More photos…

Ξ February 23rd, 2009 | → 0 Comments |
Development |, , |

You might have already noticed that the number of photos in my own Experiment photoblog. This increase in the number of photos is due to my vacations (sort of!), but also and specially due to the new Python upload “tool”* I’ve developed during the last week!


The all process was quite simple…

1. Design the interface using Glade-3. This step includes creating the window and placing some controls. My “tool” uses labels, text boxes, buttons, menus and even a status bar (which I didn’t get to use for any status display). Also, the required controls should be connected with event listener which will be customized by the developer. The only listeners the “tool” interface defines is the window_kill for the File -> Quit menu option and on_button1_clicked for the ‘Upload’ button.

2. The previous results in the generation of a window.glade file. In order to use this interface definition, the .glade file needs to be converted to a GTK definition file (e.g. window.xml). This conversion is performed using the gtk-builder-convert (simply execute gtk-builder-convert window.glade window.xml).

3. In order to use the Window.xml definition just create a Python class and build the interface in the constructor. Don’t forget to instantiate the handlers you defined for your interface. Here is an example of my gui.py (before customizing the button listener).

Again, I really find easy to make stuff work using Python.

* - The expression tool appears several times between quotes and in italic because the actual application took no more that a couple of hours to build, so calling it a tool is a bit too much. Moreover, it’s highly hardcoded so it’s not much of a tool… it’s more like a “tool”!

 

A (++) (-)

Ξ February 19th, 2009 | → 0 Comments |
Introspection, Work |, , |

Yesterday was a special day, the annual self-appraisal meeting has proven to be an effective mean to discuss some of my thoughts and concerns about the past and future. But it also proved to be a good introspection exercise about what could be improved.

The ‘after’ feeling was that I had excelled (and ever surpassed some of the expectations) in a number of ways. The only exception is my capabilities to plan and organize myself. The (-) on the title is only related to this exception.

I must admit that improving this aspect of my work has proven to be more difficult that I expected. The major problem seems to be finding a workflow able to cope with all my everyday needs.

I’ll promise to keep trying to pro-actively improve this issue!

  

 

Lost Childhood

Ξ February 14th, 2009 | → 0 Comments |
Introspection |, , |

I proudly admit that during my child hood (pre teen years), I had a ZX Spectrum 128k + 2. My first PC came later, two years before I entered entered the university. And the Internet only became available during my undergraduate studies. For this I must admit that every business of the heart (or should I say business of the ‘raging hormones’) was handled face-to-face with the loved one.

I was somehow shocked to learn that more than half of the Portuguese population prefers to use instant messaging tools instead of face-to-face communication to exchange their “most intimate thoughts”! Even worst than that was learning that of about 31 weekly hours (1612 annual hours) each teen uses only 87 annual hours looking at soft-porn… preferring to spend their on-line period looking for diet recipes or researching about cosmetic surgeries!

Let’s see if I understand kids today. They prefers to stay at home ‘chatting’ instead of having an actual date, and they use the Internet for things other than searching for porn…

I’m feeling old!

 

Some APIs…

Ξ February 14th, 2009 | → 0 Comments |
Development |, , |

Yes, this is YAPP (yet another python post) on my blog… Three in a row! Not that I’m counting…

This time is related to describe some interesting APIs available for python developers. A while ago I was making some experiments in order to develop a simple tool to upload my photos to my Picasa Web Album, and automatically also into my Experiment photoblog. Trying to use Java proved to be a pain in the ass! Now that I discovered Python, I again ready to give it a try.

After a first glance, here’s my findings:

So, I guess all I have to do is develop the GUI. The next move is try to use Glade-3 to do just that!

[UPDATE @ February 15th, 2009]

More interesting APIs available at any python installation near you:

  • urllib and urllib2 enable the developer to download almost anything from the web
  • urlparse easily decomposes any url
  • and, even csv files are easily parsed to be accessed as tables

 

How to: Join MPEG or AVI videos (now using Python)

Ξ February 8th, 2009 | → 0 Comments |
Development, Tools |, , |

Did I already told you that I really enjoy to develop scripts in Python? It’s simply great!

Last month I did some research on how to join video files and the result was this. Now, having discovered Python I took another dive into the problem. The previous solution worked nice, but I was making it work double. Let’s see, the script began by concatenating the video files in /tmp folder, and then encoding it into the final video file.

A much more efficient was to do it is to simply execute menconder providing all the files to concatenate (in order!) as parameters. This solutions directly creates the output file, avoiding the creation of any temporary file.

Using Python to create the new script and trying to improving the first script, the new joinvids.py is now able to join .mpg and .avi files (according to the extension of the files to join).

 

The Latest Experiment

Ξ February 8th, 2009 | → 0 Comments |
Computer, Development |, , , |

The last post was so long ago that it’s hard to remember. Usually, the lack of posts comes associated with some huge amount of work. I could say that this is another example how my work takes to much of my own time, but that would not be completely true. In fact, I have been working long hours but the main reason for not having time to write is another…

I don’t see myself has a sysadmin, but I like to do my own experiments… like building a file sharing server (one that no one will hever use), having a wireless network in place (to be used once every month by a computer that could easily be connected using a wired connection) or mounting a home theater PC (an placing the old computer box in the living room and understanding that it really looks ugly and out-of-place).

No, this time it wasn’t one of “my crazy” projects. I just decided to learn a new language… I didn’t actually decided it! Let’s just say that Python started to grow on me. And front my point of view, Python is far better that bash script or perl or any other scripting language out there. With it you can do the simplest things, like inspecting some file’s content or you can do the most complex procedure (including, for example, DB access).

Book Cover
A friend talked about Python with me, and for someone with background in C/C++ and some bash script, Python turned out to be really (REALLY!) simple. I’ve been using it for a couple of months and I already converted all my ‘~/bin’ scripts to Python.

My real interest began after finding “Python for Unix and Linux System Administration” and reading this really hands-on and example based ‘introduction’.

More on my Python experiments, soon… (I hope!)

 

On the nightstand...


    The Art of Agile Development


    Beautiful Architecture


    Modern C++ Design


    Large Scale C++ Software Design

Personal

Friends


Interesting


Shared Readings