Monday, December 17, 2007

Upcoming Google Knol - a Wikipedia killer?

Google has just announced their latest upcoming application called 'Google Knol'. It's a tool for posting and sharing information in the form of articles. Much like Wikipedia, Google Knol just seems to be more social and focusing more on the author's name, and of course its 'Google' branded. 'Google branded' means Knol will have more higher rank results than the Wikipedia, answers.com or other sites in search results on general topics.

Users can share, rate, suggest edit, add contents to articles. There can be more than one article on a topic from different authors, unlike Wikipedia. In Wikipedia, all aurthors edit/enhance one article per topic. Wikipedia is 'topic centric' where as Google Knol will be 'author centric'.

Here's the intro at Google's official blog:
"The web contains an enormous amount of information, and Google has helped to make that information more easily accessible by providing pretty good search facilities. But not everything is written nor is everything well organized to make it easily discoverable. There are millions of people who possess useful knowledge that they would love to share, and there are billions of people who can benefit from it. We believe that many do not share that knowledge today simply because it is not easy enough to do that. The challenge posed to us by Larry, Sergey and Eric was to find a way to help people share their knowledge. This is our main goal."

So is this a Wikipedia killer? In my point of view, it's not gonna be an easy task for Google to takeover the popularity of Wikipedia anytime soon. They need something more jaw breaking (a feature, functionality or an idea) to do so. Well only time can tell the 'actual' story.. :).

More on Google's Blog:
http://googleblog.blogspot.com/2007/12/encouraging-people-to-contribute.html

Constructive comments by Roger Ehrenberg, who's not so optimistic about the success of Knol, is here:
http://seekingalpha.com/article/57457-google-knol-not-setting-the-world-on-fire.

Tuesday, December 11, 2007

Visual Studio.Net for free

Yes, many of us do not know this fact but there are free editions of the mighty Visual Studio IDE, the languages: Visual C++, Visual C#, Visual Basic and SQL Server. It's called the 'Express Editions'.

Visual Studio Express Editions (2005, 2008, etc) are free versions of Visual Studio professional editions with limitations on some professional and enterprise features. Targets of Express Editions are mostly beginners, hobbyist and students.

This very good strategy of Microsoft is definitely targeted to reach the mass market and make more programmers divert to or become Visual Studio developers. Open source tools, languages and operating systems are causing Microsoft to loose ground at an alarming rate over the last few years. The free editions are one of few and good steps of Microsoft against it.

Whatever the reasons for the express editions are, it's a great news for beginners, students and hobbyists. I've used C# express edition (2005) for a moderate sized application earlier this year and hardly noticed any significant changes. You can easily switch between the Visual Studio professional and express editions too. So, if you begin developing an application in Express Edition and want to move to professional edition later, it's a piece of cake!

Web site & downloads: http://www.microsoft.com/express/.

Ext JS 2.0 final is out

As the title says, Ext JS 2.0 final has been released on December 4, 2007. You can check it out and download it at extjs.com.

Ext JS 1.1 rocked my heart. I had used it in a bio-informatics web 2.0 application (basically a DNA sequence/template modification application with lots of complex business rules, built with .Net 2 and Ext JS). Ext JS 1.1 dramatically improved the application GUI over another GUI framework we used earlier.

Ext JS is definitely one of the best choices if you're planning for a heavy weight GUI based web application but may not be a good choice if you're planning for a lightweight application. The main reason behind this is the 'bluky' size of the library. To use all features of the library, you can include the full library in your application, which is around 580 KB for Ext JS 1.1.1 and 614 KB for Ext JS 2.0. In that case, the only thing may bother you, the lightweight lovers, 'a lot' is the load time of your page/application. It's definitely very noticeable in the slower speed internet connection (like dial-ups).

With Ext JS 1.1, it was difficult to choose the specific library parts of the library for any specific features or widgets, for example the nice window message box dialogs. 'Packages' didn't help much, or I do not know how to use them :). If you have any expectations from Ext JS 2.0 about being it any more lightweight or choosing specific library parts easily, it may disappoint you. But you'll definitely like the more dramatics Ext 2.0 has to offer over its predecessor.

