The Python Scene, Accepting Javascript, and Lots of REST

Life continues at a breakneck pace.  Despite my best laid plans, the surest way of getting things done at the moment is in a sort of out-order manner.  However I did want to share a brief update on my journey into the Python and web application development world.  Instead of separate long form articles, I will briefly touch upon various topics.  (Note that this post itself has been in my work queue for over 3 weeks.  Mea culpae.)

The Python Scene in Toronto: Django Toronto and PyCon

I’ve now gone to two Django Toronto meetups and really enjoyed meeting with the Python community in Toronto.  The majority of web application developers in Toronto, deal with Java, Ruby or PHP (and of course Javascript).  However the Python community is there and growing.  They are very welcoming, and I have enjoyed each of the Django Toronto meetups I have gone to.  Also I feel like everytime I go there, I learn a lot and come back a better (or at least better informed) developer.  At the last meetup, I gained a deeper insight into crafting REST web services.  Something that I immediately applied to my day job the next day.  The one funny thing about Django Toronto, is that while the Django framework is an amazing platform, many Python developers move away from it once they scale up.  That is reflected in the meetups, since the topic of different platforms such as Flask come up.

The most exciting thing that is happening in the Toronto area for Python developers is PyCon.  This will be the first year that PyCon comes to Toronto.  I will definitely be there and I have been preparing by working on some real world Python applications.  If you will be there, I’d love to meet up with you!

How I Stopped Worrying and Started to Like Javascript

Javascript has been a language and platform I have avoided as much as possible.  If I can I try to stick to fancy tricks that one can pull off HTML5 and CSS3.  However one can only go so far without adding scripting to a web application.  Plain old Javascript still is a pain in the neck in a browser environment.  In other environments, it might be different as a scripting language.  However in such cases, I usually reach for Python rather than Javascript.  In a web app environment most of my experience has been with Sencha ExtJS.  While ExtJS is a remarkably powerful and flexible platform, it is problematic.  Aside from the licensing confusion of the original versions of ExtJS, I found that ExtJS contains a lot of automagic.  Building a ExtJS application consists more of configuring a number of components, and getting them to do more or less what you want to do.  Finding the right configuration has resulted in many stressful hours for myself and many other developers that I know.  Given all that developing with Javascript has left a bad taste in my mouth, until recently.

Two main things have changed my mind about Javascript.  Aside from the fact any sort of more advanced web application requires a full-on Javascript powered client, Javascript is not an entirely evil language for the web.  Doug Crawford (of JSLint fame) makes a good claim in his book Javascript: The Good Parts, that Javascript has some nice parts.  Yes, there are some ugly parts and needs a lot of love in the coming version.  But it is quite good for what is essentially a Schema-like functional/prototype language with Java-ish syntax.  Especially considering how quickly it was created at Netscape, it is not a terrible language.  If you are not convinced, I highly recommend watching the video below:

 

 

The other thing that changed my mind about Javascript is jQuery.  After fighting with ExtJS, the minimalist approach to Javascript development espoused in jQuery is refreshing.  I essentially learned the basics of jQuery overnight, trying to firefight a work project where office politics had gone amok.  (Aside: My take on politics in general is avoid it.  Get stuff done, not argue about it.)  Yes you have to know what you are doing with jQuery, and you don’t get a fancy MVC/MVT/etc. framework with jQuery.  But if you don’t fear writing Javascript by hand, and you want a library that abstracts the cross-browser stupidity, then jQuery is the answer.  For the next big web application that I am currently writing I will definitely be using jQuery.

Lots of REST and JSON

As mentioned earlier in the post, I have been dealing with a lot of REST service and JSON.  It is an infinitely nicer and simpler manner to talk with a server application, than via SOAP and XML.  (XML has its place, but it has been overused and abused in the Java world.)  When working with Java I’ve worked with Jersey and SpringMVC for building REST services.  Spring in general just works better, aside from its crazy arcane configuration.  In Python I’ve started working with Flask to handle building REST services, which I find a lot lighter than Django that sort of thing.  Also JSON is an awesome idea.  More people should use it for more of their data interchange needs. 🙂

IntelliJ IDEA Makes It All Better

