- 1
document.getElementById(element.id).checked = true;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+44
document.getElementById(element.id).checked = true;
−248
nop
nop
nop
call somelabel
somelabel:
pop si
sub si, 3
ассемблер - источник массы говнокода, классика...
0
//Вдохновил говнокод от DypHuu_niBEHb
fun main() {
Сорок тысяч обезъян в жопу сунули банан
}
object Сорок {
infix fun тысяч(a: обезъян) : обезъян {
print("${this.javaClass.simpleName} ${Thread.currentThread().stackTrace[1].methodName} ")
return обезъян
}
}
object обезъян {
infix fun в(a: жопу) : жопу {
print("${this.javaClass.simpleName} ${Thread.currentThread().stackTrace[1].methodName} ")
return жопу
}
}
object жопу {
infix fun сунули(a: банан) : жопу {
print("${this.javaClass.simpleName} ${Thread.currentThread().stackTrace[1].methodName} ${a.javaClass.simpleName}")
return this
}
}
object банан {
}
Сорок тысяч обезъян в жопу сунули банан
0
Плохие новости, Говнокод скоро закроется. Ищите более уютную борду.
Начитайте искать уже сичас.
−2
[xcache.admin]
xcache.admin.enable_auth = On
; use http://xcache.lighttpd.net/demo/cacher/mkpassword.php to generate your encrypted password
xcache.admin.user = "mOo"
xcache.admin.pass = "md5 encrypted password"
mOo
−2
if (true
&& (false
|| LYS_LEAF != ref_node->schema->nodetype
|| LY_TYPE_LEAFREF != reinterpret_cast<lys_node_leaf*>(ref_node->schema)->type.base
)
&& (false
|| LYS_LEAFLIST != ref_node->schema->nodetype
|| LY_TYPE_LEAFREF != reinterpret_cast<lys_node_leaflist*>(ref_node->schema)->type.base
)
)
return nullptr;
Посоны, помогити!11
Я блять чего то не ПОНИМАЮ, ШО ТАК ЗАЧЕМ ДЕЛАТЬ?
+2
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define NUMARGS(type,...) (sizeof((type[]){__VA_ARGS__})/sizeof(type))
#define xDEF(type) typedef struct {size_t size; type* arr; } xARR(type)
#define xARR(type) jArr_ ## type
#define A(type, ...) (xARR(type)) {NUMARGS(type,__VA_ARGS__), (type[]){__VA_ARGS__}}
#define _FOR(type, item, Arr) type item=Arr.arr[0]; for(size_t I = 0; I < Arr.size; item=Arr.arr[++I] )
// MSVC
#define xFOR(type, item, array) do{ _FOR(type, item, array) {
// GCC, Clang
#define FOR(item, array) do{ __auto_type Arr=array; _FOR(__auto_type, item, Arr) {
#define NEXT }} while(0);
#define OfArray(type,arr) (xARR(type)){sizeof(arr)/sizeof(type), arr }
typedef struct {
char *name;
int id;
} Entry;
typedef struct {const char *name;} Str;
typedef struct {int x[2]; } Pair;
xDEF(Entry);
xDEF(Str);
xDEF(Pair);
xDEF(int);
void printEntry(xARR(Entry) entries)
{
xFOR(Entry, e, entries)
printf("%s %d \n", e.name, e.id);
NEXT
}
void printSquares(xARR(int) ints)
{
FOR(v, ints)
printf("%d²=%d\n", v,(int) pow(v,2.));
NEXT
}
int main(void)
{
xARR(Entry) e = A(Entry, {"one",1}, {"two",2}, {"three",3});
printEntry(e);
puts("_______________________________________");
// можно передавать в метод непосредственно аргуметом
printSquares( A(int, 3, 7, 5, 4) );
puts("_______________________________________");
int nums[]={4,3,2,1};
// можно использовать ранее объявленный массив
printSquares(OfArray(int,nums));
// можно итерироватьcя по ранее объявленному массиву
FOR(i, OfArray(int, nums))
printf("%d-",i);
NEXT
puts("\n_______________________________________");
//вложенные циклы:
for (int k=1;k<3;k++)
FOR(i, A(Str, "kakoi", "bagor"))
FOR(j, A(int, 1111,2222,3333))
printf("%d %s %d\n", k, i.name, j);
NEXT
NEXT
puts("_______________________________________");
FOR(v, A(Pair, {1,2}, {11,12}, {20,21}))
printf("%d,%d\n", v.x[0], v.x[1]);
NEXT
puts("_______________________________________");
//проблема пустого варарга
FOR(j, A(int))
printf("%d\n", j);
NEXT
return(0);
}
https://godbolt.org/z/o9Tv9EvGx
Довёл for~each до ума.
0
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "ntdll.lib")
#include <Windows.h>
#include <string>
#define FLG_HEAP_ENABLE_TAIL_CHECK 0x10
#define FLG_HEAP_ENABLE_FREE_CHECK 0x20
#define FLG_HEAP_VALIDATE_PARAMETERS 0x40
#define NT_GLOBAL_FLAG_DEBUGGED (FLG_HEAP_ENABLE_TAIL_CHECK | FLG_HEAP_ENABLE_FREE_CHECK | FLG_HEAP_VALIDATE_PARAMETERS)
typedef NTSTATUS(NTAPI* pfnNtSetInformationThread)(
_In_ HANDLE ThreadHandle,
_In_ ULONG ThreadInformationClass,
_In_ PVOID ThreadInformation,
_In_ ULONG ThreadInformationLenght);
const ULONG ThreadHideFromDebugger = 0x11;
typedef NTSTATUS(NTAPI* pfnNtQueryInformationProcess)(
_In_ HANDLE ProcessHandle,
_In_ ULONG ProcessInformationClass,
_In_ PVOID ProcessInformation,
_In_ ULONG ProcessInformationLenght,
_Out_opt_ PULONG ReturnLenght);
const UINT ProcessDebugPort = 7;
void HideFromDebugger()
{
HMODULE hNtDll = LoadLibrary("ntdll.dll");
if (!hNtDll)
throw std::exception("can't load kernel");
pfnNtSetInformationThread NtSetInformatioThread = (pfnNtSetInformationThread)
GetProcAddress(hNtDll, "NtSetInformationThread");
NTSTATUS status = NtSetInformatioThread(GetCurrentThread(), ThreadHideFromDebugger, NULL, NULL);
}
PVOID GetPEB()
{
return (PVOID)__readfsword(0x0C * sizeof(PVOID));
}
int main()
{
pfnNtQueryInformationProcess NtQueryInformationProcess = nullptr;
NTSTATUS status;
DWORD IsDebuggerPresent = 0;
HMODULE hNtDll = LoadLibrary("ntdll.dll");
if (!hNtDll)
throw std::exception("can't load kernel");
NtQueryInformationProcess = (pfnNtQueryInformationProcess)GetProcAddress(hNtDll, "NtQueryInformationProcess");
void HideFromDebugger();
while (true)
{
PVOID pPEB = GetPEB();
DWORD offsetNtGlobalFlag = 0x68;
DWORD NtGlobalFlag = (DWORD)((PBYTE)pPEB + offsetNtGlobalFlag);
NTSTATUS stat = NtQueryInformationProcess(GetCurrentProcess(), ProcessDebugPort,
&IsDebuggerPresent, sizeof(DWORD), NULL);
if ((NtGlobalFlag & NT_GLOBAL_FLAG_DEBUGGED) || (stat == 0x00000000 && IsDebuggerPresent != 0))
{
MessageBox(NULL, "Close your fucking debuger!", "FUCK YOU", MB_OK);
return -1;
}
}
return 0;
}
0
-- Теперь мы можем легко получить отчёт по продажам на прошлую дату:
DELIMITER ;
BEGIN;
CALL set_prot_snapshot_date('2018-10-09 17:23:47', NULL, -1);
SELECT NOW() report_time, d.date, SUM(p.amount * p.price) sum
FROM docs d
INNER JOIN doc_pos p ON d.id = p.doc_id
GROUP BY d.date;
ROLLBACK;
https://habr.com/ru/post/425769/
Как научить MySQL заглядывать в прошлое
0
#include <iostream>
#include <vector>
#include <thread>
int f()
{
static int i = 0;
synchronized { // begin synchronized block
std::cout << i << " -> ";
++i; // each call to f() obtains a unique value of i
std::cout << i << '\n';
return i; // end synchronized block
}
}
int main()
{
std::vector<std::thread> v(10);
for(auto& t: v)
t = std::thread([]{ for(int n = 0; n < 10; ++n) f(); });
for(auto& t: v)
t.join();
}
0 -> 1
1 -> 2
2 -> 3
...
99 -> 100
https://en.cppreference.com/w/cpp/language/transactional_memory