User:Euoa/sandbox

CMake C++ C++ IDEs Maven Python WinAPI Android Testing CMD Windows Excel Word Math QtCreator Network Unix shell web server Apps GDB Autosys Git Jira

CMake		cmake was unable to find a build program corresponding to mingw makefiles https://stackoverflow.com/questions/45150172/cmake-error-cmake-was-unable-to-find-a-build-program-corresponding-to-mingw-ma

CMake		cmake configure to vs project https://stackoverflow.com/questions/395169/using-cmake-to-generate-visual-studio-c-project-files

CMake		Looking for a 'cmake clean' command to clear up CMake output https://stackoverflow.com/questions/9680420/looking-for-a-cmake-clean-command-to-clear-up-cmake-output

C++			c++ compare float values https://www.quora.com/How-do-I-compare-two-floats-in-C++

C++			Warning: function uses 'auto' type specifier without trailing return type https://stackoverflow.com/questions/44798728/warning-function-uses-auto-type-specifier-without-trailing-return-type

C++			Is there a good Python library that can parse C++? https://stackoverflow.com/questions/1444961/is-there-a-good-python-library-that-can-parse-c

C++			c++ when should I use cend https://stackoverflow.com/questions/12001410/what-is-the-reason-behind-cbegin-cend

C++			GCC can generate strange errors. This errors can be avoided by moving problematic header above. If error looks strange, maybe this is compiler bug, not my code problem. 210429: tried to compile Cobra with GMD API, GCC version 4.4.7.

C++			should I always specify exact library name to assemble binary, or specification of folder with libraries is possible? ?

C++			crash inside _int_free Any crash inside malloc or free is a sure sign of previous heap corruption. https://stackoverflow.com/questions/18267766/c-application-crash C++			C++ Standards Support in GCC https://gcc.gnu.org/projects/cxx-status.html

C++			- local classes could not be used as template arguments (until C++11) - 211001 | gmd_api | tried to remove_if with my custom functor as 3rd argument https://stackoverflow.com/questions/8203750/local-classes-c03-vs-c11

C++			it's impossible to have same type for non-templated part of templated class https://stackoverflow.com/questions/55579387/storing-non-template-parts-of-templated-class-in-cpp

---references--- C++			it's impossible to have address of "reference variable", because reference is designed to be alias https://stackoverflow.com/questions/1950779/is-there-any-way-to-find-the-address-of-a-reference#:~:text=There%20is%20no%20way%20to,print%20out%20the%20same%20address.

C++			- temporary cannot be bound to non-const reference - because result of modification will be lost anyway https://stackoverflow.com/questions/18565167/non-const-lvalue-references ---references---

---constexpr--- C++			non-static data members can't be constexpr because they are initialized at runtime https://stackoverflow.com/questions/27408819/why-cant-non-static-data-members-be-constexpr?noredirect=1&lq=1

C++			- should I use const or constexpr for constants? - depends on intent, should constant be initialized at runtime? - https://stackoverflow.com/questions/13346879/const-vs-constexpr-on-variables C++			- when should I use constexpr - when I want to demonstrate intent that this piece of code can be calculated at compilation time - https://stackoverflow.com/questions/4748083/when-should-you-use-constexpr-capability-in-c11 ---constexpr---

C++ IDEs	VS Code and Visual Studio C++ compiler https://stackoverflow.com/questions/56497648/compiling-c-c-in-vs-code/56499225

C++ IDEs	VS Code: limiting line at the right of the code in settings modify editor.rulers C++ IDEs	VS Code: multiline tabs https://stackoverflow.com/questions/42462777/multirow-tabs-for-vscode C++ IDEs	Boost.Test error: could not locate debug symbols for https://developercommunity.visualstudio.com/t/tests-could-not-locate-debug-symbols/178469 https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2017

C++ IDEs	standard support by VS version https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-160

Maven		my code is not included into resulting .jar https://stackoverflow.com/questions/31008058/maven-2-2-1-wanrning-jar-will-be-empty-no-content-was-marked-for-inclusion

Maven		when executing .jar nothing happens, error "no main manifest attribute, in .jar" https://stackoverflow.com/questions/9689793/cant-execute-jar-file-no-main-manifest-attribute

Maven		show stack traces of failed tests https://natritmeyer.com/howto/how-to-make-maven-display-stack-traces-of-failed-tests/

Maven		don't assemble .jar when verify lifecycle step is run https://stackoverflow.com/questions/3632190/maven-assembly-plugin-causing-tests-to-run-twice

Python		__del__ is not called https://stackoverflow.com/questions/6104535/i-dont-understand-this-python-del-behaviour

Python		relative import problems https://stackoverflow.com/questions/16981921/relative-imports-in-python-3

Python		create virtual environment when project already created File -> Settings -> Project: -> Python Interpreter -> Show All -> Add

Python		PyCharm warning when passing function as argument https://youtrack.jetbrains.com/issue/PY-43841

WinAPI		Handling Ctrl+C in Windows Console Application http://asawicki.info/news_1465_handling_ctrlc_in_windows_console_application.html

WinAPI		Handle messages in console application https://stackoverflow.com/questions/36043832/send-windows-message-to-a-console-application https://stackoverflow.com/questions/4081334/using-createwindowex-to-make-a-message-only-window

Android		WebView doesn't load web pages, showing ERR_CACHE_MISS error https://stackoverflow.com/questions/32708440/loadurl-in-android-webview-fails-with-neterr-cache-miss - this line should be added in AndroidManifest.xml outside application tag 

Testing		white box testing vs black box testing https://stackoverflow.com/questions/402161/black-box-vs-white-box-testing

CMD			Is there a command to refresh environment variables from the command prompt in Windows? https://stackoverflow.com/questions/171588/is-there-a-command-to-refresh-environment-variables-from-the-command-prompt-in-w

Windows		Conclusively stop wake timers from waking Windows 10 desktop https://superuser.com/questions/973009/conclusively-stop-wake-timers-from-waking-windows-10-desktop

Windows 	why there is no hibernate in windows 10 https://winaero.com/blog/add-hibernate-to-the-start-menu-in-windows-10/

Windows    add application to autostart windows 10 win10_autorun.png

Excel		excel make header row sticky View -> Window -> Freeze Panes -> Freeze Top Row

Excel		clipboard pane excel Home -> Clipboard ->

Word		turn off auto capitalization word online Review -> Editor -> AutoCorrect Options... -> Capitalize first letter of sentences

Math		Find Equation of Line From 2 Points https://www.mathwarehouse.com/algebra/linear_equation/write-equation/equation-of-line-given-two-points.php

Math		Dot Product - Distance between Point and a Line https://brilliant.org/wiki/dot-product-distance-between-point-and-a-line/

Math		How to check if perpendicular intersects segment? https://stackoverflow.com/questions/49118760/how-to-check-if-perpendicular-intersects-segment-c-sharp

Math		How to calculate an angle from three points? https://stackoverflow.com/questions/1211212/how-to-calculate-an-angle-from-three-points

