How to set tab space keybinding in UTOP - terminal

I'm thinking I have to somehow edit my ~/.lambda-term-inputrc file but I'm lost as to what actually to write in it.

While I'm totally not sure that it is a good idea to bind <tab> to spaces in the interactive shell where <tab> is used for completion, you can achieve this using the following ~/.lambda-term-inputrc,
[read-line]
[edit]
C-i: insert( ), insert( ), insert( ), insert( )
Explanation, here C-i is the Emacs way of saying <tab>, and a series of insert( ) will insert four spaces, instead of a tabulation.
P.S. This might not work, however, since lambda-term may treat specially.

I got it to work by similar steps to what ivg suggested by instead changing C-i with tab
"tab: insert( ), insert( ), insert( ), insert( )"

Related

vim: How to create a shortcut on ALT key to insert text while in insert mode?

I usually press alt + , to insert <, it works fine in my zsh terminal and on every other application, but unfortunatly not on vim or neovim.
I tried following but nothing worked:
map <M-,> "<"
map <M-,>='<'
I appreciate any help
Everything is wrong, here.
First, you can't expect any of those mappings to do anything in insert mode because the :map command creates mappings for normal, visual, and operator-pending modes, not for insert mode. The first thing to change is thus to use the proper :map variant:
imap <M-,> "<"
imap <M-,>='<'
Second, the left-hand side of a mapping (the keys you want to press) and the right-hand side (what you want Vim to press instead) are supposed to be separated by whitespace so your second example wouldn't produce a mapping to begin with. It asks Vim to list insert mode mappings that contain <M-,>='<', which is pointless.
Third, the right-hand side of a mapping is a macro, where every character is used as if you typed it. "<" would literally insert a double quote, an angle bracket, and a double quote. If you want the mapping to insert a <, use a <:
imap <M-,> <
Fourth, I've heard that Neovim handles the Meta/Alt key better than Vim so the mapping above is still likely to be problematic in Vim, depending on the OS or the keyboard layout. For example, in Vim on macOS with the AZERTY layout, the system translates Alt+, to ∞ before it even reaches Vim so <M- and <A- mappings simply don't work reliably.

Godot: too few arguments

every now and then I stumble over an error-message like the one in this case:
if "," in text.erase():
print ("comma erased")
error(109,1): Too few arguments for "erase()" call. Expected at least
2.
Whatever I try to put into those (), nothing seems to work. How can I find out what arguments I need in such a case?
At least some basic programming knowledge provided, the editor's Search Help offers some useful info in such a case:
void erase ( int position, int chars )
Erases chars characters from the string starting from position.

Clear table data in SQL

I hope there is no post limit since I have posted more than once today. :-P
Now I have a table in OracleSQL. I noticed there are some useless signs and want to delete them. The way I do it is to replace all of them. Below is my table and my query.
Here is my query:
SELECT
CASE WHEN WORD IN ('!', '"', '#','""') Then ''
ELSE WORD END
FROM TERM_FREQUENCY;
It is not giving me an error, but these special characters are not going away either... Any thoughts?
A little typo of yours: you use - instead of _
SELECT
CASE WHEN WORD IN ('!', '"', '#','""') Then ''
ELSE WORD END
-- FROM TERM-FREQUENCY; --This is where the problem is.
FROM TERM_FREQUENCY; -- Because your table is named TERM _ FREQUENCY
You originally tagged your question with 'replace' but then didn't use that function in your code. You're comparing each whole word to those fixed strings, not seeing if it contains any of them.
You can either use nested replace calls to remove one character at a time:
select replace(replace(word, '!', null), '"', null) from ...
... which would be tedious and rely on you identifying every character you didn't want; or you could use a regular expression only keep alphabetic characters, which I suspect is what you're really after:
select regexp_replace(word, '[^[:alpha:]]', null) from ...
Quick demo.
You might also want to use lower or upper to get everything into the same case, as you probably don't really want to count different capitalisation differently either.

What is the best way to trim leading and trailing single quotes in pl_sql

I am getting a Varchar2 variable with leading and trailing single quotes but I want to remove these single quotes, I am doing it like
trim(BOTH '''' FROM lastname);
It is giving me right result but is it a right way or is there any other way to do that.
Thanks in advance.
I think you can't get any better than what you already proposed. So yes, this is the right way.
Using BOTH is not necessary as it is the default (as oppposed to the also valid leading and trailing specifiers). So, depending to your preferences (short vs clear) you might leave it out, so that your statement becomes
trim('''' from lastname)

how to get value containing special symbol in where clause

i have a requirement to pull the column value containing special symbol('.').
i wrote the code like below
SELECT value, name_display_code
FROM vp40.ATTRIBUTES
WHERE attribute_type_id IN (
SELECT attribute_type_id
FROM vp40.attribute_types
WHERE name_display_code =
'ATTRIBUTE_TYPE.R'
|| '&'
|| 'D GMD NO'||'.')
i need value is ATTRIBUTE_TYPE.R&D GMD NO.
TL;DR: set define off before running your query (probably).
A period (.) is not a special character. The way you've split up and concatenated the value makes me wonder if you're actually seeing a substitution variable issue in SQL*Plus or SQL Developer (or maybe other another client) because of the &, which can in turn can make a . seem to disappear - though not in your specific case.
A period can mark the end of a substitution variable, and is needed if the next character is part of the string, so if you had:
select 'R&Ddept' from dual;
then the entire 'Ddept' would be treated as the substitution variable:
Enter value for ddept: D
old 1: select 'R&Ddept' from dual
new 1: select 'RD' from dual
'R
--
RD
To make just the D be the substitution variable and leave 'dept' as a fixed string, you delimit the variable with a period:
select 'R&D.dept' from dual;
Enter value for d: D
old 1: select 'R&D.dept' from dual
new 1: select 'RDdept' from dual
'RDDEP
------
RDdept
But if you want a period to actually be displayed as well, you need to add an extra one, to account for the one swallowed by the substitution processing:
select 'R&D..dept' from dual;
Enter value for d: D
old 1: select 'R&D..dept' from dual
new 1: select 'RD.dept' from dual
'RD.DEP
-------
RD.dept
Obviously this only applies if you actually want the substitution, and of course the & doesn't appear in the final string in any of those cases. More confusingly (for me) in your case, having a space between the & and the . means it is not treated as a delimiter anyway; for 'ATTRIBUTE_TYPE.R&D GMD NO.' only the &D is treated as a substitution and the . is left as it is. I'm guessing you got to this point with a shorter value.
What you probably want to achieve here is to avoid the substitution altogether. The way you're doing it, splitting up the string so the & is seen on its own and no substitution is seen, is certainly one way but painful, particularly if you don't necessarily control the string being used or there are multiple values.
There are at least two other ways; with set escape and set define:
set escape '\'
select 'ATTRIBUTE_TYPE.R\&D GMD NO.' from dual;
This defines an escape character for the SQL*Plus session, and you can then put that character before the ampersand - \& - so it is not treated as a substitution variable. But you still have to modify your original string, which isn't ideal.
set define off
select 'ATTRIBUTE_TYPE.R&D GMD NO.' from dual;
This disables substitution altogether, so the original string remains intact. This is the simplest approach generally. You can toggle it on and off as needed in your script; if you have a single statement that needs substitution in some places but also has ampersands that you want to keep you can either revert to the escape mechanism, or define a different substitution character, as long as you can find something else you'll never need to escape.
(You may also see references to set scan off; this predates set define and is obsolete, so don't use that in new code).

Resources