This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading; | |
| namespace WhyFight | |
| { | |
| class Program | |
| { |
| <?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> |
| #ifdef GL_ES | |
| precision highp float; | |
| #endif | |
| uniform float time; | |
| uniform vec2 resolution; | |
| uniform vec4 mouse; | |
| uniform sampler2D tex0; | |
| uniform sampler2D tex1; |
| /* | |
| ** 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> |
| #!/usr/local/bin/python3.2 | |
| #Exercise 2.2 | |
| name = input("Write your name: ") | |
| print("Hello", name, "!") |
| #!/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 |
| #!/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 |
| #!/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. |
| // 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 |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer