Best Software Doesn't Have To Be The Hardest To Make

    A dusty road

    Many, many moons ago, I used to frequent a long dusty and weed-ridden road with the dreams of a pompous education. While the path opened many doors, the dream still remained a mere mirage. The chasm between IT ‘Real World’ and my Engineering classes was shockingly wide, deep and treacherous. My Govt. Engineering College is still an asylum for Dreamers. Their eyes are still full of dreams and heads full of unfinished ideas.

    But after those 4 years, I am not disillusioned. Actually, far from it, I have the fondest memories of trying (perhaps in vain) to try and make a difference, to an educational system gathering dust. ‘Softcorner’ was one such attempt that I had spearheaded. Apart from coining a punningly clever name for a software exhibition. I tried to make the demo’ed software as approachable to the ‘Average Joe’ as possible (You might wonder how many Average Joe’s one would find in an Engg college. Trust me, plenty!!). We designed a mascot character who would explain different technical concepts in a simple language through posters. I had to think how to visualize concepts like Huffman encoding and Data Structures in the language of comics. In fact, some of my friends didn’t know I could draw until that day ! ;)

    Of course, a software exhibition would be incomplete without cool software. We had some bright fellows who were developing pretty interesting software thanks to Pramod Sir, who gave us lots of guidance. But we needed many more projects to make it truly a moderate sized exhibition. I, for one, felt a lot more responsible and wanted to develop 3 or 4 projects in this short time span. Being a little egoistical, I wanted them to be decent crowd pullers as well. In hindsight, a major handicap was that there was no Internet connection, so ‘online applications’ were out-of-question. So in circa 2001, this zeroed down to practically using Visual Basic 6.0.

    I had 3 project ideas at that time:

    1. A
    [Kaun Banega Crorepathi](http://en.wikipedia.org/wiki/Kaun_Banega_Crorepati)
    (KBC) Simulator
    
    1. A Biorhythm
    Calculator
    
    1. A simple VGA game

    My timeline was one week. Please note that I had to manage the logistics of preparing for Softcorner in parallel (I am not going to add ‘meanwhile complete my assignments’, because it wasn’t much of a workload then). All these applications had to look attractive and should be running full screen.

    From the TV Show

    As it turns out, the first project was easiest to code. KBC is basically the Indian clone of the gameshow based on ‘Who Wants to Be a Millionaire?’ All the game requires is a way of picking random questions and allowing the player to pick among four alternatives. Regular viewers of the show are quite familiar with the hexagonal interface and gimmicky confirmatory questions by the host like ‘Lock Kiya Jaaye’ or ‘Confident?’. Armed with Photoshop and a GK book, all this went into the design of the game. The whole affair didn’t take that long and within one night, I had the EXE ready (What a productive one night stand !;) !)

    Fateful Graphs

    But the second project turned out to be the hardest to make, despite being the second time I was developing a Biorhythm application. The date functions and the math never seemed to find a middle ground. I also didn’t have a working Biorhythm calculator to confirm. So in terms of testing, this baby was a nightmare. But I must admit that with its cool sinusoidal graphs and calendar buttons, I was extremely proud of it when it was finished.

    Games are no monkey business

    The game was pretty much DOS based and used Allegro for graphics. It was a variant of “Bouncing Babies” except with Chimps. It had pretty much all the usual features of a DOS game like High scores list, Help screens and various difficulty levels. It was fun designing the physics for this game(isn’t it always so !;) ?), but certainly not eye candy for the masses. Again, adding all the features, took quite a bit of coding in C++.

    The D-day finally came and we were all tensed. We tried to market as best as we could. If we pulled-in only the “geek crowd” and some senior lecturers, then it would turn out to be a flop show. So, we tried the simplest trick in the book, attract more girls! It was simpler than we thought, we started distributing some handouts to the ‘target population’ (an MBA term I later picked up) and also some extensive word-of-mouth publicity. The crowds slowly trickled in and soon a bunch of wide-eyed girls are listening intently to a demonstration of ‘Huffman’s Compression Algorithm’.

    Being egoistical, as mentioned earlier, I always kept an eye on my 3 projects and the results still astound me. The first project was without exaggeration the star of the show. Many wanted copies of the simulator and wanted to know how it worked(!) They kept pondering over questions like - ‘Why does it repeat some questions?’ (it had some 30 odd questions in its database), ‘How does it make such smart comments?’ (random no: generator) etc. If you have ever seen the original game show, the main selling point is the tension built just before the participant answers the question. The viewers hang at the edge of their seats wondering if the words coming out the person on the hot seat will take him/her to the next higher rung or seal his/her fate forever. Many felt that my simulator could recreate a bit of that drama successfully.

    It was an important lesson at that point. Basically, Do your research well before you start coding. Spending Herculean effort on any venture will make you biased on judging the success of the project. But often, simple but effective ideas ‘click’. Probably, I should say one of the best lessons I learnt from GEC.

    PS: All images are copyrighted by their respective owners. They are not screen shots of the software mentioned in the article

    Comments →

    Our Outdoor Shoot is Released!

    Well, well… have I been busy ;) All this while I have been wondering about the long overdue Role change and when it finally happens, I’m still wondering what’s the big deal… Ignore maadi.

    Most wedding albums in Kerala at least have a (partly film songs inspired) outdoor shoot. The locations are traditionally the nearby paddy field or some overgrowth of trees.

    Our outdoor shoot isn’t very different, but hopefully done more tastefully. The locations are places around my hometown, Thrissur like Nehru Park and Velingankunnu. The camerawork was done by Sudheep. Direction by him and yours truly. Click on more to see the video and do write in your comments….

    Comments →

    TAPMI Homecoming 2007

    Hope all of you had a fab weekend. Mine was a little more interesting this time. Almost all of our last week was spent setting up our new apartment in Ladyhill. This week some of us TAPMIians had our good ‘ol Homecoming. Actually more of old than good. However I thought it’s a great idea to take Vidya along to show where I scrammed around for two years.

    There was a party/culturals and it was pretty obvious that the no: of engineers in the current batch of students have shot up, right upto the level of saturation. Not the grooviest night out I have had, I’ve got to say.

    The best part was, of course, Manipal. End-point is still the best place to kick start your romance (and to end them abruptly ;) ). KMC greens, with its curvy beauties, is still the best place to remind you that grass is always greener on the other side. Not to forget the boozer’s paradise – Shackpoint is now relocated to a less deserted area. Except for that, every pothole is very much where we had left it.

    Some pics which we took over the weekend:

    Long Way After PG

    http://www.flickr.com/photos/arun_ravindran/1511389525/ (in front of good ol TAPMI)

    Vidya Lisa Smile

    http://www.flickr.com/photos/arun_ravindran/1511389513/ (if only I had penny for every time I asked her to smile ;) )

    Edit The official snaps from the Homecoming are here http://picasaweb.google.com/alumni.tapmi/Homecoming2007

    Comments →

    Wedding Microsite is Up!

    A big thanks to everyone who greeted me for the Engagement. I’ve been a bit tied up with my own wedding preparations lately that the blog is wanting some updates for sometime now. But I haven’t been neglecting ArunRocks. As the title suggests, welcome a new addition to the site:

    http://www.arunrocks.com/wedding/

    You may find it a little incomplete for now, but don’t worry, it will be updated with the latest photos and gossip ;)

    Keep watching the space!

    Comments →

    Making Python Scripts Show Windows-friendly Errors/Stacktrace

    Most of us love to distribute our python programs to others once you have finished coding a neat little script. For Windows users we package it using Py2exe or cx_freeze. However, many of the end-users will not be happy with a black command window popping up, say, when an error is thrown.

    Of course the alternative is to write a full blown GUI application using WXPython or PyFLTK. Even the latter, though quite lightweight, adds several megabytes to the distribution, when all you need is a simple message-box indicating an error or showing some informational text. Clearly, its an overkill for your throwaway python scripts.

    This is the kind of problem I typically face and I have found a good solution. The answer is ctypes library which comes as a part of the standard distribution from Python 2.5 onwards. It simply calls the messagebox function from user32.dll (which is always present in a windows installation). With the main problem solved, what remained was to obtain the error text and stack trace.

    Let’s see how the code looks like:

    # Importing all the works for a native Win32 Message Box
    from ctypes import c_int, WINFUNCTYPE, windll
    from ctypes.wintypes import HWND, LPCSTR, UINT
    prototype = WINFUNCTYPE(c_int, HWND, LPCSTR, LPCSTR, UINT)
    paramflags = (1, "hwnd", 0), (1, "text", "Hi"), (1, "caption", None), (1, "flags", 0)
    MessageBox = prototype(("MessageBoxA", windll.user32), paramflags)
     # For printing the stack
    import sys
    import traceback
    from time import sleep
    
    def show_popup(text):
        print text
        MessageBox(text=text, caption="Sample App Says...")
    
    def mainloop():
        raise "Uff!"
    
    if __name__ == '__main__':
        try:
            mainloop()
        except:
            type, value, sys.last_traceback = sys.exc_info()
            lines = traceback.format_exception(type, value,sys.last_traceback)
            show_popup("Aiyooooo..... there has been an error!\n" +
                "Exception in user code:\n" +
                "".join(lines) +
                "===== Please mail a screenshot to arunvr@gmail.com ===="
                )
        finally:
            sleep(1) # show the console output for a second so that users can read it
    

    EDIT: This is how it looks like in PyMail, one of my scripts-that-grew-into-an-app ;)

    Screenshot of a Python Stacktrace in a Messagebox

    Comments →

    « Newer Page 23 of 39 Older »