QtCreator	qtcreator failed to activate protocol version generator is unset but required (cmake can't starts end exits immediately) https://github.com/vector-of-bool/vscode-cmake-tools/issues/508 (permission issue, run QtCreator as administrator)

Network		unix how to check that remote port is open https://superuser.com/questions/621870/test-if-a-port-on-a-remote-system-is-reachable-without-telnet https://stackoverflow.com/questions/273159/how-do-i-determine-if-a-port-is-open-on-a-windows-server

Network		how to exit telnet session telnet_exit.jpg

Network		unix get ip https://superuser.com/questions/347408/how-to-get-the-ip-address-of-a-unix-machine

Network		scp how to avoid entering password every time alvinalexander.com/linux-unix/how-use-scp-without-password-backups-copy

Unix shell	unix find in files https://stackoverflow.com/questions/16956810/how-do-i-find-all-files-containing-specific-text-on-linux

Unix shell	how to subside permission denied in find https://unix.stackexchange.com/questions/42841/how-to-skip-permission-denied-errors-when-running-find-in-linux

Unix shell	how to exit from vi vi_exit.jpg

Unix shell	how to save a file in vi editor vi_save.jpg

Unix shell	what is ^m in unix unix_^M.jpg

Unix shell	shell script several levels of single quotes https://unix.stackexchange.com/questions/23347/wrapping-a-command-that-includes-single-and-double-quotes-for-another-command

Unix shell	unix terminal find last command in history containing phrase https://unix.stackexchange.com/questions/231605/search-for-a-previous-command-with-the-prefix-i-just-typed

Unix shell Keyboard shortcuts for terminal https://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/

Unix shell vi reference sheet http://www.atmos.albany.edu/daes/atmclasses/atm350/vi_cheat_sheet.pdf

Unix shell	description of rsync mask why file was transferred https://stackoverflow.com/questions/4493525/what-does-f-mean-in-rsync-logs

Unix shell	regular expressions in grep https://www.cyberciti.biz/faq/grep-regular-expressions/

web server	running scripts on server - add ExecCGI to Directory /var/www/ -> Options - add AddHandler cgi-script .pl to Directory /var/www/ - add symbolic link for cgi.load from /etc/apache2/mods-available/ to /etc/apache2/mods-enabled/ - restart apache2

Apps		mru behavior in chrome https://stackoverflow.com/questions/11093448/is-there-a-real-working-solution-to-add-mru-tab-selection-via-ctrltab-to-google

Apps		Visual Studio Code message "no source control providers registered" Source Control tab https://stackoverflow.com/questions/46609255/git-missing-in-vs-code-no-source-control-providers

Apps		Microphone should be inserted before Horizon Client start, otherwise it will not work inside VM

GDB        how to run program with arguments in GDB form command line https://stackoverflow.com/questions/6121094/how-do-i-run-a-program-with-commandline-arguments-using-gdb-within-a-bash-script

GDB        gdb condition with std string https://stackoverflow.com/questions/10801112/gdb-conditional-breakpoint-on-arbitrary-types

GDB			pretty print Boost containers https://cwiki.apache.org/confluence/display/IMPALA/Boost+Pretty+Printers+for+GDB

Autosys    Autosys how to rename a job autosys_rename_job.PNG

Git			Folder has two files with names different only with case. Checking out on Windows creates problem. https://docs.microsoft.com/en-us/azure/devops/repos/git/case-sensitivity?view=azure-devops

Git			"LF will be replaced by CRLF" warning https://stackoverflow.com/questions/5834014/lf-will-be-replaced-by-crlf-in-git-what-is-that-and-is-it-important

Git			is it possible to include symlinks inside git repository Git can track symlinks as well as any other text files. After all, as the documentation says, a symbolic link is nothing but a file with special mode containing the path to the referenced file.

Jira		how to link jira issue to arbitrary branch https://community.atlassian.com/t5/Jira-questions/How-to-link-existing-JIRA-issue-to-a-existing-branch-in/qaq-p/701496

Shell, Command line programs, PowerShell, Windows CMD, Git, Linux, kdb+, vi, Oracle DB, Adaptive Server Enterprise / SQL Server, SQLite, Excel, GDB, AWK, C++, Boost, Linux C++ functions, GNU C Library, Perforce Jam, Java, Android, Python, Autosys, Maven, Markdown, Regular expressions, Emoji

Shell ---

---selecting files--- shopt -s extglob rm -- !(Makefile) ---selecting files---
 * 1) remove all except one file

python3 -u follow_market/follow_market.py --btc=0.25 --ratio=4 --sell-rise-percent=5 --sell-fall-percent=50 --sell-all-fall-percent=50 --sell-all-rise-percent=1 --weather-period-h=24 > follow_market_`date +%y%m%d_%H%M`.log 2>&1 &
 * 1) redirection of errors to output file (2>&1 should be after > )

---scripting--- dirname "$0"
 * 1) path of currently running script

set -x
 * 1) debug mode of script execution

seconds=`expr 15 \* 60`
 * 1) arithmetic operations

arr=("lnq-cobra04a" "uk1pthor04")
 * 1) declaring array

arr="str1 str2"
 * 1) declaring string array

echo ${arr[0]}
 * 1) accessing array elements

if $0 != *Global* ; then
 * 1) check if string contains / doesn't contain substring

if [ "$#" -eq 4 ]; then
 * 1) number of arguments

if [ "$#" -eq 4 ]; then
 * 1) check numerical equality

echo $?
 * 1) Getting exit code of last command

if $num && $num != 0 ; then		# should have double brachets
 * 1) condition1 and condition2

.sh ---scripting---
 * 1) run script from another script

---for cycle--- for to in qa/nam/scripts/Global/ qa/nam/scripts/NAM.QA.01/ qa/nam/scripts/NAM.QA.02/ qa/nam/scripts/NAM.QA.03/ qa/nam/scripts/NAM.QA.BONDS/ qa/nam/scripts/NAM.QA.PROXY/; do cp helperScripts/restartCobraEngine.sh $to; done
 * 1) for cycle

IFS=$'\n' for name in $file_list
 * 1) iterating through lines (not through words AND lines)

for (( i=0; i<=$end_value; i++ )) ---for cycle---
 * 1) for cycle with variable

ssh_func {	ssh_func_rv=`ssh -n $SERVER "bash -c \"$1\""` } ... ssh_func "ls -1t ${INSTANCE_LOGS_DIR}/cobra.*.0.log 2> /dev/null | head -1"
 * 1) pass argument into the function

ssh_func_rv="" ssh_func {	ssh_func_rv=`ssh -n $SERVER "bash -c \"$1\""` } ... ssh_func "ls -1t ${INSTANCE_LOGS_DIR}/cobra.*.0.log 2> /dev/null | head -1" COBRA_LOG_FILE=$ssh_func_rv
 * 1) returning string from function (by using global variable)

