Роутинг, авторизация, защита Cross Site Request, шаблонизация, события - первое, что в голову пришло из ряда универсальных для каждого сайта компонентов.
Если потыкать, то несложно. За 5 мин болванка из которой можно все что угодно развить
document.getElementById('iiii').addEventListener('click', function (event) { let b = this.getBoundingClientRect(), x = event.x - b.left - 10, y = event.y - b.top -10; console.log(b, x, y) /* * ну так на всякий, если скадрировано, то координаты можно пересчитать с поправкой на коэф */ console.log( this.clientWidth, this.clientHeight, this.naturalWidth, this.naturalHeight ) var div = document.createElement("div") div.style.position = 'absolute'; div.style.width = '20px'; div.style.height = '20px'; div.style.top = y+'px'; div.style.left = x+'px'; div.style.background = 'rgba(255,0,0,.2)'; this.parentNode.appendChild(div); });
If you poke it is simple. 5 min ingot from which you can build anything
document.getElementById ( 'iiii'). addEventListener ( 'click', function (event) { let b = this.getBoundingClientRect (), x = event.x - b.left - 10, y = event.y - b.top -10; console.log (b, x, y) / * * Well, just if cropped, the coordinates can be counted-adjusted coefficients * / console.log ( this.clientWidth, this.clientHeight, this.naturalWidth, this.naturalHeight ) var div = document.createElement ( "div") div.style.position = 'absolute'; div.style.width = '20px'; div.style.height = '20px'; div.style.top = y + 'px'; div.style.left = x + 'px'; div.style.background = 'rgba (255,0,0, .2)'; this.parentNode.appendChild (div); });
https://pastebin.com/HgtXG8d2
На питоне с тем же алгоритмом:(---------- Добавлено 18.06.2020 в 19:06 ----------
Что то идей больше нет. :(
In Python with the same algorithm :( ---------- Posted 18.06.2020 at 19:06 ----------
That the idea is no more. :(
Очень похожий результат
Very similar results
Сначала в не ту степь с array_combine. Работает, но не обязательно первое достает c например [1,2,3,3,3,3,3, 6].
Потом дошло. Смысл в значениях в качестве индекса.
https://pastebin.com/NcuYkQbe
Вариант в "лоб" по памяти чуть лучше, но медленней
class Solution { private $n, $t, $l; public function twoSum(array $nums, int $target) { $this->n = $nums; $this->t = $target; $this->l = count($nums); $c = $this->l-1; for($i=0;$i<$c;$i++){ $r = $this->calc($this->n[$i], $i+1); if(false!==$r) return [$i,$r]; } return []; } private function calc($val, $k){ for($i=$k;$i<$this->l;$i++){ if( $this->t == $val + $this->n[$i]) return $i; } return false; } }
First, in the wrong steppe array_combine. Works, but not necessarily the first example gets c [1,2,3,3,3,3,3, 6].
Then it came. The point values as an index.
Option in the "forehead" slightly better memory, but slower
class Solution { private $ n, $ t, $ l; public function twoSum (array $ nums, int $ target) { $ This-> n = $ nums; $ This-> t = $ target; $ This-> l = count ($ nums); $ C = $ this-> l-1; for ($ i = 0; $ i <$ c; $ i ++) { $ R = $ this-> calc ($ this-> n [$ i], $ i + 1); if (false == $ r!) return [$ i, $ r]; } return []; } private function calc ($ val, $ k) { for ($ i = $ k; $ i <$ this-> l; $ i ++) { if ($ this-> t == $ val + $ this-> n [$ i]) return $ i; } return false; } }
днс атака на субдомен
Вообще не про это, т.к. нс - cloudflare, т.е косвенно защищает. А так да * - серое, сайт.ру