Diving head first in the Custom Google Maps 
Tuesday, November 13, 2007, 05:33 AM - Technology
Over the last few weeks I have been dreaming up a great idea for a Web 2ish mash-up project. Unfortunately I don't really know very many people other than me that would actually use it, but I think I'm going to build it anyways in the time that I should probably be sleeping or doing pretty much anything else in the world besides sitting at a computer... I know you want to know what it is, but I am not going to tell you. My eager audience will have to wait until I have some sort of prototype online before I am going to spill the beans.

However this much I am willing to give up; on my way to stage one of the development process I discovered that apparently the entire world thinks that it's dirt easy to create your own Google Maps, I disagree. Google has provided a very nice and simple Javascript API to interact with the mapping service, but that wasn't the part I found frustrating. Additionally mapki has provided a "Step by Step" set of Instructions to make it even clearer how to use the Javascript API. The part that hung me up was taking these high resolution, giant images of mine and easily cutting them into Google Maps usable pieces.

The first thing I tried is the following Web Site, this timed out every time I tried it.. and provided me with a bunch of data that I didn't fully understand and didn't feel that I really needed to understand to accomplish my goal. As the combination of this and the Command Line Cutter I wound up with a tmp directory full of files without extensions, and two hours of monkeying around with ImageMagick modules. After editing the bash file and alternating png compressors I finally gave up and moved to the ruby side. Ym4R Tools looked promising, but required me to install RMagick and still I had to comma delimit all kinds of numbers from the atlas.free.fr site as arguments to make this script do anything. I finally found myself with 5 gigs of mostly black images, not totally sure if it had done what it was supposed to and even more confused about what to do with this whole mess of files after it finally stopped running.

At this point I felt like giving up, not completely because of the technical frustrations but because after one spends so long trying to accomplish the first task in a large list of tasks to complete a project it sort of seems hopeless. As I sat and watched Weeds, Journey Man, Metalocalypse and many episodes of Family Guy I started thinking about this situation and how bizarre it is that this seemingly simple and common task didn't yield a more straight forward out of the box, satisfying solution that would give me instant gratification encouraging me to move the the next step in my project.

Working in Open Source and dealing with relatively strange and complex problems all day long I was surprised that in all of the hugs amounts of projects that popped up on my Google search, none really gave me what I wanted until somehow I wound up at the Holy Grail of exactly what I wanted, and it's project page is in ASP, and the app is written in Java. I have never heard of 'The Centre for Advanced Spatial Analysis (CASA)' or the University Collage London, but I thank you immensely for this software called The Google Maps Image Cutter. The simplicity here is refreshing, who said that JAVA GUI apps were useless (you know who you are.)... this one hit a home run with me today.

This amazing JAVA based GUI application, allows you to open the image you would like to GoogleMapperIze, drag a scroll bar to configure the zoom levels and quickly generate all the images you need in one directory. Not only that but it also generates you an HTML page with all of the Javascript source to instantly see the thing working. And to take you one step closer to serving your custom map to the whole world, they even leave you a place holder to insert your GMaps API Key to get you live.

Granted, the naming convention they used for the generated Images makes absolutely no sense and is pretty hard to follow and the algorithm used for computing the filenames being served is pretty a bit ugly, the thing just WORKS. And this will be providing me all kinds of progress, but mostly that immediate gratification needed to drive me on to the next task.

Thank you Internets, you magnificent series of tubes, I shall now bobsled off into the night.

2:36 AM, over and out.
add comment   |  0 trackbacks   |  permalink   |  related link   |   ( 2.9 / 96 )

Safari 2 and Math.random() 
Friday, October 26, 2007, 05:01 PM - Web
We have had a couple weeks discovering interesting problems in Javascript, and one that I had been seeing for a long time but finally had a chance to dig into a couple weeks ago before the Windmill 2.0 release was a problem in Safari 2 with Math.random().

This first showed it's gnarly teeth in an algorithm I had written to generate a random user every time you ran a test suite, so I didn't have to think about conflicting users and I didn't want to remove the user at the end of every test run because it is important for us to grow that database and see how it performs.

Here's the code that enabled the problem:

var getRandomKey = function () {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var len = 16;
var str = '';
for (var i = 0; i < len; i++) {
var rnum = Math.floor(Math.random() * chars.length);
str += chars.substring(rnum, rnum + 1);
}
return str;
};


(excerpt from fleegix_js/trunk/plugins/hash.js)

This worked great on every browser except Safari, where I had to delete my user from the last session every time I ran the test suite. The Math.random() in Safari uses the same starting point and same algorithm to generate the random number used, so that each time you start your browser and generate a Math.random() you get the same value, not very random is it?

Our solution to this problem is demonstrated below, you make want to tweak it even more dependent on your requirements.

