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

function compare($object1, $object2) {
    if ($object1 == $object2) {
        return true;
    } else {
        return false;
    }
}
 

+1

	public boolean isNumber(String string){

		try
		{
			Long.parseLong(string);
		} catch (Exception e){
			return false;
		}
		return true;
	}
 

+2

// Don't display errors. This will mess up the image.
ini_set('display_errors', 'On');
 

anonymous

+3

// Some simple array-code by junior dev

foreach($codes as $code){
    if (isset($allCodes[$code[0]][$code[1]][$code[2]][$code[3]][$code[4]][$code[5]])) {
        unset($allCodes[$code[0]][$code[1]][$code[2]][$code[3]][$code[4]][$code[5]]);
        $newCodes[$code[0]][$code[1]][$code[2]][$code[3]][$code[4]][$code[5]] = 1;
        if (array() === $allCodes[$code[0]][$code[1]][$code[2]][$code[3]][$code[4]]) {
            unset($allCodes[$code[0]][$code[1]][$code[2]][$code[3]][$code[4]]);
            $newCodes[$code[0]][$code[1]][$code[2]][$code[3]][$code[4]] = '*';
            if (array() === $allCodes[$code[0]][$code[1]][$code[2]][$code[3]]) {
                unset($allCodes[$code[0]][$code[1]][$code[2]][$code[3]]);
                $newCodes[$code[0]][$code[1]][$code[2]][$code[3]] = '*';
                if (array() === $allCodes[$code[0]][$code[1]][$code[2]]) {
                    unset($allCodes[$code[0]][$code[1]][$code[2]]);
                    $newCodes[$code[0]][$code[1]][$code[2]] = '*';
                    if (array() === $allCodes[$code[0]][$code[1]]) {
                        unset($allCodes[$code[0]][$code[1]]);
                        $newCodes[$code[0]][$code[1]] = '*';
                        if (array() === $allCodes[$code[0]]) {
                            unset($allCodes[$code[0]]);
                            $newCodes[$code[0]] = '*';
                        }
                    }
                }
            }
        }
    }
}
 

anonymous

-1

replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(lower(AmazonCategory0), 'ö', 'oe'), 'ä', 'ae'), 'ü', 'ue'), 'ß', 'ss'), '.', ''), ',', ''), '-', ''), '_', ''), '/', ''), '|', ''), ')', ''), '(', ''), '[', ''), ']', ''), '{', ''), '}', ''), '''', ''), '´', ''), '`', ''), ' ', '') 
 

anonymous

0

while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        if(!@$_++) continue; // skip headline
        //...
}
 

0

//This code is in production on a major website            

            $('#hiba_1').hide();
            //$('#div_2').hide();
            $('#div_3').hide();
            $('#div_32').hide();
            $('#div_4').hide();
            $('#div_42').hide();
            $('#div_45').hide();
            $('#div_5').hide();
            $('#div_6').hide();
            $('#div_7').hide();
            $('#div_8').hide();
            $('#div_9').hide();
            $('#div_10').hide();
            $('#div_11').hide();
            $('#div_12').hide();
            $('#div_13').hide();
            $('#div_14').hide();
            $('#div_15').hide();
            $('#div_16').hide();
            $('#div_17').hide();
            $('#div_18').hide();
            $('#div_19').hide();
            $('#div_20').hide();
 

anonymous

0

// Actual production code used to generate many installments for an invoice
// This very code is copied and pasted three times inside the same method
 // 1a. Installment
                if dmConsultas.qryGeral.FieldByName('fator1').AsFloat > 0 then
                begin
                 Parameters.ParamByName('cod_historico').Value      := icod_hist;
                 Parameters.ParamByName('seq_historico').Value      := 1;
                 Parameters.ParamByName('dt_vencimento').Value := (dtpDt_movto.DateTime + dmConsultas.qryGeral.FieldByName('nr_dias1').AsInteger );
                 Parameters.ParamByName('valor_movto').Value          := (rValor_Total *
                                                                             ( dmConsultas.qryGeral.FieldByName('fator1').AsFloat / 100  ));
                 Parameters.ParamByName('usu_lasup').Value           := Frm_Principal.sLoginUser;
                  Execute;
                end;

                // 2a. Installment
                if dmConsultas.qryGeral.FieldByName('fator2').AsFloat > 0 then
                begin
                 Parameters.ParamByName('cod_historico').Value      := icod_hist;
                 Parameters.ParamByName('seq_historico'). Value      := 2;
                 Parameters.ParamByName('dt_vencimento').Value := (dtpDt_movto.DateTime + dmConsultas.qryGeral.FieldByName('nr_dias2').AsInteger );
                 Parameters.ParamByName('valor_movto').Value          := (rValor_Total *
                                                                 ( dmConsultas.qryGeral.FieldByName('fator2').AsFloat / 100  ));
                 Parameters.ParamByName('usu_lasup').Value           := Frm_Principal.sLoginUser;
                  Execute;
                end;

                // 3a. Installment
                if dmConsultas.qryGeral.FieldByName('fator3').AsFloat > 0 then
                begin
                 Parameters.ParamByName('cod_historico').Value      := icod_hist;
                 Parameters.ParamByName('seq_historico').Value      := 3;
                 Parameters.ParamByName('dt_vencimento').Value := ( dtpDt_movto.DateTime + dmConsultas.qryGeral.FieldByName('nr_dias3').AsInteger );
                 Parameters.ParamByName('valor_movto').Value          := (rValor_Total *
                                                                 ( dmConsultas.qryGeral.FieldByName('fator3').AsFloat / 100  ));
                 Parameters.ParamByName('usu_lasup').Value           := Frm_Principal.sLoginUser;
                  Execute;
                end;

                // 4a. Installment
                if dmConsultas.qryGeral.FieldByName('fator4').AsFloat > 0 then
                begin
                 Parameters.ParamByName('cod_historico').Value      := icod_hist;
                 Parameters.ParamByName('seq_historico').Value      := 4;
                 Parameters.ParamByName('dt_vencimento').Value := (dtpDt_movto.DateTime + dmConsultas.qryGeral.FieldByName('nr_dias4').AsInteger );
                 Parameters.ParamByName('valor_movto').Value          := (rValor_Total *
                                                                 ( dmConsultas.qryGeral.FieldByName('fator4').AsFloat / 100  ));
                 Parameters.ParamByName('usu_lasup').Value           := Frm_Principal.sLoginUser;
                  Execute;
                end;

                // 5a. Installment
                if dmConsultas.qryGeral.FieldByName('fator5').AsFloat > 0 then
                begin
                 Parameters.ParamByName('cod_historico').Value      := icod_hist;
                 Parameters.ParamByName('seq_historico').Value      := 5;
                 Parameters.ParamByName('dt_vencimento').Value := (dtpDt_movto.DateTime + dmConsultas.qryGeral.FieldByName('nr_dias5').AsInteger );
                 Parameters.ParamByName('valor_movto').Value          := (rValor_Total *
                                                                 ( dmConsultas.qryGeral.FieldByName('fator5').AsFloat / 100  ));
                 Parameters.ParamByName('usu_lasup').Value           := Frm_Principal.sLoginUser;
                  Execute;
                end;

                // 6a. Installment
                if dmConsultas.qryGeral.FieldByName('fator1').AsFloat > 0 then
                begin
                 Parameters.ParamByName('cod_historico').Value      := icod_hist;
                 Parameters.ParamByName('seq_historico').Value      := 1;
                 Parameters.ParamByName('dt_vencimento').Value := (dtpDt_movto.DateTime + dmConsultas.qryGeral.FieldByName('nr_dias6').AsInteger );
                 Parameters.ParamByName('valor_movto').Value          := (rValor_Total *
                                                                             ( dmConsultas.qryGeral.FieldByName('fator6').AsFloat / 100  ));
                 Parameters.ParamByName('usu_lasup').Value           := Frm_Principal.sLoginUser;
                  Execute;
                end;

                // 7a. Installment
                if dmConsultas.qryGeral.FieldByName('fator7').AsFloat > 0 then
                begin
                 Parameters.ParamByName('cod_historico').Value      := icod_hist;
                 Parameters.ParamByName('seq_historico'). Value      := 2;
                 Parameters.ParamByName('dt_vencimento').Value := (dtpDt_movto.DateTime + dmConsultas.qryGeral.FieldByName('nr_dias7').AsInteger );
                 Parameters.ParamByName('valor_movto').Value          := (rValor_Total *
                                                                 ( dmConsultas.qryGeral.FieldByName('fator7').AsFloat / 100  ));
                 Parameters.ParamByName('usu_lasup').Value           := Frm_Principal.sLoginUser;
                  Execute;
                end;

                // 8a. Installment
                if dmConsultas.qryGeral.FieldByName('fator8').AsFloat > 0 then
                begin
                 Parameters.ParamByName('cod_historico').Value      := icod_hist;
                 Parameters.ParamByName('seq_historico').Value      := 3;
                 Parameters.ParamByName('dt_vencimento').Value := ( dtpDt_movto.DateTime + dmConsultas.qryGeral.FieldByName('nr_dias8').AsInteger );
                 Parameters.ParamByName('valor_movto').Value          := (rValor_Total *
                                                                 ( dmConsultas.qryGeral.FieldByName('fator8').AsFloat / 100  ));
                 Parameters.ParamByName('usu_lasup').Value           := Frm_Principal.sLoginUser;
                  Execute;
                end;

                // 9a. Installment
                if dmConsultas.qryGeral.FieldByName('fator9').AsFloat > 0 then
                begin
                 Parameters.ParamByName('cod_historico').Value      := icod_hist;
                 Parameters.ParamByName('seq_historico').Value      := 4;
                 Parameters.ParamByName('dt_vencimento').Value := (dtpDt_movto.DateTime + dmConsultas.qryGeral.FieldByName('nr_dias9').AsInteger );
                 Parameters.ParamByName('valor_movto').Value          := (rValor_Total *
                                                                 ( dmConsultas.qryGeral.FieldByName('fator9').AsFloat / 100  ));
                 Parameters.ParamByName('usu_lasup').Value           := Frm_Principal.sLoginUser;
                  Execute;
                end;

                // 10a. Installment
                if dmConsultas.qryGeral.FieldByName('fator10').AsFloat > 0 then
                begin
                 Parameters.ParamByName('cod_historico').Value      := icod_hist;
                 Parameters.ParamByName('seq_historico').Value      := 5;
                 Parameters.ParamByName('dt_vencimento').Value := (dtpDt_movto.DateTime + dmConsultas.qryGeral.FieldByName('nr_dias10').AsInteger );
                 Parameters.ParamByName('valor_movto').Value          := (rValor_Total *
                                                                 ( dmConsultas.qryGeral.FieldByName('fator10').AsFloat / 100  ));
                 Parameters.ParamByName('usu_lasup').Value           := Frm_Principal.sLoginUser;
                  Execute;
                end;
 

anonymous

+9

// String Arrays
private String scoreArray[] = {"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16"};

private String scoreConverter(int a)
{		
	return scoreArray[a];
}
 

+1

//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: ☆ ☆ ☆ ☆ ☆  ";