hmmm… (life, programming and everything)

Karthik goes to America ;-)

with one comment

Every software engineer (with a few exceptions) longs to vist the United States of America during his/her career. I had the chance of visiting the US to work for a short duration in my client’s place. I thought to pen down all that happened right from when I boarded the flight till I return back to India. But, I felt lazy to do so. So, I let the moments that I was here churn down for a week or so before I have enough to put it in paper (what we call blog in the internet days ;-) ).

It all started when I boarded a Lufthanza from Bangalore international airport. Before that I always used to think that the flight journey would always be one of the interesting parts of a US trip. Guess what, I was wrong.. at least not in Lufthanza’s zip code… and at least not in the economy class. It was terrible. The only thing that was close to being good was the food and frequent drinks. The seats were horrible. That’s exactly when I felt the value of KSRTC and SETC buses in which I made my frequent trips from Bangalore to Chennai. All flights usually halt at some place for around 3 to 5 hours before which the next trip happens. I guess, more than refuelling the planes, it’s the need to take rest (from that not-so-interesting flight seats) that would have brought in this halt :-) The halt at frankfurt was really refreshing. I read some books in that time over a cup of coffee. I thought having euros was a must to buy something in the airport. So, I went to the exchange counter and converted a $50 bill for the equivalent in euros. While leaving the airport, I read a board saying – “We accept cards and dollars too..” The journey from Frankfurt to Newark was not a percent better. Children crying, painful backs, no good movie on the TV and most of all not a window seat. Well, having a window seat doesn’t really help either but I thought it would be more fun to watch the clouds moving rather than watching a dumb movie ;-) To make things more horrible as if someone wanted me to understand the true value of KSRTC buses, the flight was re-routed to Boston as the weather (as the pilot said) was not too good for a safe landing. That led to a 2 hour stall in Boston airport. The two hour stay WAS INSIDE THE FLIGHT.

Before I knew when I slept, I was in Newark intl airport at 7:30 in the PM. That’s almost a 4 hour delay.

After the immigration, it was a long wait in the get-your-baggage place. It was close to 8:30 when I got my baggage and came out just to find another security check. By the time I was all set to go to the train station, it was close to 9. I took a intra-airport train to reach the Rail Station. Well, the process was all clean in the US. I already had a taste of it by the ease at which I could get a ticket to the Rail Station. Once there, I had to wait for quite some time before I the NJ Transit came. In this time, I called my colleagues who were supposed to pick me up from Trenton. It took nearly an hour or so before I reached Trenton. From there, it was a hour and a half long journey to the hotel room, but just that I was sitting on a much better cushioned Suzuki Forenza and with two people with whom I can at least start a conversation with ;-). That’s a lot better than the 16 hour journey on a Boeing 747. Sheez! The drive in the car was very relishing. All that people said about the US roads were actually true. It was clean and people follow rules like hell. From a guy who lived 22 years in India, it’s quite surprising as to how people patiently wait for the Red signal to turn to Green even if there is no one in the traffic junction.

I din’t have much energy to do anything interesting after I came to the hotel. It was quite interesting though to know that Americans don’t use tubelights. In all the places in the US that I have been uptil now, I can’t find one place which had a tubelight lit. It was a great relief for me to have a long nap in the nice well-cushioned king size bed. Next day was my first day to the US office. It was a nice morning drive to Malvern. I will reserve the rest for a later post (hopefully).

Written by karthik3186

August 10, 2009 at 4:10 am

Posted in Uncategorized

Virtual directory in JBoss/Tomcat

leave a comment »

[UPDATE]
The reason for the listing not showing JBoss 4.2.2 is due to the fact that ‘listing’ parameter in ‘jboss-web.deployer/conf/web.xml’ is ‘false’. Change it to ‘true’ so that the listing is shown.
[/UPDATE]

One of the projects that I am currently doing involves a huge bunch of htm, powerpoint and other image files that are independent of the application. The problem happens when you need to move the EAR from the test bed to the production machine. It takes a hell-lot of time to transport it. A nice alternative in such a case would be to configure virtual directories in your application server and put the index.html’s link in your app.

It’s a simple one line configuration in the tomcat’s server.xml file. In JBoss 4.0.4, this would be present under $JBOSS_HOME_DIR/server/default/deploy/jbossweb-tomcat55.sar.  The last folder will be jboss-web.deployer if it is JBoss 4.2.2 and above. Inside the tag “Host” add the following lines -

<Context path=”/virtual” docBase=”C:/physical_dir” />

This will let http://localhost/virtual to be mapped to the files under “C:\physical_dir”.

