- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
1:
Task task = Task.Factory.StartNew(delegate {
Program.CirCle(wsdlUrl, new List<int> { RayID });
});
Task.WaitAll(new Task[] { task });
2:
if (recordsForTerm.Length.Equals(0)) {
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+128
1:
Task task = Task.Factory.StartNew(delegate {
Program.CirCle(wsdlUrl, new List<int> { RayID });
});
Task.WaitAll(new Task[] { task });
2:
if (recordsForTerm.Length.Equals(0)) {
}
Консольная приблуда.
1. Создаем поток и лочим основной - зачем?
2. == для слабых?
+119
Почитываю иногда комменты на govnokod.ru
Сложилось впечатление, что Stertor, bormand, kegdan, inkanus-gray, 1024--, и многие другие - один и тот же человек
так ли это?
−119
def Hash(InputNumber,Salt,Pass)
return (58 - (529 + (-1975048375 + (InputNumber | -2092637991 | ((-713925853 & Pass & (Salt + (-401 ^ Pass) ^ (Pass + (-462 | ((-946 | (InputNumber - Salt & -1686942264) ^ 1238358322) - 1665246394))))) + Salt | Pass) + Salt)))) | InputNumber
Хэширование числа
+141
void perestanovka(int a[13][13], int n, int m){
int maxim, minim, temp,i;
for (i=0; i<n; i++){
minim=0;
for (int j=1; j<m; j++){
if(a[i][j]<a[i][minim]) minim=j;
}
temp=a[i][0];
a[i][0]=a[i][minim];
a[i][minim]=temp;}
for (int j=0; i<n; i++){
maxim=0;
for (int j=1; j<m; j++){
if(a[i][j]>a[i][maxim]) maxim=j;
}
temp=a[i][m-1];
a[i][m-1]=a[i][maxim];
a[i][maxim]=temp; }
}
−123
URL = '/some/url/here'
...
...
url = '{0}'.format(URL)
нашел в дебрях проекта...
+144
bool X = Glob.UserIsAdmin ? true : false;
+142
function array_to_file($array_name, $array, $filename = 0, $file = 0)
{
$level = 1;
if($file == 0) {
$level = 0;
$file = fopen($filename, "w");
if(!$file) {
return false;
}
fwrite($file, "<" . "?\n\$".$array_name." = ");
}
$cnt = count($array);
$i = 0;
fwrite($file, "\narray(\n");
foreach($array as $key => $value)
{
if($i++ != 0) {
fwrite($file, ",\n");
}
if(is_array($array[$key])) {
fwrite($file, "\"".$key."\" => ");
array_to_file($array_name, $array[$key], 0, $file);
} else {
$value = addcslashes($value, "\""."\\\\");
fwrite($file, str_repeat(" ", ($level + 1) * 2) . "\"".$key."\" => \"".$value."\"");
}
}
fwrite($file, ")");
if($level == 0) {
fwrite($file, ";\n?".">");
fclose($file);
return true;
}
}
−105
Функция КонтрИскл8(код)
КонтрИскл8=Справочники.Контрагенты.НайтиПоКоду(Код).Ссылка.ДополнительныеРеквизиты.Найти(ПланыВидовХарактеристик.ДополнительныеРеквизитыИСведения.НайтиПоНаименованию("Код_").Ссылка).Значение;
Искл8=КонтрИскл8;
Возврат Искл8;
КонецФункции
Укоадено с mista.ru. Не мог не поделиться. Когда впервые увидел, мой взгляд был примерно таким - 0_0
−160
n IN (6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)
условие n >= 6 выполнено
+142
/* Background gallery by http://manos.malihu.gr */
//config
//set default images view mode
//$defaultViewMode="full"; //full, normal, original
$defaultViewMode="original"; //full, normal, original
$tsMargin=0; //first and last thumbnail margin (for better cursor interaction)
$scrollEasing=999888; //scroll easing amount (0 for no easing)
$scrollEasingType="easeOutCirc"; //scroll easing type
$thumbnailsContainerOpacity=0.9; //thumbnails area default opacity
$thumbnailsContainerMouseOutOpacity=0; //thumbnails area opacity on mouse out
$thumbnailsOpacity=1; //thumbnails default opacity
$nextPrevBtnsInitState="show"; //next/previous image buttons initial state ("hide" or "show")
$keyboardNavigation="on"; //enable/disable keyboard navigation ("on" or "off")
//cache vars
$thumbnails_wrapper=$("#thumbnails_wrapper");
$outer_container=$("#outer_container");
$thumbScroller=$(".thumbScroller");
$thumbScroller_container=$(".thumbScroller .container");
$thumbScroller_content=$(".thumbScroller .content");
$thumbScroller_thumb=$(".thumbScroller .thumb");
$preloader=$("#preloader");
$toolbar=$("#toolbar");
$toolbar_a=$("#toolbar a");
$bgimg=$("#bgimg");
$img_title=$("#img_title");
$nextImageBtn=$(".nextImageBtn");
$prevImageBtn=$(".prevImageBtn");
$bg=$("#bg");
$(window).load(function() {
$toolbar.data("imageViewMode",$defaultViewMode); //default view mode
if($defaultViewMode=="full"){
$toolbar_a.html("<img src='images/toolbar_n_icon.png' width='50' height='50' />").attr("onClick", "ImageViewMode('normal');return false").attr("title", "Restore");
} else {
$toolbar_a.html("<img src='images/toolbar_fs_icon.png' width='50' height='50' />").attr("onClick", "ImageViewMode('full');return false").attr("title", "Maximize");
}
/* var winWidth=$(window).width();
var winHeight=$(window).height();
$("#bg").attr("min-height",winHeight+"px"); */
ShowHideNextPrev($nextPrevBtnsInitState);
//thumbnail scroller
$thumbScroller_container.css("marginLeft",$tsMargin+"px"); //add margin
sliderLeft=$thumbScroller_container.position().left;
sliderLeft=0;
sliderWidth=$outer_container.width();
$thumbScroller.css("width",sliderWidth);
var totalContent=0;
fadeSpeed=200;
var $the_outer_container=document.getElementById("outer_container");
var $placement=findPos($the_outer_container);
$thumbScroller_content.each(function () {
var $this=$(this);
totalContent+=$this.innerWidth();
$thumbScroller_container.css("width",totalContent);
$this.children().children().children(".thumb").fadeTo(fadeSpeed, $thumbnailsOpacity);
});
$thumbScroller.mousemove(function(e){
if($thumbScroller_container.width()>sliderWidth){
var mouseCoords=(e.pageX - $placement[1]);
var mousePercentX=mouseCoords/sliderWidth;
var destX=-((((totalContent+($tsMargin*2))-(sliderWidth))-sliderWidth)*(mousePercentX));
var thePosA=mouseCoords-destX;
var thePosB=destX-mouseCoords;
if(mouseCoords>destX){
$thumbScroller_container.stop().animate({left: -thePosA}, $scrollEasing,$scrollEasingType); //with easing
} else if(mouseCoords<destX){
$thumbScroller_container.stop().animate({left: thePosB}, $scrollEasing,$scrollEasingType); //with easing
} else {
$thumbScroller_container.stop();
}
}
});
$thumbnails_wrapper.fadeTo(fadeSpeed, $thumbnailsContainerOpacity);
/* $thumbnails_wrapper.hover(
function(){ //mouse over
var $this=$(this);
$this.stop().fadeTo("slow", 1);
},
function(){ //mouse out
var $this=$(this);
$this.stop().fadeTo("slow", $thumbnailsContainerMouseOutOpacity);
}
); */
$thumbScroller_thumb.hover(
function(){ //mouse over
var $this=$(this);
$this.stop().fadeTo(fadeSpeed, 1);
},
function(){ //mouse out
var $this=$(this);
$this.stop().fadeTo(fadeSpeed, $thumbnailsOpacity);
}
);
carousel