Tuesday, December 27, 2011

Every time I think of some cool futuristic machine application, I'm reminded of how pointless it would be if we can't link up our consciousness and biology to the machines. So troublesome.

Friday, December 9, 2011

How to make an MMORPG

Stop reading this post. If you came here to find a formula to produce the game of your dreams, then you can quit right here. As a matter of fact, you can quit reading all such articles on how to make game X. They won't get you where you want to go.

Every howto you read was written by someone who did not need a howto. If they had used one, there wouldn't have been a need to write one in the first place. They gained the knowledge they needed to do what they do by other  means and most probably have a deeper knowledge of their subject because of that.

And honestly, we have enough MMOs. Like, way too many.

Saturday, October 29, 2011

Solving Substitution Ciphers

For the past couple of days I've been trying to come up with a good method for solving substitution ciphers algorithmically and without a human moderator. The results were pretty terrible. However, while looking for a solution to my problem, I discovered this little gem:

http://25yearsofprogramming.com/fun/ciphers.htm

It's a tool for decoding a simple substitution cipher that allows you to test out substitutions while fixing certain other substitutions that you believe are correct. Essentially, it attacks the problem by asking, "How can I make it easier for a human to get the answer?" So it's really a tool for visualizing or reflecting on the thought process that people typically go through when they attempt to solve these ciphers. The result is, I think, much faster than a purely computational solution could be, and in any case, is much easier to code.

Sunday, September 11, 2011

PulseAudio + XMMS2

So you've been using XMMS2 for a little while and seen how frigging awesome it is, but now you want more. You want to access your XMMS2 library anywhere you take your laptop. So where do you start?

XMMS2

First off, disable the firewall on your host machine if you have one. Unless you are working a very hostile network environment, this will make things a lot easier until everything is working. After you've done that you have just one setting to change in xmms2. On the terminal, type

xmms2 server config core.ipcsocket "unix:///tmp/xmms-ipc-$USER;tcp://:9667"

assuming you still want to run clients on your host machine. On your client machine, run

XMMS_PATH=tcp://<server-hostname>:9667 xmms2 list

you should get the playlist of songs on your server. If everything checks out you can set your XMMS_PATH for your login shell. Add

export XMMS_PATH=tcp://<server-hostname>:9667

to whichever startup script your shell uses. At this point you should be able to control xmms2 remotely from your laptop. Next we'll set pulseaudio to push the music to your laptop.

PulseAudio

To listen to your music on your laptop, you have to make the sound card on your laptop visible to the network. If you haven't yet, install paprefs on both your host machine and all clients. When you run paprefs, there should be four tabs; we'll only concern ourselves with the first two.

On your host, switch to the "Network Access" tab and toggle the first item. Now on each client, open the "Network Server" tab and check the first three boxes. These settings will load zeroconf modules and tell pulse to tunnel audio from your host to remote sound devices. Run pavucontrol on your host. Here's where you enable your networked audio devices to receive from your host. Find the xmms2 stream and select your remote machine from the drop-down.

That's it. You should be able to hear your music and control xmms2 remotely. Enjoy.

This guide shows how I got my setup the way I wanted, but it definitely isn't the only way. For instance, instead of using the native xmms2 protocol, you could just use ssh, and there are at least ten viable audio streaming options. If you have problems with this guide or want to share your setup, leave a comment or shoot me an email. Thanks for reading!