- 1
- 2
- 3
// Полный импорт
private void fullImport(Collection<Entity> entities, File unzippedDir)
throws IOException {
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+64
// Полный импорт
private void fullImport(Collection<Entity> entities, File unzippedDir)
throws IOException {
спасибо за подсказку
+126
<input type="text" id="tos" name="tos" data-validate="true" class="text-field" tabindex="6" data-validation-rules="^(https?|ftp):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$" data-validation-msg="Invalid URL" />
Monkey killing monkey killing monkey
Over pieces of the ground.
Silly monkeys give them thumbs,
They forge a blade,
And where there's one
they're bound to divide it,
Right in two.
Right in two.
:'(
+13
if(ortho){
if( abs(e->x() - line.p1().x() ) * 2 < abs( e->y() - line.p1().y() ) ){
y = e->y();
x = line.p1().x();
}else if(abs(e->x() - line.p1().x() ) > 2 * abs( e->y() - line.p1().y() )){
x = e->x();
y = line.p1().y();
}else if(abs(e->x() - line.p1().x() ) * 2 > abs( e->y() - line.p1().y() ) &&
abs(e->x() - line.p1().x() ) < abs( e->y() - line.p1().y() )){
if((e->x() < line.p1().x() && e->y() < line.p1().y()) || (e->x() > line.p1().x() && e->y() < line.p1().y())){
x = e->x();
y = line.p1().y() - abs(line.p1().x() - e->x());
}else if((e->x() > line.p1().x() && e->y() > line.p1().y()) || (e->x() < line.p1().x() && e->y() > line.p1().y())){
x = e->x();
y = line.p1().y() + abs(line.p1().x() - e->x());
}
}else if(abs(e->x() - line.p1().x() ) < 2 * abs( e->y() - line.p1().y() ) &&
abs(e->x() - line.p1().x() ) > abs( e->y() - line.p1().y() )){
if((e->x() < line.p1().x() && e->y() < line.p1().y()) || (e->x() < line.p1().x() && e->y() > line.p1().y())){
y = e->y();
x = line.p1().x() - abs(line.p1().y() - e->y());
}else if((e->x() > line.p1().x() && e->y() > line.p1().y()) || (e->x() > line.p1().x() && e->y() < line.p1().y())){
y = e->y();
x = line.p1().x() + abs(line.p1().y() - e->y());
}
}else{
x = e->x();
y = e->y();
}
+13
TAbstractMessageFrame * SwitchIfNeedReceivePackets = create_switch(
fnc_ext::bind(this,
fnc_ext::compose2(std::greater<WORD>(),
fnc_ext::get_mem(&TThisClass::_totalDataLength),
fnc_ext::compose1(std::bind1st(std::minus<WORD>(), static_cast<WORD>(TByteBuffer::MaxCapacity)),
fnc_ext::compose1(fnc_ext::get_mem_func_ref(&TThisClass::TByteBuffer::length),
fnc_ext::get_mem(&TThisClass::_receivedBuffer))))),
// fnc_ext::get_mem_func(&TThisClass::FreeBufferSpace))),
DataByPackets, DataByLength, "Switch If Need Receive Packets" );
+139
if ((ObjectType)value == ObjectType.Undefined)
{
return string.Empty;
}
{
return ((ObjectType)value).GetDescriptionAttribute();
}
Как будто не хватает чего-то..
+155
<?php
class Json_Encode {
public function Encode($obj) {
$str = "";
$type = gettype($obj);
if ($type == "array") {
$fst = 1;
if (array_keys($obj) !== range(0, count($obj) - 1)) {
$str .= "{";
foreach($obj as $id=>$el) {
if ($fst) {
$fst = 0;
} else {
$str .= ",";
}
$str .= "\"$id\":";
$str .= $this->Encode($el);
}
$str .= "}";
} else {
$str .= "[";
foreach($obj as $el) {
if ($fst) {
$fst = 0;
} else {
$str .= ",";
}
$str .= $this->Encode($el);
}
$str .= "]";
}
} else if ($type == "string") {
$str .= "\"$obj\"";
} else if ($obj == null) {
$str .= "null";
} else {
$str .= "$obj";
}
return $str;
}
}
Листинг файла json_encode.php
От души посмеялся.
+163
var sound = 0;
function chooseSound(x) {
if(x == 0) sound = 0;
else if(x == 1) sound = 1;
else if(x == 2) sound = 2;
else if(x == 3) sound = 3;
else if(x == 4) sound = 4;
else if(x == 5) sound = 5;
else if(x == 6) sound = 6;
else if(x == 7) sound = 7;
else if(x == 8) sound = 8;
else if(x == 9) sound = 9;
else if(x == 10) sound = 10;
else if(x == 11) sound = 11;
else if(x == 12) sound = 12;
else if(x == 13) sound = 13;
else if(x == 14) sound = 14;
else sound = 15;
}
отакота
+161
</if>
</if>
</ul>
</if>
</td>
</if>
</tr>
</if>
</foreach>
</table>
</div>
</div>
<br />
</div>
</if>
</foreach>
</if>
</div>
facepalm
+133
//программист
private void work7_Click(object sender, EventArgs e)
{
if ((player.CompLevel > 50) & (player.GamedevLevel > 20))
{
work1.Enabled = true;
work2.Enabled = true;
work3.Enabled = true;
work4.Enabled = true;
work5.Enabled = true;
work6.Enabled = true;
work7.Enabled = false;
player.Salary = 20000;
player.Levels = 50;
player.HealthWork = 0;
Game_Update();
}
else MessageBox.Show("Ты еще плохо знаешь программирование и компьютер");
}
Оттуда ж.
+23
struct mystream: public std::ostream
{
mystream(std::ostream & o): std::ostream(o.rdbuf()) {}
template <class T>
mystream & operator << (T const & arg)
{
if (enabled_) as_std_ostream() << arg;
return *this;
}
// дерьмо STX
mystream & operator << (std::ostream & (*f)(std::ostream &))
{
if (enabled_) as_std_ostream() << f;
return *this;
}
mystream & operator << (std::ios & (*f)(std::ios &))
{
if (enabled_) as_std_ostream() << f;
return *this;
}
mystream & operator << (std::ios_base & (*f)(std::ios_base &))
{
if (enabled_) as_std_ostream() << f;
return *this;
}
// дерьмо ETX
void enable() { enabled_ = true; }
void disable() { enabled_ = false; }
protected:
bool enabled_;
std::ostream & as_std_ostream() { return *this; }
};
а так хотелось хоть сегодня рыбки поесть захерачить вместо трёх перегрузок
template <class O>
mystream & operator << (O & (*f)(O &)) { ...