Saturday, December 15, 2007

Logout

Yesterday was an offisite at work. We went for a day trip to Pratapgarh fort beyond Mahabaleshwar.


Destination...


Mode...


Vista...

Wednesday, June 13, 2007

Code quality

Computers are good at following instructions, but not at reading your mind
Dr. Knuth surmised this and the following snippet of a java code written by a professional programmer demonstrate this. What the programmer wanted was to find if the string value is empty. Look at the way computer is told to determine this:

// check for empty value
static boolean isEmpty(String value) {

Boolean isEmpty = new Boolean(false);
if ((value == null) || (value.length() == 0))
isEmpty = true;

return isEmpty.booleanValue();

}
Do you see, why I like to be in this profession and what I hate about it!
:-)

Thursday, June 07, 2007

Truth ...

Though leaves are many, the root is one;
Through all the lying days of my youth
I swayed my leaves and flowers in the sun;
Now I may wither into the truth.
 - W. B Yeats

Friday, May 25, 2007

Baby DJ





Baby Diya Jha :-)

Latest

Last weekend was a short vacation for the family. A complete R&R at Daman. This one is at Jampore beach, Moti Daman

Tuesday, May 22, 2007

JBoss, JAXB and JDK 1.6

While using JBoss 4.0.2, JAXB 2.1 and JDK 1.6 (a.k.a J2SE 6.0) if you get a linkage error similar to one discussed here then you should put jaxb-api.jar from JAXB RI into the endorsed directory used by Jboss. Putting it under jre/lib/endorsed directory has no affect as JBoss overrides the endorsed directory with its own. Place the jaxb-api.jar into $jboss-home/lib/endorsed directory instead. It should solve the linkage problem.

Friday, March 09, 2007

Final Day

Today is my last day at EIPL. I will cease to exist at this office from tomorrow. I am moving to a new start-up which is being setup in Pune and will be functional probably by early next month.

More later...

Friday, March 02, 2007

Moving On ...

I was a pure java/e-App techie until about year and half ago when my present employer made this tempting offer to lead their VoIP/Java initiative at Pune. I joined them leaving behind the comfort and security of a job from $5 billion giant. The new job, however, soon changed due to the changing business plans and they decided to re-engineer everything that existed in Java to C#/.NET. I stayed on. Left Java and picked up strangers like C# and .NET along with SIP, IMS, Soft-switch etc in this VoIP/C# journey. Now, with first generation of the craft already in the market and my team here quite capable of taking it further, I have decided to move on ...

What Next?

So far, I do not have a firm destination. Google was enticing but, it did not work out. SAS is way too far from home and GSL appeared puerile. Right now I am talking to a fledgling company that is yet to establish presence in India... let us see what happens!

Thursday, February 01, 2007

5000 kilometers

Yesterday I completed first 5k on my Royal Enfield Bullet on the way to work. This happend after nearly ten months. The journey so far includes miles of pleasurable ride- mostly done between home to work daily, and couple of out-station solo rides (Narayangaon and Kashid)- accompanied by loads of road presence and envious glances on the way.

Other than usual maintenance and tappet adjustments I had to tighten the cam-gears during initial run-in and replace the oil seals on primary drive case to plug the oil leakage. No other major problems (touch wood) so far, just a couple of cable replacements (clutch at ~4000 kms and speedo at ~3000 kms due to monsoon) .

Cheers!

Tuesday, January 30, 2007

Thank you from Google

Over two months of wait is finally over- they sent me a thank you note today "... hiring committee carefully reviewed your experience and qualifications and determined that there is not a strong match for a position at this time..."

Seven rounds of intense interviewing- three over the wire and four onsite at Bangalore. Most of them, I thought, went very well, but ... at the end I guess it was not good enough!

Life goes on... may be for the better.
I will not have to relocate now.

Wednesday, January 17, 2007

Helpdesk at Icici Direct

My other half has a trading a/c with the ICICI Direct but it is only me who runs it and knows the portfolio's worth :-). Lately, I have observed a lot of descripancies in the online MF portfolio tracker at their site. It is reporting few fund holdings twice. This inflates our net worth but, it is of no use as I can not sell them. For selling I need to use the unit holdings page and sadly, the data is accurate here.

