            if (context.ConditionValue1.Value == 5)
                return gameobjectParameter!.Items;

            return null;
        }

        private void LazyLoad()
        {
            if (creatureParameter == null || gameobjectParameter == null)
            {
                creatureParameter = parameterFactory.Factory("CreatureParameter");
                gameobjectParameter = parameterFactory.Factory("GameobjectParameter");
            }
        }

        private IParameter<long>? creatureParameter;
        private IParameter<long>? gameobjectParameter;

        public override string ToString(long value, IConditionViewModel context)
        {
            LazyLoad();

            if (context.ConditionValue1.Value == 3)
                return creatureParameter!.ToString(value);

            if (context.ConditionValue1.Value == 5)
                return gameobjectParameter!.ToString(value);

            return ToString(value);
        }
    }
}


ight crop by the computed offset, then re-run
        // phase correlation to get a final offset.
        // - This improves the results at the cost of taking twice as long.

        ImageView<ChannelT> shift_right_crop = crop(translate(right_image,
                                                              d[0], d[1],
                                                              ZeroEdgeExtension(),
                                                              BicubicInterpolation()),
                                                    right_window
                                                  );
        //write_image("right_patch_refined.tif", shift_right_crop);

        Vector2f d2(0,0);
        phase_correlation_subpixel(left_image_patch, shift_right_crop,
                                  d2, subpixel_accuracy, debug);
        d += d2; // The second translation adds to the first one.
      }

      // If there is too much translation in our affine transform or
      // we got NaNs, invalidate the pixel
      if ( norm_2(d) > SUBPIXEL_MAX_TRANSLATION ||
           std::isnan(d[0]) || std::isnan(d[1]) )
        invalidate(disparity_map(x,y));
      else
        remove_mask(disparity_map(x,y)) -= d; // TODO: Why is this subtracted?

      //vw_throw( NoImplErr() << "DEBUG!!!!" );
    } // X increment
  } // Y increment

}

}} // namespace vw::stereo

#endif // __VW_STEREO_PHASESUBPIXEL_VIEW__


            "F7", "M7" -> "Maxor"
            else -> null
        } ?: return false

        // Livid has a prefix in front of the name, so we check ends with to cover all the livids
        return bossName.endsWith(correctBoss)
    }

    fun getCurrentBoss(): DungeonFloor? {
        val floor = dungeonFloor ?: return null
        return DungeonFloor.valueOf(floor.replace("M", "F"))
    }

    private const val WATER_ROOM_ID = "-60,-60"
    val inWaterRoom: Boolean get() = roomId == WATER_ROOM_ID

    fun getColor(level: Int): String = when {
        level >= 50 -> "§c§l"
        level >= 45 -> "§c"
        level >= 40 -> "§6"
        level >= 35 -> "§d"
        level >= 30 -> "§9"
        level >= 25 -> "§b"
        level >= 20 -> "§2"
        level >= 15 -> "§a"
        level >= 10 -> "§e"
        level >= 5 -> "§f"
        else -> "§7"
    }

    @HandleEvent
    fun onScoreboardUpdate(event: ScoreboardUpdateEvent) {
        // TODO: move this under inDungeon check when we use Hypixel's ModAPI for island detection
        floorPattern.firstMatcher(event.added) {
            val floor = group("floor")
            if (dungeonFloor == floor) return
            dungeonFloor = floor
            DungeonEnterEvent(floor).post()
            return
        }
        if (!inDungeon()) return
        dungeonRoomPattern.firstMatcher(event.added) {
            roomId = group("roomId")
            return
        }
        timePattern.firstMatcher(event.added) {
            time = "${groupOrNull("minutes") ?: "00"}:${group("seconds")}"
            return
        }
    }

    @HandleEvent
    fun onTablistChange(event: TabListUpdateEvent) {
        if (!inDungeon()) return
        if (dungeonFloor == null || playerClass != null) return

        val playerTeam = event.tabList.find { it.contains(PlayerUtils.getName()) }?.removeColor() ?: return
        for (dungeonClass in DungeonClass.entries) {
            if (playerTeam.contains("(${dungeonClass.scoreboardName} ")) {
                val level = playerTeam.split(" ").last().trimEnd(')').romanToDecimalIfNecessary()
                playerClass = dungeonClass
                playerClassLevel = level
                return
            }
        }
    }

    @HandleEvent
    fun onTabUpdate(event: TablistFooterUpdateEvent) {
        if (!inDungeon()) return
        for (line in event.footer.split("\n")) {
            if (noBlessingPattern.matches(line)) {
                DungeonBlessings.reset()
                return
            }
            val matcher = blessingPattern.matcher(line)
            if (matcher.find()) {
                val type = matcher.group("type") ?: continue
                val amount = matcher.group("amount").romanToDecimalIfNecessary()
                if (DungeonBlessings.valueOf(type.uppercase()).power != amount) {
                    DungeonBlessings.valueOf(type.uppercase()).power = amount
                }
            }
        }

    }

    @HandleEvent
    fun onWorldChange() {
        dungeonFloor = null
        started = false
        inBossRoom = false
        isUniqueClass = false
        playerClass = null
        playerClassLevel = -1
        completed = false
        playerTeamClasses.clear()
        time = ""
        roomId = null
        DungeonBlessings.reset()
    }

    @HandleEvent(onlyOnSkyblock = true)
    fun onChat(event: SkyHanniChatEvent) {
        val floor = dungeonFloor ?: return
        if (event.message == "§e[NPC] §bMort§f: §rHere, I found this map when I first entered the dungeon.") {
            started = true
            DungeonStartEvent(floor).post()
        }
        if (event.message.removeColor().matches(uniqueClassBonus)) {


ke sense will not be",
   "echoed, and a bell will sound instead.  Also, backspacing and",
   "killing lines will echo differently than normal.  You may examine",
   "the board by typing a 'r' if you have made a partial move, or be-",
   "fore you type a newline, to see what the board looks like.  You",
   "must end your move with a newline.  If you cannot double, your",
   "roll will always be printed, and you will not be given the oppor-",
   "tunity to double.  Home and bar are represented by the appropri-",
   "ate number, 0 or 25 as the case may be, or by the letters 'h' or",
   "'b' as appropriate.  You may also type 'r' or 'q' when the program",
   "types 'Move:', which has the same effect as above.  Finally, you",
   "will get to decide if you want to play red or white (or both if you",
   "want to play a friend) at the beginning of the session, and you",
   "will not get to change your mind later, since the computer keeps",
   "score.",
   "",
   0};

char	*lastch[] = {
   "\nTutorial (Practice Game):",
   "\n   This tutorial, for simplicity's sake, will let you play one",
   "predetermined game.  All the rolls have been pre-arranged, and",
   "only one response will let you advance to the next move.",
   "Although a given roll will may have several legal moves, the tu-",
   "torial will only accept one (not including the same moves in a",
   "different order), claiming that that move is 'best.'  Obviously,",
   "a subjective statement.  At any rate, be patient with it and have",
   "fun learning about backgammon.  Also, to speed things up a lit-",
   "tle, doubling will not take place in the tutorial, so you will",
   "never get that opportunity, and quitting only leaves the tutori-",
   "al, not the game.  You will still be able to play backgammon",
   "after quitting.",
   "\n   This is your last chance to look over the rules before the tu-",
   "torial starts.",
   "",
   0};

text (txt)
char	**txt;

{
	char	**begin;
	char	*a;
	char	b;
	char	*c;
	int	i;

	fixtty (noech);
	begin = txt;
	while (*txt)  {
		a = *(txt++);
		if (*a != '\0')  {
			c = a;
			for (i = 0; *(c++) != '\0'; i--);
			writel (a);
			writec ('\n');
		} else  {
			fixtty (raw);
			writel (prompt);
			for (;;)  {
				if ((b = readc()) == '?')  {
					if (tflag)  {
						if (begscr)  {
							curmove (18,0);
							clend();
						} else
							clear();
					} else
						writec ('\n');
					text (list);
					writel (prompt);
					continue;
				}
				i = 0;
				if (b == '\n')
					break;
				while (i < 11)  {
					if (b == opts[i])
						break;
					i++;
				}
				if (i == 11)
					writec ('\007');
				else
					break;
			}
			if (tflag)  {
				if (begscr)  {
					curmove (18,0);
					clend();
				} else
					clear();
			} else
				writec ('\n');
			if (i)
				return(i);
			fixtty (noech);
			if (tflag)
				curmove (curr,0);
			begin = txt;
		}
	}
	fixtty (raw);
	return (0);
}


import sys
sys.path.insert(0, '/root/hypothesis-llm/envs/coremltools_env/lib/python3.13/site-packages')

print("Proposed fix for EnumeratedShapes bug:")
print("\nThe fix needs to handle shapes of different lengths properly.")
print("The symbolic_shape should have length equal to the maximum shape length.")
print("\nHere's the fix (lines 556-564 in input_types.py):")

fix = '''
# OLD CODE (buggy):
self.symbolic_shape = self.shapes[0].symbolic_shape
for shape in self.shapes:
    for idx, s in enumerate(shape.symbolic_shape):
        if is_symbolic(self.symbolic_shape[idx]):  # BUG: IndexError here
            continue
        elif is_symbolic(s):
            self.symbolic_shape[idx] = s
        elif s != self.symbolic_shape[idx]:
            self.symbolic_shape[idx] = get_new_symbol()

# FIXED CODE:
# Find the maximum number of dimensions across all shapes
max_rank = max(len(shape.symbolic_shape) for shape in self.shapes)

# Initialize symbolic_shape with new symbols for all dimensions
self.symbolic_shape = [get_new_symbol() for _ in range(max_rank)]

# Now process each shape
for shape in self.shapes:
    for idx, s in enumerate(shape.symbolic_shape):
        # Since we've pre-allocated symbolic_shape with max_rank length,
        # idx will never be out of bounds
        if is_symbolic(self.symbolic_shape[idx]):
            continue
        elif is_symbolic(s):
            self.symbolic_shape[idx] = s
        elif s != self.symbolic_shape[idx]:
            self.symbolic_shape[idx] = get_new_symbol()
'''

print(fix)


dailyStat.auctionsCompletedToday = 0
    dailyStat.auctionsCancelledToday = 0
    dailyStat.valueCreatedToday = BigInt.fromI32(0)
    dailyStat.valueCompletedToday = BigInt.fromI32(0)
  }
  dailyStat.auctionsCompletedToday = dailyStat.auctionsCompletedToday + 1
  dailyStat.valueCompletedToday = dailyStat.valueCompletedToday + event.params.totalPrice
  dailyStat.save()

}

export function handleAuctionCancelled(event: AuctionCancelledEvent): void {
  let entity = new AuctionCancelled(
    event.transaction.hash.toHex() + "-" + event.logIndex.toString()
  )
  entity.tokenId = event.params.tokenId
  entity.save()

  //Get Sales summary entity from the store.
  //If it does not exist(is null), create new

  let salesSummary = SalesSummary.load("1");
  if (salesSummary == null) {
    salesSummary = new SalesSummary("1")
    salesSummary.auctionsCreated = 0
    salesSummary.auctionsCompleted = 0
    salesSummary.auctionsCancelled = 0

    salesSummary.valueCreated = BigInt.fromI32(0)
    salesSummary.valueCompleted = BigInt.fromI32(0)
    salesSummary.valueCancelled = BigInt.fromI32(0)
  }

  //Increment the auctionsCancelled count
  salesSummary.auctionsCancelled = salesSummary.auctionsCancelled + 1

  //Set the value of auctions cancelled
  salesSummary.valueCancelled = salesSummary.valueCreated - salesSummary.valueCompleted
  salesSummary.save()

  let day = event.block.timestamp / BigInt.fromI32(86400)
  let dayID = day.toString()
  let dailyStat = DailyStat.load(dayID)
  if (dailyStat == null) {
    dailyStat = new DailyStat(dayID)
    dailyStat.auctionsCreatedToday = 0
    dailyStat.auctionsCompletedToday = 0
    dailyStat.auctionsCancelledToday = 0
    dailyStat.valueCreatedToday = BigInt.fromI32(0)
    dailyStat.valueCompletedToday = BigInt.fromI32(0)
  }
  dailyStat.auctionsCancelledToday = dailyStat.auctionsCancelledToday + 1

  dailyStat.save()
}

export function handlePause(event: PauseEvent): void {
  let entity = new Pause(
    event.transaction.hash.toHex() + "-" + event.logIndex.toString()
  )

  entity.save()
}

