Thursday, 1 March 2007

Microsoft's true Ultimate Keyboard - is it GNU/Linux friendly ?

The first computer I owned came with a Microsoft Intellimouse serial mouse. It was a three button scroll wheel mouse which I really liked for its perfect shape and comfort in using it. I was even able to get it to work with GNU/Linux, though with some tweaking.

Almost all people, when they hear the word Microsoft, equate it with substandard bug ridden OS, monopoly and unfair trade practices. But a little known fact about Microsoft is that for a company with such a big negative image, it surprisingly manufactures robust, well designed, ergonomic hardware. A case to the point being the keyboards, mice and XBox. And the hardware is surprisingly compatible with GNU/Linux. Not that Microsoft went out of their way to support Linux.

Gizmodo - a gadget blog introduces the latest hardware offering of Microsoft which is an aesthetically pleasing, ergonomic keyboard. It is a top of the line Wireless Entertainment Desktop 8000 keyboard.




Gizmodo recommends this keyboard only for people like bloggers, programmers or chat maniacs who are at their computer for 10+ hours a day. If you can deal with the difficult function keys, the lack of a num-pad, the small arrow keys, the weird Windows key placement and the gigantic price of $249, you'll definitely feel like you're typing on the ultimate keyboard.

But the big question that has gone unanswered is this. Is this beautiful thing GNU/Linux friendly ?

Wednesday, 28 February 2007

Python Phrasebook - Essential Code and Commands

Python PhrasebookOne of the most asked for feature in a book by programmers and coders is a quick reference for getting things done. That is, all the useful bits of code and other gems pertaining to a language compressed into a book whose size is ideal for carrying around where ever you go. Truth be told, there are not many such books around. When you search for a book which acts as a ready reference for any programming language, you inadvertently run into hefty 800 to 1000 page books which require significant effort on the part of the reader to navigate, let alone carry it around.

But the Phrasebook series is a set of books on a variety of programming languages which is published by Sams Publishing which aims to address this need. The advantage of the phrasebook is that it is small enough to be held in the palm of your hand. And the number of pages are no more than 300. Which means it is the exact dimension and size of an average pulp novel. But the difference is that each of those 300 pages contain a wealth of knowledge in the form of bits of useful code which can be readily used by programmers.

One such phrase book is the Python Phrasebook which has a very rich collection of customizable code snippets. "The Python Phrasebook - Essential code and commands" is authored by Brad Dayley and is divided into 10 distinct chapters each catering to a particular aspect of the Python language.

While the first chapter provides an overview of the Python language, the succeeding chapters provide bits of code in Manipulating strings in python, Managing data types, managing files, threads and databases in python and so on.

To highlight the usefulness of this little book, suppose I want to say find the right code to access a list using Python. I can do it in a number of ways. I could troll the internet to get the exact code, go through a good book on python which may or may not contain the exact code I want or make use of the easier way which is to use the Python phrasebook as a ready reference and find the exact code I am looking for in the "Managing data types" chapter. This little book contain a chapter on implementing internet communication where the author provides bits of code to achieve tasks related to sockets. And also chapters which show the code to process HTML and XML files using python.

One thing worth noting is that each code snippet is accompanied by an explanation of the code and also a short example program which utilize the code. This makes it much more easier for a Python programmer to understand the use of the code. And all code snippets address real life problems. So you will find code snippets to say, retrieve images from HTML documents, allowing users to upload files via CGI scripts, connecting to a MySQL database server, defining lists, splitting strings and so on which range from the common things to the other end of the spectrum of accomplishing specialized tasks.

To give a preview of what you get in this book, here is a sample excerpt from the Chapter 7 titled "Implementing Internet Communication".

Retrieving Email from a POP3 Server
The text below is the copyright of Sams Publishings.
mServer = poplib.POP3('mail.sfcn.org')
mServer.user(getpass.getuser())
mServer.pass_(getpass.getpass())
numMessages = len(mServer.list()[1])
for msg in mServer.retr(mList+1)[1]:
The code

