When pressing enter key, automatically skips a line in Jupyter Notebook - jupyter-notebook

Not sure why but when I press enter within the cell to type on the next line, it skips a line instead, i.e. there's now a blank line in between my 1st and 2nd line of code. Happens each time I press enter. Not sure if anyone encountered this before.
# this is my first line
(empty line)
# my cursor jumps to 3rd line by just pressing enter once

Related

How to make R script jump to the next line?

The last line of my script creates a table
write.xlsx(res, file="C:/Users/salahmed/Desktop/test/res6.xlsx", row.names=FALSE);
But after I run the whole script, the cursor remains stuck at the end of this line and the table is not created. It moves to the next line (with the > symbol) only if I press Enter and only then the table is created in the folder. How do I make it automatically move to the next line without having to press Enter?
As mentioned in the comments, the problem was solved by adding a blank line at the end of the script.

Atom: How do I create shortcut to select a word and search?

I got really used to cmnd+d, cmnd+g and cmnd+d, cmnd+shift+g workflow in sublime text. Is it possible to reproduce the same behavior in Atom using keymap.cson or some other tool?
Here is step by step description of the expected behavior:
I put my cursor on a word.
I press cmnd+d, the word gets highlighted and silently copied to search input. Not silently would be ok.
If I press cmnd+g, the selection goes to the next occurrence of the word. If I press cmnd+shift+g, the selection goes to the previous occurrence of the word.
If I press cmnd+d, I select the current and the next occurrence of the word.
I'm running Linux instead of Mac and I'm not sure what the differences are, but here's the closest method I've found:
Put your cursor on a word
Press Ctrl+F3 to select the next occurrence of the term or Ctrl+Shift+F3 to select the previous occurrence
I say "term" instead of "word" because its behaviour depends on whether whole word matches are enabled in the Ctrl+F menu.
Press Ctrl+D once to select the current word, and again to select the next occurrence of the word
Also:
Ctrl+F searches for whatever's selected
Alt+F3 selects all occurrences of the current word

What does the "+" symbol mean on the left side of the R console?

I have entered in code to plot a graph, but when I press Enter to execute the graph, it does not plot the graph. Rather, + symbols appear every time I press Enter to execute the command and plot the code.
Now there is a long column of + symbols in my R consoles.
Why is this happening and what can I do to prevent this from happening?
The prompt has + because it signifies that the prompt is expecting more from the line of code, a sort of continuation. This may be because you forgot to close something so the prompt expects the closing side. For example, say you forgot to close a string like so:
> "
+
+
Here, I entered a double-quote into the prompt and kept on pressing Enter. There is a missing double-quote to tell the prompt I've ended the string literal, so the prompt expects another double-quote. Once you enter the double quote the prompt will stop expecting it. For example:
> "
+
+ "
[1] "\n\n"
This is standard on all command prompts, to expect more code if something isn't ended properly, like the string literal above. Check your code to make sure you've closed all opening quotes, symbols, etc, so the prompt doesn't expect it and your code executes correctly.
The ways of exiting the prompt when this happens are:
Esc on RGui and RStudio
Ctrl-C on Terminals and Command Prompts
This could happen if you used space in the middle of an object name, eg. Column names. R doesn't allow space in between " ".

R readline, issues with User Input

1
Firstly my issue is when sourcing a script, if that contains a readline call, the input in console is attached to the prompt
eg
sourcefile <- readline(prompt="Enter csv file name for FUND DATA, 2nd column price data\n")
in the console I type in equil, it appears as/this is where I'm typing
Inputting looks like
After hitting enter, this then indents with \n. Notice how equil.. is now on the next line. Then for next readline I am again inputting with 0 space between my input and the prompt.
This is super unreadable/awkward. Is it possible to input for readlines on it's own line for readability? ie to have the user typing on the next line like it is after pressing enter
Output then indents
try this:
sourcefile <- readline(prompt=cat("Enter csv file name for FUND DATA, 2nd column price data\n"))

# symbol at the bottom when search using / in vi

I open a file in unix with vi, then do the search using /, it finds an occurrence but it also displays # symbol at the bottom, when I try to scroll down, the # symbol disappears. I'm not sure if this # symbol was something I entered accidentally when I was modifying the the file last time.
Have a look at :
http://nixdoc.net/man-pages/HP-UX/vi.1.html
"Terminals with limited local intelligence
might display lines on the screen marked with an #. These indicate
space on the screen not corresponding to lines in the file. (These
lines can be removed by entering a ^R, forcing the editor to retype
the screen without these holes.)"

Resources