Not to sound like a promotional campaign (since I work in what essentially amounts to the advertising industry, it happens more often I’d like) but one of the best decisions I’ve made recently is to switch IDEs.  I used to swear by Eclipse as the be-all-end-all of development environments.  Then I discovered PyCharm for Python.  Soon after that I got to meet Jessamyn Smith at a Django Toronto meetup.  While were talking about the joys of switching away from Subversion to Git–Jessamyn wrote a great article about her own experiences of migrating to Git–she convinced me to look into IntelliJ IDEA as it had a better interface for managing Git operations.  She was pretty convincing, as that is my primary IDE nowadays.  No more mucking around and wasting time with Eclipse’s temperamental setup.  Things.  Just.  Work.  Meaning I can do work.

Hitting the Flask

Somethings die hard.  One of those things is my own insistence on having lots of control over my computing environment and development platforms.  This led me to using Linux late in high school.  After playing around with Django, and wanting to build my own applications I found myself hunting down various odd ways to get around Django’s defaults.  Do not get me wrong, Django has a ton of nice pre-build features and default that just work.  Unfortunately being a web application developer, I have my own experiences, expectations and assumptions.  They are not always right.  However I prefer frameworks that I can plug-and-play and give me a finer grain of control.  (Hence I prefer using Spring in my Java web apps.)  So I’ve discovered Flask, a great micro-framework for Python.  I like how it makes web programming easy, without making a whole wack-load of design assumptions.  It very much reminds of me of the best parts of Spring, and apparently it is very “Ruby on Rails” like.

Review of Ontario Linux Fest 2009

Two weekends ago I went to Ontario Linux Fest 2009, held here in chilly Toronto for the third year in a row. And for such a young conference, it was quite good.  In fact good enough, that longer review of the event is in order:

Morning Keynote – Changes to the GPL

The day started with me rushing out the door in the morning, to catch a morning bus.  I made a bit later, missing the first part of Bradley Kuhn‘s keynote.   I rushed in, grabbed my conference package, put on my name-tag and rushed to hear the second part of the keynote.  Brad discussed the changes between versions 2 and 3 of the GPL (GNU General Public License).  As someone who followed the licenses and uses the GPL in my current project (justCheckers), it was pretty interesting to hear about why behind the changes.  The original GPL2 was quite brief for a software license, but not quite as understandable as the GPL 3.  The GPL 3 helped simplify the license, made it international and got rid of some icky loopholes.  After the keynote, I did a quick swag run even buying a fleece from the Eclipse guys from Redhat.  (And no Nick, I wasn’t there just for the swag I just haven’t gotten around to contributing to Eclipse just yet.)  I then quickly popped quickly back in for the first track of sessions.

Session 1 – Enterprise Content Management (ECM)

Cheryl McKinnon from Nuxeo did a talk on ECM.  I can definitely relate to having to hunt down information in the mess of Office documents and e-mails at the office.  I can just imagine what happens at larger organizations that have less rigorous guidelines to handling documentation.  So I definitely see the need software that handles such data, especially in terms of productivity and maintaining documents for regulatory purposes.  I can’t understand why every organization doesn’t have at least a wiki.  Interesting note that the concepts I learned in a university course on information science, really applies here.  Managing the capture, collaboration, review, publish, archiving and search-ability of information is really a science on to itself.  No wonder open source vendors like Nuxeo, Alfresco and MindTouch that provide ECM solutions in a flexible and low-cost way are such a big hit for enterprises.  There also was a neat discussion on how Nuxeo can do both centralization (bring documents into itself) and management of meta-data (like the locations and “tags” related to scattered documentation).  Really neat.

Session 2 – Ubuntu Moblin & Netbook Remixes

Jorge Castro from Canonical of Ubuntu community fame presented the Ubuntu Moblin and Netbook Remixes.  As with any live demo, the demo technology co-operated with Jorge like any demoed technology or self-conscious prima donna.  Still the Ubuntu Moblin Remix looks gorgeous.  It sports a nice, simple, elegant and understandable user interface.  However this remix qualifies as a tech preview more than something to hit the mass consumer.  Still I think people will be impressed when they change over from Windows to something like Moblin.  It looks a far bit of effort was put into making refactoring the UIs to fit a smaller, wider screen.  The Netbook Remix looks great too, and if you are reading this and running Ubuntu 9.10… switch over to the Netbook UI, you’ll love it even on your main system.