Ext 2.0 offers newer components, layouts, better examples and a better documentation. It's worth of upgrading to it for your current web 2.0 application, if time permits.

Wednesday, December 5, 2007

Animoto - A.I. creates your music videos!

"Animoto is a web application that automatically generates professionally produced videos using patent-pending Cinematic Artificial Intelligence technology and high-end motion design. Each video is a fully customized orchestration of user-selected images and music. Produced in widescreen format, Animoto videos have the visual energy of a music video and the emotional impact of a movie trailer.

The heart of Animoto is its newly developed Cinematic A.I. technology that thinks like an actual director and editor. It analyzes and combines user-selected images and music with the same sophisticated post-production skills and techniques that are used in television and film. The technology takes into account every nuance of a song: the genre, song structure, energy, rhythm, instrumentation, and vocals. Whether it's punk, pop, hip-hop or a classical Stravinsky piece, every Animoto video is totally customized. Even videos generated with an identical set of images and music will each have a completely distinct set of motion design. No two videos are the same. They can be emailed, and embedded in pages on websites including social network sites like Facebook and MySpace."

The above text is taken from the Animoto web site.

So A.I. creates music videos for you! Can things be anymore cool? :) I guess this application will get huge popularity in a few days. YouTube fans won't wait to publish thousands of their own music videos, created with this, right away.

You can create only short length, 30 seconds videos for free but you can create as many as you want.

Check it out at http://animoto.com/.

Saturday, December 1, 2007

Why Good Programmers Are Lazy and Dumb

Please check out this very interesting article, you'll surely be convinced that you're lazy and dumb and will realize why you've been coding so hard all these years :). I really liked this article. Here goes the first few lines from the article:

"I realized that, paradoxically enough, good programmers need to be both lazy and dumb.

Lazy, because only lazy programmers will want to write the kind of tools that might replace them in the end. Lazy, because only a lazy programmer will avoid writing monotonous, repetitive code – thus avoiding redundancy, the enemy of software maintenance and flexible refactoring. Mostly, the tools and processes that come out of this endeavor fired by laziness will speed up the production."

URL: http://blogoscoped.com/archive/2005-08-24-n14.html

Chao!

Friday, November 30, 2007

How to become a good programmer

At ReliSource, many of the times I am involved in the hiring process and need to take several interviews per week/month. Over the last two years, I’m observing one unfortunate truth which is: Bangladesh is lacking enough skilled programmers. Some people have talked about this issue previously and I think it’s time to take some real steps to improve the situation so that we do not face a disaster in the near future.

I’m putting some suggestions here for the fresh graduates and the college freshmen on how to become a good programmer.

In my own definition, a fresh graduate good/skilled programmer should have the followings:

  1. Strong skill of one or more good languages like C++, Java and C#.
    1. Must have strong skills with control structures. Don’t mess up if you’re asked to print out triangle or other shaped piles of ‘x’s with loops.
    2. Must have strong skills with recursion. You must know how to transform a looped task into a recursive one and vice versa, for example: multiplication using addition recursively.
    3. If your language is C/C++, you must know how to play with pointers and references.
    4. Understand pass by value and reference.
    5. Clearly understand scopes and memory allocation, de-allocation. Know when a object is destroyed and when to destroy.
    6. Know the usage of all operators including bit-wise ones.
  2. In-depth knowledge of OOP.
    1. Only being able to write classes and doing encapsulation and inheritance is not what you should call good OOP.
    2. Clearly understand how function overloading, overriding, polymorphism works.
    3. Clearly understand how constructor/destructor (if any) works with inheritance.
    4. Clearly know the difference and use of Interfaces and Abstract classes.
    5. Know how to overload operators. Why and how copy constructor is defined/used.
  3. Know common data structures
    1. At least know the common data structures like stack, queue, linked list, doubly linked list (know circular version of all of them) and trees.
    2. Be a skilled implementer of any of those, have clear concept of how push, pop, add, delete, peek etc method works on those data structures.
  4. Know most common algorithms well
    1. You don’t need to memorize pseudo codes line by line but you need to have clear concept of most common algorithms of sorting(bubble, quick, merge, heap, bucket, etc), searching (including DFS, BFS), etc.
    2. As a fresher you must know their time and space complexities, pitfalls and improvements (if any).
  5. General computing concepts:
    1. Know processes and threads, how are they related to each other, how to program them, etc.
    2. Understand TCP/IP: Don’t think it’s only the network administrator’s task to understand TCP/IP. All programmers ever doing any network or web programming should have clear TCP/IP concepts and understanding.
  6. Be skilled in debugging in IDEs:
    1. Be skilled in any of Visual Studio/Visual Studio.Net, Eclipse, Netbeans, KDevelop, etc.
    2. Know how to debug your code.
  7. Have basic knowledge of Software Engineering and SDLC.

