- 1
- 2
- 3
- 4
StringBuilder text = new StringBuilder();
for (char letter : section.getName().toCharArray()){
text.append(Character.toUpperCase(letter));
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+6
StringBuilder text = new StringBuilder();
for (char letter : section.getName().toCharArray()){
text.append(Character.toUpperCase(letter));
}
Вот так мы приводим текст к верхнему регистру
+6
$query_list_builder = array(
'1000' => " and account = $account_id and creator = $creator_id",
'0100' => " and account = $account_id and salepoint = $salepoint_id and creator <> $creator_id ",
'0010' => " and account = $account_id and creator <> $creator_id and salepoint <> $salepoint_id ",
'0001' => " and account IN ($watchlist) and creator <> $creator_id and salepoint <> $salepoint_id and account <> $account_id ",
'1100' => " and salepoint = $salepoint_id or creator = $creator_id and account = $account_id ",
'1010' => " and account = $account_id and salepoint <> $salepoint_id or creator = $creator_id ",
'1001' => " and account IN ($watchlist) and account <> $account_id or creator = $creator_id ",
'1110' => " and account = $account_id or creator = $creator_id and salepoint = $salepoint_id ",
'1101' => " and account IN ($watchlist) and account <> $account_id or creator = $creator_id or salepoint = $salepoint_id ",
'1111' => " and account IN ($watchlist) or account = $account_id or creator = $creator_id or salepoint = $salepoint_id ",
'0000' => " and creator <> $creator_id and salepoint <> $salepoint_id and account NOT IN ($watchlist) ",
'0011' => " and account IN ($watchlist) and salepoint <> $salepoint_id and creator <> $creator_id ",
'0111' => " and account IN ($watchlist) and creator <> $creator_id ",
'0110' => " and account = $account_id and creator <> $creator_id ",
'0101' => " and account IN ($watchlist) and account <> $account_id or salepoint = $salepoint_id and creator <> $creator_id ",
'1011' => " and account IN ($watchlist) and salepoint <> $salepoint_id or creator = $creator_id ",
);
+6
public void сдвинутьРяд()
{
this.caseInventory.setItem(24, this.caseInventory.getItem(23));
this.caseInventory.setItem(23, this.caseInventory.getItem(22));
this.caseInventory.setItem(22, this.caseInventory.getItem(21));
this.caseInventory.setItem(21, this.caseInventory.getItem(20));
this.caseInventory.setItem(20, null);
}
хмхмхмхмххмхмхм
+6
switch ($m->type) {
case 'photo':
echo sprintf('<div class="fb_photo %s"><a %s href="%s"><div style="background-image: url(\'%s\');"><b>%s</b><br>%s%s<div class="status">%s <img src="%s" /> %s <img src="%s" /></div></div></div>', ($showProfilePic ? 'padding65' : ''), (isset($_GET['nonavbar']) ? 'target="_top"' : 'target="_blank"'), $m->link . (isset($_GET['nonavbar']) ? '&openwithnavigation=1' : ''), str_replace("_s", "_n", $m->picture), $m->from->name, (!empty($m->message) ? $m->message.'<br>' : ''), ago($m->created_time, $timezone), isset($m->likes) && isset($m->likes->count) ? $m->likes->count : '', isset($m->likes) && isset($m->likes->count) ? buildUri('images/icons/like.png') : '', isset($m->comments) && isset($m->comments->count) ? $m->comments->count : '', isset($m->comments) && isset($m->comments->count) ? buildUri('images/icons/comment.png') : '');
break;
case 'video':
case 'link':
echo sprintf('<div class="fb_link %s"><a %s href="%s"><div style="width: 100%%; padding: 30px; box-sizing: border-box;border-bottom:1px solid #ccc;border-top:1px solid #ccc;"><img style="max-width: none; width:100px;" src="%s" /><div style="width: 100%%"><b>%s</b><br>%s</div></div><div style="position:absolute; right: 10px; bottom: 10px;" class="status">%s <img style="display: inline-block" src="%s" /> %s <img style="display: inline-block" src="%s" /></div></a></div>', ($showProfilePic ? 'padding65' : ''), (isset($_GET['nonavbar']) ? 'target="_top"' : 'target="_blank"'), $m->link . (isset($_GET['nonavbar']) ? '&openwithnavigation=1' : ''), $m->picture, $m->name, $m->message, ago($m->created_time, $timezone), isset($m->likes) && isset($m->likes->count) ? $m->likes->count : '', isset($m->likes) && isset($m->likes->count) ? buildUri('images/icons/like.png') : '', isset($m->comments) && isset($m->comments->count) ? $m->comments->count : '', isset($m->comments) && isset($m->comments->count) ? buildUri('images/icons/comment.png') : '');
//echo sprintf('<div class="fb_link"><a href="%s"><div><img src="%s" /><b>%s</b><br>%s<div class="status">%s likes, %s comments</div></div></div></div>', $m->link, str_replace("_s", "_n", $m->picture), $m->from->name, $m->message, $m->likes->count, $m->comments->count);
break;
case 'status':
echo sprintf('<div class="fb_link %s"><a %s href="%s"><div style="width: 100%%; padding: 30px; box-sizing: border-box;border-bottom:1px solid #ccc;border-top:1px solid #ccc;"><img style="max-width: none; width:100px;" src="%s" /><div style="width: 100%%"><b>%s</b><br>%s</div></div><div style="position:absolute; right: 10px; bottom: 10px;" class="status">%s <img style="display: inline-block" src="%s" /> %s <img style="display: inline-block" src="%s" /></div></a></div>', ($showProfilePic ? 'padding65' : ''), '', '', $m->picture, $m->name, $m->message, ago($m->created_time, $timezone), isset($m->likes) && isset($m->likes->count) ? $m->likes->count : '', isset($m->likes) && isset($m->likes->count) ? buildUri('images/icons/like.png') : '', isset($m->comments) && isset($m->comments->count) ? $m->comments->count : '', isset($m->comments) && isset($m->comments->count) ? buildUri('images/icons/comment.png') : '');
break;
default:
//echo 'TODO: ' . $m->type;
//var_dump($m);
break;
}
Верстка.
Уровень - бог.
+6
habrahabr.ru/post/113215/
Кодогенерируем вместе!
+6
# https://github.com/mpak2/mpak.su/blob/607ee884dddc1df541aefc4f3b06ea5c2bfa4470/modules/users/pass.php
if($_POST['new'] && $_POST['new'] == $_POST['ret']){
Сравнение пароля на ==
Для тех кто не знает, http://ideone.com/yPjk4K
+6
> var x = new String("eval(x.toString())");
undefined
> eval(x.toString());
RangeError: Maximum call stack size exceeded
Yo dawg, I heard you like evaluation. So I put evaluation in your evaluation so you could evaluate while you evaluate
Жаль что nodejs не осиливает заоптимизировать это как бесконечный цикл
+6
for(int i = 0; i < codes.size(); ++i) {
switch(i) {
case 0: ret.code0 = codes[i]; break;
case 1: ret.code1 = codes[i]; break;
case 2: ret.code2 = codes[i]; break;
case 3: ret.code3 = codes[i]; break;
case 4: ret.code4 = codes[i]; break;
case 5: ret.code5 = codes[i]; break;
}
}
А всё потому, что ret.code[0-5] - битовые поля. Эх.
+6
https://github.com/pascalabcnet/pascalabcnet
ШОК! Говном компилируется говно. Это рекорд
+6
if (selectedGroup == null)
return null;
return selectedGroup;
зачем if то?