Also, ASK nur setzen wenn ich hoch komme?
runter: true-> first;  false second;
hoch: true-> nextSecond; false-> nextUP
337750
private QueryTerm findNext() {
		//Walk down first branch
		if (askFirstA[askFirstD]) {
			while (currentNode.firstTerm() == null) {
				//remember that we already walked down the first branch
				askFirstD++;
				currentNode = currentNode.firstNode();
			}
			askFirstA[askFirstD] = false;
			return currentNode.firstTerm();
		} 

		//do we have a second branch?
		if (currentNode.isUnary()) {
			return findUpwards();
		}

		//walk down second branch
		if (currentNode.secondTerm() != null) {
			//dirty hack
			if (currentNode.secondTerm() != nextElement) {
				return currentNode.secondTerm();
			}
			//else: we have been here before!
			//walk back up
			return findUpwards();
		} else {
			currentNode = currentNode.secondNode();
			askFirstD++;
			return findNext();
		}
	}
1029322
protected function setZero()
	{
	    if (false === $this->boolAllowReset)
	    {
	        return ;
	    }
	    $intCID = preg_replace('@\D@', '', \Input::get('zid')); //  only digits 
	    if ($intCID>0) 
	    {
	        // mal sehen ob ein Startdatum gesetzt war
    	    $objVisitorsDate = \Database::getInstance()
    	            ->prepare("SELECT 
                                    visitors_startdate 
                                FROM 
                                    tl_visitors 
                                WHERE 
                                    id=?")
                    ->execute($intCID);
    	    $objVisitorsDate->next();
    	    if (0 < (int)$objVisitorsDate->visitors_startdate) 
    	    {
    	        // ok es war eins gesetzt, dann setzen wir es wieder
                \Database::getInstance()
                        ->prepare("UPDATE tl_visitors 
                                    SET 
                                        tstamp=?, 
                                        visitors_startdate=? 
                                    WHERE 
                                        id=?")
                        ->execute( time(), strtotime(date('Y-m-d')), $intCID );
    	    }
    	    // und nun die eigendlichen counter
    	    \Database::getInstance()
    	            ->prepare("DELETE FROM tl_visitors_counter WHERE vid=?")
                    ->execute($intCID);
            \Database::getInstance()
                    ->prepare("DELETE FROM tl_visitors_blocker WHERE vid=?")
                    ->execute($intCID);
            \Database::getInstance()
                    ->prepare("DELETE FROM tl_visitors_browser WHERE vid=?")
                    ->execute($intCID);
            \Database::getInstance()
                    ->prepare("DELETE FROM tl_visitors_pages WHERE vid=?")
                    ->execute($intCID);
            \Database::getInstance()
                    ->prepare("DELETE FROM tl_visitors_screen_counter WHERE vid=?")
                    ->execute($intCID);
	    }
	    return ;
	}
165979
private void prepareNext()
    {
        hasNext = false;
        while (iterator.hasNext())
        {
            next = iterator.next();
            if (predicate.test(next))
            {
                hasNext = true;
                break;
            }
        }
    }
821391
@Override
    public void nextState(PHATInterface phatInterface) {
        switch (state) {
            case NOT_INIT:
                initState(phatInterface);
                setState(STATE.STARTED);
                break;
            case STARTED:
                if(isFinished(phatInterface)) {
                    setState(FINISHED);
                } else {
                    simpleNextState(phatInterface);
                }
                break;
            case FINISHED:
                break;
            case INTERRUPTED:
                if (finishCondition != null) {
                    finishCondition.automatonInterrupted(this);
                }
                interrupt(phatInterface);
                break;
            case RESUMED:
                if (finishCondition != null) {
                    finishCondition.automatonResumed(this);
                }
                resume(phatInterface);
                setState(STATE.STARTED);
                break;
        }    
    }
391041
@Override
    public boolean propagateValue(String destPath, String valueString, boolean tryToCreate, boolean allowOverwrite) {
        boolean ret = false;

        // wenn dieses de gemeint ist
        if (destPath.equals(getPath())) {
            if (this.value != null) { // es gibt schon einen Wert
                if (!allowOverwrite) { // überschreiben ist nicht erlaubt
                    throw new OverwriteException(getPath(), value.toString(), valueString);
                }
            }

            setValue(valueString);
            ret = true;
        }

        return ret;
    }
1131154
function first(FIRST, rule) {
  var terminals = new Set();
  var read = true;
  var _iteratorNormalCompletion = true;
  var _didIteratorError = false;
  var _iteratorError = undefined;

  try {
    for (var _iterator = rule[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
      var x = _step.value;
      if (!read) break;
      read = false;

      if (x.type === 'leaf') {
        terminals.add(x.terminal);
        break;
      }

      (0, _util.setaddall)(terminals, (0, _jsItertools.filter)(function (y) {
        return y !== _grammar.EW;
      }, FIRST.get(x.nonterminal)));
      read |= (0, _jsItertools.any)((0, _jsItertools.map)(function (y) {
        return y === _grammar.EW;
      }, FIRST.get(x.nonterminal)));
    }
  } catch (err) {
    _didIteratorError = true;
    _iteratorError = err;
  } finally {
    try {
      if (!_iteratorNormalCompletion && _iterator.return != null) {
        _iterator.return();
      }
    } finally {
      if (_didIteratorError) {
        throw _iteratorError;
      }
    }
  }

  if (read) terminals.add(_grammar.EW);
  return terminals;
}
519564
function nextup(inst, orig, argv, event, cb) {
    return function nextupCallback(err, data) {
        if (err) return cb(err, null);
        if (_isQuoted(data)) return cb(null, _unquote(data));
        if (_isValue(data)) return cb(null, _entityToValue(data, inst.library));
        // Remove any nulls or undefineds from the list
        var compact = _compactList(data);
        // Allow the programmer to opt out for _minor_ perf gains
        if (inst.options.doIrreducibleListCheck) {
            // If no change, we'll keep looping forever, so just return
            if (IsEqual(orig, compact)) {
                Console.printWarning(inst, 'Detected irreducible list; exiting...');
                return cb(null, compact);
            }
        }
        return exec(inst, compact, argv, event, cb);
    };
}
285604
function $and( first ){
        return first.next ? function( thing ){
            var fn = first;
            while ( fn ){

                if ( !fn( thing ) ){
                    return false;
                }
                fn = fn.next;
            }
            return true;
        } : first;
    }
1112878
function future (run) {

  var result,
      resolve_listeners = [],
      reject_listeners = [],
      is_resolving = false,
      is_fullfilled = false,
      is_rejected = false,
      is_uncaught = true

  var promise = {
    then: function (onFulfilled, onRejected) {

      if( onRejected instanceof Function ) is_uncaught = false

      if( is_fullfilled && typeof onFulfilled !== 'function' ) return resolvedFuture(result)

      if( is_rejected && typeof onRejected !== 'function' ) return rejectedFuture(result)

      var _promise = future(function (_resolve, _reject) {

        var _onFulfilled = onFulfilled instanceof Function ? function (_result) {

            // nextTick( _resolveThen(_promise, onFulfilled, _result, _resolve, _reject) );

            nextTick(function () {
              try {
                _resolvePromise(_promise, onFulfilled(_result), _resolve, _reject )
              } catch(_reason) {
                _reject(_reason)
              }

              // _resolvePromise(_promise, { then: function (_complete) {
              //   if( is_completed ) return;
              //   is_completed = true;
              //   // var value = onFulfilled(_result);
              //   // if( value === promise ) console.log('TypeError promise'); // eslint-disable-line
              //   // if( value === _promise ) console.log('TypeError _promise'); // eslint-disable-line
              //   _complete( onFulfilled(_result) );
              // } }, _resolve, _reject );
            })

          } : _resolve

        var _onRejected = onRejected instanceof Function ? function (_result) {

            // nextTick( _resolveThen(_promise, onRejected, _result, _resolve, _reject) );

            nextTick(function () {
              try {
                _resolvePromise(_promise, onRejected(_result), _resolve, _reject )
              } catch(_reason) {
                _reject(_reason)
              }
              // _resolvePromise(_promise, { then: function (_complete) {
              //   if( is_completed ) return;
              //   is_completed = true;
              //   _complete( onRejected(_result) );
              // } }, _resolve, _reject );
            })

          } : _reject

        if( is_fullfilled ) _onFulfilled(result)
        else if( is_rejected ) _onRejected(result)
        else {
          resolve_listeners.push(_onFulfilled)
          reject_listeners.push(_onRejected)
        }

      })

      return _promise
    },
    catch: function (onReject) {
      return promise.then(null, onReject)
    },
  }

  var resolve = function (value) {
    if( is_resolving ) return

    is_resolving = true
    _resolvePromise(promise, value, function (_result) {

      is_fullfilled = true
      result = _result

      nextTick( _runQueue( resolve_listeners, result ) )
      reject_listeners.splice()
    }, reject)
  }

  var reject = function (reason) {
    if( is_resolving || is_fullfilled || is_rejected ) return

    is_resolving = true
    is_rejected = true
    result = reason

    nextTick( _runQueue( reject_listeners, result, is_uncaught ) )
    resolve_listeners.splice()
  }

  try{
    // run.call(promise, resolve, reject);
    run(resolve, reject)
  } catch(_reason) {
    reject(_reason)
  }

  return promise

}
356328
boolean precedes(final String s1, final String s2) {
    String symbol1 = s1.toLowerCase(Locale.ENGLISH);
    String symbol2 = s2.toLowerCase(Locale.ENGLISH);

    if (!precedenceMap.keySet().contains(symbol1)) {
      return false;
    }

    if (!precedenceMap.keySet().contains(symbol2)) {
      return false;
    }

    int index1 = ((Integer) precedenceMap.get(symbol1)).intValue();
    int index2 = ((Integer) precedenceMap.get(symbol2)).intValue();

    boolean precedesResult = (index1 < index2);

    return precedesResult;
  }
1132077
public boolean propagateValue(String destPath, String value, boolean tryToCreate, boolean allowOverwrite) {
        boolean ret = false;

        if (destPath.equals(getPath())) {
            if (value != null && value.equals("requested"))
                this.haveRequestTag = true;
            else
                throw new HBCI_Exception(HBCIUtils.getLocMsg("EXCMSG_INVVALUE", new Object[]{destPath, value}));
            ret = true;
        } else {
            // damit überspringen wir gleich elemente, bei denen es mit
            // sicherheit nicht funktionieren kann
            if (destPath.startsWith(getPath())) {
                for (MultipleSyntaxElements l : childContainers) {
                    if (l.propagateValue(destPath, value, tryToCreate, allowOverwrite)) {
                        ret = true;
                        break;
                    }
                }

                if (!ret && tryToCreate) {
                    // der Wert konnte nicht gesetzt werden -> möglicherweise
                    // existiert ja nur der entsprechende child-container noch
                    // nicht
                    log.trace(getPath() + ": could not set value for " + destPath);

                    // Namen des fehlenden Elementes ermitteln
                    String subPath = destPath.substring(getPath().length() + 1);
                    log.trace("  subpath is " + subPath);
                    int dotPos = subPath.indexOf('.');
                    if (dotPos == -1) {
                        dotPos = subPath.length();
                    }
                    String subType = subPath.substring(0, dotPos);
                    log.trace("  subname is " + subType);
                    int counterPos = subType.indexOf('_');
                    if (counterPos != -1) {
                        subType = subType.substring(0, counterPos);
                    }
                    log.trace("  subType is " + subType);

                    // hier überprüfen, ob es wirklich noch keinen child-container
                    // mit diesem Namen gibt. Wenn z.B. der pfad msg.gv.ueb.kik.blz
                    // gesucht wird und msg.gv schon existiert, wird diese methode
                    // hier in msg.gv ausgeführt. wenn sie fehlschlägt (z.b. weil
                    // tatsächlich kein .ueb.kik.blz angelegt werden kann), wird false
                    // ("can not propagate") zurückgegeben. im übergeordneten modul
                    // (msg) soll dann nicht versucht werden, das nächste sub-element
                    // (gv) anzulegen - dieser test merkt, dass es "gv" schon gibt
                    boolean found = false;
                    for (MultipleSyntaxElements c : childContainers) {
                        if (c.getName().equals(subType)) {
                            found = true;
                            break;
                        }
                    }

                    if (!found) {
                        // jetzt durch alle child-elemente des definierenden XML-Knotens
                        // loopen und den ref-Knoten suchen, der das fehlende Element
                        // beschreibt
                        int newChildIdx = 0;
                        Node ref;
                        found = false;
                        for (ref = def.getFirstChild(); ref != null; ref = ref.getNextSibling()) {
                            if (ref.getNodeType() == Node.ELEMENT_NODE) {
                                String type = ((Element) ref).getAttribute("type");
                                String name = ((Element) ref).getAttribute("name");
                                if (name.length() == 0) {
                                    name = type;
                                }
                                if (name.equals(subType)) {
                                    found = true;
                                    break;
                                }
                                newChildIdx++;
                            }
                        }

                        if (found) {
                            // entsprechenden child-container erzeugen
                            MultipleSyntaxElements child = createNewChildContainer(ref, document);
                            child.setParent(this);
                            child.setSyntaxIdx(newChildIdx);

                            if (getElementTypeName().equals("MSG"))
                                log.trace("child container " + child.getPath() + " has syntaxIdx=" + child.getSyntaxIdx());

                            // aktuelle child-container-liste durchlaufen und den neu
                            // erzeugten child-container dort richtig einsortieren
                            int newPosi = 0;
                            for (MultipleSyntaxElements c : childContainers) {
                                if (c.getSyntaxIdx() > newChildIdx) {
                                    // der gerade betrachtete child-container hat einen idx
                                    // gröÃer als den des einzufügenden elementes, also wird
                                    // sich diese position gemerkt und das element hier eingefügt
                                    break;
                                }
                                newPosi++;
                            }
                            log.trace("  inserting child container with syntaxIdx " + newChildIdx + " at position " + newPosi);
                            childContainers.add(newPosi, child);

                            // now try to propagate the value to the newly created child
                            ret = child.propagateValue(destPath, value, tryToCreate, allowOverwrite);
                        }
                    } else {
                        log.trace("  subtype " + subType + " already existing - will not try to create");
                    }
                }
            }
        }

        return ret;
    }
488100
public void run(String... args) {
        int maxIteration = 10;
        int totalMoreFast = 0;
        int totalMoreFastWithThreadPool = 0;
        int totalMoreFastPacketThreadPool = 0;
        for (int i = 0; i < maxIteration; i++) {
            LOGGER.info("**********************************");
            long jxnetRunnerRes = jxnetRunner.run();
            long jxnetWithThreadPoolRunnerRes = jxnetWithThreadPoolRunner.run();
            long jxnetPacketThreadPoolRunnerRes = springJxnetWithThreadPoolRunner.run();
            long pcap4jRunnerRes = pcap4jRunner.run();
            long pcap4jWithThreadPoolRunnerRes = pcap4jWithThreadPoolRunner.run();
            long pcap4jPacketThreadPoolRunnerRes = pcap4jPacketWithThreadPoolRunner.run();
            LOGGER.info("Jxnet x Pcap4j");
            boolean moreFast = jxnetRunnerRes < pcap4jRunnerRes;
            boolean moreFastWithThreadPool = jxnetWithThreadPoolRunnerRes < pcap4jWithThreadPoolRunnerRes;
            boolean moreFastPacketThreadPool = jxnetPacketThreadPoolRunnerRes < pcap4jPacketThreadPoolRunnerRes;
            if (moreFast) {
                totalMoreFast++;
            }
            if (moreFastWithThreadPool) {
                totalMoreFastWithThreadPool++;
            }
            if (moreFastPacketThreadPool) {
                totalMoreFastPacketThreadPool++;
            }
            LOGGER.info("Is Jxnet runner more fast? {} : {}",
                     moreFast ? "YES" : "NO",
                    jxnetRunnerRes + " and " + pcap4jRunnerRes);
            LOGGER.info("Is Jxnet with thread pool runner more fast? {} : {}",
                    moreFastWithThreadPool ? "YES" : "NO",
                    jxnetWithThreadPoolRunnerRes + " and " + pcap4jWithThreadPoolRunnerRes);
            LOGGER.info("IS Jxnet packet with thread pool runner more fast? {} : {}",
                    moreFastPacketThreadPool ? "YES" : "NO",
                    jxnetPacketThreadPoolRunnerRes + " and " + pcap4jPacketThreadPoolRunnerRes);
            LOGGER.info("**********************************\n");
        }
        LOGGER.info("Total jxnet more fast                                 : {}/{}", totalMoreFast, maxIteration);
        LOGGER.info("Total jxnet more fast with thread pool                : {}/{}", totalMoreFastWithThreadPool, maxIteration);
        LOGGER.info("Total jxnet more fast packet decoder with thread pool : {}/{}", totalMoreFastPacketThreadPool, maxIteration);
        executorService.shutdownNow();
    }
83571
def next(pointer)
      super

      if !@current_week_start
        case pointer
        when :future
          sunday_repeater = RepeaterDayName.new(:sunday)
          sunday_repeater.start = @now
          next_sunday_span = sunday_repeater.next(:future)
          @current_week_start = next_sunday_span.begin
        when :past
          sunday_repeater = RepeaterDayName.new(:sunday)
          sunday_repeater.start = (@now + RepeaterDay::DAY_SECONDS)
          sunday_repeater.next(:past)
          last_sunday_span = sunday_repeater.next(:past)
          @current_week_start = last_sunday_span.begin
        end
      else
        direction = pointer == :future ? 1 : -1
        @current_week_start += direction * WEEK_SECONDS
      end

      Span.new(@current_week_start, @current_week_start + WEEK_SECONDS)
    end
393761
static int compare (final Date nextFireTime1,
                        final int priority1,
                        final TriggerKey key1,
                        final Date nextFireTime2,
                        final int priority2,
                        final TriggerKey key2)
    {
      if (nextFireTime1 != null || nextFireTime2 != null)
      {
        if (nextFireTime1 == null)
          return 1;
        if (nextFireTime2 == null)
          return -1;
        if (nextFireTime1.before (nextFireTime2))
          return -1;
        if (nextFireTime1.after (nextFireTime2))
          return 1;
      }

      int comp = priority2 - priority1;
      if (comp == 0)
        comp = key1.compareTo (key2);
      return comp;
    }
722937
public static void main(String[] args) {
		Stopwatch stopwatch = SimonManager.getStopwatch("org.javasimon.examples.HelloWorld-stopwatch");

		Split split = stopwatch.start();
		System.out.println("Hello world, " + stopwatch);
		split.stop();

		// or this way using try-with-resource construction
		try (Split ignored = stopwatch.start()){
			System.out.println("Hello world (try-with-resource), " + stopwatch);
		}

		System.out.println("Result: " + stopwatch);
	}
1057076
function run(thisArg, args) {
    var end = -1;
    const r = this._f.map((f, i) => {
        if(end === -1) {
            return f.apply(thisArg, args.concat(abort));
        }

        function abort() {
            end = i;
        }
    });
    if(end === -1) {
        return r;
    }
    return r.slice(0, end);
}
1170267
def do_next(self, args):
        
        self._do_print_from_last_cmd = True
        self._interp.step_over()
        return True