- 1
- 2
public ArgumentException (string? message, string? paramName);
public ArgumentNullException (string? paramName, string? message);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 34
0
public ArgumentException (string? message, string? paramName);
public ArgumentNullException (string? paramName, string? message);
https://learn.microsoft.com/en-us/dotnet/api/system.argumentexception.-ctor?view=net-7.0#system-argumentexception-ctor(system-string-system-string)
https://learn.microsoft.com/en-us/dotnet/api/system.argumentnullexception.-ctor?view=net-7.0#system-argumentnullexception-ctor(system-string-system-string)
0
@dataclass(slots=True)
class Govno:
govno_index: int
def patch(self, indices_dict: Dict[int, int]) -> None:
new_index = indices_dict[self.govno_index]
self.govno_index = new_index
@dataclass(slots=True)
class Mocha:
mocha_index: int
def patch(self, indices_dict: Dict[int, int]) -> None:
new_index = indices_dict[self.govno_index]
self.govno_index = new_index
Метод «patch» был скопипащен из класса «Govno» в класс «Mocha». Тайпчекер никаких ошибок не показывал; все типы были выведены корректно.
А в рантайме всё упало, что и неудивительно!
0
if (this.$arg0 == 'inc') this.$ret = this.$math = args[0] + 1;
if (this.$arg0 == 'dec') this.$ret = this.$math = args[0] - 1;
if (this.$arg0 == 'div') this.$ret = this.$math = args[0] / args[1];
if (this.$arg0 == 'ceil') this.$ret = this.$math = Math.ceil(args[0]);
if (this.$arg0 == 'floor') this.$ret = this.$math = Math.floor(args[0]);
if (this.$arg0 == 'sqrt') this.$ret = this.$math = Math.sqrt(args[0]);
if (this.$arg0 == 'exp') this.$ret = this.$math = Math.exp(args[0]);
if (this.$arg0 == 'log') this.$ret = this.$math = Math.log(args[0]);
if (this.$arg0 == 'sin') this.$ret = this.$math = Math.sign(args[0]);
if (this.$arg0 == 'log10') this.$ret = this.$math = Math.log10(args[0]);
if (this.$arg0 == 'cos') this.$ret = this.$math = Math.cos(args[0]);
if (this.$arg0 == 'tan') this.$ret = this.$math = Math.tan(args[0]);
if (this.$arg0 == 'acos') this.$ret = this.$math = Math.acos(args[0]);
if (this.$arg0 == 'atan') this.$ret = this.$math = Math.atan(args[0]);
if (this.$arg0 == 'round') this.$ret = this.$math = Math.round(args[0]);
if (this.$arg0 == 'atan2') this.$ret = this.$math = Math.atan2(args[0]);
Исходный код интерпретатора компилятора (!) Языка Программирования «AsmX».
https://github.com/langprogramming-AsmX/AsmX/blob/main/compiler.js#L215
0
AttributeError: type object 'datetime.datetime' has no attribute 'from_timestamp'. Did you mean: 'fromtimestamp'?
−1
std::int32_t(v8::Maybe<std::int32_t>::* maybe_from_just)() && = v8::Maybe<std::int32_t>::FromJust;
−3
Public Function DescendingSort(ByRef Data As Variant) As Variant
Dim i As Long
For i = LBound(Data) To UBound(Data) - 1
Dim j As Long
For j = i + 1 To UBound(Data)
If Data(i) < Data(j) Then
Dim Temp As Variant
Temp = Data(j)
Data(j) = Data(i)
Data(i) = Temp
End If
Next
Next
DescendingSort = Data
End Function
Вот все спрашивают, зачем на собеседованиях требуют сортировки писать — так вот для этого! Вдруг вам придётся писать на «VBA»?
> Как в VBA правильно создавать одномерный массив. ArrayList
https://habr.com/ru/post/712000/
+1
static private Double getHashString(String string, Integer foundation){
Double hash = 0.0 ;
short [] charsToInteger = getCharArray(string);
double step = Double.MAX_VALUE / 256 - foundation;
for (int i = 0; i < charsToInteger.length ; i++ ){
hash += charsToInteger[i] * step;
step = step / 2 - 1;
}
return hash;
}
static private short [] getCharArray(String string){
char [] chars = string.toLowerCase().toCharArray();
short [] bytes = new short [chars.length];
for (int i = 0; i < chars.length; i++){
bytes [i] = (short) (chars[i] & 0x00FF);
//System.out.println("bytes [" + i + "] = " + bytes[i]);
}
return bytes;
}
Вычисление сигнатуры строки для её применения в сортировке строк в алфавитном порядке по всем символам
https://habr.com/ru/post/709406/ / https://itnan.ru/post.php?c=1&p=709406
https://github.com/Helgi-cell/HashStringAlphabetical
0
table inet filter {
set open_ports {
type inet_proto . inet_service
counter
elements = { tcp . 123 counter packets 0 bytes 0,
udp . 123 counter packets 0 bytes 0,
tcp . 456 counter packets 0 bytes 0,
tcp . 567 counter packets 0 bytes 0 }
}
chain input {
type filter hook input priority filter; policy drop;
iifname "eth*" ct state established,related accept
iifname "eth*" ct state invalid drop
iifname "eth*" ct state new meta l4proto . th dport @open_ports accept
}
}
«nftables» — охуенны.
0
YAML:
- 0:00
- 01:00
- 12:34
yaml2json.hs
["0:00","01:00","12:34"]
yaml2json.pl
["0:00","01:00","12:34"]
yaml2json.py
["0:00", "01:00", 754]
yaml2json.rb
[0,3600,45240]
rq
["0:00","01:00","12:34"]
https://github.com/cblp/yaml-sucks
0
const govnoMochi = `$mocha.govno` ?? "Ваше говно не определено";