Are you happy with the support you’re receiving from your development partner?

On the surface that might sound like an easy question, but dig a little deeper and the answer could get tricky.

Edsger Wybe Dijkstra, one of computing science’s most influential founding-fathers, had this to say about computer programming:

“If debugging is the process of removing software bugs, then programming must be the process of putting them in.”

In other words, no piece of software is infallible. The very act of creating that software will almost certainly involve creating a few (inadvertent) bugs as well.

To be honest, programmer Sidney Markowitz framed this problem even more succinctly when he said:

“The last bug is not fixed until the last user is dead.”

Which, if you say it out loud in a Woody Allen voice, sounds as funny as it is wise.

The bottom line is – it is extremely rare (read: it never happens) that, when a software product is delivered and deployed, it will perform flawlessly until the end of its working life.

It just isn’t possible, and sometimes it can take many years before the perfect set of circumstances arise which forces a software bug to reveal itself. Software bugs are notoriously shy, and possess better cloaking abilities than the Predator.

Which takes us back to our original question, because even though a software developer can never guarantee there are no bugs in their product, what they should be able to guarantee is that they will always support you whenever those bugs appear. So let’s try re-phrasing it:

How pro-active is the support your developer will give you after the product has been delivered? Is there a time limit to the support on offer?

Will they fix the bugs free of charge?

When you’ve got a problem, are you able to talk to the developer directly or are you forced to stumble through a maze of helpdesks and call centres first? (Hint: If that ever happens, take some advice from Jack Nicholson in ‘The Shining’ and always carry an axe, but wrap up warm because you’ll be in for a long wait.)

We develop software, so we’re acutely familiar with the problem from both sides. We’d love to convince you that there will never be any bugs in our product, but that simply wouldn’t be true. Who can predict the future? But we have one simple ethos – to make certain that we investigate and remove any bugs as soon as they appear, and to ensure that testing is always an on-going process and not just something that happens at the end. That’s why, when we develop our software, we constantly release new versions – not only to minimise the problem of software bugs as far as is humanly possible, but as our ongoing commitment to the customers who are relying upon our product. And whenever you want to talk to us – the developers – we’re right here at the other end of the phone or the email.

Will your development partner do the same for you?

Because we’re in a quoting mood, let’s end on two more:

Flon’s Law states: “There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.”

But here’s our favourite, courtesy of Olav Mjelde:

“They don’t make bugs like Bunny anymore.”

And P.S. if you can predict the future, please give us a call!

See you next time!

Why the ‘right’ way isn’t always the best way

Why the ‘right’ way isn’t always the best way

The software development industry is a notoriously difficult beast, frequently loaded with dogma and snobbery, and often with the annoying tendency to throw the baby out with the bathwater. It seems as if everyone has a strong opinion about the ‘right’ and ‘wrong’ way to do things and woe betide anybody who suggests an alternative way forward.

I’ve been developing software for a very long time, and JavaScript is a language I know extremely well. To give you some idea of my pain, I can still remember spending significant hours wrestling with JavaScript, trying to make the same code work on both Netscape and Internet Explorer. Believe me, if there’s a PTSD for software developers, then I’ve got it.

Back in those (I’m resisting the urge to say ‘good old’) days, the usual method of attaching an event to a HTML element was simply to add it into the tag, like so:

<img src="myimage.jpg" onclick="my_event();" id="myimage">

Easy, right? But how times have changed. Now, the ‘correct’ approach is to attach the event after the fact, which means that some script is placed to run after the page has loaded:

<script>

//attach event
var img=document.getElementById('myimage');
if (img) {
	img.addEventListener("click", function() { my_event(); } );
}

</script>

Just looking at it, and comparing the two, the differences are obvious. Yes, I can appreciate that this ‘new’ way allows for a better separation of content and code but, in my humble opinion, the original way is still by far the simpler and cleaner method.

Now I’ll tell you why the new way didn’t work for me, and what I did about it:

