Skip to content

Instantly share code, notes, and snippets.

data FileSystem = File Name
| Directory Name [FileSystem]
search :: String -> FileSystem -> String
search target (Directory name (x:xs)) = ""
@Zolomon
Zolomon / make.txt
Created August 31, 2013 21:14
What's causing this build error?
➜ rust git:(master) make
cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples x86_64-unknown-linux-gnu
cfg: target triples x86_64-unknown-linux-gnu
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: using gcc
cfg: no pandoc found, omitting docs
cfg: no node found, omitting docs
cfg: no llnextgen found, omitting grammar-verification
@Zolomon
Zolomon / composite.rs
Created August 31, 2013 18:33
It works! \o/ Thank you #rust@irc.freenode.net <3
fn main() {
struct GoalExplore {
name: ~str
}
struct GoalRest {
name: ~str
}
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Artemis;
using Microsoft.Xna.Framework;
using Roguelike.components;
namespace Roguelike.utils
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DerivedPropertyDemo
{
class Program
{
#define _BSD_SOURCE /* Get getpass() declaration from <unistd.h> */
#define _XOPEN_SOURCE /* Get crypt() declaration from <unistd.h> */
#include <unistd.h>
#include <limits.h>
#include <pwd.h>
#include <shadow.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
@Zolomon
Zolomon / about.md
Created August 9, 2011 15:29 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@Zolomon
Zolomon / utorrentcontroller.cs
Created July 25, 2011 18:56
µTorrent Controller 1.0a
// Author: Bengt Ericsson, July 2011
//
// This tiny program will move files/dirs to the label you give them in µTorrent v3.2.
// Example: download a torrent and save it with its directory "E:/Torrents/my.example.torrent.dir/",
// specify the label "Misc/cool/stuff" and the my.example.torrent.dir/ will be moved to
// "E:/Torrents/Misc/cool/stuff/my.example.torrent.dir/" when it's finished downloading.
//
// 1) Change the variable "torrentPath" to represent the directory where you store your torrents.
// 2) Get http://www.ntwind.com/software/utilities/hstart.html - this will run the app in a none obtrusive way, skip it if you don't mind the console flashing!
// 3) Get http://commandline.codeplex.com and reference it to your solution
@Zolomon
Zolomon / primefactorization.py
Created July 6, 2011 12:20
Prime Factorization & Divisibility
#!/usr/bin/python3.2
import sys
def gen_primes():
""" Generate an infinite sequence of prime numbers.
"""
# Maps composites to primes witnessing their compositeness.
# This is memory efficient, as the sieve is not "run forward"
# indefinitely, but only as long as required by the current
# number being tested.
@Zolomon
Zolomon / lcm.py
Created July 5, 2011 11:20
Least Common Multiple
#!/usr/local/bin/python3.2
def gcd(a, b):
if a == 0:
return b
while b != 0:
if a > b:
a = a - b
else:
b = b - a