Set Vim Shift Width

I have had a problem with vim for a while. Although I have my tabstop set to 4, when I use >> or << to indent or undent (technical term) my code, it moves the code by 8 characters. As I'm now working with phpcodesniffer, I’m pretty motivated to get my editor set correctly so I don’t waste time on formatting.

The setting I want is the shift width. I added this in my .vimrc file:

set sw=4

Hopefully this will help someone else with the same issues. I’ve been grappling with the tab/space/indentation settings for vim as long as I’ve been using it and I don’t think I’m done yet. Maybe one day I’ll solve it and write a big overview but for now, you can read the previous installment and pass on any tips you may have via the comments!

As an aside, I now completely understand why projects have vim settings in their files – I’ve got different coding standards going on inside different projects so I’m spending a lot of time fiddling with .vimrc these days!

PHP Training Courses from Ibuildings

Ibuildings (my employers) have announced their public courses in the UK – this is very exciting as its been in the planning for a while and of course it means more people can be using PHP to build excellent applications. There are more details on the Ibuildings site of the courses and dates available.

Our classroom training is a bit different in that we send one of our real, live software developers to come along and teach the course. I actually really enjoy doing training as part of my day job rather than as a separate job that I do instead, because I actively do the thing I’m trying to teach and find it easy to think of good examples of when a particular thing does or does not work. If you’re thinking of getting some PHP training, then have a look at the courses.

Home Made Yarn Swift

Some time ago I started a project, using laceweight mohair, which I blogged about. Its take 6 months to finish the first skein, which was wound into a ball by friends, and now I’m ready for the next one. I’ve been chasing around trying to find a wool winder I can borrow and also considering using a nostepinne but at 400 yards of yarn in a skein, I’d be there for some time doing that.

To cut a long story short, my boyfriend ordered me a surprise wool winder so I was off to a flying start – but I don’t have a swift (and I don’t plan on winding wool often enough to justify buying one as they aren’t cheap). So I googled and found this home-made swift on instructables – and decided I could make my own. Our lazy susan (5 quid from Ikea) is wooden so I didn’t really want to tape onto it, so instead I found a spare piece of MDF and clamped it to the lazy susan. With two coat hangers cable-clipped to the MDF, I was all set.

Ball Winder Yarn Swift Assembled

Making a yarn ball

It actually worked really really well, I had the two remaining skeins wound into balls in no time at all and I can carry on with my project, which is growing, if slowly! Look, I think I’m half way there:

Cobweb Wrap

Ada Lovelace Day: Kathy Sierra

In honour of Ada Lovelace Day, this is a blog post about a woman I admire in technology: Kathy Sierra.

I’ve been a big fan of Kathy’s site for a number of years, hers was the first site I saw where eloquent prose was wrapped around technical and relevant content. I’ve widened my reading list since that day but it made a big impression then, and re-reading the articles now it is clear I still have plenty to learn from them. Kathy’s blog Creating Passionate Users is stuffed full of great articles, and I prescribe all of them as good reading if you have the time. There are some gems in there though, that have completely shaped my own attitude to my profession and learning – its tough to pick favourites, but I would like to give mention to Angry/Negative people can be bad for your brain, the true but unchangeable When only the glib win, we all lose and of course Code like a girl.

A while after I started reading the blog, I started to hear more about Kathy Sierra herself and some of the things she’s done in her career – and its pretty impressive reading. She started her career in the fitness industry but with a strong interest in how the brain processes information she moved over into writing games. As a master trainer at Sun (wow!) she developed more ideas about learning and went on to co-found the Head First books. These are technical books with a very visual style, different from the drier offerings we usually see on software topics. Kathy also founded JavaRanch and is now a popular speaker across the technical conference circuit, inspiring many.

