You are viewing [info]razinaber's journal

On moving

Yosh!
It's such a relief to be moving. I've been stressing about my post-Aber life for going on two years now so it's wonderful to have a new home lined up. I picked up the keys to my new apartment on the 21st of May and have spent the last two weeks doing the most cleaning and decorating I've ever done in my life. The flat wasn't left in an awful condition by the previous tenant, but nothing was cleaned, beyond the carpets which were given a quick hoover. This has led to a near endless series of cleaning tasks to remove years of neglected grime from things like the shower, fridge, freezer, washing machine, extractor, air vents and so on. The good news is I've nearly finished cleaning. Nearly. Decorating is also taking a long, long time. The living room was the toughest, as the previous tenant was a filthy smoker. Which resulted in the ceiling and walls needing to be washed down multiple times, the carpet thoroughly deodorised, the curtains washed (oops they shrank a bit!) and a total repaint. So far the only other room I've repainted is the hallway, the master bedroom is part painted as I write this and I hope to finish this off next week. I'm already sick of painting and buying expensive cans of paint and cleaning rollers and brushes. But on the upside it's great to be able to put my own stamp on the place and have a choice over the colours rather than being stuck with just magnolia on everything.

Aside from cleaning and decorating which has been wearing me down, I really love the flat. It's huge, the living room and kitchen alone are about the size of my Aber flat, with a very generously sized master bedroom with en-suite and smaller second bedroom that will serve as my office. As this is my first unfurnished place I've had to buy a ton of furniture, which even with some help from my dad has cost me rather a bit and I'm not even done yet! But it's wonderful having my own bed and mattress and sofa at last. It makes this feel like my first proper grown up home with all my own stuff in it and my own paint on the walls.




View from my balcony over the Rochdale canal



The views from both the front and back of the apartment are fabulous, particularly on the canal side where I can watch ducks and canada geese quaking and honking away merrily from the balcony. I'm also afforded wonderful views of the Pennine hills climbing far, far above the valley floor on both sides. The location is great for a number of reasons beyond the sheer scenic beauty of the area however. I'm within a minutes walk of a Sainsburys Local and post office, 5 minutes from a small Co-op, train station with regular services to Manchester and Leeds and a couple of minutes from the bus stop with services running every 10 minutes to the wonderful nearby towns of Hebden Bridge and Halifax. To top it off; Gareth and Penny are but a short walk away, Matt P is a little over an hour away in Macclesfield and Dan B (an old friend from uni) is 30 minutes away near Rochdale. Did I mention this place is £50 cheaper a month than my studio in Aber?

I will certainly miss the friends I'll be leaving behind in Aber, and the town itself, it's been home to me for much of the last decade and is full of memories. But I'm really happy to be moving on a bit with my life, it will be great to make new friends and discover new places. Best of all I feel like I've found a place a bit like Aber, but without the isolation.

Mytholmroyd

Yosh!
So I'm leaving Aber this summer, at last, although the exact date of departure is still being worked out. I need to be out of my old flat by the end of June when the tenancy agreement finishes so that sets the upper time limit.

After I failed to find anywhere nice down Oxford way I decide to try casting my gaze further north and have settled on the lovely village of Mytholmroyd which lies roughly half way between Manchester and Leeds with excellent transport links to both. I had originally hoped to find somewhere in Hebden Bridge which is a mile up the road on the Manchester side, but a lack of nice properties within my price range caused me to widen my net a bit. As a result I've found a really lovely, spacious and modern 2 bedroom apartment with a huge balcony overlooking the Rochdale canal and green, leafy hills beyond for an extremely reasonable £450 a month. Throw in that it's only five minutes from the train station and local supermarket and it's very hard to find fault. It also has the benefit of having the lovely Gareth and Penny very nearby, if only for another year or so.

The apartment has a nice large living room with aforementioned balcony, leading to a modern kitchen, two bedrooms - one with an en suit shower room, bathroom, storage cupboard with hot water tank and entrance hall. Once again I've managed to find somewhere on the top floor (my 3rd consecutive flat with this feature) so there's a fair few steps up to it. On the upside this improves security and reduces heating bills a bit. It also means I don't have to worry about anyone clonking around above me.

The apartment will need a bit of a repaint before I move in but as I fully expect to have at least a month to start transitioning things over that should work out alright and be fresh and sparkly by the time I'm done with it. Hopefully I'll be able to do a bit of a house warming at some point!

I'll post some pictures and things once I've moved in as the ones I snapped for my own reference aren't that super.

PS - it's pronounced My-th'm-roid

Vintage code retrospective

Yosh!
Backing up your data is important. Early trials and tribulations experimenting with Linux (Redhat 2, Slackware and Caldera) and OS/2 Warp when I was a teenager quickly taught me that. I screwed up my PC on more than one occasion which got me into the habit of making sure I had copies of my important stuff stashed away on floppies, then removable Syquest cartridges, then Zip disks and finally on to CDs and DVDs. Handily as a result I now have an archive of my work dating back a little over 14 years. It's some of that really old stuff I'd like to talk a bit about today.

