Skip to content

Instantly share code, notes, and snippets.

Avatar

John "DumbSheep" Hsieh johnhmj

View GitHub Profile
View AAClient-backup-2020.06.27-17.04.34.log
Log: Log file open, 06/27/20 17:04:34
Log: FEngineLoop::PreInit GHiPriThreadPoolNumThreads=8
Init: WinSock: version 1.1 (2.2), MaxSocks=32767, MaxUdp=65467
Log: ... running in INSTALLED mode
DevConfig: GConfig::Find has loaded file: ..\..\Engine\Config\ConsoleVariables.ini
Init: Version: 9656
Init: Epic Internal: 0
Init: Compiled (32-bit): Dec 16 2019 08:54:00
Init: Changelist: 1202061
Init: Command line:
View Slashstreet Boys - I'll Kill You That Way.txt
(translated to traditional chinese by johnmhsieh)
YEAHHHHH YEAH "耶…耶…"
i'll set "我會"
you on fire "點火焚燒你"
with gas "用瓦斯"
and a lighterrrr "還有打火機…"
you'll scream "你會大聲尖叫"
when i "當我"
View main.cpp
#include <Windows.h>
//
// 1st way to avoid max conflict: undefine max from Windows.h
#ifdef max
#undef max
#endif
//
int wmain(int argc, wchar_t* argv[])
{
//
@johnhmj
johnhmj / header.cpp
Created Dec 1, 2017
AutoCAD Text height calculator
View header.cpp
#include "header.h"
//
CACADTextHeight::CACADTextHeight()
{
this->m_dDIMTXT = 0.0f;
this->m_dDIMSCALE = 0.0f;
this->m_dViewportScale = 0.0f;
this->m_dTextHeightModel = 0.0f;
this->m_dTextHeightLayout = 0.0f;
}
View SICXEPass1.pseudo
BEGIN
read first input line
IF OPCODE = 'START' THEN
BEGIN
save #[OPERAND] as starting address
initialize LOCCTR to starting address
write line to intermediate file
read next input line
END {if START}
ELSE
View SingleInstance.cpp
#include "SingleInstance.h"
//
CSingleInstance::CSingleInstance(TCHAR* pMutexName)
{
this->m_hMutex = CreateMutex(NULL, FALSE, pMutexName);
this->m_bExist = (ERROR_ALREADY_EXISTS == GetLastError())?TRUE:FALSE;
}
CSingleInstance::CSingleInstance(const CSingleInstance& instance)
{
if (this == &instance)
View WindowPosition.cpp
#include "WindowPosition.h"
//
CWndPos::CWndPos()
{
InitStruct(&this->m_pos, SWndPos);
InitStruct(&this->m_wndSize, SWndSize);
this->m_sysSize.width = GetSystemMetrics(SM_CXSCREEN);
this->m_sysSize.height = GetSystemMetrics(SM_CYSCREEN);
}
CWndPos::CWndPos(HWND hWnd)
@johnhmj
johnhmj / InitStruct.h
Last active Apr 3, 2017
Win32 C/C++ InitStruct macro, initialize your structure as ZeroMemory, http://johnmhsheep.pixnet.net/blog, https://johnmhsieh.blogspot.com/
View InitStruct.h
#ifndef _INITSTRUCT_H_
#define _INITSTRUCT_H_
//
// initialize struct
#define InitStruct(s, t) memset((void*) s, 0x0, sizeof(t))
//
// copy struct
#define CopyStruct(s_dst, s_src, t) memcpy((void*) s_dst, (void*) s_src, sizeof(t))
//
#endif
View WinMainCmdline.cpp
#include "WinMainCmdline.h"
//
CCmdLine::CCmdLine()
{
this->m_lpCmdLine = NULL;
}
CCmdLine::CCmdLine(const CCmdLine& cl)
{
unsigned int nBufferSize = 0;
this->m_lpCmdLine = NULL;
@johnhmj
johnhmj / SingleInstance.cpp
Last active Apr 3, 2017
Win32 C/C++ Only one instance of an application is allowed to run, http://johnmhsheep.pixnet.net/blog, https://johnmhsieh.blogspot.com/
View SingleInstance.cpp
#include "SingleInstance.h"
//
CSingleInstance::CSingleInstance(TCHAR* pMutexName)
{
this->m_hMutex = CreateMutex(NULL, FALSE, pMutexName);
this->m_bExist = (ERROR_ALREADY_EXISTS == GetLastError())?TRUE:FALSE;
}
CSingleInstance::CSingleInstance(const CSingleInstance& instance)
{
if (this == &instance)
You can’t perform that action at this time.