- 1
С праздником, девочки! ʕ ᵔᴥᵔ ʔ
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−5
С праздником, девочки! ʕ ᵔᴥᵔ ʔ
−1
(function(){
const panel = document.querySelector('.pane-content > ul');
function appendLink(text, href) {
const li = document.createElement('li');
const a = document.createElement('a');
li.appendChild(a);
a.setAttribute('href', href);
a.innerText = text;
panel.appendChild(li);
}
appendLink("Перелогиниться", 'https://govnokod.ru/user/exit/?url=https://govnokod.ru/user/login');
appendLink("Регистрация", 'https://govnokod.ru/user/exit/?url=https://govnokod.ru/user/register');
})();
Кокококое у гк удобне апи )))
0
<vistefan> In recently installed Manjaro i have this (https://imgur.com/a/e0Prjez) instead of proper AwesomeWM menu called by Super button. Any Ideas? Tried to install additional fonts. Locales are correct.
<HEX0> !give vistefan manjaro
<phrik> vistefan: manjaro does things differently from arch, so we can't really support it. ask in #manjaro or ##linux
<SGOrava> vistefan: you would be fine as long as you do not mention other distributions and pretend to be using Arch, is it that hard ? Even I do that :D
<SGOrava> vistefan: My idea is that you are missing some fonts or locale...
<vistefan> SGOrava, :D
<Scimmia> !give SGOrava notarch
<phrik> SGOrava: This channel is for Arch Linux support only. Also see https://wiki.archlinux.org/index.php/Code_of_conduct#Arch_Linux_distribution_support_.2Aonly.2A
<thingfish> you're better off being up front, from the beginning about what you're running.
<Scimmia> seriously, we don't want you here if you're going to act like a total piece of shit
<SGOrava> Scimmia: I know sure, but as long as one knows what one can ask here than it is fine
<Scimmia> no, it's not
<Scimmia> at all
<SGOrava> how is it not ?
<Scimmia> If you're not on Arch, it's not OK, end of story
<SGOrava> what is wrong with that when one wants to ask a question
<Namarrgon> lying about your distro? ban
<Scimmia> and asking here implies it's Arch, so knowing the rules and asking anyway is lying
<SGOrava> why be so pedantic ?
<Namarrgon> we don't like liars
<SGOrava> that is why I said one needs to know what belongs here and what does not
<thingfish> people who help in here have a hard enough time supporting actual Arch users. They don't need to be wasting their time chasing down some issue for other distros, which should have their own support channels.
<Namarrgon> support for other distros does not belong here
<SGOrava> Namarrgon: peopúle lie everyday just to survive
<Namarrgon> that's a shitty excuse
<cyveris> That's a shitty person.
<SGOrava> why are you so hostile ?
<Namarrgon> if you don't like our rules then you there are plenty of other channels that you can join
<thingfish> because you don't seem to have a clue, dude.
<Namarrgon> SGOrava: because you are telling other people to lie to the community just to get support
<SGOrava> I am not, I am telling them to distinguish where the problem is and ask at the source
<demonicmaniac3> 21:14 < SGOrava> vistefan: you would be fine as long as you do not mention other distributions and pretend to be using Arch, is it that hard ?
<Scimmia> and if it's not Arch, the problem is not here
<demonicmaniac3> you are telling them to pretend to use arch when they ask questions
<Scimmia> SGOrava: sounds like you aren't running arch...
<SGOrava> I am running Arch, half of the packages comes from Arch repos, so I run Arch
<Scimmia> So that's a no
<thingfish> aargh
<HEX0> !roulette
* phrik has kicked HEX0 from #archlinux (BANG!)
<Scimmia> !give SGOrava notarch
<cyveris> Bold move, cotton.
* phrik reloads and spins the chambers.
<phrik> SGOrava: This channel is for Arch Linux support only. Also see https://wiki.archlinux.org/index.php/Code_of_conduct#Arch_Linux_distribution_support_.2Aonly.2A
<SGOrava> how is it a no ?
<Scimmia> SGOrava: where do the other half come from?
<SGOrava> Scimmia: you still would not care
<Scimmia> yep, not Arch
<SGOrava> I know what to ask where (mostly)
<Scimmia> if you're asking here about anything at all, you obviously don't
<SGOrava> ??
<Namarrgon> SGOrava: https://wiki.archlinux.org/index.php/Code_of_conduct#Arch_Linux_distribution_support_*only*
<phrik> Title: Code of conduct - ArchWiki (at wiki.archlinux.org)
* HEX0 (~HEX0@unaffiliated/hex0) has joined
<Namarrgon> you can use whatever distro you want but that doesn't mean that we have to put up with your nonsense
<cyveris> SGOrava: You're not using Arch Linux. You're using some derivative. Hence, this is not the channel for you, and now that everyone here knows you advocate for lying about it to get help, no one will help you.
<SGOrava> Namarrgon: sorry, it is too long
<Namarrgon> alright
<SGOrava> cyveris: nope, it is channel for me when I have problems which are sourced from Arch
<Scimmia> SGOrava: and now that you know the rules, ask here and get banned
<SGOrava> Scimmia: what should I ask ?
<cyveris> And here we go.
<SGOrava> cyveris: you said I should ask something, so think about it
<HEX0> stop talking and install arch linux while you can
+2
https://tjournal.ru/analysis/128216-moshenniki-3-0-kak-ne-popastsya-na-udochku-novogo-pokoleniya-prestupnikov-v-sfere-it
https://leonardo.osnova.io/0234cd39-a2ef-c6d8-d8df-87df562f9997/-/scale_crop/600x398/center/
0
#include <ncurses.h>
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#define msleep(msec) Sleep(msec)
#else
#include <unistd.h>
#define msleep(msec) usleep(msec*1000)
#endif
int main()
{
initscr();
char str[100];
addstr("Enter string: ");
getstr(str); //Считваем строку
curs_set(0); //"Убиваем" курсор, чтобы не мешался
while ( true )
{
//Перемещаем х-координату как можно дальше вправо, и будем уменьшать её, пока она != 0
for ( unsigned x = getmaxx(stdscr); x; x-- )
{
clear();
mvaddstr(getmaxy(stdscr) / 2, x, str);
refresh();
msleep(200);
}
}
endwin();
return 0;
}
https://code-live.ru/post/ncurses-input-output/#getstr-
Сколько хуйни вы можете найти в этом примере?
+6
#include "stdafx.h"
#include "hackery.h"
#include <cstdint>
#include <windows.h>
/*XXX*/
unsigned char udiv128Data[] =
{
0x48, 0x89, 0xD0, // mov rax,rdx
0x48, 0x89, 0xCA, // mov rdx,rcx
0x49, 0xF7, 0xF0, // div r8
0x49, 0x89, 0x11, // mov [r9],rdx
0xC3 // ret
};
/*XXX*/
unsigned char sdiv128Data[] =
{
0x48, 0x89, 0xD0, // mov rax,rdx
0x48, 0x89, 0xCA, // mov rdx,rcx
0x49, 0xF7, 0xF8, // idiv r8
0x49, 0x89, 0x11, // mov [r9],rdx
0xC3 // ret
};
unsigned __int64(__fastcall *udiv128)(unsigned __int64 numhi, unsigned __int64 numlo, unsigned __int64 den, unsigned __int64* rem);
__int64(__fastcall *sdiv128)(__int64 numhi, __int64 numlo, __int64 den, __int64* rem);
namespace {
struct Q {
Q() {
/*XXX*/
udiv128 = reinterpret_cast<unsigned __int64(__fastcall *)(unsigned __int64, unsigned __int64, unsigned __int64, unsigned __int64*)>(&udiv128Data[0]);
/*XXX*/
sdiv128 = reinterpret_cast<__int64(__fastcall *)(__int64, __int64, __int64, __int64*)>(&sdiv128Data[0]);
/*XXX*/
DWORD dummy;
/*XXX*/
VirtualProtect(udiv128Data, sizeof(udiv128Data), PAGE_EXECUTE_READWRITE, &dummy);
/*XXX*/
VirtualProtect(sdiv128Data, sizeof(sdiv128Data), PAGE_EXECUTE_READWRITE, &dummy);
}
} q;
}
Вот такая вот загогулина получилась по причине того что в 64-х битной Вижуал Студии нет встроенного асма, нет интринсика для простой асмовой команды, но мне вот надо именно полное деление 128-битного числа на 64-х битное именно с остатком и мне совершенно фиолетово на то что Майкрософт думает на тему вредности команды DIV и заменимости деления умножением на обратное. Да, и мне влом усложнять структуру проекта и линковать какие-то символы с внешнего асма.
+131
fi = fopen("kokoko.tmp", "rb");
fseek(fi, 0, SEEK_END);
file_size = ftell(fi);
fseek(fi, 0, SEEK_SET);
rewind? system call? Не, не слышали.
+155
try
{
return ($image = $this->row->image()->first())
? $image->{$this->imageAlias}
: dummyThumbnail($this->imageAlias)
;
}
catch(\Exception $e)
{
if ($e->getMessage() === 'Method [image] is not defined on the Query class.')
{
$val = parent::value();
return (is_string($val) and \Str::contains($val, 'http://'))
? $val
: $this->row->getImageSrc($this->name, $this->imageAlias)
;
}
throw new \Exception($e->getMessage(), $e->getCode());
}
+143
const int index64[64] = {
0, 1, 48, 2, 57, 49, 28, 3,
61, 58, 50, 42, 38, 29, 17, 4,
62, 55, 59, 36, 53, 51, 43, 22,
45, 39, 33, 30, 24, 18, 12, 5,
63, 47, 56, 27, 60, 41, 37, 16,
54, 35, 52, 21, 44, 32, 23, 11,
46, 26, 40, 15, 34, 20, 31, 10,
25, 14, 19, 9, 13, 8, 7, 6
};
/**
* bitScanForward
* @author Martin Läuter (1997)
* Charles E. Leiserson
* Harald Prokop
* Keith H. Randall
* "Using de Bruijn Sequences to Index a 1 in a Computer Word"
* @param bb bitboard to scan
* @precondition bb != 0
* @return index (0..63) of least significant one bit
*/
int bitScanForward(U64 bb) {
assert (bb != 0);
return index64[((bb & -bb) * 0x03f79d71b4cb0a89) >> 58];
}
нашёл на кывте
+114
// FxCop does not allow the string "Uri" in a method name that does not return a Uri object.
public static string To_U_r_i_TypeString(DeviceType type)