imatch';

export interface PackageJSON extends Record<string, unknown> {
  dependencies: Record<string, string>;
}

type DependenciesList = string[];

type IncludeExcludeList = (string | RegExp)[];

const isPassIncudeExclude = (value: string, include: IncludeExcludeList, exclude: IncludeExcludeList) => {
  const shouldBeExplicitlyIncluded = include.length > 0;
  let isIncluded = false;

  for (const inc of include) {
    if (typeof inc === 'string') {
      if (match(value, inc)) {
        isIncluded = true;
        break;
      }
    } else if (inc instanceof RegExp) {
      if (inc.test(value)) {
        isIncluded = true;
        break;
      }
    }
  }

  if (!isIncluded && shouldBeExplicitlyIncluded) {
    return false;
  }

  for (const ex of exclude) {
    if (typeof ex === 'string') {
      if (match(value, ex)) {
        return false;
      }
    } else if (ex instanceof RegExp) {
      if (ex.test(value)) {
        return false;
      }
    }
  }

  return true;
};

type GetEveryDependencyOptions = {
  maxDepth?: number;
  include?: IncludeExcludeList;
  exclude?: IncludeExcludeList;
  peer?: boolean;
  normal?: boolean;
  dev?: boolean;
  optional?: boolean;
};

/*
  Get every dependency and dependencies of dependencies
*/
export function getEveryDependency(
  pathToPackageJSON: string,
  {
    exclude = [],
    include = [],
    // get only direct dependencies by default
    maxDepth = 0,
    normal = true,
    dev = false,
    optional = false,
    peer = false,
  }: GetEveryDependencyOptions = {}
): DependenciesList {
  const getDeps = (pathToPackage: string, currDepth: number): DependenciesList => {
    const pkgJSON = require(pathToPackage);
    const deps = {
      ...(normal ? pkgJSON.dependencies ?? {} : {}),
      ...(dev ? pkgJSON.devDependencies ?? {} : {}),
      ...(peer ? pkgJSON.peerDependencies ?? {} : {}),
      ...(optional ? pkgJSON.optionalDependencies ?? {} : {}),
    };

    let depsList = Object.keys(deps);

    if (exclude.length || include.length) {
      depsList = depsList.filter((d) => isPassIncudeExclude(d, include, exclude));
    }

    let tail: DependenciesList[] = [];
    if (currDepth < maxDepth) {
      tail = depsList.map((d) => getDeps(d + '/package.json', currDepth + 1));
    }

    // filter out duplicates
    return Array.from(new Set([...depsList, ...tail].reduce((acc, val) => acc.concat(val as string), [])));
  };

  return getDeps(pathToPackageJSON, 0);
}

