Skip to content

Instantly share code, notes, and snippets.

def shuffle_in_unison(a, b):
assert len(a) == len(b)
shuffled_a = np.empty(a.shape, dtype=a.dtype)
shuffled_b = np.empty(b.shape, dtype=b.dtype)
permutation = np.random.permutation(len(a))
for old_index, new_index in enumerate(permutation):
shuffled_a[new_index] = a[old_index]
shuffled_b[new_index] = b[old_index]
return shuffled_a, shuffled_b
import scrapy
import os
import urllib
import thread
from scrapy.selector import Selector
import cookie
class GoodReadsSpider(scrapy.Spider):
int arraySize;
int totalBitsUsed;
unsigned int* generateBitArray(FILE *file){
char currentChar ;
char buffer[256];
int currentSize = 1;
unsigned int *bitArray = malloc(sizeof(unsigned int)*currentSize);
int usedElements = 0;
int index = currentSize-1;
#include<stdio.h>
#include<string.h>
#include<stdbool.h>
#include<stdlib.h>
#include"HeapDT.h"
#include"Tree.h"
#define tableSize 256
unsigned int freqList [tableSize];
FILE *input = fopen(argv[1],"rb");
FILE *output;
unsigned short header =0;
fread(&header,1,sizeof(unsigned short),input);
if(header == magicNumber){
rewind(input);
if(argc==3 && argv[2][0]!='-'){
output=fopen(argv[3],"w");
handleDecode(input,output);
31131122211311123113322110 : three ones. one three. one one. two twos.
two ones. one three. one one. one two. three ones. one three. three twos.
two ones. one zero.
#define _BSD_SOURCE
#include <time.h>
#include <string.h>
#include "racer.h"
#include "display.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
long maxSpeedDelay ;
#!/usr/bin/env node
/**
* Module dependencies.
*/
let app = require('../app');
let debug = require('debug')('maroon-lab-node:server');
let http = require('http');
let io = require('socket.io')(http);
/**
* Created by harshvardhangupta on 07/01/17.
*/
let chai = require('chai');
let chaiHttp = require('chai-http');
let server = require('../../bin/www');
let group = require('../../core/group/model');
let Joi = require('joi');
global.__base = __dirname + '/';
let express = require('express');
let path = require('path');
let favicon = require('serve-favicon');
let logger = require('morgan');
let cookieParser = require('cookie-parser');
let bodyParser = require('body-parser');
let validator = require('express-validator');
let index = require('./routes/index');