This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scrapy | |
import os | |
import urllib | |
import thread | |
from scrapy.selector import Selector | |
import cookie | |
class GoodReadsSpider(scrapy.Spider): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |