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
/// <summary> | |
/// Implementation of the "Sieve of Eratosthenes" algorithm for generating prime numbers up to N in C# | |
/// </summary> | |
public static class SieveOfEratosthenes { | |
/// <summary> | |
/// Checking for a prime number with <see cref="Sieve(int)"/> | |
/// </summary> | |
/// <param name="num">Number to check</param> | |
/// <returns>Is <paramref name="num"/> prime number or not</returns> |
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 asyncio, time | |
from typing import List | |
class Toast: | |
is_fried = False | |
with_butter = False | |
with_jam = False | |
def start_fry(self): | |
print("Начинаем готовить тост.") | |
def end_fry(self): |
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
namespace AdvFormat; | |
/// <summary> | |
/// Advanced (and better) keyword-based format (with extension methods) | |
/// </summary> | |
public static class AdvFormat { | |
/// <summary> | |
/// Format string from dict with keywords | |
/// </summary> | |
/// <param name="srcStr">Source string (string to format)</param> | |
/// <param name="format">Dictionary, where keys is keyword for format, and values is values!</param> |
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 json as j, hashlib, os | |
def chinteg(): | |
res = [] | |
for f in [str(i) for i in sorted([int(ii) for ii in os.listdir('./blocks/')])][1:]: | |
h = j.load(fi:=open('./blocks/'+f, 'r'))['hash']; fi.close() | |
with open('./blocks/'+str(int(f)-1), 'rb') as fp: h2 = hashlib.md5(fp.read()).hexdigest() | |
res.append((int(f)-1, h2 == h)) | |
return res |
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
# pyperclip is recommended (pip install pyperclip) | |
# you can replace `__import__("pyperclip").copy(...)` with just `print(...)` | |
# one line verson | |
__import__("pyperclip").copy("".join(__import__('random').choices(__import__('string').printable[:-6], k=24))) # ; print("Generated"); __import__("time").sleep(3) | |
# "prettier" version | |
__import__("pyperclip").\ | |
copy( | |
"".join( |
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
using Godot; | |
/// <summary> | |
/// Freecam (or "Noclip") camera / Свободная (или "ноуклип") камера | |
/// </summary> | |
public class Freecam : Camera { | |
[Export] | |
public float speed = 1; // Cam movement speed / Скорость движения | |
[Export] | |
public float sensivity = .01f; // Mouse sensivity / Сенса (чувствительность) мыши | |
[Export] |