Short description of method evalDifferent

@access public
@author firstname and lastname of author, <author@example.org>
@param  Literal first
@param  Literal second
@return boolean
431708
public function evalDifferent( core_kernel_classes_Literal $first,  core_kernel_classes_Literal $second)
    {
        $returnValue = (bool) false;

        
        if($first instanceof core_kernel_classes_Literal && $second instanceof core_kernel_classes_Literal)  {
    		$returnValue = $first->literal != $second->literal;
        }
        

        return (bool) $returnValue;
    }
1279352
function compareSpecificity(first, second) {
    for (var i = 0; i < first.length; i++) {
        var a = first[i];
        var b = second[i];

        if (a === b) {
            continue;
        }

        return a - b;
    }

    return 0;
}
8501
public function evaluateRecursiveOperation( core_kernel_classes_Literal $first,  core_kernel_classes_Literal $second,  core_kernel_classes_Resource $operator)
    {
        
        
        switch ($operator->getUri()) {
        	case RulesRdf::INSTANCE_OPERATOR_ADD: {
        		$returnValue = new core_kernel_classes_Literal($first->literal + $second->literal);
        		break;
        	}
             case RulesRdf::INSTANCE_OPERATOR_MINUS: {
        		$returnValue = new core_kernel_classes_Literal($first->literal - $second->literal);
        		break;
        	}
            case RulesRdf::INSTANCE_OPERATOR_MULTIPLY: {
        		$returnValue = new core_kernel_classes_Literal($first->literal * $second->literal);
        		break;
        	}
        	case RulesRdf::INSTANCE_OPERATOR_DIVISION: {
        		$returnValue = new core_kernel_classes_Literal($first->literal / $second->literal);
        		break;
        	}
        	case RulesRdf::INSTANCE_OPERATOR_CONCAT: {
        		// FIXME Hotfix for the concat operator. Can't find why traling spaces are not
        		// kept intact when using concat.
        		// ex: 'february ' CONCAT '2008' -> 'february2008' instead of 'february 2008'.
        		$returnValue = new core_kernel_classes_Literal($first->literal . ' ' . $second->literal);
        		break;
        	}
        	             	
        	default : {
        		throw new common_Exception('problem evaluating operation, operator do not match with operands');
        	}
        		
        }
        $returnValue->debug = __METHOD__;
        return $returnValue;
        
    }
1052660
function equals(first, second){

		//If are the same instance, true
		if (first === second)
			return true;
			
		//If values are equals, return true
		if (first == second)
			return true;
			
		//If different type, false
		if (typeof first != typeof second)
			return false;
			
		//If are not objects, check value
		if (typeof first != "object")
			return first == second;
			
		//For each property on first
		for (var current in first){
		
			//Get property value from each element
			var firstValue = first[current];
			var secondValue = second[current];
			
			//If current is object, invoke "Equals" on each 
			//member of the object; otherwise just check values
			var isEqual = (typeof firstValue === 'object') ? equals(firstValue, secondValue) : firstValue == secondValue;
			
			//If not equals, exit
			if (!isEqual)
				return false;
		}
		
		//Confirm
		return true;	
	}
511654
public static boolean isSecondNewerThanFirst(File first, File second) {
        boolean isSecondNewerThanFirst = false;
        // If file does not exist, it cannot be newer.
        if (second.exists()) {
            long firstLastModified = first.lastModified();
            long secondLastModified = second.lastModified();
            // 0L is returned if there was any error, so we check if both last
            // modification stamps are != 0L.
            if (firstLastModified != 0L && secondLastModified != 0L) {
                isSecondNewerThanFirst = secondLastModified > firstLastModified;
            }
        }
        return isSecondNewerThanFirst;
    }
1030833
function evaluateIdentifier(path) {
  if (!path.isReferencedIdentifier()) {
    throw new Error(`Expected ReferencedIdentifier. Got ${path.type}`);
  }

  const { node } = path;

  const binding = path.scope.getBinding(node.name);

  if (!binding) {
    const { name } = node;
    if (!name) {
      return deopt(path);
    }

    switch (name) {
      case "undefined":
        return { confident: true, value: undefined };
      case "NaN":
        return { confident: true, value: NaN };
      case "Infinity":
        return { confident: true, value: Infinity };
      default:
        return deopt(path);
    }
  }

  if (binding.constantViolations.length > 0) {
    return deopt(binding.path);
  }

  // referenced in a different scope - deopt
  if (shouldDeoptBasedOnScope(binding, path)) {
    return deopt(path);
  }

  // let/var/const referenced before init
  // or "var" referenced in an outer scope
  const flowEvalResult = evaluateBasedOnControlFlow(binding, path);

  if (flowEvalResult.confident) {
    return flowEvalResult;
  }

  if (flowEvalResult.shouldDeopt) {
    return deopt(path);
  }

  return path.evaluate();
}
395958
public function compareTo($other)
    {
        if ($other === null) {
            return false;
        }
        if (!($other instanceof VariableNode)) {
            return false;
        }

        return $this->getName() == $other->getName();
    }
545073
@VisibleForTesting
  static boolean isGreaterThanOrEqualTo(Version first, Version second) {
    if ((first.getMajor() > second.getMajor())
        || (first.getMajor() == second.getMajor() && first.getMinor() >= second.getMinor())) {
      return true;
    }
    return false;
  }