Some advice for college freshmen:

  1. Start with C++ or Java, avoid starting with scripting languages:
    1. If you’re learning programming for the first time, avoid starting with scripting or loosely typed languages like: PHP, ASP, Perl, etc or Visual Basic. It may destroy your understanding of program execution, data types, memory allocation, etc.
    2. Start with C++ or Java. If you want to me to be specific, start with C++, you’ll love it for the rest of your life.. :) It’ll be easier for you to learn (almost) any other language (like: C#, PHP, ASP, etc).
    3. If you ask, do you need to know C to start with C++? Or should you learn C first and then C++? C definitely helps a lot for learning C++ but it's not mandatory to start with C.
  2. If you want to be a good programmer, keep on coding at least 20 hours a week for the next 4 years :).
  3. Never stop learning new technologies that are coming out everyday.
  4. Know some of the many languages/technologies but be master of one. Know at least one language very well.

Good luck!

An interesting interview with great programmers

Please check out this interesting interview.

The following persons were interviewed:

  • Bjarne Stroustrup - C++ creator
  • Linus Torvalds - The Linux kernel author
  • James Gosling - The Java language creator
  • Peter Norvig - Research Director at Google, a well known Lisper, author of famous (in some circles at least) books about AI.
  • Guido Van Rossum - The Python language creator
  • Tim Bray - One of the XML and Atom specifications author and a blogger too.
  • Dave Thomas - Author of the “Pragmmatic Programmer”, “Programming Ruby” and other great books about programming.
  • David Heinemeier Hansson - Author of the Rails Framework - the new hot web development framework.
  • Steve Yegge - Probably the least known from guys here, but also made one of the most interestings answers, has a popular weblog about programming. He is also the author of a game called “Wyvern”.

The following questions were asked:

  1. How did you learn programming? Were any schools of any use? Or maybe you didn’t even bother with ending any schools :) ?
  2. What do you think is the most important skill every programmer should posses?
  3. Do you think mathematics and/or physics are an important skill for a programmer? Why?
  4. What do you think will be the next big thing in computer programming? X-oriented programming, y language, quantum computers, what?
  5. If you had three months to learn one relatively new technology, which one would You choose?
  6. What do you think makes some programmers 10 or 100 times more productive than others?
  7. What are your favourite tools (operating system, programming/scripting language, text editor, version control system, shell, database engine, other tools you can’t live without) and why do you like them more than others?
  8. What is your favourite book related to computer programming?
  9. What is Your favourite book NOT related to computer programming?
  10. What are your favourite music bands/performers/compositors?

Url: http://www.stifflog.com/2006/10/16/stiff-asks-great-programmers-answer/

Chao!

Thursday, November 22, 2007

Some interesting facts about the origin of C++

If you don't know them alredy, enjoy:
  1. BCPL’s // comment convention was (re)introduced in C++.
  2. The class concept (with derived classes and virtual functions) was borrowed from Simula67.
  3. C++’s facility for overloading operators and the freedom to place a declaration wherever a statement can occur resembles Algol68.
  4. Templates were partly inspired by Ada’s generics (both their strengths and their weaknesses) and partly by Clu’s parameterized modules.
  5. The C++ exception-handling mechanism was inspired partly by Ada, Clu, and ML.
  6. Other developments in the 1985 to 1995 time span – such as multiple inheritance, pure virtual functions, and namespaces – were primarily generalizations driven by experience with the use of C++ rather than ideas imported from other languages.

