-
+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
- 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
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
if ($arItem['OFFERS_PROPS_DISPLAY']) {
foreach ($arItem['JS_OFFERS'] as $keyOffer => $arJSOffer) {
$strProps = '';
if (!empty($arJSOffer['DISPLAY_PROPERTIES'])) {
foreach ($arJSOffer['DISPLAY_PROPERTIES'] as $arOneProp) {
$strProps .= '<br>'.$arOneProp['NAME'].' <strong>'.(
is_array($arOneProp['VALUE'])
? implode(' / ', $arOneProp['VALUE'])
: $arOneProp['VALUE']
).'</strong>';
}
}
$arItem['JS_OFFERS'][$keyOffer]['DISPLAY_PROPERTIES'] = $strProps;
}
}
foreach ($arItem['JS_OFFERS'] as $keyOffer => $arJSOffer) {
if ($arItem['PROPERTIES']['OLD_PRICE']['VALUE'] > 0 &&
$arItem['PROPERTIES']['OLD_PRICE']['ACTIVE'] == 'Y' &&
($arItem['PROPERTIES']['OLD_PRICE']['VALUE'] * $arItem['OFFERS'][$keyOffer]['CATALOG_MEASURE_RATIO']) > $arItem['JS_OFFERS'][$keyOffer]['PRICE']['VALUE']) {
$arItem['JS_OFFERS'][$keyOffer]['PRICE']['VALUE'] = $arItem['PROPERTIES']['OLD_PRICE']['VALUE'] * $arItem['OFFERS'][$keyOffer]['CATALOG_MEASURE_RATIO'];
$arItem['JS_OFFERS'][$keyOffer]['PRICE']['PRINT_VALUE'] = CCurrencyLang::CurrencyFormat($arItem['JS_OFFERS'][$keyOffer]['PRICE']['VALUE'], $arItem['JS_OFFERS'][$keyOffer]['PRICE']['CURRENCY']);
}
$maxItemPriceValue = ($arItem['JS_OFFERS'][$keyOffer]['PRICE']['VALUE'] > $maxBasisPriceValue) ? $arItem['JS_OFFERS'][$keyOffer]['PRICE']['VALUE'] : $maxBasisPriceValue;
$discount = $maxItemPriceValue - $arItem['JS_OFFERS'][$keyOffer]['PRICE']['DISCOUNT_VALUE'];
$arItem['JS_OFFERS'][$keyOffer]['PRICE']['VALUE'] = $maxItemPriceValue;
$arItem['JS_OFFERS'][$keyOffer]['PRICE']['ECONOMY'] = $discount;
$arItem['JS_OFFERS'][$keyOffer]['BASIS_PRICE']['VALUE'] = $maxItemPriceValue / $arItem['OFFERS'][$keyOffer]['CATALOG_MEASURE_RATIO'];
$arItem['JS_OFFERS'][$keyOffer]['BASIS_PRICE']['ECONOMY'] = $discount / $arItem['OFFERS'][$keyOffer]['CATALOG_MEASURE_RATIO'];
$arItem['JS_OFFERS'][$keyOffer]['BASIS_PRICE']['CATALOG_MEASURE_RATIO'] = $arItem['OFFERS'][$keyOffer]['CATALOG_MEASURE_RATIO'];
if ($isPriceMulty && count($arItem['OFFERS'][$keyOffer]['PRICES']) > 1 && (!$arParams['TAB_TYPE'] || ($arResult['IS_SHOW_LARGE_PREVIEW'] && !in_array('prodday', $itemType) && !in_array('action', $itemType)))) {
$iPrice = 0;
$maxBasisItemPriceValue = $maxBasisPriceValue / $arItem['OFFERS'][$keyOffer]['CATALOG_MEASURE_RATIO'];
foreach($arItem['OFFERS'][$keyOffer]['PRICES'] as $arPrice) {
$maxItemPriceValue = ($arPrice['VALUE'] > $maxBasisItemPriceValue) ? $arPrice['VALUE'] : $maxBasisItemPriceValue;
$arItem['JS_OFFERS'][$keyOffer]['PRICE']['PRICES'][$iPrice]['TITLE'] = $arItem['OFFERS'][$keyOffer]['CATALOG_GROUP_NAME_' . $arPrice['PRICE_ID']];
$arItem['JS_OFFERS'][$keyOffer]['PRICE']['PRICES'][$iPrice]['DISCOUNT_VALUE'] = $arPrice['DISCOUNT_VALUE'];
$arItem['JS_OFFERS'][$keyOffer]['PRICE']['PRICES'][$iPrice]['VALUE'] = $maxItemPriceValue;
$arItem['JS_OFFERS'][$keyOffer]['PRICE']['PRICES'][$iPrice]['ECONOMY'] = $maxItemPriceValue - $arPrice['DISCOUNT_VALUE'];
$arItem['JS_OFFERS'][$keyOffer]['PRICE']['PRICES'][$iPrice]['CURRENCY'] = $arPrice['CURRENCY'];
$arItem['JS_OFFERS'][$keyOffer]['PRICE']['PRICES'][$iPrice]['CATALOG_MEASURE_RATIO'] = $arItem['OFFERS'][$keyOffer]['CATALOG_MEASURE_RATIO'];
$arItem['JS_OFFERS'][$keyOffer]['BASIS_PRICE']['PRICES'][$iPrice]['TITLE'] = $arItem['OFFERS'][$keyOffer]['CATALOG_GROUP_NAME_' . $arPrice['PRICE_ID']];
$arItem['JS_OFFERS'][$keyOffer]['BASIS_PRICE']['PRICES'][$iPrice]['DISCOUNT_VALUE'] = $arPrice['DISCOUNT_VALUE'];
$arItem['JS_OFFERS'][$keyOffer]['BASIS_PRICE']['PRICES'][$iPrice]['VALUE'] = $maxItemPriceValue;
$arItem['JS_OFFERS'][$keyOffer]['BASIS_PRICE']['PRICES'][$iPrice]['ECONOMY'] = $maxItemPriceValue - $arPrice['DISCOUNT_VALUE'];
$arItem['JS_OFFERS'][$keyOffer]['BASIS_PRICE']['PRICES'][$iPrice]['CURRENCY'] = $arPrice['CURRENCY'];
$arItem['JS_OFFERS'][$keyOffer]['BASIS_PRICE']['PRICES'][$iPrice]['CATALOG_MEASURE_RATIO'] = $arItem['OFFERS'][$keyOffer]['CATALOG_MEASURE_RATIO'];
$iPrice++;
}
}
}
js прайс ?
phpBidlokoder2,
01 Июня 2020
-
0
- 1
- 2
- 3
- 4
- 5
- 6
func GetUser() *User {
defer func() {
time.Sleep(100 * time.Millisecond)
}()
return &User{}
}
Паттерн: поработал - отдохни.
Pattern: worked hard - have a rest
anon007,
01 Июня 2020
-
+1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
func (svc *UserSvc) isEmptyName(name model.User_Name) bool {
if name.First.RU == "" {
if name.First.EN == "" {
if name.First.TR == "" {
if name.First.IT == "" {
if name.Last.RU == "" {
if name.Last.EN == "" {
if name.Last.TR == "" {
if name.Last.IT == "" {
return true
}
}
}
}
}
}
}
}
return false
}
Проверка заполненности имени пользователя хотя - бы на одном из языков.
anon007,
01 Июня 2020
-
−4
Oleg4260,
01 Июня 2020
-
+1
- 1
- 2
- 3
- 4
http://lhohq.info/
http://www.lhohq.info/lhohq_android.html
http://octagon.lhohq.info/exploit-nomophobia.html
http://phonograph.lhohq.info/
Безумбреции / шизофреции с легким оттенком конардио
Давненько не появлялось хорошего соперника DBУNOГUM
Fike,
31 Мая 2020
-
+1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
class Values<T> {
T data;
Values() {}
Values(T data) {this.setData(data);}
public void setData(T data) {this.data = data;}
public T getData() {return this.data;}
}
public class Main {
public static void main(String[] args) {
Values[][] item = new Values[3][2];
item[0][0] = new Values("grapes");
item[0][1] = new Values(1);
item[1][0] = new Values("apples");
item[1][1] = new Values(1);
item[2][0] = new Values("peaches");
item[2][1] = new Values(1);
}
}
>>> кто меня интервьюировал на позицию Staff Engineer? Junior?
>>>
1. Если покупатель купит больше одного яблока,
то он получит скидку 20% на все яблоки в корзине;
2. Если покупатель купит пакет винограда, то второй пакет
он получит бесплатно.
Итог: посчитать стоимость корзины покупателя при выходе из магазина,
при то, что данные даны в следующем виде:
[["grapes", 1],["apples", 0],["peaches", 1]] => 12
[["grapes", 1],["apples", 1],["peaches", 1]] => 15 ...
https://habr.com/post/504638
Бля-я-я-я, это просто феерия! 1024--, зацени статью, ты оценишь!
gost,
31 Мая 2020
-
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
a1=[gg for gg in range( 1, 9+ 1 , 1) ]
b1='';b2=""
for a in a1:
for A1 in a1:
b1=b1 + str(a)+'*' + str(A1)+ '=' +'%s' %str(int( a )* int(A1 ) )+" "
b2+=b1+ '\n'
del b1; b1=''
print(f'{b2}' )
ТаблицаУмножения
mosni,
30 Мая 2020
-
+2
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
def get_build_version():
"""Return the version of MSVC that was used to build Python.
For Python 2.3 and up, the version number is included in
sys.version. For earlier versions, assume the compiler is MSVC 6.
"""
prefix = "MSC v."
i = sys.version.find(prefix)
if i == -1:
return 6
i = i + len(prefix)
s, rest = sys.version[i:].split(" ", 1)
majorVersion = int(s[:-2]) - 6
if majorVersion >= 13:
# v13 was skipped and should be v14
majorVersion += 1
minorVersion = int(s[2:3]) / 10.0
# I don't think paths are affected by minor version in version 6
if majorVersion == 6:
minorVersion = 0
if majorVersion >= 6:
return majorVersion + minorVersion
# else we don't know what version of the compiler this is
return None
Определение версии конпелятора, которой был собран «CPython».
TEH3OPHblu_nemyx,
30 Мая 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
IT Оффтоп #48
#1: https://govnokod.ru/18142 https://govnokod.xyz/_18142
#2: https://govnokod.ru/18378 https://govnokod.xyz/_18378
#3: https://govnokod.ru/19667 https://govnokod.xyz/_19667
#4: https://govnokod.ru/21160 https://govnokod.xyz/_21160
#5: https://govnokod.ru/21772 https://govnokod.xyz/_21772
#6: (vanished) https://govnokod.xyz/_24063
#7: https://govnokod.ru/24538 https://govnokod.xyz/_24538
#8: (vanished) https://govnokod.xyz/_24815
#9: https://govnokod.ru/24867 https://govnokod.xyz/_24867
#10: https://govnokod.ru/25328 https://govnokod.xyz/_25328
#11: (vanished) https://govnokod.xyz/_25436
#12: (vanished) https://govnokod.xyz/_25471
#13: (vanished) https://govnokod.xyz/_25590
#14: https://govnokod.ru/25684 https://govnokod.xyz/_25684
#15: https://govnokod.ru/25694 https://govnokod.xyz/_25694
#16: https://govnokod.ru/25725 https://govnokod.xyz/_25725
#17: https://govnokod.ru/25731 https://govnokod.xyz/_25731
#18: https://govnokod.ru/25762 https://govnokod.xyz/_25762
#19: https://govnokod.ru/25767 https://govnokod.xyz/_25767
#20: https://govnokod.ru/25776 https://govnokod.xyz/_25776
#21: https://govnokod.ru/25798 https://govnokod.xyz/_25798
#22: https://govnokod.ru/25811 https://govnokod.xyz/_25811
#23: https://govnokod.ru/25863 https://govnokod.xyz/_25863
#24: https://govnokod.ru/25941 https://govnokod.xyz/_25941
#25: https://govnokod.ru/26026 https://govnokod.xyz/_26026
#26: https://govnokod.ru/26050 https://govnokod.xyz/_26050
#27: https://govnokod.ru/26340 https://govnokod.xyz/_26340
#28: https://govnokod.ru/26372 https://govnokod.xyz/_26372
#29: https://govnokod.ru/26385 https://govnokod.xyz/_26385
#30: https://govnokod.ru/26413 https://govnokod.xyz/_26413
#31: https://govnokod.ru/26423 https://govnokod.xyz/_26423
#32: https://govnokod.ru/26440 https://govnokod.xyz/_26440
#33: https://govnokod.ru/26449 https://govnokod.xyz/_26449
#34: https://govnokod.ru/26456 https://govnokod.xyz/_26456
#35: https://govnokod.ru/26463 https://govnokod.xyz/_26463
#36: https://govnokod.ru/26508 https://govnokod.xyz/_26508
#37: https://govnokod.ru/26524 https://govnokod.xyz/_26524
#38: https://govnokod.ru/26539 https://govnokod.xyz/_26539
#39: https://govnokod.ru/26556 https://govnokod.xyz/_26556
#40: https://govnokod.ru/26568 https://govnokod.xyz/_26568
#41: https://govnokod.ru/26589 https://govnokod.xyz/_26589
#42: https://govnokod.ru/26600 https://govnokod.xyz/_26600
#43: https://govnokod.ru/26604 https://govnokod.xyz/_26604
#44: https://govnokod.ru/26627 https://govnokod.xyz/_26627
#45: https://govnokod.ru/26635 https://govnokod.xyz/_26635
#46: (vanished) https://govnokod.xyz/_26646
#46: (vanished) https://govnokod.xyz/_26654
#47: https://govnokod.ru/26671 https://govnokod.xyz/_26671
baropinho,
30 Мая 2020