The poplib module included with Python provides simple access to POP3 mail servers that allow you to connect and quickly retrieve messages using your Python scripts.

Connect to the POP3 mail server using the poplib.POP3(host [,port [,keyfile [,certfile]]]) method, where host is the address of the POP3 mail server. The optional port argument defaults to 995. The other optional arguments, keyfile and certfile, refer to the PEM-formatted private key and certificate authentication files, respectively.

To log in to the POP3 server, the code in pop3_mail.py calls the user(username) and pass_(password) methods of the POP3 server object to complete the authentication.

NOTE: The example uses getuser() and getpass() from the getpass module to retrieve the username and password. The username and password can also be passed in as clear text strings.

After it’s authenticated to the POP3 server, the poplib module provides several methods to manage the mail messages. The example uses the list() method to retr ieve a list of messages in the tuple format (response, msglist, size), where response is the server’s response code, msglist is a list of messages in string format, and size is the size of the response in bytes.

To retrieve only a single message, use retr(msgid). The retr method retur ns the message numbered msgid in the form of a tuple (response, lines, size), where response is the server response, lines is a list of strings that com- pose the mail message, and size is the total size in bytes of the message.

NOTE: The lines list returned by the retr method includes all lines of the messages, including the head- er. To retrieve specific information, such as the recipi- ent list, the lines list must be parsed.

When you are finished managing the mail messages, use the quit() method to close the connection to the POP3 server.

import poplib
import getpass
mServer = poplib.POP3('mail.sfcn.org')
#Login to mail server
mServer.user(getpass.getuser())
mServer.pass_(getpass.getpass())
#Get the number of mail messages
numMessages = len(mServer.list()[1])
print "You have %d messages." % (numMessages)
print "Message List:"
#List the subject line of each message
for mList in range(numMessages) :
for msg in mServer.retr(mList+1)[1]:
if msg.startswith('Subject'):
print '\t' + msg
Using Python to Fetch Files from an FTP Server 159
break
mServer.quit()
The Program : pop3_mail.py

password:
You have 10 messages.
Message List:
Subject: Static IP Info
Subject: IP Address Change
Subject: Verizon Wireless Online Statement
Subject: New Static IP Address
Subject: Your server account has been created
Subject: Looking For New Home Projects?
Subject: PDF Online - cl_scr_sheet.xls
Subject: Professional 11 Upgrade Offer
Subject: #1 Ball Played at the U.S. Open
Subject: Chapter 3 submission
The Output: From pop3_mail.py code above

Book Specification
Name : Python Phrasebook - Essential code and commands
ISBN No: 0-672-32910-7
Author : Brad Dayley
Publisher : Sams Publishing
No of Pages : 300
Price : Check the latest price at Amazon.com
Comments : An Ideal resource for Python programmers. Acts as a ready made code source for achieving a variety of tasks in Python.

Tuesday, 27 February 2007

Most popular websites 6 out of 7 powered by GNU/Linux - concludes survey

Pingdom - an uptime monitoring company conducted a survey recently where it researched the technologies that power 7 most popular websites namely -
  • Techcrunch - A blog maintained by Mike Arrington which is dedicated to profiling and reviewing new Internet products and companies.
  • FeedBurner - a provider of RSS feed management for bloggers and other online news sources and which is currently offering more than 566,000 feeds from more than 334,000 publishers.
  • iStockPhoto - An online, royalty-free stock photo provider.
  • YouSendIt - A service allowing its users to move and share large files with others over the Web instead of sending them over email. The service has more than 3 million registered users and transfers more than 1 million files daily.
  • Meebo - This is an in-browser messaging application supporting a variety of messaging applications such as Yahoo! Messenger, Windows Live Messenger, ICQ, AIM and Jabber. Meebo users exchange more than 70 million messages every day.
  • Vimeo - claims to be one of the most popular video sharing sites; next to youtube that is. And lastly ...
  • Alexaholic - This popular site uses data from Alexa to display web traffic trends. Here you can compare and analyse one site's statistics with another.
While I do not believe these are the most popular sites (obviously there are more popular websites), these are indeed very popular and enjoy a large group of followers.

