}
        public Tess(IPool pool)
        {
            if (pool == null)
            {
                throw new ArgumentNullException("pool");
            }

            _normal = Vec3.Zero;
            _bminX = _bminY = _bmaxX = _bmaxY = 0;

            _windingRule = WindingRule.EvenOdd;
            _pool = pool;
            _mesh = null;

            _vertices = null;
            _vertexCount = 0;
            _elements = null;
            _elementCount = 0;
        }

        private void ComputeNormal(ref Vec3 norm)
        {
            var v = _mesh._vHead._next;

            var minVal = new Real[3] { v._coords.X, v._coords.Y, v._coords.Z };
            var minVert = new MeshUtils.Vertex[3] { v, v, v };
            var maxVal = new Real[3] { v._coords.X, v._coords.Y, v._coords.Z };
            var maxVert = new MeshUtils.Vertex[3] { v, v, v };

            for (; v != _mesh._vHead; v = v._next)
            {
                if (v._coords.X < minVal[0]) { minVal[0] = v._coords.X; minVert[0] = v; }
                if (v._coords.Y < minVal[1]) { minVal[1] = v._coords.Y; minVert[1] = v; }
                if (v._coords.Z < minVal[2]) { minVal[2] = v._coords.Z; minVert[2] = v; }
                if (v._coords.X > maxVal[0]) { maxVal[0] = v._coords.X; maxVert[0] = v; }
                if (v._coords.Y > maxVal[1]) { maxVal[1] = v._coords.Y; maxVert[1] = v; }
                if (v._coords.Z > maxVal[2]) { maxVal[2] = v._coords.Z; maxVert[2] = v; }
            }

            // Find two vertices separated by at least 1/sqrt(3) of the maximum
            // distance between any two vertices
            int i = 0;
            if (maxVal[1] - minVal[1] > maxVal[0] - minVal[0]) { i = 1; }
            if (maxVal[2] - minVal[2] > maxVal[i] - minVal[i]) { i = 2; }
            if (minVal[i] >= maxVal[i])
            {
                // All vertices are the same -- normal doesn't matter
                norm = new Vec3(0, 0, 1);
                return;
            }

            // Look for a third vertex which forms the triangle with maximum area
            // (Length of normal == twice the triangle area)
            Real maxLen2 = 0, tLen2;
            var v1 = minVert[i];
            var v2 = maxVert[i];
            Vec3 d1, d2, tNorm;
            Vec3.Sub(ref v1._coords, ref v2._coords, out d1);
            for (v = _mesh._vHead._next; v != _mesh._vHead; v = v._next)
            {
                Vec3.Sub(ref v._coords, ref v2._coords, out d2);
                tNorm.X = d1.Y * d2.Z - d1.Z * d2.Y;
                tNorm.Y = d1.Z * d2.X - d1.X * d2.Z;
                tNorm.Z = d1.X * d2.Y - d1.Y * d2.X;
                tLen2 = tNorm.X*tNorm.X + tNorm.Y*tNorm.Y + tNorm.Z*tNorm.Z;
                if (tLen2 > maxLen2)
                {
                    maxLen2 = tLen2;
                    norm = tNorm;
                }
            }

            if (maxLen2 <= 0.0f)
            {
                // All points lie on a single line -- any decent normal will do
                norm = Vec3.Zero;


line-block lg:mt-0 mr-4">
                        Top 100

                        API abuse score history

                <input type='search' disabled="disabled" placeholder="Loading…" class='search-box__input px-2' />

 uehtjp.cn

Domain Stats

                    Owner: Unknown

                    Privacy Policy: Unknown

                    Rank: #25269/27288

                    Prevalence: 0.00% (2 sites)

                    Fingerprinting: 3/3 - Excessive use of browser API's, almost certainly for tracking purposes

                    Cookies: 0.00%

                    Performance: ?

time: /3

size: /3

CPU: /3

cache: /3

                    Categories:

                    Resource Types:
                    Script,

Raw


--- Replace intra-word hyphens with LaTeX shorthand "= for better hyphenation.
--
-- PURPOSE
--
-- The regular hyphen - prevents LaTeX from breaking a word at any other
-- position than the explicit hyphen. With long, hyphenated words as they occur
-- in languages like German, this can lead to undesirable visual results. The
-- expression "= outputs a normal hyphen while still allowing LaTeX to break
-- the word at any other position according to its regular hyphenation rules.
--
-- USAGE
--
-- For this to work, babel shorthands have to be activated. With XeLaTeX or
-- LuaTeX as PDF engine, this can be done using the YAML frontmatter:

-- polyglossia-lang:
--     name: german
--     options:
--         - spelling=new,babelshorthands=true
--
-- For pdflatex, a custom template has to be used, as the built-in template
-- explicitly deactivates babel’s shorthands.
--
-- The filter can then be called like this:
--
-- pandoc -o doc.pdf --pdf-engine xelatex --lua-filter latex-hyphen.lua doc.md
--
-- AUTHOR
--
-- Copyright 2020 Frederik Elwert <frederik.elwert@rub.de>
--
-- LICENSE
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to
-- deal in the Software without restriction, including without limitation the
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or


     var renderer = target.gameObject.GetComponent<Renderer>();
            if (renderer)
            {
                renderer.sortingLayerName = layerName;
                Debug.Log(target.name);
            }

            var targetTransform = target.transform;
            foreach (Transform child in targetTransform)
            {
                ApplySortingLayer(child, layerName);
            }
        }

        #region Public members

        public override void OnEnter()
        {
            if (targetObject != null)
            {
                ApplySortingLayer(targetObject.transform, sortingLayer);
            }

            Continue();
        }

        public override string GetSummary()
        {
            if (targetObject == null)
            {
                return "Error: No game object selected";
            }

            return targetObject.name;
        }

        public override Color GetButtonColor()
        {
            return new Color32(235, 191, 217, 255);
        }

        #endregion
    }
}


oops'), null).catch(common.mustCall((err) => {
    assert.strictEqual(err.message, 'oops');
  }));
}

{
  function fn(err, val, callback) {
    callback(err, val);
  }

  (async () => {
    const value = await promisify(fn)(null, 42);
    assert.strictEqual(value, 42);
  })();
}

{
  const o = {};
  const fn = promisify(function(cb) {

    cb(null, this === o);
  });

  o.fn = fn;

  o.fn().then(common.mustCall((val) => assert(val)));
}

{
  const err = new Error('Should not have called the callback with the error.');
  const stack = err.stack;

  const fn = promisify(function(cb) {
    cb(null);
    cb(err);
  });

  (async () => {
    await fn();
    await Promise.resolve();
    return assert.strictEqual(stack, err.stack);
  })();
}

{
  function c() { }
  const a = promisify(function() { });
  const b = promisify(a);
  assert.notStrictEqual(c, a);
  assert.strictEqual(a, b);
}

{
  let errToThrow;
  const thrower = promisify(function(a, b, c, cb) {
    errToThrow = new Error();
    throw errToThrow;
  });
  thrower(1, 2, 3)
    .then(assert.fail)
    .then(assert.fail, (e) => assert.strictEqual(e, errToThrow));
}

{
  const err = new Error();

  const a = promisify((cb) => cb(err))();
  const b = promisify(() => { throw err; })();

  Promise.all([
    a.then(assert.fail, function(e) {
      assert.strictEqual(err, e);
    }),
    b.then(assert.fail, function(e) {
      assert.strictEqual(err, e);
    })
  ]);
}

[undefined, null, true, 0, 'str', {}, [], Symbol()].forEach((input) => {
  assert.throws(
    () => promisify(input),
    {
      code: 'ERR_INVALID_ARG_TYPE',
      name: 'TypeError',
      message: 'The "original" argument must be of type function.' +
               common.invalidArgTypeHelper(input)
    });
});
'use strict';

const common = require('../common');
const assert = require('assert');

// utf8, ucs2, ascii, latin1, utf16le
const encodings = ['utf8', 'utf-8', 'ucs2', 'ucs-2', 'ascii', 'latin1',
                   'binary', 'utf16le', 'utf-16le'];

encodings
  .reduce((es, e) => es.concat(e, e.toUpperCase()), [])
  .forEach((encoding) => {
    assert.strictEqual(Buffer.from('foo', encoding).toString(encoding), 'foo');
  });

// base64
['base64', 'BASE64'].forEach((encoding) => {
  assert.strictEqual(Buffer.from('Zm9v', encoding).toString(encoding), 'Zm9v');
});

// hex
['hex', 'HEX'].forEach((encoding) => {
  assert.strictEqual(Buffer.from('666f6f', encoding).toString(encoding),
                     '666f6f');
});

// Invalid encodings
for (let i = 1; i < 10; i++) {
  const encoding = String(i).repeat(i);
  const error = common.expectsError({
    code: 'ERR_UNKNOWN_ENCODING',
    name: 'TypeError',
    message: `Unknown encoding: ${encoding}`
  });
  assert.ok(!Buffer.isEncoding(encoding));
  assert.throws(() => Buffer.from('foo').toString(encoding), error);
}
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the r


전장 밖에 있는 호드 돌격대장에게 아라시 분지 명예 훈장 3개를 가져가야 합니다."}},
[8443] = {"아라시 분지 정복", nil, nil},
[8444] = {"<NYI> <TXT> gossip shade of ambermoon", nil, {"x"}},
[8445] = {"<NYI> <TXT> gossip shade of ambermoon", nil, {"x"}},
[8446] = {"악몽 속의 장막", nil, {"악몽이 깃든 물건에 숨겨진 의미를 해석할 수 있는 이를 찾아야 합니다.\n\n강력한 힘을 가진 드루이드가 도움을 줄 수 있을 것입니다."}},
[8447] = {"깨어나는 전설", nil, {"달의 숲에 있는 수호자 레물로스가 악몽이 깃든 물건을 정화할 때까지 기다려야 합니다."}},
[8448] = {"[미완성] 신비한 보상", nil, nil},
[8449] = {"[미사용] 신비한 보상", nil, nil},
[8450] = {"[미완성] 신비한 보상", nil, nil},
[8451] = {"[미완성] 신비한 보상", nil, nil},
[8452] = {"[미완성] 신비한 보상", nil, nil},
[8453] = {"[미완성] 신비한 보상", nil, nil},
[8454] = {"[미완성] 신비한 보상", nil, nil},
[8459] = {"<UNUSED>", nil, {"Log"}},
[8460] = {"나무구렁일족", nil, {"그라즐이 자기 일족의 친구임을 입증하려면 마른가지일족 전사, 길잡이, 정원사를 각각 6마리씩 처치해달라고 부탁했습니다. 임무를 마치면 악령의 숲 남쪽, 에메랄드 성소 근처에 있는 그라즐에게 돌아가십시오."}},
[8461] = {"북방의 마른가지일족", nil, {"나피엔이 마른가지일족 보초, 복수


�端事件通知
	 * @param msgbody
	 * @return
	 */
	public static EventSet decoderTerEventNotice(String msgbody){

		byte [] data = ParseUtil.parseHexStrToByte(msgbody);
		try {

			EventSet event = new EventSet();
			int dstPos = 0;
			//事件类型
			int eventtype = ParseUtil.byteToint(ParseUtil.byteTobyte(data, dstPos, 1));
			event.setEventtype(eventtype);
			dstPos += 1;
			//发生原因
			int reason = ParseUtil.byteToint(ParseUtil.byteTobyte(data, dstPos, 1));
			event.setReason(reason);
			dstPos += 1;
			//发生时间
			String time = ParseUtil.bcd2Str(ParseUtil.byteTobyte(data, dstPos, 6));
			event.setTime(time);
			dstPos += 6;

			return event;

		} catch (Exception e) {
			e.printStackTrace();ExceptionUtil.getInfo(e);
			logger.info("解析终端事件通知协议异常:"+e);
			return null;
		}
	}

	/**
	 * 文本信息应答
	 * @param msgbody
	 * @return
	 */
	public static TextInfo decoderTextResponse(String msgbody){

		byte [] data = ParseUtil.parseHexStrToByte(msgbody);
		try {

			TextInfo textInfo = new TextInfo();
			int dstPos = 0;
			//标志
			int flag = ParseUtil.byteToint(ParseUtil.byteTobyte(data, dstPos, 1));
			textInfo.setFlag(flag);
			dstPos += 1;
			//当前序号
			int textseq = ParseUtil.byteToint(ParseUtil.byteTobyte(data, dstPos, 1));
			textInfo.setTextseq(textseq);
			dstPos += 1;
			//文本信息
			byte[] textdatabyte = ParseUtil.byteTobyte(data, dstPos, data.length-2);
			String textdata = ParseUtil.byteToString(textdatabyte, 0, textdatabyte.length);
			textInfo.setTextdata(textdata);

			return textInfo;

		} catch (Exception e) {
			e.printStackTrace();ExceptionUtil.getInfo(e);
			logger.info("解析文本信息应答协议异常:"+e);
			return null;
		}
	}

	/**
	 * 升级结果报告
	 * @param msgbody
	 * @return
	 */
	public static TerminalUpdate decoderUpdateResult(String msgbody){

		byte [] data = ParseUtil.parseHexStrToByte(msgbody);
		try {

			TerminalUpdate tUpdate = new TerminalUpdate();
			int dstPos = 0;
			//设备类型
			int devicetype = ParseUtil.byteToint(ParseUtil.byteTobyte(data, dstPos, 1));
			tUpdate.setDevicetype(devicetype);
			dstPos += 1;
			//厂商标识
			int oem = ParseUtil.byteToint(ParseUtil.byteTobyte(data, dstPos, 1));
			tUpdate.setOem(oem);
			dstPos += 1;
			//硬件版本号
			String dversion = ParseUtil.bcd2Str(ParseUtil.byteTobyte(data, dstPos, 1));
			tUpdate.setDversion(dversion);
			dstPos += 1;
			//软件版本号
			String sversion = ParseUtil.bcd2Str(ParseUtil.byteTobyte(data, dstPos, 2));
			tUpdate.setSversion(sversion);
			dstPos += 2;
			//升级结果
			int result = ParseUtil.byteToint(ParseUtil.byteTobyte(data, dstPos, 1));
			tUpdate.setResult(result);
			dstPos += 1;

			return tUpdate;

		} catch (Exception e) {
			e.printStackTrace();ExceptionUtil.getInfo(e);


22], "when": [21, 23], "where": [4, 8, 9, 10, 11, 12, 14, 16, 17, 18, 20, 21, 22, 23], "which": [11, 15, 22], "wrapper": 17, "wright": 16, "x": [18, 20, 21, 22, 23], "xaxi": 0, "xaxis2": 0, "xlabel": 3, "xlim": 1, "xu": 22, "xx": 22, "y": [1, 16, 18, 20, 21, 22, 23], "y_mdof": 1, "yaxi": 0, "yield": 22, "ylabel": 3, "ymax": [2, 4], "ymin": [2, 4], "you": 0, "ytrue": [0, 1, 2, 4], "yu": 22, "yx": 22, "yy": 22, "z": [4, 23], "zero": [1, 4, 14, 18, 22, 23], "zeta": [0, 1, 2, 4], "zeta1": 4, "zeta2": 4, "zeta_": 20, "zhang": 17, "zip": [4, 5], "zustandsvari": 16, "zz": 5, "\u03b2": 16, "\u03b6": [0, 1, 2, 4, 5]}, "titles": ["Overview of the mdof package", "Introduction to SISO", "SISO for a Ground Motion Event", "SISO for Event History", "Introduction to MIMO", "MIMO for Event History", "Examples", "mdof documentation", "mdof.eigid", "mdof.modes", "mdof.outid", "mdof.predict", "mdof.sysid", "mdof", "mdof.markov module", "mdof.modal module", "mdof.realize module", "mdof.transform module", "Eigensystem Realization Algorithm (ERA)", "Theory", "Modal Properties from State Space Realization", "Observer Kalman Filter Identification (OKID)", "System Realization by Information Matrix (SRIM)", "State Space Model of Structural Dynamics"], "titleterms": {"1": 0, "2": 0, "3": 0, "A": 20, "For": 0, "The": 4, "_": 20, "algorithm": [1, 5, 18], "analysi": [2, 4], "ani": 0, "appendix": 22, "ar": [0, 4], "below": 4, "breakdown": 1, "c": 20, "can": 0, "compar": 1, "configur": [2, 4], "content": 7, "continu": 23, "coordin": 4, "correl": [1, 22], "damp": [4, 20], "data": [0, 1, 5], "dataset": 3, "dc": 1, "defin": 1, "deriv": 4, "discret": [22, 23], "document": 7, "dynam": 23, "eigendecomposit": 20, "eigensystem": [1, 5, 18], "eigenvalu": 4, "eigid": 8, "equat": [22, 23], "equilibrium": 23, "era": [1, 5, 18], "estim": 4, "event": [2, 3, 5], "exampl": 6, "express": 4, "filter": 21, "frequenc": [4, 20], "from": [0, 20, 22], "function": [1, 2], "gener": [0, 1, 5], "given": 0, "ground": 2, "harmon": 4, "histori": [3, 5], "i": [0, 4], "identif": [0, 1, 2, 3, 4, 5, 21], "identifi": 3, "import": 0, "inform": [1, 5, 22], "input": [0, 1, 2, 3, 4


 "";
            else
            {
                text += "\r\n" + indent;
            }

            if (node is XmlComment)
            {
                text += node.OuterXml;
                return text;
            }

            text += "<" + node.Name;
            if (node.Attributes.Count > 0)
            {
                AddAttributes(node, ref text);
            }
            if (node.HasChildNodes)
            {
                text += ">";
                foreach (XmlNode child in node.ChildNodes)
                {
                    text = FormatText(child, text, indent + "  ");
                }
                if (node.ChildNodes.Count == 1 &&
                   (node.FirstChild is XmlText || node.FirstChild is XmlComment))
                    text += "</" + node.Name + ">";
                else
                    text += "\r\n" + indent + "</" + node.Name + ">";
            }
            else
                text += " />";
            return text;
        }

        private void AddAttributes(XmlNode node, ref string text)
        {
            foreach (XmlAttribute xa in node.Attributes)
            {
                text += " " + xa.Name + "='" + xa.Value + "'";
            }
        }

        private void buttonExecute_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                XmlNodeList nodes = document.DocumentElement.SelectNodes(textBoxQuery.Text);
                Update(nodes);
            }
            catch (Exception err)
            {
                textBlockResult.Text = err.Message;
            }
        }
    }
}


