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 primeiter; | |
use primeiter::PrimeIter; | |
fn num_facts(mut num: u64)->u64 | |
{ | |
let mut count = 1; | |
let primes = PrimeIter::new(); | |
for prime in primes | |
{ |
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 rustbox; | |
use rustbox::{Color,RustBox,Key}; | |
use rustbox::Event::*; | |
fn main() | |
{ | |
let term = RustBox::init(std::default::Default::default()).unwrap(); | |
term.print(1,1,rustbox::RB_BOLD,Color::White,Color::Default,"Hello, world!"); |
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
#![feature(str_escape)] | |
#[derive(Debug,Copy,Clone,Eq,PartialEq)] | |
enum CryptError | |
{ | |
BufferSizeInvalid, | |
} | |
fn main() | |
{ |
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
import QtQuick 2.0 | |
import QtWebKit 3.0 | |
import QtQuick.Controls 1.0 | |
ApplicationWindow | |
{ | |
width: 640 | |
height: 400 | |
TextField |
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
#include <assert.h> | |
#include <stdio.h> | |
#include <string.h> | |
size_t strchcount(const char *str,int ch) | |
{ | |
size_t count = 0; | |
const char *s = str-1; | |
while(s=strchr(s+1,ch)) | |
{ |
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/sh | |
URL='http://zeldauniverse.net/media/music/the-wind-waker-original-soundtrack/' | |
FILE_SCHEMA='http:\/\/zeldauniverse\.s3\.amazonaws\.com\/soundtracks\/thewindwakerost\/cd[12]\/The_Legend_of_Zelda_-_The_Wind_Waker.*\.mp3' | |
curl $URL | egrep $FILE_SCHEMA | cut -c 14- | sed -E 's/\.mp3.*$/.mp3/' | wget -i - |
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
CC := cc | |
LD := ld | |
CFLAGS := -pedantic -Wall -Werror -Wextra -std=c89 -fno-stack-protector | |
LDFLAGS := | |
default: main binary | |
all: clean main binary | |
%.o: %.c |
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 rustbox; | |
use rustbox::{Color,RustBox,Key}; | |
use rustbox::Event::*; | |
fn main() | |
{ | |
let term = RustBox::init(std::default::Default::default()).unwrap(); | |
term.print(1,1,rustbox::RB_BOLD,Color::White,Color::Default,"Hello, world!"); |
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 main() | |
{ | |
let v = (0..16).collect::<Vec<_>>(); | |
for p in v.iter() | |
.chain(v.iter().rev().skip(1).take(v.len()-2)) | |
.cycle() | |
.take(35) | |
{ | |
for i in (v.len()/2..).take(v.len()+v.len()/2) |
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
use std::path::Path; | |
use std::path::PathBuf; | |
use std::sync::Arc; | |
struct Context | |
{ | |
root: String, | |
index: String, | |
} |