##2. C++版

### (I) C++版推理环境的搭建

**锐景智能的环境和算能官方镜像的环境搭建是一样的**

**如果是使用bmcv**

①编译安装libsophon、sophon-opencv和sophon-ffmpeg

直接按照该链接的步骤编译安装配置: [网址](https://github.com/sophgo/sophon-demo/blob/release/sample/YOLOv5/cpp/README.md#22-soc%E5%B9%B3%E5%8F%B0)

已编译打包好的libsophon、sophon-opencv和sophon-ffmpeg已全部在2070Super服务器上的名字叫test的容器中, 路径: /root/work/sophon_cpp_env

推理所需的libsophon、sophon-opencv和sophon-ffmpeg的所有的头文件和库文件已经全部放在路径:/root/work/sophon_cpp_env中的soc-sdk-bmcv文件夹下,

只需要将该soc-sdk-bmcv文件夹整个拷贝至算能设备中工程目录下即可, 编译的时候要和自己写的代码一起编译

②安装其他所需头文件及源文件

下载sophon-demo:

```bash
git clone https://github.com/sophgo/sophon-demo.git
```

将sophon-demo下的include文件夹拷贝至算能设备中工程目录下即可, 编译的时候要和自己写的代码一起编译

将sophon-demo下的src文件夹拷贝至算能设备中工程目录下即可, 编译的时候要和自己写的代码一起编译

 **如果是使用sail**

todo

### (II) C++版推理(在算能官方的环境中)

编译推理文件所需要链接的动态库名字:

系统目录(/usr/lib/aarch64-linux-gnu/)下的: pthread

soc-sdk下的: avcodec,  avformat, avutil, bmlib, bmrt, bmcv, yuv

soc-sdk下的opencv相关的库: opencv_imgproc,  opencv_core,  opencv_highgui,  opencv_imgcodecs, opencv_videoio

yolov5s在640*640的输入分辨率以及FP32精度下使用bmcv对图像进行处理推理速度:

	![](assets/infer6.jpg)

	![](assets/infer7.jpg)

# 四. 如何刷机

锐景智能环境的刷机包: <https://cowtransfer.com/s/38323333922244> 点击链接查看 [ sdcard.tgz ] ，或访问奶牛快传 [cowtransfer.com](http://cowtransfer.com/) 输入传输口令 1n3zg3 查看；

算能官方的刷机包: <https://developer.sophgo.com/site/index/material/29/all.html>, 下载sophon-img, 解压后在sophon-img文件夹中有一个sdcard.tgz

需要准备不小于16G的sd卡以及读卡器, 并将sd卡格式化为FAT32格式

刷机方法: 将刷机包放入SD卡根目录


) async {
    _prefs.setStringList(
        MoodleStorageKeys.events,
        eventManager.events
            .map((event) => jsonEncode(event.toJson()))
            .toList());
  }

  // ------------Request Utilities------------

  /// Build Moodle url according to params.
  Uri _buildMoodleUrl(
      {String? entryPoint, Map<String, String>? params, bool useHTTPS = true}) {
    return Uri(
      scheme: useHTTPS ? 'https' : 'http',
      host: _domain,
      path: entryPoint,
      queryParameters: params,
    );
  }

  /// Build Moodle mobile launch URL.
  /// Used for authentication.
  Uri _buildLaunchUrl() {
    // Passport here does not affect the authentication, fixed to be 100
    const String passport = '100';
    return _buildMoodleUrl(entryPoint: 'admin/tool/mobile/launch.php', params: {
      'service': 'moodle_mobile_app',
      'passport': passport,
      'urlscheme': 'cuckoo'
    });
  }

  /// Build URL for calling Moodle functions.
  Uri _buildMoodleFunctionUrl(String functionName) {
    return _buildMoodleUrl(
      entryPoint: 'webservice/rest/server.php',
      params: {
        'moodlewsrestformat': 'json',
        'wsfunction': functionName,
      },
    );
  }

  /// Build Moodle function body.
  String _buildMoodleFunctionBody(String functionName,
      {List<MoodleFunctionSubrequest>? subrequests,
      Map<String, dynamic>? params,
      bool filter = true,
      bool fileUrl = true,
      String lang = 'en_us'}) {
    var bodyParams = <String, dynamic>{
      'moodlewssettinglang': lang,
      'wsfunction': functionName,
      'wstoken': _wstoken!
    };
    if (params != null) bodyParams.addAll(params);
    if (subrequests == null) {
      bodyParams['moodlewssettingfilter'] = filter ? 'true' : 'false';
      bodyParams['moodlewssettingfileurl'] = fileUrl ? 'true' : 'false';
    } else {
      // Expand subrequests
      for (final (index, subrequest) in subrequests.indexed) {
        bodyParams.addAll(subrequest.bodyParamsWithIndex(index));
      }
    }

    // Convert to string
    var bodyComponents = <String>[];
    bodyParams.forEach((key, value) {
      final valStr = value is Map ? jsonEncode(value) : value.toString();
      bodyComponents
          .add('${Uri.encodeComponent(key)}=${Uri.encodeComponent(valStr)}');
    });
    return bodyComponents.join('&');
  }

  /// Call a Moodle function on Moodle's web service.
  Future<MoodleFunctionResponse> _callMoodleFunction(String functionName,
      {List<MoodleFunctionSubrequest>? subrequests,
      Map<String, dynamic>? params,
      bool filter = true,
      bool fileUrl = true,
      String lang = 'en_us'}) {
    // Build URL and body
    final url = _buildMoodleFunctionUrl(functionName);
    final body = _buildMoodleFunctionBody(functionName,
        subrequests: subrequests,
        params: params,
        filter: filter,
        fileUrl: fileUrl,
        lang: lang);

    // Issue request
    return Dio()
        .postUri(url,
            data: body,
            options: Options(headers: {
              Headers.acceptHeader: 'application/json, text/plain, */*',
              Headers.contentTypeHeader: 'application/x-www-form-urlencoded',
              'host': _domain,
              'origin': 'moodleappfs://localhost',
              'user-agent': 'MoodleMobile 4.3.0 (43001)',
            }))
        .then((response) => MoodleFunctionResponse


					sortVal = Number(sortVal);
					if (sortVal == 99) break;
					where.and['TASK_STATUS'] = sortVal;
					break;
				}
				case 'sort': {
					orderBy = this.fmtOrderBySort(sortVal, 'TASK_ADD_TIME');
					break;
				}
			}
		}

		let result = await TaskModel.getList(where, fields, orderBy, page, size, true, oldTotal, false);

		// 为导出增加一个参数condition
		result.condition = encodeURIComponent(JSON.stringify(where));

		return result;
	}

	/**修改状态 */
	async statusAdminTask(admin, id, status) {
		this.AppError('[访客]该功能暂不开放，如有需要请加作者微信：cclinux0730');

	}

	// #####################导出数据

	/**获取数据 */
	async getTaskDataURL() {
		return await exportUtil.getExportDataURL(EXPORT_TASK_DATA_KEY);
	}

	/**删除数据 */
	async deleteTaskDataExcel() {
		this.AppError('[访客]该功能暂不开放，如有需要请加作者微信：cclinux0730');
	}

	/**导出数据 */
	async exportTaskDataExcel(condition, fields) {

		this.AppError('[访客]该功能暂不开放，如有需要请加作者微信：cclinux0730');

	}

}

module.exports = AdminTaskService;/**
 * Notes: 资讯后台管理
 * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
 * Date: 2021-07-11 07:48:00
 */

const BaseProjectAdminService = require('./base_project_admin_service.js');
const AdminHomeService = require('../admin/admin_home_service.js');
const dataUtil = require('../../../../framework/utils/data_util.js');
const util = require('../../../../framework/utils/util.js');
const timeUtil = require('../../../../framework/utils/time_util.js');
const cloudUtil = require('../../../../framework/cloud/cloud_util.js');

const NewsModel = require('../../model/news_model.js');

class AdminNewsService extends BaseProjectAdminService {

	/** 推荐首页SETUP */
	async vouchNewsSetup(id, vouch) {
		this.AppError('[访客]该功能暂不开放，如有需要请加作者微信：cclinux0730');
	}

	/**添加资讯 */
	async insertNews({
		title,
		cateId, //分类
		cateName,
		order,
		desc = '',
		forms
	}) {

		this.AppError('[访客]该功能暂不开放，如有需要请加作者微信：cclinux0730');
	}

	/**删除资讯数据 */
	async delNews(id) {
		this.AppError('[访客]该功能暂不开放，如有需要请加作者微信：cclinux0730');

	}

	/**获取资讯信息 */
	async getNewsDetail(id) {
		let fields = '*';

		let where = {
			_id: id
		}
		let news = await NewsModel.getOne(where, fields);
		if (!news) return null;

		return news;
	}

	// 更新forms信息
	async updateNewsForms({
		id,
		hasImageForms
	}) {
		this.AppError('[访客]该功能暂不开放，如有需要请加作者微信：cclinux0730');
	}

