
A few months ago I got a pair of 4x20 LCD displays from Sure Electronics, via eBay. Though they worked quite happily through LCDproc, I didn't really want to use that (as I intend to use one of them on a Bifferboard). To that end, I've attempted to write a driver for them. Until recently I didn't have a lot of success, which made me think that the documentation provided with the device was incorrect, until Gordon suggested trying the command set through gtkterm. I did, which made it work, and discovered that it requires the entire line to be sent to the display even if you're only updating part of it. Adjusting my code to handle this, and add some sleep time after sending each command, made it work.
I've put the code on Github in case anyone else is interested. It's able to drive my DE-LD023 device quite happily, but I suspect it should work for other 4x20 devices too. Once I add the code to detect the device features it should also work for different sized displays. Any comments or patches are of course welcome.
2011-01-19 21:50:37 cms, code, open source, php and standards
My previous post was typed in a bit of a hurry (was it that obvious?) and could probably have done with a few more sarcasm tags, though I think I still have a valid, if small, point. It surprised me that these well-maintained projects seem to be content to run with what I would consider to be errors. Though they do run, otherwise nobody would be using them. For what it's worth, SilverStripe and I have made up and it's all going swimmingly at present. Thanks to everyone who commented with recommendations; I'll try and follow some of them up when I get time.
One comment did ask me to define what I meant when I refer to a "lightweight" CMS -- basically, I was looking for something that will allow me to create a hierarchy of pages that consist roughly of a title and content. Nothing fancy. I don't need multiple content types, complex user management, discussion forums, built-in wikis, etc. It's the sort of thing I could have coded up in a couple of days using any number of frameworks, but I figured there'd be something off the shelf that'd do what I was after.
Another commenter questioned why I cared about coding standards warnings seemingly more than avoiding SQL injection and XSS and CSRF protection -- I don't, those are absolute hard requirements for any application. I'd put avoiding the coding standards warnings somewhere above "nice to have", but those warnings are indications that something is being done in a way which is either less than ideal (such as using non-static methods in a static context, a la Concrete5), or deprecated (such as using the ereg functions).
My next post shall try and be a little more constructive, as I release some code.
2011-01-17 21:10:09 cms, code, open source, php and standards
I've been recently asked to check out some CMSes for someone, and try to find a recommendation. What I've been finding hasn't really been encouraging. Out of the several CMSes I've tried, they've all failed for various reasons. I admit that I might be looking at this from a slightly different perspective than most - that of admining it and coding against it, rather than as a user - but it's still rather disappointing.
- Silverstripe is what I used first - but the forms (including the login to the admin) kept failing to render. In the end, I got sick of debugging it and started my hunt.
- Next up was Concrete5, which I heard mentioned recently. There were one hundred and fifty-five strict warnings in the front page of the installer. Bye bye.
- Next, CMS Made Simple. Its installer wanted E_STRICT and E_DEPRECATED removed from error reporting. At this point some folk might have continued; but that was enough for me not to consider it. I didn't have enough confidence in the code that I wanted to continue. It lost more points for the tarball not extracting into a subdirectory, which resulted in my document root being filled with nonsense.
- Joomla!... well, my last experience of it wasn't pleasant - I couldn't work out how the code was structured. It's also overkill for the requirements of this site.
- I would love to go for Habari, but the site isn't a blog, so it doesn't really fit the use case. It's still the top of the list just now, though.
- I could do what everyone else does and run Wordpress - but, again, the site isn't a blog, and I'd rather try something different.
I didn't consider Drupal or eZ Publish, which again I believed to be massive overkill for what is required of the site. What's going on? This is what PHP is supposed to be good at. Where are the simple, lightweight CMSes with modern code? Notices, strict and deprecation warnings should be considered errors when developing - this doesn't seem to be the case with many of the above projects.
So, that's what I've found. I now don my asbestos suit.
I've just committed two new plugins to the habari-extras Subversion. Firstly, there's the 'share' plugin, which adds the Facebook OpenGraph metadata to pages so that the Like button works, and also adds Facebook and Twitter widgets to the bottom of posts. Secondly, there's a bitly plugin, that pings bit.ly's API when every post is published and generates a short URL. This URL is then stored in the post info, and it provides a template to add it to the head of each page using the shortlink markup. I'd be interested in feedback from anyone more familar with Habari in case there's a better way to do what I'm doing.
2011-01-15 22:49:13 blogging, habari, open source and php
I think I'm just about keeping to this one-post-a-week thing, almost. I've recently been playing with the internals of Habari, writing a couple of plugins. I've found it quite well put together, though I don't seem to ever get the Utils::debug() output to display properly - though this might have been due to the code I was writing running before a redirect. I believe though that I now have got 2 plugins which I'm going to investigate publishing - one which generates the Facebook and Twitter widgets at the bottom of the posts (and the relevant OpenGraph metadata for Facebook in the header), and another which pings bit.ly and generates a short URL for each post as it's published. I'm writing this post in part as a test to see that it works for real :-)
If I get a bit of time over the next few days, I'll finish tidying them up and make them available. If anyone's interested before I do, drop me an email or catch me on Twitter.