Desi Founder @ Work

14 Jun, 2009

Ins and Outs

Posted by: sharjeel In: carputer| nerds| technology

Some recent ins and outs of my daily tech-life:

Windows 7 is in - XP and Mac OS X*  are out
Ubuntu Server is in - Fedora and RedHat are out

Flock & Chrome are in - Firefox & Safari 4 are out
Postbox is in - Thunderbird is out
XChat2 is in - mIRC is out
MSN Messenger stays in due to locked contacts :(
Google Talk: Always in :)

Google Desktop is in - Yahoo Gadgets and Launchy are out
TrueCrypt is in - Other File encryption tools are out
VLCPlayer & Foobar2000 are in - WMPlayer & KLite are out
GIMP is in - Photoshop is out (I'm a thrifty developer)

Dropbox would so be in - Manual rsync scripts would be out

Console2 is in - Standard Command Prompt is out
IPython is in - Bash is (almost) out
GNUWin32 is in - Cygwin is out

Aptana is in - Standard Eclipse is out
Notepad++ is in - Notepad is out
Emacs is in - Vim is out
PyScripter is in - Other Python only IDEs are out
Putty connection manager is in - PuttyTabs is out

Python, C, C++ are in - Java, PHP are out
NginX is in - Apache2 is out

Mobile:
Windows Mobile 6.1 are in - WM6.0 and 5.x are out
WM 6.5 would soon be in - iPhone, Blackberry & Symbian probably will never make it! Android may come under consideration.
Windows Mobile Device Center is in - ActiveSync is out
HTC Touch Pro would soon be in - TyTN II would be out
TouchFlo 3D is in - Standard Today is out
Opera Mobile is in - Opera Mini is out
Skype & Windows Messenger are in - Fring is out

Desktop Linux box:
Ubuntu 9 is in - 8.04 LTS is out
KDE4.2 is in - GNome & KDE 3.x are out

Carputer:
Ubuntu is in - XP is out
Gnome is in - KDE is out
Hildon is in - RoadRunner is out
Android Linux apps would soon be in -
Microcontrolled power control is in - Direct switches are out
SAIMA (Sharjeel's Artificially Intelligent Machine for Automation) is in - SMSLib is out

* I tried Mac-OS-X for a while. Loved it for awesome user interface, bundled out of the box applications but at the same time hated it for poor keyboard shortcuts and hardware restrictions. I would have switched but Microsoft did a REALLY good job at Win7.

Does Facebook really need to be worried about how to become Twitter? I don't think so. Facebook has grown out so successfully and elegantly that it becomes a benchmark itself for others to follow. Facebook serves a certain distinguished sets of audience than that of Twitter and I think by just poking into other spaces Facebook would simply loose its stickiness and its loyal userbase.

Facebook has just announced that its users would soon be able to have their own usernames. At the first glance it seems to serve a genuine need. For instance, when we developed the Facebook SMS application, we had a hard time letting users send SMS to their Facebook friends. Had every user got a unique username, it would have been as simple as "@username <the message>". But it has its own implication as well.

One of the things I love about Facebook is that they've kept the profiles and their related data sanitized. I believe it is one of the major reasons why Facebook succeeded while other Social Networks lagged behind despite initially having a wider audience. For instance one of the things that fended me off Orkut was that every friend of mine had a funny name and I couldn't figure out who was who. I would get notifications like "Kachoo-Kooma-123 wrote in your scrapbook", "G3n.X Guy has written a testimonial" without having any idea who these guys were. Later on I would come to know that these are updated "elite" names of people sitting next to me.

On the other hand Facebook has worked hard to keep the profiles real, accurate and spam-free. This has helped even technology averse people join Facebook who have hard time figuring out how to interpret "RT @sharjeelq #facebook now offrz usernames http://tinyurl/blablabla". With proper checks to disallow funny names and rigorous privacy settings to encourage putting accurate information they've kept the site accessible to ordinary (non-1337) humans.

Clearly there is a distinction between the general users of Facebook and Twitter. While twitter users may be more progressive, it is a fact that Facebook users are fond of Facebook not because everyone is on Facebook but because what Facebook is in its current form. They are going to allow people to choose usernames for themselves and disallowing funny usernames is not possible at all. Usernames are supposed to be globally unique and when people having common names like Muhammad Hassan would not be able to get sane usernames like hassan, muhammadhassan, mhassan etc. they'd come up with creative names like mhs1pk. And when you would see "Sharjeel: Hassan, it's been long since I saw you. Where are you these days?" replaced with the culture of "sharjeelq: @mhs1pk wru?", you wouldn't want to stick much to Facebook if you are not a twitter fan or like 1337 stuff.

Introduction of usernames in Facebook is bound to make a significant change in the current userbase of Facebook. Let's see if they get benefit from the new audience!

Tags:

23 Apr, 2009

OpenLaszlo: First Impression

Posted by: sharjeel In: Programming

OpenLaszlo is a framework which, officially, is for creating Rich Internet Applications. It takes a higher level markup language Laszlo and converts it into SWF Flash or DHTML. Like many other tools, you are not bound to create only Internet Apps using OpenLaszlo; go ahead if you wanna create your restaurants digital menu card, interface to your car's sensors or for create a skinned menu for your phone.

I just wrote my first piece of code in OpenLaszlo and the experience has turned out be pretty ambivalent. On one hand I feel having lot of power and control to generate a Flash application. On the other hand I feel very restricted due to poor documentation, lack of supporting editors and a language I feel isn't powerful enough and hence inappropriate.

Let me share my experience:

I saw OpenLaszlo couple of years back and thought it to be pretty cool, but kept on my stack of to-learn technologies until yesterday when I encountered a simple problem: My friend had to prepare his PhD proposal defense presentation and he wanted me to create him a three minute count down timer animation for a particular slide. I thought I'd generate an SWF using Flash and embed it in PowerPoint. Then I thought maybe it is a good oppurtunity to learn OpenLaszlo. Alas, this simple problem which I estimated to be a one hour excercise turned out to be 8 hour long nighter marathon; even at the end I couldn't produce something really impressive.

The main reason I took time was lack of good documentation and examples. The basic tutorial is pretty neat but afterwards everything is messed up. I thought maybe I should, just like learning any other language/tool, take a look at examples on net but it turns out that there are few examples as opposed to one would expect. The reference is pretty complex and the guide is not only hard to understand, but seems outdated as well. I couldn't get some things running which were stated in the documentation (I'm pretty sure I was doing what the documentation says).

But that is Ok as with any open source project, documentation and support gets mature over time. However there are other things that deter you from using OpenLaszlo i.e. lack of tools. The running process is horrible for the first time user. There are no editors out there. The best I could do was use Notepad++ was HTML or XML as language. The most annoying this is that there is no debugger. There IS a debug console but not a debugger.

To me, the biggest limitation was the language, the markup language. I felt that I had to hit the keyboard five more times as I would in a scripting language like Python to achieve the same task. For simple UI element level stuff it seems OK but whenever I needed to introduce some logic, I felt as if I were writing code in machine language: so much stuff to do.

For instance, take a look at this piece of code:

 
 <class name="box" bgcolor="red"
         height="100" width="100" />
 
  <class name="borderedbox" extends="box"
         width="${size}" height="${size}"
         onmouseover="this.changeSize(50)"
         onmouseout="this.changeSize(-50)">
    <attribute name="size" value="100"/>
    <attribute name="bordersize" value="3"/>
    <view bgcolor="yellow"
          x="${parent.bordersize}"
          y="${parent.bordersize}"
          width="${parent.width - parent.bordersize*2}"
          height="${parent.height - parent.bordersize*2}"/>
 
    <method name="changeSize" args="pixels">
      this.animate('size', pixels, 500, true);
    </method>
  </class>
 

If instead of a Markup language, had it been modeled in an object oriented script language it would have been much more succinct and readable. Let's see how almost same thing could be modeled in Python:

class Box:
	height=100
	width=100
	bgcolor="red"

class BorderedBox(Box):
	bgcolor="yellow"
	size=100
	bordersize=3

    unnamed_view = view(bgcolor="yellow", x=self.bordersize, y=self.bordersize,
	                      width=self.width - self.bordersize * 2,
                          height=self.height - self.bordersize * 2)
	def __init__(self):
	    self.width = self.size
		self.height = self.size
	    onMouseOver=lambda:self.changeSize(50)
        onMouseOut=lambda:self.changeSize(-50)

	def changeSize(self):
	    somehow_embed_js(""" this.animate('size', pixels, 500, true); """);

Of course it has its own limitations and cannot achieve all what the markup can, I still think that the trade-off would deter people from using it.

Sometimes you want your File Transfer tool to map certain folders on your dev machine to remote folders on your different remote machines. Wouldn't it be great if you could choose a particular file in your project, click it and it automatically uploads in appropriate folder on desired server?

For instance I have an XP dev machine with a project in folder "D:\workspace\saima" and another in "D:\workspace\ismspk". I would like all files in any sub-directory in "saima" to upload on my server "saima" in the appropriate sub-directory in "/home/saima/workspace/". Same goes for rest of my projects and servers. Of course I'd like to do it with a simple click rather than choosing the sessions and folders in my FTP client every time I make a change in a file.

I tried such an option with FileZilla and WinSCP but couldn't find any such option (maybe there exists one). So I thought about writing my own. Since I'm running XP with RSA keys setup with pageant, pscp (Putty SCP Client) was a good choice. Though other command-line utilities such as rsync etc. may do the job pretty as well.

I wrote a small Python script which I linked to my "Send To" menu. To add something in your Send-To menu, goto run, type "sendto" and create a new link here. I created a link to my Python Script and named it "Upload".

Here is how it looks like

Here is the Python script I wrote

 
"""
Author: Sharjeel Ahmed Qureshi
Description: Script for uploading files via pscp
You need to setup putty sessions and your RSA keys first.
Make sure that pageant is running and pscp is in your PATH variable.
Works for windows only
You are free to use this script anyway you like
"""
 
from os import path, popen
import sys
 
import logging
logger = logging
logger.basicConfig(level=logging.DEBUG)
 
FILES_TO_UPLOAD = sys.argv[1:]
 
# PATH_RULES is a config variable which is list of path rules
# Each path rule is a list of three members:
#    ['Local Drive + Directory', 'putty session name', 'remote directory']
# e.g.
# PATH_RULES = [
#    ['d:/workspace/saima/', 'saima', '/home/saima/workspace/'],
#    ['d:/workspace/smsfriends/', 'facebooksms', '/home/fbsms/public_html/www/smsfriends/'], ]
 
try:
    PATH_RULES = [
        # ['localdir', 'puttysession', 'remote_dir'],
        ]
 
    for i in PATH_RULES: i[0] = path.abspath(i[0]).lower()
    if not PATH_RULES: raise Exception("No rules defined!")
except Exception, e:
    logging.exception("There was an loading the config. Check your rules: %s" % e.message)
 
def err(msg):
    logging.error(msg)
    sys.stderr.write(msg + '\n')
 
def match_server(filename):
    """ Gets matching server for a given filename including fullpath """
    global PATH_RULES
    filename = path.abspath(filename).lower()
    for r in PATH_RULES:
        if path.dirname( filename ).startswith( r[0] ):
            psession = r[1]
            r_path = r[2] + filename.rsplit(r[0],1)[1].replace('\\', '/')
            return (psession, r_path)
    return None
 
def upload(filename):
 
    if path.isdir(filename):
        err("Directory Upload is currently not supported")
 
    server = match_server(filename)
    if not server:
        err("No rule available about uploading this file")
        return
    psession, r_path = server
    cmd = "pscp %s %s:%s" % (filename, psession, r_path)
    # logger.debug("Executing command %s" % cmd)
    print cmd
    print popen(cmd).read()
 
for f in FILES_TO_UPLOAD:
    try:
        upload(f)
    except:
        logging.exception("Error while uploading %s" % f)
 
raw_input("Press ENTER to Continue")
 
Tags: ,

16 Feb, 2009

Python: Copy to clipboard

Posted by: sharjeel In: Programming

I use this small utility function for debugging certain Python scripts, especially those for processing data, e.g. moving some bits of information to Excel.

The idea is pretty simple. Just pass it some information and it'll be available in your clipboard.

 
import sys
import win32clipboard as wc
import win32con
 
def copy_to_clipboard(msg):
   if sys.platform == 'win32':
      wc.OpenClipboard()
      wc.EmptyClipboard()
      wc.SetClipboardData(win32con.CF_TEXT, msg)
      wc.CloseClipboard()

It works on Win32 and you need CTypes installed.

08 Feb, 2009

Carputer Kit for Sale

Posted by: sharjeel In: forsale

Few months back I wrote about my Carputer which I built over the past two years. I've had loads of fun with it, especially when I installed few months ago.

Here's a good news for all those who were feeling jealous :P I'm selling my Carputer.

Mini KeyboardDell Optiplex

Garmin external GPS

The stuff includes:

1) Lilliput Touchscreen 8" LCD
2) Garmin GPS Module
3) Dell Optiplex SX 270, 512 MB RAM, 40 GB HDD
4) A4Tech mini camera for reverse assists
5) Havit Mini Keyboard
6) Wires for car as well as for porting it in home
7) Car Audio Kit

