$(document).ready(function() {
$('.services-link').each( function(){
if ($(this).hasClass('active')){
$('.blackimg', this).hide();
$('.whiteimg', this).show();
} else {
$('.blackimg', this).show();
$('.whiteimg', this).hide();
}
})
});
.services-link .blackimage {display: block}
.services-link.active .blackimage {display: none}
.services-link .whiteimage {display: none}
.services-link.active .whiteimage {display: block}
let WIDTH=640
let HEIGHT=480
let MID=$WIDTH/2
let BUFFER=16
let FRAMERATE=30
let XRATE=$BUFFER\*$FRAMERATE
let DURATION=8
let FPERIOD=$XRATE\*$DURATION
ffmpeg \
-filter_complex \
" \
color=white:${WIDTH}x${HEIGHT}:d=$DURATION:r=$XRATE,format=rgb24[bg]; \
color=black:8x${HEIGHT}:d=$DURATION:r=$XRATE,format=rgb24[bar]; \
[bg][bar]overlay=x='$MID + $MID * sin(8 * PI * n / $FPERIOD)':y=0:format=yuv444,format=yuv420p[motion]; \
[motion]tmix=frames=$BUFFER \
" \
-c:v libx264 \
-r $FRAMERATE \
-an \
-hide_banner \
-y \
output.mp4
// но тесты проходит
function repairCase(src, input) {
const len = input.length;
if (len === 0) return '';
const _src = src.toLowerCase();
const _input = input.toLowerCase();
let i, from = 0, maxWeight = -1, maxIndex = -1;
while (i = _src.indexOf(_input, from), -1 !== i) {
from = i + 1;
const match = src.substr(i, len);
let weight = 0;
for (let k = 0; k < len; k++) if (match[k] === input[k]) weight++;
if (maxWeight < weight) {
maxWeight = weight;
maxIndex = i;
}
}
if (-1 === maxIndex) return '';
return src.substr(maxIndex, len);
}
event_id
события и datetime
каждого напоминания о нём с сегодняшней даты до даты события.const countries = people.map(el => el.country);
people.filter((el, index) => countries.indexOf(el.country) === index)
/* [
{"id":73334,"country":"Sweden"},
{"id":73335,"country":"England"},
{"id":45445,"country":""}, // про пустые и отсутсвующие страны надо уточнить
{"id":4544500},
{"id":88989,"country":"France"}
]
*/
function groupProps(obj) {
const sums = {};
const result = {};
for (let p in obj) {
const key = p.substring(0, 4); // группируем по первым 4 символам
if (!sums.hasOwnProperty(key)) {
sums[key] = 0;
result[p] = 0;
}
sums[key] += obj[p];
}
for (let p in result) {
const key = p.substring(0, 4);
result[p] = sums[key];
}
return result;
}
groupProps(obj) // {"12345":3,"12356":2,"12360":1}
setInterval(() => {
const field1 = document.getElementById("#id-polya-1"); // 1-е поле формы
const field2 = document.getElementById("#id-polya-2"); // 2-е поле
const btn = document.getElementById("#btn"); // кнопка отправки
field1.value = "значение в поле 1";
field2.value = "значение в поле 2";
btn.click();
}, 18e5);
[0, 2346]
оказалось 105 из диапазона "B"[0, 1902]
, т.к. длина "B" 544-101+1 = 444
, 2346 - 444 = 1902
[0,1902]
оказалось, например, 404. Для чисел выше 100 добавляем 444 и получаем 848 из диапазона "C" по старому стилю )