export function getScopedDependencies(
  pathToPackageJSON: string,
  scopes: string[],
  options: GetEveryDependencyOptions = {}
) {
  return getEveryDependency(pathToPackageJSON, {
    ...options,
    include: scopes.map((scope) => scope + '/**'),
  });
}
/*  Create a Ship class.
The Ship stores Pirate-s instances in a list as the crew and has one captain who is also a Pirate.
When a ship is created it doesn't have a crew or a captain.
The ship can be filled with pirates and a captain via fillShip() method.
Filling the ship with a captain and random number of pirates.
Ships should be represented in a nice way on command line including information about
captains consumed rum, state (passed out / died)
number of alive pirates in the crew


距離』,道のり / 『歩道』,散歩道,遊歩道 / (特徴をもった)湾き方,歩きぶり / (人・動物の)並み足,正常歩 / 職業,地位 / (野球で)フォアボールで一塁に出ること'],
  ['walk of life', '地位,職業　社会的階級　身分　階層'],
  ['walk-in', '人が歩いて出はいりできる大きさの / (勝利などが)容易な,楽な'],
  ['walk-on', '(せりふのない)端役,通行人役 / 端役の俳優'],
  ['walkabout', '{U}(オーストラリア原住民の)放浪 / {C}(政府首脳などが)市民の声を聞く視察'],
  ['walkaway', '楽勝,楽勝の試合'],
  ['walker', '歩く人(物) / 歩行器'],
  ['walkie-talkie, walky-talky', '携帯用無線電話機,トランシーバー'],
  ['walking', '歩くこと,歩行 / 歩き方 / 歩く,歩行する / 歩行用の'],
  ['walking papers', '解雇通知(《英》marching orders)'],
  ['walking stick', '《英》ステッキ,つえ / ナナフシ(細い枝状の胴体の昆虫)'],
  ['walkout', 'ストライキ,同盟罷業(strike)'],
  ['walkover', '楽勝'],
  ['walkup', 'エレベーターのない建物(アパート) / エレベーターのない建物の2階以上の部屋'],
  ['walkway', '(玄関から通りまで,また工場内などの)歩行者用通路'],
  ['wall', '{C}(石・れんがなどの)『壁』,へい / {U}(胃などの)内壁,内側 / {C}(…の)壁[のようなもの]《+of+名》 / …‘を\'壁(へい)で囲む / …‘を\'壁で仕切る / 〈窓・入り口など〉‘を\'壁でふさぐ《+up+名,+名+up》'],
  ['wall painting', '〈C〉(フレスコ画法の)壁面 / 〈U〉フレスコ画法'],
  ['Wall Street', 'ウォール街(New York 市にある米国金融の中心地) / 米国金融界(市場)'],
  ['wall-to-wall', '(カーペットが)総張りの / 全面的な,包括的な / 総張りにして'],
  ['wallaby', 'ワラビー(小型のカンガルー)'],
  ['wallah, walla', '…業務の人,…係'],
  ['wallboard', '壁張り用材'],
  ['wallet', '(折りたたみ式で通例皮製の)『紙入れ』,財布 / 《古》(乞食・巡礼などの)がっさい袋,ずだ�


ght: 5px; margin-left: 5px;
```

### border-color: border-top-color border-right-color border-bottom-color border-left-color

替换了CSS的 `border-color`，处理使用了 `_` 占位符的情况。

**使用方法**

```haml
.box
    border-color: _ red
    // => border-right-color: red; border-left-color: red;
```

### border-style: border-top-style border-right-style border-bottom-style border-left-style

替换了CSS的 `border-style`，处理使用了 `_` 占位符的情况。

### border-width: border-top-width border-right-width border-bottom-width border-left-width

替换了CSS的 `border-width`，处理使用了 `_` 占位符的情况。

### clockhand: values, property-prefix, property-suffix, sides

生成符合 **顺时针简写** 规则的属性，很少会直接用到。

**使用方法**

```haml
.test
    clockhand: 1 2 3 4, 'foo', 'bar', (a b c d)
    // => foo-a-bar: 1; foo-b-bar: 2; foo-c-bar: 3; foo-d-bar: 4;
```

## 缓动函数

### easing(type)

CSS默认提供的缓动函数有限，我们通过贝塞尔曲线对缓动函数进行了扩充。

各缓动函数的效果可以参考 [easings.net](http://easings.net/zh-cn)。

支持的缓动函数类型有：

    'in-sine' 'out-sine' 'in-out-sine'
    'in-quad' 'out-quad' 'in-out-quad'
    'in-cubic' 'out-cubic' 'in-out-cubic'
    'in-quart' 'out-quart' 'in-out-quart'
    'in-quint' 'out-quint' 'in-out-quint'
    'in-expo' 'out-expo' 'in-out-expo'
    'in-circ' 'out-circ' 'in-out-circ'
    'in-back' 'out-back' 'in-out-back'

**使用方法**

```haml
.box
    transition: all 1s easing('in-sine')
    // => transition: all 1s cubic-bezier(0.47, 0, 0.745, 0.715);
```

## 图片

从现在移动端的场景来看，retina 设备已经占了绝大多数，所以采用默认使用高清图片的方案。

纯移动端下将不再使用 `原图 + @2x图` 的方式对 retina 做支持。

### bg: path, width, height, dppx

设置背景图片。宽与高默认会读取本地文件自动获取，请注意 `build/webserver` 的 log，若获取失败需手动填写。

**参数说明**

+ `path` 图片路径
+ `width` `(可选)` 图片宽度，默认会尝试读取本地文件宽度，取不到设为 `auto`
+ `height` `(可选)` 图片高度，默认会尝试读取本地文件高度，取不到设为 `auto`
+ `dppx` `(可选)` 图片真实尺寸的倍数，默认值为全局配置 `$-image-dppx = 2`

注：当 `width` 为 `cover` 或 `contain` 时，


_VERSION_DERBY_10_15:
			return "10.15";
		case DataDictionary.DD_VERSION_DERBY_10_16:
			return "10.16";
		default:
			return null;
		}
	}

	////////////////////////////////////////////////////////////////////////
	//
	//	DataDictionary SPECIFIC
	//
	////////////////////////////////////////////////////////////////////////

	/**
	 * Upgrade the data dictionary catalogs to the version represented by this
	 * DD_Version.
	 *
	 * @param dictionaryVersion the version of the data dictionary tables.
	 * @exception StandardException Ooops
	 */
	void upgradeIfNeeded(DD_Version dictionaryVersion,
								TransactionController tc, Properties startParams)
		 throws StandardException
	{
		// database has been upgrade with a later engine version than this?
		if (dictionaryVersion.majorVersionNumber > majorVersionNumber) {
			throw StandardException.newException(SQLState.LANG_CANT_UPGRADE_CATALOGS,
				dictionaryVersion, this);
		}

		boolean minorOnly = false;
		boolean performMajorUpgrade = false;
		boolean softUpgradeRun = false;
		boolean isReadOnly = bootingDictionary.af.isReadOnly();

		if (dictionaryVersion.majorVersionNumber == majorVersionNumber) {

			// exact match of engine to database, do nothing.
			if (dictionaryVersion.minorVersionNumber == minorVersionNumber)
				return;

			// database and engine at same major level
			minorOnly = true;

		} else {

			if (isFullUpgrade(startParams, dictionaryVersion.toString())) {
				performMajorUpgrade = true;
			} else {
				softUpgradeRun = true;
			}
		}

		// make sure we have a clean transaction for the upgrade
		tc.commit();

		if (performMajorUpgrade) {
			// real upgrade changes. Get user name of current user.
			String userName = IdUtil.getUserNameFromURLProps(startParams);
			doFullUpgrade(tc, dictionaryVersion.majorVersionNumber,IdUtil.getUserAuthorizationId(userName));
            //DERBY-5996(Create readme files (cautioning users against
            // modifying database files) at database hard upgrade time)
            //Following will create 3 readme files.
            // one in database directory, one in "seg0" directory and one in
            // log directory. These readme files warn users against touching
            // any of files associated with derby database
			bootingDictionary.af.createReadMeFiles();
		}

		if (!minorOnly && !isReadOnly) {
			// apply changes that can be made and will continue to work
			// against previous version.

			// See if we have already applied these changes.
			DD_Version softUpgradeVersion = (DD_Version) tc.getProperty(
											DataDictionary.SOFT_DATA_DICTIONARY_VERSION);

			// need to apply them if we have never performed a soft upgrade
			// or only a soft upgrade using a previous version.
			int softUpgradeMajorVersion = 0;
			if (softUpgradeVersion != null)
				softUpgradeMajorVersion = softUpgradeVersion.majorVersionNumber;

			if (softUpgradeMajorVersion < majorVersionNumber) {
				applySafeChanges( tc, dictionaryVersion.majorVersionNumber, softUpgradeMajorVersion);
			}
		}

		// changes such as invalidating SPS so they will recompile against
		// the new internal classes.
		// this method also changes the on-disk format version on the disk and in-memory as well.
		handleMinorRevisionChange(tc, dictionaryVersion, softUpgradeRun);

		// commit any upgrade
		tc.commit();
	}

	/**
		Apply changes that can safely be made in soft upgrade.
		Any changes must not prevent the database from being re-booted
		by the a Derby engine at the older version fromMajorVersionNumber.
		<BR>
		Exam


, -- Lindsay
    [31850] = true, -- Eric Davidson
    [31851] = true, -- Bill Buckler
    [31852] = true, -- Steven Lisbane
    [31910] = true, -- David Kosse
    [31911] = true, -- Deiza Plaguehorn
    [31912] = true, -- Kortas Darkhammer
    [31913] = true, -- Everessa
    [31914] = true, -- Durin Darkhammer
}

local questsRequiringTamingOutlandAchievement = {
    [31922] = true, -- Nicki Tinytech
    [31923] = true, -- Ras'an
    [31924] = true, -- Narrok
    [31925] = true, -- Morulu The Elder
    [31926] = true, -- Grand Master Antari
}

local questsRequiringTamingNorthrendAchievement = {
    [31931] = true, -- Beegle Blastfuse
    [31932] = true, -- Nearly Headless Jacob
    [31933] = true, -- Okrut Dragonwaste
    [31934] = true, -- Gutretch
    [31935] = true, -- Grand Master Payne
}

local questsRequiringTamingCataclysmAchievement = {
    [31971] = true, -- Grand Master Obalis
    [31972] = true, -- Brok
    [31973] = true, -- Bordin Steadyfist
    [31974] = true, -- Goz Banefury
}

local questsRequiringTamingPandariaAchievement = {
    [31953] = true, -- Grand Master Hyuna
    [31954] = true, -- Grand Master Mo'ruk
    [31955] = true, -- Grand Master Nishi
    [31956] = true, -- Grand Master Yon
    [31957] = true, -- Grand Master Shu
    [31958] = true, -- Grand Master Aki
    [31991] = true, -- Grand Master Zusshi
    [33222] = true, -- Little Tommy Newcomer
}

local questsRequiringPandarenSpiritTamerAchievement = {
    [32434] = true, -- Burning Pandaren Spirit
    [32439] = true, -- Flowing Pandaren Spirit
    [32440] = true, -- Whispering Pandaren Spirit
    [32441] = true, -- Thundering Pandaren Spirit
}

local questsRequiringFabledPandarenTamerAchievement = {
    [32604] = true, -- Beasts of Fable Book I
    [32868] = true, -- Beasts of Fable Book II
    [32869] = true, -- Beasts of Fable Book III
}

local questsRequiringFriendsOnTheFarmAchievement = {
    [31312] = true, -- The Old Map
}

local questsRequiringAllGrownsUpAchievement = {
    [32863] = true, -- What We've Been Training For
}

function _QuestieDB:CheckAchievementRequirements(questId)
    -- So far the only Quests that we know of that requires an earned Achievement are the ones offered by:
    -- https://www.wowhead.com/wotlk/npc=35094/crusader-silverdawn
    -- Get Kraken (14108)
    -- The Fate Of The Fallen (14107)
    -- This NPC requires these earned Achievements baseed on a Players home faction:
    -- https://www.wowhead.com/wotlk/achievement=2817/exalted-argent-champion-of-the-alliance
    -- https://www.wowhead.com/wotlk/achievement=2816/exalted-argent-champion-of-the-horde
    if questId == 14101 or questId == 14102 or questId == 14104 or questId == 14105 or questId == 14107 or questId == 14108 then
        if select(13, GetAchievementInfo(2817)) or select(13, GetAchievementInfo(2816)) then
            return true
        end

        return false
    end

    if questsRequiringNewbieAchievement[questId] then
        return select(13, GetAchievementInfo(7433)) -- Newbie
    end

    if questsRequiringTamingKalimdorAchievement[questId] then
        return select(13, GetAchievementInfo(6602)) -- Taming Kalim


import numpy as np
from scipy.signal import butter, buttord, sosfreqz

import matplotlib.pyplot as plt

wp = [0.2, 0.5]  # 通带边界频率
ws = [0.15, 0.55]  # 阻带边界频率

# 定义在通带和阻带中允许的最大损耗（以分贝为单位）
gpass = 1  # 通带最大损耗
gstop = 30  # 阻带最大损耗
# 采样频率
fs = 25

# 计算滤波器的最小阶数和截止频率
N, Wn = buttord(wp, ws, gpass, gstop, fs=fs)
sos = butter(N, Wn, 'band', fs=fs, output='sos')

# 计算频率响应
w, h = sosfreqz(sos, fs=fs)

# 计算幅度响应（以分贝为单位）
amp = 20 * np.log10(np.abs(h))

# 绘制幅度响应曲线
plt.plot(w, amp)
plt.title('Frequency response')
plt.xlabel('Frequency [Hz]')
plt.ylabel('Amplitude [dB]')
plt.grid(True)
plt.show()

# t = np.linspace(0, 1, 500, False)  # 1 second
# sig1 = np.sin(2*np.pi*5*t)  # 5 Hz signal
# sig2 = 0.5 * np.sin(2*np.pi*10*t)  # 10 Hz signal
# sig3 = 0.3 * np.sin(2*np.pi*20*t)  # 20 Hz signal
# noise = np.random.normal(size=500)*0.2  # Random noise
# signal = sig1 + sig2 + sig3 + noise  # Complex signal
#
# 使用 SOS 滤波器对信号进行滤波
# filtered_signal = sosfiltfilt(sos, signal)
# plt.plot(signal)
# plt.plot(filtered_signal)


       std::cout << vt << " " << std::endl;
    }

    // Delete the graph (i.e., release memory)
    delete graph;

    return EXIT_SUCCESS;
}
# /* Copyright (C) 2001
#  * Housemarque Oy
#  * http://www.housemarque.com
#  *
#  * Distributed under the Boost Software License, Version 1.0. (See
#  * accompanying file LICENSE_1_0.txt or copy at
#  * http://www.boost.org/LICENSE_1_0.txt)
#  */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_COMPARISON_GREATER_EQUAL_HPP
# define BOOST_PREPROCESSOR_COMPARISON_GREATER_EQUAL_HPP
#
# include <boost/preprocessor/comparison/less_equal.hpp>
# include <boost/preprocessor/config/config.hpp>
#
# /* BOOST_PP_GREATER_EQUAL */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
#    define BOOST_PP_GREATER_EQUAL(x, y) BOOST_PP_LESS_EQUAL(y, x)
# else
#    define BOOST_PP_GREATER_EQUAL(x, y) BOOST_PP_GREATER_EQUAL_I(x, y)
#    define BOOST_PP_GREATER_EQUAL_I(x, y) BOOST_PP_LESS_EQUAL(y, x)
# endif
#
# /* BOOST_PP_GREATER_EQUAL_D */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
#    define BOOST_PP_GREATER_EQUAL_D(d, x, y) BOOST_PP_LESS_EQUAL_D(d, y, x)
# else
#    define BOOST_PP_GREATER_EQUAL_D(d, x, y) BOOST_PP_GREATER_EQUAL_D_I(d, x, y)
#    define BOOST_PP_GREATER_EQUAL_D_I(d, x, y) BOOST_PP_LESS_EQUAL_D(d, y, x)
# endif
#
# endif
# /* Copyright (C) 2001
#  * Housemarque Oy
#  * http://www.housemarque.com
#  *
#  * Distributed under the Boost Software License, Version 1.0. (See
#  * accompanying file LICENSE_1_0.txt or copy at
#  * http://www.boost.org/LICENSE_1_0.txt)
#  */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_COMPARISON_LESS_EQUAL_HPP
# define BOOST_PREPROCESSOR_COMPARISON_LESS_EQUAL_HPP
#
# include <boost/preprocessor/arithmetic/sub.hpp>
# include <boost/preprocessor/config/config.hpp>
# include <boost/preprocessor/logical/not.hpp>
#
# /* BOOST_PP_LESS_EQUAL */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
#    define BOOST_PP_LESS_EQUAL(x, y) BOOST_PP_NOT(BOOST_PP_SUB(x, y))
# else
#    define BOOST_PP_LESS_EQUAL(x, y) BOOST_PP_LESS_EQUAL_I(x, y)
#    define BOOST_PP_LESS_EQUAL_I(x, y) BOOST_PP_NOT(BOOST_PP_SUB(x, y))
# endif
#
# /* BOOST_PP_LESS_EQUAL_D */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
#    define BOOST_PP_LESS_EQUAL_D(d, x, y) BOOST_PP_NOT(BOOST_PP_SUB_D(d, x, y))
# else
#    define BOOST_PP_LESS_EQUAL_D(d, x, y) BOOST_PP_LESS_EQUAL_D_I(d, x, y)
#    define BOOST_PP_LESS_EQUAL_D_I(d, x, y) BOOST_PP_NOT(BOOST_PP_SUB_D(d, x, y))
# endif
#
# endif
/********************************************************************
 * Copyright (C) 2015 Liangliang Nan <liangliang.nan@gmail.com>
 * https://3d.bk.tudelft.nl/liangliang/
 *
 * This file is


f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
    font-family: arial;
    line-height: .3;
    cursor: pointer;
}

.CodeMirror-foldgutter {
    width: .7em;
}

.CodeMirror-foldgutter-open,
.CodeMirror-foldgutter-folded {
    cursor: pointer;
}

.CodeMirror-foldgutter-open:after {
    content: "\25BE";
}

.CodeMirror-foldgutter-folded:after {
    content: "\25B8";
}

.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div {
    position: absolute;
    background: #ccc;
    box-sizing: border-box;
    border: 1px solid #bbb;
    border-radius: 2px;
}

.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical {
    position: absolute;
    z-index: 6;
    background: #eee;
}

.CodeMirror-simplescroll-horizontal {
    bottom: 0;
    left: 0;
    height: 8px;
}

.CodeMirror-simplescroll-horizontal div {
    bottom: 0;
    height: 100%;
}

.CodeMirror-simplescroll-vertical {
    right: 0;
    top: 0;
    width: 8px;
}

.CodeMirror-simplescroll-vertical div {
    right: 0;
    width: 100%;
}

.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler {
    display: none;
}

.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div {
    position: absolute;
    background: #bcd;
    border-radius: 3px;
}

.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical {
    position: absolute;
    z-index: 6;
}

.CodeMirror-overlayscroll-horizontal {
    bottom: 0;
    left: 0;
    height: 6px;
}

.CodeMirror-overlayscroll-horizontal div {
    bottom: 0;
    height: 100%;
}

.CodeMirror-overlayscroll-vertical {
    right: 0;
    top: 0;
    width: 6px;
}

.CodeMirror-overlayscroll-vertical div {
    right: 0;
    width: 100%;
}

._3xp4c3Gvny8Oap6jE2-Q_ .CodeMirror {
    background-color: #354551;
    text-shadow: 1px 1px 1px rgba(43, 56, 66, 0.3);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 13px;
    font-family: Monaco, Menlo, "Ubuntu Mono", "Droid Sans Mono", Consolas, monospace;
    font-weight: 300
}

._3xp4c3Gvny8Oap6jE2-Q_ ::-moz-selection {
    background: rgba(45, 45, 45, 0.99)
}

._3xp4c3Gvny8Oap6jE2-Q_ ::selection {
    background: rgba(45, 45, 45, 0.99)
}

._3xp4c3Gvny8Oap6jE2-Q_ ::-moz-selection {
    background: rgba(45, 45, 45, 0.99)
}

._3xp4c3Gvny8Oap6jE2-Q_ .CodeMirror-gutters {
    background-color: #354551;
    border-right-color: transparent;
    padding-right: 8px
}

._3xp4c3Gvny8Oap6jE2-Q_ .CodeMirror-lines {
    padding: 10px 0
}

._3xp4c3Gvny8Oap6jE2-Q_ pre {
    padding: 0
}

._3xp4c3Gvny8Oap6jE2-Q


      local data = group.selectedGroupSorted[i]
      if data then
        local texturePath, textureName = data[1], data[2]
        local textureWidget = AceGUI:Create("WeakAurasTextureButton");
        tinsert(group.textureWidgets, textureWidget)
        if (group.SetTextureFunc) then
          group.SetTextureFunc(textureWidget, texturePath, textureName);
        else
          textureWidget:SetTexture(texturePath, textureName);
          local d = group.textureData;
          textureWidget:ChangeTexture(d.r, d.g, d.b, d.a, d.texRotation, d.auraRotation, d.mirror, d.blendMode)
        end
        if group.selectedTextures[texturePath] then
          textureWidget:Pick()
        end
        textureWidget:SetClick(function()
          group:Pick(texturePath);
        end);

        local index = i - 1 -- Math is easier if we start counting at 0
        local textureY = floor(index / texturesPerRow) * -128
        local textureX = (index % texturesPerRow) * 128

        textureWidget.frame:Show()
        textureWidget.frame:SetParent(scroll.content)
        textureWidget.frame:SetPoint("TOPLEFT", textureX, textureY)
      end
    end
  end

  scroll:SetCallback("ContentScrolled", function(self)
    UpdateShownWidgets()
  end)

  local function texturePickerGroupSelected(widget, event, uniquevalue, filter)
    group.selectedGroupSorted = {}
    if filter then
      filter = filter:lower()
    end
    local category = group.textures[uniquevalue]
    local cat = type(category) == "function" and category() or category
    for texturePath, textureName in pairs(cat) do
      if filter == nil or filter == "" or textureName:lower():find(filter, 1, true) then
        tinsert(group.selectedGroupSorted, {texturePath, textureName})
      end
    end

    table.sort(group.selectedGroupSorted, function(a, b)
      local aPath, bPath = a[1], b[1]
      local aNum, bNum = tonumber(aPath:match("%d+")), tonumber(bPath:match("%d+"));
      local aNonNumber, bNonNumber = aPath:match("[^%d]+"), bPath:match("[^%d]+")
      if(aNum and bNum and aNonNumber == bNonNumber) then
        return aNum < bNum;
      else
        return aPath < bPath;
        end
    end)

    local viewportWidth = scroll:GetViewportSize()
    local texturesPerRow = floor(viewportWidth / 128)
    if texturesPerRow == 0 then
      texturesPerRow = 1
    end
    local totalHeight = ceil(#group.selectedGroupSorted / texturesPerRow) * 128
    scroll:SetContentHeight(totalHeight)

    UpdateShownWidgets()
  end

  local input = CreateFrame("EditBox", nil, group.frame, "SearchBoxTemplate");
  input:SetScript("OnTextChanged", function(self, ...)
    SearchBoxTemplate_OnTextChanged(self)
    local status = dropdown.status or dropdown.localstatus
    texturePickerGroupSelected(nil, nil, status.selected, input:GetText())
  end);
  input:SetScript("OnEnterPressed", function(...)
    local status = dropdown.status or dropdown.localstatus
    texturePickerGroupSelected(nil, nil, status.selected, input:GetText())
  end);
  input:SetScript("OnEscapePressed", function(...)
    input:SetText("");
    local status = dropdown.status or dropdown.localstatus
    texturePickerGroupSelected(nil, nil, status.selected, input:GetText())
  end);
  input:SetWidth(200);
  input:SetHeight(15);
  input:SetPoint("TOPRIGHT", group.frame, "TOPRIGHT", -3, -10);

  dropdown:SetCallback("OnGroupSelected", function(widget


val lowerError = abs(target - lowerNum.toDouble() / lowerDen)
            val upperError = abs(target - upperNum.toDouble() / upperDen)
            return if (lowerError < upperError) Pair(lowerNum, lowerDen) else Pair(upperNum, upperDen)
        }

        /**
         * Design filter taps for the resampler.
         * Default: low-pass with Kaiser window (beta=7.0).
         */
        @JvmStatic
        fun designResamplerTaps(interpolation: Int, decimation: Int, fractionalBw: Float, maxTaps: Int): FloatArray {
            val beta = 7.0
            val halfband = 0.5
            val rate = interpolation.toFloat() / decimation.toFloat()
            val transWidth: Float
            val midTransitionBand: Float

            if (rate >= 1.0f) {
                transWidth = (halfband - fractionalBw).toFloat()
                midTransitionBand = (halfband - transWidth / 2.0).toFloat()
            } else {
                transWidth = (rate * (halfband - fractionalBw)).toFloat()
                midTransitionBand = (rate * halfband - transWidth / 2.0).toFloat()
            }

            return FirFilter.createLowPassTaps(
                decimation = 1,
                gain = interpolation.toFloat(),
                sampleRate = interpolation.toFloat(),
                cutoffFrequency = midTransitionBand,
                transitionWidth = transWidth,
                attenuationInDecibels = 72.22087f,  // hardcoded, max. attenuation for Kaiser @ beta=7.0
                windowFunction = KaiserWindow(beta),
                maxTaps = maxTaps * interpolation   // we will have <interpolation> number of FirFilters, so specify the total amount of taps
            ) ?: FloatArray(0)
        }
    }
}
package com.mantz_it.rfanalyzer.analyzer

