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
import java.util.LinkedList; | |
import java.util.stream.Stream; | |
class Scratch { | |
public static void main(String[] args) throws InterruptedException { | |
int rate = Integer.parseInt(args[0]); | |
int maxBucketSize = Integer.parseInt(args[1]); | |
LinkedList<Integer> requestStream = new LinkedList<>(Stream.of(args[2].split(",")) | |
.map(Integer::parseInt) | |
.toList()); |
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
const { series, src, dest } = require('gulp'); | |
const tap = require('gulp-tap'); | |
function helloWorld(cb) { | |
console.log('hello world'); | |
cb(); | |
} | |
function helloWorldPromise() { | |
return new Promise((resolve, reject) => { |
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
const { series, src, dest } = require('gulp'); | |
const tap = require('gulp-tap'); | |
function helloWorld(cb) { | |
console.log('hello world'); | |
cb(); | |
} | |
function helloWorldPromise() { | |
return new Promise((resolve, reject) => { |
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
name: Build & deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: |
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 COMPLETED_TASKS_ENDPOINT = 'https://api.todoist.com/sync/v8/completed/get_all?since=[SINCE]&until=[UNTIL]'; | |
var EMAIL_SUBJECT = 'Todoist Completed Tasks Report for [DATE]'; | |
var MILLIS_PER_DAY = 1000 * 60 * 60 * 24; | |
function main() { | |
var yesterday = getYesterday(); | |
var tasks = getCompletedTasks(yesterday); | |
if (tasks) { | |
processCompletedTasks(tasks, yesterday); |
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
package com.emuneee.tensorandflow | |
import android.graphics.* | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import kotlinx.android.synthetic.main.activity_main.* | |
import android.graphics.Bitmap | |
import com.emuneee.tensorandflow.classifier.Classifier | |
import com.emuneee.tensorandflow.classifier.TFMobileClassifier | |
import com.emuneee.tensorandflow.view.CanvasView |
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
[{ | |
"filename": "1495332407.63.jpg", | |
"is_congested": -1 | |
}, { | |
"filename": "1495332973.66.jpg", | |
"is_congested": -1 | |
}, { | |
"filename": "1495333131.12.jpg", | |
"is_congested": -1 | |
}, { |
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 os import listdir | |
import json | |
files = listdir('./traffic_images') | |
data = [] | |
# loop over the list of files and write it to an array | |
for image_file in files: | |
row = {} | |
row['filename'] = image_file |
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
import sys | |
import urllib | |
import time | |
url = sys.argv[1] | |
directory = sys.argv[2] | |
destination = directory + "/" + str(time.time()) + ".jpg" | |
print 'Saving image from url ', url, ' to ', destination | |
urllib.urlretrieve(url, destination) |
NewerOlder