Posts

Showing posts with the label programming

Dawn Ascends! Ready Your Swords!

I absolutely love coding in PHP. Sometimes I get distracted by the glitz and glamour of some of the more popular languages (and their associated frameworks) - and I agree, they have their place. But PHP is in a class of its own.

Wouldn't It Be Great If All APIs Followed RESTful Principles?

APIs and connecting web applications together is going to be the next challenge of the evolution of the web. The next decade should see easier-to-implement, yet more secure methods for connecting the various web applications that we use.

Putting My DBA Hat On... Again

It's not often I have to worry too much about the minutia of database administration... well, I try not to. But this question on StackOverflow got me intrigued, so I put on my trilby. labratmatt was having a bit of a problem with inserting data into a MySQL table with field defined as DECIMAL(3,2). Can you guess what his problem was? That's right.... 9.99! How did you guess? This has got to be one of the most popular MySQL-related Google searches. The initial problem is easy to solve... correct the presumptuous field definition. However, the underlying problem is really why his data was being truncated, even inserted incorrectly. You may notice the same if you run MySQL (v5.0+) from a default setup on other field types: VARCHAR for example, where you set a maximum field length. When you INSERT data that is too long it simply gets truncated. Not hugely worrying you may think, especially in development and testing phases. True. But this wasn't enough for me, so I went on a ...

Enabling PHP extensions on a Mac

So I hit my first attempt at using something not bundled in Apple's 'safe' PHP build for Mac OS X. I decided to implement memcached on my big project. I found out that memcached is pretty easy to set up and had that running in no time. The problems start when trying to get PHP to talk 'memcached'. Windows binaries come bundled with the latest stable release of the PECL Memcache library, but Apple has decided not to bundle it into the PHP Apache module. Then I got thinking: "Well what about other extensions that I might need?". I resolved to get this working so I knew what to do for future extensions! I'd read so much about how Apple has disabled extensions and there's no way to make it work... blah blah blah... Then I found this brilliant tutorial by Erik Giberti . Stupidly though I didn't follow the guidelines to the letter (I was probably distracted), but Erik provided continuing support. I Twitter'd him and he seemed more than happy to o...

Unfinished Business