From the article so far, you can see why I name Kathy Sierra as an influence for me as a woman in technology – she has achieved so much and shared knowledge with so many. However, there’s another reason I hold Kathy in my mind. Almost exactly two years ago, she cancelled a speaking engagement at ETech following her reciept of threats of violence (including sexual violence). Her blog hasn’t had another post since her post regarding that episode. There was a virtual storm when it happened, with some very strong opinions on both sides of the fence – I even blogged about it myself at the time. Two years on, no more inspirational blog posts for me to read and my sense of injustice is as strong now as it was then. I also have this dark sense of vulnerability. I’m a woman in IT; I speak, I blog. I’m visible and one day I hope I’ll be successful – and of course I’ll always get comments made to me that are inappropriate, offensive and intended to hurt. That’s the price of being female and visible online, and the “pix pls” thing comes with the territory. But to be simultaneously female, popular, and successful in an online field … lets just say I’ve had my eyes opened to the dangers if I ever manage more than one of those.

I’ll wrap up by thanking Kathy for all her excellent writings, hopefully one day I will see her speak but already I’ve been educated and inspired. I wish I hadn’t also learned the darker things from her experience, but they’re definitely secondary and came along helpfully early in my career. Kathy Sierra is my inspirational woman in Technology – who is yours?

WordPress Automatic Update Asking for FTP

I have a wordpress installation that I look after (in fact its phpwomen.org) and since upgrading it to 2.7 I see that it has lots of “click here to upgrade” buttons, both for the core code and even to upgrade and install plugins. However when I click on these, either the core upgrade or to install/upgrade a plugin, I get prompted for my FTP details.

I found this odd, as I thought I was downloading and unpacking a file. I read around and there isn’t much information about this feature at all. It seems like such a useful thing if it would work, then I can give someone an admin login and they can just work everything from there without me giving them shell access. After a very frustrating few weeks of trying, I found out the answer.

WordPress can update without FTP

I don’t need to install FTP on my server (good, I don’t want to), I had incorrect permissions on my files. When the user that apache runs as can write to the wordpress directories, then the upgrade stuff all just works! The FTP credentials are for if the web server doesn’t have the right information, then wordpress prompts you for your FTP details, and attempts to use those to FTP back to the same server it is on to be able to write the files it needs. As wordpress is often used in a shared hosting environment, this makes more sense than I first thought.

I really hope that helps someone, I spent ages being confused over this “feature”! If you have any more details or information, or if this works for you, then please add a comment below :) I’m off to enjoy my new wordpress feature …

Trainer Lacing

I play a lot of sport, and wear almost exclusively Asics trainers (sneakers if you like the other kind of English) to do so. In fact I only wear one pair of trainers, to the gym, to classes and for netball – which might be a mistake. One pair of trainers used to make my toes go dead sometimes, usually when running. A woman I was playing netball with at the time re-laced my trainers and that stopped the problem. My new trainers are giving me the same problem, and luckily I was able to dig out those old ones and copy the lacing – so here it is for posterity (and for next time I have this problem and can’t remember how to do it).

Trainer Re-lacing
Lace the bottom of the shoe as usual, then with 2 holes to go, thread down into the shoe.

Trainer Re-lacing
Come up through the top hole on the opposite side.

Trainer Re-lacing
Staying on the same side, go back inwards through the hole you just missed out.

Trainer Re-lacing
Finally, thread each end through the loop on the outside of the opposite side of the shoe (see why I included pictures? This is tricky to explain)

I’m not sure why this works for me, I have a high instep so perhaps it relieves pressure on a key point? Anyway, if this works for you, or if you have any tips – leave a comment!

Open Office Presenter View

I was delighted to discover recently that Open Office have released a working version of their long-anticipated Presenter View. Both Powerpoint (from Microsoft) and Keynote (on the Mac) have these views which allow someone giving a presentation to see the current slide, the next slide(s), any notes associated with the current slide and some timing/progress information. Personally I’ve been booting into windows solely to deliver presentations for a couple of years now, partly for the Powerpoint Presenter View and partly because Linux isn’t very friendly about driving second screens.

Well, one of those problems has been eliminated with this new plugin for Open Office. It only works with Open Office 3 or above (I’m using 3.0.1). You’ll also need to download the extension from the project page which you can find here:

http://extensions.services.openoffice.org/project/presenter-screen

Go to Tools -> Package Manager and browse to the .oxt file you downloaded from the site, and restart Impress – hopefully everything should just work! The settings are hidden in the “Slideshow Settings” screen, look right at the bottom. And with luck, you’ll see your slides on your second screen as usual, and something like this on your main screen:

