General BLOG stuff

Making an external connection to a Blaknight MySQL database

You can connect to a Blacknight MySQL database from an external tool (e.g. mysql or mysqlimport commandline) if you change some of the database’s settings. This can be useful if you need to manage your database, for example if you need to perform a large database import (one that is so large it causes phpMyAdmin to time out).

First you need to configure the database to allow external connections, in the Blacknight control panel choose to edit the database’s settings and check the ‘Access from external hosts’ check-box. This change on its own isn’t sufficient, next you must add your ip address to the ‘Access Hosts’ list.

enable_external_access

When on the database properties page, click on the ‘Access Hosts’ tab, click on ‘Add new access host’ and add your ip address. To find your IP address, just google ‘my ip address’ and your address will be displayed near the top of the results page.

add_ip_address_blacknight

Once you have made these changes you should be able to make external connections to the database. When you are finished it is probably a good idea to remove external access again.

You can now do something like import a database, get the hostname from the ‘external hostname’ field on the blacknight control panel:

Software Requirements Specification

software_requirements_1

I am currently of writing a fairly large software requirements specification for a client. I am acutely aware that in general people don’t like to read documents, and that large terse documents like software development specifications can be especially challenging. To help reduce the amount of effort that readers will have to put into reading and reviewing the document while attempting to increase its usefulness I am doing my best to follow some simple self enforced rules:

1. Avoid using abbreviations (TLAs)
2. Avoid mentioning technologies – this is a requirements spec. after all!
3. Avoid unnecessary Capitals As Much As Possible!
4. Avoid repeating words in a sentence for no good reason
5. Run the spell checker
6. Add a revision number
7. Print out and properly review on paper before releasing to to the client.

Hopefully if I stick to these rules, then the specification will end up as a slightly ‘better’ read.

Mathematica to be bundled with Raspberry Pi

The register reports that Mathematica is to be bundled with the RaspberryPi which to my ears is fantastic news as Mathematica is by far my favourite mathematical tool even if the forces of convention force me to use the slightly duller Mathlab most of the time…

Algorithm to calculate speed from two GPS latitude and longitude points and time difference

I found this good description of how to calculate an approximate speed over ground given two latitude and longitude coordinates and a time difference:

http://answers.yahoo.com/question/index?qid=20110325075640AADHGXI

It involves first plotting your two GPS points on a spherical model of the earth, calculating the angle between them using a dot product, calculating distance using this angle and the earth’s radius and finally dividing by the elapsed time to approximate the speed.

Thanks to bpiguy for the answer!

Now I just have to implement it….

Update:

I finally got around to writing some code to play with this distance calculation:

This function takes the latitude and longitude in signed decimal format and returns the distance in metres, I have left in the ‘r’s for clarity but if efficiency is what you’re after then they can be removed as the original post suggests…

Now once you have the distance between the points you can estimate the average speed by dividing this distance by the time between the two position measurements like this:

This code assumes that p1 and p2 represent the first and second measured GPS positions and that the time-stamp recorded at each is enumerated in milliseconds, it calculates both metres per second and kilometres per hour. It is important to note that this is only an estimate of the average speed between the two points and its accuracy will depend on various factors including the distance and time elapsed between the two GPS measurements.

Computer Vision in the Cloud? – Amazon makes Nvidia GPUs available

I just came across this article from The Register that mentions that Amazon is making Nvidia GPU cores available:

http://www.theregister.co.uk/2013/11/05/aws_gpu_grid_service/

Makes me think again about the possibilities of doing Computer Vision / Machine Vision in the cloud (taking advantage of GPGPU techniques via OpenCL etc.), however like most of Amazon’s stuff it would probably be way too expensive, interesting though – I must look into it if I ever get the time…

New Look Website

If you are a repeat visitor you may (or may not) have noticed that we have launched our brand new-look website.  There are still a few tweaks to do so if you notice anything dodge please let us know!

Many thank to Ridge Design, Wicklow for the fantastic web design!

C++11 Lambda Expressions

It appears that using lambda expressions in C++ makes me surprisingly happy, they can be positively good for the soul it seems!

Fedora released for Raspberry Pi

Another OS option for your Pi – Fedora Remix has been released for the Raspberry Pi, it is based on the Fedora ARM secondary architecture project, more details can be found here:

http://zenit.senecac.on.ca/wiki/index.php/Raspberry_Pi_Fedora_Remix_FAQ

I love the 4th. item in the FAQ, it is entitled – “Why is the Remix slow?” lol

It makes me very curious, just how slow is it? I guess I will have to install it to find out! :-)

Enterprise Architect UML – Add C++ #include code statements for dependency relationship

By default #include statements are not inserted into files for dependency relationships when generating C++ code from UML models in Sparx Enterprise Architect – this is a bit annoying but we are well used to UML editors doing annoying things so at least it’s not a terrible surprise!

 

In Enterprise Architect’s defence it is quite easy to add this missing functionality. In order to get it to generate #include statements we have to edit two of the code generation templates: “Import” and “Import Section”.

 

To edit the templates go to the “Settings / Code Generation Templates…”, menu and you should see a list of the templates on the left-hand side of the screen.

 

Change the “Import” template so that it looks like this:

And then change the “Import Section” template so that it looks like this:

Now when you generate C++ code from your modle #include statements should be inserted to satisify dependency relationships.

 

Thanks to this article for the instructions (in German!).

 

Machine Vision on the Raspberry Pi anybody?

Here’s is a blog post that has some pictures of the (hopefully) soon to arrive camera for the Pi.

 

http://www.raspberrypi.org/archives/3224

 

It will be interesting to see what cone be done from a machine vision or computer vision point of view with the Pi once cameras are available.