visitorCountUpdate
509973
protected function visitorGetPageObj()
	{
	    $objPage = null;
	    $pageId  = null;
	    
	    $pageId = $this->getPageIdFromUrl(); // Alias, not ID :-(
	    // Load a website root page object if there is no page ID
	    if ($pageId === null)
	    {
	        $pageId = $this->visitorGetRootPageFromUrl();
	    }
	    ModuleVisitorLog::writeLog(__METHOD__ , __LINE__ , 'Page ID over URL: '. $pageId);
	    // Get the current page object(s), NULL on type 404
	    $objPage = \PageModel::findPublishedByIdOrAlias($pageId);
	    
	    // Check the URL and language of each page if there are multiple results
	    if ($objPage !== null && $objPage->count() > 1)
	    {
	        $objNewPage = null;
	        $arrPages   = array();
	    
	        // Order by domain and language
	        while ($objPage->next())
	        {
	            $objCurrentPage = $objPage->current()->loadDetails();
	    
	            $domain = $objCurrentPage->domain ?: '*';
	            $arrPages[$domain][$objCurrentPage->rootLanguage] = $objCurrentPage;
	    
	            // Also store the fallback language
	            if ($objCurrentPage->rootIsFallback)
	            {
	                $arrPages[$domain]['*'] = $objCurrentPage;
	            }
	        }
	    
	        $strHost = \Environment::get('host');
	    
	        // Look for a root page whose domain name matches the host name
	        if (isset($arrPages[$strHost]))
	        {
	            $arrLangs = $arrPages[$strHost];
	        }
	        else
	        {
	            $arrLangs = $arrPages['*']; // empty domain
	        }
	    
	        // Use the first result (see #4872)
	        if (!$GLOBALS['TL_CONFIG']['addLanguageToUrl'])
	        {
	            $objNewPage = current($arrLangs);
	        }
	        // Try to find a page matching the language parameter
	        elseif (($lang = \Input::get('language')) != '' && isset($arrLangs[$lang]))
	        {
	            $objNewPage = $arrLangs[$lang];
	        }
	    
	        // Store the page object
	        if (is_object($objNewPage))
	        {
	            $objPage = $objNewPage;
	        }
	    }
	    elseif ($objPage !== null && $objPage->count() == 1)
	    {
	        $objPage = $objPage->current()->loadDetails();
	    }
	    elseif ($objPage === null)
	    {
	        //404 page aus dem Cache
	        $pageId = $this->visitorGetRootPageFromUrl(false);
	        $objPage = \PageModel::find404ByPid($pageId);
	        ModuleVisitorLog::writeLog(__METHOD__ , __LINE__ , 'Page Root ID / Page ID 404: '. $pageId .' / '.$objPage->id);
	    }
	    return $objPage;
	}
131329
def visit_and_update(self, visitor_fn):
        """"""
        new_predicate = self.predicate.visit_and_update(visitor_fn)
        new_if_true = self.if_true.visit_and_update(visitor_fn)
        new_if_false = self.if_false.visit_and_update(visitor_fn)

        if any((new_predicate is not self.predicate,
                new_if_true is not self.if_true,
                new_if_false is not self.if_false)):
            return visitor_fn(TernaryConditional(new_predicate, new_if_true, new_if_false))
        else:
            return visitor_fn(self)
176011
public function UpdateProductViewCount()
    {
        if (CMS_SHOP_TRACK_ARTICLE_DETAIL_VIEWS && !is_null($this->id)) {
            $this->getProductStatsService()->add($this->id, ProductStatisticsServiceInterface::TYPE_DETAIL_VIEWS, 1);
        }
    }
843982
@SuppressWarnings("unchecked")
	static VisitorStatusType visitList(String name, List<Object> list, BindMapListener listener, VisitorStatusType status) {
		int i = 0;
		for (Object item : list) {
			if (item == null || item instanceof String) {
				visit(name + "." + i, (String) item, listener, status);
			} else if (item instanceof List) {
				visitList(name + "." + i, (List<Object>) item, listener, status);
			} else if (item instanceof Map) {
				visitMap(name + "." + i, (Map<String, Object>) item, listener, status);
			}
			i++;

			if (status == VisitorStatusType.STOP)
				return status;
		}

		return status;
	}
385678
public void visitWith(ExecArg.Visitor visitor) {
        for (ExecArg arg : getList()) {
            arg.accept(visitor);
        }
    }
