Reading List

The Selfish Gene
The Psychopath Test: A Journey Through the Madness Industry
Bad Science
The Feynman Lectures on Physics
The Theory of Everything: The Origin and Fate of the Universe


ifknot's favorite books »
Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts

Saturday, 27 August 2016

Fontastic! Meaningful programming ligatures with FiraCode

Fira Code: monospaced font with programming ligatures


Fira Code is an extension of the Fira Mono font containing a set of ligatures for common programming multi-character combinations. It is easy to install in OS X and works with Qt Creator.

I think I like it :)



Wednesday, 3 September 2014

C++11 Variadic template factory member function fun! Building a FBP directed graph class.

Better by variadic design?


TL;DR The libfbp library needs a directed graph container for the ensemble of communicating components that makes FBP programming as easy and error free as possible. Achieving these goals by giving the directed graph class the responsibilities for creation, storage, lifetime and execution of its components and connections poses the challenge of how to implement generic factory methods that allow the creation of a zoo of unknowable components and connections?  C++11/14 variadic template metaprogramming to the rescue!

Sunday, 24 August 2014

A simplified libfbp component and a general purpose work-stealing, back-off threadpool to get things going.

Sucked into a general purpose threadpool!


TL;DR To paraphrase Thoreau "Decouple, decouple, decouple!" the clumsy component that needed to take a dequeuer is simplified to a virtual interface PPM API facilitating generalisation for PXMs. There's also a threadpool PXM so that FBP can run out of the box.

As previously stated the primary strategic goal here is that the libfbp implementation of Flow-Based Programming (FBP) as a Parallel Programming Model (PPM), though the FBP paradigm is a lot more more than simply a PPM, should be agnostic to its underlying Program eXecution Model (PXM) but must, never-the-less, provide an Application Programming Interface (API) that remains versatile in its implementation. 

In an effort to achieve this goal the original component here was overly complex and took on too much of the scheduling burden the simplified component presents a single virtual operator()() member function that returns a component*. The API contract is simple, the returned component* points to the next component to be executed and a returned value of null_ptr removes the component from the execution pipeline.

Monday, 4 August 2014

Template Metaprogramming is cool! Using C++11 template overloading to make sense of queue behaviour.

Metaprogramming putting meat on the bones.


TL;DR Using an enumerated type as a behaviour selector at compile time by using template overloading[1] to select either total or partial queue access[2] behaviour whilst maintaining the same queue ADT interface 

The libfbp design goal is for a uniform queue interface as per the prescribed Abstract Data Type definition here using only enqueue and dequeue access class functions instead of having separate class function method calls for either partial or total access behaviour i.e. to get rid of try_enqueue and try_dequeue.

Friday, 1 August 2014

Stuff about C++11 that I like... #2 Delegating Constructors

Delegating constructors is cool.

TL;DR With C++11 you can kiss goodbye to some 'init' method function shared between constructors or copying and pasting between your constructors.

Saturday, 10 May 2014

A CSP approach to FBP Information Packets

What exactly are we delivering here?


TL;DR Don't look now the CSP event is the FBP IP, the FBP IP is the std::unique_ptr.

The real world has put a significant crimp on my programming of late but I have had plenty of time to think about things, so this post is rather theory heavy and code light.

The axiomatic processes of CSP Theory have been implemented as FBP Components here, here and here; but what of the FBP Information Packet (IP) - does it have a CSP equivalent?

Sunday, 13 April 2014

Stuff about C++11 that I like... #1 Inherited Constructors

Inherited constructors make life easy.


Depending on your mood the (counter)intuitive scope behaviour of class members such that ordinary scope rules apply to class members. In particular, a member of a base class is not in the same scope as a member of a derived class.[1]

Wednesday, 5 March 2014

Part (2/3): A general purpose thread-safe internally synchronized message queue.

When it's time to end the relationship.

So here is the code for the single lock general purpose message queue as the obviously correct base queue type, but with one important addition...

The ability to close() the message queue.

But why?

TL;DR github.com/ifknot/libfbp

Saturday, 18 January 2014

Shooting from the hip... (1)

Worried about your C++ programming style and contemporary idioms? Not sure which patterns are in and which are on their way out? Concerned about software craftsmanship? Thinking of attending a coding dojo? Dithering about being an incrementalist or a completionist?

TL;DR Herb Sutter(2011) Elements of Modern C++ Style

I am, at best, an average programmer - I know this because I have been exposed to great programmers and do you know what? They're always humble and they're always learning.

However, that doesn't stop me from being mouthy and opinionated.

So, in my mind there are 2 kinds of C++ programmers: