Monthly Archives: December 2007

Selling A House On Amazon!

Check out this Home Listing On Amazon!

Call it marketing technique or desperation. The description of the listing goes

Product Description
SHORT SALE!! Owe bank $292,994.. Hardship, pre-foreclosure. Resort Living with Pools, Spa, and Tennis located in Mountain View Gated Community”. The best house available. Buyer to pay closing cost. Patio Cover in back yard. Large Corner Lot. Panoramic View of Mountains. Newer home. Comparables from $380 – $412 K. Next to Golf Course. North of Mission Lakes Blvd. 9 Miles to Palm Springs. Upgraded galore Beds: 3 Baths: 2 Sq. Ft.: 1,500 $/Sq. Ft.: $195 Lot Size: 7,900 sq. ft. Property Type: Single Family Residential Detached Year Built: 2006 Stories: One Level View: Mountain Area: Desert Hot Springs Subdivision: Mountain View Country Estates County: Riverside MLS#: 41294751 Additional Rooms * Master Suite * Living Room * Breakfast Counter/Bar * Breakfast Nook Flooring Information * Ceramic Tile * Wall-to-Wall Carpet Water & Sewer Information * District Water Source * Front Sprinklers Only * Auto Timer for Sprinklers * Sewer Connected & Paid Pool & Spa Information * Has Pool * Community Pool * Has Spa * Community Spa Interior Features * Window Blinds Property Information * Has Yard * CC&R’s * Gated Community * Land: Fee School Information * School District: Palm Springs Unified Fireplace Information * Has Fireplace * In Living Room Appliances Included * Dishwasher * Garbage Disposal * Microwave * Built-In Gas Building Information * Direct Garage Access * Main Floor Master Bedroom * Concrete Tile Roof * Square Footage Source: Seller Patio Information * Has Patio * Concrete Slab Patio Lot Information * APN: 661470021 * Lot #: 310

It can’t be a joke since Amazon actually assigned an ASIN (Amazon Store Item Number?) for this house and it’s B00106CN44.

I can already imagine mashups between and with all the MLS listings!

Now how do you like creating a Wishlist for houses, My Favorites for Houses, a Listmania, A deals widget for Houses, an Omakase (contextual) links and may be even recommendations based on your past purchase history (of houses or other things on Amazon)! Or may be even a donations widget asking people to fund your favorite home.

Right now it seems to be a 3rd party seller’s listing. Now, imagine if Amazon were to enter into a real estate brokering business. Using it’s dynamic price optimization, you would see one price and someone else a different price, give or take a few thousands of dollars!

And all of a sudden you get New Homes, Used Homes and Like-New homes. If a roof is newly done or a kitchen is remodeled, then it could even go as a “Refurbished Home”! Of course, there is no packaging with UPC code that has to be sent to get a manufacturer’s rebate. Practically, everything that Amazon does with it’s products, I am imagining how it goes with a house listing!

Here is the best thing, some kid puts a home in the shopping cart and a day later the rich dad with no credit limit tries to buy a book using One-Click and guess what, “Honey, the monthly credit-bill this month came to a million plus, what did you buy?” Just kidding!

Leave a comment

Filed under, Home Selling, Realestate, Zillow

JavaScript Performance Tuning

Most server-side programming languages have tools to do performance tuning on applications written in them. With the popularity of AJAX based applications and other rich-client HTML applications on the rise, more and more code is being written in JavaScript. So, how the heck do you go about troubleshooting performance issues for these type of client-side heavy applications written in JavaScript?

I faced this issue recently in two different applications where the Javascript library was not performing fast enough causing tardy user experience. I figured out that Firebug is an extension for Firefox that can be used to do the performance tuning. The way this works is,

a) install Firebug (and restart the Firefox browser)
b) enable Firebug if not currently enabled
c) load the page that needs performance tuning
d) open up Firebug and in the console, click on Profile
e) start using the UI controls in the page that have performance problem
f) Click on the profile and see a table of all the function calls ordered by the amount of time spent

This gives you an idea of the functions that are slow. The granularity of this report is only by function (thought it would have been good if there is a way to have line level granularity for some hot-spot functions to pin-point the line number). From this, it’s possible to figure out what’s going on and go about optimizing. In my specific cases, the two things I had to do one in each app are

