Toothpicks
1. Moisten thoroughly in mouth.
2. Insert pointed end between teeth with flat side next to gums as shown.
3. Use gentle in-and-out motion to clean between teeth. Do not force into tight spaces between teeth.
It is official. The world has gone insane.
Lua
So, I went ahead and tried out working with Lua. For those of you unfamiliar with it, Lua is a lightweight scripting language which is usually embedded in other applications – for instance, a whole lot of games use Lua for various purposes (configuration scripts, AI, and so on). The whole package is pretty small (the static library is actually less than 200 kilobytes, and that includes the standard libraries!) and it performs extremely well.
A couple of years ago I used Lua quite a bit (only writing Lua scripts, not applications that employ Lua). Back then I used to know it pretty well, but that was years ago. Not using the knowledge for so long combined with updates to the language make it necessary to re-learn a lot of things. But fortunately, Lua is actually a very simple language, it doesn’t come with tons of things we don’t need, the syntax is easy, and it has a couple of nice features.
One thing I love about Lua is the ability for functions to return more than 1 value. In pretty much any other language, a function can only ever return a single value, but often we want to return more data than that. In C/C++ the “obvious” workaround is to use additional function arguments, which will be pointers to the location where the result data is written to. Lua, on the other hand, does allow functions to return more than one value.
So instead of a complex function call with lots of arguments where you’re not really sure if they actually affect the behaviour of the function or if they are used to pass a result back, we can do this in Lua:
result1, result2, result3 = somefunction( argument1, argument2, argument3 )
Getting the basics of Lua working on your system isn’t that hard. It is downloaded in source form from the website, and needs to be built into a library (which you’ll also use if you write any applications that use Lua), the Lua interpreter (lua.exe), and the Lua compiler (luac.exe), which pre-compiles Lua scripts into bytecode (optional but does increase performance a bit). On Linux this is of course an extremely trivial task (tar xzvf lua-5.1.4.tar.gz, cd lua-5.1.4, make, make install), on Windows it’s a bit more work but still easy enough.
Then comes writing a little test application that calls an external Lua script, followed by making said test application a bit more complicated (by setting variables, adding functions, calling functions inside the Lua script, and things like that). To the untrained eye a C/C++ program that embeds Lua may seem complicated, but it’s really not that bad: Lua uses a stack for most of its work, and once you see how it works, it’s actually quite easy to work with. A lot of the work you do is just pushing or popping values to/from the stack.
I wonder how easy (or difficult) it will be to make Lua run from an embedded CPU.
Wiki
I set up a private wiki for myself last night
The thing is, I tend to gather a lot of random notes and things in text files. Also, I have an astonishing and ever-growing amount of bookmarks, which I usually have either on my PC but not on my laptop, or the other way around (and of course, I always need them while I’m using the computer that doesn’t have them).
Because that is rather inconvenient, and because I generally hate having lots of random text files and garbage around on my desktop, I decided to set up a wiki for myself, where I can dump all those random notes and little things. Any important bookmarks also get copied to the wiki. This way I can access them wherever I am, and keep my PC clean at the same time. Yay!
I can probably set up a little script to import bookmarks from the wiki into Firefox and run that on both my PC and laptop, that would be the ultimate awesome
