- 1
// https://habr.com/ru/company/ruvds/blog/515676/
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−1
// https://habr.com/ru/company/ruvds/blog/515676/
Разбор худшего в мире куска кода.
+1
/// Checks if the token is number or not
bool is_number(char* test_val)
{
const char* ROW = "0123456789\0";
for (int i = 0; i < strlen(test_val); i++) {
for (int j = 0; j < strlen(ROW); j++) {
if (test_val[i] == ROW[j]) {
goto next;
}
}
return false;
next:
}
return true;
}
Попытка проверить строку на число в Си.
+1
//--------------------------------------------------------------------------------------------------------------------\\
float max_rotation = record->m_pEntity->GetMaxBodyRotation();
auto animstate = ent->m_PlayerAnimState();
float resolve_value = 50.f; //не трогайте это, так и должно быть
if (!record->m_pState)
return;
const auto info = g_anims.GetAnimationInfo(record->m_pEntity);
if (!info)
return;
float eye_yaw = record->m_pState->m_flEyeYaw;
if (max_rotation < resolve_value)
resolve_value = max_rotation;
data->m_extending = record->m_pLayers[3].m_cycle == 0.f && record->m_pLayers[3].m_weight == 0.f;
float Delta = AngleDiff(ent->m_angEyeAngles().y, animstate->m_flGoalFeetYaw);
//--------------------------------------------------------------------------------------------------------------------\\
RESOLVERPART
//--------------------------------------------------------------------------------------------------------------------\\
if (data->m_extending)
resolve_value = max_rotation;
if (ent->m_AnimOverlay()[13].m_weight + 14.250f > 0.54)
{
if (ent->m_AnimOverlay()[3].m_cycle > 0.12)
{
if (ent->m_AnimOverlay()[13].m_cycle > 0.43)
{
animstate->m_flGoalFeetYaw = ent->m_angEyeAngles().y;
}
}
}
if (data->m_extending)
{
if (Delta <= 0)
{
animstate->m_flGoalFeetYaw = Delta * resolve_value;
}
else if (Delta > 0)
{
animstate->m_flGoalFeetYaw = Delta * -resolve_value;
}
}
else if (ent->m_AnimOverlay()[7].m_order == record->m_pLayers[7].m_order)
{
if (ent->m_AnimOverlay()[7].m_cycle > 0.5f)
{
animstate->m_flGoalFeetYaw = math::NormalizeYaw(record->m_pEntity->m_flLowerBodyYawTarget()) + get_max_desync_delta;
return;
}
else
animstate->m_flGoalFeetYaw = record->m_pEntity->m_angEyeAngles().y;
}
if (record->m_bDidShot)
info->m_flBrute = Resolver::ResolveShot(data, record);
//--------------------------------------------------------------------------------------------------------------------\\
BRUTEFORCE PART
//--------------------------------------------------------------------------------------------------------------------\\
else {
float lbyt = record->m_pEntity->m_flLowerBodyYawTarget();
data->m_delta = std::abs(math::NormalizedAngle(eye_yaw - lbyt));
float resolve_yaw = ((data->m_delta < 0.f) ? resolve_value : resolve_value);
switch (data->m_missed_shots % 3) {
case 0:
info->m_flBrute = data->m_last_resolve = resolve_yaw;
break;
case 1:
info->m_flBrute = -data->m_last_resolve;
break;
case 2:
info->m_flBrute = 0;
break;
}
}
record->m_pState->m_flGoalFeetYaw = eye_yaw + info->m_flBrute;
//--------------------------------------------------------------------------------------------------------------------\\
best resolver
+2
lea esi, cpu_name
mov eax, 0
mov mreg, eax
;[04/12] G
mov eax, 0ffh
and eax, ebx
mov mreg, eax
mov al, byte ptr [mreg]
mov [esi], al
inc esi
;[03/12] e
mov eax, 0ff00h
and eax, ebx
mov mreg, eax
mov al, byte ptr [mreg + 1]
mov [esi], al
inc esi
;[02/12] n
mov eax, 0ff0000h
and eax, ebx
mov mreg, eax
mov al, byte ptr [mreg + 2]
mov [esi], al
inc esi
;[01/12] u
mov eax, 0ff000000h
and eax, ebx
mov mreg, eax
mov al, byte ptr [mreg + 3]
mov [esi], al
inc esi
;[08/12] i
mov eax, 0ffh
and eax, edx
mov mreg, eax
mov al, byte ptr [mreg]
mov [esi], al
inc esi
;[07/12] n
mov eax, 0ff00h
and eax, edx
mov mreg, eax
mov al, byte ptr [mreg + 1]
mov [esi], al
inc esi
;[06/12] e
mov eax, 0ff0000h
and eax, edx
mov mreg, eax
mov al, byte ptr [mreg + 2]
mov [esi], al
inc esi
;[05/12] I
mov eax, 0ff000000h
and eax, edx
mov mreg, eax
mov al, byte ptr [mreg + 3]
mov [esi], al
inc esi
;[12/12] n
mov eax, 0ffh
and eax, ecx
mov mreg, eax
mov al, byte ptr [mreg]
mov [esi], al
inc esi
;[11/12] t
mov eax, 0ff00h
and eax, ecx
mov mreg, eax
mov al, byte ptr [mreg + 1]
mov [esi], al
inc esi
;[10/12] e
mov eax, 0ff0000h
and eax, ecx
mov mreg, eax
mov al, byte ptr [mreg + 2]
mov [esi], al
inc esi
;[09/12] l
mov eax, 0ff000000h
and eax, ecx
mov mreg, eax
mov al, byte ptr [mreg + 3]
mov [esi], al
inc esi
−1
public function index()
{
$items = CartManager::getAllItems();
$couponCode = Coupon::getFromSession()->implode('code', ', ');
$address = auth()->user()->address;
$user = auth()->user();
$userDetails = auth()->user() ? auth()->user()->fields : null;
$fields = [
'promo_code' => $couponCode,
'email' => $user->email,
'first_name' => $userDetails->firstname,
'last_name' => $userDetails->lastname,
'phone' => $userDetails->phone,
];
if ($address) {
$field = [
'value' => $address->city->title
];
if ($address->city->type === \App\Address::TYPE_CITY) {
$field ['data']['city_fias_id'] = $address->city->id;
$field ['data']['city'] = $address->city->title;
} elseif ($address->city->type === \App\Address::TYPE_SETTLEMENT) {
$field ['data']['settlement_fias_id'] = $address->city->id;
$field ['data']['settlement'] = $address->city->title;
}
$fields ['delivery_city'] = $field;
}
if ($address->street) {
$fields ['delivery_street'] = [
'value' => $address->street->title,
'data' => [
'street_fias_id' => $address->street->id,
]
];
}
if ($address->street_number) {
$fields ['delivery_house_number'] = [
'value' => $address->street_number,
];
}
if ($address->flat) {
$fields ['delivery_flat_number'] = $address->flat;
}
$fields = (object)$fields;
$actions = [
'remove' => route('shop.cart.remove'),
'remove_gift_card' => route('shop.cart.gift-cards.remove'),
'change' => route('shop.cart.update'),
'promo' => route('shop.coupon.apply'),
'checkout' => route('orders.store'),
'get_pickups' => route('delivery_points.index'),
'check_email' => route('check_email'),
];
return view('shop.cart.index', compact(
'items',
'address',
'couponCode',
'fields',
'actions'
));
}
this is MVC, baby !
−1
while True:
print("И снова...")
dopamin_up()
adrenalin_up()
ne_brezrazlichen = True
vlublena = False
if vturilas:
vtreskalas = True
vkrashilas = True
Теперь ясно почему дора дура.
Код взят с https://vk.com/wall-91010741_75007
+1
The authenticity of host 'ololo.fike.nemyx (<ip address>)' can't be established.
fingerprint is SHA256:ololo.
Are you sure you want to continue connecting
? (Y/N) Y
I have no idea what to do with 'Y'
Just say Y or N, please.
The authenticity of host 'ololo.fike.nemyx (<ip address>)' can't be established.
fingerprint is SHA256:ololo.
Are you sure you want to continue connecting
? (Y/N) y
Connecting to ololo.fike.nemyx
Chef
+1
Хрюкни #4
._ __,
|\,../'\
,'. . `.
.-- '`.
( `' , ;
,`--' _, ,'\
,`.____ `.
/ `, |
' \, '
| / /`,
`, . ,` ./ |
' `. ,' |;,' ,@
______| | _________,_____jv______
`. `. ,'
,'_,','_,
`' `'
#1: https://govnokod.ru/26863 https://govnokod.xyz/_26863
#2: https://govnokod.ru/26868 https://govnokod.xyz/_26868
#3: https://govnokod.ru/26881 https://govnokod.xyz/_26881
+3
https://habr.com/ru/company/ruvds/blog/516266/
https://github.com/asz/icmpshell/blob/main/main.c
+2
Definition idx_compl_r {i : Fin.t N} (j : Fin.t i) : Fin.t N.
remember (fin_to_nat i) as i'.
assert (Hlt : i' < N).
{ rewrite Heqi'. eapply fin_to_nat_lt. }
assert (Heq : i' + (N - i') = N) by lia.
set (j' := Fin.L (N - i') j).
rewrite Heq in j'.
exact j'.
Defined.
Ещё один говношедевр. Как кастовать значения типа Fin.t (число в интервале от 1 до N) друг в друга. Разворачивается в 12000 строк кода. "Тому, кто это придумал, надо в голову гвоздь забить".