I reported this matter to ICICIDirect through following email:
Ref: Trading a/c # XXX
Demat a/c # XXX

Hi,

My mutual fund portfolio tracker page ( trading -> portfolio -> mutual funds) is showing wrong data. Some funds are getting reported twice causing wrong portfolio value. Some funds like:

SBI FUNDS MANAGEMENT PVT LTD SBI MAGNUM COMMA FUND - GROWTH OPTION
and
TATA MUTUAL FUND TATA INFRASTRUCTURE FUND - GROWTH


are reported twice on the page each time under different Fund "Category". I have noticed this problem ever since you have implemented new SIP investment options. Looks like your coders have done a shoddy job and QA has failed to notice it.

This is causing a great inconvenience to me by reporting inflated portfolio value. Pls check and correct the bug as early as possible.

Thanks,
xxx
After two days this is the reply I received from their CSA:
Dear Ms. Jha,

We wish you a Happy New Year!

If you wish to delete any transaction from your Mutual Fund Portfolio, we request you to follow the below mentioned procedure:
1. Login to www.icicidirect.com
2. Go to portfolio section on the trading page
3. click on the Mutual Funds link
4. Click on the Scheme name of the Mutual Fund which you wish to delete.
5. Click on the "x" symbol available on the extreme right side to delete that particular transaction.

Sincerely,

XXX
Customer Service Officer
ICICI Bank Limited
Note the signing authority and her designation..."ICICI Bank".

This is my follow-up reply and I am waiting to hear on this :
> If you wish to delete any transaction from your Mutual Fund Portfolio, we
> request you to follow the below mentioned procedure:
>
> 1. Login to www.icicidirect.com
> 2. Go to portfolio section on the trading page


Did you understand the issue I have reported? I think it is a totally irrelevant and dumb reply I got from ICICI Direct. Let me try to explain the problem once again.

Say I have a mutual fund called MF1 and I have 100 units of MF1 in my DEMAT account. The portfolio tracker page reports MF1 twice as:

serial# 1 MF1 - units held =100
serial# 2 MF1 - units held = 100

Since, I am NOT adding any transaction MANUALLY into my mutual fund portfolio tracker, it must be coming through the software that ICICI Direct uses. Right!

Another thing is that I have subscribed for SIP, hence MF1 can have 100s of SIP transactions all accumulated under SL#1 and SL#2. Do you expect me to delete each SIP transactions one-by-one through your portfolio tracker? Can you imagine the time it will take to do that?

Another thing, if I delete MF1 at SL#2 what is the guarantee that SL#1 would not get deleted also and I will loose all my portfolio information!!! I suspect both SL #1 and SL #2 to share the same PK in the back end database if your DB is in third normal form (?)

I appreciate that you may not follow all the issues that I have raised here, hence, please escalate it to your Technical Architect or SQA Lead- I am sure he will understand the problem and please do not waste my time (and yours too) by copy-pasting a "set" response from your
repository of replies!

Please...my time is very precious...

Thanks for taking time to reply.

