Software development woes. Java-based development in particular. Also, philosophizing, architecture, design.
Thursday, March 29, 2012
Inner Override
It would be logical, consistent, useful, great and simply awesome if one could override inner classes in Java. IUSWIM.
Wednesday, March 28, 2012
Glassfish School
Error now:
Exception Description: Mapping annotations cannot be applied to fields or properties that have a @Transient specified. [field playlists] is in violation of this restriction.
at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:221)
So, Glassfish also belongs to the school of providing the minimal amount of
useful information. "[field playlists]" ok, but WHAT CLASS!?
Sunday, January 8, 2012
By The Way, CSS Is a Bad Idea
Updated Safari the other day. Safari 5.1.2, specifically. Issues:
- Seems that CPU usage is unreasonably high for some changes to attributes matched by CSS rules.
- Now, it seems, when updating an DOM element attribute, the change is not re-rendered until mouseout.
I offer you the following hypothesis: that this change has to do with CSS complexity; maybe adding the new types of rules (CSS3, CSS4?) or changing CSS rule matching algorithm increases calculation algorithmic complexity in specific patterns.
And these are useful patterns, I'd say. The pattern I suspect goes like in this CSS:
[var_attr=X] [attr=X] {...}
Which is useful in many situations. For instance for GUI components with multiple parts that you want to reflect a particular state, like On/Off, Active/Inactive:
.component[var_attr=off] .part1[attr=off] {...}
.component[var_attr=on] .part1[attr=on] {...}
.component[var_attr=off] .part2[attr=off] {...}
.component[var_attr=on] .part2[attr=on] {...}
And then you can set the state of the component by changing only one attribute. There are alternatives, of course: removing and adding classes, but that's even uglier. Or using JavaScript, which is probably the right thing to do anyway.
Back to guessing the Safari inner workings: they added a new rule matching engine to accomodate new CSS rule patterns, perhaps the 'parent' matching rule (so far, everything has been matching inwards only, if you see what I mean), using a new algorithm, which breaks badly in the above patterns. Then, they added the "don't re-render until mouseout" rule to cope with a slower algorithm. Which is what IE8 seems to do too, so maybe this is suggested standard behavior to cope with slowness? Remember, just a guess of mine, of course.
I've googled around a little to find information about CSS, especially I'd like to find some information on its algorithmic complexity. Hard to find. I found some papers on parallelizing web page rendering. That might tell you something.
This, http://www.eecs.berkeley.edu/~lmeyerov/projects/pbrowser/pubfiles/paper.pdf, is a good paper of 2010. Quote, to support the CSS denouncing to follow: "Due to the weak abstraction mechanisms in the selector language, multiple rules often use the same selectors.". CSS has abstraction? :) Well, within itself it does not. It only provides one layer of indirection. Presumably to make CSS intuitive to non-programmers.
My opinion on CSS: it is big mistake, still to unfold. It has un-over-come-able problems. It is not scoped and has no definitions, only rules; which is bad for composability. I suspect it has terrible worst-case algorithmic complexity. It is declarative, but in an unstructured way.
It will cost the web dearly. I could of course go on and write about what are, to my mind, better solutions; maybe some day soon. But for now, a prediction: just like NoSQL, which I really do see as having some really good points -- especially as far as the SQL language goes -- we'll soon see a NoCSS movement. I, for one, am about to rewrite some CSS into JavaScript right about now.
PS. More pages found ("computational complexity" instead of "algorithmic complexity"):
- http://lambda-the-ultimate.org/node/3810. LtU of course! And on the 'general CSS critique' topic: http://lambda-the-ultimate.org/node/3810#comment-55916.
Thursday, December 15, 2011
Maven. Just...Maven
It has come to my attention....no, it has been forced to my attention, that maven is even more interesting than I knew.
It can download poms and jars and shit from repositories. Well, that's a known fact. The new brilliantly interesting part is the 'shit'. Maven will say hello and please give me a pom or a jar to a repository website; and the repository might say ok, well, I've been moving around, here's a redirect to my new location, and then the new location might be the web page for humans of the repository, and maven is not human, so it can't read that page, and will download it in place of the jar or pom.
It will know that the data is invalid. But it is polite and will say thank you repository website, and just like all us millions of humans at christmas, it will definitely not refuse the kind gifts, but actually keep it. It will warn me that it is invalid, but, it will definitely store it, and not try to replace it. So you have to do it manually. cd .m2/, find . | grep shit, rm -rf repository/that/shit. Or just erase the whole of .m2/repository. Or make that the whole .m2/, you might have old and stale settings.
Maybe there is some 'clean-up' command. Or maybe not.
Well, sort of what you can expect when trying to build a project that hasn't been built for a year or so -- there is something called bit rot.
So...back to solving the other upwards of a hundred 'Missing artifact' errors. Parting advice: avoid dependencies :)
EDIT.
Returning 403 is also not a good idea (not the same repo). Is this bad luck, or what? Two repositories each breaking the build.
It can download poms and jars and shit from repositories. Well, that's a known fact. The new brilliantly interesting part is the 'shit'. Maven will say hello and please give me a pom or a jar to a repository website; and the repository might say ok, well, I've been moving around, here's a redirect to my new location, and then the new location might be the web page for humans of the repository, and maven is not human, so it can't read that page, and will download it in place of the jar or pom.
It will know that the data is invalid. But it is polite and will say thank you repository website, and just like all us millions of humans at christmas, it will definitely not refuse the kind gifts, but actually keep it. It will warn me that it is invalid, but, it will definitely store it, and not try to replace it. So you have to do it manually. cd .m2/, find . | grep shit, rm -rf repository/that/shit. Or just erase the whole of .m2/repository. Or make that the whole .m2/, you might have old and stale settings.
Maybe there is some 'clean-up' command. Or maybe not.
Well, sort of what you can expect when trying to build a project that hasn't been built for a year or so -- there is something called bit rot.
So...back to solving the other upwards of a hundred 'Missing artifact' errors. Parting advice: avoid dependencies :)
EDIT.
Returning 403 is also not a good idea (not the same repo). Is this bad luck, or what? Two repositories each breaking the build.
Sunday, August 8, 2010
Vansklighet av planering
Vardaglig förklaring av vanskligheten av planering:
http://ulrikapark.wordpress.com/2010/08/08/sloseri-med-resurser-att-specificera-innan-utveckling/Jag tror jag skulle vilja återkomma i detta ämne.
Pig Analogy
This must be one of the Worst Uses of Analogy Ever:
http://www.implementingscrum.com/2006/09/11/the-classic-story-of-the-pig-and-chicken/
...and there is a comment there along that line:
http://www.implementingscrum.com/2006/09/11/the-classic-story-of-the-pig-and-chicken/#comment-1487
Subscribe to:
Posts (Atom)