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
| ### Keybase proof | |
| I hereby claim: | |
| * I am rylev on github. | |
| * I am ryanlevick (https://keybase.io/ryanlevick) on keybase. | |
| * I have a public key whose fingerprint is F379 58BE 0E1A ECE1 D1DB A8E5 243E 54BE D142 3716 | |
| To claim this, I am signing this object: |
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
| enum Maybe<T> { | |
| case Just(T) | |
| case None | |
| func maybe(def: T, fn: (T) -> (T)) -> T { | |
| switch self { | |
| case let Just(x): return fn(x) | |
| case None: return def | |
| } | |
| } |
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
| if (resp.isSuccess) | |
| Future{ NoContent } | |
| else passthrough(resp) | |
| if (resp.isSuccess) { | |
| Future{ NoContent } | |
| } else { | |
| passthrough(resp) | |
| } |
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
| =erl_crash_dump:0.2 | |
| Fri Sep 26 14:40:25 2014 | |
| Slogan: init terminating in do_boot () | |
| System version: Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] | |
| Compiled: Tue Sep 3 19:23:51 2013 | |
| Taints: | |
| Atoms: 4761 | |
| =memory | |
| total: 10782344 | |
| processes: 3969496 |
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
| /* Map */ | |
| class Future[A] { | |
| map[B](someMapFunction: A => B): Future[B] | |
| } | |
| // Mapping lets you convert any Future of some type A to a Future of some type B | |
| // For instance you can go from Future[String] to Future[Int] | |
| val myFutureString : Future[String] = Future("some String") |
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
| use std::io::File; use std::io::FileMode::Open; | |
| use std::io::FileAccess::{Write,ReadWrite}; | |
| use std::io::IoResult; | |
| use std::fmt::{Show,Formatter,Error}; | |
| const MAX_DATA: uint = 512; | |
| const MAX_ROWS: uint = 100; | |
| struct Field { |
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
| fn bubble_sort(numbers: &Vec<i64>, compare_fn: |i64, i64| -> i64) -> Vec<i64> { | |
| let mut temp; | |
| let mut target = numbers.clone(); | |
| let length = numbers.len(); | |
| for _ in range(0, length) { | |
| for j in range(0, length - 1) { | |
| if compare_fn(target[j], target[j+1]) > 0 { | |
| temp = target[j+1]; | |
| target[j+1] = target[j]; |
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
| function divide(num1: number | undefined, num2: number | undefined): number | 'no!' | undefined { | |
| if (num1 === undefined || num2 === undefined) { return } | |
| // num1 and num2 now have type number | |
| if (num2 === 0) { return 'no!'} | |
| return num1 / num2 | |
| } |
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
| PROCESSOR 6502; set processor | |
| INCLUDE "vcs.h" ; include helpful stuff | |
| INCLUDE "macro.h" ; include helpful stuff | |
| Seg Code ; set code segment | |
| ORG $F000 ; code should start at 0xF000 | |
| BGColor equ $81 ; Reserve space at 0x81 | |
| Start |
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
| fn main() { | |
| let mut sortable: [i32; 5] = [5, 8, 2, 7, 6]; | |
| let length = sortable.len(); | |
| let mut swapped = true; | |
| print_array(&sortable); | |
| while swapped { | |
| swapped = false; | |
| for i in 1..length { |