I've never liked Windows. But I was a PC user for about 5 years from 1995 through 2000. As I've already alluded to, I've experimented with many alternative operating systems (some kids did drugs, I did operating systems - I wonder which caused the most longterm mental damage). Unfortunately they were all pretty universally shit in one respect or another. This combined with a strong interest in programming often had me pottering away building my own GUIs (graphical user interfaces) on top of DOS. If you're too young (or old) to remember DOS, it was a command line driven operating system that sat beneath Windows until they switched to using the Windows NT kernel from Windows 2000 onward. You typed a command and it either did something or gave you an unhelpful error message. Abort, Retry, Fail?

At first I wrote software with DOS's bundled QBasic, where I cut my programming teeth, then on to a dodgy copy of the commercial version of QBasic (QuickBASIC) which could actually compile executables (which was a big deal as the speed difference between interpreted and compiled code was very noticeable back then). Then finally I bought a copy of PowerBASIC which was much more powerful and faster than QBasic.

Building a GUI is actually rather involved, especially when you're starting from scratch, which on DOS I was. It took a lot of trial and error but over several years I built up a set of libraries which I termed "Widgets". It grew from version to version adding features and functionality. I went from the very basic act of drawing a grey box on the screen with a 3D bevel around it to make it look like a button, to making that button clickable with the mouse, then to creating the fonts and text layout functions needed to write a title on it. Building a GUI in DOS was like building a chair out of a tree and some iron ore. Each element required a number of steps of increasing complexity to refine the raw materials into the components needed to make the end product.

This is an early font demo I made to show a friend, circa 1996.



Each letter was encoded in a bitmap format, for example this is how the letter 'A' was stored:
"A 000 n0 0 n0 0 n0 0 n00000 n0 0 n0 0 n0 0 n0 0 n n n "
Which if you break it up onto multiple lines after each 'n' you'd see a recognisable representation of the letter "A". The bold and italic variants were made by simply changing the way the bitmaps were drawn at runtime.

As an aside, back then I used to publish my work under the brand name of New Technologies which I usually abbreviated to "Nt" which you'll see in a few of the screenshots.



Getting a bit more interesting, this is a screenshot of an early icon designer I wrote (I've always liked drawing icons and they're essential when you want to make your own shiny GUI). When I got this code running again at first I thought there was a problem with the mouse driver in my DOS emulator but then I realised at this point I didn't have the mouse working in QBasic so it was all keyboard driven.



This is my first stab at a full on GUI environment called AdvanceOS. This particular GUI drew inspiration in particular from early builds of BeOS which at the time looked like it would form the foundation of the next Mac operating system and was of major interest to me even though I lacked the hardware to run it. This was a late QBasic app and still lacked mouse support so it was all keyboard driven. Widgets at this point was still quite basic. In brief AdvanceOS comprised of a note viewer which supported limited rich text, a picture viewer that only supported my own proprietary bitmap format and a file browser. To my amusement I discovered that I'd also built in quite a decent graphical error logger which I got to see in action as the file browser choked on some metadata files MacOS had dumped on the disk at some point prior to it being imaged.



This is a graphical font designer I wrote. Note the mouse cursor! Things are much more sophisticated now with pull down menus, a draggable window and more control types. The font format too has evolved a lot, in particular I did a lot of work to make it as fast as possible. You could watch each line of text being drawn with my earlier attempts, my later font system which I dubbed the "Advanced Font System", could fill the screen with text in an instant. Rather than simply storing a bitmap for each letter, it instead used a vertical run length encoding (RLE) algorithm. Here is how the letter A was encoded in a similar font to the one shown above:

"065 05 07 .000. 1612131213121316"

The first three digits are the ASCII code of the character, then the width and height. Then there is a line that sets the initial state of each column of pixels in the character. For whatever reason I used a period to represent transparent, "don't draw anything", and 0 to represent a solid colour. Each number then corresponds to alternating lengths of transparent or filled pixels. It knows when to get to draw the next column when the number of pixels drawn (or not drawn) equals the height of the character. This would have been a nightmare to type out by hand, but was made possible by the graphical font designer. If you're wondering how it handled lines larger than 9 pixels have a look in the code listing below.

The code I wrote looks totally unintelligible to me now it's been so long since I did any work in BASIC. This is the algorithm to decode an AFS character:

