Sunday 13 July 2008

Fresh fruit

This is going to be just a quick post as I'm writibg this blog entry using my new BlackBerry mobile phone/PDA device. I was curious to see if the browser could handle the blogger pages ok and allow me to blog using my phone. So, if you are reading this, then the answer is yes. Next task is to see how I upload a photo from the phone's camera to my blog.

Sunday 15 June 2008

It's been a long time ...

... since I rock and rolled.

Yes, it's been a while since I last posted an entry, but that's not to say I've not been doing anything!


knitonthenet - Pattern Search


I've just completed some further enhancements to the knitonthenet site. The main noticeable difference from a visitors point of view is that there is now a pattern search page that allows a simple text search to be performed on the complete list of patterns on the site. It uses code based upon the pattern index creation php functions, that pull all the required information on each of the pattern pages from the current and previous issues, and builds them into a set of arrays. Each element is searched, and if the a match is found the data is built into another set of 'result' arrays and output to the browser. The final 'result' arrays can be ordered in the same way as they can on the Pattern Index page to display the results in a sorted order by Issue, Title, Category, or Designer. The text search is limited to the pattern title, the designer name, any description text, and the category text.

The Pattern Search should really be tagged as being a 'beta release' at this time, as it's not had much testing yet, certainly not by any real users.

A Stitch in Time

I've been doing some more work of late on 'A Stitch In Time'. And as a result of actually working on the book, I been making further additions to !-Trim which is the software application I've been writing to process and manipulate the page data of the original scanned images. It's had rather a lot of changes and additions of late, including the ability to convert the cropped images to JPEGs (well JFIFs) which are then embedded into the Drawfile output. The JPEG images are handled more efficiently in the PostScript output, which make a huge difference in processing time and file sizes when the pages are processed on the RIP. The only downside of converting the images to JPEGs in the Drawfile, is that they no longer contain any transparency (alpha channel) data that may have been present in the RISC OS Sprite file. The transparency data is added to the cropped Sprite when the cropped area needs to be an irregular shape (i.e. not rectangular). So, when converting to a JPEG the unwanted background area is painted in white. This does cause a problem for any transparent areas that overlap other cropped areas on the page as the white background will now obscure the underlying image, so the shape of the irregular frame is also output to the Drawfile as a hidden vector path (hidden as it has no fill or line colour). This path object can then be used to create a 'clipping path' to the JPEG image, thus re-creating an irregular shaped image again. The only problem is that !Draw doesn't have any concept of clipping paths, so the Drawfile will have to be imported into ArtWorks so a ClipView object can be created from the path and the JPEG.

Linux distros - a change

I'd recently been using Ubuntu on one of my PCs, but when the computer decided to pack-up (which I still need to investigate properly, but I suspect a static shock has killed the motherboard) I attempted to install onto another machine. I decided to use a machine which I'd built as a NAS (network attached storage) device, and had been testing FreeNAS, the plan being that after sufficient trials it would be deployed at work. I had, what seemed like, endless trouble trying to get Ubuntu to install and ended up installing Madriva 2008 Spring instead, as it was  included on a DVD that came with LINUX magazine. So far I'm happy with Mandriva and will be sticking with it. I think the problems with the Ubuntu installation was lack of memory as this new machine only had 256MB of RAM, of which some was being shared by the onboard graphics chip. I've since installed another 256MB simm and a separate AGP graphics card and everything seems to run very smoothly. I suppose I could re-install Ubuntu now, but I'll stay with Mandriva now it's all set-up.

Friday 18 April 2008

kotn i5

