 StorePlugin _storePlugin;

  PointAwardEvent(this._storePlugin) {
    _initializeEventHandlers();
  }

  /// 获取事件对应的积分值
  int _getPointsForEvent(String eventName) {
    return _storePlugin.pointAwardSettings[eventName] ?? 0;
  }

  /// 初始化事件处理器
  void _initializeEventHandlers() {
    final eventManager = EventManager.instance;

    // 监听活动添加事件
    eventManager.subscribe('activity_added', _handleActivityAdded);

    // 监听签到完成事件
    eventManager.subscribe('checkin_completed', _handleCheckinCompleted);

    // 监听任务完成事件
    eventManager.subscribe('task_completed', _handleTaskCompleted);

    // 监听笔记添加事件
    eventManager.subscribe('note_added', _handleNoteAdded);

    // 监听物品添加事件
    eventManager.subscribe('goods_item_added', _handleGoodsAdded);

    // 监听消息发送事件
    eventManager.subscribe('onMessageSent', _handleMessageSent);

    // 监听记录添加事件
    eventManager.subscribe('onRecordAdded', _handleRecordAdded);

    // 监听日记添加事件
    eventManager.subscribe('diary_entry_created', _handleDiaryAdded);

    eventManager.subscribe('bill_added', _handleBillAdded);

  }

  /// 处理活动添加事件
  Future<void> _handleActivityAdded(EventArgs args) async {
    await _awardPoints(_getPointsForEvent('activity_added'), '添加活动奖励');
  }

  /// 处理签到完成事件
  Future<void> _handleCheckinCompleted(EventArgs args) async {
    await _awardPoints(_getPointsForEvent('checkin_completed'), '签到完成奖励');
  }

  /// 处理任务完成事件
  Future<void> _handleTaskCompleted(EventArgs args) async {
    await _awardPoints(_getPointsForEvent('task_completed'), '完成任务奖励');
  }

  /// 处理笔记添加事件
  Future<void> _handleNoteAdded(EventArgs args) async {
    await _awardPoints(_getPointsForEvent('note_added'), '添加笔记奖励');
  }

  /// 处理物品添加事件
  Future<void> _handleGoodsAdded(EventArgs args) async {
    await _awardPoints(_getPointsForEvent('goods_added'), '添加物品奖励');
  }

  /// 处理消息发送事件
  Future<void> _handleMessageSent(EventArgs args) async {
    await _awardPoints(_getPointsForEvent('onMessageSent'), '发送消息奖励');
  }

  /// 处理记录添加事件
  Future<void> _handleRecordAdded(EventArgs args) async {
    await _awardPoints(_getPointsForEvent('onRecordAdded'), '添加记录奖励');
  }

  /// 处理日记添加事件
  Future<void> _handleDiaryAdded(EventArgs args) async {
    await _awardPoints(_getPointsForEvent('onDiaryAdded'), '添加日记奖励');
  }

  Future<void> _handleBillAdded(EventArgs args) async {
    await _awardPoints(_getPointsForEvent('bill_added'), '添加账单奖励');
  }

  /// 添加积分
  Future<void> _awardPoints(int points, String reason) async {
    if (points > 0) {
      await _storePlugin.controller.addPoints(points, reason);
    }
  }

  /// 清理事件订阅
  void dispose() {
    final eventManager = EventManager.instance;
    eventManager.unsubscribe('activity_added', _handleActivityAdded);
    eventManager.unsubscribe('checkin_completed', _handleCheckinCompleted);
    eventManager.unsubscribe('task_completed', _handleTaskCompleted);
    eventManager.unsubscribe('note_added', _handleNoteAdded);
    eventManager.unsubscribe('goods_item_added', _handleGoodsAdded);
    eventManager.unsubscribe('onMessageSent', _handleMessageSent);
    eventManager.unsubscribe('onRecordAdded', _handleRecordAdded);
    eventManager.unsubscribe('diary_entry_created', _handleDiaryAdded);
    eventManager.unsubscribe('bill_added', _handleDiaryAdded);
  }
}import 'dart:io';
import 'package:Memento/plugins/goods/widgets/goods_item_form/index.dart';
import 'package:Memento/plugins/store/l10n/store_localizations.dart';
import 'package:flutter/material.dart';
import '../models/product.dart';
import 'package:Memento/l10n


r : ContentProvider() {
    var dirty = false
        set(value) {
            if (!field && value) {
                (context?.applicationContext as? MyApplication)?.markDataDirty()
            }
            field = value
        }

    fun maybeSetDirty(uriMatch: Int) {
        if (uriMatch != EVENT_CACHE) {
            dirty = true
        }
    }

    @Volatile
    private var _helper: SupportSQLiteOpenHelper? = null

    val helper: SupportSQLiteOpenHelper
        get() = _helper
            ?: synchronized(this) {
                if (_helper == null) {
                    _helper = openHelperProvider.get()
                }
                return _helper!!
            }

    @Inject
    @Named(AppComponent.DATABASE_NAME)
    @JvmSuppressWildcards
    lateinit var provideDatabaseName: (Boolean) -> String

    @Inject
    @Named(AppComponent.UI_SETTINGS_DATASTORE_NAME)
    lateinit var uiSettingsDataStoreName: String

    @Inject
    lateinit var prefHandler: PrefHandler

    @Inject
    lateinit var currencyContext: CurrencyContext

    @Inject
    lateinit var dataStore: DataStore<Preferences>

    @Inject
    lateinit var openHelperProvider: Provider<SupportSQLiteOpenHelper>

    val collate: String
        get() = prefHandler.collate

    val wrappedContext: Context
        get() = with(context!!) {
            (applicationContext as? MyApplication)?.wrapContext(this) ?: this
        }

    private var shouldLog = false

    var bulkInProgress = false

    private val bulkNotificationUris = mutableSetOf<Pair<Uri, Boolean>>()

    fun notifyAccountChange() {
        notifyChange(TransactionProvider.ACCOUNTS_BASE_URI, false)
        notifyChange(TransactionProvider.ACCOUNTS_MINIMAL_URI, false)
    }

    fun notifyChange(uri: Uri, syncToNetwork: Boolean) {
        if (!bulkInProgress && callerIsNotInBulkOperation(uri)) {
            notifyChangeDo(uri, syncToNetwork)
        } else {
            synchronized(bulkNotificationUris) {
                bulkNotificationUris.add(uri to syncToNetwork)
            }
        }
    }

    private fun notifyChangeDo(uri: Uri, syncToNetwork: Boolean) {
        context!!.contentResolver.notifyChange(
            uri, null,
            syncToNetwork && prefHandler.getBoolean(PrefKey.SYNC_CHANGES_IMMEDIATELY, true)
        )
    }

    fun notifyBulk() {
        synchronized(bulkNotificationUris) {
            val iterator = bulkNotificationUris.iterator()
            for ((uri, syncToNetwork) in iterator) {
                notifyChangeDo(uri, syncToNetwork)
                iterator.remove()
            }
        }
    }

    fun callerIsNotSyncAdapter(uri: Uri): Boolean {
        return !uri.getBooleanQueryParameter(
            TransactionProvider.QUERY_PARAMETER_CALLER_IS_SYNCADAPTER,
            false
        )
    }

    fun callerIsNotInBulkOperation(uri: Uri): Boolean {
        return !uri.getBooleanQueryParameter(QUERY_PARAMETER_CALLER_IS_IN_BULK, false)
    }

    /**
     * @param transactionId When we edit a transaction, we want it to not be included into the debt sum, since it can be changed in the UI, and the variable amount will be calculated by the UI
     */
    fun debtProjection(transactionId: String?, withSum: Boolean): Array<String> {
        val exclusionClause = transactionId?.let {
            "AND $KEY_ROWID != $it"
        } ?: ""

        return listOfNotNull(
            "


Ped, 110) == true and PedGetPedToTypeAttitude(ScenarioPed, 13) == 2 and PedIsDead(gPlayer) == false and MissionActive() == false and F_PlayerSleptOnErrand() == false and bTimedOut == false and ObjectiveMet == false and shared.gBusTransition == nil and OutOfRange == false then
        return true
    else
        if bTimedOut then
            PedSetTaskNode(ScenarioPed, "/Global/AI/GeneralObjectives/POIPoint/Scenario/ScenarioSeek/ScenarioOpen/ScenarioWait/ScenarioDialog/ScenarioAccepted/ScenarioOptions/ScenarioObjective/WaitForObjective/ObjectiveOptions/ObjCompleted/ObjScenarioEnd", "Act/AI/AI.act")
        end
        if bActive and not ObjectiveMet and not F_PedIsDead(gPlayer) and shared.gBusTransition == nil then


BytecodeIndex(map.getBytecodeIndexForMCOffset(instr));
      browser.setCompiledMethod(this);
      browser.setMethod(MemberReference.getMethodRef(mid).peekResolvedMethod());

      if (VM.TraceStackTrace) {
        VM.sysWrite("setting stack to frame (opt): ");
        VM.sysWrite(browser.getMethod());
        VM.sysWrite(browser.getBytecodeIndex());
        VM.sysWriteln();
      }
    } else {
      if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED);
    }
  }

  @Override
  @Interruptible
  public boolean up(StackBrowser browser) {
    OptMachineCodeMap map = getMCMap();
    int iei = browser.getInlineEncodingIndex();
    int[] ie = map.inlineEncoding;
    int next = OptEncodedCallSiteTree.getParent(iei, ie);
    if (next >= 0) {
      int mid = OptEncodedCallSiteTree.getMethodID(next, ie);
      int bci = OptEncodedCallSiteTree.getByteCodeOffset(iei, ie);

      browser.setInlineEncodingIndex(next);
      browser.setBytecodeIndex(bci);
      browser.setMethod(MemberReference.getMethodRef(mid).peekResolvedMethod());

      if (VM.TraceStackTrace) {
        VM.sysWrite("up within frame stack (opt): ");
        VM.sysWrite(browser.getMethod());
        VM.sysWrite(browser.getBytecodeIndex());
        VM.sysWriteln();
      }

      return true;
    } else {
      return false;
    }
  }

  @Override
  @Interruptible
  public void printStackTrace(Offset instructionOffset, PrintLN out) {
    OptMachineCodeMap map = getMCMap();
    int iei = map.getInlineEncodingForMCOffset(instructionOffset);
    if (iei >= 0) {
      int[] inlineEncoding = map.inlineEncoding;
      int bci = map.getBytecodeIndexForMCOffset(instructionOffset);
      for (int j = iei; j >= 0; j = OptEncodedCallSiteTree.getParent(j, inlineEncoding)) {
        int mid = OptEncodedCallSiteTree.getMethodID(j, inlineEncoding);
        NormalMethod m =
            (NormalMethod) MemberReference.getMethodRef(mid).peekResolvedMethod();
        int lineNumber = m.getLineNumberForBCIndex(bci); // might be 0 if unavailable.
        out.print("\tat ");
        out.print(m.getDeclaringClass());
        out.print('.');
        out.print(m.getName());
        out.print('(');
        out.print(m.getDeclaringClass().getSourceName());
        out.print(':');
        out.print(lineNumber);
        out.print(')');
        out.println();
        if (j > 0) {
          bci = OptEncodedCallSiteTree.getByteCodeOffset(j, inlineEncoding);
        }
      }
    } else {
      out.print("\tat ");
      out.print(method.getDeclaringClass());
      out.print('.');
      out.print(method.getName());
      out.print('(');
      out.print(method.getDeclaringClass().getSourceName());
      out.print("; machine code offset: ");
      out.printHex(instructionOffset.toInt());
      out.print(')');
      out.println();
    }
  }

  @Override
  @Interruptible
  public int size() {
    int size = TypeReference.ExceptionTable.peekType().asClass().getInstanceSize();
    size += _mcMap.size();
    if (eTable != null) size += RVMArray.IntArray.getInstanceSize(eTable.length);
    if (patchMap != null) size += RVMArray.IntArray.getInstanceSize(patchMap.length);
    return size;
  }

  //----------------//
  // implementation //
  //----------------//
  priva


