poeticcode

July 1, 2008

Free License For Link

Filed under: SEO, software startup — S @ 11:22 pm

In the pre-Google era no one cared about inbound links. Everyone cared about stuffing keywords within their own pages. That has changed due to PageRank. Companies spend a lot of money on online advertising, search engine optimization, link exchange, link submission, blogging and writing articles and even purchasing links. Some of the practices are frowned upon and potentially penalized while the others are genuine and well rewarded.

Here is a new strategy. What if you offer a “lite” version of your product/service for free with the understanding that the receiving party will link to your website? It would even be possible for those non-paying customers to write their experience with your product/service and make it a genuine backlink with appropriate content. Obviously, it’s not possible to offer this type of a transaction for life, so perhaps doing this limited time till you get enough backlinks that boosts your website to a PageRank of 5 or 6. Sounds like a cool strategy isn’t it?

Well, this bright idea is not mine, I just came across at this website. If you are wondering why would anyone want to do this and not just sell their product but spend money on advertising, obviously the reason is to improve visitors through organic search than paid advertising. In the long run who wants to pay Google or other online advertisers especially if the rates are high in some categories?

June 23, 2008

How Micro ISVs Can Integrate With PayPal

Filed under: PayPal, license management, mISV — S @ 10:14 pm

I came across a question in a forum asking how to deliver license keys to a customer as soon as a payment is made through PayPal. I know that PayPal has the facility to send a user back to a page of your choice after the payment is made. So, I did a bit more research and found that there is a facility called PDT (Payment Data Transfer). Here is how it works. As soon as a payment is made, the transaction id of that payment is returned back to the call back URL on your website where you can give a confirmation message to the user. This call back URL can be a dynamic page (cgi script) that takes the transaction id, makes a call to PayPal and gets additional information about the transaction. The response payload contains, among other things, the name of the customer which can be used to create a custom message and even embed the name into the license keys. But the main purpose of calling Paypal with the transaction id is to ensure that it’s a valid transaction (you don’t want someone faking a transaction id just to get a license). Assuming that the transaction is verified with Paypal, you can just create a license on the fly or a standard license key (depending on how sophisticated your licensing software is) and bundle it along with the rest of the software and just provide a download link. Make sure to keep track of the transaction id and the timing along with the license key id so that you don’t keep regenerating new licenses just in case the customer refreshes the browser a couple of times. Infact, just redirect the original call back page that contains the transaction id so that the user doesn’t even get to see it (I know, such things are not hacker-proof, but doesn’t harm doing it). In addition to giving the same license for a given transaction, make sure to expire a transaction id. If you want to be very cautious, you can just let only one download to happen for a given transaction, but with the internet not working sometimes and what not, it may be a safe bet to let the software downloaded any number of times (but with the same license key for a given transaction) within X minutes (where X is dependent on how big your download file is, the bigger it is, the more time you might want to give just in case the customer’s network is not working properly to download a larger file).

June 16, 2008

Windows Vista SP1 and the 3GB Limit With The 32-bit Version

Filed under: Windows Vista SP1 — S @ 6:05 pm

Recently when I was shopping for a new laptop, I noticed that there were several 3GB Notebooks and initially I didn’t understand why there are 3GB laptops and not just 2GB Notebooks/Laptops or 4GB Notebooks/Laptops.

So, as I was shopping for the laptop and tried learning a few things, came to know that Windows Vista 32-bit edition could only support up to 3GB. That prompted me to go for a 64-bit Windows Vista Home Premium edition. But then, today I was reading the Redmond magazine that talked about Windows Vista SP1 and seems, SP1 now allows a 32-bit Vista OS to support up to 4GB as well. Here is the excerpt from the magazine

“Apparently, this is a limitation in the way the 32-bit version of Vista handles memory (the 64-bit version doesn’t have this issue). It’s no longer an issue, as SP1 fixes the problem and shows you the full amount of memory in your system.” So, no longer frustrations about the missing RAM.

Now, if you are wondering why there is a 4GB limit for a 32-bit machine, the reason is, 2^32 = 2^2 * 2^30 = 4 * (2^10*2^10*2^10) = 4GB. Yup. I already ordered a 64-bit OS since the CPU is Intel Core 2 Duo, which is a 64-bit CPU.

June 12, 2008

PIM - Even The Best Companies Struggle With Data Quality

Filed under: DQ, Data Quality, PIM, Product Catalog — S @ 9:28 pm

PIM stands for Product Information Management. There are applications built specifically to deal with product definition since it is very critical for online retailers to have accurate and comprehensive data so that their visitors can make the right decision. Similarly, it’s also in the best interest of the manufacturers to capture accurate and comprehensive data in a timely manner to provide their upstream supply-chain parters.

My notepad crashed recently so I am trying to shop for a new one. After some research I ended up at HP Pavilion DV6500T Entertainment 15.4″ Notebook PC and the funny thing was, when you go to the Technical Details, it contained the following

