import torch
import torch.nn as nn

from .baseRNN import baseRNN

class VanillaRNN(baseRNN):

    def __init__(self, vocab_size, embedding_size ,hidden_size, verb_size, cap_size, input_dropout_p=0,
                 output_dropout_p=0.1, n_layers=4, bidirectional=True, rnn_cell='lstm'):

        super(VanillaRNN, self).__init__(vocab_size, hidden_size, input_dropout_p,
                                             output_dropout_p, n_layers, rnn_cell)

        self.embedding = nn.Embedding(vocab_size, embedding_size)

        augmented_embedding_size = embedding_size + verb_size + cap_size
        self.rnn = self.rnn_cell(augmented_embedding_size, hidden_size, n_layers,
                                 bidirectional=bidirectional, dropout=output_dropout_p,
                                 batch_first=True)

    def forward(self, words, verb_embedding, cap_embedding, input_lengths):

        embedded = self.embedding(words)
        if cap_embedding is not None:
            embedded = torch.cat((embedded,verb_embedding,cap_embedding),2)
        else:
            embedded = torch.cat((embedded,verb_embedding),2)

        embedded = self.input_dropout(embedded)
        embedded = nn.utils.rnn.pack_padded_sequence(embedded, input_lengths, batch_first= True)
        output, _ = self.rnn(embedded)
        output, _ = nn.utils.rnn.pad_packed_sequence(output, batch_first= True)

        return output


////////////////////////////////////////////////////////////////////////////////
//
//  Track.cs - This file is part of LibVLC.NET.
//
//    Copyright (C) 2011 Boris Richter <himself@boris-richter.net>
//
//  ==========================================================================
//
//  LibVLC.NET is free software; you can redistribute it and/or modify it
//  under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation; either version 2.1 of the License, or (at
//  your option) any later version.
//
//  LibVLC.NET is distributed in the hope that it will be useful, but WITHOUT
//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
//  License for more details.
//
//  You should have received a copy of the GNU Lesser General Public License
//  along with LibVLC.NET; if not, see http://www.gnu.org/licenses/.
//
//  ==========================================================================
//
//  $LastChangedRevision$
//  $LastChangedDate$
//  $LastChangedBy$
//
////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Concurrent;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;

namespace LibVLC.NET
{

  //****************************************************************************
  /// <summary>
  ///   Base class for all track classes.
  /// </summary>
  /// <seealso cref="VideoTrack"/>
  /// <seealso cref="AudioTrack"/>
  /// <seealso cref="SubtitleTrack"/>
  public class Track
  {
    //==========================================================================
    private static readonly ConcurrentDictionary<string, CultureInfo> m_Cultures = new ConcurrentDictionary<string, CultureInfo>();

    //==========================================================================
    private static CultureInfo GetCulture(string nativeName)
    {
      return m_Cultures.GetOrAdd(nativeName,
        delegate
        {
          foreach(CultureInfo culture in CultureInfo.GetCultures(CultureTypes.AllCultures))
            if(culture.NativeName == nativeName)
              return culture;
          return null;
        });
    }

    //==========================================================================
    private static readonly Regex m_NameLanguageRegex = new Regex(@"^(.*)\s-\s\[(.*)\]$");

    //==========================================================================
    internal Track(int index, LibVLCLibrary.libvlc_track_description_t trackDescription, LibVLCLibrary.libvlc_media_track_info_t? trackInfo)
    {
      m_Name = trackDescription.psz_name;

      // Title 1 - [Deutsch]
      // Title 2 - [English]
      Match match = m_NameLanguageRegex.Match(m_Name);
      if(match.Success)
      {
        m_Title = match.Groups[1].Value;
        m_Language = match.Groups[2].Value;
        m_Culture = GetCulture(m_Language);
      }
      else
      {
        m_Title = trackDescription.psz_name;
        m_Language = null;
        m_Culture = null;
      }

      if(trackInfo.HasValue)
      {
        m_Codec = Encoding.ASCII.GetString(BitConverter.GetBytes(trackInfo.Value.i_codec));
        for(int i = 0; i < m_Codec.Length; ++i)
          if(m_Codec[i] == '\0')
          {
            m_Co


vel 5

这一关执行程序没有任何输出，没有提示，还是直接看反汇编出来的代码吧。代码

可以看到，程序首先打开了密码文件/etc/behemoth_pass/behemoth6，然后建立了localhost:1337的socket，再用sendto函数将文件内容发送出去。程序的流程很明显了，接下来我们只要监听本地端口1337就可以收到密码了。需要注意的是sendto是用UDP协议发送的，需要监听该端口的UDP数据包。

使用瑞士军刀nc进行监听，然后在另外一个shell中执行程序，nc就会输出收到的UDP数据包内容了。

shell 1

shell 2

shell 1

level 6

这一关有两个可执行程序，执行程序都没有得到任何有意义的结果，还是直接看反汇编出来的代码吧。

第一个主程序与第二个程序/behemoth/behemoth6_reader建立一个管道，然后通过管道读取，如果读到的内容等于HelloKitty，这样就会执行execl()，建立一个<


# Generated by Django 4.2.24 on 2025-09-24 14:33

from django.db import migrations

def add_italy_vs_germany_variant(apps, schema_editor):
    Variant = apps.get_model("variant", "Variant")
    Variant.objects.create(
        id="italy-vs-germany",
        name="Italy vs Germany",
        description="A two player variant on the classical map.",
        author="Allan B. Calhamer",
    )

def remove_italy_vs_germany_variant(apps, schema_editor):
    Variant = apps.get_model("variant", "Variant")
    Variant.objects.filter(id="italy-vs-germany").delete()

class Migration(migrations.Migration):

    dependencies = [
        ("variant", "0002_add_classical_variant"),
    ]

    operations = [
        migrations.RunPython(
            add_italy_vs_germany_variant,
            remove_italy_vs_germany_variant,
        ),
    ]


ndCreateDateTime("2019-12-31 22:00")
        assertEquals(365, dateTime!!.numberOfDaysInYear, "Europe-Berlin: 2020! UTC: ${dateTime.isoString}")
    }

    @Test
    fun sqlDateTest() {
        var sqlDate = PFDateTimeUtils.parseAndCreateDateTime("2019-12-06 23:30")!!.sqlDate
        var localDate = sqlDate.toLocalDate()
        assertEquals(2019, localDate.year)
        assertEquals(Month.DECEMBER, localDate.month)
        assertEquals(7, localDate.dayOfMonth)
        sqlDate = PFDateTimeUtils.parseAndCreateDateTime("2019-12-06 22:30")!!.sqlDate
        localDate = sqlDate.toLocalDate()
        assertEquals(2019, localDate.year)
        assertEquals(Month.DECEMBER, localDate.month)
        assertEquals(6, localDate.dayOfMonth)
    }

    @Test
    fun weekOfYearTest() {
        val storedDefaultLocale = ConfigurationServiceAccessor.get().defaultLocale
        ConfigurationServiceAccessor.internalSetLocaleForJunitTests(Locale("de", "DE"))
        PFDay.resetWeekFieldsForTest() // Force recalculation of weekFields

        checkISOWeeks()

        ConfigurationServiceAccessor.internalSetLocaleForJunitTests(Locale("en", "US"))
        PFDay.resetWeekFieldsForTest() // Force recalculation of weekFields
        // US weeks:
        var dateTime = PFDateTimeUtils.parseAndCreateDateTime("2020-12-31 10:00")
        assertEquals(1, dateTime!!.weekOfYear)
        dateTime = PFDateTimeUtils.parseAndCreateDateTime("2021-01-02 10:00")
        assertEquals(1, dateTime!!.weekOfYear)
        dateTime = PFDateTimeUtils.parseAndCreateDateTime("2021-01-04 10:00")
        assertEquals(2, dateTime!!.weekOfYear)

        dateTime = PFDateTimeUtils.parseAndCreateDateTime("2019-12-31 10:00")
        assertEquals(1, dateTime!!.weekOfYear)
        dateTime = PFDateTimeUtils.parseAndCreateDateTime("2020-01-02 10:00")
        assertEquals(1, dateTime!!.weekOfYear)

        ConfigurationServiceAccessor.internalSetMinimalDaysInFirstWeekForJunitTests(4)
        PFDay.resetWeekFieldsForTest() // Force recalculation of weekFields
        checkISOWeeks()
        ConfigurationServiceAccessor.internalSetMinimalDaysInFirstWeekForJunitTests(null)

        ConfigurationServiceAccessor.internalSetLocaleForJunitTests(storedDefaultLocale)
        PFDay.resetWeekFieldsForTest() // Force recalculation of weekFields
    }

    private fun checkISOWeeks() {
        // German weeks:
        var dateTime = PFDateTimeUtils.parseAndCreateDateTime("2020-12-31 10:00")
        assertEquals(53, dateTime!!.weekOfYear)
        dateTime = PFDateTimeUtils.parseAndCreateDateTime("2021-01-02 10:00")
        assertEquals(53, dateTime!!.weekOfYear)
        dateTime = PFDateTimeUtils.parseAndCreateDateTime("2021-01-04 10:00")
        assertEquals(1, dateTime!!.weekOfYear)

        dateTime = PFDateTimeUtils.parseAndCreateDateTime("2019-12-31 10:00")
        assertEquals(1, dateTime!!.weekOfYear)
        dateTime = PFDateTimeUtils.parseAndCreateDateTime("2020-01-02 10:00")
        assertEquals(1, dateTime!!.weekOfYear)
    }

    @Test
    fun ensurePrecision() {
        assertPrecision("1970-11-20 23:00:00", "1970-11-21 21:04:50", DatePrecision.DAY)

        assertPrecision("1970-11-21 04:00:00", "1970-11-21 04:50:23", DatePrecision.HOUR_OF_DAY)

        assertPrecision("1970-11-21 04:50:00", "1970-11-21 04:50:23", DatePrecision.MINUTE)

        assertPrecision("1970-


(System.currentTimeMillis());
        request.multiMessage = weiboMessage;

        // 3. 发送请求消息到微博，唤起微博分享界面
        if (isClientOnly) {
            GGOfficiialSDK.mWeiboShareAPI.sendRequest(activity, request);
        } else {
            Oauth2AccessToken accessToken = AccessTokenKeeper.readAccessToken(activity);
            String token = "";
            if (accessToken != null) {
                token = accessToken.getToken();
            }
            GGOfficiialSDK.mWeiboShareAPI.sendRequest(activity, request, GGOfficiialSDK.mAuthInfo, token, weiboAuthListener);
        }
    }
}
package com.share.api.tencent.qq;

import android.app.Activity;
import android.os.Bundle;

import com.share.api.GGOfficiialSDK;
import com.share.api.interfaces.tencent.qq.QQAudioTypeOpt;
import com.share.api.interfaces.tencent.qq.QQImageTypeOpt;
import com.share.api.interfaces.tencent.qq.QQShareType;
import com.share.api.interfaces.tencent.qq.common.ImageCommonOpt;
import com.share.api.interfaces.tencent.qq.common.MediaCommonOpt;
import com.share.api.interfaces.tencent.qq.common.QQCommonOpt;
import com.share.api.interfaces.tencent.qq.common.TargetCommonOpt;
import com.share.api.utils.Strings;
import com.share.api.utils.ToastHelper;
import com.tencent.connect.share.QQShare;
import com.tencent.tauth.IUiListener;

/**
 * 负责初始化QQ分享需要的资源, 并且调用分享
 * Created by Aaron on 6/29/16.
 */
public class QQShareBuilder {
    private static Activity mActivity;
    private static Bundle bundle;
    private static IUiListener mIUiListener;

    public static ShareType with(Activity activity, IUiListener iUiListener) {
        mIUiListener = iUiListener;
        return new ShareType(activity);
    }

    public static class ShareType implements QQShareType {

        public ShareType(Activity activity) {
            mActivity = activity;
            //分享的内容bundle
            bundle = new Bundle();
        }

        //默认为分享图文
        @Override
        public DefaultStyle isDefault() {
            bundle.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
            return new DefaultStyle();
        }

        //分享纯图片
        @Override
        public ImageStyle isImage() {
            bundle.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_IMAGE);
            return new ImageStyle();
        }

        //分享音乐
        @Override
        public AudioStyle isAudio() {
            bundle.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_AUDIO);
            return new AudioStyle();
        }

        //分享应用
        @Override
        public MediaCommonStep isApp() {
            bundle.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_APP);
            return new MediaCommonStep();
        }
    }

    /**
     * 4种类型公用属性
     */
    public static class QQCommonStep implements QQCommonOpt {

        @Override
        public QQCommonStep setAppName(String appName) {
            bundle.putString(QQShare.SHARE_TO_QQ_APP_NAME, appName);
            return this;
        }

