``{k: v for d in [{ key: { 0: x[0], } for key in x["name"] } for x in items] for k, v in d.items()}``
``````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
}
}
}
}
}
}

``````
``````A,B=map(str,input().split())        # let's begin by casting strings to strings!

while(int(A)!=0 and int(B)!=0):

tamanhoa=0
tamanhob=0

for i in range(len(A)):
tamanhoa+=1                 # wonderful way to determine the length of
# a string!
for i in range(len(B)):
tamanhob+=1

vA = [0]*tamanhoa
vB = [0]*tamanhob

if tamanhoa>tamanhob:
vA = [0]*tamanhoa           # Just to make sure it really gets set!!!
vB = [0]*tamanhoa

for i in range(tamanhoa-1,-1,-1):
vA[i]=int(A[i])         # he even saved an operation by casting
# the char to int at the same time!
for i in range(tamanhob):
vB[i+1]=int(B[i])
elif tamanhoa<tamanhob:
vA = [0]*tamanhob           # Just to make sure it really gets set!!!
vB = [0]*tamanhob

for i in range(tamanhoa):
vA[i+1]=int(A[i])

for i in range(tamanhob-1,-1,-1):
vB[i]=int(B[i])

tamanhoa=tamanhob

else:
for i in range(tamanhoa):
vA[i]=int(A[i])

for i in range(tamanhob):
vB[i]=int(B[i])

print(vA)
print(vB)

carry = 0

for i in range(tamanhoa-1,-1,-1):
soma = vA[i] + vB[i]
if soma > 9:
carry += 1
if vA[i-1]!= 9:
vA[i-1] += 1
else:
vB[i-1] +=1

if carry == 0:
print('No carry operation.')
elif carry == 1:
print(carry, 'carry operation.')
else:
print(carry, 'carry operations.')

A,B=map(str,input().split())    # why bother casting strings to int? yay

if int(A)==0 and int(B)==0:
break
``````

This wonder was found within answers to a university programming test. Code as-is, comments added by me.

``````int min(int a,int b,int c) //Function to return the minimum.
{
if(a < b)
{
if(a < c)return a;
else if(a > c)return c;
else return a;
}
else if(a > b)
{
if(b < c)return b;
else if(b > c)return c;
else return b;
}
else
{
if(a < c) return a;
else if(a > c) return c;
else return a;
}
}``````

This kind of things make me hate my work.

``````zipped_file.extractall(f'{file_path}')
zipped_file.close()``````
``````function isAllowSearchLength(text) {
return text.length > isNaN(parseInt(text, 10)) ? 1 : 0;
}``````
``````int my_array[] = {
#include "data.txt"
};``````
``````i++;
i++;
i++;
i++;
Console.WriteLine(i);``````

He doesn't know what is " i+=4 " :||||

``````public function get(\$paymentType, \$carrier, \$gds, \$clearingCompany, \$allowDirectPayment)
{

\$carrier = strtoupper(\$carrier);
if(\$paymentType == 'cc') {
\$gdsVal = \$this->acqData->getGdsVal(\$gds);

if(!\$allowDirectPayment ||
!\$gdsVal ||
!isset(\$gdsVal['lr'], \$gdsVal['direct'], \$gdsVal['lr_commission_acq'], \$gdsVal['direct_commission_acq'])
) {
\$ccDefaultVal = \$this->acqData->getPaymentTypeVal(\$paymentType);
return [[\$ccDefaultVal, \$ccDefaultVal], false];
}

\$commission = \$gdsVal['direct_commission_acq'];
\$isDirect = \$this->isDirect(\$carrier, \$gds, \$clearingCompany);
if(!\$isDirect) {
\$gdsVal['direct'] = \$gdsVal['lr'];
\$commission = \$gdsVal['lr'];
}

return [
[\$gdsVal['direct'], \$commission],
\$isDirect
];
}

\$paymentTypeVal = \$this->acqData->getPaymentTypeVal(\$paymentType);

return [
[\$paymentTypeVal, \$paymentTypeVal],
false
];
}``````

\$ccDefaultVal = \$this->acqData->getPaymentTypeVal(\$paymentType); is duplicated in two branches...

``````public void Handle(SomethingCreatedEvent e)
{
if (e.ActCode == "SOME_VALUE")
{
return;
}
else
{
// insert real function body here
}
}``````
``this.props.HeaderStore.setHeader(true, null, false, false, true, true,'dashboardNavigation');``
``````base.transform.name = this.bodyName;
this.mass = Math.Pow(this.radius, 2.0) * this.surfaceGravity;
this.cameraSwitchHeightM = this.cameraSwitchHeightKm * 1000.0;
{
}
this.atmosphereData.atmosphereHeightM = this.atmosphereData.atmosphereHeightKm * 1000.0;
if (this.terrainData.terrainMaterial != null)
{
this.terrainData.terrainMaterial.color = this.terrainData.terrainColor;
}
this.terrainData.maxTerrainHeight = this.GetMaxTerrainHeight();
this.terrainData.unitToAngle = 360.0 / ((this.radius + this.terrainData.maxTerrainHeight) * 2.0 * 3.1415926535897931);
for (int i = 0; i < this.terrainData.detailLevels.Length; i++)
{
this.terrainData.detailLevels[i].chunckSize = (double)this.terrainData.baseChunckSize / Math.Pow(2.0, (double)i);
this.terrainData.detailLevels[i].angularSize = (float)this.terrainData.detailLevels[i].chunckSize / (float)this.terrainData.heightMaps[0].heightMap.HeightDataArray.Length * 360f;
}
if (this.type == CelestialBodyData.Type.Star)
{
this.parentBody = null;
this.orbitData.SOIMultiplier = double.PositiveInfinity;
}
if (this.parentBody != null && (this.type == this.parentBody.type || (this.type == CelestialBodyData.Type.Planet && this.parentBody.type == CelestialBodyData.Type.Moon)))
{
this.parentBody = null;
}
if (this.parentBody != null)
{
this.orbitData._period = Kepler.GetPeriod(0.0, this.orbitData.orbitHeightM, this.parentBody.mass);
this.orbitData.periodString = Ref.GetTimeString(this.orbitData._period);
this.orbitData._meanMotion = -6.2831853071795862 / this.orbitData._period;
this.orbitData.orbitalVelocity = this.orbitData.orbitHeightM * this.orbitData._meanMotion;
this.orbitData.SOI = this.orbitData.orbitHeightM * Math.Pow(this.mass / this.parentBody.mass, 0.4) * this.orbitData.SOIMultiplier;
if (!this.ParentHasThisBodyAsSatellite())
{
List<CelestialBodyData> list = new List<CelestialBodyData>(this.parentBody.satellites);
this.parentBody.satellites = list.ToArray();
this.parentBody.ValidateSatellites();
}``````
``````<?php
\$now = time();

while (\$now + 10 > time()) {

// Just chill...smoke a blunt
}

echo "Done.\n";``````
``````file = fopen(argv[1], "r");

if (file == NULL){}
exit(EXIT_FAILURE);
``````

Those silly curly braces.

``````    function changePassword() {
if (isInputEmpty()) {
\$.ajax({
type: 'POST',
data: '...'
url: '...',
success: function (result) {
if (result.substring(0, 3) != "!!!") {
//success
} else {
//faliure
}
},
error: function () {
}
});
}
}``````

And of course,in production, it always reported success and never changed the password, because of equally bad server code.