Easter Chick

Happy Easter! I’m away for a long weekend but this post was pre-recorded. I handmade my mum’s easter gift and wrote about it, but can’t publish until she’ll have got it!

Its a duckling from this pattern – knitted with fluffy wool on four needles. I used Snowflake DK and 5mm needles but I suspect it would have been better with 4mm ones as stated in the pattern however I only have one set of double-pointed needles.

Here he is anyway:

His beak and feet are made from orange pipe-cleaners. The beak was bent into shape and then the excess clipped off. The feet were shaped and then just pushed into the chicken through his woolly exterior and into the toy stuffing inside.

Happy Easter, mum :)

Kbuntu Add Programs

I’m just getting started with running a linux machine as my main computer at work (yay!), setting everything up today. My tip for installing linux the first time is to get the repositories of software added so you can install more things though “adept” (the program that runs when you choose the “Add/Remove Programs” option from the start menu). To add the repositories just edit this file:

  /etc/apt/sources.list

Then uncomment the lines as directed in the file. You will also need to get the list of available packages by running

  sudo aptitude update

Next time you go to “Add/Remove Programs” you’ll have a much bigger list to chose from, especially if you allow unsupported and proprietary software by ticking the boxes at the top right hand side.

9 Steps to PHP Documentation Heaven

  1. Download PHPDocumentor and uncompress it into a directory inside your web root.
  2. Access the web interface by going to phpdoc.php in the newly extracted directory
  3. Enter the directory you would like to document
  4. Enter the directory the output should appear in (this needs to exist and be writable by the user your web server runs as)
  5. Choose a template! My favourite is the HandS one, but there are others and you can create your own later on
  6. Press the create button
  7. If your code wasn’t already documented correctly then there might not be a lot to see at this point. Go to the PHPDocumentor tutorial to find out how your commented code can become shiny documentation you can use to blind your manager with science to empower knowledge-sharing within your team
  8. Regenerate the documentation
  9. Get the rest of your team to comment their code correctly

Now repeat steps 8 and 9 many times until you have beautiful documentation.

Form Name ID and Label Tags

Just a quick one, but something that confuses me often.

<input name="input_name" id="input_identifier ....

name is what the POST request will see the field called
id is what the label tag will use to figure out which field it belongs to.

Improvised Chicken

That title makes it sound like a recipe, but actually its a bird! I saw a pattern linked off CRAFT which was gorgeous so I rushed out and bought some snowflake yarn in yellow. When I came to read the pattern it was quite complicated and I was a bit fed up … so I sort of started fiddling with the wool, and a crochet hook, and I got:

He is about two inches tall and as cute as a button. I cast on 4 stitches (in the round), increased in each stitch on the next row and then switched to increasing every other stitch until he was wide enough. Went straight for a bit then decreased quickly (so he’s made from the top down). The wings are crochet but the beak is knitted because I couldn’t work out how to get such sharp edges in crochet.

I should also point out that its really quite hard to crochet with fluffy or eyelash yarns because you can’t see where the stitches are to stitch into! I managed but don’t look too closely at him – my rounds turned into a spiral quite quickly because it was so hard to see what was going on.

I hope you like him, and if you’d like to suggest a recipe for “improvised chicken” in case anyone gets here hoping for one then I’d be grateful :)

Can blogging get you killed?

I’ve just spent the last two hours reading through (this is a disturbing link, you have been warned) Kathy Sierra’s post about the death threats she has been receiving.

Death threats.

One of the most talented and inspirational writers of our time is currently locked inside their house in fear. How can that be right?

Its created waves in the blogosphere, I picked up the news from a blogher mailing list, and they have an excellent article on the subject on their site. The blogher mailing list people have also added their words of support to Kathy onto their own blogs, here and here. And it must be true because its even on the BBC News Website.

I hope this blows over for Kathy, as much as it can, and that justice runs its course. There’s overwhelming support for her but we can’t protect her in the real world and it only takes one nutcase to carry out these threats. She may stop blogging and I can understand that although I’d be gutted. I’ve posted to her site to say this, and also want to state here my support for Kathy whose articles inspire and educate me.

So here I am, a woman blogging on mainly tech subjects, with nothing to protect me but the fact that I have a very tiny readership. It makes you think …

Want to Meet Mantis?

Bug trackers are great. Keeping track of lots of little niggly things is tedious and hard to do even if you have pink post-it notes, which I do. But for a software development team there is no subsitute for a decent bug tracker [1].

That’s why I’m trying out Mantis for size. So far I’ve installed it and had an initial play and so far I’m impressed. Its got everything I’d expect and then some more, next I shall feed it some data and have a proper play. Its less slick than other products on the market (Eventum springs immediately to mind) but on the other hand it takes seven minutes to go from “I quite fancy a shot with mantis” to “cool status colours on the overview list” which is good.

Mantis is also temping as it integrates (or can with some help) with both subversion and dokuwiki. I’ll be having a shot at getting these all talking soon, and I’ll let you know how I get on.

1 So why have I come across so many teams that don’t use one? I have no idea, maybe you know.

PHP Best Practices

There’s a new thread started over at phpwomen.org about best practices for programming with PHP, which will make interesting reading for anyone looking to improve their skills. I’ve been really brave and contributed one of the articles, PHPDoc: Comments are your friends.

People are all contributing a little knowledge about the area they feel comfortable with and even at this early stage the results are impressive!

PHP Throwdown Icon

As you may remember we participated in the PHP Throwdown a while ago. Well Elizabeth has sent out the icons to competitors who successfully got through the 24 hours and submitted something which vaguely conformed to the rules. You can see ours on the left :)

Does PHP know itself?

I’ve run into a problem with a framework I’ve been contributing to. It has a bunch of objects, which look a lot like rows in database tables. So there are pages and each page object is a row in the “pages” table in the database, with a primary key called “page_id”. There are also sections and each section object is a row in the “sections” table in the database with a primary key called “section_id”… you get the picture.

So there’s a parent class called “Model” which figures out the magic table/primary key names in the constructor and can then do a variety of tricks on the generic data set. The various object types such as page then extend this “model” and use its methods. Which was going quite well until I tried actually calling the methods.

Statically.

Because I figured that even if the code was inherited from somewhere else, PHP would know which class had called it in the first place and so I’d be able to reference “self” and know what was happening. So wrong!!

Its a feature of PHP that in fact the self() object for a method called statically will always reference the place the code is actually executing. So in order for me to statically call a method which is going to return me an array of instantiated objects of whatever type I called the method against (still with me??), I must first instantiate an object of that type and call it in the usual way.

So in case you’re wondering what the variables $pointless_page and $pointless_section are doing at the top of my script then now you know! I love the little quirks that programming languages have …