Archive for the ‘Development’ Category

Have you unit tested that aileron servo?

2016/05/25 Leave a comment

Unit testing has become a religion. The more a system is replaced with impostors just for the sake of testing convenience and timeliness, the lower the level of usefulness such results have when reporting to stake-holders.

Testing with a database is integration testing and one does not mock-out an airplane aileron when testing a flight management computer just because the aileron’s servos are slow!

Categories: Development

Developer De-skilling and the Fast Food of Software Development

2015/08/01 Leave a comment

In the beginning, anyone who wanted to be around a computer generally wore a white coat and had several letters after his surname.  Over time and with each generation the need for programmers to be part of a secular order; to punch peculiar tiny holes onto small flat pieces of cardboard has no longer been as important and has freed people up so that they may instead fixate over purchasing small electronic devices for the purpose of making phone calls, only to buy a new model the following year.  Which is odd when you think about it since no one really buys these small device for making phone calls but I digress.

In the early years, at least from my experience, you really had to know your stuff as a c/c++ developer.  There was no Internet (at least we had access to);  no Google to find things at a touch of a button;  no open source library let alone open-source system or sub-system that you could plonk willy-nilly into your project.  What we did have were books?  Ah books.  Lovely smelling finger-loving hard-bound tomes of awesomeness.  Didn’t know something?  Look it up.  I fondly remember the wonderful set of Windows 3.0 API and Microsoft MFC volumes.  I read the reference manual from beginning to end.  I could not wait to try out something I had learnt.

As I mentioned, we didn’t use open source – such a concept did not arise in the Windows world at least in my travels until everyone had pretty much committed to c#.  I’d say everyone in our team were equally skilled and we had great team-work. Prior to that – need a database? Hire a DBA.  Need to learn DCOM?  Buy that Wrox book.  Embedded system?  R&D.

Today I find it’s all rather changed where the need for creating a software sub-system is replaced with an order to source a pre-fabricated; unknown; un-tested; potentially toxic foreign body and plug it into our developing system.

  • No sooner as a need arisen for hosting multiple .NET services into a single system as someone says “get a open-source project”
  • Need a reliable messaging system?  Better down-load that open-source bus project that has been stagnant for the past 24 months
  • Need a plug-in system?  Well you better use MEF then
  • Don’t have time for a nutritious home-cooked meal with ingredients your purchased?  Better buy that burger at the drive-thru then

Now, I can understand that time spent rolling our own equivalent to the above may be better suited to fulfilling the immediate demand as put by the project requirements.  That’s a valid point so long as measure the time spent rolling your own relative to the time spent developing the entire project.  If you’re going to incorporate someone else’s system, you should ideally quarantine the foreign system and subject it to the same level of software testing your company does.  I suspect you don’t and you would not be alone.

I only this week threw the c++ DICOM open source testing project DVTk into the bin.  It had more memory leaks than atoms in my Miss Piggy coffee cup.  It’s rather embarrassing really when you consider the API is meant for a testing software.  Ooops!

Plus and more importantly, pre-fab software sets a dangerous precedent where if left unchecked, developers would be largely nothing more than systems integrators with little knowledge how the disparate foreign sub-systems operate nor of the overall quality of said sub-systems; where all the substantial; complex and low-level development has been done by someone else.

One has only to look at some of the questions on StackOverflow.

Only this week someone was asking:

“how do I make a progress bar for my UI”.

Nothing wrong with that until you learn the author is wanting to make a game in Unity 3D no less.  I’m pretty sure making a game has a high requirement that a developer be skilled graphics-wise.  If you can’t make a progress bar then you should not be making a game.  To not to be able to do so when you’re using a 3rd party game engine – something that is responsible for a measurable and significant amount of foundation is just the more embarrassing.

This is what the world of pre-fabbing has come to.  What is even more amazing is that even in this world of instant-satisfaction Googling, some people are have trouble clicking that search button on their web browser because they are too busy looking at their shiny phone or new age digital watch.  Unable to spend time with Google or AskJeeves to perform any form of research or let alone pick up a book.

The other danger of course failure in backward-compatibility or failure as a result of a combination of 3rd party system interaction of a 3rd party system or systems or platform in the future.

  • Making a control for Google Chrome using their proprietary control technology?  Let’s hope they don’t remove it as a feature. Oh wait they just did
  • Not too long ago, many firms were utilising Flash in their web sites but iOS; and the continual desktop security issues eventually saw to the demise of the once popular juggernaut
  • Using AnglularJS?  Can you bet your guinea pig’s life that AJS won’t be incompatible with browsers in 5 years time?
  • Can you say for 100% certainty that HTML5 won’t be replaced with something else?
  • Can you say with confidence that the contributors to say AJS won’t ditch it for something new