export function handleUnpause(event: UnpauseEvent): void {
  let entity = new Unpause(
    event.transaction.hash.toHex() + "-" + event.logIndex.toString()
  )

  entity.save()
}
import { Component, OnInit, Input, EventEmitter, Output, ViewChild, ElementRef } from '@angular/core';

import * as Croppie from 'croppie';
import { CroppieOptions, ResultOptions, CropData } from 'croppie';

export type Type = 'canvas' | 'base64' | 'html' | 'blob' | 'rawcanvas';

@Component({
	selector: 'cng-croppie',
	templateUrl: "cng-croppie.html"
})
export class CngCroppieCard implements OnInit {
	@ViewChild('imageEdit') imageEdit: ElementRef;
	@Input() croppieOptions: CroppieOptions;
	@Input() points: number[];
	@Input() isRotator: boolean = true;
	//kiểu dữ liệu croppie trả về là blob để post lên máy chủ sẽ có kích cỡ nhỏ hơn base64
	@Input() outputFormatOptions: ResultOptions = { type: 'base64', size: 'viewp


%,45%,0.2);
    --lns-themeLight-color-disabledContent: hsla(230,8%,60%,1);
    --lns-themeLight-color-disabledBackground: hsla(230,7%,92%,1);
    --lns-themeLight-color-backdrop: hsla(230,11%,19%,0.5);
    --lns-themeLight-color-formFieldBorder: hsla(230,7%,84%,1);
    --lns-themeLight-color-formFieldBackground: hsla(230,7%,100%,1);
    --lns-themeDark-color-body: hsla(230,7%,97%,1);
    --lns-themeDark-color-bodyDimmed: hsla(230,40%,97%,0.6);
    --lns-themeDark-color-background: hsla(230,11%,19%,1);
    --lns-themeDark-color-overlay: hsla(230,10%,30%,1);
    --lns-themeDark-color-primary: hsla(230,84%,63%,1);
    --lns-themeDark-color-focusRing: hsla(230,84%,63%,0.5);
    --lns-themeDark-color-border: hsla(230,7%,75%,0.2);
    --lns-themeDark-color-disabledContent: hsla(230,8%,60%,1);
    --lns-themeDark-color-disabledBackground: hsla(230,10%,30%,1);
    --lns-themeDark-color-backdrop: hsla(230,11%,19%,0.5);
    --lns-themeDark-color-formFieldBorder: hsla(230,9%,45%,1);
    --lns-themeDark-color-formFieldBackground: hsla(230,11%,19%,1);
    --lns-fontSize-small: 12px;
    --lns-lineHeight-small: 18px;
    --lns-fontSize-medium: 14px;
    --lns-lineHeight-medium: 22px;
    --lns-fontSize-large: 18px;
    --lns-lineHeight-large: 26px;
    --lns-fontSize-xlarge: 22px;
    --lns-lineHeight-xlarge: 32px;
    --lns-fontSize-xxlarge: 32px;
    --lns-lineHeight-xxlarge: 38px;
    --lns-fontWeight-normal: 400;
Show All Properties (11 more)
}
<style>
:root, .theme-light {
    --lns-color-body: var(--lns-themeLight-color-body);
    --lns-color-bodyDimmed: var(--lns-themeLight-color-bodyDimmed);
    --lns-color-background: var(--lns-themeLight-color-background);
    --lns-color-overlay: var(--lns-themeLight-color-overlay);
    --lns-color-primary: var(--lns-themeLight-color-primary);
    --lns-color-focusRing: var(--lns-themeLight-color-focusRing);
    --lns-color-border: var(--lns-themeLight-color-border);
    --lns-color-disabledContent: var(--lns-themeLight-color-disabledContent);
    --lns-color-disabledBackground: var(--lns-themeLight-color-disabledBackground);
    --lns-color-backdrop: var(--lns-themeLight-color-backdrop);
    --lns-color-formFieldBorder: var(--lns-themeLight-color-formFieldBorder);
    --lns-color-formFieldBackground: var(--lns-themeLight-color-formFieldBackground);
} */
.cropper {
  &-container {
    direction: ltr;
    font-size: 0;
    line-height: 0;
    position: relative;
    touch-action: none;
    user-select: none;

    img {
      display: block;
      height: 100%;
      image-or


.internal:8545")?;
    let web3 = web3::Web3::new(transport);

    let accounts = web3.eth().accounts().await?;

    let contract_addr = Address::from_str("5fbdb2315678afecb367f032d93f642f64180aa3").unwrap();
    let contract = Contract::from_json(
        web3.eth(),
        contract_addr,
        include_bytes!("../contract/abi/storage.json"),
    )
    .unwrap();

    let value = format!("{:?}", ciphertext);
    println!("{}", value.clone());

    let tx = contract
        .call("addValue", (value,), accounts[0], Options::default())
        .await?;
    println!("TxHash: {}", tx);

    println!("[+] crypto_box success...");
    enclave.destroy();

    Ok(())
}
<reponame>puzza007/ErlangRT
use emulator::mfa::MFArity;

/// A pointer to a code location: used in funs created with a `fun m:f/a`
/// expression, in module export table and module local functions table.
#[derive(Debug, Copy, Clone)]
pub struct Export {
  /// Where the export points to.
  pub mfa: MFArity,
  // pub dst: CallableLocation,
}

impl Export {
  pub fn new(mfa: MFArity) -> Export {
    Export { mfa }
  }

//  pub fn new_code_offset(fa: &FunArity,
//                         mod_id: &VersionedModuleId,
//                         offset: usize) -> Export
//  {
//    let far_offset = FarCodePointer::new(mod_id, offset);
//    Export::new(MFArity::new_from_funarity(mod_id.module(), &fa))
//    //  dst: CallableLocation::Code(far_offset))
//  }
}
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn nextafter(x: f64, y: f64) -> f64 {
    if x.is_nan() || y.is_nan() {
        return x + y;
    }

    let mut ux_i = x.to_bits();
    let uy_i = y.to_bits();
    if ux_i == uy_i {
        return y;
    }

    let ax = ux_i & !1_u64 / 2;
    let ay = uy_i & !1_u64 / 2;
    if ax == 0 {
        if ay == 0 {
            return y;
        }
        ux_i = (uy_i & 1_u64 << 63) | 1;
    } else if ax > ay || ((ux_i ^ uy_i) & 1_u64 << 63) != 0 {
        ux_i -= 1;
    } else {
        ux_i += 1;
    }

    let e = ux_i.wrapping_shr(52 & 0x7ff);
    // raise overflow if ux.f is infinite and x is finite
    if e == 0x7ff {
        force_eval!(x + x);
    }
    let ux_f = f64::from_bits(ux_i);
    // raise underflow if ux.f is subnormal or zero
    if e == 0 {
        force_eval!(x * x + ux_f * ux_f);
    }
    ux_f
}
#![no_std]
#![no_main]

#[macro_use]
extern crate user_lib;

use user_lib::{get_time, yield_};

/// 正确输出：（无报错信息）
/// get_time OK! {...}
/// Test sleep OK!

#[no_mangle]
fn main() -> i32 {
    let current_time = get_time();
    assert!(current_time > 0);
    println!("get_time OK! {}", current_time);
    let wait_for = current_time + 3000;
    while get_time() < wait_for {
        yield_();
    }
    println!("Test sleep OK!");
    0
}
<filename>address_space/src/address_space.rs
// Copyright (c) 2020 Huawei Technologies Co.,Ltd. All rights reserved.
//
// StratoVirt is licensed under Mulan PSL v2.
// You can use this software accordin


eWithGeneric {   //TODO: 泛型的CompoundData

    override val objectData: CompoundData
        get() = MCFPPBaseType.Any.instanceData

    override val typeName: String
        get() = identifier

    fun toValue():MCTypeValue{
        return MCTypeValue(identifier,parentType)
    }

    override fun replaceGenericParam(type: Map<String, MCFPPType>): MCFPPType {
        if(type.size != 1) throw IllegalArgumentException("Need 1 generic param but get ${type.size}")
        if(type.containsKey(identifier)){
            return type[identifier]!!
        }else{
            throw IllegalArgumentException("No generic param $identifier")
        }
    }
}package top.mcfpp.type

import top.mcfpp.core.lang.ImmutableList
import top.mcfpp.core.lang.ImmutableListConcrete
import top.mcfpp.core.lang.Var
import top.mcfpp.core.lang.nbt.*
import top.mcfpp.mni.*
import top.mcfpp.model.compound.CompoundData
import top.mcfpp.nbt.tags.CompoundTag
import top.mcfpp.nbt.tags.Tag
import top.mcfpp.nbt.tags.collection.ByteArrayTag
import top.mcfpp.nbt.tags.collection.IntArrayTag
import top.mcfpp.nbt.tags.collection.ListTag
import top.mcfpp.nbt.tags.collection.LongArrayTag
import top.mcfpp.nbt.tags.primitive.DoubleTag
import top.mcfpp.nbt.tags.primitive.IntTag
import top.mcfpp.nbt.tags.primitive.LongTag

/**
 * 以NBT为底层的类型，包括普通的NBT类型，以及由nbt实现的map，list和dict
 */
class MCFPPNBTType {
    object NBT : MCFPPType(arrayListOf(MCFPPBaseType.Any)) {

        override val objectData by lazy {
            CompoundData("nbt","mcfpp").apply {
                extends(MCFPPBaseType.Any.instanceData)
                injectedBy(NBTBasedDataData::class.java)
            }
        }

        override val concreteInstanceData by lazy {
            CompoundData("nbt","mcfpp").apply {
                extends(MCFPPBaseType.Any.instanceData)
                injectedBy(NBTBasedDataConcreteData::class.java)
            }
        }

        override val typeName: String
            get() = "nbt"

        override fun defaultValue() = IntTag(0)

        override fun build(identifier: String, value: Any?): Var<*> = NBTBasedDataConcrete(value as Tag<*>, identifier)
        override fun buildUnConcrete(identifier: String): Var<*> = NBTBasedData(identifier)

    }

    object Byte: MCFPPType(arrayListOf(MCFPPBaseType.Int)){

        override val instanceData by lazy {
            CompoundData("byte","mcfpp").apply {
                extends(NBT.instanceData)
                injectedBy(MCByteData::class.java)
            }
        }

        override val concreteInstanceData by lazy {
            CompoundData("byte","mcfpp").apply {
                extends(NBT.instance


"):format(
                _.dana(speaker, 3),
                goldCost,
                _.da(speaker)
            )
        end,
        NoAmmo = function(speaker)
            return ("充填する必要はないみたい%s"):format(_.da(speaker))
        end,
    },

    Attack = {
        Choices = {
            Attack = "神に祈れ",
            GoBack = "いや、冗談です",
        },
        Dialog = function(speaker)
            return ("%s"):format(_.rob(speaker, 2))
        end,
    },

    Criminal = {
        Buy = function(speaker)
            return ("犯罪者に売る物はない%s"):format(_.yo(speaker))
        end,
        Sell = function(speaker)
            return ("犯罪者から買う物はない%s"):format(_.yo(speaker))
        end,
    },
}


				// Enable image specific ui components if the element is an image
					if (foundMarkup) { // TODO : this is always null (below is dead code, moving it to clickImage)
						plugin.ui._insertImageButton.show();
						plugin.ui.setScope();
						if (plugin.settings.ui.meta) {
							plugin.ui.imgSrcField.setTargetObject(foundMarkup, 'src');
							plugin.ui.imgTitleField.setTargetObject(foundMarkup, 'title');
						}
						plugin.ui.imgSrcField.foreground();
						plugin.ui.imgSrcField.focus();
					} else {
						if (plugin.settings.ui.meta) {
							plugin.ui.imgSrcField.setTargetObject(null);
						}
					}
					// TODO this should not be necessary here!
					plugin.ui.doLayout();
				}

			});

			Aloha.bind('aloha-editable-created', function (event, editable) {
				try {
					// this disables mozillas image resizing facilities
					document.execCommand('enableObjectResizing', false, false);
				} catch (e) {
					Aloha.Log.info(e, 'Could not disable enableObjectResizing');
					// this is just for other browsers, which do not support disabling enableObjectResizing
				}

				// Inital click on images will be handled here
				// editable.obj.find('img').attr('_moz_resizing', false);
				// editable.obj.find('img').contentEditable(false);

				editable.obj.delegate('img', 'mouseup', function (event) {
					if (!resizing) {
						plugin.clickImage(event);
						event.stopPropagation();
					}
				});
			});

			plugin._subscribeToResizeFieldEvents();

		},

		/**
		 * Automatically resize the image to fit into defined bounds.
		 * @param doScaleUp if true, small images are scaled up to fit minimum size
		 */
		autoResize: function(doScaleUp) {
			// @todo handle ratio mismatches (eg 4:3 is set but image is 16:9 --> image needs to be cut)

			var that = this;

			var widthField = jQuery("#" + that.ui.imgResizeWidthField.getInputId());
			var heightField = jQuery("#" + that.ui.imgResizeHeightField.getInputId());

			var width = that.imageObj.width();
			var height = that.imageObj.height();
			var resize = false;

			// Only normalize the field values if the image exceeds the defined bounds
			if (width < that.settings.minWidth ||
				width > that.settings.maxWidth ||
				height < that.settings.minHeight ||
				height > that.settings.maxHeight) {
				resize = true;
			}

			var aspectRatio = width / height;

			if (resize) {
				if (width > that.settings.maxWidth) {
					width = that.settings.maxWidth;
					height = width / aspectRatio;
				}

				if (height > that.settings.maxHeight) {
					height = that.settings.maxHeight;
					width = height * aspectRatio;
				}

				if ((width < that.settings.minWidth) && doScaleUp) {
					width = that.settings.minWidth;
					height = width / aspectRatio;
				}

				if ((height < that.settings.minHeight) && doScaleUp) {
					height = that.settings.minHeight;
					width = width * aspectRatio;
				}

				widthField.val(width);
				heightField.val(height);

				that.setSizeByFieldValue();
				return true;
			}
			return false;
		},

		/**
		 * Toggle the keep aspect ratio functionality
		 */
		toggleKeepAspectRatio: function() {

			this.keepAspectRatio = !this.keepAspectRatio;

			if (typeof this.jcAPI !== 'undefined' && this.jcAPI !== null) {
				//toggling keepaspectratio during crop is deactivated until implemented
				//this.ui._imageCnrRatioButton.setState(false);


statstemp(sum, ext, 0, 0, sumw, false, stable_algo) : fbstatstemp(sum, ext, 0, 0, w, false, stable_algo);
      result(2, _) = fbstatstemp(within, ext, 0, 0, w, false, stable_algo);
      result[2] /= result[1];
      if(weights) {
        result[4] = result[1];
        result[5] /= result[1];
      }
      if(setn) {
        Rf_dimnamesgets(result, List::create(CharacterVector::create("Overall","Between","Within"),
                                             get_stats_names(d, true)));
        Rf_classgets(result, CharacterVector::create("qsu","matrix","table"));
      }
      return(result);
    } else {
      if(g.size() != l) stop("length(g) must match nrow(X)");
      NumericVector between = no_init_vector(l);
      // bool groupids[ng][npg]; // could do +1 trick, but that could be costly in term of memory if few g and many pg
      LogicalMatrix groupids = no_init_matrix(ng, npg);
      // memset(groupids, true, sizeof(bool)*ng*npg); // works ? necessary ?
      std::fill(groupids.begin(), groupids.end(), true);
      NumericVector gnpids(ng); // best ?
      for(int i = 0; i != l; ++i) {
        if(std::isnan(x[i])) { // important ? right ?
          between[i] = within[i] = NA_REAL; // x[i] ?
        } else {
          if(groupids(g[i]-1, pg[i]-1)) { // added this part
            ++gnpids[g[i]-1];
            groupids(g[i]-1, pg[i]-1) = false;
          }
          between[i] = sum[pg[i]-1];
          within[i] = x[i] - between[i] + osum;
        }
      }
      if(array) {
        NumericMatrix result = no_init_matrix(d*ng, 3);
        result(_,0) = fbstatstemp(x, ext, ng, g, w, false, stable_algo);
        result(_,1) = replaceC12(as<NumericMatrix>(fbstatstemp(between, ext, ng, g, w, false, stable_algo)), gnpids); // how to do this ? -> above best approach ?
        result(_,2) = replaceC12(as<NumericMatrix>(fbstatstemp(within, ext, ng, g, w, false, stable_algo)), gnpids, true);
        if(setn) {
          Rf_dimgets(result, Dimension(ng, d, 3));
          Rf_dimnamesgets(result, List::create(gn, get_stats_names(d, true), CharacterVector::create("Overall","Between","Within")));
          Rf_classgets(result, CharacterVector::create("qsu","array","table"));
        }
        return(result);
      } else {
        List result(3); // option array ?
        result[0] = fbstatstemp(x, ext, ng, g, w, true, stable_algo, gn);
        result[1] = replaceC12(as<NumericMatrix>(fbstatstemp(between, ext, ng, g, w, true, stable_algo, gn)), gnpids); // how to do this ? -> above best approach ?
        result[2] = replaceC12(as<NumericMatrix>(fbstatstemp(within, ext, ng, g, w, true, stable_algo, gn)), gnpids, true);
        Rf_namesgets(result, CharacterVector::create("Overall","Between","Within"));
        return(result);
      }
    }
  }
}

