Monday, February 28, 2011

Turbo C/C++ compiler is crippling new graduates !

Most colleges in Kerala  teach C/C++ programming using Turbo C/C++. It is a 16 bit compiler which predates ANSI C/C++ standard by a decade. It does not support templates , STL , exception handling,Windows programming , Socket programming  etc.

The same students find breathtaking graphics being shown in their games. To program games , one should use a game engine or a custom game engine which runs on top of either DirectX or OpenGL. To do this , the students need to learn 32 bit or 64 bit windows programming using Visual C/C++ or a 32 bit compiler which runs on top of Windows.

The other day , a person who was reporting to me joined a company which is a name to reckon with in the software services industry. This bangalore based "Tiger" teaches there fresh recruits C/C++ using Turbo C/C++ !!

These software superbrains will advise next generation of youngsters to learn C/C++ using Turbo C/C++. It is a kind of software "ragging".

Travel from Aluva to Adoor and Back

I happen to travel to College of Engineering Adoor ( on 28th feb. 2010 ) to give a session on 3D Graphics programming using OpenGL ( under Windows ).

When I was walking to the railway station ( less than a kilometer from my home ) I happen to see a dead body on the railway track, with some people around it . ( I might have seen more human corpses than most people as that particular  area near my home is a "suicide point" ) This time , It was an accident (he was walking along the track with mobile phone in his ear. Train came from both sides )  and the guy who got killed was some one whom I have seen in my locality ( I know this father very well ).

I took a 3rd A/C sleeper ticket ( Rs. 265 )  to Chengannur and boarded Kerala Express. I started reading Organization design from Economist magazine and also read some pages from "How mathematicians think ?" . Later , I chanced upon a guy who has worked with Milma and discussion about their Software implementation.

At Kottayam , I happen to know that train will leave the station only around 1.30 pm. I had to reach Adoor by 2.00 pm. So , I travelled by a KSRTC bus to Adoor and managed to reach in the college late by twenty minutes.

Fourty people had turned up for the presentation. Since the audience was not homogeneous and most did not have necessary background (Windows programming , GDI etc ) to understand Graphics programming , it quickly became twelve people ( who remained untill I finished my presentation ) and some of the guys were genuinely interested in Computer Graphics programming. I happen to meet a journalist who attended the session and was busy scribbling notes. Since , he had background in physics , he could follow the presentation really well ( based on feedback and questions from him )

I covered Pixels , Pixel Arithematic , Image processing ( color to grey scale , negative ) , Scan conversion of primitives , FrameBuffer , Transformation matrices , A analog clock program , 3D viewing pipeline , 3D transformation using homogeneous matrices , Jim Kajiya's rendering equation , Monte carlo rendering of Cornell box , Phong lighting model with Gourord shading , Phong shading using GLSL , Flat shading , Ray tracing , Ray casting etc to name a few.

The person who invited me for the event dropped me @ adoor bus stand and I happen to find a perumbavoor bus . I boarded the bus and had a nice nap for nearly two hours. I reached perumbavoor around 9.45 pm and got a bus to Aluva @ 10.10 .

After having my dinner , I am writing this blog entry !

Sunday, February 27, 2011

Why I think I will write computer programs till death ?

I am not saying that Computer programming is a passion for me . But, I write lot of code ( in various languages ) in my work , for preparing presentations , mentoring , and last but not the least for fun.

Most of my friends take a dig at me for my fascination for computer programming and they feel after couple of years into the software industry , one should stop writing code !.

Lask week , I found the reason why they are like them and I am like this.

"Most people think Computer Programming just as a way to make a living . If they are good at it , it is because of the fact that either they are specialist or they have got brains and ego to master most things which comes their way. Personally , I use computer programs as a cognitive device to understand concepts by implementing programs which embodies those concepts."

Some Exampls are

a ) Wrote a regular expression interpreter to understand how regular expressions work.
b)  I wrote a Lisp interpreter to understand functional programming
c)  Wrote a B-tree engine to understand how Database Indexing works
d)  Wrote a Software renderer to understand how 3D graphics works
e)  Wrote some C# routines to understand nuances of Computation Finance
f)   Ported Craig Rich's Generic interpreter to understand how Table driven parsing works