- xxx
It is getting increasingly difficult to get an accurate response from ICICI Direct for any query... but ... what are my options? I have heard more annoying tales about the competition from my friends. Unfortunately most CSA activities are either out- sourced or are manned by less than adequately trained personnel who are quite incompetent to address such queries :-( and what is alarming is such dorky CSAs are polluting the name of ICICI Bank as well by signing under their banner. I think ICICI management should separate the CSA's of ICICI Bank and ICICI Direct- at least that will help them to preserve some respect in ICICI Bank that I want to have!

Wednesday, December 20, 2006

Two wise men on MS, Yahoo and Google

pkbehera: does yahoo use LCS now?
BJ: they seem to have married with "msn msgr" ...if you mean it is LCS...then yes
pkbehera: well MSN is LCS
BJ: I believe LCS is lot more than MSN messenger
BJ: messenger is a front end to LCS
pkbehera: perhaps they have opened up some web services like stuff on LCS for YM to talk to
BJ: IMHO lcs is a middleware + backend
BJ: perfect
pkbehera: right
BJ: btw web services are "default" mechanism for IPC in .NET
pkbehera: well yahoo tried best to enter enterprised and did not have much success, so LCS is one route of getting into enterprises for them
BJ: possible...
BJ: the main magnet for both MS and Yahoo is the following
BJ: 1. Large existing user base for yim
BJ: 2. large existing users for msn IM
BJ: take union of 1+2 ...and get even 10% to click on the ad links...a potential million $ mkt for them
BJ: and many orgs already using yim unofficially for their multi-site collaboration
BJ: now both yahoo + ms want to exploit that potential too
BJ: btw...did u notice unprovoked apperance of ads in latest YIM tool?
pkbehera: yes
pkbehera: thats irritating
BJ: yeah...call it "ad sense" in yim
pkbehera: and keeps shouting at me "u fool, swith to ggle talk"
pkbehera:
BJ: yeah...but all ur peers too need to move to ggle talk then...i see that happening very slowly
pkbehera: which much less lightweight, less fancy
BJ: these IMs are a sticky tool...my father and your father if they are used to yahoo...will not switch to ggle talk easily
pkbehera: thankfully that adsense is limited to the main ym window
BJ: next version will be those popping on and off as u type
pkbehera: yes
BJ: i have a feeling that ggle wants to come out with a whole suite of tools for "collaboration on the web" and go to big enterprises and reduce their bills on MS Office licenses ...
pkbehera: yeah thats their plan
pkbehera: ggle docs is already very impressive
pkbehera: there is few other such players too
BJ: and all these nuts and bolts like gmail, talk, picasa, calendar etc...are pre launch feelers to get the mind share of peple on the web
pkbehera: yes
BJ: yeah...ggle is acquiring small players in the arena ...
pkbehera: with gmail they introduced a whole new concept of conversations, rather than messages and folders
pkbehera: thats getting hugely popular
pkbehera: www.thinkfree.com, seen this?
pkbehera: and www.zoho.com
pkbehera: they give a little more than ggle docs as of now,
pkbehera: MS office has got serious competition
BJ: yeah...billy has already set his best drivers to steer them home with "windows live" adventure

Thursday, November 23, 2006

Real World Enterprise Application!

Pic-1










Pic-2







I have veiled the brand and company name to keep it anonymous to avoid embarrassment :-)

Tuesday, November 21, 2006

C# class for Hex encoding

Here is the C# code I wrote for handling Hexadecimal encoding/decoding for using with OpenSSL tool. Pls see my earlier post for discussion on OpenSSL quirks.

