Not intellectually simulated in my school
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (195)
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (195)
I tried to explain them how important it was to me, since I am not intellectually simulated in my school, and how meeting other smart colege students was imporant to me.
:-)
http://prez.wordpress.com/2006/10/16/facebook-has-a-post-limit/
Erlang vs. Java benchmarking update
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (193)
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (193)
As an update to my last post, I didn’t find an image which goes to 100.000 tasks for performance, but the Kilim guys have a graph for creating 200.000 tasks.

Perhaps they implement an supervisor architecture too. And perhaps this makes it into a future JDK.
Update: There is also a Google talks video about Kilim on YouTube.
Interesting picture: Benchmarking Erlang versus Java concurrency
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (191)
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (191)
I stumbled upon a nice Java framework called Kilim. It implements message passing in Java and it’s interesting to compare to Erlang:

As I’ve said before, usually comparing Java to Erlang is stupid, because it compares threads to actors, not Java to Erlang. Comparing actors in Java to actors in Erlang is the right thing to do. Also see Scala (Which I don’t use because it won’t make it into the enterprise and I don’t like a type-inferencing language).
SMC WGBR14-N 802.11n doesn’t work with my MacBook Pro
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (190)
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (190)
I’ve bought a SMC WGBR14-N router as a replacement for my current Fritzbox. The FB is too slow for wireless with only a small - non replaceable - antenna. I thought I could attach my Qnap 409 to the SMC draft-n router to speed up time machine backups and copying to the NAS.
Reality: The SMC drops connections and doesn’t work with either my MacBook Pro nor the MacBook of my girl friend. Most of the time there is a time out when connecting to the SMC. Both with G and N wireless modes. WPA with 802.11g on the Fritzbox works, but not on the SMC router. Connecting by wire gets me into the internet. Next week it’s going back to the dealer and I’ll try a D-Link or Apple Extreme 802.11n router. I hope for better luck.
(Is there a way to see with which mode a mac is connected to a wireless router?)
Another Rails and dynamic language fallacy concerning missing methods
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (189)
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (189)
Russell writes in the post The Dynamic Language Advantage: A Concrete Example:
“All you have to do is make the call to the non-existent method that contains your column names and Rails will dynamically generate the method for you.”
Though he got quite some flak for his opinion.
@cards = Card.find_all_by_cardType_and_expirationData(cardTypeId, expirationDate)
Which looks magic to most people and most impressive. But in the end it’s not more safe or magic than
Card.find("all_by_cardType_and_expirationData", cardTypeId, expirationDate);
This code can easily be written in any static language, becasuse the method missing property is no more safe or expressive than a String. The idea that parsing a method name from method missing is different than parsing a String in this case is a fallacy. I wonder why not more people use Strings like this to create finders? Perhaps because it’s not a good idea, as some comments in the mentioned post claim?
Thanks for listening.
The only thing that really matters in software development.
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (188)
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (188)
Catchy title? I mean it. After 25 years of programming, the only thing that really matters in software development is if a company understands the project triangle. That from the three variables scope, time and resources you can only define two. There are two kinds of companies. Those that understand this and those that don’t. Everything they do flows from there. This is what really matters about software development.
Update: There are a lot of other factors, probably people being one of the most important (think “Peopleware”). Without understanding the Scope-Time-Resources triangle your development won’t work. It just can’t. You can screw up by chosing the wrong architecture, or methodology, or screw up during requirement engineering or with the wrong language for the problem.
But from my point of view this triangle is like gravity. If you ignore gravity, all else will fail.
Unboxing as a Java Interview Question
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (187)
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (187)
Sometimes I ask an unboxing question during Java interviews. “What can happen with unboxing? See this code:”
Integer i1; ... // do some things with i1; ... int i2 = i1;
The thing that can happen is that i1 is NULL which will result in a NullPointerException being thrown.
“What is the problem with the NPE here?” There are several ones. The big one is that developers search for dereferencing variables (think “.”) when seeing a NPE. The line
int i2 = i1;
does not have a dot, the trained eye of a Java developer has problems to see the NPE there (if he didn’t encounter the bug before).
“What would you have done instead, if you would have been the Sun developer designing the unboxing feature?”
Possible answers are:
- Set
i1to the default value ifi2is null, 0 in this case (null being the default value for Integer) - Throw an
IllegalArgumentException - Throw a
ClassCastException - Throw an
AutoUnboxingException(my favorite)
It’s more about discussing design and programming decisions than getting the right answer from the candidate. With questions like this you can see how defensive a programmer can think, how he writes maintainable code and how good his micro-architecture design skills are. Often there is a dialog between the candidate and me about good design, error handling, exception handling and error messages.
What would you do?
Thanks for listening.
As ever, please do share your thoughts and additional tips in the comments below, or on your own blog (I have trackbacks enabled)
Update: This code will throw an NPE too - obviously - but from reading the isSomething() line in a large app it might not be that obvious.
public class Test {
public static void main(String[] args) {
if (isSomething()) {
System.out.println("Something!");
}
}
public static Boolean isSomething() {
return null;
}
}
Akismet has protected your site from 100,152 spam comments.
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (186)
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (186)
The title says it all. Thanks.
Update: One month later: “Akismet has protected your site from 126,559 spam comments.” 27.000 spam comments in 1 month.
Bending Java: More readable code with methods that do nothing?
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (185)
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (185)
From the category “Bending Java near it’s Breaking Point” or “What a stupid but interesting idea”. I like to explore ideas in Java that are inside the language spec but outside of common usage or style guides. I think Java has a lot more to give than what people did the last ten years. Before dumping Java perhaps we should reconsider some of the “common wisdoms” about how to do things in Java.
My last post on beautiful Java, and why to never use String ;-) got me flamed like I haven’t been flamed since alt.amiga.advocacy times. The idea was to provide wrappers around String like Name to achieve several things: Have better typed method signatures, have a fluent interface and to better convey meaning.
Customer customer = new Customer( name("Stephan") );
...
Customer(Name name) {
...
}
...
public Name name(String value) {
...
}
The flames were mostly about creating lots of small objects, which people claimed are unnecessary and unmaintainable.
An alternative implementation would be:
Customer customer = new Customer( name("Stephan") );
...
Customer(String name) {
...
}
...
public String name(String value) {
return value;
}
This implementation doesn’t achieve the same things as the solution before, but there is no new object necessary, only a new method.
But still the line Customer customer = new Customer( name("Stephan") ); is more readable than Customer customer = new Customer( "stephan" );. The Hotspot JIT should optimize the method calls away so there is no performance penalty.
A better idea? Or still too repulsive.
Thanks for listening.
As ever, please do share your thoughts and additional tips in the comments below, or on your own blog (I have trackbacks enabled). This line is shamelessly take from Daniel Tenner, who writes a really excellent blog.
300 readers milestone - thanks again
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (184)
WordPress database error: [Table 'reposita_wp.wp_post2cat' doesn't exist]
SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (184)
After my 200 reader milestone in January, we’ve reached the 300 (317) reader milestone. Thanks to all the regular readers of this blog for listening. I know 300 is still not as many readers as others have, and it might drop below 300 the next day, but I’m still thankful for everyone of you (including those with comments who prove me wrong - as happened in the last posts - or whose comments make an interesting reading :-)
