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
#!/bin/bash | |
#set config(0) {{- 0} -1 56 -1 56} | |
#set config(1) {{- 1} 47 75 47 75} | |
#set config(2) {{- 2} 65 128 65 128} | |
## config | |
I8KCTL_FAN="i8kctl fan" | |
I8KCTL_TEMP="i8kctl temp" |
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
extern crate webclient; | |
use std::io::Reader; | |
use std::io::stdin; | |
use webclient::digest::types::HashAlgorithm; | |
pub fn hash_algorithm_from_lower(name: &str) -> Option<Box<HashAlgorithm+'static>> { | |
match name { | |
"-md5" => Some(box webclient::digest::md5::md5_new() as Box<HashAlgorithm>), | |
"-sha1" => Some(box webclient::digest::sha1::sha1_new() as Box<HashAlgorithm>), |
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
extern crate getopts; | |
use std::io::File; | |
use std::path::Path; | |
use getopts::optflag; | |
pub struct Total { | |
lines: uint, | |
words: uint, | |
chars: uint, | |
bytes: uint |
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
trait Mappable | |
{ | |
type A; | |
type B; | |
type M<A> where M<A> = Self; | |
type M<B>; | |
fn map<A, B>(self, f: A -> B) -> M<B>; | |
} |
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
sql_execute!{ | |
select(star, from(user), where(age > 5), order_by(tel)); | |
} |
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
let matches = getopts::getopts(args, opts.as_slice()).unwrap(); | |
if matches.opt_present("h") { | |
let brief = "word, line, and byte or character count"; | |
format_args!(|args| { std::io::stderr().write_fmt(args).unwrap() }, | |
"{} {}\n\n{}", getopts::short_usage(program, opts), | |
"[FILE ...]", getopts::usage(brief, opts)); | |
std::os::set_exit_status(1); | |
return; | |
} |
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
if matches.opt_present("h") { | |
let brief = "word, line, and byte or character count"; | |
(writeln!(&mut std::io::stderr(), | |
"{} {}\n\n{}", getopts::short_usage(program, opts), | |
"[FILE ...]", getopts::usage(brief, opts))).unwrap(); | |
std::os::set_exit_status(1); | |
return; | |
} |
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
$ echo 'typedef union { char __mbstate8[128]; } __mbstate_t;' | bin/cdump.pl6 | |
TOP | |
| ws | |
| | ws-char | |
| | * FAIL | |
| * MATCH "" | |
| ws | |
| | ws-char | |
| | * FAIL | |
| * MATCH "" |
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
diff --git a/Makefile.in b/Makefile.in | |
index 8172d27..dd0fc06 100644 | |
--- a/Makefile.in | |
+++ b/Makefile.in | |
@@ -1,8 +1,9 @@ | |
+EXTOPTS="-arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector" | |
.PHONY: clean test | |
all: %DESTDIR%/Inline/pyhelper%SO% | |
clean: | |
rm %DESTDIR%/Inline/pyhelper%SO% |
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
pub fn transmute_memory<T: Sized, U: Sized>(dst: &mut T, src: &U) { | |
unsafe { | |
let size = ::std::mem::size_of::<U>(); | |
assert_eq!(::std::mem::size_of::<T>(), size); | |
::std::ptr::copy_nonoverlapping_memory( | |
::std::mem::transmute::<&T, *mut T>(dst), | |
::std::mem::transmute::<&U, *const T>(src), | |
size); | |
} | |
} |
OlderNewer