// [[Rcpp::export]]
SEXP fbstatsmCpp(const NumericM


# Simplifies DIY InkHUD builds, with presets for several common E-Ink displays
# - build using custom task in Platformio's "Project Tasks" panel
# - build with `pio run -e <variant> -t build_weact_154` (or similar)

# Silence trunk's objections to the import statements
# trunk-ignore-all(ruff/F821)
# trunk-ignore-all(flake8/F821)

from SCons.Script import COMMAND_LINE_TARGETS

Import("env")
Import("projenv")

# Custom targets
# These wrappers just run the normal build task under a different target name
# We intercept the build later on, based on the target name
env.AddTarget(
    name="build_weact_154",
    dependencies=["buildprog"],
    actions=None,
    title='Build (WeAct 1.54")',
)
env.AddTarget(
    name="build_weact_213",
    dependencies=["buildprog"],
    actions=None,
    title='Build (WeAct 2.13")',
)
env.AddTarget(
    name="build_weact_290",
    dependencies=["buildprog"],
    actions=None,
    title='Build (WeAct 2.9")',
)
env.AddTarget(
    name="build_weact_420",
    dependencies=["buildprog"],
    actions=None,
    title='Build (WeAct 4.2")',
)

# Check whether a build was started via one of our custom targets above

if "build_weact_154" in COMMAND_LINE_TARGETS:
    print('Building for WeAct 1.54" Display')
    projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "ZJY200200_0154DAAMFGN"))
    projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15"))

elif "build_weact_213" in COMMAND_LINE_TARGETS:
    print('Building for WeAct 2.13" Display')
    projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "HINK_E0213A289"))
    projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "10"))

elif "build_weact_290" in COMMAND_LINE_TARGETS:
    print('Building for WeAct 2.9" Display')
    projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "ZJY128296_029EAAMFGN"))
    projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15"))

elif "build_weact_420" in COMMAND_LINE_TARGETS:
    print('Building for WeAct 4.2" Display')
    projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "HINK_E042A87"))
    projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15"))


 reducer format state
 */
export interface PostsState {
  readonly data: Post[];
  readonly loading: boolean;
  readonly error: boolean;
}
import view = require("ui/core/view");

export type PropertySetter = (instance: view.View, propertyValue: any) => void;

var specialProperties: Map<string, PropertySetter> = new Map<string, PropertySetter>();

function specialPropertyKey(name: string) {
    return name.toLowerCase();
}

export function registerSpecialProperty(name: string, setter: PropertySetter): void {
    let propertyKey = specialPropertyKey(name);
    if (specialProperties.has(propertyKey)) {
        throw new Error(`Property for ${propertyKey} already registered`);
    } else {
        specialProperties.set(propertyKey, setter);
    }
}

export function getSpecialPropertySetter(name: string): PropertySetter {
    let propertyKey = specialPropertyKey(name);
    return specialProperties.get(propertyKey);
}
//aula 12

//criar um tipo

type Todo = {
    title: string
    description: string
    completed: boolean
}

//criar um obj

const todo: Readonly<Todo> = {
    title: 'Assistir Dark de novo',
    description: 'Relembrar os detalhes',
    completed: false
}

console.log(todo)

//atualizar o todo para completo
//poderiamos fazer assim:

//todo.completed = true

console.log(todo)
//quando fazemos dessa forma estamos alterando diretamente o obj todo
//o podemos fazer para não alterar diretamente o nosso obj?
//o que podemos fazermos uma função que cria um novo objeto a partir do obj todo
//e usarmos um type utilities
//como não queremos alterar diretamente no obj, usamos o Readonly
//e ao fazermos isso todo.completed = true dará erro
//Não é possível atribuir a 'completed' porque é uma propriedade de somente leitura
//uma forma de fazemos a edição desse obj sem retornar esse erro
//é criando uma função que retorne um obj novo

function atualizarTodo(todo: Todo, camposAtualizar: Partial<Todo>) {
    //o retorno será um nobo obj
    //... é onde estamos pegando as propriedades do obj
    //separando elas uma a uma
    //é como se estivessimos criando obj passando propriedade um por um
    return {...todo, ...camposAtualizar}
}

const todo2: Todo = atualizarTodo(todo, { completed: true })

//o Partial deixa opcional os campos do Todo

console.log(todo2)
console.log(todo)

//pick
//digamos que eu só quero passar o title e o completed - lista

type TodoLista = Pick<Todo, 'title' | 'completed'>

const todo3: TodoLista = {
    title: 'alguma coisa',
    completed: false
}

//outra forma é utilizando o omit
//Omit, ele vai omitir o que vc não quer

type TodoLista2 = Omit<Todo, 'description'>

const todo4: TodoLista = {
    title: 'alguma coisa',
    completed: false
}

//quando eu devo utilizar o Pink ou Omit?
//vc deve pensar:
//eu quero pegar mais ou anular mais?
//se eu quiser anular mais: Pick
//se eu quiser pegar mais: Omit

//exemplo, se eu tivesse 5 propriedades
//e eu quer  4 delas, isso significa que eu quero pegar mais
//então eu uso o Omit
//agora se eu quiser pegar só 01, eu uso o Pick/*
Copyright 2022 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITION


 outer border where things don't work quite right.
    print('bounds = ',image.bounds)
    image = image.subImage(galsim.BoundsI(1+nborder,nx+nborder,1+nborder,ny+nborder))
    print('bounds => ',image.bounds)
    image.setOrigin(1,1)
    print('bounds => ',image.bounds)

    t4 = time.time()
    print('Total time to make flat image with level {} = {}'.format(counts_total, t4-t1))

    image.write('flat{:02d}.fits'.format(n))

