Archive for the 'General' Category

A Very Special Day

Saturday, November 29th, 2008

I was recently invited to give a talk on FOSS usage in the IT Industry by Prof. C N Krishnan and Dr. Srinivasan of NRC-FOSS. Now, this is one organization that I always held in great regard, so it was imperative that I accept their invitation. It was a truly memorable day. For the uninitiated, NRC-FOSS is one of the very first university-level formal organizations promoted by the Ministry of IT, Govt. of India for spreading the FOSS word. True to their mission, they have achieved phenomenal results, and early this year, it was great to see hundreds of students getting introduced to FOSS through their annual event, FossConf.in.

Folks, this is special. Because, of NRC-FOSS’ efforts, FOSS curriculum is offered as 2 electives in all of Tamilnadu engineering colleges. This is being widely copied by colleges across the country now. And today when I went to the seminar, I was astounded by the awareness of FOSS by pretty much everybody from the Profs themselves, to the Dean and even the Vice-Chancellor. Truly, it’s an inspiring effort, and NRC-FOSS is one of the few govt.-sponsored organizations which shows how much change you can bring by getting Industry and the Colleges to be stakeholders in IT education.

I was touched by the fact that many attended inspite of pouring, non-stop rain, it made it all the more worthwhile for me, as I had to brave the rains myself. I did my best to evangelize FOSS and explain what we do as part of our job. I was pleasantly surprised when one of the students followed me outside the auditorium to ask a few more questions. As you can probably see, I’m still aglow from the interaction. There’s nothing more fulfilling than being able to give back and open a few doors for the enthusiastic students.

Well done, and thank you NRC-FOSS. I don’t know how much benefit the students got out of my talk, but it certainly made me feel better about the path I’ve chosen. I’m betting at least some of them will make this country proud.

Print

I’m Back!

Thursday, October 2nd, 2008

After a rather long absence from writing anything here, I’m back. There is only so long I can hold back from yammering about one cool thing or the other that I see, inspite of the hectic schedule.The last one year has been a great adventure. Some of you have followed it here, and I’m thankful to you. See the number of subscribers to this blog and I wonder who it could be. I hope you’re getting some value out of it. I can only say things will be getting better.

As some of you know, Viamentis started a life of it’s own last year around this time. Previously, it was just me hacking away nurturing dreams of building this company, and hiring more developers who are as much in love with the web as I am. And I did that. I got to work with two really talented ones, and it has been a great ride. Unfortunately, the ride did not last long. Of course, I have myself to blame. I underestimated what it takes to actually run a web development services company.

Though I loved every minute of creating something of my own, but it meant that I was moving away and away from the things that I really loved – writing code, exploring new technologies. Still, I did not really regret it, because Unni and Divya were really enthusiastic about checking out new stuff and blogging about them here. I knew that there would be some administrative overhead that I would have to handle.

In the end, it was down to every startup’s curse – burning cash too fast – that did us in. I had to let both of them go, because, let’s face it, Viamentis is fully boot-strapped, out of my pocket. I really hated letting them go. But I guess we all have to start somewhere, and it was a great lesson to me. Though it has been very difficult, I would not miss the experience for anything. It’s absolutely true that you don’t actually know something until you start doing it. I learned a lot more about running a business by doing it for six months than I did in years of reading business books.

So, here we are, back to Viamentis being a single-person company again. Of course, that means my schedule is a lot more hectic – luckily, most of the clients that I picked up stuck with me, and I’m grateful to them. But I think there is an upside after all – now I realize why I have to find a good partner – there is no way I can handle everything in a business like this. Also, being on my own again means that there will be a little bit of free time -  so I can go back to tech stuff that never had time for checking out.

There are a couple of new languages that I’m dying to check out. Also, the mobile arena is really getting interesting – with iPhone SDK and Android. Though I always loved the iPhone, for now I’m more leaned towards Android, mostly because it uses a language I know (Java) and uses a toolset that is very familiar to me (Eclipse). Also, the emulator was pretty neat – I got a taste of what G-1 would look like, right on my desktop. I would still like to check out a bit of iPhone SDK too, but that would mean I have to change a lot of my development environment – the biggest one being getting a Mac. Now, that would take a bit more time. With Android, I can just start right away on my beloved Ubuntu box. More on this later.

If you made it this long, thanks! Hang on, there is a lot of interesting stuff coming up! :)

Print

web.py – a web framework on Python

Friday, May 9th, 2008

web.py is a web framework for python that is as simple and it is powerful too.Installation steps are given below , make sure your system is having Python’s latest version and easy_install (Easy Install is a python module (easy_install) bundled with setup tools that lets you automatically download, build, install, and manage Python packages).

$sudo easy_install easy_install web.py

Or to install web.py, download and do python setup.py install.

Now the web.py is ready to use.Basically web.py is not following MVC architecture and here we use a code.py to write our classes and methods ,for rendering views we can use a templates folder.

Getting started with web.py

Create a file called code.py : where we writing our control methods

Create a directory for HTML file , lets say “templates” : where we creating the needed views for our methods

Now we have to import our web.py module , so add a line to our code.py

import web

web.py is imported to our application now.Now we need to tell web.py our URL structure.We can strt with a simple one now , add the below lines to your code.py

urls = (
'/', 'index' )

In this first part is regular expression that matches the URL and the second part is the name of a class to send the incoming request.Have to write the “index” method now.Open up the code.py and add a method called index , we can first try to print a “HELLO WORLD” on browser using web.py.

class index:
def GET(self):
print "HELLO WORLD"

This GET function will now get called by web.py anytime someone makes a GET request for “/”.Need to finish up this with a final line telling web.py to start serving web pages:

if __name__ == "__main__": web.run(urls, globals())

This tells web.py to serve the URLs we listed above and looking up the classes in the global namespace of this file.

Now run on your shell

$python code.py

The internal server of web.py gets started now , by default it will start at port number 8080 , you can change it by specifying the port you wish to run the server.

Adding templates

We can add all the templates to some directory , lets say templates , now add an index.html inside that.We can use either use simple html or web.py’s templating language to add code to our HTML.

<em>HELLO WORLD</em>

To get these templates inside our application add a line to code.py

render = web.template.render('templates/')

Databasing

Before start using a database, make sure that you have the appropriate database library installed. For MySQL databases, use MySQLdb and for Postgres use psycopg2.Now above our web.run line add the following line to connect to database.

web.config.db_parameters = dict(dbn='postgres', user='username', pw='password', db='databasename')

This will connect to our database.Now you can make try on a simple application which will create a blogging system.You can give a try on simple application which will create a blogging system.
blog.zip

Print

Scriptaculous – a Javascript library

Friday, March 14th, 2008

Scriptaculous is a Javascript library for providing Web 2.0 effects in web pages. Scriptaculous is built on top of the Prototype library(prototype.js).Effects provided by scriptaculous include Visual effects like Appear,Higlight, Shake etc of DOM elements. It also provides advanced functions like Slider, Drag & Drop and Autocomplete for text boxes.

A drop and drop shopping cart example can be see here

Scriptaculous can be downloaded from here

Download and link the scriptaculouos.js file to your html page. Using scriptaculous effects is very easy

Example:

Effect.Appear('element_id'); (element_id is the id of a DOM element)

Similar examples with demo can be seen here

Scriptaculous library by itself is simple, but Ruby on Rails makes it even simpler. Rails has wrappers around scriptacuolus methods.

Examples:
i :o nclick => visual_effect(:highlight, 'msg', :duration => 1.0)

ii. <%= draggable_element 'idOne', :revert => true %>

Print