Skip to content

Instantly share code, notes, and snippets.

@bbrother92
bbrother92 / 19.md
Created July 25, 2022 21:41 — forked from rusdevops/19.md

XIX Задача о поиске элемента ⭐⭐

Дан упорядоченный массив чисел размером N Нужно реализовать алгоритм поиска вхождения упорядоченного подмассива размера M, где M << N

func isInclude(array int[], subarray []int) bool

assert(isInclude([1, 2, 3, 5, 7, 9, 11], []) == true) 
assert(isInclude([1, 2, 3, 5, 7, 9, 11], [3, 5, 7]) == true) 
@bbrother92
bbrother92 / docker.md
Last active September 16, 2019 15:03
#docker

Containers

docker ps -as
** list containers, -s is short for --size

docker  logs --details [container-id]
** Fetch the logs of a container

docker top CONTAINER
** Display the running processes of a container
@bbrother92
bbrother92 / curl.md
Last active September 19, 2020 19:05

GET is default, using -d or -F makes it a POST, -I generates a HEAD and -T sends a PUT.

Download

curl -O README.md  download and save with orginal name or -o (lowercase o) the result will be saved in the filename provided
curl -u ftpuser:ftppass -O ftp://ftp_server/public_html/xss.php download files from FTP servers

tabs

if we clicked on target="_black" link then we have to use switchTo().window([0-N]);
N - tab number
but without switchTo locally in browser tab will appear like its already selected (its not)!

frames

switchTo().innerFrame("frameName")

testng запускает тесты не по порядку но не радномо (после перезапуска порядок не измениться ) и чтобы сохр порядок юзаем preserve-order="true" (работает только если метод вписан в xml include name=)

verbose option

<test name="logintest1" verbose="0" preserve-order="true" enabled="true">

"0":
[INFO] ------------------------------------------------------------------------
[INFO] Building regressionui 1.0-SNAPSHOT
@bbrother92
bbrother92 / linux.md
Last active March 19, 2019 17:14
linux notes

Installing chrome

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update 
sudo apt-get install google-chrome-stable


# Update
@bbrother92
bbrother92 / logs.md
Last active September 2, 2019 15:54
#logs #cat #find #xargs #mkdir #sed

Tail

by default tail display only first 10 lines

tail -n2 access.log 
**last 2 lines  

tail -f /var/log/mail.log 
**fresh updating  

Compilation

In root directory: javac -d target/classes src/main/java/app/Main.java src/main/java/util/Second.java (-d option to set output dir)
Or javac -cp src/main/java/ src/main/java/app/Main.java

java command

@bbrother92
bbrother92 / cheatsheet.py
Created December 3, 2017 00:30 — forked from fuyufjh/cheatsheet.py
My Python Cheatsheet
Python Cheatsheet
=================
################################ Input & Output ###############################
name = input('please enter your name: ')
print('hello,', name)
ageStr = input('please enter your age: ')
age = int(ageStr)