t5 = time.time()
print('Total time to make {} flat images = {}'.format(nflats, t5-t0))


  CALL R31 2 1
  SETTABLEKS R31 R30 K71 ["&Pill"]
  CALL R28 2 1
  SETTABLE R28 R26 R27
  GETTABLEKS R27 R6 K72 ["StyledDialog"]
  GETTABLEKS R29 R4 K73 ["Dictionary"]
  GETTABLEKS R28 R29 K27 ["join"]
  MOVE R29 R3
  LOADK R30 K72 ["StyledDialog"]
  CALL R29 1 1
  NEWTABLE R30 2 0
  DUPTABLE R31 K77 [{"Font", "ButtonPadding", "ContentPadding", "ButtonHorizontalAlignment"}]
  GETIMPORT R32 K38 [Enum.Font.SourceSans]
  SETTABLEKS R32 R31 K34 ["Font"]
  LOADN R32 24
  SETTABLEKS R32 R31 K74 ["ButtonPadding"]
  LOADN R32 0
  SETTABLEKS R32 R31 K75 ["ContentPadding"]
  GETIMPORT R32 K79 [Enum.HorizontalAlignment.Center]
  SETTABLEKS R32 R31 K76 ["ButtonHorizontalAlignment"]
  SETTABLEKS R31 R30 K80 ["&CancelDialog"]
  DUPTABLE R31 K77 [{"Font", "ButtonPadding", "ContentPadding", "ButtonHorizontalAlignment"}]
  GETIMPORT R32 K38 [Enum.Font.SourceSans]
  SETTABLEKS R32 R31 K34 ["Font"]
  LOADN R32 24
  SETTABLEKS R32 R31 K74 ["ButtonPadding"]
  LOADN R32 0
  SETTABLEKS R32 R31 K75 ["ContentPadding"]
  GETIMPORT R32 K79 [Enum.HorizontalAlignment.Center]
  SETTABLEKS R32 R31 K76 ["ButtonHorizontalAlignment"]
  SETTABLEKS R31 R30 K81 ["&EnableTeamCreateDialog"]
  CALL R28 2 1
  SETTABLE R28 R26 R27
  GETTABLEKS R27 R6 K82 ["DropdownMenu"]
  GETTABLEKS R29 R4 K73 ["Dictionary"]
  GETTABLEKS R28 R29 K27 ["join"]
  MOVE R29 R3
  LOADK R30 K82 ["DropdownMenu"]
  CALL R29 1 1
  NEWTABLE R30 1 0
  DUPTABLE R31 K85 [{"Offset", "BackgroundColor"}]
  GETIMPORT R32 K88 [Vector2.new]
  LOADN R33 244
  LOADN R34 0
  CALL R32 2 1
  SETTABLEKS R32 R31 K83 ["Offset"]
  JUMPIFNOT R22 [+3]
  GETTABLEKS R32 R18 K89 ["MainBackground"]
  JUMP [+1]
  LOADNIL R32
  SETTABLEKS R32 R31 K84 ["BackgroundColor"]
  SETTABLEKS R31 R30 K90 ["&Search"]
  CALL R28 2 1
  SETTABLE R28 R26 R27
  GETTABLEKS R27 R18 K89 ["MainBackground"]
  SETTABLEKS R27 R26 K91 ["backgroundColor"]
  DUPTABLE R27 K95 [{"Subtitle", "Normal", "Subtext"}]
  DUPTABLE R28 K97 [{"Font", "TextSize", "TextColor3"}]
  SETTABLEKS R24 R28 K34 ["Font"]
  LOADN R29 22
  SETTABLEKS R29 R28 K63 ["TextSize"]
  GETTABLEKS R29 R18 K98 ["SubText"]
  SETTABLEKS R29 R28 K96 ["TextColor3"]
  SETTABLEKS R28 R27 K92 ["Subtitle"]
  DUPTABLE R28 K97 [{"Font", "TextSize", "TextColor3"}]
  SETTABLEKS R24 R28 K34 ["Font"]
  LOADN R29 20
  SETTABLEKS R29 R28 K63 ["TextSize"]
  GETTABLEKS R29 R18 K59 ["TitlebarText"]
  SETTABLEKS R29 R28 K96 ["TextColor3"]
  SETTABLEKS R28 R27 K93 ["Normal"]
  DUPTABLE R28 K97 [{"Font",


-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:ye("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec


omain.items.chapter.model.NoChaptersException
import tachiyomi.domain.library.manga.LibraryManga
import tachiyomi.domain.library.service.LibraryPreferences
import tachiyomi.domain.library.service.LibraryPreferences.Companion.DEVICE_CHARGING
import tachiyomi.domain.library.service.LibraryPreferences.Companion.DEVICE_NETWORK_NOT_METERED
import tachiyomi.domain.library.service.LibraryPreferences.Companion.DEVICE_ONLY_ON_WIFI
import tachiyomi.domain.library.service.LibraryPreferences.Companion.ENTRY_HAS_UNVIEWED
import tachiyomi.domain.library.service.LibraryPreferences.Companion.ENTRY_NON_COMPLETED
import tachiyomi.domain.library.service.LibraryPreferences.Companion.ENTRY_NON_VIEWED
import tachiyomi.domain.library.service.LibraryPreferences.Companion.ENTRY_OUTSIDE_RELEASE_PERIOD
import tachiyomi.domain.source.manga.model.SourceNotInstalledException
import tachiyomi.domain.source.manga.service.MangaSourceManager
import tachiyomi.i18n.MR
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.io.File
import java.time.Instant
import java.time.ZonedDateTime
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicInteger

class MangaLibraryUpdateJob(private val context: Context, workerParams: WorkerParameters) :
    CoroutineWorker(context, workerParams) {

    private val sourceManager: MangaSourceManager = Injekt.get()
    private val libraryPreferences: LibraryPreferences = Injekt.get()
    private val downloadManager: MangaDownloadManager = Injekt.get()
    private val coverCache: MangaCoverCache = Injekt.get()
    private val getLibraryManga: GetLibraryManga = Injekt.get()
    private val getManga: GetManga = Injekt.get()
    private val updateManga: UpdateManga = Injekt.get()
    private val syncChaptersWithSource: SyncChaptersWithSource = Injekt.get()
    private val mangaFetchInterval: MangaFetchInterval = Injekt.get()
    private val filterChaptersForDownload: FilterChaptersForDownload = Injekt.get()

    private val notifier = MangaLibraryUpdateNotifier(context)

    private var mangaToUpdate: List<LibraryManga> = mutableListOf()

    override suspend fun doWork(): Result {
        if (tags.contains(WORK_NAME_AUTO)) {
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
                val preferences = Injekt.get<LibraryPreferences>()
                val restrictions = preferences.autoUpdateDeviceRestrictions().get()
                if ((DEVICE_ONLY_ON_WIFI in restrictions) && !context.isConnectedToWifi()) {
                    return Result.retry()
                }
            }

            // Find a running manual worker. If exists, try again later
            if (context.workManager.isRunning(WORK_NAME_MANUAL)) {
                return Result.retry()
            }
        }

        try {
            setForeground(getForegroundInfo())
        } catch (e: IllegalStateException) {
            logcat(LogPriority.ERROR, e) { "Not allowed to set foreground job" }
        }

        libraryPreferences.lastUpdatedTimestamp().set(Instant.now().toEpochMilli())

        val categoryId = inputData.getLong(KEY_CATEGORY, -1L)
        addMangaToQueue(categoryId)

        return withIOContext {
            try {
                updateChapterList()
                Result


2F134C
	ldr r0, [r2]
	ldr r1, _022F153C ; =ov11_02320CD8
	bl GroundBg_Init
	ldr r0, _022F1538 ; =GROUND_STATE_MAP
	mvn r1, #0
	ldr r0, [r0]
	bl ov11_022EC27C
	ldr r0, _022F1538 ; =GROUND_STATE_MAP
	ldmia r0, {r1, r2}
	add r0, r2, #4
	bl ov11_022EFD5C
	ldr r0, _022F1538 ; =GROUND_STATE_MAP
	ldr r1, [r0, #4]
	add r0, r1, #0x20
	add r1, r1, #4
	bl ov11_022F03C4
	b _022F14E8
_022F134C:
	mov r0, #0xc
	smulbb r3, r5, r0
	ldr r4, _022F1540 ; =EVENTS
	ldrsh r0, [r4, r3]
	add r4, r4, r3
	add r0, r0, #1
	cmp r0, #0xc
	addls pc, pc, r0, lsl #2
	b _022F146C
_022F1370: ; jump table
	b _022F1444 ; case 0
	b _022F146C ; case 1
	b _022F146C ; case 2
	b _022F146C ; case 3
	b _022F146C ; case 4
	b _022F146C ; case 5
	b _022F13A4 ; case 6
	b _022F13A4 ; case 7
	b _022F13A4 ; case 8
	b _022F13A4 ; case 9
	b _022F13A4 ; case 10
	b _022F13C4 ; case 11
	b _022F13C4 ; case 12
_022F13A4:
	ldr r0, [r2]
	ldr r1, _022F1544 ; =ov11_02320CF4
	bl GroundBg_Init
	mov r0, #0
	bl ov11_022EF53C
	mov r0, #2
	bl ov11_022F22F4
	b _022F148C
_022F13C4:
	ldr r6, _022F1548 ; =LEVEL_TILEMAP_LIST
	b _022F1414
_022F13CC:
	cmp r0, r5
	bne _022F1410
	ldr r0, _022F1538 ; =GROUND_STATE_MAP
	ldr r0, [r0]
	bl MemFree
	ldrsh r1, [r4]
	ldr r0, _022F1538 ; =GROUND_STATE_MAP
	mov r3, #0
	str r3, [r0]
	cmp r1, #0xb
	moveq r3, #1
	ldr r2, [r6, #4]
	mov r0, r5
	add r1, r6, #2
	and r3, r3, #0xff
	bl GetSpecialLayoutBackground
	b _022F152C
_022F1410:
	add r6, r6, #8
_022F1414:
	ldrsh r0, [r6]
	cmp r0, r1
	bne _022F13CC
	ldr r0, _022F1538 ; =GROUND_STATE_MAP
	ldr r1, _022F154C ; =ov11_02320D10
	ldr r0, [r0]
	bl GroundBg_Init
	mov r0, #0
	bl ov11_022EF53C
	mov r0, #1
	bl ov11_022F22F4
	b _022F148C
_022F1444:
	ldr r0, _022F1550 ; =ov11_02320CA8
	ldrsh r3, [r4]


PSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTcwcHgiIGhlaWdodD0iMTI3cHgiIHZpZXdCb3g9IjAgMCAxNzAgMTI3IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxNzAgMTI3IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGQ9Ik0wLDEyN1YzYzAtMS42NSwxLjM1LTMsMy0zaDE2NGMxLjY1LDAsMywxLjM1LDMsM3YxMjQiLz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjwvc3ZnPg0K');
      -webkit-mask-box-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjQsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTcwcHgiIGhlaWdodD0iMTI3cHgiIHZpZXdCb3g9IjAgMCAxNzAgMTI3IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxNzAgMTI3IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGQ9Ik0wLDEyN1YzYzAtMS42NSwxLjM1LTMsMy0zaDE2NGMxLjY1LDAsMywxLjM1LDMsM3YxMjQiLz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjwvc3ZnPg0K');
    }

      /* User stream options */
      .gi-webrtc .gi-user .gi-stream-wrapper .gi-overlay {
        visibility: hidden;
        position: absolute;
        margin: 6px;
        padding: 6px 0 1px;
        z-index: 1;
        background: rgba(0,0,0,.1);
        border-radius: 3px;
        box-shadow: 0 1px 2px rgba(0,0,0,.2);
        transition: all .1s linear;
      }

        .gi-webrtc .gi-user.gi-streaming .gi-stream-wrapper .gi-ove


 ldc %dx
    dex %cx
.mloop:
    lda *%gi
    cmp %ax $10
    jme .mfill
    cmp %ax $F0
    jme .mend
    int $C
    inx %si
    inx %gi
    jmp .mloop
.mend:
    lda %gi
    pop %gi
    pop %si
    add %si 340
    push %si
    push %gi
    loop .mloop
    pop %gi
    ldg %ax
    inx %gi
    jmp .bloop

.mfill:
    add %si %bx
    inx %gi
    jmp .mloop

.end:
    pop %ax
    ret

taskbar:
    pop %bp
    lds 58480
    lda 7
    ldc 340
.floop:
    int $C
    inx %si
    loop .floop
    lda 15
    ldc 340
.sloop:
    int $C
    inx %si
    loop .sloop
    lda 7
    ldc 5440
.tloop:
    int $C
    inx %si
    loop .tloop
    push %bp
ret


Dear Fravia,

I enjoy visiting and exploring your web pages, and thus I have to start

this message by expressing my gratitude for your efforts.

A few years back I used to "crack" software games so that I could play

them and impress my friends (lame, I know). My favourite technique for

bypassing protection and adding functionality would be to write a

program loader that would rewrite sections of code in memory and/or

redirect calls to ones of my own design. As a very inquisitive teenager

I always wanted to improve my knowledge of how things work. Cracking

was one of my first steps into reverse engineering (something I

inherited from both my parents - reversing for knowledge and REALITY),

and it provided impetus for learning Assembly, source level debugging

(still VERY useful) high level languages, and many other disciplines I

will not bore you with - for I am sure you know what I mean.

What I am trying to get at is that software cracking has a place in the

global scope of reverse engineering; although I would prefer to see

protection essays in the line of:

<essay>

Introduction to the type of protection.

Reason why this protection is insecure (e.g. Old style Doc checks -

setting si=di defeats the protection)

Reference sample protection code - Not real apps

/* this could be in Asm, HLL, Pseudo code etc. Showing that the cracker

has reversed the protection - not only found a way past it (*1) */

Tips and tricks on spotting this type of protection, and common ways of

defeating it, thus the aim moves from bypassing protection to actually

understanding them.

Some reference samples e.g.

This type of protection can be found in "Appname1, Appname2, etc.

<\essay>

If the person reading the essay really wants to crack a specific

application, they can spend the time learning how it works as opposed

to how to make it not work.

*1 - Most protected applications are very silly in their assumptions,

for instance years back I encountered a game (Dark queen of krynn or

Lands of lore, I can't recall which one) that encrypted the doc

checking code with a silly XOR cipher or something similarly stupid.

Now I could have analyzed the cipher and worked on cracking the key and

algorithm. OR I could have (and I did :-) trace to a point in the code

where the checking code was deciphered and THEN patch the checking

code. Therefore even if the programmers employed the toughest

encryption and used the longest random key possible (very long :-) and

it took 10^10^80 years (VERY, VERY long time) to brute force the key,

the protection would still be weak and I think people should know why a

protection fails even when built with tried and tested methods,

analogy: A house built from the toughest bricks will not outlast the

storm


 arguments; // set stack offset
        pV = SStack.Read(s_off, 0);
        if (!pV)
        {
            SetError(INVALID_FA);
            break;
        }
        pV->Get(pChar);
        if (arguments > 1)
        {
            CreateMessage(&ms, s_off, 1);
            ms.Move2Start();
            ProcessEvent(pChar, &ms);
        }
        else
            ProcessEvent(pChar);
        for (n = 0; n < arguments; n++)
        {
            SStack.Pop();
        }
        // set stack pointer to correct position (vars in stack remain valid)
        break;
    case FUNC_POSTEVENT:
        MESSAGE *pMS;
        S_EVENTMSG *pEM;
        s_off = SStack.GetDataNum() - arguments; // set stack offset
        pV = SStack.Read(s_off, 0);
        if (!pV)
        {
            SetError(INVALID_FA);
            break;
        }
        pV->Get(pChar);
        pV = SStack.Read(s_off, 1);
        if (!pV)
        {
            SetError(INVALID_FA);
            break;
        }
        pV->Get(TempLong1);
        if (arguments >= 4) // event w/o message
        {
            pMS = new MESSAGE();
            CreateMessage(pMS, s_off, 2);
            pMS->Move2Start();
        }
        else
            pMS = nullptr;

        pEM = new S_EVENTMSG(pChar, pMS, TempLong1);
        EventMsg.Add(pEM);
        for (n = 0; n < arguments; n++)
        {
            SStack.Pop();
        }
        break;
    case FUNC_SEND_MESSAGE: {
        s_off = SStack.GetDataNum() - arguments; // set stack offset

        pV = SStack.Read(s_off, 0);
        if (!pV)
        {
            SetError(INVALID_FA);
            break;
        }
        pV->Get(ent);

        CreateMessage(&ms, s_off, 1);

        uint64_t mresult = 0;
        pE = core.GetEntityPointerSafe(ent);
        if (pE)
        {
            ms.Move2Start();
            mresult = pE->ProcessMessage(ms);
        }
        for (n = 0; n < arguments; n++)
        {
            SStack.Pop();
        }
        // set stack pointer to correct position (vars in stack remain valid)

        pV = SStack.Push();
        pV->SetPtr(mresult); // SendMessage returns uint64_t, could be truncated to 32
        pVResult = pV;

        return pV;
        // break;
    }
    case FUNC_TRACE:
        pV = SStack.Pop();
        if (!pV)
        {
            SetError(INVALID_FA);
            break;
        }
        pV->RefConvert();
        pV->Convert(VAR_STRING);
        pV->Get(pChar);
#ifndef _TOFF
        DTrace(pChar);
#endif
        break;
    case FUNC_STI:
    case FUNC_MAKE_INT:
        pV = SStack.Pop();
        if (!pV)
        {
            SetError(INVALID_FA);
            break;
        }
        pV->Convert(VAR_INTEGER);
        pV->Get(TempLong1);
        pV = SStack.Push();
        pV->Set(TempLong1);
        pVResult = pV;
        return pV;
    case FUNC_STF:
    case FUNC_MAKE_FLOAT:
        pV = SStack.Pop();
        if (!pV)
        {
            SetError(INVALID_FA);
            break;
        }
        pV->Convert(VAR_FLOAT);
        pV->Get(TempFloat1);
        pV = SStack.Push();
        pV->Set(TempFloat1);
        pVResult = pV;
        return pV;
    case FUNC_FTS:
        pV2 = SStack.Pop();


@Serializable
	data class AdditionalMediaInfo(
		val monetizable: Boolean,
		val title: String? = null,
		val description: String? = null,
		val embeddable: Boolean = false, // TODO correct default?
	)

	@Serializable
	data class MediaVideoInfo(
		val aspect_ratio: List<String>, // TODO Pair<String, String>?
		val variants: List<MediaVideoVariant>,
		val duration_millis: UInt? = null,
	)

	@Serializable
	data class MediaVideoVariant(
		val bitrate: UInt? = null,
		val content_type: String,
		val url: String,
	)

	@Serializable
	data class MediaSizes(
		val small: MediaSize,
		val medium: MediaSize,
		val large: MediaSize,
		val thumb: MediaSize,
	)

	@Serializable
	data class MediaSize(
		val w: UInt,
		val h: UInt,
		val resize: MediaResize,
	)

	@Serializable
	enum class MediaResize {
		@SerialName("fit") Fit,
		@SerialName("crop") Crop,
	}

	@Serializable
	enum class MediaType {
		@SerialName("photo") Photo,
		@SerialName("video") Video,
		@SerialName("animated_gif") AnimatedGif,
	}

	@Serializable
	data class UserMentionEntity(
		val name: String,
		val screen_name: String,
		@Serializable(TwoStringArrayIntRangeSerializer::class)
		val indices: IntRange,
		val id_str: String,
		val id: String,
	)

	@Serializable
	data class UrlEntity(
		val url: String,
		val expanded_url: String,
		val display_url: String,
		@Serializable(TwoStringArrayIntRangeSerializer::class)
		val indices: IntRange,
	)
}

private object TwitterTimestampSerializer : KSerializer<Instant> {
	private val formatter = DateTimeFormatter.ofPattern("EEE MMM dd HH:mm:ss ZZ yyyy", Locale.US)
	override val descriptor = PrimitiveSerialDescriptor("twitter_timestamp", STRING)

	override fun deserialize(decoder: Decoder): Instant {
		val string = decoder.decodeString()
		return OffsetDateTime.parse(string, formatter).toInstant()
	}

	override fun serialize(encoder: Encoder, value: Instant) {
		throw AssertionError()
	}
}

private object TwoStringArrayIntRangeSerializer : KSerializer<IntRange> {
	private val delegate = ListSerializer(String.serializer())
	override val descriptor get() = delegate.descriptor

	override fun deserialize(decoder: Decoder): IntRange {
		val items = delegate.deserialize(decoder)
		check(items.size == 2) { items.toString() }
		return items[0].toInt()..items[1].toInt()
	}

	override fun serialize(encoder: Encoder, value: IntRange) {
		throw AssertionError()
	}
}
package kotterknife

import android.app.Activity
import android.app.Dialog
import android.app.DialogFragment
import android.app.Fragment
import android.support.v7.widget.RecyclerView.ViewHolder
import android.view.View
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
import android.support.v4.app.DialogFragment as SupportDialogFragment
import android.support.v4.app.Fragment as SupportFragment

public fun <V : View> View.bindView(id: Int)
    : ReadOnlyProperty<View, V> = required(id, viewFinder)
public fun <V : View> Activity.bindView(id: Int)
    : ReadOnlyProperty<Activity, V> = required(id, viewFinder)
public fun <V : View> Dialog.bindView(id: Int)
    : ReadOnlyProperty<Dialog, V> = required(id, viewFinder)
public fun <V : View> DialogFragment.bindView(id: Int)


/**
 * @file static_strings.h
 * @author Ambroz Bizjak <ambrop7@gmail.com>
 *
 * @section LICENSE
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. 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.
 * 3. Neither the name of the author 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 AUTHOR 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.
 */

#ifndef BADVPN_STATIC_STRINGS_H
#define BADVPN_STATIC_STRINGS_H

// NOTE: keep synchronized with NCDStringIndex.c
enum {
    NCD_STRING_EMPTY,
    NCD_STRING_ARGS,
    NCD_STRING_ARG0,
    NCD_STRING_ARG1,
    NCD_STRING_ARG2,
    NCD_STRING_ARG3,
    NCD_STRING_ARG4,
    NCD_STRING_ARG5,
    NCD_STRING_ARG6,
    NCD_STRING_ARG7,
    NCD_STRING_ARG8,
    NCD_STRING_ARG9,
    NCD_STRING_ARG10,
    NCD_STRING_ARG11,
    NCD_STRING_ARG12,
    NCD_STRING_ARG13,
    NCD_STRING_ARG14,
    NCD_STRING_ARG15,
    NCD_STRING_ARG16,
    NCD_STRING_ARG17,
    NCD_STRING_ARG18,
    NCD_STRING_ARG19,
    NCD_STRING_TRUE,
    NCD_STRING_FALSE,
    NCD_STRING_NONE,
    NCD_STRING_CALLER,
    NCD_STRING_SUCCEEDED,
    NCD_STRING_IS_ERROR,
    NCD_STRING_NOT_EOF,
    NCD_STRING_LENGTH,
    NCD_STRING_TYPE,
    NCD_STRING_EXIT_STATUS,
    NCD_STRING_SIZE,
    NCD_STRING_EOF,
    NCD_STRING_SCOPE,
};

#endif


import pytest

from onetl.file.filter import Glob
from onetl.impl import RemoteDirectory, RemoteFile, RemotePathStat

def test_glob_invalid():
    with pytest.raises(ValueError, match="Invalid glob: 'something'"):
        Glob("something")

@pytest.mark.parametrize(
    "matched, path",
    [
        (True, RemoteFile(path="file1.csv", stats=RemotePathStat(st_size=10 * 1024, st_mtime=50))),
        (True, RemoteFile(path="nested/file3.csv", stats=RemotePathStat(st_size=20 * 1024, st_mtime=50))),
        (False, RemoteFile(path="/absolute/file4.txt", stats=RemotePathStat(st_size=30 * 1024, st_mtime=50))),
        (False, RemoteFile(path="no_ext", stats=RemotePathStat(st_size=40 * 1024, st_mtime=50))),
        (True, RemoteDirectory("some")),
        (True, RemoteDirectory("some.csv")),
        (True, RemoteDirectory("some.txt")),
        (True, RemoteDirectory("/absolute/some")),
        (True, RemoteDirectory("/absolute/some.csv")),
        (True, RemoteDirectory("/absolute/some.txt")),
    ],
)
def test_glob_match(matched, path):
    file_filter = Glob("*.csv")

    assert file_filter.match(path) == matched


Pid, User) ->
    RUser = riakc_obj:new(?USER_BUCKET,
                          list_to_binary(User#user.user_name),
                          User),
    riakc_pb_socket:put(ClientPid, RUser).

get_user(ClientPid, UserName) ->
    {ok, RUser} = riakc_pb_socket:get(ClientPid,
                                      ?USER_BUCKET,
                                      list_to_binary(UserName)),
    binary_to_term(riakc_obj:get_value(RUser)).
```

<br />

```erlang
%% msg_repository.erl

-module(msg_repository).
-export([create_msg/3,
         get_msg/2]).
-include("msgy.hrl").

-spec create_msg(user_name(), user_name(), text()) -> msg().
create_msg(Sender, Recipient, Text) ->
    #msg{sender=Sender,
         recipient=Recipient,
         created=get_current_iso_timestamp(),
         text = Text}.

-spec get_msg(pid(), riakc_obj:key()) -> msg().
get_msg(ClientPid, MsgKey) ->
    {ok, RMsg} = riakc_pb_socket:get(ClientPid,
                                     ?MSG_BUCKET,
                                     MsgKey),
    binary_to_term(riakc_obj:get_value(RMsg)).

%% @private
-spec get_current_iso_timestamp() -> datetimestamp().
get_current_iso_timestamp() ->
    {_,_,MicroSec} = DateTime = erlang:now(),
    {{Year,Month,Day},{Hour,Min,Sec}} = calendar:now_to_universal_time(DateTime),
    lists:flatten(
        io_lib:format("~4..0B-~2..0B-~2..0BT~2..0B:~2..0B:~2..0B.~6..0B",
            [Year, Month, Day, Hour, Min, Sec, MicroSec])).

```

<br />

```erlang
%% timeline_repository.erl

-module(timeline_repository).
-export([post_msg/2,
         get_timeline/4]).
-include("msgy.hrl").

post_msg(ClientPid, Msg) ->
     %% Save the canonical copy
    SavedMsg = save_msg(ClientPid, Msg),
    MsgKey = binary_to_list(riakc_obj:key(SavedMsg)),

    %% Post to sender's Sent timeline
    add_to_timeline(ClientPid, Msg, sent, MsgKey),

    %% Post to recipient's Inbox timeline
    add_to_timeline(ClientPid, Msg, inbox, MsgKey),
    ok.

get_timeline(ClientPid, Owner, MsgType, Date) ->
    TimelineKey = generate_key(Owner, MsgType, Date),
    {ok, RTimeline} = riakc_pb_socket:get(ClientPid,
                                          ?TIMELINE_BUCKET,
                                          list_to_binary(TimelineKey)),
    binary_to_term(riakc_obj:get_value(RTimeline)).

%% --------------------------------------------------------------------

%% @private
save_msg(ClientPid, Msg) ->
    MsgKey = Msg#msg.sender ++ "_" ++ Msg#msg.created,
    ExistingMsg = riakc_pb_socket:get(ClientPid,
                                      ?MSG_BUCKET,
                                      list_to_binary(MsgKey)),
    SavedMsg = case ExistingMsg of
        {error, notfound} ->
            NewMsg = riakc_obj:new(?MSG_BUCKET, list_to_binary(MsgKey), Msg),
            {ok, NewSaved} = riakc_pb_socket:put(ClientPid,
                                                 NewMsg,
                                                 [if_


 System.currentTimeMillis(), parts[4].toIntOrNull() ?: 0, parts[5].toIntOrNull() ?: 0xFFFFFFFF.toInt()) // Формат с цветом
                        7 -> Card(
                            parts[0],
                            parts[1],
                            parts[2],
                            parts[3].toLongOrNull() ?: System.currentTimeMillis(),
                            parts[4].toIntOrNull() ?: 0, // usageCount
                            parts[5].toIntOrNull() ?: 0xFFFFFFFF.toInt(), // color
                            parts[6].takeIf { it.isNotBlank() } // coverAsset
                        )
                        else -> null
                    }
                }.sortedWith(getSortComparator(currentSortType))
            }

            val scanCardLauncher = rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
                if (result.resultCode == RESULT_OK) {
                    loadCards()
                }
            }

            val cardDetailLauncher = rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
                if (result.resultCode == RESULT_OK) {
                    loadCards()
                }
            }

            val launcher = rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) {
                isDark = loadThemePref(context)
                loadCards()
            }

            // Функция обновления частоты использования карты
            fun updateCardUsage(cardName: String) {
                val prefs = getSharedPreferences("cards", Context.MODE_PRIVATE)
                val cardSet = prefs.getStringSet("card_list", setOf())?.toMutableSet() ?: mutableSetOf()

                val updatedCardSet = cardSet.map { cardString ->
                    val parts = cardString.split("|")
                    if (parts[0] == cardName) {
                        when (parts.size) {
                            2 -> "${parts[0]}|${parts[1]}|barcode|${System.currentTimeMillis()}|1|${0xFFFFFFFF.toInt()}"
                            3 -> "${parts[0]}|${parts[1]}|${parts[2]}|${System.currentTimeMillis()}|1|${0xFFFFFFFF.toInt()}"
                            5 -> "${parts[0]}|${parts[1]}|${parts[2]}|${parts[3]}|${(parts[4].toIntOrNull() ?: 0) + 1}|${0xFFFFFFFF.toInt()}"
                            6 -> "${parts[0]}|${parts[1]}|${parts[2]}|${parts[3]}|${(parts[4].toIntOrNull() ?: 0) + 1}|${parts[5]}"
                            7 -> "${parts[0]}|${parts[1]}|${parts[2]}|${parts[3]}|${(parts[4].toIntOrNull() ?: 0) + 1}|${parts[5]}|${parts[6]}"
                            else -> cardString
                        }
                    } else {
                        cardString
                    }
                }.toSet()

                prefs.edit { putStringSet("card_list", updatedCardSet) }
                loadCards()
            }

            LaunchedEffect(isDark) {
                val window = this@MainActivity.window
                WindowCompat.getInsetsController(window, window.decorView).isAppearanceLightStatusBars = !isDark
            }

            LaunchedEffect(Unit) {
                isDark = loadThemePref(context)
                loadCards()
            }

            SeaCardTheme(darkTheme = isDark) {
                if (showCoverPicker) {
                    CardCoverPickerScreen(
                        onCoverSelected = { coverAsset: String? ->
                            showCoverPicker = false
                            pendingCoverAsset = coverAsset
                            val intent = Intent(this@MainActivity, ScanCardActivity::class.java)
                            if (coverAsset != null) intent.putExtra("cover_asset", coverAsset as String)
                            scanCardLauncher.launch(intent)
                        },
                        onBack = {
                            showCoverPicker = false
                        }
                    )


            },
                {
                    (torch.float16, torch.float16): [
                        ...
                    ]
                },
                ...
            ]

        Return:
            param到具体的梯度缓冲区的映射。
        """
        param_gbuf_map = {}
        for gbuf_index, gbuf_range_map in enumerate(gbuf_ranges):
            for dtype, gbuf_range_map_for_all_buckets in gbuf_range_map.items():
                for bucket_index, gbuf_range_map in enumerate(gbuf_range_map_for_all_buckets):
                    for param, _ in gbuf_range_map["param_map"].items():
                        assert (
                            param not in param_gbuf_map
                        ), "Param should not be in param_gbuf_map; each param only belongs to a single bucket"
                        param_gbuf_map[param] = (gbuf_index, dtype, bucket_index)
        return param_gbuf_map

    @classmethod
    def _build_optimizer_group_ranges(cls, param_groups: List[Dict], gbuf_ranges: List[Dict]):
        """
        Create optimizer groups.

        Given the set of parameter shard ranges that are owned by the current
        data-parallel (DP) rank, gather the set of parameters that will be
        used (in the method below) to create the current DP's optimizer
        groups.

        gbuf_ranges有当前dp rank下所包含的参数的信息（作为key）

        Return:
        group_ranges = []
        group_ranges[0] = {
            "params": ,  # 这个group下的参数
            "orig_group": ,  # 原始完整的optim参数组，包含所有dp rank的参数，即self.optimizer.param_groups[group_index]
            "orig_group_idx": ,  # 原始optim参数组的id
        }
        """

        # Param group map.
        # World param group map.
        # - Store a mapping of <model_parameter:group_index> for all parameters
        #   across all DP ranks. This is necessary because it is our first
        #   cross reference between the DDP mappings and the optimizer group
        #   parameters. This mapping only for use in the next step of building
        #   the local mapping over this DP rank's parameters.
        world_param_group_map = {}
        for group_index, group in enumerate(param_groups):
            for param in group["params"]:
                assert param.requires_grad
                world_param_group_map[param] = group_index

        # Optimizer group ranges & param-group mapping.
        # - Build a mapping from groups to their contained parameters, and also
        #   from parameters to their containing group index and order within
        #   the group. The group index and order are particularly important for
        #   saving and loading checkpoints.
        local_param_group_map = {}  # 某个dp rank下的新的param group，参数 -> 所处的组id和组内顺序
        group_ranges = [{"params": []} for _ in param_groups]  # 某个dp rank所包含的参数组，其中的参数还没有进行shard
        for gbuf_range_map in gbuf_ranges:
            for dtype, gbuf_range_map_for_all_buckets in gbuf_range_map.items():
                for gbuf_range_map in gbuf_range_map_for_all_buckets:
                    for param in gbuf_range_map["param_map"]:
                        group_index = world_param_group_map[param]
                        group_range = group_ranges[group_index]
                        group_range["params"].append(param)
                        local_param_group_map[param] = (group_index, len(group_range["params"]) - 1)

        # Squeeze zero-size group ranges.
        for group_index, group_range in enumerate(group_ranges):
            group_range["orig_group"] = param_groups[group_index]  # 原始完整的optim参数组，包含所有dp rank的参数
            group_range["orig_group_idx"] = group_index

        return local_param_group_map, group_ranges

    @classmethod
    def _build_model_and_main_param_groups(
        cls,
        gbuf_ranges: List[Dict],
        param_gbuf_map: Dict[torch.nn.Parameter, Tuple],
        opt_group_ranges: List,
        model_param_to_bucket_map: Dict[torch.nn.Parameter, Bucket],
        optim_config: OptimizerConfig,
    ):
        """
        Create main parameter groups needed for the optimizer step.

        These groups encompass both: 1) groups used by this class, for
        reducing/gather, and 2) groups used by the inner optimizer for the
        parameter update. Given that the conceptual grad buffer partitioning
        (created in earlier method) doesn't respect parameter boundaries,
        the optimizer operates on shards of the model parameters, rather than
        the full


