Humour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and then
Tutorials and HOWTOs by
Posted on Mon, Dec 11, 2006 at 10:56 IST (last updated: Wed, Oct 29, 2008 @ 22:00 IST)
If you're new to Linux programming, then you might be interested in considering these aspects before you start your wonderful journey. Especially if you've programmed in Windows, you might want to change some of your ideas, so that you minimize the "culture" shock you experience when you encounter completely different ideas and ways of thinking.
Here are some of my tips, based on common questions asked in forums about Linux programming especially from experienced Windows programmers.
Evaluate every available alternative
Unlike the unified Windows API which provides the Windows programmer with a single method of achieving a certain objective, Linux provides a variety of ways to achieve the same objective. For instance there are a variety of GUI abstraction toolkits, the major ones being QT and GTK to write GUI programs. Again, you need not necessarily choose C or C++. There are many choices for programming including basic shell scripting, Perl, Python and PHP. So do not always have a fixed idea that you need to learn the "hard" way. In fact, you might be surprised to discover the power and elegance of scripting.
Do not be overwhelmed by choices. Just be aware of all of them and pick the tools and techniques that you're most comfortable with.
IDEs are not necessarily more productive
Programmers who've used Microsoft Visual Studio extensively to do their development might find it uncomfortable to adapt to Linux's way of doing things. While there are some pretty decent IDEs in Linux including Kdevelop, anjuta and Eclipse, you might actually find that using a text editor and creating a make file to be a better idea in the long run. Particularly when you are developing Free Software applications, you might not want to tie down development to a particular platform or IDE considering that your code will be shared and other programmers might also be contributing to your project. While IDEs are not always bad, you might find developing smaller projects using a simple text editor and a makefile a better idea.
Do not look for distribution-specific features
It might surprise many Windows programmers to know that you can practically make no assumptions about a default Linux configuration on the end user's machine. Different distros use different configuration file locations and settings. Unless you're writing a system configuration utility for a particular distro, try and avoid distro-specific assumptions. Also never force users to run as "root" unless your application's sole purpose is to modify system specific settings.
Do NOT modify or attempt to modify system files
Apart from being bad programming etiquette,
- You cannot assume that a certain system file exists on the end user's machine (because of distribution-specific differences).
- You simply cannot modify system files as a "normal" user and you cannot expect a normal productivity app to be run as "root."
In most cases, you will find you hardly have any good reason to touch system specific files.
Be consistent visually
GUI programmers, especially GTK and QT programmers, need to understand that these libraries are heavily themeable (meaning that the end-user can modify the visual appearance of GUIs in almost any way possible - including fonts, colours and the widget appearance). Therefore, avoid using specific fonts or colours in your GUIs. You don't need them. Do not force your end users to install any particular font on their system. Leave your application's visual rendering entirely to the GUI library that you use. Unless you're writing a word processor you might hardly ever need to directly handle fonts in your application's code.
Be prepared to do some research
Linux does not come with an MSDN-like tool to provide you documentation for every single programming tool or API available out there. It's simply not practical because Linux is not developed by a single company. In most cases if you're using third-party libraries, you will be able to find documentation (either downloadable or online) on the official website of that particular library's maintainer. Also be aware that quite a few libraries come with incomplete documentation or none at all.
You might have to look for sample code or even at header files to learn more about a particular library. Fortunately you might not encounter this situation in the case of most popular third-party libraries, but it's better to be prepared nevertheless.
Do not package dependencies
When you're creating a "distributable package" do not include dependencies along with your tarball. Just include the source and provide compiling instructions (the more generic, the better). Also mention the required dependencies in your README or INSTALL files and in your website. Since most Linux distributions have their own package management systems (and if you're application is good enough, it might even be included in the official package repository), you should leave the dependency handling either to the end user who compiles your program manually or to the distribution package maintainer who ships your application as part of his package. Since every Linux distribution has a different way to manage dependencies, do not interfere with it by creating an "installation" routine that tries to be smart and installs other libraries.
Apart from creating versioning problems, it's simply tedious and cumbersome to include dependencies with the program. Also try and keep the dependencies to a minimum, particularly if your program tends to use exotic third-party libraries.
Even if you're not releasing your program as Free Software, try and keep the packaging to a minimum and provide instructions to the user on dependencies.
I hope this has been of use to you as a newbie to Linux programming. Happy programming!
Humour and Nonsense by
Posted on Fri, Dec 8, 2006 at 21:32 IST (last updated: Thu, Oct 30, 2008 @ 08:08 IST)
Welcome back to another edition of Papa Hari's tips to make your life better.
This time, Papa Hari will discuss job interviews and some tips on making a good impression on the interviewer. Let us start from the top.
The most important thing is the dress code. When you attend an interview, the first impressions you make on the interviewer count for a lot. Papa Hari recommends that you wear the following -- a pair of silky red trousers, a bright parrot green shirt, a yellow tie spotted with red dots and a pink blazer. Wearing a formal top hat and ray-ban sun glasses is highly recommended as well. After all, it's important to differentiate yourself from the rest. You will make an immediate impact on the interviewer with your neat, dignified appearance.
Decorate your resume with colour prints of your best holiday photos. Start with the phrase "I'm the greatest!" and use a variety of fonts, colours and styling. The more exotic the better. For instance, avoid "Times Roman" like a plague. Every other candidate uses it to the exclusion of all other fonts. Make sure that your resume speaks highly of you in every sentence. Never use the first-person. Always address yourself as "Mr. ABC is highly proficient in these areas... " and "Mr. ABC is highly trustworthy, competent and reliable." In short, your resume should be fairly sprinkled with glittering endorsements about the product that is YOU! Your confidence in yourself should communicate itself clearly to the interviewers.
It's extremely important to give the interviewer an idea of how important you are. Always walk into an interview nine and three quarters minutes late and when walking in to the interview, make sure that you're talking in your cell phone, preferably along the lines of "About that $10 million contract... wait till I get back to you. I have a meeting at the moment and I'll get back to you later." Interviewers respect important people and you immediately have something in your favour.
The most important question
The first question that an interviewer will ask you is the famous opening to any job interview -- tell me about yourself
. It's necessary to frame your answer along these lines:
"Pronoun. 1) The one identical with you. a) Used reflexively as the direct or indirect object of the verb or as the object of the preposition. example: did you buy yourself a gift? b) Used for emphasis. example: you yourself were certain of the facts. c) Used in an absolute construction. example: in office yourself, you helped push the bill along. 2) Your normal or healthy condition. example: Are you feeling yourself again?"
Most interviewers would be amazed at your knowledge and command over the English language.
It's not just about answering questions correctly but also stylishly. When an interviewer asks you a question, always nod your head intelligently and say "that's a very good question. I'm glad you asked it." And while thinking about your answer, always shake your head this way and that, rub your nose, scratch your chin and roll your eyes upwards. Every little gesture counts. Act like they're the media crew and you're a celebrity giving an exclusive interview. Make sure you give them the right impression and make them feel important.
Other miscellaneous tips
- Always smile broadly showing all your teeth at the end of every answer you give.
- Raise your top hat every time a question is asked. This is basic politeness
- Sit well back in your seat (if possible), purse your lips and put one leg over the other and keep shaking it. This shows that you're relaxed and comfortable. Interviewers like that.
- Never make eye contact with the interviewers while a question is being asked. Instead hold your chin in your palm and close your eyes slightly. This gives them the impression that you're really concentrating hard in absorbing the question.
Following these basic tips will ensure that you get the job and score above other candidates. Papa Hari wishes you the best of luck with your future career. (editor note:
p.s. you'll need it)
Software and Technology by
Posted on Thu, Dec 7, 2006 at 17:59 IST (last updated: Wed, Jul 16, 2008 @ 21:14 IST)
It's interesting to see how the recent debate on DRM and Trusted Computing is going. I'm particularly alarmed by the implications of this technology and its potential
to arm-twist consumers tying them down effectively to using a particular software on a particular media. No matter how many people put forth positive arguments to support this technology, I have an instinctive feeling against it. It's all very well to separate the technology from its application, but for all practical purposes, I see no difference.
The application of this technology puts enormous clout in the hands of the already powerful global IT and media giants and restricts the end customer even further while offering a few lame sweeteners (security, reliability and trust, huh) to make it palatable. How they use that clout is a completely different story, but it's amazing how many people are willing to trust corporate entities that have a history of monopolistic tendencies and unfair (and often illegal) business practices to gain market share.
The point of this post however, is not to argue for or against the technology, but merely to show why active (and not passive) opposition is necessary if we need to prevent it from being adopted as a standard in software, hardware and digital media products. And more specifically, why we need our elected representatives in government to stand up for consumer rights and protection.
Most people tend to argue in this manner
If you don't like DRM, just don't buy products which have DRM in them. The technology is useful and governments should not interfere/put a blanket ban on its use. Also DRM doesn't affect FOSS, so why should I care?
The assertion, in effect calls for passive resistance by the "market." Unfortunately, I see some big flaws in the above argument.
- Implied in the argument is the fact that if we (the small group of enlightened and empowered users) boycott those products, that'll convince the powerful global multinationals that the technology is not marketable and it'll be a failure. Unfortunately, it's a proven fact that the majority of software and hardware multinationals do not give a damn (to put it mildly) about the "enlightened" minority. Sure, consumer awareness is growing, but it's still nowhere near large enough to cause any major headaches for them.
- The second assumption is that the FOSS community will not be affected by the technology. I seriously doubt this but even otherwise, is this any reason not to be worried about DRM? What about the rest of the world? We certainly do not live in a vaccuum and whether we like it or not, anything that Microsoft, AMD, Intel or Sony does affects us directly or indirectly.
- Lastly, even if we, as individuals, are in a position to successfully boycott DRM-infected products, how practical would it be in the long run? Assuming a market where 80-90% of the products are DRM-enabled, how much choice do we have as consumers? And if the major multinational corporations do adopt DRM and Trusted Computing in a big way how can customers keep avoiding it forever?
In order to overcome the first obstacle, we need to educate and inform the general public about the perils of Trusted Computing. I don't think we'll have much trouble about this one though as awareness is already spreading. The second point is implicitly tied with the first point. As far as this issue is concerned, I doubt whether the voice of any single group of consumers will make a big impact. It's necessary for us to have a (huge) collective voice to seriously trouble the likes of Microsoft and Sony.
The third point is the clincher though. Going by the current trend, it's becoming increasingly clear that the major hardware and software companies will adopt DRM and Trusted Computing in some form or the other. Even if the whole of the consumer world protests against these technologies, sooner or later the world will be forced to use and adopt them. If you're not convinced, then consider how Microsoft has successfully used this tactic to keep their customers over the years -- by forcing them into the vicious upgrade cycle and tying them down to Microsoft-specific technology. The same tactic will be used in this instance too. They might not be too open and explicit about it and will try and hide it using every kind of marketing jargon, but the result will be the same. If the technology is adopted, they know that there will be a lot of initial resistance, but they're equally confident that the resistance can be broken down by using marketing techniques and unfair business practices.
The ultimate question here is this: is the market strong enough and competitive enough to resist restrictive technologies like DRM and trusted computing when implemented by powerful vested interests? Should we entirely rely on market forces to reject anti-competitive and restrictive technologies? Whatever be the answer to that, I think the key is that we need
government support and intervention in the issue no matter which part of the world we live in. The likes of Microsoft and Sony are not just companies. They're powerful corporate empires and normal market forces do not affect them so much in the short term -- particularly when they are in a position to form cartels and alliances. An outright ban on TC/DRM may be the last step in that intervention, but whatever be the case, every government needs to step forward and keep the technology and its use under heavy control.
The point here is that we need one empire to balance the other. Only governments have that power. And that's why I fully support government controls to prevent the rampant abuse of this technology. Mere passive resistance from end customers will only delay the inevitable -- it will not prevent it.
Bits and Bytes by
Posted on Wed, Dec 6, 2006 at 12:34 IST (last updated: Wed, Jul 16, 2008 @ 20:48 IST)
I'm starting a new feature on this blog -- I'll be linking some interesting articles I find on the web here and provide a bit of commentary on it. I'm generally not a big fan of re-blogging, but it does have its uses. I'd also like some feedback on this kind of blogging from my regular readers.
However, here's my first interesting link: I found this when I was doing a bit of research on the subject of Services Marketing. It's a pretty interesting articles that debunks the myth of the phrase "The Customer is Always Right" and the way it's interpreted by big businesses.
Top 5 reasons why "The Customer is Always Right" is wrong
I must say I agree entirely with the article. Too often, this phrase is interpreted in an absolute sense without a proper context. In my belief the phrase always stood for "The Market is Always Right" and means: whatever product or service the customer chooses (within reason) is the right one. In other words, the customer chooses the product or service he/she wants and not the other way round. It does not mean that the customer has the right to be abusive, disruptive, threatening or generally obnoxious towards employees of service organizations.
Having said that, I believe that service providers who try to cut corners in quality and employ poorly trained or equipped people to serve customers deserve what they get. We all know how much a customer has to endure from poorly trained, clueless Call Centre employees. I believe in such cases, the business escapes its responsibility by putting unprofessional novices in the front-lines to take all the fire.
I hope you find it an interesting read as well.
Humour and Nonsense by
Posted on Mon, Dec 4, 2006 at 21:14 IST (last updated: Wed, Jul 16, 2008 @ 21:01 IST)
I'm here only to express my opinion regarding Linux. I know that most of you will tell me to go back to Windows and ask me why I'm bothering to post this message. It's quite simple. I think that Linux has a long way to go before it can be considered a "serious" contender to Microsoft Windows. Unfortunately most users of Linux I've met seem to be blind to the simple fact that Windows is a much more user-friendly and works out of the box for almost every computer manufactured out there. There's a reason why Microsoft is #1 and I now understand why they charge money for their Operating System.
Let me explain. I started my journey with Linux four years ago. Every time I tried to install Linux on my machine, I ended up in frustration and failure. To be honest, I tried with different hardware every time as well. Slackware just wouldn't recognize my network card. Red Hat get giving my grub errors all the time and I was unable to boot to my Windows partition after a failed installation. I even tried SUSE and Debian. SUSE had the easiest installer, but it was so slow to boot up and run compared to Windows that I gave it up as a bad job. Also I couldn't get any of my audio files to play under SUSE. As for Debian, every time I ran the installer, I got a file-corrupted error and the installation aborted about halfway through. From time to time I kept trying to install Linux and I kept failing. And the worst part of it was the time I wasted in downloading and writing installations CDs! What a waste! Seriously folks, what are the Linux devs thinking? I'm an above-average IQ guy and I've worked for 10 years in the IT industry, but even I had a tough time figuring out what hda, hdb and hdc stood for. Why couldn't they stick to known standards like C:, D: and E: to represent disk drives. It would all be fine if the damn thing worked! BUT NO... it doesn't and that's the worst part about Linux -- all hype and no substance. And believe me, only I know how much I struggled through all this...
Trust me guys. I know what you'll say. I've really gone ahead and wasted plenty of weeks (maybe even months) on trying out Linux, but it seems that Linux just hates me. I'm always open to trying it out again, but to be frank, I don't really have the faith any more. It seems that Linux needs some kind of uber-geek to tame it. And being in the software industry for 10 years, even I couldn't make head or tail of it. I really don't want to use Windows any more since I am morally against Microsoft's business practices, but what are the Linux developers doing all these years? It seems that the interest in developing Linux into a true alternative to the monopoly that is Windows has waned over the years. The community seems more interested in aggressively asserting the superiority of their Operating System than providing real solutions to all of us.
So, go ahead and flame me all you want. But you know the truth and the truth hurts... I couldn't care less what you want to say about me, but so long as the community keeps up its uppish attitude, Linux is just going to remain a fringe system used by bespectacled, pale geeks in University laboratories.
(And no, before you ask, I didn't copy this from any Linux forum. )
Posted on Fri, Dec 1, 2006 at 18:26 IST (last updated: Fri, May 29, 2009 @ 21:24 IST)
My next cartoon character: Professor Das
Professor of Mathematics
Educational programmes on Television and UGC programmes
Solving the square root of pi to the thousandth decimal place
"What is the integral of square root of sin theta? Come on, tell me... tell me... tell me..."