leaderboard update in FFA mode
337882
function(client, packet) {
            var highlights = [];
            var names = [];
            var count = packet.readUInt32LE();

            for(var i=0;i<count;i++) {
                var highlight = packet.readUInt32LE();

                var name = '';
                while(1) {
                    var char = packet.readUInt16LE();
                    if(char == 0) break;
                    name += String.fromCharCode(char);
                }

                highlights.push(highlight);
                names.push(name);
            }

            if(JSON.stringify(client.leaderHighlights) == JSON.stringify(highlights) &&
                JSON.stringify(client.leaderNames) == JSON.stringify(names)) {
                return;
            }
			
            var old_highlights  = client.leaderHighlights; 
            var old_leaderNames = client.leaderNames;
			client.leaderHighlights = highlights;
            client.leaderNames      = names;

            if(client.debug >= 3)
                client.log('leaders update: ' + JSON.stringify(highlights) + ',' + JSON.stringify(names));

            client.emitEvent('leaderBoardUpdate', old_highlights, highlights, old_leaderNames, names);
        }
812136
void updateCount() {
		if (this.hasChanged) {
			this.positionArray = ArrayUtils.toPrimitive(getPositionList()
					.toArray(new Long[0]));
			this.hasChanged = false;
		}
	}
72851
def rank_members_in(self, leaderboard_name, members_and_scores):
        '''
        
        '''
        pipeline = self.redis_connection.pipeline()
        for member, score in grouper(2, members_and_scores):
            if isinstance(self.redis_connection, Redis):
                pipeline.zadd(leaderboard_name, member, score)
            else:
                pipeline.zadd(leaderboard_name, score, member)
        pipeline.execute()
282174
private void updateCounter() {

        m_counter.replaceData(
            Collections.singletonMap(
                CmsVaadinUtils.getMessageText(Messages.GUI_MODULES_STATISTICS_ROW_COUNT_0),
                String.valueOf(getContainerDataSource().size())));
    }
171664
function (progress, adv) {
  if (progress) {
    var id = progress[0]
      , pos = progress[1]
      , insertM = this.findMatch(id);

    if (!insertM) {
      throw new Error('tournament corrupt: ' + id + ' not found!');
    }

    insertM.p[pos] = adv;
    if (insertM.p[(pos + 1) % 2] === WO) {
      insertM.m = (pos) ? [0, 1] : [1, 0]; // set WO map scores
      return insertM.id; // this id was won by adv on WO, inform
    }
  }
}
439228
function gameOrLobby(games) {
    $(LOBBY).hide();
    $(GAMEROOM).hide();
    $(ADDGUEST).hide();

    if (!$.cookie("player")) {
        drawAddGuest();
        return;
    }

    // hide the fork me banner from now on
    $(FORKME).hide();

    var my_game = $.cookie("game");
    // User is not in a valid game
    if (typeof games[my_game] === 'undefined') {
        $.removeCookie('game');
        $(LOBBY).show();
        drawLobby(games);
    } else {
        $(GAMEROOM).show();
        drawGame();
    }
    $(CHATPNL).show();
    drawChatLog();
    drawChatIn();

    // setup future calls to get chat
    function pollChat() {
        drawChatLog();
        DRAWCHATTID = setTimeout(pollChat, 2000);
    }
    DRAWCHATTID = setTimeout(pollChat, 2000);
}
970055
def rank_member(self, member, score, member_data=None):
        '''
        
        '''
        self.rank_member_in(self.leaderboard_name, member, score, member_data)
1186579
public void updateStatus() {
        Optional<Activity> activity = api.getActivity();
        ObjectNode updateStatus = JsonNodeFactory.instance.objectNode()
                .put("op", GatewayOpcode.STATUS_UPDATE.getCode());
        ObjectNode data = updateStatus.putObject("d")
                .put("status", api.getStatus().getStatusString())
                .put("afk", false)
                .putNull("since");
        ObjectNode activityJson = data.putObject("game");
        activityJson.put("name", activity.isPresent() ? activity.get().getName() : null);
        activityJson.put("type", activity.map(g -> g.getType().getId()).orElse(0));
        activity.ifPresent(g -> g.getStreamingUrl().ifPresent(url -> activityJson.put("url", url)));
        logger.debug("Updating status (content: {})", updateStatus);
        websocket.get().sendText(updateStatus.toString());
    }