But wait I hear you say – it’s open source, we can just download the source code and maintain it.  Perhaps, assuming of course that the skill set of the developers are up to the task and more importantly management will allow you to spend considerable resources in an attempt to first comprehend the 3rd party system; then make the necessary changes.

In some ways, even using a web browser is essentially a 3rd party open source ever changing, widely-unpredictable development platform.  Is it really necessary for your next project to be browser-based?  Particularly if its for an intranet.

Think twice before you use that open-source project.

Categories: Development Tags: ,

n-Body Galaxy Simulation using Compute Shaders on GPGPU via Unity 3D

2014/02/01 12 comments


Following on from my prior article about GPGPU, I thought I try my hand at n-Body simulation.

Here’s my first attempt at n-Body simulation of a galaxy where n equals 10,000 stars with the algorithm running as a compute shader on the GPU.  Compute shaders are small HLSL-syntax-like kernels but can run in massive parallel compared to a regular CPU equivalent.

It’s important to remember that conventional graphics including those in games, do not use GPGPU for star fields.  Generally this is accomplished by either manipulating the star coordinates CPU-side and uploading to the GPU every frame or so; or utilise a small shader that renders a pre-uploaded buffer of stars that may or may not move over time.  In any event, it would be unlikely to perform n-Body simulation using conventional non-GPGPU means due to the slow performance.

My simulation entails n2 gravity calculations per frame or 10,0002 = 100,000,000 calculations per frame at 60 frames per second – something that is quite impossible if I attempted to do it from the CPU-side even if the GPU was still rendering the stars.

Here’s the compute kernel (note I’m hosting the Gist on GitHub as a “c” file in order to display syntax hi-lighting.  Readers should be aware the correct file extension is .compute):

Here’s my Unity MonoBehaviour controller that initialises and manages the simulation:

GPU General Purpose Computing with Unity Compute Shaders

2014/01/16 3 comments

Compute Shaders in Unity3D are a way to perform general purpose computing on a GPU card.  This is known as General Purpose computing on Graphics Processing Units or GPGPU.  This means you can use the GPU to perform operations that may not necessarily have anything to do with graphics.  e.g. protein folding simulations (ya I don’t know what that is either).  Not everything is suitable, only those operations that can run concurrently and make use of the ridiculous amount of parallelism on a GPU.

Unity’s Compute Shaders are currently limited to supporting DirectX 11 only but I suspect this will change in the future when you consider that Unity’s aim is to be cross-platform.  DX11 compute shaders is also known as DirectCompute.

Compute shaders syntax is just as per HLSL so you should feel right at home.

Compute shaders are great.  Normally from what I understand, if you had a ton of stuff to manipulate well you had to do it CPU side then upload it to the GPU – a very expensive operation not to be done frequently.

With compute shaders you merely allocate the data CPU side and send it once to the GPU.  From then on a little program (or kernel) updates the data for you and the output is passed to a shader for rendering.  All without being touched by the CPU.

Here’s my first attempt at making a GPGPU galaxy modelled with 1,000,000 stars where the stars are moved on the GPU side of things.  It’s looks more like a pizza at the moment, oh well.  I can manage 60 FPS on 1920×1080.




I’ll follow up with a non-pizza looking galaxy soon and some source code as documentation on anything GPGPU is quite rare.

Maybe if we get enough of these GPUs we can find out what “42” means?

Categories: Development Tags: , ,

The Programmer and the Paper Plane

2013/03/23 Leave a comment

This week at work we were visited by an agile expert who presented a workshop on agile task estimation techniques such as:

During the Planning Poker segment we were to use Fibonacci sequence poker cards to estimate a hypothetical project were the aim was to create a series of items made from folded paper including:

  • Simple helicopter
  • Paper plane
  • Decorated plane
  • bird
  • decorated bird
  • and so on…

Having made many Origami flapping birds, cranes, frogs, flowers when I was in my teens, I eagerly raised my hand when the question was asked:

“Has anyone ever made paper items before?”

Before I realised what was going on I was being passed a sheet of paper and told to make a paper airplane in front of everyone whilst being timed.  Normally I don’t like this level of attention but it was all in good fun.

