- 1
Борманд, у тебя спина рыжая!
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
Борманд, у тебя спина рыжая!
Ха-ха, я пошутил, с первым апреля )))
0
#define CONSTRUCT_JUMP(name_, opcode_) else if(mnemonic.name == #name_) \
subcompileMnemonic(mnemonic, {\
{constructDescription(CONSTANT), opcode_},\
{constructDescription(LABEL), opcode_}})
CONSTRUCT_JUMP(JMP, JMP);
CONSTRUCT_JUMP(JE, JZ);
CONSTRUCT_JUMP(JZ, JZ);
CONSTRUCT_JUMP(JNZ, JNZ);
CONSTRUCT_JUMP(JNE, JNZ);
CONSTRUCT_JUMP(JG, JG);
CONSTRUCT_JUMP(JNLE, JG);
CONSTRUCT_JUMP(JNLZ, JG);
CONSTRUCT_JUMP(JLE, JNG);
CONSTRUCT_JUMP(JLZ, JNG);
CONSTRUCT_JUMP(JNG, JNG);
CONSTRUCT_JUMP(JGE, JGZ);
CONSTRUCT_JUMP(JGZ, JGZ);
CONSTRUCT_JUMP(JNL, JGZ);
CONSTRUCT_JUMP(JNGZ, JL);
CONSTRUCT_JUMP(JNGE, JL);
CONSTRUCT_JUMP(JL , JL);
CONSTRUCT_JUMP(JB, JB);
CONSTRUCT_JUMP(JNAE, JB);
CONSTRUCT_JUMP(JNAZ, JB);
CONSTRUCT_JUMP(JC, JB);
CONSTRUCT_JUMP(JNB, JNB);
CONSTRUCT_JUMP(JAE, JNB);
CONSTRUCT_JUMP(JAZ, JNB);
CONSTRUCT_JUMP(JNC, JNB);
CONSTRUCT_JUMP(JBE, JBZ);
CONSTRUCT_JUMP(JBZ, JBZ);
CONSTRUCT_JUMP(JNA, JBZ);
CONSTRUCT_JUMP(JA, JA);
CONSTRUCT_JUMP(JNBE, JA);
CONSTRUCT_JUMP(JNBZ, JA);
CONSTRUCT_JUMP(CALL, CALL);
#undef CONSTRUCT_JUMP
0
interface Animal {
live(): void;
}
interface Dog extends Animal {
woof(): void;
}
type Example1 = Dog extends Animal ? number : string;
type Example2 = RegExp extends Animal ? number : string;
function main() {
let a: Example1;
a = 10.0;
print(a);
let b: Example2;
b = "asd";
print(b);
print("done.");
}
"Условные типа" подвезли.... ура ... теперь можно всякую х. наговнокодить..
+2
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <limits.h>
typedef unsigned __int128 uint128_t;
typedef __int128 int128_t;
// в чем тут по-вашему баг ?
uint64_t add1bit_left_1_bug(const uint64_t a, int shift)
{
return ~(~(a << shift) >> shift);
}
uint64_t add1bit_left_1(const uint64_t a, int shift)
{
return ~((uint128_t)~(uint64_t)((uint128_t)a << shift) >> shift);
}
// или тут ?
uint64_t add1bit_left_2_bug(const uint64_t a, int shift)
{
return a | (uint64_t)(UINT64_MAX << (CHAR_BIT * sizeof(uint64_t) - shift));
}
uint64_t add1bit_left_2(const uint64_t a, int shift)
{
return a | (uint64_t)((uint128_t)-1 << (CHAR_BIT * sizeof(uint64_t) - shift));
}
uint64_t add1bit_left_3(const uint64_t a, int shift)
{
if (shift == 0) return a;
return (uint64_t)((int64_t)((a << (shift-1)) | ((uint64_t)1 << (CHAR_BIT * sizeof(uint64_t) - 1)) ) >> (shift-1)); // а тут вообще UB
}
int main(void)
{
// tests
for (int i = 0; i <= 64; i++) // пробуем сдвигать от 0 до 64 включительно.
{
// for (uint128_t j = 0; j < UINT64_MAX+1; j++) - какая формальная верификация )))
for (uint64_t j = 0; j < 100; j++)
{
if (add1bit_left_1(j,i) != add1bit_left_2(j,i))
{
printf("error1\n");
printf("%" PRIu64 " %d\n", j,i);
return EXIT_FAILURE;
}
if (add1bit_left_1(j,i) != add1bit_left_3(j,i))
printf("error2\n");
if (add1bit_left_2(j,i) != add1bit_left_3(j,i))
printf("error3\n");
}
}
printf("%" PRIX64 "\n", add1bit_left_1(0,0));
printf("%" PRIX64 "\n", add1bit_left_2(0,0));
printf("%" PRIX64 "\n", add1bit_left_3(0,0));
printf("%" PRIX64 " - bug\n", add1bit_left_1_bug(0,0));
printf("%" PRIX64 " - bug\n", add1bit_left_2_bug(0,0));
puts("");
printf("%" PRIX64 "\n", add1bit_left_1(0,1));
printf("%" PRIX64 "\n", add1bit_left_2(0,1));
printf("%" PRIX64 "\n", add1bit_left_3(0,1));
printf("%" PRIX64 " - bug\n", add1bit_left_1_bug(0,1));
printf("%" PRIX64 " - bug\n", add1bit_left_2_bug(0,1));
puts("");
printf("%" PRIX64 "\n", add1bit_left_1(0,2));
printf("%" PRIX64 "\n", add1bit_left_2(0,2));
printf("%" PRIX64 "\n", add1bit_left_3(0,2));
printf("%" PRIX64 " - bug\n", add1bit_left_2_bug(0,2));
printf("%" PRIX64 " - bug\n", add1bit_left_2_bug(0,2));
puts("");
printf("%" PRIX64 "\n", add1bit_left_1(0,64));
printf("%" PRIX64 "\n", add1bit_left_2(0,64));
printf("%" PRIX64 "\n", add1bit_left_3(0,64));
printf("%" PRIX64 " - bug\n", add1bit_left_1_bug(0,64));
printf("%" PRIX64 " - bug\n", add1bit_left_2_bug(0,64));
return EXIT_SUCCESS;
}
Вореанты говнофункции, которая сдвигает влево uint64_t но набрасывает единички вместо ноликов.
+1
if (op.size() == 1)
{
if (op[0].id == LexemID::REGISTER)
{
if (isSIBbase(registerName2registerId.at( std::get<std::string>(op[0].lexemas))))
mnemonic.mnemonics.emplace_back(IndirectAddress{
.base = Register(std::get<std::string>(op[0].lexemas))
});
else
mnemonic.mnemonics.emplace_back(IndirectAddress{
.index = Register(std::get<std::string>(op[0].lexemas))
});
}
else if (op[0].id == LexemID::LABEL_USE)
mnemonic.mnemonics.emplace_back(IndirectAddress{
.disp = LabelUse(std::get<std::string>(op[0].lexemas))
});
else if (op[0].id == LexemID::NUMBER)
mnemonic.mnemonics.emplace_back(IndirectAddress{
.disp = Constant(std::get<int>(op[0].lexemas))
});
}
else if (op.size() == 3)
{
if (const auto operation = std::get<std::string>(op[1].lexemas)[0]; operation == '+')
{
if (op[0].id == LexemID::REGISTER && op[2].id == LexemID::REGISTER)
{
if (isSIBbase(registerName2registerId.at(std::get<std::string>(op[0].lexemas))))
mnemonic.mnemonics.emplace_back(IndirectAddress{
.base = Register(std::get<std::string>(op[0].lexemas)),
.index = Register(std::get<std::string>(op[2].lexemas))
});
else
mnemonic.mnemonics.emplace_back(IndirectAddress{
.base = Register(std::get<std::string>(op[2].lexemas)),
.index = Register(std::get<std::string>(op[0].lexemas))
});
}
else if (op[0].id == LexemID::REGISTER && op[2].id == LexemID::NUMBER)
{
if (isSIBbase(registerName2registerId.at(std::get<std::string>(op[0].lexemas))))
mnemonic.mnemonics.emplace_back(IndirectAddress{
.base = Register(std::get<std::string>(op[0].lexemas)),
.disp = Constant(std::get<int>(op[2].lexemas))
});
else
mnemonic.mnemonics.emplace_back(IndirectAddress{
.index = Register(std::get<std::string>(op[0].lexemas)),
.disp = Constant(std::get<int>(op[2].lexemas))
});
}
else if (op[0].id == LexemID::REGISTER && op[2].id == LexemID::LABEL_USE)
{
if (isSIBbase(registerName2registerId.at(std::get<std::string>(op[0].lexemas))))
mnemonic.mnemonics.emplace_back(IndirectAddress{
.base = Register(std::get<std::string>(op[0].lexemas)),
.disp = LabelUse(std::get<std::string>(op[2].lexemas))
});
else
mnemonic.mnemonics.emplace_back(IndirectAddress{
.index = Register(std::get<std::string>(op[0].lexemas)),
.disp = LabelUse(std::get<std::string>(op[2].lexemas))
});
}
}
else if (operation == '*')
{
if (op[0].id == LexemID::NUMBER && op[2].id == LexemID::REGISTER)
mnemonic.mnemonics.emplace_back(IndirectAddress{
.base = Register(std::get<std::string>(op[2].lexemas)),
.scale = static_cast<uint8_t>(std::get<int>(op[0].lexemas))
});
}
}
else if(op.size() == 5)
{
if (op[4].id == LexemID::REGISTER)
mnemonic.mnemonics.emplace_back(IndirectAddress{
.base = Register(std::get<std::string>(op[4].lexemas)),
.index = Register(std::get<std::string>(op[2].lexemas)),
.scale = static_cast<uint8_t>(std::get<int>(op[0].lexemas))
});
else if (op[4].id == LexemID::NUMBER)
mnemonic.mnemonics.emplace_back(IndirectAddress{
.index = Register(std::get<std::string>(op[2].lexemas)),
.scale = static_cast<uint8_t>(std::get<int>(op[0].lexemas)),
.disp = Constant(std::get<int>(op[4].lexemas))
});
else if (op[4].id == LexemID::LABEL_USE)
mnemonic.mnemonics.emplace_back(IndirectAddress{
.index = Register(std::get<std::string>(op[2].lexemas)),
.scale = static_cast<uint8_t>(std::get<int>(op[0].lexemas)),
.disp = LabelUse(std::get<std::string>(op[4].lexemas))
});
...
чё к щам близко?
https://github.com/kcalbSphere/PVC-16/blob/master/pvc-asm/syntaxer.cpp
+1
package com.javarush.task.task10.task1013;
/*
Конструкторы класса Human
*/
public class Solution {
public static void main(String[] args) {
}
public static class Human {
// Напишите тут ваши переменные и конструкторы
private String name;
private int age;
private int height;
private String profession;
private String sex;
private String citizen;
public Human(String name, int huy) {
this.name = name;
huy = huy;
}
public Human(String name, int huy, int pizda) {
this.name = name;
huy = huy;
pizda = pizda;
}
public Human(String name) {
this.name = name;
}
public Human(String name, int age, String sex) {
this.name = name;
this.age = age;
this.sex = sex;
}
public Human(String name, int age, String sex, String profession) {
this.name = name;
this.age = age;
this.sex = sex;
this.profession = profession;
}
public Human(String name, int age, String sex, String profession, String citizen) {
this.name = name;
this.age = age;
this.sex = sex;
this.profession = profession;
this.citizen = citizen;
}
public Human(String name, int age, int height, String sex, String profession, String citizen) {
this.name = name;
this.age = age;
this.height = height;
this.sex = sex;
this.profession = profession;
this.citizen = citizen;
}
public Human(String name, int age, int height, String sex, String profession, String citizen, boolean pidor) {
this.name = name;
this.age = age;
this.height = height;
this.sex = sex;
this.profession = profession;
this.citizen = citizen;
pidor = pidor;
}
public Human(String name, int age, int height, String sex, String profession, String citizen, boolean pidor, boolean govno) {
this.name = name;
this.age = age;
this.height = height;
this.sex = sex;
this.profession = profession;
this.citizen = citizen;
pidor = pidor;
govno = govno;
−1
https://thestreetjournal.org/2021/04/chinese-authorities-seize-7221-human-penises-on-cargo-ship-from-nigeria/
7221 камерунских шоколадных зайцев пострадало.
+1
def ForQueryInAddr(query, addr):
global listed, primalsource
print("Searcing in: "+addr)
html = requests.get(addr,proxies=proxies).text
if (query.lower() in html.lower()):
print("==============================================")
print("Query found in: "+addr)
print("==============================================")
if ("<html>" in html or "<head>" in html):
data = PyQuery(html)
links = data('a')
for link in links:
ahref = link.attrib['href']
#print("Found: "+ahref)
if (ahref not in listed):
if (ahref[0].lower() == "h"):
if (primalsource in ahref):
if (ahref[-3:].lower() not in filetypes and ahref[-4:].lower() not in filetypes and ahref[-5:].lower() not in filetypes):
listed.append(ahref)
ForQueryInAddr(query, ahref)
https://github.com/Dev1lroot/OnionSearch/blob/master/main.py
+1
declare @NL table
(ARTICLE_ID int primary key,
M int,
DS datetime,
DD datetime,
RAS money,
REST money,
NWS money,
NWA money,
LD_AMOUNT money,
LD_DATE datetime,
IS_NL bit,
SCC_ID int,
IS_NOT_MARKDOWN bit)
Double Side,Single Density / Double Side, Double Density — это понятно. Но почему datetime?
0
Тест потерянных комментариев