let foo = {} // object no. 1
let bar = {} // object no. 2
foo > bar // return false
foo < bar // return false, so maybe foo equals bar?
foo == bar // oh well, return false
// but
foo >= bar // return true, 'cause !(foo < bar) == true
return value is expected, but JS is funny
this.unwatchBackdrop ? this.unwatchBackdrop() : this.noop();
...
private noop(): void {}
if(
(!_.isEmpty($(switcher).val()) && value_isnt == ":empty") ||
((value_isnt) && !$(switcher).is(value_isnt) && value_isnt != ':empty') ||
(value_is && $(switcher).is(value_is) && value_is != ':empty') ||
(value_is == ':empty' && _.isEmpty($(switcher).val())) ||
(value && _switcherValue == value) ||
(valueIn && .anyMatchInArray(valueIn.split(','), .flatten([_switcherValue]))) ||
(valueOut && !.anyMatchInArray(valueOut.split(','), .flatten([_switcherValue])))
)
<?php
$payload = '{ "products": [';
foreach ($products as $product) {
$payload .= $product->toJson() . ',';
}
$payload = substr($payload, 0, \strlen($payload) - 1);
$payload .= ']}';
private boolean isToRemove(byte b) {
byte[] toRemoveB = { -106 };
for(byte c : toRemoveB) {
if(b == c) {
return true;
}
}
return false;
}
it goes without saying...
self.isOptionsVisible = ko.computed(function() {
if((self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
self.isNameVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
self.isBeforeAfterImagesVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
self.isTooltipVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
self.isLabelVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload') || (self.type() == 'info')) {
return true;
}
return false;
}, this);
self.isClassVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
self.isStyleVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
object orientation overrated. let's check the fields in several places ...
var None = null;
if ({{ post.pk }} == None) {
// reset to draft
$("#id_status")[0].value = 1;
}
doit({txs, [Tx]}) ->
X = tx_pool_feeder:absorb(Tx),
Y = case X of
ok -> hash:doit(testnet_sign:data(Tx));
_ -> <<"error">>
end,
{ok, Y};
In my opinion api response should be as confusing as possible. This method is used for sending tx into Amoveo blockchain. It returns ["ok",
$net_price = "var net_price = " . json_encode($net_price) . ";";
This is a Javascript variable being created inside of a PHP string.
/// <summary>
/// Desctop constructor
/// </summary>
...
This is best XML commentary I found so far.
$(".alarmBell").on("click", () => {
let icon = $(".alarm-bell__icon")
icon.attr('data', icon.attr('data') == 'images/icon/alarm-bell.svg' ? 'images/icon/alarm-bell-filled-new.svg' : 'images/icon/alarm-bell.svg');
// $(".alarm-bell__icon").attr('data', function (index, data) {
// if (data == 'images/icon/alarm-bell-filled-new.svg') {
// return 'images/icon/alarm-bell.svg';
// } else if (data == 'images/icon/alarm-bell.svg') {
// return 'images/icon/alarm-bell-filled-new.svg';
// } else {
// return 'images/icon/alarm-bell.svg';
// }
// });
});
...after yet another icons change request
{k: v for d in [{ key: { 0: x[0], } for key in x["name"] } for x in items] for k, v in d.items()}
$config = Config::getConfig('common');
$contract_carriers = $config[$market . "_" . $clearing . '_contract_carriers']; // f**ing php array
$interline_carriers = $config[$market . "_" . $clearing . '_interline_carriers']; // another f**ing array
// $marketing_carriers - is also array
$sets = [];
foreach ($marketing_carriers as $mc) {
$sets[] = array_unique(array_intersect(
array_merge(
[$mc],
array_intersect(
isset(self::$interlines[$mc]) ? self::$interlines[$mc] : [],
array_merge(
$marketing_carriers,
$interline_carriers
)
)
),
$contract_carriers
));
}
base.transform.name = this.bodyName;
this.radius = this.diameterKm * 500.0;
this.mass = Math.Pow(this.radius, 2.0) * this.surfaceGravity;
this.cameraSwitchHeightM = this.cameraSwitchHeightKm * 1000.0;
if (this.atmosphereData.shadowIntensity == 0f)
{
this.atmosphereData.shadowIntensity = 1.65f;
}
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;
}
this.terrainData.detailLevels[0].loadDistance = double.PositiveInfinity;
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);
list.Add(this);
this.parentBody.satellites = list.ToArray();
this.parentBody.ValidateSatellites();
}
string date = user.RegistrationDate.ToShortDateString().ToString();