Also includes some good piece of Software installed and configured including RoadRunner, GPS Spanner, Google Earth configured with RoadRunner and many more.

Only serious Geeks should contact. Price is Rs. 41,340 (or $516.75). Lahoris will be preferred.

Tags:

24 Jan, 2009

Why Nerds are Unfit

Posted by: sharjeel In: nerds

A healthy body contains a healthier mind. Keeping this in mind, I floated an idea in front of my colleagues. Here was the conversation:

Me: I think we should have our Cricket team. We should play regularly
PersonA: It won't be useful. No one would play eventually. ... (pause) ... On second thought we will. Now Cricket games have networked multiplayer support as well.
PersonB: Do they run on Linux?
PersonA: You can try WINE. You'll have to recompile a few things to support 3D acceleration and ... bla bla bla

19 Dec, 2008

Subjective well being in Gmail

Posted by: sharjeel In: Subjective Well Being

Every morning I log into my machine, a nice Yahoo Widget shows me the weather of my city in a very nice manner. Today, It was drizzling and when I logged in, it showed me a nice photo of clouds and a five day forecast.

Yahoo Weather Widget

When I logged into GMail today, I noticed that the theme was slightly different  than everyday. Was there any rain element previously in the theme? No. Gmail changed the themes slightly according to my weather. And made me smile :)

