_v+4(%ebx),%esi
	movl	C(r_refdef)+rd_vrectbottom,%edx
	cmpl	%edx,%esi
	jge		LNextVert

//			zbuf = zspantable[fv->v[1]] + fv->v[0];
	movl	C(zspantable)(,%esi,4),%edi

//			z = fv->v[5]>>16;
	movl	fv_v+20(%ebx),%edx
	shrl	$16,%edx

//			if (z >= *zbuf)
//			{
//				int		pix;
	cmpw	(%edi,%eax,2),%dx
	jl		LNextVert

//				*zbuf = z;
	movw	%dx,(%edi,%eax,2)

//				pix = skintable[fv->v[3]>>16][fv->v[2]>>16];
	movl	fv_v+12(%ebx),%edi
	shrl	$16,%edi
	movl	C(skintable)(,%edi,4),%edi
	movl	fv_v+8(%ebx),%edx
	shrl	$16,%edx
	movb	(%edi,%edx),%dl

//				pix = ((byte *)acolormap)[pix + (fv->v[4] & 0xFF00)];
	movl	fv_v+16(%ebx),%edi
	andl	$0xFF00,%edi
	andl	$0x00FF,%edx
	addl	%edx,%edi
	movl	C(acolormap),%edx
	movb	(%edx,%edi,1),%dl

//				d_viewbuffer[d_scantable[fv->v[1]] + fv->v[0]] = pix;
	movl	C(d_scantable)(,%esi,4),%edi
	movl	C(d_viewbuffer),%esi
	addl	%eax,%edi
	movb	%dl,(%esi,%edi)

//			}
//		}
//	}
LNextVert:
	addl	$(fv_size),%ebx
	decl	%ecx
	jnz		LFVLoop

	popl	%edi
	popl	%esi
	popl	%ebx
	popl	%ebp
	ret

//----------------------------------------------------------------------
// Alias model non-subdivided polygon dispatching code
//
// not C-callable because of stack buffer cleanup
//----------------------------------------------------------------------

.globl C(D_DrawNonSubdiv)
C(D_DrawNonSubdiv):
	pushl	%ebp				// preserve caller stack frame pointer
	movl	C(r_affinetridesc)+atd_numtriangles,%ebp
	pushl	%ebx
	shll	$(mtri_shift),%ebp
	pushl	%esi				// preserve register variables
	movl	C(r_affinetridesc)+atd_ptriangles,%esi
	pushl	%edi

//	mtriangle_t		*ptri;
//	finalvert_t		*pfv, *index0, *index1, *index2;
//	int				i;
//	int				lnumtriangles;

//	pfv = r_affinetridesc.pfinalverts;
//	ptri = r_affinetridesc.ptriangles;
//	lnumtriangles = r_affinetridesc.numtriangles;

LNDLoop:

//	for (i=0 ; i<lnumtriangles ; i++, ptri++)
//	{
//		index0 = pfv + ptri->vertindex[0];
//		index1 = pfv + ptri->vertindex[1];
//		index2 = pfv + ptri->vertindex[2];
	movl	C(r_affinetridesc)+atd_pfinalverts,%edi
	movl	mtri_vertindex+0


   While(Box<Node>, Block),
    FuncCall(FunctionCall),
    Return(Box<Node>),
}

#[derive(Debug, PartialEq, Eq)]
pub enum _Expr {
    BinOp(Box<Node>, Op, Box<Node>),
    VarOp(Box<Node>, Op, Box<Node>),
}

#[derive(Debug, PartialEq, Eq)]
pub enum Node {
    Value(Value),
    Keyword(Keyword),
    Expr(_Expr),
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Expr {
    // Right-hand expressions
    BinOp(Box<Expr>, Op, Box<Expr>),
    Num(i32),
    Var(String),
    Bool(bool),

    // Keywords (coud be moved to another enum?)
    Let(Box<Expr>, Type, Box<Expr>),
    VarOp(Box<Expr>, Op, Box<Expr>),
    If(Box<Expr>, Block),
    IfElse(Box<Expr>, Block), // not implemented yet
    While(Box<Expr>, Block),
    FuncCall(FunctionCall),
    Return(Box<Expr>),
}

impl From<Expr> for i32 {
    fn from(e: Expr) -> i32 {
        match e {
            Expr::Num(i) => i,
            _ => panic!("Could not convert to i32. Wrong type."),
        }
    }
}

// Implement TryForm trait instead to get a Result back
impl From<Expr> for String {
    fn from(e: Expr) -> String {
        match e {
            Expr::Var(s) => s,
            Expr::Bool(b) => format!("{}", b),
            Expr::Num(i) => format!("{}", i),
            _ => panic!("Could not convert to String. Wrong type."),
        }
    }
}

// Implement TryForm trait instead to get a Result back
impl From<Expr> for bool {
    fn from(e: Expr) -> bool {
        match e {
            Expr::Bool(b) => b,
            _ => panic!("Could not convert to bool. Wrong type."),
        }
    }
}
<gh_stars>0

/// operators combining patterns
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum PatternOperator {
    And,
    Or,
    Not,
}

<gh_stars>0
//! # An arbitrary precision rational type
//!
//! At the moment, this is just wrapping the `num::BigRational` type, following the newtype pattern.
//! This is needed because some of the impl's in this module are not provided by `num`. Methods on
//! this type can be modified and specialized as needed.
use std::fmt::{Debug, Formatter};
use std::fmt;

mod with_fixed_size;
mod wrapping;
mod special;
#[cfg(test)]
mod test;

/// A big rational type that currently completely relies on the methods of `num::BigRational`.
#[derive(
    Clone,
    Ord, PartialOrd, Eq, PartialEq,
)]
pub struct Big(pub num::BigRational);

impl Big {
    /// Create a new instance by converting the two provided numbers into arbitrary size ints.
    #[must_use]
    pub fn new(numer: i64, denom: i64) -> Self {
        Self(num::BigRational::new(numer.into(), denom.into()))
    }
}

impl Debug for Big {
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        let Self(inner) = self;

        write!(f, "{}", inner.numer().to_string())?;
        write!(f, "/")?;
        write!(f, "{}", inner.denom().to_string())
    }
}
use quote::quote;
use syn::export::TokenStream2;
use syn::Generics;

