- 1
Пиздец-оффтоп #25Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
Пиздец-оффтоп #25
            #1: https://govnokod.ru/26503 https://govnokod.xyz/_26503
#2: https://govnokod.ru/26541 https://govnokod.xyz/_26541
#3: https://govnokod.ru/26583 https://govnokod.xyz/_26583
#4: https://govnokod.ru/26689 https://govnokod.xyz/_26689
#5: https://govnokod.ru/26784 https://govnokod.xyz/_26784
#5: https://govnokod.ru/26839 https://govnokod.xyz/_26839
#6: https://govnokod.ru/26986 https://govnokod.xyz/_26986
#7: https://govnokod.ru/27007 https://govnokod.xyz/_27007
#8: https://govnokod.ru/27023 https://govnokod.xyz/_27023
#9: https://govnokod.ru/27098 https://govnokod.xyz/_27098
#10: https://govnokod.ru/27125 https://govnokod.xyz/_27125
#11: https://govnokod.ru/27129 https://govnokod.xyz/_27129
#12: https://govnokod.ru/27184 https://govnokod.xyz/_27184
#13: https://govnokod.ru/27286 https://govnokod.xyz/_27286
#14: https://govnokod.ru/27298 https://govnokod.xyz/_27298
#15: https://govnokod.ru/27322 https://govnokod.xyz/_27322
#16: https://govnokod.ru/27328 https://govnokod.xyz/_27328
#17: https://govnokod.ru/27346 https://govnokod.xyz/_27346
#18: https://govnokod.ru/27374 https://govnokod.xyz/_27374
#19: https://govnokod.ru/27468 https://govnokod.xyz/_27468
#20: https://govnokod.ru/27469 https://govnokod.xyz/_27469
#21: https://govnokod.ru/27479 https://govnokod.xyz/_27479
#22: https://govnokod.ru/27485 https://govnokod.xyz/_27485
#23: https://govnokod.ru/27493 https://govnokod.xyz/_27493
#24: https://govnokod.ru/27501 https://govnokod.xyz/_27501
        
+2
abstract class Department {
    constructor(public name: string) {}
    printName(): void {
        print("Department name: " + this.name);
    }
    abstract printMeeting(): void; // must be implemented in derived classes
}
class AccountingDepartment extends Department {
    constructor() {
        super("Accounting and Auditing"); // constructors in derived classes must call super()
    }
    printMeeting(): void {
        print("The Accounting Department meets each Monday at 10am.");
    }
    generateReports(): void {
        print("Generating accounting reports...");
    }
}
function main() {
    let department: Department; // ok to create a reference to an abstract type
    department = new AccountingDepartment(); // ok to create and assign a non-abstract subclass
    department.printName();
    department.printMeeting();
    //department.generateReports(); // error: department is not of type AccountingDepartment, cannot access generateReports
    print("done.");
}Алилуя - я вам абстракты принес :)
+1
/* В отдельном файле */
function Skif_Email(auth,em) {
	em = em.substring(3,em.length-3);
	auth = auth.substring(4,auth.length-4);
	document.write('<a href="mailto:',em,'" title="Защищён от спам-роботов">',auth,'</a>');
}
/* На странице */
<script type="text/javascript">Skif_Email('[email protected]', '[email protected]');</script>Какая защита )))
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);