I’m writing some stuff involving various map tile servers out on the internet, which are internet-slow at responding. To avoid cluttering up all my other code with asynchronous junk, I’ve implemented Futures in C#, like so: namespace IjwFramework.Types { public class Future<T> { Func<T> f; IAsyncResult async; T value; bool hasValue = false; public Future(Func<T> [...]
Content
File: Code
When I’m not writing something hardcore in C, I’m building tools to support it in C#. That C# is getting increasingly functional and rapidly less imperative, partly because the language is heading slowly in that direction, but mostly because I think they code is much clearer than handrolled loops and mutations and whatever I used [...]
So I’m reading Bartosz Milewski’s latest on extending the D type system to eliminate common causes of errors in multithreaded code, and I come across this fragment: There are two major challenges in multithreaded programming: Avoiding races Preventing deadlocks While his analysis is correct, from a program-correctness point of view, and he does offer reasonably [...]
So, I’m switching toolchains for my embedded system, because the one I had chosen previously doesnt do floating-point quite right. Don’t ask – you don’t want to know the gory details. Anyway, I now have a bunch of libs I want to rebuild for the new libc. They’re built via the normal UNIX incantation: ./configure; [...]
Oh, apparently I fail today. Having used select() extensively under Windows, where it is only useful for sockets, I thought this would be a great way to try multiplexing serial interfaces (/dev/tty*) in my embedded Linux box. The problem: select() never signaled readability for a file descriptor which I knew was readable. The non-solution: screwing [...]
Software systems are getting bigger, but not really better. Instead, our advances in tooling are absorbed by pushing further out the point where we throw our arms up and say: "This thing is too big, it sucks." We’ve got gigabytes of memory, and more gigabytes of disk, so we don’t have to worry about running [...]
You know who I mean – the guy who contributes negatively to your project. Here’s some tips for being that guy, largely courtesy of our "favorite programmer’s" fine example (name suppressed to protect the guilty):
This is the fifth part of an ongoing series on building Mock Object support for C++ by exploiting knowledge of the ABI. Last time, we looked at how to recover argument and return types from the function signature, via a pile of templates.
As with many new-ish machines, my current laptop has a USB webcam built into the lid. I know what normal people do with that kind of thing – it involves either an IM client, or an upload to YouTube. These things don’t really seem too exciting. Video calling still sucks, since my uplink isn’t quite [...]
This is the fourth installment in an ongoing series on building support for mock objects in C++. If you’d rather just use the features, grab a tested library for Visual Studio 2005/2008 here. Last time, we looked at how the expectation system hangs together, and I finished off by saying that we would recover function [...]