        @Override
        public void share() {
            if(!GGOfficiialSDK.mTencentAPI.isSupportSSOLogin(mActivity)){
                ToastHelper.


# Created by MechAviv
# Quest ID :: 25567
# Killing Time

sm.setSpeakerID(1032208)
sm.sendNext("E-excuse me... You can't just go digging through the books like that...")

sm.setSpeakerID(1032208)
sm.setPlayerAsSpeaker()
sm.sendSay("There is something I need immediately. I must find it before the darkness swallows me whole.")

sm.setSpeakerID(1032208)
sm.sendSay("J-just let me help! Grendel will light my hair on fire if he sees the library like this. What are you looking for?")

sm.setSpeakerID(1032208)
sm.sendSay("R-right. I actually know all about this...")

sm.setSpeakerID(1032208)
sm.sendSay("O-okay! Just don't hurt me, please...")

sm.setSpeakerID(1032208)
sm.setPlayerAsSpeaker()
sm.sendSay("Do not fear, I would not harm you. I must go and unleash the fury within me upon some monsters before I am unable to bear it any longer. Please look for the book while I am away... ")

sm.setSpeakerID(1032208)
sm.removeEscapeButton()
sm.setPlayerAsSpeaker()
sm.sendSay("Some Royal Fairies would make acceptable target practice.")

sm.setSpeakerID(1032208)
sm.removeEscapeButton()
sm.setPlayerAsSpeaker()
sm.sendSay("This old Teleport Scroll will take me where I must go.")

sm.startQuest(25567)


Response(getUserStatsForGameRequest))
				.thenReturn(mockAnswer);

		GetUserStatsForGame getUserStatsForGame = client
				.<GetUserStatsForGame> processRequest(getUserStatsForGameRequest);

		assertNotNull(getUserStatsForGame);
		assertTrue(getUserStatsForGame.getAdditionalProperties().isEmpty());
		assertNotNull(getUserStatsForGame.getPlayerstats());
		assertEquals(getUserStatsForGame.getPlayerstats().getGameName(),
				"Team Fortress 2");
		assertEquals(getUserStatsForGame.getPlayerstats().getSteamID(),
				"76561197972495328");

		assertNotNull(getUserStatsForGame.getPlayerstats().getStats());
		assertEquals(getUserStatsForGame.getPlayerstats().getStats().size(),
				459);
		assertEquals(getUserStatsForGame.getPlayerstats().getStats().get(2)
				.getName(), "Scout.accum.iDominations");
		assertEquals(getUserStatsForGame.getPlayerstats().getStats().get(2)
				.getValue(), Long.valueOf(68));

		assertNotNull(getUserStatsForGame.getPlayerstats().getAchievements());
		assertEquals(getUserStatsForGame.getPlayerstats().getAchievements()
				.size(), 393);
		assertEquals(getUserStatsForGame.getPlayerstats().getAchievements()
				.get(1).getName(), "TF_PLAY_GAME_EVERYMAP");
		assertEquals(getUserStatsForGame.getPlayerstats().getAchievements()
				.get(1).getAchieved(), Long.valueOf(1));
	}

	@Test
	public void testProcessGetOwnedGamesRequest() throws SteamApiException,
			IOException {

		GetOwnedGamesRequest getOwnedGamesRequest = SteamWebApiRequestFactory
				.createGetOwnedGamesRequest("76561197960435530");

		String mockAnswer = readResourceAsString("GetOwnedGames.json");

		when(requestHandlerMock.getWebApiResponse(getOwnedGamesRequest))
				.thenReturn(mockAnswer);

		GetOwnedGames getOwnedGames = client
				.<GetOwnedGames> processRequest(getOwnedGamesRequest);

		assertNotNull(getOwnedGames);
		assertTrue(getOwnedGames.getAdditionalProperties().isEmpty());
		assertNotNull(getOwnedGames.getResponse());
		assertEquals(getOwnedGames.getResponse().getGameCount(),
				Long.valueOf(487));
		assertNotNull(getOwnedGames.getResponse().getGames());
		assertEquals(getOwnedGames.getResponse().getGames().size(), 487);

		assertEquals(getOwnedGames.getResponse().getGames().get(0).getAppid(),
				Long.valueOf(10));
		assertEquals(getOwnedGames.getResponse().getGames().get(0).getName(),
				"Counter-Strike");
		assertEquals(getOwnedGames.getResponse().getGames().get(0)
				.getPlaytimeForever(), Long.valueOf(32));
		assertEquals(getOwnedGames.getResponse().getGames().get(0)
				.getImgIconUrl(), "6b0312cda02f5f777efa2f3318c307ff9acafbb5");
		assertEquals(getOwnedGames.getResponse().getGames().get(0)
				.getImgLogoUrl(), "af890f848dd606ac2fd4415de3c3f5e7a66fcb9f");
		assertEquals(getOwnedGames.getResponse().getGames().get(0)
				.getHasCommunityVisibleStats(), Boolean.TRUE);
	}

	@Test
	public void testProcessGetRecentlyPlayedGamesRequest()
			throws SteamApiException, IOException {

		GetRecentlyPlayedGamesRequest getRecentlyPlayedGamesRequest = SteamWebApiRequestFactory
				.createGetRecentlyPlayedGamesRequest("76561197960435530");

		String mockAnswer = readResourceAsString("GetRecentlyPlayedGames.json");

		when(
				requestHandlerMock
						.getWebApiResponse(getRecentlyPlayedGamesRequest))
				.thenReturn(mockAnswer);

		GetRecentlyPlayedGames getRecentlyPlayedGames = client
				.<GetRecent


containsKey(pivo)) {

                Integer qt = repeticoesNumero.get(pivo);
                qt++;
                repeticoesNumero.put(pivo, qt);

            } else {

                repeticoesNumero.put(pivo, 1);

            }

        }

        return repeticoesNumero;

    }

    private static Map<Integer, Integer> lerRepeticoesColunaX(Map<String, Integer> operacao,
                                                                Integer[][] tabuleiro,
                                                                Integer tamTab) {

        Map<Integer, Integer> repeticoesNumero = new HashMap<Integer, Integer>();

        int colunaX = operacao.get("numLinColX") - 1;

        for(int i = 0; i < tamTab; i++) {

            Integer pivo = tabuleiro[i][colunaX];

            if(repeticoesNumero.containsKey(pivo)) {

                Integer qt = repeticoesNumero.get(pivo);
                qt++;
                repeticoesNumero.put(pivo, qt);

            } else {

                repeticoesNumero.put(pivo, 1);

            }

        }

        return repeticoesNumero;

    }

    public static Integer avaliaMaiorNumeroComMaiorRepeticao(Map<Integer, Integer> repeticoesNumero) {

        List<Integer> maioresRepeticoes = new ArrayList<Integer>();
        Integer maiorRepeticao = Collections.max (repeticoesNumero.values());

        List<Integer> chaves = new ArrayList<Integer>(repeticoesNumero.keySet());

        for(Integer chave : chaves) {

            Integer valorRepeticao = repeticoesNumero.get(chave);

            if(valorRepeticao >= maiorRepeticao) {

                maioresRepeticoes.add(chave);

            }

        }

        Integer maiorNumeroComMaiorRepeticao = Collections.max(maioresRepeticoes);
        return maiorNumeroComMaiorRepeticao;

    }

}// Voleibol

/*

Um treinador de voleibol gostaria de manter estatísticas sobre sua equipe. A cada jogo, seu auxiliar anota quantas tentativas de saques, bloqueios e ataques cada um de seus jogadores fez, bem como quantos desses saques, bloqueios e ataques tiveram sucesso (resultaram em pontos). Seu programa deve mostrar qual o percentual de saques, bloqueios e ataques do time todo tiveram sucesso.
Entrada
A entrada é dada pelo número de jogadores N (1 ≤ N ≤ 100), seguido pelo nome de cada um dos jogadores. Abaixo do nome de cada jogador, seguem duas linhas com três inteiros cada. Na primeira linha S, B e A (0 ≤ S,B,A ≤ 10000) representam a quantidade de tentativas de saques, bloqueios e ataques e na segunda linha, S1, B1 e A1 (0 ≤ S1 ≤ S; 0 ≤ B1 ≤ B; 0 ≤ A1 ≤ A) com o número de saques, bloqueios e ataques deste jogador que tiveram sucesso.
Saída
A saída deve conter o percentual total de saques, bloqueios e ataques do time todo que resultaram em pontos, conforme mostrado no exemplo.

Exemplo de Entrada
3
Renan
10 20 12
1 10 9
Jonas
8 7 1
2 7 0
Edson
3 3


);

			@include assert-equal(
				ml.convert-util-states('+:h'),
				('&+:hover'),
			);

			@include assert-equal(
				ml.convert-util-states('&:&', 'D'),
				('&\\&\\&'),
			);

			@include assert-equal(
				ml.convert-util-states(':^:&-::^2:+a.link:h', 'D'),
				('& .-Ctx.D .-Ctx2+a.link:hover'),
			);

			@include assert-equal(
				ml.convert-util-states('^ct0:=>*:h:!&-sec0', 'Bgc', true),
				('.-Ctx-ct0>*:hover:not(.Bgc-sec0) '),
			);
		}

		@include it('converts states list') {
			@include assert-equal(
				ml.convert-util-states('h,f'),
				('&:hover, &:focus'),
			);

			@include assert-equal(
				ml.convert-util-states('h:a:b,-nojs:a,:^:!-testou:!=h2'),
				('&:hover:active::before, &.no-js:active, & .-Ctx:not(.pa.ro.voz):not(h2)'),
			);
		}
	}
}
@use 'sass:map';
@use 'sass-true' as *;
@use 'src/sass/tools' as ml;

ml.$utils-db: map.deep-merge(
	ml.$utils-db,
	('utils':
	(
		'registry': (
			'Ai': (
				'keywords': (
					'e': end,
					'b': baseline,
					'c': center,
				),
			),
			'Ts': (
				'keywords': ('transition', 'timing-functions',)
			),
		),
		'keywords': (
			'timing-functions': (
				'e': ease,
				'ei': ease-in,
				'eo': ease-out,
			),
			'transition': (
				'': all 3s,
				'all': all 3s,
				'def0': (color 3s, background-color 3s),
			),
		),
	),
	),
);

$-global-kw: map.get(ml.$utils-db, 'common', 'keywords', 'global');
ml.$utils-db: map.set(
	ml.$utils-db, 'common', 'keywords', 'global', ('gODef': 0.88, 'gTsdDef': 0.3s,)
);

@include describe('tools/functions/common/utils/') {
	@include describe('expand-util-kw-alias') {
		$-tests: (
			'util own keywords': (
				('KW', 'Ai'): (
					'values': (
						'e': end,
						'b': baseline,
						'c': center,
				)),
				('KW', 'Ts'): (
					'values': (
						'': all 3s,
						'all': all 3s,
						'def0': (color 3s, background-color 3s),
						'e': ease,
						'ei': ease-in,
						'eo': ease-out,
				)),
				('BpAll_KW_f,a', 'Ai'): (
					'components': (
						'at-rules': 'BpAll',
						'post-states': 'f,a',
					),
					'values': (
						'e': end,
						'b': baseline,
						'c': center,
					)
				),
			),
			'get CSS-wide keywords if util has not their own': (
				('KW', 'P'): (
					'values': (
						'ih': inherit,
						'ini': initial,
						'rvr': revert,
						'rvrl': revert-layer,
						'ust': unset,
					)
				),
			),
			'keywords from `common` section': (
				('KW.global', 'P'): (
					'values': (
						'gO


 GPU=$gpu_id"

        # Add to Rank list
        ranks+=($rank)
        ((found_ranks++))
    fi
done

# 3. Check if valid Ranks are found
if [[ $found_ranks -eq 0 ]]; then
    echo "error: No valid training processes with RANK found"
    exit 1
fi

# 4. Calculate Rank range
# Sort Ranks
sorted_ranks=($(printf "%s\n" "${ranks[@]}" | sort -n))

min_rank=${sorted_ranks[0]}
max_rank=${sorted_ranks[${#sorted_ranks[@]}-1]}

# 5. Output Rank range
echo "$min_rank:$max_rank"
exit 0
`

// Get the rank range of the current node
func GetCurrentNodeRankRange(ctx context.Context) (minNum, maxNum int, err error) {
	tmpl, err := template.New("rankRange").Parse(rankRangeTemplate)
	if err != nil {
		return 0, 0, err
	}

	output, err := executeScript(ctx, tmpl)
	if err != nil {
		return 0, 0, err
	}
	logger.Logger.Info("GetCurrentNodeRankRange ", zap.String("output:", string(output)))

	// Parse output
	return parseRankRangeOutput(string(output))
}

// Parse script output
func parseRankRangeOutput(output string) (minNum, maxNum int, err error) {
	output = strings.TrimSpace(output)
	if strings.HasPrefix(output, "error:") {
		return 0, 0, fmt.Errorf("rank range script error: %s", output)
	}

	parts := strings.Split(output, ":")
	if len(parts) != 2 {
		return 0, 0, fmt.Errorf("Invalid output format: %s", output)
	}

	minRank, err := strconv.Atoi(parts[0])
	if err != nil {
		return 0, 0, fmt.Errorf("Failed to parse minRank: %v", err)
	}

	maxRank, err := strconv.Atoi(parts[1])
	if err != nil {
		return 0, 0, fmt.Errorf("Failed to parse maxRank: %v", err)
	}

	return minRank, maxRank, nil
}
// Copyright (c) OpenMMLab. All rights reserved.

package textparser

import (
	"context"
	"reflect"
	"testing"
	"time"

	pb "deeptrace/v1"

	"google.golang.org/protobuf/types/known/timestamppb"
)

func TestLogParser_Parse(t *testing.T) {
	logtime, _ := time.Parse("2006-01-02 15:04:05", "2025-07-11 02:32:52")
	type args struct {
		ctx    context.Context
		inputs []string
	}
	tests := []struct {
		name    string
		p       *LogParser
		args    args
		want    []*pb.LogEntry
		wantErr bool
	}{
		// TODO: Add test cases.
		{
			name: "normal",
			p:    &LogParser{},
			args: args{
				ctx: context.TODO(),
				inputs: []string{
					"dsaljflkdjafljadslfj",
				},
			},
			want: []*pb.LogEntry{
				{
					Message: "dsaljflkdjafljadslfj",
				},
			},
			wantErr: false,
		},
		{
			name: "time",
			p:    &LogParser{},
			args: args{
				ctx: context.TODO(),
				inputs: []string{
					"[XTuner][RANK 15][2025-07-11 02:32:52][INFO] Gradient Accumulation: 4, Compile: True, CPU Offload: False",
				},
			},
			want: []*pb.LogEntry{
				{
					Message:   "[XTuner][RANK 15][2025-07-11 02:32:52][INFO] Gradient Accumulation: 4, Compile: True, CPU Offload: False",
					Timestamp: timestamppb.New(logtime),
				},
			},
			wantErr: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			p := &LogParser{}
			got, err := p.Parse(tt.args.ctx, tt.args.inputs)
			if (err != nil) != tt.wantErr {
				t.Errorf("LogParser.Parse()


 28)
#define	STAMP_DB_12		(0x02 << 28)
#define	STAMP_DB_02		(0x04 << 28)

/* Miscellaneous flags */
#define	STAMP_UPDATE_ENABLE	(1 << 0)
#define	STAMP_SAVE_SIGN		(1 << 6)
#define	STAMP_SAVE_ALPHA	(1 << 7)
#define	STAMP_SUPERSAMPLE	(1 << 11)
#define	STAMP_SPAN		(1 << 19)
#define	STAMP_COPYSPAN_ALIGNED	(1 << 20)
#define	STAMP_MINMAX		(1 << 21)
#define	STAMP_MULT		(1 << 22)
#define	STAMP_MULTACC		(1 << 23)
#define	STAMP_HALF_BUFF		(1 << 27)
#define	STAMP_INITIALIZE	(1 << 31)

