Sunday, December 20, 2009

Total Freedom

Recently I accidentally found a completely new software license called WTFPL. It is a license which is dedicated to deliver true freedom and to make the lives of the people easier.

Initially I thought this was something created just for fun, but that was not the case. I found several real open source projects licensed under WTFPL. :D

At a glance, it appeared to me as this license should be compatible with most of the other licenses as it allows you to do whatever you want (I'm avoiding the original way used by the license creator to say this :P).

When I first read GPL and BSD license statements, I couldn't understand anything. I had to find articles written in simple language which explain what the licenses were all about. But this is much more simpler. Obviously, this is the first license I understood at the first glance. :P

So if you're concerned about giving total freedom to the users/developers, then WTFPL is something you should consider when you decide a license for your project. Seriously.

Wednesday, November 25, 2009

Microsoft Fonts for Firefox on Ubuntu...

When I first started using Ubuntu, I found that the default fonts come with its Firefox are a bit difficult to read. By default, Ubuntu doesn't have popular Microsoft fonts such as 'Times New Roman' pre-installed. So the first task I did was to install Microsoft True Type core fonts bundle on Ubuntu. It can be done with a simple apt-get command as following:

sudo apt-get install msttcorefonts


This installs all the required Microsoft fonts. Then all I had to do was just to change the font settings in Firefox to be similar to Firefox on Windows.


Preferences -> Content

Default Font: Times New Roman
Size: 16

In Advanced Settings:

Fonts for: Western
Propotional: Serif Size: 16
Serif: Times New Roman
Sans-serif: Arial
Monospace: Courier New Size: 13


Note that these settings are similar to Firefox on Windows 7.
That's it.

Thursday, October 29, 2009

Progress of epZilla

I'm involved in doing a research on a scalable and a fault-tolerant distributed architecture for complex event processing (epZilla) as my final year undergraduate project with three other colleagues. So far it has been all research and no coding, which makes life a bit harder for us coz we are not very good readers and also it makes life even harder in evaluations by the department since we don't have anything other than some research papers and some ideas and concepts in mind which doesn't seem to be very much convincing for the evaluators.

So far we have read several dozens of research papers on many related areas and now about to finalize the architecture. Meanwhile we are about to start some coding even before we finalize the architecture since we gotta have something working before the next evaluation - for demonstration purposes.

I'm posting this here so that I can look back later and find how our project evolved.

Monday, September 21, 2009

Ideas from Code Jam....

Recently, I accidentally got to know about Google's Code Jam competition. After getting to know that it is an algorithmic problem solving competition, I decided to give it a try. I've never had much experience in this area, so I did not have any hope of advancing to the semi-finals or finals but thought that this is a good opportunity to sharpen thinking ability.

I got through the qualification round with ease as it contained two problems which could be solved without knowing any advanced problem solving technique. But for the next round, it clearly appeared like knowing only to solve number theory, brute-forcing/backtracking and ad-hoc problems wouldn't help. So I Googled a bit to find what to learn.......and found several problem type classifications which were based on different programming competitions. Here's Hal Burch's classification based on ICPC which is somewhat applicable to Code Jam too:

  1. Dynamic Programming
  2. Greedy
  3. Complete Search
  4. Flood Fill
  5. Shortest Path
  6. Recursive Search Techniques
  7. Minimum Spanning Tree
  8. Knapsack
  9. Computational Geometry
  10. Network Flow
  11. Eulerian Path
  12. Two-Dimensional Convex Hull
  13. BigNums
  14. Heuristic Search
  15. Approximate Search
  16. Ad Hoc Problems

Of course, many of these types can be solved using simple brute-force algorithms, but they will end up taking a few million years to give you an answer for some of the inputs..... so definitely you need to learn some efficient and easy to implement techniques to tackle such problems. The best resource I found for this is TopCoder's algorithm tutorials, which contain no-nonsense and easy to understand tutorials on most of these areas.

Having said that, I should now come to the point.......that is, some of the smart tricks used by the competitors in this Code Jam competition. One is that, since the solutions are executed in competitor's mahine itself, it gives competitors the ability to generate all solutions to a problem using brute-force which might take a couple of hours (before downloading the input, coz once you download inputs you'll have only 8 minutes to solve them), save it, then download the actual input and then just lookup the already generated results to directly find answers to the input. No DP, no efficient algorithms, but still perfectly legal and effective! (if your computer has enough processing power). I actually found a few guys who had advanced to round 2 using this technique.

Second one is writing multi-threaded programs. It feels like a crazy idea trying to implement a multi-threaded algorithm.....but think about it.....you might have a Core 2 Duo processor, if you write a normal inefficient algorithm, it will execute on only one core.....and your program might take 8 minutes plus a couple more seconds to execute and you'll be out of the competiton. What a waste.....you might have implemented the same program to have multiple threads and execute over both cores and could have solved it within 8 minutes! (this is a rare case, but actually happened in Round 1A - Problem A) Now some of the competitors are interested in writing toolkits to provide concurrent execution over all cores they have on all computers at home, be it a desktop computer, a laptop or a netbook. What a fantastic idea!....they've turned this competition into a concurrent programming competition too. By the way, I have only one single-core machine at home, so I'm trying to find an online supercomputer service which can offer some computing time for me to execute my horrible brute-force programs to advance to the next round :) Just another different idea ;)

Anyway, the competition is getting fierce....so there's a very little chance (most probably no chance at all) to advance through round 2 (which takes only top 500 contestants). But if you too give it a try, you'll certainly discover some fantastic techniques to tackle problems.