i++;
i++;
i++;
i++;
Console.WriteLine(i);

He doesn't know what is " i+=4 " :||||

By Manoochehr Mojgani, 2017-12-13 21:46:04
function getJSType(cppType: string) {
    let typeMap = new Map<string, string>([
        ["Bool", "boolean"],
        ["Int32", "number"],
        ["UInt32", "number"],
        ["Int64", "number"],
        ["UInt64", "number"],
        ["Double", "number"],
        ["String", "string"],
        ["Object", "any"]
    ]);

    if (typeMap.get(cppType) === undefined) {
        console.error("Invalid type in getJavascriptType: " + cppType);
        process.exit(1);
    }
    return typeMap.get(cppType);
}
By Anonymous, 2017-12-15 11:58:04
const errorHandler = () => {
  throw new Error();
};
By Anonymous, 2018-10-08 19:35:38
$_POST = $this->db->mres($_POST);
$_SESSION['post'] = $_POST;

$sql = "SELECT id, documento, nombre1, nombre2, apellido1, apellido2 "
        . "FROM usuarios "
        . "WHERE " .
    "REPLACE(" .
        "REPLACE(" .
            "REPLACE(" .
                "REPLACE(telefono,' ','')," .
                "'(','')," .
            "')','')," .
        "'-','') LIKE '%{$searchTel}'";
By Carlos Correa, 2016-09-16 22:11:38
        $gallery = \common\models\UtVideogallery::find()->select(['ut_videogallery.VideogalleryID',
                'ut_videogallery.Name_rus','ut_videogallery.TournamentID','ut_videogallery.MatchID', 'Slug',
                'ut_videogallery.Date','COUNT(ut_video_to_gallery.VideoToGalleryID) count','ut_matches_videos.Data',
                'm1.Data DataP'])
                ->leftJoin('ut_video_to_gallery','ut_video_to_gallery.VideogalleryID=ut_videogallery.VideogalleryID')
                ->leftJoin('ut_matches_videos','ut_matches_videos.VideoID=ut_video_to_gallery.VideoID')
                ->leftJoin('ut_matches_videos m1','m1.VideoID=ut_videogallery.PreviewID')
                ->where(['ut_videogallery.Active'=>1])
                //->andWhere(['TournamentID'=>$list['selected']])
                ->groupBy('ut_videogallery.VideogalleryID')
                ->orderBy('ut_videogallery.Date DESC')
                ->limit(self::$countPerPage)
                ->asArray()->all();
        foreach ($gallery as $key => $value) {
            if($value['count']==0) unset($gallery[$key]);
        }
        foreach($gallery as $k=>$v){
            if(isset($v['Data']))
                $v['Data'] = str_replace('http:','https:',$v['Data']);
            if(isset($v['DataP']))
                $v['DataP'] = str_replace('http:','https:',$v['DataP']);
            $gallery[$k]=$v;
        }
        $galleryCount = \common\models\UtVideogallery::find()->select(['ut_videogallery.VideogalleryID',
                'ut_videogallery.Name_rus','ut_videogallery.TournamentID','ut_videogallery.MatchID',
                'ut_videogallery.Date','COUNT(ut_video_to_gallery.VideoToGalleryID) count','ut_matches_videos.Data'])
                ->leftJoin('ut_video_to_gallery','ut_video_to_gallery.VideogalleryID=ut_videogallery.VideogalleryID')
                ->leftJoin('ut_matches_videos','ut_matches_videos.VideoID=ut_video_to_gallery.VideoID')
                ->leftJoin('ut_matches_videos m1','m1.VideoID=ut_videogallery.PreviewID')
                ->where(['ut_videogallery.Active'=>1])
                //->andWhere(['TournamentID'=>$list['selected']])
                ->groupBy('ut_videogallery.VideogalleryID')   
                ->orderBy('ut_videogallery.Date DESC')
                ->asArray()->all();
        foreach ($galleryCount as $key => $value) {
            if($value['count']==0) unset($galleryCount[$key]);
        }
        $pagination = new \yii\data\Pagination(
        [
            'totalCount' => count($galleryCount),
            'pageSize' => self::$countPerPage,

        ]);

Picasso of PHP

By chernomorets, 2017-03-03 11:26:18
public static bool HasValues<T>(this ICollection<T> collection)
{
    if (collection == null)
    {
        return false;
    }
    if (collection.Count == 0)
    {
        return false;
    }
    return true;
}
By oskarnrk, 2017-12-12 16:49:43
date('Y-m-d').'T'.date("H:i:s", strtotime("- 1 hour")).'Z'

Back to the future

