Skip to content

Instantly share code, notes, and snippets.

@ssgkd
ssgkd / jamotest.py
Last active December 11, 2022 06:39
jamotest.py
# -*- coding: utf-8 -*-
from jamo import h2j, j2hcj
allInit = []
text = "삼성전자"
for x in text:
temp = h2j(x)
imf = j2hcj(temp) # init,middle,final
print(f"{temp}, {imf}")
@ssgkd
ssgkd / funcObjectTest.ahk
Last active December 6, 2022 10:40
funcObjectTest.ahk
#Requires Autohotkey v1.1.33+
#SingleInstance, Force
SendMode Input
SetWorkingDir, %A_ScriptDir%
a=Test String
b=Test String2
fn := Func("targetFun").Bind(a,b)
@ssgkd
ssgkd / Month_Change_test.ahk
Last active November 27, 2022 02:29
Month_Change_test.ahk
#Requires Autohotkey v1.1.33+
; https://www.autohotkey.com/boards/viewtopic.php?t=27910, FanaticGuru
#SingleInstance, Force
SendMode Input
SetWorkingDir, %A_ScriptDir%
Month_Change(Change, Month = 0, Year = 0, Format := "yyyyMM")
{
if not exist "C:\chromeprofileDebug" mkdir "C:\chromeprofileDebug"
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --remote-debugging-port=8989 --user-data-dirs="C:\chromeprofileDebug"
#Requires Autohotkey v1.1.33+
#SingleInstance Force
#Include Rufaydium-Webdriver-main\Rufaydium.ahk
/*
Load "chromedriver.exe" from "A_ScriptDir"
In case Driver is not yet available, it will Download "chromedriver.exe" into "A_ScriptDir"
before starting the Driver.
*/
Folderpath=C:\�듅吏뺤쥌紐�
FileList =
Loop, Files, %Folderpath%\*.txt,
{
FileList = %FileList%%A_LoopFileTimeModified%`t%A_LoopFileFullPath%`n ; �닔�젙�맂 �궇吏�, tab, Fullpath �삎�깭濡� 由ъ뒪�듃 留뚮벉
}
Sort, FileList, R ; �닔�젙�맂 �궇吏쒖뿉 �뵲�씪 �궡由쇱감�닚�쑝濡� �젙�젹
sortedFileList:=[]
Loop, parse, FileList, `n
{
Option Explicit
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As Long, Source As Long, ByVal Length As Long)
Private Declare Function VirtualProtect Lib "kernel32" (lpAddress As Long, _
ByVal dwSize As Long, ByVal flNewProtect As Long, lpflOldProtect As Long) As Long
try
{
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", "https://www.autohotkey.com/download/1.1/version.txt", true)
whr.Send()
; Using 'true' above and the call below allows the script to remain responsive.
whr.WaitForResponse()
version := whr.ResponseText
if (A_AhkVersion != version)
Imports Microsoft.Win32.SafeHandles
Function GetPortHandle(ByVal Port As SerialPort) As SafeFileHandle
Dim BaseStream As Object = Port.BaseStream
Dim BaseStreamType As Type = BaseStream.GetType
Return BaseStreamType.GetField("_handle", BindingFlags.NonPublic Or BindingFlags.Instance).GetValue(BaseStream)
End Function
pV= 0.2; % 성공확률 0~1
pmf =@(k,p) (1-p).^(k).*p; % geometric pmf func.
k_vector=0:100; % k 값 설정, 적당히 100 정도까지만 설정
PMF_geometric=pmf(k_vector,pV); % geometric pmf 값
cdf_geometric=cumsum(PMF_geometric); % 이론적 cdf 값
cdf_p=[0 ; cdf_geometric(:)];
%% geometric r.v. generation