reduc_ind = list(xrange(1, len(x.get_shape())))
// Return flagged enum with inverted selected flag value
public static TEnum SwapFlag<TEnum>(this TEnum target, TEnum flag) where TEnum : Enum
{
if (target.HasFlag(flag)) return (TEnum)(object)((int)(object)target & ~(int)(object)flag);
return (TEnum)(object)((int)(object)target | (int)(object)flag);
}
private HashMap<String, Tuple6<float[], String[], String[], String[], String[], String>> memberNameChangedToProtectTheInnocent = null;
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.
maybeSomething match {
case Some(x) => true
case None => false
}
maybeSomething.getOrElse(false) Short code and readable
// var array = retrieveArrayValue();
var filteredArray = array.filter(function (element, index, array) {
return array.indexOf(element) == index;
});
// processArray(filteredArray);
public void sleep(long duration) {
long start = System.currentTimeMillis();
while(true) {
if (System.currentTimeMillis() - start >= duration)
break;
}
}
return isDisabled == false ? false : true;
function edit_vehality: locality,
google_place_id: '1'
};
let opts = { 'method': 'put', 'route': '/border/' + border_id, 'status': status, 'account_access_token': saved_values.superadmin.account_access_token, 'params': params };
request(opts)
.then(function(res) {
resolve(res.result);
}).catch(reject);
})
}
const ws = new WebSocket('wss://echo.websocket.org', {
agent: new HttpsProxyAgent(`https://${proxy}`)
});
wsz.push(ws);
ws.onopen = () => {
if (ws.readyState === WebSocket.OPEN) {
.....
ws.close();
}
};
ws.onerror = () => {
ws.close();
};
u just cant trust, just cant......
CASE WHEN lc.injected = true THEN 'Yes' WHEN lc.injected = false THEN 'No' ELSE 'N/A' END AS is_injected,
CASE WHEN lc.recycled = true THEN 'Yes' WHEN lc.recycled = false THEN 'No' ELSE 'N/A' END AS is_recycled,
CASE WHEN lc.issued = true THEN 'Yes' WHEN lc.issued = false THEN 'No' ELSE 'N/A' END AS is_issued,
The target table contains boolean types, and some others are pseudo-booleans using strings :-\
<ng-container *ngIf="!errors">
<div *ngIf="errors" class="no-content-wrapper">
<esel-components-error [error]="errors"></esel-components-error>
</div>
</ng-container>
Make your code error prone with effective error handling!
const int ONLY_ONE_ITEM = 1;
if (myList.Count > ONLY_ONE_ITEM)
{
DoSomething();
}
else
{
DoSomethingElse();
}
int var = 0;
int* ptr = &var;
ptr[0] = 5;
std::cout << ptr[0];
switch ($content) {
case "vid":
echo '<iframe width="600" height="450" src="http://www.youtube.com/embed/' . $img . '" frameborder="0" allowfullscreen></iframe>';
break;
default:
if ($height > 0 && $width > 0) {
echo '<img width="' . $width . '" height="' . $height . '" src="http://szpileczki.com/up/' . $img . '"/>';
} else {
if ($kochamto == 1) {
echo '<img src="http://kocham.to/up/' . $img . '"/>';
} else {
echo '<img src="http://szpileczki.com/up/' . $img . '"/>';
}
}
break;
}
especially if one of them doesn't exist since 2012