lastCobraLog {   echo `ls -lt cobra.*.log | cut -d ' ' -f9 | head -n 1` } grep "NOKIA" `lastCobraLog`
 * 1) returning and using string value from function (by using echo)

ssh $1 "bash -s" < ./checkout_for_server.sh $ENVIRONMENT \"$2\" | tee $3
 * 1) executing local script on another machine
 * 2) https://unix.stackexchange.com/questions/87405/how-can-i-execute-local-script-on-remote-machine-and-include-arguments

---find--- find / -name pbrun 2> /dev/null
 * 1) supress access denied errors

find. -name MarketTimeCheck.sh -exec stat {} \;
 * 1) execute command on several files

find -type l
 * 1) find symbolic links

find $backup -mtime +3 -exec rm {} \; ---find---
 * 1) finding files older than x days

---cmake--- cmake .. -G "MinGW Makefiles" cmake .. -G "Visual Studio 15 2017" cmake -DCMAKE_BUILD_TYPE=Debug .. -G "MinGW Makefiles" cmake -D DEVELOPER_TESTS_ENABLED=1 .. -G "MinGW Makefiles" cmake --trace -D DEVELOPER_TESTS_ENABLED=1 .. -G "MinGW Makefiles" 2> trace.log ---cmake---
 * 1) configure project with cmake for mingw
 * 1) configure project with cmake for editing in Visual Studio
 * 1) configure for debug build
 * 1) configure project with setting variable
 * 1) create trace while running

mingw32-make
 * 1) build with mingw

// gccxml gccxml --gccxml-cxxflags "-std=c++03 -Ic:\soft\gccxml\GCC_XML\Support\GCC\4.9 -Ic:\projects\proj1433_feex_test\algoskel -Ic:\projects\proj1433_feex_test\algoskel\autosar -Ic:\projects\proj1433_feex_test\algoskel\supt" c:\projects\proj1433_feex_test\algoskel\feex\IfFeex.cpp -fxml=IfFeex.xml

// Bitbucket SSH ssh-keygen												// creating private and public keys ssh-keygen --key-format openssh2						// for .ssh2 version cat .ssh/id_rsa.pub										// copy it to Bitbucket git clone --recursive ssh://git@cedt-icg-bitbucketcli.nam.nsroot.net:7999/thorcobra/dosa.git

// Using SSH2 keys ssh-broker-ctl start ssh-broker-ctl add-key ~/.ssh2/id_rsa_2048_a

---network--- ping -c 1 cedt-icg-bitbucketcli.nam.nsroot.net
 * 1) pinging server once

telnet lnyeqdsfap1u.nam.nsroot.net 2068
 * 1) "Pinging" specific port

ip -f inet addr
 * 1) Finding IP(s) of machine

nslookup 169.181.19.78
 * 1) finding hostname from IP

netstat -p
 * 1) all connections
 * 2) what process is sitting on the port (requires root)

lsof -i -P -n ---network---
 * 1) Ports use information

---packages--- yum list python-dateutil
 * 1) List available packages in 'yum'

yum list installed			# RHEL rpm -qa | grep -i odbc		# RHEL apt list --installed		# Ubuntu
 * 1) List all installed packages

yumdownloader gcc-4.4.7-23.el6
 * 1) Downloading RPM package (RHEL, SuSE)

yum --assumeyes install gcc-c++-4.4.7-23.el6.x86_64.rpm
 * 1) Install package from uDeploy

rpm -ivh --nodeps 
 * 1) Install RPMs without dependencies stuff

rpm -e --nodeps dosa_shared-2.17.0.GmdThr-1
 * 1) Remove package

yum whatprovides */libdna.so rpm -q --whatprovides /usr/include/python2.6/Python.h
 * 1) Find package from which this binary from

rpm -ql dna-A6-1.x86_64
 * 1) List files from specific package

rpm -qlp .rpm
 * 1) list files from specific .rpm

pydoc modules ---packages---
 * 1) List Python installed modules

pbrun -u atd dap sudo su atd				// where there is no 'atd'
 * 1) Becoming 'atd' user

id ps67755
 * 1) User info

OUTPUT_DIR=/home/`whoami`/ProdCheckOutScript
 * 1) Get user name

