Posts filed under 'English'
Java: Overriding Vs Hiding
Here is an interesting piece of code in Java. Say there are two classes, one extending another:
class A {
public static void sampleMethod1() {
System.out.println("In sampleMethod1:A");
}
public void sampleMethod2(){
System.out.println("In sampleMethod2:A");
}
}
class B extends A {
public static void sampleMethod1() {
System.out.println("In sampleMethod1:B");
}
public void sampleMethod2() {
System.out.println("In sampleMethod2:B");
}
}
What is the output of the following:
1. A a = new B();
a.sampleMethod1();
2. B b = new B();
((A)b).sampleMethod1();
3. A a = new B();
a.sampleMethod2();
4. B b = new B();
((A)b).sampleMethod2()
Interestingly, its not possible to invoke a method in the parent which is overridden in the child class, from a child class instance. Its a dependency on the runtime object type. At the same time, you can always invoke a static method hidden in the child class by type casting it or using an object reference of type its parent. Its a static binding at class level.
Add comment September 11, 2008
Downloading WSDL using JDeveloper 10g
If you are working on Web services and want to download a WSDL to your local system, here is a nice tool from JDeveloper 10g. If you don’t already have JDeveloper with you, download recent 10g version from here:
http://www.oracle.com/technology/software/products/jdev/htdocs/soft10131.html (Get the J2EE or Studio version). Run the below command:
java -jar wsa.jar -fetchWSDL -wsdl <WSDL_URL> -output <LOCAL_OUTPUT_DIR>
The wsa.jar will be under <JDev_INSTALL_DIR>/webservices/lib folder. This will download the WSDL including all referred XSDs, if any, to your local drive.
So why do you have to do this? First, this makes life easier when you create a client proxy or use the WSDL in orchestrating a business process or defining an Enterprise Service Bus (ESB). All these tools will have the capability to refer to the WSDL URL and corresponding schemas automatically even if they are not present in the local disk, but they make separate HTTP calls to access them each time, which makes the entire process too long. For example, if you try to create a JDev proxy referring to the WSDL present at your server, it can take up to 30 minutes, where as with a downloaded WSDL, it will be over within 5 minutes…
Add comment September 8, 2008
Wikipedia data and statistics
(I actually wanted to start a new blog with technical content, but dropped the idea and decided to use my telugu blog until I get this as a habit. I will move these posts into a separate blog once there is sufficient content..)
I’ve been working with Wikipedia data since a while and I thought I would share some of the tools and download points here.
Wikimedia has been kind enough to make the entire Wikipedia data to be available for research purposes. As the data in Wikipedia keeps on updating, a snapshot is saved and is available here:
http://download.wikipedia.org/ or
http://download.wikipedia.org/enwiki/ (for english wikipedia dumps)
Out of all available downloads, I would suggest XMLs if you want to work on the Wiki data. The static HTML dumps are huge in size, and are the output of the Mediawiki rendering engine for each page. These are useful only if you can’t use the PHP rendering engine provided by Mediawiki. The XMLs are nothing bug pages in Mediawiki format, so are pretty much less in size. When I downloaded, the static, compressed XML dump without images was around 3.7 GB. (For my work I didn’t need images at all).This can go upto 11GB if you unzip and load the data to a database (I used MySQL). I read in some research work that the total size after decompression with page history can go upto 700 GB.
Once you download the dump, the next step is to load it into your favorite database. I used a LAMP (Linux, Apache, MySQL, PHP) combination for this. I downloaded Mediawiki first (from http://www.mediawiki.org/wiki/Download) and installed on my system. The dump zip will contain one single file with huge size. So you need to be careful in using the file system to perform this (Win FAT32 doesn’t support files of size > 4GB). You can use tools like mwdumper or mwimport to do this. Detailed documentation is available here: http://meta.wikimedia.org/wiki/Importing_a_Wikipedia_database_dump_into_MediaWiki .
However, mwdumper did not work initially with English Wikipedia due to its huge size. So I had to use a different technique: I divided the bzip2 file into small chunks first (using bzip2recover) and then parsed each of them in sequence using a simple perl script. However, the script needs to identify the start and end of each page. Also, a page can span across multiple bzip2 files (though less likely), the script should be clever enough to handle such cases. Another way of dumping is to tweak mwdumper options (available in the above URL) to get the file loaded. You will most likely encounter issues first time, but everything is well documented in the Mediawiki site above.
One the database loading is done, you should install Mediawiki. This should be a simple step (Look at http://www.mediawiki.org/wiki/Installation). If your web server is Apache, copying the unzipped Mediawiki into the www folder and running http://<yourhost>:<port>/<Mediawiki_Folder_Name> should open a wizard that takes you through installation procedure.
The next step is to build indices. Go to maintenance folder in the Mediawiki installation and run buildall.php. This can take huge time, depending on your processor capacity. On an 8GB RAM computer, I left the process to run for around a week.
Wikipedia access data:
We were looking for access statistics for Wikipedia for our research purposes and found this:
This is an accurate hourly snapshot data on access to Wikipedia. It has data of the format <Language, Page, AccessCount>. However, we were looking for data in format <Page, Date&Time, IPAddress>. We wanted this because we wanted to identify user sessions on Wikipedia pages. This data, however is not being given out right now.
We also found a site that shows Wikipedia traffic status http://stats.grok.se/ while searching for the access data. this, however is a different view of what is shown in the above web site.
I will keep posted on our progress in this research area and try to keep my blog active..
Add comment September 7, 2008
The Enthralling Goa Experience!
During the last weekend and earlier this week, I happened to experience some of the most exciting moments of my life. I went for a 4-day long trip to Goa along with four of my colleagues.
The journey was planned three months before, though I wasn’t sure whether I’ll be able to join the bandwagon or not as my midsem exams were scheduled at the same time. Fortunately, my ANN professor was kind enough to cancel the exam so that I could get enough time to plan and join my friends..
There were finally 4 people who confirmed their travel apart from me: Giridhar, Sachin, Manohar and Rajesh, all of them my colleagues.
The forward journey was planned in Train. We took the Kacheguda-VascoDaGama train on Friday 21st, which started at 9:30pm at Kacheguda station. The train didn’t have any dinner facility, so we had to finish our dinner at the station itself and board. The train went via Mahabubnagar and Kurnool. It was a link train, in the sense that only 3 bogies were destined to Goa, and they were attached to the Yaswanthpur Express which goes to Bangalore. These bogies were detached at Guntakal Juntion and attached to Amaravathi Express, which comes from Howrah. So, there was some delay in the whole process of attaching-detaching, but fortunately we were sleeping at that time. Me, Manohar and Sachin woke up at around 7am and we reached Dharwar Junction. We finished our breakfast with some Dosas and Idlies, while the other two also woke up and prepared. The train stopped at another junction at aroud 11:30 am, which was almost at the end of Karnataka. The journey was really beautiful from there. The route was a single line and took us through the jungles and small villages spread through the Western ghats. The view was lovely with different kinds of plants and trees. Me and Giridhar went to the bogie door and started taking photographs. As time passed by, the route became more beautiful, and the train started going through many tunnels. Each time the train passed through a tunnel, people started shouting. We reached a station called CaranZol where the train took halt for around 10 minutes. We got down, took photos in all possible angles with all possible backgrounds. Later in the afternoon, we reached a station called Castle Rock, which is at the beginning of Goa state. Now we started seeing more number of valleys and waterfalls and tunnels. We were fortunate to see the Dudh Sagar waterfalls, which were falling from the pinnacle of a tall mountain, and a small bridge was built over it on which our train passed by. We took pretty good number of photos of these water falls and after some more small stations, we finally reached the Margao station at around 5pm.
The Caranzol station
Unlike many places in India, Goa is filled with foreigners and we were able to see many of them in all places. We took an auto for 180/- to Colva Residcncy, where we booked our stay for the first 2 days (Saturday afternoon to Monday afternoon). It was ~5km from the station. It was maintained by the Goa Tourism Development Corporation and was a nice place. We took two double rooms and one extra bed. The room was situated very near to the beach and there was a view of the Sea from the balcony. We went to the beach, roamed around for some time and came back after sunset. The beach looked good, but I didn’t feel anything great about it, because I have been to beaches too many times, primarily due to my native place being placed in the Godavari Delta, very near to the Bay of Bengal.
Early next day morning (Sunday), we had the complimentary breakfast and went out to the beach. Here came the first excitement of the trip. There were some good water sports available at the beach. We took the Water Scooter, Banana ride and Dolphin view as a combined package for 1750/-. Water Scooter was pretty good. In Banana ride, 5 people at a time will be taken into the sea and the boat will be tilted upside down leaving all five floating! They then need to swim and take the boat back. This was scary initially but was very exciting. We were tempted to take another banana ride and enjoyed it..
. Dolphin view was the worst of all… we were taken in a motor boat into the Sea and he just showed some Dolphins swimming far away. After the rides, we took some refreshments and walked along the beach for some time. We saw many beach restaurants offering varieties of Sea food and liquor. We came back, had lunch and took some rest in the rooms. We started again in the evening to walk towards south. We touched many western styled bar cum restaurants and foreigners, to finally stop at Benoulin beach. We sat there and enjoyed the full moon for some time. This time, we wanted to come back in an auto or bus. But it was already night, around 8:30pm. We then came to know that all bus services will stop before 8pm, though that was unexpected for a tourist place like Goa. We had to hire one auto and a two wheeler. Both took 50/- for a distance of less than 3 km, which gave me an idea on why Goa’s per person income is two and half times more than India’s average figure! We took dinner at the Little Goa restaurant, part of the Colva residency. It seems the Goan restaurants have a tradition of having a music concert kind of thing during dinner. The singers sang some good songs, with not so good voices, for which some enthusiastic or drunk people started dancing. That dinner was our first lesson that we should _never_ order a rice item in any Goan restaurants. The biryanis were pathetic, especially for Hyderabadis like us. We tried to sleep after dinner, but could do that only after the singers took “alvidaa” from singing. The place was pretty congested and rooms were very near to the restaurant.
We booked our next two days of stay at Miramar Residency, around 25 km distance from Colva. We could take a direct taxi, which will take 850/-. But we thought it will be better to take a tour package and ask the driver to drop us at Miramar at the end. We booked a Cab for 1400/-, which included a package of set of places, temples and a church.
We started at around 9:30am on Monday morning from Colva residency to first reach “The Ancestral Goa”, a traditional museum. We first saw a Portuguese styled house, which depicted a mix of Indian and Portuguese architecture. The guide was pretty decent in explaining many details. We took many photos over there, concentrating less on what the guide was saying..
An interesting part here was the Toilet room, where in a set of family members of the same gender can sit together, discuss among themselves while doing that!

At the Ancient Goa
Me at the Ancient GoaWe then were shown many Plaster of Paris made full sized human shapes that depicted the ancient village professions. But, I was familiar with most of them, as I was grown up in a village. We then were taken to a village-bar, where in they served a mock tail made of coconut. I can’t recall its name, but it was pretty nice. We then were taken to a place called “Big Foot”, where a saint is supposed to have prayed god on single foot, and was taken to Heaven alive. It is said that we can ask our wish by putting our feet there and it will surely be fulfilled. We all prayed there putting our foots..
We then saw the sculpture of Meerabai, made by single person in just 30 days. It was mentioned in Limca book of records in 1994.
Our driver then took us to the Shanta Durga Temple and then to the Mangesh Temple. The style of the construction was different, with no “Dhwajastambham”, which is a must in all Telugu temples. Instead, there was a long structure built using cement or soil. The Lord Shiva we saw in Mangesh Temple was not a “Shivalinga”, but a full “Vigraha”. This temple was developed by Lata Mangeshkar. Everyone was saying that it is “Lata Mangeshkar Temple”, leading us to suspect that it’s a temple of Lata Mangeshkar!!
We then went to the St. Xavier’s Church, where in the Mummy of the priest was preserved even today. It is supposed to be of at least 400 years old. The church was huge and old, built in a pure Portuguese style. Lot of beautification was going on as the next day was Christmas.
After that, we stopped at a Pujabi restaurant for lunch. Incidentally, most of the Punjabi restaurants in Goa are named as “Sher-E-Punjab”s… I don’t know why! Later, we stopped at a Cashew nut stop. Some of my friends bought Feni and Red Wine, an alcoholic drink made of Cashew nuts, famous in Goa.
We then went to the Dona Paula beach, which was really nothing but a set of rocks and a small bridge. But many people came to watch the Sea there. We also took some photos, but we didn’t find that place much exciting. We came back and our driver dropped us at the Miramar Residency.
This residency was relatively pretty good, probably because it is located in the heart of Goa. That night we booked for a River cruise. The ship’s name was Paradise and it took us over the Mandovi river. Three Goan special dances were performed over the stage. Later a small disco session was arranged separately for kids, couples, guys and girls. The show lasted for about an hour, and then the ship took a “U” turn to leave us back at the Mandovi riverbank.
Tuesday was the only full day left for us and we decided to roam around Goa. We hired two bikes and started exploring. We first visited Arambola beach, which is located around 45 km from Miramar. It’s a remote place, with very few visitors, but has a considerable population of foreigners enjoying in the sea, under the sun and on the sand. We too had a very good time there. All of us walked along the beach for some time, keeping an eye on the sunbathing beauties!..
We started back around afternoon, stopped at a Marathi restaurant to have our lunch and proceeded to see the Chapora fort. It was located on a hill, beside the sea. The view was very beautiful. Some scenes in the movie Dil Chahta Hai were shot here. We too tried to give the same poses at the same location..

The DCH Spot!
We then went to the Calangute beach, called as the “queen of the beaches” in Goa. I don’t know why its called so, but it was too crowded and dirty. There were some good water sports like parasailing. But I wouldn’t recommend this to people who really want to enjoy in isolation. People said this beach was almost like the Marina beach in Chennai & Ramakrishna beach in Vizag..
We tried parasailing. It was enjoyable, though lasted for considerably less time.
As a last item in our beach, we visited Baga beach around 8 pm, which is famous for nightlife. There were numerous restaurants along the beach with couple tables and candle lights. Almost every restaurant had a DJ arrangement. The activities will go on till midnight and late night. There are other pubs that start only at 11pm, but entry will be restricted only for couples. We drove back to Miramar that night after roaming for sometime, had dinner at our Hotel and browsed through all photos taken during the three days.
The next day was the last day of stay at Goa and everyone was very tired. We didn’t plan much for the day. We visited the Miramar beach that was nearby and roamed for some time. Contradictory to our expectations, there was no one around and some warning boards were displayed saying swimming is prohibited in the beach. We played for sometime near the bank, came back to our rooms and prepared for check out. The check out time in most Goan residencies is 12pm. We booked a cab to drop us at the Dabolim Airport, which was located around 25 km from Miramar. While going, we stopped by a Kaju shop and bought some Goan sweets, Kaju and Feni. We took Indigo flight to come back to Hyderabad. It was just 45 minutes of journey and we safely landed at Hyderabad at 7pm on 26th night…
Overall, this is a journey that can’t be forgotten by me. Its my first holiday tour and filled with enchanting experiences.
1 comment December 29, 2007
Can this be a solution?
Today I went to my college (IIIT Hyderabad) and located groups of new faces wearing suits and walking around busily. When asked, I found that they are students of special program organized by one of the Directors of the college (I think Dr. Raj Reddy). All those people are from remote areas of Andhra Pradesh. Students from various undeveloped areas are selected, they are brought here for a full year for this course. As I understand, the aim of this course is to make them suited for the current day’s ‘hot’ IT/BPO jobs. Students are selected based on a screening test, and those who did well in the test are given seats for free. Mind you, people are not discriminated by their social backwardness. Not to mention, people got selected from all three regions of AP..!
Many of them are bright students who stopped studying due to weak economic conditions. Essentially the entry criteria was how a student performed in his 10th or 12th, the entrance test score and his economic situation.
I talked to some of the students who are studying there. Their schedule is really hectic. Classes spawn from Morning till night. Attendance and Uniform are must. They said that this course was extremely useful. I believe this kind of initiative will be really helpful.
Now, this is my question. Can our government and the political parties can even think of this kind of solution for the upliftment of the backward people of India? How on the earth will the 100+ seats in IIMs help the uplifting of crores of backward people? Why do the political parties fear doing it? They cannot survive, if there does not exist tensions between different social groups. If everyone in India is well educated and sensible citizens, they cannot rig the elections and bribe the voters to win..
Are these the reasons? I do not know.
Add comment April 28, 2007


