content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
file1 = open('/home/student/.ros/log/a13f3d8c-1369-11eb-a6ad-08002707b8e3/rosout.log','r') file2 = open('/home/student/CarND-Capstone/imgs/Train_Imgs/Train_data.txt','w') count=1 while True: line = file1.readline() if not line: break # if line.split(' ')[2][1:7]=='tl_det': sep_line = line.split(' ') if len(s...
file1 = open('/home/student/.ros/log/a13f3d8c-1369-11eb-a6ad-08002707b8e3/rosout.log', 'r') file2 = open('/home/student/CarND-Capstone/imgs/Train_Imgs/Train_data.txt', 'w') count = 1 while True: line = file1.readline() if not line: break sep_line = line.split(' ') if len(sep_line) > 2 and sep_li...
def kebab_to_snake_case(json): if isinstance(json, dict): return kebab_to_snake_case_dict(json) if isinstance(json, list): new_json = [] for d in json: if isinstance(d, dict): new_json.append(kebab_to_snake_case_dict) return json def kebab_to_snake_case_...
def kebab_to_snake_case(json): if isinstance(json, dict): return kebab_to_snake_case_dict(json) if isinstance(json, list): new_json = [] for d in json: if isinstance(d, dict): new_json.append(kebab_to_snake_case_dict) return json def kebab_to_snake_case_d...
class InterMolError(Exception): """""" class MultipleValidationErrors(InterMolError): """""" def __str__(self): return '\n\n{0}\n\n'.format('\n'.join(self.args)) class ConversionError(InterMolError): """""" def __init__(self, could_not_convert, engine): Exception.__init__(self) ...
class Intermolerror(Exception): """""" class Multiplevalidationerrors(InterMolError): """""" def __str__(self): return '\n\n{0}\n\n'.format('\n'.join(self.args)) class Conversionerror(InterMolError): """""" def __init__(self, could_not_convert, engine): Exception.__init__(self) ...
#Every true traveler must know how to do 3 things: fix the fire, find the water and extract useful information #from the nature around him. Programming won't help you with the fire and water, but when it comes to the #information extraction - it might be just the thing you need. #Your task is to find the angle of the...
def sun_angle(hora): hora = hora.split(':') lista = [] for c in hora: c = int(c) lista.append(c) if 6 <= int(lista[0]) < 18: angulo = (lista[0] - 6) * 15 + lista[1] * 0.25 elif lista[0] == 18 and lista[1] == 0: angulo = (lista[0] - 6) * 15 + lista[1] * 0.25 else: ...
class Lightbulb: def __init__(self): self.state = "off" def change_state(self): if self.state == "off": self.state = "on" print("Turning the light on") else: self.state = "off" print("Turning the light off")
class Lightbulb: def __init__(self): self.state = 'off' def change_state(self): if self.state == 'off': self.state = 'on' print('Turning the light on') else: self.state = 'off' print('Turning the light off')
# Enable standard authentication functionality for this application def user(): return dict(form=auth()) def index(): return dict() def login(): form = auth.login(next=URL(a='loginexample', c='default',f='gallery')) form.custom.widget.email['_class'] = 'form-control my-3 bg-light' form.custom.wi...
def user(): return dict(form=auth()) def index(): return dict() def login(): form = auth.login(next=url(a='loginexample', c='default', f='gallery')) form.custom.widget.email['_class'] = 'form-control my-3 bg-light' form.custom.widget.email['_placeholder'] = 'Email' form.custom.widget.password[...
class Solution(object): def coinChange(self, coins, amount): """ :type coins: List[int] :type amount: int :rtype: int """ """ definition: dp[i] means min coins to achieve total i result: return dp[amount] assume the initial would be inf ...
class Solution(object): def coin_change(self, coins, amount): """ :type coins: List[int] :type amount: int :rtype: int """ '\n definition: dp[i] means min coins to achieve total i\n result: return dp[amount]\n assume the initial would be inf \n ...
# Space: O(1) # Time: O(n) # recursive approach # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def swapPairs(self, head): if head is None or head.next is None: return head...
class Solution: def swap_pairs(self, head): if head is None or head.next is None: return head first_node = head second_node = head.next first_node.next = self.swapPairs(head.next.next) second_node.next = first_node return second_node
""" Interface for Controllers functionality described in ps4.py ord xbox.py """ class IController: def start(self): raise NotImplementedError def getActions(self): raise NotImplementedError
""" Interface for Controllers functionality described in ps4.py ord xbox.py """ class Icontroller: def start(self): raise NotImplementedError def get_actions(self): raise NotImplementedError
""" Retrieve and display information from GBIF for all species in the dataset """ def register(parser): parser.add_argument('-U', '--update', default=False, action='store_true') def run(args): if args.update: args.api.update_gbif() args.api.tree()
""" Retrieve and display information from GBIF for all species in the dataset """ def register(parser): parser.add_argument('-U', '--update', default=False, action='store_true') def run(args): if args.update: args.api.update_gbif() args.api.tree()
fin = open("input_18.txt") digits = '1234567890' def prep(text): text = text.strip().replace(' ','') text = text[::-1] text = text.replace('(','X') text = text.replace(')','(') text = text.replace('X',')') return text def geval(text): # print(text) if text[0] == '(': plevel =...
fin = open('input_18.txt') digits = '1234567890' def prep(text): text = text.strip().replace(' ', '') text = text[::-1] text = text.replace('(', 'X') text = text.replace(')', '(') text = text.replace('X', ')') return text def geval(text): if text[0] == '(': plevel = 1 for (...
#!/usr/bin/env python # # Converts the Gonnet matrix to a pair-wise score # # Read replacements replacements = {} filename = 'gonnet.csv' print('Reading ' + filename) rows = [] arow = [] acol = [] with open(filename, 'r') as f: for k, line in enumerate(f): row = line.strip().split(',') if k < 19: ...
replacements = {} filename = 'gonnet.csv' print('Reading ' + filename) rows = [] arow = [] acol = [] with open(filename, 'r') as f: for (k, line) in enumerate(f): row = line.strip().split(',') if k < 19: row = row[:row.index('')] if k < 20: arow.append(row[0]) ...
# rename this file to config.py # change with your info from adafruit.io ADAFRUIT_IO_USERNAME = "XXXX" ADAFRUIT_IO_KEY = "aio_XXXXXXXXXXXXXXXXXXXXXXXXXXXX" APIURL="https://api.openweathermap.org/data/2.5/weather?lat=41.XXXXXX&lon=-73.XXXXXX&appid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&units=imperial"
adafruit_io_username = 'XXXX' adafruit_io_key = 'aio_XXXXXXXXXXXXXXXXXXXXXXXXXXXX' apiurl = 'https://api.openweathermap.org/data/2.5/weather?lat=41.XXXXXX&lon=-73.XXXXXX&appid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&units=imperial'
loud_string = "This string is going to get sliced down!!!!" quiet_string = loud_string[:-4] print(quiet_string) string_one = "Uno" string_one += " means one in spanish." print(string_one) # Join method # join string . join (sequence to be joined ) string = " " sequence = ("a", "b", "c", "d") print(strin...
loud_string = 'This string is going to get sliced down!!!!' quiet_string = loud_string[:-4] print(quiet_string) string_one = 'Uno' string_one += ' means one in spanish.' print(string_one) string = ' ' sequence = ('a', 'b', 'c', 'd') print(string.join(sequence)) multiline_string = '\nTHIS IS \nA\nMULTILINE\nSTRING!\n' p...
"""Clean output files (.jdr) from wire sniffing.""" __author__ = "James Mullinix" __version__ = "0.1.0"
"""Clean output files (.jdr) from wire sniffing.""" __author__ = 'James Mullinix' __version__ = '0.1.0'
# Copyright 2018 eBay Inc. # Copyright 2012 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0...
netforce_plugin = 'NETFORCE' netforce_description = 'A service plugin that manages the life cycle of the resources related to network devices' health_state_healthy = 'healthy' health_state_error = 'error' health_state_probation = 'probation' health_state_maintenance = 'maintenance' subnet_type_primary = 'primary' cms_a...
consumer_conf = { "aws_region":"", "kinesis_stream":"", "kinesis_endpoint":"", "kinesis_app_name":"", "AWS_ACCESS_KEY":"", "AWS_SECRET_KEY":"", "AWS_ACCESS_KEY_ID":"", "AWS_SECRET_ACCESS_KEY":"", "MONGO_CONNECTION_STRING":"" }
consumer_conf = {'aws_region': '', 'kinesis_stream': '', 'kinesis_endpoint': '', 'kinesis_app_name': '', 'AWS_ACCESS_KEY': '', 'AWS_SECRET_KEY': '', 'AWS_ACCESS_KEY_ID': '', 'AWS_SECRET_ACCESS_KEY': '', 'MONGO_CONNECTION_STRING': ''}
''' Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function). The algorithm for myAtoi(string s) is as follows: Read in and ignore any leading whitespace. Check if the next character (if not already at the end of the string) is '-' or '+'. Read thi...
""" Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function). The algorithm for myAtoi(string s) is as follows: Read in and ignore any leading whitespace. Check if the next character (if not already at the end of the string) is '-' or '+'. Read thi...
# ========================================================================== # Only for a given set of 10 companies the data is being extracted/collected # to make predictions as they are independent and are also likely to sample # lot of variation from engineering, beverages, mdicine, investment banking # etc and the...
selected = ['GS'] all_companies_list = ['TRV', 'DOW', 'WBA', 'CAT', 'GS', 'MMM', 'AXP', 'UTX', 'IBM', 'NKE', 'MCD', 'BA', 'CSCO', 'CVX', 'PFE', 'MRK', 'VZ', 'KO', 'DIS', 'HD', 'XOM', 'UNH', 'INTC', 'PG', 'WMT', 'JNJ', 'JPM', 'V', 'AAPL', 'MSFT']
def getFix(s): ret = "" for i in range(1, len(s) - 1): if s[i] == '(': ret += ')' else: ret += '(' return ret def isCorrect(s): cnt = 0 for c in s: if c == '(': cnt += 1 else: cnt -= 1 if cnt < 0: re...
def get_fix(s): ret = '' for i in range(1, len(s) - 1): if s[i] == '(': ret += ')' else: ret += '(' return ret def is_correct(s): cnt = 0 for c in s: if c == '(': cnt += 1 else: cnt -= 1 if cnt < 0: ...
# https://leetcode.com/problems/subarray-sum-equals-k/ class Solution: def subarraySum(self, nums: list[int], k: int) -> int: block_sum = 0 sum_counts = {0: 1} # Pretend sum at the left of nums[0] was 0. good_subarrays = 0 for num in nums: block_sum += num r...
class Solution: def subarray_sum(self, nums: list[int], k: int) -> int: block_sum = 0 sum_counts = {0: 1} good_subarrays = 0 for num in nums: block_sum += num required = block_sum - k if required in sum_counts: good_subarrays += su...
def const_ver(): return "v8.0" def is_gpvdm_next(): return False
def const_ver(): return 'v8.0' def is_gpvdm_next(): return False
if True: pass elif (banana): pass else: pass
if True: pass elif banana: pass else: pass
load("@//tools/base/bazel:merge_archives.bzl", "merge_jars") def setup_bin_loop_repo(): native.new_local_repository( name = "baseline", path = "bazel-bin", build_file_content = """ load("@cov//:baseline.bzl", "construct_baseline_processing_graph") construct_baseline_processing_graph() """, ...
load('@//tools/base/bazel:merge_archives.bzl', 'merge_jars') def setup_bin_loop_repo(): native.new_local_repository(name='baseline', path='bazel-bin', build_file_content='\nload("@cov//:baseline.bzl", "construct_baseline_processing_graph")\nconstruct_baseline_processing_graph()\n') def construct_baseline_processi...
other_schema = { "type": "list", "items": [ {"type": "string"}, {"type": "integer", "min": 500}, { "type": "list", "items": [ {"type": "string"}, {"type": "integer", "name": "nd_int"}, {"type": "integer"}, ...
other_schema = {'type': 'list', 'items': [{'type': 'string'}, {'type': 'integer', 'min': 500}, {'type': 'list', 'items': [{'type': 'string'}, {'type': 'integer', 'name': 'nd_int'}, {'type': 'integer'}, {'type': 'integer', 'min': 50}]}]} schema = {'list_of_values': {'type': 'list', 'name': 'hello', 'items': [{'type': 's...
# As you already know, the string is one of the most # important data types in Python. To make working with # strings easier, Python has many special built-in string # methods. We are about to learn some of them. # An important thing to remember, however, is that the # string is an immutable data type! It means t...
message = 'bonjour and welcome to Paris!' print(message.upper()) print(message) title_message = message.title() print(title_message) print(message.replace('Paris', 'Lyon')) replace_message = message.replace('o', '!', 2) print(replace_message) print(message) whitespace_string = ' hey ' normal_string = 'incomp...
class CircularDependency(Exception): pass class UnparsedExpressions(Exception): pass class UnknownFilter(Exception): pass class FilterError(Exception): pass
class Circulardependency(Exception): pass class Unparsedexpressions(Exception): pass class Unknownfilter(Exception): pass class Filtererror(Exception): pass
#!/usr/bin/env python data = [i for i in open('day03.input').readlines()] fabric = [[0]*1000 for i in range(1000)] def get_x_y_w_h(line): _, _, coord, dim = line.split() x, y = map(int, coord[:-1].split(',')) w, h = map(int, dim.split('x')) return x, y, w, h for line in data: x, y, w, h = get_x_y...
data = [i for i in open('day03.input').readlines()] fabric = [[0] * 1000 for i in range(1000)] def get_x_y_w_h(line): (_, _, coord, dim) = line.split() (x, y) = map(int, coord[:-1].split(',')) (w, h) = map(int, dim.split('x')) return (x, y, w, h) for line in data: (x, y, w, h) = get_x_y_w_h(line) ...
try: hours = int(input("enter hours :")) rate=int(input("enter rate :")) pay = int(hours * rate) print("pay") except: print("Error, enter numeric input!")
try: hours = int(input('enter hours :')) rate = int(input('enter rate :')) pay = int(hours * rate) print('pay') except: print('Error, enter numeric input!')
class Person(): """docstring for Person""" def __init__(self, name, age): self.name = name self.age = age def __str__(self): return "{} is {} years old".format(self.name, self.age) class Employee(Person): def __str__(self): return "{} is employee".format(self.name) maria = Person("Maria", 20...
class Person: """docstring for Person""" def __init__(self, name, age): self.name = name self.age = age def __str__(self): return '{} is {} years old'.format(self.name, self.age) class Employee(Person): def __str__(self): return '{} is employee'.format(self.name) mar...
occurrence = int(input()) city = {} for i in range(occurrence): strike = input() if strike in city: city[strike] += 1 else: city[strike] = 0 strike_counter = 0 for v in city.values(): strike_counter += v if strike_counter > 0: print('1') else: print('0')
occurrence = int(input()) city = {} for i in range(occurrence): strike = input() if strike in city: city[strike] += 1 else: city[strike] = 0 strike_counter = 0 for v in city.values(): strike_counter += v if strike_counter > 0: print('1') else: print('0')
class CohereObject(): def __str__(self) -> str: contents = '' exclude_list = ['iterator'] for k in self.__dict__.keys(): if k not in exclude_list: contents += f'\t{k}: {self.__dict__[k]}\n' output = f'cohere.{type(self).__name__} {{\n{contents}}}' ...
class Cohereobject: def __str__(self) -> str: contents = '' exclude_list = ['iterator'] for k in self.__dict__.keys(): if k not in exclude_list: contents += f'\t{k}: {self.__dict__[k]}\n' output = f'cohere.{type(self).__name__} {{\n{contents}}}' r...
class Plot(object): """ """ def __init__(self): """ """ return 0
class Plot(object): """ """ def __init__(self): """ """ return 0
class Producto: def __init__(self, nombre, descripcion, precio, stock, codigo): self.nombre = nombre self.descripcion = descripcion self.precio = precio self.stock = stock self.codigo = codigo
class Producto: def __init__(self, nombre, descripcion, precio, stock, codigo): self.nombre = nombre self.descripcion = descripcion self.precio = precio self.stock = stock self.codigo = codigo
# The number of nook purchase price periods PRICE_PERIOD_COUNT = 12 # Alternating 'AM' 'PM' labels PRICE_TODS = [["AM", "PM"][i % 2] for i in range(PRICE_PERIOD_COUNT)] PRICE_DAYS = ["Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"] PRICE_PERIODS = [x for x in range(PRICE_PERIOD_COUNT)] # The y range of price graphs PRICE...
price_period_count = 12 price_tods = [['AM', 'PM'][i % 2] for i in range(PRICE_PERIOD_COUNT)] price_days = ['Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat'] price_periods = [x for x in range(PRICE_PERIOD_COUNT)] price_y_lim = [0, 701] label_size = 16
"""Should raise SyntaxError: cannot assign to __debug__ in Py 3.8 and assignment to keyword before.""" a.__debug__ = 1
"""Should raise SyntaxError: cannot assign to __debug__ in Py 3.8 and assignment to keyword before.""" a.__debug__ = 1
# Litkowski Norbert # Cw.1 # Python # McCulloch-Pitts neuron def f(weights, inputs, m): x = float(0) for i in range(m): x += (weights[i] * inputs[i]) if x >= 0: return 1 else: return 0 def and_gate(): inputs = [] weights = [float(0.3), float(0.3), float(-0.5)] m ...
def f(weights, inputs, m): x = float(0) for i in range(m): x += weights[i] * inputs[i] if x >= 0: return 1 else: return 0 def and_gate(): inputs = [] weights = [float(0.3), float(0.3), float(-0.5)] m = 3 print('\nAND gate\n') x = input('Input 1: ') y = in...
def bubble_sort(mass, cmp = lambda a, b: a - b): len_mass= len(mass) for i in range(len_mass, 0, -1): need = False for j in range(1, i): if cmp(mass[j-1], mass[j]) > 0: mass[j-1], mass[j] = mass[j], mass[j-1] need = True if not need: break ...
def bubble_sort(mass, cmp=lambda a, b: a - b): len_mass = len(mass) for i in range(len_mass, 0, -1): need = False for j in range(1, i): if cmp(mass[j - 1], mass[j]) > 0: (mass[j - 1], mass[j]) = (mass[j], mass[j - 1]) need = True if not need: ...
class Room: #Initialises a room. Do not change the function signature (line 2) def __init__(self, name): self.name = name self.quest = None self.north = None self.south = None self.east = None self.west = None #Returns the room's name. def get_name(self): return self.name #Returns a string containi...
class Room: def __init__(self, name): self.name = name self.quest = None self.north = None self.south = None self.east = None self.west = None def get_name(self): return self.name def get_short_desc(self): if self.quest == None: ...
# Time: O(n * l), n is number of quries # , l is length of query # Space: O(1) class Solution(object): def camelMatch(self, queries, pattern): """ :type queries: List[str] :type pattern: str :rtype: List[bool] """ def is_matched(query, pattern): ...
class Solution(object): def camel_match(self, queries, pattern): """ :type queries: List[str] :type pattern: str :rtype: List[bool] """ def is_matched(query, pattern): i = 0 for c in query: if i < len(pattern) and pattern[i] =...
CALIB_FILE_NAME = "calib.p" PERSPECTIVE_FILE_NAME = "projection.p" VIDEO_SIZE = 1280, 720 ORIGINAL_SIZE = 1280, 720 MODEL_SIZE = 608., 608. UNWARPED_SIZE = 500, 600
calib_file_name = 'calib.p' perspective_file_name = 'projection.p' video_size = (1280, 720) original_size = (1280, 720) model_size = (608.0, 608.0) unwarped_size = (500, 600)
#!/usr/bin/env python foo = 123 class NothingMoreToSeeHere(Exception): """ Don't recon any farther. This exception can be thrown in a provider to signal to TileStache.getTile() that the result tile should be returned, and saved in a cache, but no further child tiles should be rendered...
foo = 123 class Nothingmoretoseehere(Exception): """ Don't recon any farther. This exception can be thrown in a provider to signal to TileStache.getTile() that the result tile should be returned, and saved in a cache, but no further child tiles should be rendered. Useful in cas...
""" Number Data types Integers(int) Floating Point(float) Integer """
""" Number Data types Integers(int) Floating Point(float) Integer """
class PipConfigurationError(Exception): pass
class Pipconfigurationerror(Exception): pass
# Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of that number. You can guarantee that input is non-negative. # Example: The binary representation of 1234 is 10011010010, so the function should return 5 in this case # https://www.codew...
def count_bits(n): bitcount = 0 while n > 0: bitcount += n % 2 n = int(n / 2) return bitcount
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
def create_user(app, username, role): appbuilder = app.appbuilder role_admin = appbuilder.sm.find_role(role) tester = appbuilder.sm.find_user(username=username) if not tester: appbuilder.sm.add_user(username=username, first_name=username, last_name=username, email=f'{username}@fab.org', role=rol...
class Field(object): def __init__(self, name, column_type, primary_key, default): self.name = name self.column_type = column_type self.primary_key = primary_key self.default = default def __str__(self): return '<%s, %s:%s>' % (self.__class__.__name__, self.column_type, ...
class Field(object): def __init__(self, name, column_type, primary_key, default): self.name = name self.column_type = column_type self.primary_key = primary_key self.default = default def __str__(self): return '<%s, %s:%s>' % (self.__class__.__name__, self.column_type, ...
def Rotate(arr): temp = [] for i in range(len(arr)): for j in range(0, len(arr)): if i != j and i < j: arr[i][j], arr[j][i] = arr[j][i], arr[i][j] for l in arr: l.reverse() print(l) arr = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] Rotate(arr)
def rotate(arr): temp = [] for i in range(len(arr)): for j in range(0, len(arr)): if i != j and i < j: (arr[i][j], arr[j][i]) = (arr[j][i], arr[i][j]) for l in arr: l.reverse() print(l) arr = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] rotate(arr)
# coding: utf-8 lib_common = { 'uri': 'common', 'type': 'config', 'cxxflags': [ '-std=c++11', ], 'source_base_dir': 'd:/lib/ogre', 'install_dirs_map': { }, } def dyn_common(lib, context): c = context versions = c.parseFile( 'OgreMain/include/OgrePrerequ...
lib_common = {'uri': 'common', 'type': 'config', 'cxxflags': ['-std=c++11'], 'source_base_dir': 'd:/lib/ogre', 'install_dirs_map': {}} def dyn_common(lib, context): c = context versions = c.parseFile('OgreMain/include/OgrePrerequisites.h', '^\\s*#define\\s+(OGRE_VERSION_\\S+)\\s+(.+)') c.setVar('OGRE_VERSI...
ReLU [[-0.426116, -1.36682, 1.82537, -0.359894, 0.781783], [0.0141898, -1.74668, 2.10078, 0.199607, -0.625995], [0.236925, -0.387744, 0.335238, -0.0708328, -0.872241], [0.189836, 1.80645, 0.228501, 1.39699, -1.70341], [3.36428, -0.00959754, -0.02829, -0.00182374, -0.00321689], [-0.00116646, -1.30479, -0.646313, 0.38497...
ReLU [[-0.426116, -1.36682, 1.82537, -0.359894, 0.781783], [0.0141898, -1.74668, 2.10078, 0.199607, -0.625995], [0.236925, -0.387744, 0.335238, -0.0708328, -0.872241], [0.189836, 1.80645, 0.228501, 1.39699, -1.70341], [3.36428, -0.00959754, -0.02829, -0.00182374, -0.00321689], [-0.00116646, -1.30479, -0.646313, 0.38497...
class MyCalendarThree: def __init__(self): self.times = [] def book(self, start, end): bisect.insort(self.times, (start, 1)) bisect.insort(self.times, (end, -1)) res = cur = 0 for _, x in self.times: cur += x res = max(res, cur) return re...
class Mycalendarthree: def __init__(self): self.times = [] def book(self, start, end): bisect.insort(self.times, (start, 1)) bisect.insort(self.times, (end, -1)) res = cur = 0 for (_, x) in self.times: cur += x res = max(res, cur) return ...
# A programming coach has n students to teach. We know that n is divisible by 3. Let's assume that # all students are numbered from 1 to n, inclusive. Before the university programming championship # the coach wants to split all students into groups of three. For some pairs of students we know that # they want to be on...
def dfs(graph, u, visited, actual_team): if not visited[u]: actual_team.append(u) visited[u] = True for v in range(len(graph)): if not visited[v] and graph[u][v] == 1: dfs(graph, v, visited, actual_team) def coach(n, m, T): graph = [[0] * n for _ in range(n)] for i in ra...
ALPACA_END_POINT = 'https://paper-api.alpaca.markets' ALPACA_API_KEY = 'PK45PMO9M1JFIAWKW1X1' ALPACA_SECRET_KEY = 'l6nOaQQvgPqE98MhKjXkrZFvoKPl6ikJ7inBrEed' POLYGON_ALPACA_WS = 'wss://alpaca.socket.polygon.io/stocks' # POLYGON_API_KEY = 'jrQpup0rXAdbYrIRXUTOI8bZ1BkQlJiR' POLYGON_API_KEY = 'PK45PMO9M1JFIAWKW1X1'
alpaca_end_point = 'https://paper-api.alpaca.markets' alpaca_api_key = 'PK45PMO9M1JFIAWKW1X1' alpaca_secret_key = 'l6nOaQQvgPqE98MhKjXkrZFvoKPl6ikJ7inBrEed' polygon_alpaca_ws = 'wss://alpaca.socket.polygon.io/stocks' polygon_api_key = 'PK45PMO9M1JFIAWKW1X1'
class Solution: def countVowelPermutation(self, n: int) -> int: mod = 10**9 + 7 dp = [[0] * 5 for _ in range(n)] for j in range(5): dp[0][j] = 1 for i in range(1, n): dp[i][0] = (dp[i-1][1] + dp[i-1][2] + dp[i-1][4]) % mod dp[i][1] = (dp[i-1][0]...
class Solution: def count_vowel_permutation(self, n: int) -> int: mod = 10 ** 9 + 7 dp = [[0] * 5 for _ in range(n)] for j in range(5): dp[0][j] = 1 for i in range(1, n): dp[i][0] = (dp[i - 1][1] + dp[i - 1][2] + dp[i - 1][4]) % mod dp[i][1] = (dp...
# -*- coding: utf-8 -*- # AtCoder Beginner Contest if __name__ == '__main__': n = int(input()) a = list(map(int, input().split())) count = 0 # See: # https://beta.atcoder.jp/contests/abc100/submissions/2675457 for ai in a: while ai % 2 == 0: ai //= 2 ...
if __name__ == '__main__': n = int(input()) a = list(map(int, input().split())) count = 0 for ai in a: while ai % 2 == 0: ai //= 2 count += 1 print(count)
# -*- coding: utf-8 -*- class RabbitmqClientError(Exception): pass class RabbitmqConnectionError(RabbitmqClientError): pass class QueueNotFoundError(RabbitmqClientError): pass
class Rabbitmqclienterror(Exception): pass class Rabbitmqconnectionerror(RabbitmqClientError): pass class Queuenotfounderror(RabbitmqClientError): pass
# -*- coding: utf-8 -*- """ File __init__.py @author: ZhengYuwei """
""" File __init__.py @author: ZhengYuwei """
def login(): return 'login info' a = 18 num1 = 30 num2 = 10 num2 = 20
def login(): return 'login info' a = 18 num1 = 30 num2 = 10 num2 = 20
A, B, C = map(int, input().split()) if (A*B*C) % 2 == 0: print(0) else: abc = [A, B, C] abc.sort() print(abc[0] * abc[1])
(a, b, c) = map(int, input().split()) if A * B * C % 2 == 0: print(0) else: abc = [A, B, C] abc.sort() print(abc[0] * abc[1])
class BaseUIHandler(object): def handle_first_run(self): pass def init(self): raise NotImplementedError('No UI handler specified!') return False def start(self): return 1
class Baseuihandler(object): def handle_first_run(self): pass def init(self): raise not_implemented_error('No UI handler specified!') return False def start(self): return 1
Encoding = {\ ['e']: '000', ['\0x20']: '1111', ['t']: '1100', ['a']: '10111', ['o']: '1000', ['n']: '0111', ['i']: '0110', ['s']: '0100', ['r']: '0011', ['h']: '11011', ['l']: '10101', ['d']: '10010', ['c']: '00101', ['u']: '111001', ['m']: '110101', ['f']: '101001', ['p']: '101000', ['g']: '100111', ['y']: '010110', [...
encoding = {['e']: '000', ['\x00x20']: '1111', ['t']: '1100', ['a']: '10111', ['o']: '1000', ['n']: '0111', ['i']: '0110', ['s']: '0100', ['r']: '0011', ['h']: '11011', ['l']: '10101', ['d']: '10010', ['c']: '00101', ['u']: '111001', ['m']: '110101', ['f']: '101001', ['p']: '101000', ['g']: '100111', ['y']: '010110', [...
product = { "name":"book", "quan":3, "price":4.25, } person ={ "name":"zoy", "first_name":"mol", "age":39, } print(type(product)) print(dir(product)) print(product) #Obtener los indices o llaves del diccionario print(product.keys()) print(product.values()) print(product.items()) tienda = [ ...
product = {'name': 'book', 'quan': 3, 'price': 4.25} person = {'name': 'zoy', 'first_name': 'mol', 'age': 39} print(type(product)) print(dir(product)) print(product) print(product.keys()) print(product.values()) print(product.items()) tienda = [{'name': 'chair', 'price': 150}, {'name': 'soap', 'price': 10}, {'fifi': '8...
# coding=utf-8 ver_info = {"major": 1, "alias": "Config", "minor": 0} cfg_ver_min = 2 cfg_ver_active = 2
ver_info = {'major': 1, 'alias': 'Config', 'minor': 0} cfg_ver_min = 2 cfg_ver_active = 2
class DataHeader: def __init__(self, name, data_type, vocab_file=None, vocab_mode="read"): self.name = name self.data_type = data_type self.vocab_file = vocab_file self.vocab_mode = vocab_mode
class Dataheader: def __init__(self, name, data_type, vocab_file=None, vocab_mode='read'): self.name = name self.data_type = data_type self.vocab_file = vocab_file self.vocab_mode = vocab_mode
def parse_data(): with open('2019/01/input.txt') as f: data = f.read() return [int(num) for num in data.splitlines()] def part_one(data): return sum(mass // 3 - 2 for mass in data) def part_two(data): total = 0 for num in data: while (num := num // 3 - 2) > 0: total ...
def parse_data(): with open('2019/01/input.txt') as f: data = f.read() return [int(num) for num in data.splitlines()] def part_one(data): return sum((mass // 3 - 2 for mass in data)) def part_two(data): total = 0 for num in data: while (num := (num // 3 - 2)) > 0: total...
# greatest common divisor def gcd(a, b): while b: a, b = b, a % b return a # lowest common multiple def lcm(a, b): return (a * b) // gcd(a, b)
def gcd(a, b): while b: (a, b) = (b, a % b) return a def lcm(a, b): return a * b // gcd(a, b)
""" ANIMATION CACHE MANAGER mGear's animation cache manager is a tool that allows generating a Alembic GPU cache representation of references rigs inside Autodesk Maya. :module: mgear.animbits.cache_manager.__init__ """ __version__ = 1.0
""" ANIMATION CACHE MANAGER mGear's animation cache manager is a tool that allows generating a Alembic GPU cache representation of references rigs inside Autodesk Maya. :module: mgear.animbits.cache_manager.__init__ """ __version__ = 1.0
fname = input("Enter file name: ") if len(fname) < 1: fname = "mbox-short.txt" fh = open(fname) count = 0 def handle_line(line): tokens = line.split(' ') print(tokens[1]) count += 1 for line in fh: if (line.startswith("From:")): continue if (not line.startswith("From")): continue handle_line(...
fname = input('Enter file name: ') if len(fname) < 1: fname = 'mbox-short.txt' fh = open(fname) count = 0 def handle_line(line): tokens = line.split(' ') print(tokens[1]) count += 1 for line in fh: if line.startswith('From:'): continue if not line.startswith('From'): continue ...
# Ex012.2 """Make an algorithm that reads the price of a product, and show it's new price with a 5% discount""" price = float(input('What is the product price?: ')) new_price = price - (price * 5 / 100) print(f'The product that coast R$: {price:.2f}') print(f'Will now coast R$: {new_price:.2f} with 5% discount')
"""Make an algorithm that reads the price of a product, and show it's new price with a 5% discount""" price = float(input('What is the product price?: ')) new_price = price - price * 5 / 100 print(f'The product that coast R$: {price:.2f}') print(f'Will now coast R$: {new_price:.2f} with 5% discount')
#for i in range (1,11): # print ("%d * 5 = %d" %(i,i*5)) # Printing Pattern for i in range (1,5): for j in range (0,i): print ( " * ", end = '' ) print ('') #NExt line # For - Else loop for i in range (5,1,-1): for j in range(0,i): print ( " * ", end = '' ) print ('') #...
for i in range(1, 5): for j in range(0, i): print(' * ', end='') print('') for i in range(5, 1, -1): for j in range(0, i): print(' * ', end='') print('') for i in range(50, 100, 2): print(i) else: print(' No breaks') print(' Values') i = 10 while i < 25: print(i) i = i + ...
""" https://www.codewars.com/kata/52597aa56021e91c93000cb0/python Given an array (probably with different types of values inside), move all of the zeros to the end, keeping the order of the rest. Example: move_zeros([false,1,0,1,2,0,1,3,"a"]) # returns[false,1,1,2,1,3,"a",0,0] """ def move_zeros(array): num_ze...
""" https://www.codewars.com/kata/52597aa56021e91c93000cb0/python Given an array (probably with different types of values inside), move all of the zeros to the end, keeping the order of the rest. Example: move_zeros([false,1,0,1,2,0,1,3,"a"]) # returns[false,1,1,2,1,3,"a",0,0] """ def move_zeros(array): num_zer...
# Shared constants SEGMENT_LEN = 3 # duration per spectrogram in seconds FMIN = 30 # min frequency FMAX = 12500 # max frequency SAMPLING_RATE = 44100 WIN_LEN = 2048 # FFT window length BINARY_SPEC_HEIGHT = 32 # binary classifier spectrogram height SPEC_HEIGHT = 128 # no...
segment_len = 3 fmin = 30 fmax = 12500 sampling_rate = 44100 win_len = 2048 binary_spec_height = 32 spec_height = 128 spec_width = 384 ignore_file = 'data/ignore.txt' classes_file = 'data/classes.txt' ckpt_path = 'data/ckpt' binary_ckpt_path = 'data/binary_classifier_ckpt'
def get_input(): puzzle_input = open('./python/inputday01.txt', 'r').read() return puzzle_input.split('\n')[:-1] def get_fuel_required(module_mass=0): return (module_mass//3)-2 def get_fuel_required_for_fuel(fuel_volume=0): fuel_volume_required = (fuel_volume // 3)-2 if fuel_volume_required <= 0: ...
def get_input(): puzzle_input = open('./python/inputday01.txt', 'r').read() return puzzle_input.split('\n')[:-1] def get_fuel_required(module_mass=0): return module_mass // 3 - 2 def get_fuel_required_for_fuel(fuel_volume=0): fuel_volume_required = fuel_volume // 3 - 2 if fuel_volume_required <= 0...
# -*- coding: utf-8 def register(user_store, email, username, first_name, last_name, password): """ Register command """ return user_store.create( email=email, username=username, first_name=first_name, last_name=last_name, password=password)
def register(user_store, email, username, first_name, last_name, password): """ Register command """ return user_store.create(email=email, username=username, first_name=first_name, last_name=last_name, password=password)
SUBLIST = 0 SUPERLIST = 1 EQUAL = 2 UNEQUAL = 3 def sublist(list_one, list_two): one_chars = map(str, list_one) two_chars = map(str, list_two) list_one_str = ",".join(one_chars) + "," list_two_str = ",".join(two_chars) + "," if list_one_str == list_two_str: return 2 elif list_one_str ...
sublist = 0 superlist = 1 equal = 2 unequal = 3 def sublist(list_one, list_two): one_chars = map(str, list_one) two_chars = map(str, list_two) list_one_str = ','.join(one_chars) + ',' list_two_str = ','.join(two_chars) + ',' if list_one_str == list_two_str: return 2 elif list_one_str in...
# 285. Inorder Successor in BST # Runtime: 68 ms, faster than 85.36% of Python3 online submissions for Inorder Successor in BST. # Memory Usage: 18.1 MB, less than 79.18% of Python3 online submissions for Inorder Successor in BST. # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): #...
class Solution: def inorder_successor(self, root: TreeNode, p: TreeNode) -> TreeNode: stack = [] find_p = False while root or stack: while root: stack.append(root) root = root.left node = stack.pop() if find_p: ...
# -*- coding: utf-8 -*- """@package scrape @date Created on nov. 15 09:30 2017 @author samuel_r """ def get_translation(jp_text): return
"""@package scrape @date Created on nov. 15 09:30 2017 @author samuel_r """ def get_translation(jp_text): return
# -*- coding: utf-8 -*- class ArchiveService: def get_service_name(self): return 'DEFAULT' def submit(self, url): pass class ArchiveException(Exception): pass
class Archiveservice: def get_service_name(self): return 'DEFAULT' def submit(self, url): pass class Archiveexception(Exception): pass
def reverse(st): st = st.split() st.reverse() st2 = ' '.join(st) return st2
def reverse(st): st = st.split() st.reverse() st2 = ' '.join(st) return st2
class HyperParameter: def __init__(self, num_batches, batch_size, epoch, learning_rate, hold_prob, epoch_to_report=100): self.num_batches = num_batches self.batch_size = batch_size self.epoch = epoch self.learning_rate = learning_rate self.hold_prob = hold_prob, self....
class Hyperparameter: def __init__(self, num_batches, batch_size, epoch, learning_rate, hold_prob, epoch_to_report=100): self.num_batches = num_batches self.batch_size = batch_size self.epoch = epoch self.learning_rate = learning_rate self.hold_prob = (hold_prob,) se...
# This project created by urhoba # www.urhoba.net #region DB Settings class DBSettings: sqliteDB = "db.urhoba" #endregion #region Mail Settings class MailSettings: fromMail = "ahmetbohur@urhoba.net" fromPassword = "" smtpHost = "smtp.yandex.com" smtpPort = 465 #endregion #region Download Settings...
class Dbsettings: sqlite_db = 'db.urhoba' class Mailsettings: from_mail = 'ahmetbohur@urhoba.net' from_password = '' smtp_host = 'smtp.yandex.com' smtp_port = 465 class Downloadsettings: music_folder = 'songs' video_folder = 'videos' class Telegramsettings: telegram_api = ''
"""python-homewizard-energy errors.""" class HomeWizardEnergyException(Exception): """Base error for python-homewizard-energy.""" class RequestError(HomeWizardEnergyException): """Unable to fulfill request. Raised when host or API cannot be reached. """ class InvalidStateError(HomeWizardEnergyExc...
"""python-homewizard-energy errors.""" class Homewizardenergyexception(Exception): """Base error for python-homewizard-energy.""" class Requesterror(HomeWizardEnergyException): """Unable to fulfill request. Raised when host or API cannot be reached. """ class Invalidstateerror(HomeWizardEnergyExcept...
__author__ = 'Chintalagiri Shashank' __email__ = 'shashank@chintal.in' __version__ = '0.2.9'
__author__ = 'Chintalagiri Shashank' __email__ = 'shashank@chintal.in' __version__ = '0.2.9'
{ 'targets': [ { 'target_name': 'rulesjs', 'sources': [ 'src/rulesjs/rules.cc' ], 'include_dirs': ["<!(node -e \"require('nan')\")"], 'dependencies': [ 'src/rules/rules.gyp:rules' ], 'defines': [ '_GNU_SOURCE' ], 'cflags': [ '-Wall', '-O3' ] } ] }
{'targets': [{'target_name': 'rulesjs', 'sources': ['src/rulesjs/rules.cc'], 'include_dirs': ['<!(node -e "require(\'nan\')")'], 'dependencies': ['src/rules/rules.gyp:rules'], 'defines': ['_GNU_SOURCE'], 'cflags': ['-Wall', '-O3']}]}
# Generate key with openssl rand -hex 32 JWT_SECRET_KEY = "46e5c95a2d980476afb2d679b37bb2c8990c25b4ea1075514f67f62f77daf306" JWT_ALGORITHM = "HS256" JWT_EXPIRATION_MINUTES = 15 # TODO: Move to environment variables DB_HOST = 'localhost' DB_NAME = 'bookstore' DB_USER = 'postgres' DB_PASSWORD = 'postgres' DB_PORT = 5432...
jwt_secret_key = '46e5c95a2d980476afb2d679b37bb2c8990c25b4ea1075514f67f62f77daf306' jwt_algorithm = 'HS256' jwt_expiration_minutes = 15 db_host = 'localhost' db_name = 'bookstore' db_user = 'postgres' db_password = 'postgres' db_port = 5432 redis_url = 'redis://localhost' test = True test_db_host = 'localhost' test_db_...
class Difference: def __init__(self, a): self.__elements = a self.maximumDifference = 0 def computeDifference(self): max_num = max(self.__element) min_num = min(self.__element) self.maximumDifference = max_num - min_num if self.maximumDifference < 0: ...
class Difference: def __init__(self, a): self.__elements = a self.maximumDifference = 0 def compute_difference(self): max_num = max(self.__element) min_num = min(self.__element) self.maximumDifference = max_num - min_num if self.maximumDifference < 0: ...
t = int(input()) output = [] for _ in range(t): p, a, b, c = [int(x) for x in input().split()] if a >= p: minimum = a - p elif p % a == 0: minimum = 0 else: minimum = a - (p % a) if b >= p: minimum = min(minimum, b - p) elif p % b == 0: minimum = 0 els...
t = int(input()) output = [] for _ in range(t): (p, a, b, c) = [int(x) for x in input().split()] if a >= p: minimum = a - p elif p % a == 0: minimum = 0 else: minimum = a - p % a if b >= p: minimum = min(minimum, b - p) elif p % b == 0: minimum = 0 els...
n=int(input());r="" for i in range(1,n+1): s=input().strip() if s=="5 6" or s=="6 5": r+="Case "+str(i)+": Sheesh Beesh\n" else: a=[int(k) for k in s.split()] a.sort(reverse=True) if a[0]==a[1]: if a[0]==1: r+="Case "+str(i)+": Habb Yakk\n" ...
n = int(input()) r = '' for i in range(1, n + 1): s = input().strip() if s == '5 6' or s == '6 5': r += 'Case ' + str(i) + ': Sheesh Beesh\n' else: a = [int(k) for k in s.split()] a.sort(reverse=True) if a[0] == a[1]: if a[0] == 1: r += 'Case ' + s...
def order(data): # new_data = [] for i in range(len(data)): for j in range(len(data) - 1): if (data[j] > data[j + 1]): temp_data_j = data[j] data[j] = data[j + 1] data[j + 1] = temp_data_j return data
def order(data): for i in range(len(data)): for j in range(len(data) - 1): if data[j] > data[j + 1]: temp_data_j = data[j] data[j] = data[j + 1] data[j + 1] = temp_data_j return data
# %% [markdown] ''' # How to install NVIDIA GPU driver and CUDA on ubuntu ''' # %% [markdown] ''' This post is intended to describe how to install NVIDIA GPU driver and CUDA on ubuntu. I have myself a GTX 560M with ubuntu 18.04. ''' # %% [markdown] ''' ## Requirements Before installing, we will first need to find th...
""" # How to install NVIDIA GPU driver and CUDA on ubuntu """ '\nThis post is intended to describe how to install NVIDIA GPU driver and CUDA on ubuntu. \nI have myself a GTX 560M with ubuntu 18.04.\n' '\n## Requirements\n\nBefore installing, we will first need to find the different version that your GPU support in the...
#!/usr/bin/env python3 def clean_up(): try: raise KeyboardInterrupt finally: print('Goodbye, world!') def divide(x, y): try: result = x / y except ZeroDivisionError: print("division by zero!") else: print("result is", result) finally: print("exe...
def clean_up(): try: raise KeyboardInterrupt finally: print('Goodbye, world!') def divide(x, y): try: result = x / y except ZeroDivisionError: print('division by zero!') else: print('result is', result) finally: print('executing finally clause') i...
test = { "name": "q3", "points": 1, "hidden": False, "suites": [ { "cases": [ { "code": r""" >>> len(data["flavor"].unique()) == 4 True """, "hidden": False, "locked": False, }, { "code": r""" >>> for l in ["chocolate", "vanilla", "strawberry", "mint"]: ...
test = {'name': 'q3', 'points': 1, 'hidden': False, 'suites': [{'cases': [{'code': '\n\t\t\t\t\t>>> len(data["flavor"].unique()) == 4\n\t\t\t\t\tTrue\n\t\t\t\t\t', 'hidden': False, 'locked': False}, {'code': '\n\t\t\t\t\t>>> for l in ["chocolate", "vanilla", "strawberry", "mint"]:\n\t\t\t\t\t... \tassert l in data["fla...
# Just a simple time class # that stores time in 24 hour format # and displays in period time (AM/PM) class SimpleTime: def __init__(self, hour, minute, period): # assertions for checking assert(hour > 0 and hour <= 12) assert(minute >= 0 and minute < 60) assert(period == "AM" or per...
class Simpletime: def __init__(self, hour, minute, period): assert hour > 0 and hour <= 12 assert minute >= 0 and minute < 60 assert period == 'AM' or period == 'PM' self._minute = minute if period == 'AM': self._hour = hour % 12 else: self._h...
file_pickled_dfas = "helper-dfas.pickled" file_pickled_dfas = "helper-more-dfas.pickled" day_in_sec = 86400 now_in_sec = time.time() def get_dfas(): """Get DFAs from pickled file. If the file is older than a day regenerate it.""" global day_in_sec global now_in_sec global __dfa_list ...
file_pickled_dfas = 'helper-dfas.pickled' file_pickled_dfas = 'helper-more-dfas.pickled' day_in_sec = 86400 now_in_sec = time.time() def get_dfas(): """Get DFAs from pickled file. If the file is older than a day regenerate it.""" global day_in_sec global now_in_sec global __dfa_list try: (p...
class BytesIntEncoder: @staticmethod def encode(s: str) -> int: return int.from_bytes(s.encode(), byteorder='big') @staticmethod def decode(i: int) -> str: return i.to_bytes(((i.bit_length() + 7) // 8), byteorder='big').decode()
class Bytesintencoder: @staticmethod def encode(s: str) -> int: return int.from_bytes(s.encode(), byteorder='big') @staticmethod def decode(i: int) -> str: return i.to_bytes((i.bit_length() + 7) // 8, byteorder='big').decode()
def castleTowers(n, ar): occurrences_map = {} max_item = -1 for item in ar: if item > max_item: max_item = item if item in occurrences_map: occurrences_map[item] += 1 else: occurrences_map[item] = 1 return occurrences_map[max_item] if __na...
def castle_towers(n, ar): occurrences_map = {} max_item = -1 for item in ar: if item > max_item: max_item = item if item in occurrences_map: occurrences_map[item] += 1 else: occurrences_map[item] = 1 return occurrences_map[max_item] if __name__...
def countMinOperations(target, n): result = 0 while (True): zero_count = 0 i = 0 while (i < n): if ((target[i] & 1) > 0): break elif (target[i] == 0): zero_count += 1 i += 1 if (zero_count == n): ...
def count_min_operations(target, n): result = 0 while True: zero_count = 0 i = 0 while i < n: if target[i] & 1 > 0: break elif target[i] == 0: zero_count += 1 i += 1 if zero_count == n: return result ...
# generated from genmsg/cmake/pkg-genmsg.context.in messages_str = "/home/pi/catkin_ws/src/mobrob_util/msg/ME439SensorsRaw.msg;/home/pi/catkin_ws/src/mobrob_util/msg/ME439SensorsProcessed.msg;/home/pi/catkin_ws/src/mobrob_util/msg/ME439WheelSpeeds.msg;/home/pi/catkin_ws/src/mobrob_util/msg/ME439MotorCommands.msg;/home...
messages_str = '/home/pi/catkin_ws/src/mobrob_util/msg/ME439SensorsRaw.msg;/home/pi/catkin_ws/src/mobrob_util/msg/ME439SensorsProcessed.msg;/home/pi/catkin_ws/src/mobrob_util/msg/ME439WheelSpeeds.msg;/home/pi/catkin_ws/src/mobrob_util/msg/ME439MotorCommands.msg;/home/pi/catkin_ws/src/mobrob_util/msg/ME439WheelAngles.ms...
# # Find the one food that is eaten by only one animal. # # The animals table has columns (name, species, birthdate) for each individual. # The diet table has columns (species, food) for each food that a species eats. # QUERY = ''' select diet.food, count(animals.name) as num from animals, diet where animals.s...
query = '\nselect diet.food, count(animals.name) as num from animals, diet where animals.species = diet.species group by diet.food having num = 1\n'
# IE 11 CustomEvent polyfill src = r""" (function () { if ( typeof window.CustomEvent === "function" ) return false; //If not IE function CustomEvent ( event, params ) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = document.createEvent( 'CustomEvent' ); evt.in...
src = '\n(function () {\n if ( typeof window.CustomEvent === "function" ) return false; //If not IE\n\n function CustomEvent ( event, params ) {\n params = params || { bubbles: false, cancelable: false, detail: undefined };\n var evt = document.createEvent( \'CustomEvent\' );\n evt.initCustomEvent( event, pa...