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

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

    +93

    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
    private void Form1_Load(object sender, EventArgs e)
            {
                    this.пользователиTableAdapter.Fill(this.пользователиDataSet.Пользователи);
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
    
                string a1 = textBox1.Text;
                string a2 = a1 + ";" + textBox2.Text;
    
                int d = dataGridView1.ColumnCount-1;
                int d1 = dataGridView1.RowCount-1;
    
                for (int i = 0; i < d1; i++)
                {
                    for (int j = 0; j < d; j++)
                    {
                        if (a2 == ";")
                        {
                            MessageBox.Show("Введите логин и пароль");
                            d = 0;
                            d1 = 0;
                            break;
                        }
    
                        if (a2 == dataGridView1.Rows[i].Cells[0].Value.ToString())
                        {
                            int r1 = i;
                            int r2 = j;
    
                            string r11 = dataGridView1.Rows[r1].Cells[r2 + 1].Value.ToString() + dataGridView1.Rows[r1].Cells[r2 + 2].Value.ToString() + dataGridView1.Rows[r1].Cells[r2 + 3].Value.ToString() + dataGridView1.Rows[r1].Cells[r2 + 4].Value.ToString();
    
                            if (r11 == "++--")
                            {
                                Hide();
                                Form2 f2 = new Form2();
                                f2.ShowDialog();
                                d = 0;
                                d1 = 0;
                                this.Close();
                                break;
                            }
    
                            if (r11 == "--++")
                            {
                                Hide();
                                Form3 f3 = new Form3();
                                f3.ShowDialog();
                                d = 0;
                                d1 = 0;
                                this.Close();
                                break;
                            }
    
                            if (r11 == "--+-")
                            {
                                Hide();
                                Form4 f4 = new Form4();
                                f4.ShowDialog();
                                d = 0;
                                d1 = 0;
                                this.Close();
                                break;
                            }
                        }
    
                        int d11 = d1-1;
                        int dd = d-1;
    
                        if (j == dd && i == d11)
                        {
                            MessageBox.Show("Логин или пароль отсутствует в базе данных");
                        }
                    }
                        }
                    }      
                }
            }

    http://www.youtube.com/watch?v=MNQb-uxneYs

    lowercase, 10 Мая 2012

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

    +108

    1. 1
    2. 2
    3. 3
    4. 4
    userPerms = (Permissions)Session["permissions"];
    if (userPerms.AllUserRights["rod_view"] == null && userPerms.AllUserRights["rod_view"] == null) {
        throw new Exception("no rights");
    }

    Я по два раза по два раза не повторяю не повторяю.

    sergey_sh, 10 Мая 2012

    Комментарии (2)
  4. 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)
  5. 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)
  6. 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)
  7. Куча / Говнокод #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)
  8. PHP / Говнокод #9972

    +158

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

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

    nur, 17 Апреля 2012

    Комментарии (2)
  9. 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)
  10. 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)
  11. Си / Говнокод #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)