Skip to content

Instantly share code, notes, and snippets.

View ppwwyyxx's full-sized avatar
🎯
Focusing

Yuxin Wu ppwwyyxx

🎯
Focusing
View GitHub Profile
# Try to copy "a" value to "c" while simultaneously adding vector of 1's to a.
# If the copy is started before the first assign_add, the copied value will be inconsistent.
#
# Running it on macbook my "c" ends up with a mix of values between 1 and 6
#
#
# 16.017478 copy 1 (0) starting
# 17.006894 write 1 (0) starting
# 28.431654 write 1 ending (11.4247 sec)
# 29.436692 write 1 (1) starting
@MaskRay
MaskRay / fft.txt
Last active August 16, 2019 04:46
FFT技巧
https://www.hackerrank.com/contests/w23/challenges/sasha-and-swaps-ii
感谢ftiasch老师教导,参考了 https://async.icpc-camp.org/d/408-fft 和其他一些地方的东西
P = 1e9+7
Q = ceil(sqrt(P))
a, b为两个向量
c = convolution(a, b)
c系数取值为 [0, n*(P-1)^2] 的整数,若n*(P-1)^2的表示需要超过53 bits(double mantissa)则很可能会出错
template <typename Left, typename Right>
struct ConcatExpr;
template <typename Left, typename Right>
struct AltExpr;
template <typename SubExpr>
struct RepeatExpr;
template <char ch>
@vancluever
vancluever / gnome-tracker-disable.md
Last active May 2, 2024 16:26
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@raine
raine / gitter-weechat-instructions.md
Last active October 4, 2021 10:52
Connecting to gitter using weechat

Auth and copy token at https://irc.gitter.im/.

Ignore the /PASS thing, it doesn't work in weechat.

/server add gitter irc.gitter.im -ssl -ssl_verify -ssl_dhkey_size=1024 -password=<REPLACE_WITH_YOUR_TOKEN>
/connect gitter
@tadly
tadly / pacaur_install.sh
Last active August 30, 2023 13:15
A simple shell script to quickly / easily install "pacaur" on archlinux
#!/bin/sh
#
# !!! IMPORTANT !!!
# As of 2017-12-14, pacaur is unmaintained (https://bbs.archlinux.org/viewtopic.php?pid=1755144#p1755144)
# For alternatives see the arch wiki: https://wiki.archlinux.org/index.php/AUR_helpers#Active
# pacaur seems to get occasional updates to fix breaking changes due to pacman updates though.
#
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# $File: push-phone
# $Date: Thu Sep 18 11:29:13 2014 +0800
# $Author: Xinyu Zhou <zxytim[at]gmail[dot]com>
import sys
import getpass
import socket
import argparse
@ax3l
ax3l / CUDA_Compilers.md
Last active May 20, 2024 16:33
CUDA Compilers