import android.app.Notification
import android.app.PendingIntent
import android.app.Service
import android.content.Intent
import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK
import android.os.Binder
import android.os.IBinder
import android.util.Log
import android.widget.Toast
import androidx.core.app.NotificationCompat
import androidx.core.app.ServiceCompat
import com.mantz_it.rfanalyzer.source.FileIQSource
import com.mantz_it.rfanalyzer.source.HackrfSource
import com.mantz_it.rfanalyzer.source.IQSourceInterface
import com.mantz_it.rfanalyzer.LogcatLogger
import com.mantz_it.rfanalyzer.R
import com.mantz_it.rfanalyzer.source.RtlsdrSource
import com.mantz_it.rfanalyzer.ui.RECORDINGS_DIRECTORY
import com.mantz_it.rfanalyzer.ui.composable.DemodulationMode
import com.mantz_it.rfanalyzer.ui.composable.SourceType
import com.mantz_it.rfanalyzer.ui.composable.StopAfterUnit
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import kotlinx.coroutines.delay
import java.io.BufferedOutputStream
import java.io.File
import java.io.FileOutputStream
import androidx.core.net.toUri
import com.mantz_it.rfanalyzer.database.AppStateRepository
import com.mantz_it.rfanalyzer.database.GlobalPerformanceData
import com.mantz_it.rfanalyzer.database.collectAppState
import com.mantz_it.rfanalyzer.source.AirspySource
import com.mantz_it.rfanalyzer.source.HydraSdrSource
import com.mantz_it.rfanalyzer.ui.MainActivity
import com.mantz_it.rfanalyzer.ui.composable.FilesourceFileFormat
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
import kotlin.math.abs

/**
 *
RF Analyzer - Analyzer Service

 *
 * Module:      AnalyzerService.kt
 * Description: Foreground Service which orchestr


int64"),
			func(c *Call) {
				c.DoAddInt64(0, "key", 1)
			},
			false,
		},
		{
			"add_int64 wrong policy, type",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_MAX, "bigint"),
			func(c *Call) {
				c.DoAddInt64(0, "key", 1)
			},
			false,
		},
		{
			"add_float64 golden path",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_ADD, "float64"),
			func(c *Call) {
				c.DoAddFloat64(0, "key", 1.0)
			},
			true,
		},
		{
			"add_float64 wrong type",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_ADD, "int64"),
			func(c *Call) {
				c.DoAddFloat64(0, "key", 1.0)
			},
			false,
		},
		{
			"add_float64 wrong policy",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_MAX, "float64"),
			func(c *Call) {
				c.DoAddFloat64(0, "key", 1.0)
			},
			false,
		},
		{
			"add_float64 wrong policy, type",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_MAX, "bigint"),
			func(c *Call) {
				c.DoAddFloat64(0, "key", 1.0)
			},
			false,
		},
		{
			"set_min_int64 golden path",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_MIN, "int64"),
			func(c *Call) {
				c.DoSetMinInt64(0, "key", 1)
			},
			true,
		},
		{
			"set_min_int64 wrong type",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_MIN, "float64"),
			func(c *Call) {
				c.DoSetMinInt64(0, "key", 1)
			},
			false,
		},
		{
			"set_min_int64 wrong policy",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_MAX, "int64"),
			func(c *Call) {
				c.DoSetMinInt64(0, "key", 1)
			},
			false,
		},
		{
			"set_min_int64 wrong policy, type",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_MAX, "float64"),
			func(c *Call) {
				c.DoSetMinInt64(0, "key", 1)
			},
			false,
		},
		{
			"set_min_bigint golden path",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_MIN, "bigint"),
			func(c *Call) {
				c.DoSetMinBigInt(0, "key", "1")
			},
			true,
		},
		{
			"set_min_bigint wrong type",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_MIN, "int64"),
			func(c *Call) {
				c.DoSetMinBigInt(0, "key", "1")
			},
			false,
		},
		{
			"set_min_bigint wrong policy",
			newTestCall(pbsubstreams.Module_KindStore_UPDATE_POLICY_MAX, "bigint"),
			func(c *Call) {
				c.DoSetMinBigInt(0, "key", "1")
			},
			false,
		},
		{
			"set_mi


}
import 'package:thingsboard_app/core/entity/entities_base.dart';
import 'package:thingsboard_app/modules/alarm/domain/entities/alarm_filters_entity.dart';
import 'package:thingsboard_app/thingsboard_client.dart';

class AlarmQueryController extends PageKeyController<AlarmQueryV2> {
  AlarmQueryController({int pageSize = 20, String? searchText})
      : super(
          AlarmQueryV2(
            TimePageLink(
              pageSize,
              0,
              searchText,
              SortOrder('createdTime', Direction.DESC),
            ),
            statusList: [AlarmSearchStatus.ACTIVE],
          ),
        );

  @override
  AlarmQueryV2 nextPageKey(AlarmQueryV2 pageKey) {
    return AlarmQueryV2(
      pageKey.pageLink.nextPageLink(),
      typeList: pageKey.typeList,
      statusList: pageKey.statusList,
      severityList: pageKey.severityList,
      assigneeId: pageKey.assigneeId,
    );
  }

  void onSearchText(String? searchText) {
    final query = value.pageKey;
    query.pageLink.page = 0;
    query.pageLink.textSearch = searchText;

    notifyListeners();
  }

  void onFiltersUpdated(AlarmFiltersEntity filters) {
    final query = value.pageKey;
    query.pageLink.page = 0;
    query.assigneeId = filters.assigneeId;
    query.severityList = filters.severityList;
    query.statusList = filters.statusList;
    query.typeList = filters.typeList;

    notifyListeners();
  }
}
import 'package:thingsboard_app/modules/alarm/domain/repository/details/i_alarm_details_repository.dart';
import 'package:thingsboard_app/thingsboard_client.dart';
import 'package:thingsboard_app/utils/usecase.dart';

final class PostAlarmCommentsUseCase
    extends UseCase<Future<AlarmCommentInfo>, PostAlarmCommentParams> {
  const PostAlarmCommentsUseCase(this.repository);

  final IAlarmDetailsRepository repository;

  @override
  Future<AlarmCommentInfo> call(PostAlarmCommentParams params) {
    final comment = params.comment.trimLeft().trimRight();
    if (comment.isEmpty) {
      throw Exception('An empty comment was rejected to be posted.');
    }

    if (params.id != null) {
      return repository.updateComment(
        params.alarmId,
        id: params.id!,
        comment: comment,
      );
    }

    return repository.postComment(params.alarmId, comment: comment);
  }
}

final class PostAlarmCommentParams {
  const PostAlarmCommentParams({
    required this.alarmId,
    required this.comment,
    this.id,
  });

  final AlarmId alarmId;
  final String? id;
  final String comment;
}
import 'package:flutter/material.dart';
import 'package:thingsboard_app/utils/ui/tb_text_styles.dart';

extension BoldSubString on Text {
  Text boldSubString(
    String target, {
    Color? highlightedColor,
    Color? regularColor,
    TextStyle? highlightedTextStyle,
    TextStyle? regularTextStyle,
  }) {
    final textSpans = <TextSpan>[];
    final escapedTarget = RegExp.escape(target);
    final pattern = RegExp(escapedTarget, caseSensitive: false);
    final matches = pattern.allMatches(data!);

    int currentIndex = 0;
    for (final match in matches) {
      final beforeMatch = data!.substring(currentIndex, match.start);
      if (beforeMatch.isNotEmpty) {
        textSpans.add(
          TextSpan(
            text: beforeMatch,
            style: regularTextStyle ??
                TbTextStyles.bodyLarge.copyWith(color: regularColor),
          ),
        );


 direction opposite to |\Mvar|
and starting in |source|.}*/
{ return Ray_d<R>(source(),-direction()); }

Ray_d<R> transform(const Aff_transformation_d<R>& t) const
/*{\Mop returns $t(l)$. }*/
{ return Ray_d<R>(point(0).transform(t),point(1).transform(t)); }

Ray_d<R> operator+(const Vector_d<R>& v) const
/*{\Mbinop returns |\Mvar+v|, i.e., |\Mvar| translated by vector $v$.}*/
{ return Ray_d<R>(point(0)+v, point(1)+v); }

bool has_on(const Point_d<R>& p) const
/*{\Mop A point is on |r|, iff it is equal to the source of |r|, or if it is
in the interior of |r|.}*/
{ typename R::Position_on_line_d pos; FT l;
  if (pos(p,point(0),point(1),l)) return (FT(0)<=l);
  return false;
}

/*{\Mtext \headerline{Non-Member Functions}}*/

bool operator==(const Ray_d<R>& r1) const
{ if ( this->identical(r1) ) return true;
  if ( dimension() != r1.dimension() ) return false;
  return source() == r1.source() &&
         direction() == r1.direction();
}

bool operator!=(const Ray_d<R>& r1)
{ return !operator==(r1); }

friend std::istream& operator>> <>
(std::istream&, Ray_d<R>&);
friend std::ostream& operator<< <>
(std::ostream&, const Ray_d<R>&);

}; // end of class

template <class R>
bool parallel(const Ray_d<R>& r1, const Ray_d<R>& r2)
/*{\Mfunc returns true if the unoriented supporting lines of |r1| and |r2|
are parallel and false otherwise. }*/
{ return (r1.direction() == r2.direction()) ||
         (r1.direction() == -(r2.direction()));
}

template <class R>
std::istream& operator>>(std::istream& I, Ray_d<R>& r)
{ r.copy_on_write(); r.ptr()->read(I);
  CGAL_assertion_msg(r.point(0)!=r.point(1),
    "Line_d::operator>>: trivial ray.");
  CGAL_assertion_msg(r.point(0).dimension()==r.point(1).dimension(),
  "Ray_d::operator>>: dimensions disagree.");
  return I;
}

template <class R>
std::ostream& operator<<(std::ostream& O, const Ray_d<R>& r)
{ r.ptr()->print(O,"Ray_d"); return O; }

/*{\Mimplementation
Rays are implemented by a pair of points as an item type.  All
operations like creation, initialization, tests, direction
calculation, input and output on a ray $r$ take time
$O(|r.dimension()|)$. |dimension()|, coordinate and point access, and
identity test take constant time. The space requirement is
$O(|r.dimension()|)$.}*/

} //namespace CGAL
#endif // CGAL_RAYHD_H
//----------------------- end of file ----------------------------------


(device1.Short())

	dbUpdateChan := make(chan dbUpdateJob, 2)
	scanChan := make(chan string, 2)
	if err := f.renameFile(cur, deleted, confl, dbUpdateChan, scanChan); err != nil {
		t.Error(err)
	}
}