242586
public static function compare(Version $first, Version $second) : int
    {
        $obj = new self($first, $second);

        return $obj->doCompare();
    }
802835
public static function numberCmp($first, $second): int
	{
		return ($first - $second) ? (int) (($first - $second) / abs($first - $second)) : 0;
	}
126961
public function compare(\DateInterval $first, \DateInterval $second)
    {
        if ($this->safe) {
            $this->safecheck($first);
            $this->safecheck($second);
        }

        if ($first->y > $second->y) {
            return 1;
        }

        if ($first->y < $second->y) {
            return -1;
        }

        if ($first->m > $second->m) {
            return 1;
        }

        if ($first->m < $second->m) {
            return -1;
        }

        if ($first->d > $second->d) {
            return 1;
        }

        if ($first->d < $second->d) {
            return -1;
        }

        if ($first->h > $second->h) {
            return 1;
        }

        if ($first->h < $second->h) {
            return -1;
        }

        if ($first->i > $second->i) {
            return 1;
        }

        if ($first->i < $second->i) {
            return -1;
        }

        if ($first->s > $second->s) {
            return 1;
        }

        if ($first->s < $second->s) {
            return -1;
        }

        return 0;
    }
308928
public function evalEquals( core_kernel_classes_Literal $first,  core_kernel_classes_Literal $second)
    {
        $returnValue = (bool) false;

        
        if($first instanceof core_kernel_classes_Literal && $second instanceof core_kernel_classes_Literal)  {
    		$returnValue = $first->literal == $second->literal;
        }
        

        return (bool) $returnValue;
    }
1253846
def strip_literal(literal)
      literal = literal[1..-1] if literal[0] == ':'
      literal = literal[1..-2] if literal[0] == "'" || literal[0] == '"'
      literal
    end
1184337
private Term evalLang(Function term) {
		Term innerTerm = term.getTerm(0);

		// Create a default return constant: blank language with literal type.
		// TODO: avoid this constant wrapping thing
		Function emptyString = termFactory.getTypedTerm(
				termFactory.getConstantLiteral("", XSD.STRING), XSD.STRING);

        if (innerTerm instanceof Variable) {
            return term;
        }
		/*
		 * TODO: consider the case of constants
		 */
		if (!(innerTerm instanceof Function)) {
			return emptyString;
		}
		Function function = (Function) innerTerm;

		if (!function.isDataTypeFunction()) {
			return null;
		}

		Predicate predicate = function.getFunctionSymbol();
		if (predicate instanceof DatatypePredicate) {
			RDFDatatype datatype = ((DatatypePredicate) predicate).getReturnedType();

			return datatype.getLanguageTag()
					// TODO: avoid this constant wrapping thing
					.map(tag -> termFactory.getTypedTerm(
							termFactory.getConstantLiteral(tag.getFullString(), XSD.STRING),
							XSD.STRING))
					.orElse(emptyString);

		}
		return term;
	}
743503
public static <T> boolean isEqual(final T first, final T second) {
        /* test to see if they are both null, or both reference the same object */
        if (first == second) return true;

        if (first == null && second != null) return false;

        return first.equals(second);
    }
275701
boolean startsWith(final Literal literal) {

        // Check whether the answer is already in the cache
        final int index = literal.getIndex();
        final Boolean cached = myPrefixCache.get(index);
        if (cached != null) {
            return cached.booleanValue();
        }

        // Get the answer and cache the result
        final boolean result = literal.matches(myChars, 0);
        myPrefixCache.set(index, result);
        return result;
    }
186187
public final void literal() throws RecognitionException {
		int literal_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 61) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:587:5: ( integerLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | booleanLiteral | 'null' )
			int alt84=6;
			switch ( input.LA(1) ) {
			case DecimalLiteral:
			case HexLiteral:
			case OctalLiteral:
				{
				alt84=1;
				}
				break;
			case FloatingPointLiteral:
				{
				alt84=2;
				}
				break;
			case CharacterLiteral:
				{
				alt84=3;
				}
				break;
			case StringLiteral:
				{
				alt84=4;
				}
				break;
			case 82:
			case 115:
				{
				alt84=5;
				}
				break;
			case 98:
				{
				alt84=6;
				}
				break;
			default:
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 84, 0, input);
				throw nvae;
			}
			switch (alt84) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:587:9: integerLiteral
					{
					pushFollow(FOLLOW_integerLiteral_in_literal2150);
					integerLiteral();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:588:9: FloatingPointLiteral
					{
					match(input,FloatingPointLiteral,FOLLOW_FloatingPointLiteral_in_literal2160); if (state.failed) return;
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:589:9: CharacterLiteral
					{
					match(input,CharacterLiteral,FOLLOW_CharacterLiteral_in_literal2170); if (state.failed) return;
					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:590:9: StringLiteral
					{
					match(input,StringLiteral,FOLLOW_StringLiteral_in_literal2180); if (state.failed) return;
					}
					break;
				case 5 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:591:9: booleanLiteral
					{
					pushFollow(FOLLOW_booleanLiteral_in_literal2190);
					booleanLiteral();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 6 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:592:9: 'null'
					{
					match(input,98,FOLLOW_98_in_literal2200); if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 61, literal_StartIndex); }

		}
	}