921758
def update_badge_users_count(self):
        
        logger.debug('→ Badge %s: syncing users count...', self.slug)

        badge, updated = self.badge, False

        if not badge:
            logger.debug(
                '✘ Badge %s: does not exist in the database (run badgify_sync badges)',
                self.slug)
            return (self.slug, updated)

        old_value, new_value = badge.users_count, badge.users.count()

        if old_value != new_value:
            badge = Badge.objects.get(slug=self.slug)
            badge.users_count = new_value
            badge.save()
            updated = True

        if updated:
            logger.debug('✓ Badge %s: updated users count (from %d to %d)',
                         self.slug,
                         old_value,
                         new_value)
        else:
            logger.debug('✓ Badge %s: users count up-to-date (%d)',
                         self.slug,
                         new_value)

        return (badge, updated)
920252
def view_count_plus(slug):
        '''
        
        '''
        entry = TabWiki.update(
            view_count=TabWiki.view_count + 1,
        ).where(TabWiki.uid == slug)
        entry.execute()
293481
function visitor(parent) {
    var index = -1
    var children = parent && parent.children

    if (!children) {
      throw new Error('Missing children in `parent` for `visitor`')
    }

    while (++index in children) {
      callback(children[index], index, parent)
    }
  }
1009557
function count(req, res, next) {
  User.count(function(err, count){
    if (err) return next(err);
    req.count = count;
    next();
  })
}
694959
def get_active_entry(user, select_for_update=False):
    """"""
    entries = apps.get_model('entries', 'Entry').no_join
    if select_for_update:
        entries = entries.select_for_update()
    entries = entries.filter(user=user, end_time__isnull=True)

    if not entries.exists():
        return None
    if entries.count() > 1:
        raise ActiveEntryError('Only one active entry is allowed.')
    return entries[0]
249957
def updateIgnoredEntry(self):
        """"""
        # collect new DPs from items
        dps = []
        for item, dp in self.wdplv.getItemDPList():
            if dp and not dp.archived:  # None means a new DP
                # set all policies to ignore, unless already set to banish
                if dp.policy != "banish":
                    self.wdplv.setItemPolicy(item, "ignore")
                    dp.set_policy("ignore")
                dps.append(dp)
        # return new entry
        return Purr.LogEntry(time.time(), dps=dps, ignore=True)
411330
private void updateStatistics() {
        final PNCounterService service = getService();
        final LocalPNCounterStatsImpl stats = service.getLocalPNCounterStats(name);
        if (delta > 0) {
            stats.incrementIncrementOperationCount();
        } else if (delta < 0) {
            stats.incrementDecrementOperationCount();
        }
        stats.setValue(getBeforeUpdate ? (response.getValue() + delta) : response.getValue());
    }
420633
def _UpdateCounters(self, event):
    
    self._session.parsers_counter['total'] += 1

    # Here we want the name of the parser or plugin not the parser chain.
    parser_name = getattr(event, 'parser', '')
    _, _, parser_name = parser_name.rpartition('/')
    if not parser_name:
      parser_name = 'N/A'
    self._session.parsers_counter[parser_name] += 1
890689
void updateCount() {
		if (this.hasChanged) {
			this.countArray = ArrayUtils.toPrimitive(getCountList().toArray(
					new Long[0]));
			this.hasChanged = false;
		}
	}
1046913
static function updateLastVisit( $userID, $updateLoginCount = false )
    {
        if ( isset( $GLOBALS['eZUserUpdatedLastVisit'] ) )
            return;
        $db = eZDB::instance();
        $userID = (int) $userID;
        $userVisitArray = $db->arrayQuery( "SELECT 1 FROM ezuservisit WHERE user_id=$userID" );
        $time = time();

        if ( isset( $userVisitArray[0] ) )
        {
            $loginCountSQL = $updateLoginCount ? ', login_count=login_count+1' : '';
            $db->query( "UPDATE ezuservisit SET last_visit_timestamp=ABS(current_visit_timestamp), current_visit_timestamp=$time$loginCountSQL WHERE user_id=$userID" );
        }
        else
        {
            $intialLoginCount = $updateLoginCount ? 1 : 0;
            $db->query( "INSERT INTO ezuservisit ( current_visit_timestamp, last_visit_timestamp, user_id, login_count ) VALUES ( $time, $time, $userID, $intialLoginCount )" );
        }
        $GLOBALS['eZUserUpdatedLastVisit'] = true;
    }
94323
def update_counts(self, current):
        
        for item in current:
            try:
                self.counts[item] += 1
            except KeyError:
                self.counts[item] = 1
772848
public void notifyUpdate( URL resource, int expected, int count )
    {
        synchronized( m_Monitors )
        {
            for( StreamMonitor monitor : m_Monitors )
            {
                monitor.notifyUpdate( resource, expected, count );
            }
        }
    }