Archive for January, 2009

The Vodafone G1

January 30th, 2009  |  Published in Technology

I’m writing this post from my G1 (thanks to the PostBot wordpress application) in Cairo, Egypt using Vodafone Egypt’s 3G service.

Before coming over I was told (by T-mobile) that my phone absolutely would not work, because the G1 only works with the “google network” that T-Mobile has exclusive access to. Without this “google network”, I was told, my phone wouldn’t turn on and was essentially a paper weight (exact words). Yeah right.

I convinced the customer service representative to give me my unlock code (which you are entitled to after 90 days of service), and told her I didn’t want the outrageous international plan (15$/megabyte). Note: it takes 1 or 2 days for the unlock code request to be processed and emailed to you.

Getting my G1 working in Egypt was quite simple. I bought a prepaid sim card from one of the Vodafone shops you’ll find on every street (literally) for 45 L.E. (approx. $6) and a 100 L.E. (approx $17) card for 100 minutes.

After putting the simcard in and powering up the phone, I was greeted with an unlock dialog into which I entered the T-Mobile unlock code. Poof! Instant cellular access. 3G service was slightly more complicated. You have to add a new APN in the mobile network settings.

Instructions for adding the Vodafone Egypt APN

  1. Open Settings > Wireless Controls > Mobile Networks > Access Point Names
  2. Click Menu > Add APN
  3. Enter the following information
    Name: Vodafone Internet
    APN: internet.vodafone.net
    User: internet
    Pass: internet
    APN type: default
  4. Leave every other field at the default setting
  5. Reboot the phone
  6. Enjoy 3G service

My hands are cramping from writing this post on the tiny keyboard. Pardon any spelling/grammar mistakes. My hands are done.

The Twitter Account Jive

January 25th, 2009  |  Published in Life

Short version: @Ramblurr is my new public Tech/FOSS twitter account, please follow it.

I have been on twitter for quite awhile, for several years at least. My original use case for twitter was something like a web/sms based IRC channel for my good friends from my hometown. Twitter is responsible for keeping us close in the years after we parted ways for different colleges. This use case worked great until my online communities (KDE, tech industry, etc) started jumping aboard the twitter boat.

At first I tried to handle both social spheres—online professional, and raucous college student—with the same account. Needless to say one group did not appreciate the drunken tweets or lengthy star wars quotation contests, and the other group did not appreciate my Java vs C++ discussions. Eventually, I made my account private and left the online technology twitter sphere, but now things are changing.

Twitter has risen to prominence in the online community, and I am missing out on this form of social communication with my fellow technology and open source enthusiasts. So, I’ve renamed my private account, and opened my original for public use.

Please feel free to follow @Ramblurr, my public account, without need to fear a flood of inane, hyper-context-sensitive, ramblings between friends.

Android: Now With 100% More Radio

January 24th, 2009  |  Published in Technology

Last week I mentioned a secret project involving Last.fm. Well today it was finally announced! Since late last November I, and several other open source android developers, have been working together with the official last.fm developers on an Android application that would leverage the full suite of Last.fm features. Today this app was officially released to the Android Market.

Not only does the application bring the full power of last.fm radio to the Android platform, but it also demonstrates the power of open source development in a commercial setting. When last.fm expressed interest around late November in developing an android application to be featured in the Marketplace, Google responded with an enthusiastic thumbs up but included a deadline of mid-January. A month and a half is an incredibly short turnaround time for a fully featured mobile application.

Last.fm contacted several 3rd-party developers who had already began work on their own last.fm android clients, and suggested that we work together and pool our resources. You can take a peek at the results below. I am proud of our product after such a short development cycle, even though there exist several outstanding bugs at launch time. We already have a slew of bug-fixes and feature additions in the tubes for another release.

Keep an eye out for posts announcing the opening of the site where the source code can be found, as well as bugs and feature requests submitted. Due to licensing issues the source code repository and issue tracker will be delayed several days.

(click for full image)

The Lessons of a Master

January 24th, 2009  |  Published in Code

Several of us at Camp KDE—myself included—owe a great debt to Till Adam. When he came to the sunny, beautiful beaches of Jamaica, instead of spending his days lounging on the shore or swimming in the warm Caribbean, he chose to pen himself in a stuffy room with a dozen geeks and teach them Qt.

Till works for Klarälvdalens Datakonsult AB (KDAB), the Qt consultancy firm. Besides working on large-scale, enterprise Qt applications, KDAB provides professional Qt training to such companies as IBM, Boeing, Ericsson, and J.D. Edwards. These training sessions usually run a few thousand Euros per person. With the OK from Nokia and Qt Software, Till provided us with a mini two day training course for free!

While the content and materials Till used during the sessions is copyrighted, the information I learned is not. With his permission I’m going to discuss a few pointers in this post. The topics covered somewhat basic/intermediate Qt skills, so those of you who have been programming with Qt for any length of time might not find anything new or interesting. However, for those, like me, who haven’t quite developed our Qt Fu to the Master level, take away tips from here knowing it was passed from a master.

#1 Most Common Performance Issue in Qt
Converting from a QPixmap to QImage too often.

This tip is actually fairly well known, but apparently KDAB consultants run across this mistake very often while in the field. There is a great discussion of this topic over at KDE’s techbase. In summary:

  • A QImage is stored in main memory
  • A QPixmap is stored in video memory
  • Converting from a QPixmap to a QImage is a very expensive operation (see the above article for the explanation)

#1 Most Common Cause of Crashes in Qt
Deleting this from slots

This tip needs some more explanation. Essentially, a mistake many Qt programmers do is include executable code after emitting a signal. Consider this flow of execution:

  • The function Produce::blend() emits signal pineapple()
  • The slot slotBlender() deletes the instance of Produce
  • The signal/slot connection returns to the function Produce::blend(), which has some other executable code such as variable assignments after the emit.
  • Crash. Since the slot deleted Produce, any code following the emit statement that modifies memory is now attempting to write to invalid memory.
  • One good practice to follow is: don’t have any executable code following the last emit statement in your objects’ methods.
    However, the real solution is: Use deleteLater() on your QObjects.

    This post is getting somewhat lengthy and I potentially still have two topics to cover (Threading and Model/View). Most likely I’ll dedicate a post regarding threading in Qt (I took better notes during that talk) in the next couple days. Many thanks to Till for the sessions, as well as KDAB and Qt Software for allowing them to happen.

It’s Jamaica, Mon.

January 19th, 2009  |  Published in Technology

The “conference” ended yesterday as the final presentations were given, however we still have 4 days left here among the sunny beaches. Today Till Adam gave a fantastic lecture-slash-hands-on-workshop of Qt’s Model/View and plugin architecture. Just a couple weeks ago I was slamming my head against the desk trying to wrap my head around Qt’s M/V concepts, the results of which can be seen in Amarok’s new last.fm service browser. Through the creative use of roleplaying (thanks Ade, Jeff, Sebas, and Leo!) and two helpful hands-on exercises I’ve finally gotten a decent grasp of the system. Tomorrow morning we hope to sip QtConcurrent knowledge from the cup that is Till.

I’d write more, but the ocean is calling and I still need to get a Pina Colada. But before I go, check out some photos from the past couple days.