Skip to content

Instantly share code, notes, and snippets.

View 0xJchen's full-sized avatar
🎯
Focusing

Jiachen Wang 0xJchen

🎯
Focusing
View GitHub Profile
{
"cells": [
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
"from SABR import SABR_swaption, SABR\n",
"import pandas as pd\n",
#!/bin/bash
# Initialize an associative array to store png filenames and their corresponding grepped numbers
declare -A png_map
# Clear the loggers.txt file if it exists
> loggers.txt
# Iterate over each png file in ./selected directory
for png_file in ./selected/*.png; do
package test;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@0xJchen
0xJchen / gist:9693396ef7b8139014825478b3e8ba6e
Created September 17, 2023 05:04
AVL-Tree Testcase Generator
#!/bin/bash
# Function to generate a single test file
generate_test_file() {
local filename=$1
local num_commands=$2
> "$filename"
# Generate random 'i' and 'd' commands with random numbers
for (( j=0; j<$num_commands; j++ )); do
The output from `lsblk` shows that you have two large disks (`nvme0n1` and `nvme1n1`) that are 3.5T in size but do not have any partitions or filesystems. If you want to increase the size of your `/` filesystem, you can't do it directly because it's currently on a smaller disk (`nvme2n1`) which is completely used.
A better approach would be to create a new partition on one of the larger disks, create a filesystem on it, and then move your data from the smaller disk to the new filesystem on the larger disk. Here is an outline of the steps you would need to take.
**Disclaimer: This process can result in data loss if not done carefully. Always backup important data before attempting these steps.**
1. **Create a new partition on one of the larger disks**
Before you create a new partition, you need to check if there is free space available. If there is no free space, you may need to shrink or delete an existing partition.
@0xJchen
0xJchen / bridge_hacks.md
Created July 15, 2023 20:57 — forked from cwhinfrey/bridge_hacks.md
Bridge Hack List
@0xJchen
0xJchen / git_newrepo
Created March 24, 2023 21:55 — forked from c0ldlimit/git_newrepo
Git: Push a new or existing repo to Github
# Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line
@0xJchen
0xJchen / OrderFlow.ipynb
Created January 31, 2023 21:59 — forked from sebjai/OrderFlow.ipynb
Optimal trading with order-flow and short-term alpha
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0xJchen
0xJchen / log
Created February 5, 2022 14:13
- Device platform: arm64-v8a
- Installing: 23.0 (23000)
- Copying image to cache
- Unpacking boot image
Parsing boot image: [/data/user_de/0/com.topjohnwu.magisk/install/boot.img]
HEADER_VER [3]
KERNEL_SZ [50481164]
RAMDISK_SZ [19855248]
OS_VERSION [11.0.0]
OS_PATCH_LEVEL [2021-11]
root@ec2bf3896c8b:/home/game/pisac# ./xvfb-run-safe python -m pisac.run --root_dir=/tmp/pisac_cartpole_swingup --gin_file=pisac/config/pisac.gin --gin_bindings=train_pisac.train_eval.domain_name=\'cartpole\' --gin_bindings=train_pisac.train_eval.task_name=\'swingup\' --gin_bindings=train_pisac.train_eval.action_repeat=4 --gin_bindings=train_pisac.train_eval.initial_collect_steps=1000 --gin_bindings=train_pisac.train_eval.initial_feature_step=5000 gin_bindings=train_pisac.train_eval.drivers_in_graph=False
2022-01-08 11:59:02.458894: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
2022-01-08 11:59:03,907: MUJOCO_GL is not set, so an OpenGL backend will be chosen automatically.
2022-01-08 11:59:04,056: Successfully imported OpenGL backend: glfw
2022-01-08 11:59:04,194: MuJoCo library version is: 200
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/l