” Special Features

* These are the additional features. Yada yada yada. Wuba wuba wuba”

I wonder if this is a funny place-holder TODO text used by the manufacturer (HP), or by the retailer (Amazon.com). Anyway, will be doing more research for HP Laptops.

June 4, 2008

XPath: What about the between operator?

Filed under: XML, XPath — S @ 7:16 pm

XPath 1.0 has following and preceding axes to help you get all the elements after a certain element or all the elements before a certain element. But what if you want all the elements between two elements? I didn’t find any explicit construct in xpath 1.0 specification to do this.

One way to do this is use the following axis and get all the elements after the first element and use the preceding axis and get all the elements before the second element and then find the intersection of these two. Sounds like a good idea, but how to do this using xpath only and no procedural code? So, I searched for the intersection operator and to my delight found this in XPath 2.0 specification, that also contains except and union operators.

But the tools I am working with only support XPath 1.0 and so, I was back to finding a way to do this in XPath 1.0. After a bit of experimentation, came up with the following strategy.

Take a simple XML like

<a><b/><c/><b/><b/><d/><b/><b/></a>

The goal is to get all the b elements between c and d.

  • Using //b, you get 5 <b> elements
  • Using //c/following::b, you get 4 <b> elements
  • Using //d/preceding::b, you get 3 <b> elements
  • Using //c/following::b[following::d] you get 2 <b> elements, the end goal!

Technically, the above solution is not 100% correct as there can be multiple c and d elements, but it’s good enough for my use case. However, the general idea is

first-element-axis/following::desired-elements[following::second-element]

to get the desired behavior of the between axis. I would be curious to hear any other solutions. And BTW, you can verify all this by using the online xpath evaluator, a nice tool to experiment with xpaths.

May 19, 2008

Why I (rarely) Hate Java?

Filed under: Java — S @ 9:41 pm

I have spent a lot of time learning the many libraries of java to hate it actually. I have decent knowledge in perl that I am reluctant to learn other scripting languages like Python. Similarly, if I can write cgi scripts in perl, why learn PHP or Ruby (on rails or otherwise).

I had a strange Out Of Memory Heap exception and after reviewing the code didn’t find anything obvious in the java code that hinted at any memory leak. Then it turns out, my regular expression matching is what is causing the memory problem. That is in turn caused by the String.substring.

If you look at Java source code, in java/lang/String.java, you would notice some comments for the

public String(String string)

implementation. First, why would one want to create a String of another string? Well, here is the reason. Thing is, when you get a substring of a string in java, it doesn’t actually create a separate array to store that substring. Instead, the array of the original string is shared and an offset and length are used to track the substring. This type of implementation is possible in Java because strings are immutable.

So, in my use case, I have been fetching a bunch of large HTML pages and doing some pattern matching and extracting some tokens and keeping them in an array. So, even though they happen to be small tokens within my program and hence my initial code review assuming that I am only consuming very little memory, because those tokens happened to be substrings of the entire html page, the memory consumption turned out to be very high. Actually they are the return values of the javax.util.regex.Matcher.group(1). So, instead of directly adding the return value into the array, I created a string

String token = new String(matcher.group(1));

and then added it. This solved the memory problem.

Granted you don’t need to know about memory management when using Java as there is the garbage collector that takes care of things for you. But now and then, you get into this type of issues that require a little bit more digging (not the social type).

May 14, 2008

Why I like Googlebot and not Yahoo! Slurp

Filed under: Googlebot, Yahoo! slurp, bots — S @ 8:55 pm

If you are a webmaster who monitors your website statistics periodically, you know that there are a bunch of crawlers, mostly from Google and Yahoo! visiting your website. One thing I noticed is that Googlebot typically visits your website from a single ip address at any given day (frequency and ip variation may perhaps depend on the popularity of the website) while Yahoo! slurp visits the site from multiple ip addresses. I think Yahoo! does this perhaps to parallelize their crawling. However, between the option of parallelizing crawling on one site vs multiple sites, the later is probably desirable for a few reasons. One is the fact that the website being crawled will need to expend less resources (think of keepalive, no concurrent crawler connections). The other issue is, if you use a normal web statistics software that doesn’t offer more powerful analytics by filtering out crawling visits, the number of visitors is going to be high if it’s crawled from multiple IPs. Also, the latest visits report on my website’s cpanel groups visits by ip address and as a result, there are too many entries for Yahoo! while there is a consolidated single entry for Googlebot. I wonder if there is a way to specify the max crawlers per bot.

May 7, 2008

Can we hibernate, seriously?

Filed under: Hibernate, MySQL, ORM, Oracle, SQL Tuning, SQLITE, performance tuning — S @ 8:37 pm

