- 1
- 2
- 3
- 4
public List<Market> GetMarkets(List<Sport> sports)
{
return (from sport in sports from region in sport.Regions from league in region.Leagues from game in league.Games from market in game.Markets select market).ToList();
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−2
public List<Market> GetMarkets(List<Sport> sports)
{
return (from sport in sports from region in sport.Regions from league in region.Leagues from game in league.Games from market in game.Markets select market).ToList();
}
вонючий код от решарпера
−2
...
Array(
'url' => 'http://' . (@$_SERVER['HTTP_HOST']) . (@$_SERVER['REQUEST_URI']),
'captcha.key' => 'ключ для капчи он такой ключ',
'retail.cache_lifetime' => 3600,
'hash.salt' => 'Соль для хэшированийяаааааа!%$#@)((()+))(',
'icon' => '/favicon.ico'
)
...
+3
this.products.forEach(product => {
if (product.product_type === 'recruitment'
|| product.product_type === 'recruitment_platform') {
this.hasRecruitmentProducts = true;
}
if (product.product_type === 'ats'
|| product.product_type === 'recruitment'
|| product.product_type === 'recruitment_platform') {
if (product.product_type === 'recruitment'
|| product.product_type === 'recruitment_platform') {
product['externalPath'] = this.accountRoutes['MyCb'];
product['isActive'] = true;
}
this.HEADER_DATA.appSwitcher.unshift(product);
}
});
Вот такие вот вещи пишут ребята из удаленной тимы клиента в Америке.
+1
#if !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
namespace __detail {
template<typename _Tp, size_t ..._Extra> struct __repeat;
template<typename _Tp, _Tp ..._Np, size_t ..._Extra> struct __repeat<__integer_sequence<_Tp, _Np...>, _Extra...> {
typedef __integer_sequence<_Tp,
_Np...,
sizeof...(_Np) + _Np...,
2 * sizeof...(_Np) + _Np...,
3 * sizeof...(_Np) + _Np...,
4 * sizeof...(_Np) + _Np...,
5 * sizeof...(_Np) + _Np...,
6 * sizeof...(_Np) + _Np...,
7 * sizeof...(_Np) + _Np...,
_Extra...> type;
};
template<size_t _Np> struct __parity;
template<size_t _Np> struct __make : __parity<_Np % 8>::template __pmake<_Np> {};
template<> struct __make<0> { typedef __integer_sequence<size_t> type; };
template<> struct __make<1> { typedef __integer_sequence<size_t, 0> type; };
template<> struct __make<2> { typedef __integer_sequence<size_t, 0, 1> type; };
template<> struct __make<3> { typedef __integer_sequence<size_t, 0, 1, 2> type; };
template<> struct __make<4> { typedef __integer_sequence<size_t, 0, 1, 2, 3> type; };
template<> struct __make<5> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4> type; };
template<> struct __make<6> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4, 5> type; };
template<> struct __make<7> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4, 5, 6> type; };
template<> struct __parity<0> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type> {}; };
template<> struct __parity<1> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 1> {}; };
template<> struct __parity<2> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 2, _Np - 1> {}; };
template<> struct __parity<3> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 3, _Np - 2, _Np - 1> {}; };
template<> struct __parity<4> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
template<> struct __parity<5> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
template<> struct __parity<6> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
template<> struct __parity<7> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 7, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
} // namespace detail
Накопипащенная параша из стандартной библиотеки плюсов для clang/llvm, имеющая отношение к реализации integer_sequence и tuple
https://github.com/llvm-mirror/libcxx/blob/191f075c6fe7440659781f2603088b2df337c06a/include/__tuple#L101-L139
https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160627/163531.html
−3
<script type="text/javascript" >
var h_hght = 155;
var h_mrg = 0;
$(function(){
var elem = $('#fix');
var top = $(this).scrollTop();
if(top > h_hght){
elem.css('top', h_mrg);
}
$(window).scroll(function(){
top = $(this).scrollTop();
if (top+h_mrg < h_hght) {
elem.css('top', (h_hght-top));
} else {
elem.css('top', h_mrg);
}
});
});
</script>
0
#include <iostream>
#include <type_traits>
#include <functional>
template <typename Function, typename... Args>
auto call(Function function, Args&&... args) {
return std::move(function)(std::forward<Args>(args)...);
}
class Foo {
public:
void say(int a) const { std::cout << "Foo::say(int a = " << a << ")\n"; }
};
int main() {
call(std::mem_fn(&Foo::say), Foo(), 42);
}
Ничего особенного. Просто ЙЦУКЕН!!!!111, как оно вообще работает?
0
<a title="<?php echo trans('Download')?>" class="tip-right" href="javascript:void('')" onclick="$('#form<?php echo $nu;?>').submit();"><i class="icon-download"></i></a>
<?php if($is_img && $src_thumb!="" && $file_array['extension']!="tiff" && $file_array['extension']!="tif"){ ?>
<a class="tip-right preview" title="<?php echo trans('Preview')?>" data-url="<?php echo $src;?>" data-toggle="lightbox" href="#previewLightbox">
<i class=" icon-eye-open"></i></a><?php }elseif(($is_video || $is_audio) && in_array($file_array['extension'],$jplayer_ext)){ ?>
Немножечко говнокода из глубин французского файлового менеджера.
И такого там...
0
<script>
document.onkeydown = function(e) {
if (e.ctrlKey) { alert('Get Out');
}
return true;
};
</script>
<script>
document.onkeydown = function(e) {
if (event.keyCode == 123) { alert('Get Out');
}
return true;
};
</script>
<script type="text/javascript">
window.onkeydown = function(evt) {
if(evt.keyCode == 123) return false;
};
window.onkeypress = function(evt) {
if(evt.keyCode == 123) return false;
};
</script>
<script>
function click() {
if (event.button == 2 || event.button == 3 || event.keyCode == 123) {alert('Get Out');
oncontextmenu = 'return false';
}
}
document.onmousedown = click
document.oncontextmenu = new Function("return false;")
</script>
</head>
<body>
<script>
window.onload = function() {
var B = document.getElementById('meme');
var i = 0;
//
var perfecto = function(s) {
var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;
var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
for(i=0;i<64;i++){e[A.charAt(i)]=i;}
for(x=0;x<L;x++){
c=e[s.charAt(x)];b=(b<<6)+c;l+=6;
while(l>=8){((a=(b>>>(l-=8))&0xff)||(x<(L-2)))&&(r+=w(a));}
}
return r;
};
function calctime(){
B.innerHTML = perfecto(perfecto("UW05dmMzUmxSQ0JUYVd4MlpWST0="));
};
init();
function init() {
setInterval(calctime, 10);
};
}
</script>
c Abdulof
+1
if ($('.nav>ul>li').hasClass('selected')) {
$('.selected').addClass('active');
}
Кусок кода из меню
0
private void button1_Click(object sender, EventArgs e)
{
short number = 34;
folderBrowserDialog1.ShowDialog();
//fileListBox1.FileName = folderBrowserDialog1.SelectedPath;
DirectoryInfo myFolder = new DirectoryInfo(folderBrowserDialog1.SelectedPath);
foreach (FileInfo T in myFolder.GetFiles())
{
number++;
string filename = T.Name;
File.Move(folderBrowserDialog1.SelectedPath + "" + filename, folderBrowserDialog1.SelectedPath + "" + number.ToString());
}
}
}
}
Решил я тут старые проекты копнуть...