I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
def chop(matrix, box, direction, results=None): | |
if results is None: | |
results = [] | |
x1, y1, x2, y2 = box | |
w = x2 - x1 + 1 | |
h = y2 - y1 + 1 | |
if w <= 0 or h <= 0: | |
return results | |
else: | |
if direction == 0: |
import time | |
from collections import deque | |
def throttled_call(func, args=(), kwargs={}, threshold_per_minute=60): | |
"""Throttling the function call with ``threshold_per_minute`` calls per minute. | |
This is useful when the function request a remote service that having throttling policy. | |
We must honor the throttling, otherwise we will be banned. | |
:param func: the function to be called |
seeing this puzzle in glowing's jobs page
https://glowing.com/jobs/mobiledeveloper#mtop
here's my solution
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:f7fc0e66200bb5a9cae8e5e59abfaa99691caa881252e9266f11e7cffc7dafe6" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
! function (t) { | |
if ("object" == typeof exports && "undefined" != typeof module) module.exports = t(); | |
else if ("function" == typeof define && define.amd) define([], t); | |
else { | |
("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).buffer = t() | |
} | |
}(function () { | |
return function () { | |
return function t(r, e, n) { | |
function i(f, u) { |
[ | |
{ | |
"label": "内网网关地址", | |
"name": "gateway", | |
"value": "10.86.30.1" | |
}, | |
{ | |
"label": "上班打卡时间范围", | |
"name": "clockInRange", | |
"value": "07:00-11:00" |