Skip to content

Instantly share code, notes, and snippets.

View udoprog's full-sized avatar

John-John Tedro udoprog

View GitHub Profile
heap:
.Lfunc_begin2:
.loc 1 21 0
.cfi_startproc
.cfi_personality 155, DW.ref.rust_eh_personality
.cfi_lsda 27, .Lexception0
pushq %rbp
.Lcfi6:
.cfi_def_cfa_offset 16
.Lcfi7:
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import fetch_mldata
mnist = fetch_mldata("MNIST original")
def plot_images(datas, titles):
fig, axes = plt.subplots(4, int(len(datas) / 4))
fig.set_size_inches((10, 10))
extern crate ws;
use std::sync::Arc;
use std::sync::Mutex;
use std::collections::HashMap;
use ws::*;
use ws::util::Token;
type Connections = Arc<Mutex<HashMap<Token, Arc<Mutex<Client>>>>>;
.PHONY: all
all:
gcc -ljack jack_status.c -o jack_status
import datetime
import sys
import json
def printThrown(thrown):
if 'message' in thrown:
print " {name}: {message}".format(**thrown)
else:
print " {name}".format(**thrown)
@udoprog
udoprog / Main.java
Last active October 18, 2016 13:29
Case where non-final is OK
public class Main {
public static void main(String[] argv) throws Exception {
Exception e = null;
try {
doSomething();
} catch(final Exception inner) {
e = inner;
}
from multiprocessing import Pool
from gcloud.exceptions import Conflict
from gcloud import datastore
import random
import traceback
import os
import uuid
import time
import sys
@udoprog
udoprog / out.txt
Last active February 25, 2016 16:50
Failing enum-based API Blueprint
{ code: 1,
message: 'parser exception: \'mismatched adapter and node type\'',
location: [] }
@udoprog
udoprog / startup.sh
Created February 12, 2016 16:58
HeroicShell Startup Time
$ time tools/heroic-shell -P memory <<< exit
17:58:24.238 [main] INFO com.spotify.heroic.HeroicShell - Starting local Heroic...
17:58:24.239 [main] INFO com.spotify.heroic.HeroicCore - Building Loading Injector
17:58:24.355 [main] INFO com.spotify.heroic.HeroicCore - Loaded 19 module(s)
17:58:24.360 [main] INFO com.spotify.heroic.HeroicCore - Loading profile 'Configures in-memory backends for everything (useful for integration/performance testing)' (params: ExtraParameters(parameters={}))
17:58:24.393 [main] INFO com.spotify.heroic.HeroicCore - Building Primary Injector
17:58:24.442 [main] INFO com.spotify.heroic.HeroicCore - Starting life cycles
17:58:24.444 [main] INFO com.spotify.heroic.HeroicCore - Started all life cycles
17:58:24.447 [main] INFO com.spotify.heroic.CoreHeroicLifeCycle - startup Core Future Resolver
17:58:24.448 [main] INFO com.spotify.heroic.cluster.CoreClusterManager - No discovery mechanism configured, using local node
public class SerializerTest {
public abstract class SerializerBase<T extends SomeType> implements Serializer<T> {
private final Serializer<Integer> number;
public SerializerBase(final SerializerFramework s) {
this.number = s.fixedInteger();
}
@Override
public void serialize(SerialWriter buffer, T value) throws IOException {