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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    //Текстовый реквизит 
    //Событие реквизита формы НП_ТелефонПолучателя  (Строка (50)) - очистка
    
    Процедура НП_ТелефонПолучателяОчистка(Элемент, СтандартнаяОбработка)
    	НП_ТелефонПолучателя = "";
    КонецПроцедуры

    Ну чтоб уж точно очистить

    FesenkoA, 07 Февраля 2018

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

    +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
    Запрос = Новый Запрос;
    	Запрос.Текст="ВЫБРАТЬ
    	|	ЗаказНаряд.Ссылка КАК Ссылка
    	|ИЗ
    	|	Документ.ЗаказНаряд КАК ЗаказНаряд
    	|ГДЕ
    	|	ЗаказНаряд.Проведен = ИСТИНА";	
    
    	Выборка=Запрос.Выполнить().Выбрать();
    	Выборка.Следующий();
    	Если обЗначениеНеЗаполнено(Выборка.Ссылка) Тогда
    .......

    Чуть упростил запрос для быстроты понимания...
    Как проверить запрос ПУСТОЙ() или нет... Вот один из разработчиков нашел метод.....

    timofeysin, 07 Февраля 2018

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

    0

    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
    // enum_helper_pre.h
    
    #ifndef delimiter 
        #define delimiter , 
    #endif 
     
     
    #ifndef enumeration_begin 
        #define enumeration_begin(arg) enum arg { 
    #endif 
     
    #ifndef enumeration_end 
        #ifdef last_enumerator 
            #define enumeration_end delimiter last_enumerator } 
        #else 
            #define enumeration_end } 
        #endif 
    #endif 
     
    #ifndef declare_member 
        #define declare_member(arg) arg 
    #endif 
     
    #ifndef member_value 
        #define member_value(arg) = arg 
    #endif 
    
    
    // enum_helper_post.h
    
    #undef delimiter 
    #undef enumeration_begin 
    #undef enumeration_end 
    #undef last_enumerator 
    #undef declare_member 
    #undef member_value
    
    
    // color.h
    
    #include "enum_helper_pre.h" 
     
    enumeration_begin(color) 
    declare_member(RED) member_value(-2) delimiter 
    declare_member(GREEN) delimiter 
    declare_member(BLUE) member_value(5) delimiter 
    declare_member(BRIGHTNESS) 
    enumeration_end; 
     
    #include "enum_helper_post.h"
    
    
    // main.cpp
    
    #include <iostream> 
    #include <string> 
    #include <boost/bimap.hpp> 
    #include <boost/preprocessor/stringize.hpp> 
     
    #include "color.h" 
     
    int main(int argc,char* argv[]) 
    { 
        typedef boost::bimap<color,std::string> map_type; 
        map_type color_map; 
        #define declare_member(arg) color_map.insert( map_type::value_type(arg,BOOST_PP_STRINGIZE(arg)) ) 
        #define delimiter ; 
        #define enumeration_begin(arg) 
        #define enumeration_end 
        #define member_value(arg) 
        #include "color.h" 
     
        std::cout<<color_map.left.at(RED)<<std::endl; 
        std::cout<<color_map.left.at(BLUE)<<std::endl; 
        std::cout<<color_map.right.at("GREEN")<<std::endl; 
        std::cout<<color_map.right.at("BRIGHTNESS")<<std::endl; 
        return 0; 
    }
    
    // Output
    
    RED 
    BLUE 
    -1 
    6

    Нарыл эту хуйню на http://www.quizful.net/post/enum-types-c

    j123123, 06 Февраля 2018

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

    0

    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
    switch ($city) {
    			case $city == 'Москва':
    				$tel['work'] = '+7 (495) www-ww-22';
    				$tel['entire'] = '8 (800) xxx-xx-49';
    				break;
    			case $city == 'Нижний-Новгород':
    				$tel['work'] = '+7 (495) zzz-zz-02';
    				$tel['entire'] = '8 (800) zzz-zz-02';
    				break;
    			case $city == 'Ростов-на-Дону':
    				$tel['work'] = '+7 (495) zzz-zz-03';
    				$tel['entire'] = '8 (800) zzz-zz-03';
    				break;
    			case $city == 'Казань':
    				$tel['work'] = '+7 (495) zzz-zz-04';
    				$tel['entire'] = '8 (800) zzz-zz-04';
    				break;
    			case $city == 'Тюмень':
    				$tel['work'] = '+7 (495) zzz-zz-05';
    				$tel['entire'] = '8 (800) zzz-zz-05';
    				break;

    Мало того, что странное использование case, так это ещё повторяется для 28 городов.
    Одинаковые части номеров заменил на zzz-zz

    Int, 06 Февраля 2018

    Комментарии (56)
  5. Си / Говнокод #23709

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    #include <stdio.h>
     
    int main() {
    	double x = 0.11111;
    	printf("%lld\n", x);
     
    	double y = 0.11111;
    	printf("%lld\n", y);
    }

    https://ideone.com/FHKfA6
    УБЭ?

    3_dar, 06 Февраля 2018

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    -(id)copyWithZone:(NSZone *)zone
    {
        NSString* str = [self toJSONString];
        
        return [[MyBeautifulClass alloc] initWithJSON:str :NO];
    }

    Desktop, 05 Февраля 2018

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    char bytes[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
    function1(bytes);
    (void)(bytes[0] = 10), (void)(bytes[1] = 11), (void)(bytes[2] = 12); //WTF?
    function2(bytes);

    Вот такую байду требует написать XCode при присвоении элементов массива через запятую, иначе warning.
    Гейкорп и их главпидор Кук совсем охренели, мало того что последие хуйкоды крашатся и виснут по фазам луны, мало того что встроенный гуй систем контроля версий работает как говно, так оно еще и ворининги выдает на ровном месте - качество apple - blyad.

    Psionic, 05 Февраля 2018

    Комментарии (19)
  8. Java / Говнокод #23704

    +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
    public static synchronized Tracker getDefaultTracker() {
        Tracker tracker;
        synchronized (MainApp.class) {
            if (googleAnalTracker == null) {
                analytics = GoogleAnalytics.getInstance(app());
                GoogleAnalytics googleAnalytics = analytics;
                int i = (DEBUG || STAGE) ? R.xml.app_tracker_debug : R.xml.app_tracker;
                googleAnalTracker = googleAnalytics.newTracker(i);
                googleAnalTracker.enableAutoActivityTracking(false);
            }
            tracker = googleAnalTracker;
        }
        return tracker;
    }

    Тайна гугла раскрыта

    m0003r, 04 Февраля 2018

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

    +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
    решение:
    class Twofer {
        String twofer(String name) {
            if (name.equalsIgnoreCase("Alice")){
                return "One for Alice, one for me.";
            } else if (name.equalsIgnoreCase("Bob")) {
                return "One for Bob, one for me.";
            } else {
                return "One for you, one for me.";
            }
        }
    }
    
    
    чтобы эти тесты проходили

    задачка:
    # Two Fer

    `Two-fer` or `2-fer` is short for two for one. One for you and one for me.

    ```text
    "One for X, one for me."
    ```

    When X is a name or "you".

    If the given name is "Alice", the result should be "One for Alice, one for me."
    If no name is given, the result should be "One for you, one for me."


    чувак решил не заморачиваться...

    Lure Of Chaos, 03 Февраля 2018

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

    0

    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
    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    
    char *questions[] = {
        "Answer these questions please.",
        "I am HACTEHbKA. Do you know about me?",
        "Do you like my love stories?",
        "By the way, what is your name?",
        "Do you like C++?",
        "Do you like bormand?",
        "bormand is cool, isn't he?",
        "Do you know what does it mean?",
        0,
    };
    
    int main () {
        char answer[10], **question = questions, z[30] = {0}, Z = questions[0x04][0x10];
        
        while (*++question) {
            float x = 1, y = 7;
            char* a = answer;
            puts(*question);
            gets(answer);
            while (*a) {
                x *= 10;
                x += *a / 90;
                a ++;
            }
            y = (9/x - 120)/x/x/x;
            if (y > 170/x - 1263 - 437/x/x) {
                int U = **questions;
                for (U = 1/(x+1); U < ' '; U += 0x10) {
                    float bormand = 9*y-6*x*sqrt(y)-6*sqrt(y)+1.0*x*x*x*x-5.2*x*x*x+11.14*x*x-6.788*x+6;
                    z[Z|U] = questions[5-U/5+1/(int)bormand][(int)(Z + questions[0x06][0x10] / 2.6)];
                    if ((Z|U|7) * (int)question[1] < 30) puts(z + U);
                }
                Z++;
            }
        }
        
        return answer == questions[1];
    }

    https://ideone.com/zDcuG2

    HACTEHbKA, 03 Февраля 2018

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