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 typing import List, Self, Union | |
import math | |
import copy | |
class Ratio: | |
numerator: int | |
denominator: int | |
def __init__(self, numerator: int, denominator=1): |
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
impl FrameProcessor { | |
pub fn new() -> Self { | |
let device = NdArrayDevice::default(); | |
let detector: detector::Model<Backend> = detector::Model::default(); | |
let recognizer: recognizer::Model<Backend> = recognizer::Model::default(); | |
Self { | |
device, | |
detector, | |
recognizer, |
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
čen 18 09:24:24 Simon-s-Tuxedo-InfinityBook-14-Gen8 systemd-logind[1668]: Lid closed. | |
čen 18 09:24:24 Simon-s-Tuxedo-InfinityBook-14-Gen8 systemd-logind[1668]: Suspending... | |
čen 18 09:24:24 Simon-s-Tuxedo-InfinityBook-14-Gen8 tailord[1678]: INFO tailord::suspend: Suspended, sleeping until wake up. | |
čen 18 09:24:24 Simon-s-Tuxedo-InfinityBook-14-Gen8 ModemManager[68914]: <msg> [sleep-monitor-systemd] system is about to suspend | |
čen 18 09:24:24 Simon-s-Tuxedo-InfinityBook-14-Gen8 dbus-daemon[1599]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.6' (uid=0 pid=1713 comm="/nix/store/mlwlbq4cgi28h4j69s3brqql9d7rlcqm-networ" label="kernel") | |
čen 18 09:24:24 Simon-s-Tuxedo-InfinityBook-14-Gen8 systemd[1]: Starting Network Manager Script Dispatcher Service... | |
čen 18 09:24:24 Simon-s-Tuxedo-InfinityBook-14-Gen8 dbus-daemon[1599]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher' | |
čen 18 09:24:24 Simon-s- |
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 math | |
n = int(input()) | |
def some_sum(): | |
s = 0 | |
for m in range(1, n+1): | |
s += ((-1)**(m-1)) * (1/math.factorial(m)) |
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
const MAX_NGRAM_LENGTH = 5; | |
const inputString = "Hello Alice how are you doing at the moment"; | |
const findNgram = ( | |
words: String[], | |
length: number, | |
startIndex: number | |
): String | undefined => { | |
if (startIndex + length > words.length) return; |
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
const text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; | |
let currentSentence = ""; | |
let longestSentence = ""; | |
let numberOfSentences = 0; | |
let numberOfWords = 0; | |
const numberOfLettersInSentence = (sentence) => Array.from(sentence).reduce((acc, curr) => { | |
if (curr !== " ") return acc + 1; | |
return acc; |