ls /etc/*-release
 * 1) Get Linux distribution

clear
 * 1) Clear the terminal

---view files--- ll
 * 1) List files including symbolic links

ls -a
 * 1) List files starting with.

ls -l
 * 1) Detailed output with symbolic links showing destination

ls -lt
 * 1) Sort files by most recent and show full view

ls -lS ---view files---
 * 1) sort by size of files

// Monitoring file tail -f logs/current/cobra.*

---archives--- tar -tvf /home/ps67755/ems8.41.tar.gz
 * 1) List the contents of tar archive

tar -chzf ~/indexDNA indexDNA/scripts indexDNA/config indexDNA/files/20191119 indexDNA/logs/20191119
 * 1) Create tar archive

tar xvzf dosa_pricing*.tar.gz
 * 1) Extract .tar.gz compressed archive

zip -r dosa_thor_config.zip dosa_thor_config
 * 1) Zip files

unzip 
 * 1) Unzip archive

bzip2 -d .tar.bz2 ---archives---
 * 1) unpack .bz2 file

// Remove directory with all files rm -r .ssh // Remove folder with all files and never ask confirmation rm -r -f dosa

// Find executable in path variable whereis g++

// Look at non-text symbols vi -b .rpmmacros

// Giving permission to read your folder to another user setfacl -m u:ar52271:rx /home/ps67755 // Sharing folder with everyone chmod -R 777 dosa_shared/* // Making script executable chmod +x  // Change owner (Uid) of the file(s) chown -R atd /home/atd/production/indexDNA // Change group (Gid) of the file(s) chgrp -R domain_users /home/atd/production/indexDNA

// Copy file to another machine scp cobra_svr.tar lnd-thor02a.uk.atdesk.com:/home/ps67755/cobra_svr.tar // recursive scp -r nj1qeqthor07.dev.sti:/home/ps67755/rpm /home/ps67755

date +%y%m%d_%H%M target_epoch=`date -d "$current_date 23:10" +%s`
 * 1) Timestamp
 * 1) timedelta until specific timestamp

// Get current folder name basename `pwd`

// Creating symbolic link ln -s /usr/local/dna_A17 /usr/local/dna // Removing symbolic link unlink libencoder_fix.so

// Diff vimdiff /home/atd/cron.20190711.txt /home/atd/dosa/cobra_config/2.11.0/qa/emea/cronEntries/lnq-cobra04a/cron.txt

// Get the Centrify Zone of the server adinfo | grep "Zone:"

// Find process ps -ef | grep udeploy ps aux | grep atd		// difference ?

diff -y /path1/file1 /path2diff /file2 diff /home/atd/qa/cobra/Cobra.QA.01/config/config qa/emea/config/Cobra.QA.01/config
 * 1) Find differences side-by-side
 * 1) Compare two folders

---rsync--- rsync -r --del --links  
 * 1) sync two folders
 * 2) it's permissible if src-folder is on another host

rsync -avu --delete --checksum qa/emea/config/Cobra.QA.01/ ~atd/qa/cobra/Cobra.QA.01/config
 * 1) sync the contents of two folders, skip based on checksum, not modification time / size

rsync --itemize-changes ---rsync---
 * 1) show why file should be copied
 * 2) http://www.staroceans.org/e-book/understanding-the-output-of-rsync-itemize-changes.html

crontab -l crontab -e
 * 1) List cron jobs
 * 1) Edit cron jobs

ldd /usr/local/lib/libtdsodbc.so
 * 1) Find dependencies of *.so

---scheduling--- echo "echo hello > /home/ps67755/at_out.txt" | at 15:30
 * 1) Schedule a task at specific time

atq ---scheduling---
 * 1) List current scheduled jobs

---grep--- grep -rnw. -e 'lnyeqdsfap1u.nam.nsroot.net'
 * 1) Finding string in several files

| grep " \| "
 * 1) match regular expression
 * 2) grep will use regular expressions syntax by default, so no additional switches are needed

grep -E "Loaded [0-9]+ baskets to universe" cobra.20210923_060003.0.log
 * 1) extended regular expressions syntax

 | grep -P "MDSubscriber\tThrottlePeriodMs\t1"
 * 1) grep something with tab (or other special symbol)

grep -q
 * 1) result is 0 if something found, else is 1

grep -r --files-with-matches *
 * 1) only print files that have match

grep -A 10 "prices=0, stats=6" `lastproto` | less ---grep---
 * 1) print also context after matched line

---gz archives--- zgrep -isl "WMCO FX Received for BRFS3" cobra*
 * 1) Finding .gz files containing specific string

zgrep -l "WMCO FX Received for ABEV3" cobra*
 * 1) Only print files contatining matches

zless logs/20200720/eqrmsMapping.out.gz ---gz archives---
 * 1) less for .gz files

// Get drive free space df -h // Find folder size du -s -B M ~ // Compare folder sizes du -h --max-depth=1. 2> /dev/null

// Connecting to DB (with unixODBC) isql -v eqrmsusprod progjob Pr0gram

---killing process--- kill 25131
 * 1) Kill process by PID

kill -s SIGINT 31865
 * 1) send ctrl-c to the process

pkill --full --signal SIGINT Cobra.QA.06
 * 1) kill by command line pattern

timeout 2 ssh uk1ucobra01.prod.lava ---killing process---
 * 1) send TERM signal if not finished in  seconds

// Make raw connection and exchange data nc -vv -l 0.0.0.0 12001 nc nj1qeqthor04 12001

// See process' loaded modules cat /proc/20570/maps | less

// Check md5 sum of the file md5sum ~/rpm/dosa/usr/local/dosa/shared/current/lib/libCommon.so

// Running Python script in debug mode python -m pdb /home/atd/production/support/scripts/checkAllComposition.py

// Get last exit code echo $?

printf "%-80sSUCCESSFUL\\n" "$output" | tee -a $OUTPUT_DIR/passedTests.txt $OUTPUT_DIR/allTests.txt
 * 1) Formatted output

// Concatenate lines in file into one line tr '\n' ' ' < ~atd/production/cobra/EU.PROD.01/scripts/python/EQRMSIDQuery.sql

// Display all non printable characters cat -A ~atd/production/indexDNA/config/eqrmsUniverse.txt | less

---checking executable files--- readelf -d /home/atd/qa/cobra/Cobra.QA.01/bin/cobraEngine
 * 1) look into binary to get some information, for example RPATH

nm -D /usr/local/dosa/shared/current/lib/libTransport.so | less ---checking executable files---
 * 1) what symbols does .so export?

---debugging--- // Hooking all string constants strace sqlplus cgmipops_th/Qcgm1db@qthordb | grep tnsnames.ora

gstack 11586 >/tmp/11586.gstack.log pstack 7391 > /tmp/EU.PROD.PROXY.01.txt		# found in Vadim's message on 210330 ---debugging---
 * 1) print stack trace of the process

screen -S follow_market
 * 1) starting terminal session that we can detach from
 * 2) https://stackoverflow.com/questions/10409897/ioerror-input-output-error-when-printing
 * 3) https://linuxize.com/post/how-to-use-linux-screen/

screen -r 32043
 * 1) attaching to session

ssh -o ServerAliveInterval=60 178.154.246.82
 * 1) make prolonged ssh session

curl -o logstash-7.2.0.tar.gz https://artifactrepository.citigroup.net/artifactory/generic-icg-prod-local/msst-devops-171981/elastic-stack/7.2.0/logstash-7.2.0.tar.gz
 * 1) download file from internet

rpm -qa | mail -s `hostname` pavel.shalin@citi.com
 * 1) send some information to someone by means of mail

date +%Z sudo timedatectl set-timezone Europe/Moscow
 * 1) checking and setting timezone

Command line programs ---

"/c/Program Files/Java/jdk1.8.0_261/bin/jar" tvf citi-mktdata-mock-1.0.jar
 * 1) look what inside .jar file (requires JDK)

java -jar cobra_tests.jar
 * 1) executing .jar file

g++ test.cpp -o test
 * 1) building simple program

g++ -S test.cpp 2> g++.log
 * 1) only compile .cpp file

/etc/rc.d/init.d/cybagent-WA1_AGENT start
 * 1) starting Autosys agent

cd gmp-6.2.1/; ./configure --prefix=/home/ps67755/gcc-out; make; make install cd mpfr-4.1.0/; ./configure --with-gmp=/home/ps67755/gcc-out --prefix=/home/ps67755/gcc-out; make; make install cd mpc-1.2.0/; ./configure --with-gmp=/home/ps67755/gcc-out --with-mpfr=/home/ps67755/gcc-out --prefix=/home/ps67755/gcc-out; make; make install cd gcc-4.9.2/; ./configure --prefix=/home/ps67755/gcc-out --with-gmp=/home/ps67755/gcc-out --with-mpfr=/home/ps67755/gcc-out --with-mpc=/home/ps67755/gcc-out --enable-languages=c,c++,go --disable-multilib; screen; export LD_LIBRARY_PATH=/home/ps67755/gcc-out/lib; make; make install
 * 1) building GCC

./bootstrap.sh --prefix=/home/ps67755/boost156-out ./b2 --layout=tagged		# to add -mt suffix to .so names ./b2 --layout=tagged install
 * 1) building Boost

?
 * 1) less searching backwards

ffmpeg -i .flv -vn .mp3
 * 1) using FFmpeg to extract audio from video

PowerShell ---

/ setting environment variables in an restrictive corporate environment [System.Environment]::SetEnvironmentVariable('GOPA', 'gopa test', [System.EnvironmentVariableTarget]::USER)

Windows CMD ---


 * input parameters of script

%1 %2 ...


 * list all input parameters

cl.exe %*


 * last boot time and other system information

systeminfo

Git ---

git clone ssh://git@cedt-icg-bitbucketcli.nam.nsroot.net:7999/thorcobra/dosa_shared.git git checkout -b C162799-2710-allow-blank-fii       // create new local branch git checkout -b CobraMaster origin/CobraMaster		// ? git pull origin	CobraMaster							// if branch is already created; pull new commits from CobraMaster
 * 1) Switch to branch

git checkout -f C163659-2279-qa-automation
 * 1) forced switch (helps in case of different case file names problem on Windows)

git branch			// local git branch -a		// + remote
 * 1) Show all branches

git branch -m C163659-1627-restartInstance-EMEA
 * 1) Rename branch

git log
 * 1) Commits history

---discarding changes--- git reset --hard
 * 1) Reset modified files

git clean -fd git clean -fx
 * 1) clean untracked files

git reset --hard origin/CobraMaster
 * 1) discarding local commits in favor of remote branch

git checkout -- src/IndexArbPairs/IndexArbPairsOrder.cpp
 * 1) Discarding changes in file

git checkout HEAD~ --
 * 1) revert one particular file to specific commit

git branch -d CobraMaster git branch -D C162799-2710-allow-blank-fii // even if unmerged
 * 1) Removing crippled branch

git push origin --delete C163659-2938-cobra-upgrade-reuters-rfa-library-from-7-to-8.2
 * 1) delete remote branch (that was created by mistake)

git revert HEAD
 * 1) revert last commit

git revert --no-commit C git revert --no-commit B git commit -m "the commit message" ---discarding changes---
 * 1) reverting multiple commits

git commit -a -m "C163659-1627: adding timeout parameters; suppressing error output from kill scripts; added example usage"
 * 1) adding modified files to the commit

---amending commits--- git commit --amend
 * 1) amend last commit

git rebase -i @~ ---amending commits---
 * 1) modifying not last commit

git pull git push
 * 1) Pulling/Pushing commits

---pushing--- git push --dry-run
 * 1) Checking if you have write permission to the repo

git push --set-upstream origin C162799-2710-allow-blank-fii
 * 1) linking upstream branch with local one

git push origin HEAD ---pushing---
 * 1) pushing current branch without specifying its name

git fetch
 * 1) Update information about remote repo

---differences in code--- git diff
 * 1) View differences to commit

git diff HEAD~1 HEAD ---differences in code---
 * 1) differences of last commit

git format-patch -1 HEAD
 * 1) Create patch

git am < 0001-C162799-2710-Fill-tag-48-with-SMCP-if-FII-is-blank-e.patch
 * 1) Apply patch

git add -A
 * 1) add all untracked files

git mv -f version.txt version~.txt
 * 1) rename file saving its history

---config--- git config --list
 * 1) list config values

git config --global -e
 * 1) edit global config file

git config --get core.autocrlf ---config---
 * 1) get some option's value

---merging--- git merge -s recursive -X ours Rel_202003_EMEA
 * 1) merge and use our branch in case of conflicts

git checkout --theirs -- helperScripts/instanceConfig.txt ---merging---
 * 1) checkout incoming version of conflict file

---stash--- git stash
 * 1) stash changes for later use

git stash list ---stash---
 * 1) show all stashed changes

---tags--- git tag
 * 1) list tags in repo

git push --delete origin ---tags--- Linux ---
 * 1) delete some tag

sudo unlink /etc/localtime sudo ln -s /usr/share/zoneinfo/Europe/Moscow /etc/localtime
 * 1) changing timezone
 * 2) https://unix.stackexchange.com/questions/110522/timezone-setting-in-linux

sudo apt-get update
 * 1) after this command I was able to install apache2
 * 2) https://askubuntu.com/questions/364404/e-unable-to-fetch-some-archives-maybe-run-apt-get-update-or-try-with-fix-mis

sudo systemctl restart apache2.service
 * 1) restarting service

/tmp/ folder with temporary files where anyone can create new file /etc/ program and system settings /etc/apt/sources.list addresses from where apt will pull packages /etc/hosts File that contains keys/values on how to resolve host names into IP addresses. No service needs to be restarted. Updated info is pulled from it immediately /etc/systemd/journald.conf SystemMaxUse	limiting space occupied by /var/log/journal (systemd-journald) https://unix.stackexchange.com/questions/130786/can-i-remove-files-in-var-log-journal-and-var-cache-abrt-di-usr /opt/ for packages not part of the Operating System distribution, but provided by an independent source https://unix.stackexchange.com/questions/11544/what-is-the-difference-between-opt-and-usr-local

kdb+ ---

/ get PID of the q process .z.i

/ String with characters that should be escaped cobra_instance: update host_name: `$"lnq-cobra01a" from cobra_instance where instance_id = `Cobra.QA.06

/ unequal operator select const_id, last_price, fx_rate from basket_price where date = 2021.01.28, id = `.STOXX, const_id <> `

---select--- / Simple select from table 1000# select from basket_price where id=`KWEB.P

/ Select with 2 columns in filter select from basket_price where id=`KWEB.P, time=2019.11.29T21:30:02

/ selecting with key prefix select from basket_price where id like "ACWI*"

/ selecting with time starting from some timestamp 100# select from percent_shift where date = 2020.03.10, time > 08:39:00, proxy_key like "SFCH0*"

/ selecting 10 last results -10# select from basket_price where date = 2020.03.10, id = `.FTXIN9, const_id = `, time <= 08:41:00

/ selecting by time 10# select from basket_price where time = 2020.03.10T02:10:00, id = `.FTXIN9, const_id = `

/ previous day select from basket_price where date = .z.d - 1, id = `2800.HK

/ condition A or B select from market_times where (Market = `XSHE) or (Market = `XSHG)

/ another better (doesn't repeat rows if there are less in table than specified amount as 10# does) / way to limit number of result rows (James Ruthledge example) select [10] from Level1 where sym in `HK.MI`EMAE.MI

/ selecting table with prepared data (simulating query) ([] Ric: `CRH.I`ISF.L; primaryRic: `CRH.I`ISF.L; Market: `XDUB`XLON; Region: `EMEA`EMEA; Type: `EnSec`EnSec)

/ selecting all distinct values in a column select distinct id from basket_price ---select--- / substituting specific value to the selected data select Ric,basket_type,disableImbalance,PositionDate:2021.01.01,instrument_type,CreationCost,RedemptionCost from .api.cobra.getUniverseWithPositionDate[%BASKET%;%INSTANCE_ID%;(`effectiveDate`engine_type!(.z.D;`proxy))]

/ comparing anything with anything (match operator, = compares same entities) if [(`$("VMOM.L";"SPY4.L")) ~ `; res: select from universe]

/ Updating data in some table market_times: update Times: `hello from market_times where Market = `XHKG

/ inserting row(s) to the table `proxy_conf insert (`EMHD.L;`MKUW.L;0;`EMEA;`XLON;`FFIH1;`IFLL;`EMEA;`Future;07:15:00.000;16:35:00.000;1.0;0b;`PercentageShift;`FuturesReCalc;`LiveMids;-45.09;`Default;0b;0b;00:00:00.000;0b;1.0;`T;2020.12.18T08:38:18.947;0b)

/ Setting arbitrary string as a value of some cell market_times: update Times: enlist "Open=02:29:00,02:30:00,0,0|Trading=02:30:00,06:00:00,0,0|Close=06:00:00,06:30:00,0,0" from market_times where Market = `XHKG

/ Get types of columns in table meta quoteRequestConfiguration

/ Getting code of a function raze .api.cobra_server.cidre.getEMSConstituents

/ Transposing table (if it is made of dictionaries -- key/value pairs) { ( [] k: key x; v: value x ) } .cobra_engine.get_basket_types[ .z.D; `; ]

/ Quitting q.exe process interpreter exit 0

/ Find all cells unequal to specific value select from basket_price where date = 2020.02.24, id = `.dMIBR00000NUS, not(const_id = `)

/ list comprehension select count i by id from basket_price where date = .z.d - 1, id in `.AEX`.AXJO`.CSI300

/ left join two tables. only keyed table can be left-joined a lj 1! b

/ extract value from table / this will convert table into dict (type 99), then we can extract value held in the dict with column name as a key sola_id: 1# exec from select id from instrument_detail where ric = `100H.PA; select from basket_info where id = sola_id[`id]

/ show all tables \a

/ executing arbitrary shell command \netstat -p | grep 7218

---deleting--- / removing row(s) from table basket_price: delete from basket_price where id = `.AEX, const_id = `ULVR.L

/ modifying table in a better way when : delete/update from delete from `instance_universe where i in 2837 2865

/ delete the table delete quoteStab from `.

/ delete duplicate row select instance_id, sym, i from instance_universe where sym like "*CRUD*" delete from `instance_universe where i in 2837 2865 ---deleting---

Oracle DB ---

// Get the name of the database select * from global_name;

Adaptive Server Enterprise / SQL Server ---

// Get version of the database management system SELECT @@VERSION

// Select first 100 rows SELECT TOP 100 * FROM CDM_basket_list

// get all stored procedures SELECT * FROM sysobjects WHERE type = 'P' and category = 0

SQLite ---

// assign SELECT result to variable // not available, but here's hack: https://stackoverflow.com/questions/7739444/declare-variable-in-sqlite-and-use-it

// column name for expression column SELECT question, wrong - correct - (SELECT MIN(wrong - correct) FROM questions) + 1 AS weight FROM questions;

// update values in row UPDATE questions SET correct = correct + 1 WHERE question = 'q1.html';

// clear the table DELETE FROM questions;

// check if table exists SELECT name FROM sqlite_master WHERE type='table' AND name=' ';

Vi

$
 * 1) Go to the end of the line

1G
 * 1) go to the start of document

w
 * 1) save changes


 * 1) reload file
 * e

---special characters--- set list
 * 1) view tabs

set nolist
 * 1) hide tabs

set listchars=tab:>-
 * 1) how to show tabs

e ++ff=unix ---special characters---
 * 1) see carriage returns

ctrl-v 
 * 1) Insert "natural" tab

dd
 * 1) Delete current line

u
 * 1) Undo last change

Excel ---

// AND condition =AND(E2=F2; F2=G2)

GDB ---

gdb --args $COBRA/bin/cobraEngine -config $COBRA/config/config >> $LOG_DIR/cobraEngine.$TODAY.out 2>&1
 * 1) Starting a program under GDB

attach 10691
 * 1) Attach to the process

gdb /usr/local/dosa/cobra/current/bin/cobraEngine 8393
 * 1) attach to process and specify running binary

detach
 * 1) Detach from the process

r
 * 1) start and restart the program

info threads
 * 1) See all the threads of the process

---stack--- bt
 * 1) See backtrace

thread apply all bt
 * 1) See backtrace for all the threads

up 1 frame
 * 1) move up stack on specified number frames
 * 1) Show current location in the execution path

info frame ---stack---
 * 1) show current stack in memory

---variables--- p configFile
 * 1) View variable's value

p &_index
 * 1) view variable address

info locals ---variables---
 * 1) view all local variables

thread 2
 * 1) Switch to another thread

run
 * 1) Start the process

kill
 * 1) Kill the process

c
 * 1) Continue execution

s
 * 1) Step into

n
 * 1) Step over

finish
 * 1) Step out

break Application.cpp:299
 * 1) Set breakpoint

condition 2 bad_sym == 1
 * 1) Adding condition to breakpoint

condition 2 _symbol.compare("SPY.P") == 0
 * 1) Checking std::string value

disable 4
 * 1) Disable breakpoint

condition 2
 * 1) Remove condition from breakpoint

watch *(bool *)0xd73a19
 * 1) variable modification breakpoint

delete 2
 * 1) Remove breakpoint

info breakpoints
 * 1) List breakpoints

directory ~ps67755/reps/atd-q
 * 1) Add directory where to look for sources

show directories
 * 1) Show current paths to look for source files

set substitute-path /home/ts02817/usr/local/dosa/shared/current/include /home/ps67755/reps/dosa_shared
 * 1) Path substitution for sources

gdb /home/atd/qa/cobra/NAM.QA.03/bin/cobraEngine /home/atd/qa/cobra/NAM.QA.03/logs/20191211/core.27616
 * 1) Inspecting core files

x 0x7f286022c0c0
 * 1) dump memory

AWK ---

BEGIN { FS=":"; max_v = 0 } $2>300 { v = $2; if (v > max_v) { max_v = v; } } END { print max_v }
 * 1) structure of AWK script

$2>300 { ... }
 * 1) conversion string -> float
 * 2) conversion is done automatically, no specific casts needed

BEGIN { FS="-"; } { print tolower($1) }
 * 1) input field separator

/DWTR.OQ/
 * 1) Filter lines containing substring

getline
 * 1) Consider next line

$6 !~ /^\[/
 * 1) filter strings starting with symbol

$6 != "" && $6 !~ /^\[/
 * 1) and condition

for (l in libs) print l
 * 1) foreach cycle

BEGIN { FS="-"; } { print tolower($1) }
 * 1) make all letters lowercase

if (v > max_v) { max_v = v; }
 * 1) if statement, should be lowercase!

C++ ---

---constants--- // constexpr string constexpr std::string_view _DIRS_STR = "^>v<";				// C++17

// string constant restricted to class class Auto { static constexpr std::string_view _DIRS_STR = "^>v<";	// C++17 } ---constants---

// aggregate initialization of array to default values int var[SIZE] = {};

// list initialization (C++11) (copy-list-initialization (7)) struct S { double d; int i; }; int main(void) { vector vs; vs.push_back({ 0.0, 0 }); }

// name of current function __func__		// C++11

// new basic type long long val;	// C++11

// fixed integer types int64_t val;	// C++11

// non-static default member initializer (C++11) struct S { int n = 7; }

// typename disambiguator for dependent names (LevelsType depends on template parameter) typename LevelsType::iterator lvl = _levels.find(price);

// default inheritance for class is private class QBusSubscriptionGroup : public iMDSubscriber

---C++03--- // local types can't be used for template parameters until C++11 struct Test { int _val; Test(int val) : _val(val) {} bool operator(int x) const { return x < _val; } }; int main(void) { vector test_v; test_v.push_back(1); test_v.push_back(11); test_v.push_back(5); remove_if(test_v.begin, test_v.end, Test(5)); }

// basic_stream has only const char* constructor until C++11 static const char* CONFIG_FN = "config"; ifstream exists(CONFIG_FN); ---C++03---

// why struct is needed? struct timeval tv;

// make assertions assert;

// erase-remove idiom _subs.erase(remove_if(_subs.begin, _subs.end, CheckRemoval(sym, session_context)), _subs.end);

---filesystem--- // check that path is correct filesystem::exists()

// list files in folder for (const auto& f : filesystem::directory_iterator( tasks(thr_num); ... tasks[i] = async(launch::async, process_file, cref(*file_iter), ref(out_f)); ... if (tasks[i].wait_for(0ms) == future_status::ready)

// something like static initialization of std::map in C++98 // https://stackoverflow.com/questions/2172053/c-can-i-statically-initialize-a-stdmap-at-compile-time std::pair map_data[] = { std::make_pair(1, "a"), std::make_pair(2, "b"), std::make_pair(3, "c") }; std::map<int, std::string> my_map(map_data,   map_data + sizeof map_data / sizeof map_data[0]); // process ctrl-c signal in Linux volatile bool g_stop = false; void ctrl_c_received { g_stop = true; } int main(int argc, char** argv) { signal(SIGINT, ctrl_c_received); while (!g_stop) { } LOG_INFO("Ctrl-C received..."); }
 * 1) include <signal.h>

Boost ---

// range-based loop BOOST_FOREACH(IPriceListener* pl, _listeners) ; or { }

// smart pointer with self-managed ref counter // https://stackoverflow.com/questions/40137660/boost-intrusive-pointer typedef BIP<GMDTradeMsg>                 GMDTradeMsgSP;
 * 1) define BIP boost::intrusive_ptr

// unordered_map boost::unordered_map<std::string, std::string> dnaProperties;
 * 1) include <boost/unordered_map.hpp>

// unordered_map::count _securities.count(symbol)

// convert text representation into integer trade->_venue_sequence = boost::lexical_cast ( m.header.exchange_sequence_number );

Linux C++ functions ---

// get current time // https://man7.org/linux/man-pages/man2/settimeofday.2.html struct timeval tv; struct timezone tz; gettimeofday( &tv, &tz ); trade->_local_timestamp_sec = ( int )tv.tv_sec; trade->_local_timestamp_usec = ( int )tv.tv_usec;

// sleep sleep(1);			// seconds usleep(100000u);	// microseconds

GNU C Library ---

// fixed width integer types int64_t getPrice const { ... }		// GMD TCP API

Perforce Jam ---

project : requirements <include-dir-1> <include-dir-2> ; lib boost_filesystem : : <path-to-boost-lib> ; exe GmdApiTest : gmd_api.cpp gmd_api_test.cpp : -lgcov : boost_filesystem
 * 1) simple Jamroot file

Java ---

// enum enum ColumnFormat { QUOTE_SEP, SPACE_SEP, DOLLAR_SEP }

// use enum as int // it is possible to use EnumMap for this purpose in Java private static final EnumMap<Environments, LogsManager> COBRA_LOGS = new EnumMap<>(Environments.class);

// const in Java // variable queryFile can be assigned only once private final String queryFile;

// struct in Java // https://stackoverflow.com/questions/36701/struct-like-objects-in-java static class Override { public String basket; public int category; public int subcategory; public Override(String b, int cat, int subcat) { ...

// initialize Map with some content new HashMap<String, String>

// output something to console System.out.println("Hello world!");

// pause execution try {	Thread.sleep(300000); } catch(InterruptedException ex) {	Thread.currentThread.interrupt; }

// replace symbol in the string value = value.replace(',', '.');

// change element of collection inside cycle for (int i = 0; i < values.size; ++i) { ...	values.set(i, String.format("`%s", value)); ... }

// read text file into String try { String query = new String(Files.readAllBytes(Paths.get(queryFile))); } catch (Exception exc) { ... }

// index of char in String int wildcardStartIdx = pattern.indexOf('{');

// cut from String if indexes are known pattern.substring(0, wildcardStartIdx)

// determine if String is number try { Double.parseDouble(val); } catch (NumberFormatException exc) { return ColumnFormat.QUOTE_SEP; }

// get current time Date current = new Date;

// set timestamp to start of day startDay = DateUtils.truncate(startDay, Calendar.DATE);

// convert timestamp to UTC current.toInstant.toString

// format floating point value with specific locale (non-Russian) DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#.########", new DecimalFormatSymbols(Locale.US))

// remove unchecked cast warning that I don't know how to fix better @SuppressWarnings("unchecked")

Android ---

// load page inside WebView, not WebView Tester WebView webView = (WebView) findViewById(R.id.mainView); webView.setWebViewClient(new WebViewClient); webView.loadUrl("http://84.201.153.179/qa1.html");

// removing title bar (at the top of the screen) from the app // styles.xml <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar" />

Python ---

pip install python-binance
 * 1) installing package through pip

> -5.982905982905983 // 5 -2.0
 * 1) // operator will always round to the left

> ticks = {} > ticks['ICPBTC'] = 1 > ticks['MDABTC'] = 2 > ticks['NXSBTC'] = 3 > ticks['GLMBTC'] = 4 > list(ticks) ['ICPBTC', 'MDABTC', 'NXSBTC', 'GLMBTC']
 * 1) dict stores keys in the order they were inserted

if __name__ == "__main__":
 * 1) main function

---printing--- print "DnaConnection.execute | query |", query
 * 1) printing in Python 2

import termcolor print(termcolor.colored('text', 'red')) ---printing---
 * 1) printing in colors

---files--- with open('tracebacks.log', 'a') as f:
 * 1) opening file for read/write

if os.path.isfile: if os.path.isdir: os.listdir
 * 1) check if path file or directory
 * 1) list contents of a folder

os.getcwd
 * 1) get current folder

os.chdir(os.path.dirname(sys.argv[0])) ---files---
 * 1) change working folder to the folder of the .py

---time--- from time import sleep sleep(1)
 * 1) sleep

datetime.datetime.strptime(day_, '%y%m%d')
 * 1) creating time type from string

localtz = dateutil.tz.tzlocal timestamp = timestamp.replace(tzinfo=localtz) ---time---
 * 1) making timestamp timezone-aware

line.strip
 * 1) stripping string of whitespaces

max(column, key=len)
 * 1) max value of function on element for container

max(row, key=lambda c: c[i])
 * 1) lambda function on element of container for key parameter

import sys sys.path.insert(1, 'lib') import ODBCQuery, os, time, datetime, Disco
 * 1) import file from another folder

self.bm = BinanceSocketManager(self.client) self.bm.daemon = True
 * 1) terminate application if main thread is finished, don't allow another thread to hold app from finishing

exec('unit_tests.append(%s)' % ut)
 * 1) code from string

parser = argparse.ArgumentParser(fromfile_prefix_chars = '@') parser.add_argument('--btc', type = float) parser.add_argument('--ratio', type = int, default = 5) parser.add_argument('--sell-rise-percent', type = int, default = 5) ... args = parser.parse_args(sys.argv[1 : ]) ... Strategy.SELL_PERCENT = args.sell_rise_percent Strategy.GOOD_RATIO = args.ratio
 * 1) parse options

def exit_gracefully(dummy_arg1, dummy_arg2): ... signal.signal(signal.SIGINT, exit_gracefully)
 * 1) execute function on OS signal
 * 2) https://stackoverflow.com/questions/18114560/python-catch-ctrl-c-command-prompt-really-want-to-quit-y-n-resume-executi

def cycle(self): ...
 * 1) starting a thread

...	thr = threading.Thread(target = self.cycle, name = 'Weather') thr.start ...	# sender from multiprocessing.connection import Client c = Client(('localhost', 5000)) c.send('ETHBTC') # receiver from multiprocessing.connection import Listener server = Listener(('', 5000)) connection = server.accept msg = connection.recv ---unit tests--- class TestWallsAnalyzerIsStableCoin(unittest.TestCase): def setUp(self): self.assertEqual(pm.curr_threshold['ICPBTC'], 10)
 * 1) sending string from one process and receiving in another
 * 1) setup environment for tests
 * 1) testing inside unittest.TestCase child

def test_1__init__(self): ...	def test_2_store_answer(self): ---unit tests---
 * 1) order in which test* functions will be executed in TestCase child class is alphabetical

res = self.conn.execute if res.fetchone is None:
 * 1) check result of SELECT

Autosys ---

autoping -m nj1qeqcob01.dev.sti
 * 1) ping server from web GUI

kill 11074 cd /opt/CA/WorkloadAutomationAE/SystemAgent/WA1_AGENT/		# note, it starts only from this folder ./cybAgent -a &
 * 1) restart Autosys agent

Maven ---

debugging Java code inside test suite (IntelliJ IDEA run configuration window) -Dmaven.surefire.debug test -f pom.xml

Markdown ---

line break (for example in list item)

Regular expressions ---

Find what: 		^([^#]) Replace with: 	# \1
 * 1) replace match

grep "Unhandled GMD trading status \[117\]" `lastcobra` | wc -l
 * 1) [] treated as part of regexp in grep and sed by default

[0-9]+
 * 1) pattern should be found once or more times

grep -E "Subscribe to [A-Z]{3,5} "
 * 1) number of occurences

---sed--- sed 's/.*_\(digit:\{6\}\)\..*/\1/'
 * 1) group of symbols

