Skip to content

Instantly share code, notes, and snippets.

View herberteuler's full-sized avatar

Guanpeng Xu herberteuler

  • Burnaby, BC, Canada
  • 13:12 (UTC -07:00)
View GitHub Profile
@jnulzl
jnulzl / libtorch_all_version.md
Created January 21, 2022 01:44
Win && Linux libtorch 1.4.0 ~ 1.10.1 gpu&&cpu version url

Linux libtorch 1.4.0 ~ 1.10.1 gpu version url

  • cxx11 ABI
libtorch-cxx11-abi-shared-with-deps-1.4.0+cu92.zip : https://download.pytorch.org/libtorch/cu92/libtorch-cxx11-abi-shared-with-deps-1.4.0%2Bcu92.zip
libtorch-cxx11-abi-shared-with-deps-1.4.0+cu100.zip : https://download.pytorch.org/libtorch/cu100/libtorch-cxx11-abi-shared-with-deps-1.4.0%2Bcu100.zip
libtorch-cxx11-abi-shared-with-deps-1.4.0.zip : https://download.pytorch.org/libtorch/cu101/libtorch-cxx11-abi-shared-with-deps-1.4.0.zip
libtorch-cxx11-abi-shared-with-deps-1.5.0+cu92.zip : https://download.pytorch.org/libtorch/cu92/libtorch-cxx11-abi-shared-with-deps-1.5.0%2Bcu92.zip
// Estimating CPU frequency...
// CPU frequency: 4.52 GHz
// sum1: value = 15182118497126522709, 0.31 secs, 5.14 cycles/elem
// sum2: value = 15182118497126522709, 0.17 secs, 2.93 cycles/elem
#define RW(x) asm("" : "+r"(x))
typedef struct Node {
u64 value;
struct Node *next;
@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active March 18, 2024 14:57
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?

@Kazark
Kazark / sqrt.scm
Created July 2, 2020 22:20
A playful implementation of square root in Guile, with a Haskell flavor
#| An obfuscated Haskell-style solution to exercise 1.7 from SICP in Guile.
|
| The basis of this solution is the idea: the numerical method for square root
| does not inherently have any notion of what is means for the solution to be
| "good enough"; that is an _orthogonal_ concern. The inherent idea, in its
| purest form, is a limit of the algorithm considered as a function of the
| number of iterations. Therefore, it would be pleasing in our implementation
| to divorce the idea of what "good enough" means from our expression of the
| algorithm. But this requires an infinite data structure, because if we do not
| have an infinite data structure, we must from the first think about when to
@edolstra
edolstra / nix-lang.md
Last active May 2, 2024 23:39
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to
@nelsonenzo
nelsonenzo / letsencrypt-route53.md
Created February 15, 2018 21:06
Generate letsencrypt SSL certificates using acme.sh and Route53

letsencrypt + route53

what will you learn?

How to use letsencrypt to generate ssl certificates and keys locally for any domain you own, using DNS entries for domain ownership validation.

requirements

  • aws keys with rights to read/write AWS Route53 for the domain in question
  • bash
@yamaguchiyuto
yamaguchiyuto / btree.hs
Last active November 1, 2023 03:07
Haskell B-tree implementation
data Tree a = Nil Int | Leaf Int [a] | Node Int [a] [Tree a] deriving Show
find :: (Ord a, Eq a) => Tree a -> a -> Bool
find (Nil _) _ = False
find (Leaf _ []) _ = False
find (Leaf m (k:ks)) x
| x == k = True
| x < k = False
| x > k = find (Leaf m ks) x
find (Node _ [] (t:ts)) x = find t x
@vinnyoodles
vinnyoodles / kmp.java
Created December 30, 2016 22:30
Knuth Morris Pratt string searching algorithm in Java
import java.util.Scanner;
public class KMP {
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
String search = kb.next();
String target = kb.next();
int result = KMP(search, target);
if (result == -1) {
System.out.println("NO");