Andy's Blog

A while back a friend showed me an impressive web page from Sonos, which contains an embedded video in which a lady walks around her house turing in a number of coloured lights, as each light turns on the page background gradually changes colour to become an extension of the video. It reminded me of a family of televisions from Phillips which would shine a coloured light onto the wall behind it to help make the TV show more immersive.

Screenshot 2014-01-21 00.51.07

There are a couple of projects floating around where people have replicated the functionally of the Phillips TV using DIY hardware, I thought it may be fun to try and do something similar, in real time, inside the browser. As I’m pretty new to JavaScript it seemed a good way to fill an empty Saturday afternoon. The implementation is pretty crude, but overall I pleased with the results as a proof of concept, so lets take a look, shall we?

Concept

To make a video playing in a constrained box more immersive, by creating a coloured “overspill” that shines out from behind the box onto the page background.

Technical Details

Playback is achieved using the wonderful HTML 5 <video> tag, although sadly it’s not possible to interrogate the video’s frames directly in order to determine the overspill colour. However a work around is to write the current video frame to a HTML 5 <canvas> element, from there I can access the bitmap array. The good news is that the canvas doesn’t actually have to part of the page, so we can programmatically create one and use that a vehicle to get the frame bitmap.

What I’m left with then is a map of the current frame represented as an array. The array is arranged into batches of three values between 0 and 255, for the red green and blue elements respectively. So elements 0, 1 and 2 contain the red green and blue values for the first pixel (the top left corner of the image (yeah, it’s a very big array).

Screenshot 2013-11-11 01.30.47

Now equipped with the array, I iterate through it, summing up the brightness of each of the red, green and blue elements; dividing each of these sums by the total number of pixels in the video (width x height) giving the average red, green and blue values for the image – the average frame colour.

A CSS3 radial gradient is then used to set the background colour of the page to this average value, radiating out form behind the video so that it appears to be spilling out from it.

As an extra dimension I set the opacity of the coloured element of the page so that the brightness of the video is reflected in the intensity of the overspill colour. This is achieved by summing up RBG values of every pixel and dividing that by three times the total pixel count, multiplied by 255:

(TotalRed + TotalBlue + TotalGreen) / (VideoWidth * VideoHeight * 255)

What this leaves is a number between 0 and 1, which represents how white the frame is; a perfectly while frame would be 1, whereas a perfectly back one would be 0. The final step is to subtract this number from 1 and use that as the opacity for the background colour. To prevent the image form becoming completely transparent, or too dark, it is clipped at 0.3 and 0.75. A 50ms transition delay is used in an attempt to soften sharp transitions in colour, however this can have the effect of creating a lag on such situations.

If you’re wondering about that final subtraction from one, it means that darker scenes will be paired with more intense colours. As a TV shinning colours onto the wall can only make things more bright it makes sense that brighter scenes have brighter background colours, however as this sets the colours of the page I can “shine a dark light” from the overspill, so it makes sense to match a dark scenes with a dark background, not a pale one.

Compatibility

Everything here should work in all modern browsers, with a few vender specific CSS properties filling the gaps in for older browsers. The only slight issue is HTML 5 video codec support; each video needs be encoded a couple of times to ensure compatibility, which is a pain.
Continue reading

Share This


28/04/13

As promised, the new site layout is now live. I hope you like it; its been designed to make the articles much easier to read with a bigger, clearer font and limited visual clutter. It’s also designed to push the photography to forefront to make a (hopefully) more appealing experience, with a few extra toys that will come into play in future articles.

This is still a work in progress, mind, I’m tracking some bugs and there are some new futures lined up in a later update.

Wait. Last time I visited wasn’t the site Green/ Orange/ Blue/ Silver?

Most likely, the “accent colour” is picked when you first enter the site and stays the same until you leave. For one time only, here are some buttons to (temporarily) mess with it: Green, Blue, Silver

All the best. Andy.

Share This


Not so long ago I awoke, along with millions of others, to the news that Google Reader was to be no more. My first reaction was to Google “Google Reader alternatives”, I soon discovered that almost all of the tech blogs where already touting lists of possible alternatives; these took many forms, from web based replacements like Pulse news to pure app driven options such as the ever popular Flipboard.

For some time now, I’ve used Google Reader simply as a syncing service, accessing it via Flipboard on the iPad much more often than via its own website (people using it in this way, incidentally, is my theory for why Google are pulling the plug). I was, therefore, looking for a service that could manage the same feeds and present them in a fast, easy to use way that I can consume both on my desktop computer as well as while kicking back on the sofa. I was immediately drawn to Feedly, and what I found was a thoroughly modern service with an enthusiastic attitude.

Technology

At the moment Feedly offers nothing more than a front end to Google Reader; you log into it with your Google account, it then proceeds to access your stored Feeds in Google Reader – when an article is marked as read or starred, it is synced with Google Reader. This, obviously, is no use after Reader goes away, but Feedly have promised that they are working on a clone of Reader’s back end and will seamlessly move to this once Google pull the plug.

Update: I’ve just read that Feedly are already migrating some users off Google’s back end and onto their own, when this happens your feeds will be maintained as will up to 250 starred items. For more info, see Feedly’s blog.

Feedly’s Offering

Feedly can be accessed directly from its website (which can be installed as a Chrome/ Firefox app) or via its iPad, iPhone or Android app.

Website

Feedly’s primary offering comes in the form of feedly.com, this has a number of display options; those looking for a familiar Google experience will find solace in “Title only mode” which shows a scrolling list of article titles.

Feedly Web Screenshot

However, it also offers some other, much more visual, ways to display your feeds. These, of course, are not to everybody’s taste and in my experience different feeds lend themselves to different display methods, so experimentation is certainly advised.

Feedly Website Screenshot

I find Feedly’s website to be attractive and responsive, even on relatively low powered laptops. Its not without its quirks though; next to each feed is an unread count, clicking on the number marks all items in that feed as read. This perhaps seems like a useful idea, but on several occasions I pressed it accidentally.

When your feeds are imported from Google Land any folders they where in are maintained, but if you don’t have any folders, or some feeds are not placed in folders, Feedly insists on placing them under “uncategorized” – this doesn’t really cause a problem, but I find it a bit ugly (maybe I should place everything under a folder called “All” or somthing).

iPad
One of the things that attracted me to to Feedly in the first place was its iPad app; from its screenshots it looked as though it could serve as an adequate alternative to Flipboard. I was wrong – its an excellent alternative to Flipboard. In fact, in my opinion Flipboard’s recent updated to version two has ruined its old Google support.

An excellent alternative to Flipboard

The Feedly mobile apps very much mirror the main website’s look and feel, featuring a modern, clean looking UI with large blocks of simple colours free of the skeuomorphic fussiness found in other iOS apps; it feels as if it pulls some of the clean line thinking from Microsoft’s extremely attractive design language found on Windows 8 “don’t-call-it-Metro” Apps.

Feedly on iPad

When I first started writing down review notes in my notepad (yes, all these reviews start their life as pencil written notes in a notebook made of dead trees) I was suffering an issue where the app would sign out of Google, requiring you to log back in again – a massive pain (particularly if you use two step authentication). However I was pleased to see that within a week an update was released completely resolving the problem. Pleasingly this was followed by series of updates every few days – its really nice to see a app where the developers are actively working on the app and are responding to issues quickly.

Android

Feedy on AndroidThe Android app follows in an almost identical ilk to iOS, so its not worth going into too much detail here. The same app is used on both tablets and phones, with the same UI responding to suite the screen size, this works well although I found that it works even better if you go into the setting and change the transition so that on the tablet you swipe horizontally and vertically on the phone.

Being within Google’s ecosystem, logging into the app is a delightfully simple operation, of simply hitting login and allowing it to use the Google account used for Android.

Wrap up

When I first started looking into Feedly in a sort of desperation to find a RSS reader solution before the Mountain View based rug was pulled sharply from under my feet. However, what I stumbled across was an extremely promising service, which provides the same functionality in a lovely way, topped off with a set of apps that I think are actually better Flipboard.

The occasional bug is evident, but they rarely threaten to spoil the show, and are resolved quickly, leaving you with a feeling that its run by an enthusiastic team who really do care about your as a customer.

All in all, I’m giving Feedly an almost perfect 4.5 out of 5. Good work, guys.

Share This


Well, we made it through the first month of 2013. To celebrate, I think its time for a few changes, first of which is the introduction of a new theme for this blog. This is for a couple of reasons, firstly the site has been dressed like this for about three years and I’m board of it. The other is that I’ve seen it used on some other sites and I’d quite like to carve myself out my own identity.

To that end, I present to you a low resulution, pixelated, screenshot of what is coming – its not ready yet:

ABDCDU_2013Theme_blur_small-300x154

This new theme is lovingly hand crafted by my own hands in my free time, so its taking a little time, but will be rolled out sooner or later. I’ve tried to make this one really visual and push some of my own photography right to the front.

Happy February and all that.

Andy

Share This


…And it was so worth it.

A cupple of posts ago, I introduced you to an amazing violinist called Linsey Stirling, I enthused about how much I loved her music and would love to see her live.

Well. I did. And it was freaking amazing. Determined not to miss out on the opportunity, I was poised at my computer ready to buy tickets as soon as they went on sale, and was able to bag myself not only tickets to see the show, but a VIP upgrade to meet her beforehand.

Back in my first post, I promised to get my much loved copy of her album signed, and here it is:

Signed Album Cover

During my relatively brief encounter with Lindsey she was lovely, she was friendly and chatty even if I was awkward and and awe struck and I was debonaire and dashing. I know the way these things work, everyone gets their opportunity to meet the band and it feels like something huge, but in reality you’re just get another fan in another queue at another show on the tour, yet Lindsey made every single person feel special.

Lindsey and I

The show its self was incredible. Its was loud… very loud. There was dancing, moon walking, bouncing on the spot, singing and sweet sweet music, including both originals and covers. The show was opened by the also excellent The Vibrant Sound, who did a great job of getting everybody revved up.

There was a heck of a lot of standing around; queuing outside the venue, queuing inside, waiting for the show to start… It could have been awful, if it where not for the fact that Lindsey  Stirling fans are all awesome, too – I really enjoyed chatting to a pair of really nice Italian chaps in the line outside.

I took my new camera along for the ride, and took a few photos and shot some video, although to be honest I was far too busy enjoying the show to spend time shooting lots of video, rather it takes the form a bunch of clips. I was actually very impressed with how well it coped with the loud show and dark conditions so I quickly edited it into a montage you can see here (hopefully Lindsey won’t mind me sharing her show with you):

So that leads me to say, if you haven’t already bought her album, do it. Do it now.

And Lindsey, if you’re reading this, thanks for an awesome evening; you’re amazing.

Share This


I wanted to post something special for christmas this year, but I’ve been far too busy. So instead I’m left with nothing more then to wish you Merry Christmas:

Merry Christmas, I hope you enjoy it and spend the time with those you love.

See ya!

Share This


A couple of weeks back I was flicking through some videos on YouTube when I came access this video (embedded) made by Lindsey Stirling and Megan Nicole. I’d never heard of ether of these people before but was very impressed with how talented they both were.

I found that I particularly enjoyed the music the the aforementioned Miss Stirling. I don’t really see myself as somebody with a particularly strong affiliation with any specific genre of music; I like a little bit of lot of things. However I’ve not really listened to a lot of violin before, that was because I’d never heard violin like this before…

I have to admit, I’m obsessed now. Her music is beautiful, yet energetic. Shadows, in particular, is hauntingly brilliant. While sat at my desk one day, for a brief second I could almost hear this song playing in the silence. Spooky.

I soon realised that she had brought out an album, it’s available on iTunes, but you can also get it on a physical CD form Amazon [Amazon dot com link]. I had a little think, and the last time I bought myself a physical music CD was back in 2002, yet I knew that I MUST own this one.

After what seemed like years, my disk arrived in the UK (its only for sale in the States). I was surprised that someAlbum Cover of the songs on the album where slightly different mixes those used on YouTube. This is no bad thing, they’re still amazing – it was just that after getting used to the songs on YouTube, it took a couple of listens to get used to the CD. After listening for a bit I rushed on to Amazon and bought another copy for my Dad’s Christmas present; I’m sure he’ll love it, too.

Looking at the response, on YouTube, of other fans coming out of her shows is incredible – everybody seems to love them. I really hope Lindsey does some shows in the UK, I’d really love to see her live (and maybe even meet her and have my CD signed Smile).

I know it’s Clichéd, but I find Lindsey inspiring; she’s taken the time in her life to not only learn, but to become really good at her music. She’s then taken that and become some what of a sensation in America, having just completed a sizeable tour with many sell out locations. She makes me want to go out and better myself.

I’m the same breath, though, I find myself slightly deflated. What I see is somebody of roughly the same age, who is incredibly talented with music, and I compare that to my own, unsuccessful, musical history involving some bad experiences at school with a renegade music teacher who offered me violin lessons without first authorising it with the school (the disappointment of that still hurts to think about today).

To that end, I want to go out and learn new things, expand my horizons; I want to learn to play an instrument (maybe even violin, living in an apartment block may be an issue, though). Strangely as I was sitting watching TV the other day I was struck with an urge to learn to sing. I can’t sing, not even slightly. In fact, I won’t sing – I’d be far too self conscious, which I guess is really the reason that I want to actively go out and break down that barrier.

What scares me though, is when I see people that good, is what must they think of a rank novice like myself? Screeching away like a wounded animal in a desperate attempt to mutate their hero.

I guess I should really wrap this little ramble up; So, I encourage you to go out right now (actually, please read to the end of the paragraph first, otherwise it would be rude) and listen to some of Lindsey’s music. Also, swing by Megan’s channel, too, for a demonstration of what singing talent sounds like. It would be really neat if I could finish this off this a bunch of targets to myself, but I’m not going to commit myself to specifics just yet, so I’ll keep that for a later post.

Share This


Ever since its launch a couple of months back the Nexus 7 has created a media storm; when I first heard of it, I have to admit, I was dismissive. It was clearly an accomplished piece of hardware, but I’d always had little time for the 7 inch tablets; citing their cramped dimensions for making them pointless.

Recently, however, I have rather fallen for the form factor. Many of my blog based brethren coolly write that they haven’t touched their iPad since discovering the Nexus 7; going on to explain how the iPad is too big and too heavy. While I’m not ready to make such a sweeping statement, I would like to introduce you to my very own Nexus 7, bought as my new buddy on the daily commute:

SONY DSC

The internet is unbelievably packed with reviews of the Nexus 7, so I won’t be contributing my piece on this one. For completeness, however, here’s an abridged version of what a review from me might feature.

The Basics

· My iPad is going nowhere – This little guy is great on the train, but for checking the news and Facebook while watching TV, there’s no beating the iPad’s sofa surfing credentials.

· My Kindle isn’t on the move either – I admit, I do sometimes read books on the train using the Nexus. It’s a pretty nice experience (I actually missed my stop while reading a book the other day), but the e-ink screen of the Kindle is defiantly the tool for any serious reading.

The Good

· Android feels light-years ahead of it did when I reviewed the Sony Tablet S – It’s hard to put your figure on exactly why, the much smoother UI certainly helps, and it just all feels a bit more grown up.

· The screen is lovely – But text in some apps is far too small. Browsing the internet and reading books is fine, but some apps (including Facebook) are a bit tiny.

· It fits your hand like a glove – Come to think of it; I actually have some gloves that don’t fit too well.

· The home screen doesn’t rotate, AND THAT’S EXACTLY HOW IT SHOULD BE – At some point Android tablets became landscape devices; I’m not sure how this happened, but it stuck – with both devices and Android 3 seeming to encourage you to hold it this way.

With this came problems – Firstly, the devices where too large and clumsy, holding a 10.1 inch tablet horizontally in one hand is uncomfortable and in portrait is too high and narrow. The second, is that there are much fewer dedicated tablet apps than phone apps in Google Play (Android Market), meaning you quite often wind up using a phone app on a tablet, with it looking stretched and stupid.

Put simply: Not rotating the home screen is not a bug or an oversight; it’s Google, forcing you to hold it properly..!

(Update: The home screen now rotates. See end of article.)

The Bad

· Android apps for tablet are still thin on the ground – but the tablet’s size and portrait orientation really helps to mitigate that.

· It’s not a cheap iPad – The iPad is the iPad, nothing quite compares; what you’re getting here is a reasonably priced device with its own target market. If all you ever wanted was an iPad, get an iPad. (And the prize for saying “iPad” the most times in a single bullet point goes to….)

· One handed navigation doesn’t scale well from a phone – So, this is a little difficult to explain. But is you consider holding atypical 4 inch smartphone in one hand, you should be able to reach the entire screen with your thumb. If you were to navigate a long list, you would probably scroll by moving your thumb over the bottom three quarters. Therefore, all scroll actions are possible in that three quarters.

The problem here is that the same principal has simply been scaled up, so the size of your movements are measured in terms of the percentage of the screen, rather than the actual size of the movement. The effect of this, is that it can be a bit tricky to compatibly scroll when holding the device in one hand. This is particularly apparent when scrolling left and right between the home screens, often finding that flicking between the screen simply causes the one you are on to move slightly and then bounce back, because you have not moved it far enough.

The Bottom Line

Because this certainly isn’t a review, I’m certainly not giving the Nexus 7 ‘8 out of 10’. Ahem.

 

Update (11/10/2012): It seems I spoke too soon; Update to Android 4.1.2 and bag yourself a rotating home screen. Oh well…

N7Update

Share This


A few days ago posted an article about teaching programming on the Raspberry Pi. Amongst the rambling monologue I made a long shot request for my readers to identify a game I used to play on my family’s Sinclair Spectrum, but had lost the tape and forgotten its name.

I returned to my computer mere hours after after writing that post to find Peter had got in contact via Facebook and found the answer: The game is called Santa, and was published by Artic Computing, of Hull, in 1983. You can read more about it, at World of Spectrum.

I ran onto EBay and picked myself up this rather nice copy of the game:

2012-06-29 13.13.05

 

I rustled up a working Spectrum+ and a CRT TV then loaded the game up for some nostalgia:

Exif_JPEG_PICTURE

I also grabbed the .TAP file form World of Spectrum, and got it running in an emulator. Ironically enough, my Spectrum emulator itself is so old that I had to run it in DOSBox to use it under Windows 7. Anyway, I fired it up in the emulator and had a play, below is a screenshot of that.

SantaScreenshot

Thanks for reuniting me with Santa, I’m very happy!

Merry Christmas.

-Andy.

Share This


So my Raspberry Pi arrived a couple of weeks ago, and here it is:

DSC05943_tiny

…Beautiful isn’t she? But that’s not for today – I’ll talk more about the device itself in another post. What I want to talk about today is a video I watched on the BBC News website relating to the Pi.

This video reported the news that a class of school children had been successfully given a lesson on programming with the Raspberry Pi; this is incredibly commendable – it seems pretty important that the current generation of children don’t grow up with the fear of computers that has plagued their parents. To a lot of people, though, the idea of teaching every child to programs seems a little extreme, and to those old enough to remember the micro-computer boom in the 80’s, a little familiar.

I suspect, though, this is largely a case of the press latching on to the wrong end of the proverbial stick and refusing to loose go. This is not about making every kid a programmer any more than PE lessons aim to make every kid a footballer (God knows, I’m no footballer). No, the Raspberry Pi is about making programming available to every child.

Let me illustrate this with an example: At school, despite my persistent protests to the contrary, I was made to play rugby in PE. At the time I would trudge out onto the field in my sports kit (black shorts and hideous green nylon shirt) muttering words unsuitable for print (did I mention it was icy too?), but this was indeed an educational experience – it taught me that I don’t like playing rugby. Some years later, the brother of a good friend of mine would step out onto the same field (in the same horrible kit) to discover that he had found his calling, and by all accounts is actually pretty good at it – he is now on the under 18’s squad of my local team.

With programming, quite the same principal applies – those who hate computers and have no desire to learn how they work will continue with their lives’ as normal (that’s me and rugby), however occasional kid may come along and think “this is fun, I like this” and now finds a whole new career path open to them that they may previously have never even known about (that’s Ash and rugby). That, ladies and gentleman, is mission accomplished – its not about making every child a programmer, its about making sure any child could become a programmer if they wanted.

DSC06027_tinyAs a brief aside, while writing this post I reacquainted myself with the first computer I ever used. It was my family’s Sinclair ZX Spectrum [shown on the right] – now it’s old, battered and broken (an unfortunate run in with a defective ZX Printer many years later) but that’s only because I loved it so much. Believe it or not one my earliest memories is of playing a game on it (if you owned a ZX Spectrum, please take a look at the section at the end). I count myself lucky that my parents where always very encouraging with teaching me to use it, and think that is forms the first crucial step in a path that would shape my education and career.

Incidentally, the un-edited JPEG of the Spectrum photo on the right (before I resized the life out of it) was 74.23 times larger than the total memory of the Spectrum, yet occupies only 0.0435% of my current PC’s memory – amazing, huh? (Photo = 3.48MiB, Spectrum memory = 48KiB, My RAM = 8GiB; 1GiB = 1024MiB, 1MiB = 1024KiB).

I digress, though. What troubles me slightly is the content of the aforementioned BBC video (not watched it yet – go watch it now, I’ll wait…); the “grown-ups” in the video are all grinning and patting themselves on the back at how wonderful it is to see children programming at such a young age, yet so many of the kids seem board, confused or stuck – the quote “I needed do it over twenty times” is a case-in-point . The story doesn’t seem to elaborate on what they have taught them, yet it seems that the poor kids have been handed a printed sheet of Python code and told to copy it, verbatim.

If this is true, I’m a bit worried – this is about inspiring kids to love computers and programming, not boring them so much that they never want to touch the darn thing again. Yes, lines of code is what programming is about, but in PE (see what I did there?) you don’t just throw a bunch of kids onto a pitch with the English rugby team and tell them to “get stuck in”. No, we must make IT ICT and programming lessons fun and engaging, so that the future computer scientists are excited and want to learn more. To that end, I offer the following impassioned plea: please don’t give kids printed pages of Python – it will turn them off everything almost immediately – please, please, please use MIT Scratch, and please work with them, not just leave them to get on with it. If you can excite and interest the kids, we may have a winner on our hands.

I really love the Raspberry Pi, and its goal to bring computers and computer science to the younger generation, and its nice to see the community rallying around the Raspberry Pi in education and not just squandering it for themselves. Good work.

Good night. Andy out.

ZX Spectrum Owners:

Update: I’ve been reunited with this game, see this post for details. Thanks for your help!

When I was little, I played a game on the Spectrum in which you played Santa and had to tunnel your way through some giant Christmas puddings (they where brown and had white icing at the top) without hitting the “worms”. If you hit the worms, they would all come out of the pudding and wave around, and the game would be over.

All memory of what this game is called has gone, and I’m reliably informed that the tapes where sold at a car boot sale. If you can remember what this game is called, please do get in contact via the comments; I’d love to fire up an emulator and play it again.

Thanks!

Share This