View that handles the generation of blogrolls.
497499
def blogroll(request, btype):
	''
	response, site, cachekey = initview(request)
	if response: return response[0]

	template = loader.get_template('feedjack/{0}.xml'.format(btype))
	ctx = dict()
	fjlib.get_extra_context(site, ctx)
	ctx = Context(ctx)
	response = HttpResponse(
		template.render(ctx), content_type='text/xml; charset=utf-8' )

	patch_vary_headers(response, ['Host'])
	fjcache.cache_set(site, cachekey, (response, ctx_get(ctx, 'last_modified')))
	return response
1252121
protected function prepareBlogIndexViewData()
    {
        $postsPerPage = @$this->viewsData['postsPerPage'] ?: 5;

        $this->viewsData['nextPage'] = count($this->viewsData['blogPosts']) > $postsPerPage ? '/blog-page/2' : null;

        $this->viewsData['previousPage'] = null;

        $this->viewsData['paginatedBlogPosts'] = array_slice($this->viewsData['blogPosts'], 0, $postsPerPage, true);
    }
1122175
def index(count, page):
    
    blogging_engine = _get_blogging_engine(current_app)
    storage = blogging_engine.storage
    config = blogging_engine.config
    count = count or config.get("BLOGGING_POSTS_PER_PAGE", 10)

    meta = _get_meta(storage, count, page)
    offset = meta["offset"]
    meta["is_user_blogger"] = _is_blogger(blogging_engine.blogger_permission)
    meta["count"] = count
    meta["page"] = page

    render = config.get("BLOGGING_RENDER_TEXT", True)
    posts = storage.get_posts(count=count, offset=offset, include_draft=False,
                              tag=None, user_id=None, recent=True)
    index_posts_fetched.send(blogging_engine.app, engine=blogging_engine,
                             posts=posts, meta=meta)
    for post in posts:
        blogging_engine.process_post(post, render=render)
    index_posts_processed.send(blogging_engine.app, engine=blogging_engine,
                               posts=posts, meta=meta)
    return render_template("blogging/index.html", posts=posts, meta=meta,
                           config=config)
89910
protected function loadViews()
    {
        $this->loadViewsFrom($this->getRelativePath('views'), 'maintenancemode');

        $this->publishes([
            $this->getRelativePath('views') => base_path('resources/views/vendor/maintenancemode'),
        ], 'views');
    }
1155557
def as_view(cls, *class_args, **class_kwargs):
        

        def view(*args, **kwargs):
            self = view.view_class(*class_args, **class_kwargs)
            return self.dispatch_request(*args, **kwargs)

        if cls.decorators:
            view.__module__ = cls.__module__
            for decorator in cls.decorators:
                view = decorator(view)

        view.view_class = cls
        view.__doc__ = cls.__doc__
        view.__module__ = cls.__module__
        view.__name__ = cls.__name__
        return view
420952
def generate_index(self, num_posts=5):
		
		posts = self.get_posts(num=num_posts)
		self.generate_page('index', template='index.html.jinja', posts=posts)
584448
private void createViewForCount(Map<String, MapReduce> views)
    {
        if (views.get(CouchDBConstants.COUNT) == null)
        {
            MapReduce mapr = new MapReduce();
            mapr.setMap("function(doc){" + "for(field in doc){if(field!=\"" + CouchDBConstants.ENTITYNAME
                    + "\"){var o = doc[field];emit(field+\"_\"+doc." + CouchDBConstants.ENTITYNAME + ", o);" + "}}"
                    + "emit(\"" + CouchDBConstants.ALL + "_\"+doc." + CouchDBConstants.ENTITYNAME + ", null);}");
            mapr.setReduce("function(keys, values){return values.length;}");
            views.put(CouchDBConstants.COUNT, mapr);
        }
    }
991519
function ()
	{
		var
			oSetDT = this.s.dt,
			nScrollBody = oSetDT.nTable.parentNode;

		if ( oSetDT.oScroll.sX !== "" )
		{
			nScrollBody.style.width = oSetDT.oApi._fnStringToCss( oSetDT.oScroll.sX );
			nScrollBody.style.overflow = "auto";
		}

		if ( oSetDT.oScroll.sY !== "" )
		{
			nScrollBody.style.height = oSetDT.oApi._fnStringToCss( oSetDT.oScroll.sY );
			nScrollBody.style.overflow = "auto";
		}
	}
551977
function View(view, options) {
  this.history = [];
  Item.call(this, view, options);
  this.init(view);
  return view;
}
1280551
function _onScroll () {
        _scrollY = window.scrollY;
        if (_monitorTop && _dynamicCss) {
            _updateDynamicCss();
        }
        _broadcaster.broadcastEvent("scroll", {
            top: _scrollY
        });
    }
