Skip to content

Instantly share code, notes, and snippets.

@paulnice
paulnice / gist:ff49f2337d87d7255b1bd2c14c6dbdb1
Created July 16, 2023 16:06 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
@paulnice
paulnice / m1-max-numpy-setup.md
Created May 1, 2023 05:23 — forked from MarkDana/m1-max-numpy-setup.md
Install NumPy on M1 Max

How to install numpy on M1 Max, with the most accelerated performance (Apple's vecLib)? Here's the answer as of Dec 6 2021.


Steps

I. Install miniforge

So that your Python is run natively on arm64, not translated via Rosseta.

  1. Download Miniforge3-MacOSX-arm64.sh, then
  2. Run the script, then open another shell
$ bash Miniforge3-MacOSX-arm64.sh
@paulnice
paulnice / interesting_crates.md
Created June 23, 2022 21:24 — forked from vi/interesting_crates.md
List of crates that improves or experiments with Rust, but may be hard to find

Let's list here crates that enhance Rust as a language.

It not "batteries" like in stdx, but Rust-specific crates for workarounds for various missing features and experimental ideals from non-accepted/postponed RFCs, or just hacky tricks.

The list is supposed to contain (mostly) crates that are internal to Rust, not ones for making Rust deal with "external world" like other languages bindings, file formats, protocols and so on.

Primary focus should be on crates that are not easy to find by conventional means (e.g. no algorithm name, format or protocol to search for).

Note that quality of the listed crates may vary from proof-of-concept to stable-and-widely-used.

@paulnice
paulnice / Dockerfile
Created March 31, 2021 20:33 — forked from kangasta/Dockerfile
Multiple vhostuser ports example with testpmd
FROM ubuntu:bionic
RUN apt-get update && apt-get install -y dpdk;
ENTRYPOINT ["bash"]

why doesn't radfft support AVX on PC?

So there's two separate issues here: using instructions added in AVX and using 256-bit wide vectors. The former turns out to be much easier than the latter for our use case.

Problem number 1 was that you positively need to put AVX code in a separate file with different compiler settings (/arch:AVX for VC++, -mavx for GCC/Clang) that make all SSE code emitted also use VEX encoding, and at the time radfft was written there was no way in CDep to set compiler flags for just one file, just for the overall build.

[There's the GCC "target" annotations on individual funcs, which in principle fix this, but I ran into nasty problems with this for several compiler versions, and VC++ has no equivalent, so we're not currently using that and just sticking with different compilation units.]

The other issue is to do with CPU power management.

@paulnice
paulnice / Legend.md
Created March 24, 2018 21:16 — forked from sigrlami/ab.md
List of companies using Haskell

Types of work:

  • RD - research&development
  • PR - product
  • IP - in-house product
  • CO - consulting

This doesn't mean it's only way company works. Many have inner products, but this key describes type of work that presumably prevails.

@paulnice
paulnice / tmux-cheats.md
Created March 23, 2018 19:53 — forked from Starefossen/tmux-cheats.md
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@paulnice
paulnice / linux.sh
Created February 27, 2018 23:06 — forked from marcan/linux.sh
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@paulnice
paulnice / introrx.md
Created February 9, 2018 06:54 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing