Category Archives: Technology

Platform Transform

I’ve been burying my head in Brazil – the framework – over the last few weeks.

The first step was taking Friendlier and making it work as an API. Cutting vast blocks of functionality (which forshame resided mainly in one or two huge files) into firstly addressable chunks and then to plump out this component based API with blocks that would equate to finer grained control with subsequent apps.

To whit – I parcelled up the old stuff and kept it working while creating new things that had a cleaner and therefore more reusable interface. The output of this phase of work was a half completed game called Paulo. This is what Christmas Chickens is turning into. A 3D XNA game written using Brazil.

So once I had satisfied myself that the framework was usable I set about moving it immediately on to another platform. Why not finish the game? Well my goals are bigger than ‘just’ writing games and also not limited to one platform. I could just write a game in XNA if I wanted to target that platform. I wanted to see if this framework would translate to another platform – and I didn’t want to wait any longer to test out the theory.

Next stop – Eclipse, Java, Android OpenGLES. Big change from the (yes) cosseted world of Visual Studio and XNA 4.0.

Select java version, install java SDK, get Eclipse (or another IDE), download the Android SDK and virtual device (AVD) manager, then select and download target Android SDKs, integrate the Android and Mercurial plugins for my IDE and fire up a new Android project.

Then on to the OpenGL integration. Subclass the Renderer object and port my existing C# framework into Java. This bit is relatively straightforward as C# and Java share a great deal of syntactic similarities. The larger challenge is working out how much abstraction to keep in Brazil for Java. OpenGL is a lower level API than XNA is therefore the choice is to bind directly with it or introduce some XNA like helper components such as Vector3s and BoundingBoxes. However, so far so good. I have a working Java framework and a working application and I’m able to fire up a virtual Android device and see the app working.

Next steps will be Paulo for Android and then I tackle the next platform. I’m documenting this transformation here and also over on the xyglo site where you can see code examples.

The Cosseted Programmer

It appears we have come to a juncture in information technology where the sheer weight of data is forcing us to draft everybody into the ranks.  Over the years there have been multiple plays to gamify programming – make it cool – make it understandable – rather have people just stare dumbly at that results and prod occasional buttons.  Our limbic system flinching in response to sounds and colourful 3D shapes was previously considered satisfactorily.  Now we are encouraged to buy virtual stuff inside other stuff to make our experience more valuable.  And it works – because unlike pharmaceuticals – these things aren’t licensed and our kids are hooked into them from an early age.

 

And it’s no longer enough to just consume these goodies – we’re also taught to create.  Creation is cool.  Photos, videos, blogs, apps.  It’s a self perpetuating cycle of creation – no destruction, just additive, endless piling upon piling of bits into bytes into terabytes into hard disks in drawers and burned onto disks and stored away never to be looked at again.  The world may soon fill up soon like the Stross/Doctorow dystopia planned and we’ll be forced into living in the Clouds ourselves or turn the solar system into one big computer.  Our bodies slumped in the corner of our living rooms while the substrates fill up with our souls emancipated by the combined efforts of humanity – from east to west – working together to abstract our lives away from a flawed meatspace.

 

So there are these guys like Bret and Light table guy and Anonymous Game Framework Guy who probably all live on the West Coast in the sunshine and think purely in terms of web servers, big data, shiny tablets, closed feedback loops and turning everyone into a developer.  And that is all well and good and also sometimes I think like that and the world is all shiny and exciting – but there is somehow a missing element here.  Our thoughts turn to the lack of boredom thanks to smartphones.  The gap between waking and sleeping where we’re not sharing our lives with each other or silently just consuming others thoughts or the thoughts of machines.  How many of those twitter people you’re reading are actual people typing stuff and thinking stuff?   Are we even paying attention enough to pass our own Turing Test?

 

A lot of effort, direction and money is being spent/burned/created/transferred in order to capture and inspire developers.  To draft a few inferior souls into the wake of conglomerates who have spotted our Achille’s heel and are making us all believers of a doctrine whose only basis is that inaction and not thinking of anything better to do is a good reason to glance down and lose ourselves again in our hand held worlds.  At the same time as these real businesses – ones that provide a service and get a payment for that service – are making a lot of money out of this shuffling around we are held fascinated in the glow of the Gorilla[R] glass.  We are marking time.  This developer for all, creator for all – as I read it this week the ‘democratizing’ of the development landscape – is no such thing.  And despite these tools being wonderful and in their own way addictive (so that one can become addicted to simply learning more development tools) occasionally it’s just nice to sit around and do something worthwhile and with merit rather than worrying about what technology it needs to use in order to attract the most attention.

