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
| data FileSystem = File Name | |
| | Directory Name [FileSystem] | |
| search :: String -> FileSystem -> String | |
| search target (Directory name (x:xs)) = "" |
| ➜ 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 |
| 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> |
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
| // 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 |
| #!/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. |
| #!/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 |