- 1
IT Оффтоп #102
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
IT Оффтоп #102
#72: https://govnokod.ru/27120 https://govnokod.xyz/_27120
#73: https://govnokod.ru/27136 https://govnokod.xyz/_27136
#74: https://govnokod.ru/27160 https://govnokod.xyz/_27160
#75: https://govnokod.ru/27166 https://govnokod.xyz/_27166
#76: https://govnokod.ru/27168 https://govnokod.xyz/_27168
#77: https://govnokod.ru/27186 https://govnokod.xyz/_27186
#78: https://govnokod.ru/27219 https://govnokod.xyz/_27219
#79: https://govnokod.ru/27254 https://govnokod.xyz/_27254
#80: https://govnokod.ru/27270 https://govnokod.xyz/_27270
#81: https://govnokod.ru/27280 https://govnokod.xyz/_27280
#82: https://govnokod.ru/27284 https://govnokod.xyz/_27284
#83: https://govnokod.ru/27296 https://govnokod.xyz/_27296
#84: https://govnokod.ru/27336 https://govnokod.xyz/_27336
#85: https://govnokod.ru/27381 https://govnokod.xyz/_27381
#86: https://govnokod.ru/27405 https://govnokod.xyz/_27405
#87: https://govnokod.ru/27429 https://govnokod.xyz/_27429
#88: https://govnokod.ru/27432 https://govnokod.xyz/_27432
#89: https://govnokod.ru/27435 https://govnokod.xyz/_27435
#90: https://govnokod.ru/27439 https://govnokod.xyz/_27439
#91: https://govnokod.ru/27449 https://govnokod.xyz/_27449
#92: https://govnokod.ru/27460 https://govnokod.xyz/_27460
#93: https://govnokod.ru/27463 https://govnokod.xyz/_27463
#94: https://govnokod.ru/27466 https://govnokod.xyz/_27466
#95: https://govnokod.ru/27473 https://govnokod.xyz/_27473
#96: https://govnokod.ru/27478 https://govnokod.xyz/_27478
#97: https://govnokod.ru/27484 https://govnokod.xyz/_27484
#98: https://govnokod.ru/27495 https://govnokod.xyz/_27495
#99: https://govnokod.ru/27504 https://govnokod.xyz/_27504
#100: https://govnokod.ru/27508 https://govnokod.xyz/_27508
#101: https://govnokod.ru/27511 https://govnokod.xyz/_27511
0
Хрюкни #11
._ __,
|\,../'\
,'. . `.
.-- '`.
( `' , ;
,`--' _, ,'\
,`.____ `.
/ `, |
' \, '
| / /`,
`, . ,` ./ |
' `. ,' |;,' ,@
______| | _________,_____jv______
`. `. ,'
,'_,','_,
`' `'
#1: (vanished) https://govnokod.xyz/_26863
#2: (vanished) https://govnokod.xyz/_26868
#3: https://govnokod.ru/26881 https://govnokod.xyz/_26881
#4: https://govnokod.ru/26896 https://govnokod.xyz/_26896
#5: https://govnokod.ru/26928 https://govnokod.xyz/_26928
#6: (vanished) https://govnokod.xyz/_26952
#7: https://govnokod.ru/26955 https://govnokod.xyz/_26955
#8: https://govnokod.ru/27043 https://govnokod.xyz/_27043
#9: https://govnokod.ru/27175 https://govnokod.xyz/_27175
#10: https://govnokod.ru/27472 https://govnokod.xyz/_27472
+4
while (1) {
uint16_t state = in(USB_BASE + USB_ISTR);
if (state & 0x8000) {
uint16_t epstat = in(USB_BASE + USB_EP0R);
if (epstat & 0x8000) {
// RX done
if (epstat & 0x0800) {
// setup
if ((usbRead(0x180) == 0x80) && (usbRead(0x181) == 0x06)) {
uint16_t maxlen = (usbRead(0x187) << 8) | usbRead(0x186);
if (usbRead(0x183) == 0x01) {
// send device descriptor
copyToUsb(0x0100, deviceDescriptor, sizeof(deviceDescriptor));
if (sizeof(deviceDescriptor) < maxlen)
maxlen = sizeof(deviceDescriptor);
out(USB_SRAM_BASE + 0x04, 0x9000 + maxlen); // TX count
// STAT_TX=11 (valid)
if ((in(USB_BASE + USB_EP0R) & 0x0010) != 0x0010)
out(USB_BASE + USB_EP0R, 0x0210);
if ((in(USB_BASE + USB_EP0R) & 0x0020) != 0x0020)
out(USB_BASE + USB_EP0R, 0x0220);
} else if (usbRead(0x183) == 0x02) {
// send config descriptor
copyToUsb(0x0100, configDescriptor, sizeof(configDescriptor));
if (sizeof(configDescriptor) < maxlen)
maxlen = sizeof(configDescriptor);
out(USB_SRAM_BASE + 0x04, 0x9000 + maxlen); // TX count
// STAT_TX=11 (valid)
if ((in(USB_BASE + USB_EP0R) & 0x0010) != 0x0010)
out(USB_BASE + USB_EP0R, 0x0210);
if ((in(USB_BASE + USB_EP0R) & 0x0020) != 0x0020)
out(USB_BASE + USB_EP0R, 0x0220);
} else {
// ... и ещё сотня строк в том же духе ...
Иногда в меня вселяется дух PHP...
+1
// https://github.com/shanecoughlan/OpenGEM/blob/ac06b1a3fec3f3e8defcaaf7ea0338c38c3cef46/source/OpenGEM-7-RC3-SDK/OpenGEM-7-SDK/GEM%20AES%20AND%20SOURCE%20CODE/FreeGEM%20AES%203.0%20(source%20code)/GEMEVLIB.C#L143
/*
* Do a multi-wait on the specified events.
*/
WORD
ev_multi(flags, pmo1, pmo2, tmcount, buparm, mebuff, prets)
REG WORD flags;
REG MOBLK *pmo1;
MOBLK *pmo2;
LONG tmcount;
LONG buparm;
LPVOID mebuff;
WORD prets[];
{
QPB m;
REG EVSPEC which;
REG WORD what;
REG CQUEUE *pc;
#if MULTIAPP
WORD evbuff[8];
WORD pid;
SHELL *psh;
LONG ljunk;
pid = rlr->p_pid;
psh = &sh[pid];
if ( psh->sh_state & SHRINK ) /* shrink accessory */
{
if (pr_shrink(pid, TRUE, &ljunk, &ljunk))
ap_exit(TRUE); /* if no swap space terminate acc */
psh->sh_state &= ~SHRINK;
}
#endif
/* say nothing has */
/* happened yet */
what = 0x0;
/* do a pre-check for a */
/* keystroke & then */
/* clear out the forkq*/
chkkbd();
forker();
/* a keystroke */
if (flags & MU_KEYBD)
{
/* if a character is */
/* ready then get it */
pc = &rlr->p_cda->c_q;
if ( pc->c_cnt )
{
prets[4] = (UWORD) dq(pc);
what |= MU_KEYBD;
}
}
/* if we own the mouse */
/* then do quick chks */
if ( rlr == gl_mowner )
{
/* quick check button */
if (flags & MU_BUTTON)
{
if ( (mtrans > 1) &&
(downorup(pr_button, buparm)) )
{
what |= MU_BUTTON;
prets[5] = pr_mclick;
}
else
{
if ( downorup(button, buparm) )
{
what |= MU_BUTTON;
prets[5] = mclick;
}
}
}
/* quick check mouse rec*/
if ( ( flags & MU_M1 ) &&
( in_mrect(pmo1) ) )
what |= MU_M1;
/* quick check mouse rec*/
if ( ( flags & MU_M2 ) &&
( in_mrect(pmo2) ) )
what |= MU_M2;
}
/* quick check timer */
if (flags & MU_TIMER)
{
if ( tmcount == 0x0L )
what |= MU_TIMER;
}
/* quick check message */
if (flags & MU_MESAG)
{
if ( rlr->p_qindex > 0 )
{
#if MULTIAPP
ap_rdwr(MU_MESAG, rlr, 16, ADDR(&evbuff[0]) );
#endif
#if SINGLAPP
Уххх бля
0
Питушня #18
#1: https://govnokod.ru/26692 https://govnokod.xyz/_26692
#2: https://govnokod.ru/26891 https://govnokod.xyz/_26891
#3: https://govnokod.ru/26893 https://govnokod.xyz/_26893
#4: https://govnokod.ru/26935 https://govnokod.xyz/_26935
#5: (vanished) https://govnokod.xyz/_26954
#6: (vanished) https://govnokod.xyz/_26956
#7: https://govnokod.ru/26964 https://govnokod.xyz/_26964
#8: https://govnokod.ru/26966 https://govnokod.xyz/_26966
#9: https://govnokod.ru/27017 https://govnokod.xyz/_27017
#10: https://govnokod.ru/27045 https://govnokod.xyz/_27045
#11: https://govnokod.ru/27058 https://govnokod.xyz/_27058
#12: https://govnokod.ru/27182 https://govnokod.xyz/_27182
#13: https://govnokod.ru/27260 https://govnokod.xyz/_27260
#14: https://govnokod.ru/27343 https://govnokod.xyz/_27343
#15: https://govnokod.ru/27353 https://govnokod.xyz/_27353
#16: https://govnokod.ru/27384 https://govnokod.xyz/_27384
#17: https://govnokod.ru/27482 https://govnokod.xyz/_27482
+2
class Point {
x = 0;
y = 0;
}
function main() {
const pt = new Point();
// Prints 0, 0
print(`${pt.x}, ${pt.y}`);
}
вот пока вы тут языки чесали - я наваял новую фичу. а кто догадается что особенного в этом классе? в чем фича?
+2
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Biblo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
double a = 0, b = 0, c = 0;
double f, g;
private void button1_Click(object sender, EventArgs e)
{
a = Convert.ToDouble(maskedTextBox1.Text);
b = Convert.ToDouble(maskedTextBox2.Text);
c = Convert.ToDouble(maskedTextBox3.Text);
f = (a - b) * c / 100;
if (comboBox1.Text.Contains("12 месяцев"))
{
g = Math.Round((a + f) / 12);
}
if (comboBox1.Text.Contains("36 месяцев"))
{
g = Math.Round((a + f) / 36);
}
if (comboBox1.Text.Contains("5 лет"))
{
g = Math.Round((a + f) / 60);
}
if (comboBox1.Text.Contains("10 лет"))
{
g = Math.Round((a + f) / 120);
}
if (comboBox1.Text.Contains("20 лет"))
{
g = Math.Round((a + f) / 240);
0
IT Оффтоп #101
#71: https://govnokod.ru/27115 https://govnokod.xyz/_27115
#72: https://govnokod.ru/27120 https://govnokod.xyz/_27120
#73: https://govnokod.ru/27136 https://govnokod.xyz/_27136
#74: https://govnokod.ru/27160 https://govnokod.xyz/_27160
#75: https://govnokod.ru/27166 https://govnokod.xyz/_27166
#76: https://govnokod.ru/27168 https://govnokod.xyz/_27168
#77: https://govnokod.ru/27186 https://govnokod.xyz/_27186
#78: https://govnokod.ru/27219 https://govnokod.xyz/_27219
#79: https://govnokod.ru/27254 https://govnokod.xyz/_27254
#80: https://govnokod.ru/27270 https://govnokod.xyz/_27270
#81: https://govnokod.ru/27280 https://govnokod.xyz/_27280
#82: https://govnokod.ru/27284 https://govnokod.xyz/_27284
#83: https://govnokod.ru/27296 https://govnokod.xyz/_27296
#84: https://govnokod.ru/27336 https://govnokod.xyz/_27336
#85: https://govnokod.ru/27381 https://govnokod.xyz/_27381
#86: https://govnokod.ru/27405 https://govnokod.xyz/_27405
#87: https://govnokod.ru/27429 https://govnokod.xyz/_27429
#88: https://govnokod.ru/27432 https://govnokod.xyz/_27432
#89: https://govnokod.ru/27435 https://govnokod.xyz/_27435
#90: https://govnokod.ru/27439 https://govnokod.xyz/_27439
#91: https://govnokod.ru/27449 https://govnokod.xyz/_27449
#92: https://govnokod.ru/27460 https://govnokod.xyz/_27460
#93: https://govnokod.ru/27463 https://govnokod.xyz/_27463
#94: https://govnokod.ru/27466 https://govnokod.xyz/_27466
#95: https://govnokod.ru/27473 https://govnokod.xyz/_27473
#96: https://govnokod.ru/27478 https://govnokod.xyz/_27478
#97: https://govnokod.ru/27484 https://govnokod.xyz/_27484
#98: https://govnokod.ru/27495 https://govnokod.xyz/_27495
#99: https://govnokod.ru/27504 https://govnokod.xyz/_27504
#100: https://govnokod.ru/27508 https://govnokod.xyz/_27508
+2
class Animal {
name: string;
constructor(name: string) {
this.name = name;
}
speak() {
print(`${this.name} makes a noise.`);
}
}
class Dog extends Animal {
constructor(name: string) {
super(name); // call the super class constructor and pass in the name parameter
}
speak() {
print(`${this.name} barks.`);
}
}
function main() {
let d = new Dog("Mitzie");
d.speak(); // Mitzie barks.
print(d.name);
}
Я вам принес нового говнокода для нового говнокомпилятора.... дамп в следующем посту
+1
async Create(id, subscribe_yyyymmdd) {
const query = "INSERT INTO users(id,subscribe_yyyymmdd) VALUES ($1,$2) RETURNING *";
const values = [id, subscribe_yyyymmdd];
try {
const result = await this.db.query(query, values);
return result.rows[0].id;
} catch (error) {
this.logger.error(error);
}
},
async Update() {
const query = "UPDATE users SET subscribe_yyyymmdd = $1 where id=$2 RETURNING *";
const values = [id, subscribe_yyyymmdd];
try {
const result = await this.db.query(query, values);
return result.rows[0].id;
} catch (error) {
this.logger.error(error);
}
},
Из https://vk.com/wall521764930_6553 .