Archive for the 'General' Category

Tim Schafer is a genious

A person whose mind is behind the Excellent Game Psychonauts and all that other Grim-Throttle-Tentacle games is a one hilarious genius. There. Just wanted to say this after finishing Psychonauts.

On a completely unrelated note: yes, we are late with our long-awaited traffic monitoring software. But fear not. The product is actually ready and we just need one more week to polish things up, particularly, finish with the 60+ pages user guide.

Who said creating and selling software products is fun-n-easy? People, get real — this is hard work!

PHP key generator for ShareIt

We are currently working in a “death march” mode in order to launch our new site, Stuffed Tracker 2.0 and Stuffed Sync on the 1st of September. Also we are going to launch a new sales system, integrated with our payment-taking partner ShareIt.

The integration is quite simple actually — whenever a customer pays for our product, ShareIt’s own keygen server should make a POST request to our script to get the key (which is just a short text string in our case) that will be presented to the customer at the end of the payment process. This whole process is described in the SDK that you can download from ShareIt if you are a registered author in their system.

I’ve already done this integration before, but I’ve used Perl back then. The new version of our sales system is built with PHP. And unexpectedly we’ve got a big problem because of this yesterday. I’ve actually had to spend the whole day on fixing it, instead of doing other important things.

So, to save time for someone who might also want to use PHP to write a keygen for ShareIt, here is the whole story.

In order to install a new keygen for a particular product in ShareIt’s system, you need to write them an email, in which you should specify the URL of your keygen. Then they use a special tool, called KeyTest.exe (provided with their SDK), to check that your keygen is actually working. This tool is quite simple; it just submits several test values to your keygen via a POST request and then displays the response.

So we’ve got stuck on this testing phase yesterday. We’ve manually tested our keygen with several POST requests containing the required fields that ShareIt should provide to us and everything worked perfectly. So we happily submitted the keygen to ShareIt and quite soon got a response from them that our keygen is not working in their “test environment” (which is their slang for this KeyTest.exe tool).

This was a surprise to us, but we really haven’t tested our keygen using KeyTest.exe up to this moment. So we’ve launching this tool and tried to submit a test POST request to our keygen with it. And it didn’t work just as ShareIt has told us.

Here is the most interesting thing: after we’ve started debugging our script, we’ve quickly realized that PHP doesn’t populate $_POST or $_REQUEST variables when KeyTest.exe makes its request. Yes, that’s right — we’ve got nothing in these variables, just as if no parameters were submitted at all.

It was quite strange, to say the least. Obviously ShareIt uses this tool to test keygens everyday and they should have noticed that it doesn’t submit any parameters in its POST requests. So we’ve continued digging deeper.

I’ve opened up Ethereal (which is a great network traffic monitoring tool, btw) and started capturing TCP traffic during KeyTest.exe POST requests. And immediately I’ve found the problem – KeyTest.exe wasn’t specifying Content-Type with its request, so PHP didn’t know how to handle the data submitted via POST.

Thankfully, in cases like this, PHP creates a special variable called $HTTP_RAW_POST_DATA in which it stores all data that was passed to it in the POST request (basically everything it gets from STDIN). And, lo and behold, we’ve found the missing parameters there. It was trivial after this to make our keygen work with ShareIt’s KeyTest.exe tool.

But our problems were not over yet. We’ve wrote a new email to ShareIt saying that we’ve finally made our keygen work. But in their response ShareIt told us that the keygen still doesn’t work.

What the hell, we thought and looked again at the values that KeyTest.exe submits. For some reason one parameter called PURCHASE_ID was specified as equal to 0. We had a test in our keygen that specifically tested that this parameter is not 0; if it was, then our keygen returned an error.

We’ve added this test because the description of this parameter in the SDK says this: “Type: decimal string representation of an unsigned 32bit integer number > 0” (emphasis is mine).

Not surprisingly any more, after we’ve removed the test for this parameter and sent yet another email to ShareIt, our keygen was finally accepted.

And that’s the happy end of this story. Hope it helps someone.

