1. Лучший говнокод

    В номинации:
    За время:
  2. PHP / Говнокод #10220

    +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
    [production]
    phpSettings.display_startup_errors = 0
    phpSettings.display_errors = 0
    includePaths.library = APPLICATION_PATH "/../library"
    bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
    bootstrap.class = "Bootstrap"
    appnamespace = "Application"
    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
    resources.frontController.params.displayExceptions = 0
    
    resources.log.khuy.writerName = "Firebug"
    
    resources.view.helperPath.Zend_View_Helper = APPLICATION_PATH "/../library/Zend/View/Helper"
    resources.view.helperPath.My_View_Helper = APPLICATION_PATH "/views/helpers"
    [staging : production]
    
    [testing : production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    
    [development : production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    resources.frontController.params.displayExceptions = 1

    __proto__, 08 Мая 2012

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

    +96

    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
    // expressions to parse
    		$input_pars = array(
    			's:2'=>'(sort(\d+)/?)?', 				//1-2
    			'id:2'=>'((\d+)/?)?',  			 		//3-4
    			'utkonos_id-shop_id:2-2'=>'(u(\d+)(s(\d+))?/)?', 	//5-6 7-8
    			'iid:1'=>'([0-9a-zA-Z_]+)/?', 				//9
    			'page:2'=>'(pg(\d+)/)?', 				//10-11
    			'chpsize:2'=>'(chp(\d+)/)?', 				//12-13
    			'chlist:2'=>'(chlist_(grid|list)/)?', 				//14-15
    			'p_other:1'=>'(.*)',					//16
    		);
    		if(!$class)unset($input_pars['iid:1']);
    		$m = array();
    		$i=0;
    
    		if(isset($_REQUEST['p_'])&&preg_match('[^'.implode('',$input_pars).'$]',$_REQUEST['p_'],$m)) {
    			//vd($m);
    			foreach($input_pars as $key=>$line) {
    				list($par_name,$num) = explode(':', $key);
    				$par_name_arr = explode('-',$par_name);
    				$num_arr = explode('-',$num);
    				if(count($par_name_arr)>1) {
    					foreach($par_name_arr as $kluch => $par_name) {
    						$i += $num_arr[$kluch];
    						$_REQUEST[$par_name] = $m[$i];
    					}
    				}else{
    					$i += $num;
    					$_REQUEST[$par_name] = $m[$i];
    				}
    			}
    			$_REQUEST['id'] += 0;
    			if ($_REQUEST['s'] === '0') {
    				$_REQUEST['s'] = 0;
    			}
    			if ($_REQUEST['chpsize'] === '0') {
    				$_REQUEST['chpsize'] = 0;
    			}
    			vd($_REQUEST);
    		}else{
    			$_REQUEST['s'] = grv('s',-1);						/// Сортировка
    			$_REQUEST['id'] = grv('id',0);
    			$_REQUEST['shop_id'] = grv('shop_id',0);
    			$_REQUEST['page'] = grv('page',0);
    			$_REQUEST['chpsize'] = (int)grv('chpsize',-1);
    		}

    ggg, 23 Апреля 2012

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

    +95

    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
    <table style="width: 100%">
    				<tr>
    					<td rowspan="2" style="width: 39px">&nbsp;</td>
    					<td height="22px" width="306px" background="/templates/images/all_for_your.jpg" style="background-repeat: no-repeat;"></td>
    					<td>&nbsp;</td>
    				</tr>
    				<tr>
    					<td width="306px">
    						<table  class="style2" style="height: 147px;" >
    <tr>
    					<!--<td height="22px" width="306px" background="/templates/images/all_for_your.jpg">
    				</td>-->
    				</tr>
    				<tr>
    					<td class="style14" style="height: 21px;"><a href="page13.html" <?php if ($_GET['id'] == 13) echo "style=\"color: red;\""; ?>> ччччч</td>
    				</tr>
    								<tr>
    					<td class="style14" style="height: 21px;"><a href="page12.html" <?php if ($_GET['id'] == 12) echo "style=\"color: red;\""; ?>> фвургия</td>
    				</tr>
    								<tr> 
    					<td class="style14" style="height: 21px; ">
    					<a href="page8.html" <?php if ($_GET['id'] == 8) echo "style=\"color: red;\""; ?>> ывфыв</a> </td>
    			    </tr>
    				<tr>
    					<td class="style14" style="height: 21px; ;"><a href="page9.html" <?php if ($_GET['id'] == 9) echo "style=\"color: red;\""; ?>> ыывсия</td>
    				</tr>
    				<tr>
    					<td class="style14" style="height: 21px; "><a href="page43.html" <?php if ($_GET['id'] == 43) echo "style=\"color: red;\""; ?>> Вмиика</td>
    				</tr>				
    				<tr>
    					<td class="style14" style="height: 21px; "><a href="page10.html" <?php if ($_GET['id'] == 10) echo "style=\"color: red;\""; ?>>ние</td>
    				</tr>
    					<tr>
    					<td class="style14" style="height: 21px; "><a href="page14.html" <?php if ($_GET['id'] == 14) echo "style=\"color: red;\""; ?>>Одыа 
    					</td>
    				</tr>
    					<tr>
    					<td class="style14" style="height: 21px; "><a href="page22.html" <?php if ($_GET['id'] == 22) echo "style=\"color: red;\""; ?>> Оысия</td>
    				</tr>
    			</table>

    Один из старых сайтов нашел:)

    EGR, 23 Апреля 2012

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

    +91

    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
    #include <amxmodx>
    
    new g_MsgSync
    new g_MsgSync2
    
    new isConnected[33 char]
    
    public plugin_init()
    {
       register_plugin("Damager", "1.0", "Prayer")
       
       register_event("Damage", "EVENT_Damage", "b", "2!0", "3=0", "4!0")
       
       g_MsgSync = CreateHudSyncObj()
       g_MsgSync2 = CreateHudSyncObj()
    }
    
    public client_putinserver(id)
    {
       isConnected{id} = true
    }
    
    public client_disconnect(id)
    {
       isConnected{id} = false
    }
    
    public EVENT_Damage(id)
    { 
       if(isConnected{id})
       {
          static damage, pid
          damage = read_data(2)
          
          set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
          ShowSyncHudMsg(id, g_MsgSync2, "%d", damage)
       
          pid = get_user_attacker(id)
          
          if((pid > 0) && (pid < 33) && isConnected{pid})
          {
             set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
             ShowSyncHudMsg(pid, g_MsgSync, "%d", damage)
          }
       }
    }

    Это павн переработанный вельвом. Кто писал плагины для CS тот поймёт всю соль.

    Dg_INC, 22 Апреля 2012

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

    +158

    1. 1
    if($_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest") die("Вот тебе и лол...");

    неибическая защита от обычных запросов через урл в адресной строке)

    nur, 17 Апреля 2012

    Комментарии (2)
  7. C++ / Говнокод #9969

    +139

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    #include <iostream>
    #include <conio.h>
    
    #define true false // Wish you happy debug!
    
    int main(int argc, char* argv[])
    {
        std::cout << (((1+1)==2) ? true : false);
    
        getch();
        return 0;
    }

    Wish you happy debug!

    ipchelnikov, 17 Апреля 2012

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

    +1000

    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
    template<class THTTPServerSettings_>
    	class TSettingsApplyer: public TAbstractSettingsApplyer
    	{
    	private:
    		enum
    		{
    			RESPONSE_BUFFER_SIZE=THTTPServerSettings_::ResponseBufferSize>THTTPServerSettings_::FullBufferedResponseSize?THTTPServerSettings_::ResponseBufferSize:THTTPServerSettings_::FullBufferedResponseSize
    		};
    		char _requestBuffer[THTTPServerSettings_::RequestBufferSize];
    		char _responseBuffer[RESPONSE_BUFFER_SIZE];
    		char _requestHeaderBuffer[THTTPServerSettings_::RequestHeaderBufferSize];
    		char _responseHeaderBuffer[THTTPServerSettings_::ResponseHeaderBufferSize];
    		
    	public:
    		TSettingsApplyer(void);
    		virtual void* const GetRequestBuffer(void) const;
    		virtual void* const GetRequestHeaderBuffer(void) const;
    		virtual void* const GetResponseBuffer(void) const;
    		virtual void* const GetResponseHeaderBuffer(void) const;
    		virtual const size_t GetPort(void) const;
    		virtual const size_t GetRequestBufferSize(void) const;
    		virtual const size_t GetRequestHeaderBufferSize(void) const;
    		virtual const size_t GetResponseBufferSize(void) const;
    		virtual const size_t GetResponseHeaderBufferSize(void) const;
    	};
    //...
    template<class TSettings>
    	THTTPServer( TSettings settings ):
    		_SettingsApplyer(*(::new TSettingsApplyer< TSettings >)),

    Говногость, 16 Апреля 2012

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

    +128

    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
    #ifndef __KERNEL__
    /* Multicast groups - backwards compatiblility for userspace */
    #define SELNL_GRP_NONE		0x00000000
    #define SELNL_GRP_AVC		0x00000001	/* AVC notifications */
    #define SELNL_GRP_ALL		0xffffffff
    #endif
    
    enum selinux_nlgroups {
    	SELNLGRP_NONE,
    #define SELNLGRP_NONE	SELNLGRP_NONE
    	SELNLGRP_AVC,
    #define SELNLGRP_AVC	SELNLGRP_AVC
    	__SELNLGRP_MAX
    };
    #define SELNLGRP_MAX	(__SELNLGRP_MAX - 1)

    Linux 3.3.0
    include/linux/selinux_netlink.h

    myaut, 15 Апреля 2012

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

    +114

    1. 1
    EventTypeId = (int)Enum.Parse(typeof(AmazonMailingLogEventType), Enum.GetName(typeof(AmazonMailingLogEventType), AmazonMailingLogEventType.SendEmailError))

    вместо
    EventTypeId = (int)AmazonMailingLogEventType.SendEmail Error

    mozg_raka, 11 Апреля 2012

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

    +150

    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
    <tr class="cursor-over">
            <td><i class="fs12">Сегодня</i></td>
            <td><?= isset($today_stat['Отправлен']) ? $today_stat['Отправлен'] : 0 ?> <?=
    HTML::image('media/img/private/good.png',
            array('class' => 'png_bg', 'alt' => ''))
    ?></td>
            <td><?= isset($today_stat['В обработке']) ? $today_stat['В обработке'] : 0 ?></td>
            <td><?= isset($today_stat['Возврат']) ? $today_stat['Возврат'] : 0 ?></td>
            <td><?= isset($today_stat['Отказ']) ? $today_stat['Отказ'] : 0 ?> <?=
                HTML::image('media/img/private/error.png',
                        array('class' => 'png_bg', 'alt' => ''))
    ?></td>
        </tr>
        <tr class="cursor-over">
            <td><i class="fs12">Вчера</i></td>
            <td><?= isset($yesterday_stat['Отправлен']) ? $yesterday_stat['Отправлен'] : 0 ?> <?=
                HTML::image('media/img/private/good.png',
                        array('class' => 'png_bg', 'alt' => ''))
    ?></td>
            <td><?= isset($yesterday_stat['В обработке']) ? $yesterday_stat['В обработке'] : 0 ?></td>
            <td><?= isset($yesterday_stat['Возврат']) ? $yesterday_stat['Возврат'] : 0 ?></td>
            <td><?= isset($yesterday_stat['Отказ']) ? $yesterday_stat['Отказ'] : 0 ?> <?=
                HTML::image('media/img/private/error.png',
                        array('class' => 'png_bg', 'alt' => ''))
    ?></td>
        </tr>

    это кусок шаблона, в котором, "опытный" программист выводит некую статистику за некий период

    login, 11 Апреля 2012

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