Working on some Web Development in Wordpress / PHP, I made the following experience today:
A file was being parsed and executed correctly on one server, but showed a parse error (unexpected T_ELSE, but this could have been anything related to placement of conditional and loop markers "}").
What do you do? You double check if the file is indeed the same file. Is there a problem with FTP, encoding, etc.?
And then?
You noticed that you were using <? instead of <?php
Then you look in PHP.INI and you find this:
short_open_tag.
The default is "On" and most web hosts use this, and I was so used to using it everywhere in my code, that I really...
Thursday, December 27, 2012
Wednesday, December 26, 2012
Translating Wordpress: Poedit
I had a hard time during the last couple of days trying to get gettext translation work in a Wordpress installation. Eventually it turned out to be a bug (read: a missing slash) that went undetected and made me search for hours and hours. Not very cool with Christmas, but at least it's warm inside.
And I learned a lot about translating in Wordpress. If you google it, you'll probably find plugins like transposh, qtranslate (both free) or WPML (free for non-profits). There are also lots of tutorials about using gettext with Wordpress. You need a little program called poedit, that requires some configuration. The best tutorial I found (I read about six) is:
http://wp.smashingmagazine.com/2011/12/29/internationalizing-localizing-wordpress-theme/
Note that some other tutorials miss some of the...
Tuesday, December 18, 2012
Creativity and Computers?
Yesterday, I wrote about the creative juices that allegedly flow wildly when programming a computer, or generally working with digital devices. This is partly true, when you have to move swiftly between files and folders, tabs and temporary clipboards,when you have to program in various languages and just challenge your brain constantly to be precise enough. Every geek with a little bit of experience knows what I'm talking about here.
I once studied computer science because I thought it'd be the most creative thing in the world. Unfortunately, that turned out to be an illusion. Of course, there are the events like I described yesterday, and...
Sunday, December 16, 2012
Programming for the Brain

Brains ought to jump. Photo seen at Google.com
Do geeks have an obsession with brains or braininess? Perhaps. I just wanted to share a simple but authentic thought with you:
Programming a computer is good for the flexibility of your brain.
That statement isn't true. It should be refined, since many programming tasks are boring and don't challenge our gray matter. Think surrepetitiously programming an old VCR.
So what about
Performing certain non-trivial tasks on your computer is good for your brain.
What kind of tasks? Programming at CERN or hacking into NASA (which might not qualify here given the age of the individual who actually did...
Geeky Christmas: Snow

In the Christmas season, website owners are looking for Santa and snow. Moving images of Santa abound on the Internet, and we're not going into that.
I have looked for a snow plugin for a website I work on, amaidi.org, and integrated the best I could find. Flakes are highly configurable, there are several modes and the coolest thing is that the snow can collect on a <DIV>.
It is really easy to integrate this plugin by simply adding this line to the <HEAD> of your file to load the latest Jquery and the plugin file:
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript">
And then, just before...
Thursday, November 8, 2012
Cross posting
The amount of services, plugins and methods to syndicate your blog to many different platforms has grown steadily over the last few years, and it is easy to lose track of it. I had a look at some convenient solutions yesterday, that are suited to regular bloggers. Majors blogging platforms like wordpress, blogger, tumblr allow for posting per email. This is still one of the easiest and most rubust ways to set up your cross-posting empire, as there is no need to re-approve applications or update when services update their API. I use Wordpress multisite as a backbone, with a simple plugin called crosspress to autopost stuff to blogger and tumblr sites. There are a number of automated syndication plugins, but I couldn't get them working. Another out-of-the-box solution is to use posterous.com,...
Sunday, September 9, 2012
Bulk file rename utility

not-so-scary screen of this utility
Sometimes you want to rename a series of files in one go. Windows has very limited functionality for this. Although it can rename files generating automatic postfixes like (1), (2) etc, it doesn't have the flexibility you need when your file names are important for you. In most cases you would like to have control over the file names of your photos, and manually changing "DCR000346" into "holiday photo 346" isn't much fun if you have to go through 100s of photos.
I use file names as important tags on the content. I add the following prefixes when working with files that are assignments that have to be sent...
Friday, August 17, 2012
Sign A PDF Without Printing
One of these little tasks we all need to do every once in a while is signing documents. As usual, many traditional institutions don't (yet) support digital fingerprint signing, so they require a "real" handwritten signature. Filling in the form can be done online, everybody has the Acrobat plugin to make that happen, but attaching a signature?
There are a few quick and free ways to accomplish this, without printing out your document, signing it with a pen, and rescanning it. Of course you just attach an image of sufficient quality. One PDF-reader that does this is NitroPDF. It is free to try, and you can actually sign your documents with the free version by inserting a scanned (or photographed) image of your signature. The pro version offers batch processing, word integration and full control.
If...
Wednesday, August 15, 2012
Wordpress vs. Drupal

Two of the most prominent tools to create websites are Wordpress and Drupal. Both of them are well developed PHP-based open source content management systems. When people start websites these days, they need to pick an appropriate framework first. I'll try to explain when Wordpress is more suitable, and when Drupal would be advisible.
The common preconception can be summarized in two prejudices:
(1) Wordpress is just for blogging
(2) Drupal is a complicated CMS with a very steep learning curve
This is not true. Wordpress can be, and has been, used for full-blown websites, and vice-versa, you can do amazing things drupal without in-depth knowledge.
Wordpress...
Tuesday, August 7, 2012
Dlvr.it

Most of us have used some platforms built on top of social networks like facebook and twitter. Services like Hootsuite, Tweetdeck, and Socialoomph come to mind (they are actually the top three). I've used them for a bit, but found them too bulky, especially if you are not working in a fixed office, but often on the road, relying on the small screen of a netbook or even more portable device. What I wanted was a service that simply published my content to a selection of targets.
I recently discovered such a service: dlvr.it. This is indeed very simple to use and manageable on a portable device. I've set up several "routes", which connect sources...
Thursday, August 2, 2012
Scripting with autohotkey

Here's a tool that is easy to use yet extremely powerful. If you're an average computer user who just reads emails and edits an occasional word document, you can benefit from autohotkey. If you're a heavy user and it's not uncommon that you've more than 20 windows open, you can benefit even more from this scripting program.
Experts agree that Autohotkey is one of the best automation tools around. Perhaps you haven't heard of it before, because you've never seen any ads? Well, that's because it is open-source freeware! The benevolent geek who created this over the course of many years has made the source code as well as installer packages...