sed 's/.*_\(digit:\{6\}\)\..*/\1/'
 * 1) in sed {} should be escaped

... | sed 's/.*\(Cross:\-\?[0-9\.]\+\).*/\1/'
 * 1) present or not ? should be escaped

... | sed 's/.*\(Cross:\-\?[0-9\.]\+\).*/\1/'
 * 1) 1 or more + should be escaped

... | sed 's/.*\(Cross:\-\?[0-9\.]\+\).*/\1/' ---sed---
 * 1) group  should be escaped

Emoji ---

¯\_(ツ)_/¯
 * 1) shrug

Wiki

White-box testing      			181231	+ Black-box testing      			181231	+ Luxoft                 			190114  + CMake                  			190118	+ Unity (game engine)					190118	+ C++14								180121	+ Object-oriented analysis and design	190516	+ kdb+								190605	+ PostgreSQL							190617	+ Market maker						190704	+ Boilerplate code					190705	+ Observer pattern					190709	+ cron								190719	+ vi									190725	+ Volume-weighted average price		190813	+ Telnet								190814	+ Red Hat Enterprise Linux			190820	+ SUSE Linux Enterprise				190902	+ RPM Package Manager					190821	+ CA Workload Automation AE			190905	+ Perforce Jam						190924	+ Emacs								191031 Visual Studio Code					191031 strace								191111	+ Adaptive Server Enterprise         191112	+ Symphony Communication             191113  + Ruby (programming language)        191120 Regression testing                 191127 Port forwarding                    191128 netcat                             191128 ps (Unix)                          191210 Mushroom management					200219 Protocol Buffers					200304 Windows Subsystem for Linux			200306 Asio C++ library					200310	+ Basket (finance)					200311	+ Micromanagement						200316 SSH Communications Security			200325 mintty								200325 CodeLite							200427 Confluence (software)				200513 pkill								200529	+ Smoke testing (software)			200625 APT (software)						200620 Ubuntu								200620 Dynamic programming language		+	200630, 210218 TeamCity							200715	+ less (Unix)							200922 Apache Maven						201007 Cucumber (software)					201007 Java Development Kit				201008 nohup								201008 IntelliJ IDEA						201026	+ PKZIP								201030 JUnit								201120 Refinitiv							210128 Microsoft OneNote					210211 Deadlock							210330 Opaque pointer						210405 pragma once							210405 rsync								210408 Git									-	210409 ping (networking utility)			-	210409 mkdir								-	210409 rm (Unix)							-	210409 Technical debt						-	210409 Software repository					-	210420 bzip2								-	210427 GNU Compiler Collection				-	210427 tar (computing)						-	210427 Autoconf							-	210427 Make (software)						-	210427 GNU MPFR							-	210427 XZ Utils							-	210427 Bash (Unix shell)					-	210427 gzip								-	210427 GNU Screen							-	210428 Sticky bit							-	210507 INI file							-	210511 GNU C Library						-	210512 Microservices						+	210528 C++03								+	211001 Erase–remove idiom					-	211001 Cross product						-	211026 Query string						-	211116 Common Gateway Interface			-	211117 SQLite								- 	211120 Spaced repetition					-	211120 Message-oriented middleware			-	211124

questions -

// size_t can't be < 0, why? size_t size = pendingUpdateMap_->size; if( size <= 0 ) return; // 211110 | Vadim doesn't know, I think just stupidity

rules -

---identifiers--- - compile time constants are all caps - variable names are all lowercase and use _ - function names are all lowercase and use _ - class names and typedefs are camel case - fields identifiers start with _ ---identifiers--- - using using namespace std; inside .cpp, but not in headers - if it is possible to skip {}, I should skip it - constant strings member of class - static constexpr std::string_view STR = "value"; - I don't write in-class definitions - function should fit into one screen vertically - at the end of file should be blank line ---text--- - if there is one sentence in line, I start it with lower case - if there are 2 or more sentences, I start each of them with upper case - if sentence is last on the line, I don't put. at the end ---text---