/** * 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)
      

anonymous

0

<?php 

function to_epoch_time($date_str){
	$hours = date('H', strtotime($date_str));
	$minutes = date('i', strtotime($date_str));
	$seconds = date('s', strtotime($date_str));
	$month = date('n', strtotime($date_str));
	$day = date('j', strtotime($date_str));
	$year = date('Y', strtotime($date_str));
	$is_dst = 0;
        return mktime($hours, $minutes, $seconds, $month, $day, $year, $is_dst);
}
 

0

//This keeps going for 50k lines, not my source code.

if (ItemName == "Silver Hammer")
{
	this.SetDefaults(7, false);
	this.color = new Color(180, 180, 180, 100);
	this.useAnimation = 29;
	this.useTime = 19;
	this.scale = 1.25f;
	this.damage = 9;
	this.hammer = 45;
	this.value = 4000;
	this.netID = -11;
}
else
{
	if (ItemName == "Silver Bow")
	{
		this.SetDefaults(99, false);
		this.useAnimation = 27;
		this.useTime = 27;
		this.color = new Color(180, 180, 180, 100);
		this.damage = 9;
		this.value = 3500;
		this.netID = -12;
	}
	else
	{
		if (ItemName == "Copper Pickaxe")
		{
			this.SetDefaults(1, false);
			this.color = new Color(180, 100, 45, 80);
			this.useTime = 15;
			this.pick = 35;
			this.useAnimation = 23;
			this.damage = 4;
			this.scale = 0.9f;
			this.tileBoost = -1;
			this.value = 500;
			this.netID = -13;
		}
		else
		{
			if (ItemName == "Copper Broadsword")
			{
				this.SetDefaults(4, false);
				this.color = new Color(180, 100, 45, 80);
				this.useAnimation = 23;
				this.damage = 8;
				this.value = 450;
				this.netID = -14;
			}
        }
 

anonymous

0

private void SetLabelText()
{
    Label1.Text = dateFirst.ToShortDateString();
            Label2.Text = dateFirst.AddDays(1).ToShortDateString();
            Label3.Text = dateFirst.AddDays(2).ToShortDateString();
            Label4.Text = dateFirst.AddDays(3).ToShortDateString();
            Label5.Text = dateFirst.AddDays(4).ToShortDateString(); 
            Label6.Text = dateFirst.AddDays(5).ToShortDateString();
            Label7.Text = dateFirst.AddDays(6).ToShortDateString();
            Label8.Text = dateFirst.AddDays(7).ToShortDateString();
            Label9.Text = dateFirst.AddDays(8).ToShortDateString();
            Label10.Text = dateFirst.AddDays(9).ToShortDateString();
            Label11.Text = dateFirst.AddDays(10).ToShortDateString();
            Label12.Text = dateFirst.AddDays(11).ToShortDateString();
            Label13.Text = dateFirst.AddDays(12).ToShortDateString();
            Label14.Text = dateFirst.AddDays(13).ToShortDateString();
            Label15.Text = dateFirst.AddDays(14).ToShortDateString();
            Label16.Text = dateFirst.AddDays(15).ToShortDateString();
            Label17.Text = dateFirst.AddDays(16).ToShortDateString();
            Label18.Text = dateFirst.AddDays(17).ToShortDateString();
            Label19.Text = dateFirst.AddDays(18).ToShortDateString();
            Label20.Text = dateFirst.AddDays(19).ToShortDateString();
            Label21.Text = dateFirst.AddDays(20).ToShortDateString();
            Label22.Text = dateFirst.AddDays(21).ToShortDateString();
            Label23.Text = dateFirst.AddDays(22).ToShortDateString();
            Label24.Text = dateFirst.AddDays(23).ToShortDateString();
            Label25.Text = dateFirst.AddDays(24).ToShortDateString();
            Label26.Text = dateFirst.AddDays(25).ToShortDateString();
            Label27.Text = dateFirst.AddDays(26).ToShortDateString();
            Label28.Text = dateFirst.AddDays(27).ToShortDateString();
            Label29.Text = dateFirst.AddDays(28).ToShortDateString();
            Label30.Text = dateFirst.AddDays(29).ToShortDateString();
            Label31.Text = dateFirst.AddDays(30).ToShortDateString()

}

private void setLabelVisibility()
{

             xrLabel1.Visible = Label1.Visible = (iCounter >= 1);
            xrLabel2.Visible = Label2.Visible = (iCounter >= 2);
            xrLabel3.Visible = Label3.Visible = (iCounter >= 3);
            xrLabel4.Visible = Label4.Visible = (iCounter >= 4);
            xrLabel5.Visible = Label5.Visible = (iCounter >= 5);
            xrLabel6.Visible = Label6.Visible = (iCounter >= 6);
            xrLabel7.Visible = Label7.Visible = (iCounter >= 7);
            xrLabel8.Visible = Label8.Visible = (iCounter >= 8);
            xrLabel9.Visible = Label9.Visible = (iCounter >= 9);
            xrLabel10.Visible = Label10.Visible = (iCounter >= 10);
            xrLabel11.Visible = Label11.Visible = (iCounter >= 11);
            xrLabel12.Visible = Label12.Visible = (iCounter >= 12);
            xrLabel13.Visible = Label13.Visible = (iCounter >= 13);
            xrLabel14.Visible = Label14.Visible = (iCounter >= 14);
            xrLabel15.Visible = Label15.Visible = (iCounter >= 15);
            xrLabel16.Visible = Label16.Visible = (iCounter >= 16);
            xrLabel17.Visible = Label17.Visible = (iCounter >= 17);
            xrLabel18.Visible = Label18.Visible = (iCounter >= 18);
            xrLabel19.Visible = Label19.Visible = (iCounter >= 19);
            xrLabel20.Visible = Label20.Visible = (iCounter >= 20);
            xrLabel21.Visible = Label21.Visible = (iCounter >= 21);
            xrLabel22.Visible = Label22.Visible = (iCounter >= 22);
            xrLabel23.Visible = Label23.Visible = (iCounter >= 23);
            xrLabel24.Visible = Label24.Visible = (iCounter >= 24);
            xrLabel25.Visible = Label25.Visible = (iCounter >= 25);
            xrLabel26.Visible = Label26.Visible = (iCounter >= 26);
            xrLabel27.Visible = Label27.Visible = (iCounter >= 27);
            xrLabel28.Visible = Label28.Visible = (iCounter >= 28);
            xrLabel29.Visible = Label29.Visible = (iCounter >= 29);
            xrLabel30.Visible = Label30.Visible = (iCounter >= 30);
            xrLabel31.Visible = Label31.Visible = (iCounter >= 31);
}
 

anonymous

0

<a href="#" onclick="location.href='Account/ForgotPassword.aspx'"></a>
 

anonymous

-2

/* This is how somebody chose to centre the content of a page. */

