tagged as: My Work

SvnViz 1.0.0 Released

Finally got off my butt and packaged up version 1.0.0 of SvnViz. It can be downloaded from sourceforge.

SvnViz builds visualizations of the activity within a Subversion repository. Here is an example of the default visualization run against the project that I am currently working on. Green dots indicate file adds, blue dots are modified files and red dots are deleted files. The greater the activity of the user the higher their score.

YouTube Preview Image

SvnViz also provides a framework for creating your own visualizations. Simply extend the FrameViz class and implement the generateFrame method. To run your vizualization class, instead of the default class, just pass the fully qualified name of your class to the application using the -vc parameter.

Source files can be downloaded from here. All code is released under the GPL.

Have fun and drop me a line if you come up with an interesting visualization.




Expose /var/www using Samba

This is actually more of a note for myself but it may be of use to you. I often find myself running up Linux VMs to test and build LAMP based systems but since I (generally) use Windows it is a major pain to have to transfer files via scp or worse edit files using vi.

However is you install Samba into your test VM, you can simply browse to the folder using Windows explorer and edit the files directly. The following configuration exposes your /var/www folder via Samba and makes its content editable by everyone. It makes the files read/writeable by all and makes sure that www-data remains the owner.

Needless to say this configuration is very very insecure and MUST NOT be used in production !

[www]
comment = apache root folder
path = /var/www
guest ok = yes
browseable = yes
create mask = 777
directory mask = 777
read only = no
force user = www-data
force group = www-data




Cross-browser testing and virtualization

Update: The latest images from Microsoft now ONLY work under MS Virtual PC ! Not so useful if you are a Mac developer or you want to run under VMware like we are. Microsoft is aware of the problem, hopefully they fix it soon.

I’ve been setting up a bunch of VMware images for testing various browser and OS combinations. This has worked out very nicely and the best thing is you can do it all for free !

In my travels I came across these very useful images from Microsoft, basically XP and Vista installs with various flavours of Internet Explorer ( 6, 7 and 8 ) installed.

These are free for download (but they do expire) and can be easily run using Microsoft’s free Virtual PC.

To get these images to run under VMware, you first need to set up the images to run under Virtual PC (to create a .vmc file) and then you can converted the images to the VMware format using the VMware vCenter Converter. This tool is also free.

The VMware Converter is also able to create an image of your locally installed OS, I haven’t tried this but it could be useful for backups and the like.

All up its taken about 2 days to set up XP, Vista & Ubuntu images running combinations of IE 6, IE 7, IE 8, Firefox 3, Opera 9, Safari 4 and Chrome.

Now the fun really starts….




ScanPaste – My first app released to the Android Market

Last week I released by first Android application on the Android Market. It is called ScanPaste. The application lets you scan barcodes and then  copy the scanned data to the phone’s clipboard for pasting into web pages, emails etc.

I had been looking for a simple app to build, to test out the end to end Android Market publishing process and when I saw this blog post by about populating your Google books list using barcodes scanned with a USB scanner, I figured why not build an Android app to do it.

Now scanning barcodes with a phone’s camera is not that simple but luckily someone else has done all the hard work. The ZXing team have released an excellent barcode scanning application and library. Even better, using a cool feature of Android, integrating barcode scanning into ScanPaste was only a few lines of code!

In an Android application each screen is broken down into it’s own little task called an Activity. If an Activity is correctly “marked” it can be initiated not only by the application owning the Activity but by other applications. This is what the nice guys on the ZXing team have done and with their application installed, any other application can simply use the following code to scan and process barcodes:

...
// start the scan
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
startActivityForResult(intent, 0);
...
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
  if (resultCode == Activity.RESULT_OK && requestCode == 0)
  {
    Bundle extras = data.getExtras();
    String result = extras.getString("SCAN_RESULT");
    // do stuff with result here
  }
}

The rest of the app is pretty straightforward, a couple of buttons, a text field and some error checking. All up the application is less than 100 lines of code.

In all it took a few hours to put together and test. The bulk of the time was actually spent working on the icon :) The 1.5 Android platform has some pretty clear guidelines and I was trying to adher to them.

Building a signed app for upload to the Market was a snap, just a menu click and a step by step wizard. Actually publishing the application was as simple as uploading the signed .apk file, filling in a form and clicking on upload. Couldn’t be simpler especially when you compare it to the nightmare process of uploading an iPhone app to the iPhone App store and of course the Android Market doesn’t have a vetting process so as soon as the upload was complete the application could be downloaded by anyone.

One of the things that took me by surprise was that within half an hour the application had been downloaded 20 times. A week later it has been downloaded 1849 times and it has 1156 active installs! It also has a 4 1/2 star rating and all positive comments. From the comments it seems that many people are using the app to scan the barcodes of books that they are selling on Amazon.

Ok the bad stuff….

Firstly, a minor one,  in the developer console of the Market there is no way to see the comments about your application. You can see the rating and the number of ratings but that is it. Instead you need to look up the app in the Market application on your phone or view a 3rd party site like Cyrket (which apparently uses the Market’s own APIs so why the info cannot be surfaced in the developer console is beyond me).

Now for the killer…since I am in New Zealand I cannot sell any Android applications! I need to be in the US, UK or one of a couple of other countries to be able to sign up as merchant. What the heck is up with that? I see that as a major shortcoming of the Android platform and one that Google needs to rectify ASAP.

Hopefully with the imminent launch of the HTC Magic here in New Zealand this will change. Lets wait and see….




The Contact Protocol & my first RFC

[Update]: I have created contactprotocol.org which now holds the draft specifications.

About ten years ago I had a couple of interesting ideas but due to sheer laziness on my part I never did anything with them.

One of these ideas however keeps popping back into my head and so finally I’ve decided to do something about it.

The original idea is very very simple: wouldn’t be nice to have a URL that points to information about you ? You could give this URL to people and they would always be able to find you.

Now of course it’s 2009 and the idea is slightly more refined and so I give to you: the “Contact Protocol”… It works as follows:

  1. you give out a Contact URL which looks something like contact://host.com/xyz . This URL can be put on business cards, email footers, websites etc
  2. the URL can then be used to retrieve your up-to-date contact details. If your details change you simply update them in one place and anyone who has your Contact URL can retrieve them.

Now obviously you would be able to type the URL into a web browser to lookup someone’s details but that is only one use.

How about an email client ? Just add the Contact URL for someone into your address book and voilà your email client will always have right email address for them.

What about your mobile phone ? Add a contact URL for a contact and the device can use it to figure out which phone number to use when you call them.

Instant messaging, same deal…

Pretty nice… at least I think so.

So what the heck is an RFC and how does it fit in with your crazy idea I hear you ask ?

Well I want the Contact Protocol to be widely used and the easiest way to do this is to make it a standard. On the Internet standards are defined in request for comments or RFCs. This practice has been in place since the Internet was born.

The RFC process is looked after by the IETF (Internet Enginnering Task Force) and most RFCs are written by this group but anyone can write one and submit it for consideration so this is what I have started to do.

It is however not entirely straightforward, RFCs have specific format, language, style and content requirements. Check out the RFC style guide (formatted as an RFC itself). Luckily the IETF have provided the xml2rfc tool which takes an xml file and generates a correctly formatted RFC, this makes things much simpler.

So I’m currently enthusiastically hacking away on my xml file, I’ll let you know when I have something to look at.