.word 0x9a2a2d10  ! 353: ANDN_I	andn 	%r8, 0x0d10, %r13
	.word 0x8c0a0009  ! 353: AND_R	and 	%r8, %r9, %r6
	.word 0x8a1a2ba0  ! 353: XOR_I	xor 	%r8, 0x0ba0, %r5
IDLE_INTR_196:
!$EV trig_pc_d(2,expr(@VA(.MAIN.IDLE_INTR_196), 16, 16)) -> intp(0, 2, 1)
!$EV trig_pc_d(2,expr(@VA(.MAIN.IDLE_INTR_196)+4, 16, 16)) -> intp(0, 3, 1)
	.word 0x88a22c60  ! 355: SUBcc_I	subcc 	%r8, 0x0c60, %r4
	.word 0x98aa0009  ! 355: ANDNcc_R	andncc 	%r8, %r9, %r12
	.word 0x8a8a0009  ! 355: ANDcc_R	andcc 	%r8, %r9, %r5
	.word 0x8e322c74  ! 355: ORN_I	orn 	%r8, 0x0c74, %r7
	.word 0x84120009  ! 355: OR_R	or 	%r8, %r9, %r2
	.word 0x89322001  ! 355: SRL_I	srl 	%r8, 0x0001, %r4
	.word 0x8a320009  ! 355: SUBC_R	orn 	%r8, %r9, %r5
	.word 0xa8022a10  ! 355: ADD_I	add 	%r8, 0x0a10, %r20
	.word 0x87320009  ! 355: SRL_R	srl 	%r8, %r9, %r3
	.word 0x8c1225a4  ! 355: OR_I	or 	%r8, 0x05a4, %r6
	.word 0xa6b20009  ! 355: SUBCcc_R	orncc 	%r8, %r9, %r19
	.word 0x98120009  ! 355: OR_R	or 	%r8, %r9, %r12
	.word 0x86ba2828  ! 355: XNORcc_I	xnorcc 	%r8, 0x0828, %r3
	.word 0xb80a2b50  ! 355: AND_I	and 	%r8, 0x0b50, %r28
	.word 0x8cba0009  ! 356: XNORcc_R	xnorcc 	%r8, %r9, %r6
	.word 0xb6b22688  ! 356: ORNcc_I	orncc 	%r8, 0x0688, %r27
	.word 0xbe0a26ac  ! 356: AND_I	and 	%r8, 0x06ac, %r31
	.word 0x8a920009  ! 356: ORcc_R	orcc 	%r8, %r9, %r5
	.word 0x82022020  ! 356: ADD_I	add 	%r8, 0x0020, %r1
	.word 0x852a0009  ! 356: SLL_R	sll 	%r8, %r9, %r2
	.word 0x849220f8  ! 356: ORcc_I	orcc 	%r8, 0x00f8, %r2
	.word 0x89321009  ! 356: SRLX_R	srlx	%r8, %r9, %r4
	.word 0xa2aa0009  ! 356: ANDNcc_R	andncc 	%r8, %r9, %r17
	.word 0x8d780409  ! 356: MOVR_R	move	%r0, %r9


>>|cRXP_WARN_Follow the arrow|r.
    .complete 40837,1 --1/1 Follow the worgen tracks
step
    .goto 42,47.22,51.69
    >>|cRXP_WARN_Follow the arrow|r.
    .complete 40837,2 --1/1 Continue following the worgen
step
    .goto 42,49.17,57.66
    >>|cRXP_WARN_Follow the arrow|r.
    .complete 40837,3 --1/1 Continue following the worgen
step
    .goto 42,45.93,63.33
    >>|cRXP_WARN_Follow the arrow|r.
    .complete 40837,4 --1/1 Continue following the worgen
step
    .goto 42,46.90,69.49
    >>|Tinterface/worldmap/chatbubble_64grey.blp:20|tTalk to |cRXP_FRIENDLY_Revil Kost|r
    .turnin 40837 >>Turn in The Deadwind Hunt
    .accept 40838 >>Accept The Dark Riders
    .target Revil Kost
step
    .isOnQuest 40838
    .goto 42,46.28,69.07
    .enterScenario 1014 >>|cRXP_WARN_Follow the arrow|r
step
    #completewith next
    #label KarazhanCatacombsA
    .isInScenario 1014
    .scenario 2108,1 --Karazhan Catacombs infiltrated
step
    #completewith KarazhanCatacombsA
    .goto 46,71.72,83.73
    .zone 46 >>Jump down
step
    #requires KarazhanCatacombsA
    .isInScenario 1014
    .goto 46,72.09,74.41
    >>|cRXP_WARN_Enter the catacombs|r
    .scenario 2108,1 --Karazhan Catacombs infiltrated
step
    .isInScenario 1014
    #title Use |T252188:0|t[Solar Beam]
    .goto 46,55.90,69.19
    >>Use |T252188:0|t[Solar Beam] on |cRXP_ENEMY_Ariden|r |cRXP_WARN_from the quest log|r.
    .scenario 2109,1 --Spirit Barrier crossed
    .mob Ariden
    .usespell 311930
step
    .isInScenario 1014
    .goto 46,56.36,69.25
    >>Kill |cRXP_ENEMY_The Conservator|r.
    .scenario 2110,1 --Conservator Defeated
    .mob The Conservator
step
    #completewith next
    #hidewindow
    .cast 3365 >>1
    .timer 25,Roleplay
step
    .isInScenario 1014
    .goto 46,43.63,67.82
    >>|TInterface/cursor/crosshair/interact.blp:20|tClick on the |cRXP_PICK_The Scythe of Elune|r. |cRXP_WARN_Wait for the roleplay|r.
    .scenario 2111,1 --Scythe of Elune found
step
    .isInScenario 1014
    .goto 46,58.06,64.22,15,0
    .goto 46,55.33,49.51,10,0
    .goto 46,67.81,44.27,10,0
    .goto 46,68.49,37.77
    >>|cRXP_WARN_Follow the arrow up the stairs to |cRXP_ENEMY_Ariden|r.
    .scenario 2112,1 --Ariden followed
    .timer 15,Ariden Roleplay
step
    .isInScenario 1014
    .goto 46,68.36,24.43
    >>Kill |cRXP_ENEMY_Ariden|r.
    .scenario 2113,1 --Ariden defeated
    .complete 40838,1 --1/1 Defeat the Dark Riders
    .timer 33,Ariden Roleplay
    .mob Ariden
step
    .goto 46,68.28,24.62
    >>|TInterface/cursor/crosshair/interac


1, 4]));
	t.deepEqual(symmetricDifference(x, z), new Set([1, 2, 4, 5]));
	t.deepEqual(symmetricDifference(x, y, z), new Set([1, 3, 5]));
	t.deepEqual(symmetricDifference(x, y, z, w), new Set([3, 5, 6, 7]));
});

test('union', (t) => {
	const x = new Set([1, 2, 3]);
	const y = new Set([2, 3, 4]);
	const z = new Set([4, 5, 6]);
	t.deepEqual(union(x), new Set([1, 2, 3]));
	t.deepEqual(union(x, y), new Set([1, 2, 3, 4]));
	t.deepEqual(union(x, y, z), new Set([1, 2, 3, 4, 5, 6]));
});

test('intersection', (t) => {
	const x = new Set([1, 2, 3]);
	const y = new Set([2, 3, 4]);
	const z = new Set([3, 4, 5]);
	t.deepEqual(intersection(x), new Set([1, 2, 3]));
	t.deepEqual(intersection(x, y), new Set([2, 3]));
	t.deepEqual(intersection(x, y, z), new Set([3]));
});

test('equivalence', (t) => {
	const x = new Set([1, 2, 3]);
	const y = new Set([3, 1, 2]);
	const z = new Set([2, 3, 1]);
	const w = new Set([1, 2, 3, 4]);

	t.true(equivalence(x));
	t.true(equivalence(x, y));
	t.true(equivalence(x, y, z));
	t.false(equivalence(x, w));
	t.false(equivalence(x, y, w));
	t.false(equivalence(x, y, z, w));
});
import { Action } from '@ngrx/store';
import { TemperatureActionTypes } from '../actions/temperature.actions';
import { Temperature } from '../../models/temperature.model';

export const initialState: Temperature = {
    minskTemperature: -5,
    londonTemperature: 10
};

export function temperatureReducer(state = initialState, action: Action) {
    switch (action.type) {

        case TemperatureActionTypes.Change:
            return state;

        case TemperatureActionTypes.Increment:
            state.minskTemperature++;
            return {minskTemperature: state.minskTemperature, londonTemperature: state.londonTemperature};

        case TemperatureActionTypes.Decrement:
            state.londonTemperature--;
            return {minskTemperature: state.minskTemperature, londonTemperature: state.londonTemperature};

        case TemperatureActionTypes.Reset:
            state.minskTemperature = -5;
            state.londonTemperature = 10;
            return {minskTemperature: state.minskTemperature, londonTemperature: state.londonTemperature};

        default:
            return state;
    }
}
import { ValidationResultValue } from '../typings/ValidationResultValue';

export class ValidationResult implements ValidationResultValue {
    /**
     * 성공
     */
    public static success: ValidationResultValue = new ValidationResult({
        valid: true,
    });
    /**
     * 실패
     * @param message 실패 메시지
     */
    public static fail(message: string): ValidationResultValue {
        return new ValidationResult({
            valid: false,
            message: message,
        });
    }
    public valid: boolean;
    public message?: string;
    constructor(value: ValidationResultValue) {
        this.valid = value && value.valid;
        this.message = value && value.message;
    }
}
import * as functions from 'firebase-functions';
import firebase from './Firebase'
import { UserTweet } from './UserTweet';

export const addFavorite = functions.https.onRequest((request, response) => {

    response.header('Access-Control-Allow-Origin', '*');
    response.header('Access-Control-Allow-Headers', request.header('Access-Control-Request-Headers'));
    response.header('Access-Control


) const = 0;

  //! Return the degree of element
  virtual mpm::ElementDegree degree() const = 0;

  //! Return the shapefn type of element
  virtual mpm::ShapefnType shapefn_type() const = 0;

  //! Return nodal coordinates of a unit cell
  virtual Eigen::MatrixXd unit_cell_coordinates() const = 0;

  //! Return the side indices of a cell to calculate the cell length
  //! \retval indices Outer-indices that form the sides of the cell
  virtual Eigen::MatrixXi sides_indices() const = 0;

  //! Return the corner indices of a cell to calculate the cell volume
  //! \retval indices Outer-indices that form the cell
  virtual Eigen::VectorXi corner_indices() const = 0;

  //! Return indices of a sub-tetrahedrons in a volume
  //! to check if a point is inside /outside of a hedron
  //! \retval indices Indices that form sub-tetrahedrons
  virtual Eigen::MatrixXi inhedron_indices() const = 0;

  //! Return indices of a face of an element
  //! \param[in] face_id given id of the face
  //! \retval indices Indices that make the face
  virtual Eigen::VectorXi face_indices(unsigned face_id) const = 0;

  //! Return number of faces
  virtual unsigned nfaces() const = 0;
  //! Return unit element length
  virtual double unit_element_length() const = 0;

  //! Return quadrature of the element
  virtual std::shared_ptr<mpm::Quadrature<Tdim>> quadrature(
      unsigned nquadratures) const = 0;

  //! Compute volume
  //! \param[in] nodal_coordinates Coordinates of nodes forming the cell
  //! \retval volume Return the volume of cell
  virtual double compute_volume(
      const Eigen::MatrixXd& nodal_coordinates) const = 0;

  //! Return if natural coordinates can be evaluates
  virtual bool isvalid_natural_coordinates_analytical() const = 0;

  //! Compute Natural coordinates of a point (analytical)
  //! \param[in] nodal_coordinates Coordinates of nodes forming the cell
  //! \param[in] point Location of the point in cell
  //! \retval xi Return the local coordinates
  virtual VectorDim natural_coordinates_analytical(
      const VectorDim& point,
      const Eigen::MatrixXd& nodal_coordinates) const = 0;
};

}  // namespace mpm

#endif  // MPM_ELEMENT_H_


the time zone).  For
this reason, by default ExifTool does not assume a time zone for these
values.  However, if the API QuickTimeUTC option is set, then ExifTool will
assume these values are properly stored as UTC, and will convert them to
local time when extracting.

When writing string-based date/time tags, the system time zone is added if
the PrintConv option is enabled and no time zone is specified.  This is
because Apple software may display crazy values if the time zone is missing
for some tags.

By default ExifTool will remove null padding from some QuickTime containers
in Canon CR3 files when writing, but the
QuickTimePad option may be used to preserve
the original size by padding with nulls if necessary.

See
https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/
for the official specification.

Tag ID	Tag Name
Writable	Values / Notes

'GPS '
GPSDataList2?
no

'IDIT'
DateTimeOriginal
string

'PICT'
PreviewPICT
no

'_htc'
HTCInfo
-
--> QuickTime HTCInfo Tags

'ardt'
ARDroneFile
no

'frea'
Kodak_frea
-
--> Kodak frea Tags

'free'
KodakFree

Pittasoft

ThumbnailImage

Free?
-
-
no
no
--> Kodak Free Tags

--> QuickTime Pittasoft Tags

'ftyp'
FileType
-
--> QuickTime FileType Tags

'gps0'
GPSTrack
-
--> <a href='


