content
stringlengths
7
1.05M
def getBuiltinTargs(): return { "1": { "name": "1", "ptype": "maven2", "patterns": [".*"], "defincpat": ["**"], "defexcpat": [] }, "2": { "name": "2", "ptype": "maven1", "patterns": [".*"], ...
def add(x,y): """add two numbers together""" return x + y
# -*- coding: utf-8 -*- """ Created on Thu Aug 10 15:43:09 2017 @author: juherask """ DEBUG_VERBOSITY = 3 COST_EPSILON = 1e-10 CAPACITY_EPSILON = 1e-10 # how many seconds we give to a MIP solver MAX_MIP_SOLVER_RUNTIME = 60*10 # 10m MIP_SOLVER_THREADS = 1 # 0 is automatic (parallel computing) BENCHMARKS_BASEPATH =...
EXT_STANDARD = 1 INT_STANDARD = 2 EXT_HQ = 3 INT_HQ = 4 EXT_HOUSE = 5 INT_HOUSE = 6 EXT_COGHQ = 7 INT_COGHQ = 8 EXT_KS = 9 INT_KS = 10
class MaxAlgorithm: #최대값 알고리즘 def __init__(self, ns): self.nums = ns self.maxNum = 0 self.maxNumIdx = 0 def setMaxIdxAndNum(self): self.maxNum = self.nums[0] self.maxNumIdx = 0 for i, n in enumerate(self.nums): if self.maxNum < n: ...
# Basics """ Summary: Dictionary are a list of Key and Value {Key: Value} You can create a key connected to its own definition e.g. {"Bug": "An error in a program that prevents the program from running as expected"} You can also create more keys, separating each key /w a comma. { "Bug": "An error i...
# Leo colorizer control file for dart mode. # This file is in the public domain. # Properties for dart mode. properties = { "commentEnd": "*/", "commentStart": "/*", "electricKeys": ":", "indentCloseBrackets": "]}", "indentNextLine": "\\s*(((if|while)\\s*\\(|else\\s*|else\\s+if\\s*\\(|for\\s*\\(.*\...
ACCOUNT_ID = "1234567890" def parameter_arn(region, parameter_name): if parameter_name[0] == "/": parameter_name = parameter_name[1:] return "arn:aws:ssm:{0}:{1}:parameter/{2}".format( region, ACCOUNT_ID, parameter_name )
class Node: def __init__(self, data): self.data = data self.next = None class PilhaListaEncadeada: def __init__(self): self.head = None def isempty(self): if self.head == None: return True else: return False def empilhar(self, data): ...
#!/bin/python # Enter your code here. Read input from STDIN. Print output to STDOUT N = int(raw_input()) n= N w = 'Weird' nw = 'Not Weird' if n % 2 == 1: print(w) elif n % 2 == 0 and (n>=2 and n<5): print(nw) elif n % 2 == 0 and (n>=6 and n<=20): print(w) elif n % 2 == 0 and (n>20): print(nw)
# Sage version information for Python scripts # This file is auto-generated by the sage-update-version script, do not edit! version = '9.3.rc0' date = '2021-03-23' banner = 'SageMath version 9.3.rc0, Release Date: 2021-03-23'
# Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next def __str__(self): return str(self.val) def print_list(head: ListNode): cur = head while cur is not None: print(cur.val, end=' ') cur = cu...
""" Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time. Example 1: https://assets.leetcode.com/uploads/2020/11/05/minpath.jpg Input: grid = [[...
REDFIN_TABLE_SCHEMA = { 'SCHEMA': { 'SALE_TYPE': 'VARCHAR(50)', 'SOLD_DATE': 'DATE', 'PROPERTY_TYPE': 'VARCHAR(50)', 'ADDRESS': 'VARCHAR(100) NOT NULL', 'CITY': 'VARCHAR(50) NOT NULL', 'STATE': 'VARCHAR(50) NOT NULL', 'ZIPCODE': 'BIGINT', 'PRICE': 'BIG...
# Crie um programa que vai ler vários números e colocar em uma lista. Depois disso, crie duas listas extras que vão conter apenas os valores pares e os valores ímpares digitados, respectivamente. Ao final, mostre o conteúdo das três listas geradas. lista = list() pares = list() impares = list() while True: numero...
message = 'My name is ' 'Tom' print(message)
list1 = ["apple", "banana", "cherry"] list2 = list1.copy() print(list2) list3 = list(list1) print(list3) list4 = list('T am a list') print(list4) # join 2 lists list5 = list1 + list4 print(list5) for x in list4: list1.append(x) print(list1) list2.extend(list4) print(list2) # list constructor list7 = list(("appl...
""" URLify: Write a method to replace all spaces in a string with '%20'. You may assume that the string has sufficient space at the end to hold the additional characters, and that you are given the "true" length of the string. (Note: If implementing in Java, please use a character array so that you can perform this ope...
r""" ``scanInfo`` --- Scan information ==================================== .. code-block:: python import gempython.vfatqc.utils.scanInfo Documentation ------------- """ #default values for the algorithm to update the trim values in the iterative trimmer sigmaOffsetDefault=0 highNoiseCutDefault=63 highTrimCutof...
class SessionStorage: """Class to save data into session section organized by section_id.""" def __init__(self, session): self.session = session def set(self, section_id, key, value): """Set data to session section.""" session_part = self.session.get(section_id, {}) session...
_MODELS = dict() def register(fn): global _MODELS _MODELS[fn.__name__] = fn return fn def get_model(args=None): if args.model is None: return _MODELS return _MODELS[args.model](args.num_classes)
Izhikevich = Neuron( parameters= { 'a': Array(value=0.02, dtype=np.float32), 'b': Array(value=0.2), 'c': Value(value=-65.), 'd': Value(value=-2.), 'VT': Value(value=30.), }, equations = { 'v': Array(eq="dv/dt = 0.04 * v^2 + 5.0 * v + 140.0 - u + I + ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Gammapy integration and system tests. This package can be used for tests that involved several Gammapy sub-packages, or that don't fit anywhere else. """
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
reta1 = float(input('comprimento 1: ')) reta2 = float(input('comprimento 2: ')) reta3 = float(input('comprimento 3: ')) if (reta1 < reta2 + reta3) and reta1 > abs(reta2 - reta3): if(reta2 < reta1 + reta3) and reta2 > abs(reta1 - reta3): if(reta3 < reta1 + reta2) and reta3 > abs(reta1 - reta2): p...
# class SVNRepo: # @classmethod # def isBadVersion(cls, id) # # Run unit tests to check whether verison `id` is a bad version # # return true if unit tests passed else false. # You can use SVNRepo.isBadVersion(10) to check whether version 10 is a # bad version. class Solution: """ @param n...
#Lists Challenge 9: Basketball Roster Program print("Welcome to the Basketball Roster Program") #Get user input and define our roster roster = [] player = input("\nWho is your point guard: ").title() roster.append(player) player = input("Who is your shooting guard: ").title() roster.append(player) player = input("Wh...
# Helper merge sort function def mergeSort(arr): # Clone the array for the merge later arrClone = arr.clone() mergeSortAux(arr, arrClone, 0, len(arr) - 1) # Actual merge sort def mergeSortAux(arr, arrClone, low, high): if low < high: mid = (low + high) / 2 # Sort left mergeSort...
""" Exceptions """ class SubFrameError(Exception): """General error.""" pass
valor = [] while True: x = (int(input('Digite um valor: '))) if x not in valor: valor.append(x) print('Prontinho, adicionado com sucesso. :)') else: print('Valor duplicado, não vou adicionar. :(') y = str(input('quer continuar ? S ou N? ')).strip().upper()[0] if y in 'Nn': ...
# You can comment by putting # in front of a text. #First off we will start off with the humble while loop. #Now notice the syntax: first we declare our variable, #while condition is followed with a colon, #in order to concenate a string with a number #we must turn it into a string as well. #Finally don't forget the i...
class DailySchedule: def __init__(self, day_number: int, day_off: bool = False): self.day_number = day_number self.day_off = day_off self.lessons: list[tuple[str, str, str]] = []
my_list = [] print('Введите кол-во элементов массива и его элементы') for a in range(0, int(input())): # t = int(input()) my_list.append(int(input())) my_list.sort() print('my_list =', my_list, 'type: ', type(my_list)) # list check def binary_search(sorted_list, item): low = 0 high = len(sorted_list...
class SpaceSequenceEditor: display_channel = None display_mode = None draw_overexposed = None grease_pencil = None overlay_type = None preview_channels = None proxy_render_size = None show_backdrop = None show_frame_indicator = None show_frames = None show_grease_pencil = Non...
""" 斐波那契数,通常用 F(n) 表示,形成的序列称为斐波那契数列。该数列由 0 和 1 开始,后面的每一项数字都是前面两项数字的和。也就是: F(0) = 0,   F(1) = 1 F(N) = F(N - 1) + F(N - 2), 其中 N > 1. 给定 N,计算 F(N)。   示例 1: 输入:2 输出:1 解释:F(2) = F(1) + F(0) = 1 + 0 = 1. 示例 2: 输入:3 输出:2 解释:F(3) = F(2) + F(1) = 1 + 1 = 2. 示例 3: 输入:4 输出:3 解释:F(4) = F(3) + F(2) = 2 + 1 = 3. """ class ...
# Write for loops that iterate over the elements of a list without the use of the range # function for the following tasks. # c. Counting how many elements in a list are negative. list = [ -5, 10, 15, -20, -2, 0, -8, 94 ] numNegativeElements = 0 for item in list: if item < 0: numNegativeElements += ...
# Letter Phone # https://www.interviewbit.com/problems/letter-phone/ # # Given a digit string, return all possible letter combinations that the number could represent. # # A mapping of digit to letters (just like on the telephone buttons) is given below. # # The digit 0 maps to 0 itself. # The digit 1 maps to 1 itself....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def test_install_extension(lib): lib.cmd('extension install hello') lib.cmd('hello') def test_install_extension_with_github_syntax(lib): lib.cmd('extension install clk-project/hello') lib.cmd('hello') def test_update_extension(lib): lib.cmd('exten...
# Números primos # Escreva uma função que recebe um número e verifica se é ou não um número primo. Para fazer essa verificação, calcule o resto da divisão do número por 2 e depois por todos os números ímpares até o número recebido. Se o resto de uma dessas divisões for igual a zero, o número não é primo. Observe que 0 ...
""" Module contains class coordinates Class coordinates represent a pair of coordinates of a single cell on a 10x10 board """ class Coordinates: """ Represents coordinates of a single cell Represents coordinates of a single cell with x and y coordinates where x abs is a top row in range a-j and y abs ...
class Producto: def __init__(self, codigo: str, nombre: str, precio: float) -> None: self.codigo = codigo self.nombre = nombre self.precio = precio def __str__(self) -> str: return f'(Código: {self.codigo}, Nombre: {self.nombre}, Precio: {self.precio})'
''' ref: https://www.datacamp.com/community/tutorials/decorators-python ''' def uppercase_decorator(function): def wrapper(): func = function() make_uppercase = func.upper() return make_uppercase return wrapper def say_hi(): return 'hi there' decorate = uppercase_decorator(say_h...
''' Given a string s, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation. Example 1: Input: "aacecaaa" Output: "aaacecaaa" Example 2: Input: "abcd" Output: "dcbabcd" ''' # 2018-10-10 # 214. Shortes...
# Copyright Google Inc. All Rights Reserved. # # Use of this source code is governed by an MIT-style license that can be # found in the LICENSE file at https://angular.io/license """Test utility to extract the "flat_module_metadata" from transitive Angular deps. """ def _extract_flat_module_index(ctx): return [Defau...
def calcula_fatorial(numero): """ Calcula o fatorial de um número recursivamente """ if numero == 0: return 1 return numero * calcula_fatorial(numero - 1) def main(): numero = int(input()) fatorial = calcula_fatorial(numero) print(fatorial) main()
MAX_CHAR_GROUP_NAME = 30 MAX_CHAR_CONTEXT_NAME = 30 MAX_CHAR_DEVICE_NAME = 30 MAX_DEVICES = 10 MAX_GROUPS = 10 MAX_CONTEXTS = 10 MAX_ACTIONS = 10 MAX_TRIGGERS = 10 # in seconds INTERVAL_PUB_GROUP_DATA = 120 INTERVAL_ONLINE = 60 STATE_NO_CONNECTION = 1 STATE_CONNECTED_INTERNET = 2 STATE_CONNECTED_NO_INTERNET = 3
# -*- coding: utf-8 -*- """ Created on Fri Sep 25 19:44:16 2020 @author: Ravi """ #Topological Sorting using recursive DFS # {1: [3], 2: [3], 4: [0, 1], 5: [0, 2]} # topological order = [3,1,2,1,0,4,5] # 1->3 # 2->3 # 4->0->1 class Graph: def __init__(self,edges): self.explored = set() ...
def login(client, username, password): payload = dict(username=username, password=password) return client.post('/login', data=payload, follow_redirects=True) def logout(client): return client.get('/logout', follow_redirects=True)
largest_number=None smallest_number=None while True: order=input('Enter a number: ') if order=='done': break try: number=int(order) except Exception as e: print("Invalid Input") continue if largest_number is None: largest_number=number if smal...
# XXXXXXXXXXX class Node: def __init__(self, value, prev_item=None, next_item=None): self.value = value self.prev_item = prev_item self.next_item = next_item class Queue(): def __init__(self, max_size): self.max_size = max_size self.size = 0 self.head = None ...
""" Proszę zmodyfikować poprzedni program aby wypisywał znalezione n-ki. """ def print_ns(T, product, n, idx=0, ns=[]): if product == 1 and n == 0: for i in range(len(ns)): print(ns[i], end=" ") print() return 1 if n == 0: return 0 count = 0 for i in range(i...
#!/usr/bin/python3.6 # created by cicek on 12.10.2018 15:09 digits = "731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861560789112949495459501737958331952853208805511125406987471585238630507156932909632952274430435576689664895044524452316173185640309871112172238311...
# coding=utf-8 # @Time : 2020/2/15 # @Author : Wang Xiaoxiao # @University : Dalian University of Technology # @FileName : SegmentTree.py # @Software : PyCharm # @github : https://github.com/i-love-linux/BasicDataStructure class SegmentTree: """ 时间复杂度分析:n为数组大小 更新set:O(logn) 查...
#crie um programa onde o usuario possa digitar varios valores numericos e cadastre-os em uma #lista. Caso o numero já exista lá dentro, ele nao será adicionado. No final serao exibidos todos #os valores unicos digitados em ordem crescente num = [] while True: n = (int(input('Digite um valor: '))) if n not in nu...
user_schema = { "type": "object", "properties": { "name": {"type": "string"} }, "required": ["name"], "additionalProperties": False } get_users_query_params_schema = { "type": ["object", "null"], "properties": { "page": {"type": "string"} }, "additionalProperties": F...
## =============================================================================== ## Authors: AFRL/RQQA ## Organization: Air Force Research Laboratory, Aerospace Systems Directorate, Power and Control Division ## ## Copyright (c) 2017 Government of the United State of America, as represented by ## the Secretary of th...
#!/usr/bin/env python class HostType: GPCHECK_HOSTTYPE_UNDEFINED = 0 GPCHECK_HOSTTYPE_APPLIANCE = 1 GPCHECK_HOSTTYPE_GENERIC_LINUX = 2 def hosttype_str(type): if type == HostType.GPCHECK_HOSTTYPE_APPLIANCE: return "GPDB Appliance" elif type == HostType.GPCHECK_HOSTTYPE_GENERIC_LINUX: ...
true = True false = False abi = [ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "stateMutability": "payable", "type": "fallback" }, { "inputs": [], "name": "client_cancellation", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs":...
# Copyright 2020 The FedLearner Authors. 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
""" uzlib 模块实现了使用 DEFLATE 算法解压缩二进制数据 (常用的 zlib 库和 gzip 文档)。目前不支持压缩。 """ def decompress(data) -> None: """打开一个文件,关联到内建函数open()。所有端口 (用于访问文件系统) 需要支持模式参数,但支持其他参数不同的端口。""" ...
class Stack(): def __init__(self): self.lista = [] def push(self, a): self.lista.append(a) def pop(self): if self.isEmpty(): print('Ação negada, a pilha está vazia') else: return self.lista.pop() def isEmpty(self): return len...
my_list = list(range(1, 11)) print(my_list) def maxInList(aList): # non-recursion method max_number = aList[0] for i in range(1, len(aList)): if max_number < aList[i]: max_number = aList[i] return max_number def minInList(aList): # non-recursion method min_number =...
#!/usr/bin/env python # # Copyright (c) 2018 10X Genomics, Inc. All rights reserved. # MATRIX_MEM_GB_MULTIPLIER = 2 # TODO reduce this once we're confident about the actual memory bounds NUM_MATRIX_ENTRIES_PER_MEM_GB = 50e6 # Empirical obs: with new CountMatrix setup, take ~ 50 bytes/bc NUM_MATRIX_BARCODES_PER_MEM_G...
# 8. Write a program that swaps the values of three variables x,y, and z, so that x gets the value # of y, y gets the value of z, and z gets the value of x. x, y, z = 5, 10, 15 x, y, z = y, z, x # The power of Python ;) # print(x, y, z) : 10 15 5
class SomentePares(list): def append(self, inteiro): if not isinstance(inteiro, int): raise TypeError('Somente inteiros') # raise lança uma exceção if inteiro % 2: raise ValueError('Somente Pares') super().append(inteiro) sp = SomentePares() sp.append(10) ...
vts = list() vts.append(0) vtx = list() total = 0 def dfs(cur, visited:list): global vtx, total if cache[cur] != -1: total += cache[cur] return if not vtx[cur]: if cur == tg + 3: total += 1 return visited = visited.copy() visited.append(cur) ...
alunos = list() notas = list() c = 0 while True: alunos.append([str(input('Nome: '))]) notas.append([float(input('Nota 1: '))]) notas[c].append(float(input('Nota 2: '))) alunos[c].append((notas[c][0] + notas[c][1]) / 2) c += 1 continuar = str(input('Quer continuar? ')).upper().strip() if co...
#!/usr/bin/env prey async def main(): await x("ls -a") cd("..") a = await x("ls") await asyncio.sleep(2)
"""Default configuration Use env var to override """ DEBUG = True SECRET_KEY = "changeme" SQLALCHEMY_DATABASE_URI = "sqlite:////tmp/microbiome_api.db" SQLALCHEMY_TRACK_MODIFICATIONS = False
class Solution: def halvesAreAlike(self, s: str) -> bool: num_vowels=0 num_vowels1=0 split = -( ( -len(s) )//2 ) p1, p2 = s[:split], s[split:] for char in p1: if char in "aeiouAEIOU": num_vowels = num_vowels+1 for char in p2: ...
class BaseValidationError(ValueError): pass class LogInFileNotParsedError(BaseValidationError): pass
# -*- coding: utf-8 -*- class TransitionType(object): def __init__(self, utc_offset, is_dst, abbrev): self.utc_offset = utc_offset self.is_dst = is_dst self.abbrev = abbrev def __repr__(self): return '<TransitionType [{}, {}, {}]>'.format( self.utc_offset, ...
""" 16175. General Election 작성자: xCrypt0r 언어: Python 3 사용 메모리: 29,380 KB 소요 시간: 172 ms 해결 날짜: 2020년 9월 19일 """ def main(): for _ in range(int(input())): N, M = map(int, input().split()) votes = [0] * N for _ in range(M): for i, v in enumerate(map(int, input().split())): ...
class SingleLinkedListNode(object): def __init__(self, value, nxt): self.value = value self.next = nxt def __repr__(self): nval = self.next and self.next.value or None return f"[{self.value}:{repr(nval)}]" class SingleLinkedList(object): def __init__(self): self.b...
""" 0997. Find the Town Judge In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: The town judge trusts nobody. Everybody (except for the town judge) trusts the town judge. There is exactly one person that satisfies...
class Solution: def findLonelyPixel(self, picture: List[List[str]]) -> int: """Array. Running time: O(m * n) where m and n are the size of picture. """ m, n = len(picture), len(picture[0]) row, col = [0] * m , [0] * n for i in range(m): for j in range(n):...
#!/usr/bin/env python # coding: utf-8 # In given array find the duplicate odd number . # # Note: There is only one duplicate odd number # # <b> Ex [1,4,6,3,1] should return 1 </b> # In[3]: def dup_odd_num(num): count=0 for i in range(len(num)): if num[i] % 2 != 0: count+=1 if c...
# -*- coding: utf-8 -*- class OcelotError(Exception): """Base for custom ocelot errors""" pass class ZeroProduction(OcelotError): """Reference production exchange has amount of zero""" pass class IdenticalVariables(OcelotError): """The same variable name is used twice""" pass class Inval...
# -*- coding: utf-8 -*- # ******************************************************* # Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved. # SPDX-License-Identifier: MIT # ******************************************************* # * # * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT # * WARRANTIES OR C...
a = int(input()) b = int(input()) count = 0 x = 0 a1 = str(a) b1 = str(b) if len(a1) == len(b1): for i in a1: for j in b1[x::]: if i != j: count += 1 x += 1 break print(count)
valores =[] valores_quadrado =[] for i in range(10): valores.append(int(input("Digite um numero inteiro: "))) for i in valores: valores_quadrado.append(i**2) print("Valores da lista ao quadrado: ",valores_quadrado) print("Soma dos quadrados: ",sum(valores_quadrado))
def str_seems_like_json(txt): for c in txt: if c not in "\r\n\t ": return c == '{' return False def bytes_seems_like_json(binary): for b in binary: if b not in [13, 10, 9, 32]: return b == 123 return False
#!/usr/bin/env python3 # Atcoder ABC 157 # Problem B a = [] for i in range(3): a.append(list(map(int, input().split()))) n = int(input()) for _ in range(n): #b_n roop b = int(input()) for i in range(3): for j in range(3): if b == a[i][j]: a[i][j] = 0 #make a 0 for i in range(3): ...
user_features = { "demographic": { "age": 20, "gender": "M", "city": "Taipei", "career": "Software Engineer", }, "is_vol...
DEFAULT_SESSION_DURATION = 43200 # 12 hours SANDBOX_SESSION_DURATION = 60 * 60 # 1 hour BASTION_PROFILE_ENV_NAME = 'FIGGY_AWS_PROFILE' AWS_REGIONS = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'af-south-1', 'ap-east-1', 'ap-east-2', 'ap-northeast-3', 'ap-northeast-2', 'ap-northeast-1', 'ap-so...
# # SOFTWARE HISTORY # # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated class GetStationsRequest(object): def __init__(self): self.pluginName = Non...
def compute(): ans = sum(1 for i in range(10000) if is_lychrel(i)) return str(ans) def is_lychrel(n): for i in range(50): n += int(str(n)[ : : -1]) if str(n) == str(n)[ : : -1]: return False return True if __name__ == "__main__": print(compute())
# lecture 3.6, slide 2 # bisection search for square root x = 12345 epsilon = 0.01 numGuesses = 0 low = 0.0 high = x ans = (high + low)/2.0 while abs(ans**2 - x) >= epsilon: print('low = ' + str(low) + ' high = ' + str(high) + ' ans = ' + str(ans)) numGuesses += 1 if ans**2 < x: low = ans else:...
"""Implementation of Kotlin JS rules.""" load("@io_bazel_rules_kotlin//kotlin/internal:defs.bzl", "KtJsInfo") def kt_js_import_impl(ctx): """Implementation for kt_js_import. Args: ctx: rule context Returns: Providers for the build rule. """ if len(ctx.files.jars) != 1: fail("...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Question 010 Source : http://www.pythonchallenge.com/pc/return/bull.html what are you looking at ? len(a[30]) = ? a = [1, 11, 21, 1211, 111221] Solution : http://villemin.gerard.free.fr/Puzzle/SeqComme.htm """ a = ["1"] for i in range(31): # init value val...
#!/usr/bin/env python3 # imports go here # # Free Coding session for 2015-03-02 # Written by Matt Warren # class SimpleClass: def main(self): return "HI" def main2(self): return "HELLO AGAIN" if __name__ == '__main__': sc = SimpleClass() assert(sc.main.__name__ == 'main') fn = g...
r =int(input("enter the row:")) for i in range(1, r+1): for j in range(1, i+1): print("*", end = " ") print("\n") x = r for j in range(1, r): for i in range(1, x): print("*", end = " ") x = x - 1 print("\n")
app.config.from_envvar('FLASKR_SETTINGS', silent=True) def connect_db(): """Connects to the specific database.""" rv = sqlite3.connect(app.config['DATABASE']) rv.row_factory = sqlite3.Row return rv
# -*- coding: utf-8 -*- """ Project: EverydayWechat-Github Creator: DoubleThunder Create time: 2019-07-12 19:09 Introduction: """
with open("input.txt") as fin: points, folds = [x.splitlines() for x in fin.read().split("\n\n")] points = [tuple(int(x) for x in line.split(",")) for line in points] folds = [x.split()[2].split("=") for x in folds] def p1(points, i): axis, line = folds[i] line = int(line) res = set() if a...
class Solution: ''' 给定一个字符串 s ,找出 至多 包含 k 个不同字符的最长子串 T。 示例 1: 输入: s = "eceba", k = 2 输出: 3 解释: 则 T 为 "ece",所以长度为 3。 示例 2: 输入: s = "aa", k = 1 输出: 2 解释: 则 T 为 "aa",所以长度为 2。 ''' def lengthOfLongestSubstringKDistinct(self, s: str, k: int) -> int: ''' i: 添加元素到...
n = input('Qual é o seu nome? ') if n == 'Mariana': print('Seu nome é muito bonito!') elif n == 'Maria' or n == 'Pedro' or n == 'Paulo': print('Seu nome é bem comum no Brasil.') else: print('Seu nome é bem normal...') print('Tenha um bom dia, \033[33m{}\033[33m!'.format(n))
SERVIDOR_DESTINO = "BIGSQL" YAML_SCOOP_IMPORT = "sqoop-import" YAML_SCOOP_EXPORT = "sqoop-export" YAML_BIGSQL_EXEC = "bigsql-import" YAML_HDFS_IMPORT = "hdfs-import" YAML_HDFS_EXPORT = "hdfs-export" YAML_PYTHON_SCRIPT = "python-script" YAML_ORIGEM = "origem" YAML_DESTINO = "destino" YAML_TABLE = "tabela" YAML_QUERY =...
"""1423. Maximum Points You Can Obtain from Cards""" class Solution(object): def maxScore(self, cardPoints, k): """ :type cardPoints: List[int] :type k: int :rtype: int """ points = res = sum(cardPoints[:k]) c = cardPoints[::-1] for i in range(k): ...
{ # Ports for the left-side motors "leftMotorPorts": [0, 1], # Ports for the right-side motors "rightMotorPorts": [2, 3], # NOTE: Inversions of the slaves (i.e. any motor *after* the first on # each side of the drive) are *with respect to their master*. This is # different from the other po...