-
+157
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
$('#id_accept_eula').click(function () {
// код аффтара
try {
var v = 1 - this.getAttribute('value');
this.setAttribute('value', v);
if (v == 1) {
$('#submit_button').removeAttr('disabled');
} else {
$('#submit_button').attr('disabled', 'disabled');
}
} catch (e) {
alert('exc: ' + e);
}
// заменил на
$("#submit_button").prop('disabled', !this.checked);
});
Когда платят за строки кода...
govnozmey,
14 Сентября 2014
-
+131
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
/*
* Copyright (C) 2007-2012 Allwinner Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef __DISP_DISPLAY_I_H__
#define __DISP_DISPLAY_I_H__
#include "ebios_de.h"
#include "ebios_lcdc_tve.h"
#include "drv_disp_i.h" /* For DISP_XXXXXX status codes */
#define DE_INF __inf
#define DE_WRN __wrn
#define OSAL_IRQ_RETURN IRQ_HANDLED
#define HANDTOID(handle) ((handle) - 100)
#define IDTOHAND(ID) ((ID) + 100)
#define INTC_IRQNO_SCALER0 SW_INT_IRQNO_DEFEBE0
#define INTC_IRQNO_SCALER1 SW_INT_IRQNO_DEFEBE1
#define INTC_IRQNO_LCDC0 SW_INT_IRQNO_LCDCTRL0
#define INTC_IRQNO_LCDC1 SW_INT_IRQNO_LCDCTRL1
#define MAX_SPRITE_BLOCKS 32
/*basic data information definition*/
enum {
FALSE = 0,
TRUE
};
#define DIS_NULL 0
#define BIT0 0x00000001
#define BIT1 0x00000002
#define BIT2 0x00000004
#define BIT3 0x00000008
#define BIT4 0x00000010
#define BIT5 0x00000020
#define BIT6 0x00000040
#define BIT7 0x00000080
#define BIT8 0x00000100
#define BIT9 0x00000200
#define BIT10 0x00000400
#define BIT11 0x00000800
#define BIT12 0x00001000
#define BIT13 0x00002000
#define BIT14 0x00004000
#define BIT15 0x00008000
#define BIT16 0x00010000
#define BIT17 0x00020000
#define BIT18 0x00040000
#define BIT19 0x00080000
#define BIT20 0x00100000
#define BIT21 0x00200000
#define BIT22 0x00400000
#define BIT23 0x00800000
#define BIT24 0x01000000
#define BIT25 0x02000000
#define BIT26 0x04000000
#define BIT27 0x08000000
#define BIT28 0x10000000
#define BIT29 0x20000000
#define BIT30 0x40000000
#define BIT31 0x80000000
#endif
Нашёл в драйвере дисплея. Вместо 1<<N.
mittorn,
13 Сентября 2014
-
+156
- 1
- 2
- 3
- 4
- 5
$data = $DB->...
reset($data);
while (list(, $row) = each($data)) {
// do somethig with $row
}
Я не понимаю, почему просто не использовать foreach?!
matasar,
13 Сентября 2014
-
+125
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 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
-
+153
- 1
- 2
$("div.entry-comment-wrapper").has("p strong a").each( function (i,e){
$.ajax({'url':'http://govnokod.ru/ratings/comment/'+$(e).attr('id').replace('comment-','')+'/against'}) } );
gost,
12 Сентября 2014
-
+173
- 1
var magnitude = parseInt('10' + new Array(8).join('0'));
вот такое встретилось
Sulik78,
12 Сентября 2014
-
+138
- 1
p.fANT = Convert.ToUInt16(((devStat & (1 << 13)) != 0 ? "1" : "0") + ((devStat & (1 << 12)) != 0 ? "1" : "0"), 2);
Вот сижу думаю так задуманно или автор сам не понял что написал
Smekalisty,
12 Сентября 2014
-
+133
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
private void gv3_HiddenEditor(object sender, EventArgs e)
{
if (cloneDt != null)
{
cloneDt = null;
}
if (cloneCt != null)
{
cloneCt = null;
}
}
Коллега в скайпе поделился говном из одного коммерческого проекта
Smekalisty,
12 Сентября 2014
-
−126
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
ТовМат = РегистрыСведений.ТоварнаяМартица;
ГруппаД = Справочники.КлассификацияABC.НайтиПоНаименованию("Д").Ссылка;
ТЗНомен = Запрос.Выполнить().Выгрузить();Ит=0;тСерт = Справочники.СертификатыСоответствия.ПустаяСсылка();
ТЗНомен.Сортировать("Производитель,Сертификат,Номенклатура");
тПроизвод="";
Для Каждого стр Из ТзНомен Цикл
Если Объект.ИсключитьТоварыГруппыД = Истина Тогда
Если стр.Номенклатура.КлассABC = ГруппаД Тогда
Продолжить;
КонецЕсли;
КонецЕсли;
Если стр.Номенклатура.ЭтоГруппа = Ложь Тогда
Если НаличиеВМатрице = истина Тогда
НаборД = ТовМат.СоздатьНаборЗаписей();
// устанавливаем параметры отбора по полному набору Измерений регистра:
НаборД.Отбор.нОменклатура.Установить(стр.Номенклатура.Ссылка);
НаборД.Прочитать();
Если НаборД.Количество() = 0 Тогда
Продолжить;
Конецесли;
КонецЕсли;
Бывший программист из нашей конторы отбирает строки таблицы с номенклатурой, по которой отсутствуют записи в регистре сведений, используя при этом другие "удивительные приемы программирования"... Ушел на повышение в саму 1С)))
GORYNY4,
12 Сентября 2014
-
+64
кода на самом деле нет, но это достойно говнокод.ру
на сервере был http метод GET /rest/user/anon/create
по непонятной причине был заменён на POST /rest/user/anon/create1
старый метод теперь возвращает 405 ошибку "Method not allowed" с заголовком Allow: POST, OPTIONS
kyzmitch,
12 Сентября 2014