Sub Decoder(x,y,char$,col) Public     '-- Converts AFS to screen
  Dim InitCodes(1 to 40) as Byte

  w = FontW(asc(char$))
  h = FontH(asc(char$))
  dat$ = FontData(asc(char$))

  l = 0: a = 0: oldl = 0

  For i = 1 to w  '-- Generate init codes
    If Mid$(dat$,i,1) = "." then InitCodes(i) = 0
    If Mid$(dat$,i,1) = "0" then InitCodes(i) = 1
  Next i

  If InitCodes(1) = 1 then d = 1 else d = 0
  i = -1

  Do
    strt:
    i = i + 1: a$ = mid$(dat$,i+w+2,1)
    oldl = l

    If a$ >= chr$(97) then '-- Allows very long fonts (up to 39 pixels)
      i = i + 1
      If a$ = "a" then l = l + 10 + val(mid$(dat$,i+w+2,1))
      If a$ = "b" then l = l + 20 + val(mid$(dat$,i+w+2,1))
      If a$ = "c" then l = l + 30 + val(mid$(dat$,i+w+2,1))
    Else
      l = l + val(mid$(dat$,i+w+2,1))
    End If

    If d = 1 then
      If FShadow = 1 then Line (x+a+1,y+oldl+1)-(x+a+1,y+l),ShadowColor
      If FShadow = 1 and bold = 1 then Line (x+a+2,y+oldl+1)-(x+a+2,y+l),ShadowColor
      Line (x+a,y+oldl)-(x+a,y+l-1),col: d = 0
      If Bold = 1 then  d = 0 : Line (x+a+1,y+oldl)-(x+a+1,y+l-1),col
      Goto ContFont
    End If
    If d = 0 then d = 1

    ContFont: '-- Another *great* line label
    If l = h then
      If InitCodes(a+2) = 1 then d = 1 else d = 0
      a = a + 1: l = 0
    End If
  Loop until a$ = ""
  Erase InitCodes
End Sub


You wouldn't call this function directly, there was a nice friendly string drawing routine.



This is IconWORKS which I completed in 1998, an icon editor and animator which was built on top of my final Widgets library, by then up to version 8. It supported a rich variety of controls including text entry (which can be very complex), multiple windows and even bits of animated UI eye candy. The mouse graphic which showed the colours assigned to each mouse button moved to track the relative position of your cursor on the screen.

You may think by this point I've strayed from my original goal of building a GUI environment to focusing on developing a GUI API (application programming interface). This is some what true, but I did write one last project that I finished around the end of the 6th form that went back to my original desire to build my own self contained GUI environment. It was called Zenith. It was built using Widgets 8 and used SVGA graphics. You'll note up until now all my work has been done at VGA (640x480) resolution with 16 colours. Believe me I would have loved to work with more but this was the highest standardised resolution you could use in DOS, anything more needed specific graphics drivers and a library to interface with them). However eventually I managed to get hold of a VESA graphics library for PowerBASIC that supported SVGA (800x600) with up to 256 colours on any system with a VESA compliant graphics card. Zenith was an environment for running programs written in Ze script. A simple scripting language I devised to build graphical apps using my Widgets library. Frustratingly I'm missing a couple of important files that prevent me from showing any shiny screenshots of it running. It relied on a palette file to define the colours used without which everything looks horrible as its using arbitrary colours, most of which seem to be shades of black. I'm also missing the final version of the demo script I wrote to fully show off it's capabilities which is annoying.

I did find a couple of Ze scripts I wrote including this calculator. I think it works but its hard to use as it appears as a largely black box. I thought I'd include the code listing for those technically minded to have a look over.

# ZeCalc

# Example program in the Ze programming language.

init
  def_window(1,300,200,200,230,"<B>Ze</B>Calc")
  int(a,0)
  int(b,0)
  int(total,0)
  int(number,0)
  str(button,0)
  str(screen,)
  int(opp,0)
  show(1)
  focus(1)
end

# Main

window(1)
  #-- Display
    raise_box(5,5,190,40)
    drop_box(15,15,170,20)
    box(17,17,183,33,132,BF)
    font(0,0,"<B>",0)
    font(20,22,$screen,0)
    font(0,0,"</B>",0)
  #-- Function Buttons
    raise_box(5,50,190,30)
    button(10,55,20,20,"+",add)
    button(35,55,20,20,"-",min)
    button(60,55,20,20,"/",div)
    button(85,55,20,20,"x",mul)
    =($button,"-")
    button(110,55,30,20,"-/+",update)
    button(145,55,40,20,"C",reset)
  #-- Number Buttons
    raise_box(5,85,190,126)
    =($button,"7")
    button(12,90,55,25,"7",update)
    =($button,"8")
    button(72,90,55,25,"8",update)
    =($button,"9")
    button(132,90,55,25,"9",update)
    =($button,"4")  
    button(12,120,55,25,"4",update) 
    =($button,"5")
    button(72,120,55,25,"5",update)
    =($button,"6")  
    button(132,120,55,25,"6",update)
    =($button,"1")  
    button(12,150,55,25,"1",update)
    =($button,"2")
    button(72,150,55,25,"2",update)
    =($button,"3")
    button(132,150,55,25,"3",update)
    =($button,"0")  
    button(12,180,55,25,"0",update)
    =($button,".") 
    button(72,180,55,25,".",update)
    button(132,180,55,25,"enter",calc)

end(1)

term