I am currently developing a web application which requires a simple click event to be registered on a line of data within a grid. The grid itself was being generated ‘on the fly’ from data supplied by the backend server code.

When I coded a loop in JavaScript to add the Events, everything worked fine in Chrome and Safari etc. but then – when I got to Internet Explorer – it just wasn’t happening.

For reasons of time and sanity (both yours and mine) I won’t explain the weird and wonderful intricacies of this project, except to say that the application needs to support IE8 as the minimum requirement. If you’ve ever had to support lower IE versions you’ll know that you need to use attachEvent, which worked for me up to a point. The big problem was that I needed to pass through the sender object (the object that was clicked) which I would normally do something like this:

img.addEventListener("click", function() { my_event(this); } );

All well and good, except(this)was being pre-translated by IE within the loop, meaning it didn’t refer to the correct object when I clicked each line on the grid. So how did I solve the problem?

Well, after wasting a lot of time pulling my hair out (not an easy trick, but we can talk about that another time) and banging my face so hard into the keyboard that I now have QWERTY permanently imprinted on my forehead, I decided to throw out the ‘new’ ‘correct’ approach in favour of the older, easier, but probably no longer recommended method. I added the event call into the backend code so that it generated:

<img src="myimage.jpg" onclick="my_event(this);" id="myimage">

What do you know? It worked! Score 1 for ‘old skool’ (no, that’s not a misspelling), proving yet again that the new ‘right’ way of doing things isn’t always necessarily the way that’s best.

See you next time!  

 

Debian 7 to 8 VM update

As a lot of developers I utilise Virtual Machines (VMs) to host my development environments.  Below are my notes with some of the issues I had updating a Virtualised Debian 7 machine to Debian 8 (Wheezy to Jessie).

First thing was a standard update, ie. make sure the current system is updated by doing:
apt-get update
apt-get upgrade

Then I needed to change the sources file in /etc/apt/  basically where wheezy was mentioned you change this to jessie

Then the update:
apt-get update
apt-get upgrade

Grub – issue

During the upgrades I got some Grub errors (when prompted I ticked the boxes to install Grub wherever it wanted and this seemed to be OK).

Some packages would be held back and so to fix these you need to do:

apt-get dist-upgrade

Apache issues (part 1)

During the update the installer asks if I wanted to keep some of my existing Apache conf files or replace with the new ones.  As often I would have changed the configuration files specifically for my setup I opted for the default of keeping my own.  The two files of note for me were apache2.conf and ports.conf.

Virtualbox Guest additions issues

During the update, Virtual box guest additions gave an error performing build.  So I Set Networking to Bridged so I could get a connection.

Further Update issues

apt-get update / upgrade gave:

Calculating upgrade… The following packages were automatically installed and are no longer required:
apache2.2-bin apache2.2-common dkms fakeroot giblib1 gnome-js-common gstreamer0.10-plugins-good gstreamer0.10-pulseaudio libbind9-80 libcolord1 libdconf0
libdevmapper-event1.02.1 libdns88 libdrm-nouveau1a libfakeroot libfftw3-3 libfftw3-long3 libgd2-xpm libgdu0 libglew1.7 libgphoto2-2 libgphoto2-port0 libicu48 libisc84
libisccc80 libisccfg82 libjson0 liblvm2app2.2 liblwres80 libparted0debian1 libseed-gtk3-0 libsystemd-daemon0 libsystemd-login0 libvte-common libvte9
linux-headers-amd64 openssh-blacklist openssh-blacklist-extra python-aptdaemon python-aptdaemon.gtk3widgets python-defer python-fpconst python-gnupginterface
python-pycurl python-software-properties udisks virtualbox-guest-dkms virtualbox-guest-utils
Use ‘apt-get autoremove’ to remove them.
Done
The following packages have been kept back:
db5.1-util
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

Do I decided to remove the db5 package as it looked like a hangover from an older version of Debian.

apt-get remove db5.1-util

Fixing the VirtualBox Guest additions

