This file contains hidden or 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 collections import defaultdict | |
def get_gears_for_ratio(ratio, gears, maxdepth=10): | |
shortestpath = dict() | |
shortestpath[1] = list() | |
expanded = defaultdict(lambda: False) | |
depth = 0 | |
while ratio not in shortestpath.keys(): | |
depth +=1 | |
if depth > 14: |
This file contains hidden or 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 nltk | |
reference = "today I go cycling".split() | |
references = [reference] | |
hypothesis_strings = ["today I go cycling", | |
"today I go biking", | |
"today , I go cycling", | |
"today I go ride my bike", | |
"today I go bicycles", | |
"today I go fietsen", |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266WebServer.h> | |
#include <ESP8266mDNS.h> | |
#include <ESP8266HTTPClient.h> | |
// The WIFI SSID and password you connect to | |
const char* ssid = "XXXXX"; | |
const char* password = "XXXX"; |
This file contains hidden or 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 tensorflow as tf | |
import numpy as np | |
import tempfile | |
import random | |
vocabulary_size = 250 # amount of numbers our algorithm can handle | |
batch_size = 256 | |
length_vector = 10 # length of the sequences we try to sort | |
training_epochs = 10000 |
This file contains hidden or 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 operator # For sorting my dictionary | |
bills = {"Kim":392.08,"Peter":71.81,"Mike":48.09,"Roland":5.91,"Yorick":0.0,"Elvira":-74.37,"Lisette":-103.22,"Robert":-340.30} | |
transactions = 0 | |
while sorted(bills.items(), key=operator.itemgetter(1),reverse=True)[0][1]>0.001: | |
transactions+=1 | |
sorted_bills = sorted(bills.items(), key=operator.itemgetter(1),reverse=True) | |
diff_highest_lowest = sorted_bills[0][1]+sorted_bills[-1][1] # Note that array[-1] is the last element of an array (for us: lowest value) | |
if diff_highest_lowest > 0: # In this case the lowest amount can't fill the highest amount |
This file contains hidden or 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
%% 'Global' variables | |
% Assuming that we are saving the positive instances: | |
filesToSave = positiveInstances; | |
vecFormatName='output_vec.dat' | |
fileID = fopen(vecFormatName,'w'); | |
%% Write each object | |
for i = 1 : length(filesToSave) | |
%% Get data we want to write | |
instance = filesToSave(i); |
This file contains hidden or 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 f():print("xx = 'f';eval('%s()'%(xx))") | |
xx = 'f';eval('%s()'%(xx)) |
This file contains hidden or 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
samenwerken. super gezellig |