1. JavaScript / Говнокод #17394

    +154

    1. 1
    <input type="submit" name="sub" value="регистрация" class="buttom2_activ" onmouseover="this.className='buttom2_activ'" onmouseout="this.className='buttom2'">

    CSS :hover, лол

    heyzea1, 31 Декабря 2014

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

    +97

    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
    using System;
    using Microsoft.Win32;
     
    namespace Reester
    {
        class Program
        {
            static void Main(string[] args)
            {
                RegCreatySubKey();
            }
     
            private static void RegCreatySubKey()
            {
                RegistryKey regKey = Registry.LocalMachine;
                string[] shell = new[] { "SOFTWARE", "Microsoft", "Windows", "CurrentVersion", "Explorer", "CommandStore", "shell" };
     
                string prog = "Programma";
    1)            using (regKey = Registry.LocalMachine.OpenSubKey(shell[0],true))// тут regKey равно{HKEY_LOCAL_MACHINE}
    2)                {                                                    //сдеть уже regKey   равно {HKEY_LOCAL_MACHINE\SOFTWARE}
     
     
    3)                    if (regKey != null)//и тут уже regkey равно Null.А дальше программа не идет.
                        {
                            using (regKey = Registry.LocalMachine.OpenSubKey(shell[1], true))
                            {
                                if (regKey != null)
                                {
                                    using (regKey = Registry.LocalMachine.OpenSubKey(shell[2], true))
                                    {
                                        if (regKey != null)
                                        {
                                            using (regKey = Registry.LocalMachine.OpenSubKey(shell[3], true))
                                            {
                                                if (regKey != null)
                                                {
                                                    using (regKey = Registry.LocalMachine.OpenSubKey(shell[4], true))
                                                    {
                                                        if (regKey != null)
                                                        {
                                                            using (regKey = Registry.LocalMachine.OpenSubKey(shell[5], true))
                                                                
                                                            {
                                                                if (regKey != null)
                                                                {
                                                                    using (regKey = Registry.LocalMachine.OpenSubKey(shell[6], true))
                                                                    {
                                                                        if (regKey != null)
                                                                        {
                                                                            regKey.CreateSubKey(prog);
                                                                        }
                                                                    }
                                                                 }
     
                                                              }
                                                          }
                                                      }
                                                    }
                                                 }
                                               }
                                            }
                                          }
                                        }
                                     }
                                  }
                              }
                        
                       }
                  }

    Работаем с реестром

    Psilon, 31 Декабря 2014

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

    +127

    1. 1
    alias Foo(V : V[]) = V;

    dlang, угадайте, что этот код делает.

    DlangGovno, 31 Декабря 2014

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

    +57

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    /* Fix NAN constant for VisualC++. */
       #ifdef _MSC_VER
          #ifndef NAN
              static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
              #define NAN (*(const float *) __nan)
          #endif
       #endif

    ????

    Pythoner, 30 Декабря 2014

    Комментарии (22)
  5. PHP / Говнокод #17390

    +162

    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
    if ($n > '25') {
        $list = floor($n / 25) + 1;
        $str .= '<div id="srt_page" align="center">';
        for ($q = 1; (($q) <= $list); $q++) {
            if ((((isset($_GET['page'])) && ($_GET['page'] == $q)) || ((!isset($_GET['page'])) && ($q == 1))))
                $str .= ' <b>' . $q . '</b> ';
            else {
                if ((($q == ($pg - 1)) && (($pg - 1) != 1) && (($pg - 1) != $list)) || (($q == ($pg - 2)) && (($pg - 2) != 1) && (($pg - 2) != $list)) || (($q == ($pg - 3)) && (($pg - 3) != 1) && (($pg - 3) != $list)) || (($q == ($pg - 4)) && (($pg - 4) != 1) && (($pg - 4) != $list)) || (($q == ($pg + 1)) && (($pg + 1) != 1) && (($pg + 1) != $list)) || (($q == ($pg + 2)) && (($pg + 2) != 1) && (($pg + 2) != $list)) || (($q == ($pg + 3)) && (($pg + 3) != 1) && (($pg + 3) != $list)) || (($q == ($pg + 4)) && (($pg + 4) != 1) && (($pg + 4) != $list)) || ($q == $list) || ($q == 1)) {
                    if (($q == $list) && (($pg + 4) < ($list - 1)))
                        $str .= '...';
                    $str .= ' <a class="link_page" href="?page=' . $q . '"> ' . $q . ' </a> ' . "\n";
                    if (($q == 1) && (($pg - 4) > 2))
                        $str .= '...';
                }
            }
        }
        $str .= '</div>';
    }
    return $str;

    Кто не понял, это такой pagination %))

    AgentSIB, 30 Декабря 2014

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

    +74

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    private void showProgress() {
        if(mIndProgressVisible && mIndProgress != null && mIndProgress.isShowing()) return;
        if(!mIndProgressVisible && (mIndProgress == null || !mIndProgress.isShowing())) return;
    
        ...
    }

    Не ходите, дети, в Африку гулять

    StanDalone, 30 Декабря 2014

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

    +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
    _catalogDb.Categories
                     .Where(w => w.Resources.Where(r => _catalogDb.Resources
                        .Where(a => _catalogDb.Persons.Where(b => b.EmployeeNumber == employeeNumber)
                            .Select(c => c.VIP).FirstOrDefault() || !a.VIP)
                     .Where(a => _catalogDb.Persons.Where(b => b.EmployeeNumber == employeeNumber)
                         .Select(c => c.InnerEmployee).FirstOrDefault() || !a.InnerEmployee)
                     .Where(a => !a.Paths.Any()
                         || a.Paths.Where(wer => wer.Name == null).Any()
                            || a.Paths.Where(pt => pt.Name != null && _catalogDb.Persons
                                .Where(b => b.EmployeeNumber == employeeNumber)
                                    .Select(c => c.Path).FirstOrDefault().Contains(pt.Name)).Any())
                     .Where(a => !a.Filials.Any() || a.Filials.Where(wer => wer.Code == null).Any() || a.Filials
                         .Where(pt => pt.Code != null && pt.Code == _catalogDb.Persons
                             .Where(b => b.EmployeeNumber == employeeNumber)
                                .Select(c => c.Filial).FirstOrDefault()).Any())
                     .Select(a => a.UNID).Contains(r.UNID)).Any())
                        .Select(s => s.ID).Distinct().ToList();

    Кто сказал что Entity framework облегчает жизнь...

    SuperCuke, 30 Декабря 2014

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

    +51

    1. 1
    static void operator()(int atan)

    Wat?

    LispGovno, 30 Декабря 2014

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

    +135

    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
    /// <summary>
    /// Converts to number.
    /// </summary>
    /// <param name="value">The value.</param>
    /// <returns>System.String.</returns>
    public static string convertToNumber(string value) {
        string mvalue = "0";
        string wildchars = @"~!@#$%^&*()_+={}[]|\/?><,`:;'";
        bool chknegative = false;
    	if (value == null)
    		value = "";
        try {
            if (value == "") {
                mvalue = "0";
            }
            for (var i = 0; i < wildchars.Length; i++) {
                string wildchar = wildchars.Substring(i, 1);
                //chknegative = value.Contains(wildchar);
                mvalue = value.Replace(wildchar, "");
                value = mvalue;
            }
    
    
            chknegative = value.Contains("-");
    
            if (chknegative) {
                mvalue = value.Replace("-", "");
                mvalue = "-" + mvalue;
            }
            else {
                mvalue = value;
            }
        }
        catch {
            mvalue = "0";
        }
        return mvalue;
    }

    barsv, 29 Декабря 2014

    Комментарии (4)
  10. Си / Говнокод #17385

    +142

    1. 1
    return (guint)(((double)(((double)((SAMPLERATE_48KHZ)) / (((double)(fps_numerator) / (double)(fps_denominator)))))));

    Фу, блять.

    codemonkey, 29 Декабря 2014

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