my thoughts on the iphone

so last thursday, i had the fabulous idea of purchasing an iphone, especially being that i was already in a cingular 2 year contract. so i picked up the 4gb model. after having used it for nearly a week now, here are my thoughts:


  • the screen is amazing.

  • it has wifi.

  • safari on it is awesome.

  • the whole means of navigation (zooming with your two fingers in safari and google maps) is off the hook.

  • visual voicemail rocks! why wasn’t this available before!?

  • pull based email is good for personal email accounts.

  • the screen rotates when the device rotates which is really cool (accelerometer).


  • no 3g. edge is slow! i guess usually, this is not a problem because you have wifi in most places these days, but still, in places with no wifi, 3g would be nice.

  • the phone voice quality is not that good - if you turn the volume on calls to maximum, the voice doesn’t sound right. the speaker phone also doesn’t get too loud.

  • the web browser has no arabic support!

  • no cut and paste… come on, this one should be obvious!

  • while one can supposedly play quicktime videos from within safari, i couldn’t play m3us or mp3s off of an ftp on it. not sure if that’s just me though…

  • no custom mp3 ringtones! you can only use one of the handful of preloaded ones.

  • no custom alarm tones! you have to use one of the handful of preloaded ones.

  • no games! what, so i have to be on the internet playing javascript games?

  • it comes with a youtube application, but only a fraction of all videos are available because they have to be encoded in a certain way. this is supposed to be fixed soon though.

  • no api! i want to write my own apps for it, but i can’t. people are working on it, but still…

so that’s my review in a nutshell. overall, a nice phone, but if they iron out some of those issues, it’d be incredible. a lot of those issues could be fixed by releasing a software update and opening up their api, but whether or not they’ll actually do it, only time will tell. in the meanwhile, hackers have done a good job playing with th internals of the phone, and its only a matter of time until we get unlocked iphones that will run custom applications.

tweaking your driving route using google maps...

someone from the yahoo maps team did this last hack day (a month+ ago), but for whatever reason, it hasn’t been released by yahoo yet. very useful feature imho (basically, you can drag and drop on the map to change the route, so if you want to avoid a particular road, you can).

scraping websites...

many times, i find myself having to scrape a website for any particular reason. now a days, if i need to do it, i’d probably do it with some version of mechanize (www::mechanize in perl, hpricot in ruby, etc). when i was looking for a bug in one of the scrapers i’d written a long time ago, what took me by surprise was that i’d written a lexer to do it.

i guess this was shortly after i’d taken “languages and interpreters” in college, in which we used [f]lex and yacc/(bison). i just figured it was interesting, after working with a technology, that we try to utilize it. its not necessarily a bad way to do things, i just would do things differently now…

quran facebook application

i figured i’d play around with the facebook api today, so i wrote a little facebook quran app for displaying verses from the quran on your profile page. not very polished if i should say so myself, but… it works (at least for me). if you try it, please let me know if you find any bugs or have any feature suggestions.

you can test it here:

zomg lolcats ftw!

this is off the hook!


they actually have a few test interpreters for it and more examples here.

scratching my head over a c problem...

today, i wanted to try out my test arabic gtk program to see if behdad’s new changes to pango magically fixed the renown arabic shaping issue [in short, it had nothing to do with it]. anyway, i discovered that i needed to install libquran, and to make a long story short, my test program, which used to work before, segfaulted. i ran gdb and valgrind only to find the segfault happening within libquran at the closing of the configuration file (noting this libquran code hasn’t been changed in 3 years now).

i looked at the source, and discovered that the file pointer was becoming null after a call to getline. i tried to see if i could reproduce this in a smaller test program, and i discovered that i indeed could -

#include <stdio.h>

int main(void){
   int n = 0;
   char* tmp;
   FILE* fp = fopen("./testfile", "r");
   getline(&tmp, &n, fp);
   printf("got a str of: %s\n", tmp);
   printf("now fp is: %s\n", (fp==NULL)? "null" : "not null");
   return 0;

the program displayed the first line from testfile, but unexpectedly displayed that fp is null and segfaulted at the fclose. checking the return from getline, i see that it returns successfully (the number of characters it read).

while i got around this problem by modifying the library to do a malloc followed by an fgets, i am just confused -this library code hasn’t been touched in 3 years, it used to work before, and i just repulled it from cvs when i discovered this. so why is it broken now? the only thing that i can think of being different is that my box now runs a 64 bit version of linux, but would that break it?

any ideas?

arabic answers rip off

one of my coworkers sent me this today. pretty funny that they blatantly ripped off the images and such. on a similar note, it seems as though there’s way too much red tape to go through in order to get something like this officially done.

taxes on softdrinks... what next?

today, i went to the supermarket to buy some stuff, and i picked up a 12 pack of pepsi on the way out. when i looked at my receipt, i noticed that there was an additional tax of $0.48 for the pepsi, separate from the overall tax at the bottom (not sure if it is included in the overall x% tax that you pay at the end or not, but regardless, it is more).

safeway receipt

oddly enough, i could buy 1.92 cans of pepsi for the amount of the tax. actually, for the total of $3.98, i could have bought 15.92 cans from the vending machine at work… (although ideally, i should stop drinking pepsi altogether).

ruby and rcairo

i’ve recently been playing more and more with ruby and i really like it. at the same time, i’ve been loving launchy, an open source application launcher for windows (currently using it on my work laptop).

since i love launchy so much, i started to wonder, “why not write something similar for linux?” - now i know one will say that deskbar does the job, but its not quite the same. so anyway, because i wanted transparency and so on, i decided to look into cairo, and the rcairo ruby bindings.

here’s a screenshot of what i’ve been playing with so far:

rcairo demo

note the very right side is the part showing of my open gvim window. while i have yet to organize the code and start writing it for real, the ruby file i have is a proof of concept of all the required pieces i can think of (cairo wise anyway) working together.

some neat videos

this video from steve jobs’ stanford commencement speech (2005) was pretty good:

in addition, the following videos are worth watching (in my opinion):

  • killing us softly - an excellent talk about how today’s advertising schemes are harmful to women and to the society in general (pictures of ads included, so muslim guys may just want to listen rather than watch).

  • don’t buy stuff you can’t afford - a short, yet hilarious, snl skit.

  • pirates of silicon valley - this movie is good for cs majors who want to know how apple/microsoft started.

while most of those were posted in my google reader shared items, no one checks those, do they? :p