/*
 * XYMASK address calculation.
 */
#define	XMASKADDR(sw, sx, a)	(((a)-((sx) % (sw))) & 15)
#define	YMASKADDR(shm, sy, b)	(((b)-((sy) & (shm))) & 15)
#define	XYMASKADDR(sw,shm,x,y,a,b)	\
    (XMASKADDR(sw,x,a) << 16 | YMASKADDR(shm,y,b))

/*
 * Miscellenous constants.
 */
#define	STIC_MAGIC_X	370
#define	STIC_MAGIC_Y	37

/*
 * Poll register magic values.
 */
#define	STAMP_OK		(0)
#define	STAMP_BUSY		(1)
#define	STAMP_RETRIES		(100000)
#define	STAMP_DELAY		(10)

/*
 * STIC registers.
 */
struct stic_regs {
	u_int32_t	sr_pad0;
	u_int32_t	sr_pad1;
	u_int32_t	sr_hsync;
	u_int32_t	sr_hsync2;
	u_int32_t	sr_hblank;
	u_int32_t	sr_vsync;
	u_int32_t	sr_vblank;
	u_int32_t	sr_vtest;
	u_int32_t	sr_ipdvint;
	u_int32_t	sr_pad2;
	u_int32_t	sr_sticsr;
	u_int32_t	sr_busdat;
	u_int32_t	sr_busadr;
	u_int32_t	sr_pad3;
	u_int32_t	sr_buscsr;
	u_int32_t	sr_modcl;
} __packed;

/*
 * Bit definitions for stic_regs::sticsr.
 */
#define	STIC_CSR_TSTFNC		0x00000003
# define STIC_CSR_TSTFNC_NORMAL	0
# define STIC_CSR_TSTFNC_PARITY	1
# define STIC_CSR_TSTFNC_CNTPIX	2
# define STIC_CSR_TSTFNC_TSTDAC	3
#define	STIC_CSR_CHECKPAR	0x00000004
#define	STIC_CSR_STARTVT	0x00000010
#define	STIC_CSR_START		0x00000020
#define	STIC_CSR_RESET		0x00000040
#define	STIC_CSR_STARTST	0x00000080

/*
 * Bit definitions for stic_regs::int.  Three four-bit wide fields, for
 * error (E), vertical-blank (V), and packet-done (P) intererupts,
 * respectively.  The low-order three bits of each field are interrupt
 * enable, condition flagged, and nybble write enable.  The top bit of each
 * field is unused.
 */
#define	STIC_INT_E_EN		0x00000001
#define	STIC_INT_E		0x00000002
#define	STIC_INT_E_WE		0x00000004

#define	STIC_INT_V_EN		0x00000100
#define	STIC_INT_V		0x00000200
#define	STIC_INT_V_WE		0x00000400

#define	STIC_INT_P_EN		0x00010000
#define	STIC_INT_P		0x00020000
#define	STIC_INT_P_WE		0x00040000

#define	STIC_INT_E_MASK	(STIC_INT_E_EN | STIC_INT_E | STIC_INT_E_WE)
#define	STIC_INT_V_MASK	(STIC_INT_V_EN | STIC_INT_V | STIC_INT_V_WE)
#define	STIC_INT_P_MASK	(STIC_INT_P_EN | STIC_INT_P | STIC_INT_P_WE)
#define	STIC_INT_MASK	(STIC_INT_E_MASK | STIC_INT_P_MASK | STIC_INT_V_MASK)

#define	STIC_INT_WE	(STIC_INT_E_WE | STIC_INT_V_WE | STIC_INT_P_WE)
#define	STIC_INT_CLR	(STIC_INT_E_EN | STIC_INT_V_EN | STIC_INT_P_EN)

/*
 * On DMA: reading from a STIC poll register causes load & execution of
 * the packet at the correspoinding physical address.  Either STAMP_OK
 * or STAMP_BUSY will be returned to indicate status.
 *
 * The STIC sees only 23-bits (8MB) of address space.  Bits 21-22 in
 * physical address space map to bits 27-28, and bits 15-20 map to bits
 * 18-23 in the STIC's warped view of the word.  On the PXG, the STIC
 * sees only the onboard SRAM (so any `physical addresses' are offsets
 * into the beginning of the SRAM).
 */

#endif	/* _TC_STICREG_H_ */


erts[ LAMBERT_NB ];

#define DECIMAL(D,M,S) (D + M / 60. + S / 3600.)
#define RAD_OF_DEG(D) (D*M_PI/180.)
#define DEG_OF_RAD(R) (R/M_PI*180.)
#define LATITUDE_ISOMETRIQUE(PHI,E) (log(tan(M_PI_4 + PHI/2.0)) - E/2.0 * log((1.0+E*sin(PHI)) / (1.0-E*sin(PHI))))
#define E_SQUARE(D) (2.0*D - D * D)
#define E_PRIME_SQUARE(D) (1.0 / (1.0 - D) / (1.0 - D) - 1.0)

/* projections */
void lambert_of_e2d ( const enum type_lambert lmb,
                      const enum type_ellipsoid elps,
                      struct double_e2d world_pos, struct double_c2d *lmb_pos );
void e2d_of_lambert ( const enum type_lambert lmb,
                      const enum type_ellipsoid elps,
                      struct double_c2d c_pos, struct double_e2d *e_pos );
/* coordinates */
void e3d_of_c3d( const enum type_ellipsoid elps, struct double_c3d c_pos,
                 struct double_e3d *e_pos );
void e2d_of_e2d( const enum type_ellipsoid dest, const enum type_ellipsoid src,
                 struct double_e2d *e2d_pos );

#endif /* GEOMETRY_H */


ite-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml">
Error Display
User Feedback

</foreignObject></g></g></g></g></g></svg>

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 256 256" class="light:text-gray-800 text-white dark:text-white"><path d="M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z"></path></svg>

Sources: <svg class="mr-1.5 hidden h-3.5 w-3.5 flex-shrink-0 opacity-40 md:block" fill="currentColor" viewBox="0 0 24 24"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"></path></svg>hclient/widgets/cms/websiteScriptAndStyles.php<span class="flex flex-shrink-0 items-center rounded-r border-l px-2 py-1.5 border-[#dddddd] bg-[#d8d8d8] text-[#666666


 4.735-10.161 3.292-2.373 6.553-7.111 9.033-11.39a93.431 93.431 0 003.76-7.217 50.734 50.734 0 00.266-.582l.013-.03.004-.008a1 1 0 011.319-.512Zm2.125 34.764c1.41-.88 2.708-2.768 3.227-4.858.53-2.139.286-4.663-1.66-6.685l-1.441 1.387c1.355 1.408 1.569 3.169 1.16 4.816-.421 1.695-1.462 3.093-2.344 3.642l1.058 1.698Z"/></svg>';
  static const String not_ok =
      '<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"><g fill="currentColor"><path d="M14.807 23.233c-.683-.438-1.183-1.145-1.064-1.883a.5.5 0 01.668-.389c1.818.675 3.846.256 5.642-1.448a.5.5 0 01.818.203c.231.689.024 1.618-.48 2.382a3.794 3.794 0 01-2.654 1.665c-1.198.177-2.216-.073-2.93-.53Zm17.947 0c.683-.438 1.184-1.145 1.065-1.883a.5.5 0 00-.668-.389c-1.818.675-3.846.256-5.642-1.448a.5.5 0 00-.818.203c-.232.689-.024 1.618.48 2.382a3.794 3.794 0 002.653 1.665c1.199.177 2.216-.073 2.93-.53Zm-15.789 8.943c.097-.355.245-.72.431-1.005C18.664 29.225 21.151 28 23.892 28c2.646 0 5.048 1.139 6.354 2.962l.017.023a4.3 4.3 0 01.278.403c.164.285.284.637.357.973a3.6 3.6 0 01.076 1.123c-.038.356-.17.9-.64 1.268-.523.41-1.15.372-1.656.195-2.394-.782-3.53-1.12-4.648-1.126-1.116-.006-2.277.317-4.714 1.128l-.008.003-.008.002c-.56.176-1.222.216-1.772-.187-.527-.386-.668-.976-.698-1.377a3.66 3.66 0 01.135-1.214Z"/><path fill-rule="evenodd" d="M42 24c0 9.941-8.059 18-18 18S6 33.941 6 24 14.059 6 24 6s18 8.059 18 18Zm-2 0c0 8.837-7.163 16-16 16S8 32.837 8 24 15.163 8 24 8s16 7.163 16 16Z" clip-rule="evenodd"/></g></svg>';
  static const String not_ok_negative =
      '<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" fill-rule="evenodd" d="M48 0H0v48h48V0Zm-8 24c0 8.837-7.163 16-16 16S8 32.837 8 24 15.163 8 24 8s16 7.163 16 1


lidTransitionTrigger2()
    {
        var transition = s1.AddTransitionTo(s2);
        transition._triggers.Add("entry");
        ExpectBehaviorValidationException(exceptionMessagePart: expectedInvalidTriggerErrorText);
    }

    [Fact]
    public void InvalidTransitionTrigger3()
    {
        var transition = s1.AddTransitionTo(s2);
        transition._triggers.Add("exit");
        ExpectBehaviorValidationException(exceptionMessagePart: expectedInvalidTriggerErrorText);
    }

    [Fact]
    public void InvalidTransitionTriggerInList()
    {
        var transition = s1.AddTransitionTo(s2);
        transition._triggers.Add("do");
        transition._triggers.Add("exit");
        ExpectBehaviorValidationException(exceptionMessagePart: expectedInvalidTriggerErrorText);
    }

    [Fact]
    public void DuplicateStateNames()
    {
        s1.AddChild(new State("s2"));
        // Note! We only get this failure because this test disables auto name conflict resolution
        ExpectVertexValidationExceptionWildcard(s2, "*name `s2` also used by state `ROOT.s1.s2`*");
    }

    /// <summary>
    /// https://github.com/StateSmith/StateSmith/issues/199
    /// </summary>
    [Fact]
    public void UsingReservedRootName()
    {
        var badRoot = s1.AddChild(new State("root"));
        ExpectVertexValidationExceptionWildcard(badRoot, "*`ROOT`*reserved*");
    }
}


 63) | (h0 >>> 1);   h1 += h0;

		return h0;
	}

	/**
	 * Computes the hash code for an array of bytes, using the specified seed value.
	 * @param src contains bytes for which the hash code is computed
	 * @param start the index of the first element in {@code src} to
	 * include in the computation; must be non-negative and no larger than
	 * {@code src.length}
	 * @param length the number of bytes to include in the computation;
	 * must be non-negative and no larger than {@code src.length - start}
	 * @param seed seed value used to initialize engine state
	 * @return computed hash code
	 * @throws ArrayIndexOutOfBoundsException if the preconditions for
	 * {@code offset} or {@code length} do not obtain
	 * @throws IllegalArgumentException if {@code length} is negative
	 */
	public static long hash(byte[] src, int start, int length, long seed) {
		if (length < SMALLHASH_LIMIT_BYTES) {
			return smallHash(src, start, length, seed);
		}

		long h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11;
		h0 = h3 = h6 = h9 = seed;
		h1 = h4 = h7 = h10 = seed;
		h2 = h5 = h8 = h11 = ARBITRARY_BITS;

		int remaining = length;
		int pos = start;
		while (remaining >= BLOCK_SIZE_BYTES) {
			h0 += packLong(src, pos);
			h2 ^= h10;
			h11 ^= h0;
			h0 = (h0 << 11) | (h0 >>> 53);
			h11 += h1;

			h1 += packLong(src, pos+8);
			h3 ^= h11;
			h0 ^= h1;
			h1 = (h1 << 32) | (h1 >>> 32);
			h0 += h2;

			h2 += packLong(src, pos+16);
			h4 ^= h0;
			h1 ^= h2;
			h2 = (h2 << 43) | (h2 >>> 21);
			h1 += h3;

			h3 += packLong(src, pos+24);
			h5 ^= h1;
			h2 ^= h3;
			h3 = (h3 << 31) | (h3 >>> 33);
			h2 += h4;

			h4 += packLong(src, pos+32);
			h6 ^= h2;
			h3 ^= h4;
			h4 = (h4 << 17) | (h4 >>> 47);
			h3 += h5;

			h5 += packLong(src, pos+40);
			h7 ^= h3;
			h4 ^= h5;
			h5 = (h5 << 28) | (h5 >>> 36);
			h4 += h6;

			h6 += packLong(src, pos+48);
			h8 ^= h4;
			h5 ^= h6;
			h6 = (h6 << 39) | (h6 >>> 25);
			h5 += h7;

			h7 += packLong(src, pos+56);
			h9 ^= h5;
			h6 ^= h7;
			h7 = (h7 << 57) | (h7 >>> 7);
			h6 += h8;

			h8 += packLong(src, pos+64);


.JsonPropertyName("policyDocument")]
#endif
        public APIGatewayCustomAuthorizerPolicy PolicyDocument { get; set; } = new APIGatewayCustomAuthorizerPolicy();

        /// <summary>
        /// Gets or sets the <see cref="APIGatewayCustomAuthorizerContext"/> property.
        /// </summary>
        [DataMember(Name = "context")]
#if NETCOREAPP3_1_OR_GREATER
            [System.Text.Json.Serialization.JsonPropertyName("context")]
#endif
        public APIGatewayCustomAuthorizerContextOutput Context { get; set; }

        /// <summary>
        /// Gets or sets the usageIdentifierKey.
        /// </summary>
        [DataMember(Name = "usageIdentifierKey")]
#if NETCOREAPP3_1_OR_GREATER
            [System.Text.Json.Serialization.JsonPropertyName("usageIdentifierKey")]
#endif
        public string UsageIdentifierKey { get; set; }
    }
}


