Use JavaScript for Automation to rename files in batch!
#!/usr/bin/env python | |
# This example shows how to use multiprocessing with an initializer function. | |
# We take advantage of that to make the workers each have a custom initial | |
# load. And in particular example, we will make the workers sleep. | |
# Because we make them sleep different amounts, one of them is going to be | |
# ready much before the others, and thus we can guess easily which worker | |
# will do most of the work. | |
# | |
# see https://stackoverflow.com/questions/26693797/python-multiprocessing-process-number |
session = get_session('tempo-iq-backend-url', key, secret) | |
start_time = datetime.datetime(2014,1,1,0,0,0,0) | |
end_time = datetime.datetime(2014,1,2,0,0,0,0) | |
results = session.query(Device) | |
.filter(Device[‘building’] == 1) | |
.filter(Sensor.key == “temp”) | |
.interpolate(“linear”, “PT15M”) | |
.aggregate(“avg”) |
#include <iostream> | |
#include <string> | |
using namespace std; | |
void function(string var, int flag); | |
int main(){ | |
function(R"!( | |
#include <iostream> |
On July 22, Github announced the 3rd Annual Github Data Challenge presenting multiple sources of data available.
This sounded to me a good opportunity to use their available data and import it in Neo4j in order to have a lot of fun at analyzing the data that fits naturally in a graph.
As I work mainly offline or behind military proxies that do not permit me to use the ReST API, I decided to go for the Github Archive available here, you can then download json files representing Github Events on a daily/hour basis.
import itertools | |
import string | |
import re | |
class PhraseMatcher(object): | |
ACTIONS = [] | |
WORDS = {} | |
@classmethod | |
def get_possible_phrases(cls): | |
# Sample implementation, there might be a better one |
// | |
// Swift-KVO | |
// | |
// Created by Jim Correia on 6/5/14. | |
// Copyright (c) 2014-2015 Jim Correia. All rights reserved. | |
// | |
// Update: 6/17/2014 | |
// | |
// KVOContext has gone away; use the same idiom you'd use from Objective-C for the context | |
// |
This is part of a series of examples that describe the basic operation of the D3.js force layout. Eventually they may end up in a blog post that wraps everything together. If you missed the beginning of the series, here's a link to first example.
The previous example
shows how linkDistance
tells the force layout the desired distance
between connected nodes. It may seem strange that D3 doesn't simply
compel all links to be that distance. The force layout, however, takes
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\