Skip to content

Instantly share code, notes, and snippets.

Blake Johnson blakejohnson

Block or report user

Report or block blakejohnson

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
@blakejohnson
blakejohnson / my_socketpair.cpp
Created May 12, 2017
asio-based "socketpair" for Win32
View my_socketpair.cpp
#include <iostream>
#include <cstdint>
#include "asio.hpp"
using namespace std;
using asio::ip::tcp;
void my_socketpair(asio::io_service &ios, tcp::socket &s1, tcp::socket &s2) {
// uses a strategy cribbed from Cygwin to mimick a posix socket pair on win32
View keybase.md

Keybase proof

I hereby claim:

  • I am blakejohnson on github.
  • I am blakejohnson (https://keybase.io/blakejohnson) on keybase.
  • I have a public key whose fingerprint is E85E 167F 23D8 E47D 1B9D 7271 C4B4 9D4E 4A9F 7F1F

To claim this, I am signing this object:

@blakejohnson
blakejohnson / DictManager.py
Created Nov 21, 2016
atom/enaml exception issue
View DictManager.py
from atom.api import (Atom, List, ContainerList, Dict, observe, Callable, Typed, Unicode)
import enaml
class DictManager(Atom):
"""
Control - Presenter for a dictionary of items.
i.e. give the ability to add/delete rename items
"""
@blakejohnson
blakejohnson / analysis.ipynb
Created Dec 1, 2014
Basic single-shot analysis
View analysis.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Coupled Duffing oscillators.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blakejohnson
blakejohnson / parseint_preamble.asm
Created Dec 16, 2013
Output of code_native(Base.parseint_preamble, (Bool, String, Int))
View parseint_preamble.asm
.section __TEXT,__text,regular,pure_instructions
Filename: string.jl
Source line: 1442
push RBP
mov RBP, RSP
push R15
push R14
push R13
push R12
push RBX
View test_dgeqrt3_int64.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
extern void dgeqrt3_(long * m, long *n, double * a, long *lda, double *t, long *ldt, long*info);
int main(int argc, char**argv)
{
int in, i;
long n,info=1;
int ct;
@blakejohnson
blakejohnson / compare.ipynb
Created Oct 10, 2013
Thresholding vs Soft-averaging --Marcus, Blake, and Colm
View compare.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View segfault-script.jl
function expm_eigen(A::Matrix, t)
#Calculates expm(t*A) via eigenvalue decomposition and assuming Hermitian matrix
F = eigfact(Hermitian(A))
# V * diagm(exp(t*D)) * V'
return scale(F[:vectors], exp(t*F[:values])) * F[:vectors]'
end
function evolution_unitary(Hnat::Matrix{Complex128}, controlHams::Array{Complex128, 3}, controlFields::Matrix{Float64}, controlFreqs::Vector{Float64})
@blakejohnson
blakejohnson / test1.ipynb
Created Aug 21, 2013
Unresponsive IJulia notebook.
View test1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.