So I wanted to see if I could get the VirtualBox additions updated, so I searched for what was available:

aptitude search virtualbox
id virtualbox-guest-dkms – x86 virtualization solution – guest addition module source for dkms
id virtualbox-guest-utils – x86 virtualization solution – non-X11 guest utilities
c virtualbox-guest-x11 – x86 virtualization solution – X11 guest utilities

I opted to try a complete purge and re-install:

aptitude purge virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11

However after this an aptitude search turned up no packages.

Looking online I found the following instructions:
apt-get install build-essential module-assistant
m-a prepare

Mount the Guest additions CD from the Devices menu (or tried to, but couldn’t)
In the end I had to:
mount /dev/cdrom /media/cdrom

then the last instruction was:
sh /media/cdrom/VBoxLinuxAdditions.run

this failed:
Verifying archive integrity… All good.
Uncompressing VirtualBox 4.2.16 Guest Additions for Linux…………
VirtualBox Guest Additions installer
Copying additional installer modules …
Installing additional modules …
Removing existing VirtualBox DKMS kernel modules …done.
Removing existing VirtualBox non-DKMS kernel modules …done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

Building the main Guest Additions module …fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions …done.
Installing the Window System drivers
Warning: unknown version of the X Window System installed. Not installing
X Window System drivers.
…done.
Installing graphics libraries and desktop services components …done.

so I tried:
apt-get install linux-headers-amd64 (but it seems this was already installed)

A support forum pointed out tha dkms needs to be installed:
apt-get install build-essential linux-headers-`uname -r` dkms

In the end I decided to find a more up-to-date iso but still a similar version to the VirtualBox Host:
http://download.virtualbox.org/virtualbox/4.3.34/VBoxGuestAdditions_4.3.34.iso

I downloaded and renamed to VBoxGuestAdditions.iso

Re-performed the install from the guest and the install seemed to go through fine.
Reset the network back to NAT and attempted a simple port forward for the VNC server which worked fine!

Apache problems…

Apache wasn’t starting up
/etc/init.d/apache2 start
[….] Starting apache2 (via systemctl): apache2.serviceJob for apache2.service failed. See ‘systemctl status apache2.service’ and ‘journalctl -xn’ for details.
failed!

