1. Список говнокодов пользователя guest

    Всего: 1419

  2. PHP / Говнокод #1396

    +154

    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
    <?php
    
    $socket = stream_socket_server("tcp://127.0.0.1:8982", $errno, $errstr);
    if (!$socket) 
        echo "$errstr ($errno)<br />\n";
    while (TRUE){
    	$conn = stream_socket_accept($socket);
    if(pcntl_fork() == -1) {
    			echo "Sorrr: fork failure!\n";
    			die();
    			}
    	if(pcntl_fork() == 0)
    	{
    	fwrite($conn, "Hello!\n");
    	$input=fread($conn,1024);
    	fwrite($conn,$input . "\n");
    	if ($input = "quit")
    			{
    			fwrite($conn,"Terminated");
    			fclose($conn);
    			fclose($socket);
    			sleep (5);
    			exit();
    			}else{
    			fwrite($conn,"Enter data:");
    }
    }
    }
    fclose($conn);
    ?>

    guest, 21 Июля 2009

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

    +154

    1. 1
    return !( Pattern.compile("['\"`]+").matcher(query.subSequence(0, query.length())).matches());

    Шедевр проверки на запретные символы в запросе

    guest, 21 Июля 2009

    Комментарии (4)
  4. Куча / Говнокод #1394

    +148

    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
    # /etc/fstab: static file system information.
    #
    # Use 'vol_id --uuid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    defaults        0       0
    # / was on /dev/sda1 during installation
    UUID=12179970-74dc-4673-a865-cf8af384eb4b /               ext4    relatime,errors=remount-ro 0       1
    # swap was on /dev/sda6 during installation
    UUID=059ff3fe-4866-4f54-b796-54d4a265f660 none            swap    sw              0       0
    /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0

    fstab

    guest, 21 Июля 2009

    Комментарии (5)
  5. Java / Говнокод #1393

    +134.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
    // Объявлен класс GOSTDocument extends TechDocument ( ввожу в курс дела:) )
    
    public class TechDocument
    {
    
      protected TechDocument(){} //Ибо нефиг
    
      public TechDocument getDocumentA ( Type DocType )
    {
    
            TechDocument tmpl = null;
      switch (DocType)
      {
          case DOCTYPE_GOST : tmpl = (GOSTDocument) new GOSTDocument();
          break;
    // ... Тут еще CASE всякие
          default: tmpl = new TechDocument();
          break;
      }
      return tmpl;
    
    }
    
    }

    Как бы кастинг.:)

    guest, 21 Июля 2009

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

    +149

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    for($i=1; $i<=$count; $i++) {
    	$buf = ...
    	$result = preg_match($filter, $buf, $matches);
    	if ($result > 0) {
    		fwrite($handle,"ok\n");
    		fwrite($handle, $buf);
    		exit(0);
    		fclose($handle);
    		break;
    	}
    }

    guest, 20 Июля 2009

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

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    function getPayBackTime() {
    //$time = $this->db->query("SELECT scn_id FROM sections WHERE scn_from_d<='".date("d")."' AND scn_to_d >='".date("d")."' AND scn_from_m='".date("m")."' AND scn_from_y='".date("Y")."'");
    //return $time[0]['scn_id'];
    return 12;
    }

    guest, 20 Июля 2009

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

    +143

    1. 1
    2. 2
    3. 3
    4. 4
    $i = (True)?(True?True:False):False;
    $i = !$i;
    if (($i)?(!$i?$i:!$i):$i) die('Наговнокодить!');
    die('Говнокод!');

    что выведет скрипт? ))))

    guest, 20 Июля 2009

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

    +174

    1. 1
    if (!function_exists('function_exists')) die('o_O');

    существует или нет, вот в чем вопрос

    guest, 20 Июля 2009

    Комментарии (7)
  10. PHP / Говнокод #1388

    +153

    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
    <?php
    /*
      $Id: specials.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
    
      osCommerce, Open Source E-Commerce Solutions
      http://www.oscommerce.com
    
      Copyright (c) 2003 osCommerce
    
      CRE Loaded , Open Source E-Commerce Solutions
      http://www.creloaded.com
     
      Chain Reaction Works, Inc
      Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
      
      Last Modified by $Author$
      Last Modifed on : $Date$
      Latest Revision : $Revision:$
    
    
      Released under the GNU General Public License
    */
    
      if(!tep_session_is_registered('sppc_customer_group_id')) {
      $customer_group_id = 'G';
      } else {
       $customer_group_id = $sppc_customer_group_id;
      }
    
       $random_product25 = tep_db_query("select distinct
       p.products_id, 
       pd.products_name, 
       IF(pg.customers_group_price IS NOT NULL,pg.customers_group_price, p.products_price) as products_price,
       p.products_tax_class_id, 
       p.products_image, 
       s.specials_new_products_price 
       from " . TABLE_PRODUCTS . " p 
        left join " . TABLE_PRODUCTS_GROUPS . " pg on p.products_id = pg.products_id and pg.customers_group_id like '%" . $customer_group_id . "%',
        " . TABLE_PRODUCTS_DESCRIPTION . " pd,
        " . TABLE_SPECIALS . " s 
       where 
       p.products_status = '1' 
       and p.products_id = s.products_id 
       and pd.products_id = s.products_id 
       and pd.language_id = '" . (int)$languages_id . "' 
       and s.status = '1' 
       and p.products_group_access like '%". $customer_group_id."%'
       order by rand(), s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
     
      
      $random_product24_side_row = tep_db_num_rows($random_product25);
         if ($random_product24_side_row > 0){
    
    // EOF Separate Price per Customer
    //Eversun mod end for sppc and qty price breaks
    ?>
    <!-- d specials //-->
              <tr>
                <td>
    <?php
    
    while ($product_specials22 = tep_db_fetch_array($random_product25)){
      $product_specials22_id = $product_specials22['products_id'];
      $product_specials22_image = tep_get_products_image($product_specials22['products_id']);
      $product_specials22_name = tep_get_products_name($product_specials22['products_id']);
    
      $pf->loadProduct($product_specials22['products_id'],$languages_id);
            $special_random_price = $pf->getPriceStringShort();
    }
        $info_box_contents = array();
        $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SPECIALS . '</font>');
        new infoBoxHeading($info_box_contents, tep_href_link(FILENAME_SPECIALS));
    
        $info_box_contents = array();
        $info_box_contents[] = array('align' => 'center',
                                     'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . tep_image(DIR_WS_IMAGES . $product_specials22_image, $product_specials22_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . $product_specials22_name . '</a><br>' . $special_random_price);
    
        new infoBox($info_box_contents);
         if (TEMPLATE_INCLUDE_FOOTER =='true'){
             $info_box_contents = array();
              $info_box_contents[] = array('align' => 'left',
                                            'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
                                          );
         new infoboxFooter($info_box_contents);
     }
    ?>
                </td>
              </tr>
    <!-- d specials_eof //-->
    <?php
      }
    ?>

    Судя по всему, это говнокод с CRE Loaded. Это кусок дерьма, еще и продается за большие деньги!

    guest, 20 Июля 2009

    Комментарии (0)
  11. Java / Говнокод #1387

    +78.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
    if (choice==0)
                new Browser(null, display, this, this, false);
            
            if (choice==1)
                new Browser(null, display, this, this, true);
            
            if (choice==2)
                new Browser(null, display, this, this, false);
            
            if (choice==3)
                new Browser(null, display, this, this, true);
            
            if (choice==4)
                new Browser(null, display, this, this, false);
            
            if (choice==5)
                new Browser(null, display, this, this, true);
            
            if (choice==6)
                new Browser(null, display, this, this, false);
            
            if (choice==7)
                new Browser(null, display, this, this, true);

    Сохранить, загрузить, сохранить, загрузить...

    guest, 19 Июля 2009

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