pub fn declaration(ident_str: &String, generics: &Generics) -> (TokenStream2, Vec


8, 206, 169, 168, 224, 26, 205, 154, 75, 184, 56, 191, 144, 213, 233, 114, 224, 92, 118, 189, 179, 59, 75, 198, 189, 23, 94, 235, 232, 110, 197, 239, 219, 52, 171, 225, 69, 121, 39, 19, 190, 109, 227, 207, 26, 65, 108, 186, 1, 49, 231, 58, 205, 43, 96, 53, 181, 40, 139, 203, 104, 87, 239, 178, 106, 19, 207, 40, 63, 240, 208, 106, 58, 101, 212, 12, 50, 216, 67, 159, 69, 75, 200, 115, 30, 184, 215, 167, 39, 150, 37, 146, 0, 183, 71, 73, 240, 125, 54, 89, 228, 230, 146, 87, 238, 46, 120, 164, 246, 92, 100, 51, 239, 48, 221, 224, 66, 129, 216, 172, 117, 55, 53, 191, 182, 206, 87, 100, 22, 74, 231, 142, 91, 39, 229, 216, 121, 209, 101, 114, 231, 237, 33, 207, 188, 46, 252, 185, 243, 62, 233, 188, 76, 136, 215, 165, 42, 179, 49, 107, 143, 199, 213, 164, 205, 34, 53, 100, 1, 178, 46, 116, 97, 100, 7, 174, 69, 50, 33, 118, 168, 33, 144, 44, 222, 229, 127, 52, 212, 219, 171, 247, 236, 240, 65, 147, 50, 30, 182, 37, 82, 201, 208, 242, 231, 31, 70, 196, 178, 207, 234, 36, 140, 28, 98, 4, 23, 211, 152, 98, 140, 57, 227, 100, 84, 91, 12, 83, 67, 147, 31, 123, 136, 80, 68, 124, 117, 51, 213, 248, 158, 171, 215, 189, 254, 64, 141, 245, 18, 240, 201, 197, 162, 235, 230, 67, 241, 199, 238, 83, 97, 62, 32, 200, 241, 170, 59, 194, 247, 17, 143, 145, 27, 227, 83, 68, 49, 42, 253, 167, 225, 78, 245, 6, 135, 241, 156, 154, 63, 203, 38, 78, 218, 224, 33, 70, 84, 252, 230, 128, 215, 71, 49, 52, 49, 75, 177, 186, 1, 31, 221, 11, 203, 112, 79, 221, 235, 201, 129, 9, 126, 99, 243, 49, 3, 246, 109, 246, 250, 250, 17, 214, 27, 6, 73, 184, 128, 65, 139, 225, 114, 221, 251, 238, 14, 2, 31, 49, 168, 101, 84, 3, 77, 124, 217, 112, 143, 166, 117, 79, 252, 63, 38, 244, 111, 195, 123, 210, 99, 61, 7, 0, 0 }) { } }
    public class Candle : Emoji { public Candle() : base("Candle", EmojiSize.Size32, EmojiGroup.Objects, EmojiSkintone.Default, EmojiStyle.HighContrast, new byte [] { 31, 139, 8, 0, 0, 0, 0, 0, 0, 10, 85, 83, 187, 110, 27, 65, 12, 252, 149, 133, 210, 51, 36, 119, 249, 88, 32, 78, 115, 141, 10, 185, 189, 194, 93, 128, 32, 72, 0, 23, 41, 252, 255, 200, 240, 94, 114, 212, 144, 163, 229, 99, 56, 228, 125, 251, 251, 227, 227, 119, 251, 249, 114, 123, 21, 167, 193, 169, 77, 105, 168, 200, 124, 72, 146, 90, 74, 51, 178, 144, 33, 11, 176, 25, 107, 115, 226, 158, 93, 27, 112, 200, 236, 192, 54, 133, 229, 194, 65


, err := theme.pool.Allocate(int(size))
		if err != nil {
			return nil, err
		}

		// Copy pixels to shm pool
		copy(theme.pool.Data[offset:], image.Pixels)
		totalDelay += image.Delay

		images[i] = Image{
			theme:    theme,
			Width:    image.Width,
			Height:   image.Height,
			HotspotX: image.HotspotX,
			HotspotY: image.HotspotY,
			Delay:    image.Delay,
			offset:   offset,
		}
	}

	return &Cursor{
		Name:       name,
		totalDelay: totalDelay,
		Images:     images,
	}, nil
}

// FrameAndDuration finds the frame for a given elapsed time in a
// cursor animation as well as the time left until next cursor change.
//
//	cursor: The cursor
//	time: Elapsed time in ms since the beginning of the animation
//	duration: Time left for this image or zero if the cursor won't change.
//
// Returns the index of the image that should be displayed for the
// given time in the cursor animation and updated duration.
func (cursor *Cursor) FrameAndDuration(time uint32, d uint32) (int, uint32) {
	if len(cursor.Images) == 1 || cursor.totalDelay == 0 {
		return 0, 0
	}

	i := 0
	t := time % cursor.totalDelay
	duration := d

	// If there is a 0 delay in the image set then this
	// loop breaks on it and we display that cursor until
	// time % cursor.totalDelay wraps again.
	//
	// Since a 0 delay is silly, and we've never actually
	// seen one in a cursor file, we haven't bothered to
	// "fix" this.
	for t-cursor.Images[i].Delay < t {
		i++
		t -= cursor.Images[i].Delay
	}

	if duration != 0 {
		return i, duration
	}

	// Make sure we don't accidentally tell the caller this is
	// a static cursor image.
	if t >= cursor.Images[i].Delay {
		duration = 1
	} else {
		duration = cursor.Images[i].Delay - t
	}

	return i, duration
}

// Frame finds the frame for a given elapsed time in a cursor animation
//
//	cursor: The cursor
//	time: Elapsed time in ms since the beginning of the animation
//
// Returns the index of the image that should be displayed for the
// given time in the cursor animation.
func (cursor *Cursor) Frame(time uint32) int {
	i, _ := cursor.FrameAndDuration(time, 0)
	return i
}

func (cursor *Cursor) Destroy() error {
	err := MultiError{}

	for _, image := range cursor.Images {
		err.Add(image.Destroy())
	}

	cursor.Images = nil

	return err.Err()
}

type Theme struct {
	cursors map[string]*Cursor
	pool    *shmPool
	size    int
}

func (theme *Theme) loadCallback(name string, images []xcursor.Image) {
	if c := theme.GetCursor(name); c != nil {
		return
	}

	cursor, err := createCursorFromXcursorImages(name, images, theme)
	if err != nil {
		return
	}

	theme.cursors[name] = cursor
}

// LoadTheme loads a cursor theme to memory shared with the compositor
//
// name: The name of the cursor theme to load. If empty, the default theme will be loaded.
// size: Desired size of the cursor images.
// shm: The compositor's shm interface.
//
// Returns an object representing the theme that should be destroyed with
// Theme.Destroy().
func LoadTheme(name string, size int, shm *client.Shm) (*Theme, error) {
	if name == "" {
		name = "default"
	}

	pool, err := createShmPool(shm, size*size*4)
	if err != nil {
		return nil, err
	}

	theme := &Theme{
		size:    size,
		pool:    pool,
		cursors: map[string]*Cursor{},
	}

	xcursor.LoadTheme(name, size, theme.loadCallback)

	if len(theme.cursors) == 0 {
		xcursor.LoadTheme("", size, theme.loadCallback)
	}

	if len(theme.cursors) == 0 {
		_ = pool.Destroy()
		return nil, errors.New("unable to find cursors in specified theme")
	}

	return theme, nil
}

func (th


< dendl;
  return NULL;
}

void Pipe::DelayedDelivery::stop_fast_dispatching() {
  Mutex::Locker l(delay_lock);
  stop_fast_dispatching_flag = true;
  while (delay_dispatching)
    delay_cond.Wait(delay_lock);
}

int Pipe::accept()
{
  ldout(msgr->cct,10) << "accept" << dendl;
  assert(pipe_lock.is_locked());
  assert(state == STATE_ACCEPTING);

  pipe_lock.Unlock();

  // vars
  bufferlist addrs;
  entity_addr_t socket_addr;
  socklen_t len;
  int r;
  char banner[strlen(CEPH_BANNER)+1];
  bufferlist addrbl;
  ceph_msg_connect connect;
  ceph_msg_connect_reply reply;
  Pipe *existing = 0;
  bufferptr bp;
  bufferlist authorizer, authorizer_reply;
  bool authorizer_valid;
  uint64_t feat_missing;
  bool replaced = false;
  // this variable denotes if the connection attempt from peer is a hard
  // reset or not, it is true if there is an existing connection and the
  // connection sequence from peer is equal to zero
  bool is_reset_from_peer = false;
  CryptoKey session_key;
  int removed; // single-use down below

  // this should roughly mirror pseudocode at
  //  http://ceph.com/wiki/Messaging_protocol
  int reply_tag = 0;
  uint64_t existing_seq = -1;

  // used for reading in the remote acked seq on connect
  uint64_t newly_acked_seq = 0;

  bool need_challenge = false;
  bool had_challenge = false;
  std::unique_ptr<AuthAuthorizerChallenge> authorizer_challenge;

  recv_reset();

  set_socket_options();

  // announce myself.
  r = tcp_write(CEPH_BANNER, strlen(CEPH_BANNER));
  if (r < 0) {
    ldout(msgr->cct,10) << "accept couldn't write banner" << dendl;
    goto fail_unlocked;
  }

  // and my addr
  ::encode(msgr->my_inst.addr, addrs, 0);  // legacy

  port = msgr->my_inst.addr.get_port();

  // and peer's socket addr (they might not know their ip)
  sockaddr_storage ss;
  len = sizeof(ss);
  r = ::getpeername(sd, (sockaddr*)&ss, &len);
  if (r < 0) {
    ldout(msgr->cct,0) << "accept failed to getpeername " << cpp_strerror(errno) << dendl;
    goto fail_unlocked;
  }
  socket_addr.set_sockaddr((sockaddr*)&ss);
  ::encode(socket_addr, addrs, 0);  // legacy

  r = tcp_write(addrs.c_str(), addrs.length());
  if (r < 0) {
    ldout(msgr->cct,10) << "accept couldn't write my+peer addr" << dendl;
    goto fail_unlocked;
  }

  ldout(msgr->cct,1) << "accept sd=" << sd << " " << socket_addr << dendl;

  // identify peer
  if (tcp_read(banner, strlen(CEPH_BANNER)) < 0) {
    ldout(msgr->cct,10) << "accept couldn't read banner" << dendl;
    goto fail_unlocked;
  }
  if (memcmp(banner, CEPH_BANNER, strlen(CEPH_BANNER))) {
    banner[strlen(CEPH_BANNER)] = 0;
    ldout(msgr->cct,1) << "accept peer sent bad banner '" << banner << "' (should be '" << CEPH_BANNER << "')" << dendl;
    goto fail_unlocked;
  }
  {
    bufferptr tp(sizeof(


2
echo $?
```

```js
// zx
await $`sleep 2`.timeout('1ms');
// Error:
//   at file:///home/me/Desktop/example.js:6:12
//   exit code: null
//   signal: SIGTERM
```

```js
// Execa
await $({timeout: 1})`sleep 2`;
// ExecaError: Command timed out after 1 milliseconds: sleep 2
//     at file:///home/me/Desktop/example.js:2:20
//     at ... {
//   shortMessage: 'Command timed out after 1 milliseconds: sleep 2\nTimed out',
//   originalMessage: '',
//   command: 'sleep 2',
//   escapedCommand: 'sleep 2',
//   cwd: '/path/to/cwd',
//   durationMs: 19.95693,
//   failed: true,
//   timedOut: true,
//   isCanceled: false,
//   isTerminated: true,
//   isMaxBuffer: false,
//   signal: 'SIGTERM',
//   signalDescription: 'Termination',
//   stdout: '',
//   stderr: '',
//   stdio: [undefined, '', ''],
//   pipedFrom: []
// }
```

[More info.](errors.md)

### Exit codes

```sh
# Bash
npm run build
echo $?
```

```js
// zx
const {exitCode} = await $`npm run build`.nothrow();
```

```js
// Execa
const {exitCode} = await $({reject: false})`npm run build`;
```

[More info.](errors.md#exit-code)

### Timeouts

```sh
# Bash
timeout 5 npm run build
```

```js
// zx
await $`npm run build`.timeout('5s');
```

```js
// Execa
await $({timeout: 5000})`npm run build`;
```

[More info.](termination.md#timeout)

### Current filename

```sh
# Bash
echo "$(basename "$0")"
```

```js
// zx
await $`echo ${__filename}`;
```

```js
// Execa
await $`echo ${import.meta.filename}`;
```

### Current directory

```sh
# Bash
cd project
```

```js
// zx
const $$ = $({cwd: 'project'});

// Or:
cd('project');
```

```js
// Execa
const $$ = $({cwd: 'project'});
```

[More info.](environment.md#current-directory)

### Background subprocess

```sh
# Bash
npm run build &
```

```js
// zx
await $({detached: true})`npm run build`;
```

```js
// Execa
await $({detached: true})`npm run build`;
```

[More info.](environment.md#background-subprocess)

### IPC

```sh
# Bash does not allow simple IPC
```

```js
// zx does not allow simple IPC
```

```js
// Execa
const subprocess = $({node: true})`script.js`;

for await (const message of subprocess.getEachMessage()) {
	if (message === 'ping') {
		await subprocess.sendMessage('pong');
	}
});
```

[More info.](ipc.md)

### Transforms

```sh
# Bash does not allow transforms
```

```js
// zx does not allow transforms
```

```js
// Execa
const transform = function * (line) {
	if (!line.includes('secret')) {
		yield line;
	}
};

await $({stdout: [transform, 'inherit']})`echo ${'This is a secret.'}`;
```

[More info.](transform.md)

### Signal termination

```sh
# Bash
kill $PID
```

```js
// zx
subprocess.kill();
```

```js
// Execa
subprocess.kill();

// Or with an error message and stack trace:
subprocess.kill(


   this[GXTemplateKey.STYLE_MODE] = "scaleToFill"
            this[GXTemplateKey.STYLE_MODE_TYPE] = "scale"

            // View Border Style
            this[GXTemplateKey.STYLE_BORDER_WIDTH] = "1px"
            this[GXTemplateKey.STYLE_BORDER_RADIUS] = "1px"
            this[GXTemplateKey.STYLE_BORDER_COLOR] = "#00FF00"

            // View Border Radii
            this[GXTemplateKey.STYLE_BORDER_TOP_LEFT_RADIUS] = "1px"
            this[GXTemplateKey.STYLE_BORDER_TOP_RIGHT_RADIUS] = "2px"
            this[GXTemplateKey.STYLE_BORDER_BOTTOM_LEFT_RADIUS] = "3px"
            this[GXTemplateKey.STYLE_BORDER_BOTTOM_RIGHT_RADIUS] = "4px"

            // View Padding
            this[GXTemplateKey.FLEXBOX_PADDING] = "1px"

            // View Background Style
            this[GXTemplateKey.STYLE_BACKGROUND_IMAGE] =
                "linear-gradient(to bottom right, red , yellow)"
            this[GXTemplateKey.STYLE_BACKGROUND_COLOR] = "#00FF00"

            // View Common Style
            this[GXTemplateKey.FLEXBOX_DISPLAY] = "flex"
            this[GXTemplateKey.STYLE_HIDDEN] = "true"
            this[GXTemplateKey.STYLE_BOX_SHADOW] = "0px 5px 5px 5px #ff0000"
            this[GXTemplateKey.STYLE_OPACITY] = "0.5"
            this[GXTemplateKey.FLEXBOX_OVERFLOW] = "visible"
        })

        Assert.assertEquals(false, style.isEmptyStyle())

        // Text
        Assert.assertEquals(10F.dpToPx(), style.fontSize?.valueFloat)
        Assert.assertEquals(GXColor.create("#00FF00")?.value(), style.fontColor?.value())
        Assert.assertEquals(Typeface.DEFAULT, style.fontWeight)
        Assert.assertEquals(2, style.fontLines)
        Assert.assertEquals(20F.dpToPx(), style.fontLineHeight?.valueFloat)
        Assert.assertEquals(TextUtils.TruncateAt.END, style.fontTextOverflow)
        Assert.assertEquals(Paint.STRIKE_THRU_TEXT_FLAG, style.fontTextDecoration)

        // Image
        Assert.assertEquals("scaleToFill", style.mode?.mode)
        Assert.assertEquals("scale", style.mode?.modeType)

        // Border
        Assert.assertEquals(1F.dpToPx(), style.borderWidth?.valueFloat)
        Assert.assertEquals(1F.dpToPx(), style.borderRadius?.topLeft?.valueFloat)
        Assert.assertEquals(2F.dpToPx(), style.borderRadius?.topRight?.valueFloat)
        Assert.assertEquals(3F.dpToPx(), style.borderRadius?.bottomLeft?.valueFloat)
        Assert.assertEquals(4F.dpToPx(), style.borderRadius?.bottomRight?.valueFloat)

        // Padding
        Assert.assertEquals(1F.dpToPx(), style.padding?.start?.valueFloat)
        Assert.assertEquals(1F.dpToPx(), style.padding?.top?.valueFloat)
        Assert.assertEquals(1F.dpToPx(), style.padding?.end?.valueFloat)
        Assert.assertEquals(1F.dpToPx(), style.padding?.bottom?.valueFloat)

        // Background
        Assert.assertEquals(GradientDrawable.Orientation.TL_BR, style.backgroundImage?.direction)
        Assert.assertEquals(
            GXColor.create("#00FF00")?.value(),
            style.backgroundColor?.value()
        )

        // Common
        Assert.assertEquals(View.VISIBLE, style.display)
        Assert.assertEquals(View.INVISIBLE, style.hidden)
        Assert.assertEquals(0.5F,


	fun `hashPin delegates to PinCrypto with device id`() = runTest {
		val pin = "9999"
		val hashed = HashedPin("hh", "ss")
		coEvery { pinCrypto.hashPin(pin, deviceId) } returns hashed

		val result = repo.hashPin(pin)

		assertEquals(hashed, result)
	}

	@Test
	fun `verifyPin delegates to PinCrypto with device id`() = runTest {
		val input = "1111"
		val stored = HashedPin("h1", "s1")
		coEvery { pinCrypto.verifyPin(input, stored, deviceId) } returns true

		assertTrue(repo.verifyPin(input, stored))
	}

	@Test
	fun `verifySecurityPin uses getHashedPin and verifyPin`() = runTest {
		val input = "2222"
		val stored = HashedPin("h2", "s2")
		coEvery { dataSource.getCipheredPin() } returns XorCipher.encrypt(Json.encodeToString(stored), cipherKey)
		coEvery { pinCrypto.verifyPin(input, stored, deviceId) } returns true

		assertTrue(repo.verifySecurityPin(input))
	}

	@Test
	fun `verifySecurityPin returns false when no stored pin`() = runTest {
		coEvery { dataSource.getCipheredPin() } returns null
		assertFalse(repo.verifySecurityPin("0000"))
	}

	@Test
	fun `setPoisonPillPin stores ciphered hashed and plain`() = runTest {
		val ppp = "5678"
		val hashed = HashedPin("ph", "ps")
		coEvery { pinCrypto.hashPin(ppp, deviceId) } returns hashed

		val expectedHashed = XorCipher.encrypt(Json.encodeToString(hashed), cipherKey)
		val expectedPlain = XorCipher.encrypt(ppp, cipherKey)

		repo.setPoisonPillPin(ppp)

		coVerify { dataSource.setPoisonPillPin(expectedHashed, expectedPlain) }
	}

	@Test
	fun `getPlainPoisonPillPin decrypts plain PPP`() = runTest {
		val ppp = "7777"
		val ciphered = XorCipher.encrypt(ppp, cipherKey)
		coEvery { dataSource.getPlainPoisonPillPin() } returns ciphered

		val result = repo.getPlainPoisonPillPin()
		assertEquals(ppp, result)
	}

	@Test
	fun `getPlainPoisonPillPin returns null when not set`() = runTest {
		coEvery { dataSource.getPlainPoisonPillPin() } returns null
		assertNull(repo.getPlainPoisonPillPin())
	}

	@Test
	fun `getHashedPoisonPillPin decrypts and decodes`() = runTest {
		val stored = HashedPin("h3", "s3")
		val ciphered = XorCipher.encrypt(Json.encodeToString(stored), cipherKey)
		coEvery { dataSource.getHashedPoisonPillPin() } returns ciphered

		val result = repo.getHashedPoisonPillPin()
		assertNotNull(result)
		assertEquals(stored, result)
	}

	@Test
	fun `hasPoisonPillPin true only when both main and PPP exist`() = runTest {
		// Main pin present
		coEvery { dataSource.getCipheredPin() } returns XorCipher.encrypt(
			Json.encodeToString(HashedPin("mh", "ms")),
			cipherKey
		)
		// PPP present
		coEvery { dataSource.getHashedPoisonPillPin() } returns XorCipher.encrypt(
			Json.encodeToString(
				HashedPin(
					"ph",
					"ps"
				)
			), cipherKey
		)

		assertTrue(repo.hasPoisonPillPin())
	}

	@Test
	fun `hasPoisonPillPin false when one missing`() = runTest {
		// Main pin present, PPP missing
		coEvery { dataSource.getCipheredPin() } returns XorCipher.encrypt


 'fileB', 'fileC'] },
                { type: 'SINGLE_SCOPE', scope: 'scopeB' }
            ]
        },
        {
            type: 'FILE_RULE',
            name: 'filesRuleC',
            effect: 'file',
            scope: [
                { type: 'FILE_LIST', files: ['fileD'] },
                { type: 'SINGLE_SCOPE', scope: 'scopeA' }
            ]
        }
    ],
    expectedObject: ((): Policy => {
        let fileRuleA = new FileRule("filesRuleA", "scopeA", ['fileA']);
        let fileRuleB = new FileRule("filesRuleB", "scopeB", ["fileA", "fileB", "fileC"]);
        let fileRuleC = new FileRule("filesRuleC", "scopeA", ["fileD"]);

        return new Policy("dummy", new Array<Rule>(),
            [fileRuleA, fileRuleB, fileRuleC], new Array<Import>());
    })(),

};