	/**
	 * 更新富文本详细的内容及图片信息
	 * @returns 返回 urls数组 [


<script type="text/javascript" src="../../../_static/jquery.js"></script>
      <script type="text/javascript" src="../../../_static/underscore.js"></script>
      <script type="text/javascript" src="../../../_static/doctools.js"></script>
      <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>

</body>
</html><!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Privacy Policy - Ollama Client Extension</title>
    <meta
      name="description"
      content="Read the Ollama Client Privacy Policy to understand how we protect your data, ensure privacy, and maintain a secure AI chat experience." />
    <meta
      name="keywords"
      content="Ollama Client, Privacy Policy, data protection, AI chat privacy, local AI, Chrome extension privacy" />
    <meta name="author" content="Shishir Chaurasiya" />

    <meta property="og:type" content="website" />
    <meta
      property="og:url"
      content="https://ollama-client.shishirchaurasiya.in/privacy-policy" />
    <meta property="og:title" content="Ollama Client - Privacy Policy" />
    <meta
      property="og:description"
      content="Learn how Ollama Client protects your data and ensures a secure local AI chat experience." />
    <meta
      property="og:image"
      content="https://ollama-client.shishirchaurasiya.in/assets/og-image.png" />

    <!-- Twitter -->
    <meta name="twitter:card" content="summary_large_image" />
    <meta
      name="twitter:url"
      content="https://ollama-client.shishirchaurasiya.in/privacy-policy" />
    <meta name="twitter:title" content="Ollama Client - Privacy Policy" />
    <meta
      name="twitter:description"
      content="Ollama Client keeps your AI chat data private and secure. Read our Privacy Policy to learn more." />
    <meta
      name="twitter:image"
      content="https://ollama-client.shishirchaurasiya.in/assets/og-image.png" />

    <!-- Favicons -->
    <link
      rel="apple-touch-icon"
      sizes="180x180"
      href="https://ollama-client.shishirchaurasiya.in/assets/apple-touch-icon.png" />
    <link
      rel="icon"
      type="image/png"
      sizes="32x32"
      href="https://ollama-client.shishirchaurasiya.in/assets/favicon-32x32.png" />
    <link
      rel="icon"
      type="image/png"
      sizes="16x16"
      href="https://ollama-client.shishirchaurasiya.in/assets/favicon-16x16.png" />
    <link
      href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
      rel="stylesheet" />
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      :root {
        --primary-color: #6366f1;
        --primary-dark: #4f46e5;


   朝晖尚德园没独浴           |
|     第三卫生间     | seldom |          在莫干山见到过一次          |
|    军训协商减免    |   ?    |                                      |
| 军训凭医疗材料减免 |   ?    |                                      |
|    军训不管头发    |   ✓    |              貌似没要求              |
|    体育协商减免    |   ?    |                                      |
| 体育凭医疗材料减免 |   ✓    | 绝对可行，但是要在还没排课时找体军部 |
|      医保使用      |   ?    |              学校内未知              |
|     校医院服务     |   ✓    |              开证明友善              |

### 伙食

朝晖食堂好吃，校区西边一溜子也有吃的，离麦麦有点远

屏峰食堂一般，不过周围离麦麦近，校内有K和罗森，向西南走还有浙科的东和美食街，再走一点西和也有，旁边西溪印象城挺近的，还有山姆超市

莫干山食堂不好吃（细节待补充

### 周边娱乐

朝晖方便去各种综合体（just 综合体）玩，屏峰稍微远一点因为要转一号线。朝晖附近还有友LGBT酒吧。屏峰附近有西溪湿地，还有方便通向市区的三号线。

三个校区附近都有舞萌机厅

## 学校事项

### 医疗体育事项

杭州各大医院的证明都可以在校医院使用以开具需要的证明，并用于体育或者学业相关事情。

体测大一大二每一个学期体育课数周完成测试，可以用精神问题申请保健班，大三有体测，也可以在校医院开具证明免测试或者(修改对应性别的测试标准(待确认)）。

至于军训方面，将可能很快有新信息补充。（细节待补充

### 毕业改证事项

持有效证明（浙里办办理公安出具）联系辅导员即可改证，记得在新学生证出具之前尝试更改学生证照片，修改后学信网自动变化，四六级成绩疑似会跟着变动，学生医保如果不管的话


ognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleExpressionList"

    // $ANTLR start "entryRuleParameter"
    // InternalGaml.g:7082:1: entryRuleParameter returns [EObject current=null] : iv_ruleParameter= ruleParameter EOF ;
    public final EObject entryRuleParameter() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleParameter = null;

        try {
            // InternalGaml.g:7082:50: (iv_ruleParameter= ruleParameter EOF )
            // InternalGaml.g:7083:2: iv_ruleParameter= ruleParameter EOF
            {
            if ( state.backtracking==0 ) {
               newCompositeNode(grammarAccess.getParameterRule());
            }
            pushFollow(FOLLOW_1);
            iv_ruleParameter=ruleParameter();

            state._fsp--;
            if (state.failed) return current;
            if ( state.backtracking==0 ) {
               current =iv_ruleParameter;
            }
            match(input,EOF,FOLLOW_2); if (state.failed) return current;

            }

        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleParameter"

    // $ANTLR start "ruleParameter"
    // InternalGaml.g:7089:1: ruleParameter returns [EObject current=null] : ( () ( ( ( (lv_builtInFacetKey_1_1= ruleDefinitionFacetKey | lv_builtInFacetKey_1_2= ruleTypeFacetKey | lv_builtInFacetKey_1_3= ruleSpecialFacetKey | lv_builtInFacetKey_1_4= ruleActionFacetKey | lv_builtInFacetKey_1_5= ruleVarFacetKey ) ) ) | ( ( (lv_left_2_0= ruleVariableRef ) ) otherlv_3= ':' ) ) ( (lv_right_4_0= ruleExpression ) ) ) ;
    public final EObject ruleParameter() throws RecognitionException {
        EObject current = null;

        Token otherlv_3=null;
        AntlrDatatypeRuleToken lv_builtInFacetKey_1_1 = null;

        AntlrDatatypeRuleToken lv_builtInFacetKey_1_2 = null;

        AntlrDatatypeRuleToken lv_builtInFacetKey_1_3 = null;

        AntlrDatatypeRuleToken lv_builtInFacetKey_1_4 = null;

        AntlrDatatypeRuleToken lv_builtInFacetKey_1_5 = null;

        EObject lv_left_2_0 = null;

        EObject lv_right_4_0 = null;

        	enterRule();

        try {
            // InternalGaml.g:7095:2: ( ( () ( ( ( (lv_builtInFacetKey_1_1= ruleDefinitionFacetKey | lv_builtInFacetKey_1_2= ruleTypeFacetKey | lv_builtInFacetKey_1_3= ruleSpecialFacetKey | lv_builtInFacetKey_1_4= ruleActionFacetKey | lv_builtInFacetKey_1_5= ruleVarFacetKey ) ) ) | ( ( (lv_left_2_0= ruleVariableRef ) ) otherlv_3= ':' ) ) ( (lv_right_4_0= ruleExpression ) ) ) )
            // InternalGaml.g:7096:2: ( () ( ( ( (lv_builtInFacetKey_1_1= ruleDe


イルを元に、チャネルのジェネシスブロックを作成します。
  チャネルを作成した後、スクリプトはピア CLIを使用してチャネルを作成し、 ``peer0.org1.example.com`` と ``peer0.org2.example.com`` をチャネルに参加させ、両方のピアをアンカーピアにします。

- `deployCC` コマンドを発行すると、`./network.sh` は ``deployCC.sh`` スクリプトを実行して両方のピアに **asset-transfer (basic)** チェーンコードをインストールし、チャネルにチェーンコードを定義します。
  チェーンコード定義がチャネルにコミットされると、ピア CLIは `Init` を使用してチェーンコードを初期化し、チェーンコードを呼び出して初期データを台帳に格納します。

## Troubleshooting

チュートリアルで問題が発生した場合は、以下を確認してください:

-  ネットワークは常に新しく開始する必要があります。次のコマンドを使用して、過去の実行におけるアーティファクト、暗号マテリアル、コンテナ、Dockerボリューム、およびチェーンコードイメージを削除できます:
   ```
   ./network.sh down
   ```
   古いコンテナ、イメージ、およびボリュームを削除しないと、**エラーが発生します**。

-  Dockerエラーが表示された場合は、まずDockerのバージョン ([前提条件](prereqs.html)) を確認してから、Dockerプロセスを再起動してみてください。
   Dockerの問題は、すぐにはわからないことが多いです。例えば、ノードがコンテナ内にマウントされた暗号マテリアルにアクセスできないことが原因で発生するエラーが表示される場合があります。

   問題が解決しない場合は、以下の通りイメージを削除して一からやり直すことができます:
   ```
   docker rm -f $(docker ps -aq)
   docker rmi -f $(docker images -q)
   ```

-  もし、MacOSでDocker Desktopを動かしている場合に、チェーンコードのインストール時に、次のようなエラーになった場合:
   ```
   Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image inspection failed: Get "http://unix.sock/images/dev-peer0.org1.example.com-basic_1.0-4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad-42f57faac8360472e47cbbbf3940e81bba83439702d085878d148089a1b213ca/json": dial unix /host/var/run/docker.sock: connect: no such file or directory
   Chaincode installation on peer0.org1 has failed
   Deploying chaincode failed
   ```

   この問題は、MacOS用のDocker Desktopの新しめのバージョンで発生します。この問題を解決するには、Docker Desktopの設定で、`Use gRPC FUSE for file sharing` のチェックを解除して、レガシーなosxfsファイル共有を代わりに使用するようにして、**Apply & Restart**をクリックしてください。

-  もし、生成 (create)、承認 (approve)、コミット (commit)、呼び出し (invoke)、または参照 (query) コマンドでエラーが発生した場合は、
   チャネル名とチ


orHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include <cassert>
#include <cstdint>
#include <iterator>
#include <utility>

using namespace llvm;

#define GET_INSTRINFO_CTOR_DTOR
#include "AArch64GenInstrInfo.inc"

static cl::opt<unsigned> TBZDisplacementBits(
    "aarch64-tbz-offset-bits", cl::Hidden, cl::init(14),
    cl::desc("Restrict range of TB[N]Z instructions (DEBUG)"));

static cl::opt<unsigned> CBZDisplacementBits(
    "aarch64-cbz-offset-bits", cl::Hidden, cl::init(19),
    cl::desc("Restrict range of CB[N]Z instructions (DEBUG)"));

static cl::opt<unsigned>
    BCCDisplacementBits("aarch64-bcc-offset-bits", cl::Hidden, cl::init(19),
                        cl::desc("Restrict range of Bcc instructions (DEBUG)"));

AArch64InstrInfo::AArch64InstrInfo(const AArch64Subtarget &STI)
    : AArch64GenInstrInfo(AArch64::ADJCALLSTACKDOWN, AArch64::ADJCALLSTACKUP),
      RI(STI.getTargetTriple()), Subtarget(STI) {}

/// GetInstSize - Return the number of bytes of code the specified
/// instruction may be.  This returns the maximum number of bytes.
unsigned AArch64InstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
  const MachineBasicBlock &MBB = *MI.getParent();
  const MachineFunction *MF = MBB.getParent();
  const MCAsmInfo *MAI = MF->getTarget().getMCAsmInfo();

  if (MI.getOpcode() == AArch64::INLINEASM)
    return getInlineAsmLength(MI.getOperand(0).getSymbolName(), *MAI);

  // FIXME: We currently only handle pseudoinstructions that don't get expanded
  //        before the assembly printer.
  unsigned NumBytes = 0;
  const MCInstrDesc &Desc = MI.getDesc();
  switch (Desc.getOpcode()) {
  default:
    // Anything not explicitly designated otherwise is a normal 4-byte insn.
    NumBytes = 4;
    break;
  case TargetOpcode::DBG_VALUE:
  case TargetOpcode::EH_LABEL:
  case TargetOpcode::IMPLICIT_DEF:
  case TargetOpcode::KILL:
    NumBytes = 0;
    break;
  case TargetOpcode::STACKMAP:
    // The upper bound for a stackmap intrinsic is the full length of its shadow
    NumBytes = StackMapOpers(&MI).getNumPatchBytes();
    assert(NumBytes % 4 == 0 && "Invalid number of NOP bytes requested!");
    break;
  case TargetOpcode::PATCHPOINT:
    // The size of the patchpoint intrinsic is the number of bytes requested
    NumBytes = PatchPointOpers(&MI).getNumPatchBytes();
    assert(NumBytes % 4 == 0 && "Invalid number of NOP bytes requested!");
    break;
  case AArch64::TLSDESC_CALLSEQ:
    // This gets lowered to an instruction sequence which takes 16 bytes
    NumBytes = 16;
    break;
  }

  return NumBytes;
}

static void parseCondBranch(MachineInstr *LastInst, MachineBasicBlock *&Target,
                            SmallVectorImpl<MachineOperand> &Cond) {
  // Block ends with fall-through condbranch.
  switch (LastInst->getOpcode()) {
  default:
    llvm_unreachable("Unknown branch instruction?");
  case AArch64::Bcc:
    Target = LastInst->getOperand(1).getMBB();
    Cond.push_back(LastInst->getOperand(0));
    break;
  case AArch64::CBZW:
  case AArch64::CBZX:
  case AArch64::CB


se": "v1"},
					map[interface{}]interface{}{"id": "sixth", "release": "v1"},
					map[interface{}]interface{}{"id": "seventh", "release": "v1"},
					map[interface{}]interface{}{"id": "eighth", "release": "v1"},
				}

				array := []interface{}{
					"(( insert after id \"second\" ))",
					map[interface{}]interface{}{"id": "new-kid-on-the-block-1", "release": "vNext"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-2", "release": "vNext"},
					"(( prepend ))",
					map[interface{}]interface{}{"id": "new-kid-on-the-block-3", "release": "vNext"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-4", "release": "vNext"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-5", "release": "vNext"},
					"(( append ))",
					map[interface{}]interface{}{"id": "new-kid-on-the-block-6", "release": "vNext"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-7", "release": "vNext"},
					"(( insert before id \"fourth\" ))",
					map[interface{}]interface{}{"id": "new-kid-on-the-block-8", "release": "vNext"},
					"(( insert after 0 ))",
					map[interface{}]interface{}{"id": "new-kid-on-the-block-9", "release": "vNext"},
				}

				expect := []interface{}{
					map[interface{}]interface{}{"id": "new-kid-on-the-block-3", "release": "vNext"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-9", "release": "vNext"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-4", "release": "vNext"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-5", "release": "vNext"},
					map[interface{}]interface{}{"id": "first", "release": "v1"},
					map[interface{}]interface{}{"id": "second", "release": "v1"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-1", "release": "vNext"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-2", "release": "vNext"},
					map[interface{}]interface{}{"id": "third", "release": "v1"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-8", "release": "vNext"},
					map[interface{}]interface{}{"id": "fourth", "release": "v1"},
					map[interface{}]interface{}{"id": "fifth", "release": "v1"},
					map[interface{}]interface{}{"id": "sixth", "release": "v1"},
					map[interface{}]interface{}{"id": "seventh", "release": "v1"},
					map[interface{}]interface{}{"id": "eighth", "release": "v1"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-6", "release": "vNext"},
					map[interface{}]interface{}{"id": "new-kid-on-the-block-7", "release": "vNext"},
				}

				m := &Merger{}
				a := m.mergeArray(orig, array, "node-path")
				err := m.Error()
				So(a, ShouldResemble, expect)
				So(err, ShouldBeNil)
			})

			Convey("Insert multiple new entries in with different insertion styles which depend on each other (without name keys)", func() {
				orig := []interface{}{
					"1",
					"2",
					"3",
				}

				array := []interface{}{
					"


 base / "zipWithModifiedDate.zip"
    val zipFileSystem = fileSystem.openZip(zipPath)

    zipFileSystem.metadata("a/a.txt".toPath())
      .apply {
        assertThat(createdAtMillis).isNull()
        assertThat(lastModifiedAtMillis).isEqualTo("1970-01-01T00:01:00Z".toEpochMillis())
        assertThat(lastAccessedAtMillis).isEqualTo("1970-01-01T00:02:00Z".toEpochMillis())
      }
  }

  /**
   * Build a very small zip file with just a single empty directory.
   *
   * ```
   * mkdir -p a
   * touch -m -t 200102030405.06 a
   * touch -a -t 200102030405.07 a
   *
   * zip \
   *   zipWithEmptyDirectory.zip \
   *   a
   * ```
   */
  @Test
  fun zipWithEmptyDirectory() {
    val zipPath = base / "zipWithEmptyDirectory.zip"
    val zipFileSystem = fileSystem.openZip(zipPath)

    zipFileSystem.metadata("a".toPath())
      .apply {
        assertThat(isRegularFile).isFalse()
        assertThat(isDirectory).isTrue()
        assertThat(size).isNull()
        assertThat(createdAtMillis).isNull()
        assertThat(lastModifiedAtMillis).isEqualTo("2001-02-03T04:05:06Z".toEpochMillis())
        assertThat(lastAccessedAtMillis).isEqualTo("2001-02-03T04:05:07Z".toEpochMillis())
      }
    assertThat(zipFileSystem.list("a".toPath())).isEmpty()
  }