"
            "fmax.b %1, ft4, ft4\n"
            : "+f"(fcmp0), "+f"(fcmp1));

        asm volatile(
            "feq.b %0, %2, ft3\n"
            "feq.b %1, %3, ft4\n"
            : "+r"(cmp0), "+r"(cmp1), "+f"(fcmp0), "+f"(fcmp1));

        errs -= (cmp0 == 0x1);
        errs -= (cmp1 == 0x1);

        asm volatile(
            "fmax.b %0, ft5, ft5\n"
            "fmax.b %1, ft6, ft6\n"
            : "+f"(fcmp0), "+f"(fcmp1));

        asm volatile(
            "feq.b %0, %2, ft5\n"
            "feq.b %1, %3, ft6\n"
            : "+r"(cmp0), "+r"(cmp1), "+f"(fcmp0), "+f"(fcmp1));

        errs -= (cmp0 == 0x1);
        errs -= (cmp1 == 0x1);

        asm volatile(
            "fmax.b %0, ft3, ft4\n"
            "fmax.b %1, ft4, ft5\n"
            : "+f"(fcmp0), "+f"(fcmp1));

        asm volatile(
            "feq.b %0, %2, ft3\n"
            "feq.b %1, %3, ft5\n"
            : "+r"(cmp0), "+r"(cmp1), "+f"(fcmp0), "+f"(fcmp1));

        errs -= (cmp0 == 0x1);
        errs -= (cmp1 == 0x1);

        asm volatile(
            "fmax.b %0, ft5, ft6\n"
            "fmax.b %1, ft3, ft6\n"
            : "+f"(fcmp0), "+f"(fcmp1));

        asm volatile(
            "feq.b %0, %2, ft5\n"
            "feq.b %1, %3, ft3\n"
            : "+r"(cmp0), "+r"(cmp1), "+f"(fcmp0), "+f"(fcmp1));

        errs -= (cmp0 == 0x1);
        errs -= (cmp1 == 0x1);
    }

    return errs;
}


 #8
	add r0, #0xb5
	mov r5, #2
	strb r1, [r0]
	b _021EB990
_021EB940:
	add r0, r4, #0
	mov r1, #5
	add r0, #0xb5
	strb r1, [r0]
	b _021EB990
