Tag Archive for 'XML'

Open Country Codes: ISO 3166 country names and Alpha-2 country codes in HTML, Python, JavaScript, ActionScript, Flex, JSON, and XML

Introducing Open Country Codes: easy to use ISO 3166 country codes for your apps.

Why are some things just much harder than they need to be? Finding a current, easy-to-use data source for populating a country selection box, for example.

Most of the clean country data out on the web is second-hand, having at one point in time been scraped and tediously hand-converted from the International Organization for Standardization (ISO)'s page of English country names and code elements.

That list "states the country names (official short names in English) in alphabetical order as given in ISO 3166-1 and the corresponding ISO 3166-1-alpha-2 code elements" of 246 countries and is free to use.

Unfortunately, it's an HTML table. Which means that you have some manual data massaging to do if you want to use it. Sucks big time.

ISO also sells the ISO 3166 "database" for about $148 USD. And it comes in -- get this -- Microsoft Access format. I bet we've all got a copy laying around somewhere, right? Oh wait, it's not 1999! So they want to charge you about 60 cents per country name? Not acceptable.

So what's a developer to do? Scrape the site? Write his one-line regular expression to pull out the data? Solve his own problem and move on?

Nah, let's make things better so that other developers don't lose precious time having to jump through ridiculous hoops! :)

Et, voilà, I present to you Open Country Codes.

This simple and deliberately unstyled little app gives you the ISO 3166-1 and ISO 3166-1-alpha-2 country name and country code lists in a variety of ready-to-use formats. There's an HTML country list selection box that you can drop into your page, and pure data structures in Python, JavaScript, ActionScript and a CountryComboBox component for Flex.

There are also JSON and XML feeds that you can use in your applications.

The application pulls in a fresh copy of the list every day and the code samples are dynamically generated.

I hope you find this useful. If you have any suggestions for improving it, please leave me a comment here.

XTech, Singularity, and AMEE

In the last few years, I've been making a very conscious effort to attend and speak at a variety of conferences both within the Flash world and in the greater world of web development, web standards, and open source. This has meant that in the last year or so alone, I got to opportunity to present to plethora of different audiences at conferences as diverse as MacWorld, Wizards of OS, Flash on the Beach, and d.construct. XTech, however, was very different to any of my previous conference experiences and I have to thank Jeremy for suggesting that I speak at it. (Jeremy also live-blogged several of the sessions from the conference and you can find several of the session slides online at SlideShare.)

XTech, at its birth, was a conference about XML. Although, as I understand it, the focus of the conference has shifted somewhat in recent years to embrace other web technologies and the crazy/sexy world of Web 2.0. Shifts in focus notwithstanding, I still had the pleasure of meeting and conversing with delegates from a variety of interest areas that I hadn't had the chance to at previous conferences, from people who make dictionaries to government representatives.

XTech was an intimate, and very geeky. After several days, I had learned heaps simply by conversing with the wonderful people I met and my brain was aching. Needless to say, I'm very happy to have taken part and I want to take this opportunity to thank Edd Dumbill of expectnation for organizing it and having me as a speaker.

During the conference, I attending a series of excellent sessions, starting on the workshop day with Simon's excellent tutorial on JQuery. Simon is one of the brightest minds I know and, as is sometimes rare in such cases, he is also an excellent and engaging presenter. To summarize what I got out of the session, if you're doing JavaScript, you could do far worse than to use JQuery! I know which JS library I'll be using from now on. (It has a very simple and consistent programming model, is hugely practical, extensible via plugins, and it handles all sorts of browser incompatibility issues for you behind the scenes. It's also lightweight and I'd urge ActionScript developers to look into the code for inspiration in taking advantage of the dynamic nature of ActionScript.)

The first day of the conference kicked off splendidly with Simon Wardley's amazing keynote presentation. Wow! I was in awe of Simon's presentation and I'm not too often in awe (for a list of other speakers that have blown me away with their presentations and their unique presentation styles in the past, see the speakers list for Singularity. I kid you not, first-hand experience is my main criterion when selecting speakers). Presenting is part performance, part teaching, part stand-up comedy and Simon masterfully blended all three. And, I'm honored that he has kindly accepted to present a session at Singularity. Don't miss it! :)

I also finally got the chance to meet one of my heros, Douglas Crockford, in person. Douglas is, of course, the creator of JSON, the native data format for JavaScript which, among other things, inspired me to create SWX last year.

He is also one of the best JavaScripters I know. Douglas groks JavaScript. He really does.

I've been programming ActionScript for close to a decade now and, during his talk, I learned several _fundamental_ concepts that I hadn't even thought of. Needless to say, I feel that every ActionScript developer needs to hear Douglas talk. And, I've been immutably excited ever since he graciously agreed to present his session at the Singularity web conference.

(Expect more speaker announcements for Singularity in the coming days. We've actually got more confirmed speakers than I've had the chance to announce on the conference web site.)

I'm also very happy to announce that AMEE, the world's energy meter, will be supporting Singularity as a technology partner and we will be using their carbon data and calculation technology to visualize exactly how much carbon Singularity will be saving by not having thousands of people fly out to a single location to attend the conference.

I was psyched to meet AMEE's founder, Gavin Starks. We share the same concerns about the environment and what AMEE is doing is of fundamental importance to the future of humanity. Gavin gave a riveting and informative talk at XTech and I'm delighted that he will be presenting at Singularity also. His call to action is probably the most important there has been in the history of mankind: We only have one planet and we need to start treating it better if we want it to continue being habitable.

I am happy that Singularity, in its own small way, will help to lead by example to prove that online conferences (global conferences?) are a successful model. And I hope that others will emulate our success in the future. The carbon savings alone in a shift towards global/online conferences will be phenomenal when you consider the number of conferences across the globe that take place annually. I envision a future where global conferences like Singularity will be the norm rather than the exception.

I'm heading back to the UK in a few hours and I can't wait to throw myself back into developing the new Singularity web site which I will be launching this month on Google App Engine, along with ticket sales. We are also going to be announcing our stellar line-up of sponsors in the next few days. Needless to say that I am exceptionally excited and humbled by the magnitude of support we are getting from everyone. Words can't express my gratitude or how blessed I feel to have such amazing friends and colleagues around me.






Bad Behavior has blocked 0 access attempts in the last 7 days.