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
| │ mov %eax,%edx | |
| │ mov -0x10570(%rbp),%rdi | |
| │ → callq memset@plt | |
| │ ↑ jmp 3ff | |
| │430: lea -0x270(%rbp),%rdi | |
| │ → callq core..result..Result$LT$hyper..server..response..Response$LT$hyper..net..Streaming$GT$$C$$u{20}std..old_io..IoError$GT$::glue_drop.7352::hc73d0301cc6ca3b3 | |
| 0.01 │ lea -0x10328(%rbp),%rdi | |
| │ mov %rdi,-0x10578(%rbp) | |
| │ ↓ jmp 45f | |
| │44c: mov -0x10578(%rbp),%rax |
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
| /code fn write_with_body(mut res: HttpResponse<Fresh>, mut body: Box<Reader + Send>) -> IoResult<()> { | |
| let content_type = res.headers().get::<headers::ContentType>() | |
| .map(|cx| cx.clone()) | |
| .unwrap_or_else(|| headers::ContentType("text/plain".parse().unwrap())); | |
| res.headers_mut().set(content_type); | |
| let mut res = try!(res.start()); | |
| // FIXME: Manually inlined old_io::util::copy | |
| // because Box<Reader + Send> does not impl Reader. |
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
| #!/usr/bin/zsh | |
| set -e | |
| case "$1" in | |
| mobile) | |
| (set -x; | |
| nmcli c down uuid fbfcaacb-649b-4490-8293-c68b526250d8) | |
| nmcli c up uuid e3a22e4f-1973-4683-8de8-931578b0c6ec | |
| ;; |
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
| for line_or_fail in io::stdin().lines() { | |
| let entry = line_counts.entry(line_or_fail.unwrap()); | |
| match entry { | |
| Occupied(mut entry) => { *entry.get_mut() = *entry.get_mut() + 1; }, | |
| Vacant(entry) => { entry.set(1); }, | |
| } | |
| } |
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
| for line_or_fail in io::stdin().lines() { | |
| // XXX(scode): There is probably a much better way? | |
| let line = line_or_fail.unwrap(); | |
| let existed = { | |
| let existing_count = line_counts.get_mut(&line); | |
| match existing_count { | |
| None => { false }, | |
| Some(count) => { *count = *count + 1; true}, | |
| } | |
| }; |
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
| #[test] | |
| fn test_from_file() { | |
| let tmp_dir = io::TempDir::new("jsontest").unwrap(); | |
| let tmp_file: io::File = io::File::create(tmp_dir.path()).unwrap(); | |
| let tmp_path: Path = *tmp_file.path(); | |
| let mut tmp_out = io::BufferedWriter::new(tmp_file); | |
| tmp_out.write_str(valid_cfg_json()); | |
| tmp_out.flush(); |
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
| Python 2.7.6 (default, Mar 22 2014, 22:59:56) | |
| [GCC 4.8.2] on linux2 | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> l1 = [1, 2] | |
| >>> l2 = l1 | |
| >>> l1 | |
| [1, 2] | |
| >>> l2 | |
| [1, 2] | |
| >>> l1 += [3] |
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
| for tup in sorted_lines.iter() { | |
| let count = tup.ref0(); | |
| let line = tup.ref1(); | |
| ... | |
| } |
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
| (defn- inner-generate [n] | |
| (if (= n 10) | |
| nil | |
| (cons n (lazy-seq (inner-generate (inc n)))))) | |
| (defn generate [] | |
| (lazy-seq (inner-generate 0))) |
NewerOlder