I have a complex form with FCKEditor and some Jquery, today i was debugging an issue where a function run after a form action would just magically stop halfway through. I eventually did alert(functionName) which in firefox dumps the function code.
To my suprise the dumped function missed the last line which called the next function in the chain. View source confirmed that the code was as i wrote it. So I edited the function, moving the text around (figuring whitespace might be that affecting it!) and refreshed and this time it worked, the dumped function had the last function call.
Problem solved. On to the next one
Thursday, April 10, 2008
Strange javascript bug, functions loosing lines?
Mapguide Openlayers Sheboygan tiled map example
Here is a demo of using a Mapguide tiled map with OpenLayers, the OpenLayers Mapguide example doesn't have an example for a map you can access yourself like the Sheboygan sample.
The secret source to getting it working is
var extent = new OpenLayers.Bounds(-87.865114442365922,43.665065564837931, -87.595394059497067,43.823852564430069);
var tempScales =[1000,1930.6977300000001,3727.5937199999998, 7196.8567300000004, 13894.95494,26826.95795,51794.746789999997,100000];
Documentation for for OpenLayers.Layer.MapGuide & Mapguide Example
Following my testing, I believe the tiled map's under mapguide have a bug which relates to the tile grid not being correct
Wednesday, April 09, 2008
Build notes for Mapguide 2.0 on CentOS
My notes when following these build guides: BuildingAndConfiguringMGOSOnLinux.pdf and OpenSourceBuild__README.html
My Linux knowledge is rather average, i know bits and have used it for over 10 years on and off, occasionally some Solaris, but i am by no means an expert.
- It's not supported yet on 64-bit Linux, use a 32-bit version
- Make sure you install the GNOME Software Development packages, otherwise you will hit an error with xslt-config being missing (libxslt-devel libxslt) but this was a big hassle on RHEL 4.
- If your using Vmware Player and your on a dual core machine, add numvcpus = "2" to your .VMX file to use both CPU's otherwise you'll only ever see 50% CPU usage
- I started with RHEL 4 and then switched to using CentOS coz i didn't have a Redhat Network account which gave me access and yum wasn't playing nice for some reason (couldn't find packages?) where as CentOS just works with any login requirement.
- I used the thoughtpolice vmware image @ http://www.thoughtpolice.co.uk/vmware/#centos4.6
- For Centos the Yum Extender is pretty good for managing packages, use "yum install yumextender"
- I built the FDO, i believe the prebuilt RHEL4 fdo binaries get installed to /usr/local/fdo-3.3.0/lib , the download notes don't make that clear (i guess it would be better as an rpm really?).
- If you have the apr packages installed that will break apache if they are the 0.94 versions, the error message i got was "undefined reference to 'apr_os_uuid_get'". I just removed the package, which did uninstall the default apache httpd and other stuff like subversion also depends on (so it's the wrong thing to do!).
- SSH is your friend :) I use Putty and Winscp on XP
- I changed the fdo build_thirdparty.sh and build_linux.sh from #!/bin/sh to #!/bin/bash after i hit "acinclude.m4:7: warning: underquoted definition of FDO_HELP_STRING"
- Nabble FDO Users and Mapguide are the best source of information and the best place to ask questions for this stuff. Just search before you ask!
- uncomment the lines: AddHandler mgmapagent_handler fcgi and LoadModule mgmapagent_module modules/mod_mgmapagent.so in /usr/local/mapguideopensource/webserverextensions/apache/conf/mapguide.conf or you will get the mapguide.fcgi binary returned :(
- I had a font problem, almost wingdingy which was solved by copying verdana.ttf from /usr/share/fonts/msttcorefonts
phew
BTW My Wmare image ended up being about 6.8 Gb at the end
Sunday, April 06, 2008
CFCHART tips
The charting component in Coldfusion is really quite flexible and useful.
Beyond the basic embedded styles, you can use the built in editor for the
CFCHART underlying engine, WebCharts3D.
C:\ColdFusion8\charting\webcharts.bat
Using this you can modify the style for any graph, and there's a lot
of possibilities.
The first thing i changed was turning off the animation for the flash graphs
by changing <morph morph="grow"/> to <morph morph="none">
The other default option (it's a change from the CF 7 behaviour in CFMX) is to disable the auto-interpolation. Basically, when it's enabled, any missing data will be filled in with estimated values, which is very frustrating when you don't know about it!
Thankfully I found this livedocs comment which grabbed my attention more than the change notes in the doco.
by changing this at the top of the XML style file
<frameChart autoAdjust="false" is3D="false" isInterpolated="true">
to
<frameChart autoAdjust="false" is3D="false" isInterpolated="false">
Given how easy Coldfusion is to use, i would suggest it's worth trying out if you are going to do some database driven web based charting.
I was suggest that you don't ever modify the file in the default styles directory, always make a copy in your application tree, that way it will minimise deployment hassles and we all hate them don't we?
Friday, April 04, 2008
Newstopia is brilliant!
Newstopia was great this week, check it out before next wednesday, coz this weeks espisode was a pearler :)
that's also for anyone not in Australia or who can't receive SBS
trust me, it witty, funny topical stuff
Friday, March 21, 2008
Wednesday, March 05, 2008
A quick howto to setup JMeter
JMeter is an open source load testing tool, it's pretty easy to get up
and running and it's quite fun to test and break things on your own server.
Here's a quick getting started guide on how to record a simple test plan.
Download and install JMeter
Open Jmeter (bin/Jmeter.bat on Windows)
Add (via right click) a Thread group to the Test Plan
Add a Non Test Element > HTTP Proxy Server to the Workbench
Open the HTTP Proxy Server Page and change the port if required
Set the Target Controller to Test Plan > Thread Group on the same page
Configure your browser (Firefox!) to use the Proxy Server (it's localhost)
Press Start at the bottom of the page
Now, JMeter will record all the HTTP requests your browser makes, so make sure you have closed all the other tabs you have open, otherwise you will get a mixture of Ad's and ajax requests recorded as well.
As an example, tonight I was doing some load testing on the Tile service for Mapguide, so I opened a map and zoomed in and panned around a bit. Then I pressed Stop in JMeter and I had a list of HTTP requests. Simple!
Don't forget to reset your browser proxy settings!
You can delete any requests you don't want from the list at any time.
Add a Timer > Gaussian Random Timer to the Thread Group which will make the requests random.
Add a Listener > Aggregate Report to the Test Plan
Now for the first run, the default load setting is fine.
Select the Aggregate Report and the from the top menu click Run > Start
If that worked out ok and there are no errors, you can the configure the thread group to run multiple times with multiple users. You can see I had an error rate of 100% in the example above.
If you get errors, check your webserver and application server logs. You can also log and view each http request and response using Listener > View Results in Table. Filtering to only show errors is also helpful.
If you are running a big load test, remember each Listener keeps a copy of the results in memory so you might be better running a Listener > Simple Data Writer instead which writes the results out to a file. You can then read the file in later into any of the reports.
Overall it took me a bit of time to get familiar with JMeter, there's lots of cool things you can do with it. Keep in mind session handling (cookies) for dynamic applications as well!
Remember to read the documentation and be careful! Make sure you know what servers will be affected by your testing, and don't jump to simple conclusions, 3-tier web apps are complex beasts.
I have seen developers trying to solve a performance issue and completely misunderstanding the problem. Then they go and try and solve the wrong problem, usually involving lots of wasted coding.
Always start with a smaller load, you better off finding and fixing a bug which occurs often under low load, than an obscure bug which occurs only under extreme load.
Monday, March 03, 2008
EPSG for Australia
http://spatialreference.org/ref/epsg/3112/
http://spatialreference.org/ref/epsg/4283/
for things like PSMA & GA datasets
notice that Tassie looks better and australia isn't so wiiiide in EPSG:3112
tho, generally speaking EPSG:4283 is better choice as it's there out of the box
Oracle didn't have EPSG:3112 so i created one, EPSG:4283 is srid 4283
INSERT INTO mdsys.SDO_CS_SRS ( CS_NAME, SRID, AUTH_SRID, AUTH_NAME, WKTEXT )
VALUES ('GDA94 / Geoscience Australia Lambert', 3112, 3112, 'EPSG',
'PROJCS["GDA94 / Geoscience Australia Lambert",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6283"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4283"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",-18],PARAMETER["standard_parallel_2",-36],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",134],PARAMETER["false_easting",0],PARAMETER["false_northing",0],AUTHORITY["EPSG","3112"]]'
);
COMMIT;
Sunday, March 02, 2008
Free public transport in Melbourne? Maybe.....
Over at The Age is a story about yet another IT disaster when it comes to developing a new electronic ticketing systems for Melbourne.
Passengers face $500m ticket chaos talks about the 15 month over due 'mkyi' system still being MIA and the old MetCard system being about to fall over. They can't get any new machines for the slightly expanding network and some spare parts aren't available anymore.
Time to stop wasting money on ticketing systems and make public transport free.
It will never happen because the politicians are scared about having to spend a lot more money on expanding the transport network. The logic behind that is that if it's free, we all pay for it and therefore all suburbs deserve the equal service.
Now that would be progressive green politics, carbon friendly and just think how much closer the whole community will become from more BO on even more crowded trains...
Did you know the control system Metrol for the Met in Melbourne dates back from the 70's, it's why they can't increase the frequency of the network at least until when the new one, cough, is meant to go into service in 2010
Mapguide 2.0 Released - PNG8 Goodness
I have really enjoyed helping test on the new Mapguide 2.0.0 Release, it's a bit slower than the previous release, but that's not so much an issue if your caching everything heavy using tiled maps.
One of the new features is support for PNG8 images. You can configure the tile service to use PNG8 in the serverconfig.ini under the [TileServiceProperties] Imageformat parameter, the header comments don't mention it yet, here's my patch.
It would be nice in the future for the tile format to be configurable in the Map Definition per Base Layer Group, rather than a server wide setting.
Here is a True Marble Tile using PNG8 (36.98 kB) 
The same tile as a 24 bit PNG (135.26 kB)
You can barely visually tell the difference, basically there is loss of detail of a black shadow next to the coastline, but there is 100kB difference in file size per tile.
That adds up to well over 1 MB saving per map, depending on you map size. That's 1GB over 1000 page impressions for a page containing this map. That is a huge improvement ! I will investigate later the savings for non-raster tiles
There is also the Fusion framework for doing flexible layouts which also includes the Native Mapguide Layer support for OpenLayers which rocks!