: "numeric" }, "year") : this.num(dt.year);
          case "yy":
            // like 14
            return useDateTimeFormatter
              ? string({ year: "2-digit" }, "year")
              : this.num(dt.year.toString().slice(-2), 2);
          case "yyyy":
            // like 0012
            return useDateTimeFormatter
              ? string({ year: "numeric" }, "year")
              : this.num(dt.year, 4);
          case "yyyyyy":
            // like 000012
            return useDateTimeFormatter
              ? string({ year: "numeric" }, "year")
              : this.num(dt.year, 6);
          // eras
          case "G":
            // like AD
            return era("short");
          case "GG":
            // like Anno Domini
            return era("long");
          case "GGGGG":
            return era("narrow");
          case "kk":
            return this.num(dt.weekYear.toString().slice(-2), 2);
          case "kkkk":
            return this.num(dt.weekYear, 4);
          case "W":
            return this.num(dt.weekNumber);
          case "WW":
            return this.num(dt.weekNumber, 2);
          case "o":
            return this.num(dt.ordinal);
          case "ooo":
            return this.num(dt.ordinal, 3);
          case "q":
            // like 1
            return this.num(dt.quarter);
          case "qq":
            // like 01
            return this.num(dt.quarter, 2);
          case "X":
            return this.num(Math.floor(dt.ts / 1000));
          case "x":
            return this.num(dt.ts);
          default:
            return maybeMacro(token);
        }
      };

    return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);
  }

  formatDurationFromString(dur, fmt) {
    const tokenToField = (token) => {
        switch (token[0]) {
          case "S":
            return "millisecond";
          case "s":
            return "second";
          case "m":
            return "minute";
          case "h":
            return "hour";
          case "d":
            return "day";
          case "w":
            return "week";
          case "M":
            return "month";
          case "y":
            return "year";
          default:
            return null;
        }
      },
      tokenToString = (lildur) => (token) => {
        const mapped = tokenToField(token);
        if (mapped) {
          return this.num(lildur.get(mapped), token.length);
        } else {
          return token;
        }
      },
      tokens = Formatter.parseFormat(fmt),
      realTokens = tokens.reduce(
        (found, { literal, val }) => (literal ? found : found.concat(val)),
        []
      ),
      collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));
    return stringifyTokens(tokens, tokenToString(collapsed));
  }
}

class Invalid {
  constructor(reason, explanation) {
    this.reason = reason;
    this.explanation = explanation;
  }

  toMessage() {
    if (this.explanation) {
      return `${this.reason}: ${this.explanation}`;
    } else {
      return this.reason;
    }
  }
}

/*
 * This file handles parsing for well-specified formats. Here's how it works:
 * Two things go into p


# 订阅

这个周刊每周五发布，同步更新在[阮一峰的网络日志](http://www.ruanyifeng.com/blog)和[微信公众号](http://weixin.sogou.com/weixin?query=%E9%98%AE%E4%B8%80%E5%B3%B0%E7%9A%84%E7%BD%91%E7%BB%9C%E6%97%A5%E5%BF%97)。

微信搜索“阮一峰的网络日志”或者扫描二维码，即可订阅。

![](https://cdn.beekka.com/blogimg/asset/202103/bg2021030402.jpg)

（完）
## 家庭保险规划

读者问到周刊的合作问题，我这里说一下。每周会有一个栏位，留给合作方推广产品，收取的费用用来资助周刊。如果你们公司有产品，希望在周刊上宣传一下，欢迎与我联系（Email：yifeng.ruan@gmail.com），但是合作方主要限于 IT 公司和计算机培训机构。

目前非 IT 类的合作机构只有一家，那就是今天要介绍的谱蓝公司。因为他们很早以前就支持我，每年搞活动时，就会找我发布消息，一直合作到现在。今年春季的免费活动 **家庭保险规划** 就要开始了，如果你有理财或保险方面的问题，可以考虑参加。

谱蓝是一家拥有合规牌照的保险咨询公司，是孙明展老师从世界500强保险公司离职创办的，专门为用户提供保险咨询和理财规划。他们开发了一个人工智能系统，通过算法与金融产品数据库相结合，自动给出最合适的财务建议。

![](https://cdn.beekka.com/blogimg/asset/202104/bg2021041612.jpg)

这个系统已经运作多年，受到用户的好评。大家可以搜索一下“谱蓝”，有很多关于他们的报道，孙老师的公号“孙明展”也值得看，都是理财科普文章。

![](https://cdn.beekka.com/blogimg/asset/202104/bg2021041613.jpg)

现在的经济形势很复杂，利率这么低，房市和股市居高不下，经济增长速度又在放慢，个人财务的压力可想而知。怎样才能保证财务安全，实现保值和增值，减轻意外事件的冲击，给自己和家庭多一点保障？

这次的“家庭保险规划”活动，就是由专业的理财师为大家一对一提供咨询，根据实际情况，分析家庭财务，给出保障建议和具体方案，打好家庭财务的安全垫。活动内容包括但不限于下面几项：

> - 家庭成员保障责任综合评估
> - 保险产品的性价比分析比较
> - 构建基于家庭状况和需求的综合


}

    /**
     * Returns the size of the list.
     *
     * @return the size of the list
     */
    fun size(): Int = idObjects.size

    /**
     * Returns an iterator over the list elements in proper sequence.
     *
     * @return iterator over the list elements
     */
    override fun iterator(): Iterator<T> = idObjects.iterator()

    /**
     * Returns the Stream of the internal IdObject list for functional processing.
     *
     * @return the Stream of the internal IdObject list
     */
    fun stream(): Stream<T> = idObjects.stream()

    /**
     * Returns a string representation of this object.
     *
     * @return string with object content
     */
    override fun toString(): String = "${this.javaClass.name}: size=${idObjects.size}"
}
package nz.scuttlebutt.tremolavossbol.audio

object Codec2 {
    // supported modes for Codec2 v1.0.4
    const val CODEC2_MODE_3200    = 0
    const val CODEC2_MODE_2400    = 1
    const val CODEC2_MODE_1600    = 2
    const val CODEC2_MODE_1400    = 3
    const val CODEC2_MODE_1300    = 4
    const val CODEC2_MODE_1200    = 5
    // const val CODEC2_MODE_700  = 6
    // const val CODEC2_MODE_700B = 7
    const val CODEC2_MODE_700C    = 8
    // const val CODEC2_MODE_WB   = 9
    const val CODEC2_MODE_450    = 10
    // const val CODEC2_MODE_450PWB = 11

    const val CODEC2_FILE_HEADER_SIZE = 7

    fun makeHeader(mode: Int): ByteArray {
        val a = ByteArray(CODEC2_FILE_HEADER_SIZE)
        a[0] = 0xc0 - 256
        a[1] = 0xde - 256
        a[2] = 0xc2 - 256
        a[3] = 1 // version_major
        a[4] = 0 // version_minor
        a[5] = mode.toByte()
        a[6] = 0 // flags
        return a
    }

    fun extractMode(a: ByteArray): Int { // return -1 if header is invalid, else compression mode
        if (a.size < 8 || a[0] != (0xc0-256).toByte() || a[1] != (0xde-256).toByte() ||
            a[2] != (0xc2-256).toByte() || a[3].toInt() != 1 || a[4].toInt() != 0)
                return -1
        return a[5].toInt()
    }

    external fun create(mode: Int): Long
    external fun getSamplesPerFrame(con: Long): Int
    external fun getBitsSize(con: Long): Int
    external fun destroy(con: Long): Int
    external fun encode(con: Long, buf: ShortArray?, bits: ByteArray?): Long
    /**
     * Decode one frame from codec2.
     *
     * @param con pointer long, as from the create method
     * @param bits input buffer containing one frame of audio
     * @param outputBuffer buffer which will be filled with raw PCM audio decoded
     *
     * @return 0 on successful completion
     */
    external fun decode(con: Long, bits: ByteArray?, outputBuffer: ShortArray?): Long