e it and/or modify
 * it under the terms of the GNU Affero General Public License, included
 * in the LICENSE file in this source code package.
 */

package migrations

import (
	"fmt"
)

// TODO: use now() from writefreely pkg
func (db *datastore) now() string {
	if db.driverName == driverSQLite {
		return "strftime('%Y-%m-%d %H:%M:%S','now')"
	}
	return "NOW()"
}

func (db *datastore) typeInt() string {
	if db.driverName == driverSQLite {
		return "INTEGER"
	}
	return "INT"
}

func (db *datastore) typeSmallInt() string {
	if db.driverName == driverSQLite {
		return "INTEGER"
	}
	return "SMALLINT"
}

func (db *datastore) typeTinyInt() string {
	if db.driverName == driverSQLite {
		return "INTEGER"
	}
	return "TINYINT"
}

func (db *datastore) typeText() string {
	return "TEXT"
}

func (db *datastore) typeChar(l int) string {
	if db.driverName == driverSQLite {
		return "TEXT"
	}
	return fmt.Sprintf("CHAR(%d)", l)
}

func (db *datastore) typeVarChar(l int) string {
	if db.driverName == driverSQLite {
		return "TEXT"
	}
	return fmt.Sprintf("VARCHAR(%d)", l)
}

func (db *datastore) typeVarBinary(l int) string {
	if db.driverName == driverSQLite {
		return "BLOB"
	}
	return fmt.Sprintf("VARBINARY(%d)", l)
}

func (db *datastore) typeBool() string {
	if db.driverName == driverSQLite {
		return "INTEGER"
	}
	return "TINYINT(1)"
}

func (db *datastore) typeDateTime() string {
	return "DATETIME"
}

func (db *datastore) typeIntPrimaryKey() string {
	if db.driverName == driverSQLite {
		// From docs: "In SQLite, a column with type INTEGER PRIMARY KEY is an alias for the ROWID (except in WITHOUT
		// ROWID tables) which is always a 64-bit signed integer."
		return "INTEGER PRIMARY KEY"
	}
	return "INT AUTO_INCREMENT PRIMARY KEY"
}

func (db *datastore) collateMultiByte() string {
	if db.driverName == driverSQLite {
		return ""
	}
	return " COLLATE utf8_bin"
}

func (db *datastore) engine() string {
	if db.driverName == driverSQLite {
		return ""
	}
	return " ENGINE = InnoDB"
}

func (db *datastore) after(colName string) string {
	if db.driverName == driverSQLite {
		return ""
	}
	return " AFTER " + colName
}
/*
 * Copyright © 2019-2021 Musing Studio LLC.
 *
 * This file is part of WriteFreely.
 *
 * WriteFreely is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, included
 * in the LICENSE file in this source code package.
 */

package migrations

import (
	"context"
	"database/sql"

	wf_db "github.com/writefreely/writefreely/db"
)

