I am recently migrating from vimscript to lua with Nvim. While converting the keymappings, I ran into a problem with the following keymap:
[ init.vim ]
tmap <leader>e <C-\><C-n>
[ init.lua ] ( error )
map('t','<leader>e','<C-\><C-n>')
Whenever I reload with above keymap, Nvim will throw the following error:
I'm assuming that "\" might be the problem. If so, how do I refactor the keymap properly for it to work? Any feedback will be greatly appreciated.
It is most likely as the \ is used to escape special characters in the string. Try putting
map('t','<leader>e','<C-\\><C-n>')
This way you are telling Lua that you want the backslash character and not some other special character.
I'm getting the following error in Neo4j community 4.1.2 using the neo4-admin import tool.
Caused by:ERROR in input
data source: BufferedCharSeeker[source:/home/ubuntu/workspace/neo4j-community-4.1.2/bin/../import/nodes.csv, position:24455, line:359]
in field: code:string:6
for header: [id:ID, labels:LABEL, type:string, flags:string, lineno:string, code:string, childnum:string, funcid:string, classname:string, namespace:string, endlineno:string, name:string, doccomment:string]
raw field value: 402
original error: At /home/ubuntu/workspace/neo4j-community-4.1.2/bin/../import/nodes.csv # position 24455 - Multi-line fields are illegal in this context and so this might suggest that there's a field with a start quote, but a missing end quote. See /home/ubuntu/workspace/neo4j-community-4.1.2/bin/../import/nodes.csv # position 24455.
I checked each single byte with hexedit:
the line #359
the char #24455
the line #358
the line #360
357,AST,string,,34,"/load.php",1,310,,"",,,
358,AST,AST_CALL,,37,,9,310,,"",,,
359,AST,AST_NAME,NAME_NOT_FQ,37,,0,310,,"",,,
360,AST,string,,37,"wp_check_php_mysql_versions",0,310,,"",,,
361,AST,AST_ARG_LIST,,37,,1,310,,"",,,
362,AST,AST_INCLUDE_OR_EVAL,EXEC_REQUIRE,40,,10,310,,"",,,
This is the absurd situation:
no multi-line fields are present
no special char are present
no extra 0A byte
no extra "start quote" without its relative "end quote"
I found some issues on Github but are referred to old versions of Neo4j...what can be the reason?
Finally I found the line causing the exception.
The exception cause was correct but the number of the line was totally wrong.
I pointed out it by adding the following flag --multiline-fields=true to the neo4j-admin import command.
When I try to decrypt this bytecode:
local crypt = '27\76\117\97\83\0\25\147\13\10\26\10\4\8\4\8\8\120\86\0\0\0\0\0\0\0\0\0\0\0\40\119\64\1\255\201\207\1\0\0\0\0\0\108\105\110\101\108\101\110\103\116\104\32\61\32\49\48\48\48\32\45\45\72\111\119\32\108\111\110\103\32\121\111\117\32\119\97\110\116\32\101\97\99\104\32\108\105\110\101\32\111\102\32\111\98\102\117\115\99\97\116\101\100\32\99\104\97\114\97\99\116\101\114\115\32\116\111\32\98\101\46\13\10\45\45\73\102\32\116\104\101\32\115\99\114\105\112\116\32\105\115\32\116\111\111\32\108\111\110\103\32\119\104\101\114\101\32\116\104\101\32\111\117\116\112\117\116\32\115\97\121\115\32\34\109\101\115\115\97\103\101\115\32\100\105\115\99\97\114\100\101\100\34\32\116\104\101\110\32\99\104\97\110\103\101\32\116\104\101\32\110\117\109\98\101\114\32\116\111\32\52\48\48\32\111\114\32\49\48\48\48\44\32\101\116\99\46\13\10\97\32\61\32\115\116\114\105\110\103\46\100\117\109\112\40\102\117\110\99\116\105\111\110\40\41\13\10\13\10\108\111\99\97\108\32\99\111\100\101\32\61\32\39\92\50\55\92\55\54\92\49\ 49\55\92\57\55\92\56\49\92\48\92\49\92\52\92\52\92\52\92\56\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\50\92\53\92\54\49\92\49\92\48\92\48\92\53\92\54\52\92\48\92\48\92\50\56\92\49\50\56\92\49\50\56\92\48\92\54\92\49\50\56\92\54\52\92\48\92\55\92\48\92\48\92\48\92\53\92\49\57\50\92\48\92\48\92\54\92\48\92\54\53\92\48\92\54\92\54\52\92\54\53\92\48\92\57\92\49\57\50\92\54\53\92\49\51\49\92\53\92\49\57\50\92\48\92\48\92\54\92\48\92\54\54\92\48\92\54\57\92\49\57\50\92\48\92\48\92\55\48\92\49\50\56\92\49\57\52\92\48\92\55\48\92\54\52\92\49\57\52\92\48\92\57\92\54\52\92\49\50\56\92\49\51\50\92\53\92\49\57\50\92\48\92\48\92\54\92\49\57\50\92\54\54\92\48\92\54\57\92\49\57\50\92\48\92\48\92\55\48\92\48\92\49\57\53\92\48\92\55\48\92\54\52\92\49\57\52\92\48\92\57\'
I get the following error: "unfinished string near 27LuaS". How can I fix this?
Add one \ at the beginning of the string
Remove the \ at the end of the string
Remove a line break in the middle of the string
The program then runs. If you write that string to a file, then you'll get truncated Lua 5.3 bytecode. It seems that your original script is incomplete.
Hello I am writing a scipt on ROBLOX and I have encountered a problem.
function showVictoryMessage(playerName)
local message = Instance.new("Message")
message.Text = playerName .." has won!"
message.Parent = game.Workspace
wait (2)
message.Destroy()
end
Upon running this function, or more specifically the "message.Destroy" command, I get the error: Error in script: '=' expected near '< eof >'
I have never seen this error before, and the ROBLOX wiki page on Lua errors doesn't mention it.
I would very much appreciate help in this, because I don't personally know anyone who has coded in Lua.
Looks like a syntax error. message.Destroy() should be message:Destroy() according to this Roblox wiki page http://wiki.roblox.com/index.php?title=API:Class/Instance/Destroy
Also see the section Explosions, Messages, and More at URL http://wiki.roblox.com/index.php?title=Basic_Scripting which provides similar syntax using the colon (:) operator.
See also Difference between . and : in Lua and explanation of "possible side-effects of calculations/access are calculated only once" with colon notation.
Instead of message.Destroy() it should be message:Destroy()
Remember that '.' are used directory-wise and ":' are used for inbuilt functions.
WOOOOOOOO! It was a syntax error. The correct command is message:Destroy. Cause why would object.Destroy work and message.Destroy not?
Im trying to use idl to read a file, so im using the readcol command. However, in my file i use | as a delimiter, but continually get syntax errors. Heres my latest attempt:
readcol,'kcorrins.txt',uband, gband, rband, iband, zband, $
ubanderr, gbanerr, rbanderr, ibanderr, zbanderr, adjredshift, $
SKIPLINE=1, DELIMITER=|
could someone post an example of the proper syntax for using the delimiter in this way?
You need to quote the delimiter:
readcol,'kcorrins.txt',uband, gband, rband, iband, zband, $
ubanderr, gbanerr, rbanderr, ibanderr, zbanderr, adjredshift, $
SKIPLINE=1, DELIMITER='|'