"  ".split(" ");

Very weird code found multiple times in old code base.

By heldt, 2017-12-12 12:03:14
/// <summary>
/// Returns true if any component of of Vector3 v is negative
/// </summary>
public static bool Ext_IsNegative(this Vector3 v)
{
    return v.x < 0f && v.y < 0f && v.z < 0f;
}

Either the description is wrong or the method in itself

By SwagridOfficial, 2017-12-13 13:00:34
public class Main {
    public static void main(String[] args) {
        try {
            //code goes here
        } catch (Exception e) {
            System.exit(0);
        }
    }
}
By s0m31, 2022-06-03 15:46:49
const rola = (usr: IUserData) => {
    let student = "student"
    let edukator = "edukator"
    let dziekanat = "dziekanat"
    let admin = "admin"
    if(usr.type===1){
        return student
    }
    else if(usr.type===2){
        return edukator
    }
    else if(usr.type===3){
        return dziekanat
    }
    else if(usr.type===4){
        return admin
    }
}
By Anonymous, 2022-06-06 14:02:08
//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

By whitemoon, 2024-03-08 19:58:38
#include <stdio.h>
#include<stdlib.h>
#include<time.h>

void randy(int array[] ){
int i = 0  , d = 0;
		for(i = 1 ; i <= 23 ; i++){
			
			array[i] =  1 + (rand() % 365 ); 
		}
	}

int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}



int find (int arr[]){
 int d = 0;
 	
 	for(d = 1  ;d <=23 ; d++ ){
 		
		 if(arr[d] == 	 arr[d + 1]){
		 	return 1;
		 }
	 }
	
	return 0;
}

int main(void){
	 double count_birthday = 0;
	int  people[24];
  
	srand(time(NULL));
	
	int c = 0 ;
	long double ip = 0;
	
	
	
	while(ip++ <= 1000000 ){
		

		randy(people);
		qsort (people, 25, sizeof(int), compare);
		if(find (people) == 1 ){
			count_birthday++;
		}

	}

printf("%.2lf", 	count_birthday  / 10000  );
return 0;
}
By lazy_8, 2020-03-04 13:14:05
scrollToEl($el.parent().parent().parent());

Someones idea of how to select an element to scroll to.... Please no.

By Anonymous, 2019-09-27 15:20:17
<?php

class CasinoCode
{
    CONST POST = 'POST';
    CONST GET = 'GET';
    
    $data = $this->callAPI('/hidden', [], self::POST);

production code of an API with dozens of millions of requests per day.

By Anonymous, 2019-10-17 19:43:24
fn second_word(s: &String) -> &str {
    let bytes = s.as_bytes();
    let mut k = 0;
    let mut n =0;
    for (i, &item) in bytes.iter().enumerate() {
        if item == b' ' {
            k = k + 1;
            if k == 1 {
                n = i;
            }
            else if k == 2 {
                return &s[1+n..i];
            }

        }
    }

    &s[..]
}

the code looks like shit

By big_shaq123, 2022-05-10 15:27:32
if (cookiesBannerHeight !== 0 && isMobile) {
      style = {
        top: cookiesBannerHeight === 0 ? 0 : cookiesBannerHeight
      }
}
By Kubus, 2018-02-28 11:00:11
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;
    }
}
By Anonymous, 2024-04-30 08:31:39
public static returnTrue(boolean b){
    if (b){
        return true;
    } else {
        return true;
    }
}

When you want your function always returns the correct value

By kayvan goli, 2017-12-13 14:49:39

class Timer extends React.Component{
    state ={
        time: 10
    };
    setInvt = () =>{
        let t = this.state.time
        if(t<=1){
            clearInterval(this.invertal)
        }
        this.setState({time: t-1})
    }
    componentDidMount(){
        this.invertal = setInterval(this.setInvt, 1000)
    }

    render(){
        return (<label>{this.state.time}</label>)
    }
}

export {Timer}
By Anonymous, 2021-07-30 21:13:46
case ClientMessage:    
    if (*XGetAtomName(GLWin.dpy, event.xclient.message_type)
        == *"WM_PROTOCOLS")
        {   printf("Exiting sanely...\n");
            done = True;
        }
    break;

someone just want to watch the world burn

By Anonymous, 2018-01-07 13:01:05
this.props.HeaderStore.setHeader(true, null, false, false, true, true,'dashboardNavigation');
By Fluttershy, 2018-01-19 08:53:26