func oauth(db *datastore) error {
	dialect := wf_db.DialectMySQL
	if db.driverName == driverSQLite {
		dialect = wf_db.DialectSQLite
	}
	return wf_db.RunTransactionWithOptions(context.Background(), db.DB, &sql.TxOptions{}, func(ctx context.Context, tx *sql.Tx) error {
		createTable


yzwU8(MemoryAccessor gltfAccessor, VertexElementAccessor accessor)
    {
        VertexElementArray<(byte x, byte y, byte z, byte w)> accessorArray = accessor.AsXyzwU8Array();
        Vector4Array gltfArray = gltfAccessor.AsVector4Array();

        gltfArray.Fill(accessorArray.Select(x => new Vector4(x.x, x.y, x.z, x.w)));
    }

    private static void WriteNormalMemoryAccessor(MemoryAccessor gltfAccessor, VertexElementAccessor accessor)
    {
        Vector3[] accessorArray = accessor.Element.Format switch
        {
            ElementFormat.XYZ_Float32 => [.. accessor.AsVector3Array()],
            ElementFormat.XYZ_Packed161616 => ConvertHalfVector3Array(accessor),
            _ => throw new InvalidOperationException()
        };
        Vector3Array gltfArray = gltfAccessor.AsVector3Array();

        for (int i = 0; i < accessorArray.Length; i++)
        {
            Vector3 normal = accessorArray[i];

            // Check for NaN values
            if (float.IsNaN(normal.X) || float.IsNaN(normal.Y) || float.IsNaN(normal.Z))
            {
                gltfArray[i] = Vector3.UnitY;
                continue;
            }

            float length = normal.Length();
            if (length < 0.0001f || float.IsInfinity(length))
            {
                gltfArray[i] = Vector3.UnitY;
                continue;
            }

            gltfArray[i] = Vector3.Normalize(normal);
        }
    }

    private static void WriteTexcoordMemoryAccessor(MemoryAccessor gltfAccessor, VertexElementAccessor accessor)
    {
        Vector2[] accessorArray = accessor.Element.Format switch
        {
            ElementFormat.XY_Float32 => [.. accessor.AsVector2Array()],
            ElementFormat.XY_Packed1616 => ConvertHalfVector2Array(accessor),
            _ => throw new InvalidOperationException()
        };

        gltfAccessor.As


n identificationFound;
        } catch (error) {
            console.error(error);
            throw new Error("Canot found identification");
        }
    }
}
interface FrontEnvironment { // 앞에 뭐가 있는지
  type: null | 'middle' | 'final' // 각각 현재 자모음이 어두 / 모음 뒤 / 종성 뒤에 있음을 의미
  charCode?: number; // 앞에 있는 자모음의 charCode
}

interface BackEnvironment { // 뒤에 뭐가 있는지
  type: null | 'initial' | 'middle' // 각각 어말 / 초성 앞 / 중성 앞에 있음을 의미
  charCode?: number; // 뒤에 있는 자모음의 charCode
}

interface PronounceContext {
  frontEnvironment: FrontEnvironment;
  backEnvironment: BackEnvironment;
}

// https://namu.wiki/w/%EA%B5%AD%EC%A0%9C%EC%9D%8C%EC%84%B1%EA%B8%B0%ED%98%B8#rfn-29
const middleToPhoneticMap = {
  0x119e: '\u028C', // ㆍ : ʌ
  0x1173: '\u0268', // ㅡ : ɨ
  0x1175: '\u0069', // ᅵ : i
  0x1169: '\u006f', // ᅩ : o
  0x1161: '\u0061', // ᅡ : a CHECK: a 맞나? ɐ 아닌가?
  0x116e: '\u0075', // ᅮ : u
  0x1165: '\u0259', // ᅥ : ə CHECK: 1D4A도 있음
  0x116d: 'jo', // ᅭ : jo
  0x1163: 'ja', // ᅣ : ja
  0x1172: 'ju', // ᅲ : ju
  0x1167: 'jə', // ᅧ : jə
  0x11a1: 'ʌj', // ᆡ : ʌj
  0x1174: 'ɨj', // ᅴ : ɨj
  0x116c: 'oj', // ᅬ : oj
  0x1162: 'aj', // ᅢ : aj
  0x1171: 'uj', // ᅱ : uj
  0x1166: 'əj', // ᅦ : əj
  0x1188: 'joj', // ᆈ : joj
  0x1164: 'jaj', // ᅤ : jaj
  0x1194: 'juj', // ᆔ : juj
  0x1168: 'jəj', // ᅨ : jəj
  0x116b: 'waj', // ᅫ : waj
  0x1170: 'wəj', // ᅰ : wəj
  0x116a: 'wa', // ᅪ : wa
  0x116f: 'wə', // ᅯ : wə
}

// 초성이면 true 반환, 아니면 false 반환
function isInitialChar(charCode: number): boolean {
  return 0x1100 <= charCode && charCode <= 0x115e;
}

// 중성이면 true 반환, 아니면 false 반환
function isMiddleChar(charCode: number): boolean {
  return 0x1161 <= charCode && charCode <= 0x11a7;
}

// 종성이면 true 반환, 아니면 false 반환
function isFinalChar(charCode: number): boolean {
  return 0x11a8 <= charCode && charCode <= 0x11ff;
}

function charCodeToPhoneticSymbol(charCode: number, context: PronounceContext, backContextOfNextChar?: BackEnvironment) {
  console.log(`처리할 코드: ${charCode}` )
  console.log('context type: ', context);
  console.log('backContextOfNextChar: ', backContextOfNextChar);
  let phoneticSymbol = '?';
  switch (charCode) {
    case 0x1100: // 초성 ㄱ
      if (context.frontEnvironment.type === null) { // 어두
        phoneticSymbol = 'k';

      } else if (context.frontEnvironment.type === 'final') { // 종성 뒤
        if ([0x11ab, 0x11af, 0x11b7, 0x11bc, 0x11f0, 0x11B1].includes(context.frontEnvironment.charCode)) { // 받침 ㄴ, ㄹ, ㅁ,


::<T, M>(
				elem,
				value,
				Msb0::mask(head, tail),
				T::Mem::BITS - tail.value(),
			),
			DomainMut::Region { head, body, tail } => {
				if let Some((head, elem)) = head {
					set::<T, M>(elem, value, Msb0::mask(head, None), 0);
					value >>= T::Mem::BITS - head.value();
				}

				for elem in body.iter_mut() {
					*elem = resize(value);
					if M::BITS > T::Mem::BITS {
						value >>= T::Mem::BITS;
					}
				}

				if let Some((elem, tail)) = tail {
					set::<T, M>(
						elem,
						value,
						Msb0::mask(None, tail),
						T::Mem::BITS - tail.value(),
					);
				}
			},
		}
	}

	#[inline]
	fn store_be<M>(&mut self, mut value: M)
	where M: BitMemory {
		let len = self.len();
		check("store", len, M::BITS);

		match self.domain_mut() {
			DomainMut::Enclave { head, elem, tail } => set::<T, M>(
				elem,
				value,
				Msb0::mask(head, tail),
				T::Mem::BITS - tail.value(),
			),
			DomainMut::Region { head, body, tail } => {
				if let Some((elem, tail)) = tail {
					set::<T, M>(
						elem,
						value,
						Msb0::mask(None, tail),
						T::Mem::BITS - tail.value(),
					);
					value >>= tail.value();
				}

				for elem in body.iter_mut().rev() {
					*elem = resize(value);
					if M::BITS > T::Mem::BITS {
						value >>= T::Mem::BITS;
					}
				}

				if let Some((head, elem)) = head {
					set::<T, M>(elem, value, Msb0::mask(head, None), 0);
				}
			},
		}
	}
}

#[cfg(not(tarpaulin_include))]
impl<O, V> BitField for BitArray<O, V>
where
	O: BitOrder,
	V: BitView,
	BitSlice<O, V::Store>: BitField,
{
	#[inline]
	fn load_le<M>(&self) -> M
	where M: BitMemory {
		self.as_bitslice().load_le()
	}

	#[inline]
	fn load_be<M>(&self) -> M
	where M: BitMemory {
		self.as_bitslice().load_be()
	}

	#[inline]
	fn store_le<M>(&mut self, value: M)
	where M: BitMemory {
		self.as_mut_bitslice().store_le(value)
	}

	#[inline]
	fn store_be<M>(&mut self, value: M)
	where M: BitMemory {
		self.as_mut_bitslice().store_be(value)
	}
}

#[cfg(feature = "alloc")]
#[cfg(not(tarpaulin_include))]
impl<O, T> BitField for BitBox<O, T>
where
	O: BitOrder,
	T: BitStore,
	BitSlice<O, T>: BitField,
{
	#[inline]
	fn load_le<M>(&self) -> M
	where M: BitMemory {
		self.as_bitslice().load_le()
	}

	#[inline]
	fn load_be<M>(&self) -> M
	where M: BitMemory {
		self.as_bitslice().load_be()
	}

	#[inline]
	fn store_le<M>(&mut self, value: M)
	where M: BitMemory {
		self.as_mut_bitslice().store_le(value)
	}

	#[inline]
	fn store_be<M>(&mut self, value: M)
	where M: BitMemory {
		self.as_mut_bitslice().store_be(value)
	}
}

#[cfg(feature = "alloc")]
#[cfg(not(tar


务。

（周总理又问到XXX所一个同志）

总理：国家科委情报局搞什么呢？有没有重复，要精简机构，统一归口。

正题

总理：下步运动怎么办？大家商量。

（被接见人头脑发热，没有领会总理的意见，都争先发言，表明自己的观点，驳斥对方。）

刘西尧：我们不是一言堂。打架，在道理面前打嘛。当然我不同意打架。

总理：应地所就是打出一些事情，那么几个人还没有谈完，也没有调查完，你们革命造反队不是有队伍吗？其他所也有队伍。要求出去调查，你们做些核实，进行全面的调查，继续进行揭发、辩论，不要老停留在应地所的问题上。

天文台工人说：什么十四条，七十二条是修正主义的。

总理：十四条是修正主义的，什么内容你知道吗？（问了很多人看过没有，都答没有看过，只有一人看过）你研究过没有？（答：没有研究过）你们不清楚就好好读一读，叫（文革的）高学文同志把十四条印发下去，再进行辩论。

（被接见人大家都听不进对方意见，总理生气了，站起来。大家辩论到科学仪器厂刘存仁883人联合写的大字报后，在科研厂有七人被打。）

总理：贴了一张大字报你就反对，人家有贴大字报的自由。要有一个辩论的气氛，不然还行啊！我去清华作了二次报告，也给我贴了许多大字报，要给人家贴大字报的自由，等你们作到这一点，咱们再谈。红卫兵两种、三种都可以，要重视成分，也要看表现。

工人：张劲夫做检查，有些人反对，不让检查，人家犯了错误，要允许人家革命。前天早上去一百多人到院文革，在一、二十分钟作出决定，会是开是不开？

总理：青年嘛！能不犯错误？要允许犯错误，只要能改正。

XX：他们到处抓人，大闹院部，作顶帽子，跑到机要室，裤子都不让穿，不然就是保皇派。

另一方：反对，这是造谣！

总理：话传多了，总是要走样的。我小时候做游戏……话传刘西光那里，再传给我，是要走样的。人总是有主


STER_WHISPER_GET = "%s悄悄地說：";
CHAT_MONSTER_YELL_GET = "%s大喊：";
CHAT_MOUSE_WHEEL_SCROLL = "啟動滑鼠滾輪捲動";
CHAT_MSG_ACHIEVEMENT = "成就發佈";
CHAT_MSG_AFK = "暫離";
CHAT_MSG_BATTLEGROUND = "戰場";
CHAT_MSG_BATTLEGROUND_LEADER = "戰場隊長";
CHAT_MSG_BG_SYSTEM_ALLIANCE = "聯盟區域訊息";
CHAT_MSG_BG_SYSTEM_HORDE = "部落區域訊息";
CHAT_MSG_BG_SYSTEM_NEUTRAL = "中立區域訊息";
CHAT_MSG_BLOCK_CHAT_CHANNEL_INVITE = "你已封鎖了對話頻道的邀請。";
CHAT_MSG_BN_CONVERSATION = "Real ID對話";
CHAT_MSG_BN_WHISPER = "Real ID密語";
CHAT_MSG_CHANNEL_LIST = "頻道列表";
CHAT_MSG_COMBAT_HONOR_GAIN = "榮譽點數";
CHAT_MSG_EMOTE = "表情指令";
CHAT_MSG_FILTERED = "對話過濾訊息";
CHAT_MSG_GUILD = "公會";
CHAT_MSG_GUILD_ACHIEVEMENT = "公會發佈";
CHAT_MSG_GUILD_ITEM_LOOTED = "非常稀有物品取得發佈";
CHAT_MSG_INSTANCE_CHAT = "副本";
CHAT_MSG_LOOT = "戰利品";
CHAT_MSG_MONEY = "拾取金錢";
CHAT_MSG_MONSTER_EMOTE = "怪物表情";
CHAT_MSG_MONSTER_PARTY = "生物隊伍";
CHAT_MSG_MONSTER_SAY = "怪物說";
CHAT_MSG_MONSTER_WHISPER = "怪物悄悄話";
CHAT_MSG_MONSTER_YELL = "怪物大喊";
CHAT_MSG_OFFICER = "公會幹部";
CHAT_MSG_PARTY = "隊伍";
CHAT_MSG_PARTY_LEADER = "隊長";
CHAT_MSG_RAID = "團隊";
CHAT_MSG_RAID_BOSS_EMOTE = "團隊首領表情";
CHAT_MSG_RAID_LEADER = "團隊隊長";
CHAT_MSG_RAID_WARNING = "團隊警告";
CHAT_MSG_RECENT_ALLY_NAME_FORMAT = "[%s]%s";
CHAT_MSG_RESTRICTED = "管制";
CHAT_MSG_SAY = "說";
CHAT_MSG_SKILL = "技能";
CHAT_MSG_SYSTEM = "系統";
CHAT_MSG_TEXT_EMOTE = "文字表情";
CHAT_MSG_WHISPER = "聽悄悄話";
CHAT_MSG_WHISPER_INFORM = "悄悄話";
CHAT_MSG_WORLDDEFENSE_FORMAT = "[%s]%s";
CHAT_MSG_YELL = "大喊";
CHAT_MUTED_NOTICE = "|Hchannel:%d|h[%s]|h你沒有發言權限。";
CHAT_MUTED_NOTICE_BN = "|Hchannel:CHANNEL:%d|h[%s]|h你沒有發言權限。";
CHAT_NAME_TEMPLATE = "


}

impl PartialEq for Key {
    fn eq(&self, other: &Self) -> bool {
        self.key_data == other.key_data
    }
}

impl Eq for Key {}

#[derive(Debug, Clone)]
pub struct StretchKey {
    key_data: SecVec<u8>,
}

impl StretchKey {
    pub fn new(key_data: &[u8]) -> Self {
        debug_assert!(key_data.len() >= 32);
        StretchKey {
            key_data: SecVec::<u8>::from(key_data),
        }
    }

    #[cfg(any(test, feature = "expose"))]
    pub fn mock_stretch(key_data: &[u8]) -> Self {
        StretchKey::new(&fastish_hash(key_data))
    }

    pub fn len(&self) -> usize {
        self.key_data.unsecure().len()
    }

    pub fn unsecure_slice(&self, upto: usize) -> &[u8] {
        &self.key_data.unsecure()[..upto]
    }
}
use alga::linear::FiniteDimVectorSpace;
use na::{DVector, RealField, Unit};

use crate::joint::JointConstraint;
use crate::math::{Point, Vector, DIM};
use crate::object::{Body, BodyHandle, BodyPartHandle, BodySet};
use crate::solver::{
    helper, BilateralConstraint, BilateralGroundConstraint, ForceDirection, ImpulseLimits,
};
use crate::solver::{
    GenericNonlinearConstraint, IntegrationParameters, LinearConstraints,
    NonlinearConstraintGenerator,
};

/// A spring-like constraint to be used to drag a body part with the mouse.
pub struct MouseConstraint<N: RealField, Handle: BodyHandle> {
    b1: BodyPartHandle<Handle>,
    b2: BodyPartHandle<Handle>,
    anchor1: Point<N>,
    anchor2: Point<N>,
    limit: N,
}

impl<N: RealField, Handle: BodyHandle> MouseConstraint<N, Handle> {
    /// Initialize a mouse constraint between two bodies.getPartHandle
    ///
    /// Typically, `b1` will be the ground and the anchor the position of the mouse.
    /// Both anchors are expressed in the local coordinate frames of the corresponding body parts.
    pub fn new(
        b1: BodyPartHandle<Handle>,
        b2: BodyPartHandle<Handle>,
        anchor1: Point<N>,
        anchor2: Point<N>,
        limit: N,
    ) -> Self {
        MouseConstraint {
            b1,
            b2,
            anchor1,
            anchor2,
            limit,
        }
    }

    /// Change the first anchor, expressed in the local space of the first body part.
    pub fn set_anchor_1(&mut self, anchor1: Point<N>) {
        self.anchor1 = anchor1;
    }

    /// Change the first anchor, expressed in the local space of the second body part.
    pub fn set_anchor_2(&mut self, anchor2: Point<N>) {
        self.anchor2 = anchor2;
    }
}

impl<N: RealField, Handle: BodyHandle, Bodies: BodySet<N, Handle = Handle>>
    JointConstraint<N, Bodies> for MouseConstraint<N, Handle>
{
    fn num_velocity_constraints(&self) -> usize {
        DIM
    }

    fn anchors(&self) -> (BodyPartHandle<Handle>, BodyPartHandle<Handle>) {
        (self.b1, self.b2)
    }

    fn velocity_constraints(
        &mut self,
        parameters: &IntegrationParameters<N>,
        bodies: &Bodies,
        ext_vels: &DVector<N>,
        ground_j_id: &mut usize,
        j_id: &mut usize,
        jacobians: &mut [N],
        constraints: &mut LinearConstraints<N, usize>,
    ) {
        let body1 = try_ret!(bodies.get(self.b1.0));
        let body2 = try_ret!(bodies.get(self.b2.0));
        let part1 = try_ret!(body1.part(self.b1.1));
        let par


uth_key', this.apiKey);
    url.searchParams.append('type', 'target');

    const response = await fetch(url.toString());

    if (!response.ok) {
      throw new Error('Could not fetch supported languages from DeepL');
    }

    const languages: Array<{
      language: string;
      name: string;
      supports_formality: boolean;
    }> = await response.json();
    return languages;
  }

  getFormalityLanguages(
    languages: Array<{
      language: string;
      name: string;
      supports_formality: boolean;
    }>,
  ) {
    const supportedLanguages = languages.filter((l) => l.supports_formality);
    return this.formatLanguages(supportedLanguages);
  }

  formatLanguages(
    languages: Array<{
      language: string;
      name: string;
      supports_formality: boolean;
    }>,
  ) {
    // DeepL supports e.g. either EN-US or EN as language code, but only returns EN-US
    // so we add both variants to the array and filter duplicates later.
    const languageCodes = languages.flatMap((l) => [
      l.language,
      l.language.split('-')[0],
    ]);
    return new Set(languageCodes.map((l) => l.toLowerCase()));
  }

  supportsLanguage(language: string) {
    return this.supportedLanguages.has(language.toLowerCase());
  }

  supportsFormality(language: string) {
    return this.formalityLanguages.has(language.toLowerCase());
  }

  async translateStrings(
    strings: { key: string; value: string }[],
    from: string,
    to: string,
  ) {
    const responses: TranslationResult[] = [];
    // Split the translation requests into batches
    // This is done because the DeepL API prevents the body of a request to be larger than 128 KiB (128 · 1024 bytes)
    // The default batch size is 1000 tokens, as this was found to almost always fit in the limit
    for (let i = 0; i < strings.length; i += this.batchSize) {
      const chunk = strings.slice(i, i + this.batchSize);

      responses.push(...(await this.runTranslation(chunk, from, to)));
    }
    return responses;
  }

  async runTranslation(
    strings: { key: string; value: string }[],
    from: string,
    to: string,
    triesLeft: number = 5,
  ): Promise<TranslationResult[]> {
    const cleaned = strings.map((s) =>
      replaceInterpolations(s.value, this.interpolationMatcher),
    );

    const body = {
      text: cleaned.map((c) => c.clean),
      source_lang: from.toUpperCase(),
      target_lang: to.toUpperCase(),
      // see https://www.deepl.com/docs-api/html/disabling
      // set in order to indicate to DeepL that the interpolated strings that the matcher
      // replaced with `${index} should not be translated
      tag_handling: 'html',
    };
    if (this.supportsFormality(to)) {
      // only append formality to avoid bad request error from deepl for languages with unsupported formality
      body['formality'] = this.formality;
    }

    // send request as a POST request, with all the tokens as separate texts in the body
    const response = await fetch(`${this.apiEndpoint}/translate`, {
      body: JSON.stringify(body),
      method: 'POST',
      headers: {
        Authorization: `DeepL-Auth-Key ${this.apiKey}`,
        'Content-Type': 'application/json',
      },
    });

    if (!response.ok) {
      // automatically retry the translation if DeepL rate-limits us
      // see https://support.deepl.com/hc/en-us/articles/360020710619-Error-code-429
      if (response.status === 429 && triesLeft > 0) {
        return this.runTranslation(strings, from, to, triesLeft - 1);


class="styles__Link-sc-1j2nu8t-8 styles__NextLink-sc-1j2nu8t-9 fgNqbp" href="/courses/grokking-the-object-oriented-design-interview/JP7BXYkj3DK">Next    →
Design Chess

Stuck? Get help on   DISCUSS

<svg width="25px" height="20px" viewBox="0 0 51 48"><g id="UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round"><g transform="translate(-1074.000000, -1165.000000)" id="FeedbackIcon" stroke="#000000"><g transform="translate(1073.000000, 1168.000000)"><g id="volume" stroke-linejoin="round" stroke-width="4.39999962"><path d="M13.0157749,15.0318872 L4.55277274,15.0318872 L4.86586151,28.201542 L11.6223057,28.201542 C13.0368243,28.201542 14.4442324,28.4016234 15.8027079,28.7958405 L45.8658615,37.5198913 L45.942567,5.61428925 L13.8507214,14.9133563 C13.5793752,14.9919828 13.2982831,15.0318872 13.0157749,15.0318872 Z" transform="translate(25.247670, 21.567090) rotate(-18.000000) translate(-25.247670, -21.567090) "></path></g><path d="M22.5,32 L25,42" id="Path-6" stroke-width="5" fill-rule="nonzero"></path></g></g></g></svg>Send feedback

<svg class="heart-icon" width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1664 596q0-81-21.5-143t-55-98.5-81.5-59.5-94-31-98-8-112 25.5-110.5 64-86.5 72-60 61.5q-18 22-49 22t-49-22q-24-28-60-61.5t-86.5-72-110.5-64-112-25.5-98 8-94 31-81.5 59.5-55 98.5-21.5 143q0 168 187 355l581 560 580-559q188-188 188-356zm128 0q0 221-229 450l-623 600q-18 18-44 18t-44-18l-624-602q-10-8-27.5-26t


.word	.LANCHOR0
	.word	1179929683
	.word	.LANCHOR0+292
	.size	Ftl_load_ext_data, .-Ftl_load_ext_data
	.align	2
	.global	sftl_vendor_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	sftl_vendor_read, %function
sftl_vendor_read:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	mov	ip, sp
	push	{fp, ip, lr, pc}
	sub	fp, ip, #4
	push	{lr}
	bl	__gnu_mcount_nc
	add	r0, r0, #256
	bl	FtlVendorPartRead
	ldmfd	sp, {fp, sp, pc}
	.size	sftl_vendor_read, .-sftl_vendor_read
	.align	2
	.global	FtlMapBlkWriteDump_data
	.syntax unified
	.arm
	.fpu softvfp
	.type	FtlMapBlkWriteDump_data, %function
FtlMapBlkWriteDump_data:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	mov	ip, sp
	push	{r4, r5, r6, r7, fp, ip, lr, pc}
	sub	fp, ip, #4
	push	{lr}
	bl	__gnu_mcount_nc
	ldr	r3, [r0, #36]
	mov	r4, r0
	cmp	r3, #0
	ldmfdeq	sp, {r4, r5, r6, r7, fp, sp, pc}
	ldrh	r6, [r0, #6]
	mov	r2, #0
	ldr	r5, .L1408
	sub	r6, r6, #1
	str	r2, [r0, #36]
	ldr	r3, [r0, #24]
	uxth	r6, r6
	ldr	r0, [r5, #3304]
	ldr	r2, [r5, #3332]
	str	r0, [r5, #3460]
	str	r2, [r5, #3464]
	ldr	r3, [r3, r6, lsl #2]
	str	r3, [r5, #3456]
	cmp	r3, #0
	beq	.L1403
	mov	r2, #1
	ldr	r0, .L1408+4
	mov	r1, r2
	bl	FlashReadPages
.L1404:
	ldr	r2, [r5, #3460]
	mov	r1, r6
	mov	r0, r4
	bl	FtlMapWritePage
	ldmfd	sp, {r4, r5, r6, r7, fp, sp, pc}
.L1403:
	movw	r3, #310
	mov	r1, #255
	ldrh	r2, [r5, r3]
	bl	ftl_memset
	b	.L1404
.L1409:
	.align	2
.L1408:
	.word	.LANCHOR0
	.word	.LANCHOR0+3452
	.size	FtlMapBlkWriteDump_data, .-FtlMapBlkWriteDump_data
	.section	.rodata.str1.1
.LC120:
	.ascii	"FtlVpcTblFlu


 ) {
                number_of_pml_cells.push_back( number_of_pml_cells[0] );
            }
        } else if( number_of_pml_cells.size() != nDim_field ) {
            ERROR_NAMELIST( "number_of_pml_cells must be the same size as the number of dimensions",
                            LINK_NAMELIST + std::string("#main-variables") );
        }
        for( unsigned int iDim=0; iDim<nDim_field; iDim++ ) {
            if( number_of_pml_cells[iDim].size() == 1 ) { // if just one type is specified, then take the same bc type in a given dimension
                number_of_pml_cells[iDim].push_back( number_of_pml_cells[iDim][0] );
            }
        }
    }

    // -----------------------------------
    // POISSON & FILTERING OPTIONS
    // -----------------------------------

    time_fields_frozen=0.0;
    PyTools::extract( "time_fields_frozen", time_fields_frozen, "Main"   );

    // Poisson Solver
    PyTools::extract( "solve_poisson", solve_poisson, "Main"   );
    PyTools::extract( "poisson_max_iteration", poisson_max_iteration, "Main"   );
    PyTools::extract( "poisson_max_error", poisson_max_error, "Main"   );
    // Relativistic Poisson Solver
    PyTools::extract( "solve_relativistic_poisson", solve_relativistic_poisson, "Main"   );
    PyTools::extract( "relativistic_poisson_max_iteration", relativistic_poisson_max_iteration, "Main"   );
    PyTools::extract( "relativistic_poisson_max_error", relativistic_poisson_max_error, "Main"   );

    // Use BTIS3 interpolation method to reduce the effects of numerical Cherenkov radiation
    // This method is detailed in P.-L. Bourgeois and X. Davoine (2023) https://doi.org/10.1017/S0022377823000223
    use_BTIS3 = false;
    PyTools::extract( "use_BTIS3_interpolation", use_BTIS3, "Main"   );
    if (use_BTIS3 && interpolation_order != 2 && (interpolation_order != 1 || geometry != "AMcylindrical" || is_spectral==true )){
        if (geometry=="AMcylindrical"){
            ERROR("B-TIS3 interpolation is not implemented for PSATD solver.");
        } else {
            ERROR("B-TIS3 interpolation is implemented only at order 2 for Cartesian geometries.");
        }
    }

    // Current filter properties
    int nCurrentFilter = PyTools::nComponents( "CurrentFilter" );
    for( int ifilt = 0; ifilt < nCurrentFilter; ifilt++ ) {
        PyTools::extract( "model", currentFilter_model, "CurrentFilter", ifilt );
        if( (currentFilter_model != "binomial")&&(currentFilter_model != "customFIR") ) {
            ERROR_NAMELIST( "Currently, only the `binomial` and `customFIR` model is available in CurrentFilter()",
            LINK_NAMELIST + std::string("#current-filtering") );
        }

        if(currentFilter_model == "customFIR") {
            PyTools::extractV( "kernelFIR", currentFilter_kernelFIR, "CurrentFilter", ifilt );
            if( currentFilter_kernelFIR.size() < 3 ) {
                ERROR_NAMELIST( "Kernel have to measure 3 taps at least. For example the binomial FIR kernel on three tapis [0.25,0.50,0.25]",
                                LINK_NAMELIST + std::string("#current-filtering"));
            }
        }

        PyTools::extractV( "passes", currentFilter_passes, "CurrentFilter", ifilt );  //test list

        if( currentFilter_passes.size() == 0 ) {
            ERROR_NAMELIST( "passes in block 'CurrentFilter' cannot be empty",  LINK_NAMELIST +


   ProcessFormat6Glyph
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
*   POV-Ray Team
*
* DESCRIPTION
*
*  This handles the trimmed table mapping for glyphs.
*
* CHANGES
*
*   -
*
******************************************************************************/
bool ProcessFormat6Glyph(TrueTypeFont *ffile, GlyphIndex& glyphIndex, POV_UINT32 search_codepoint)
{
    USHORT firstCode, entryCount;

    if (search_codepoint > 0xFFFFu)
        return false;

    firstCode = READUSHORT(*ffile->file);
    entryCount = READUSHORT(*ffile->file);

    if (search_codepoint >= firstCode && search_codepoint < firstCode + entryCount)
    {
        ffile->file->seekg(((int)(search_codepoint - firstCode)) * 2, IOBase::seek_cur);
        glyphIndex = READUSHORT(*ffile->file);
    }

    return (glyphIndex != 0);
}

/*****************************************************************************
*
* FUNCTION
*
*   ExtractGlyphInfo
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
*   POV-Ray Team
*
* DESCRIPTION
*
*   Change TTF outline information for the glyph(s) into a useful format
*
* CHANGES
*
*   -
*
******************************************************************************/
GlyphPtr ExtractGlyphInfo(TrueTypeFont *ffile, GlyphIndex glyph_index, UCS4 c)
{
    GlyphOutline *ttglyph;
    GlyphPtr glyph;

    ttglyph = ExtractGlyphOutline(ffile, glyph_index, c);
    POV_SHAPE_ASSERT(ttglyph != nullptr);

    /*
     * Convert the glyph outline information from TrueType layout into a more
     * easily processed format
     */

    glyph = ConvertOutlineToGlyph(ffile, ttglyph);
    glyph->glyph_index = glyph_index;
    glyph->myMetrics = ttglyph->myMetrics;

    /* Free up outline information */

    delete ttglyph;

#ifdef TTF_DEBUG3
    int i, j;

    Debug_Info("// Character '%c'\n", (char)c);

    for(i = 0; i < (int)glyph->header.numContours; i++)
    {
        Debug_Info("BYTE gGlypthFlags_%c_%d[] = \n", (char)c, i);
        Debug_Info("{");
        for(j = 0; j <= (int)glyph->contours[i].count; j++)
        {
            if((j % 10) == 0)
                Debug_Info("\n\t");
            Debug_Info("0x%x, ", (unsigned int)glyph->contours[i].flags[j]);
        }
        Debug_Info("\n};\n\n");

        Debug_Info("DBL gGlypthX_%c_%d[] = \n", (char)c, i);
        Debug_Info("{");
        for(j = 0; j <= (int)glyph->contours[i].count; j++)
        {
            if((j % 10) == 0)
                Debug_Info("\n\t");
            Debug_Info("%f, ", (DBL)glyph->contours[i].x[j]);
        }
        Debug_Info("\n};\n\n");

        Debug_Info("DBL gGlypthY_%c_%d[] = \n", (char)c, i);
        Debug_Info("{");
        for(j = 0; j <= (int)glyph->contours[i].count; j++)
        {
            if((j % 10) == 0)
                Debug_Info("\n\t");
            Debug_Info("%f, ", (DBL)glyph->contours[i].y[j]);
        }
        Debug_Info(


ng, string[]>
        {
            { TraceParent, [$"00-{TraceId}-{SpanId}-01"] },
            { TraceState, tracestate },
        };
        var f = new TraceContextPropagator();
        var ctx = f.Extract(default, headers, ArrayGetter);

        var traceState = ctx.ActivityContext.TraceState;
        Assert.NotNull(traceState);
        return traceState;
    }
}


ui-layedit-tool .layui-icon:hover{color:#393D49}.layui-layedit-tool .layui-icon:active{color:#000}.layui-layedit-tool .layedit-tool-active{background-color:#e2e2e2;color:#000}.layui-layedit-tool .layui-disabled,.layui-layedit-tool .layui-disabled:hover{color:#d2d2d2;cursor:not-allowed}.layui-layedit-tool .layedit-tool-mid{width:1px;height:18px;margin:0 10px;background-color:#d2d2d2}.layedit-tool-html{width:50px!important;font-size:30px!important}.layedit-tool-b,.layedit-tool-code,.layedit-tool-help{font-size:16px!important}.layedit-tool-d,.layedit-tool-face,.layedit-tool-image,.layedit-tool-unlink{font-size:18px!important}.layedit-tool-image input{position:absolute;font-size:0;left:0;top:0;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-layedit-iframe iframe{display:block;width:100%}#LAY_layedit_code{overflow:hidden}.layui-laypage{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid #e2e2e2}.layui-laypage a,.layui-laypage span{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-flow-more a *,.layui-laypage input,.layui-table-view select[lay-ignore]{display:inline-block}.layui-laypage a:hover{color:#009688}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage a{text-decoration:none}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:#009688}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh{vertical-align:top}.layui-laypage .layui-laypage-refresh i{font-size:18px;cursor:pointer}.lay


',	'通关3-6【遗民之争】',	'1',	'1306',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13307',	'',	'',	'30005',	'通关3-7【附生暗影】',	'1',	'1307',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13308',	'',	'',	'30005',	'通关3-8【前行之路】',	'1',	'1308',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13309',	'',	'',	'30005',	'通关3-9【一触即发】',	'1',	'1309',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13310',	'',	'',	'30005',	'通关3-10【长夜梦醒】',	'1',	'1310',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13311',	'',	'',	'30005',	'通关3-11【往昔幻影】',	'1',	'1311',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13312',	'',	'',	'30005',	'通关3-12【不按常理】',	'1',	'1312',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13313',	'',	'',	'30005',	'通关3-13【正午烈阳】',	'1',	'1313',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13314',	'',	'',	'30005',	'通关3-14【疾速奔行】',	'1',	'1314',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13315',	'',	'',	'30005',	'通关3-15【中断回路】',	'1',	'1315',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13316',	'',	'',	'30005',	'通关3-16【高空翱翔】',	'1',	'1316',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13317',	'',	'',	'30005',	'通关3-17【汹涌如潮】',	'1',	'1317',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13318',	'',	'',	'30005',	'通关3-18【手握命运】',	'1',	'1318',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13319',	'',	'',	'30005',	'通关3-19【侵吞战影】',	'1',	'1319',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'13320',	'',	'',	'30005',


(t, err)

	mgr.Run(ctx)

	// THEN: we expect that the handler will have received the notifications for dispatch
	require.Eventually(t, func() bool {
		handler.mu.RLock()
		defer handler.mu.RUnlock()
		return slices.Contains(handler.succeeded, sid[0].String()) &&
			slices.Contains(handler.failed, fid[0].String())
	}, testutil.WaitLong, testutil.IntervalFast)

	// THEN: we expect the store to be called with the updates of the earlier dispatches
	require.Eventually(t, func() bool {
		return interceptor.sent.Load() == 2 &&
			interceptor.failed.Load() == 2
	}, testutil.WaitLong, testutil.IntervalFast)

	// THEN: we verify that the store contains notifications in their expected state
	success, err := store.GetNotificationMessagesByStatus(ctx, database.GetNotificationMessagesByStatusParams{
		Status: database.NotificationMessageStatusSent,
		Limit:  10,
	})
	require.NoError(t, err)
	require.Len(t, success, 2)
	failed, err := store.GetNotificationMessagesByStatus(ctx, database.GetNotificationMessagesByStatusParams{
		Status: database.NotificationMessageStatusTemporaryFailure,
		Limit:  10,
	})
	require.NoError(t, err)
	require.Len(t, failed, 2)
}

func TestSMTPDispatch(t *testing.T) {
	t.Parallel()

	// SETUP

	ctx := dbauthz.AsNotifier(testutil.Context(t, testutil.WaitSuperLong))
	store, pubsub := dbtestutil.NewDB(t)
	logger := testutil.Logger(t)

	// start mock SMTP server
	mockSMTPSrv := smtpmock.New(smtpmock.ConfigurationAttr{
		LogToStdout:       false,
		LogServerActivity: true,
	})
	require.NoError(t, mockSMTPSrv.Start())
	t.Cleanup(func() {
		assert.NoError(t, mockSMTPSrv.Stop())
	})

	// GIVEN: an SMTP setup referencing a mock SMTP server
	const from = "danny@coder.com"
	method := database.NotificationMethodSmtp
	cfg := defaultNotificationsConfig(method)
	cfg.SMTP = codersdk.NotificationsEmailConfig{
		From:      from,
		Smarthost: serpent.String(fmt.Sprintf("localhost:%d", mockSMTPSrv.PortNumber())),
		Hello:     "localhost",
	}
	handler := newDispatchInterceptor(dispatch.NewSMTPHandler(cfg.SMTP, logger.Named("smtp")))
	mgr, err := notifications.NewManager(cfg, store, pubsub, defaultHelpers(), createMetrics(), logger.Named("manager"))
	require.NoError(t, err)
	mgr.WithHandlers(map[database.NotificationMethod]notifications.Handler{
		method:                           handler,
		database.NotificationMethodInbox: &fakeHandler{},
	})
	t.Cleanup(func() {
		assert.NoError(t, mgr.Stop(ctx))
	})
	enq, err := notifications.NewStoreEnqueuer(cfg, store, defaultHelpers(), logger.Named("enqueuer"), quartz.NewReal())
	require.NoError(t, err)

	user := createSampleUser(t, store)

	// WHEN: a message is enqueued
	msgID, err := enq.Enqueue(ctx, user.ID, notifications.TemplateWorkspaceDeleted, map[string]string{}, "test")
	require.NoError(t, err)
	require.Len(t, msgID, 2)

	mgr.Run(ctx)

	// THEN: wait until the dispatch interceptor validates that the messages were dispatched
	require.Eventually(t, func() bool {
		assert.Nil(t, handler.lastErr.Load())
		assert.True(t, h


.22 1.095-1.83.395-.604.806-1.188 1.224-1.745h.394c.54 0 1.126.01 1.734.048 6.53.343 10.975 2.56 10.884 4.334-.04.765-.924 1.538-2.425 2.12a.464.464 0 00-.26.596.455.455 0 00.593.262c1.905-.74 2.95-1.756 3.01-2.93.07-1.33-1.17-2.61-3.5-3.6v-.01zM8.073 9.45c-.27.415-.52.827-.764 1.244a23.66 23.66 0 01-.723-2.215c.713-.11 1.485-.19 2.31-.24-.28.39-.554.794-.82 1.21v-.01zm3.925 1.175a1.375 1.375 0 100 2.75 1.375 1.375 0 100-2.75z"/></svg>';
  static const String auchan =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="m14.467 18.753 1.652 4.636h1.218l-1.744-4.859a7.959 7.959 0 01-1.126.222M0 23.39h5.506l1.782-5.611H1.916A107.284 107.284 0 000 23.388m7.255-12.634L10.434 8.1c.52-1.409 1.064-2.82 1.63-4.022.281.641.549 1.282.83 1.964 1.226-1.007 2.032-1.555 2.073-1.582l.016-.011a5.662 5.662 0 011.632-.707 112.778 112.778 0 00-1.482-3.13H8.964c-.514.99-2.432 4.951-4.676 10.398h2.27a.974.974 0 00.697-.256m12.907 4.408a7.454 7.454 0 01-3.473 2.966l1.87 5.26H24c-1.087-3.3-2.254-6.278-3.348-9.068-.153.303-.316.56-.49.841m-1.613-8.866c.157 0 .303.036.436.1-.027-.004-.054-.01-.081-.01a.584.584 0 00-.585.582.581.581 0 00.585.58.581.581 0 00.582-.58c0-.02-.002-.037-.004-.054a.999.999 0 01.077.384c0 .553-.452 1.003-1.01 1.003a1.008 1.008 0 01-1.01-1.003c0-.556.453-1.002 1.01-1.002zm-5.64 11.317c1.33 0 4.504-.337 6.221-3.096 1.72-2.76 2.32-7.138 2.32-7.138l1.882-.892c.118-.06.087-.263-.057-.263h-2.029c-.318-.495-1.42-1.55-3.042-1.55-.963 0-1.806.272-2.562.764 0 0-1.101.75-2.703 2.128l-4.904 4.08c-.378.316-.84.52-1.48.52H.386c-.174 0-.115.147-.087.231.435 1.326 1.596 2.509 3.623 2.509l-1.448 1.491c-.057.057-.057.226.087.226h5.505c3.978 0 6.424-1.741 8.032-4.154.138-.207.267-.427.39-.64.06.029.067.087.038.143-.


.parse(
      '1.1,1.2,1.3,1.4,2.1,2.2,2.3,2.4,3.1,3.2,3.3,3.4',
      type: Coords.xyzm,
    );

    test('Creating position arrays', () {
      expect(xyzmArray3.values, xyzmData3);
      expect(xyzmArray3FromText.values, xyzmArray3.values);
      expect(xyzmArray3.coordType, Coords.xyzm);
    });

    test('Access projected positions', () {
      final projected = xyzmArray3.positionsAs(to: Projected.create).toList();
      expect(projected.length, 3);
      expect(projected.first.coordType, Coords.xyzm);

      final tests = [
        [
          [1.1, 1.2, 1.3, 1.4].xyzm,
          [2.1, 2.2, 2.3, 2.4].xyzm,
          [3.1, 3.2, 3.3, 3.4].xyzm,
        ],
        [
          const Projected(x: 1.1, y: 1.2, z: 1.3, m: 1.4),
          const Projected(x: 2.1, y: 2.2, z: 2.3, m: 2.4),
          const Projected(x: 3.1, y: 3.2, z: 3.3, m: 3.4),
        ],
      ];

      for (final test in tests) {
        expect(projected, test);
        for (var index = 0; index < 3; index++) {
          expect(projected[index], test[index]);
          expect(projected[index].copyTo(Projected.create), tests[1][index]);
          expect(
            projected[index].copyTo(Geographic.create),
            tests[1][index],
          );
          expect(projected[index].x, test[index].x);
          expect(projected[index].y, test[index].y);
          expect(projected[index].z, test[index].z);
          expect(projected[index].optZ, test[index].optZ);
          expect(projected[index].m, test[index].m);
          expect(projected[index].optM, test[index].optM);
        }
      }
    });
  });

  group('Position series reversed and toText', () {
    test('xy', () {
      final coords = [1.1, 1.2, 2.1, 2.2, 3.1, 3.2, 4.1, 4.2];
      final xyCoords = PositionSeries.view(coords);
      final xyPos = PositionSeries.from([
        [1.1, 1.2].xy,
        [2.1, 2.2].xy,
        [3.1, 3.2].xy,
        [4.1, 4.2].xy,
      ]);
      for (final xy in [xyCoords, xyPos]) {
        expect(xy.toText(), '1.1,1.2,2.1,2.2,3.1,3.2,4.1,4.2');
        expect(
          xy.toText(positionDelimiter: ' ', decimals: 2),
          '1.10,1.20 2.10,2.20 3.10,3.20 4.10,4.20',
        );
        final xyRev = xy.reversed();
        expect(xy[1], [2.1, 2.2].xy);
        expect(xyRev[2], [2.1, 2.2].xy);
        expect(xyRev.values, [4.1, 4.2, 3.1, 3.2, 2.1, 2.2, 1.1, 1.2]);
        expect(xyRev.toText(), '4.1,4.2,3.1,3.2,2.1,2.2,1.1,1.2');
        expect(xyRev.toText(swapXY: true), '4.2,4.1,3.2,3.1,2.2,2.1,1.2,1.1');
        expect(
          xyRev.valuesByType(Coords.xy),
          [4.1, 4.2, 3.1, 3.2, 2.1, 2.2, 1.1, 1.2],


相近的企业可以联合建立行业性职工代表大会。

区域性、行业性职工代表大会的工作机构是区域、行业工会。

第三十九条 乡、镇人民政府和街道办事处应当积极推动实施区域性、行业性职工代表大会制度，支持和保障职工代表大会制度的正常运行，确定相关职能部门履行下列职责：

（一）组织、协调区域性、行业性职工代表大会制度的建立；

（二）指导、督促区域性、行业性职工代表大会落实本条例各项规定、行使各项职权；

（三）会同工会和企业联合组织等确定实施区域性、行业性职工代表大会制度的召集人和责任人；

（四）督促落实区域性、行业性职工代表大会决议；

（五）会同工会和企业联合组织依法对违反本条例规定的企业提出处理建议。

第四十条 区域性、行业性职工代表大会行使下列职权：

（一）听取区域、行业内企业执行劳动法律法规和政策情况报告，区域、行业劳动关系状况报告，并提出意见和建议；

（二）审议区域、行业内企业有关劳动报酬、工作时间、休息休假、劳动安全卫生、保险福利、职工培训，以及劳动定额等直接涉及职工切身利益的重大事项，提出意见和建议；

（三）审议通过区域性、行业性集体合同草案和专项集体合同草案；

（四）审查监督区域、行业内企业执行劳动法律法规和区域性、行业性职工代表大会决定事项的情况，履行区域性、行业性集体合同和专项集体合同及缴纳社会保险费等情况；

（五）其他应当由区域性、行业性职工代表大会行使的职权。

第四十一条 区域性、行业性职工代表大会的职工代表人数和构成，由区域、行业工会与区域、行业内企业协商确定，并根据实际设立选区，组织职工按比例民主选举产生职工代表。

区域性、行业性职工代表大会的职工代表总数不得少于三十人，其中企业经营管理者不得超过百分之三十，一线职工不得少于百分之五十。

第四十二条


this.getAggregateRootId(),
            this.playhead,
            event,
        );

        this.recursiveHandling(event, this.methodToApplyEvent(domainMessage.eventType));

        this.playhead++;

        this.events.push(domainMessage);
    }

    private handle(event: object|DomainEvent, method: string): void {
        if ((this as any)[method]) {
            (this as any)[method](event);
        }
    }

    private methodToApplyEvent(eventName: string): string {

        return this.methodPrefix + eventName;
    }
}
import * as Phaser from 'phaser-ce';

export class Mushroom extends Phaser.Sprite {
  constructor (
    public game: any,
    public x: number,
    public y: number,
    public key: string | Phaser.RenderTexture | Phaser.BitmapData | PIXI.Texture,
  ) {
    super(game, x, y, key);
    this.key = this.key;
    this.anchor.setTo(0.5);
  }

  public update(): void {
    this.angle ++;
  }
}

/**
 * TeamWrecker is a special role for attacking bases, working together with TeamHealer.
 * Has WORK for deconstruct and RANGED_ATTACK for defense. All parts T3 boosted.
 * T1 - 2280 E, 8 TOUGH, 14 WORK, 2 RANGED_ATTACK, 6 MOVE
 * T2 - 3570 E, 12 TOUGH, 20 WORK, 4 RANGED_ATTACK, 9 MOVE
 * T3 - 4660 E, 16 TOUGH, 20 WORK, 4 RANGED_ATTACK, 10 MOVE
 */
export function getB3TeamWreckerBody(tier: number): string[] {
    if (tier > 3) { tier = 3; }
    let body: string[] = [];

    body = addToBody(body, 4, [TOUGH])
    body = addToBody(body, tier * 4, [TOUGH]);

    body = addToBody(body, 14, [WORK]);
    if (tier > 1) {
        body = addToBody(body, 6, [WORK]);
    }

    body = addToBody(body, 2, [RANGED_ATTACK]);
    if (tier > 1) {
        body = addToBody(body, 2, [RANGED_ATTACK]);
    }

    body = addToBody(body, 6, [MOVE]);
    if (tier === 2) {
        body = addToBody(body, 3, [MOVE]);
    }
    if (tier === 3) {
        body = addToBody(body, 4, [MOVE]);
    }

    return body;
}

/**
 * TeamHealer is a special role for support in teams, working together with other teammembers.
 * Has HEAL for healing. All parts boosted with T3 Boosts.
 * T1 - 2280 E, 8 TOUGH, 8 HEAL, 4 MOVE
 * T2 - 4470 E, 12 TOUGH, 16 HEAL, 7 MOVE
 * T3 - 6660 E, 16 TOUGH, 24 HEAL, 10 MOVE
 */
export function getB3TeamHealerBody(tier: number): string[] {
    if (tier > 3) { tier = 3; }
    let body: string[] = [];

    body = addToBody(body, 4, [TOUGH])
    body = addToBody(body, tier * 4, [TOUGH]);

    body = addToBody(body, tier * 8, [HEAL]);

    body = addToBody(body, 4, [MOVE]);
    if (tier === 2) {
        body = addToBody(body, 3, [MOVE]);
    }
    if (tier === 3) {
        body = addToBody(body, 6, [MOVE]);
    }

    return body;
}

/**
 * TeamWrecker is a special role for attacking bases, working together with TeamHealer.
 * Has WORK for deconstru


operties("path", "", "key")
	assert.Error(t, err)
	assert.EqualValues(t, FailedAllPatternPropsCode, err.Code())
	//failedAllPatternPropsNoIn = "%s.%s failed all pattern properties"
	assert.Equal(t, "path.key failed all pattern properties", err.Error())
}
/*
 *  Copyright (C) 2020 Intel Corporation
 *  SPDX-License-Identifier: BSD-3-Clause
 */

package hvs

import "github.com/open-edge-platform/trusted-compute/attestation-verifier/src/pkg/model/hvs"

// FlavorFromAppManifest API request payload
// swagger:parameters ManifestRequest
type ManifestRequest struct {
	// in:body
	Body hvs.ManifestRequest
}

// FlavorFromAppManifest API response payload
// swagger:parameters Flavor
type Flavor struct {
	// in:body
	Body hvs.Flavor
}

// ---
//
// swagger:operation POST /flavor-from-app-manifest Flavor-From-App-Manifest Create-Software-Flavor
// ---
//
// description: |
//      A flavor is a set of measurements and metadata organized in a flexible format that allows for ease of further extension. The measurements included in the flavor pertain to various hardware, software and feature categories, and their respective metadata sections provide descriptive information.
//
//      When a flavor is created, it is associated with a flavor group. This means that the measurements for that flavor type are deemed acceptable to obtain a trusted status. If a host, associated with the same flavor group, matches the measurements contained within that flavor, the host is trusted for that particular flavor category (dependent on the flavor group policy). If no flavor group name is defined in input, flavor is, by default, associated with automatic flavor group.
//
//      A manifest is a list of files/directories/symlinks that are to be measured. The manifest provided can be used to create SOFTWARE flavor only.
//
//      The Verification Service exposes this REST API to create and store SOFTWARE flavor as per the manifest provided.
//
//      The serialized ManifestRequest Go struct object represents the content of the request body.
//
//        | Attribute                      | Description                                     |
//        |--------------------------------|-------------------------------------------------|
//        | hostId                         | (Optional) The host id is used to fetch the connection string from database. If not provided, 'connectionString' needs to be provided.|
//        | connectionString               | (Optional) The connection string is of the form <b>https://tagent-ip:1443"</b>. If not provided, 'hostId' needs to be provided.|
//        | flavorgroupNames               | (Optional) Name of the flavor groups the created flavor needs to be associated to. If not provided, flavor is associated to default flavor group.|
//        | Manifest                       | Application manifest for which flavor needs to be created. |
//
//
// x-permissions: software_flavors:create
// security:
//  - bearerAuth: []
// produces:
// - application/json
// consumes:
// - application/xml
// parameters:
// - name: request body
//   required: true
//   in: body
//   schema:
//    "$ref": "#/definitions/ManifestRequest"
// - name: Content-Type
//   description: Content-Type header
//   in: header
//   type: string
//   required: true
//   enum:
//     - application/xml
// - name: Accept
//   description: Accept header
//   in: header
//   type: string
//   required: true
//   enum:
//     - application/json
// responses:
//   '201':
//     description: Successfully created the software flavor.
//


 the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*!
 * Copyright 1999-2018 Alibaba Group Holding Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*!
 * Copyright 1999-2018 Alibaba Group Holding Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*!
 * Copyright 1999-2018 Alibaba Group Holding Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */.next-balloon{font-size:12px}.next-balloon-title.next-balloon-closable .next-balloon-close{transform:translateY(18px)}.next-balloon-primary{border-color:#4494f9;background-color:#e3f2fd}.next-balloon-primary .next-balloon-close{transform:translateY(16px);font-size:12px}.next-balloon-primary .next-balloon-close .next-icon{width:12px;height:12px}.next-balloon-primary .next-balloon-close .next-icon:before{width:12px;height:12px;font-size:12px}.next-balloon-primary:after{border:1px solid #4494f9;background-color:#e3f2fd}.next-balloon-normal{border-color:#dcdee3;box-shadow:0 2px 4px 0 rgba(0,0,0,.12)}.next-balloon-normal .next-balloon-close{transform:translateY(16px);font-size:12px}.next-balloon-normal .next-balloon-close .next-icon{width:12px;height:12px}.next-balloon-normal .next-balloon-close .next-icon:before{width:12px;height:12px;font-size:12px}.next-balloon-normal:after{border:1px solid #dcdee3}.next-balloon-tooltip{font


fadd	za.d[w8, 0], { z0.d - z1.d }
	fadd	za.d[w8, 0, vgx2], { z0.d - z1.d }
	FADD	ZA.d[W8, 0, VGx2], { Z0.d - Z1.d }
	FADD	ZA.D[W8, 0, VGX2], { Z0.D - Z1.D }
	fadd	za.d[w11, 0], { z0.d - z1.d }
	fadd	za.d[w8, 7], { z0.d - z1.d }
	fadd	za.d[w8, 0], { z30.d - z31.d }
	fadd	za.d[w10, 3], { z10.d - z11.d }

	fadd	za.d[w8, 0], { z0.d - z3.d }
	fadd	za.d[w8, 0, vgx4], { z0.d - z3.d }
	FADD	ZA.d[W8, 0, VGx4], { Z0.d - Z3.d }
	FADD	ZA.D[W8, 0, VGX4], { Z0.D - Z3.D }
	fadd	za.d[w11, 0], { z0.d - z3.d }
	fadd	za.d[w8, 7], { z0.d - z3.d }
	fadd	za.d[w8, 0], { z28.d - z31.d }
	fadd	za.d[w11, 1], { z12.d - z15.d }


.24c-.057-.069.172-.777.697-1.006.329-.142.675-.183.894-.187zm-2.523.264c.107.011.59.419.6.997a1.646 1.646 0 01-.388 1.052c-.149-.137-.469-.491-.503-.949v-.068c0-.492.217-.983.274-1.029.004-.003.01-.004.017-.003zm1.985 1.07c.133.003.217.018.204.03-.034.035-.206.663-.708.915a1.383 1.383 0 01-.995.148c.263-.297.206-.731.64-.937.279-.129.638-.159.86-.155zm-3.866.133a.057.057 0 00-.044.023l-.617 1.177c-.012.012 0 .035 0 .046l.08.137a.046.046 0 00.08-.011l.617-1.166c0-.011.011-.023 0-.046l-.069-.137a.057.057 0 00-.047-.023zm7.66.829c.014.002.03.011.044.028 1.783 1.932 2.915 2.31 3.532 2.492.057.023.046.091.023.16-.286 1.005-.435 1.406 0 2.503.057.148.103.262-.023.24-.88-.16-1.075-.297-3.852-.069-.194.023.069-.388.035-.663.251-.034.663-.148.743-.56.08-.411-.24-.868-.206-.937.4-.766-.023-1.611-.354-3.04-.026-.103.012-.16.057-.154zm-6.873.5c-.017.003-.031.014-.031.031l-.331 1.372c-.012.023 0 .034 0 .046l.114.114a.046.046 0 00.08-.012l.32-1.36c.011-.011 0-.023 0-.034l-.103-.137a.049.049 0 00-.049-.02zm2.489 2.851c.056.007.111.04.154.083.114.115-.08.32-.103.492-.08.022-.331.034-.274-.309.036-.214.13-.277.223-.266zm1.583.096c.155-.01.304.046.297.124-.035.492-.24 1.052.137 1.612.149.217-.594.251-.731-.32-.092-.423-.126-1.143.045-1.314a.394.394 0 01.252-.102zm.962.04c.203-.002.475.028.546.05.115.034-.091.777.777 1.12.08.034-.011 1.006-1.28.686-.182-.046-.685-.846-.274-1.806.013-.034.11-.048.23-.05zm1.938.018c.23.031.238.746-.112.866-.674.229-.948-.56-.834-.731.114-.172.503.114.834-.103a.164.164 0 01.112-.032zm-3.78.073c.128-.004.245.022.251.085.012.126-.126.617.034 1.165-.034.08-.525.046-.662-.32-.069-.308-.046-.72.057-.834.051-.057.191-.091.32-.096z"/></svg>';
  static const String micro_dot_blog =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M12 0C5.4 0 0 4.9 0 10.95 0 17 5.4 21.9 12 21.9c1.4 0 2.85-.25 4.2-.7.15-.05.35 0 .45.1 1 1


/**
 * @file BLog.c
 * @author Ambroz Bizjak <ambrop7@gmail.com>
 *
 * @section LICENSE
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the author nor the
 *    names of its contributors may be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <stdio.h>
#include <stddef.h>

#include "BLog.h"

#ifdef ANDROID
#include <android/log.h>
#endif

#ifndef BADVPN_PLUGIN

struct _BLog_channel blog_channel_list[] = {
#include <generated/blog_channels_list.h>
};

struct _BLog_global blog_global = {
    #ifndef NDEBUG
    0
    #endif
};

#endif

// keep in sync with level numbers in BLog.h!
static char *level_names[] = { NULL, "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG" };

static void stdout_log (int channel, int level, const char *msg)
{
#ifndef ANDROID
    fprintf(stdout, "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
#else
    __android_log_print(ANDROID_LOG_DEBUG, "tun2socks",
            "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
#endif
}

static void stderr_log (int channel, int level, const char *msg)
{
#ifndef ANDROID
    fprintf(stderr, "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
#else
    __android_log_print(ANDROID_LOG_ERROR, "tun2socks",
            "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
#endif
}

static void stdout_stderr_free (void)
{
}

void BLog_InitStdout (void)
{
    BLog_Init(stdout_log, stdout_stderr_free);
}

void BLog_InitStderr (void)
{
    BLog_Init(stderr_log, stdout_stderr_free);
}


#if UNITY_4_6 || UNITY_4_7
using UnityEngine;

namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
{
    [TaskCategory("Basic/Light")]
    [TaskDescription("Sets the shadow softness fade value of the light.")]
    public class SetShadowSoftnessFade : Action
    {
        [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
        public SharedGameObject targetGameObject;
        [Tooltip("The shadow softness fade to set")]
        public SharedFloat shadowSoftnessFade;

        // cache the light component
        private Light light;
        private GameObject prevGameObject;

        public override void OnStart()
        {
            var currentGameOb


self;
        (point.x.abs() + point.y.abs()) as usize
    }

    pub fn find_closest(&self, others: Vec<Self>) -> Self {
        let mut dist = f32::MAX;
        let mut best = &Point::new(-1, -1);
        for point in others.iter() {
            let current = self.distance_squared(point);
            if dist > current {
                best = point;
                dist = current;
            }
        }
        best.clone()
    }

    // needs rework to use try_from for direction
    pub fn get_neighbour_direction(self, neighbour: Self) -> Option<Direction> {
        let p = neighbour - self;
        match p {
            Point { x: 1, y: 0 } => Some(Direction::Right),
            Point { x: -1, y: 0 } => Some(Direction::Left),
            Point { x: 0, y: 1 } => Some(Direction::Up),
            Point { x: 0, y: -1 } => Some(Direction::Down),
            _ => None,
        }
    }

    pub fn is_neighbour(self, other: Point) -> bool {
        self.manhattan_distance(&other) == 1
    }

    pub fn is_not_negative(&self) -> bool {
        self.x >= 0 && self.y >= 0
    }
}

impl fmt::Display for Point {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{{{}, {}}}", self.x, self.y)
    }
}

impl Sub for Point {
    type Output = Self;

    fn sub(self, other: Self) -> Self::Output {
        Self {
            x: self.x - other.x,
            y: self.y - other.y,
        }
    }
}

impl Sub<&Point> for Point {
    type Output = Self;

    fn sub(self, other: &Self) -> Self::Output {
        Self {
            x: self.x - other.x,
            y: self.y - other.y,
        }
    }
}

impl Add for Point {
    type Output = Self;

    fn add(self, other: Self) -> Self {
        Self {
            x: self.x + other.x,
            y: self.y + other.y,
        }
    }
}

impl Add<Direction> for Point {
    type Output = Self;

    fn add(self, dir: Direction) -> Self {
        self + Point::from(dir)
    }
}

impl Add<&Direction> for Point {
    type Output = Self;

    fn add(self, dir: &Direction) -> Self {
        self + Point::from(dir)
    }
}

impl Sub<Direction> for Point {
    type Output = Self;

    fn sub(self, dir: Direction) -> Self {
        self - Point::from(dir)
    }
}

impl Sub<&Direction> for Point {
    type Output = Self;

    fn sub(self, dir: &Direction) -> Self {
        self - Point::from(dir)
    }
}

impl From<Direction> for Point {
    fn from(dir: Direction) -> Self {
        match dir {
            Direction::Right => Point { x: 1, y: 0 },
            Direction::Left => Point { x: -1, y: 0 },
            Direction::Up => Point { x: 0, y: 1 },
            Direction::Down => Point { x: 0, y: -1 },
        }
    }
}

impl From<&Direction> for Point {
    fn from(dir: &Direction) -> Self {
        match *dir {
            Direction::Right => Point { x: 1, y: 0 },
            Direction::Left => Point { x: -1, y: 0 },
            Direction::Up => Point { x: 0, y: 1 },
            Direction::Down => Point { x: 0, y: -1 },
        }
    }
}

#[cfg(test


);
        intersil_clock->cmd_reg=(INTERSIL_RUN|INTERSIL_INT_ENABLE|INTERSIL_24H_MODE);
        sun3_enable_interrupts();
        intersil_clear();
}

#if IS_ENABLED(CONFIG_SUN3_SCSI)

static const struct resource sun3_scsi_vme_rsrc[] __initconst = {
	{
		.flags = IORESOURCE_IRQ,
		.start = SUN3_VEC_VMESCSI0,
		.end   = SUN3_VEC_VMESCSI0,
	}, {
		.flags = IORESOURCE_MEM,
		.start = 0xff200000,
		.end   = 0xff200021,
	}, {
		.flags = IORESOURCE_IRQ,
		.start = SUN3_VEC_VMESCSI1,
		.end   = SUN3_VEC_VMESCSI1,
	}, {
		.flags = IORESOURCE_MEM,
		.start = 0xff204000,
		.end   = 0xff204021,
	},
};

/*
 * Int: level 2 autovector
 * IO: type 1, base 0x00140000, 5 bits phys space: A<4..0>
 */
static const struct resource sun3_scsi_rsrc[] __initconst = {
	{
		.flags = IORESOURCE_IRQ,
		.start = 2,
		.end   = 2,
	}, {
		.flags = IORESOURCE_MEM,
		.start = 0x00140000,
		.end   = 0x0014001f,
	},
};

int __init sun3_platform_init(void)
{
	switch (idprom->id_machtype) {
	case SM_SUN3 | SM_3_160:
	case SM_SUN3 | SM_3_260:
		platform_device_register_simple("sun3_scsi_vme", -1,
			sun3_scsi_vme_rsrc, ARRAY_SIZE(sun3_scsi_vme_rsrc));
		break;
	case SM_SUN3 | SM_3_50:
	case SM_SUN3 | SM_3_60:
		platform_device_register_simple("sun3_scsi", -1,
			sun3_scsi_rsrc, ARRAY_SIZE(sun3_scsi_rsrc));
		break;
	}
	return 0;
}

arch_initcall(sun3_platform_init);

#endif