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() { | |
println!("hello?"); | |
} | |
/* | |
-- Running Windows -- | |
Installed MinGW per tutorial (checking mingw32-base and msys-base) | |
Included minGW/bin on path | |
Still, error on compiling hello world: |
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
import requests, os, bs4 | |
os.makedirs("oots", exist_ok=True) | |
for i in range (1, 968): | |
comicUrl = "http://www.giantitp.com/comics/oots" + str(i).zfill(4) + ".html" | |
filename = os.path.join("oots", "oots" + str(i).zfill(4) + ".gif") | |
if os.path.exists(filename): | |
print ("Skipping ", comicUrl) | |
continue |
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::cmp::Ordering; | |
#[derive(Debug)] | |
pub struct Tree<T> (Option<Box<Node<T>>>); | |
#[derive(Debug)] | |
pub struct Node<T> { | |
elem: T, | |
left: Tree<T>, | |
right: Tree<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
use std::cmp::Ordering; | |
#[derive(Debug)] | |
pub struct Tree<T> (Option<Box<Node<T>>>); | |
#[derive(Debug)] | |
pub struct Node<T> { | |
elem: T, | |
left: Tree<T>, | |
right: Tree<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
pub fn other(&self, room: &Room) -> Rc<RefCell<Room>> { | |
match self.left.borrow().name { //name is a String in the Room Struct | |
ref name if name == room.name => self.right.clone(), | |
_ => self.left.clone() | |
} | |
} | |
/* Gives: | |
the trait bound `&std::string::String: std::cmp::PartialEq<std::string::String>` is not satisfied [E0277] | |
src\game\hall.rs:20 ref name if name == room.name => self.right.clone(), |
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
let h: &Vec<Json> = try!(h.as_array().ok_or("Unable to parse halls".to_string())); | |
if h.len() != 2 { return Err("Invalid number of rooms per hall".to_string()); } | |
let left = h[0].as_u64().ok_or("Unable to parse Hall left".to_string()); | |
let right = h[0].as_u64().ok_or("Unable to parse Hall left".to_string()); | |
let mut hall = Hall::new_left_right(&self.rooms[left as usize], &self.rooms[right as usize]); |
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 <iostream> | |
#include <cctype> | |
using namespace std; | |
int main () { | |
char a; | |
int x = 0; | |
cin >> noskipws; |
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
import fileinput | |
def resolver(): | |
for line in fileinput.input(): | |
x = 0 | |
for c in line: | |
print(c.upper() if x % 2 == 0 else c.lower(), end='') | |
if c != ' ': | |
x += 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
import sys | |
def resolver(): | |
entrada = sys.stdin.read() | |
saida = list(entrada) | |
x = 0 | |
for i, c in enumerate(entrada): | |
if c == '\n': | |
x = 0 | |
elif c != ' ': |
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 <stdio.h> | |
int main () { | |
double a, b; | |
int i = 1; | |
while (scanf("%lf %lf", &a, &b) == 2) | |
printf ("Projeto %d:\n" | |
"Percentual dos juros da aplicacao: %.2lf %% \n", |
OlderNewer