Tuesday, September 22, 2015

Venice the sinking city

Wednesday, September 16, 2015

My first day to work at XYZ


It was my first day to work. This is going to be my second job since I have given away my first one with all the good things heard about the new company.

According to the contract given, my work should start by 8 am, so I decided to be before time. Our HR already taken my vehicle number and assign me a parking slot. She already mailed me the details so there is no hassle for me to find a park on first day in unknown territory.

I came to office by 7.50. Amazingly our HR and System Administrator waiting for me at front door. HR gave me my company ID first place since she has taken my photograph earlier. She show me my seat and there is a nice welcome pack waiting at my desk for me including company hand book, company pen, note book, cap and a T shirt. How she came to know my T size?

Then it came the sys admin to me with a booklet with all the details that I should know. It got my machine username/password and cooperate username/password and steps to change them if I want. They got single sign-in for all the systems with intranet to manage all the domain links. What a relief for me as I had to remember more than five username/passwords in my previous place.

I logged in to my machine and open the new email. Amazing..., our HR has already send me a welcome mail with all my details and some of my new colleagues already greeted me through mail. I was amazed to see that even my new PM has send me a greeting mail with description of my new assignment. He has stated the steps to download even code and all the access were already available. How much they have believe on me....

Few minutes later my buddy came to me. Wow, I got a buddy too and I heard that he is going to give me a company sponsored lunch at the end of my probation period. He introduce all the people to me, show me the lunch area and wash rooms too. He teach me all the rules and regulations of the company including procedures of laving last to order a cab to use of company booked swimming pool.

Ohh, they have prepare a surprise treat for me too at 10 am. What a warm welcome and what a first day...

Vidula Hasaranga
http://vidula-sinhala.blogspot.com
http://vidulahasaranga.blogspot.com

Monday, September 07, 2015

Resolving ORA-01882: timezone region not found



Recently I have changed my oracle jar version in Tomcat lib to ojdbc6-11.2.0.4.jar and started to see following error while starting tomcat.

java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region  not found

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)
at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:675)
at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:448)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:383)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:776)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:432)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)

I have got same issue sometime back with my sqldeveloper, and fixed by adding some java options to its property file, so this time I tried the same in catalina.sh:

export JAVA_OPTS="$JAVA_OPTS -Duser.timezone=+05:30 "

Restart tomcat and the error log is no more.

Monday, June 11, 2012

How to reverse a String using Stack / Queue

Reversing a string / word / name is very common interview question to see how the candidate studied his data structures. This involves the knowledge of Stacks and Queues.

How to reverse using a Stack.


This is straight forward if you know how a stack is working. Stack is working as a First In Last Out (FILO) data structure. So what you have to do is put letters from beginning to end in to the stack and pop one by one and write in popping order. Lets see an example for word HELP.

Pushing to the stack:

HELP

+---+---+---+---+---+
|   |   |   |   |   |
+---+---+---+---+---+

ELP

+---+---+---+---+---+
| H |   |   |   |   |
+---+---+---+---+---+

LP

+---+---+---+---+---+
| E | H |   |   |   |
+---+---+---+---+---+

P

+---+---+---+---+---+
| L | E | H |   |   |
+---+---+---+---+---+


+---+---+---+---+---+
| P | L | E | H |   |
+---+---+---+---+---+

Popping from stack:

P

+---+---+---+---+---+
| L | E | H |   |   |
+---+---+---+---+---+

PL

+---+---+---+---+---+
| E | H |   |   |   |
+---+---+---+---+---+

PLE

+---+---+---+---+---+
| H |   |   |   |   |
+---+---+---+---+---+

PLEH

+---+---+---+---+---+
|   |   |   |   |   |
+---+---+---+---+---+

Here we go: HELP --> PLEH

How to reverse using a Queue.
This is not that straight forward as we did using a Stack. But if you know how to do it using a stack, and how to implement a stack using queues you are done with this.

Implementation of a stack can be done using 2 queues. Lets see the above example using 2 queues.


HELP

+---+---+---+---+---+
|   |   |   |   |   |
+---+---+---+---+---+

+---+---+---+---+---+   +---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+   +---+---+---+---+---+

ELP

+---+---+---+---+---+
| H |   |   |   |   |
+---+---+---+---+---+
Put H to first queue.
+---+---+---+---+---+   +---+---+---+---+---+
| H |   |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+   +---+---+---+---+---+

LP

+---+---+---+---+---+
| E | H |   |   |   |
+---+---+---+---+---+
Dequeue values from first queue and put them to second queue. Put E to the same.
+---+---+---+---+---+   +---+---+---+---+---+
|   |   |   |   |   |   | E | H |   |   |   |
+---+---+---+---+---+   +---+---+---+---+---+

P

+---+---+---+---+---+
| L | E | H |   |   |
+---+---+---+---+---+

Dequeue values from second queue and put them to first. Put L to the same.
+---+---+---+---+---+   +---+---+---+---+---+
| L | E | H |   |   |   |   |   |   |   |   |
+---+---+---+---+---+   +---+---+---+---+---+


+---+---+---+---+---+
| P | L | E | H |   |
+---+---+---+---+---+

+---+---+---+---+---+   +---+---+---+---+---+
|   |   |   |   |   |   | P | L | E | H |   |
+---+---+---+---+---+   +---+---+---+---+---+
Same way you can dequeue by swapping the queues to implement pop method of the stack.


Vidula Hasaranga
http://vidula-sinhala.blogspot.com
http://vidulahasaranga.blogspot.com

Sunday, January 01, 2012

Happy New Year.....

  /""/_/""/
 /         /
