- 1
int i;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+64
int i;
кода на самом деле нет, но это достойно говнокод.ру
на сервере был http метод GET /rest/user/anon/create
по непонятной причине был заменён на POST /rest/user/anon/create1
старый метод теперь возвращает 405 ошибку "Method not allowed" с заголовком Allow: POST, OPTIONS
+162
<?php
/**
* Project: Smarty: the PHP compiling template engine
* File: Smarty.class.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* For questions, help, comments, discussion, etc., please join the
* Smarty mailing list. Send a blank e-mail to
* [email protected]
*
* @link http://www.smarty.net/
* @copyright 2001-2005 New Digital Group, Inc.
* @author Monte Ohrt <monte at ohrt dot com>
* @author Andrei Zmievski <[email protected]>
* @package Smarty
* @version 2.6.26
*/
/* $Id: Smarty.class.php 3163 2009-06-17 14:39:24Z monte.ohrt $ */
/**
* DIR_SEP isn't used anymore, but third party apps might
*/
echo ".";
?>
+88
var
s: string := '1 2 4 8 16 32 64 128 256 512';
sum: integer;
num,p: integer;
numstr: string;
begin
sum := 0;
while s.Length>0 do
begin
while s[1]=' ' do // Удаление лидирующих пробелов
Delete(s,1,1);
p := Pos(' ',s); // Поиск следующего пробела
if p=0 then // Если он не найден, то до конца строки находится последнее число
p := s.Length;
numstr := Copy(s,1,p);
Delete(s,1,p);
num := StrToInt(numstr);
sum += num;
end;
writeln('Сумма чисел строки равна ',sum);
end.
"Pascal" не умеет в split?
http://pascalabc.net/wiki/index.php/Строки_и_символы._Тексты_программ
+119
public static RuntimeException propagate(Throwable throwable)
This method always throws an exception. The RuntimeException return type is only for client code to make Java type system happy in case a return value is required by the enclosing method.
Давно пора сделать аннотацию типа noreturn, чтобы компилятор не ругался и подсвечивал мёртвый код.
+68
public static String elvis(String value, String ifNull) {
return value == null ? ifNull : value;
}
public static Boolean elvis(Boolean value, Boolean ifNull) {
return value == null ? ifNull : value;
}
public static Object elvis(Object value, Object ifNull) {
return value == null ? ifNull : value;
}
- Objects#firstNotNull()?
- нет, не слышал
+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();
}
Как будто не хватает чего-то..