1. Pascal / Говнокод #13649

    +110

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    // Двухклеточная прямая.
           ({D2A2}(Pixels[X+h,Y-1]=clWhite) and(Pixels[x+h,y-2]=clBlack) and(Pixels[x+h,y-3]=clBlack)     and{D2A2} (Pixels[x+h+1,y-1]=clWhite) and(Pixels[x+h+1,y-2]=clBlack) and(Pixels[x+h+1,y-3]=clWhite)  and{D2A2}(Pixels[x+h+2,y-2]=clWhite) and(Pixels[x+h+2,y-3]=clBlack) and(Pixels[x+h+2,y-4]=clWhite) and{D2A2}(Pixels[x+h+3,y-2]=clWhite) and(Pixels[x+h+3,y-3]=clBlack) and(Pixels[x+h+3,y-4]=clWhite)) or {D2A2}
        ({D2A2A-1}(Pixels[X+h,Y-1]=clWhite) and(Pixels[x+h,y-2]=clBlack) and(Pixels[x+h,y-3]=clWhite)     and{D2A2A-1}(Pixels[x+h+1,y-1]=clWhite) and(Pixels[x+h+1,y-2]=clBlack) and(Pixels[x+h+1,y-3]=clWhite)  and{D2A2A-1}(Pixels[x+h+2,y-2]=clWhite) and(Pixels[x+h+2,y-3]=clBlack) and(Pixels[x+h+2,y-4]=clBlack) and{D2A2A-1}(Pixels[x+h+3,y-2]=clWhite) and(Pixels[x+h+3,y-3]=clBlack) and(Pixels[x+h+3,y-4]=clWhite)) or {D2A2A-1}
           ({D2A3}(Pixels[X+h,Y-1]=clWhite) and(Pixels[x+h,y-2]=clBlack) and(Pixels[x+h,y-3]=clWhite)     and{D2A3}(Pixels[x+h+1,y-1]=clWhite) and(Pixels[x+h+1,y-2]=clBlack) and(Pixels[x+h+1,y-3]=clBlack)  and{D2A3}(Pixels[x+h+2,y-2]=clWhite) and(Pixels[x+h+2,y-3]=clBlack) and(Pixels[x+h+2,y-4]=clWhite) and{D2A3}(Pixels[x+h+3,y-2]=clWhite) and(Pixels[x+h+3,y-3]=clBlack) and(Pixels[x+h+3,y-4]=clWhite) and{D2A3}(Pixels[x+h+4,y-3]=clWhite) and(Pixels[x+h+4,y-4]=clBlack) and(Pixels[x+h+4,y-5]=clWhite)) or {D2A3}
           ({D2A4}(Pixels[X+h,Y-1]=clBlack) and(Pixels[x+h,y-2]=clBlack) and(Pixels[x+h,y-3]=clWhite)     and{D2A4}(Pixels[x+h+1,y-1]=clWhite) and(Pixels[x+h+1,y-2]=clBlack) and(Pixels[x+h+1,y-3]=clWhite)  and{D2A4}(Pixels[x+h+2,y-2]=clWhite) and(Pixels[x+h+2,y-3]=clBlack) and(Pixels[x+h+2,y-4]=clWhite) and{D2A4}(Pixels[x+h+3,y-2]=clWhite) and(Pixels[x+h+3,y-3]=clBlack) and(Pixels[x+h+3,y-4]=clWhite)) or {D2A4}
       ... Ещё 20 строк в таком стиле
           ({D2B2}(Pixels[X+h,Y-1]=clWhite) and(Pixels[x+h,y-2]=clWhite) and(Pixels[x+h,y-3]=clBlack)     and{D2B2}(Pixels[x+h+1,y-1]=clWhite) and(Pixels[x+h+1,y-2]=clBlack) and(Pixels[x+h+1,y-3]=clWhite)      and{D2B2}(Pixels[x+h+2,y-2]=clWhite) and(Pixels[x+h+2,y-3]=clBlack) and(Pixels[x+h+2,y-4]=clWhite)    and{D2B2}(Pixels[x+h+3,y-2]=clWhite) and(Pixels[x+h+3,y-3]=clBlack) and(Pixels[x+h+3,y-4]=clWhite)     and{D2B2}(Pixels[x+h+4,y-3]=clWhite) and(Pixels[x+h+4,y-4]=clBlack) and(Pixels[x+h+4,y-5]=clWhite)) or {D2B2}
           ({D2B3}(Pixels[X+h,Y-1]=clWhite) and(Pixels[x+h,y-2]=clWhite) and(Pixels[x+h,y-3]=clWhite)     and{D2B3}(Pixels[x+h+1,y-1]=clWhite) and(Pixels[x+h+1,y-2]=clBlack) and(Pixels[x+h+1,y-3]=clBlack)      and{D2B3}(Pixels[x+h+2,y-2]=clWhite) and(Pixels[x+h+2,y-3]=clBlack) and(Pixels[x+h+2,y-4]=clWhite)    and{D2B3}(Pixels[x+h+3,y-2]=clWhite) and(Pixels[x+h+3,y-3]=clBlack) and(Pixels[x+h+3,y-4]=clWhite)     and{D2B3}(Pixels[x+h+4,y-3]=clWhite) and(Pixels[x+h+4,y-4]=clBlack) and(Pixels[x+h+4,y-5]=clWhite)) or {D2B3}
           ({D2B4}(Pixels[X+h,Y-1]=clBlack) and(Pixels[x+h,y-2]=clWhite) and(Pixels[x+h,y-3]=clWhite)     and{D2B4}(Pixels[x+h+1,y-1]=clWhite) and(Pixels[x+h+1,y-2]=clBlack) and(Pixels[x+h+1,y-3]=clBlack)      and{D2B4}(Pixels[x+h+2,y-2]=clWhite) and(Pixels[x+h+2,y-3]=clBlack) and(Pixels[x+h+2,y-4]=clWhite)    and{D2B4}(Pixels[x+h+3,y-2]=clWhite) and(Pixels[x+h+3,y-3]=clBlack) and(Pixels[x+h+3,y-4]=clWhite)     and{D2B4}(Pixels[x+h+4,y-3]=clWhite) and(Pixels[x+h+4,y-4]=clBlack) and(Pixels[x+h+4,y-5]=clWhite)) {or} {D2B4}
             {(J1(Pixels[X+h,Y-1]=clWhite) and (Pixels[x+h,y]=clWhite) and (Pixels[x+h,y-2]=clBlack))} then // Проверка, если обрыв по x, начало следующей ступенрки.
             begin
              goto k8;
               end ;
                goto k3;//Если убрать эту строчку,то может фиксироваться вся линия исключая точку с дифектоми, т.к.
                 end;   // если не отрабатывает сравнение пикселей по длине ступеньки и не отрабатывает по переходу на новую ступеньку, прог. прибавляет h и перемещает пиксель опроса в право.
     
        k8: if (CPlx-CPLxI=0) or (CPlx-CPlxI=1) or (CPlxI-CPlx=1)or(CPlxI-CPlx=CPlxI/2) or (CPlx-CPlxI=CPlx/2) or (CPlxI-CPlx=(CPlxI/2)-1) or (CPlx-CPlxI=(CPlx/2)-1) or ((CPlxI-CPlx>(CPlxI/2)-1) and (CPlxI-CPlx<(CPlxI/2)+1)) then
     
        begin
         a:=x+h;
         b:=y-1;
         count:=count+1; // Счет ступеник.
         goto k5;
          end;
     
          k3: OperEnd:=DateTimeToTimeStamp(Now);
     Total:=OperEnd.Time-OperBegin.Time;
     
     
       ListBox1.Items.Add(IntToStr(CPlx0)+' CPlx0');
       ListBox1.Items.Add(IntToStr(CPlxI)+' CPlxI');
       ListBox1.Items.Add(IntToStr(count)+' Ступеньки.');
       ListBox1.Items.Add(IntToStr(Total)+' MSec');
         end; // Конец прог.
           end;
             end.

    Адовый пиздец с киберфорума.

    http://www.cyberforum.ru/delphi-beginners/thread941698.html

    murder, 23 Августа 2013

    Комментарии (24)
  2. C# / Говнокод #13646

    +141

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    /// <summary>
    		/// Стартовый метод потока, который отображает процесс вычисления.
    		/// </summary>
    		public static void LoadingThread()
    		{
    			int curLoadingStep = 0;
    
    			while(!bStop)
    			{
    				Console.Clear();
    
    				switch(curLoadingStep)
    				{
    					case 0:
    						Console.WriteLine("Производится вычисление");
    						curLoadingStep = 1;
    					break;
    
    					case 1:
    						Console.WriteLine("Производится вычисление.");
    						curLoadingStep = 2;
    					break;
    
    					case 2:
    						Console.WriteLine("Производится вычисление..");
    						curLoadingStep = 3;
    					break;
    
    					case 3:
    						Console.WriteLine("Производится вычисление...");
    						curLoadingStep = 0;
    					break;
    				}
    
    				Thread.Sleep(800);
    			}
    		}

    Наткнулся на форуме.
    Чего то в этой жизни я явно не понимаю

    kegdan, 22 Августа 2013

    Комментарии (17)
  3. JavaScript / Говнокод #13645

    +144

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    clientsize:function () {
    			if (window.innerWidth || window.innerHeight) {
    				return {"w":window.innerWidth,"h":window.innerHeight};
    			}
    			else if (_$$.$().documentElement && (_$$.$().documentElement.clientWidth || _$$.$().documentElement.clientHeight)) {
    				return {"w":_$$.$().documentElement.clientWidth,"h":_$$.$().documentElement.clientHeight};
    			}
    			else if (_$$.$().body.clientWidth || _$$.$().body.clientHeight) {
    				return {"w":_$$.$().body.clientWidth,"h":_$$.$().body.clientHeight};
    			}
    			else {
    				return {"w":0,"h":0};
    			}
    		},
    		scrollpos:function () {
    			if (window.innerWidth || window.innerHeight) {
    				return {"l":window.pageXOffset,"t":window.pageYOffset};
    			}
    			else if (_$$.$().documentElement && (_$$.$().documentElement.clientWidth || _$$.$().documentElement.clientHeight)) {
    				return {"l":_$$.$().documentElement.scrollLeft,"t":_$$.$().documentElement.scrollTop};
    			}
    			else if (_$$.$().body.clientWidth || _$$.$().body.clientHeight) {
    				return {"l":_$$.$().body.scrollLeft,"t":_$$.$().body.scrollTop};
    			}
    			else {
    				return {"l":0,"t":0};
    			}
    		},
    		scrollsize:function () {
    			if (_$$.$().documentElement && (_$$.$().documentElement.scrollWidth || _$$.$().documentElement.scrollHeight)) {
    				return {"w":_$$.$().documentElement.scrollWidth,"h":_$$.$().documentElement.scrollHeight};
    			}
    			else if (_$$.$().body.scrollWidth || _$$.$().body.scrollHeight) {
    				return {"w":_$$.$().body.scrollWidth,"h":_$$.$().body.scrollHeight};
    			}
    			else {
    				return {"w":0,"h":0};
    			}
    		},

    Йебанайтунг координатунг ...

    Stealth, 22 Августа 2013

    Комментарии (0)
  4. JavaScript / Говнокод #13644

    +144

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    movement_8: function() {
    			var d_param=effect.noeffect.winparam();
    			var main_left=Math.round(d_param[4]+(d_param[0]-this.width)/2);
    			var main_top=Math.round(d_param[5]+(d_param[1]-this.height)/2);
    			
    			document.getElementById('panel_p_el_1').style.left=parseInt(document.getElementById('panel_p_el_1').style.left)-this.step+'px';
    			document.getElementById('panel_p_el_1').style.top=main_top+'px';
    			
    			if(parseInt(document.getElementById('panel_p_el_1').style.left)>main_left+Math.round(this.width/2)) {
    				setTimeout('effect.panel.movement_8();',this.speed);
    			}
    			else {
    				document.getElementById('panel_p_el_1').style.left=main_left+Math.round(this.width/2)+'px';
    				document.getElementById('panel_p_el_1').style.top=main_top+'px';
    				this.key[1]=1;
    				
    				if(this.key[0]+this.key[1]+this.key[2]+this.key[3]==4) {
    					document.getElementById('panel_p_el_0').style.visibility='hidden';
    					document.getElementById('panel_p_el_1').style.visibility='hidden';
    					document.getElementById('panel_p_el_2').style.visibility='hidden';
    					document.getElementById('panel_p_el_3').style.visibility='hidden';
    					
    					document.getElementById('panel_p_el_m').style.visibility='visible';
    					document.getElementById('panel_p_el_m').style.left=main_left+'px';
    					document.getElementById('panel_p_el_m').style.top=main_top+'px';
    				}
    			}
    		},

    Зачем канвас и иксэмэл, давай нажарим цыэсэсом ... Вообще так оно и делается быстрее всего, геймдевы еще не расчухали толком :D Однако, HTML для этого избыточен ...

    Stealth, 22 Августа 2013

    Комментарии (0)
  5. JavaScript / Говнокод #13643

    +144

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    var cooker = {
    	set: function(cookie_name, cookie_value, cookie_expires, cookie_path, cookie_domain, cookie_secure) {
    		if(cookie_name!==undefined) {
    			cookie_expires=cookie_expires || 0;
    			var expire_date = new Date;
    			expire_date.setTime(expire_date.getTime() + (cookie_expires*1000));
    			document.cookie = cookie_name + "=" + escape(cookie_value)+'; ' + 
    			((cookie_expires === undefined) ? '' : 'expires=' + expire_date.toGMTString()+'; ') +
    			((cookie_path === undefined) ? 'path=/;' : 'path='+cookie_path+'; ') +
    			((cookie_domain === undefined) ? '' : 'domain='+cookie_domain+'; ') +
    			((cookie_secure === true) ? 'secure; ' : '');
    		}
    	},
    	get: function(cookie_name) {
    		var cookie = document.cookie, length = cookie.length;
    		if(length) {
    			var cookie_start = cookie.indexOf(cookie_name + '=');
    			if(cookie_start != -1) {
    				var cookie_end = cookie.indexOf(';', cookie_start);
    				if(cookie_end == -1) {
    					cookie_end = length;
    				}
    				cookie_start += cookie_name.length + 1;
    				return unescape(cookie.substring(cookie_start, cookie_end));
    			}
    		}
    	},
    	erase: function(cookie_name) {
    		cooker.set(cookie_name, '', -1);
    	},
    	test: function() {
    		cooker.set('test_cookie', 'test', 10);
    		var work = (cooker.get('test_cookie') === 'test') ? true : false;
    		cooker.erase('test_cookie');
    		return work;
    	}
    };

    Stealth, 22 Августа 2013

    Комментарии (2)
  6. Pascal / Говнокод #13642

    +130

    1. 1
    Народ, вы где? Я реально соскучился.

    Stertor, 22 Августа 2013

    Комментарии (0)
  7. JavaScript / Говнокод #13641

    +144

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    show: function () {
    		this.number_x++;
    		if(this.number_x-1>=this.frames_x) {
    			this.number_x=1;
    			this.number_y++;
    			if(this.number_y-1>=this.frames_y) {
    				this.number_y=1;
    				if(this.playandstop) {
    					this.stop();
    				}
    			}
    		}
    		if(this.key) {
    			var left;
    			var top;
    			(this.reverse)?left=(this.frames_x-this.number_x)*this.frame_x:left=(this.number_x-1)*this.frame_x;
    			(this.reverse)?top=(this.frames_y-this.number_y)*this.frame_y:top=(this.number_y-1)*this.frame_y;
    			$$(this.id).$$('marginLeft',''+-left+'px').$$('marginTop',''+-top+'px');
    			var th = this;
    			this.timer=setTimeout(function () { th.show(); },this.speed);
    		}
    		else {
    			this.next();
    		}
    	},

    фреймы: такие фреймы

    Stealth, 22 Августа 2013

    Комментарии (0)
  8. C++ / Говнокод #13640

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    parallel_for(1, 6, [](int value) {
          wstringstream ss;
          ss << value << L' ';
          wcout << ss.str();
       });

    Вместо того чтобы заняться допиливанием С++11 для студии, макрософт решила написать своё параллельное апи и глупые примерчики к нему на тему вывести случайную перестановку элементов.

    LispGovno, 22 Августа 2013

    Комментарии (244)
  9. Куча / Говнокод #13639

    +139

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    Всего обработано 12582 постов (не считая 1055 исключённых из-за 404 ошибки), 186254 комментариев, которые создали 4163 пользователей.
    
    3390+	юзеров имеют 1+	постов
    181+	юзеров имеют 10+	постов
    6+	юзеров имеют 100+	постов
    1+	юзеров имеют 1000+	постов
    
    3159+	юзеров имеют 1+	комментариев
    875+	юзеров имеют 10+	комментариев
    178+	юзеров имеют 100+	комментариев
    24+	юзеров имеют 1000+	комментариев
    2+	юзеров имеют 10000+	комментариев
    
    711+	юзеров создали 1+	комм./постов за последние 360	дней
    299+	юзеров создали 5+	комм./постов за последние 360	дней
    197+	юзеров создали 10+	комм./постов за последние 360	дней
    77+	юзеров создали 50+	комм./постов за последние 360	дней
    49+	юзеров создали 100+	комм./постов за последние 360	дней
    17+	юзеров создали 500+	комм./постов за последние 360	дней
    
    290+	юзеров создали 1+	комм./постов за последние 90	дней
    118+	юзеров создали 5+	комм./постов за последние 90	дней
    86+	юзеров создали 10+	комм./постов за последние 90	дней
    37+	юзеров создали 50+	комм./постов за последние 90	дней
    25+	юзеров создали 100+	комм./постов за последние 90	дней
    
    144+	юзеров создали 1+	комм./постов за последние 30	дней
    59+	юзеров создали 5+	комм./постов за последние 30	дней
    40+	юзеров создали 10+	комм./постов за последние 30	дней
    23+	юзеров создали 20+	комм./постов за последние 30	дней
    14+	юзеров создали 50+	комм./постов за последние 30	дней
    9+	юзеров создали 100+	комм./постов за последние 30	дней
    
    Топ 20 пользователей, которые вызывают эмоции
    (по количеству кликов по +/-):
    1: guest (#1) - 224256 (1418 постов, 32235 комментариев)
    2: Lure Of Chaos (#1538) - 28637 (133 постов, 14460 комментариев)
    3: bormand (#5528) - 17334 (62 постов, 8303 комментариев)
    4: TarasB (#721) - 15999 (60 постов, 5978 комментариев)
    5: roman-kashitsyn (#3818) - 12252 (71 постов, 5767 комментариев)
    6: 3.14159265 (#1438) - 11991 (85 постов, 4851 комментариев)
    7: bugmenot (#1632) - 11748 (51 постов, 6120 комментариев)
    8: anonimb84a2f6fd141 (#5798) - 10073 (52 постов, 1806 комментариев)
    9: absolut (#1528) - 7881 (21 постов, 4142 комментариев)
    10: defecate-plusplus (#4442) - 6788 (13 постов, 2748 комментариев)
    11: LispGovno (#6011) - 5951 (88 постов, 2733 комментариев)
    12: Анонимус (#1679) - 5783 (8 постов, 3021 комментариев)
    13: eth0 (#2108) - 5401 (0 постов, 2608 комментариев)
    14: inkanus-gray (#1659) - 5307 (16 постов, 2538 комментариев)
    15: Stertor (#5934) - 4395 (98 постов, 864 комментариев)
    16: Говногость (#320) - 3893 (184 постов, 937 комментариев)
    17: istem (#1997) - 3851 (31 постов, 2130 комментариев)
    18: wvxvw (#988) - 3446 (115 постов, 2446 комментариев)
    19: xXx_totalwar (#963) - 3427 (24 постов, 1099 комментариев)
    20: Vasiliy (#1478) - 3404 (56 постов, 1573 комментариев)

    Статистика ГК. Данные были собраны за последние 3-4 дня.
    Постараюсь добавить в комментарии несколько Топ50.

    1024--, 21 Августа 2013

    Комментарии (95)
  10. C++ / Говнокод #13638

    +6

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    #include <iostream>
    
    using std::cout;
    using std::endl;
    
    auto power(double x, int n)-> double*;
    
    int main()
    {
    	void * c = power(5,2);
    
    	std::cout << *(double*)c << std::endl;
    
    	return 0;
    }
    
    auto power(double x, int n)-> double* 
    { 
    	double* result(new double(1.0));
    	for(int i = 1; i <= n; i++)
    	*result *= x;
    	return result;
    }

    taburetka, 21 Августа 2013

    Комментарии (14)