int minimum(int a, int b, int c){
  int mini =a*b*c;
  int iterator=0;
  int test[3];
  test[0]=a;
  test[1]=b;
  test[2]=c;
  for (iterator=0;iterator<3;iterator++){
    if (test[iterator]<mini){
      mini=test[iterator];
    }
  }
  return mini;
}

I hope that your 3 numbers aren't larger than 1290!

By Another random student of algorithms., 2017-12-14 01:28:18
    $partnerChargesRegular = $row['charges'];
    $partnerChargesIrregular = $row['charges'];
    if (!isset($partnerChargesIrregular) || $partnerChargesIrregular == "") {
      $partnerChargesIrregular = $partnerChargesRegular;
    }

Look. We take A from X and B from X. Then, you make a check, and if it is true you assing A to B. BUT A AND B ARE TAKEN FROM THE SAME X PLACE!!! HOW CAN THEY DIFFER?!?!!!?!?!?!?!!

By My boss, 2018-02-20 10:06:53
private void reset_kolejnosc()
{
	this.kolejnosc_s[0] = 1;
	this.kolejnosc_s[1] = 2;
	this.kolejnosc_s[2] = 3;
	this.kolejnosc_s[3] = 4;
	this.kolejnosc_s[4] = 5;
	this.kolejnosc_s[5] = 6;
	this.kolejnosc_s[6] = 7;
	this.kolejnosc_s[7] = 8;
	this.kolejnosc_s[8] = 9;
	this.kolejnosc_s[9] = 10;
}
By winek, 2016-07-17 00:16:00
<?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
public static int[] sleepSort(int... args) {
        final int[] sorted = new int[args.length];
        final AtomicInteger index = new AtomicInteger(0);
        List<Thread> threads = new ArrayList<Thread>(0);
        for (int i = 0; i < args.length; i++) {
            final int x = i;
            Thread sorter = new Thread(() -> {
                try {
                    Thread.sleep(args[x]);
                } catch (InterruptedException ex) { 
                    // shrug
                }
                sorted[index.getAndIncrement()] = args[x];
            });
            sorter.setDaemon(true);
            sorter.start();
            threads.add(sorter);
        }
        try {
            for (Thread t : threads) { t.join(); }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return sorted;
    }

Takes an unsorted array of integers, sorts by sleeping for the int value of each item in the array and then writing that into the resulting sorted array. Big-O analysis is... difficult.

By Sum YungGui, 2017-12-12 17:10:56
if ((bool)greenButton.IsChecked)
{
    CurrentColor = Color.FromArgb(0xFF, 0x00, 0xCC, 0x00);
}
else if ((bool)greyButton.IsChecked)
{
    CurrentColor = Color.FromArgb(0xFF, 0x79, 0x79, 0x79);
}

foreach (var item in ItemsList.Items)
{
    if ((grid.Background as SolidColorBrush).Color == CurrentColor)
    {
        selectedItems.Add(item);
    }
}
By Anonymous, 2019-09-13 15:41:19
@Pipe({ name: 'shortSex' })
export class SexPipe implements PipeTransform {
  public transform(value: any): 'M' | 'K' {
    switch (value?.code) {
      case SexCodes.MALE:
        return 'M';
      case SexCodes.FEMALE:
        return 'K';
      default:
        return null;
    }
  }
}

What can I say more?

By Anonymous, 2021-07-21 10:44:17
if (argv[1][0]=='D'){
                demo=1;
                argv[1]++;
        }

        if (argv[1][0]=='P'){
                if (sscanf(argv[1], "P%ux%ux%ux%ux%lfx%ux%u"
                                ,&temporal_resample
                                ,&input_w, &input_h, &rate, &input_gamma
                                ,&output_w
                                ,&output_h)!=7){
                        fprintf(stderr,"%s: Invalid argument format\n", progname);
                        print_usage();
                        exit(3);
                }
                ppm=1; 
         }else{
                if (sscanf(argv[1], "%ux%ux%ux%ux%lfx%ux%u"
                                ,&temporal_resample
                                ,&input_w
                                ,&input_h
                                ,&rate
                                ,&input_gamma
                                ,&output_w
                                ,&output_h)!=7){
                        fprintf(stderr,"%s: Invalid argument format\n", progname);
                        print_usage();
                        exit(3);
                }

Found in a chroma subsampling algorithm.

By Anonymous, 2021-03-18 19:51:47
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
    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 x = 3;
> '5' + x - x
50
> '5' - x + x
5 // Because fuck math

JS is simply. Oh, wait...

By mademan, 2015-11-18 13:50:39
if (currentDay.day() !== MONDAY) {
    do {
        currentDay = this.$moment(currentDay).subtract(1, 'days');
        days.unshift(currentDay);
    } while (currentDay.day() !== MONDAY);
}
By Anonymous, 2017-10-14 18:44:20
public static int[] xxx(String filename) throws IOException{
	int[] f = new int[26];
	BufferedReader in = new BufferedReader(new FileReader(filename));
	String line;
	while((line = in.readLine()) != null){
		line = line.toUpperCase();
		for(char ch:line.toCharArray()){
			if(Character.isLetter(ch)){
				f[ch - 'A']++;
			}
		}
	}
	in.close();
	return f;
}
By Anonymous, 2017-12-15 16:08:38
  $(".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
if (string.Compare(json["result"].ToString(), "OK", true) == 0)
{
    if (string.Compare(json["list"][0]["result"].ToString(), "OK", true) == 0)
        return null;
        
    //omitted
}
By J@k3R, 2022-08-09 08:51:55