This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
final var line = "abaabbbc"; //Expected result: aba2b3c | |
final var chars = line.toCharArray(); | |
int count = 0; | |
char prev = ' '; | |
final var result = new ArrayList<Character>(); | |
for (char current : chars) { | |
if (current == prev) { | |
count++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.base.CharMatcher; | |
import java.io.IOException; | |
import java.nio.charset.StandardCharsets; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.Collections; | |
import java.util.LinkedHashMap; | |
import java.util.Map; | |
import java.util.stream.Collectors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
databaseChangeLog: | |
- changeSet: | |
id: 2022-03-31-14-30 | |
author: tkachenko | |
changes: | |
- sql: | |
dbms: mssql | |
sql: ALTER SEQUENCE ROCK_SEQ RESTART WITH 1 MINVALUE 1 | |
rollback: | |
- sql: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
databaseChangeLog: | |
- property: | |
dbms: oracle | |
name: my_date_type | |
value: to_date('2021-10-03','YY-MM-DD') | |
- property: | |
dbms: postgresql | |
name: my_date_type | |
value: date '2021-10-03' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
databaseChangeLog: | |
- changeSet: | |
id: 2021100110000 | |
author: test | |
changes: | |
- addColumn: | |
tableName: example_tab | |
columns: | |
- column: | |
name: rock_new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2020-10-18 15:26:10,784 DEBUG reactor.netty.http.client.HttpClient : [id: 0x779c09ee] REGISTERED | |
2020-10-18 15:26:10,788 DEBUG reactor.netty.http.client.HttpClient : [id: 0x779c09ee] CONNECT: httpbin.org/52.6.34.179:443 | |
2020-10-18 15:26:11,150 DEBUG reactor.netty.http.client.HttpClient : [id: 0x779c09ee, L:/192.168.1.116:39582 - R:httpbin.org/52.6.34.179:443] ACTIVE | |
2020-10-18 15:26:11,409 DEBUG reactor.netty.http.client.HttpClient : [id: 0x779c09ee, L:/192.168.1.116:39582 - R:httpbin.org/52.6.34.179:443] READ COMPLETE | |
2020-10-18 15:26:11,482 DEBUG reactor.netty.http.client.HttpClient : [id: 0x779c09ee, L:/192.168.1.116:39582 - R:httpbin.org/52.6.34.179:443] READ COMPLETE | |
2020-10-18 15:26:11,711 DEBUG reactor.netty.http.client.HttpClient : [id: 0x779c09ee, L:/192.168.1.116:39582 - R:httpbin.org/52.6.34.179:443] USER_EVENT: SslHandshakeCompletionEvent(SUCCESS) | |
2020-10-18 15:26:11,728 DEBUG reactor.netty.http.client.HttpClientConnect : [id: 0x779c09ee, L:/192.168.1.116:39582 - R:httpbin.org/52.6.34.179:4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.tkachenko.app; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
/** | |
* @author d.tkachenko | |
*/ | |
@SpringBootApplication | |
public class Application { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASE_PATH="$HOME/nginx/ssl/certificates" | |
PATH_CERT="$BASE_PATH/1.crt" | |
PATH_CERT_KEY="$BASE_PATH/1.key" | |
URL=https://localhost/v1/api/topic/favourites | |
#чтобы не писатать полный путь к утилите, например, /usr/bin/seq или /usr/bin/parallel или /usr/bin/curl | |
#экспортируем директиву в окружение | |
export MY_ENV="/usr/bin" | |
export PATH=$MY_ENV:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Важно. Нужно запускать source myprojscript.sh, а не . ./myprojscript.sh, чтобы сохранялся экспорт окружения | |
# Чтобы запускать этот скрипт было удобно, добавим alias в .bashrc: alias testbuild="cd $HOME/myproj && source myprojscript.sh" | |
# все манипуляции делаются ради замены пути в JAVA_HOME, чтобы избавиться от ERROR: JAVA_HOME is set to an invalid directory | |
# смотрим что лежит в JAVA_HOME. По умолчанию там .sdkman/candidates/java/current/jre | |
# этот путь не корректный. нужно заменить его на .sdkman/candidates/java/current/ | |
# берем последние 3 символа jre и кладем их в переменную PREFIXX | |
PREFIXX="${JAVA_HOME: -3:3}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.tkachenko.utils; | |
/** | |
* @author d.tkachenko | |
*/ | |
public class Constant { | |
public static final String V1 = "v1/api"; | |
} |
NewerOlder