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
Chicken chicken chicken chicken chicken chicken chicken chicken chicken: chicken chicken, chicken chicken chicken, chicken $x \in $\mathbb{R}$^n$, chicken a chicken chicken chicken, chicken $y in $\mathbb{R}$$. | |
Chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken, chicken chicken chicken chicken chicken chicken chicken chicken. | |
Chicken chicken a chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken. Chicken | |
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken | |
chicken chicken chicken chicken chicken. Chicken chicken chicken chicken a chicken chicken- | |
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken: chicken chicken chicken a chicken- |
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
// Old style: | |
DefConstructor!("\emph{}", "<ltx:emph>#1</ltx:emph>"); | |
// New style: | |
DefConstructor!("\emph{}", element!("ltx:emph", arg!(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
#!/bin/bash | |
# copied from: https://gist.githubusercontent.com/petere/6023944/raw/pg-travis-test.sh | |
# just changed the port | |
set -eux | |
sudo apt-get update | |
packages="postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-common" | |
# bug: http://www.postgresql.org/message-id/[email protected] |
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
extern crate regex; | |
use regex::Regex; | |
fn main() { | |
let test = "\u{123}\u{000}\u{143}\u{00}"; | |
let no_nulls_regex = Regex::new(r"\x00").unwrap(); | |
println!("Before: {:?}", test); | |
let sanitized = no_nulls_regex.replace_all(test,""); | |
println!("Sanitized: {:?}", sanitized); | |
} |
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
fn fetch_vec<T>(vec_arc: &Arc<Mutex<Vec<T>>>) -> Vec<T> { | |
let mut vec_mutex_guard = vec_arc.lock().unwrap(); | |
let fetched_vec : Vec<T> = vec_mutex_guard.deref().clone(); | |
vec_mutex_guard.clear(); | |
fetched_vec | |
} |
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
fn utf8_truncate(input : &mut String, maxsize: usize) { | |
let mut utf8_maxsize = input.len(); | |
if utf8_maxsize >= maxsize { | |
{ let mut char_iter = input.char_indices(); | |
while utf8_maxsize >= maxsize { | |
utf8_maxsize = match char_iter.next_back() { | |
Some((index, _)) => index, | |
_ => 0 | |
}; | |
} } // Extra {} wrap to limit the immutable borrow of char_indices() |
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
impl TaskManager { | |
pub fn start<'manager>(&'manager self) -> Result<(), Error> { | |
// We'll use some local memoization shared between source and sink: | |
let mut services: HashMap<String, Option<Service>> = HashMap::new(); | |
let mut queues : HashMap<String, Vec<Task>> = HashMap::new(); | |
// First prepare the source ventilator | |
let source_port = self.source_port.clone(); | |
let source_queue_size = self.queue_size.clone(); | |
let source_backend_address = self.backend_address.clone(); |
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
/home/dreamweaver/.cargo/registry/src/github.com-0a35038f75765ae4/libarchive-sys-0.0.2/src/lib.rs:93:22: 93:35 error: use of unstable library feature 'box_raw': may be renamed or moved out of Box scope | |
/home/dreamweaver/.cargo/registry/src/github.com-0a35038f75765ae4/libarchive-sys-0.0.2/src/lib.rs:93 let mut rc = Box::from_raw(_client_data as *mut ReadContainer); | |
^~~~~~~~~~~~~ | |
/home/dreamweaver/.cargo/registry/src/github.com-0a35038f75765ae4/libarchive-sys-0.0.2/src/lib.rs:93:22: 93:35 help: add #![feature(box_raw)] to the crate attributes to enable | |
/home/dreamweaver/.cargo/registry/src/github.com-0a35038f75765ae4/libarchive-sys-0.0.2/src/lib.rs:96:9: 96:29 error: use of unstable library feature 'box_raw': renamed to Box::into_raw | |
/home/dreamweaver/.cargo/registry/src/github.com-0a35038f75765ae4/libarchive-sys-0.0.2/src/lib.rs:96 std::boxed::into_raw(rc); | |