This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ones(num: int, number_of_bytes: int = 4) -> int: | |
num_ones = 0 | |
for i in range(number_of_bytes * 8): | |
if (2 ** i) & num: | |
num_ones += 1 | |
return num_ones | |
def ones(num: int) -> int: | |
bin_string = f"{num:b}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
with open('szavak.txt', encoding="utf-8") as f: | |
szavak = f.read().split() | |
ossz = len(szavak) | |
szamlalo = Counter(szo for szo in szavak) | |
for szo, darab in szamlalo.most_common(8): | |
print(f"{darab/ossz*100:5.2f}% {szo} ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
import unittest | |
from typing import Callable | |
class LoaderFactory: | |
def __init__(self) -> None: | |
self.registered_functions = dict( | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open("naplo.txt") as f: | |
lines = f.readlines() | |
hi = [] | |
for l in lines: | |
if l[0] != '#': | |
hi.append(l) | |
print(f'A naplóban {len(hi)}') | |
# Ugyanezt csinálja, list comprehension néven kereshetsz rá |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def clock(): | |
maxdiff_ = 90 | |
for h in range(12): | |
for m in range(60): | |
for s in range(60): | |
current_diffs = diffs(h, m, s) | |
current_maxdiff = maxdiff(current_diffs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def clock(): | |
maxdiff_ = 90 | |
for h in range(12): | |
for m in range(60): | |
for s in range(60): | |
current_diffs = diffs(h, m, s) | |
current_maxdiff = maxdiff(current_diffs) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
article | name | birth | death | nationality | notable_21_century_works | era | |
---|---|---|---|---|---|---|---|
Cassandra_Miller | Cassandra Miller | 1976 | Canadian | About Bach (string quartet) | 21st-century classical | ||
Caio_Fac%C3%B3 | Caio Facó | 1992 | Brazilian | Diário das Narrativas Fantásticas: Uma fantasia sobre a história da América do Sul (for chamber orchestra)[1] | 21st-century classical | ||
Rolf_Riehm | Rolf Riehm | 1937 | German | Sirenen (opera) | 21st-century classical | ||
Hiro_Fujikake | Hiro Fujikake | 1949 | Japan | Pastoral Fantasy (1975),The Rope Crest (1977), Symphony Japan(1993), Symphony IZUMO(2005) | 21st-century classical | ||
Ann_Cleare | Ann Cleare | 1983 | Irish | Claustrophobia (orchestra) | 21st-century classical | ||
Sarah_Hutchings | Sarah Hutchings | 1984 | American | 21st-century classical | |||
Peter_Seabourne | Peter Seabourne | 1960 | English | Steps piano cycle series – 6 volumes | 21st-century classical | ||
Eric_Salzman | Eric Salzman | 1933 | 2017 | American | The True Last Words of Dutch Schultz (opera) | 21st-century classical | |
Johannes_Kreidler | Johannes Kreidler | 1980 | German | Fremdarbeit | 21st-century classic |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uloc=RTP, NC & around the world | |
new TSplit: ['rtp', 'nc', '&', 'around', 'the', 'world'] | |
old TSplit: ['rtp,', '&', 'around', 'nc & around the world', 'world', 'rtp', 'the', 'nc'] | |
uloc=SOUTHERN CAMEROONS | |
new TSplit: ['southern', 'cameroons'] | |
old TSplit: ['cameroons', 'southern', 'southern cameroons'] | |
uloc=Bhopal, Madhya pradesh, India | |
new TSplit: ['bhopal', 'madhya', 'pradesh', 'india'] | |
old TSplit: ['bhopal,', 'india', 'pradesh,', 'madhya pradesh', 'bhopal', 'madhya'] | |
uloc=Malibu, CA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for root, _, files in os.walk("."): | |
print('root: ', root) | |
for file in files: | |
if file.endswith(".py"): | |
with open(os.path.join(root, file)) as f: | |
b = f.read() | |
print(file, b.count('\n')) |