1. C++ / Говнокод #5277

    +164

    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
    // Licensed to Green Energy Corp (www.greenenergycorp.com) under one
    // or more contributor license agreements. See the NOTICE file
    // distributed with this work for additional information
    // regarding copyright ownership. Green Enery Corp licenses this file
    // to you under the Apache License, Version 2.0 (the
    // "License"); you may not use this file except in compliance
    // with the License. You may obtain a copy of the License at
    // http://www.apache.org/licenses/LICENSE-2.0
    // Unless required by applicable law or agreed to in writing,
    // software distributed under the License is distributed on an
    // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    // KIND, either express or implied. See the License for the
    // specific language governing permissions and limitations
    // under the License.
    //
    #include "Objects.h"
    
    #define MACRO_STATIC_INSTANCE(group, var) Group##group##Var##var Group##group##Var##var::mInstance;
    
    namespace apl { namespace dnp {
    
    MACRO_STATIC_INSTANCE(1,0)
    MACRO_STATIC_INSTANCE(1,1)
    MACRO_STATIC_INSTANCE(1,2)
    MACRO_STATIC_INSTANCE(2,0)
    MACRO_STATIC_INSTANCE(2,1)
    MACRO_STATIC_INSTANCE(2,2)
    MACRO_STATIC_INSTANCE(2,3)
    
    <... 100500 строк ...>
    
    MACRO_STATIC_INSTANCE(60,1)
    MACRO_STATIC_INSTANCE(60,2)
    MACRO_STATIC_INSTANCE(60,3)
    MACRO_STATIC_INSTANCE(60,4)
    
    MACRO_STATIC_INSTANCE(80,1)
    
    MACRO_STATIC_INSTANCE(110,0)
    MACRO_STATIC_INSTANCE(111,0)
    MACRO_STATIC_INSTANCE(112,0)
    MACRO_STATIC_INSTANCE(113,0)
    
    //////////////////////////////////////////////
    // Binary Input Types
    //////////////////////////////////////////////
    
    void Group1Var2::Write(apl::byte_t* p, const apl::Binary& v) const { DNPToStream::WriteQ(p, Group1Var2::Inst(), v); }
    void Group2Var1::Write(apl::byte_t* p, const apl::Binary& v) const { DNPToStream::WriteQ(p, Group2Var1::Inst(), v); }
    void Group2Var2::Write(apl::byte_t* p, const apl::Binary& v) const { DNPToStream::WriteQT(p, Group2Var2::Inst(), v); }
    void Group2Var3::Write(apl::byte_t* p, const apl::Binary& v) const { DNPToStream::WriteQT(p, Group2Var3::Inst(), v); }
    
    Binary Group1Var2::Read(const apl::byte_t* p) const { return DNPFromStream::ReadBinaryQV(p, Group1Var2::Inst()); }
    Binary Group2Var1::Read(const apl::byte_t* p) const { return DNPFromStream::ReadBinaryQV(p, Group2Var1::Inst()); }
    Binary Group2Var2::Read(const apl::byte_t* p) const { return DNPFromStream::ReadBinaryQV(p, Group2Var2::Inst()); }
    Binary Group2Var3::Read(const apl::byte_t* p) const { return DNPFromStream::ReadBinaryQVT(p, Group2Var3::Inst()); }

    "We provide world-class engineering services to companies leading the smart energy revolution."
    посредством копипасты. малаца.

    xXx_totalwar, 14 Января 2011

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

    +168

    1. 1
    2. 2
    3. 3
    4. 4
    TOutputConsoleWindow::TOutputConsoleWindow(void)
    {
                  //...
    	_mainWindow = new TConsoleOutputWindow(Rect);

    Говногость, 14 Января 2011

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

    +168

    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
    class TalentsWindow : public PopupWindow {
    	render::Sprite* m_background_sprite, *m_header_sprite, *m_fucking_sprite;
    ...
    ...
    };
    
    ...
    
    TalentsWindow::TalentsWindow()
    {
    ...
    	m_fucking_sprite = m_sprites.addSprite(render::SpriteRect(NOINITIALIZE)
                .setTop(591.0f)
                .setLeft(500.0f)
                .setWidth(411.0f)
                .setHeight(140.0f),
                m_tex,
                0.85f
            );
            m_fucking_sprite->setPosition(math::float2(818.0f, 50.0f));
    		m_fucking_sprite->idiot = true;
    ...
    }

    Самодокументирующий код.

    Kirinyale, 13 Января 2011

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

    +145

    1. 1
    2. 2
    3. 3
    #ifndef UTF8_ONLY
        I HATE YOU!!!!
    #endif

    Говногость, 12 Января 2011

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

    +164

    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
    void Attr::setConvertedValue(std::string pValue)
    {
        /* ............. - BEGIN - Place the HTML code instead of the */
        /* plain values. This is needed since special XML characters      */
        /* might exist.                                                   */
        for(int i = 0; i < pValue.length(); i++)
        {
            int ascii = (int)pValue[i];
    
            if(!( (ascii == 32 ) ||
                  (ascii >= 48 && ascii <= 57) ||
                  (ascii >= 65 && ascii <= 90) ||
                  (ascii >= 97 && ascii <= 122) ) )
            {
                if( ascii < 0 )
                    ascii += 256;
    
                std::ostringstream stream;
                stream << ascii;
    
                std::string newString = stream.str();
                newString = "&#" + newString + ';';
    
                pValue.replace(i, 1, newString);
    
                i += newString.length() - 1;
            }
        }
        /* ............. - END - Place the HTML code instead of the */
        /* plain values. This is needed since special XML characters      */
        /* might exist.                                                   */
        mConvertedValue = pValue;
    }

    я стою на асфальте, ноги в лыжы абуты.

    мы эскайпим значения для ХМЛ.

    вы тут посмейтесь, а я пошел головой об стенку стучатся.

    ЗЫ пысано в Бразилии.

    Dummy00001, 11 Января 2011

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

    +145

    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
    /********************************************************************************
    ** Form generated from reading UI file 'qrselector.ui'
    **
    ** Created: Thu 6. Jan 14:25:49 2011
    **      by: Qt User Interface Compiler version 4.7.0
    **
    ** WARNING! All changes made in this file will be lost when recompiling UI file!
    ********************************************************************************/
    
    #ifndef UI_QRSELECTOR_H
    #define UI_QRSELECTOR_H
    
    #include <QtCore/QVariant>
    #include <QtGui/QAction>
    #include <QtGui/QApplication>
    #include <QtGui/QButtonGroup>
    #include <QtGui/QHeaderView>
    #include <QtGui/QLabel>
    #include <QtGui/QWidget>
    
    QT_BEGIN_NAMESPACE
    
    class Ui_QRSelector
    {
    public:
        QLabel *label;
    
        void setupUi(QWidget *QRSelector)
        {
            if (QRSelector->objectName().isEmpty())
                QRSelector->setObjectName(QString::fromUtf8("QRSelector"));
            QRSelector->resize(400, 300);
            label = new QLabel(QRSelector);
            label->setObjectName(QString::fromUtf8("label"));
            label->setGeometry(QRect(10, 10, 371, 16));
    
            retranslateUi(QRSelector);
    
            QMetaObject::connectSlotsByName(QRSelector);
        } // setupUi
    
        void retranslateUi(QWidget *QRSelector)
        {
            QRSelector->setWindowTitle(QApplication::translate("QRSelector", "QRSelector", 0, QApplication::UnicodeUTF8));
            label->setText(QString());
        } // retranslateUi
    
    };
    
    namespace Ui {
        class QRSelector: public Ui_QRSelector {};
    } // namespace Ui
    
    QT_END_NAMESPACE
    
    #endif // UI_QRSELECTOR_H

    ui_qrselector.h

    Resager, 06 Января 2011

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

    +145

    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
    #-------------------------------------------------
    #
    # Project created by QtCreator 2011-01-06T13:54:57
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    TARGET = RSelector
    TEMPLATE = app
    
    
    SOURCES += main.cpp\
            qrselector.cpp
    
    HEADERS  += qrselector.h
    
    FORMS    += qrselector.ui

    qrselector.pro

    Resager, 06 Января 2011

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

    +145

    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
    <?xml version="1.0" encoding="UTF-8"?>
    <ui version="4.0">
     <class>QRSelector</class>
     <widget class="QWidget" name="QRSelector">
      <property name="geometry">
       <rect>
        <x>0</x>
        <y>0</y>
        <width>400</width>
        <height>300</height>
       </rect>
      </property>
      <property name="windowTitle">
       <string>QRSelector</string>
      </property>
      <widget class="QLabel" name="label">
       <property name="geometry">
        <rect>
         <x>10</x>
         <y>10</y>
         <width>371</width>
         <height>16</height>
        </rect>
       </property>
       <property name="text">
        <string/>
       </property>
      </widget>
     </widget>
     <layoutdefault spacing="6" margin="11"/>
     <resources/>
     <connections/>
    </ui>

    qrselector.ui

    Resager, 06 Января 2011

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

    +145

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    #include <QtGui/QApplication>
    #include "qrselector.h"
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        QRSelector w;
        w.show();
    
        return a.exec();
    }

    main.cpp

    Resager, 06 Января 2011

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

    +145

    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
    #ifndef QRSELECTOR_H
    #define QRSELECTOR_H
    
    #include "ui_qrselector.h"
    #include <QMouseEvent>
    #include <QRubberBand>
    #include <QPixmap>
    #include <QVBoxLayout>
    
    class QRSelector : public QWidget, private Ui::QRSelector
    {
        Q_OBJECT
    
    public:
        explicit QRSelector(QWidget *parent = 0);
        QRubberBand *rubberBand;
        QPoint origin;
    
    protected:
        void changeEvent(QEvent *e);
        void mousePressEvent(QMouseEvent *e);
        void mouseMoveEvent(QMouseEvent *e);
    };
    
    #endif // QRSELECTOR_H

    qrselector.h

    Resager, 06 Января 2011

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