try
{
    len = readBufferSize(reader);
}
catch (IOException xcp)
{
    throw xcp;
}

I swear I didn't omit a single symbol (except for tabs at the beginning)

By RusAD, 2019-07-18 09:24:10
FOR x IN ( SELECT COUNT(*) cnt
            FROM DUAL
           WHERE EXISTS ( SELECT NULL FROM task
                           WHERE task.task_type_id = lib.task_type_check()
                             AND task.task_status_id = lib.task_status_open()
                             AND task.unit_id = in_unit_id
                             AND task.station_id = v_station_id
                        )
         )
LOOP
  IF( x.cnt = 1 ) THEN
    v_task_exist := TRUE;
  ELSE
    v_task_exist := FALSE;
  END IF;
END LOOP;
By Anonymous, 2019-08-01 15:25:36
function resetfields_simple()
{
	pole1=document.getElementById('dataOd');
	pole1.value='';
	pole2=document.getElementById('dataDo');
	pole2.value='';
	pole3=document.getElementById('trescKom');
	pole3.value='';	
	pole4=document.getElementById('katId');
	pole4.value='';	
}

function resetfields()
{
	pole1=document.getElementById('dataOd');
	pole1.value='';
	pole2=document.getElementById('dataDo');
	pole2.value='';
	pole3=document.getElementById('trescKom');
	pole3.value='';	
	pole4=document.getElementById('dokId');
	pole4.value='';	
	pole5=document.getElementById('katId');
	pole5.value='';	
	pole6=document.getElementById('currId');
	pole6.value='';		
}

function resetfields_arch()
{
	pole1=document.getElementById('dataOd');
	pole1.value='';
	pole2=document.getElementById('dataDo');
	pole2.value='';
	pole3=document.getElementById('trescKom');
	pole3.value='';	
	pole4=document.getElementById('dokId');
	pole4.value='';	
	pole5=document.getElementById('katId');
	pole5.value='';	
}
By javascriptowiec, 2020-06-30 21:29:57
        public static bool ValidateEmailAddress(string emailAddress)
        {
            string pattern = "^((?>[a-zA-Z\\d!#$%&'*+\\-/=?^_`{|}~]+\x20*|\"((?=[\x01-\x7f])[^\"\\]|\\[\x01-\x7f])*\"\x20*)*(?<angle><))?((?!\\.)(?>\\.?[a-zA-Z\\d!#$%&'*+\\-/=?^_`{|}~]+)+|\"((?=[\x01-\x7f])[^\"\\]|\\[\x01-\x7f])*\")@(((?!-)[a-zA-Z\\d\\-]+(?<!-)\\.)+[a-zA-Z]{2,}|\\[(((?(?<!\\[)\\.)(25[0-5]|2[0-4]\\d|[01]?\\d?\\d)){4}|[a-zA-Z\\d\\-]*[a-zA-Z\\d]:((?=[\x01-\x7f])[^\\\\[\\]]|\\[\x01-\x7f])+)\\])(?(angle)>)$";

            if (!String.IsNullOrEmpty(emailAddress) && !(Regex.Match(emailAddress.Trim(), pattern, RegexOptions.IgnoreCase)).Success)
            {
                return false;
            }
            return true;
        }
By Anonymous, 2019-07-17 23:47:20
 filterForProvincia() {
    console.log('ciao');
 }

The last line of code of a parting Developer

By Anonymous, 2019-07-23 11:31:51
public class CustomBoolean {

    private Container<java.lang.Boolean> booleanContainer;

    public CustomBoolean(Container<Boolean> booleanContainer) {
        CustomBoolean custom_boolean = getThis();
        custom_boolean.booleanContainer = booleanContainer;
    }

    private <T extends Object> T getThis() {
        return (T) (Object) (T) this;
    }

    public Container<Boolean> getBooleanContainer() {
        return booleanContainer;
    }

    public static CustomBoolean create(Boolean value) {
        return new CustomBoolean(Container.builder().setValue(true).build());
    }

    public static void main(String[] args) {
        System.out.println(CustomBoolean.create(Boolean.TRUE).getBooleanContainer().getObject());
    }

    public static class Container<T extends Object> {

        private T object = null;

        private Container(T object) {
            Container<T> _this = getThis();
            _this.object = (T) (Object) object;
        }

        private <T extends Object> T getThis() {
            return (T) (Object) (T) this;
        }

        public static Builder builder() {
            return new Builder();
        }

        public T getObject() {
            return object;
        }

        public static class Builder<T extends Object> {
            private T value;

            public Builder<T> setValue(T value) {
                Container<T> _this = getThis();
                _this.object = (T) (Object) value;
                return this;
            }

            private <T extends Object> T getThis() {
                return (T) (Object) (T) this;
            }

            public Container build() {
                return new Container(value);
            }
        }
    }
} // Dort#0001

trolled

By Dort, 2022-03-24 21:41:54
<h1 className="sidebar-text">
	<h1 className="sidebar-text">My Applauses</h1>
