Skip to content
Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Amaze your friends, and confound your enemies!

elbeno, 4 November, 20154 November, 2015

When I was young, I read lots of books with titles (or at least subheadings) along the lines of, “Amaze Your Friends and Confound Your Enemies” – a lot of them were filled with tricks and oddities like the Birthday Paradox, or the old saw about the elephant from Denmark….

Compile-time RNG tricks

elbeno, 15 October, 201518 October, 2015

(Start at the beginning of the series – and all the source can be found in my github repo) Compile-time random number generation is quite useful. For instance, we could generate GUIDs (version 4 UUIDs): namespace cx { struct guid_t { uint32_t data1; uint16_t data2; uint16_t data3; uint64_t data4; };…

Compile-time counters, revisited

elbeno, 14 October, 201515 October, 2015

(Start at the beginning of the series – and all the source can be found in my github repo) Some time ago I read a blog post showing how to make a compile-time counter: a constexpr function that would return monotonically increasing integers. When I first read it I didn’t…

More string hashing with C++11 constexpr

elbeno, 14 October, 201515 October, 2015

(Start at the beginning of the series – and all the source can be found in my github repo) So FNV1 was easy, and Murmur3 wasn’t too much harder; for a challenge and to see how far I could go, I decided to try to compute an MD5 string hash…

C++11 compile-time string hashing

elbeno, 13 October, 201515 October, 2015

(Start at the beginning of the series – and all the source can be found in my github repo) Now that I was used to writing C++11-style constexpr, I decided to try some compile-time string hashing. It turns out that FNV1 is very easy to express in a move-down-the-string recursive…

More constexpr floating-point computation

elbeno, 13 October, 201515 October, 2015

(Start at the beginning of the series – and all the source can be found in my github repo) In the last post, I covered my first forays into writing C++11-style constexpr floating point math functions. Once I’d done some trig functions, exp, and floor and friends, it seemed like…

Floating-point maths, constexpr style

elbeno, 13 October, 201515 October, 2015

(Start at the beginning of the series – and all the source can be found in my github repo) To ease into constexpr programming I decided to tackle some floating-point maths functions. Disclaimer: I’m not a mathematician and this code has not been rigorously tested for numeric stability or convergence…

Experimenting with constexpr

elbeno, 13 October, 201515 October, 2015

Since seeing Scott Schurr at C++Now in Aspen and hearing his talks about constexpr, it’s been on my list of things to try out, and recently I got around to it. With the release of Visual Studio 2015, Microsoft’s compiler now finally supports C++11 style constexpr (modulo some minor issues),…

CppCon 2015

elbeno, 27 September, 201527 September, 2015

CppCon 2015 is over and I’m home from Bellevue. It was a really great week; I learned a lot, talked to lots of interesting folks, and traded C++ tips and techniques with the cognoscenti. Having been to C++Now, I knew a bunch of people already, which was a good leg-up…

Exercising Ranges (part 8)

elbeno, 1 July, 20152 July, 2015

(Start at the beginning of the series if you want more context.) Extras from the Haskell Prelude Having implemented iterate, there were a couple of other useful things from the Haskell Prelude that I wanted to have available with ranges. First, there’s cycle. It simply takes a finite range and…

  • Previous
  • 1
  • …
  • 3
  • 4
  • 5
  • …
  • 68
  • Next
©2026 Why is a raven like a writing desk? | WordPress Theme by SuperbThemes