The Speed of Change

So I’ve been changing my little 3D app into a framework and puzzling over some of the challenges that this in itself throws out.

A framework creates a logical structure over an existing (or missing) structure and provides you a consistent way of thinking about things. This applies not only to applications that might use that framework but also to other technologies you want to integrate on the back end. The advantage of turning an app something into a framework something is that in you’re effort to construct the framework you start to ask yourself what you really want out of the technology. Additionally you might get lucky and turn what you’ve created into something that someone else could use. So by creating a framework you’re abstracting, promoting re-use and thinking carefully about your design – these are all good things.

So what does “a framework” mean?

In the case of an input device framework this means that you can think about how simple interactions with users are to be represented without having to deal with the actual keystrokes, mouse clicks and gestures just yet. So you can define an interface and then worry about the details when you actually come to use it. In the case of the components you want to define in your framework – the targets for these actions – then you can also think about the interfaces they should expose and how best to interoperate with them. Again the technology that the framework operates with will have certain limitations but those are details that you or someone else can worry about later.

So in some ways it’s just a method of procrastination?

It can be if you’re not careful. And as with any form of programming it can be as simple or as complicated as you want it. The challenge is to do this in a way that is meaningful and works for my existing app in one existing technology but with eyes on the future. With my app’s current dependence on XNA (and XNA may have a limited shelf life) I want to ensure that my own framework is going to allow me a method of porting potentially to DX11/C++, WPF/XAML, Android/Java, iOs/Objective C or wherever else I want to go. So I’m investigating these other technologies as I come up with the framework – so it acts as a stepping stone as well as a way of breaking up the work of porting into manageable chunks.

So where does this end up?

A framework may well end up being no use to someone else but it will at least provide you with a stable view of various technologies underneath – a little like a photographer framing a shot with his hands. Your frame of reference is you, rather a moving background with unclear borders. And in case you haven’t noticed technology things are moving pretty fast these days. If you want to get ahead – then get yourself a framework.

C++ (chew slowly)

I spent a some time on the weekend looking at Rosegarden for Windows for the first time in a while.  I’ve been meaning to get the device allocation working correctly with RtMidi and get the MIDI recording also working but it’s slightly more challenging when you have to pass stuff back from it’s own thread rather than having access to all the nice Driver level features we’ve built into Rosegarden.

Rosegarden has the concept of a Studio – originally this was designed around the idea of device templates and the autoload document in Logic Audio – so essentially you can set up your external MIDI and audio devices once and then save it all to your autoload file and every time you hit ‘New Composition’ you get a fresh canvas with all you devices all set up and raring to go.   In my original design I’d also expanded the idea of the Studio to encompass audio placement eventually so that you’d be able to mimic acoustics of virtual instruments and such like – so being able to place MIDI and audio instruments in the stereo (or more) sound field and have consistent effects.  However it just became a layer in the end whereby we could try and put sensible names onto MIDI instruments and provide something approaching a consistent interface across audio and MIDI.   Perhaps in this regard it wasn’t such a good idea simply copying the Logic Audio model because to be honest it wasn’t a very elegant solution – I just didn’t know any better.

Have a look at Albeton if you want to see a way that this can be addressed for recording purposes.

Anyway – I digress – Rosegarden has a Studio concept which is an abstraction of MIDI and Audio devices and I need to tie up my outgoing and incoming MIDI events to the Studio model if I’m to make Rosegarden understand what the events are and where they come from.  So I have to jump through a few hoops to make the MappedStudio (as it’s known at the sequencer level) available to the MidiThread.  At this point I got a great remind of how hokey C++ syntax is – as my RtMidi event callback is a static method I have to declare any data structures that it wants to use also as static.  As I’ve been used to the wonderful world of C# for a long time now I tried to write:

static public MyStructure m_myStructure;

In the class definition.  Forgetting of course that my scope definitions are section based in C++.  Then for the life of me could I remember how to initialise this static public structure in the code and where?  No – first I tried in the header (of course no joy), then in the body but of course I got the naming convention wrong.  Eventually I got my definitions correct after a lot of fiddling and probably some swearing and of course waiting for the rebuilds (don’t forget the linker errors) but it demonstrates to me just why I moved on around 2004 and tried another language or two after being mired in C++ land for a while.  It can all drive you insane and I’m just now thinking that I’ve not even started to think about debugging the undoubted mistakes I’ve made in memory management with the changes I’ve made.

So bear it in mind, C++ is wonderful for connecting across the seemingly impassable chasms of disparate functionality and fixing holes between APIs but it takes a bit of your soul with you every time you lose your temper.  So take small bites, chew slowly and keep topped up with plenty of fluids.  It’s going to get warm and shouty out there.

