Mistři v programování na #hovnokod

Luki je kokot

x = 0
print("\n")
meno = (input("Tvoje meno: "))
print("\n")
while x < 1:
    print('Ahoj '+str(meno)+' vidím, že ťa zaujíma veľkosť Lukiho čuraka')
    print("\n")
    a = input("(ano/nie)\n: ")
    print("\n")
    if a == ("ano") :
        print("###############################")
        print('# Veľkosť Lukiho čuraka = 0cm #')
        print("###############################")
        print("\n")
        a = input ("Ešte raz ? (ano/nie) \n: ")
        print("\n")
        if a == ("ano"):
            x = 0
        elif a == ("nie"):
            x += 1
        else:
            print ("Prečo ? ... prečo ?")
            x += 1
    elif a == ("nie"):
        print("###########################")
        print("# Luki aj tak žiaden nemá #")
        print("###########################")
        print("\n")
        a = input ("Ešte raz ? \n(ano/nie) \n: ")
        print("\n")
        if a == ("ano"):
            x = 0
        elif a == ("nie"):
            x += 1
        else:
            print ("Prečo ? ... prečo ?")
            x += 1
    else:
        print("Si kokot ?\n")
        a = input("(ano/nie) ? \n: ")
        if a == ("ano"):
            x += 1
        elif a == ("nie"):
            x += 1
        else:
            print ("Prečo ? ... prečo ?")
            x += 1


Matej1237,

Dalsia perlicka z Nette. Fc mkdir padne napr. pre nedostatocne prava, ale vdaka hovnokodu sa to nedozviem. Naviac, adresar sa nepodari vytvorit, napriek tomu pokracuje a kopiruje do neho subor... Cista fuserina :(

/**
 * Move uploaded file to new location.
 * @param  string
 * @return static
 */
public function move($dest)
{
    @mkdir(dirname($dest), 0777, TRUE); // @ - dir may already exist
    @unlink($dest); // @ - file may not exists
    if (!call_user_func(is_uploaded_file($this->tmpName) ? 'move_uploaded_file' : 'rename', $this->tmpName, $dest)) {
        throw new Nette\InvalidStateException("Unable to move uploaded file '$this->tmpName' to '$dest'.");
    }
    @chmod($dest, 0666); // @ - possible low permission to chmod
    $this->tmpName = $dest;
    return $this;
}

Anonymous,

Kvalitni pouziti navrhoveho vzoru builder.

SingleData result = SingleData.builder().build();

result.setBank(tariff.getBankName());
result.setInterestRate(interestRate);
result.setMonthlyPayment(monthPayment);
result.setBonita(bonita);

Vojta Bereščák,

Jak rozpoznt, zda kod bezi pod linuxem nebo po widlemi :D

if (DIRECTORY_SEPARATOR == '/') {
    // linux
}

if (DIRECTORY_SEPARATOR == '\\') {
    // windows
}

Anonymous,


Anonymous,