Jupyterlab / Mac / German keyboard: how to comment multiple lines or entire cell? - ipython

I'd like to simply select and comment/uncomment multiple python lines in jupyter, which means putting # sign at the beginning of each line. What is the keyboard shortcut for that in German layout (QAY-WSX)? Thanks.
For info: non of these solutions worked
jupyter - how to comment out cells?

Related

CLIPS: Clear-window in CLIPSDOS.exe and tab to indent in CLIPSIDE

With CLIPS, It's possible some of the following?? (V 6.4 for Windows)
1 - Use a command like (clear-window) in the CLIPSDOS console for clear the console.
2 - Use tabs for indentation in CLIPSIDE. When i press tab, cursor goes to File menu item... how to indent?
How do people learn programming with CLIPS? I'm using a plugin for Visual Studio that helps me with the parenthesis concordance, let me use tabs to indent, and other tricks. But it has some problems, and i'm quite worried about the usability of the CLIPSDOS and CLIPSIDE interfaces to this purpose.
Thanks in advance.
In CLIPSDOS, you can use the command (system cls) to clear the screen. This will simply call out to DOS to execute a cls command.
The IDEs use standard text editing classes for the CLIPS command prompt window. Tabs appear to work correctly on the macOS IDE, but not the Windows or Java Swing IDEs, so that will need to be corrected.
While you can directly enter constructs at the command prompt, it's better to edit them in a file with your preferred text editor and then use the load command from the command prompt to load the contents of that file. The IDE supports a command history so you can use the up/down arrow keys to cycle through prior commands to avoid retyping.

How to copy cells in Visual Studio Code when using Jupyter?

I'm working with a Jupyter notebook. How would you copy cells in Visual Studio Code? C to copy and V to Paste did not work for me as it would online.
Also, Visual Studio doesn't seem to offer right click options when working in the notebook. Is there a extension that would give me some options such as Cut, Copy, Paste, Delete Cell, Etc.?
I'm a developer on this extension, and I have a bit of a two part answer for you.
In the current (as of 2/16/21) stable release version of the extension notebook UI is done by a hosted webview, it was the only supported option at the time. As such it is lacking features both of Jupyter and of VS Code editor instances. It does not currently support cutting, copying and pasting of cells.
We are currently in the process of moving over to VS Code's new notebook UI that they provide. This allows better UI both for matching Jupyter and supporting more VS Code editor features. This current UI does allow for copying / cutting / pasting cells with the familiar Jupyter commands.
This support will not be added to the old editors, but currently the new UI is available if you use the extension with VS Code - Insiders and will soon start rolling out to VS Code Stable.
https://devblogs.microsoft.com/python/notebooks-are-getting-revamped/
Short answer: Supported with VS Code - Insiders now, and will be supported on stable VS Code in the future.
The new version of the visual studio Jupyter Notebook extension support all the standard operations for one or multiple cells of the jupyter notebook. For example, the following list shows some tested shutcuts:
To copy a selected cell(s) use: ctrl+c
To paste a selected cell(s) use: ctrl+v
To cut a selected cell(s) use: ctrl+x
To delete a selected cell(s) use: ctrl+x
etc.
Note that, as usual, to select multiples cells one should hold the ctrl button before selecting.
As of 2021-01-14, you can now select the cells, right click on any single one of the cells you selected (this will select them as a group if you select more than one) and have the option to press COPY. Or you can simply ctrl+C as a keyboard shortcut. The key here is when you copy and paste the cells to another notebook, your cursor needs to be outside any cells; that is you need to press somewhere outside the cell before pasting. In COLAB notebook, even if your cursor is on a cell, the copy and pasting method works. BUT here if you do that you will be pasting all of the codes inside the cell where your cursor is active; it will not paste the actual cells you copied.
Hope this wasn't too confusing.

How to Format Jupyter notebook in VSCode?

