Articles

Validating XML Files With XML Schema Definitions In PHP

XML is a useful format for configuration, data storage, and transmitting data from one system to another. As a human readable format that can be easily read by machines it quickly gained favor in lots of different systems as a mechanism for data storage.

Many systems transparently make use of XML without the user ever seeing it. The API system SOAP is built around XML data, and it is normally possible to ask API endpoints to respond in either JSON or XML. It is common to see XML files used in configuration of systems as they can be easily edited and parsed when needed.

Brennan Helix CD Player And Ripper: A Review

I have a lot of CDs. It isn't a "serious" collection, but I have been collecting CDs for at least 30 years so I have a couple of hundred there.

Taking a large CD collection everywhere with you isn't feasible, so I've been ribbing my collection to MP3 for a number of years. Recently, I've started to notice that MP3 doesn't have amazing sound quality, which is more apparent on higher quality audio equipment. MP3s are fine for cars and similar, but not ideal for listening on more serious sound systems.

Since my CD player died a few years ago I have been unable to listen to them in any other way. There is just something about the physical experience of playing music from a medium like the CD that appeals to me so I have still been buying CDs since then.

Creating A Character Bitmap In PHP

I was watching a video from NDC by Dylan Beattie the other day on The Story of Typography and a particular section stood out to me.

The talk ranges from the initial start of writing symbols to the formation of typography as an art form and the creation of eInk displays. Well worth a watch if you have some time to spare.

The part that was interesting to me was then discussing early word processors and the ASCII character standard. Early word processors couldn't store the amount of data required to fully render a font, so characters were rendered using a bitmap system.

Drupal 10: Testing Migration Process Plugins

Drupal's migration system allows the use of a number of different plugins to perform source, processing, and destination functions. 

Process plugins are responsible for copying and sometimes manipulating data into the destination. There are a number of different process plugins that allow you to get data in different ways and and apply it to your destination fields.

Both the core Migrate module and the excellent Migrate Plus module contain a number of different process plugins that you can use to process your data in different ways.

Approximating Pi Using A Circle And A Square

Pi day was a few weeks ago, but I came across this simple approximation of pi recently and decided to put together an example in PHP since it seemed pretty simple.

This approximation of pi centers around a real world example, but we can simulate this using some code.

Let's say you have a dart board that fits inside a square area so that it is flush with the outside of the square. Then you pick someone who is particularly bad at darts and get them to start throwing darts. Record where the darts hit and after a million or so darts you will have a number of darts that hit the board and a number of darts that hit the background.

Drawing A Parabolic Curve With Straight Lines In PHP

A parabolic curve is a type of curve where every point is an equal distance from a focal point. There a number of different way to generate this sort of curve using math, but one of the simplest is to use straight lines to create the illusion of the curve.

The curve is created by diving two axis into equal points and then drawing a line from the first point on one axis to the last point on the opposite axis. Each line of the curve is drawn in the same way, repeating the process of drawing a line between opposite points for every point along the axis.

LocalGov Drupal Camp 2024

April 23rd, 2024 saw the first LocalGov Drupal Camp, held at the Birmingham Council buildings in Birmingham city center.

It's been ages since I attended an in person Drupal Camp in the UK, so when I saw that the LocalGov Drupal people were organising one just down the road for me I jumped at the chance to grab a ticket.

LocalGov Drupal is a distribution that combines Drupal, some configuration, some contributed modules, and some glue code with the aim of making it easier for councils to generate sites.

Drupal 10: Adding Extra User Account Protection

One of Drupal's strengths is its ability to create communities of users who contribute towards the content of the site. Whether you have an open forum, where users can create their own accounts, or a closed magazine with just a few editors your need to take the security of your users seriously.

Out of the box, Drupal has a number of account protection features that assist in making sure that users are authenticated correctly.

For example, the user login page is protected by a brute force system and will lock accounts after a number of incorrect password attempts in a short amount of time.

Getting Started With Git Bisect

Git bisect is a git command that makes it easier to track down where a problem was introduced to a codebase.

In large projects you may find that a change was added to the code that causes a problem and you then need to track down where that problem occurred. Knowing where the problem was introduced makes debugging the issue a lot easier.

You could just checkout commits until you find the culprit, but git comes with the bisect tool that can assist in this process and can even be automated to quickly find the problem.

Recreating Spotify Wrapped In PHP

I quite like the end of the year report from Spotify that they call "Wrapped". This is a little application in which they tell you what your favorite artist was and what sort of genres you listened to the most during the year. It shouldn't come as a surprise to me that I listened to this or that, but since I listen to Spotify around 30-40 hours a week I certainly lose track of what my favorite artist was that year.

This years report got me thinking about how difficult it would be for me to generate my own Spotify report, whenever I wanted. Maybe to see who I had listened to the most during the week, or what sort of genres I was into at the moment.