The Xyglo Framework

Rather than ploughing on with features directly in the Friendlier codebase I’m now in the process of breaking it out into a framework that I can share with others.  This will allow me to get feedback from all you developers and also potentially target multiple platforms – or at least see what I have in common with other platforms and if the same event model is going to work with them.

What with things changing in the Windows world – W8, DX11, perhaps the end of XNA then this for me is a sensible option.  Also I want to shortly have a look at VS2012 and the options available there.

Please as I just tweeted – Kinect for Windows SDK is going to be upversioned shortly and I’m still lagging behind on my framework for that too.   So, back from the summer break, suddenly masses to do to keep up with the rest of the world.

I’m also way overdue on my promise to do some more work on Rosegarden for Windows.  This also needs to be worked into the mix.

All in the all my poor Raspberry Pi doesn’t get a look in!

Ode to a Preemptive Multitasking Kernel

The login prompt gave you no clue,
If I/O bound or CPU,
Free RAM was high and cycles free,
As you unpacked directories,
then uptime indicated that,
you fork your process, vmstat.


This tiny bud of bootstrap code,
Blossomed therein motherlode,
A caustic strain that cause rendition,
Hit resource boundary condition,
Dumped a core and left you blue,
And scratching chin upon the loo.


Another try, tweak’d interlocking,
Perhaps those mutexes were blocking,
Assign some new shared memory,
Eye pee see ess, min-us emm pee,
And at last you seem now able,
To run in some semblance of stable.


Your server program is now ready,
To accept connection from Blackberry,
Client packets and block’d ports,
Iphone, Android java sorts,
XML, decrypting blobs,
A panoply of resource hogs.


These jobs they come and then they go,
The process table tells us so,
With clarity we do recall,
System V, BSD, all,
those antecedent behemoths,
whose children make clean from their dust.


You mask and storm an interrupt,
Which I ignore and push above,
An essence, your priority,
With threads all flailing to run free,
You time your sleep and so quiesce,
(I take a moment to persist).


The walls fall quick, the mem’ry snaps,
Hex explodes into our laps,
The dissolution of connection,
Teardown lasting microseconds,
Leak’d bytes free again to spill,
light process destruction thrill.


The login prompt gave you no clue,
If I/O bound or CPU,
Free RAM was high and cycles free,
As you unpacked directories,
now uptime indicated that,
you fork your process, vmstat.

Creative Commons License
Ode to a Preemptive Multitasking Kernel by Richard Bown is licensed under a Creative Commons Attribution 3.0 Unported License.

Inspired by a lively disussion. Thanks to Chris and wiki and Rosegarden as ever. I’m experimenting with CC licences for the first time so don’t shout at me if it’s all wrong.

Thoughts of an Independent Software Vendor

I’ve been building and selling code for a few years now and this is usually as a part time thing alongside something else I’m already doing (i.e. a proper job or having a family). A few years ago I launched a company called Fervent Software which sold Studio to Go! I then launched a company called QuantockSoft which sold a product called TemperDB and I’ve just started a new company called Xyglo which has just started selling some software called Friendlier.

When you’re bringing a product to market (*) and you can only devote part of your time to it due to other commitments, there are many factors you have to weigh up. Some of these relate to the limited time you have, some of them are applicable to all ISVs. First and foremost you need to determine if there is a market for your product – that’s pretty important! Secondly you must decide if what you’re trying to build is achievable with the amount of spare time you have – also important. Thirdly you need to know how to spend your time – when to code and when to spend time on designing and when you have market or promote your piece of software. And finally and most importantly you need to know when to get it out of the door and actually start selling the thing.

Of course all of these steps are potentially perilous. If you’ve come up with something that is innovative then how do you know there is a market for it? As a small independent you don’t have the resources to have a focus group – and anyway have you even defined a core market? So maybe you’re taking a risk on the product or perhaps you’re launching a product to compete with an established player. In that case how do you ensure that you differentiate with that player and still get your voice heard? Secondly are you being realistic about how long it will take to build your software? If you have plenty of spare time and energy then this might be less of a concern, but if you have a family or other commitments be sure to work these in to your planning. Thirdly – and this is actually the best part – remember that you are the boss now. So when it comes to scheduling when you do stuff you can chop and change. If something is becoming a drag in your coding then give it up for a while and do some website stuff, or draw a logo, or write a press release or do some market research. Remember that all the effort you’re putting in is pushing the product in the right direction so don’t dismiss non-coding hours as non-productive ones. Even talking about your ideas with people counts as working – just don’t let them necessarily talk you out of it!

