Detecting system language in Julia - operating-system

How can I detect the OS default language in Julia? I expected there maybe to be a Sys variable, but there doesn’t seem to be one. In python there is a locale package.

julia> ENV["LANG"]
"en_US.UTF-8"
This should work on Linux, at least. I'm not sure about Windows.

Related

VS Code jupyter, how to set cell language to cython?

I'd like to write Cython in vscode using the built-in jupyter notebook and Cython extension. I can actually do it and it will compile just fine, but vscode thinks it's python code and will complain about all kinds of syntax and linting errors. I know I could write in pure python mode, but I'm also trying to learn Cython simultaneously, so that's not very helpful.
I tried installing Cython language extensions, but none of them appeared in vscode when I tried to switch language of cell.
Is this possible? How could I do this?

How can I add a lua/other languages to VSCode?

In VSC, all I can select is my Python Interpretter. I have Lua installed, same as Java, but I cannot run either, it will always run as Python 3.9
By it will always run as python 3.9, have you tried to make a new file, save as, and you can choose what type of language you are going to use. Hope this solves your problem!

Failing to force Python 2.7.4 to run in 32-bit mode on OS X 10.8.3

I have been trying to force Python 2.7.4 to run in 32-bit mode on OS X 10.8.3 by default. I can get Python to run in 32-bit mode by running python32. But when I try to configure Eclipse+PyDev to run Python, it ends up running in 64-bit mode.
I have also tried
export VERSIONER_PYTHON_PREFER_32_BIT=yes
and
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
but neither seem to have any effect on my Python, and it still runs in 64-bit.
I was wondering if anyone has any idea how to permanently run Python 2.7 in 32-bit mode. Alternately, I am open to any solution that makes Eclipse/PyDev use the 32-bit Python.
My Python has been installed in /Library/Frameworks/Python.framework/Versions/2.7 and sys.executable returns /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python on my computer.
Thanks.
This made python go to 32-bit:
arch -i386 /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
import ctypes
print ctypes.sizeof(ctypes.c_voidp)
output -> 4
but I had the same issue as you that couldn't setup a permanent solution with environment flags as before.

How to use MPI (openMPI or MPICH2) with minGW - GNU gfortran compiler

I am using the eclipse PTP IDE to develop MPI code, I want to be able to compile MPI on windows, it seems to provide c++ and c binding, but I am writing using fortran and gfortran compiler and would like to work in windows, the current problem doesn't exist on linux because there it is possible to compile the libraries locally in linux and use the .mod modules.
I wanted to compile the modules using cygwin but the GNU gfortran version on cygwin is too old, and I wasn't successful openMPI or MPICH2 on windows using miniGW
any suggestions? maybe using c++ binding in fortran 2003, I write my code in fortran 2003 so it support this feature.
Documentation on this issue is lacking.
Thank you.
According to the MPICH2 Installer's Guide MPICH2 can be built under cygwin (see section 9.3 of the same document), so the version of gfortran shouldn't be an issue. Have you followed the instructions in this document (in particular section 2)?

Mex problem, how to support c99(matlab)

I'm using windows os. I want to choose some compilers which can support c99 to mex my cpp files. What should I do? I have installed visual c++ in my os, but I guess it does not support c99
Thanks
Zhong
Well, comparing the list of compilers supported by mex with the list of compilers supporting C99, it looks like the best you can do would probably be Open Watcom or Intel C++, which each have partial support for C99.
If you are able to run on Linux or Mac OS X, you can use GCC, which has better C99 support, but given that you are on Windows, it doesn't appear that Matlab on Windows supports GCC.
A proposed solution for working with MinGW can be found here.
Transparency: the solution was posted by me.