export let fileRulesWithMoreExpressions = {
    code: `
import moreFileRules as mfr;
filesRuleA : file {
    files = fileA;
    scope = scopeA;
}
            ruleAInBetween {}
            ruleBInBetween {}

            filesRuleB : file {
                files = fileA, fileB, fileC;
                scope = scopeA;
            }
    `,
    expectedTree: [
        { type: 'IMPORT', policy: 'moreFileRules', alias: 'mfr' },
        {
            type: 'FILE_RULE',
            name: 'filesRuleA',
            effect: 'file',
            scope: [
                { type: 'FILE_LIST', files: ['fileA'] },
                { type: 'SINGLE_SCOPE', scope: 'scopeA' }
            ]
        },
        {
            type: 'BOOLEAN_RULE',
            name: 'ruleAInBetween',
            effect: 'boolean',
            scope: []
        },
        {
            type: 'BOOLEAN_RULE',
            name: 'ruleBInBetween',
            effect: 'boolean',
            scope: []
        },
        {
            type: 'FILE_RULE',
            name: 'filesRuleB',
            effect: 'file',
            scope: [
                { type: 'FILE_LIST', files: ['fileA', 'fileB', 'fileC'] },
                { type: 'SINGLE_SCOPE', scope: 'scopeA' }
            ]
        }
    ],
    expectedObject: ((): Policy => {
        let ruleInBetweenA = new Rule("ruleAInBetween", RuleType.BOOLEAN, new Scope([]));
        let ruleInBetweenB = new Rule("ruleBInBetween", RuleType.BOOLEAN, new Scope([]));
        let importCmd = new Import("moreFileRules", "mfr");
        let fileRuleA = new FileRule("filesRuleA", "scopeA", ['fileA']);
        let fileRuleB = new FileRule("filesRuleB", "scopeA", ["fileA", "fileB", "fileC"]);
        return new Policy("dummy",
            [ruleInBetweenA, ruleInBetweenB],
            [fileRuleA, fileRuleB],
            [importCmd]);
    })(),
}import {addTodolist, todolistsReducer, TodolistType} from './todolists-reducer'
import {tasksReducer, Tasks} from '../tasks-reducer/tasks-reducer'

test('ID\'s should be equals', () => {
    const startTasksState: Tasks = {}
    const startTodolistsState: Array<TodolistType> = []

    const newTodolist = {
        id: '100',
        title: 'What to learn',
        order: 0,
        addedDate: ''
    }

    const action = addTodolist({todolist: newTodolist})

    const endTasksState = tasksReducer(startTasksState, action)
    const endTodolist


 = 2 * i;
 }

 for (i = 0; i < n; i++)
 {
  printf("%d, ", *(p + i));
 }
 printf("\n");

 return 0;
}
```

### 6.3 指针加减运算

#### 加法运算

- 指针计算不是简单的整数相加
- 如果是一个int *，+1的结果是增加一个int的大小
- 如果是一个char *，+1的结果是增加一个char大小

以int型指针为例，假设int*型指针p中存储的地址为0x2016，对其进行如下操作：

![1500552968195](images/1500552968195.png)

```c
#include <stdio.h>

int main()
{
 int a;
 int *p = &a;
 printf("%d\n", p);
 p += 2;//移动了2个int
 printf("%d\n", p);

 char b = 0;
 char *p1 = &b;
 printf("%d\n", p1);
 p1 += 2;//移动了2个char
 printf("%d\n", p1);

 return 0;
}
```
通过改变指针指向操作数组元素：

```c
#include <stdio.h>

int main()
{
 int a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
 int i = 0;
 int n = sizeof(a) / sizeof(a[0]);

 int *p = a;
 for (i = 0; i < n; i++)
 {
  printf("%d, ", *p);
  p++;
 }
 printf("\n");
 return 0;
}
```
#### 减法运算

示例1：

```c
#include <stdio.h>

int main()
{
 int a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
 int i = 0;
 int n = sizeof(a) / sizeof(a[0]);

 int *p = a+n-1;
 for (i = 0; i < n; i++)
 {
  printf("%d, ", *p);
  p--;
 }
 printf("\n");

 return 0;
}
```
示例2：

```c
#include <stdio.h>

int main()
{
 int a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
 int *p2 = &a[2]; //第2个元素地址
 int *p1 = &a[1]; //第1个元素地址
 printf("p1 = %p, p2 = %p\n", p1, p2);

 int n1 = p2 - p1; //n1 = 1
 int n2 = (int)p2 - (int)p1; //n2 = 4
 printf("n1 = %d, n2 = %d\n", n1, n2);
 return 0;
}
```
#### 指针的步长

p+1 = p的值+p的基类型的字节数，p+1 = p + 1*sizeof(p的数据类型)

![指针p加1的内存图解](images/指针p加1的内存图解.png)

### 6.4 指针数组

指针数组，它是数组，数组的每个元素都是指针类型。

```c
#include <stdio


