Skip to content

Instantly share code, notes, and snippets.

@jalavik
jalavik / unicode_to_latex.py
Created May 17, 2011 11:04 — forked from beniwohli/unicode_to_latex.py
Map to convert unicode characters to their respective LaTeX representation
# original XML at http://www.w3.org/Math/characters/unicode.xml
# XSL for conversion: https://gist.github.com/798546
unicode_to_latex = {
u"\u0020": "\\space ",
u"\u0023": "\\#",
u"\u0024": "\\textdollar ",
u"\u0025": "\\%",
u"\u0026": "\\&",
@mgedmin
mgedmin / demo.txt
Created December 12, 2012 16:25
Fixing Mako tracebacks (version 2)
$ virtualenv /tmp/sandbox
...
$ /tmp/sandbox/bin/pip install mako
...
$ /tmp/sandbox/bin/python mako_tb.py
= Default traceback =
@whyrusleeping
whyrusleeping / archsetup.md
Last active May 11, 2019 17:15
arch linux setup guide for samsung chromebook 2

Arch Linux Chromebook 2 Setup

First, follow the instructions on this page up until it tells you to unmount root: http://archlinuxarm.org/platforms/armv7/samsung/samsung-chromebook-2

Dont unmount root yet. you need to run cp /lib/firmware/mrvl/* root/lib/firmware/mrvl

This copies the proper wireless drivers to your new installation (otherwise wireless will NOT work)

Now you can umount root and sync and reboot.

After rebooting, press Ctrl + u at the boot screen to boot to your SD card.

@dhermes
dhermes / .gitignore
Last active December 12, 2022 06:38
Remez Algorithm for log(x)
*.pyc
*.aux
*.log
*.out
@evpo
evpo / bash.log
Created February 10, 2018 13:01
GnuPG: Sample commands to store master key offline and use subkeys
##############################
# In your underground bunker:
##############################
ubuntu@sign-key-owner:~$ gpg2 --list-secret-keys
/home/ubuntu/.gnupg/pubring.gpg
-------------------------------
sec rsa2048/26AD9CA6 2018-02-10 [SC] [expires: 2018-02-20]
uid [ultimate] Shelling Point <nowhere@north.pole>
ssb rsa2048/4CC51AF4 2018-02-10 [E] [expires: 2018-02-20]

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.

@piyushrpt
piyushrpt / customfeedstock.md
Last active October 21, 2021 20:17
Setting up custom conda feedstock
@bjodah
bjodah / .gitignore
Last active August 4, 2020 20:04
Script to compile symengine with memory sanitizer enabled.
mount_*/
environment_*/
output.log
@twlz0ne
twlz0ne / test-lsp-jdtls-installation.el
Created May 11, 2020 03:55
Test jdtls installation #Emacs #LSP
;;; test-lsp-jdtls-installation.el --- Test lsp jdtls installation -*- lexical-binding: t; -*-
;;; Date: 2020-05-11_09.12.50
;;; Usage:
;; ┌────
;; │ $ emacs -nw -Q -l \
;; │ --eval '(setq with-proxy-http-server "127.0.0.1:XXXX")' \
;; │ /path/to/test-lsp-jdtls-installation.el
;; └────
(toggle-debug-on-error)
(setq user-emacs-directory (format "~/.emacs.d/%s/%s/" (file-name-base load-file-name) emacs-version))
@bjodah
bjodah / gist:bf554c4eb6d75837c00b4ec01991da05
Last active April 11, 2022 11:48
Using emacs under windows
1. Install msys2 from msys2.org
2. run msys2.exe: pacman -Syu, restart, pacman -Su
3. run mingw64.exe: pamcan -S mingw-w64-x86_64-emacs
4. create C:\msys2_64\runemacs_patched_path.bat:
cmd /C "set PATH=C:\msys2_64\mingw64\bin;C:\msys2_64\usr\bin;%PATH% && C:\msys2_64\mingw64\bin\runemacs.exe --daemon"
5. Super-R shell:startup [RET]
6. Create shortcut to runemacs_patched_path.bat, call it e.g. "emacs-daemon"
7. Create a short-cut in Start menu:
C:\msys2_64\mingw64\bin\emacsclientw.exe -c -n -a "C:\msys2_64\mingw64\bin\runemacs.exe"