Source:The C++ Programming Language, Special Edition by Bjarne Stroustrup.

Linux: Using the 'find' command.

In Linux, often times you'll need to find files using patterns like '*.txt' or 'sys*.*' and do operations with the results. You can do that in several ways. A harder way will be writing a complicated script using the 'ls' and 'grep' commands in pipe. But the 'find' command is one of the easier ways. I'm using the terms 'easier' as I'm not sure of the 'easiest' way as I am not a Linux guru.. well yet.. ;)

The 'find' command is powerfull but if you're a begginer, you'll hardly understand the help or manual of it. I won't re-write the man page in some easy way here, rather I'll just give some examples so that you can quickly use it and understand the man page later on. So, here goes the examples:

1. Search all '.txt' files in the current directory, including its subdirectories:

find . -iname "*.txt"

2. Search all files with the name 'pre_*.txt' (example: pre_01.txt, pre_abcd.txt, etc) in the 'src/dir', including its subdirectories:

find src/dir -iname "pre_*.txt"

3. Search all '.txt' files in the current directory, including its subdirectories, and copy/move them to another directory:

find . -iname "*.txt" -exec cp {} /dest/dir \;
find . -iname "*.txt" -exec mv {} /dest/dir \;

Note: don't forget the '\;' in the end, it won't work otherwise.

4. Find all .htm files in the current directory, including its subdirectories, and compress them into a gzip file naming 'output.tar.gz', maintaining the directory structure that they were found in:

find . -iname "*.htm" > temp.txt
tar -czT temp.txt -f output.tar.gz

I hope this post will be helpful to you sometime.

Monday, July 23, 2007

C++: A nice thread class

Java and .Net have very nice and easy ways to create threads. We can trun any class into a thread within seconds and that's probably one of their coolest features. As a Win32 C++ programmer, we don't have this advantage. But we can achieve this very easily. Here is how.

Following is my thread class which you need to include to make threading a piece of cake.

The class:
  1 class Thread
2
{
3
public:
4
Thread()
5
{
6
hThread = 0;
7
}
8
9
void start()
10
{
11
_threadObj = this;
12
13
DWORD threadID;
14
hThread = CreateThread(0, 0, threadProc, _threadObj, 0, &threadID);
15
}
16
17
void stop()
18
{
19
if (hThread)
20
TerminateThread (hThread, 0);
21
}
22
23
virtual void run() = 0;
24
25
protected:
26
static unsigned long __stdcall threadProc(void* ptr)
27
{
28
((Thread*)ptr)->run();
29
return 0;
30
}
31
32
Thread *_threadObj;
33
HANDLE hThread;
34
};
35

Example of usages:
 36 class YourClass: public Thread
37
{
38
public:
39
YourClass() { }
40
~YourClass() { }
41
42
//the run function, you need to override this one
43
void run();
44
45
private:
46
//private variables
47
};
48
49
void YourClass::run()
50
{
51
//Add your threaded code here
52
}
53
54
int main()
55
{
56
YourClass obj;
57
obj.start();
58
59
//the thread is running
60
61
obj.stop();
62
63
//the thread is stopped
64
return 0;
65
}
66


Looks cool, right? It's your turn to try it. Happy threading.

Thursday, June 21, 2007

CMM & Processes - Where does Bangladesh stand?

Today, in the SQABD mailing group, I noticed the following two questions:

1. Would you please inform me that how many companies of BD actually make a proper use of RUP, XP and so...

2. In terms of our country, process improvement is its initial stage......Not many company is working on SPI..... Look at India, where are they and where are we...?

I had seen these types of questions before and would like to answer with an explanation from my perspective. I'll start by commenting the questions again:

1. Would you please inform me that how many companies of BD actually make a proper use of RUP, XP and so...

If you need the number, it's not "many". If you need to know why, you'll find my comments about it later in this post.

2. In terms of our country, process improvement is its initial stage......Not many company is working on SPI..... Look at India, where are they and where are we...?