return {
	fadeOut = 1.5,
	mode = 2,
	fadeType = 2,
	once = true,
	id = "SHANCHENGLIFU3",
	fadein = 1.5,
	scripts = {
		{
			mode = 1,
			stopbgm = true,
			sequence = {
				{
					"The Special Banquet\n\n<size=45>Chapter 3: Cleveland Enters!</size>",
					1
				}
			}
		},
		{
			side = 2,
			stopbgm = true,
			dir = 1,
			blackBg = true,
			say = "Port - Outside the Gymnasium",
			flashout = {
				dur = 1,
				black = true,
				alpha = {
					0,
					1
				}
			},
			flashin = {
				delay = 1,
				dur = 1,
				black = true,
				alpha = {
					1,
					0
				}
			},
			typewriter = {
				speed = 0.05,
				speedUp = 0.01
			}
		},
		{
			actor = 102092,
			side = 2,
			nameColor = "#a9f548",
			dir = 1,
			blackBg = true,
			say = "Ugh... Should I go in or not...",
			typewriter = {
				speed = 0.05,
				speedUp = 0.01
			},
			painting = {
				alpha = 0.3,
				time = 1
			}
		},
		{
			actor = 102092,
			side = 2,
			nameColor = "#a9f548",
			dir = 1,
			blackBg = true,
			say = "I know that I caved and agreed to wear men's attire, but I'm not sure I have the heart to go in...",
			typewriter = {
				speed = 0.05,
				speedUp = 0.01
			},
			painting = {
				alpha = 0.3,
				time = 1
			}
		},
		{
			actor = 102092,
			side = 2,
			nameColor = "#a9f548",
			dir = 1,
			blackBg = true,
			say = "Why the heck do I have to wear a suit anyway when everyone else is wearing a pretty dress...",
			typewriter = {
				speed = 0.05,
				speedUp = 0.01
			},
			painting = {
				alpha = 0.3,
				time = 1
			}
		},
		{
			actor = 102092,
			side = 2,
			nameColor = "#a9f548",
			dir = 1,
			blackBg = true,
			say = "... But I have to admit, this is way more comfortable...",
			typewriter = {
				speed = 0.05,
				speedUp = 0.01
			},
			painting = {
				alpha = 0.3,
				time = 1
			}
		},
		{
			side = 2,
			dir = 1,
			blackBg = true,
			actor = 102092,
			nameColor = "#a9f548",
			say = "No no, it's definitely weird that I'm the only one wearing a suit...",
			typewriter = {
				speed = 0.05,
				speedUp = 0.01
			},
			painting = {
				alpha = 0.3,
				time = 1
			},
			action = {
				{
					y = 60,
					type = "shake",
					delay = 0.2,
					dur = 0.2,
					x = 0,
					number = 2
				}
			}
		},
		{
			actor = 102092,
			side = 2,
			nameColor = "#a9f548",
			dir = 1,
			blackBg = true,
			say = "…………",
			typewriter = {
				speed = 0.05,
				speedUp = 0.01
			},
			painting = {
				alpha = 0.3,
				time = 1
			}
		},
		{
			actor = 102092,
			sid


import http.server
import socketserver
import sys

# Function to print the POST payload
def print_payload(payload):
    print("Received POST payload:")
    print(payload.decode("utf-8"))

# Create a custom request handler
class SimpleHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
    def do_GET(self):
        # Handle GET requests
        self.send_response(200)
        self.send_header("Content-type", "text/html")
        self.end_headers()
        self.wfile.write(b"Hello, this is a simple HTTP server!")

    def do_POST(self):
        # Handle POST requests
        content_length = int(self.headers["Content-Length"])
        post_data = self.rfile.read(content_length)

        # Print the POST payload
        print_payload(post_data)

        # Send a simple response
        self.send_response(200)
        self.send_header("Content-type", "text/plain")
        self.end_headers()
        self.wfile.write(b"POST request received and processed")

# Check if the correct number of command-line arguments is provided
if len(sys.argv) != 2:
    print("Usage: python script_name.py <interface>")
    sys.exit(1)

# Get the interface from command-line argument
interface = sys.argv[1]
port = 80

# Create the server
with socketserver.TCPServer((interface, port), SimpleHTTPRequestHandler) as httpd:
    print(f"Serving on {interface}:{port}")
    # Start the server
    httpd.serve_forever()


ogs=${encodeURIComponent('query:++foo++')}`;
        const {logQuery} = getRunPageFilters(query);
        expect(logQuery).toMatchObject([{token: 'query', value: '++foo++'}]);
      });

      it('extracts a `steps` list from params', () => {
        const query = `logs=${encodeURIComponent('query:foo, bar, baz')}`;
        const {logQuery} = getRunPageFilters(query);
        expect(logQuery).toMatchObject([{token: 'query', value: 'foo, bar, baz'}]);
      });
    });

    describe('multiple extractions', () => {
      it('extracts `query` and `step`', () => {
        const query = `logs=${encodeURIComponent('query:bar++')}&logs=step:foo`;
        const {logQuery} = getRunPageFilters(query);
        expect(logQuery).toMatchObject([
          {token: 'query', value: 'bar++'},
          {token: 'step', value: 'foo'},
        ]);
      });

      it('extracts `query` with commas, and `step`', () => {
        const query = `logs=${encodeURIComponent('query:bar1,bar2')}&logs=step:foo`;
        const {logQuery} = getRunPageFilters(query);
        expect(logQuery).toMatchObject([
          {token: 'query', value: 'bar1,bar2'},
          {token: 'step', value: 'foo'},
        ]);
      });

      it('extracts `query` with commas, and free text', () => {
        const query = `logs=${encodeURIComponent('query:bar1,bar2')}&logs=foo`;
        const {logQuery} = getRunPageFilters(query);
        expect(logQuery).toMatchObject([{token: 'query', value: 'bar1,bar2'}, {value: 'foo'}]);
      });

      it('extracts `query` and `levels`', () => {
        const query = `logs=${encodeURIComponent('query:bar1,bar2')}&levels=error&levels=warning`;
        const {levels, logQuery} = getRunPageFilters(query);
        expect(logQuery).toMatchObject([{token: 'query', value: 'bar1,bar2'}]);
        expect(levels).toMatchObject({ERROR: true, WARNING: true});
      });
    });
  });

  describe('`levels` extraction', () => {
    it('extracts `levels` from params', () => {
      const query = 'levels=error';
      const {levels} = getRunPageFilters(query);
      expect(levels).toMatchObject({ERROR: true});
    });

    it('extracts multiple `levels` from params', () => {
      const query = 'levels=error&levels=warning';
      const {levels} = getRunPageFilters(query);
      expect(levels).toMatchObject({ERROR: true, WARNING: true});
    });

    it('ignores invalid `levels`', () => {
      const query = 'levels=error&levels=foo';
      const {levels} = getRunPageFilters(query);
      expect(levels).toMatchObject({ERROR: true});
    });

    it('sets default levels if none specified', () => {
      const query = 'query=type:foo';
      const {levels} = getRunPageFilters(query);
      expect(levels).toMatchObject({
        INFO: true,
        WARNING: true,
        ERROR: true,
        CRITICAL: true,
        EVENT: true,
      });
    });
  });

  describe('free text `logs` extraction', () => {
    it('extracts free text from params', () => {
      const query = 'logs=foobarbaz';
      const {logQuery} = getRunPageFilters(query);
      expect(logQuery).toMatchObject([{value: 'foobarbaz'}]);
    });

    it('treats unknown tokens


/* 202F4C 801E035C 00095080 */  sll         $t2, $t1, 2
/* 202F50 801E0360 00CA5821 */  addu        $t3, $a2, $t2
/* 202F54 801E0364 E5660000 */  swc1        $f6, 0x0($t3)
/* 202F58 801E0368 8C430000 */  lw          $v1, 0x0($v0)
/* 202F5C 801E036C 3C01800E */  lui         $at, %hi(D_800E3AD0)
/* 202F60 801E0370 35EF0639 */  ori         $t7, $t7, (0x10639 & 0xFFFF)
/* 202F64 801E0374 00031880 */  sll         $v1, $v1, 2
/* 202F68 801E0378 00C36021 */  addu        $t4, $a2, $v1
/* 202F6C 801E037C C5880000 */  lwc1        $f8, 0x0($t4)
/* 202F70 801E0380 00230821 */  addu        $at, $at, $v1
/* 202F74 801E0384 E4283AD0 */  swc1        $f8, %lo(D_800E3AD0)($at)
/* 202F78 801E0388 8C4D0000 */  lw          $t5, 0x0($v0)
/* 202F7C 801E038C 3C01C0E0 */  lui         $at, (0xC0E00000 >> 16)
/* 202F80 801E0390 44815000 */  mtc1        $at, $f10
/* 202F84 801E0394 3C01800E */  lui         $at, %hi(D_800E3210)
/* 202F88 801E0398 000D7080 */  sll         $t6, $t5, 2
/* 202F8C 801E039C 002E0821 */  addu        $at, $at, $t6
/* 202F90 801E03A0 E42A3210 */  swc1        $f10, %lo(D_800E3210)($at)
/* 202F94 801E03A4 8C580000 */  lw          $t8, 0x0($v0)
/* 202F98 801E03A8 3C01800F */  lui         $at, %hi(D_800E9C60)
/* 202F9C 801E03AC 0018C880 */  sll         $t9, $t8, 2
/* 202FA0 801E03B0 00390821 */  addu        $at, $at, $t9
/* 202FA4 801E03B4 0C002DAF */  jal         finish_current_thread
/* 202FA8 801E03B8 AC2F9C60 */   sw         $t7, %lo(D_800E9C60)($at)
/* 202FAC 801E03BC 8FAA0024 */  lw          $t2, 0x24($sp)
/* 202FB0 801E03C0 24090001 */  addiu       $t1, $zero, 0x1
/* 202FB4 801E03C4 A1490040 */  sb          $t1, 0x40($t2)
/* 202FB8 801E03C8 0C068FA0 */  jal         func_801A3E80
/* 202FBC 801E03CC 8FA40028 */   lw         $a0, 0x28($sp)
/* 202FC0 801E03D0 8FBF001C */  lw          $ra, 0x1C($sp)
/* 202FC4 801E03D4 27BD0028 */  addiu       $sp, $sp, 0x28
/* 202FC8 801E03D8 03E00008 */  jr          $ra
/* 202FCC 801E03DC 00000000 */   nop
.size func_801E025C_ovl14, . - func_801E025C_ovl14

glabel func_801E03E0_ovl14 # 67
/*


kunt [mijn blogpost over deze kwestie](/blog/email-spam-problems/) lezen voor alle details, maar als je een van deze adressen hebt, zou je deze e-mails nu moeten krijgen. Het enige nadeel is dat je ze misschien twee keer krijgt.

## Verwijzingen
Als mensen een link naar je site plaatsen en bezoekers klikken op die link, dan heet dat een verwijzing. De bloggers onder jullie zijn misschien bekend met het doorbladeren van je Google Analytics-rapporten om te zien wie er naar je heeft gelinkt.

Deze site maakt geen gebruik van Google Analytics --- er is [een blogpost met details over dat](/blog/privacy-choices/) ook --- maar legt nog steeds verwijzingen vast. Het overzicht van recente verwijzingen is voor iedereen beschikbaar op [de statuspagina](/status).

Linken naar freesewing.org is natuurlijk leuk om te doen, dus ik houd de verwijzingen in de gaten en als er een site opduikt die van een gebruiker is, krijg je de Ambassador badge.

![Linken naar freesewing.org is een manier om de ambassadeurbadge vrij te spelen.](https://posts.freesewing.org/uploads/badge_ambassador_3dd1e722cc.svg)

Het is een kleine manier om je te bedanken voor het verspreiden van freesewing.

## Donaties
In september hebben we het donatiebedrag van vorig jaar gepasseerd, dus het is fijn om te zien dat ik dit jaar [meer geld naar AzG](/about/pledge#donations-history) kan sturen dan in 2016.

Je kunt de donaties altijd volgen op [de donaties belofte pagina](/about/pledge#donations-history), maar hier is de huidige status:

![Joehoew! Beter dan vorig jaar](https://posts.freesewing.org/uploads/donations_68e214d133.svg)

## Meer downloadformaten

Ik heb ook extra formaten toegevoegd aan de concept downloadpagina. Je hebt nu de keuze uit SVG, PDF, brief-PDF, tabloid-PDF, A4-PDF, A3-PDF, A2-PDF, A1-PDF en A0-PDF.

## De badge voor kwaliteitscontrole
Ik heb de kwaliteitscontrolebadge toegevoegd voor dingen als het melden (of repareren) van typefouten, gebroken links, grammatica en andere kleine verbeteringen.

![Zie je een typefout? Laat het me weten en je krijgt dit](https://posts.freesewing.org/uploads/badge_quality_control_6acb8c10c2.svg)

Dit lijkt misschien geen wereldschokkende bijdrage, maar toch zijn ze belangrijk.

Op het spectrum tussen eindeloos zwoegen op de perfecte inhoud voordat je het publiceert, of het snel uitbrengen met alles erop en eraan, neig ik sterk naar het laatste. Dus ik reken een beetje op jullie om me te laten weten wanneer ik het verprutst heb.

## Vooruitkijken naar oktober

Er zijn 5 patronen waar ik momenteel aan werk. En ze zijn allemaal zover klaar dat ik ze moet maken om te controleren of ze werken zoals bedoeld. Eerst een mousseline en dan het echte werk.

Dat is een beetje een knelpunt voor mij omdat ik lang moet pendelen, dus mijn naaitijd is meestal beperkt tot het weekend.

De enige manier die ik zie om het proces van het uitbrengen van patronen te versnellen


.0;

    // Convert OGS rank (floating point) to our Rank enum
    final rank = _ogsRankToRank(rankValue);

    return UserInfo(
      userId: userId,
      username: username,
      rank: rank,
      online: false, // We don't have online status from gamedata
      winCount: 0, // We don't have win/loss counts from gamedata
      lossCount: 0,
    );
  }

  Rank _ogsRankToRank(double ogsRank) {
    if (ogsRank > 900) {
      // Professional ranks on OGS are shifted up by 1000 for whatever reason
      final proLevel = (ogsRank - 1000 - 36).floor().clamp(1, 10);
      return Rank.values[Rank.p1.index + proLevel - 1];
    } else {
      final enumIndex = ogsRank.floor().clamp(0, 39);
      return Rank.values[enumIndex];
    }
  }

  GameResult _parseGameResult(
      int winnerId, String outcome, Map<String, dynamic>? players) {
    wq.Color? winner;

    if (players != null) {
      final blackPlayer = players['black'] as Map<String, dynamic>?;
      final whitePlayer = players['white'] as Map<String, dynamic>?;

      final blackId = blackPlayer?['id'] as int?;
      final whiteId = whitePlayer?['id'] as int?;

      if (winnerId == blackId) {
        winner = wq.Color.black;
      } else if (winnerId == whiteId) {
        winner = wq.Color.white;
      }
    }

    // Map OGS outcome to our result format
    final result = switch (outcome.toLowerCase()) {
      'resignation' => 'Resignation',
      'timeout' => 'Time',
      'cancellation' => 'Cancellation',
      // Score-based results, e.g. "W+5.5"
      _ => outcome, // Keep original for score-based results
    };

    return GameResult(
      winner: winner,
      result: result,
      description: outcome,
    );
  }

  void _handleRemovedStonesAccepted(Map<String, dynamic> data) {
    _logger.fine('Received removed stones accepted for game $id');

    try {
      // Check if this is just the server telling us about our own acceptance
      final playerId = data['player_id'] as int?;
      if (playerId?.toString() == _myUserId) {
        _logger.fine('Ignoring our own stone removal acceptance');
        return;
      }

      _recentlyRemovedStonesString = data['stones'] as String? ?? '';

      final countingResult = _calculateCountingResultFromOwnership(data);
      _countingResultController.add(countingResult);
    } catch (error) {
      _logger.warning(
          'Error handling removed stones accepted for game $id: $error');
    }
  }

  void _handleClock(Map<String, dynamic> data) {
    _logger.fine('Received clock update for game $id');

    try {
      final blackTimeData = data['black_time'] as Map<String, dynamic>?;
      final whiteTimeData = data['white_time'] as Map<String, dynamic>?;

      if (blackTimeData != null) {
        blackTime.value =
            (blackTime.value.$1 + 1, _parseOGSTimeData(blackTimeData));
      }

      if (whiteTimeData != null) {
        whiteTime.value =
            (whiteTime.value.$1 + 1, _parseOGSTimeData(whiteTimeData));
      }

      _logger.fine(
          'Updated clock for game $id: blackTime=${blackTime.value}, whiteTime=${whiteTime.value}');
    } catch (error) {
      _logger.warning('Error handling clock update for game $id: $error');
    }
  }

  /// Helper function to safely convert dynamic value to double
  static Duration _parseSeconds(dynamic value) {
    if (value is double) return Duration(milliseconds: (value * 1000).toInt());
    if (va


 side: string) {
  return typeof value == "number" ? value : value[side];
}

function clientRect(node: HTMLElement) {
  let rect = node.getBoundingClientRect();
  // Make sure scrollbar width isn't included in the rectangle
  return { left: rect.left, right: rect.left + node.clientWidth, top: rect.top, bottom: rect.top + node.clientHeight };
}

export function scrollRectIntoView(
  view: EditorView,
  rect: { left: number; right: number; top: number; bottom: number },
  startDOM: HTMLElement
) {
  let scrollThreshold = view.someProp("scrollThreshold") || 0,
    scrollMargin = view.someProp("scrollMargin") || 5;
  let doc = view.dom.ownerDocument;
  for (let parent = startDOM || view.dom; ; parent = parentNode(parent)) {
    if (!parent) break;
    if (parent.nodeType != 1) continue;
    let atTop = parent == doc.body || parent.nodeType != 1;
    let bounding = atTop ? windowRect(doc) : clientRect(parent);
    let moveX = 0,
      moveY = 0;
    if (rect.top < bounding.top + getSide(scrollThreshold, "top"))
      moveY = -(bounding.top - rect.top + getSide(scrollMargin, "top"));
    else if (rect.bottom > bounding.bottom - getSide(scrollThreshold, "bottom"))
      moveY = rect.bottom - bounding.bottom + getSide(scrollMargin, "bottom");
    if (rect.left < bounding.left + getSide(scrollThreshold, "left"))
      moveX = -(bounding.left - rect.left + getSide(scrollMargin, "left"));
    else if (rect.right > bounding.right - getSide(scrollThreshold, "right"))
      moveX = rect.right - bounding.right + getSide(scrollMargin, "right");
    if (moveX || moveY) {
      if (atTop) {
        doc.defaultView.scrollBy(moveX, moveY);
      } else {
        let startX = parent.scrollLeft,
          startY = parent.scrollTop;
        if (moveY) parent.scrollTop += moveY;
        if (moveX) parent.scrollLeft += moveX;
        let dX = parent.scrollLeft - startX,
          dY = parent.scrollTop - startY;
        rect = { left: rect.left - dX, top: rect.top - dY, right: rect.right - dX, bottom: rect.bottom - dY };
      }
    }
    if (atTop) break;
  }
}

// Store the scroll position of the editor's parent nodes, along with
// the top position of an element near the top of the editor, which
// will be used to make sure the visible viewport remains stable even
// when the size of the content above changes.
export function storeScrollPos(view: EditorView) {
  let rect = view.dom.getBoundingClientRect(),
    startY = Math.max(0, rect.top);
  let refDOM: Element, refTop: number;
  for (let x = (rect.left + rect.right) / 2, y = startY + 1; y < Math.min(innerHeight, rect.bottom); y += 5) {
    let dom = (view.root as Document).elementFromPoint(x, y);
    if (dom == view.dom || !view.dom.contains(dom)) continue;
    let localRect = dom.getBoundingClientRect();
    if (localRect.top >= startY - 20) {
      refDOM = dom;
      refTop = localRect.top;
      break;
    }
  }
  return { refDOM, refTop, stack: scrollStack(view.dom) };
}

function scrollStack(dom: HTMLElement) {
  let stack = [],
    doc = dom.ownerDocument;
  for (; dom; dom = parentNode(dom)) {
    stack.push({ dom, top: dom.scrollTop, left: dom.scr


.

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(
    MaterialApp(
      title: 'Hardware Key Demo',
      home: Scaffold(
        appBar: AppBar(title: const Text('Hardware Key Demo')),
        body: const Center(child: HardwareKeyboardDemo()),
      ),
    ),
  );
}

class HardwareKeyboardDemo extends StatefulWidget {
  const HardwareKeyboardDemo({super.key});

  @override
  State<HardwareKeyboardDemo> createState() => _HardwareKeyboardDemoState();
}

class _HardwareKeyboardDemoState extends State<HardwareKeyboardDemo> {
  final FocusNode _focusNode = FocusNode();
  KeyEvent? _event;

  @override
  void dispose() {
    _focusNode.dispose();
    super.dispose();
  }

  KeyEventResult _handleKeyEvent(FocusNode node, KeyEvent event) {
    setState(() {
      _event = event;
    });
    return KeyEventResult.ignored;
  }

  @override
  Widget build(BuildContext context) {
    final TextTheme textTheme = Theme.of(context).textTheme;
    return Focus(
      focusNode: _focusNode,
      onKeyEvent: _handleKeyEvent,
      autofocus: true,
      child: AnimatedBuilder(
        animation: _focusNode,
        builder: (BuildContext context, Widget? child) {
          if (!_focusNode.hasFocus) {
            return GestureDetector(
              onTap: () {
                _focusNode.requestFocus();
              },
              child: Text('Tap to focus', style: textTheme.headlineMedium),
            );
          }

          if (_event == null) {
            return Text('Press a key', style: textTheme.headlineMedium);
          }

          final List<Widget> dataText = <Widget>[
            Text('${_event.runtimeType}'),
            if (_event?.character?.isNotEmpty ?? false)
              Text('character produced: "${_event?.character}"'),
          ];
          dataText.add(Text('logical: ${_event?.logicalKey}'));
          dataText.add(Text('physical: ${_event?.physicalKey}'));
          if (_event?.character != null) {
            dataText.add(Text('character: ${_event?.character}'));
          }
          final List<String> pressed = <String>['Pressed:'];
          for (final LogicalKeyboardKey key in HardwareKeyboard.instance.logicalKeysPressed) {
            pressed.add(key.debugName!);
          }
          dataText.add(Text(pressed.join(' ')));
          return DefaultTextStyle(
            style: textTheme.titleMedium!,
            child: Column(mainAxisAlignment: MainAxisAlignment.center, children: dataText),
          );
        },
      ),
    );
  }
}
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';

class AnimatedIconsTestApp extends StatelessWidget {
  const AnimatedIconsTestApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Animated Icons Test',
      home: Scaffold(body: IconsList()),
    );
  }
}

class IconsList extends StatelessWidget {
  const IconsList({super.key});

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: samples.map<IconSampleRow>((IconSample s) => IconSampleRow(s)).toList(),
    );
  }
}

class IconSampleRow extends StatefulWidget {
  const IconSampleRow(this.sample, {su


/***********************************************************************************/
/*  Copyright (c) 2002-2006, Silicon Image, Inc.  All rights reserved.             */
/*  No part of this work may be reproduced, modified, distributed, transmitted,    */
/*  transcribed, or translated into any language or computer format, in any form   */
/*  or by any means without written permission of: Silicon Image, Inc.,            */
/*  1060 East Arques Avenue, Sunnyvale, California 94085                           */
/***********************************************************************************/
#include "typedefs.h"
#include "timer.h"
#include "hi_unf_disp.h"

//                  Aspect ratio
#define _4     0  // 4:3
#define _4or16 1  // 4:3 or 16:9
#define _16    2  // 16:9

#define NSM    0 // no sub. mode

#define PC_BASE 60

#define NMODES 30

void GetVModeData(HI_U8, HI_U8 *);
HI_U8 VideoModeDetection(HI_U8 *);
void VMode_Handler(void);
HI_U16 GetPixelClock( HI_U8 );

//----------------------------------------------------------
typedef struct {
        HI_U8 FPixTMDS;
        HI_U16 Fs[3];
} PixPerSPDIFType;
//----------------------------------------------------------
typedef struct {
        HI_U16 FPixTMDS;
        HI_U32 Fs[7];

} NValType;
//----------------------------------------------------------

typedef struct {
   HI_U8 Mode_C1;
   HI_U8 Mode_C2;
   HI_U8 SubMode;
   HI_UNF_ENC_FMT_E  enUNFFmt_C1;
   HI_UNF_ENC_FMT_E  enUNFFmt_C2;
}ModeIdType;

typedef struct {
   HI_U16 Pixels;
   HI_U16 Lines;
} PxlLnTotalType;

typedef struct {
   HI_U16 H;
   HI_U16 V;
} HVPositionType;

typedef struct {
   HI_U16 H;
   HI_U16 V;
} HVResolutionType;

typedef struct{
   HI_U8 RefrTypeVHPol;
   HI_U16 VFreq;
   PxlLnTotalType Total;
} TagType;

typedef struct {
  HI_U8 IntAdjMode;
  HI_U16 HLength;
  HI_U16 VLength;
  HI_U16 Top;
  HI_U16 Dly;
  HI_U16 HBit2HSync;
  HI_U16 VBit2VSync;
  HI_U16 Field2Offset;

}  _656Type;

typedef struct {
   ModeIdType ModeId;
   HI_U16 PixClk;
   TagType Tag;
   HVPositionType Pos;
   HVResolutionType Res;
   HI_U8 AspectRatio;
   _656Type _656;
   HI_U8 PixRep;
} VModeInfoType;

typedef struct {
   HVPositionType HVPos;
   HVResolutionType HVRes;
} DEType;
//--------------------------------------------------------------------
typedef struct {

   HI_U16 CapHalfLineCnt;
   HI_U16 PreEqPulseCnt;
   HI_U16 SerratedCnt;
   HI_U16 PostEqPulseCnt;
   HI_U8 Field2BackPorch;

} InterlaceCSyncType;

extern const VModeInfoType VModeTables[NMODES];


EndsWith(incrementalToolSuffix, OperatingSystemHelper.PathComparison))
                {
                    result = true;
                    break;
                }
            }

            // Cache the result
            m_incrementalToolMatchCache.AddItem(toolPath, result);
            return result;
        }

        /// <summary>
        /// Logs a process sub phase and ensures the time is recored in the Counters
        /// </summary>
        public static


rust-lang.org/1.75.0/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized,\n    A: Allocator,\n    U: ?Sized,

","CoerceUnsized<Box>","sqlx::error::BoxDynError"],["
1.0.0 · source§
impl<T, A> Eq for Box<T, A>where\n    T: Eq + ?Sized,\n    A: Allocator,

","Eq","sqlx::error::BoxDynError"],["
1.0.0 · source§
impl<I, A> Iterator for Box<I, A>where\n    I: Iterator + ?Sized</a


* @deprecated Replaced by Mainnet - will be removed in v3
     */
    MainnetVDot3 = "mainnet",

    /**
     * @deprecated Replaced by Testnet - will be removed in v3
     */
    TestnetVDot3 = "testnet",

    /**
     * @deprecated Replaced by Devnet - will be removed in v3
     */
    DevnetVDot3 = "devnet",
}

export interface RenNetworkDetails {
    name: string;
    lightnode: string;
    isTestnet: boolean;
}

const renMainnet: RenNetworkDetails = {
    name: RenNetwork.Mainnet,
    lightnode: "https://lightnode-mainnet.herokuapp.com",
    isTestnet: false,
};
const renTestnet: RenNetworkDetails = {
    name: RenNetwork.Testnet,
    lightnode: "https://lightnode-testnet.herokuapp.com",
    isTestnet: true,
};
const renDevnet: RenNetworkDetails = {
    name: RenNetwork.Devnet,
    lightnode: "https://lightnode-devnet.herokuapp.com/",
    isTestnet: true,
};
const renLocalnet: RenNetworkDetails = {
    name: RenNetwork.Localnet,
    lightnode: "http://localhost:5000",
    isTestnet: true,
};

export const getRenNetworkDetails = (
    renNetwork: RenNetwork | RenNetworkString | RenNetworkDetails,
): RenNetworkDetails => {
    switch (renNetwork) {
        case RenNetwork.Mainnet:
        case RenNetwork.Mainnet as "mainnet":
        case "mainnet-v0.3":
            return renMainnet;
        case RenNetwork.Testnet:
        case RenNetwork.Testnet as "testnet":
        case "testnet-v0.3":
            return renTestnet;
        case RenNetwork.Devnet:
        case RenNetwork.Devnet as "devnet":
        case "devnet-v0.3":
            return renDevnet;
        case RenNetwork.Localnet:
        case RenNetwork.Localnet as "localnet":
            return renLocalnet;
        default:
            return renNetwork;
    }
};

export type RenNetworkString = "mainnet" | "testnet" | "devnet" | "localnet";

export const RenNetworks = [
    RenNetwork.Mainnet,
    RenNetwork.Testnet,
    RenNetwork.Devnet,
    RenNetwork.Localnet,
];
import { Subject } from "rxjs";
import { IBasePromise } from "./IBasePromise";

export class BasePromiseModel<T, E> implements IBasePromise<T, E> {
  isCompleted = false;
  isFailed = false;
  isLoading = false;
  isFinished = false;
  response?: T = undefined;
  error?: E = undefined;

  /**
   * contains the object of response
   * trigger everytime with the completed event
   */
  responseAsync = new Subject<T>();

  /**
   * contains the object of error
   * trigger everytime with the failed event
   */
  errorAsync = new Subject<E>();

  /**
   * trigger everytime with the finished event
   */
  finishAsync = new Subject<E>();

  public request(requestPromise: Promise<T>) {
    this.loading();
    requestPromise
      .then(this.completed)
      .catch(this.failed)
      .finally(this.finished);
  }

  public reset = () => {
    this.isLoading = false;
    this.isCompleted = false;
    this.isFailed = false;
    this.response = undefined;
    this.error = undefined;
  };

  protected loading = () => {
    this.isLoading = true;
    this.isCompleted = false;
    this.isFailed = false;
    this.isFinished = false;
    this.response = undefined;
    this.error = undefined;
  };

  protected completed = (promiseResponse: T) => {
    thi


FFFFFF),
    iconMouseOver: const Color(0xFFD32F2F));

class WindowButtons extends StatefulWidget {
  const WindowButtons({Key? key}) : super(key: key);

  @override
  State<WindowButtons> createState() => _WindowButtonsState();
}

class _WindowButtonsState extends State<WindowButtons> {
  final GlobalKey _menuKey = GlobalKey();
  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        MinimizeWindowButton(
          colors: buttonColors,
          animate: true,
        ),
        Theme(
          data: ThemeData.dark(),
          child: PopupMenuButton(
            key: _menuKey,
            onSelected: (value) {
              if (value == 1) {
                launch('https://github.com/odinapp/odin#readme');
              } else if (value == 2) {
                launch('https://www.buymeacoffee.com/HashStudios');
              }
            },
            child: MenuWindowButton(
              colors: buttonColors,
              animate: true,
              onPressed: () {
                dynamic state = _menuKey.currentState;
                state.showButtonMenu();
              },
            ),
            itemBuilder: (context) => [
              PopupMenuItem(
                child: Text(
                  "About",
                  style: GoogleFonts.poppins(fontSize: 12),
                ),
                height: 32,
                value: 1,
              ),
              PopupMenuItem(
                child: Text(
                  "Support us",
                  style: GoogleFonts.poppins(fontSize: 12),
                ),
                value: 2,
                height: 32,
              ),
            ],
          ),
        ),
        CloseWindowButton(
          colors: closeButtonColors,
          animate: true,
        ),
      ],
    );
  }
}
import 'package:flutter/material.dart';

class DropIconCustomPainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    Paint paint0Fill = Paint()..style = PaintingStyle.fill;
    paint0Fill.color = Colors.white.withOpacity(1.0);
    canvas.drawCircle(Offset(size.width * 0.5000000, size.height * 0.5000000),
        size.width * 0.4986500, paint0Fill);

    Path path_1 = Path();
    path_1.moveTo(size.width * 0.5000000, size.height * 0.5000000);
    path_1.lineTo(size.width * 0.3333333, size.height * 0.5000000);
    path_1.moveTo(size.width * 0.5000000, size.height * 0.3333333);
    path_1.lineTo(size.width * 0.5000000, size.height * 0.5000000);
    path_1.lineTo(size.width * 0.5000000, size.height * 0.3333333);
    path_1.close();
    path_1.moveTo(size.width * 0.5000000, size.height * 0.5000000);
    path_1.lineTo(size.width * 0.5000000, size.height * 0.6666667);
    path_1.lineTo(size.width * 0.5000000, size.height * 0.5000000);
    path_1.close();
    path_1.moveTo(size.width * 0.5000000, size.height * 0.5000000);
    path_1.lineTo(size.width * 0.6666667, size.height * 0.5000000);
    path_1.lineTo(size.width * 0.5000000, size.height * 0.5000000);
    path_1.close();

    Paint paint1Stroke = Paint()
      ..style = PaintingStyle.stroke
      ..strokeWidth = size.width * 0.05555567;
    paint1Stroke.color = const Color(0xff7D5DE


EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\n    importKey(format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\n    sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;\n    unwrapKey(format: "raw" | "pkcs8" | "spki" | "jwk" | string, wrappedKey: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\n    verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<boolean>;\n    wrapKey(format: "raw" | "pkcs8" | "spki" | "jwk" | string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams): Promise<ArrayBuffer>;\n}\n\ndeclare var SubtleCrypto: {\n    prototype: SubtleCrypto;\n    new(): SubtleCrypto;\n};\n\n/** A sync action that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker.  */\ninterface SyncEvent extends ExtendableEvent {\n    readonly lastChance: boolean;\n    readonly tag: string;\n}\n\ndeclare var SyncEvent: {\n    prototype: SyncEvent;\n    new(type: string, init: SyncEventInit): SyncEvent;\n};\n\n/** This ServiceWorker API interface provides an interface for registering and listing sync registrations. */\ninterface SyncManager {\n    getTags(): Promise<string[]>;\n    register(tag: string): Promise<void>;\n}\n\ndeclare var SyncManager: {\n    prototype: SyncManager;\n    new(): SyncManager;\n};\n\n/** A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */\ninterface TextDecoder extends TextDecoderCommon {\n    /**\n     * Returns the result of running encoding\'s decoder. The method can be invoked zero or more times with options\'s stream set to true, and then once without options\'s stream (or set to false), to process a fragmented input. If the invocation without options\'s stream (or set to false) has no input, it\'s clearest to omit both arguments.\n     * \n     * ```\n


stw r0, 0x17c(r5)
/* 80328524 00324184  7C 06 19 14 */	adde r0, r6, r3
/* 80328528 00324188  90 05 01 78 */	stw r0, 0x178(r5)
lbl_8032852C:
/* 8032852C 0032418C  7F E3 FB 78 */	mr r3, r31
/* 80328530 00324190  83 E1 01 DC */	lwz r31, 0x1dc(r1)
/* 80328534 00324194  83 C1 01 D8 */	lwz r30, 0x1d8(r1)
/* 80328538 00324198  83 A1 01 D4 */	lwz r29, 0x1d4(r1)
/* 8032853C 0032419C  80 01 01 E4 */	lwz r0, 0x1e4(r1)
/* 80328540 003241A0  7C 08 03 A6 */	mtlr r0
/* 80328544 003241A4  38 21 01 E0 */	addi r1, r1, 0x1e0
/* 80328548 003241A8  4E 80 00 20 */	blr

.global DWCi_NNStartupAsync
DWCi_NNStartupAsync:
/* 8032854C 003241AC  94 21 FF D0 */	stwu r1, -0x30(r1)
/* 80328550 003241B0  7C 08 02 A6 */	mflr r0
/* 80328554 003241B4  90 01 00 34 */	stw r0, 0x34(r1)
/* 80328558 003241B8  39 61 00 30 */	addi r11, r1, 0x30
/* 8032855C 003241BC  4B E9 EB C5 */	bl _savegpr_25
/* 80328560 003241C0  80 CD B0 68 */	lwz r6, lbl_80640328-_SDA_BASE_(r13)
/* 80328564 003241C4  3F E0 80 44 */	lis r31, lbl_80447FE0@ha
/* 80328568 003241C8  2C 03 00 00 */	cmpwi r3, 0
/* 8032856C 003241CC  7C BA 2B 78 */	mr r26, r5
/* 80328570 003241D0  8B A6 00 14 */	lbz r29, 0x14(r6)
/* 80328574 003241D4  3B FF 7F E0 */	addi r31, r31, lbl_80447FE0@l
/* 80328578 003241D8  3B 60 00 00 */	li r27, 0
/* 8032857C 003241DC  40 82 02 78 */	bne lbl_803287F4
/* 80328580 003241E0  A0 06 01 82 */	lhz r0, 0x182(r6)
/* 80328584 003241E4  7F 43 D3 78 */	mr r3, r26
/* 80328588 003241E8  80 86 02 10 */	lwz r4, 0x210(r6)
/* 8032858C 003241EC  54 1E 80 1E */	slwi r30, r0, 0x10
/* 80328590 003241F0  50 9E 04 3E */	rlwimi r30, r4, 0, 0x10, 0x1f
/* 80328594 003241F4  48 03 52 A9 */	bl SBServerHasPrivateAddress
/* 80328598 003241F8  2C 03 00 00 */	cmpwi r3, 0
/* 8032859C 003241FC  41 82 00 8C */	beq lbl_80328628
/* 803285A0 00324200  80 6D B0 68 */	lwz r3, lbl_80640328-_SDA_BASE_(r13)
/* 803285A4 00324204  80 63 00 E4 */	lwz r3, 0xe4(r3)
/* 803285A8 00324208  48 03 63 99 */	bl


#ifndef _DUAL_BANK_API_H_
#define _DUAL_BANK_API_H_

/* @brief:Api for getting the buffer size for temporary storage
 */
u32 get_dual_bank_passive_update_max_buf(void);

/* @brief:Initializes the update task,and setting the crc value and file size of new fw;
 * @param fw_crc:crc value of new fw file
 * @param fw_size:total size of new fw file
 * @param priv:reserved
 * @param max_ptk_len: Supported maxium length of every programming,it decides the max size of programming every time
 */
u32 dual_bank_passive_update_init(u32 fw_crc, u32 fw_size, u16 max_pkt_len, void *priv);

/* @brief:exit the update task
 * @param priv:reserved
 */
u32 dual_bank_passive_update_exit(void *priv);

/* @brief:Judge whether enough space for new fw file
 * @note: it should be called after dual_bank_passive_update_init(...);
 * @param fw_size:fw size of new fw file
 */
u32 dual_bank_update_allow_check(u32 fw_size);

/* @brief:copy the data to temporary buffer and notify task to write non-volatile storage
 * @param data:the pointer to download data
 * @param len:the length to download data
 * @param write_complete_cb:callback for programming done,return 0 if no err occurred
*/
u32 dual_bank_update_write(void *data, u16 len, int (*write_complete_cb)(void *priv));

/* @brief: caculate all the data had flashed,and compare with the cre value intializeed when update init;
 * @crc_init_hdl:if it equals NULL,use internal implementation(CRC16-CCITT Standard);otherwise,use user's customization;
 * @crc_calc_hdl:if it equals NULL,use internal implementation(CRC16-CCITT Standard);otherwise,use user's customization;
 * @verify_result_hdl:when the verification completed,this callback for result notification;
 *                    if crc_res equals 1,crc verification passed,if 0,the verification failed.
*/
u32 dual_bank_update_verify(void (*crc_init_hdl)(void), u32(*crc_calc_hdl)(u32 init_crc, u8 *data, u32 len), int (*verify_result_hdl)(int crc_res));

/* @brief:After the new fw verification succeed,call this api to program the new boot info for new fw
 * @param burn_boot_info_result_hdl:this callback for error notification
 *                                  if err equals 0,the operate to burn boot info succeed,other value means to fail.
 */
u32 dual_bank_update_burn_boot_info(int (*burn_boot_info_result_hdl)(int err));

enum {

    CLEAR_APP_RUNNING_BANK = 0,
    CLEAR_APP_UPDATE_BANK,
};

/* @brief:this api for erasing the boot info of specific bank,it should be called much carefully
 * @param type:it decides which bank's boot info would be erased;
 *             clean the boot info of running bank and call system_reset,system will run the other bank if available;
 */
int flash_update_clr_boot_info(u8 type);

/* @brief:this api for user read flash data to calculate crc
 * @param offset: the offset relative to update area
          read_buf: user data buffer
          read_len: read length
   @returns: Actual read length
 */
u32 dual_bank_update_read_data(u32 offset, u8 *read_buf, u32 read_len);

#endif


nd("3")
							else -> append("3")
						}
						append("&page=")
						append(page.toString())
					} else {
						when (order) {
							SortOrder.POPULARITY -> append("/popular-manga")
							SortOrder.UPDATED -> append("/latest-manga")
							else -> append("/latest-manga")
						}
						append("?page=")
						append(page.toString())
					}
				}
			}
		}
		val doc = webClient.httpGet(url).parseHtml()

		return doc.select("div.row.c-tabs-item__content").ifEmpty {
			doc.select("div.page-item-detail.manga")
		}.map { div ->
			val href = div.selectFirstOrThrow("a").attrAsRelativeUrl("href")
			val summary = div.selectFirst(".tab-summary") ?: div.selectFirst(".item-summary")
			val author = summary?.selectFirst(".mg_author")?.selectFirst("a")?.ownText()
			Manga(
				id = generateUid(href),
				url = href,
				publicUrl = href.toAbsoluteUrl(div.host ?: domain),
				coverUrl = div.selectFirst("img")?.src(),
				title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4"))?.text().orEmpty(),
				altTitles = emptySet(),
				rating = div.selectFirst("span.total_votes")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f,
				tags = summary?.selectFirst(".mg_genres")?.select("a")?.mapNotNullToSet { a ->
					MangaTag(
						key = a.attr("href").removeSuffix('/').substringAfterLast('/'),
						title = a.text().ifEmpty { return@mapNotNullToSet null }.toTitleCase(),
						source = source,
					)
				}.orEmpty(),
				authors = setOfNotNull(author),
				state = when (summary?.selectFirst(".mg_status")?.selectFirst(".summary-content")?.ownText()
					?.lowercase()) {
					"ongoing" -> MangaState.ONGOING
					"completed " -> MangaState.FINISHED
					else -> null
				},
				source = source,
				contentRating = if (isNsfwSource) ContentRating.ADULT else null,
			)
		}
	}

	override suspend fun loadChapters(mangaUrl: String, document: Document): List<MangaChapter> {

		val mangaId = document.select("div[id^=manga-chapters-holder]").attr("data-id")

		val doc = webClient.httpGet("https://$domain/ajax-list-chapter?mangaID=$mangaId").parseHtml()

		val dateFormat = SimpleDateFormat(datePattern, sourceLocale)

		return doc.select(selectChapter).mapChapters(reversed = true) { i, li ->
			val a = li.selectFirst("a")
			val href = a?.attrAsRelativeUrlOrNull("href") ?: li.parseFailed("Link is missing")
			val link = href + stylePage
			MangaChapter(
				id = generateUid(href),
				url = link,
				title = a.ownText(),
				number = i + 1f,
				volume = 0,
				branch = null,
				uploadDate = parseChapterDate(
					dateFormat,
					li.selectFirst(selectDate)?.text(),
				),
				scanlator = null,
				source = source,
			)
		}
	}

	override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
		val fullUrl = chapter.url.toAbsoluteUrl(domain)
		val doc = webClient.httpGet(fullUrl).parseHtml()
		val urlArray = doc.select("p#arraydata").text().split(",").toTypedArray()
		return urlArray.map { url ->
			MangaPage(
				id = generateUid(url),
				url = url,
				preview = null,
				source = source,
			)
		}
	}
}