Lunch Chat 1 – Free Software and Its Impact on the Future of the Software Industry

I skipped out on the last session of the morning to pester Brad Kuhn with a few questions.  It started with an innocent question about his opinion about certain companies planning on moving from the GPL to the Apache licenses.  Brad figured out that I had read one of Matt Asay’s blogs on the topic, and went on a mini-rant.  Apparently Matt is one of Brad’s “nemesis” (not that they don’t get along rather their views on software freedom are quite different).  Brad envisions a future where software stops being a “big box” industry of packaged software products to more of a lawyery/consultancy profession.  I have to agree with him on that, and I don’t mind such a future being a consultant by trade.  However I did point out the difficulty one runs into with consumer-level products or projects.  Basically how does one sufficiently fund a project like Inkscape?  One way would be to sell a proprietary product, which defeats the purpose of going open source.  Another way would be to offer a service.  The heart of the problem is how to finance a regular development and enhancements (like usability) on a regular basis… and still get someone to pay for it willingly.  It isn’t an easy problem to solve… A problem that I plan on working on in my semi-stealth project… But Brad tried to convince it wasn’t as big of a deal as I think it is.

Lunch Chat 2 – Decoupling User Interfaces from the Application Backends

Feeling now famished for lack of a breakfast, I went out with Scott from the GTALug for pizza.  Scott is into user interface design both on a hardware and software level.  We both agreed that user interfaces should be loosely coupled to their backends.  In enterprise web application design the concept of different views for different users and environments comes to mind.  Scott introduced me to the concept of a framework that allows for completely decoupling the user interface with the underlying application, called Metisse.  It allows for building UIs at runtime using a widget palette or toolkit… brilliant!  That would let developers concentrate on what they are good at: application development and design.  And HCI/usability/graphics designer concentrate on what they are good at: design kick-ass usable user interfaces.

Session 3 – Building Business Applications Using SugarCRM

Right after lunch, I went to a more practical session by John Mertic, a developer at SugarCRM.  The session was naturally about developing applications using SugarCRM.  It looks a very nice application, and CRMs apparently can solve a lot of problems centred around customers.  Even just using SugarCRM to manage a client’s organizational contacts would save a lot of my time at work.  However since I work in Java and not PHP, thats not really an option.  But it looks like a neat application, the latest version SugarCRM 5 being all built in PHP and using the YUI (used to use ExtJS).  There is a vibrant community forge and marketplace around the application.  Neat.  Also neat that John just published an Apress book called: The Definitive Guide to SugarCRM.  See a pattern, yet? 😉

Session 4 – World Domination, Documentation and Ponies

OK, I admit it as a writer masquerading as a software developer,  (Or is it the other way around?) I actually enjoy writing documentation.  Some would even say, I enjoy writing documentation too much.  So I jumped at the opportunity of hear Emma Jane Hogbin talk about world domination through good documentation.  Actually I was disappointed by the lack of talk on world domination.  But there was much talk of ponies… oh and documentation.  I swear I’ve never heard anyone comparing documentation to wearing high heels.  I guess the analogy of it being sexy and painful makes sense.  But then again I’ve never (or do I ever plan to) worn high heels, so I’ll trust the ladies on this one.  Still it was an awesome and enlightening talk.  I’ve never consider all the various audiences (devs, users, marketing) and types of documentation.  I must agree with Emma’s statement, that if you are doing a lot of work documenting how to use your program… maybe reconsidering how the UI is done is in order.  The concept of automating documentation and using an XML source is new to me.  But I will have to look into technologies like pywebdoc, Mallard and DocBook.  Emma went through the Capture, Organize, Translate, Output, Review and Revise cycle, using the Status.net documentation efforts.  (Emma’s project on writing open source documentation.)

Session 5 – The Look at Introducing FLOSS into Education

Karlie Robinson of On-Disk did a talk about her experiences with connecting the OLPC, Fedora and RIT together.

Afternoon Keynote – How Linux is Like Music

