Travis CI

Configuration for C++, Python, R, bash and Graphviz

Note: my use of Travis CI has been superseded by GitLab which has all this built in. In fact this blog is generated by GitLab. Create an account with your GitHub login and enable a repo to get started. (Travis Pro appears to enable new repos by default.) Simple C++11 compilations If you just want to get something building quickly the default Trusty build has clang 5 pre-installed, no need for complicated matrices. [Read More]

An open letter

To my 20-year-old developer self

Things I’ve learned in 20+ years as a software engineer. You need a work laptop Not only does this give you the option of working from home but in reality your brain doesn’t work 9-to-5. You can make a note of an idea for tomorrow but why not get it done there and then? If your employer gets two weeks of extra work out of you then it’s already paid for itself. [Read More]

Resetting a forgotten Windows password

When you’ve misplaced the password to a local Windows account. Seen to work on Windows 2000, 7 and 10. Prerequisites: a 4GB USB stick and a machine capable of creating a USB boot disk (Ubuntu is good). Time to complete: half an hour to download Kali and create the stick and a few minutes to reset a password. Download the latest Kali Linux ISO and create a USB boot disk on another machine. [Read More]

Video formats

See formats on encoding.com. Video Encoding Formats Video Codecs DRM Adaptive Bitrate Supported Image Formats Closed Captions Audio Formats Video formats TGA “TGA is still used extensively throughout the animation and video industry because its primary intended outputs are standard TV screens, not color printed pages.” https://en.wikipedia.org/wiki/Truevision_TGA YUV “YUV is a color encoding system typically used as part of a color image pipeline. It encodes a color image or video taking human perception into account, allowing reduced bandwidth for chrominance components, thereby typically enabling transmission errors or compression artefacts to be more efficiently masked by the human perception than using a “direct” RGB-representation. [Read More]

योग

Learning Sanskrit through Yoga

Forward I originally began learning ગુજરાતી (Gujarati) around 2001 as a means to better understand my family heritage. But it has since expanded into an appreciation of other Indic languages and even right-to-left writing systems such as Arabic and Urdu. Whilst ગુજરાતી (Gujarati) came first for me but it wasn’t a huge leap to हिन्दी (Hindi) and संस्कृतम् (Sanskrit). In the first part of the book I will break down selected yoga poses as a “way in” to the language. [Read More]

The magnitude of it all

The units you should be aware of

In 2014 Randall Munroe estimated that Google stores 10 exabytes of data across all of its operations. See list of SI prefixes. If CPUs are topping out at gigahertz then single operations aren’t going to subceed the order of nanoseconds. 1 000 kilo | milli .001 1 000 000 mega | micro .000 001 1 000 000 000 giga | nano .000 000 001 1 000 000 000 000 tera | pico . [Read More]

Databases

SQL “Structured Query Language” SQL - relational NoSQL - non-relational Tables / schema Humongous data, collections, documents, duplication of data Structured Semi/no structure, flexible Relations Less dependence on relations, quick reads Atomic Eventually consistent Monolithic Distributed SQL MySql, Oracle, Sqlite, Postgres, MS-SQL, Amazon Aurora (part of RDS). NoSQL MongoDB, BigTable, Redis, RavenDb, Cassandra, Hbase, Neo4j, CouchDb, Amazon DynamoDB. [Read More]

Exceptions in destructors

In C++11 destructors default to noexcept so you have to go out of your way to make them throw. See throwing a vector in a destructor. #include <exception> #include <iostream> #include <vector> // Note the braces void exception1() try { throw 1; } catch (int e) { std::cout << "Caught " << e << std::endl; } catch (const std::out_of_range &oor) { std::cout << "Caught OOR\n" << oor.what() << std::endl; } catch (const std::exception &e) { std::cout << "Caught " << e. [Read More]

SOLID

Single responsibility principle A class should have only a single responsibility (i.e. changes to only one part of the software’s specification should be able to affect the specification of the class). A class should have only one reason to change. Separate GUI and the business logic. Low coupling, high cohesion. Open/closed principle Software entities should be open for extension, but closed for modification. However, realistically you don’t know which bits need to be extensible. [Read More]

STL containers

http://www.cplusplus.com/reference/stl/ Sequence Containers array vector deque forward_list list Container Adapters stack queue priority_queue Associative Containers set map multiset multimap Unordered Associative Containers unordered_set unordered_multiset unordered_map unordered_multimap Features multiset, set and map are typically implemented as binary search trees. Forward lists are sequence containers that allow constant time insert and erase operations anywhere within the sequence. map is generally slower than unordered_map containers to access individual elements by their key, but it allows the direct iteration on subsets based on their order. [Read More]