func TestPullSymlinkOverExistingWindows(t *testing.T) {
	if !build.IsWindows {
		t.Skip()
	}

	m, f, wcfgCancel := setupSendReceiveFolder(t)
	defer wcfgCancel()
	conn := addFakeConn(m, device1, f.ID)

	name := "foo"
	if fd, err := f.mtimefs.Create(name); err != nil {
		t.Fatal(err)
	} else {
		if _, err := fd.Write([]byte("data")); err != nil {
			t.Fatal(err)
		}
		fd.Close()
	}

	must(t, f.scanSubdirs(nil))

	file, ok := m.testCurrentFolderFile(f.ID, name)
	if !ok {
		t.Fatal("file missing")
	}
	must(t, m.Index(conn, &protocol.Index{Folder: f.ID, Files: []protocol.FileInfo{{Name: name, Type: protocol.FileInfoTypeSymlink, Version: file.Version.Update(device1.Short())}}}))

	scanChan := make(chan string)

	changed, err := f.pullerIteration(scanChan)
	must(t, err)
	if changed != 1 {
		t.Error("Expected one change in pull, got", changed)
	}
	if file, ok := m.testCurrentFolderFile(f.ID, name); !ok {
		t.Error("symlink entry missing")
	} else if !file.IsUnsupported() {
		t.Error("symlink entry isn't marked as unsupported")
	}
	if _, err := f.mtimefs.Lstat(name); err == nil {
		t.Error("old file still exists on disk")
	} else if !fs.IsNotExist(err) {
		t.Error(err)
	}
}

func TestPullDeleteCaseConflict(t *testing.T) {
	_, f, wcfgCancel := setupSendReceiveFolder(t)
	defer wcfgCancel()

	name := "foo"
	fi := protocol.FileInfo{Name: "Foo"}
	dbUpdateChan := make(chan dbUpdateJob, 1)
	scanChan := make(chan string)

	if fd, err := f.mtimefs.Create(name); err != nil {
		t.Fatal(err)
	} else {
		if _, err := fd.Write([]byte("data")); err != nil {
			t.Fatal(err)
		}
		fd.Close()
	}
	f.deleteFileWithCurrent(fi, protocol.FileInfo{}, false, dbUpdateChan, scanChan)
	select {
	case <-dbUpdateChan:
	default:
		t.Error("Missing db update for file")
	}

	f.deleteDir(fi, dbUpdateChan, scanChan)
	select {
	case <-dbUpdateChan:
	default:
		t.Error("Missing db update for dir")
	}
}

func TestPullDeleteIgnoreChildDir(t *testing.T) {
	_, f, wcfgCancel := setupSendReceiveFolder(t)
	defer wcfgCancel()

	parent := "parent"
	del := "ignored"
	child := "keep"
	matcher := ignore.New(f.mtimefs)
	must(t, matcher.Parse(bytes.NewBufferString(fmt.Sprintf(`
!%v
(?d)%v
`, child, del)), ""))
	f.ignores = matcher

	must(t, f.mtimefs.Mkdir(parent, 0o777))
	must(t, f.mtimefs.Mkdir(filepath.Join(parent, del), 0o777))
	must(t, f.mtimefs.Mkdir(filepath.Join(parent, del, child), 0o777))


 tomata i wasabi",
                    "https://media.istockphoto.com/id/614313140/es/foto/tacos-de-ternera-suave-con-papas-fritas.jpg?s=612x612&w=0&k=20&c=QHiqUDuVqyDokMkE4htKJVRQES_UPq_NGMVP9361TnU="),
                Meal(
                    "Cuscus",
                    12.09,
                    "",
                    "https://media.istockphoto.com/id/1219875134/es/foto/tagine-cuscus-con-calamares-y-verduras.jpg?s=612x612&w=0&k=20&c=int0osKW0wr6yHa6zI713ISoPRvI8OBGnbxFQf9X3-c="),
                Meal(
                    "Arrós",
                    8.09,
                    "Arrós amb verdures",
                    "https://media.istockphoto.com/id/476541008/es/foto/arroz-con-azafr%C3%A1n-con-verduras-y-cilantro.jpg?s=612x612&w=0&k=20&c=BEt70Kspf6AUOuSzC1qGXDfZEjPjsRmrEPevtMirS-4="),
                Meal(
                    "Paella",
                    20.99,
                    "",
                    "https://media.istockphoto.com/id/1329666820/es/foto/paella-tradicional-de-mariscos-espa%C3%B1oles-en-la-sart%C3%A9n-sobre-un-fondo-blanco.jpg?s=612x612&w=0&k=20&c=ihLLtcC2Nm6-9QUiZlPqszIjn3kMu7DbNEVuzKbsB20="),
                Meal(
                    "Fish & Chips",
                    10.09,
                    "Peix i patates fregides",
                    "https://media.istockphoto.com/id/459488805/es/foto/pescado-con-papas-fritas-en-bandeja.jpg?s=612x612&w=0&k=20&c=-ioGpz1b6eq6uk7ZZrKTrCs9NQtv1Iz8415qVF1K08Y="),
                Meal(
                    "Spaghetti amb tomàquet i formatge",
                    15.09,
                    "",
                    "https://media.istockphoto.com/id/1144823591/es/foto/espaguetis-en-un-plato-sobre-un-fondo-blanco.jpg?s=612x612&w=0&k=20&c=85t2f7LimkaEgTQd8P0P1PoINvA0epT8J1es6tf9OIU="),
                Meal(
                    "Mac & Cheese",
                    17.09,
                    "Macarrons i formatge",
                    "https://media.istockphoto.com/id/667520856/es/foto/macarrones-con-queso-macarrones-y-queso-con-salsa-de-tomate-de-carne-delicioso-almuerzo.jpg?s=612x612&w=0&k=20&c=VfUnfmqOm3schMFUQkAcPvIjWiFbobVpFGCM31LxrIc=")
            )
        }
    }
}package com.example.fooddeliveryapp.data.repository

import com.example.fooddeliveryapp.data.datasource.RoomDataSource

class RoomRepository(var rds:RoomDataSource) {
    suspend fun favYukle() = rds.favYukle()
    suspend fun favEkle(yemek_adi:String,yemek_fiyat:String,yemek_id:Int,yemek_resim_ad:String) =
        rds.favEkle(yemek_adi,yemek_fiyat,yemek_id,yemek_resim_ad)

    suspend fun favSil(yemek_id: Int) = rds.favSil(yemek_id)
}package com.example.fooddeliveryapp

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/*


 a result this will apply a torque and force on the object.
   * @param force Force vector in world coordinates.
   * @param pos Position in world coordinates.
   */
  addForceAtPosition(force: Vector3, pos: Vector3) {
    this._pxActor.addForceAtPos({ x: force.x, y: force.y, z: force.z }, { x: pos.x, y: pos.y, z: pos.z });
  }

  /**
   * The velocity of the collider at the point worldPoint in global space.
   * @param pos The point in global space.
   */
  getPointVelocity(pos: Vector3): Vector3 {
    const vel = this._pxActor.getVelocityAtPos({ x: pos.x, y: pos.y, z: pos.z });
    return new Vector3(vel.x, vel.y, vel.z);
  }

  /**
   * The velocity relative to the collider at the point relativePoint.
   * @param pos The relative point
   */
  getRelativePointVelocity(pos: Vector3): Vector3 {
    const vel = this._pxActor.getLocalVelocityAtLocalPos({ x: pos.x, y: pos.y, z: pos.z });
    return new Vector3(vel.x, vel.y, vel.z);
  }

  /**
   * Moves the kinematic collider towards position.
   * @param value Provides the new position for the collider object.
   */
  MovePosition(value: Vector3) {
    const transform = {
      translation: {
        x: value.x,
        y: value.y,
        z: value.z
      },
      rotation: {
        w: 1,
        x: 0,
        y: 0,
        z: 0
      }
    };
    this._pxActor.setKinematicTarget(transform);
  }

  /**
   * Rotates the collider to rotation.
   * @param value The new rotation for the collider.
   */
  MoveRotation(value: Quaternion) {
    const transform = {
      translation: {
        x: 0,
        y: 0,
        z: 0
      },
      rotation: {
        w: value.w,
        x: value.x,
        y: value.y,
        z: value.z
      }
    };
    this._pxActor.setKinematicTarget(transform);
  }

  /**
   * Is the collider sleeping?
   */
  isSleeping(): boolean {
    return this._pxActor.isSleeping();
  }

  /**
   * Forces a collider to sleep at least one frame.
   */
  sleep() {
    return this._pxActor.putToSleep();
  }

  /**
   * Forces a collider to wake up.
   */
  wakeUp() {
    return this._pxActor.wakeUp();
  }
}
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {Day} from './day'
import {Chore} from '../chores/chore';
import {Week} from './week'

