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 time | |
| def main(): | |
| limits = [10, 20, 30] | |
| total = 0 | |
| for i, num in enumerate(limits): | |
| file1 = open('file.txt', 'a+') |
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 random | |
| while True: | |
| response = input() | |
| if response == "End": | |
| break | |
| num = random.randint(0,int(response)) | |
| print(num) |
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 solution(n, arr): | |
| dict_free = {"J": [0,0], | |
| "C": [0,0] | |
| } | |
| arr = [[x,i,""] for i,x in enumerate(arr)] | |
| arr = sorted(arr, key= lambda x:x[0][0]) | |
| for time in arr: | |
| if time[0][0] >= dict_free["J"][1] or time[0][1] <= dict_free["J"][0]: | |
| dict_free["J"] = [time[0][0],time[0][1]] |
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 solution(n): | |
| ans = "" | |
| ans += "(" * n[0] | |
| for i in range(len(n)-1): | |
| ans += str(n[i]) | |
| diff = n[i] - n[i+1] | |
| if diff < 0: | |
| ans += "("*abs(diff) | |
| elif diff > 0: | |
| ans += ")"*abs(diff) |
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 solution(n, arr): | |
| k = r = c = 0 | |
| for i in range(n): | |
| if len(arr[i]) != len(set(arr[i])): | |
| r += 1 | |
| if len([x[i] for x in arr]) != len(set([x[i] for x in arr])): | |
| c+=1 | |
| k+=arr[i][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
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| import numpy as np | |
| from mpl_toolkits.axes_grid1 import make_axes_locatable | |
| from sklearn.cluster import KMeans | |
| from sklearn.metrics import mean_squared_error | |
| import itertools | |
| from sklearn.metrics import silhouette_samples, silhouette_score | |
| def draw_scatterplot(x_data, x_label, y_data, y_label): |
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
| try: | |
| clouds = dict['list'][i]['clouds']['all'] | |
| except KeyError: | |
| clouds = 0 |
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
| ''' | |
| converts a csv file into a JSON file for all reports, giving latest gen output | |
| ''' | |
| import json | |
| import pandas as pd | |
| import numpy as np | |
| from datetime import datetime as dt | |
| ''' |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dt$ | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.demo.dashboard.plist</string> | |
| <key>ProgramArguments</key> | |
| <string>/path/to/working/directory/python/test.py</string> | |
| <key>KeepAlive</key> | |
| <true/> |
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
| $(function() { | |
| $.getJSON("./data/interconnector.json", function(data) { | |
| var french = [], | |
| irish = [], | |
| dutch = [], | |
| e_w = [], | |
| time = [], | |
| newTime = [] | |
| i = 0; |
NewerOlder