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
-- tagsoup 0.13.1 package, ghc 7.8.2 | |
*Main> :m +Text.HTML.TagSoup | |
*Main Text.HTML.TagSoup> :t renderOptions { optEscape = id, optMinimize = const True, optRawTag = const True } | |
<interactive>:1:1: | |
No instance for (Text.StringLike.StringLike t0) | |
arising from a use of ‘renderOptions’ | |
The type variable ‘t0’ is ambiguous | |
Note: there are several potential instances: | |
instance Text.StringLike.StringLike |
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
$ rustc slower.rs --test -C no-stack-check -O | |
$ ./slower --bench | |
running 1 test | |
test bench_stdrng_u64 ... bench: 187 ns/iter (+/- 14) = 42 MB/s | |
test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured | |
$ rustc slower.rs --test -C no-stack-check | |
$ ./slower --bench |
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
src/net.rs:99:34: 99:53 error: type `&net::Host` does not implement any method in scope named `update_tables` | |
src/net.rs:99 self.update_tables(c, p); | |
^~~~~~~~~~~~~~~~~~~ | |
src/net.rs:99:34: 99:53 note: found defined static methods, maybe a `self` is missing? | |
src/net.rs:157:5: 159:6 note: candidate #1 is defined in an impl for the type `net::Host` | |
src/net.rs:157 fn update_tables(source: IP, packet: &RIPv1Packet) { | |
src/net.rs:158 | |
src/net.rs:159 } |
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
enum B {} | |
impl B { | |
fn bb() -> i32 { 0 } | |
} | |
fn main() { | |
match 0 { | |
B::bb => {} | |
} |
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 Monoid<T> { | |
let zero : T; | |
// Arbitrary 2 argument functions may be used as binary operators | |
let `+` : T → T → T; | |
} |
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
#settings | |
DESCRIPTION_LEN = 5 | |
DESCRIPTION_SPLITTER = r'(?<=[.?!。!?])\s+' | |
#Modelis | |
def get_description(self, splitter = re.compile(settings.DESCRIPTION_SPLITTER)): | |
if self.short_content: | |
return self.short_content | |
else: | |
return ' '.join(splitter.split(self.content, settings.DESCRIPTION_LEN)[:-1]) |
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
start = new Date(); | |
for(i=0; i<1000000; i++){String(Math.floor(Math.random()*1000000))}; | |
console.log(new Date()-start) | |
>> 2054 | |
start = new Date(); | |
for(i=0; i<1000000; i++){String(~~(Math.random()*1000000))}; | |
console.log(new Date()-start) | |
>> 1752 |
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
body{background:#ffffff;color:#111111;} | |
h1,h2,h3,h4,h5,h6{color:#222222;} | |
.content{box-shadow:0 0 5px #111111;-moz-box-shadow:0 0 5px #111111;-webkit-box-shadow:0 0 5px #111111;border:#000 solid;border-width:0 1px;} | |
#logo{background:url("http://kazlauskas.me/m/image/logo.svg") 100%;height:100px;} |
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
>> stash.set('a', function(){return true;}) | |
<< 1 | |
>> stash.add('a', 'adding string') //It shouldn't replace old value. | |
<< 1 | |
>> stash.get('a') //Unexpected value, we would expect old function. | |
<< "adding string" | |
//For people who may want replace action, they could use stash.cut(); and stash.set(); again. |
OlderNewer