     fun pcm_to_codec2(mode: Int, pcm: ShortArray): ByteArray {
        val c2 = create(mode)
        val spf = getSamplesPerFrame(c2)
        val bpf = getBitsSize(c2) // bytes per frame
        var outBuf = ByteArray(0)
        var pos = 0
        while ((pos + spf) <= pcm.size) {
            var bits = ByteArray(bpf)
            encode(c2,


olelle","deleteRow":"Poista rivit"},"rows":"Rivit","summary":"Yhteenveto","title":"Taulun ominaisuudet","toolbar":"Taulu","widthPc":"prosenttia","widthPx":"pikseliä","widthUnit":"leveysyksikkö"},"stylescombo":{"label":"Tyyli","panelTitle":"Muotoilujen tyylit","panelTitle1":"Lohkojen tyylit","panelTitle2":"Rivinsisäiset tyylit","panelTitle3":"Objektien tyylit"},"specialchar":{"options":"Erikoismerkin ominaisuudet","title":"Valitse erikoismerkki","toolbar":"Lisää erikoismerkki"},"sourcearea":{"toolbar":"Koodi"},"smiley":{"options":"Hymiön ominaisuudet","title":"Lisää hymiö","toolbar":"Hymiö"},"showblocks":{"toolbar":"Näytä elementit"},"selectall":{"toolbar":"Valitse kaikki"},"scayt":{"about":"Tietoja oikoluvusta kirjoitetaessa","aboutTab":"Tietoa","addWord":"Lisää sana","allCaps":"Ohita sanat, jotka on kirjoitettu kokonaan isoilla kirjaimilla","dic_create":"Luo","dic_delete":"Poista","dic_field_name":"Sanakirjan nimi","dic_info":"Oletuksena sanakirjat tallennetaan evästeeseen, mutta evästeiden koko on kuitenkin rajallinen. Sanakirjan kasvaessa niin suureksi, ettei se enää mahdu evästeeseen, sanakirja täytyy tallentaa palvelimellemme. Tallentaaksesi sanakirjasi palvelimellemme tulee sinun antaa sille nimi. Jos olet jo tallentanut sanakirjan, anna sen nimi ja klikkaa Palauta-painiketta","dic_rename":"Nimeä uudelleen","dic_restore":"Palauta","dictionariesTab":"Sanakirjat","disable":"Poista käytöstä oikoluku kirjoitetaessa","emptyDic":"Sanakirjan nimi on annettava.","enable":"Ota käyttöön oikoluku kirjoitettaessa","ignore":"Ohita","ignoreAll":"Ohita kaikki","ignoreDomainNames":"Ohita verkkotunnukset","langs":"Kielet","languagesTab":"Kielet","mixedCase":"Ohita sanat, joissa on sekoitettu isoja ja pieniä kirjaimia","mixedWithDigits":"Ohita sanat, joissa on numeroita","moreSuggestions":"Lisää ehdotuksia","opera_title":"Opera ei tue tätä ominaisuutta","options":"Asetukset","optionsTab":"Asetukset","title":"Oikolue kirjoitettaessa","toggle":"Vaihda oikoluku kirjoittaessa tilaa"},"save":{"toolbar":"Tallenna"},"removeformat":{"toolbar":"Poista muotoilu"},"print":{"toolbar":"Tulosta"},"preview":{"preview":"Esikatsele"},"pastetext":{"button":"Liitä tekstinä","title":"Liitä tekstinä"},"pastefromword":{"confirmCleanup":"Liittämäsi teksti näyttäisi olevan Word-dokumentista. Haluatko siivota sen ennen liittämistä? (Suositus: Kyllä)","error":"Liitetyn tiedon siivoaminen ei onnistunut sisäisen virheen takia","title":"Liitä Word-dokumentista","toolbar":"Liitä Word-dokumentista"},"pagebreak":{"alt":"Sivunvaihto","toolbar":"Lisää sivunvaihto"},"newpage":{"toolbar":"Tyhjennä"},"maximize":{"maximize":"Suurenna","minimize":"Pienennä"},"magicline":{"title":"Insert paragraph here"},"liststyle":{"armenian":"Armeenialainen numerointi","bulletedTitle":"Numeroimattoman listan ominaisuudet","circle":"Ympyrä


applicable law or agreed to in writing,

 * software distributed under the License is distributed on an "AS IS" BASIS,

 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

 * See the License for the specific language governing permissions and

 * limitations under the License.
 *

 * Initial code contributed and copyrighted by

 * frentix GmbH, https://www.frentix.com
 *

 */
package org.olat.modules.coach.ui;

import java.util.ArrayList;
import java.util.List;

import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.scope.Scope;
import org.olat.core.gui.components.scope.ScopeEvent;
import org.olat.core.gui.components.scope.ScopeFactory;
import org.olat.core.gui.components.scope.ScopeSelection;
import org.olat.core.gui.components.stack.TooledStackedPanel;
import org.olat.core.gui.components.velocity.VelocityContainer;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.controller.BasicController;
import org.olat.core.gui.control.generic.dtabs.Activateable2;
import org.olat.core.id.OLATResourceable;
import org.olat.core.id.context.ContextEntry;
import org.olat.core.id.context.StateEntry;
import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
import org.olat.core.util.resource.OresHelper;
import org.olat.modules.coach.model.CoachingSecurity;
import org.olat.modules.lecture.ui.LectureRoles;
import org.olat.modules.lecture.ui.LecturesSecurityCallback;
import org.olat.modules.lecture.ui.LecturesSecurityCallbackFactory;
import org.olat.modules.lecture.ui.coach.LecturesCoachingController;
import org.olat.util.logging.activity.LoggingResourceable;

/**
 *
 * Initial date: 7 févr. 2025

 * @author srosse, stephane.rosse@frentix.com, https://www.frentix.com
 *
 */
public class LecturesMainController extends BasicController implements Activateable2 {

	private static final String MAIN_CONTROLLER = "component";

	private static final String TEACHER_SCOPE = "teacher";
	private static final String MASTER_COACH_SCOPE = "mastercoach";

	private final VelocityContainer mainVC;
	private final TooledStackedPanel content;
	private final ScopeSelection searchScopes;

	private LecturesCoachingController lecturesCtrl;

	public LecturesMainController(UserRequest ureq, WindowControl wControl, TooledStackedPanel content, CoachingSecurity coachingSec) {
		super(ureq, wControl);
		this.content = content;

		mainVC = createVelocityContainer("lectures");

		List<Scope> scopes = new ArrayList<>(4);
		if(coachingSec.isTeacher()) {
			scopes.add(ScopeFactory.createScope(TEACHER_SCOPE, translate("lectures.teacher.menu.title"), null, "o_icon o_icon_coaching_tool"));
		}
		if(coachingSec.isMasterCoachForLectures()) {
			scopes.add(ScopeFactory.createScope(MASTER_COACH_SCOPE, translate("lectures.mastercoach.menu.title"), null, "o_icon o_icon_num_participants"));
		}
		searchScopes = ScopeFactory.createScopeSelection("search.scopes", mainVC, this, scopes);
		searchScopes.setVisible(scopes.size() > 1);

		putInitialPanel(mainVC);

		if(coachingSec.isTeacher()) {


bottom-slider--title {
  display: inline-block;
  max-width: 360px;
  line-height: 14px;
}
.bottom-slide--container .bottom-slider .bottom-slider--icon {
  color: #333;
  font-size: 27px;
  line-height: 22px;
  font-size: 27px;
}
.bottom-slide--container .bottom-slider .bottom-slider--more-info {
  opacity: 0;
}
.bottom-slide--container:hover .bottom-slider--image {
  transform: translateY(-26px);
  -webkit-transform: translateY(-26px);
  -moz-transform: translateY(-26px);
  -o-transform: translateY(-26px);
  -ms-transform: translateY(-26px);
}
.bottom-slide--container:hover .bottom-slider {
  transform: translateY(-53px);
  -webkit-transform: translateY(-53px);
  -moz-transform: translateY(-53px);
  -o-transform: translateY(-53px);
  -ms-transform: translateY(-53px);
}
.bottom-slide--container:hover .bottom-slider--more-info {
  opacity: 1;
}

.dashboard--posts tr:hover .actions {
  visibility: visible;
}
.dashboard--posts .actions {
  visibility: hidden;
}
.dashboard--posts .actions form {
  display: inline;
}

.gh-project-url--container {
  background-color: #FFF;
  border: 1px solid #cccccc;
  height: 20px;
  padding: 4px 6px;
  border-radius: 4px;
  margin: 12px 0;
}
.gh-project-url--container input {
  width: 87%;
  background-color: transparent;
  border: none;
  box-shadow: none;
}
.gh-project-url--container input:focus {
  outline: none;
}
.gh-project-url--container .icon--pull-right {
  float: right;
  margin-top: 2px;
  cursor: pointer;
}

.btn--full-width {
  display: block;
}

.content--title {
  display: inline-block;
  border-top: 3px solid #6db33f;
  font-size: 12px;
  line-height: 12px;
  text-transform: uppercase;
  padding-top: 8px;
  position: absolute;
  margin-top: -30px;
  font-family: "Montserrat", sans-serif;
}
.content--title.search-title {
  position: relative;
}

.index-page--title {
  /* ASC from 30px to 50px */
  margin-bottom: 50px;
  line-height: 26px;
  /* ASC */
  font-size:26px;
}

.nan1 {
  white-space:nowrap;
  margin-bottom: 50px;
  line-height: 26px;
  font-size: 26px;
}

.index-page--subtitle {
  /* ASC from 16 to 20 px */
  font-size: 22px;
  line-height: 24px;
  /* ASC from 60px to 20px */
  margin-bottom: 20px;
  /* ASC new */
  margin-top: 30px;
}
.index-page--subtitle a {
  color: #5fa134;
}

.nan2 {
  font-size: 22px;
  line-height: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  margin-top: 30px;
}

/* ASC new class, based on above index-page--subtitle */
.nan3 {
  font-size: 18px;
  font-weight: bold;
  line-height: 24px;
  margin-top: 24px;
}
.nan3 {
/*
  color: #5fa134;
*/
}

img {
  margin: 5px;
}

.footer {
  background-color: #34302d;
  color: #eeeeee;


16 *Bn, int16 *Cn, int16 *Dn)
{
	int16	C, E, C1, E1;

	DSP1_Inverse((Vs * DSP1.SinAzs >> 15) + DSP1.VOffset, 7, &C, &E);
	E += DSP1.VPlane_E;

	C1 = C * DSP1.VPlane_C >> 15;
	E1 = E + DSP1.SecAZS_E2;

	DSP1_Normalize(C1, &C, &E);

	C = DSP1_Truncate(C, E);

	*An = C *  DSP1.CosAas >> 15;
	*Cn = C *  DSP1.SinAas >> 15;

	DSP1_Normalize(C1 * DSP1.SecAZS_C2 >> 15, &C, &E1);

	C = DSP1_Truncate(C, E1);

	*Bn = C * -DSP1.SinAas >> 15;
	*Dn = C *  DSP1.CosAas >> 15;
}

static void DSP1_Op02 (void)
{
	DSP1_Parameter(DSP1.Op02FX, DSP1.Op02FY, DSP1.Op02FZ, DSP1.Op02LFE, DSP1.Op02LES, DSP1.Op02AAS, DSP1.Op02AZS, &DSP1.Op02VOF, &DSP1.Op02VVA, &DSP1.Op02CX, &DSP1.Op02CY);
}

static void DSP1_Op0A (void)
{
	DSP1_Raster(DSP1.Op0AVS, &DSP1.Op0AA, &DSP1.Op0AB, &DSP1.Op0AC, &DSP1.Op0AD);
	DSP1.Op0AVS++;
}

static int16 DSP1_ShiftR (int16 C, int16 E)
{
	return (C * DSP1ROM[0x0031 + E] >> 15);
}

static void DSP1_Project (int16 X, int16 Y, int16 Z, int16 *H, int16 *V, int16 *M)
{
	int32	aux, aux4;
	int16	E, E2, E3, E4, E5, refE, E6, E7;
	int16	C2, C4, C6, C8, C9, C10, C11, C12, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26;
	int16	Px, Py, Pz;

	E4 = E3 = E2 = E = E5 = 0;

	DSP1_NormalizeDouble((int32) X - DSP1.Gx, &Px, &E4);
	DSP1_NormalizeDouble((int32) Y - DSP1.Gy, &Py, &E );
	DSP1_NormalizeDouble((int32) Z - DSP1.Gz, &Pz, &E3);
	Px >>= 1; // to avoid overflows when calculating the scalar products
	E4--;
	Py >>= 1;
	E--;
	Pz >>= 1;
	E3--;

	refE = (E < E3) ? E : E3;
	refE = (refE < E4) ? refE : E4;

	Px = DSP1_ShiftR(Px, E4 - refE); // normalize them to the same exponent
	Py = DSP1_ShiftR(Py, E  - refE);
	Pz = DSP1_ShiftR(Pz, E3 - refE);

	C11 = -(Px * DSP1.Nx >> 15);
	C8  = -(Py * DSP1.Ny >> 15);
	C9  = -(Pz * DSP1.Nz >> 15);
	C12 = C11 + C8 + C9; // this cannot overflow!

	aux4 = C12; // de-normalization with 32-bits arithmetic
	refE = 16 - refE; // refE can


: inline-block;
	margin-left: calc( var( --gsuiTimeline-beats-incr ) * var( --gsuiTimeline-beats-per-measure ) * 1em );
}
.gsuiTimeline-measure:first-child {
	margin-left: calc( var( --gsuiTimeline-beats-offset ) * var( --gsuiTimeline-beats-per-measure ) * 1em );
}
.gsuiTimeline-measure::before {
	content: "";
	position: absolute;
	margin-left: -2px;
	width: 4px;
	height: 100%;
	background-color: var( --gsui-timeline-bg );
}
.gsuiTimeline-measure::after {
	display: flex;
	content: counter( beat );
	position: absolute;
	inset: 0 auto;
	width: 52px;
	margin-left: -26px;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-family: var( --gsui-font-number );
	opacity: var( --gsuiTimeline-measures-opacity, 0 );
}
.gsuiTimeline-measure[ data-hl ]::after {
	font-weight: bold;
	opacity: 1;
}

/* .......................................................................... */
.gsuiTimeline-cursor,
.gsuiTimeline-cursorPreview {
	position: absolute;
	margin-left: -8px;
	bottom: 1px;
	fill: var( --gsui-col-currentTimeCursor );
	stroke: var( --gsui-col-currentTimeCursor );
	stroke-width: 2px;
	stroke-linejoin: round;
	pointer-events: none;
}
.gsuiTimeline-cursorPreview {
	opacity: .5;
}

/* .......................................................................... */
.gsuiTimeline-loop {
	position: absolute;
	top: 0;
	height: 6px;
	transition: .1s;
	transition-property: opacity, visibility;
	opacity: 0;
	visibility: hidden;
}
gsui-timeline[ loop ] .gsuiTimeline-loop {
	opacity: 1;
	visibility: visible;
}
.gsuiTimeline-loopBody {
	height: 100%;
	transition: filter .2s;
	background-color: var( --gsui-timeline-loop-bg );
}
.gsuiTimeline-loopBody:hover,
gsui-timeline[ status="dragLoop" ] .gsuiTimeline-loopBody {
	filter: brightness( 1.2 );
}

/* .......................................................................... */
.gsuiTimeline-loopHandle {
	position: absolute;
	inset: 0 auto -6px;
	width: 25%;
	min-width: 7px;
	max-width: 12px;
}
.gsuiTimeline-loopHandleA { left: -5px; }
.gsuiTimeline-loopHandleB { right: -5px; }

/* .......................................................................... */
.gsuiTimeline-loopBorder {
	position: absolute;
	inset: 0 auto;
	width: 2px;
	transition: .2s;
	transition-property: bottom, background-color;
	pointer-events: none;
}
.gsuiTimeline-loopBorderA { left: 0; }
.gsuiTimeline-loopBorderB { right: 0; }
.gsuiTimeline-loopHandle:hover + .gsuiTimeline-loopBorder,
gsui-timeline[ status="dragLoopA" ] .gsuiTimeline-loopBorderA,
gsui-timeline[ status="dragLoopB" ] .gsuiTimeline-loopBorderB {
	bottom: -3px;
	background-color: currentColor;
}
.gsuiPatterns-pattern {
	overflow: hidden;
	position: relative;
	box-sizing: border


/tc39.es/ecma262/#sec-ecmascript-language-types-number-type">is a Number</emu-xref>.

If <var>end</var> <emu-xref href="#sec-ecmascript-language-types-number-type">is not a Number</emu-xref>, throw a <emu-val>TypeError</emu-val> exception.

Let <var>zero</var> be <emu-val>+0</emu-val>𝔽.

Let <var>one</var> be <emu-val>1</emu-val>𝔽.

Else,

<emu-xref href="#assert">Assert</emu-xref>: <var>start</var> <emu-xref href="#sec-ecmascript-language-types-bigint-type">is a BigInt</emu-xref>.
                        <emu-note type="editor">Editor's Note
Allowing all kinds of number (bigint, decimals, ...) to range from a <emu-xref href="#finite">finite</emu-xref> number to infinity.
</emu-note>

If <var>end</var> is not <emu-val>+∞</emu-val>𝔽 or <emu-val>-∞</emu-val>𝔽 and <var>end</var> <emu-xref href="#sec-ecmascript-language-types-bigint-type">is not a BigInt</emu-xref>, throw a <emu-val>TypeError</emu-val> exception.

Let <var>zero</var> be <emu-val>0</emu-val>ℤ.

Let <var>one</var> be <emu-val>1</emu-val>ℤ.

If <var>start</var> is <emu-val>+∞</emu-val>𝔽 or <emu-val>-∞</emu-val>𝔽, throw a <emu-val>RangeError</emu-val> exception.

Let <var>inclusiveEnd</var> be <emu-val>false</emu-val>.

If <var>optionOrStep</var> is <emu-val>undefined</emu-val> or <emu-val>null</emu-val>, then

Let <var>step</var> be <emu-val>undefined</emu-val>.

Else if <var>optionOrStep</var> <emu-xref href="#sec-object-type">is an Object</emu-xref>, then

Let <var>step</var> be ? <emu-xref aoid="Get">Get</emu-xref>(<var>optionOrStep</var>, <emu-val>"step"</emu-val>).

Set <var>inclusiveEnd</var> to <emu-xref aoid="ToBoolean">ToBoolean</emu-xref>(? <emu-xref aoid="Get">Get</emu-xref>(<var>optionOrStep</var>, <emu-val>"inclusive"</emu-val>)).

Else if <var>type</var> is <emu-const>number-range</emu-const> and <var>optionOrStep</var> <emu-xref href="#sec-ecmascript-language-types-number-type


t** aInstancePtrResult);

nsresult
NS_NewImageDocument(nsIDocument** aInstancePtrResult);

nsresult
NS_NewVideoDocument(nsIDocument** aInstancePtrResult);

// Note: it's the caller's responsibility to create or get aPrincipal as needed
// -- this method will not attempt to get a principal based on aDocumentURI.
// Also, both aDocumentURI and aBaseURI must not be null.
nsresult
NS_NewDOMDocument(nsIDOMDocument** aInstancePtrResult,
                  const nsAString& aNamespaceURI,
                  const nsAString& aQualifiedName,
                  nsIDOMDocumentType* aDoctype,
                  nsIURI* aDocumentURI,
                  nsIURI* aBaseURI,
                  nsIPrincipal* aPrincipal,
                  bool aLoadedAsData,
                  nsIGlobalObject* aEventObject,
                  DocumentFlavor aFlavor);

// This is used only for xbl documents created from the startup cache.
// Non-cached documents are created in the same manner as xml documents.
nsresult
NS_NewXBLDocument(nsIDOMDocument** aInstancePtrResult,
                  nsIURI* aDocumentURI,
                  nsIURI* aBaseURI,
                  nsIPrincipal* aPrincipal);

nsresult
NS_NewPluginDocument(nsIDocument** aInstancePtrResult);

inline nsIDocument*
nsINode::GetOwnerDocument() const
{
  nsIDocument* ownerDoc = OwnerDoc();

  return ownerDoc != this ? ownerDoc : nullptr;
}

inline nsINode*
nsINode::OwnerDocAsNode() const
{
  return OwnerDoc();
}

#endif /* nsIDocument_h___ */


Config = BrnPickerTitleConfig.Default,
    BrnPickerConfig? themeData,
  }) : super(
            key: key,
            context: context,
            onConfirm: onConfirm,
            onCancel: onCancel,
            pickerTitleConfig: pickerTitleConfig,
            themeData: themeData);

  /// 父类属性
  final BuildContext context;

  /// 点击提交功能
  final ValueChanged onConfirm;

  /// 点击取消按钮
  final VoidCallback? onCancel;

  /// 当点击到最大数目时的点击事件
  final VoidCallback? onMaxSelectClick;

  /// 点击某个按钮的回调
  final BrnMultiSelectTagOnItemClick? onItemClick;

  /// 一行多少个数据，默认4个
  final int? crossAxisCount;

  /// 最多选择多少个item，默认可以无限选
  final int maxSelectItemCount;

  /// 本类属性
  final BrnTagsPickerConfig tagPickerConfig;

  /// 传入的泛型数据转换为 [BrnTagItemBean]
  /// 默认以填充Widget
  final BrnMultiSelectTagStringBuilder<BrnTagItemBean> onTagValueGetter;

  /// 是等分样式还是流式布局样式，[BrnMultiSelectTagsLayoutStyle]，默认等分
  final BrnMultiSelectTagsLayoutStyle layoutStyle;

  /// item的高度, 默认数值是34
  final double itemHeight;

  /// 操作类型属性
  late List<BrnTagItemBean> _selectedTags;
  late List<BrnTagItemBean> _sourceTags;

  @override
  void show() {
    _dataSetup();
    super.show();
  }

  @override
  Object getConfirmData() {
    return this._selectedTags;
  }

  @override
  Widget createBuilder(BuildContext context, VoidCallback? onUpdate) {
    if (this.tagPickerConfig.tagItemSource.isNotEmpty) {
      return _buildContent(context, onUpdate);
    } else {
      return Container(
        height: 200,
        child: Center(
          child: Text(BrnIntl.of(context).localizedResource.noTagDataTip),
        ),
      );
    }
  }

  Widget _buildContent(BuildContext context, VoidCallback? onUpdate) {
    if (this.layoutStyle == BrnMultiSelectTagsLayoutStyle.average) {
      return LayoutBuilder(
        builder: (_, constraints) {
          double maxWidth = constraints.maxWidth;
          return _buildGridViewWidget(context, onUpdate, maxWidth);
        },
      );
    } else {
      return _buildWrapViewWidget(context, onUpdate);
    }
  }

  ///等宽度的布局
  Widget _buildGridViewWidget(
      BuildContext context, VoidCallback? onUpdate, double maxWidth) {
    int brnCrossAxisCount =
        (this.crossAxisCount == null || this.crossAxisCount == 0)
            ? 4
            : this.crossAxisCount!;
    double width =
        (maxWidth - (brnCrossAxisCount - 1) * 12 - 40) / brnCrossAxisCount;
    //计算宽高比
    double brnChildAspectRatio = width / this.itemHeight;
    Color selectedTagTitleColor = this.tagPickerConfig.selectedTagTitleColor ??
        BrnThemeConfigurator.instance.getConfig().commonConfig.brandPrimary;
    Color tagTitleColor = this.tagPickerConfig.tagTitleColor ??
        BrnThemeConfigurator.instance
            .getConfig()
            .commonConfig
            .colorTextImportant;
    Color tagBackgroundColor =
        this.tagPickerConfig.tagBackgroudColor ?? Color(0xffF8F8F8);
    Color selectedTagBackgroundColor =
        this.tagPickerConfig.selectedTagBackgroudColor ??
            BrnThemeConfigurator.instance
                .getConfig()
                .commonConfig
                .brandPrimary
                .withAlpha(0x14);
    return Container(
      padding: EdgeInsets.only(top: 0.0, left: 20.0, right: 20.0, bottom: 0.0),
      constraints: BoxConstraints(maxHeight: 322, minHeight: 120),
      child: GridView.count(
        shrinkWrap:


 = params.target_alpha
				else
					local active = input_field_content.is_writing

					params.input_field_source = input_field_widget.alpha_multiplier or 0
					params.input_field_target = active and 1 or 0
				end
			end,
			update = function (parent, ui_scenegraph, scenegraph_definition, widgets, progress, params)
				local eased_progress = math.easeCubic(progress)
				local input_field_widget = widgets.input_field

				input_field_widget.alpha_multiplier = math.lerp(params.input_field_source, params.input_field_target, eased_progress)
			end,
			on_complete = function (parent, ui_scenegraph, scenegraph_definition, widgets, params)
				local input_field = widgets.input_field
				local input_field_content = input_field.content

				input_field_content.visible = params.input_field_target > 0
			end,
		},
	},
}

return {
	widget_definitions = widget_definitions,
	scenegraph_definition = scenegraph_definition,
	animations = animations,
	message_widget_blueprints = message_widget_blueprints,
}


8063D768-_SDA_BASE_
/* 801E7E98 001E3AF8  38 00 00 FF */	li r0, 0xff
/* 801E7E9C 001E3AFC  2C 1E 00 00 */	cmpwi r30, 0
/* 801E7EA0 001E3B00  98 03 00 02 */	stb r0, 2(r3)
/* 801E7EA4 001E3B04  38 A0 00 00 */	li r5, 0
/* 801E7EA8 001E3B08  98 03 00 03 */	stb r0, 3(r3)
/* 801E7EAC 001E3B0C  41 82 00 10 */	beq lbl_801E7EBC
/* 801E7EB0 001E3B10  2C 1D 00 0F */	cmpwi r29, 0xf
/* 801E7EB4 001E3B14  40 82 00 08 */	bne lbl_801E7EBC
/* 801E7EB8 001E3B18  38 A0 00 01 */	li r5, 1
lbl_801E7EBC:
/* 801E7EBC 001E3B1C  38 8D 84 A8 */	addi r4, r13, lbl_8063D768-_SDA_BASE_
/* 801E7EC0 001E3B20  38 60 00 0F */	li r3, 0xf
/* 801E7EC4 001E3B24  38 00 00 00 */	li r0, 0
/* 801E7EC8 001E3B28  98 A4 00 01 */	stb r5, 1(r4)
/* 801E7ECC 001E3B2C  98 64 00 04 */	stb r3, 4(r4)
/* 801E7ED0 001E3B30  98 04 00 05 */	stb r0, 5(r4)
/* 801E7ED4 001E3B34  48 00 00 AC */	b lbl_801E7F80
/* 801E7ED8 001E3B38  80 6D A3 D8 */	lwz r3, render_context_ptr-_SDA_BASE_(r13)
/* 801E7EDC 001E3B3C  38 A0 00 00 */	li r5, 0
/* 801E7EE0 001E3B40  38 C0 00 00 */	li r6, 0
/* 801E7EE4 001E3B44  38 E0 00 00 */	li r7, 0
/* 801E7EE8 001E3B48  39 00 00 00 */	li r8, 0
/* 801E7EEC 001E3B4C  39 20 00 00 */	li r9, 0
/* 801E7EF0 001E3B50  48 00 51 FD */	bl func_801ED0EC
/* 801E7EF4 001E3B54  80 6D A3 D8 */	lwz r3, render_context_ptr-_SDA_BASE_(r13)
/* 801E7EF8 001E3B58  38 A0 00 00 */	li r5, 0
/* 801E7EFC 001E3B5C  88 98 00 1F */	lbz r4, 0x1f(r24)
/* 801E7F00 001E3B60  38 C0 00 00 */	li r6, 0
/* 801E7F04 001E3B64  38 E0 00 00 */	li r7, 0
/* 801E7F08 001E3B68  39 00 00 00 */	li r8, 0
/* 801E7F0C 001E3B6C  39 20 00 00 */	li r9, 0
/* 801E7F10 001E3B70  48 00 52 29 */	bl func_801ED138
/* 801E7F14 001E3B74  88 98 00 1F */	lbz r4, 0x1f(r24)
/* 801E7F18 001E3B78  38 A0 00 0F */


t java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicInteger
import javax.management.ObjectName
import kotlin.io.path.div
import kotlin.system.exitProcess

class NodeWithInfo(val node: Node, val info: NodeInfo) {
    val services: StartedNodeServices = object : StartedNodeServices, ServiceHubInternal by node.services, FlowStarter by node.flowStarter {}
    fun dispose() = node.stop()
    fun <T : FlowLogic<*>> registerInitiatedFlow(initiatedFlowClass: Class<T>) = node.registerInitiatedFlow(node.smm, initiatedFlowClass)
}

/**
 * A Node manages a standalone server that takes part in the P2P network. It creates the services found in [ServiceHub],
 * loads important data off disk and starts listening for connections.
 *
 * @param configuration This is typically loaded from a TypeSafe HOCON configuration file.
 */
open class Node(configuration: NodeConfiguration,
                versionInfo: VersionInfo,
                private val initialiseSerialization: Boolean = true,
                flowManager: FlowManager = NodeFlowManager(configuration.flowOverrides),
                cacheFactoryPrototype: BindableNamedCacheFactory = DefaultNamedCacheFactory(),
                allowHibernateToManageAppSchema: Boolean = false
) : AbstractNode<NodeInfo>(
        configuration,
        createClock(configuration),
        cacheFactoryPrototype,
        versionInfo,
        flowManager,
        // Under normal (non-test execution) it will always be "1"
        AffinityExecutor.ServiceAffinityExecutor("Node thread-${sameVmNodeCounter.incrementAndGet()}", 1),
        allowHibernateToManageAppSchema = allowHibernateToManageAppSchema
) {

    override fun createStartedNode(nodeInfo: NodeInfo, rpcOps: List<RPCOps>, notaryService: NotaryService?): NodeInfo =
            nodeInfo

    companion object {
        private val staticLog = contextLogger()
        var renderBasicInfoToConsole = true

        /** Used for useful info that we always want to show, even when not logging to the console */
        fun printBasicNodeInfo(description: String, info: String? = null) {
            val msg = if (info == null) description else "${description.padEnd(40)}: $info"
            val loggerName = if (renderBasicInfoToConsole) "BasicInfo" else "Main"
            LoggerFactory.getLogger(loggerName).info(msg)
        }

        fun printInRed(message: String) {
            println("${ShellConstants.RED}$message${ShellConstants.RESET}")
        }

        fun printWarning(message: String) {
            Emoji.renderIfSupported {
                printInRed("${Emoji.warningSign} ATTENTION: $message")
            }
            staticLog.warn(message)
        }

        internal fun failStartUp(message: String): Nothing {
            println(message)
            println("Corda will now exit...")
            exitProcess(1)
        }

        private fun createClock(configuration: NodeConfiguration): CordaClock {
            return (if (configuration.useTestClock) ::DemoClock else ::SimpleClock)(Clock.systemUTC())
        }

        private val sameVmNodeCounter = AtomicInteger()

        // TODO: make this configurable.
        const val MAX_RPC_MESSAGE_SIZE = 10485760

        fun isInvalidJavaVersion(): Boolean {
            if (!hasMinimumJavaVersion()) {
                println("You are using a version of Java that is not supported (${SystemUtils.JAVA_VERSION}). Please upgrade to the latest version of Java 17.")
                println("Corda will now exit...")
                return true
            }
            return false
        }

        private fun hasMinimumJavaVersion


a0a048d2749252848da35e10c8b',1,'glm']]],
  ['mirrorrepeat',['mirrorRepeat',['../a00369.html#ga16a89b0661b60d5bea85137bbae74d73',1,'glm']]],
  ['mix',['mix',['../a00241.html#ga8e93f374aae27d1a88b921860351f8d4',1,'glm::mix(genTypeT x, genTypeT y, genTypeU a)'],['../a00248.html#gafbfe587b8da11fb89a30c3d67dd5ccc2',1,'glm::mix(qua< T, Q > const &x, qua< T, Q > const &y, T a)']]],
  ['mixedproduct',['mixedProduct',['../a00342.html#gab3c6048fbb67f7243b088a4fee48d020',1,'glm']]],
  ['mod',['mod',['../a00241.html#ga9b197a452cd52db3c5c18bac72bd7798',1,'glm::mod(vec< L, T, Q > const &x, vec< L, T, Q > const &y)'],['../a00330.html#gaabfbb41531ab7ad8d06fc176edfba785',1,'glm::mod(int x, int y)'],['../a00330.html#ga63fc8d63e7da1706439233b386ba8b6f',1,'glm::mod(uint x, uint y)']]],
  ['modf',['modf',['../a00241.html#ga85e33f139b8db1b39b590a5713b9e679',1,'glm']]]
];
/*!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

/**
 * @import { FlatConfig } from "@typescript-eslint/utils/ts-eslint";
 */
import perfectionist from "eslint-plugin-perfectionist";

import { ERROR } from "./levels.js";
import { off } from "./off.js";

/**
 * ESLint `perfectionist` namespace.
 */
export const perfectionistNamespace = "perfectionist";

/**
 * ESLint `perfectionist` rules.
 * @see [perfectionist](https://perfectionist.dev/rules)
 */
export const perfectionistRules = /** @type {const} @satisfies {FlatConfig.Config} */ ({
  plugins: {
    [perfectionistNamespace]: perfectionist,
  },
  rules: {
    /**
     * Enforce sorted array values if the `includes` method is
     * immediately called after the array is created.
     *
     * @see [perfectionist/sort-array-includes](https://perfectionist.dev/rules/sort-array-includes)
     */
    [`${perfectionistNamespace}/sort-array-includes`]: ERROR,

    /**
     * Enforce sorted class members.
     *
     * @see [perfectionist/sort-classes](https://perfectionist.dev/rules/sort-classes)
     */
    [`${perfectionistNamespace}/sort-classes`]: ERROR,

    /**
     * Enforce sorted TypeScript enum members.
     *
     * @see [perfectionist/sort-enums](https://perfectionist.dev/rules/sort-enums)
     */
    [`${perfectionistNamespace}/sort-enums`]: ERROR,

    /**
     * Enforce sorted TypeScript interface properties.
     *
     * @see [perfectionist/sort-interfaces](https://perfectionist.dev/ru


"""
ログ設定システム

構造化ログとリクエスト追跡を実装します。
"""

import json
import logging
import logging.config
import uuid
from contextvars import ContextVar
from datetime import datetime
from pathlib import Path
from typing import Any, Dict, Optional

import yaml

from .config import get_settings

# リクエストIDのコンテキスト変数
request_id_var: ContextVar[Optional[str]] = ContextVar('request_id', default=None)

class StructuredFormatter(logging.Formatter):
    """構造化ログフォーマッター"""

    def format(self, record: logging.LogRecord) -> str:
        """ログレコードをJSON形式でフォーマット"""
        log_data = {
            'timestamp': datetime.fromtimestamp(record.created).isoformat(),
            'level': record.levelname,
            'logger': record.name,
            'message': record.getMessage(),
            'module': record.module,
            'function': record.funcName,
            'line': record.lineno,
        }

        # リクエストIDを追加
        request_id = request_id_var.get()
        if request_id:
            log_data['request_id'] = request_id

        # 例外情報を追加
        if record.exc_info:
            log_data['exception'] = self.formatException(record.exc_info)

        # 追加のコンテキスト情報を追加
        if hasattr(record, 'extra_data'):
            log_data.update(record.extra_data)

        return json.dumps(log_data, ensure_ascii=False)

class RequestContextFilter(logging.Filter):
    """リクエストコンテキストフィルター"""

    def filter(self, record: logging.LogRecord) -> bool:
        """ログレコードにリクエストIDを追加"""
        request_id = request_id_var.get()
        if request_id:
            record.request_id = request_id
        return True

def setup_logging(config_path: Optional[Path] = None) -> None:
    """ログ設定を初期化"""
    settings = get_settings()

    if config_path is None:
        config_path = settings.log_config_path

    # ログディレクトリを作成
    log_dir = Path("logs")
    log_dir.mkdir(exist_ok=True)

    try:
        if config_path.exists():
            # YAML設定ファイルから読み込み
            with open(config_path, 'r', encoding='utf-8') as f:
                config = yaml.safe_load(f)
            logging.config.dictConfig(config)
        else:
            # デフォルト設定を使用
            _setup_default_logging()

        # カスタムフィルターを追加
        for handler in logging.root.handlers:
            handler.addFilter(RequestContextFilter())

    except Exception as e:
        print(f"ログ設定エラー: {e}")
        _setup_default_logging()

def _setup_default_logging() -> None:
    """デフォルトログ設定"""
    logging.basicConfig(
        level=logging.INFO,
        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
        handlers=[
            logging.StreamHandler(),
            logging.FileHandler('logs/api.log', encoding='utf-8')
        ]
    )

def get_logger(name: str) -> logging.Logger:
    """構造化ログ対応のロガーを取得"""
    logger = logging.getLogger(name)
    return logger

def set_request_id(request_id: str) -> None:
    """リクエストIDを設定"""
    request_id_var.set(request_id)

def get_request_id() -> Optional[str]:
    """現在のリクエストIDを取得"""
    return request_id_var.get()

def generate_request_id() -> str:
    """新しいリクエストIDを生成"""
    return str(uuid.uuid4())

class APILogger:
    """API専用ロガークラス"""

    def __init__(self, name: str):
        self.logger = get_logger(f"api.{name}")

    def info(self, message: str, **kwargs):
        """情報ログ"""
        self._log(logging.INFO, message, **kwargs)

    def warning(self, message: str, **kwargs):
        """警告ログ"""
        self._log(logging.WARNING, message, **kwargs)

    def error(self, message: str, **kwargs):
        """エラーログ"""
        self._log(logging.ERROR, message, **kwargs)

    def debug(self, message: str, **kwargs):
        """デバッグログ"""
        self._log(logging.DEBUG, message, **kwargs)

    def log_request(self, method: str, path: str, status_code: int,
                   response_time: float, **kwargs):
        """リクエストログ"""
        self.info(
            f"{method} {path} - {status_code}",
            extra_data={
                'request_method': method,
                'request_path': path,
                'status_code': status_code,
                'response_time_ms': round(response_time * 1000, 2),
                **kwargs
            }
        )

    def log_prediction(self, model_type: str, success: bool,
                      response_time: float, **kwargs):
        """予測ログ"""
        level = logging.INFO if success else logging.ERROR
        message = f"予測{model_type} - {'成功' if success else '失敗'}"


puts
   lda #chrCR
   jmp putchar

   assignShowDrv = *
   lda #$80
   jsr aceDirStat
   bcc +
   rts
+  ldx #stdout
   jsr zpputs
   lda #"="
   jsr putchar
   lda #<aceSharedBuf
   ldy #>aceSharedBuf
   jsr puts
   lda #chrCR
   jmp putchar

   assignShowAll = *
   lda #$40
   sta mtDrive
-  inc mtDrive
   lda #<mtDrive
   ldy #>mtDrive
   sta zp
   sty zp+1
   jsr aceMiscDeviceInfo
   cpx #4
   bne +
   jsr assignShowDrv
+  lda mtDrive
   cmp #$5a
   bne -
   rts

;===mem===
gmTpa       = 2  ;(4)
gmDynFree   = 6  ;(4)
gmTotal     = 10 ;(4)
gmOption    = 14 ;(1)
gmTemp      = 15 ;(4)

;             |---------1---------2---------3---------4|
gmTpaMsg !pet "xxxxx application bytes available.",chrCR,0
gmUsageMsg = *
   !pet  "mem [/s]"
   !byte chrCR,chrCR
   !pet  "    /s : short-form system memory only"
   !byte chrCR,0

getmem = *
   ; clear variables
   lda #0
   ldx #$11
-  sta gmTpa,x
   dex
   bpl -
   ; default to long version
   lda #$ff
   sta gmOption
   ; check for allowed options
   lda #1
   ldy #0
   jsr getarg
   lda zp+0
   ora zp+1
   beq ++       ; no optional arg
   ldy #0
   lda (zp),y
   +cmpASCII "/"
   beq +              ; invalid option prefix
   gmShowUsage = *
   lda #<gmUsageMsg   ; show help text and punt
   ldy #>gmUsageMsg
   jmp eputs
+  iny
   lda (zp),y
   sta gmOption ; option stored
   ; check for /h, /?, or unrecognized option
   +cmpASCII "s"
   beq ++
   jmp gmShowUsage
   ; get dynamic memory free/total
++ ldx #gmDynFree
   jsr aceMemStat
   lda #<gmMemMsg
   sta zp+0
   lda #>gmMemMsg
   sta zp+1
   ldx #gmTotal
   jsr getKb
   +ldaSCII "k"
   ldx #5
   sta gmMemMsg,x
   lda #<UtoaNumber
   sta zp+0
   lda #>UtoaNumber
   sta zp+1
   ldx #gmDynFree
   jsr getKb
   ldx #0
-  lda UtoaNumber, x
   sta gmMemMsg+25,x
   inx
   cpx #5
   bne -
   ; output system RAM/free as bordered text
   lda #0
   ldx #39
   jsr toolUserLayout
   lda #$80    ; border on
   sta toolUserStyles
   lda #2      ; text color
   sta toolUserColor
   jsr toolUserNode
   jsr toolUserLabel
;             |---------1---------2---------3---------4|
gmMemMsg !pet "xxxxxk RAM System        xxxxxk free.",0
   jsr toolUserEnd
   ; check if short option ('/s') was used
   lda gmOption
   +cmpASCII "s"
   bne +
   rts
   ; calculate and show application memory
+  sec
   lda aceMemTop+0
   sbc #<aceAppAddress
   sta gmTpa+0
   lda aceMemTop+1
   sbc #>aceAppAddress


    return;
    }
  };
  var /*@type=(bool) -> Null*/ i = /*@ returnType=Null */ (bool b) {
    if (b) {
      return null;
    } else {
      return null;
    }
  };
  var /*@type=(bool) -> int?*/ j = /*@returnType=int?*/ (bool b) {
    if (b) {
      return null;
    } else {
      return 0;
    }
  };
  var /*@type=(bool) -> int?*/ k = /*@returnType=int?*/ (bool b) {
    if (b) {
      return 0;
    } else {
      return;
    }
  };
  var /*@type=(bool) -> int?*/ l = /*@returnType=int?*/ (bool b) {
    if (b) {
      return 0;
    } else {
      return null;
    }
  };
  var /*@type=(bool) -> int*/ m = /*@returnType=int*/ (bool b) {
    if (b) {
      return 0;
    } else {
      return 0;
    }
  };
}
// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/*@testedFeatures=inference*/
library test;

class A<S, T> {
  S x;
  T y;
  A(this.x, this.y);
  A.named(this.x, this.y);
}

class B<S, T> extends A<T, S> {
  B(S y, T x) : super(x, y);
  B.named(S y, T x) : super.named(x, y);
}

class C<S> extends B<S, S> {
  C(S a) : super(a, a);
  C.named(S a) : super.named(a, a);
}

class D<S, T> extends B<T, int> {
  D(T a) : super(a, 3);
  D.named(T a) : super.named(a, 3);
}

class E<S, T> extends A<C<S>, T> {
  E(T a) : super(throw '', a);
}

class F<S, T> extends A<S, T> {
  F(S x, T y, {required List<S> a, required List<T> b}) : super(x, y);
  F.named(S x, T y, [S? a, T? b]) : super(x, y);
}

void test() {
  {
    A<int, String> a0 = new /*@typeArgs=int, String*/ A(3, "hello");
    A<int, String> a1 = new /*@typeArgs=int, String*/ A.named(3, "hello");
    A<int, String> a2 = new A<int, String>(3, "hello");
    A<int, String> a3 = new A<int, String>.named(3, "hello");
    A<int, String>
        a4 = /*error:INVALID_CAST_NEW_EXPR*/ new A<int, dynamic>(3, "hello");
    A<int, String>
        a5 = /*error:INVALID_CAST_NEW_EXPR*/ new A<dynamic, dynamic>.named(
            3, "hello");
  }
  {
    A<int, String> a0 = new /*@typeArgs=int, String*/ A(
        /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ "hello",
        /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
    A<int, String> a1 = new /*@typeArgs=int, String*/ A.named(
        /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ "hello",
        /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
  }
  {
    A<int, String> a0 = new /*@typeArgs=String, int*/ B("hello", 3);
    A<int, String> a1 = new /*@typeArgs=String, int*/ B.named("hello", 3);


#ifdef AX_CONFIG_SELECT

#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/select.h>
#include <sys/time.h>

int pselect(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds,
            const struct timespec *restrict ts, const sigset_t *restrict mask)
{
    struct timeval tv = {ts->tv_sec, ts->tv_nsec / 1000};
    select(n, rfds, wfds, efds, &tv);
    return 0;
}

#endif // AX_CONFIG_SELECT


"""Minimal reproducer for the reset_caches inconsistency bug."""

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

import htmldate.meta

# Replace an htmldate function with a mock that doesn't have cache_clear
original = htmldate.meta.compare_reference
htmldate.meta.compare_reference = lambda *args: 0

# This will crash with AttributeError
try:
    htmldate.meta.reset_caches()
    print("No error - unexpected!")
except AttributeError as e:
    print(f"AttributeError: {e}")

# Restore
htmldate.meta.compare_reference = original

# But charset_normalizer functions are handled gracefully
original_enc = htmldate.meta.encoding_languages if hasattr(htmldate.meta, 'encoding_languages') else None
htmldate.meta.encoding_languages = lambda *args: None

# This will NOT crash
try:
    htmldate.meta.reset_caches()
    print("No error for charset_normalizer - handled gracefully")
except AttributeError as e:
    print(f"Unexpected AttributeError: {e}")

# Restore
if original_enc:
    htmldate.meta.encoding_languages = original_enc


fs[vf27].vf;
  //  sq.xyzw vf28, 8(vi00)      |  nop
  background_vu0_data[8] = c->vfs[vf28].vf;
  //  sq.xyzw vf29, 9(vi00)      |  nop
  background_vu0_data[9] = c->vfs[vf29].vf;
  //  sq.xyzw vf30, 10(vi00)     |  nop
  background_vu0_data[10] = c->vfs[vf30].vf;
  //  sq.xyzw vf31, 11(vi00)     |  nop :e
  background_vu0_data[11] = c->vfs[vf31].vf;
  //  iaddiu vi02, vi00, 0xf0    |  nop
}

// clang-format off
u64 execute(void* ctxt) {
  auto* c = (ExecutionContext*)ctxt;
  init_background(c);
  bool bc = false;
  u16 vi01 = 0;

  u32 madr, sadr, qwc;
  c->daddiu(sp, sp, -128);                          // daddiu sp, sp, -128
  c->sd(ra, 0, sp);                                 // sd ra, 0(sp)
  c->sq(s0, 16, sp);                                // sq s0, 16(sp)
  c->sq(s1, 32, sp);                                // sq s1, 32(sp)
  c->sq(s2, 48, sp);                                // sq s2, 48(sp)
  c->sq(s3, 64, sp);                                // sq s3, 64(sp)
  c->sq(s4, 80, sp);                                // sq s4, 80(sp)
  c->sq(s5, 96, sp);                                // sq s5, 96(sp)
  c->sq(gp, 112, sp);                               // sq gp, 112(sp)
  get_fake_spad_addr(t4, cache.fake_scratchpad_data, 0, c);// lui t4, 28672
  c->lw(v1, 4, a3);                                 // lw v1, 4(a3)
  c->lui(t1, 4096);                                 // lui t1, 4096
  c->lui(t2, 4096);                                 // lui t2, 4096
  // sync.l
  // cache dxwbin v1, 0
  // sync.l
  // cache dxwbin v1, 1
  // sync.l
  c->load_symbol(t0, cache.instance_tie_work_copy); // lw t0, *instance-tie-work-copy*(s7)
  c->ori(t1, t1, 54272);                            // ori t1, t1, 54272 SPR TO
  c->sw(a3, 396, t0);                               // sw a3, 396(t0)
  c->ori(a3, t2, 53248);                            // ori a3, t2, 53248 SPR FROM
  c->load_symbol(t5, cache.wind_work);              // lw t5, *wind-work*(s7)
  c->lw(t6, 0, a0);                                 // lw t6, 0(a0)
  c->ori(t2, t4, 16);                               // ori t2, t4,


right: 0;
    background: rgba(0, 0, 0, .75);
}

.km-image-viewer .km-image-viewer-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    white-space: nowrap;
    overflow: auto;
}

.km-image-viewer .km-image-viewer-container::before {
    content: '';
    display: inline-block;
    height: 100%;
    width: 0;
    font-size: 0;
    vertical-align: middle;
}

.km-image-viewer .km-image-viewer-container img {
    cursor: zoom-out;
    vertical-align: middle;
}

.km-image-viewer .km-image-viewer-container img.limited {
    cursor: zoom-in;
    max-width: 100%;
    max-height: 100%;
}

.km-image-viewer .km-image-viewer-toolbar {
    z-index: 1;
    background: rgba(0, 0, 0, .75);
    text-align: right;
    transition: all .25s;
}

.km-image-viewer .km-image-viewer-toolbar.hidden {
    transform: translate(0, -100%);
    opacity: 0;
}

.km-image-viewer .km-image-viewer-btn {
    cursor: pointer;
    outline: 0;
    border: 0;
    width: 44px;
    height: 44px;
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjY0IiBoZWlnaHQ9Ijg4IiB2aWV3Qm94PSIwIDAgMjY0IDg4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0aXRsZT5kZWZhdWx0LXNraW4gMjwvdGl0bGU+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Zz48cGF0aCBkPSJNNjcuMDAyIDU5LjV2My43NjhjLTYuMzA3Ljg0LTkuMTg0IDUuNzUtMTAuMDAyIDkuNzMyIDIuMjItMi44MyA1LjU2NC01LjA5OCAxMC4wMDItNS4wOThWNzEuNUw3MyA2NS41ODUgNjcuMDAyIDU5LjV6IiBpZD0iU2hhcGUiIGZpbGw9IiNmZmYiLz48ZyBmaWxsPSIjZmZmIj48cGF0aCBkPSJNMTMgMjl2LTVoMnYzaDN2MmgtNXpNMTMgMTVoNXYyaC0zdjNoLTJ2LTV6TTMxIDE1djVoLTJ2LTNoLTN2LTJoNXpNMzEgMjloLTV2LTJoM3YtM2gydjV6IiBpZD0iU2hhcGUiLz48L2c+PGcgZmlsbD0iI2ZmZiI+PHBhdGggZD0iTTYyID


    glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE)
    glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE)
    val windowHandle: Long = glfwCreateWindow(width, height, "Compose LWJGL Demo", NULL, NULL)
    glfwMakeContextCurrent(windowHandle)
    glfwSwapInterval(1)

    GL.createCapabilities()

    val context = DirectContext.makeGL()
    var surface = createSurface(width, height, context) // Skia Surface, bound to the OpenGL framebuffer
    val glfwDispatcher = GlfwCoroutineDispatcher() // a custom coroutine dispatcher, in which Compose will run

    glfwSetWindowCloseCallback(windowHandle) {
        glfwDispatcher.stop()
    }

    lateinit var composeScene: ComposeScene

    fun render() {
        surface.canvas.clear(Color.WHITE)
        composeScene.constraints = Constraints(maxWidth = width, maxHeight = height)
        composeScene.render(surface.canvas, System.nanoTime())

        context.flush()
        glfwSwapBuffers(windowHandle)
    }

    val frameDispatcher = FrameDispatcher(glfwDispatcher) { render() }

    val density = Density(glfwGetWindowContentScale(windowHandle))
    composeScene = ComposeScene(glfwDispatcher, density, invalidate = frameDispatcher::scheduleFrame)

    glfwSetWindowSizeCallback(windowHandle) { _, windowWidth, windowHeight ->
        width = windowWidth
        height = windowHeight
        surface.close()
        surface = createSurface(width, height, context)

        glfwSwapInterval(0)
        render()
        glfwSwapInterval(1)
    }

    composeScene.subscribeToGLFWEvents(windowHandle)
    composeScene.setContent { App() }
    glfwShowWindow(windowHandle)

    glfwDispatcher.runLoop()

    composeScene.close()
    glfwDestroyWindow(windowHandle)

    exitProcess(0)
}

private fun createSurface(width: Int, height: Int, context: DirectContext): Surface {
    val fbId = GL11.glGetInteger(GL_FRAMEBUFFER_BINDING)
    val renderTarget = BackendRenderTarget.makeGL(width, height, 0, 8, fbId, GR_GL_RGBA8)
    return Surface.makeFromBackendRenderTarget(
        context, renderTarget, SurfaceOrigin.BOTTOM_LEFT, SurfaceColorFormat.RGBA_8888, ColorSpace.sRGB
    )
}

private fun glfwGetWindowContentScale(window: Long): Float {
    val array = FloatArray(1)
    glfwGetWindowContentScale(window, array, FloatArray(1))
    return array[0]
}package com.jetbrains.edu.csharp.hyperskill

import com.jetbrains.edu.csharp.CSharpConfigurator
import com.jetbrains.edu.csharp.CSharpConfigurator.Companion.ASSETS_DIRECTORY
import com.jetbrains.edu.csharp.CSharpConfigurator.Companion.PACKAGES_DIRECTORY
import com.jetbrains.edu.csharp.CSharpConfigurator.Companion.PROJECT_SETTINGS_DIRECTORY
import com.jetbrains.edu.csharp.CSharpProjectSettings
import com.jetbrains.edu.learning.EduCourseBuilder
import com.jetbrains.edu.learning.configuration.ArchiveInclusionPolicy
import com.jetbrains.edu.learning.configuration.CourseViewVisibility
import com.jetbrains.edu.learning.configuration.attributesEvaluator.AttributesEvaluator
import com.jetbrains.edu.learning.stepik.hyperskill.HyperskillConfigurator

/**
 * For now, we assume that Hyperskill courses can only be Unity-based
 */
class CSharpHyperskillConfigurator : HyperskillConfigurator<CSharpProjectSettings>(CSharpConfigurator()) {
  override val courseBuilder: EduCourseBuilder<CSharpProjectSettings>
    get() = CSharpHyperskillCourseBuilder()

  override val courseFileAttributesEvaluator: AttributesEvaluator = AttributesEvaluator(super.courseFileAttributesEvalu


  throw new ArgumentOutOfRangeException( "count" );
            }

            char[] chars = new char[ ( count * 2 ) < CharsChunkSize ? ( count * 2 ) : CharsChunkSize ];
            int endIndex = index + count;
            while ( index < endIndex ) {
                int cnt = ( count < CharsChunkSize/2 ) ? count : CharsChunkSize/2;
                int charCount = Encode( buffer, index, cnt, chars );
                await writer.WriteRawAsync( chars, 0, charCount ).ConfigureAwait(false);
                index += cnt;
                count -= cnt;
            }
        }

    } // class
} // namespace


))),_I=l.forwardRef(({color:e="currentColor",size:t=14,...r},n)=>l.createElement("svg",{width:t,height:t,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,...r},l.createElement("path",{d:"M7 2a4 4 0 014 4 3 3 0 110 6H7c-.08 0-.161-.003-.24-.01-.086.007-.173.01-.26.01h-3a3.5 3.5 0 01-.38-6.98A4.002 4.002 0 017 2z",fill:e}))),RI=l.forwardRef(({color:e="currentColor",size:t=14,...r},n)=>l.createElement("svg",{width:t,height:t,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:n,...r},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 7a4 4 0 11-8 0 4 4 0 018 0zm-1 0a3 3 0 11-6 0 3 3 0 016 0z",fill:e}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.268 13.18c.25.472.83.66 1.31.425l.987-.482a.991.991 0 01.87 0l.987.482a.991.991 0 001.31-.426l.515-.97a.991.991 0 01.704-.511l1.082-.19a.99.99 0 00.81-1.115l-.154-1.087a.991.991 0 01.269-.828l.763-.789a.991.991 0 000-1.378l-.763-.79a.991.991 0 01-.27-.827l.155-1.087a.99.99 0 00-.81-1.115l-1.082-.19a.991.991 0 01-.704-.511L9.732.82a.99.99 0 00-1.31-.426l-.987.482a.991.991 0 01-.87 0L5.578.395a.99.99 0 00-1.31.426l-.515.97a.99.99 0 01-.704.511l-1.082.19a.99.99 0 00-.81 1.115l.154 1.087a.99.99 0 01-.269.828L.28 6.31a.99.99 0 000 1.378l.763.79a.99.99 0 01.27.827l-.155 1.087a.99.99 0 00.81 1.115l1.082.19a.99.99 0 01.704.511l.515.97zm5.096-1.44l-.511.963-.979-.478a1.99 1.99 0 00-1.748 0l-.979.478-.51-.962a1.991 1.991 0 00-1.415-1.028l-1.073-.188.152-1.079a1.991 1.991 0 00-.54-1.663L1.004 7l.757-.783a1.991 1.991 0 00.54-1.663L2.15 3.475l1.073-.188A1.991 1.991 0 004.636 2.26l.511-.962.979.478a1.99 1.99 0 001.748 0l.979-.478.51.962c.288.543.81.922 1.415 1.028l1.073.188-.152 1.079a1.99 1.99 0 00.54 1.663l.757.783-.757.783a1.99 1.99 0 00-.54 1.663l.152 1.079-1.073.188a1.991 1.991 0 00-1.414 1.028z",fill:e}))),II=l.forwardRef(({color:e="currentColor",size:t=14,...r},n)=>l.createElement("svg",{width:t


52,1.8-3.185,4.213-3.262s4.356,1.236,4.412,2.988A2.775,2.775,0,0,1,9.548,28.33a5.3,5.3,0,0,1-2.948.948Q6.5,29.281,6.4,29.281Zm.186-5.2-.156,0c-1.766.056-3.229,1.052-3.193,2.174a1.761,1.761,0,0,0,.924,1.374,4.235,4.235,0,0,0,2.4.593,4.235,4.235,0,0,0,2.357-.744,1.761,1.761,0,0,0,.835-1.43C9.724,24.961,8.29,24.08,6.591,24.08Z" style="fill:#656565"/><path d="M19.261,29.26a5.238,5.238,0,0,1-2.807-.762,2.775,2.775,0,0,1-1.41-2.229h0c-.055-1.752,1.8-3.185,4.213-3.262a5.3,5.3,0,0,1,3,.759A2.6,2.6,0,0,1,22.4,28.31a5.3,5.3,0,0,1-2.948.948Q19.358,29.26,19.261,29.26ZM16.1,26.236a1.761,1.761,0,0,0,.924,1.374,4.57,4.57,0,0,0,4.757-.151,1.558,1.558,0,0,0-.089-2.8,4.226,4.226,0,0,0-2.4-.593c-1.766.056-3.228,1.052-3.193,2.174Z" style="fill:#656565"/><path d="M6.2,23.477A27.4,27.4,0,0,1,9.769,8.986l.687.391A26.609,26.609,0,0,0,6.986,23.45Z" style="fill:#656565"/><path d="M10.853,7.957a7.171,7.171,0,0,0-.075,2.32l-.758-.93-1.178-.23A7.165,7.165,0,0,0,10.853,7.957Z" style="fill:#656565"/><path d="M19.854,23.477l-.79-.027a26.59,26.59,0,0,0-.915-7.884,26.624,26.624,0,0,0-2.554-6.189l.687-.391a27.423,27.423,0,0,1,2.63,6.373A27.372,27.372,0,0,1,19.854,23.477Z" style="fill:#656565"/><path d="M15.2,7.957a7.171,7.171,0,0,0,2.011,1.159l-1.178.23-.758.93A7.165,7.165,0,0,0,15.2,7.957Z" style="fill:#656565"/><rect x="11.348" y="9.945" width="3.515" height="0.791" transform="matrix(0.016, -1, 1, 0.016, 2.557, 23.279)" style="fill:#656565"/><path d="M13.054,13.529a7.171,7.171,0,0,0-1.1-2.046l1.122.426,1.135-.39A7.165,7.165,0,0,0,13.054,13.529Z" style="fill:#656565"/><rect x="7.809" y="20.081" width="4.757" height="0.791" transform="translate(-12.56 18.108) rotate(-57.603)" style="fill:#656565"/><path d="M8.147,23.694a7.


that encrypted the private key.
  final String? keyId;

  /// The type of data key pair that was generated.
  final DataKeyPairSpec? keyPairSpec;

  /// The encrypted copy of the private key. When you use the HTTP API or the
  /// Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not
  /// Base64-encoded.
  final Uint8List? privateKeyCiphertextBlob;

  /// The plaintext copy of the private key. When you use the HTTP API or the
  /// Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not
  /// Base64-encoded.
  ///
  /// If the response includes the CiphertextForRecipient field, the
  /// PrivateKeyPlaintext field is null or empty.
  final Uint8List? privateKeyPlaintext;

  /// The public key (in plaintext). When you use the HTTP API or the Amazon Web
  /// Services CLI, the value is Base64-encoded. Otherwise, it is not
  /// Base64-encoded.
  final Uint8List? publicKey;

  GenerateDataKeyPairResponse({
    this.ciphertextForRecipient,
    this.keyId,
    this.keyPairSpec,
    this.privateKeyCiphertextBlob,
    this.privateKeyPlaintext,
    this.publicKey,
  });

  factory GenerateDataKeyPairResponse.fromJson(Map<String, dynamic> json) {
    return GenerateDataKeyPairResponse(
      ciphertextForRecipient:
          _s.decodeNullableUint8List(json['CiphertextForRecipient'] as String?),
      keyId: json['KeyId'] as String?,
      keyPairSpec:
          (json['KeyPairSpec'] as String?)?.let(DataKeyPairSpec.fromString),
      privateKeyCiphertextBlob: _s
          .decodeNullableUint8List(json['PrivateKeyCiphertextBlob'] as String?),
      privateKeyPlaintext:
          _s.decodeNullableUint8List(json['PrivateKeyPlaintext'] as String?),
      publicKey: _s.decodeNullableUint8List(json['PublicKey'] as String?),
    );
  }

  Map<String, dynamic> toJson() {
    final ciphertextForRecipient = this.ciphertextForRecipient;
    final keyId = this.keyId;
    final keyPairSpec = this.keyPairSpec;
    final privateKeyCiphertextBlob = this.privateKeyCiphertextBlob;
    final privateKeyPlaintext = this.privateKeyPlaintext;
    final publicKey = this.publicKey;
    return {
      if (ciphertextForRecipient != null)
        'CiphertextForRecipient': base64Encode(ciphertextForRecipient),
      if (keyId != null) 'KeyId': keyId,
      if (keyPairSpec != null) 'KeyPairSpec': keyPairSpec.value,
      if (privateKeyCiphertextBlob != null)
        'PrivateKeyCiphertextBlob': base64Encode(privateKeyCiphertextBlob),
      if (privateKeyPlaintext != null)
        'PrivateKeyPlaintext': base64Encode(privateKeyPlaintext),
      if (publicKey != null) 'PublicKey': base64Encode(publicKey),
    };
  }
}

class GenerateDataKeyPairWithoutPlaintextResponse {
  /// The Amazon Resource Name (key
  /// ARN) of the KMS key that encrypted the private key.
  final String? keyId;

  /// The type of data key pair that was generated.
  final DataKeyPairSpec? keyPairSpec;

  /// The encrypted copy of the private key. When you use the HTTP API or the
  /// Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not
  /// Base64-encoded.
  final Uint8List? privateKeyCiphertextBlob;

  /// The public key (in plaintext). When you use the HTTP API or the Amazon Web
  /// Services C


    }
                            _ => None,
                        })
                        .or(Some(referenced)),