subs
  sub add
    val(%a,$screen)
    =($screen,)
    =(%opp,1)
    =($button,"+") 
    call(screen)
  end_sub

  sub min
    val(%a,$screen)
    =($screen,)
    =(%opp,2)
    =($button,"-") 
    call(screen)
  end_sub

  sub div
    val(%a,$screen)
    =($screen,)
    =(%opp,3)
    =($button,"/") 
    call(screen)
  end_sub

  sub mul
    val(%a,$screen)
    =($screen,)
    =(%opp,4)
    =($button,"x")
    call(screen)
  end_sub

  sub screen
    refresh_on
    box(17,17,183,33,132,BF)
    font(20,22,$button,0)   
    refresh_off
    =(%number,0)
  end_sub

  sub update
    +(%number,%number,1) 
    if(%number,=<,10) then concat($screen,$button)
    refresh_on
    box(17,17,183,33,132,BF)
    font(20,22,"<B>",0)
    font(20,22,$screen,0)
    font(20,22,"</B>",0)
    refresh_off
  end_sub

  sub calc
    val(%b,$screen)
    if(%opp,=,1) then +(%total,%a,%b)
    if(%opp,=,2) then -(%total,%a,%b) 
    if(%opp,=,3) then /(%total,%a,%b) 
    if(%opp,=,4) then *(%total,%a,%b) 
    refresh_on
    box(17,17,183,33,132,BF)    
    font(20,22,"<B>=",0) 
    font(26,22,%total,0)   
    font(20,22,"</B>",0) 
    refresh_off
    =($screen,)
    =(%b,%total)
    =(%number,0)
  end_sub

  sub reset
    =(%number,0)
    =(%a,0)
    =(%b,0)
    =(%total,0)
    =($button,)
    =($screen,)
    call(screen)
  end_sub

term.


It's a fairly basic scripting language but I'm still quite proud that I came up with this when I was 18 ^_^. A Ze script is split into three parts, initialisation where variables are declared, window declarations that define the GUI and subroutines that can be called to perform specific actions and update the GUI. You could have multiple simple apps running together as long as they were written in the same file.

So there we are, a brief history of my BASIC coding days and how I tried to build my own GUI enviroments. I hope you enjoyed looking over this old stuff as much as I did, if you're not a programmer and got this far then congrats, and remember it's never too late to learn ;) By the way, the story also has a happy ending because I finally found an OS that I liked when I got my first Mac!

iPad 3 review

Yosh!
I’ve been using a 1st generation iPad since before they were officially available in the UK back in April 2010 and I love it. Now with the announcement of the 3rd generation model it’s time for an upgrade. My old iPad still works great but the hardware specs of the new model are so different I really need one in my hands to be able to test my software works well with it. The downside of being an iOS developer in this case is that I can’t sell off my old model just yet as I’d like be able to guarantee my software will still work well on the original iPad for at least another year. Oh well my iPhone 3GS can keep it company.

So before launching into the review I’d like to first mention what I use my iPad for, I still often see people asking what the point is of tablets so this feels relevant. Feel free to skip ahead.

My usage for the iPad falls into roughly three categories:

Second screen - I often use my iPad on my desk next to my main computer to keep an eye on NHK, the BBC news or Twitter.

Casual gaming - I’ve spent countless hours playing games on my iPad. Whether it’s Angry Birds, Tower Defense Lost Earth, World of Goo, Carcassonne, Ticket to Ride, Small World etc. The iPad is a fantastic gaming platform and while it’s never going to be ideal for first person shooters, there are still lots of immersive and very fun games available which make excellent use of the multi-touch screen.

Away from desk Internet stuff - the iPad is wonderful for browsing the web, firing off a quick email or exploring images from 500px or Flickr in situations where a laptop is awkward to use. Think lying in bed or curled up on the sofa. Even in a cramped train seat, the iPad is much more convenient than even a small laptop. I know some people still like to whine about the lack of Flash but if this ever was an actual issue it seems even more irrelevant today than it did in 2010.

The Review



First lets look at what’s new, coming from a 1st gen iPad the difference in specs is quite significant:

iPad 3 (wifi)iPad 1 (wifi)
CPUDual core 1GHz A5X CPUSingle core 1GHz A4 CPU
RAM1GB256MB
Display9.7” 2048x1536 IPS9.7” 1024x768 IPS
Cameras5MP rear camera, VGA frontNo cameras
WirelessBluetooth 4, 802.11a/b/g/nBluetooth 2.1, 802.11a/b/g/n
Sensors3 axis gyro, accelerometer, digital compass, ambient lightAccelerometer, digital compass, ambient light
Weight650g680g
AirPlayAudio, video, screen mirroringAudio, video
Storage16, 32 or 64GB configurations16, 32 or 64GB configurations


The screen

The screen of the iPad 3 is simply gorgeous. There was nothing wrong with the screens of the previous two generations, they were better than most laptop displays even, but the sheer pixel density on the new retina display is lush. It's most noticeable with text - rather than text looking like a pixelised equivalent of what you see on a printed page, it looks like you're reading glowing paper.

Ergonomics

Coming from the 1st generation iPad, the ergonomics of the iPad 3 are vastly superior. It feels so much nicer to hold. In particular the tapered edges now make it much harder to accidentally press the lock or volume buttons. In fact while I always used to be able to feel the orientation of my old iPad by where the buttons were poking out, that's no longer the case now which is refreshing - it no longer feels like there is a right and a wrong way to hold it in landscape or portrait.