/**
 * Generated class for the SchedulePage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-schedule',
  templateUrl: 'schedule.html',
})
export class SchedulePage {

  chores: Array<Chore> = [];
  schedule: Array<Day> =[];

  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.chores = navParams.data.chores;
    console.log(this.chores);
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad SchedulePage');
  }

  ionViewWillEnter(){
    this.loadWeek();
    this.createSchedule();
    console.log(this.schedule);
  }

  loadWeek(){
    this.schedule.push({name:"monday", chores:[], energyLevel : 0});
    this.schedule.push({name:"tuesday", chores:


3d_bf2ceb02}
```

There's the flag!
# Tab, Tab, Attack
This was a challenge for PicoCTF 2021.  It's listed as Easy and categorized as a General Skills challenge.
Direct Link: https://play.picoctf.org/practice/challenge/176

## Description
The Description reads:
> Using tabcomplete in the Terminal will add years to your life, esp. when dealing with long rambling directory structures and filenames: Addadshashanammu.zip

## Hints
There is one hint:
> After `unzip`ing, this problem can be solved with 11 button-presses...(mostly Tab)...

# Solving
## My Thoughts
This was a nice simple challenge that introduces tab completion to new Linux users.

## Tab Completion
Now we could do this the way it suggests, but I prefer my method.  After unzipping, let's run an 'find -type f', which will find all files within the current directory:

``` bash
┌──(kali㉿kali)-[~/tab_tab_attack]
└─$ find -type f
./Addadshashanammu/Almurbalarammi/Ashalmimilkala/Assurnabitashpi/Maelkashishi/Onnissiralis/Ularradallaku/fang-of-haynekhtnamet
```

So we have a file located at the above spot, let's navigate to that folder and run file to see what the file is:

``` bash
┌──(kali㉿kali)-[~/tab_tab_attack]
└─$ cd Addadshashanammu/Almurbalarammi/Ashalmimilkala/Assurnabitashpi/Maelkashishi/Onnissiralis/Ularradallaku/; file *
fang-of-haynekhtnamet: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=47e898db922f38cb54ab4a08fb4e3def5a1cb6a1, not stripped
```

So, this is an executable file, let's run it:

``` bash
┌──(kali㉿kali)-[~/…/Assurnabitashpi/Maelkashishi/Onnissiralis/Ularradallaku]
└─$ ./fang-of-haynekhtnamet
*ZAP!* picoCTF{l3v3l_up!_t4k3_4_r35t!_a00cae70}
```

And there's our flag!
# Scavenger Hunt
This was a challenge for PicoCTF 2021.  It's listed as Easy and categorized as a Web Exploitation challenge.
Direct Link: https://play.picoctf.org/practice/challenge/161

## Description
The Description reads:
> There is some interesting information hidden around this site http://mercury.picoctf.net:39698/. Can you find it?

## Hints
There is one hint:
> You should have enough hints to find the files, don't run a brute forcer.

# Solving
## My Thoughts
This is actually probably a very helpful challenge even for veterans, there were a few things I wasn't aware of!

## Webpage
Let's first take a look at the web page and the source code:

![Page](https://github.com/user-attachments/assets/0b32a26f-9f5b-45df-bc3e-0bc4c640d062)

We can see that the web page uses HTML, CSS, and Javascript, now for the source:

``` html
<!doctype html>

    <title>Scavenger Hunt</title>
    <link href="https://fonts.googleapis.com/css?family=Open+Sans|Roboto" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="mycss.css">

Just some boring HTML

      </header


-----------------------------------
-- Area: Bibiki Bay
--  NPC: Warmachine
-- !pos -345.236 -3.188 -976.563 4
-----------------------------------
require("scripts/globals/keyitems")
local ID = require("scripts/zones/Bibiki_Bay/IDs")
require("scripts/globals/missions")
-----------------------------------

function onTrade(player, npc, trade)
end

function onTrigger(player, npc)

local ColoredDrop = 4258+math.random(0, 7)

    -- COP mission
    if (player:getCurrentMission(COP) == tpz.mission.id.cop.THREE_PATHS and player:getCharVar("COP_Louverance_s_Path") == 2) then
        player:startEvent(33)
    elseif (player:getCurrentMission(COP) == tpz.mission.id.cop.DAWN and player:getCharVar("COP_3-taru_story")== 1) then
        if (player:getFreeSlotsCount() == 0) then
            player:messageSpecial(ID.text.ITEM_CANNOT_BE_O


210ECF2957F35
    L5_2 = L5_2(L6_2)
    if L5_2 then
      break
    end
    L5_2 = C1DB14DCC9D7634FA
    L5_2 = L5_2.S760DAE4C5371A78E
    L6_2 = nil
    L5_2(L6_2)
  end
  L5_2 = A0_2[8]
  L6_2 = L5_2
  L5_2 = L5_2.FD014229B3B926D03
  L5_2(L6_2)
  while true do
    L5_2 = A0_2[8]
    L6_2 = L5_2
    L5_2 = L5_2.F9D7588710454A953
    L5_2 = L5_2(L6_2)
    if L5_2 then
      break
    end
    L5_2 = C1DB14DCC9D7634FA
    L5_2 = L5_2.S760DAE4C5371A78E
    L6_2 = nil
    L5_2(L6_2)
  end
end

_ENV["C11DD84659E21A495"]["prototype"]["FEB16F27ECF5C4C90"] = function(A0_2)

  local L1_2, L2_2
  L1_2 = A0_2[8]
  L2_2 = L1_2
  L1_2 = L1_2.FD014229B3B926D03
  L1_2(L2_2)
  L1_2 = A0_2[8]
  L2_2 = L1_2
  L1_2 = L1_2.F9D7588710454A953
  L1_2 = L1_2(L2_2)
  if not L1_2 then
    L1_2 = false
    return L1_2
  end
  L1_2 = true
  return L1_2
end

L68_1 = _ENV["C11DD84659E21A495"]["prototype"]
L69_1 = _ENV["C11DD84659E21A495"]
L68_1.__class__ = L69_1
L68_1 = _ENV["C11DD84659E21A495"]
L69_1 = "__super__"
L69_1 = _ENV["C11DD84659E21A495"]["prototype"]
L70_1 = {}
L71_1 = "__index"


else:
            if SHOT == 'zero-shot':
                if FILE_NAME == 'new_English_Spam_and_Nonspam.csv':
                    input_text = ENG_PROMPT_3 + input_list[i]
                else:
                    input_text = KOR_PROMPT_3 + input_list[i]
            elif SHOT == 'one-shot':
                if FILE_NAME == 'new_English_Spam_and_Nonspam.csv':
                    input_text = ONE_SHOT_ENG_PROMPT_3 + "2. " + input_list[i] + " ⇒ "
                else:
                    input_text = ONE_SHOT_KOR_PROMPT_3 + "2. " + input_list[i] + " ⇒ "
            elif SHOT == 'three-shot':
                if FILE_NAME == 'new_English_Spam_and_Nonspam.csv':
                    input_text = THREE_SHOT_ENG_PROMPT_3 + "4. " + input_list[i] + " ⇒ "
                else:
                    input_text = THREE_SHOT_KOR_PROMPT_3 + "4. " + input_list[i] + " ⇒ "
            elif SHOT == 'five-shot':
                if FILE_NAME == 'new_English_Spam_and_Nonspam.csv':
                    input_text = FIVE_SHOT_ENG_PROMPT_3 + "6. " + input_list[i] + " ⇒ "
                else:
                    input_text = FIVE_SHOT_KOR_PROMPT_3 + "6. " + input_list[i] + " ⇒ "
        # Prompt request
        preset_text = [{"role":"system","content":""},{"role":"user","content":input_text}]
        # Request Header Information
        request_data = {
            'messages': preset_text,
            'topP': 0.8,
            'topK': 0,
            'temperature': 0.5,
            'repeatPenalty': 5.0,
            'stopBefore': [],
            'includeAiFilters': False,
            'seed': 0
        }

        # Execute Prompt and Retrieve the Generated Response
        response = completion_executor.execute(request_data)
        # Read the final response
        for j in range(len(response)):
            if response[j] == "event:result":
                result = response[j+1][5:]
                json_data = json.loads(result)
        # Can print our response in JSON format using: Pretty-print (optional) -> print(json.dumps(json_data, indent=4))
        response_text = json_data["message"]["content"]

        response_list.append([i, label_list[i], input_text, response_text])
        # Append Response in CSV file
        make_csv(SAVE_PATH, i, [i, label_list[i], input_text, response_text])

        # Print out verbose
        dt_string = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
        print(f'==== {i}/{len(input_list)}   {round(i/int(len(input_list)),4)*100}% -- {dt_string} ====')

        # Timeout
        if i%1 == 0:
            timeout = get_timeout(TIMEOUT_MIN, TIMEOUT_MAX)
            print(f'{i}/{END_INDEX} cool down. Timeout for {timeout} seconds.')
            time.sleep(timeout)
    end = time.time()
    dt_string = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
    print(f'took {end - start:.5f} secs for {END_INDEX-START_INDEX}queries -- {dt_string}')

    # Save CSV file in excel format (optional)
    # make_excel(SAVE_PATH, FILE_NAME)

    # Finished
    print("=== CLOVA FINISHED ===")
    print(f"Method: {METHOD}")
    print(f"Shot: {SHOT}")
    print(f"File name: {FILE_NAME}")
    print(f"Save path: {SAVE_PATH}")


/**
     * int32 msgType = 4;
     * @return This builder for chaining.
     */
    public Builder clearMsgType() {
      bitField0_ = (bitField0_ & ~0x00000008);
      msgType_ = 0;
      onChanged();
      return this;
    }

    private long offset_ ;
    /**
     * int64 offset = 5;
     * @return The offset.
     */
    @java.lang.Override
    public long getOffset() {
      return offset_;
    }
    /**
     * int64 offset = 5;
     * @param value The offset to set.
     * @return This builder for chaining.
     */
    public Builder setOffset(long value) {

      offset_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     * int64 offset = 5;
     * @return This builder for chaining.
     */
    public Builder clearOffset() {
      bitField0_ = (bitField0_ & ~0x00000010);
      offset_ = 0L;
      onChanged();
      return this;
    }

    private boolean isHistory_ ;
    /**
     * bool isHistory = 6;
     * @return The isHistory.
     */
    @java.lang.Override
    public boolean getIsHistory() {
      return isHistory_;
    }
    /**
     * bool isHistory = 6;
     * @param value The isHistory to set.
     * @return This builder for chaining.
     */
    public Builder setIsHistory(boolean value) {

      isHistory_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     * bool isHistory = 6;
     * @return This builder for chaining.
     */
    public Builder clearIsHistory() {
      bitField0_ = (bitField0_ & ~0x00000020);
      isHistory_ = false;
      onChanged();
      return this;
    }

    // @@protoc_insertion_point(builder_scope:tiktok_hack.Message)
  }

  // @@protoc_insertion_point(class_scope:tiktok_hack.Message)
  private static final cool.scx.live_room_watcher.impl.tiktok_hack.proto_entity.webcast.im.Message DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new cool.scx.live_room_watcher.impl.tiktok_hack.proto_entity.webcast.im.Message();
  }

  public static cool.scx.live_room_watcher.impl.tiktok_hack.proto_entity.webcast.im.Message getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<Message>
      PARSER = new com.google.protobuf.AbstractParser<Message>() {
    @java.lang.Override
    public Message parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      Builder builder = newBuilder();
      try {
        builder.mergeFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(builder.buildPartial());
      } catch (com.google.protobuf.UninitializedMessageException e) {
        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(e)
            .setUnfinishedMessage(builder.buildPartial());


ild-last path) {
  display: block;
}

/* Last LTR tree child. */

:is(.tree-child-last path):not(.tree__item-child-last-ltr) {
  display: none;
}

.tree__item-child-last-ltr:is(.tree-child-last path) {
  display: block;
}

/* Horizontal line. */

:is(.tree-child-horizontal path):not(.tree__item-horizontal) {
  display: none;
}

.tree__item-horizontal:is(.tree-child-horizontal path) {
  display: block;
}
/**
 * @file
 * The .admin.css file is intended to only contain positioning and size
 * declarations. For example: display, position, float, clear, and overflow.
 */

.views-admin pre {
  margin-block: 0;
  white-space: pre-wrap;
}

.views-display-deleted {
  & > details > summary,
  & .details-wrapper > .views-ui-display-tab-bucket > *,
  & .views-display-columns {
    opacity: 0.25;
  }
}
.views-display-disabled {
  & > details > summary,
  & .details-wrapper > .views-ui-display-tab-bucket > *,
  & .views-display-columns {
    opacity: 0.5;
  }
}
.views-display-tab .details-wrapper > .views-ui-display-tab-bucket .actions {
  opacity: 1;
}

.views-display-column {
  box-sizing: border-box;
}
.views-display-columns > * {
  float: none;
  width: auto;
  margin-block: 0 var(--space-l);
  margin-inline: 0;
}

@media screen and (min-width: 60rem) {
  /* 960px */
  .views-display-columns {
    & > * {
      float: left; /* LTR */
      width: 32%;
      margin-block-end: 0;
      margin-inline-start: 2%;
    }
    & > *:first-child {
      margin-inline-start: 0;
    }

    [dir="rtl"] & {
      & > * {
        float: right;
      }
    }
  }
}

.views-ui-dialog {
  & .scroll {
    overflow: auto;
    padding: 1em;
  }

  /* Don't let the messages overwhelm the modal */
  & .views-messages {
    overflow: auto;
    max-height: 200px;
  }
}

.form-item--options-value-all {
  display: none;
}

.js-only {
  display: none;
}

html.js {
  & .js-only {
    display: inherit;
  }

  & span {
    &.js-only {
      display: inline;
    }
  }
}
/*
 * DO NOT EDIT THIS FILE.
 * See the following change record for more information,
 * https://www.drupal.org/node/3084859
 * @preserve
 */

/**
 * @file
 * Visual styles for the Password widgets.
 */

/**
 * Password confirm widget styles.
 */

.password-confirm {
  max-inline-size: 25rem;
}

.password-confirm input {
  width: 100%;
}

.password-confirm__password {
  margin-block-end: 0;
}

.password-confirm__confirm {
  margin-block-end: 0;
}

.js .password-confirm__confirm {
  max-height: 10rem;
  transition:
    max-height var(--speed-transition) ease-in-out,
    margin var(--speed-transition) ease-in-out;
}

@media screen and (prefers-reduced-motion: reduce) {
  .js .password-confirm__confirm {
    transition: none;
  }
}

/* Password confirm widget states. */

.js .is-initial:not(.


text, rs.allpts, lineStyle);
      context.lineCap = 'butt'; // reset for other drawing functions
    }
  };
  var drawLineOutline = function drawLineOutline() {
    var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : effectiveLineOpacity;
    context.lineWidth = edgeWidth + lineOutlineWidth;
    context.lineCap = lineCap;
    if (lineOutlineWidth > 0) {
      r.colorStrokeStyle(context, lineOutlineColor[0], lineOutlineColor[1], lineOutlineColor[2], strokeOpacity);
    } else {
      // do not draw any lineOutline
      context.lineCap = 'butt'; // reset for other drawing functions
      return;
    }
    if (curveStyle === 'straight-triangle') {
      r.drawEdgeTrianglePath(edge, context, rs.allpts);
    } else {
      r.drawEdgePath(edge, context, rs.allpts, lineStyle);
      context.lineCap = 'butt'; // reset for other drawing functions
    }
  };
  var drawOverlay = function drawOverlay() {
    if (!shouldDrawOverlay) {
      return;
    }
    r.drawEdgeOverlay(context, edge);
  };
  var drawUnderlay = function drawUnderlay() {
    if (!shouldDrawOverlay) {
      return;
    }
    r.drawEdgeUnderlay(context, edge);
  };
  var drawArrows = function drawArrows() {
    var arrowOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : effectiveArrowOpacity;
    r.drawArrowheads(context, edge, arrowOpacity);
  };
  var drawText = function drawText() {
    r.drawElementText(context, edge, null, drawLabel);
  };
  context.lineJoin = 'round';
  var ghost = edge.pstyle('ghost').value === 'yes';
  if (ghost) {
    var gx = edge.pstyle('ghost-offset-x').pfValue;
    var gy = edge.pstyle('ghost-offset-y').pfValue;
    var ghostOpacity = edge.pstyle('ghost-opacity').value;
    var effectiveGhostOpacity = effectiveLineOpacity * ghostOpacity;
    context.translate(gx, gy);
    drawLine(effectiveGhostOpacity);
    drawArrows(effectiveGhostOpacity);
    context.translate(-gx, -gy);
  } else {
    drawLineOutline();
  }
  drawUnderlay();
  drawLine();
  drawArrows();
  drawOverlay();
  drawText();
  if (shiftToOriginWithBb) {
    context.translate(bb.x1, bb.y1);
  }
};
var drawEdgeOverlayUnderlay = function drawEdgeOverlayUnderlay(overlayOrUnderlay) {
  if (!['overlay', 'underlay'].includes(overlayOrUnderlay)) {
    throw new Error('Invalid state');
  }
  return function (context, edge) {
    if (!edge.visible()) {
      return;
    }
    var opacity = edge.pstyle("".concat(overlayOrUnderlay, "-opacity")).value;
    if (opacity === 0) {
      return;
    }
    var r = this;
    var usePaths = r.usePaths();
    var rs = edge._private.rscratch;
    var padding = edge.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue;
    var width = 2 * padding;
    var color = edge.pstyle("".concat(overlayOrUnderlay, "-color")).value;
    context.lineWidth = width;
    if (rs.edgeType === 'self' && !usePaths) {
      context.lineCap = 'butt';
    } else {
      context.lineCap = 'round';
    }
    r.colorStrokeStyle(


lGetter => null;

/*member: testTopLevelGetterGet:static=[topLevelGetter]*/
testTopLevelGetterGet() => topLevelGetter;

/*member: topLevelGetterTyped:type=[inst:JSNull]*/
int? get topLevelGetterTyped => null;

/*member: testTopLevelGetterGetTyped:static=[topLevelGetterTyped]*/
testTopLevelGetterGetTyped() => topLevelGetterTyped;

/*member: topLevelSetter=:*/
set topLevelSetter(_) {}

/*member: testTopLevelSetterSet:static=[set:topLevelSetter],type=[inst:JSNull]*/
testTopLevelSetterSet() => topLevelSetter = null;

/*member: topLevelSetterTyped=:
 static=[
  Rti._bind(1),
  Rti._eval(1),
  _arrayInstanceType(1),
  _asBool(1),
  _asBoolQ(1),
  _asDouble(1),
  _asDoubleQ(1),
  _asInt(1),
  _asIntQ(1),
  _asNum(1),
  _asNumQ(1),
  _asObject(1),
  _asString(1),
  _asStringQ(1),
  _asTop(1),
  _generalAsCheckImplementation(1),
  _generalIsTestImplementation(1),
  _generalNullableAsCheckImplementation(1),
  _generalNullableIsTestImplementation(1),
  _installSpecializedAsCheck(1),
  _installSpecializedIsTest(1),
  _instanceType(1),
  _isBool(1),
  _isInt(1),
  _isNum(1),
  _isObject(1),
  _isString(1),
  _isTop(1),
  findType(1),
  instanceType(1)],
 type=[
  inst:Closure,
  inst:JSBool,
  param:int?]
*/
void set topLevelSetterTyped(int? value) {}

/*member: testTopLevelSetterSetTyped:static=[set:topLevelSetterTyped],type=[inst:JSNull]*/
testTopLevelSetterSetTyped() => topLevelSetterTyped = null;

/*member: topLevelField:type=[inst:JSNull]*/
var topLevelField;

/*member: testTopLevelField:static=[topLevelField]*/
testTopLevelField() => topLevelField;

/*member: topLevelFieldLazy:
 static=[
  throwLateFieldADI(1),
  topLevelFunction1(1)],
 type=[inst:JSNull]
*/
var topLevelFieldLazy = topLevelFunction1(null);

/*member: testTopLevelFieldLazy:static=[topLevelFieldLazy]*/
testTopLevelFieldLazy() => topLevelFieldLazy;

const topLevelFieldConst = null;

/*member: testTopLevelFieldConst:type=[inst:JSNull]*/
testTopLevelFieldConst() => topLevelFieldConst;

/*member: topLevelFieldFinal:
 static=[
  throwLateFieldADI(1),
  topLevelFunction1(1)],
 type=[inst:JSNull]
*/
final topLevelFieldFinal = topLevelFunction1(null);

/*member: testTopLevelFieldFinal:static=[topLevelFieldFinal]*/
testTopLevelFieldFinal() => topLevelFieldFinal;

/*member: topLevelFieldTyped:
 static=[
  Rti._bind(1),
  Rti._eval(1),
  _arrayInstanceType(1),
  _asBool(1),
  _asBoolQ(1),
  _asDouble(1),
  _asDoubleQ(1),
  _asInt(1),
  _asIntQ(1),
  _asNum(1),
  _asNumQ(1),
  _asObject(1),
  _asString(1),
  _asStringQ(1),
  _asTop(1),
  _generalAsCheckImplementation(1),
  _


app.notification.service.FcmTokenService
import com.nexters.bottles.app.user.domain.enum.AlimyType
import com.nexters.bottles.app.user.service.UserAlimyService
import mu.KotlinLogging
import org.springframework.context.event.EventListener
import org.springframework.scheduling.annotation.Async
import org.springframework.stereotype.Component

@Component
class AuthApiEventListener(
    private val fcmTokenService: FcmTokenService,
    private val alimyService: UserAlimyService,
    private val fcmClient: FcmClient,
) {

    private val log = KotlinLogging.logger { }

    @Async
    @EventListener
    fun handleCustomEvent(event: SignUpEventDto) {
        val fcmNotification = FcmNotification(
            title = "똑똑똑! ${event.userName}님에게 보틀이 도착했어요 👀",
            body = "보틀을 확인하기 위해서는 자기소개 작성이 꼭 필요해요!\n" +
                    "자기소개를 작성하러 가볼까요?"
        )

        fcmTokenService.findAllByUserIdAndTokenNotBlank(userId = event.userId).forEach {
            fcmClient.sendNotificationTo(userToken = it.token, fcmNotification = fcmNotification)
            log.info { "[SignUpEventDto] 회원 가입 후 자기소개 작성 부스팅 token: ${it.token}" }
        }

        // 알림 설정 자동 ON
        AlimyType.values().forEach { it ->
            alimyService.turnOnOffAlimy(event.userId, it, enabled = true)
        }
    }
}
package com.nexters.bottles.app.notification.component

import com.nexters.bottles.app.notification.component.dto.FcmNotification
import com.nexters.bottles.app.notification.service.FcmTokenService
import com.nexters.bottles.app.user.domain.enum.AlimyType
import com.nexters.bottles.app.user.service.UserAlimyService
import com.nexters.bottles.app.user.service.UserService
import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Component

@Component
class FcmNotificationScheduler(
    private val fcmClient: FcmClient,
    private val fcmTokenService: FcmTokenService,
    private val userService: UserService,
    private val userAlimyService: UserAlimyService,
) {

    @Scheduled(cron = "0 0 21 * * *")
    fun notifyMatching() {
        val userIds = userService.findAllByDeletedFalseAndMatchActivatedTrue().map { it.id }
        val alimyAllowUserIds = userAlimyService.findAllowedUserAlimyByUserIdsAndAlimyType(userIds.toSet(), AlimyType.DAILY_RANDOM)
            .map { it.userId }

        val fcmTokens = fcmTokenService.findAllByUserIdsAndTokenNotBlank(alimyAllowUserIds)
        val tokens = fcmTokens.map { it.token }

        val fcmNotification = FcmNotification(
            title = "새로운 보틀이 떠내려왔어요 🏖",
            body = "모래사장에 새로운 보틀이 도착했어요.\n도착한 보틀을 확인해주세요!"
        )


# Definition for a binary tree node.
# class TreeNode:
#     def __init__(self, x):
#         self.val = x
#         self.left = None
#         self.right = None

class Codec:

    def serialize(self, root: TreeNode) -> str:
        """Encodes a tree to a single string.
        """
        result = []

        def preOrder(root):
            if not root: return None
            result.append(str(root.val))
            preOrder(root.left)
            preOrder(root.right)

        preOrder(root)

        return ' '.join(result)

    def deserialize(self, data: str) -> TreeNode:
        """Decodes your encoded data to tree.
        """
        vals = [int(val) for val in data.split()]

        def build(minVal: int, maxVal: int) -> TreeNode:
            if vals and minVal < vals[0] < maxVal:
                val = vals.pop(0)
                return TreeNode(val, left=build(minVal, val), right=build(val, maxVal))

        return build(-inf, inf)

# Your Codec object will be instantiated and called as such:
# codec = Codec()
# codec.deserialize(codec.serialize(root))


unting
 */
int
#ifndef __OpenBSD__
ntfs_toupper_use(mp, ntmp)
	struct mount *mp;
	struct ntfsmount *ntmp;
#else
ntfs_toupper_use(mp, ntmp, p)
	struct mount *mp;
	struct ntfsmount *ntmp;
	struct proc *p;
#endif
{
	int error = 0;
	struct vnode *vp;

	/* get exclusive access */
#ifndef __OpenBSD__
	lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL);
#else
	lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, p);
#endif

	/* only read the translation data from a file if it hasn't been
	 * read already */
	if (ntfs_toupper_tab)
		goto out;

	/*
	 * Read in Unicode lowercase -> uppercase translation file.
	 * XXX for now, just the first 256 entries are used anyway,
	 * so don't bother reading more
	 */
	MALLOC(ntfs_toupper_tab, wchar *, 256 * 256 * sizeof(wchar),
		M_NTFSRDATA, M_WAITOK);

	if ((error = VFS_VGET(mp, NTFS_UPCASEINO, &vp)))
		goto out;
	error = ntfs_readattr(ntmp, VTONT(vp), NTFS_A_DATA, NULL,
			0, 256*256*sizeof(wchar), (char *) ntfs_toupper_tab,
			NULL);
	vput(vp);

    out:
	ntfs_toupper_usecount++;
#ifndef __OpenBSD__
	lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL);
#else
	lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, p);
