Bits and pieces. gist
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 serial; | |
use std::path::Path; | |
use std::path::PathBuf; | |
use serial::prelude::*; | |
use serial::posix::TTYPort; | |
struct FirmataBoard { | |
port: TTYPort, |
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
#[macro_use] | |
extern crate nickel; | |
extern crate yaml_rust; | |
use nickel::{ Nickel, HttpRouter }; | |
use yaml_rust::{ Yaml, YamlEmitter }; | |
mod yaml_handler; | |
fn get_yaml() -> String { |
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 move_enemies(&mut self) { | |
self.enemies = self.enemies.into_iter().map(|enemy| { | |
let between = Range::new(0, 4); | |
let mut rng = rand::thread_rng(); | |
let desired_move: (i8, i8) = match between.ind_sample(&mut rng) { | |
0 => (0, -1), | |
1 => (0, 1), | |
2 => (-1, 0), | |
3 => (1, 0), | |
_ => (0, 0), // This shouldn't happen. |
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
pub struct Command { | |
cmd: String, | |
} | |
impl Command { | |
pub fn new(cmd: &str) -> Command { | |
Command { | |
cmd: String::from(cmd), | |
} | |
} |
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 gl; | |
extern crate glutin; | |
extern crate libc; | |
use std::io::prelude::*; | |
use std::io; | |
use std::fs::File; | |
fn main(){ | |
let s = read_file("model.obj"); |
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
struct Lib { | |
// whatever... but it implements Drop | |
} | |
impl Lib { | |
fn get_widget() -> &LibWidget { | |
// unimportant (I think), but LibWidget implements Drop | |
} |
9:05- 9:25 1. Welcome and Introduction (20min)
-
Operational Stuff (10min) [Ashley]
- Introduction to instructors
- Where are all the materials
- Explain the schedule, when are breaks
- Code of Conduct
- What to do if you need help
-
What is the intermezzOS project? (10min) [Steve]
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 add_to_mutable_reference(x: &mut i32) { | |
*x +=1; | |
} | |
#[test] | |
fn mutable_reference_test() { | |
let mut x = 5; | |
let y = &mut x; | |
mutable_reference(y); |
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
global start | |
section .text | |
bits 32 | |
start: | |
; Point the first entry of the level 4 page table to the first entry in the | |
; p3 table | |
mov eax, p3_table | |
or eax, 0b11 ; | |
mov dword [p4_table + 0], eax |