- 1
- 2
- 3
- 4
- 5
- 6
<?php
$Fnm = $mosConfig_absolute_path .'/components/'.$option.'/cron.php';
$inF = fopen($Fnm,"w");
fwrite($inF,'<?php $last_cron_date='.$last_cron_date.';?>');
fclose($inF);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+155.9
<?php
$Fnm = $mosConfig_absolute_path .'/components/'.$option.'/cron.php';
$inF = fopen($Fnm,"w");
fwrite($inF,'<?php $last_cron_date='.$last_cron_date.';?>');
fclose($inF);
всеми любимая джумла... а точнее один из её компонентов... строка 1846-ая...
почему собственно гадость:
1. а если нету доступа на запись...
2. не безопасно
3. если в файле что-нибудь будет не так - обвалится весь сайт, потому как ошибко php
4. я настороженно отношусь к файлам по 2246 - строк ... уж больно много всего...
+124.3
Functions called:
fflush (4 times)
delete (11 times)
fclose (1 times)
free (11 times)
fread (3 times)
fopen (1 times)
vsnprintf (4 times)
new (11 times)
SysReallocMem (652 times)
SysFreeMem (13185 times)
SysGetMem (13188 times)
lstrlenA (1 times)
lstrcpynA (4 times)
calloc (1 times)
strlen (98 times)
realloc (1 times)
strdup (1 times)
malloc (8 times)
memcpy (4 times)
Resource types used:
object (11 allocs, 11 max)
memory block (13199 allocs, 4007 max)
file stream (1 allocs, 1 max)
file handle (1 allocs, 1 max)
−409.2
import urllib, sys, string
from string import maketrans
bbb = 0
f = urllib.urlopen("http://www.pythonchallenge.com/pc/def/equality.html")
while 1:
buf = f.read(200000)
if not len(buf):
break
for x in range(len(buf)):
if buf[x] in string.ascii_lowercase:
if buf[x+1] in string.ascii_uppercase:
if buf[x-1] in string.ascii_uppercase:
if buf[x+2] in string.ascii_uppercase:
if buf[x-2] in string.ascii_uppercase:
if buf[x+3] in string.ascii_uppercase:
if buf[x-3] in string.ascii_uppercase:
if buf[x+4] in string.ascii_lowercase:
if buf[x-4] in string.ascii_lowercase:
bbb = x
sys.stdout.write(buf)
print(buf[bbb-3:bbb+4])
http://stackoverflow.com/questions/1972693/python-challenge-level-3
+59.5
//и теперь шлём запрос письма
reply = QString("<iq type='get' from='%1' to='%2' id='mail-request-%3'>"\
"<query xmlns='google:mail:notify' %4 %5/></iq>")
.arg(from)
.arg(to)
.arg(id)
.arg((lastCheck.value(QString("%1").arg(account),"")=="")?QString(""):QString("newer-than-time='%1'").arg(lastCheck.value(QString("%1").arg(account))))
.arg((lastTid.value(QString("%1").arg(account),"")=="")?QString(""):QString("newer-than-tid='%1'").arg(lastTid.value(QString("%1").arg(account))));
stanzaSender->sendStanza(account, reply);
Раскопано в недрах плагинов к psi:
Особенно радует шедевральная конвертация int'а в строку при помощи QString("%1").arg(account),"")
Плюс ко всему комменты на русском в интернациональном проекте это немножко моветон
+135.4
public static BitmapImage ConvertBitmapToBitmapImage(Bitmap bitmap)
{
var bitMapImage = new BitmapImage();
var ms = new MemoryStream();
try
{
bitmap.Save(ms, ImageFormat.Bmp);
bitMapImage.BeginInit();
bitMapImage.StreamSource = ms;
bitMapImage.EndInit();
}
catch (NotSupportedException e)
{
try
{
bitMapImage = new BitmapImage();
bitmap.Save(ms, ImageFormat.Png);
bitMapImage.BeginInit();
bitMapImage.StreamSource = ms;
bitMapImage.EndInit();
}
catch (NotSupportedException e2)
{
bitMapImage = new BitmapImage();
bitmap.Save(ms, ImageFormat.Bmp);
ms.Write(ms.ToArray(), 78, (int)(ms.Length - 78));
bitMapImage.BeginInit();
bitMapImage.StreamSource = ms;
bitMapImage.EndInit();
}
}
return bitMapImage;
}
wpf + System.Drawing + sql и хз что со всем этим делать )))))
+168.1
function check($pass)
{ if (strpos($pass,'0') || strpos($pass,'1')
|| strpos($pass,'2') || strpos($pass,'3')
|| strpos($pass,'4') || strpos($pass,'5')
|| strpos($pass,'6') || strpos($pass,'7')
|| strpos($pass,'8') || strpos($pass,'9'))
{
if (strpos($pass,'a') || strpos($pass,'b') || strpos($pass,'c')
|| strpos($pass,'d') || strpos($pass,'e') || strpos($pass,'f')
|| strpos($pass,'g') || strpos($pass,'h') || strpos($pass,'i')
|| strpos($pass,'j') || strpos($pass,'k') || strpos($pass,'l')
|| strpos($pass,'m') || strpos($pass,'n') || strpos($pass,'o')
|| strpos($pass,'p') || strpos($pass,'q') || strpos($pass,'r')
|| strpos($pass,'s') || strpos($pass,'t') || strpos($pass,'u')
|| strpos($pass,'v') || strpos($pass,'w') || strpos($pass,'x')
|| strpos($pass,'y') || strpos($pass,'z'))
{
if (strpos($pass,'A') || strpos($pass,'B') || strpos($pass,'C')
|| strpos($pass,'D') || strpos($pass,'E') || strpos($pass,'F')
|| strpos($pass,'G') || strpos($pass,'H') || strpos($pass,'I')
|| strpos($pass,'J') || strpos($pass,'K') || strpos($pass,'K')
|| strpos($pass,'M') || strpos($pass,'N') || strpos($pass,'O')
|| strpos($pass,'P') || strpos($pass,'Q') || strpos($pass,'R')
|| strpos($pass,'S') || strpos($pass,'T') || strpos($pass,'U')
|| strpos($pass,'V') || strpos($pass,'W') || strpos($pass,'X')
|| strpos($pass,'Y') || strpos($pass,'Z'))
{ if (ctype_lower(substr($pass,0,1)) || ctype_upper(substr($pass,0,1)) || is_numeric(substr($pass,0,1)))
{ if (ctype_lower(substr($pass,0,1)))
{ if (!ctype_lower(substr($pass,-1)))
{ return $pass; } }
if (ctype_upper(substr($pass,0,1)))
{
if (!ctype_upper(substr($pass,-1)))
{
return $pass;
}
}
if (is_numeric(substr($pass,0,1)))
{
if (!is_numeric(substr($pass,-1)))
{
return $pass;
}
} }
}
}
} }
без коментариев. (из одного вап чата)
+162.5
public function run() {
$this->_stop();
}
К концу рабочего дня у себя такое обнаружил = ) Заработался.
+148
<? if (!$isLogged) {
echo '
<table class="br-table" align="center" cellspacing="0" cellpadding="0">
<tr>
<td class="corner-lt"></td>
<td class="left-br-top"></td>
<td class="corner-rt"></td>
</tr>
<tr>
<td colspan="3" class="box">
<h1 class="h1-title" ><img src="img/star.png">';
блаблабла
Да, и <? if(): ?> <?endif;?> их тоже не учили :(
+160.4
$('input').each(function () {
if ($(this).attr('type') == 'text') {
this.className = 'textInput';
}
if ($(this).attr('type') == 'password') {
this.className = 'passwordInput';
}
});
$('textarea').each(function () {
this.className = 'textarea';
});
это чудо было найдено здесь http://uweb.ws/publ/javascript/dobavljaem_vsem_ehlementam_input_i_texta rea_klassy/1-1-0-8
+122.4
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<!--
POSTER PHOTO
-->
<div id="poster-photo-container">
<img src="images/photo-poster.jpg" alt="" class="poster-photo-image" />
<div id="feature-area-home">
<div id="login" class="boxed">
<h2 class="title">Аккаунт пользователя</h2>
<div class="content">
<fieldset>
<legend>Войти</legend>
<label for="inputtext1">Аккаунт :</label>
<input id="inputtext1" type="text" name="inputtext1" value="" />
<label for="inputtext2">Пароль :</label>
<input id="inputtext2" type="password" name="inputtext2" value="" />
<asp:Button ID="Button1" runat="server" Text="Войти" onclick="Button1_Click" />
<p><a href="#">Забыли пароль ?</p>
</a>
</fieldset>
</div>
</div>
</div>
</div>
<!--
CONTENT CONTAINER
-->
<div id="content-container-two-column">
<!--
CONTENT MAIN COLUMN
-->
<div id="content-main-two-column">
<h1>
<span lang="ru">Контроль измерительных приборов.</span> </h1>
<p>
Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet
dolore magna aliquam erat volutpat.</p>
<div id="three-column-container">
<div id="three-column-side1">
<a href="Items.aspx">
<img src="images/home-photo-1.jpg" class="photo-border" alt="Enter Alt Text Here" /></a>
<h2>
<span lang="ru">Хромотографы ?</span></h2>
<p>
<span lang="ru">11111111</span></p>
<span lang="ru">
<a href="Items.aspx">Подробнее</a></span><img class="arrow" src="images/arrow.gif" alt="" /></div>
</div>
</div>
<!--
CONTENT SIDE COLUMN
-->
<div class="clear">
</div>
</div>
</asp:Content>
Найти DIV