#region HexUtil class
/// <summary>
/// Utility class for doing Hex encoding/decoding
/// </summary>
public sealed class HexUtil {

/// <summary>
/// Holds the hex characters for a fast lookup
/// </summary>
private static readonly char[] HEX_CHARS = "0123456789ABCDEF".ToCharArray();
//Keep the array sorted for faster search
static HexUtil() {
Array.Sort(HEX_CHARS);
}

/// <summary>
/// No explicit client creation needed/allowed
/// </summary>
private HexUtil() {
}


/// <summary>
/// Creates a byte array from the hexadecimal string. Each two characters are combined
/// to create one byte. First two hexadecimal characters become first byte in returned array.
/// If input hex string contains an odd number of bytes, then last character is dropped to
/// make the returned byte array as even bytes. It raises ArgumentException, if a
/// Non-hexadecimal character is encountered while processing the string.
/// </summary>
/// <param name="hexString">String to convert to byte array. It should contain only
/// Hex chars [0-9 a-f A-F] only, else error will be raised. See description above </param>
/// <returns>byte array, in the same left-to-right order as the hexString</returns>
///
public static byte[] GetBytes(string hexString) {

if( ! IsValidHexCharLength(hexString) ) {
throw new ArgumentException("Invalid hexString size");
}

//check for non hex characters
StringBuilder tempString = new StringBuilder(hexString.Length);
foreach (char c in hexString) {
if (IsHexChar(c)) {
tempString.Append(c);
}
else {
throw new ArgumentException("Non Hexadecimal character '"+c+"' in hexString");
}
}

string verifiedHexString = tempString.ToString();
tempString=null;

//check for valid length. If number of characters is odd in the hex string then
//drop the last character
if ((verifiedHexString.Length % 2) != 0) {
verifiedHexString = verifiedHexString.Substring(0, verifiedHexString.Length-1);
}


//Convert each hex character to byte
//Hex byte length is half of actual ascii byte length
int byteArrayLength = verifiedHexString.Length / 2;
byte[] hexbytes = new byte[byteArrayLength];
string tmp_substring = null;
try {
for (int i = 0; i < hexbytes.Length; i++) {
int charIndex = i * 2;
tmp_substring = verifiedHexString.Substring(charIndex, 2);
hexbytes[i] = Convert.ToByte(tmp_substring, 16);
}
}
catch (FormatException ex) {
throw new ArgumentException("hexString must be a valid hexadecimal", ex);
}

return hexbytes;
}



/// <summary>
/// Converts the input bytes array to a String assuming each character as a hexadecimal
/// character. Uses .NET Byte.ToString("X2") implementation to achieve the encoding
/// </summary>
/// <param name="bytes">hex encoded bytes to be converted to the string</param>
/// <returns>A string representation of the input bytes assuming Hex encoding</returns>
public static string ToString(byte[] bytes) {

if( bytes == null || bytes.Length == 0) {
throw new ArgumentNullException("bytes");
}

StringBuilder hexString = new StringBuilder();
foreach (byte byt in bytes) {
hexString.Append( byt.ToString("X2") );
}
return hexString.ToString();
}


/// <summary>
/// Determines if given string is in proper hexadecimal string format
/// </summary>
/// <param name="hexString">string to be tested for valid hexadecimal content</param>
/// <returns>true if hexString contains only hex characters and
/// atleast two characters long else false.</returns>
public static bool IsHexString(string hexString) {

bool hexFormat = IsValidHexCharLength(hexString);
if(hexFormat) {
foreach (char ch in hexString) {
if (!IsHexChar(ch)) {
hexFormat = false;
break;
}
}
}
return hexFormat;
}

/// <summary>
/// Checks to see if the input string is not null and atleast two
/// characters long
/// </summary>
/// <param name="hexString">string to be tested</param>
/// <returns>true if hexString is not null and atleast two
/// characters long</returns>
private static bool IsValidHexCharLength(string hexString) {
return ((hexString != null) && (hexString.Length >= 2));
}

/// <summary>
/// Returns true if c is a hexadecimal character [A-F, a-f, 0-9]
/// </summary>
/// <param name="c">Character to test</param>
/// <returns>true if c is a hex char, false if not</returns>
public static bool IsHexChar(Char c) {
c = Char.ToUpper(c);
//look-up the char in HEX_CHARS Array
bool isHexChar = (Array.BinarySearch(HEX_CHARS,c) >= 0);
return isHexChar;
}


/// <summary>
/// This is a utility method to convert any input byte[] to the requiredSize. If the input
/// byte[] is smaller than requiredSize, then a new byte array is created where all lower order
/// places are filled with input byte[] and balance places are filled with 0 (zeros). inputBytes
/// array is truncated if it is larger than requiredSize.
/// </summary>
/// <param name="inputBytes">input byte aray</param>
/// <param name="requiredSize">the size of the byte array to be created</param>
/// <returns>a byte array of requiredSize</returns>
public static byte[] CreateLegalByteArray(byte[] inputBytes, int requiredSize) {

byte[] newBytes = null;
int inputLength = inputBytes.Length;

if(inputLength == requiredSize) {
//nothing to do
newBytes = inputBytes;
}
else {
//create a new Byte array of reuired lenght and fill the content with
//given byte[] starting from 0 index in the new byte[]
newBytes = new byte[requiredSize];
int len= newBytes.Length;
if (len > inputLength) {
len= inputLength;
}
Array.Copy(inputBytes,newBytes,len); //note: balance is filled with 0 (zero)
}
return newBytes;
}
}

#endregion

Friday, November 17, 2006

Sight...

Saw a dumbbell formed lady just emerging out of a local gym sporting a T-Shirt proclaiming... "Misson Impossible" !

Tuesday, November 14, 2006

Recipe for inter-operating a C# Symmetric Encryption code with OpenSSL

Interoperability is not a difficult thing to achieve. Yet, it is not an easy thing to get either- predominantly because the relevant information are widely fragmented and even Google fails to compact all of them together- leaving you rummaging through a pile of web pages to fish out really useful information from them. I am posting this for my own help- may be in future I will need to come back here to look at this again to see what I did!

Problem # 1: Quirks of Hex key in OpenSSL