_021EB94A:
	ldr r0, [sp, #0xc]
	bl ov96_021E5EE8
	cmp r0, #0
	beq _021EB95E
	ldr r0, [sp, #0xc]
	bl ov96_021EE54C
	cmp r0, #0
	beq _021EB990
_021EB95E:
	add r0, r4, #0
	bl ov96_021EC2E0
	cmp r0, #0
	beq _021EB978
	add r0, r4, #0
	add r0, #0x88
	ldr r0, [r0]
	bl Heap_Free
	ldr r0, [r4, #8]
	bl SysTask_Destroy
_021EB978:
	ldr r0, [r4, #0xc]
	bl ov96_021EE944
	ldr r0, [sp, #0xc]
	mov r1, #2
	bl ov96_021E5FC8
	add sp, #0x14
	mov r0, #0
	pop {r4, r5, r6, r7, pc}
_021EB98C:
	bl GF_AssertFail
_021EB990:
	mov r0, #0
	mvn r0, r0
	cmp r5, r0
	beq _021EB9AE
	ldr r0, [r4, #0xc]
	add r1, r5, #0
	bl ov96_021EE8CC
	add r0, r4, #0
	add r0, #0xb7
	ldrb r0, [r0]
	add r1, r0, #1
	add r0, r4, #0
	add r0, #0xb7
	strb r1, [r0]
_021EB9AE:
	add r0, r4, #0
	add r0, #0xb0
	ldrb r0, [r0]
	cmp r0, #0
	beq _021EBA86
	add r0, r4, #0
	add r0, #0xb2
	ldrb r1, [r0]
	add r2, r4, #0
	add r2, #0x94
	lsl r0, r1, #1
	add r0, r1, r0
	lsl r0, r0, #0x18
	lsr r6, r0, #0x18
	add r0, r4, #0
	ldr r2, [r2]
	add r0, #0x94
	ldr r1, [r0]
	add r3, r2, #1
	add r2, r4, #0
	add r0, r4, #0
	add r2, #0x94
	add r0, #0x94
	str r3, [r2]
	cmp r1, #0
	bne _021EBA08
	mov r5, #0
_021EB9E4:
	lsl r1, r6, #0x18
	ldr r0, [r4, #0x14]
	lsr r1, r1, #0x18
	bl ov96_021EAA04
	add r7, r0, #0
	mov r1, #2
	bl ov96_021EAC0C
	add r0, r7, #0
	mov r1, #0x10
	bl ov96_021EAC5C
	add r5, r5, #1
	add r6, r6, #1
	cmp r5, #3
	blt _


<summary>
        /// This command is similar to ZDIFFSTORE, but instead of storing the resulting sorted set, it is returned to the client.
        /// <para>Available since: 6.2.0</para>
        /// <para>此命令类似于 ZDIFFSTORE, 但不是转存结果, 而是将结果返回</para>
        /// <para>支持此命令的Redis版本, 6.2.0+</para>
        /// </summary>
        /// <param name="key1">SortedSet key1</param>
        /// <param name="key2">SortedSet key2</param>
        /// <param name="cancellationToken">Propagates notification that operations should be canceled. The valid value overrides the system Token
        /// <para>取消Token, 有效值会覆盖系统默认的</para>
        /// </param>
        /// <returns>Set of difference set members
        /// <para>差集元素的集合</para>
        /// </returns>
#if NET5_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
        public Task<MemberScoreValue<string>[]?> ZDiffWithScoresAsync(string key1, string key2, CancellationToken cancellationToken = default)
#else
        public Task<MemberScoreValue<string>[]> ZDiffWithScoresAsync(string key1, string key2, CancellationToken cancellationToken = default)
#endif
        {
            return base._call.CallStructArrayAsync<MemberScoreValue<string>>(SortedSetCommands.ZDiff(true, key1, key2), ResultType.Array | ResultType.MemberScoreValue | ResultType.String, cancellationToken);
        }

        /// <summary>
        /// This command is similar to ZDIFFSTORE, but instead of storing the resulting sorted set, it is returned to the client.
        /// <para>Available since: 6.2.0</para>
        /// <para>此命令类似于 ZDIFFSTORE, 但不是转存结果, 而是将结果返回</para>
        /// <para>支持此命令的Redis版本, 6.2.0+</para>
        /// </summary>
        /// <param name="keys">keys</param>
        /// <param name="cancellationToken">Propagates notification that operations should be canceled. The valid value overrides the system Token
        /// <para>取消Token, 有效值会覆盖系统默认的</para>
        /// </param>
        /// <returns>Set of difference set members
        /// <para>差集元素的集合</para>
        /// </returns>
#if NET5_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
        public Task<MemberScoreValue<string>[]?> ZDiffWithScoresAsync(string[] keys, CancellationToken cancellationToken = default)
#else
        public Task<MemberScoreValue<string>[]> ZDiffWithScoresAsync(string[] keys, CancellationToken cancellationToken = default)
#endif
        {
            return base._call.CallStructArrayAsync<MemberScoreValue<string>>(SortedSetCommands.ZDiff(true, keys), ResultType.Array | ResultType.MemberScoreValue | ResultType.String, cancellationToken)
#if NET5_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
            !
#endif
            ;
        }

        /// <summary>
        /// This command is similar to ZDIFFSTORE, but instead of storing the resulting sorted set, it is returned to the client.
        /// <para>Available since: 6.2.0</para>
        /// <para>此命令类似于 ZDIFFSTORE, 但不是转存结果, 而是将结果返回</para>
        /// <para>支持此命令的Redis版本, 6.2.0+</para>
        /// </summary>
        /// <param name="key">SortedSet key</param>
        /// <param name="keys">keys


l it using your package manager. For example, on Ubuntu:\n       ```bash\n       sudo apt-get install suricata\n       ```\n     - Alternatively, you can download and compile Suricata from source available on its official website or GitHub repository.\n\n   - **Windows:**\n     - Suricata also supports Windows, and you can download the installer from the official Suricata website or GitHub releases page. Follow the installation instructions provided with the installer.\n\n2. **Configuration:**\n   - Once installed, the main configuration file for Suricata is typically located at `/etc/suricata/suricata.yaml` on Linux systems. This file allows you to configure interfaces to monitor, rulesets to use, logging options, and more.\n   - Customize the configuration based on your network environment and security requirements. Ensure to review and modify the rulesets (`suricata.rules`) to match your organization's policies and threat landscape.\n\n3. **Starting Suricata:**\n   - On Linux, you can start Suricata using:\n     ```bash\n     sudo suricata -c /etc/suricata/suricata.yaml -i eth0\n     ```\n     Replace `eth0` with the network interface you want Suricata to monitor.\n   - On Windows, launch Suricata using the installed application or command line, depending on your installation method.\n\n4. **Monitoring and Alerts:**\n   - Suricata monitors network traffic in real-time based on the configured rules and signatures.\n   - When suspicious activity is detected, Suricata generates alerts that can be logged to files (`eve.json`, `fast.log`, etc.) and/or sent to a SIEM or logging system for further analysis.\n   - Review the generated alerts regularly to investigate potential security incidents and take appropriate action.\n\n5. **Advanced Features:**\n   - Suricata supports various advanced features such as multi-threading for high performance, protocol decoding, file extraction, TLS/SSL decryption (with proper setup), and more.\n   - Explore additional plugins and integrations available for Suricata to extend its functionality and customize it according to your specific security needs.\n\n6. **Community and Support:**\n   - Join the Suricata community forums, mailing lists, or GitHub repository for discussions, updates, and support from other users and developers.\n   - Regularly update Suricata to the latest stable version to benefit from new features, bug fixes, and security updates.\n\nBy following these steps, you can get started with Suricata and leverage its capabilities to enhance the security monitoring of your network infrastructure. Adjust the configuration and rulesets over time based on your experience and evolving security requirements."]}, "status": "finished_successfully", "end_turn": true, "weight": 1.0, "metadata": {"citations": [], "gizmo_id": null, "finish_details": {"type": "stop", "stop_tokens": [100260]}, "is_complete": true, "message_type": null, "model_slug": "text-davinci-002-render-sha", "default_model_slug": "auto", "model_adjustments": ["auto:smaller_model:reached_message_cap"], "pad": "AAAAAAAAAAAAAAAAAAAA", "parent_id": "aaa2fdb8-a266-4736-bc4f-c36c7d56ed0c", "request_id": "894a7fff9cad4eb6-JNB", "timestamp_": "absolute"}, "recipient": "all", "channel": null}, "parent": "aaa2fdb8-a266-4736-bc4f-c36c7d56ed0c", "children": ["aaa2ed68-b601-47f5-893f-3013b422bc0b"]}, "aaa2ed68-b601-47f5-893f-3013b422bc0b": {"id": "aaa2ed68-b601-47f5-893f-3013b422bc0b", "message":


 */
export class RouteSectionParser implements IRouteEntryParser {
    static parsers: { [key: string]: IRouteEntryParser } = {};

    public linesToJSON(scopedLine: ScopedLine, filename: string): EntryJSON {
        let entry = new EntryJSON(scopedLine.type);
        let [title, ...summary] = scopedLine.untypedLine.split("::");
        entry.info = { title: title.trim(), summary: summary.join("::").trim(), description: "" };
        entry.entries = scopedLine.scope ? this.parseLinesScopeToJSON(scopedLine.scope, filename) : [];
        // TODO: Message if empty section? If so, when?
        return entry;
    }

    public parseLinesScopeToJSON(scope: ScopedLine[], filename: string): EntryJSON[] {
        let entries: EntryJSON[] = [];
        scope.forEach(scopedLine => {
            let parser = RouteSectionParser.parsers[scopedLine.type.toUpperCase()];
            if (!parser) {
                parser = new RouteDirectionsParser();
            }
            entries.push(parser.linesToJSON(scopedLine, filename));
        });
        return entries;
    }

    public jsonToLines(jsonEntry: EntryJSON): ScopedLine {
        let scopedLine = new ScopedLine();
        if (jsonEntry.info) {
            if (jsonEntry.info.title) {
                scopedLine.line = Route.RouteSection.ENTRY_TYPE + ": " + jsonEntry.info.title + (jsonEntry.info.summary ? " :: " + jsonEntry.info.summary : "");
                scopedLine.scope = this.parseJSONScopeToLines(jsonEntry.entries ? jsonEntry.entries : []);
            } else {
                // TODO
            }
        }
        return scopedLine;
    }

    public parseJSONScopeToLines(jsonEntries: EntryJSON[] = []) {
        let lines: ScopedLine[] = [];
        jsonEntries.forEach(jsonEntry => {
            let parser = RouteSectionParser.parsers[jsonEntry.type.toUpperCase()];
            if (!parser) {
                parser = new RouteDirectionsParser();
            }
            lines.push(parser.jsonToLines(jsonEntry));
        });
        return lines;
    }
}

RouteSectionParser.parsers[Route.RouteBattle.ENTRY_TYPE.toUpperCase()] = new RouteBattleParser();
RouteSectionParser.parsers[Route.RouteDirections.ENTRY_TYPE.toUpperCase()] = new RouteDirectionsParser();
RouteSectionParser.parsers[Route.RouteEncounter.ENTRY_TYPE.toUpperCase()] = new RouteEncounterParser();
RouteSectionParser.parsers[Route.RouteEntry.ENTRY_TYPE.toUpperCase()] = new RouteEntryParser();
RouteSectionParser.parsers[Route.RouteManip.ENTRY_TYPE.toUpperCase()] = new RouteManipParser();
RouteSectionParser.parsers[Route.RouteGetItem.ENTRY_TYPE.toUpperCase()] = new RouteGetItemParser();
RouteSectionParser.parsers[Route.RouteGetPokemon.ENTRY_TYPE.toUpperCase()] = new RouteGetPokemonParser();
RouteSectionParser.parsers[Route.RouteSection.ENTRY_TYPE.toUpperCase()] = new RouteSectionParser();
RouteSectionParser.parsers[Route.RouteMenu.ENTRY_TYPE.toUpperCase()] = new RouteMenuParser();
RouteSectionParser.parsers[Route.RouteShop.ENTRY_TYPE.toUpperCase()]


ые или создают ли несколько аккаунтов для обмана.
* Сбор доказательств переписок - В случае споров или конфликтов важна история сообщений, которую можно попытаться сохранить или проверить.
* Мониторинг публичных каналов и ботов - Через анализ публикаций и подписчиков находят полезные сведения или подтверждения информации.

## Юридический дисклеймер и условия использования
Внимание! Представленные в данном материале инструменты и методы, такие как Пробив Телеграм, техники OSINT Телеграм и способы поиска информации в Телеграм, предназначены исключительно для образовательных целей и повышения осведомлённости о рисках цифровой приватности.

Использование этих методов разрешается только для анализа собственных данных или при получении явного согласия владельцев аккаунтов.

Несанкционированный сбор, обработка и распространение чужих персональных данных через Пробив Телеграм могут нарушать законодательство о защите конфиденциальности и персональных данных (включая статью 137 УК РФ, Закон «О персональных данных» и аналогичные нормативы в других странах).

Авторы и администрация ресурса не несут ответственности за возможные нарушения закона, допущенные с применением описанных сервисов OSINT Телеграм или Пробива Телеграм.

Вся информация предоставляется «как есть» и служит исключительно для повышения уровня цифровой грамотности и понимания угроз приватности.

[Вернуться к каталогу OSINT-инструментов](https://github.com/OSINT-searcher/probiv_i_OSINT_instrumenti)
## [Unreleased]

### Publish `encrypted-datastore` as KMP library

As `security-crypto-datastore` artifacts are [going to be deprecated](https://github.com/osipxd/encrypted-datastore/issues/31),
`encrypted-datastore` artifacts are published as a KMP library.
It has only two targets yet: JVM and Android.
This change was made to use the same dependency for JVM and Android projects
and to prepare the library for possible support for iOS target in the future.

### Dependencies

- Kotlin `1.9.23` → `2.0.20`
- [Tink](https://github.com/tink-crypto/tink-java/releases/tag/v1.15.0) `1.13.0` → `1.15.0`

### Housekeeping

- Compile against Android SDK 35
- Update dependencies in sample project
- Drop usage of


.font or MenuSettings.fonts.menu_font.font
	local font_material = layout_settings.font and layout_settings.font.material or MenuSettings.fonts.menu_font.material
	local c = layout_settings.text_color
	local color = Color(c[1], c[2], c[3], c[4])
	local text_x = self._x + self._width / 2 - self._text_width / 2
	local text_y = self._y + (layout_settings.text_offset_y or 0)

	ScriptGUI.text(gui, self._text, font, layout_settings.font_size, font_material, Vector3(math.floor(text_x), math.floor(text_y), self._z + 1), color)

	local marker_x = text_x + self._marker_offset_x - layout_settings.marker_width / 2
	local marker_y = self._y + (layout_settings.marker_offset_y or 0)
	local marker_alpha = 100 * math.cos(t * 8) + 155
	local marker_color = Color(marker_alpha, 255, 255, 255)

	Gui.rect(gui, Vector3(math.floor(marker_x), math.floor(marker_y), self._z + 1), Vector2(math.floor(layout_settings.marker_width), math.floor(layout_settings.marker_height)), marker_color)

	if layout_settings.texture_background then
		local x = self._x + self._width / 2 - layout_settings.texture_background_width / 2
		local y = self._y + (layout_settings.texture_offset_y or 0)

		Gui.bitmap(gui, layout_settings.texture_background, Vector3(math.floor(x), math.floor(y), self._z), Vector2(layout_settings.texture_background_width, layout_settings.texture_background_height))
	end
end

function TextInputMenuItem.create_from_config(compiler_data, config, callback_object)
	local config = {
		type = "text_input",
		page = config.page,
		name = config.name,
		disabled = config.disabled,
		disabled_func = config.disabled_func and callback(callback_object, config.disabled_func, config.disabled_func_args),
		callback_object = callback_object,
		on_select = config.on_select,
		on_select_args = config.on_select_args or {},
		on_highlight = config.on_highlight,
		on_highlight_args = config.on_highlight_args or {},
		on_enter_text = config.on_enter_text,
		on_enter_text_args = config.on_enter_text_args or {},
		min_text_length = config.min_text_length or 0,
		max_text_length = config.max_text_length or math.huge,
		toggle_selection = config.toggle_selection,
		layout_settings = config.layout_settings,
		parent_page = config.parent_page,
		sounds = config.parent_page.config.sounds.items.text_input
	}

	return TextInputMenuItem:new(config, compiler_data.world)
end


esolutionByLambdaReturnType
public inline fun <T, reified R> DataColumn<T>.medianOfOrNull(
    skipNaN: Boolean = skipNaNDefault,
    crossinline expression: (T) -> R,
): Double?
    where R : Comparable<R & Any>?, R : Number? =
    Aggregators.medianNumbers<R>(skipNaN).aggregateOf(this, expression)

// endregion

// region DataRow

@Deprecated(ROW_MEDIAN_OR_NULL, level = DeprecationLevel.ERROR)
public fun AnyRow.rowMedianOrNull(): Nothing? = error(ROW_MEDIAN_OR_NULL)

@Deprecated(ROW_MEDIAN, level = DeprecationLevel.ERROR)
public fun AnyRow.rowMedian(): Nothing = error(ROW_MEDIAN)

public inline fun <reified T : Comparable<T>> AnyRow.rowMedianOfOrNull(): T? =
    Aggregators.medianComparables<T>().aggregateOfRow(this) { colsOf<T?>() }

public inline fun <reified T : Comparable<T>> AnyRow.rowMedianOf(): T =
    rowMedianOfOrNull<T>().suggestIfNull("rowMedianOf")

public inline fun <reified T> AnyRow.rowMedianOfOrNull(
    skipNaN: Boolean = skipNaNDefault,
): Double?
    where T : Comparable<T>, T : Number =
    Aggregators.medianNumbers<T>(skipNaN).aggregateOfRow(this) { colsOf<T?>() }

public inline fun <reified T> AnyRow.rowMedianOf(
    skipNaN: Boolean = skipNaNDefault,
): Double
    where T : Comparable<T>, T : Number = rowMedianOfOrNull<T>(skipNaN).suggestIfNull("rowMedianOf")

// endregion

// region DataFrame
@Refine
@Interpretable("Median0")
public fun <T> DataFrame<T>.median(skipNaN: Boolean = skipNaNDefault): DataRow<T> =
    medianFor(skipNaN, intraComparableColumns())

@Refine
@Interpretable("Median1")
public fun <T, C : Comparable<*>?> DataFrame<T>.medianFor(
    skipNaN: Boolean = skipNaNDefault,
    columns: ColumnsForAggregateSelector<T, C>,
): DataRow<T> = Aggregators.median.invoke(skipNaN).aggregateFor(this, columns)

public fun <T> DataFrame<T>.medianFor(vararg columns: String, skipNaN: Boolean = skipNaNDefault): DataRow<T> =
    medianFor(skipNaN) { columns.toComparableColumns() }

@Deprecated(DEPRECATED_ACCESS_API)
@AccessApiOverload
public fun <T, C : Comparable<*>?> DataFrame<T>.medianFor(
    vararg columns: ColumnReference<C>,
    skipNaN: Boolean = skipNaNDefault,
): DataRow<T> = medianFor(skipNaN) { columns.toColumnSet() }

@Deprecated(DEPRECATED_ACCESS_API)
@AccessApiOverload
public fun <T, C : Comparable<*>?> DataFrame<T>.medianFor(
    vararg columns: KProperty<C>,
    skipNaN: Boolean = skipNaNDefault,
): DataRow<T> = medianFor(skipNaN) { columns.toColumnSet() }

// TODO, requires explicit type C due to https://youtrack.jetbrains.com/issue/KT-76683
@OverloadResolutionByLambdaReturnType
public fun <T, C : Comparable<C & Any>?> DataFrame<T>.median(columns: ColumnsSelector<T, C>): C & Any =
    medianOrNull(columns).suggestIfNull("median")

// TODO, requires explicit type C due to https://youtrack.jetbrains.com/issue/KT-76683
@OverloadResolutionByLambdaReturnType
@Suppress("UNCHECKED_CAST")
public fun <T, C : Comparable<C & Any>?> DataFrame<T>.medianOrNull(columns: ColumnsSelector<T, C>): C? =
    Aggregators.medianComparables<C>().aggregateAll(this, columns)

@OverloadResolutionByLambdaReturnType
public


= map_symlinks(cats, paths)
    for src, dst in syms:
        webm_src = unicode(os.path.join(webm_root, src))
        webm_dst = unicode(os.path.join(symlink_root, dst)) + u".webm"
        directory = os.path.split(webm_dst)[0]
        if not os.path.exists(directory):
            os.makedirs(directory)
        if os.path.exists(webm_dst):
            os.remove(webm_dst)
        print webm_src.encode('utf-8'), " -> ", webm_dst.encode('utf-8')
        os.symlink(webm_src.encode('utf-8'), webm_dst.encode('utf-8'))
        h264_src = os.path.join(h264_root, os.path.splitext(src)[0] + ".m4v")
        h264_dst = os.path.join(symlink_root, dst + ".m4v")
        if os.path.exists(h264_dst):
            os.remove(h264_dst)
        print h264_src.encode('utf-8'), " -> ", h264_dst.encode('utf-8')
        assert(os.path.exists(h264_src.encode('utf-8')))
        os.symlink(h264_src.encode('utf-8'), h264_dst.encode('utf-8'))


.isEndOfCurrentList) {
      rlpInput.readList<Any>(Withdrawal::readFrom)
    }

    rlpInput.leaveList()
    return Block(header, BlockBody(transactions, ommers))
  }
}
package net.consensys.zkevm

import io.vertx.core.Vertx
import org.apache.logging.log4j.Logger
import tech.pegasys.teku.infrastructure.async.SafeFuture

abstract class PeriodicPollingService(
  private val vertx: Vertx,
  private val pollingIntervalMs: Long,
  private val log: Logger,
) : LongRunningService {
  private var timerId: Long? = null

  init {
    require(pollingIntervalMs > 0) {
      "pollingIntervalMs must be greater than 0"
    }
  }
  abstract fun action(): SafeFuture<*>
  open fun handleError(error: Throwable) {
    log.error("Error with period polling service: errorMessage={}", error.message, error)
  }

  @Synchronized
  override fun start(): SafeFuture<Unit> {
    if (timerId == null) {
      timerId = vertx.setTimer(pollingIntervalMs, this::actionHandler)
    }
    return SafeFuture.completedFuture(Unit)
  }

  @Synchronized
  override fun stop(): SafeFuture<Unit> {
    if (timerId != null) {
      vertx.cancelTimer(timerId!!)
      timerId = null
    } else {
      log.info("Service is not running to stop it!")
    }
    return SafeFuture.completedFuture(Unit)
  }

  @Suppress("UNUSED_PARAMETER")
  private fun actionHandler(_timerId: Long) {
    try {
      action()
        .whenComplete { _, error ->
          error?.let(::handleError)
          if (timerId != null) {
            timerId = vertx.setTimer(pollingIntervalMs, this::actionHandler)
          }
        }
    } catch (e: Exception) {
      handleError(e)
      if (timerId != null) {
        timerId = vertx.setTimer(pollingIntervalMs, this::actionHandler)
      }
    }
  }
}
package linea.domain

import linea.kotlin.encodeHex

data class EthLog(
  val removed: Boolean,
  val logIndex: ULong,
  val transactionIndex: ULong,
  val transactionHash: ByteArray,
  val blockHash: ByteArray,
  val blockNumber: ULong,
  val address: ByteArray,
  val data: ByteArray,
  val topics: List<ByteArray>,
) {
  override fun equals(other: Any?): Boolean {
    if (this === other) return true
    if (javaClass != other?.javaClass) return false

    other as EthLog

    if (removed != other.removed) return false
    if (logIndex != other.logIndex) return false
    if (transactionIndex != other.transactionIndex) return false
    if (!transactionHash.contentEquals(other.transactionHash)) return false
    if (!blockHash.contentEquals(other.blockHash)) return false
    if (blockNumber != other.blockNumber) return false
    if (!address.contentEquals(other.address)) return false
    if (!data.contentEquals(other.data)) return false
    if (topics.size != other.topics.size || !topics.zip(other.topics).all { (a, b) -> a.contentEquals(b) }) return false

    return true
  }

  override fun hashCode(): Int {
    var result = removed.hashCode()
    result = 31 * result + logIndex.hashCode()
    result = 31 * result + transactionIndex.hashCode()
    result = 31 * result + transactionHash.contentHashCode()
    result = 31 * result + blockHash.contentHashCode()
    result = 31 * result + blockNumber.hashCode()
    result = 31 * result + address.contentHashCode()
    result = 31 * result + data.cont


w) end
            if self.periodics.next_tanks_req <= time_now then _request_tanks(time_now) end
        end

        self.session.post_update()
    end

    -- invalidate build cache
    function public.invalidate_cache()
        self.periodics.next_formed_req = 0
        self.periodics.next_build_req = 0
        self.has_build = false
    end

    -- get the unit session database
    ---@nodiscard
    function public.get_db() return self.db end

    return public
end

return turbinev


alledTimes(3);
    expect(mock.mock.calls[1][0]).toMatch('update `my_entity` set `audit1_archived` = ?, `audit1_updated` = ?, `audit1_nested_audit1_updated` = ?, `audit2` = ? where `id` = ?');
    mock.mockReset();

    const tmp2 = line.audit2.archived = new Date();
    await orm.em.flush();
    expect(mock).toBeCalledTimes(3);
    expect(mock.mock.calls[1][0]).toMatch('update `my_entity` set `audit2` = ?, `audit1_updated` = ?, `audit1_nested_audit1_updated` = ? where `id` = ?');
    mock.mockReset();

    const tmp3 = line.audit2.nestedAudit1.archived = new Date();
    await orm.em.flush();
    expect(mock).toBeCalledTimes(3);
    expect(mock.mock.calls[1][0]).toMatch('update `my_entity` set `audit2` = ?, `audit1_updated` = ?, `audit1_nested_audit1_updated` = ? where `id` = ?');
    mock.mockRestore();

    const line2 = await orm.em.fork().findOneOrFail(MyEntity, line.id);
    expect(line2.audit1.archived).toEqual(tmp1);
    expect(line2.audit2.archived).toEqual(tmp2);
    expect(line2.audit2.nestedAudit1.archived).toEqual(tmp3);
  });

});
import Flyable from './Flyable'

interface Vehicle {
  ammoStorage: number
  maximumAmmo: number
  refill?(): number
}

class Truck implements Vehicle {
  ammoStorage: number
  maximumAmmo: number

  constructor(ammo: number, max: number) {
    this.ammoStorage = ammo
    this.maximumAmmo = max
  }
}

abstract class Aircraft implements Flyable, Vehicle {
  ammoStorage: number
  maximumAmmo: number
  damage: number

  constructor(ammoStorage: number, damage: number) {
    this.ammoStorage = ammoStorage
    this.damage = damage
  }

  refill(): number {
    return null
  }

  fight(): void {
    //
  }

  abstract isPriority(): boolean
}

class F16 extends Aircraft {
  isPriority() {
    return false
  }
}

class Carrier {
  aircraftStorage: Flyable[]
  constructor() {
    this.aircraftStorage = []
  }
  addNewAircraft(newAircraft: Flyable): void {
    this.aircraftStorage.push(newAircraft)
  }
}

let truck = new Truck(3, 3)
console.log(truck)
let f16 = new F16(3, 3)
console.log(f16)
import {
	SortDirection,
	OrderLevel,
	OrderLevelSimple,
	FeedData,
	createOrderLevels,
	updateOrderLevels,
	createDepthLevels,
} from "../../../components/feed/feed";

describe("create order levels", () => {
	test("create order levels - sort ascending", () => {
		const priceLevels: [number, number][] = [
			[4500, 1],
			[2500, 2],
			[1000, 3],
			[3800, 4],
		];
		const expected: OrderLevelSimple[] = [
			{ price: 1000, size: 3 },
			{ price: 2500, size: 2 },
			{ price: 3800, size: 4 },
			{ price: 4500, size: 1 },
		];
		const actual = createOrderLevels(priceLevels, SortDirection.ASC);
		expect(actual).toEqual(expected);
	});

	test("create order levels - sort descending", () => {
		const priceLevels: [number, number][] = [
			[150, 1],
			[40, 4],
			[280, 2],
			[300, 3


,"")
    local FilePath = reaper.GetProjectPathEx(0,"").."/"..WaveName
          FilePath = FilePath:gsub("\\","/")
    --------------------
    local FP_i = FilePath
    for i=1, 100 do
       if reaper.file_exists(FP_i..".wav") then FP_i = FilePath .."-"..i
          else FilePath = FP_i..".wav" break
       end
    end
  return FilePath, Type, Freq, Gain, duration
end

-------------------------------------------------------------------------------------------------------------------------
-- Start ----------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------

audioFormat = 3
nchans = 1
srate = 44100
bitspersample = 32
----------------
----------------
Init()
mainloop()


      }else{
            //绘制精灵.
            svg.append('image').attr('id','pegman').attr('width', actor.width ).attr('height',  actor.height).attr('clip-path', 'url(#pegmanClipPath)')
            .attr('xlink:href',actor.img)
        }

        displayPegman(actor.x , actor.y , actor.direction*4 )
    }

    var drawMap=function(){
        svg.attr('id','game_stage')
        var scale = Math.max(maze_ROWS, maze_COLS) * maze_SQUARE_SIZE;
        svg.attr('viewBox', '0 -10 ' + scale + ' ' + (scale+10));

        // 绘制外框
        svg.append('rect').attr('x', 0).attr('y', 0).attr('width', maze.MAZE_WIDTH).attr('height', maze.MAZE_HEIGHT)
        .style('fill','#F1EEE7').style('stroke','#CCB').style('stroke-width','1');

        for (var y = 0; y < maze_ROWS; y++) {
            for (var x = 0; x < maze_COLS; x++) {
                //绘制迷宫背景
                svg.append('image').attr('x', x*maze_SQUARE_SIZE).attr('y', y*maze_SQUARE_SIZE).attr('width', maze_SQUARE_SIZE).attr('height',maze_SQUARE_SIZE)
                .attr('xlink:href',maze.background)
            }
        }
        // svg.append('image').attr('x', 0).attr('y', 0).attr('width', maze_SQUARE_SIZE*maze_COLS).attr('height',maze_SQUARE_SIZE*maze_ROWS)
        // .attr('xlink:href',maze.background)
        //初始化地图

        var normalize = function(x, y) {
            if (x < 0 || x >= maze_COLS || y < 0 || y >= maze_ROWS) {
              return '0';
            }
            return ((map[y][x] == maze.SquareType.WALL)||(map[y][x] == maze.SquareType.OIL_STATION)) ? '0' : '1';
        };
        // 依次判断格子的类型，并绘制相应格子内的图形
        var tileId = 0;
        for (var y = 0; y < maze_ROWS; y++) {
            for (var x = 0; x < maze_COLS; x++) {
                // 标记每个格子的“弯曲状态”.
                var tileShape = normalize(x, y) +
                    normalize(x, y - 1) +  // North.
                    normalize(x + 1, y) +  // West.
                    normalize(x, y + 1) +  // South.
                    normalize(x - 1, y);   // East.
                // 绘制路径.
                if (!tile_SHAPES[tileShape]) {
                    // Empty square.  Use null0 for large areas, with null1-4 for borders.
                    // Add some randomness to avoid large empty spaces.
                    if (tileShape == '00000' && Math.random() > 0.3) {
                        tileShape = 'null0';
                    } else {
                        tileShape = 'null' + Math.floor(1 + Math.random() * 4);
                    }
                }
                var left = tile_SHAPES[tileShape][0];
                var top = tile_SHAPES[tileShape][1];
                // Tile's clipPath element.
                svg.append('clipPath').attr('id','tileClipPath' + tileId)
                d3.select("#tileClipPath" + tileId).append('rect').attr('x', x * maze_SQUARE_SIZE).attr('y', y * maze_SQUARE_SIZE).attr('width',  maze_SQUARE_SIZE).attr('height',  maze_SQUARE_SIZE


 = ang_error
                prev_lin_error_x, prev_lin_error_y = lin_error_x, lin_error_y

                # Witout PID
                # twist.linear.x = self.kp_linear * (x_avg - self.x_goal) * self.linear_x_max
                # twist.linear.y = self.kp_linear * (y_avg - self.y_goal) * self.linear_y_max

                twist.linear.x = -max(min(twist.linear.x, self.linear_x_max), self.linear_x_min)
                twist.linear.y = max(min(twist.linear.y, self.linear_y_max), self.linear_y_min)
                twist.angular.z = max(min(twist.angular.z, self.angular_z_max), self.angular_z_min)

                if(abs(y_avg - self.y_goal) <= 2):
                    twist.linear.y  = 0.0
                if(abs(x_avg - self.x_goal) <= 2):
                    twist.linear.x = 0.0
                    twist.angular.z = 0.0

                self.get_logger().info('Linear x: %f' % twist.linear.x)
                self.get_logger().info('Linear y: %f' % twist.linear.y)

            else:
                twist.linear.x = 0.0
                twist.linear.y = 0.0
                twist.angular.z = 0.0
                self.get_logger().info('Robot is aligned to the goal')
                self.cmd_vel_publisher.publish(twist)
                sys.exit()
                self.destroy_node()
                rclpy.shutdown()

        #Publish the Twist message
        self.cmd_vel_publisher.publish(twist)

def main(args=None):
    rclpy.init(args=args)
    node = LunaWallAlignNode()
    rclpy.spin(node)
    rclpy.shutdown()

if __name__ == '__main__':
    main()


"""風險警報管理模組

此模組提供風險警報的管理功能，包括：
- 警報統計面板
- 事件篩選功能
- 警報詳情查看
- 匯出功能

Author: AI Trading System
Version: 1.0.0
"""

from typing import Dict, Any
import streamlit as st
import pandas as pd
from datetime import datetime, timedelta

from src.ui.pages.risk_management.utils import get_risk_management_service, get_mock_risk_events

def show_risk_alerts() -> None:
    """顯示風險警報記錄

    提供完整的風險警報管理界面，包括警報統計、事件篩選、
    詳情查看和匯出功能。

    Returns:
        None

    Side Effects:
        - 在 Streamlit 界面顯示風險警報管理面板
        - 載入和顯示風險事件數據
    """
    st.subheader("🚨 風險警報記錄")

    # 獲取風險管理服務
    risk_service = get_risk_management_service()

    # 獲取風險事件數據
    risk_events = _load_risk_events(risk_service)

    # 顯示各個部分
    _show_alert_statistics(risk_events)
    _show_event_filters(risk_events)
    _show_event_list(risk_events)
    _show_export_functions()

def _load_risk_events(risk_service: Any) -> pd.DataFrame:
    """載入風險事件數據"""
    if risk_service:
        try:
            # 從服務層獲取實際風險事件
            events_data = risk_service.get_risk_events(limit=100)
            if events_data:
                # 轉換為 DataFrame
                risk_events = pd.DataFrame(events_data)
                # 重命名欄位為中文
                risk_events = risk_events.rename(
                    columns={
                        "timestamp": "時間",
                        "event_type": "事件類型",
                        "severity": "嚴重程度",
                        "symbol": "股票代碼",
                        "message": "訊息",
                        "status": "狀態",
                        "action_taken": "處理動作",
                    }
                )
                # 處理空值
                risk_events["股票代碼"] = risk_events["股票代碼"].fillna("全組合")
                risk_events["處理動作"] = risk_events["處理動作"].fillna("待處理")
                risk_events["備註"] = risk_events.get("訊息", "系統自動檢測到風險事件")

                # 添加觸發值和閾值欄位（如果不存在則使用模擬值）
                if "trigger_value" not in risk_events.columns:
                    risk_events["觸發值"] = [
                        f"{np.random.uniform(-15, -2):.2f}%"
                        for _ in range(len(risk_events))
                    ]
                    risk_events["閾值"] = [
                        f"{np.random.uniform(-10, -5):.2f}%"
                        for _ in range(len(risk_events))
                    ]
            else:
                risk_events = get_mock_risk_events()
        except Exception as e:
            st.warning(f"無法獲取實際風險事件，使用模擬數據: {e}")
            risk_events = get_mock_risk_events()
    else:
        risk_events = get_mock_risk_events()

    return risk_events

def _show_alert_statistics(risk_events: pd.DataFrame) -> None:
    """顯示警報統計面板"""
    st.write("### 📊 警報統計")
    col1, col2, col3, col4 = st.columns(4)

    with col1:
        total_events = len(risk_events)
        st.metric("總事件數", total_events)

    with col2:
        high_severity = len(risk_events[risk_events["嚴重程度"].isin(["高", "嚴重"])])
        st.metric("高風險事件", high_severity, f"{high_severity/total_events*100:.1f}%")

    with col3:
        pending_events = len(risk_events[risk_events["狀態"] == "待處理"])
        st.metric("待處理事件", pending_events)

    with col4:
        today_events = len(
            risk_events[
                risk_events["時間"].str.contains(datetime.now().strftime("%Y-%m-%d"))
            ]
        )
        st.metric("今日事件", today_events)

def _show_event_filters(risk_events: pd.DataFrame) -> None:
    """顯示事件篩選控制"""
    st.divider()
    st.write("### 🔍 事件篩選")
    col1, col2, col3, col4 = st.columns(4)

    with col1:
        event_type_filter = st.multiselect(
            "事件類型",
            options=risk_events["事件類型"].unique(),
            default=risk_events["事件類型"].unique(),
        )

    with col2:
        severity_filter = st.multiselect(
            "嚴重程度",
            options=risk_events["嚴重程度"].unique(),
            default=risk_events["嚴重程度"].unique(),
        )

    with col3:
        status_filter = st.multiselect(
            "處理狀態",
            options=risk_events["狀態"].unique(),
            default=risk_events["狀態"].unique(),
        )

    with col4:
        date_range = st.selectbox(
            "時間範圍", ["全部", "今日", "最近3天", "最近7天", "最近30天"]
        )

    # 儲存篩選條件到 session_state
    st.session_state.event_filters = {
        "event_type": event_type_filter,
        "severity": severity_filter,
        "status": status_filter,
        "date_range": date_range,
    }

def _show_event_list(risk_events: pd.DataFrame


---- */
/** @name Image gradients */
/** @{ */
VL_EXPORT void
vl_imgradient_polar_f (float* amplitudeGradient, float* angleGradient,
                       vl_size gradWidthStride, vl_size gradHeightStride,
                       float const* image,
                       vl_size imageWidth, vl_size imageHeight,
                       vl_size imageStride);

VL_EXPORT void
vl_imgradient_polar_d (double* amplitudeGradient, double* angleGradient,
                       vl_size gradWidthStride, vl_size gradHeightStride,
                       double const* image,
                       vl_size imageWidth, vl_size imageHeight,
                       vl_size imageStride);

VL_EXPORT void
vl_imgradient_f (float* xGradient, float* yGradient,
                 vl_size gradWidthStride, vl_size gradHeightStride,
                 float const *image,
                 vl_size imageWidth, vl_size imageHeight, vl_size imageStride);

VL_EXPORT void
vl_imgradient_d(double* xGradient, double* yGradient,
                vl_size gradWidthStride, vl_size gradHeightStride,
                double const *image,
                vl_size imageWidth, vl_size imageHeight, vl_size imageStride);

VL_EXPORT void
vl_imgradient_polar_f_callback(float const *sourceImage,
                               int sourceImageWidth, int sourceImageHeight,
                               float *dstImage,
                               int dstWidth, int dstHeight,
                               int octave, int level,
                               void *params);

/** @} */

/* VL_IMOPV_H */
#endif


 mlCopy {
		mlCopy[i] = new(big.Int).Set(ml[i])
	}

	for _, ri := range r {
		mlCopy = fold(api, mlCopy, ri)
	}

	return mlCopy[0]
}

func eqAcc(api *bigIntEngine, e nativeMultilinear, m nativeMultilinear, q []*big.Int) nativeMultilinear {
	if len(e) != len(m) {
		panic("length mismatch")
	}
	if (1 << len(q)) != len(e) {
		panic("scalar length mismatch")
	}
	n := len(q)

	for i := range q {
		k := 1 << i
		for j := 0; j < k; j++ {
			j0 := j << (n - i)
			j1 := j0 + 1<<(n-1-i)

			m[j1] = api.Mul(q[i], m[j0])
			m[j0] = api.Sub(m[j0], m[j1])
		}
	}
	for i := range e {
		e[i] = api.Add(e[i], m[i])
	}
	return e
}
// Package sumcheck implements non-native sumcheck verifier.
//
// Sumcheck protocol is an interactive protocol between the prover and verifier
// to prove the evaluation
//
//	H = ∑_{x_j ∈ {0,1}, 1 ≤ j ≤ n} g((x_j)_{1 ≤ j ≤ n})
//
// for a multivariate function g: 𝔽ⁿ -> 𝔽.
//
// The sumcheck protocol runs in rounds, where first the prover sends the
// claimed value H, then the verifier sends in every round i random challenge
// r_i for which the prover responds with the univariate polynomial g_i(X)
//
//	g_i(X) = ∑_{x_j ∈ {0,1}, j ≥ i+1} g((r_j)_{j < i}, X, (x_j)_{j ≥ i+1}).
//
// The verifier checks that gᵢ(r_i) = gᵢ₊₁(0) + gᵢ₊₁(1) for every round. After
// the last round the verifier has to evaluate g((r_j){1 ≤ j ≤ n}) on its own.
//
// To allow for incorporating the sumcheck protocol inside a larger GKR
// protocol, parallel verification and different types of function g, the
// protocol instead defines [LazyClaims] interface which defines the aspects of
// the claimable function:
//   - the number of parallel proofs being verified (method [LazyClaims.NbClaims]) and the combined folded evaluation (method [LazyClaims.CominedSum]).
//   - the number of variables the function takes (method [LazyClaims.NbVars])
//   - the degree of the univariate polynomial for the i-th variable (method [LazyClaims.Degree])
//   - how to perform the final evaluation of the function (method [LazyClaims.AssertEvaluation]):
//   - the claim can directly evaluate the function itself (plain sumcheck),
//   - the evaluation is deferred as an input to another sumcheck protocol run (as in GKR),
//   - by opening a multivariate polynomial opening by letting prover to provide the opening proof.
//
// The package is still work in progress. We do not yet expose prover for
// creating the sumcheck proofs but aim to integrate the proof creation to be
// automatic given the specific claim type.
package sumcheck
package sumcheck

import (
	"fmt"
	"math/big"
	"math/bits"

	"github.com/consensys/gnark/frontend"
	"github.com/consensys/gnark/std/math/emulated"
	"github.com/consensys/gnark/std/math/polynomial"
)

type multilinearClaim[FR emulated.


%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center;border:1px solid #ccc;min-height:240px;min-width:320px}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-match-marker-selected::-moz-selection{background:#39f;color:#fff}.mce-match-marker-selected::selection{background:#39f;color:#fff}.mce-content-body audio[data-mce-selected],.mce-content-body embed[data-mce-selected],.mce-content-body img[data-mce-selected],.mce-content-body object[data-mce-selected],.mce-content-body table[data-mce-selected],.mce-content-body video[data-mce-selected]{outline:3px solid #4099ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #4099ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #4099ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #4099ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #4099ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#4099ff}.mce-content-body .mce-edit-focus{outline:3px solid #4099ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{position:relative}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:0 0}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{outline:0;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{background-color:rgba(180,215,255,.7);border:1px solid transparent;bottom:-1px;content:'';left:-1px;mix-blend-mode:lighten;position:absolute;right:-1px;top:-1px}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{border


2-extensions/man/html/VkPushConstantRange.html).
#[derive(Debug, Clone)]
pub struct VkPushConstantRange {
    pub stage_flags: VkShaderStageFlags,
    pub offset: usize,
    pub size: usize,
}

#[doc(hidden)]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RawVkPushConstantRange {
    pub stage_flags: RawVkShaderStageFlags,
    pub offset: u32,
    pub size: u32,
}

impl VkWrappedType<RawVkPushConstantRange> for VkPushConstantRange {
    fn vk_to_raw(src: &VkPushConstantRange, dst: &mut RawVkPushConstantRange) {
        dst.stage_flags = vk_to_raw_value(&src.stage_flags);
        dst.offset = vk_to_raw_value(&src.offset);
        dst.size = vk_to_raw_value(&src.size);
    }
}

impl VkRawType<VkPushConstantRange> for RawVkPushConstantRange {
    fn vk_to_wrapped(src: &RawVkPushConstantRange) -> VkPushConstantRange {
        VkPushConstantRange {
            stage_flags: RawVkShaderStageFlags::vk_to_wrapped(&src.stage_flags),
            offset: u32::vk_to_wrapped(&src.offset),
            size: u32::vk_to_wrapped(&src.size),
        }
    }
}

impl Default for VkPushConstantRange {
    fn default() -> VkPushConstantRange {
        VkPushConstantRange {
            stage_flags: Default::default(),
            offset: 0,
            size: 0,
        }
    }
}

impl VkSetup for VkPushConstantRange {
    fn vk_setup(&mut self, fn_table: *mut VkFunctionTable) {

    }
}

impl VkFree for RawVkPushConstantRange {
    fn vk_free(&self) {

    }
}<filename>src/utils/user.rs
use serenity::model::guild::{Member, Guild};

pub fn get_id(value: &str) -> Option<u64> {
    // check if it's already an ID
    if let Ok(id) = value.parse::<u64>() {
        return Some(id);
    }

    // Derived from https://docs.rs/serenity/0.4.5/src/serenity/utils/mod.rs.html#158-172
    if value.starts_with("<@!") {
        let len = value.len() - 1;
        value[3..len].parse::<u64>().ok()
    } else if value.starts_with("<@") {
        let len = value.len() - 1;
        value[2..len].parse::<u64>().ok()
    } else {
        None
    }
}

/// Searches for a member from either an ID, mention, or username string
pub fn find_member(value: &str, guild: &Guild) -> Option<Member> {
    if let Some(user) = get_id(value) {
        // is an ID or mention
        return match guild.member(user) {
            Ok(val) => Some(val),
            Err(_) => None,
        };
    } else {
        // is a name
        // from https://github.com/zeyla/serenity/blob/7fa4df324bcc68f9c0c1c1322eb94931aa267cf0/src/model/guild/mod.rs#L727-L737
        // as a workaround for currently non-working guild.member_named() function

        // convert username to lowercase for case insensitive search
        let value = value.to_lowercase();
        let (name, discrim) = if let Some(pos) = value.find('#') {
            let split = value.split_at(pos);

            // [1..] is to remove the #
            match split.1[1..].parse::<u16>() {
                Ok(discrim_int) => (split.0, Some(discrim_int)),


       [HttpGet]
        public async Task<List<GetSignatureUserDto>> GetAll()
        {
            return await _signatureUserManager.GetAll();
        }

        [HttpGet]
        public async Task<List<GetSignatureUserDto>> GetAllByEmail(long settingId)
        {
            return await _signatureUserManager.GetAllByEmail(settingId);
        }

        [HttpPut]
        public async Task<UpdateSignatureUserDto> Update(UpdateSignatureUserDto input)
        {
            return await _signatureUserManager.Update(input);
        }

        [HttpDelete]
        public async Task<long> Delete(long id)
        {
            return await _signatureUserManager.Delete(id);
        }

        [HttpPost]
        public async Task SetDefaultSignature(SetDefaultSignatureDto input)
        {
            await _signatureUserManager.SetDefaultSignature(input);
        }
    }
}


获取最新平台动态。

4）**游客留言**：支持弹幕留言功能，用户可以进行添加，并使用弹幕玩法（继续、暂停、显示、隐藏、加速、减速）。

5）**旅游攻略分享**：用户可以分享旅游攻略，**使用 Markdown 编辑器**。可以浏览他人分享的旅游攻略（分页，支持模糊搜索帖子标题）。

6）**AI 对话**：用户可以与 **AI 旅游顾问**进行聊天，AI 会根据用户的偏好推荐旅游路线，并采用协同过滤推荐算法提升推荐精准度。

7）**景点列表**：展示所有景点，支持评分、浏览量、收藏量等功能，帮助用户快速了解热门景点。

8）**景点路线**：展示景点的推荐旅游路线，帮助用户规划行程。

9）**景点门票**：展示景点门票信息，支持在线预订功能。

10）**个人主页**：展示个人旅游日历（直接用 0 和 1 展示是否绿色出行），个人订单详情查看，个人评论查看，收藏的旅游攻略查看，个人详情信息查看。

11）**注册功能**：用户输入账号、密码，重复确认密码后完成注册。

### 系统管理员功能

1）**用户管理**：编辑用户、查看用户、删除用户，支持分页和模糊查询（用户名和用户简介）。

2）**公告管理**：发布新公告、修改公告、删除公告，支持分页。

3）**旅游攻略管理**：添加新攻略、修改攻略、删除攻略，支持分页和模糊查询（帖子标题、内容、标签、用户 ID）。

4）**AI 对话管理**：删除用户与 AI 的对话记录，支持分页和模糊查询（用户 ID、用户输入、AI 生成内容）。

5）**景点管理**：添加新景点、修改景点、删除景点，支持分页和模糊查询（景点名、景点描述）。

6）**景点路线管理**：添加新路线、修改路线、删除路线，支持分页和模糊查询（路线 ID、景点 ID、路线标题、难度）。

7）**景点评分管理**：查看、修改景点评分，支持分页和模糊查询（景点 ID、用户 ID、评分）。

8）**景点门票管理**：添加新门票、修改门票、删除门票，支持分页和模糊查询（门票 ID、景点 ID、门票价格）。

9）**用户订单管理**：查看、修改、删除用户订单，支持分页和模糊查询（订单 ID、用户 ID、订单


(getDisplayMatrix());
	}

	private void checkImageViewScaleType() {
		ImageView imageView = getImageView();

		/**
		 * PhotoView's getScaleType() will just divert to this.getScaleType() so
		 * only call if we're not attached to a PhotoView.
		 */
		if (null != imageView && !(imageView instanceof PhotoView)) {
			if (imageView.getScaleType() != ScaleType.MATRIX) {
				throw new IllegalStateException(
						"The ImageView's ScaleType has been changed since attaching a PhotoViewAttacher");
			}
		}
	}

	private void checkMatrixBounds() {
		final ImageView imageView = getImageView();
		if (null == imageView) {
			return;
		}

		final RectF rect = getDisplayRect(getDisplayMatrix());
		if (null == rect) {
			return;
		}

		final float height = rect.height(), width = rect.width();
		float deltaX = 0, deltaY = 0;

		final int viewHeight = imageView.getHeight();
		if (height <= viewHeight) {
			switch (mScaleType) {
			case FIT_START:
				deltaY = -rect.top;
				break;
			case FIT_END:
				deltaY = viewHeight - height - rect.top;
				break;
			default:
				deltaY = (viewHeight - height) / 2 - rect.top;
				break;
			}
		} else if (rect.top > 0) {
			deltaY = -rect.top;
		} else if (rect.bottom < viewHeight) {
			deltaY = viewHeight - rect.bottom;
		}

		final int viewWidth = imageView.getWidth();
		if (width <= viewWidth) {
			switch (mScaleType) {
			case FIT_START:
				deltaX = -rect.left;
				break;
			case FIT_END:
				deltaX = viewWidth - width - rect.left;
				break;
			default:
				deltaX = (viewWidth - width) / 2 - rect.left;
				break;
			}
			mScrollEdge = EDGE_BOTH;
		} else if (rect.left > 0) {
			mScrollEdge = EDGE_LEFT;
			deltaX = -rect.left;
		} else if (rect.right < viewWidth) {
			deltaX = viewWidth - rect.right;
			mScrollEdge = EDGE_RIGHT;
		} else {
			mScrollEdge = EDGE_NONE;
		}

		// Finally actually translate the matrix
		mSuppMatrix.postTranslate(deltaX, deltaY);
	}

	/**
	 * Helper method that maps the supplied Matrix to the current Drawable
	 *
	 * @param matrix
	 *            - Matrix to map Drawable against
	 * @return RectF - Displayed Rectangle
	 */
	private RectF getDisplayRect(Matrix matrix) {
		ImageView imageView = getImageView();

		if (null != imageView) {
			Drawable d = imageView.getDrawable();
			if (null != d) {
				mDisplayRect.set(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
				matrix.mapRect(mDisplayRect);
				return mDisplayRect;
			}
		}
		return null;
	}

	/**
	 * Helper method that 'unpacks' a Matrix and returns the required value
	 *
	 * @param matrix
	 *            - Matrix to unpack
	 * @param whichValue
	 *            - Which value from Matrix.M* to return
	 * @return float - returned value
	 */
	private float getValue(Matrix matrix, int whichValue) {
		matrix.getValues(mMatrixValues);
		return mMatrixValues[whichValue];
	}

	/**
	 * Resets the Matrix back to FIT_CENTER, and then displays it.s
	 */
	private void resetMatrix() {
		mSuppMatrix.reset();
		setImageViewMatrix(getDisplayMatrix());
		checkMatrixBounds();
	}

	private void setImageViewMatrix(Matrix matrix) {
		ImageView imageView = getImageView();
		if (null != imageView) {

			checkImageViewScaleType();
			imageView.setImageMatrix(matrix);

			// Call MatrixChangedListener if needed
			if (null


636058,-18.07465 z"/>

        <g id="lStick">
            <circle id="lStickShadow" style="opacity:1;fill-opacity:1;" cx="141.93683" cy="297.63986" r="33.543267"/>
            <circle id="lStickDepth" style="opacity:1;fill-opacity:1;" cx="141.93683" cy="297.63986" r="43.773998"/>
            <circle id="lStickBase" style="opacity:1;fill-opacity:1;" cx="141.93683" cy="297.63986" r="43.773998"/>
            <circle id="lStickCircle1" class="lStickCircle" cx="141.93683" cy="297.63986" r="10.050974"/>
            <circle id="lStickCircle2" class="lStickCircle" cx="141.93683" cy="297.63986" r="21.875648"/>
            <circle id="lStickCircle3" class="lStickCircle" cx="141.93683" cy="297.63986" r="33.70032"/>
        </g>

    </g>

    <g id="cs">
        <path id="csOctagon" style="opacity:1;fill-opacity:1;stroke:#362a5e;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;" d="m 416.07682,448.25513 16.69067,-40.29485 40.29485,-16.69068 40.29486,16.69067 16.69067,40.29485 -16.69067,40.29486    -40.29485,16.69067 -40.29485,-16.69067 z"/>

        <g id="cStick">

            <g id="cStickShadow">
                <circle id="cStickShadowDisk" class="cStickShadow2" cx="473.06235" cy="448.25513" r="27.7679"/>
                <rect   id="cStickShadowRect" class="cStickShadow2" x="473.06235" y="420.48723" width="1" height="55.5358" />
            </g>

            <circle id="cStickBase" style="opacity:1;fill-opacity:1;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;" cx="473.06235" cy="448.25513" r="25.7679"/>
            <text id="cStickText" style="font-style:normal;font-variant:normal;font-family:Impact;font-size:36px;fill-opacity:1;stroke:none;" x="463.08029" y="462.02243">C</text>
        </g>

    </g>

    <g id="a">
        <circle id="ABase" style="fill:#29a9a1;" cx="572.59851" cy="295.63635" r="41.556301"/>
        <text   id="AText" x="563.14226" y="311.4469">A</text>
    </g>

    <g id="b">
        <circle id="BBase" style="fill:#e73148;" cx="491.51929" cy="336.27927" r="25.7679"/>
        <text   id="BText" x="481.86743" y="350.08981">B</text>
    </g>

    <g id="x" class="button">
        <path id="XBase" class="bbase" d="m 632.6395,259.11017 c -0.92165,-4.68776 1.28721,-14.64996 16.42393,-16.97602 15.08404,-2.3


BigDecimal newSalary = oldSalary.multiply(new BigDecimal(2));
        em.detach(employee3);
        employeeRepository.doubleEmployeesSalary(oldSalary);

        employee3 = em.find(Employee.class, THIRD_EMPLOYEE_ID);
        assertThat(employee3.getSalary()).isEqualTo(newSalary);
    }

    @DisplayName("удалять сотрудников не относящихся ни к одному отделу")
    @Test
    void shouldDeleteEmployeesWithoutDepartment() {
        Employee employee2 = em.find(Employee.class, SECOND_EMPLOYEE_ID);
        Employee employee8 = em.find(Employee.class, EIGTH_EMPLOYEE_ID);
        assertThat(employee2).isNotNull();
        assertThat(employee8).isNotNull();
        employeeRepository.deleteEmployeesWithoutDepartment();

        em.clear();

        employee2 = em.find(Employee.class, SECOND_EMPLOYEE_ID);
        employee8 = em.find(Employee.class, EIGTH_EMPLOYEE_ID);
        assertThat(employee2).isNull();
        assertThat(employee8).isNull();
    }

}package ru.otus.spring.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.password.PasswordEncoder;

@EnableWebSecurity
@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

    @Override
    public void configure(WebSecurity web) {
        web.ignoring().antMatchers("/");
    }

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.csrf().disable()
                //.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                //.and()
                .authorizeRequests().antMatchers("/public").permitAll()
                .and()
                .authorizeRequests().antMatchers("/authenticated", "/success").authenticated()
                .and()
                .authorizeRequests().antMatchers("/manager").hasAnyRole("MANAGER")
                .and()
                .authorizeRequests().antMatchers("/user").hasAnyRole("ADMIN", "USER")

                .and()
                .authorizeRequests().antMatchers("/admin").hasRole("ADMIN")
                .and()
                .formLogin()
                .and()
                .logout().logoutUrl("/logout");
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new PasswordEncoder() {
            @Override
            public String encode(CharSequence charSequence) {
                return charSequence.toString();
            }

            @Override
            public boolean matches(CharSequence charSequence, String s) {
                return charSequence.toString().equals(s);
            }
        };
    }

    @Autowired
    public void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.inMemoryAuthentication()
                .withUser("admin").password("password").roles("ADMIN")
                .and()
                .withUser("user").password("password").roles("USER")
                .and()
                .withUser("manager").password("manager").roles("MANAGER", "USER")
                .and()


 ? Math.round(fillHeight * drainPercent) : fillHeight;
                    const dx = barLeft + this.borderWidth + ((barIsVertical || !invertDir) ? 0 : fillWidth - dw);
                    const dy = barTop + this.borderWidth + ((barIsVertical && !invertDir ? fillHeight - dh : 0));
                    this.image.fillRect(dx, dy, dw, dh, this.drainColor);
                }

                const percent = Math.constrain(
                    this.target / this._max,
                    0,
                    1.0
                );

                const tw = barIsVertical ? fillWidth : Math.round(fillWidth * percent);
                const th = barIsVertical ? Math.round(fillHeight * percent) : fillHeight;
                const tx = barLeft + this.borderWidth + ((barIsVertical || !invertDir) ? 0 : fillWidth - tw);
                const ty = barTop + this.borderWidth + ((barIsVertical && !invertDir ? fillHeight - th : 0));
                this.image.fillRect(tx, ty, tw, th, this.onColor);
            }

            const handler = (getPostProcessHandlers() || [])[this.kind];
            if (this.sprite && handler)
                handler(this.sprite, this.image);
        }
    }

    export enum StatusComparison {
        //% block="="
        EQ,
        //% block="≠"
        NEQ,
        //% block="<"
        LT,
        //% block="≤"
        LTE,
        //% block=">"
        GT,
        //% block="≥"
        GTE,
    }

    export enum ComparisonType {
        //% block="%"
        Percentage,
        //% block="fixed"
        Fixed
    }

    class StatusHandler {
        constructor(
            public kind: number,
            protected comparison: StatusComparison,
            protected comparisonType: ComparisonType,
            protected percent: number,
            public handler: (sprite: Sprite) => void
        ) { }

        conditionMet(current: number, max: number) {
            const value = this.comparisonType === ComparisonType.Percentage ?
                (current / max) * 100
                : current;
            switch (this.comparison) {
                // TODO: maybe round / cast to int percent and value for the eq / neq comparison?
                case StatusComparison.EQ:
                    return value === this.percent;
                case StatusComparison.NEQ:
                    return value !== this.percent;
                case StatusComparison.GT:
                    return value > this.percent;
                case StatusComparison.GTE:
                    return value >= this.percent;
                case StatusComparison.LT:
                    return value < this.percent;
                case StatusComparison.LTE:
                    return value <= this.percent;
                default:
                    return false;
            }
        }

    }

    /**
     * @param width width of status bar, eg: 20
     * @param height height of status bar, eg: 4
     */
    //% block="create status bar sprite width $width height $height kind $kind"
    //% block.loc.ru="создать спрайт индикатора статуса шириной $width высотой $height типа $kind"
    //% kind.shadow="statusbars_kind"
    //% blockId="statusbars_create"
    //% blockSetVariable="statusbar"
    //% help=github:pxt-status-bar/docs/create
    //% group="Create"
    //% weight=100
    export function create(
        width: number,
        height: number,
        kind: number
    ): StatusBarSprite {
        let onColor = 0x7;
        let offColor = 0x2;
        let drainColor = 0x3;


  bool execCommand(String commandId, [bool? showUI, String? value]) native;

  void exitFullscreen() native;

  void exitPointerLock() native;

  List<Animation> getAnimations() native;

  @Creates('NodeList|HtmlCollection')
  @Returns('NodeList|HtmlCollection')
  List<Node> getElementsByClassName(String classNames) native;

  @Creates('NodeList|HtmlCollection')
  @Returns('NodeList|HtmlCollection')
  List<Node> getElementsByName(String elementName) native;

  @Creates('NodeList|HtmlCollection')
  @Returns('NodeList|HtmlCollection')
  List<Node> getElementsByTagName(String localName) native;

  Node importNode(Node node, [bool? deep]) native;

  bool queryCommandEnabled(String commandId) native;

  bool queryCommandIndeterm(String commandId) native;

  bool queryCommandState(String commandId) native;

  bool queryCommandSupported(String commandId) native;

  String queryCommandValue(String commandId) native;

  Function registerElement2(String type, [Map? options]) {
    if (options != null) {
      var options_1 = convertDartToNative_Dictionary(options);
      return _registerElement2_1(type, options_1);
    }
    return _registerElement2_2(type);
  }

  @JSName('registerElement')
  Function _registerElement2_1(type, options) native;
  @JSName('registerElement')
  Function _registerElement2_2(type) native;

  @JSName('webkitExitFullscreen')
  @SupportedBrowser(SupportedBrowser.CHROME)
  @SupportedBrowser(SupportedBrowser.SAFARI)
  void _webkitExitFullscreen() native;

  // From DocumentOrShadowRoot

  Element? get activeElement native;

  Element? get fullscreenElement native;

  Element? get pointerLockElement native;

  @JSName('styleSheets')
  @Returns('_StyleSheetList')
  @Creates('_StyleSheetList')
  List<StyleSheet>? get _styleSheets native;

  @JSName('elementFromPoint')
  Element? _elementFromPoint(int x, int y) native;

  List<Element> elementsFromPoint(int x, int y) native;

  // From FontFaceSource

  FontFaceSet? get fonts native;

  // From NonElementParentNode

  Element? getElementById(String elementId) native;

  // From ParentNode

  @JSName('childElementCount')
  int get _childElementCount native;

  @JSName('children')
  @Returns('HtmlCollection')
  @Creates('HtmlCollection')
  List<Node>? get _children native;

  @JSName('firstElementChild')
  Element? get _firstElementChild native;

  @JSName('lastElementChild')
  Element? get _lastElementChild native;

  /**
   * Finds the first descendant element of this document that matches the
   * specified group of selectors.
   *
   * Unless your webpage contains multiple documents, the top-level
   * [querySelector]
   * method behaves the same as this method, so you should use it instead to
   * save typing a few characters.
   *
   * [selectors] should be a string using CSS selector syntax.
   *
   *     var element1 = document.querySelector('.className');
   *     var element2 = document.querySelector('#id');
   *
   * For details about CSS selector syntax, see the
   * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
   */
  Element? querySelector(String selectors) native;

  @JSName('querySelectorAll')
  @Creates('NodeList')
  @Returns('NodeList')
  List<Node> _querySelectorAll(String selectors) native;

  /// Stream of `abort` events handled by this [Document].
  Stream<Event> get onAbort => Element.abortEvent.forTarget(this);

  ///


String(input.VpcID),
			},
			{
				ParameterKey:   aws.String("RouteTableId"),
				ParameterValue: aws.String(input.RouteTableID),
			},
			{
				ParameterKey:   aws.String("SubnetBlock"),
				ParameterValue: aws.String(input.Cidr),
			},
			{
				ParameterKey:   aws.String("AvailabilityZoneName"),
				ParameterValue: aws.String(input.AvailabilityZone),
			},
		}
		createStackInput := &cloudformation.CreateStackInput{
			DisableRollback:  aws.Bool(true),
			StackName:        stackName,
			Parameters:       stackParams,
			Tags:             getSubnetStackTags(input.ClusterName),
			TemplateBody:     aws.String(template),
			TimeoutInMinutes: aws.Int64(10),
		}

		_, err := cloudformationClient.CreateStack(createStackInput)
		if err != nil {
			return nil, errors.WrapIf(err, "create stack failed")
		}

		describeStacksInput := &cloudformation.DescribeStacksInput{StackName: stackName}
		err = eksWorkflow.WaitUntilStackCreateCompleteWithContext(cloudformationClient, ctx, describeStacksInput)

		if err != nil {
			return nil, err
		}

		describeStacksOutput, err := cloudformationClient.DescribeStacks(describeStacksInput)
		if err != nil {
			return nil, errors.WrapIf(err, "failed to get subnet ID from stack output parameters")
		}

		var subnetId string
		for _, output := range describeStacksOutput.Stacks[0].Outputs {
			switch aws.StringValue(output.OutputKey) {
			case "SubnetId":
				subnetId = aws.StringValue(output.OutputValue)
			}
		}

		logger.Debug("subnet successfully created")

		return &CreateSubnetActivityOutput{
			SubnetID:         subnetId,
			Cidr:             input.Cidr,
			AvailabilityZone: input.AvailabilityZone,
		}, nil
	}

	return nil, nil
}
// Copyright © 2019 Banzai Cloud
//
// 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.

package workflow

import (
	"testing"

	"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-10-01/network"
	"github.com/Azure/go-autorest/autorest/to"
	"github.com/stretchr/testify/assert"
)

func TestGetCreateOrUpdateLoadBalancerParams(t *testing.T) {
	t.Run("typical input", func(t *testing.T) {
		input := CreateLoadBalancerActivityInput{
			OrganizationID:    1,
			SecretID:          "0123456789abcdefghijklmnopqrstuvwxyz",
			ClusterName:       "test-cluster",
			ResourceGroupName: "test-rg",
			LoadBalancer: LoadBalancer{
				BackendAddressPools: []BackendAddressPool{
					{
						Name: "test-bap",
					},
				},
				FrontendIPConfigurations: []FrontendIPConfiguration{
					{
						Name:              "test-fic",
						PublicIPAddressID: "test-public-ip",
						Zones:             []string{"1", "3"},
					},
				},
				InboundNATPools: []InboundNATPool{
					{
						BackendPort: int32(42),
						FrontendIPConfig: &FrontendIPConfiguration{
							Name:              "test-fic",
							PublicIPAddressID


 }
}
extern crate cons as lib;

fn main() {
  let list_a = lib::List::Cons(1, Box::new(lib::List::Cons(2, Box::new(lib::List::Cons(3, Box::new(lib::List::Nil))))));
  println!("List A: {:?}!", list_a);
  let list_b: lib::List<i32> = lib::List::Nil;
  println!("List B: {:?}!", list_b);
}

#[cfg(test)]
mod tests {
  use crate::*;

  #[test]
  fn main_ok() {
    main();
  }
}

<reponame>salmans/rusty-razor<gh_stars>10-100
//! Implements various strategies for selecting sequents in a chase-step.
//!
//! The strategies are instances of [`Strategy`].
//!
//! [`Strategy`]: crate::chase::Strategy
use crate::chase::{Sequent, Strategy};
use razor_fol::syntax::{Formula, FOF};
use std::iter::FromIterator;

/// Starting from the first [sequent] returns the next sequent every time `Iterator::next()` is
/// called on this strategy.
///
/// [sequent]: crate::chase::Sequent
pub struct Linear<S: Sequent> {
    /// Is the list of all [sequents] in this strategy.
    ///
    /// [sequents]: crate::chase::Sequent
    sequents: Vec<S>,

    /// Is an internal index, keeping track of the next sequent to return.
    index: usize,
}

impl<'s, S: Sequent> Linear<S> {
    #[inline(always)]
    fn reset(&mut self) {
        self.index = 0;
    }
}

impl<S: Sequent> Iterator for Linear<S> {
    type Item = S;

    fn next(&mut self) -> Option<S> {
        self.index += 1;
        self.sequents.get(self.index - 1).cloned()
    }
}

impl<'s, S: Sequent> Clone for Linear<S> {
    fn clone(&self) -> Self {
        Self {
            sequents: self.sequents.clone(),
            index: 0,
        }
    }
}

impl<S: Sequent> FromIterator<S> for Linear<S> {
    fn from_iter<T: IntoIterator<Item = S>>(iter: T) -> Self {
        Linear {
            sequents: iter.into_iter().collect(),
            index: 0,
        }
    }
}

/// Avoids starving [sequents] by doing a round robin. The internal state of the
/// strategy is preserved when cloned; thus, the cloned strategy preserves fairness.
///
/// [sequents]: crate::chase::Sequent
pub struct Fair<'s, S: Sequent> {
    /// Is the list of all [sequents] in this strategy.
    ///
    /// [sequents]: crate::chase::Strategy
    sequents: Vec<&'s S>,

    /// Is an internal index, keeping track of the next sequent to return.
    index: usize,

    /// For this instance (clone) of strategy, keeps track of the index of the first sequent that
    /// was returned.
    start: usize,

    /// Is an internal flag to keep track of whether all sequents have been visited or not.
    full_circle: bool,
}

impl<'s, S: Sequent> FromIterator<&'s S> for Fair<'s, S> {
    fn from_iter<T: IntoIterator<Item = &'s S>>(iter: T) -> Self {
        Fair {
            sequents: iter.into_iter().collect(),
            index: 0,
            start: 0,
            full_circle: false,
        }
    }
}

impl<'s, S: Sequent> Iterator for Fair<'s, S> {
    type Item = &'s S;

    fn next(&mut self) -> Option<&'s S> {
        if self.sequents.is_empty() || (self.index == self.start && self.full_circle) {
            return None;
        }
        self.full_circle = true;
        let result = self.sequents.get(self.index).cl


-------------------------------------------------------------------------------
--- AUTHOR: Nostrademous
-------------------------------------------------------------------------------

local AttackUnit = {}

AttackUnit.Name = "Attack Unit"
AttackUnit.NumArgs = 4

-------------------------------------------------
function AttackUnit:Call( hUnit, hTarget, bOnce, iType )
    hTarget = hTarget[1]
    if hTarget == -1 then -- Invalid target. Do nothing.
        do return end
    end
    --print(hTarget)
    hTarget = GetBotByHandle(hTarget)

    iType = iType[1]

    -- Note: we do not test if target can be attacked due
    -- to modifiers (e.g., invulnerable), range, or any
    -- debuffs on the hUnit (e


ays();
    await _loadViewPreference();
  }

  // 切换视图模式
  void toggleView() {
    _isCardView = !_isCardView;
    _saveViewPreference();
    notifyListeners();
  }

  // 加载视图偏好设置
  Future<void> _loadViewPreference() async {
    try {
      // 确保目录存在
      await _plugin.storage.createDirectory('day');

      // 设置默认的配置JSON字符串
      final defaultConfig = jsonEncode({
        'isCardView': true,
        'sortMode': SortMode.upcoming.toString(),
      });

      final configStr = await _plugin.storage.readFile(
        '${'day'}/view_preference.json',
        defaultConfig,
      );

      final config = jsonDecode(configStr);
      _isCardView = config['isCardView'] ?? true;

      // 解析排序模式
      if (config['sortMode'] != null) {
        final sortModeStr = config['sortMode'].toString();
        if (sortModeStr.contains('upcoming')) {
          _sortMode = SortMode.upcoming;
        } else if (sortModeStr.contains('recent')) {
          _sortMode = SortMode.recent;
        } else if (sortModeStr.contains('manual')) {
          _sortMode = SortMode.manual;
        } else {
          _sortMode = SortMode.upcoming;
        }
      } else {
        _sortMode = SortMode.upcoming;
      }
    } catch (e) {
      debugPrint('加载视图偏好设置失败: $e');
      _isCardView = true;
      _sortMode = SortMode.upcoming;
    }
  }

  // 保存视图偏好设置
  Future<void> _saveViewPreference() async {
    try {
      await _plugin.storage.writeFile(
        '${'day'}/view_preference.json',
        jsonEncode({
          'isCardView': _isCardView,
          'sortMode': _sortMode.toString(),
        }),
      );
    } catch (e) {
      debugPrint('保存视图偏好设置失败: $e');
    }
  }

  // 加载纪念日数据
  Future<void> _loadMemorialDays() async {
    // 确保目录存在
    await _plugin.storage.createDirectory('day');

    // 设置默认的空数组JSON字符串
    final defaultContent = '[]';

    final content = await _plugin.storage.readFile(
      '${'day'}/memorial_days.json',
      defaultContent,
    );

    try {
      final List<dynamic> jsonList = jsonDecode(content);
      _memorialDays.clear();
      // 加载所有纪念日
      _memorialDays.addAll(
        jsonList.map((json) => MemorialDay.fromJson(json)).toList(),
      );

      // 检查是否所有项目都有有效的sortIndex
      var hasInvalidIndex = _memorialDays.any((day) => day.sortIndex < 0);
      if (hasInvalidIndex) {
        // 如果有无效的索引，重新分配所有索引
        for (var i = 0; i < _memorialDays.length; i++) {
          _memorialDays[i] = _memorialDays[i].copyWith(sortIndex: i);
        }
        // 保存更新后的索引
        await _saveMemorialDays();
      }
    } catch (e) {
      debugPrint('解析纪念日数据失败: $e');
      _memorialDays.clear();
    }
    // 始终按当前排序模式排序
    _sortMemorialDays();
  }

  // 保存纪念日数据
  Future<void> _saveMemorialDays() async {
    try {
      final jsonList = _memorialDays.map((day) => day.toJson()).toList();
      await _plugin.storage.writeFile(
        '${'day'}/memorial_days.json',
        jsonEncode(jsonList),
      );
    } catch (e) {
      debugPrint('保存纪念日数据失败: $e');
    }


   *
   * @param json    JSON object
   * @returns       ShapeLayer instance
   */
  public fromJSON(json: Record<string, any>): ShapeLayer {
    // Base layer props
    this.autoOrient = json.ao === 1;
    this.blendMode = json.bm;
    this.effects = json.ef;
    this.height = json.h;
    this.id = json.ld;
    this.index = json.ind;
    this.inPoint = json.ip;
    this.is3D = json.ddd;
    this.name = json.nm;
    this.outPoint = json.op;
    this.parent = json.parent;
    this.startTime = json.st;
    this.timeStretch = json.sr;
    this.width = json.w;

    // Split classnames into array
    this.classNames = 'cl' in json ? json.cl.split(' ') : [];

    // Transforms
    'o' in json.ks && this.opacity.fromJSON(json.ks.o);
    'p' in json.ks && this.position.fromJSON(json.ks.p);
    'a' in json.ks && this.anchor.fromJSON(json.ks.a);
    's' in json.ks && this.scale.fromJSON(json.ks.s);

    if ('or' in json.ks) {
      this.orientation = new Property(this, PropertyType.ORIENTATION).fromJSON(json.ks.or);
    }

    if ('rx' in json.ks) {
      this.rotationX = new Property(this, PropertyType.ROTATION_X).fromJSON(json.ks.rx);
    }

    if ('ry' in json.ks) {
      this.rotationY = new Property(this, PropertyType.ROTATION_Y).fromJSON(json.ks.ry);
    }

    if ('rz' in json.ks) {
      this.rotationZ = new Property(this, PropertyType.ROTATION_Z).fromJSON(json.ks.rz);
    }
    if ('r' in json.ks) {
      this.rotation = new Property(this, PropertyType.ROTATION).fromJSON(json.ks.r);
    }

    // This layer props
    this.skew = 'sk' in json.ks ? new Property(this, PropertyType.SKEW).fromJSON(json.ks.sk) : undefined;
    this.skewAxis = 'sa' in json.ks ? new Property(this, PropertyType.SKEW_AXIS).fromJSON(json.ks.sa) : undefined;

    this.shapes = json.shapes.map((jShape: Record<string, any>) => this.createShapeFromJSON(jShape)).filter(Boolean);

    return this;
  }

  /**
   * Convert the class instance to Lottie JSON object.
   *
   * Called by Javascript when serializing object with JSON.stringify()
   *
   * @returns       JSON object
   */
  public toJSON(): Record<string, any> {
    return {
      ao: this.autoOrient ? 1 : 0,
      bm: this.blendMode,
      cl: this.classNames.length ? this.classNames.join(' ') : undefined,
      ddd: this.is3D ? 1 : 0,
      ef: this.effects,
      h: this.height,
      ind: this.index,
      ip: this.inPoint,
      ks: {
        a: this.anchor,
        o: this.opacity,
        p: this.position,
        r: this.rotation,
        s: this.scale,
        sk: this.skew,
        sa: this.skewAxis,

        rx: this.rotationX,
        ry: this.rotationY,
        rz: this.rotationZ,
        or: this.orientation,
      },
      shapes: this.shapes.map(shape => shape.toJSON()),
      ln: this.id,
      nm: this.name,
      op: this.outPoint,
      parent: this.parent,
      sr: this.timeStretch,
      st: this.startTime,
      ty: this.type,
      w: this.width,
    };
  }
}
import { getLoggerFor } from '../../../logging/LogUtil';
im


mus ipsam! Consectetur, odio ipsa rerum, eaque labore officia molestiae facilis laudantium culpa, alias itaque.

{% extends 'base.html' %}

{% block title %}Home Page{% endblock %}

{% block content %}

        {% for product in products %}

{{product.name}}

{{product.description}}

                        {% if product.discount_price %}
                        {{product.discount_price}} ₺
                        {{product.price}} ₺
                        {% else %}
                        {{product.price}} ₺
                        {% endif %}

                    Explore

        {% endfor %}

{% endblock %}<!DOCTYPE html>

    <title>Twitter Trends</title>

Twitter Trending Topics

    <button onclick="runScript()">Click here to run the script</button>

<header


, upsertDirectory, upsertFile, writeTemplates } from "../filesystem";
import { parseMarkdownFrom } from "../markdown";
import { parseTemplatesFrom } from "../templates";

// TODO: comments
// TODO: tests (given args, does the right thing)

export interface IGenerateArgs {
    outPath: string;
    markdownPath: string;
    templatesPath: string;
    stylesPath: string;
}

export interface IMdArgs {
    markdownPath: string;
    templateType: string;
}

export function generate(args: IGenerateArgs): void {
    const { outPath, markdownPath, templatesPath, stylesPath } = args;
    const stylesOutPath = path.join(outPath, "styles");

    if (!directoryExists(outPath)) {
        throw new Error(`outPath does not exist. Have you tried running md2blog scaffold?`);
    }

    const parsedMarkdown = parseMarkdownFrom(markdownPath);
    const parsedTemplates = parseTemplatesFrom(templatesPath, parsedMarkdown);

    writeTemplates(outPath, parsedTemplates);
    upsertDirectory(stylesPath, stylesOutPath);
}

export function scaffold(src: string, dest: string): void {
    upsertDirectory(src, dest);
    console.log("Finished scaffolding");
}

export function md(args: IMdArgs) {
    const { markdownPath, templateType } = args;

    const timestamp = Date.now();
    const mdTemplate = stripIndent`
        ---
        title: yourtitle
        template: ${templateType}
        timestamp: ${timestamp}
        prettyUrl: true
        ---

        yourcontent
    `;

    const fileOutPath = path.join(markdownPath, `${timestamp}.md`);

    upsertFile(fileOutPath, mdTemplate);
}
import { TestHelper } from "src/test.helper";
import { Message } from "../../../../common/communication/message";

import { Title } from "../../../../common/communication/TitleEnum";
import { ImageService } from "./image.service";

// No types for Jasmine spies
// tslint:disable-next-line:no-any
let httpClientSpy: any;
let imageService: ImageService;

describe("ImageService", () => {
  beforeEach(() => {
    httpClientSpy = jasmine.createSpyObj("HttpClient", ["post"]);
    imageService = new ImageService(httpClientSpy);
  });

  it("should create", () => {
    expect(imageService).toBeTruthy();
  });

  describe("#1 verifyImage(formData: FormData)", () => {

    it("#1.1 Should return a error if the images doesn't respect the format requested or doesn't contain 7 differences.", () => {
      const expectedMessage: Message = {title: Title.FAIL, body: "..."};
      const formDataTest: FormData = new FormData();
      httpClientSpy.post.and.returnValue(TestHelper.asyncData(expectedMessage));
      imageService.verifyImage(formDataTest).subscribe((message: Message) => {
        expect(message.title).toEqual(expectedMessage.title);
      });
    });

    it("#1.2 Should return a succes if the images respect the format requested and contain 7 differences.", () => {
      const expectedMessage: Message = {title: Title.SUCCESS, body: "..."};
      const formDataTest: FormData = new FormData();
      httpClientSpy.post.and.returnValue(TestHelper.asyncData(expectedMessage));
      imageService.verifyImage(formDataTest).subscribe((message: Message) => {
        expect(message.title).toEqual(expectedMessage.title);
      });
    });

  });

});
import {
  BadRequestException,
  forwardRef,
  Inject,
  Injectable,
} from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { AuthService } from 'src/auth/auth.service';
import { Repository } from '


Return value */

    FUNC_ENTER_API_NOINIT
    H5TRACE1("e", "x", is_ts);

    if (is_ts) {
#ifdef H5_HAVE_THREADSAFE
        *is_ts = TRUE;
#else  /* H5_HAVE_THREADSAFE */
        *is_ts = FALSE;
#endif /* H5_HAVE_THREADSAFE */
    }
    else
        ret_value = FAIL;

    FUNC_LEAVE_API_NOINIT(ret_value)
} /* end H5is_library_threadsafe() */

/*-------------------------------------------------------------------------
 * Function:    H5is_library_terminating
 *
 * Purpose:    Checks to see if the library is shutting down.
 *
 * Note:    Useful for plugins to detect when the library is terminating.
 *        For example, a VOL connector could check if a "file close"
 *        callback was the result of the library shutdown process, or
 *        an API action from the application.
 *
 * Return:    SUCCEED/FAIL
 *
 *-------------------------------------------------------------------------
 */
herr_t
H5is_library_terminating(hbool_t *is_terminating /*out*/)
{
    herr_t ret_value = SUCCEED; /* Return value */

    FUNC_ENTER_API_NOINIT
    H5TRACE1("e", "x", is_terminating);

    HDassert(is_terminating);

    if (is_terminating)
        *is_terminating = H5_TERM_GLOBAL;
    else
        ret_value = FAIL;

    FUNC_LEAVE_API_NOINIT(ret_value)
} /* end H5is_library_terminating() */

#if defined(H5_HAVE_THREADSAFE) && defined(H5_BUILT_AS_DYNAMIC_LIB) && defined(H5_HAVE_WIN32_API) &&         \
    defined(H5_HAVE_WIN_THREADS)
/*-------------------------------------------------------------------------
 * Function:    DllMain
 *
 * Purpose:     Handles various conditions in the library on Windows.
 *
 *    NOTE:     The main purpose of this is for handling Win32 thread cleanup
 *              on thread/process detach.
 *
 *              Only enabled when the shared Windows library is built with
 *              thread safety enabled.
 *
 * Return:      TRUE on success, FALSE on failure
 *
 *-------------------------------------------------------------------------
 */
BOOL WINAPI
DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved)
{
    /* Don't add our function enter/leave macros since this function will be
     * called before the library is initialized.
     *
     * NOTE: Do NOT call any CRT functions in DllMain!
     * This includes any functions that are called by from here!
     */

    BOOL fOkay = TRUE;

    switch (fdwReason) {
        case DLL_PROCESS_ATTACH:
            break;

        case DLL_PROCESS_DETACH:
            break;

        case DLL_THREAD_ATTACH:
#ifdef H5_HAVE_WIN_THREADS
            if (H5TS_win32_thread_enter() < 0)
                fOkay = FALSE;
#endif /* H5_HAVE_WIN_THREADS */
            break;

        case DLL_THREAD_DETACH:
#ifdef H5_HAVE_WIN_THREADS
            if (H5TS_win32_thread_exit() < 0)
                fOkay = FALSE;
#endif /* H5_HAVE_WIN_THREADS */
            break;

        default:
            /* Shouldn't get here */
            fOkay = FALSE;
            break;
    }

    return fOkay;
}
#endif /* H5_HAVE_WIN32_API && H5_BUILT_AS_DYNAMIC_LIB && H5_HAVE_WIN_THREADS && H5_HAVE_THREADSAFE*/


e x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");--icon-date:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");--icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(198, 40, 40)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");--icon-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");--icon-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");--icon-time:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");--icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(56, 142, 60)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");color-scheme:light}@media only screen and