1. Куча / Говнокод #15797

    +142

    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
    // основная функция запуска
    func main($script){
        //устанавливаем значение переменной
        $caption = "гыыы кальулятор";
        
        //грузим иконку
    	$calc_icon= library_load_icon(library_load("shell32.dll"),307);
    	
    	//создаем окошко))
    	$main_window=gui_window("TCalc",$caption,$_WS_SYSMENU+$_WS_VISIBLE+$_WS_CAPTION,$_CW_DESKTOPCENTER,$_CW_DESKTOPCENTER,200,100,$calc_icon,0,0,"WindowFunc");
    	
    	gui_control($main_window,"button","ok",201,$_WS_CHILD+$_WS_VISIBLE+$_BS_DEFPUSHBUTTON+$_BS_FLAT,152,16,32,16);
    	gui_control($main_window,"edit","2+7",202,$_WS_CHILD+$_WS_VISIBLE,2,15,130,15);
    	gui_control($main_window,"static","Ready",203,$_WS_CHILD+$_WS_VISIBLE,16,36,130,16);
    	
    	//иконка в трее...
    	tray_icon($main_window,$calc_icon,"ГАЛЬГУЛЯТОР",$_NIM_ADD);
    	tray_icon_show_balloon($main_window,"[$caption] -> Startup","Добро пожаловать в программу\nСоздано с неизвестным языком (название не придумал)",4);
    	idle(); //перевод программы в режим ожидания
    }
    	 
    func WindowFunc($hwnd,$msg,$param,$id){ //обработка сообщений виндоуса
    	if($msg==$_WM_CLOSE){  //если крестик нажали
    		tray_icon($main_window,$calc_icon,null,$_NIM_DELETE);  //удаляем иконку
    		close();  //выходим
    	}
    	if($msg==$_WM_COMMAND){  //если нажали кнопку
    		if($id==201){ //click ok  //определяем ID   //math_compiler - производить математические операции
    			$res=math_compiler(gui_get($hwnd,202)); //gui_get - получить текст
    			if length($res)==0 {                    //gui_set - установить текст
    				$res="[ERROR]";
    				tray_icon_show_balloon($hwnd,"[$caption] -> Ашипка","Нивазможна\nправирить текст!",2);
    			}else{
    				tray_icon_show_balloon($hwnd,"[$caption] -> Result",gui_get($hwnd,202)." = $res",4);
    			}
    			gui_set($hwnd,203,$res);
    		}
    	}
    }

    Названия языка нет..

    Mobac, 20 Апреля 2014

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

    +143

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    Lol1 = "1", Lol2 = "2"
    set lols = array
    lols.append Lol1
    lols.append Lol2
    set result = string
    result = lols.foldl1 (++)
    Put result

    Название языка ещё не придумал :)

    Mobac, 20 Апреля 2014

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

    +155

    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
    /**
    * Handles Registration Links.
    *
    * @package s2Member\Registrations
    * @since 3.5
    *
    * @attaches-to ``add_action("init");``
    *
    * @return null Or exits script execution after redirection.
    */
    public static function register ()
    {
    	do_action ("ws_plugin__s2member_before_register", get_defined_vars ());
    
    	if (!empty ($_GET["s2member_register"])) // If they're attempting to access the registration system.
    		{
    			while (@ob_end_clean ()); // Clean any existing output buffers.
    
    			$msg_503 = _x ('<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance.', "s2member-front", "s2member");
    
    			if (is_array ($register = preg_split ("/\:\.\:\|\:\.\:/", c_ws_plugin__s2member_utils_encryption::decrypt (trim (stripslashes ((string)$_GET["s2member_register"]))))))
    				{
    					if (count ($register) === 6 && $register[0] === "subscr_gateway_subscr_id_custom_item_number_time" /* Does the checksum value match up here? */)
    						{
    							if (is_numeric ($register[5]) && $register[5] <= strtotime ("now") && $register[5] >= strtotime ("-" . apply_filters ("ws_plugin__s2member_register_link_exp_time", "2 days", get_defined_vars ())))
    								{
    									$_COOKIE["s2member_subscr_gateway"] = /* For ``reg_cookies_ok ()``. */ c_ws_plugin__s2member_utils_encryption::encrypt ($register[1]);
    									$_COOKIE["s2member_subscr_id"] = /* For ``reg_cookies_ok ()``. */ c_ws_plugin__s2member_utils_encryption::encrypt ($register[2]);
    									$_COOKIE["s2member_custom"] = /* For ``reg_cookies_ok ()``. */ c_ws_plugin__s2member_utils_encryption::encrypt ($register[3]);
    									$_COOKIE["s2member_item_number"] = /* For ``reg_cookies_ok ()``. */ c_ws_plugin__s2member_utils_encryption::encrypt ($register[4]);
    
    									if (($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok ()) && extract ($reg_cookies) /* Needed? */)
    										{
    											status_header(200); // Send a 200 OK status header.
    											header("Content-Type: text/html; charset=UTF-8"); // Content-Type with UTF-8.
    
    											setcookie ("s2member_subscr_gateway", $_COOKIE["s2member_subscr_gateway"], time () + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie ("s2member_subscr_gateway", $_COOKIE["s2member_subscr_gateway"], time () + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
    											setcookie ("s2member_subscr_id", $_COOKIE["s2member_subscr_id"], time () + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie ("s2member_subscr_id", $_COOKIE["s2member_subscr_id"], time () + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
    											setcookie ("s2member_custom", $_COOKIE["s2member_custom"], time () + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie ("s2member_custom", $_COOKIE["s2member_custom"], time () + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
    											setcookie ("s2member_item_number", $_COOKIE["s2member_item_number"], time () + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie ("s2member_item_number", $_COOKIE["s2member_item_number"], time () + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
    
    											do_action ("ws_plugin__s2member_during_register", get_defined_vars ());
    
    											if (is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && is_main_site () && ($location = c_ws_plugin__s2member_utils_urls::wp_signup_url ()))
    												{
    													echo '<script type="text/javascript">' . "\n";
    													echo "window.location = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq ($location) . "';";
    													echo '</script>' . "\n";
    												}
    											else if (($location = c_ws_plugin__s2member_utils_urls::wp_register_url ()))
    												{
    													echo '<script type="text/javascript">' . "\n";
    													echo "window.location = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq ($location) . "';";
    													echo '</script>' . "\n";
    												}
    											exit (); // Clean exit. The browser will now be redirected to ``$location``.
    										}
    									else
    										status_header(503) . header ("Content-Type: text/html; charset=UTF-8") . exit ($msg_503);
    								}
    							else
    								status_header(503) . header ("Content-Type: text/html; charset=UTF-8") . exit ($msg_503);
    						}
    					else
    						status_header(503) . header ("Content-Type: text/html; charset=UTF-8") . exit ($msg_503);
    				}
    			else
    				status_header(503) . header ("Content-Type: text/html; charset=UTF-8") . exit ($msg_503);
    		}
    
    	do_action ("ws_plugin__s2member_after_register", get_defined_vars ());
    }

    Концовка особенно захватывающа.

    Плагин для Wordpress - s2member, https://www.s2member.com/codex/stable/source/s2member/includes/classes/register-in.inc.php

    antongorodezkiy, 20 Апреля 2014

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

    +64

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    QSqlQuery my_query;
    my_query.prepare(
              QString("INSERT INTO table1 (number, address, age) VALUES (%1, '%2', %3);")
                              .arg(fromInput1).arg(fromInput2).arg(fromInput3)
              );

    Жаль, но похоже автор не осилил экранирование от SQL-иньекций.

    LispGovno, 19 Апреля 2014

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

    +70

    1. 1
    qDebug() << QString("%1-%2").arg("%1").arg("foo");

    LispGovno, 19 Апреля 2014

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

    +123

    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
    Type win32gui
    Create object window
    Set window title = "Window"
    Set width window = 299
    Set height window = 279
    S1 = "y"
    S2 = "="
    S3 = "x^3+1"
    Obj = "Graph"
    Create object obj
    Set obj graph = "y=x^3+1"
    Display obj
    Rewrite obj

    Название языка ещё не придумал :P

    Данный пример построит график y=x^3+1.
    Картинка тут - http://coun.at.ua/_sf/1/116_Screenshot1.png

    Mobac, 19 Апреля 2014

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

    +133

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    Lol = "Lol"
    Put Lol
    Lol1 = "1", Lol2 = "2"
    Put Lol1+Lol2
    Set lol = string
    Lol = "HELLO LOLLED GUYS!"
    Put lol.lowcase
    Lolka="lolka"
    Put lolka.upcase

    Так сказать, новый язык программирования - название не придумал (помогите!!!).
    Результат выполнения программы:

    Lol
    3
    hello lolled guys!
    LOLKA

    Жду комментариев (напишите название для япа).

    Mobac, 19 Апреля 2014

    Комментарии (169)
  8. Assembler / Говнокод #15790

    +143

    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
    entry start 
    
    include 'C:\Program Files\Casm\win32a.inc' ; Include file win32a.inc 
    
    section '.text' code readable executable 
    
      start: 
    
            invoke  GetModuleHandle,0 
            invoke  DialogBoxParam,eax,37,HWND_DESKTOP,DialogProc,0 
            or      eax,eax 
            jz      exit 
      exit: 
            invoke  ExitProcess,0 
    
    proc DialogProc hwnddlg,msg,wparam,lparam 
            push    ebx esi edi 
            cmp     [msg],WM_INITDIALOG 
            je      .wminitdialog 
            cmp     [msg],WM_CLOSE 
            je      .wmclose 
            xor     eax,eax 
            jmp     .finish 
      .wminitdialog: 
            jmp     .processed 
      .wmclose: 
            invoke  EndDialog,[hwnddlg],0 
      .processed: 
            mov     eax,1 
      .finish: 
            pop     edi esi ebx 
            ret 
    endp 
    
    section '.bss' readable writeable 
    
      flags dd ? 
      caption rb 40h 
      message rb 100h 
    
    section '.idata' import data readable writeable 
    
      library kernel,'KERNEL32.DLL',\ 
              user,'USER32.DLL' 
    
      import kernel,\ 
             GetModuleHandle,'GetModuleHandleA',\ 
             ExitProcess,'ExitProcess' 
    
      import user,\ 
             DialogBoxParam,'DialogBoxParamA',\ 
             EndDialog,'EndDialog' 
    
    section '.rsrc' resource data readable 
    
      directory RT_DIALOG,dialogs 
    
      resource dialogs,\ 
               37,LANG_ENGLISH+SUBLANG_DEFAULT,demonstration 
    
      dialog demonstration,'TestProgram',170,170,105,75,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME 
      dialogitem 'STATIC','Compile',-1,10,10,70,29,WS_VISIBLE 
      dialogitem 'STATIC','WITH...',-1,10,20,70,8,WS_VISIBLE 
      dialogitem 'STATIC','C',-1,10,30,70,8,WS_VISIBLE 
      dialogitem 'STATIC','A',-1,10,40,70,8,WS_VISIBLE 
      dialogitem 'STATIC','S',-1,10,50,70,8,WS_VISIBLE 
      dialogitem 'STATIC','M',-1,10,60,70,8,WS_VISIBLE 
      enddialog

    Окно на Fasm M.P.E.

    Mobac, 19 Апреля 2014

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

    +123

    1. 1
    Я тут решил свой язык запилить, кто скажет, какой синтаксис кому нравится?

    Пишите в комментарии!

    Mobac, 19 Апреля 2014

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

    +121

    1. 1
    Wct Editor forever

    Ахаххахаха))

    Mobac, 19 Апреля 2014

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