#endif
	return (error);
}

/*
 * lower the use count and if it reaches zero, free the memory
 * tied by toupper table
 */
void
#ifndef __OpenBSD__
ntfs_toupper_unuse()
#else
ntfs_toupper_unuse(p)
	struct proc *p;
#endif
{
	/* get exclusive access */
#ifndef __OpenBSD__
	lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL);
#else
	lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, p);
#endif

	ntfs_toupper_usecount--;
	if (ntfs_toupper_usecount == 0) {
		FREE(ntfs_toupper_tab, M_NTFSRDATA);
		ntfs_toupper_tab = NULL;
	}
#ifdef DIAGNOSTIC
	else if (ntfs_toupper_usecount < 0) {
		panic("ntfs_toupper_unuse(): use count negative: %d",
			ntfs_toupper_usecount);
	}
#endif

	/* release the lock */
#ifndef __OpenBSD__
	lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL);
#else
	lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, p);
#endif
}


P 3.0
Description: Model relacionado à tabela [COMPRA_PEDIDO_DETALHE]

The MIT License

Copyright: Copyright (C) 2021 T2Ti.COM

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

       The author may be contacted at:
           t2ti.com@gmail.com

@author Albert Eije (alberteije@gmail.com)
@version 1.0.0
*******************************************************************************/
import 'dart:convert';

import 'package:fenix/src/model/model.dart';

class CompraPedidoDetalhe {
	int? id;
	int? idCompraPedido;
	int? idProduto;
	double? quantidade;
	double? valorUnitario;
	double? valorSubtotal;
	double? taxaDesconto;
	double? valorDesconto;
	double? valorTotal;
	String? cst;
	String? csosn;
	int? cfop;
	double? baseCalculoIcms;
	double? valorIcms;
	double? valorIpi;
	double? aliquotaIcms;
	double? aliquotaIpi;
	Produto? produto;

	CompraPedidoDetalhe({
			id,
			idCompraPedido,
			idProduto,
			quantidade,
			valorUnitario,
			valorSubtotal,
			taxaDesconto,
			valorDesconto,
			valorTotal,
			cst,
			csosn,
			cfop,
			baseCalculoIcms,
			valorIcms,
			valorIpi,
			aliquotaIcms,
			aliquotaIpi,
			produto,
		});

	static List<String> campos = <String>[
		'ID',
		'QUANTIDADE',
		'VALOR_UNITARIO',
		'VALOR_SUBTOTAL',
		'TAXA_DESCONTO',
		'VALOR_DESCONTO',
		'VALOR_TOTAL',
		'CST',
		'CSOSN',
		'CFOP',
		'BASE_CALCULO_ICMS',
		'VALOR_ICMS',
		'VALOR_IPI',
		'ALIQUOTA_ICMS',
		'ALIQUOTA_IPI',
	];