var getRandomKey = function () {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var len = 16;
var str = '';
var mls = new Date().getTime();
for (var i = 0; i < len; i++) {
// In Safari 2 Math.random returns the same random
// sequence after firing up the browser -- return
// something randomish
if (navigator.userAgent.indexOf('Safari/41') > -1) {
rnum = (((mls / (i + 1)) + mls) % chars.length);
}
else {
var rnum = (Math.random() * chars.length);
}
rnum = Math.floor(rnum);
str += chars.substring(rnum, rnum + 1);
}
return str;
};


My original fix was to simply rip a piece of Date().getTime() and append it to the string in Safari, but mde's implementation above is a bit more elegant and generates a string of the same length for every browser.

A week later we were investigating a bug in the Cosmo UI breaking intermittently in Safari which finally brought us right back to this bug. Over time Safari users were generating event's in the DB and the code to do this obviously used Math.random() as part of the algorithm to generate the event's ID, as these were propagated to the DOM when building the UI to display these events we wound up with multiple events with the same ID which caused some serious problems.

Hope this helps someone out there with their terrible Safari bug they haven't figured out yet!
add comment   |  0 trackbacks   |  permalink   |  related link   |   ( 3 / 270 )

Windmill 0.2 Release 
Wednesday, October 17, 2007, 03:31 PM - QA
Yesterday we pushed out the 0.2 release of Windmill to the eagerly awaiting world of QA. (If you want it installing while you read on, 'easy_install windmill')

For those of you who aren’t familiar with Windmill, it is a framework we have built at OSAF for automating tests against our Web Calendar User Interface. In other words, it’s a slick way to save yourself some time by creating tests that will insure the quality of your web page as you are developing them. We at OSAF have some very advanced needs for the project, so the more you use it, the more you will discover all of the other features that make it as impressive as it is.

A few months ago Windmill became an official OSAF project and has been gaining steam every since. After a long period of working out glaring adoption blockers we came out of stealth mode to present at OSCON in Portland and are now actively building our community.

