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

    −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
    <a class="callformtrigger"  href="http://#ck_callback_button"><!-- container box --></a>
    <script>
    (function(){
    	try{
                var el = $("a.callformtrigger");
                var hash = el.attr("href");
                hash = hash.replace("http://", "");
                el.attr("href", hash);
    	}
    	catch(e)
    	{
    		/** **/
    	}
    })();
    </script>

    вместо того, чтобы поправить данный url в исходниках, был применен данный способ

    turbosnail, 26 Сентября 2018

    Комментарии (10)
  2. Куча / Говнокод #24819

    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
    : ?>
      BEGIN
        SOURCE >IN @ /STRING 2DUP
        S" <?" SEARCH NIP
        IF
          NIP OVER -
          DUP 2 + >IN +!
          STATE @ IF
            POSTPONE SLITERAL
            ['] TYPE COMPILE,
          ELSE
            TYPE
          THEN
          TRUE
        ELSE
          DROP 
          STATE @ IF
            POSTPONE SLITERAL
            ['] TYPE COMPILE,
            ['] CR COMPILE,
          ELSE
            TYPE CR
          THEN
          REFILL 0=
        THEN
      UNTIL
    ; IMMEDIATE
    
    : ROW
      5 0 ?DO
        ?> <TD> <? I . ?> </TD> <?
      LOOP
    ;
    
    : T-ROWS
      0 ?DO
        ?>
        <TR>
        <? DUP EXECUTE ?>
        </TR>
        <?
      LOOP
      DROP
    ;
    
    ?> <!DOCTYPE HTML>
    <HTML>
    <HEAD>
    <TITLE>OLOLO!</TITLE>
    </HEAD>
    <BODY>
    <H1>THIS IS FORTH BABY ;)</H1>
    <TABLE>
    <? ' ROW 5 T-ROWS ?>
    </TABLE>
    </BODY>
    </HTML>

    =)

    Morgoth, 26 Сентября 2018

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

    −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
    #include <stdio.h>
    #include <locale.h>
    main()
    {
    	setlocale(LC_ALL, "Rus");
    	float lower, medium, upper;
    	lower = 2;
    	medium = 50;
    	upper = 100;
    	float step = 1;
    	printf( "\t\t%s\n\n\n","Температура пукана относительно изучения ЯП (10 лет) ");
    	printf("%s\t\t%s\t\t%s\n","изучение основ","изучение STL" , "делать сайтики на Ассемблере");
    	while (step <= 10)
    	{
    		++step;
    		printf("%.1f\t\t\t%.1f\t\t\t%.1f\n", lower*step, lower*step*5, medium * step*10);
    	}
    	getchar();
    }

    Немного статистики Hot пукана

    __DmitrJ, 26 Сентября 2018

    Комментарии (25)
  4. SQL / Говнокод #24817

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    https://ru.wikipedia.org/wiki/Хранимая_процедура#Возможности_программирования
    Начиная с версии Oracle 10g поддерживается так называемая естественная компиляция
    (native compilation) хранимого процедурного кода в Си и затем в машинный код целевой
    машины, после чего при вызове хранимой процедуры происходит прямое выполнение её
    скомпилированного объектного кода.

    Можно сделать вирусню, живущую в этих самых хранимых процедурах в машинном коде и инфицирующую другие БД с хранимыми процедурами

    j123123, 26 Сентября 2018

    Комментарии (42)
  5. Pascal / Говнокод #24816

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    procedure ChangeChar(var c: char; val: char);
    begin
      c := val;
    end;

    Это из модуля PABCSystem. Но зачем?

    Morgoth, 26 Сентября 2018

    Комментарии (14)
  6. PHP / Говнокод #24813

    −4

    1. 1
    2. 2
    3. 3
    <?php
     
    --"";

    PHP Parse error: syntax error, unexpected ';', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /home/XQ5b1K/prog.php on line 3

    https://ideone.com/vYLgSF

    guestinxo, 25 Сентября 2018

    Комментарии (9)
  7. PHP / Говнокод #24812

    −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 MyBigClass
    {
        var $allocatedSize;
        var $allMyOtherStuff;
    }
    
    function AllocateMyBigClass()
    {
        $before = memory_get_usage();
        $ret = new MyBigClass;
        $after = memory_get_usage();
        $ret->allocatedSize = ($after - $before);
    
        return $ret;
    }

    Зачем нам в языке адекватный sizeof, у нас нет времени, чтобы ебаться с ним!

    Подробнее: https://stackoverflow.com/questions/1351855/getting-size-in-memory-of-an-object-in-php

    gost, 25 Сентября 2018

    Комментарии (25)
  8. PHP / Говнокод #24811

    +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
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    /**
     * Cast an object into a different class.
     *
     * Currently this only supports casting DOWN the inheritance chain,
     * that is, an object may only be cast into a class if that class 
     * is a descendant of the object's current class.
     *
     * This is mostly to avoid potentially losing data by casting across
     * incompatable classes.
     *
     * @param object $object The object to cast.
     * @param string $class The class to cast the object into.
     * @return object
     */
    function cast($object, $class) {
    	if( !is_object($object) ) 
    		throw new InvalidArgumentException('$object must be an object.');
    	if( !is_string($class) )
    		throw new InvalidArgumentException('$class must be a string.');
    	if( !class_exists($class) )
    		throw new InvalidArgumentException(sprintf('Unknown class: %s.', $class));
    	if( !is_subclass_of($class, get_class($object)) ) 
    		throw new InvalidArgumentException(sprintf(
    			'%s is not a descendant of $object class: %s.',
    			$class, get_class($object)
    		));
    	/**
    	 * This is a beautifully ugly hack.
    	 *
    	 * First, we serialize our object, which turns it into a string, allowing
    	 * us to muck about with it using standard string manipulation methods.
    	 *
    	 * Then, we use preg_replace to change it's defined type to the class
    	 * we're casting it to, and then serialize the string back into an
    	 * object.
    	 */
    	return unserialize(
    		preg_replace(
    			'/^O:\d+:"[^"]++"/', 
    			'O:'.strlen($class).':"'.$class.'"',
    			serialize($object)
    		)
    	);
    }

    Это прекрасно.

    gost, 25 Сентября 2018

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

    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
    static {
        final Logger log = LoggerFactory.getLogger(ModulePeer.class);
        if (log.isDebugEnabled()) {
          final Map<String, Function<String, String>> source = new LinkedHashMap<>();
          source.put("LD_LIBRARY_PATH", System::getenv);
          source.put("java.library.path", System::getProperty);
          source.put("java.class.path", System::getProperty);
    
          final Map<String, Set<Path>> dump = source.entrySet().stream().collect(Collectors.toMap(e -> e
            .getKey(), e -> Optional.ofNullable(e.getValue().apply(e.getKey())).map(i -> Pattern
              .compile(Pattern.quote(System.getProperty("path.separator"))).splitAsStream(i)).orElse(
                Stream.empty()).map(n -> Paths.get(n).toAbsolutePath()) //
              .collect(Collectors.toCollection(TreeSet::new)), (u, v) -> {
                throw new IllegalStateException(String.format("Duplicate key %s", u));
              }, LinkedHashMap::new));
    
          log.info(dump.toString());
        }
    ...
    }

    Немного практики с манадами и лямбдами.

    javamaker, 25 Сентября 2018

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

    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
    frm.ShowDialog(); 
    if (frm.DialogResult == DialogResult.OK) 
    { 
    string s = ""; 
    if (frm.chkResident.Checked == true) 
    s = "-ДА-"; 
    else 
    s = "-НЕТ-"; 
    s = "Резидент: " + s + ", страна рождения: " + frm.cmbCountryBirth.Text.Trim() + ", дата рождения: " + frm.dtpBirth.Value.ToShortDateString() + " г., место рождения: " + frm.txtPlaceBorn.Text.Trim() + (char)13 + (char)10; 
    s = s + "тип ДУЛ: " + frm.cmbDUL.Text.Trim() + ", дата выдачи ДУЛ: " + frm.dtpDUL.Value.ToShortDateString() + " г."; 
    if (frm.dtpEndDUL.Value.ToShortDateString() != "01.01.1900") 
    s = s + ", дата окончания ДУЛ: " + frm.dtpEndDUL.Value.ToShortDateString() + " г."; 
    s = s + (char)13 + (char)10; 
    s = s + "Серия и номер ДУЛ: " + frm.txtDUL.Text.Trim() + ", страна выдачи ДУЛ: " + frm.cmbLandDUL.Text.Trim() + ", орган выдачи ДУЛ: " + frm.txtIssue.Text.Trim() + (char)13 + (char)10; 
    
    if (frm.txtDUL2.Text.Trim() != "") 
    { 
    s = s + "тип ДУЛ2: " + frm.cmbDUL2.Text.Trim() + ", дата выдачи ДУЛ2:" + frm.dtpDUL2.Value.ToShortDateString() + " г."; 
    if (frm.dtpEndDUL2.Value.ToShortDateString() != "01.01.1900") 
    s = s + ", дата окончания ДУЛ2: " + frm.dtpEndDUL2.Value.ToShortDateString() + " г."; 
    s = s + (char)13 + (char)10; 
    s = s + "Серия и номер ДУЛ2: " + frm.txtDUL2.Text.Trim() + ", страна выдачи ДУЛ2: " + frm.cmbLandDUL2.Text.Trim() + ", орган выдачи ДУЛ2: " + frm.txtIssue2.Text.Trim() + (char)13 + (char)10; 
    } 
    
    s = s + "---------------------------------------------------------------" + (char)13 + (char)10; 
    s = s + "Адрес:" + (char)13 + (char)10; 
    s = s + "Строка 1:" + frm.txtAddress1.Text.Trim() + (char)13 + (char)10; 
    s = s + "Строка 2:" + frm.txtAddress2.Text.Trim() + (char)13 + (char)10; 
    s = s + "Штат: " + frm.txtState.Text.Trim() + ", нас. пункт: " + frm.txtPunkt.Text.Trim() + ", индекс: " + frm.txtPOSTINDEX.Text.Trim() + ", страна: " + frm.cmbLand.Text.Trim() + (char)13 + (char)10; 
    s = s + "Тел. код: " + frm.cmbPhoneCode.Text.Trim() + ", мобильный номер: " + frm.txtPhone.Text.Trim();

    У меня нет слов...

    awesome3000, 25 Сентября 2018

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