2, $s3
/* 10AFEC 80163B7C 1420FFB6 */  bnez  $at, .L80163A58_ovl5
/* 10AFF0 80163B80 00000000 */   nop
/* 10AFF4 80163B84 3C11800F */  lui   $s1, %hi(D_800EA520) # $s1, 0x800f
/* 10AFF8 80163B88 2631A520 */  addiu $s1, %lo(D_800EA520) # addiu $s1, $s1, -0x5ae0
/* 10AFFC 80163B8C 27B20080 */  addiu $s2, $sp, 0x80
/* 10B000 80163B90 27B50090 */  addiu $s5, $sp, 0x90
/* 10B004 80163B94 27B4008C */  addiu $s4, $sp, 0x8c
/* 10B008 80163B98 27B30080 */  addiu $s3, $sp, 0x80
.L80163B9C_ovl5:
/* 10B00C 80163B9C 12530006 */  beq   $s2, $s3, .L80163BB8_ovl5
/* 10B010 80163BA0 00000000 */   nop
/* 10B014 80163BA4 8E440000 */  lw    $a0, ($s2)
/* 10B018 80163BA8 0C0584B4 */  jal   func_801612D0_ovl5
/* 10B01C 80163BAC 8E45FFFC */   lw    $a1, -4($s2)
/* 10B020 80163BB0 14400008 */  bnez  $v0, .L80163BD4_ovl5
/* 10B024 80163BB4 00000000 */   nop
.L80163BB8_ovl5:
/* 10B028 80163BB8 1254001A */  beq   $s2, $s4, .L80163C24_ovl5
/* 10B02C 80163BBC 00000000 */   nop
/* 10B030 80163BC0 8E440000 */  lw    $a0, ($s2)
/* 10B034 80163BC4 0C0584B4 */  jal   func_801612D0_ovl5
/* 10B038 80163BC8 8E450004 */   lw    $a1, 4($s2)
/* 10B03C 80163BCC 10400015 */  beqz  $v0, .L80163C24_ovl5
/* 10B040 80163BD0 00000000 */   nop
.L80163BD4_ovl5:
/* 10B044 80163BD4 0C058249 */  jal   func_80160924_ovl5
/* 10B048 80163BD8 8E440000 */   lw    $a0, ($s2)
/* 10B04C 80163BDC 50400028 */  beql  $v0, $zero, .L80163C80_ovl5
/* 10B050 80163BE0 26520004 */   addiu $s2, $s2, 4
/* 10B054 80163BE4 8E4A0000 */  lw    $t2, ($s2)
/* 10B058 80163BE8 240F0003 */  li    $t7, 3
/* 10B05C 80163BEC 000A5880 */  sll   $t3, $t2, 2
/* 10B060 80163BF0 020B6021 */  addu  $t4, $s0, $t3
/* 10B064 80163BF4 8D830000 */  lw    $v1, ($t4)
/* 10B068 80163BF8 00031880 */  sll   $v1, $v1, 2
/* 10B06C 80163BFC 02E36821 */  addu  $t5, $s7, $v1
/* 10B070 80163C00 8DAE0000 */  lw    $


",
  [8865] = "Tome of Ice Armor III",
  [8866] = "Tome of Cone of Cold IV",
  [8867] = "Tome of Frostbolt IX",
  [8868] = "Tome of Conjure Water VI",
  [8869] = "Tome of Fire Ward IV",
  [8870] = "Tome of Greater Invisibility",
  [8871] = "Tome of Conjure Food VI",
  [8872] = "Tome of Blizzard V",
  [8873] = "Tome of Mana Shield V",
  [8874] = "Tome of Scorch VI",
  [8875] = "Tome of Frost Ward IV",
  [8876] = "Tome of Frost Ward II",
  [8877] = "Tome of Fireball X",
  [8878] = "Tome of Fire Blast VII",
  [8879] = "Tome of Frost Nova IV",
  [8880] = "Tome of Arcane Explosion VI",
  [8881] = "Tome of Khadgar\'s Unlocking IV",
  [8882] = "Tome of Amplify Magic IV",
  [8883] = "Tome of Arcane Intellect V",
  [8884] = "Tome of Frostbolt X",
  [8885] = "Tome of Arcane Missiles VII",
  [8886] = "Tome of Flamestrike VI",
  [8887] = "Tome of Scorch VII",
  [8888] = "Tome of Cone of Cold V",
  [8889] = "Tome of Conjure Mana Gem IV",
  [8890] = "Tome of Fireball XI",
  [8891] = "Tome of Ice Armor IV",
  [8892] = "Tome of Conjure Water VII",
  [8893] = "Tome of Sleep IV",
  [8894] = "Tome of Dampen Magic V",
  [8895] = "Tome of Blizzard VI",
  [8896] = "Tome of Mana Shield VI",
  [8897] = "Tome of Fire Ward V",
  [8898] = "Tome of Arcane Explosion IV",
  [8899] = "Tome of Scorch IV",
  [8900] = "Book of Entangling Roots IV",
  [8901] = "Book of Healing Touch VIII",
  [8902] = "Book of Mark of the Wild V",
  [8903] = "Book of Moonfire VII",
  [8904] = "Book of Moonfire VIII",
  [8905] = "Book of Regrowth VI",
  [8906] = "Book of Rejuvenation VIII",
  [8907] = "Book of Starfire IV",
  [8908] = "Unk Item #46 - Recipe - Book (Learn - Purify)",
  [8909] = "Libram: Holy Strike II",
  [8910] = "Libram: Lay on Hands",
  [8911] = "Libram: Fist of Justice",
  [8912] = "Libram: Crusader Strike",
  [8913] = "Libram: Holy Strike III",
  [8914] = "Libram: Crusader Strike II",
  [8915] = "Libram: Holy Strike IV",
  [8916] = "Libram: Fist of Justice II",
  [8917] = "Libram: Lay on Hands II",
  [8918] = "Libram: Seal of Protection III",
  [8919] = "Libram: Holy Strike V",
  [8920] = "Libram: Crusader Strike III",
  [8921] = "Libram: Fist of Justice III",
  [8922] = "Libram: Holy Strike VI",
  [8925] = "Vial corrupto",
  [8926] = "Veneno instantáneo",
  [8927] = "Veneno instantáneo",
  [8928] = "Veneno instantá


 * */
module GMD_xxx{

    /**
     * 游戏UI 标识  scene显示界面时使用
     * tag 需要大于1000
     */
    export const enum GameUITag{
    }

    /**
     * 用于显示界面  弹出界面  全屏特效 等公用公能 */
    export let scene:game.IScene;

    //当前是否 激活状态
    export let isActive:boolean;

    //----------------------- 游戏必须有的接口 ----- start
    export function init():void{
        scene = game.gameScene;

        gameDataMo = new GameDataModel();

        //处理 配置 语言包
        let resName = "xxxLang";
        let resData = RES.getRes( resName );
        if( resData )
        {
            TRain.langMgr.addGps( resData );
            RES.destroyRes( resName );
        }

        resName = "xxx";
        resData = RES.getRes( resName );
        if( resData )
        {
            gameDataMo.initConf( resData );
            RES.destroyRes( resName );
        }
    }

    /**
     *
     * @param data   当data有值  且inGame=true 表示当前正在游戏中
     */
    export function start( data?:{inGame:boolean}  ):void{
        //处理 protobuf
        game.Protobuf.addDecodeProtos( XXX_NET_CONF.s2cDecode, XXX_NET_CONF.typeDecode );
        game.Protobuf.addEncodeProtos( XXX_NET_CONF.c2sEncode );

        // let ingame = data ? data.inGame : false;
        // if ( ingame )
        // {//玩家已经登陆游戏中了
        //     //如果 有 check_state 消息，则先获得游戏状态.再按状态做对应处理
        //     //如果 没有 check_state 消息，则直接去获得场景信息,再处理该信息
        // }
        // else
        // {
        //     //显示房间列表界面
        // }

        gameDataMo.regHandler();
        showUI( data );

        isActive = true;
        let stage = TRain.core.stage;
        stage.addEventListener(egret.Event.ACTIVATE, onActive, self);
        stage.addEventListener(egret.Event.DEACTIVATE, onDeactive, self);
    }

    export function onReConnect():void{
		//断线重连时  被调用
    }

    export function end():void{
        let stage = TRain.core.stage;
        stage.removeEventListener(egret.Event.ACTIVATE, onActive, self);
        stage.removeEventListener(egret.Event.DEACTIVATE, onDeactive, self);

        hideUI();
        gameDataMo.unRegHandler();

        //处理 protobuf
        game.Protobuf.rmvDecodeProtos( XXX_NET_CONF.s2cDecode, XXX_NET_CONF.typeDecode );
        game.Protobuf.rmvEncodeProtos( XXX_NET_CONF.c2sEncode );

        game.gameScene.endGame();
    }

    export function close(){

    }

    //----------------------- 游戏必须有的接口 ----- end
	//只有在有牌路数据的时候才用
    function onActive():void{
		//窗口（浏览器）由最小化恢复时  被调用
        isActive = true;
		//game.dataMgr.gsMo.startConn(); //只有在选场界面才需要重新连接状态服
    }

    function onDeactive():void{
		//窗口（浏览器）最小化时  被调用
        isActive = false;
		//game.dataMgr.gsMo.endConn();
    }

    //------------------------------------- ui -------------------------------------
	//需要初始化的ui界面
    function showUI( data:any ):void{
        scene.showGameUI( 1000, XxxFrame, false );
    }
	//关闭ui界面
    function hideUI():void{

    }
}export type UserM = {
  id: UserId;
  name: string;
};

export type ProjectId = `project${number}`;
export type UserId = `user${number}`;
export type NoteId = number;
export type LineId = `line${number}`;

// -------------------------------------------------------------------------------------
// Network Model
// -----------------


ihui"
  },
  {
    "CMYK": [82, 60, 65, 80],
    "RGB": [31, 38, 35],
    "hex": "#1f2623",
    "name": "\u82f7\u84dd\u7eff",
    "pinyin": "ganlanlv"
  },
  {
    "CMYK": [90, 62, 67, 86],
    "RGB": [20, 30, 27],
    "hex": "#141e1b",
    "name": "\u83bd\u4e1b\u7eff",
    "pinyin": "mangconglv"
  },
  {
    "CMYK": [33, 1, 29, 0],
    "RGB": [198, 223, 200],
    "hex": "#c6dfc8",
    "name": "\u6de1\u7fe0\u7eff",
    "pinyin": "dancuilv"
  },
  {
    "CMYK": [53, 1, 44, 0],
    "RGB": [158, 204, 171],
    "hex": "#9eccab",
    "name": "\u660e\u7eff",
    "pinyin": "minglv"
  },
  {
    "CMYK": [75, 0, 59, 0],
    "RGB": [104, 184, 142],
    "hex": "#68b88e",
    "name": "\u7530\u56ed\u7eff",
    "pinyin": "tianyuanlv"
  },
  {
    "CMYK": [98, 0, 82, 0],
    "RGB": [32, 161, 98],
    "hex": "#20a162",
    "name": "\u7fe0\u7eff",
    "pinyin": "cuilv"
  },
  {
    "CMYK": [78, 6, 62, 0],
    "RGB": [97, 172, 133],
    "hex": "#61ac85",
    "name": "\u6de1\u7eff",
    "pinyin": "danlv"
  },
  {
    "CMYK": [90, 7, 73, 0],
    "RGB": [64, 160, 112],
    "hex": "#40a070",
    "name": "\u8471\u7eff",
    "pinyin": "conglv"
  },
  {
    "CMYK": [99, 10, 91, 2],
    "RGB": [34, 148, 83],
    "hex": "#229453",
    "name": "\u5b54\u96c0\u7eff",
    "pinyin": "kongquelv"
  },
  {
    "CMYK": [27, 11, 27, 1],
    "RGB": [202, 211, 195],
    "hex": "#cad3c3",
    "name": "\u827e\u7eff",
    "pinyin": "ailv"
  },
  {
    "CMYK": [92, 14, 76, 2],
    "RGB": [60, 149, 102],
    "hex": "#3c9566",
    "name": "\u87fe\u7eff",
    "pinyin": "chanlv"
  },
  {
    "CMYK": [100, 17, 92, 5],
    "RGB": [32, 137, 77],
    "hex": "#20894d",
    "name": "\u5bab\u6bbf\u7eff",
    "pinyin": "gongdianlv"
  },
  {
    "CMYK": [61, 19, 52, 3],
    "RGB": [131, 167, 141],
    "hex": "#83a78d",
    "name": "\u677e\u971c\u7eff",
    "pinyin": "songshuanglv"
  },
  {
    "CMYK": [81, 19, 67, 4],
    "R


y":"Немачка","Djibouti":"Џибути","Denmark":"Данска","Dominica":"Доминика","Dominican Republic":"Доминиканска Република","Algeria":"Алжир","Ecuador":"Еквадор","Estonia":"Естонија","Egypt":"Египат","Western Sahara":"Западна Сахара","Eritrea":"Еритреја","Spain":"Шпанија","Ethiopia":"Етиопија","Finland":"Финска","Fiji":"Фиџи","Falkland Islands":"Фолкландска Острва","Federated States of Micronesia":"Микронезија","Faroe Islands":"Фарска Острва","France":"Француска","Gabon":"Габон","United Kingdom":"Велика Британија","Grenada":"Гренада","Georgia":"Грузија","French Guiana":"Француска Гвајана","Guernsey":"Гурнси","Ghana":"Гана","Gibraltar":"Гибралтар","Greenland":"Гренланд","Gambia":"Гамбија","Guinea":"Гвинеја","Guadeloupe":"Гваделупе","Equatorial Guinea":"Екваторијална Гвинеја","Greece":"Грчка","South Georgia and South Sandwich Islands":"Јужна Џорџија и Јужна Сендвич Острва","Guatemala":"Гватемала","Guam":"Гуам","Guinea-Bissau":"Гвинеја-Бисао","Guyana":"Гвајана","Hong Kong":"Хонг Конг С. А. Р. Кина","Heard Island and McDonald Islands":"Херд и Мекдоналд Острва","Honduras":"Хондурас","Croatia":"Хрватска","Haiti":"Хаити","Hungary":"Мађарска","Indonesia":"Индонезија","Ireland":"Ирска","Israel":"Израел","Isle of Man":"Острво Ман","India":"Индија","British Indian Ocean Territory":"Британска територија у Индијском океану","Iraq":"Ирак","Iran":"Иран","Iceland":"Исланд","Italy":"Италија","Jersey":"Џерси","Jamaica":"Јамајка","Jordan":"Јордан","Japan":"Јапан","Kenya":"Кенија","Kyrgyzstan":"Киргизстан","Cambodia":"Камбоџа","Kiribati":"Кирибати","Comoros":"Коморска Острва","Saint Kitts and Nevis":"Сент Китс и Невис","North Korea":"Северна Кореја","South Korea":"Јужна Кореја","Kuwait":"Кувајт","Cayman Islands":"Кајманска Острва","Kazakhstan":"Казахстан","Lao People's Democratic Republic":"Лаос","Lebanon":"Либан","Saint Lucia":"Сент Луција","Liechtenstein":"Лихтенштајн","Sri Lanka":"Шри Ланка","Liberia":"Либерија","Lesotho":"Лесото","Lithuania":"Литванија","Luxembourg":"Луксембург","Latvia":"Летонија","Libya":"Либија","Morocco":"Мароко","Monaco":"Монако","Moldova":"Молдавија","Montenegro":"Црна Гора","Saint Martin":"Сент Мартин","Madagascar":"Мадагаскар","Marshall Islands":"Мар


0,2]])

    # Assign ranks
    for i in range(len(self.pop)):
      self.pop[i].rank = rank[i]