                    _ => Some(referenced),
                });

            let referenced_id = referenced_declaration.map(|reference| reference.id);

            debug!(
                "Associating child {} to value {:?}",
                child_ident, referenced_declaration
            );

            {
                let child: &mut LinearizationItem<TypeWrapper> =
                    self.linearization.get_mut(*child_item).unwrap();
                child.kind = TermKind::Usage(UsageState::from(referenced_id));
            }

            if let Some(referenced_id) = referenced_id {
                self.add_usage(referenced_id, *child_item);
            }

            if defers.is_empty() && !unresolved.is_empty() {
                debug!("unresolved references: {:?}", unresolved);
                defers = mem::take(&mut unresolved);
            }
        }
    }

    pub(super) fn id_gen(&self) -> IdGen {
        IdGen::new(self.linearization.len())
    }
}

impl LinearizationState for Building {}
pub mod event_hub;
<reponame>cheme/block-ciphers
//! AES block ciphers implementation using AES-NI instruction set.
//!
//! This crate does not implement any software fallback and does not
//! automatically check CPUID, so if you are using this crate make sure to run
//! software on an appropriate hardware or to use software fallback
//! (e.g. from [`aes-soft`](https://crates.io/crates/aes-soft) crate) with
//! runtime detection of AES-NI availability (e.g. by using
//! [`cupid`](https://crates.io/crates/cupid) crate).
//!
//! When using this crate do not forget to enable `aes` target feature,
//! otherwise you will get a compilation error. You can do it either by using
//! `RUSTFLAGS="-C target-feature=+aes"` or by editing your `.cargo/config`.
//!
//! Ciphers functionality is accessed using `BlockCipher` trait from
//! [`block-cipher-trait`](https://docs.rs/block-cipher-trait) crate.
//!
//! # CTR mode
//! In addition to core block cipher functionality this crate provides optimized
//! CTR mode implementation. This functionality requires additionall `ssse3`
//! target feature and feature-gated behind `ctr` feature flag, which is enabled
//! by default. If you only need block ciphers, disable default features with
//! `default-features = false` in your `Cargro.toml`.
//!
//! AES-CTR functionality is accessed using traits from
//! [`stream-cipher`](https://docs.rs/stream-cipher) crate.
//!
//! # Vulnerability
//! Lazy FP state restory vulnerability can allow local process to leak content
//! of the FPU register, in which round keys are stored. This vulnerability
//! can be mitigated at the operating system level by installing relevant
//! patches. (i.e. keep your OS updated!) More info:
//! - [Intel advisory](https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00145.html)
//! - [Wikipedia](https://en.wikipedia.org/wiki/Lazy_FP_state_restore)
//!
//! # Usage example
//! ```
//! use aesni::block_cipher_trait::generic_array::GenericArray;
//! use aesni::block_cipher_trait::BlockCipher;
//! use aesni::Aes128;
//!
//! let key = GenericArray::from_slice(&[0u8; 16]);
//! let mut block = GenericArray::clone_from_slice(&[0u8; 16]);
//! let mut block8 = GenericArray::clone_from_slice(&[block; 8]);
//! // Initialize cipher
//! let cipher = aesni::Aes128::new(&key);
//!
//! let block_copy = block.clone();
//! // Encrypt block in-place
//! cipher.encrypt_block(&mut block);
//! // And decrypt it back
//! cipher.decrypt_block(&mut block);
//! assert_eq!(block, block_copy);
//!
//! // We can encrypt 8 blocks simultaneously using
//! // instruction-level parallelism
//! let block8_copy = block8.clone();
//! cipher.encrypt_blocks(&mut block8);
//! cipher.decrypt_blocks(&mut block8);
//! assert_eq!(block8, block8_copy);
//! ```
//!
//! # Related documents
//!
//! - [Intel AES-NI whitepaper](https://software.intel.com/


		return Err(Error::DeserializeJson);
	}

	let res = flush();
	if let Err(err) = res {
		debug_message(&format!("failed flush transaction: {:?}", err));
		return Err(Error::DeserializeJson);
	}

	let res = get_mosaic_id(&GetMosaicID {
		owner_public_key: sc.id.clone(),
		nonce: MOSAIC_NONCE,
	});
	if let Err(err) = res {
		debug_message(&format!("failed get mosaic_id: {:?}", err));
		return Err(Error::DeserializeJson);
	}

	let mosaic_id = res.unwrap();
	Ok(mosaic_id)
}

