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

    +131

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    private bool IsChanged(string name, string surname, string patronymic, string email, bool? sex = null, byte[] avatar = null, DateTime? birthDate = null, string address = null)
            {
                bool r1 = sex == null ^ Sex == null ? true : (sex != null ? sex.Value != Sex.Value : true);
                bool r2 = birthDate == null ^ BirthDate == null ? true : (birthDate != null ? birthDate.Value != BirthDate.Value : true);
                bool r3 = address == null ^ Address == null ? true : Address != address;
                bool r4 = avatar == null ^ Avatar == null ? true : (avatar != null ? !Avatar.IsEqual(avatar) : true);
                bool r = Name != name || Surname != surname || Patronymic != patronymic || Email != email;
                return r | r1 | r2 | r3 | r4;
            }

    dotnetdeveloper, 30 Сентября 2011

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

    +134

    1. 1
    2. 2
    if (!(string.IsNullOrEmpty("")))
    ...

    HellMaster_HaiL, 30 Сентября 2011

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

    +122

    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
    private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
            {
                if (this.cbDocumentComleted.Checked) WriteText("DocumentCompleted " + e.Url.ToString()); ;
    
                if (e.Url.ToString() == "about:blank") return;
                
                this.myCountCompleted++;
                
                if ((this.myCurrentBootState == BootState.FirstBoot) && (this.myCountCompleted == 2))
                {
    
                    this.myCountCompleted = 0;
    		FirstBoot();
    
                }
    
                if((this.myCurrentBootState == BootState.BootAfterChangePageSize) && (this.myCountCompleted == 2))
                {
    
                    this.myCountCompleted = 0;
                    this.myFirstAppStart = false;
                    this.timer3.Start();
    
                }
    
                if ((this.myCurrentBootState == BootState.BootAfterCapcha) && (this.myCountCompleted == 2))
                {
    
                    this.myCountCompleted = 0;
                    this.timer1.Start();
    
                }
    
                if ((this.myCurrentBootState == BootState.BootAfterNavigation) && (this.myCountCompleted == 2))
                {
    
                    this.myCountCompleted = 0;
                    this.timer2.Start();
    
                }
    
            }

    HellMaster_HaiL, 29 Сентября 2011

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

    +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
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    eax = esp;
                    if (gB(eax + 0x19) == 0) {
                        uint edx = gD(eax + 8);
                        if (gB(edx + 0x19) == 0) {
                            eax = gD(edx);
                            if (gB(eax + 0x19) == 0) {
                                do {
                                    edx = eax;
                                    eax = gD(edx);
                                }
                                while (gB(eax + 0x19) == 0);
                            }
                            esp = edx;
                            //ret
                        }
                        else {
                            eax = gD(eax + 4);
                            if (gB(eax + 0x19) == 0) {
                                do {
                                    edx = esp;
                                    if (edx != gD(eax + 8)) break;
                                    esp = eax;
                                    eax = gD(eax + 4);
                                }
                                while (gB(eax + 0x19) == 0);
                            }
                            esp = eax;
                        }
                    }
                    eax = esp;

    X: я занялся написанием научной фантастики)
    Y: АИ? ИИ?
    X: /*код!!!111*/
    Y: декомпилятор пишешь?
    X: декомпилятор это не фантастика
    это реальность
    Y: А что пишешь?
    X: а это я сам не знаю что это)
    вообщем, в игре на земле валяются предметы
    нужно найти как они расположены в памяти
    Y: Это результат декомпиляции или что это?
    X: обычно это либо eax, [eax + idi * 4]
    или что то в этом духе
    просто постраничное считывание
    типа eax, [eax]
    eax, [eax]
    eax, [eax]
    а тут ни то ни другое)
    сама игра ищет предметы по какой то безумной логике
    Y: Это ты написал программы и обозвал так свои переменные?
    X: да)
    вообщем
    мне стало лень разбираться
    что и как делает игрушка
    и я просто скопировал код
    из дизасма
    в С№
    и перебил под синтаксис)
    на удивление четко работает)

    Говногость, 27 Сентября 2011

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

    +126

    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
    public static bool GetSafeBool(object val, bool defaultVal)
            {
                //TODO: check functionality
                bool result = defaultVal;
                try
                {
                    if (val != null)
                    {
                        string str = val.ToString().Trim();
                        // compare ignore case, for performance
                        result = (0 == string.Compare(str, true.ToString(), true) || str == "1" || str == "-1");
                    }
                }
                catch { }
                return result;
            }

    Продолжая тему расовых индусов...

    fade, 27 Сентября 2011

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

    +128

    1. 1
    2. 2
    3. 3
    4. 4
    XmlNodeList list = xdoc.GetElementsByTagName("Customer");
    for (int i = 0; i < list.Count; i++)
    {
    XmlElement cl = (XmlElement)xdoc.GetElementsByTagName("Customer")[i];

    Написано расовым индусом.
    http://www.c-sharpcorner.com/UploadFile/vimalkandasamy/Xml03032009055848AM/Xml.aspx - чисто индусский бложик. Там много подобного.

    koodeer, 26 Сентября 2011

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

    +125

    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
    if ((pen == true) || (brush == true))
     {
     mousePath = new System.Drawing.Drawing2D.GraphicsPath();
     myPaths.Add(mousePath);
     }
     else
     if ((rectangle == true) && (e.X > 0) && (e.Y > 0) && (e.X < pictureBox1.Width)
     && (e.Y < pictureBox1.Height))
     {
     if (Border == true)
     {
     PenForBrush.Width = trackBar1.Value;
    if ((e.X >= rectX) && (e.Y >= rectY))
    {
    g.DrawRectangle(PenForBrush, rectX, rectY, e.X - rectX, e.Y - rectY);
    }
    else
    if ((e.X <= rectX) && (e.Y <= rectY))
    {
    Rectangle R = new Rectangle(e.X, e.Y, rectX - e.X, rectY - e.Y);
    g.DrawRectangle(PenForBrush, R);
    }
    else
    if ((e.X <= rectX) && (e.Y >= rectY))
    {
    Rectangle R = new Rectangle(e.X, rectY, rectX - e.X, e.Y - rectY);
    g.DrawRectangle(PenForBrush, R);
    }
    else
    if ((e.X >= rectX) && (e.Y <= rectY))
    {
    Rectangle R = new Rectangle(rectX, e.Y, e.X - rectX, rectY - e.Y);
    g.DrawRectangle(PenForBrush, R);
    }
    }
    else  if (FillBorder == true)
    {
    else
    if ((e.X <= rectX) && (e.Y <= rectY))
    {
    Rectangle R = new Rectangle(e.X + width, e.Y + width,
    rectX - e.X - trackBar1.Value, rectY - e.Y - trackBar1.Value);
    g.FillRectangle(FillBrush, R);
                                        g.DrawRectangle(PenForBrush, e.X, e.Y, rectX - e.X, rectY - e.Y);
                                    }
                                    else
                                        if ((e.X <= rectX) && (e.Y >= rectY))
                                        {
                                            Rectangle R = new Rectangle(e.X + width, rectY + width,
                                                                        rectX - e.X - trackBar1.Value, e.Y - rectY - trackBar1.Value);
                                            g.FillRectangle(FillBrush, R);
                                            g.DrawRectangle(PenForBrush, e.X, rectY, rectX - e.X, e.Y - rectY);
                                        }
                                        else
                                            if ((e.X >= rectX) && (e.Y <= rectY))
                                            {
                                                Rectangle R = new Rectangle(rectX + width, e.Y + width,
                                                                            e.X - rectX - trackBar1.Value, rectY - e.Y - trackBar1.Value);
                                                g.FillRectangle(FillBrush, R);
                                                g.DrawRectangle(PenForBrush, rectX, e.Y, e.X - rectX, rectY - e.Y);
                                            }
                            }
    else               if ((mark == true) && (!IsMarkPaint)
                        && (e.X - distance1 > 0) && (e.Y - distance2 > 0)
                        && (e.X + distance3 < pictureBox1.Width) && (e.Y + distance4 < pictureBox1.Height))
                    {
                        if (Count == 0)
                        {
                            try
                            {
                                Rectangle R = new Rectangle(PreviousMarkPoint.X, PreviousMarkPoint.Y,
                                    MarkRectangle.Width, MarkRectangle.Height);
                                SolidBrush s = new SolidBrush(Color.White);
                                g.FillRectangle(s, R);
    Bitmap temp = new Bitmap(pictureBox1.Image.Width, pictureBox1.Image.Height);
                                temp = (Bitmap)pictureBox1.Image;
                                ImageClone = temp.Clone(MarkRectangle, PixelFormat.Format16bppArgb1555);
                            }
                            catch { }
    if (myImages.Count > 35)
                {
                    myImages.RemoveAt(0);
                    ImageNames.RemoveAt(0);
                }

    Графический редактор

    GavnoCoder111, 25 Сентября 2011

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

    +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
    public object Data 
                {
                    get
                    {
                        return this._data;
                    }
                    set
                    {
                        (((value is byte ||
                           value is short ||
                           value is ushort ||
                           value is int ||
                           value is uint ||
                           value is long ||
                           value is ulong ||
                           value is decimal ||
                           value is double ||
                           value is float) && (DataType == JsonNodeDataType.Number)) ||
                         ((value is string) && (DataType == JsonNodeDataType.String)) ||
                         ((value is object[]) && (DataType == JsonNodeDataType.Array)) ||
                         ((value is Json) && (DataType == JsonNodeDataType.SubObject)) ||
                         ((value is bool) && (DataType == JsonNodeDataType.Boolean))).Assert();
                        this._data = value;
                    }
                }

    Изобретаю велосипед для работы с Json

    psina-from-ua, 20 Сентября 2011

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

    +128

    1. 1
    2. 2
    3. 3
    string a = 'a'+""+'b';
    string b = ""+'a'+'b';
    string c = 'a'+'b'+"";

    никогда не воспроизводи говнокод по памяти

    Ccik, 19 Сентября 2011

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

    +145

    1. 1
    2. 2
    string a = 'a'+""+'b';
    string b = ""+'a'+'b';

    может и боян

    Ccik, 19 Сентября 2011

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