reduc_ind = list(xrange(1, len(x.get_shape())))
function generateArrayFrom1To10()
{
let a = 0;
let b = 1;
let c = 3;
let d = 4;
let e = 5;
let f = 6;
let g = 7;
let h = 8;
let i = 9;
let array = [a,b,c,d,e,f,g,h,i];
return array;
}
const int ONLY_ONE_ITEM = 1;
if (myList.Count > ONLY_ONE_ITEM)
{
DoSomething();
}
else
{
DoSomethingElse();
}
public class MandateData {
public final UUID coreId;
public final UUID accountId;
public final String accountRef;
public final String creditorId;
public final String creditorName;
public final String debtorFirstName;
public final String debtorLastName;
public final String branchCode;
public final String accountNumber;
public final LocalDate signingDate;
public final Address debtorAddress;
private MandateData(UUID coreId, UUID accountId, String accountRef, String creditorId, String creditorName, String branchCode, String accountNumber, String debtorFirstName, String debtorLastName,
LocalDate signingDate, Address debtorAddress) {
this.coreId = coreId;
this.accountId = accountId;
this.accountRef = accountRef;
this.creditorId = creditorId;
this.creditorName = creditorName;
this.debtorFirstName = debtorFirstName;
this.debtorLastName = debtorLastName;
this.branchCode = branchCode;
this.accountNumber = accountNumber;
this.signingDate = signingDate;
this.debtorAddress = debtorAddress;
}
public static MandateData creationMandateData(UUID coreId, UUID accountId, String accountRef, String creditorId, String creditorName, String branchCode, String accountNumber, String debtorFirstName, String debtorLastName,
LocalDate signingDate, Address debtorAddress) {
return new MandateData(coreId, accountId, accountRef, creditorId, creditorName, branchCode, accountNumber, debtorFirstName, debtorLastName, signingDate, debtorAddress);
}
}
There is an ancient and mysterious legend about public static constructor, called createShit. If anyone want's just to create an instance of Shit be aware of it! This is too obvious! just Implement static method with the exactly the same fields, and make constructor private. Don't write a shit!
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......
maybeSomething match {
case Some(x) => true
case None => false
}
maybeSomething.getOrElse(false) Short code and readable
const newReply = (reply !== null) ? reply : null;
private HashMap<String, Tuple6<float[], String[], String[], String[], String[], String>> memberNameChangedToProtectTheInnocent = null;
from typing import Dict, List
from dataclasses import dataclass
from lbcore.orders import Order, Match
@dataclass
class SideEffect:
order_id: str = ''
action: Dict = None
updates: Dict = None
matches: List[Match] = None
order: Order = None
action_exists: bool = False
def match(self, price):
match = self.action.copy()
match['price'] = price
return match
class SideEffects(list):
def add_action(self, order, action_exists=False, **action):
action['order_id'] = order.id
se = SideEffect(order=order, action=action,
action_exists=action_exists)
self.append(se)
return se
def add_update(self, order_id, **updates):
se = SideEffect(order_id=order_id, updates=updates)
self.append(se)
return se
def add_trade(self, order, matches):
se = SideEffect(order=order, matches=matches)
self.append(se)
return se
private void EnableGPSAutoMatically() {
GoogleApiClient googleApiClient = null;
if (googleApiClient == null) {
oogleApiClient = new GoogleApiClient.Builder(this)
.addApi(LocationServices.API).addConnectionCallbacks(this)
.addOnConnectionFailedListener(this).build();
/* about 50 lines of code were here ...
* all depends on this if statement ... !
* Actually the whole method depends on this if statement ! */
}
}
});
}
}
what if that mysterious power change it to be not null !! It gonna be a holly object and You should not "new" it anymore ?! damn ... :)))
if (!String.IsNullOrEmpty(Client.CLADDR1))
{
if (Client.CLADDR1 == "NULL")
{
this.onSubmit = this.onSubmit.bind(this)
this.onClose = this.onClose.bind(this)
somewhere in react-native app
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);
})
}
if(!Hardware::initialize()) {
Serial.println("Hardware initialization failed!");
for(;;){}
}
if(!UI.begin()) {
Serial.println("SSD1306 allocation failed");
for(;;){}
}
For is best ever, why even bother with While, or even Return... Source of code: https://github.com/MausTec/nogasm-wifi/blob/master/ESP32_WiFi.ino
return isDisabled == false ? false : true;