x7F) << shift
				if b < 0x80 {
					break
				}
			}
			postIndex := iNdEx + msglen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Allocations = append(m.Allocations, Allocation{})
			if err := m.Allocations[len(m.Allocations)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			var sizeOfWire int
			for {
				sizeOfWire++
				wire >>= 7
				if wire == 0 {
					break
				}
			}
			iNdEx -= sizeOfWire
			skippy, err := skipOrder(data[iNdEx:])
			if err != nil {
				return err
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}
	if hasFields[0]&uint64(0x00000001) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("client_guid")
	}
	if hasFields[0]&uint64(0x00000002) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("order_id")
	}
	if hasFields[0]&uint64(0x00000004) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("order_key")
	}
	if hasFields[0]&uint64(0x00000008) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("version")
	}
	if hasFields[0]&uint64(0x00000010) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("side")
	}
	if hasFields[0]&uint64(0x00000020) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("quantity")
	}
	if hasFields[0]&uint64(0x00000040) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("symbol")
	}
	if hasFields[0]&uint64(0x00000080) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("order_type")
	}
	if hasFields[0]&uint64(0x00000100) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timeinforce")
	}
	if hasFields[0]&uint64(0x00000200) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("account_id")
	}
	if hasFields[0]&uint64(0x00000400) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("handle_inst")
	}
	if hasFields[0]&uint64(0x00000800) == 0 {
		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("trader_id")
	}

	return nil
}
func (m *Execution) Unmarshal(data []byte) error {
	var hasFields [1]uint64
	l := len(data)
	iNdEx := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := data[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ExecutionId", wireType


-1.821 34.217h-6.78L45.44 22zm9.646 45.366C56.36 68.575 57 70.036 57 71.758c0 1.943-.645 3.47-1.936 4.577-1.293 1.11-2.8 1.665-4.52 1.665-1.75 0-3.278-.547-4.584-1.644C44.654 75.26 44 73.728 44 71.758c0-1.721.626-3.183 1.873-4.392 1.248-1.205 2.776-1.809 4.585-1.809 1.806 0 3.35.604 4.628 1.809z\" fill=\"#666F83\"/></g></svg>","success-color":"<svg class=\"success\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" style=\"background:0 0\"><defs><linearGradient x1=\"85.237%\" y1=\"96.954%\" x2=\"22.272%\" y2=\"5.057%\" id=\"a\"><stop stop-color=\"#F3F4F5\" offset=\"0%\"/><stop stop-color=\"#F9FAFB\" offset=\"100%\"/></linearGradient></defs><g fill=\"none\" fill-rule=\"evenodd\"><path d=\"M50.001 100C22.385 100 0 77.615 0 50.001 0 22.385 22.385 0 50.001 0 77.615 0 100 22.385 100 50.001 100 77.615 77.615 100 50.001 100z\" fill=\"url(#a)\"/><path fill=\"#666F83\" d=\"M41.662 61.51L28.137 47.849 22 54.045 41.754 74l6.135-6.197L78 37.197 71.865 31z\"/></g></svg>","fail-color":"<svg class=\"fail\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" style=\"background:0 0\"><defs><linearGradient x1=\"85.237%\" y1=\"96.954%\" x2=\"22.272%\" y2=\"5.057%\" id=\"a\"><stop stop-color=\"#F3F4F5\" offset=\"0%\"/><stop stop-color=\"#F9FAFB\" offset=\"100%\"/></linearGradient></defs><g fill=\"none\" fill-rule=\"evenodd\"><path d=\"M50.001 100C22.385 100 0 77.615 0 50.001 0 22.385 22.385 0 50.001 0 77.615 0 100 22.385 100 50.001 100 77.615 77.615 100 50.001 100z\" fill=\"url(#a)\"/><path d=\"M72.225 32.627l-16.97 16.97 16.97 16.972-5.656 5.656-16.972-16.97-16.97 16.97-5.656-5.656 16.97-16.972-16.97-16.97 5.656-5.656 16.97 16.97L66.57 26.97l5.656 5.656z\" fill=\"#666F83\"/></g></svg>","square-check":"<svg class=\"icon\" viewBox=\"0 0 1024 1024\" ><path d=\"M750.933333 0a273.066667 273.066667 0 0 1 273.066667 273.066667v477.866666a273.066667 273.066667 0 0 1-273.066667 273.066667H273.066667a273.066667 273.066667 0 0 1-273.066667-273.066667V273.066667a273.066667 273.066667 0 0 1 273.066667-273.066667h477.866666z m0 68.266667H273.066667a204.8 204.8 0 0 0-204.663467 197.12L68.266667 273.066667v477.866666a204.8 204.8 0 0 0 197.12 204.663467L273.066667 955.733333h477.866666a204.8 204.8 0 0 0 204.663467-197.12L955.733333 750.933333V273.066667a204.8 204.8 0 0 0-197.12-204.663467L750.933333 68.266667z\" /></svg>","square-checked":"<svg class=\"icon\" viewBox=\"0 0 1024 1024\" ><path d=\"M750.933333 0a273.066667 273.066667 0 0 1 273.066667 273.066667v477.866666a


// <auto-generated>
//     Generated by the protocol buffer compiler.  DO NOT EDIT!
//     source: bgs/low/pb/client/connection_service.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021, 8981
#region Designer generated code

using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace WowPacketParserModule.V10_0_0_46181.Protos.V10_2_0_52649.Bgs.Protocol.Connection.V1 {

  /// Holder for reflection information generated from bgs/low/pb/client/connection_service.proto
  public static partial class ConnectionServiceReflection {

    #region Descriptor
    /// File descriptor for bgs/low/pb/client/connection_service.proto
    public static pbr::FileDescriptor Descriptor {
      get { return descriptor; }
    }
    private static pbr::FileDescriptor descriptor;

    static ConnectionServiceReflection() {
      byte[] descriptorData = global::System.Convert.FromBase64String(
          string.Concat(
            "CipiZ3MvbG93L3BiL2NsaWVudC9jb25uZWN0aW9uX3NlcnZpY2UucHJvdG8S",
            "GmJncy5wcm90b2NvbC5jb25uZWN0aW9uLnYxGixiZ3MvbG93L3BiL2NsaWVu",
            "dC9jb250ZW50X2hhbmRsZV90eXBlcy5wcm90bxohYmdzL2xvdy9wYi9jbGll",
            "bnQvcnBjX3R5cGVzLnByb3RvGihiZ3MvbG93L3BiL2NsaWVudC9zZW1hbnRp",
            "Y192ZXJzaW9uLnByb3RvIpUBChRDbGllbnRTZGtWZXJzaW9uSW5mbxIQCghz",
            "ZGtfbmFtZRgBIAEoCRIyCgtzZGtfdmVyc2lvbhgCIAEoCzIdLmJncy5wcm90",
            "b2NvbC5TZW1hbnRpY1ZlcnNpb24SNwoQcHJvdG9jb2xfdmVyc2lvbhgDIAEo",
            "CzIdLmJncy5wcm90b2NvbC5TZW1hbnRpY1ZlcnNpb24iqQIKDkNvbm5lY3RS",
            "ZXF1ZXN0EioKCWNsaWVudF9pZBgBIAEoCzIXLmJncy5wcm90b2NvbC5Qcm9j",
            "ZXNzSWQSPQoMYmluZF9yZXF1ZXN0GAIgASgLMicuYmdzLnByb3RvY29sLmNv",
            "bm5lY3Rpb24udjEuQmluZFJlcX


if(r)i0=g7.f
else i0=h4.f
if(r)i1=g7.r
else i1=h4.r
i2=t.KX
i3=i2.a(A.dA(g7.w,h4.w,u3))
g7=A.amM(g7.x,h4.x,u3)
h4=A.amR(u2.b0,s.b0,u3)
h4.toString
i4=u2.ep
i5=s.ep
i6=A.Q7(i4.a,i5.a,u3)
i7=A.acz(i4.b,i5.b,u3,A.dq(),a)
i8=A.O(i4.c,i5.c,u3)
i9=A.b5(i4.d,i5.d,u3)
j0=A.acz(i4.e,i5.e,u3,A.dq(),a)
j1=A.O(i4.f,i5.f,u3)
j2=A.b5(i4.r,i5.r,u3)
j3=A.O(i4.w,i5.w,u3)
j4=A.O(i4.x,i5.x,u3)
j5=A.O(i4.y,i5.y,u3)
i5=A.O(i4.z,i5.z,u3)
i4=u2.c9
j6=s.c9
j7=A.v(i4.a,j6.a,u3)
j8=A.O(i4.b,j6.b,u3)
j9=A.dA(i4.c,j6.c,u3)
k0=A.a8h(i4.d,j6.d,u3)
k1=A.b5(i4.e,j6.e,u3)
i4=A.b5(i4.f,j6.f,u3)
j6=u2.u
k2=s.u
k3=A.v(j6.a,k2.a,u3)
k4=A.O(j6.b,k2.b,u3)
k5=A.O(j6.c,k2.c,u3)
k6=A.O(j6.d,k2.d,u3)
j6=A.O(j6.e,k2.e,u3)
k2=A.ano(u2.I,s.I,u3)
k2.toString
k7=A.anv(u2.ad,s.ad,u3)
k7.toString
k8=A.anG(u2.a4,s.a4,u3)
k8.toString
k9=A.aok(u2.aE,s.aE,u3)
k9.toString
l0=A.aoE(u2.bl,s.bl,u3)
l0.toString
l1=A.aoF(u2.br,s.br,u3)
l1.toString
l2=A.aoJ(u2.b4,s.b4,u3)
l2.toString
l3=A.ap1(u2.ck,s.ck,u3)
l3.toString
l4=A.api(u2.cQ,s.cQ,u3)
l4.toString
l5=u2.dI
l6=s.dI
if(r)l7=l5.a
else l7=l6.a
l8=A.adS(l5.b,l6.b,u3,A.dq(),a)
if(r)l9=l5.e


4.121758], [54.693024, 24.797892], [55.439025, 25.439145], [56.070821, 26.055464], [56.261042, 25.714606], [56.396847, 24.924732], [55.886233, 24.920831], [55.804119, 24.269604], [55.981214, 24.130543], [55.528632, 23.933604], [55.525841, 23.524869], [55.234489, 23.110993], [55.208341, 22.70833], [55.006803, 22.496948], [52.000733, 23.001154], [51.617708, 24.014219], [51.579519, 24.245497]]], "type": "Polygon"}, "id": "ARE", "properties": {"highlight": {}, "name": "United Arab Emirates", "style": {"color": "black", "fillColor": "#fed976", "fillOpacity": 0.7, "opacity": 0.2, "weight": 1}}, "type": "Feature"}, {"geometry": {"coordinates": [[[[-65.5, -55.2], [-66.45, -55.25], [-66.95992, -54.89681], [-67.56244, -54.87001], [-68.63335, -54.8695], [-68.63401, -52.63637], [-68.25, -53.1], [-67.75, -53.85], [-66.45, -54.45], [-65.05, -54.7], [-65.5, -55.2]]], [[[-64.964892, -22.075862], [-64.377021, -22.798091], [-63.986838, -21.993644], [-62.846468, -22.034985], [-62.685057, -22.249029], [-60.846565, -23.880713], [-60.028966, -24.032796], [-58.807128, -24.771459], [-57.777217, -25.16234], [-57.63366, -25.603657], [-58.618174, -27.123719], [-57.60976, -27.395899], [-56.486702, -27.548499], [-55.695846, -27.387837], [-54.788795, -26.621786], [-54.625291, -25.739255], [-54.13005, -25.547639], [-53.628349, -26.124865], [-53.648735, -26.923473], [-54.490725, -27.474757], [-55.162286, -27.881915], [-56.2909, -28.852761], [-57.625133, -30.216295], [-57.874937, -31.016556], [-58.14244, -32.044504], [-58.132648, -33.040567], [-58.349611, -33.263189], [-58.427074, -33.909454], [-58.495442, -34.43149], [-57.22583, -35.288027], [-57.362359, -35.97739], [-56.737487, -36.413126], [-56.788285, -36.901572], [-57.749157, -38.183871], [-59.231857, -38.72022], [-61.237445, -38.928425], [-62.335957, -38.827707], [-62.125763, -39.424105], [-62.330531, -40.172586], [-62.145994, -40.676897], [-62.745803, -41.028761], [-63.770495, -41.166789], [-64.73209, -40.802677], [-65.118035, -41.064315], [-64.978561, -42.058001], [-64.303408, -42.359016], [-63.75


optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *SettingsSearchapplicationsGetCall) IfNoneMatch(entityTag string) *SettingsSearchapplicationsGetCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *SettingsSearchapplicationsGetCall) Context(ctx context.Context) *SettingsSearchapplicationsGetCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *SettingsSearchapplicationsGetCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *SettingsSearchapplicationsGetCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"name": c.name,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "cloudsearch.settings.searchapplications.get", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "cloudsearch.settings.searchapplications.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *SearchApplication.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *SettingsSearchapplicationsGetCall) Do(opts ...googleapi.CallOption) (*SearchApplication, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SearchApplication{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "cloudsearch.settings.searchapplications.get", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type SettingsSearchapplicationsListCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context


Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 52, Short.MAX_VALUE)
        );

        dacCmdPanel.add(jPanel2);

        offchipDACPanel.add(dacCmdPanel, java.awt.BorderLayout.SOUTH);

        dacPoweredPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Power DACs"));
        dacPoweredPanel.setToolTipText("Sets the DACs to be powered (on) or with high impedance outputs (off)");
        dacPoweredPanel.setMaximumSize(new java.awt.Dimension(32767, 100));
        dacPoweredPanel.setPreferredSize(new java.awt.Dimension(100, 50));
        dacPoweredPanel.setLayout(new javax.swing.BoxLayout(dacPoweredPanel, javax.swing.BoxLayout.LINE_AXIS));

        dacPowerButtonGroup.add(dacPoweronButton);
        dacPoweronButton.setText("Power on");
        dacPoweronButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                dacPoweronButtonActionPerformed(evt);
            }
        });
        dacPoweredPanel.add(dacPoweronButton);

        dacPowerButtonGroup.add(dacPoweroffButton);
        dacPoweroffButton.setText("Power off");
        dacPoweroffButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                dacPoweroffButtonActionPerformed(evt);
            }
        });
        dacPoweredPanel.add(dacPoweroffButton);

        offchipDACPanel.add(dacPoweredPanel, java.awt.BorderLayout.NORTH);

        tabbedPane.addTab("off-chip biases", offchipDACPanel);

        equalizerPanel.setToolTipText("Control the equalizer (QDAC and SOS local quality factor DACs)");
        equalizerPanel.setLayout(new java.awt.BorderLayout());

        equalizerSlidersPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        equalizerSlidersPanel.setLayout(new javax.swing.BoxLayout(equalizerSlidersPanel, javax.swing.BoxLayout.Y_AXIS));

        channelLabel.setFont(new java.awt.Font("Bitstream Vera Sans Mono", 0, 11)); // NOI18N
        channelLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        channelLabel.setText("                                       ");
        equalizerSlidersPanel.add(channelLabel);

        jPanel10.setLayout(new javax.swing.BoxLayout(jPanel10, javax.swing.BoxLayout.LINE_AXIS));

        resetEqBut.setText("Reset all");
        resetEqBut.setToolTipText("Uses hardware reset to reset all latches to default state");
        resetEqBut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resetEqButActionPerformed(evt);
            }
        });
        jPanel10.add(resetEqBut);

        rubberBandCB.setText("rubber bands");
        rubberBandCB.setToolTipText("ties channels together with rubber band");
        jPanel10.add(rubberBandCB);

        equalizerSlidersPanel.add(jPanel10);

        sosQualPan.setBorder(javax.swing.BorderFactory.createTitledBorder("SOS quality"));
        sosQualPan.setToolTipText("");
        sosQualPan.setLayout(new javax.swing.BoxLayout(sosQualPan, javax.swing.BoxLayout.LINE_AXIS));

        jPanel9.setMinimumSize(new java.awt.Dimension(40, 63));