Setoid'
import { StaticTraversable, FantasyTraversable } from './Traversable'
import { StaticBifunctor, FantasyBifunctor } from './Bifunctor'
import { StaticAlt, FantasyAlt } from './Alt'
import { StaticChainRec, tailRec } from './ChainRec'
import { Option, none, some } from './Option'
import { constFalse, constTrue, Predicate, Lazy } from './function'

declare module './HKT' {
  interface HKT<A> {
    Either: Either<any, A>
  }
  interface HKT2<A, B> {
    Either: Either<A, B>
  }
}

export const URI = 'Either'

export type URI = typeof URI

export type Either<L, A> = Left<L, A> | Right<L, A>

export class Left<L, A> implements
  FantasyMonad<URI, A>,
  FantasyFoldable<A>,
  FantasyTraversable<URI, A>,
  FantasyAlt<URI, A>,
  FantasyExtend<URI, A>,
  FantasyBifunctor<URI, L, A> {

  static of = of
  readonly _tag: 'Left'
  readonly _L: L
  readonly _A: A
  readonly _URI: URI
  constructor(public readonly value: L) {}
  map<B>(f: (a: A) => B): Either<L, B> {
    return this as any
  }
  of<L2, B>(b: B): Either<L2, B> {
    return of<L2, B>(b)
  }
  ap<B>(fab: Either<L, (a: A) => B>): Either<L, B> {
    return this as any
  }
  chain<B>(f: (a: A) => Either<L, B>): Either<L, B> {
    return this as any
  }
  bimap<L2, B>(f: (l: L) => L2, g: (a: A) => B): Either<L2, B> {
    return new Left<L2, B>(f(this.value))
  }
  alt(fy: Either<L, A>): Either<L, A> {
    return fy
  }
  extend<B>(f: (ea: Either<L, A>) => B): Either<L, B> {
    return this as any
  }
  reduce<B>(f: (b: B, a: A) => B, b: B): B {
    return b
  }
  traverse<F extends HKT2S>(applicative: StaticApplicative<F>): <L2, B>(f: (a: A) => HKT2<L2, B>[F]) => HKT2<L2, Either<L, B>>[F]
  traverse<F extends HKTS>(applicative: StaticApplicative<F>): <B>(f: (a: A) => HKT<B>[F]) => HKT<Either<L, B>>[F]
  traverse<F extends HKTS>(applicative: StaticApplicative<F>): <B>(f: (a: A) => HKT<B>[F]) => HKT<Either<L, B>>[F] {
    return <B>(f: (a: A) => HKT<B>[F]) => applicative.of(this as any)
  }
  fold<B>(left: (l: L) => B, right: (a: A) => B): B {
    return left(this.value)
  }
  equals(setoid: StaticSetoid<A>, fy: Either<L, A>): boolean {
    return fy.fold(constTrue, constFalse)
  }
  mapLeft<L2>(f: (l: L) => L2): Either<L2, A> {
    return left<L2, A>(f(this.value))
  }
  toOption(): Option<A> {
    retur


# coding: utf8
#https://www.sketch.com/docs/shortcuts/

shortcuts = {
  "Sketch": {
    "Copy": "⌘ + C",
    "Cut": "⌘ + X",
    "Paste": "⌘ + V",
    "Paste over selection": "⌘ + ⇧ + V",
    "Pan Canvas": "Space + drag",
    "New page": "⌘ + ⇧ + N",
    "Previous page": "fn + ↑",
    "Next page": "fn + ↓",
    "Zoom in": "⌘ + +",
    "Zoom out": "⌘ + -",
    "Show/hide rulers": "Ctrl + R",
    "Show/hide pixels": "Ctrl + P",
    "Show/hide pixel grid": "Ctrl + X",
    "Show/hide grid": "Ctrl + G",
    "Show/hide layout": "Ctrl + L",
    "Show/hide slices": "Ctrl + E",
    "Show/hide prototyping": "Ctrl + F",
    "Filter in Layer List/Components Panel": "⌘ + F",
    "Filter in the Components Panel": "⌘ + ⇧ + F",
    "Run custom plugin": "⌘ + Ctrl + K",
    "Undo": "⌘ + Z",
    "Redo": "⌘ + ⇧ + Z",
    "New document": "⌘ N",
    "Open document": "⌘ O",
    "Open Documents window": "⌘ ⇧ O",
    "Close window": "⌘ + W",
    "Save document": "⌘ + S",
    "Duplicate*": "⌘ + ⇧ + S",
    "Save As…*": "⌘ + ⌥ + ⇧ + S",
    "Page setup": "⌘ + ⇧ + P",
    "Open Preferences": "⌘ + ,",
    "Hide Sketch": "⌘ + H",
    "Quit Sketch": "⌘ + Q",
    "Open the Help menu": "⌘ + ⇧ + ?",
    "Open the Prototyping Preview window": "⌘ + P"
  }
}


         }
            }
        }
    }
}

