reduc_ind = list(xrange(1, len(x.get_shape())))
function renderGroupSelectedSuccessors() {
var index = 0;
if (tempSuccessorsGroupsList != null && tempSuccessorsGroupsList.length > 0) {
var groups = tempSuccessorsGroupsList.splice(0, PageSettings.lazyRenderItemsPerPage);
var groupSuccessors = '';
for (var i = 0; i < groups.length; i++) {
if (index % 10 == 0) {
groupSuccessors += '<div style="float: left;"><ul>';
}
groupSuccessors += '<li><a data-groupid="'+groups[i].GroupID+'">' + groups[i].GroupName + '</a></li>';
index++;
if (index % 10 == 0 || i == groups.length - 1) {
groupSuccessors += '</ul></div>';
}
}
$('#divGroupSuccessorsList').append(groupSuccessors);
SetCheckBoxState();
setTimeout(renderGroupSelectedSuccessors, 50);
}
}
Where does the data come from? Where does it go? Why isn't this an endless recursive loop? Why has this worked for three years?
var div = '<div class="imgdiv" '+(user[5] ? 'style="display: flex; flex-direction: column; padding: 10px; justify-content: flex-end; background-image: url(\''+user[5]+'\');"' : '')+'>'
+ (usersVideos[userId] && <?= ($authuser ? 'true' : 'false') ?> ? '<i class="f7-icons icon-acc" onclick="videoShow('+user[uID]+')" style="color: white; font-size: 50px; margin-bottom: 5px; cursor: pointer; text-align: left;">play_round</i>' : '')
+ (iam && page=='home' ? '<div> <input id="video-input" onchange="uploadVideo(files)" type="file" accept="video/*" style="display: none; width: 80%; height: 100px; margin: auto; padding-top: 20px;"/> </div> <p class="action_cont" style="padding: 0; padding-top: 12;"> <a class="act_btn" onmousedown=document.getElementById("video-input").click() href="javascript:void(0)" style="text-decoration: none; margin: auto; width: calc(100% - 26px); text-align: center;"> ' + (myMods['video'] ? 'Загрузить новое видео' : 'Добавить видео-превью' ) + ' </a> </p>' : '')
+ '</div>'
JS + CSS + PHP + HTML
const [glossaries, prompts] = [await getGlossaries(), await getPromps()];
// instead of
// const [glossaries, prompts] = await Promise.all([getGlossaries(), getPrompts()]);
When I was writing the code, I thought for a moment that getGlossaries() and getPrompts() will be executed in parallel
//class tworzenie.FaceOknoDodatki
var b = 2;
var wlosyT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,7,4,4,7,8,9,10,6,8,6,5,5,7,8,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b];
var brwiT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b];
var oczyT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,5,6,6,7,8,8,8,9,9,9,10,10,10,10,10,10];
var nosT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b];
var brodaT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,5,6,7,7,8,9];
var ustaT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,10,10];
var czachyT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,10];
var tatuazT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,3,7,7,7,7,8,8,8,9,9,9,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0];
var opaskaT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,8,9,10,7,8,9,8,9,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
var kolczykiT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,3,3,4,4,5,6,5,6,7,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
var kolczyki2T = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,3,3,6,5,8,9,4,7,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
var bliznaT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,5,7,8,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
code from some shitty polish game, character face creator
int main() {
int error_code = some_function();
if (error_code == 1) {
// In case of error, crash the program by eating up memory
while (true) new int;
}
}
#define omae
#define wa (void)0
#define mou (void)0
#define shinderu ;
#define nani (void)
#define return 0; return
int main(void) {
omae wa, mou shinderu
nani!
return 0;
}
private HashMap<String, Tuple6<float[], String[], String[], String[], String[], String>> memberNameChangedToProtectTheInnocent = null;
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 int ONLY_ONE_ITEM = 1;
if (myList.Count > ONLY_ONE_ITEM)
{
DoSomething();
}
else
{
DoSomethingElse();
}
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......
<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!
public abstract class AbstractInventoryProductFactoryManagerSingletonServiceManagerFactoryExceptionHandlerResourceHandlerDatabaseConnectionHandlerImpl {
private static AbstractInventoryProductFactoryManagerSingletonServiceManagerFactoryExceptionHandlerResourceHandlerDatabaseConnectionHandlerImpl theOneAndOnlyInstance;
private Connection theUnbreakableEverlastingDatabaseLifeline;
public static AbstractInventoryProductFactoryManagerSingletonServiceManagerFactoryExceptionHandlerResourceHandlerDatabaseConnectionHandlerImpl summonTheSingleton() {
if (theOneAndOnlyInstance == null) {
theOneAndOnlyInstance = new ConcreteImplementation();
}
return theOneAndOnlyInstance;
}
public abstract void initiateUnswervingDatabaseLinkWithCompulsiveRetriesAndUnyieldingTimeout();
public abstract InventoryProduct concoctAndJumpstartBrandNewInventoryProductPostRigorousValidation();
public abstract Service bootstrapAndEnrollNovelServicePostInfallibleAvailabilityCheck();
public abstract void seizeAndChronicleExceptionWithStackTrackAndSignalDeveloper(Exception e);
public abstract void manageAndFineTuneResourceConsumptionForPeakEfficiency(Resource resource);
public abstract void launchDatabaseTransactionWithOptimumIsolationLevel();
public abstract void ratifyDatabaseTransactionAndScourForPossibleConflicts();
public abstract void revokeDatabaseTransactionInEventOfUnforeseenErrors();
public abstract void safelySeverDatabaseConnectionAndLiberatePreciousResources();
}
maybeSomething match {
case Some(x) => true
case None => false
}
maybeSomething.getOrElse(false) Short code and readable
<?php
// This code supposed to find adjacent items of a specific one
// $list is an array of ids
// $itemToSearch is an id that might be in the $list
foreach ($list as $item) {
next($list);
if ($item == $itemToSearch) {
break;
}
$previousItem = $item;
}
$nextItem = current($list);
The $list variable is a list of ids, e.g [1, 2, 3, 4, 5] The $itemToSearch is an id that might be in $list