1. C# / Говнокод #18989

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public object Synchronous( 
    Func<object,object,object,object,object   ,object   ,object  ,object, object  , object , object  , object, object  , object, object, object, object>   func,
     
    object argument1,     object argument2,     object argument3,     object argument4   ,
    object argument5,     object argument6 ,    object argument7,     object argument8  ,
    object argument9,     object argument10 ,  object argument11 ,  object argument12 ,
    object argument13 ,  object argument14 ,  object argument15 ,  object argument16)

    Человек написал сверх-полезную библиотеку для асинхронного программирования. Практически все методы выглядят так.

    Psilon, 09 Ноября 2015

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

    +14

    1. 1
    2. 2
    3. 3
    public static bool Convert(string fileName, string Namefile) {
    ...
    }

    нет, ну не дебил?

    Lokich, 06 Ноября 2015

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

    +1

    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
    private readonly Dictionary<BuildType, string> mProductBuildPrefix = new Dictionary<BuildType, string>
        {
            { BuildType.iOS, "appstore" },
            { BuildType.iOSHD, "appstore" },
            { BuildType.iOS_INT, "appstore" },
            { BuildType.iOS_INT_HD, "appstore" },
            { BuildType.Alpha, "appstore" },
            { BuildType.Develop, "appstore" },
            { BuildType.Android, "appstore" },
            { BuildType.Android_INT, "appstore" },
            { BuildType.Web, "appstore" },
            { BuildType.Amazon, "appstore" }
        };

    > не понимаю смысловой нагрузки в этом...

    strax, 05 Ноября 2015

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

    +1

    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
    public void CreateTable(ref string text) 
            {
                List<S> list = new List<S>();
                list.Add(new S('о', 9.28));
                list.Add(new S('а', 8.66));
                list.Add(new S('е', 8.10));
                list.Add(new S('и', 7.45));
                list.Add(new S('н', 6.35));
                list.Add(new S('т', 6.30));
                list.Add(new S('р', 5.53));
                list.Add(new S('с', 5.45));
                list.Add(new S('л', 4.32));
                list.Add(new S('в', 4.19));
                list.Add(new S('к', 3.47));
                list.Add(new S('п', 3.35));
                list.Add(new S('м', 3.29));
                list.Add(new S('у', 2.90));
                list.Add(new S('д', 2.56));
                list.Add(new S('я', 2.22));
                list.Add(new S('ы', 2.11));
                list.Add(new S('ь', 1.90));
                list.Add(new S('з', 1.81));
                list.Add(new S('б', 1.51));
                list.Add(new S('г', 1.41));
                list.Add(new S('й', 1.31));
                list.Add(new S('ч', 1.27));
                list.Add(new S('ю', 1.03));
                list.Add(new S('х', 0.92));
                list.Add(new S('ж', 0.78));
                list.Add(new S('ш', 0.77));
                list.Add(new S('ц', 0.52));
                list.Add(new S('щ', 0.49));
                list.Add(new S('ф', 0.40));
                list.Add(new S('э', 0.17));
                list.Add(new S('ъ', 0.04));
    }

    И как от этого отойти?

    jekastiy, 04 Ноября 2015

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

    −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
    22. 22
    23. 23
    static void Main(string[] args){
                int i = int.Parse(Console.ReadLine());
                int j = i;
                i = j * Programa(1,2,3,4,5,6,7);
                i = i * Recursia(1);
                int x = i / i;
                Console.WriteLine(x);
            }
            private static int Programa(int i1, int i2, int i3, int i4, int i5, int i6, int i7) {
                int i = i1 * i2 * i3 * i4 * i5 * i6 * i7;
                int j = i / (i7*i4);
                return (j * (i7 * i4)) /i;
            }
            private static int Recursia(int i) {
                if (i * 0 == 0 && i<50000)
                    Recursia(i*2);
                return Suma(i,15);
            }
            private static int Suma(int A, int B){
                if (0 == A) return B;
                if (0 == B) return A;
                return Suma(A - 1, B - 1);
            }

    Вывод 1 используя $еву тучу д(г)ействий

    MkSavin, 03 Ноября 2015

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

    +1

    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
    //~200 строк сбора статистики
    ...
                    detail.AppendLine("     Обработано кодом \"1\" (Готово - полная идентификация)  " + kolvostrok.ToString() + " (" + getProc + "%)" + "");
                    detail.AppendLine("");
                    proc = (((kolvostrok_1 + kolvostro1) / kolvostrok) * 100).ToString();
                    getProc = proc.Substring(0, proc.IndexOf(",") + 3);
                    detail.Append("Обработано данных с кодом \"-1\" и \"1\" , Всего  " + (kolvostrok_1 + kolvostrok).ToString() + " (" + getProc + "%)");
    
                    msgBody += str.ToString();
                    msgBody += detail.ToString();
                    msgBody = msgBody.Normalize();
                }
                catch (Exception e)
                {
                    
                }
                finally
                {
                    ocon.Close();
                    SendEmail.SendEmail.SendMessage(msgSubject, msgBody, msgFrom, msgTo, msgCopy);
                }
            }

    потрясающе

    Lokich, 02 Ноября 2015

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

    +2

    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
    public int RowSpan {
                get {
                    int p = HtmlText.IndexOf("rowspan");
                    if (p > -1) {
                        int index = HtmlText.IndexOf(" ", p + 8);
                        int index1 = HtmlText.IndexOf(">", p + 8);
                        int index2 = HtmlText.IndexOf("/", p + 8);
                        if ((index > index1) && (index1 != -1))
                            index = index1;
                        if ((index > index2) && (index2 != -1))
                            index = index2;
                        string s = HtmlText.Substring(p + 8, index - p - 8);
                        return Convert.ToInt16(s);
                    } else
                        return -1;
                }
                set {
                    if (value == 0) {
                        HtmlText = HtmlText.Replace("rowspan", string.Empty);
                    }
                }
            }
            public int ColSpan {
                get {
                    int p = HtmlText.IndexOf("colspan");
                    if (p > -1) {
                        int index = HtmlText.IndexOf(" ", p + 8);
                        int index1 = HtmlText.IndexOf(">", p + 8);
                        int index2 = HtmlText.IndexOf("/", p + 8);
                        if ((index > index1) && (index1 != -1))
                            index = index1;
                        if ((index > index2) && (index2 != -1))
                            index = index2;
                        string s = HtmlText.Substring(p + 8, index - p - 8);
                        return Convert.ToInt16(s);
                    } else
                        return -1;
                }
            }

    а тут регулярки он не осилил

    Lokich, 02 Ноября 2015

    Комментарии (11)
  8. C# / Говнокод #18936

    +8

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public TD GetColumn(int i) {
                try {
                    return this.Columns[i];
                } catch {
                    return this.Columns[i - 1];
                }
            }

    в продолжение парсера

    Lokich, 29 Октября 2015

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

    +8

    1. 1
    2. 2
    3. 3
    4. 4
    if (args.Length < 2 || args.Length == 3 || args.Length > 5 || args.Length > 2 && args[2] != "-n" && args[2] != "-t" || args.Length == 5 && args[4] != "-f" && args[4] != "-d" && args[4] != "-a")
    {
    	FindPrivateKey.PrintHelp();
    }

    Из майкрософтовского sample для поиска файлов приватных ключей.

    yamamoto, 29 Октября 2015

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

    +6

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    tempPages.Add(page, tempValue);
    rempPages = tempPages;
    if (totalPages != 0)
    {
    	rotalPages = totalPages;
    }
    currentCountItem += tempLength;

    Шашлык-рашлык.

    yamamoto, 23 Октября 2015

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