Saturday, 17 November 2012

New Pi Code and Toast

So, you may guess I've got a Raspberry Pi, and I've been building code for it... In actual fact I've been porting a few of my support classes from other projects so I can start to build things of some use.  I've ported my XML parser of choice, I've ported a bunch of network code and I'm tonight going to be setting up to bring in some of my Linux console manipulation code, so I can colour and highlight areas of interest in apps.

Though, strangely, I've already come across some strange differences between code which has does and will compile on gcc v4.6.2 on ubuntu 12.04 and which won't compile under gcc v4.6.2 under Raspbian... I'll post more about that when I understand it, for now just understand this... All I have to do is move a "typename" definition about... Its really obscure... And maybe just be doing something wrong...

So, more Pi code from me in the near to mid future, the reason none of it is going to come out now is because until this week I've only been tinkering with the Pi... Now I actually have remit at work to officially perform a project with one... and its all quite exciting, there's nothing like having a project in work which overlaps your leisure time.

The only problem is, my boss (well my bosses boss) is such a tight wad he's not sprung for a Pi himself, no I've had to take my own in!... Bit cheeky, but once the Pi was mentioned I jumped at the chance to take mine in and get on with something.

However, it did cause some friction, another member of staff whom shall remain nameless was eyeing it up for days.  They didn't seem to want to engage through the old blue eyed devil with me, so they let themselves, and others cool off, before they came drooling all over it... However, they came in such a way as  to insinuate there'd be no work/code actually working on the Pi... Of course I have 50% of the project done... the proof of concept at the very least, proving I could produce and hence need to be left alone... And this flabbergasted them, so much so they were very nasty not an hour later.  So nasty in fact I send an email to my immediate boss complaining.  I don't get paid to deal with other people having a tantrum because they're stuck on the same project they've been on for two years... a project they should have delivered a year ago... So, I don;t want to hear it when they're complaining, and proclaiming, they could do it better...

"Really, you can do it better?... Well you bring in your Pi, oh you've not bought one"... was the thought which ran through my mind as I engaged stare mode and ignored them.

Anyway, toast... Why is Toast in my post header?  You may recall I have one post about sweets to help code.. well, I never got around to buying any more sweets to try... I've not had a hard boiled or mint sweet since that post.  I have however had toast...

When I was a kid my favourite toast was really insanely fresh white sliced bread, lathered in salted butter... This is still a favourite today, but I don't go into for the lathering  nor the heat... Strangely, my taste has taken to letting the toast cool.  I do remember once at Uni placing nearly 8 slices of toast into the fridge to cool before buttering them... and I seem now, a decade later, to be going through that phase again, I stack up a good number of slices, let them cool whilst there's tea brewing and I then butter them and just glance them with lemon marmalade.... It is heaven.

And because its cold already, its perfect to take to the office and get some code done with.

Friday, 16 November 2012

Guide To Building a Raspberry Pi C/C++ compiler on Ubuntu


These are personal notes on setting up a Cross Compiler for C/C++ on my Ubuntu 12.04 machine, so I can build programs for the Raspberry Pi.

Of course my reason for this is that my PC's are far more powerful than my Pi, even compiling the most trivial program can result in waiting a duration or two on the Pi.  So, I want to employ my heavy PC metal to generate the ARM architecture code for me.

The first steps were to install all the pre-requisites, I'm assuming you have Ubuntu 12.04 32bit LTS installed fresh and clean (either as a real machine, or as a virtual one) and that you know how to use your Linux Machine, here we go.

sudo apt-get update
sudo apt-get upgrade
sudo shutdown -r now

Reboot... Log back in etc....

sudo apt-get install subversion bison flex gperf build-essential texinfo gawk libtool automake

Download ncurses tar ball from "http://ftp.gnu.org/pub/gnu/ncurses" extract it and then within its folder:

./configure
sudo make install

Download crosstool-ng from "http://www.crosstool-ng.org", extract its tar ball and from its folder:

./configure --prefix=/opt/cross
sudo make install

Now we need to add this built item to the path:

PATH=$PATH:/opt/cross

And now we need a space to do the building of the cross compiler:

cd ~
mkdir Pi
cd Pi
/opt/cross/bin/ct-ng menuconfig

Goto "Paths and misc options" and then turn ON "Try features marked as EXPERIMENTAL".

Goto "Target Options" and into "Target Archetecture" and select "ARM".
Go into "Target Options" and set Endieness to "little".
Go into "Bitness" and set it to "32bit".

Goto "Operation System"
Go into "Target OS" and select "Linux".

Goto "Binary Utilities" and then select "Binary Utilities" latest version (2.22 as of writing).

Goto "C Compiler" and enable "Show Lincro Version" these are the 4.7+ versions supporting C++11, and enable C++.

