Wednesday, November 08, 2006

i like like

Turn around for a moment and the world changes around you.

the brilliant guys from Riya have just release like.com. Its a visual search engine. Completely mindblowing. Searching for "blues suede shoes" pops up the following
Lacoste - roxbury nubuck (p...
Puma women's roma nubuck
Red wing rowan (women's) - ...
Puma women's roma nubuck

And no .. this isnt anything like google's image search. Cause the same search got me

blue-suede-shoes.jpg
150 x 150 pixels - 8k - jpg
www.quotenet.nl
... singing about in Blue Suede Shoes
650 x 752 pixels - 59k - jpg
www.shraderbootmaker.com
Blue Suede Shoes
459 x 422 pixels - 49k - jpg
www.emblibrary.com
... Blue Suede Shoes; Hound Dog; ...
200 x 200 pixels - 13k - jpg
www.cd.edirectory.co.uk
Blue Suede Shoes: Elvis Songs for ...
200 x 200 pixels - 17k - jpg
www.artistdirect.com

Tuesday, November 07, 2006

find of the week ..

the hilarious Bill Maher and his new rules

a preview -

New Rule: President Bush has to stop saying that, "before 9/11, we thought oceans could protect us." No, we didn't. Maybe in your world, the oceans were like America's moat—and you were king, and Condie was a Nubian princess. But in our world, we knew that our enemies, evil though they may be, had figured out boats and flying machines.

New Rule, and this one is for the kids: Kids, if you're going to bring cocaine to class, make sure you bring enough for everyone. This week, a second-grader in Philadelphia brought 18 bags of cocaine to school and passed it around. Boy, there's a switch. Going in the sandbox and getting "crack in your sand." Then at recess, one kid tried to fly a kite, but he'd done so much blow, he couldn't get it up.

New Rule: Hey, wild girls, when you're taking your shirt off, you don't have to stick your tongue out to prove you're fun! You're taking your shirt off. That's all the fun we need.

New Rule: When President Bush meets an autistic teenager, they must wear name tags so we can tell them apart.

New Rule: Bluetooth headset users have to do something that lets me know you're just on the phone and not a dangerous schizophrenic. Right? We don't know if you're talking to your secretary or the evil leprechaun who lives in your head. You're not the chief communications officer of the Starship Enterprise. You're a shoe salesman asking your mom if you can bring over your laundry. If I wanted to overhear every tedious scrap of brain static rattling around in your head, I'd read your blog.

New Rule: The Olympics must stop putting on opening ceremonies that make me wonder if someone slipped acid into my drink. I tell you, you watch four hours of skaters with flaming torch helmets racing around interpretive dancers dressed in camouflage condoms, all while people in lederhosen play sixty-foot trombones.

New Rule: Stop worrying that the government is listening in on your phone conversation. The person you called isn't even listening to your phone conversation. Any American in this day and age who thinks they're not being monitored is so naive and oblivious, I can't believe they're not working already for the Bush Administration.


Sunday, November 05, 2006

NO thanks for all the phish

got a mail from paypal.com asking me to update my details. My paranoia compelled me to examine the mailing address a little more carefully. Aha - it was "<service@paypai.com>"

Now, personally i don't like paying pais' any money.

The link they provided was the one shown below (DON'T click on this)

https://www.paypal.com/cgi-bin/webscr?cmd=_login-run

For the uninitiated in the art of html programming, and element / text on a page is marked as a clickable link (hyperlink) by surrounding it with the &lt;a> tag. the href property of the tag provides the url (address). What these guys had done was play a subtle trick. The element is a valid paypal url, but the linking attribute underneath it is a phishing site.

This is what the html code for it looks like
&lt;a href="http://www.artcolordigital.com/galeria/ptest/">https://www.paypal.com/cgi-bin/webscr?cmd=_login-run&lt;
/a>

I tried going to the link using FireFox, but it immediately threw up a phishing attack warning. Impressive!




IE6 though let me through very easily, and this is what came up on my screen



notice the address bar on the top highlighted in red ? well - thats not your ie address bar - its a part of this cleverly crafted page. The actual address bar is hidden by the fake page.

Well, if the target has been lured this far, he'll probably even sign in ( any user name password combination works - you are in). Next, credit card details are taken. The final step is the beauty - after clicking on "Save" on the credit card details page, they redirect you to an actual paypal.com error page. and that's it. Most people won't even realize that they had been phished.

Among the phishing attacks i have seen, this is one of the better ones. It relies on all the standard magic tricks - redirection, subtlety and speed. Before you even think, you are back to the original paypal site. the only thing that was missing from the attack was making it work using SSL.

Firefox2 does a check against known phishing sites, and so does IE7 . In addition, IE7 also does

"Address Bar Protection -- To help block malicious sites from emulating trusted sites, every window, regardless of whether it is a pop-up or standard window, will present an Address bar to users."

phishers, back to you. let me give you a hint - AJAX !

Wednesday, October 25, 2006

stumbling over the EntLib blocks

just when i had thought that 1.1 to 2.0 migration was going to be done within a week, I stumble upon the Enterprise Library application blocks migration from the June 2005 (.Net 1.1) to January 2006 (2.0).

The first approach i took was to replace all the assemblies with their 2006 version ans get rid of any obsolete ones ( e.g Configuration.dll ) - This completely wrecked the build. So now, I'm going to take up the migration assembly by assembly... slooow and careful, just as recommended

Microsoft.Practices.EnterpriseLibrary.Common
replaced the 1.1 version with the 2.0 version, Cleaned solution, Re-built;

Errors-
The name 'ArgumentValidation' does not exist in the current context

Fire up Lutz's reflector and notice that not only ArgumentValidation, but thenamespace it used to reide is gone in this release.




Fine, i'm not going to do any argumentvalidation. It was a sort of "nice to have" in any case . No complaints. Just commented out the offending statements. Build succeeded.

Microsoft.Practices.EnterpriseLibrary.Data.dll
replaced the 1.1 version with the 2.0 version, Cleaned solution, Re-built;

Errors -
The type or namespace name 'DBCommandWrapper' could not be found (are you missing a using directive or an assembly reference?

Ahh, so thats gone too ?

As per documentation, the replacement for this is System.Data.Common.DbCommand. And here is the example

Original Code

Database db = DatabaseFactory.CreateDatabase();
DBCommandWrapper dbCommand = db.GetStoredProcCommandWrapper("GetProductsByCategory");
dbCommand.AddInParameter("CategoryID", DbType.Int32, Category);
DataSet productDataSet = db.ExecuteDataSet(dbCommand);

Modify to

Database db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("GetProductsByCategory");
db.AddInParameter(dbCommand , "CategoryID", DbType.Int32, Category);
DataSet productDataSet = db.ExecuteDataSet(dbCommand);


Take a close look - yes, you got it - Now to add in parameters you require both Database + DbCommand. So it is not going to be a straightforward replacement.

The application i'm migrating has literally thousands of calls to DbCommandWrapper.AddInParamater. Worse still these calls are made through another static Helper class, that does some business validations before actually calling AddInParameter on the DbcommandWrapper. And obviously, the Database object is not passed into it.

A typical signature for the helper function looks like

public static void AddStringInParameter( DBCommandWrapper cw, string parameterName, string parameterValue)
{
if ( null == cw )
return;

cw.AddInParameter( parameterName, DbType.String);

if ( null != parameterValue &&amp;amp;amp;amp;amp;amp;amp; parameterValue.Length>0 && NotAvailable.sNA != parameterValue)
cw.SetParameterValue( parameterName, parameterValue);
}

So this is a huge problem now. With this static helper class being used liberally all through the application, method parameter modification is not feasible. Manually repairing the code to pass in the Database object into such functions is also not an options just beacuse of the sheer number of times it is used ( >5K calls ).

At this point i realize that my basic need to Add parameters without needing Database object is essential to a painless migration.

Luckily, the internal implementation of DbCommand still allows the addition of parameters using the Parameters collection and without the need for a Database object. In addtion&nbsp; DbCommandWrapper was very useful in hiding the complexity of CreatePararamter and Parameters.Add() by exposing the AddInParameter function family.

Now the functionality is exposed on the Database class; which is puzzling; as it could have been very easily implemented in the DbCommand class. Maybe a question for Tom.

So anyway, I decided to nick the code for DbCommandWrapper from the original Entlib (1.1) code. This would solve 3 problems- 1) obviously it would re-instate the class and make all the references valid again; 2) It would allow me to add parameters the way i was used to - without the database object. 3) at the same time keep the migration issues internal to the Wrapper class.

Hopefully, this would work with a few well-aimed hacks. And it did - just beautifully.

I copied the class code files exactly as they were into my namespace. This got rid of the original DbcommandWrapper not found errors. I then applied a few hacks on these Wrappers -

  • The original OracleCommandWrapper (OCW) is a concrete implementation of the (abstract) DbCommandWrapper (DbCW) ; In addition DbCW has a private mustoverride member IDbCommand, which OCW overrrides with OracleCommand . Changed IDbCommandrresponding DbCommand in System.Data 2.0.
  • Created a new constructor that accepted DbCommand, and got rid of the other constructors. This means that the new wrappers now are "Real" wrappers, in the sense that they don't have ability to create the DbCommand internally. Retaining the code to create the command, would have meant pulling in more source from the EntLib. I decided to avoid this.

so far so good - The DbcommandWrapper has re-incarnated and the AddParamter family of references are also now available. The code fit back into the jigsaw again.

unfortunately, I could not protect all of my code, but at least the further changes could be done by intelligent search and replace operations
  • System.Data.Database in the 2.0 versions replaces the EntLib.Database and it has no awareness of a DbCommandWrapper. So all the references to Database.Get[]Wrapper functions are no longer valid. These are all Database.Get[]Command functions now. Well, with what i consider a stroke of pre-science, we had decided to wrap the Database class with a custom DatabaseWrapper class that would hide (almost) all functionality of the Database class. Facading paid off ! In fact, the code broke exactly where we had been to lazy to facade some workings of the EntLib - Lesson learnt.
  • All the IDbConnection, IDbTransaction, and IDbCommand reference had to be updated to the new classes from System.Data.Common namespace equivalents - DbConnection, DbTransaction, DbCommand.i>
  • Database.GetConnection() has been replaced by Database.CreateConnection() . Search and replace.
The search and replace operation took about 15 mins.
>
Ahhh - no compile errors . The code is fitting in snug and tight -no ugly patches required. Life is good again .


... to be continued. Next migrating the Configuration block

kick it on DotNetKicks.com

communism is alive ..

and its being promoted by the company that wants to do no evil. In fact they are now allowing you to build your own search engine and make money off it.

Google Co-op

I haven't had the time to play around with it, but the concept is exciting. Vik Singh has an in-depth article on Google's shining new baby.

Got any ideas?

Sunday, October 22, 2006

Head Hunt

The past week, I've had to to conduct few interviews. We are looking for Senior Software Engineers in .Net domain. The cut-off due to practical limitations is at least 4 years of technical experience with relevant technologies, and we usually want someone having worked hands-on on .Net for a couple of years. Our team is a relatively small team, where we cannot afford to just coders on deck. The candidates would have to be skilled enough to dig into a problem and solve it.

I was sorely disappointed by the quality of candidates we had to look through - and this is after the resumes were filtered by HR (hmmm .. another post about this later ). And this is not me alone - discussion with colleagues, made me realize that everyone had the same problem.

After about 15-20 interviews in my career, I have more or less, settled down on a technique, which i believe helps me filter out the the anti-workers and get in some deserving people with good technical knowledge.


Resume Analysis
  • Stability - Especially in Bangalore, you have an overload of candidates that keep jumping from company to company every year. Not only is this not good for the team in terms of ROI - this also means that most likely the person has never even had the opportunity to get down into development issues like deployment, maintenance. Rule of thumb - jumping jobs in less than 2 years - no no.
  • Roles - Most people in the industry are only too willing to jump on to the management wagon after a few years of technical work. Avoid them - they won't care about technology. The way to spot this is look for key-words like - coordinator, on site, trainer, documentation, manuals, client-interaction, processes, CMM; Many of us have performed some of these roles at some point - but i really don't like emphasizing them on my resume. So use your judgement, and try and figure out what the candidate is trying to emphasize.
  • Graduation Scores / Courses / Certifications - I completely ignore this section. This does not even matter for freshers. I can attest to this from my modest performance in these areas :D
  • Email address: what self respecting techie would have a hotmail / AOL id ? :D - All right this point is debatable, but definitely avoid guys who have addresses ending in xxx.com
The Interview

Keep it informal. If possible, shift the interview out to more relaxed settings like a coffee shop. I would not want to reject a good candidate just because he had jitters due to your interview style. Remember that your company wants a good candidate almost as desperately as he wants a job. If in Bangalore, even more so.

I've found that fairest way of conducting a technical interview is to discuss projects listed on the resume. Convert one or more of the projects on the candidate's resume into a case study. That way you cover areas which the candidate is familiar with, and can analyse his / her understanding of their work. It also gives insights into the amount of interest the person has in the work.

  • Do ask the candidate to explain and justify the high / low level architecture and design of projects worked on. Judge on clarity of understanding and clarity of thought. Grill hard on this, as intellectual curiosity in an employee is an essential requirement.
  • Do get down into the details of any module the candidate has worked extensively on. Ask for details on the why and the how of the module. In addition to proving his understanding, in many cases it also sifts out the misrepresentations of role in a project.
  • Do describe a problem in the module, and see how the candidate works out a solution for it.
  • Don't restrict the interview the technologies you are familiar with; Even listening out the candidate's understanding of a completely irrelevant technology offers enough insight into the his thought process and comfort level with all things technical.
  • Do try and gauge how well the candidate tries to keep up with current technology trends in his domain. For this, you must also be well aware of whats happening. For example, an impressive candidate I interviewed was right on the mark with the release of AJAX 1.0 Beta, 3 days after the event.
  • Don't pay any attention to correct mannerisms, dress-style, grammatical mistakes etc. These are peacock feathers more suited to the, well, well-suited corporate bored-room environment. Allow techies the freedom to be as ugly and smelly as they (we) want - That's why we chose to spend our lives with computers instead of humans.
  • Above all, getting into details of framework libraries is pointless. With .Net and Java technologies especially so, as these are HUGE. Rather, concentrate on the in-depth understanding of namespaces he has already worked upon and basic concepts. Everything else, all of us google anyway.
  • Building upon the previous point, make your questions essay style that allow for you to branch off on interesting topics. Branching off from the questions is great - it makes things more comfortable. For example (ASP.Net) start off the request cycle - branch into session implementations - discuss differences between session /cache - again pick up caching strategies- come back to HttpModules -continue upon ASP.Net Page Life cycle - dig into viewstate. Having discussion with context makes the interview well-connected and free flowing. Avoid staccato Drill-Sergeant type questions.
  • Do touch upon tools of the trade - Most of us don't write out code in notepad. If Visual Studio is the tool, check out familiarity with advanced debugging options. Efficient coders optimize their output with the tools used on a day to day basis.

Sneaky Tricks to filter out the Evil Coder Hacks (ECHs) : You don't want the blind cutter-pasters around, do you ? Infosys and Wipro might, but any non-suicidal team would steer away from the multitude of brain dead coders who nevertheless are skilled enough to pass interviews. Here are some tips / tricks to catch these guys out.

  • Standard Questions: Google for interview questions and pick them off from the first page. Most of our Evil Coder Hacks (ECHs) will have the answers down pat. Add some twisters to these and see how well they fare. For ex: What are the 3 types of Session state options in .Net: Everyone will know - Inproc, State Server, and SQL Server. Now add the twister - What are the serialization requirements for each of these ? ECHs stopped by the door
  • Telephonic Interviews: Open up google and a couple of other search engines. Ask a question and simultaneously search for it- check if the answers from the other end of the line have an uncanny resemblance to whats on your screen !
  • Familiar error messages: Have screen shots of some standard and not-do standard error message with you. Show these and ask the candidate to analyse these and explain the situations these might occur in. Every good programmer has a data bank of error screens in his head, and this is something that only comes with hands-on experience. ( Recall the message when you forget to configure your virtual directory as an application, and its web.config has Authorization related tags )
In summary, Discuss, don't interview. Respect all candidates; Try and recall shabby interviews you attended that didn't give you a chance to show your strengths - Don't do this to others. Interviewing is a skill like any other - think about it; work on it; improve. Don't view it as a invasion into your busy day.

I hope this helps you keep the bad ones out and get the good ones in. I'll try and keep this post a live one and make additions / modifications as and when i think of them.

Cheers

Wednesday, October 18, 2006

the nokia 5500


As most of you know, I lost 2 mobiles within the space of a week - Since then, I worked out the theory that I subconsciously wanted to lose them because there was my true handset lying in wait for me - And surprisingly enough, the very week I lost these phones, the Nokia 5500 was released in India. Hallelujah - Its fate; karma; and its sporty !!


It has all the features of a N-72, but nokia spared the ugliness. AND its cheaper by a bit. Here are some reviews

Pope uses Nokia 5500 to solve middle-east crisis
Nokia 5500 makes man stallion in bed

and it goes on. Worth the 15k ?