We have made the setup process as easy and well documented as we possibly can, and encourage anyone interested to install windmill and give it a try. We do our very best to respond to all outside feedback, and make ourselves available in the IRC channel (#windmill on Freenode) to solve all your Windmill issues. OSAF takes openness in it's projects very seriously and we are committed to making the project easy for you to get involved, and encourage outside contributors and feedback.

This release includes many new features and bug fixes:

- Windmill Unit Tests, for all your future contributors out there to make sure you didn't break anything!
- Browser launcher support for Safari and Firefox Linux, no more manual proxy configuration.
- Lots of performance and stability improvement, say goodbye to those t-box hangs.
- The assertion explorer tool, now point and click to create your assertions.
- Javascript tests, write tests in Javascript to test deep down in that app's source.
- Commenting in all of the test files, including JSON.
- Windmill support for testing against localhost
- Fully functional WIndmill Integrated Development Environment in all the browsers.
- Controller additions of many wait and assert functions, get better control of your tests.
- Convenience features including automatically giving you the correct focus when working in the IDE, smarter logic in the DOM Explorer.
- DOM serialization, you can now pause your tests and get the state of your page on command.
- Cross domain, frame and window recording and testing
- And much more...

Any documentation you may need is available at our website, http://windmill.osafoundation.org and if you find any areas that could use improvement we encourage you to signup and add to the WIKI.

Other documents you may want to jump to:

- Windmill Mailing List
- The Windmill Book Index
- Installing Windmill
- Logged tickets
- Source Repository

add comment   |  0 trackbacks   |  permalink   |  related link   |   ( 2.9 / 272 )

Windmill BayPiggies Presentation 
Monday, October 15, 2007, 02:22 AM - QA
Last Thursday Mikeal, Dan and I made our way down to Google to do a Windmill presentation for the Python fanatics as well as anyone else interested in what we were doing (BayPiggies is a Python Users Group in the Bay Area). We found at OSCON that any presentation with the word AJAX in it seems to attract more people than you would expect.. hopefully many of them had an interest in Web UI testing, Python, Javascript or just really cool calendaring software.

I wore my OSAF t-shirt to open the gateway for as much evangelizing as I possibly could. The presentation started at 7:30, was done at about 8:30 and we were busy conversing until around 10:30. Apparently there was enough interest to keep us yacking with people for two hours.

Tomorrow we will be posting the presentation slides, which were a doctored and updated version of our OSCON presentation. Additionally tomorrow lunch will be the deciding point on whether we can release Windmill 0.2 without feeling too fearful about glaring bugs. In a relatively comedic and usual fashion, I was making checkins up until the second before the presentation actually started. Unfortunately one of the problems I thought I had fixed still did show up in the presentation.. fortunately it was relatively unimportant. Of course Friday morning I got a much more solid fix in, so we should be all set for any further presentations. As we have had a lot of interest in San Francisco from people who aren't so keen on a drive down to the South Bay and back, we will probably work out a way to do a presentation up here.. so keep your eyes on the mailing list of you are interested in that.

Part of our audience included Jason Huggins the now Google employed creator of Selenium which was started to reach many similar goals to that of Windmill, and has gained a very large community. Selenium was part of the inspiration for Windmill and if you browse our source you will see snips of Javascript here and there where I either used pieces of their code base, or concepts based on things I saw in their code base. One of the things that was pioneered by Selenium was this concept that not only can you fire an event attached to a DOM element on the page, but you can also simulate this without a user by pretending to be a user, or artificially firing these events. This simple concept has lead to a world of Web UI automation and is growing huge amounts everyday.

After the presentation we had a few minutes to share war stories as Jason ran into most of the same very difficult engineering challenges provided by working in a Javascript platform, while trying to do things that aren't common place and really only surface when you try to do things that weren't really intended to be done. It was a really interesting conversation for me, because we got to compare a lot of architectural, and technological decisions that both projects had to make. This gave us the ability to compare how these different decisions have panned out, as well as what priorities drove these decisions and why. There were a lot of big decisions that we compared especially as we were presenting at the Bay Piggies and chose to build our service in Python, which was something Selenium initially considered but wound up in a Java environment. I really appreciated all of his feedback, input and wish him the best of luck with Selenium and the big goals and expectations Google has for the project.

I was again excited for the solid turnout, all the feedback and responses by everyone. I am glad to say that I had a few conversations with people just about the status of OSAF and the exciting and interesting state we are in finally getting a usable project out the door and into the hands of the public. It was especially exciting for me to walk around the room at the end of the presentation and see that many of the people in the room had windmill running and were playing around with the test recording functionality. This means that basically anyone who can figure out easy_install and walk through our docs can figure out how to get the project up and start playing with it. This is an obvious key to getting users, because if they can't get the thing up to check it out there is a pretty small chance they will be putting any time in contributing or giving us useful feedback.

Go give it a try yourself!
http://windmill.osafoundation.org/trac/ ... ndmillBook

or jump on the mailing list to keep up on what's happening.
http://lists.osafoundation.org/mailman/ ... ndmill-dev
add comment   |  0 trackbacks   |  permalink   |  related link   |   ( 3 / 281 )

Oakland 2.0 
Wednesday, October 3, 2007, 07:43 PM - General
Life on the home front is finally calmed to a dull roar. After moving, a new kitten appeared at the house, and a new roommate was found to help manage the cost of the new house. Overall I would have to say I am very satisfied with the result of it all and considering the drastic changes other than AT&T everything has been reasonable, reliable and within my realm of patience (Comcast will be here on Monday).


So far the guest cottage has been used to it's full potential, my fountain has been filled and unclogged for a tranquil backyard experience and I have had a chance to golf Lake Chabot and Golden Gate park. This combined with a very productive sprint week at OSAF and thus far a very solid preview release of the Chandler ecosystem.


One must have a place to go relax between lines of code, right!


For the last year my cousin has had one very smart, previously feral cat named Anna Belle. She ran the house, taught herself how to open doors, play fetch and many other things I didn't know cats could do. As the dominant creature in the house hold the idea of bringing a playmate in for her was a tough sell, but it happened anyways. After a couple days of showing the little guy "Spock" who's boss, things started to relax and now I can look over and see them in a bear hug sound asleep on a chair in the living-room. Most likely because they were up all night wreaking havoc on ever item in the entire house that can possibly make noise.

At this point I am pretty surprised that they are getting along so well, but the veteran feline seems to have taken over the mother role. Every-time the little one gets into something he shouldn't she quickly reminds him. As he discovers new things (Such as playing fetch with bottle caps) she sits and observes in a very dignified and superior fashion from one of the many view points in the living-room.

Looks like we have a full house at this point, should be a good fall and winter.


I am sticking a few pictures of the new place and the kitties here in the blog post, but if you want the full tour I have uploaded them to my Picasa photos; linked from the "Links" in the toolbar to the right.

This weekend I am headed to Pullman, Washington for the WSU Homecoming weekend. Once a year I like to remind myself of the college atmosphere, bitter cold, and terrible side effects of too much cheap barley pop. Hopefully the Cougs can make it exciting, and Meg will finally get a tour of the little town hidden in the wheat fields where I spent four years getting a life experience.

Next week Windmill will be having the 0.2 release, stand by for our shift into a higher gear on exposure, development, and polish. Exciting stuff.


add comment   |  0 trackbacks   |  permalink   |  related link   |   ( 2.9 / 200 )


Back Next