- 1
const TWindow window(TWindowKindController::TWindowID WindowName, bool& isMainWindow=*(bool*)NULL)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+159
const TWindow window(TWindowKindController::TWindowID WindowName, bool& isMainWindow=*(bool*)NULL)
Крупный проЭкт.
Мне кажется или с isMainWindow что-то не чисто?
+162
if (substr(getcwd(), 0, 1) == "/")
{
$div = ":";
} // *nix system
else
{
$div = ";";
}
PATH_SEPARATOR? Нет, не слышал.
+197
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.an)!==-1;},ctype_alpha:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.al)!==-1;},ctype_cntrl:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.ct)!==-1;},ctype_digit:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.dg)!==-1;},ctype_graph:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.gr)!==-1;},ctype_lower:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.lw)!==-1;},ctype_print:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.pr)!==-1;},ctype_punct:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.pu)!==-1;},ctype_space:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.sp)!==-1;},ctype_upper:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.up)!==-1;},ctype_xdigit:function(text){if(typeof text!=='string'){return false;}
При беглом просмотре бросился мне тут в глаза кусочек из http://phpjs.org/downloads/php.common.min.js
+89
// пароль как при входе в Win XP
Edit1.Font.Name:='Wingdings';
Edit1.PasswordChar:='l'; // символ "точка"
//
j:=78575;
j1:=j;
Edit6.Text:='1234567890АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~ .,:;"-=+\/|!?@#$%^&*_№<>()[]{}`';
try
RichEdit2.Lines.LoadFromFile('conf.ps');
except
MessageDlg('Файл "conf.ps" не найден!',mtError,[mbOK],0);
Close;
end;
st:='1234567890АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~ .,:;"-=+\/|!?@#$%^&*_№<>()[]{}`';
a:=RichEdit2.Lines.Strings[0];
x:=length(a);
try
for i:=1 to x do
begin
if pos(a[i],Edit6.Text)<>0 then
begin
Edit6.SelStart:=pos(a[i],Edit6.Text)-1;
n:=Edit6.SelStart;
s1:=n+1;
j:=j1;
s:=s1-j;
if ((s<=159) and (s>=0)) then
begin
s:=s1-j;
a[i]:=st[s];
goto M;
end;
j:=j1-n-1;
repeat
tt:=j-159;
s:=abs(tt);
j:=s;
until (s<=159);
s:=159-s;
a[i]:=st[s];
M:
end
else
end;
shif_str:=a;
except
MessageDlg('Ошибка открытия пароля!',mtError,[mbOK],0);
end;
вот такая процедура "проверки" пароля попалась)))
+157
.....
function init()
{
.......
$this->smenu = file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/sitemenu/?tb=/lombards/?type_id=1');
$this->smenu2 = file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/sitemenu/?tb=/lombards/?type_id=2');
$this->sform = file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/searchform/?request=lombards&'.$_SERVER['QUERY_STRING']);
$this->bottom = file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/bottom/');
.......
}
.....
Чистый ООП
P.S. Проект на zend framework
+121
public static boolean isAssignable(Class cls, Class toClass, boolean autoboxing) {
if (toClass == null) {
return false;
}
// have to check for null, as isAssignableFrom doesn't
if (cls == null) {
return !(toClass.isPrimitive());
}
//autoboxing:
if (autoboxing) {
if (cls.isPrimitive() && !toClass.isPrimitive()) {
cls = primitiveToWrapper(cls);
if (cls == null) {
return false;
}
}
if (toClass.isPrimitive() && !cls.isPrimitive()) {
cls = wrapperToPrimitive(cls);
if (cls == null) {
return false;
}
}
}
if (cls.equals(toClass)) {
return true;
}
if (cls.isPrimitive()) {
if (toClass.isPrimitive() == false) {
return false;
}
if (Integer.TYPE.equals(cls)) {
return Long.TYPE.equals(toClass)
|| Float.TYPE.equals(toClass)
|| Double.TYPE.equals(toClass);
}
if (Long.TYPE.equals(cls)) {
return Float.TYPE.equals(toClass)
|| Double.TYPE.equals(toClass);
}
if (Boolean.TYPE.equals(cls)) {
return false;
}
if (Double.TYPE.equals(cls)) {
return false;
}
if (Float.TYPE.equals(cls)) {
return Double.TYPE.equals(toClass);
}
if (Character.TYPE.equals(cls)) {
return Integer.TYPE.equals(toClass)
|| Long.TYPE.equals(toClass)
|| Float.TYPE.equals(toClass)
|| Double.TYPE.equals(toClass);
}
if (Short.TYPE.equals(cls)) {
return Integer.TYPE.equals(toClass)
|| Long.TYPE.equals(toClass)
|| Float.TYPE.equals(toClass)
|| Double.TYPE.equals(toClass);
}
if (Byte.TYPE.equals(cls)) {
return Short.TYPE.equals(toClass)
|| Integer.TYPE.equals(toClass)
|| Long.TYPE.equals(toClass)
|| Float.TYPE.equals(toClass)
|| Double.TYPE.equals(toClass);
}
// should never get here
return false;
}
return toClass.isAssignableFrom(cls);
}
org.apache.commons.lang.ClassUtils
+71
StringBuffer possibleNames = new StringBuffer();
int max = item.getPossibleNames().length;
for (int i = 0; i < max; i++) {
..
possibleNames.append(ing.name + " " + ( i != (max-1) ? ", " : ""));
..
}
вставка запятых между элементами массива
+119
ApiException(final ResourceException cause, final Representation repr,
final Class<? extends ErrorResponse> responseClass) {
super(cause);
this.cause = cause;
ErrorResponse response = null;
try {
response = new ObjectMapper().readValue(repr.getText(), responseClass);
} catch (final Exception e) {
log.error("Error attempting to parse the error response", e);
} finally {
this.response = response;
}
}
Возникла ошибка при возникновении ошибки...
+154
function unbb($str)
{
return preg_replace('#\[(.*?)\]#ui', '', preg_replace('#\[(.*?)\](.*?)\[\/(.*?)\]#ui', '', $str));
}
+154
$query = rawurldecode(A::get('query'));
$maps = strtolower($query);
$maps_array = array();
// cs_assault,"de_dust",de_inferno
$map = strtok($maps, ',');
do
{
$map = trim($map);
// если экранирование кавычками то искать точное совпадение, пример: "de_dust"
if(preg_match('/^"(.*)"$/', $map, $match_map))
{
$map = mysql::safe(end($match_map));
$maps_array[] = "map = '".$map."'";
}
else
{
$maps_array[] = "map LIKE '%".mysql::safe($map)."%'";
}
} while($map = strtok(','));
mysql::query("SELECT * FROM servers WHERE status=1 ".join(" OR ", $maps_array));