Can I get Unix’s pthread.h to compile in Windows?

pthread.h is a header for the Unix/Linux (POSIX) API for threads. A POSIX layer such as Cygwin would probably compile an app with #include <pthreads.h>. The native Windows threading API is exposed via #include <windows.h> and it works slightly differently to Linux’s threading. Still, there’s a replacement “glue” library maintained at http://sourceware.org/pthreads-win32/ ; note that it has some slight incompatibilities with … Read more

Windows batch – concatenate multiple text files into one

Windows type command works similarly to UNIX cat. Example 1: Merge with file names (This will merge file1.csv & file2.csv to create concat.csv) Example 2: Merge files with pattern (This will merge all files with csv extension and create concat.csv) When using asterisk(*) to concatenate all files. Please DON’T use same extension for target file(Eg. .csv). There should be some difference … Read more

Sublime Text from Command Line

Windows Command Prompt For Windows cmd.exe you could just add the sublime text installation directory to your PATH environment variable, this would allow you to type: Personally, I add a doskey (in a .bat file set to autorun with cmd) so I can type subl file.rb: Cygwin For the default bash shell add an alias to your ~/.bashrc file, e.g:

Anaconda “failed to create process”

I encountered the exact same error, because my username included a space. (“C:\Users\Ben Ji”) The easiest solution is to install Anaconda to another folder in the Users-folder, e.g. public. (The same error occurs when using pip, check out https://stackoverflow.com/a/35275384/6580199)

In which cases does program exit with 0x40010004 code?

On the theoretical side it could be anything, since TerminateProcess has an exit code parameter. On the practical side, it’s most likely due to system shutdown. When Windows shuts down, it tries to exit running programs gracefully (more on that here). If they refuse to quit, they might be terminated by the system with the exit code 0x40010004. For … Read more

REGSVR32: the module “xxxxx.dll” failed to load … dependent assembly could not be found

This is almost certainly due to a missing dependency. Use a tool like Dependency Walker to find the required dependencies of the DLL. Or, if the DLL is supplied by a third party, read their documentation which should specify the required dependencies. Note that Microsoft.VC90.ATL indicates version 9 of MSVC which is VS2008. So you would need to install … Read more

Systrace for Windows

WinDbg’s Logger.exe is the closest to strace: https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/logger-and-logviewer EDIT: There’s also windbg’s wt: https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/wt–trace-and-watch-data-

Using sys/socket.h functions on windows

You have two options: Use Cygwin (Unix emulation library). Port to Winsock (Windows standard library). Cygwin: lets you compile your Unix sources mostly untouched, but ties you to the Cygwin emulation library. This have two implications: general performance -no only network- will probably be less than optimal; and the target environment must have (at run … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)