Under the hood

Performance is very snappy, while the 1st gen iPad was always pleasant to use, there were a few places under iOS 5 where things weren't quite as smooth a I'd have liked. The dual core A5X handily takes care of that. The benchmarks I've seen put raw CPU performance on a level pegging with the iPad 2's dual core A5 which by all accounts was already a speedy chip. It seems the added 'X' is purely an acknowledgement of the new quad core PowerVR GPU. Indeed graphically intense 3D games like Infinity Blade 2 and Mass Effect Infiltrator look amazing and run very smoothly. It's not quite XBox quality but it's pretty damn close. Now if only they would port Skyrim!

Sound

The built-in mono speaker produces a fuller sound than the original iPad's which is nice for games and things although using headphones or AirPlay speakers are obviously preferable for music where possible.

Voice Dictation

Voice dictation works but isn't marvellous and seems to perform much better in video reviews I've seen with American's using it. Hopefully as its largely server side this will improve over time as its algorithms get better trained at dealing with non-American accents. It would be nice if Siri got brought over from the iPhone 4S, but I'm willing to believe the main reason why it hasn't thus far is due to Apple having trouble scaling the service to meet demand.

Video mirroring

If you have an Apple TV you can wirelessly mirror the iPad's screen to your TV (albeit it cropped to match the iPad's 4:3 aspect ratio). Performance is very smooth and with very little lag. It could be quite fun for certain games, especially those that let you utilise an iPod touch or iPhone as a controller. As with the 1st gen iPad you can also simply stream video (from apps that allow it) and audio from pretty much anything. Great if you find a funny video and want to share it with a group quickly.

Cameras

My old iPad had no camera at all so it's nice to now have two available. In the back is a 5 megapixel shooter using the sensor from the iPhone 4 and the improved optics from the 4S. It seems decent enough but I don't know how useful a rear camera on a tablet is. Perhaps for quick and dirty document scans or augmented reality applications? The front facing camera is still of the mediocre VGA variety. I'd much prefer the cameras to be reversed with the 5 megapixel one on the front.

Conclusion



As a piece of hardware the iPad 3 is damn near perfect, and while an argument could be made for including an SD card slot, I think the biggest limitations are purely in software at this point. Which is good because software is easily updatable and Apple has a generally good track record of keeping its devices running the latest OS versions for 3 years or more.

Starting at £399 for the 16GB model, the iPad 3 isn't unduly expensive and for anyone looking to upgrade from a 1st generation iPad or some other tablet it's a no brainer. Especially if you read a lot of text you'll really appreciate the amazing new screen. While e-ink will probably remain the undisputed champion display type for reading plain text, for anything which includes richer content and benefits from colour, the iPad's retina display simply has no competitor.

Things get more complicated if you currently own an iPad 2, as really the only major improvement you'll see is the screen - which is not to be sneezed at, the screen is the iPad, but if you're not bothered about super crisp looking text and images it's probably worth waiting for the iPad 4 next year. It's also worth noting that the iPad 2 can now be had for the bargain basement price of £330 which makes it fantastic value for money.

More Making

Yosh!
A few weeks ago I had the idea of making a clock. I wanted to make something a bit unusual and fulfilling the geek ideal of having lots of little blinking lights. It occurred to me it would be quite neat to have all the digits for the hours, minutes and seconds stacked up in columns. After a few variations I eventually came up with this design:




This design was a lot more complex than the lamp I had made previously and required the combination of two different types of acrylic and mount board along with a lot of electronics. Needless to say I spent a long time in Illustrator tweaking and poking things. When I got all the parts delivered (within 48 hours of uploading my design which was pretty amazing) I quickly discovered how unforgiving acrylic plastic is and that in the real world tolerances mean what's described as being 3mm thick may actually be 2.99mm or 3.01mm thick. Which doesn't sound like much, but when you're dealing with a very hard, brittle plastic like acrylic that's the difference between two pieces happily slotting together or not fitting at all. It also turns out if you try and apply much force to connect two pieces, that rather than bending ever so slightly to accommodate you (as plywood does for example) the plastic snaps at its weakest point instead. Which is what happened with the back panels and one of the side panels of the clock frame, requiring an expensive redesign which added about £30 to the build cost on top of the £60 it had already come to. Ouch.




Here you can see two slot shapes, the one on the left is a simple rectangular cut measuring 3mm x 6mm. This kind of slot is what I originally used in my design. Turns out it's awful - it's structurally weak and it requires the connecting part to be exactly the right size or smaller in order to fit. This is fine with a pliable material like wood but no good for a material like acrylic. Each of those sharp corners is just waiting to crack when placed under stress. In the slot on the right, it tapers from being about 0.2mm wider and taller than the connecting part down to the exact size at just four small points. It also has rounded corners cut to distribute stress more evenly. It's this shape I used in the revised design and I'm glad to say it worked well, holding parts firmly but without needing a great deal of force to assemble.