impl NormalMode {
    pub fn new() -> NormalMode {
        let mut mode = NormalMode {
            keymap: KeyMap::new(),
            operator_pending: String::new(),
        };
        mode.bind_defaults();
        mode
    }

    fn bind_defaults(&mut self) {
        let ref mut km = self.keymap;
        km.bind_defaults();
        km.bind(&[Key::Char('k')], MoveCursor(Up));
        km.bind(&[Key::Char('j')], MoveCursor(Down));
        km.bind(&[Key::Char('h')], MoveCursor(Left));
        km.bind(&[Key::Char('l')], MoveCursor(Right));
        km.bind(&[Key::Char('o')], NewLine);
        km.bind(&[Key::Char('O')], Multi(vec!(MoveCursor(Up), NewLine)));
        km.bind(&[Key::Char('i')], ChangeMode(ModeType::Insert));
        km.bind(&[Key::Char('R')], ChangeMode(ModeType::Replace));
        km.bind(&[Key::Char('x')], Delete);
        km.bind(&[Key::Char('p')], Paste);
        km.bind(&[Key::Char('.')], RepeatPrevious);
        km.bind(&[Key::Char('0')], MoveCursor(BeginningOfLine));
        km.bind(&[Key::Char('$')], MoveCursor(EndOfLine));
        km.bind(&[Key::Char('G')], MoveCursor(EndOfFile));
        km.bind(&[Key::Char('g'), Key::Char('g')], MoveCursor(BeginningOfFile));
        km.bind(&[Key::Char('y'), Key::Char('y')], YankLine);
        km.bind(&[Key::Char('d'), Key::Char('d')], DeleteLine);

        km.bind(&[Key::Char(' '), Key::Char('b'), Key::Char('n')], NextBuffer);
        km.bind(&[Key::Char(' '), Key::Char('b'), Key::Char('p')], PrevBuffer);

        km.bind(&[Key::Char('A')], Multi(vec!(
            MoveCursor(EndOfLine),
            ChangeMode(ModeType::Insert),
            MoveCursor(Right),
        )));

        km.bind(&[Key::Char('I')], Multi(vec!(
            MoveCursor(BeginningOfLine),
            ChangeMode(ModeType::Insert),
        )));

        km.bind(&[Key::Char('a')], Multi(vec!(
            MoveCursor(Right),
            ChangeMode(ModeType::Insert),
        )));
    }