Since most people ( including me !) are not gifted in Mathematics like mathematicians ,Writing Computer programs is a great way to understand certain concepts which is depicted in abstract mathematical notation.

Write computer programs , lot of them. You will come richer ( in ideas !) 

3D Computer Graphics using OpenGL @ College of Engineering,Adoor,Kerala

I have been invited to give a workshop on 3D graphics programming @ College of Engineering , Adoor. The session will deal with Pixels , Co-ordinate transformation , 2D graphics programing , 3D Matrix math , OpenGL fixed function pipeline , OpenGL shading language ( GLSL )  and other computer graphics techniques

Since the examples are on Microsoft Windows and OpenGL , The session will cover rudiments of Windows SDK programming , Device Independent bitmap and WGL.

Three hour session will start on 28th february , 2011 @ 2.00 pm in the college campus.

Thursday, February 17, 2011

Cement Loading/Unloading Pollution - When It is going to hit me , I am taking note !

In my locality , a trading concern has built a huge structure to store and distribute cement sacks. This will force us to move out of the area fearing health problems. I have already invested a huge sum in building a house and renovating another. Moving out , will be a great loss both economically and emotionally.  Modern cements have got adhesive catalysts to speeden up the "cementing" process. We have given complaints to local authorities and has not got any communication back , yet. As per the norms , to start such an activity authorities has to insist to the concern to procure NOC ( No Objection Certificate ) from residents living in the fifty meter vicinity.

I never used to care about pollution issues much before. When I am on the verge of eviction , I have started taking note. But , It is belated wisdom. Watch out for open spaces in your locality and always be on the alert to see who are planning to purchase the plot.

After reading a blog post of mine , a friend sent me a news clip from Indian Express
written by Nitin Patil.

NitinPatil


Tags : MPCB, pune


Following the objections raised by residents around Khadki railway station housing the cement godown, the Maharashtra Pollution Control Board (MPCB) on Tuesday installed a device opposite the railway goods shed to gauge the volume of cement and dust particles that float in the residential area.



The MPCB have already started taking samples of the dust particles. They will be analysed to reach a conclusion.


This is the second time that the MPCB is carrying out a survey in the area, the earlier one was in 2007, and given in writing that the air quality in the area had gone down due to the cement dust flying around.


The issue of local residents suffering from health problems due to the cement godown was highlighted by Newsline in December 2009.


Local residents and political leaders approached us to gauge the dust particles once again so that it could be confirmed. Based on the complaint, we have installed a device, Respirable Dust Sampler, right in front of the cement godown,” Abhijit Kasabe, field officer of MPCB said. He said that the result of the analysis of the samples will be out in a couple of days. “Due to the constant loading and unloading activity, people living in the vicinity had been facing various health problems like respiratory illnesses. Trees, walls and vehicles too get covered with heavy cement coat,” a resident said.


"We decided to take up the issue when the residents approached us explaining the kind of hardships they were going through due to the presence of the cement godown. We held an agitation along with the locals and also met the MPCB and railway officials,” said Feroze Mulla, an office-bearer of Republican Party of India (RPI). The local unit of the RPI had taken up this issue earlier.

Source :- http://www.indianexpress.com/news/mpcb-to-study-pollution-near-khadki-rly-stat/589067/










Who told you there is no free lunch ?

