Kari’s Weblog

expressions unlimited

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 864 other followers

  • Twitter

  • Find me on

  • Bookmarks

  • Categories

Archive for August, 2007

Object-oriented pragramming using stuctured programming language

Posted by karthikjcecs on August 27, 2007

“C” is my first programming language. I learnt it quite good in my 5th, 6th sem of engineering and I got good interest in programming. I used to do all programs in C. I was thinking of “why to use object -oriented(O-o) when everything is possible in C?”

My vision towards O-o changed when I started on a project in IBM-ISL as an internship program in my 8th semester. There I clearly found out why object oriented is required, its power and ease of programming.

Now I am working on a project which uses C language and I am finding it difficult to understand existing code and to change code is even painful. The project is embedded software, here optimization is of great concern, so one cannot use O-o language for this.

So I thought of why cannot we write structured programs in an object oriented fashion. Some tips came into my mind. Those as follows,

1. Dont use extenal variables.

If you want to share variables among files, follow these:

a. Create static global in the file. Write get and set functions for each static variable. (get function returns the variables value, set function sets the value)

b. Create a header file, declare all the public functions in it. (Like those get and set functions)

c. Those who want to access the variable should include the created header file.

This helps in data abstraction to some extent. Finding the files which access the specific variable becomes easier ( Files which includes header actually uses it )

2. modularize by creating a file for specific function. Should be able to describe the purpose of the file very clearly (Just like class declaration. My idea is to create on file instead of one class here )

Well, its not difficult to break this. Programmers should have such standard conventions and make it easier of a third party to make changes. Even though if we follow this in the future if some one comes and declares the variable externally, it fantastically works, but industry should not allow it to happen, should maintain convention.

