3D Studio Max – Modelling a Grundig 2440 antique radio

3D Studio Max - Modelling a Grundig 2440 antique radio

I am currently doing a website project for the “forum of community radios” of Mozambique. While struggling to think how to visualize this concept, I decided to model an actual radio to feature at the top  of the site. After thinking some more, I settled on an antique radio which I felt would be instantly recognizable as a radio, and some of these radios are probably still in use in rural communities.

So I set about modelling an actual Grundig 2440 radio (from this sample photo). Since I need the radio in extreme closeup, I needed to add lots of details. Texture maps were used for the fabric grille over the loudspeakers, and for the reflective dial plate. Read more


A working RTF to HTML converter in PHP

A working RTF to HTML converter in PHP

In a recent project, I desperately needed an RTF to HTML converter written in PHP. Googling around turned up some matches, but I could not get them to work properly. Also, one of them called passthru() to use a RTF2HTML executable, which is something I didn’t want. I was looking for a RTF2HTML converter written purely in PHP.
Read more


Developing a generic count() method for Idiorm/Paris

The minimalistic object relational mapping libraries for PHP, Idiorm and Paris, are wonderful stuff. They have a very small footprint and make your code a joy to read. They allow you to build queries using method chaining, avoiding tedious string concatenation. They’re safer than string concatenation too, since they use parameterized PDO queries under the hood.

And yet, minimalism comes at its own price. Not everything is possible with Idiorm/Paris. Still, whatever seems impossible could very well result from my not understanding the libraries’ potential, or SQL for that matter. Read more


Developing a REST-powered AJAX table control with the Slim Microframework and AngularJS (3)

Developing an REST-powered AJAX table control with the Slim Microframework and AngularJS

Welcome to the third part of a hands-on tutorial on writing reusable user interface components with AngularJS. In this tutorial, we’ll write a table control that asynchronously loads data from a server, display it, and allows the user to sort the data by clicking table headers. The sorting is done client-side. We’ll show how to write a REST-server in PHP, how to define custom HTML elements in AngularJS, and how to setup a controller for the elements. To top it off, we’ll write CSS for our table in such a way that it can be dropped into a user interface in a snap, and scales fluidly with the space allotted to it.

The third part of this tutorial adds CSS to style the output we already have, and adds automatic (client-side) sorting to our table control.

Don’t forget to read the first part and the second part of this tutorial.
Read more


Developing a REST-powered AJAX table control with the Slim Microframework and AngularJS (2)

Developing an REST-powered AJAX table control with the Slim Microframework and AngularJS

Welcome to the second part of a hands-on tutorial on writing reusable user interface components with AngularJS. In this tutorial, we’ll write a table control that asynchronously loads data from a server, display it, and allows the user to sort the data by clicking table headers. The sorting is done client-side. We’ll show how to write a REST-server in PHP, how to define custom HTML elements in AngularJS, and how to setup a controller for the elements. To top it off, we’ll write CSS for our table in such a way that it can be dropped into a user interface in a snap, and scales fluidly with the space allotted to it.

The second part of this tutorial focuses on AngularJS. With a RESTful web service in place, we will now set about writing a new HTML element for our dynamic table. (Read the first part here).
Read more


Developing a REST-powered AJAX table control with the Slim Microframework and AngularJS (1)

Developing an REST-powered AJAX table control with the Slim Microframework and AngularJS

Welcome to a hands-on tutorial on writing reusable user interface components with AngularJS. In this tutorial, we’ll write a table control that asynchronously loads data from a server, display it, and allows the user to sort the data by clicking table headers. The sorting is done client-side. We’ll show how to write a REST-server in PHP, how to define custom HTML elements in AngularJS, and how to setup a controller for the elements. To top it off, we’ll write CSS for our table in such a way that it can be dropped into a user interface in a snap, and scales fluidly with the space allotted to it.

The first part of this tutorial introduces AngularJS, and takes you through the use of the Slim PHP Microframework and the Idiorm and Paris ORM libraries in order to write a RESTful web service, which we’ll need for our table control to talk to.
Read more


Online Tools

I can see blonde, redhead...

Websofia presents a couple of online tools that can be handy when you’re examining hacking scripts on your web server. Often, you’ll find that malicious code is encoded using either base64_encode or str_rot13, and possibly gzip-compressed. You could scan all the files on your web server looking  for base64_decode, str_rot13 and gzinflate, but you’ll get a lot of false positives in the bargain. When you need to know what the encoded code actually looks like, run it through one of these tools to find out. Saves you having to write the scripts yourself.


A practical guide to URL rewriting for IIS (and Apache)

Microsoft IIS URL RewritingI use my own PHP-based CMS for almost all my web development. This is great, because since I know the code inside and out, I can make whatever the client wishes happen. It has a lot of nice, reusable features (plugins) that make development of a generic website pretty short. Still, all was not well because one of the things it didn’t support was URL rewriting. In this blog post, I’ll set out to describe how this is done, what pitfalls there are and how they can be avoided.
Read more


Automating website & MySQL backups

MySQLI have a web server with a number of clients’ websites on it. It’s necessary to backup these websites every day, since clients use a content management system to make changes regularly. These changes can be updates to a website’s MySQL database, or they can be changes to the files stored within these websites. What I’d like is to backup the MySQL database and the filesystem for each website, every day, at a specific time. The backups must rotate: when there are, say, five backups, I want the oldest one to be removed as the newest one is written. Also, I’d like the backup solution to send me an email every day after it’s completed the backups with a summary of the procedure. Read more