Skip to content

Instantly share code, notes, and snippets.

View SnowyPainter's full-sized avatar
๐ŸŽฏ
Focusing

Minwoo Yu SnowyPainter

๐ŸŽฏ
Focusing
View GitHub Profile
@SnowyPainter
SnowyPainter / linkedlist.c
Created June 14, 2025 08:54
Cํ”„ linked list
#include <stdio.h>
#include <stdlib.h>
typedef struct _node NODE;
typedef struct _list LIST;
typedef struct _node{
int data;
NODE* prev;
NODE* next;
name: tf
channels:
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- _openmp_mutex=5.1=1_gnu
- ca-certificates=2024.11.26=h06a4308_0
- ld_impl_linux-64=2.40=h12ee557_0
- libffi=3.4.4=h6a678d5_1
- libgcc-ng=11.2.0=h1234567_1
// ์ „์—ญ ๋ฐ์ดํ„ฐ ์ €์žฅ์†Œ
let chartData = [];
let svg, x, y, width, height, margin;
function initializeChart() {
margin = { top: 20, right: 20, bottom: 30, left: 50 };
width = 800 - margin.left - margin.right;
height = 400 - margin.top - margin.bottom;
// SVG ์„ค์ •
#๋จผ์ € ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™์„ ๋งŒ๋“œ์„ธ์š”.
# PowerShell ์Šคํฌ๋ฆฝํŠธ
# 1. ๊ธฐ์กด portproxy ์„ค์ • ์‚ญ์ œ
netsh interface portproxy delete v4tov4 listenport=4000 listenaddress=0.0.0.0
# 2. WSL2์˜ eth0 IP ์ฃผ์†Œ ๊ฐ€์ ธ์˜ค๊ธฐ
$wslIP = wsl hostname -I | ForEach-Object { $_.Trim() }
# 3. ์ƒˆ๋กœ์šด portproxy ์„ค์ • ์ถ”๊ฐ€
@SnowyPainter
SnowyPainter / localbns3axishedge.py
Created September 23, 2024 11:41
Local BNS algorithm, 3 axis hedge portfolio functions.
import numpy as np
import pandas as pd
from scipy.optimize import minimize
import numpy as np
'''
์ฃผ์‹ A๋ฅผ ํ—ค์ง€ํ•˜๊ธฐ ์œ„ํ•ด์„œ ์ฃผ์‹ B1, B2๊ฐ€ ์‚ฌ์šฉ๋จ.
์กฐ๊ฑด: (A)์™€ (B1, B2)๋Š” ๋‹ค๋ฅธ ์„นํ„ฐ์—์„œ ์ƒ๊ด€๊ณ„์ˆ˜๊ฐ€ -1์— ๊ฐ€๊นŒ์›Œ์•ผํ•จ
์กฐ๊ฑด2: ์‚ฌ์‹ค ๋ญ๋“  ์ƒ๊ด€์—†์Œ
import mojito
import websockets
import json
import requests
import os
import asyncio
import time
from Crypto.Cipher import AES
from Crypto.Util.Padding import unpad
import mojito
import pprint
key = "๋ฐœ๊ธ‰๋ฐ›์€ API KEY"
secret = "๋ฐœ๊ธ‰๋ฐ›์€ API SECRET"
acc_no = "12345678-01"
broker = mojito.KoreaInvestment(
api_key=key,
api_secret=secret,
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout
from tensorflow.keras.optimizers import RMSprop
import numpy as np
import random
class QLearningAgent:
def __init__(self, env, learning_rate=0.1, discount_factor=0.99, epsilon=0.1):
self.env = env
self.step_size = learning_rate
@SnowyPainter
SnowyPainter / data.py
Last active January 18, 2024 10:50
3๊ฐœ ์ด์ƒ merge
import pandas as pd
import numpy as np
files = ["nvda.csv", "vix.csv", "eur.csv"]
def open_df(fn):
df = pd.read_csv(fn)
df.drop(["Vol.","Change %","Open","Low","High"], axis=1, inplace=True)
df["Price"] = df["Price"].astype(float)
df['Date'] = pd.to_datetime(df['Date'], format='%m/%d/%Y')
@SnowyPainter
SnowyPainter / wjdqhtngod.py
Created October 27, 2023 09:58
wjdqhtngod.py
import random
computer = random.randint(1,3)
player = int(input("๊ฐ€์œ„, ๋ฐ”์œ„, ๋ณด ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•˜์‹œ์˜ค. (๊ฐ€์œ„=1, ๋ฐ”์œ„=2, ๋ณด=3): "))
if computer == player:
print("๋น„๊ฒผ์Šต๋‹ˆ๋‹ค.")
elif player == 1:
if computer == 2:
print("์กŒ์Šต๋‹ˆ๋‹ค (๊ฐ€์œ„<๋ฐ”์œ„)")