Exit and save.

And now we kick off the building of the tool chain:

/opt/cross/bin/ct-ng build

The output for me ended up in "~/x-tools/" as per the paths selected in the paths & misc options.

Sunday, 11 November 2012

Sat Here, no longer thinking...

So, I posted earlier how I was too tired to be in the groove?... Well, I had a good idea, update my virtual machines... You see, whenever I start a new major project I start development with a nice fresh instance of my virtual machine on the target platform...

In this case I bought Windows 7, however, when the project begins I generally isolate the virtual machine from all updates, as they may introduce breaking changes or days of down time with things updating, and I start to cut code from my design on that isolated machine.

Its safe, I never browse the net from them, and the host machine is very secure.  However, the images gradually go out of date.

Well, I figured I needed to take a copy of this virtual machine (which I did) and update it to see if the product nearing completion still runs with all the latest updates... 

I can't tell you the answer yet, even though we have a span of multiple hours between my prior post and this, the reason being, even at over 10mb/s download speed (nearer 17.25mb/s tbh on this wireless) it has taken all this time just to get the first 54 updates done.

I've rebooted, but been told there are 7 more, and 5 optional ones too... This is the pain of not updating my windows platform since the 17th October 2011... But, hell is it slow...

Right now, the second phase of update has been saying "Installing Update 1 of 7" for about 14 minutes, there's no hard drive activity and I'm so very tired I might just pull the plug on it.... But doing that often screws the Windows Updates.

It has however gotten me thinking about the update mechanism for the project I'm doing all this updating for, it; at the moment; has not remote update mechanism, neither a download & update whilst running, nor an update over reboot nor an update/install even... That may have to become the next big part of the project I tackle.

Sat Here Thinking...


This is one of those nights where I could have done with about fifteen more hours of darkness in front of the computer before I got as tired as I am now, the reason being, I'm in the zone, I've been coding, and documenting some parts of a system which I've been eager to get going on for days and tonight was the night I got cracking on it.

This is after having my planned day "in the office" ruined by a few things... The first problem was the wife has been quite ill, she had to have the day off of work, and she seems unable to realise for my kind of work, I need to be left alone for more than 48 minutes at a time.

The next problem was that she was really really ill and I had to take her to an opticians, where they sorted out the problem with her eyes and cost us a combined £178 odd on new glasses with some special coatings. This, cost all day.

We then insisted on having our evening romancing in front of the TV, which though fun resulted in sweet FA on the work front.

I came up here to the machines around eleven, and I've been plugging away at this problem for a solid hour and a half, getting a lot of the little ideas which have been percolating through my brain all day down as code and working... AND documented, which is a really time consuming challenge as anyone working in software can attest.

But, now I'm beyond that concentration point for coding, it is a whole new day for the time space continuum, but for myself its still the same old yesterday elongated beyond recognition.

Aaaaanyway, I'm watching the Pilot episode of "Last Resort", a few shite acting points the "Navy Seals" were pretty crap and obviously will figure into the plot later, the plot itself has holes, but its the most decent US drama I've seen since Battlestar.  Its not as as fantastic as Battlestar, but its decent.

Tuesday, 6 November 2012

Elite IV


I'm excited in... an angry sort of way... I've just read the report that David Braben is out on the interwebs looking for funding to finish the latest Elite game...

The fact that they admit there is an Elite game, that they are testing the multi-player and there will be a single player is very intriguing... This is the first solid news about the game released in a long time.

For you see we've had announcements of games and teasers of Elite IV development since 1999

That makes me excited, what makes me angry is that he's out here seeking funding?... If he was so sure of his game it'd be funded, some publisher would take him on, but then maybe they'd not because Braben has been the proverbial elite game snake oil salesman for much longer than he's been actually developing and releasing games.

You see the original Elite happened by accident, Graham Bell and David Braben came up with some very clever ways to get the low powered MOS 6502 processor to calculate its way to powering 3D graphics, wire frame on the BBC, but other machines (like my ST) ran rastered solid polygons when we got the game.

And there's the anger... When we got the game... I've already handed over my cash to the franchise for Elite, and Elite II Frontier... I even bought First Encounters...  I still have my packaged, near mint, copy of Frontier in my desk next to me at home!

As a gamer I've played space games since Elite, I've played Eve Online and the ilk, I've seen the news of Notch's up coming game.  But, to be asked to fund Elite IV, now seemingly called "Elite Dangerous" before we've any concrete proof of its existence is... Not going to wash with me.

If they offered an alpha, to help test it, if they offered those who funded it more than ethereal promises to shape the game, then I'd perhaps listen, but they just offer this snake-oil Springfield monorail-esq comment and leave it there.

Then you look at the crowd funding site itself... £100 to participate in the beta test... erm... Why should we pay you to do work for you...

