Skip to content

Instantly share code, notes, and snippets.

import scrapy
import os
import urllib
import thread
from scrapy.selector import Selector
import cookie
class GoodReadsSpider(scrapy.Spider):
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
BASEURL =
categories = {
"art&photography":"https://www.amazon.com/s/ref=sr_pg_2?fst=as%3Aoff&rh=n%3A283155%2Cn%3A%211000%2Cn%3A1&page=PAGENUM&bbn=1000&sort=featured-rank&ie=UTF8&qid=1479879286",
"Biographies & Memoirs":"https://www.amazon.com/s/ref=sr_pg_2?fst=as%3Aoff&rh=n%3A283155%2Cn%3A%211000%2Cn%3A2&page=PAGENUM&bbn=1000&sort=featured-rank&ie=UTF8&qid=1479879374",
"Business & Money":"https://www.amazon.com/s/ref=sr_pg_3?fst=as%3Aoff&rh=n%3A283155%2Cn%3A%211000%2Cn%3A3&page=PAGENUM&bbn=1000&sort=featured-rank&ie=UTF8&qid=1479879412",
*** ../../hw7.2161/stdout.1 2016-11-10 17:17:37.000000000 -0500
--- out.1 2016-11-17 17:38:58.788292167 -0500
***************
*** 16,20 ****
set1 set_cardinality: 4
set2 set_cardinality: 4
! members of set1: 'Helo'
! members of set2: 'Tehr'
--- 16,20 ----
from random import random, choice
import matplotlib.pyplot as plt
import numpy as np
import timeit
def empty_state():
'''establish the empty wherein each cell is filled by zero'''
return [[0] * 3] * 3
==2783== 1,200 bytes in 50 blocks are still reachable in loss record 1 of 1
==2783== at 0x402A5E6: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2783== by 0x80488ED: new_emp (emp.c:142)
==2783== by 0x80487E1: add_employee (emp.c:65)
==2783== by 0x8048B02: load_employees (emp.c:280)
==2783== by 0x8048708: main (rpt.c:23)
+ Today's discount is 91.00%.$
+ Customer: Zoran$
+ >-----List $>-Sale $$
+ >-----$ 39.95 $ 3.60$
+ >-----$ 27.49 $ 2.47$
+ >-----$ 72.79 $ 6.55$
+ >-----$ 127.89 $ 11.51$
+ >-----$ 89.29 $ 8.04$
+ >-----$ 100.00 $ 9.00$
+ Total: $41.17. Savings: $416.24.$
basicShop.c:7:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
int main(int argc,char *argv[]){
^
gcc -ggdb -std=c99 -Wall -Wextra -pedantic -c shop_utils.c
gcc -ggdb -std=c99 -Wall -Wextra -pedantic -o basicShop basicShop.o shop_utils.o -lm
Test 1: basicShop .10 < input.1
Test 2: basicShop .10 < input.2
Differences in your standard output:
*** ../../hw2/stdout-1.2 2016-08-31 16:55:11.000000000 -0400
--- out.2 2016-09-07 23:27:30.107136409 -0400
private function startWampServer()
{
$loop = \React\EventLoop\Factory::create();
// $class = $this->option('class');
// $ratchetServer = new $class($this);
// $this->info(sprintf('Starting ZMQ server on: %s:%s', config('ratchet.zmq.host'), config('ratchet.zmq.port')));
NSData *data = [message dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSLog(@"THIS IS IT %@", [json valueForKey:@"message_create"]);
id jsonBody = [json valueForKey:@"message_create"];
if ([Chat fetchById:[jsonBody valueForKey:@"id"] withContext:self.managedObjectContext]==nil) {
NSLog(@"GOT NIL FROM SOCKET");
Chat *chat = [Chat initWithContext:self.managedObjectContext];