498525
private void updateRuntimeStatus() {

    final RuntimeStatusEventImpl.Builder builder = RuntimeStatusEventImpl.newBuilder()
        .setName(RUNTIME_NAME)
        .setState(State.RUNNING)
        .setOutstandingContainerRequests(this.containerRequestCounter.get());

    for (final String allocatedContainerId : this.containers.getContainerIds()) {
      builder.addContainerAllocation(allocatedContainerId);
    }

    this.reefEventHandlers.onRuntimeStatus(builder.build());
  }
834692
def update(tournament, match, attachment, **params):
    """"""
    api.fetch(
        "PUT",
        "tournaments/%s/matches/%s/attachments/%s" % (tournament, match, attachment),
        "match_attachment",
        **params)
932988
def update_collisions(self):
        
        if not self.mode['items'] or len(self.mode['items']) == 0: return

        # update collman
        # FIXME: Why update each frame?
        self.collman.clear()
        for z, node in self.children:
            if hasattr(node, 'cshape') and type(node.cshape) == cm.CircleShape:
                self.collman.add(node)

        # interactions player - others
        for other in self.collman.iter_colliding(self.player):
            typeball = other.btype
            self.logger.debug('collision', typeball)

            # TODO: Limit player position on non-removable items
            #if not other.removable:
            #    pass

            if other.removable:
                self.to_remove.append(other)

            self.reward_item(typeball)

        #
        #    elif (typeball == 'wall' or
        #          typeball == 'gate' and self.cnt_food > 0):
        #        self.level_losed()
        #
        #    elif typeball == 'gate':
        #        self.level_conquered()

        self.remove_items()
947187
protected void updateCounts(LoadStatisticsSnapshot current) {
        definedExecutors.update(current.getDefinedExecutors());
        onlineExecutors.update(current.getOnlineExecutors());
        connectingExecutors.update(current.getConnectingExecutors());
        busyExecutors.update(current.getBusyExecutors());
        idleExecutors.update(current.getIdleExecutors());
        availableExecutors.update(current.getAvailableExecutors());
        queueLength.update(current.getQueueLength());
    }
