20 June 2010

Google commandline services

It seems to be a bit odd to be posting something in praise of Google on blogger; if anyone bothers to read this blog they might be forgiven if they accuse me of toadying up. Anyway, the big news is that Google has released Python based scripts to access and use a host of Google services. No wonder Google has consistently beaten the pants off its rivals. 

11 June 2010

OpenCV 2.1.0 and FFMPEG compilation solution

I had been recently struggling to compile OpenCV 2.1.0 with FFMPEG support on GNU/Linux. The problem was that the OpenCV CMake script fails to detect the important component of ffmpeg it needs; like avcodec, swscale, avformat. The more idiotic thing is that if one uses ccmake, the log is not visible. It is only after building that one sees that ffmpeg support is not there. One has to use cmake. Anyways, after doing cmake ../OpenCV-2.1.0, noted that config log said “ffmpeg 0″ and also put zeros against the above mentioned components of ffmpeg. Well, I knew that ffmpeg existed in all its components. I had also made a directory called ffmpeg in /usr/local/include and made symbolic links for the respective header files. Now it was a clear case of cmake being unable to find these, either because of poor CMakeLists.txt or the cmake itself. At this point, I did not want to dig into the innards of CMake; unlike autoconf it has an annoying tendency to hide information; for example where it searches for ffmpeg and such things. Such blackbox approach suits Ubuntu users no doubt. I tried parsing through the CMakeLists.txt and could not find anything that I could rectify. However, I did know that CMakeCache.txt contained the configured values. After that it was a matter of putting manually the include, lib paths and the linker flags in this for each of the ffmpeg components. After running cmake again, I could immediately see that ffmpeg components were recognised and ffmpeg was turned to 1. make happily started building cvcap_ffmpeg which meant that ffmpeg was actually being used. However, the build process croaked at 99% when trying to link to the actual libavcodec/libavformat and libswscale. Clearly, the linker links I had passed as a guess had not worked. Now, I did cmake again and passed -L/usr/local/lib and -Wl, -rpath,/usr/local/lib. Voila! the compilation was complete. I build a test program to read and write videos. All worked ok. This was a rough sketch of the compilation solution. I will post the details of the CMakeCache.txt in case someone is interested.

30 May 2010

Acer 5738G review


I bought this laptop after doing a "literature survey" of the different models available in the market. I had considered Dell Studio as an alternative; however it was extremely expensive for nearly the same specifications. HP & Lenovo were way too expensive. My primary requirements were a good CPU( Core2Duo 2.0+), 4GB RAM, a low-end graphics card and a good HDD. 5738G fitted in admirably. My requirements were not on the portability side. There were enough laptops with 2GB RAM or so from Sony and costing nearly twice this model. Also, I tried to cleverly time my purchase during some festival season, where the offers would be there. The usual freebies thrown in would be a USB mouse, a pair of cheap speakers or something similar. I went to an Acer store itself and was convinced by the salesman to shell out 42,000/- for this. He would throw in a cable lock(which he himself admitted was one of those "cheap Chinese junk") and a USB hub. I had a look at the mouse; it was a micro-mouse barely bigger than the inside of my palm and was of some obscure Chinese make; I should have known better. I thought that as i was going to an Acer store, the offer there may be more true to the word. On my protests, I got an equally cheap cable lock which is lying unused. Anyway, after I swiped my card the salesman quickly brought in a new box, showed me that the seals were intact, broke them and powered up the laptop. When I reached home, I saw that the instructions that the laptops were *not* supposed to be powered up on battery alone for the first time. This showed the complete lack of professionalism again.

I had searched for a DOS-prompt or preferably GNU/Linux loaded laptop. Sadly, these things are unheard of in Bangalore. Nobody had such models, the most they might do was to wipe out the default OS and install some earlier version of Fedora but this was not advisable. So I paid the Windows tax and took the Vista Home Premium version with the promise of free upgrade to Windows 7 as and when it came. Little did I know that this was another conspiracy to hoodwink and cheat from consumers. This is because when Windows 7 was released, I tried to upgrade but the media for my region was supposed to be shipped for which I would have to shell out yet another good amount of money. So much for free market.

I installed Fedora 12 on it. The default stupid HDD configuration is one huge drive. I had to use the re-partition tool to create two nearly equal partitions and installed Fedora on the other. The laptop came with a lot of junk software, games, promos and a big virus called Microsoft Office 2007. This last piece of junk was a 3 month trial version and reminded this everytime I started it. I uninstalled it faster than it could squeak "Bill Gates". The general feel is ok; the keypad feels cheap but is fairly rugged. I have banged on it a number of times in frustration and it seems to have taken it well. On the other hand, I have a Dell Latitude E6400 which is feeling its "Shift" key despite careful usage. Thats one plus for Acer though I am not sure if the "ruggedness" is deliberate or accidental. The screen is ok, a bit too reflective, you have to turn on the screenlight quite a bit to do something useful. Naturally, this reduces battery life.

Coming to the most important part, the battery life is something I am fairly ok with. This laptop comes with the usual company specific power management tools. There are 3 modes:
Powersaver: Saves power and extends battery life. I get about 2 hr 30-40 minutes for very normal usage. Maybe I have a browser, a text editor and some python scripts running while I learn the language.

