- 1
- 2
- 3
let startMonth = Number(moment(payDate).startOf("month").format("DD"));
let endOfMonth = Number(moment(startMonth).endOf("month").format("DD"));
let dayOffMonth = (endOfMonth-startMonth +1)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
let startMonth = Number(moment(payDate).startOf("month").format("DD"));
let endOfMonth = Number(moment(startMonth).endOf("month").format("DD"));
let dayOffMonth = (endOfMonth-startMonth +1)
Это так оказывается можно посчитать число дней в месяце
0
handleShowScheduler() {
console.log(this.$parent.$parent.$parent.showScheduler, 'sch')
if (this.$parent.$parent.$parent.showScheduler) {
this.$parent.$parent.$parent.showScheduler = false;
setTimeout(() => {
this.$parent.$parent.$parent.showScheduler = true;
}, 200)
} else {
this.$parent.$parent.$parent.showScheduler = true;
}
},
+1
https://core.telegram.org/constructor/passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow
Какой багор )))
0
Процедура ОбработкаПолученияПредставления(Данные, Представление, СтандартнаяОбработка)
СтандартнаяОбработка=Ложь;
Представление="";
Для Каждого Стр Из Данные.Ссылка.Состав Цикл
Представление=Представление+?(Представление="","",", ")+Стр.Автомобиль;
Если СтрДлина(Представление)>50 Тогда
Представление=Представление+"...";
Прервать
КонецЕсли;
КонецЦикла;
//Представление=""+Данные.Ссылка.Клиент+" ("+Представление+")";
КонецПроцедуры
А чё это списки у нас вдруг тормозить стали?
0
#include <stdio.h>
#include <csptr/smart_ptr.h>
#include <csptr/array.h>
void print_int(void *ptr, void *meta) {
(void) meta;
// ptr points to the current element
// meta points to the array metadata (global to the array), if any.
printf("%d\n", *(int*) ptr);
}
int main(void) {
// Destructors for array types are run on every element of the
// array before destruction.
smart int *ints = unique_ptr(int[5], {5, 4, 3, 2, 1}, print_int);
// ints == {5, 4, 3, 2, 1}
// Smart arrays are length-aware
for (size_t i = 0; i < array_length(ints); ++i) {
ints[i] = i + 1;
}
// ints == {1, 2, 3, 4, 5}
return 0;
}
Allocating a smart array and printing its contents before destruction.
C Smart Pointers
What this is
This project is an attempt to bring smart pointer constructs to the (GNU) C programming language.
Features: unique_ptr, shared_ptr macros, and smart type attribute
https://github.com/Snaipe/libcsptr
−1
updateTimer() {
requestAnimationFrame(() => {
this.timeLeft = this.resendTimeDuration - (Date.now() * 0.001 - this.lastTimeLeft);
if (this.timeLeft <= 0) {
this.resetTimer();
return;
} else {
this.lastTimeLeft = this.timeLeft;
this.updateTimer();
}
});
}
А как сделать таймер обратного отсчета?
+1
enchufar Chamuyo
un Árbol de a es
bien Hoja a
bien Nodo a (Árbol de a) (Árbol de a)
el máximo
dados n m
si n > m da n
si no da m
la altura de Árbol de a en Numerito
dado (Hoja _) da 1
dado (Nodo _ a b) da 1 + máximo (altura a)
(altura b)
el programa es escupir . mostrar . altura $
Nodo 'a'
(Nodo 'b'
(Hoja 'c')
(Hoja 'd'))
(Nodo 'e'
(Hoja 'f')
(Hoja 'g'))
Отсюда:
https://qriollo.github.io/
+1
if number >= 0 and number <= 9 then
string.format('00%d', number)
end
if number >= 10 and number <= 99 then
string.format('0%d', number)
end
if number >= 100 and number <= 999 then
string.format('%d', number)
end
0
post_content = post_node.xpath('div[@class="entry-content"]')[0]
post_code_nodes = post_content.xpath('.//code')
if len(post_code_nodes) > 0:
post.code = post_code_nodes[0].text
else:
post.code = inner_html_ru(post_content)
Багор.
+1
private IDictionary<string, Value> valueIndex;
...
var result = this.valueIndex
.Where(v => v.Key == prefix + hashCode.ToString())
.Select(v => new
{
path = v.Value.Path,
field = v.Value.Field
})
.FirstOrDefault();
Трушный способ достать значение из словаря.
В словаре 10000 записей, за каждой полезут хотя бы раз