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
use std::error::Error; | |
fn run() -> Result<(), Box<Error>> { | |
let stdin = std::io::stdin(); | |
let mut buffer = String::new(); | |
stdin.read_line(&mut buffer)?; | |
let n: u32 = buffer.parse()?; | |
println!("{}", n); | |
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
$ awk \ | |
'match($0, /^\[[^]]+\] :([^! ]+)[^ ]*/, a) { names[a[1]] = true; }; END { for (n in names) { print n } }' \ | |
ubuntu-indonesia.log | sort | |
akashi | |
alunux | |
anomimouse | |
anonimouse | |
anuress | |
aralmelintang | |
azzamsa |
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
(function(){var e={iu:"https://d5nxst8fruw4z.cloudfront.net/atrk.gif?",ver:"20130128",opts:{atrk_acct:"",domain:"",dynamic:false},fired:function(){if(typeof window._atrk_fired==="undefined"){window._atrk_fired=false}return window._atrk_fired},params:{frame_height:function(){return e.frame("innerHeight","clientHeight")},frame_width:function(){return e.frame("innerWidth","clientWidth")},iframe:function(){try{return window!=window.top?1:0}catch(e){return 0}},title:function(){return this.ue(document?document.title:"")},time:function(){var e=new Date;return e.getTime()+"&time_zone_offset="+e.getTimezoneOffset()},screen_params:function(){try{return screen.width+"x"+screen.height+"x"+screen.colorDepth}catch(e){}return""},java_enabled:function(){if(navigator&&typeof navigator.javaEnabled!=="undefined"){return navigator.javaEnabled()?"1":"0"}return""},cookie_enabled:function(){if(navigator&&typeof navigator.cookieEnabled!=="undefined"){return navigator.cookieEnabled?"1":"0"}return""},ref_url:function(){return typeof d |
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
#include <cstdio> | |
#define get getchar_unlocked | |
template<typename T> | |
void read(T &n) | |
{ | |
n = 0; T sign = 1; char c = get(); | |
while (c < '0' || c > '9') { | |
if (c == '-') sign = -1; | |
c = get(); | |
} |
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
[package] | |
name = "fixlog" | |
version = "0.1.0" | |
license = "MIT" | |
authors = ["Adit Cahya Ramadhan <[email protected]>"] | |
[[bin]] | |
name = "fixlog" | |
path = "main.rs" |
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() { | |
let mut data = Data::new(10); | |
println!("{:?}", data); | |
for n in data.iter() { | |
// you can't use data here | |
// this line fail: | |
// println!("{:?}", data); | |
println!("{}", n); | |
} | |
println!("{:?}", data); |
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 Next<S> { | |
fn next(&mut self) -> S; | |
} | |
#[derive(Debug)] | |
struct Multi { | |
s: &'static str, | |
n: u8, | |
x: f32, | |
} |
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 -s logubin.gomix.me/raw | awk 'match($0, /^\[[^]]+\] :([^!]+)[^ ]+ PRIVMSG/, a) { s = a[1]; sub(/_+$/, "", s); names[tolower(s)]++ }; END { for (n in names) { print names[n], n } }' | sort -k 1rn | |
332 triawarman | |
321 presiden | |
266 syandal | |
163 dikiaap | |
133 mr1nk | |
103 greenshirt | |
76 mugiono | |
38 tampandanberani | |
24 yulianfh[m] |
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 Unpack<T> { | |
fn unpack<I: IntoIterator<Item=T>>(i: I) -> Self; | |
} | |
macro_rules! impl_unpack { | |
(@replace_ty $_t:tt $ty:ty ) => { $ty }; | |
(@replace_expr $_t:tt $expr:expr) => { $expr }; | |
(@expand $($ident:ident,)* ) => { | |
impl<T> Unpack<T> for ( |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.