Showing posts from October, 2008

Hemnet & Eniro launched!

After working last year at Eniro maps to introduce the "utsikt" images (images taken from an airplane at a 45° angle), we have today successfully launched the integration of Eniro maps on Hemnet, Sweden largest site for real-estate. During the project I acted as a javascript programmer and as a scrum master together with Torsten Ek as projekt leader and the cordination of Johan Ljung. I also introduced a lot of javascript unit testing, it was pretty cool!

Encoding of included JSON files

Lately I had a problem with a page which was including two JSON scripts, one encoded in UTF-8 and the other encoded in ISO-8859-1. In some circumstances (and in some browsers) the strings where not showed correctly. Hunting down the problem required a good dose of my favourite tool wget -S where the -S option causes the http response headers to be printed on stderr. My conclusions are that: if a page uses a certain encoding (as specified by the charset on the page and/or the Content-Type http header) the included javascript will be handled with the same type of encoding if nothing else is specified In Firefox, if the http response of the javascript contains the "Content-Type" header with a charset value, the file will be treated as using this encoding In Internet Explorer 6 (and 7?) the http headers are ignored and you must explicitly use the charsets attribute of the script tag to force the correct encoding In other words, to make a script inclusion cross-brows

Maven and the encoding of Java files

I was mavenizing a java project (I was using ant earlier) on my macbook and I realized that since I was using UTF-8 on my macbook the files were compiled using UTF-8 instead of ISO-8859-1 (some strings where corrupted). The solution is to add the encoding parameter to the maven-compiler-plugin [source:xml] <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> <encoding>ISO-8859-1</encoding> </configuration> </plugin> [/source]


This is just a list of things I think you should master if you want to be a good web programmer (and not only) * Unit testing * Refactoring, you must have a copy of Refactoring: Improving the Design of Existing Code * Design Patterns, read Design Patterns: Elements of Reusable Object-Oriented Software * Dependency injection and why you should use it (and if you use java what is Spring )