Skip to content

Instantly share code, notes, and snippets.

View cjauvin's full-sized avatar

Christian Jauvin cjauvin

View GitHub Profile
ad_source_id = 0
cs = [('ad_image_domain', imp['ac_bannerhost']),
('iframe_domain', data_rec['iframe_domain']),
('ad_image_linked_domain', imp['ac_clickhost'])]
cs += [('iframe_domain', iframe_dom)
for iframe_dom, _, _ in iframe_stack]
for company_table, company_value in cs:
q = """select company from {}
# iframe_stack: list of iframe_data's
# iframe_data: iframe_domain + list of js_domain's
iframe_stack = []
for iframe_url, js_urls in impression['ac_iframedata']:
iframe_domain = select_or_insert_id('domain', get_domain(iframe_url))
js_domains = [select_or_insert_id('domain', get_domain(js_url)) for js_url in js_urls]
iframe_stack.append((iframe_domain, js_domains))
iframe_datas = []
{
"metadata": {
"name": "",
"signature": "sha256:ef7ca5a14e7a01867f1d77880a532e12f70a22d5dc580b53ccfce1ba360ba3d1"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
from __future__ import division, print_function
from string import maketrans
import re
def thue_morse(n):
comp = maketrans('01', '10')
s = '0'
for _ in range(n):
s += s.translate(comp)
from joblib import Parallel, delayed
import numpy as np
N = 1000
def big_fucking_computation(dir):
# do something with dir..
# this should take some time..
return np.random.random((784, N))
{
"metadata": {
"name": "",
"signature": "sha256:d82c6f4443637d378cccfa9275c1931d1f275b7f69d91ed29aadd8575137b2b8"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"metadata": {
"name": "",
"signature": "sha256:5d88cc5ee3abf75f4705adfae917ca4a4fa214cbf4a09025e81166a248935557"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@cjauvin
cjauvin / PCA.ipynb
Last active February 5, 2016 03:23
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "",
"signature": "sha256:bcfe4b55e6d42f5d9dd5325fa546124ae29654f445f6805cead751ae32059a8d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"metadata": {
"name": "",
"signature": "sha256:170c46784f3e0b997ceb3c3357bbe718d35d1f97cc2c321d191cd11d3758ea2a"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [