Category Archives: open source

Normalize URL’s with PHP

I’ve posted to GitHub a PHP class that I’ve written which can handle URL normalization, as specified by RFC 3986.

https://github.com/glenscott/url-normalizer

Specifically, the following normalization steps are performed:

  1. Normalize case
  2. Decode unreserved characters
  3. Remove dot segments

An example of use:

require_once 'URLNormalizer.php';
 
$url = 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d';
$un = new URLNormalizer();
$un->setUrl( $url );
echo $un->normalize();

// result: "example://a/b/c/%7Bfoo%7D"

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn

Shared memory fix for PostgreSQL Mac installation

EnterpriseDB have kindly created a one-click installer for PostgreSQL, but unfortunately it doesn’t work out-of-the-box, at least not on my MacBook Pro. The problem is down to the amount of shared memory that is configured in OS X; by default it is 4Mb, and PostgreSQL requires 32Mb:

Postgres installer error

The error message suggests looking at the README file, which actually doesn’t exist. Luckily, there’s a simple fix; to increase the shared memory to the required 32Mb, create or edit the /etc/sysctl.conf file and include the following lines:

kern.sysv.shmall=8192
kern.sysv.shmseg=64
kern.sysv.shmmni=256
kern.sysv.shmmin=1
kern.sysv.shmmax=33554432

Reboot your machine for the settings to take effect, and re-launch the PostgreSQL installer which should now work as normal.

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn

Sun and MySQL continue uneasy relationship

As well as moving away from a completely open model, Sun’s MySQL has bigger issues:

Sun has announced the official release of MySQL 5.1, a new version of the popular open source database software. Although Sun has declared that this version is ready for widespread adoption in production environments, MySQL creator Michael Widenius says that it has “fatal bugs” that seriously undermine the quality of the release.

MySQL creator: version 5.1 released with “fatal bugs”

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn

Review: London Perl Workshop

Spent an interesting morning in the company of many Perl mongers at the London Perl Workshop. Although I don’t use Perl as my primary language any more, it was was interesting to learn about the current movements of its London-based community. The talks I attended were:

  • The Complete History of the Perle Mongers of Olde London Towne – Dave Cross
  • DBIx::Class for (advanced) beginners‎ – Leo Lapworth
  • closures for fun and maybe profit‎ – David Cantrell
  • Catalyst, DBIx::Class and PostgreSQL -‎ Matt Trout
  • ‎Introduction to Moose – Mike Whitaker

In particular, DBIx::Class caught my eye as a nice way of abstracting database details behind more friendly object methods. Although, as the list of contributors shows, this is a highly complex problem to solve and achieving a “one size fits all” solution may be unrealistic.

Matt Trout’s talk was a little disappointing. Although I admired his passion and enthusiasm, there was far too much crammed in the 40 minute talk. Just concentrating on one aspect of the development process would been more useful. However, saying that, he did enough to convince me that I need to revisit PostgreSQL at some point in the future.

My colleague Mike Whitaker talked about the “postmodern object system”, Moose. There was lots of questions by the end of the talk, which was a good sign that the introduction had achieved its aim.

Overall, a good experience and a reminder that the Perl community is very much alive and well.

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn

Real World Lisp

Prompted by a question posed by one of my colleagues today, “has anyone ever used Lisp?”, I surprisingly found myself being the only person that had.

I played around with it many years ago after being inspired by Eric S. Raymond’s seminal article, “How to Become A Hacker” in which he explained that “getting” Lisp is equalivent to finding programming nirvana.

Whilst I didn’t quite reach those levels, I found that using Lisp was a great learning experience. Despite it being half a century old, it is still a relevant language today; the online Practical Common Lisp book contains examples of a spam filter, an ID3 tag parser and other real-world examples.

The following two links are for the curious who might wish to try it out:

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn

BrowserPlus to become Open Source

The new BrowserPlus framework – a way of extending your browser capabilities – will become open source next year, which seems a sensible way to increase its adoption:

The big idea here is that we’ll have the whole platform open sourced by mid-next year, and as soon as possible we’ll have many of the services we’ve written open sourced, as well as the APIs needed to write new services. Our goal is to empower the community to contribute actual patches and new services – code to compliment the feedback.

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn

Microsoft considers WebKit for Internet Explorer

Wow.

Open source is interesting. Apple has embraced Webkit and we may look at that, but we will continue to build extensions for IE 8.

AppleInsider | Microsoft considers adopting WebKit for Internet Explorer

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn

No More X11 – OpenOffice 3.0 is a Native Mac Application

The latest version of OpenOffice is now a native OS X application, meaning no more launching Apple’s X11 to get it running.

OpenOffice 3.0 on Mac OS X

OpenOffice.org 3.0 officially released
Download OpenOffice 3.0 for Mac OS X (Intel)

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn

Stephen Fry wishes GNU a happy birthday

Mr. Stephen Fry introduces you to free software, and reminds you of a very special birthday

Stephen Fry

Freedom Fry — “Happy birthday to GNU”

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn

Google bringing new browser to the party

Google have announced news of Chrome, a new open source Webkit-based browser. The central premise is that it has been designed from the ground-up to work efficiently with the demanding web applications of today’s web. In particular, it features a JavaScript engine called V8 which can utilise multiple processes, as opposed to the single-process engines that power Firefox and Safari.

As Google are emphasising performance, it will be interesting to compare their efforts with Safari’s new SquirrelFish JavaScript engine.

Google Chrome, Google’s Browser Project

Glen Scott

I’m a freelance software developer with 18 years’ professional experience in web development. I specialise in creating tailor-made, web-based systems that can help your business run like clockwork. I am the Managing Director of Yellow Square Development.

More Posts

Follow Me:
TwitterFacebookLinkedIn