Archive for the 'Programming' Category
Why debuggers are bad
Tuesday, April 21st, 2009Debuggers are useful
They make you run an application and inspect variables while you a running the real thing
They make you debug code and quickly find bugs
You set a breakpoint somewhere, you run your application, it stops where you want and let you inspect variables and more.
Debuggers are bad
They make you debug code instead of writing [...]
Respect for JavaScript
Tuesday, April 7th, 2009Surfing around I found this cool video of Doug Crockford, the man behind JSLint and JSON. He surely is a funny guy
OnTheFly
Thursday, March 19th, 2009I Just published on github a tool to concatenate JavaScript and CSS files on the fly to speed up the development process when using large code base. Check the project page
Hemnet & Eniro launched!
Thursday, October 23rd, 2008After 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 [...]
Encoding of included JSON files
Tuesday, October 7th, 2008Lately 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 [...]
Agilitá
Thursday, October 2nd, 2008This 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 [...]
maven-script-ant and the maven.test.classpath
Friday, September 19th, 2008When using the ant-run plugin you can get references to the maven classpaths in the ant fragment
Those are the ones available:
maven.compile.classpath
maven.runtime.classpath
maven.test.classpath
maven.plugin.classpat
I tried to build an ant plugin for maven as explained in http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html to refactor out the ant fragment and all went smooth until I needed a reference to the maven classpath.
I just assumed I [...]
onresize event and prototype
Tuesday, September 2nd, 2008If you need a compact way to use prototype and listen to on onresize event in a cross-browser manner, this is the way to go:
Event.observe(document.onresize ? document : window, “resize”, function() {//dostuff});
As you can see, the event to listen is resize but depending on the browser, it may be fired on either the window or [...]
Object.extend, an example of inheritance
Tuesday, September 2nd, 2008Updated: my previous attempt to simulate inheritance in javascript using Prototype.extend did not work as I expected so I removed the example I had written.
Inheritance can be defined in several ways. The definition of inheritance I will use in the following example is: A child class inherits from a parent class if all methods of [...]
onmouseover / onmouseout and nested divs
Friday, August 29th, 2008I had never noticed a behavior which left me astonished
If you have two nested divs and are listening for the onmousover event on the parent div, you will get a onmouseout event when entering the nested div!
parent div
Nested div
As I see it, since the mouse has not left the area covered by the red [...]