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

By Anonymous, 2021-03-12 21:08:32
this.unwatchBackdrop ? this.unwatchBackdrop() : this.noop();
...
private noop(): void {}
By Anonymous, 2023-01-19 12:36:09
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])))
)
By Alex, 2017-06-08 15:58:10
<?php

$payload = '{ "products": [';
foreach ($products as $product) {
    $payload .= $product->toJson() . ',';
}
$payload = substr($payload, 0, \strlen($payload) - 1);
$payload .= ']}';
By sijolas, 2019-03-15 14:47:06
private boolean isToRemove(byte b) {
    byte[] toRemoveB = { -106 };
    for(byte c : toRemoveB) {
        if(b == c) {
            return true;
        }
    }
    return false;
}

it goes without saying...

By Unknown, 2017-09-26 17:45:20
    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 ...

By Dude, 2020-12-16 12:25:17
var None = null;

if ({{ post.pk }} == None) {
    // reset to draft
    $("#id_status")[0].value = 1;
}
By Anonymous, 2016-11-18 19:08:07
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", ] in success, and ["ok", <base64 encoded «error» word>] I hope I inspired you to make your code totally confusing and irrational.

By Zack Hess, 2019-01-24 12:19:04
$net_price = "var net_price = " . json_encode($net_price) . ";";

This is a Javascript variable being created inside of a PHP string.

By notmycode, 2017-12-12 16:47:24
/// <summary> 
/// Desctop constructor
/// </summary>
...

This is best XML commentary I found so far.

By Anonymous, 2020-03-11 17:55:37
  $(".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

By Desperate Dev..., 2020-01-21 17:28:18
{k: v for d in [{ key: { 0: x[0], } for key in x["name"] } for x in items] for k, v in d.items()}
By nooooooo, 2018-01-02 14:54:31
$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
  ));
}
By Anonymous, 2018-01-16 10:56:13
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();
			}
By Anonymous, 2018-02-16 21:20:56

string date = user.RegistrationDate.ToShortDateString().ToString();
By Anonymous, 2019-02-13 14:51:41