Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace WhyFight
{
class Program
{