  /**
   * The `--no-dir-entries` option causes the zip file to omit the directories from the encoded
   * file. Our implementation synthesizes these missing directories automatically.
   *
   * ```
   * mkdir -p a
   * echo "Android" > a/a.txt
   *
   * mkdir -p b
   * echo "Android" > b/b.txt
   *
   * zip \
   *   --no-dir-entries \
   *   zipWithSyntheticDirectory.zip \
   *   a/a.txt \
   *   a \
   *   b/b.txt \
   *   b
   * ```
   */
  @Test
  fun zipWithSyntheticDirectory() {
    val zipPath = base / "zipWithSyntheticDirectory.zip"
    val zipFileSystem = fileSystem.openZip(zipPath)

    zipFileSystem.metadata("a".toPath())
      .apply {
        assertThat(isRegularFile).isFalse()
        assertThat(isDirectory).isTrue()
        assertThat(size).isNull()
        assertThat(createdAtMillis).isNull()
        assertThat(lastModifiedAtMillis).isNull()
        assertThat(lastAccessedAtMillis).isNull()
      }
    assertThat(zipFileSystem.list("a".toPath())).containsExactly("/a/a.txt".toPath())

    zipFileSystem.metadata("b".toPath())
      .apply {
        assertThat(isRegularFile).isFalse()
        assertThat(isDirectory).isTrue()
        assertThat(size).isNull()
        assertThat(createdAtMillis).isNull()
        assertThat(lastModifiedAtMillis).isNull()
        assertThat(lastAccessedAtMillis).isNull()
      }
    assertThat(zipFileSystem.list("b".toPath())).containsExactly("/b/b.txt".toPath())
  }

  /**
   * Force a file to be encoded with zip64 metadata. We use a pipe to force the zip command to
   * create a zip64 archive; otherwise we'd need to add a very large file to get this format.
   *
   * ```
   * zip \
   *


], a[a_c+0:a_c+15]     ; repeat:0x0, step:0x0, num_a_c:16

    v_mfma_f32_32x32x8f16 a[a_c+16:a_c+31], v[v_a+0:v_a+1], v[v_b+2:v_b+3], a[a_c+16:a_c+31]     ; repeat:0x0, step:0x1, num_a_c:16

    s_waitcnt lgkmcnt(5)
    v_mfma_f32_32x32x8f16 a[a_c+32:a_c+47], v[v_a+0:v_a+1], v[v_b+4:v_b+5], a[a_c+32:a_c+47]     ; repeat:0x1, step:0x0, num_a_c:16

    v_mfma_f32_32x32x8f16 a[a_c+48:a_c+63], v[v_a+0:v_a+1], v[v_b+6:v_b+7], a[a_c+48:a_c+63]     ; repeat:0x1, step:0x1, num_a_c:16

    s_waitcnt lgkmcnt(4)
    v_mfma_f32_32x32x8f16 a[a_c+64:a_c+79], v[v_a+2:v_a+3], v[v_b+0:v_b+1], a[a_c+64:a_c+79]     ; repeat:1x0, step:0x0, num_a_c:16

    v_mfma_f32_32x32x8f16 a[a_c+80:a_c+95], v[v_a+2:v_a+3], v[v_b+2:v_b+3], a[a_c+80:a_c+95]     ; repeat:1x0, step:0x1, num_a_c:16

    s_cmp_eq_u32 1, s[s_flag_need_acc_yx]
    s_cbranch_scc0 igemm_fwd_gtcx_nhwc_fp16_bx0_ex1_bt128x256x32_wt32x32x8_ws1x2_wr2x2_ta1x8x2x1_1x4x1x64_tb1x8x4x1_1x4x1x64_acc_yx_end_1  ; no need do accumulate yx
igemm_fwd_gtcx_nhwc_fp16_bx0_ex1_bt128x256x32_wt32x32x8_ws1x2_wr2x2_ta1x8x2x1_1x4x1x64_tb1x8x4x1_1x4x1x64_acc_yx_1:
    s_mov_b32 s[s_in_offset], 0
    s_add_u32 s[s_move_slice_k_ix], 1, s[s_move_slice_k_ix]
    s_cmp_le_u32 s[s_x], s[s_move_slice_k_ix]
    s_cselect_b32 s[s_tmp], s[s_dilation_w_x], s[s_dilation_w]
    v_add_u32 v[v_in_iwi_list], s[s_tmp], v[v_in_iwi_list]
    v_add_u32 v[v_in_iwi_list+1], s[s_tmp], v[v_in_iwi_list+1]
    s_cselect_b32 s[s_tmp], s[s_in_diff_hi], s[s_in_diff_wi]
    v_add_u32 v[v_in_os], s[s_tmp], v[v_in_os]
    v_add_u32 v[


	if x != nil {
		return x.AnalysisResults
	}
	return nil
}

func (x *AnalyzeIamPolicyResponse_IamPolicyAnalysis) GetFullyExplored() bool {
	if x != nil {
		return x.FullyExplored
	}
	return false
}

func (x *AnalyzeIamPolicyResponse_IamPolicyAnalysis) GetNonCriticalErrors() []*IamPolicyAnalysisState {
	if x != nil {
		return x.NonCriticalErrors
	}
	return nil
}

// A Cloud Storage location.
type IamPolicyAnalysisOutputConfig_GcsDestination struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// Required. The URI of the Cloud Storage object. It's the same URI that is
	// used by gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
	// Editing Object
	// Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
	// for more information.
	//
	// If the specified Cloud Storage object already exists and there is no
	// [hold](https://cloud.google.com/storage/docs/object-holds), it will be
	// overwritten with the analysis result.
	Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
}

func (x *IamPolicyAnalysisOutputConfig_GcsDestination) Reset() {
	*x = IamPolicyAnalysisOutputConfig_GcsDestination{}
	mi := &file_google_cloud_asset_v1_asset_service_proto_msgTypes[66]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *IamPolicyAnalysisOutputConfig_GcsDestination) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*IamPolicyAnalysisOutputConfig_GcsDestination) ProtoMessage() {}

func (x *IamPolicyAnalysisOutputConfig_GcsDestination) ProtoReflect() protoreflect.Message {
	mi := &file_google_cloud_asset_v1_asset_service_proto_msgTypes[66]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use IamPolicyAnalysisOutputConfig_GcsDestination.ProtoReflect.Descriptor instead.
func (*IamPolicyAnalysisOutputConfig_GcsDestination) Descriptor() ([]byte, []int) {
	return file_google_cloud_asset_v1_asset_service_proto_rawDescGZIP(), []int{29, 0}
}

func (x *IamPolicyAnalysisOutputConfig_GcsDestination) GetUri() string {
	if x != nil {
		return x.Uri
	}
	return ""
}

// A BigQuery destination.
type IamPolicyAnalysisOutputConfig_BigQueryDestination struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// Required. The BigQuery dataset in format
	// "projects/projectId/datasets/datasetId", to which the analysis results
	// should be exported. If this dataset does not exist, the export call will
	// return an INVALID_ARGUMENT error.
	Dataset string `protobuf:"bytes,1,opt,name=dataset,proto3" json:"dataset,omitempty"`
	// Required. The prefix of the BigQuery tables to which the analysis results
	// will be written. Tables will be created based on this table_prefix if not
	// exist:
	//   - <table_prefix>_analysis table will contain export operation's metadata.
	//   - <table_prefix>_analysis_result will contain all the
	//     [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult].
	//


model = [['_', '_', '_'],
         ['_', '_', '_'],
         ['A', 'T', 'K'],
         ['_', '_', '_'],
         ['_', '_', '_']]

behave = []
for i in range(7):
    be = list(map(str, input().split()))
    behave.append(be)

ay, ax = 2, 0
ty, tx = 2, 1
ky, kx = 2, 2

for k in range(7):
    if behave[k][0] == 'A':
        if behave[k][1] == "UP":
            model[ay][ax], model[ay - 1][ax] = model[ay - 1][ax], model[ay][ax]
            ay -= 1
        elif behave[k][1] == 'DOWN':
            model[ay][ax], model[ay + 1][ax] = model[ay + 1][ax], model[ay][ax]
            ay += 1
        elif behave[k][1] == 'RIGHT':
            model[ay][ax], model[ay][ax + 1] = model[ay][ax + 1], model[ay][ax]
            ax += 1
        elif behave[k][1] == 'LEFT':
            model[ay][ax], model[ay][ax - 1] = model[ay][ax - 1], model[ay][ax]
            ax -= 1
    elif behave[k][0] == 'T':
        if behave[k][1] == "UP":
            model[ty][tx], model[ty - 1][tx] = model[ty - 1][tx], model[ty][tx]
            ty -= 1
        elif behave[k][1] == 'DOWN':
            model[ty][tx], model[ty + 1][tx] = model[ty + 1][tx], model[ty][tx]
            ty += 1
        elif behave[k][1] == 'RIGHT':
            model[ty][tx], model[ty][tx + 1] = model[ty][tx + 1], model[ty][tx]
            tx -= 1
        elif behave[k][1] == 'LEFT':
            model[ty][tx], model[ty][tx - 1] = model[ty][tx - 1], model[ty][tx]
            tx += 1
    elif behave[k][0] == 'K':
        if behave[k][1] == "UP":
            model[ky][kx], model[ky - 1][kx] = model[ky - 1][kx], model[ky][kx]
            ky -= 1
        elif behave[k][1] == 'DOWN':
            model[ky][kx], model[ky + 1][kx] = model[ky + 1][kx], model[ky][kx]
            ky += 1
        elif behave[k][1] == 'RIGHT':
            model[ky][kx], model[ky][kx + 1] = model[ky][kx + 1], model[ky][kx]
            kx += 1
        elif behave[k][1] == 'LEFT':
            model[ky][kx], model[ky][kx - 1] = model[ky][kx - 1], model[ky][kx]
            kx -= 1
for i in model:
    print(*i, sep = '')

# def runway(y, x):
#     global model
#     dy = y
#     dx = x
#     for i in range(7):
#         if behave[i][0] == model[dy][dx]:
#             if behave[i][1] == 'UP':
#                 dy += 1
#             elif behave[i][1] == 'DOWN':
#                 dy -= 1
#             elif behave[i][1] == 'RIGHT':
#                 dx += 1
#             elif behave[i][1] == 'LEFT':
#                 dx += 1
#     return dy, dx


using UnityEngine;
using System.Collections;

/// <summary>
/// Implements OnClick to destroy the GameObject it's attached to. Optionally a RPC is sent to do this.
/// </summary>
/// <remarks>
/// Using an RPC to Destroy a GameObject allows any player to Destroy a GameObject. But it might cause errors.
/// RPC and the Instantiated GameObject are not fully linked on the server. One might stick in the server witout
/// the other.
///
/// A buffered RPC gets cleaned up when the sending player leaves the room. This means, the RPC gets lost.
///
/// Vice versus, a GameObject Instantiate might get cleaned up when the creating player leaves a room.
/// This way, the GameObject that a RPC targets might become lost.
///
/// It makes sense to test those cases. Many are not breaking errors a


o = xmm4;
    Xbyak::Xmm xc_hi = xmm5;
    Xbyak::Xmm xd_lo = xmm6;
    Xbyak::Xmm xd_hi = xmm7;
    Xbyak::Xmm xe_lo = xmm8;
    Xbyak::Xmm xe_hi = xmm9;
    Xbyak::Xmm xsum_lo = xmm10;
    Xbyak::Xmm xsum_hi = xmm11;
    Xbyak::Xmm xmask_lo = xmm12;
    Xbyak::Xmm xmask_hi = xmm13;
    Xbyak::Xmm xbase_lo = xmm14;
    Xbyak::Xmm xbase_hi = xmm15;

    this->preamble();

    mov(src, ptr[this->param1 + 0]);
    mov(dst, ptr[this->param1 + 8]);
    if (pk != prop_kind::forward_inference)
        mov(scratch, ptr[this->param1 + 16]);
    mov(imm_addr64, float2int(this->alpha));
    movq(xalpha, imm_addr64);
    shufps(xalpha, xalpha, 0);

    mov(imm_addr64, float2int(this->k));
    movq(xk, imm_addr64);
    shufps(xk, xk, 0);

    mov(store_addr, reinterpret_cast<size_t>(&store[0]));
    and_(store_addr, -15);
    movups(ptr[store_addr], xalpha);
    movups(ptr[store_addr + 4 * sizeof(float)], xk);

    xorps(xsum_lo, xsum_lo);
    xorps(xsum_hi, xsum_hi);

    mov(imm_addr64, reinterpret_cast<size_t>(&mask[0]));
    movups(xmask_lo, ptr[imm_addr64]);
    movups(xmask_hi, ptr[imm_addr64 + 4 * sizeof(float)]);
    movups(xa_lo, ptr[src - 8]);
    movups(xa_hi, ptr[src - 8 + 4 * sizeof(float)]);
    andps(xa_lo, xmask_lo);
    andps(xa_hi, xmask_hi);
    mulps(xa_lo, xa_lo);
    mulps(xa_hi, xa_hi);
    addps(xsum_lo, xa_lo);
    addps(xsum_hi, xa_hi); // xsum <- xsum + xa^2+xb^2+xc^2+xd^2+xe^2

    mov(imm_addr64, reinterpret_cast<size_t>(&mask[1]));
    movups(xmask_lo, ptr[imm_addr64]);
    movups(xmask_hi, ptr[imm_addr64 + 4 * sizeof(float)]);
    movups(xb_lo, ptr[src - 4]);
    movups(xb_hi, ptr[src - 4 + 4 * sizeof(float)]);
    andps(xb_lo, xmask_lo);
    andps(xb_hi, xmask_hi);
    mulps(xb_lo, xb_lo);
    mulps(xb_hi, xb_hi);
    addps(xsum_lo, xb_lo);
    addps(xsum_hi, xb_hi);

    mov(c, J.C / 8 - 1);
    Label lrn_loop;
    L(lrn_loop);

    movups(xc_lo, ptr[src]);
    movups(xc_hi, ptr[src + 4 * sizeof(float)]);
    movups(xd_lo, ptr[src + 4]);
    movups(xd_hi, ptr[src + 4 + 4 * sizeof(float)]);
    movups(xe_lo, ptr[src + 8]);
    movups(xe_hi, ptr[src + 8 + 4 * sizeof(float)]);
    mulps(xc_lo, xc_lo);
    mulps(xc_hi, xc_hi);


// default label
template <class Arg>
inline const
tagged_lambda_functor<
  detail::switch_case_tag<detail::default_label>,
  lambda_functor<Arg>
>
default_statement(const lambda_functor<Arg>& a) {
  return
    tagged_lambda_functor<
      detail::switch_case_tag<detail::default_label>,
      lambda_functor<Arg>
    >(a);
}

// default lable, no case body case.
inline const
tagged_lambda_functor<
  detail::switch_case_tag<detail::default_label>,
  lambda_functor<
    lambda_functor_base<
      do_nothing_action,
      null_type
    >
  >
>
default_statement() {
return
      lambda_functor_base<
        do_nothing_action,
        null_type
      > () ;
}

// Specializations for lambda_functor_base of case_statement -----------------

// 0 case type:
// useless (just the condition part) but provided for completeness.
template<class Args>
class
lambda_functor_base<
  switch_action<1>,
  Args
>
{
public:
  Args args;
  template <class SigArgs> struct sig { typedef void type; };
public:
  explicit lambda_functor_base(const Args& a) : args(a) {}

  template<class RET, CALL_TEMPLATE_ARGS>
  RET call(CALL_FORMAL_ARGS) const {
    detail::select(::boost::tuples::get<1>(args), CALL_ACTUAL_ARGS);
  }
};

// 1 case type:
// template<class Args, int Case1>
// class
// lambda_functor_base<
//   action<
//     2,
//     return_void_action<switch_action<detail::case_label<Case1> > >
//   >,
//   Args
// >
// {
//   Args args;
// public:
//   explicit lambda_functor_base(const Args& a) : args(a) {}

//   template<class RET, class A, class B, class C>
//   RET call(A& a, B& b, C& c) const {
//     switch( detail::select(::boost::tuples::get<0>(args), a, b, c) )
//     {
//       case Case1:
//         detail::select(::boost::tuples::get<1>(args), a, b, c);
//         break;
//     }
//   }
// };

// switch with default being the sole label - doesn't make much sense but
// it is there for completeness
// template<class Args>
// class
// lambda_functor_base<
//   action<
//     2,
//     return_void_action<switch_action<detail::default_label> >
//   >,
//   Args
// >
// {
//   Args args;
// public:
//   explicit lambda_functor_base(const Args& a) : args(a) {}
//
//   template<class RET, class A, class B, class C>
//   RET call(A& a, B& b, C& c) const {
//     switch( detail::select(::boost::tuples::get<0>(args), a, b, c) )
//     {
//       default:
//         detail::select(::boost::tuples::get<1>(args), a, b, c);
//         break;
//     }
//   }
// };

// // 2 case type:
// The different specializations are generated with Vesa Karvonen's
// preprocessor library.

// This is just a comment to show what the generated classes look like

// template<class Args, int Case1, int Case2>
// class
// lambda_functor_base<
//   action<3,
//     return_void_action<
//       switch_action<
//         detail::case_label<Case1>,
//         detail::case_label<Case2>
//       >
//     >
//   >,
//   Args
// >
// {
//   Args


, 'tag2']));
    });

    test('should throw error for invalid JSON', () {
      // 测试缺少必填字段
      expect(() => Quote.fromJson({}), throwsA(isA<ArgumentError>()));
      expect(
          () => Quote.fromJson({'content': ''}), throwsA(isA<ArgumentError>()));
      expect(() => Quote.fromJson({'content': '测试', 'date': ''}),
          throwsA(isA<ArgumentError>()));

      // 测试无效日期格式
      expect(
          () => Quote.fromJson({
                'content': '测试内容',
                'date': 'invalid-date',
              }),
          throwsA(isA<ArgumentError>()));

      // 测试无效颜色格式
      expect(
          () => Quote.fromJson({
                'content': '测试内容',
                'date': '2024-01-01T00:00:00.000Z',
                'color_hex': 'invalid-color',
              }),
          throwsA(isA<ArgumentError>()));
    });
  });
}
/// 文件类型枚举
enum FileType {
  /// 图片
  image,

  /// 视频
  video,

  /// 音频
  audio,

  /// 文档
  document,

  /// 文本
  text,

  /// 应用
  apk,

  /// 其他
  other,
}

extension FileTypeExtension on FileType {
  String get displayName {
    switch (this) {
      case FileType.image:
        return '图片';
      case FileType.video:
        return '视频';
      case FileType.audio:
        return '音频';
      case FileType.document:
        return '文档';
      case FileType.text:
        return '文本';
      case FileType.apk:
        return '应用';
      case FileType.other:
        return '其他';
    }
  }

  /// 根据文件扩展名判断文件类型
  static FileType fromExtension(String extension) {
    final ext = extension.toLowerCase();

    if (['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'].contains(ext)) {
      return FileType.image;
    } else if (['mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv', 'webm']
        .contains(ext)) {
      return FileType.video;
    } else if (['mp3', 'wav', 'flac', 'aac', 'ogg', 'm4a'].contains(ext)) {
      return FileType.audio;
    } else if (['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
        .contains(ext)) {
      return FileType.document;
    } else if (['txt', 'md', 'json', 'xml', 'csv'].contains(ext)) {
      return FileType.text;
    } else if (ext == 'apk') {
      return FileType.apk;
    } else {
      return FileType.other;
    }
  }
}
class AppSettings {
  final String hitokotoType;
  final bool clipboardMonitoringEnabled; // 添加剪贴板监控设置
  final int defaultStartPage; // 添加默认启动页面设置，0=首页，1=记录页
  final bool hasCompletedOnboarding; // 添加是否完成引导页的标志
  final bool aiCardGenerationEnabled; // 添加AI卡片生成功能开关
  final bool reportInsightsUseAI; // 新增：周期报告洞察是否使用AI（流式）
  final bool todayThoughtsUseAI; // 新增：今日思考是否使用AI（默认开启）
  final bool prioritizeBoldContentIn


cted[i] = true;
      state.add(choice);
      // 进行下一轮选择
      backtrack(state, choices, selected, res);
      // 回退：撤销选择，恢复到之前的状态
      selected[i] = false;
      state.removeLast();
    }
  }
}

/* 全排列 II */
List<List<int>> permutationsII(List<int> nums) {
  List<List<int>> res = [];
  backtrack([], nums, List.filled(nums.length, false), res);
  return res;
}

/* Driver Code */
void main() {
  List<int> nums = [1, 2, 2];

  List<List<int>> res = permutationsII(nums);

  print("输入数组 nums = $nums");
  print("所有排列 res = $res");
}
/**
 * File: iteration.dart
 * Created Time: 2023-08-27
 * Author: liuyuxin (gvenusleo@gmail.com)
 */

/* for 循环 */
int forLoop(int n) {
  int res = 0;
  // 循环求和 1, 2, ..., n-1, n
  for (int i = 1; i <= n; i++) {
    res += i;
  }
  return res;
}

/* while 循环 */
int whileLoop(int n) {
  int res = 0;
  int i = 1; // 初始化条件变量
  // 循环求和 1, 2, ..., n-1, n
  while (i <= n) {
    res += i;
    i++; // 更新条件变量
  }
  return res;
}

/* while 循环（两次更新） */
int whileLoopII(int n) {
  int res = 0;
  int i = 1; // 初始化条件变量
  // 循环求和 1, 4, 10, ...
  while (i <= n) {
    res += i;
    // 更新条件变量
    i++;
    i *= 2;
  }
  return res;
}

/* 双层 for 循环 */
String nestedForLoop(int n) {
  String res = "";
  // 循环 i = 1, 2, ..., n-1, n
  for (int i = 1; i <= n; i++) {
    // 循环 j = 1, 2, ..., n-1, n
    for (int j = 1; j <= n; j++) {
      res += "($i, $j), ";
    }
  }
  return res;
}

/* Driver Code */
void main() {
  int n = 5;
  int res;

  res = forLoop(n);
  print("\nfor 循环的求和结果 res = $res");

  res = whileLoop(n);
  print("\nwhile 循环的求和结果 res = $res");

  res = whileLoopII(n);
  print("\nwhile 循环（两次更新）的求和结果 res = $res");

  String resStr = nestedForLoop(n);
  print("\n双层 for 循环的结果 $resStr");
}
/**
 * File: binary_search_tree.dart
 * Created Time: 2023-04-04
 * Author: liuyuxin (gvenusleo@gmail.com)
 */

import '../utils/print_util.dart';
import '../utils/tree_node.dart';

/* 二叉搜索树 */
class BinarySearchTree {
  late TreeNode? _root;