There is a popular saying which goes as "There is no free lunch". The saying implies that for everything you ought to pay a price.  Observations confirms this "theory" more or less. Herb Sutter wrote a highly influential article some time back which went as "Free Lunch Is Over ". He wrote the article to announce the arrival of multi core programming models and Free lunch there was 18 months performance doubling of CPUs ( Moore's law ).

Today , Microsoft is conducting a Web Camp @ Abad Plaza , Kochi. If you have already registered , you will be fed with ideas for your web programming projects and at the same time you will be fed well !!.

As one of my friend quoted some time back ,

"As much as there is no free lunch , there is no free software. At least , I know a place where they serve free lunch . In a Microsoft Organized Seminar ! "

Sunday, February 13, 2011

A Cement Godown Is invading a Residential Area in Aluva ( I happen to live there! )

For the last thirty eight years , I have lived in a residential area where things are centered around a temple. The temple is situated in the western end of the Aluva town. The Name of the temple is Sree Dharma Sastha Temple.

Barring a couple of families , all of us belong to Gowda Saraswath Brahmin Community. Being a linguistic minority ( Konkani speaking ) we are not politically a powerful group and has always been considered as a soft target by some. Since we are fewer in numbers , there is great unity among the people and we have resisted incursions by force into the place we live . During the hey days of ISS ( erstwhile name of the PDP ) , there has been attacks on our shops .

This time , a Business group with interest in Building materials have built a structure meant to be Cement And Steel Godown. People affected have already filed a mass pettition in this regard and have submitted to the Aluva muncipality . No , reply has been recieved so far in this regard from them.

The business group which is good at PR gave some kind of verbal assurance ( a hazy one , we are not planning to use it as a cement godown at this point of time ) that they are going to use it for stroring steel rods. Most of the people living around the structure are strugglers who find it hard to make both ends meet. Thus , are not fully capable to come to the front and fight it. This business group has hired some local "pimps" to do their PR work by giving false assurances and bad mouthing against people who are protesting against this.

Last friday  (Day before ytd ), around 6.10 pm , they unloaded a load of steel by creating noise which might have gone over 200 decibels. ( Anything more than 90 decibels is pollution !) They repeated the same stuff on saturday ( Second saturday ) as well. A neighbhour and I went and protested against it and the partner of the business group gave us assurances that it is only steel and no cement. They have violated their earlier promise and I have considered it as a some kind of diplomatic talk.

Modus Operandi of These people
-----------------------------------
a) Start an operation in an area. If there is no protest , legitimize it by getting license
b) Start an operation in an area , if there is protest , try to buy out the protesters
c) Start an operation in an area , if there is court injection , maintain the status quo
d) Apply for license , In collusion with muncipal authorities do not take any action
    on this application. Automatically, After thirty days ,  it becomes a deemed license. This has been the
   most dominant strategy. So, Muncipal authorities will wash their hands off and the vendor
   will have the license. It is a hidden war against the people.


To the best of the notion , they have bribed the authorities and local poltical class . Some people in our own area are colluding with the "invaders" to settle old scores.

Personally , It has been a great disruption for me and I have to start my life from "scratch" now. I have got a 1600 sq. feet home and a 800 sq. feet house which is going to be practically useless. I will be forced to live in a rented house despite having 2400 sq. feet space. A polluted land won't be purchased by anyone and a losss in that front as well.

Life begins at 40 ! ... I am going to be 39 !.... I think there is wisdom in that saying.

I am attaching a picture where godown area is marked red and my home is marked in violet. Just seven meters from the area.


Wednesday, February 09, 2011

Back to Java after some time...!

I have worked with Java on Desktop ,Web ,  Enterprise applications and Workflow systems. Due to some unknown reasons , people have always hired  me for my .NET skills. So , I occassionally foray into Java in enterprise integration projects every now and then in the past five years. I do keep abreast about the happenings there through blogs and articles.

After a gap of two years , I am going to work with java , groovy/grails. As I write , I am downloading NetBeans IDE for working with those stuff.

Tuesday, February 08, 2011

C++ vs Objective C

Now a days , there is resurgence of interest in Objective C. The usual question I get everywhere is what is the difference and which one is better .

C++ and Objective C are attempts to extend the venerable C programming language to have Object Oriented Programming support.

C++ was created by Bjarne Stroustrup and Objective C was created by Brad Cox. In other words , C++ is an attempt to add Simula like features on top of C and Objective C is an attempt to add Smalltalk like features on top of C.

C++ is statically typed and method resolutions are more or less done at the compile time. In the case of Objective C , it is a dynamic language ( data typing is static with the exception of "id" type ) where there is a run time library to do dynamic message dispatching. The latter has got some advantage in the case of UX programming.

I have found C++ to be much more expressive than Objective C. The primary bottleneck used to be the reference counted memory management of the Objective C language. On MAC OS X , there is a garbage collector to avoid the problem and In iPhone there is hope that it will be added soon.

There is a provision to mix C , C++ and Objective C together into a single program to have best of all worlds.

The GCC compiler driver calls appropriate compilers based on the extension.