So let’s say you’ve got to that point when you want to release your software on the world but you’re still wracked with indecision. Is it ready? Is it good enough? Is it the right price? Will anybody want it? The only way you’ll find out is by pressing the button and getting it out of the door. If you get that far then there is no better feeling. So good luck.

(* I started writing this with the intention of saying how much easier it had got to build and release software regarding the tools, the payment providers, the website hosters etc. I’ve not got that far this time but I’ll get on to that at a later date. Also we need to talk about App Store vs truly Independent.)

Pi or the Sky?

Last week’s S3 cloud outage gave the cloud world a timely reminder that it doesn’t matter how big your infrastructure, you’re going to have some downtime at some point. With the continued migration to cloud solutions for not just B2C and B2B but increasingly intranet apps the question for a lot of organisations is, will the cost saving justify the risk and is that risk acceptable?

Where do we head next? Metacloud? Distribution across clouds? Or do we look to home hosted solutions? Or all of these?

One thing to bear in mind with cloud scale solutions is that they only work because they already use ubiquitous technology. The mechanism that makes them work is something any business of any size can leverage themselves if they know what they’re doing. The same is true for distributed computing as it is file systems but of course with storage you need to think about replication if you can afford it.

So when we talk about the cloud we need have no migration or lock-in fear. We should use it as we use our own servers, our desktops or even our Raspberry Pi. By using a combination of solutions we provide resiliency and availability. Nothing is going to be bulletproof but by anticipating failure modes during planning we can reduce downtime. Additionally we shouldn’t discount local solutions both for backups and for providing redundancy and uptime. The cloud or any geographically distinct storage solution no matter how big is only a part of the solution -and like any part if you rely on it completely then at some point you will have no other option.

Let’s go for it

So I still have some bugs to squash – but I want you all to have a look at what we’ve got so far so today we’re releasing the Friendlier Beta.  It’s fully functioning until the end of July so please download it and give it a whirl and let us know what you think.

In the last couple of weeks I sat down and sketched out a roadmap to see where we are and where we’re going.

At the moment things we know about Friendlier are:

  • Beautiful 3D user interface
  • Touch-like navigation (moving between windows, zooming)
  • Full screen/windowed modes
  • Syntax highlighting (C++)
  • Multi-level undo/redo
  • Stunning visual compare (you have to try it)
  • Build integration (Standard Out and Standard Error capture)
  • File management
  • Project and file level statistics
  • Single Friendlier project file architecture

Planned features for Friendlier (Q4 2012):

  • Multiple Friendlier project files
  • Improved C++/Qt support and syntax highlighting
  • Project import functionality (Makefiles, directories, Project files)
  • Improved java build and syntax highlighting
  • Autocomplete for Qt/C++ and Java
  • Source control integration (Subversion, Mercurial histories/compare integration)
  • Microsoft Kinect integration and speech support for navigation and build tasks

 Features beyond that:

  • Debugger integration
  • Multi-user project level paradigm including gamification of coding
  • Browser and notification integration
  • Graphical filesystem management
  • Windows 8/touch integration

The further features are dependent on where the next six months take us.   So far Friendlier has been in development for just over six months and we have a good platform for moving us forward.  Now we’re sending the challenge out to potential users to download it, give it a go and tell us what they think.  By offering the ability to pre-purchase Friendlier 1.0 we will also give early adopters the opportunity to shape the near term future of the product.  We call this futureware – it’s here, it works already but we want you to tell us where to take it.

Get Real Coders

The next time you’re asked to do a coding test in a job interview, ask them why? If your potential new bosses aren’t able to determine from your CV and from talking to you what level of experience and understanding you have then you probably don’t want to be working for them in the first place. Take it from me, they’re just trying to fill headcount – this is fine if you just need a job (because let’s face it, sometimes you just need a job right?), but if you want a career then forget about them or at least as them “Why?”

I’ve had lots of interviews and I’ve given lots of interviews. I’ve never given anyone a coding test and I never will give anyone a coding test. The attribute that every coder must have is honesty – honesty to themselves firstly and realising that you are fallible as well as honesty to others and realising that what you build affects other coders, users and everyone who will come into contact with your solution. Having a nice portfolio is useful, having experience is perfect, but honesty about yourself and your abilities is more important to me.

Spending an hour telling someone who is really not that interested in hearing it what polymorphism is, or the difference between an abstract class and an interface is a waste of everyone’s time. Do they not know themselves? What are they trying to prove by having you tell them? How does this help you fulfill the dead-end job they’ve got lined up for you?

Don’t spend the rest of your life working for idiots. One of these days I’ll be hiring.