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

    +165

    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
    <?php
    #-----------------------------------------------------#
    #          ********* ROTORCMS *********               #
    #              Made by  :  VANTUZ                     #
    #               E-mail  :  [email protected]         #
    #                 Site  :  http://pizdec.ru           #
    #             WAP-Site  :  http://visavi.net          #
    #                  ICQ  :  36-44-66                   #
    #  Вы не имеете право вносить изменения в код скрипта #
    #        для его дальнейшего распространения          #
    #-----------------------------------------------------#	
    require_once ('includes/start.php');
    require_once ('includes/functions.php');
    require_once ('includes/header.php');
    include_once ('themes/' . $config['themes'] . '/index.php');
    
    if (empty($_GET['p'])) {
        include_once (BASEDIR . 'includes/info.php');
        include_once (DATADIR . 'main/index_head.dat');
        include_once (DATADIR . 'main/begin.dat');
        include_once (DATADIR . 'main/index.dat');
        include_once (DATADIR . 'main/index_foot.dat');
    } else {
        if (empty($_GET['f'])) {
            $_GET['f'] = 'index';
        } 
        if (preg_match('|^[a-z0-9_\-]+$|i', $_GET['p']) && preg_match('|^[a-z0-9_\-]+$|i', $_GET['f'])) {
            if (file_exists('files/' . $_GET['p'] . '/' . $_GET['f'] . '.' . $config['ras'])) {
                include_once ('files/' . $_GET['p'] . '/' . $_GET['f'] . '.' . $config['ras']);
            } else {
                show_error('Ошибка! Файл с данными параметрами не найден!');
            } 
        } else {
            show_error('Ошибка! Недопустимое название страницы!');
        } 
    
        echo '<img src="' . BASEDIR . 'images/img/act_home.gif" alt="image" /> <a href="' . BASEDIR . 'index.php?' . SID . '">На главную</a>';
    } 
    
    include_once ('themes/' . $config['themes'] . '/foot.php');
    
    ?>

    Представляем вашему вниманию первую версию движка RotorCMS!!!

    p.s. Угадайте где здесь говнокод?)

    lads, 11 Августа 2010

    Комментарии (23)
  2. PHP / Говнокод #3933

    +167

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $url=$_SERVER['QUERY_STRING'];
    parse_str($url, $out);
    @$tbname=$out['tbname'];
    @$pname=$out['pname'];
    @$sub=$out['sub'];

    http://forum.php.su/topic.php?forum=60&topic=1371#1281343178

    А как ВЫ принимаете параметры запроса?

    Uchkuma, 10 Августа 2010

    Комментарии (15)
  3. C# / Говнокод #3932

    +144

    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
    static void Main(string[] args)
            {
                int[,] mas = new int[5, 5];
                Random rnd = new Random();
                for (int i = 0; i < 5; i++)
                {
                    for (int j = 0; j < 5; j++)
                    {
                        mas[i, j] = rnd.Next(0, 100);
                        Console.Write(mas[i, j] + "\t");
                    }
                    Console.WriteLine();
                }
            }

    Ebaw, 10 Августа 2010

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

    +111

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    string filename = "pasker_ltd.xls";
                         string ConnectionString = String.Format("Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0}; Extended Properties=Excel 8.0;", filename);
                DataSet ds = new DataSet("EXCEL");
                OleDbConnection cn = new OleDbConnection(ConnectionString);
                cn.Open();
                DataTable schemaTable =cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,new object[] { null, null, null, "TABLE" });
                string sheet1 = (string)schemaTable.Rows[0].ItemArray[2];
                string select = String.Format("SELECT * FROM [{0}]", sheet1);
                OleDbDataAdapter ad = new OleDbDataAdapter(select, cn);
                ad.Fill(ds);
                DataTable tb = ds.Tables[0];
                dataGridView1.DataSource = tb;

    Ebaw, 10 Августа 2010

    Комментарии (0)
  5. C# / Говнокод #3930

    +104

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    int x = 1, z = ++x + x;
    Console.WriteLine (x.ToString () + "  " + z.ToString ());
    x = 1;
    int z1 = x + ++x;
    Console.WriteLine (x.ToString ()  + "  " + z1.ToString ());

    Вот такой код

    Ebaw, 10 Августа 2010

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

    +171

    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
    include('conf.php');
    
    $domen=strip_tags($_POST['domain']);
    $descr=strip_tags($_POST['descr']);
    $admin=strip_tags($_POST['admin']);
    $tech=strip_tags($_POST['tech']);
    $nserver1=strip_tags($_POST['nserver1']);
    $nserver2=strip_tags($_POST['nserver2']);
    $mail=strip_tags($_POST['changed']);
    $submit=strip_tags($_POST['s']);
    
    if($_POST['s']){
    $simbol='|[^a-z0-9-]|i'; if(!preg_match($simbol, $domen)) {
    if($domen){ 
    if($descr){ 
    if($admin){
    if($tech){
    if($nserver1){
    if($nserver2){
    if($mail){if (preg_match("|[0-9a-z^_]+@[0-9a-z_^.]+.[a-z]{2,3}|i",$mail)){
    
    $headers = "Content-Type: text/plain; charset=windows-1251\n";
    $headers .= "From: ".$_POST['changed']."\n";
    $headers .= "X-Priority: 3\r\n";
    
    $tem="ADD $domen.org.ua";
    
    $msg ="domain: $domen.org.ua
    descr: $descr
    admin-c: $admin
    tech-c:  $tech
    nserver: $nserver1
    nserver: $nserver2
    changed: $mail ".date("Ymd")."
    source: UANIC";
    
    mail("[email protected]", "$tem", $msg, $headers);
    
    echo "Заявка отправлена со следующими данными:<br><br>";
    echo"Название домена: <strong><font color=\"#ff0000\">$domen.org.ua</font></strong><br>";
    echo"Описание домена: <strong><font color=\"#ff0000\">$descr</font></strong><br>";
    echo"Администратор домена: <strong><font color=\"#ff0000\">$admin</font></strong><br>";
    echo"Технический контакт домена: <strong><font color=\"#ff0000\">$tech</font></strong><br>";
    echo"DNS Сервер № 1: <strong><font color=\"#ff0000\">$nserver1</font></strong><br>";
    echo"DNS Сервер № 1:  <strong><font color=\"#ff0000\">$nserver2</font></strong><br>";
    echo"Ваш E-mail: <strong><font color=\"#ff0000\">$mail</font>   ".date("Ymd")."</strong><br><br>";
    echo"В течении 10 минут проверьте ваш почтовый ящчик <strong><font color=\"#00ff00\">$mail</font></strong> на наличие ссылки о подтверждении регистрации доменного имени";
    exit(); 
    
    }else{echo "<center>$error9<br>"; include('index.html');  die;}
    }else{echo "<center>$error8<br>"; include('index.html');  die;}
    }else{echo "<center>$error7<br>"; include('index.html');  die;}
    }else{echo "<center>$error6<br>"; include('index.html');  die;}
    }else{echo "<center>$error5<br>"; include('index.html');  die;}
    }else{echo "<center>$error4<br>"; include('index.html');  die;}
    }else{echo "<center>$error3<br>"; include('index.html');  die;}
    }else{echo "<center>$error2<br>"; include('index.html');  die;}
    }else{echo "<center>$error10<br>"; include('index.html');  die;}
    }else{echo "<center>$error1<br>"; include('index.html');  die;}

    ящчик :D

    GoodTalkBot, 10 Августа 2010

    Комментарии (3)
  7. Java / Говнокод #3928

    +73

    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
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    class game {
      public static void main (String args[])
          throws java.io.IOException {
     
        double x = 0.0;
        byte php = 100, mhp = 100, pd = 0, md = 0;
        char pd_ch;
        boolean b1, b2;
     
        System.out.println("Welcome to \"Kill the mob\" v0.1!");
        System.out.println();
        System.out.println("While you where wandering in deep dark tunnels, a mob appeared in your way.");
        System.out.println("It appeared to be very agressive, so a fight started.");
        System.out.println();
     
        do {
          System.out.println("Your opponent is ready to act. You need to do something. What are you going to do?");
          System.out.print("Enter \"1\" to attack, \"2\" to defend yourself and \"3\" to regenerate: ");
          pd_ch = (char) System.in.read();
          if (pd_ch == '1')
            pd = 1;
          else if (pd_ch == '2')
            pd = 2;
          else
            pd = 3;
          x = Math.random();
          if (x < 0.33333)
            md = 1;
          else if (x > 0.66666)
            md = 3;
          else
            md = 2;
          System.out.println(md);
          System.out.println(pd);
          switch(pd) {
            case 1:
              System.out.print("You chose to attack, while mob chose to ");
              switch (md) {
                case 1:
                  System.out.println("attack too!");
                  System.out.println("You both lose 20 HP.");
                  php -= 20;
                  mhp -= 20;
                  break;
                case 2:
                  System.out.println("defend.");
                  System.out.println("You did not manage to hurt him.");
                  break;
                case 3:
                  System.out.println("regenerate.");
                  System.out.println("He lost 30 HP.");
                  mhp -= 30;
                  break;
              }
              break;
            case 2:
              System.out.print("You chose to defend, while mob chose to ");
              switch (md) {
                case 1:
                  System.out.println("attack.");
                  System.out.println("You did not let him hurt you.");
                  break;
                case 2:
                  System.out.println("defend too!");
                  System.out.println("You standed like two retards.");
                  break;
                case 3:
                  System.out.println("regenerate.");
                  System.out.println("He gained 20 HP.");
                  mhp += 20;
                  break;
              }
              break;
            case 3:
              System.out.print("You chose to regenerate, while mob chose to ");
              switch (md) {
                case 1:
                  System.out.println("attack.");
                  System.out.println("You was completely protectless. you you've lost 30 HP.");
                  php -= 30;
                  break;
                case 2:
                  System.out.println("defend.");
                  System.out.println("He standed like a retard, while you gained 20 HP.");
                  php += 20;
                  break;
                case 3:
                  System.out.println("regenerate too!");
                  System.out.println("Your energies helped each other, so you both gained 30 HP.");
                  mhp += 30;
                  php += 30;
                  break;
              }
              break;
          }
          System.out.println("Your HP: " + php);

    Цикл после одного ввода делается какого-то хуя 3 раза, причем с рандомными (1, 2, 3) pd и md. ЧЯДНТ?

    jesuschrist, 10 Августа 2010

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

    +163

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    foo(int objType)
    {
      std:string sObjType;
      char outStr[256];
      memset(outStr,NULL,256);
      sprintf(outStr,"0x%x",(unsigned int)objType);
      sObjType = outStr;
      //…
      std::ostringstream str;
      str << "Ready: list of objects, type " << sObjType;
      TRACE(str.str());
    }

    belca, 10 Августа 2010

    Комментарии (5)
  9. ActionScript / Говнокод #3926

    −173

    1. 1
    this.title = "Detail for " + this.parentApplication.loadedContent.cbPeriod.selectedItem.name + ", " + drillParam[0] + ", " + headerName[int(drillParam[2]) - 1] + ", " + this.parentApplication.loadedContent.cbClient.selectedItem.name;

    dimas_art, 10 Августа 2010

    Комментарии (0)
  10. C# / Говнокод #3925

    +117

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    using System;
    class PleaseSayUra
    {
    static void WriteHelloSam()
    {
    Console.WriteLine("Hellosam");
    WriteHelloSam();
    }
    }

    >>Пытаюсь вызвать метод, а программа пишет ошибка "Не содержит статического метода "Main", подходящего для точки входа ConsoleApplication1" Рассажите что такое?
    http://otvet.mail.ru/question/43958756/

    This is obvious, 10 Августа 2010

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