Priorities and Joel Spolsky

From an interview with Joel Spolsky:

JS: I would never have the chutzpa to say that I have the answer for all teams. However, in most cases, the key thing is to have a constantly-updated, real-time, highly detailed list of features and tasks, with priorities and estimates for each item. Then at any time everybody knows what they should be working on and in what order, and if you have good estimates, you should be able to say “if we do all priority 1 features, we’ll finish on date X, and if we also do priority 2 features, we’ll finish on date Y.” Now it’s a simple matter of setting a date that gets the optimal balance of features and shipping (shipping is a very valuable feature).

This highlights a problem I am currently thinking about in context of the project management system that we develop.

In a perfect world you can easily put a proper prioroty for any task in the project at the same moment when the task is being created. But isn’t a task priority — a relative thing? I mean, a task with the highest priority has this highest priority among all other tasks, no? If another task appears that has a higher priority then a task with the highest priority then what should you do? For some reason, I don’t like the idea of changing priorities of potentially tens if not hundres of tasks just to put a new task at the top.

Another problem with priorities is that you always end up with a lot of tasks having the same priority assigned. How can you decide what task to do or how can you tell a developer (if you are a manager) what task to do, if 20 of them are of the same high priority (or the same normal priority — doesn’t matter)?

So, my current thinking about this is that it is impossible to understand what task a developer has to do next just using the priorities concept. Priorities are good for some general understanding of how important is the task, but that seems to be all.

We have some interesting ideas regarding this issue that we are going to implement in Factory Nova. I don’t want to describe them now, just want to first make sure that they will work out as I expect. More about this later.

Verson Tracker

Is it good to be number 1 result on Google for “verson tracker”?

Ooops. I think not.

On a brighter note, I’ve noticed that particular referrer inside an almost-ready-to-be-called-beta Stuffed Tracker 2.0.

Currently we are testing it with several large and small sites (including ours). It’s functionality is 95% complete, but we are still tweaking the database schemas and SQL statements to make the product work with large amounts of data as efficiently as possible (currently our test database is 160 Mb in size, and grows by around 2.45 Mb a day).

Although Stuffed Tracker has several settings that could be turned on and will prevent it from tracking potentially excessive information, like visitors paths and visitors with unknown referrers — we still want it to be ready for cases when our customer would decide to use it as a general traffic tracker (your own StatCounter anyone?).

Later: Just occured to me — this post has a good chance to become a new number 1 for “verson tracker” with these keywords in the URL and all.

Coincidences

It’s interesting how I am surrounded by coincidences. I wonder if I only notice them because I am usually looking out for them. Does coincidences happen often to you too?

The latest coincidence is that all of us in Stuffed Guys are Leos, all of us were born in August. When I was searching for additional 2 programmers for Stuffed Guys I wasn’t specifically looking for 2 Leos. But after I’ve settled on 2 candidates they both appeared to be Leos!

So now the Leo horoscope affects the fate of the whole company!

Number 3

I like number 3. And it has just occured to me: 3 guys in the company, 3 introductory posts, 3 photos in each post.

We definitely need a 3rd product!

Take a cookie when they’re passed?

I keep thinking about Take a Cookie post by Joe Kraus. There is something wrong with this idea.

What if my mouth already full with the cookies (and my pockets) too? Should I still take the cookie?

What if I am eating a spicy hotdog, should I also take a cookie?

With opportunities in your business you can’t just take every one as a cookie and put them for later use in your pocket. This doesn’t work like that. You should actually work for every opportunity that you take, you can’t work on it later.

In other words, you should not take a cookie unless you are ready to digest it right away. If your stomach is already fully occupied you have to pass it.

Also, this idea doesn’t work well with goal setting, which I believe is a very good thing to do for any business. If you see that chocolate cookies have a greater potential for your business, then vanilla cookies and you decide to concentrate only on chocolate cookies, you shouldn’t take a vanilla one when it is passing you. It will only distract you from your main goal.

