This file contains hidden or 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
# See Veritasium's video: https://www.youtube.com/watch?v=iSNsgj1OCLA | |
import numpy as np | |
from numba import njit | |
@njit | |
def process(n: int = 100, series: int = 10_000) -> int: | |
retval: int = 0 |
This file contains hidden or 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 atexit | |
import ctypes | |
import sys | |
from ctypes import wintypes | |
from enum import Enum | |
import keyboard | |
from win32con import * | |
user32 = ctypes.windll.user32 |
This file contains hidden or 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
""" | |
win32api.MapVirtualKey - Documentation and usage examples | |
================================================================ | |
SIGNATURE: | |
----------- | |
win32api.MapVirtualKey(uCode, uMapType) -> int | |
PARAMETERS: | |
---------- |
This file contains hidden or 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 threading import Thread | |
from typing import List | |
from win32api import SendMessage, GetKeyboardLayoutName, GetKeyboardLayoutList | |
from win32con import WM_INPUTLANGCHANGEREQUEST | |
from win32gui import WNDCLASS, GetModuleHandle, RegisterClass, CreateWindow, PumpMessages | |
INPUTLANGCHANGE_SYSCHARSET: int = 0x0001 | |
hidden_window_hwnd: int = 0 |
This file contains hidden or 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 random | |
from numba import cuda | |
import numpy as np | |
import cupy as cp | |
H_DATA = np.random.uniform(0, 40, 128).astype(np.float32) | |
@cuda.jit |
This file contains hidden or 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 multiprocessing | |
from datetime import datetime | |
from multiprocessing import Process | |
from typing import List | |
import numpy as np | |
NUM_ITERATIONS: int = 1_000_000 | |
KEY_SIZE: int = 20 |
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 hidden or 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
# MIT License | |
# | |
# Copyright (c) 2024 Oleksii Sylichenko | |
# | |
# 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, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains hidden or 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 static org.junit.jupiter.api.Assertions.assertEquals; | |
import org.junit.jupiter.api.Test; | |
import org.junit.jupiter.params.ParameterizedTest; | |
import org.junit.jupiter.params.provider.Arguments; | |
import org.junit.jupiter.params.provider.MethodSource; | |
import java.util.stream.Stream; | |
/** |
This file contains hidden or 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
activity_maps.xml: | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:map="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<fragment |