problems were down to errors in the apache2.conf:
Include conf.d/ (This no longer exists so changed it to conf-enabled/)
LockFile (simply commented out with a #)

Now Apache started.

However sites that used .htaccess like WordPress and Joomla were failing to work with a .htaccess Options not allowed here error in the Apache log.

placing this right at the end of sites-available/000-default.conf seems to sort it:
<Directory /var/www/>
AllowOverride all
</Directory>

Further investigation reveals an extra section in the standard apache2.conf distributed so I decided to remove my above mod and copy the below into my version of the apache2.conf:

# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>

<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>

I then changed the AllowOverride in the /var/www section to All from None.

Power Off

Another thing to note was I always use halt to shutdown a VM, however now in Debian 8 this no longer powers the machine off, instead you have to do:

halt -p

Windows 8.1 Networking is easier via command line

It is amazing how often when diagnosing or fixing network issues I will jump to the command line on Windows as it is just quicker and simpler.

I was working on a customer’s Windows 8.1 laptop the other day, which was connected to two network printers, one was shared from another PC on the LAN, the other was a wireless printer directly connected to the network.

When I tried right click connect in Windows all I got was failure messages.  It had got itself in a muddle and no amount of rebooting was fixing it.  Eventually I fired up a command prompt and entered:

net use \\server\printername

(replacing server and printername with the actual names)

it returned back with no errors and to my surprise the printer would now connect from the control panel.

The net use command is extremely powerful, it can connect drive shares, disconnect them, allow you to specify different usernames and passwords, map drive letters etc.  A lot of these things are difficult to do directly in Windows.

To get an idea just issue this at the command prompt:

net use /?

 

 

Retrochallenge 2015/07 – Retrospective

And so another Retrochallenge over.

This time however I did not succeed in all my objectives.  So this article is a summary of the hits and misses.

What did I achieve?

  • I learned a lot about Assembly programming on the Electron.
  • Learned how the memory maps in Mode 2
  • Created some rudimentary sprite routines
  • discovered how the Electron Plus/1 requires Paddles to be wired up
  • Up-cycled some old paddles for use with the Plus/1
  • Learned how to image ADFS disks
  • Learned how to extract files from the ADFS images and convert to text

What did I fail to achieve?

  • Failed to get the Atari Paddles working
  • Failed to get close to any sort of playable game

So in summary I am happy that as a learning exercise I have advanced forward with my knowledge of the Acorn Electron.  However it was a shame I couldn’t have committed more time to it, and achieved more of the final aims.

Retrochallenge 2015/07 – Debugging the 6502 Machine Code

With time rapidly running out for this challenge I’m hoping to at least get a simple animation working on the Electron.  Once I had written my first simple test code I discovered that the “calcscrloc” code had a couple of bugs.

Below is the debugged Calculate Screen Location Routine:

.calcscrloc
NOP ; CALCULATE MEMORY LOCATION
NOP ; STORE IN &70,&71
NOP ; A 0/1 FOR EVEN/ODD
TYA ; READY TO PROCESS
LSR A ; DIVIDE BY 2
LSR A ; DIVIDE BY 2 (4)
LSR A ; DIVIDE BY 2 (8)
STA &70 ; USE AS TEMP STORE
ASL A ; MULT BY 2
ASL A ; MULT BY 2 (4)
CLC
ADC &70 ; ADD ORIG VALUE (X5)
CLC
ROR A ; SHIFT RIGHT BIT 0 IN C
STA &71
LDA #0
ROR A ; SHIFT C INTO BIT 7
STA &70
TYA ; ORIGINAL Y COORD
AND #7 ; BITS 0-2
ORA &70 ; ADD 0 TO 7
STA &70 ; STORE
LDA &71
CLC
ADC #&30 ; ADD SCREEN BASE
STA &71 ; STORE
TXA ; READY TO MULT BY 4
AND #&C0 ; TOP 2 BITS
LSR A ; MOVE RIGHT
LSR A ; MOVE RIGHT
LSR A ; MOVE RIGHT
LSR A ; MOVE RIGHT
LSR A ; MOVE RIGHT
LSR A ; BITS ARE NOW 0-1
CLC
ADC &71 ; ADD TO MS BYTE
STA &71
TXA ; READY TO CONT MULT BY 4
AND #&3E ; BITS 1-5
ASL A ; MULT BY 2
ASL A ; MULT BY 2 (4)
CLC
ADC &70 ; ADD TO LS BYTE
STA &70
LDA #0
ADC &71 ; ADD CARRY TO MS BYTE
STA &71
TXA ; NEED ODD / EVEN
AND #&01 ; WE JUST NEED BIT 0
RTS
.incscrrow
NOP ; INCREMENT SCREEN MEM ROW
PHA ; PRESERVE A
TXA ; TRANSFER TO PRESERVE
PHA ; PRESERVE X
TYA ; TRANSFER TO PRESERVE
PHA ; PRESERVE Y
INC &70
LDA &70
AND #&7 ; USE BITS 0-2
BEQ incscrrow_1
.incscrrow_2
PLA ; POP (Y)
TAY
PLA ; POP (X)
TAX
PLA ; POP A
RTS
.incscrrow_1
DEC &70 ; DECREMENT BACK
LDA &70
AND #&F8 ; MASK OUT BITS 0-2
CLC
ADC #&80 ; ADD THE LS OF &280
STA &70
LDA #0
ADC #&2 ; ADD THE MS OF &280
CLC
ADC &71 ; ADD EXISTING MS BYTE
STA &71
JMP incscrrow_2

So I now have the following BASIC code creating a very simple animation moving the ball down the screen:


OLDX%=-1
OLDY%=-1
FOR A%=0 TO 251 STEP 2
IF OLDX% <> -1 THEN X%=OLDX%:Y%=OLDY%:CALL removeball
X%=79
Y%=A%
Z=USR(displayball)
OLDX%=X%
OLDY%=Y%
NEXT

It is however very flickery and so I may need to see if doing the remove within the assembly is going to be faster than doing it in BASIC.

Bespoke Software Development: the remedy for your business headache!

Are you suffering with a painfully inefficient part of your work life that causes irritation, distress and sends your blood pressure sky high? Fear not, Dr Syrinx is here to help.

We’ve treated a number of cases of this all too common condition and the good news is that the cure could be relatively simple. The treatment we prescribe is bespoke software development.

Your company is every bit as individual as you are, and so there might not be a one size fits all answer to the procedural problems that blight your business. That’s why when we come to examine your particular concern, we make sure our treatment is tailored just for you.

Just recently we received an SOS from Mill House Media who had a perfectly good database to track their costs and services but had encountered a problem. They were afflicted by a serious loss of hours – thanks to an invoicing issue related to their Microsoft Access database that didn’t function as they needed it to. Every time someone had to actually step in to manually split each individual invoice and then e-mail them out. No wonder they were in operational agony.

Imagine their delight when Dr Syrinx took a look and then delivered a favourable prognosis. All it took was for us to take the existing report query, automate the process to build the document and automatically lay it out. That and a couple of minor layout tweaks. It was a simple, effective cure that gave our customer hours of his life back.

So if you’ve got a pain that might have a simple Syrinx cure, get in touch and let us get working on your remedy!

Syrinx helped turn a job that could sometimes take half a day or more into one that could be dealt with, efficiently and effectively, in a few minutes. My team are grateful, too – especially as the job involved was sorting out their end of month payments! Syrinx took the time to find out exactly what we needed, check that they’d fulfilled the brief, and follow up to ensure that all was well once we started using the app. Great work – we have no hesitation in recommending them’  Allan Scott, Mill House Media

 

A Piece of Pi

Here at Syrinx we worship at the temple of technological advancement but it’s sometimes fun when a job gives us the chance to crack open our real toolkit too. So when Instromet Weather Systems Ltd came to us with a job that would utilise our software know-how and meant Sean getting his soldering iron out, we were all very excited.

Instromet needed help with their sun duration sensor, which was being sold to a European meteorology company for distribution. They planned to sell to ski-ing centres and resorts who want to be able to tell their customers how many hours of sun they can expect in real time. The problem was that the sensor needed to be connected to their IT systems so they could extract the data.

After consultation from Sean, we suggested installing a Raspberry Pi and using bespoke software to talk to the sensor. As the Raspberry Pi runs of WIFI and uses minimum power, it’s incredibly efficient and was able to pick up the real time data and transmit it straight to their servers. After quite a lot of fun working up a prototype, the product was ready to roll.

You can take a look at the sun sensor updates at the Instromet Weather Systems Ltd website here. Even if you aren’t slaloming down the slopes, it is fascinating to see what the sun is up to.

Raspberry Pi Sun Sensor

 

Virtually Priceless

Product Case Study

PAT00’s Simulator – Megger Limited

We have recently finished working on an interesting development, delivering a software simulation tool to a Product Manager (PM)  at Megger Limited, who design and manufacture test and measurement equipment.

The objectives of the project were to create accurate simulations of two specific test instrument variants in a product range, and to mimic the behaviour of the complex custom LCD displays as the instruments performed their various test and measurement functions.

The goal was to provide the PM with a simulation tool that he could use for virtual product demonstrations, training sessions and other situations where a simulation of the test instrument proved a better option than actually using the real thing itself.

An example of such a situation would be where the PM would be presenting to large groups, such as in a seminar environment, where the real product would be very difficult to see and a virtualised simulation would be a much better alternative.

Delivery of the simulator was split into two phases with a tight six week deadline imposed for the first phase as there was a need to start to test the interface with end users and collect feedback on the simulator as soon as possible.

The results;

Simulator on iPad

Simulator on iPad

Wk1 – By the end of week 1 we had set up development and test environments, source control systems etc. and built an online viewer to enable the customer to see and comment on our development work “hot off the press”.

Wk3 – At the end of week 3 we showcased our work to the customer having already implemented all of the features necessary to support one of the instrument variants. We provided a fully tested offline build of the simulator to enable the Product Manager to start demonstrating to end users (3 weeks ahead of the original deadline for delivery!)

Wk5 – By the end of week 5 we had completed, showcased and delivered the complete phase 1 delivery (1 week ahead of schedule) and we had a meeting with the customer to ensure there were no late breaking requirements affecting the phase 2 delivery.

The combination of the iterative delivery and the online viewer allowed the PM to engage with end users and get valuable feedback very early on in the project, whilst development work was still very much in progress.

This approach also gave other Engineers and Project Managers on the customer’s site the ability to test the more detailed aspects of the simulators against the real test instruments, teasing out and allowing us to resolve any issues at an early stage in the process.

This is one of a series of short articles to be published on this project by Syrinx Systems Limited, check out the test and measurement page on our website for more information on our experience in this industry.

Retrochallenge 2015/07 – 6502 Assembly Slow Progress

It seems I have underestimated the time I needed to develop the 6502 Machine code routines that will allow me to start the game development.  The perils of “learning on the job” I suppose.

As all programming goes, and especially so with machine code, the art is breaking it all down to very small pieces and working on each piece individually.  With the limitations of the Acorn Electron’s line editor this is even more the case.

My aim is to write some machine code routines that allow me to easily draw the sprites onto the display as the built in BASIC just wont be fast enough.  The first bit of code I required was to convert a X and Y screen coordinate into the mode 2 memory location so I can easily ‘poke’ into the screen memory.

I thought this would be trivial but proved more challenging than I expected.

however I do now have the following code which appears to work though it will likely change especially how I return odd / even (currently in the A register).

.calcscrloc
NOP ; CALCULATE MEMORY LOCATION
NOP ; STORE IN &70,&71
NOP ; A 0/1 FOR EVEN/ODD
TYA ; READY TO PROCESS
LSR A ; DIVIDE BY 2
LSR A ; DIVIDE BY 2 (4)
LSR A ; DIVIDE BY 2 (8)
STA &70 ; USE AS TEMP STORE
ASL A ; MULT BY 2
ASL A ; MULT BY 2 (4)
CLC
ADC &70 ; ADD ORIG VALUE (X5)
CLC
ROR A ; SHIFT RIGHT BIT 0 IN C
STA &71
LDA #0
ROR A ; SHIFT C INTO BIT 7
STA &70
TYA ; ORIGINAL Y COORD
AND #7 ; BITS 0-2
ORA &70 ; ADD 0 TO 7
STA &70 ; STORE
LDA &71
ORA #&30 ; ADD SCREEN BASE
STA &71 ; STORE
TXA ; READY TO MULT BY 4
AND #&C0 ; TOP 2 BITS
LSR A ; MOVE RIGHT
LSR A ; MOVE RIGHT
LSR A ; MOVE RIGHT
LSR A ; MOVE RIGHT
LSR A ; MOVE RIGHT
LSR A ; BITS ARE NOW 0-1
CLC
ADC &71 ; ADD TO MS BYTE
STA &71
TXA ; READY TO CONT MULT BY 4
AND #&3E ; BITS 1-5
ASL A ; MULT BY 2
ASL A ; MULT BY 2 (4)
CLC
ADC &70 ; ADD TO LS BYTE
STA &70
TXA ; NEED ODD / EVEN
AND #&01 ; WE JUST NEED BIT 0
RTS

I still have lots of machine code routines to write, and it is looking like I am up against in regards to the Retrochallenge deadline of the end of the month!  However I am determined to keep pushing forward and at this stage I think I will be happy if I can just demonstrate basic sprite animation on the Electron.