Tuesday, December 21, 2004

Achates Take a Break!

Finally!

I'm out with Achates Take a Break!. This app has been hanging around on my computer in a 'nearly' finished state for a couple of weeks now and I finally pushed it out today.

Part of the reason I knuckled down to it was that I'm off for a week for my cousin's wedding (so no updates for a while!) and I wanted to finish this off before I left. Just 7 hours or so till I catch my train, and I haven't really started packing yet! :-P

<white rabbit>I'm late! I'm late!</white rabbit>

BTW, you might want to subscribe to the RSS feed to get the latest updates when I return...

RAD with Python, wxPython and Boa constructor - Part 3

Here's the third essay in a three part series on using Python, wxPython and Boa Constructor to rapidly develop cross-platform desktop applications.

Last time, we discussed wxPython, the GUI toolkit we're using to create rich, cross-platform user interfaces from Python. Now wxPython is great, but like almost all such toolkits, it's a royal pain to code up an interface using it. The code which deals with creating and managing the UI is usually very verbose and it's boring, tedious work. The drudgery of trying to get your buttons set up just so by repeatedly changing the relevant positioning variables and running the script, is positively mind numbing. What we need is a way to graphically setup the interface and have the code to recreate it generated automatically...

Enter Boa Constructor (just Boa from now on).

To quote from it's website, Boa is "...a cross platform Python IDE and wxPython GUI Builder. It offers visual frame creation and manipulation, an object inspector, many views on the source like object browsers, inheritance hierarchies, doc string generated html documentation, an advanced debugger and integrated help..."

Pretty impressive.

So what's to like?

  1. GUI Construction - This is the main reason I use Boa. Create a new frame, click on frame designer and away you go. Drag visual elements like list boxes, buttons and text areas in and throw them around until they look the way you want them to. You can access the attributes of the various visual elements by bringing up the inspector and change just about everything to do with the widget. You can also automatically generate place-holder callback functions and fill them up with the relevant code later. Boa really makes GUI construction a breeze.
  2. Code Exploration - Boa comes with some nice tools that help you explore other people's code; or your own if you're as lazy about commenting as I can sometimes be! :-). Just open up the .py file and tab over to Explore in the editor and you can browse the various classes and their attendant methods. Mosey over to Events and you can check out the various events handled in that file as well.
  3. Skeleton Files - Boa generates a wide variety of skeleton files which help reduce the amount of tedious typing you have to do. You can generate everything from wizards to setup files to help files, all at the click of a button.
  4. Debugging - Boa has extensive support for debugging Python code. However, python is so easy to use that I've never had to use a debugger to solve any problems. Yet :-P.

So much for the cheerleading.

Boa is currently at version 0.3.1-alpha. Now version numbers hold very little meaning across applications. I trust FireFox 1.0 a hell of a lot more than I trust Internet Explorer 6.0. Boa is fairly stable and useful, but it does have it's short comings.

  1. Ugly - Boa is ugly enough to make children cry, horses faint and women snort and rear up, pawing at the air. OK, that may be a little harsh... but it is pretty damned ugly. Now I know that shouldn't make a difference. Book covers and internal beauty and all that PC crap. But personally, I like working on applications which don't remind me of the bleeding, infected sores on a lepers back.
  2. Doesn't support latest version of wxPython - The official stable release of wxPython is still version 2.4.2.4. However, wxPython version 2.5 is stable enough to use regularly and has some nifty new features. Unfortunately, Boa refuses to work with 2.5 so all that's out.
  3. So-so editor - One of the main modules in any IDE is the code editor. It has got to be perfect, or as close to perfection as you can get... and Boa's just can't hack it. Now that's partly my fault. I'm an Emacs addict and it's chords are burnt into by muscle memory. When I want to save a file, I do C-x C-s without even thinking about it. Unfortunately, Boa's editor doesn't let me re-set shortcut keys, so when I do a C-a to move to the head of the line, I end up selecting all the text in the program and losing my place in the code. If it had offered code completion and other goodies, I still might have used it; but it doesn't, so I don't.
  4. Slightly buggy - This is still alpha code. Weird 'stuff' will happen, usually when you haven't saved your code in a while.
  5. Ugly - Did I mention that Boa is really really ugly?

