C Coding Style Guide

Coding standards are by far one of the most over looked and unthought aspects of writing good code. It falls into a selection of material, which I find myself being increasingly more opinionated about. Unfortunately many people don’t see the importance of a strict style guide, or following best practices, and this generally leaves you high and dry with a clump of unmaintainable code.

Continue reading

A few have to have libraries

This is a very incomplete list of libraries that you have to know about. Most of these have been discovered and used during my M.Sc or private projects. I have contributed and written some of them and the others are just libraries that I like.

Maths and Optimisation:

  • Eigen – This is by far the best Matrix and Vector toolkit on the face of the planet. It is entirely implemented in C++ templates which means there are zero issues compiling on any platform. It also has SIMD optimisations for both X86 and ARM NEON platforms. Eigen is used in some big projects and has all the main factorisation algorithms built in.

Continue reading

Using Eigen Quaternions and Ceres Solver

So recently I found myself needing to use Google’s Ceres Solver to perform a non-linear batch optimization for my masters.  This should have been easy as Ceres makes implementing this sort of thing rather trivial. I took a look at their “Simple bundle adjustment” code and soon realized that my Eigen Quaternions and the Ceres Quaternions are in a different order.

Eigen uses the correct initialization order [w, x, y, z] however in memory it stores Quaternions as [x, y, z, w]. Thus you cannot use the Ceres QuaternionLocalParameterization to ensure the optimization generates normalized quaternions. Furthermore, you cannot use any of the Ceres rotation functions to transform the world points into the camera frame. So after some investigation and some help from the awesome guys on the Ceres Solver Google group I finally got it all working. I implemented a LocalParameterization to handle Eigen Quaternions and with some help I managed to use the Eigen based rotations with Ceres Jet objects.

Continue reading

The Wonderful World of Redis

Since the day I began developing web applications I have always been a huge fan of MySQL. Maybe because SQL was drilled into us at school and varsity, or maybe because of some underlying fear of the unknown. But recently I took on a project that requires huge scalability and concurrency (I’m talking about thousands of requests a second from hundreds of threads), for this my beloved MySQL would just not hold up without making the connection pool massive. So after some hesitation I took a look at Redis.

Continue reading

Fixing Library not loaded: libsqlite3.0.8.6.dylib Error in Rails

After updating to OSX 10.9 and switching over to zsh I started experiencing problems with my Rails install. I started receiving the following error every time I ran “rails s -p 12345”:

vendor/bundle/gems/sqlite3-1.3.8/lib/sqlite3.rb:6:in `require': dlopen(vendor/bundle/gems/sqlite3-1.3.8/
lib/sqlite3/sqlite3_native.bundle, 9): Library not loaded: /usr/local/lib/libsqlite3.0.8.6.dylib (LoadError)

Continue reading

My Finds in the World of Pen-testing

So recently I found a number of flaws in a few websites, which I promptly informed the web admins of. Nothing major just a few XSS holes that needed to be closed to prevent persistant XSS. Since then I have been playing around on the site (with said web admins permission) to see what else I can discover. My finds have been glorious, educational and horrifying all in one. Continue reading

© 2019 Lloyd Hughes

Theme by Anders NorenUp ↑