Lately, I've been
wasting spending time doing code golf at the (very informal) Anarchy Golf server.
I don't claim to be any sort of expert on the topic, but here are some recent entries I've made, explained.
For those not
in the know, the goal in code golf is to write the shortest possible program in language X that accomplishes a task Y.
The golf server has a set of test inputs, and your program needs to produce output matching the corresponding reference outputs in order to be accepted.
I was recently talked into taking on the role of the negligent MediaWiki administrator for the esoteric programming languages wiki. As a consequence, I have now a local copy of the XML dump of the wiki contents (that anyone can download). To celebrate Easter in the traditional manner, then, I've spent some time computing statistics of the link graph of the wiki.
Recently, there was some idle discussion on #esoteric on the topic of reserved identifiers in C and POSIX. The discussion further progressed to a thought experiment on whether it would be possible to write useful programs in C if the standard (or POSIX) reserved all identifiers, i.e., using only identifiers defined by the standard, in a legal manner.
The following program is a rudimentary brainfuck (sans input) interpreter that is at least mostly valid C, yet uses no user-defined identifiers (after preprocessing).
This is a gamified extension of the x86 opcode mnemonic generator. Playing should, hopefully, be self-explanatory.
| tags: photo
As a sequel to part 1, let's look at more... alternative ways of rendering a composite image.
Have you ever wondered how Intel comes up with such high-quality mnemonics as
VPCLMULHQLQDQ, and many more besides?
Well, wonder no more!
Here is an entirely automatic generator for you to make as many new opcodes as you please.
| tags: photo
Continuing on the fringes of photography, here are some initial results from an experiment involving long-term time-lapse photos.
To summarize, I've taken (with a phone) a picture of the Aalto University main building, from two different angles, (almost) every morning when arriving at work. So far, there are approximately 28 pictures from both angles, from 2014-02-11 to 2014-03-25. I'm still collecting more, and thinking about how to post-process the images, but here are some quick blends.
Quite some time ago (late 2011) I got sufficiently bored to poke and prod the firmware of a ZTE ZXDSL 931WIIA brand VDSL2 device, primarily to find out if it had a usable telnet interface and/or a convenient way to run arbitrary code. I always meant to write up a description of what was hiding under this particular rock, but never got around to. Well, here we (belatedly) are.
Most things in the following are likely to be — more or less — particular to the exact model and firmware version (
ZXDSL931WIIA_ElisaV2.8.2a_Z40_FI) I have.
The model is probably discontinued by now, but perhaps the illustrated principles may be helpful for someone.
If you still have one, don't try any of this at home if you're very attached to the device.
Finally, the approach taken is a very "manual" one (GNU binutils, dd, etc.), and more intelligent tools could well make it simpler.
tl;dr? There is a telnet interface (in this version), with hardcoded ZTE "debugging" username:password pairs, allowing for full root shell access.
| tags: photo
Not really a sequel of Adventures in Macroland, Part 1 but... here's a macroSD card. (In other words, just got an IR remote for the camera, for shake-free shutter, and was itching to test it out.)
| tags: photo
Having recently come into possession of a DSLR, and with the weather being like this (i.e., wet), I've been thinking up what kind of photos I could take, at home, that I couldn't have taken with the old non-interchangeable lens camera. One such category is macrophotography with a reversed lens mounted in front of a regular one.
| tags: web
After a long time of sporadic idle thinking about it, it is finally time to reorganize this spectacular web presence. The previous hierachical organization of stuff was p. arbitrary, and anyway there's not that much content in here, so I've chosen to go with a chronological ordering combined with a flat set of tags. Since the end result bears some facial similarity to (sigh) "a blog", and I can't think of a better word, I'll call it that. Just don't let that lead you to expect regular (or irregular) updates more than, say, once a year.
Regarding the existing content, I've shamelessly mangled them into "blog posts", complete with faked-in approximate dates of creation (or last update). This is certainly not a cheap attempt to make it look like I'd've been keeping a blog for a while now.
My personal XMonad configuration is in a GitHub repo. Might be useful if you want an example where a dzen2 bar is controlled over DBus.
(Disclaimer: not the cleanest Haskell code out there.)
The idea of having the biographical stuff (i.e. my own face) be the very first thing on the site felt somehow banal.
I was therefore forced to put in a usability-decreasing
splash page sort of thing instead.
The logo is randomly chosen out of N more or less different L-systems and IFS fractals.
If you would like to see a particular logo, try adding
N is either a non-negative integer or the logo name (shown in the bottom-right corner), to the URL.
| tags: code
fcolor is an in-browser edition of gcolor, which is, and I quote,
scientific™ method for converting an arbitrary string to a color.
See the gcolor post for technical details: the only difference is the source of the images, which in this case is Flickr.
| tags: code
More examples of gcolor results.
| tags: code
Have you ever wanted to know the color of magic?
Or the color of absolutely anything?
gcolor figure it out for you.
gcolor is a scientific™ method for converting an arbitrary string to a color.
Handy both for getting definitions of
real colors, as well as determining the colors of abstract concepts.
The basic idea is to leverage crowdsourced synergies by searching for the given text in Google Image Search, then compute an
average color out of all the returned thumbnail images.
mcmap is a Minecraft automap that works by proxying the connection between the Minecraft client and server, and extracting the world information from the traffic.
I wrote the initial version in late 2010; other people have worked on it, too.
Caveat: it might not always be very speedily updated to be compatible with the latest Minecraft versions.
mcmap has a GitHub repository.
| tags: eso
I've written a pair of "Square Root of Minus Garfield" strips:
Continuing on the topic of esolangs, I'm responsible of a set of BF Joust implementations. You can find them and their documentation at a GitHub repository.
Speaking of Befunge, I have also written a somewhat speedy interpreter for the older, more limited Befunge-93 variant of it.
It is called
ff, and it is but a single file of C: ff3.c. (The 3 is a version number of sorts.)
zpaste is a simple, single-user (or not-too-many-user) pastebin/tinyurl hybrid, in case you want something a bit more tweakable than the myriad of web services around.
You know how, when you link an ELF executable dynamically, all the names of the dynamically linked symbols end up being included in the executable? That's, like, several bytes — maybe even dozens — of bloat. (And there's no Windows DLL style import-by-ordinal functionality.) Turns out, however, that it's possible to refer to the symbols by their hash values instead. That's a fixed cost of four bytes per symbol, compared to 8 (symbol table entry) + strlen(name) + 1 for regular dynamic linking. (Of course there's also some amount of bytes wasted in the stub that does the hash resolving.)
robotfindskitten is a
Zen simulation that has been ported to incredibly many sorts of systems.
In it, you assume control of a robot, looking for kitten amongst many non-kitten items (NKI).
rfk86 is a port of it to the TI-86 graphing calculator.
It has its very own website.
There is an interesting
2D programming language called Befunge.
fungot is an IRC bot written in the Funge-98 version of the language.
As far as I am aware, it's one of the largest
hand-written Funge-98 programs there are.
Features of fungot include interpreters for the brainfuck and Underload languages, support for user-defined commands in the above-mentioned languages, as well as an ngram-based babble generator with various styles.
Most of the time you can find fungot on the channel
#esoteric in the freenode IRC network.
It also has a periodically active Twitter account.
The main source file is fungot.b98. The GitHub repository there also contains some other files necessary for running it.
| tags: code
Let me just quote from the README:
This is a GTK+ program to use the input devices (keyboard, mouse) of one computer as the input devices of a remote computer, via VNC. Think of it as a sort of a DIY "Synergy". The main benefit, compared to an actual VNC client, is significantly improved latency in some cases, as it never actually requests the screen contents from the remote computer.
Find it by cloning/downloading gist 2017454.
Here's a rather old (and probably outdated) look at how one could simulate digital logic circuits with OpenTTD. Includes the fastest four-bit ripple-carry adder ever: takes about two months (of in-game time) for the carry information to propagate.
From the 2005s, an outdated nano-HOWTO on how to build a port knocking system to reduce the amount of SSH password guessing attempts, with simple iptables rules and no extra daemons.