How can I cin and cout some unicode text?

I had a similar problem in the past, in my case imbue and sync_with_stdio did the trick. Try this: #include <iostream> #include <locale> #include <string> using namespace std; int main() { ios_base::sync_with_stdio(false); wcin.imbue(locale(“en_US.UTF-8”)); wcout.imbue(locale(“en_US.UTF-8″)); wstring s; wstring t(L” la PolynĂ©sie française”); wcin >> s; wcout << s << t << endl; return 0; }

Can Ruby import a .NET dll?

While IronRuby will make short work of talking to your .NET dll (it’ll be literally no code at all), it was abandoned by microsoft, and it never got a large enough open source community to keep it going after that event. I wouldn’t recommend it these days Regarding the COM solution, this may actually be … Read more

How can I find the size of all files located inside a folder?

How about letting OS do it for you: long long int getFolderSize(string path) { // command to be executed std::string cmd(“du -sb “); cmd.append(path); cmd.append(” | cut -f1 2>&1″); // execute above command and get the output FILE *stream = popen(cmd.c_str(), “r”); if (stream) { const int max_size = 256; char readbuf[max_size]; if (fgets(readbuf, max_size, … Read more

WSL run linux from windows without spawning a cmd-window

Here’s a simpler solution, which, however, requires a WSH-based helper script, runHidden.vbs (see bottom section): wscript .\runHidden.vbs bash -c “DISPLAY=:0 xmessage ‘hello, world'” To apply @davv’s own launch-in-background technique to avoid creating a new bash instance every time: One-time action (e.g., at boot time): launch a hidden, stay-open bash window. This spawns 2 bash processes: … Read more

Python PIP has issues with path for MS Visual Studio 2010 Express for 64-bit install on Windows 7

Ultimately I was able to get pip running. In a nutshell (and redundant from info above) here is what I did to intall 64-bit packages for python 3.3: 1) Installed Microsoft Visual C++ 2010 Express Download Here (http://www.visualstudio.com/downloads/download-visual-studio-vs) 2) Installed Microsoft SDK 7.1 (Windows 7) (http://www.microsoft.com/en-us/download/details.aspx?id=8279) 3) Built/enabled the 64-bit tools in SDK. Go to … Read more

How to use enable pseudo-locale in Windows for testing?

How do i enable pseudo-locale’s in Windows? Initially the four pseudo-locale’s are not visible in the Control Panel: (archive.org) Note that NLS does not automatically enumerate the pseudo-locales or expose them in the regional and language options portion of the Control Panel. They are only enumerable if values are set in the registry. You enable … Read more

Globbing in C++/C, on Windows

Link with setargv.obj (or wsetargv.obj) and argv[] will be globbed for you similar to how the Unix shells do it: http://msdn.microsoft.com/en-us/library/8bch7bkk.aspx I can’t vouch for how well it does it though.