Software

Can't find what you're looking for? Search the archive!

Track your Adsense trends!

Software

Monitoring your Adsense income can be fun, especially if your site is performing better and better over time.

But is it? Unless you are a major publisher, your income might very well fluctuate a lot and it's hard to see any trends by just looking at the numbers.

Adsense Performance Grapher is a small utility I have written to assist me in the monitoring of smaller sites. It takes an Google Adsense CSV report as input and then creates a wonderful graph including running averages highlighting short-term and long-term trends:

/img/software/apg.jpg

In the past I used to copy data into a spreadsheet for an analysis, but in the end this resulted in too much manual labour. Adsense Performance Grapher automates this task, saving me time. Being nice and all that, I've decided to publish the software as a web service, so every publisher can try it out and take advantage of it.

Try Adsense Performance Grapher now!

Use Amazon S3 storage or not?

Software

Capsi is not in jeopardy of requiring more bandwidth and storage than planend for with its current hosting solution. It is however the goal that one day it will require more resources - and I'd like to plan ahead.

Capsi's current host, EngineHosting, is probably the best entry-level hosting provider when it comes to knowledge, support and reliability. They on quality of service, where budget hosts tend to oversell resulting in questionable availability and horribly incompetent support. Not EngineHosting - they know what they're doing.

The downside? EngineHosting offers limited disk space and data traffic. So I have the feeling that splitting dynamic content from static content would be a good decision in the long run. So let's do some math, assuming bandwidth is a greater resource risk than storage. What would the next 5GB of traffic (average filesize 50k, so that's 100,000 requests) cost? And what's the next upgrade step?

Let's take a look at the options:

Don't be surprised if Capsi's static content will soon be hosted on S3..

Additional benefits:

Yup, I'm going to give it a go with a couple of static images. And if I'm happy with the performance, reliability, ease-of-use and costs.. I will definitely port the user content uploads towards S3. Another added benefit, albeit specific to Capsi: this would be a great opportunity to obfuscate content names more, providing better privacy for users using Capsi's access levels.

Last but not least: Neil will probably complain how Amazon is naughty for its one-click shopping patent, but to be honest I don't think life will be much fun if you're going to avoid every single bit of evil..

UTF-8 in LAMP

Software

Here's a handy function returning an array of UTF-8 characters associated to a simple ASCII character. Can be useful when offering users an interface to browse by first character (0-9, A-Z) while actual data retrieval should obviously also include entries starting with a special character.

For example, browsableUtf8Characters("e") returns an array containing e. è, é, ê and ë which can easily be joined and then used in SQL like-queries.

Download browsableUtf8Characters.php or view the source first. (License: none really, enjoy!)

Network oddness

Software

Most of my friends and probably most people I have worked with would call me an Internet expert. That doesn't necessarily mean I know everything about it, but usually I do have a clue what's going on.

Well, not this week. I'm currently in Austria for a skiing trip. The wireless network in the hotel works fine (hence this post), however there are some hosts I cannot access. There seems to be some correlation with the network location: US hosted sites have most problems, including.. Capsi. Argh! (I could easily forego checking my own site and e-mail for a week if I didn't have the opportunity, but when I do have a network connection and I still can't, that's just annoying.)

So far so good, though. I don't like it much but there are some reasonable explanations for the situation, such as a broken proxy server at the hotel or its provider. But I just set up dad's wireless connection - and he has no problems whatsoever connecting to the sites I have problems with. This I do not get.

Network oddness

Software

Most of my friends and probably most people I have worked with would call me an Internet expert. That doesn't necessarily mean I know everything about it, but usually I do have a clue what's going on.

Well, not this week. I'm currently in Austria for a skiing trip. The wireless network in the hotel works fine (hence this post), however there are some hosts I cannot access. There seems to be some correlation with the network location: US hosted sites have most problems, including.. Capsi. Argh! (I could easily forego checking my own site and e-mail for a week if I didn't have the opportunity, but when I do have a network connection and I still can't, that's just annoying.)

So far so good, though. I don't like it much but there are some reasonable explanations for the situation, such as a broken proxy server at the hotel or its provider. But I just set up dad's wireless connection - and he has no problems whatsoever connecting to the sites I have problems with. This I do not get.

Another on-line advertising tip

Software

Many advertisers work with a monthly budget. Some of them spread their budget evenly, but quite a few will spend their money as fast as possible.

Use this to your advantage and plan your promotions im such a way that you draw extra visitors at the beginning of a new month. You should notice higher clickthrough rates and earnings even with the same amount of traffic and especially with higher traffic where you have a higher market share when all budgets are maximised!

Improve your advertising success!

Software

Do you have a monetised web site? Are you unhappy with the results? Here are some tips to increase your success!

First of all, check the optimisation tips from your partner programme. On-line advertising is big business and the experts know what they are talking about!

Also, experiment with different strategies. Take the Google AdSense programme for example: by switching from contrasting to blending adverts and adding end-of-page ones, I managed to nearly triple clickthrough rates and income on Capsi!