I come from, what some may think as an old school, the development environment where a lot of SQL is hand-coded and well tuned. So, to me using a generic framework that can understand the database schema based on some meta-data and automatically translate a generic syntax into the target database is a bit concerning. I have done performance tuning on Oracle, MySQL, SQLite and Derby and my experience had been that, while abstracting the SQL generation such that the same SQL definition can run on all of these databases is probably not that difficult, for anything that’s more serious, such as a complex reporting SQL, not all databases behave the same way with the same form of SQL adjusting a bit for their syntactic differences. For example, check my articles MySQL COUNT DISTINCT vs DISTINCT and COUNT, SQLite Join and Group By vs Group By and Join and Experience with Derby to see how each of these databases required restructuring the SQL statements fundamentally so different, that a generic ORM (object relational mapping) such as Hibernate will not be sufficient for complex SQLs.

Depending on the application, I would say 60 to 80% of the SQLs could be very simple mostly providing the basic CRUD services and can be done using the generic frameworks. But that remaining 20 to 40% is where it may be desirable to hire database experts to hand-tune SQLs.

April 29, 2008

PageRank Up Again

Filed under: poeticcode — S @ 7:55 pm

Today I noticed that my blog is back to PR 5 after a dip to 4 last time. Few of my other websites also had an increase in the PR.

And BTW, with WordPress’s recent introduction of “related links”, the traffic for the blog certainly has increased a bit. Hopefully the increased PR also will improve the traffic further.

April 27, 2008

Should you buy Nokia N810 Internet Tablet?

Filed under: gadget review — S @ 12:37 pm
Tags: ,

I had been using a tablet pc for more than 2yrs and it is from Averatec. So, when I was deciding on buying the Nokia N810 Internet Tablet, I already know some aspects of tablet pcs. I never figured out a way to properly use the stylus and type in the words fluently, so that’s definitely not the reason why I bought it. But there are plenty of other good reasons to buy it and they are listed below

* The form factor. It’s weight is half-a-pound! Anything more would make it painful especially if you want to sleep and browse the web relaxedly.
* It has WPA support so that you can connect it to the internet using my existing Wireless Lan.
* It has a built-in GPS receiver. Yes, it can serve as a GPS unit! So, if you don’t have a standalone GPS unit, then you will get two things in one gadget, albeit at a bit higher price. More about GPS is mentioned below.
* It has a built-in keyboard making it possible to type text rather than using the stylus to do free-form writing or tapping the onscreen keyboard. While the keyboard is not as convenient as your typical full-size keyboard, it is reasonable enough. The keyboard is backlit so when you are typing in the night with lights off when everyone is sleeping, this option comes handy.
* It has a built-in camera and possible to do chatting using Google Talk or Skype (I didn’t get it to install Skype, but it’s possible). Built-in speakers and microphone are there for playing songs and chatting.
* It is based on the maemo linux distribution and comes with Mozilla browser that allows accessing any Web 2.0 websites possible. Possible to watch YouTube videos using the 4.1″ screen which is a bit bigger than an iPhone (it’s everything the iPhone offers less the phone but support for VOIP reduces this gap a bit).
* While the number of apps available to this are limited, if you have several Palm apps already, there is a Palm emulator that makes it possible to run all those 30K+ Palm applications on this device. Heck, it comes with an xterm and you can ssh to rest of your network as well. Depending on how geekish you are, you can run a few linux commands from the xterm and feel good about :). And there is an SDK which makes it possible to satisfy your developer desire if you so wish by writing a few apps.

GPS support with Nokia N810 By default it comes with an application called Map. This doesn’t provide directions and navigation instructions but possible to buy that service for $100+/3yrs price. However, there is a “Maemo Mapper” application that provides the ability to create routes and also voice announcements. What’s best, using the maemo mapper, you can overlay the map with Google Satellite images! For voice announcements to work, you need to also install a library called flite. Few issues I have with GPS are, sometimes it takes a while to get the GPS service to work (There are three options for GPS information within maemo mapper. A bluetooth option which allows to use an external GPS reciever, a /dev/gpsd internal device or a gps server on the network. I initially used the 2nd option but based on reading, it’s possible to use the bluetooth option without specifying any value to it). So, perhaps it’s not as fast as using a dedicated GPS unit (this is not exactly a great concern for me). Also, it tries to do what’s called “Establishing gps fix” which again seems to take a lot of time but didn’t interfere with the ability to start using the map while that is happening. So, overall it seems like an acceptable choice to use it as a GPS device.

Power The N810 battery is BP-4L which comes for about 7hrs of normal usage like listening to songs and web surfing. As I have been running multiple apps at the same time, I never got it to go for 7hrs. If you want to use the device as a GPS unit on a long trip, the battery life becomes critical so having a mobile charger with car adapter is an option. If you are going to the city and want to use the GPS while walking, there is an extra power pack as well.

I think overall, N810 is a good choice at about $400 for those who want a light-weight internet connectivity product which also serves as a GPS unit and is more than your typical PDA.

Next Page »

Blog at WordPress.com.