Claus Witt

software and web developer

Archive for February, 2009

Is My Blog Working – caching and gzip

with 2 comments

For some reason I ran my blog through the online tool ismyblogworking.com – which suggested that I enabled mod_deflate and enabled mod_expires and added some configuration of both of these. I have not performed an a/b test of how this could influence the performance of the blog, but just enabled it, and tweaked it to where my experience told me the values should be. I found two ressources for those of you who wants to know how these changes could be made.

Enabling mod_deflate

Enabling browser caching

Written by Claus Witt

February 27th, 2009 at 11:30 am

The Everticum Video – by Rolf

without comments

Even though a lot of people allready have seen this video (and/or have heard our 1999-demo). I decided to post this again. For some reason I still love this song (that Lars and I wrote on the 31/12 1998, before a great night on the town celebrating new years).

This video was embedded using the YouTuber plugin by Roy Tanck. Adobe Flash Player is required to view the video.


Written by Claus Witt

February 27th, 2009 at 7:30 am

Posted in Metal,Music

Tagged with

Ten Tips for Lead Generation Landing Pages | Online Marketing Blog

without comments

I am trying to find new ways to generate leads. I am curious not only because the knowledge could be useful if I am able to start one of my software projects as an actual business in the future, but also because we at Arnsbo Media constantly try to improve our online archive of voice over talents, and the leads that this archive generates.

In this pursuit U found yet another list of ideas for Lead Generation.

Ten Tips for Lead Generation Landing Pages | Online Marketing Blog.

Written by Claus Witt

February 26th, 2009 at 4:30 pm

Posted in Business

Tagged with ,

WordPress and Magento together. SEO for your shop.

without comments

The great thing with open source software is that it is possible to adapt the systems to your needs. After having read about SEO for E-Commerce I was wondering wether or not there allready existed a solution for integrating a WordPress Blog in an Magento webshop. In my opinion the best open source blogging platform and the best open source webshop application. Off course there did. Lazzymonks WordPress Integration requires some code-tinkering however, but it seems to work well.

Written by Claus Witt

February 26th, 2009 at 7:30 am

Upload Progress Bar using Php and Dojo

without comments

For a long time I have wanted my applications to have progress bars on uploads, but I have always thought that this was impossible when the server language was php. Unless of course you wanted to do some mixing of languages, and handle the upload via perl. I, however, wanted complete integration of the code, and wanted my mvc framework to be able to output the wanted information. A while ago my boss at Voicearchive asked me if we could get a progress bar for uploads on the system that we are developing. Once again I found myself searching for possible solutions.

This time around, however, I found what I was looking for. I found an article about PHP and jQuery upload progress bar. In this article I learned about the PECL extension uploadprogress. I began trying to make this solution work.

First thing, was that I found the extension did not work as I wanted. After a while I found that installing newest version, required installing it via “pecl install channel://pecl.php.net/uploadprogress-0.9.2″ – which gave me the latest beta release of the extension. Now it returned the correct information when I uploaded a file.

The solution consists of 5 parts.

  1. The Pecl extension
  2. The form
  3. The progressbar widget
  4. The javascript
  5. and the controller which sends the data from uploadprogress as json to the client

After the installation was managed, I changed the form to have the required hidden UPLOAD_IDENTIFIER value included.


The value of the field is set when the dialogbox containing the upload form is revealed, and saved in a variable, that can be used when the script needs to poll for the result.

lastFileProgressKey = guid();
console.log(lastFileProgressKey);
dojo.byId('addFileProgressKey').value = lastFileProgressKey;
dijit.byId('addFileDialog').show();

The guid function is just a simple function which generates a guid-like random string. The value is then set to the form, and the dialog is revealed.

When the upload button on the form is pressed it calls a event handler which handles the actual upload. Before the upload is started however the following function is called.

startUploadCheck(lastFileProgressKey);

These function do the actual work.

function updateProgressBar(response) {
	if(response) {
		totalBytes = parseInt(response.bytes_total);
		uploadedBytes = parseInt(response.bytes_uploaded);
		percentage = Math.floor(100 * uploadedBytes/ totalBytes);
		uploadProgressBar.update({ progress: percentage+'%'});
		if(lastUploadId!='') {
			setTimeout("checkUpload()", 1000);
		}
	} else {
		if(lastUploadId!='') {
			setTimeout("checkUpload()", 1000);
		}
	}
}

function checkUpload() {
	dojo.xhrGet( {
		url :'/uploadprogress/check?uploadid='+lastUploadId,
		handleAs: 'json',
		preventCache: true,
		load: updateProgressBar,
		error: function(data) {
			if(lastUploadId!='') {
				setTimeout("checkUpload()", 1000);
			}
		}
	});
}

function startUploadCheck(uploadid) {
	dijit.byId('uploadProgressDialog').show();
	lastUploadId = uploadid;
	checkUpload( uploadid );
}

function hideProgressDialog() {
	lastUploadId = '';
	dijit.byId('uploadProgressDialog').hide();
}

The dojo widget used is the ProgressBar.

The controller is the simplest part of the equation.

public function check() {
    $formUploadId = $this->request['uploadid'];
    return json_encode(uploadprogress_get_info($formUploadId));
}

All the legwork is done by uploadprogress_get_info, which then is passed through json_encode.

Written by Claus Witt

February 25th, 2009 at 1:00 pm

Posted in Development,Web development

Tagged with , ,

7 Tips for Generating Leads Online

with one comment

Continuing my pursuit of learning more about sales and marketing, I have found a list of 7 great tips for lead generation.

7 Tips for Generating Leads Online.

Written by Claus Witt

February 24th, 2009 at 4:30 pm

Posted in Business

Tagged with ,