Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Rampersad ryanmr

View GitHub Profile
View wargame.rs
extern crate time;
use std::fmt;
use time::precise_time_ns;
use std::rand::{task_rng, Rng};
#[deriving(Clone)]
enum Value {
Two,
View match2.rs
let args = os::args();
let tasks:uint = match args.len() {
2 => match args[1].as_slice().trim().parse() {
Some(x) => x,
None => 1
},
_ => 1
};
View callgrind.log
--------------------------------------------------------------------------------
Profile data file 'callgrind.out.23136' (creator: callgrind-3.8.1)
--------------------------------------------------------------------------------
I1 cache:
D1 cache:
LL cache:
Timerange: Basic block 0 - 273612
Trigger: Program termination
Profiled target: ./game (PID 23136, part 1)
Events recorded: Ir
View gist:2a2b60f059d3dc8305f5
ryans-mba:rust-wg ryanrampersad$ cargo run --bin game
Compiling wargame v0.0.1 (file:///Users/ryanrampersad/Desktop/rust-wg)
/Users/ryanrampersad/Desktop/rust-wg/src/wg.rs:2:1: 2:23 error: compile time crate loading is experimental and possibly buggy
/Users/ryanrampersad/Desktop/rust-wg/src/wg.rs:2 #[phase(plugin, link)] extern crate log;
^~~~~~~~~~~~~~~~~~~~~~
/Users/ryanrampersad/Desktop/rust-wg/src/wg.rs:2:1: 2:23 help: add #![feature(phase)] to the crate attributes to enable
/Users/ryanrampersad/Desktop/rust-wg/src/wg.rs:2 #[phase(plugin, link)] extern crate log;
^~~~~~~~~~~~~~~~~~~~~~
View htpc.md

A New HTPC, Or Not?

Update: the components for Build 2.1 have been purchased and will all arrive by Monday evening. Thanks for all your input on building this HTPC.

Our HTPC is rather old, large and somewhat noisey. I have been given clearance to build something better, provided it costs less than $450 (excluding Windows).

This HTPC needs to handle our current USB-based tuner stick so that DVR capabilities exist. Aside from that, it also needs to handle websites that don't have Chromecast support. It should ideally be smaller, quieter, and use less power annually.

Build 2.1

View rust-error.md

Here's a lovely error.

error: mismatched types: expected `wg::Value`, found `&wg::Value` (expected enum wg::Value, found &-ptr)

cards.push(Card::new(value.clone(), suit.clone()));

Solution

cards.push(Card::new(*value.clone(), *suit.clone()));

View wg.go
package main
import (
"fmt"
)
type Value int
const (
Two Value = 2 + iota
Three
View gist:e76fb13c69f8c5c8db19
2015/02/04 18:56:14 [error] 2200#0: *1 FastCGI sent in stderr: "Unable to open primary script: /home/vagrant/Code/Laravel/public/index.php (No such file or directory)" while reading response header from upstream, client: 192.168.10.1, server: test.app, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "test.app"
View nexus_export.php
<div class="wrap">
<textarea cols="80" rows="100">
<?php
/*
Series (categories in WordPress)
*/
$json_categories = array();
View tc-gen.php
$template = "<b>Test ID:</b> 4.5.{n}<br />
<b>Test Name:</b> Tuition for graduate student in year {year} of Medical School, {res}resident status, 13 credits<br />
<b>Description:</b> Check that a graduate student in year {year} of Medical School, with {res}resident status, taking 13 credits, pays the \${amount} flat fee rate<br />
<b>Inputs:</b> Graduate student, year {year} in program, {res}resident status, 13-credit count<br />
<b>Expected Results:</b> \${amount} tuition fee charged<br />
<b>Initialization:</b> {initialization}<br />
<b>Test Steps:</b> {test steps}<br />
<b>Author:</b> The Bot <b>Date:</b> 2015-03-03<br />
<hr />
<br /><br />
You can’t perform that action at this time.