Skip to content

Instantly share code, notes, and snippets.

@ziyuang
ziyuang / max_galaxy_dimboost.py
Last active February 27, 2023 10:42
Send keys to maximize galaxies in Antimatter Dimensions
import argparse
import math
import re
import time
from dataclasses import dataclass
from pywinauto.application import Application, WindowSpecification
from pywinauto.keyboard import VirtualKeyAction
@ziyuang
ziyuang / global.ts
Created August 11, 2020 09:48
cannot resolve module
export interface Dict {
[key: string]: string
}
export const g: string = "g";
@ziyuang
ziyuang / index.js
Created July 30, 2020 18:55
Reproducing `hdf5.File is not a constructor`
import { hdf5 } from 'hdf5';
import { Access } from 'hdf5/lib/globals';
let f = new hdf5.File('test.hdf5', Access.ACC_RDONLY);
@ziyuang
ziyuang / install_mxnet_p2xlarge.sh
Created January 13, 2017 18:57
Install MXNet (with Anaconda Python 3, CUDA, cuDNN, Intel MKL, OpenCV, Zsh) for p2.xlarge on Ubuntu 16.04 (ami-6f587e1c).
#!/bin/bash
set -e
# Put
# 1. CUDA installation script (cuda_*.run, see https://developer.nvidia.com/cuda-downloads)
# 2. cuDNN archive (cudnn-*.tgz, see https://developer.nvidia.com/rdp/cudnn-download)
# 3. Intel MKL archive (l_mkl_*.tgz, see https://software.intel.com/en-us/intel-mkl)
# under $HOME
# Also set INTEL_MKL_SN to Intel MKL's serial number (XXXX-XXXXXXXX)
import operator
import itertools
import math
import collections
_SYMBOL_TO_OP = {'+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv,
'!': lambda a, b: b-a, '@': lambda a, b: b/a}
_R_OP = {'!': '-', '@': '/'}
#!/bin/bash
# Licence: GPLv3, MIT, BSD, Apache or whatever you prefer; FREE to use, modify, copy, no obligations
# Description: Bash Script to Start the process with NOHUP and & - in background, pretend to be a Daemon
# Author: Andrew Bikadorov
# Script v1.5
# For debugging purposes uncomment next line
#set -x
@ziyuang
ziyuang / lp.tex
Last active August 29, 2015 14:05
L^p空间企业文化(误
\documentclass{article}
\usepackage{fontspec, xunicode, xltxtra}
\setmainfont{宋体}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt
\defaultfontfeatures{Mapping=tex-text}
\begin{document}
@ziyuang
ziyuang / s1_prime.c
Created July 24, 2014 22:40
S1死程群群号
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
// Prime[N] = ?
int main(){
double time_start = clock();
const int N = 4263116;
const int UPPER_BOUND = 80000000;
  • .bashrc: append to the local .bashrc
  • .bashrc-remote: append to the remote .bashrc
  • .screenrc: local .screenrc