All I need to do now is figure out why I sometimes have issues with xrandr and projectors, and I’ll be ready to go!

Maker Faire UK

Yesterday I took the opportunity to pop along to the Maker Faire in Newcastle – its so exciting to see events like these in the UK! The marquee there was pretty small but what it had was great fun. I saw several things there that had me really drooling – one was a harp, another was a bracelet with LEDs on it, the idea being that you could have the LEDs get more intense or more agitated when you received more tweets/emails (except this wasn’t a working prototype, just a pretty idea). There were all sorts of other people there, including folksy and oomlout and an O’Reilly stand where I bought an instructables book.

We also popped over to the Discovery Museum, just up the road where there were a few more events happening. I haven’t been before and had a lot of fun looking around the various bits, especially the Science Maze. At the back of the science maze was a workshop where you could make a “throwie” – an LED taped to a battery and some magnets, for throwing at fridges and things, and then a darkroom with surfaces to throw them in.

throwies

Later on there was an appearance by the “robot” Titan. He arrived, and stood up … I was astonished to see a walking robot (walking is really tricky), especially since his shoulders seemed very large – and in the next heartbeat I realised it was a man in a grey plastic suit. There’s a few photos though on my flickr stream along with a few others from the day.

All in all I am very excited to see something like this happening in the UK and am on the look-out for the next event of this kind.

Simple SVN Merging

Today I had a big SVN merge to do – i’m at the end of a development cycle and I needed to merge my branch of changes back into trunk. I dug out my crib sheet for merging and tweeted that I had – and a few people asked me to blog it so here it is.

diff the relevant paths until the + and – shoe the operations you want to perform to your working copy

change into the equivalent directory on your working copy and replace the word “diff” with the word “merge”

That’s it.

Seems like a bit of a short blog post for something that a lot of people find painful, so here’s what I actually did, in more depth.

Example

  1. I had the branch I’d been working on checked out. I committed all changes and triple-checked that I had done that
  2. I ran svn log --stop-on-copy and noted the revision number which was the commit where I created the branch
  3. Next I took a checkout of trunk so that I could break things in my own space
  4. I changed into the new checkout and from the root of it, figured out what I should be diffing, piped it to more and read through the output to make sure I really was applying what I thought I was applying. svn diff -r[branch create rev]:HEAD http://path/to/repo/branch/ | more
  5. Then I ran the same command again but without the |more and with diff now replaced by merge
  6. I then checked my working copy, if there were conflicts I’d have resolved them, checked the system still worked, that sort of thing
  7. Committed my changes

I hope that helps – the same principle applies whether you are applying one fix or many fixes to trunk or branches – the key is to think about what it is you want to merge, and make sure the diff looks right. You can play with the diff without breaking anything for as long as you need to (which today was just as well because the first thing I tried was completely not the right one!) and once it looks plausible – merge those changes in and then untangle anything which has gone wrong from there. Hope this helps!

Blurb Book of Peru Holiday Photos

In January, Kevin and I went to Peru for a few weeks – to visit our friend Cally, and we did some touring while we were there. Between the two of us, we took almost 3,000 photos. Which is way too many to make granny sit through when we got home. I tried showing people the photos I put on flickr, but they make little sense since Kevin has (at least) half the good ones in his flickr stream. So instead, got a blurb book of our holiday photos – to easily show people, and to keep.

Blurb Book

Apart from a few that came out darker than we expected, and the book taking WEEKS to arrive, its absolutely ace! Some of the photos look amazing in print – even more so than they do on the screen. We rarely have hard copies of any of our photos so this is quite a treat for us as well, and the book is really nice quality for us to have on our bookshelves.

Inside the Book DSCF4982

Doing it this way was much less labour intensive than getting them printed and then scrapbooking them up or something – OK potentially this was less fun but at least its actually done and not sat on my to-do list :) We did all the layout ourselves, combined both our flickr sets (after we’d both gone through and edited and captioned the lot anyway), and just pressed the button. A few weeks later, the finished book arrived – yay!