  /* 构�


知识（20%）.htm">本国知识*（20%）
博物学*（20%）【专攻】
导航（10%）
地位*（00%）

动物驯养*（15%）
洞察*（05%）
读写能力*（01%）【专攻】
格斗（不同数值%）【专攻】

估价（05%）
话术（05%）
会计（10%）
急救（30%）

技艺（05%）【专攻】
<a


new Error(Ho(14))}function qre(){throw new Error(Ho(15))}function Ure(){throw new Error(Ho(16))}let NA=!1;function Hre(...e){return NA||(console.warn(["MUI: The `experimental_extendTheme` has been stabilized.","","You should use `import { extendTheme } from '@mui/material/styles'`"].join(`
`)),NA=!0),KM(...e)}function Vre(){throw new Error(Ho(19))}const Gre=Object.freeze(Object.defineProperty({__proto__:null,CssVarsProvider:uz,Experimental_CssVarsProvider:zre,StyledEngineProvider:dte,THEME_ID:Di,ThemeProvider:cz,adaptV4Theme:ure,alpha:ar,createColorScheme:az,createMuiTheme:Cre,createStyles:Rre,createTheme:Sc,createTransitions:ez,css:hs,darken:Il,decomposeColor:Ll,duration:XM,easing:Jj,emphasize:jj,experimentalStyled:Dt,experimental_extendTheme:Hre,experimental_sx:Vre,extendTheme:KM,getContrastRatio:Fj,getInitColorSchemeScript:Bre,getLuminance:fy,getOverlayAlpha:gy,hexToRgb:Nj,hslToRgb:qM,keyframes:il,lighten:$l,makeStyles:Wre,private_createMixins:Qj,private_createTypography:YM,private_excludeVariablesFromRoot:iz,recomposeColor:sg,responsiveFontSizes:Fre,rgbToHex:Lne,shouldSkipGeneratingVar:oz,styled:Dt,unstable_createBreakpoints:AM,unstable_createMuiStrictModeTheme:Ere,unstable_getUnit:ZM,unstable_toUnitless:Xl,useColorScheme:QM,useTheme:pi,useThemeProps:Tr,withStyles:qre,withTheme:Ure},Symbol.toStringTag,{value:"Module"}));function Yre(e){return Se.jsx(fne,{...e,defaultTheme:bb,themeId:Di})}function JM(e){return function(n){return Se.jsx(Yre,{styles:typeof e=="function"?r=>e({theme:r,...n}):e})}}function Xre(){return FM}const Fn=Zne;function jn(e){return Kne(e)}function Kre(e){return gn("MuiSvgIcon",e)}fn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Zre=e=>{const{color:t,fontSize:n,classes:r}=e,l={root:["root",t!=="inherit"&&`color${Qt(t)}`,`fontSize${Qt(n)}`]};return vn(l,Kre,r)},Qre=Dt("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Qt(n.color)}`],t[`fontSize${Qt(n.fontSize)}`]]}})(Fn(({theme:e})=>{var t,n,r,l,i,o,a,s,u,c,d,f,p,h;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(l=(t=e.transitions)==null?void 0:t.create)==null?void 0:l.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:g=>!g.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{


			},
			VampireHunterQuest = {
				Rank = 41730,
				Door = 41731,
				BloodSkull = 41732,
			},
			TheMutatedPumpkin = {
				Skinned = 41733,
			},
		},
		U8_4 = { -- update 8.4 - Reserved Storages 41901 - 42145
			BloodBrothers = {
				QuestLine = 41901,
				Mission01 = 41902,
				-- unused GarlicBread = 41903,
				Mission02 = 41904,
				Cookies = {
					Serafin = 41905,
					Lisander = 41906,
					Ortheus = 41907,
					Maris = 41908,
					Armenius = 41909,
				},
				Mission03 = 41910,
				Mission04 = 41911,
				VengothAccess = 41912,
			},
			InServiceOfYalahar = {
				TheWayToYalahar = 41950,
				Questline = 41951,
				Mission01 = 41952,
				Mission02 = 41953,
				Mission03 = 41954,
				Mission04 = 41955,
				Mission05 = 41956,
				Mission06 = 41957,
				Mission07 = 41958,
				Mission08 = 41959,
				Mission09 = 41960,
				Mission10 = 41961,
				SewerPipe01 = 41962,
				SewerPipe02 = 41963,
				SewerPipe03 = 41964,
				SewerPipe04 = 41965,
				DiseasedDan = 41966,
				DiseasedBill = 41967,
				DiseasedFred = 41968,
				AlchemistFormula = 41969,
				BadSide = 41970,
				GoodSide = 41971,
				MrWestDoor = 41972,
				MrWestStatus = 41973,
				TamerinStatus = 41974,
				MorikSummon = 41975,
				QuaraState = 41976,
				QuaraSplasher = 41977,
				QuaraSharptooth = 41978,
				QuaraInky = 41979,
				MatrixState = 41980,
				SideDecision = 41981,
				MatrixReward = 41982,
				NotesPalimuth = 41983,
				NotesAzerus = 41984,
				DoorToAzerus = 41985,
				DoorToBog = 41986,
				DoorToLastFight = 41987,
				DoorToMatrix = 41988,
				DoorToQuara = 41989,
				DoorToReward = 41990,
				LastFight = 41991,
				WarGolemsMachine1 = 41992,
				WarGolemsMachine2 = 41993,
				SearoutesAroundYalahar = {
					TownsCounter = 41994,
					AbDendriel = 41995,
					Darashia = 41996,
					Venore = 41997,
					Ankrahmun = 41998,
					PortHope = 41999,
					Thais = 42000,
					LibertyBay = 42001,
					Carlin = 42002,
				},
			},
			TheHiddenCityOfBeregar = {
				DefaultStart = 42003,
				WayToBeregar = 42004,
				OreWagon = 42005,
				GoingDown = 42006,
				JusticeForAll = 42007,
				GearWheel = 42008,
				SweetAsChocolateCake = 42009,
				RoyalRescue = 42010,
				TheGoodGuard = 42011,
				PythiusTheRotten = 42012,
				DoorNorthMine = 42013,
				DoorWestMine = 42014,
				DoorSouthMine = 42015,
				BrownMushrooms = 42016,
				TunnellingGuide = 42017,
				CorpseGoldIngot = 42018,
				CorpseSmallTopazes = 42019,
				CorpseRustedArmor = 42020,
				PrisonCellKey = 42021,
				BPTheUndeathStare = 42022,
				FirewalkerBoots = 42023,
			},
			TopOfTheCity = {},


ter_fold_results[OUTER_TEST])

                for k in outer_fold_results[
                    OUTER_TRAIN
                ].keys():  # train keys are the same as valid and test keys
                    # Do not want to average std of different final runs in
                    # different outer folds
                    if k[-3:] == STD:
                        continue

                    # there may be different optimal losses for each outer
                    # fold, so we cannot always compute the average over
                    # K outer folds of the same loss this is not so
                    # problematic as one can always recover the average and
                    # standard loss values across outer folds when we
                    # have the same loss for all outer folds using
                    # a jupyter notebook
                    if "_loss" in k:
                        continue

                    outer_results = [
                        (outer_tr_results, TRAINING),
                        (outer_vl_results, VALIDATION),
                        (outer_ts_results, TEST),
                    ]

                    for results, set in outer_results:
                        set_results = np.array([res[k] for res in results])
                        assessment_results[f"{AVG}_{set}_{k}"] = (
                            set_results.mean()
                        )
                        assessment_results[f"{STD}_{set}_{k}"] = (
                            set_results.std()
                        )

        # Send telegram update
        if self.model_configs.telegram_config is not None:
            exp_name = os.path.basename(self.exp_path)
            telegram_msg = (
                f"Exp *{exp_name}* \n"
                f"Experiment has finished \n"
                f"Test score: avg "
                f'*{assessment_results[f"{AVG}_{TEST}_{MAIN_SCORE}"]:.4f}* '
                f"/ std"
                f' *{assessment_results[f"{STD}_{TEST}_{MAIN_SCORE}"]:.4f}*'
            )
            send_telegram_update(
                self.telegram_bot_token,
                self.telegram_bot_chat_ID,
                telegram_msg,
            )

        with open(
            osp.join(self._ASSESSMENT_FOLDER, self._ASSESSMENT_FILENAME), "w"
        ) as fp:
            json.dump(assessment_results, fp, sort_keys=False, indent=4)


Video>(searchDefinition, query, options);

				for await (const video of pager) {

					results.push(video);
				}
				return results;
			},
			/**
			 * Example of using the video search API to search for videos, then getting
			 * the details of each video
			 * @param query
			 * @param options
			 */
			async * detailsStream(query: VideoSearchOptions = {}, options: RevSearchOptions<SearchVideo> = {}): AsyncGenerator<SearchVideo & (VideoDetails | {error?: Error})> {
				const searchDefinition = {
					endpoint: '/api/v2/videos/search',
					totalKey: 'totalVideos',
					hitsKey: 'videos'
				};
				const pager = rev._scroll<SearchVideo>(searchDefinition, query, options);
				for await (const rawVideo of pager) {
					const out: SearchVideo & (VideoDetails | {error?: Error}) = rawVideo;
					try {
						const details = await videoAPI.details(rawVideo.id);
						Object.assign(out, details);
					} catch (error) {
						out.error = error;
					}
					yield out;
				}
			}
		};
		return videoAPI;
	}
	get user() {
		const rev = this;
		return {
			/**
			 * @description get the list of roles available in the system
			 * @type {() => Promise<Array<{ id: string, name: string, description: string }>>}
			 */
			async roles(): Promise<{ id: string, name: string, description: string}[]> {
				return rev.get('/api/v2/users/roles');
			},
			/**
			 * Create a new User in Rev
			 * @param user
			 * @returns the User ID of the created user
			 */
			async create(user: UserRequest): Promise<string> {
				const { userId } = await rev.post('/api/v2/users', user);
				return userId;
			},
            async details(userId: string) {
                return rev.get<User>(`/api/v2/users/${userId}`);
            },
			/**
			 */
			async getByUsername(username: string) {
				return rev.get<User>(`/api/v2/users/${username}`, { type: 'username' });
			},
			/**
			 */
			async getByEmail(email: string) {
				return rev.get<User>(`/api/v2/users/${email}`, { type: 'email' });
			},
			/**
			 * use PATCH API to add user to the specified group
			 * https://revdocs.vbrick.com/reference#edituserdetails
			 * @param {string} userId id of user in question
			 * @param {string} groupId
			 * @returns {Promise<void>}
			 */
			async addGroup(userId: string, groupId: string) {
				const operations = [
					{ op: 'add', path: '/GroupIds/-', value: groupId }
				];
				await rev.patch(`/api/v2/users/${userId}`, operations);
			},
			/**
			 * use PATCH API to add user to the specified group
			 * https://revdocs.vbrick.com/reference#edituserdetails
			 * @param {string} userId id of user in question
			 * @param {string} groupId
			 * @returns {Promise<void>}
			 */
			async removeGroup(userId: string, groupId: string) {
				const operations = [
					{ op: 'remove', path: '/GroupIds', value: groupId }
				];
				await rev.patch(`/api/v2/users/${userId}`, operations);
			},
			/**
			 * search for users based on text query. Leave blank to return all users.
			 *
			 * @param {string} [searchText]
			 * @param {RevSearchOptions<{Id: string, Name: string}>} [options]
			 */
			async search(searchText?: string, options: RevSearchOptions<SearchUser> = {}) {
				const searchDefinition = {
					endpoint: '/api/v2/search/access-entity'


lib/index.js";
import * as cryptocoinjs_secp256k1 from "./cryptocoinjs_secp256k1.js";
import noble_secp256k1 from "@bitcoinerlab/secp256k1";
import {
  fecdsa,
  fpoints,
  fprivates,
  fschnorrSign,
  fschnorrVerify,
  fschnorrTweak,
} from "./fixtures.js";

// import { loadAddon as _loadAddon } from "../lib/addon.js";
// function loadAddon(location) {
//   const path = new URL(location, import.meta.url).pathname;
//   return _loadAddon(path);
// }

const modules = [
  // {
  //   name: "tiny-secp256k1 (Rust addon, N-API, opt-level-3)",
  //   secp256k1: loadAddon("./opt-level-3.so"),
  // },
  {
    name: "tiny-secp256k1 (WASM)",
    secp256k1: tiny_secp256k1,
  },
  {
    name: "tiny-secp256k1 (ASM.JS)",
    secp256k1: tiny_secp256k1_asmjs,
  },
  {
    name: "tiny-secp256k1@1.1.6 (C++ addon, NAN/V8)",
    secp256k1: tiny_secp256k1_prev_native,
  },
  {
    name: "tiny-secp256k1@1.1.6 (elliptic)",
    secp256k1: tiny_secp256k1_prev_js,
  },
  {
    name: "secp256k1@4.0.2 (C++ addon, N-API)",
    secp256k1: cryptocoinjs_secp256k1.native,
  },
  {
    name: "secp256k1@4.0.2 (elliptic)",
    secp256k1: cryptocoinjs_secp256k1.js,
  },
  {
    name: "noble-secp256k1@1.1.2 (BigInt)",
    secp256k1: noble_secp256k1,
  },
];

const benchmarks = [
  {
    name: "isPoint",
    bench: createBenchmarkFn(fpoints.isPoint, (secp256k1, f) =>
      secp256k1.isPoint(f.P)
    ),
  },
  {
    name: "isPrivate",
    bench: createBenchmarkFn(fprivates.isPrivate, (secp256k1, f) =>
      secp256k1.isPrivate(f.d)
    ),
  },
  {
    name: "pointAdd",
    bench: createBenchmarkFn(fpoints.pointAdd, (secp256k1, f) =>
      secp256k1.pointAdd(f.P, f.Q)
    ),
  },
  {
    name: "pointAddScalar",
    bench: createBenchmarkFn(fpoints.pointAddScalar, (secp256k1, f) =>
      secp256k1.pointAddScalar(f.P, f.d)
    ),
  },
  {
    name: "pointCompress",
    bench: createBenchmarkFn(fpoints.pointCompress, (secp256k1, f) =>
      secp256k1.pointCompress(f.P)
    ),
  },
  {
    name: "pointFromScalar",
    bench: createBenchmarkFn(fpoints.pointFromScalar, (secp256k1, f) =>
      secp256k1.pointFromScalar(f.d)
    ),
  },
  {
    name: "pointMultiply",
    bench: createBenchmarkFn(fpoints.pointMultiply, (secp256k1, f) =>
      secp256k1.pointMultiply(f.P, f.d)
    ),
  },
  {
    name: "privateAdd",
    bench: createBenchmarkFn(fprivates.privateAdd, (secp256k1, f) =>
      secp256k1.privateAdd(f.d, f.tweak)
    ),
  },
  {
    name: "privateSub",
    bench: createBenchmarkFn(fprivates.privateSub, (secp256k1, f) =>
      secp256k1.privateSub(f.d, f.tweak)
    ),
  },
  {
    name: "privateNegate",
    // use data from privateSub
    bench: createBenchmarkFn(fprivates.privateSub, (secp256k1, f) =>
      secp256k1.privateNegate(f.d)
    ),
  },
  {
    name: "sign",
    bench: createBenchmarkFn(fecdsa, (secp


operties).forEach(key => {
      if (result.length > 1) {
        result += ", ";
      }
      result += `${JSON.stringify(key)}: ${toSource(properties[key])}`;
    });
    result += "}";

    return result;
  },

  [PlorthValueType.QUOTE]: (value: PlorthValue): string => {
    return `(${toString(value)})`;
  },

  [PlorthValueType.STRING]: (value: PlorthValue): string => {
    return JSON.stringify((value as PlorthString).value);
  }
};

export function toSource(value: PlorthValue | null): string {
  if (value) {
    const callback = toSourceCallbacks[value.type];

    return callback ? callback(value) : toString(value);
  }

  return "null";
}
import { DataNode, Almacen, NodoTree } from './../../interface/nodoTree';
import { Request, Response } from "express";
import db from "../../database";

const resultLimpio = (arbol: NodoTree[]) => {
    return arbol.map((dato) => {
        !dato.children && delete (dato.children);
        dato.children && resultLimpio(dato.children);
        return dato
    });
}

const childNodos = (nodo: Almacen, todos: Almacen[]) => {
    const hijos = todos.filter((dato) => dato.idPadre == nodo.idAlmacenes);

    let newNodo: NodoTree = {};
    let nodos: NodoTree[] = [];

    if (hijos.length == 0) {
        return null;
    }

    hijos.forEach((hijo) => {
        newNodo.data = hijo;
        newNodo.children = <NodoTree[]>childNodos(hijo, todos);
        nodos.push(newNodo);
        newNodo = {};

    });
    return nodos;
}

export const todosAlmacenesArbol = async (req: Request, resp: Response) => {

    let consulta = "SELECT * FROM adm_almacenes";
    let segundaParteConsulta = " ORDER BY idPadre, idAlmacenes";
    let idGerencia = req.params.idGerencia;

    if (idGerencia) { consulta += ` WHERE idGerencia = ${idGerencia}` + segundaParteConsulta }
    else { consulta += segundaParteConsulta }

    const todosBD: Almacen[] = await db.querySelect(consulta);

    const padres: Almacen[] = todosBD.filter((nodo) => nodo.idPadre == 0);
    const ramasYhojas: Almacen[] = todosBD.filter((nodo) => nodo.idPadre != 0);

    let resultado: DataNode = { "data": [] };
    let newNodoTree: NodoTree = {};

    padres.forEach((raiz) => {
        newNodoTree.data = raiz;
        newNodoTree.children = (<NodoTree[]>childNodos(raiz, ramasYhojas));
        resultado.data?.push(newNodoTree);
        newNodoTree = {};
    });
    return resp.status(201).json({ data: resultLimpio(<NodoTree[]>resultado.data) });
}import { Engine } from '../engine/Engine';

/**
 * The 'Filter' is class for creating collision filters.
 */
export class Filter {
    mask: number = 4294967295;
    category: number = 1;
    group: number = 0;
    private static group = 1;
    private static nonCollidingGroup = -1;

    /**
     * Creates a new filter.
     * @param mask
     * @param category
     * @param group
     */
    constructor (mask = 4294967295, category = 1, group = 0) {
        this.mask = mask;
        this.category = category;
        this.group = group;
    }

    /**
     * Returns true if the two given filters can collide.
     *


        return 0;
    }
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if (m_controlCounter == M4A_TRAK)
    { // trak
        if (specialIndexOf(data, "esds", len) > 0)
        {
            int esds = specialIndexOf(data, "esds", len); // Packaging/Encapsulation And Setup Data
            uint8_t *pos = data + esds;
            uint8_t len_of_OD = *(pos + 12); // length of this OD (which includes the next 2 tags)
            (void)len_of_OD;
            uint8_t len_of_ESD = *(pos + 20); // length of this Elementary Stream Descriptor
            (void)len_of_ESD;
            uint8_t audioType = *(pos + 21);

            if (audioType == 0x40)
            {
                AUDIO_INFO("AudioType: MPEG4 / Audio");
            } // ObjectTypeIndication
            else if (audioType == 0x66)
            {
                AUDIO_INFO("AudioType: MPEG2 / Audio");
            }
            else if (audioType == 0x69)
            {
                AUDIO_INFO("AudioType: MPEG2 / Audio Part 3");
            } // Backward Compatible Audio
            else if (audioType == 0x6B)
            {
                AUDIO_INFO("AudioType: MPEG1 / Audio");
            }
            else
            {
                AUDIO_INFO("unknown Audio Type %x", audioType);
            }

            uint8_t streamType = *(pos + 22);
            streamType = streamType >> 2; // 6 bits
            if (streamType != 5)
            {
                log_e("Streamtype is not audio!");
            }

            uint32_t maxBr = bigEndian(pos + 26, 4); // max bitrate
            AUDIO_INFO("max bitrate: %i", maxBr);

            uint32_t avrBr = bigEndian(pos + 30, 4); // avg bitrate
            AUDIO_INFO("avr bitrate: %i", avrBr);

            uint16_t ASC = bigEndian(pos + 39, 2);

            uint8_t objectType = ASC >> 11; // first 5 bits

            if (objectType == 1)
            {
                AUDIO_INFO("AudioObjectType: AAC Main");
            } // Audio Object Types
            else if (objectType == 2)
            {
                AUDIO_INFO("AudioObjectType: AAC Low Complexity");
            }
            else if (objectType == 3)
            {
                AUDIO_INFO("AudioObjectType: AAC Scalable Sample Rate");
            }
            else if (objectType == 4)
            {
                AUDIO_INFO("AudioObjectType: AAC Long Term Prediction");
            }
            else if (objectType == 5)
            {
                AUDIO_INFO("AudioObjectType: AAC Spectral Band Replication");
            }
            else if (objectType == 6)
            {
                AUDIO_INFO("AudioObjectType: AAC Scalable");
            }
            else
            {
                AUDIO_INFO("unknown Audio Type %x", audioType);
            }

            const uint32_t samplingFrequencies[13] = {
                96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350};
            uint8_t sRate = (ASC & 0x0600) >> 7; // next 4 bits Sampling Frequencies
            AUDIO_INFO("Sampling Frequency: %u", samplingFrequencies[sRate]);

            uint8_t chConfig = (ASC & 0x78) >> 3; // next 4 bits
            if (chConfig == 0)
                AUDIO_INFO("Channel Configurations: AOT Specifc Config");
            if (chConfig == 1)
                AUDIO_INFO("Channel Configurations: front-center");
            if (chConfig == 2)


using System.Collections.Generic;
using System.Linq;
using NHibernate.DomainModel.Northwind.Entities;
using NUnit.Framework;

namespace NHibernate.Test.Linq
{
    [TestFixture]
    public class QueryReuseTests : LinqTestCase
    {
        private IQueryable<User> _query;

        protected override void OnSetUp()
        {
            base.OnSetUp();

            _query = db.Users;
        }

        private void AssertQueryReuseable()
        {
            IList<User> users = _query.ToList();
            Assert.AreEqual(3, users.Count);
        }

        [Test]
        public void CanReuseAfterFirst()
        {
            var user = _query.First(u => u.Name == "rahien");

            Assert.IsNotNull(user);
            AssertQueryReuseable();
        }

        [Test]
        public void CanReuseAfterFirstOrDefault()
        {
            var user = _query.FirstOrDefault(u => u.Name == "rahien");

            Assert.IsNotNull(user);
            AssertQueryReuseable();
        }

        [Test]
        public void CanReuseAfterSingle()
        {
            var user = _query.Single(u => u.Name == "rahien");

            Assert.IsNotNull(user);
            AssertQueryReuseable();
        }

        [Test]
        public void CanReuseAfterSingleOrDefault()
        {
            User user = _query.SingleOrDefault(u => u.Name == "rahien");

            Assert.IsNotNull(user);
            AssertQueryReuseable();
        }

        [Test]
        public void CanReuseAfterAggregate()
        {
            User user = _query.Aggregate((u1, u2) => u1);

            Assert.IsNotNull(user);
            AssertQueryReuseable();
        }

        [Test]
        public void CanReuseAfterAverage()


Pledge Frequency", @"Show the pledge frequency option to the user.", 5, @"false", "69523CEB-F479-47A6-BAA7-B5A727C9BA46" );

            // Attribute for BlockType
            //   BlockType: Pledge Entry
            //   Category: Finance
            //   Attribute: Require Pledge Frequency
            RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "0455ECBD-D54D-4485-BF4D-F469048AE10F", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Require Pledge Frequency", "RequirePledgeFrequency", "Require Pledge Frequency", @"Require that a user select a specific pledge frequency (when pledge frequency is shown).", 6, @"false", "BF2696B5-B22A-4ECA-B49C-E12BD343470F" );

            // Attribute for BlockType
            //   BlockType: Pledge Entry
            //   Category: Finance
            //   Attribute: Save Button Text
            RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "0455ECBD-D54D-4485-BF4D-F469048AE10F", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Save Button Text", "SaveButtonText", "Save Button Text", @"The Text to shown on the Save button", 7, @"Save", "B4FFAE5E-C1A5-49EB-A332-AAB7B153BB0B" );

            // Attribute for BlockType
            //   BlockType: Pledge Entry
            //   Category: Finance
            //   Attribute: Note Message
            RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "0455ECBD-D54D-4485-BF4D-F469048AE10F", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Note Message", "NoteMessage", "Note Message", @"Message to show at the bottom of the create pledge block.", 8, @"Note: This commitment is a statement of intent and may be changed as your circumstances change.", "C070D2A7-750C-416A-99D2-F00AA7CA50C6" );

            // Attribute for BlockType
            //   BlockType: Pledge Entry
            //   Category: Finance
            //   Attribute: Receipt Text
            RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "0455ECBD-D54D-4485-BF4D-F469048AE10F", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Receipt Text", "ReceiptText", "Receipt Text", @"The text (or HTML) to display as the pledge receipt.  ", 9, @"
Thank You!

  {{Person.NickName}}, thank you for your commitment of ${{FinancialPledge.TotalAmount}} to {{Account.Name}}.  To make your commitment even easier, you might consider making a scheduled giving profile.

      Setup a Giving Profile
  ", "9A60B235-2D4D-4CE7-9BD7-9BBA98554A77" );

            // Attribute for BlockType
            //   BlockType: Pledge Entry
            //   Category: Finance
            //   Attribute: Confirmation Email Template
            RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "0455ECBD-D54D-4485-BF4D-F469048AE10F", "72ED40C7-4D64-4D60-9411-4FFB2B9E833E", "Confirmation Email Template", "ConfirmationEmailTemplate", "Confirmation Email Template", @"Email template to use after submitting a new pledge. Leave blank to not send an email.", 10, @"", "966D8BF5-5DA


'',	'',	'',	'',	'7022001',	'',	'',	'2',	'',	'洛基',	'Loki',	'',	'4',	'',	'4',	'',	'',	'',	'',	'',	'',	'',	'1022828',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'1022828',	'',	'然而那也是你让我做的梦。',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'7024003',	'',	'',	'2',	'',	'丝卡蒂',	'Skadi',	'',	'4',	'',	'4',	'',	'',	'',	'',	'',	'',	'',	'1022829',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'1022829',	'',	'是你将那种未来展示给我知道，现在你却要将它全部粉碎。',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'7024003',	'',	'',	'2',	'',	'丝卡蒂',	'Skadi',	'',	'4',	'',	'4',	'',	'',	'',	'',	'',	'',	'',	'1022830',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'1022830',	'',	'如今的它是个失控的战争机器，已经不是我们认识的维达尔了。',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'7022001',	'',	'',	'2',	'',	'洛基',	'Loki',	'',	'4',	'',	'4',	'',	'',	'',	'',	'',	'',	'',	'1022831',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'1022831',	'',	'不停止它的话，『诺斯』板块和地球，更严重点，整个碎星都会被波及。',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'7022001',	'',	'',	'2',	'',	'洛基',	'Loki',	'',	'4',	'',	'4',	'',	'',	'',	'',	'',	'',	'',	'1022832',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'1022832',	'',	'那么换作失控的是我或是其他人，你也下得了手吗？',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'7024003',	'',	'',	'2',	'',


(op) << 1) + 1] = m_r[(RR4(op) << 1) + 1];
	m_r[RD4(op) << 1] = m_r[RR4(op) << 1];
}

void avr8_base_device::op_muls(uint16_t op)
{
	const int16_t sd = (int8_t)m_r[16 + RD4(op)] * (int8_t)m_r[16 + RR4(op)];
	m_r[1] = (sd >> 8) & 0x00ff;
	m_r[0] = sd & 0x00ff;
	m_r[SREG] &= ~(SREG_MASK_C | SREG_MASK_Z);
	if (BIT(sd, 15))
		m_r[SREG] |= SREG_MASK_C;
	else if (sd == 0)
		m_r[SREG] |= SREG_MASK_Z;
}

void avr8_base_device::op_mulsu(uint16_t op)
{
	const int16_t sd = (int8_t)m_r[16 + RD3(op)] * (uint8_t)m_r[16 + RR3(op)];
	m_r[1] = (sd >> 8) & 0x00ff;
	m_r[0] = sd & 0x00ff;
	m_r[SREG] &= ~(SREG_MASK_C | SREG_MASK_Z);
	if (BIT(sd, 15))
		m_r[SREG] |= SREG_MASK_C;
	else if (sd == 0)
		m_r[SREG] |= SREG_MASK_Z;
}

void avr8_base_device::op_fmul(uint16_t op)
{
	const int16_t sd = ((uint8_t)m_r[16 + RD3(op)] * (uint8_t)m_r[16 + RR3(op)]) << 1;
	m_r[1] = (sd >> 8) & 0x00ff;
	m_r[0] = sd & 0x00ff;
	m_r[SREG] &= ~(SREG_MASK_C | SREG_MASK_Z);
	if (BIT(sd, 15))
		m_r[SREG] |= SREG_MASK_C;
	else if (sd == 0)
		m_r[SREG] |= SREG_MASK_Z;
}

void avr8_base_device::op_fmuls(uint16_t op)
{
	const int16_t sd = ((int8_t)m_r[16 + RD3(op)] * (int8_t)m_r[16 + RR3(op)]) << 1;
	m_r[1] = (sd >> 8) & 0x00ff;
	m_r[0] = sd & 0x00ff;
	m_r[SREG] &= ~(SREG_MASK_C | SREG_MASK_Z);
	if (BIT(sd, 15))
		m_r[SREG] |= SREG_MASK_C;
	else if (sd == 0)
		m_r[SREG] |= SREG_MASK_Z;
}

void avr8_base_device::op_fmulsu(uint16_t op)
{
	const int16_t sd = ((int8_t)m_r[16 + RD3(op)] * (uint8_t)m_r[16 + RR3(op)]) << 1;
	m_r[1] = (sd >> 8) & 0x00ff;
	m_r[0] = sd & 0x00ff;
	m_r[SREG] &= ~(SREG_MASK_C | SREG_MASK_Z);
	if (BIT(sd, 15))
		m_r[SREG] |= SREG_MASK_C;
	else if (sd == 0)
		m_r[SREG] |= SREG_MASK_Z;
}

void avr8_base_device::op_cpc(uint16_t op)
{
	const uint8_t rd = m_r[RD5(op)];
	const uint8_t rr = m_r[RR5(op)];
	const uint8_t c = m_r[SREG] & SREG_MASK_C;
	const uint32_t z = (m_r[SREG] & SREG_MASK_Z) ? (1 << 17


arentId = parentId == null ? null : parentId.trim();
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName == null ? null : shortName.trim();
    }

    public Integer getLevelType() {
        return levelType;
    }

    public void setLevelType(Integer levelType) {
        this.levelType = levelType;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode == null ? null : cityCode.trim();
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode == null ? null : zipCode.trim();
    }

    public String getMergerName() {
        return mergerName;
    }

    public void setMergerName(String mergerName) {
        this.mergerName = mergerName == null ? null : mergerName.trim();
    }

    public BigDecimal getPositionX() {
        return positionX;
    }

    public void setPositionX(BigDecimal positionX) {
        this.positionX = positionX;
    }

    public BigDecimal getPositionY() {
        return positionY;
    }

    public void setPositionY(BigDecimal positionY) {
        this.positionY = positionY;
    }

    public String getPinYin() {
        return pinYin;
    }

    public void setPinYin(String pinYin) {
        this.pinYin = pinYin == null ? null : pinYin.trim();
    }

    public List<CfAreas> getChildren() {
        return children;
    }

    public void setChildren(List<CfAreas> children) {
        this.children = children;
    }
}package com.cf.position.service.impl;

import com.cf.position.dao.mapper.CfAreasMapper;
import com.cf.position.domain.CfAreas;
import com.cf.position.domain.CfAreasExample;
import com.cf.position.service.CfAreasService;
import org.apache.commons.lang3.StringUtils;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 地区管理
 *
 * @ClassName CfAreasServiceImpl
 * @Author 隔壁小王子 981011512@qq.com
 * @Date 2020/4/25/025 8:22
 * @Version 1.0
 **/
@Service(version = "1.0.0", loadbalance = "roundrobin")
public class CfAreasServiceImpl implements CfAreasService {
    @Autowired
    private CfAreasMapper cfAreasMapper;

    @Override
    public List<CfAreas> selectAll(Boolean recursive) {

        List<CfAreas> cfAreas = null;
        if(!recursive){
            CfAreasExample cfAreasExample = new CfAreasExample();
            cfAreas = cfAreasMapper.selectByExample(cfAreasExample);
        }else{
            int maxLevelType = cfAreasMapper.getMaxLevelType();
            cfAreas = selectByLevelAndParentId(0, "0", maxLevelType, true);
        }
        return cfAreas;
    }

    @Override
    public List<CfAreas> selectByLevelAndParentId(Integer level, String parentId, Integer maxLevel, boolean loop) {
        CfAreasExample cfAreasExample = new CfAreasExample();
        CfAreasExample.Criteria criteria = cfAreasExample.createCriteria();
        criteria.andLevelTypeEqualTo(level);
        if(StringUtils.isNotEmpty(parentId)){
            criteria.andParentIdEqualTo(parentId);
        }
        List<CfAreas> cfAreas = cfAreasMapper.selectByExample(cfAreasExample);
        if(loop && cfAreas!=null && cfAreas.size()>0 &&


idData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.granite.builder.GraniteBuilderContext;
import org.granite.builder.properties.Gas3Template;
import org.granite.builder.properties.Gas3Transformer;
import org.granite.builder.properties.GraniteProperties;
import org.granite.builder.util.SWTUtil;
import org.granite.generator.TemplateUri;
import org.granite.generator.as3.DefaultAs3TypeFactory;
import org.granite.generator.as3.JavaAs3GroovyTransformer;
import org.granite.generator.as3.LCDSAs3TypeFactory;
import org.granite.generator.as3.reflect.JavaType.Kind;
import org.granite.generator.java.DefaultJavaTypeFactory;
import org.granite.generator.java.JavaGroovyTransformer;
import org.granite.generator.java.template.JavaTemplateUris;
import org.granite.generator.javafx.DefaultJavaFXTypeFactory;
import org.granite.generator.javafx.template.JavaFXTemplateUris;
import org.granite.generator.template.StandardTemplateUris;

/**
 * @author Franck WOLFF
 */
public class TemplatesPanel extends Composite {

	private final GraniteProperties properties;

	private Tree templatesTree = null;
	private boolean initialized = false;

	public TemplatesPanel(Composite parent, GraniteBuilderContext context) throws CoreException {
        super(parent, SWT.NONE);
        this.properties = context.getProperties();
        initializeComponents();
	}

	public Set<Gas3Template> getTemplates() {
		if (!initialized)
			return properties.getGas3().getTemplates();

		Set<Gas3Template> templates = new HashSet<Gas3Template>(templatesTree.getItemCount());
		for (TreeItem kindItem : templatesTree.getItems()) {
			StringBuilder sb = new StringBuilder();
			if (kindItem.getItemCount() > 0)
				sb.append((String)kindItem.getItem(0).getData());
			if (kindItem.getItemCount() > 1)
				sb.append(';').append((String)kindItem.getItem(1).getData());
			templates.add(new Gas3Template((Kind)kindItem.getData(), sb.toString()));
		}
		return templates;
	}

	@Override
	public Rectangle getClientArea() {
		initializeContent();
		return super.getClientArea();
	}

	private void initializeContent() {
		if (!initialized) {
			for (Kind kind : Kind.values()) {
				TreeItem kindItem = SWTUtil.addTreeItem(templatesTree, SWTUtil.IMG_TEMPLATE, kind.name(), null, null);
				kindItem.setData(kind);
				TemplateUri[] uris = properties.getGas3().getMatchingTemplateUris(kind);
				for (TemplateUri uri : uris) {
					TreeItem uriItem = SWTUtil.addTreeItem(kindItem, SWTUtil.IMG_FILE, uri.getUri() + (uri.isBase() ? " (base)" : ""), null, null);
					uriItem.setData(uri.getUri());
				}
				kindItem.setExpanded(true);
			}
			initialized = true;
		}
	}

	private void initializeComponents() {
        setLayout(new GridLayout(2, false));

        Label text = new Label(this, SWT.NONE);
        text.setText("Templates used for generation:");
        text.setLayoutData(SWTUtil.newGridData(SWT.NONE, 2));

        templatesTree = new Tree(this, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
        templatesTree.setLayoutData(new GridData(
            GridData.HORIZONTAL_ALIGN_FILL


 this method does NOTHING to this kind of events */
    public static void applyAttributesToDocument(StyledDocument doc, Object defaultval, AbstractStyleover over, int textsize) {
        if (over.styletype == null)
            return;

        SimpleAttributeSet set;
        int from = 0;
        Object value = defaultval;
        if (over != null)
            for (AbstractStyleover.Entry entry : over) {
                set = new SimpleAttributeSet();
                applyAtributesToSection(doc, over.styletype, value, from, entry.prev.position - from);
                from = entry.prev.position;
                if (entry.next == null)
                    value = entry.prev.value;
                else
                    value = entry.next.value;
            }
        applyAtributesToSection(doc, over.styletype, value, from, textsize - from);
    }

    /* This method is for characted based styles mostly, adapted to perform OK with alignment (paragraph based */
    private static void applyAtributesToSection(StyledDocument doc, Object type, Object value, int from, int length) {
        SimpleAttributeSet set = new SimpleAttributeSet();

        if (type == StyleConstants.Alignment) {
            if (value == Direction.TOPRIGHT || value == Direction.RIGHT || value == Direction.BOTTOMRIGHT)
                value = StyleConstants.ALIGN_RIGHT;
            else if (value == Direction.TOPLEFT || value == Direction.LEFT || value == Direction.BOTTOMLEFT)
                value = StyleConstants.ALIGN_LEFT;
            else
                value = StyleConstants.ALIGN_CENTER;

            if (from != 0)
                from++;    // Fix the offset by one error with the marking of the end of the paragraph
            set.addAttribute(type, value);
            doc.setParagraphAttributes(from, length, set, false);
        } else {
            if (type == StyleConstants.FontSize) value = scale((int) value);
            set.addAttribute(type, value);
            doc.setCharacterAttributes(from, length, set, false);
        }
    }

    public StyleoverEvent getEvent(int i) {
        Entry e = get(i);
        if (e.next != null)
            return e.next;
        return e.prev;
    }

    protected class Entry {

        StyleoverEvent prev = null;
        StyleoverEvent next = null;

        public Entry(Entry old) {
            prev = new StyleoverEvent(old.prev);
        }

        public Entry(StyleoverEvent p, StyleoverEvent n) {
            prev = p;
            next = n;
        }
    }
}
/*
 * (c) 2005-2025 by Panayotis Katsaloulis
 * SPDX-License-Identifier: AGPL-3.0-only
 * This file is part of Jubler.
 */

package  com.panayotis.jubler.media.preview;

import static com.panayotis.jubler.i18n.I18N.__;
import com.panayotis.jubler.media.MediaFile;

public class JAudioLoader extends javax.swing.JPanel {

    private MediaFile mfile;

    /**
     * Creates new form JAudioLoader
     */
    public JAudioLoader() {
        initComponents();
    }

    public void setValue(int value) {
        ProgressB.setValue(value);
    }

    public void setFilename(String fname) {
        FileL.setText(fname);
        validate();
    }

    public void updateMediaFile(MediaFile mfile) {
        this.mfile = mfile;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        ProgressB = new javax.swing.JProg


345_u128,
			93293564_u128,
			82_u128,
			183274469_u128,
		),
		(
			49_u64,
			94059_u128,
			81_u128,
			HDX,
			BSX_FARM,
			11126653978_u128,
			132_u64,
			1672829_u128,
			75841904_u128,
			1557_u128,
			214686711_u128,
		),
		(
			38_u64,
			14085_u128,
			266_u128,
			KSM,
			ACA_FARM,
			36115448964_u128,
			400000_u64,
			886865_u128,
			52402278_u128,
			2564373_u128,
			36167851242_u128,
		),
		(
			158_u64,
			762784_u128,
			129_u128,
			BSX,
			ACA_FARM,
			21814882774_u128,
			158_u64,
			789730_u128,
			86085676_u128,
			129_u128,
			86085676_u128,
		),
	];

	for (
		updated_at,
		total_shares_z,
		accumulated_rpz,
		reward_currency,
		id,
		rewards_left_to_distribute,
		now_period,
		reward_per_period,
		accumulated_rewards,
		expected_accumulated_rpz,
		expected_accumulated_rewards,
	) in testing_values.iter()
	{
		let yield_per_period = Permill::from_percent(50);
		let planned_yielding_periods = 100;
		let blocks_per_period = 0;
		let owner = ALICE;
		let incentivized_token = <PASSWORD>;
		let max_reward_per_period = 10_000_u128;

		let mut global_pool = GlobalPool::new(
			*id,
			*updated_at,
			*reward_currency,
			yield_per_period,
			planned_yielding_periods,
			blocks_per_period,
			owner,
			incentivized_token,
			max_reward_per_period,
		);

		global_pool.total_shares_z = *total_shares_z;
		global_pool.accumulated_rewards = *accumulated_rewards;
		global_pool.accumulated_rpz = *accumulated_rpz;
		global_pool.paid_accumulated_rewards = 10;

		let mut ext = new_test_ext();

		ext.execute_with(|| {
			let farm_account_id = LiquidityMining::pool_account_id(*id).unwrap();
			let _ = Tokens::transfer(
				Origin::signed(TREASURY),
				farm_account_id,
				*reward_currency,
				*rewards_left_to_distribute,
			);
			assert_eq!(
				Tokens::free_balance(*reward_currency, &farm_account_id),
				*rewards_left_to_distribute
			);

			LiquidityMining::update_global_pool(&mut global_pool, *now_period, *reward_per_period).unwrap();

			let mut expected_global_pool = GlobalPool::new(
				*id,
				*now_period,
				*reward_currency,
				yield_per_period,
				planned_yielding_periods,
				blocks_per_period,


DmgAdhocWifiMac> (apWifiNetDevice->GetMac ());
  Ptr<DmgAdhocWifiMac> staWifiMac = DynamicCast<DmgAdhocWifiMac> (staWifiNetDevice->GetMac ());
  apWifiMac->AddAntennaConfig (1, 1, staWifiMac->GetAddress ());
  staWifiMac->AddAntennaConfig (5, 1, apWifiMac->GetAddress ());
  apWifiMac->SteerAntennaToward (staWifiMac->GetAddress ());
  staWifiMac->SteerAntennaToward (apWifiMac->GetAddress ());
}

int
main (int argc, char *argv[])
{
  uint32_t payloadSize = 1472;                  /* Application payload size in bytes. */
  string msduAggSize = "max";                   /* The maximum aggregation size for A-MSDU in Bytes. */
  string mpduAggSize = "max";                   /* The maximum aggregation size for A-MPDU in Bytes. */
  string queueSize = "4000p";                   /* Wifi MAC Queue Size. */
  string standard = "ad";                       /* The WiGig standard being utilized (ad/ay). */
  uint32_t channel = 2;                         /* WiGig channel number. */
  bool enableRts = false;                       /* Flag to indicate if RTS/CTS handskahre is enabled or disabled. */
  uint32_t rtsThreshold = 0;                    /* RTS/CTS handshare threshold. */
  double simulationTime = 1;                    /* Simulation time in seconds per MCS. */

  /* Command line argument parser setup. */
  CommandLine cmd;
  cmd.AddValue ("payloadSize", "Application payload size in bytes", payloadSize);
  cmd.AddValue ("msduAggSize", "The maximum aggregation size for A-MSDU in Bytes", msduAggSize);
  cmd.AddValue ("mpduAggSize", "The maximum aggregation size for A-MPDU in Bytes", mpduAggSize);
  cmd.AddValue ("enableRts", "Enable or disable RTS/CTS handshake", enableRts);
  cmd.AddValue ("queueSize", "The maximum size of the Wifi MAC Queue", queueSize);
  cmd.AddValue ("standard", "The WiGig standard being utilized (ad/ay)", standard);
  cmd.AddValue ("channel", "WiGig channel number", channel);
  cmd.AddValue ("simulationTime", "Simulation time in Seconds per MCS", simulationTime);
  cmd.Parse (argc, argv);

  AsciiTraceHelper ascii;       /* ASCII Helper. */
  Ptr<OutputStreamWrapper> outputFile = ascii.CreateFileStream ("AchievableThroughputTable.csv");
  *outputFile->GetStream () << "MCS,THROUGHPUT" << std::endl;

  /* Validate WiGig standard value */
  WifiPhyStandard wifiStandard = WIFI_PHY_STANDARD_80211ad;
  string wifiModePrefix;
  uint modes = 1;          /* The number of PHY modes we have. */
  uint maxMcs = 24;        /* The maximum MCS index. */
  if (standard == "ad")
    {
      wifiStandard = WIFI_PHY_STANDARD_80211ad;
      wifiModePrefix = "DMG_MCS";
    }
  else if (standard == "ay")
    {
      wifiStandard = WIFI_PHY_STANDARD_80211ay;
      modes = 2;
      wifiModePrefix = "EDMG_SC_MCS";
    }
  else
    {
      NS_FATAL_ERROR ("Wrong WiGig standard");
    }

  /* Validate A-MSDU and A-MPDU values */
  ValidateFrameAggregationAttributes (msduAggSize, mpduAggSize, wifiStandard);
  /* Configure RTS/CTS and Fragmentation */
  ConfigureRtsCtsAndFragmenatation (enableRts, rtsThreshold);
  /* Wifi MAC Queue Parameters */
  ChangeQueueSize (queueSize);

  for (uint mode = 1; mode <= modes; mode++)
    {
      if (standard == "ay" && mode == 1)
        {
          wifiModePrefix = "EDMG_SC_MCS";
          maxMcs = 21;
        }
      else if (standard == "ay" && mode == 2)
        {
          wifiModePrefix = "EDMG_OFDM_MCS";
          max


0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Qn0 qO0 16n0 Rb0 1wp0 TX0 rlB0 7B0 8zb0 uL0|","America/Argentina/Mendoza|CMT -04 -03 -02|4g.M 40 30 20|01212121212121212121212121212121212121212123232312121321232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1u20 SL0 1vd0 Tb0 1wp0 TW0 ri10 Op0 7TX0 uL0|","America/Argentina/Rio_Gallegos|CMT -04 -03 -02|4g.M 40 30 20|01212121212121212121212121212121212121212123232323232321232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 rlB0 7B0 8zb0 uL0|","America/Argentina/Salta|CMT -04 -03 -02|4g.M 40 30 20|012121212121212121212121212121212121212121232323231323232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 A4p0 uL0|","America/Argentina/San_Juan|CMT -04 -03 -02|4g.M 40 30 20|012121212121212121212121212121212121212121232323231232321232|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10


# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for config.py.

Run command:
```
python -m data_creation.config_test
```
"""

from absl.testing import absltest

# pylint: disable=g-bad-import-order
from data_creation import config
# pylint: enable=g-bad-import-order

_ACCEPTED_MODELS = (
    'gpt_4_turbo',
    'gpt_4',
    'gpt_4_32k',
    'gpt_35_turbo',
    'gpt_35_turbo_16k',
    'claude_3_opus',
    'claude_3_sonnet',
    'claude_21',
    'claude_20',
    'claude_instant',
)
_ACCEPTED_SUBTASKS = ('longfact_concepts', 'longfact_objects')

class ConfigTest(absltest.TestCase):

  def test_model_settings(self) -> None:
    self.assertIsInstance(config.generator_model, str)
    self.assertIn(config.generator_model, _ACCEPTED_MODELS)
    self.assertIsInstance(config.generation_temp, float)
    self.assertGreaterEqual(config.generation_temp, 0.0)

  def test_debug_settings(self) -> None:
    self.assertIsInstance(config.generate_data_debug, bool)
    self.assertIsInstance(config.show_generator_prompts, bool)
    self.assertIsInstance(config.show_generator_responses, bool)
    self.assertFalse(
        config.generate_data_debug
        and not config.show_generator_prompts
        and not config.show_generator_responses
    )  # Don't uselessly turn on the debug mode

  def test_data_generation_settings(self) -> None:
    self.assertIsInstance(config.subtask, str)
    self.assertIn(config.subtask, _ACCEPTED_SUBTASKS)
    self.assertIsInstance(config.num_prompts_to_generate, int)
    self.assertGreater(config.num_prompts_to_generate, 0)
    self.assertIsInstance(config.max_in_context_examples, int)
    self.assertGreaterEqual(config.max_in_context_examples, 0)
    self.assertIsInstance(config.save_results, bool)

  def test_forced_settings(self) -> None:
    self.assertIsInstance(config.generator_shorthand, str)
    self.assertNotEmpty(config.generator_shorthand)
    self.assertIsInstance(config.generator, str)
    self.assertNotEmpty(config.generator)

if __name__ == '__main__':
  absltest.main()


tial_definitions_fix_cred_def_wallet_record,
            ),
        ]
    )

def post_process_routes(app: web.Application):
    """Amend swagger API."""
    # Add top-level tags description
    if "tags" not in app._state["swagger_dict"]:
        app._state["swagger_dict"]["tags"] = []
    app._state["swagger_dict"]["tags"].append(
        {
            "name": "credential-definition",
            "description": "Credential definition operations",
            "externalDocs": {
                "description": "Specification",
                "url": (
                    "https://github.com/hyperledger/indy-node/blob/main/"
                    "design/anoncreds.md#cred_def"
                ),
            },
        }
    )


ES_LTD, true
	case 221:
		return BACnetVendorId_OPEN_GENERAL_PTY_LTD, true
	case 222:
		return BACnetVendorId_WAGO_KONTAKTTECHNIK_GMBH_COKG, true
	case 223:
		return BACnetVendorId_FRANKLIN_ELECTRIC, true
	case 224:
		return BACnetVendorId_CHLORIDE_POWER_PROTECTION_COMPANY, true
	case 225:
		return BACnetVendorId_COMPUTROLS_INC, true
	case 226:
		return BACnetVendorId_PHOENIX_CONTACT_GMBH_COKG, true
	case 227:
		return BACnetVendorId_GRUNDFOS_MANAGEMENTAS, true
	case 228:
		return BACnetVendorId_RIDDER_DRIVE_SYSTEMS, true
	case 229:
		return BACnetVendorId_SOFT_DEVICESDNBHD, true
	case 23:
		return BACnetVendorId_YORK_CONTROLS_GROUP, true
	case 230:
		return BACnetVendorId_INTEGRATED_CONTROL_TECHNOLOGY_LIMITED, true
	case 231:
		return BACnetVendorId_AI_RXPERT_SYSTEMS_INC, true
	case 232:
		return BACnetVendorId_MICROTROL_LIMITED, true
	case 233:
		return BACnetVendorId_RED_LION_CONTROLS, true
	case 234:
		return BACnetVendorId_DIGITAL_ELECTRONICS_CORPORATION, true
	case 235:
		return BACnetVendorId_ENNOVATIS_GMBH, true
	case 236:
		return BACnetVendorId_SEROTONIN_SOFTWARE_TECHNOLOGIES_INC, true
	case 237:
		return BACnetVendorId_LS_INDUSTRIAL_SYSTEMS_CO_LTD, true
	case 238:
		return BACnetVendorId_SQUARED_COMPANY, true
	case 239:
		return BACnetVendorId_S_SQUARED_INNOVATIONS_INC, true
	case 24:
		return BACnetVendorId_AUTOMATED_LOGIC_CORPORATION, true
	case 240:
		return BACnetVendorId_ARICENT_LTD, true
	case 241:
		return BACnetVendorId_ETHER_METRICSLLC, true
	case 242:
		return BACnetVendorId_INDUSTRIAL_CONTROL_COMMUNICATIONS_INC, true
	case 243:
		return BACnetVendorId_PARAGON_CONTROLS_INC, true
	case 244:
		return BACnetVendorId_AO_SMITH_CORPORATION, true
	case 245:
		return BACnetVendorId_CONTEMPORARY_CONTROL_SYSTEMS_INC, true
	case 246:
		return BACnetVendorId_HMS_INDUSTRIAL_NETWORKSSLU, true
	case 247:
		return BACnetVendorId_INGENIEURGESELLSCHAFTN_HARTLEBMBH, true
	case 248:
		return BACnetVendorId_HEAT_TIMER_CORPORATION, true
	case 249:
		return BACnetVendorId_INGRASYS_TECHNOLOGY_INC, true
	case 25:
		return BACnetVendorId_CSI_CONTROL_SYSTEMS_INTERNATIONAL, true
	case 250:
		return BACnetVendorId_COSTERM_BUILDING_AUTOMATION, true
	case 251:
		return BACnetVendorId_WILOSE, true
	case 252:
		return BACnetVendorId_EMBEDIA_TECHNOLOGIES_CORP, true
	case 253:
		return BACnetVendorId_TECHNILOG, true
	case 254


calar startPtX = GetObject<scalar>();
    scalar startPtY = GetObject<scalar>();
    scalar endPtX = GetObject<scalar>();
    scalar endPtY = GetObject<scalar>();
    Point startPt { startPtX, startPtY };
    Point endPt { endPtX, endPtY };
    PaintHandle paintHandle;
    paintHandle.isAntiAlias = GetObject<bool>();
    paintHandle.blenderEnabled = GetObject<bool>();
    paintHandle.width = GetObject<scalar>();
    paintHandle.miterLimit = GetObject<scalar>();
    DrawLineOpItem::ConstructorHandle constructorHandle = DrawLineOpItem::ConstructorHandle(
        startPt, endPt, paintHandle);
    DrawLineOpItem drawLineOpItem = DrawLineOpItem(*drawCmdList, &constructorHandle);
    drawLineOpItem.Marshalling(*drawCmdList);
    DrawLineOpItem::Unmarshalling(*drawCmdList, &constructorHandle);
    std::string out;
    drawLineOpItem.DumpItems(out);
    if (dataText != nullptr) {
        delete [] dataText;
        dataText = nullptr;
    }
    return true;
}

bool DrawCmdFuzzTest016(const uint8_t* data, size_t size)
{
    if (data == nullptr) {
        return false;
    }

    scalar startPtX = GetObject<scalar>();
    scalar startPtY = GetObject<scalar>();
    scalar endPtX = GetObject<scalar>();
    scalar endPtY = GetObject<scalar>();
    Point startPt { startPtX, startPtY };
    Point endPt { endPtX, endPtY };
    uint32_t alpha = GetObject<uint32_t>();
    uint32_t red = GetObject<uint32_t>();
    uint32_t blue = GetObject<uint32_t>();
    uint32_t green = GetObject<uint32_t>();
    Color color = Color(red, green, blue, alpha);
    Paint paint = Paint(color);
    DrawLineOpItem drawLineOpItem = DrawLineOpItem(startPt, endPt, paint);
    int32_t width = GetObject<int32_t>();
    int32_t height = GetObject<int32_t>();
    Canvas canvas = Canvas(width, height);
    Rect rect { GetObject<float>(), GetObject<float>(), GetObject<float>(), GetObject<float>() };
    drawLineOpItem.Playback(&canvas, &rect);
    return true;
}

bool DrawCmdFuzzTest017(const uint8_t* data, size_t size)
{
    if (data == nullptr) {
        return false;
    }

    size_t length = GetObject<size_t>() % MAX_SIZE + 1;
    char* dataText = new char[length];
    for (size_t i = 0; i < length; i++) {
        dataText[i] = GetObject<char>();
    }
    std::pair<const void*, size_t> cmdListData;
    cmdListData.first = static_cast<const void*>(dataText);
    cmdListData.second = length;
    bool isCopy = GetObject<bool>();
    static std::shared_ptr<DrawCmdList> drawCmdList = DrawCmdList::CreateFromData(cmdListData, isCopy);
    Rect rect { GetObject<float>(), GetObject<float>(), GetObject<float>(), GetObject<float>() };
    PaintHandle paintHandle;
    paintHandle.isAntiAlias = GetObject<bool>();
    paintHandle.blenderEnabled = GetObject<bool>();
    paintHandle.width = GetObject<scalar>();
    paintHandle.miterLimit = GetObject<scalar>();
    DrawRectOpItem::ConstructorHandle constructorHandle = DrawRectOpItem::ConstructorHandle(rect, paintHandle);
    DrawRectOpItem drawRectOpItem = DrawRectOpItem(*drawCmdList, &constructorHandle);
    drawRectOpItem.Marshalling(*drawCmdList);
    DrawRectOpItem::Unmarshalling(*drawCmdList, &constructorHandle);