uot;, package = "MASS")
# Split the data into training and test set
set.seed(123)
training.samples <- Boston$medv %>%
  createDataPartition(p = 0.8, list = FALSE)
train.data  <- Boston[training.samples, ]
test.data <- Boston[-training.samples, ]
# Predictor variables
x <- model.matrix(medv~., train.data)[,-1]
# Outcome variable
y <- train.data$medv
lambda <- 10^seq(-3, 3, length = 100)

# ridge
# Build the model
set.seed(123)
ridge <- train(
  medv ~., data = train.data, method = "glmnet",
  trControl = trainControl("cv", number = 10),
  tuneGrid = expand.grid(alpha = 0, lambda = lambda)
  )

# Model coefficients
coef(ridge$finalModel, ridge$bestTune$lambda)

## 14 x 1 sparse Matrix of class "dgCMatrix"
##                         1
## (Intercept)  29.199522433
## crim         -0.076456377
## zn            0.026794700
## indus        -0.062277495
## chas          2.525893584
## nox         -11.388819192
## rm            3.723870172
## age           0.002204446
## dis          -1.058455239
## rad           0.165876918
## tax          -0.005354632
## ptratio      -0.862205203
## black         0.009610093
## lstat        -0.498825572

# Make predictions
predictions <- ridge %>% predict(test.data)
# Model prediction performance
data.frame(
  RMSE = RMSE(predictions, test.data$medv),
  Rsquare = R2(predictions, test.data$medv)
)

##       RMSE   Rsquare
## 1 4.646655 0.7655889

