This file contains 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
{ | |
"foo": 3, | |
"bar": 10 | |
} |
This file contains 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
Compiling korasho v0.1.0 (file:///Users/bjorn/projects/korasho) | |
src/connect.rs:32:45: 32:78 error: use of undeclared type name `std::Result` [E0412] | |
src/connect.rs:32 pub fn connect(server: ::config::Server) -> ::std::Result<Connection, String> { | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
src/connect.rs:32:45: 32:78 help: run `rustc --explain E0412` to see a detailed explanation | |
error: aborting due to previous error | |
Could not compile `korasho`. |
This file contains 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
Compiling korasho v0.1.0 (file:///Users/bjorn/projects/korasho) | |
<std macros>:1:33: 1:58 error: invalid reference to argument `0` (no arguments given) | |
<std macros>:1 ( $ fmt : expr ) => ( print ! ( concat ! ( $ fmt , "\n" ) ) ) ; ( | |
^~~~~~~~~~~~~~~~~~~~~~~~~ | |
<std macros>:1:33: 1:58 note: in this expansion of concat! | |
<std macros>:2:25: 2:56 note: in this expansion of format_args! | |
<std macros>:1:23: 1:60 note: in this expansion of print! (defined in <std macros>) | |
src/main.rs:143:5: 143:29 note: in this expansion of println! (defined in <std macros>) | |
error: aborting due to previous error | |
Could not compile `korasho`. |
This file contains 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
// Rust 0.10-pre (Tue Mar 18, 2014) | |
// $ rustc -L rust-openssl/build/ -L rust-toml/lib doing.rs | |
// assuming https://github.com/sfackler/rust-openssl is cloned and compiled, | |
// and https://github.com/mneumann/rust-tom is cloned and compiled | |
#[feature(macro_rules)]; | |
#[allow(deprecated_owned_vector)]; | |
extern crate openssl; | |
extern crate serialize; |
This file contains 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() { | |
fn map<F, T, A>(option: Option<T>, f: F) -> Option<A> where F: FnOnce(T) -> A { | |
match option { | |
None => None, | |
Some(value) => Some(f(value)), | |
} | |
} | |
} |
This file contains 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
curl -vvv "http://50.168.68.186:3080/nphMotionJpeg?Resolution=640x480&Quality=Standard" | |
* Trying 50.168.68.186... | |
* Connected to 50.168.68.186 (50.168.68.186) port 3080 (#0) | |
> GET /nphMotionJpeg?Resolution=640x480&Quality=Standard HTTP/1.1 | |
> Host: 50.168.68.186:3080 | |
> User-Agent: curl/7.43.0 | |
> Accept: */* | |
> | |
* HTTP 1.0, assume close after body | |
< HTTP/1.0 200 OK |
This file contains 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
main = putStrLn "Hello, World!" | |
doubleSecondNum :: [Int] -> [Int] | |
doubleSecondNum numbers | |
| length numbers == 0 = numbers | |
| otherwise = reverse (map doubleEven (zip (reverse numbers) [0..])) | |
doubleEven :: (Int, Int) -> Int | |
doubleEven pair | |
| (succ (snd pair)) `mod` 2 == 0 = (fst pair) * 2 |
This file contains 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
def find_best(telephone_number): | |
results = filter(lambda x : telephone_number.find(x) is not -1, ("001","001631","001800")) | |
current = "" | |
for res in results: | |
if len(res) > len(current): | |
current = res | |
return current | |
print(find_best("0016316420665")) |
This file contains 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
~ $ python | |
Python 2.7.10 (default, Jun 2 2015, 17:24:15) | |
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> l = [1] | |
>>> d = {} | |
>>> d[l] = "foo" | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: unhashable type: 'list' |
This file contains 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
bash-3.2$ vim test | |
bash-3.2$ chmod +x test | |
bash-3.2$ ./test | |
moo | |
bash-3.2$ cat test | |
#!/bin/bash | |
echo "moo" |
NewerOlder