I needed to write some C# code which will take in a plain text file and run some Symmetric Encryption routine over them using a given Initialization Vector (IV) and a Secret Key (SK). The output will be some encrypted binary data which should be decoded by the OpenSSL tool. Basically, I wanted following OpenSSL command line to work for me always:

$openssl enc [-aes-128-cbc] -in <CipherData.bin> -out <ClearData.txt> -d -K <SomeSecretKey> -iv <SomeIV>

Here <CipherData.bin> is the encrypted file generated by C#/.NET crypto routine. My aim is to support these algorithms: AES, 3DES, RC2 and DES and at least support following chaining modes: CBC, ECB and CFB.

With -–K (and -iv) option, OpenSSL expects only Hexadecimal secret key (and IV) string whose valid size differ for different algorithms employed. The input hex string is converted into a byte array and used as SK (and IV). The interesting part is that OpenSSL and .NET crypto behave differently if you do not supply a valid length hex stream against these data. While, OpenSSL intelligently (and silently) pads the byte array with trailing 0s to make up for the shortfall in “legal” size or truncate it if the same goes beyond the adequate size, the C#/.NET crypto code dies with an exception, leaving you puzzled- what went wrong? Sometimes, to baffle us more, a secret key which had worked in C#/.Net seems to give you "“bad crypto"” in OpenSSL and vice versa.

The crux is how you encode (and decode) a Hex string into byte[] for SK and IV. Basically the point to remember is that a simple Hex text like "“CAFEBABE"” is 8 ASCII character (8 bytes array) but, becomes 4 bytes array when converted to Hex encoding. I have a sample HexUtil C# class which illustrates these things... wait for next post.

Problem # 2: Line breaks in base64 encoding

By default (-a or -base64 switch) OpenSSL inserts/expects a line break (new line character) after every 64th character printed in the encoded/decoded stream. But C#/.NET Libraries v1.1 does not insert a line break automatically in the generated base64 encoded string. Hence, there is some incompatibility between OpenSSL and C# Base64 converter. I have read that in .NET v2.0, Microsoft has added an additional API to insert line breaks in the generated Base64 strings [add link ?]. Meanwhile, I figured out that there is a command line switch in OpenSSL to disable the default line break behavior in the tool. I used following OpenSSL command to successfully decode the Base64 texts generated by C# code:

$openssl enc -a -A -d -in <B64EncryptedData.txt> -out <B64EncryptedData.txt.out>

Note the extra -A switch in the command line!

Tuesday, September 19, 2006

Wednesday, July 26, 2006

Getting rid of Null Pointers

NullPointerException or Null Object Reference errors are so common in any Object Oriented programming languages, be it ubiquitous Java or C#, that programmers have accepted it as a 'feature'. This happens when a reference (an object handle) pointing to ‘no-where’ is called in to service a request during the execution of a program. In the traditional languages like C, it would be a memory location without any serviceable address assigned. What is worse is that, such creepy things stay unnoticed while building the executable and surface only when someone uses the ‘shipped’ program. This not only leads to the annoyance and frustration to the consumer of the program, but also reveals the ‘ability’ of the software developer to him/her. Just look at so many jokes floating around involving the software developer community.

Yesterday stayed awake till late in the night. I was trying to book a ticket at a well-known website and this is what I encountered on the screen:

java.lang.NullPointerException: null at org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:133)
at booking._0002fbooking_0002fbookTicket_0002ejspbookTicket_jsp_
1._jspService

(_0002fbooking_0002fbookTicket_0002ejspbookTicket_jsp_1.java:485) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.
java:174) at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:268)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:381) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.broadvision.servlet.ServletContainer.service(ServletContainer.java:404
) at com.broadvision.servlet.BVRequestDispatcher.forward(BVRequestDispatcher.ja
va:133) at …

While, clearly above is a testimony to a poor QA activity, but, the responsibility of the coder is no less severe either. Actually, it perhaps mirrors a poor coding practice followed by him/her which went unnoticed throughout the entire SDLC.

There is very little that a language compiler can do to check and alert the coder if he/she is leaving a dangling reference attached to 'nothing' before the code actually runs and the OS detects that the program has tried to reach a location that is either out of bounds for the current code or it is not present in the universe (mem address space) at all. Therefore, all null pointers show up only at the first usage of a handle (reference or pointer) that points to a NULL location.

