try
{
len = readBufferSize(reader);
}
catch (IOException xcp)
{
throw xcp;
}
I swear I didn't omit a single symbol (except for tabs at the beginning)
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;
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='';
}
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;
}
filterForProvincia() {
console.log('ciao');
}
The last line of code of a parting Developer
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
<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...
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...
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())
}
# Create vpc peering connection
response = ec2.delete_vpc_peering_connection(peer_connection_id)
a part of AWS Landing Zone solution
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]);
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
if (!recruiters
.stream().map(UserData::getUserName).collect(Collectors.toList())
.contains(recruiter.getUserData().getUserName())) {
}
val weekEnd = DateTime.now.withDayOfWeek(5).plusDays(2)
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 ?