전체 글 (105) 썸네일형 리스트형 [SQL] Table Field Record Table ColumnFieldAttribute (Modeling) RowRecordTuple (Modeling) Class [Python] allocator __new__ & initializer __init__ & finalizer __del__ 참고 :Data model > Special method names > Basic customizationUnderstanding __new__ and __init__ class Class1: def __new__(cls): # allocator print('in __new__') return super().__new__(cls) def __init__(self): # initializer print('in __init__') super().__init__() def __del__(self): # finalizer print('in __del__') def say(self, words: str): print("say", words) if __name__ == '__main__': c1 = Class1().. [Python] Check Package Dependencies How to find a Python package's dependencies from pip._vendor import pkg_resources _package_name = 'zipline'_package = pkg_resources.working_set.by_key[_package_name] # retrieve dependencies from setup.pyfor requirement in _package.requires(): print(requirement) $ pip freeze $ pip list $ pip show pandas $ pip check pipdeptree $ pip install pipdeptree$ pipdeptree [C] struct Initialization 참고 :C Structure Initialization #include #include #include #include struct x { INT32 a; INT32 b; INT32 c;}; int _tmain(INT32 argc, LPTSTR argv[]) { struct x x1 = {0}; _tprintf(_T("%d %d %d \n"), x1.a, x1.b, x1.c); struct x x2; memset(&x2, 0, sizeof(x2)); _tprintf(_T("%d %d %d \n"), x2.a, x2.b, x2.c); return EXIT_SUCCESS;} /* Output0 0 00 0 0*/ [C] GetCurrentDirectory GetWindowsDirectory GetSystemDirectory #include #include #include #include int _tmain(INT32 argc, LPTSTR argv[]){ // MAX_PATH : The maximum character length of a path. TCHAR currentDirectory[MAX_PATH]; TCHAR windowsDirectory[MAX_PATH]; TCHAR systemDirectory[MAX_PATH]; // GetCurrentDirectory GetWindowsDirectory GetSystemDirectory // If the function fails, the return value is zero. DWORD result1 = GetCurrentDirectory(MAX_PATH, currentD.. Detect System Architecture [Python] platform 참고 :[Python] platform - Access to underlying platform's identifying data >>> import platform >>> platform.architecture() ('64bit', 'WindowsPE') >>> platform.machine() 'AMD64' >>> platform.platform() 'Windows-10-10.0.17134-SP0' >>> platform.system() 'Windows' >>> platform.version() '10.0.17134' >>> platform.release() '10' Detect Windows Architecture [C++] IsWow64Process SYSTEM_INFO GetNativeSystemInfo 참고 :IsWow64Process functionSYSTEM_INFO structureGetSystemInfo functionGetNativeSystemInfo function // C++ #include #include #include #include using namespace std; int _tmain(int argc, TCHAR *argv[]){ BOOL isWow64 = false; if (IsWow64Process(GetCurrentProcess(), &isWow64) != 0) cout Detect Windows Architecture [C++] CString.GetEnvironmentVariable // C++ #include #include #include // for CString using namespace std; int _tmain(int argc, TCHAR *argv[]){ CString myArchitecture; if (myArchitecture.GetEnvironmentVariable(_T("PROCESSOR_ARCHITECTURE")) != 0) cout 이전 1 ··· 4 5 6 7 8 9 10 ··· 14 다음