If surfacing unsolicited was not enough, such ‘runtime’ exceptions generally carry useless information along to be of any help during debugging, unless the coder has implemented a meticulous audit/tracing plan. Try to decipher what went wrong in the above exception message? Here the coder at least was fortunate to have a dorky build engineer who allowed to ship the software with debug information on (look at those source code line numbers) otherwise, stack trace would have been dumber with no evidence of what went wrong and where… I mean you would not find any line numbers and if the code was subjected to massive compiler optimization then it would loose every bit of its identity due to the mangling of information and sometimes further obfuscated by dynamic compilation by JITC.

So, as they say, prevention is the best cure. Do not write code that can suffer from such an ailment and writing code as given below is suicidal. In the following example I am trying to fetch some ‘textual’ information from a Database (DB).

String txtData = getCollectionFromDB().getSomeDataForNamedKey().getValue().trim()

This looks smart (?) But, IMHO usages like this is the single biggest source of null pointers and other hypodermic bugs.

Yes, in our DB, values can be "NULL" or there may not be a matching row to fetch. Practice of in lining many calls as above is a great source of null pointer exception especially, if the data is coming from outside your code 'boundary'. Here you have absolutely no control over what is coming to you. In the above snippet, all the method calls preceding the dot (.) operator could give you a null reference leading to the exception. E.g. trim() would fail on a null value returned by getValue(); getValue() would fail on a null Object fetched by getSomeDataForNamedKey() and so on.

Why would you write code like this? This programming practice does not save anything except may be some of your typing time and finger ache! Instead of being stingy on words and lines as above, try to break calls into individual ‘statement’ and combine such statements into a code block (example shown below). This not only yields a more robust code but, also makes code easier to comprehend. Whats more, the debugger tools will also report proper line numbers happily.

Map nameValuePairMap = getCollectionFromDB();

if( isNull(nameValuePairMap) )
{
//do Blah Blah
}
else
{
NameValuePair someNameValue = nameValuePairMap.GetSomeDataForKey();
// Do Null check
...
String dataValue = someNameValue.GetValue();
if( isNull(dataValue) )
{
txtData ="";
}
else
{
txtData = dataValue.trim();
}
...
}


Follow this and & > 80% of your programming bugs (especially Null pointers) would disappear.
Ask me how do I know that :-)


Saturday, July 08, 2006

Roof-top Farming


Green chilly on the attic and the overcast monsoon sky filling the background Posted by Picasa

Wednesday, June 14, 2006

Abstraction and Encapsulation

These days I conduct a lot of job interviews to fill up few vacant positions for developers in our group. Typical profiles that I get read something like:
<<S. RamaLinga Reddy>>
Hyderabad
BCA, MCA, PGDST, e-DAST, NSCT,NIIT…(yes IT qualifications in India look like degrees of a medical practitioner- the more the better)
5+ years in IT
Expert in C#/.NET, ASP.Net, VB.Net,C, C++, Java,
Knowledge of COM, DCOM, COM+, MTS, SQL Server, IIS, Windows, Unix (?), OOP, Design Patterns…
Responsible for FSD, LLD, HLD, CUT…
Wannabe S/W Architect
The first page is normally crammed with such accomplishments and aspirations. One Reddy I saw had included this too “H/W: Pentium-III, 633MHz, 128 MB RAM, 8.3 GB SCSI- II HDD, 32x CDROM, 1.44 (3.5 in) FDD, PCI BUS Architecture”. Next tens of pages lists the projects he has worked like: “Web Based Employee Attendance Management System”, “Employee Data Management System”, “Ticket Reservation Systems” and so on.

Yesterday, I interviewed one such candidate. As expected, he too had a well endowed resume not different from the above sample, though. I am reticent even during interviews. Hence, he was quizzed mostly by my colleague. I just had one question at the end:
What is the difference between Abstraction and Encapsulation?

Answer: Both are actually same…umm...like Encapsulation...is Encapsulating things in a class and...umm ... Abstraction is Abstracting somethings inside a class...umm...blah blah blah
End of interview!

I have been asking this question to every 5+ years I see. However, rarely I get a pleasing answer. No wonder we still remain a land of ‘Cyber Coolies’!