These are the findings of the survey.
  1. All these websites except Alexaholic, exclusively use Linux as their choice of OS. Alexaholic is hosted on Windows.
  2. Barring Meebo and Alexaholic, all the rest use Apache web server to serve their web pages. Meebo uses lighttpd - an alternative open source web server and Alexaholic uses IIS.
  3. All the seven websites exclusively use MySQL as their database.
  4. These are the number of web servers each of the sites employ:
    • Meebo - Greater than 40 Nos
    • Yousendit - 24 Nos
    • Alexaholic - 2 Nos
    • Techcrunch - one
    • FeedBurner - 2x70 - 140 Nos
    • iStockPhoto - 15 nos
    • Vimeo - 4 Nos
  5. The most popular server side scripting language is obviously PHP with 5 of them developed using it.
In all, the survey provides details related to web servers, database servers, network hardware, storage servers, site usage and some miscellaneous data. You can read the detailed result of the survey here.

One thing worth noting is that none of them use FreeBSD which is claimed to power many high traffic portals including Yahoo. The reason provided is that many Linux distribution companies such as Red Hat and Novell provide standardization, and more importantly support not available on the same level in FreeBSD.

Monday, 26 February 2007

7 Habits for effective text editing 2.0

Being a Vi enthusiast, I am always on the look out for articles related to Vi, or rather Vi's modern avatar Vim - the versatile text editor created by Bram Moolenaar. In the past, this blog has seen a number of posts related to Vim. In fact if you ask me, the proverb "Too much of a thing" doesn't hold true for Vim.

It can easily take you a life time to learn each and every aspect of Vim though in most cases you can get along quite well by mastering just a couple of Vi commands. The sheer number of features and the permutations and combinations are that many. Then you have branched projects which aim to make Vim much more easier for the average computer user. Cream for Vim being a case to the point.

Today I stumbled upon this video which explains the 7 Habits for effective text editing in Vim which I found informative. The video is one of the series of Google TechTalks. In this video, Bram Moolenaar himself talks on the most efficient ways of editing text in Vim. The regular readers of this blog will know that Bram Moolenaar now works for Google.

The preamble of Google TechTalks goes thus :
Google TeckTalks are designed to disseminate a wide spectrum of views on topics including Current Affairs, Science, Medicine, Engineering, Business, Humanities, Law, Entertainment, and the Arts.
The video is a bit large (over 500 MB in size) and stretches over 1 hour. So make sure you have the required bandwidth to view the video. It is every bit worth watching.

Sunday, 25 February 2007

Dell and Linux - The GNU/Linux support page of Dell

Dell has been recently in the news for its decision to ship Dell desktops and laptops pre-loaded with GNU/Linux. While most Dell advertisements in newspapers shows the caption "Dell recommends Windows XP" or similar, this move has come as a surprising relief for all Free software enthusiasts. More specifically, it shows the change in the way the wind blows. Of course Dell does not provide the option to ship all its computers pre-loaded with Linux. This is available only for its N-Series range of desktops and laptops.

Dell has also put up a separate page dedicated to Linux where it explains the level of support it provides for machines pre-loaded with Linux. The heading of the web page proclaims - "You choose the Linux you want. Dell does the rest. Dell|Linux makes life easier." Dell has also put together a community portal at linux.dell.com where you can get more information regarding the usage of Linux on your Dell equipment.

Update (26-Feb-2007): Dell has also started a website called dellideastorm.com where it invites opinion from the general public about the suggestions and ideas they have and which they would like Dell to incorporate in their products. Guess what, offering "Pre-Installed Linux | Ubuntu | Fedora | OpenSUSE | Multi-Boot" has the most number of votes - a total of 82959 followed by "Dell machines Pre-installed with Open Office" a distant second with 53092 votes.

Saturday, 24 February 2007

Shiksha India - taking strides in providing Open Source multimedia driven educational material