The electronics of the clock are modestly complex, it uses a grand total of 45 LEDs to illuminate the digits for the hours, minutes and seconds. Driving all these LEDs is an Arduino Uno, an easy to program, open source microcontroller. Because the Arduino doesn't have enough outputs to run 45 LEDs directly I had to hook up a series of 6 shift register chips to multiply the outputs. Each shift register gets you an additional 8 outputs. You talk to the shift registers in binary, sending a sequence of 0s and 1s which tells them to either turn on or off one of their outputs. Handily they can chain together and this method only uses three of the Arduino's digital pins leaving lots open for other purposes.




Click the photo to see the full size version.



In order to keep my clock running at the proper time I added a real time clock (RTC) module. This is a tiny chip with a backup battery. Once you set it to the desired time it will just keep running happily on its own with no external power needed for as long as seven years. The software I wrote to operate my clock simply queries it periodically to make sure its in sync. So when ever my clock is powered on it immediately sets itself to the correct time from the RTC module. Wouldn't it be nice if your typical alarm clock had one of these! For adjustments I added a couple of tactile buttons and a small piezo speaker for alarms and chimes.

As well as simply telling the time I wanted the clock to be fun to watch so I programmed in several animations which it performs twice a minute. These include displaying the day of the week as a kanji, randomly blinking all the LEDs on and off and sweeping patterns. It audibly counts down to the hour with a 'beep beep beep boop' and sounds a quick bleep at half past the hour. Because all the animation effects and beeping might be disturbing during the night I set it to have a 'quiet period' which runs from 2am to 8am at present which silences all the sounds, disables the animations and turns off the seconds column.




The TowerClock, mounted on my wall.



All in all this has been a really fun, if rather time consuming and expensive project. Making something practical with the Arduino has been great fun and it's certainly helped me brush up my soldering skills. I also learned a lot about working with acrylic which will hopefully save a lot of money in future projects.

Complexities of riding the bus in Japan

Yosh!
Busses in Japan are surprisingly complicated and it's taken me a little while to get used to all the various methods of buying tickets/paying for rides/working out when its my stop. But I think I finally have it down:

Tickets

There are four possibilities when it comes to buying a ticket depending on the particular bus/operator:



  1. The pass - if you buy a pass for a given area (often combined with rail passes) then life is easy, show your pass to the driver or conductor when you get on and off the bus.

  2. The flat rate - often city busses will have a flat rate fare for travelling around the city center. Typically you drop your coins in the box by the driver and that's that.

  3. Buy a ticket at the bus stop - sometimes at stations you have the option of buying the ticket to your destination from either a ticket vending machine or kiosk. You often have the choice of buying a return ticket if that's required.

  4. If none of the above apply, when you board the bus (taking note to use the correct entrance if there are two or more) take a numbered ticket from the dispenser and take a seat. Keep an eye on the big display at the front of the bus, it will show the current fare you owe based on the number on your ticket. Kind of like the meter in a taxi.

  5. What about our way? - I've yet to come across the situation where you state your destination and pay the fare on boarding. I'm not saying it doesn't happen somewhere in the archipelago, but it's not the norm.



When is your stop

  • Busses going to popular tourist destinations often have prerecorded bilingual announcements. This is also often displayed on a monitor at the front of the bus. Count yourself lucky, this is as easy as it gets.

  • Listen to announcements in Japanese, hopefully you can pick out the place name. Electronic signage will usually cycle between kanji, hiragana and romaji for a place name, or at least kanji and hiragana. Learn kana before going to Japan, you'll be glad you did.

  • If you have a bus route map (if you buy a ticket at a kiosk you will often be given one, yay) keep an eye out for stop numbers, even if the place name is displayed in Japanese you'll likely still get arabic numbers. Don't confuse the numbers on the fare display board with bus stop numbers!

  • If you've got a smartphone on you and you don't mind paying exorbitant data fees you can use Google Maps and your in-built GPS to see if you're near your destination. Some carriers (O2 and Vodafone from my experience) offer some data packages which while expensive aren't as bad as paying £6 a MB.

  • Ask the person next to you - if you're sitting next to a westerner or Japanese person who speaks English you're super lucky. Chances are it's actually an old lady who is bemused to see this strange white person sitting next to her making alien noises. You could try a "koko wa place desu ka?" (is here place?). Hopefully you'll get a straight forward "hai/yes" or "iie/no" answer to that.

  • If you're not sat next to anyone, don't have a smartphone and otherwise can't puzzle your way out, you're only other recourses are looking out the window and hoping you recognise the place or asking the driver at an opportune time. Don't expect the driver to understand English either by the way. Bad luck friend.



Paying up