	static List<String> colunas = <String>[
		'Id',
		'Quantidade',
		'Valor Unitário',
		'Valor Subtotal',
		'Taxa Desconto',
		'V


-keyword,
.hljs-selector-tag,
.hljs-subst {
  color: #333;
  font-weight: bold;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
  color: #008080;
}

.hljs-string,
.hljs-doctag {
  color: #d14;
}

.hljs-title,
.hljs-section,
.hljs-selector-id {
  color: #900;
  font-weight: bold;
}

.hljs-subst {
  font-weight: normal;
}

.hljs-type,
.hljs-class .hljs-title {
  color: #458;
  font-weight: bold;
}

.hljs-tag,
.hljs-name,
.hljs-attribute {
  color: #000080;
  font-weight: normal;
}

.hljs-regexp,
.hljs-link {
  color: #009926;
}

.hljs-symbol,
.hljs-bullet {
  color: #990073;
}

.hljs-built_in,
.hljs-builtin-name {
  color: #0086b3;
}

.hljs-meta {
  color: #999;
  font-weight: bold;
}

.hljs-deletion {
  background: #fdd;
}

.hljs-addition {
  background: #dfd;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: bold;
}
/*!
 * "Fork me on GitHub" CSS ribbon v0.2.3 | MIT License
 * https://github.com/simonwhitaker/github-fork-ribbon-css
*/.github-fork-ribbon{width:12.1em;height:12.1em;position:absolute;overflow:hidden;top:0;right:0;z-index:9999;pointer-events:none;font-size:13px;text-decoration:none;text-indent:-999999px}.github-fork-ribbon.fixed{position:fixed}.github-fork-ribbon:active,.github-fork-ribbon:hover{background-color:rgba(0,0,0,0)}.github-fork-ribbon:after,.github-fork-ribbon:before{position:absolute;display:block;width:15.38em;height:1.54em;top:3.23em;right:-3.23em;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.github-fork-ribbon:before{content:"";padding:.38em 0;background-color:#a00;background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,.15)));background-image:-webkit-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:linear-gradient(to bottom,rgba(0,0,0,0),rgba(0,0,0,.15));-webkit-box-shadow:0 .15em .23em 0 rgba(0,0,0,.5);-moz-box-shadow:0 .15em .23em 0 rgba(0,0,0,.5);box-shadow:0 .15em .23em 0 rgba(0,0,0,.5);pointer-events:auto}.github-fork-ribbon:after{content:attr(data-ribbon);color:#fff;f


ckerControl-revealPassword{cursor:pointer;color:#b8bbbf;}@media (min-width: 576px){.amis-scope .dark-IconPickerControl.dark-Form-control--sizeXs > .dark-IconPickerControl-input,.amis-scope .dark-IconPickerControl.dark-Form-control--sizeSm > .dark-IconPickerControl-input,.amis-scope .dark-IconPickerControl.dark-Form-control--sizeMd > .dark-IconPickerControl-input,.amis-scope .dark-IconPickerControl.dark-Form-control--sizeLg > .dark-IconPickerControl-input{min-width:100%;display:inline-flex;}}.amis-scope .dark-IconPickerControl-placeholder{color:#b8bbbf;user-select:none;line-height:1.5;position:absolute;left:2px;overflow:hidden;width:100%;}.amis-scope .dark-IconPickerControl-valueWrap{justify-content:space-between;flex-grow:1;line-height:1;white-space:nowrap;width:100%;position:relative;}.amis-scope .dark-IconPickerControl-valueWrap > input{display:inline-block;width:100% !important;vertical-align:middle;}.amis-scope .dark-IconPickerControl-input--withAC{position:relative;flex-wrap:wrap;width:100%;}.amis-scope .dark-IconPickerControl-input--withAC > input{width:auto;}.amis-scope .dark-IconPickerControl-sugsPanel{position:absolute;background:#070d14;color:#f7f8fa;border:0.0625rem solid #1677ff;left:-0.0625rem;right:-0.0625rem;top:100%;z-index:10;height:auto;}.amis-scope .dark-IconPickerControl-tabs{background:#f0f3f4;}.amis-scope .dark-IconPickerControl-tab{display:inline-block;padding:0 0.625rem;height:1.875rem;line-height:1.875rem;cursor:pointer;text-align:center;font-size:12px;user-select:none;}.amis-scope .dark-IconPickerControl-tab.active{background:#070d14;}.amis-scope .dark-IconPickerControl-sugs{position:relative;padding:0.25rem;max-height:21.875rem;overflow-y:auto;}.amis-scope .dark-IconPickerControl-sugItem{display:inline-block;width:1.75rem;height:1.75rem;text-align:center;line-height:1.75rem;cursor:pointer;}.amis-scope .dark-IconPickerControl-sugItem:hover{background:#0040bf;}.amis-scope .dark-IconPickerControl-sugItem.is-active{color:#070d14;background:#1677ff;}.amis-scope .dark-IconPickerControl-value{position:absolute;user-select:none;line-height:calc( 1.5 * 14px );vertical-align:middle;display:inline-block;overflow:hidden;width:100%;text-overflow:ellipsis;}.amis-scope .dark-IconPickerControl-value > i{display:inline-block;margin-right:0.25rem;}.amis-scope .dark-IconSelectControl{position:relative;max-width:100%;}.amis-scope .dark-IconSelectControl.is-inline{display:inline-block;width:12.5rem;}.amis-scope .dark-IconSelectControl-input{display:flex;background:#070d14;border:0.0625rem solid #5c6066;border-radius:2px;line-height:1.5;padding:0.25rem 0.625rem;font-size:14px;flex-wrap:wrap;justify-content:flex-start;}.amis-scope .dark-IconSelectControl-input input{flex-basis:1.875rem;flex-grow:1;outline:none;background:transparent;border:none;color:#f7f8fa;width:100%;}.amis-scope .dark-IconSelectControl-input input::placeholder{color:#b8bbbf;user-select:none;}.amis-


 issue 188).

Release 3.3.0
=============

Features
--------

* Facilitate `Memory` subclasses (jbellis).
* Allow multiple fields of the same type in Unions (Francis Barber).
* Add `platform.win32.Advapi32.AdjustTokenPrivileges`, `platform.win32.Advapi32.LookupPrivilegeName`, `platform.win32.Advapi32.LookupPrivilegeValue`, `platform.win32.Advapi32.ImpersonateSelf`.
* Add `platform.win32.Advapi32.DuplicateTokenEx`, `platform.win32.Advapi32.CreateProcessAsUser`, `platform.win32.Kernel32.GetExitCodeProcess`, `platform.win32.Kernel32.TerminateProcess`, `platform.win32.Kernel32.ReadFile`, `platform.win32.Kernel32.CreatePipe`, `platform.win32.Kernel32.SetHandleInformation` and related constants / structures in `platform.win32.WinBase` and `platform.win32.WinNT`. Please note that the `SECURITY_ATTRIBUTES` structure has been moved from `platform.win32.WinNT` to `platform.win32.WinBase`.
* Add `platform.win32.Kernel32.DeleteFile` and `platform.win32.Kernel32Util.deleteFile`.
* Add `platform.win32.Kernel32.GetFileAttributes` and `platform.win32.Kernel32Util.getFileAttributes`.
* Add `platform.win32.Kernel32.GetTickCount`.
* Add Win32 Service functions to `platform.win32.Advapi32`.
* Add `platform.win32.W32ServiceManager` and `W32Service`.
* Add Win32 Event Logging functions to `platform.win32.Advapi32` and `platform.win32.Advapi32Util.EventLogIterator`.
* `platform.win32.Advapi32Util.registryCreateKey` returns `true` if key was created, `false` if it already exists.
* Add `REG_BINARY`, `REG_EXPAND_SZ` and `REG_MULTI_SZ` support to `platform.win32.Advapi32Util` registry functions.
* Reduce JNI crossings in a number of native methods, moving object creation out into pure Java code.

Bug Fixes
---------

* Move all native functions into `com.sun.jna.Native`, to ensure that all dependent classes must be disposed before the `Native` class is unloaded.  Note that this change is incompatible with all previous JNA native libraries.
* Fix `platform.win32.Kernel32.GetNativeSystemInfo` and `GetSystemInfo` AV on Win64.
* Fix several potential minor bugs as reported by TvT.
* Fix bug in Structure.StructureSet.toString (Blair Zajac), exposed by Tomcat ThreadLocal cleanup.
* Fix several bugs when using Structure(Pointer) ctor and array fields (Samuel Audet).

Release 3.2.7
=============

Features
--------

* Add native peer value accessors for Pointer
* The `jna.library.path` property is now re-evaluated whenever a native library is loaded.  Previously this value was cached when the JNA classes loaded.
* `Native.loadLibrary` can now load `.drv` files.
* Refactor `com.sun.jna.platform.win32.WINBASE` into `WinDef`, `WinNT` and `BaseTSD`, matching Windows SDK headers.
* Refactor constants from `com.sun.jna.platform.win32.GDI32` into `WinGDI`, matching Windows SDK headers.
* Refactor constants from `com.sun.jna.platform.win32.User32` into `WinUser`, matching Windows SDK headers.
* Refactor `platform.win32.WinNT.LARGE_INTEGER` into a union.
* Add `platform.win32.ObjBase`, `com.sun.jna.platform.win32.Ole32.CoInitializeEx`, `CoUninitialize`, and `CoCreateInstance`.
* Add `platform.win32.Oleaut32.SysAllocString` and `SysFreeString`.
* Add `platform.win32.Secur32.ImpersonateSecurityContext` and `RevertSecurityContext`.
* Ad


== RG.DIR.E) {
            tx = this.cols - 1;
        } else if (edge === RG.DIR.W) {
            tx = 0;
        } else {
            RG.err('Map', 'getEdgeCells', 'Invalid edge: ' + edge);
        }

        for (let x = 0; x < this.cols; x++) {
            for (let y = 0; y < this.rows; y++) {
                if ((x === tx) && (y === ty)) {
                    result.push(this._map[x][y]);
                }
            }
        }
        return result;
    }

}

CellMap.fromJSON = function(json: {[key: string]: any}): null | CellMap {
    if (json.encoded) {
        const {defaultType} = json;
        const elemObj = ELEM_MAP.elemIndexToElemObj[defaultType];
        const map = new CellMap(json.cols, json.rows, elemObj);

        Object.keys(json.cellsXY).forEach(x => {
            const xCol = json.cellsXY[x];
            const xNum = parseInt(x, 10);
            xCol.forEach(yAndIndex => {
                const elem = ELEM_MAP.elemIndexToElemObj[yAndIndex[1]];
                map.setBaseElemXY(xNum, yAndIndex[0], elem);
            });
        });

        json.explored.forEach(xy => {
            const [x, y] = xy;
            map._map[x][y].setExplored();
        });
        return map;
    }
    return null;
};
import type { CommonState } from '@audius/common'
import { badgeTiers, useSelectTierInfo } from '@audius/common'
import { useSelector } from 'react-redux'

import { MIN_COLLECTIBLES_TIER } from './constants'
import { getIsOwner, useSelectProfile } from './selectors'

/**
 *
 * Encapsulates complex logic for determining whether we should show the
 * profile's collectibles tab.
 *
 * User needs to be at a specific tier, needs to have collectibles,
 * they need to be ordered, and they need to load correctly.
 *
 * If the user is viewing their own profile, the collectibles don't
 * need to be ordered
 */
export const useShouldShowCollectiblesTab = () => {
  const {
    handle,
    user_id,
    has_collectibles,
    collectibleList,
    solanaCollectibleList,
    collectibles
  } = useSelectProfile([
    'handle',
    'user_id',
    'has_collectibles',
    'collectibleList',
    'solanaCollectibleList',
    'collectibles'
  ])
  const isOwner = useSelector((state: CommonState) => getIsOwner(state, handle))
  const { tierNumber } = useSelectTierInfo(user_id)

  const hasCollectiblesTierRequirement =
    tierNumber >= badgeTiers.findIndex((t) => t.tier === MIN_COLLECTIBLES_TIER)

  if (!hasCollectiblesTierRequirement) return false

  const hasCollectibles =
    collectibleList?.length || solanaCollectibleList?.length
  const hasCollectiblesOrder = Boolean(collectibles?.order?.length)
  const didCollectiblesLoadAndWasEmpty =
    hasCollectibles && !hasCollectiblesOrder

  if (has_collectibles && !didCollectiblesLoadAndWasEmpty) return true

  const neverSetCollectiblesOrder = !collectibles
  const hasVisibleCollectibles =
    hasCollectibles && (neverSetCollectiblesOrder || hasCollectiblesOrder)

  if (hasVisibleCollectibles) return true

  if (hasCollectibles && isOwner) return true

  return false
}

/**
 * Reduces multiple sequential newlines (> 3) into max `\n\n` and
 * trims both leading and trailing newlines
 * @param {string} str
 */
export const squashNewLines = (str?: string) => {
  return str ? str.replace(/\n\s*\n\s*\n/g, '\n\


/* Copyright (C) 1993-2024 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library 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.

   The GNU C Library 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 the GNU C Library; if not, see
   <https://www.gnu.org/licenses/>.

   As a special exception, if you link the code in this file with
   files compiled with a GNU compiler to produce an executable,
   that does not cause the resulting executable to be covered by
   the GNU Lesser General Public License.  This exception does not
   however invalidate any other reasons why the executable file
   might be covered by the GNU Lesser General Public License.
   This exception applies to code released by its copyright holders
   in files containing the exception.  */

#include "libioP.h"
#include <wchar.h>
#include <sys/param.h>

wchar_t *
__fgetws_unlocked_chk (wchar_t *buf, size_t size, int n, FILE *fp)
{
  size_t count;
  wchar_t *result;
  int old_error;
  CHECK_FILE (fp, NULL);
  if (n <= 0)
    return NULL;
  /* This is very tricky since a file descriptor may be in the
     non-blocking mode. The error flag doesn't mean much in this
     case. We return an error only when there is a new error. */
  old_error = fp->_flags & _IO_ERR_SEEN;
  fp->_flags &= ~_IO_ERR_SEEN;
  count = _IO_getwline (fp, buf, MIN ((size_t) n - 1, size), L'\n', 1);
  /* If we read in some bytes and errno is EAGAIN, that error will
     be reported for next read. */
  if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN))
    result = NULL;
  else if (count >= size)
    __chk_fail ();
  else
    {
      buf[count] = '\0';
      result = buf;
    }
  fp->_flags |= old_error;
  return result;
}


Task.Run(async() =>
            {
                while (true)
                {
                    var buffer = new byte[1024*1024];
                    var result = await clientWebSocket.ReceiveAsync(buffer, CancellationToken.None);
                    if (result.EndOfMessage)
                    {
                        await fileStream.WriteAsync(buffer.AsSpan(0, result.Count).ToArray());
                    }
                    else
                    {
                        await fileStream.WriteAsync(buffer);
                    }
                }
            });
            Thread.Sleep(100 * 1000);
        }

        [Fact]
        public void tkhd_width_height_test()
        {
            //01 60 00 00
            //01 20 00 00
            var a = BinaryPrimitives.ReadUInt32LittleEndian(new byte[] { 0x01, 0x60, 0, 0 });
            var b = BinaryPrimitives.ReadUInt32LittleEndian(new byte[] { 0x01, 0x20, 0, 0 });

            //00 00 01 60
            //00 00 01 20
            var c = BinaryPrimitives.ReadUInt32BigEndian(new byte[] { 0, 0, 0x01, 0x20 });
            var d = BinaryPrimitives.ReadUInt32BigEndian(new byte[] { 0, 0, 0x01, 0x60 });

            var e = new byte[4];
            var f = new byte[4];
            BinaryPrimitives.WriteUInt32LittleEndian(e, 352);
            BinaryPrimitives.WriteUInt32LittleEndian(f, 288);
            //60 01 00 00
            //20 01 00 00
            var g = e.ToHexString();
            var h = f.ToHexString();
        }

        [Fact]
        public void tfdt_test()
        {
            var TrackFragmentBaseMediaDecodeTimeBox = new TrackFragmentBaseMediaDecodeTimeBox();
            TrackFragmentBaseMediaDecodeTimeBox.BaseMediaDecodeTime = 0;
            FMp4MessagePackWriter writer = new FMp4MessagePackWriter(new byte[65535]);
            TrackFragmentBaseMediaDecodeTimeBox.ToBuffer(ref writer);
            var buffer = writer.FlushAndGetArray().ToHexString();
        }

        [Fact]
        public void match_test()
        {
            var filepath1 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "H264", "JT1078_1.mp4");
            var filepath2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "H264", "jt1078_1_fragmented.mp4");
            var byte1 = File.ReadAllBytes(filepath1);
            var byte2 = File.ReadAllBytes(filepath2);
            if (byte1.Length == byte2.Length)
            {
                for (


ui_button span{width:70px;padding:5px 15px;text-align:center;color:#3b3b1f;background:#53d9f0 none;display:inline-block;cursor:default}a.cke_dialog_ui_button_ok span{background-image:none;background-color:#b8e834;margin-right:0}a.cke_dialog_ui_button_cancel span{background-image:none;background-color:#f65d20;margin-right:0}a.cke_dialog_ui_button:hover span,a.cke_dialog_ui_button:focus span,a.cke_dialog_ui_button:active span{background-image:none;background:#f7a922}div.cke_dialog_ui_input_password,textarea.cke_dialog_ui_input_textarea{width:99%}.cke_dialog_ui_checkbox_input,.cke_dialog_ui_ratio_input,.cke_btn_reset,.cke_btn_locked,.cke_btn_unlocked{border:1px solid red!important;filter:chroma(color=red)}.cke_dialog_ui_focused,.cke_btn_over{border:1px dotted #696969!important}/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
.cke_dialog{visibility:visible}.cke_dialog_body{z-index:1;background:#eaeaea;border:1px solid #b2b2b2;border-bottom-color:#999;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:0 0 3px rgba(0,0,0,.15);-webkit-box-shadow:0 0 3px rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.15)}.cke_browser_gecko19 .cke_dialog_body{position:relative}.cke_dialog strong{font-weight:bold}.cke_dialog_title{font-weight:bold;font-size:13px;cursor:move;position:relative;color:#474747;text-shadow:0 1px 0 rgba(255,255,255,.75);border-bottom:1px solid #999;padding:6px 10px;-moz-border-radius:2px 2px 0 0;-webkit-border-radius:2px 2px 0 0;border-radius:2px 2px 0 0;-moz-box-shadow:0 1px 0 #fff inset;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;background:#cfd1cf;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#cfd1cf));background-image:-moz-linear-gradient(top,#f5f5f5,#cfd1cf);background-image:-webkit-linear-gradient(top,#f5f5f5,#cfd1cf);background-image:-o-linear-gradient(top,#f5f5f5,#cfd1cf);background-image:-ms-linear-gradient(top,#f5f5f5,#cfd1cf);background-image:linear-gradient(top,#f5f5f5,#cfd1cf);filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='#f5f5f5',endColorstr='#cfd1cf')}.cke_dialog_contents{background-color:#fff;overflow:auto;padding:15px 10px 5px 10px;margin-top:30px;border-top:1px solid #bfbfbf;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px}.cke_dialog_contents_body{overflow:auto;padding:17px 10px 5px 10px;margin-top:22px}.cke_dialog_footer{text-align:right;position:relative;border:0;outline:1px solid #bfbfbf;-moz-box-shadow:0 1px 0 #fff inset;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;


 id: &str) -> Result<String, APIError> {
        // Build the request.
        let request = self.request(Method::GET, &format!("jobs/{}/transcript", id), None, None);

        let resp = self.client.execute(request).await.unwrap();
        match resp.status() {
            StatusCode::OK => (),
            s => {
                return Err(APIError {
                    status_code: s,
                    body: resp.text().await.unwrap(),
                })
            }
        };

        Ok(resp.text().await.unwrap())
    }
}

/// Error type returned by our library.
pub struct APIError {
    pub status_code: StatusCode,
    pub body: String,
}

impl fmt::Display for APIError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "APIError: status code -> {}, body -> {}", self.status_code.to_string(), self.body)
    }
}