@media (min-width: 800px) {
    html { padding-left: 0px; }
}

@media (min-width: 1024px) {
    html { padding-left: 5%; }
}

@media (min-width: 1200px) {
    html { padding-left: 10%; }
}

@media (min-width: 1400px) {
    html { padding-left: 20%; }
}
 

anonymous

0

$weight = ((float)('0.'.( $weight < 10 ? '0' : '').$weight));
 

anonymous

0

try 
{
    /* lines of code */
}
catch (Exception ex) 
{
    throw ex;
}
 

anonymous

0

- readable inline sql in java annotation:
SELECT TRIM(CONCAT(TRIM(CONCAT(TRIM(CONCAT(TRIM(CONCAT(TRIM(CONCAT(TRIM(CONCAT(COALESCE(...
 

anonymous

0

// This might not work... Wait... no, it should be fine.
 

anonymous

0

7 years and a half later :

// XYZ: April 16, 2008: Remove in a few weeks.
 

anonymous

0

// This is why we don't accept pull requests
 

anonymous

0

    # Found this on a relatively old site.
  <IfModule mod_setenvif.c>
        # Netscape 4.x has some problems...
        BrowserMatch ^Mozilla/4 gzip-only-text/html
       
        # Netscape 4.06-4.08 have some more problems
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
       
        # MSIE masquerades as Netscape, but it is fine
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
       
        # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
        # the above regex won't work. You can use the following
        # workaround to get the desired effect:
        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
       
        # Don't compress images
        SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    </IfModule>
 

anonymous

0

void one_wire_delay_2us(void)
{
   _nop_(); _nop_(); _nop_();
   _nop_(); _nop_(); 
}
 

anonymous

0

.tac {
text-align: center;
}
.tar {
text-align: right;
}
.tal {
text-align: left;
}
 

anonymous

0

private static String strongSecurityHash() {
	String weakHash1 = HashUtil.generate(32);
	String weakHash2 = HashUtil.generate(32);
	String strongHash = weakHash1+weakHash2;
	return strongHash;
}
 

anonymous

+2

//MAIN
int main()
{
    try {
        /* 70 lines of crappy code */
    }
    catch( ...) {
	cerr << "crash!\n";
    }
}
 

anonymous

+2

Merge branch 'production' into master
 

anonymous

-2

-- there has to be a smarter way to do this
    | x < 1000000000000 = 
        illion x 1000000000 "billion "
    | x < 1000000000000000 = 
        illion x 1000000000000 "trillion "
    | x < 1000000000000000000 = 
        illion x 1000000000000000 "quadrillion "
    | x < 1000000000000000000000 = 
        illion x 1000000000000000000 "quintillion "
    | x < 1000000000000000000000000 = 
        illion x 1000000000000000000000 "sextillion "
 

anonymous

+6

// drunk, fix later
 

anonymous

+7

private String isValid(String s) {
  if (...) {
    return Boolean.FALSE.toString();
  } else {
    return Boolean.TRUE.toString();
  }
}

// Later, the only call to isValid:
if (isValid(param).equalsIgnoreCase("TRUE")) {
  ...
}
 

anonymous

+1

$id = (int)$id;
if ( !is_int($id) ) {
	return false;
}
 

anonymous

+4

array = new array[1024] //that should be enough
 

anonymous

+3

Seen in Production code, but not used!

/* encrypt a message with rot13 algorithm */
char *rot13(char *src)
{
  return(src);
}
 

anonymous

+1

//I have no shame in submitting my own code
//I have learned my lesson I swear

//It goes on like this for ~11 more lines
var score = scoreList.SelectedIndex;
                switch (score)
                {
                    case (0):
                        sr.WriteLine("score=0");
                        break;
 

anonymous

-1

# The following function prototype should be taken out and shot.
ccinfogen :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> ChannelCosterInfo
ccinfogen bi bc bb bf bd bin li lc lb lf ld lin oi oc ob xof od oin osl pbi pbc pbb pbf pbd pbin pli plc plb plf pld plin poi poc pob pof pod poin posl eot eop cin = ChannelCosterInfo btfun lifun lofun eofun cin
     where 
           btfun False s 
            | s == "Int"     = bi
            | s == "Char"    = bc
            | s == "Bool"    = bb
            | s == "Float"   = bf
            | s == "Double"  = bd
            | s == "Integer" = bin
            | otherwise      = error ("Btfun-False of nonbasic type " ++ s)
 

anonymous

+2

.margin-top-80px {
  margin-top: 80px;
}
.margin-top-40px {
  margin-top: 40px;
}
.margin-top-30px {
  margin-top: 30px;
}
 

anonymous

+3

$(window).load(function () {
    if ('False'.toLowerCase() !== true) {
        //event handlers
    }
}
 

anonymous

+2

// skip parameter validation. I know what I'm doing. usually. probably. at least sometimes.
 

anonymous

0

Shared Function isPositiv(ByVal str As String) As Boolean

        Dim test As Boolean = False
        Dim nTest As Decimal

        If str = String.Empty Then
            test = False
        ElseIf str = "0" Then
            test = False
        ElseIf str = "0,0" Then
            test = False
        ElseIf str = "0,00" Then
            test = False
        Else
            If IsNumeric(str) Then
                nTest = CDec(str)
                If nTest > 0 Then
                    test = True
                End If
            End If
        End If

        Return test

    End Function
 

+1

if (RUNNING_ENVIRONMENT === 'development') {
    define('CACHE_JS', false);
} else {
    define('CACHE_JS', false);
}
 

anonymous

0

void setformat(int textcolor, int textbackground, int format) {
std::string params;
switch (format) {
case 0:
params="0;";
break;
case 1:
params="1;";
break;
case 2:
params="2;";
break;
case 3:
params="1;2;";
break;
case 4:
params="4;";
break;
case 5:
params="1;4;";
break;
case 6:
params="2;4;";
break;
case 7:
params="1;2;4;";
break;
case 8:
params="5;";
break;
case 9:
params="1;5;";
break;
case 10:
params="2;5;";
break;
case 11:
params="1;2;5;";
break;
case 12:
params="4;5;";
break;
case 13:
params="1;4;5;";
break;
case 14:
params="2;4;5;";
break;
case 15:
params="1;2;4;5;";
break;
case 16:
params="9;";
break;
case 17:
params="1;9;";
break;
case 18:
params="2;9;";
break;
case 19:
params="1;2;9;";
break;
case 20:
params="4;9;";
break;
case 21:
params="1;4;9;";
break;
case 22:
params="2;4;9;";
break;
case 23:
params="1;2;4;9;";
break;
case 24:
params="5;9;";
break;
case 25:
params="1;5;9;";
break;
case 26:
params="2;5;9;";
break;
case 27:
params="1;2;5;9;";
break;
case 28:
params="4;5;9;";
break;
case 29:
params="1;4;5;9;";
break;
case 30:
params="2;4;5;9;";
break;
case 31:
params="1;2;4;5;9;";
break;
}
cout << "\033[" << params << 30+textcolor << ";" << 40+textbackground << "m";
}
 

anonymous

+5

// if the computer is fast, set this to true, else set this to false
#define FAST true
// ...
if (FAST) {
// sleep a long while
for (long l=0; l<10000000000000000L; l=l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+1);
} else {
// sleep a long while
for (long l=0; l<1000000000000L; l=l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+l-l+1);
}
 

anonymous

0

// NOT WORKING: for some reason result appears reversed, if somebody knows a way to fix it, I would appreciate it

int one = 1;
int two = 2;
int three = 3;
int four = 4;
int five = 5;
int six = 6;
int seven = 7;
int eight = 8;
int nine = 9;
int zero = 0;

while (result2>0) {
	switch (result2%10) {
		case 0:
			printf("%d",zero);
			break;
		case 1:
			printf("%d",one);
			break;
		case 2:
			printf("%d",two);
			break;
		case 3:
			printf("%d",three);
			break;
		case 4:
			printf("%d",four);
			break;
		case 5:
			printf("%d",five);
			break;
		case 6:
			printf("%d",six);
			break;
		case 7:
			printf("%d",seven);
			break;
		case 8:
			printf("%d",eight);
			break;
		case 9:
			printf("%d",nine);
			break;
		default:
			printf("%d",result2 % 10);
			break;
	}
	result2 = result2 / 10;
}
 

anonymous

+2

void some_NP_complete_problem_impl (int** arg1, int arg2, int arg3) {
// I found an awesome implementation of this problem in polynomial time,
// but I think it's rude to waste the work of my colleague, so I'll leave it as it is.
[...]
}
 

anonymous

+5

var number = 10.632222232;

function round2Decimal(number) {
    return parseFloat(number.toString().substr(0, number.toString().indexOf('.') + 2) + (number.toString()[number.toString().indexOf('.') + 3] >= 5 ? (parseInt(number.toString()[number.toString().indexOf('.') + 2]) + 1).toString() : number.toString()[number.toString().indexOf('.') + 2]));
}

var roundedNumber = round2Decimal(number);
 

anonymous

+3

var arr = "5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8,8,8,5,10,8,8,8,8,10,10,8,12,10,10,8,10,10,8,8,8,10,10,10,8,10,10,8,10,5,".split(',');
 

anonymous

0

int shift(int x, int y)
{
     int r = x;
     for(int i = 0; i < y; ++i)
     {
         r = r << 1;
     }
     return r;
}
 

anonymous

+5

#actual infinite loop from production code:

while True is not False and True or False is False or False and True is not False and True:
  socket.listen()
 

anonymous

+1

//TODO: hash it
byte[] password = System.Text.Encoding.UTF8.GetBytes( pwd.ToString() );
Array.Reverse(password);
string tmpPassword = Convert.ToBase64String( password );
 

anonymous

+1

if(  $username == "admin" &&
     sha1(SALT . $password) == "2e7ee9a0c8c420711c709d908c37ee65f41276fd") { //check if password is "m8onIBBpRU"
     $adminSessionController->loggedIn(true);
}