565359
function ThreadBranchView(vm) {
	return function(vm, data) {
		return data.error ? errorTpl(data.error)
		: data.comment == null ? statusTpl("Loading comments of thread #" + data.threadId)
		: el(".comment", [
			el("p", {".innerHTML": data.comment.text}),
			vw(CommentReplyView, data.comment),
			el(".children", data.comment.children.map(comment2 =>
				vw(ThreadBranchView, {comment: comment2})
			))
		]);
	}
}
1213644
@Override
    public void onScroll(
            AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
        SimpleMonthView child = (SimpleMonthView) view.getChildAt(0);
        if (child == null) {
            return;
        }

        // Figure out where we are
        long currScroll = view.getFirstVisiblePosition() * child.getHeight() - child.getBottom();
        mPreviousScrollPosition = currScroll;
        mPreviousScrollState = mCurrentScrollState;
    }
116144
def _auto_scroll(self, *args):
        
        adj = self['scrollable'].get_vadjustment()
        adj.set_value(adj.get_upper() - adj.get_page_size())
1100296
private void createViewForMax(Map<String, MapReduce> views)
    {
        if (views.get(CouchDBConstants.MAX) == null)
        {
            MapReduce mapr = new MapReduce();
            mapr.setMap("function(doc){for(field in doc){var o = doc[field];if(typeof(o)==\"number\")emit(field+\"_\"+doc."
                    + CouchDBConstants.ENTITYNAME + ", o);}}");
            mapr.setReduce("function(keys, values){return Math.max.apply(Math, values);}");
            views.put(CouchDBConstants.MAX, mapr);
        }
    }
648806
def pageviews(params):
    
    # set up default values
    default_from, default_to, yesterday, _ = make_default_times()

    # get params
    try:
        series = params.get("site", [DEFAULT_SERIES])[0]
        from_date = params.get("from", [default_from])[0]
        to_date = params.get("to", [default_to])[0]
        group_by = params.get("group_by", [DEFAULT_GROUP_BY])[0]
    except Exception as e:
        LOGGER.exception(e)
        return json.dumps({"error": e.message}), "500 Internal Error"

    # check the cache
    cache_key = "{}:{}:{}:{}:{}:{}".format(memcached_prefix, "pageviews.json", series, from_date, to_date, group_by)
    try:
        data = MEMCACHED_CLIENT.get(cache_key)
        if data:
            return data, "200 OK"
    except Exception as e:
        LOGGER.exception(e)

    # parse from date
    from_date = parse_datetime(from_date)
    if from_date is None:
        LOGGER.error("could not parse 'from'")
        return json.dumps({"error": "could not parse 'from'"}), "400 Bad Request"

    # parse to date
    to_date = parse_datetime(to_date)
    if to_date is None:
        LOGGER.error("could not parse 'to'")
        return json.dumps({"error": "could not parse 'to'"}), "400 Bad Request"

    # influx will only keep non-aggregated data for a day, so if the from param is beyond that point
    # we need to update the series name to use the rolled up values
    rollup_query = False
    if from_date < yesterday:
        series = update_series(series, "pageviews")
        rollup_query = True

    # format times
    from_date = format_datetime(from_date)
    to_date = format_datetime(to_date)

    # build out the query
    if not rollup_query:
        query = "SELECT sum(value) as value " \
                "FROM {series} " \
                "WHERE time > '{from_date}' " \
                "AND time < '{to_date}' " \
                "AND event =~ /^pageview$/ " \
                "GROUP BY time({group_by}) " \
                "fill(0);"
    else:
        query = "SELECT sum(value) as value " \
                "FROM {series} " \
                "WHERE time > '{from_date}' " \
                "AND time < '{to_date}' " \
                "GROUP BY time({group_by}) " \
                "fill(0);"
    args = {"series": series, "from_date": from_date, "to_date": to_date, "group_by": group_by}

    # send the request
    try:
        res = INFLUXDB_CLIENT.query(query.format(**args))

    # capture errors and send them back along with the query (for inspection/debugging)
    except Exception as e:
        LOGGER.error("query: {}".format(query.format(**args)))
        LOGGER.exception(e)
        return json.dumps({"error": e.message, "query": query.format(**args)}), "500 Internal Error"

    # build the response object
    response = flatten_response(res)
    res = json.dumps(response)

    # cache the response
    try:
        MEMCACHED_CLIENT.set(cache_key, res, time=MEMCACHED_EXPIRATION)
    except Exception as e:
        LOGGER.exception(e)

    return res, "200 OK"
877462
void adjustScroll() {

        if (iRowHeight == 0) {
            return;
        }

        int w = 0;

        for (int i = 0; i < iColCount; i++) {
            w += iColWidth[i];
        }

        iGridWidth  = w;
        iGridHeight = iRowHeight * (iRowCount + 1);

        sbHoriz.setValues(iX, iWidth, 0, iGridWidth);

        int v = iY / iRowHeight,
            h = iHeight / iRowHeight;

        sbVert.setValues(v, h, 0, iRowCount + 1);

        iX = sbHoriz.getValue();
        iY = iRowHeight * sbVert.getValue();
    }
1338395
def views(self):
        
        if self._views:
            return self._views
        elif not self.abstract:
            return self.read_meta()._views

        raise EmptyDocumentException()