I just wanted to write a quick post (as it's late and my Mrs wants me to come to bed) about lingering jobs. We all have them. Washing up that's starting to grow its own ecosystem, that lightswitch that's still hanging off the wall (but it works!)... For me it's a plethora of oddjobs for old clients. In my case they come back for more, usually at the most inconvenient times. This time however it's all my fault. In desperation I have offered to do work in the hopes that I will finally get these people off my back. It's not that they're begging me to do things, but more for my own sanity. I guess I have some mild form of OCD . I just want things tidy. Is that so bad? I find that eventually there are so many things on my mind that I can do none of them. So I suffer silently in a corner somewhere waiting for the light to come on. Ultimately it's a crippling fear of failure that grips me most. Of course it is that very fear that breeds itself. I'm sure you...

When "Can I..." or "I'm going to..." becomes "I want you to..."

Dear Audrie, Today I have been mostly making "final tweaks" to a fairly simple project that I've been working on. It's a content site with a Flash gallery. It's quite easy, but we're not dealing directly with the client. We're dealing with a go-between art studio who produced the design. They've basically done the whole rebranding and needed someone to put the site together. This sounds great from a programmer's point of view: No designing, just programming... more like this please. There is a major problem with this though. The design studio tend to get their own "ideas" of how the copy should go and what goes where. All within their power? 'Yes' you might say. However, it becomes a little silly when as the programmer you are providing a product to a client that allows them to update their website themselves  and you end up making all the changes. I'm not going to name drop because that may enlighten the client a little too m...

iPhone 2.0 Apps Could Alter The Way We Engage

Dear Judy, Since the Jobs-note last Monday (9th), a lot of media attention has been focussed on the App Store and the coming features of iPhone 2.0. Sadly, orders of magnitude more media attention has been focussed on the 3G iPhone - the highly anticipated, but hugely underwhelming revelation that it is. The iPhone's new little (big) brother does address some of the more than glaring ommissions that the original was left wanting. And in my view it does finally justify the hefty price tag. But even this has been reduced! To the shock of all! I shall definitely be getting a 3G iPhone as soon as my existing contract expires (especially as my handset is slowly falling apart). There are still some issues that I have with the iPhone. These are more correctable with firmware updates than hardware changes, and save for any major improvements in carrier networks' hardware I don't see that there's much need for adding to the tech specs of the 3G iPhone anytime soon. In my opinion...

Google Friend Connect - the answer to a programmers prayers?

Dear Tanya, Google Friend Connect was officially announced last week. It has since come to light that this is no ordinary social network. In fact in the truest sense of the term, it isn't a social network at all! Friend Connect is a social tool. It seems the lovely people at the big G have been working their socks off finding a way to help us all connect a lot more easily. This fantastic tool is still only in preview, but from the fairly sketchy detail proffered by Google, it seems that even now it has a very wide appeal. In order to place a perspective on what Friend Connect allows you to do, imagine: you are the only software developer on the planet. You, and you alone, have developed each and every web site in the world and you had to build each site from scratch. So that means no code sharing. No data sharing. This means for every user who visits a web site that requires authentication they will have to register and verify their details. Then they will have to maintain them....

iPhone, iPod Touch and why Mobile Internet is the Future

Dear Geraldine, Yes I am begging for a verbal beating from all the nay-sayers... but Apple have pushed the boat out with full featured web browsing on the mobile platform. Many non-converts will say that it's missing some vital features - and they are right. Without Java and Flash on either version of Apple's uber status symbol, they is missing out on some serious functionality and usability. Let us not forget though that this is merely the first incarnation of these oft-heckled devices. And many of these issues can be resolved by a "simple" software update. Why am I so bold? You would be right in thinking I sold out. Yes I bought an iPod Touch. Happy with my current cellular device I couldn't justify the expense of the iPhone without the features I now expect from a modern handset - especially one with so much (dare I say?) "PDA-like" potential! - What should the next iPhone have? I'm no analyst, marketer or even a prophet, but Apple have started se...

WinMerge... wow...

Dear Francine, I have only just discovered WinMerge . And all I can say is "wow!". I run a number of simple projects by myself and so we don't use any sort of version control software. Generally latest and greatest rules. However, on the odd occasion, I have had cause for maintaining two distinct versions of a site. The obvious drawback with this sort of manual version control management is the sustainability of migrating changes to more than about three files. That's when Slam informed me of WinMerge. Up to this point I was using WinDiff to track changes in my abstract scenarios. But when ol' Slammy caught wind of my head grief he decided to tell all. I am so enamoured with WinMerge now; I insist that all of you out there who are struggling with a good system for basic versioning and change-merging try this out. You can download WinMerge from SourceForge . It's Open Source and free to use. Whilst being simple and intuitive in it's methods, it wields great...

RadScheduler and .NET 3.5

Dear Susan, At the moment I'm working heavily on a project that is using Telerik 's superb RadScheduler. I know it's still only in BETA, but it came at just the perfect time for us and our client so we jumped on board. This meant a 1.1 - 2.0 shift (yikes!) and AJAX thrown in too. The main issue though came up a couple of weeks ago, when - here in the UK - we moved into DST. What a nightmare! The problem is that one of the specifications of the project requires that it be ready to accept users from any country and map all times local to them! So I spent two months rebuilding all the time functions, saving all times to UTC etc etc Without going into all of the details of DST in different countries and how we use the data in other areas of the site, suffice to say there is no manageable way with either the Scheduler or .NET 2.0 to map DST for each and every rule save creating them yourself. And then I stumbled upon TimeZoneInfo in the System.Core of .NET 3.5! What a God-send....