In the middle of the desert you can say anything you want
Sehr schönes deutschsprächiges Buch über Java, dem ich nützen könnte, um mein IT-Wortschatz zu verbessern:
Rheinwerk Computing :: Java ist auch eine Insel - Inhaltsverzeichnis
The commit window is (as with conflict resolution) a fully-functioning text editor, including all the usual ideavim bindings! All changes/diffs get automatically updated as they get changed.
“Copy”-ed files get pasted as the filename with all the extensions. “Copy filename” does only the file name, w/o the last extension.
I’ve been bitten by this before at least twice. When copypasting them, for example even from another Intellij running configuration, check for spaces at the end. Not visible at all ever in any of the context one might hope to see them.
Called jshell
on my box. Has tab-completion etc. Really nice!
jshell> NavigableSet original = new TreeSet();
...> original.add("1");
...> original.add("2");
...> original.add("3");
...>
original ==> []
jshell> original.floor("2")
| Warning:
| unchecked call to floor(E) as a member of the raw type java.util.NavigableSet
| original.floor("2")
| ^-----------------^
$8 ==> "2"
Think about compareTo()
and equals()
of the classes if I’m doing something that may need it. Such as using Pair
s as keys in a TreeSet
and expecting that they will be compared only based on first value.
Java: Integer equals vs. == - Stack Overflow
Using !=
/==
… works only for Integers -128..127. Otherwise they will likely be different Objects => not equal.
And of course, -128..127 is exactly the kind of numbers one might see in tests as opposed to real world situations.
The way to do it is if (!one.equals(two)) {
TODO read this: Java gotchas - OWASP
(Link from AA in the context of comparing integers)
I usually use
sleep 5m && foobar
, so if I change my mind and^C
thesleep
, the next command doesn’t run. – Peter Cordes May 28 ‘16 at 14:07 1
And sleep
is installed by default in a lot of places!
sleep 5m && foobar
From the man page:
SUFFIX may be ’s’ for seconds (the default), ’m’ for minutes, ‘h’ for hours or ’d’ for days. Unlike most implementations that require NUMBER be an integer, here NUMBER may be an arbitrary floating point number.
!wa now plus 12.5h
bash - unix diff side-to-side results? - Stack Overflow
diff -y
(NB not git diff
) does really nice side by side viewing, and still colours output in the columns.
Found Think Java in my old notes and it’s really nice.
Ctrl+C - “Steuerung-C” - Strg.
Intersection over Union (IoU) for object detection - PyImageSearch TODO + add to Fiamma
This again, but:
\v
- very magic - everything has special meaning\V
- not magic - everything has literal meaning meaning, \
to activate specialFor my log, it would be interesting to create a keybinding that prepends current time to the beginning of the new created line and stays in insert mode.
Hot keys and keyboard shortcuts – Zoom Help Center
<Alt-A>
- mute/unmute microphone.Confluence saves draft version of the things you write if a page already exists. If the page is not created yet, no draft version is saved.
Project settings are not separate, but part of the general ‘Settings’.
Conditional formatting, especially the one that does gradient, is really nice. Butif you enter numbers with “.” as decimal point, while the sheet has “,” as decimal “point”, it will silently fail and color everything white.
TODO:
Lookarounds look useful: Regex Tutorial - Lookahead and Lookbehind Zero-Length Assertions
If TC triggers Sonar, it will provide a link to it once it finishes in the build log! (Same for CheckStyle - if it breaks because of it, going to the error and scrolling up in the log will lead to the problematic file and line.)
tig
(git)TS showed it to me some days ago, installed it, does really nice and colorful visualizations of branches statuses etc etc etc. Keyboard-driven and configurable and basically everything I might want, including easy to remember name.
This is awesome: Bar Plots in Python using Pandas DataFrames | Shane Lynn
Система моніторингу поширення епідемії коронавірусу
TL;DR use only one screen and they work.
I have a potential fix for this! I have 2 screens (internal laptop monitor, and external monitor). I noticed that the problem only presents when I’m using “dual monitor” mode and have “gallery view” enabled. The controls also don’t appear if I have “full screen” enabled. They also won’t appear if I have either window on the external monitor.
It works in “dual monitor” mode if I have the controls window set to “speaker view” and not in “full screen” with both windows on the internal (laptop) monitor. I can then move either window to the external monitor. If I’ve accidentally started Annotation mode “wrong”, I have to cancel it and move all windows to the internal monitor before re-starting Annontation mode.
I have my controls back! This is with version 5.2.458699.0906 1
I have version 5.3.47…. (no way to copypaste) and they don’t, but using only one monitor helped. Though I get a black screen underneath annotations when/as I’m writing them.
pwd | xc
alias pwx='pwd | xc'
I really need to gather them all in one place and make ~/.zshrc cleaner and neater.
```
cc() python3 -c "from math import *; from statistics import *; print($*);"
alias cc='noglob cc'
```
Added `statistics` to it, now I can do things like `cc mean([2, 4, 9])`. (As a bonus `stdev()` etc., [full list](https://docs.python.org/3/library/statistics.html)). Works for now. `"`, if any, have to be escaped.
## zsh prompt
Yet another change (theme file `clean2.zsh-theme`):
`PROMPT='%{$fg[green]%}(%*/%!) %{$fg[$NCOLOR]%}%B%b%{$reset_color%}%{$fg[blue]%}%B%5c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '`
It transforms to:
`(10:23:09/10712) some/folder/whatever/ $ mycommand`
Removed the user (that I had to edit out often), moved current time from `PROMPT` to the left side (now I can happily copypaste CLI args and output again).
## regex greedy / lazy
[Regex Quantifier Tutorial: Greedy, Lazy, Possessive](https://www.rexegg.com/regex-quantifiers.html) TODO
TL;DR most regex engines are greedy by default. Greedy = 'longest possible match'. Making it lazy sometimes means adding a "?" to the quantifier, such as `.*?`. Not supported everywhere, notably grep does this only with the perl syntax (`grep -P .*?`).
For vim: [regular expression - How to make regex matchers non-greedy? - Vi and Vim Stack Exchange](https://vi.stackexchange.com/questions/196/how-to-make-regex-matchers-non-greedy/13363#13363)
## `info` command instead of `man`
Nice, had no idea this existed. `info diff`, for example.
Found here: [linux - Understanding of diff output - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/81998/understanding-of-diff-output).
## Unified diff how to read
`@@ -1,4 +1,5 @@`:
> - The number after the comma is the length of the chunk (in the old or new file), and
> - the number before the comma is the line number for the beginning of the chunk.
> - The + and - signs refer to adding and deleting lines, respectively. [^sounce]
[^sounce]: [What do the numbers in the @@ line mean in output of diff? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/252927/what-do-the-numbers-in-the-line-mean-in-output-of-diff?noredirect=1&lq=1)
Gnu diff man page has more: [Detailed Unified (Comparing and Merging Files)](http://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html)
## Git / Jira / Bitbucket branches and connections to tickets
As long as the branch name contains the issue key (ABCD-123), it gets connected - but only if the branch is created _after_ the creation of the ticket. [^jibbranchsource]
> As stated previously in this question, it is not possible. You are screwed if you create the branch first.
But also it seems that mentioning an issue name in the pull request (does this work for commits?) also works:
> Simply renaming the Pull Request in Github to include the issue id XXX-nnn in the name triggered that PR and Branch to be linked to the Jira ticket. [^jibbranchsource]
[^jibbranchsource]: [Solved: How to link existing JIRA issue to a existing bran...](https://community.atlassian.com/t5/Jira-questions/How-to-link-existing-JIRA-issue-to-a-existing-branch-in/qaq-p/701496)
## Random / i3 / workspaces
I could define a workspace officially, like number 5, for terminals I don't really need but that are open in deep folders I might need later.
## Random / documentation / dtb
Sometimes I miss the ability to drag and drop screenshots to my textfile with descriptions of stuff I did. I can drag and drop screenshots but they are a bit ephemeral. An interesting idea would be create a different keybinding that creates screenshots that get put in a particular folder; I can still drag-and-drop them, but I'll have stricter guarantees that they'll be there when I'll look for them.
## vim plugin MultipleSearch
[MultipleSearch - Highlight multiple searches at the same time, each with a different color. : vim online](https://www.vim.org/scripts/script.php?script_id=479)
```
:Search sth
:Search somethingelse
:SearchReset
```
Highlights them in diff colors, just what I need. `n/N` works only on the last one.
[vim-scripts/MultipleSearch2.vim: Improve Multiple search](https://github.com/vim-scripts/MultipleSearch2.vim) looks like an improved version of the above.
## vim search and substitute
You can use `\1` etc for `%s/..` commands, if the groups where previously defined by you in a usual `/search-for-stuff`!
```
/\v(https?):\/\/(.{-})\/.* <-- Search
:%s,,Protocol:\1 - Domain:\2,g <-- Substitution
```
This is awesome.
Tickets are linked automatically when mentioned like WHAT-1234
, but only with spaces around them; WHAT-1234: result
, for example, wouldn’t work.
alias sumup='paste -sd+ | bc'
This is nice! sort -V
sorts by “version numbers” => 1, 10, 20, 50, 200, instead of the alphabetic 1 10 20 200 50.
I need something like “output to CLI and copy to clipboard” + I need a smaller timestamp and to the left, not right-aligned, so I can more easily copypaste stuff.