I would like to ask a few questions first: what's the size of the largest software company in Bangladesh? Let me ask the question in another way: how many of the software companies in Bangladesh is of size 100 or more? (including all employees - engineers, admin, management?) How many CMM level 2 (first certification level) companies we have? (we know anyone is in Level 1 by default).

Now, let's ask the same questions about India... If you do a little googling, you'll find that Infosys alone has 72,000 employees and Wipro has 68,000. India has got 60 CMM Level 5 companies, which is 75% in the whole world!!

And we compare ourselves with India every now and then?!!!! IMHO, comparing a new born with a 30 years old man is not always a good idea.

Let's dig a little deeper..

So, we should agree that regarding software industries, our country is in a very negligible state comparing to the "giant" India. (I don't want to discuss the reasons for that, it's out of the scope of this topic.) So, even they are t-o-o large, can we compare their engineering processes with ours? why or why not? You may also ask, why can't we follow from the begging what they are following at their mature stages?

To get the answers, we need to stop "guessing" and do some studies on CMM implementations first, if we haven't already. I strongly recommend everyone to read "CMM in Practice" by "Pankaj Jalote". (You may not get the book in Bangladesh.) If you don't know him already: He is Professor and Chairman of the Department of CSE at IIT, Kanpur and he is a legend in engineering processes and CMM. He worked with the processes at Infosys for many years. Now, here goes my answer to my above questions:

First, I'd really like to clarify the terms and relations between, "Process" and "CMM".

There are two main categories of processes: Engineering and Business. They are both important for any company, engineering process alone cannot improve the company. There are a lot of engineering and business processes defined/sketched out there. You can define your own too.

If a company wants to follow an existing engineering process, it must study and know what the other common engineering processes are. The company should do some studies about them, try to compare them and find which one fits best to the company. It is very important to know that some processes fit good only to some particular types of projects. For example, where the client doesn't know the requirements (as they don't in many practical cases), you can't fit IBM RUP into it, Prototype may do a better job in that case. For another instance, you may not be able to fit all of your junior coders into XP as it was built for experienced ones. Iterative waterfall, Incremental Evoluation, RAD, Staged delivery processes has their own glories. Some processes are more completely defined than other, you'll find good and complete documentation on them as you may not find on some other. You may also need to understand license types, training and certification costs for some proprietary processes.

Next, so we learned about the different processes, why wait to implement one?

One size doesn't fit all! Yes, none of the business processes and engineering processes will fit your company 100%. You may need to customize it, which is known as 'tailoring' in many processes. To do so, you need to know what your company needs now and potentially in the future and what not at all. It's a lot of work.

CMM, defined by CMU SEI, on the other hand, does not define an engineering process. It's a process evaluation framework. It defines the maturity models and the qualities a process need to have to achive the maturity levels. You need to study and outline what your processes need to have if you want to achieve the next CMM level. There are 18 important KPAs (Key Process Areas) you need to have a good idea of. There are different CMMs (extensions and versions) including SE-CMM, SA-CMM, SW-CMM, P-CMM and CMMI.

Next, the hardest part is the real life implementation. Even if you define your dream process set, it will be a nightmare to implement it in a team, let alone in the whole company. It takes a lot of effort and dedication to implement even some simple processes.

For that, you need to have dedicated "Software Engineering Process Group" with one/more dedicated "Process Coach". According to Pankaj Jalote, typical size of the SEPG is 1.5% of size of the company. Task of the SEPG is to understand, define, implement, ensure implementation, study improvement and improve the process itself.

This is where Bangladesh failed so far. Take an example of a good company of Bangladesh: Company X has 50 engineers. Size of SEPG should be less than 1 (if we take 1.5%), as the company size is very small, say we took 1 or 2. Now the problems are:

  1. Company X doesn't even know they need a SEPG.
  2. When they know, Company X doesn't want to effort (even) 2 senior guys just for implementing processes! They keep asking, what's the output, what's the benefit, etc.
  3. It's a whole lot of tasks for a 2 person team. It will take a long time to complete all of the steps and even get to CMM level 2. It's not in months, it may take years.
  4. Company X cannot even effort a third company (say from India) to come and assist them. Moreover, no other company will understand your works and process needs more than you do.

