content stringlengths 7 1.05M |
|---|
for i in range(nBlocks):
# Load new block of data from CSV file
xTrain = createSparseTable('./mldata/20newsgroups.coo.' + str(i + 1) + '.csv', nFeatures)
# Load new block of labels from CSV file
labelsDataSource = FileDataSource(
'./mldata/20newsgroups.labels.' + str(i + 1) + '.csv',
Dat... |
# -*- coding: UTF-8 -*-
logger.info("Loading 6 objects to table households_type...")
# fields: id, name
loader.save(create_households_type(1,['Married couple', 'Ehepaar', 'Couple mari\xe9']))
loader.save(create_households_type(2,['Divorced couple', 'Geschiedenes Paar', 'Couple divorc\xe9']))
loader.save(create_househol... |
"""
Python program to solve N Queen
Problem using backtracking
"""
global N
def printSolution(board):
for i in range(N):
for j in range(N):
print(board[i][j], end="")
print()
def isSafe(board, row, col):
# Check this row on left side
for i in range(col):
if board[row][i] == 1:
ret... |
user = {
'name' : 'magdy' ,
'age' : ' 23 ' ,
'country' : ' egypt'
}
print(user)
print(type(user))
print(user.values())
print(user.keys())
print(len(user))
print(user['name'])
print(user['age'])
print("="*50) # separator
user['friend'] = 'sameh'
print(user)
user.update({'father' : 'edwar' , ... |
# 75
# Desenvolva um programa que leia quatro valores pelo teclado e guarde-os em uma tupla. No final, mostre: A) Quantas vezes apareceu o valor 9. B) Em que posição foi digitado o primeiro valor 3. C) Quais foram os números pares.
# Description
num = (int(input('Digite um número: ')),
int(input('Digite outro núm... |
""" Leetcode 62 - Unique Paths
https://leetcode.com/problems/unique-paths/
1. self-implement BFS: Time Limit Exceeded
2. self-implement DP: Time: 32ms(57.17%) Memory: 13.8MB(68.02%)
"""
class Solution1:
""" self-implement BFS """
def unique_paths(self, m: int, n: int) -> int:
if m == 1 and n == 1:
... |
class Solution(object):
def mySqrt(self, x):
"""
:type x: int
:rtype: int
"""
left = 0
right = x+1
while left < right:
mid = (left+right)//2
if mid*mid > x:
right = mid
elif mid*mid < x:
left... |
class DottableDict(dict):
"""能用点 '.' 访问的dict"""
def __init__(self, *args, **kwargs):
dict.__init__(self, *args, **kwargs)
for arg in args:
if isinstance(arg, dict):
for k, v in arg.items():
if isinstance(v, dict):
v = Dotta... |
def minimum():
l= [8, 6, 4, 8, 4, 50, 2, 7]
i=0
min=l[i]
while i<len(l):
if l[i]<min:
min=l[i]
i=i+1
print(min)
minimum() |
name = "ada lovelace"
#print(name.title())
#name refers to a the string "ada lovelace". The title *method* changes each word
#to title-case.
#A method is a specific function or group of funcitons that python can perform on
# a piece of data.
name = "adA LoveLace"
#print(name.upper())
#print(name.lower())
#print(n... |
def chunks(l, n):
'''
:rtype list
split a list into a list of sublists
'''
n = max(1, n)
return [l[i:i + n] for i in range(0, len(l), n)]
|
#memotong array bisa dengan menggunakan fungsi del
#dengan cara memasukkan angka dari urutan array
#array variable
#data array
a = ['medan', 'banjarmasin', 'jakarta', 'pekanbaru']
#saya ingin memotong array dengan menyisakan medan dan pekanbaru
del a[1:3]
print(a)
#hmm sepertinya jika menggunakan fungsi del akan d... |
"""
Empty pytest settings.
"""
SECRET_KEY = 'dummy secret key' # nosec
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.admin',
'django.contrib.messages',
'site_config_client',
]
FEATURES = {}
MIDDLEWARE = [
'django.contrib.auth.middleware.Authenticat... |
"""
Tuples are ecnlosed in parenthesis.
The values inside a tuple cannot be
changed.
"""
#declaring a tuple
flush = (1, 3, 4, 5)
print(flush[0]) #This will index 1 out of the tuple |
# Project Picframe
# Copyright 2021, Alef Solutions, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights# to use, copy, modify, ... |
#
# PySNMP MIB module HUAWEI-SLOG-EUDM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-SLOG-EUDM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:36:46 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... |
# -*- coding: utf-8 -*-
"""
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
"""
SETTING_FILENAME... |
class MljarException(Exception):
"""Base exception class for this module"""
pass
class TokenException(MljarException):
pass
class DataReadException(MljarException):
pass
class JSONReadException(MljarException):
pass
class NotFoundException(MljarException):
pass
class AuthenticationExceptio... |
class Invitation ():
def __init__(self, _id, sender, recipient):
self._id = _id
self.sender = sender
self.recipient = recipient
def __repr__(self):
return f'Invitation({self._id}, {self.sender}, {self.recipient})'
|
# coding=utf-8
"""
二叉树的前序遍历
给出一棵二叉树,返回其节点值的前序遍历。
思路:
先去了解二叉树, 再来解决问题
"""
"""
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
self.val = val
self.left, self.right = None, None
"""
class Solution:
"""
@param root: A Tree
@return: Preorder in ArrayList which contains n... |
class Brackets():
# You are given an expression with numbers, brackets and operators.
# For this task only the brackets matter.
# Brackets come in three flavors: "{}" "()" or "[]".
# Brackets are used to determine scope or to restrict some expression.
# If a bracket is open, then it must be clo... |
logo = '''
_____ _ _ _____ _
| __|_ _ ___ ___ ___ | |_| |_ ___ | | |_ _ _____| |_ ___ ___
| | | | | -_|_ -|_ -| | _| | -_| | | | | | | | . | -_| _|
|_____|___|___|___|___| |_| |_|_|___| |_|___|___|_|_|_|___|___|_|
''' |
def test():
print('software installed')
print('a new version')
print('version update')
|
#!/usr/bin/python3
"""
DOWNLOAD ALL THE PROBLEMS OF CODE FORCE
"""
CODEF_SET_URLS = list()
CODEF_SET_URLS.append("https://codeforces.com/problemset")
CODEF_SET_URLS.append("https://codeforces.com/problemset/acmsguru")
print("Code Forces Scrapping.")
|
# The Rabin-Karp Algorithm for Pattern Searching
# uses hashing to find patterns in text
# It is O(nm)
# ascii values go up to 255, so use 256 as a large prime number
d = 256
def rk(text, pat, q):
# q is a prime number for hashing
M = len(pat)
N = len(text)
i = 0
j = 0
pHash = 0
tHash = 0... |
'''
Blind Curated 75 - Problem 56
=============================
Meeting Rooms
-------------
Given an array of meeting time intervals consisting of start and end times, find
whether it is possible for one person to attend all meetings.
[→ LintCode][1]
[1]: https://www.lintcode.com/problem/meeting-rooms/description
'... |
#!/usr/bin/env python3
### PRIME FACTORIZATION ###
# The program make the user enter a number and find all prime factors (if there are any) and display them.
# Firstly, we define "factors", "prime" and "prime_factors".
factors = lambda a: [n for n in range(1, a + 1) if not a % n]
prime = lambda a: len(factors(a)) ... |
t=int(input())
while(t>0):
t=t-1
n,k=map(int,input().split())
n1=n
k1=k
l=[]
while(k1>1):
if(n%k!=0):
firstn=int(n/k)+1
elif(k==2):
firstn=int(n/2)+1
else:
firstn=int(n/k)
l.append(firstn)
n=n-firstn
... |
expected_output = {
"vrf": {
"default": {
"associations": {
"address": {
"172.31.32.2": {
"local_mode": {
"active": {
"isconfigured": {
"Tru... |
"""Test User API resources"""
def test_user_list__get_200(app, client, db, user):
res = client.get("/users/")
res_json = res.get_json()
assert res.status_code == 200
assert len(res_json) == 1
assert res_json[0]["id"] == str(user.id)
def test_user_list__post_200(app, client, db):
payload = [{... |
"""
expo.commands.app
~~~~~~~~~~~~~~~~~
hikari Application Command Handler.
:copyright: 2022 VincentRPS
:license: Apache-2.0
"""
# This is a COMING-SOON feature.
# it shouldn't be priority currently.
|
"""
Utils functions
"""
def print_bytes_int(value):
array = []
for val in value:
array.append(val)
print(array)
def print_bytes_bit(value):
array = []
for val in value:
for j in range(7, -1, -1):
array.append((val >> j) % 2)
print(array)
|
class Solution:
def isMatch(self, s: str, p: str) -> bool:
if not p: return not s
first_match = bool(s) and p[0] in {s[0], '.'}
if len(p) >= 2 and p[1] == '*':
return (self.isMatch(s, p[2:]) or first_match and self.isMatch(s[1:], p))
else:
return first_match ... |
school = {
"Cavell": ["Claim"],
"Master": ["Austin1975", "Wittgenstein2009"],
"Most cited": [
"Burge2010",
"Davidson2013",
"Dummett1973",
"Fodor1983",
"Frege1948",
"Kripke1980",
"Lewis2002",
"Putnam2004",
"Quine2013",
"Russell19... |
print("{}, {}, {}".format("a", "b", "c")) #By default position; most common
print("{2}, {1}, {0}".format("a", "b", "c")) #By numbered position
print("Coordinates: {latitude}, {longitude}".format(latitude="37.24N", longitude="-115.81W")) #By name; automatically handles format
print("Coordinates: {latitude}, {longi... |
##########################################################
# Author: Raghav Sikaria
# LinkedIn: https://www.linkedin.com/in/raghavsikaria/
# Github: https://github.com/raghavsikaria
# Last Update: 12-5-2020
# Project: LeetCode May 31 Day 2020 Challenge - Day 12
##########################################################... |
"""
Program: momentum.py
Project 2.11
Given an object's mass and velocity, compute its momentum
and kinetic energy.
"""
# Request the input
mass = float(input("Enter the object's mass: "))
velocity = float(input("Enter the object's velocity: "))
# Compute the results
momentum = mass * velocity
kin... |
def usuario_escolhe_jogada(n,m):
while n<=m:
print("Oops! Jogada inválida! Tente de novo")
n=int(input("Digite novamente o n"))
m=int (input("Digite novamente o m"))
jm=0
jm=int(input("Qual e o numero(s) de peça(s) retirada(s): "))
while jm>m or jm<=0:
print("Oo... |
def gb_syn():
return [
['MT-CO1','cox1','COX1','COI','coi','cytochome oxidase 1','cytochome oxidase I',
'cytochome oxidase subunit 1','cytochome oxidase subunit I',
'cox I','coxI', 'cytochrome c oxidase subunit I','CO1','cytochrome oxidase subunit 1',
'cytochrome ... |
BACKUP = {
# MAIN USER ID: BACKUP USER ID
# MAIN CHAT ID: BACKUP CHAT ID
-1001111111111: -1002222222222,
}
DEBUG = False # log outgoing events
|
"""data_index contains all of the quantities calculated by the compute functions.
label = (str) Title of the quantity in LaTeX format.
units = (str) Units of the quantity in LaTeX format.
units_long (str) Full units without abbreviations.
description (str) Description of the quantity.
fun = (str) Function name in comp... |
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]
m.sort()
x -= sum(m)
print(n + x // m[0])
|
#!/usr/bin/python
imagedir = parent + "/oiio-images"
files = [ "dpx_nuke_10bits_rgb.dpx", "dpx_nuke_16bits_rgba.dpx" ]
for f in files:
command += rw_command (imagedir, f)
|
n = input()
arr = list(map(int, input().split(' ')))
print(arr.count(max(arr)))
|
# 本参考程序来自九章算法,由 @ 提供。版权所有,转发请注明出处。
# - 九章算法致力于帮助更多中国人找到好的工作,教师团队均来自硅谷和国内的一线大公司在职工程师。
# - 现有的面试培训课程包括:九章算法班,系统设计班,算法强化班,Java入门与基础算法班,Android 项目实战班,
# - Big Data 项目实战班,算法面试高频题班, 动态规划专题班
# - 更多详情请见官方网站:http://www.jiuzhang.com/?source=code
class Solution:
# @param nums: The integer array
# @param target: Target n... |
cube=[value**3 for value in range(1,10)]
print(cube)
print("Los primero tres numeros de la lista son: " , cube[:3])
print("Los tres numeros centro de la lista son: " , cube[3:6])
print("Los ultimos tres numeros de la lista son: " , cube[6:]) |
class Demag(object):
def __init__(self):
pass
def get_mif(self):
mif = '# Demag\n'
mif += 'Specify Oxs_Demag {}\n\n'
return mif
|
"""
vigor - A collection of semi-random, semi-useful Python scripts and CLI tools.
"""
__version__ = '0.1.1'
__author__ = 'Ryan Liu <ryan@ryanliu6.xyz>'
"""
__all__ only affects if you do from vigor import *.
"""
__all__ = []
|
def divisible7(n):
for x in range(0,n):
if x%7==0:
yield x
print([x for x in divisible7(1000)]) |
getApproxError = lambda x_i, x_i_1: abs(x_i_1-x_i)/x_i_1 # For Percent error
def _NR_(xn, f, fp, iterations, n = 1, c_error = 1, p_error = 2):
if iterations == 0 or c_error > p_error:
return xn
xr = xn - f(xn)/fp(xn)
p_error = c_error
c_error = getApproxError(xn, xr)
... |
class Solution:
def reverseParentheses(self, s: str) -> str:
#initialize a stack to keep track of left bracket indexes
leftBracketIndices = []
#iterate through the string
outputString = s
index = 0
while index < len(outputString):
if outp... |
# -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class TypeFlashBladeProtectionSourceEnum(object):
"""Implementation of the 'Type_FlashBladeProtectionSource' enum.
Specifies the type of managed object in a Pure Storage FlashBlade
like 'kStorageArray' or 'kFileSystem'.
'kStorageArray' indicates ... |
students = ['Ivan', 'Masha', 'Sasha']
students += ['Olga']
students += 'Olga'
print(len(students))
|
class OpenSRSError(Exception):
"""Base class for errors in this library."""
pass
class XCPError(OpenSRSError):
def __init__(self, response_message):
self.response_message = response_message
self.message_data = response_message.get_data()
self.response_code = self.message_data['resp... |
def rot_char(character, n):
"""Rot-n for a single character"""
if character.islower():
return chr(((ord(character)-97+n)%26)+97)
elif character.isupper():
return chr(((ord(character)-65+n)%26)+65)
else:
return character
def rot_n(plaintext,n):
"""Implementation of caesar cyp... |
#!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'chuangyudun (zhidaochuangyu Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<span class="r-tip01"><%= error_403 %>'),
self.matchContent(r"'hacker';"),
... |
#replace username,pwd, api_key with yours
USER_NAME = '6565'
PWD = '6g!fdfgd'
API_KEY = '657hgg'
#Dont change below varibale
FEED_TOKEN = None
TOKEN_MAP = None
SMART_API_OBJ = None
|
"""
Summary:
--------
0416: sequence labeling, with granularity 1/4 of the signal's frequency
0433: (subtract) unet
0436: object detection (yolo)
0430: unet
0437: unet (+lstm)
0343: unet/lstm/etc.
0348: crnn (cnn no downsampling)
"""
|
nome = input("Insira o seu nome: ")
print()
print("____________00____00___00000___0000000__0000000__00____00___________")
print("____________00____00__00___00__00___00__00___00___00__00____________")
print("____________00000000__0000000__000000___000000______00______________")
print("____________00____00__00___00__00__... |
#!/usr/bin/python2
# Copyright (c) 2017 Public Library of Science
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, cop... |
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class MyLinkedList(object):
def __init__(self):
"""
Initialize your data structure here.
"""
self.head = None
self.length = 0
def get(self, index):
"""
Get the val... |
# -*- coding: UTF-8 -*-
class Values():
def __init__(self):
return None
class ScreenIdValue():
def DEFAULT():
return 0
def GOOGLE_SEARCH():
return 1
class AccountTitleClassificationTypeValue():
def __init__(self, account_title_value):
self.__account_title_valu... |
S = input()
#win = S.count("o")
lose = S.count("x")
if lose <= 7:
print("YES")
else:
print("NO")
|
class Fish:
def __init__(self, color, age):
self.color = color
self.age = age
def speed_up(self, speed):
print("Move speed to "+speed+" mph")
p1 = Fish("blue","0.5")
print(p1.color)
print(p1.age)
p1.speed_up("100") |
def smallest_range(nums, k):
difference = max(nums) - min(nums)
if 2 * k >= difference:
return 0
else:
return difference - 2 * k
print(smallest_range([0, 10], 2))
print(smallest_range([1, 3, 6], 3))
print(smallest_range([1], 0))
print(smallest_range([9, 9, 2, 8, 7], 4))
|
# Exercício 056:
'''Desenvolva um programa que leia o nome, idade e sexo de 4 pessoas. No final do programa, mostre:
- A média de idade do grupo;
- Qual é o nome do homem mais velho;
- Quantas mulheres têm menos de 21 anos.'''
soma = 0
homem = 0
velho = 0
idoso = 0
mulher = 0
for c in range(1, 5):
nome = str(inpu... |
# Default `TAR` package extensions.
# Please change the below value to suit your corresponding environment requirement.
TAR_EXTENSION = {'gz': '.tar.gz', 'bz2': '.tar.bz2'}
# Store the `TAR` extracts in the below destination directory option.
TAR_BASE_EXTRACT_DIRECTORY = '/home/vagrant/downloads/MW_AUTOMATE/TarEx... |
class QuizBrain:
def __init__(self, question_list):
"""takes a list of questions as input. questions are dicts with text and answer keys."""
self.question_list = question_list
self.question_number = 0
self.score = 0
def next_question(self):
"""will ... |
__import__('pkg_resources').declare_namespace(__name__)
version = (0, 1, 4)
__version__ = ".".join(map(str, version))
|
# -*- coding: utf-8 -*-
class Card:
""" generic game card """
def __init__(self, value):
self.value = value
def __eq__(self, other_card):
return self.value == other_card.value
def __ne__(self, other_card):
return self.value != other_card.value
def __lt__(self, other_card)... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# src/model.py
# Author : Irreq
"""
DOCUMENTATION: Define the model.
TODO: Everything.
Implement the CNN and fix the core of
modem.
"""
|
USER_NAME = 'Big Joe'
USER_EMAIL = 'bigjoe@bigjoe.com'
USER_PASSWORD = 'bigjoe99'
def delete_user(login_manager, email):
"""Delete given user"""
try:
login_manager.delete_user(email=email)
except Exception:
pass
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
#######################################
# Author: Jorge Mauricio
# Email: jorge.ernesto.mauricio@gmail.com
# Date: 2018-02-01
# Version: 1.0
#######################################
Objetivo:
Escribe un programa que calcule el valor neto de una cuenta de banco basado
e... |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
"""
Given a Binary Search Tree (BST) with the root node root, return the minimum
difference between the values of any two different nodes in the tree... |
class FileWriter:
def __init__(self):
pass
def Write(self, path, record):
with open(path, 'w') as f:
if None is not record['Title'] and 0 != len(record['Title']):
f.write(record['Title'])
f.write('\n\n')
f.write(record['Content'])
|
expected_output = {
'red_sys_info': {
'available_system_uptime': '21 weeks, 5 days, 1 hour, 3 minutes',
'communications': 'Down',
'communications_reason': 'Simplex mode',
'conf_red_mode': 'sso',
'hw_mode': 'Simplex',
'last_switchover_reason... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 24 10:52:22 2018
@author: haiwa
"""
|
"""
Datos de entrada
edad_uno-> e_uno-->int
edad_dos--> e_dos-->int
edad_tres--> e_tres-->int
Datos de salida
promedio-->p-->float
"""
# Entradas
e_uno=int(input("Digite edad uno : "))
e_dos=int(input("Digite edad dos : "))
e_tres=int(input("Digite edad tres : "))
# Caja Negra
p=((e_uno+e_dos+e_tres)/3)#float
# Salidas... |
""" 43: Desenvolva uma lógica que leia o peso e a altura de uma pessoa, calcule seu Índice de Massa Corporal (IMC) e
mostre seu status, de acordo com a tabela abaixo:
- IMC abaixo de 18,5: Abaixo do Peso
- Entre 18,5 e 25: Peso Ideal
- 25 até 30: Sobrepeso
- 30 até 40: Obesidade
- Acima de 40: Obesidade Mórbida """
pe... |
#
# ----------------------------------------------------------------------------------------------------
# DESCRIPTION
# ----------------------------------------------------------------------------------------------------
#
# --------------------------------------------------------------------------------------------... |
'''052 - NÚMEROS PRIMOS
'''
numero = int(input('Digite um valor: '))
totaldivisoes = 0
for sequencia in range(1, numero + 1):
if numero % sequencia == 0:
print('\033[32m', end=' ')
totaldivisoes = totaldivisoes + 1
else:
print('\033[31m', end=' ')
print(sequencia, end=' ')
print('\n... |
# https://www.codewars.com/kata/5276c18121e20900c0000235/
'''
Instructions :
Background:
You're working in a number zoo, and it seems that one of the numbers has gone missing!
Zoo workers have no idea what number is missing, and are too incompetent to figure it out, so they're hiring you to do it for them.
In case ... |
class Network:
'''
TODO: Document this
'''
def train(self, **kwargs):
'''
Train the network
'''
raise NotImplementedError
|
# Declaration
x, y, z = 1, 2, 3
p, q, r = (1, 2, 3)
# In function definition
def f(*a):
print(a[0])
f([1, 2, 3], [2])
# In function calls
def g(a, b):
print(a + b)
g(*[1,2])
|
"""
author: Shawn
time : 11/9/18 6:41 PM
desc :
update: Shawn 11/9/18 6:41 PM
""" |
DEFAULT_TAGS = {
'Key': 'Solution',
'Value': 'DataMeshUtils'
}
DOMAIN_TAG_KEY = 'Domain'
DATA_PRODUCT_TAG_KEY = 'DataProduct'
DATA_MESH_MANAGER_ROLENAME = 'DataMeshManager'
DATA_MESH_ADMIN_PRODUCER_ROLENAME = 'DataMeshAdminProducer'
DATA_MESH_ADMIN_CONSUMER_ROLENAME = 'DataMeshAdminConsumer'
DATA_MESH_READONLY... |
"""
219. Contains Duplicate II
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is at most k.
Example 1:
Input: nums = [1,2,3,1], k = 3
Output: true
Example 2:
Input: nums = [1,0,1... |
class Bounds:
def __init__(self, minimum, maximum):
self.minimum = minimum
self.maximum = maximum
def keep_in_bounds(self, value):
if value < self.minimum:
return self.minimum
if value > self.maximum:
return self.maximum
return value
|
# Description: Run the PE75 function from the pymolshortcuts.py file to show the pearl effect with the inner sphere scaled by 0.75 of the van der Waals surface.
# Source: placeHolder
"""
cmd.do('cmd.do("PE75")')
"""
cmd.do('cmd.do("PE75")')
|
"""
Write a Python program to convert a list of multiple integers into a single integer.
"""
l = [11, 33, 50]
print("Original List: ", l)
x = int("".join(map(str, l)))
print("Single integer: ",x) |
company = 'Tesla'
model = 'Model 3'
fsd = 12000
base_price = 36000
tax_per = 7.5
retail = (fsd + base_price)
tax = ((fsd + base_price) * tax_per )/100
print(retail+tax)
print(type(company))
print(type(base_price))
print(type(tax_per))
print(type(retail))
|
'''
import gym
from myrl.environments.environment import Environment
def make(name, gamma):
if name == 'CartPole-v0':
return GymCartPole(name=name, gamma=gamma)
else:
raise ValueError('Agent name [' + name + '] not found.')
class GymCartPole(Environment):
def __init__(self, name, gamma... |
# -*- coding: utf-8 -*-
#
class AB2R():
# AB2/TR method as described in 3.16.4 of
#
# Incompressible flow and the finite element method;
# Volume 2: Isothermal laminar flow;
# P.M. Gresho, R.L. Sani.
#
# Here, the Navier-Stokes equation is written as
#
# Mu' + (K+N(u)... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# file_name: COMMON.py
# author: ScCcWe
# time: 2022/3/5 9:32 上午
DEBUG = True
MODULE_NAME = "pymysql_dao"
|
#!/usr/bin/env python
"""
_ThreadPool_t_
ThreadPool test methods
"""
__all__ = []
|
# Scrapy settings for worldmeters project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middle... |
# Multiplicación
x, y, z = 0.1, 10, 12
a = x * y * z # 12.0
a = x * x * x # 0.001
a = y * y * y # 1000
a = x * z * z # 14.4
a = z * z # 144
a = y * z * y # 1200
print("Final") |
class Maximum(Bound):
__metaclass__ = ABCMeta
class MaximumWidth(
Property,
Minimum,
):
pass
class MinimumHeight(
Property,
Minimum,
):
pass
|
"""
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.
You should try to do it in place. The program should run in O(1) space complexity and O(nodes) time complexity.
Example 1:
Input: 1->2->3->4->... |
# Good morning! Here's your coding interview problem for today.
# This problem was asked by Stripe.
# Given an array of integers, find the first missing positive integer in linear time and constant space.
# In other words, find the lowest positive integer that does not exist in the array.
# The array can contain duplic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.