I'm trying to cut and paste multiple commands into the Neo4j browser. When I paste and individual command it works fine. When I paste multiple command sets all terminated by a ; I encounter errors.
The commands are for example as follows:
start n1=node:node_auto_index(id='1000038'),n2=node:node_auto_index(id='M5') create n1-
[:STUDIES]->n2;
start n1=node:node_auto_index(id='1000039'),n2=node:node_auto_index(id='M7') create n1-
[:STUDIES]->n2;
I get this error:
Invalid input 's': expected whitespace, comment or end of input (line 2, column 1)
"start n1=node:node_auto_index(id='1000040'),n2=node:node_auto_index(id='M15') create
n1-[:STUDIES]->n2;"
^
Any help would be greatly appreciated.
At the moment, the Neo4j Browser only supports single statements, which may be multi-line. Execution of multiple statements is planned as a feature enhancement.
Cheers,
Andreas
In Neo4j 2.2.3 web interface, press Shift + Enter to generate multiple new lines and then enter your code. Then click on the run button on the right. For me, it worked! :)
Related
I'm trying to remove duplicates in an document. This includes both of entries it finds without moving the order of the entries.
Example
A
B
C
Random info
B
C
Results
A
Random info
I found how to do that via this link and following Method 2. Problem is when recording the macro it doesn't record steps I take when using Column editor. Does anyone know how to fix this or a different method? Thank you
Unfortunatelly, column editor and other plugin actions cannot be recorded because of a bug in notepad++.
However, you can still achieve what you want without using column editor.
Use this macro:
Start macro recording
Control + H to launch "search & replace":
Find what: ^([^\n]*)$\R([\s\S]*?)\R?+^\1$
Replace by: \2
Replace All
Place the cursor at the first position of the file (line 0, character 0) Use the mouse or use Control + G, then 0
Stop macro recording
Now, run your macro with run a macro multiple times and select run until the end of file.
Here is a demo of the process:
I'd like to be able to run a spark-shell command via it's history number. When I type :history or :h?, I then cut and paste the command - even though the history command gives it an ID number. I'd like to be able to type
:61
or something to just rerun the command. Is there something like that?
You can press control + R, then start typing to search for your command. You can then press enter to run, or you can edit the command before running, like in readline.
Yes It is possible to use the use HISTORY command in spark shell
scala> :history
or
scala> :22
or
scala> ctrl + r
dpeacock's answer is probably the best you can get currently.
If you look at this SO question you can see that you could load the history yourself, but loading and running it is another story as I cannot seem to find a way to get access to the ILoop variable, which is the interactive loop that you could run an interpret command through.
To load the history, just do
val history = new FileHistory(new File("HOME/.spark_history"))
history.index //gives you the current number
history.moveTo(NUMBER) //moves the cursor
history.current //gives you the command you want
You could wrap this all up in an object, but without the ILoop you would still need to copy and paste. So....the short answer is not really
In Linux it will be present in
/home/<userid>/scala_history for spark-shell
How can I create a new database in oracle12c?
I started the oracle using the command sqlplus "/as sysdba".then i tried to create a new database.For that use the command create database.When I give that query and press enter then a number 2 is displayed and nothing happens.I don't know what to do next?
Actually, you can create a database via SQLPlus; I do it all the time; what is happening to the user with the question, is he is entering just part of the create database command, hitting ENTER, and then SQL*Plus displays a "2" meaning it is ready to accept line 2 of the command. SQLPlus will not run the commands until you enter a ";" at the end of a line and press ENTER, or a "/" and press ENTER as the first character on last line.
What you can do is to create an initialization file, say /u01/app/oracle/product/12.1.0/dbs/initbadint1.ora, that might look something like this:
control_files = (/u02/oradata/badint1/badint1control01.ctl,
/u03/oradata/badint1/badint1control02.ctl,
/u04/oradata/badint1/badint1control03.ctl)
diagnostic_dest = /u01/app/oracle/admin/badint1/ddump
db_block_size = 8192
db_name = badint1
and then look at
http://docs.oracle.com/database/121/SQLRF/statements_5005.htm#SQLRF01204
for the full syntax of the create database command.
Then invoke the following in SQL*Plus:
startup nomount pfile=/u01/app/oracle/product/12.1.0/dbs/initbadint1.ora
create database "badint1"
controlfile reuse
maxlogfiles 32
maxdatafiles 1000
-- rest of commands go here ...
;
Once you enter the semicolon and press enter, then Oracle will create the database.
Once that is done, then invoke the following, one at a time, to set up the data dictionary:
#/u01/app/oracle/product/12.1.0/rdbms/admin/catalog
#/u01/app/oracle/product/12.1.0/rdbms/admin/catproc
All the databases have to be created with Database Configuration Assistant, it is possible to create in both command line and GUI interfaces. Also Oracle Corp. strongly recommends to use this tool to create databases.
PS: try to google next time you have a question, its is really easy, I found this after 5 sec I started the search
Every-time you save a Scala Worksheet in the Scala IDE, the output of each expression is printed as comments on the right-hand side of the editor. Is there a way to clear this output from a Scala Worksheet so that you can cut and paste code?
Currently, my solution is to save my worksheet with an error, so that the output would disappear. There must be a better way... a keyboard shortcut or something.
There is no such feature yet. There is a related ticket: The Format action should strip comments.
While waiting for the ticket to be resolved, this regular expression can be used in Find/Replace (Ctrl/Cmd+F) to delete the comments.
*//[>|].*$
Update:
This has been fixed: #132
It's jerry-rigged, but gets the job done.
Make a small edit (e.g. delete a space where it doesn't matter) to prompt a save.
Save.
Press Esc immediately to terminate worksheet process.
You now have a clean worksheet!
Ctrl+Shift+C does the job in Scala IDE 4.7.0
Alt+Shift+A enables Block selection mode. You will be able to select only left part of screen (columns with code). Block mode also makes possible to select only columns with output.
More on block selection mode
I'm writing a script in Python 2.7 exploring the use of the multithreading and Queue modules. the script just defines two functions, one of which will be started in a thread instance to fill a Queue, and a second one which will be started in a second thread instance to pull something off the Queue. However, I cannot even get this script to execute, as it chokes on one of the function definitions even before it executes. The code snippet with the problem is:
def listenThread(counter):
while queue.empty() != True:
try:
outcome = queue.get()
print outcome
counter -=1
print counter
except:
return 'queue.get() command loop failing.'
The error message I am getting is:
$ python threading-and-queue-test.py
File "threading-and-queue-test.py", line 34
except:
^
IndentationError: unindent does not match any outer indentation level
$
I've searched SO and checked the docs for correct formation of the try-except construct, and it seems OK. I had earlier versions of the code (without the try-except ) working, so I am getting suspicious about the text editor, TextWrangler v4.0.1.
Can anyone suggest a debug approach or code correction?
Thanks!
Red
As you have already suspected, it is most likely an indentation error. Your text editor is probably mixing the use of tabs and spaces. Replace all tabs with spaces (or vice versa though the standard in python is 4 spaces) and you should see the error disappear.
For those who find this question later like I did it's easy to fix TextWrangler's settings and stop this issue altogether; Go to "Preferences" -> "Editor Defaults" -> "Auto-expand tabs" then set tabs to 4 spaces. Restart TextWrangler for changes to take affect. For existing documents that continue giving you a problem read this.