#[allow(dead_code)]
fn save_mosaic_info(supercontract_id: Cid, mosaic_id: u64) -> i64 {
	let data_bytes = serde_json::to_vec(&IcoInfo {
		supercontract_id,
		mosaic_id,
	});
	if let Err(err) = data_bytes {
		debug_message(&format!("failed serialize: {:?}", err));
		return Error::SerializeJson as i64;
	}

	let data_bytes = data_bytes.unwrap();
	let res = save_result(&ICO_MOSAIC_INFO.to_string(), &data_bytes[..]);
	if let Err(err) = res {
		debug_message(&format!("failed save result: {:?}", err));
		return FUNCTION_ERROR;
	}

	FUNCTION_RETURN_SUCCESS
}

#[no_mangle]
pub extern "C" fn ico_init() -> i64 {
	constructor(create_ico)
}

#[no_mangle]
pub extern "C" fn send(param1: i64, param2: i64, param3: i64, param4: i64, param5: i64, amount: i64) -> i64 {
	let res = get_initiator_pubkey();
	if let Err(err) = res {
		debug_message(&format!("failed get_initiator_pubkey: {:?}", err));
		return FUNCTION_ERROR;
	}
	let pk = res.unwrap();

	let mut bytes: Vec<u8> = vec![];
	let mut p1 = param1.to_le_bytes().to_vec();
	let mut p2 = param2.to_le_bytes().to_vec();
	let mut p3 = param3.to_le_bytes().to_vec();
	let mut p4 = param4.to_le_bytes().to_vec();
	let mut p5 = param5.to_le_bytes().to_vec();
	bytes.append(&mut p1);
	bytes.append(&mut p2);
	bytes.append(&mut p3);
	bytes.append(&mut p4);
	bytes.append(&mut p5);

	let res = std::str::from_utf8(&bytes);
	if let Err(err) = res {
		debug_message(&format!("failed convert address: {:?}", err));
		return FUNCTION_ERROR;
	}

	let address: &str = res.unwrap();
	debug_message(&format!("send [{:?}] to address: {:?}", amount, address));

	let res = get_supercontract();
	if let Err(err) = res {
		debug_message(&format!("failed parse ge SuperContract: {:?}", err));
		return FUNCTION_ERROR;
	}
	let sc = res.unwrap();

	// Check Token owner
	if sc.drive.owner.to_uppercase() != pk.to_uppercase() {
		debug_message(&format!("failed send token from not owner's: {:?}", pk));
		return FUNCTION_ERROR;
	}

	let res = get_mosaic_id(&GetMosaicID {
	owner_public_key: sc.id.clone(),
	nonce: MOSAIC_NONCE,
	});
	if let Err(err) = res {
	debug_message(&format!("failed get mosaic_id: {:?}", err));
	return FUNCTION_ERROR;
	}

	let mosaic


     /// <remarks>
        /// This method may be useful when patching a method body, where reusing the instruction object is favourable.
        /// This can prevent breaking any references to the instruction (e.g. branch or exception handler targets).
        /// </remarks>
        public void ReplaceWithNop() => ReplaceWith(CilOpCodes.Nop);
    }
}


