/** * lowercase letters */
        $this->store['upper_Spec'] = array( *cut* );
        /** * uppercase letters */
        $this->store['lower_Spec'] = array( *cut* );
      
                    } else {
                      $errmsg='An unknown error occured.';
                    }
                  } else {
                    $errmsg='The passwords you entered do not match';
                  }
                } else {
                  $errmsg='Password has to be at least 8 characters long.';
                }
              } else {
                $errmsg='The email you entered is already in our database.';
              }
            } else {
              $errmsg='Please enter your email address.';
            }
          } else {
            $errmsg='Please enter your first name and your last name.';
          }
        } else {
        (...)
      
        // Happy debugging, suckers
        # define true (rand() > 10)
      

Snippets of kazet

0

fdsfds
 

0

//console.log("route.params",req.route.params, "param 0", req.route.params[0]);
//console.log("stars", stars);
var starsPrint = "";
if (stars == 5 || stars == "5" || stars == "5\r")
    starsPrint = "Awarded stars: ★ ★ ★ ★ ★  ";
    else if (stars == 4 || stars == "4" || stars == "4\r")
    starsPrint = "Awarded stars: ★ ★ ★ ★ ☆  ";
else if (stars == 3 || stars == "3" || stars == "3\r")
    starsPrint = "Awarded stars: ★ ★ ★ ☆ ☆  ";
else if (stars == 2 || stars == "2" || stars == "2\r")
    starsPrint = "Awarded stars: ★ ★ ☆ ☆ ☆  ";
else if (stars == 1 || stars == "1" || stars == "1\r")
    starsPrint = "Awarded stars: ★ ☆ ☆ ☆ ☆  ";
else
    starsPrint = "Awarded stars: ☆ ☆ ☆ ☆ ☆  ";
 

+5

public class Bank_12
{
 
/*Blah blah... Basically, this was a pathetic attempt to curb copying in one of the "top"
engineering universities. Every student have to suffix every variable, class, method
(identifier) with the his/her registration number so that people don't "rip off code" from
other students. It obviously works because it is SOOOOO hard to do a find+replace with
your own number.
*/
 
    private int balance_12;
    private String name_12;
 
    public Bank_12(String name_12, balance_12)
    {
       this.name_12 = name_12;
       this.balance_12 = balance_12;
    }
 
    public void getBalance_12()
    {
        return balance_12;
    }
}
 

+3

svg .white {
    fill: $grey;
}
 

+5

<?

$calend = array(
"17.05.2014", 
"18.05.2014", 
"24.05.2014",
"25.05.2014",
"31.05.2014",
"01.06.2014",
"07.06.2014",
"08.06.2014",
"12.06.2014",
"13.06.2014",
"14.06.2014",
"15.06.2014",
"21.06.2014",
"22.06.2014",
"28.06.2014",
"29.06.2014",
"05.07.2014",
"06.07.2014",
"12.07.2014",
"13.07.2014",
"19.07.2014",
"20.07.2014",
"26.07.2014",
"27.07.2014",
"02.08.2014",
"03.08.2014",
"09.08.2014",
"10.08.2014",
"16.08.2014",
"17.08.2014",
"23.08.2014",
"24.08.2014",
"30.08.2014",
"31.08.2014",
"07.09.2014",
"13.09.2014",
"14.09.2014",
"20.09.2014",
"21.09.2014",
"27.09.2014",
"28.09.2014",
"04.10.2014",
"05.10.2014",
"11.10.2014",
"12.10.2014",
"18.10.2014",
"19.10.2014",
"25.10.2014",
"26.10.2014",
"01.11.2014",
"02.11.2014",
"03.11.2014",
"04.11.2014",
"08.11.2014",
"09.11.2014",
"15.11.2014",
"16.11.2014",
"22.11.2014",
"23.11.2014",
"29.11.2014",
"30.11.2014",
"07.12.2014",
"13.12.2014",
"14.12.2014",
"20.12.2014",
"21.12.2014",
"27.12.2014",
"28.12.2014"
);



if (in_array(date("d.m.Y",time()), $calend)) {
echo "(343) 266-30-54";
}

else echo '(343) 222-77-60';





?>
 

+1

{% for img in subpage.images.all %}
    <a href="
    {% thumbnail img.image '930x523' as im %}
        {{ im.url }}">
    {% empty %}
        ">
    {% endthumbnail %}
    <img src="
    {% thumbnail img.image '200x112' as im %}
        {{ im.url }}"
    {% empty %}
        "
    {% endthumbnail %}
    {% thumbnail img.image "1200" as im %}
        data-big="{{ im.url }}"
    {% empty %}
    {% endthumbnail %}
    {% if img.title or img.author %}
            data-title="{{ img.title|default:"&nbsp;" }}"
        {% if img.author %}
            data-description="{% blocktrans with img.author as author %}photo by {{ author }}{% endblocktrans %}"
        {% else %}
            data-description="&nbsp;"
        {% endif %}
    {% endif %}
    ></a>
{% endfor %}
 

+8

function not_only_letters(word) {
     
    var OK = 1
    var NO = 0
 
     
    word = word.toUpperCase();
 
    var len = wyraz.length; 
 
    for(i = 0;  i < len;  i++){        
             
            if(word.charAt(i) <"A" 
                    && word.charAt(i) != "-" 
                        && word.charAt(i)  != " " 
                            && word.charAt(i) != "." 
                                && word.charAt(i) != "&" 
                                    && word.charAt(i) != "_" 
                                        && word.charAt(i) != "\"" 
                                            && word.charAt(i) != "'" 
                             
            ) {                
                if(polish_letter(word.charAt(i) ) == 0 ) 
                            return NO; 
            }
            if(word.charAt(i) >"Z" 
                       && word.charAt(i) != "-" 
                            && word.charAt(i)  != " " 
                                && word.charAt(i) != "." 
                                    && word.charAt(i) != "&" 
                                        && word.charAt(i) != "_" 
                                            && word.charAt(i) != "\""
                                                && word.charAt(i) != "'"
            ) {  
 
                if(word.charCodeAt(i) >188) 
                    continue;
                else
                {
                 if(polish_letter(word.charAt(i) ) == 0 ) 
                        return NO;
                else
                   continue;
                }
            }
    }
    var counter = 0;
    for(i = 0;  i < len;  i++){
            if(word.charAt(i) == "-" 
                        || word.charAt(i)  == " " 
                            || word.charAt(i) == "." 
                                || word.charAt(i) == "&" 
                                    || word.charAt(i) == "_" 
                                        || word.charAt(i) == "\""
                                            || word.charAt(i) == "'"
             ) {
                counter++;
            }
    }
    if (len > 0)
    if (counter==len)
    {
        return NO;
    }
    return OK;
}
 

0

function not_only_letters(wyraz) {
    
    var OK = 1
    var NO = 0

    
    word = word.toUpperCase();

    var len = wyraz.length; 

    for(i = 0;  i < len;  i++){        
            
            if(word.charAt(i) <"A" 
                    && word.charAt(i) != "-" 
                        && word.charAt(i)  != " " 
                            && word.charAt(i) != "." 
                                && word.charAt(i) != "&" 
                                    && word.charAt(i) != "_" 
                                        && word.charAt(i) != "\"" 
                                            && word.charAt(i) != "'" 
                            
            ) {                
                if(polish_letter(word.charAt(i) ) == 0 ) 
                            return NO; 
            }
            if(word.charAt(i) >"Z" 
                       && word.charAt(i) != "-" 
                            && word.charAt(i)  != " " 
                                && word.charAt(i) != "." 
                                    && word.charAt(i) != "&" 
                                        && word.charAt(i) != "_" 
                                            && word.charAt(i) != "\""
                                                && word.charAt(i) != "'"
            ) {  

                if(word.charCodeAt(i) >188) 
                    continue;
                else
                {
                 if(polish_letter(word.charAt(i) ) == 0 ) 
                        return NO;
                else
                   continue;
                }
            }
    }
    var counter = 0;
    for(i = 0;  i < len;  i++){
            if(word.charAt(i) == "-" 
                        || word.charAt(i)  == " " 
                            || word.charAt(i) == "." 
                                || word.charAt(i) == "&" 
                                    || word.charAt(i) == "_" 
                                        || word.charAt(i) == "\""
                                            || word.charAt(i) == "'"
             ) {
                counter++;
            }
    }
    if (len > 0)
    if (counter==len)
    {
        return NO;
    }
    return OK;
}
 

+1

// how to check if a string is a valid dollar amount

        var str = $('#priceField').val();
        var res;
        res = str.substring(1, 0);
 
        if (res != "$" && res.length > 0) {
            str = "$" + str;
            var res1 = str.substring(str.length, 1);
 
            if (res1.length > 0) {
                var chk1 = res1.split('.');
                if (chk1.length > 1) {
                    if (!$.isNumeric(chk1[0])) {
                        alert('Please enter valid amount.');
                        return false;
                    }
                    if (chk1[1] != '') {
                        if (chk1[1].length > 2) {
                            alert('Please enter valid amount.');
                            return false;
                        }
                        else {
                            if (!$.isNumeric(chk1[1])) {
                                alert('Please enter valid amount.');
                                return false;
                            }
                        }
                    }
                    else {
                        alert('Please enter valid amount.');
                        return false;
                    }
                }
                else {
 
                    if (!$.isNumeric(chk1[0])) {
                        alert('Please enter valid amount.');
                        return false;
                    }
                }
            }
            else {
                if (res.length > 0) {
                    alert('Please enter valid amount.');
                    return false;
                }
            }
        }
        else {
            var res1 = str.substring(str.length, 1);
 
            if (res1.length > 0) {
                var chk1 = res1.split('.');
                if (chk1.length > 1) {
                    if (!$.isNumeric(chk1[0])) {
                        alert('Please enter valid amount.');
                        return false;
                    }
                    if (chk1[1] != '') {
                        if (chk1[1].length > 2) {
                            alert('Please enter valid amount.');
                            return false;
                        }
                        else {
                            if (!$.isNumeric(chk1[1])) {
                                alert('Please enter valid amount.');
                                return false;
                            }
                        }
                    }
                    else {
                        alert('Please enter valid amount.');
                        return false;
                    }
                }
                else {
 
                    if (!$.isNumeric(chk1[0])) {
                        alert('Please enter valid amount.');
                        return false;
                    }
                }
            }
            else {
                if (res.length > 0) {
                    alert('Please enter valid amount.');
                    return false;
                }
            }
        }
 

+2

$sqlinjection = false;

[a piece of code that modifies different variable]

if ($sqlinjection)
{
    echo 'Attack attempt detected';
}
 

+7

if (preg_match("/delete from|update|insert into|create|alter table|alter column|drop table|drop column|execute|shutdown(...)/i", $string)) {
        exit('Attack attempt detected!');
}
 

0

if (preg_match("/delete from|update|insert into|create|alter table|alter column|drop table|drop column|execute|shutdown|show databases|lock tables|replication client|replication slave|create user|substring|sysobjects|union all|xtype|select top|non_existant_table|tablenames|select count|insurance|insure|medic|viagra|tramadol|pill|overdose|phentermine|propafenone|cialis|prescription|cheapest|diazepam|valium|oxycodone|hydrocodone|xanax|lesbian|sex|amateur|position|ringtone|dating|wedding|impotenza|zyrtec|valtrex|remedio|prozac|alprazolam|cipro/i", $string)) {
        exit('Attack attempt detected!');
}
 

+6

// We need sleep to get two different random seeds and therefore signatures
// if we have two close calls of this code
sleep(1);
srand (time(NULL));
int signature = rand() % MAX_CONS;
 

0

// We need sleep to get two different random seeds and therefore signatures
// if we have two close calls of this code
sleep(1);
srand (time(NULL));
int signature = rand() % MAX_CONS;
 

+8

// No kidding, it's from FUCKING PRODUCTION CODE

// Retrieve
var MongoClient = require('mongodb').MongoClient;
var schools;
// Connect to the db
MongoClient.connect("mongodb://localhost:[CENSORED]/[CENSORED]", function(err, db) {
    if(!err) {
        console.log("We are connected");
        schools = db.collection('schools');

    }else
    {
        console.log(err)
    }
});

function Schools(){
    if(schools){

    }
    else
    {
        return 'test';
    }
}

module.exports = Schools;
 

0

            event.dateLabelSimple = (function (d) {
                return d >= 10 ? String(d) : ('0' + String(d))
            })(eDate.getDate())
            + '.' + romanDigits[(eDate.getMonth() + 1)];


            event.dateLabel = (function (d) {
                return d >= 10 ? String(d) : ('0' + String(d))
            })(eDate.getDate())
            + '.' + romanDigits[(eDate.getMonth() + 1)];

            if (
                eDate.getDate() == e2Date.getDate()
                &&
                eDate.getMonth() == e2Date.getMonth()
            ) {

            } else {
                if (
                    eDate.getMonth() == e2Date.getMonth()
                ) {
                    event.dateLabelSimple = (function (d) {
                        return d >= 10 ? String(d) : ('0' + String(d))
                    })(eDate.getDate())
                    + " - "
                    + (function (d) {
                        return d >= 10 ? String(d) : ('0' + String(d))
                    })(e2Date.getDate()) + ' '
                    + romanDigits[(e2Date.getMonth() + 1)];

                } else {
                    event.dateLabelSimple = (function (d) {
                        return d >= 10 ? String(d) : ('0' + String(d))
                    })(eDate.getDate())
                    + '.' + romanDigits[(eDate.getMonth() + 1)] + " - "
                    + (function (d) {
                        return d >= 10 ? String(d) : ('0' + String(d))
                    })(e2Date.getDate()) + '.'
                    + romanDigits[(e2Date.getMonth() + 1)];

                }

                event.dateLabel += '<br/><span>' + event.dateLabelSimple + '</span>';
            }


            event.hoursLabel = eDate.getHours()
            + ":" + (eDate.getMinutes() || '00')
            + " - " + e2Date.getHours() + ":" + (e2Date.getMinutes() || '00');


            return event

        });
    });
 

