-------------------------------------------------------------------------------------------
430633
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException {
        // Don't pollute the logging with the favicon.ico requests that browsers issue.
        if (target.equals("/favicon.ico")) {
            response.sendError(404);
            return;
        }

        // Log the request path.
        String requestPath = target;
        if (request.getQueryString() != null) {
            requestPath += "?" + request.getQueryString();
        }
        common.log.println("-- Request: " + request.getMethod() + " " + requestPath);

        if (target.equals("/")) {
            doIndex(request, response);
        } else if (target.equals("/login")) {
            doLogin(request, response);
        } else if (target.equals("/home")) {
            doHome(request, response);
        } else if (target.equals("/logout")) {
            doLogout(request, response);
        // Dropbox authorize routes
        } else if (target.equals("/dropbox-auth-start")) {
            dropboxAuth.doStart(request, response);
        } else if (target.equals("/dropbox-auth-finish")) {
            dropboxAuth.doFinish(request, response);
        } else if (target.equals("/dropbox-unlink")) {
            dropboxAuth.doUnlink(request, response);
        // Dropbox file browsing routes.
        } else if (target.equals("/browse")) {
            dropboxBrowse.doBrowse(request, response);
        } else if (target.equals("/upload")) {
            dropboxBrowse.doUpload(request, response);
        } else {
            response.sendError(404);
        }
    }
1155837
public function init(): void
    {
        if ($this->sourcePath !== null) {
            $this->sourcePath = $this->findPath($this->sourcePath);
        }
        if ($this->basePath !== null) {
            $this->basePath = $this->findPath($this->basePath);
        }
        if ($this->baseUrl !== null) {
            $this->baseUrl = rtrim(Yii::getAlias($this->baseUrl), '/');
        }
    }
649406
protected function initItems()
	{
		$initItems = null;
		
		if ($this->items != null)
		{
			foreach ($this->items as $item)
			{
				if (isset($item['value']))
				{
					$i = $item['value'];
					unset($item['value']);
					$initItems[$i] = $item;
				}
				else 
				{
					$initItems = $this->items;	
				}
			}
			
			$this->items = array_replace($this->defaults, $initItems);
		}
		else 
		{
			$this->items = $this->defaults;
		}
	}
1122260
protected function initialize()
    {
        if (!is_array($this->queryResult)) {
            $this->queryResult = $this->dataMapper->mapToObjects($this->persistenceManager->getObjectDataByQuery($this->query));
        }
    }
633961
public function init()
    {
        $this->idAttribute = '_id';
        $this->idAttributeType = static::$idTypeAutoIncrement;
        if ($this->skipInit) {
            return;
        }
        $this->initEntityEvents();
        parent::init();
    }
300090
public function process()
    {
        $rule = $this->getComponent();
        $context = $this->getContext();

        $processor = $this->getRuleProcessorFactory()->createProcessor($rule);
        $processor->setState($context);
        $processor->process();

        $this->trace($rule->getQtiClassName());
    }
395675
public function init()
    {
        if ($this->widget !== null) {
            $this->widget->init();
        }

        // ensure the widget has an id
        if ($this->widget->id === null) {
            $this->widget->id = $this->widget->getUniqueId();
        }
    }
1123840
public function init()
    {
        parent::init();
        $this->db = Instance::ensure($this->db, Connection::className());
        if ($this->cache !== null) {
            $this->cache = Instance::ensure($this->cache, Cache::className());
        }
    }
1058597
function () {
        while (this.head !== null) {
            var temp = this.head;
            this.head = this.head.next();   // use next() the instead of "_next", otherwise it will loop forever
            temp._list = null;
            temp._next = null;
            temp._prev = null;
        }

        this.head = null;
        this.size = 0;
    }
619344
public function index()
    {
        $this->getListingService()
            ->setOrder($this->getOrder())
            ->setPagination($this->getPagination())
            ->getFilters()->add($this->getSearchFilter());
        $this->set(
            [
                $this->getEntityNamePlural() => $this->getListingService()
                    ->getList(),
                'pagination' => $this->getListingService()->getPagination()
            ]
        );
    }