a) gcc ( .c )
b) g++ (.cpp)
c) gcc (.m - Objective C )
d) g++ (.mm Objective C++ )

The GCC , MINGW ( GCC under Windows ) has got support for Objective C/C++ language.


Meeting Ravi D.C.

Yesterday , I had gone to buy an electronics book at the International book fair conducted by DC books @ Marine Drive , Eranakulam. I got the book titled "Electronics Circuit and Systems " by Owen Bishop. As always , couple of other titles also slipped into my bag .

I was waiting for a colleague of mine outside the exhibhition hall and happen to see Ravi D.C. ,who is a major stake holder ( only ? ) in the DC publications.

I went and met the person and conveyed my appreciation of the effort which DC books is undertaking by translating English books to Malayalam.

I specifically mentioned about

             a ) Rich dad , Poor dad
             b ) Biography of PC Alexander
             c ) Biography of Mohammed Younis ( Grameen Bank )
             d ) Who moved my Cheese ?

The book has been translated into malayalam and it has helped some people I know . They have not transliterated it , Instead , they have translated it. Some kind of contextification relevant to local settings has been done in the case of the book "Who moved my cheese?".

For a state where there is dearth of books in local language in the areas of science /non-fiction genre , the effort undertaken by them is quite remarkable.

Monday, February 07, 2011

FOSSMEET 2011 - a personal perspective

I did attend and took a session on the last day (6th Feb, 2011) of FOSSMEET  2011 , NIT Calicut. I had plans to go for the event on thursday night itself. Due to some domestic compulsions , I cancelled my trip .

I started around 6.30 am from home and reached railway station to find a long queue. Despite being a sunday , I happen to find enough people to fill a train or two . After standing in the queue for some thirty minutes , finally  I managed to get my ticket.

The EKM-Kannur intercity train was nearly full when it reached the Aluva station. I had to stand uptil Trichur. Reached Calicut around 10.35 am . Amarnath and another guy (who drove the car ) picked me up and we reached the NIT campus around 11.15 am. I straight away walked in to attend Vishnu Gopal's Talk . (Pitfalls of OSS )

Pitfalls of OSS - by Vishnu Gopal
----------------------------------
He was well into his talk by the time  I arrived. The part I happen to attend dealt about issues like

a ) Too much choice is a source of complexity
b)  Dependency Hell ( Versioning dependencies )

He stressed about pragmatic approach to FOSS tools than  an idealistic one. ( This view , I share with him ! )Sooraj Kenoth ( SMC  ) had some objections to some of the point and Vishnu was careful not to react sharply as such a reaction can be interpreted as he is against FOSS.

I also particpated in the post presentation Q&A . The topic of discussion was "Why Free and Open Source community is closed ?!"

An Introduction to NLTK by Sreejith S
----------------------------------------
It was a wonderful talk by some one who is a practicioner of Natural language processing. He explained NTLK (Python ) as a toolkit for doing Natural Language processing. He also stressed the fact that NLP is a cross between Computer Programming , Linguistics and Statistics.

Since the topic of NLP requires some heavy math and theory , he was careful to show a hands on session with NLTK using his Linux laptop. I learned about lot of techniques like Stemming , Lemmatization , Concordonce , Parts of Speech Tagging , Bigrams ( trigrams and n-grams ) , Interence , Text Corpus ,
Model building through learning  etc..

The gist of his talk is as follows :- NLTK is a practical tool which has made it possible for thousands of people do NLP. Uptil the arrival of NLTK , you had to implement everything yourself and it requires good grounding in math and statistics.

He was ably assisted by his colleague Mr. Biju ( whose session on Apache Mahout collided with my workshop timing and could not attend ).

Lunch time ....!
----------------
I had my lunch and met Kenneth Gonsalves , the person who was conducting the Python workshop. I had met him last september at Bangalore , when I had gone to give a talk "Extending and Embedding Python under Windows" @ Pycon India , 2010 . I did meet Hiran (Champa project ) , Sooraj Kenoth ( SMC )
and a KWA employee ( who is a ardent GNU Linux follower ).

