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
[tool.poetry] | |
name = "private-package-b" | |
version = "0.0.0" | |
description = "" | |
[tool.poetry.dependencies] | |
private-package-a = { version = "*", source = "source-a" } | |
[[tool.poetry.source]] | |
name = "source-a" |
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
from __future__ import absolute_import | |
import rules | |
from employee.rules import is_project_owner, is_director, is_g3, is_g4, is_bp, is_user, is_team_leader, is_division_manager, is_superuser, is_employee | |
from .models import Document, Project | |
from django.db.models import Q | |
from django.core.cache import cache | |
import json | |
def has_perm_projects(user__id): |
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
#!/usr/bin/env python | |
import sys | |
from collections import Counter | |
import re | |
from blessings import Terminal | |
term = Terminal() | |
def show(counter): | |
with term.fullscreen(): |
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
from pyspark import SparkContext | |
logFile = "gs://tagtoo-track-log/log2bq-2014120100*" | |
sc = SparkContext() | |
logData = sc.textFile(logFile).cache() | |
print logData.count(), logData.first() |
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 mapper(row, emit) { | |
if(row.comment) { | |
keywords = row.comment.split(' '); | |
for(var i=0; i<keywords.length; i++) { | |
emit({keyword: keywords[i], count: 1}); | |
} | |
} | |
} | |
function reducer(row, emit) { |
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
def c(n, r): | |
print n, r | |
if r == 1: return n | |
if n == r: return 1 | |
return c(n-1, r) + c(n-1, r-1) | |
# can compute it on time | |
print c(5, 2) |
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
$('.link').on({ | |
click: function(e) { | |
e.stopPropagation(); | |
var id = $(this).parents('.item')[0].id; | |
id = parseInt(id.replace('item-', '')); | |
Ad.click(data[id]['url']); | |
} | |
}); |
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
Ad.statemachine = StateMachine.create({ | |
initial: 'Slideshow', | |
error: function() {}, | |
events: [{ | |
name: 'Slideshow', | |
from: 'Detail', | |
to: 'Slideshow' | |
}, { | |
name: 'Slideshow', | |
from: 'Highlight', |
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
var SlideShow = function(objs, option) { | |
/* | |
objs, the element to do the slide | |
*/ | |
var index = 0; | |
var page_size = option.page_size; | |
var interval = option.interval || 1000; | |
var fade_time = option.fade_time || 300; | |
var timeout = option.timeout || 30000; |
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
store = {} | |
def g(w, h, odd=True): | |
if w <= 0 or h <= 0: | |
if odd: return 0 | |
return 1 | |
if not odd: | |
return (h+1)**w - g(w, h) |
NewerOlder