Having said that, in the original Joe’s post he is talking about a chain of events that was started by him reading a book and getting in contact with the author, which eventually led to his company getting first funding. In my “cookie” examples above, this situation can be described as taking a chocolate cookie at the moment when you are very hungry.

So, I would rephrase the saying to “Take a cookie when they’re passed if you are hungry” (otherwise pass them to your friends) :).

Joe Kraus is a star

Well, I’ve just discovered Joe Kraus (Excite co-founder) and his excellent blog on entrepreneurship.

Unfortunately Joe posts infrequently, but I’ve just spent an hour or so to read all his posts with all comments. Just coudn’t stop! Last time this happened to me was when I discovered Joel Spolsky several years ago.

Joe’s new company is called Jotspot and they have an interesting Wiki-based product service in beta.

Self extracting web installer

An interesting post by Jeff Moore about how web applications installation could be simplified:

Drag and Drop Web Applications
I think a drag and drop PHP web application should meet the following criteria:

  • Make no requirements for PHP_INI_SYSTEM or PHP_INI_PERDIR configuration.
  • Make no requirements for .htaccess configuration
  • Work with default application level configuration
  • Not require writable filesystem permissions
  • Not require installing external software
  • Not require unarchiving (a wish, i know)
  • Not require obscure PHP modules

I was toying with a Perl self extracting CGI archive long time ago. I was doing this with a colleague. We actually managed to create a working prototype that was able to pack an application inside one CGI file, this file could be run later from a browser, it asked several questions about database parameters and then unpacked everything contained inside of it to proper directories.

I’ve also seen several other implementations of the same idea, even in PHP. In Perl with have a special “__END__” mark that we can place inside a file to tell Perl that this is the end of the code. Perl will also allow us to access everything after the __END__ just as a normal file, so we could do all sort of things that we do with normal files (open, read, etc). In PHP we don’t have __END__, but still the same could be achieved. For example, by enclosing the archive inside a very long comment in a PHP script. It might be required to encode the binary data in the archive as a string (using base64 encoding, for example). So in PHP this is also possible. And we actually considered creating a special installation system for our upcoming products that will be able to pack the whole product in one file and then interactively extract and install it.

But we’ve found out several complications in the concept itself:

  1. Most of PHP web applications have an open source and it is a standard today that a power user of the product could tweak its code easily to match his needs. If we distribute only a self-extracting archive a user would have to first install the product on the server through a web browser and only then he will be able to download the code on his local machine to play with it. Not convenient.
  2. PHP scripts are normally run with the server access rights, because PHP itself is usually installed as a server module. This means that if we will try to extract our product from an archive with a script that is accessed through the browser (as opposed to the shell) we a) might not be able to create directories and files at all on the server, because we won’t have enough rights or b) we might be able to extract everything, but all of the extracted files will belong to the server user — this means that any other PHP script on the same server could easily access them and do something bad. Not good too.

So, considering the above, the self-extracting PHP archive could only be offered as an alternative to a standard distribution (a zip file, that should be unzipped first, then uploaded to the server, then an installation script on the server is launched).

This appears to be a costly alternative (without a ready-to-use solution we will have to create such installer ourselves) and I am not sure right now if it is worth the trouble.

Blogs completely consisting of spam

I am thinking of switching to Plesk on our dedicated server. We are currently using Cpanel which is fine and all, but Plesk’s new interface looks too good to miss.

I’ve decided to find what other people might be saying about Plesk 7.5 Reloaded, so I’ve searched Feedster Blogs for “plesk”. What I’ve got in the results is a complete crap. Pages and pages of what looks like spam messages mostly posted on Blogger-powered blogs. Whole blogs of spam?

Update: After not finding anything interesting on the web about the new Plesk except a very good looking interface that I’ve noticed myself, I’ve decided to stay with Cpanel. Cpanel rocks anyway! :)

Btw, SW Soft, the developer of Plesk has an office in Russia, in Moscow. Actually I believe Plesk is developed in Moscow, at least partly. During my search for Plesk reviews I’ve stumbled upon a blog belonging to a Plesk developer and it was in Russian.