This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Blueprint where | |
| import Test.SmallCheck | |
| import qualified Test.SmallCheck.Property | |
| import Data.List ( inits ) | |
| fold_balanced :: b -> (b -> b -> b) -> [b] -> b | |
| fold_balanced z f xs = case xs of | |
| [ ] -> z | |
| [x] -> x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ThreadBleh extends Thread { | |
| private boolean areWePlayingNow = false; | |
| public void run() { | |
| while(true) { | |
| if(areWePlayingNow) { | |
| // do something | |
| } else { | |
| // don't do something ;) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Vector | |
| constructor: (p1, p2) -> | |
| console.log "Vector: Warning", p1, p2 unless p1? and p2? | |
| @x = p2.x - p1.x | |
| @y = p2.y - p1.y | |
| @random: (p1 = { x: 0, y: 0}, p2 = { x: window.innerWidth * 0.01, y: window.innerHeight * 0.01}) -> | |
| flippy = (n) -> if Math.random() < 0.5 then -1 else 1 | |
| new Vector p1, { x: flippy(p2.x), y: flippy(p2.y)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package dp; | |
| interface Tree<K> { | |
| int leaves(); | |
| } | |
| class Branch<K> implements Tree<K> { | |
| final Tree<K> left, right; | |
| Branch(Tree<K> left, Tree<K> right) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package jsomp.example.mvc; | |
| /* | |
| * A MVC example not using reflection in the controller. | |
| */ | |
| interface Machine { | |
| String getName(); | |
| void setName(String name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ 0.000000] Initializing cgroup subsys cpuset | |
| [ 0.000000] Initializing cgroup subsys cpu | |
| [ 0.000000] Linux version 3.2.0-rc5+ (lu@papill0n) (gcc version 4.6.2 20111125 (prerelease) (GCC) ) #4 SMP Wed Dec 21 15:30:57 CET 2011 | |
| [ 0.000000] Command line: root=/dev/sda6 ro | |
| [ 0.000000] Disabled fast string operations | |
| [ 0.000000] BIOS-provided physical RAM map: | |
| [ 0.000000] BIOS-e820: 0000000000000000 - 000000000009fc00 (usable) | |
| [ 0.000000] BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved) | |
| [ 0.000000] BIOS-e820: 00000000000e2000 - 0000000000100000 (reserved) | |
| [ 0.000000] BIOS-e820: 0000000000100000 - 000000006ff90000 (usable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /home/lu/t/games/Aquaria | |
| DSQ init | |
| Mipmaps Enabled | |
| DeveloperKeys Disabled | |
| VoiceOvers Enabled | |
| Init Graphics Library... | |
| setting vsync: 1 | |
| Video Driver Name [x11] | |
| virtual(1067, 600) | |
| virtual(1067, 600) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # So, this version is not at all mine, it's one from @samuelkadolph. | |
| # (Just for the record.) | |
| class MyHash < Hash | |
| def initialize(hash = {}) | |
| super() | |
| merge!(hash) if hash | |
| end | |
| def [](key) |