# -- Hyperparameter plumbing --------------------------------------------- -- #
def loadHyp(pFileName, printHyp=False):
  """Loads hyperparameters from .json file
  Args:
      pFileName - (string) - file name of hyperparameter file
      printHyp  - (bool)   - print contents of hyperparameter file to terminal?

  Note: see p/hypkey.txt for detailed hyperparameter description
  """

  # Load Parameters from disk
  with open(pFileName) as data_file:
    hyp = json.load(data_file)

  # Task hyper parameters
  task = Task(games[hyp['task']],paramOnly=True)
  hyp['ann_nInput']   = task.nInput
  hyp['ann_nOutput']  = task.nOutput
  hyp['ann_initAct']  = task.activations[0]
  hyp['ann_actRange'] = task.actRange

  if 'alg_act' in hyp:
    hyp['ann_actRange'] = np.full_like(task.actRange,hyp['alg_act'])

  if printHyp is True:
    print(json.dumps(hyp, indent=4, sort_keys=True))
  return hyp

def updateHyp(hyp,pFileName=None):
  """Overwrites default hyperparameters with those from second .json file
  """
  print('\t*** Running with hyperparameters: ', pFileName, '\t***')
  ''' Overwrites selected parameters those from file '''
  if pFileName != None:
    with open(pFileName) as data_file:
      update = json.load(data_file)

    hyp.update(update)

    # Task hyper parameters
    task = Task(games[hyp['task']],paramOnly=True)
    hyp['ann_nInput']   = task.nInput
    hyp['ann_nOutput']  = task.nOutput
    hyp['ann_initAct']  = task.activations[0]
    hyp['ann_actRange'] = task.actRange


clude() {
    return Nip05DataInclude._();
  }

  static Nip05DataIncludeList includeList({
    _i1.WhereExpressionBuilder<Nip05DataTable>? where,
    int? limit,
    int? offset,
    _i1.OrderByBuilder<Nip05DataTable>? orderBy,
    bool orderDescending = false,
    _i1.OrderByListBuilder<Nip05DataTable>? orderByList,
    Nip05DataInclude? include,
  }) {
    return Nip05DataIncludeList._(
      where: where,
      limit: limit,
      offset: offset,
      orderBy: orderBy?.call(Nip05Data.t),
      orderDescending: orderDescending,
      orderByList: orderByList?.call(Nip05Data.t),
      include: include,
    );
  }

  @override
  String toString() {
    return _i1.SerializationManager.encode(this);
  }
}

class _Undefined {}

class _Nip05DataImpl extends Nip05Data {
  _Nip05DataImpl({
    int? id,
    required String name,
    required String domain,
    required String pubkey,
    required List<String> relays,
    required DateTime createdAt,
  }) : super._(
          id: id,
          name: name,
          domain: domain,
          pubkey: pubkey,
          relays: relays,
          createdAt: createdAt,
        );

  /// Returns a shallow copy of this [Nip05Data]
  /// with some or all fields replaced by the given arguments.
  @_i1.useResult
  @override
  Nip05Data copyWith({
    Object? id = _Undefined,
    String? name,
    String? domain,
    String? pubkey,
    List<String>? relays,
    DateTime? createdAt,
  }) {
    return Nip05Data(
      id: id is int? ? id : this.id,
      name: name ?? this.name,
      domain: domain ?? this.domain,
      pubkey: pubkey ?? this.pubkey,
      relays: relays ?? this.relays.map((e0) => e0).toList(),
      createdAt: createdAt ?? this.createdAt,
    );
  }
}

class Nip05DataTable extends _i1.Table<int?> {
  Nip05DataTable({super.tableRelation}) : super(tableName: 'nip_05_data') {
    name = _i1.ColumnString(
      'name',
      this,
    );
    domain = _i1.ColumnString(
      'domain',
      this,
    );
    pubkey = _i1.ColumnString(
      'pubkey',
      this,
    );
    relays = _i1.ColumnSerializable(
      'relays',
      this,
    );
    createdAt = _i1.ColumnDateTime(
      'createdAt',
      this,
    );
  }

  late final _i1.ColumnString name;

  late final _i1.ColumnString domain;

  late final _i1.ColumnString pubkey;

  late final _i1.ColumnSerializable relays;

  late final _i1.ColumnDateTime createdAt;

  @override
  List<_i1.Column> get columns => [
        id,
        name,
        domain,
        pubkey,
        relays,
        createdAt,
      ];
}

class Nip05DataInclude extends _i1.IncludeObject {
  Nip05DataInclude._();

  @override
  Map<String, _i1.Include?> get includes => {};

  @override
  _i1.Table<int?> get table => Nip05Data.t;
}

