1. Java / Говнокод #16189

    +87

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public BarrierAssessment(int id, Client client, int homephone, int mobile, int email, int transport, int licence, boolean notInWorkForce, boolean unpaidWork, boolean cdeProgram, boolean notWorkingBut, int paidWork, 
    String employerOcc, String reason, int highlevel, String further, int stableAccomodation, int loneParent, int livingWith, int policeProblems, int courtPending, int preventFrom, int medical, int drugTest, int currentBusy, 
    String scurrentBusy, String reasonForNotGettingJob, int startTomorrow, String jobGoals, int currentResume, int canvasLetter, int referees, int interviewClothing, String otherBarriers, int ec, LastModified lastModified, 
    Date datestamp, Date bupdated, String disabilityBarriers, Date licenceDueToExpire, Date licenceDueBack, String currentSkills, String possibleSkills) {
     
    ...
     
    }

    Мать всех конструкторов!

    Meegoo, 18 Июня 2014

    Комментарии (25)
  2. Java / Говнокод #16188

    +74

    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
    import java.io.*;
    import java.util.*;
    
    public class Solution
    {
        public static void main(String[] args) throws Exception
          { Scanner scanner = new Scanner(System.in);
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            int c = scanner.nextInt();
            int z = scanner.nextInt();
            if (a < b && a < c && a < z)
            {  if (b < c && b < z)
                {if (c < z)
                    {System.out.println(z + " " + c + " " + b + " " + a);}
                    else
                    {System.out.println(c + " " + z + " " + b + " " + a);} }
                else if (c < b && c < z)
                { if (b < z)
                    {System.out.println(z + " " + b + " " + c + " " + a);}
                    else
                    {System.out.println(b + " " + z + " " + c + " " + a);} }
                else if (z < c && z < b)
                { if (c < b)
                    {System.out.println(b + " " + c + " " + z + " " + a);}
                    else
                    {System.out.println(c + " " + b + " " + z + " " + a);} } }
            else if (b < a && b < c && b < z)
            { if (a < c && a < z)
                { if (c < z)
                    {System.out.println(z + " " + c + " " + a + " " + b);}
                    else
                    {System.out.println(c + " " + z + " " + a + " " + b);} }
                else if (c < a && c < z)
                { if (a < z)
                    {System.out.println(z + " " + a + " " + c + " " + b);}
                    else
                    {System.out.println(a + " " + z + " " + c + " " + b);} }
                else if (z < a && z < c)
                { if (a < c)
                    {System.out.println(c + " " + a + " " + z + " " + b);}
                    else
                    {System.out.println(a + " " + c + " " + z + " " + b);} } }
            else if (c < a && c < b && c < z)
            { if (a < b && a < z)
                { if (b < z)
                    {System.out.println(z + " " + b + " " + a + " " + c);}
                    else
                    {System.out.println(b + " " + z + " " + a + " " + c);} }
                else if (b < a && b < z)
                { if (a < z)
                    {System.out.println(z + " " + a + " " + b + " " + c);}
                    else
                    {System.out.println(a + " " + z + " " + b + " " + c);} }
                else if (z < a && z < b)
                { if (a < b)
                    {System.out.println(b + " " + a + " " + z + " " + c);}
                    else
                    {System.out.println(a + " " + b + " " + z + " " + c);} } }
            else if (z < a && z < b && z < c)
            { if (a < c && a < b)
                { if (c < b)
                    {System.out.println(b + " " + c + " " + a + " " + z);}
                    else
                    {System.out.println(c + " " + b + " " + a + " " + z);} }
                else if (c < a && c < b)
                { if (a < b)
                    {System.out.println(b + " " + a + " " + c + " " + z);}
                    else
                    {System.out.println(a + " " + b + " " + c + " " + z);} }
                else if (b < a && b < c)
                {
                    if (a < c)
                    {System.out.println(c + " " + a + " " + b + " " + z);}
                    else
                    {System.out.println(a + " " + c + " " + b + " " + z);} } }
    }
    }

    Ня!

    dagonlaf, 18 Июня 2014

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

    +136

    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
    static string[] ArrayFuller(string pathToFile)
            {
    
                int rr = 0;
                StreamReader sr=new StreamReader(pathToFile);
                while(!sr.EndOfStream){
                sr.ReadLine();
                rr++;
                }
                StreamReader sr2 = new StreamReader(pathToFile);
                string[] arrayBox = new string[rr];
                for (int i = 0; i < rr; i++)
                {
                    arrayBox[i] = Convert.ToString(sr2.ReadLine());
                }
                sr2.Close();
                return arrayBox;
            }

    vladb9582, 18 Июня 2014

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

    +79

    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
    public Long getRecordCount() {
            long result = 0;
            if(pfrFile != null){
                if(pfrFile.getПачкаВходящихДокументов().getРАСЧЕТ_ПО_СТРАХОВЫМ_ВЗНОСАМ_НА_ОПС_И_ОМС_ПЛАТЕЛЬЩИКАМИ_ПРОИЗВОДЯЩИМИ_ВЫПЛАТЫ_ФЛ() != null){
                    result++;
                }
                if(pfrFile.getПачкаВходящихДокументов().getРСВ1() != null){
                    result++;
                }
                if(pfrFile.getПачкаВходящихДокументов().getРАСЧЕТ_ПО_СТРАХОВЫМ_ВЗНОСАМ_НА_ОПС_И_ОМС_ПЛАТЕЛЬЩИКАМИ_СВ_ПРОИЗВОДЯЩИМИ_ВЫПЛАТЫ_ФЛ_НАЧИНАЯ_С_2012_ГОДА() != null){
                    result++;
                }
                if(pfrFile.getПачкаВходящихДокументов().getРАСЧЕТ_ПО_СТРАХОВЫМ_ВЗНОСАМ_НА_ОПС_И_ОМС_ПЛАТЕЛЬЩИКАМИ_СВ_ПРОИЗВОДЯЩИМИ_ВЫПЛАТЫ_ФЛ_НАЧИНАЯ_С_2013_ГОДА() != null){
                    result++;
                }
    ...
            return result;
    }

    :D

    skobets, 18 Июня 2014

    Комментарии (5)
  5. Java / Говнокод #16185

    +74

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    /**
     * Some UI hacks for JRuby Facet
     */
    public class NiiChAVOUtil { 
    }

    Слова лишнии

    vistall, 18 Июня 2014

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

    +133

    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
    string parser(string chto, string chem)
                {
                    int dlina = chem.Length;
                    int kol = chto.Length;
                    string ret = null;
                    int shet = 0;
                    int r = 0;
                    int nom = 0;
                    for (int i = 0; i < kol; i++)
                    {
                        if (chto[i] == chem[0] && shet == 0)
                        {
                            for (int j = i; j < dlina + i; j++)
                            {
                                if (chto[j] == chem[r])
                                {
                                    r++;
                                    shet++;
                                    nom = j;
                                }
    
                            }
                            if (shet != dlina)
                            {
                                shet = 0;
                                r = 0;
                                nom = 0;
                            }
                        }
                    }
                    int schet = nom + 3;
                    while (chto[schet] != '<')
                    {
                        ret += chto[schet];
                        schet++;
                    }
                    return ret;
                }

    Функция для парсинга подстроки

    vladb9582, 18 Июня 2014

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

    +156

    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 ((int)($basket->summ/1000) > 999)
        {
          $price_all = substr_replace($basket->summ," ",1,0);
          $price_all = substr_replace($price_all," ",5,0);
        }
        elseif ((int)($basket->summ/1000) > 99)
        {
          $price_all = substr_replace($basket->summ," ",3,0);
        }
        elseif ((int)($basket->summ/1000) > 9)
        {
          $price_all = substr_replace($basket->summ," ",2,0);
        }
        elseif ((int)($basket->summ/1000) < 9 && (int)($basket->summ/1000) > 0)
        {
          $price_all = substr_replace($basket->summ," ",1,0);
        }
        elseif ((int)($basket->summ/1000) == 0)
        {
          $price_all = $basket->summ;
        }

    Вот так вот у нас на офисе коллега форматировал цену...

    Mayhemalexf, 18 Июня 2014

    Комментарии (4)
  8. Pascal / Говнокод #16182

    +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
    for li:=LL-2 downto 1 do
            begin
              ag:=ml_(a[li], m_(gen(len(a[li]), 1, 1), a[li]) );
    
                cp(
                  b[li],
                  ml_(
                    ml(
                      t(W[li]),
                      from2(b[li+1], li <> LL-2)
                    )
                    ,
                    ag
                  )
                );
            end;

    Функциональное программирование в императивном стиле.

    icune, 18 Июня 2014

    Комментарии (4)
  9. Pascal / Говнокод #16181

    +92

    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
    type
      TForm1 = class(TForm)
        Button1: TButton;
        Button3: TButton;
        ListBox1: TListBox;
        Button2: TButton;
        Button4: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button3Click(Sender: TObject);
        procedure FormCreate(Sender: TObject);
        procedure Button2Click(Sender: TObject);
        procedure Button4Click(Sender: TObject);
        procedure FormDestroy(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
      TListThread = class(TThread)
      protected
        procedure Execute; override;
      end;
      TMyThread = class(TThread)
      protected
        procedure Execute; override;
      end;
      TYouThread = class(TThread)
      protected
        procedure Execute; override;
      end;
     
    var
      Form1: TForm1;
      threadList1: TThreadList;
      mythreadRunning, youthreadRunning, listThreadRunning: Boolean;
      globalCount: Integer;
      listProcess: TListThread; { TListThread is a custom descendant of TThread. }
      secondProcess: TMyThread; { TMyThread is a custom descendant of TThread. }
      otherSecondProcess: TYouThread; { TMyThread is a custom descendant of TThread. }
     
    implementation
     
    {$R *.dfm}
     
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      if (mythreadRunning = FALSE) then
      begin
        mythreadRunning:= TRUE;
        secondProcess := TMyThread.Create(True); { Create suspended--secondProcess does not run yet. }
        secondProcess.FreeOnTerminate := True; { You do not need to clean up after termination. }
        secondProcess.Priority := tpLower;  // Set the priority to lower than normal.
        secondProcess.Resume; { Now run the thread. }
      end
      else
        MessageDlg('This thread is still running.  You are going to hurt yourself!',
          mtInformation, [mbOk], 0);
    end;
     
    procedure TMyThread.Execute;
    var
      I: Integer;
      myRadio: TRadioButton;
    begin
      for I := 0 to 20 do
      begin
        if (Terminated) then
        begin
          mythreadRunning:= FALSE;
          exit;
        end;
        myRadio:= TRadioButton.Create(Form1);
        globalCount:= globalCount + 1;
        myRadio.Name:= 'RadioButton' + IntToStr(globalCount);
        threadList1.Add(myRadio);
        Sleep(1000);
      end;
      mythreadRunning:= FALSE;
    end;
     
    procedure TForm1.Button2Click(Sender: TObject);
    begin
      if (listthreadRunning = FALSE) then
      begin
        listThreadRunning:= TRUE;
        listProcess := TListThread.Create(True); { Create suspended--secondProcess does not run yet. }
        listProcess.FreeOnTerminate := True; { You do not need to clean up after termination. }
        listProcess.Priority := tpLower;  // Set the priority to lower than normal.
        listProcess.Resume; { Now run the thread. }
      end;
    end;
     
    procedure TListThread.Execute;
    var
      I: Integer;
      Temp: TControl;
      myList: TList;
    begin
      while(True) do
      begin

    http://docwiki.embarcadero.com/CodeExamples/XE5/en/TThreadList_%28Delphi%29
    Беда, когда примеры пишут психически неполноценные люди. Самое ужасное то, что этот "пример" висит на сайте embarcadero.

    brutushafens, 17 Июня 2014

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

    +84

    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
    type
      TSearchF = class(TThread)
      private
      protected
        procedure Execute; override;
      public
        Str: String; // думаю назначение обоих 
        Pause: Boolean; // параметров объяснять не надо
      end;
    
    и
    
    Код:
    
    
     procedure TSearchF.Execute;
    begin
      while not Terminated do
      begin
         if(Pause) then
         begin
            Sleep(10);
         end else
         begin
            FindFile(Str);
         end;
      end;
    end;

    http://www.programmersforum.ru/showthread.php?t=91543
    Без комментариев.

    brutushafens, 17 Июня 2014

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