Skip to content

Instantly share code, notes, and snippets.


Ryan Rampersad ryanmr

View GitHub Profile
View weather.php
$url = "*%20from%20geo.places%20where%20woeid%3D12781740&format=json&diagnostics=true&callback=";
// $url = "*%20from%20geo.places%20where%20text%3D%22Macalester%20-%20Groveland%2C%20MN%22&format=json&diagnostics=true&callback=";
// $url = "*%20from%20geo.places%20where%20woeid%3D29306623&format=json&diagnostics=true&callback=";
$text = file_get_contents($url);
$data = json_decode($text, true);
function get_location($data) {
View grid.c
to generate a matrix and global values.
Then paste that generated code here.
void loop() {
package com.ifupdown.odin.adapters;
import android.content.Context;
import android.util.Log;
import android.util.SparseBooleanArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
View record.bash
# don't forget to include ADB in your path
# for example, in your ~/.bashrc, somewhere near the top
# export PATH=$PATH:/path/to/android-sdk/sdk/platform-tools
# check if there is a filename
if [ -z "$1" ]; then
echo usage: $0 filename
use std::io;
use std::rand;
struct Monte {
h: uint,
k: uint,
r: uint
fn main() {
fn multi() {
let tasks:uint = 4;
let (tx, rx): (Sender<uint>, Receiver<uint>) = channel();
let mut senders = Vec::<Sender<uint>>::new();
let mut receivers = Vec::<Receiver<uint>>::new();
for i in range(0, tasks) {
extern crate time;
use std::fmt;
use time::precise_time_ns;
use std::rand::{task_rng, Rng};
enum Value {
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 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/ 2:23 error: compile time crate loading is experimental and possibly buggy
/Users/ryanrampersad/Desktop/rust-wg/src/ #[phase(plugin, link)] extern crate log;
/Users/ryanrampersad/Desktop/rust-wg/src/ 2:23 help: add #![feature(phase)] to the crate attributes to enable
/Users/ryanrampersad/Desktop/rust-wg/src/ #[phase(plugin, link)] extern crate log;
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