Now as I mentioned in the beginning, I primarily use Boa to rapidly generate GUI code. What would take me days to do manually can usually be done in scant minutes using Boa. However, that also just about all I use Boa for 'cause I can't stand it's editor and looking at it makes my eyes bleed (which is a little surprising cause wxPython GUI's usually look quite reasonable).

If Boa isn't your cup of tea, you might want to check out Spe (Stani's Python Editor) which seems to offer similar functionality.

Well that concludes this particular series of essays. See you next time.

Same Bat Blog.

Same Bat Time.

Sunday, December 19, 2004

The rising drumbeat of war

It seems that Iran will be next, before Syria, which seemed like it was next in line after Iraq.

Bolting on Iran

Evildoers, here we come

Of course, Iraq proved that American military might isn't all it's made out to be. Here's how Iran will fight back

Saturday, December 11, 2004

I'm back!

I've been quite unwell over the last few days, but as you can see from my last few posts, I'm back!

I hope to finish off the RAD using Python series and write another article on pricing soon Inshallah. Still have to do a bit of research for that...

You'll be seeing me posting more often now, more's the pity. :-)

LBB Lesson - 1.5. The Network is the Entrepreneur cont...

In Lesson 1, I covered the usefulness of networking to the budding entrepreneur. Having a useful social network however, is not just important when you're starting out, but throughout your whole business career
Now, the obvious benefit is increased sales. The more people who know you, the better your chances that you'll come across potential customers (or friends of customers etc.). However, here's at least one more reason to spend some time getting to know a diverse bunch of people, especially if you're in the software business.

The people you know from other walks of life are the best sources of inspiration, and help, when developing a new product.

Here's an example from my own experiences...

A relative of mine works in the advertising industry. One day I was at his house and right out of the blue, he asked me to suggest some software that'll help him organise and maintain his vast collection of (mostly video) media files. He often has to refer to old campaigns and ads and it would save him a lot of time if he could pull up just the file he needed.

Of course, what he really wanted was software that would 'review' the clip and file it automatically, but that's not possible yet. The alternative is of course to correctly annotate the files and sort them sensibly. Even a properly arranged hierarchal collection of folders would be enough in most cases.

However, his remarks got me thinking about the problems of the advertising and marketing world in general and before long, I was convinced that it was possible to come out with a product that could target this cash rich segment :-P

Now, I have several near relatives involved in this field, so I've picked up quite a bit of advertising/marketing lore through dinner table osmosis. In addition, these relatives (wonderful people, I must say (in case they're reading this!)) could act as advisers and beta testers, giving me insights into the industry I couldn't get elsewhere.

It was perfect. I was both inspired to produce a product which I'm convinced will do very well and at the same time I find myself uniquely positioned to create it. All because of a chance request by someone I knew.

I'm sure you can come up with other such examples from your own life. And of course, the more people you know, the greater the chances that one of them will cough up a chance remark which could inspire you to heights of greatness; or at least increased profitability :-P

...And remember the golden rule of networking from last time: Be helpful to others and others will be helpful to you!

Venster

It's early days yet for Venster, but it seems worth keeping an eye out for.

I still much prefer my GUI toolkit to be portable across Operating Systems.

NSIS: Open Source installer

A fairly impressive list of features and free to boot.

Looks good. I just might try this out.

Sunday, December 05, 2004

Added an RSS/Atom feed using Feedburner

Just click on the little "XML" button under Subscribe and you're good to go!

Never miss an update again. :-)


LBB Lesson - 1. The Network is the Entrepreneur

