private <T> Supplier<T> abort(Class<T> exception) {
  return () -> {
    try {
      return exception.newInstance();
    } catch (InstantiationException | IllegalAccessException e) {
      throw new RuntimeException(e);
    }
  };
}

...

throw abort(MyException.class).get();
By Anonymous, 2017-12-14 11:27:50
<?php
    if(isset($_POST['csrf'])){
        if($_POST['csrf'] !== $_SESSION['csrf']){
            return 'session expired!';
        }
    }

In all Sama Samaneh university and class management system from iran :)

By Mahmoud etc, 2017-12-14 11:21:23
$number = int(1);
By Richard Chipper, 2017-12-14 08:22:23
file = fopen(argv[1], "r");

if (file == NULL){}
    exit(EXIT_FAILURE);

Those silly curly braces.

By Anonymous, 2017-12-14 05:47:47
<?php

if ($_GET['csrfstopper'] !== 1){
    exit();
}

Please don't judge my friend trying to stop CSRF Attacks he's still learning.

By Lunorian, 2017-12-14 04:37:45
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
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
A,B=map(str,input().split())        # let's begin by casting strings to strings!

while(int(A)!=0 and int(B)!=0):

    tamanhoa=0
    tamanhob=0

    for i in range(len(A)):
        tamanhoa+=1                 # wonderful way to determine the length of
                                    # a string!
    for i in range(len(B)):
        tamanhob+=1

    vA = [0]*tamanhoa
    vB = [0]*tamanhob

    if tamanhoa>tamanhob:
        vA = [0]*tamanhoa           # Just to make sure it really gets set!!!
        vB = [0]*tamanhoa

        for i in range(tamanhoa-1,-1,-1):
            vA[i]=int(A[i])         # he even saved an operation by casting
                                    # the char to int at the same time!
        for i in range(tamanhob):
            vB[i+1]=int(B[i])
    elif tamanhoa<tamanhob:
        vA = [0]*tamanhob           # Just to make sure it really gets set!!!
        vB = [0]*tamanhob

        for i in range(tamanhoa):
            vA[i+1]=int(A[i])

        for i in range(tamanhob-1,-1,-1):
            vB[i]=int(B[i])

        tamanhoa=tamanhob

    else:
        for i in range(tamanhoa):
            vA[i]=int(A[i])

        for i in range(tamanhob):
            vB[i]=int(B[i])

    print(vA)
    print(vB)
    
    carry = 0

    for i in range(tamanhoa-1,-1,-1):
        soma = vA[i] + vB[i]
        if soma > 9:
            carry += 1
            if vA[i-1]!= 9:
                vA[i-1] += 1
            else:
                vB[i-1] +=1


    if carry == 0:
        print('No carry operation.')
    elif carry == 1:
        print(carry, 'carry operation.')
    else:
        print(carry, 'carry operations.')

    A,B=map(str,input().split())    # why bother casting strings to int? yay

    if int(A)==0 and int(B)==0:
        break

This wonder was found within answers to a university programming test. Code as-is, comments added by me.

By Anonymous, 2017-12-14 00:09:27
if (i === 1 || i === 2 || i === 3 || i === 4 || i === 5 || i === 6 || i === 7 || i === 8 || i === 9 || i === 10){
 return true;
}
By foxy, 2017-12-13 23:25:17
i++;
i++;
i++;
i++;
Console.WriteLine(i);

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

By Manoochehr Mojgani, 2017-12-13 21:46:04
int phoneNumberFinder(int phoneNum){
int num = 0;
   while (true){
    if(phoneNum == num){
     return num;
    else{
      num++;
    }
  }
}
By Neeson, 2017-12-13 21:33:52
int t;

if ((t > 1) && (t < 2))
{
    errorString = errorBuffer;
	return -1;
}
By Anonymous, 2017-12-13 19:42:08
s[strlen(s)] = '\0';
By Ulfalizer, 2017-12-13 19:17:36
sed -i 's/^#HTTPD=\/usr\/sbin\/httpd.worker/HTTPD=/\/usr\/sbin\/httpd.worker/g' /etc/sysconfig/httpd 
By Anonymous, 2017-12-13 18:09:51
if (botCount < botCount)
    this.reconnect();
}

My friend wrote this code recently

By Anonymous, 2017-12-13 17:47:25