Skip to content

Instantly share code, notes, and snippets.

View sbeckeriv's full-sized avatar
🐢
Horray another status box

becker sbeckeriv

🐢
Horray another status box
  • Death By Escalator
  • Seattle
  • 18:38 (UTC -07:00)
View GitHub Profile
function lmf {
if [ -z "$1" ]
then
ls -ctr -d db/migrate/* | tail -1
else
ls -ctrdl $1/*| egrep -v '^d'| tr -s ' ' |cut -d" " -f9 | tail -1
fi
}
function lm {
require "delegate"
class BankAccount
def number
123456
end
end
class SimpleDelegatorBankAccount < SimpleDelegator
end
@sbeckeriv
sbeckeriv / bench
Created June 28, 2015 00:04
Smith-Waterman Bench
v0.1.0
many = 7k x 7k
many_many = 70k * 7k
mac osx 10.10.2
2.7 GHz Intel Core i7
16 gigs of ram
running 6 tests
@sbeckeriv
sbeckeriv / benchs
Created June 29, 2015 01:12
bench marks
many = 7k x 7k
many_many = 70k * 7k
mac osx 10.10.2
2.7 GHz Intel Core i7
16 gigs of ram
running 6 tests
test tests::bench_maxtrix_fn ... bench: 5,991,024 ns/iter (+/- 186,413)
test tests::bench_maxtrix_fn_many ... bench: 1,612,595,751 ns/iter (+/- 6,534,472)
test tests::bench_maxtrix_fn_many_many ... bench: 16,097,644,354 ns/iter (+/- 100,424,256)
#![feature(simd)]
#![allow(experimental)]
extern crate test;
extern crate time;
use std::simd::f64x2;
use std::sync::{Arc,Future};
static CHUNKS: uint = 4;
static POINTS: uint = 10000000;
<!DOCTYPE html>
<meta charset="utf-8">
<title>Bookmakrlet</title>
<body>
<a href="javascript:(function()%20{$("#downloadFileCSV").remove();var%20scrub_csv=function(e){return'"'+$.trim(e.replace(/"/g,'""')+'"')},data=$.makeArray($(".destiny-icon-item").map(function(e,t){return%20scrub_csv($(t).find(".standardTitle").text())+","+scrub_csv($(t).find(".requirements").text())+","+scrub_csv($(t).find(".itemSubtitle%20.tierTypeName").text())+","+scrub_csv($(t).find(".vendorFailureReasons").text())})).join("\n");data=["name","requirements%20count","teir","requirements","\n"].join()+data,$("<a></a>").attr("id","downloadFileCSV").attr("href","data:text/csv;charset=utf8,"+encodeURIComponent(data)).attr("download","filename.csv").appendTo("body"),$("#downloadFileCSV").ready(function(){$("#downloadFileCSV").get(0).click()});})()">Export CSV from destiny vendors. Click and drag to bookmark bar<a/>
</body>
</html>
$ ~/trash/rust-algorithms/chapter-1/3/max_stack[master*]: cargo build
Compiling max_stack v0.1.0 (file:///Users/becker/trash/rust-algorithms/chapter-1/3/max_stack)
src/stackable.rs:34:1: 41:2 error: the trait `core::iter::Iterator` is not implemented for the type `stackable::MaxStackIterator<T>` [E0277]
src/stackable.rs:34 impl<T> IntoIterator for MaxStack<T> {
src/stackable.rs:35 type Item = T;
src/stackable.rs:36 type IntoIter = MaxStackIterator<T>;
src/stackable.rs:37
src/stackable.rs:38 fn into_iter(self) -> MaxStackIterator<T> {
src/stackable.rs:39 MaxStackIterator::new(self)
...
// _IMAGE AUTHENTICATION FOR A SLIPPERY NEW AGE_
//by Steve Walton
//Listing One
// <sealimg.c>
// Copyright 1994 by Steve Walton
//
// This implementation measures checksums using all of the upper 7 bits of each
@sbeckeriv
sbeckeriv / main.rs
Created June 3, 2016 06:00
rust scraping
extern crate curl;
use curl::easy::Easy;
use std::error::Error;
use std::io::prelude::*;
use std::fs::File;
use std::path::Path;
// Print a web page onto stdout
fn main() {
Compiling image_gen v0.1.0 (file:///Users/becker/trash/image_gen)
src/main.rs:25:26: 25:41 error: the trait bound `&image::ImageBuffer<image::Rgba<u8>, std::vec::Vec<u8>>: img_hash::HashImage` is not satisfied [E0277]
src/main.rs:25 let generated_hash = ImageHash::hash(&generated, 8, HashType::Gradient);
^~~~~~~~~~~~~~~
src/main.rs:25:26: 25:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:25:26: 25:41 help: the following implementations were found:
src/main.rs:25:26: 25:41 help: <image::ImageBuffer<image::Luma<u8>, std::vec::Vec<u8>> as img_hash::HashImage>
src/main.rs:25:26: 25:41 help: <image::ImageBuffer<image::LumaA<u8>, std::vec::Vec<u8>> as img_hash::HashImage>
src/main.rs:25:26: 25:41 help: <image::ImageBuffer<image::Rgb<u8>, std::vec::Vec<u8>> as img_hash::HashImage>
src/main.rs:25:26: 25:41 help: <image::ImageBuffer<image::Rgba<u8>, std::vec::Vec<u8>> as img_hash::HashImage>