GMail - Weather localization in Theme

Although this small feature is not a core functionality of an email system,  small tweaks like these make your day; they also differentiate mediocre products from refined ones. Features like these differentiated Apple's iPod with all other MP3 players in the market

Tags:

16 Dec, 2008

Some good products by Microsoft

Posted by: sharjeel In: Uncategorized

Microsoft is the company everyone loves to hate and I am not an exception. But I think we have gone a bit too far in our prejudice. Surely there are looser products by Microsoft such as Internet Explorer which do not care anything about users and prevent the market from taking a good direction. But on the other hand Microsoft also has built products which have changed our lives and most of us really like to use but somehow we don't admit.

I gave some thoughts to it and came up with a list of Microsoft products I really like:

Windows Mobile

I love this mobile operating system! I've owned two Windows Mobile based devices (HTC TyTN II & P3300) and never had a slightest of regret. The version of 6.1 just works great! It is smooth, handles multitasking very well, mobile Office is great and there are so many useful third party applications available. The only thing I don't like about Windows Mobile is the bundled Pocket IE. But you can always install Opera Mini or Opera Mobile.

I find Windows Mobile way better than iPhone, Blackberry, Android and Symbian platforms.

Microsoft Office

I've used a lot of Office suites out there (OpenOffice etc) but nothing comes closer to Microsoft Word, Excel and Outlook. They've worked hard on improving Office to keep their users happy and if you analyze the complexity of these products, you'd realize that they've done a good job. Also, they've been relatively quite fair in this competition :)