(DATA_FOLDER, fname))
        tags = ['gmm_PGA', 'gmm_SA02', 'gmm_SA05', 'gmm_SA10', 'gmm_SA20']
        for gmm, subset_df in gen_data(df):
            chk(gmm, tags, subset_df, what="mea")

    def test_sigmatot(self):
        fname = 'ValidationTable_STD_full.csv'
        df = pd.read_csv(os.path.join(DATA_FOLDER, fname))
        tags = ['PGA', 'SA02', 'SA05', 'SA10', 'SA20']
        for gmm, subset_df in gen_data(df):
            chk(gmm, tags, subset_df, what="sig")

    def test_tau(self):
        fname = 'ValidationTable_STD_tau.csv'
        df = pd.read_csv(os.path.join(DATA_FOLDER, fname))
        tags = ['PGA', 'SA02', 'SA05', 'SA10', 'SA20']
        for gmm, subset_df in gen_data(df):
            chk(gmm, tags, subset_df, what="tau")

    def test_phi(self):
        fname = 'ValidationTable_STD_phi.csv'
        df = pd.read_csv(os.path.join(DATA_FOLDER, fname))
        tags = ['PGA', 'SA02', 'SA05', 'SA10', 'SA20']
        for gmm, subset_df in gen_data(df):
            chk(gmm, tags, subset_df, what="phi")