By loutre, 2018-12-19 15:37:45
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
function isAllowSearchLength(text) {
    return text.length > isNaN(parseInt(text, 10)) ? 1 : 0;
}
By Anonymous, 2018-01-24 12:02:46
in_array($this->market, ["ru"])

There is an old mysterious legend, which says that those conditions are lightening fast which are using in_array($source, ["target"]) instead of just "==". Is says always that probably you never do code refactoring, and keep all shit alive

By Anonymous, 2018-03-12 14:47:24
CREATE FUNCTION [dbo].[get_number_of_workers] 
(
     @number_of_workers varchar(10)
 
)
RETURNS int
AS
BEGIN
 
 
set @number_of_workers = replace(replace(replace(replace(LTRIM(RTRIM(@number_of_workers)), char(9), ''), char(10), ''), char(13),''), char(13)+char(10), '')
 
DECLARE @temp varchar(10)
 
SELECT
    @temp = number_of_workers 
FROM
    (SELECT LTRIM(RTRIM(@number_of_workers)) as number_of_workers) as temp
WHERE
       number_of_workers like  '[0-9]'
    or number_of_workers like  '[0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
     
     
RETURN CONVERT(INT, @temp)
 
END
By Anonymous, 2015-07-22 14:59:09
value unless value.select! { |v| v != "0" }.nil?

I don't not know no why not no one of my "predecessor" committed this shit.

By Penguin, 2018-08-09 04:37:29
$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
// TODO(as): MAKE XML DOXYGEN THING SO IDE WITH COLORS CAN READ THIS
package main

import (
	"os"
	"sync"

	_ "github.com/mailru/easyjson"
	_ "github.com/satori/go.uuid"
	_ "github.com/valyala/fasthttp"
)

func main() {
	sync.Once(func(){}())

	myMutexLockVariable := struct {
		IDontKnowHowEmbeddingWorks *sync.RWMutex // FOR SCALEABILITY
	}{
		func() *sync.RWMutex {
			return new(sync.RWMutex) // FACTORY PATTERN FACTORY PATTERN!
		}(),
	}
	
	lockthelock := func(){
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock()
	}
	unlockthelock := func(){
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock()
	}
	// TODO(as): THERE THEM FUNCTIORNS NO WORKY ABSTRACTION FOR SOME REASON
	// SO WE JUST CALL myMutexLockVariable.IDontKnowHowEmbeddingWorks FUNCTIONS
	// DIRECTLY THERE IS A BUG INSIDE OF THE GO PROGRAMMING LANGUAGE
	//
	// GO ISSUE NUMBER: 181393
	// Description: GO NO WORKY, I PUT FUNCTORS TO ACCESS MY LOCK AND IT DEAD LOCK
	// cc: bradfitz, ian lance taylor, rob pike, ken, even brian k
	lockthelock = lockthelock
	unlockthelock = unlockthelock
	    // I DONT WANNA DELETE FUNCY BECAUSE I WORK TOO HARD ON THEM WE KEEP IT FOR USE LATER WHEN GO FIXES BUG

	var err error
	if myMutexLockVariable.IDontKnowHowEmbeddingWorks == nil {
		panic("whoops, you forgot to put the pointer of the mutex!!!!!")
		os.Exit(0xbadc0de) // FOR SAFTEY
	}
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.RLock()
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock() // just grease the wheels a bit
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock()
	go func() {
		println("goroutine!")
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock()
	}()

	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Lock() // WAIT FOR BABY TO FINISH
	if &err != nil {
		myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock() // DO IT HERE FASTER THAN DEFUR
		main()
		os.Exit(0) // YAY
	}
	myMutexLockVariable.IDontKnowHowEmbeddingWorks.Unlock() // DO IT HERE FASTER THAN DEFUR
}

THIS CODE IS COVERED BY THE GNU AFFERO PUBIC LICENSE, DO NOT SHARE THIS CODE WITHOUT PUBLISHING ALL OF YOUR CHANGES. FREE SOFTWARE FREEEEEDOM!!!

TO SEE THE TEXINFO MANUAL IN EMACS, TYPE CONTROL X CLOVER CLOVER DOT 9

By github.com/as, 2019-10-18 19:26:43
int min(int a,int b,int c) //Function to return the minimum.
{
  if(a < b)
  {
    if(a < c)return a;
    else if(a > c)return c;
    else return a;
  }
  else if(a > b)
  {
    if(b < c)return b;
    else if(b > c)return c;
    else return b;
  }
  else
  {
    if(a < c) return a;
    else if(a > c) return c;
    else return a;
  }
}

This kind of things make me hate my work.

By Another random student of algorithms., 2017-12-14 00:45:52