Domain Name Malfunction :-)

All of the following are legitimate companies that didn’t spend quite enough time considering how their online names might appear…and be misread.

These are not made up. Check them out yourself!

  1. “Who Represents” is where you can find the name of the agent that represents any celebrity.  Their Web site iswww.whorepresents.com
  2. Experts Exchange is a knowledge base where programmers can exchange advice and views at  www.expertsexchange.com
  3. Looking for a pen? Look no further than Pen Island at www.penisland.net
  4. Need a therapist? Try Therapist Finder at www.therapistfinder.com
  5. There’s the Italian Power Generator company, www.powergenitalia.com
  6. And don’t forget the Mole Station Native Nursery in New South Wales http://www.molestationnursery.com/
  7. If you’re looking for IP computer software, there’s always http://www.iPanywhere.com/
  8. The First Cumming Methodist Church Web site is   www.cummingfirst.com
  9. And the designers at Speed of Art await you at their wacky Web site, http://www.speedofart.com/

XML Data Truncated with SqlDatareader

I was working on XML feeds for my site and found a strange problem.

The XML returned by the SP was getting truncated. After ‘googling’ for a while, I found this on MSDN:
The XML data row is truncated at 2,033 characters when you use the SqlDataReader object

When you read Extensible Markup Language (XML) data from Microsoft SQL Server by using the SqlDataReader object, the XML in the first column of the first row is truncated at 2,033 characters. You expect all of the contents of the XML data to be contained in a single row and column.

This was exactly my problem. I found the solution as well. The solution is to use  ExecuteXmlReader  instead of SqlDataReader .

 

You can see the detailed articles here and here.

 

Impact of Job Change

A taxi passenger tapped the driver on the shoulder to ask him a question. The driver screamed, lost control of the car, nearly hit a bus, went up on the footpath, and stopped few centimeters from a shop window.

For a second everything went quiet in the cab, and then the driver said: “Look mate, don’t ever do that again. You scared the daylights out of me!”.

The passenger apologized and said, “I didn’t realize that a little tap would scare you so much.”

The driver replied, “Sorry, it’s not really your fault. Today is my first day as a cab driver – I’ve been driving a van carrying dead Bodies for the last 25 years…

3 Engineer Jokes

1

Two engineering students were walking across campus when one said, “Where did you get such a great bike?”

The second engineer replied, “Well, I was walking along yesterday minding my own business when a beautiful woman rode up on this bike. She threw the bike to the ground, took off all her clothes and said, “Take what you want.”

“The second engineer nodded approvingly, “Good choice; the clothes probably wouldn’t have fit.”

2

An architect, an artist and an engineer were discussing whether it was better to spend time with the wife or a mistress.

The architect said he enjoyed time with his wife, building a solid foundation for an enduring relationship. The artist said he enjoyed time with his mistress, because of the passion and mystery he found there. The engineer said, “I like both.” “Both?” Engineer: “Yeah.

If you have a wife and a mistress, they will each assume you are spending time with the other woman, and you can go to the lab and get some work done.”

3

A pastor, a doctor and an engineer were waiting one morning for a particularly slow group of golfers.

The engineer fumed, “What’s with these guys? We must have been waiting for 15 minutes!”

The doctor chimed in, “I don’t know, but I’ve never seen such ineptitude! ”

The pastor said, “Hey, here comes the greens-keeper. Let’s have a word with him.” [dramatic pause]”Hi George. Say, what’s with that group ahead of us? They’re rather slow, aren’t they?”

The greens-keeper replied, “Oh, yes, that’s a group of blind fire-fighters. They lost their sight saving our clubhouse from a fire last year, so we always let them play for free anytime.” The group was silent for a moment.

The pastor said, “That’s so sad. I think I will say a special prayer for them tonight.”

The doctor said, “Good idea. And I’m going to contact my ophthalmologist buddy and see if there’s anything he can do for them.”

The engineer said, “Why can’t these guys play at night?”

Why NULL equals NULL is False

NULL has a special meaning. This was created to fulfill the need of having a character, that means ’nothing’ and it equals ’nothing’. So, it doesn’t even equal itself. Suppose, you have a column named ’PRICE’ in your table with datatype ‘money’. For a particular product, you don’t have data for price. How would you store it? Store a zero? But that would mean that the product is free!

Consider another scenario. You have a table, where you store the comments written by visitors on your site. Whenever a comment is written, you have to either approve it or disapprove it. If you disapprove, a ‘sorry’ mail is sent, if you approve, that comment is shown on your site, and a ‘thank you’ mail is sent. In this case, what would be the value of the column ‘approved’ initially?

Above two cases make a good case for storing a NULL.

Now the problem, how would you search for NULL in your query? The obvious answer would be to use something like:

select * from sometable where somecolumn=NULL

But above will NOT work. The reason is NULL is a special character and it equals nothing, not even it self. So, the solution to this problem is the IS NULL operator:

select * from sometable where somecolumn IS NULL

This works perfectly. Another solution is to set ANSI_NULLS to off:

This will work fine as well. The reason for this is compliance to SQL-92 standards. When you set ANSI_NULLS to off, you are actually turning off the compliance to SQL-92 standards. Read more about it here.

Happy Coding!

View Page Source When Right-Click is Disabled with Wizton

Migrating from old blog.
Orignially Posted: 04 Oct, 2007

There are instances the page uses frames, and you want to view the page source. If you do View > Source, it will not show you the source of the page that you want to view, but only the container page. You could right click and say view source, but then there are certain sites which have disabled right click using javascript. What would you do then?

Solution: Use Maxthon browser.

In the bottom right of the browser, you will see a button that says “Force Open Links in New Tabs”.

Before clicking a link, that will opens the page in the frame, click this button. Now the pages will open in a new tab. (You can turn it off later if it is irritating). You will have the page opened in a new tab without frames. Now you can always use the View > Source menu option.

Simple but useful tip I would say.