set.seed(123)
lasso <- train(
  medv ~., data = train.data, method = "glmnet",
  trControl = trainControl("cv", number = 10),
  tuneGrid = expand.grid(alpha


tOrEmpty("java.vm.version")
    val tmpDir get() = getOrEmpty("java.io.tmpdir")
    val pathSeparator get() = File.separatorChar.toString()

    // User
    val userDir get() = getOrEmpty("user.dir")
    val userHome get() = getOrEmpty("user.home")
    val userName get() = getOrEmpty("user.name")

    fun getOrEmpty(name: String): String {
        val pval = System.getProperty(name)
        return pval.orEmpty()
    }
}
/**
 *  <kiit_header>
 * url: www.kiit.dev
 * git: www.github.com/slatekit/kiit
 * org: www.codehelix.co
 * author: Kishore Reddy
 * copyright: 2016 CodeHelix Solutions Inc.
 * license: refer to website and/or github
 *
 *
 *  </kiit_header>
 */

package kiit.common.utils

/**
 * Supplements kotlin require guard method.
 */
object Require {

    /**
     * Ensures text is not empty, otherwise throws an IllegalArgumentException with the message
     *
     * @param text : The string to check
     * @param message : Message for the exception
     */
    fun requireText(text: String?, message: String) {
        require(!text.isNullOrEmpty()) { message }
    }

    /**
     * Ensures text exists in the list, otherwise throws an IllegalArgumentException with the message
     *
     * @param text : The string to check for
     * @param items : The list of items to search
     * @param message : Message for the exception
     */
    fun requireOneOf(text: String, items: List<String>, message: String) {
        require(items.contains(text)) { message }
    }

    /**
     * Ensures condition is true, otherwise throws an IllegalArgumentException with the message
     *
     * @param pos : The index position
     * @param size : The size to check against
     * @param message : Message for the exception
     */
    fun requireValidIndex(pos: Int, size: Int, message: String) {
        require(pos in 1..(size - 1)) { message }
    }
}
/**
 *  <kiit_header>
 * url: www.kiit.dev
 * git: www.github.com/slatekit/kiit
 * org: www.codehelix.co
 * author: Kishore Reddy
 * copyright: 2016 CodeHelix Solutions Inc.
 * license: refer to website and/or github
 *
 *
 *  </kiit_header>
 */

package kiit.common.checks

import kiit.common.toCharMap

object CheckConsts {

    @JvmField val NUMS = "0123456789".toCharMap
    @JvmField val LETTERS_LCASE = "abcdefghijklmnopqrstuvwxyz".toCharMap
    @JvmField val LETTERS_UCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharMap
    @JvmField val LETTERS_ALL = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharMap
    @JvmField val ALPHA = "0123456789abcdefghijklmnopqrstuvwxyz".toCharMap
    @JvmField val SYMS = "!@#$%^&*()_+-=[]{}|;:,./<>?".toCharMap
    @JvmField val ALPHASYM = "0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()_+-=[]{}|;:,./<>?".toCharMap
    const val Error_Is_Empty = "Item must be empty"
    const val Error_Is_NotEmpty = "Item must not be empty"
    const val Error_Is_OneOf = "Item must be one of the valid values"
    const val Error_Is_Length = "Item must have a valid length"
    const val Error_Is_MinLength = "Item must have a valid min length"
    const val Error_Is_MaxLength = "Item must have a valid


	//  - This comes from (4 bytes per float)x(4 sensors)x(2 vals per sensor)
	//	- The values will be stored in the order (cal[0].x),(cal[0].y),(cal[0].r),
	//		(cal[1].x),...,(cal[i].r), so sensor 0 calibration value for x,
	//		sensor 0 calibration value for y, sensor 0 calibration for rotation,
	//		sensor 1 calibration value for x, and so on

	Serial.println("writing calibration values to EEPROM...");

	int addr = 0;         // starting address is always 0
	for (int i = 0; i < ns; i++) {    // sensor number
		EEPROM.put(addr, cal[i].x);
		addr += sizeof(float);
		EEPROM.put(addr, cal[i].y);
		addr += sizeof(float);
		EEPROM.put(addr, cal[i].r);
		addr += sizeof(float);
  	}
}

void calibrate() {
	encoder.setEncoderHandler(nullHandler);
	encoder.setClickHandler(onClickCalibrationAdvance);

	float calDistance = 300.0;
	int currentRun = 0;
	int numRuns = 5;
	float tempCalScalar[2][ns] = {0.0f};
	float tempCalRot[2][ns] = {0.0f};

	for (int axis = 0; axis < 2; axis++) {
		while (currentRun < numRuns) {
			if (axis == 0) {
				drawCenteredText("Align X axis\nClick when at 0", 2);
			} else {
				drawCenteredText("Align Y axis\nClick when at 0", 2);
			}
			// draw circular progress bar based on run number
			int progressRadius = (screen->width()/2) - 10;
			int centerX = screen->width() / 2;
			int centerY = screen->height() / 2;
			float progressAngle = (currentRun + 1) * (TWO_PI / numRuns);

			screen->drawCircle(centerX, centerY, progressRadius, WHITE);
			for (float rad = 0; rad < progressAngle; rad+=0.01) {
				for (int i = 0; i < 3; i++) {
					int x = centerX + (progressRadius-1+i) * sinf(rad);
					int y = centerY - (progressRadius-1+i) * cosf(rad);
					screen->drawPixel(x, y, GREEN);
				}
			}

			while (state != CALIBRATION_ADVANCE) encoder.update();
			state = CALIBRATION;

			// Flush sensor readings then reset
			for (int i = 0; i < ns; i++) {
				sensors[i].readBurst();
				calPos[0][i] = 0.0f;
				calPos[1][i] = 0.0f;
			}

			// prompt x calibration
			// 	- do x run
			//		- "Reached 300?"
			// 		- "Retry?"
			if (axis == 0) {
				drawCenteredText("Move in +X\nClick when at 300mm", 2);
			} else {
				drawCenteredText("Move in +Y\nClick when at 300mm", 2);
			}

			while (state != CALIBRATION_ADVANCE) {
				if(micros() - timeLastPoll >= dt) {
					doSensingLinear();
				}

				encoder.update();
			}

			for (int i = 0; i < ns; i++) {
				float sensorDist = calDistance / (myDist(calPos[0][i],calPos[1][i],0,0));
				float sensorRot = axis ? atan2f(calPos[0][i],calPos[1][i]) : atan2f(-calPos[1][i],calPos[0][i]);	// Cry : Crx

				Serial.printf("Cx/y:%f, Cr:%


TIMPL;
}

static HRESULT WINAPI random_access_stream_reference_statics_CreateFromUri( IRandomAccessStreamReferenceStatics *iface, IUriRuntimeClass *uri,
                                                                            IRandomAccessStreamReference **stream_reference )
{
    FIXME( "iface %p, uri %p, stream_reference %p stub!\n", iface, uri, stream_reference );
    return E_NOTIMPL;
}

static HRESULT WINAPI random_access_stream_reference_statics_CreateFromStream( IRandomAccessStreamReferenceStatics *iface, IRandomAccessStream *stream,
                                                                               IRandomAccessStreamReference **stream_reference )
{
    FIXME( "iface %p, stream %p, stream_reference %p stub!\n", iface, stream, stream_reference );

    *stream_reference = NULL;

    if (!stream) return E_POINTER;
    return E_NOTIMPL;
}

static const struct IRandomAccessStreamReferenceStaticsVtbl random_access_stream_reference_statics_vtbl =
{
    random_access_stream_reference_statics_QueryInterface,
    random_access_stream_reference_statics_AddRef,
    random_access_stream_reference_statics_Release,
    /* IInspectable methods */
    random_access_stream_reference_statics_GetIids,
    random_access_stream_reference_statics_GetRuntimeClassName,
    random_access_stream_reference_statics_GetTrustLevel,
    /* IRandomAccessStreamReferenceStatics methods */
    random_access_stream_reference_statics_CreateFromFile,
    random_access_stream_reference_statics_CreateFromUri,
    random_access_stream_reference_statics_CreateFromStream,
};

static struct random_access_stream_reference_statics random_access_stream_reference_statics =
{
    {&factory_vtbl},
    {&random_access_stream_reference_statics_vtbl},
    0,
};

IActivationFactory *random_access_stream_reference_factory = &random_access_stream_reference_statics.IActivationFactory_iface;


ef OVERDRAW_INSPECTOR
gl_FragColor=vec4(0.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),ap=dt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),tf=dt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset


A{9A3<)F59{*FJ 3jJ5-F)A: :_5:<PAt{*tJteF<{A*9 33ee<NA)9e):J<5<{PF{ *dt: P9t*93J3eJP,te*eJ:e5P-AP9{3A)t5J{9F*  {39) thJ5Pr::9P<tP*{53te* J5)3<tA:5JA59)3e):tA F)359&F:FPFtJ**J e3*PJ)e3<{e:{:A<9P3{<t9333)FJ*{:tJ3)w :F{OtFA5J e{PF5A993Jer<F: 9e3Ae:5e{5FJ t/tH57{:*PttF*9<:A3*{X:*4)<ee<:A52t<<:{F93)T95Je*FM F4A::P*<e*9Jt:{<95{*{J9 F<9A39eJ)eeE4::{)t<*55gP99,tPtt 5J9e*< 3s:5<3{59{J<eF53{tF*{A9: FW9:*958:5:<:tP 5Mte <AA9<{AJ9t3F)9tJJ)):5JA2FP PF: 5N<:PP{9 *tJFe9P3 A933Je(<PAe9:35:<59{AFA tDF:9{Pt 3i8::!P:te**J5e<<PA{9 3t)F59{3F 3!QJPYAAFe :n5:<PPFe*A)t5.<9A*9 33)J<{A)9e3 )55<{PFt Ax9:F{)9e* J3eJA5t)*:J:e5<<AFPF3A)t5FtJF* 3_3:JP*F) e.::5P<tP*{J35 <FA99*JF)3<(AZ9e3e){J{{<FP {)<:tP9t9 (9ce3<Jto *Jee5<5A<9e3{)A5t{9F9 *_ <39JF) ),e::P5t{*PJ A<<tAF99J3) 5J{J9,3))PJP{5F< P)t:APFtF*JFJe <3AJ*YJ)e:<:A59)3P){5A{9FF 9h*5:*9tJ lQ)5AP:t<*<JPe{<*:*9F39)*P:{39(3W)<J<{:F5 <eF:{Pttt*FJ{e*< A3*aJCe)<e9:t<3<)P5{{FFt 3W95oevt3*J%v:)Pet5*5Jt t<{AA9tV3)95 { 9ete)T5){eF: 5CP:PP{t5*tJFe9<JA 933J<Y:eAe9:35){5P{9FA tdP:9P*t *JJJ:=P)*eF5J5e<<PAF9AJ))F< *{F  3GJ5){)Fe :)Pt PPtA*AJJeF<9A*9 )*)J<YA)953:)<5<{F<F A8t:FAJt**3J3::):t)*eJ:e5<<A{9{3A!F5F{9F* 3C3:J{NF)3t7::5P<tPPbJAet<FA99*3 )3{JtP9)3e):5P{<FF {aA5{PFt9**J e3<JtQ3)J<e:<5A<9P3{)95ttF9* *8 :3PJF_ P/e:t9:tP*AJ{eA<tA999J4) 53*P9)3))e55{5F< P_{{JPFtF*9J3e <3AJ*x


snippet lang=c :
     * extern const char *vips_foreign_find_save_buffer(const char *suffix)
     * }
     */
    public static MemorySegment vips_foreign_find_save_buffer(MemorySegment suffix) {
        var mh$ = vips_foreign_find_save_buffer.HANDLE;
        try {
            if (TRACE_DOWNCALLS) {
                traceDowncall("vips_foreign_find_save_buffer", suffix);
            }
            return (MemorySegment)mh$.invokeExact(suffix);
        } catch (Throwable ex$) {
           throw new AssertionError("should not reach here", ex$);
        }
    }

    private static class vips_foreign_find_save_target {
        public static final FunctionDescriptor DESC = FunctionDescriptor.of(
            VipsRaw.C_POINTER,
            VipsRaw.C_POINTER
        );

        public static final MemorySegment ADDR = VipsRaw.findOrThrow("vips_foreign_find_save_target");

        public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC);
    }

    /**
     * Function descriptor for:
     * {@snippet lang=c :
     * extern const char *vips_foreign_find_save_target(const char *suffix)
     * }
     */
    public static FunctionDescriptor vips_foreign_find_save_target$descriptor() {
        return vips_foreign_find_save_target.DESC;
    }

    /**
     * Downcall method handle for:
     * {@snippet lang=c :
     * extern const char *vips_foreign_find_save_target(const char *suffix)
     * }
     */
    public static MethodHandle vips_foreign_find_save_target$handle() {
        return vips_foreign_find_save_target.HANDLE;
    }

    /**
     * Address for:
     * {@snippet lang=c :
     * extern const char *vips_foreign_find_save_target(const char *suffix)
     * }
     */
    public static MemorySegment vips_foreign_find_save_target$address() {
        return vips_foreign_find_save_target.ADDR;
    }

    /**
     * {@snippet lang=c :
     * extern const char *vips_foreign_find_save_target(const char *suffix)
     * }
     */
    public static MemorySegment vips_foreign_find_save_target(MemorySegment suffix) {
        var mh$ = vips_foreign_find_save_target.HANDLE;
        try {
            if (TRACE_DOWNCALLS) {
                traceDowncall("vips_foreign_find_save_target", suffix);
            }
            return (MemorySegment)mh$.invokeExact(suffix);
        } catch (Throwable ex$) {
           throw new AssertionError("should not reach here", ex$);
        }
    }
    private static final int VIPS_FOREIGN_SUBSAMPLE_AUTO = (int)0L;
    /**
     * {@snippet lang=c :
     * enum <anonymous>.VIPS_FOREIGN_SUBSAMPLE_AUTO = 0
     * }
     */
    public static int VIPS_FOREIGN_SUBSAMPLE_AUTO() {
        return VIPS_FOREIGN_SUBSAMPLE_AUTO;
    }
    private static final int VIPS_FOREIGN_SUBSAMPLE_ON = (int)1L;
    /**
     * {@snippet lang=c :
     * enum <anonymous>.VIPS_FOREIGN_SUBSAMPLE_ON = 1
     * }
     */
    public static int VIPS_FOR


iled to grant {policy} to {USERNAME}. Exiting.")
            exit(1)

    # 1.2 grant extra permissions related to AgentCore via custom policy file
    attach_custom_policy(
        policy_name="agentCoreCustomPolicy",
        policy_json_path=os.path.join(POLICIES_DIR, "agentCoreCustomPolicy.json"),
        attach_to_type="user",
        attach_to_name="learner",
    )
    print("✅ agentCoreCustomPolicy policy created and attached to learner")

    # 2. Enable the Bedrock models
    for model in BEDROCK_MODELS:
        result = enable_model(model)
        if result["status"] == "enabled":
            print(f"✅ Bedrock model {model} enabled")
        else:
            print(f"❌ Failed to enable Bedrock model {model}")
            exit(1)

    # 3. Create guardrail
    guardrail = create_guardrail(REGION_NAME)
    if not guardrail:
        print("❌ Failed to create guardrail. Exiting.")
        exit(1)
    else:
        guardrail_id = guardrail["guardrailId"]
        print(f"✅ Guardrail is ready to use with ID: {guardrail_id}")

    # 4. Setup complete knowledge base
    result = setup_complete_knowledge_base(
        documents_folder=DOCUMENTS_FOLDER,
        vector_bucket_name=VECTOR_BUCKET_NAME,
        vector_index_name=VECTOR_INDEX_NAME,
        kb_name=KB_NAME,
        region_name=REGION_NAME,
    )

    # Check if knowledge base setup was successful
    if result:
        knowledge_base_id, vector_index_arn = result
        print("\nKnowledge Base is ready to use!")
        print(f"Knowledge Base ID: {knowledge_base_id}")
        print(f"Vector Index ARN: {vector_index_arn}")
    else:
        print("❌ Failed to create knowledge base. Exiting.")
        exit(1)

    # 5. Configure and then launch agent
    configure_agent()
    print("✅ Agent is configured")

    # 6. Launch agent
    launch_agent(
        guardrail_id=guardrail_id,
        knowledge_base_id=knowledge_base_id,
    )
    print("✅ Agent is launched")

    # 7. Create backup bucket and upload config after launch
    create_config_backup_bucket()
    print("✅ Config file uploaded to S3 bucket")

if __name__ == "__main__":
    main()


using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Codaxy.WkHtmlToPdf.Tests
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.InputEncoding = Encoding.UTF8;

            PdfConvert.Environment.Debug = false;
            PdfConvert.ConvertHtmlToPdf(new PdfDocument { Url = "http://www.codaxy.com" }, new PdfOutput
            {
                OutputFilePath = "codaxy.pdf"
            });

            PdfConvert.ConvertHtmlToPdf(new PdfDocument
            {
                Url = "http://www.codaxy.com",
                HeaderLeft = "[title]",
                HeaderRight = "[date] [time]",
                FooterCenter = "Page [page] of [topage]",


//       Our screen rows are what we are building to display; a data row we are here
		//       defining to be a single xref.   This is a somewhat arbitrary decision.
		int dataRow = totalXrefs - noFunction.size();
		TextField noFunctionXrefsField = createWrappingXrefRow(program, dataRow, noFunction,
			currentFunction, isOffcut, availableLines, hlFactory);

		List<TextField> allFields = new ArrayList<>();
		allFields.addAll(functionRows);
		if (noFunctionXrefsField != null) {
			allFields.add(noFunctionXrefsField);
		}

		int newStartX = startX + varWidth;
		if (tooMany) {
			// add the [more] element
			int lastRow = allFields.size() - 1;
			AttributedString as =
				new AttributedString(MORE_XREFS_STRING, XrefColors.DEFAULT, metrics);
			TextFieldElement moreElement = new TextFieldElement(as, lastRow, 0);
			ClippingTextField ctf = new ClippingTextField(newStartX, width, moreElement, hlFactory);
			allFields.add(ctf);
		}

		CompositeVerticalLayoutTextField compositefield =
			new CompositeVerticalLayoutTextField(allFields, newStartX, width, maxXRefs, hlFactory);
		XrefListingField listingField =
			new XrefListingField(this, proxy, compositefield, hlFactory);
		return listingField;
	}

	private List<TextField> createXrefRowsByFunction(Program program, Function currentFunction,
			TreeMap<Function, List<Reference>> xrefsByFunction, Predicate<Reference> isOffcut,
			int varWidth, FieldHighlightFactory hlFactory) {

		FontMetrics metrics = getMetrics();
		AttributedString delimiter = new AttributedString(delim, Colors.FOREGROUND, metrics);

		int row = 0;
		List<FieldElement> elements = new ArrayList<>();
		Set<Entry<Function, List<Reference>>> entries = xrefsByFunction.entrySet();
		for (Entry<Function, List<Reference>> entry : entries) {

			//
			// Example row: functionName: 1234(c), 1238(c)
			//

			List<Reference> refs = entry.getValue();
			Function fromFunction = entry.getKey();
			String functionName = fromFunction.getName();
			int refCount = refs.size();
			String sizeText = ": ";
			if (refCount > 1) {
				sizeText = "[" + refs.size() + "]: ";
			}
			String text = functionName + sizeText;
			AttributedString nameString = new AttributedString(text, XrefColors.DEFAULT, metrics);
			List<XrefFieldElement> rowElements = new ArrayList<>();
			Reference firstRef = refs.get(0);
			XrefAttributedString xrefString = new XrefAttributedString(firstRef, nameString);
			rowElements.add(new XrefFieldElement(xrefString, row, 0));

			//
			// TODO how many xrefs to display per function?
			//
			int n = Math.min(10, refs.size());
			for (int i = 0; i < n; i++) {

				boolean isLast = i == n - 1;
				Reference ref = refs.get(i);
				String prefix = getMergedPrefix(program, ref, currentFunction, fromFunction);
				XrefFieldElement element = createFunctionElement(program, prefix, ref, row,
					isLast ? null : delimiter, isOffcut.test(ref));
				rowElements.add(element);
			}

			elements.add(new CompositeFieldElement(rowElements));

			row++;
		}

		int newStartX = startX + varWidth;
		List<TextField> textFields = new ArrayList<>();
		for (FieldElement element : elements) {
			textFields.add(new ClippingTextField(newStartX, width, element, hlFactory));
		}

		return textFields;
	}

	private TextField createWrappingXrefRow(Program program, int startRow, List<Reference> xrefs,
			Function currentFunction, Predicate<Reference> isOffcut, int availableLines,
			Fie


      "993122" : "功興（台中市太平區建興路47號）",
      "993270" : "溪洲（台中市太平區新平路二段221號）",
      "993708" : "精中（台中市太平區太平一街220號）"
   },
   "SEB117" : {
      "111027" : "瑞城（台中市大里區瑞城一街1號）",
      "111979" : "喬城（台中市大里區大智路567號）",
      "112204" : "興城（台中市大里區塗城路765號）",
      "127066" : "玉豐（台中市大里區東榮路483號）",
      "130235" : "興生（台中市大里區大里路95號97號1樓）",
      "131087" : "國光（台中市大里區國光路二段257號）",
      "142995" : "仁化（台中市大里區仁化路657號）",
      "145031" : "元百（台中市大里區成功路512號516號）",
      "150952" : "宥辰（台中市大里區立新街350號）",
      "153722" : "新里（台中市大里區中興路二段480號）",
      "165035" : "新永大（台中市大里區大明路340號1樓）",
      "170635" : "美群（台中市大里區美群路60號）",
      "175054" : "大明（台中市大里區中興路二段833號835號）",
      "180838" : "十九甲（台中市大里區東昇里新仁路二段92號）",
      "181314" : "大金（台中市大里區中興路一段255號）",
      "182764" : "新榮（台中市大里區東榮路552號）",
      "188740" : "中城（台中市大里區中興路一段328號）",
      "194262" : "豐竹（台中市大里區健民路97號）",
      "198725" : "巧聖（台中市大里區西榮里益民路二段137號）",
      "810018" : "草湖（台中市大里區中興路一段11之6號）",
      "874296" : "益民（台中市大里區東興里10鄰大明路238號）",
      "880822" : "大峰（台中市大里區大峰路167號）",
      "885780" : "東里（台中市大里區大里路295號）",
      "890704" : "立新（台中市大里區立仁路142號）",
      "893345" : "新仁華（台中市大里區仁化路460.462號）",
      "905424" : "大道（台中市大里區仁化里至善路1


-->

  ETH

						Share

Tweet

DoE #38 – Toasting Mate

Lucian and Evan Van Ness start off by justifying their caffeine addiction and shilling Yerba Mate. Evan and Josh Stark wrote a detailed update on developments that spanned the Ethereum ecosystem, we pick out some datapoint highlights for our listeners. For example they demonstrated, with data, how multiple individual DApps on Ethereum have produced more […]

								Read More

									4 years ago

												<div class="one-fourth column


Value is Map<String, dynamic>) {
      final type = dbValue['_type'];
      final value = dbValue['_value'];

      if (type == 'enum' && value is String) {
        // 处理枚举类型
        if (T == ThemeMode) {
          switch (value) {
            case 'system':
              return ThemeMode.system as T;
            case 'light':
              return ThemeMode.light as T;
            case 'dark':
              return ThemeMode.dark as T;
            default:
              return null;
          }
        }
        return null;
      }

      if (type == 'string' && value is String) {
        return value as T;
      }
    }

    // 处理 ThemeMode 类型
    if (T == ThemeMode && dbValue is String) {
      switch (dbValue) {
        case 'system':
          return ThemeMode.system as T;
        case 'light':
          return ThemeMode.light as T;
        case 'dark':
          return ThemeMode.dark as T;
        default:
          return null;
      }
    }

    // 处理 Color 类型
    if (initialValue is Color && dbValue is int) {
      return Color(dbValue) as T;
    }

    // 处理 MaterialColor 和 MaterialAccentColor 类型
    if (initialValue.runtimeType.toString().contains('MaterialColor') ||
        initialValue.runtimeType.toString().contains('MaterialAccentColor')) {
      if (dbValue is int) {
        // 对于 MaterialColor 类型，我们无法完美重建，但可以创建一个基本的 Color
        // 然后让应用使用初始值，但记录文件存储中确实有值
        if (kDebugMode) {
          print('[PersistentSignal] MaterialColor 从文件存储加载颜色值: $dbValue，但使用初始值以保持完整性');
        }
        return null; // 继续使用初始值以保持 MaterialColor 的完整性
      }
    }

    // 处理枚举类型
    if (initialValue is Enum && dbValue is String) {
      // 这里需要根据具体的枚举类型来处理
      // 由于泛型限制，暂时返回 null
      return null;
    }

    // 处理 List 类型
    if (initialValue is List && dbValue is List) {
      try {
        return dbValue.cast<dynamic>() as T;
      } catch (e) {
        return null;
      }
    }

    // 处理 Map 类型
    if (initialValue is Map && dbValue is Map) {
      try {
        return Map<String, dynamic>.from(dbValue) as T;
      } catch (e) {
        return null;
      }
    }

    // 处理基本类型转换
    if (T == String) {
      return dbValue.toString() as T;
    }

    if (T == int && dbValue is num) {
      return dbValue.toInt() as T;
    }

    if (T == double && dbValue is num) {
      return dbValue.toDouble() as T;
    }

    if (T == bool) {
      if (dbValue is bool) return dbValue as T;
      if (dbValue is String) {
        return (dbValue.toLowerCase() == 'true') as T;
      }
    }

    // 无法解码，返回 null
    return null;
  }

  /// 编码值为可存储的格式
  dynamic _en


tual = ensure(
		`ab
ab
ab`,
		2
	);

	expect(actual).toBe(true);
});
import { Habit } from '../database/models/habit';
import { getDay, format } from 'date-fns';

const resetDailyHabits = async () => {
  try {
    const habits = await Habit.findAll();
    habits.map(habit => {
      Habit.update(
        { is_complete: false },
        { where: { frequency: 'daily' } }
      );
    });
  } catch (err) {
    console.warn('error updating daily habits: ', err);
  }
};

const resetWeeklyHabits = async () => {
  try {
    const habits = await Habit.findAll();
    const currentDayOfWk = getDay(new Date());
    const days = {
      0: 'Su',
      1: 'M',
      2: 'Tu',
      3: 'W',
      4: 'Th',
      5: 'F',
      6: 'Sa'
    }
    habits.map(habit => {
      // currently set to reset each day newly due
      if (habit.days_of_week.includes(days[currentDayOfWk])) {
        Habit.update(
          { is_complete: false },
          { where: { id: habit.id } }
        );
      }
    });
  } catch (err) {
    console.warn('error updating weekly habits: ', err);
  }
}

const resetMonthlyHabits = async () => {
  try {
    const habits = await Habit.findAll();
    const currentDateOfMonth = format(new Date(), 'd');
    habits.map(habit => {
      if (habit.frequency === 'monthly') {
        Habit.update(
          { is_complete: false },
          { where: { calendar_date: parseInt(currentDateOfMonth) } }
        );
      }
    });
  } catch (err) {
    console.warn('error updating monthly habits: ', err);
  }
}

resetDailyHabits();
resetWeeklyHabits();
resetMonthlyHabits();import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { from, interval, Observable, of } from 'rxjs';
import { first, map, tap } from 'rxjs/operators';

export interface User {
  id: number;
  firstName: string;
  lastName: string;
}

export interface Post {
  userId: number;
  id: number;
  title: string;
  body: string;
}

const users: User[] = [
  {
    id: 1,
    firstName: 'John',
    lastName: 'Doe',
  },
  {
    id: 2,
    firstName: 'Sally',
    lastName: 'Mae',
  },
  {
    id: 3,
    firstName: 'Chris',
    lastName: 'Williams',
  },
];

@Injectable({
  providedIn: 'root',
})
export class AppService {
  private value$: Observable<number>;

  constructor(private http: HttpClient) {
    this.value$ = interval(1000);
  }

  getValue(): Observable<number> {
    return this.value$;
  }

  getUsers(): Observable<User[]> {
    return of(users);
  }

  getUser(id: number): Observable<User> {
    return from(users).pipe(first((user) => user.id === id));
  }

  getPosts(): Observable<Post[]> {
    return this.http.get<Post[]>('https://jsonplaceholder.typicode.com/posts');
  }

  getPost(id: number): Observable<Post> {
    return this.http.get<Post>(
      `https://jsonplaceholder.typicode.com/posts/${id}`
    );
  }
}
import {Component} from "../../Component";
import GetStarted from "../getStarted/GetStarted";
import Testimonial from "../testimonials/Testimonial";
import


 {
      if (input.parsedOp.indexed) {
        this.cardCusses.add(cusses.Cuss40)
      }
    }

    if (!this.verifyAddressField(input, operandNecessity)) {
      return { lexedLine: input.lexedLine }
    }

    const pushDown = this.popExplicit(input.parsedOp.op, operand)
    let parsed: field.AddressField | undefined
    if (operand !== undefined) {
      if (input.parsedOp.op === this.operations.operation('P')) {
        if (this.interpretiveOperationWords !== 0) {
          this.cardCusses.add(cusses.Cuss14)
        }
        if (pushDown === undefined) {
          this.cardCusses.add(cusses.Cuss0E)
          parsed = field.parse(operand, ops.Necessity.Never, false, this.options, this.cardCusses)
        } else {
          const indexed = pushDown.operator.indexed && pushDown.operand?.indexable === true
          const indexedNecessity = indexed ? ops.Necessity.Required : ops.Necessity.Never
          if (this.options.source.isBlock1() && operand === '-') {
            if (indexed) {
              this.cardCusses.add(cusses.Cuss17)
            }
            parsed = { value: operand }
          } else {
            parsed = field.parse(operand, indexedNecessity, false, this.options, this.cardCusses)
            const value = parsed?.value
            if (this.options.source.isBlock1() && field.isOffset(value) && value.value < 0) {
              // Hacky workaround for yaYUL-formatted source that moves the '-' from column 17 to the start of the
              // address field.
              parsed = { value: -value.value }
              complemented = true
            }
          }
        }
      } else {
        parsed = field.parse(operand, ops.Necessity.Never, false, this.options, this.cardCusses)
      }

      if (parsed === undefined) {
        return { lexedLine: input.lexedLine }
      }
    }

    const card: AddressConstantCard = {
      type: CardType.Address,
      location: input.location,
      operation: {
        operation: input.parsedOp.op, complemented, indexed: input.parsedOp.indexed
      },
      address: parsed,
      interpretive: pushDown
    }
    return { lexedLine: input.lexedLine, card }
  }

  private parseClericalCard (input: LineOp<ops.Clerical>): ParsedLine {
    // We shouldn't have weird assembler operations like SETLOC between EXTEND and its target.
    // Unfortunately, there is at least one such operation in the code, which has no effect on
    // the location counter.
    // So warn but allow.
    switch (input.parsedOp.op.symbol) {
      case 'EBANK=':
      case 'SBANK=':
        break

      default:
        if (this.isExtended) {
          this.cardCusses.add(cusses.Cuss27, 'Operation should immediately follow EXTEND')
        }
    }
    this.verifyNotStadr()

    let pushDown: OperandStackElement | undefined
    const operand = input.lexedLine.field3
    if (input.parsedOp.op.words > 0) {
      pushDown = this.popExplicit(input.parsedOp.op, operand)
    } else if (this.interpretiveOperands.length > 0 && input.parsedOp.op !== this.operations.operation('EQUALS')) {
      // Let's also not allow clerical operations like SETLOC in the middle of an IIW / IAW pair
      this.cardCusses.add(cus


test_functionToString_prefixed() async {
    await assertNoDiagnostics('''
import '' as self;

void f() {
  switch (self.toString()) {
    case 'int':
      break;
    default:
      break;
  }
}

String toString() => '';
''');
  }

  Future<void> test_insideClass_implicitThis() async {
    await assertDiagnostics(
      '''
class A {
  void m() {
    switch (runtimeType) {
      case const (A):
        break;
      default:
        break;
    }
  }
}
''',
      [lint(35, 11)],
    );
  }

  Future<void> test_insideClass_withThis() async {
    await assertDiagnostics(
      '''
class A {
  void m() {
    switch (this.runtimeType) {
      case const (A):
        break;
      default:
        break;
    }
  }
}
''',
      [lint(35, 16)],
    );
  }

  Future<void> test_nestedSwitch() async {
    await assertDiagnostics(
      r'''
void f(Type t, Object o) {
  switch (switch(o) {_ => t}) {
    case const (int):
      break;
    default:
      break;
  }
}
''',
      [lint(37, 18)],
    );
  }

  Future<void> test_other() async {
    await assertNoDiagnostics('''
void f(num i) {
  switch (i) {
    case int _:
      break;
    case double _:
      break;
  }
}
''');
  }

  Future<void> test_override() async {
    await assertDiagnostics(
      '''
void f(MyClass i) {
  switch (i.runtimeType) {
    case const (MyClass):
      break;
    default:
      break;
  }
}

class MyClass {
  @override
  Type get runtimeType => int;
}
''',
      [lint(30, 13)],
    );
  }

  Future<void> test_prePatterns() async {
    await assertNoDiagnostics('''
// @dart = 2.19

void f(num i) {
  switch (i.runtimeType) {
    case int:
      break;
    case double:
      break;
    default:
      break;
  }
}
''');
  }

  Future<void> test_runtimeType() async {
    await assertDiagnostics(
      '''
void f(num i) {
  switch (i.runtimeType) {
    case const (int):
      break;
    case const (double):
      break;
    default:
      break;
  }
}
''',
      [lint(26, 13)],
    );
  }

  Future<void> test_runtimeTypeToString() async {
    await assertDiagnostics(
      '''
void f(num n) {
  switch (n.runtimeType.toString()) {
    case 'int':
      break;
    default:
      break;
  }
}
''',
      [lint(26, 24)],
    );
  }

  Future<void> test_runtimeTypeToString_insideClass() async {
    await assertDiagnostics(
      '''
class A {
  void m() {
    switch (runtimeType.toString()) {
      case 'A':
        break;
      default:
        break;
    }
  }
}
''',
      [lint(35, 22)],
    );
  }

  Future<void> test_runtimeTypeToString_insideClass_override() async {
    await assertDiagnostics(
      '''
class A {
  void m() {
    switch (runtimeType.toString()) {
      case 'A':
        break;
      default:
        break;
    }
  }

  @override
  MyType get


leCell-sizeSmall css-1suujdx"><svg viewBox="0 0 36 36" fill="none" role="img" xmlns="http://www.w3.org/2000/svg" width="28" height="28"><mask id=":r11s:" maskUnits="userSpaceOnUse" x="0" y="0" width="36" height="36"><rect width="36" height="36" rx="72" fill="#FFFFFF"></rect></mask><g mask="url(#:r11s:)"><rect width="36" height="36" fill="#F2CFB6"></rect><rect x="0" y="0" width="36" height="36" transform="translate(5 -5) rotate(226 18 18) scale(1.1) skewX(4) skewY(9)" fill="#851405" rx="21.6" ry="27"></rect><g transform="translate(-3.5 3.5) rotate(-4 18 18)"><rect x="12" y="14" width="1.8" height="3.3" rx="1.2" stroke="none" fill="#FFFFFF" style="animation: 100s ease 0s infinite normal none running eye;"></rect><rect x="22" y="14" width="1.8" height="3.3" rx="1.2" stroke="none" fill="#FFFFFF" style="animation: 100s ease 0s infinite normal none running eye;"></rect></g></g></svg>
qupa

0

pts

-

-

-

-

<p class="MuiTypography-root MuiTypography-body1 css


<H, N, E>>>,
	finalized_notifications: UnboundedReceiver<FinalizedNotification<H, N, E>>,
	last_finalized_number: N,
	global_in: GlobalIn,
	global_out: Buffered<GlobalOut, CommunicationOut<H, N, E::Signature, E::Id>>,
	// the commit protocol might finalize further than the current round (if we're
	// behind), we keep track of last finalized in round so we don't violate any
	// assumptions from round-to-round.
	last_finalized_in_rounds: (H, N),
}

impl<'a, H: 'a, N, E: 'a, GlobalIn, GlobalOut> Voter<H, N, E, GlobalIn, GlobalOut>
where
	H: Clone + Ord + ::std::fmt::Debug + Sync + Send,
	N: BlockNumberOps + Sync + Send,
	E: Environment<H, N> + Sync + Send,
	GlobalIn: Stream<Item = Result<CommunicationIn<H, N, E::Signature, E::Id>, E::Error>> + Unpin,
	GlobalOut: Sink<CommunicationOut<H, N, E::Signature, E::Id>, Error = E::Error> + Unpin,
{
	/// Returns an object allowing to query the voter state.
	pub fn voter_state(&self) -> Box<dyn VoterState<E::Id> + 'a + Send + Sync>
	where
		<E as Environment<H, N>>::Signature: Send,
		<E as Environment<H, N>>::Id: Hash + Send,
		<E as Environment<H, N>>::Timer: Send,
		<E as Environment<H, N>>::Out: Send,
		<E as Environment<H, N>>::In: Send,
	{
		Box::new(SharedVoterState(self.inner.clone()))
	}
}

impl<H, N, E: Environment<H, N>, GlobalIn, GlobalOut> Voter<H, N, E, GlobalIn, GlobalOut>
where
	H: Clone + Eq + Ord + ::std::fmt::Debug,
	N: Copy + BlockNumberOps + ::std::fmt::Debug,
	GlobalIn: Stream<Item = Result<CommunicationIn<H, N, E::Signature, E::Id>, E::Error>> + Unpin,
	GlobalOut: Sink<CommunicationOut<H, N, E::Signature, E::Id>, Error = E::Error> + Unpin,
{
	/// Create new `Voter` tracker with given round number and base block.
	///
	/// Provide data about the last completed round. If there is no
	/// known last completed round, the genesis state (round number 0, no votes, genesis base),
	/// should be provided. When available, all messages required to complete
	/// the last round should be provided.
	///
	/// The input stream for commit messages should provide commits which
	/// correspond to known blocks only (including all its precommits). It
	/// is also responsible for validating the signature data in commit
	/// messages.
	pub fn new(
		env: Arc<E>,
		voters: VoterSet<E::Id>,
		global_comms: (GlobalIn, GlobalOut),
		last_round_number: u64,
		last_round_votes: Vec<SignedMessage<H, N, E::Signature, E::Id>>,
		last_round_base: (H, N),
		last_finalized: (H, N),
	) -> Self {
		let (finalized_sender, finalized_notifications) = mpsc::unbounded();
		let last_finalized_number = last_finalized.1;

		// re-start the last round and queue all messages to be processed on first poll.
		// keep it in the background so we can push the estimate backwards until finalized
		// by actually waiting for more messages.
		let mut past_rounds = PastRounds::new();
		let mut last_round_state =
			crate::bridge_state::bridge_state(RoundState::genesis(last_round_base.clone())).1;

		if last_round_number > 0 {
			let maybe_completed_la


t.fromLTRB(0, 0, 400, 400),
        SurfacePaint()
          ..style = PaintingStyle.fill
          ..color = const Color.fromARGB(255, 255, 255, 255));
    rc.drawCircle(
        const Offset(100, 100),
        80.0,
        SurfacePaint()
          ..style = PaintingStyle.fill
          ..color = const Color.fromARGB(128, 255, 0, 0)
          ..blendMode = BlendMode.difference);

    rc.drawCircle(
        const Offset(170, 100),
        80.0,
        SurfacePaint()
          ..style = PaintingStyle.fill
          ..blendMode = BlendMode.color
          ..color = const Color.fromARGB(128, 0, 255, 0));

    rc.drawCircle(
        const Offset(135, 170),
        80.0,
        SurfacePaint()
          ..style = PaintingStyle.fill
          ..color = const Color.fromARGB(128, 255, 0, 0));
    rc.restore();

    await canvasScreenshot(rc, 'canvas_blend_circle_diff_color');
  });

  test('Blend circle and text with multiply', () async {
    final RecordingCanvas rc =
        RecordingCanvas(const Rect.fromLTRB(0, 0, 400, 300));
    rc.save();
    rc.drawRect(
        const Rect.fromLTRB(0, 0, 400, 400),
        SurfacePaint()
          ..style = PaintingStyle.fill
          ..color = const Color.fromARGB(255, 255, 255, 255));
    rc.drawCircle(
        const Offset(100, 100),
        80.0,
        SurfacePaint()
          ..style = PaintingStyle.fill
          ..color = const Color.fromARGB(128, 255, 0, 0)
          ..blendMode = BlendMode.difference);
    rc.drawCircle(
        const Offset(170, 100),
        80.0,
        SurfacePaint()
          ..style = PaintingStyle.fill
          ..blendMode = BlendMode.color
          ..color = const Color.fromARGB(128, 0, 255, 0));

    rc.drawCircle(
        const Offset(135, 170),
        80.0,
        SurfacePaint()
          ..style = PaintingStyle.fill
          ..color = const Color.fromARGB(128, 255, 0, 0));
    rc.drawImage(createTestImage(), const Offset(135.0, 130.0),
        SurfacePaint()..blendMode = BlendMode.multiply);
    rc.restore();
    await canvasScreenshot(rc, 'canvas_blend_image_multiply');
  });
}

HtmlImage createTestImage() {
  const int width = 100;
  const int height = 50;
  final DomCanvasElement canvas =
      createDomCanvasElement(width: width, height: height);
  final DomCanvasRenderingContext2D ctx = canvas.context2D;
  ctx.fillStyle = '#E04040';
  ctx.fillRect(0, 0, 33, 50);
  ctx.fill();
  ctx.fillStyle = '#40E080';
  ctx.fillRect(33, 0, 33, 50);
  ctx.fill();
  ctx.fillStyle = '#2040E0';
  ctx.fillRect(66, 0, 33, 50);
  ctx.fill();
  final DomHTMLImageElement imageElement = createDomHTMLImageElement();
  imageElement.src = js_util.callMethod<String>(canvas, 'toDataURL', <dynamic>[]);
  return HtmlImage(imageElement, width, height);
}
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:math' as math;
import 'dart:typed_data';

import 'package:test/bootstrap/browser.dart';
import 'package:test/test.dart';
import 'package:ui/src/engine.dart';
import 'package:ui/ui.dart' as ui;

import '../../common/test_initialization.dart


}

impl BallState {
    pub fn new() -> BallState {
        BallState {
            sprite:      load_sprite("./sphere.png"),
            diameter:    0.0,
            pos:         (0.0, 0.0),
            spd:         (0.0, 0.0),
            stopped:     true,
            basespd:     0.0,
            afterimages: Vec::with_capacity(7),
        }
    }
}

pub struct PaddleState {
    pub sprite:   Value,
    pub xpos:     f32,
    pub ypos:     f32,
    pub spd:      f32,
    pub sz:       (f32, f32),
    pub basespd:  f32,
}

impl PaddleState {
    pub fn new() -> PaddleState {
        PaddleState {
            sprite:   load_sprite("./paddle.png"),
            xpos:     0.0,
            ypos:     0.0,
            spd:      0.0,
            basespd:  0.0,
            sz:       (0.0, 0.0),
        }
    }
}

pub struct Block {
    pub pos:    (f32, f32),
    pub color:  String,
    pub active: bool,
}

fn load_sprite(path: &'static str) -> Value {
    let sprite = js! {
        var img = new Image();
        img.src = @{path};
        return img;
    };
    sprite
}
<filename>tests/tests.rs
#![allow(clippy::too_many_arguments)]

mod accepted;
mod compiletest;
mod consts;
mod methods;

use vecn::vector;

#[macro_export]
macro_rules! new {
    ($ident:ident, $($num:literal),*) => {
        $ident::new($($num),*)
    };
    ($ident:ident @ $num:literal) => {
        $ident::splat($num)
    };
}

macro_rules! tuple_struct {
    ($($ident:ident<$generic:tt>, $($fields:tt),+)*) => {
        $(
            #[vector]
            #[derive(Debug, Default)]
            pub struct $ident<$generic>($(pub $fields),+);
        )*
    };
    ($($ident:ident, $($fields:tt),+)*) => {
        $(
            #[vector]
            #[derive(Debug, Default)]
            pub struct $ident($(pub $fields),+);
        )*
    }
}

macro_rules! named_struct {
    ($($ident:ident<$generic:tt>, $($field:tt: $type:tt),+)*) => {
        $(
            #[vector]
            #[derive(Debug, Default)]
            pub struct $ident<$generic>{$(pub $field: $type),+}
        )*
    };
    ($($ident:ident, $($field:ident: $type:tt),+)*) => {
        $(
            #[vector]
            #[derive(Debug, Default)]
            pub struct $ident{$(pub $field: $type),+}
        )*
    }
}

tuple_struct! {
    T2<T>, T, T
    T3<T>, T, T, T
    T4<T>, T, T, T, T
    T8<T>, T, T, T, T, T, T, T, T
}

tuple_struct! {
    T2xf32, f32, f32
    T3xf32, f32, f32, f32
    T4xf32, f32, f32, f32, f32
    T8xf32, f32, f32, f32, f32, f32, f32, f32, f32
}

tuple_struct! {
    T2xi32, i32, i32
    T3xi32, i32, i32, i32
    T4xi32, i32, i32, i32, i32
    T8xi32, i32, i32, i32, i32, i32, i32, i32, i32
}

tuple_struct! {
    T2xu32, u32, u32
    T3xu32, u32, u32, u32
    T4xu32, u32, u32, u32, u32


(' 0x0e026d45820d91356fc73d7ff2bdef353ebfe7e9'), false);
  assertEquals(isHexString('fdsjfsd'), false);
  assertEquals(isHexString(' 0xfdsjfsd'), false);
  assertEquals(isHexString('0xfds*jfsd'), false);
  assertEquals(isHexString('0xfds$jfsd'), false);
  assertEquals(isHexString('0xf@dsjfsd'), false);
  assertEquals(isHexString('0xfdsjf!sd'), false);
  assertEquals(isHexString('fds@@jfsd'), false);
  assertEquals(isHexString('0x0', 2), false);
});

Deno.test('stripHexPrefix strip prefix of valid strings', () => {
  assertEquals(stripHexPrefix('0xkdsfksfdkj'), 'kdsfksfdkj');
  assertEquals(stripHexPrefix('0xksfdkj'), 'ksfdkj');
  assertEquals(stripHexPrefix('0xkdsfdkj'), 'kdsfdkj');
  assertEquals(stripHexPrefix('0x23442sfdkj'), '23442sfdkj');
  assertEquals(stripHexPrefix('0xkdssdfssfdkj'), 'kdssdfssfdkj');
  assertEquals(stripHexPrefix('0xaaaasfdkj'), 'aaaasfdkj');
  assertEquals(stripHexPrefix('0xkdsdfsfsdfsdfsdfdkj'), 'kdsdfsfsdfsdfsdfdkj');
  assertEquals(stripHexPrefix('0x111dssdddj'), '111dssdddj');
  assertEquals(stripHexPrefix('0xkdsfksfdkj'), 'kdsfksfdkj');
  assertEquals(stripHexPrefix('ksfdkj'), 'ksfdkj');
  assertEquals(stripHexPrefix('kdsfdkj'), 'kdsfdkj');
  assertEquals(stripHexPrefix('23442sfdkj'), '23442sfdkj');
  assertEquals(stripHexPrefix('0xkdssdfssfdkj'), 'kdssdfssfdkj');
  assertEquals(stripHexPrefix('aaaasfdkj'), 'aaaasfdkj');
  assertEquals(stripHexPrefix('kdsdfsfsdfsdfsdfdkj'), 'kdsdfsfsdfsdfsdfdkj');
  assertEquals(stripHexPrefix('111dssdddj'), '111dssdddj');
  assertEquals(stripHexPrefix(null as unknown as string), null);
  assertEquals(stripHexPrefix(undefined as unknown as string), undefined);
  assertEquals(stripHexPrefix(242423 as unknown as string), 242423);
  assertEquals(stripHexPrefix({} as unknown as string), {});
  assertEquals(stripHexPrefix([] as unknown as string), []);
  assertEquals(stripHexPrefix(true as unknown as string), true);
});

Deno.test('padToEven should pad to even', () => {
  assertEquals(padToEven('0').length % 2, 0);
  assertEquals(padToEven('111').length % 2, 0);
  assertEquals(padToEven('22222').length % 2, 0);
  assertEquals(padToEven('ddd').length % 2, 0);
  assertEquals(padToEven('aa').length % 2, 0);
  assertEquals(padToEven('aaaaaa').length % 2, 0);
  assertEquals(padToEven('sdssd').length % 2, 0);
  assertEquals(padToEven('eee').length % 2, 0);
  assertEquals(padToEven('w').length % 2, 0);
});

Deno.test('padToEven should add leading 0 to non-even strings', () => {
  assertEquals(padToEven('0'), '00');
  assertEquals(padToEven('111'), '0111');
  assertEquals(padToEven('22222'), '022222');
  assertEquals(padToEven('ddd'), '0ddd


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

//  Abstract:
//      Represents a PageStackEntryTrackerCollection.
//      Wraps TrackerCollection<PageStackEntry> and provides VectorChanging
//      and VectorChanged events.

#pragma once

namespace DirectUI
{

    class NavigationHistory;

    class PageStackEntryTrackerCollection:
        public TrackerCollection<xaml::Navigation::PageStackEntry*>
    {

    private:
        // Flag indicating whether this collection corresponds to the BackStack or the ForwardStack.
        BOOLEAN m_isBackStack{};

        // Weak reference to the NavigationHistory that owns this PageStack collection.
        ctl::WeakRefPtr m_wrNavigationHistory;

    public:

        IFACEMETHOD (SetAt)(_In_ UINT index, _In_opt_ T_abi item) override;
        IFACEMETHOD (InsertAt)(_In_ UINT index, _In_ T_abi item) override;
        IFACEMETHOD (RemoveAt)(_In_ UINT index) override;
        IFACEMETHOD (Append)(_In_opt_ T_abi item) override;
        IFACEMETHOD (RemoveAtEnd)() override;
        IFACEMETHOD (Clear)() override;

    private:
        _Check_return_ HRESULT
        OnVectorChanging(
            _In_ wfc::CollectionChange action,
            _In_ UINT index,
            _In_opt_ T_abi item);

        _Check_return_ HRESULT
        OnVectorChanged(
            _In_ wfc::CollectionChange action,
            _In_ UINT index);

        _Check_return_ HRESULT
        GetNavigationHistory(
            _Outptr_ NavigationHistory** ppNavigationHistory);

        _Check_return_ HRESULT
        SetNavigationHistory(
            _In_ NavigationHistory* pNavigationHistory);

    public:
        _Check_return_ HRESULT
        Init(
            _In_ NavigationHistory* pNavigationHistory,
            _In_ BOOLEAN isBackStack);

        _Check_return_ HRESULT
        AppendInternal(
            _In_opt_ T_abi item);

        _Check_return_ HRESULT
        RemoveAtEndInternal();

        _Check_return_ HRESULT
        ClearInternal();

        _Check_return_ HRESULT
        GetAtEnd(_Outptr_ T_abi *item);
    };
}


"This location cannot be upgraded");
    }
  }
  if (squadSize > 1 && !sieged) addOptionText(8, 31, "o", "O - Reorder");
  if (squadSize > 0 && !sieged) {
    // don't cover up info about siege with irrelevant squad name of a squad
    // that will be disbanded during the siege anyway
    mvaddstrc(8, 1, lightGray, activeSquad?.name ?? "");
  }
  addOptionText(8, 45, "n", "N - Next Squad",
      enabledWhen:
          squads.length > 1 || (activeSquad == null && squads.isNotEmpty));
  addOptionText(8, 62, "z", "Z - Next Location",
      enabledWhen: safehouseCount > 0);
  addOptionText(21, 40, "l", "L - The Status of the Liberal Agenda");
  addOptionText(21, 1, "a", "A - Assign Tasks",
      enabledWhen: pool.any((p) =>
          p.isActiveLiberal &&
          (p.squad == null || p.squad?.activity.type == ActivityType.none)));
  addOptionText(21, 20, "b", "B - Sleeper Agents",
      enabledWhen: pool.any((p) => p.sleeperAgent));
  addOptionText(20, 1, "c", "C - Cancel Departure",
      enabledWhen:
          squadSize > 0 && activeSquad?.activity.type != ActivityType.none);

  if (sieged) {
    addOptionText(19, 1, "f", "F - Fight/Escape",
        enabledWhen: squadSize > 0 ||
            pool.any((p) => p.site?.siege.underAttack ?? false));
    addOptionText(19, 23, "g", "G - Give Up");
  } else {
    addOptionText(19, 1, "f", "F - Go Forth to Stop Evil",
        enabledWhen: squadSize > 0);
  }

  if (cannotWait) {
    if (sieged) {
      mvaddstrc(23, 1, red, "Cannot Wait until Siege Resolved");
    } else {
      addOptionText(23, 1, "w", "W - Select Siege Location",
          baseColorKey: ColorKey.red);
    }
  } else {
    if (sieged) {
      addOptionText(23, 1, "w", "W - Wait out the siege");
    } else if (squads.any((s) => s.activity.type == ActivityType.visit)) {
      addOptionText(23, 1, "w", "W - Carry out your plans", baseColorKey: "G");
    } else {
      addOptionText(23, 1, "w", "W - Wait a day");
    }
    if (date.add(const Duration(days: 1)).month != month) {
      addstrc(lightGray, " (next month)");
    }
  }
  int unreadNewsCount = gameState.newsArchive.where((ns) => ns.unread).length;
  if (unreadNewsCount > 0) {
    addOptionText(
        22, 40, "m", "M - Media Overview & Impact &C($unreadNewsCount)");
  } else {
    addOptionText(22, 40, "m", "M - Media Overview & Impact");
  }
  addOptionText(23, 40, "x", "X - Exit to the Title Screen");

  if (loc?.hasFlag ?? false) {
    addOptionText(22, 1, "p", "P - Protest: Burn the flag",
        baseColorKey: sieged ? "G" : "w");
  } else {
    addOptionText(22, 1, "p", "P - Pride: Fly a flag here (\$20)",
        enabledWhen: (activeSafehouse != null || activeSquad != null) &&
            ledger.funds >= 20 &&
            !sieged);
  }

  setColor


 30)
	private String cidade;

	@Column(name = "CEP_PESSOA", length = 8)
	private String cep;

	@Column(name = "TELEFONE_PESSOA", length = 30)
	private String telefone;

	@Column(name = "RG_PESSOA", length = 20)
	private String identidade;

	@Column(name = "RG_ORGAO_PESSOA", length = 50)
	private String orgaoIdentidade;

	@Temporal(TemporalType.DATE)
	@Column(name = "RG_DATA_EXPEDICAO_PESSOA")
	private Date dataExpedicaoIdentidade;

	@Column(name = "RG_UF_PESSOA", length = 2)
	private String ufIdentidade;

	@Column(name = "ID_ESTADO_CIVIL")
	private Integer idEstadoCivil;

	@Column(name = "NOME_EXIBICAO")
	private String nomeExibicao;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_PESSOA_INICIAL", insertable = false, updatable = false)
	@Desconsiderar
	private DpPessoa pessoaInicial;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_LOTACAO")
	private DpLotacao lotacao;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_CARGO")
	private DpCargo cargo;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_FUNCAO_CONFIANCA")
	private DpFuncaoConfianca funcaoConfianca;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_ORGAO_USU")
	@Desconsiderar
	private CpOrgaoUsuario orgaoUsuario;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_TP_PESSOA")
	private CpTipoPessoa cpTipoPessoa;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "pessoaInicial")
	@OrderBy("idPessoa DESC")
	@Desconsiderar
	// private Set<DpPessoa> pessoasPosteriores = new HashSet<DpPessoa>(0);
	private Set<DpPessoa> pessoasPosteriores;

	@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="HIS_IDC_INI")
    @Desconsiderar
	private CpIdentidade hisIdcIni;

	@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="HIS_IDC_FIM")
    @Desconsiderar
	private CpIdentidade hisIdcFim;

	public CpIdentidade getHisIdcIni() {
		return hisIdcIni;
	}

	public void setHisIdcIni(CpIdentidade hisIdcIni) {
		this.hisIdcIni = hisIdcIni;
	}

	public CpIdentidade getHisIdcFim() {
		return hisIdcFim;
	}

	public void setHisIdcFim(CpIdentidade hisIdcFim) {
		this.hisIdcFim = hisIdcFim;
	}

	/**
	 * @return the cpTipoPessoa
	 */
	public CpTipoPessoa getCpTipoPessoa() {
		return cpTipoPessoa;
	}

	/**
	 * @param cpTipoPessoa
	 *            the cpTipoPessoa to set
	 */
	public void setCpTipoPessoa(CpTipoPessoa cpTipoPessoa) {
		this.cpTipoPessoa = cpTipoPessoa;
	}

	public String getNacionalidade() {
		return nacionalidade;
	}


month, day)), expected);
    }

    // Data provider for localized dates
    @DataProvider(name="chronoDateTimes")
   Object[][] data_chronodatetimes() {
        return new Object[][] {
            {1432, 12, 29, "Safar 1, 1434 AH"},
            {1433, 1, 30, "Safar 30, 1434 AH"},
            {1434, 6, 30, "Rajab 30, 1435 AH"},
        };
    }

    // Test to verify the localized dates using ofLocalizedDate() method
    @Test(dataProvider="chronoDateTimes")
    public void test_formatterOfLocalizedDate(int year, int month, int day, String expected) {
        HijrahDate hd = HijrahChronology.INSTANCE.date(year, month, day);
        ChronoLocalDateTime<HijrahDate> hdt = hd.atTime(LocalTime.NOON);
        hdt = hdt.plus(1, ChronoUnit.YEARS);
        hdt = hdt.plus(1, ChronoUnit.MONTHS);
        hdt = hdt.plus(1, ChronoUnit.DAYS);
        hdt = hdt.plus(1, ChronoUnit.HOURS);
        hdt = hdt.plus(1, ChronoUnit.MINUTES);
        hdt = hdt.plus(1, ChronoUnit.SECONDS);
        DateTimeFormatter df = DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG).withChronology(Chronology.of("Hijrah-umalqura")).withLocale(Locale.US);
        assertEquals(df.format(hdt), expected);
    }

    // Data provider to get the day of the week in a given date
    // The day of the week varies if the week starts with a saturday or sunday
    @DataProvider(name="dayOfWeek")
    Object[][] data_dayOfweek() {
        return new Object[][] {
            {HijrahDate.of(1434, 6, 24), 1, 7},
            {HijrahDate.of(1432, 9, 3), 5, 4},
            {HijrahDate.of(1334, 12, 29), 7, 6},
            {HijrahDate.of(1354, 5, 24), 1, 7},
            {HijrahDate.of(1465, 10, 2), 2, 1},
        };
    }

    // Test to get the day of the week based on a Saturday/Sunday as the first day of the week
    @Test(dataProvider="dayOfWeek")
    public void test_dayOfWeek(HijrahDate date, int satStart, int sunStart) {
        assertEquals(date.get(WeekFields.of(DayOfWeek.SATURDAY, 7).dayOfWeek()), satStart);
        assertEquals(date.get(WeekFields.of(DayOfWeek.SUNDAY, 7).dayOfWeek()), sunStart);
    }

    // Data sample to get the epoch days of a date instance
    @DataProvider(name="epochDays")
    Object[][] data_epochdays() {
        return new Object[][] {
            {1332, -20486},
            {1334, -19777},
            {1336, -19068},
            {1432, 14950},
            {1434, 15659},
            {1534, 51096},
            {1535, 51450},
        };
    }

    // Test to verify the number of epoch days of a date instance
    @Test(dataProvider="epochDays")
    public void test_epochDays(int y, long epoch) {
        HijrahDate date = HijrahDate.of(y, 1, 1);
        assertEquals(date.toEpochDay(), epoch);
    }

    // Data provider to verify whether a given hijrah year is a leap year or not
    @DataProvider(name="leapYears")
    Object[][] data_leapyears() {
        return new Object[][] {
            {1302, true},
            {1305, false},
            {1315, false},
            {1534, false},
            {1411, true},
            {1429, false},
            {1433, true},
            {14


ts' failed."), // array is missing
            new InvalidMessageData("StreamInvocationArgumentArrayNotAnArray", new byte[] { 0x95, 4, 0x80, 0xa3, (byte)'a', (byte)'b', (byte)'c', 0xa3, (byte)'x', (byte)'y', (byte)'z', 42 }, "Reading array length for 'arguments' failed."), // arguments isn't an array
            new InvalidMessageData("StreamInvocationArgumentArraySizeMismatchEmpty", new byte[] { 0x95, 4, 0x80, 0xa3, (byte)'a', (byte)'b', (byte)'c', 0xa3, (byte)'x', (byte)'y', (byte)'z', 0x90 }, "Invocation provides 0 argument(s) but target expects 1."), // array is missing elements
            new InvalidMessageData("StreamInvocationArgumentArraySizeMismatchTooLarge", new byte[] { 0x95, 4, 0x80, 0xa3, (byte)'a', (byte)'b', (byte)'c', 0xa3, (byte)'x', (byte)'y', (byte)'z', 0x92, 0xa1, (byte)'a', 0xa1, (byte)'b' }, "Invocation provides 2 argument(s) but target expects 1."), // argument count does not match binder argument count
            new InvalidMessageData("StreamInvocationArgumentTypeMismatch", new byte[] { 0x95, 4, 0x80, 0xa3, (byte)'a', (byte)'b', (byte)'c', 0xa3, (byte)'x', (byte)'y', (byte)'z', 0x91, 42 }, "Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked."), // argument type mismatch
        }.ToDictionary(t => t.Name);

    public static IEnumerable<object[]> ArgumentBindingErrorNames => ArgumentBindingErrors.Keys.Select(name => new object[] { name });

    [Theory]
    [MemberData(nameof(ArgumentBindingErrorNames))]
    public void GettingArgumentsThrowsIfBindingFailed(string argumentBindingErrorName)
    {
        var testData = ArgumentBindingErrors[argumentBindingErrorName];

        var buffer = Frame(testData.Encoded);
        var binder = new TestBinder(new[] { typeof(string) }, typeof(string));
        var data = new ReadOnlySequence<byte>(buffer);
        HubProtocol.TryParseMessage(ref data, binder, out var message);
        var bindingFailure = Assert.IsType<InvocationBindingFailureMessage>(message);
        Assert.Equal(testData.ErrorMessage, bindingFailure.BindingFailure.SourceException.Message);
    }

    [Theory]
    [InlineData(new byte[] { 0x05, 0x01 })]
    public void ParserDoesNotConsumePartialData(byte[] payload)
    {
        var binder = new TestBinder(new[] { typeof(string) }, typeof(string));
        var data = new ReadOnlySequence<byte>(payload);
        var result = HubProtocol.TryParseMessage(ref data, binder, out var message);
        Assert.Null(message);
    }

    public static IDictionary<string, MessageSizeTestData> MessageSizeData => new[]
    {
            new MessageSizeTestData("InvocationMessage_WithoutInvocationId", new InvocationMessage("Target", new object[] { 1 }), 15),
            new MessageSizeTestData("InvocationMessage_WithInvocationId", new InvocationMessage("1", "Target", new object[] { 1 }), 16),
            new MessageSizeTestData("InvocationMessage_WithInvocationIdAndStreamId", new InvocationMessage("1", "Target", new object[] { 1 }, new string[] { "2" }), 18),

            new MessageSizeTestData("CloseMessage_Empty", CloseMessage.Empty, 5),
            new MessageSizeTestData("CloseMessage_WithError", new CloseMessage("error"), 10),

            new MessageSizeTestData("StreamItemMessage_WithNullItem", new StreamItemMessage("1", null), 7),
            new MessageSizeTestData("StreamItemMessage_WithItem", new StreamItemMessage("1", 1), 7),


t = totalNeighbors;
  });

  return copyBoard
}

// Retorna os vizinhos de um elemento
export function getNeighbors(configurations: IGameConfigurations, cellIndex: number) {
  const isCellLeft = (cellIndex % configurations.width) === 0;
  const isCellRight = (cellIndex % configurations.width) === (configurations.width - 1);

  let neighbors: number[] = [];
  // Por ter usado uma array de uma dimensão, tenho que fazer
  // essa lista para ser mais fácil pegar os elementos vizinhos
  const neighborsPositions = [
    -configurations.width - 1, // 0 - Top Left
    -configurations.width,     // 1 - Top
    -configurations.width + 1, // 2 - Top Right
    -1,                                  // 3 - Left
    1,                                   // 4 - Right
    configurations.width - 1,  // 5 - Bottom Left
    configurations.width,      // 6 - Bottom
    configurations.width + 1,  // 7 - Bottom Right
  ]

  neighborsPositions.forEach((position, i) => {
    if(
      isCellLeft && (i === 0 || i === 3 || i === 5) ||
      isCellRight && (i === 2 || i === 4 || i === 7)
    ) return

    const targetIndex = cellIndex + position;
    if(!isIndexValid(configurations, targetIndex)) return

    neighbors.push(targetIndex);
  });

  return neighbors
}

// Checa se o Index no quadro é válido
export function isIndexValid(configurations: IGameConfigurations, index: number) {
  return (index >= 0 && index < configurations.width * configurations.height)
}

// Faz uma cópia do quadro
export function deepCopyBoard(board: IBoardCell[]): IBoardCell[] {
  return JSON.parse(JSON.stringify(board))
}

// Checar se ganhou o jogo
export function isClear({ board, configurations }: IGameState) {
  // Ganhar o jogo seria revelar todos os elementos exeto os que contém bomba,
  // ou seja, para checar se já ganhou ou não, é ver se a quantidade de
  // elementos revelados é igual a quantidade de bombas, pois assim, apenas
  // as bombas que terão sobrado
  let totalClear = board.reduce((total, curr) => curr.isRevealed ? total + 1 : total, 1);

  console.log(totalClear);

  return totalClear === ( configurations.width * configurations.height - configurations.totalBombs )
}interface Feature {
  id: number
  name: string
}

interface IResult<T> {
  OK: 0 | 1
  data: T[]
}

let datas: any[]
datas = [
  { id: 7, name: '改造1' },
  { id: 8, name: '改造2' },
]

let getData = <T>(): IResult<T> => {
  return { OK: 1, data: datas }
}
// 定义和使用没什么问题,但是不能在函数定义的时候就对它进行操作
let getData2: <T>(name: T, age: T) => IResult<T> = () => {
  return { OK: 1, data: datas }
}

console.log('getData<Feature>()', getData<Feature>())
let add = (a: number, b: number): number => a + b

console.log('add(3,4)', add(3, 4))

interface Num {
  a?: number
  b?: number
}

const sub = <T>(p1: T | number, p2: T | number) => {
  // 不能对p1和p2进行操作+ - * /
  // p1+p2
}

sub<number>(1, 3)
// console.log('sub<Num>({ a: 1 })', sub<Num>({ a: 1 }, { b: 2 }))

// ============================================================类型断言
function getLength(input: string | number): number {


r10,%rdx
	mulxq	%r15,%rdx,%rax
	adcxq	%rcx,%r13
	adoxq	%rbp,%r8

	adcxq	%r9,%r8
	adoxq	%r9,%r9
	adcq	$0,%r9

	mulxq	0+128(%r14),%rcx,%rbp
	adcxq	%rcx,%r10
	adoxq	%rbp,%r11

	mulxq	8+128(%r14),%rcx,%rbp
	adcxq	%rcx,%r11
	adoxq	%rbp,%r12

	mulxq	16+128(%r14),%rcx,%rbp
	adcxq	%rcx,%r12
	adoxq	%rbp,%r13

	mulxq	24+128(%r14),%rcx,%rbp
	movq	24(%rbx),%rdx
	adcxq	%rcx,%r13
	adoxq	%rbp,%r8
	adcxq	%r10,%r8
	adoxq	%r10,%r9
	adcq	$0,%r9

	mulxq	0+128(%rsi),%rcx,%rbp
	adcxq	%rcx,%r11
	adoxq	%rbp,%r12

	mulxq	8+128(%rsi),%rcx,%rbp
	adcxq	%rcx,%r12
	adoxq	%rbp,%r13

	mulxq	16+128(%rsi),%rcx,%rbp
	adcxq	%rcx,%r13
	adoxq	%rbp,%r8

	mulxq	24+128(%rsi),%rcx,%rbp
	movq	%r11,%rdx
	mulxq	%r15,%rdx,%rax
	adcxq	%rcx,%r8
	adoxq	%rbp,%r9

	adcxq	%r10,%r9
	adoxq	%r10,%r10
	adcq	$0,%r10

	mulxq	0+128(%r14),%rcx,%rbp
	adcxq	%rcx,%r11
	adoxq	%rbp,%r12

	mulxq	8+128(%r14),%rcx,%rbp
	adcxq	%rcx,%r12
	adoxq	%rbp,%r13

	mulxq	16+128(%r14),%rcx,%rbp
	adcxq	%rcx,%r13
	adoxq	%rbp,%r8

	mulxq	24+128(%r14),%rcx,%rbp
	leaq	128(%r14),%r14
	movq	%r12,%rbx
	adcxq	%rcx,%r8
	adoxq	%rbp,%r9
	movq	%r13,%rdx
	adcxq	%r11,%r9
	adoxq	%r11,%r10
	adcq	$0,%r10

	movq	%r8,%rcx
	subq	0(%r14),%r12
	sbbq	8(%r14),%r13
	sbbq	16(%r14),%r8
	movq	%r9,%rbp
	sbbq	24(%r14),%r9
	sbbq	$0,%r10

	cmovcq	%rbx,%r12
	cmovcq	%rdx,%r13
	cmovcq	%rcx,%r8
	cmovcq	%rbp,%r9

	movq	%r12,0(%rdi)
	movq	%r13,8(%rdi)
	movq	%r8,16(%rdi)
	movq	%r9,24(%rdi)

	movq	0(%rsp),%r15

	movq	8(%rsp),%r14

	movq	16(%rsp),%r13


0                      ; Reserved Address
IRQ_Addr        DCD     IRQ_Handler
FIQ_Addr        DCD     FIQ_Handler

Undef_Handler   B       Undef_Handler
SWI_Handler     B       SWI_Handler
PAbt_Handler    B       PAbt_Handler
DAbt_Handler    B       DAbt_Handler
FIQ_Handler     B       FIQ_Handler

; CPU Wrapper and Bus Priorities Configuration
                IF      SYS_SETUP <> 0
SYS_CFG
                DCD     CPUW_BASE
                DCD     BUSP_BASE
                DCD     SYSCFG_Val
                DCD     NCACHBE0_Val
                DCD     NCACHBE1_Val
                DCD     SBUSCON_Val
                ENDIF

; Memory Controller Configuration
                IF      MC_SETUP <> 0
MC_CFG
                DCD     BWSCON_Val
                DCD     BANKCON0_Val
                DCD     BANKCON1_Val
                DCD     BANKCON2_Val
                DCD     BANKCON3_Val
                DCD     BANKCON4_Val
                DCD     BANKCON5_Val
                DCD     BANKCON6_Val
                DCD     BANKCON7_Val
                DCD     REFRESH_Val
                DCD     BANKSIZE_Val
                DCD     MRSRB6_Val
                DCD     MRSRB7_Val
                ENDIF

; Clock Management Configuration
                IF      CLK_SETUP <> 0
CLK_CFG
                DCD     CLK_BASE
                DCD     PLLCON_Val
                DCD     CLKCON_Val
                DCD     CLKSLOW_Val
                DCD     LOCKTIME_Val
                ENDIF

; I/O Configuration
                IF      PIO_SETUP <> 0
PIO_CFG
                DCD     PCONA_Val
                DCD     PCONB_Val
                DCD     PCONC_Val
                DCD     PCOND_Val
                DCD     PCONE_Val
                DCD     PCONF_Val
                DCD     PCONG_Val
                DCD     PUPC_Val
                DCD     PUPD_Val
                DCD     PUPE_Val
                DCD     PUPF_Val
                DCD     PUPG_Val
                DCD     SPUCR_Val
                ENDIF

; Reset Handler

                EXPORT  Reset_Handler
Reset_Handler

                IF      SYS_SETUP <> 0
                ADR     R8, SYS_CFG
                LDMIA   R8, {R0-R5}
                STMIA   R0, {R2-R4}
                STR     R5, [R1]
                ENDIF

                IF      MC_SETUP <> 0
                ADR     R14, MC_CFG
                LDMIA   R14, {R0-R12}
                LDR     R14, =MC_BASE
                STMIA   R14, {R0-R12}
                ENDIF

                IF      CLK_SETUP <> 0
                ADR     R8, CLK_CFG
                LDMIA   R8, {R0-R4}
                STR     R4, [R0, #LOCKTIME_OFS]
                STR     R1, [R0, #PLLCON_OFS]
                STR     R3, [R0, #CLKSLOW_OFS]
                STR     R2, [R0, #CLKCON_OFS]
                ENDIF

                IF      WT_SETUP <> 0
                LDR     R0, =WT_BASE
                LDR


(
    name = "lithoLinearGradientFingerprint",
    accessFlags = AccessFlags.STATIC.value,
    returnType = "Landroid/graphics/LinearGradient;",
    parameters = listOf("F", "F", "F", "F", "[I", "[F")
)

/**
 * YouTube 19.49+
 */
internal val playerLinearGradientFingerprint = legacyFingerprint(
    name = "playerLinearGradientFingerprint",
    accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
    parameters = listOf("I", "I", "I", "I", "Landroid/content/Context;", "I"),
    returnType = "Landroid/graphics/LinearGradient;",
    opcodes = listOf(
        Opcode.FILLED_NEW_ARRAY,
        Opcode.MOVE_RESULT_OBJECT
    ),
    literals = listOf(ytYoutubeMagenta),
)

/**
 * YouTube 19.25 - 19.47
 */
internal val playerLinearGradientLegacyFingerprint = legacyFingerprint(
    name = "playerLinearGradientLegacyFingerprint",
    returnType = "V",
    opcodes = listOf(
        Opcode.FILLED_NEW_ARRAY,
        Opcode.MOVE_RESULT_OBJECT
    ),
    literals = listOf(ytYoutubeMagenta),
)

internal const val launchScreenLayoutTypeLotteFeatureLegacyFlag = 268507948L
internal const val launchScreenLayoutTypeLotteFeatureFlag = 1073814316L

internal val setBoundsFingerprint = legacyFingerprint(
    name = "setBoundsFingerprint",
    accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
    returnType = "V",
    parameters = listOf("I", "I", "I", "I"),
    opcodes = listOf(
        Opcode.NEW_ARRAY,
        Opcode.FILL_ARRAY_DATA
    )
)

internal val seekbarThumbFingerprint = legacyFingerprint(
    name = "seekbarThumbFingerprint",
    accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
    returnType = "V",
    parameters = listOf("Landroid/content/Context;"),
    opcodes = listOf(
        Opcode.CONST,
        Opcode.INVOKE_STATIC,
        Opcode.MOVE_RESULT,
        Opcode.INVOKE_VIRTUAL
    )
)

internal val launchScreenLayoutTypeFingerprint = legacyFingerprint(
    name = "launchScreenLayoutTypeFingerprint",
    accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
    returnType = "V",
    customFingerprint = { method, _ ->
        val firstParameter = method.parameterTypes.firstOrNull()
        // 19.25 - 19.45
        (firstParameter == "Lcom/google/android/apps/youtube/app/watchwhile/MainActivity;"
                || firstParameter == "Landroid/app/Activity;") // 19.46+
                && (method.containsLiteralInstruction(launchScreenLayoutTypeLotteFeatureLegacyFlag)
                || method.containsLiteralInstruction(launchScreenLayoutTypeLotteFeatureFlag))
    }
)

internal val seekbarTappingFingerprint = legacyFingerprint(
    name = "seekbarTappingFingerprint",
    returnType = "Z",
    accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
    parameters = listOf("Landroid/view/MotionEvent;"),
    customFingerprint = { method, classDef ->
        classDef.interfaces.contains("Landroid/view/View${'$'}OnLayoutChangeListener;") &&
                classDef.fields.find { it.type == "[Lcom/google/android/libraries/youtube/player/features/overlay/timebar/TimelineMarker;" } != null &&
                method.name == "onTouchEvent" &&
                indexOfPointInstruction(method) >= 0
    }
)

internal fun indexOfPointInstruction(method: Method) =
    method.indexOfFirstInstructionReversed {
        opcode == Opcode.INVOKE_DIRECT &&


.router.get_sub_path()] = `${encodeURIComponent(
			frappe.router.slug(this.doctype)
		)}/${encodeURIComponent(name)}`;
		!frappe._from_link && frappe.set_route("Form", this.doctype, name);
	}

	// ACTIONS

	print_doc() {
		frappe.route_options = {
			frm: this,
		};
		frappe.set_route("print", this.doctype, this.doc.name);
	}

	navigate_records(prev) {
		let filters, sort_field, sort_order;
		let list_view = frappe.get_list_view(this.doctype);
		if (list_view) {
			filters = list_view.get_filters_for_args();
			sort_field = list_view.sort_by;
			sort_order = list_view.sort_order;
		} else {
			let list_settings = frappe.get_user_settings(this.doctype)["List"];
			if (list_settings) {
				filters = list_settings.filters;
				sort_field = list_settings.sort_by;
				sort_order = list_settings.sort_order;
			}
		}

		let args = {
			doctype: this.doctype,
			value: this.docname,
			filters,
			sort_order,
			sort_field,
			prev,
		};

		frappe.call("frappe.desk.form.utils.get_next", args).then((r) => {
			if (r.message) {
				frappe.set_route("Form", this.doctype, r.message);
				this.focus_on_first_input();
			}
		});
	}

	rename_doc() {
		frappe.model.rename_doc(this.doctype, this.docname, () => this.refresh_header());
	}

	share_doc() {
		this.shared.show();
	}

	email_doc(message) {
		new frappe.views.CommunicationComposer({
			doc: this.doc,
			frm: this,
			subject: __(this.meta.name) + ": " + this.docname,
			recipients: this.doc.email || this.doc.email_id || this.doc.contact_email,
			attach_document_print: true,
			message: message,
		});
	}

	copy_doc(onload, from_amend) {
		this.validate_form_action("Create");
		var newdoc = frappe.model.copy_doc(this.doc, from_amend);

		newdoc.idx = null;
		newdoc.__run_link_triggers = false;
		if (onload) {
			onload(newdoc);
		}
		frappe.set_route("Form", newdoc.doctype, newdoc.name);
	}

	reload_doc() {
		this.check_doctype_conflict(this.docname);

		if (!this.doc.__islocal) {
			frappe.model.remove_from_locals(this.doctype, this.docname);
			return frappe.model.with_doc(this.doctype, this.docname, () => {
				this.refresh();
			});
		}
	}

	refresh_field(fname) {
		if (this.fields_dict[fname] && this.fields_dict[fname].refresh) {
			this.fields_dict[fname].refresh();
			this.layout.refresh_dependency();
			this.layout.refresh_sections();
		}
	}

	// UTILITIES
	add_fetch(link_field, source_field, target_field, target_doctype) {
		/*
		Example fetch dict to get sender_email from email_id field in sender:
			{
				"Notification": {
					"sender": {
						"sender_email": "email_id"
					}
				}
			}
		*/

		if (!target_doctype) target_doctype = "*";

		// Target field kept as key b


knowledge250Sbringct250Sb0250Sbtext => '
Monero のプライバシーは、壊れた場合にトランザクション全体が明らかになる単一のメカニズムに依存するのではなく、他の部分の弱点を補いながら全体的なプライバシーを提供するために連携して機能する 3 つの異なるテクノロジーに依存しています。この 3 つのアプローチは、リング シグネチャ、RingCT、および ステルス アドレスで構成されます。これら 3 つのテクノロジーは、実際の出力 (送信側)、量、および受信側をそれぞれ隠します。今日はRingCTについてお話します。
\n\n
RingCT はおそらく 3 つの中で最も技術的であり、理解するのが難しい場合があるため、正確にどのように機能するかについては説明しませんが、量を知らなくてもそれについて確認できる方法を示します。 心配はいりません。いつものようにたくさんの例を使用します。
\n\n
まず、金額を確認することが重要な理由を探ってみましょう。それらを完全に秘密にしておくことができないのはなぜですか？答えは、機会があれば、どこからともなくお金を生み出す巧妙な方法があるということです。このようなものはどのように機能しますか？例を見てみましょう。
\n\n
あなたがあなたの友人からアイテムを購入したい場合、彼は10ドルを要求し、あなたは10ドルから始め、彼はゼロから始めます。あなたが彼に 10 ドルを渡すと、彼は 10 ドルになり、あなたはゼロになります。あなたは 10 人で始めましたが、今では彼は 10 人です。このトランザクションでは、お金は作成または破棄されませんでした。
\n\n
暗号通貨を使用すると、賢い個人はアイテムに 10 ドルを与えることができ、0 ドルの釣り銭を受け取る代わりに 2 ドルを受け取ることができます。 0 と 10 が 10 と 0 (または 10=10) につながるのではなく、0 と 10 が 10 と 2 (または 10=12) につながります。 Two Monero は、何もないところから作成されました。個人がこれを自分自身に数回行うとしたら、短期間で莫大な財産を築くことができると想像できます。
\n\n
Bitcoin などでは、これは簡単に確認できます。トランザクションに入る入力と出てくる出力を見て、送信されたものが受信されたものと等しいことを確認します。これらの金額が暗号化されて表示されてい


81 3.12a94.66 94.66 0 0 0-18.39 12.32c-1.88 1.61-3.69 3.28-5.43 5A93.86 93.86 0 0 0 12 85.17a99.45 99.45 0 0 0-9.22 28 196.31 196.31 0 0 0-2.54 29.4c-.13 4.51-.18 9-.21 13.52v199.83c0 4.51.08 9 .21 13.51a196.08 196.08 0 0 0 2.58 29.42 99.3 99.3 0 0 0 9.22 28A94.31 94.31 0 0 0 53.17 468a99.47 99.47 0 0 0 28 9.21 195 195 0 0 0 29.43 2.59c4.5.12 9 .17 13.52.2H323.91c4.51 0 9-.08 13.52-.2a196.59 196.59 0 0 0 29.44-2.59 99.57 99.57 0 0 0 28-9.21A94.22 94.22 0 0 0 436 426.84a99.3 99.3 0 0 0 9.22-28 194.79 194.79 0 0 0 2.59-29.42c.12-4.5.17-9 .2-13.51V172.14c-.01-5.35-.01-10.7-.01-16.05zm-69.88 241c-20-38.93-57.23-29.27-76.31-19.47-1.72 1-3.48 2-5.25 3l-.42.25c-39.5 21-92.53 22.54-145.85-.38A234.64 234.64 0 0 1 45 290.12a230.63 230.63 0 0 0 39.17 23.37c56.36 26.4 113 24.49 153 0-57-43.85-104.6-101-141.09-147.22a197.09 197.09 0 0 1-18.78-25.9c43.7 40 112.7 90.22 137.48 104.12-52.57-55.49-98.89-123.94-96.72-121.74 82.79 83.42 159.18 130.59 159.18 130.59 2.88 1.58 5 2.85 6.73 4a127.44 127.44 0 0 0 4.16-12.47c13.22-48.33-1.66-103.58-35.31-149.2C329.61 141.75 375 229.34 356.4 303.42c-.44 1.73-.95 3.4-1.44 5.09 38.52 47.4 28.04 98.17 23.13 88.59z"],symfony:[512,512,[],"f83d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm133.74 143.54c-11.47.41-19.4-6.45-19.77-16.87-.27-9.18 6.68-13.44 6.53-18.85-.23-6.55-10.16-6.82-12.87-6.67-39.78 1.29-48.59 57-58.89 113.85 21.43 3.15 36.65-.72 45.14-6.22 12-7.75-3.34-15.72-1.42-24.56 4-18.16 32.55-19 32 5.3-.36 17.86-25.92 41.81-77.6 35.7-10.76 59.52-18.35 115-58.2 161.72-29 34.46-58.4 39.82-71.58 40.26-24.65.85-41-12.31-41.58-29.84


些数据都是非常有分析价值的。
而且你也知道，这些数据不过是数据库里的一行而已，也没有多少人会关心这些数据会带来多少开销。
而且也未必是要落盘到数据库，比如信用卡详情之类的东西，因为其敏感性，也许放在 session 里是更恰当的。这样当订单被取消的时候，这些 session 里的信息也自然就没有了。

在这个例子里，我们可以看到。模块与模块之间有两个集成方式

* 在同一个界面里，左边渲染 sales，右边渲染 billing。两个模块通过共享同一块屏幕的方式实现了基于 UI 的集成
* sales => finance => shipping 的事件里只包含了 id

在这个 UI 集成的例子里，我们可以再展开一下。如果，产品的需求是这样的：

![batch-ui](./batch-ui.drawio.svg)

这种情况下，配送方式和收费方式就不再是独立有两个保存按钮了。它们要在点确认按钮的时候统一保存，而且要在同一个弹框里反馈保存成功与否。在这种情况下配送方式和收费方式就不能仅仅提供

```
render()
```

这么一个集成接口。还需要提供

```
render()
save(): err
renderError(err)
```

注入这样的更多的接口出来，才能在 UI 上拼装出所需要的产品体验。但即便是这样，像支持比特币付款这样的需求改动，我们仍然是可以封闭在 finance 模块内部来完成。
# 问题

经常看见一个表里面有 extra_fields 之类的字段，里面放一个大 JSON。每个需求都要加新字段怎么弄?

# 分析

## 加字段就是加业务流程

加字段只是一个表象，任何字段都有一堆相关联的业务逻辑。
本质上数据要持久化是因为业务流程需要中断引入的。
比如顾客点菜让厨师去制作，如果厨师就站在旁边，直接告诉他去做就行了。
厨师不在旁边，就得先把菜写在单子上，传给后厨去制作。
因为多个角色的工作是先后进行的，中间需要一个载体来承载过去的“需求/承诺/契约/合同”，所以才需要持久化。
加字段，代表了新的业务流程。

## 通过加表来实现加字段

最常见的扩展需求是要订单加字段。订单上记录了顾客的需求，记录了处理过程，记录了客服的处置，每个需求都可以找到一个给订单加字段的理由。
我们除了订单，还需要报价单，还需要送货记录，还需要退款记录，还需要客服补偿申请。这些表的名字看起来都挺合理，为什么就一定要往订单上堆呢。
加字段都可以转化为加表来实现。


 |
| 数据分析 | 如何利用Python编程进行数据可视化和分析？ |
| 网络安全 | 如何保护自己的在线账户免受黑客攻击？ |
| 环保减排 | 如何在日常生活中减少碳足迹，保护环境？ |
| 智能家居 | 如何利用智能家居技术提高生活品质和安全性？ |
| 教育学习 | 如何提高自己的学习效率和记忆力？ |
| 计算机视觉               | 如何将一张图片转换为灰度图像？                               |
| 自然语言处理             | 如何使用Python NLTK库进行情感分析？                          |
| 人工智能伦理学           | 在AI应用中，如何平衡隐私保护和数据收集的利益？              |
| 数据科学                   | 如何对给定的数据集进行特征选择？                             |
| 机器学习                 | 如何训练一个支持向量机模型？                                 |
| 深度学习                 | 如何使用Tensorflow实现一个卷积神经网络？                     |
| 数据可视化               | 如何使用Python的Matplotlib库制作交互式散点图？                |
| 自动驾驶技术             | 在自动驾驶汽车中，如何检测并避免障碍物？                    |
| 增强学习                 | 如何构建一个基于Q-learning的简单强化学习模型？              |
| 人工智能与医学           | 如何使用深度学习技术进行肺部CT影像的结节检测？             |
| 分类 |在图像识别中，如何将狗和猫分开？


_end sub_0201333C

	thumb_func_start sub_02013364
sub_02013364: ; 0x02013364
	push {r4, r5}
	add r4, r2, #0
	add r2, r3, #0
	ldr r3, [sp, #8]
	cmp r3, #0
	bne _020133C2
	ldr r3, [sp, #0xc]
	cmp r3, #0
	bne _0201339C
	lsl r0, r0, #8
	mov r3, #0xff
	add r5, r0, #0
	lsl r3, r3, #8
	lsl r0, r4, #0x18
	and r5, r3
	lsl r1, r1, #8
	and r3, r1
	lsl r1, r2, #0x18
	lsr r1, r1, #0x18
	lsr r0, r0, #0x18
	add r4, r5, #0
	orr r4, r0
	ldr r0, _02013414 ; =0x04000040
	orr r1, r3
	strh r4, [r0]
	strh r1, [r0, #4]
	pop {r4, r5}
	bx lr
_0201339C:
	lsl r0, r0, #8
	mov r3, #0xff
	add r5, r0, #0
	lsl r3, r3, #8
	lsl r0, r4, #0x18
	and r5, r3
	lsl r1, r1, #8
	and r3, r1
	lsl r1, r2, #0x18
	lsr r1, r1, #0x18
	lsr r0, r0, #0x18
	add r4, r5, #0
	orr r4, r0
	ldr r0, _02013418 ; =0x04001040
	orr r1, r3
	strh r4, [r0]
	strh r1, [r0, #4]
	pop {r4, r5}
	bx lr
_020133C2:
	ldr r3, [sp, #0xc]
	cmp r3, #0
	bne _020133EE
	lsl r0, r0, #8
	mov r3, #0xff
	add r5, r0, #0
	lsl r3, r3, #8
	lsl r0, r4, #0x18
	and r5, r3
	lsl r1, r1, #8
	and r3, r1
	lsl r1, r2, #0x18
	lsr r1, r1, #0x18
	lsr r0, r0, #0x18
	add r4, r5, #0
	orr r4, r0
	ldr r0, _0201341C ; =0x04000042
	orr r1, r3
	strh r4, [r0]
	strh r1, [r0, #4]
	pop {r4, r5}
	bx lr
_020133EE:
	lsl r0, r0, #8
	mov r3, #0xff
	add r5, r0, #0
	lsl r3, r3, #8
	lsl r0, r4, #0x18
	and r5, r3
	lsl r1, r1, #8
	and r3, r1
	lsl r1, r2, #0x18
	lsr r1, r1, #0x18
	lsr r0, r0, #0x18
	add r4, r5, #0
	orr r4, r0
	ldr r0, _02013420 ; =0x04001042
	orr r1, r3
	strh r4, [r0]
	strh r1, [r0, #4]
	pop {r4, r5}
	bx lr
	.balign 4, 0
_02013414: