\
    The index view, which basically just displays a button and increments
    a counter.
435788
def index(request, template_name="index.html"):
    
    if request.GET.get('ic-request'):
        counter, created = Counter.objects.get_or_create(pk=1)
        counter.value += 1
        counter.save()
    else:
        counter, created = Counter.objects.get_or_create(pk=1)
        print(counter.value)
    context = dict(
        value=counter.value,
    )
    return render(request, template_name, context=context)
334420
public void viewDebugMenuClick(int index, Object value, boolean isToggled) {
		System.out.println(index + ":" + value + ":" + isToggled);
		switch (index) {
		case 0:
			displayFps = isToggled;
			app.setDisplayFps(isToggled);
			break;
		case 1:
			app.setDisplayStatView(isToggled);
			break;
		}
	}
920252
def view_count_plus(slug):
        '''
        
        '''
        entry = TabWiki.update(
            view_count=TabWiki.view_count + 1,
        ).where(TabWiki.uid == slug)
        entry.execute()
1285893
def set_current_index(self, index):
        
        # d = self.declaration
        # #: We have to wait for the current_index to be ready before we can
        # #: change pages
        if self._notify_count > 0:
            self._pending_calls.append(
                lambda index=index: self.widget.setCurrentItem(index))
        else:
            self.widget.setCurrentItem(index)
26410
function (iBeginDragIndex, iControlCount) {
				if (iBeginDragIndex === iControlCount - 1) {
					sInsertAfterBeforePosition = INSERT_BEFORE;
					return iBeginDragIndex;
				}
				sInsertAfterBeforePosition = INSERT_AFTER;
				return iBeginDragIndex + 1;
			}
971667
function _counter(column, amount, symbol) {
    var amt = parseInt(amount, 10);
    if (isNaN(amt)) {
      amt = 1;
    }
    this._method = 'counter';
    this._single.counter = {
      column: column,
      amount: amt,
      symbol: symbol || '+'
    };
    return this;
  }
433755
def index(ctx, view):
    """"""
    adapter = ctx.obj['adapter']
    if view:
        click.echo(adapter.indexes())
        return
    adapter.ensure_indexes()
246856
def increment(self):
        ''''''

        for i in xrange(len(self._counter) - 1, -1, -1):
            self._counter[i] += 1

            if self._counter[i] < 256: break

            # Carry the one
            self._counter[i] = 0

        # Overflow
        else:
            self._counter = [ 0 ] * len(self._counter)
995625
def switchCurrentView(self, viewType):
        
        if not self.count():
            return self.addView(viewType)

        # make sure we're not trying to switch to the same type
        view = self.currentView()
        if type(view) == viewType:
            return view

        # create a new view and close the old one
        self.blockSignals(True)
        self.setUpdatesEnabled(False)

        # create the new view
        index = self.indexOf(view)
        if not view.close():
            return None
        #else:
        #    self.tabBar().removeTab(index)

        index = self.currentIndex()
        new_view = viewType.createInstance(self.viewWidget(), self.viewWidget())

        # add the new view
        self.insertTab(index, new_view, new_view.windowTitle())

        self.blockSignals(False)
        self.setUpdatesEnabled(True)
        self.setCurrentIndex(index)

        return new_view
660982
public static <E> Counter<E> toCounter(Map<Integer, ? extends Number> counts, Index<E> index) {

    Counter<E> counter = new ClassicCounter<E>();
    for (Map.Entry<Integer, ? extends Number> entry : counts.entrySet()) {
      counter.setCount(index.get(entry.getKey()), entry.getValue().doubleValue());
    }
    return counter;
  }
331485
function () {
    var childViews, childViewCount,
        numberOfChildViews, numberOfChildViewsNeeded,
        contentIndex, startingIndex, endingIndex,
        contentLength, emptyView, count, delta;

    if (this.isDestroyed || this.isDestroying) {
      return;
    }

    contentLength = get(this, 'content.length');
    emptyView = get(this, 'emptyView');

    childViewCount = this._childViewCount();
    childViews = this.positionOrderedChildViews();

    if (this._isChildEmptyView()) {
      removeEmptyView.call(this);
    }

    startingIndex = this._startingIndex();
    endingIndex = startingIndex + childViewCount;

    numberOfChildViewsNeeded = childViewCount;
    numberOfChildViews = childViews.length;

    delta = numberOfChildViewsNeeded - numberOfChildViews;

    if (delta === 0) {
      // no change
    } else if (delta > 0) {
      // more views are needed
      contentIndex = this._lastEndingIndex;

      for (count = 0; count < delta; count++, contentIndex++) {
        this._addItemView(contentIndex);
      }
    } else {
      // less views are needed
      forEach.call(
        childViews.splice(numberOfChildViewsNeeded, numberOfChildViews),
        removeAndDestroy,
        this
      );
    }

    this._reuseChildren();

    this._lastStartingIndex = startingIndex;
    this._lastEndingIndex   = this._lastEndingIndex + delta;

    if (contentLength === 0 || contentLength === undefined) {
      addEmptyView.call(this);
    }
  }
1080953
private boolean incrementViews() {

        if (System.currentTimeMillis() - settings.getLong(KEY_LAST_COUNT_UPDATE, 0L) < minimumInterval) {
            if (debug) LogD("Count not incremented due to minimum interval not reached");
            return false;
        }

        editor.putInt(KEY_COUNT, settings.getInt(KEY_COUNT, 0) + 1);
        editor.putLong(KEY_LAST_COUNT_UPDATE, System.currentTimeMillis());
        commitEditor();
        return true;
    }
855148
public function visible($index = false, $view = true)
    {
        $this->visible = true;

        $this->actions[Action::VIEW] = $view;
        $this->actions[Action::INDEX] = $index;

        return $this;
    }
854726
private boolean increment(int index)
    {
        if (index == -1)
        {
            return false;
        }
        int value = current.get(index);
        if (value < max.get(index))
        {
            current.set(index, value+1);
            updateMinMax(index+1);
            return true;
        }
        boolean hasNext = increment(index-1);
        if (hasNext)
        {
            current.set(index, min.get(index));            
        }
        return hasNext;
    }
253595
private void incrementIndexes(int c) {
        if(c > 0) {
            this.index++;
            if(c=='\r') {
                this.line++;
                this.characterPreviousLine = this.character;
                this.character=0;
            }else if (c=='\n') {
                if(this.previous != '\r') {
                    this.line++;
                    this.characterPreviousLine = this.character;
                }
                this.character=0;
            } else {
                this.character++;
            }
        }
    }
618844
def display_view(self):
        """"""
        self.idx_start.setText(str(self.parent.value('window_start')))
        self.idx_length.setText(str(self.parent.value('window_length')))
        self.idx_scaling.setText(str(self.parent.value('y_scale')))
        self.idx_distance.setText(str(self.parent.value('y_distance')))
427318
private void onEvent(CounterManager.Event2C.OnCounterUpdated event) {
        getModel().count = String.valueOf(event.getCount());

        if (view != null) {
            view.update();
        }
    }