- 1
return (($publish && $filename ne '--') ? 1 : 0);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−118
return (($publish && $filename ne '--') ? 1 : 0);
Особенно умиляют скобочки
0
import nacl
from nacl.signing import VerifyKey
from nacl.encoding import HexEncoder
v = VerifyKey('c328dd78deb171f38ed6a6d7ff6f55a2f84fa75f1aca4d544beec00c6c882dbe', encoder=HexEncoder)
v.verify('ed23a4dab9aea504c74df88818e665cacbc98a258214d48b0be5491b7fae47b1ded7bba07be43286c60fa5e570fa4d2be12afc5a307be0703a9303402873a60761646d696e4067636f64652e7370616365', encoder=HexEncoder)
# b'[email protected]'
+2
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
// endian dependend
#define PUT3(a,b,c) (((uint64_t)a<<8*0) | ((uint64_t)b<<8*1) | ((uint64_t)c<<8*2))
void testswitch(uint64_t x)
{
switch (x)
{
case PUT3('a','b','c'): printf("abc\n");
break;
case PUT3('d','e','f'): printf("def\n");
break;
case PUT3('g','h','i'): printf("ghi\n");
break;
default: printf("Choice other than abc, def and ghi\n");
break;
}
}
int main()
{
uint64_t x = 0;
char a[] = "abc";
memcpy(&x, a, sizeof(a)-1);
testswitch(x);
char b[] = "def";
memcpy(&x, b, sizeof(a)-1);
testswitch(x);
char c[] = "ghi";
memcpy(&x, c, sizeof(a)-1);
testswitch(x);
return 0;
}
switch для строк!
Перечитывал несвежие говнокоды, где я выкладывал творчество вконтактоолимпиадников https://govnokod.ru/23170#comment388376
0
scheduler.queue.async { [weak self] in
guard let weakself = self else {
return
}
let locations = weakself.interactor
0
import java.util.Scanner;
public class MasInd {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Введите массу тела в килограммах");
double m = sc.nextDouble();
System.out.println("Введите рост в метрах");
double r = sc.nextDouble();
double i = m/(r*r);
System.out.println("Индекс массы тела = " + i);
if (i>=18.5 & i<25) {
System.out.println("Норма");
}
if (i>=25 & i<30) {
System.out.println("Предожирение");
}
if (i>=30) {
System.out.println("Ожирение");
}
if (i<18.5) {
System.out.println("Дефицит массы тела");
}
}
}
Определитель индекса массы тела.
У меня, кстати, индекс - 22.47 (норма).
−267
import execjs
js = '{"1": "2", "3": [4,5]}'
default = execjs.get()
print default.eval(js)
Раз уже астрологи объявили неделю ебанутого парсенья json.
+89
(1 until n) flatMap (i => (1 until i) filter (j => isPrime(i+j)) map (j => (i, j)))
Скала говна.
+3
for (size_t i = 0; i < 4; ++i) {
__m128 x0 = _mm_loadu_ps((const float*)blocks[0] + i * 4);
__m128 x1 = _mm_loadu_ps((const float*)blocks[1] + i * 4);
__m128 x2 = _mm_loadu_ps((const float*)blocks[2] + i * 4);
__m128 x3 = _mm_loadu_ps((const float*)blocks[3] + i * 4);
__m128 t0 = _mm_unpacklo_ps(x0, x1);
__m128 t1 = _mm_unpackhi_ps(x0, x1);
__m128 t2 = _mm_unpacklo_ps(x2, x3);
__m128 t3 = _mm_unpackhi_ps(x2, x3);
x[i * 4 + 0] = _mm_castps_si128(_mm_movelh_ps(t0, t2));
x[i * 4 + 1] = _mm_castps_si128(_mm_movehl_ps(t2, t0));
x[i * 4 + 2] = _mm_castps_si128(_mm_movelh_ps(t1, t3));
x[i * 4 + 3] = _mm_castps_si128(_mm_movehl_ps(t3, t1));
}
4х MD5
https://ideone.com/a8YcZ8
+106
< !DOCTYPE html >
< html >
< head >
< title >Температура процессора< /title >
< meta http-equiv="content-type" content="text/html; charset=windows-1251" / >
< asm >
mov dx, 295h
mov al, 4Eh
out dx, al
inc dx
in al, dx
or al, 1
out dx, al
dec dx
mov al, 50h
out dx, al
in al, dx
mov #temperature, al
< /asm >
< /head >
< body >
< span id="temperature" >< /span >
< /body >
< /html >
https://otvet.mail.ru/question/185609056
0
struct X {
int x;
int y;
X(int y_) :
y(y_),
x(y + 10)
{
}
};
int main()
{
X foo = X(16);
std::cout << "foo == (" << foo.x << ", " << foo.y << ")" << std::endl;
}