</h1>

How do you even miss this... the Console will literally complain in red to you...

By Mr Verster, 2022-04-07 16:53:40
 const configs = {
    employeeObject: {
      // tab 0
      firstName: "",
      middleName: "",
      nickname: "",
      lastName: "",
      gender: "",
      race: "",
      title: "",
      dob: "",
      employeeIDNo: "",
      // tab 1
      userName: "",
      permissionRole: 0,
      employeeNo: "",
      phoneExt: "",
      startDate: "",
      company: "",
      division: "",
      jobDescription: "",
      businessUnit: "",
      regionId: "",
      participantStatus: "",
      costCentre: "",
      personType: "",
      comments: "",
      // tab 2
      phone1: "",
      phone2: "",
      phone3: "",
      address1: "",
      address2: "",
      address3: "",
      address4: "",
      postalCode: "",
      email: "",
    },

Why add another object with a title when you can just add a comment saying... well... nothing really...

By Mr Verster, 2022-04-08 14:19:12
func runAnsible(c *cli.Context) {
    runAnsibleCmd1(c.String("command"), c.StringSlice("var-file"), c.StringSlice("var"))
}
func runAnsibleCmd1(cmd string, varfiles []string, varstrs []string) {
    runAnsibleCmd2(cmd, util.ToVars(varfiles, varstrs))
}
func runAnsibleCmd2(cmd string, vars map[string]interface{}) {
    err := exec.SyscallExecute(cmd, vars)
    log.Error("Error running ansible command.", "err", err.Error())
}
By PANDUDH, 2019-04-16 18:03:41
# Create vpc peering connection
response = ec2.delete_vpc_peering_connection(peer_connection_id)

a part of AWS Landing Zone solution

By Amazon Solutions, 2019-07-10 12:49:42
if(typeof(sortOrder) != "boolean"){        
    return items;
}
filtered.sort(function (a, b) {
    if(sortOrder == true){
        return (CustomOrder(a.status) > CustomOrder(b.status) ? 1 : -1);
    }
    else if(sortOrder == false){
        return (CustomOrder(a.status) < CustomOrder(b.status) ? 1 : -1);
    }
});

The status property is a string ("Started", "Running", "Failed", "Finished", etc.), and CustomOrder is a function with a switch that just returns a predefined integer for each string. I switched CustomOrder to just be a simple lookup table object, and the sort call was changed to filtered.sort((a, b) => CustomOrder[a.status] - CustomOrder[b.status]);

By Anonymous, 2017-12-13 00:06:25
#411 C# +11
if (date.Training != null)
            {
                var training = date.Training;
                var status = new TrainingStatus();
                var refresher = new Training();

                if (training.Trainings != null)
                    refresher = training.Trainings;

                bool hasTakenRefresher = false;
                status.Value = date.Date.AddDays(
                    TrainingHelper.CalculateValidityDays(training.Validity ?? 0, training.ValidityType ?? 0));

                status.Name = training.TrainingName;
                status.ID = training.TrainingID;
                status.Category = training.CategoryTraining != null ? training.CategoryTraining.Name : "Other";
                status.IsTrained = _validityUtilsService.IsValid(training, date.Date);

                if (status.IsTrained)
                {
                    status.IsExpiring = _validityUtilsService.IsExpiring(training, date.Date,
                                            TrainingHelper.CalculateValidityDays(
                                                training.ExpirationWarningValidity ?? 0,
                                                training.ExpirationWarningValidityType ?? 0));
                }

                if (refresher.ID != 0)
                {
                    hasTakenRefresher = employee.Dates
                        .Count(x => x.Training != null
                            && x.TrainingID == refresher.ID) > 1;

                    if (hasTakenRefresher && (status.IsExpiring || !status.IsTrained))
                    {
                        status.IsExpiring = false;
                        var trainingWithNewValidity = new Training();

                        status.Value = date.Date.AddDays(
                            TrainingHelper.CalculateValidityDays(training.ValidityRefresher ?? 0,
                                training.ValidityRefresherType ?? 0));

                        trainingWithNewValidity.Validity = training.ValidityRefresher;
                        trainingWithNewValidity.ValidityType = training.ValidityRefresherType;
                        status.IsTrained = _validityUtilsService.IsValid(trainingWithNewValidity, date.Date);

                        if (status.IsTrained)
                        {
                            status.IsExpiring = _validityUtilsService.IsExpiring(trainingWithNewValidity, date.Date,
                                TrainingHelper.CalculateValidityDays(
                                    refresher.ExpirationWarningValidity ?? 0,
                                    refresher.ExpirationWarningValidityType ?? 0));
                        }
                    }
                }

                if (status.IsTrained && !status.IsExpiring)
                    status.Status = TrainingStatuses.Trained;
                else if (status.IsTrained && status.IsExpiring)
                    status.Status = TrainingStatuses.Expiring;
                else if (!status.IsTrained && !status.IsExpiring)
                    status.Status = TrainingStatuses.Expired;

                status.EmpID = employee.ID;

                return status;
            }

test

By NN, 2019-10-29 12:59:14
    if (!recruiters
                    .stream().map(UserData::getUserName).collect(Collectors.toList())
                    .contains(recruiter.getUserData().getUserName())) {
    }
By somebody11, 2022-03-11 09:56:35
val weekEnd = DateTime.now.withDayOfWeek(5).plusDays(2)
By Anonymous, 2017-12-22 13:55:37
SELECT 
	tblPosts.idPost,
	tblPosts.postTitle, 
	tblPosts.postCode, 
	tblPostsStatus.scsTitle, 
	concat(code, '<br>', pTitle) AS pTitle, (CASE WHEN postResult = 1 THEN 'yes' ELSE 'no' END) AS postResult , 
	concat(date_format(postStartedDate, '%d.%m.%Y'), '<br>', date_format(postStartedDate, '%H:%i')) AS dateStart, 
	date_format(tblPosts.updated_at, '%d.%m.%Y %H:%i') AS dtUpdated, tblPerson.mobile, tblPerson.mail, tblPerson.isoLang, tblPostsReason.surname, 
	concat(coalesce(clientFName, ''), ' ', coalesce(clientName, '')) AS client, 
	concat(coalesce(concat(tblGender.gender, ' '), ''), coalesce(eFName, ''), ' ', coalesce(eName, '')) AS pers, 
	(CASE WHEN tblPosts.idCollab is NULLTHEN '' ELSE concat(coalesce(tblCol.cFName, ''), ' ', coalesce(tblCol.cName, '')) END) AS starter, 
	concat("<img src='img/status_", tblPosts.status, ".png' height='12px' border='1' />") AS displaystat,
	concat("<a href='index.php?arg=posts&id=", tblPosts.idPost, "&idAccess=", coalesce(tblAccess.idAccess, ''), "' title='Prepare Interface'><img src='../DG/styles/flat/images/edit.gif' style='height:14px; width:32px;' border='0'></a>") AS elink, 
	concat("<a href='email.php?frame=1&idPost=", tblPosts.idPost, "&source=PERS&idSrc=", tblPerson.idPerson, "&lang=", tblPerson.isoLang, "&from=", ";;SENDER", "&to=", tblPerson.persMail, "&idTperslate=CLI_diff_joindre_can,PERS_demande_contact,PERS_demande_CV&title=", replace(replace(replace(coalesce(pTitle, ''), "'", ";;APO"), "(", ";;PLT"), ")", ";;PGT"), "' title='", concat(coalesce(persName, ''), ' ', coalesce(persFname, '')), "' class='fancybox fancybox.iframe'><img src='img/email.png' height='12px' border='1' title='Messages' ></a>") AS mailink, 
	concat("<a href='post_email.php?frame=1&op=resend&idPosts=", tblPosts.idPost, "&idPerson=", tblPerson.idPerson, "&lang=", tblPerson.isoLang, "&idAccess=", coalesce(tblAccess.idAccess, ''), "&title=", replace(replace(replace(coalesce(pTitle, ''), "'", ";;APO"), "(", ";;PLT"), ")", ";;PGT"), "' title='", concat(coalesce(perName, ''), ' ', coalesce(perFName, '')), "' class='fancybox fancybox.iframe'><img src='img/emailNew.png' height='12px' border=1 title='New Posts' ></a>") AS newlink, 
	concat("<a href='comment.php?idPosts=", tblPosts.idPost, "&idPostsElem=-1&idClient=", tblPosts.idClient, "&frame=1&title=", replace(replace(replace(pTitle, "'", ";;APO"), "(", ";;PLT"), ")", ";;PGT"), "' title='", concat(coalesce(persName, ''), ' ', coalesce(persFName, '')), "' class='fancyboxstepreload fancybox.iframe'><div id='divBadgeComm", tblPosts.idPost, "' class='divBadge'>", (select count(*) from tblComment where idPosts=tblPosts.idPost and idElem is NULLand visibleClient=1), "</div><img src='img/comment.png' height='12px' border='1' title='Comments' /></a>") AS comments, 
	concat("<a href='docs.php?frame=1&idPosts=", tblPosts.idPost, "&title=", replace(replace(replace(pTitle, "'", ";;APO"), "(", ";;PLT"), ")", ";;PGT"), "' title='", concat(coalesce(persName, ''), ' ', coalesce(persFname, '')), "' class='fancyboxstep fancybox.iframe'><div id='divBadgeDocument", tblPosts.idPost, "' class='divBadge'>", (select count(*) from tblDocs where idPosts=tblPosts.idPost and docFileName <> '' and status=1), "</div><img src='img/dir.png' height='12px' border='1' title='Docs' /></a>") AS documents, 
FROM tblPosts
-- lots of LEFT JOIN
WHERE 1;

Maybe he didn't know how to do it in PHP ?

By Not a real programmer, 2018-07-10 11:03:17