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 parse_command(): | |
| from sys import stdin as f | |
| n_tests = int(f.readline().strip()) | |
| test_num = 0 | |
| while test_num < n_tests: | |
| n_cities = int(f.readline().strip()) | |
| cities = [int(x) for x in f.readline().strip().split()] | |
| W = [] | |
| for _ in range(n_cities): | |
| line = [float("inf") if int(x) == -1 else int(x) for x in f.readline().strip().split()] |
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 parse_command(): | |
| from sys import stdin as f | |
| n_tests = int(f.readline().strip()) | |
| test_num = 0 | |
| while test_num < n_tests: | |
| n_cities = int(f.readline().strip()) | |
| cities = [int(x) for x in f.readline().strip().split()] | |
| W = [] | |
| for _ in range(n_cities): | |
| line = [float("inf") if int(x) == -1 else int(x) for x in f.readline().strip().split()] |
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 math | |
| from math import cos, sin | |
| #### DEFINE THE mass, length and gravitational constant ##### | |
| #playing around with the gravity constant and mass ratios might cause a resonant system, which is pretty cool | |
| m1,m2 = 2,1 | |
| L1,L2 = 1,2 | |
| g = 9.81 | |
| ######## |
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
| /* | |
| * ADC version 1.0.c | |
| * | |
| * Created: 23.01.2016 21:02:13 | |
| * Author : Daniel | |
| */ | |
| #include <avr/io.h> | |
| #include <ctype.h> | |
| #include "SPI.h" |
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 multiprocessing.managers import BaseManager | |
| class QueueManager(BaseManager): pass | |
| QueueManager.register('get_queue') | |
| m = QueueManager(address=('78.91.11.26', 50000), authkey='lol') | |
| m.connect() | |
| queue = m.get_queue() | |
| queue.put('hello') | |
| queue.put("yes") | |
| print(queue.qsize()) | |
| print(queue.get(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
| from multiprocessing.managers import BaseManager | |
| class QueueManager(BaseManager): pass | |
| QueueManager.register('get_queue') | |
| m = QueueManager(address=('78.91.11.26', 50000), authkey='lol') | |
| m.connect() | |
| queue = m.get_queue() | |
| while True: | |
| i = raw_input("write GET or WRITE") | |
| if i.lower() == "write": | |
| text = raw_input("text: ") |
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 socket import * | |
| s = socket(AF_INET, SOCK_DGRAM) | |
| s.sendto("hello",("78.91.11.26",60770)) |
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
| int main(void) | |
| { | |
| LED_1_init(); | |
| LED_2_init(); | |
| LED_3_init(); | |
| atmega_init(); | |
| cli(); |
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
| // New interface | |
| enum RegisterGroup { CONFIG, CELLA, CELLB, CELLC, AUXA, AUXB, STATA, STATB }; | |
| struct configRegisterStruct | |
| { | |
| bool refon; | |
| bool adcModeOpt; | |
| uint16_t underVoltageMonitoringEnable_bm; | |
| uint16_t overVoltageMonitoringEnable_bm; |
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
| enum ltc6804_RegisterGroup | |
| { | |
| RegisterGroup_CONFIG, | |
| RegisterGroup_CELLA, | |
| RegisterGroup_CELLB, | |
| RegisterGroup_CELLC, | |
| RegisterGroup_CELLD, | |
| ReigsterGroup_AUXA, | |
| RegisterGroup_AUXB, |