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 PIL import Image | |
def convert_webp_to_gif(webp_file, gif_file): | |
# Open the WEBP file using the PIL library | |
webp_image = Image.open(webp_file) | |
# Initialize lists to store the frames and durations of the WEBP image | |
frames = [] | |
durations = [] | |
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 | |
import aiohttp | |
from bs4 import BeautifulSoup | |
base_url = "https://control.fandom.com" | |
all_collectibles = "/wiki/Collectibles/List_of_Collectibles" | |
def stats(text): |
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
# Minimum moves solver for https://www.funnyhowtheknightmoves.com/ | |
from collections import deque | |
import chess | |
def main(): | |
destinations = [chess.F8, chess.E8, chess.C8, chess.B8, | |
chess.H7, chess.G7, chess.E7, chess.C7, chess.A7, |
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 BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using CommunityToolkit.HighPerformance; | |
public struct Position { | |
public float x; | |
public float y; | |
}; | |
public class TestStructModification { |
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 argparse | |
import math | |
import multiprocessing | |
import os | |
import itertools as it | |
from scipy import ndimage | |
from skimage.metrics import structural_similarity | |
import cv2 | |
import numpy as np |
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 | |
import time | |
import pygame | |
class Vector: | |
def __init__(self, p1, p2): | |
self.x1, self.y1 = p1 | |
self.x2, self.y2 = p2 |
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
package main | |
import ( | |
"fmt" | |
"sort" | |
"strings" | |
) | |
type Shape struct { | |
grid [][]bool |
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
use rdev::{simulate, grab, Event, EventType, Key}; | |
static mut SIMULATED: u32 = 0; | |
fn main() { | |
if let Err(error) = grab(callback) { | |
println!("Error: {:?}", error) | |
} | |
} |
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
I’ve just finished reading through the now approved proposal for generics in Go and am beyond excited. | |
Speaking as someone who works for a major tech company that uses primarily Go, and having personally been writing Go on-and-off for over 5 years, I believe this will be a huge game changer. | |
In particular, this will very strongly support and encourage companies to use Go for higher performance critical projects as opposed to C++ or Rust. Allow me to illustrate why I believe this to be the case. | |
I’m a big fan of Rust as well, and had attempted to introduce it at work in the past. It’s difficult to integrate, and the learning curve is a problem, as well as general complexity in comparison to the extreme ergonomics of Go. | |
Why Rust? Rust has no garbage collector, and is certainly faster than Go, due to having effectively no runtime. For real time computing, projects with extreme performance requirements, or with strict memory budgets, Rust will still be superior. | |
However, there’s a middle ground where Go will now |
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 string | |
import requests | |
letters = 'lairodm' | |
must_have = 'm' | |
length = 4 | |
raw = requests.get( | |
'https://raw.githubusercontent.com/dwyl/english-words/master/words_alpha.txt').text.split('\n') |
NewerOlder