We can format python code in the jupyter notebook in the browser. After I change to VSCode and use the Microsoft extension, I find I can not format Jupyter notebook any more. Does anyone know how to solve this?
As Kyle Carow stated in their answer to Ian Huff: Formatting of notebooks is available by now.
MacOS: Option+Shift+F
Windows: Alt+Shift+F
Pressing these keys will either trigger a formatting of the active cell or the notebook as a whole if no cell is active.
Windows: Shift+Alt+F
Is what worked for me with Black formatter set up on VS Code Version: 1.64.2
Or right click "Format Notebook" to format entire notebook.
Format Notebook
I do not think VS Code support formatting of code cells, but if you use the black code formatter, then you can use the blackcellmagic %%black to format the code in a cell.
You need to have pip install black and blackcellmagic, details here: https://github.com/csurfer/blackcellmagic
I'm not exactly sure what is being asked here. But currently in VS Code the notebook editor and interactive window do not support formatting python code.
However we are moving to a new UI for those features which will support all the formatting features of VS Code in .py files. If you try out VS Code - Insiders now you should see this support and can try it out. This new UI will eventually be rolling out to VS Code stable.
Edit: The new UI which supports formatting in cells is now out by default for stable users.
If you have a Jupyter notebook open in VS Code with the Jupyter notebook extension, it should be possible to format code cells with Ctrl+ Shift+ I.
I'm not sure if this shortcut differs between operating systems, you can check what the shortcut is yourself by hitting Ctrl+ Shift+ P and then searching for "Format cell". The shortcut should be displayed then.

Eclipse: Scroll down further than file's last line

I've been searching to no avail for a tweak that would enable Eclipse's editor window to scroll down N lines further below the edited file's last line. Such behavior is supported in:
IntelliJ IDE
VIM (by setting 'set scrolloff=10' for example, enabling you to scroll 10 lines further below the last line)
Thanks in advance,
amnong
Sorry, you can't. See this question.

How to show/reveal hidden or invisible characters in NetBeans?

How can you show/reveal hidden characters in NetBeans? In other editors, if this feature is turned on, a space might be shown as a small centered dot, and a tab as a right arrow. (This feature is useful to see if a file uses tabs or spaces for indentation, among other things.)
This feature was missing for a long time—a feature request was created on November 1999 and it was finally implemented on August 2010 (NetBeans 6.10). You can enable/disable it at "View → Show Non-printable Characters".
Bug history
As of NetBeans 7.0.1, the definition for "non-printable" seems to include tabs and carriage returns but not regular white space char:
NetBeans 7.1.0 finally displays spaces. However, now it has a new bug where consecutive tabs (or tabs & spaces combinations) collapse into one tab:
NetBeans 7.4.0 fixes this:
There're yet a couple of issues:
The end of file is represented with the same symbol as line feeds, thus making it non-obvious to determine whether the file ends with EOL.
Hidden chars are displayed in the same colour as regular text.
These issues have not been addressed so far but they can be sort of mitigated with the Editor Whitespace third-party plugin, which:
Hides the EOL and EOF markers (which aren't useful anyway).
Displays other whitespace characters using always the same colour.
in netbeans 7 you can enable display of spaces, tabs & line feeds like this:
spaces
download font from: http://netbeans.org/bugzilla/attachment.cgi?id=97902
install the ttf font
tools > options > font & colors > Syntax > All Languages > Whitespaces
choose the installed whitespace font
more info about the netbeans 6 bug: http://netbeans.org/bugzilla/show_bug.cgi?id=4619
tabs & line feeds
in netbeans 7 you can enable to see non-printable characters:
view > show non-printable characters
in netbeans 6 only the spaces part works
Using Netbeans 8.0.1
View-> Show Non-Printable characters
Ubuntu 11.10 => Netbeans 7.0.1
The "View → Show Non-printable Characters" mode really not shows whitespaces while font was not installed by me.
Thanks!
View -> Show Non-Printable characters
Using Netbeans 7.3.1,
View -> Show Non-Printable characters
I can see white-spaces, tabs, and carriage returns.
This feature has finally been added and is available in NetBeans 6.10. Since this has not been released yet, you can try out 6.10 MileStone 1: http://bits.netbeans.org/netbeans/6.10/m1/. I look forward to the final release!