I hope, you all agree with these problems. This is the scenario of a company of size 50, think about the smaller ones of 10, 20 or 30!

Now compare the scenario with a small/medium size Indian company of size 1,000. SEPG is (1.5%) 15 people. A team that large can work much faster and better. They will succeed to get into higher CMM levels very fast.

The reason why I explained a lot about the whole implementation effort is really to give you an idea about the real life effort required and why things fail with us. I had worked in such a SEPG in a company. I learned some of the facts mentioned above while working in it.

Please post your comments, if any.

Note: Few figures were corrected on June 28, 2007.

Sunday, May 20, 2007

Use the right antivirus!

I would like to share a painful experience with the Antivirus applications we trust!

Few days ago my home PC got infected with a worm (IM-Worm.Win32.Sohanad.t) that attacks the Windows OS, disables all important tools including:
Task manager, regedit, msconfig, ..even the command prompt!

It creates its copies in most drives, primarily in removable ones and creates autorun.inf to auto run itself, creates a copy of itself (exe file) for each folder in the removable drive!

So, you may ask, didn’t I have an updated antivirus? Yes, I had and that’s the point of my email. I had Norton Antivirus 2005 with the latest definitions updated. Unfortunately even after manual updates and manual scans on the infected exe files it couldn’t find any threats!

More bad news! I tried all of the following top most antivirus and anti-malware applications but they couldn’t detect the virus:

PC Cillin 2004 with updates, Adware Professional with updates, Spyware Doctor, SpyBot Search & Destroy!

So I did some googling to learn which are the current ‘top 10’ antivirus applications. I found ‘Kaspersky 6’ to be the top most one in several ‘good’ web sites. I never heard of it! Interestingly Norton, Trend Micro, McCafe are not in ‘top 5’.

I downloaded and updated Kaspersky and it could detect and clean the virus very well! I installed it in my office PC and it got 2 spywares which our default Network antivirus couldn’t find! Don’t know how long the spyware was in my PC!

Summary: I suggest all to recheck the ‘top 5’ list of antiviruses to get ‘true’ protection from latest viruses/malwares. I found Kaspersky good for my case.

Saturday, May 19, 2007

Online (Comprehensive) English to Bengali Dictionary

Last week I was looking for a web based dictionary in the web. I found two sites with very poor collection of the word translation. (Details mentioned end of the article). At once I decided to give one whole night a try and create my own online dictionary. And guess what? I did.

How: After some googling, I got two good Unicode based dictionary databases. But none of them translate from English to Bengali. They were Bengali to English and Bengali to Bengali. Hmm.. they don't seem to be much useful, do they?

This is what I did: created my db schema, wrote a php code to parse and enter the entries of two dictionaries into one db table without any duplicates (Bengali and English translations strings into separate fields), wrote another php code to parse the English translation strings and do 'word indexing' and store indexes into another table. Then I created a search page. That's all, I'm done.

The search page searches in the indexed words, prioritize and sort them by their original positions in the translation strings and also categories the results. Works like a charm.

Try it now: www.ittefaq.com/dict.

I'll work on the application some more soon and will make a release. And yes, I do need to check the License types of the data sources :).

The other online dictionaries:

These dictionaries are good starts but look dummy and not really useful.

I may make my dictionary open source soon.

Happy translating!

Thursday, May 3, 2007

JavaScript - Yet another toggle (show/hide) combo box code

You probably already have found or used code to toggle 'select' elements (combo boxes). But some of them have prototype dependancies, some don't work for non-form based elements and some don't work with ajax based pages.

I just wrote this tiny code that seem to do the job on IE, both form and non-form based elements, both ajax and non-ajax based pages. Check it out:
/*
* toggle select boxes by Kaisar
*/
function toggleSelectBoxes()
{
var elems = document.getElementsByTagName("select");
if (elems)
for (i=0; i<elems.length; i++)
elems[i].style.display = elems[i].style.display == 'none' ? '' : 'none';
}