Skip to content

Instantly share code, notes, and snippets.

View 0xJchen's full-sized avatar
🎯
Focusing

Jiachen Wang 0xJchen

🎯
Focusing
View GitHub Profile
@0xJchen
0xJchen / throttledebounce.go
Created January 12, 2024 01:34 — forked from haleyrc/throttledebounce.go
Throttle and debounce implemented in Go
// This gist is a reminder to myself about the differences between throttling and debouncing, inspired by
// https://redd.one/blog/debounce-vs-throttle
//
// A runnable example is available here: https://play.golang.org/p/sADDu829fRa
package main
import (
"fmt"
"time"
)
# human
package org.jsoup.nodes;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.junit.Test;
import java.util.List;
import static org.junit.Assert.*;
# evosuite
/*
* This file was automatically generated by EvoSuite
* Fri Sep 22 05:18:32 GMT 2023
*/
package org.jsoup.nodes;
import org.junit.Test;
import static org.junit.Assert.*;
@0xJchen
0xJchen / test.sh
Created September 27, 2023 19:13
hw2-testcase
#!/bin/bash
# Initialize a variable to store the maximum percentage
max_percentage=0.0
# Iterate over all n.png files in the hw2img/move/ directory
for file in hw2img/*.png; do
# Extract the base filename without extension
base_name=$(basename "$file" .png)
@0xJchen
0xJchen / chatgpt-sabr.py
Last active September 27, 2023 10:11
chatgpt-sabr
import numpy as np
from scipy.optimize import minimize
from math import log, sqrt
import matplotlib.pyplot as plt
def sabr_iv(alpha, beta, rho, nu, F, K, T):
"""
Returns the implied volatility using the SABR model formula.
"""
X = K
if F == K:
@0xJchen
0xJchen / test.ipynb
Created September 27, 2023 06:37
sample sabr
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0xJchen
0xJchen / test.ipynb
Created September 27, 2023 06:36
sample sabr
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0xJchen
0xJchen / SABR.ipynb
Created September 27, 2023 06:35
SIMPLE SABR
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0xJchen
0xJchen / test_SABR.ipynb
Created September 27, 2023 06:34
simple SABR
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0xJchen
0xJchen / test.ipynb
Created September 27, 2023 06:33
simple SABR
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.