Mao had his little Red Book, Ghaddafi has a little Green book, so I've decided to follow in these illustrious foot-steps and name my ever expanding compendium of experiences, my little Blue book. :-P

As I mentioned in my last post, I want to do this partly for my own benefit. I am quite absent-minded and I feel quite strongly the need to write down things I consider important enough to remember. A side benefit of this is of course, that other people can read up on what I've written and comment on it, benefiting us both.

So here's the most important lesson on entrepreneurship I've learnt as I've been battered by the vicissitudes of fortune...

Lesson 1 - The Network is the Entrepreneur

When you initially start up your business, it's going to take a very long time to show some returns. Your first clients are absolutely vital and are going to either make or break your business. And guess what? 9 times out of 10, your first clients are going to be people you know. They're either going to be friends, relatives, past employers or even employees. They could be your fellow co-workers from a previous job or club members. Anyone who's known you for a while and trusts you.

"...and trusts you". This really is the crux of the matter. The number one problem for the new entrepreneur is a lack of credibility. Sure, you may be offering the best service or product for the best price, but if no one trusts you to deliver, no one's going to buy. The fear of loss far out-weighs the greed for profit in most such cases. The only way you can overcome this credibility gap is if the buyer already knows you, trusts you or is beholden to you in some way.

Who are these people who trust you and like you already and who therefore are far more likely to give you a chance? They're the people you know before hand of course. And the more such people you know, the more likely it is that there are potential buyers to be found amongst them.

How do you build up such a network of interesting, friendly, useful people? By being interesting, friendly and useful of course! :-D

Give stuff away and don't expect anything in return. Not only is this recommended by just about every religion in existence, but it's the best way to network. Help people out, give them useful advice, go the extra mile; and people will respond in kind. Not all naturally, but enough.

If I remember correctly, there's a Hadith Qudsi that runs something like this (paraphrased from memory): "Do not be discouraged by people who treat you shabbily after you help them, because there will be others who will treat you far better than you deserve for helping them just a little". It all balances out :-)

Join clubs and organisations. Mingle. Hand out your visiting card at every opportunity. If you're shy, hide behind your PC and blog. :-P. Do something, anything but be among people and Inshallah, opportunities will present themselves.

A final word in parting. The people in your network are ready to give you a chance because they trust you.

Never betray that trust.

Friday, December 03, 2004

Lessons from my little blue book...

Hmm...

I'm thinking about doing a series on the lessons I've learnt over the past year or so while trying to get Achates off the ground. I want to do this partly for my own benefit; it's quite easy to forget stuff that seems blindingly obvious now.

Stay tuned, I'll probably post the first in the series within the next few days Inshallah.

Comments and suggestions welcome.


RAD with Python, wxPython and Boa constructor - Part 2

Here's the second essay in a three part series on using Python, wxPython and Boa Constructor to rapidly develop cross-platform desktop applications.

But first, some clarification!

  • The Mystery of the Disappearing Post - Part 1 of this essay pulled a Houdini and mysteriously disappeared a day after it was posted. No other post was affected. I've contacted Blogger.com support but I'm pretty sure that it's gone forever.
Since it seems we'll have to do with just part 2 and 3 of a three part piece, lets get on with it...

wxPython is just a thin wrapper around another library, wxWidgets. wxWidgets is an open source GUI framework written in C++ and is cross-platform from the ground up. It works reliably on various flavours of Unix and Windows and is generally usable on the Mac. Support for other platforms like PDA's etc. is under development.

Unlike good ol', butt-ugly Tk, wxWidgets gives you a native look and feel on every platform it runs on. User's can't tell the difference between something written in wxWidgets and another application written in MFC, for example. Both will look the same.

wxWidgets is fast, stable, well-documented and under active development. It's also free (in both senses of the word). This applies to its Python wrapper, wxPython as well.