AreEqual(HttpMethod.Get, message.Method);
                Assert.AreEqual(url, message.RequestUri.AbsoluteUri);
            });

            return Helper.CreateFitbitClient(responseMessage, verification);
        }

        private void ValidateWeight(Weight weight)
        {
            Assert.IsNotNull(weight);

            Assert.AreEqual(2, weight.Weights.Count);

            var log = weight.Weights.First();
            Assert.IsNotNull(log);

            Assert.AreEqual(new DateTime(2012, 3, 5), log.Date);
            Assert.AreEqual(1330991999000, log.LogId);
            Assert.AreEqual(73f


Tree engines family: In case of repeated vertical merge the error `Cannot unlink file ColumnName.bin ... No such file or directory.` could happen. [#40346](https://github.com/ClickHouse/ClickHouse/pull/40346) ([alesapin](https://github.com/alesapin)).
* Backported in [#40533](https://github.com/ClickHouse/ClickHouse/issues/40533): Proxy resolver stop on first successful request to endpoint. [#40353](https://github.com/ClickHouse/ClickHouse/pull/40353) ([Maksim Kita](https://github.com/kitaisreal)).
* Backported in [#40625](https://github.com/ClickHouse/ClickHouse/issues/40625): Fix potential dataloss due to a bug in AWS SDK (https://github.com/aws/aws-sdk-cpp/issues/658). Bug can be triggered only when clickhouse is used over S3. [#40506](https://github.com/ClickHouse/ClickHouse/pull/40506) ([alesapin](https://github.com/alesapin)).

#### NOT FOR CHANGELOG / INSIGNIFICANT

* DNSResolver remove AI_V4MAPPED, AI_ALL hints [#40502](https://github.com/ClickHouse/ClickHouse/pull/40502) ([Maksim Kita](https://github.com/kitaisreal)).
---
sidebar_position: 1
sidebar_label: 2022
---

# 2022 Changelog

### ClickHouse release v21.10.6.2-stable FIXME as compared to v21.10.5.3-stable

#### Bug Fix
* Backported in [#32692](https://github.com/ClickHouse/ClickHouse/issues/32692): Quota limit was not reached, but the limit was exceeded. This PR fixes [#31174](https://github.com/ClickHouse/ClickHouse/issues/31174). [#31656](https://github.com/ClickHouse/ClickHouse/pull/31656) ([sunny](https://github.com/sunny19930321)).

#### Bug Fix (user-visible misbehaviour in official stable release)

* Backported in [#32680](https://github.com/ClickHouse/ClickHouse/issues/32680): Fix unexpected projection removal when detaching parts. [#32067](https://github.com/ClickHouse/ClickHouse/pull/32067) ([Amos Bird](https://github.com/amosbird)).
* Backported in [#32285](https://github.com/ClickHouse/ClickHouse/issues/32285): Dictionaries fix cases when `{condition}` does not work for custom database queries. [#32117](https://github.com/ClickHouse/ClickHouse/pull/32117) ([Maksim Kita](https://github.com/kitaisreal)).
* Backported in [#32730](https://github.com/ClickHouse/ClickHouse/issues/32730): Fix 'APPLY lambda' parsing which could lead to client/server crash. [#32138](https://github.com/ClickHouse/ClickHouse/pull/32138) ([Kruglov Pavel](https://github.com/Avogar)).
* Backported in [#32313](https://github.com/ClickHouse/ClickHouse/issues/32313): XML dictionaries identifiers, used in table create query, can be qualified to `default_database` during upgrade to newer version. Closes [#31963](https://github.com/ClickHouse/ClickHouse/issues/31963). [#32187](https://github.com/ClickHouse/ClickHouse/pull/32187) ([Maksim Kita](https://github.com/kitaisreal)).
* Backported in [#32539](https://github.com/ClickHouse/ClickHouse/issues/32539): Some replication queue entries might hang for `temporary_directories_lifetime` (1 day by default) with `Directory tmp_merge_<part_name>` or `Part ... (state Deleting) already exists, but it will be deleted soon` or similar error. It's fixed. Fixes [#29616](https://github.com/ClickHouse/ClickHouse/issues/29616). [#32201](https://github.com/ClickHouse/ClickHouse/pull/32201) ([Alexander Tokmakov](https:


	max9877_regs[MAX9877_OUTPUT_MODE] &= ~MAX9877_OSC_MASK;
	max9877_regs[MAX9877_OUTPUT_MODE] |= value;
	max9877_write_regs();
	return 1;
}

static const unsigned int max9877_pgain_tlv[] = {
	TLV_DB_RANGE_HEAD(2),
	0, 1, TLV_DB_SCALE_ITEM(0, 900, 0),
	2, 2, TLV_DB_SCALE_ITEM(2000, 0, 0),
};

static const unsigned int max9877_output_tlv[] = {
	TLV_DB_RANGE_HEAD(4),
	0, 7, TLV_DB_SCALE_ITEM(-7900, 400, 1),
	8, 15, TLV_DB_SCALE_ITEM(-4700, 300, 0),
	16, 23, TLV_DB_SCALE_ITEM(-2300, 200, 0),
	24, 31, TLV_DB_SCALE_ITEM(-700, 100, 0),
};

static const char *max9877_out_mode[] = {
	"INA -> SPK",
	"INA -> HP",
	"INA -> SPK and HP",
	"INB -> SPK",
	"INB -> HP",
	"INB -> SPK and HP",
	"INA + INB -> SPK",
	"INA + INB -> HP",
	"INA + INB -> SPK and HP",
};

static const char *max9877_osc_mode[] = {
	"1176KHz",
	"1100KHz",
	"700KHz",
};

static const struct soc_enum max9877_enum[] = {
	SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(max9877_out_mode), max9877_out_mode),
	SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(max9877_osc_mode), max9877_osc_mode),
};

static const struct snd_kcontrol_new max9877_controls[] = {
	SOC_SINGLE_EXT_TLV("MAX9877 PGAINA Playback Volume",
			MAX9877_INPUT_MODE, 0, 2, 0,
			max9877_get_reg, max9877_set_reg, max9877_pgain_tlv),
	SOC_SINGLE_EXT_TLV("MAX9877 PGAINB Playback Volume",
			MAX9877_INPUT_MODE, 2, 2, 0,
			max9877_get_reg, max9877_set_reg, max9877_pgain_tlv),
	SOC_SINGLE_EXT_TLV("MAX9877 Amp Speaker Playback Volume",
			MAX9877_SPK_VOLUME, 0, 31, 0,
			max9877_get_reg, max9877_set_reg, max9877_output_tlv),
	SOC_DOUBLE_R_EXT_TLV("MAX9877 Amp HP Playback Volume",
			MAX9877_HPL_VOLUME, MAX9877_HPR_VOLUME, 0, 31, 0,
			max9877_get_2reg, max9877_set_2reg, max9877_output_tlv),
	SOC_SINGLE_EXT("MAX9877 INB Stereo Switch",
			MAX9877_INPUT_MODE, 4, 1, 1,
			max9877_get_reg, max9877_set_reg),
	SOC_SINGLE_EXT("MAX9877 INA Stereo Switch",
			MAX9877_INPUT_MODE, 5, 1, 1,
			max9877_get_reg, max9877_set_reg),
	SOC_SINGLE_EXT("MAX9877 Zero-crossing detection Switch",
			MAX9877_INPUT_MODE, 6, 1, 0,
			max9877_get_reg, max9877_set_reg),
	SOC_SINGLE_EXT("MAX9877 Bypass Mode Switch",
			MAX9877_OUTPUT_MODE, 6, 1, 0,
			max9877_get_reg, max9877_set_reg),
	SOC_SINGLE_EXT("MAX9877 Shutdown Mode Switch",
			MAX9877_OUTPUT_MODE, 7, 1, 1,
			max9877_get_reg, max9877_set_reg),
	SOC_ENUM_EXT("MAX9877 Output Mode", max9877_enum[0],
			max9877_get_out_mode, max9877_set_out_mode),
	SOC_ENUM_EXT("MAX9877 Oscillator Mode", max9877_enum[1],
			max9877_get_osc_mode, max9877_set_osc_mode),
};

/* This function is called from ASoC machine driver */
int max9877_add_controls(struct snd_soc_codec *codec)
{
	return snd_soc_add_codec_controls(codec, max9877_controls,
			ARRAY_SIZE(max9877_controls));
}
EXPORT_SYMBOL_GPL(max9877_add_controls);

static int max9877_i2c_probe(struct i2c_client *client,
			     const struct i2c_device_id *id)
{
	i2c = client;

	max9877_write_regs();

	return 0;
}

static int max9877_i2c_remove(struct i2c_client *client)
{
	i2c = NULL;

	return 0;
}

static const struct i2c_device_id max9877_i2c_id[] = {
	{ "max9877", 0 },
	{ }
};
MODULE_DEVICE_TABLE(i2c, max9877_i2c_id);

static struct i2c_driver max9877_i2c_driver = {
	.driver = {
		.name = "max9877",
		.owner = THIS_MODULE,
	},
	.probe = max9877_i2c_probe,
	.remove = max9877_i2c_remove,
	.id_table = max9877_i2c_id,
};

module_i2c_driver(max9877_i2c_driver);

MODULE_DESCRIPTION("ASoC MAX9877 amp driver");
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
MODULE_LICENSE("GPL");


2.5|25.05|3.34",
				"|18|35|73.5|63|10.02|3.34",
				"|18|35|76.5|63|45.09|3.34",
				"|18|35|73.5|63.5|80.16|6.68",
				"|18|35|73|64.5|85.17|10.02",
				"|18|35|73.5|66|80.16|3.34",
				"|18|35|74|66.5|70.14|3.34",
				"|18|35|74.5|67|65.13|20.04",
				"|18|35|74.5|70|70.14|3.34",
				"|18|35|74.5|70.5|75.15|6.68",
				"|18|35|74|71.5|80.16|10.02",
				"|18|35|74|73|50.1|3.34",
				"|18|35|74.5|73.5|40.08|3.34"
			}
		}
	},
	[25058] = {
		["Quest"] = "Mine Disposal, the Goblin Way|2|9|1|25066|0|0",
		["Start"] = "38387|174|32|43.6|25.3",
		["End"] = "38387|174|32|43.6|25.3",
		["Objectives"] = 	{
			[1] = 		{
				"|174|35|31|34|15.03|13.36",
				"|174|35|31|36|20.04|10.02",
				"|174|35|31.5|37.5|15.03|3.34",
				"|174|35|31.5|38|20.04|3.34",
				"|174|35|32|38.5|20.04|3.34",
				"|174|35|32|39|25.05|26.72",
				"|174|35|32.5|43|20.04|6.68",
				"|174|35|32.5|44|15.03|10.02",
				"|174|35|32.5|45.5|10.02|3.34"
			}
		}
	},
	[25064] = {
		["Quest"] = "Moraya|2|3|1|24622|0|0",
		["Start"] = "38966|463|32|61.6|65.9",
		["End"] = "38005|463|32|56.8|63.7"
	},
	[25066] = {
		["Quest"] = "The Pride of Kezan|2|9|1|25098|0|0",
		["Start"] = "38387|174|32|43.6|25.3",
		["End"] = "38387|174|32|43.6|25.3",
		["Objectives"] = 	{
			[1] = 		{
				"|174|35|31|26.5|5.01|6.68",
				"|174|35|31|27.5|10.02|3.34",
				"|174|35|31|28|15.03|3.34",
				"|174|35|30.5|28.5|25.05|3.34",
				"|174|35|30|29|35.07|13.36",
				"|174|35|30|31|40.08|3.34",
				"|174|35|29.5|31.5|45.09|3.34",
				"|174|35|29|32|50.1|3.34",
				"|174|35|28.5|32.5|55.11|16.7",
				"|174|35|29|35|50.1|13.36",
				"|174|35|29|37|55.11|13.36",
				"|174|35|29.5|39|45.09|3.34",


have value for group %s, input %s" % (
                                                        groupName, inp.name)
            self.fillTemplateGroupInputs(inp, groupName, mapping)

#values = {}
#values["service"] = {}
#values["network"] = {}
#values["service"]["name"] = "OpenstackLB-app"
#values["service"]["vip"] = "10.4.15.33"
#values["service"]["port"] = "110"
#values["service"]["sfarm_name"] = "sftest"
#values["service"]["use_backup_sfarm"] = "true"
#values["service"]["backup_sfarm_name"] = "sftest-backup"
#values["service"]["sticky"] = "false"

#values["network"]["device"] = "ace30:dmitryme"
#values["network"]["vlans"] = "2"
#values["network"]["autoNat"] = "true"


eTime = 0.0

-- float GetDoorOffset()
-- Gives you the current offset of the door
function GetDoorOffset()
	return DOOR_ROOT:GetPosition().z / OPEN_DISTANCE
end

-- nil SetCurrentOffset(float)
-- Snap instantly to the given offset
function SetCurrentOffset(offset)
	targetDoorOffset = offset
	DOOR_ROOT:SetPosition(Vector3.New(0.0, 0.0, OPEN_DISTANCE * offset))
	WINCH_ROOT:SetRotation(Rotation.New(0.0, 0.0, 0.0))
end

-- nil SetTargetOffset(float)
-- Sets the offset that the door should move to (at SPEED)
function SetTargetOffset(offset)
	targetDoorOffset = offset
	local t = OPEN_DISTANCE * math.abs(targetDoorOffset - GetDoorOffset()) / SPEED
	DOOR_ROOT:MoveTo(Vector3.New(0.0, 0.0, OPEN_DISTANCE * offset), t, true)

	Task.Spawn(function()
		if offset > GetDoorOffset() then
			WINCH_ROOT:RotateContinuous(Vector3.New(0.0, SPEED / 100.0, 0.0),true)
		else
			WINCH_ROOT:RotateContinuous(Vector3.New(0.0, -SPEED / 100.0, 0.0),true)
		end

		Task.Wait(t)
		WINCH_ROOT:StopRotate()
	end)
end

-- nil ResetDoor()
-- Instantly snaps the door to the closed state
function ResetDoor()
	SetCurrentOffset(0.0)
	LEVER_ROOT:SetRotation(Rotation.New(0, 10.0, 0))
end

-- nil OpenDoor(Player)
-- Opens the door
function OpenDoor(player)
	SetTargetOffset(1.0)
	LEVER_ROOT:RotateTo(Rotation.New(0, -40, 0), 0.3, true)
	Events.Broadcast("DoorOpened", COMPONENT_ROOT)
end

-- nil CloseDoor()
-- Closes the door, even if it was only partially open
function CloseDoor()
	SetTargetOffset(0.0)
	LEVER_ROOT:RotateTo(Rotation.New(0, 10, 0), 0.3, true)
end

-- nil OnInteracted(Trigger, CoreObject)
-- Handles the player using the door if AutoOpen is false
function OnInteracted(trigger, player)
	if playerLastUseTimes[player] and playerLastUseTimes[player] + USE_DEBOUNCE_TIME > time() then
		return
	end

	playerLastUseTimes[player] = time()

	if GetDoorOffset() == 0.0 then									-- Door is closed
		OpenDoor(player)

		TRIGGER.interactionLabel = CLOSE_LABEL
	else															-- Door is open or moving, clsoe it
		CloseDoor()
	end
end

-- nil OnRoundStart()
-- Handles the roundStartEvent
function OnRoundStart()
	ResetDoor()
end

-- nil Tick(float)
-- Handle changing interaction label back to open
function Tick(deltaTime)
	if targetDoorOffset == 0.0 and GetDoorOffset() == 0.0 then
		TRIGGER.interactionLabel = OPEN_LABEL

		Events.Broadcast("DoorClosed", COMPONENT_ROOT)
	end
end

-- Initialize
TRIGGER.interactedEvent:Connect(OnInteracted)

if RESET_ON_ROUND_START then
	Game.roundStartEvent:Connect(OnRoundStart)
end


.Swap {
		if i.ToTokenID == "" {
			return ErrSwapRequiresToTokenID
		}
		if i.TokenID == i.ToTokenID {
			return ErrSwapTokenIDMustBeDifferent
		}

		if i.SlippagePercentage <= 0 {
			return ErrSwapSlippagePercentageMustBePositive
		}

		if i.AmountIn != nil &&
			i.AmountOut != nil &&
			i.AmountIn.ToInt().Cmp(walletCommon.ZeroBigIntValue()) > 0 &&
			i.AmountOut.ToInt().Cmp(walletCommon.ZeroBigIntValue()) > 0 {
			return ErrSwapAmountInAmountOutMustBeExclusive
		}

		if i.AmountIn != nil && i.AmountIn.ToInt().Sign() < 0 {
			return ErrSwapAmountInMustBePositive
		}

		if i.AmountOut != nil && i.AmountOut.ToInt().Sign() < 0 {
			return ErrSwapAmountOutMustBePositive
		}
	}

	if i.SendType.IsCommunityRelatedTransfer() {
		if i.CommunityRouteInputParams == nil {
			return ErrNoCommunityParametersProvided
		}
		return i.CommunityRouteInputParams.validateCommunityRelatedInputs(i.SendType)
	}

	return nil
}
package leaderboard

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestInitialValue(t *testing.T) {
	cache := NewPageCache()

	cachedPage := cache.GetLastPage()

	require.Equal(t, 0, cachedPage.Page)
	require.Equal(t, 0, cachedPage.PageSize)
	require.Equal(t, 0, cachedPage.SortOrder)
}

func TestUpdateCache(t *testing.T) {
	cache := NewPageCache()

	page := &LeaderboardPage{
		Page:      1,
		PageSize:  10,
		SortOrder: 2,
	}

	cache.UpdateLastPage(page)

	cachedPage := cache.GetLastPage()

	require.Equal(t, page.Page, cachedPage.Page)
	require.Equal(t, page.PageSize, cachedPage.PageSize)
	require.Equal(t, page.SortOrder, cachedPage.SortOrder)
}

func TestClearCache(t *testing.T) {
	cache := NewPageCache()

	page := &LeaderboardPage{
		Page:      1,
		PageSize:  10,
		SortOrder: 2,
	}

	cache.UpdateLastPage(page)
	cache.Clear()

	cachedPage := cache.GetLastPage()

	require.Equal(t, 0, cachedPage.Page)
	require.Equal(t, 0, cachedPage.PageSize)
	require.Equal(t, 0, cachedPage.SortOrder)
}
package leaderboard

import (
	"context"
	"testing"
	"time"

	"github.com/stretchr/testify/require"
)

func TestEmit(t *testing.T) {
	// Signal ids
	signal1ID := 10
	signal2ID := 15

	m := NewSubscriptionManager()
	chn := m.Subscribe()
	require.NotNil(t, chn)

	received := make(chan int, 3) // buffer for the 3 emits

	go func() {
		for sig := range chn {
			received <- sig.Source()
		}
	}()

	m.Emit(context.Background(), signal1ID)
	m.Emit(context.Background(), signal2ID)

	got := make(map[int]int)
	timeout := time.After(1 * time.Second)

	// Verify signal are received once
	for i := 0; i < 2; i++ {
		select {
		case src := <-received:
			got[src]++
			require.Equal(t, got[src], 1, "received signal from source %d more than once", src)
		case <-timeout:
			t.Fatal("timeout waiting for signals")
		}
	}

	// Verify all expected signals were received exactly once
	for _, expected := range []int{signal1ID, signal2ID} {
		require.Equal(t, 1, got[expected], "expected signal from source %d once, got %d", expected, got[expected])
	}
	require.Equal(t, 2,


(group: 'tag')
  Widget _buildMarkFillTag(BuildContext context) {
    return const TDTag(
      '标签文字',
      shape: TDTagShape.mark,
    );
  }

  @Demo(group: 'tag')
  Widget _buildMarkOutlineTag(BuildContext context) {
    return const TDTag(
      '标签文字',
      shape: TDTagShape.mark,
      isOutline: true,
    );
  }

  @Demo(group: 'tag')
  Widget _buildIconFillTag(BuildContext context) {
    return const TDTag(
      '标签文字',
      icon: TDIcons.discount,
    );
  }

  @Demo(group: 'tag')
  Widget _buildIconOutlineTag(BuildContext context) {
    return const TDTag(
      '标签文字',
      icon: TDIcons.discount,
      isOutline: true,
    );
  }

  @Demo(group: 'tag')
  Widget _buildCloseFillTag(BuildContext context) {
    return TDTag(
      '标签文字',
      needCloseIcon: true,
      onCloseTap: () {
        TDToast.showText('点击关闭', context: context);
      },
    );
  }

  @Demo(group: 'tag')
  Widget _buildCloseOutlineTag(BuildContext context) {
    return TDTag('标签文字', needCloseIcon: true, isOutline: true, onCloseTap: () {
      TDToast.showText('点击关闭', context: context);
    });
  }

  @Demo(group: 'tag')
  Widget _buildDarkSelectTags(BuildContext context) {
    return const Wrap(spacing: 8, children: [
      TDSelectTag(
        '未选中态',
        theme: TDTagTheme.primary,
      ),
      TDSelectTag(
        '已选中态',
        theme: TDTagTheme.primary,
        isSelected: true,
      ),
      TDSelectTag(
        '不可选态',
        theme: TDTagTheme.primary,
        disableSelect: true,
      ),
    ]);
  }

  @Demo(group: 'tag')
  Widget _buildLightSelectTags(BuildContext context) {
    return const Wrap(spacing: 8, children: [
      TDSelectTag(
        '未选中态',
        theme: TDTagTheme.primary,
        isLight: true,
      ),
      TDSelectTag(
        '已选中态',
        theme: TDTagTheme.primary,
        isLight: true,
        isSelected: true,
      ),
      TDSelectTag(
        '不可选态',
        theme: TDTagTheme.primary,
        isLight: true,
        disableSelect: true,
      ),
    ]);
  }

  @Demo(group: 'tag')
  Widget _buildOutlineSelectTags(BuildContext context) {
    return const Wrap(spacing: 8, children: [
      TDSelectTag(
        '未选中态',
        theme: TDTagTheme.primary,
        isOutline: true,
      ),
      TDSelectTag(
        '已选中态',
        theme: TDTagTheme.primary,
        isOutline: true,
        isSelected: true,
      ),
      TDSelectTag(
        '不可选态',
        theme: TDTagTheme.primary,
        isOutline: true,
        disableSelect: true,
      ),
    ]);
  }

  @Demo(group: 'tag')
  Widget _buildLightOutlineSelectTags(BuildContext context) {
    return const Wrap(spacing: 8, children: [
      TDSelectTag(
        '未选中态',
        theme: TDTagTheme.primary,
        isOutline: true,
        isLight: true,
      ),
      TDSelectTag(
        '已选中态',
        theme: TDTagTheme.primary,
        isOutline: true,
        isLight: true,
        isSelected: true,
      ),
      TDSelectTag(
        '不可选态',
        theme: TDTagTheme.primary,
        isOutline: true,
        isLight: true,
        disableSelect: true,
      ),
    ]);
  }

  @Demo(group: 'tag')
  Widget _buildLightShowTags(BuildContext context) {
    return const Wrap(
      spacing: 8,
      children: [
        TDTag('默认', isLight: true),
        TDTag(
          '主要',
          isLight: true,
          theme: TDTagTheme.primary,
        ),
        TDTag(
          '警告',
          isLight: true,
          theme: TDTagTheme.warning,
        ),
        TDTag(
          '危险',
          isLight: true


        bottom: Padding(
          padding: EdgeInsets.all(16.0),
          child: MacosListTile(
            onClick: () => showMacosAlertDialog(
              barrierDismissible: true,
              useRootNavigator: false,
              context: context,
              builder: (context) => MacosAlertDialog(
                appIcon: Image.asset(
                  "images/app_icon.png",
                  width: 64,
                  height: 64,
                ),
                title: Text(
                  'Mars Xlog Decoder Tool',
                ),
                message: Text(
                  'Copyright © Jerryfans 2022',
                ),
                //horizontalActions: false,
                primaryButton: PushButton(
                  buttonSize: ButtonSize.large,
                  child: const Text('确定'),
                  onPressed: Navigator.of(context).pop,
                ),
              ),
            ),
            leading: Image.asset(
              "images/app_icon.png",
              width: 32,
              height: 32,
            ),
            title: Text(
              'Xlog Decoder Tool',
            ),
            subtitle: Text('Copyright © Jerryfans'),
          ),
        ),
        builder: (context, controller) {
          return SidebarItems(
            currentIndex: pageIndex,
            onChanged: (i) => setState(() => pageIndex = i),
            scrollController: controller,
            items: [
              SidebarItem(
                leading: MacosIcon(
                    CupertinoIcons.rectangle_fill_on_rectangle_angled_fill),
                label: Text('Xlog Decode'),
              ),
            ],
          );
        },
      ),
    );
  }
}
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:io' show Directory, Platform;

import 'package:flutter/foundation.dart' show kIsWeb, visibleForTesting;
import 'package:path_provider_linux/path_provider_linux.dart';
import 'package:path_provider_platform_interface/path_provider_platform_interface.dart';
// ignore: implementation_imports
import 'package:path_provider_platform_interface/src/method_channel_path_provider.dart';
import 'package:path_provider_windows/path_provider_windows.dart';

export 'package:path_provider_platform_interface/path_provider_platform_interface.dart'
    show StorageDirectory;

@visibleForTesting
@Deprecated('This is no longer necessary, and is now a no-op')
set disablePathProviderPlatformOverride(bool override) {}

bool _manualDartRegistrationNeeded = true;

/// An exception thrown when a directory that should always be available on
/// the current platform cannot be obtained.
class MissingPlatformDirectoryException implements Exception {
  /// Creates a new exception
  MissingPlatformDirectoryException(this.message, {this.details});

  /// The explanation of the exception.
  final String message;

  /// Added details, if any.
  ///
  /// E.g., an error object from the platform implementation.
  final Object? details;

  @override
  String toString() {
    final String detailsAddition = details == null ? '' : ': $details';
    return 'MissingPlatformDirectoryException($message)$detailsAddition';
  }
}

PathProviderPlatform get _platform {
  // TODO


Bouton '50 en plus' non trouvé via JavaScript")
                except Exception as js_error:
                    self.logger.error(f"Erreur lors de la tentative JavaScript: {js_error}")
                    break

        # Créer une nouvelle réponse à partir du contenu de la page après les clics
        self.logger.info("Extraction des données de la page mise à jour")
        updated_response = HtmlResponse(
            url=response.url,
            body=self.driver.page_source.encode('utf-8'),
            encoding='utf-8'
        )

        # Extraction des films avec la page mise à jour
        films = updated_response.css('.ipc-metadata-list-summary-item')
        self.logger.info(f"Nombre de films trouvés: {len(films)}")

        for i, film in enumerate(films, 1):
            try:
                self.logger.info(f"Traitement du film {i}")
                item = self.extract_film_info(film)
                if item:
                    yield item
            except Exception as e:
                self.logger.error(f"Erreur lors du traitement du film {i}: {e}")

    def extract_film_info(self, film):
        try:
            # Extraction avec des sélecteurs plus robustes
            title = film.css('h3.ipc-title__text::text').get()
            if title:
                title = title.strip()
                # Supprimer les numéros au début (ex: "1. Film Title")
                title = re.sub(r'^\d+\.\s*', '', title)

            url = film.css('a.ipc-title-link-wrapper::attr(href)').get().split('/?')[0]
            if url:
                url = "https://www.imdb.com" + url

            # Extraction des métadonnées
            metadata_items = film.css('.dli-title-metadata-item::text').getall()
            year = metadata_items[0].strip() if len(metadata_items) > 0 else None
            time = metadata_items[1].strip() if len(metadata_items) > 1 else None

            resume = film.css('.ipc-html-content-inner-div::text').get()
            if not resume:
                resume = film.css('.ipc-html-content-inner-div p::text').get()

            score = film.css('.ipc-rating-star--imdb::text').get()
            if score:
                score = score.strip()

            item = {
                'title': title,
                'year': year,
                'time': time,
                'resume': resume,
                'metascore': score,
                'url': url,
            }
            return item
        except Exception as e:
            self.logger.error(f"Erreur lors de l'extraction des informations du film : {e}")
            return None

    def closed(self, reason):
        # Fermer le navigateur à la fin
        self.driver.quit()


[3, -1, 0, 100, -7, 2], [2, 1, 1, 3]);
    tf.test_util.expectArraysEqual(
        await tf.argMax(a).data(), new Float32Array([1, 0, 1]));
  });

  it('2D, axis=0', async () => {
    const a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]);
    const r = tf.argMax(a, 0);

    expect(r.shape).toEqual([3]);
    expect(r.dtype).toBe('int32');
    tf.test_util.expectArraysEqual(await r.data(), new Float32Array([1, 0, 1]));
  });

  it('2D, axis=1', async () => {
    const a = tf.tensor2d([3, 2, 5, 100, -7, 2], [2, 3]);
    const r = tf.argMax(a, 1);
    expect(r.shape).toEqual([2]);
    expect(r.dtype).toBe('int32');
    tf.test_util.expectArraysEqual(await r.data(), new Float32Array([2, 0]));
  });

  it('2D, axis = -1', async () => {
    const a = tf.tensor2d([3, 2, 5, 100, -7, 2], [2, 3]);
    const r = tf.argMax(a, -1);
    expect(r.dtype).toBe('int32');
    tf.test_util.expectArraysEqual(await r.data(), new Float32Array([2, 0]));
  });

  it('throws when passed a non-tensor', () => {
    expect(() => tf.argMax({} as tf.Tensor))
        .toThrowError(/Argument 'x' passed to 'argMax' must be a Tensor/);
  });

  it('accepts a tensor-like object', async () => {
    const result = tf.argMax([1, 0, 3, 2]);
    expect(result.dtype).toBe('int32');
    tf.test_util.expectArraysEqual(await result.data(), new Float32Array([2]));
  });

  it('throws error for string tensor', () => {
    expect(() => tf.argMax(['a']))
        .toThrowError(/Argument 'x' passed to 'argMax' must be numeric tensor/);
  });
});

describe('Reduction: argmin', () => {
  beforeAll(async () => tfwebgpu.ready);

  it('Tensor1D', async () => {
    const a = tf.tensor1d([1, 0, 3, 2]);
    const result = tf.argMin(a);
    tf.test_util.expectArraysEqual(await result.data(), new Float32Array([1]));
  });

  it('one value', async () => {
    const a = tf.tensor1d([10]);
    const result = tf.argMin(a);
    tf.test_util.expectArraysEqual(await result.data(), new Float32Array([0]));
  });

  it('1D large', async () => {
    const n = 250000;
    const values = randomFloats(n);
    const argmin = computeArgMinMax(Array.from(values), 'min');

    const a = tf.tensor1d(values);
    const result = tf.argMin(a);
    expect(result.dtype).toBe('int32');
    tf.test_util.expectArraysEqual(
        await result.data(), new Float32Array([argmin]));
  });

  it('4D large, axis = 3', async () => {
    const n = 250000;
    const values = randomFloats(n);
    const argmin = computeArgMinMax(Array.from(values), 'min');

    const a = tf.tensor4d(values, [1, 1, 1, n]);
    const result