impl fmt::Debug for APIError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "APIError: status code -> {}, body -> {}", self.status_code.to_string(), self.body)
    }
}

// This is important for other errors to wrap this one.
impl error::Error for APIError {
    fn source(&self) -> Option<&(dyn error::Error + 'static)> {
        // Generic error, underlying cause isn't tracked.
        None
    }
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Job {
    #[serde(default, skip_serializing_if = "String::is_empty")]
    pub id: String,
    #[serde(default, skip_serializing_if = "String::is_empty")]
    pub status: String,
    pub created_on: DateTime<Utc>,
    #[serde(default, skip_serializing_if = "String::is_empty")]
    pub type_: String,
    #[serde(default)]
    pub delete_after_seconds: i64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct JobOptions {
    pub skip_diarization: bool,
    pub skip_punctuation: bool,
    pub remove_disfluencies: bool,
    pub filter_profanity: bool,
    pub speaker_channels_count: i64,
    pub metadata: String,
    pub callback_url: String,
    pub custom_vocabulary_id: String,
    pub language: String,
    pub delete_after_seconds: i64,
}
<reponame>wareya/notmecab-rs<filename>src/dart.rs
use crate::HashMap;
use crate::HashSet;

use std::io::Cursor;
use std::io::Read;
use std::io::Seek;
use std::ops::Range;
use std::hash::{BuildHasherDefault, Hasher};

use super::blob::*;
use super::file::*;
use super::FormatToken;

type BuildNoopHasher = BuildHasherDefault<NoopHasher>;

#[derive(Default)]
struct NoopHasher(u64);

impl Hasher for NoopHasher {
    fn finish(&self) -> u64
    {
        self.0
    }

    fn write(&mut self, bytes : &[u8])
    {
        for &byte in bytes
        {
            self.0 = (self.0 << 8) ^ (byte as u64);
        }
    }

    fn write_u64(&mut self, value : u64)
    {
        self.0 ^= value;
    }
}

#[derive(Debug)]
pub (crate) struct Link {
    base : u32,
    check : u32


lse,
  ),
  Meal(
    id: 'm10',
    categories: [
      'c2',
      'c5',
      'c10',
    ],
    title: 'Asparagus Salad with Cherry Tomatoes',
    affordability: Affordability.luxurious,
    complexity: Complexity.simple,
    imageUrl:
        'https://cdn.pixabay.com/photo/2018/04/09/18/26/asparagus-3304997_1280.jpg',
    duration: 30,
    ingredients: [
      'White and Green Asparagus',
      '30g Pine Nuts',
      '300g Cherry Tomatoes',
      'Salad',
      'Salt, Pepper and Olive Oil'
    ],
    steps: [
      'Wash, peel and cut the asparagus',
      'Cook in salted water',
      'Salt and pepper the asparagus',
      'Roast the pine nuts',
      'Halve the tomatoes',
      'Mix with asparagus, salad and dressing',
      'Serve with Baguette'
    ],
    isGlutenFree: true,
    isVegan: true,
    isVegetarian: true,
    isLactoseFree: true,
  ),
];
import 'package:flutter/material.dart';

import 'package:expense_tracker/widgets/expenses_list/expense_item.dart';
import 'package:expense_tracker/models/expense.dart';

class ExpensesList extends StatelessWidget {
  const ExpensesList({
    super.key,
    required this.expenses,
    required this.onRemoveExpense,
  });

  final List<Expense> expenses;
  final void Function(Expense expense) onRemoveExpense;

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemCount: expenses.length,
      itemBuilder: (ctx, index) => Dismissible(
        key: ValueKey(expenses[index]),
        background: Container(
          color: Theme.of(context).colorScheme.error.withOpacity(0.75),
          margin: EdgeInsets.symmetric(
            horizontal: Theme.of(context).cardTheme.margin!.horizontal,
          ),
        ),
        onDismissed: (direction) {
          onRemoveExpense(expenses[index]);
        },
        child: ExpenseItem(
          expenses[index],
        ),
      ),
    );
  }
}
import 'package:flutter/material.dart';
import 'package:uuid/uuid.dart';
import 'package:intl/intl.dart';

final formatter = DateFormat.yMd();

const uuid = Uuid();

enum Category { food, travel, leisure, work }

const categoryIcons = {
  Category.food: Icons.lunch_dining,
  Category.travel: Icons.flight_takeoff,
  Category.leisure: Icons.movie,
  Category.work: Icons.work,
};

class Expense {
  Expense({
    required this.title,
    required this.amount,
    required this.date,
    required this.category,
  }) : id = uuid.v4();

  final String id;
  final String title;
  final double amount;
  final DateTime date;
  final Category category;

  String get formattedDate {
    return formatter.format(date);
  }
}

class ExpenseBucket {
  const ExpenseBucket({
    required this.category,
    required this.expenses,
  });

  ExpenseBucket.forCategory(List<Expense> allExpenses, this.category)
      : expenses = allExpenses
            .where((expense) => expense.category == category)
            .toList();

  final Category category;
  final List<Expense> expenses;

  double get totalExpenses {
    double sum = 0;

    for (final expense in expenses) {
      sum += expense.amount; // sum = sum + expense.amount
    }

    return sum;
  }
}
import 'package:flutter/material.dart';

import 'package:expense_tracker/models/expense.dart';

class ExpenseItem extends StatelessWidget {
  const ExpenseItem(this.expense, {super.key});

  final Expense expense;


   | OIOT3       |
| 6   | A   | OIOT2       |
| 7   | B   | OIOT1       |
| 8   | A   | OIOT0       |
| 9   | B   | GND         |
| 10  | A   | GND         |
| 11  | B   | 3V3         |
| 12  | A   | 3V3         |

### J5

| Pin | Row | Signal Name |
| --- | --- | ----------- |
| 1   | B   | IT7         |
| 2   | A   | IT6         |
| 3   | B   | IT5         |
| 4   | A   | IT4         |
| 5   | B   | IT3         |
| 6   | A   | IT2         |
| 7   | B   | IT1         |
| 8   | A   | IT0         |
| 9   | B   | GND         |
| 10  | A   | GND         |
| 11  | B   | 3V3         |
| 12  | A   | 3V3         |

### J6

| Pin | Row | Signal Name |
| --- | --- | ----------- |
| 1   | B   | OIT7        |
| 2   | A   | OIT6        |
| 3   | B   | OIT5        |
| 4   | A   | OIT4        |
| 5   | B   | OIT3        |
| 6   | A   | OIT2        |
| 7   | B   | OIT1        |
| 8   | A   | OIT0        |
| 9   | B   | GND         |
| 10  | A   | GND         |
| 11  | B   | 3V3         |
| 12  | A   | 3V3         |
# Python面向对象

[视频LINK](https://www.bilibili.com/video/BV1uE411x76i?spm_id_from=333.788.player.switch&vd_source=ef2483e6c9fc0260d768b09282b7d179&p=4)

## 1.\_\_init\_\_函数

```
构造方法
此处self可以理解为类的实例化的地址，如d1 = Dog()，d1即为一个实例，self指向实例地址
```

## 2.类方法

```
类方法:可以通过类名调用，也可以通过实例名调用
1.类方法不能访问实例变量，可以访问类变量
2.类方法需要加上@classmethod，第一参数必须是class(cls)
```

## 3.静态方法

```
#静态方法：不依赖实例和属性
使用@staticmethod
```

## 4.继承

```
class 子类(父类):
# super() 调用父类的方法
```

## 5.命名规则

```
1.类名：驼峰，SheepDog
2.方法名、变量名、参数、文件名：
全小写，下划线连接,如 num_of_sheeps
3.私有属性：变量名前加下划线 _secret
```

# SOLID Principles ใน Rust 🦀

## 1. Single Responsibility Principle (SRP) - หลักการรับผิดชอบเดี่ยว

หลักการที่ว่าโค้ดหรือคลาสควรมีหน้าที่รับผิดชอบเพียงอย่างเดียวเท่านั้น

❌ แย่:

```rust
struct UserManager {
    users: Vec<User>,

    fn add_user(&mut self, user: User) {
        self.users.push(user);
    }

    fn save_to_database(&self) {
        // บันทึกลงฐานข้อมูล
    }

    fn generate_report(&self) -> String {
        // สร้างรายงาน