int true = 0;
while (true)
{
    //do something
}

true = false

By noz1995, 2017-12-15 16:08:59
http://localhost:52108/Trade/Details/1953452?class=pull-left
By Anonymous, 2018-01-05 10:23:21
bool calculateLeapYear(uint8_t year) {
    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
        return true;
    } else {
        return false;
    }
}

uint8_t and a useless if.

By eha, 2023-06-19 23:01:57
apps_to_be_deployed = apps_to_be_deployed.strip()
if apps_to_be_deployed.endswith(":"):
    apps_to_be_deployed_length = len(apps_to_be_deployed)
    apps_to_be_deployed_list = list(apps_to_be_deployed)
    apps_to_be_deployed_list[apps_to_be_deployed_length - 1] = ''
    apps_to_be_deployed = "".join(apps_to_be_deployed_list)
By jlo, 2019-09-14 01:16:59

def divide(a, b):
    try:
        return a / b
    except:
        x = 17

My smart exception handling before meeting "pass" :))

By mophix, 2017-12-15 18:13:07
def possibilities():
    alphabets=(n,o,r,t,h,e,a,s,u,w,m,y)
    combinations=list()
    for n in range(9,-1,-1):
            for o in range(9,-1,-1):
                    for r in range(9,-1,-1):
                            for t in range(9,-1,-1):
                                    for h in range(9,-1,-1):
                                            for e in range(9,-1,-1):
                                                    for a in range(9,-1,-1):
                                                            for s in range(9,-1,-1):
                                                                    for u in range(9,-1,-1):
                                                                            for w in range(9,-1,-1):
                                                                                    for m in range(9,-1,-1):
                                                                                            for y in range(9,-1,-1):
                                                                                                    if len(set([n,o,r,t,h,e,a,s,u,w,m,y]))==12:
                                                                                                    north=10000*n + 1000*o +100*r +10*t +h
                                                                                                    east=1000*e +100*a +10*s +t
                                                                                                    south=10000*s + 1000*o +100*u +10*t +h
                                                                                                    west=1000*w + 100*e +10*s +t
                                                                                                    earth= 10000*e + 1000*a + 100*r +10*t +h
                                                                                                    if north +east +south +west == earth:
                                                                                                            combinations.append((north,east,south,west,earth))

    return combinations
By Dusk Code, 2018-04-25 11:47:49
public List<Location> searchLocations(final String phrase) {
        final String like = phrase.replaceAll("(\\s)", "%$1") + "%";
        final List<Location> result = getLocations(
                "replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(\n" +
                        "replace(lower(name),'.',' '),\n" +
                        "'á','a'),\n" +
                        "'é','e'),\n" +
                        "'í','i'),\n" +
                        "'ĺ','l'),\n" +
                        "'ó','o'),\n" +
                        "'ŕ','r'),\n" +
                        "'ú','u'),\n" +
                        "'ý','y'),\n" +
                        "'č','c'),\n" +
                        "'ď','s'),\n" +
                        "'ľ','l'),\n" +
                        "'ň','n'),\n" +
                        "'š','s'),\n" +
                        "'ť','t'),\n" +
                        "'ž','z'),\n" +
                        "'ä','a'),\n" +
                        "'ô','o') LIKE lower(?)\n" +
                        "ORDER BY CASE country_code WHEN 'SK' THEN 0 ELSE 1 END, length(name), name", like);
        return result;
    }

Author: I am satisfied with the project and I don't think I have anything to be ashamed of

By Anonymous, 2020-07-16 10:49:27
void destroy_phone(T9obj* ptr_T9Obj){
    free(ptr_T9Obj);
}

Such thoughtful name!

By farhanhubble, 2019-05-30 08:57:39
if(date.getFullYear() <= 2017) {
    if(date.getMonth() <= 11) {
        if(date.getDate() <= 26) {
            if(date.getHours() <= 23) {
                if(date.getMinutes() <= 59) {
                    if(date.getSeconds() <= 59) {
                        //Display popup before 2017-11-27
                    }
                }
            }
        }
    }
}

    
By Anonymous, 2017-12-12 14:14:55
public IsTrueWithNewTokenResponse isVoice(String token){
    IsTrueWithNewTokenResponse isTrue = isWhatever(token, 0)
    resultStatus.success = isTrue.generalResultResponse.success;
    resultStatus.statusCode = isTrue.generalResultResponse.statusCode;
    resultStatus.statusDescription  = isTrue.generalResultResponse.statusDescription;
    if(isTrue != null && isTrue.generalResultResponse != null && isTrue.generalResultResponse.success){
        isTrue.isTrue = !isTrue.isTrue
        return isTrue
    } else {
        return isTrue
    }
}
By Anonymous, 2017-12-18 09:11:43
class PythonClass {
    protected boolean True = true;
    protected boolean False = false;
    protected Object None = null;
}

class MyClass extends PythonClass {
    String do_something(Object foo) {
        if (foo == False)
            return ""                                  ;
        
        
        else if (foo == None)
            return "!"                                 ;
            
        else if (foo == True)
            return "Yay!"                              ;
    }
}

Yikes

By imaginedev, 2021-04-03 02:44:52
private static function derivePrice(...)
  {
	$price = self::derivePriceUnchecked($vars);
    
    if (isset($price)) {
		// CODE HERE
    } 

    if (isset($price)) {
		// CODE HERE
    } 
    
    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    return $price;
  }
By Anonymous, 2018-02-06 11:38:18
$("#search-submit").click(function() {
  $("#search form").submit()
});

type="submit" is too mainstream, jquery is the proper way to do it

By Kadet, 2016-02-13 16:44:10
if yearOfBirth > 2002 {
    fmt.Errorf("year of birth not allowed %d", yob)
    return
}
By V, 2021-06-15 14:53:58
local part = script.Parent

local OriginColor = Color3.new(0,170,255)

local KillColor = Color3.new(1, 0, 0)

part.Touched:Connect(function(H)
	local humanoid = H.Parent:FindFirstChild("Humanoid")
	if humanoid and part.Color == KillColor then
		humanoid.Health = 0

	end

end)

local shit = 1
repeat

	part.Color = OriginColor
	wait(1.5) 
	part.Color = KillColor
	wait(1.5)



until shit == 2
By petierko, 2021-06-23 19:02:54