1. PHP / Говнокод #484

    +169.8

    1. 1
    2. 2
    3. 3
    if ( isset($_GET['action']) && !isset($_GET['action']) ) {
        die('Не не не, Девид Блейн, не не не!!!!! Сдрысни демон!!!!!');
    }

    o_O

    guest, 31 Января 2009

    Комментарии (3)
  2. Pascal / Говнокод #483

    +141.5

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    procedure TForm2.s1;
    var a,a1:real;
    begin
    a:=a+1.8;
    randomize;
    if p<1 then
    begin
    if a<1.9 then
    begin
    a:=999;
    a1:=random(4);
    if a1=2 then
    begin
    GroupBox5.Visible:=True;
    GroupBox6.Visible:=False;
    GroupBox1.Visible:=False;
    end
    else
    if a1=3 then
    begin
    GroupBox5.Visible:=False;
    GroupBox6.Visible:=True;
    GroupBox1.Visible:=False;
    end
    else
    begin
    GroupBox5.Visible:=False;
    GroupBox6.Visible:=False;
    GroupBox1.Visible:=True;
    end
    end
    end
    end;

    0_o

    guest, 31 Января 2009

    Комментарии (0)
  3. PHP / Говнокод #482

    +151.1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $this->oPostTest->recipients = trim($this->oPostTest->recipients);
    $this->oPostTest->recipients = trim($this->oPostTest->recipients, ';');
    
    $this->oPostTest->recipients = str_replace(' ', ';', $this->oPostTest->recipients);
    $this->oPostTest->recipients = str_replace(';;', ';', $this->oPostTest->recipients);

    такая вот загагулина )

    guest, 30 Января 2009

    Комментарии (1)
  4. C++ / Говнокод #481

    +154.3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    double a, b;
    
    ...
    
     *((DWORD*)&a) ^= *((DWORD*)&b);
     *((DWORD*)&b) ^= *((DWORD*)&a);
     *((DWORD*)&a) ^= *((DWORD*)&b);
     *((DWORD*)&a + 1) ^= *((DWORD*)&b + 1);
     *((DWORD*)&b + 1) ^= *((DWORD*)&a + 1);
     *((DWORD*)&a + 1) ^= *((DWORD*)&b + 1);

    Cпособ обменять значения двух переменных типа double;

    guest, 30 Января 2009

    Комментарии (6)
  5. PHP / Говнокод #480

    +152.9

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    if (isset($this->handle) || !isset($this->handle) {
         echo "Не правильный тип ресурса... или не тип ресурса не известен..."
    }
    ...
    ...
    ...

    Проверим дескриптор :D

    guest, 30 Января 2009

    Комментарии (4)
  6. PHP / Говнокод #479

    +143

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if ($src_encoding == '')
    {
        // lame, but we know no better...
        $src_encoding = $GLOBALS['xmlrpc_internalencoding'];
    }

    guest, 30 Января 2009

    Комментарии (0)
  7. Си / Говнокод #478

    +108.6

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    void init()
    {
      int i;
    
      for(i=0;i<4;i++)
        ALG_RxConst[i] = -1;
    
      for(i=0;i<4;i++)
        ALG_TxConst[i] = -1;
    
      for(i=0;i<4;i++)
        ALG_EqInfo[i][0] = 0;
    
      for(i=0;i<4;i++)
        ALG_EqInfo[i][1] = -1;
    
      for(i=0;i<4;i++)
        ALG_EqInfo[i][2] = -1;
    }

    Индусу очень-очень нравится for ;)

    guest, 29 Января 2009

    Комментарии (5)
  8. PHP / Говнокод #477

    +160.1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    class Company extends BaseCompany {
    //...
        public function setName($v){
            $this->setName(String::mb_ucfirst($v));
        }
    //...
    }

    Мегаметодика переопределения сеттеров. Symfony, Propel.

    guest, 29 Января 2009

    Комментарии (6)
  9. PHP / Говнокод #476

    +150

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    {? if (!isset($edit_style)) ?}
    <form action="disp.php?action=style_add" method="post">
    {? else ?}
    <form action="disp.php?action=style_edit" method="post">
    <input type="hidden" name="id" value="{? $edit_style.id ?}">
    {? /if ?}
    ...
    ...
    <td><input type="submit" value="{? if (isset($edit_style)) ?}Save{? else ?}Add{? /if ?}"></td>
      Ю

    guest, 29 Января 2009

    Комментарии (2)
  10. Pascal / Говнокод #475

    +138.9

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    1000:
        nume:=0;
        for i:=1 to mmes do work^[i]{^}:=work^[i]{^}+hde;
        iter:=iter+1;
        for j:=1 to 2 do
    begin
        if j=1 then w:=work^[1]{^};
        if j=2 then w:=work^[mmes]{^}  ;
        ab:=2*sqrt(3.*abs(1.-w));
        w1:=ab;
        for i:=1 to 10 do
    begin
        w2:=ab * sqrt(1.+w1);
        if abs(w2-w1)<1.e-6 then goto 18;
        w1:=w2
    end;
    18:
      wkb:=(1.+w2)/w;
      if j=1 then rpsi[1]^:=work^[2]{^}*wkb;
      if j=2 then rpsi[mmes]^:=work^[m1]{^}*wkb
    end;
      b:=rpsi[mmes]^;
      for i:=1 to m1 do
    begin
        npsi:=mmes-i;
        a:=(12./work^[npsi]{^}-10.0)-1./b;
        rpsi[npsi]^:=a;
        b:=a;
        if a<=1. then goto 30
    end;
    30:
      mcross:=npsi;
      rmcros:=a;
      b:=rpsi[1]^;
      for i:=2 to mcross do
    begin
        a:=(12./work^[i]{^}-10.0)-1./b;
        rpsi[i]^:=a;
        b:=a;
        if a<0. then nume:=nume+1
    end;
       if (iter=1) and (nume<num) then writeln('error in initial Eh');
       if nume=num then goto 50;
       if (not bisec) then writeln('give left energy El');
       if (succes) then goto 60;
       if nume>num then eh:=enew;
       if nume<num then el:=enew;
       goto 80;
    50:
      m3:=mcross+1;
      m4:=mcross-1;
      a:=1.-0.5/work^[m3]{^};
      a1:=a*(1./rpsi[m3]^-rpsi[mcross]^);
      b:=1.-0.5/work^[m4]{^};
      b1:=b*(rmcros-1./rpsi[m4]^);
      de:=(a1-b1)*work^[mcross]{^};
      if de>0. then eh:=enew;
      if de<0. then el:=enew;
      it:=it+1;
      goto 70;
    60:
       it:=0;
    70:
       if it>=maxit then goto 100;
    80:
       eold:=enew;
       delta:=(el-eh)*0.5;
       enew:=eh+delta;
       hde:=hsq12*(enew-eold);
       succes:=false;
      {writeln  ('delta=',delta); }
       if abs(delta)>1.e-10 then goto 1000;
      {writeln('enew=',enew);  }
       if nume=num then goto 90;
       writeln ('degeneration : num-state=nume-state ');
       halt;
    90:
    {  lip:=true; }
    100:
      succes:=true;

    1 из 3-х модулей, которые мне нужно оснастить ГУИ, оптимизировать и привнести абстракцию...

    guest, 29 Января 2009

    Комментарии (9)