Skip to content

Instantly share code, notes, and snippets.

View henryjmin's full-sized avatar

Jihong Min henryjmin

  • Seoul, Republic of Korea
View GitHub Profile
Set-PSReadlineOption -BellStyle None
Set-PSReadLineOption -PredictionSource None
Set-PSReadlineOption -EditMode vi
function OnViModeChange {
$esc = [char]27
if ($args[0] -eq 'Command') {
Write-Host -NoNewLine "$esc[2 q"
} else {
Write-Host -NoNewLine "$esc[6 q"
}
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct Vector {
double x;
double y;
double z;
} Vector;
@henryjmin
henryjmin / e_13_1.py
Created November 24, 2024 11:04
Thermodynamics Chapter 13 codes
# Introduction to Chemical Engineering Thermodynamics, 8E
# Example 13.1
import math
def gamma(t, x1):
x2 = 1 - x1
A = 2.771 - 0.00523 * t
return (math.exp(A * x2**2), math.exp(A * x1**2))
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TABLE_SIZE 10000
typedef struct Node
{
char *key;
int value;
struct Node *next;
crc_16_table = [0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800,
0xE401, 0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400]
def get_crc_16(p: bytes, n: int) -> bytes:
crc = 0x55AA
index = 0
while (index < n):
r = crc_16_table[crc & 0xF]
@henryjmin
henryjmin / webui-user-high-spec.bat
Created October 10, 2022 17:04
webui user batch scripts
@echo off
set PYTHON=%localappdata%\Programs\Python\Python310\python.exe
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=--listen --xformers
call webui.bat
#include <stdio.h>
#include <stdlib.h>
unsigned int crc_16_table[16] = {
0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401,
0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400};
unsigned short int get_crc_16(char *p, int n)
{
unsigned short int crc = 0x55AA;
#include <stdio.h>
#include <stdlib.h>
unsigned int crc_16_table[16] = {
0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401,
0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400};
unsigned short int get_crc_16(char *p, int n)
{
unsigned short int crc = 0x55AA;