- 1
Верните мой WCT!
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+1
Верните мой WCT!
+1
function crooked_nail_create_item(){ ...
Зато честно!
+1
define('OKVED_TRY_BUILD_CHUNK_IF_IT_NOT_FOUND_IN_CHUNKCACHE', TRUE);
Написал строчку и думаю - то ли я наговнокодил с названием, то ли соломки подстелил, так, что через месяц я ТОЧНО вспомню, зачем оно нужно...
+1
foreach ($child as $ch) {
if ($ch->nodeName === 'w:style') {
$sum++;
if ($ch->hasAttributes()) {
/** @var DOMAttr $attribute */
foreach ($ch->attributes as $attribute) {
if ($attribute->name === 'styleId') {
if ($attribute->value == $sTempStyle) {
/** @var DOMElement $styleNode */
foreach ($ch->childNodes as $styleNode) {
if (isset($styleNode->tagName) && $styleNode->tagName === 'w:basedOn') {
$basedOn = $styleNode->getAttribute('w:val');
$properties = $this->wordStyle2Array($basedOn, $tagName, $properties);
}
if (isset($styleNode->tagName) && $styleNode->tagName === $tagName) {
$elements = $styleNode->childNodes;
/** @var DOMElement $element */
foreach ($elements as $element) {
if (isset($element->tagName)) {
switch ($element->tagName) {
case 'w:color':
if ($element->hasAttribute('w:val')) {
$properties['color']['hex'] = '#' . $element->getAttribute
('w:val');
}
break;
case 'w:rFonts':
if ($element->hasAttribute('w:ascii')) {
$properties['font_family'] = $element->getAttribute('w:ascii');
}
break;
//кейсы - бесконечные как осень в России
}
}
}
}
}
}
}
}
}
}
Чувак, мы слышали ты любишь плодить уровни вложенности, поэтому мы написали switch в if в foreach в if в foreach в if в if в foreach в if в if в foreach, кажется.
+1
#pragma strict
function Start () {
function OnMouseDown (); {
if(name=="new") { Application.LoadLevel("procedural"); }
if(name=="set") { }
if(name=="exit") { Application.Quit(); }
}
}
+1
<span style="font-size: 16px; line-height: 12px;">
<b style="color: rgb(255, 102, 102);background-color:rgb(255, 204, 204);">
<span <a href="news/"><b style="color:rgb(153, 102, 0);">Новости</b></span>
________________________________________________________</b></span>
html код на одном сайте
+1
$row['sub']=str_replace("{&quot;",'{"',$row['sub']);
$row['sub']=str_replace("&quot;:&quot;",'":"',$row['sub']);
$row['sub']=str_replace(""",'"',$row['sub']);
$row['sub']=str_replace("&",'"',$row['sub']);
$row['sub']=str_replace("quot;:quot;",'":"',$row['sub']);
$row['sub']=str_replace("{quot;",'{"',$row['sub']);
$row['sub']=str_replace("quot;}",'"}',$row['sub']);
$row['sub']=str_replace("quot;:",'":',$row['sub']);
$sub = json_decode($row['sub']);
+1
$sql = array();
foreach ($stats as $date => $array) {
$where="";
$where = array();
$where['date'] = $date;
foreach ($array as $sub => $array1) {
$where['sub'] = $nosqlmap->text($sub);
foreach ($array1 as $webmaster => $array2) {
$where['user']=$webmaster;
foreach ($array2 as $offer => $array3) {
$where['offer'] = $offer;
foreach ($array3 as $promo => $array4) {
$where['promo'] = $promo;
foreach ($array4 as $potoc => $array5) {
$where['potoc'] = $nosqlmap->o9($potoc);
if (!isset($stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['orders'])) $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['orders'] = 0;
if (!isset($stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['aprove'])) $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['aprove'] = 0;
if (!isset($stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['noorder'])) $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['noorder'] = 0;
if (!isset($stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['money'])) $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['money'] = 0;
$where['unics'] = $array5['unics'];
$where['hits'] = $array5['hits'];
$where['orders'] = $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['orders'];
$where['aprove'] = $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['aprove'];
$where['noorder'] = $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['noorder'];
$where['money'] = $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['money'];
$sql[] = $where;
}
}
}
}
}
}
+1
$error = 0;
list($date, $time) = explode(' ', $_POST['date_till']);
if (isset($date) && isset($time)) {
list($day, $month, $year) = explode('.', $date);
list($hour, $min) = explode(':', $time);
if (isset($day) && isset($month) && isset($year) && isset($hour) && isset($min)) {
$date_till = "$year-$month-$day $hour:$min:00";
$executed = Groups::setOutOfRangeGroups($date_till);
if (!$executed) {echo 'q';
$error = 1;
}
} else {echo 'w';
$error = 1;
}
} else {echo 'e';
$error = 1;
}
Нормальные герои всегда идут в обход!
+1
bool isNoGoodCommentText = String.IsNullOrEmpty(this.txbxCommentCtrl.Text) || String.IsNullOrWhiteSpace(this.txbxCommentCtrl.Text);
И действительно, is not good