Tuesday, June 9, 2009

My experience with a programming error

Today I spent hours just because of a blunder in my programming. I am working on Esterel language and did some programming in that for last 6 months. In Esterel, a condition checking is done using '=' operator and the operator for assignment is ':='. There is limited support of data types in Esterel, hence, to get the support of structure kind of data types it takes support form C as the host language. I am programming some part of my project in C as the host language for Esterel. Here comes the blunder that took hours of my time. As I was doing programming mostly in Esterel for last several months I used the same '=' operator for condition checking in if condition in C. As we all know '=' operator in C stands for assignment. Since an assignment operator in an if condition is valid in C, the compiler does not generate any error. I spent hours checking my logic but all that was right even if I check for 20 times. Now my question is How do we get to know such kind of programming blunders we do????? I think the best possible option is that the compiler should give a warning but not an error. Generating a warning in this case is reasonable as most of the programmers do condition checking more often than an assignment in an if condition.

Here is a possible solution to get rid of such kind of errors apart from C compiler generating a warning. When you are in such kind of situation that all your logic is correct and the compiler does not generate any errors but still the program does not behave as you expect, ask one of your friend to check the code and there is a high probability that he will definitely catch those kind of silly programming errors.

Monday, June 1, 2009

ISRO written test paper(Computer Science)

I attended ISRO written test this year(2009). Before attending the exam I tried to get some ISRO papers to prepare but I didn't find one. So, I thought of sharing my paper so that it helps later year students to prepare well and get some idea of the question paper......
Here is the link to download the paper ISRO written test paper(CS)

Sunday, February 22, 2009

Installing Gnome ip messenger in ubuntu

Download debian package file of gnome ip messenger here or from this page. Once you download the file, double click on it. It gets installed through GDebi package installer. You have to add the ip messenger applet to your panel. To do this go to your main panel and right click on it. Choose Add to panel and select the ip messenger applet.

Friday, February 20, 2009

ఓం నమఃశ్శివాయ ----- శివరాత్రి శుభాకాంక్షలు

This song is one of my all time favorites. It has beautiful lyric,music and well sung by shankar mahadevan. I was trying to get the lyric in telugu but I was not managed to get it. So, I have written the telugu lyric in lekhini.org and posting here.

ఓం మహా ప్రాణ దీపం శివం శివం
మహొంకార రూపం శివం శివం
మహ సూర్య చంద్రాగ్ని నేత్రం పవిత్రం
మహ గాఢ తిమిరాంతకం సౌరగాత్రం
మహ కాంతి బీజం మహ దివ్య తేజం
భవానీ సమేతం భజే మంజునాథం
ఓం నమశ్శంకరాయచ మనస్కరాయచ నమశ్శివాయచ శివ తరాయచ భవహరాయచ
మహా ప్రాణ దీపం శివం శివం
భజే మంజునాథం శివం శివం
అద్వైత భాస్కరం అర్థ నారీశ్వరం
త్రిదశ హృదయంగమం
చతురుదధి సంగమం
పంచభూతాత్మకం
షట్చత్రు నాశకం
సప్తశ్వరేశ్వరం
అష్టసిధ్ధీశ్వరం
నవరస మనోహరం
దశ దిశా సువిమలం
ఏకాదశోజ్జ్వలం ఏకనాథేశ్వరం
ప్రస్తుతివ శంకరం
ప్రణథ జన కింకరం
దుర్జన భయంకరం
సజ్జన శుభంకరం
ప్రాణి భవతారకం
పృకృతి హిత కారకం
భువన భవ్య భవ నాయకం
భాగ్యాతంకం రక్షకం ఈశం సురేశం ఋశేశం పరేశం నటేశం గౌరీశం గణేశం భూతేశం
మహా మధుర పంచాక్షరీ మంత్ర మార్చం
మహా హర్ష వర్ష ప్రవర్షం సుశీర్షం

ఓం నమో హరాయచ స్మరహరాయచ పురహరాయచ రుద్రాయచ భద్రాయచ ఇంద్రాయచ నిత్యాయచ నిర్నిత్యాయచ
మహా ప్రాణ దీపం శివం శివం
భజే మంజునాథం శివం శివం
డండండ డండండ డండండ డండండ డక్కాది నాద నవతాండవాడంబరం
తథిమి తకథిమి దిథిమి థిమిథిమి
సంగీత సాహిత్య సుమ కమల బంబరం
ఓంకార హ్రీంకార శ్రింకార ఐంకార మంత్ర బీజాక్షరం మంజునాథేశ్వరం
ఋగ్వేద మాద్యం యజుర్ వేద వేద్యం సామ ప్రగీతం అథర్వ ప్రభాతం
పురాణేతిహాస ప్రసిద్ధం విశుద్ధం
ప్రపంచైక సూత్రం విబుద్ధం సుసిద్ధం

నకారం మకారం శికారం వకారం యకారం
నిరాకార సాకార సారం మహాకాల కాలం మహానీలకంఠం
మహా నందనందం మహాట్టాట్టహాసం
జటాజుట రంగైక గంగా సుచిత్రం
జ్వలత్ ఉగ్ర నేత్రం సుమిత్రం సుగోత్రం
మహాకాశభాసం మహాభాను లింగం
మహా వర్తృవర్ణం సువర్ణం ప్రవర్ణం
సౌరాష్ర్ట సుందరం సోమనాథేశ్వరం
శ్రీశైల మందిరం శ్రీమల్లికార్జునం ఉజ్జయినిపుర మహా కాళేశ్వరం
వైద్యనాథేశ్వరం మహాభీమేశ్వరం అమరలింగేశ్వరం రామలింగేశ్వరం కాశీవిశ్వేశ్వరం పరం ఘృశ్మేశ్వరం
త్ర్యంబకాధీశ్వరం నాగలింగేశ్వరం
శ్రీకేదార లింగేశ్వరం
అగ్ని లింగాత్మకం జ్యోతి లింగాత్మకం వాయు లింగాత్మకం ఆత్మ లింగాత్మకం అఖిల లింగాత్మకం అగ్ని సోమాత్మకం
అనాదిం అమేయం అజేయం అచింత్యం అమోఘం అపూర్వం అనంతం అఖండం
ధర్మ స్థల క్షేత్ర వర పరం జ్యోతిం
ఓం నమః సోమాయచ సౌమ్యాయచ భవ్యాయచ భాగ్యాయచ
శాంతాయచ శౌర్యాయచ యోగాయచ భోగాయచ కాలయచ కాంతాయచ రమ్యాయచ గమ్యాయచ
ఈశాయచ శిరీషాయచ శర్వాయచ సర్వాయచ

*******************
చిత్రం: శ్రీ మంజునాథ (2001)
సంగీతం: హంసలేఖ
సాహిత్యం: మహర్షి వేద వ్యాస్
గానం: శంకర్ మహదేవన్


Saturday, January 3, 2009

kill any application in linux through terminal

Here is a small shell script to kill any application in Linux through terminal. Of course you should have the permission to kill that process.


EXPECTED_ARGS=1
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage: appkill.sh [application name]"
exit 0
fi
pid=`ps -el | grep $1 | awk '{print $4}'`
echo $pid
kill -9 $pid

Save it as, say appkill.sh . Now make the file executable using the following command

$> chmod +x appkill.sh

Now one can kill any application by giving its name as an argument to the script

$> appkill.sh applicationname

Example: To kill firefox use

$> appkill.sh firefox