Skip to content

Instantly share code, notes, and snippets.

Lindsey Kuper lkuper

Block or report user

Report or block lkuper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:8789334
%====Set up Listings===============================================================
\definecolor{darkgreen}{rgb}{0,0.5,0}
\definecolor{darkred}{rgb}{0.5,0,0}
\lstloadlanguages{Haskell}
\lstnewenvironment{code}
{ % \centering
\lstset{}%
\csname lst@SetFirstLabel\endcsname}
{ %\centering
View gist:9589829
#[lang="strdup_uniq"]
#[cfg(not(test))]
#[allow(missing_doc)]
#[inline]
pub unsafe fn strdup_uniq(ptr: *u8, len: uint) -> ~str {
from_buf_len(ptr, len)
}
View gist:9701594
### Keybase proof
I hereby claim:
* I am lkuper on github.
* I am lindsey (https://keybase.io/lindsey) on keybase.
* I have a public key whose fingerprint is 6832 D0DB 85DB 2D9A 10DC B4B9 DF53 470B 4C78 460C
To claim this, I am signing this object:
View gist:5f9e55e8bb72a80a81e5
<lkuper> is it equivalent to say that a function is invertible and that it's a bijection?
<shachaf> Yes.
<lkuper> ok :)
<shachaf> But you have to be careful if you have "functions" between more complicated structures.
<shachaf> In which case there might be more requirements on the inverse. But not with plain old functions.
<lkuper> ah. by ""functions" between more complicated structures", do you mean, like, some other kind of morphism?
<lkuper> (I'm dealing with plain old functions here, but curious)
<shachaf> Right.
<shachaf> E.g. you might care that the inverse of a continuous function is continuous, or something.
<lkuper> I see. so, maybe another way to say this is that, when dealing with sets, it turns out bijectivity and invertibility coincide, but invertibility is a more general concept and applies to fancier kinds of objects too
@lkuper
lkuper / peter-alvaro-halpern-pwl-notes.md
Last active Aug 29, 2015
Notes from Peter Alvaro's talk at PWL, August 21, 2014
View peter-alvaro-halpern-pwl-notes.md

"Consensus is impossible" is a gloss for "there's always an execution that doesn't terminate".

Once you've internalized that you can't distinguish slow nodes from dead nodes, how do you deal with that?

"When you're engaged in a battle of wits with a Sicilian and death is on the line, you certainly need to think about epistemic logic."

A correct distributed program achieves (nontrivial) distributed property X. So we need to ask:

  1. is X even attainable?
  2. what's the cheapest* protocol that gets me X? (* according to some cost metric)
View bootstrap.js
Components.utils.import('resource://gre/modules/Services.jsm');
// Code that listens for a custom DOM event. This is how we
// implement communication between unprivileged (web page) and
// privileged (extension) JS code.
function load(win) {
let document = win.document;
document.addEventListener("TestExtensionCustomEvent", function(e) {
win.alert("Hello from privileged code! Event received!");
}, false, true);
View gist:1004f2345aab65d6386c
repos $ mkdir tmp
repos $ cd tmp/
tmp $ cabal sandbox init
Writing a default package environment file to
/Users/lkuper/repos/tmp/cabal.sandbox.config
Creating a new sandbox at /Users/lkuper/repos/tmp/.cabal-sandbox
tmp $ cabal install ~/repos/lvars/haskell/lvish/
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: lvish-2.0 (user goal)
View bootstrap.js
Components.utils.import('resource://gre/modules/Services.jsm');
function myObserver()
{
this.register();
}
myObserver.prototype = {
observe: function(subject, topic, data) {
console.log("observed: " + subject);
View gist:29fab36b954acbf56d9c
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
import Control.Concurrent (threadDelay)
import Control.LVish
import Control.LVish.DeepFrz
import Control.LVish.Internal (liftIO)
import Data.LVar.IVar
import Data.LVar.Counter
import Data.Word
View gist:92eaf7d7db11700977a1
// Extension-side code
let AnObj = {
field: "hello",
thisIsATest: function() {
let str = this.field + " world!";
return str;
},
};
You can’t perform that action at this time.