Open letter to Fefe
Submitted by struppi on Thu, 2007-01-18 17:28. GeneralDear Fefe,
could you please tag all articles in your blog which are not about computer security or conspiracy theories with "rants about things I have absolutely no clue of" so it is easier for me to filter them out? Ok, I guess it's easier to remove your blog from my feedreader. Done now.
David.
(Ok, I didn't really send this to him b/c this would be too impolite, but I wouldn't mind if he reads it either).
TDWTF: The Complicator's Gloves?
Submitted by struppi on Wed, 2007-01-17 08:10.
For those who didn't read the article on The daily WTF yet, do it now! (The image is from The daily WTF too).
Moods @davidtanzer.net
Submitted by struppi on Tue, 2007-01-16 14:18. GeneralSince last week I am running an experimental "Mood" - service here on my site. It all started when I felt the need to post a smiley somewhere because I was listening to some cool music last friday, so I created a page with the content:
2007-01-12 15:52 d^_^b
When Manu saw this, she asked me if she can have such a page too. Then Jürgen ("Schorsch") and Jani followed. Today I did some PHP hacking which displays the newest entry on every mood page on the overview page:
And now I thought this deserves a frontpage story too ;-)
BTW, if /you/ want a mood page too, just ask nicely, I might create one you can edit. Just email to "mail -at- davidtanzer -dot- net".
WriteRoom
Submitted by struppi on Sun, 2007-01-14 11:03. GeneralI just found WriteRoom via this entry in Geir Magnusson Jr.'s blog. It's an editor which goes into full-screen mode and looks really simple. The licensing scheme is that you pay just about 24$ if you like the software, so I'll evaluate it now for some time and pay if I use it frequently.
NullPointerException in FileUploadBase.createItem of jakarta commons fileupload: Solved
Submitted by struppi on Tue, 2007-01-09 10:14. JavaI just had a problem with a NullPointerException in jakarta commons fileupload. This is the code I was using:
ServletFileUpload upload = new ServletFileUpload();
try {
List items = upload.parseRequest(request);
/* ... */
} catch (Exception e) {
e.printStackTrace();
}
And it yielded this exception:
java.lang.NullPointerException at org.apache.commons.fileupload.FileUploadBase.createItem(FileUploadBase.java:500) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:116) ...
The problem here was that I didn't set a FileItemFactory in the constructor of ServletFileUpload. The correct code would be:
FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory);
Other reasons of this exception can be found in the mailing list of the project here. I don't think the NPE is very helpful here, so I have created this issue in the JIRA of commons fileupload, if you are interested in the status of this issue.
Update: Wow, that was fast. The bug is already resolved: Find the JIRA issue here. Good work, Jochen Wiedmann and the jakarta commons fileupload team!
iBATIS problem with paginated list + session timezone
Submitted by struppi on Mon, 2007-01-08 16:29. RDBMSI have another strange problem with iBATIS: I get a field from the Oracle database which is of type TIMESTAMP(6) WITH LOCAL TIME ZONE. This requires that you manually set the session timezone in the Oracle database session:
connection = DriverManager.getConnection(url, username, password);
((OracleConnection) connection).setSessionTimeZone(TimeZone
.getDefault().getID());
sqlMap.openSession(connection);
sqlMap.queryForPaginatedList("mapped-statement", parameter, pageSize);
This works fine, and i can call the method nextPage() on the paginated list several times, and it works until suddenly, aver 20 or so successfull calls to this method it throws the following exception:
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/.../SomeSqlMap.xml. --- The error occurred while applying a result map. --- Check the SomeSqlMap.mapped-statement-AutoResultMap. --- Check the result mapping for the 'timeStamp' property. --- Cause: java.sql.SQLException: Session Time Zone not set! Caused by: java.sql.SQLException: Session Time Zone not set! at com.ibatis.sqlmap.engine.mapping.statement.PaginatedDataList.pageForward(PaginatedDataList.java:55) at com.ibatis.sqlmap.engine.mapping.statement.PaginatedDataList.nextPage(PaginatedDataList.java:145)
I once looked into the implementation of the paginated list before, and I guess the problem here is that the paginated list executes the query each time nextPage is called and simply skips the first pageSize*n rows of the result set. Here it seems to use the wrong connection object at some time. This implementation is not correct anyway (executing the query multiple times and skipping rows), because the DB might change the sort order or rows might be inserted between 2 query executions.
Of course, the other problem here is that the worst RDBMS in the world throws an exception here instead of just assuming a default time zone. So, I'd say both iBATIS and Oracle are guilty here.
Looking for IT jobs? Find them at The Hidden Network.
Java: Reflection-Annotation-Class not found problem
Submitted by struppi on Thu, 2006-12-14 17:10. JavaI just ran into a problem which was quite tricky to find in a framework I am currently using. This framework has an annotation which takes a class argument. It is used to tell the framework that your class needs an implementation of a special interface although it has no direct dependency to this interface. This seems a little bit strange to me, but it is used in cases like:
@Needs(Scheduler.class) class MyClass { ... }
The code above tells the framework that some kind of scheduler should be running since this class should be scheduled. (To be honest, it still doesn't make much sense to me. This still doesn't mean that the class really will be scheduled. And if the application is configured to schedule jobs then there will be a scheduler. Always.). Anyway, let's continue with the problem. This annotation would be used by the framework to look up any implementations of the interface Scheduler in the classpath, and if it finds none it would report an error.
Now, the problem occurs when even the interface Scheduler is not on the classpath, which can happen because it is not in the main jar file of the framework. It's in the scheduler jar file. Of course. Now, when the framework tries to get the annotations of MyClass the JVM says goodby with this nice message:
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:653) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:460) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:286) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3071) at java.lang.Class.getAnnotation(Class.java:3028) at java.lang.Class.isAnnotationPresent(Class.java:3041) ...
Since MyClass is not the only class which is initialized that way, and there is absolutely no log output which class is initialized at the moment, this was pretty hard to find.
Looking for IT jobs? Find them at The Hidden Network.
Funky LOC comics
Submitted by struppi on Sat, 2006-11-25 09:18. GeneralManu has published two strips of her Funcy LOC comics - A comic where lines of code are the stars. Really worth reading, way to go, Manu!
(I just realized that I have no "Fun" - section here in my blog. Maybe I should create one. But OTOH I don't think I am really funny, so I'll file this one as "General" ;)
Looking for IT jobs? Find them at The Hidden Network.
Apple rant by fefe
Submitted by struppi on Wed, 2006-11-22 08:40. GeneralUpdate: After some email conversation Fefe has updated his blog post.
Sorry for the (partly) german post, this is my answer to this rant by fefe.
[Snip] To: [Felix von Leitner's email adress] From: David Tanzer [email adress snipped] Subject: Apple-Rants Date: Wed, 22 Nov 2006 09:37:28 +0100 Sag mal, liest du eigentlich die Artikel bevor du irgendwelche rants wie z.B. diesen hier (http://blog.fefe.de/?ts=3Dbb9ac349) schreibst? Wenn ja dann sollte dir aufgefallen sein dass die ein unkomprimiertes Video gestreamt haben, deswegen die Datenmenge von 125 GB für das 2 min Video. Und dass sie die 12 clients verwendet haben da sie das Video auf eine tiled wall projiziert haben (also haben sie eigentlich 12 streams abgespielt). Und die 7,5 Gb/s werden sich dann wahrscheinlich genau aus der Datenmenge ergeben haben (hab ich jetzt nicht nachgerechnet, da du ja sowas auch nicht machst). Siehe auch: http://it.slashdot.org/comments.pl?sid=3D207776&cid=3D16939060 lg, David.
Java RI is open source now
Submitted by struppi on Mon, 2006-11-13 12:11. HarmonySun finally made the reference implementation (RI) of Java open source under the GNU General Public license. Here is a press release on lycos news. Althogh I was hoping for a different license choice (like the Apache License) this is really good news. As Dalibor Topic once said: "More free software is never a problem" (I hope I remembered this quote correctly). Really, there is more free software in the end. This is A Good Thing (tm).
Mark Wielaard wrote in his blog about this and he provides some interesting links in this posting. Finally, Geir Magnusson Jr. wrote some postings in his blog about Sun's JDK and the GPL, but the linked posting and those before were written before the announcement from sun.
Update: Roman Kennke has a more detailed posting in his blog where he also speculates what this move could mean for GNU Classpath and Apache Harmony.
Update 2: 2 more postings by free runtime developers: One from Mario Torre (GNU Classpath) and one from Geir Magnusson Jr. (Apache Harmony). Both include speculation about what Sun's move could mean for the 2 projects.
Looking for IT jobs? Find them at The Hidden Network.





