Pyautogui: Can I insert text at the current cursor position using a keyboard shortcut? - pyautogui

In Pop!_os 21.10 I created a keyboard shortcut in the settings panel 'ctrl'-'/' to run python3 /home/dg/scuts/p2-pyautogui.py
In /home/dg/scuts/p2-pyautogui.py I used the following:
import pyautogui, time
time.sleep(0.3)
pyautogui.write("el0 n 123. 12345", interval=0.005)
In gedit, I try to run this.
If I press 'ctrl'-'/' and quickly release the ctrl key it works.
If I hold down the control key too long after pressing /, it seems to execute 'ctrl'-'n' and open a new gedit window. Sometimes I get the emoticon input window, which I think is 'ctrl'-'.'
I want to make it more mistake-proof for entering text like date-time for example using a hotkey combination.
What am I doing wrong?

Related

maple code output does not display on the screen

I've just downloaded the Maple 2020 trial version and I have zero experience on Maple programming. My problem is: when I do simple calculations such as 3+5 or 2*3, the result displays on the screen but, for other functions such as
factor(x^2+2x+1);
or assigning variables can't be done:
n:= 5;
m:=7;
m+n;
I do not see any results on the display screen after the enter.
Where am I doing wrong?
It seems like, I need to change some configurations of the Maple. After doing some search online, I found these suggestions in a web site. I have applied the following steps and my problem is solved: (Remember to apply globally not for the session.)
Open a new blank worksheet
On the toolbar, access Tools->Options.
Select the 'Display' tab
Ensure that the first entry is set to 'Maple Notation', and the second entry is set to '2-D Math Notation'
Click 'Apply to session' at the bottom left
On the toolbar, access Tools->Options again
Select the 'Interface' tab
Ensure that the entry 'Default format for new worksheet' is set to 'Worksheet'
Click 'Apply to session' at the bottom left
Now open a new worksheet in the same session. There should be a prompt '>'.
At the prompt, type 'version();' without the single quotes, but with the trailing semi-colon. This ought to return details of the precise Maple version you are running. If it returns something like
User Interface: 1133417
Kernel: 1133417
Library: 1133417
(precise numbers may be different), then you ought to be good to go - so try something simple like 1+1; at the next command prompt, (remember the semicolon).

PhpStorm keyboard multiple keystrokes

Is it possible to create PhpStorm shortcut through double keystrokes? For example by pressing f character twice.
create every arbitrary shortcut is possible via autoHotKey . for my case create a comma.ahk script with the code below:
:*:ff::
send, {end},{enter}
Return
then run the script. that enough to make you free from going to end of line ,press the comma key and at last going to a new line!

How to get Neo4j webadmin console to properly work with copy and paste?

I want to dump some of my entities using webadmin console like this:
dump match (n:Country) return n;
But there are two problems with this. First: the output has leading arrows ==> which get selected along with the rest of the text:
==> begin
==> create constraint on (n:`Country`) assert n.`code` is unique
==> create (_3923:`Country` {`alt_name`:"Malta", `code`:"MT"})
==> create (_3924:`Country` {`alt_name`:"Germany", `code`:"DE")
==> create (_3925:`Country` {`alt_name`:"France", `code`:"FR"})
==> create (_3926:`Country` {`alt_name`:"Italy", `code`:"IT"})
==> create (_3927:`Country` {`alt_name`:"Spain", `code`:"ES"})
==> create (_3928:`Country` {`alt_name`:"Poland", `code`:"PL")
==> create (_3929:`Country` {`alt_name`:"Belgium", `code`:"BE"})
==> create (_3930:`Country` {`alt_name`:"Sweden", `code`:"SE"})
==> create (_3931:`Country` {`alt_name`:"Austria", `code`:"AT"})
==> create (_3932:`Country` {`alt_name`:"Greece", `code`:"GR"})
==> create (_3933:`Country` {`alt_name`:"Ireland", `code`:"IE"})
==> ;
==> commit
And secondly the text selection disappear as soon as I release mouse button (this one is an issue only in Chrome - when I use Firefox the selection behaves normally).
I know that I can use the system shell to connect to Neo4j shell, and those problems are gone. But I don't always have access to the server's shell and setting up a connection directly to Neo4j shell is a waste of time since I have the console already open in the browser.
First question: is there a way to configure the Webadmin console in such way that it would not display the leading arrows? Second: how to make selection behave properly in Chrome?
I can help you with your second question, at least on a Mac with a mouse. (I don't know if this works on Windows.) If this works for you, then your first question should be moot, since you can just copy and edit the dump result.
Use the left mouse button to select the lines you want.
Keeping the left mouse button depressed, click the right mouse button.
The popup context menu displays, and "Copy" should be an option.
You should be able to release both mouse buttons, without losing the selection or the context menu.
Click on the "Copy" option to copy the selection to the clipboard. (The context menu goes away but the selection now remains!)
Paste from the clipboard to your favorite editor.

Mysql multiple line requests

I'm new to MySQL and I am facing a little problem that I couldn't find an answer to in any previous thread here, so I was hoping someone could help, okay here it is:
When typing a request on mysql (on the terminal) you can just press enter to make it stand on many lines instead of one, but how do you get back to a previous line ?
I tried the arrow buttons and it didn't work, neither did the backspace button, any help is welcome, thank you in advance!
The mysql command uses the readline library. Each input line is edited independently, so once you press Return you can no longer go back and modify that line. The arrow keys will recall the line, but it's inserted into the current line being edited, and appends to the query.
So the solution is to NOT press Return until you've finished typing the whole query.
If you mean to show previously entered lines in order to send them again, according to the MySQL website, it should work via the up/down keys.
[...] the up-arrow and down-arrow keys move up and down through the set of previously entered line
http://dev.mysql.com/doc/refman/5.0/en/mysql-tips.html

Show Vim omnicomplete on certain characters instead of Ctrl-X Ctrl-O?

In Vim 7, Ctrl-X Ctrl-O shows a list of possible values but I find this sequence of keys to be too long when I frequently use the autocomplete feature. For instance, in an HTML file, I'd like to see the list automatically popup after I type a < followed by one or two letters. In a CSS file, I'd like to see the list after I hit the ":" key. Is there a way to set this up?
To activate the omnicompletion on typing a ":" you can use
the following mapping.
imap : :<c-x><c-o>
The disadvantage is that each time you press ":" omnicompletion will
be activated, even when typing ":" in comments or in any other context
in which you do not want omnicompletion.
I have mapped ctrl-space to active omnicompletion:
imap <c-space> <c-x><c-o>
This gives me the choice to activate omni whenever I need it.
Another alternative that I found easier is just to press tab two times when you want autocomplete, and one time for regular tab.
Add the following line to your ~/.vimrc
imap <tab><tab> <c-x><c-o>