Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace WhyFight
{
class Program
{
@Zolomon
Zolomon / Exempel_På_Level01.xml
Created March 22, 2011 13:57
Hur man använder klassen
<?xml version="1.0" encoding="utf-8" ?>
<XnaContent>
<Asset Type="Breakout.Level">
<LevelIndex>1</LevelIndex>
<Rows>13</Rows>
<Columns>13</Columns>
<NextLevelAsset>Content/Levels/Level02</NextLevelAsset>
<StartLevel>true</StartLevel>
<MaxHits>9</MaxHits>
<Blocks>
@Zolomon
Zolomon / SomeHlsl.fx
Created March 24, 2011 07:50
The rings of Uranus
#ifdef GL_ES
precision highp float;
#endif
uniform float time;
uniform vec2 resolution;
uniform vec4 mouse;
uniform sampler2D tex0;
uniform sampler2D tex1;
@Zolomon
Zolomon / showip.c
Created June 19, 2011 21:13
show IP addresses for a host given on the command line
/*
** showip.c -- show IP addresses for a host given on the command line
*/
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
@Zolomon
Zolomon / ex2_2.py
Created July 3, 2011 11:16
Python exercises Chapter 2
#!/usr/local/bin/python3.2
#Exercise 2.2
name = input("Write your name: ")
print("Hello", name, "!")
@Zolomon
Zolomon / ex4_4.py
Created July 4, 2011 20:57
Python exercises Task 3 (Chapter 3 & 4)
#!/usr/local/bin/python3.2
def computepay(hours, rate):
if hours < 1: raise ValueError("No hours")
if rate < 1.0: raise ValueError("No rate")
if hours > 40:
return (40 * rate) + ((hours - 40) * rate * 1.5)
else:
return hours * rate
@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
@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 / 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 / about.md
Created August 9, 2011 15:29 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer