mirnazim's blog
Happy Birthday GNOME
Submitted by mirnazim on Wed, 08/22/2007 - 11:28
On August 22nd 1997, a phenomenon started to take its first steps. This was GNONE.This has been a long way here. GNOME has come up from being a small project with relatively very very new toolkit in 1997 to a mature and rock solid desktop environment. I met GNOME(and Linux) very briefly in winter of 2000. Then from January 2002 I started using it fultime and it has been wonderful to see GNOME grow all these year.So let's all wish happy birthday to our beloved GNOME. Powered by ScribeFire.
Ubuntu May Be The First Distro To Support Winmodem...
Submitted by mirnazim on Sun, 10/22/2006 - 02:57
Now this is something real cool. Ubuntu, The Linux Distro that "Just Works", may well be the first distro to support those notorious winmodems, OUT OF THE BOX.
Check out this discussions.
Support for Winmodems under Linux had been a constant annoyance to many people, especially those from the third world countries like India. It was also a major road block for lot of people. I personally know about guys who almost coverteded but when they came to know the fuss they had to go through to set up modems, they said we are fine wihout it.
jQuery is Slow! huh!
Submitted by mirnazim on Tue, 10/17/2006 - 00:11
Dion Almer reports
Claudio Cicali thinks benchmarks are boring and useless, so he decided to conduct a series of micro-benchmarks of CSS selector tests with both Prototype and jQuery. He decided to do this after he saw others observe:
Reality behing Linux Based Laptops
Submitted by mirnazim on Thu, 10/12/2006 - 22:53
Recently, we have seen a huge growth in the sale of Linux based laptops. Bundling of Linux with the laptops has considerably reduced the price tags with laptops available as low as Rs. 20,000 from ACi, Zenith Acer, and Sahara. But point is that are these laptops vendors accutally commited to the cause of Linux adoption or it is just a trick employed to trigger up the sales.
State of Linux based Laptops.
Current, major players is the Linux laptop areana are Acer, Compaq, Aci, Zenith and Sahara. All of them claim that their products are linux friendly. Lets take the case of Acer. I own a Acer TravelMate 2310 notebook. It came preinstalled with Linux.
Are these notebooks really Linux friendly.
There has been a major leap in hardware compatibility in Linux. All the major hardware vendors either have drivers for Linux or are supported by the drivers from Open Source community. Be it LAN card, graphics hardware, touchpads, displays etc. For instance my Acer notebook has SiS PCI Fast Ethernet, SiS M661MX Display, Synaptics Touchpad and AC 97 audio, all of which are already very well supported on Linux one way or the other.
But when it comes to devices which have reputation for not being Linux friendly, tall claims of Linux friendliness fail utterly. I am talking specifically about Internal Modems and WiFi cards. When I tried to connect my dial up connection through internal modem, I found out that it was not detected automatically. Then I thought resource CD, that came with my notebook, might have some sort of instructions. It contained all the drivers and a user manual, but to my surprise all these drivers were for MS Windows. Even manual was also meant only for MS Windows. Best part was when I searched it for the word 'Linux'. The word 'Linux' was not even mentioned in that manual. Same was the fate for my Atheros WiFi adapter, though I managed to get it working thanks to various NDISWrapper utilities.
Now the next logical step was to contact Acer Support Center. Next day at office, where we have a broad band connection, I mailed Acer informing them of my problems and asking for suggestions. They did not even bother to respond. For few days, I kept mailing them, but it just did not seemed to have any effect. After that I was able to get modem working using slmodemd packages, but that is not a reliable solution, so I shifted back to external modem using serial to USB converter to connect my serial external modem.
How many Linux laptops actualy remain Linux laptops.
This is a question that most of the Linux enthusiasts ask. How many linux laptops actually remain linux based. As far as Acer is concerned, I get an image that they assume that people are going to format the laptop for MS Windows. This is evident from the fact that resource CD contains drivers and instruction manual only for MS Windows. Linux is not even mentioned there. There are no linux based drivers avaiable for downloads from acer website while all the MS Windows based drivers are available. Online manual is also silient when it comes for troubleshooting on Linux.
Conclusion.
What I personally feel is that these vendors are just interested in getting more and more units sold. Hardware is not picked properly. Mostly internal modem and WiFi cards fail. No information, what so ever, is provided on troubleshooting tips on Linux.
If such is the scenario, I really think are these vendors just trying to cash on Linux brand and taking customers for a ride.
powered by performancing firefox
How jQuery saved my day
Submitted by mirnazim on Sun, 10/01/2006 - 02:00
While working on an assignment to write a front-end for Wikipedia, I ran into a lot of troubles. First, I searched if there was someone providing API's to get articles from wikipedia(I hate site scrapping). Found Ontok, after working on it for some time, I realized that id was more PITA than sites crapping. They changed API's three times in two weeks and some how managed fuck the hell out of the wiki markup, with some weired encoding that seemed to work fine inside the text editor, when viewed directly from a web browser and when queried from localhost(with PHP) but somehow, it never worked when accessed from my clients box(I was using same configuration as my clients box). Finally decided to do it with cURL(sigh.. :().
Now after using cURL to get articles, client wanted all the links to be rebuilt to point to the search URL of his site rather than wikipedia. Now this required a lot of regular expression work to get this working. I hate to admit, but I din't not want to write regular expression and debuging them for a week. Don't get me wrong, Regexp is a very very powerfull tool but equally easy to shot in your foot.
jQuery came to rescue:
jQuery is a damn cool JavaScript toolkit that really rocks. Here is a bit of code that did all the trick for me: Below is the code snippet that did the trick:
jQuery is a great way to do JavaScript. It actually makes JavaScript fun.
Very easy to learn and very intutive.
Do check out http://www.visualjquery.com/ for a great visual api docs for jquery.
Now after using cURL to get articles, client wanted all the links to be rebuilt to point to the search URL of his site rather than wikipedia. Now this required a lot of regular expression work to get this working. I hate to admit, but I din't not want to write regular expression and debuging them for a week. Don't get me wrong, Regexp is a very very powerfull tool but equally easy to shot in your foot.
jQuery came to rescue:
jQuery is a damn cool JavaScript toolkit that really rocks. Here is a bit of code that did all the trick for me: Below is the code snippet that did the trick:
Notice at the end i am setting display:block for an element with id 'wiki-article'. This is because this javascript script executes when DOM tree for the page is ready. So until the page loads fully, the fetched article will still have original links. We do not want people to see orignial links. So the article was hidden first and we will display it only when it is ready.
<script src="img/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
var search_url = 'http://www.yoursite.com/search.php?q=';
var wiki_url = 'http://en.wikipedia.org/wiki/';
$(document).ready(function() {
// Get all A elements with there 'href' attributes.
$("a[@href]").each(function(i){
//Split the href to pieces
var link = $(this).href().split('/');
//Check if it is an interlink on wikipedia
if(link[link.length-2] == 'wiki'){
// for debugging with FireBug. A must have for web developer.
//See http://www.joehewitt.com/software/firebug/
console.log(link);
//Split the last part of the link to check if it is a non-article link
//Non-Article links will include a ':' like 'Special:sreach', 'Category:Computer'
//We want to keep non-article links intact
var article = link[link.length-1].split(':');
//An article link does not contain a ':', hence will not split
if(article.length == 1){
// This is what we need prefix with the search_url. i.e.
$(this).href(search_url+article[0]);
} else {
//rebuild all other links with to wikipedia, because wikipedia uses relative linking
$(this).attr({target: '_blank', href: wiki_url+link[link.length-1]});
}
} else {
// Make external links open in a new window.
$(this).attr('target','_blank');
}
});
$("#loading").css('display', 'none');
$("#wiki-article").css('display','block');
});
</script>
jQuery is a great way to do JavaScript. It actually makes JavaScript fun.
Very easy to learn and very intutive.
Do check out http://www.visualjquery.com/ for a great visual api docs for jquery.
powered by performancing firefox
Brief highlight of Python 2.5
Submitted by mirnazim on Thu, 09/21/2006 - 00:36
Highlights of Python 2.5:
New Language Features
- Internally, the Python compiler now converts the source code to an
abstract syntax tree (AST) before producing the bytecode. - The 'with' operator replaces a common try/finally idiom that results in much
cleaner and safer code. - Generators gained push, throw and close methods. Values passed to push
will be returned by the yield statement when the generator is resumed.
throw takes an exception and causes the yield statement to raise the
passed exception in the generator. close is used to terminate a generator.
This turns generators into a form of coroutine and makes them even more
powerful. - Conditional expressions of the form (format: TrueValue if Condition else FalseValue)
were added. - Import can use both relative and absolute imports when inside packages.
- Try/except/finally were changed so that it's now possible to have both except
blocks and a finally block for the same try block. - Exceptions have become new-style classes, and the exception hierarchy has
been rearranged a bit. - Internally, Python was changed to use the Py_ssize_t type - this means that
many structures that were limited to 2^32 objects can now hold up to 2^64
instead.
- partition and rpartition methods were added to str and unicode. This
greatly simplifies the process of searching and splitting strings. - New builtins any and all evaluate whether an iterator contains any or all
True values, respectively. - min and max gained a key keyword parameter, analogous to sort.
- In keeping with the theme of adding tried and true packages to the standard
library, in 2.5 we've added ctypes, ElementTree, hashlib, sqlite3 and wsgiref
to the standard library that ships with Python. - Google's summer of code resulted in a new cProfile profiling module. This is a
much more efficient version of the venerable profile.py module that's shipped
with Python for many many years. GSoC also gave us a rewritten mailbox module
that can both read and write mailboxes in a variety of formats. - The struct module was updated to support a new Struct object. These are similar
to the re module's compiled form of regular expressions. - Some other smaller modules added to the standard library include uuid, msilib
and spwd.
Looking forward to get my hands wet on it.
powered by performancing firefox
Finaly! Python 2.5 it out.
Submitted by mirnazim on Thu, 09/21/2006 - 00:04
Python 2.5 is out. I am really excited about the new features in this version. Check out AMK's section on Whats New in Python 2.5.
I will write my comments on the changes in new version in detail.
Looking forward to get my hands wet on it.
I will write my comments on the changes in new version in detail.
Looking forward to get my hands wet on it.
powered by performancing firefox
This touched my heart
Submitted by mirnazim on Fri, 09/08/2006 - 00:25
I just recieved a mail from one of my buddies Raashid Malik, with this short story. It almost managed to roll a tear down my cheek.ONE BEDROOM FLAT... AN INDIAN SOFTWARE ENGINEER'SLIFE... - A Bitter RealityAs
the dream of most parents I had acquired a degree in Software Engineer
and joined a company based in USA, the land of braves and opportunity.
When I arrived in the USA , it was as if a dream had come true.Here
at last I was in the place where I want to be. I decided I would be
staying in this country for about Five years in which time I would have
earned enough money to settle down in India .My father was a
government employee and after his retirement, the only asset he could
acquire was a decent one bedroom flat. I wanted to do some thing more
than him. I started feeling homesick and lonely as the time passed. I
used to call home and speak to my parents every week using cheap
international phone cards. Two years passed, two years of Burgers at
McDonald's and pizzas and discos and 2 years watching the foreign
exchange rate getting happy whenever the Rupee value went down.Finally
I decided to get married. Told my parents that I have only 10 days of
holidays and everything must be done within these 10 days. I got my
ticket booked in the cheapest flight. Was jubilant and was actually
enjoying hopping for gifts for all my friends back home.If I miss
anyone then there will be talks. After reaching home I spent home one
week going through all the photographs of girls and as the time was
getting shorter I was forced to select one candidate.In-laws told
me, to my surprise, that I would have to get married in 2-3 days, as I
will not get anymore holidays. After the marriage, it was time to
return to USA , after giving some money to my parents and telling the
neighbors to look after them, we returned to USA.My wife
enjoyed this country for about two months and then she started feeling
lonely. The frequency of calling India increased to twice in a week
sometimes 3 times a week. Our savings started diminishing. After two
more years we started to have kids. Two lovely kids, a boy and a girl,
were gifted to us by the almighty. Every time I spoke to my parents,
they asked me to come to India so that they can see their
grand-children.Every year I decide to go to India. But part
work part monetary conditions prevented it. Years went by and visiting
India was a distant dream. Then suddenly one day I got a message that
my parents were seriously sick. I tried but I couldn't get any holidays
and thus could not go to India . The next message I got was my parents
had passed away and as there was no one to do the last rights the
society members had done whatever they could. I was depressed. My
parents had passed away without seeing their grand children.After
couple more years passed away, much to my children's dislike and my
wife's joy we returned to India to settle down. I started to look for a
suitable property, but to my dismay my savings were short and the
property prices had gone up during all these years. I had to return to
the USA . My wife refused to come back with me and my children refused
to stay in India . My 2 children and I returned to USA after promising
my wife I would be back for good after two years.Time passed
by, my daughter decided to get married to an American and my son was
happy living in USA. I decided that had enough and wound-up every thing
and returned to India . I had just enough money to buy a decent 02
bedroom flat in a well-developed locality.Now I am 60 years old and
the only time I go out of the flat is for the routine visit to the
nearby temple. My faithful wife has also left me and gone to the holy
abode.Sometimes I wondered was it worth all this? My father,
even after staying in India, had a house to his name and I too have the
same nothing more.I lost my parents and children for just ONE EXTRA BEDROOM.Looking
out from the window I see a lot of children dancing. This damned cable
TV has spoiled our new generation and these children are losing their
values and culture because of it. I get occasional cards from my
children asking I am alright. Well at least they remember me.Now
perhaps after I die it will be the neighbors again who will be
performing my last rights, God Bless them. But the question still
remains 'was all this worth it?'I am still searching for an answer................!!!!--- By an Indian Software Engineer who was in US
Codding is the real thing
Submitted by mirnazim on Wed, 09/06/2006 - 01:33
Update: fixed some spelling mistakes.
Today I recieved an email from 'barcamp_delhi', one of my subscribed mailing list on Yahoo Groups. It was about a friend of someone asking about a problem existing in the mindset of "Indian Programmers". It was a long email, but the whole point is summarized in just one paragraph.She(some one not from India, actually China) had observed that in India Guys have this strange notion that Coding is only real test of knowledge . so untill your manager can't sit with you and punch-in a syntactically right code . your team will not listen to you . design, UI,Usability,Business Logic are looked down . guys who write code consider these things as gimmicks and want to do Pure Computer Sc which in there opinion is only Prog /coding . It is funny and ironic, at the same time. Funny because this person(who said the above verses) is some one who is actually leading a team of tech guys and Ironic because non tech managers normally misunderstand geeks too much.The root of all evil:Basically, almost all geeks and nerds are creative and artistics people, who know that they are creativity. This creativity, along with self conciousness about the same, brings along arrogance. So it is quite natural to look down upon people from other fields mostly management. Now, managers will argue that management is also a creative job. I do not disagree, but it is like my "field of art is better than yours" situation. Painter think they are better than scluptors, scluptors think they are better than wood carvers and so on. But, this a universal problem, not with Indian programmers(until and unless you mean Indians are better programmers ;)).But, problem lies in the management of technical guys(I have to say that). Most of the time, geeks are managed by people who don't even know the 'P' of programming. Even worse most of the time, they do not know the real power and limitations of technology. Managers set non-sense deadlines on programmers, keep interuppting them by the famous Project Manager punch line "What is the status", keep insisting on mailing the daily status reports when same information is already present in support tools like issue tracker, project management app etc. This is what leads to all the problems. Design, Business Logic solvers are looked down upon by programmer, only when design, UI, usability etc are done by some one who are morons when it comes to programming. By the way, what makes you think that a programmer who can convert you design into code cannot design and develop business logic. The solution:Best solution to this problem is to "let the geeks be happy in their geekdom". Do not try to tell them there are people better than them in other fields. Such a faith keeps things going and your programmers happy and super charged. In other words, "Do not break their moral".Try to get a project manager who has a background in technology, even better if he is a programmer himself. That way your team can always look up to him. It is a kind of satisfaction to have someone on your team who know more than you and can help you if you get stuck. If your project manager's answer to every technical query is "I don't know, I am not a programmer", GOD help your team. Remember, we are programmers and we are the best community when it comes to learning fromeach other.Let your geeks do the design and time estimate for their work. After all it is them who has to do it not the Project Manager. Your geeks are best estimators of time. Only bargain on it later when they come up with their designs and estimates. They will love your comments and most of the time accept them(if your comments are worthy). Trust plays an important role here. Trust you programmer, they will in turn trust you. Moreover, it lets your programmers feel that they are in control, means moral goes up, meaning productivity goes up, meaning quality goes up, meaning projects are on time, meaning clients are happy, meaning more money comes, meaning organization grows.Remember, in software business, programmers are the most important assets, not your managers. It is comparatively easier to find good managers than good programmers.Remember there are only to types of programmers, 'God' and 'Bad'. God programmer are futher categorized in beginners, intermediate, advance, expert, wizard, etc. Bad programmers are just bad. There is no such thing a beginner bad programmer, advance bad programmer etc.In the end, to implement all these solutions, just get an agile development process set up in your organization. Take a look Extereme Programming. You will get all these benifits in one go.What ever I have said above, comes from personal expereince from my running own company, XenSoft Labs(http://www.xensoftlabs.com) and from one of the best place to work at, Tekriti Software(http://www.tekritisoftware.com/), where I worked previously. People there, took care of all the above stated things very carefully and very "implicitly", without a single programmer ever noticing it. I, myself realized this when I started my own venture. Bieng implicit is very important. Don't go one touting the trumpet and boasting your programmer that you are taking care of them, make them feel it without ever saying a single word.Moreover, there is a great essay on Eric Raymonds web page about managing programmers. Read it. Though, I do not agree on everything Eric says in it(thats a different story, altogether), you will still learn much more about managing programmers. There is another article for programmers, teaching programmers how to deal with managers. Make your programmers read it. But for god sake don't ask your managers to tell the programmers to read it and vice versa. You will make it sound bad. This is something a programmer's mentor should do(hope you have the mentoring system for your programmers).powered by performancing firefox
How many lines of code do you produce per hour
Submitted by mirnazim on Mon, 09/04/2006 - 23:24
Today I took an exercise. I tried to test how many lines of useful code can I produce per hour. Before going into the results, I will tell you about the strategy I adopted to take this exercise.
Test Problem:
Problem had to be something that I understood very well and could finish in one hour using the tools I best know. I decided on a simple discussion list, which allows you to add a topic and reply to it. No user authentication and no fancy UI's. Seems doable in one hour.
Class and Database Design
Step one was to define the class design and database schema for our discussion list. I took an object oriented approach instead of writing standalone scripts. It took me arround 15-20 minutes to fully document the class and database design.
Two classes one for topic and other for comments are to be implemented, for features like new topic, edit topic, delete topic, new comment, edit comment and delete comment.
Start coding:
I took this test once using PHP and once using python. The results are below.
But this was just a toy problem and not a real world problem. Well, I am doing this kind of study these days a lot. These day, I am maintaining an extensive log of time I spend on coding. So, far results don't seem very encouraging.
Alien Problems:
Problems about which I know nothing, those have seen them for first time:
12 lines of usefull code per hour :((, includes thinking on it :|
Some what, I know problems:
Problems, that I know about but have not solved before.
33 lines of usefull code per hour, including thinking
Ah, I have done that before:
63.5 lines of useful code per hour
Test Problem:
Problem had to be something that I understood very well and could finish in one hour using the tools I best know. I decided on a simple discussion list, which allows you to add a topic and reply to it. No user authentication and no fancy UI's. Seems doable in one hour.
Class and Database Design
Step one was to define the class design and database schema for our discussion list. I took an object oriented approach instead of writing standalone scripts. It took me arround 15-20 minutes to fully document the class and database design.
Two classes one for topic and other for comments are to be implemented, for features like new topic, edit topic, delete topic, new comment, edit comment and delete comment.
Start coding:
I took this test once using PHP and once using python. The results are below.
- PHP: I used plain PHP with native mysql libs and no PEAR or any other libs were used. Two classes, when finished, were arround 150 lines of code, without comments and took arround 55 minutes.
- Python: I used sqlite for database and and CGIHTTPServer available in standard library of python distribution. Design remained same and it was arround 100 lines of code and time roughly the same, 55 minutes.
- These 55 minutes do not include HTML design.
- Note that python normally requires less amount of code that other languages to get same thing done.
But this was just a toy problem and not a real world problem. Well, I am doing this kind of study these days a lot. These day, I am maintaining an extensive log of time I spend on coding. So, far results don't seem very encouraging.
Alien Problems:
Problems about which I know nothing, those have seen them for first time:
12 lines of usefull code per hour :((, includes thinking on it :|
Some what, I know problems:
Problems, that I know about but have not solved before.
33 lines of usefull code per hour, including thinking
Ah, I have done that before:
63.5 lines of useful code per hour
powered by performancing firefox