    fn maybe_repeat(&mut self, action: Action) -> Option<Action> {
        if self.operator_pending.is_empty() {
            Some(action)
        } else {
            let n = i32::from_str_radix(self.operator_pending.as_ref(), 10).ok().unwrap_or(1);
            self.operator_pending = String::new();
            Some(Repeat(Box::new(action), n as usize))
        }
    }
}
use std::*;

extern crate ordered_float;
extern crate linked_hash_set;
extern crate rayon;

use linked_hash_set::LinkedHashSet;
pub use ordered_float::*;
use rayon::prelude::*;
mod triangular;

use triangular::TriangularMatrix;
use triangular::FreqMatrix;

mod random_generator;

use random_generator::RandomGenerator;
use random_generator::RustRand;

const NUMBER_OF_ITERATIONS: usize = 10_000;
const TABOO_LIST_MAX_ELEMENTS: usize = 30;
const REBOOT_ON_IT: usize = 99;
const DIVISOR_CHANGE_ON_REBOOT: usize = 4;
const TRIES_ON_REBOOT: usize = 1000;
const REPETITION_CONST: f64 = 1.0;
const INTENSIFICATION_MOD: usize = 10;

struct PathFinder {
    cost_map: TriangularMatrix<usize>,
    current_solution: Vec<usize>,
    solution_size: usize,
    best_cost: f64,
    best_solution: Vec<usize>,
    best_solution_iteration: usize,
    tab


----------------------------------------------------
bool ChordEngraver::is_tablature()
{
    return (m_clefs.size() == 1 && m_clefs.front() == k_clef_TAB);
}

//---------------------------------------------------------------------------------------
void ChordEngraver::add_note(ImoStaffObj* pSO, GmoShape* pStaffObjShape, int UNUSED(idxStaff))
{
    m_numNotesMissing--;
    ImoNote* pNote = static_cast<ImoNote*>(pSO);
    GmoShapeNote* pNoteShape = static_cast<GmoShapeNote*>(pStaffObjShape);
    int posOnStaff = pNoteShape->get_pos_on_staff();

    if (m_notes.size() == 0)
    {
        ChordNoteData* pData = LOMSE_NEW ChordNoteData(pNote, pNoteShape, posOnStaff, m_iInstr);
	    m_notes.push_back(pData);
        m_pBaseNoteData = pData;
        m_stemWidth = tenths_to_logical(LOMSE_STEM_THICKNESS);
    }
    else
    {
        //keep notes sorted by pitch
        DiatonicPitch newPitch(pNote->get_step(), pNote->get_octave());
        std::list<ChordNoteData*>::iterator it;
        for (it = m_notes.begin(); it != m_notes.end(); ++it)
        {
            DiatonicPitch curPitch((*it)->pNote->get_step(), (*it)->pNote->get_octave());
            if (newPitch < curPitch)
            {
                ChordNoteData* pData =
                    LOMSE_NEW ChordNoteData(pNote, pNoteShape, posOnStaff, m_iInstr);
	            m_notes.insert(it, 1, pData);
                return;
            }
        }
        ChordNoteData* pData = LOMSE_NEW ChordNoteData(pNote, pNoteShape, posOnStaff, m_iInstr);
	    m_notes.push_back(pData);
    }
}

//---------------------------------------------------------------------------------------
void ChordEngraver::find_reference_notes()
{
    m_pStartNoteData = (m_fStemDown ? m_notes.back() : m_notes.front());
    m_pFlagNoteData = (m_fStemDown ? m_notes.front() : m_notes.back());

    m_pLinkNoteData = nullptr;
    if (m_pChord->is_cross_staff())
    {
        int staff = m_pFlagNoteData->pNote->get_staff();
        if (m_fStemDown)
        {
            std::list<ChordNoteData*>::iterator it;
            for(it=m_notes.begin(); it != m_notes.end(); ++it)
            {
                if ((*it)->pNote->get_staff() != staff)
                    break;
                m_pLinkNoteData = *it;
            }
        }
        else
        {
            std::list<ChordNoteData*>::reverse_iterator it;
            for(it=m_notes.rbegin(); it != m_notes.rend(); ++it)
            {
                if ((*it)->pNote->get_staff() != staff)
                    break;
                m_pLinkNoteData = *it;
            }
        }
    }

    //Fix for special cases
    if (!m_pLinkNoteData)
    {
        //For single-staff chords, the link note is the same than the start note and
        //thus, start note does no exists as no extensible segment exists.
        m_pLinkNoteData = m_pStartNoteData;
        m_pStartNoteData = nullptr;
    }
    else if (m_pLinkNoteData == m_pFlagNoteData )
    {
        //For cross-staff chords, when only two notes, one on each staff, the link note
        //and the link segment do not exist. But the loop for finding the link note
        //will point it to the flag note
        m_pLinkNoteData = nullptr;
    }

    //set ptrs. to reference notes in


Index()
	sym := fn.Linksym()
	inlIndex := base.Ctxt.InlTree.Add(parent, n.Pos(), sym, ir.FuncName(fn))

	closureInitLSym := func(n *ir.CallExpr, fn *ir.Func) {
		// The linker needs FuncInfo metadata for all inlined
		// functions. This is typically handled by gc.enqueueFunc
		// calling ir.InitLSym for all function declarations in
		// typecheck.Target.Decls (ir.UseClosure adds all closures to
		// Decls).
		//
		// However, non-trivial closures in Decls are ignored, and are
		// insteaded enqueued when walk of the calling function
		// discovers them.
		//
		// This presents a problem for direct calls to closures.
		// Inlining will replace the entire closure definition with its
		// body, which hides the closure from walk and thus suppresses
		// symbol creation.
		//
		// Explicitly create a symbol early in this edge case to ensure
		// we keep this metadata.
		//
		// TODO: Refactor to keep a reference so this can all be done
		// by enqueueFunc.

		if n.Op() != ir.OCALLFUNC {
			// Not a standard call.
			return
		}
		if n.Fun.Op() != ir.OCLOSURE {
			// Not a direct closure call.
			return
		}

		clo := n.Fun.(*ir.ClosureExpr)
		if ir.IsTrivialClosure(clo) {
			// enqueueFunc will handle trivial closures anyways.
			return
		}

		ir.InitLSym(fn, true)
	}

	closureInitLSym(n, fn)

	if base.Flag.GenDwarfInl > 0 {
		if !sym.WasInlined() {
			base.Ctxt.DwFixups.SetPrecursorFunc(sym, fn)
			sym.Set(obj.AttrWasInlined, true)
		}
	}

	if base.Flag.LowerM != 0 {
		if buildcfg.Experiment.NewInliner {
			fmt.Printf("%v: inlining call to %v with score %d\n",
				ir.Line(n), fn, score)
		} else {
			fmt.Printf("%v: inlining call to %v\n", ir.Line(n), fn)
		}
	}
	if base.Flag.LowerM > 2 {
		fmt.Printf("%v: Before inlining: %+v\n", ir.Line(n), n)
	}

	res := InlineCall(callerfn, n, fn, inlIndex)

	if res == nil {
		base.FatalfAt(n.Pos(), "inlining call to %v failed", fn)
	}

	if base.Flag.LowerM > 2 {
		fmt.Printf("%v: After inlining %+v\n\n", ir.Line(res), res)
	}

	if inlheur.Enabled() {
		inlheur.UpdateCallsiteTable(callerfn, n, res)
	}

	return res
}

// CalleeEffects appends any side effects from evaluating callee to init.
func CalleeEffects(init *ir.Nodes, callee ir.Node) {
	for {
		init.Append(ir.TakeInit(callee)...)

		switch callee.Op() {
		case ir.ONAME, ir.OCLOSURE, ir.OMETHEXPR:
			return // done

		case ir.OCONVNOP:
			conv := callee.(*ir.ConvExpr)
			callee = conv.X

		case ir.OINLCALL:
			ic := callee.(*ir.InlinedCallExpr)
			init.Append(ic.Body.Take()...)
			callee = ic.SingleResult()

		default:
			base.FatalfAt(callee.Pos(), "unexpected callee expression: %v", callee)
		}
	}
}

func pruneUnusedAutos(ll []*ir.Name, vis *hairyVisitor) []*ir.Name {
	s := make([]*ir.Name, 0, len(ll))
	f


}

			List<String> fileSeqs = new ArrayList<String>();
			if (prjParam.getPackageFileId() != null) {
				fileSeqs.add(prjParam.getPackageFileId());
			}
			if (prjParam.getPackageFileId2() != null) {
				fileSeqs.add(prjParam.getPackageFileId2());
			}
			if (prjParam.getPackageFileId3() != null) {
				fileSeqs.add(prjParam.getPackageFileId3());
			}
			if (prjParam.getPackageFileId4() != null) {
				fileSeqs.add(prjParam.getPackageFileId4());
			}
			if (prjParam.getPackageFileId5() != null) {
				fileSeqs.add(prjParam.getPackageFileId5());
			}
			Map<Object, Object> map = new HashMap<Object, Object>();
			map.put("prjId", prjId);
			map.put("fileSeqs", fileSeqs);

			String packagingComment = "";

			try {
				packagingComment = fileService.setClearFiles(map);
			} catch(Exception e) {
				log.error(e.getMessage(), e);
			}
			prjParam.setStatusVerifyYn("N");
			// project_master packageFileId update
			verificationMapper.updatePackageFile(prjParam);

