- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
(define A (list 1 2 3 4 5))
(define (reverse L)
(let ((C (cdr L)))
(if (not (null? C))
(cons (reverse C) (car L))
(car L))))
(newline)
(display (reverse A))
(newline)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−1
(define A (list 1 2 3 4 5))
(define (reverse L)
(let ((C (cdr L)))
(if (not (null? C))
(cons (reverse C) (car L))
(car L))))
(newline)
(display (reverse A))
(newline)
Почему у меня получается х****й лист после реверсинга? :-(
−2
<div v-if="type" v-show="item.item.personalDiscount" class="item__price" style="background: none !important">
<span style="background: none !important">
{{ `${item.item.personalDiscount} %` }}
</span>
<span class="item__exchange">
{{ $t('pdf.personalDiscount') }} -
{{ getExchange(item.item.personalDiscountFinal) }}
</span>
</div>
<div v-if="type" class="item__totalPriceContainer">
<span class="item__totalPrice">{{ $t('pdf.itemTotal') }}:</span>
<div class="item__price">
<span>{{ getTotalOneCartPrice(item.item) }}</span>
<span class="item__exchange">
{{ $t('pdf.vat') }} —
{{
getOneCartTotalPriceExchangeNDS(
item.item.nds,
item.item.basketPriceExchange
)
}}
</span>
</div>
</div>
vue js
−3
ТОРПЕДО ВПЕРДЕ
)
−2
SELECT
DISTINCT customer_contracts_ref._Description AS Номер_договора,
CAST(dateadd(year, -2000, customer_contracts_ref._Fld418) as date) AS Дата_договора,
TSBO_ref._Description AS ЦБО,
trade_for_service._Number AS Номер_сделки,
CAST(dateadd(year, -2000, customer_contracts_ref._Fld419) as date) AS Дата_сделки,
service_ref._Description AS Вид_услуги,
ISNULL(trade_for_service._Fld7941, 0) AS Сумма_сделки,
ISNULL(STUFF(
(SELECT ', ', _Number as [text()]
FROM MTCKCenter.dbo._Document129 implementation_service_2
WHERE implementation_service._Fld2613RRef = implementation_service_2._Fld2613RRef
FOR XML PATH ('')), 1, 1, ''), 'ОТСУТСТВУЕТ') AS Номер_реализации,
ISNULL(STUFF(
(SELECT ', ',CAST(dateadd(year, -2000, trade_for_service._Fld16346) as date) as [text()]
FROM MTCKCenter.dbo._Document129 implementation_service_2
WHERE implementation_service._Fld2613RRef = implementation_service_2._Fld2613RRef
FOR XML PATH ('')), 1, 1, ''), '-') AS Дата_реализации,
CAST(customer_ref._Description as varchar(50)) AS Контрагент,
CASE trade_for_service._Fld9233
WHEN 0
THEN 'нет'
ELSE 'да'
END AS УТП_сделка,
CASE implementation_service._Fld8224
WHEN 0
THEN 'да'
ELSE 'нет'
END AS УТП_реализация,
CASE
WHEN implementation_service._Fld8224 = 0
THEN SUM(ISNULL(CAST(implementation_service._Fld2632 as money), 0))
ELSE '-'
END AS Сумма_УТП,
ISNULL(shopping._Fld1772,0) AS Сумма_оплаты_плюс,
FROM
MTCKCenter.dbo._Document7939 trade_for_service
JOIN MTCKCenter.dbo._Reference29 customer_contracts_ref
ON trade_for_service._Fld7945RRef = customer_contracts_ref._IDRRef
JOIN MTCKCenter.dbo._Reference90 service_ref
ON trade_for_service._Fld7942RRef = service_ref._IDRRef
JOIN MTCKCenter.dbo._Reference93 TSBO_ref
ON trade_for_service._Fld7947RRef = TSBO_ref._IDRRef
LEFT JOIN MTCKCenter.dbo._Document129 implementation_service
ON trade_for_service._Fld7945RRef = implementation_service._Fld2613RRef
JOIN MTCKCenter.dbo._Reference44 customer_ref
ON trade_for_service._Fld7944RRef = customer_ref._IDRRef
LEFT JOIN MTCKCenter.dbo._Document115 shopping
ON trade_for_service._Fld7945RRef = shopping._Fld1749RRef
LEFT JOIN MTCKCenter.dbo._Document104_VT1460 corrections1
ON trade_for_service._Fld7945RRef = corrections1._Fld1463RRef
LEFT JOIN MTCKCenter.dbo._Document104_VT1476 corrections2
ON trade_for_service._Fld7945RRef = corrections2._Fld1479RRef
LEFT JOIN MTCKCenter.dbo._Document98 refunds
ON trade_for_service._Fld7944RRef = refunds._Fld1199RRef
LEFT JOIN MTCKCenter.dbo._Document133_VT2880 write_off_to_
ON trade_for_service._Fld7945RRef = write_off_to_._Fld5602_RRRef
WHERE
(_Fld7942RRef=0x9C8F02DA550767D34576572C765E712A -- уменьшение стоимости авто
OR _Fld7942RRef=0xB999001DD8B71C2811EA5143E3D901D3) -- доплата за а/м
AND service_ref._Marked = 0x00
AND trade_for_service._Posted = 0x01
GROUP BY customer_contracts_ref._Description, trade_for_service._Posted,
customer_contracts_ref._Fld418, customer_contracts_ref._Fld419,
TSBO_ref._Description, service_ref._Description,
shopping._Fld1772, trade_for_service._Fld7941,
implementation_service._Fld2613RRef,
trade_for_service._Fld16346, customer_ref._Description,
trade_for_service._Fld9233, implementation_service._Fld8224,
implementation_service._Fld2632, trade_for_service._Fld8413,
corrections1._Fld8389, corrections2._Fld8390,
refunds._Fld1221, write_off_to_._Fld2887,
write_off_to_._Fld2888, trade_for_service._Number
Здравия всем желающим понюхать эту реальную кучу!
Есть БД, в которую данные заносились на похуй абсолютно.
Пример:
Номер_договора | Номер_сделки | Номер_реализации | Сумма_залупа | Сумма_кастюма | Сумма_второй_палочки_твикс |....|...|...|...|...|
а б в 300 3414 123424
а б в 300 3414 123424
г д е 134 154 17
г д ж 213 3903 125627
г д ж 213 13.151123151 125627
!ЗАДАЧА!
Надо выгрузить таблицу, в которой будут
1. ДИСТИНКТ номер_договора, дата_договора,
2. ДИСТИНКТ номер_сделки, дата_сделки (1 договор = 1 сделка),
3. ЧЕРЕЗ ЗАПЯТУЮ В 1ой ЯЧЕЙКЕ номер_реализации, дата_реализации (в одной сделке их может быть больше 1),
4. Запилить оконную функцию, кейс, или че нахуй угодно(я месяц работаю, до этого тыкал сиквел в вузе тока,
поэтому возможно просто не вижу более адекватное решение), которые
будут СУММИРОВАТЬ сумму_залупу, если у нее по 1 договору несколько РАЗНЫХ значений, и другие суммы,
или ВЫБИРАТЬ только одно значение, если они одинаковые по 1 договору.
1, 2, 3 пункты коряво, но разобрался. Зделал)
На 4ом жоско хочется пробить башней стену, вообще не понимаю, как это написать нормально.
−2
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Scanner;
import java.util.zip.*;
import java.io.*;
public class CitiesPrinter {
public static void main(String[] args) throws IOException {
final String fileName = "/storage/emulated/0/Documents/Jvdroid/single-files/_данные_Сбер_Java_20210407090226.zip";
try(ZipInputStream unzipping = new ZipInputStream(new FileInputStream(fileName)));
{
ZipEntry entry = null;
String name = null;
long size = 0;
while((entry=unzipping.getNextEntry())!= null) {
name = entry.getName();
size = entry.getSize();
System.out.println("FileName: " + name + "FileSize: " + size);
FileOutputStream unzippedFile = new FileOutputStream("/storage/emulated/0/Documents/Jvdroid/single-files/new" + name);
for (int c = unzipping.read(); c != -1; c = unzipping.read()) {
unzippedFile.write(c);
}
unzippedFile.flush();
unzipping.closeEntry();
unzippedFile.close();
}
}
catch(Exception e){
System.out.println(e.getMessage());
}
Path path = Paths.get(fileName);
Scanner scanner = new Scanner(path);
scanner.useDelimiter(System.getProperty("line.separator"));
while(scanner.hasNext()){
System.out.println("Строка: " + scanner.next());
}
scanner.close();
scanner = new Scanner(Paths.get("/storage/emulated/0/Documents/Jvdroid/single-files/_данные_Сбер_Java_20210407090226.zip/city_ru.csv"));
scanner.useDelimiter(System.getProperty("line.separator"));
while(scanner.hasNext()){
Employee emp = parseCSVLine(scanner.next());
System.out.println(emp.toString());
}
scanner.close();
scanner = new Scanner(System.in);
System.out.println("Вводим первое слово: " + scanner.next());
}
private static Employee parseCSVLine(String line) {
Scanner scanner = new Scanner(line);
scanner.useDelimiter("\\s*,\\s*");
String name = scanner.next();
int age = scanner.nextInt();
String gender = scanner.next();
CitiesPrinter jfs = new CitiesPrinter();
return jfs.new Employee(name, age, gender);
}
}
class Employee{
private String name;
private int age;
private String gender;
public Employee(String n, int a, String gen){
this.name = n;
this.age = a;
this.gender = gen;
}
@Override
public String toString(){
return "Name=" + this.name + "::Age=" + this.age + "::Gender=" + this.gender;
}
}
Что не так?
−1
/// <summary>
/// Converts an object to null. Returns null.
/// </summary>
public static object ToNull(this object value)
{
return null;
}
Индийский extension
−2
a := []string{"Yandex.ru","mos.ru","sberbank.ru"}
kkk
0
Праизвадительнасть труда kodemonkey можна зафорсить, если запелить несколька курсорав.
Чем больше курсорав - тем вышы праизвадительнасть
0
IT Оффтоп #167
#137: https://govnokod.ru/27857 https://govnokod.xyz/_27857
#138: https://govnokod.ru/27867 https://govnokod.xyz/_27867
#139: https://govnokod.ru/27887 https://govnokod.xyz/_27887
#140: https://govnokod.ru/27900 https://govnokod.xyz/_27900
#141: https://govnokod.ru/27914 https://govnokod.xyz/_27914
#142: https://govnokod.ru/27942 https://govnokod.xyz/_27942
#143: https://govnokod.ru/27960 https://govnokod.xyz/_27960
#144: https://govnokod.ru/27972 https://govnokod.xyz/_27972
#145: https://govnokod.ru/27996 https://govnokod.xyz/_27996
#146: https://govnokod.ru/28008 https://govnokod.xyz/_28008
#147: https://govnokod.ru/28049 https://govnokod.xyz/_28049
#148: https://govnokod.ru/28087 https://govnokod.xyz/_28087
#149: https://govnokod.ru/28136 https://govnokod.xyz/_28136
#150: https://govnokod.ru/28157 https://govnokod.xyz/_28157
#151: https://govnokod.ru/28209 https://govnokod.xyz/_28209
#152: https://govnokod.ru/28217 https://govnokod.xyz/_28217
#153: https://govnokod.ru/28232 https://govnokod.xyz/_28232
#154: https://govnokod.ru/28275 https://govnokod.xyz/_28275
#155: https://govnokod.ru/28281 https://govnokod.xyz/_28281
#156: https://govnokod.ru/28322 https://govnokod.xyz/_28322
#157: https://govnokod.ru/28344 https://govnokod.xyz/_28344
#158: https://govnokod.ru/28366 https://govnokod.xyz/_28366
#159: https://govnokod.ru/28391 https://govnokod.xyz/_28391
#160: https://govnokod.ru/28434 https://govnokod.xyz/_28434
#161: https://govnokod.ru/28449 https://govnokod.xyz/_28449
#162: https://govnokod.ru/28477 https://govnokod.xyz/_28477
#163: https://govnokod.ru/28501 https://govnokod.xyz/_28501
#164: https://govnokod.ru/28527 https://govnokod.xyz/_28527
#165: https://govnokod.ru/28557 https://govnokod.xyz/_28557
#166: https://govnokod.ru/28574 https://govnokod.xyz/_28574
0
curl -fsSL https://deno.land/x/install/install.sh | sh
Хи-хи-хи