679131
public function getLeaderboardQuery(
        $leaderboardType = null,
        $nbItems = 5,
        $search = null,
        $order = null,
        $dir = null,
        $highlightId = null,
        $filter = null
    ) {
        $em = $this->serviceLocator->get('playgroundreward_doctrine_em');
        /* @var $dbal \Doctrine\DBAL\Connection */
        $dbal = $em->getConnection();

        $filterSearch = '';
        $availableOrders = array('total_points', 'city', 'address2', 'address', 'username', 'display_name');

        if (is_string($leaderboardType) && !empty($leaderboardType)) {
            $leaderboardType = $this->getLeaderboardTypeService()->getLeaderboardTypeMapper()->findOneBy(array('name' => $leaderboardType));
        }
        
        if (!$leaderboardType) {
            $leaderboardType = $this->getLeaderboardTypeService()->getLeaderboardTypeDefault();
        }

        $parameters = array('leaderboardTypeId' => $leaderboardType->getId());
        
        if ($order && in_array($order, $availableOrders)) {
            $order = 'ORDER BY ' . $order;
        } else {
            $order = 'ORDER BY rank';
        }
        
        if ($dir && in_array($dir, array('asc', 'desc'))) {
            $order .= ' ' . $dir;
        } else {
            $order .= ' asc';
        }

        if ($filter) {
            $filter = ' ' . $filter;
        } else {
            $filter = '';
        }
        
        if ($search != '') {
            $filterSearch = ' AND (u.address LIKE :queryString1 OR u.address2 LIKE :queryString2 OR u.city LIKE :queryString3)';
            $parameters['queryString1'] = '%'.$search.'%';
            $parameters['queryString2'] = '%'.$search.'%';
            $parameters['queryString3'] = '%'.$search.'%';
        }
        
        // Statement ordering the players by total_points and determining their respective rank
        $stmt = '
            SELECT e.*, u.*, t.*
            FROM (
                SELECT sube.*, @curRank := @curRank + 1 AS rank 
                FROM reward_leaderboard sube, (SELECT @curRank := 0) r
                WHERE sube.leaderboardtype_id = :leaderboardTypeId
                ORDER BY sube.total_points DESC
            ) as e
            LEFT JOIN user u ON u.user_id = e.user_id
            LEFT JOIN user_team t ON t.id = e.team_id
            WHERE 1=1
        ';
        
        $query = $stmt.$filterSearch.$filter;

        if ($leaderboardType->getType() === 'user' && $highlightId) {
            $query .= ' AND u.user_id = ' . $highlightId;

            $row = current($dbal->fetchAll($query, $parameters));
            $rank = (!empty($row))?$row['rank']:0;

            $offset = max(0, $rank - 5);
            $limit = ($offset == 0 ? 10 : 9);
            $stmtLimit = $stmt . ' LIMIT '.$limit.' OFFSET ' . $offset;
            $result = $dbal->fetchAll($stmtLimit, $parameters);
            if (9 == $limit) {
                $first = current($dbal->fetchAll($stmt . ' LIMIT 1', $parameters));
                array_unshift($result, $first);
            }
            // find rank & set highlight to use it in the template
            foreach ($result as $k => $row) {
                if ($row['rank'] == $rank) {
                    $result[$k]['highlight'] = true;
                    break;
                }
            }
        } elseif ($leaderboardType->getType() === 'team' && $highlightId) {
            $query .= ' AND t.id = ' . $highlightId;

            $row = current($dbal->fetchAll($query, $parameters));
            $rank = (!empty($row))?$row['rank']:0;

            $offset = max(0, $rank - 5);
            $limit = ($offset == 0 ? 10 : 9);
            $stmtLimit = $stmt . ' LIMIT '.$limit.' OFFSET ' . $offset;
            $result = $dbal->fetchAll($stmtLimit, $parameters);
            if (9 == $limit) {
                $first = current($dbal->fetchAll($stmt . ' LIMIT 1', $parameters));
                array_unshift($result, $first);
            }
            // find rank & set highlight to use it in the template
            foreach ($result as $k => $row) {
                if ($row['rank'] == $rank) {
                    $result[$k]['highlight'] = true;
                    break;
                }
            }
        } else {
            $query .= ' ' . $order;
            if ($nbItems && $nbItems> 0) {
                $query .= ' limit ' . $nbItems;
            }
            $result = $dbal->fetchAll($query, $parameters);
        }

        return $result;
    }
387777
private void updateBeatGrid(TrackMetadataUpdate update, BeatGrid beatGrid) {
        hotCache.put(DeckReference.getDeckReference(update.player, 0), beatGrid);  // Main deck
        if (update.metadata.getCueList() != null) {  // Update the cache with any hot cues in this track as well
            for (CueList.Entry entry : update.metadata.getCueList().entries) {
                if (entry.hotCueNumber != 0) {
                    hotCache.put(DeckReference.getDeckReference(update.player, entry.hotCueNumber), beatGrid);
                }
            }
        }
        deliverBeatGridUpdate(update.player, beatGrid);
    }
180920
function(client) {
            if(client.debug >= 1)
                client.log(client.balls[client.leaders[0]] + ' WON THE GAME! Server going for restart');

            client.emitEvent('winner', client.leaders[0]);
        }
1111633
private void updateStatsTree() {
        if (myStatsWithChildren == null)
            return;

        ArrayList colMembers = myStatsWithChildren.subCollections();
        if (colMembers == null)
            return;

        colMembers.clear();

        // getStats from children
        ModuleItem[] items = children();
        if (items != null) {
            for (int i = 0; i < items.length; i++)
                colMembers.add(items[i].getStats(true));
        }
    }
1143424
private void updateAverage()
    {
        if(t == last_t || t < burnIn)
            return;
        else if(last_t < burnIn)//first update since done burning 
        {
            for(int i = 0; i < alphaAveraged.size(); i++)
                alphaAveraged.set(i, alphas.get(i));
        }
        double w = t-last_t;//time elapsed
        for(int i = 0; i < alphaAveraged.size(); i++)
        {
            double delta = alphas.getD(i) - alphaAveraged.getD(i);
            alphaAveraged.set(i, alphaAveraged.getD(i)+delta*w/t);
        }
        last_t = t;//average done
    }