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 crypto from 'crypto'; | |
// values from html | |
const KEY = "PqNhWICGMDKoRbL0hncbXQ=="; | |
const IV = "x/6IjlGnzYOiigxVSJ6Dmw=="; | |
const DATA = "ZVFKoJQk8YmLz7fCmW6xB7QISRIMk4YeH1Rg6Uy/rI11DSH6xIDDG46RNa1hsJUVT0YutN4QAICu14ODZB5SJGgdNFn4gQl5OaLYFKal7X3/9STXHpeEXajk5iXHIFe12arh69mOwdfPoHYMCB8ODZtM5ZBeVuNqgTmbWkst3G8TX/bfLL5RAmTZ3KkXkfMaE+Rl61baD340Achqi1Aa0jExpgvNpWPkmHfB3J85L2yv9vWw0Ea+KdIs7YQblxH/ldGIP8HxZeJIE7esK6YALoStLpt0fnHSo0hOzAwQyS6DZlUSAMfopInTMn7tlE4M7wdHxGOIArMLWGglmMxkJLAxfQkO6B+mxLbtaMAmh4cG7rFBYcGta6GM6GNuDa1v8h54vhZXozZDG8xWsVG+Nen8EfCVki17Hb18fDy+mcJ5q2LpusrigschdicPoiSJXoKfAn2mngFx5tZ4emrMbcwppd6p1QOuF3tdaOeNJPe4ZlSIOo+5M53USAlPP3m40i/fm8yZaO7iTQ0RT70u7FP7qrqsvN00sYnXZvVivf+/lx/cW1lzB8Layd6PkZBfaLWvTkVENthCbujHoHOe1XwGU2UBHIXzUiBsfzUuKNtStNq0HAig7kDW85OuclnJlTZTsblFbfif+InrI9ZV0Qr47wX/QCxMvU/PBsyrA9ihfs6wCxZ9BGERSA0mZyB/SByaAovFbP87EFKXGNb7cqzBYvHnlQ3H58GT107cU3hgtowUAJvxiC03Hlk5/OFZvAssREoHS1PwXqyqwEFT/4oH5GVVelFq5ym+DVz6CUMeOHmwHoqp4zQP3RqVyfJ/WLfRB1k0xR0A/CcEbmhQdBva0hoex+dAfyB1JeQfQuJkV9 |
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
sandbox=> | |
equation 1 : (x + 50) * 10 - 15 = 10 | |
(((x + 50) * 10) - 15) = 10 | |
((x + 50) * 10) = (10 + 15) | |
(x + 50) = ((10 + 15) / 10) | |
x = (((10 + 15) / 10) - 50) | |
solution: x = (((10 + 15) / 10) - 50) = -95/2 | |
equation 2 : ((x + 10) + 30) = 10 + 20 |
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
(defn full-square? [n] | |
(let [r (int (Math/round (Math/sqrt n)))] | |
(= (* r r) n))) | |
(defn f [i s] | |
(if-not (seq s) | |
(when i (list (list i))) | |
(when-let [rs (->> s | |
(filter #(or (nil? i) (full-square? (+ % i)))) |
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
(ns tinkoff-2 | |
(:import [java.util Date])) | |
;; мутабельный thread-safe (!) атом для хранения списка неотправленных сообщений | |
(def data (atom [])) | |
;; У вас есть метод `readData` для получения порции непрерывных данных. | |
;; Данные нужно сразу отослать всем потребителям при помощи `sendData`. | |
;; Технические детали |
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
(ns tinkoff-1 | |
(:import [java.util Date])) | |
;; У вас есть два эквивалентных сервиса, в которых можно узнать статус заявки | |
;; при помощи функций `getApplicationStatus1` и `getApplicationStatus2`. | |
;; Каждый из сервисов может вернуть один из ответов: | |
;; * `Response.Success` в случае успешно выполненного запроса | |
;; * `Response.RetryAfter` в случае, если сервис не может выполнить запрос, поле `delay` - желательная задержка перед повторным запросом | |
;; * `Response.Failure` в случае, если в ходе обработки запроса произошла ошибка |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
.unauthorized-display-none { display: none } | |
.authorized-display-none { display: none } | |
</style> | |
</head> |
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
.....................................................................................................................................................#########................................................................................................................................................. | |
.....................................................................................................................................................#*******#................................................................................................................................................. | |
.....................................................................................................................................................#*******#................................................................................................................................................. | |
................................................................................................................ |
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
;; toast ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(defn- create-element-from-hiccup [hiccup-data] | |
(let [tmp (.createElement js/document "div") | |
content (rds/render-to-static-markup hiccup-data)] | |
(aset tmp "innerHTML" content) | |
(.-firstChild tmp))) | |
(defn- get-create-toast-container [] | |
(let [container-id "ivana_toast_container"] |
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
create table organization ( | |
id int, | |
parent int, | |
name text | |
); | |
insert into organization (id, parent, name) | |
values (1, null, 'ГКБ 1') | |
,(2, null, 'ГКБ 2') | |
,(3, 1, 'Детское отделение') |
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
(defn take-first-sorted-by | |
"Performs the same result as (take n (sort-by keyfn comp coll)) | |
but more efficient in terms of time and memory" | |
([n keyfn coll] (take-first-sorted-by n keyfn compare coll)) | |
([n keyfn ^java.util.Comparator comp coll] | |
(if (pos? n) | |
(let [m ^java.util.TreeMap (java.util.TreeMap. comp) | |
m-size (volatile! 0) | |
;; if it is guaranteed that (keyfn v) will be unique for all v in coll | |
;; we can attach :unique? key to keyfn meta and algorythm will use single val map |
NewerOlder