Go GCC vs GC
For awhile now I’ve been playing around with a stack based language written in Go. The specifics of that project aren’t too important here, but I did notice something interesting today as I tried GCC for the first time with the project. First I wanted to make sure it worked so I ran go-5 test and happily all tests passed. Next, I thought I’d see how the benchmark looked. Here I think I was most surprised.
Bootstrapping a Forth in 46 lines of Moonscript code
There’s an article called Boostrapping a Forth in 40 lines of Lua code[sic]1 that’s been around since around 2007. It’s a great article and I’d highly recommend reading it. However, I only recently found it after some interest in Forth.
This is the Forth outer interpreter in Lua from the above article reformatted a bit:
eval = function (str) return assert(loadstring(str))() end subj = "" pos = 1 parsebypattern = function (pat) local capture, newpos = string.
Go UTF-16
This is just a small code fragment that prints out the Unicode characters from the Fullwidth Latin Letters (range 0xFF01-0xFFEF). This works on little & big endian machines (tested with qemu-arm & qemu-mips compiled using gccgo 4.7.) I thought it might have issues with the way it decodes the int32 into a byte array and re-encodes it to a uint16 array.
package main import ( "bytes" "encoding/binary" "fmt" "unicode/utf16" ) func main() { for i := int32(0xFF00); i <= 0xFFEF; i++ { c := new(bytes.
Down but not out
On the 28th of last month (2013/06/28) I lost my subdomain name that I had previously been getting for Dyn for free. For a long time Dyn offered free dynamic DNS. I setup my subdomain with them on their homelinux.org. This was initially needed because the server was being run from my, well, home. This provided a convenient method to automatically update the DNS records when my IP would change. This worked well, and it worked well for a long time.
HGE Go work
I just realized I never actually posted about why I was doing a C binding of C++. Basically I bound most of Haaf’s Game Engine (HGE) from C++ to C. I ended up getting a bit stuck on the GUI elements and getting a nice way to let them do simple inheritance and polymorphism based on the current C++ classes. This actually wasn’t a problem for my end-game which was to take that C binding and make a Go version with cgo.
C Bindings for C++
Lately I’ve been playing around with writing C bindings for a C++ library. Your first thought might be, “Why would you bind a C++ to C?” Those of you who have ever had to do bindings to other languages may already know the answer. In general, it’s much easier to bind C to another language than it is to bind C++ directly. Another, albeit less likely, reason might be because a client wants a C interface instead.
Chipmunk Physics
I’ve been hard at work at my project which I’m yet to call by name on here (and will continue to be that way until I have a playable demo.) First, a status update. I’ve ditched the idea of doing the entire engine myself and have now migrated to HGE (Haaf’s Game Engine) which fairly recently had a port to *nix and OS X by Ryan C. Gordon. I’ve worked a bit on the engine itself after the source release and my changes were pulled in upstream (mostly it adding a CMake build system, but I also did some things like get the tutorial/examples working, silenced warnings, etc.
WordPress Backup Script
After my server was down for a couple days (because I was physically moving the machine to another location) I decided to check if there were any updates. Sure enough, there just happened to be an update for 3.2 and it had the usual warning of “be sure to backup your database and files” which I either ignore or partially ignore. I do typically do a mysqldump before running any of the updates, but I almost never backup the WordPress directory itself.
Spam Detection
I just thought I’d make a quick post about two WordPress plugins which seem to work great for spam detection. The first one is Akismet. Alone it seems to catch most spam here. The problem with this plugin alone is, there may still be false positives. This requires more time on my part to skim over my spam to see if there was any legit comments.
This brings me to the second plugin, Conditional CAPTCHA.