Tag: code

| tags: asm code eso golf

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.

more...

| tags: code eso

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).

more...

| tags: asm code

Have you ever wondered how Intel comes up with such high-quality mnemonics as VPBROADCASTMB2Q, 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.

more...

| tags: code xmonad

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.)

| tags: code web

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. Both are drawn on a HTML5 canvas with some JavaScript. If you would like to see a particular logo, try adding ?logo=N, where N is either a non-negative integer or the logo name (shown in the bottom-right corner), to the URL.

more...

| 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.

more...

| tags: code

More examples of gcolor results.

more...

| tags: code

Have you ever wanted to know the color of magic? Or the color of absolutely anything? Let 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.

more...

| tags: code game

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: code eso

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.

| tags: code eso

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.)

| tags: code web

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. GitHub repository.

| tags: asm code

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.)

more...

| tags: asm code game

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.

| tags: code eso

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.

| tags: code game

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.

more...

| tags: code sec

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.

Document here.