- 1
- 2
// empty the contents of the stringData
$stringData = "";
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+151
// empty the contents of the stringData
$stringData = "";
С уважением, Ваш КО! ;)
+132
private void doComand(byte command)
{
byte value = 0;
if (command <= 44)
{
if (command <= 32)
{
switch (command)
{
case 0:
case 5:
case 10:
break;
case 1:
this.RB.Value = this.RA.Value;
break;
case 2:
this.RC.Value = this.RA.Value;
break;
case 3:
this.RD.Value = this.RA.Value;
break;
case 4:
this.RA.Value = this.RB.Value;
break;
case 6:
this.RC.Value = this.RB.Value;
break;
case 7:
this.RD.Value = this.RB.Value;
break;
case 8:
this.RA.Value = this.RC.Value;
break;
case 9:
this.RB.Value = this.RC.Value;
break;
case 11:
this.RD.Value = this.RC.Value;
break;
case 12:
this.RA.Value = this.RD.Value;
break;
case 13:
this.RB.Value = this.RD.Value;
break;
case 14:
this.RC.Value = this.RD.Value;
break;
default:
if (command == 32)
{
this.RA.Value = 0;
}
break;
}
}
else
{
if (command != 36)
{
if (command != 40)
{
if (command == 44)
{
byte value2 = this.RA.Value;
byte value3 = this.RB.Value;
byte b = 0;
for (byte b2 = 0; b2 < 8; b2 += 1)
{
this.setBit(ref b, b2, this.getBit(value2, b2) && this.getBit(value3, b2));
}
this.RA.Value = b;
if (b == 0)
{
this.setBit(ref value, 0, true);
}
}
}
else
{
byte value2 = this.RA.Value;
byte value3 = this.RB.Value;
byte b = 0;
for (byte b3 = 0; b3 < 8; b3 += 1)
{
this.setBit(ref b, b3, this.getBit(value2, b3) || this.getBit(value3, b3));
}
this.RA.Value = b;
if (b == 0)
{
this.setBit(ref value, 0, true);
}
}
}
else
{
byte value4 = this.RA.Value;
Элсы,свечи,ифы и просто хороший код №1
(продолжение следует)
годная реализация того что можно было написать в 10 строчек
+122
for (byte b4 = 0; b4 < 8; b4 += 1)
{
this.setBit(ref value4, b4, !this.getBit(value4, b4));
}
this.RA.Value = value4;
if (value4 == 0)
{
this.setBit(ref value, 0, true);
}
}
}
}
else
{
if (command <= 56)
{
if (command != 48)
{
if (command != 52)
{
if (command == 56)
{
byte value4 = this.RA.Value;
if (this.getBit(value4, 0))
{
this.setBit(ref value, 1, true);
}
for (byte b5 = 0; b5 < 7; b5 += 1)
{
this.setBit(ref value4, b5, this.getBit(value4, b5 + 1));
}
this.setBit(ref value4, 7, false);
this.RA.Value = value4;
if (value4 == 0)
{
this.setBit(ref value, 0, true);
}
}
}
else
{
byte value4 = this.RA.Value;
if (this.getBit(value4, 7))
{
this.setBit(ref value, 1, true);
}
for (byte b6 = 7; b6 > 0; b6 -= 1)
{
this.setBit(ref value4, b6, this.getBit(value4, b6 - 1));
}
this.setBit(ref value4, 0, false);
this.RA.Value = value4;
if (value4 == 0)
{
this.setBit(ref value, 0, true);
}
}
}
else
{
byte value2 = this.RA.Value;
byte value3 = this.RB.Value;
byte b = 0;
for (byte b7 = 0; b7 < 8; b7 += 1)
{
this.setBit(ref b, b7, this.getBit(value2, b7) ^ this.getBit(value3, b7));
}
this.RA.Value = b;
if (b == 0)
{
this.setBit(ref value, 0, true);
}
}
}
else
{
switch (command)
{
case 60:
{
int value5 = (int)this.RA.Value;
int value6 = (int)this.RB.Value;
int num = value5 + value6;
if (num == 0)
{
this.setBit(ref value, 0, true);
}
if (num > 255)
{
this.setBit(ref value, 1, true);
}
this.RA.Value = (byte)num;
break;
}
case 61:
case 62:
case 63:
break;
Элсы,свечи,ифы и просто хороший код №2
(продолжение следует)
годная реализация того что можно было написать в 10 строчек
+121
case 64:
{
this.RA.Value = this.memory.getValue(this.CCR.Value);
HideRegister expr_555 = this.CCR;
expr_555.Value += 1;
break;
}
case 65:
{
this.RB.Value = this.memory.getValue(this.CCR.Value);
HideRegister expr_58F = this.CCR;
expr_58F.Value += 1;
break;
}
case 66:
{
this.RC.Value = this.memory.getValue(this.CCR.Value);
HideRegister expr_5C9 = this.CCR;
expr_5C9.Value += 1;
break;
}
case 67:
{
this.RD.Value = this.memory.getValue(this.CCR.Value);
HideRegister expr_603 = this.CCR;
expr_603.Value += 1;
break;
}
default:
if (command != 129)
{
switch (command)
{
case 192:
if (this.getBit(this.FR.Value, 0))
{
this.CCR.Value = this.memory.getValue(this.CCR.Value);
}
else
{
HideRegister expr_67C = this.CCR;
expr_67C.Value += 1;
}
break;
case 193:
if (!this.getBit(this.FR.Value, 0))
{
this.CCR.Value = this.memory.getValue(this.CCR.Value);
}
else
{
HideRegister expr_6CF = this.CCR;
expr_6CF.Value += 1;
}
break;
case 194:
if (this.getBit(this.FR.Value, 1))
{
this.CCR.Value = this.memory.getValue(this.CCR.Value);
}
else
{
HideRegister expr_71F = this.CCR;
expr_71F.Value += 1;
}
break;
case 195:
if (!this.getBit(this.FR.Value, 1))
{
this.CCR.Value = this.memory.getValue(this.CCR.Value);
}
else
{
HideRegister expr_76C = this.CCR;
expr_76C.Value += 1;
}
break;
}
}
else
{
this.CCR.Value = this.memory.getValue(this.CCR.Value);
}
break;
}
}
}
this.FR.Value = value;
}
Элсы,свечи,ифы и просто хороший код №3
(продолжение следует)
годная реализация того что можно было написать в 10 строчек
+122
input.for-blind, select.for-blind, textarea.for-blind {
font-size: 5em !important;
/*font-family: "Louis Braille";
font-convexity: 3mm;*/
}
ДОСТАЛО!!11
+67
public static boolean areEquals(Object [] ... paires){
for(Object [] paire : paires){
if(paire[0] == null || !paire[0].equals(paire[1])){
return false;
}
}
return true;
}
Целый день убил из-за этого говна
+154
} else {
if (is_array($v))
foreach ($v as $kk => $vv) {
if (null != $vv) {
$empty = true;
if (is_array($vv)) {
if (sizeof($vv) > 0) {
$empty = false;
}
} else {
$vv = trim($vv);
if (isset($vv{0})) {
$empty = false;
}
}
if (false === $empty) {
if (in_array($kk, $keys)) {
if (empty($fields[$kk]))
continue;
$fld = $fields[$kk];
$val = $this->getTable('field-value')->createRow(array(
'entity_id' => $id
, 'entity_type_id' => $entityTypeId
, 'field_id' => $fld['id']
, 'value_' . $fld['type_name'] => $this->_typedValue($vv, $fld['type_name'])
, 'step' => $step
));
$val->save();
if (($entity_id == null) || ($entity_id = '')) {
$entity_id = $id;
}
}
}
}
}
}
}
}
}
}
тру-хардкор
−133
Функция ПроверкаНогИВанны()
Строка = ТаблицаНоменклатуры.Найти(Справочники.Номенклатура.НайтиПоКоду("50641 "), "Номенклатура");
Если Строка = Неопределено Тогда
Возврат Ложь;
Иначе
СтрокаВанна = ТаблицаНоменклатуры.Найти(Справочники.Номенклатура.НайтиПоКоду("50624 "), "Номенклатура");
Если СтрокаВанна = Неопределено Тогда
Возврат Истина
Иначе
Возврат Ложь
КонецЕсли;
КонецЕсли;
КонецФункции
+1001
if(unitClass == Apprentice && unitClass == Master)
{
unitClass = Artisan;
}
+109
public static bool IsLocalAddress(IPAddress address)
{
if (address.ToString() == IPAddress.Loopback.ToString())
{
return true;
}
foreach (IPAddress address2 in LocalAddresses)
{
if (address2.ToString() == address.ToString())
{
return true;
}
}
return false;
}
Выдрано решарпером из одного коммерческой библиотеки.