For the benefit of next candidate I have to interview, here are some links to look at:
http://www.itmweb.com/essay550.htm
http://www.javaworld.com/javaworld/jw-05-2001/jw-0518-encapsulation.html
http://www.artima.com/intv/abstreffi.html
http://forum.java.sun.com/thread.jspa?threadID=280797&messageID=1092364

It is important to learn how to abstract what you know and encapsulate what you don't before you appear for a job interview !

:-)

Thursday, April 13, 2006

Wow - What a Ride!

Life should NOT be a journey to the grave
with the intention of arriving safely
in an attractive and well preserved body,
but rather to skid in broadways,

Haywards in one hand - Goldflake in the other,
body thoroughly used up, totally worn out, and screaming

Wow - What a RIDE !!!


Don't know who said this- but very well said indeed!

Monday, March 27, 2006

On Sale

Jan 1998 black Yamaha RXZ, Pune registered
Done ~48000 kms
Single handedly driven,
Excellent condition, Looks much younger,
Fed on Speed, Premium and Power
New battery,
New front tyre,
Semi-new rear tyre (done 20,000 kms)
Comprehensive insurance paid upto Feb, 2007
PUC valid up to august, 2006
Expected price 16,000/- (negotiable)
Reason for sale: going for a Royal Enfield Bullet
Contact: hi2bj AT sify DOT com
She has served me very well for the past eight years…now is the time to bid her adieu :-(
 Posted by Picasa

Wednesday, March 08, 2006

What's new?

Nothing...! Just happened to click these snaps of Diya on a Sunday couple of weeks back.

Emu and quails

Drive down to Tony Da Dhaba near Kamshet on Pune Mumbai road (NH-4) to see these birds live Posted by Picasa

Thursday, March 02, 2006

Loosing patience!

I have not received my renewed passport yet and it does not look to be happening in a near future either. For past three weeks, I see the same poster: "It is to regret that due to unavoidable circumstances the despatch of Passport has been delayed and will now be despatched in a week's time". Mails to rpo DOT pune AT mea DOT gov DOT in are not answered !!

Anyone (other than me) stuck at the same damn status?

:-(

Friday, February 24, 2006

Kabhi Socha Thaa?

Indian Railways launches loyalty programme called SOFT (Scheme for Frequent Travellers)!!

Thursday, February 02, 2006

Trip to Ganpatipule

26th of January was a Thursday. We grabbed this opportunity to extend the weekend by bunking next day and set out for a family outing to Ganpatipule. This is a tiny hamlet in southern Konkan known for its shiny beach and a four centuries old temple of Lord Ganesha. People visit here with different agendas. Some of them come here just to pay respect and pray to the Lord; some drop in to enjoy the sun kissed beach and laze around while others simply leave hustles and bustles of city life behind to enjoy the splendid drive down the NH17 meandering through scenic Konkan countryside. I had all of these motives in different proportions. We reached here via Chandni Chowk-> Mulshi-> Kolad-> NH17-> Chiplun -> Sangameshwar. Beyond Paud, SH60 is in a very good shape with fresh asphalt. Nothing to complain about NH17 except few miles of wrinkled tarmac between Mahad and Kashedi ghat. We made it by 6PM to MTDC resort and had an awesome view of the sun setting into the Arabian sea. Evening went by hogging kebabs and beer. Pleasure was upped as Bipul and his better half paid for them (they were celebrating second wedding anniversary). Diya and Shirin preferred to sleep through the feast.

Three days of delectable indolence passed like a trice and now back to the stock humdrum of urban life!

More pics from the trip.

Tuesday, January 31, 2006

Patience Pays

Once again I checked the status today. But, unlike last time now it says:
"Police Report is clear and the passport is expected to be despatched by 18-02-2006 Subject to all documents being in order."
I have not paid any bribe to get it cleared. Which makes me believe that our government agencies can really work. What you need is an 'honest' patience to wait (I have waited for over ten weeks now) for the results to happen naturally. Most often it is only us, who try to catalyze the process by greasing with bribes, in order to 'accelerate' results.

Hope my trust in the system is not betrayed.

Saturday, January 28, 2006

Bliss!


Spending a quiet afternoon.

Ganpatipule, Jan-2006Posted by Picasa

Time


"...And you run and you run to catch up with the sun, but it's

sinking
And racing around to come up behind you again
The sun is the
same in the relative way, but you're older..."

Sunset at Ganpatipule near Ratnagiri, Konkan Coast

Posted by Picasa

Mirror Image

 Posted by Picasa

Back On the Field


That's me and Diya at Deccan Gymkhana for a cricket outing against IndiaSoft earlier this month. Posted by Picasa

College mates

That is me, Raktim, Rakesh, Manas, Venugopal and Priyotosh (L->R) at Oval, B. E. College, Shibpore, Howrah. It must be final year of IIT?
Posted by Picasa

Me a decade ago

A snap from my final year at IIT. Posted by Picasa

Tuesday, January 24, 2006

Invited to talk

Last Thursday I was at Sinhgad College of Science, Pune, to participate in their annual Industry Academia Forum (IAF). Prasanta too accompanied me. They had invited us to speak about Java.

About two hundred odd under graduate students of computer science had gathered in an auditorium to listen us. I spoke about genesis and uniqueness of Java and what makes it so popular. I had also compiled some interesting real world applications to demonstrate that Java can be used everywhere, right from e-Commerce, home networking, gadgets to space exploration. I could feel, most present there knew that java is limited to ubiquitous internet applications and shopping carts only. They were wide eyed after hearing how java powers Philips iPronoto and BMW in-dash infotainment or how Mars exploration was simulated using Java 3D imaging. Prasanta went deep and spoke about complex issues in enterprise applications like dealing with heterogeneous database, bridging isolated and disparate applications and how J2EE addresses such challenges.

This was my second such presentation. Earlier I had been to Wadia College. It is a always a great experience talking in front of such an audience and more so speaking about Java :-).

Hope, I could educate them about power and applications of Java and cleared some of their doubts...

Wednesday, January 11, 2006

Hats Off to The Metro Man

Chief of Delhi Metro, Mr. E. Sreedharan finds a spot in top 25 newsmakers list of US. Indeed a very rare tale of honest deeds in a country despaired by corruption and scams.

Thursday, January 05, 2006

What lies ahead

This is basically a compilation of some interesting links I found around the web which tries to reveal futuristic things.

Check out Microsoft's vision of the future.

A peek into futuristic computing; slightly dated, still worth a dekko

IBM's Autonomic Computing

Google's ten golden rules to get the best out of knowledge workers in order to be a successful business in the next quarter century.

An excellent pictorial summary by Don Paragon about evolution of mankind and man made society.

Sun's vision of the future of programming- a nice compilation and commentary on how programming might look like in future!

Let me be honest; I am still biased towards Java :-). Here is a link, that has Q&A type information on future of Java.

