This file contains hidden or 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
SELECT main.login, main.timestamp, main.partner_id, main.currency, main.ref_camp, main.subtype, | |
deposit, payout, main.income, dep_players_count, fd_count, bonus_amount, bonus_currency, | |
COUNT(reg.login) AS regs | |
FROM (SELECT p2.login, tr.timestamp::date, p2.partner_id, tr.currency, p1.ref_camp, tr.subtype, | |
SUM(tr.amount) FILTER(WHERE tr.type = 'deposit') AS deposit, | |
SUM(tr.amount) FILTER(WHERE tr.type = 'payout') AS payout, | |
SUM(tr.amount) FILTER(WHERE tr.type = 'deposit') - | |
SUM(tr.amount) FILTER(WHERE tr.type = 'payout') as income, | |
COUNT(DISTINCT tr.login) FILTER(WHERE tr.type = 'deposit') AS dep_players_count, | |
COUNT(tr.amount) |
This file contains hidden or 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
Правильно подсчитывающий запрос: | |
```SELECT p2.login, tr.timestamp::date, p2.partner_id, tr.currency, p1.ref_camp, tr.subtype, | |
SUM(tr.amount) FILTER(WHERE tr.type = 'deposit') AS deposit, | |
SUM(tr.amount) FILTER(WHERE tr.type = 'payout') AS payout, | |
SUM(tr.amount) FILTER(WHERE tr.type = 'deposit') - | |
SUM(tr.amount) FILTER(WHERE tr.type = 'payout') as income, | |
COUNT(DISTINCT tr.login) FILTER(WHERE tr.type = 'deposit') as dep_players_count, | |
COUNT(*) FILTER (WHERE tr.type = 'deposit' AND tr.subtype = 'first') as fd_count | |
FROM transactions_paysys tr |
This file contains hidden or 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
<% if (result.length !== 0) { %> | |
<h2 class="text-center">Результаты поиска</h2> | |
<table class="table table-hover"> | |
<thead class="black white-text"> | |
<tr> | |
<th scope="col">№</th> | |
<th scope="col">Фамилия, имя</th> | |
<th scope="col">Комната</th> |
This file contains hidden or 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 com.khuzha.objects; | |
import java.util.Scanner; | |
public class Sergey { | |
static int factorial(int n) { | |
if (n == 0) | |
return 1; | |
else | |
return(n * factorial(n-1)); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title><%= lodger.lastName %> <%= lodger.firstName %> <%= lodger.fathersName %></title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" | |
integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous"> | |
</head> | |
<body class="container mt-3"> | |
<% if (edited) { %> |
This file contains hidden or 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.io.IOException; | |
import java.net.URI; | |
import java.net.http.HttpClient; | |
import java.net.http.HttpRequest; | |
import java.net.http.HttpResponse; | |
import java.util.Scanner; | |
public class Calc { | |
public static void main(String[] args) throws IOException, InterruptedException { |
This file contains hidden or 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
const schema = { | |
'Date of request': { | |
prop: 'date', | |
type: Date | |
}, | |
'Name': { | |
prop: 'name', | |
type: String | |
}, | |
'Birthday': { |
This file contains hidden or 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
def devyatoe(a): | |
""" | |
Выведет в стандартный поток вывод возраст и слово "год" в нужном падеже | |
:параметр a: возраст | |
:тип данных параметра a: целочисленное значение | |
:функция вернет: ничего | |
""" | |
if a%10==0 or a%10>4 or a//10%10==1: | |
""" |
This file contains hidden or 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 com.khuzha.objects; | |
public class Main { | |
public static void main(String[] args) { | |
int k = 2, l = 2, m = 4, n = 6; | |
if (l % k == 0 && m % k == 0 && n % k == 0) { | |
System.out.println("Все эти числа можно разделить на число k без остатка."); | |
} else { | |
System.out.println("Одно из этих чисел делится на число k с остатком"); |
This file contains hidden or 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 com.khuzha.objects; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
System.out.println("Введите длину стороны а:"); | |
float a = scan.nextInt(); |