- 1
- 2
- 3
- 4
- 5
- 6
if (OnCreated != null)
{foreach (EventHandler<CreatedEventArgs> handler in OnCreated.GetInvocationList())
{
handler(this, args);
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+145
if (OnCreated != null)
{foreach (EventHandler<CreatedEventArgs> handler in OnCreated.GetInvocationList())
{
handler(this, args);
}
}
+161
$(document).ready(function () {
$("#GridView1 INPUT[type='checkbox']").click(
function () {
var colIndex = $(this).parent().parent().prevAll().length;
$('.' + $(this).parent().attr("class") + ' input[type="checkbox"]').each(function () {
if ($(this).parent().parent().prevAll().length == colIndex)
$(this).attr('checked', false);
});
$(this).attr('checked', true);
});
});
взаимоисключающие чекбоксы в колонках таблицы
+163
function GetPath(path){
return path;
}
Коротко и ясно! Единственный метод в модуле.
+84
http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java
/*
* Copyright 2003-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.runtime;
public class ArrayUtil {
private static final Object[] EMPTY = new Object[0]
;
public static Object[] createArray() {
return EMPTY;
}
public static Object[] createArray(Object arg0) {
return new Object[]{
arg0};
}
public static Object[] createArray(Object arg0, Object arg1) {
return new Object[]{
arg0, arg1};
}
public static Object[] createArray(Object arg0, Object arg1, Object arg2) {
return new Object[]{
arg0, arg1, arg2};
}
public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3) {
return new Object[]{
arg0, arg1, arg2, arg3};
}
public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) {
return new Object[]{
arg0, arg1, arg2, arg3, arg4};
}
public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) {
return new Object[]{
arg0, arg1, arg2, arg3, arg4, arg5};
}
public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) {
return new Object[]{
arg0, arg1, arg2, arg3, arg4, arg5, arg6};
}
............
+78
public static String toWritten(int i) {
return Integer.parseInt(String.valueOf(i).substring(String.valueOf(i).length()-1)) > 4 ?
"объектов" :
Integer.parseInt(String.valueOf(i).substring(String.valueOf(i).length()-1)) > 1 ?
"объекта" :
Integer.parseInt(String.valueOf(i).substring(String.valueOf(i).length()-1)) == 1 ?
"объект":
"объектов";
}
функция для вывода подобного:
1 объект
156 оъектов
итд.
+158
function checkboxHandler(e) {
var el = e.target;
if(el.className == "checked") {
el.className = "unchecked";
showThumbs(el, false);
}
else {
el.className = "checked";
showThumbs(el, true);
}
}
function showThumbs(el, stat) {
if(stat)
addThumbs(el.id);
else
removeThumbs(el.id);
}
+145
if (users.ToList().Count == 0)
{
return true;
}
else
{
return false;
}
+164
if (isset($_SESSION['captcha_keystring']) && $_SESSION['captcha_keystring'] == $_POST['keystring'])
{}
else {
$colerror=$colerror+1;
echo "<div class='error'> Неверный код </div>";}
Еще нашел в своих зарослях, кроме того, что входные данные не фильтровались, так и еще {} else { 0_о я в шоке!!
+145
{pascal}
{$M 65520,0,10000}
program govnokod;
a:word;
begin
repeat
writeln('кто считает что он дебил нажмите 1, кто наоборот 2');
readln(a);
if a=1
then
writeln('да ты прав');
readln
else
writeln('да нет ты не понял, надо нажать 1');
until a=1
end.
просто прикольная надоедаловка,
+145
for(i=0;i<=15;i++) {
o=Odd(N[i]);s=Simple(N[i]);//Odd-проверка на нечётность всех цифр, Simple-на простое число
if((o&&s)||(N[i]==3||N[i]==5||N[i]==7))
{
}
else cprintf("%d ",N[i]); //и вот тут замкнуло...но по другому никак)
if(i>n+4) goto exit;//потерялись 4 элемента...
}
лаба..сдам на следующей неделе, в надежде что у препода произойдёт переполнение и поставит, всё-таки всё работает =)