using System;
using System.Collections.Generic;
using System.Linq;
using Pulsar4X.Engine;
using Pulsar4X.Interfaces;

namespace Pulsar4X.People
{
    public class NavalAcademyProcessor : IInstanceProcessor
    {
        internal override void ProcessEntity(Entity entity, DateTime atDateTime)
        {
            if(!entity.TryGetDatablob<NavalAcademyDB>(out var academyDB)) return;

            var academy = academyDB.Academies.Where(a => a.GraduationDate.Date == atDateTime.Date).First();
            var generator = new GaussianRandom();

            // Graduate the class
            for(int i = 0; i < academy.ClassSize; i++)
            {
                var commanderDB = CommanderFactory.CreateAcademyGraduate(entity.Manager.Game);

                // Set the officers commission date and rank date
                commanderDB.CommissionedOn = entity.StarSysDateTime.Date;
                commanderDB.RankedOn = entity.StarSysDateTime.Date;

                // Generate an experience cap for the graduate on a bell curve from 0-200
                // Modify the default mean (100) by the length of training
                // 1 month = mean of 77
                // 48 months = mean of 124
                double mean = 100 + (academy.TrainingPeriodInMonths - 24);
                commanderDB.ExperienceCap = generator.NextBellCurve(entity.Manager.Game.RNG, 0, 200, mean, 33.333);

                // Only give starting experience to graduates with some potential
                if(commanderDB.Expe


         <FacebookPixel>
                    <DefaultSeo
                        openGraph={{
                            type: 'website'
                        }}
                        twitter={{
                            handle  : '@handle',
                            site    : '@site',
                            cardType: 'summary_large_image',
                        }}
                    />
                    { stateModuleHook }
                    <Component {...pageProps} />
                </FacebookPixel>
            </GenericHoc>
        </Provider>
    );
};

export default AquilaTheme;
import absoluteUrl                      from 'next-absolute-url';
import useTranslation                   from 'next-translate/useTranslation';
import ErrorPage                        from '@pages/_error';
import Layout                           from '@components/layouts/Layout';
import NextSeoCustom                    from '@components/tools/NextSeoCustom';
import BlockCMS                         from '@components/common/BlockCMS';
import { dispatcher }                   from '@lib/redux/dispatcher';
import { getPageStatic }                from '@aquilacms/aquila-connector/api/static';
import { getBlocksCMS }                 from '@aquilacms/aquila-connector/api/blockcms';
import { useStaticPage, useSiteConfig } from '@lib/hooks';
import { initAxios }                    from '@lib/utils';

export async function getServerSideProps({ locale, params, query, req, res }) {
    initAxios(locale, req, res);

    let staticPage = {};
    try {
        staticPage = await getPageStatic(params.staticSlug, query.preview, locale);
    } catch (err) {
        return { notFound: true };
    }

    // Get URLs for language change
    const urlsLanguages = [];
    if (staticPage) {
        for (const [lang, sl] of Object.entries(staticPage.slug)) {
            urlsLanguages.push({ lang, url: `/${sl}` });
        }
    }

    const actions = [
        {
            type: 'PUSH_CMSBLOCKS',
            func: getBlocksCMS.bind(this, ['bottom-parallax'], locale)
        }, {
            type : 'SET_STATICPAGE',
            value: staticPage
        }, {
            type : 'SET_URLS_LANGUAGES',
            value: urlsLanguages
        }
    ];

    const pageProps = await dispatcher(locale, req, res, actions);

    // URL origin
    const { origin }       = absoluteUrl(req);
    pageProps.props.origin = origin;
    return pageProps;
}

export default function StaticPage({ error, origin }) {
    const { staticPage }  = useStaticPage();
    const { environment } = useSiteConfig();
    const { lang }        = useTranslation();

    if (error || !staticPage._id) {
        return (<ErrorPage statusCode={404} />);
    }

    return (
        <Layout>
            <NextSeoCustom
                title={`${environment?.siteName} - ${staticPage.title}`}
                description={staticPage.metaDesc}
                canonical={`${origin}/${staticPage.slug[lang]}`}
                lang={lang}
                image={`${origin}/images/medias/max-100/605363104b9ac91f54fcabac/Logo.jpg`}
            />

            <BlockCMS content={staticPage.content} />

            <BlockCMS nsCode="bottom-parallax" />
        </Layout>
    );
}
import parse                     from 'html-react-parser';
import absoluteUrl               from 'next-absolute-url';
import getT                      from 'next-translate/getT';
import useTranslation            from 'next-translate/useTranslation';
import Link                      from 'next/link';
import { useRouter }             from 'next/router';
import Breadcrumb                from '@components/


重引用符",
	bdquo:"二重下付き右引用符",
	dagger:"剣標",
	Dagger:"二重剣標",
	permil:"パーミル記号",
	lsaquo:"単一左角引用符",
	rsaquo:"単一右角引用符",
	euro:"ユーロ記号"
})

//end v1.x content
);
//>>built
define(
//begin v1.x content
({
	/* These are already handled in the default RTE
		amp:"ampersand",lt:"less-than sign",
		gt:"greater-than sign",
		nbsp:"no-break space\nnon-breaking space",
		quot:"quote",
	*/
	iexcl:"signe d'exclamació obert",
	cent:"signe de cèntims",
	pound:"signe de lliura",
	curren:"signe de moneda",
	yen:"signe de ien\nsigne de iuan",
	brvbar:"barra partida\nbarra vertical partida",
	sect:"signe de secció",
	uml:"dièresi\ndièresi d'espai",
	copy:"signe de copyright",
	ordf:"indicador ordinal femení",
	laquo:"cometes llatines apuntant cap a l'esquerra\ncometes llatines cap a l'esquerra",
	not:"signe de negació",
	shy:"guió tou\nguió opcional",
	reg:"signe de registrat\nsigne de marca comercial registrada",
	macr:"macron\nmacron d'espaiat\nsobre-ratllat\nguió alt",
	deg:"signe de graus",
	plusmn:"signe de més-menys\nsigne de més-o-menys",
	sup2:"dos en superíndex\nnúmero dos en superíndex\nal quadrat",
	sup3:"tres en superíndex\nnúmero tres en superíndex\nal cub",
	acute:"accent agut\nespaiat agut",
	micro:"signe de micro",
	para:"signe de paràgrafn\nsigne de canvi de paràgraf",
	middot:"punt volat\ncoma georgiana\npunt volat grec",
	cedil:"ce trencada\nespai de ce trencada",
	sup1:"ú en superíndex\nnúmero ú en superíndex",
	ordm:"indicador d'ordinal masculí",
	raquo:"cometes llatines apuntant cap a la dreta\ncometes llatines cap a la dreta",
	frac14:"fracció vulgar d'un quart\nfracció d'un quart",
	frac12:"fracció vulgar de meitat\nfracció d'un mig",
	frac34:"fracció vulgar de tres quarts\nfracció de tres quarts",
	iquest:"signe d'interrogació obert\ninterrogació oberta",
	Agrave:"lletra llatina A majúscula amb accent greu\nA majúscula amb accent greu",
	Aacute:"lletra llatina A majúscula amb accent agut\nA majúscula amb accent agut",
	Acirc:"lletra llatina A majúscula amb circumflex\nA majúscula amb circumflex",
	Atilde:"lletra llatina A majúscula amb titlla",
	Auml:"lletra llatina A majúscula amb dièresi",
	Aring:"lletra llatina A majúscula amb anell al damunt\nA majúscula amb anell",
	AElig:"lletra llatina AE majúscula\n Lligatura llatina AE majúscula",
	Ccedil:"lletra llatina C trencada majúscula",
	Egrave:"lletra llatina E majúscula amb accent greu",
	Eacute:"l


7frgQngnRCXuz:
nop
.text
.weak b__MAFg3__16irpgbeVoAF_9nyybpngbeVoRRR18__pbafgehpg_ng_raqVAF_14__ovg_vgrengbeVF3_Yo1RYz0RRRRRAF_9ranoyr_vsVKfe21__vf_sbejneq_vgrengbeVG_RR5inyhrRiR4glcrRF8_F8_
.type b__MAFg3__16irpgbeVoAF_9nyybpngbeVoRRR18__pbafgehpg_ng_raqVAF_14__ovg_vgrengbeVF3_Yo1RYz0RRRRRAF_9ranoyr_vsVKfe21__vf_sbejneq_vgrengbeVG_RR5inyhrRiR4glcrRF8_F8_,%function
b__MAFg3__16irpgbeVoAF_9nyybpngbeVoRRR18__pbafgehpg_ng_raqVAF_14__ovg_vgrengbeVF3_Yo1RYz0RRRRRAF_9ranoyr_vsVKfe21__vf_sbejneq_vgrengbeVG_RR5inyhrRiR4glcrRF8_F8_:
nop
.text
.globl b__MA7naqebvq19VCebprffVasbFreivprQ0Ri
.type b__MA7naqebvq19VCebprffVasbFreivprQ0Ri,%function
b__MA7naqebvq19VCebprffVasbFreivprQ0Ri:
nop
.text
.weak b__MAX7naqebvq6IrpgbeVAF_8Fgevat16RR12qb_pbafgehpgRCiz
.type b__MAX7naqebvq6IrpgbeVAF_8Fgevat16RR12qb_pbafgehpgRCiz,%function
b__MAX7naqebvq6IrpgbeVAF_8Fgevat16RR12qb_pbafgehpgRCiz:
nop
.text
.weak b__MAX7naqebvq6IrpgbeVAF_8OcOvaqre8BovghnelRR12qb_pbafgehpgRCiz
.type b__MAX7naqebvq6IrpgbeVAF_8OcOvaqre8BovghnelRR12qb_pbafgehpgRCiz,%function
b__MAX7naqebvq6IrpgbeVAF_8OcOvaqre8BovghnelRR12qb_pbafgehpgRCiz:
nop
.text
.globl b__MAX7naqebvq12OcZrzbelUrnc18nffregErnyylZnccrqRi
.type b__MAX7naqebvq12OcZrzbelUrnc18nffregErnyylZnccrqRi,%function
b__MAX7naqebvq12OcZrzbelUrnc18nffregErnyylZnccrqRi:
nop
.data
.globl b__MGPA7naqebvq8OcZrzbelR0_AF_10VVagresnprR
.type b__MGPA7naqebvq8OcZrzbelR0_AF_10VVagresnprR,%object
b__MGPA7naqebvq8OcZrzbelR0_AF_10VVagresnprR:
.space __SIZEOF_POINTER__
.data
.globl b__MGPA7naqebvq22OaZrqvnErfbheprZbavgbeR8_AF_7VOvaqreR
.type b__MGPA7naqebvq22OaZrqvnErfbheprZbavgbeR8_AF_7VOvaqreR,%object
b__MGPA7naqebvq22OaZrqvnErfbheprZbavgbeR8_AF_7VOvaqreR:
.s


on
        else return 0
    }

    /**
   * Odczyt stanu czujnikow lini wartosci 0,1,10,11
   */
    //% block
    //% weight = 10
    export function CzujnikiLini(): number {
        GetLineSensors()
        return LineSensors
    }

    /**
    * Odczyt stanu czujnika lini prawej True - dla białego podłoża
    */
    //% block
    //% weight = 10
    export function LiniaPrawa(): boolean {
        GetLineSensors()
        return ((LineSensors % 10) == 1)
    }

    /**
    * Odczyt stanu czujnika lini lewej True - dla białego podłoża
    */
    //% block
    //% weight = 10
    export function LiniaLewa(): boolean {
        GetLineSensors()
        return ((LineSensors % 10) == 0)
    }

    /**
 * Odczyt stanu czujnika lini o zadanym numerze
 */
    //% block
    //% weight = 15
    //% CzujnikNo.min=1 CzujnikNo.max=5
    export function StanLini(CzujnikNo: number = 1): number {
        GetLineSensors()
        if (CzujnikNo < 6) return Math.idiv(LineSensors, Math.pow(10, CzujnikNo - 1)) % 10
        else return 0
    }

    /**
  * Odczyt stanu ruchu robota
  */
    //% block
    //% weight = 10
    export function CzyWRuchu(): boolean {
        return Running
    }

    function SendDspVal(DspType: string, DspVal: string) {
        let SendStr = DspType + DspVal
        radio.sendString(SendStr)
    }

    /**
    * Wyswietlenie napisu na ekranie
    */
    //% block
    //% weight = 100
    export function WyswietlNapis(DspVal: string) {
        SendDspVal(CMD_DISPSTR, DspVal)
    }

    /**
  * Wyswietlenie liczby na ekranie
  */
    //% block
    //% weight = 100
    export function WyswietlLiczbe(DspVal: number) {
        SendDspVal(CMD_DISPSTR, DspVal.toString())
    }

    function EncodeImage(Img: string): string {
        let len = Img.length
        let RetImg = ""
        let EncVal = 0
        let count = 0
        for (let i = 0; i < len; i++) {

            let pix = Img.charAt(i)
            if (pix != " ") count++
            if (pix != "0" && pix != ".") EncVal = EncVal + 1
            if (count != 5) EncVal = EncVal * 2
            else {
                if (EncVal < 10) RetImg = RetImg + "0" + EncVal.toString()
                else RetImg = RetImg + EncVal.toString()
                EncVal = 0
                count = 0
            }
            // console.logValue("x", EncVal)
        }
        if (count != 0) {
            if (EncVal < 10) RetImg = RetImg + "0" + EncVal.toString()
            else RetImg = RetImg + EncVal.toString()
        }
        return RetImg

    }

    /**
     * Wyswietlenie obrazka zakodowanego np. "10001 11111 00001 10101 11011"
     */
    //% block
    //% weight = 100
    export function WyswietlObraz(DspVal: string = "10001 11111 00001 10101 11011") {
        SendDspVal(CMD_DSPLED, EncodeImage(DspVal))
    }

    /**
     * Wyswietlenie ikony
    */
    //% block
    //% weight=100
    export function WyswietlIkone(DspVal: IconNames = IconNames.Heart) {
        radio


, r1
	strh lr, [ip, #0x3e]
	ldr ip, [r3]
	ldrh lr, [r0, #0x14]
	add ip, ip, r1
	strh lr, [ip, #0x40]
	ldr ip, [r3]
	ldrh lr, [r0, #0x16]
	add ip, ip, r1
	strh lr, [ip, #0x42]
	ldrh ip, [r0, #0x18]
	ldr r3, [r3]
	mov r0, r2
	add r1, r3, r1
	strh ip, [r1, #0x44]
	ldmia sp!, {r4, pc}
_02314EE0:
	add r2, r2, #1
_02314EE4:
	cmp r2, #0x40
	blt _02314E38
	mov r0, #0xff
	ldmia sp!, {r4, pc}
	.align 2, 0
_02314EF4: .word ov11_02324E34
	arm_func_end ov11_02314E20

	arm_func_start ov11_02314EF8
ov11_02314EF8: ; 0x02314EF8
	stmdb sp!, {r4, r5, r6, lr}
	ldr r2, _02314FF4 ; =ov11_02324E34
	mov ip, #0
	ldr r5, [r2]
	mov r2, #0x28
	b _02314FE4
_02314F10:
	mul r3, ip, r2
	add r6, r5, r3
	ldrh r4, [r6, #0x2c]
	cmp r4, #0xff
	bne _02314FE0
	ldrh r5, [r0]
	ldr r4, _02314FF4 ; =ov11_02324E34
	and r2, r1, #0x1f
	strh r5, [r6, #0x2c]
	ldr r6, [r0, #4]
	ldr r5, [r4]
	add r6, r6, r2, lsl #12
	add r5, r5, r3
	str r6, [r5, #0x30]
	ldr r5, [r0, #8]
	mov lr, #0x1c00
	mla r6, r2, lr, r5
	ldr r2, [r4]
	mov r5, r1, lsl #0x1c
	add r2, r2, r3
	str r6, [r2, #0x34]
	ldr r6, [r0, #0xc]
	ldr r2, [r4]
	add r6, r6, r1
	and r6, r6, #1
	add r2, r2, r3
	str r6, [r2, #0x38]
	ldrh r6, [r0, #0x10]
	ldr lr, [r4]
	mov r2, r1, lsl #0x1b
	add r5, r6, r5, lsr #21
	add r1, lr, r3
	strh r5, [r1, #0x3c]
	ldrh lr, [r0, #0x12]
	ldr r1, [r4]
	add r2, lr, r2, lsr #21
	add r1, r1, r3
	strh r2, [r1, #0x3e]
	ldr r1, [r4]
	ldrh r2, [r0, #0x14]
	add r1, r1, r3
	strh r2, [r1, #0x40]
	ldr r1, [r4]
	ldrh r2, [r0, #0x16]
	add r1, r1, r3
	strh r2, [r1


: false);
  @override
  List<GeneratedColumn> get $columns => [
        id,
        idNfeCabecalho,
        indicadorPagamento,
        meioPagamento,
        valor,
        tipoIntegracao,
        cnpjOperadoraCartao,
        bandeira,
        numeroAutorizacao,
        troco
      ];
  @override
  String get aliasedName => _alias ?? actualTableName;
  @override
  String get actualTableName => $name;
  static const String $name = 'NFE_INFORMACAO_PAGAMENTO';
  @override
  VerificationContext validateIntegrity(
      Insertable<NfeInformacaoPagamento> instance,
      {bool isInserting = false}) {
    final context = VerificationContext();
    final data = instance.toColumns(true);
    if (data.containsKey('ID')) {
      context.handle(_idMeta, id.isAcceptableOrUnknown(data['ID']!, _idMeta));
    }
    if (data.containsKey('ID_NFE_CABECALHO')) {
      context.handle(
          _idNfeCabecalhoMeta,
          idNfeCabecalho.isAcceptableOrUnknown(
              data['ID_NFE_CABECALHO']!, _idNfeCabecalhoMeta));
    }
    if (data.containsKey('INDICADOR_PAGAMENTO')) {
      context.handle(
          _indicadorPagamentoMeta,
          indicadorPagamento.isAcceptableOrUnknown(
              data['INDICADOR_PAGAMENTO']!, _indicadorPagamentoMeta));
    }
    if (data.containsKey('MEIO_PAGAMENTO')) {
      context.handle(
          _meioPagamentoMeta,
          meioPagamento.isAcceptableOrUnknown(
              data['MEIO_PAGAMENTO']!, _meioPagamentoMeta));
    }
    if (data.containsKey('VALOR')) {
      context.handle(
          _valorMeta, valor.isAcceptableOrUnknown(data['VALOR']!, _valorMeta));
    }
    if (data.containsKey('TIPO_INTEGRACAO')) {
      context.handle(
          _tipoIntegracaoMeta,
          tipoIntegracao.isAcceptableOrUnknown(
              data['TIPO_INTEGRACAO']!, _tipoIntegracaoMeta));
    }
    if (data.containsKey('CNPJ_OPERADORA_CARTAO')) {
      context.handle(
          _cnpjOperadoraCartaoMeta,
          cnpjOperadoraCartao.isAcceptableOrUnknown(
              data['CNPJ_OPERADORA_CARTAO']!, _cnpjOperadoraCartaoMeta));
    }
    if (data.containsKey('BANDEIRA')) {
      context.handle(_bandeiraMeta,
          bandeira.isAcceptableOrUnknown(data['BANDEIRA']!, _bandeiraMeta));
    }
    if (data.containsKey('NUMERO_AUTORIZACAO')) {
      context.handle(
          _numeroAutorizacaoMeta,
          numeroAutorizacao.isAcceptableOrUnknown(
              data['NUMERO_AUTORIZACAO']!, _numeroAutorizacaoMeta));
    }
    if (data.containsKey('TROCO')) {
      context.handle(
          _trocoMeta, troco.isAcceptableOrUnknown(data['TROCO']!, _trocoMeta));
    }
    return context;
  }

  @override
  Set<GeneratedColumn> get $primaryKey => {id};
  @override
  NfeInformacaoPagamento map(Map<String, dynamic> data, {String? tablePrefix}) {
    final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
    return NfeInformacaoPagamento(
      id: attachedDa


;padding:10px}.ax-body.frame-set #ax-frame-root .ax-frame-header .cell-aside-handle i{background:#788694;color:#fff;display:block;height:30px;line-height:30px;width:30px;font-size:20px}.ax-body.frame-set #ax-frame-root .ax-frame-header .cell-logo{height:50px;width:170px}.ax-body.frame-set #ax-frame-root .ax-frame-header #ax-top-menu{padding-left:10px}.ax-body.frame-set #ax-frame-root .ax-frame-header #ax-fullscreen-handel .icon-closed{display:block}.ax-body.frame-set #ax-frame-root .ax-frame-header #ax-fullscreen-handel .icon-opened{display:none}.ax-body.frame-set #ax-frame-root .ax-frame-header #ax-fullscreen-handel i{background:#F1F1F1;color:#2B3A48}.ax-body.frame-set #ax-frame-root .ax-frame-header-tab{-webkit-animation:SLIDE-DOWN 0.3s ease-in-out forwards;-o-animation:SLIDE-DOWN 0.3s ease-in-out forwards;animation:SLIDE-DOWN 0.3s ease-in-out forwards;z-index:1;position:absolute;top:80px;left:0;width:100%;height:30px;background-color:#B5B6B6;background-image:-webkit-linear-gradient(top, #B5B6B6,#B5B6B6);background-image:linear-gradient(to bottom,#B5B6B6,#B5B6B6);border-bottom:1px solid #636363}.ax-body.frame-set #ax-frame-root .ax-frame-header-tab #ax-frame-header-tab-container{height:100%}.ax-body.frame-set #ax-frame-root .ax-frame-header-tab #ax-frame-header-tab-container:before{display:block;content:' ';position:absolute;left:0;bottom:0px;height:4px;width:100%;background:#3DACFC;border-top:1px solid #636363;box-sizing:border-box}.ax-body.frame-set #ax-frame-root .ax-frame-header-tab #ax-frame-header-tab-container .tab-item-holder{display:table;table-layout:fixed}.ax-body.frame-set #ax-frame-root .ax-frame-header-tab #ax-frame-header-tab-container .tab-item{cursor:pointer;position:relative;box-sizing:border-box;display:table-cell;box-sizing:border-box;height:26px;line-height:23px;min-width:120px;padding:0 10px;padding-right:22px;border-right:1px solid #636363;border-bottom:1px solid #636363;color:#000;font-size:0.9em;margin:0 1px;background-color:#ddd;background-image:-webkit-linear-gradient(top, #ddd,#ddd);background-image:linear-gradient(to bottom,#ddd,#ddd)}.ax-body.frame-set #ax-frame-root .ax-frame-header-tab #ax-frame-header-tab-container .tab-item span[data-toggle="tooltip"]{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ax-body.frame-set #ax-frame-root .ax-frame-header-tab #ax-frame-header-tab-container .tab-item i[data-tab-close]{position:absolute;right:0px;top:0px;height:25px;line-height:25px;width:25px;text-align:center}.ax-body.frame-set #ax-frame-root .ax-frame-header-tab #ax-frame-header-tab-container .tab-item.on{background-color:#3DACFC;background-image:-webkit-linear-


Mesh>(anIter.Key());
    if (!aSubMesh->_is_nil())
    {
      if (aSubMesh->GetFather()->GetId() == myMesh->GetId())
      {
        SMESH::smIdType_array_var anIds =
          theType == SMESH::NODE ? aSubMesh->GetNodesId() : aSubMesh->GetElementsId();
        for (int i = 0, n = anIds->length(); i < n; i++)
          aToBeFiltered.Add(FromSmIdType<int>(anIds[ i ]));
      }
    }

    // process group
    SMESH::SMESH_GroupBase_var aGroup =
      SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(anIter.Key());
    if (!aGroup->_is_nil())
    {
      if (aGroup->GetType() == theType && aGroup->GetMesh()->GetId() == myMesh->GetId())
      {
        SMESH::smIdType_array_var anIds = aGroup->GetListOfID();
        for (int i = 0, n = anIds->length(); i < n; i++)
          aToBeFiltered.Add(FromSmIdType<int>(anIds[ i ]));
      }
    }

    // process mesh
    SMESH::SMESH_Mesh_var aMeshPtr = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIter.Key());
    if (!aMeshPtr->_is_nil() && aMeshPtr->GetId() == myMesh->GetId())
    {
      const SVTK_TIndexedMapOfVtkId& aSelMap = anIter.Value();

      if (aSelMap.Extent() > 0)
      {
        if(SMESH::FindActorByEntry(anIter.Key()->getEntry()))
        {
          for (int i = 1; i <= aSelMap.Extent(); i++)
            aToBeFiltered.Add(aSelMap(i));
        }
      }
    }
  }

  // Filter entities
  SMESH::Predicate_ptr aPred = myFilter[ theType ]->GetPredicate();
  myFilter[ theType ]->SetMesh(myMesh);
  TColStd_MapIteratorOfMapOfInteger aResIter(aToBeFiltered);
  for ( ; aResIter.More(); aResIter.Next())
    if (aPred->IsSatisfy(aResIter.Key()))
      theResIds.append(aResIter.Key());
}

//=======================================================================
//function : getActor
//purpose  : Returns an actor to show filtered entities
//=======================================================================

SMESH_Actor* SMESHGUI_FilterDlg::getActor()
{
  SMESH_Actor* meshActor = SMESH::FindActorByObject( myMesh );
  if ( meshActor && meshActor->GetVisibility() )
    return meshActor;

  SALOME_DataMapIteratorOfIOMapOfVtk anIter(myIObjects);
  for ( ; anIter.More(); anIter.Next())
  {
    Handle(SALOME_InteractiveObject) io = anIter.Key();
    if ( io->hasEntry() )
    {
      SMESH_Actor* actor = SMESH::FindActorByEntry( io->getEntry() );
      if ( !actor )
        continue;
      if ( actor->GetVisibility() )
        return actor;
      if ( !meshActor )
        meshActor = actor;
    }
  }
  return meshActor;
}

//=======================================================================
// name    : SMESHGUI_FilterDlg::selectInViewer
// Purpose : Select given entities in viewer
//=======================================================================
void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QList<int>& theIds)
{
  if (mySelectionMgr == 0 || myMesh->_is_nil() )
    return;

  mySelectionMgr->clearFilters();

  // Set new selection mode if necessary
  Selection_Mode aSelMode = getSelMode(theType);
  SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
  if ( aViewWindow && aViewWindow->SelectionMode() != aSelMod


}
            }
        })

        return true
    },
    init(...args) {
        let types, required, logic
        args.map(x => {
            if(x instanceof Function && !logic){ logic = x }
            else if(typeof x === 'object') {
                if(!types){ types = x }
                else if(!required){ required = x }
            }
        })

        const isValid = (data) => {
            const pipe = logic ? [model.check, logic] : [model.check]
            return pipe.reduce((a,v) => a && v(types||{},required||{},data), true)
        }

        const whenValid = (data) => new Promise((res,rej) => isValid(data) && res(data))

        return {isValid, whenValid}
    },
    ArrayOf(M) {
        return model.init((t,r,data) => {
            if(!(data instanceof Array)) throw `${data} not an Array`
            data.map(x => {
                if(!model.is(M, x))
                    throw `${x} is not a model instance`
            })
            return true
        })
    }
}

export default model
/**
 * @module models
 */
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from "typeorm";
import Name from './Name';
import Phone from './Phone';
import Email from './Email';

@Entity({
    name: 'contact'
})
export default class Contact {

    @PrimaryGeneratedColumn()
    public id: number;

    @Column({
        type: "varchar",
        name: "type",
        default: 'person'
    })
    public type: string;

    @Column(
        () => Name,
        {
            prefix: false
        }
    )
    public name: Name;

    @OneToMany(
        () => Phone,
        ( phone: Phone ) => phone.contact,
        {
            cascade: true
        }
    )
    public phones: Phone[];

    @OneToMany(
        () => Email,
        ( email: Email ) => email.contact,
        {
            cascade: true
        }
    )
    public emails: Email[];

}
import intersect from './intersect';
import { Node, BoxedData, AreaData, BoxArea, Box } from './types';

export default function* getIterator<T>(
  tree: Node<T> | undefined,
  { top, left, width = 1, height = 1, right = left + width, bottom = top + height }: BoxArea,
  x = 0,
  y = 0)
  : IterableIterator<AreaData<T>> {
  if (tree == undefined) {
    return;
  }

  if (tree.data != undefined) {
    return yield {
      data: tree.data,
      top: y,
      left: x,
      width: 1,
      height: 1
    };
  }

  const halfSize = tree.size / 2;
  const min = (x: number) => Math.min(x, halfSize);
  const max = (x: number) => Math.max(x, halfSize);
  if (top < halfSize && left < halfSize && tree.topLeft) {
    yield* getIterator(tree.topLeft, {
      top,
      left,
      right: min(right),
      bottom: min(bottom)
    }, x, y);
  }

  if (top < halfSize && right > halfSize && tree.topRight) {
    yield* getIterator(tree.topRight, {
      top,
      left: max(left) - halfSize,
      right: right - halfSize,
      bottom: min(bottom)
    }, x + halfSize, y);
  }

  if (bottom > halfSize && left < halfSize && tree.bottomLeft) {
    yield* getIterator(tree.bottomLeft, {
      top: max(top) - halfSize,
      left,
      right: min(right),
      bottom: bottom - halfSize
    }, x, y + halfSize);
  }

  if (bottom > halfSize && right > halfSize && tree.bottomRight) {
    yield* getIt


 midi_out) = midi2audio.step(MIDPOINT, &midi_in);
                prop_assert!(midi_out.is_empty());
                let (audio_out, midi_out) = audio2midi.step(u16::from(audio_out) << OUT_BITS, &midi_out);
                prop_assert_eq!(audio_out, MIDPOINT_OUT);
                prop_assert!(midi_out.is_empty());
            }
        }
    }
}
// WARNING:  This file was autogenerated by jni-bindgen.  Any changes to this file may be lost!!!

#[cfg(any(feature = "all", feature = "android-content-res-Resources"))]
__jni_bindgen! {
    /// public class [Resources](https://developer.android.com/reference/android/content/res/Resources.html)
    ///
    /// Required feature: android-content-res-Resources
    public class Resources ("android/content/res/Resources") extends crate::java::lang::Object {

        /// [Resources](https://developer.android.com/reference/android/content/res/Resources.html#Resources(android.content.res.AssetManager,%20android.util.DisplayMetrics,%20android.content.res.Configuration))
        ///
        /// Required features: "android-content-res-AssetManager", "android-content-res-Configuration", "android-util-DisplayMetrics"
        #[cfg(any(feature = "all", all(feature = "android-content-res-AssetManager", feature = "android-content-res-Configuration", feature = "android-util-DisplayMetrics")))]
        #[deprecated] pub fn new<'env>(__jni_env: &'env __jni_bindgen::Env, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::content::res::AssetManager>>, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::util::DisplayMetrics>>, arg2: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::content::res::Configuration>>) -> __jni_bindgen::std::result::Result<__jni_bindgen::Local<'env, crate::android::content::res::Resources>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
            // class.path == "android/content/res/Resources", java.flags == PUBLIC, .name == "<init>", .descriptor == "(Landroid/content/res/AssetManager;Landroid/util/DisplayMetrics;Landroid/content/res/Configuration;)V"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1.into()), __jni_bindgen::AsJValue::as_jvalue(&arg2.into())];
                let (__jni_class, __jni_method) = __jni_env.require_class_method("android/content/res/Resources\0", "<init>\0", "(Landroid/content/res/AssetManager;Landroid/util/DisplayMetrics;Landroid/content/res/Configuration;)V\0");
                __jni_env.new_object_a(__jni_class, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [getSystem](https://developer.android.com/reference/android/content/res/Resources.html#getSystem())
        ///
        /// Required features: "android-content-res-Resources"
        #[cfg(any(feature = "all", all(feature = "android-content-res-Resources")))]
        pub fn getSystem<


init::uninit();
            let ret = FromGlibContainer::from_glib_container_num(
                nm_sys::nm_setting_vpn_get_secret_keys(
                    self.as_ref().to_glib_none().0,
                    out_length.as_mut_ptr(),
                ),
                out_length.assume_init() as usize,
            );
            ret
        }
    }

    fn get_service_type(&self) -> Option<GString> {
        unsafe {
            from_glib_none(nm_sys::nm_setting_vpn_get_service_type(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[cfg(any(feature = "v1_2", feature = "dox"))]
    fn get_timeout(&self) -> u32 {
        unsafe { nm_sys::nm_setting_vpn_get_timeout(self.as_ref().to_glib_none().0) }
    }

    fn get_user_name(&self) -> Option<GString> {
        unsafe {
            from_glib_none(nm_sys::nm_setting_vpn_get_user_name(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn remove_data_item(&self, key: &str) -> bool {
        unsafe {
            from_glib(nm_sys::nm_setting_vpn_remove_data_item(
                self.as_ref().to_glib_none().0,
                key.to_glib_none().0,
            ))
        }
    }

    fn remove_secret(&self, key: &str) -> bool {
        unsafe {
            from_glib(nm_sys::nm_setting_vpn_remove_secret(
                self.as_ref().to_glib_none().0,
                key.to_glib_none().0,
            ))
        }
    }

    //fn get_property_data(&self) -> /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 } {
    //    unsafe {
    //        let mut value = Value::from_type(</*Unknown type*/ as StaticType>::static_type());
    //        gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"data\0".as_ptr() as *const _, value.to_glib_none_mut().0);
    //        value.get().expect("Return Value for property `data` getter").unwrap()
    //    }
    //}

    //fn set_property_data(&self, data: /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }) {
    //    unsafe {
    //        gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"data\0".as_ptr() as *const _, Value::from(&data).to_glib_none().0);
    //    }
    //}

    fn set_property_persistent(&self, persistent: bool) {
        unsafe {
            gobject_sys::g_object_set_property(
                self.to_glib_none().0 as *mut gobject_sys::GObject,
                b"persistent\0".as_ptr() as *const _,
                Value::from(&persistent).to_glib_none().0,
            );
        }
    }

    //fn get_property_secrets(&self) -> /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 } {
    //    unsafe {
    //        let mut value = Value::from_type(</*Unknown type*/ as StaticType>::static_type());
    //


_block {
    char *name;
    uint32_t start;
    uint32_t end;
} mjb_codepoint_block;

/*
 * Unicode codepoint general category
 * [see: https://www.unicode.org/glossary/#general_category]
 */
typedef enum mjb_category {
${categoryEnums.join('\n')}
} mjb_category;

#define MJB_CATEGORY_COUNT ${categoryEnums.length}

/*
 * Decomposition
 * [see: https://www.unicode.org/glossary/#combining_class]
 */
typedef enum mjb_canonical_combining_class {
    MJB_CCC_SPACING =                0, /* Spacing, split, enclosing, reordrant, and Tibetan subjoined */
    MJB_CCC_OVERLAYS =               1, /* Overlays and interior */
    MJB_CCC_NUKTAS =                 7, /* Nuktas */
    MJB_CCC_HIRAGANA_KATAKANA =      8, /* Hiragana/Katakana voicing marks */
    MJB_CCC_VIRAMAS =                9, /* Viramas */
    MJB_CCC_FIXED_START =           10, /* Start of fixed position classes */
    MJB_CCC_FIXED_END =            199, /* End of fixed position classes */
    MJB_CCC_BELOW_LEFT_ATTACHED =  200, /* Below left attached */
    MJB_CCC_BELOW_ATTACHED =       202, /* Below attached */
    MJB_CCC_BELOW_RIGHT_ATTACHED = 204, /* Below right attached */
    MJB_CCC_LEFT_ATTACHED =        208, /* Left attached (reordrant around single base character) */
    MJB_CCC_RIGHT_ATTACHED =       210, /* Right attached */
    MJB_CCC_ABOVE_LEFT_ATTACHED =  212, /* Above left attached */
    MJB_CCC_ABOVE_ATTACHED =       214, /* Above attached */
    MJB_CCC_ABOVE_RIGHT_ATTACHED = 216, /* Above right attached */
    MJB_CCC_BELOW_LEFT =           218, /* Below left */
    MJB_CCC_BELOW =                220, /* Below */
    MJB_CCC_BELOW_RIGHT =          222, /* Below right */
    MJB_CCC_LEFT =                 224, /* Left (reordrant around single base character) */
    MJB_CCC_RIGHT =                226, /* Right */
    MJB_CCC_ABOVE_LEFT =           228, /* Above left */
    MJB_CCC_ABOVE =                230, /* Above */
    MJB_CCC_ABOVE_RIGHT =          232, /* Above right */
    MJB_CCC_DOUBLE_BELOW =         233, /* Double below */
    MJB_CCC_DOUBLE_ABOVE =         234, /* Double above */
    MJB_CCC_BELOW_IOTA =           240  /* Below (iota subscript) */
} mjb_canonical_combining_class;

#define MJB_CCC_COUNT 26

/*
 * Bidirectional categories
 * [see: https://www.unicode.org/glossary/#combining_class]
 */
typedef enum mjb_bidi_categories {
    NONE, /* Nothing specified */
    L,	  /* Left-to-right */
    R,	  /* Right-to-left */
    AL,	  /* Right-to-left arabic */
    EN,	  /* European number */
    ES,	  /* European number separator */
    ET,	  /* European number terminator */
    AN,	  /* Arabic number */
    CS,	  /* Common number separator */
    NSM,  /* Nonspacing mark */
    BN,	  /* Boundary neutral */
    B,    /* Paragraph separator */
    S,    /* Segment separator */
    WS,   /* Whitespace */
    ON,	  /* Other neutrals */
    LRE,  /* Left-to-right embedding */
    LRO,  /* Left-to-right override */
    RLE,


-Predictor' and 'SA-Corrector'. For unconditional generation and conditional generation with small classifier-free guidance scale, the recommended orders are 'predictor_order = 3' and 'corrector_order = 4'; for conditional generation with large classifier-free guidance scale (e.g. t2i), the recommended orders are 'predictor_order = 2' and 'corrector_order = 2'.

# Download Pretrained Models

All models are stored in `HunyuanVideo/ckpts` by default, and the file structure is as follows
```shell
HunyuanVideo
  ├──ckpts
  │  ├──README.md
  │  ├──hunyuan-video-t2v-720p
  │  │  ├──transformers
  │  │  │  ├──mp_rank_00_model_states.pt
  │  │  │  ├──mp_rank_00_model_states_fp8.pt
  │  │  │  ├──mp_rank_00_model_states_fp8_map.pt
  ├  │  ├──vae
  │  ├──text_encoder
  │  ├──text_encoder_2
  ├──...
```

## Download HunyuanVideo model
To download the HunyuanVideo model, first install the huggingface-cli. (Detailed instructions are available [here](https://huggingface.co/docs/huggingface_hub/guides/cli).)

```shell
python -m pip install "huggingface_hub[cli]"
```

Then download the model using the following commands:

```shell
# Switch to the directory named 'HunyuanVideo'
cd HunyuanVideo
# Use the huggingface-cli tool to download HunyuanVideo model in HunyuanVideo/ckpts dir.
# The download time may vary from 10 minutes to 1 hour depending on network conditions.
huggingface-cli download tencent/HunyuanVideo --local-dir ./ckpts
```

<details>
<summary>💡Tips for using huggingface-cli (network problem)</summary>

##### 1. Using HF-Mirror

If you encounter slow download speeds in China, you can try a mirror to speed up the download process. For example,

```shell
HF_ENDPOINT=https://hf-mirror.com huggingface-cli download tencent/HunyuanVideo --local-dir ./ckpts
```

##### 2. Resume Download

`huggingface-cli` supports resuming downloads. If the download is interrupted, you can just rerun the download
command to resume the download process.

Note: If an `No such file or directory: 'ckpts/.huggingface/.gitignore.lock'` like error occurs during the download
process, you can ignore the error and rerun the download command.

</details>

---

## Download Text Encoder

HunyuanVideo uses an MLLM model and a CLIP model as text encoder.

1. MLLM model (text_encoder folder)

HunyuanVideo supports different MLLMs (including HunyuanMLLM and open-source MLLM models). At this stage, we have not yet released HunyuanMLLM. We recommend the user in community to use [llava-llama-3-8b](https://huggingface.co/xtuner/llava-llama-3-8b-v1_1-transformers) provided by [Xtuer](https://huggingface.co/xtuner), which can be downloaded by the following command

```shell
cd HunyuanVideo/ckpts
huggingface-cli download xtuner/llava-llama-3-8b-v1_1-transformers --local-dir ./llava-llama-3-8b-v1_1-transformers
```

In order to save GPU memory resources for model loading, we separate the language model parts of `llava-llama-3-8b-v1_1-transformers` into `text_encoder`.
```
cd HunyuanVideo
python hyvideo/utils/preprocess_text_encoder_tokenizer_utils.py --input_dir ckpts/llava-llama-3-8b-v1_1-transformers --output_dir ckpts/text_encoder
```

2. CLIP model (text_encoder_2 folder)

We use [CLIP](https://huggingface.co/openai/clip-vit-l


#include <stdlib.h>
#include <stdio.h>
#include "../include/apiClient.h"
#include "../include/list.h"
#include "../external/cJSON.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "../model/dto_sec_filing_result_dto.h"
#include "../model/mvc_problem_details.h"
#include "../model/mvc_validation_problem_details.h"

// Full-text search of SEC filing documents
//
// Search across SEC filing documents with advanced filtering and sorting capabilities.  ### Available Sort Fields  Field Name | Description -----------|------------- AccessionNumber | SEC filing accession number FormType | Type of the filing document FilingDate | Date when filing was submitted CompanyName | Name of the company CIK | Central Index Key DocumentFilename | Name of the filing document DocumentDescription | Description of the document  ### Search Options  Option | Description --------|------------- text_contains | Keywords that must appear in the document text_not_contain | Keywords that must not appear in the document  ### Date Format All dates must be provided in YYYY-MM-DD format  :::tip Use text_contains and text_not_contain with multiple keywords separated by commas for more precise searches :::  :::note The search is case-insensitive and supports partial word matches :::
//
list_t*
FullTextSearchAPI_v1FullTextGet(apiClient_t *apiClient, char *form_type, char *filling_date_start, char *filling_date_end, char *text_contains, char *text_not_contain, int *page_size, int *page_number, char *sort_by, char *sort_order);


from tkinter.simpledialog import askfloat
from tkinter import *
top = Tk()
top.geometry("100x100")
def show():
        num = askfloat("Input", "Input a floating point number")
        print(num)
B = Button(top, text ="Click", command = show)
B.place(x=50,y=50)
top.mainloop()
#gui 4th programs


mary = "";
                    string strBiblioRecPath = "";
                    nRet = this.App.GetBiblioSummary(strBarcode,
                        strConfirmItemRecPath,
                        null,   //  strBiblioRecPathExclude,
                        25,
                        out strBiblioRecPath,
                        out strSummary,
                        out strError);
                    if (nRet == -1)
                    {
                        strSummary = "ERROR: " + strError;
                    }

                    strResult += (i+1).ToString() + ") " + strSummary + " ";
                    strResult += "借阅日期: " + DateTimeUtil.LocalDate(strBorrowDate) + " ";
                    strResult += "应还日期: " + timeReturning.ToString("d") + " ";
                    strResult += strOverDue + " ";
                }
            }

            strResult += "=== 共有 " + nOverdueCount.ToString() + " 册图书超期, 请尽快归还。";

            strBody = strResult;

            if (wantNotifyBarcodes.Count > 0)
                return 1;
            else
                return 0;
        }
#endif
    }

    // 一个扩展消息接口
    public class MessageInterface
    {
        public string Type = "";
        public Assembly Assembly = null;
        public ExternalMessageHost HostObj = null;
    }

#if NO
    class NameAttribute : Attribute
    {
        public NameAttribute(string name)
        {
            this._name = name;
        }

        private string _name;
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
    }
#endif
}


:15px 0;width:100%}#onetrust-pc-sdk .ot-lst-subhdr{width:calc(100% - 15px);float:none;bottom:auto;display:inline-block;padding-top:8px;padding-left:15px}#onetrust-pc-sdk .ot-btn-subcntr{float:none}#onetrust-pc-sdk #ot-search-cntr{display:inline-block;width:calc(100% - 55px);position:relative}#onetrust-pc-sdk #ot-anchor{top:75px;right:30px}#onetrust-pc-sdk #ot-fltr-modal{top:81px}#onetrust-pc-sdk #ot-fltr-cntr{float:right;right:15px}#onetrust-pc-sdk #ot-lst-title{padding-left:15px}#onetrust-pc-sdk #ot-lst-cnt{height:auto;overflow:auto}#onetrust-pc-sdk #accept-recommended-btn-handler,#onetrust-pc-sdk .ot-pc-refuse-all-handler,#onetrust-pc-sdk .save-preference-btn-handler{width:calc(100% - 33px)}#onetrust-pc-sdk.ot-ftr-stacked .ot-btn-subcntr,#onetrust-pc-sdk.ot-ftr-stacked .save-preference-btn-handler{max-width:none}#onetrust-pc-sdk.ot-ftr-stacked .ot-pc-footer button{margin:15px}#onetrust-pc-sdk.ot-ftr-stacked .ot-btn-subcntr button{min-width:none;max-width:none}#onetrust-pc-sdk.ot-ftr-stacked .ot-btn-subcntr button:nth-child(2){margin-top:15px}#onetrust-pc-sdk.ot-ftr-stacked .ot-btn-container button:not(:last-child){margin-bottom:0}}@media(max-width:425px){#onetrust-pc-sdk #ot-pc-lst .ot-acc-txt{padding-top:6px;padding-bottom:10px}#onetrust-pc-sdk #ot-pc-lst .ot-host-notice{float:left;margin-left:30px}#onetrust-pc-sdk #ot-pc-lst .ot-arw-cntr{float:none;display:inline}#onetrust-pc-sdk #ot-pc-lst .ot-ven-hdr{float:left;width:100%;max-width:85%}#onetrust-pc-sdk.ot-addtl-vendors #ot-pc-lst .ot-acc-cntr .ot-arw-cntr:first-of-type{float:right}#onetrust-pc-sdk #ot-pc-title{max-width:100%}#onetrust-pc-sdk .ot-subgrp-cntr li.ot-subgrp{margin-left:10px;width:calc(100% - 10px)}#onetrust-pc-sdk #ot-ven-lst .ot-tgl-cntr{width:auto;float:right}#onetrust-pc-sdk #ot-ven-lst .ot-arw-cntr{float:right}#onetrust-pc-sdk .ot-ven-hdr{max-width:47%}#onetrust-pc-sdk .ot-always-active-group .ot-tgl-cntr:first-of-type{max-width:none;padding-left:20px}}@media only screen and (max-height:425px)and (max-width:896px)and (orientation:landscape){#onetrust-pc-sdk{height:100%;width:100%;max-width:none}#onetrust-pc-sdk .ot-always-active-group .ot-tgl-cntr{max-width:none}#onetrust-pc-sdk .ot-pc-header{padding:10px;width:calc(100% - 20px)}#onetrust-pc-sdk #ot-lst-cnt{height:auto;ove


 {
                        val ax = MutableVec3f(rand.randomF(-1f, 1f), rand.randomF(-1f, 1f), 0f).norm()
                        rotate(rand.randomF(0f, 15f).deg, ax)
                        val h = rand.randomF(2f, 4f)

                        val p = i.toFloat() / steps
                        val sub = 1f / steps

                        scale(0.8f, 0.8f, 1f)
                        translate(0f, 0f, h * 0.1f)
                        color = shaftGrad.getColor(p + sub * 0.15f).mix(Color.BLACK, 0.25f)
                        sample()
                        scale(0.8f, 0.8f, 1f)
                        translate(0f, 0f, h * 0.2f)
                        color = shaftGrad.getColor(p + sub * 0.3f)
                        sample()
                        translate(0f, 0f, h * 0.4f)
                        color = shaftGrad.getColor(p + sub * 0.55f)
                        sample()
                        scale(1 / 0.8f, 1 / 0.8f, 1f)
                        translate(0f, 0f, h * 0.2f)
                        color = shaftGrad.getColor(p + sub * 0.7f).mix(Color.BLACK, 0.25f)
                        sample()
                        scale(1 / 0.8f, 1 / 0.8f, 1f)
                        translate(0f, 0f, h * 0.1f)
                        color = shaftGrad.getColor(p + sub * 0.85f).mix(Color.BLACK, 0.55f)
                        sample()

                        if (i == leafPos) {
                            shaftLeafTransform.set(transform)
                        } else {
                            for (j in 0 until rand.randomI(0, 1)) {
                                makeThorn()
                            }
                        }
                    }

                    translate(0f, 0f, 0.2f)
                    withTransform {
                        scale(1.5f, 1.5f, 1f)
                        sample()
                    }
                    translate(0f, 0f, 0.15f)
                    withTransform {
                        scale(3f, 3f, 1f)
                        sample()
                    }
                    fillTop()
                }

                shaftTopTransform.set(transform)
            }
        }

        private fun MeshBuilder.makeThorn() {
            withTransform {
                val ax = MutableVec3f(rand.randomF(-1f, 1f), rand.randomF(-1f, 1f), 0f).norm()
                rotate(90f.deg, ax)
                val shaftUp = MutableVec3f(0f, 0f, 1f).rotate((-90f).deg, ax).mul(0.1f)
                translate(0f, 0f, 0.1f)

                profile {
                    circleShape(0.18f, steps = 8)

                    for (i in 0..4) {
                        val p = i / 4f
                        val s = (1 - p).pow(1.5f)
                        scale(s, s, 1f)
                        sample()
                        scale(1 / s, 1 / s, 1f)

                        translate(0f, 0f, (1 - p) * 0.1f)
                        translate(shaftUp)
                    }
                }
            }
        }

        private fun MeshBuilder.makeShaftLeafGeometry() {
            transform.mul(shaftLeafTransform)
            rotate(rand.randomF(0f, 360f).deg, Vec3f.Z_AXIS)

            val grad = ColorGradient(shaftGrad.getColor(0.7f), MdColor.LIGHT_GREEN toneLin 900)

            for (i in 0..1) {
                withTransform {
                    rotate(rand.randomF(30f, 45f).deg, Vec3f.X_AXIS)
                    color = grad.getColor(0f)
                    val leafBases = mutableListOf<Mat4f>()

                    val rotYOffset = rand.randomF(-4f, 4f)


control">

      <form class="width-100">

            <button type="button" (click)="sortSelectGatewayModal.showDialog()" class="btn {{ gatewaySort.first ? 'btn-info' : 'btn-default' }} btn-circle btn-xl" title="{{ 'MODAL_BUTTON_HELPSORT' | translate }}">

            </button>

          <input class="form-control filter-input" type="text" name="gatewayFilter" [(ngModel)]="gatewayFilter" autocomplete="off"/>

            <button class="btn btn-default btn-circle btn-xl" type="button" (click)="onClearFilterPg()" title="{{ 'MODAL_BUTTON_CLEARFILTER' | translate }}">

            </button>

      </form>

      <form class="width-100">

            <button type="button" (click)="onSearchHelpToggle()" class="btn {{ searchHelpShow ? 'btn-info' : 'btn-default' }} btn-circle btn-xl" title="{{ 'MODAL_BUTTON_HELPFILTER' | translate }}">

            </button>
            <button type="button" (click)="sortSelectParamModal.showDialog()" class="btn {{ paramSort.first ? 'btn-info' : 'btn-default' }} btn-square btn-xl" title="{{ 'MODAL_BUTTON_HELPSORT' | translate }}">

            </button>

          <input class="form-control filter-input" type="text" name="paramFilter" [(ngModel)]="paramFilter" autocomplete="off"/>

            <button class="btn btn-default btn-circle btn-xl" type="button" (click)="onClearFilterParam()" title="{{ 'MODAL_BUTTON_CLEARFILTER' | translate }}">

            </button>

      </form>

      <button type="button" (click)="onBackToList()" [hidden]="viewMode === 'pgs'" class="btn btn-info btn-circle btn-xl" title="{{ 'MODAL_BUTTON_BACK' | translate }}">

      </button>

      <button type="button" (click)="onIncludeSecure()"  [hidden]="viewMode === 'params'" class="btn {{ includeSecure ? 'btn-danger' : 'btn-default' }} btn-circle btn-xl" title="{{ (includeSecure ? 'MODAL_BUTTON_SECURE_ATTR_OFF' : 'MODAL_BUTTON_SECURE_ATTR_ON') | translate }}">

      </button>

      <button type="button" (click)="onRowListSelected()" [disabled]="selectedGateway == null" [hidden]="viewMode === 'params'" class="btn btn-default btn-circle btn-xl" title="{{ 'MODAL_BUTTON_DETAILS' | translate }}">

      </button>

      <button type="button" (click)="onRowEnableSelected()" [d


lic class StoryReactionWidgetBackground extends Drawable {

    private final int STYLE_FILLED = 0;
    private final int STYLE_TRANSCLUENT = 1;
    int style;
    private final View parent;
    Paint shadowPaint;
    Paint backgroundPaint;
    int alpha = 255;

    float[] points = new float[3 * 5];
    AnimatedFloat progressToMirrored;
    private boolean mirror;
    private Paint xRefPaint;
    Path path = new Path();

    public StoryReactionWidgetBackground(View parent) {
        this.parent = parent;
        progressToMirrored = new AnimatedFloat(parent, 350, CubicBezierInterpolator.EASE_OUT_QUINT);
        shadowPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        shadowPaint.setShadowLayer(AndroidUtilities.dp(4), 0, 0, 0x5f000000);

        backgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        backgroundPaint.setColor(Color.WHITE);
    }

    public void updateShadowLayer(float scale) {
        shadowPaint.setShadowLayer(AndroidUtilities.dp(2) / scale, 0, AndroidUtilities.dpf2(0.7f) / scale, ColorUtils.setAlphaComponent(Color.BLACK, (int) (255 * 0.18f)));
    }

    @Override
    public void draw(@NonNull Canvas canvas) {
        points[0] = getBounds().centerX();
        points[1] = getBounds().centerY();
        points[2] = getBounds().height() / 2f;

        points[3] = getBounds().left + getBounds().width() * 1.027f;
        points[4] = getBounds().top + getBounds().height() * 0.956f;
        points[5] = getBounds().height() * 0.055f;

        points[6] = getBounds().left + getBounds().width() * 0.843f;
        points[7] = getBounds().top + getBounds().height() * 0.812f;
        points[8] = getBounds().height() * 0.132f;

        //mirrored
        points[9] = getBounds().left + getBounds().width() * (1f - 1.027f);
        points[10] = getBounds().top + getBounds().height() * 0.956f;
        points[11] = getBounds().height() * 0.055f;

        points[12] = getBounds().left + getBounds().width() * (1f - 0.843f);
        points[13] = getBounds().top + getBounds().height() * 0.812f;
        points[14] = getBounds().height() * 0.132f;

        float mirrorProgress = progressToMirrored.set(mirror ? 1f : 0);
        if (style == STYLE_FILLED) {
            backgroundPaint.setColor(Color.WHITE);
        } else if (style == STYLE_TRANSCLUENT) {
            if (xRefPaint == null) {
                xRefPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
                xRefPaint.setColor(0xff000000);
                xRefPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
                xRefPaint.setStrokeWidth(AndroidUtilities.dp(3));
            }
            backgroundPaint.setColor(ColorUtils.setAlphaComponent(Color.BLACK, 127));
        }
        if (alpha != 255 || style == STYLE_TRANSCLUENT) {
            canvas.saveLayerAlpha(getBounds().left - getBounds().width() * 0.2f, getBounds().top, getBounds().right + getBounds().width() * 0.2f, getBounds().bottom + getBounds().height() * 0.2f, alpha, Canvas.ALL_SAVE_FLAG);
        } else {
            canvas.save();
        }
        path.rewind();
        for (int k = 0; k < 2; k++) {
            if (style == STYLE_TRANSCLUENT && k == 0) {
                continue;
            }
            Paint paint = k == 0 ? shadowPaint : backgroundPaint;
            int shadowOffset = k == 0 ? 1 : 0;
            for (int i = 0; i < 5; i++) {
                if (i == 1 || i == 2) {
                    if (mirrorProgress == 1f) {
                        continue;
                    }
                    path.addCircle(points


 保存当前会话ID
  Future<void> saveChatSessionId(int sessionId) async {
    // 获取SharedPreferences实例
    final SharedPreferences prefs = await SharedPreferences.getInstance();

    // 保存当前会话ID
    prefs.setInt(currentSessionId, sessionId);
  }

  /// 删除当前会话ID
  Future<void> removeChatSessionId() async {
    // 获取SharedPreferences实例
    final SharedPreferences prefs = await SharedPreferences.getInstance();

    // 删除当前会话ID
    prefs.remove(currentSessionId);
  }

  // 消息列表
  List<ChatMessage> messages = [];

  // 聊天会话 ID
  int chatSessionId = 0;

  // 聊天会话名称
  String chatSessionName = "新会话";

  // 加载到的 API 配置列表
  late List<AiApi> apiConfigs;

  // 当前正在使用的 API 配置
  AiApi? currentApi;

  // 当前模型列表
  List<String> models = [];

  // 当前选择的 模型
  String currentModel = "";

  // 是否正在等待回复
  bool isWaitingResponse = false;

  // 是否使用流式请求
  bool useStream = true;

  // 输入框控制器
  final TextEditingController inputController = TextEditingController();

  // 滚动控制器
  final ScrollController scrollController = ScrollController();

  /// 根据会话ID 加载对应的聊天记录列表
  Future<void> loadChatMessages(int sessionId,
      {ChatSession? chatSession}) async {
    // 判断是否传递了会话信息
    if (chatSession != null) {
      // 设置聊天会话ID
      sessionId = chatSession.id;
      // 设置聊天会话ID到当前对象
      chatSessionId = sessionId;
      // 设置聊天会话名称
      chatSessionName = chatSession.title;

      // 获取api id
      final apiConfigId = chatSession.apiConfigId;
      // 根据配置id查询对应的api信息
      final apiConfig = apiConfigs.firstWhere((api) => api.id == apiConfigId);
      // 判断是否有API信息
      if (apiConfig.id > 0) {
        currentApi = apiConfig;
        currentModel = chatSession.model.toString();
      }
    } else {
      // 根据会话ID 查询会话信息
      final session = await chatSessionService.getSessionById(sessionId);
      // 判断是否有数据
      if (session != null) {
        // 设置聊天会话ID
        chatSessionId = session.id;
        // 设置聊天会话名称
        chatSessionName = session.title;
        // 获取api id
        final apiConfigId = session.apiConfigId;
        // 根据配置id查询对应的api信息
        final apiConfig = apiConfigs.firstWhere((api) => api.id == apiConfigId);
        // 判断是否有API信息
        if (apiConfig.id > 0) {
          currentApi = apiConfig;
          currentModel = session.model.toString();
        }
      }
    }

    // 根据会话ID 查询会话信息
    final messages = await chatMessageService.getMessagesBySessionId(sessionId);

    // 设置聊天会话ID
    chatSessionId = sessionId;

    // 保存当前会话ID
    saveChatSessionId(chatSessionId);

    // 设置聊天信息
    this.messages = messages;

    // 无论是否有消息，都通知监听器更新UI
    notifyListeners();
  }

  /// 加载指定会话的聊天记录列表
  void loadSession(ChatSession chatSes


->module[i].col == mw->module[j].col+1 ||
				mw->module[j].dbl && mw->module[i].col == mw->module[j].col+2)
			{
				// j->right = i
				int err = ABS(mw->module[i].dy + mw->module[i].h/2 - yj);
				if (right<0 || err<right_err)
				{
					right = i;
					right_err = err;
				}
			}
		}

		if (left>=0)
			mw->module[j].left = mw->module + left;
		if (right>=0)
			mw->module[j].right = mw->module + right;
	}

	// smooth scroll to hovered mod
	if (mw->focus->dy - window.t - mw->scroll < 0)
		mw->scroll = mw->focus->dy - window.t;
	if (mw->focus->dy+mw->focus->h - window.t - mw->scroll > client_h)
		mw->scroll = mw->focus->dy+mw->focus->h - window.t - client_h;
}

enum MODULE_MSG
{
	MM_INIT,  // return height if ok
	MM_LOAD,  // overwrite menu data with conf
	MM_INPUT, // p1 contains single CON_INPUT
	MM_PAINT, // p1 contains CON_OUTPUT, p2 contains clip rect to apply, use menu_window.scroll

	MM_FOCUS,
	// p1 is flag indicating if focus is being gained or lost,
	// if focus is being lost, p2 MUST be filled with Y coordinate of focused element in the module
	// if focus is being gained p2 contains Y coordinate of previously focused element in module the focus is comming from
};

#define LABEL_CL(m,h,f) ((m)->state==2) ? ((h)&&!(f) ? cl_menu_c[(m)->state] : cl_menu_b[(m)->state] ) : cl_menu_a[(m)->state];
#define VALUE_CL(m,h,f) ((m)->state==2) ? ((h)&&(f) ? cl_menu_c[(m)->state] : cl_menu_b[(m)->state] ) : cl_menu_b[(m)->state];

void PaintScroll(CON_OUTPUT* s, int x, int dy, int h, int pos, int size, int state, const int* clip);

int ProfileProc(MODULE* m, int msg, void* p1, void* p2);
int CampaignProc(MODULE* m, int msg, void* p1, void* p2);

int PromptProc(int msg, void* p1, void* p2)
{
	static MENU_ASSET prompt(&keyb);

	enum FuncKey
	{
		EXIT = 1,
		BKSPC,
		TAB,
		CAPSLK,
		ENTER,
		L_SHIFT,
		R_SHIFT,
		L_CTRL,
		L_WIN,
		L_ALT,
		R_ALT,
		R_WIN,
		APP,
		R_CTRL
	};

	struct Key
	{
		int ch; // if smaller than 0x20 it is some FuncKey
		int shift_ch;
		bool caps; // if false don't xor shift with capslk
		int x,y,w,h;
	};

	const static Key keymap[] =
	{
		{ L_SHIFT,L_SHIFT, fal


// <copyright file="EmptyConfigFeature.cs" company="ConfigR contributors">
//  Copyright (c) ConfigR contributors. (configr.net@gmail.com)
// </copyright>

namespace ConfigR.Tests.Acceptance
{
    using System;
    using ConfigR.Tests.Acceptance.Roslyn.CSharp.Support;
    using FluentAssertions;
    using Xbehave;
    using Xunit;

    public static class EmptyConfigFeature
    {
        [Scenario]
        [Example(null)]
        [Example("")]
        [Example(" ")]
        [Example("\n")]
        [Example("//")]
        [E


"""
配置文件: DEEPFM_CONFIG

使用方式:
    from funrec.config.config_deepfm import CONFIG
    config = CONFIG
"""

from typing import Dict, Any

# 配置来源: config_deepfm.yaml
CONFIG: Dict[str, Any] = {
    "data": {
        "dataset_name": "kuairand_data",
    },
    "features": {
        "dataset_name": "kuairand_data",
        "emb_dim": 8,
        "task_names": [
            "is_click",
        ],
        "features": [
            {
                "name": "user_id",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "video_id",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "user_active_degree",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "is_live_streamer",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "is_video_author",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "follow_user_num_range",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "fans_user_num_range",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "friend_user_num_range",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "register_days_range",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "author_id",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "video_type",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "upload_type",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "visible_status",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "music_id",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "music_type",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
            {
                "name": "tag",
                "group": [
                    "deepfm",
                    "linear",
                ],
            },
        ],
    },
    "training": {
        "build_function": "funrec.models.deepfm.build_deepfm_model",
        "model_params": {
            "dnn_units": [
                64,
                32,
            ],
            "dropout_rate": 0.1,
            "linear_logits": True,
        },
        "optimizer": "adam",
        "loss": [
            "binary_crossentropy",
        ],
        "metrics": [
            "binary_accuracy",
        ],
        "batch_size": 1024,
        "epochs": 1,
        "validation_split": 0.2,
        "verbose": 0,
        "subsample_size": 300000,
    },
    "evaluation": {
        "model_type": "ranking",
        "model_config": {
            "user_id_col": "user_id",
            "item_id_col": "video_id",
        },
    },
}

# 为了向后兼容，也提供原始变量名
DEEPFM_CONFIG = CONFIG

__all__ = ["CONFIG", "DEEPFM_CONFIG"]


bg_memory",
		subtitle = "",
		type = 1,
		title = "Distance Felt",
		condition = "Begin \"Anything and Everything for Indy!\" Chapter 4.",
		story = "BOTELAN4",
		id = 1324,
		icon = "memory_botelan",
		is_open = 0
	},
	[1325] = {
		mask = "bg/bg_memory",
		subtitle = "",
		type = 1,
		title = "Change of Plans",
		condition = "Begin \"Anything and Everything for Indy!\" Chapter 5.",
		story = "BOTELAN5",
		id = 1325,
		icon = "memory_botelan",
		is_open = 0
	},
	[1326] = {
		mask = "bg/bg_memory",
		subtitle = "",
		type = 1,
		title = "More Layers Than One",
		condition = "Begin \"Anything and Everything for Indy!\" Chapter 6.",
		story = "BOTELAN6",
		id = 1326,
		icon = "memory_botelan",
		is_open = 0
	},
	[1327] = {
		mask = "bg/bg_memory",
		subtitle = "",
		type = 1,
		title = "Happiness is Best When Shared",
		condition = "Begin \"Anything and Everything for Indy!\" Chapter 7.",
		story = "BOTELAN7",
		id = 1327,
		icon = "memory_botelan",
		is_open = 0
	},
	[1331] = {
		mask = "bg/bg_memory",
		subtitle = "",
		type = 1,
		title = "The Secret Spot",
		condition = "Begin \"A Lady's Modest Proposal\" Chapter 1.",
		story = "GUANGHUI1",
		id = 1331,
		icon = "memory_guanghui",
		is_open = 0
	},
	[1332] = {
		mask = "bg/bg_memory",
		subtitle = "",
		type = 1,
		title = "Consultation",
		condition = "Begin \"A Lady's Modest Proposal\" Chapter 2.",
		story = "GUANGHUI2",
		id = 1332,
		icon = "memory_guanghui",
		is_open = 0
	},
	[1333] = {
		mask = "bg/bg_memory",
		subtitle = "",
		type = 1,
		title = "An Unexpected Disaster?",
		condition = "Begin \"A Lady's Modest Proposal\" Chapter 3.",
		story = "GUANGHUI3",
		id = 1333,
		icon = "memory_guanghui",
		is_open = 0
	},
	[1334] = {
		mask = "bg/bg_memory",
		subtitle = "",
		type = 1,
		title = "Heart-pounding Intimacy?!",
		condition = "Begin \"A Lady's Modest Proposal\" Chapter 4.",
		story = "GUANGHUI4",
		id = 1334,
		icon = "memory_guanghui",
		is_open = 0
	},
	[1335] = {
		mask = "bg/bg_memory",
		subtitle = "",
		type = 1,
		title = "The Little Sister's Opinion",
		condition = "Begin \"A Lady's Modest Proposal\" Chapter 5.",
		story = "GUANGHUI5",
		id = 1335,
		icon = "memory_guanghui",
		is_open = 0
	},
	[1336] = {
		mask = "bg/bg_memory",
		subtitle = "",
		type = 1,
		title = "Holding Hands, Once More",
		condition = "Begin \"A Lady's Modest Proposal\" Chapter 6.",
		story = "GUANGHUI6",
		id = 1336,
		icon = "memor


  add    x6, x6, x2
    # Test Instruction
    fsw      f23, -2048(x6)
    # Check results:  mem[test_5_res+32] = 0x00000000bf800000
    ld x3, 32(x1)
    RVMODEL_IO_ASSERT_GPR_EQ(x2, x3, 0x00000000bf800000)

    RVTEST_SIGBASE(x6,signature_6_0)

    # Clear memory
    sd      x0, 0(x6)
    # Load values and compute offsets
    li      x8, 0x3a2b48ef
    fmv.w.x f22, x8
    addi    x5, x6,0
    li     x7, MASK_XLEN(2048)
    add    x5, x5, x7
    # Test Instruction
    fsw      f22, -2048(x5)
    # Check results:  mem[test_6_res+0] = 0x000000003a2b48ef
    ld x8, 0(x6)
    RVMODEL_IO_ASSERT_GPR_EQ(x7, x8, 0x000000003a2b48ef)

    # Clear memory
    sd      x0, 8(x6)
    # Load values and compute offsets
    li      x8, 0x3f800000
    fmv.w.x f21, x8
    addi    x4, x6,8
    li     x7, MASK_XLEN(2048)
    add    x4, x4, x7
    # Test Instruction
    fsw      f21, -2048(x4)
    # Check results:  mem[test_6_res+8] = 0x000000003f800000
    ld x8, 8(x6)
    RVMODEL_IO_ASSERT_GPR_EQ(x7, x8, 0x000000003f800000)

    # Clear memory
    sd      x0, 16(x6)
    # Load values and compute offsets
    li      x8, 0x4c50e7e7
    fmv.w.x f20, x8
    addi    x3, x6,16
    li     x7, MASK_XLEN(2048)
    add    x3, x3, x7
    # Test Instruction
    fsw      f20, -2048(x3)
    # Check results:  mem[test_6_res+16] = 0x000000004c50e7e7
    ld x8, 16(x6)
    RVMODEL_IO_ASSERT_GPR_EQ(x7, x8, 0x000000004c50e7e7)

    # Clear memory
    sd      x0, 24(x6)
    # Load values and compute offsets
    li      x8, 0xc61a5229
    fmv.w.x f19, x8
    addi    x2, x6,24
    li     x7, MASK_XLEN(2048)
    add    x2, x2, x7
    # Test Instruction
    fsw      f19, -2048(x2)
    # Check results:  mem[test_6_res+24] = 0x00000000c61a5229
    ld x8, 24(x6)
    RVMODEL_IO_ASSERT_GPR_EQ(x7, x8, 0x00000000c61a5229)

    # Clear memory
    sd      x0, 32(x6)
    # Load values and compute offsets
    li      x8, 0xc1458794
    fmv.w.x f18, x8
    addi    x1, x6,32
    li     x7, MASK_XLEN(2048)
    add    x1, x1, x7
    # Test Instruction
    fsw      f18, -2048(x1)
    # Check results:  mem[test_6_res+32] = 0x00000000c1458794
    ld x8, 32(x6)
    RVMODEL_IO_ASSERT_GPR_EQ(x7, x8, 0x00000000c14587


='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M0 10h10V0C8.141 0 7.212 0 6.44.154A8 8 0 0 0 .153 6.439C0 7.212 0 8.141 0 10Z' fill='red'/%3E%3C/svg%3E") no-repeat,
      right top / 10px url("data:image/svg+xml, %3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M0 0v10h10c0-1.859 0-2.788-.154-3.56A8 8 0 0 0 3.561.153C2.788 0 1.859 0 0 0Z' fill='red'/%3E%3C/svg%3E") no-repeat,
      right bottom / 10px url("data:image/svg+xml, %3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10 0H0v10c1.859 0 2.788 0 3.56-.154a8 8 0 0 0 6.286-6.285C10 2.788 10 1.859 10 0Z' fill='red'/%3E%3C/svg%3E") no-repeat,
      5px bottom / 10px url("data:image/svg+xml, %3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10 10V0H0c0 1.859 0 2.788.154 3.56a8 8 0 0 0 6.285 6.286C7.212 10 8.141 10 10 10Z' fill='red'/%3E%3C/svg%3E") no-repeat,
      linear-gradient(
        to right,
        transparent calc(5px + 10px),
        blue calc(5px + 10px),
        blue calc(100% - 10px),
        transparent calc(100% - 10px)
      ) no-repeat,
      right center / calc(100% - 5px) 100% linear-gradient(
        to bottom,
        transparent 10px,
        green 10px,
        green calc(100% - 10px),
        transparent calc(100% - 10px)
      ) no-repeat;
  }

  .mask-bubble-tail-r {
    mask:
      right 13px / 5px 18px url("data:image/svg+xml,%3Csvg width='5' height='18' viewBox='0 0 5 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 18c0-2.82 1.59-4.36 2.97-5.72C4.05 11.24 5 10.31 5 9c0-1.3-.95-2.24-2.03-3.28C1.6 4.36 0 2.82 0 0v18Z' fill='red'/%3E%3C/svg%3E") no-repeat,
      left top / 10px url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M0 10h10V0C8.141 0 7.212 0 6.44.154A8 8 0 0 0 .153 6.439C0 7.212 0 8.141 0 10Z' fill='red'/%3E%3C/svg%3E") no-repeat,
      right 5px top / 10px url("data:image/svg+xml, %3Csv


   );
  });

  it('should display a workflow URL with overiding query params', () => {
    const workflow = { id: 'id', runId: 'run' } as WorkflowExecution;
    const query = new URLSearchParams({ a: '1', b: '2' });
    const overrides = new URLSearchParams({ b: '3' });

    expect(getWorkflowExecutionUrl('default', workflow, query, overrides)).toBe(
      '/namespaces/default/workflows/id/run?a=1&b=3',
    );
  });
});
/*
 * @Author: Drazy
 * @Date: 2021-10-13 17:44:42
 * @LastEditors: Drazy
 * @LastEditTime: 2021-11-01 19:55:11
 */
export default interface Iiterator {
  // 得到集合的第一个对象
  first(): object
  // 得到集合的下一个对象
  next(): object | undefined
  // 判断当前是否遍历到结尾，到结尾的话返回 true
  isDone(): boolean
  // 返回当前集合对象
  currentItem(): object
}
import { BehaviorSubject } from "rxjs";
import { MyDataType } from "../interfaces/my-data";

class MyServiceController {
  public myData: BehaviorSubject<MyDataType[]> = new BehaviorSubject<MyDataType[]>([]);
  private testStorage: MyDataType[] = []; // Just for testing

  constructor() {}

  load(): void {
    this.myData.next(this.testStorage);
  }

  addData(data): void {
    this.testStorage.push(data);
    this.myData.next(this.testStorage);
  }
}

export const MyService = new MyServiceController();
export interface ICategory {
  /**
   * The ID of the category.
   */
  id: string;

  /**
   * The name of the category.
   */
  name: string;

  /**
   * A hex code for the color of the category.
   */
  color: string;

  /**
   * If present, the account to transfer the amount to.
   */
  accountTransferId?: string;
}
import 'mocha';
import { expect } from 'chai';
import memoize from '@/function/memoize';

describe('memoize', () => {
  it('create a function', () => {
    const add = memoize((x, y) => {
      return x + y;
    });
    expect(typeof add).to.equal('function');
  });

  it('returns value from cache', () => {
    // use type any to ignore tslint check
    const add: any = memoize(
      (x: number, y: number): number => {
        return x + y;
      }
    );
    expect(add(1, 2)).to.equal(3);
    expect(add(1, 2)).to.equal(3);
    expect(add.cache[1]).to.equal(3);
  });

  it('uses the first parameter as cache key by default', () => {
    // use type any to ignore tslint check
    const add: any = memoize(
      (x: number, y: number): number => {
        return x + y;
      }
    );
    expect(add(1, 2)).to.equal(3);
    expect(add.cache[1]).to.equal(3);
  });

  it('sets resolves by function', () => {
    const add: any = memoize(
      (x: number, y: number): number => {
        return x + y;
      },
      (...args) => {
        return args.join('-');
      }
    );

    expect(add(1, 2)).to.equal(3);
    expect(add.cache['1-2']).to.equal(3);
  });
});
import { BlockNode, StatementNode } from '@alchemy/ast';
import { NodeSerializer } from '../../NodeSerializer';
import { SerializingContext } from '../../SerializingContext';

export type BlockSerializerChildren = {
    statement: StatementNode;
};

export class BlockSerializer extends NodeSerializer<BlockNode, BlockSerializerChildren> {
    serialize(node: BlockNode, context: SerializingContext): string {
        const sub = context.nest();
        const cap = !node.isExpressionStatement;
        const statements = node.statements
            .map


4.067S38.922 15 38.922 15s0-2.986-.803-4.142a14.282 14.282 0 00-9.472-5.587c-6.133-.931-11.025-1.252-14.77.385-1.21.529-5.074 4.207-4.785 7.835s.6 8.443.6 8.443"/><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M19.24 14.615c.257-1.253 2.73-3.565 3.757-4.014a36.842 36.842 0 014.72-1.092 5.38 5.38 0 01-.951 3.54 6.922 6.922 0 01-1.458 1.565 26.25 26.25 0 01-3.05 2.312"/><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M26.765 13.05c1.65-1.212 4.194-1.678 6.478-2.352.028 1.83-.825 5.298-2.887 7m1.952 3.371c2.215-.996 3.018-3.789 3.436-6.069m-21.032-1.573c.16-3.243 4.669-5.84 6.027-6.532m-8.371 6.323c.353-2.232 2.183-6.053 3.018-6.663m4.303 20.572c2.472-.086 5.234-.257 5.94-.685a19.694 19.694 0 012.633-1.07m-17.564-3.469c.835.643 2.216 2.023 3.05 2.585s2.505 1.558 2.505 1.558m-.273 5.201c-.85.707-1.776 2.014-.868 3.05m-1.797 2.81a2.637 2.637 0 002.296 1.51 21.512 21.512 0 004.656-.225m-5.529 1.541a8.147 8.147 0 013.634.498m0-14.23c-.15-.594.867-1.713.867-1.713m4.909 3.527.141-.025m-11.178-2.41.126.104"/></svg>';
  static const String shaadi =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" preserveAspectRatio="xMidYMid meet" viewBox="0 0 48 48"><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M13.327 39.078a9.036 9.036 0 006.356 4.363c2.328.132 5.444 0 7.258 0 3.632 0 8.05-4.363 8.05-9.696a8.731 8.731 0 00-7.29-8.762s-4.703-.962-8.878-1.794c-3.818-.762-5.813-3.504-5.813-8.837 0-9.115 4.63-9.412 6.355-9.696a11.88 11.88 0 013.814 0 7.756 7.756 0 016.006 4.538"/></svg>';
  static const String shaarlier =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" preserveAspectRatio="xMidYMid meet" viewBox="0 0 48 48"><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M24 3.46c4.843 0 5.73 5.972 5.7


z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-127.505,96.979c0,0 0.975,1.629 0.236,1.996c-0.738,0.368 -37.723,-34.476 -54.832,-22.914c0,0 12.297,-14.8 54.596,20.918z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-127.62,101.349c0,0 1.122,1.531 0.421,1.966c-0.701,0.434 -40.77,-30.813 -56.728,-17.708c0,0 10.865,-15.881 56.307,15.742z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-129.83,103.065c0.503,6.048 1.491,12.617 3.23,15.736c0,0 -3.6,12.4 5.2,25.6c0,0 -0.4,7.2 1.2,10.4c0,0 4,8.4 8.8,9.2c3.884,0.647 12.607,3.716 22.468,5.12c0,0 17.132,14.08 13.932,26.88c0,0 -0.4,16.4 -4,18c0,0 11.6,-11.2 2,5.6L-81.4,238.401c0,0 25.6,-21.6 10,-3.2L-81.4,261.201c0,0 19.6,-18.4 12.4,-10L-72.2,260.001c0,0 43.2,-27.2 12.4,2.4c0,0 8,-3.6 12.4,-0.8c0,0 6.8,-1.2 6,0.4c0,0 -20.8,10.4 -24.4,28.8c0,0 8.4,-10 5.2,0.8L-60.2,303.201c0,0 4,-21.6 3.6,16c0,0 19.2,-18 7.6,2.8L-49,338.801c0,0 15.2,-16.4 8.8,-3.6c0,0 10,-8.8 6,6.4c0,0 -0.8,10.4 3.6,-0.8c0,0 16,-30.6 10,-4.4c0,0 -0.8,19.2 4,4.4c0,0 0.4,10.4 9.6,17.6c0,0 -1.2,-50.8 11.6,-14.8L8.6,360.001c0,0 2.8,-9.2 2.4,-14.4c0,0 14.8,-16.4 8,8c0,0 15.2,-22.8 12,-9.6c0,0 -7.6,16 -6,20.8c0,0 16.8,-34.8 18,-36.4c0,0 -2,42.401 8.8,6.4c0,0 5.6,12 2.8,16.4c0,0 8,-8 7.2,-11.2c0,0 4.6,-8.2 7.4,5.4c0,0 1.8,9.4 3.4,6.


;
				int fixed = 0;

				while (statusIterator.hasNext()) {
					GpsSatellite sat = statusIterator.next();
					if (sat.usedInFix() == true) {
						fixed++;
					}
					satellites++;

					/* satellite signal strength
					if (sat.usedInFix()) {
						Log.d(cgSettings.tag, "Sat #" + satellites + ": " + sat.getSnr() + " FIX");
					} else {
						Log.d(cgSettings.tag, "Sat #" + satellites + ": " + sat.getSnr());
					}
					 */
				}

				boolean changed = false;
				if (satellitesVisible == null || satellites != satellitesVisible) {
					satellitesVisible = satellites;
					changed = true;
				}
				if (satellitesFixed == null || fixed != satellitesFixed) {
					satellitesFixed = fixed;
					changed = true;
				}

				if (changed == true) {
					selectBest(null);
				}
			}
		}
	}

	private void selectBest(String initProvider) {
		if (locNet == null && locGps != null) { // we have only GPS
			assign(locGps);
			return;
		}

		if (locNet != null && locGps == null) { // we have only NET
			assign(locNet);
			return;
		}

		if (satellitesFixed > 0) { // GPS seems to be fixed
			assign(locGps);
			return;
		}

		if (initProvider != null && initProvider.equals(LocationManager.GPS_PROVIDER) == true) { // we have new location from GPS
			assign(locGps);
			return;
		}

		if (locGpsLast > (System.currentTimeMillis() - 30 * 1000)) { // GPS was working in last 30 seconds
			assign(locGps);
			return;
		}

		assign(locNet); // nothing else, using NET
	}

	private void assign(Double lat, Double lon) {
		if (lat == null || lon == null) {
			return;
		}

		gps = -1;
		latitudeNow = lat;
		longitudeNow = lon;
		altitudeNow = null;
		bearingNow = new Double(0);
		speedNow = 0f;
		accuracyNow = 999f;

		if (geoUpdate != null) {
			geoUpdate.updateLoc(this);
		}
	}

	private void assign(Location loc) {
		if (loc == null) {
			gps = -1;
			return;
		}

		location = loc;

		String provider = location.getProvider();
		if (provider.equals(LocationManager.GPS_PROVIDER) == true) {
			gps = 1;
		} else if (provider.equals(LocationManager.NETWORK_PROVIDER) == true) {
			gps = 0;
		} else if (provider.equals("last") == true) {
			gps = -1;
		}

		latitudeNow = location.getLatitude();
		longitudeNow = location.getLongitude();
		app.setLastLoc(latitudeNow, longitudeNow);

		if (location.hasAltitude() && gps != -1) {
			altitudeNow = location.getAltitude() + settings.altCorrection;
		} else {
			altitudeNow = null;
		}
		if (location.hasBearing() && gps != -1) {
			bearingNow = new Double(location.getBearing());
		} else {
			bearingNow = new Double(0);
		}
		if (location.hasSpeed() && gps != -1) {
			speedNow = location.getSpeed();
		} else {
			speedNow = 0f;
		}
		if (location.hasAccuracy() && gps != -1) {
			accuracyNow = location.getAccuracy();
		} else {
			accuracyNow = 999f;
		}

		if (gps == 1) {
			// save travelled distance only when location is from GPS
			if (latitudeBefore != null && longitudeBefore != null && latitudeNow != null && longitudeNow != null) {
				final double dst = cgBase.getDistance(latitudeBe


de: $('select[name=code]', container).val(),
          amount_1000: $('input[name=amount_1000]', container).val(),
          fallback_value: $('input[name=fallback_value]', container).val()
        };
      }
      if (obj.type === 'date_time') {
        obj.date_time = {
          fallback_value: $('input[name=fallbackValue]', container).val()
        };
      }
      params.push(obj);
    }
    return params;
  };

  $.fn.RB_setWhatsappParams = function(item) {
    var container = $(this);
    if (item != null) {
      $('select[name=type]', container).val(item.type);
      $('.panel-' + item.type, container).css('display', 'inline-block');
      if (item.type === 'text') {
        $('input[name=text]', container).val(item.text);
      }
      if (item.type === 'video') {
        $('input[name=video]', container).val(item.video);
      }
      if (item.type === 'image') {
        $('input[name=image]', container).val(item.image);
      }
      if (item.type === 'document') {
        $('input[name=document]', container).val(item.document);
      }
      if (item.type === 'date_time') {
        $('input[name=fallbackValue]', container).val(item.date_time.fallback_value);
      }
      if (item.type === 'currency') {
        $('select[name=code]', container).val(item.currency.code);
        $('input[name=amount_1000]', container).val(item.currency.amount_1000);
        $('input[name=fallback_value]', container).val(item.currency.fallback_value);
      }
    }
  };

  $.fn.RB_mountWhatsappParams = function(options) {
    options = options != null ? options : {};
    var container = $(this).css('paddingBottom', '5px');
    var main = $('
').appendTo(container);
    var types = options.types ? options.types : ['currency', 'date_time', 'document', 'image', 'text', 'video'];
    var typesLabels = {
      currency: 'Currency',
      date_time: 'Date-time',
      document: 'Document',
      image: 'Image',
      text: 'Text',
      video: 'Viceo'
    }
    var selectButtonType = $('<select name="type"></select>')
      .attr('style', 'width:100px; margin-left: 5px;')
      .attr('placeholder', 'Select parameter type')
      .change(function() {
        var type = $(this).val();
        $('.panel', container).hide();
        $('.panel-' + type, container).css('display', 'inline-block');
      })
      .appendTo(main);
    $('<option value="">Select type</option>').appendTo(selectButtonType);
    types.forEach(type => $('<option value="' + type + '">' + typesLabels[type] + '</option>').appendTo(selectButtonType));

    var panelText = $('
').appendTo(container);
    $('
')
      .append($('<input style="width:100%" type="text" name="text" placeholder="Text value"/>'))
      .appendTo(panelText);

    var panelImage = $('
').appendTo(container);
    $('
')
      .append($('<input style="width:100%" type="text" name="image" placeholder="Image URL or path"/>'))
      .appendTo


a

dŀ@shdZddlZGdddejZGdddejZGdddejZGd	d
d
eejZGdddeejZd
dZee	dZ
e
dddddddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddZdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd	d
ddd
dddddddddd5dddddddddd d!d"dd|ddd#ddwd$d%dd&d2d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPddQdRd#dSdTdUdVdWd!dXdYdZd[d\d]d^d_d`dadbdcd6dddedfdgdhdidjdkdldmddxd dndoZ
dS(pz` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py.

Nc@s eZdZdddZdddZdS)	CodecstrictcCst||tSN)codecscharmap_encodeencoding_mapselfinputerrorsrV/home/tom/ab/renpy-build-fix/tmp/install.linux-x86_64/lib/python3.9/encodings/cp869.pyencodeszCodec.encodecCst||tSr)rcharmap_decodedecoding_tablerrrr
decodeszCodec.decodeN)r)r)__name__
__module____qualname__rrrrrr
r	s
rc@seZdZdddZdS)IncrementalEncoderFcCst||jtdSNr)rrrrr	r
finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZdddZdS)IncrementalDecoderFcCst||jtdSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)StreamWriterNrrrrrrr
rsrc@seZdZdS)StreamReaderNrrrrr
rsrc	Cs tjdtjtjttttdS)Ncp869)namerrincrementalencoderincrementaldecoderstreamreaderstreamwriter)	r	CodecInforrrrrrrrrrr
getregentry!sr$   %%%%$%c%Q%W%]%%%4%,%%%<%Z%T%i%f%`%P%l%%%%%%%)rr9r)rrr4rKr(rrrr6r7r'rLrHu

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ά·¬¦‘’Έ―ΉΊΪΌΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄±υφχ§ψ΅°¨ωϋΰώ■

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr	rrrrrrrrrrrrrrrrrrrrrrrrrrrr
rrrr


pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 ltcTextureCoords( const in GeometricContext geometry, const in float roughness ) {\n\tconst float LUT_SIZE  = 64.0;\n\tconst float LUT_SCALE = (LUT_SIZE - 1.0)/LUT_SIZE;\n\tconst float LUT_BIAS  = 0.5/LUT_SIZE;\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nvoid clipQuadToHorizon( inout vec3 L[5], out int n ) {\n\tint config = 0;\n\tif ( L[0].z > 0.0 ) config += 1;\n\tif ( L[1].z > 0.0 ) config += 2;\n\tif ( L[2].z > 0.0 ) config += 4;\n\tif ( L[3].z > 0.0 ) config += 8;\n\tn = 0;\n\tif ( config == 0 ) {\n\t} else if ( config == 1 ) {\n\t\tn = 3;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 2 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 3 ) {\n\t\tn = 4;\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t\tL[3] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 4 ) {\n\t\tn = 3;\n\t\tL[0] = -L[3].z * L[2] + L[2].z * L[3];\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t} else if ( config == 5 ) {\n\t\tn = 0;\n\t} else if ( config == 6 ) {\n\t\tn = 4;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 7 ) {\n\t\tn = 5;\n\t\tL[4] = -L[3].z * L[0] + L[0].z * L[3];\n\t\tL[3


numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center !important}.markdown-preview:not([for="preview"]) .code-chunk .btn-group{display:none}.markdown-preview:not([for="preview"]) .code-chunk .status{display:none}.markdown-preview:not([for="preview"]) .code-chunk .output-div{margin-bottom:16px}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0}@media screen and (min-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px)}}@media screen and (max-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{font-size:14px !important;padding:1em}}@media print{html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,0.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba


		*pending_lt_ptr = MATCHFINDER_INITVAL;
			*pending_gt_ptr = MATCHFINDER_INITVAL;
			return lz_matchptr;
		}
	}
}

/*
 * Retrieve a list of matches with the current position.
 *
 * @mf
 *	The matchfinder structure.
 * @in_base
 *	Pointer to the next byte in the input buffer to process _at the last
 *	time bt_matchfinder_init() or bt_matchfinder_slide_window() was called_.
 * @cur_pos
 *	The current position in the input buffer relative to @in_base (the
 *	position of the sequence being matched against).
 * @max_len
 *	The maximum permissible match length at this position.  Must be >=
 *	BT_MATCHFINDER_REQUIRED_NBYTES.
 * @nice_len
 *	Stop searching if a match of at least this length is found.
 *	Must be <= @max_len.
 * @max_search_depth
 *	Limit on the number of potential matches to consider.  Must be >= 1.
 * @next_hashes
 *	The precomputed hash codes for the sequence beginning at @in_next.
 *	These will be used and then updated with the precomputed hashcodes for
 *	the sequence beginning at @in_next + 1.
 * @lz_matchptr
 *	An array in which this function will record the matches.  The recorded
 *	matches will be sorted by strictly increasing length and (non-strictly)
 *	increasing offset.  The maximum number of matches that may be found is
 *	'nice_len - 2'.
 *
 * The return value is a pointer to the next available slot in the @lz_matchptr
 * array.  (If no matches were found, this will be the same as @lz_matchptr.)
 */
static forceinline struct lz_match *
bt_matchfinder_get_matches(struct bt_matchfinder *mf,
			   const u8 *in_base,
			   ptrdiff_t cur_pos,
			   u32 max_len,
			   u32 nice_len,
			   u32 max_search_depth,
			   u32 next_hashes[2],
			   struct lz_match *lz_matchptr)
{
	return bt_matchfinder_advance_one_byte(mf,
					       in_base,
					       cur_pos,
					       max_len,
					       nice_len,
					       max_search_depth,
					       next_hashes,
					       lz_matchptr,
					       true);
}

/*
 * Advance the matchfinder, but don't record any matches.
 *
 * This is very similar to bt_matchfinder_get_matches() because both functions
 * must do hashing and tree re-rooting.
 */
static forceinline void
bt_matchfinder_skip_byte(struct bt_matchfinder *mf,
			 const u8 *in_base,
			 ptrdiff_t cur_pos,
			 u32 nice_len,
			 u32 max_search_depth,
			 u32 next_hashes[2])
{
	bt_matchfinder_advance_one_byte(mf,
					in_base,
					cur_pos,
					nice_len,
					nice_len,
					max_search_depth,
					next_hashes,
					NULL,
					false);
}

#endif /* LIB_BT_MATCHFINDER_H */


        return PositionSample{
            PointGeometry::make_degenerated(position_),
            Vec3(1_f)
        };
    }

    virtual Float pdf_position(const PointGeometry&) const override {
        return 1_f;
    }

    // --------------------------------------------------------------------------------------------

    virtual std::optional<RaySample> sample_direct(const RaySampleU&, const PointGeometry& geom) const override {
        if (geom.infinite) {
            // Direct connection from the infinitely-distant point
            return {};
        }
        const auto geomE = PointGeometry::make_degenerated(position_);
        const auto wo = glm::normalize(geom.p - position_);
        const auto We = Vec3(J(wo));
        const auto p = pdf_direct(geom, geomE, wo);
        if (p == 0_f) {
            return {};
        }
        return RaySample{
            geomE,
            wo,
            We / p
        };
    }

    virtual Float pdf_direct(const PointGeometry& geom, const PointGeometry& geomE, Vec3) const override {
        if (geom.infinite) {
            return 0_f;
        }
        const auto G = surface::geometry_term(geom, geomE);
        return G == 0_f ? 0_f : 1_f / G;
    }

    // --------------------------------------------------------------------------------------------

    virtual std::optional<Vec2> raster_position(Vec3 wo) const override {
        // Convert to camera space
        const auto to_eye = glm::transpose(Mat3(u_, v_, w_));
        const auto wo_eye = to_eye * wo;
        if (wo_eye.z >= 0) {
            // wo is directed to the opposition direction
            return {};
        }

        // Calculate raster position
        const auto rp = Vec2(
            -wo_eye.x / wo_eye.z / tf_ / aspect_,
            -wo_eye.y / wo_eye.z / tf_) * .5_f + .5_f;
        if (rp.x < 0_f || rp.x > 1_f || rp.y < 0_f || rp.y > 1_f) {
            // wo is not in the view frustum
            return {};
        }

        return rp;
    }

    virtual bool is_connectable(const PointGeometry&) const override {
        return true;
    }

    virtual Vec3 eval(Vec3 wo) const override {
        if (!raster_position(wo)) {
            return Vec3(0_f);
        }
        return Vec3(J(wo));
    }
};

LM_COMP_REG_IMPL(Camera_Pinhole, "camera::pinhole");

LM_NAMESPACE_END(LM_NAMESPACE)
/*
    Lightmetrica - Copyright (c) 2019 Hisanari Otsu
    Distributed under MIT license. See LICENSE file for details.
*/

#include <pch.h>
#include <lm/core.h>
#include <lm/model.h>
#include <lm/objloader.h>
#include <lm/mesh.h>
#include <lm/material.h>
#include <lm/texture.h>
#include <lm/film.h>
#include <lm/light.h>
#include <lm/surface.h>

#define NO_MIXTURE_MATERIAL 0

LM_NAMESPACE_BEGIN(LM_NAMESPACE)

using namespace objloader;
class Mesh_WavefrontObjRef;

/*
\rst
.. function:: model::wavefrontobj

    Wavefront OBJ model.

    :param str path: Path to ``.obj`` file.
\endrst
*/
class Model_WavefrontObj final : public Model {
private:
    friend class Mesh_WavefrontObjRef;

private:
    // Surface geometry
    OBJSurfaceGeometry geo_;

    // Underlying assets
    std::vector<Component::Ptr<Component>> assets_;
    std::unordered_map<std::string, int> assets_map_;

    // Mesh group which assocites a mesh and a material
    struct Group {
        int mesh;
        int material;
        int light;

        template <typename Archive>
        void serialize(Archive& ar) {
            ar(mesh, material, light);
        }
    };
    std::vector<Group> groups_;

public:
    LM_SERIALIZE_IMPL(ar) {
        ar(geo_, groups_, assets_map_, assets_);
    }

    virtual void foreach_underlying(const ComponentVisitor& visit) override {
        for (au


import asyncio
import logging
import os

from dotenv import load_dotenv
from rich.console import Console
from rich.panel import Panel
from rich.theme import Theme

from stagehand import Stagehand, StagehandConfig, configure_logging

# Create a custom theme for consistent styling
custom_theme = Theme(
    {
        "info": "cyan",
        "success": "green",
        "warning": "yellow",
        "error": "red bold",
        "highlight": "magenta",
        "url": "blue underline",
    }
)

# Create a Rich console instance with our theme
console = Console(theme=custom_theme)

load_dotenv()

# Configure logging with the utility function
configure_logging(
    level=logging.INFO,  # Set to INFO for regular logs, DEBUG for detailed
    quiet_dependencies=True,  # Reduce noise from dependencies
)

async def main():
    # Build a unified configuration object for Stagehand
    config = StagehandConfig(
        env="BROWSERBASE",
        # env="LOCAL",
        api_key=os.getenv("BROWSERBASE_API_KEY"),
        project_id=os.getenv("BROWSERBASE_PROJECT_ID"),
        model_name="gpt-4o",
        self_heal=True,
        system_prompt="You are a browser automation assistant that helps users navigate websites effectively.",
        model_client_options={"apiKey": os.getenv("MODEL_API_KEY")},
        verbose=2,
    )

    # Create a Stagehand client using the configuration object.
    stagehand = Stagehand(config)

    # Initialize - this creates a new session automatically.
    console.print("\n🚀 [info]Initializing Stagehand...[/]")
    await stagehand.init()
    if stagehand.env == "BROWSERBASE":
        console.print(f"\n[yellow]Created new session:[/] {stagehand.session_id}")
        console.print(
            f"🌐 [white]View your live browser:[/] [url]https://www.browserbase.com/sessions/{stagehand.session_id}[/]"
        )

    console.print("\n▶ [highlight] Navigating[/] to Google")
    await stagehand.page.goto("https://google.com/")
    console.print("✅ [success]Navigated to Google[/]")

    console.print("\n▶ [highlight] Using Agent to perform a task[/]: playing a game of 2048")
    agent = stagehand.agent(
        model="gemini-2.5-computer-use-preview-10-2025",
        instructions="You are a helpful web navigation assistant that helps users find information. You are currently on the following page: google.com. Do not ask follow up questions, the user will trust your judgement.",
        options={"apiKey": os.getenv("GEMINI_API_KEY")}
    )
    agent_result = await agent.execute(
        instruction="Play a game of 2048",
        max_steps=20,
        auto_screenshot=True,
    )

    console.print("📊 [info]Agent execution result:[/]")
    console.print(f"✅ Success: [bold]{'Yes' if agent_result.success else 'No'}[/]")
    console.print(f"🎯 Completed: [bold]{'Yes' if agent_result.completed else 'No'}[/]")
    if agent_result.message:
        console.print(f"💬 Message: [italic]{agent_result.message}[/]")

    if agent_result.actions:
        console.print(f"🔄 Actions performed: [bold]{len(agent_result.actions)}[/]")
        for i, action in enumerate(agent_result.actions):
            console.print(f"  Action {i+1}: {action.get('type', 'Unknown')} - {action.get('description', 'No description')}")

    # For debugging, you can also print the full JSON
    console.print("[dim]Full response JSON:[/]")
    console.print_json(f"{agent_result.model_dump_json()}")

    # Close the session
    console.print("\n⏹  [warning]Closing session...[/]")
    await stagehand.close()
    console.print("✅ [success]Session closed successfully![/]")
    console.rule("[bold]End of Example[/]")

if __name__ == "__main__":
    # Add a fancy header
    console.print(
        "\n",
        Panel(
            "[light_gray]Stagehand 🤘 Agent Example[/]",
            border_style="green",
            padding=(1, 10),
        ),
    )
    asyncio.run(main())