I started off well, remembering to fold the paper in half but unfortunately the only design that came to mind was probably the most obvious from my early youth.  I continued to fold and crease, trying my best to keep it neat all awhile the imaginary tick-tick-tick from a stopwatch from afar encouraging me to go faster.

I kept at it till it resembled something that could fly at which point it was ready to give it its maiden flight.  I picked it up, raised it high above my head and carefully tossed it with all the grace I could muster into the boardroom skyline, only to watch it gently fall to the table in exactly the same way that feathers don’t. 😉

At which point someone said:

…and this is why developers should not test their own code!

To which we all including myself broke out in hysterics. Smile

Categories: Development Tags: , ,

Well No, Macs No Longer “Just Work”

2012/09/16 Leave a comment

Last year I wrote about how things changed once I bought a Mac, well it has been over a year now and I wonder how things are fairing?

Things have changed drastically during the past year and it’s quite worrisome. Let’s review that post in chunks:

  • Apple TV and iTunes on iMac just work; do not forget each other

Well no, ever since OS X Mountain Lion (ML) if my Mac goes to sleep to conserve power, it’s too dumb to restore network connections properly once the Mac comes out of sleep.  Maybe it’s my router?  Did I mention I have an Apple Airport too? So now I have to tell it not to sleep which is sort of naughty in this green day and age.

  • Canon MX850 was automatically detected over wi-fi when plugged into Airport Extreme Base Station USB socket

This still works, yay!

  • Lacie 4big Quadra 4TB RAID was automatically detected and iMac kindly asked if I wished to use it for TimeMachine
  • Pressing big blue button on Lacie launched the brilliant TimeMachine app
  • TimeMachine is fast, intuitive, reliable
    Sadly this is screwed if my Mac does to sleep; the Mac does not wait for the drive to be ready before it stupidly tries to open iTunes.  Some times I have to reboot the iMac and/or Quadra.  Did I mention Windows has no problem?
  • Apple’s iMail automatically configured e-mail server settings just by me typing in my address

I have had no reason to redo this but that’s all pretty academic since iMail/Mail is too demented to restore connectivity after a sleep.  I have to rerun Mail.  At least prior to ML you could click the little alert symbol to fix it.

  • MS Messenger for iMac (via Office Mac) is much like pre-Windows Live Essentials meaning it doesn’t have the annoying ads but more importantly, uses less computer resources like memory and CPU in wlcomm.exe

Well sure, but sadly it does not support pasting images into it plus it’s missing all the features in the Windows Live Essentials version on Windows.

  • Apple’s Xcode IDE is only $5.00 and uses minimal CPU and memory

Xcode tends to crash – a lot!  However, Xcode is continuing to grow on me and they are adding new features all the time, sadly the debugger is rather featureless compared to Microsoft Visual Studio.

  • Though Apple may make use of seemingly vertical standards such as Bonjour, historically it can be shown that Apple is more likely to adopt more popular standards with more realized use cases than say MS.  Calendering is a good example

Mail, Calenders and Chat continue to support other non-Apple tech which is nice.

I’m not sure why I said Visual Studio is bloated, particularly when such criticisms are silly when no one is stopping you to install any version whether it be Express or Ultimate or any in between.

Categories: Development, News Tags:

Check Out our New Work Office!

2012/08/28 2 comments

Our work – Primary Health Care (formerly DDI Health), moved to it’s new office in Perth, Australia and it’s fantastic!  We think it’s the best place to work at in Australia.


  • A TARDIS that opens so that you can make a phone call in privacy and comfort
  • Groovy retro meeting room complete with “Dr Evil”-looking chairs
  • Heaps of meeting rooms each with unique theme; smartboards through-out
  • A cottage/kitchen right smack in the middle
  • Homely kitchen
  • Huge outdoor veranda; remote-controlled retractable roof
  • Ergonomic tables and chairs for all
  • Forest theme
  • Ergo-smart building
  • Converts to a “nightclub” at a flick of a switch!

Retro meeting roomIMG_0608

TARDIS – yes you can go in and make phone calls in comfort and privacy!






North wing


Meeting roomIMG_0609

Arched EntranceIMG_0610

Lounge Area #1


North Wing phone booth


North wing looking back to kitchen


Balcony with electric awning retracted


South wing


South wing looking towards kitchen/cottage


outside kitchen


The kitchen


Kitchen looking towards north wing


Categories: Development Tags: