Thursday, September 30, 2010

JavaScript Unit Testing

YUI Test is probably the best JavaScript testing framework I've found so far. Check it out here.

I have still yet to find a way to call YUI test from a Continuous Integration environment. The default way to call it is by running the website to be tested, but there should be a way to call it remotely and make sure the test passed.

Wednesday, September 29, 2010

This is speed!

I am getting a download speed up to 3500 KB/sec!!

Sunday, September 12, 2010

Windows 7 crash

My first Windows 7 crash!! This is the log:

The computer has rebooted from a bugcheck. The bugcheck was: 0x00000101 (0x0000000000000019, 0x0000000000000000, 0xfffff880009b1180, 0x0000000000000004). A dump was saved in: C:\Windows\MEMORY.DMP. Report Id: .

ArcMap 10: Definition query not working on a layer with joins

It seems this was a defect on previous versions of ArcMap, but I recently came across it in ArcMap 10. I am not an ArcMap 10 expert, but I am pretty sure I set it up correctly.

A possible workaround is doing this in a different order: creating a definition query and then setting up the joins. This may work for most scenarios, except when the definition query is dependent on the joined data.

Saturday, September 11, 2010


It seems to me that the ArcGIS 10 REST API is good for -really- simple applications, but it's not something I would use in an enterprise application. Specially one that needs complex queries. Also, it has some problems and doesn't work correctly all the time. The latest problem I came up with is related to spatially querying joined tables. In my case, the spatial query didn't filter any records, it was like it wasn't even being run.

Of course, there's always the option of not using joins (and give up good database design). Not an option for me, so I'll check if there's a workaround.

Friday, September 10, 2010

esri.layers.FeatureLayer is not a constructor

I received this error when using the ArcGIS JavaScript API. After doing some digging, it turned out that esri.layers.FeatureLayer was undefined (because the API was not loaded) when I was calling it.

Al the API examples show that dojo.addOnLoad should be used but I was using Ext.onReady (another JS API). This was causing the problem because when Ext.onReady was executed the AGS JS API was not loaded. I had to use dojo.addOnLoad to make sure that when I call esri.layers.FeatureLayer it is actually loaded.

Monday, September 6, 2010

JavaScript MVC

This article provides a great start to implement the MVC pattern. I would argue, however, that it can be improved because it doesn't match the definition of MVC from Wikipedia.

One of the problems with the article below is that the View knows about the Controller and the Model, when it should only know about the Model. Although there is at least another problem (hint: the controller doesn't know about the View), it is very easy to fix and you get a perfect implementation of JavaScript MVC.

I am doing this with ExtJS, I'll post some code after I get it to work.