−1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
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();
}
});
}
А как сделать таймер обратного отсчета?
somebodyoncetoldme,
18 Августа 2020
+1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
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/
TEH3OPHblu_nemyx,
01 Июня 2020
+1
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
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
imring,
22 Мая 2020
0
- 1
- 2
- 3
- 4
- 5
- 6
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)
Багор.
gost,
19 Мая 2020
+1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
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 записей, за каждой полезут хотя бы раз
adoconnection,
05 Мая 2020
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
private String getStringDelimitedNullByte(Collection<String> stringList){
byte delimiter = (byte) 0;
int numBytes = 0;
int index = 0;
List<Byte> byteList = new ArrayList<>();
int stringListsize = stringList.size();
for (String str : stringList) {
numBytes += str.getBytes().length;
}
for (String str : stringList) {
byte[] currentByteArr = str.getBytes();
for (byte b : currentByteArr) {
byteList.add(b);
}
index++;
if (index < stringListsize) byteList.add(delimiter);
}
Byte[] byteArr = byteList.toArray(new Byte[numBytes]);
return new String(ArrayUtils.toPrimitive(byteArr));
}
qwerty123,
24 Апреля 2020
−1
- 1
https://pastebin.com/uu1YLnFD
Я хотел бы запостить целиком, да страйко сжимает булыжники.
nudop,
08 Апреля 2020
+1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
private void MainDataGridCellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
if (e.Column == MainDataGrid.Columns[1])
return;
if (CheckComplianceWithIndentation)
if ((NumberOfLeadingSpaces(Rows[e.Row.GetIndex()].OriginalText) != NumberOfLeadingSpaces(Rows[e.Row.GetIndex()].Translation)) && !Rows[e.Row.GetIndex()].Tags.Contains("I"))
Rows[e.Row.GetIndex()].Tags += "I";
else if (NumberOfLeadingSpaces(Rows[e.Row.GetIndex()].OriginalText) == NumberOfLeadingSpaces(Rows[e.Row.GetIndex()].Translation))
Rows[e.Row.GetIndex()].Tags = Rows[e.Row.GetIndex()].Tags.Replace("I", "");
if ((Rows[e.Row.GetIndex()].Translation.Trim() == "") && !Rows[e.Row.GetIndex()].Tags.Contains("N"))
Rows[e.Row.GetIndex()].Tags += "N";
else if (Rows[e.Row.GetIndex()].Translation.Trim() != "")
Rows[e.Row.GetIndex()].Tags = Rows[e.Row.GetIndex()].Tags.Replace("N", "");
//...
}
public void TagsInit()
{
if (CheckComplianceWithIndentation)
foreach (var hRow in Rows.Where(hRow => NumberOfLeadingSpaces(hRow.OriginalText) != NumberOfLeadingSpaces(hRow.Translation)))
{
hRow.Tags += "I";
}
foreach (var row in Rows.Where(hRow => hRow.Translation == ""))
{
row.Tags += "N";
}
}
Дано: C#, WPF, DataGrid, таблица.
Надо сделать: таблица имеет поля, в том числе и поле Tags, которое определяется полями Translation и OriginalText, а также настройками пользователя (CheckComplianceWithIndentation), нет бы его вынести в класс строки как геттер:
public string Tags => f(Translation, Original);
вместо:
private string _tags;
public string Tags
{
get => _tags;
set
{
_tags = value;
RaisePropertyChanged("Tags");
}
}
Так нет же, будем отлавливать изменения ячеек таблицы (MainDataGridCellEditEnding) и пересчитывать Tags. MainDataGrid.Columns[1] - это колонка с ними, прибито гвоздями в xaml: CanUserReorderColumns="False"
Эх, а еще и Trim вместо String.IsNullOrWhiteSpace.
А еще немного венгерской говнонотации (hRow).
Так я писал где-то лет 7 назад. Да, тогда стрелок не было, но они приведены в описании тупо для сокращения строк кода.
Janycz,
08 Марта 2020
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
$('#search-map').on('click', '.v-card-prev', function () {
var v_next = $(this)
.parent()
.find('.v-card-img-block .v-card-img-hidden.active')
.prev();
if ($(v_next).length == 0) {
$(this)
.parent()
.find('.v-card-img-hidden.active')
.removeClass('active');
$(this)
.parent()
.find('.v-card-img-hidden:last')
.addClass('active');
} else {
$(this)
.parent()
.find('.v-card-img-hidden.active')
.removeClass('active');
$(this)
.parent()
.find(v_next)
.addClass('active');
}
$(this)
.parent()
.find('.v-card-img-hidden.active')
.click();
});
$('#search-map').on('click', '.offers-favorite', function () {
var favorID = $(this)
.closest('.js__product')
.attr('data-item');
if ($(this).hasClass('active')) var doAction = 'delete';
else var doAction = 'add';
updateFavorite(favorID, doAction);
return false;
});
phpBidlokoder2,
18 Февраля 2020
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
ебучая ссала
case AccountStatuses.Blocked if acc.properties.get(GamStopService.GamStopVerification)
.map(_.extract[String](DefaultFormats, implicitly[Manifest[String]]))
.contains(GamStopStatus.NotPassed.toString) =>
\/.left(AuthenticationError(ErrorCodes.GamStopUnauthorized, s"GamStop validation failed"))
почему ты сука молдавская не можешь добавить метод блять а аккаунт сук ачтобы было
case AccountStatuses.Blocked if acc.contains(GamStopStatus.NotPassed) =>
\/.left(AuthenticationError(ErrorCodes.GamStopUnauthorized, s"GamStop validation failed"))
почему хуиа?
говно блять
levxxx,
21 Января 2020