			// commentHistory regist
			if (!packagingComment.equals("")) {
				CommentsHistory commHisBean = new CommentsHistory();
				commHisBean.setReferenceDiv(CoConstDef.CD_DTL_COMMENT_PACKAGING_HIS);
				commHisBean.setReferenceId(prjId);
				commHisBean.setContents(packagingComment);

				commentService.registComment(commHisBean, false);
			}
		}
	}

	@Override
	public void updateProjectAllowDownloadBitFlag(Project project) {
		project.setAllowDownloadBitFlag(allowDownloadMultiFlagToBitFlag(project));

		projectMapper.updateProjectAllowDownloadBitFlag(project);
	}

	public int allowDownloadMultiFlagToBitFlag(Project project) {
		int bitFlag = 1;

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadNoticeHTMLYn())) {
			bitFlag |= CoConstDef.FLAG_A;
		}

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadNoticeTextYn())) {
			bitFlag |= CoConstDef.FLAG_B;
		}

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadSimpleHTMLYn())) {
			bitFlag |= CoConstDef.FLAG_C;
		}

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadSimpleTextYn())) {
			bitFlag |= CoConstDef.FLAG_D;
		}

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadSPDXSheetYn())) {
			bitFlag |= CoConstDef.FLAG_E;
		}

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadSPDXRdfYn())) {
			bitFlag |= CoConstDef.FLAG_F;
		}

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadSPDXTagYn())) {
			bitFlag |= CoConstDef.FLAG_G;
		}

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadSPDXJsonYn())) {
			bitFlag |= CoConstDef.FLAG_H;
		}

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadSPDXYamlYn())) {
			bitFlag |= CoConstDef.FLAG_I;
		}

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadCDXJsonYn())) {
			bitFlag |= CoConstDef.FLAG_J;
		}

		if (CoConstDef.FLAG_YES.equals(project.getAllowDownloadCDXXmlYn())) {
			bitFlag |= CoConstDef.FLAG_K;
		}

		return bitFlag;
	}

	@Override
	public void registOssNoticeConfirmStatus(OssNotice ossNotice) {
		try{
			Project project = projectMapper.selectProjectMaster(ossN


profileFile, backupDestination);
                            } catch (Exception ex) {
                                Logger.Error(ex);
                            }
                        }

                        // Save adjusted profile
                        File.WriteAllText(profileFile, profile);
                    }
                } catch (Exception ex) {
                    Logger.Error($"Failed to migrate profile {profileFile} due to ", ex);
                }
            }
        }

        #endregion Migration

        public static void ActivateInstanceOfNinaReferencingProfile(string startWithProfileId) {
            using (var waitHandle = new EventWaitHandle(false,

                EventResetMode.ManualReset,

                "NINA_ActivateInstance:" + startWithProfileId)) {
                waitHandle.Set();
            }
        }

        public static System.Threading.Tasks.Task ActivateInstanceWatcher(
            IProfileService profileService,
            Window mainWindow
            ) {
            var currentProfile = profileService.ActiveProfile.Id.ToString();
            return System.Threading.Tasks.Task.Factory.StartNew(
                () => {
                    var profileChanged = new ManualResetEventSlim();
                    profileService.ProfileChanged += (x, y) => profileChanged.Set();

                    var activated = new EventWaitHandle(false,
                        EventResetMode.AutoReset,
                        "NINA_ActivateInstance:" + currentProfile);


1]
	movs r1, #0
	ldr r0, _080A248C @ =0x03000136
	adds r6, r2, r0
	subs r3, #0x16
	adds r3, r3, r2
	mov ip, r3
	ldr r5, _080A2474 @ =0x0300013A
	adds r5, r5, r2
	mov sb, r5
_080A2434:
	lsls r1, r1, #0x10
	asrs r2, r1, #0x10
	movs r3, #0
	ldrsh r0, [r6, r3]
	subs r0, r2, r0
	adds r7, r1, #0
	cmp r0, #0
	blt _080A2490
	ldrh r0, [r6]
	subs r0, r2, r0
	b _080A2494
	.align 2, 0
_080A244C: .4byte gCurTask
_080A2450: .4byte sa2__gUnknown_03002A80
_080A2454: .4byte sa2__gUnknown_03002878
_080A2458: .4byte 0x04000020
_080A245C: .4byte gBgOffsetsHBlank
_080A2460: .4byte 0x0300012C
_080A2464: .4byte gFlags
_080A2468: .4byte 0x03000138
_080A246C: .4byte 0x03000140
_080A2470: .4byte 0x00000FFF
_080A2474: .4byte 0x0300013A
_080A2478: .4byte 0x03000142
_080A247C: .4byte 0x000007FF
_080A2480: .4byte 0x03000148
_080A2484: .4byte 0x03000144
_080A2488: .4byte 0x0300014A
_080A248C: .4byte 0x03000136
_080A2490:
	ldrh r0, [r6]
	subs r0, r0, r2
_080A2494:
	lsls r0, r0, #0x10
	lsrs r0, r0, #0x10
	adds r5, r0, #0
	lsls r1, r5, #0x10
	asrs r1, r1, #0x10
	mov r0, ip
	ldr r2, [r0]
	lsls r0, r1, #2
	adds r0, r0, r2
	ldr r0, [r0]
	muls r1, r0, r1
	lsls r1, r1, #1
	mov r2, sb
	ldrh r0, [r2]
	lsls r0, r0, #4
	adds r1, r1, r0
	lsls r1, r1, #0x10
	lsrs r3, r1, #0x10
	asrs r1, r7, #0x10
	movs r2, #0
	ldrsh r0, [r6, r2]
	cmp r1, r0
	bge _080A24D4
	lsls r0, r3, #0x10
	cmp r0, #0
	bge _080A24E4
	ldr r1, _080A24D0 @ =0xFFFF8000
	adds r0, r3, r1
	b _080A24E0
	.align 2, 0
_080A24D0: .4byte 0xFFFF8000
_080A24D4:
	lsls r0, r3, #0x10
	cmp r0, #0
	blt _080A24E4
	movs r2, #0x80
	lsls r2, r2, #8
	adds r0, r3


  void set(String unit, int val) {
    final processedUnit = Unit.fromShorthand(unit);

    if (_values.containsKey(processedUnit)) {
      _values[processedUnit] = val;
    }
  }

  /// Updates the internal [_time] by [_values].
  ///
  /// Use to apply all changes.
  void finished() {
    final vals = _values;

    _time = DateTime(
      vals[Unit.y]!,
      vals[Unit.m]!,
      vals[Unit.d]!,
      vals[Unit.h]!,
      vals[Unit.min]!,
      vals[Unit.s]!,
      vals[Unit.ms]!,
    );

    _parseTime();
  }

  Day? _add({
    required int val,
    required String unit,
    bool opposite = false,
    bool rounded = false,
  }) {
    final processedUnit = Unit.fromShorthand(unit);
    final duration = u.durationFromUnit(val, processedUnit);

    if (duration != null) {
      final d = clone();

      d._time = !opposite ? d._time.add(duration) : d._time.subtract(duration);
      d._parseTime();

      return d;
    } else {
      if (unit == Unit.y || unit == 'y') {
        final currentYear = year() + (!opposite ? val : -val);

        if (rounded) {
          final currentMonth = month();

          // First determines if the month is February to avoid over-checking
          if (currentMonth == 2 &&
              u.isDateOverflow(currentYear, currentMonth, date())) {
            return _cloneAndSetMultipleValues({
              Unit.y: currentYear,
              Unit.d: u.daysInMonth(currentYear, currentMonth),
            });
          }
        }

        return _cloneAndSetSingleValue(Unit.y, currentYear);
      } else if (unit == Unit.m || unit == 'M') {
        final d = clone();

        final int result = month() + (!opposite ? val : -val);

        if (result > 0) {
          d.setValue(Unit.m, result);
        } else {
          final abs = result.abs();

          d
            ..setValue(Unit.y, d.year() - (abs ~/ 12 + 1))
            ..setValue(Unit.m, 12 - abs % 12);
        }

        if (rounded) {
          final currentYear = d.year();
          final currentMonth = d.month();

          if (u.isDateOverflow(currentYear, currentMonth, d.date())) {
            d.setValue(Unit.d, u.daysInMonth(currentYear, currentMonth));
          }
        }

        d.finished();

        return d;
      }
    }

    return null;
  }

  /// Adds [val] by [unit]. Supports shorthand.
  ///
  /// Example:
  ///
  /// ```dart
  /// add(1, 'date');
  /// add(1, 'd');
  /// ```
  Day? add(int val, String unit) => _add(val: val, unit: unit);

  /// Adds [val] by [unit] but rounded. Supports shorthand.
  ///
  /// Example:
  ///
  /// ```dart
  /// addRound(1, 'month');
  /// addRound(1, 'M');
  /// ```
  Day? addRound(int val, String unit) =>
      _add(val: val, unit: unit, rounded: true);

  /// Subtracts [val] by [unit]. Supports shorthand.
  ///
  /// Example:
  ///
  /// ```dart
  /// subtract(1, 'date');
  /// subtract(1, 'd');
  /// ```
  Day? subtract(int val, String unit) =>
      _add(val: val, unit: unit, opposite: true);

  /// Subtracts [val] by [unit] but rounded. Supports shorthand.
  ///
  /// Example:
  ///
  /// ```dart
  /// subtractRound(1, 'month');
  /// subtractRound(1, 'M');
  /// ```
  Day? subtractRound(int val, String unit


其他scoop仓库的更新，仓库地址：https://github.com/kkzzhizhou/scoop-apps

## License

[![CC0](http://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)](https://creativecommons.org/publicdomain/zero/1.0/)

To the extent possible under law, [udpsec](https://github.com/udpsec) has waived all copyright and related or neighboring rights to this work.

---
title: font stacks
---

```
/* Times New Roman-based stack */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;

/* Modern Georgia-based serif stack */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;

/* Traditional Garamond-based serif stack */
font-family: "Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif;

/* Helvetica/Arial-based sans serif stack */
font-family: Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;

/* Verdana-based sans serif stack */
font-family: Corbel, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, "Verdana Ref", sans-serif;

/* Trebuchet-based sans serif stack */
font-family: "Segoe UI", Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif;

/* Impact-based sans serif stack */
font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", Charcoal, "Helvetica Inserat", "Bitstream Vera Sans Bold", "Arial Black", sans-serif;

/* Monospace stack */
font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
```# Introduction to IBM i

IBM i is a different kind of beast to learn compared to the typical progamming environment.
In order to get started with programming on IBM i, I think its important to have a basic understanding of what it is.

		IBM i Main Menu

## IBM i
IBM i is considered a **midrange server**, its not quite a mainframe and not quite an entry-level server.
This operating system specializes in business applications, reporting, data warehousing, and more.
It is also well known for its minimal downtime and strong defenses;
making it the perfect platform for companies housing financial information.

I will cover more important/interesting information about how IBM i came to be and why its still around in the [history](history.md) section.

## Language Overview
There are quite a few languages native to IBM i, I will be primarily covering
* CL
* RPG
* DB2 SQL
* DDS/DSPF (More of a data format tha


CalendarTypes.SET;
    }

    /**
     * Returns the string representation of the calendar
     * field value in the given style and
     * locale.  If no string representation is
     * applicable, null is returned. This method calls
     * {@link Calendar#get(int) get(field)} to get the calendar
     * field value if the string representation is
     * applicable to the given calendar field.
     *
     *
For example, if this Calendar is a
     * GregorianCalendar and its date is 2005-01-01, then
     * the string representation of the {@link #MONTH} field would be
     * "January" in the long style in an English locale or "Jan" in
     * the short style. However, no string representation would be
     * available for the {@link #DAY_OF_MONTH} field, and this method
     * would return null.
     *
     *
The default implementation supports the calendar fields for
     * which a {@link DateFormatSymbols} has names in the given
     * locale.
     *
     * @param field  the calendar field for which the string representation
     *               is returned
     * @param style  the style applied to the string representation; one of {@link
     *               #SHORT_FORMAT} ({@link #SHORT}), {@link #SHORT_STANDALONE},
     *               {@link #LONG_FORMAT} ({@link #LONG}), {@link #LONG_STANDALONE},
     *               {@link #NARROW_FORMAT}, or {@link #NARROW_STANDALONE}.
     * @param locale the locale for the string representation
     *               (any calendar types specified by {@code locale} are ignored)
     *
     * @return the string representation of the given
     * {@code field} in the given {@code style}, or
     * {@code null} if no string representation is
     * applicable.
     *
     * @throws IllegalArgumentException if {@code field} or {@code style} is invalid,
     *                                  or if this {@code Calendar} is non-lenient and any
     *                                  of the calendar fields have invalid values
     * @throws NullPointerException     if {@code locale} is null
     * @since 1.6
     */
    /*
     * 返回某个字段在指定区域下的显示风格；style指示使用长格式还是短格式
     *
     * 举例：
     * getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.CHINA) // 12月
     * getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.CHINA)  // 十二月
     */
    public String getDisplayName(int field, int style, Locale locale) {
        if(!checkDisplayNameParams(field, style, SHORT, NARROW_FORMAT, locale, ERA_MASK | MONTH_MASK | DAY_OF_WEEK_MASK | AM_PM_MASK)) {
            return null;
        }

        String calendarType = getCalendarType();
        int fieldValue = get(field);
        // the standalone/narrow styles and short era are supported only through
        // CalendarNameProviders.
        if(isStandaloneStyle(style) || isNarrowFormatStyle(style) || field == ERA && (style & SHORT) == SHORT) {
            String val = CalendarDataUtility.retrieveFieldValueName(calendarType, field, fieldValue, style, locale);
            // Perform fallback here to follow the CLDR rules
            if(val == null) {
                if(isNarrowFormatStyle(style)) {
                    val = CalendarDataUtility.retrieveFieldValueName(calendarType, field, fieldValue, toStandaloneStyle(style), locale);
                } else if(isStandaloneStyle(style)) {
                    val = CalendarDataUtility.retrieveFieldValueName(