Depending on your ticket/lack there of:



  1. If you have a pass then there's likely nothing to pay, huzzah, wave it at the driver, utter thanks and alite

  2. If it's a flat rate you've probably paid when you got on the bus, if not do that now and alite. As a side note if you don't have change there are often change machines that will take a ¥1000 note. Some busses in major cities also accept contactless payment methods (think Oyster) if you have an appropriate card (suica, pasmo etc).

  3. If you've bought a ticket at the bus stop you'll either get it stamped, torn or be shown to drop it into the change bin by the driver.

  4. If you had to take a number ticket, look up at the display as you make your way down the aisle, the figure shown by your ticket number is what you pay. Simples!



Other notes

  • Japanese busses tend to be designed for maximised standing room, this often means there is very little seating, or only single seats down the length of the bus. If you want a seat make sure you're very near the doors before boarding, like us Brits the Japanese like to queue. Sometimes at really popular stops you'll actually have to wait for another bus to come along before you can board.

  • Sometimes there are foldout seats that block the aisle which you can use while the bus is moving. Obviously you have to keep getting up every time the bus stops but it beats standing all the way on a long journey and puts you in a good position to nab the next seat that becomes vacant.

  • As with trains, it's generally considered really rude to speak on a mobile phone on the bus. Keep an eye out for 'priority seats' as often you're not supposed to use your mobile phones at all in these lest you zap some old dudes pacemaker with an errant microwave.

  • As with everywhere, press the button near your seat to ring the bell for request stops.

  • Like everything in Japan, busses generally run on-time, although they're still ultimately a slave to traffic conditions.

iPod Nano 7G watch review

Yosh!
The term iPod is synonymous with portable music, but when Apple chopped the iconic click wheel off the 6th generation Nano series and replaced it with a tiny square touch screen they opened the device to some interesting new possibilities. Along with the iOS style makeover they gave the iPod OS, they added a nice clock app that could be set to appear when the device is woken by tapping the sleep/wake button. Almost overnight the ever growing Apple accessory market started producing watch bands so people could wear the Nano on their wrist. Seeing the growing popularity of Nanos used as watches, when Apple updated the device's firmware last year they added a large selection of different watch themes to the clock app. Everything from glowing nixie tubes to Mickey Mouse.

When I first saw the announcement I thought "cool, that looks pretty neat", but I didn't have any great desire to run out and buy one. I already had a very nice chunky Black Dice Industries Cash watch and wasn't really in the market for another. Initially there was some speculation that the new Nanos were running a cut down version of iOS but this turned out to be false, it was a very faithfully restyled version of the iPod OS instead. Given that took away any possibility I'd be able to write apps for the thing any further reason to get one evaporated quickly. After the new firmware update was pushed out last year along with the 7G model, I again found myself interested by the Nano. But it wasn't until I finally got the chance to spend some time playing with one at Bic Camera in Kyoto that I got just how awesome the device was. So taking advantage of the relatively low price of the Nano in Japan (about £30 cheaper than the UK!) I decide to spring for one.

iPod Nano 7G in TikTok strap



Since then I've been using the Nano pretty exclusively as my watch of choice. Originally with a fairly cheap, but comfy silicone rubber style watch band and now with a better looking and more sturdy TikTok strap.

So how does the Nano fare as a watch? Well it looks great, the watch faces are very nicely designed and there's going to be one in there to suit most people's tastes. It's also easy to change the style to match your mood or the occasion. After years of having watches with fiddly tiny buttons that require far too much pressure to actuate, it's a revelation to be able to use the same taps and swipes familiar from the iPhone and iPad, to set things like timers and change settings on the Nano. You also get the added benefit of having an MP3 player on your arm too; along with an FM radio, pedometer that syncs with Nike+, photo album and voice recorder when used with an iPhone headset. Overall I really like it, and it gives a little glimpse at what watches of the future will be like. Given the technology of digital watches has largely stagnated since the 80s it's about time someone breathed some life into the industry.

There are some downsides though - and they're not insignificant. So while all of the Nano's strong points weigh in the device's favour for a geek like me, I think the following probably count a little too heavily against using the Nano as a watch for most people. These negatives are in the order of severity:

