Wednesday, September 21, 2011

Extract file name from absolute path in Excel


Following formula can be used to get only file name from absolute path in Excel

=RIGHT(A1,LEN(A1)-FIND("~",SUBSTITUTE(A1,"\","~",LEN(A1)-LEN(SUBSTITUTE(A1,"\","")))))

Example

if A1=C:\Vijayan\Dev\qbn\m2\repository\org\apache\ws\security\wss4j\1.5.8\wss4j-1.5.8.jar
then result will be wss4j-1.5.8.jar

Friday, July 22, 2011

Wedding and Divorce

When I got home that night as my wife served dinner, I held her hand and said, I've got something to tell you. She sat down and ate quietly. Again I observed the hurt in her eyes.

Suddenly I didn't know how to open my mouth. But I had to let her know what I was thinking. I want a divorce. I raised the topic calmly.

She didn't seem to be annoyed by my words, instead she asked me softly, why?

I avoided her question. This made her angry. She threw away the chopsticks and shouted at me, you are not a man! That night, we didn't talk to each other. She was weeping. I knew she wanted to find out what had happened to our marriage. But I could hardly give her a satisfactory answer; she had lost my heart to Jane. I didn't love her anymore. I just pitied her!

With a deep sense of guilt, I drafted a divorce agreement which stated that she could own our house, our car, and 30% stake of my company.

She glanced at it and then tore it into pieces. The woman who had spent ten years of her life with me had become a stranger. I felt sorry for her wasted time, resources and energy but I could not take back what I had said for I loved Jane so dearly. Finally she cried loudly in front of me, which was what I had expected to see. To me her cry was actually a kind of release. The idea of divorce which had obsessed me for several weeks seemed to be firmer and clearer now.

The next day, I came back home very late and found her writing something at the table. I didn't have supper but went straight to sleep and fell asleep very fast because I was tired after an eventful day with Jane.

When I woke up, she was still there at the table writing. I just did not care so I turned over and was asleep again.

In the morning she presented her divorce conditions: she didn't want anything from me, but needed a month's notice before the divorce. She requested that in that one month we both struggle to live as normal a life as possible. Her reasons were simple: our son had his exams in a month's time and she didn't want to disrupt him with our broken marriage.

This was agreeable to me. But she had something more, she asked me to recall how I had carried her into out bridal room on our wedding day.

She requested that every day for the month's duration I carry her out of our bedroom to the front door ever morning. I thought she was going crazy. Just to make our last days together bearable I accepted her odd request.

I told Jane about my wife's divorce conditions. . She laughed loudly and thought it was absurd. No matter what tricks she applies, she has to face the divorce, she said scornfully.

My wife and I hadn't had any body contact since my divorce intention was explicitly expressed. So when I carried her out on the first day, we both appeared clumsy. Our son clapped behind us, daddy is holding mommy in his arms. His words brought me a sense of pain. From the bedroom to the sitting room, then to the door, I walked over ten meters with her in my arms. She closed her eyes and said softly; don't tell our son about the divorce. I nodded, feeling somewhat upset. I put her down outsidethe door. She went to wait for the bus to work. I drove alone to the office.

On the second day, both of us acted much more easily. She leaned on my chest. I could smell the fragrance of her blouse. I realized that I hadn't looked at this woman carefully for a long time. I realized she was not young any more. There were fine wrinkles on her face, her hair was graying! Our marriage had taken its toll on her. For a minute I wondered what I had done to her.

On the fourth day, when I lifted her up, I felt a sense of intimacy returning. This was the woman who had given ten years of her life to me.

On the fifth and sixth day, I realized that our sense of intimacy was growing again. I didn't tell Jane about this. It became easier to carry her as the month slipped by. Perhaps the everyday workout made me stronger.

She was choosing what to wear one morning. She tried on quite a few dresses but could not find a suitable one. Then she sighed, all my dresses have grown bigger. I suddenly realized that she had grown so thin, that was the reason why I could carry her more easily.

Suddenly it hit me... she had buried so much pain and bitterness in her heart. Subconsciously I reached out and touched her head.

Our son came in at the moment and said, Dad, it's time to carry mom out. To him, seeing his father carrying his mother out had become an essential part of his life. My wife gestured to our son to come closer and hugged him tightly. I turned my face away because I was afraid I might change my mind at this last minute. I then held her in my arms, walking from the bedroom, through the sitting room, to the hallway. Her hand surrounded my neck softly and naturally. I held her body tightly; it was just like our wedding day.

But her much lighter weight made me sad. On the last day, when I held her in my arms I could hardly move a step. Our son had gone to school. I held her tightly and said, I hadn't noticed that our life lacked intimacy.

I drove to office.... jumped out of the car swiftly without locking the door. I was afraid any delay would make me change my mind...I walked upstairs. Jane opened the door and I said to her, Sorry, Jane, I do not want the divorce anymore.

She looked at me, astonished, and then touched my forehead. Do you have a fever? She said. I moved her hand off my head. Sorry, Jane, I said, I won't divorce. My marriage life was boring probably because she and I didn't value the details of our lives, not because we didn't love each other anymore. Now I realize that since I carried her into my home on our wedding day I am supposed to hold her until death do us apart.

Jane seemed to suddenly wake up. She gave me a loud slap and then slammed the door and burst into tears. I walked downstairs and drove away.

At the floral shop on the way, I ordered a bouquet of flowers for my wife. The salesgirl asked me what to write on the card. I smiled and wrote, I'll carry you out every morning until death do us apart.

That evening I arrived home, flowers in my hands, a smile on my face, I run up stairs, only to find my wife in the bed - dead.

My wife had been fighting CANCER for months and I was so busy with Jane to even notice. She knew that she would die soon and she wanted to save me from the whatever negative reaction from our son, in case we push thru with the divorce.-- At least, in the eyes of our son--- I'm a loving husband....

The small details of your lives are what really matter in a relationship. It is not the mansion, the car, property, the money in the bank. These create an environment conducive for happiness but cannot give happiness in themselves. So find time to be your spouse's friend and do those little things for each other that build intimacy. Do have a real happy marriage!

If you don't share this, nothing will happen to you.

If you do, you just might save a marriage.

Many of life's failures are people who did not realize how close they were to success when they gave up

Thursday, June 30, 2011

அன்பு என்றால் அம்மா, அதற்கும் மேல் நீ!!!

உன்னால் மட்டும்
எப்படி முடிகிறது
என் அசைவுகள் முதல்
அனிச்சைகள் வரை
அனைத்தையும்
அறிந்திருக்க?

ஒருவேளை
என் நியூரான்கள்
நீ நினைப்பதை மட்டுமே
எடுத்து செல்கின்றனவா?

என் தமனி முழுதும்
உன் எலக்ட்ரான் முத்தமே
குருதியாய் பாய்கிறதா?

என் உயிர்க்கான
மென்பொருள்
உன் காந்த பார்வையில்
பிழையாய் நிற்கிறதா?

இவை அனைத்துக்கும்
பதில் தெரியாமல்
எத்தனையோமுறை
யோசித்திருக்கிறேன்...

ஆனால் ஒன்று மட்டும்
சொல்வேன் ...

எனக்கு
அன்பு என்றால்
அது அம்மா...

அதற்கும் மேல்
என்றால்
அது நீ...

இனிய பிறந்தநாள் வாழ்த்துக்கள்!!!

அன்புடன்,
விஜயன் சீனிவாசன்

Sunday, May 29, 2011

Learn from Architectures of Other Systems

Here’s a good book (online for free) that discusses architectures of existing successful open source software for us to learn from this link

Courtesy: Saurabh Jain

Thursday, April 07, 2011

Rails 2.3.5 with MySQL 5.5.10

Mac Detail:

banl09d5acb54:clerk vsrinivasan$ uname -a
Darwin banl09d5acb54.local 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386

MySQL:

Install mysql-5.5.10-osx10.6-x86_64.dmg

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -v 2.7 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle

Other Gems:

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
daemons (1.1.0)
linecache (0.43)
mocha (0.9.12)
mysql (2.7)
rack (1.0.1)
rails (2.3.5)
rake (0.8.3)
rcov (0.9.9)
rmagick (2.13.1)
ruby-debug-base (0.10.5.jb2)
ruby-debug-ide (0.4.17.beta3)
rubygems-update (1.3.6)
stomp (1.1.6)
will_paginate (2.3.15)

Uninstall MySQL from Mac

Step1:

edit /etc/hostconfig and remove the line MYSQLCOM=-YES-

Step2:

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm /etc/my.cnf
sudo rm -rf /var/db/receipts/com.mysql.mysql*

Friday, March 11, 2011

விமர்சிக்கும் உலகம் இது!!!

பட்டினத்தார் எத்தனை பெரிய துறவி? கோடிக்கணக்கான சொத்தை அப்படியே விட்டுவிட்டுக் கோவணத்துடன் வெளியேறிய கடுந்துறவி. சோற்றாசை கூட இல்லாத சந்யாஸி.கையில் ஓடு வைத்திருந்த பத்திரிகிரியாரைத் சொத்து வைத்திருக்கும் குடும்பஸ்தன் என்று கிண்டலடித்த அப்பழுக்கற்ற துறவி. அவரையே உலகம் என்ன பாடுபடுத்தியது தெரியுமா?

நடந்த களைப்பால் வயலில் படுத்திருந்தார் பட்டினத்தார். அறுவடை நடந்திருந்த வயல் அது. குச்சி குச்சியாய்ப் பூமியில் இருந்து கிளம்பி அறுபடாதிருந்த வைக்கோல் அவர் உடம்பில் குத்திக் கொண்டிருந்தது. அதைச் சட்டை செய்யாமல் (சட்டை இல்லாமல்) படுத்துக் கிடந்தார். இருக்கும் போதே இறந்து போன மாதிரி இருந்தார்.

அந்த வழியாகப் போன இரண்டு பெண்கள் வரப்பு வழியாக நடந்து போக முடியாதபடி பட்டினத்தார் வரப்பு மீது தலைவைத்துப் படுத்திருந்தார். ஒரு பெண்மணி, “யாரோ மகானா!” என்று அவரை வணங்கி வரப்பிலிருந்து இறங்கி நடந்தார். மற்றொரு பெண்மணியோ, “ஆமாம்… ஆமாம்… இவரு பெரிய சாமியாராக்கும்… தலையணை வைச்சுத் தூங்கறான் பாரு… ஆசை பிடிச்சவன்” என்று கடுஞ்சொல் வீசினார்.

அவர்கள் அங்கிருந்து போனதும் எழுந்து உட்கார்ந்த பட்டினத்தார், “ஆஹா… நமக்கு இந்த அறிவு இது நாள் வரை இல்லையே” என்று வருந்தி வரப்பிலிருந்து தலையைக் கீழே வைத்துப் படுத்தார்.

சற்று நேரத்தில் அந்த இரண்டு பெண்களும் அதே வழியாகத் திரும்பி வந்தனர். வரப்பிலிருந்து தலையை இறக்கிக் கீழே வைத்திருந்த பட்டினத்தாரைப் பார்த்து முதல் பெண் பரிதாபப்பட்டு, “பார்த்தாயா… நீ சொன்னதைக் கேட்டு உடனே கீழே இறங்கிப் படுத்துட்டாரூ… இப்பவாவது ஒத்துக்கோ… இவரு மகான்தானே…! என்றார். அந்த பெண்மணியோ, தனக்கே உரித்த பாணியில் “அடி போடி… இவனெல்லாம் ஒரு சாமியாரா?

தன்னைப் பத்தி யார் யாரு என்ன என்ன பேசுறாங்கன்னு ஒட்டுக் கேட்கிறான்… அதைப் பத்திக் கவலைப்படறான். இவனெல்லாம் ஒரு சாமியாரா?” என்று ஒரு வெட்டு வெட்டினாள். பட்டினத்தாருக்குத் தலை சுற்றியது.

எப்படி இருந்தாலும் உலகம் நம்மை விமர்சிக்கும். இது பேருண்மை. தரமானவர்களின் தரமான விமர்சனத்தை மதிக்க வேண்டும். விமர்சிக்க வேண்டும் என்கிற வெறியுடன் விமர்சிக்கிறவர்கள் விமர்சனத்தைப் புறக்கணியுங்கள்!!!

Thursday, March 10, 2011

Access Application Context from JSP


<%

ApplicationContext context =
WebApplicationContextUtils.getWebApplicationContext(
pageContext.getServletContext());

MyBean myBean=(MyBean)context.getBean("myBeanId");

%>

Windows: Rails with MySQL Problem

After successfully installing the Ruby 1.8.7 and Rails 2.3.5, MySQL 2.8.1 x86-mingw32 gems

When we try to create a db using the following command

>> rake db:create

It throws the following error:

!!! The bundled mysql.rb driver has been removed from Rails 2.2.
Please install the mysql gem and try again: gem install mysql.
rake aborted!

126: The specified module could not be found.
- */1.8/gems/mysql-2.8.1-x86-mingw32/lib/1.8/mysql_api.so

(See full trace by running task with --trace)
Process finished with exit code 1

To solve that we need keep the libmySQL.dll file under RUBY_HOME/bin