{C++ etc.}

Latest Posts
 
Home | C++ Posts | Linux Posts | Programming Posts | Issue Tracking Posts

Saturday, April 10, 2010

Infected by Malware-gen... again

I've had my fair share of encounters with this annoying virus. It first infected my computer at the University, spread to my home computer and later to that of my girl friend's. I got rid of the first two after a lot of work, but by that time Rasini's computer had some RAM issues and wasn't being used.
That was 4 years ago. My girlfriend is now my wife and we have a 9 month old son. Last week I was able to revive Rasini's dormant computer by fixing a new cooling fan and messing around with the cables. It still had the malware but I kept putting off installing any antivirus software on it for various reasons (mainly because I was lazy :)).
Yesterday while using my laptop, Chrome started giving me the "Aww.. snap" message. One of the things mentioned in the official google solutions page  was to check if the antivirus software was messing with it so I paused my  Kaspersky virus guard. After not being able to fix the Chrome issue, I ended up reinstalling it. But I forgot to restart the antivirus protection. While I was out, my wife had plugged in a pen which was used with the old computer in to my laptop to get the installation of Foxit reader. When I got back, things were looking a bit weird. My internet connection was showing a lot of uploads so I tried bringing down some processes and restarting. After the restart, explorer didn't show up (which is a typical symptom of Malware-gen infection) so I ended up restarting the process. The worst part was that I couldn't start Kaspersky. I knew then that I had gotten infected.
I was able to detect and delete most of the infected files by installing Avast Anti-virus and running a full system scan and a boot time scan. But I still get warnings of infected files once in a while so I guess it'll be some time before I'm completely rid of the nasty little fellow...

The results from my boot-time scan


A scan of the USB pen drive which infected my laptop

Thursday, April 08, 2010

Make every line of code count when writing "test" code

Yeah yeah.. you're just making "temporary" changes to test something out and you'll "re-write" it if it works out. Put a bit of effort in to cleaning up any non-sense (there'll be plenty)  as you go on and try to make it look "professional" 'cos chances are that the change will become "permenant" and you won't rewrite it till the next major refactoring session.
It's something that happens in most main software development projects. The developers test things out, try to tweak the system and improve performance. When the project managers see this, they're gonna want it in every system that they have and they would want it "right now". You'll be lucky to get enough time to copy and paste you're code (if that's actually necessary). Re-writing or re-designing won't be an option. So you're "temporary" code is gonna end up in the product source. if you don't want some ass hole to dig it up a few years (or months or weeks ) later and make fun of you, make sure that you write great code no matter what you do.
It'll save you a lot of time and the chance of getting mocked by some smart ass that you don't like.

Sunday, April 04, 2010

Best Free Online E-Book Catalogs

There are several notable e-book catalogs which offer free e-books which belong to a wide array of categories, such as Novels, Poetry, Science, Fantasy etc. They are a great way to catch up on classics that you missed out and to discover fresh titles by self-publishing authors. 
I've given a list of these below.
(There are several more sites which would turn up on a Google search, but they are filled with ads and propaganda material and don't contain a lot of actual e-books)

The most famous service amongst the ones listed above would be Project Gutenburg. It was first of it's kind when it was first envisioned (and implemented) in 1971. It contains over 30000 free e-books, but it's not the most eye catching or user friendly site you'll ever see.

FeedBooks and ManyBooks might not have the same amount of content as Project Gutenburg, but they offer what it lacks in eye candy. The sites are intuitive and user friendly and you could search for titles by subject or author. You could also browse through the titles under various categories. I personally prefer to use ManyBooks over  FeedBooks but that's purely a personal choice since both these sites are similar in most aspects.

You could use FBReader to browse, download and read titles from these sites.

Saturday, March 27, 2010

Best IDE for Qt4 Development in Linux


Here's why...
There are several IDE choices to develop Qt4 content in our favorite OS, such as:


Qt Creator 
 Qt Creator has been hyped as being great for not only Qt development, but C++ development as well. So I was pretty exited while the app was being installed via Yast2. Unfortunately, I never got it to run. It quietly crashes and I couldn't find a solution on the internet. Not wanting to go through another download session, I gave up.


Eclipse CDT 
To say that the de facto plugin for Qt4 development in Eclipse CDT,  QtClipse, is still in it's early stages of development, would be and understatement. It offered most of the basic configurations like paths to qmake and moc but didn't offer anything special.


KDevelop
Ever since I remember, I've loathed KDevelop. It's cluttered, the shortcuts are non standard, its auto completion sucked.. you get the point. Anyway, I went ahead and configured my first ever Qt4 app on KDevelop and started working on it. Surprisingly, the build and execute system ran well. I had to edit the Makefile in order to call moc on my classes, but it was a case of copying and pasting the main "moc" clauses and renaming the classes. The documentation got integrated perfectly and creating a new ".ui" class would automatically call Qt Designer. Debugging didn't work though. The application would exit soon after stopping at the first breakpoint. Must be something to do with the Qt event loop.


NetBeans
I didn't try NetBeans yet. My past experiences with it has been a mix between extreme satisfaction to absolute loathing. It's a good overall IDE which consumes a lot of memory. People who are used to developing on NetBeans would definitely prefer this over KDevelop.
I just finished running my first Qt application using NetBeans and it was way better than working with KDevelop. There was no setup involved at all. You just have to create a Qt Project from the "New Project" wizard and you're good to go. It just became my favorite IDE for Qt development :). (I followed this tutorial which gives  great introduction to working on Qt prjects using NetBeans).


From the IDEs that I tried out, KDevelop  turned out to be the best. That is not to say that it is perfect. I'm still looking at other alternatives which would offer an experience like the Qt plugin for Visual Studio under windows.

Wednesday, March 24, 2010

The Newton-Raphson Method and What to do When It Fails

I've been working on a system which uses Newton-Raphson method to solve a system of equations which model the flow of fluids along a channel. We've had great results during initial testing but the system fails miserably in some occasions. This is a limitation which is inherently present in Newton-Raphson iterative method which makes the system diverge. The best solution would be to move to a different numerical scheme which guarantees global convergence.
The other method is to modify the scheme in such a way that convergence is guaranteed ( or the system converges for all valid system parameter values).
While searching for how to achieve this, I came across this page, which gives details of the Damped Newton-Raphson method, which mediates iteration values, hence forcing the system to converge. To use this method to achieve global convergence would take a lot of work and enforce a heavy toll on the processor. It's best to use this iff the normal iteration fails inside a time step.


It's the best option we have at the moment. I would post about the effectiveness of the method after implementing it in our model. 


Newton-Raphson method with example VB code