It's been a busy time of late. It's taken a lot of work but knitonthenet issue 5 has finally gone live. There's been a lot of late nights and long sessions this past week. Getting the magazine's content (all the patterns, features, photos, links, adverts etc.) ready for upload takes an incredible amount of time, but on top of that I've made some tweaks to some of the back-end php code that sits behind the site and controls how things work. In particular, I was getting some strange happenings with some links that wouldn't go to the correct URLs. I think the lack of sleep was beginning to take its toll on me as I couldn't find what was breaking things. But it's amazing that after just a few hours of sleep, how things can suddenly become clear. Well, not just clear but actually jump out and slap you in the face. All that was missing was a simple call to the very useful urlencode() function, and everything was working how it should be. But it's baffling that even though the site, and that particular bit of code, has been up and running for well over a year on the live site and about two years in the test suite that the problem has only just surfaced when one particular URL contained certain characters.

I've still got some things I want to add to the code that handles the dynamic, page sidebar, advert creation, but that will follow.

Thursday 7 February 2008

sprite rotation

I've been doing some further work on 'A Stitch In Time', which will be re-published later this year. All the artwork, printing plates and film from the original book, which was published in the early 1970s were destroyed years ago in a fire, so all the pages are having to be recreated and processed using modern scanning and image manipulation techniques. One problem has been that the printed pages are not all straight, meaning almost all the images need to be rotated. What makes this even more labour intensive is that nearly every image requires a different amount of rotation to bring it back square.



So needing something to make the job easier, I decided to write SpriteRotate - a RISC OS software application that will allow a Sprite[1] to be visually rotated in steps of 100th of a degree.



When first loaded, the image is scaled to fit the window but it can be viewed at any size required. A grid can be displayed over the rotated image to ensure that the image is correctly rotated square, and the grid position can be shifted if needed. Once the required angle is acheived a click on the 'Create Sprite' button will save a new sprite file of the rotated image.



When a new straightened image has been produced, it can then be loaded into another of my applications that allows different regions of a single image to be defined and cut into pieces. This effectively chops the large single scanned image into a number of smaller parts, each kept in the correct position in relation to the original. This is then saved as a Drawfile, which is a vector based graphics file format, that can also contain sprites. Above all, this allows large areas of white space to be removed from a page and cut down the memory and disc space requirements - making faster processing, printing, ripping screen redraws etc.



[1] A Sprite is the native bitmap image format used on the RISC OS operating system.

Sunday 20 January 2008

conditions of the race

Spent a large part of the day working through some of the 'backend' php code from kotn trying to track down a  race condition that was causing a problem with some files used for logging. It's just using a simple flat-file system as it doesn't need any complex database functionality, but the difficulties of finding and replicating the circumstances of a race condition can be an absolute nightmare! I did wonder if I should move it all over to SQL DB, but it's a little over the top for what's needed.

Anyway, I've re-written some sections of code in a number of files to see if it will (hopefully) improves things. Now, just hoping that it doesn't break anything else!

Saturday 19 January 2008

action man

LesPaul

Decided to lower the action on the Les Paul, so wound down the bridge a little and then tweaked the intonation to bring things back on track. It's now a much more playable guitar - well for my liking.

The guitar is a cheap, Gibson Les Paul copy made by Summco and at only sixty odd quid, is a fantastic instrument and extremely playable. It comes, like most off-the-shelf guitars do, with a reasonably high action, which for me was too high for lead playing. I'm also planning to try lighter gauge strings, probably a set of nines. Which is what I use on my strat (my main guitar).

I also fitted a Jim Dunlop Straplok, as I hate it when in mid session the strap comes loose and you're left stood there clutching the guitar and looking rather foolish. I know there are cheaper strap locking systems around than the Dunlop ones, but I've used them for years and have them fitted to some of my other guitars and they've never let me down yet. And it's handy to be able to swap straps over to one of the other guitars. On the subject of straps, I do find it difficult to find straps that I like. I do like the standard Fender straps, but I feel it's not really appropriate to put one on a Les Paul style guitar - although I do have one on my Epiphone acoustic - sacrilege!

Monday 14 January 2008

Layout

Well, just spent some time just trying to alter this layout so it looks a little better - this will have to do for now. At least it's a better width than it was.

First Post

The first post. Not very inspiring, I know, but got to start somewhere!