Shiksha is a word in the Sanskrit language which means "to instruct" or "educate". Shiksha India - a non-profit organization, is an initiative of Confederation of Indian Industry (CII) and was launched during the India Economic Summit on 2nd of December 2001. It is managed by the Shiksha India Trust. The main aim of this organization is to provide good quality multimedia driven educational material. It has the blessings of the Indian government and it has partnered with the Ministry of Information Technology of India to provide good quality educational content in the public domain.

Mark Rais writes about how this non-profit project is playing a pivotal role in imparting education to more than half a million under privileged students. What is more important is the manner in which Open Source plays a significant role in this project.

In India, most Government controlled schools in the cities run in a relatively smooth manner and on an average have a teacher student ratio of 1:40. But as you move to the outskirts, in villages and in many remote areas, the so called government schools are just dilapidated structures with not enough teachers. And if there are teachers, the people in that area are so poor that they feel sending children to school will be a waste when they would rather ask them to do odd jobs and contribute to the family income.

To overcome this inertia among the people and to encourage them to send their children to schools, many state governments have started the free mid-day meals scheme in all government run schools in their respective states which has shown results in greater attendance in classes.

By embracing Open Source and Free Software solutions in public institutions including government run schools, India can save a huge amount of money in licensing costs which can be diverted to meet more pressing humanitarian needs. At present, the official stance of the Indian government is to use the most efficient technology in IT be it proprietary or Open source. And which one to use will be decided on a case-by-case basis. So there are no clear guidelines for or against Open Source or Free technologies. In recent times though, there is a growing awareness in many official quarters on the advantages of embracing Open Source solutions in public institutions.

Friday, 23 February 2007

Eric.S.Raymond forsakes Fedora Linux and embraces Ubuntu

Eric.S.Raymond is best known for authoring the famous essay "The cathedral and the bazaar" where he discusses the theories of software engineering in terms of two fundamentally different development styles - the cathedral model of most of the commercial world versus the "bazaar" model of the Linux world. This essay has become so popular that it has also been published in a book format (By O'Reilly). One of the most often used quotes from his essay is - "Given enough eyeballs, all bugs are shallow". He is also a board member of Freespire.

In the past, Mr Raymond has been in the limelight for the push to allow proprietary codecs into Linux. His surmise is that the Linux community need to start integrating more proprietary software in order to get market share. ESR points to proprietary multimedia codecs as an example, where Linux distributions should step away from Free software ideology in order to get more users. He states that this will succeed in bringing those users back to open source later on which will lead to gaining more influence with manufacturers and media distributors thus helping make Linux a properly supported platform. And this idea he put forward was met with ridicule from a major section of the community.

Now again he has succeeded in grabbing the headlines by stating his intention to switch to Ubuntu from Fedora which he has been using till now. And he supports his move by listing the following reasons - and I quote :
  • Chronic governance problems.
  • Persistent failure to maintain key repositories in a sane, consistent state from which upgrades might actually be possible.
  • A murky, poorly-documented, over-complex submission process.
  • Allowing RPM development to drift and stagnate -- then adding another layer of complexity, bugs, and wretched performance with yum.
  • Effectively abandoning the struggle for desktop market share.
  • Failure to address the problem of proprietary multimedia formats with any attitude other than blank denial.
While I agree with him on his statement on the performance of Yum - I have myself found it quite slow - a reason attributed to it storing all the details in an XML file and then reading from it, I do not agree that Red Hat/ Fedora is in the wrong to flatly deny to incorporate proprietary multimedia formats in their distribution.

Alan Cox has given a reply to ESR's letter in the Fedora mailing list.

Ironically, another news that is being just aired is that Microsoft has been asked to pay 1.52 Billion dollars in a patent case against Alcatel-Lucent concerning the use of MP3 technology in WMP [Source: BBC].

So the risk factors concerning incorporating proprietary / patented formats in GNU/Linux is clear for all to see. Can Red Hat / Ubuntu or any other distribution survive if they are asked to pay such a huge sum for alleged patent infringement ? I doubt it.

On another note, considering that he is a board member at Freespire, and given his stand, shouldn't he be embracing Freespire instead of Ubuntu ?