- welcome everyone!
- we have a code of conduct
- thanks to organisers, sponsors, etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi {{ Recruiter_first_name }}, | |
Thanks for reaching out. Before we jump on a call, can you answer a few questions for me. | |
1. What is the current on-call like for the team? | |
2. How much on-call is expected for this role? | |
3. Expected Base comp range? | |
4. What are the expected {{ your_tz }} work hours? | |
5. How big is the team? | |
Please also send over a FULL job description. | |
Thanks in advance, | |
{{ Your First name here }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(foreign) ## for data import | |
library(dplyr) ## for chaining ops together | |
library(ggplot2) ## for plotting | |
library(reshape2) ## for reshaping | |
library(hrbrthemes) ## for pretty pictures | |
library(survey) ## for... uh, survey data | |
party.colours <- c("#0087DC","#D50000","#FDBB30","#FFFF00","#008142","#99CC33","#70147A","#DDDDDD") | |
bes <- read.spss("~/Dropbox/2017-forecasting/data/individual/BES2015_W10_Panel_v0.3.sav") |
On the tokio chat, @carllerche suggested that one way to simplify the "errors on streams" problem (rust-lang/futures-rs#206) would be to remove the error alternative from Future
& Stream
. This idea stuck with me, and I want to sketch out a possible alternative, to see how it would look.
Future<Item, Error>
: A future resolves to either an item or an error type, exactly like an async version ofResult
.poll() -> Poll<Item, Error>
: not ready, or an item, or an error
Stream<Item, Error>
: A stream emits elements that are each either an item or error, exactly like an async iterable ofResult
.poll() -> Poll<Option<Item>, Error>
: not ready, or the end of the stream (Ready(None)
), or an item, or an error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate futures; | |
extern crate tokio_core; | |
extern crate tokio_line; | |
use futures::future::{self, Future, Loop}; | |
use futures::{Stream}; | |
use std::{io, str}; | |
use tokio_core::io::{Io}; | |
use tokio_core::net::{TcpStream}; | |
use tokio_core::reactor::{Core, Handle}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate futures; | |
use std::sync::atomic::{AtomicBool, Ordering}; | |
use std::thread; | |
use std::sync::Arc; | |
use std::time::{Instant, Duration}; | |
use futures::{Async, Future}; | |
use futures::executor::{self, Spawn}; | |
use futures::task::Unpark; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import operator | |
import functools | |
import unittest | |
import random | |
class LFSR(): | |
def __init__(self, width, taps=None, seed=1): | |
if width < 1: | |
raise ValueError("Requested LFSR width < 1.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// This type is only every inhabited when S is nominally equivalent to T | |
#[derive(Debug)] | |
pub struct Is<S, T>(::std::marker::PhantomData<(*const S, *const T)>); | |
// Construct a proof of the fact that a type is nominally equivalent | |
// to itself. | |
pub fn is<T>() -> Is<T, T> { Is(::std::marker::PhantomData) } | |
// std::mem::transmute does not accept unsubstituted type parameters | |
// manual transmute as suggested by manual |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::rc::Rc; | |
trait HKT<U> { | |
type C; // Current type | |
type T; // Type with C swapped with U | |
} | |
macro_rules! derive_hkt { | |
($t:ident) => { | |
impl<T, U> HKT<U> for $t<T> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
# ALPHAC encryption method | |
# From http://www.myersdaily.org/joseph/javascript/alphac.html | |
# This a much cleaner Python reimplementation for Cryptanalysis. | |
class Alphac: | |
c64 = list("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/") | |
# s = input string (only characters in c64) | |
# k = key string (only characters in c64) |
NewerOlder