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
Ben Batha | |
Email: [email protected] | |
Google ID: applied under: elektronjunge | |
prefered contact: bhbatha | |
Other contact info: bbatha on irc.parrot.org #parrot | |
Your Project's Title: Java Byte Code to Parrot | |
Abstract | |
The focus of this project is to build a translator from Java Byte Code to Parrot friendly targets (PIR). |
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
Ben Batha | |
Email: [email protected] | |
Google ID: applied under: elektronjunge | |
prefered contact: bhbatha | |
Other contact info: bbatha on irc.parrot.org #parrot | |
Your Project's Title: Java on Parrot | |
Abstract |
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
# change foo to your library name | |
# change Foo::Database to your Sequel database | |
namespace :bundler do | |
task :setup do | |
require 'rubygems' | |
require 'bundler/setup' | |
end | |
end |
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 it_works() { | |
let guards: Vec<thread::JoinGuard<()>> = Vec::with_capacity(3); | |
{ | |
let mut pool = ScopedThreadPool::new(2); | |
for _ in (0..3) { | |
guards.push(pool.execute(move || { | |
thread::sleep_ms(1000); | |
println!("Things are happening!"); | |
})); |
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
[bbatha@dev threadpool-rs]% cargo test | |
Compiling threadpool v0.0.1 (file:///home/bbatha/projects/threadpool-rs) | |
src/lib.rs:42:12: 42:16 error: `pool` does not live long enough | |
src/lib.rs:42 pool.execute(move || { | |
^~~~ | |
src/lib.rs:38:19: 47:6 note: reference must be valid for the block at 38:18... | |
src/lib.rs:38 fn it_works() { | |
src/lib.rs:39 let mut pool = ScopedThreadPool::new(2); | |
src/lib.rs:40 | |
src/lib.rs:41 for _ in (0..3) { |
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::collections::HashSet; | |
use std::hash::Hash; | |
pub struct Dag<'a, L: 'a, N: 'a> { | |
leaves: HashSet<L>, | |
// Might be better as an arena but that isn't available the playpen | |
nodes: Vec<Node<'a, L, N>> | |
} | |
impl<'a, L: 'a + Eq + Hash, N: 'a> Dag<'a, L, N> { |
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::collections::HashSet; | |
use std::hash::Hash; | |
use typed_arena::Arena; | |
#[derive(Clone)] | |
pub enum Edges<'a, L: 'a, N: 'a + Hash> { | |
Leaves(Vec<&'a L>), | |
Children(Vec<&'a Node<'a, L, N>>) | |
} |
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
create_table(:minors) do | |
primary_key :id | |
end | |
create_table(:states) do | |
primary_key :id | |
foreign_key :minor_id, :minors | |
String :state, :size => 10 | |
end |
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
Compiling pool_problems v0.1.0 (file:///home/user/bbatha/experiments/pool_problems) | |
src/executor.rs:70:55: 70:61 error: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements [E0495] | |
src/executor.rs:70 let executor = Executor::new(auth_method, &scope); | |
^~~~~~ | |
src/executor.rs:69:9: 73:11 note: first, the lifetime cannot outlive the method call at 69:8... | |
src/executor.rs:69 pool.scoped(|scope| { | |
src/executor.rs:70 let executor = Executor::new(auth_method, &scope); | |
src/executor.rs:71 let result = executor.execute(&"true", &host).recv().unwrap(); | |
src/executor.rs:72 assert!(result.is_ok(), "Ensure you have a valid ssh-key pair for localhost"); | |
src/executor.rs:73 }); |
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 scoped_threadpool; | |
use scoped_threadpool::{Pool, Scope}; | |
#[derive(Debug)] | |
pub struct RefOwner<'a>(&'a str); | |
pub struct ScopeRef<'pool, 'scope> where 'pool: 'scope { | |
scope: &'scope Scope<'pool, 'scope>, | |
} |
OlderNewer