The conference wrapped up with Joe ‘Zonker’ Brockmeier‘s afternoon keynote.  Zonker is an incredible speaker, and he also threw plush penguins at the crowd which instantly made the keynote awesome.  Alas I didn’t have any thing worthy to add to the conversation so I didn’t get another plush penguin. 🙁  But I’m getting ahead of myself…  Zonker talked about how we should move away from the tired analogy of choosing operating systems like cars.  Rather he suggested how choice of OSes and Linuxes should be compared to bands and musicians:

  • Fedora -> Frank Zappa
  • SuSE -> The Who
  • Ubuntu -> Duran Duran (Hurrah, I mean huh?!?)
  • Gentoo -> Write your own sungs in your own built studio (Damn right!  Sorry, ecstatic ex-Gentooer here.)

A bit zany, but with a nickname of Zonker… 😛 Ok, I’ll stop teasing.  But he did go into the problem of widespread Linux adoption: better self-marketing, pre-installed PCs (we are getting there slowly), market shift to the cloud and mobile (at least we have that one covered to a degree) and  the in-fighting that the F/OSS community seem to love (welcome to the new face of anarchy and things to come?).

The Pre-After Party

At this point most of the participants went out to either go home or wait out the time for the reception.  Having come alone, I felt like I’d love to mingle at the afterparty but I needed to do something while I waited.  Fortunately, the KDE 4 guys (Troy Unrau, Shawn Starr and Eugene Trounev) were quite welcoming and let me tag along with them.  Troy was pulled into the speaker’s dinner so I didn’t get to talk to him much.  But Shawn, Eugene and I chatted for a bit, grabbed a quick bite to eat at Burger King and came back to chill at the venue.  Shawn works on developing plasma, while Eugene makes graphics for KDE Games.  Actually if you count myself and Troy in, we each represent a different aspect of the KDE  project: Shawn – developers, Eugene – artists, Troy – marketing and myself – the humble user/wannabe contributer.

When Eugene found out about my semi-stealth project, he suggested I should join the KDE Games and look into the Gluon project.  I’m planning on getting involved, once I’ve hacked around with Qt, something I started on recently.

The After Party

The conference wrapped up with a reception sponsored by Google.  Actually I got a good amount of useful swag from Google, and the free booze was much appreciated.  At the reception I got to mingle with the presenters, organizers and participants of the conference.  I got to discuss the finer points of revision control systems (CVS, Subversion and Bazaar) with a Bazaar/Launchpad developer, Aaron Bentley from Canonical.  Also got to watch Brad Kuhn and Jorge Castro get into a heated but amicable debate about Mono, software patents and why Canonical should stop releasing and supporting proprietary software.  And I got to chill and talk about Apache Qpid (a reliable message queueing system, think something like IBM’s MQ) with Redhat’s Rajith Attapattu.

I left the reception really, really late.  And I got home around 2 in the morning, which just goes to show how awesome of a conference OLF2009 was.  After the conference I felt a lot smarter, enlightened and inspired to contribute back to the Linux and libre software community.  I’m almost sure I’ll be at OLF2010 whenever that comes around.

