- 1
SELECT * FROM users WHERE sex=1;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−852
SELECT * FROM users WHERE sex=1;
Долго думал, sex=1 это мужики или дамы. Оказалось мужики.
+147
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
говно
+162
if (!empty($login) & !empty($pass) & !empty($compIDS)) {
if (($login != "admin") | ($pass != "qwe754wwQ")) {
print <<<HERE
<script language="JavaScript">
<!--
alert ("Имя пользователя и (или) пароль неверны!");
//-->
</script>
HERE;
}
else {
}
}
Враг не пройдет!
+159
function setBlockStatus()
{
global $adminTpl, $core, $db;
..........
}
function setCommentStatus()
{
global $adminTpl, $core, $db;
..........
}
function deleteBlock()
{
global $adminTpl, $core, $db;
..........
}
И еще десятки других функций которые так любят глобальные переменные в Toogle CMS =)
+958
if (args.Cube == null)
{
args.Cube = null;
stringBuilder.AppendLine(Properties.Resources.ErrorCubeEmpty);
}
else if(...)
{
...
}
else if (...)
{
...
}
else
{
...
}
int num = args.Cube.NumSamplesIJK.K;
−104
@hands_by_value.each do |hand|
if @hands_by_value.slice(@hands_by_value.index(hand)+1..@hands_by_value.index(@hands_by_value.last)).include?(hand)
@hands_by_value.delete_at(@hands_by_value.index(hand))
end
end
Рукотворный array.uniq! похоже :)
+113
public string GetNormalImage(int newWidth, int newHeight, string sufix = "normal") {
String[] tmp = _originalImagePath.Split('.');
String newImagePath = "";
for (int i = 0; i < tmp.Length - 1; i++)
{
newImagePath += tmp[i];
newImagePath += "_";
}
newImagePath += sufix + ".";
newImagePath += tmp[tmp.Length - 1];
Image oldImage = Image.FromFile(_originalImagePath);
if (oldImage.Height >= oldImage.Width) {
Image newImage;
newImage = FixedSize(oldImage, newWidth, newHeight);
newImage.Save(newImagePath);
} else {
float heightRatio = (float)newHeight / (float)oldImage.Height;
float widthRatio = (float)newWidth / (float)oldImage.Width;
float bestRatio = 1;
if (heightRatio < widthRatio) {
bestRatio = heightRatio;
} else {
bestRatio = widthRatio;
}
var result = new System.Drawing.Bitmap((int)Math.Round(oldImage.Width * bestRatio), (int)Math.Round(oldImage.Height * bestRatio));
using (var graphics = Graphics.FromImage(result))
{
graphics.CompositingQuality = CompositingQuality.HighQuality;
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.DrawImage(oldImage, new Rectangle(Point.Empty, new Size((int)Math.Round(oldImage.Width * bestRatio), (int)Math.Round(oldImage.Height * bestRatio))));
}
result.Save(newImagePath);
}
return newImagePath;
}
ресайз изображения
−104
<%= !!@case[:img] ? image_tag(@case[:img]) : "" %>
−144
#! /bin/sh
# some code
daemon1="/usr/home/daemon1.sh"
daemon2="/home/daemon2.sh"
# some code with variables
Скрипт на BSD. Хомяк находится в /usr/home, а /home симлинк на него
+147
int __fastcall TForm1::iscomm(AnsiString str)
{
int i=1;
while (str[i]==' ')
i++;
if (str[i]=='#')
{
return 1;
}
else
{
return 0;
};
};