Skip to content

Instantly share code, notes, and snippets.

@cramertj
cramertj / gist:6a221fb8e167ea16cab4
Created February 24, 2015 20:16
Shuffle String in One Line
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
public class Main {
public static void main(String[] args) {
@cramertj
cramertj / nsa_funcs.txt
Last active April 25, 2016 00:57
Clippy NSA
clippy::mainmain ::std::io::_print
clippy::mainmain ::std::fmt::Arguments::new_v1
clippy::consts::clone Constant::Str
clippy::consts::clone ::std::clone::Clone::clone
clippy::consts::clone ::std::clone::Clone::clone
clippy::consts::clone Constant::Binary
clippy::consts::clone ::std::clone::Clone::clone
clippy::consts::clone Constant::Char
clippy::consts::clone ::std::clone::Clone::clone
clippy::consts::clone Constant::Int

Keybase proof

I hereby claim:

  • I am cramertj on github.
  • I am cramertj (https://keybase.io/cramertj) on keybase.
  • I have a public key whose fingerprint is 0315 2C9B 134B DE8B 16ED 1008 66B2 0CA6 4FAC 19DD

To claim this, I am signing this object:

@cramertj
cramertj / Cargo.toml
Created April 26, 2017 03:17
Rust Fibers
[package]
name = "fiber_test"
version = "0.1.0"
authors = ["Taylor Cramer <[email protected]>"]
[target.'cfg(windows)'.dependencies]
winapi = "0.2"
kernel32-sys = "0.2"
DEBUG 2018-05-23T19:42:45Z: rustc::infer::outlives::bounds: explicit_outlives_bounds()
DEBUG 2018-05-23T19:42:45Z: rustc::infer: is_tainted_by_errors(err_count=0, err_count_on_creation=0, tainted_by_errors_flag=false)
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: RegionConstraintData: resolve_regions()
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: ----() Start constraint listing (context=DefId(0/0:3 ~ main[317d]::FnLt[0])) ()----
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: ----() End constraint listing (context=DefId(0/0:3 ~ main[317d]::FnLt[0])) ()---
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: ---- # Iteration Expansion1
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: ---- Expansion Complete after 1 iteration(s)
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: collect_var_errors
DEBUG 2018-05-23T19:42:45Z: rustc::infer: is_tainted_by_errors(err_count=0, err_count_on_creation=0, tainted_by_e
DEBUG 2018-05-23T19:42:45Z: rustc::infer::outlives::bounds: explicit_outlives_bounds()
DEBUG 2018-05-23T19:42:45Z: rustc::infer: is_tainted_by_errors(err_count=0, err_count_on_creation=0, tainted_by_errors_flag=false)
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: RegionConstraintData: resolve_regions()
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: ----() Start constraint listing (context=DefId(0/0:3 ~ main[317d]::FnLt[0])) ()----
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: ----() End constraint listing (context=DefId(0/0:3 ~ main[317d]::FnLt[0])) ()---
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: ---- # Iteration Expansion1
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: ---- Expansion Complete after 1 iteration(s)
DEBUG 2018-05-23T19:42:45Z: rustc::infer::lexical_region_resolve: collect_var_errors
DEBUG 2018-05-23T19:42:45Z: rustc::infer: is_tainted_by_errors(err_count=0, err_count_on_creation=0, tainted_by_e
DEBUG 2018-05-23T19:49:34Z: rustc::infer::outlives::bounds: explicit_outlives_bounds()
DEBUG 2018-05-23T19:49:34Z: rustc::infer: is_tainted_by_errors(err_count=0, err_count_on_creation=0, tainted_by_errors_flag=false)
DEBUG 2018-05-23T19:49:34Z: rustc::infer::lexical_region_resolve: RegionConstraintData: resolve_regions()
DEBUG 2018-05-23T19:49:34Z: rustc::infer::lexical_region_resolve: ----() Start constraint listing (context=DefId(0/0:3 ~ main[317d]::FnLt[0])) ()----
DEBUG 2018-05-23T19:49:34Z: rustc::infer::lexical_region_resolve: ----() End constraint listing (context=DefId(0/0:3 ~ main[317d]::FnLt[0])) ()---
DEBUG 2018-05-23T19:49:34Z: rustc::infer::lexical_region_resolve: ---- # Iteration Expansion1
DEBUG 2018-05-23T19:49:34Z: rustc::infer::lexical_region_resolve: ---- Expansion Complete after 1 iteration(s)
DEBUG 2018-05-23T19:49:34Z: rustc::infer::lexical_region_resolve: collect_var_errors
DEBUG 2018-05-23T19:49:34Z: rustc::infer: is_tainted_by_errors(err_count=0, err_count_on_creation=0, tainted_by_e
Compiling wlancfg v0.1.0 (file:///usr/local/google/home/cramertj/src/fuchsia/garnet/bin/wlancfg)
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:345:21
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
1: std::sys_common::backtrace::print
2: std::panicking::default_hook::{{closure}}
3: std::panicking::default_hook
4: rustc::util::common::panic_hook
5: std::panicking::rust_panic_with_hook
6: std::panicking::continue_panic_fmt
error[E0308]: mismatched types
--> /usr/local/google/home/cramertj/src/fuchsia/garnet/bin/wlancfg/src/client.rs:92:42
|
92 | Ok(connected_state(services, next_req))
| ^^^^^^^^ expected struct `futures::stream::StreamFuture`, found struct `std::mem::PinMut`
|
= note: expected type `futures::stream::StreamFuture<futures::channel::mpsc::UnboundedReceiver<client::ManualRequest>>`
found type `std::mem::PinMut<'_, futures::future::MaybeDone<&mut futures::stream::StreamFuture<futures::channel::mpsc::UnboundedReceiver<client::ManualRequest>>>>`
thread 'main' panicked at 'assertion failed: `(left == right)`
140 async fn connect_to_known_network<'a>(
141 sme: &'a fidl_sme::ClientSmeProxy, ssid: &'a [u8], known_ess: &'a KnownEss,
142 ) -> Result<bool, failure::Error> {
143 let ssid_str = String::from_utf8_lossy(ssid).into_owned();
144 println!("wlancfg: Auto-connecting to '{}'", ssid_str);
145 let connect_txn = start_connect_txn(sme, &ssid, &known_ess.password)?;
146 let r = await!(wait_until_connected(connect_txn))?;
147 match r {
148 fidl_sme::ConnectResultCode::Success => {
149 println!("wlancfg: Auto-connected to '{}'", ssid_str);