.NET's MemoryStream is a very convenient class. It allows you to use a byte[] array as storage, while accessing it via standard Stream API. Among other things, it allows you to work with a section of a larger byte array, which is very handy when different actions need to be taken for different slices.
Unfortunately, when it comes to access the raw buffer stored in a MemoryStream instance, there is …
more »
I use Ubuntu (a modern Linux distribution) as my main work station. Everything worked fine until I upgraded from version 14.10 to 15.04 of the OS. At this point strange things started to happen. After working for an hour or two my environment would freeze and stop responding altogether. Neither Ctrl-Alt-Del nor Ctrl-Alt-Backspace would produce any reaction. I couldn't connect to the machine remotely as well. Only hard reset would …
more »
Not an uncommon task in multithreaded programming - what if you want to terminate a background thread, which is blocked at the moment, and then to make sure it has actually exited. In .NET, you can do the following:
more »