Web Features That May Not Work As You’d Expect

As the web gets more and more capable, developers are able to make richer online experiences. There are times, however, where some new web capabilities may not work as you would expect in the interest of usability, security and privacy. I have run into situations like this. Like lazy loading in HTML. It’s easy to […]

Apache AddDefaultCharset

Apache AddDefaultCharset As I found out today after a server move and a subsequent long search, the AddDefaultCharset directive is switched on by default in current Red Hat Apache installations, in httpd.conf. ISO-8859-1 and UTF-8 are specified once. These directives ensure that text and HTML files are sent with the appropriate charset in the header […]

Introduction to charsets and encodings

Introduction to charsets and encodings Since lately I have heard and read misunderstandings on the topic again and again, or heard people say things like “Uh, now it broke my umlauts, why do I have an A with a tilde over it?” I write today a little bit about charsets and encodings. First two important […]

PHP to JavaScript compiler

PHP to JavaScript compiler For a few years now I have been working “on and off” on a compiler that converts PHP to JavaScript. There is something similar with Niklas von Herztens php.js, but my engine is not a VM but a parser and compiler written in PHP. While the resulting JavaScript still requires a […]

Null, Undefined and NaN in JavaScript

Null, Undefined and NaN in JavaScript JavaScript has a couple of extraordinary variable states which, if you only use JavaScript now and then, will always give you headaches. You just want to briefly change a value in the DOM or incorporate a plausibility check, but you are annoyed by the funny little yellow exclamation mark […]

Destructors and session data in the database

Destructors and session data in the database One of my projects uses its own session handler to write the session data to the database instead of to the file system. The first step is to mount and call your own functions with session_set_save_handler (). However, the problem arose here that PHP had already destroyed most […]

REPAIR TABLE and OPTIMIZE TABLE

REPAIR TABLE and OPTIMIZE TABLE When working with very large amounts of data, it happens to me that MySQL spits out strange error messages when accessing tables, such as “Table xxx is corrupt” or “Table XXX doesn’t exist” (although SHOW TABLES shows the table). This can occur through bugs in MySQL without doing anything wrong […]

Relations / Linked Tables in PHPMyAdmin

Relations / Linked Tables in PHPMyAdmin When upgrading from an ancient version of PHPMyAdmin to the latest version 3.2.1, I wanted to try out the new relation features today. After about two hours of trying it out, it worked. Perhaps the following tips will help one or the other to speed up the process:In the […]

Quasi-MySQL dump for individual columns

Quasi-MySQL dump for individual columns There is a simple trick to copy data from individual columns from one MySQL table to another (e.g. from the development server to the production server): Use the CONCAT function to generate UPDATE statements. In this example I would like to extract the information in the primecost column of the […]

PHP to JavaScript compiler

PHP to JavaScript compiler For a few years now I have been working “on and off” on a compiler that converts PHP to JavaScript. There is something similar with Niklas von Herztens php.js, but my engine is not a VM but a parser and compiler written in PHP. While the resulting JavaScript still requires a […]