Archive for the Category » For Fun «

Sunday, November 16th, 2008 | Author:

Well, it’s about time for there to be another Lulz of the Day! Today we’ll be lulzing about Ark, my IRC anti-floodbot script. As an IRCop on a network, I am constantly figthing floodbots who join, /msg everyone on the network some spam and then disconnect. I figured that there must be a way to stop them, and so I diligently started working on Ark. Ark is a perlscript that connects to an IRC server as an IRCop and joins the most popular channels (which you specify). It then waits quietly, bidding its time until it gets /msg’d. Once it receives a message, it springs into action, checking the received message against a list of regexs. If any of them match, it will /kill the bot and resume its slumber.

This very simple, yet oddly helpful script can be downloaded from my code site

Peace and chow,

Ranok

Category: For Fun, IRC, Projects, Random, Technical  | Tags: , ,  | 2 Comments
Friday, November 14th, 2008 | Author:

While cleaning up my hard drive, I’ve come across many old projects that are pretty interesting, and I thought I’d start a mini-series of these little pearls (perls?) I come across as I find them. Without further ado, lets start with our first Lulz of the Day (LOTD)!

Cesspool

As many of you know, I’m in the systems biology class this semester, and recently we spent a week or so looking at the genetic algorithm and its applications. I immediately began hacking on a genetic algorithm to ‘breed’ a Corewars warrior. The code for this is pretty simple, and still needs much revision, but it’s bred some programs that are pretty good. I’m going to run it a few times and try to put together some statistics in the next few days, but for now, you can download the source and play around with it as you wish. Basically what it does is:

  1. Generates some initial warriors with random commands and arguments
  2. Pits the warriors against themselves in battle using the corewars-cmd command
  3. Ranks them by their scores
  4. Cross breeds the best 20% of the population, and mutate the rest (with 5% chance of mutation)
  5. Repeat from step 2 for the number of generations.

Todo:

  • Modify the cross-breeding algorithm so it doesn’t just append one program to the other, but mixes up the commands of both
  • Small bug fixes with the scraper for the corewars-cmd results
  • Run a number of times, and then pit the best generated warriors against some made by humans

Peace and lulz,

Ranok

Category: For Fun, Projects, Random, Technical  | Tags: , ,  | 2 Comments
Monday, November 03rd, 2008 | Author:

While I have many interests from computers to canoing, to philosophy and reading, one thing that I love across the board is music. I’ve been keeping track of my musical tastes for a while using Last.fm, and I’m very fascinated by how my tastes have matured and shifted, and how music I couldn’t stand before I now embrace. In high school, I was very into pretty mainstream hard rock and metal, bands like Godsmack, Killswitch Engage and Lamb of God. While I still enjoy them from time to time, I have found myself growing tired of the genre as while each song is a very multidimensional sonic journey, the variations between individual songs and albums are slight and rather lacking. I was then shown Porcupine Tree by my friend Jon Rossi. I immediately feel in love with the difference between each song, and between the different albums, I could listen to album after album without growing weary of it. Using Last.fm to branch out from Porcupine Tree, I found Blackfield, Sigur Ros, rediscovered Alan Parsons Project, Marillion and Pink Floyd. Still, I was looking for something more off the wall and varying, looking into The Prize Fighter Inferno and moving my way into electronic music. Today however, I think I have hit the nail on the head, finding a whole genre of off-beat, strange yet oddly musical delights: avant-progressive rock, with bands like Kayo Dot and The Mars Volta. From there, Max pointed me at Sound Tribe Sector 9 and I found Tstewart, an electronic post-jazz musician. So I have many new artists to listen to (thanks Amazon MP3 download) and more places to search.

It should be said that even as my tastes have evolved, I still really enjoy hardcore trance ala Clubland X-Treme and other hardcore eurotrance.

Peace and chow,

Ranok

Category: For Fun, Personal, Random  | Tags:  | Leave a Comment
Tuesday, October 28th, 2008 | Author:

For the past few days, I have been slaving away working on my latest creation: FANG, a programming language that I’m hoping will combine some of the best features I’ve found in my studies and remove some of the cruft. It will have scheme/lisp like syntax and Erlang like processes, and some other neat features from other languages I’ve come across. After this weekend, I have a rough start which supports variables, lambda functions, and auto-memoizing clean functions. You can download the source from SVN (username = password = anonymous) and check it out. Please feel free to comment with features to add, or things to change.

Features I want FANG to have:

  • Clean scheme/lisp syntax and macros
  • Lightweight processes and multi-node support
  • Arbitrary precision number support
  • Process jailing and permission setting
  • Simple networking and file I/O
  • Others I’m sure I forgot…

Code Examples:

  • (defvar ‘fib (lambda ‘(n) ‘(if (< n 3) (1) (+ (fib (- n 1)) (fib (- n 2)))))) – A plain recursive function that automatically will get memoized, so it’s rather speedy (use dirty-lambda to turn off the memoization)
  • (defvar ‘max (lambda ‘(a b) ‘(if (> a b) (a) (b)))) – A simple max function used in findset
  • (defvar ‘findset (lambda ‘(l) ‘(if (== (length l) 0) 0 (if (== 1 (length l)) (hd l) (max (+ (hd l) (if (== 2 (length l))) 0 (findset (tl (tl l)))) (findset (tl l))))))) – A function for a homework assignment to find the highest weighted independent set in a path
  • (defvar ‘fact (lambda ‘(n) ‘(if (== 0 n) (1) (* n (fact (- n 1)))))) – A memoized factorial function

Peace and chow,

Ranok

Sunday, October 26th, 2008 | Author:

While walking back from COSI today, I came up with a sweet idea for my website, make it a Xterm window that can display information about me and my projects. I was debating about whether to make it an interactive shell that lets users navigate around my site with their keyboard (and bash knowledge) but figured it would be too difficult for non-*NIX users. I instead decided to make it more point and click. Using some JavaScript and a few hours of my Sunday, I put together my new design and I’m quite proud of it. Please check out the old version and the new version and let me know what you think!

Peace and chow,

Ranok