Showing posts with label Technology. Show all posts
Showing posts with label Technology. Show all posts

Wednesday, July 21, 2010

Java in 16 days

Learn Java, Basics of J2EE, Open Source Frameworks etc in under 16 days. A free tutorial with links to good content from Sun Java and with to do exercise.

We (Nagarajan and me) prepared a curriculum for interns fresh from college, freshers and people taking up JAVA as a new programming language.

It is a 16 day learning exercise broken down into smaller chunks of contents to read and understand and a small to do exercise at the end of each learning content.








The link to access the document is here - Java learning Curriculum.

It is similar to a Java tutorial for freshers.

m.m

Tuesday, July 13, 2010

Java File Loading in Web Application

Different applications, different technologies, different designs, different packaging, different servers, different developers... Everything is different in web applications the loading of files becomes really difficult.

So how does one load files (with relative path / with absolute path) in the project structure in their java code within web applications.



1) Get the real path of the file from ServletContext or HttpServletRequest
ServletContext sc = (ServletContext)context;
sc.getRealPath("temp.txt");

or

HttpServletRequest hsrTemp = (HttpServletRequest)context;
hsrTemp.getRealPath("temp.txt");

2) Try with context path
HttpServletRequest hsrTemp = (HttpServletRequest)context;
File fileTemp = new File(hsrTemp.getContextPath()+"/resources/temp.txt");

3) Input stream - file in classes folder
InputStream inpStrTemp = this.getClass().getResourceAsStream("temp.txt");

4) resource url - file in classes folder
URL urlTemp = this.getClass().getResource("temp.txt");

5) Try this one.....................the magic one :) (all four above failed for me, this worked and yes I wrote it on my own ...)

URL currentClassFolder = TestClass.class.getResource(""); //this gives you the package reference of the test class
String pathFromUrl = currentClassFolder.getPath(); //this gives the actual path
String finalPath = pathFromUrl.substring(0,pathFromUrl.indexOf("WEB-INF/classes/com/test/web/")); //navigate to where ever you want to
finalPath = finalPath.replaceAll("% 20", " "); //command prompt doesn't like % 20'

Hope it helps, if it does - do leave a comment!

m.m

Monday, July 12, 2010

Netgear Wifi + Nortel VPN Issues?

I was troubled by the long list of issues that I was facing when I used to connect via VPN through wifi, the connection used to be refused and the office help desk would ask me to seek help from the ISP and vice versa.

Finally one day (a week back), I sat down tried to break my head over it and solved it under 2 hours. Quite pleased with the effort.


Issue: Nortel VPN not connecting via wifi router (netgear in my case) but connects via LAN (directly to the modem)

What I did:

You can access your Modem's application as follows
Link - http://192.168.1.1/
Username / password - admin / password (usually but if it doesn't work search in the net for the right one)

Wifi Router
Netgear router
Link -
http://www.routerlogin.net
or
http://10.0.0.1/
Username / password - admin / password (usually but if it doesn't work search in the net for the right one) [for the virgin media provided wifi router it is virgin/password]

For the VPN to work

Add port triggering for the following ports 50, 80, 500, 4500, 1701, 1723 under both the Wifi and modem's application.
And then Navigate to the wan setup under the wifi router's application and
check the Disable SPI Firewall.

Restart the modem and your system and connect to VPN and voila you connect and if it works drop a comment :)

m.m

Monday, August 31, 2009

The extra mile...

I am still wondering if the service provided by my favorite GSM provider - Airtel was an act of going the extra mile in customer support / satisfaction or going the extra mile in senseless activities.

Call from customer care (CC): Hallo may I speak to M?
M: Yes this is M.
CC: This is regarding your complaint that you have registered at the customer care.
M: (scratching my head), now which complaint was this, tariff change? service activation? DND?...(anyways) YES tell me.
CC: Now is your connection and network coverage issue proper?
M: (I was surprised that they proactively cover everyone's network and in a hurry check my tower signal bar on the phone and see that it is ready to burst out of the phone) Yes it is fine. What was my complaint regarding?
CC: Sir, you have complained about your network coverage in ABC area.
M: uhhhhhhhhh? hmmmm? Are you serious?
CC: Yes sir.
M: Yes the network coverage is long gone, but I want to tell you something, this was a complaint given in the mid of 2007 and you are calling me regarding this a cool 2 years later. (Anyways thanks for remembering)
CC: Sorry for the inconvenience, is there anything else that you would to know from us.
M: No
CC: If you have any query please call 1234455 to get your queries answered, thank you and have a good day sir.
M: Wish you too a good day.
click....

Bright and Shining till retirement


Makes me wonder if they are doing a great job in resolving all issues or are they having some ancient process / systems thats making their good intent to serve people go wrong. Are they losing on money, time, customer good will and above all are they barking on the wrong tree???

Can we apply Business Process Management (BPM) here?
ps: Yes I just finished a training program on BPM.

m.m

Friday, August 07, 2009

Job Schedulers - UNIX


We might have worked on various Job Scheduling Frameworks, one of the famous one that comes to our mind is Quartz. Yes quartz is a cool frameworks which has advanced error handling, job scheduling and various other great feature. Recently while trying to create a scheduling task for a task in UNIX I decided to check out the inbuilt job scheduling component - crontab, instead of setting up a java application and scheduling it using quartz. There is also a command like a timer at which a script can be run - at
chmod u+x /export/home/user/example/DeleteOldTmpFiles.sh

Useful Links
http://www.adminschoice.com/docs/crontab.htm






m
.
m

SVN vs CVS

Why is every one adopting SVN / Subversion over CVS?

Is SVN / Subversion winning over CVS?

Find out more at the following links.

Detailed Notes
http://svnbook.red-bean.com/en/1.5/svn.forcvs.html

Comparison Details
http://www.pushok.com/soft_svn_vscvs.php
http://momentarypause.blogspot.com/2007/01/subversion-vs-cvs.html
http://versioncontrolblog.com/comparison/CVS/Subversion/index.html

m.m

Friday, October 26, 2007

Business at 20 20

A colleague at work started a interesting thread on the changes that he had seen since the last 13 years i.e. 1994 and he wanted us to predict on the changes 13 years ahead....

Business in the year 20 20 will be like a 20/20 cricket match, fast paced, action packed, with dramatic twists and turns and decisions might have to be taken on a per second basis in virtual meeting rooms with people attending the meeting from all parts of the world or even from the outer world...

Some of the top changes that I can imagine for few industries are as follows...

Tourism industry would have spread to places never before visited by the masses like say Outer space travel, Extraterrestrial visits and what not - Distance revolution.

Travel industry might have super fast transportation based on apparitions and the distance revolution might lead to a time revolution using concepts like space time travel / time travel / space time travel capsules.

Hotel industry and the construction mavericks would have created under sea resorts and hotels/theme parks utilising the vast space available under sea...you and me could be coding in an environment under the sea... - Space revolution.

Digital and Mobile revolution would involve a lot of technology which would be stitched/bonded/binded inside the human body like say you might be able to answer a call without using a mobile, a chip inside would transmit the sound through bones to your ear and your voice would be also transmitted through similar means;You might not need to tap your ID cards, a RFID tag placed under your skin could tag the entry for you. - Digital/AI revolution.

Food/Biotechnology industry might come up with food capsules, pop one for a light breakfast pop two for a heavy breakfast and that too in different flavours. - Food revolution.

Automobile industry might try to come up with models which run on a self sustainable principle...smoke exhaust to be the input of a process which runs the engine on some principle and in turn the engine gives out smoke and the vehicles moves on...Technology revolution.

IT...

to be continued...


m.I.m