Skip to content

Instantly share code, notes, and snippets.

#![feature(async_await, await_macro, futures_api, pin, arbitrary_self_types)]
use std::future::{Future, FutureObj};
use std::mem::PinMut;
use std::sync::{Arc, Mutex};
use std::sync::mpsc::{sync_channel, SyncSender, SendError, Receiver};
use std::task::{
self,
local_waker_from_nonlocal,
Poll,
#lang racket
(require (planet murphy/amb:1:1/amb))
(define (list->num lst)
(define (go acc lst)
(match lst
[(cons x xs) (go (+ x (* 10 acc)) xs)]
['() acc]))
(go 0 lst))
use ndarray::{Array, Array2};
fn parse(input: &str) -> Array2<u8> {
let width = input.lines().next().unwrap().len();
let height = input.lines().count();
println!("Parsing input");
for line in input.lines() {
println!("#{}#, ({})", line, line.len());
error: no rules expected the token `i`
--> <alt macros>:43:18
|
1 | / (
2 | | __impl $ i : expr , $ submac : ident ! ( $ ( $ args : tt ) * ) , $ (
3 | | $ rest : tt ) * ) => (
4 | | compiler_error ! (
... |
42 | | $ i : expr , $ ( $ rest : tt ) * ) => (
43 | | { alt ! ( __impl $ i , $ ( $ rest ) * | __end ) } ) ;
fn main() {
println!("Hello, world!");
}
fn splitit(s:&str) -> Vec<i32> {
s.chars().filter_map(|c| c.to_digit(10).map(|x| x as i32)).collect()
}
fn doit(v:Vec<i32>) -> i32 {
assert!(v.len() > 2);
## I'm going to start my comments with ## to distiguish them.
number = 1
## I'd make this a function which returns True or False
## Before you were always returning a list of length 1 or 0, which isn't
## that helpful. Remember, just because you name your variable `primes`
## here doesn't mean that it affects the variable named `primes` below.
def is_prime(number):
factors = []
@tbelaire
tbelaire / -
Created November 25, 2016 02:27
Running `rustc src/lib.rs --crate-name rust_blob --crate-type lib -g -C metadata=9dc428673c5385b0 --out-dir /Users/tbelaire/Documents/School/4B/CO759/rust-blob/target/debug/deps --emit=dep-info,link -L dependency=/Users/tbelaire/Documents/School/4B/CO759/rust-blob/target/debug/deps --extern cairo=/Users/tbelaire/Documents/School/4B/CO759/rust-blob/target/debug/deps/libcairo-bf20523ac567712b.rlib --extern tau=/Users/tbelaire/Documents/School/4B/CO759/rust-blob/target/debug/deps/libtau-dc4ff1578e949ee0.rlib --extern toml=/Users/tbelaire/Documents/School/4B/CO759/rust-blob/target/debug/deps/libtoml-1a75b37a708f335b.rlib --extern docopt=/Users/tbelaire/Documents/School/4B/CO759/rust-blob/target/debug/deps/libdocopt-664aa2a6d9ccf7ca.rlib --extern log=/Users/tbelaire/Documents/School/4B/CO759/rust-blob/target/debug/deps/liblog-bf16bb9a4912b11d.rlib --extern nalgebra=/Users/tbelaire/Documents/School/4B/CO759/rust-blob/target/debug/deps/libnalgebra-78c8f192ead1ea81.rlib --extern rustc_serialize=/Users/tbelaire/D
#!/usr/bin/env python3
import json
import subprocess
import os
import re
class LangServer:
def __init__(self):
self.server = subprocess.Popen(
["/Users/tbelaire/.cargo/bin/cargo", "run", "-q"],
#include <stdio.h>
#include <stdlib.h>
char shellcode[] =
"\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
"\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
"\x80\xe8\xdc\xff\xff\xff/bin/sh";
int
Parameter f: nat -> nat.
Ltac foo := match goal with
| |- context ctx [S ?n] => idtac n
end.
Lemma bar : 2 = 1 + 1.
Proof.
foo.
reflexivity.