Links to what others had to say about OLF2009:

  • Troy Unrau [http://troy-at-kde.livejournal.com/23041.html]
  • Eugene Trounev [http://my.opera.com/it-s/blog/show.dml/4455292]

Open Source Gamer Goes to Ontario Linux Fest 2008

Last, last weekend (October 25) I attended my first conference, Ontario Linux Fest 2008. And what an awesome event it was! The event turned out be a somewhat low key event. Not a huge number of exhibitor booths, but the Eclipse, Fedora, FOSSology, FSF, OpenStreetMap and Drupal people had setup shop there. The event featured 4 tracks, and a number of great speakers. Got to meet Jorge Castro from Canonical, Ross Turk and Daniel Hinojosa from SourceForge, Jon “maddog” Hall, Jeremy Allison from Samba, Ian Darwin and Bradley Kuhn from the Software Freedom Law Centre (SFLC). It is always an amazing thing to meet the people “in the flesh”, who make a difference in the FOSS community, and read from blogs. The seminars were fantastic and inspire me to further my own open source/free software involvement.

One of the organizers, Richard Weait tried to convince me to start up a Brampton LUG. I might try it out, once I have a little bit more time. Nothing fancy mind you, just one night a month at the Coffee Culture, a few ads and a mailing list. We will see how it will go.

Also I got to go out to dinner with Bradley, the Red Hat and FoSSology folks. And thanks to Google for providing yet another free service in life, in the form of free drinks at the reception/ after-party.

So thanks guys for the awesome time. Sorry for not blogging earlier. Life keeps me busy as always. And lets make the 2009 event even larger!

On Hacking with Maemo

Time is the ultimae in precious and scarce commodities. With work and travelling up North to kayak, I spend most of my spare time away from a workstation. Hence the convenience of owning a N810. I can code and write anywhere!

Ok so I haven’t tried putting gcc or other c development tools on this tablet. While with Jalimo I can run Java code… I’m not sure on the feasibility of running Tomcat. And there is no way Eclipse will fit. Actually Tomcat would need an SDK, so running a full Java web development platform is most likely a no go. Instead I could set up a hosted test server.

Still I can edit the code itself. Originally I installed Vim. Then I tried PyGTKEdior and it works for me. Additionally I installed subversion. So now I can work on justCheckers while on the go.

Maemo Hacking and Project Revivals

With such a cold wet summer, I thought I would spend more time hacking. Yet this year spare time is a scarce commodity and most of that time I find myself far from a proper development workstation. Fortunately with an Internet tablet in my pocket, I can at least start on learning about Maemo development.

For an embedded device, the maemo platform is neither the easiest nor the hardest device to start hacking. Setting up the SDK on Ubuntu takes only a few minutes. In fact I also managed to setup Eclipse to do maemo development too. But I didn’t try to compile any source code so far.

Developing on Maemo, requires knowledge in both Linux and C programming. The N810 itself uses a heavily modified version of the 2.6.27 Linux kernel, Gnome and GTK. GTK seems to handle the GUI side of things in much that the same that Java Swing does. And I like the fact that GObject brings some semblence of OO programming to C. I’d prefer to learn Qt instead of GTK, but I guess I have to start somewhere. Judging by blog posts from KDE developers that got N810s at Akademy 2008, the state of Qt and KDE on Maemo is in its infancy.

In a recent conversation with Dan D’Alimonte, he suggested that I should think about reviving the justCheckers project as a web application. Considering the state of the codebase I work on a daily basis, the justCheckers codebase is very much maintainable. As a web application, the releases can happen faster and casual users can play with the program. And I’d like to play around with some more advanced Java web technologies. Now whether or not I actually revive the project is another matter. It is a definite maybe for now.

Technorati Tags:

Drifting in a Netherworld

Fall. Well not officially but still… everyone can feel it. Summer’s warm embrace is loosening and slowly turning into the cool of autumn. And haven’t enjoyed it a bit… not much time off. And now the sickness. Apparently my latest illness which seemed to be fading, has struck my sinuses. Now I have had to deal with this quite painful secondary infection… So much for time off. To top it off my knee-jerk coughing spree kept me up till 4:00 AM yesterday night. The only thing enjoyable was a reading a VERY depressing Japanese (Yeah for English translation) animated novel. Well maybe not enjoyable but at least I least I felt better about my own situation after it.

Fortunately I have been feeling better with each passing day. Mostly thanks to intensive pill-popping. Of course, to make the experience more exciting, my condition always seems to worsen in the evening. Lovely. So I decided to get some work done. I have updated my Linux box recently, with a newer version of udev, a new kernel (which I soon found to be broken with a new implementation of the Alps touchpad driver…) and few other things. I cleaned out a few old things, like useless libraries, a few games including Quake 3 Demo (sorry it was just too bloody) and UT2004 Demo (love the fast action, but I don’t have time to play), and best of all Mozilla. That’s right! Now I have only Firefox and Thunderbird… without all the additional bloat. I also
threw out the Gentooized version of Eclipse, and got a newer copy for my own personal use off the Eclipse.org site. A few minutes later (and DSL reconnects), I had everything I needed. Sort of. My update kept on crashing with the configuration of wings (awesome 3D modelling program), but that bug report I sent in yesterday paid off. I am currently in the process of
reemerging a few kernel dependent programs, and my update.

I have given up on my old laptop. The not-so-hot release of FreeDOS now lives on it. What a change I might add… I really do prefer a Unix system… but at least I can play my old DOS games again. Weee… OLD SCHOOL!!!

As for back-to-school (university) preparations, I am debating on whether to take PEY or not… and whether to pursue a degree in bioinformatics (I suck at Bio and Chem labs and their reports :() or take that one icky statistics course and take the AI courses. I would really love to hack robots (especially space probes/drones/rovers) as a job^H^H^Hcareer.