Wednesday, October 6, 2010

Unlock account in Oracle Database (ORA-28000)

An oracle database account can get locked for several reasons. The most common reason is number of unsuccessful attempts. This typically give the following error :

ORA-28000: the account is locked

Account can be unlocked by logging in as 'sys' user and issuing the following command:

SQL> alter user scott identified by tiger account unlock;

Tuesday, July 13, 2010

Setup EJB 3 MDB on Weblogic using Eclipse

Setup EJB 3 MDB Project on Eclipse Shown below is a common exception which occurs when class is executed from Eclipse that depends on Weblogic libraries -
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/kernel/KernelStatus 
    at weblogic.jndi.Environment.,clinit9(Environment.java:78) 
    at weblogic.judi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117) 
    at javax.naming spi NamingManager.getInitialContext(NamingManager.java:667) 
    at javax.naming InitialContext.getDefaultInitCtx(InitialContext.java:288) 
    at javax.naming.InitialContext.init(InitialContext.java:223) 
    at javax.naming InitialContext.einit,(InitialContext.java:197) 
    at com.MessageGenerator.getInitialContext(MessageGenerator.java:42) 

Monday, July 12, 2010

Images in Web Pages

DD_belatedPNG will (usually) solve all of your IE6 transaprency headaches with a little javascript: Medicine for your IE6/PNG headache!
It may slow down the page a little in IE6 (make sure you use conditional statements to prevent loading in other browsers), but it's much better than horrible grey blocks.

Good information overall in this article; however the easiest way to choose whether to use PNG/JPG or even GIF is:
Is the image a photograph? Yes = JPG
Must it use transparency? Yes = PNG
Does the image contain predominately blocks of colour? Yes = PNG or GIF, No = JPG
Is the PNG/GIF image very small (less than 10px x 10px)? Yes = GIF, No = PNG
Does the PNG/GIF image use >256 colours? Yes = PNG, No = 8-bit PNG/GIF

Even though GIF is an old format, it still seems to produce smaller filesizes when images are very very small. Also, it's a lossless format too so if your image contains less than 256 colours, then you won't lose any image details.
On a side note; it is a very good idea to store originals in a lossless format such as PNG. However, when storing photo originals, you'll achieve a better lossless compression using the TIFF file format, rather than PNG. This is because TIFFs are specialised for storage of photos without losing data, whereas PNG files are specialised for storing block colour graphics.

Saturday, June 12, 2010

HTML vs CSS vs Javascript

HTML is a semantic markup language, used to describe its contents. It is never to describe how its content *looks* nor *behaves*.

CSS is for describing how your content LOOKS.

Javascript is for describing how your content BEHAVES.

Tables are just part of HTML — and they have a place in marking up content: they are for tabular data.

If you content is something you’d use in Excel, it is a good choice for a table.

If you are using a table to position content on the page or “make things line up” then you are misusing HTML for layout purposes.

Friday, June 11, 2010

Consolidated list of Indian Railways Websites

Disclaimer : I am not responsible for the authenticity of the below information. Views expressed are personal only.

Websites for choosing train

Indian Railways Trains & Stations - http://indiarailinfo.com
One of the best sites available to search for trains. It includes average delay of the train, current location in the map. The interface takes a little time to get used, but once you get comfortable, it is very easy.

Indian Railways Timetables, PNR, Route fares etc - www.erail.in
Undoubtedly the simplest interface, it takes only 10 seconds to fetch any information for a given date and stations.

Indian Railways Rediff - http://indian-railways.rediff.com/index.php
A rediff approach .Quite friendly for those who are used to flight fare search :)

90 Degree Internet - www.90di.com
Very useful if there is no direct train available. Suggests itineraries with train hops. We can include flights as well.

Websites for Booking Tickets


Indian Railway Catering & Tourism Corporation ltd - http://irctc.co.in
Railways Official Site - India's busiest e-business site. Period. Ticket reservations to be made here only. The above sites are useful for planning only. Apparently, we could also install IRCTC software in phone with GPRS connection which lets us query PNR, book tickets, train search etc. have not tried personally.

OxiRail - www.oxirail.com
How to use:
1) Register your mobile number in OxiCash
2) Recharge the account like mobile wallet in OxiCash and
3) Use this mobile wallet to book the ticket in OxiRail

Advantages:

1) You can save the order before 8.00 AM (Before tatkal window opens) with train and all passenger information
2) The transaction processing here is also simple, so won't take much time to process the transaction (in irctc.co.in we need to go through more than three screens in the transaction)
3) No error like Connection refused/lost, click once and the transaction
will be completed (some time, takes time)

Drawbacks:

1) Sometime, transaction will fail, but still ticket will be booked after
two three minutes(You will get the message)
Tip: Keep exact balance to book only one ticket, in case of failure and retrying many times.
2) Rs10 extra as OXiRail charges

Other Railway Websites

Train Running Information - www.trainenquiry.com
Railways Official Site - this lets you spot any train right now.its says which stations it has crosses and how much late it is running LIVE! I use it when I am waiting for guests coming by train.

South Central Railway - http://www.scrailway.com/
Railways Official Site - Specialized for SCR Division under which majority of AP falls.

Hyderabad & Secunderabad MMTS Timetable - http://www.scrailway.gov.in/mmts/mmtstable.php
MMTS Timetable for local trains running in Hyderabad and Secunderabad.

Websites for Fun

IRTS - The Abode of Indian Railways - http://www.indianrailwaysimulator.com
If you are interested in playing train games :-D

Is Tomcat an Application Server?

What is an Application server?
Is Tomcat an Application Server?

Nearly all sorts are broken - by Joshua Bloch

A nice article explaining how integer addition breaks a sort.

Extra, Extra - Read All About It: Nearly All Binary Searches and Mergesorts are Broken

Tuesday, May 18, 2010

Technical Benefits of C over Java

While C requires more from a programmer, C can do things that Java can't easily do. Build a virtual memory manager, preemptive multi-tasking, a boot loader, a self-contained executable program. We expect an operating system to keep on running after an application crashes. We expect an operating system to reclaim resources after a process ends. We do not yet expect this from Java itself.

Inside Arrays.asList(T… a)

A small article explaining why we cannot add elements to the List returned by Arrays.asList(T... a) method - Inside Java: Arrays.asList(T… a)