Reviewed vs. Native Jan 11, 2011
764324
protected void _initPathStartPoint() {
		_touch();
		if (m_moveToPoint == null)
			m_moveToPoint = new Point(m_description);
		else
			m_moveToPoint.assignVertexDescription(m_description);
	}
1133053
function postCompareFunc(a, b) {
  var sortType = option.get('sorttype');
  var diff = new Date(a.meta.pubdate) - new Date(b.meta.pubdate);
  return sortType === 'asc' ? diff : -diff;
}
121796
private int compareToVersionNumber(VersionIdentifier otherVersion) {

    // Example version: 1.2.3.4
    // Direct successors: 1.2.3.5 / 1.2.4[.0] / 1.3.[.0[.0]] / 2.[.0[.0[.0]]]
    // Direct predecessors: 1.2.3.3[.*]
    boolean equivalent = true;
    int result = 0;
    int maxSegmentCount = StrictMath.max(getVersionSegmentCount(), otherVersion.getVersionSegmentCount());
    for (int i = 0; i < maxSegmentCount; i++) {
      int segment = getVersionSegment(i);
      int otherSegment = otherVersion.getVersionSegment(i);
      if (segment != otherSegment) {
        int delta = segment - otherSegment;
        if (equivalent) {
          result = delta;
        } else {
          if (result == COMPARE_TO_STRICT_SUCCESSOR) {
            if (segment != 0) {
              result++;
              break;
            }
          } else if (result == COMPARE_TO_STRICT_PREDECESSOR) {
            if (otherSegment != 0) {
              result--;
              break;
            }
          }
        }
      }
    }
    return result;
  }