Balanced: This turns up the power more. I have noticed a 50% reduction in compilation time for the ITK software library between this and the Balanced mode. Obviously this eats up battery, never timed it though.

High Performance: As per the blurb this mode reduces battery life and bring out the high performance. When you turn this on, be sure to bring out your pan to boil tea or eggs. Unfortunately, you would have barely begun to boil the stuff when the laptop freezes and shuts down. Initially, when this happened I thought that the laptop had conked out. Then I figured that the heating was too high. So, the "high performance" mode is really a low performance mode. In any case, there is not much of difference between "Balanced" and this mode at least in terms of compilation time for ITK code. This is a serious disappointment with Acer and I consider this as lying like the "friendly" greengrocer who has been shafting you for years and generations together.

One thing which worries me is that the battery is now getting charged to 91% of its rated capacity at full charge. I am not sure if this is the norm. This is strange because i do not do a full discharge everytime and start re-charging when the battery indicator goes less than 20%.

========== Conclusion =========
This was my first laptop purchase. I am not elated and not too disappointed. I would have expected a clearer specification of the deal from the Acer exclusive authorised dealer; I would definitely have expected better power management. I would also expect to have a no Windows version. The laptop bag is piss poor and the laptop is heavy. Not for regular travellers.

On the plus side... erm.. the laptop still works. I think that the 5738G is now phased out and Acer is offering newer and better configurations at lesser or equal prices barely 8 months after I purchased 5738G. However that is the flipside of the electronic market. The idea behind the review is to make the other aware of my general experience with Acer and of course the model. Based on my 5738G experience, I would probably pay some more money and try out HP.
If you can stick tolerate Windows Acer offers features at prices that are really tempting. Also, once you accept that the quality of Sony and Acer models are going to differ considering the price difference; you would probably not feel too bad. Dell is way too heavy and my friends have reported the heating problem.

This review is of course kind of incomplete without the after sales services. Thankfully, I have not yet had problems which would require such trips and hopefully I would not need it either!

One major grouse is that despite paying for the full Vista, I do not have an installation media. Sure, I do have a backup and restore option which will "restore" my last stable state in case the C drive gets corrupted. However, I will not be able to install a fresh version. This is rather annoying, after all I have paid a good amount. All laptop manufacturers are following this tradition now sadly.

Update: 30/11/2011
The battery has kind of gone to a large extent. Gives barely 7-10 minutes after "full" charge. The pluses are: sturdy build, especially the keyboard. I have seen two equal priced or more Dell, keyboards are pathetic. One was an office laptop, hence not a problem with the cost.  The laptop also took a screenfirst fall to the ground from a chair. This was a few weeks back. No damage(yet!).

17 May 2010

Free MATLAB Substitute

During my PhD days, I had looked around a lot for Matlab substitutes. While MATLAB is an excellent piece of software, it is prohibitively expensive. Two substitutes I can recall immediately are Octave and Scilab. While GNU has generally cut it well on the software it offers, somehow Octave has not made it. I definitely appreciate the time the community has put in; my comment is based on the conversations I have had with friends. Perhaps the non availability of an easy to install MS Windoze version may have something to do with it. My main requirement is image processing and vision. There are tonnes of software written in MATLAB, which is perhaps the main software of choice in many universities. So, a MATLAB substitute must be able to process this vast collection of tools with no or minimum effort. Sadly, this may not be possible. One problem with such packages is that these get tied down to specific releases of MATLAB.
Recently, I came across FreeMat which seems to be a good substitute. I have barely begun to use it but some people I know report a fairly good compatibility with MATLAB. At least the general commands seem to match well. The flip side is that compiling from source in GNU/Linux is a bit of bear.

05 April 2010

Python(x,y) software

This is a superb software! This Python library/software packages OpenCV, ITK, VTK, Scipy, Numpy and plotting utilities all under one umbrella seamlessly. This is what I was looking for a looooong time. I have not really begun to explore it as I had problems with the Windows installer. I am eagerly looking forward to using this.

12 February 2010

BSpline Code

Here is a small package which has the code I wrote during my PhD thesis. The code implements parametric curve evolution using B-Spline and a tangential redistribution term for curve point matching. This code uses OpenCV.

19 December 2009

V.I. Arnold on Modern Mathematics

Here is an article deploring the over-stressing of "abstract formalism" in mathematics. It is by a great mathematician too!

12 December 2009

BSNL stinks

I recently shifted from one major city to another in India and was looking to get a new mobile connection. I was interested in getting a new BSNL mobile connection. For this, I trawled through the website for information. As usual, the requirements for residential proof were set of documents like passport/ration card/voter card which unscrupulous people and terrorists easily forge with the connivance of corrupt employees in government agencies, but which are a hassle for normal citizens. I was searched the web to get some BSNL helpline number. The number 9400024365 does not work from non BSNL connections. I looked for some email ID or any number for information. As is to be expected from government organisations, there was none. Also the list of customer service centres had number which are useless. I have decided to opt for some private provider. There is no way a customer can ask about new information! No wonder they lose customers and I hope they get shut down and the lazy assholes sitting there are kicked out of jobs.