1. Куча / Говнокод #16735

    +127

    1. 1
    https://www.marshut.net/knqkut/dijkstra-s-methodology-for-secure-systems-development.html

    Учитесь троллить! (Я подписался на рассылку запостить пару багов, а тут...)

    wvxvw, 20 Сентября 2014

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

    +128

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    <a href="#" id="foo" onclick="this.nextSibling.style.display=''; return!1;">Click here for view</a><p style="display: none;">
    <noscript>
        </p>
            <style type="text/css"> a#foo { display:none; } </style>
        <p>
    </noscript>
    
        /*... some info ...*/
    </p>

    Баян, не? Вот. Наговнокодилось. captcha=5555

    istem, 18 Сентября 2014

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

    +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
    (closer-mop:defclass virtual-metaclass (closer-mop:standard-class) ())
    
    (closer-mop:defclass virtual-slot-definition
        (closer-mop:standard-slot-definition)
      ((function :initarg :function 
                 :accessor virtual-slot-definition-function)))
    
    (defmethod slot-definition-allocation ((slotd virtual-slot-definition))
      :virtual)
    
    (defmethod (setf slot-definition-allocation) 
        (allocation (slotd virtual-slot-definition))
      (unless (eq allocation :virtual)
        (error "Cannot change the allocation of a ~S"
               'virtual-direct-slot-definition)) allocation)
    
    (closer-mop:defclass virtual-direct-slot-definition 
        (closer-mop:standard-direct-slot-definition
         virtual-slot-definition) ())
    
    (defmethod closer-mop:direct-slot-definition-class
        ((class virtual-metaclass) &rest initargs)
      ;; Use virtual-direct-slot-definition if appropriate.
      (if (eq (getf initargs :allocation) :virtual)
          (find-class 'virtual-direct-slot-definition)
          (call-next-method)))
    
    (closer-mop:defclass virtual-effective-slot-definition 
        (closer-mop:standard-effective-slot-definition
         virtual-slot-definition) ())
    
    (defmethod closer-mop:effective-slot-definition-class 
        ((class virtual-metaclass) &rest initargs)
      ;; Use virtual-effective-slot-definition if appropriate.
      (let ((slot-initargs (getf initargs :initargs)))
        (if (member :virtual-slot slot-initargs)
            (find-class 'virtual-effective-slot-definition)
            (call-next-method))))
    
    (defmethod closer-mop:compute-effective-slot-definition 
        ((class virtual-metaclass) name direct-slot-definitions)
      ;; Copy the function into the effective slot definition
      ;; if appropriate.
      (let ((effective-slotd (call-next-method)))
        (dolist (slotd direct-slot-definitions)
          (when (typep slotd 'virtual-slot-definition)
            (setf (virtual-slot-definition-function effective-slotd) 
                  (virtual-slot-definition-function slotd))
            (return)))
        effective-slotd))
    
    (defmethod closer-mop:slot-value-using-class 
        ((class virtual-metaclass) object slot-name)
      (let ((slotd (find slot-name (closer-mop:class-slots class) 
                         :key 'closer-mop:slot-definition-name)))
        (if (typep slotd 'virtual-slot-definition)
            (funcall (cadr (virtual-slot-definition-function slotd)) :get object)
            (call-next-method))))
    
    (defmethod (setf closer-mop:slot-value-using-class) 
        (value (class virtual-metaclass) object slotd)
      (if (typep slotd 'virtual-slot-definition)
          ;; This is ugly and probably not portable, but what if?
          (funcall (cadr (virtual-slot-definition-function slotd))
                   :set object value)
          (call-next-method)))
    
    (defmethod closer-mop:slot-boundp-using-class 
        ((class virtual-metaclass) object slot-name)
      (let ((slotd (find slot-name (closer-mop:class-slots class) 
                         :key 'closer-mop:slot-definition-name)))
        (if (typep slotd 'virtual-slot-definition)
            (funcall (cadr (virtual-slot-definition-function slotd)) :is-set object)
            (call-next-method))))
    
    (defmethod closer-mop:slot-makunbound-using-class 
        ((class virtual-metaclass) object slot-name)
      (let ((slotd (find slot-name (closer-mop:class-slots class) 
                         :key 'closer-mop:slot-definition-name)))
        (if (typep slotd 'virtual-slot-definition)
            (funcall (virtual-slot-definition-function slotd) :unset object)
            (call-next-method))))

    О простоте объектно-ориентированого программирования, или страшная правда, которую от вас так долго скрывали.
    Написано по мотивам: http://www.lispworks.com/documentation/lw50/LWUG/html/lwuser-173.htm В попытке сделать это, по возможности, портабельным (на SBCL вроде даже завелось).

    Я понимаю, что читать это никто не будет, поэтому, краткий пересказ событий:
    Захотелось мне виртуальных свойств, ну тоесть так, чтобы при обращении к Сипипишной библиотеке, для которой я ваяю оберкту не было различий между обычными Лисповыми объектами и Сипипишными.
    Простой вариант - скопировать значения, но перформанс же!
    И вот родился этот вариант. (Использование не показано, т.как не влезло).

    wvxvw, 12 Сентября 2014

    Комментарии (16)
  4. Куча / Говнокод #16618

    +124

    1. 1
    ru.m.wikipedia.org/wiki/Мобильный_вирус

    "Наиболее перспективной платформой для написания вирусов является Java 2ME , так как подавляющее большинство современных телефонов поддерживает данную платформу"
    Не, ну это пиздец. Сегодня полдня доказывал чуваку что на его говнозвонилке вирусов быть не может технически. Потом посмотрел в вики и охуел - такое ощущение что статью писал кто то из лаборатории Касперского, с целью напугать хомячков и попиарить себя.
    Соседняя статья:
    "Некомпетентные пользователи ошибочно относят к компьютерным вирусам и другие виды вредоносных программ — программы-шпионы и прочее."
    http://ru.wikipedia.org/wiki/Компьютерный_вирус

    Pythoner, 29 Августа 2014

    Комментарии (46)
  5. Куча / Говнокод #16595

    +126

    1. 1
    @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { ... }

    При правке стилей купленной темы..
    Ну ебта, что ви таки за 5 долларов то хотели

    jhhshh, 25 Августа 2014

    Комментарии (11)
  6. Куча / Говнокод #16581

    +131

    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
    module Main:
    	program factorial:
    		algorithm factorial:
    			description of the algorithm:
    				factorial of n is the algorithm that calculates the product of all the positive integers less than or equal to n.
    			end of description of the algorithm.
    			example of usage of the algorithm:
    				var1 is equal to call algorithm with parameter n which is equal to 5;
    					begin of a comment:
    						var1 is now1 120 = 5*4*3*2*1.
    						end of a comment.
    			end of example of usage of the algorithm.
    			description of author of the algorithm:
    				name: John.
    				surname: Smith.
    				date of writing of the algorithm: 2009.
    			end of description of author of the algorithm.
    			properties of the algorithm:
    				callable from other modules.
    				callable from this module.
    				can be used in expressions.
    			end of properties of the algorithm.
    			parameters of the algorithm:
    				data n: type is positive integer.
    			end of parameters of the algorithm.
    			variables of the algorithm:
    				data res: type is positive integer.
    				data now1: type is positive integer.
    			end of variables of the algorithm.
    			initialization of the variables of the algorithm:
    				res is equal to 1.
    				now1 is equal to n.
    			end of initialization of the variables of the algorithm.
    			begin of the algorithm:
    				cycle: while now1 is not 1, repeat:
    					res is equal to multiply res by now1.
    					now1 is equal to subtract 1 from now1.
    				end of cycle.
    				result of the algorithm is res
    		end of the algorithm.
    
    		algorithm main:
    			description of the algorithm:
    				main algorithm that shows the factorial of the inputted number.
    			end of description of the algorithm.
    			example of usage of the algorithm:
    			end of example of usage of the algorithm.
    			description of author of the algorithm:
    				name: John.
    				surname: Smith.
    				date of writing of the algorithm: 2009.
    			end of description of author of the algorithm.
    			properties of the algorithm:
    				callable from the system.
    			end of properties of the algorithm.
    			parameters of the algorithm:
    				data arguments: type is array of strings.
    			end of parameters of the algorithm.
    			variables of the algorithm:
    			end of variables of the algorithm.
    			initialization of the variables of the algorithm:
    			end of initialization of the variables of the algorithm.
    			begin of the algorithm:
    				call algorithm writeInteger with parameter str which is equal to
    					call algorithm factorial with parameter n which is equal to
    						call algorithm readInteger without parameters.
    				result of the algorithm is 0.
    		end of the algorithm.

    Небольшой ответ набирающему популярность WCT. Новый язык программирования LOOOONG:
    - Отступы обязательны.
    - Все блоки в функциях ("алгоритмах") обязательны.
    - блоки нужно записывать именно в таком порядке.
    - Имена параметров необходимо помнить, когда вызываешь "алгоритм".
    - Ключевых слов ОЧЕНЬ МНОГО.

    miscff, 22 Августа 2014

    Комментарии (40)
  7. Куча / Говнокод #16575

    +143

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    http://vk.com/proger_girl?z=photo-34196141_334770895%2Falbum-34196141_00%2Frev
    
    http://vk.com/tproger?w=page-30666517_48155477
    
    http://vk.com/search?c%5Bq%5D=wct&c%5Bsection%5D=auto&w=wall172535832_2076

    WCT - оно везде!

    kegdan, 21 Августа 2014

    Комментарии (155)
  8. Куча / Говнокод #16574

    +101

    1. 1
    удалено

    Кто делает выгрузка в таком формате???
    xml? json? так лучше, епта

    Cascader, 21 Августа 2014

    Комментарии (36)
  9. Куча / Говнокод #16566

    +143

    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
    Монады как коллбеки
    
    На джаваскриптовой конференции, о которой я писал в прошлом посте, в процессе обсуждения 
    ФП неизбежно встала тема монад.
    
    Мне было интересно, насколько легко можно объяснить монады «на пальцах». Возможно, не в 
    той степени, чтобы человек смог сразу с ними программировать, но в той степени, чтобы понимать,
     что они делают и зачем нужны.
    
    И у меня возникла идея объяснить монады без типов. Мне кажется, главную сложность при изучении 
    монад вызывают именно типы (а точнее, конструкторы типов и классы конструкторов типов), т.к. многие 
    приходят в Haskell из языков с менее выразительной системой типов.
    
    В то же время, монады могут существовать и в динамических языках. А если из монад убрать типы, 
    то останется лишь то, как они работают во время исполнения — и там все довольно прозрачно.
    
    Вычислительная сущность монад — это continuation passing style, или коллбеки. Любая программа 
    на node.js написана в этом стиле.
    
    Левый аргумент >>= — вычисление, а правый — коллбек. Коллбек принимает результат вычисления 
    и совершает какие-то дальнейшие вычисления
    
    Эта аналогия особенно точно выполняется для монад Identity, IO, Maybe/Either. Каждая отдельная 
    монада определяет, к чему конкретно будет применен коллбек.
    
    Но посмотрим, например, на монаду [] (список). Если руководствоваться только лишь представлением 
    о монаде как о вызове коллбеков, то самый простой способ определить списочную монаду — это a >>= k = map k a (что неверно).
    
    Аналогия с коллбеками слишком «императивна» и не улавливает тонкость — структуру самой монады. 
    Чтобы эту структуру наглядно показать, как раз и нужны типы.

    kegdan, 19 Августа 2014

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

    +133

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    rem Check if Windows XP or Windows 7
    rem XP: C:\Documents and Settings (or language specific folder)
    rem 7: C:\Users
    
    set oprsystem=%appdata:~3,5%
    if %oprsystem%==Users (
      set ops=win7
    ) else (
      set ops=winxp
    )

    Batch
    http://members.ferrara.linux.it/freddy77/encfs.html

    galeksandrp, 18 Августа 2014

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