These what I felt. It may be totally crap :(, Or may have some value. May be we can improve in this regard. Or even some one might have already thought of it ( I don know )

programmers comment on this.

Advertisements

Posted in C programming, New Idea, Object-Oriented programming, project, Technical | Leave a Comment »

Me on a bike without clutch in the middle of the road

Posted by karthikjcecs on August 24, 2007

Title seems sceptical. The story is about how I managed when clutch wire of my bike got cut in the middle of a road in bang.

In Detail :

Day before yesterday (22nd aug 07) I left office at 6:30 and went to meet my friend in kormangala. I spent time with her till 8:30 and planned to leave I was supposed to reach home as early as possible. The bad thing was that I was not knowing the way to my home from there. I just asked someone the route to MG road (From there I was knowing) he showed the direction, I started in that way. With some confusion I finally reached MG road. I felt ………aahha….. and thought “On one can stop me going home 🙂 ” I rode just about 4 km from MG road and stopped in a signal. The clutch of my bike was not comfortable, I thought “Ok, let me somehow manage till home, tom I have to repair it” Signal turned green, I shifted to first gear, clutch released automatically and bike came to a stop. God only knows how I came on to footpath with my bike (from middle of highly traffic road). I called up my sister to tell this and I would be late, but no response. It was 9:30 already and my home is fine 10 km from there, that too I have to travel in dense traffic area. I started asking people who stops for signal about a service center nearby, but was not fruitful. One guy told there is one, but very far (he was unsure ). I came back at the bike, removed clutch covering and pulled the clutch wire (I was planning to ride by pulling that wire instead of applying lever) but the bad thing is there was no action at all. Then I thought “If I stand here then I have to be here whole night, no one is here to help.” I started pushing my bike. There was slight down, I got a pretty good speed. I decided to try last time to ride without clutch. Started the bike, pushed a bit to get a decent speed, shifted to second gear directly with rise of accelerator. yepppeee, its bike started to move with full speed. I changed gear to 4th without bothering about my bike (Changing gears without clutch is harmful to bike) . Now I was bothered about what would I do in signals? Unfortunately there was a signal ahead. Seeing that signal I dropped gears and brought to neutral. I kind of satisfaction inside me. I had the idea of pushing bike a bit and shifting to second gear when signal turns green. I did as per my idea. went without any trouble till next signal. I asked one of the guy beside about the nearest service center(This I should not have done). He told some way(out of the highway). I took that way and reached by asking people in middle. As you all can guess, it was closed. So I took a way back, rode about 2-3 km, I found out that I have missed my way (remember I am riding without clutch). Asked one auto driver about the route. The auto passenger stated to confuse me telling go that side, this side (I think he is a mentally retarded person), then driver told the proper way. I took that and I almost reached (home was just 3 km). I told to myself “Now I can easily reach home.”Traffic got move slowly, I just look ahead, I saw vehicles packed till half a km from there. Very slow moving traffic was there. Without a clutch no one can ride in such a situation. So I took my bike on the foot path and started pushing. after I pushed half km, traffic cleared, I rode home with my hands full of grease. Had delicious food prepared by my sister and slept 🙂

Never assume things, No one knows what happens in the seconds.

Posted in Bike, personel | Leave a Comment »

New Sony Ericsson w700i

Posted by karthikjcecs on August 21, 2007

Flash back

It was my dream in my lower semesters of engineering to own a high end handset. I was fascinated by seeing nokia 7610. I even borrowed with my friend for just a day. In those days I was thinking “Once I get placed then who can stop me by buying a very good cell phone” But things went differently, before placing I got internship in 6th sem. Started working at the end of 6th sem. I had responsibilities, between cell was banned in college campus. My interests towards the cell phone had gone down, I managed with my old Nokia 2300.

Present :

My old cell took retirement. Now its time to buy a new cell. So was going to make my dream true. Sudsuddenly a thought came to my mind, “Is it really useful to me? I hardly get time. what do I do with a cell having all these features?”. That is true, people used to scold me that I always doing something with my cell (even though its a low end set) . And also road robbery is increasing in the city. So decided to go for a low price cell. I just turned towards Reliance offers. It was great, I got impressed, asked some ppl for the feedback about reliance and got positive response. I entered Reliance web world. After enquiring all the offers, I chose one and asked him to give the connection (Its with handset). He laughed at me and told give all documents. He asked me to provide local address proof which I don have. Came out with a hang on face. I badly needed a handset(To chat with someone 🙂 ). I was coming back to my bike, I saw Vivek’s(big electronics shop), without second thought I went inside asked for sony W700i, Purchased it in two mins. Ha ha ah. Finally I have it now.

Have a look at my cell.

gpd_31704_28_0_4000.jpg                                          gpd_40916_28_0_4000.png

Size
  • 100 x 46 x 20.5 mm
  • 3.9 x 1.8 x 0.8 inches
Weight
  • 99 g
  • 3.5 oz
Available colours  Titanium Gold
Screen
  • 262,144-colour TFT
  • 176×220 pixel
Memory
  • Memory Stick PRO Duo™ support
  • Phone memory 34MB*

*Actual free memory may vary due to phone pre-configuration

Networks
  • GSM 900
  • GSM 1800
  • GSM 1900
Performance Talk time:   Standby time:
GSM 1800 9 hours   400 hours
GSM 1900 9 hours   400 hours
 
   
             
             
             
 
         
 
         
 
         

Inference:

Now I have my own handset but I am not as much happy as the day I borrowed Nokia 7610 with my friend. I feel to have things when you really feel to own. when you feel that you need, get it. Dont delay.

Posted in personel, sony | 1 Comment »

Finally started to blog!!

Posted by karthikjcecs on August 21, 2007

I was wondered about why people blog? who will be interested in reading some others story? But now everything is clear. I am writing blog more for myself. Feeling to express a lot, very few people are accessible that too for very short duration. Blog is the solution. I am going to write whatever I feel. You may be thinking that why didnt I choose to write a diary. Well dairy is also good but I expect that some people read my thoughts. In blog I would be having a hope that people read this. I don know weather a single person reads or not but I have a hope.

Inspiration:

I finished my work that have assigned to me and got bored. Thought of reading blog of my previous mentor ( He is a very good writer). He has written so many interesting things. At the same time I have lots in my mind and no one to listen these ( sent some chat msgs, but all were busy). I questioned myself “hey why shouldnt I blog?” answer echoed from all directions “yes.. yes.. yes..” Ok I decided to write, what next? Have to chose a Blog host. I almost clicked on “sign up” in my mentor’s blog but didnt. I recalled what all prasanna had told me. He had analyzed many hosts and decided to go for wordpress. He had also told some drawback of other blog hosts which made sense to me also. I decided to go with his decision. Created the account, now writing my very first blog of my life.

I hope to continue writing.

comments are always welcome 🙂

Posted in personel | 7 Comments »