859111
private static function init() {
        self::$huffmanLookup = self::huffmanLookupInit();
        self::$huffmanCodes = self::huffmanCodesInit();
        self::$huffmanLengths = self::huffmanLengthsInit();

        foreach (\array_column(self::TABLE, 0) as $index => $name) {
            if (isset(self::$indexMap[$name])) {
                continue;
            }

            self::$indexMap[$name] = $index + 1;
        }
    }
1230373
public function commit()
    {
        $this->driver->inTransaction(
            function (Driver $driver, array $pendingQueries) {
                /** @var PendingQuery[] $pendingQueries */
                foreach ($pendingQueries as $item) {
                    $item->execute();
                }
            },
            $this->pendingQueries
        );
        $this->pendingQueries = [];
    }
1070336
public function initialize()
    {
        $this->hasMany('id', UserPasswordChange::class, 'user_id', [
            'alias' => 'PasswordChanges',
            'foreignKey' => [
                'action' => Relation::ACTION_CASCADE,
            ],
        ]);

        $this->hasMany('id', UserPasswordReset::class, 'user_id', [
            'alias' => 'PasswordResets',
            'foreignKey' => [
                'action' => Relation::ACTION_CASCADE,
            ],
        ]);

        $this->hasMany('id', UserLoginHistory::class, 'user_id', [
            'alias' => 'LoginHistory',
            'foreignKey' => [
                'action' => Relation::ACTION_CASCADE,
            ],
        ]);

        $this->belongsTo("user_type_id", UserType::class, "id", [
            "alias" => "UserType",
            "foreignKey" => [
                "allowNulls" => true,
                "message" => "The user type specified is invalid!"
            ],
        ]);
    }
496591
public function initializeObject()
    {
        if ($this->cache->has('parsedFormats') && $this->cache->has('parsedFormatsIndices') && $this->cache->has('localizedLiterals')) {
            $this->parsedFormats = $this->cache->get('parsedFormats');
            $this->parsedFormatsIndices = $this->cache->get('parsedFormatsIndices');
            $this->localizedLiterals = $this->cache->get('localizedLiterals');
        }
    }
967582
private void lsUpdateGroup(final int isa, final int first, final int last) {
        final int[] SA = this.SA;

        int a, b;
        int t;

        for (a = first; a < last; ++a) {
            if (0 <= SA[a]) {
                b = a;
                do {
                    SA[isa + SA[a]] = a;
                } while (++a < last && 0 <= SA[a]);
                SA[b] = b - a;
                if (last <= a) {
                    break;
                }
            }
            b = a;
            do {
                SA[a] = ~SA[a];
            } while (SA[++a] < 0);
            t = a;
            do {
                SA[isa + SA[b]] = t;
            } while (++b <= a);
        }
    }