-3

var romanDigits = ['_', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII'];
 

+3

// Actual function from production code. The script breaks after removing it.

function p2u(path) {
    // returns undefined
}
 

+12

//woozy+=multiplier;
woozy+=multiplier;
 

0

// The following C code, compiled with g++ -ansi, prints -2.

// What??/
int compl = 0;

y = compl + 1;

printf("%d\n", y);
 

+7

#define THROW(x) goto CATCH##x;
 

+3

commit dd930cc57100377d02a45b9113d6a3dc93136cbc
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Wed Jan 16 14:52:48 2013 +0530

Fix the value of TWO

diff --git a/ChangeLog b/ChangeLog
index 5a74ea3..e562b5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-01-16 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+	* sysdeps/ieee754/dbl-64/mpa2.h: Fix the value of TWO.
+
2013-01-15 David S. Miller <davem@davemloft.net>

* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Add vis3
diff --git a/sysdeps/ieee754/dbl-64/mpa2.h b/sysdeps/ieee754/dbl-64/mpa2.h
index b80bf41..a4a6bdd 100644
--- a/sysdeps/ieee754/dbl-64/mpa2.h
+++ b/sysdeps/ieee754/dbl-64/mpa2.h
@@ -36,7 +36,7 @@
#define ZERO 0.0	 /* 0 */
#define ONE 1.0	 /* 1 */
#define MONE -1.0	 /* -1 */
-#define TWO -2.0	 /* -2 */
+#define TWO 2.0	 /* 2 */
#define TWO5 0x1.0p5	 /* 2^5 */
#define TWO10 0x1.0p10	 /* 2^10 */
#define TWO18 0x1.0p18	 /* 2^18 */

-----------------------------------------------------------------------

Summary of changes:
ChangeLog | 4 ++++
sysdeps/ieee754/dbl-64/mpa2.h | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
 

+5

// how to end a loop
 
try {
  int i = 0;
  for(;;) {
    if (i < n) {
      ..
    } else throw exception();
    i++;
  }
} catch (...) {
   ...
}
 

0

// how to end a loop

try {
  int i = 0;
  for(;;) {
    if (i < n) {
      ..
    } else throw exception();
  }
} catch (...) {
   ...
}
 

0

var number = (( (data.firstname != undefined && data.firstname != "") ||
                         (data.lastname != undefined && data.lastname != "") ) ?
                     '<span class="name">' + data.firstname + ' ' + data.lastname +
                     (((data.country != undefined) == (data.country != "")) ?
                     ' (' + data.country + ')' : '' ) + ' </span> <br/>' : '' ) + '(' + data.number + ')' 
                     ((data.vid != undefined && data.vid != "") ? '<br/>VID: ' + data.vid : '' );
 

+33

Exception up = new Exception();
throw up; // ha, ha...
 

+5

if (q.exec('SELECT * FROM admins WHERE username LIKE :username AND password LIKE :password', user, pass).num() > 0) {
 ... giving admin privileges ...
 

+23

            } else {
              $errmsg='An unknown error occured.';
            }
          } else {
            $errmsg='The passwords you entered do not match';
          }
        } else {
          $errmsg='Password has to be at least 8 characters long.';
        }
      } else {
        $errmsg='The email you entered is already in our database.';
      }
    } else {
      $errmsg='Please enter your email address.';
    }
  } else {
    $errmsg='Please enter your first name and your last name.';
  }
} else {
(...)
 

+67

int length = 0;
for(int idx = 0; idx < a.length; i++) {
     length++;
}
System.out.println("length is : " + length);
 

+7

switch(page) {
		case 0:
			showCurrentCar(page);
			hidePreviousCar(currentModel);
			currentModel = page;
			break;
		case 1:
			showCurrentCar(page);
			hidePreviousCar(currentModel);
			currentModel = page;
			break;
		case 2:
			showCurrentCar(page);
			hidePreviousCar(currentModel);
			currentModel = page;
			break;
		case 3:
			showCurrentCar(page);
			hidePreviousCar(currentModel);
			currentModel = page;
			break;
}
 

-2

(bug report)

( a tool ) SHOULD NOT execute arbitrary code from the Internet.

( this tool is always used with root privileges)
 

-1

/** * lowercase letters */
$this->store['upper_Spec'] = array( *cut* );
/** * uppercase letters */
$this->store['lower_Spec'] = array( *cut* );

 

+6

if [ `which which` ]; then
  ...
else
  ...
fi
 

+6

window.setTimeout(function() {
        $('#preloader_navigation_instructions_2')
        .animate({
            opacity: 1
        }, 400);
        $('#preloader_navigation_instructions_1')
        .animate({
            opacity: 0
        }, 400, function() {
            window.setTimeout(function() {
                $('#preloader_navigation_instructions_3')
                .animate({
                    opacity: 1
                }, 400);
                $('#preloader_navigation_instructions_2')
                .animate({
                    opacity: 0
                }, 400, function() {
                    window.setTimeout(function() {
                        $('#preloader_navigation_instructions_4')
                        .animate({
                            opacity: 1
                        }, 400);
                        $('#preloader_navigation_instructions_3')
                        .animate({
                            opacity: 0
                        }, 400, function() {
                            window.setTimeout(function() {
                                $('#preloader_navigation_instructions_5')
                                .animate({
                                    opacity: 1
                                }, 400);
                                $('#preloader_navigation_instructions_4')
                                .animate({
                                    opacity: 0
                                }, 400, function() {
                                    window.setTimeout(function() {
                                        $('#preloader_navigation_instructions_6')
                                        .animate({
                                            opacity: 1
                                        }, 400);
                                   (... 100 more lines ...)
 

+9

kk = pppp[pp];

(what is worse, both pppp and pp are global variables.)
 

0

          } else {
            $errmsg='An unknown error occured.';
          }
          $errmsg='The passwords you entered do not match';
        } else {
          $errmsg='Password has to be at least 8 characters long.';
        }
      } else {
        $errmsg='The email you entered is already in our database.';
      }
    } else {
      $errmsg='Please enter your email address.';
    }
  } else {
    $errmsg='Please enter your first name and your last name.';
  }
} else {
(...)
 

0

window.setTimeout(function() {
        $('#preloader_navigation_instructions_2')
        .animate({
            opacity: 1
        }, 400);
        $('#preloader_navigation_instructions_1')
        .animate({
            opacity: 0
        }, 400, function() {
            window.setTimeout(function() {
                $('#preloader_navigation_instructions_3')
                .animate({
                    opacity: 1
                }, 400);
                $('#preloader_navigation_instructions_2')
                .animate({
                    opacity: 0
                }, 400, function() {
                    window.setTimeout(function() {
                        $('#preloader_navigation_instructions_4')
                        .animate({
                            opacity: 1
                        }, 400);
                        $('#preloader_navigation_instructions_3')
                        .animate({
                            opacity: 0
                        }, 400, function() {
                            window.setTimeout(function() {
                                $('#preloader_navigation_instructions_5')
                                .animate({
                                    opacity: 1
                                }, 400);
                                $('#preloader_navigation_instructions_4')
                                .animate({
                                    opacity: 0
                                }, 400, function() {
                                    window.setTimeout(function() {
                                        $('#preloader_navigation_instructions_6')
                                        .animate({
                                            opacity: 1
                                        }, 400);
                                        $('#preloader_navigation_instructions_5')
                                        .animate({
                                            opacity: 0
                                        }, 400, function() {
                                            window.setTimeout(function() {
                                                $('#preloader_navigation_instructions_7')
                                                .animate({
                                                    opacity: 1
                                                }, 400);
                                                $('#preloader_navigation_instructions_6')
                                                .animate({
                                                    opacity: 0
                                                }, 400, function() {
                                                    window.setTimeout(function() {
                                                        $('#preloader_navigation_instructions_8')
                                                        .animate({
                                                            opacity: 1
                                                        }, 400);
                                                        $('#preloader_navigation_instructions_7')
                                                        .animate({
                                                            opacity: 0
                                                        }, 400, function() {
                                                            window.setTimeout(function() {
                                                                $('#preloader_navigation_instructions_9')
                                                                .animate({
                                                                    opacity: 1
                                                                }, 400);
                                                                $('#preloader_navigation_instructions_8')
                                                                .animate({
                                                                    opacity: 0
                                                                }, 400, function() {
                                                                    window.setTimeout(function() {
                                                                        $('#preloader_navigation_instructions_9')
                                                                        .animate({
                                                                            opacity: 1
                                                                        }, 400, function() {
                                                                            window.setTimeout(function() {
                                                                                $('#preloader_navigation_instructions_9')
                                                                                .animate({
                                                                                    opacity: 0
                                                                                }, 400);
                                                                                preloaderInstructionsEnded();
                                                                            }, 600);
                                                                        });
                                                                    }, 600);
                                                                })
                                                            }, 600);
                                                        })
                                                    }, 600);
                                                })
                                            }, 600);
                                        })
                                    }, 600);
                                })
                            }, 600);
                        })
                    }, 600);
                })
            }, 600);
        })
}, 1000);
 

+1

x = 5;
$(this).oneTime(500, function() {
       x = 5;
  });
 

-3

(from MySQL table list)

EN_MENU
FR_MENU
DE_MENU
(...)
EN_NEWS
FR_NEWS
DE_NEWS
(...)
EN_FOOTER
PL_FOOTER
DE_FOOTER
 

0

/** * lowercase letters */ $this->store['upper_Spec'] = array( *cut* );
/** * uppercase letters */ $this->store['lower_Spec'] = array( *cut* ); 
 

+8

[ ... memory limit ... ]
# Gerrit is nice because when I limited him to 100MB it
# uses only 500MB