1) Remove regular expression object creation and comparing from an inner loop
2) Reduce the number of Math.round calls

The performance gain in case of 1) was significantly high.

Leave a comment

Filed under Firebug, javascript, JavaScript Performance, performance tuning

Amazon SimpleDB, Text Indexing, BitMap Indexes

Today I just came to know about Amazon SimpleDB webservices from slashdot. Read the documentation which didn’t really give details about the internals of this technology. So, using my knowledge of information retrieval and databases, I am going to do a few comparisons. First some terminology,

Amazon SimpleDB => Databases
Domains => Tables
Items => Records
Attributes => Columns

A few key differences are

1) there is no need to define the data type of the attribute. This is because, the storage mechanism is mostly inverse indexing treating each value as a token.
2) values of an attribute can be both a string and a number. The token logic goes for this as well.
3) an attribute can have multiple values. Some databases like Oracle support user defined data types and varrays making it possible to capture multiple values.
4) different items can have different attributes. However, the doc indicates “256 total attribute name-value pairs per item”. It wasn’t clear if the union of all attributes across the items in a domain is 256 or for each item individually it is 256 (but much more across items). If it’s across the items, then this is no different than having a static table with 256 character columns and using a bit-map index on all of them.

Bitmap indexes are extremely fast. They work best when the ratio of the distinct set of values to the total records is low (fewer distinct values). Due to their vector storage nature, the query criteria are resolved individually (unlike in case of other types of indexes where either nested-loops, hash-join or merge-join is used), which is nothing but just fetching the index which is a vector and set-operations are performed on the bit vectors. This works well for “=” operator.

For example, there are a million records of people and Gender is indexed as a bit-map index, then getting the list of all the Males in this set of population is no more than loading the bitmap vector and picking all the records whose bits are set to 1. The “!=” operator is also not hard to implement it.

Dealing with numeric types and the related operators such as >= and and < is a bit expensive. The way it works is, the distinct values possible between the specified range and available among the distinct indexed values is identified and for each of these values, the index is loaded and a set union operation is performed. Though, a CBO database may be smart enough to go directly for a FTS (Full Table Scan) than loading all the indexes and then resolving the table.

From the SimpleDB documentation which mentions

“# Positive integers should be zero-padded to match the largest number of digits in your data set. For example, if the largest number you are planning to use in a range is 1,000,000, every number that you store in SimpleDB should be zero-padded to at least 7 digits. You would store 25 as 0000025, 4597 as 0004597, and so on.

# Negative integers should be offset and turned into positive numbers and zero-padded. For example, if the smallest negative integer in your data set is -500, your application should add at least 500 to every number that you store. This ensures that every number is now positive and enables you to use the zero-padding technique.”

it appears that the SimpleDB has been optimized to deal with constant-length positive numbers represented as string tokens. This is perhaps understandable since this technology, most likely developed to support Amazon’s highly scalable product catalog has most numeric attributes that are only positive (I mean, when was the last time you got an item at a -ve price? I once did after the manufacturer rebate and the retailer rebate both got cleared for an item).

Leave a comment

Filed under Amazon SimpleDB, BitMap Indexes, SimpleDB, Text Indexing

Sleek Online Open Source Charting/Graphing

I came to know recently about Open Flash Chart an excellent solution for online charting. I liked the Sketch Style Charts.

1 Comment

Filed under Online Charts

Implementing Sessionless Captcha Verification

I saw a project request to implement sessionless captcha verification. In blink of a second I thought, sounds like a dumb request, if there is no session, then the data has to be carried along with the html form that gets posted and if so, a clever program can pick up the value and submit it. Then, in the second blink, I formulated that this can be done using a two-way encryption. Essentially, generate a random word(s) on the server side, two-way encrypt it and then put the encrypted string in the form as a hidden variable. In addition, provide the encrypted string in the image url that gets generated dynamically. The image request can decode the string and then render the captcha image. When the user submits the value, the form contains the user’s value and the encrypted value which can be confirmed on the server.


Filed under CAPTCHA