Cython installed but no cdefs in Visual Studio 2017 - cython

I just installed cython and I have a problem in Visual Studio 2017.
I wrote a simple program:
import cython
def SimpleProgram():
cdef int i
The "import cython" shows cython in pink, which is the color in Visual Studio for modules that are in installed, so based on that the installation appears to be correct.
But the "cdef" in cdef int i, j does not show in blue (it's white), indicating that it does recognize cdef.
Is there some extra installation step I need for Visual Studio? I didn't see anything about it in the installation instructions.

There is no support for cython syntax in visual studio right now, but it can be added through an extension https://marketplace.visualstudio.com/items?itemName=guyskk.language-cython
As for why, apparently they are waiting for support to be added to Magic Python.
Other factors that might cause this in the future could include:
if you didn't end your filename with the correct extension .cy or .pyx in windows

Related

How to Use a Jupyter Notebook in Visual Studio 2017?

Visual Studio 2017 now supports use of a Jupyter Notebook.
A Lap Around Python in Visual Studio 2017
According to the MSDN blog post:
To work with a notebook, simply download your IPYNB file as a .py file and open it in Visual Studio. You’ll see that markdown cells have been turned into comments and each cell is collapsible and expandable.
When I download a IPYNB file, rename to a .py file, it displays in the VS editor as a JSON file containing markdown. I was expecting to see a markdown file. What am I missing?
#Jonathan answer is correct. The MSDN blog was referring to Jupyter Notebooks menu item File->Download->Python (.py). There's additional considerations in getting a notebook to run and ultimately a issue with quality of experience.
To use a notebook in Visual Studio, download using Jupyter as stated above.
Specify the Python environment as Anaconda as shown in the blog image. To do so, either set Anaconda as the default environment or create a solution from existing files that specifies Anaconda as the environment.
Open a Python interactive window to display notebook execution.
Use Ctrl-Enter to step through notebook's statements.
That said, be aware that Visual Studio's notebook-ish experience is not at the level of Jupyter's, for now. Until VS directly integrates notebooks (.IPYNB files), I see little advantage of using VS over the real Jupyter.
VS has fewer and semantically different key bindings than Jupyter.
Jupyter's formatting (HTML) is far superior to VS (text).
There's little support and documentation for notebook-ish in VS.
The whole VS notebook-ish experience lacks polish.
IMHO, the beauty of Jupyter is the single window experience but VS uses two.
This is what I believe they mean with the download as.
You need the Notebook running then click on File-> Download as-> Pythong(.py)
Once you have downloaded your Python file from the notebook you can open it in Visual Studio.
Edited: added the rest of the answer
As an alternative to Visual Studio that does not integrate well iPython notebooks, did you look at PyCharms that is a nice Python IDE (as far as I use it for now^^).
It provides a nice rendrering of ipython notebook inside the IDE making it a common IDE for python and iPython stuff. Maybe it worth a try.

Is it possible to have TypeScript support in Visual Studio Express for Windows?

I got my hands on Windows 8 machine and, willing to check out new Windows Runtime API, downloaded VS 2013 Express for Windows. WinRT offers possibility to code in HTML5/CSS/JS, but I'm interested in using TypeScript as an alternative to JavaScript when not coding for DOM. This possibility is outlined here, but only applicable to Visual Studio 2012 and not even to Express edition, as Web Essentials extension won't work there.
TypeScript web page claims that full support is built into VS 2013 Update 2 RC. However, while this update does install some new extensions and TypeScript gets installed in Program Files as well, it doesn't add TypeScript support to VS 2013 Express for Windows. I still don't get to create .ts file, let alone have it compiled from IDE.
Please note this is a different question from this one, which deals with VS 2013 for Web. I've checked the accepted answer there and it won't work. I'm interested in getting TypeScript to work with either VS 2012 Express for Windows 8 or VS 2013 Express for Windows. I'll also accept an answer pointing me to alternative IDEs for WinRT/Store Apps development, but web research tells me it's unlikely to happen.
Yes, it's perfectly possible to write a Windows Store app using TypeScript in the Express for Windows version of Visual Studio 2013. But unfortunately it isn't supported right out of the box. You'll have to modify the project file yourself.
This sounds harder than it is... I wrote a tutorial on how to this some time ago. It basically comes down to adding some xml to the project file, telling Visual Studio what to do with the .ts files.
After modifying the project the .ts files are compiled and even placing breakpoints inside the .ts files works.

Change compiler errors language in Visual Studio 2013

I installed the english version of Visual Studio 2013. The GUI is in English but compiler errors are in French. That's a nightmare when I want to Google an error...
How can I switch C# compiler output language to English ?
You'd have to switch your machine's system locale to English, Control Panel + Language.
That's a rather impactful change since it also changes the locale for every other program on your machine. One thing you can try (but I cannot verify) is to whack the localization file that the C# compiler uses for strings. On your machine it should be located in c:\windows\microsoft.net\framework\v4.0.30319\1036\cscui.dll. Rename the file so the C# compiler can't find it and is forced to fallback to, hopefully, English. Btw, I guessed at 1036, there are lots of French locales. Locale IDs are listed here.
I have solved this as well. Switching language in the IDE did not worked for me, because if the MS compiler was invoked from another program (Qt Creator in my case), the language output was still in the locale language.
Solution: Remove the language you don't want from Visual Studio using the installation tool and leave only English. It's clean, you don't have to mess with the internal files and you even save some disk space.
Just solve same problem with Deutsch:)
Do this: inside of Visual Studio:
Tools-->Options-->Environment-->International Settings. There you need to download an additional language(i.e. English) and install it.

