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

    +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
    function func($microsoft,$corn)
    {
    	$tomato=array();
    	if(!isset($corn[$microsoft])) return NULL;
    	foreach($corn[$microsoft] as $potato=>$pizza)
    	{
    		$tomato[]=$pizza;
    		$wine=$this->func($microsoft.$pizza['name'].'/',$corn);
    		if($wine)
    			foreach($wine as $anchouses)
    				$tomato[]=$anchouses;
    	}
    	return $tomato; //Где мой тамат СУКА!
    }

    Функция выполняет рекурсивную сортировку масива по ассоциативному индексу.

    dvduser, 30 Мая 2011

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

    +124

    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
    ##### curl #####
    
    GET /api/4dabd7b3816......97 HTTP/1.1
    User-Agent: curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
    Host: deepbit.net
    Accept: */*
    
    HTTP/1.1 302 Found
    Cache-Control: no-cache
    Content-length: 0
    Location: /api/4dabd7b3816......97
    Set-Cookie: *********pRd; path=/;
    
    Connection: close
    
    ##### curl #####
    
    ##### wget #####
    
    GET /api/4dabd7b3816......97 HTTP/1.0
    User-Agent: Wget/1.12 (linux-gnu)
    Accept: */*
    Host: deepbit.net
    Connection: Keep-Alive
    
    HTTP/1.1 200 OK
    Server: nginx/1.0.0
    Date: Mon, 30 May 2011 06:45:14 GMT
    Content-Type: application/json; charset=utf-8
    Connection: keep-alive
    Cache-Control: no-cache, must-revalidate
    Last-Modified: Mon, 30 May 2011 06:45:14 GMT
    Expires: Mon, 30 May 2011 06:46:14 GMT
    Content-Length: 413
    
    {data data data}
    ##### wget #####

    Lis, 30 Мая 2011

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

    +135

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    <div id="pointer_div">jQuery16104518015997745993=Object { events={...}}
    <div style="display: block; background: url("http://localhost/first/coord_mouse_on_pic/3/cr.gif") repeat scroll 0% 0% transparent; position: relative; padding: 0px; width: 615px; height: 417px;">
    <map id="htmlmap_com_4" name="htmlmap_com_4">jQuery16104518015997745993=Object { events={...}}
    <div id="myCanvas" style="position: relative; margin: 0px; padding: 0px;"></div>
    <div style="position: absolute; left: 424px; top: 195px; width: 2px; height: 2px; clip: rect(0pt, 2px, 2px, 0pt); padding: 0px; margin: 0px; background-color: red; overflow: hidden; opacity: 0.8;"></div>
    <div style="position: absolute; left: 426px; top: 195px; width: 2px; height: 2px; clip: rect(0pt, 2px, 2px, 0pt); padding: 0px; margin: 0px; background-color: red; overflow: hidden; opacity: 0.8;"></div>
    <div style="position: absolute; left: 424px; top: 197px; width: 4px; height: 2px; clip: rect(0pt, 4px, 2px, 0pt); padding: 0px; margin: 0px; background-color: red; overflow: hidden; opacity: 0.8;"></div>
    <div style="position: absolute; left: 424px; top: 197px; width: 2px; height: 0px; clip: rect(0pt, 2px, 0px, 0pt); padding: 0px; margin: 0px; background-color: red; overflow: hidden; opacity: 0.8;"></div>
    </div>

    -

    vulkan, 29 Мая 2011

    Комментарии (24)
  4. Си / Говнокод #6778

    +148

    1. 1
    2. 2
    3. 3
    4. 4
    if((s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) die("socket creating.");
    if(bind(s, (struct sockaddr*) &local, sizeof(struct sockaddr_in)) == SOCKET_ERROR) die("bind...");
    if(ioctlsocket(s, FIONBIO, &on) != 0) die("IOCTL!!!");
    if(listen(s, 16) != 0) die("WHYYYYY?!?!!!!!");

    No hard feelings.

    danilissimus, 29 Мая 2011

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

    +152

    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
    if (mysql_query("UPDATE `users` as u, `inventory` as i SET u.{$slot1} = {$id}, i.dressed = 1,
    			u.sila = u.sila + i.gsila,
    			u.lovk = u.lovk + i.glovk,
    			u.inta = u.inta + i.ginta,
    			u.intel = u.intel + i.gintel,
    			u.maxhp = u.maxhp + i.ghp,
    			u.maxmana = u.maxmana + i.gmana,
    			u.noj = u.noj + i.gnoj,
    			u.topor = u.topor + i.gtopor,
    			u.dubina = u.dubina + i.gdubina,
    			u.mec = u.mec + i.gmech,
    			u.mfire = u.mfire + i.gfire,
    			u.mwater = u.mwater + i.gwater,
    			u.mair = u.mair + i.gair,
    			u.mearth = u.mearth + i.gearth,
    			u.mlight = u.mlight + i.glight,
    			u.mgray = u.mgray + i.ggray,
    			u.mdark = u.mdark + i.gdark
    				WHERE
    			i.needident = 0 AND
    			i.id = {$id} AND
    			i.dressed = 0 AND
    			i.owner = {$user['id']} AND
    			u.sila >= i.nsila AND
    			u.lovk >= i.nlovk AND
    			u.inta >= i.ninta AND
    			u.vinos >= i.nvinos AND
    			u.intel >= i.nintel AND
    			u.mudra >= i.nmudra AND
    			u.level >= i.nlevel AND
    			((".(int)$user['align']." = i.nalign) or (i.nalign = 0)) AND
    			u.id = {$user['id']};")) {
    			$user[$slot1] = $item['id'];
    			return 	true;}
    		}

    все та же браузерка

    jQuery, 29 Мая 2011

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

    +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
    if ($user['sex']) {
    		switch(@$_GET['obraz']) {
    			case 0:
    				mysql_query("UPDATE `users` SET `shadow` = 'm0.gif' WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
    				$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
    			break;
    			case 1:
    				mysql_query("UPDATE `users` SET `shadow` = 'm1.gif' WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
    				$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
    			break;
    			case 2:
    				mysql_query("UPDATE `users` SET `shadow` = 'm2.gif' WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
    				$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
                            break;
    			/// не трудно догадаться, что здесь)
    			case 99:
    				mysql_query("UPDATE `users` SET `shadow` = 'm00.gif' WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
                                    $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
                             break;
                       }
    }

    о как

    jQuery, 29 Мая 2011

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

    +121

    1. 1
    Change mysql_query to @mysql_query and so on for the other references to suppress the error messages returned from the function calls.

    Ответ на одном форуме, относится к куску кода на PHP. Решил накласть в кучу.

    Yurik, 28 Мая 2011

    Комментарии (6)
  8. Java / Говнокод #6774

    +82

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    //////////////
       TextBuilder sb = new TextBuilder();
       sb.append("<html>");
       sb.append(new StringBuilder("<head><title>" + this.getTitle() + "</title></head><body><img src=\"....\">"));
       sb.append("</body></html>");

    В детстве видимо, матрёшек было маловато..

    VirtualVoid, 28 Мая 2011

    Комментарии (14)
  9. C# / Говнокод #6773

    +120

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    using System;
    
    class C
    {
        static void Main()
        {
            क्ष(0);
        }
    
        static void क्‍ष(int x) { Console.WriteLine(1); }
        static void क्ष(object x) { Console.WriteLine(2); }
    }

    Что будет напечатано ?


    Оч понравилось, нашел на простора интырнета (пардон если повтор)

    glilya, 28 Мая 2011

    Комментарии (24)
  10. JavaScript / Говнокод #6772

    +164

    1. 1
    IEB = (uagent.indexOf('msie') != -1) ? true : false;

    Мартин, 28 Мая 2011

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