Skip to content

Instantly share code, notes, and snippets.

@allwefantasy
allwefantasy / extractCifar10.py
Created October 15, 2018 07:31 — forked from juliensimon/extractCifar10.py
Extract 10 images from the CIFAR-10 data set
import mxnet as mx
import numpy as np
import cPickle
import cv2
def extractImagesAndLabels(path, file):
f = open(path+file, 'rb')
dict = cPickle.load(f)
images = dict['data']
images = np.reshape(images, (10000, 3, 32, 32))
@allwefantasy
allwefantasy / example.js
Created July 2, 2018 09:29 — forked from jonnyreeves/example.js
Stubbing XHRs in QUnit with SinonJS Fake Server
QUnit.module("my-module",
{
setup: function () {
// Configure Sinon's FakeServer instance. `autoRespond` ensures that any incoming requests
// will automatically be replied to, otherwise you *must* invoke `this.server.respond` to
// start processing.
this.server = sinon.fakeServer.create();
this.server.autoRespond = true;
// Tells the FakeServer's XHR request factory that we don't want to respond to every