Archive for September, 2008

Where to for this Blog

September 9th, 2008

natalie deeThis blog is getting very untidy and its spanning a lot of subjects: Python, Ruby, Rails, Django, Asterisk, PHP, agile development, and even martial arts!

All the advice about blogs says to keep onto a single subject.

So I’d be very grateful if you’d vote in the poll to the left so I know what the readers all think.

Thank you. :)

Image by: nataliedee.com

New Design

September 9th, 2008

The old one was getting boring and I’ve been taking tips from ProBlogger.  Hoping to implement a few changes over the next day or so.

Thank you for your patience. :)

Latest Ruby WWW::Mechanize Released (0.7.8)

September 6th, 2008

For those not knowing what I’m on about: Mechanize is a stunning little library which is great for automating web navigation and is especially suited to handling forms.

The latest version addresses a couple of bugs and is available here: Mechanize.

Django 1.0’s Top 5 Changes

September 4th, 2008

A Django site.Well yesterday saw the release of the much anticipated Django 1.0.  Many years in the making its been well worth the wait.  Now although there’s been numerous changes I’ve condensed this to the top 5 changes:

1. Django Comments

Although this has been available in some form for a while it’s recently undergone major changes during the Google Summer of Code which has resulted in a very powerful, yet flexibile comments platform for your Django app.

Comments Upgrade Guide

2. Refactored Admin Control

The admin area has had two major changes that will see a much cleaner and flexible control interface overall.  Firstly is the latest newforms code bveing integrated into the admin.  Secondly is the decoupling of models from admin interface.  So gone are the days of subclasses within the models of your application.

Django Admin Reference

3. Data Query Changes

Django’s ORM has had some major additions and clearup recently with some nifty features added including:

  • values() – This will get a list of related values from a table linked by one-to-many or one-to-one.  Returning this as a dictionary it can be useful for constructing selection boxes.  A similar feature to this exists in CakePHP.
  • values_list() – As above but returns a tuple instead of a dictionary.
  • update() - This method was added to enable updates of a value across multiple objects.

Query Set Changes

4. GeoDjango

I have absolutely no idea what this really is but everyone seems excited so I am too!!!!  Woooohoooo!!!! :D

GeoDjango Info

5. Unicode

The average user won’t care much about this but trust me when I say that the refactoriungs done with regard to unicode support will have a great impact.

Django and Unicode

Vimrecover – Nice Gem

September 4th, 2008

Its easy to forget some of the best discoveries are made simply by browsing RubyForge.  This is now exception.  Its a nice little Ruby Gem to help Vim users to compare and manage their swp files.  These are produced as you’re editing a file and so if the session dies or there’s a crash then the swp is left behind for you to recover.  Problem being its not easy to determine the difference between the saved file ‘proper’ and the swp file.

That’s where this little gem comes in handy: vimrecover.

P.S. Sorry for overusing that damn Ruby logo but I dunno what else to do.

Python GUI Programming? Painful

September 3rd, 2008

If you’re wanting to develop a Python GUI anytime soon can I strongly suggest you re/learn Java. I recently wanted to produce a simple yet functional desktop app and decided to give Python a go. I’d later py2exe my creation to create an executable Win32 app. My thinking was that Python is much faster to develop with and so doing a simple GUI app using it must be simple too.

Oh how wrong I was.

Coding the GUI

First off I tried the oldschool method of developing the GUI by hand using Tkinter as it seemed to have the greatest level of documentation and it was the library used in the Programming Python book. Alas this brought back painful memories of oldschool Java GUI programming with extremely restrictive rules on placement and positioning. After 3 hours of trying to get exactly what I wanted I ended up with GUI cat-sick on my screen – not good.

I tinkered with a couple of ther other libraries wxPython, PyGtk and even EasyGUI (too basic) only to hit the same problem – lack of flexibility.

I decided to try a different approach and find a GUI capable of handling the graphical side of things for me – maybe its a cheaters way out but personally I wanted an app not an education.

PythonCard

Oh dear god in heaven above. This app has been getting developed in a cave by the most hardcore, life-starved, miserable geekjects on the planet. It’s based on an age-old Apple Mac application for developing quick dirty GUI apps. Which is great except its method of working is completely different to any other IDEs out there. It does follow a convention – its just the convention died years ago. That doesn’t deter the developers though and they still have arguments to this day about wether to make tab ordering an easier to access feature or just leave as is (NB: Tab ordering is determined by the ordering of the elements in the frame and so you use “send to back”, “bring forward” commands – very intuitive).

Boa Constructor

You need a book to operate this and also colour blindness helps because the interface is…well….vile! It’s a painful mess to use and I didn’t even bother trying – I closed it down in disgust. End of story.

IronPython Studio

You need a full version of Visual Studio – no go.

PythonWorks

Project now dead.

PAGE (Python Automatic GUI Generator)

This is one hell of a piece of wonder. Its amazing the sub-sorry I can’t be sarcastic any longer. It’s rubbish, it performs a role and thats it. It simply generates your GUI code rather than being a full GUI IDE.

I eventually got onto Glade and there’s a number of options here that Python can exploit however, I’d wasted far too much of my valuable time by this point so I decided to do the only sensible thing:

Remember My Java

I left Java many moons ago but from when I’d last used Netbeans I remember the GUI building facilities were absolutely stellar. I wasn’t disappointed this time round either. I can’t believe how far along its now come and developing a GUI app in Netbeans using the Swing and SwingX components is an absolute joy. Its making me want to make more and more – I’ve restarted learning Java and not looking back.

So if you want to create a GUI desktop app – don’t use Python (or Ruby).