The funny thing is it doesn’t work as expected in JBoss 4.2.2 GA. I was struck for a long time to figure out how to make this work in JBoss 4.2.2. All the wiki’s and IRC channels I tried looking in had the same line shown above for JBoss 4.2.2 also. Strange! Frustrated, I tried the last option – “http://localhost/virtual/<filename>” and it worked “out of the blue”. I am not sure why this happenes in JBoss 4.2.2. Ideally it should show the files present in the directory that we are mapping it.

I will try updating this blog with the reason if I find it. Till then have fun!

Written by karthik3186

September 17, 2008 at 3:23 pm

Flatpress!

leave a comment »

Blogging have become ubiquitous in almost all IT industries and S7 Software is no exception. We do have a blog server in drupal, but it is so cluttered that people hardly blog. People like blogging, but not when the blog interface is horrible! Interesting and challenging work could be another reason why they might not want to waste time in blogging :-P. Recently, I signed up in 110mb.com for a free account. It’s the free and best way to start your first website before paying off to Lunarpages or any other Hosting service! No issues, works just like that! Bandwidth is also pretty decent. While exploring some of the free features on 110mb.com, I checked out the blog feature. Almost every blog required MySQL and 110mb charges for MySQL. But one among them, FlatPress, was really cool. It doesn’t require MySQL. It stores all authentication data and other such details in flat files. I immediately SSHed to our internal linux box that had a tomcat running on it and tried out FlatPress. It worked like charm. Now, all I have to do is to create a simple PHP script, which could ask for a name and create a blog for them by copying the files into the newly created folder.

Things were easy. I am gonna try out that php script and create a simple blog server. Will be publishing a small tutorial on that soon.

:-)

Written by karthik3186

June 10, 2008 at 1:05 pm

Posted in fun

Tagged with , ,

IRC – A quintessential of software engineering process..

leave a comment »

It was Ajay who actually introduced me to IRC world a couple of years back. We used to log into the #nipl channel. At that time, they gave us free linux space for hacking and stuff like that. At that time I din’t realize the importance of IRC. But I knew its a great place where you can get things clarified in a few mins rather than hunting around the WWW for the solution. I used to get lot of my problems solved in IRC. Later on, I used to be in #scheme, #python. Slowly, it became one of my toolbox. In an outsourcing company like S7 Software, where new projects keeps coming in, each in a different domain, IRC is really helpful. I was recently assigned to a Geospatial domain based project for a month and a half. I was basically asked to write a reader for a Geospatial terrain format. The format is considered to be a beast in the Geospatial domain and WWW had very little resources on that. But, there was a very famous open source package called GDAL which implements many Terrain formats in C++. Our team was asked to look into this. While browsing through the GDAL website I came across the IRC channel for GDAL (#gdal). I immediately looked into it. As the project proceeded, I used to log into #gdal, clarify a few of my doubts and get back to the project. It helped me a lot. Infact, without that it would have been very difficult.

Apart from clarifying the doubts, there is a huge potential of learning stuff and also helping others. There used to be tons of arguments going on in IRC channels. I go by the nick – complexity in IRC.

Happy IRC’ing.

:-)

Written by karthik3186

June 10, 2008 at 11:57 am

Posted in programming

Tagged with ,

Gitorious is Glorious!

leave a comment »

Sometime back, I saw srid moving his hacks into repo.or.cz. I tried the same, by pushing some of my hacks into repo, but failed miserably due to some errors in git for windows. Then I forget about the whole thing until srid had a gtalk status on gitorious. I tried that too, but again windows sucks when it comes to hacks! Microsoft just doesn’t get it! Lately, I installed Fedora on a VMWARE server. I planned to install git and try it out with gitorious. Today I did it and guess what? it worked! I moved my brainf**k to gitorious. The FAQ section of gitorious is actually enough for pushing your repo to gitorious. Just keep one thing in mind – don’t push before doing a commit, it won’t work.

:-)

Written by karthik3186

June 10, 2008 at 12:27 am

Posted in fun, programming

Tagged with

Open Source and the corporate world

leave a comment »

As a part of our “regular” TTT (Tech Talk Tuesdays) at S7, Chandra(our CTO) continued with his second session of licenses. In the first session we discussed about Copyrights, Patents and MIT and Apache licenses. In today’s session GPL and LGPL were the main targets of discussion. Open source can have great influence on the work the corporate world does, especially if developers are unaware of the licensing concepts and more specifically in outsourcing industries. For eg, the moment you take source code from a GPL’ed software and use it for some of your company projects, that project had to be thrown open which is definitely not what the client wants.

It’s more of an involuntary action that when we see some open source code, we try to get influenced by the design and unbeknowst to us, it gets copied to the client’s project. These can turn out to be very serious issue. Infact, companies like IBM conduct licensing sessions once in every 6 months.

Bottom line is – one has to be very carefull when looking into open sourced code especially GPL’ed ones.

:-)

Written by karthik3186

June 6, 2008 at 2:01 pm

Posted in thoughts