/_/""/_/appy

    /""\   /""/
  /  /\  \/  /
/_/    \_/ew

 \""\/""/
   \   /
  /  /
/_/ear

/"""""\
|  |""|  |
     /  /
    /  /
  /  /
 |    """|012
  """"""

Vidula Hasaranga
http://vidula-sinhala.blogspot.com
http://vidulahasaranga.blogspot.com

Tuesday, December 13, 2011

HOW LONG DOES IT TAKE TO DECOMPOSE

This is something I received as an email and thought to share with you all.....


Paper Towel - 2-4 weeks
Banana Peel - 3-4 weeks
Paper Bag - 1 month
Newspaper - 1.5 months
Apple Core - 2 months
Cardboard - 2 months
Cotton Glove - 3 months
Orange peels - 6 months
Plywood - 1-3 years
Wool Sock - 1-5 years
Milk Cartons - 5 years
Cigarette Butts - 10-12 years
Leather shoes - 25-40 years
Tinned Steel Can - 50 years
Foamed Plastic Cups - 50 years
Rubber-Boot Sole - 50-80 years
Plastic containers - 50-80 years
Aluminum Can - 200-500 years
Plastic Bottles - 450 years
Disposable Diapers - 550 years
Monofilament Fishing Line - 600 years
Plastic Bags - 200-1000 years
Glass - 1-2 million years


So think before you throw things away.....

Vidula Hasaranga
http://vidula-sinhala.blogspot.com
http://vidulahasaranga.blogspot.com

Monday, July 18, 2011

Accommodation at Trincomalee / Nilaveli



I was at Trincomalee last long weekend with my family members. Before that I done some R & D on places to stay at Trinco and here are the places I found with contact details and prices for some cases.


Welcombe Hotel - 026-2222373
FB - 11000
HB - 9200


Lotus Park Hotel - 026-2225327/8
FB - 11375
HB - 9975

Nilaveli garden Inn - 026-2232228

Green Park Beach Hotel - 026-2222369
FB - 7850
HB - 6600
RO - 4375

Medway Hotel - 0262227655

Sea View Hotel - Nilaveli - 026-4920016 / 026-4915224
RO - 3300 (Double room)
Family Room available for 8800 that can accommodate 8.

Hotel New Sea Lord - 026-2222396
FB - 4400
HB - 2200

New Silver Star Hotel - 026-2222348

Harbour View Guest House - 026-2222284
RO - 4500

Villa Guest house - 026-2222284

Palm Beach resort - 026-2221250
RO - 2500

Sarvodaya - 011-2647159

I stayed at Sea View Hotel in Nilaveli. Small place in front of the Nilaveli main beach. Bit expensive when compare with the facilities, but very good place to see the sun raise.

Normally rooms at Nilaveli are expensive than in Trincomalee. Its due to name and also as they close to the sea. You can get good A/C room for 2500 from Trico as I heard.


Vidula Hasaranga - à·€ිදුà¶½ හසරංà¶œ
http://vidula-sinhala.blogspot.com
http://vidulahasaranga.blogspot.com

Friday, December 31, 2010

Sunset at Hikkaduwa

sunset at hikkaduwa

sunset at hikkaduwa

The most beautiful scene you can see at western beaches of Sri Lanka is the Sun set. With the colors of the heaven its unforgettable scenery to all of us.

This is at Hikkaduwa beach, one of the most popular tourist destinations in Sri Lanka, infront of the Amaya Reef hotel.

Wednesday, December 29, 2010

Morning at Pasikuda


Morning, originally uploaded by vidulahasaranga.

One of the best scenes you can see at Pasikuda in the early morning is returning fishermen after their night work. With the colorful background of raising sun, this become a scene from heaven.

Pasikuda is one of the best beaches Sri Lanka have in eastern coast. One of the places you have to visit at Sri Lanka if you are a sea lover. In this calm beach you can stay whole day with blessing sun shine and low sea waves.

You can refer my older blog post about Pasikuda from here.

Vidula Hasaranga
http://vidula-sinhala.blogspot.com
http://vidulahasaranga.blogspot.com

Wednesday, December 22, 2010

Bubbles


Bubbles, originally uploaded by vidulahasaranga.

We always love to play with bubbles when we were small.

This picture was taken at Pasikuda, Sri Lanka while I am travelling in a motor boat. Motor of the boat produce huge force to pull the water backward and it make lot of water bubbles to remind me my child age. Not easy to capture this image as the boat is travelling very fast and shacking with the sea tides.



Vidula Hasaranga
http://vidula-sinhala.blogspot.com
http://vidulahasaranga.blogspot.com

Saturday, December 11, 2010

Dawning at Pasikuda


Morning reflection, originally uploaded by vidulahasaranga.

Pasikuda is developing now after the 30 years of war. It is one of the best beaches you can find in eastern coast of Sri Lanka. It is a place you can see the dawning of the Sun in very beautiful manner. This photo was taken few months back when I was at Pasikuda with few of my office mates. This is really beautiful scene and we were blessed to be there at early morning.

If you can leave Colombo at around 10 pm you can be at Pasikuda at early morning to see this beautiful scene. Else you have to stay one of few guest houses at Pasikuda.



Vidula Hasaranga
http://vidula-sinhala.blogspot.com
http://vidulahasaranga.blogspot.com

Tuesday, December 07, 2010

How this can happen...???


Set of images I received recently and thought to share it with you all..... Most of the situations are unbelievable. This reminds me the story of goat who put his head in to a pot (Its Sinhala - Sri Lankan folk story).


Vidula Hasaranga
http://vidula-sinhala.blogspot.com
http://vidulahasaranga.blogspot.com
Share/Bookmark