Generate3FlierState());
        }
    }
    export module States {
        export class FlierFlyingHorizontal extends AbstractState {
            enter(sm: EntityStateMachine) {
            }
            update(sm: EntityStateMachine) {
                var e = sm.e;
                e.counter["ac"] = (e.counter["ac"] + 1) % 4;
                if (e.counter["ac"] < 2) e.code = 147;
                else e.code = 148;

                e.vx = e.reverse_horizontal ? 30 : -30;

                var players = <Array<Player>>sm.e.ss.Players.get_all();

                this.checkCollisionWithPlayer(sm);
            }
            // プレイヤーとの当たり判定 をプレイヤーのupdate処理に追加する
            // 現時点ではプレイヤーと敵双方のサイズが32*32であることしか想定していない
            checkCollisionWithPlayer(sm: EntityStateMachine) {
                var e = sm.e;
                var players = <Array<Player>>sm.e.ss.Players.get_all();
                for (var i = 0; i < players.length; i++) {
                    var p = players[i];
                    // 現在のpをスコープに束縛
                    ((p: Player) => {
                        p.addOnceEventHandler("update",() => {
                            var dx = Math.abs(e.x - p.x); // プレイヤーとのx座標の差
                            var dy = Math.abs(e.y - p.y); // プレイヤーとのy座標の差
                            if (p.flags["isAlive"] && dx < 30 && dy < 23) { // プレイヤーと接触した

                                if (dx < 27 && p.vy > 0 || (p.flags["isStamping"] && p.counter["stamp_waiting"] == 5)) { // 踏まれる
                                    e.dispatchEvent(new SpriteCollisionEvent("onstamped", p));
                                    p.y = e.y - 12;
                                    p.dispatchEvent(new NumberEvent("onstamp", 2));
                                    e.addOnceEventHandler("killed",() => {
                                        p.dispatchEvent(new ScoreEvent("addscore", 10));
                                    });
                                }
                                // TODO:バリア判定はここに書く
                                else { // プレイヤーにダメージ
                                    p.dispatchEvent(new PlayerMissEvent("miss", 1));
                                }
                            }
                        });
                    })(p);
                }
            }
        }
        export class FlierFlyingVertical extends FlierFlyingHorizontal {
            enter(sm: EntityStateMachine) {
                var e = sm.e;
                e.vx = 0;
                e.vy = -40;
            }
            update(sm: EntityStateMachine) {
                var e = sm.e;
                e.counter["ac"] = (e.counter["ac"] + 1) % 4;
                if (e.counter["ac"] < 2) e.code = 147;
                else e.code = 148;

                if (e.y <= e.counter["y_lower"]) {
                    e.vy += 10;
                    if (e.vy > 40) e.vy = 40;
                }
                else if (e.y >= e.counter["y_upper"]) {
                    e.vy -= 10;
                    if (e.vy < -40) e.vy = -40;
                }

                var players = <Array<Player>>sm.e.ss.Players.get_all();

                var pt: Player = null; // 最も近いプレイヤー
                for (var i = 0; i < players.length; i++) {
                    var p = players[i];
                    if (pt == null) {
                        p


:not([class*="btn-"]):hover,
.btn-default:hover {
  color: rgba(0, 0, 0, 0.84);
}
.btn:not([class*="btn-"]):hover,
.btn-default:hover,
.btn-flat:not(.btn-link):hover,
.btn:not([class*="btn-"]).active,
.btn-default.active,
.btn-flat:not(.btn-link).active {
  background-color: rgba(255, 255, 255, 0.5);
}
.open > .dropdown-toggle.btn,
.open > .dropdown-toggle.btn-default {
  background-color: transparent;
}
.open > .dropdown-toggle.btn-black {
  background-color: #000000;
}
.open > .dropdown-toggle.btn-white {
  background-color: #ffffff;
}
.open > .dropdown-toggle.btn-inverse {
  background-color: #3f51b5;
}
.open > .dropdown-toggle.btn-primary {
  background-color: #009688;
}
.open > .dropdown-toggle.btn-success {
  background-color: #4caf50;
}
.open > .dropdown-toggle.btn-info {
  background-color: #03a9f4;
}
.open > .dropdown-toggle.btn-warning {
  background-color: #ff5722;
}
.open > .dropdown-toggle.btn-danger {
  background-color: #f44336;
}
.open > .dropdown-toggle.btn-material-red {
  background-color: #f44336;
}
.open > .dropdown-toggle.btn-material-pink {
  background-color: #e91e63;
}
.open > .dropdown-toggle.btn-material-purple {
  background-color: #9c27b0;
}
.open > .dropdown-toggle.btn-material-deep-purple {
  background-color: #673ab7;
}
.open > .dropdown-toggle.btn-material-indigo {
  background-color: #3f51b5;
}
.open > .dropdown-toggle.btn-material-blue {
  background-color: #2196f3;
}
.open > .dropdown-toggle.btn-material-light-blue {
  background-color: #03a9f4;
}
.open > .dropdown-toggle.btn-material-cyan {
  background-color: #00bcd4;
}
.open > .dropdown-toggle.btn-material-teal {
  background-color: #009688;
}
.open > .dropdown-toggle.btn-material-green {
  background-color: #4caf50;
}
.open > .dropdown-toggle.btn-material-light-green {
  background-color: #8bc34a;
}
.open > .dropdown-toggle.btn-material-lime {
  background-color: #cddc39;
}
.open > .dropdown-toggle.btn-material-yellow {
  background-color: #ffeb3b;
}
.open > .dropdown-toggle.btn-material-amber {
  background-color: #ffc107;
}
.open > .dropdown-toggle.btn-material-orange {
  background-color: #ff9800;
}
.open > .dropdown-toggle.btn-material-deep-orange {
  background-color: #ff5722;
}
.open > .dropdown-toggle.btn-material-brown {
  background-color: #795548;
}
.open > .dropdown-toggle.btn-material-grey {
  background-color: #9e9e9e;
}
.open > .dropdown-toggle.btn-material-blue-grey {
  background-color: #607d8b;
}
.btn-group .btn + .btn,
.btn-group .btn + .btn-group,
.btn-group .btn-group + .btn,
.btn-


#ifndef CH07_screen
#define CH07_screen

#include <string>
#include <iostream>

class Screen {
public:
    using pos = std::string::size_type;

    Screen() = default; // 1
    Screen(pos ht, pos wd):height(ht), width(wd), contents(ht*wd, ' '){ } // 2
    Screen(pos ht, pos wd, char c):height(ht), width(wd), contents(ht*wd, c){ } // 3

    char get() const { return contents[cursor]; }
    char get(pos r, pos c) const { return contents[r*width+c]; }
    inline Screen& move(pos r, pos c);
    inline Screen& set(char c);
    inline Screen& set(pos r, pos c, char ch);

    const Screen& display(std::ostream &os) const { do_display(os); return *this; }
    Screen& display(std::ostream &os) { do_display(os); return *this; }

private:
    void do_display(std::ostream &os) const { os << contents; }

private:
    pos cursor = 0;
    pos height = 0, width = 0;
    std::string contents;
};

inline Screen& Screen::move(pos r, pos c)
{
    cursor = r*width + c;
    return *this;
}

inline Screen& Screen::set(char c)
{
    contents[cursor] = c;
    return *this;
}

inline Screen& Screen::set(pos r, pos c, char ch)
{
    contents[r*width+c] = ch;
    return *this;
}

#endif


t.NotExist<List<Int>>())
        val position = 5
        val offset = 3

        val result = releaseUnusedPage(state, position, offset, 3)

        Assertions.assertNull(result)
    }

    @Test
    fun testReleaseUnusedPageWithSmallDiffCount() {
        val items = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
        val state = PageableState.Fixed(StateContent.Exist(items))
        val position = 5
        val offset = 1

        val result = releaseUnusedPage(state, position, offset, 20)

        Assertions.assertNull(result)
    }

    @Test
    fun testReleaseUnusedPageWithNegativePosition() {
        val items = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
        val state = PageableState.Fixed(StateContent.Exist(items))
        val position = -5
        val offset = 3

        val result = releaseUnusedPage(state, position, offset, 3)

        Assertions.assertNull(result)
    }

    @Test
    fun testReleaseUnusedPageWithPositionGreaterThanSize() {
        val items = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
        val state = PageableState.Fixed(StateContent.Exist(items))
        val position = 15
        val offset = 3

        val result = releaseUnusedPage(state, position, offset, 3)

        Assertions.assertNull(result)
    }

}package net.pantasystem.milktea.data.infrastructure.user.renote.mute.delegate

import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.test.runTest
import kotlinx.datetime.Clock
import net.pantasystem.milktea.api.misskey.users.renote.mute.RenoteMuteDTO
import net.pantasystem.milktea.data.infrastructure.user.renote.mute.IsSupportRenoteMuteInstance
import net.pantasystem.milktea.data.infrastructure.user.renote.mute.RenoteMuteApiAdapter
import net.pantasystem.milktea.data.infrastructure.user.renote.mute.db.RenoteMuteDao
import net.pantasystem.milktea.data.infrastructure.user.renote.mute.db.RenoteMuteRecord
import net.pantasystem.milktea.model.account.Account
import net.pantasystem.milktea.model.user.User
import net.pantasystem.milktea.model.user.renote.mute.RenoteMute
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import kotlin.time.Duration.Companion.days

internal class CreateRenoteMuteAndPushToRemoteDelegateTest {

    // キャッシュに存在しない
    // APIがRenoteMuteをサポートしている場合
    @OptIn(ExperimentalCoroutinesApi::class)
    @Test
    fun notExistsCacheAndSupportRenoteMute() = runTest {

        val expect = RenoteMute(
            User.Id(0L, "user-1"),
            createdAt = Clock.System.now(),
            postedAt = null,
        )

        var actualByUpdated: RenoteMuteRecord? = null
        var actualByInserted: RenoteMuteRecord? = null
        val dao: RenoteMuteDao = object : RenoteMuteDao {
            override suspend fun insert(renoteMuteRecord: RenoteMuteRecord): Long {
                actualByInserted = renoteMuteRecord
                return 1
            }

            override suspend fun update(renoteMuteRecord: RenoteMuteRecord) {
                actualByUpdated = renoteMuteRecord
            }

            override suspend fun insertAll(records: List<RenoteMuteRecord>): List<Long> = emptyList()
            override suspend fun findByAccount(accountId: Long): List<RenoteMuteRecord> = emptyList()
            override suspend fun findByUser


 by viewModel.chatBoxState.collectAsStateWithLifecycle()
  IconButton(
    onClick = {
      viewModel.switchChatBoxState()
    },
  ) {
    Icon(
      Icons.Default.KeyboardArrowUp,
      contentDescription = null,
      modifier = Modifier.graphicsLayer {
        rotationZ = if (isExpanded != BoxState.Collapsed) 180F else 0f
      }
    )
  }
}

@Composable
private fun SendMessageButton(
  viewModel: ChatScreenVM,
  search: String,
  modifier: Modifier = Modifier
) {
  IconButton(
    onClick = {
      viewModel.sendMessage(search)
    }, enabled = search.isNotEmpty(), modifier = modifier
  ) {
    Icon(
      Icons.Default.Send,
      contentDescription = null,
      tint = if (search.isEmpty()) SlackCloneColorProvider.colors.sendButtonDisabled else SlackCloneColorProvider.colors.sendButtonEnabled
    )
  }
}

@Composable
private fun ChatTFPlusPlaceHolder(
  search: String,
  modifier: Modifier = Modifier,
  innerTextField: @Composable () -> Unit,
  viewModel: ChatScreenVM
) {
  Row(
    modifier
      .padding(16.dp), verticalAlignment = Alignment.CenterVertically
  ) {
    if (search.isEmpty()) {
      Text(
        text = "Message ${viewModel.channel?.name}",
        style = SlackCloneTypography.subtitle1.copy(
          color = SlackCloneColorProvider.colors.textSecondary,
        ),
        modifier = Modifier.weight(1f)
      )
    } else {
      innerTextField()
    }
  }
}

package dev.baseio.slackclone.navigator.composenavigator

import androidx.navigation.NavOptionsBuilder
import androidx.navigation.navOptions
import dev.baseio.slackclone.navigator.ComposeNavigationCommand
import dev.baseio.slackclone.navigator.ComposeNavigator
import dev.baseio.slackclone.navigator.asFlow
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
import javax.inject.Inject

class SlackCloneComposeNavigator @Inject constructor(): ComposeNavigator() {

  override fun navigate(route: String, optionsBuilder: (NavOptionsBuilder.() -> Unit)?) {
    val options = optionsBuilder?.let { navOptions(it) }
    navigationCommands.tryEmit(ComposeNavigationCommand.NavigateToRoute(route, options))
  }

  override fun navigateAndClearBackStack(route: String) {
    navigationCommands.tryEmit(ComposeNavigationCommand.NavigateToRoute(route, navOptions {
      popUpTo(0)
    }))
  }

  override fun popUpTo(route: String, inclusive: Boolean) {
    navigationCommands.tryEmit(ComposeNavigationCommand.PopUpToRoute(route, inclusive))
  }

  override fun <T> navigateBackWithResult(
    key: String,
    result: T,
    route: String?
  ) {
    navigationCommands.tryEmit(
      ComposeNavigationCommand.NavigateUpWithResult(
        key = key,
        result = result,
        route = route
      )
    )
  }

  override fun <T> observeResult(key: String, route: String?): Flow<T> {
    return navControllerFlow
      .filterNotNull()
      .flatMapLatest { navController ->
        val backStackEntry = route?.let { navController.getBackStackEntry(it) }
          ?: navController.currentBackStackEntry

        backStackEntry?.savedStateHandle?.let { savedStateHandle ->
          savedStateHandle.getLiveData<T?>(key)
            .asFlow()
            .filter { it != null }
            .onEach {
              // Nullify the result to avoid resubmitting it
              s


 timeout`)
        return reject(err)
      }

      return tries++
    }, retryPeriod * 1000)
  })

export const MESSAGE_RESTARTING = 'Attempting to restart ncdc server'
export const MESSAGE_RESTARTING_FAILURE = 'Could not restart ncdc server'

export type ServeResult = {
  getStrippedOutput(): string
  waitForOutput(target: string | RegExp): Promise<void>
  waitUntilAvailable(): Promise<void>
}

export type CleanupTask = () => void

export const SERVE_HOST = 'http://localhost:4000'
export const fetch = (endpoint: string, init?: RequestInit): Promise<Response> =>
  nodeFetch(`${SERVE_HOST}${endpoint}`, init)

export const prepareServe = (cleanupTasks: CleanupTask[], timeout = 5) => async (
  args = '',
  checkAvailability = true,
): Promise<ServeResult> => {
  let hasExited = false
  const command = `CHOKIDAR_USEPOLLING=1 ${ENTRYPOINT} serve ${NCDC_CONFIG_FILE} -c ${TSCONFIG_FILE} ${args} -v`
  const ncdc: ChildProcess = exec(command)
  const output: string[] = []
  const getRawOutput = (): string => output.join('\n')
  const getStrippedOutput = (): string => strip(getRawOutput())

  ncdc.stdout && ncdc.stdout.on('data', (data: string) => output.push(...data.split('\n').filter((x) => !!x)))
  ncdc.stderr && ncdc.stderr.on('data', (data: string) => output.push(...data.split('\n').filter((x) => !!x)))
  ncdc.on('exit', (code, signal) => {
    hasExited = true
    if (code !== 0 && signal !== 'SIGTERM' && checkAvailability) {
      const quickInfo = `Code: ${code} | Signal: ${signal}`
      throw new Error(`${quickInfo} | Output:\n\n${getRawOutput()}`)
    }
  })

  const cleanup = (): void => {
    if (ncdc.killed || hasExited) return
    hasExited = true
    const killed = ncdc.kill()
    if (!killed) console.error('Could not kill the ncdc serve process')
  }

  cleanupTasks.push(cleanup)

  const failNicely = (message: string) => (err: Error): never => {
    console.error(`${message}. Output:\n\n${getRawOutput()}`)
    cleanup()
    throw err
  }

  let outputPointer = 0
  const waitForOutput: ServeResult['waitForOutput'] = async (target) => {
    return await waitForX(() => {
      const currentOutput = [...output]
      const searchableOutput = currentOutput.slice(outputPointer)
      const foundIndex = searchableOutput.findIndex((s) => {
        if (typeof target === 'string') return strip(s).includes(target)
        return target.test(s)
      }, timeout)

      if (foundIndex === -1) {
        outputPointer = currentOutput.length
        return false
      }

      outputPointer += foundIndex + 1
      return true
    }, timeout).catch(
      failNicely(
        `Did not find the string "${target}" in the output${
          outputPointer ? ' on or after line ' + outputPointer : ''
        }`,
      ),
    )
  }

  const waitUntilAvailable: ServeResult['waitUntilAvailable'] = () =>
    waitForX(async () => {
      const { status } = await fetch('/')
      return status === 200 && !getStrippedOutput().includes('EADDRINUSE')
    }, timeout).catch(failNicely(`The ncdc server was not contactable at ${SERVE_HOST}/`))

  if (checkAvailability) await waitUntilAvailable()
  return { getStrippedOutput, waitForOutput, waitUntilAvailable }
}
import chalk from "chalk";
import figures from "figures";
import { __ } from "i18n";
import { sprintf } from "sprintf-js";

import CliComponents from "../utils/cli/components";

import manager from "../manager-instance";

import ModuleNotFound


a512_AVX2_RORX_Len:
#endif /* __APPLE__ */
        pushq	%rbx
        pushq	%r12
        pushq	%r13
        pushq	%r14
        pushq	%r15
        pushq	%rbp
        testb	$0x80, %sil
        je	L_sha512_len_avx2_rorx_block
        movq	224(%rdi), %rax
        push	%rsi
        vmovdqu	(%rax), %ymm0
        vmovdqu	32(%rax), %ymm1
        vmovdqu	64(%rax), %ymm2
        vmovdqu	96(%rax), %ymm3
        vmovups	%ymm0, 64(%rdi)
        vmovups	%ymm1, 96(%rdi)
        vmovups	%ymm2, 128(%rdi)
        vmovups	%ymm3, 160(%rdi)
#ifndef __APPLE__
        call	Transform_Sha512_AVX2_RORX@plt
#else
        call	_Transform_Sha512_AVX2_RORX
#endif /* __APPLE__ */
        pop	%rsi
        addq	$0x80, 224(%rdi)
        subl	$0x80, %esi
        jz	L_sha512_len_avx2_rorx_done
L_sha512_len_avx2_rorx_block:
        movq	224(%rdi), %rax
        vmovdqa	L_avx2_rorx_sha512_flip_mask(%rip), %ymm15
        movq	(%rdi), %r8
        movq	8(%rdi), %r9
        movq	16(%rdi), %r10
        movq	24(%rdi), %r11
        movq	32(%rdi), %r12
        movq	40(%rdi), %r13
        movq	48(%rdi), %r14
        movq	56(%rdi), %r15
        # Start of loop processing two blocks
L_sha512_len_avx2_rorx_begin:
        subq	$0x540, %rsp
        leaq	L_avx2_rorx_sha512_k_2(%rip), %rbp
        movq	%r9, %rbx
        xorq	%rdx, %rdx
        vmovdqu	(%rax), %xmm0
        vmovdqu	16(%rax), %xmm1
        vinserti128	$0x01, 128(%rax), %ymm0, %ymm0
        vinserti128	$0x01, 144(%rax), %ymm1, %ymm1
        vpshufb	%ymm15, %ymm0, %ymm0
        vpshufb	%ymm15, %ymm1, %ymm1
        vmovdqu	32(%rax), %xmm2
        vmovdqu	48(%rax), %xmm3
        vinserti128	$0x01, 160(%rax), %ymm2, %ymm2
        vinserti128	$0x01, 176(%rax), %ymm3, %ymm3
        vpshufb	%ymm15, %ymm2, %ymm2
        vpshufb	%ymm15, %ymm3, %ymm3
        vmovdqu	64(%rax), %xmm4
        vmovdqu	80(%rax), %xmm5
        vinserti128	$0x01, 192(%rax), %ymm4, %ymm4
        vinserti128	$0x01, 208(%rax), %ymm5, %ymm5
        vpshufb	%ymm15, %ymm4, %ymm4
        vpshufb	%ymm15, %ym


',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2050260',	'',	'海洋动力适应性纤维基智能可穿戴电子系统。',	'',	'',	'',	'',	'',	'',	'',	'',	'9908001',	'',	'',	'2',	'',	'卡蒂雅',	'Katya',	'[{"id":9908001,"pos":2,"enter":2},{"id":2007001,"pos":1,"out":2},{"id":6002001,"pos":3,"out":2}]',	'',	'3',	'',	'',	'',	'',	'',	'',	'',	'',	'2050261',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2050261',	'',	'想起来了，NERI和维洲大学海洋研究所合作研发的那批。',	'',	'',	'',	'',	'',	'',	'',	'',	'100000',	'',	'1',	'1',	'1',	'%s',	'',	'',	'',	'3',	'',	'',	'',	'',	'',	'',	'',	'',	'2050262',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2050262',	'',	'说起来，预计前几日就该抵达前哨基地报到的赤溟教授，至今未见踪影。',	'',	'',	'',	'',	'',	'',	'',	'',	'100000',	'',	'1',	'1',	'1',	'%s',	'',	'',	'',	'3',	'',	'',	'',	'',	'',	'',	'',	'',	'2050263',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2050263',	'',	'我记得她作为研究所特派员，这次来到碎星的目的是——',	'',	'',	'',	'',	'',	'',	'',	'',	'100000',	'',	'1',	'1',	'1',	'%s',	'',	'',	'',	'3',	'',	'',	'',	'',	'',	'',	'',	'',	'2050264',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2050264',	'',	'有那么一瞬，资料上代号赤溟的那位队员的脸，似乎与那个潮热梦境中的轮廓重合了起来，你摇了摇头，总觉得遗漏了什么重点。',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'1',	'',	'',	'',	'',	'',	'3',	'',	'',	'',	'',	'',	'',	'',	'',	'2050


ifiManager.startLocalOnlyHotspotWithConfig(
    config: SoftApConfiguration,
    executor: Executor?,
    callback: LocalOnlyHotspotCallback
) {
    WifiManager::class.java.getMethod(
        "startLocalOnlyHotspot", SoftApConfiguration::class.java, Executor::class.java,
        LocalOnlyHotspotCallback::class.java,
    ).invoke(this, config, executor, callback)
}

/**
 * It is NOT possible to workaround the random MAC problem on Android 11 and 12.
 *
 * Option 1: use WifiManager.setWifiApConfiguration to set the default tethering ap configuration,
 * and set mac randomization to NONE. This is blocked by a requirement for OVERRIDE_WIFI_CONFIG
 * permission (which is not available to third party app). See WifiServiceImpl#setSoftApConfiguration
  https://cs.android.com/android/platform/superproject/+/android-13.0.0_r54:packages/modules/Wifi/service/java/com/android/server/wifi/WifiServiceImpl.java;l=2727
 *
 * Option 2: try to disable Wifi Mac randomization so that the generateLocalOnlyHotspotConfig will
 * set randomization to NONE. Won't work: AP config util uses a system resource
 * R.bool.config_wifi_ap_mac_randomization_supported as per:
 * https://cs.android.com/android/platform/superproject/+/android-12.0.0_r1:packages/modules/Wifi/service/java/com/android/server/wifi/util/ApConfigUtil.java;l=699
 * The only way to override that would be a "Runtime Resource Overlay" RRO, which can only be installed
 * with system level permission.
 *
 * Option 3: Try using global settings as per
 * https://stackoverflow.com/questions/61748195/android-10-how-to-disable-randomized-mac-address-in-source-code
 * Won't work on Android 11/12 - Mac Randomization is now a per-network setting, not a global setting.
 * Might work on Android 9 as per
 *  https://github.com/elastic/AndroidSDKMirror-28/blob/master/com/android/server/wifi/WifiStateMachine.java
 *
 * Option 4: Use adb command / network settings app to change the default tethering, but the
 * settings app itself does not change this:
 * https://cs.android.com/android/platform/superproject/+/master:packages/apps/Settings/src/com/android/settings/wifi/tether/WifiTetherSettings.java;l=231
 *
 */

@Suppress("DEPRECATION") //Must use deperecated properties to support pre-SDK30
fun WifiManager.LocalOnlyHotspotReservation.toLocalHotspotConfig(
    nodeVirtualAddr: Int,
    port: Int,
    logger: MNetLogger? = null,
): WifiConnectConfig {
    return if(Build.VERSION.SDK_INT >= 30) {
        val softApConfig = softApConfiguration
        val ssid = softApConfig.ssidCompat
        val passphrase = softApConfig.passphrase
        val bssid = softApConfig.bssid

        logger?.invoke(Log.DEBUG, "toLocalOnlyHotspotConfig: got SoftApConfig: ${softApConfig.prettyPrint()}")

        if(ssid != null && passphrase != null) {
            WifiConnectConfig(
                nodeVirtualAddr = nodeVirtualAddr,
                ssid = ssid,
                passphrase = passphrase,
                port = port,
                hotspotType = HotspotType.LOCALONLY_HOTSPOT,
                bssid = bssid?.toString(),
                linkLocalAddr = null,
            )
        }else {
            logger?.invoke(Log.ERROR, "toLocalHotspotConfig: ssid and passphrase " +
                    "not provided by SoftApConfig: ${softApConfig.prettyPrint()}")
            throw IllegalStateException("toLocalHotspotConfig: ssid and passphrase not provided by " +
                    "SoftApConfig: ${softApConfig.prettyPrint()}!")
        }
    }else {
        val wifiConfig = wifi


	end
	_p('')

	swift.file_rules(prj, objfiles)
	swift.linker(prj, tool)
	swift.generate_clean(prj)
end

function swift.objectname(file)
	return path.join("$(OBJDIR)", path.getname(file)..".o")
end

function swift.file_rules(prj, objfiles)
		-- use a witness file per recommendation for handling multiple outputs
		-- see https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html
	_p('$(OBJECTS_WITNESS): $(SOURCES)')
	_p(1, "@rm -f $(OBJDIR)/data.tmp")
	_p(1, "@touch $(OBJDIR)/data.tmp")
	_p(1, "$(SILENT) $(SWIFTC) -frontend -c $(SOURCES) -enable-objc-interop $(SDK) -I $(OUT_DIR) $(SWIFTC_FLAGS) -module-cache-path $(MODULECACHE_DIR) -D SWIFT_PACKAGE $(MODULE_MAPS) -emit-module-doc-path $(OUT_DIR)/$(MODULE_NAME).swiftdoc -module-name $(MODULE_NAME) -emit-module-path $(OUT_DIR)/$(MODULE_NAME).swiftmodule -num-threads 8 %s", table.arglist("-o", objfiles))
	_p(1, "@mv -f $(OBJDIR)/data.tmp $(OBJECTS_WITNESS)")
	_p('')

	-- posix only for now
	_p('$(OBJECTS): $(OBJECTS_WITNESS)')
	_p(1, '@if test -f $@; then :; else \\')
	_p(2, 'rm -f $(OBJECTS_WITNESS); \\')
	_p(2, '$(MAKE) $(AM_MAKEFLAGS) $(OBJECTS_WITNESS); \\')
	_p(1, 'fi')
	_p('')
end

function swift.linker(prj, tool)
	local lddeps = make.list(premake.getlinks(prj, "siblings", "fullpath"))

	if prj.kind == "StaticLib" then
		_p("$(TARGET): $(OBJECTS) %s ", lddeps)
		_p(1, "$(SILENT) $(AR) cr $(AR_FLAGS) $@ $(OBJECTS) %s", (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or ""))
	else
		_p("$(TARGET): $(OBJECTS) $(LDDEPS)", lddeps)
		_p(1, "$(SILENT) $(SWIFTLINK) $(SDK) -L $(OUT_DIR) -o $@ $(SWIFTLINK_FLAGS) $(LD_FLAGS) $(OBJECTS)")
		_p("ifdef SYMBOLS")
		_p(1, "$(SILENT) $(DSYMUTIL) $(TARGET) -o $(SYMBOLS)")
		_p("endif")
	end
	_p('')
end

function swift.generate_clean(prj)
	_p('clean:')
	if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCleaningMessage")) then
		_p('\t@echo Cleaning %s', prj.name)
	end
	_p('ifeq (posix,$(SHELLTYPE))')
	_p('\t$(SILENT) rm -f  $(TARGET)')
	_p('\t$(SILENT) rm -rf $(OBJDIR)')
	_p('\t$(SILENT) rm -rf $(SYMBOLS)')
	_p('\t$(SILENT) rm -rf $(MODULECACHE_DIR)')
	_p('else')
	_p('\t$(SILENT) if exist $(subst /,\\\\,$(TARGET)) del $(subst /,\\\\,$(TARGET))')
	_p('\t$(SILENT) if exist $(subst /,\\\\,$(OBJ


/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_HTMLOutputElement_h
#define mozilla_dom_HTMLOutputElement_h

#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsStubMutationObserver.h"
#include "nsIConstraintValidation.h"

namespace mozilla {
namespace dom {

class HTMLOutputElement MOZ_FINAL : public nsGenericHTMLFormElement,
                                    public nsStubMutationObserver,
                                    public nsIConstraintValidation
{
public:
  using nsIConstraintValidation::GetValidationMessage;

  HTMLOutputElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
  virtual ~HTMLOutputElement();

  // nsISupports
  NS_DECL_ISUPPORTS_INHERITED

  // nsIFormControl
  NS_IMETHOD_(uint32_t) GetType() const { return NS_FORM_OUTPUT; }
  NS_IMETHOD Reset() MOZ_OVERRIDE;
  NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) MOZ_OVERRIDE;

  virtual bool IsDisabled() const MOZ_OVERRIDE { return false; }

  nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;

  bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
                        const nsAString& aValue, nsAttrValue& aResult) MOZ_OVERRIDE;

  nsEventStates IntrinsicState() const MOZ_OVERRIDE;

  virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers) MOZ_OVERRIDE;

  // This function is called when a callback function from nsIMutationObserver
  // has to be used to update the defaultValue attribute.
  void DescendantsChanged();

  // nsIMutationObserver
  NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
  NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
  NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
  NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED

  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLOutputElement,
                                           nsGenericHTMLFormElement)

  virtual JSObject* WrapNode(JSContext* aCx,
                             JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;

  // WebIDL
  nsDOMSettableTokenList* HtmlFor();
  // nsGenericHTMLFormElement::GetForm is fine.
  void GetName(nsAString& aName)
  {
    GetHTMLAttr(nsGkAtoms::name, aName);
  }

  void SetName(const nsAString& aName, ErrorResult& aRv)
  {
    SetHTMLAttr(nsGkAtoms::name, aName, aRv);
  }

  void GetType(nsAString& aType)
  {
    aType.AssignLiteral("output");
  }

  void GetDefaultValue(nsAString& aDefaultValue)
  {
    aDefaultValue = mDefaultValue;
  }

  void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv);

  void GetValue(nsAString& aValue);
  void SetValue(const nsAString& aValue, ErrorResult& aRv);

  // nsIConstraintValidation::WillValidate is fine.
  // nsIConstraintValidation::Validity() is fine.
  // nsIConstraintValidation::GetValidationMessage() is fine.
  // nsIConstraintValidation::CheckValidity() is fine.
  void SetCustomValidity(const nsAString& aError);

protected:
  enum ValueModeFlag {
    eModeDefault,
    eModeValue
  };

  ValueModeFlag                     mValueModeFlag;
  nsString                          mDefaultValue;
  nsRefPtr<nsDOMSettableTokenList>  mTokenList;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_HTMLOutputElement_h


using System;
using System.Collections.Generic;
using System.Text;
using Android.Runtime;
using Java.Interop;

namespace Com.Google.Android.Exoplayer2.Ext.Media2
{
    public partial class SessionPlayerConnector : global::AndroidX.Media2.Common.SessionPlayer

    {
        // Metadata.xml XPath method reference: path="/api/package[@name='com.google.android.exoplayer2.ext.media2']/class[@name='SessionPlayerConnector']/method[@name='setPlaylist' and count(parameter)=2 and parameter[1][@type='java.util.List<androidx.media2.common.MediaItem>'] and parameter[2][@type='androidx.media2.common.MediaMetadata']]"
        [Register("setPlaylist", "(Ljava/util/List;Landroidx/media2/common/MediaMetadata;)Lcom/google/common/util/concurrent/ListenableFuture;", "")]
        public unsafe override global::Google.Common.Util.Concurrent.IListenableFuture? SetPlaylist(global::System.Collections.Generic.IList<global::AndroidX.Media2.Common.MediaItem>? playlist, global::AndroidX.Media2.Common.MediaMetadata? metadata)
        {
            const string __id = "setPl


op];

    if (value) {
      renderer.setStyle(element, prop, value);
    } else {
      renderer.removeStyle(element, prop);
    }
  }
}

/**
 * Fills the database with a couple thousand fake games
 */

import { Result, Decision, sequelize } from './models';
import { map, all } from 'bluebird';

all([Result.sync({ force: true }), Decision.sync({ force: true })]).then(() => {
  const decisionTypes = [
    'biz_licence',
    'helped_homework',
    'took_day_off',
  ];
  const randEl = (arr: any[]) => arr[Math.floor(Math.random() * arr.length)];
  const randRange = (max: number, min: number) => Math.random() * (max - min) + min;

  map(Array(200000), (item: any, i: number) => Decision.create({
    type: randEl(decisionTypes),
    value: randEl([true, false]),
    difficulty: randEl(['hard', 'easy']),
    meta: {},
  }).then(() => {
    console.log(`Created decision ${i}`);
    return true;
  }), {
    concurrency: 5,
  });

  map(Array(50000), (item: any, i: number) => {
    const revenue = randRange(50, 2000);
    const expenses = randRange(100, 800);
    return Result.create({
      revenue,
      expenses,
      difficulty: randEl(['hard', 'easy']),
      hourlyWage: randRange(1, 20),
      income: revenue - expenses,
      meta: {},
    }).then(() => {
      console.log(`Created result ${i}`);
      return true;
    });
  }, {
    concurrency: 5,
  });
});
import { Entity } from "./entity";
import { allocateType, Type } from "./type";

export interface Table {
  _type: Type;
  _entities: Entity[];
  _columns: Column[];
}

export type Column = any[];

const EMPTY_ARGUMENTS: any[] = [];

export function createTable(type: Type): Table {
  let columns = Array(type.length);
  for (let i = 0; i < columns.length; i++) {
    columns[i] = [];
  }
  return {
    _type: type,
    _entities: [],
    _columns: columns
  };
}

export function insertIntoTable(table: Table, entity: Entity): number {
  let index = table._entities.push(entity) - 1;

  for (let i = 0; i < table._columns.length && i < table._type.length; i++) {
    table._columns[i].push(allocateType(table._type[i], EMPTY_ARGUMENTS));
  }

  return index;
}

export function removeFromTable(table: Table, index: number): void {
  let entities = table._entities;

  entities[index] = entities[entities.length - 1];
  entities[index]._index = index;
  entities.pop();

  for (let column of table._columns) {
    column[index] = column[column.length - 1];
    column.pop();
  }
}

export function clearTable(table: Table): void {
  for (let entity of table._entities) {
    entity._table = null;
  }

  table._entities.length = 0;

  for (let column of table._columns) {
    column.length = 0;
  }
}
import { Response } from 'express';
import { ServiceResponse } from './service-response';
export class SuccessResponse {
    private static responseObj(result:any, message?:string, statusCode?:number)
    {
        let response:ServiceResponse = new ServiceResponse();
        response.statusCode = statusCode || 200,
        response.status = 'Success',
        response.result = result || {},
        response.message = message || 'Success'
        return response;
    }

    public static getResponse(resp:Response, result:any, message?:string) {
        let successResponse = SuccessResponse.responseObj(result, message);
        return resp.status(successResponse.statusCode).json(successResponse);
    }
}/*
 * @Autor:


using Application.Common.Constants;
using Application.Common.Errors;
using Application.Common.Interfaces.Services.Identity;
using Contracts.ApiWrapper;
using Domain.Aggregates.Roles;
using Mediator;
using SharedKernel.Common.Messages;

namespace Application.Features.Roles.Queries.Detail;

public class GetRoleDetailHandler(IRoleManagerService roleManagerService)
    : IRequestHandler<GetRoleDetailQuery, Result<RoleDetailResponse>>
{
    public async ValueTask<Result<RoleDetailResponse>> Handle(
        GetRoleDetailQuery query,
        CancellationToken cancellationToken
    )
    {
        Role? role = await roleMan


           }
                } else {
                        altIcon = (Icon) b.getSelectedIcon();
                }
            } else if(b.isRolloverEnabled() && model.isRollover()) {
                altIcon = (Icon) b.getRolloverIcon();
            }

            if(altIcon == null) {
                altIcon = b.getIcon();
            }

            altIcon.paintIcon(c, g, iconRect.x, iconRect.y);

        } else {
            getDefaultIcon().paintIcon(c, g, iconRect.x, iconRect.y);
        }

        // Draw the Text
        if(text != null) {
            View v = (View) c.getClientProperty(BasicHTML.propertyKey);
            if (v != null) {
                v.paint(g, textRect);
            } else {
               int mnemIndex = b.getDisplayedMnemonicIndex();
               if(model.isEnabled()) {
                   // *** paint the text normally
                   g.setColor(b.getForeground());
               } else {
                   // *** paint the text disabled
                   g.setColor(getDisabledTextColor());
               }
               SwingUtilities2.drawStringUnderlineCharAt(c,g,text,
                       mnemIndex, textRect.x, textRect.y + fm.getAscent());
           }
           if(b.hasFocus() && b.isFocusPainted() &&
              textRect.width > 0 && textRect.height > 0 ) {
               paintFocus(g,textRect,size);
           }
        }
    }

    protected void paintFocus(Graphics g, Rectangle t, Dimension d){
        g.setColor(getFocusColor());
        g.drawRect(t.x-1, t.y-1, t.width+1, t.height+1);
    }
}
/*
 * Copyright 1998-2000 Sun Microsystems, Inc.  All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Sun designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Sun in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 * CA 95054 USA or visit www.sun.com if you need additional information or
 * have any questions.
 */

package javax.swing.plaf.metal;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.*;
import javax.swing.border.*;
import java.io.Serializable;
import javax.swing.plaf.basic.BasicComboBoxUI;

/**
 * This utility class draws the horizontal bars which indicate a MetalComboBox
 *
 * @see MetalComboBoxUI
 * @author Tom Santos
 */
public class MetalComboBoxIcon implements Icon, Serializable {

    /**
     * Paints the horizontal bars for the
     */
    public void paintIcon(Component c, Graphics g, int x, int y){
        JComponent component = (JComponent)c;
        int iconWidth = getIconWidth();

        g.translate( x, y );

        g.setColor( component.isEnabled() ? MetalLookAndFeel.getControlInfo() : MetalLookAndFeel.getControlShadow() );
        g.drawLine( 0, 0, iconWidth - 1, 0 );
        g.drawLine( 1, 1, 1 + (iconWidth - 3), 1 );
        g.drawLine( 2, 2, 2 + (iconWidth - 5), 2 );
        g.drawLine( 3, 3, 3 + (iconWidth - 7), 3 );
        g.drawLine( 4, 4, 4 + (iconWidth


51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocale(["toolbox","brush","title"])}},e}(kN);var fz=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return n(e,t),e.type="title",e.defaultOption={zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Wc),gz=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return n(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,r=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=tt(t.get("textBaseline"),t.get("textVertica


r Sharon Lewin, director of the Peter Doherty Institute for Infection and Immunity, and Professor Shitij Kapur – dean of the Faculty of Medicine, Dentistry and Health Sciences – Dr Fauci said he “firmly believed” it was possible to keep businesses open while prudently enacting public health measures." data-reactid="36">Speaking with Professor Sharon Lewin, director of the Peter Doherty Institute for Infection and Immunity, and Professor Shitij Kapur – dean of the Faculty of Medicine, Dentistry and Health Sciences – Dr Fauci said he “firmly believed” it was possible to keep businesses open while prudently enacting public health measures.

However Prof Lewin said Victoria’s “hard line” response was “driven by the science” to which Mr Andrews sat tightly on.

Dr Fauci pointed to the differing rhetorics from state governments in the US as to why such public health interventions had been a failure.

“When you’re dealing with a pandemic and state number 43 does this and state number 27 does that, it becomes very difficult,” he said.

Overall, Dr Fauci said Australia was one of the few countries that had “done well” in its response to the pandemic.

Wearing of masks in US too divisive
<p class="canvas-atom canvas-text Mb(1.0em) Mb(0)--sm Mt(0.8em)--sm" type="text" content="Dr Fauci also said he envied the Victorian public’s response to masks after Prof Lewin told him 99.9 per cent of Melburnians were adhering to mask rules and the transition to making the wearing of a mask a legal requirement in public


\n");
    }
    *poff += buf_size;

    return 0;
}

int32_t hal_flash_read(hal_partition_t pno, uint32_t* poff, void* buf, uint32_t buf_size)
{
    uint32_t start_addr;
    hal_logic_partition_t *partition_info;
    hal_partition_t real_pno;

#ifdef CONFIG_AOS_KV_MULTIPTN_MODE
    if (pno == CONFIG_AOS_KV_PTN) {
        if ((*poff) >=  CONFIG_AOS_KV_PTN_SIZE) {
            pno = (hal_partition_t)CONFIG_AOS_KV_SECOND_PTN;
            *poff = (*poff) - CONFIG_AOS_KV_PTN_SIZE;
        }
    }
#endif
    real_pno = pno;

    partition_info = hal_flash_get_info( real_pno );

    if(poff == NULL || buf == NULL || *poff + buf_size > partition_info->partition_length)
        return -1;
    start_addr = partition_info->partition_start_addr + *poff;
    FLASH_read_at(start_addr, buf, buf_size);
    *poff += buf_size;

    return 0;
}

int32_t hal_flash_erase(hal_partition_t pno, uint32_t off_set,
                        uint32_t size)
{
    uint32_t start_addr;
    uint32 status;
    hal_logic_partition_t *partition_info;
    hal_partition_t real_pno;
    uint32_t * page_cache = NULL;

    page_cache = (uint32_t *)aos_malloc(FLASH_PAGE_SIZE);
    if (page_cache == NULL)
      return -1;
    memset(page_cache, 0xff, FLASH_PAGE_SIZE);

#ifdef CONFIG_AOS_KV_MULTIPTN_MODE
    if (pno == CONFIG_AOS_KV_PTN) {
        if (off_set >= CONFIG_AOS_KV_PTN_SIZE) {
            pno = (hal_partition_t)CONFIG_AOS_KV_SECOND_PTN;
            off_set -= CONFIG_AOS_KV_PTN_SIZE;
        }
    }
#endif
    real_pno = pno;

    partition_info = hal_flash_get_info( real_pno );
    if(size + off_set > partition_info->partition_length)
        return -1;

    start_addr = ROUND_DOWN((partition_info->partition_start_addr + off_set), FLASH_PAGE_SIZE);

    for(uint32_t i=0; i<size/FLASH_PAGE_SIZE; i++)
    {
        status = CySysFlashWriteRow(start_addr/FLASH_PAGE_SIZE, (uint8 *)page_cache);

        if(status != CY_SYS_FLASH_SUCCESS)
        {
            printf("Flash erase failed\n");
        }
        start_addr += FLASH_PAGE_SIZE;
    }
    aos_free(page_cache);

    return 0;
}

int32_t hal_flash_enable_secure(hal_partition_t partition, uint32_t off_set, uint32_t size)
{
    (void)partition;
    (void)off_set;
    (void)size;

    return 0;
}

int32_t hal_flash_dis_secure(hal_partition_t partition, uint32_t off_set, uint32_t size)
{
    (void)partition;
    (void)off_set;
    (void)size;

    return 0;
}


.expected), len(result))
		for i := range result {
			assert.Equal(t, test.expected[i], result[i], fmt.Sprintf("\nexpected: %s\ngot: %s\n", test.expected[i], result[i]))
		}
	}
}
package storeclient

import (
	"context"
	"fmt"
	"io"
	"mime/multipart"
	"net/http"
	"net/textproto"
	"os"
	"time"

	"github.com/benchkram/bob/bob/playbook"
	progress2 "github.com/benchkram/bob/pkg/progress"
	"github.com/benchkram/errz"
	"github.com/pkg/errors"
	"github.com/schollz/progressbar/v3"

	"github.com/benchkram/bob/pkg/usererror"
)

var ErrProjectNotFound = errors.New("project not found")
var ErrNotAuthorized = errors.New("not authorized")

func (c *c) UploadArtifact(
	ctx context.Context,
	projectName string,
	artifactID string,
	src io.Reader,
	size int64,
) (err error) {
	defer errz.Recover(&err)

	r, w := io.Pipe()
	mpw := multipart.NewWriter(w)

	bar := progressBar(ctx, size)
	rb := progressbar.NewReader(src, bar)

	go func() {
		err0 := attachMimeHeader(mpw, "id", artifactID)
		if err0 != nil {
			_ = w.CloseWithError(err)
			return
		}

		pw, err0 := mpw.CreateFormFile("file", artifactID+".bin")
		if err0 != nil {
			_ = w.CloseWithError(err)
			return
		}

		tr := io.TeeReader(&rb, pw)
		buf := make([]byte, 8192)

		for {
			_, err0 := tr.Read(buf)
			if err0 == io.EOF {
				_ = mpw.Close()
				_ = w.Close()
				break
			}
			if err0 != nil {
				_ = w.CloseWithError(err)
			}
		}
	}()

	resp, err := c.clientWithResponses.UploadArtifactWithBodyWithResponse(
		ctx, projectName, mpw.FormDataContentType(), r)
	errz.Fatal(err)

	if resp.StatusCode() != http.StatusOK {
		err = errors.Errorf("request failed [status: %d, msg: %q]", resp.StatusCode(), resp.Body)
		errz.Fatal(err)
	}

	return nil
}

func attachMimeHeader(w *multipart.Writer, key, value string) error {
	h := make(textproto.MIMEHeader)
	h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="%s"`, key))
	h.Set("Content-Type", "text/plain")

	p, err := w.CreatePart(h)
	if err != nil {
		return errors.Wrapf(err, "failed to create form field [%s]", key)
	}

	if _, err := p.Write([]byte(value)); err != nil {
		return errors.Wrapf(err, "failed to write form field [%s]", key)
	}

	return nil
}

func (c *c) ListArtifacts(ctx context.Context, project string) (ids []string, err error) {
	defer errz.Recover(&err)

	res, err := c.clientWithResponses.GetProjectArtifactsWithResponse(
		ctx, project)
	errz.Fatal(err)

	if res.StatusCode() == http.StatusNotFound {
		errz.Fatal(usererror.Wrapm(ErrProjectNotFound, "upload to remote repository failed"))
	} else if res.StatusCode() == http.StatusUnauthorized || res.StatusCode() == http.StatusForbidden {
		errz.Fatal(usererror.Wrap(ErrNotAuthorized))
	} else if res.StatusCode() != http.StatusOK {
		err = errors.Errorf("request failed [status: %d, msg: %q]", res.StatusC


runZoned(() => httpClient.getUrl(httpUri),
        zoneValues: <dynamic, dynamic>{#flutter.io.allow_http: mockTrue});
      expect(mockFalse.checked, isTrue);
    });
  }, skip: Platform.isMacOS); // https://github.com/flutter/flutter/issues/141149

  test('testWithLoopback', () async {
    await bindServerAndTest('127.0.0.1', (HttpClient httpClient, Uri uri) async {
      await httpClient.getUrl(Uri.parse('http://localhost:${uri.port}'));
      await httpClient.getUrl(Uri.parse('http://127.0.0.1:${uri.port}'));
    });
  });

  test('testWithIPV6', () async {
    if (await _supportsIPv6()) {
      await bindServerAndTest('::1', (HttpClient httpClient, Uri uri) async {
        await httpClient.getUrl(uri);
      });
    }
  });
}

class _MockZoneValue {
  _MockZoneValue(this._value);

  final Object? _value;
  bool _falseChecked = false;
  bool _trueChecked = false;

  @override
  bool operator ==(Object o) {
    if(o == true) {
      _trueChecked = true;
    }
    if(o == false) {
      _falseChecked = true;
    }
    return _value == o;
  }

  bool get checked => _falseChecked && _trueChecked;

  @override
  int get hashCode => _value.hashCode;
}
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:io';
import 'dart:typed_data';
import 'dart:ui' as ui;

import 'package:path/path.dart' as path;
import 'package:test/test.dart';

import 'impeller_enabled.dart';

void main() {

  test('Animation metadata', () async {
    Uint8List data = await _getSkiaResource('alphabetAnim.gif').readAsBytes();
    ui.Codec codec = await ui.instantiateImageCodec(data);
    expect(codec, isNotNull);
    expect(codec.frameCount, 13);
    expect(codec.repetitionCount, 0);
    codec.dispose();

    data = await _getSkiaResource('test640x479.gif').readAsBytes();
    codec = await ui.instantiateImageCodec(data);
    expect(codec.frameCount, 4);
    expect(codec.repetitionCount, -1);
  });

  test('Fails with invalid data', () async {
    final Uint8List data = Uint8List.fromList(<int>[1, 2, 3]);
    try {
      await ui.instantiateImageCodec(data);
      fail('exception not thrown');
    } on Exception catch (e) {
      expect(e.toString(), contains('Invalid image data'));
    }
  });

  test('getNextFrame fails with invalid data', () async {
    Uint8List data = await _getSkiaResource('flutter_logo.jpg').readAsBytes();
    data = Uint8List.view(data.buffer, 0, 4000);
    final ui.Codec codec = await ui.instantiateImageCodec(data);
    try {
      await codec.getNextFrame();
      fail('exception not thrown');
    } on Exception catch (e) {
      if (impellerEnabled) {
        expect(e.toString(), contains('Could not decompress image.'));
      } else {
        expect(e.toString(), contains('Codec failed'));
      }
    }
  });

  test('nextFrame', () async {
    final Uint8List data = await _getSkiaResource('test640x479.gif').readAsBytes();
    final ui.Codec codec = await ui.instantiateImageCodec(data);
    final List<List<int>> decodedFrameInfos = <List<int>>[];
    for (int i = 0; i < 5; i++) {
      final ui.FrameInfo frameInfo = await codec.getNextFrame();
      dec


!
// Hello guest!
```

{% include closecol.html %}{% include opencol.html size=6 %}

#### Nil-coalescing operator

```swift
func greet(name: String?) {
  let unwrappedName = name ?? "guest"
  print("Hello \(unwrappedName)!")
}
greet(name: "Asma")
greet(name: nil)
// Output:
// Hello Asma!
// Hello guest!
```

{% include closecol.html closerow=true %}

### Guard

Guard statements can be used to reduce indentation on the happy path. In a guard statement, the _else_ branch _must_ transfer control to exit the code block containing the guard statement. This can be done with _return_, _break_, _continue_, or _throw_.

{% include opencol.html size=6 newrow=true %}

#### Simple guard

```swift
func divide(x: Int, y: Int) -> Int? {
  guard y != 0 else {
    print("You cannot divide by 0.")
    return nil
  }
  let answer = x / y
  return answer
}
print(divide(x: 5, y: 0))
// Output:
// You cannot divide by 0.
// nil
```

{% include closecol.html %}{% include opencol.html size=6 %}

#### Guard let

```swift
func greet(name: String?) {
  guard let unwrapped = name else {
    print("Hello guest!")
    return
  }
  print("Hello \(unwrapped)!")
}
greet(name: "Asma")
greet(name: nil)
// Output:
// Hello Asma!
// Hello guest!
```

{% include closecol.html closerow=true %}

### For-in

The common for loop `for (i = a; i < b; i++)` does not exist in Swift. Instead, the for-in can be modified to have an index using tuples and _[enumerated](https://developer.apple.com/documentation/swift/array/1687832-enumerated)_:

{% include opencol.html size=6 newrow=true %}

#### Simple for-in

```swift
let birds = ["Owl", "Crane"]
for bird in birds {
  print(bird)
}
// Output:
// Owl
// Crane
```

{% include closecol.html %}{% include opencol.html size=6 %}

#### For-in with index

```swift
let birds = ["Owl", "Crane"]
for (i, bird) in birds.enumerated() {
  print("[\(i)]: \(bird)")
}
// Output:
// [0]: Owl
// [1]: Crane
```

{% include closecol.html closerow=true %}

### While

A while loop will run the code block each time the conditional is true. A repeat-while loop will run the block first without checking the conditional, then keep on running it as long as the conditional is true.

{% include opencol.html size=6 newrow=true %}

#### Simple while

```swift
var steps = 2
while steps > 0 {
  print("\(steps) steps left")
  steps -= 1
}
// Output:
// 2 steps left
// 1 steps left
```
```swift
var steps = -999
while steps > 0 {
  print("\(steps) steps left")
  steps -= 1
}
// Output: nothing
```

{% include closecol.html %}{% include opencol.html size=6 %}

#### Repeat-while

```swift
var steps = 2
repeat {
  print("\(steps) steps left")
  steps -= 1
} while steps > 0
// Output:
// 2 steps left
// 1 steps left
```
```swift
var steps = -999
repeat {
  print("\(steps) steps left")
  steps -= 1
} while steps > 0
// Output: "-999 steps left"
```

{% include closecol.html closerow=true %}

### Switch

{% include opencol.html size=6 newrow=tr


#
/*
 *
 *	UNIX debugger - common definitions
 *
 */

/*	Layout of a.out file (fsym):
 *
 *	header of 8 words	magic number 405, 407, 410, 411
 *				text size	)
 *				data size	) in bytes but even
 *				bss size	)
 *				symbol table size
 *				entry point
 *				{unused}
 *				flag set if no relocation
 *
 *
 *	header:		0
 *	text:		16
 *	data:		16+textsize
 *	relocation:	16+textsize+datasize
 *	symbol table:	16+2*(textsize+datasize) or 16+textsize+datasize
 *
 */

#include <sys/param.h>
#include <sys/dir.h>
#include <sys/reg.h>
#include <sys/user.h>
#include <sgtty.h>
#include "mac.h"
#include "mode.h"

#define VARB	11
#define VARD	13
#define VARE	14
#define VARM	22
#define VARS	28
#define VART	29

#define COREMAGIC 0140000

#define RD	0
#define WT	1
#define NSP	0
#define	ISP	1
#define	DSP	2
#define STAR	4
#define STARCOM 0200
#define DSYM	7
#define ISYM	2
#define ASYM	1
#define NSYM	0
#define ESYM	(-1)
#define BKPTSET	1
#define BKPTEXEC 2
#define	SYMSIZ	100
#define MAXSIG	20

#define USERPS	2*(512-1)
#define USERPC	2*(512-2)
#define BPT	03
#define FD	0200
#define	SETTRC	0
#define	RDUSER	2
#define	RIUSER	1
#define	WDUSER	5
#define WIUSER	4
#define	RUREGS	3
#define	WUREGS	6
#define	CONTIN	7
#define	SINGLE	9
#define	EXIT	8

#define FROFF	(&(0->fpsr))
#define FRLEN	25
#define FRMAX	6

#define	ps	-1
#define	pc	-2
#define	sp	-6
#define	r5	-9
#define	r4	-10
#define	r3	-11
#define	r2	-12
#define	r1	-5
#define	r0	-3

#define MAXOFF	255
#define MAXPOS	80
#define MAXLIN	128
#define EOF	0
#define EOR	'\n'
#define TB	'\t'
#define QUOTE	0200
#define STRIP	0177
#define LOBYTE	0377
#define EVEN	-2

/* long to ints and back (puns) */
union {
	INT	I[2];
	L_INT	L;
} itolws;

#define leng(a)		((long)((unsigned)(a)))
#define shorten(a)	((int)(a))
#define itol(a,b)	(itolws.I[0]=(a), itolws.I[1]=(b), itolws.L)

/* result type declarations */
L_INT		inkdot();
SYMPTR		lookupsym();
SYMPTR		symget();
POS		get();
POS		chkget();
STRING		exform();
L_INT		round();
BKPTR		scanbkpt();
VOID		fault();

typedef struct sgttyb TTY;
TTY	adbtty, usrtty;
#include <setjmp.h>
jmp_buf erradb;


, 44,252,  3,  3,   0},  0x20,  PIX_FREQ_54000KHz}, // 28:  2880 x  288p
	{ 29,{VPosHNeg,1728, 625,20000},{136,1440, 40, 576},{0x00, 20,128,  5,  5,   0},  0x10,  PIX_FREQ_54000KHz}, // 29:  1440 x  576p
	{ 30,{VPosHNeg,1728, 625,20000},{136,1440, 40, 576},{0x00, 20,128,  5,  5,   0},  0x20,  PIX_FREQ_54000KHz}, // 30:  1440 x  576p
	{ 31,{VPosHPos,2640,1125,20000},{148,1920, 37,1080},{0x00,524, 44,  4,  5,   0},  0x20, PIX_FREQ_148500KHz}, // 31:  1920 x 1080p, 50 Hz
	{ 32,{VPosHPos,2750,1125,41666},{148,1920, 37,1080},{0x00,634, 44,  4,  5,   0},  0x20,  PIX_FREQ_74176KHz}, // 32:  1920 x 1080p
	{ 33,{VPosHPos,2640,1125,40000},{148,1920, 37,1080},{0x00,524, 44,  4,  5,   0},  0x20,  PIX_FREQ_74250KHz}, // 33:  1920 x 1080p, 25 Hz
	{ 34,{VPosHPos,2200,1125,33333},{148,1920, 37,1080},{0x00, 84, 44,  4,  5,   0},  0x20,  PIX_FREQ_74176KHz}, // 34:  1920 x 1080p

};

unsigned char EP952_VDO_Settings_Max = (sizeof(EP952_VDO_Settings)/sizeof(EP952_VDO_Settings[0]));

//
// Index = [Channel Number]
//
ADO_SETTINGS EP952_ADO_Settings[] = {
	// SpeakerMapping, Flat
	{0x00, 0xF0}, // 0.0 - Flat All
	{0x00, 0x00}, // 2.0 - SD0
	{0x04, 0xA0}, // 3.0 - SD0 +SD2
	{0x08, 0xA0}, // 4.0 - SD0 +SD1 +SD2
	{0x07, 0x80}, // 4.1 - SD0 +SD3
	{0x0B, 0x80}, // 5.1 - SD0 +SD1 +SD3
	{0x0F, 0x00}, // 6.1 - SD0 +SD2 +SD3
	{0x13, 0x00}, // 7.1 - SD0 +SD1 +SD2 +SD3
};

//
// Index = [Pixel Freq Type]
//
N_CTS_SETTINGS N_CTS_32K[] = {
	{ 4576, 28125},        // 25.20 MHz / 1.001
	{ 4096, 25200},        // 25.20 MHz

	{ 4096, 27000},        // 27.00 MHz
	{ 4096, 27027},        // 27.00 MHz * 1.001

	{ 4096, 54000},        // 54.00 MHz
	{ 4096, 54054},        // 54.00 MHz * 1.001

	{ 4096, 72000},        // 72.00 MHz

	{11648,210937},        // 74.25 MHz / 1.001
	{ 4096, 74250},        // 74.25 MHz

	{ 4096,108000},        // 108.00 MHz
	{ 4096,108108},        // 108.00 MHz * 1.001

	{11648,421875},        // 148.50 MHz / 1.001
	{ 4096,148500},        // 148.50 MHz

	{ 4096,148500},        // PC
};

N_CTS_SETTINGS N_CTS_44K1[] = {
	{ 7007, 31250},        // 25.20 MHz / 1.001
	{ 6272, 28000},        // 25.20 MHz

	{ 6272, 30000},        // 27.00 MHz
	{ 6272, 30030},        // 27.00 MHz * 1.001

	{ 6272, 60000},        // 54.00 MHz
	{ 6272, 60060},        // 54.00 MHz * 1.001

	{ 6272, 80000},        // 72.00 MHz

	{17836,234375},        // 74.25 MHz / 1.001
	{ 6272, 82500},        // 74.25 MHz

	{ 6272,120000},        // 108.00 MHz
	{ 6272,120120},        // 108.00 MHz * 1.001

	{ 8918,234375},        // 148.50 MHz / 1.001
	{ 6272,165000},        // 148.50 MHz

	{ 6272,165000},        // PC
};

N_CTS_SETTINGS N_CTS_48K[] = {
	{ 6864, 28125},        // 25.20 MHz / 1.001
	{ 6144, 25200},        // 25.20 MHz

	{ 6144, 27000},        // 27.00 MHz
	{ 6144, 27027},        // 27.00 MHz * 1.001

	{ 6144, 54000},        // 54.00 MHz
	{ 6144, 54054},        // 54.00 MHz * 1.001

	{ 6144, 72000},        // 72.00 MHz

	{11648,140625},        // 74.25 MHz / 1.001
	{ 6144, 74250},        // 74.25 MHz

	{ 6144, 108000},        // 108.00 MHz
	{ 6144, 108108},        // 108.00 MHz * 1.001

	{ 5824, 140625},        // 148.50 MHz / 1.001
	{ 6144, 148500},        // 148.50 MHz

	{ 6144, 148500},        // PC
};


644-1.433 1.438-1.433 1.438.642 1.438 1.433-.644 1.433-1.438 1.433m1.013-1.908a.372.372 0 0 0-.745 0 .372.372 0 0 0 .745 0m-10.544 1.467c0 .923-.75 1.671-1.676 1.671a1.675 1.675 0 0 1-1.677-1.67c0-.924.752-1.672 1.677-1.672.924 0 1.676.748 1.676 1.671m-.494-.554a.434.434 0 1 0-.867.002.434.434 0 0 0 .867-.002" clip-rule="evenodd"/></g><path fill="@{text}" fill-rule="evenodd" d="M26.5 48.756c12.292 0 22.256-9.964 22.256-22.256S38.792 4.244 26.5 4.244 4.244 14.208 4.244 26.5 14.208 48.756 26.5 48.756m0 2.07c13.435 0 24.326-10.891 24.326-24.326S39.935 2.174 26.5 2.174 2.174 13.065 2.174 26.5 13.065 50.826 26.5 50.826" clip-rule="evenodd"/><path fill="#fff" fill-rule="evenodd" d="M26.497 48.438c12.118 0 21.941-9.823 21.941-21.94S38.615 4.555 26.498 4.555 4.555 14.38 4.555 26.497s9.824 21.941 21.941 21.941zm24.292-21.94c0 13.415-10.876 24.29-24.292 24.29S2.206 39.914 2.206 26.499 13.08 2.205 26.497 2.205 50.79 13.08 50.79 26.497z" clip-rule="evenodd"/></svg>'
      );
      content: url("data:image/svg+xml,@{svg}");
    }
  }
}

/* prettier-ignore */
@catppuccin: {
  @latte:     { @rosewater: #dc8a78; @flamingo: #dd7878; @pink: #ea76cb; @mauve: #8839ef; @red: #d20f39; @maroon: #e64553; @peach: #fe640b; @yellow: #df8e1d; @green: #40a02b; @teal: #179299; @sky: #04a5e5; @sapphire: #209fb5; @blue: #1e66f5; @lavender: #7287fd; @text: #4c4f69; @subtext1: #5c5f77; @subtext0: #6c6f85; @overlay2: #7c7f93; @overlay1: #8c8fa1; @overlay0: #9ca0b0; @surface2: #acb0be; @surface1: #bcc0cc; @surface0: #ccd0da; @base: #eff1f5; @mantle: #e6e9ef; @crust: #dce0e8; };
  @frappe:    { @rosewater: #f2d5cf; @flamingo: #eebebe; @pink: #f4b8e4; @mauve: #ca9ee6; @red: #e78284; @maroon: #ea999c; @peach: #ef9f76; @yellow: #e5c890; @green: #a6d189; @teal: #81c8be; @sky: #99d1db; @sapphire: #85c1dc; @blue: #8caaee; @lavender: #babbf1; @text: #c6d0f5; @subtext1: #b5bfe2; @subtext0: #a5adce; @overlay2: #949cbb; @overlay1: #838ba7; @overlay0: #737994; @surface2: #626880; @surface1: #51576d;


 file to AnkiDroid's media collection. You would likely supply this uri through a FileProvider, and
     * then set FLAG_GRANT_READ_URI_PERMISSION using something like:
     *
     * ```
     *     getContext().grantUriPermission("com.ichi2.anki", uri, Intent.FLAG_GRANT_READ_URI_PERMISSION)
     *     // Then when file is added, remove the permission
     *     // add File ...
     * getContext().revokePermission(uri, Intent.FLAG_GRAN_READ_URI_PERMISSION)
     * ```
     *
     * Example usage:
     * ```
     *     Long noteTypeId = getModelId(); // implementation can be seen in api sample app
     *     Long deckId = getDeckId(); // as above
     *     Set<String> tags = getTags(); // as above
     *     Uri fileUri = ... // this will be returned by a File Picker activity where we select an image file
     *     String addedImageFileName = mApi.addMediaFromUri(fileUri, "My_Image_File", "image");
     *
     *     String[] fields = new String[] {"text on front of card", "text on back of card " + addedImageFileName};
     *     mApi.addNote(noteTypeId, deckId, fields, tags)
     * ```
     *
     * @param fileUri   Uri for the file to be added, required.
     * @param preferredName String to add to start of filename (do not use a file extension), required.
     * @param mimeType  String indicating the mimeType of the media. Accepts "audio" or "image", required.
     * @return the correctly formatted String for the media file to be placed in the desired field of a Card, or null
     * if unsuccessful.
     */
    public fun addMediaFromUri(
        fileUri: Uri,
        preferredName: String,
        mimeType: String,
    ): String? {
        val contentValues =
            ContentValues().apply {
                put(AnkiMedia.FILE_URI, fileUri.toString())
                put(AnkiMedia.PREFERRED_NAME, preferredName.replace(" ", "_"))
            }
        return try {
            val returnUri = resolver.insert(AnkiMedia.CONTENT_URI, contentValues)
            // get the filename from Uri, return [sound:%s] % file.getName()
            val fname = File(returnUri!!.path!!).toString()
            formatMediaName(fname, mimeType)
        } catch (e: Exception) {
            null
        }
    }

    private fun formatMediaName(
        fname: String,
        mimeType: String,
    ): String? =
        when (mimeType) {
            "audio" -> "[sound:${fname.substring(1)}]" // first character in the path is "/"
            "image" -> "<img src=\"${fname.substring(1)}\" />"
            else -> null // something went wrong
        }

    /**
     * Find all existing notes in the collection which have mid and a duplicate key
     * @param mid model id
     * @param key the first field of a note
     * @return a list of duplicate notes
     */
    public fun findDuplicateNotes(
        mid: Long,
        key: String,
    ): List<NoteInfo?> {
        val notes = compat.findDuplicateNotes(mid, listOf(key))
        return if (notes!!.size() == 0) {
            emptyList<NoteInfo>()
        } else {
            notes.valueAt(0)
        }
    }

    /**
     * Find all notes in the collection which have mid and a first field that matches key
     * Much faster than calling findDuplicateNotes(long, String) when the list of keys is large
     * @param mid model id
     * @param keys list of keys
     * @return a SparseArray with a list of duplicate notes for each key
     */
    public fun findDuplicateNotes(
        mid: Long,
        keys: List<String>,
    ): SparseArray<MutableList<NoteInfo?>>? = compat.findDuplicateNotes(mid, keys)

    /**
     * Get the number of notes that exist for the specified model ID


unsigned int off = region->firstTouchedOffset(addr);
	len = region->getClampedLen(addr, len);

	unsigned int m;

	if (region->isReadable()) {
		region->read(first, off, data, len);
	} else {
		// FIXME: We might want to do these properly in future
		for (m = 0; m < len; m += 2) {
			data[m] = 0xff;
			if (m + 1 < len) {
				data[m+1] = (Bit8u)region->type;
			}
		}
	}
}

void Synth::writeMemoryRegion(const MemoryRegion *region, Bit32u addr, Bit32u len, const Bit8u *data) {
	unsigned int first = region->firstTouched(addr);
	unsigned int last = region->lastTouched(addr, len);
	unsigned int off = region->firstTouchedOffset(addr);
	switch (region->type) {
	case MR_PatchTemp:
		region->write(first, off, data, len);
		//printDebug("Patch temp: Patch %d, offset %x, len %d", off/16, off % 16, len);

		for (unsigned int i = first; i <= last; i++) {
			int absTimbreNum = mt32ram.patchTemp[i].patch.timbreGroup * 64 + mt32ram.patchTemp[i].patch.timbreNum;
			char timbreName[11];
			memcpy(timbreName, mt32ram.timbres[absTimbreNum].timbre.common.name, 10);
			timbreName[10] = 0;
#if MT32EMU_MONITOR_SYSEX > 0
			printDebug("WRITE-PARTPATCH (%d-%d@%d..%d): %d; timbre=%d (%s), outlevel=%d", first, last, off, off + len, i, absTimbreNum, timbreName, mt32ram.patchTemp[i].outputLevel);
#endif
			if (parts[i] != NULL) {
				if (i != 8) {
					// Note: Confirmed on CM-64 that we definitely *should* update the timbre here,
					// but only in the case that the sysex actually writes to those values
					if (i == first && off > 2) {
#if MT32EMU_MONITOR_SYSEX > 0
						printDebug(" (Not updating timbre, since those values weren't touched)");
#endif
					} else {
						parts[i]->setTimbre(&mt32ram.timbres[parts[i]->getAbsTimbreNum()].timbre);
					}
				}
				parts[i]->refresh();
			}
		}
		break;
	case MR_RhythmTemp:
		region->write(first, off, data, len);
		for (unsigned int i = first; i <= last; i++) {
			int timbreNum = mt32ram.rhythmTemp[i].timbre;
			char timbreName[11];
			if (timbreNum < 94) {
				memcpy(timbreName, mt32ram.timbres[128 + timbreNum].timbre.common.name, 10);
				timbreName[10] = 0;
			} else {
				strcpy(timbreName, "[None]");
			}
#if MT32EMU_MONITOR_SYSEX > 0
			printDebug("WRITE-RHYTHM (%d-%d@%d..%d): %d; level=%02x, panpot=%02x, reverb=%02x, timbre=%d (%s)", first, last, off, off + len, i, mt32ram.rhythmTemp[i].outputLevel, mt32ram.rhythmTemp[i].panpot, mt32ram.rhythmTemp[i].reverbSwitch, mt32ram.rhythmTemp[i].timbre, timbreName);
#endif
		}
		if (parts[8] != NULL) {
			parts[8]->refresh();
		}
		break;
	cas


   'state': 'TX'
  },
  {
    '_id': '79930',
    'city': 'EL PASO',
    'loc': [-106.456754, 31.804795],
    'pop': 29792,
    'state': 'TX'
  },
  {
    '_id': '79932',
    'city': 'EL PASO',
    'loc': [-106.593186, 31.862334],
    'pop': 14909,
    'state': 'TX'
  },
  {
    '_id': '79934',
    'city': 'EL PASO',
    'loc': [-106.407328, 31.938585],
    'pop': 2983,
    'state': 'TX'
  },
  {
    '_id': '79935',
    'city': 'EL PASO',
    'loc': [-106.330258, 31.771847],
    'pop': 20465,
    'state': 'TX'
  },
  {
    '_id': '79936',
    'city': 'EL PASO',
    'loc': [-106.30159, 31.767655],
    'pop': 52031,
    'state': 'TX'
  },
  {
    '_id': '80002',
    'city': 'ARVADA',
    'loc': [-105.098402, 39.794533],
    'pop': 12065,
    'state': 'CO'
  },
  {
    '_id': '80003',
    'city': 'ARVADA',
    'loc': [-105.065549, 39.828572],
    'pop': 32980,
    'state': 'CO'
  },
  {
    '_id': '80004',
    'city': 'ARVADA',
    'loc': [-105.11771, 39.814066],
    'pop': 33260,
    'state': 'CO'
  },
  {
    '_id': '80005',
    'city': 'ARVADA',
    'loc': [-105.109719, 39.842189],
    'pop': 22613,
    'state': 'CO'
  },
  {
    '_id': '80010',
    'city': 'AURORA',
    'loc': [-104.864618, 39.736788],
    'pop': 27090,
    'state': 'CO'
  },
  {
    '_id': '80011',
    'city': 'AURORA',
    'loc': [-104.815233, 39.737809],
    'pop': 36021,
    'state': 'CO'
  },
  {
    '_id': '80012',
    'city': 'AURORA',
    'loc': [-104.837693, 39.698672],
    'pop': 37711,
    'state': 'CO'
  },
  {
    '_id': '80013',
    'city': 'AURORA',
    'loc': [-104.784566, 39.657457],
    'pop': 45335,
    'state': 'CO'
  },
  {
    '_id': '80014',
    'city': 'AURORA',
    'loc': [-104.834954, 39.666171],
    'pop': 31059,
    'state': 'CO'
  },
  {
    '_id': '80015',
    'city': 'AURORA',
    'loc': [-104.787438, 39.62552],
    'pop': 28161,
    'state': 'CO'
  },
  {
    '_id': '80016',
    'city': 'AURORA',
    'loc': [-104.741734, 39.618713],
    'pop': 4085,
    'state': 'CO'
  },
  {
    '_id': '80017',
    'city': 'AURORA',
    'loc': [-104.7880


 font-size: 1.375em; }
.aux-blog-land-style .hentry .entry-info { margin-bottom: 0.5em; }
.aux-blog-land-style .hentry .entry-content, .aux-blog-land-style .hentry .comment-body { margin-bottom: 1em; }
.aux-blog-land-style .hentry .entry-meta { position: absolute; bottom: 3.5625em; width: inherit; }
.aux-blog-land-style .hentry .entry-meta:after { content: ""; display: table; clear: both; }
.aux-blog-land-style .hentry .author, .aux-blog-land-style .hentry .aux-read-more { padding: 0; background: transparent; border: none; border-radius: 0; color: #AAA; font-weight: 500; font-size: 0.875em; }
.aux-blog-land-style .hentry .author a:hover, .aux-blog-land-style .hentry .aux-read-more a:hover { color: #1bb0ce; }
.aux-blog-land-style .hentry .readmore { float: left; }
.aux-blog-land-style .hentry .aux-read-more { position: relative; border: solid 1px #AAA; padding: 0.5625em 1.5625em; }
.aux-blog-land-style .hentry .aux-read-more:hover { background: #3D3D3D; color: white; }
.aux-blog-land-style .hentry .aux-read-more::after { display: none; }
.aux-blog-land-style .hentry .author .avatar { margin-right: 0.5em; vertical-align: middle; width: 27px; height: 27px; border-radius: 50%; }
.aux-blog-land-style .hentry .comments-iconic { display: flex; align-items: center; float: right; margin-top: 3px; font-weight: 500; color: #AAA; font-size: 0.875rem; }
.aux-blog-land-style .hentry .comments-iconic .meta-comment { vertical-align: middle; margin-left: 10px; }
.aux-blog-land-style .hentry .comments-iconic .auxicon-comment { vertical-align: middle; line-height: 100%; display: inline-block; margin-right: 5px; }
.aux-blog-land-style .hentry .comments-iconic .auxicon-comment:before { display: block; }
.aux-blog-land-style .hentry .comments-iconic .comments-number { vertical-align: middle; }
@media screen and (max-width: 1024px) and (min-width: 768px) { .aux-blog-land-style .hentry .entry-media { width: 45%; margin-right: 25px; }
  .aux-blog-land-style .hentry .entry-main { width: calc(55% - 25px); } }
@media screen and (max-width: 767px) { .aux-blog-land-style .hentry .entry-media { width: 100%; }
  .aux-blog-land-style .hentry .entry-main { width: 100%; }
  .aux-blog-land-style .hentry .entry-meta { position: static; margin-top: 30px; } }
.aux-blog-land-style .hentry .post_format-post-format-quote .entry-main { background-color: #333; }
.aux-blog-land-style .hentry .post_format-post-format-quote .comments-iconic { margin-right: 30px; margin-bottom: 1.4375em; }
.aux-blog-land-style .hentry.aux-no-thumb .entry-main { width: 100%; float: none; }
.aux-blog-land-style .hentry.aux-no-thumb .entry-meta { position: static; margin-top: 30px; }

/** Tile view style for post entry content, this s


  gBombardTechs[iTech] = iRange

    for iTeam = 0, GameDefines.MAX_CIV_TEAMS, 1 do
      if (Teams[iTeam]:IsHasTech(iTech)) then
	    gTeamRange[iTeam] = iRange
	  end
	end
  end
end

function OnTechResearched(iTeam, iTech, iChange)
	if (iChange == 1 and gBombardTechs[iTech]) then
	  gTeamRange[iTeam] = gBombardTechs[iTech]
	end
end
GameEvents.TeamTechResearched.Add(OnTechResearched)

function OnGetBombardRange(iPlayer, iCity)
  return gTeamRange[Players[iPlayer]:GetTeam()] or gDefaultRange
end
GameEvents.GetBombardRange.Add(OnGetBombardRange)

Initialise()


 {
      let idxOfMax = 0;

      for (let begin = 0 + 1; begin <= end; begin++) {
        if (array[idxOfMax] <= array[begin]) {
          idxOfMax = begin;
        }

        // ------------ only for statistics --------
        loopCnt += 1;
        compCnt += 1;
      }

      const temp = array[end];
      array[end] = array[idxOfMax];
      array[idxOfMax] = temp;

      // ------------ only for statistics --------
      loopCnt += 1;
      swapCnt += 3;
    }

    return { array, loopCnt, compCnt, swapCnt };
  }

  /**
   * 1s completed for 3500- (秒级3.5K条以内数据)
   */
  protected bubble(array: number[]): number[] {
    for (let end = array.length - 1; end > 0; end--) {
      let isOrdered = true; // assume it's ordered by default

      for (let begin = 1; begin <= end; begin++) {
        if (array[begin] < array[begin - 1]) {
          [array[begin - 1], array[begin]] = [array[begin], array[begin - 1]];
          isOrdered = false; // that means it's disordered because of swapping index
        }
      }

      if (isOrdered) break;
    }

    return array;
  }

  /**
   * 1s completed for 3500- (秒级3.5K条以内数据)
   */
  protected bubble2(array: number[]): SortResult {
    let loopCnt = 0;
    let compCnt = 0;
    let swapCnt = 0;

    for (let end = array.length - 1; end > 0; end--) {
      // Assume array is in-ordered from pointerAtSorted to the end
      let pointerAtSorted = 1;

      for (let begin = 1; begin <= end; begin++) {
        if (array[begin] < array[begin - 1]) {
          const temp = array[begin];
          array[begin] = array[begin - 1];
          array[begin - 1] = temp;

          pointerAtSorted = begin;

          // ---------only for statistics------
          swapCnt += 1;
        }
        // ---------only for statistics------
        loopCnt += 1;
        compCnt += 1;
      }

      end = pointerAtSorted;

      // ---------only for statistics------
      loopCnt += 1;
    }

    return { array, loopCnt, compCnt, swapCnt };
  }

  protected heap(array: number[]): SortResult {
    let loopCnt = 0;
    let compCnt = 0;
    let swapCnt = 0;
    let size = array.length;

    // build in-place max heap
    function shiftDown(index: number) {
      const value = array[index]; // target value

      while (index < Math.floor(size / 2)) { // has child
        loopCnt += 1;
        compCnt += 3; // approximate

        // It must have left node if having child
        let leftIndex = 2 * index + 1;
        let leftValue = array[leftIndex];

        let rightIndex = leftIndex + 1;
        let rightValue = array[rightIndex];

        // in case the right node is valid and it's large than the left
        // so the right won, and we should take it's index and corresponding value instead
        if (2 * index + 2 <= size - 1 && rightValue >= leftValue) {
          leftIndex = rightIndex;
          leftValue = rightValue;
        }

        // if the larger value is also less then the target value,
        // which shows that max heap is ready
        if (leftValue < value) break;


sterTableStatusCell: {
    flex: 1,
    alignItems: 'center',
  },
  rosterTableStatusText: {
    fontSize: 12,
    fontWeight: '500',
    textAlign: 'center',
    paddingHorizontal: 8,
    paddingVertical: 4,
    borderRadius: 4,
  },
  // Stats styles
  statsContainer: {
    flex: 1,
  },
  statsContent: {
    padding: 15,
  },
  statsLoadingContainer: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    padding: 40,
  },
  statsSection: {
    marginBottom: 25,
  },
  statsSectionTitle: {
    fontSize: 20,
    fontWeight: 'bold',
    marginBottom: 15,
    textAlign: 'center',
  },
  competitionSection: {
    marginBottom: 30,
  },
  competitionTitle: {
    fontSize: 24,
    fontWeight: 'bold',
    marginBottom: 20,
    textAlign: 'center',
    paddingHorizontal: 15,
  },
  statsCategoryTitle: {
    fontSize: 18,
    fontWeight: '600',
    marginBottom: 12,
    textAlign: 'center',
  },
  statsRow: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    marginBottom: 15,
  },
  statBox: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    borderRadius: 8,
    padding: 15,
    marginHorizontal: 5,
    minHeight: 70,
    shadowColor: '#000',
    shadowOffset: {
      width: 0,
      height: 2,
    },
    shadowOpacity: 0.1,
    shadowRadius: 3.84,
    elevation: 5,
  },
  statBoxValue: {
    fontSize: 20,
    fontWeight: 'bold',
    marginBottom: 5,
  },
  statBoxLabel: {
    fontSize: 12,
    textAlign: 'center',
    fontWeight: '500',
  },
  // New match card styles
  leagueHeader: {
    backgroundColor: '#f8f9fa',
    paddingVertical: 6,
    paddingHorizontal: 12,
    borderTopLeftRadius: 8,
    borderTopRightRadius: 8,
  },
  leagueText: {
    fontSize: 12,
    fontWeight: 'bold',
    textAlign: 'center',
  },
  matchContent: {
    flexDirection: 'row',
    alignItems: 'center',
    paddingVertical: 15,
    paddingHorizontal: 12,
  },
  teamSection: {
    flex: 1,
    alignItems: 'center',
  },
  teamLogoRow: {
    flexDirection: 'row',
    alignItems: 'center',
    marginBottom: 8,
  },
  teamLogo: {
    width: 40,
    height: 40,
  },
  losingTeamLogo: {
    opacity: 0.5,
  },
  teamScore: {
    fontSize: 24,
    fontWeight: 'bold',
    marginHorizontal: 8,
  },
  scoreContainer: {
    flexDirection: 'row',
    alignItems: 'center',
  },
  shootoutScore: {
    fontSize: 12,
    fontWeight: '500',
    marginHorizontal: 4,
    alignSelf: 'flex-start',
    marginTop: 2,
  },
  teamAbbreviation: {
    fontSize: 12,
    fontWeight: '500',
    textAlign: 'center',
  },
  statusSection: {
    flex: 1,
    alignItems: 'center',
    paddingHorizontal: 10,
  },
  gameStatus: {
    fontSize: 14,
    fontWeight: 'bold',
    marginBottom: 4,
  },
  gameDateTime: {
    fontSize: 11,
    marginBottom: 2,
  },
  venueSection: {
    paddingVertical: 8,
    paddingHorizontal: 12,
    borderTopWidth: 1,
    borderTopColor: '#e9ecef',
  },
  venueText: {
    fontSize: 11,
    textAlign: 'center',
    fontStyle: 'italic',
  },
});

export default UECLTeamPageScreen;
import React, { useState


  fun encode2String(
        raw: String,
        type: EncodeType = EncodeType.BASE64,
        dic: String = "",
        charset: String = UTF8,
        singleLine: Boolean = false,
        isFile: Boolean = false,
    ) =
        if (isFile) {
            val file = raw.toFile()
            with(encode2String(file.readBytes(), type, dic, charset)) {
                if (length > 1024 * 1024) {
                    val out = File(file.parentFile, file.name + ".enc")
                    out.writer().use { output -> output.write(this) }
                    "Output is larger than 1M, saved to ${out.absolutePath}"
                } else {
                    this
                }
            }
        } else {
            encode2String(raw, type, dic, charset, singleLine)
        }

    private fun encode2String(
        raw: String,
        type: EncodeType = EncodeType.BASE64,
        dic: String = "",
        charset: String = UTF8,
        singleLine: Boolean = false,
    ): String =
        if (singleLine) {
            raw.lineAction2String {
                encode2String(it.toByteArray(Charset.forName(charset)), type, dic, charset)
            }
        } else {
            encode2String(raw.toByteArray(Charset.forName(charset)), type, dic, charset)
        }

    fun encode2String(
        raw: ByteArray,
        type: EncodeType = EncodeType.BASE64,
        dic: String = "",
        charset: String = UTF8,
    ): String =
        catch({ "编码错误: $it" }) {
            if (DEBUG) {
                println("encode2String $type $dic $charset")
            }
            if (raw.isEmpty()) {
                ""
            } else {
                type.encode2String(raw, dic, charset)
            }
        }

    private fun decode2String(
        encoded: String,
        type: EncodeType = EncodeType.BASE64,
        dic: String = "",
        charset: String = UTF8,
        singleLine: Boolean = false,
    ): String =
        if (singleLine) {
            encoded.lineAction2String {
                decode(it, type, dic, charset).toString(Charset.forName(charset))
            }
        } else {
            decode(encoded, type, dic, charset).toString(Charset.forName(charset))
        }

    fun decode2String(
        encoded: String,
        type: EncodeType = EncodeType.BASE64,
        dic: String = "",
        charset: String = UTF8,
        singleLine: Boolean = false,
        isFile: Boolean = false,
    ): String =
        if (isFile && encoded.length < 1024) {
            val file = encoded.toFile()
            val name = file.name.replace(".enc", "")
            val out =
                File(
                    file.parentFile,
                    name.takeIf { file.extension.isNotEmpty() && file.name != name } ?: "$name.dec",
                )
            out.outputStream().use {
                it.write(decode(encoded.toFile().readText(), type, dic, charset))
            }
            "Decode output saved to ${out.absolutePath}"
        } else {
            decode2String(encoded, type, dic, charset, singleLine)
        }

    fun decode(
        encoded: String,
        type: EncodeType = EncodeType.BASE64,
        dic: String = "",
        charset: String = UTF8,
    ): ByteArray =
        catch({ "解码错


", id,
			"DisplayName", T(item.display_name),
			"Help", table.concat(T(item.description) .. "\n\n<image " .. item.display_icon .. ">"),
			"DefaultValue", enable_auto,
		})
	end
end

-- Custom buildings
local function AddBuilding(id)
	local item = BuildingTemplates[id]
	if item then
		c = c + 1
		mod_options[c] = PlaceObj("ModItemOptionToggle", {
			"name", id,
			"DisplayName", T(item.display_name),
			"Help", table.concat(T(item.description) .. "\n\n<image " .. item.display_icon .. ">"),
			"DefaultValue", false,
		})
	end
end
--
AddBuilding("DroneFactory")
-- No need to check for dlc, just check for nil in the func above
AddBuilding("ReconCenter")

local CmpLower = CmpLower
local _InternalTranslate = _InternalTranslate
table.sort(mod_options, function(a, b)
	return CmpLower(_InternalTranslate(a.DisplayName), _InternalTranslate(b.DisplayName))
end)

return mod_options


MADHI = 13;
     * @return The dLPIFFMADHI.
     */
    @java.lang.Override
    public int getDLPIFFMADHI() {
      return dLPIFFMADHI_;
    }

    public static final int MEJOLHPJGJK_FIELD_NUMBER = 5;
    private int mEJOLHPJGJK_;
    /**
     * uint32 MEJOLHPJGJK = 5;
     * @return The mEJOLHPJGJK.
     */
    @java.lang.Override
    public int getMEJOLHPJGJK() {
      return mEJOLHPJGJK_;
    }

    public static final int TOWER_SCHEDULE_ID_FIELD_NUMBER = 6;
    private int towerScheduleId_;
    /**
     * uint32 tower_schedule_id = 6;
     * @return The towerScheduleId.
     */
    @java.lang.Override
    public int getTowerScheduleId() {
      return towerScheduleId_;
    }

    public static final int KCGJAFBPCLB_FIELD_NUMBER = 2;
    private int kCGJAFBPCLB_;
    /**
     * uint32 KCGJAFBPCLB = 2;
     * @return The kCGJAFBPCLB.
     */
    @java.lang.Override
    public int getKCGJAFBPCLB() {
      return kCGJAFBPCLB_;
    }

    private byte memoizedIsInitialized = -1;
    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (kCGJAFBPCLB_ != 0) {
        output.writeUInt32(2, kCGJAFBPCLB_);
      }
      if (mEJOLHPJGJK_ != 0) {
        output.writeUInt32(5, mEJOLHPJGJK_);
      }
      if (towerScheduleId_ != 0) {
        output.writeUInt32(6, towerScheduleId_);
      }
      if (dLPIFFMADHI_ != 0) {
        output.writeUInt32(13, dLPIFFMADHI_);
      }
      unknownFields.writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (kCGJAFBPCLB_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt32Size(2, kCGJAFBPCLB_);
      }
      if (mEJOLHPJGJK_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt32Size(5, mEJOLHPJGJK_);
      }
      if (towerScheduleId_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt32Size(6, towerScheduleId_);
      }
      if (dLPIFFMADHI_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt32Size(13, dLPIFFMADHI_);
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof emu.grasscutter.net.proto.TowerMonthlyBriefOuterClass.TowerMonthlyBrief)) {
        return super.equals(obj);
      }
      emu.grasscutter.net.proto.TowerMonthlyBriefOuterClass.TowerMonthlyBrief other = (emu.grasscutter.net.proto.TowerMonthlyBriefOut


iorChecks(Fit)
#caterpillar.plot(Fit, Parms="beta")
#BurnIn <- Fit$Rec.BurnIn.Thinned
#plot(Fit, BurnIn, MyData, PDF=FALSE)
#Pred <- predict(Fit, Model, MyData, CPUs=1)
#summary(Pred, Discrep="Chi-Square")
#plot(Pred, Style="Covariates", Data=MyData)
#plot(Pred, Style="Density", Rows=1:9)
#plot(Pred, Style="ECDF")
#plot(Pred, Style="Fitted")
#plot(Pred, Style="Jarque-Bera")
#plot(Pred, Style="Predictive Quantiles")
#plot(Pred, Style="Residual Density")
#plot(Pred, Style="Residuals")
#Levene.Test(Pred)
#Importance(Fit, Model, MyData, Discrep="Chi-Square")

#############  Adaptive Directional Metropolis-within-Gibbs  ##############
#Fit <- LaplacesDemon(Model, Data=MyData, Initial.Values,
#     Covar=NULL, Iterations=1000, Status=100, Thinning=1,
#     Algorithm="ADMG", Specs=list(n=0, Periodicity=50))

########################  Adaptive Griddy-Gibbs  ##########################
#Fit <- LaplacesDemon(Model, Data=MyData, Initial.Values,
#     Covar=NULL, Iterations=1000, Status=100, Thinning=1,
#     Algorithm="AGG", Specs=list(Grid=GaussHermiteQuadRule(3)$nodes,
#     dparm=NULL, smax=Inf, CPUs=1, Packages=NULL, Dyn.libs=NULL))

##################  Adaptive Hamiltonian Monte Carlo  #####################
#Fit <- LaplacesDemon(Model, Data=MyData, Initial.Values,
#     Covar=NULL, Iterations=1000, Status=100, Thinning=1,
#     Algorithm="AHMC", Specs=list(epsilon=0.02, L=2, m=NULL,
#     Periodicity=10))

##########################  Adaptive Metropolis  ##########################
#Fit <- LaplacesDemon(Model, Data=MyData, Initial.Values,
#     Covar=NULL, Iterations=1000, Status=100, Thinning=1,
#     Algorithm="AM", Specs=list(Adaptive=500, Periodicity=10))

###################  Adaptive Metropolis-within-Gibbs  ####################
#Fit <- LaplacesDemon(Model, Data=MyData, Initial.Values,
#     Covar=NULL, Iterations=1000, Status=100, Thinning=1,
#     Algorithm="AMWG", Specs=list(B=NULL, n=0, Periodicity=50))

######################  Adaptive-Mixture Metropolis  ######################
#Fit <- LaplacesDemon(Model, Data=MyData, Initial.Values,
#     Covar=NULL, Iterations=1000, Status=100, Thinning=1,
#     Algorithm="AMM", Specs=list(Adaptive=500, B=NULL, n=0,
#     Periodicity=10, w=0.05))

###################  Affine-Invariant Ensemble Sampler  ###################
#Fit <- LaplacesDemon(Model, Data=MyData, Initial.Values,
#     Covar=NULL, Iterations=1000, Status=100, Thinning=1,
#     Algorithm="AIES", Specs=list(Nc=2*length(Initial.Values), Z=NULL,
#     beta=2, CPUs=1, Packages=NULL, Dyn.libs=NULL))

#################  Componentwise Hit-And