This file contains 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
Loading data from 'data/small-train.t7'... | |
* vocabulary size: source = 50004; target = 50004 | |
* additional features: source = 0; target = 0 | |
* maximum sequence length: source = 50; target = 51 | |
* number of training sentences: 100000 | |
* maximum batch size: 64 | |
Building model... | |
* using input feeding | |
Initializing parameters... | |
* number of parameters: 84818004 |
This file contains 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
Loading data from 'data/small-train.t7'... | |
* vocabulary size: source = 50004; target = 50004 | |
* additional features: source = 0; target = 0 | |
* maximum sequence length: source = 50; target = 51 | |
* number of training sentences: 100000 | |
* maximum batch size: 64 | |
Building model... | |
* using input feeding | |
Initializing parameters... | |
* number of parameters: 84834004 |
This file contains 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
Loading data from 'data/small-train.t7'... | |
* vocabulary size: source = 50004; target = 50004 | |
* additional features: source = 0; target = 0 | |
* maximum sequence length: source = 50; target = 51 | |
* number of training sentences: 100000 | |
* maximum batch size: 64 | |
Building model... | |
* using input feeding | |
Initializing parameters... | |
* number of parameters: 84814004 |
This file contains 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> | |
void swap_values_1(int p, int q) { | |
printf("where are the local variables in this function allocated? p: %p, q: %p\n", &p, &q); | |
int tmp = q; | |
q = p; | |
p = tmp; | |
} | |
void swap_values_2(int *m, int *n) { |
This file contains 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 h5py | |
import numpy as np | |
import random | |
import re | |
import pickle | |
import pdb | |
from sklearn.utils import resample | |
# from process_data.py | |
def clean_str(string, TREC=False): |
This file contains 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
angular.module('index.controllers', []) | |
.controller('Ctrl', ['$scope', '$http', 'Service', function($scope, $http, Service){ | |
}]); | |
angular.module('index.services') | |
.factory('Service', [function(){ | |
var Service = { | |
stuff: 'here' | |
}; |
This file contains 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 | |
class WordUnit(scrapy.Item): | |
# define the fields for your item here like: | |
# name = scrapy.Field() | |
name = scrapy.Field() | |
link = scrapy.Field() | |
small_desc = scrapy.Field() | |
desc = scrapy.Field() | |
words = scrapy.Field() |
This file contains 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
class vector(list): | |
pass | |
def wrap(attr): | |
def wrapped(a, b): | |
return vector(map(lambda x, y: getattr(x, attr)(y), a, b)) | |
return wrapped | |
for attr in "__add__ __sub__ __mul__ __div__".split(): | |
setattr(vector, attr, wrap(attr)) |
This file contains 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
function executeScript(){ | |
var no = {}; // list of excluded users | |
re = new RegExp("[4][\:|\.|\)|\-][^1-9]"); | |
function findmatches(response){ | |
flag = true; | |
if (response.data.length < 2){ // empty response, sort of | |
flag = false; | |
} | |
if(flag){ | |
response.data.forEach(function(post){ |
This file contains 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
class Queue(): | |
def __init__(self): | |
self.elementarray = [0] * 25 # initialize to 25 0s for now (basically) empty | |
self.head = 0 | |
self.tail = 0 | |
def push(self, element): | |
self.elementarray[self.tail] = element # basically set the tail'th element to be 'element' | |
self.tail += 1 # shift the tail number | |