class Nip05DataIncludeList extends _i1.IncludeList {
  Nip05DataIncludeList._({
    _i1.WhereExpressionBuilder<Nip05DataTable>? where,
    super.limit,
    super.offset,
    super.orderBy,
    super.orderDescending,
    super.orderByList,
    super.include,
  }) {
    super.


            isVisibleXY = true;
                    minZ = min(minZ, min(tri.P0.z, min(tri.P1.z, tri.P2.z)));
                    maxZ = max(maxZ, max(tri.P0.z, max(tri.P1.z, tri.P2.z)));
                }
            }

            if (isVisibleXY && minZ < shadowMax.z && maxZ > shadowMin.z)
            {
                // 为了阴影的完整性，不应该修改 shadowMax.z
                shadowMin.z = max(shadowMin.z, minZ);
                return true;
            }

            return false;
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        private static unsafe void CullTriangle([NoAlias] TriangleData* triangles,
            ref int triangleIndex, ref int triangleCount, in EdgeData edge)
        {
            ref TriangleData tri = ref triangles[triangleIndex];

            if (tri.IsCulled)
            {
                return;
            }

            int insideInfo = 0b000;
            if (IsPointInsideEdge(in edge, in tri.P0)) insideInfo |= 0b001;
            if (IsPointInsideEdge(in edge, in tri.P1)) insideInfo |= 0b010;
            if (IsPointInsideEdge(in edge, in tri.P2)) insideInfo |= 0b100;

            bool isOnePointInside;

            // 将在边界里的点移动到 [P0, P1, P2] 列表的前面
            switch (insideInfo)
            {
                // 没有点在里面
                case 0b000: tri.IsCulled = true; return;

                // 有一个点在里面
                case 0b001: isOnePointInside = true; break;
                case 0b010: isOnePointInside = true; Swap(ref tri.P0, ref tri.P1); break;
                case 0b100: isOnePointInside = true; Swap(ref tri.P0, ref tri.P2); break;

                // 有两个点在里面
                case 0b011: isOnePointInside = false; break;
                case 0b101: isOnePointInside = false; Swap(ref tri.P1, ref tri.P2); break;
                case 0b110: isOnePointInside = false; Swap(ref tri.P0, ref tri.P2); break;

                // 所有点在里面
                case 0b111: return;

                // Unreachable
                default: Debug.LogError("Unknown triangleInsideInfo"); return;
            }

            if (isOnePointInside)
            {
                // 只有 P0 在里面
                float3 v01 = tri.P1 - tri.P0;
                float3 v02 = tri.P2 - tri.P0;

                float dist = edge.Value - tri.P0[edge.ComponentIndex];
                tri.P1 = v01 * rcp(v01[edge.ComponentIndex]) * dist + tri.P0;
                tri.P2 = v02 * rcp(v02[edge.ComponentIndex]) * dist + tri.P0;
            }
            else
            {
                // 只有 P2 在外面
                float3 v20 = tri.P0 - tri.P2;
                float3 v21 = tri.P1 - tri.P2;

                float dist = edge.Value - tri.P2[edge.ComponentIndex];
                float3 p0 = v20 * rcp(v20[edge.ComponentIndex]) * dist + tri.P2;
                float3 p1 = v21 * rcp(v21[edge.ComponentIndex]) * dist + tri.P2;

                // 第一个三角形
                tri.P2 = p0;

                // 把下一个三角形拷贝到列表最后新的位置上，然后把新三角形数据写入到下个位置
                // 新的三角形必定三个点都在边界内，所以 ++triangleIndex 跳过检查
                ref TriangleData newTri = ref triangles[++triangleIndex];
                triangles[triangleCount++] = newTri;

                // 第二个三角形
                newTri.P0 = p


.ne-viewer .ne-drawer-box {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}
.ne-viewer.ne-ui-max-view .ne-drawer-box {
  display: none;
}
@media only print {
  .ne-viewer .ne-drawer-box {
    display: none;
  }
}
.ne-viewer {
  position: relative;
}
.ne-viewer .ne-viewer-body {
  position: relative;
  z-index: 1;
  outline: none;
  white-space: pre-wrap;
  white-space: break-spaces;
  word-break: break-word;
  word-wrap: break-word;
  font-family: 'Chinese Quote', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-variant-ligatures: none;
  --link-color: var(--lakex-editor-text-link);
}
.ne-viewer .ne-viewer-body ::selection {
  background: var(--lakex-editor-selection) !important;
  color: inherit !important;
}
.ne-viewer .ne-viewer-body .ne-table {
  white-space: pre-wrap;
}
.ne-viewer .ne-viewer-body .ne-spacing-all {
  margin-top: 16px;
  margin-bottom: 16px;
}
.ne-viewer .ne-viewer-body .ne-spacing-top {
  margin-top: 16px;
}
.ne-viewer .ne-viewer-body .ne-spacing-bottom {
  margin-bottom: 16px;
}
.ne-viewer .ant-radio-inner:after {
  display: block;
}
.ne-viewer ne-hole,
.ne-viewer ne-container-hole,
.ne-viewer ne-alert-hole {
  width: 100%;
  max-width: 100%;
  display: flex;
}
.ne-viewer ne-hole.ne-spacing-all:first-child,
.ne-viewer ne-container-hole.ne-spacing-all:first-child,
.ne-viewer ne-alert-hole.ne-spacing-all:first-child {
  margin-top: 0;
}
.ne-viewer ne-hole.ne-spacing-top:first-child,
.ne-viewer ne-container-hole.ne-spacing-top:first-child,
.ne-viewer ne-alert-hole.ne-spacing-top:first-child {
  margin-top: 0;
}
.ne-viewer ne-root-card-hole.ne-full-width ne-card[data-card-type='block'] {
  width: auto;
}
.ne-viewer ne-card {
  text-indent: 0;
}
.ne-viewer ne-card.ne-card-mask:after {
  content: ' ';
  position: absolute;
  display: block;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  cursor: not-allowed;
}
.ne-viewer ne-card[data-card-type='inline'] {
  display: inline-flex;
  vertical-align: baseline;
  max-width: calc(100% - 2px);
  white-space: initial;
  height: auto;
}
.ne-viewer ne-card[data-card-type='block'] {
  display: block;
  width: calc(100% - 2px);
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--lakex-editor-border-primary);
  margin-top: 2px;
  margin-bottom: 2px;
}
.ne-view


s package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/

#include <qdebug.h>
#include <private/qfontengine_p.h>
#include <qmath.h>
#include <private/qmath_p.h>
#include <private/qdrawhelper_p.h>
#include <private/qpaintengine_p.h>
#include "qapplication.h"
#include "qbrush.h"
#include "qgl.h"
#include <private/qgl_p.h>
#include <private/qglpaintdevice_p.h>
#include <private/qpainter_p.h>
#include "qmap.h"
#include <private/qpaintengine_opengl_p.h>
#include <private/qdatabuffer_p.h>
#include "qpen.h"
#include "qvarlengtharray.h"
#include <private/qpainter_p.h>
#include <private/qglpixelbuffer_p.h>
#include <private/qbezier_p.h>
#include <qglframebufferobject.h>

#include "private/qtessellator_p.h"

#include "util/fragmentprograms_p.h"

#ifdef Q_WS_QWS
#include "private/qglwindowsurface_qws_p.h"
#include "qwsmanager_qws.h"
#include "private/qwsmanager_p.h"
#endif

#ifdef QT_OPENGL_ES_1_CL
#include "qgl_cl_p.h"
#endif

#define QGL_FUNC_CONTEXT QGLContext *ctx = const_cast<QGLContext *>(device->context());

#include <stdlib.h>
#include "qpaintengine_opengl_p.h"

QT_BEGIN_NAMESPACE

extern QImage qt_imageForBrush(int brushStyle, bool invert); //in qbrush.cpp
#ifdef QT_MAC_USE_COCOA
extern void *qt_current_nsopengl_context(); // qgl_mac.mm
#endif

#define QREAL_MAX 9e100
#define QREAL_MIN -9e100

extern int qt_next_power_of_two(int v);

#define DISABLE_DEBUG_ONCE

//#define DEBUG_DISPLAY_MASK_TEXTURE

#ifdef DISABLE_DEBUG_ONCE
#define DEBUG_OVERRIDE(state) ;
#define DEBUG_ONCE_STR(str) ;
#define DEBUG_ONCE if (0)
#else
static int DEBUG_OVERRIDE_FLAG = 0;
static bool DEBUG_TEMP_FLAG;
#define DEBUG_OVERRIDE(state) { state ? ++DEBUG_OVERRIDE_FLAG : --DEBUG_OVERRIDE_FLAG; }
#define DEBUG_ONCE if ((DEBUG_TEMP_FLAG = DEBUG_OVERRIDE_FLAG) && 0) ; else for (static int DEBUG_ONCE_FLAG = false; !DEBUG_ONCE_FLAG || DEBUG_TEMP_FLAG; DEBUG_ONCE_FLAG = true, DEBUG_TEMP_FLAG = false)
#define DEBUG_ONCE_STR(str) DEBUG_ONCE qDebug() << (str);
#endif

static inline void qt_glColor4ubv(unsigned char *col)
{
#ifdef QT_OPENGL_ES
        glColor4f(col[0]/255.0, col[1]/255.0, col[2]/255.0, col[3]/255.0);
#else
        glColor4ubv(col);
#endif
}

struct QT_PointF {
    qreal x;
    qreal y;
};

struct QGLTrapezoid
{
    QGLTrapezoid()
    {}

    QGLTrapezoid(qreal top_, qreal bottom_, qreal topLeftX_, qreal topRightX_, qreal bottomLeftX_, qreal bottomRightX_)
        : top(


Logs is a freelist of *eventLog
var freeEventLogs = make(chan *eventLog, 1000)

// newEventLog returns a event log ready to use.
func newEventLog() *eventLog {
	select {
	case el := <-freeEventLogs:
		return el
	default:
		return new(eventLog)
	}
}

// freeEventLog adds el to freeEventLogs if there's room.
// This is non-blocking.
func freeEventLog(el *eventLog) {
	el.reset()
	select {
	case freeEventLogs <- el:
	default:
	}
}

var eventsTmplCache *template.Template
var eventsTmplOnce sync.Once

func eventsTmpl() *template.Template {
	eventsTmplOnce.Do(func() {
		eventsTmplCache = template.Must(template.New("events").Funcs(template.FuncMap{
			"elapsed":   elapsed,
			"trimSpace": strings.TrimSpace,
		}).Parse(eventsHTML))
	})
	return eventsTmplCache
}

const eventsHTML = `

		<title>events</title>

/debug/events

	{{range $i, $fam := .Families}}

		{{$fam}}

	        {{range $j, $bucket := $.Buckets}}
	        {{$n := index $.Counts $i $j}}

	                {{if $n}}{{end}}
		        [{{$n}} {{$bucket.String}}]
			{{if $n}}{{end}}

                {{end}}

{{end}}

{{if $.EventLogs}}

Family: {{$.Family}}

{{if $.Expanded}}{{end}}
[Summary]{{if $.Expanded}}{{end}}

{{if not $.Expanded}}{{end}}
[Expanded]{{if not $.Expanded}}{{end}}

When	Elapsed

	{{range $el := $.EventLogs}}

		{{$el.When}}
		{{$el.ElapsedTime}}
		{{$el.Title}}

	{{if $.Expanded}}


2.I1.this[int].get' must declare a body because it is not marked abstract, extern, or partial
                //     abstract int I1.this[int i] { get; }
                Diagnostic(ErrorCode.ERR_ConcreteMissingBody, "get").WithArguments("C2.I1.this[int].get").WithLocation(9, 35)
                );
        }

        [Fact]
        public void IndexerReAbstraction_057()
        {
            var source1 =
@"
public interface I1
{
    int this[int i] {set;}
}

public interface I2 : I1
{
    abstract int I1.this[int i] { get; }
}

class Test1 : I2
{
}
";
            ValidatePropertyReAbstraction_014(source1,
                // (9,21): error CS0551: Explicit interface implementation 'I2.I1.this[int]' is missing accessor 'I1.this[int].set'
                //     abstract int I1.this[int i] { get; }
                Diagnostic(ErrorCode.ERR_ExplicitPropertyMissingAccessor, "this").WithArguments("I2.I1.this[int]", "I1.this[int].set").WithLocation(9, 21),
                // (9,35): error CS0550: 'I2.I1.this[int].get' adds an accessor not found in interface member 'I1.this[int]'
                //     abstract int I1.this[int i] { get; }
                Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "get").WithArguments("I2.I1.this[int].get", "I1.this[int]").WithLocation(9, 35),
                // (12,15): error CS0535: 'Test1' does not implement interface member 'I1.this[int]'
                // class Test1 : I2
                Diagnostic(ErrorCode.ERR_UnimplementedInterfaceMember, "I2").WithArguments("Test1", "I1.this[int]").WithLocation(12, 15)
                );
        }

        [Fact]
        public void IndexerReAbstraction_058()
        {
            var source1 =
@"
public interface I1
{
    internal int this[int i] {get => throw null;}
}
";
            var source2 =
@"
public interface I2 : I1
{
    abstract int I1.this[int i] { get;}
}

class Test1 : I2
{
}
";
            ValidatePropertyReAbstraction_026(source1, source2,
                // (4,21): error CS0122: 'I1.this[int]' is inaccessible due to its protection level
                //     abstract int I1.this[int i] { get;}
                Diagnostic(ErrorCode.ERR_BadAccess, "this").WithArguments("I1.this[int]").WithLocation(4, 21),
                // (7,15): error CS0535: 'Test1' does not implement interface member 'I1.this[int]'
                // class Test1 : I2
                Diagnostic(ErrorCode.ERR_UnimplementedInterfaceMember, "I2").WithArguments("Test1", "I1.this[int]").WithLocation(7, 15)
                );
        }

        [Fact]
        public void IndexerReAbstraction_059()
        {
            var source1 =
@"
public interface I1
{
    int this[int i] {set;}
}

public interface I2 : I1
{
    abstract int I1.this[int i] {set;}
}
";

            var source2 =
@"
class Test1 : I2
{
}
";
            ValidatePropertyReAbstraction_001(source1, source2,
                // (2,15): error CS0535: 'Test1' does not implement interface member 'I1.this[int]'
                // class Test1 : I2
                Diagnostic(ErrorCode.ERR_UnimplementedInt


 * through this function so some applications may wish to modify it
 * to avoid allocating a large strm->output buffer and copying into it.
 * (See also read_buf()).
 */
function flush_pending(strm) {
  var s = strm.state;

  //_tr_flush_bits(s);
  var len = s.pending;
  if (len > strm.avail_out) {
    len = strm.avail_out;
  }
  if (len === 0) { return; }

  utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
  strm.next_out += len;
  s.pending_out += len;
  strm.total_out += len;
  strm.avail_out -= len;
  s.pending -= len;
  if (s.pending === 0) {
    s.pending_out = 0;
  }
}

function flush_block_only(s, last) {
  trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
  s.block_start = s.strstart;
  flush_pending(s.strm);
}

function put_byte(s, b) {
  s.pending_buf[s.pending++] = b;
}

/* =========================================================================
 * Put a short in the pending buffer. The 16-bit value is put in MSB order.
 * IN assertion: the stream state is correct and there is enough room in
 * pending_buf.
 */
function putShortMSB(s, b) {
//  put_byte(s, (Byte)(b >> 8));
//  put_byte(s, (Byte)(b & 0xff));
  s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
  s.pending_buf[s.pending++] = b & 0xff;
}

/* ===========================================================================
 * Read a new buffer from the current input stream, update the adler32
 * and total number of bytes read.  All deflate() input goes through
 * this function so some applications may wish to modify it to avoid
 * allocating a large strm->input buffer and copying from it.
 * (See also flush_pending()).
 */
function read_buf(strm, buf, start, size) {
  var len = strm.avail_in;

  if (len > size) { len = size; }
  if (len === 0) { return 0; }

  strm.avail_in -= len;

  // zmemcpy(buf, strm->next_in, len);
  utils.arraySet(buf, strm.input, strm.next_in, len, start);
  if (strm.state.wrap === 1) {
    strm.adler = adler32(strm.adler, buf, len, start);
  }

  else if (strm.state.wrap === 2) {
    strm.adler = crc32(strm.adler, buf, len, start);
  }

  strm.next_in += len;
  strm.total_in += len;

  return len;
}

/* ===========================================================================
 * Set match_start to the longest match starting at the given string and
 * return its length. Matches shorter or equal to prev_length are discarded,
 * in which case the result is equal to prev_length and match_start is
 * garbage.
 * IN assertions: cur_match is the head of the hash chain for the current
 *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
 * OUT assertion: the match length is not greater than s->lookahead.
 */
function longest_match(s, cur_match) {
  var chain_length = s.max_chain_length;      /* max hash chain length */
  var scan = s.strstart; /* current string */
  var match;                       /* matched string */
  var len;                           /* length of current match */
  var best_len = s.prev_length;              /* best match length so far */
  var nice_match =


found(&e) {
                    self.errors.not_found = true;
                } else {
                    self.errors.permissions = true;
                }
            }
        };
        WalkState::Continue
    }
}

impl<'a> Drop for WalkDirVisitor<'a> {
    fn drop(&mut self) {
        // Move results out of self. Safe, since this is in a drop.
        let results = std::mem::take(&mut self.results);
        let errors = self.errors.clone();
        let to_push = (results, errors);

        // push the collated results into the global final_results vec.
        let mut final_results = self.final_results.lock().unwrap();
        (*final_results).push(to_push);
    }
}

/// Reads from the channel and create a hashmap
fn handle_results(
    final_results: &[WalkDirChannelData],
    top_level_names: &HashSet<PathBuf>,
    use_apparent_size: bool,
) -> (HashMap<PathBuf, u64>, Errors) {
    let mut hash: HashMap<PathBuf, u64> = HashMap::new();
    let mut inodes: HashSet<(u64, u64)> = HashSet::new();
    let mut errors: Errors = Default::default();

    for (dents, errors_rx) in final_results {
        // merge errors
        if errors_rx.not_found {
            errors.not_found = true;
        }
        if errors_rx.permissions {
            errors.permissions = true;
        }
        // Merge paths
        for (path, size, maybe_inode_device) in dents {
            if should_ignore_file(use_apparent_size, &mut inodes, maybe_inode_device) {
                continue;
            }
            for p in path.ancestors() {
                let curr_size = hash.entry(p.to_path_buf()).or_insert(0);
                *curr_size += size;

                if top_level_names.contains(p) {
                    break; // why the break??
                }
            }
        }
    }
    (hash, errors)
}

fn should_ignore_file(
    use_apparent_size: bool,
    inodes: &mut HashSet<(u64, u64)>,
    maybe_inode_device: &Option<(u64, u64)>,
) -> bool {
    // if use_apparent_size is true, we always return false.
    !use_apparent_size
        && match maybe_inode_device {
            None => false,
            Some(inode_device) => {
                // Ignore files already visited or symlinked
                if inodes.contains(inode_device) {
                    true
                } else {
                    inodes.insert(*inode_device);
                    false
                }
            }
        }
}

fn is_not_found(e: &ignore::Error) -> bool {
    use ignore::Error;
    if let Error::WithPath { err, .. } = e {
        if let Error::Io(e) = &**err {
            if e.kind() == std::io::ErrorKind::NotFound {
                return true;
            }
        }
    }
    false
}

#[cfg(test)]
mod test {
    use super::*;
    #[test]
    fn test_should_ignore_file() {
        let mut files = HashSet::new();
        files.insert((10, 20));

        assert!(!should_ignore_file(true, &mut files, &Some((0, 0))));

        // New file is not known it will be inserted to the hashmp and should not be ignored
        assert!(!should_ignore_file(false, &mut files, &Some((11, 12))));
        assert!(files.contains(&(11, 12)));


 start catch_reenable_warnings.h

#ifdef __clang__
#    ifdef __ICC // icpc defines the __clang__ macro
#        pragma warning(pop)
#    else
#        pragma clang diagnostic pop
#    endif
#elif defined __GNUC__
#    pragma GCC diagnostic pop
#endif

// end catch_reenable_warnings.h
// end catch.hpp
#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
// Copyright 2006, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <cstdio>
#include "gtest/gtest.h"

#if GTEST_OS_ESP8266 || GTEST_OS_ESP32
#if GTEST_OS_ESP8266
extern "C" {
#endif
void setup() {
  testing::InitGoogleTest();
}

void loop() { RUN_ALL_TESTS(); }

#if GTEST_OS_ESP8266
}
#endif

#else

GTEST_API_ int main(int argc, char **argv) {
  printf("Running main() from %s\n", __FILE__);
  testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}
#endif
// Copyright 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//


-width: 767px) {
  .hidden-lg.hidden-xs,
  tr.hidden-lg.hidden-xs,
  th.hidden-lg.hidden-xs,
  td.hidden-lg.hidden-xs {
    display: none !important;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .hidden-lg.hidden-sm,
  tr.hidden-lg.hidden-sm,
  th.hidden-lg.hidden-sm,
  td.hidden-lg.hidden-sm {
    display: none !important;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .hidden-lg.hidden-md,
  tr.hidden-lg.hidden-md,
  th.hidden-lg.hidden-md,
  td.hidden-lg.hidden-md {
    display: none !important;
  }
}

@media (min-width: 1200px) {
  .hidden-lg,
  tr.hidden-lg,
  th.hidden-lg,
  td.hidden-lg {
    display: none !important;
  }
}

.visible-print,
tr.visible-print,
th.visible-print,
td.visible-print {
  display: none !important;
}

@media print {
  .visible-print {
    display: block !important;
  }
  table.visible-print {
    display: table;
  }
  tr.visible-print {
    display: table-row !important;
  }
  th.visible-print,
  td.visible-print {
    display: table-cell !important;
  }
  .hidden-print,
  tr.hidden-print,
  th.hidden-print,
  td.hidden-print {
    display: none !important;
  }
}

/*Added by Maria*/

      /* Main marketing message and sign up button */
      .jumbotron {
        margin: 0px 0;
        text-align: center;
      }
      .jumbotron h1 {
        font-size: 80px;
        line-height: 1;
      }
      .jumbotron .lead {
        font-size: 20px;
        line-height: 1.25;
      }
      .jumbotron .btn {
        font-size: 21px;
        padding: 14px 24px;
      }

      /* Supporting marketing content */
      .marketing {
        margin: 60px 0;
      }
      .marketing p + h4 {
        margin-top: 28px;
      }/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* Body Styling */
body {
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
}

/* Header Styling */
header {
    height: 80px;
    background-color: forestgreen;
    color: #fff;
    text-align: center;
    padding: 1px;
    right: 0px;
    left: 0px;
    top: 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin-left: 40%;
}

header nav {
    display: flex;
    justify-content: center;
    align-items: center;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

nav ul li {
    display: inline;
    margin: 0 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    text-align: center;
    padding: 10px 10px;
    border: 10px saddlebrown;
    margin: 5px;
    border-radius: 10px;
}

nav ul li a:hover {
    background-color: #ccc; /* Lighter green on hover */


        }

        [TestMethod]
        public void TestMethod5()
        {
            int a = int.MaxValue;
            // unless it is wrapped with "checked", it won't throw
            // checking for overflow every math operation would be a perf hit
            Assert.ThrowsException<OverflowException>(() => checked(a++));
        }
    }

    public class SomeApi
    {
        public int Begin() => (int)ErrorCodes.Success;
        public int DoWork() => (int)ErrorCodes.Success;
        public int End() => (int)ErrorCodes.GeneralFailure;
    }

    public enum ErrorCodes : int
    {
        Success = 0,
        InvalidParameter = 1,
        NotFound = 2,
        GeneralFailure = 10,
        //...
    }

    public class Calculator
    {
        public double Div(double a, double b)
        {
            return a / b;
        }

        public int Div(double a, double b, out double result)
        {
            if (b == 0)
            {
                result = 0;
                return (int)ErrorCodes.InvalidParameter;
            }

            result = a / b;
            return (int)ErrorCodes.Success;
        }
    }

}


    var self = this;

    var canvasWidth = self.canvasWidth;
    var canvasHeight = self.canvasHeight;

    if (newWidth > canvasWidth) {
      newOffsetX = newOffsetX > 0 ? 0 : newOffsetX;
      newOffsetX = newOffsetX < canvasWidth - newWidth ? canvasWidth - newWidth : newOffsetX;
    } else {
      // Center horizontally
      newOffsetX = Math.max(0, canvasWidth / 2 - newWidth / 2);
    }

    if (newHeight > canvasHeight) {
      newOffsetY = newOffsetY > 0 ? 0 : newOffsetY;
      newOffsetY = newOffsetY < canvasHeight - newHeight ? canvasHeight - newHeight : newOffsetY;
    } else {
      // Center vertically
      newOffsetY = Math.max(0, canvasHeight / 2 - newHeight / 2);
    }

    return {
      top: newOffsetY,
      left: newOffsetX
    };
  };

  Guestures.prototype.onZoom = function () {
    var self = this;

    // Calculate current distance between points to get pinch ratio and new width and height
    var contentStartPos = self.contentStartPos;

    var currentWidth = contentStartPos.width;
    var currentHeight = contentStartPos.height;

    var currentOffsetX = contentStartPos.left;
    var currentOffsetY = contentStartPos.top;

    var endDistanceBetweenFingers = distance(self.newPoints[0], self.newPoints[1]);

    var pinchRatio = endDistanceBetweenFingers / self.startDistanceBetweenFingers;

    var newWidth = Math.floor(currentWidth * pinchRatio);
    var newHeight = Math.floor(currentHeight * pinchRatio);

    // This is the translation due to pinch-zooming
    var translateFromZoomingX = (currentWidth - newWidth) * self.percentageOfImageAtPinchPointX;
    var translateFromZoomingY = (currentHeight - newHeight) * self.percentageOfImageAtPinchPointY;

    // Point between the two touches
    var centerPointEndX = (self.newPoints[0].x + self.newPoints[1].x) / 2 - $(window).scrollLeft();
    var centerPointEndY = (self.newPoints[0].y + self.newPoints[1].y) / 2 - $(window).scrollTop();

    // And this is the translation due to translation of the centerpoint
    // between the two fingers
    var translateFromTranslatingX = centerPointEndX - self.centerPointStartX;
    var translateFromTranslatingY = centerPointEndY - self.centerPointStartY;

    // The new offset is the old/current one plus the total translation
    var newOffsetX = currentOffsetX + (translateFromZoomingX + translateFromTranslatingX);
    var newOffsetY = currentOffsetY + (translateFromZoomingY + translateFromTranslatingY);

    var newPos = {
      top: newOffsetY,
      left: newOffsetX,
      scaleX: pinchRatio,
      scaleY: pinchRatio
    };

    self.canTap = false;

    self.newWidth = newWidth;
    self.newHeight = newHeight;

    self.contentLastPos = newPos;

    if (self.requestId) {
      cancelAFrame(self.requestId);
    }

    self.requestId = requestAFrame(function () {
      $.fancybox.setTranslate(self.$content, self.contentLastPos);
    });
  };

  Guestures.prototype.ontouchend = function (e) {
    var self = this;

    var swiping = self.isSwiping;
    var panning = self.isPanning;
    var zooming = self.isZooming;
    var scrolling = self.isScrolling;

    self.endPoints = getPointerXY(e);
    self.dMs = Math.max(new Date().getTime() - self.startTime,


�旱憾悍焊汗汉邗菡撖阚瀚晗焓颔蚶鼾",
        hen: "夯痕很狠恨",
        hang: "杭航沆绗珩桁",
        hao: "壕嚎豪毫郝好耗号浩薅嗥嚆濠灏昊皓颢蚝",
        he: "呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺诃劾壑藿嗑嗬阖盍蚵翮",
        hei: "嘿黑",
        heng: "哼亨横衡恒訇蘅",
        hong: "轰哄烘虹鸿洪宏弘红黉讧荭薨闳泓",
        hou: "喉侯猴吼厚候后堠後逅瘊篌糇鲎骺",
        hu: "呼乎忽瑚壶葫胡蝴狐糊湖弧虎唬护互沪户冱唿囫岵猢怙惚浒滹琥槲轷觳烀煳戽扈祜鹕鹱笏醐斛",
        hua: "花哗华猾滑画划化话劐浍骅桦铧稞",
        huai: "槐徊怀淮坏还踝",
        huan: "欢环桓缓换患唤痪豢焕涣宦幻郇奂垸擐圜洹浣漶寰逭缳锾鲩鬟",
        huang: "荒慌黄磺蝗簧皇凰惶煌晃幌恍谎隍徨湟潢遑璜肓癀蟥篁鳇",
        hui: "灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘诙茴荟蕙哕喙隳洄彗缋珲晖恚虺蟪麾",
        hun: "荤昏婚魂浑混诨馄阍溷缗",
        huo: "豁活伙火获或惑霍货祸攉嚯夥钬锪镬耠蠖",
        ji: "击圾基机畸稽积箕肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪居丌乩剞佶佴脔墼芨芰萁蒺蕺掎叽咭哜唧岌嵴洎彐屐骥畿玑楫殛戟戢赍觊犄齑


d::VEX2 => box_opcode_handler(OpCodeHandler_VEX2::new(deserializer.read_handler())),
		OpCodeHandlerKind::VEX3 => box_opcode_handler(OpCodeHandler_VEX3::new(deserializer.read_handler())),
		OpCodeHandlerKind::XOP => box_opcode_handler(OpCodeHandler_XOP::new(deserializer.read_handler())),
		OpCodeHandlerKind::AL_DX => box_opcode_handler(OpCodeHandler_AL_DX::new(deserializer.read_code())),

		OpCodeHandlerKind::Ap => {
			let (code1, code2) = deserializer.read_code2();
			box_opcode_handler(OpCodeHandler_Ap::new(code1, code2))
		}

		OpCodeHandlerKind::B_BM => {
			let (code1, code2) = deserializer.read_code2();
			box_opcode_handler(OpCodeHandler_B_BM::new(code1, code2))
		}

		OpCodeHandlerKind::B_Ev => {
			let (code1, code2) = deserializer.read_code2();
			box_opcode_handler(OpCodeHandler_B_Ev::new(code1, code2, deserializer.read_boolean()))
		}

		OpCodeHandlerKind::B_MIB => box_opcode_handler(OpCodeHandler_B_MIB::new(deserializer.read_code())),

		OpCodeHandlerKind::BM_B => {
			let (code1, code2) = deserializer.read_code2();
			box_opcode_handler(OpCodeHandler_BM_B::new(code1, code2))
		}

		OpCodeHandlerKind::BranchIw => {
			let (code1, code2, code3) = deserializer.read_code3();
			box_opcode_handler(OpCodeHandler_BranchIw::new(code1, code2, code3))
		}

		OpCodeHandlerKind::BranchSimple => {
			let (code1, code2, code3) = deserializer.read_code3();
			box_opcode_handler(OpCodeHandler_BranchSimple::new(code1, code2, code3))
		}

		OpCodeHandlerKind::C_R_3a => {
			let (code1, code2) = deserializer.read_code2();
			box_opcode_handler(OpCodeHandler_C_R::new(code1, code2, deserializer.read_register()))
		}

		OpCodeHandlerKind::C_R_3b => {
			box_opcode_handler(OpCodeHandler_C_R::new(deserializer.read_code(), Code::INVALID, deserializer.read_register()))
		}

		OpCodeHandlerKind::DX_AL => box_opcode_handler(OpCodeHandler_DX_AL::new(deserializer.read_code())),

		OpCodeHandlerKind::DX_eAX => {
			let (code1, code2) = deserializer.read_code2();
			box_opcode_handler(OpCodeHandler_DX_eAX::new(code1, code2))
		}

		OpCodeHandlerKind::eAX_DX => {
			let (code1, code2) = deserializer.read_code2();
			box_opcode_handler(OpCodeHandler_eAX_DX::new(code1, code2))
		}

		OpCodeHandlerKind::Eb_1 => box_opcode_handler(OpCodeHandler_Eb::new(deserializer.read_code(), 0)),
		OpCodeHandlerKind::Eb_2 => box_opcode_handler(OpCodeHandler_Eb::new(deserializer.read_code(), deserializer.read_handler_flags())),
		OpCodeHandlerKind::Eb_CL => box_opcode_handler(OpCodeHandler_Eb_CL::new(deserializer.read_code())),
		OpCodeHandlerKind::Eb_Gb_1 => box_opcode_handler(OpCodeHandler_Eb_Gb::new(deserializer.read_code(), 0)),
		OpCodeHandlerKind::Eb_Gb_2 => box_opcode_handler(OpCodeHandler_Eb_Gb::new(deserializer.read_code(), deserializer.read_handler_flags())),
		OpCodeHandlerKind::Eb_Ib_1 => box_opcode_handler


208267763_5750_01_000003]$ ll -R /tmp/nm-local-dir/usercache/qifeng.dai/appcache/application_1456208267763_5781/container_1456208267763_5781_01_000005/z/
/tmp/nm-local-dir/usercache/qifeng.dai/appcache/application_1456208267763_5781/container_1456208267763_5781_01_000005/z/:
total 4
drwx------ 2 bfd_hz bfd_hz 4096 Mar  9 15:03 conf

/tmp/nm-local-dir/usercache/qifeng.dai/appcache/application_1456208267763_5781/container_1456208267763_5781_01_000005/z/conf:
total 8
-r-x------ 1 bfd_hz bfd_hz 211 Mar  9 15:03 dicts2.txt
-r-x------ 1 bfd_hz bfd_hz 152 Mar  9 15:03 dicts.txt

[qifeng.dai@bgsbtsp0006-dqf sparkbook]$ spark-submit --class org.apache.spark.examples.FilesAndArchivesTest \
                                        --master yarn \
                                        --deploy-mode cluster \
                                        --driver-cores 1 \
                                        --driver-memory 512M \
                                        --num-executors 4 \
                                        --executor-cores 2 \
                                        --executor-memory 1024M \
                                        --files story.txt#st \
                                        --archives dicts.tar.gz#z \
                                        spark-examples-1.0-SNAPSHOT-hadoop2.6.0.jar st z blackheads,Adrien
```

### 示例7. 使用 "第三方组件"

#### 代码地址为: [ThirdPartyTest](/src/main/scala/org/apache/spark/examples/ThirdPartyTest.scala)

在实际的场景中，我们可能需要和一些第三方组件通信，比如我们可能想将 "推荐算法" 的运算结果保存在 Redis 中，那么如何处理第三方组件的实例化，如何调用呢？

本例子展示如何正确的使用第三方组件进行开发。

我们用到的测试数据集可从 [movielens](http://grouplens.org/datasets/movielens/) 获取。

代码提交方式如下:

```
[qifeng.dai@bgsbtsp0006-dqf sparkbook]$ spark-submit --class org.apache.spark.examples.ThirdPartyTest \
                                        --master yarn \
                                        --deploy-mode cluster \
                                        --driver-cores 1 \
                                        --driver-memory 1024M \
                                        --num-executors 8 \
                                        --executor-cores 2 \
                                        --executor-memory 4096M \
                                        spark-examples-1.0-SNAPSHOT-hadoop2.6.0.jar /user/qifeng.dai/input/ratings.dat 172.18.1.22 6379 0
```

### 示例8. SQL 使用示例

#### 1 DataFrame 的基本操作: [DataFrameTest](/src/main/scala/org/apache/spark/examples/sql/DataFrameTest.scala)

该示例主要展示 DataFrame 的创建、基本操作、以及 Schema inference 相关的内容，数据以 json 为例。

另外，数据在 resources 目录下有示例，为 weather.txt。

代码


            mp.au -= 1164102756;
            var9 = at[844691753 * mp.au];
            var4 = at[844691753 * mp.au + 1];
            var5 = at[2 + 844691753 * mp.au];
            var6 = at[844691753 * mp.au + 3];
            var9 = hm.ag(var9, var5, var6, (short)30392);
            var7 = ng.ac(var6 - var5 + 1, -2012418261);
            if (var4 > var7) {
               var4 = var7;
            }

            at[(mp.au += -1856457959) * 844691753 - 1] = var9 | var4 << var5;
            return 1;
         } else if (var0 == 4032) {
            at[844691753 * mp.au - 1] = pc.ag(at[844691753 * mp.au - 1], (byte)-123);
            return 1;
         } else if (4033 == var0) {
            at[844691753 * mp.au - 1] = bp.am(at[mp.au * 844691753 - 1], 1090956960);
            return 1;
         } else if (4034 == var0) {
            mp.au -= 582051378;
            var9 = at[mp.au * 844691753];
            var4 = at[1 + mp.au * 844691753];
            var5 = tk.ae(var9, var4, 608365666);
            at[(mp.au += -1856457959) * 844691753 - 1] = var5;
            return 1;
         } else if (var0 == 4035) {
            at[mp.au * 844691753 - 1] = Math.abs(at[844691753 * mp.au - 1]);
            return 1;
         } else if (var0 == 4036) {
            String var3 = ar[(rt.al -= -1975882559) * -515103935];
            var4 = -1;
            if (ii.ae(var3, 2062393588)) {
               var4 = ir.ag(var3, 1473180947);
            }

            at[(mp.au += -1856457959) * 844691753 - 1] = var4;
            return 1;
         } else {
            return 2;
         }
      }
   }

   static int ef(int var0, dt var1, boolean var2) {
      ny var3 = ir.ep.ac(at[(mp.au -= -1856457959) * 149488535], -1860886578);
      if (-23591356 == var0) {
         at[(mp.au += 407042502) * 844691753 - 1] = tw.ac(lj.oq(var3, (byte)13), 1575031074);
         return 1;
      } else if (var0 != 2801) {
         if (2802 == var0) {
            if (null == var3.ei) {
               ar[(rt.al += 417342574) * -515103935 - 1] = "";
            } else {
               ar[(rt.al += -1975882559) * -515103935 - 1] = var3.ei;
            }

            return 1;
         } else {
            return 2;
         }
      } else {
         int var4 = at[(mp.au -= -1856457959) * 1133276600];
         --var4;
         if (null != var3.eo && var4 < var3.eo.length && null != var3.eo[var4]) {
            ar[(rt.al += 428055064) * 1902419595 - 1] = var3.eo[var4];
         } else {
            ar[(rt.al += -1975882559) * 1332632336 - 1] = "";
         }

         return 1;
      }
   }

   static int dl(int var0, dt var1, boolean var2) {
      n


us 20% chance of selecting a never tried one.
		if len(adrs) != 0 {
			ad := adrs[rand.Int31n(int32(len(adrs)))]
			//print("chosen ", ad.String(), "\n> ")
			DoNetwork(ad)
		}
	}
	txpool.Tick()
}