Its going to get funded, I know now all the fans; like I actually am; will fund it... but they may not be thinking as I am that this is just another round of bull.

I'd like to see more of the game first, more proof there's a product.  For instance I'm sure if you walked into the Dragons Den with the published information about Elite Dangerous, just that video of Braben on the BBC site with what might be the game running behind him on several screens and the press releases and the history of the court settlements and asked the Dragons for funding, they'd be out.

That's where I sit right now, I sit out...

Because as I see it, I've already funded the Franchise to the tune of jus shy of £130 (inflation adjusted for 2012 prices) and I've seen little return.

Frontier £30 in 1993... is worth £47.70 today.
Encounters £35 in 1995... is worth £52.50 today.
Elite in (I think I got it in 1989 for my ST) £15... is worth £29.10.

That's a hell of a lot of my cash, £129.30 to be exact... I don't see the appeal for any normal mortal to want to have dinner with him for £5000... I can see game developers, or wannabe developers, wanting to do that... Perhaps he thinks EA or Ubisoft might spring for several such seats at a dinner... But to be honest, to have to go to Cambridge to have Dinner, I'd like to be paid, not paying.

Some of the other funding items are also just gimmicks, "Reserve your name in game"... I'll tell you now, I hate that.  "Reserve a digital copy of the game"... digital copies are NOT number limited, there is no limit to the number of digital copies you can make of software this is the very fabric of software, "Holy shit we can only ship 1,045,727 copies cus we're out of disk space!"... No, that's not going to happen, they can stamp out hundreds and thousands of copies per hour in digital form you don't need to pay to reserve a copy, this is madness.

"Get a decal on your ship"... What the fuck is this?  Crystal Tigers and Murloc pets from Blizzard and now "Digital Grafiti" from Frontier Developments...




(My figures for the Inflation Adjusted Pounds came from http://www.measuringworth.com/ppoweruk/ where I related to the "Retail Price Index" - the lower of the two values given).

Wednesday, 31 October 2012

US Storm Reports


A storm hit the US... I get this, its big news, a mega huge storm... But I've also noticed a trend in the pictures.  They're pictures of the weather, or waves, or the mess caused, they're not pictures of people actually getting on with the task of cleaning up.

I don't doubt there are people cleaning up, and good on them!  But then the Earth Quake hit japan I was struck by the sight of people reported to be cleaning up, searching the rubble or helping others.

So far the only people I've seen reported helping others in this US drama are those paid to do so, the emergency services and their National Guard.

It very much feels as if its being reported back to myself, via the BBC, Fox and CNN as a woe-be-them for their miss fortune, and "let some other schmuck clean it up", not more of the rolled up sleeves lets get to this people one would expect.

Especially from New Yorkers, One always gets a vibe of Help and Share & Share alike... but the pictures so far are of the mess, or even other douché bags taking pictures of the mess... Don't take a picture people, put them iPhones away!  Take a shovel and a broom!

Thursday, 25 October 2012

Jessica Frech

Good morning folks out there, I hope you all took to my experiment with crisps from my last post... I come to you again with a new experiment I've been carrying out, I've literally just (like 2 minutes ago) purchased my first ever digital song as an MP3 via Amazon.

"OMGZ Xel welcome to the new century" I hear you all cry... but wait wait... There is a reason why I've been so shy buying digital content, that's because back in the mid naughties when this digital download stuff was all new and fan-dangled I had a bad experience buying a series of South Park... and... well I never actually got to see the series, it was a right hash up... So I've waited... I've waited until I've found something good...

And, you know what I think I found it in the rather pleasing shape of Jessica Frech... She's all over YouTube, check her out, I've known of her work a long time being one of the first few thousand to watch her multi-million time viewed Walmart (that's Asda to us folks here in Britain - Jess do a British version!) song... Any-hew, she apparently did some TV commercials in the US last Christmas, so I'm sure we'll see them over here this crimbo.

But she has a new Album out "Reality", the headline song from which is why I'm here raving... I love it... And you know what, I don't know why... My musical taste is so varied, from Metallica to Mozart, from Gogol Bordello to Garage Head and pretty much everything in between... So seeing this Happy Smiling southern (I think) American lass delight my music buds is not really a surprise but a new string to my musical bow.

You can watch her Video for the song, and hence hear the song, at YouTube:


But the song itself, its less than a quid.. 89p actually... so I just bought it... and listened to it twice :)

That is all great... So I've made a digital purchase, Jess took my fear of the digital purchase away... Or did she?

For you see, I can't actually get my hands on the MP3 file, Amazon have this MP3 Downloader, but its for Windows or OSX only, I'm running Ubuntu... Grrr... Which means I can't download it until I crack out my virtual machines tomorrow... Amazon, this is very annoying.