- Lack of glanceability (it takes about 1 second to wake the Nano's screen)

- Short battery life (it will last a few days and I've yet to find it dead on me, but you do need to remember to charge it fairly frequently. Handily any standard iPhone/iPod dock lead will do).

- No built-in speaker for alarms (headphones need to be plugged in to hear the timer's alarm).

- You can't set an alarm for an arbitrary time, only use timers.

- No Bluetooth means you need a wire dangling from your arm to use the audio features (although this isn't so much of an issue with long sleeved clothing).


So it's definitely worth a look if you're into gadgets and technology, or just want a cool quirky MP3 player that can double as a watch. But it's not quite ready as a replacement timepiece for the average person just yet. Still it's only a matter of time!

2011 in photos

Yosh!
January

Frozen waterfalls and bleak mine ruins in Cwmystwyth in January.



Icy bridge


February

I finally discovered the Penglais waterfall in February and was treated to some early spring colours.



The Secret Waterfall


March

I visited the Rhiwargor Waterfall in the Snowdonia national park.



Rhiwargor Waterfall #2


April

I turned 30.



Thirty


May

Visited the butterfly house near Aber with Claire.


Glasswing


June

Exploring the area around Borth on a sunny day in late June.



Distant church


July

High atop Rhossili Down by the Ordnance Survey marker in July.



OS marker view


August

A particularly spectacular sunset on one of the few nice days we had in August.



Just another Aber sunset


September

I was spoilt for choice for photos from September but ultimately settled on this view of the Vale of Rheidol steam engine approaching Devil's Bridge.



Emerging from the woods 2


October

I've not done a lot of long exposure stuff to date and this is one of my longest so far, capturing many trains over the course of 3 and a half minutes as they pass through the busy station at Nippori in Tokyo.



3½ minutes at Nippori


November

One of the highlights of my trip to Japan was a night visit to the incredible Fushimi Inari shrine in November.



Getting lost in a maze of torii


December

Finally, I know I posted this one previously but I've not had many opportunities to take photos this month and it's definitely one of my favourites for the year.



Christmas in London

Seaons Greetings

Yosh!
Happy holidays to everybody! I went to London today with my sister, here's a nice shot from a surprisingly quiet Oxford Street.


Oxford St. at Christmas

Experimenting with modern fabrication

Yosh!
When you think of making something out of wood no doubt the first things that come to mind are saws, hammers, nails and things of that nature. Traditional tools that have been around for many hundreds of years and that require a reasonable level of skill in their use in order to execute a given design to a high standard. For a long time the modernisation of these tools has focused on reducing the amount of human effort that needs to be applied to perform a given task. So we have electric drills, circular saws, nail guns and what have you. But the only truly modern wood working tools are those that do away with the human part all together. CNC (Computer Numerical Control) routers and laser cutters let you feed a design to a machine which will then churn out a result, the quality of which would require a master carpenter, or which may simply be impossible to make by hand.



What led me to this topic was this nice little wood and paper lamp that was in my room in the hotel I stayed at in Kyoto. It's a lovely simple, traditional design and I thought it would be quite nice to replicate it, or something similar anyway. But I don't have a workshop or any particularly refined woodworking skills so my immediate thought went to the possibility to using some kind of CNC solution. A quick look around on-line quickly revealed that the cost of these machines is pretty high - even for tabletop models, the cheapest laser cutter you can get is a bit over a grand and that doesn't include the various other bits you need like safety goggles, fume extractors and so on. But it turns out there are various companies which will happily take your design, cut it for you with their big expensive laser cutters and then post the results back to you. Of these the most friendly and web savvy is RazorLAB. They let you upload your designs in a number of formats and will cut your design into a wide variety of acrylic plastics, MDF, plywood and card.

So I downloaded their Illustrator templates and set about designing my lamp. It's fun and pleasingly challenging little puzzle to think about how each part fits together and how to most efficiently lay the parts out so they share as many of the same cut lines as possible to keep the cost down. Because the materials are pretty cheap the only real significant cost is the laser time, so you want as few cuts as possible and to keep things close together to reduce travel time for the cutter. So say you wanted to cut two identical squares, by having them share one cutting line you reduce the total number of lines to be cut from 8 to 5 and remove any travel time for the laser head over the dead space between them.

You can have a look at PDF versions of my design for the lamp and the construction diagram that shows how the pieces fit together. For scale, the lamp is roughly 13cm x 13cm x 22cm. The lamp is lit by a MES bulb (like you might find in a torch) and is powered from a USB port. I did consider designing it around a mains powered CFL bulb at first, but with the size limitation imposed by RazorLAB's template and my inability to find a really compact lamp fitting I gave up on that idea.



When I got all the pieces mailed to me a few days ago I set about assembling the lamp to check it all fit together properly - which thankfully it did. Then I dismantled it again to paint. I decided to use spray paint to ensure it got a nice even coating without adding too much extra thickness to the various parts which needed to slot into each other.



I used double-sided tape to attach squares of really pretty fibrous white paper to the windows and some small dollops of PVA glue to help keep the whole thing from coming apart. The lamp plate and bulb holder are bolted in for easy removal. The nuts on the lamp plate are glued in place so you just need a screwdriver to attach/detach it. All in all I'm pretty happy with how well everything fitted together. Some of you may remember a few years ago I built my own Stargate, complete with flashing LEDs, but that was seriously hampered by me choosing the wrong construction material (foam board) and the execution suffered as a result. With this project though the fit and finish is just what I'd hoped for and looks really professional.

All told the lamp cost about £65-70 in total to make. As about £10 of that was the spray paint, I'd be tempted to just use black acrylic next time which would save that and speed up construction. On the other hand it would be a shame to lose that subtle wood texture and glossy plastic wouldn't feel very authentic for an item such as this. Because the laser leaves scorch marks around the cuts it's not really practical to leave the wood in its natural state.



I'm thinking about what I can build next and I'm quite temped to make some shades for my ceiling lights in the same style as this lamp. I've already got a design I'm toying with. It's too bad there's no quick way to prototype these things on card at home as you have to be pretty sure you've both got the design right physically right (i.e. it fits together as intended) and looking right before you commit to spend £50 or so on it.