Some of the major pluses of using wxWidgets/wxPython are:

  1. Free! - I'm a sucker for free stuff. Especially good quality free stuff. The nearest thing to wxWidgets is Qt, and that costs big $$$$'s.
  2. Full-Featured - wxPython is not just a GUI toolkit, it also gives you classes to handle network programming, threads and processes, image manipulation, Databases, Printing etc. This cuts down on the number of dependencies your application has.
  3. Native Look and Feel - I've already mentioned this once, but it's important enough to bear repeating. With wxPython, your apps look like everybody else's. Many cross-platform toolkits have their own look and feel (TK comes to mind) and this tends to confuse and put off users. Others emulate the native design and just end up looking cheap. With wxPython, no one can tell that you took the easy way out! ;-P
  4. Documentation - The documentation for wxWidgets is very complete. Unfortunately, wxPython uses the documentation of wxWidgets without any changes. This can be a bit irritating since wxWidgets is written in C++ and the docs reflect that. However, if you have even a very passing familiarity with C++ (and who doesn't?), it's enough to use the docs.
  5. Demo Code - I really like this bit. wxPython comes with a very large collection of well-organised demos. These are simple, relatively small scripts that demonstrate the various widgets available. A great resource to learn from and an even better one to steal code from! ;-)

These were the features that I particularly liked. Go here to see even more reasons for using this great toolkit!

Just about everything has it's flaws and wxPython is no exception:

  1. Steep Learning Curve - wxPython is very well documented... but there's very little to get you started. The few tutorials that exists just barely get you off the ground. The only real way to learn wxPython is to start up the demos, play around with them and spend a lot of time reading their code. It's not an app killer, but it's definitely something that'll put off quite a few beginners.
  2. Documentation - There's lots of docs for wxWidgets, but none absolutely for wxPython! wxPython is just a wrapper around wxWidgets, but it's irritating to have to mentally switch between thinking in Python and thinking in C++ every time you look up the docs.
  3. Large Distribution - If, like me, you're going to be distributing your application as an .EXE (after converting it using py2exe), the size of the accompanying libraries can be a hassle. A "hello world" app is going to go from a 10-15 byte .py script to a 2.5+ Megabyte distribution! If your users are going to be downloading your product, this might be a problem!
  4. Verbose - Damn but you've got to write a lot of code to get anything done!

Anyway, that's all for now. Next time Inshallah, I'll cover Boa Constructor, which helps alleviate the code verbosity problem.

You can also check out Pythoncard. It's a wrapper around wxPython (which is itself a wrapper around wxWidgets (which is itself a wrapper...!)) and it makes writing wxPython apps a breeze. It's still under development and I wouldn't suggest it for a commercial app just yet. But it's definitely something to keep an eye on.

Till next time then!

Lit Window Library

This looks interesting...

The Lit Window Library is a new way to write UI code, saving up to 90% of the usual time and source code... Rules (predicate, constraints) based programming to code UI behaviour with integrated constraints solver

I wonder if there's a python wrapper for this yet?

Thursday, December 02, 2004

Blogger ate my essay!

WTH?!!!

I submit a new post today, view the blog to make sure it looks right and I notice that my essay on Python etc. has vanished without a trace!

I have absolutely no clue where it's gone to and who or what ate it up. I've posted a complaint, let's see what comes of it.

In the mean-time, if anyone has the essay in their cache or something, could you please email it to me at arsalan_zaidi@hotmail.com?

Thanks!

and death to Blogger.com!

The Business of Software - Reading other people's code and the GPL

A couple of days ago I asked the visitors on the joelonsoftware forums for their opinion about whether it was legal/ethical to read GPL'ed code and to learn from it, and then straight-off apply that knowledge in a closed source commercial app.

The consensus seems to be that it's OK, though michaels in particular said "I would say if you are reading it and implementing it again *only* because it is GPL and you can't use it as-is then it's unethical".

Read up more here and make up your own mind... The Business of Software - Reading other people's code and the GPL