windows

Powershell Large File Creation to Size with Data [duplicate]

旧时模样 提交于 2021-02-10 14:19:41
问题 This question already has answers here : How to Generate File of a determinate Size in Windows? (3 answers) Closed 7 days ago . I am trying to determine what Powershell command would be equivalent to the following Linux Command for creation of a large file in a reasonable time with exact size AND populated with the given text input. New Question asked as this one was automatically closed for some reason. Given: $ cat line.txt !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_

Installing the filter driver programmatically?

纵饮孤独 提交于 2021-02-10 13:15:39
问题 I am trying to write C++ code programmatically installing NDIS 6.0 lightweight filter driver. After reviewing WinDDK, online examples and MSDN documentation I ended up with the code sample below. ************** hr = InstallSpecifiedComponent( ModuleFileName, L"MS_NdisLwf", &GUID_DEVCLASS_NETSERVICE ); ************** hr = HrInstallNetComponent( pnc, lpszPnpID, pguidClass, lpszInfFile ); ************** if ( !SetupCopyOEMInfW(lpszInfFullPath, DirWithDrive, // Other files are in the same dir.as

Installing the filter driver programmatically?

别来无恙 提交于 2021-02-10 13:14:31
问题 I am trying to write C++ code programmatically installing NDIS 6.0 lightweight filter driver. After reviewing WinDDK, online examples and MSDN documentation I ended up with the code sample below. ************** hr = InstallSpecifiedComponent( ModuleFileName, L"MS_NdisLwf", &GUID_DEVCLASS_NETSERVICE ); ************** hr = HrInstallNetComponent( pnc, lpszPnpID, pguidClass, lpszInfFile ); ************** if ( !SetupCopyOEMInfW(lpszInfFullPath, DirWithDrive, // Other files are in the same dir.as

Executable merge.exe (extracted from MSYS2) doesn't run on Windows

我是研究僧i 提交于 2021-02-10 13:07:11
问题 1. Problem explained I need to run the merge tool (part of the GNU RCS project - Revision Control System) on Windows 10. These are the requirements: STEP 1: The executable merge.exe must run in a native Windows cmd terminal. STEP 2: The PATH env variable should not be modified. STEP 3: The executable can be located in any arbitrary folder (of course, it's okay to put a bunch of dll's next to it if required). It would lead us too far to explain why these requirements are so important. Please,

Executable merge.exe (extracted from MSYS2) doesn't run on Windows

China☆狼群 提交于 2021-02-10 13:05:51
问题 1. Problem explained I need to run the merge tool (part of the GNU RCS project - Revision Control System) on Windows 10. These are the requirements: STEP 1: The executable merge.exe must run in a native Windows cmd terminal. STEP 2: The PATH env variable should not be modified. STEP 3: The executable can be located in any arbitrary folder (of course, it's okay to put a bunch of dll's next to it if required). It would lead us too far to explain why these requirements are so important. Please,

WINAPI: Colored Border for Static Dialog Item

匆匆过客 提交于 2021-02-10 12:58:34
问题 I have a dialog box in win32 api. I have a Static Element which has been created as below. lpw = lpwAlign(lpw); // Align DLGITEMTEMPLATE on DWORD boundary lpdit = (LPDLGITEMTEMPLATE)lpw; lpdit->x = 12; lpdit->y = 36; lpdit->cx = 75; lpdit->cy = 7; lpdit->id = ID_ERROR_MSG; lpdit->style = WS_CHILD | SS_BITMAP | WS_VISIBLE ; lpw = (LPWORD)(lpdit + 1); *lpw++ = 0xFFFF; *lpw++ = 0x0082; // Static class lpwsz = (LPWSTR)lpw; nchar = MultiByteToWideChar(CP_ACP, 0, errorMsg.c_str(), -1, lpwsz, 50);

WINAPI: Colored Border for Static Dialog Item

泄露秘密 提交于 2021-02-10 12:56:55
问题 I have a dialog box in win32 api. I have a Static Element which has been created as below. lpw = lpwAlign(lpw); // Align DLGITEMTEMPLATE on DWORD boundary lpdit = (LPDLGITEMTEMPLATE)lpw; lpdit->x = 12; lpdit->y = 36; lpdit->cx = 75; lpdit->cy = 7; lpdit->id = ID_ERROR_MSG; lpdit->style = WS_CHILD | SS_BITMAP | WS_VISIBLE ; lpw = (LPWORD)(lpdit + 1); *lpw++ = 0xFFFF; *lpw++ = 0x0082; // Static class lpwsz = (LPWSTR)lpw; nchar = MultiByteToWideChar(CP_ACP, 0, errorMsg.c_str(), -1, lpwsz, 50);

Windows Error 0xe06d7363 when using Cross Validation XGboost

核能气质少年 提交于 2021-02-10 12:42:33
问题 I am using xgb api for python and when trying to do xgb.cv I get the following error, param = {'max_depth': 6, 'eta': 0.1,'objective' :'reg:squarederror','subsample':0.8 ,'gamma':0, 'colsample_bytree':1,'nthread':cores,'base_score':y_train.mean(),'eval_metric':'rmse'} num_round = 1 evallist = [(test, 'eval'), (train, 'train')] xgb.cv(param, train, num_round, nfold=5, metrics={'error'}, seed=0, callbacks=[xgb.callback.print_evaluation(show_stdv=True)]) OSError Traceback (most recent call last)

Windows Error 0xe06d7363 when using Cross Validation XGboost

我与影子孤独终老i 提交于 2021-02-10 12:42:13
问题 I am using xgb api for python and when trying to do xgb.cv I get the following error, param = {'max_depth': 6, 'eta': 0.1,'objective' :'reg:squarederror','subsample':0.8 ,'gamma':0, 'colsample_bytree':1,'nthread':cores,'base_score':y_train.mean(),'eval_metric':'rmse'} num_round = 1 evallist = [(test, 'eval'), (train, 'train')] xgb.cv(param, train, num_round, nfold=5, metrics={'error'}, seed=0, callbacks=[xgb.callback.print_evaluation(show_stdv=True)]) OSError Traceback (most recent call last)

Why does os.path.exists() stop windows named pipes from connecting?

柔情痞子 提交于 2021-02-10 09:32:30
问题 It seems that a successful test of the existence of a windows named pipe by using os.path.exists() prevents the pipe from working. Why would this be? Here is successfully working windows named-pipe code: import time import multiprocessing as mp import win32pipe, win32file PIPENAME = r'\\.\pipe\Foo' def producer(pipe_name: str): print('producer') # if not os.path.exists(pipe_name): # print(f'No pipe {pipe_name}') # return pipe = win32file.CreateFile(pipe_name, win32file.GENERIC_READ |