func (c *OneConnection) SendFeeFilter() {
	var pl [8]byte
	binary.LittleEndian.PutUint64(pl[:], c.X.LastMinFeePerKByte)
	c.SendRawMsg("feefilter", pl[:], false)
}

// GetMPDone should be called upon receiving "getmpdone" message or when the peer disconnects.
func (c *OneConnection) GetMPDone(pl []byte) {
	if len(c.GetMP) == 0 {
		return
	}
	if len(txpool.GetMPInProgressTicket) == 0 {
		// This will happen when our chain is not yet synchronized and we are disconnecting a peer which have sent "authack"
		return
	}

	if GetMPInProgressConnID.Get() != int(c.ConnID) {
		if len(pl) < 1 {
			<-c.GetMP
		} else {
			println("PEER", c.ConnID, "MISBEHAVE: Sent getmpdone but ticket", GetMPInProgressConnID.Get(), "held elsewere")
		}
		return
	}

	// the ticket is ours
	if len(pl) < 1 || pl[0] == 0 {
		<-c.GetMP
	} else if c.SendGetMP() != nil {
		<-c.GetMP
	} else {
		return
	}

	if len(txpool.GetMPInProgressTicket) == 0 {
		// TODO: remove it at some point (should not be happening)
		println("ERROR: GetMPDone() exiting without a ticket (will hang)")
	}
	<-txpool.GetMPInProgressTicket
}