Windows XP

Yes! Thats true. Though Windows XP is not something that I am a die hard fan but I find it certainly better than having any other OS on my desktop, especially Linux. I want something that is OK out-of-the box, not something which I have to tweak hard to make really cool. Windows XP serves this purpose really well. However I must congratulate Microsoft for taking a step backwards and coming up with Vista.

For the Mac fans out there: I like my computer running without the cover and hard-disk outside the casing. I would love to make MacOS X my primary OS on my cheap hardware but not until it becomes legal to do so.

Tags:

There are documentaries and movies like Triumph of the Nerds and Pirates of Silicon Valley which give an insight into how Steve Jobs and Steve Wozniak started apple and revolutionized the PC industry. There is a lot of other material out there too accurately based on what was initially recorded in the history. But did history accurately record what really happened?

According to Steve Wozniak's autobiography "iWoz: Computer Geek to Cult Icon" a few of the facts went inaccurately in the history and they stayed like that. Even to this day people are of their belief. Woz has tried to get some facts straight.

Here is a comprehensive list of widely believed facts that, according to Steve Wozniak, were inaccurately recorded initially and got spread:

  • Steve Jobs and Steve Wozniak were not classmates. They were several years apart. Though Jobs attended the same school Woz did.
  • Unlike Steve Jobs, Wozniak did not drop out. He took off from Berkley and after doing Apple-II he returned to school and completed his degree.
  • The two Steves did not design the first Apple computer together. Steve Wozniak did it alone.
  • Steve Wozniak did not quit Apple in protest. Although he was not satisfied the way Apple II team was treated, his main reason was that he wanted to start a new company to develop universal, programmable remote controls.
  • Steve Jobs was never fired from Apple. Steve resigned from Apple in 1985 after he was stripped of his responsiblities by the board.
  • When Steve Jobs returned to Apple, iPod and iMac were already designed by Jonathan Ive. Steve just put certain things in order and marketed them really well.
  • Technically, Steve Wozniak never left Apple. He's still on Payroll of Apple and holds an employee cards even to this date!