Introduction to GCC by Praseed Pai (It's me ! )
-------------------------------------------------
I started around 2.00 pm and some twenty + people attended my workshop. The talk explained about GCC and the it's architecture ( front end , RTL , back end ) and stressed the fact that GCC is a cross platform compiler .

The session had two parts , Compilation/Linking  of C/C++/Objective C programs and GUI programming . My original plan was to have one hour talk on each part. Considering the fact that the audience contained people with hetrogenous background , I did stress the first part.

The topics in the first part were

a) How to compile C , C++  and Objectiv C programs under Linux ( gcc and g++ )
b) Compiler vs Compiler driver
c) Invoking GCC under different modes ( compile only , compile/link , link only )
d) Compiling multi-file programs ( Source files were named after two participants !)
e) Creation of static libraries (.a)
f) Creation of shared objects (.so)
g) How to invoke .so from programs ( ./libname.so vs LD_LIBRARY_PATH )
h) How to dynamically load a .so ( function pointers ! and dynamic linker )

I did spend 90 minutes on this.

The second part contained

a ) Introduction to Xlib Programming and Compilation/Linking of Xlib programs
b) Introduction to  WxWidgets and Compilation/Linking of WxWidgets programs (using wx-config )
c) Introduction to Qt and Compilation/Linking of Qt programs ( using qmake )
d) Introduction to GTK+ and Compilation/Linking of GTK+ programs ( using pkg-config )

I hope , the people who participated in my workshop might have got some thing to take home.

After the talk , I did meet Noufal Ibrahim (Pycon Organizer !) and he introduced his brother (who is a student ) who had attended my workshop to me.  I also met Karthik singhal . Couple of guys asked me whether QT or WxWidgets is a better tool. We had a one minute discussion on it.

It was a wonder ful audience and I loved it .

Final moments
---------------
Amarnath  and another guy dropped us (  Sreejith , Biju and I  )  In the Calicut city. I disembarked at KSRTC bus stand and got  a super express Bus. Reached home around 10.00 pm.










Thursday, February 03, 2011

FOSSMEET-2011 - I'm speaking about GCC (under GNU Linux )

GCC ( GNU Compiler Collection ) is a toolchain which has got compilers (rather compiler front-ends ) for C ( .c ) , C/C++ (.cpp ) , Objective C (.m )  , Objective C/C++ (.mm)  and even Java ( GCJ ) language. The toolchain includes linker ( ld ) , static librarian ( ar for creating .a file )  , debugger ( GDB ) , dynamic linker etc.

Being a late entrant into the Linux arena , I was pleasently suprised to know that most people who talk about Linux do not know about the native compilation tools provide by the GCC. Majority of the linux afficionados ( barring a few ) are from Infrastructure side or from the LAMP camp.

The Session will give it's participants good grounding in Linux C/C++ ( native ) development using GCC.

The topics covered include

        a ) Compile/Link/Debug Cycle model for developing Native applications
        b)  Compiling multi-file C/C++  programs
        c)  How to create Static Libraries ?
        d)  How to invoke functions from Static Libraries and Link to them.
        e)  Introduction to Shared Objects ( .so )
        f)  Building Shared Objects using C/C++
        g)  Linking to a shared Object Library.
        h)  How to use dynamic linker to invoke a function from .so
        I)  Introduction to GUI Programming under Linux
        I)  How to compile GUI programs using Qt , WxWidgets and GTK+

  If time permits , how to compile and link Objective C programs will also be demonstrated.



  

Wednesday, February 02, 2011

Possibilities !

Prem is currently working in a small company which is about to close it's operation and Tilak is working with a leading Indian MNC.

Prem :=> "I need to hurry up , as the ship is sinking ..."

Tilak => "I do not have to worry about the ship which i am in !"

Prem =>"That is because , you are treated as a "shrimp" there ..."

Tilak => "Sour grapes !..."

After a while , Prem applied and got a job in the Google in their technical support dept. Perplexed ,
Tilak went to the Guruji.

Tilak =>"How , Prem might have got into the Google ?"

Guruji =>"He is in their technical support division , where entry barrier is low "

Tilak =>"Still , I am perplexed how he got in there.."

Guruji =>"He lost his Job. When you are JOBLESS , Possibilities are ENDLESS. You will attempt everything and stumble upon some thing."