Download the source code for this example here
Built in 2D arrays have the problem that they don't work with the standard library. Writing a normal class to represent a 2D array has the problem that you cannot use the built in style of operator, operator.
A general approach to solve this issue to ensure that the 2D array class operator returns a class that also overloads operator, and hence can be used to access the underlying data. To solve the issue of not being able to use the standard library, the class will implement a custom random access iterator. I provide the implementation of this approach below.
Every few months I want to build a state machine circuit, and I always have to think for a few minutes about how to use them, I always forget how to do the excitation table...
So I am going to detail the very simple steps of how to build a very simple sequential logic circuit, hopefully so I can refer back to it again in the future whenever I forget...
To illustrate it I will design a simple up/down counter. The counter works by if we have an input of 0, it counts up, if we have an input of 1 it counts down. Whenever it the counter overflows or underflows we want it to output a 1, otherwise output a zero.
Happy New Year everyone! I was attempting to sleep around 5am last night and found I could not, and hence I was reading up wikipedia on one of my favorite topics, esoteric programming languages. I absolutely love them! They are so... useless. And hence fascinating.
To see the working interpreter, Continue reading
Communicating with the database is one of the most frequent tasks one undertakes when using PHP. As such its important to have a ready to go abstraction layer to automate SQL queries.
I have written a small selection of php methods to abstract and automate this process.