Last but not least: content! Quality (and also quantity) matters. It's fine to have a casual blog or site (this one itself is definitely moving there with other projects taking over the flagship project description), but if you truly care about advertising income you will have to invest time and effort into your site. Force yourself to be clever, funny, thorough, unique and onst importantly: descriptive. The better you describe your thoughts or news, the better the contextual adverts will become. Include proper keywords and phrases. Use variation in your language. Categorise posts and group them together on thematic pages. Treat your readers with respect.

By following these simple steps, your advertisements will be much more appealing to all of your readers, both those who find what they are looking for and who cannot. Good luck!

Captcha's revisited

Software

Quiet here, again.. but probably due to too many things going on in life, so that's a good thing.

And right now you'll have to settle for just a quick administrative note: I've changed the CAPTCHA images a bit again and (hopefully) improved the code a little bit. Despite my earlier efforts I continue to get more and more comment spam. For some reason I don't want to force registration upon those who'd like to comment, but if the nonsense continues I see no alternative on the long run.

Fun error messages

Software

Found in VLC:

** (.:8239): CRITICAL **: file src/gtk/win_gtk.c: line 462 (gtk_pizza_set_size): assertion `pizza != NULL' failed

With pepperoni?

Good i18n code for websites

Software

Today I registered the capsi.nl domain just to make sure I will put some effort into writing some internationalisation code and start offering translated versions of Capsi.

Dutch seemed like the right choice for the first translation, me being able to translate into it myself.

First I will write a prototype i18n function, then use it for menus and other relatively static content and finally I'll have to tackle the dynamic content.

As a sidenote, the reason I won't rely on GeoIP, or at least not solely, are search engine crawlers. They offer no method for content negotiation other than separate URLs and I'd rather score high in results for non-English queries than.. well, not at all.

Bye-bye peekaboo bug!

Software

My new site unfortunately suffered from the infamous IE6 peekaboo bug accompanied by some messed up float clearings, but these problems now seem to be a thing of the past having discovered the proper fix (at least in my case). Simply add display: inline-block to the layer containing the float! One line of CSS and everything works a lot better in Internet Explorer! (or, in my case, IEs4Linux through Wine)

Hurray for progress!

(Edit: somewhat. Looks like I will need to provide a smallish hack to only let MSIE6 read that code as other browsers don't like it.)

Technorati pings

Software

Unless I messed up my code, this journal should be sending Technorati pings again. I'm still getting reasonable traffic from the site for older entries so it should be worth it to get listed there again.

(On that topic, I'm considering to return to a more distributed blogging effort, with different blogs for different areas of interest, in order to build more dedicated audiences for each topic. The new profile/music site already is a step towards such a setup, after all.)

Anyway, here's the PHP code that (should) send a proper ping to Technorati:

class Ping
{
function httpPost( $host, $port, $uri, $data, $userAgent = "KikiCMS/0.99" )
{
$url = "http://${host}:${port}${uri}";

$fp = @fsockopen( $host, $port, $errno, $errstr, 5);
if (!$fp)
return false;

$out = "POST ${uri} HTTP/1.1\r\n";
$out .= "Host: ${host}\r\n";
$out .= "Content-Type: text/xml\r\n";
$out .= "Content-Length: ". strlen($data). "\r\n";

fwrite($fp, $out);
fwrite($fp, "\r\n");
fwrite($fp, $data);
fwrite($fp, "\r\n");
fpassthru($fp);

fclose($fp);
return true;
}

function technoRati( $title, $url )
{
$uTitle = htmlspecialchars($title);
$uUrl = htmlspecialchars($url);
$xml = "<?xml version=\"1.0\"?>\n"
$xml .= "<methodCall>\n";
$xml .= "<methodName>weblogUpdates.ping</methodName>\n";
$xml .= "<params>\n";
$xml .= "<param>\n<value>$uTitle</value>\n</param>\n";
$xml .= "<param>\n<value>$uUrl</value>\n</param>\n";
$xml .= "</params>\n";
$xml .= "</methodCall>\n";

Ping::httpPost( "rpc.technorati.com", 80, "/rpc/ping", $xml );
}

Include the class when you save (insert) an entry with Ping::technoRati( "My blog", "myurl" ) and you should be ready to go.

The singularity, inevitable

Software

Last week I finally read The singularity is near (2005) by Ray Kurzweil, after having been interested in the subject for a while. Neil describes it as a "utopian freako book", but even though Kurzweil is definitely optimistic his thoughts focus not on the benefits of the singularity but rather the inevitability. (The technological singularity is a future event where technological progress increases so rapidly that the world as we know it, as will as mankind, will be changed beyond recognition.)

Almost everyone I talk to agrees with the basic concept that our technologies improve at an exponential rate. But mention the prospect that we'll be able to dispose of our biological bodies in just half a century time and most people will disagree because it is a) impossible and b) not desirable.

I'm not an expert on nanotechnology so I can't easily agree nor disagree with the timeframe stated by Kurzweil. But I don't believe it's impossible to remove our dependency on biological parts. Most technology we take for granted in 2007 used to be impossible. And we already live in a world where artificial organs are commonplace. There's no reason to assume our brain, although vastly more complex, will be immune to efforts of reconstruction.

That leaves us the idea that living non-biologically (uploaded in a computer) or as a cyborg hybrid is not desirable. But let's take a look at reality: even when the majority of people are reluctant to adopt new technologies, the generation that is growing up with them most certainly are not. Take the mobile phone for ultimate example: my pre-WW2 grandparents don't even have one and my baby-boomer parents can barely use it to send text messages. In the meanwhile, my generation enjoys features such as Internet access, music and picture messaging. And being nearly thirty, I didn't even grow up with cellphones. Those who did never even had to make a choice whether they are desirable or not: the technology simply is. The same will apply to our step towards non-biological bodies.

(I'll expand on the generation gap in a future post. Adding a "plus 1 generation" safeguard to Kurzweil's predictions make them much more plausible because the majority of criticism will be rendered obsolete when taking into account that mankind will not just invent future technologies, but eventually also grow up with them.)

Fun Flash games

Software

We never waste time at work. Never. So we never play:

Seriously. Never.

Integrate AdSense with Google Analytics

Software

Yesterday I found a great resource: the ability to track AdSense clicks in a Google Analytics account. This gives publishers a more advanced way to track their best-performing content, as well as the ability to analyse cross-segment performance. As a further benefit, this makes URL and content channels in AdSense a bit redundant, allowing publishers to focus on style/shape/positioning channels in the actual AdSense reports.

Giving up on MSIE6

Software

Soon I will be making a bold decision: I'm going to stop trying to make my new web sites work in Internet Explorer 6.

First of all, Internet Explorer 7 is a huge improvement. No serious hacks but only a few tweaks and workarounds were necessary to get my designs working in it. Believe it or not, a single static CSS file now actually gives me exactly what I want under all of MSIE7, Firefox , Opera and Safari/Konqueror. MSIE6 has really become the ugly duckling on the web and now that even Microsoft has a somewhat reasonable browser, even Redmond fanboys can escape its CSS horrors.

Also, Microsoft is doing everything it can to get a larger install base for MSIE7. MSIE6 has dropped from nearly 100% (amongst IE users) to 65% in the first few months. This puts the overall market share of MSIE6 under 50% - and falling with every use of Windows Update or Vista install. Consider how MSIE5.5 is already below 1% in market share and it's not a bad assumption something similar will happen to MSIE6 in a year time. And why spend time on getting things to work with obsolete software? This is 2007, where updating software is infinitely easier than it was in 1996 when 14k4 modems roamed the world.

So this is where I draw the line. Bye MSIE6.

Javascript image scaling

Software

If there's one feature I'd like for Javascript to be able to do is to scale images. And I don't mean dynamically adjusting width/height when displaying images, but actually changing the JPEG/PNG data into a smaller image for form uploads.

I've seen all too often that users of a CMS will upload an image straight from their digital camera or scanner and therefore submit a megabyte-sized file. It's easy to scale it on the server end (because most web sites won't display the image in full size), but wouldn't it be nice if it could be transformed on the client side first? It would save a lot bandwidth and upload time.

If anyone knows if this is possible, let me know.

MSIE Javascript workarounds for table manipulation

Software

Sorting tables on the fly can be fun in Javascript, especially when working with standard-compliant browsers. However when MSIE is thrown in the mix, the following workarounds are key to know:

If insertRow doesn't work properly or at all, just use insertBefore(newRow, targetRow). If you actually need to insert after, use targetRow.nextSibling if it is not null and otherwise simply use tbody.appendChild.

If newRow.innerHTML assignments are working, then just move the children of the original row to the new one instead. Like this:

var cells = oldRow.getElementsByTagName("td");
var i;
for ( i=0; i<cells.length ; )
{
var td = cells[i];
newRow.appendChild( td );
}

Note that the counter is not incremented: appendChild removes the element from the source so you'll always be operating on the zeroeth child.

These techniques make sure your table manipulations start working in both MSIE/6 and MSIE/7, while everything is still fine and dandy on KHTML (Konqueror/Safari), Firefox and Opera.

MSIE/6 Hacks

Software

The past days I've discovered a couple of hacks/workarounds for CSS bugs in Internet Explorer. Something tells me I've already discovered each one of those a million times before so I'd better write an entry about them so I'll have a good reference for the future.

Developing web sites is a lot nicer when things suddenly start to look the same in all browsers.

Still angry with MSIE

Software

It's been a (short) while since I've filed a complaint about the dead parrot called Microsoft Internet Explorer, so here I go again:

It is extremely frustrating when a piece of craftmanship (in this case Javascript code) conforms to all known standards in the solar system and then MSIE says "nuh-uh, I have my own rules so your standards-compliant crap is not going to work". Trying to do some magic with insertRow on a TableElement? Tough luck: both MSIE/6 and MSIE/7 will fail.

Maybe I should start writing pages in plain text.

© Copyright 1995-2008 Robert John Kaper. All rights reserved.

Tom has more friends but mine are prettier! (#1/1)