select h.id as hacker_id, name, sum(m_score) as total_score from(
select h.id, h.name, nvl(max(s.score),0) m_score from hackers h
left join submissions s on
s.hacker_id=h.id
group by h.id, s.challenge_id
)
where m_score > 0
order by total_score desc, name asc;
View Cron.java
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 lombok.EqualsAndHashCode; | |
import lombok.Getter; | |
import lombok.NoArgsConstructor; | |
import lombok.Setter; | |
import lombok.ToString; | |
import javax.validation.constraints.NotNull; | |
import javax.validation.constraints.Pattern; | |
@NoArgsConstructor |
View AbstractMapper.java
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 java.util.List; | |
import java.util.UUID; | |
public interface AbstractMapper<T, R> { | |
R map(T source); | |
List<R> map(List<T> sourceList); | |
default UUID stringToUUID(String string) { |
View Properties.java
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
@Data | |
@Validated | |
@ConfigurationProperties("registration.kafka") | |
public class KafkaProperties { | |
@NotEmpty(message = "Parameter 'bootstrap-servers' can not be empty") | |
private String bootstrapServers; | |
@NestedConfigurationProperty | |
@NotNull(message = "Parameter 'some-activate' can not be null") |
View docker-compose.yml
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
version: "3.7" | |
# docker-compose up --d --build --force-recreate redis | |
services: | |
redis: | |
image: redis:alpine | |
container_name: redis | |
hostname: redis | |
command: redis-server --requirepass 123456 | |
restart: unless-stopped |
View Задачи.md
View Kafka.md
Start
Windows
- zookeeper-server-start.bat config/zookeeper.properties
- kafka-server-start.bat config/server.properties
Create
kafka-topics.bat --bootstrap-server localhost:9092 --topic first --create --partitions 6 --replication-factor 1
List
kafka-topics.bat --bootstrap-server localhost:9092 --list
Delete
View SummAlgorithm.java
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 org.junit.jupiter.api.Test; | |
import org.junit.jupiter.api.TestInstance; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
import static org.junit.jupiter.api.Assertions.assertEquals; | |
// Написать функцию, которая получает на вход массив и искомое число и возвращает 2 элемента в массиве, которые в сумме дадут это число (за n^2 решать не надо). |
View VPS_hosting.md
Prepare
- apt update
- apt-get update
- apt upgrade
- apt-get upgrade
- apt-get install unzip zip bash apt-transport-https ca-certificates nano curl gnupg-agent software-properties-common gcc g++ make htop fail2ban git
service fail2ban start
Oh My Zsh - terminal
View postgres.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
--------------------------------- | |
-- Функции для создания писем -- | |
--------------------------------- | |
------------------- | |
-- MESSAGE GROUP -- | |
------------------- | |
CREATE OR REPLACE FUNCTION create_close_message_group(external_id_p text, inn_p text) | |
RETURNS bigint AS | |
$group_id$ |
View Open_feb_auth.http
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
GET http://localhost:11218/webapi-2.1/rko/ | |
Authorization: Bearer sso_1.0_dev_123 | |
http://localhost:11223/ | |
# Обновить зависимости в `package.json` | |
# npm install -g npm-check-updates | |
ncu -u | |
npm install | |
NewerOlder