Why is keyhelp.ocx failing in my Visual Studio C++ application?

Using keyhelp.ocx to display popup HtmlHelp in a modern Visual Studio C++ application fails.
I get a COM exception with no sensible error code. Looking at the debug output, there seems to be an Access Violation behind the scenes.
Your executable is build with Data Execution Prevention enabled, via /NXCOMPAT. That's the default in Visual Studio.
keyhelp.ocx is built using ATL7, which is incompatible with DEP - see http://support.microsoft.com/kb/948468
You need to disable DEP (/NXCOMPAT:NO) for your executable or find an alternative to keyhelp.ocx (I don't know of one).
(Note that's it's possible to enforce DEP system-wide - your code will still fail on such machines.)

ActiveX dependencies in Access

I'm using the Crystal Reports Viewer 11 ActiveX control in an Access form (version 2007, 2003 format). Everything works well on my development machine, where I have CRXI installed. I copied the referenced DLL to the client's machine, but when I try to register it, it says "Can't find module" (I double- and triple-checked my spelling) and when I try to open the form it tells me "ActiveX component can't create object" when the code tries to create a new instance of the report object. I suspect there are more dependency files required by the DLL, but I'm a little at a loss as to what ones and how I go about finding out. Although I'm using the CR control, I assume this would apply to any ActiveX control throwing this error. Thanks.
There should be a runtime distribution document in your Crystal Help files - from past experience (Crystal 8.5) there are multiple files that you have to distribute and register.
I'm answering my own question in case someone finds this via a search in the future. I don't have the Access Package & Deploy wizard David mentioned above (okay, I probably have it but couldn't find it readily) but I image it would probably do what I needed, so I recommend anyone try that first. Instead, I was able to create a setup to install tghe needed files using the Visual Studio Installer and the Crystal merge modules; note that while it wasn't difficult, nor was it pleasant.
I downloaded and installed Visual Studio Installer 1.1 from MSDN. This creates a new project type in Visual Studio 6.0 (in particular, I used InterDev 6.0) that creates a Windows Installer (*.msi) setup file. Because one of the Crystal merge modules requires the Crystal license key and VSI doesn't support merge module parameters, I also had to use Orca, a merge module editor, available from the Microsoft Windows SDK (also available on the Microsoft download site). I recommend reading through the SDK and Orca pages on MSDN for more info. Using Orca, I was able to put my key code and recompile the merge module, so I don't have to deploy my key to my users, and my users don't have to enter one.
Again, the Package & Deployment Wizard is probably a better option, but when faced with using merge modules, as with Crystal, this method will get the job done.