ng> item in Menu.maps)
				{
					int index = i;
					string m = item.Key;
					Container button = this.main.UIFactory.CreateButton(item.Value, delegate()
					{
						hideStart();
						this.restorePausedSettings();
						this.main.CurrentSave.Value = null;
						this.main.AddComponent(new Animation
						(
							new Animation.Delay(0.2f),
							new Animation.Execute(delegate()
							{
								this.main.Spawner.StartSpawnPoint.Value = "_main_menu";
								IO.MapLoader.Load(this.main, m);
							})
						));
					});
					button.Add(new Binding<bool>(button.Visible, () => index <= MaxLevelIndex && (this.main.Settings.GodModeProperty || this.main.Settings.LevelIndexProperty >= index), this.main.Settings.GodModeProperty, this.main.Settings.LevelIndexProperty));
					this.resizeToMenu(button);
					startList.Children.Add(button);
					i++;
				}
			}

			Scroller startScroller = new Scroller();
			startScroller.Children.Add(startList);
			startScroller.Add(new Binding<Vector2>(startScroller.Size, () => new Vector2(startList.Size.Value.X, this.main.ScreenSize.Value.Y * 0.5f), startList.Size, this.main.ScreenSize));
			startMenu.Children.Add(startScroller);

#if DEMO
			{
				Container labelPadding = this.main.UIFactory.CreateContainer();
				labelPadding.Opacity.Value = 0.0f;
				this.resizeToMenu(labelPadding);
				this.pauseMenu.Children.Add(labelPadding);

				TextElement label = new TextElement();
				label.FontFile.Value = this.main.Font;
				label.Text.Value = "\\demo";
				label.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;
				labelPadding.Children.Add(label);
			}