Tagged with

Implementing sizeof operator

leave a comment »

Everyone knows how to use a size of operator, but very few knows how to implement it correctly. This is a frequently asked question in interviews. The actual size of operator accepts both keyword, variables and class and struct instances, we will write two versions of size of with one accepting keywords and the other accepting variables, class and struct instances.

//Keywords

#define K_SIZE_OF(X) ( (X*)0 + 1 )

Basically, here you are trying to cast the 0th location in the memory to type X. If X is passed as int, the first four bytes will be interpreted as int and four will be returned. If it is X is a char, one will be returned and so on.

//Variables, class and struct instances

#define V_SIZE_OF(X) ( (&X+1) - (&X) )

Here, we are trying to move the address of the variable/instance by SIZE bytes and subtracting it from the current address which will actually give us SIZE back.

:-)

Written by karthik3186

June 6, 2008 at 2:00 pm

Posted in fun, programming

Tagged with ,

An inside look of orkut

with 5 comments

It had been almost an year and a half since I joined orkut. Let me show you some inside stuff on orkut and explain to you how it can save people from getting bored. Orkut is great! People do one thing constantly in orkut, that is, SCRAP! That five letter is everything for them. They will do anything and everything for getting more scraps. But if you look at it from another angle, its justified. Come on, there is atleast something that can save them from getting bored. The idea is simple but yet so elegantly powerful that one can hardly miss its inherent beauty. In orkut everything starts of with a scrap. A simple scrap to your friends like ‘hey! how are you ?’ cannot fetch you the happiness that you gain by solving a math problem, the joy that you realize when you crack a topcoder problem, but can fetch you something more than that – SCRAP!. Don’t worry even if you have seen him just a couple of hours back at office, or currently have him in your messenger list. Just send a scrap. After all you are sure to get his reply back (as another scrap) . The system works flawlessly because everyone wants more scraps and they know the only way to do this is to send more scraps. But still this has a lots of work to do. You have to go to your friends’ page, open his scrapbook and send him a scrap which is a pretty long process. But now things are much simpler – there are javascripts coming out, that can send scrap to all your friends. Now, isn’t it a great way of spamming, oops scrapping, on your friends spam book, oops scrap book. I don’t know why I am confusing spam with scrap. Anyway, let’s see one such scrap that was sent to me -

Orkut1

Now isn’t that great! As seen in the image, it is really really worth the time. After all how much time is it going to take. Isn’t it so much fun to search for images, then paste a cool geeeky javascript in your address bar and show your 200 odd friends what they mean to you by spamming them with images. Wow! Now I am moved! Here is another one.

Orkut2

If I put myself on the shoes of the person who sent this scrap to me, I could only think of this – “If he doesn’t like this scrap he’ll probably send me a return scrap scolding me for spamming his account(which is highly improbable) or he’ll send this scrap to all his friends! In either way my SCRAP COUNT increases! Muhahahah (evil laugh)!”.

Yet another feature of orkut is its ability to create communities. People create communities like they buy underwears. After all what better place than a community where a bunch of spammers can discuss how to spam one another efficiently. Don’t take me in the wrong sense. There are some really good ones but there are some really really bad ones too. Not only that, communities in orkut helps you become friends with other spammers. But things become a bit woozy when you have to let your friends know that you own a community and want them to join. This is where our geeky javascripts comes in handy. All you do is create a community, never mind if the community is active or dead. All you have to make sure is it has to be filled with spammers! Here is another screen shot of my scrapbook -

Orkut3

Since it is a jpg image, let me tell you that “click here” was flashing so badly that I involuntarily closed the window. Now let’s see what people are discussing in this community -

Orkut1

Don’t look for discussions, you won’t find them. Why ? Because they never happened! The community has been there for more than year and a half and yet no posts! Isn’t that great to realize how someone so pathetically sending spams to his friends to join the community that has been so active for the past 1.5 years that not even a single post has been posted! So what gives the hope? Simple, he is not the lone join-my-community-spammer.

By now you would have surely realized the power of orkut to save people from getting bored. Just follow the following mantra

  1. Never mind how busy you are, just send a scrap to your friends to let them know you are not dead and they mean so much to you.
  2. If you want to be impartial use the javascripts that are mentioned above. They are the key to your boredom-saver.
  3. Join as many communities as possible. Never mind if you understand russian or spanish. Don’t be a racist! There is only one religion in orkut – spammers!

Written by karthik3186

January 24, 2008 at 6:20 pm

Posted in thoughts

Tagged with ,

I have moved! :-)

with one comment

Many great people say change is the only constant thing. So here I am. I have lived with blogger for a long time and so venturing out. Keep seeing this page for more about life, programming and everything.

Written by karthik3186

January 23, 2008 at 10:13 am

Posted in Uncategorized

Tagged with