Author: Rajeshwaran SP

  • Converting Rows to Columns in SQL

    There was this table,

    ORG_ID     LEGACY_ORG_CODE
    ------      ------------------
    1001         8909
    1001         12323
    1002         80909
    1002         78798
    1002         09009

    and the requirement was to get the concatenated legacy_org_code like

    ORG_ID     LEGACY_ORG_CODE
    ------      ------------------
    1001         8909, 12323
    1002         80909, 78798, 09009

    The solution to this is:

    SELECT PL.ORG_ID,
    	(SELECT LEGACY_ORG_CODE + ','
    		FROM SGT_ORG_PLAN ORGPL
    		WHERE ORGPL.ORG_ID = PL.ORG_ID
    		ORDER BY LEGACY_ORG_CODE
    		FOR XML PATH(''))
    	 AS ORG_CODE
    FROM SGT_ORG_PLAN PL
    GROUP BY PL.ORG_ID

    I was looking for simple answers on the web I came across this link, that helped me to get it done in a simple SQL statement. Recording it here for future reference. This technique is called Blackbox XML.

  • New Look : Arjuna Theme

    One among the new year resolution is done. And on the same new year’s day. My site now has a new look. I have been wanting to do this for more than a year now, and I never pushed myself to sit and do it. What better time to do it, than in the vacation. And so, here is the new look for the site. I have decided to call the new theme “Arjuna”.

    Arjuna: means ‘white’, ‘clear’. It is a Sanskrit word, and the name of one of the Pandavas, in the Mahabharata.

    This theme is a white theme, minimal, and subtle in expression. Being my first side project, I was a bit confused in choosing a name. I chose this because, it was somehow connected to the ancient literature of my own country.

    Feel free to download, test and report any bugs that you encounter.

  • Uninstalling MySQL on Mac OS X

    Here are the steps to perform a clean un-install of MySQL from your Mac.

    Execute the following commands at the Terminal

    Uninstalling MySQL

    Open /etc/hostconfig file in a text editor and remove the following line

    MYSQLCOM=-YES-

    That’s all.

  • Happy New Year 2010

    Wish you all a very Happy New Year 2010. Let this year bring prosperity and joy to all.

    This is the time to reflect back on what happened the previous year, and plan for the coming year.

    What happened in 2009?

    • Completed my one year in Sagitec.
    • Had been continuously writing on this blog.
    • Got my first ever proposal.
    • Accepted her as my better half.
    • Got my first onsite offer, to work in America.
    • Came to USA on a H1B permit and currently working.

    Wishes for 2010:

    • Get happily settled in life.
    • Get a new look for this site.
    • Get CowsNBulls game to the next level.
    • Learn a new language apart from C#, looking at python and ruby.
    • Live happily ever after.

    Once again, wish you all a very happy and a prosperous new year.

    • iPod Shuffle

      I was surprised the day before yesterday to see a FedEx door tag hanging on my apartment door. I had not ordered anything, or I could not think of someone who would spend money to send me a FedEx parcel as gift.

      I just left it signed on my door yesterday, so that the FedEx person could leave it at the door. When I came back for lunch, yesterday, I met the FedEx guy who gave me a small parcel.

      Viola! it contained a 2 GB iPod Shuffle. It was gifted by Sagitec, my employer as a Christmas gift.

      Thank You Sagitec.

    • Surabhi

      I was browsing the internet as usual. But unusually, I was searching for A R Rahman videos on YouTube. That is when I spotted this video.

      A R Rahman in Surabhi

      Surabhi, if anyone of you would remember used to be aired in Doodarshan (DD1). I still remember that period, when cable TV was not known commonly in India. My full family used to watch them. We never understood or knew Hindi. But we just watched them.

      Krishna, Chandrakantha.. I am remembering these serials as I type it in. Wonderful days. We used to discuss in school, about it. We used to be discussing about Kurur Singh and his “Yakkooo..”

      In this video, that should have been taken by 1992, after Roja release, I am wondering about what he says. Hear Sridhar say, about his sound technique, “Theatrical”.. he says. Rahman wanted not the base sound of the flute but the air from it… And then the song plays… Wow, really A R Rahman… is a genius.

    • Haircut

      I had my first haircut in America yesterday. @Virginia Hair.

      One hair cut costs $35.00 equivalent to roughly Rs. 1750. That is a huge sum of money. In India, I used to have haircut for Rs. 20.00. The maximum that I used to spend was Rs. 500 equivalent to $10.00.

      So the lesson is, earn your money in America, spend it in India.

    • Spoilt Indian

      In India, in most households, parents take care of all the things for the children. Food, clothing and whatever. I am one among those spoilt Indian kids.

      We are spoilt totally, that we cannot take care of ourselves. At least, I was never into the kitchen to cook food, till I was in India. I have never washed dishes, rooms, etc. Everything my mother used to take care.

      I would help her with talking her to the shop on my bike. But it was she who would do all the shopping. I have never wished to learn how to shop for groceries, vegetables, etc. I think that is the case with any kid who grew up in towns of India. In the villages, kids are to an extent independent. This I can say, as I see a lot of my friends from the villages, know quiet a lot than me.

      When I was left alone, that is when I realized, the world is too big. Getting things together, cleaning, washing, cooking, making the bed, everything seemed to be an area of study for itself.

      I am turning independent. It has its own thrill.

    • Free Software

      I am writing this post using WriteRoom, one super working space on my new laptop Macbook Pro.  I got this one as one major purchase after I landed in US.

      I gave up my only companion the PC, to which I have been faithful since my beginning days in computers for a new Mac. Why did I take the decision? I still use Microsoft’s own Visual Studio in office for my development activities. So half of my time, I am on a PC and the remaining time I am on Mac. They both are a different culture. Everything about Mac, at least my first feel of Mac is it is beautiful.

      Design – It is Apple’s forte. It has that good finish, wonderful, artistic and everything about it. That is what captured me to it. Being a designer myself, I wanted to own it, and it just happened that I did it in the home of software development.

      I have no regrets with Windows or Linux, the two other operating systems I have used fairly so far. The first software that I have licensed, other than the OS is TextMate. It was a worthy buy. So I have bought a license for it. It feels good to own and work on licensed software. I feel as if I own it. I feel that I respect the work that goes into the making of it. I love open source and free softwares. If there is some great work going on, and you can provide your own contributions to it, yes pay them. It is not for the software, but the people behind it.

      In India, we use pirated software all the time. Piracy is nothing. Everyone has a copy of Windows, Office running on their machines. The cost of software in Indian currency is much higher compared to the US counterparts. People don’t like to pay for just a CD. We are used to the belief that if you pay more, you get more. For something as big as Rs. 13,000/- a CD doesn’t suffice, we look for something more bigger. We are used to thinking that way, just like grocery and furniture shopping.

      Since, everyone is used to using Windows, no one wants to move from the comfort zone offered by it and embrace free software. There has to be paradigm shift, if people should start buying software.

      How can that be achieved. It won’t/can’t happen immediately. Schools should start using Linux and open source softwares. Students must be encouraged to read code, tweak existing programs so that they get what they want. They must get that idea, the machine does only what they want it to do, rather than stand amazed at seeing the computer working. After all it is what it is programmed for. Then as they grow up, they will start appreciating software and by the time, they get their own computers, they get to choose what they want. They can buy a Windows or a Mac, or write their own operating systems.

      Lets make this happen!

      After all, it is necessity that is the mother of all inventions.

    • Survival of the Fittest

      This is going to be a musing… A rant, a self confession, a analysis.

      WARNING: Boring rant ahead.

      I have never been to the kitchen at home, in neyveli, or in chennai. I was just as worried, when my company offered me a H1B visa and wanted me to work from the client’s location. I am a foodie. I can’t live without tasting the great Rice for at least one meal a day.  But things have changed quiet a lot now. I am cooking my own food here. What has changed?

      Is it love? Might me. My girl helped me pack all the luggage for me. She got me two good books on cooking. She wanted me to help myself so that I don’t miss home food. She packed up everything I would require. It was very nice of her to do it. Also my mom did the final touch ups. It must be that I am in love and I end up doing something to please her?

      Survival? I am reminded of the film ‘Puthupettai’. There are two songs ‘Oru naalil valkai’ and ‘Nerupu vaiyinil oramai’, two of my all time favourite songs. The theme of the film is ‘Survival’.  When you are pushed to the limits, you tend to fight back, face the reality, tend to move forward. The simple ‘Darwin’s principle for evolution’. Not perpetuation, or theory of natural selection, I am not going scientific here. It is just the ‘Survival of the fittest’.

      Just analyzing on the same subject, we tend to perform or succumb when we are pushed to the limits. The is a comedy in a film that I watched recently, where the comedian says ‘I am cornered’. This has nothing to do with this post. Is it survival or love or desire or just a new learning? Questions unanswered.

      Hey why am I ranting. Actually cooking is good. So why this post at all in the first place. I have time to kill!