- 1
- 2
- 3
- 4
- 5
public static string ParseUrl(string url, HttpContextBase context = null)
{
context.Items[QueryStringField.Tabs.OnlyTabContent] = false;
...
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+959
public static string ParseUrl(string url, HttpContextBase context = null)
{
context.Items[QueryStringField.Tabs.OnlyTabContent] = false;
...
}
+133
(define rsagen
(lambda ()
(for-each (lambda (rsa counter)
(cond
((> (random) 0.5)
(fprintf out-quest "%N=~s, d=~s\n\\item Задача. Криптосистема RSA. Дано: $p=~s,\\ q=~s,\\ e=~s$. Вычислить $N, d$.\n"
(third rsa)
(fifth rsa)
(first rsa)
(second rsa)
(fourth rsa)
))
(else
((lambda (randM)
(fprintf out-quest "%p=~s,q=~s,e=~s,M=~s\n\\item Задача. Криптосистема RSA. Дано: $d=~s,\\ N=~s,\\ C=~s$. Вычислить $M$.\n"
(first rsa)
(second rsa)
(fourth rsa)
(rsacrypt randM (fourth rsa) (third rsa))
(fifth rsa)
(third rsa)
randM
))
((Y
(lambda (checkrand)
(lambda (randf)
((lambda (rand)
(cond
((not (eq? (rsacrypt rand (fourth rsa) (third rsa)) rand))
rand)
(else
(checkrand randf))))
(randf)))))
(lambda () (- (third rsa) (+ (random (quotient (third rsa) 2)) 1))))
)
)
)
)
(take (shuffle (getalllistallmany_e (next-primes 7 50) (next-primes 5 10))) 14)
(build-list 14 (lambda (x) (+ x 1))))
))
Генерирование заданий по криптосистеме RSA. Обратите внимание на Y комбинатор.
+153
auto L = [](int i)->int { return i+1; };
typedef decltype(L) TL;
auto lfunc = &TL::operator();
int i = (L.*lfunc)(1);
+158
class dmRegion extends dmBaseRegion
{
public static function determineLang()
{
try {
$lang = sfContext::getInstance()->getUser()->getCulture();
} catch (sfException $e) {
$lang = 'ru';
}
return $lang;
}
Вот такая вот крутая модель.
+149
#include <iostream>
struct empty_struct{};
template<char S, typename N>
struct char_type
{
static const char value = S;
typedef N next;
};
typedef
char_type<'h',
char_type<'e',
char_type<'l',
char_type<'l',
char_type<'o',
char_type<' ',
char_type<'w',
char_type<'o',
char_type<'r',
char_type<'l',
char_type<'d',
char_type<'!',
char_type<'\n', empty_struct> > > > > > > > > > > > > data_type;
template<typename T>
void print()
{
std::cout << T::value;
print<T::next>();
}
template<>
void print<empty_struct>()
{
}
int main(int argc, char* argv[])
{
print<data_type>();
return 0;
}
Такой простой hello world!
+166
<?php
$q=mysql_num_rows(mysql_query("SELECT * FROM `users`"));
>
Печально, но так поступают 85% кодеров..
+161
int b;
int c();
template<class u, class v>
struct IsSameType
{
enum {r=0};
};
template<class u>
struct IsSameType<u,u>
{
enum {r=1};
};
//...
cout<<IsSameType<decltype(b),decltype(c())>::r<<endl;
cout<<IsSameType<decltype(b),decltype((b))>::r<<endl;
cout<<IsSameType<decltype(c()),decltype((b))>::r<<endl;
Сегодня увидим новую плюшку, что нам подарил новый стандарт С++0х.
1)Что на экране получим после выполнения данной программы?
2)Какие реально decltype возвращает типы в данных случаях?
Желательно ответить на оба вопроса, не компилируя. ^_^
+163
$username = $vbulletin->userinfo['username'];
.
.
.
.
.
.
$nickname = $username;
$nickname = mysql_real_escape_string($nickname);
PHP, булка, Эстонский код.
+165
if (result.indexOf('myWinLoadSD') > -1) {
_uWnd.alert('<br /><b>Вы успешно проголосовали</b>', '', {
w: 250,
h: 70,
tm: 3000
});
_uWnd.close('cap');
} else {
result = $(re).text().replace(/<div[^>]+/, '').replace(/<\/div>/, '').replace(/>\_/, '_');
$('body').append('<scri' + 'pt type="text/jav' + 'ascript">' + result + '<' + '/script>');
}
});
Бабуин!
−184
s="ftmbG!>!fvsU";k=''
for i in s:k+=map(lambda x:chr(ord(x)-1),s)[s.index(i)]
exec(k[::-1])
"Счастливой отладки, суки!" (с)