Look at Future Web Technology. Don't sulk and hide your face if you find it Greek and Latin! Here is a more palatable version from W3C.

IRCTC starts Tatkal booking

Tatkal Booking now available online and scope of e-Tickets extended to cover all superfast trains including Rajdhanis and Shatabdi.

Way to go, IR!

Wednesday, January 04, 2006

Programmer's Bookshelf

Here are some of my personal favorites, found missing in this Programmer's Book Shelf :-(
Stay tuned, I will add my reviews and opinions about these books. Till then, learn how to be a programmer, know about history's worst software bugs and, check out what skills are hot in 2006.

Tuesday, January 03, 2006

Just back from a Training

It was all about UML and OOAD. My employer sponsored me and also granted three days away from the work to attend this program. Following broad areas were covered during the course of this program.
  • Using UML to model static and dynamic aspects of a system
  • Class and Object identification and their inter-relationship
  • Realizing Use Cases of a System
  • Migrating from Analysis to Design of a System
Ah! After a very long time I have attended such a training, where, each and every session was interesting and full of information. At the end, I have some tangible takeaways too. It helped me refresh my UML and OOAD knowledge and bolstered my faith in profoundness of these golden principles:
  • Encapsulate what might change
  • Design by Contract
  • Liskov Substitution Principle
  • Open Close Principle
  • Class with Single Responsibility
  • Favour Composition over Inheritance
  • Program to Interface than Implementation
  • Dependency Inversion
I am equipped better now, I feel. Henceforth, everytime I sit back to design, these golden rules would be my pathfinder in the maze of software systems.

What a great way to shutdown 2005 and boot into 2006!