Skip to content

Instantly share code, notes, and snippets.

View Curt-Park's full-sized avatar
👋

Jinwoo Park (Curt) Curt-Park

👋
View GitHub Profile
@Curt-Park
Curt-Park / asyncio_example.py
Last active June 20, 2021 07:38
producer-consumer example with asyncio
"""A simple example of asyncio. This code is available from python 3.7.
References
- history of asyncio: https://asyncio-notes.readthedocs.io/en/latest/asyncio-history.html
- asyncio: https://docs.python.org/3/library/asyncio.html
- asyncio.queue: https://docs.python.org/3.7/library/asyncio-queue.html
- producer-consumer: https://stackoverflow.com/questions/52582685/using-asyncio-queue-for-producer-consumer-flow
"""
import asyncio
@Curt-Park
Curt-Park / Makefile
Last active January 4, 2024 07:32
unit test generation with pynguin
# usage: `$ make utest MODULE_NAME=fibonacci`
utest:
if [ ! -d "test" ]; then mkdir test; fi
pynguin --algorithm RANDOM --project_path . --output_path test --module_name ${MODULE_NAME}
# usage: `$ make run-utest`
run-utest:
env PYTHONPATH=. pytest test --verbose --cov . --cov-report=html --cov-report=term-missing
# usage: `$ make show-cov MODULE_NAME=fibonacci`
@Curt-Park
Curt-Park / get_pos_int_solution_by_ga.py
Last active June 20, 2021 09:31
Get the positive integer solution by Genetic Algorithm, given a / (b + c) + b / (a + c) + c / (a + b) = 4.
"""Genetic algorithm solver.
Given the following function:
y = f(w1:w3) = w1 / (w2 + w3) + w2 / (w1 + w3) + w3 / (w1 + w2)
where y=4
What are the best values for the 3 weights (w1 to w3)?
We are going to use the genetic algorithm to optimize this function.
"""
import pygad
@Curt-Park
Curt-Park / cs224w-colab-1.ipynb
Last active April 5, 2023 08:22
CS224W - Colab 1.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Curt-Park
Curt-Park / financial-data-analysis.ipynb
Last active September 1, 2021 01:42
financial-data-analysis.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Curt-Park
Curt-Park / scrap_finance_data.py
Last active January 22, 2024 21:43
Scrap finance data from Naver Finance
# -*- coding: utf-8 -*-
"""Scrap data from Naver Finance.
Author:
- Name: Jinwoo Park
- Email: [email protected]
Prerequisites:
pip install beautifulsoup4
pip install html5lib
@Curt-Park
Curt-Park / efficient_frontier.ipynb
Last active September 5, 2021 15:25
efficient_frontier.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Curt-Park
Curt-Park / bt_simple_backtests.ipynb
Last active November 6, 2022 13:03
bt_simple_backtests.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <iostream>
#include <vector>
#include <array>
#include <opencv2/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <onnxruntime/onnxruntime_cxx_api.h>
int main(int argc, const char* argv[]) {
std::cout << "Optimized? " << cv::useOptimized() << std::endl;
@Curt-Park
Curt-Park / knn_with_gpu.ipynb
Created February 21, 2024 14:52
knn_with_gpu.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.