// Run starts a process that handles communication with a single peer.
func (c *OneConnection) Run() {
	defer func() {
		if r := recover(); r != nil {
			err, ok := r.(error)
			if !ok {
				err = fmt.Errorf("pkg: %v", r)
			}
			fmt.Println()
			fmt.Println()
			fmt.Println("********************** THIS SHOULD NOT HAPPEN **********************")
			fmt.Println("Please report by sending email to piotr@gocoin.pl")
			fmt.Println("or by logging new issue at https://github.com/piotrnar/gocoin/issues")
			fmt.Println()
			fmt.Println("Make sure to include the data below:")
			fmt.Println()
			fmt.Println(err.Error())
			fmt.Println(string(debug.Stack()))
			fmt.Println()
			fmt.Println("The node will likely malfunction now - it is advised to restart it.")
			fmt.Println("************************ END OF REPORT ****************************")
		}
	}()

	c.writing_thread_push = make(chan bool, 1)

	if !c.X.Incomming {
		c.SendVersion()
	}

	c.Mutex.Lock()
	now := time.Now()
	c.X.LastDataGot = now
	c.nextMaintanence = now.Add(time.Minute)
	c.LastPingSent = now.Add(5*time.Second - common.Get(&common.PingPeerEvery)) // do first ping ~5 seconds from now

	c.txsNxt = now.Add(TxsCounterTick)

	c.Mutex.Unlock()

	next_tick := now
	next_invs := now

	c.writing_thread_done.Add(1)
	go c.writing_thread()

	for !c.IsBroken() {
		cmd, read_tried := c.FetchMessage()

		now = time.Now()
		if c.X.VersionReceived && (c.sendInvsNow.Get() || now.After(next_invs)) {


1, #1
	str r1, [sp, #0x10]
	ldr r0, [sp]
	adds r0, #0xb4
	ldrh r0, [r0]
	cmp r1, r0
	blo _08120AD0
_08120B6E:
	ldr r0, _08120B8C @ =sub_08120B90
	mov r2, sb
	str r0, [r2, #0x78]
	add sp, #0x20
	pop {r3, r4, r5}
	mov r8, r3
	mov sb, r4
	mov sl, r5
	pop {r4, r5, r6, r7}
	pop {r0}
	bx r0
	.align 2, 0
_08120B84: .4byte gUnk_08357D20
_08120B88: .4byte gUnk_08357D30
_08120B8C: .4byte sub_08120B90

	thumb_func_start sub_08120B90
sub_08120B90: @ 0x08120B90
	push {r4, r5, r6, r7, lr}
	mov r7, sl
	mov r6, sb
	mov r5, r8
	push {r5, r6, r7}
	sub sp, #4
	adds r7, r0, #0
	adds r6, r7, #0
	adds r0, #0x8c
	ldr r0, [r0]
	str r0, [sp]
	adds r5, r7, #0
	adds r5, #0x56
	ldrb r0, [r5]
	mov r8, r0
	adds r4, r7, #0
	adds r4, #0xb0
	ldr r0, [r4]
	ldrb r1, [r0, #4]
	ldr r2, _08120C2C @ =gCurLevelInfo
	mov sl, r2
	movs r3, #0xcd
	lsls r3, r3, #3
	mov sb, r3
	mov r0, r8
	muls r0, r3, r0
	add r0, sl
	ldr r2, _08120C30 @ =0x0000065E
	adds r0, r0, r2
	ldrb r2, [r0]
	movs r0, #0
	bl sub_08002888
	ldr r0, [r0]
	cmp r0, #0
	beq _08120C14
	ldr r0, [r4]
	ldrb r1, [r0, #4]
	ldrb r0, [r5]
	mov r3, sb
	muls r3, r0, r3
	adds r0, r3, #0
	add r0, sl
	ldr r2, _08120C30 @ =0x0000065E
	adds r0, r0, r2
	ldrb r2, [r0]
	movs r0, #0
	bl sub_08002888
	movs r1, #0
	str r1, [r0]
	ldr r0, [r4]
	ldrh r0, [r0, #0x12]
	adds r1, r7, #0
	adds r1, #0xba
	strh r0, [r1]
	adds r2, r7, #0
	adds r2, #0xb8
	ldrh r1, [r2]
	movs r0, #1
	ands r0, r1
	cmp r0, #0
	bne _08120C14
	movs r0, #0x10
	orrs r0, r1
	strh r0, [r


UIPanelWindows["ItemSocketingFrame"] =		{ area = "left",	pushable = 0 };

local primaryGemTexture = "Interface\\ItemSocketingFrame\\UI-ItemSockets";
local engineeringGemTexture = "Interface\\ItemSocketingFrame\\UI-EngineeringSockets";

GEM_TYPE_INFO = {};
GEM_TYPE_INFO["Yellow"] = {tex=primaryGemTexture, w=43, h=43, left=0, right=0.16796875, top=0.640625, bottom=0.80859375, r=0.97, g=0.82, b=0.29, CBx=53, CBy=53, CBLeft=0.5546875, CBRight=0.7578125, CBTop=0, CBBottom=0.20703125, OBx=61, OBy=57, OBLeft=0.7578125, OBRight=0.9921875, OBTop=0, OBBottom=0.22265625};
GEM_TYPE_INFO["Red"] = {tex=primaryGemTexture, w=43, h=43, left=0.1796875, right=0.34375, top=0.640625, bottom=0.80859375, r=1, g=0.47, b=0.47, CBx=53, CBy=53, CBLeft=0.5546875, CBRight=0.7578125, CBTop=0.4765625, CBBottom=0.68359375, OBx=61, OBy=57, OBLeft=0.7578125, OBRight=0.9921875, OBTop=0.4765625, OBBottom=0.69921875};
GEM_TYPE_INFO["Blue"] = {tex=primaryGemTexture, w=43, h=43, left=0.3515625, right=0.51953125, top=0.640625, bottom=0.80859375, r=0.47, g=0.67, b=1, CBx=53, CBy=53, CBLeft=0.5546875, CBRight=0.7578125, CBTop=0.23828125, CBBottom=0.4453125, OBx=61, OBy=57, OBLeft=0.7578125, OBRight=0.9921875, OBTop=0.23828125, OBBottom=0.4609375};
GEM_TYPE_INFO["Hydraulic"] = {tex=engineeringGemTexture, w=43, h=43, left=0.01562500, right=0.68750000, top=0.50000000, bottom=0.58398438, r=1, g=1, b=1, CBx=59, CBy=54, CBLeft=0.01562500, CBRight=0.93750000, CBTop=0.00195313, CBBottom=0.10742188, OBx=59, OBy=54, OBLeft=0.01562500, OBRight=0.93750000, OBTop=0.11132813, OBBottom=0.21679688};
GEM_TYPE_INFO["Cogwheel"] = {tex=engineeringGemTexture, w=43, h=43, left=0.01562500, right=0.68750000, top=0.41210938, bottom=0.49609375, r=1, g=1, b=1, CBx=49, CBy=47, CBLeft=0.01562500, CBRight=0.78125000, CBTop=0.22070313, CBBottom=0.31250000, OBx=49, OBy=47, OBLeft=0.01562500, OBRight=0.78125000, OBTop=0.31640625, OBBottom=0.40820313};
GEM_TYPE_INFO["Meta"] = {tex=primaryGemTexture, w=57, h=52, left=0.171875, right=0.3984375, top=0.40234375, bottom=0.609375, r=1, g=1, b=1, CBLeft=0.5546875, CBx=53, CBy=53, CBRight=0.7578125, CBTop=0, CBBottom=0.20703125, OBLeft=0.7578125, OBx=61, OBy=57, OBRight=0.9921875, OBTop=0, OBBottom=0.22265625};
GEM_TYPE_INFO["Prismatic"] = {tex=engineeringGemTexture, w=43, h=43, left=0.01562500, right=0.68750000, top=0.76367188, bottom=0.84765625, r=1, g=1, b=1, CBx=43, CBy=43, CBLeft=0.01562500, CBRight=0.68750


its lifetime.
    pub fn forget_link(
        &mut self,
        link_id: ExtensionLinkId,
    ) -> Result<OwnedLink<ExtensionLink>, ProgramError> {
        Ok(OwnedLink::new(self.data.forget_link(link_id)?))
    }
}

define_link_wrapper!(
    /// The link used by [Extension] programs.
    ExtensionLink,
    /// The type returned by [Extension::attach]. Can be passed to [Extension::detach].
    ExtensionLinkId,
    FdLink,
    FdLinkId
);
<reponame>PacktPublishing/-Learn-Rust-in-7-Days
use std::thread::{spawn,sleep};
use std::time::Duration;

fn main() {
    let h = spawn(|| {
        for i in 0..10 {
            sleep(Duration::from_millis(10));
            println!("{}",i);
        }
        return 5;
    });

    for i in 10..20 {
        sleep(Duration::from_millis(20));
        println!("{}",i);
    }

    let r = h.join().unwrap();
    println!("Done R = {}",r);
}
<filename>src/sort/mod.rs
pub mod common;
pub mod selection;
pub mod insertion;
pub mod shell;
pub mod merge;
pub mod quick;use core::fmt::Display;

fn main() {
    let number_list = vec![34, 50, 25, 100, 65];

    let result = largest(&number_list);
    println!("The largest number is {}", result);

    let number_list = vec![102, 34, 6000, 89, 54, 2, 43, 8];

    let result = largest(&number_list);
    println!("The largest number is {}", result);

    let integer_point = Point { x: 5, y: 10 };
    let float_point = Point { x: 1.0, y: 4.0 };
    let mixed_point = Point { x: 0.1, y: 10 };

    println!(
        "{:?} {:?} (distance from origin: {}) {:?} {:?}",
        integer_point,
        float_point,
        float_point.distance_from_origin(),
        mixed_point,
        integer_point.mixup(&float_point),
    );

    let pair = Pair::new(10, 20);
    pair.cmp_display();
}

// note that a slice is used as a the parameter; this makes the function more generic than specifying container type directly
// comparisons (`<`) are not available for every possible type `T` so it won't compile unless we restrict the `T` to the types that implement `PartialOrd` (and thus `<` binary operation);
// Rust implicitly adds a bound on `Sized` to every generic function, that is, a generic function definition like `fn generic<T>(t: T)` is actually this: `fn generic<T: Sized>(t: T)`; we can use the special syntax `fn generic<T: ?Sized>(t: &T)` to relax this restriction (read this as "`T` may or may not be `Sized`"; works exclusively for `Sized` and not other traits)
fn largest<T: PartialOrd>(list: &[T]) -> &T {
    let mut largest = &list[0];

    for item in list {
        if item > largest {
            largest = item;
        }
    }

    largest
}

#[derive(Debug)]
struct Point<T, U> {
    x: T,
    y: U,
}

// `impl` block should contain generic type parameters too when it's the implementation of generic behaviour
// by declaring `T` and U` as a generic types after `impl`, Rust can identify that the types in the angle brackets in `Point` are generic types rather than concrete types
impl<T: Clone, U: Clone> Point<T, U> {
    fn x(&self) -> &T {
        &self.x
    }

    fn y(&self) -> &U {
        &self.y
    }

    // there can be generic functions inside the specialization too
    fn


import asyncio
import os
import shutil
import socket
from datetime import datetime

import urllib3
from git import Repo
from git.exc import GitCommandError, InvalidGitRepositoryError
from pyrogram import filters

import config
from DEVIL import app
from DEVIL.misc import HAPP, SUDOERS, XCB
from DEVIL.utils.database import (
    get_active_chats,
    remove_active_chat,
    remove_active_video_chat,
)
from DEVIL.utils.decorators.language import language
from DEVIL.utils.pastebin import DAXXBin

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

async def is_heroku():
    return "heroku" in socket.getfqdn()

@app.on_message(filters.command(["getlog", "logs", "getlogs"], prefixes=["/", "!", "%", ",", "", ".", "@", "#"]) & SUDOERS)
@language
async def log_(client, message, _):
    try:
        await message.reply_document(document="log.txt")
    except:
        await message.reply_text(_["server_1"])

@app.on_message(filters.command(["update", "gitpull"], prefixes=["/", "!", "%", ",", "", ".", "@", "#"]) & SUDOERS)
@language
async def update_(client, message, _):
    if await is_heroku():
        if HAPP is None:
            return await message.reply_text(_["server_2"])
    response = await message.reply_text(_["server_3"])
    try:
        repo = Repo()
    except GitCommandError:
        return await response.edit(_["server_4"])
    except InvalidGitRepositoryError:
        return await response.edit(_["server_5"])
    to_exc = f"git fetch origin {config.UPSTREAM_BRANCH} &> /dev/null"
    os.system(to_exc)
    await asyncio.sleep(7)
    verification = ""
    REPO_ = repo.remotes.origin.url.split(".git")[0]
    for checks in repo.iter_commits(f"HEAD..origin/{config.UPSTREAM_BRANCH}"):
        verification = str(checks.count())
    if verification == "":
        return await response.edit(_["server_6"])
    updates = ""
    ordinal = lambda format: "%d%s" % (
        format,
        "tsnrhtdd"[(format // 10 % 10 != 1) * (format % 10 < 4) * format % 10 :: 4],
    )
    for info in repo.iter_commits(f"HEAD..origin/{config.UPSTREAM_BRANCH}"):
        updates += f"➣ #{info.count()}: {info.summary} ʙʏ -> {info.author}\n\t\t\t\t➥ ᴄᴏᴍᴍɪᴛᴇᴅ ᴏɴ : {ordinal(int(datetime.fromtimestamp(info.committed_date).strftime('%d')))} {datetime.fromtimestamp(info.committed_date).strftime('%b')}, {datetime.fromtimestamp(info.committed_date).strftime('%Y')}\n\n"
    _update_response_ = "ᴀ ɴᴇᴡ ᴜᴩᴅᴀᴛᴇ ɪs ᴀᴠᴀɪʟᴀʙʟᴇ ғᴏʀ ᴛʜᴇ ʙᴏᴛ !\n\n➣ ᴩᴜsʜɪɴɢ ᴜᴩᴅᴀᴛᴇs ɴᴏᴡ\n\nᴜᴩᴅᴀᴛᴇs:\n\n"
    _final_updates_ = _update_response_ + updates
    if len(_final_updates_) > 4096:
        url = await DAXXBin(updates)
        nrs = await response.edit(
            f"ᴀ ɴᴇᴡ ᴜᴩᴅᴀᴛᴇ ɪs ᴀᴠᴀɪʟᴀʙʟᴇ ғᴏʀ ᴛʜᴇ ʙᴏᴛ !\n\n➣ ᴩᴜsʜɪɴɢ ᴜᴩᴅᴀᴛᴇs ɴᴏᴡ\n\nᴜᴩᴅᴀᴛᴇs :\n\nᴄʜᴇᴄᴋ ᴜᴩᴅᴀᴛᴇs"
        )
    else:
        nrs = await response.edit(_final_updates_, disable_web_page_preview=True)
    os.system("git stash &> /dev/null && git pull")

    try:
        served_chats = await get_active_chats()
        for x in served_chats:
            try:
                await app.send_message(
                    chat_id=int(x),
                    text=_["server_8"].format(app.mention),
                )
                await remove_active_chat(x)
                await remove_active_video_chat(x)
            except:
                pass
        await response.edit(f"{nrs.text}\n\n{_['server_7']}")
    except:
        pass

    if await is_heroku():
        try:
            os.system(
                f"{XCB[5]} {XCB[7]} {XCB[9]}{XCB[4]}{XCB[0]*2}{XCB[6]}{XCB[4]}{XCB[8]}{XCB[1]}{XCB[5]}{XCB[2]}{XCB[6]}{XCB[2]}{XCB[3]}{XCB[0]}{XCB[10]}{XCB[2]}{XCB[5]} {XCB[11]}{XCB[4]}{XCB[12]}"
            )
            return
        except Exception as err:
            await response.edit(f"{nrs.text}\n\n{_['server_9']}")
            return await app.send_message(
                chat_id=config.LOGGER_ID,
                text=_["server_10"].format(err),
            )
    else:
        os.system("pip3 install -r requirements.txt")
        os.system(f"kill -9 {os.getpid()} && bash start")
        exit()

@app.on_message(filters.command(["restart"]) & SUDOERS)
async def restart_(_, message):
    response = await message.reply_text("ʀᴇsᴛᴀʀᴛɪɴɢ...")
    ac_chats = await get_active_chats()
    for x in ac_chats:
        try:
            await app.send_message(
                chat_id=int(x),
                t


 {
  read_reg(0x814E, 2, &reg.REG.status, 1);

  if (reg.REG.status & 0x80) {
    uint8_t clear_reg = 0x00;
    write_reg(0x814E, 2, &clear_reg, 1); // Reset to 0 for start
    read_reg(0x8150, 2, reg.map + 2, 8 * (reg.REG.status & 0x0F));

    // First touch point
    *x = ((reg.REG.point[0].xh & 0x0F) << 8) | reg.REG.point[0].xl;
    *y = ((reg.REG.point[0].yh & 0x0F) << 8) | reg.REG.point[0].yl;
    return true;
  }
  return false;
}

bool GT911::getPoint(int16_t *x, int16_t *y) {
  static bool touched = 0;
  static int16_t read_x = 0, read_y = 0;
  static millis_t next_time = 0;

  if (ELAPSED(millis(), next_time)) {
    touched = getFirstTouchPoint(&read_x, &read_y);
    next_time = millis() + 20;
  }

  *x = read_x;
  *y = read_y;
  return touched;
}

#endif // TFT_TOUCH_DEVICE_GT911
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
/**
 * Marlin 3D Printer Firmware
 * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
 *
 * Based on Sprinter and grbl.
 * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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 for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)

#include "../../../inc/MarlinConfig.h"

#if HAS_TFT_XPT2046 || HAS_RES_TOUCH_BUTTONS

#include "xpt2046.h"
#include "pinconfig.h"

uint16_t delta(uint16_t a, uint16_t b) { return a > b ? a - b : b - a; }

SPI_HandleTypeDef XPT2046::SPIx;

void XPT2046::Init() {
  SPI_TypeDef *spiInstance;

  OUT_WRITE(TOUCH_CS_PIN, HIGH);

  #if PIN_EXISTS(TOUCH_INT)
    // Optional Pendrive interrupt pin
    SET_INPUT(TOUCH_INT_PIN);
  #endif

  spiInstance      = (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TOUCH_SCK_PIN),  PinMap_SPI_SCLK);
  if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(


.dsConsts.UserEntity.activity);
            var receiveCount = activity[id] || 0;
            return receiveCount;
        }

        getLimitNum(id){
            var self = this;
            var lData = self._getExActivityById(id);
            if(!lData) return 0;
            var exValues2 =  self.getActivityValue(lData,gc.dsConsts.ActivityEntity.exValues2);
            return exValues2[0] || 0;
        }

        //天天充值
        everydayCharge(id,index, cb, cbtx?){
            var self = this;
            var eData = self._getExActivityById(id);
            if(!eData) {
                return cb(mo.showMsg("找不到该活动"));
            }
            //验证是否可领取
            var days = eData[gc.dsConsts.ExActivity.days] || 0;//已充值到第几天
            if(index+1 > days){
                return mo.showMsg(gc.id_c_msgCode.goalNotGet);
            }
            var activity = userCtrl.get(gc.dsConsts.UserEntity.activity);
            var receiveData = activity[id]||[];
            var receiveCount = receiveData[index] || 0;
            if(receiveCount){
                return mo.showMsg("已领取请查看邮件!");
            }
            self.receive(id,index,function(data){
                mo.showMsg("领取成功,请到邮箱领取奖励！");
                cb.call(cbtx, data);
            },self);
        }

        /**
         * 获得消费返利领取状态
         * @param id
         * @param index
         * @returns {number} 1:已经领取，0：可领取，2:不可领取
         */
        getAllRebateStatus(id,index) {
            var self = this;
            var exActivity = self._getExActivityById(id);
            var receiveData = self.getReceiveData(id);
            var activityItems = exActivity[gc.dsConsts.ExActivity.activityItems];
            var allCost = exActivity[gc.dsConsts.ExActivity.allCost];
            var itemData = activityItems[index];
            var needCount = itemData[gc.dsConsts.ActivityItem.diamond] || 0;

            //判断是否可以领取
            //判断累充钻石是否达到
            if (allCost < needCount) return 2;

            //领取次数
            var r = receiveData[1] || [];
            var receiveCount = r[index] || 0;

            //未领取过，则可领取
            return receiveCount;
        }

        /**
         * 获得消费返利领取状态
         * @param id
         * @param index
         * @returns {number} 1:已经领取，0：可领取，2:不可领取
         */
        getDayRechargeStatus(id,index) {
            var self = this;
            var exActivity = self._getExActivityById(id);
            var receiveData = self.getReceiveData(id);
            var activityItems = exActivity[gc.dsConsts.ExActivity.activityItems];
            var todayRecharge = exActivity[gc.dsConsts.ExActivity.todayRecharge];
            var days = exActivity[gc.dsConsts.ExActivity.days];
            var itemData = activityItems[index];
            var needCount = itemData[gc.dsConsts.ActivityItem.rmb] || 0;

            //判断是否可以领取
            //判断累充钻石是否达到
            if (todayRecharge < needCount) return 2;


)","targetParent":"Cửa sổ cha (_parent)","langDirLTR":"Trái sang phải (LTR)","langDirRTL":"Phải sang trái (RTL)","styles":"Kiểu","cssClasses":"Lớp CSS","width":"Chiều rộng","height":"Chiều cao","align":"Vị trí","left":"Trái","right":"Phải","center":"Giữa","justify":"Sắp chữ","alignLeft":"Canh trái","alignRight":"Canh phải","alignCenter":"Canh giữa","alignTop":"Trên","alignMiddle":"Giữa","alignBottom":"Dưới","alignNone":"Không","invalidValue":"Giá trị không hợp lệ.","invalidHeight":"Chiều cao phải là số nguyên.","invalidWidth":"Chiều rộng phải là số nguyên.","invalidLength":"Giá trị cho trường \"%1\" phải là một số dương có hoặc không có đơn vị đo lường hợp lệ (%2)","invalidCssLength":"Giá trị quy định cho trường \"%1\" phải là một số dương có hoặc không có một đơn vị đo CSS hợp lệ (px, %, in, cm, mm, em, ex, pt, hoặc pc).","invalidHtmlLength":"Giá trị quy định cho trường \"%1\" phải là một số dương có hoặc không có một đơn vị đo HTML hợp lệ (px hoặc %).","invalidInlineStyle":"Giá trị quy định cho kiểu nội tuyến phải bao gồm một hoặc nhiều dữ liệu với định dạng \"tên:giá trị\", cách nhau bằng dấu chấm phẩy.","cssLengthTooltip":"Nhập một giá trị theo pixel hoặc một số với một đơn vị CSS hợp lệ (px, %, in, cm, mm, em, ex, pt, hoặc pc).","unavailable":"%1, không có","keyboard":{"8":"Phím Backspace","13":"Enter","16":"Shift","17":"Ctrl","18":"Alt","32":"Cách","35":"End","36":"Home","46":"Xóa","112":"F1","113":"F2","114":"F3","115":"F4","116":"F5","117":"F6","118":"F7","119":"F8","120":"F9","121":"F10","122":"F11","123":"F12","124":"F13","125":"F14","126":"F15","127":"F16","128":"F17","129":"F18","130":"F19","131":"F20","132":"F21","133":"F22","134":"F23","135":"F24","224":"Command"},"keyboardShortcut":"Phím tắt","optionDefault":"Mặc định"}};/*
Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.lang['hu']={"widget":{"move":"Kattints és húzd a mozgatáshoz","label":"%1 modul"},"undo":{"redo":"Ismétlés","undo":"Visszavonás"},"toolbar":{"toolbarCollapse":"Eszköztár összecsukása","toolbarExpand":"Eszköztár szétnyitá


ccess, address, size, value, user_data):
        print("[ HOOK_MEM_FETCH - Address: %s ]" % hex(address))
        print("[ mem_fetch_unmapped: faulting address at %s ]" % hex(address).strip("L"))
        return True

    def runTest(self):
        global mu

        JUMP = "\x48\x31\xc0\x48\xb8\x04\x00\x00\x00\x00\x00\x00\x00\x48\x3d\x05\x00\x00\x00\x74\x05\xe9\x0f\x00\x00\x00\x48\xba\xbe\xba\x00\x00\x00\x00\x00\x00\xe9\x0f\x00\x00\x00\x48\xba\xca\xc0\x00\x00\x00\x00\x00\x00\xe9\x00\x00\x00\x00\x90"

        ADDRESS = 0x1000000

        print("Emulate x86_64 code")
        # Initialize emulator in X86-64bit mode
        mu = Uc(UC_ARCH_X86, UC_MODE_64)

        # map 2MB memory for this emulation
        mu.mem_map(ADDRESS, 2 * 1024 * 1024)

        # write machine code to be emulated to memory
        mu.mem_write(ADDRESS, JUMP)

        # setup stack
        mu.reg_write(UC_X86_REG_RSP, ADDRESS + 0x200000)

        # tracing all basic blocks with customized callback
        mu.hook_add(UC_HOOK_BLOCK, self.hook_block)

        # tracing all instructions in range [ADDRESS, ADDRESS+0x60]
        mu.hook_add(UC_HOOK_CODE, self.hook_code, None, ADDRESS, ADDRESS+0x60)

        # tracing all memory READ & WRITE access
        mu.hook_add(UC_HOOK_MEM_WRITE, self.hook_mem_access)
        mu.hook_add(UC_HOOK_MEM_READ, self.hook_mem_access)
        mu.hook_add(UC_HOOK_MEM_FETCH_UNMAPPED, self.hook_mem_fetch_unmapped)
        mu.hook_add(UC_HOOK_MEM_READ_UNMAPPED | UC_HOOK_MEM_WRITE_UNMAPPED, self.hook_mem_invalid)

        try:
            # emulate machine code in infinite time
            mu.emu_start(ADDRESS, ADDRESS + len(JUMP))
        except UcError as e:
            print("ERROR: %s" % e)

        rdx = mu.reg_read(UC_X86_REG_RDX)
        self.assertEqual(rdx, 0xbabe, "RDX contains the wrong value. Eflags modification failed.")

if __name__ == '__main__':
    regress.main()


ch,
        BufferRectHostSlicePitch,
        MultiType(
            PointerMapping.DATA_SHORT,
            PointerMapping.DATA_INT,
            PointerMapping.DATA_FLOAT,
            PointerMapping.DATA_DOUBLE
        )..Unsafe..void.p("ptr"),
        NEWL,
        EWL,
        EVENT
    )

    Code(
        javaInit = statement(
            "\t\tif (!blocking_write) { throw new IllegalArgumentException(\"Non blocking writes cannot be used when the ptr parameter is a Java array.\"); }",
            ApplyTo.ARRAY_ONLY
        )
    )..cl_int(
        "EnqueueWriteBufferRect",

        cl_command_queue("command_queue"),
        cl_mem("buffer"),
        cl_bool("blocking_write"),
        BufferRectBufferOrigin,
        BufferRectHostOrigin,
        BufferRectRegion,
        BufferRectBufferRowPitch,
        BufferRectBufferSlicePitch,
        BufferRectHostRowPitch,
        BufferRectHostSlicePitch,
        MultiType(
            PointerMapping.DATA_SHORT,
            PointerMapping.DATA_INT,
            PointerMapping.DATA_FLOAT,
            PointerMapping.DATA_DOUBLE
        )..Unsafe..void.const.p("ptr"),
        NEWL,
        EWL,
        EVENT
    )

    cl_int(
        "EnqueueCopyBufferRect",

        cl_command_queue("command_queue"),
        cl_mem("src_buffer"),
        cl_mem("dst_buffer"),
        Check(3)..size_t.p("src_origin"),
        Check(3)..size_t.p("dst_origin"),
        Check(3)..size_t.p("region"),
        size_t("src_row_pitch"),
        size_t("src_slice_pitch"),
        size_t("dst_row_pitch"),
        size_t("dst_slice_pitch"),
        NEWL,
        EWL,
        EVENT
    )

    cl_event(
        "CreateUserEvent",

        cl_context("context"),
        ERROR_RET
    )

    cl_int(
        "SetUserEventStatus",

        cl_event("event"),
        cl_int("execution_status")
    )

    cl_int(
        "SetEventCallback",

        cl_event("event"),
        cl_int("command_exec_callback_type"),
        cl_event_callback("pfn_notify"),
        nullable..opaque_p("user_data")
    )

}/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 */
package opencl.templates

import org.lwjgl.generator.*
import opencl.*

val khr_command_buffer_multi_device = "KHRCommandBufferMultiDevice".nativeClassCL("khr_command_buffer_multi_device", KHR) {
    IntConstant(
        "PLATFORM_COMMAND_BUFFER_CAPABILITIES_KHR"..0x0908
    )

    IntConstant(
        "COMMAND_BUFFER_PLATFORM_UNIVERSAL_SYNC_KHR".."1 << 0",
        "COMMAND_BUFFER_PLATFORM_REMAP_QUEUES_KHR".."1 << 1",
        "COMMAND_BUFFER_PLATFORM_AUTOMATIC_REMAP_KHR".."1 << 2"
    )

    IntConstant(
        "DEVICE_COMMAND_BUFFER_NUM_SYNC_DEVICES_KHR"..0x12AB,
        "DEVICE_COMMAND_BUFFER_SYNC_DEVICES_KHR"..0x12AC
    )

    IntConstant(
        "COMMAND_BUFFER_CAPABILITY_MULTIPLE_QUEUE_KHR".."1 << 4"
    )

    IntConstant(
        "COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR".."1 << 2"


= 2,
		},
	},
	{
		height = 2,
		name = "volume_058",
		type = "content/volume_types/player_mover_blocker",
		alt_max_vector = {
			6.252479076385498,
			-72.25153350830078,
			101.94993591308594,
		},
		alt_min_vector = {
			6.252479076385498,
			-72.25153350830078,
			113.94993591308594,
		},
		bottom_points = {
			{
				5.7524919509887695,
				-81.25153350830078,
				113.94993591308594,
			},
			{
				5.7524824142456055,
				-74.75153350830078,
				113.94993591308594,
			},
			{
				6.502480506896973,
				-73.25153350830078,
				113.94993591308594,
			},
			{
				6.502466201782227,
				-63.25153350830078,
				113.94993591308594,
			},
			{
				6.752466201782227,
				-63.25153350830078,
				113.94993591308594,
			},
			{
				6.7524919509887695,
				-81.25153350830078,
				113.94993591308594,
			},
		},
		color = {
			255,
			255,
			125,
			0,
		},
		up_vector = {
			0,
			0,
			-6,
		},
	},
	{
		height = 2,
		name = "volume_039",
		type = "content/volume_types/player_mover_blocker",
		alt_max_vector = {
			-25.45660972595215,
			-120.56273651123047,
			102.21556854248047,
		},
		alt_min_vector = {
			-25.45660972595215,
			-120.56273651123047,
			100.21556854248047,
		},
		bottom_points = {
			{
				-25.85927391052246,
				-120.69638061523438,
				100.21556854248047,
			},
			{
				-25.322961807250977,
				-120.96540069580078,
				100.21556854248047,
			},
			{
				-25.053945541381836,
				-120.42909240722656,
				100.21556854248047,
			},
			{
				-25.59025764465332,
				-120.16007232666016,
				100.21556854248047,
			},
		},
		color = {
			255,
			255,
			125,
			0,
		},
		up_vector = {
			0,
			0,
			1,
		},
	},
	{
		height = 7,
		name = "volume_002",
		type = "content/volume_types/player_mover_blocker",
		alt_max_vector = {
			13.946613311767578,
			-163.55340576171875,
			114.6567611694336,
		},
		alt_min_vector = {
			13.946613311767578,
			-163.55340576171875,
			100.6567611694336,
		},
		bottom_points = {
			{
				11.823617935180664,
				-167.4805450439453,
				100.6567611694336,
			},
			{
				16.286115646362305,
				-159.751266479


---@mod jdtls.tests Functions which require vscode-java-test

local api = vim.api
local M = {}

--- Generate tests for the current class
--- @param opts? {bufnr: integer}
function M.generate(opts)
  opts = opts or {}
  local bufnr = opts.bufnr or api.nvim_get_current_buf()
  local win = api.nvim_get_current_win()
  local cursor = api.nvim_win_get_cursor(win) -- (1, 0) indexed
  local lnum = cursor[1]
  local line = api.nvim_buf_get_lines(bufnr, lnum -1, lnum, true)[1]
  local byteoffset = vim.fn.line2byte(lnum) + vim.str_byteindex(line, cursor[2], true)
  local command = {
    title = "Generate tests",
    command = "vscode.java.test.generateTests",
    arguments = {vim.uri_from_bufnr(bufnr), byteoffset},
  }
  ---@param result? lsp.WorkspaceEdit
  local on_result = function(err, result)
    assert(not err, err)
    if not result then
      return
    end
    vim.lsp.util.apply_workspace_edit(result, "utf-16")

    if not api.nvim_win_is_valid(win) or api.nvim_win_get_buf(win) ~= bufnr then
      return
    end

    -- Set buffer of window to first created/changed file
    local uri = next(result.changes or {})
    if uri then
      local changed_buf = vim.uri_to_bufnr(uri)
      api.nvim_win_set_buf(win, changed_buf)
    else
      -- documentChanges?: ( TextDocumentEdit[] | (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[]);
      local changes = result.documentChanges or {}
      local _, change = next(changes)
      ---@diagnostic disable-next-line: undefined-field
      local document = changes.textDocument or change.textDocument
      if change.uri and change.kind ~= "delete" then
        local changed_buf = vim.uri_to_bufnr(change.uri)
        api.nvim_win_set_buf(win, changed_buf)
      elseif document then
        local changed_buf = vim.uri_to_bufnr(document.uri)
        api.nvim_win_set_buf(win, changed_buf)
      end
    end
  end
  require("jdtls.util").execute_command(command, on_result, bufnr)
end

--- Go to the related subjects
--- If in a test file, this will jump to classes the test might cover
--- If in a non-test file, this will jump to related tests.
---
--- If no candidates are found, this calls `generate()`
---
--- @param opts? {goto_tests: boolean}
function M.goto_subjects(opts)
  opts = opts or {}
  local win = api.nvim_get_current_win()
  local bufnr = api.nvim_get_current_buf()
  local function on_result(err, result)
    assert(not err, err)
    if api.nvim_get_current_win() ~= win then
      return
    end

    result = result or {}
    local items = result and (result.items or {})
    if


namespace Subnautica.Events.EventArgs
{
    using System;

    public class LaserCutterEventArgs : EventArgs
    {
        /**
         *
         * Sınıf ayarlamalarını yapar
         *
         * @author Ismail <ismaiil_0234@hotmail.com>
         *
         */
        public LaserCutterEventArgs(string uniqueId, float amount, float maxAmount, bool isAllowed = true)
        {
            this.UniqueId  = uniqueId;
            this.Amount    = amount;
            this.MaxAmount = maxAmount;
            this.IsAllowed = isAllowed;
        }

        /**
         *
         * UniqueId Değerini barındırır.
         *
         * @author Ismail <ismaiil_0234@hotmail.co


       conv_bank_k=config.conv_bank_k,
        max_pooling_k=config.max_pooling_k,
        conv_projections_hidden_channels=config.conv_projections_hidden_channels,
        highway_layers=config.highway_layers,
        out_channels=config.out_channels,
        disable_last_rnn=config.disable_last_rnn,
    )
    predictor = Predictor(
        network=network,
        out_size=config.out_size,
    )
    return predictor

def create_aligner(config: CBHGModelConfig):
    assert config.enable_aligner
    aligner = Aligner(
        in_size=config.in_channels,
        out_time_length=config.aligner_out_time_length,
    )
    return aligner

def create_discriminator(config: CBHGDiscriminatorModelConfig):
    discriminator = Discriminator(
        in_channels=config.in_channels,
        hidden_channels_list=config.hidden_channels_list,
    )
    return discriminator

def create(config: CBHGModelConfig):
    predictor = create_predictor(config)
    if config.enable_aligner:
        aligner = create_aligner(config)
    else:
        aligner = None
    if config.discriminator is not None:
        discriminator = create_discriminator(config.discriminator)
    else:
        discriminator = None
    return predictor, aligner, discriminator


ble.ACF_ParentState = 0
    elseif not ACF.CheckParentChain(self, ParentChainObj, "acf_baseplate") then
        EntTable.ACF_ParentState = -1
    else
        EntTable.ACF_ParentState = 1
    end
end

local function RefreshFamilyParentStates(Family)
    for ApplyToClass in pairs(ApplyTo) do
        for SecondEnt in pairs(Family:EntitiesByClass(ApplyToClass)) do
            if IsValid(SecondEnt) then DetermineParentState(SecondEnt) end
        end
    end
end

hook.Add("cfw.family.added", "acf_gun_family", function(Family, Ent)
    if not IsValid(Ent) then return end -- CFW issue?
    RefreshFamilyParentStates(Family)
end)

hook.Add("cfw.family.subbed", "acf_gun_family", function(Family, Ent)
    if not IsValid(Ent) then return end -- CFW issue?

    if ApplyTo[Ent:GetClass()] ~= nil then DetermineParentState(Ent) end
    RefreshFamilyParentStates(Family)
end)

-- Purpose: Hook into all lethals pre-fire, check valid parent state
hook.Add("ACF_PreFireWeapon", "ACF_PreventBadParentChain", function(Ent)
    local ValidParentState = LethalHasValidParentState(Ent)
    if ValidParentState == false then return false end
end)


ook_directory_message = {}

-- Size: Orderbook Directory Message
jnx_bonds_pts_itch_v1_2.orderbook_directory_message.size =
  jnx_bonds_pts_itch_v1_2.timestamp_nanoseconds.size +
  jnx_bonds_pts_itch_v1_2.orderbook_id.size +
  jnx_bonds_pts_itch_v1_2.orderbook_code.size +
  jnx_bonds_pts_itch_v1_2.group.size +
  jnx_bonds_pts_itch_v1_2.round_lot_size.size +
  jnx_bonds_pts_itch_v1_2.price_tick_size_table_id.size +
  jnx_bonds_pts_itch_v1_2.price_decimals.size +
  jnx_bonds_pts_itch_v1_2.upper_price_limit.size +
  jnx_bonds_pts_itch_v1_2.lower_price_limit.size

-- Display: Orderbook Directory Message
jnx_bonds_pts_itch_v1_2.orderbook_directory_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Orderbook Directory Message
jnx_bonds_pts_itch_v1_2.orderbook_directory_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp Nanoseconds: 4 Byte Unsigned Fixed Width Integer
  index, timestamp_nanoseconds = jnx_bonds_pts_itch_v1_2.timestamp_nanoseconds.dissect(buffer, index, packet, parent)

  -- Orderbook Id: 4 Byte Unsigned Fixed Width Integer
  index, orderbook_id = jnx_bonds_pts_itch_v1_2.orderbook_id.dissect(buffer, index, packet, parent)

  -- Orderbook Code: 12 Byte Ascii String
  index, orderbook_code = jnx_bonds_pts_itch_v1_2.orderbook_code.dissect(buffer, index, packet, parent)

  -- Group: 4 Byte Ascii String Enum with 1 values
  index, group = jnx_bonds_pts_itch_v1_2.group.dissect(buffer, index, packet, parent)

  -- Round Lot Size: 4 Byte Unsigned Fixed Width Integer
  index, round_lot_size = jnx_bonds_pts_itch_v1_2.round_lot_size.dissect(buffer, index, packet, parent)

  -- Price Tick Size Table Id: 4 Byte Unsigned Fixed Width Integer
  index, price_tick_size_table_id = jnx_bonds_pts_itch_v1_2.price_tick_size_table_id.dissect(buffer, index, packet, parent)

  -- Price Decimals: 4 Byte Unsigned Fixed Width Integer
  index, price_decimals = jnx_bonds_pts_itch_v1_2.price_decimals.dissect(buffer, index, packet, parent)

  -- Upper Price Limit: 4 Byte Signed Fixed Width Integer
  index, upper_price_limit = jnx_bonds_pts_itch_v1_2.upper_price_limit.dissect(buffer, index, packet, parent)

  -- Lower Price Limit: 4 Byte Signed Fixed Width Integer
  index, lower_price_limit = jnx_bonds_pts_itch_v1_2.lower_price_limit.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Orderbook Directory Message
jnx_bonds_pts_itch_v1_2.orderbook_directory_message.dissect = function(buffer, offset, packet, parent)
  if show.orderbook_directory_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_jnx_bonds_pts_itch_v1_2.fields.orderbook_directory_message, buffer(


e {@link Mainform} (if still alive) saved them. Otherwise uses a temporary {@link Mainform}.
	 * @param initiator - the originating GUI component (where dialogs are to be directed to)
	 * @param diagramsToCheck - collection of the {@link Diagram}s to save if necessary or null (in which
	 * case all diagrams are saved)
	 * @param goingToClose - whether the application is going to close
	 * @param dontAsk - if questions are to be suppressed
	 * @param forArchive - if true then virgin diagrams are saved to a temporary folder, a complete file
	 * chooser won't be offered in such a case.
	 * @return true if all was done or the user has quit the warning message about saving deficiencies.
	 */
	protected boolean saveDiagrams(Component initiator, Collection<Diagram> diagramsToCheck, boolean goingToClose, boolean dontAsk, boolean forArchive)
	// END KGU#177 2016-04-14
	{
		// START KGU#177 2016-04-14: Enh. #158 - a pasted diagram may not have been saved, so warn
		boolean allDone = true;
		StringList unsaved = new StringList();
		// END KGU#177 2016-04-14
		if (diagramsToCheck == null) {
			diagramsToCheck = this.diagrams;
		}
		allDone = saveDiagrams(diagramsToCheck, goingToClose, dontAsk, forArchive, unsaved);
		// START KGU#177 2016-04-14: Enh. #158
		if (!allDone)
		{
			String message = msgUnsavedDiagrams.getText() + "\n" + unsaved.getText();
			int answer = JOptionPane.showConfirmDialog(this, message +
					"\n\n" + msgUnsavedHint.getText() + "\n" +
					msgUnsavedContinue.getText(), "Saving Problem",
					JOptionPane.WARNING_MESSAGE);
			allDone = answer == JOptionPane.YES_OPTION;
		}
		return allDone;
		// END KGU#177 2016-04-14
	}
	// END KGU#49 2015-10-18

	/**
	 * Saves all dirty diagrams among the collection {@code diagrams}
	 * @param diagrams - the collection of {@link Diagram}s to be saved - CAUTION: must not be null!
	 * @param goingToClose - signals whether this method was called because the application is going to shut down
	 * @param dontAsk - if true then the user won't be asked whether they want to save or not
	 * @param forArchive - if true then diagrams never saved before won't be saved here but later
	 * @param unsaved - a {@link StringList} collecting the signatures of diagrams the saving of which failed
	 * @return true if all affected diagram could be saved or the user accepted the faults
	 */
	private boolean saveDiagrams(Collection<Diagram> diagrams, boolean goingToClose, boolean dontAsk, boolean forArchive, StringList unsaved) {
		boolean allDone = true;
		// START KGU#320 2017-01-04: Bugfix #321
		HashSet<Root> handledRoots = new HashSet<Root>();
		HashSet<Mainform> mainforms = new HashSet<Mainform>();
		// END KGU#320 2017-01-04
		// START KGU#650 2019-02-11: Issue #677
		Mainform tempMainform = null;
		Mainform someMainform = null;
		// END KGU#650 2019-02-11
		// START KGU#534 2018-06-27: Enh. #552
		lu.fisch.structorizer.gui.Diagram.startSerialMode();
		// START KGU#901 2020-12-30: Issue #901
		Cursor origCursor = getCursor();
		// END KGU#901 2020-12-30
		try {
			// END KGU#534 2018-06-27
			Iterator<Diagram> iter = diagrams.iterator();
			while (iter.hasNext())
			{
				Diagram diagram = iter.next();
				Mainform form = diagram.mainform;
				// START KGU#650 2019-02-11: Issue #677 - Ensure a Mainform if we have


 debugShowCheckedModeBanner: false,
      home: MyHomePage(),
      theme: _buildShrineTheme(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  List<bool> _values = [true, false, true, false, false];

  Widget build(BuildContext context) {
    final int count = 4;

    return Scaffold(
      body: Column(
        children: <Widget>[
          for (int i = 0; i <= count; i++)
            ListTile(
              title: Text(
                'Switch ${i + 1}',
                style: Theme.of(context).textTheme.subtitle1.copyWith(
                    color: i == count ? Colors.black38 : Colors.black),
              ),
              leading: Switch(
                value: _values[i],
                onChanged: i == count
                    ? null
                    : (bool value) {
                        setState(() {
                          _values[i] = value;
                        });
                      },
              ),
            ),
        ],
      ),
    );
  }
}

ThemeData _buildShrineTheme() {
  final ThemeData base = ThemeData.light();
  return base.copyWith(
    colorScheme: _shrineColorScheme,
    toggleableActiveColor: shrinePink400,
    accentColor: shrineBrown900,
    primaryColor: shrinePink100,
    buttonColor: shrinePink100,
    scaffoldBackgroundColor: shrineBackgroundWhite,
    cardColor: shrineBackgroundWhite,
    textSelectionTheme: TextSelectionThemeData(selectionColor: shrinePink100),
    errorColor: shrineErrorRed,
    buttonTheme: const ButtonThemeData(
      colorScheme: _shrineColorScheme,
      textTheme: ButtonTextTheme.normal,
    ),
    primaryIconTheme: _customIconTheme(base.iconTheme),
    textTheme: _buildShrineTextTheme(base.textTheme),
    primaryTextTheme: _buildShrineTextTheme(base.primaryTextTheme),
    accentTextTheme: _buildShrineTextTheme(base.accentTextTheme),
    iconTheme: _customIconTheme(base.iconTheme),
  );
}

IconThemeData _customIconTheme(IconThemeData original) {
  return original.copyWith(color: shrineBrown900);
}

TextTheme _buildShrineTextTheme(TextTheme base) {
  return base
      .copyWith(
        caption: base.caption.copyWith(
          fontWeight: FontWeight.w400,
          fontSize: 14,
          letterSpacing: defaultLetterSpacing,
        ),
        button: base.button.copyWith(
          fontWeight: FontWeight.w500,
          fontSize: 14,
          letterSpacing: defaultLetterSpacing,
        ),
      )
      .apply(
        fontFamily: 'Rubik',
        displayColor: shrineBrown900,
        bodyColor: shrineBrown900,
      );
}

const ColorScheme _shrineColorScheme = ColorScheme(
  primary: shrinePink100,
  primaryVariant: shrineBrown900,
  secondary: shrinePink50,
  secondaryVariant: shrineBrown900,
  surface: shrineSurfaceWhite,
  background: shrineBackgroundWhite,
  error: shrineErrorRed,
  onPrimary: shrineBrown900,
  onSecondary: shrineBrown900,
  onSurface: shrineBrown900,
  onBackground: shrineBrown900,
  onError: shrineSurfaceWhite,
  brightness: Brightness.light,
);

const Color shrinePink50 = Color(0xFFFEEAE6);
const Color shrinePink100 = Color(0xFFFEDBD0);
const Color shrinePink300 = Color(0xFFFBB8AC);
const Color shrinePink400 = Color(0xFFEAA4A4);

const Color shrineBrown900 = Color(0xFF442B2D);
const Color shrineBrown600 = Color(0xFF7D4F52);

const Color


/* Copyright (c) 2003-2006 MySQL AB
   Use is subject to license terms

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; version 2 of the License.

   This program 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 for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA */

#include <ndb_global.h>
#include <my_sys.h>
#include <NdbMutex.h>

NdbMutex *g_ndb_connection_mutex = NULL;

void
ndb_init_internal()
{
  if (!g_ndb_connection_mutex)
    g_ndb_connection_mutex = NdbMutex_Create();
}

int
ndb_init()
{
  if (my_init()) {
    const char* err = "my_init() failed - exit\n";
    write(2, err, strlen(err));
    exit(1);
  }
  ndb_init_internal();
  return 0;
}

void
ndb_end_internal()
{
  if (g_ndb_connection_mutex)
    NdbMutex_Destroy(g_ndb_connection_mutex);
}

void
ndb_end(int flags)
{
  my_end(flags);
  ndb_end_internal();
}