395116
function(a, b) {
		var self = elFinder.prototype.naturalCompare;
		if (typeof self.loc == 'undefined') {
			self.loc = (navigator.userLanguage || navigator.browserLanguage || navigator.language || 'en-US');
		}
		if (typeof self.sort == 'undefined') {
			if ('11'.localeCompare('2', self.loc, {numeric: true}) > 0) {
				// Native support
				if (window.Intl && window.Intl.Collator) {
					self.sort = new Intl.Collator(self.loc, {numeric: true}).compare;
				} else {
					self.sort = function(a, b) {
						return a.localeCompare(b, self.loc, {numeric: true});
					};
				}
			} else {
				/*
				 * Edited for elFinder (emulates localeCompare() by numeric) by Naoki Sawada aka nao-pon
				 */
				/*
				 * Huddle/javascript-natural-sort (https://github.com/Huddle/javascript-natural-sort)
				 */
				/*
				 * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license
				 * Author: Jim Palmer (based on chunking idea from Dave Koelle)
				 * http://opensource.org/licenses/mit-license.php
				 */
				self.sort = function(a, b) {
					var re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,
					sre = /(^[ ]*|[ ]*$)/g,
					dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,
					hre = /^0x[0-9a-f]+$/i,
					ore = /^0/,
					syre = /^[\x01\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/, // symbol first - (Naoki Sawada)
					i = function(s) { return self.sort.insensitive && (''+s).toLowerCase() || ''+s; },
					// convert all to strings strip whitespace
					// first character is "_", it's smallest - (Naoki Sawada)
					x = i(a).replace(sre, '').replace(/^_/, "\x01") || '',
					y = i(b).replace(sre, '').replace(/^_/, "\x01") || '',
					// chunk/tokenize
					xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
					yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
					// numeric, hex or date detection
					xD = parseInt(x.match(hre)) || (xN.length != 1 && x.match(dre) && Date.parse(x)),
					yD = parseInt(y.match(hre)) || xD && y.match(dre) && Date.parse(y) || null,
					oFxNcL, oFyNcL,
					locRes = 0;

					// first try and sort Hex codes or Dates
					if (yD) {
						if ( xD < yD ) return -1;
						else if ( xD > yD ) return 1;
					}
					// natural sorting through split numeric strings and default strings
					for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {

						// find floats not starting with '0', string or 0 if not defined (Clint Priest)
						oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
						oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;

						// handle numeric vs string comparison - number < string - (Kyle Adams)
						// but symbol first < number - (Naoki Sawada)
						if (isNaN(oFxNcL) !== isNaN(oFyNcL)) {
							if (isNaN(oFxNcL) && (typeof oFxNcL !== 'string' || ! oFxNcL.match(syre))) {
								return 1;
							} else if (typeof oFyNcL !== 'string' || ! oFyNcL.match(syre)) {
								return -1;
							}
						}

						// use decimal number comparison if either value is string zero
						if (parseInt(oFxNcL, 10) === 0) oFxNcL = 0;
						if (parseInt(oFyNcL, 10) === 0) oFyNcL = 0;

						// rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
						if (typeof oFxNcL !== typeof oFyNcL) {
							oFxNcL += '';
							oFyNcL += '';
						}

						// use locale sensitive sort for strings when case insensitive
						// note: localeCompare interleaves uppercase with lowercase (e.g. A,a,B,b)
						if (self.sort.insensitive && typeof oFxNcL === 'string' && typeof oFyNcL === 'string') {
							locRes = oFxNcL.localeCompare(oFyNcL, self.loc);
							if (locRes !== 0) return locRes;
						}

						if (oFxNcL < oFyNcL) return -1;
						if (oFxNcL > oFyNcL) return 1;
					}
					return 0;
				};
				self.sort.insensitive = true;
			}
		}
		return self.sort(a, b);
	}
1168777
function resolve() {
  return whichNativeNodish('..')
    .then(function (results) {
      var nwVersion = results.nwVersion;
      var asVersion = results.asVersion;

      debug('which-native-nodish output: %j', results);

      var prefix = '';
      var target = '';
      var debugArg = process.env.BUILD_DEBUG ? ' --debug' : '';
      var builder = 'node-gyp';
      var distUrl = '';

      if (asVersion) {
        prefix = (process.platform === 'win32' ?
          'SET USERPROFILE=%USERPROFILE%\\.electron-gyp&&' :
          'HOME=~/.electron-gyp');

        target = '--target=' + asVersion;
        distUrl = '--dist-url=https://atom.io/download/atom-shell';
      }
      else if (nwVersion) {
        builder = 'nw-gyp';
        target = '--target=' + nwVersion;
      }

      builder = '"' + path.resolve(__dirname, '..', 'node_modules', '.bin', builder) + '"';

      return [prefix, builder, 'rebuild', target, debugArg, distUrl]
        .join(' ').trim();
    });
}
798613
function Input(native) {
    EventEmitter.call(this);
    this.native = native;

    this.id = native.id;
    this.manufacturer = native.manufacturer;
    this.name = native.name;
    this.version = native.version;

    native.onmidimessage = function (event) {
        var data, type, object;

        data = new BufferCursor(new buffer.Buffer(event.data));
        type = data.readUInt8();

        object = parseChannelEvent(
            event.receivedTime,
            type >> 4,
            type & 0xF,
            data
        );

        this.emit('event', object);
    }.bind(this);
}
1153455
def method_missing(cmd, options={}, *args, &block)
      native(cmd, options, *args, &block)
    end
669983
public function compare(PageVersion $new, PageVersion $old)
    {
        if ($new->getRestoredVersionId()) {
            return new Diff\RestoredVersion($new, $old);
        }

        if ($new->isContentChange()) {
            return new Diff\ChunkChange($new, $old);
        }

        if ($new->getTemplateId() !== $old->getTemplateId()) {
            return new Diff\TemplateChange($new, $old);
        }

        if (strcmp($new->getTitle(), $old->getTitle()) !== 0) {
            return new Diff\TitleChange($new, $old);
        }

        if ($new->isPendingApproval() && !$old->isPendingApproval()) {
            return new Diff\ApprovalRequest($new, $old);
        }

        if ($new->isEmbargoed($new->getEditedTime())) {
            if (!$old->isEmbargoed($old->getEditedTime())) {
                return new Diff\Embargoed($new, $old);
            }

            if ($new->getEmbargoedUntil()->getTimestamp() !== $old->getEmbargoedUntil()->getTimestamp()) {
                return new Diff\EmbargoChanged($new, $old);
            }
        }

        if ($new->isPublished($new->getEditedTime())) {
            if (!$old->isPublished($old->getEditedTime())) {
                return new Diff\Published($new, $old);
            }
        }
    }
209877
@Override
    public int compareTo(ZonalTransition other) {

        long delta = (this.posix - other.posix);

        if (delta == 0) {
            delta = (this.previous - other.previous);
            if (delta == 0) {
                delta = (this.total - other.total);
                if (delta == 0) {
                    delta = (this.getDaylightSavingOffset() - other.getDaylightSavingOffset());
                    if (delta == 0) {
                        return 0;
                    }
                }
            }
        }

        return ((delta < 0) ? -1 : 1);

    }
1035929
def native(self):
        

        if self.contents is None:
            return None

        if self._native is None:
            self._native = self._map[self.__int__()]
        return self._native
27752
def isNewerThan(self, other):
        
        if self.getValue("name") == other.getValue("name"):
            if other.getValue("version"):
                if not other.getValue("version"):
                    return False
                else:
                    return LooseVersion(self.getValue("version")) > LooseVersion(other.getValue("version"))
            else:
                return True
        else:
            return False
1339181
function compareVersion(version, range) {
        var string = (range + '');
        var n = +(string.match(/\d+/) || NaN);
        var op = string.match(/^[<>]=?|/)[0];
        return comparator[op] ? comparator[op](version, n) : (version == n || n !== n);
    }
916918
function compareByIdThenRev(a, b) {
  var idCompare = compare(a._id, b._id);
  if (idCompare !== 0) {
    return idCompare;
  }
  var aStart = a._revisions ? a._revisions.start : 0;
  var bStart = b._revisions ? b._revisions.start : 0;
  return compare(aStart, bStart);
}
750582
function reviewsById(state = {}, action) {
  switch (action.type) {
    case RECEIVE_PRODUCT_REVIEWS:
    case RECEIVE_REVIEWS: {
      const nextReviews = action.reviews || [];
      return nextReviews.reduce((currentReviews, review) => ({
        ...currentReviews,
        [review.id]: review,
      }), state);
    }
    case RECEIVE_SUBMIT_REVIEW:
    case RECEIVE_USER_REVIEW:
      return {
        ...state,
        [action.review.id]: action.review,
      };
    default:
      return state;
  }
}
132624
private function checkLocale()
    {
        if (!isset($this->locales[$this->selectLocale])) {
            // pokud neexistuje jazky hleda v aliasech
            if (isset($this->aliasLocale[$this->selectLocale])) {
                $this->selectLocale = $this->aliasLocale[$this->selectLocale];
            } else {
                $this->selectLocale = $this->defaultLocale;
            }
        }
    }
322276
function callNative (instanceId, tasks, callbackId) {
  let calls = []
  if (typeof tasks === 'string') {
    try {
      calls = JSON.parse(tasks)
    }
    catch (e) {
      console.error('invalid tasks:', tasks)
    }
  }
  else if (isArray(tasks)) {
    calls = tasks
  }
  const len = calls.length
  calls[len - 1].callbackId = (!callbackId && callbackId !== 0)
                              ? -1
                              : callbackId
  for (let i = 0; i < len; i++) {
    processCall(instanceId, calls[i])
  }
}
660409
@Override
    public boolean printNative(Appendable app, int indentLevel, FilterValues<S> values)
        throws IOException
    {
        return mExecutor.printNative(app, indentLevel, values);
    }