392999
private int gatherInfo(LblTree aT, int postorder) {
		int currentSize = 0;
		int childrenCount = 0;
		int descSizes = 0;
		int krSizesSum = 0;
		int revkrSizesSum = 0;
		int preorder = preorderTmp;

		int heavyChild = -1;
		int leftChild = -1;
		int rightChild = -1;
		int weight = -1;
		int maxWeight = -1;
		int currentPostorder = -1;
		int oldHeavyChild = -1;

		ArrayList<Integer> heavyRelSubtreesTmp = new ArrayList<>();
		ArrayList<Integer> leftRelSubtreesTmp = new ArrayList<>();
		ArrayList<Integer> rightRelSubtreesTmp = new ArrayList<>();

		ArrayList<Integer> childrenPostorders = new ArrayList<>();

		preorderTmp++;

		// enumerate over children of current node
		for (Enumeration<?> e = aT.children(); e.hasMoreElements(); ) {
			childrenCount++;

			postorder = gatherInfo((LblTree) e.nextElement(), postorder);

			childrenPostorders.add(postorder);

			currentPostorder = postorder;

			// heavy path
			weight = sizeTmp + 1;
			if (weight >= maxWeight) {
				maxWeight = weight;
				oldHeavyChild = heavyChild;
				heavyChild = currentPostorder;
			} else {
				heavyRelSubtreesTmp.add(currentPostorder);
			}
			if (oldHeavyChild != -1) {
				heavyRelSubtreesTmp.add(oldHeavyChild);
				oldHeavyChild = -1;
			}

			// left path
			if (childrenCount == 1) {
				leftChild = currentPostorder;
			} else {
				leftRelSubtreesTmp.add(currentPostorder);
			}

			// right path
			rightChild = currentPostorder;
			if (e.hasMoreElements()) {
				rightRelSubtreesTmp.add(currentPostorder);
			}

			// subtree size
			currentSize += 1 + sizeTmp;

			descSizes += descSizesTmp;

			if (childrenCount > 1) {
				krSizesSum += krSizesSumTmp + sizeTmp + 1;
			} else {
				krSizesSum += krSizesSumTmp;
				nodeType[LEFT][currentPostorder] = true;
			}

			if (e.hasMoreElements()) {
				revkrSizesSum += revkrSizesSumTmp + sizeTmp + 1;
			} else {
				revkrSizesSum += revkrSizesSumTmp;
				nodeType[RIGHT][currentPostorder] = true;
			}
		}

		postorder++;

		// postorder
		aT.setTmpData(postorder);

		int currentDescSizes = descSizes + currentSize + 1;
		info[POST2_DESC_SUM][postorder] =
				(currentSize + 1) * (currentSize + 1 + 3) / 2 - currentDescSizes;
		info[POST2_KR_SUM][postorder] = krSizesSum + currentSize + 1;
		info[POST2_REV_KR_SUM][postorder] = revkrSizesSum + currentSize + 1;

		// POST2_LABEL
		// labels[rootNumber] = ld.store(aT.getLabel());
		info[POST2_LABEL][postorder] = ld.store(aT.getLabel());

		// POST2_PARENT
		for (Integer i : childrenPostorders) {
			info[POST2_PARENT][i] = postorder;
		}

		// POST2_SIZE
		info[POST2_SIZE][postorder] = currentSize + 1;
		if (currentSize == 0) {
			leafCount++;
		}

		// POST2_PRE
		info[POST2_PRE][postorder] = preorder;

		// PRE2_POST
		info[PRE2_POST][preorder] = postorder;

		// RPOST2_POST
		info[RPOST2_POST][treeSize - 1 - preorder] = postorder;

		// heavy path
		if (heavyChild != -1) {
			paths[HEAVY][postorder] = heavyChild;
			nodeType[HEAVY][heavyChild] = true;

			if (leftChild < heavyChild && heavyChild < rightChild) {
				info[POST2_STRATEGY][postorder] = BOTH;
			} else if (heavyChild == leftChild) {
				info[POST2_STRATEGY][postorder] = RIGHT;
			} else if (heavyChild == rightChild) {
				info[POST2_STRATEGY][postorder] = LEFT;
			}
		} else {
			info[POST2_STRATEGY][postorder] = RIGHT;
		}

		// left path
		if (leftChild != -1) {
			paths[LEFT][postorder] = leftChild;
		}
		// right path
		if (rightChild != -1) {
			paths[RIGHT][postorder] = rightChild;
		}

		// heavy/left/right relevant subtrees
		relSubtrees[HEAVY][postorder] = toIntArray(heavyRelSubtreesTmp);
		relSubtrees[RIGHT][postorder] = toIntArray(rightRelSubtreesTmp);
		relSubtrees[LEFT][postorder] = toIntArray(leftRelSubtreesTmp);

		descSizesTmp = currentDescSizes;
		sizeTmp = currentSize;
		krSizesSumTmp = krSizesSum;
		revkrSizesSumTmp = revkrSizesSum;

		return postorder;
	}
962474
public function init()
    {
        parent::init();

        $this->datetimeFormat = (empty(Yii::$app->params['site']->datetimeFormat)) ? $this->datetimeFormat : Yii::$app->params['site']->datetimeFormat;
        $this->timezone = (empty(Yii::$app->params['site']->timezone)) ? $this->timezone : Yii::$app->params['site']->timezone;
    }