Skip to content

Instantly share code, notes, and snippets.

View gyk's full-sized avatar

Yukun Guo gyk

  • Hangzhou, China
  • 09:11 (UTC +08:00)
View GitHub Profile
@billti
billti / arm64-on-Win10.md
Last active May 12, 2024 08:17
ARM64 Linux on Win10

Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.

Install QEMU

Install for Windows from https://qemu.weilnetz.de/w64/ (I used qemu-w64-setup-20181211.exe)

Put C:\Program Files\qemu on your PATH, and run the below to check it's working (which will list out the CPUs the AArch64 emulator can emulate):

qemu-system-aarch64 -M virt -cpu help
@mikeananev
mikeananev / deps.edn
Created February 24, 2019 22:28
Clojure compress / decompress data examples
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
com.taoensso/nippy {:mvn/version "2.14.0"}
org.apache.commons/commons-compress {:mvn/version "1.18"}}}
@RickStrahl
RickStrahl / CompilingCSharpCode.cs
Last active April 3, 2024 14:11
A few different approaches to dynamically execute C# code dynamically at runtime from a string of code.
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Scripting;
using Microsoft.CodeAnalysis.Scripting;
using Mono.CSharp;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.Dynamic;
using System.Linq;
@HadrienG2
HadrienG2 / High_Performance_Rust.md
Last active March 13, 2024 00:31
Making Rust a perfect fit for high-performance computations

Hello, Rust community!

My name is Hadrien and I am a software performance engineer in a particle physics lab. My daily job is to figure out ways to make scientific software use hardware more efficiently without sacrificing its correctness, primarily by adapting old-ish codebases to the changes that occured in the software and computing landscape since the days where they were designed:

  • CPU clock rates and instruction-level parallelism stopped going up, so optimizing code is now more important.
  • Multi-core CPUs went from an exotic niche to a cheap commodity, so parallelism is not optional anymore.
  • Core counts grow faster than RAM prices go down, so multi-processing is not enough anymore.
  • SIMD vectors become wider and wider, so vectorization is not a gimmick anymore.
%!PS-Adobe-3.1 EPSF-3.0
%ADO_DSC_Encoding: Windows Cyrillic
%%Title: Guarantee Labels 1.eps
%%Creator: Adobe Illustrator(R) 16.0
%%For: Freshwater
%%CreationDate: 8/29/2016
%%BoundingBox: 0 0 600 600
%%HiResBoundingBox: 0 0 600 600
%%CropBox: 0 0 600 600
%%LanguageLevel: 2
@russss
russss / deskew.py
Created September 10, 2018 12:05
Automatic scanned image rotation/deskew with OpenCV
import cv2
import numpy as np
def deskew(im, max_skew=10):
height, width = im.shape
# Create a grayscale image and denoise it
im_gs = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
im_gs = cv2.fastNlMeansDenoising(im_gs, h=3)
@seanjensengrey
seanjensengrey / octal_x86.txt
Last active May 24, 2024 04:23
x86 is an octal machine
# source:http://geocities.com/SiliconValley/heights/7052/opcode.txt
From: mark@omnifest.uwm.edu (Mark Hopkins)
Newsgroups: alt.lang.asm
Subject: A Summary of the 80486 Opcodes and Instructions
(1) The 80x86 is an Octal Machine
This is a follow-up and revision of an article posted in alt.lang.asm on
7-5-92 concerning the 80x86 instruction encoding.
The only proper way to understand 80x86 coding is to realize that ALL 80x86
@yohhoy
yohhoy / av1-codec.md
Last active August 14, 2019 09:50
AV1 video codec memorandum

AV1 coding scheme

  • Arithmetic coding
    • multi-symbols (up to 16 values)
    • Coefficients coding: lv_map
    • CDF: Cumulative distribution function
      • CDF update (at the end of frame)
      • CDF update (adaptive per symbol)
  • Image blocking
@kizzx2
kizzx2 / with-env.ps1
Last active December 3, 2023 23:06
Run command with environment variables in PowerShell
$ori = @{}
Try {
$i = 0
# Loading .env files
if(Test-Path $args[0]) {
foreach($line in (Get-Content $args[0])) {
if($line -Match '^\s*$' -Or $line -Match '^#') {
continue
}