#endif

			// Resume button
			Container resume = this.main.UIFactory.CreateButton("\\resume", delegate()
			{
				this.main.Paused.Value = false;
				this.restorePausedSettings();
			});
			this.resizeToMenu(resume);
			resume.Visible.Value = false;
			this.pauseMenu.Children.Add(resume);
			resume.Add(new Binding<bool, string>(resume.Visible, x => x != Main.MenuMap, this.main.MapFile));

			// Start button
			Container start = this.main.UIFactory.CreateButton("\\new game", delegate()
			{
				this.hidePauseMenu();

				startMenu.Visible.Value = true;
				if (startAnimation != null)
					startAnimation.Delete.Execute();
				startAnimation = new Animation(new Animation.Ease(new Animation.Vector2MoveToSpeed(startMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed), Animation.Ease.EaseType.OutExponential));
				this.main.AddComponent(startAnimation);

				startShown = true;
				this.currentMenu.Value = startList;
			});
			this.resizeToMenu(start);
			start.Add(new Binding<bool, string>(start.Visible, x => x == Main.MenuMap, this.main.MapFile));
			this.pauseMenu.Children.Add(start);

			// Save button
			Container saveButton = this.main.UIFactory.CreateButton("\\save", delegate()
			{
				if (PlayerFactory.Instance != null)
				{
					this.hidePauseMenu();

					this.saveMode.Value = true;

					this.loadSaveMenu.Visible.Value = true;
					if (this.loadSaveAnimation != null)
						this.loadSaveAnimation.Delete.Execute();
					this.loadSaveAnimation = new Animation(new Animation.Ease(new Animation.Vector2MoveToSpeed(this.loadSaveMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed), Animation.Ease.EaseType.OutExponential));
					this.main.AddComponent(this.loadSaveAnimation);

					this.loadSaveShown = true;
					this.


group" style="width:1%">Sports venues

Athlone Stadium

Bellville Stadium

Bellville Velodrome

Cape Town Stadium

Erica Park

Good Hope Centre

Green Point Stadium

Hartleyvale Stadium

Killarney Motor Racing Complex

Milnerton Racecourse

Newlands Cricket Ground

Newlands Stadium

NNK Rugby Stadium

Parow Park

Philippi Stadium

University of the Western Cape Stadium

Wynberg Military Base Stadium

Education

Libraries

Biblionef

<a href="/wiki/Central_Library_C


xpectThat(x.next()).isEqualTo('1')
        expectThat(x.next()).isEqualTo('0')
        expectThat(x).isFinished()

        x = r1.reverseIterator(4)
        expectThat(x.next()).isEqualTo('0')
        expectThat(x).isFinished()

        x = r2.reverseIterator()
        expectThat(x.next()).isEqualTo('0')
        expectThat(x.next()).isEqualTo('1')
        expectThat(x.next()).isEqualTo('2')
        expectThat(x.next()).isEqualTo('3')
        expectThat(x.next()).isEqualTo('4')
        expectThat(x).isFinished()

        x = r2.reverseIterator(4)
        expectThat(x.next()).isEqualTo('4')
        expectThat(x).isFinished()

        x = r3.reverseIterator()
        expectThat(x.next()).isEqualTo('2')
        expectThat(x.next()).isEqualTo('1')
        expectThat(x.next()).isEqualTo('0')
        expectThat(x).isFinished()

        x = r3.reverseIterator(1)
        expectThat(x.next()).isEqualTo('1')
        expectThat(x.next()).isEqualTo('0')
        expectThat(x).isFinished()

        x = r4.reverseIterator() //0123443210012
        expectThat(x.next()).isEqualTo('2')
        expectThat(x.next()).isEqualTo('1')
        expectThat(x.next()).isEqualTo('0')
        expectThat(x.next()).isEqualTo('0')
        expectThat(x.next()).isEqualTo('1')
        expectThat(x.next()).isEqualTo('2')
        expectThat(x.next()).isEqualTo('3')
        expectThat(x.next()).isEqualTo('4')
        expectThat(x.next()).isEqualTo('4')
        expectThat(x.next()).isEqualTo('3')
        expectThat(x.next()).isEqualTo('2')
        expectThat(x.next()).isEqualTo('1')
        expectThat(x.next()).isEqualTo('0')
        expectThat(x).isFinished()

        x = r4.reverseIterator(7)
        expectThat(x.next()).isEqualTo('4')
        expectThat(x.next()).isEqualTo('4')
        expectThat(x.next()).isEqualTo('3')
        expectThat(x.next()).isEqualTo('2')
        expectThat(x.next()).isEqualTo('1')
        expectThat(x.next()).isEqualTo('0')
        expectThat(x).isFinished()

        x = r4.reverseIterator(12)
        expectThat(x.next()).isEqualTo('0')
        expectThat(x).isFinished()

        x = r4.reverseIterator(13)
        expectThat(x).isFinished()
    }

    @Test
    fun testSerialize() {
        val r1 = FlatCharSequenceRope("01234")
        val r2 = ReverseRope(r1)
        val r3 = SubstringRope(r1, 0, 1)
        val r4 = ConcatenationRope(ConcatenationRope(r1, r2), r3) //01234432100

        val out = ByteArrayOutputStream()
        ObjectOutputStream(out).use {
            it.writeObject(r4)
        }
        val `in` = ByteArrayInputStream(out.toByteArray())
        val ois = ObjectInputStream(`in`)
        val r = ois.readObject()
        expectThat(r).isA<FlatCharSequenceRope>()
    }

    @Test
    fun testPadStart() {
        val r = Rope.of("hello")
        expectThat(r.padStart(5)).isString("hello")
        expectThat(r.padStart(0)).isString("hello")
        expectThat(r.padStart(-1


ojeyi yönetmek ve koordine etmek ve iş verimliliğini artırmak kolaydır. Öğrenciler: Yeni teknolojileri öğrenirken ilgili açık kaynak projelerini daha kolay bulabilir ve projelerin etkinliğini ve ölçeğini hızlı bir şekilde kontrol edebilirler. 🤠
// @description:ug     🤠 ئامبارنىڭ كۆرسىتىش چوڭلۇقى: GitHub نىڭ كود ئىزدەش ، ئامبار ئىزدەش ، تارقىتىش بېتى ، ئىشلەتكۈچى ئامبار تىزىملىكى ۋە ئامبار بېتىدە ، ئامبارنىڭ چوڭلۇقى ئامبار نامىنىڭ يېنىدا كۆرسىتىلىدۇ ، ئابونتلار ئامبارنىڭ كۆلىمىنى تېزرەك چۈشىنىدۇ ۋە ئۇلارنى ئەلالاشتۇرىدۇ. تاللاش. ئاكتىپ بولمىغان تەرەققىيات ئاگاھلاندۇرۇشى: ئەگەر يېقىنقى ئالتە ئاي ئىچىدە ئامبار يېڭىلانمىغان بولسا ، بۇ سىستېما ئامبارنىڭ ئۈستىگە تېزلىكتە ئەسكەرتىپ ، ئابونتلارغا ئامبارنىڭ ئاكتىپ ئەمەسلىكىنى ئەسكەرتىپ ، ئەڭ ئاخىرقى يېڭىلاش ۋاقتىنى كۆرسىتىدۇ. بۇ ئىشلەتكۈچىلەرنىڭ ئامبارنىڭ پائالىيىتى ۋە ئاسراش ئەھۋالىنى ئېنىقلىشىغا ياردەم بېرىدۇ. ئامباردا تېز سەكرەش: ئامبارنى كۆرگەندە ، ئىشلەتكۈچى بارلىق ئامبارلارنىڭ تىزىملىكىنى ئاسانلا كۆرەلەيدۇ ، ئوخشىمىغان ئامبارلارغا تېز سەكرەش ئېغىزى بىلەن تەمىنلەيدۇ. ئىشلەتكۈچىلەر باشقا قىزىقىدىغان تۈرلەرنى تېزلا تاپالايدۇ ۋە زىيارەت قىلالايدۇ ، خىزمەت ئۈنۈمىنى ئۆستۈرىدۇ. ئىشلىتىش سىنارىيەسى: ئاچقۇچىلار: ئامبارنىڭ چوڭ-كىچىكلىكى ۋە ئاكتىپ ئاگاھلاندۇرۇشلارنى كۆرسىتىش ئارقىلىق ، ماس كېلىدىغان كۈتۈپخانىلارنى تېزلىكتە سۈزۈپ ، ئاسرىمايدىغان تۈرلەرنى ئىشلىتىشتىن ساقلىنالايسىز. تۈر دېرىكتورى: تېز سەكرەش ئىقتىدارى ئارقىلىق ، كۆپ تۈرنى باشقۇرۇش ۋە ماسلاشتۇرۇش ۋە خىزمەت �


currate == 0)
    return true;

  double cache_sbp   = 1.1 * (double)DVD_TIME_BASE / currate;         /* underestimate by 10 % */
  double play_left   = play_sbp  * (remain + queued);                 /* time to play out all remaining bytes */
  double cache_left  = cache_sbp * (remain - cached);                 /* time to cache the remaining bytes */
  double cache_need  = std::max(0.0, remain - play_left / cache_sbp); /* bytes needed until play_left == cache_left */

  delay = cache_left - play_left;

  if (full && (currate < maxrate) )
    level = -1.0;                          /* buffer is full & our read rate is too low  */
  else
    level = (cached + queued) / (cache_need + queued);

  return true;
}

void CDVDPlayer::HandlePlaySpeed()
{
  ECacheState caching = m_caching;

  if(IsInMenu() && caching != CACHESTATE_DONE)
    caching = CACHESTATE_DONE;

  if(caching == CACHESTATE_FULL)
  {
    double level, delay, offset;
    if(GetCachingTimes(level, delay, offset))
    {
      if(level  < 0.0)
      {
        CGUIDialogKaiToast::QueueNotification(g_localizeStrings.Get(21454), g_localizeStrings.Get(21455));
        caching = CACHESTATE_INIT;
      }
      if(level >= 1.0)
        caching = CACHESTATE_INIT;
    }
    else
    {
      if ((!m_dvdPlayerAudio->AcceptsData() && m_CurrentAudio.id >= 0)
      ||  (!m_dvdPlayerVideo->AcceptsData() && m_CurrentVideo.id >= 0))
        caching = CACHESTATE_INIT;
    }
  }

  if(caching == CACHESTATE_INIT)
  {
    // if all enabled streams have been inited we are done
    if((m_CurrentVideo.id < 0 || m_CurrentVideo.started)
    && (m_CurrentAudio.id < 0 || m_CurrentAudio.started))
      caching = CACHESTATE_PLAY;

    // handle situation that we get no data on one stream
    if(m_CurrentAudio.id >= 0 && m_CurrentVideo.id >= 0)
    {
      if ((!m_dvdPlayerAudio->AcceptsData() && !m_CurrentVideo.started)
      ||  (!m_dvdPlayerVideo->AcceptsData() && !m_CurrentAudio.started))
      {
        caching = CACHESTATE_DONE;
      }
    }
  }

  if (caching == CACHESTATE_PVR)
  {
    bool bGotAudio(m_pDemuxer->GetNrOfAudioStreams() > 0);
    bool bGotVideo(m_pDemuxer->GetNrOfVideoStreams() > 0);
    bool bAudioLevelOk(m_dvdPlayerAudio->GetLevel() > g_advancedSettings.m_iPVRMinAudioCacheLevel);
    bool bVideoLevelOk(m_dvdPlayerVideo->GetLevel() > g_advancedSettings.m_iPVRMinVideoCacheLevel);
    bool bAudioFull(!m_dvdPlayerAudio->AcceptsData());
    bool bVideoFull(!m_dvdPlayerVideo->AcceptsData());

    if (/* if all streams got at least g_advancedSettings.m_iPVRMinCacheLevel in their buffers, we're done */
        ((bGotVideo || bGotAudio) && (!bGotAudio || bAudioLevelOk) && (!bGotVideo || bVideoLevelOk)) ||
        /* or if one of the buffers is full */
        (bAudioFull || bVideoFull))
    {
      CLog::Log(LOGDEBUG, "set caching from pvr to done. audio (%d) = %d. video (%d) = %d",
          bGotAudio, m_dvdPlayerAudio->GetLevel(),
          bGotVideo, m_dvdPlayerVideo->GetLevel());