: $e")
            }
        } ?: Log.e(TAG, "Failed to start vpn service: vpnProto is null")
    }

    private fun connectToVpn() = vpnServiceMessenger.send(Action.CONNECT)

    private fun stopVpn() = vpnServiceMessenger.send(Action.DISCONNECT)

    @SuppressLint("StartActivityAndCollapseDeprecated")
    private fun startActivityAndCollapseCompat(intent: Intent) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
            startActivityAndCollapse(
                PendingIntent.getActivity(
                    applicationContext,
                    0,
                    intent,
                    PendingIntent.FLAG_IMMUTABLE
                )
            )
        } else {
            @Suppress("DEPRECATION")
            startActivityAndCollapse(intent)
        }
    }

    private fun updateVpnState(state: ProtocolState) =
        scope.launch { VpnStateStore.store { it.copy(protocolState = state) } }

    private fun launchVpnStateListening() =
        scope.launch { VpnStateStore.dataFlow().collectLatest(::updateTile) }

    private fun updateTile(vpnState: VpnState) {
        Log.d(TAG, "Update tile: $vpnState")
        isVpnConfigExists = vpnState.serverName != null
        vpnProto = vpnState.vpnProto
        val tile = qsTile ?: return
        tile.apply {
            label = (vpnState.serverName ?: DEFAULT_TILE_LABEL) + (vpnProto?.let { " ${it.label}" } ?: "")
            when (val protocolState = vpnState.protocolState) {
                CONNECTED -> {
                    state = Tile.STATE_ACTIVE
                    subtitleCompat = null
                }

                DISCONNECTED, UNKNOWN -> {
                    state = Tile.STATE_INACTIVE
                    subtitleCompat = null
                }

                CONNECTING, DISCONNECTING, RECONNECTING -> {
                    state = Tile.STATE_UNAVAILABLE
                    subtitleCompat = getString(protocolState)
                }
            }
            updateTile()
        }
        // double update to fix weird visual glitches
        tile.updateTile()
    }

    private var Tile.subtitleCompat: CharSequence?
        set(value) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
                this.subtitle = value
            }
        }
        get() {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
                return this.subtitle
            }
            return null
        }
}
/*
 * “Commons Clause” License Condition v1.0

 * The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition.

 * Without limiting other conditions in the License, the grant of rights under the License will not include, and the License does not grant to you,  right to Sell the Software.

 * For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide to third parties, for a fee or other consideration (including without limitation fees for hosting or consulting/ support services related to the Software), a product or service whose value derives, entirely or substantially, from the functionality of the Software.  Any license notice or attribution required by the License must also include this Commons Cause License Condition notice.

 * Software: Complications Suite - Wear OS
 * License: Apache-2.0
 * Licensor: amoledwatchfaces™

 * Copyright (c) 2024 amoledwatchfaces™

 * 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


Ptr hwndInsertAfter, int x, int y, int width, int height, uint flags);

        /// <summary>
        /// This button will invoke when help button is clicked.
        /// </summary>
        public abstract void OnHelpButtonClicked();
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);
            IntPtr hwnd = new WindowInteropHelper(this).Handle;
            uint styles = GetWindowLong(hwnd, GWL_STYLE);
            styles &= 0xFFFFFFFF ^ (WS_MINIMIZEBOX | WS_MAXIMIZEBOX);
            SetWindowLong(hwnd, GWL_STYLE, styles);
            styles = GetWindowLong(hwnd, GWL_EXSTYLE);
            styles |= WS_EX_CONTEXTHELP;
            SetWindowLong(hwnd, GWL_EXSTYLE, styles);
            SetWindowPos(hwnd, IntPtr.Zero, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
            ((HwndSource)PresentationSource.FromVisual(this)).AddHook(HelpHook);
        }

        private IntPtr HelpHook(IntPtr hwnd,
        int msg,
        IntPtr wParam,
        IntPtr lParam,
        ref bool handled)
        {
            if (msg == WM_SYSCOMMAND &&
                    ((int)wParam & 0xFFF0) == SC_CONTEXTHELP)
            {

                OnHelpButtonClicked();

                handled = true;
            }
            return IntPtr.Zero;
        }
    }
}


യും) രണ്ട് പുരുഷന്‍മാരെ അല്ലാഹു ഉപമയായി എടുത്തുകാണിക്കുന്നു. അവരില് ഒരാള് യാതൊന്നിനും കഴിവില്ലാത്ത ഊമയാകുന്നു. അവന് തന്‍റെ യജമാനന് ഒരു ഭാരവുമാണ്. അവനെ എവിടേക്ക് തിരിച്ചുവിട്ടാലും അവന് യാതൊരു നന്‍മയും കൊണ്ട് വരില്ല. അവനും, നേരായ പാതയില് നിലയുറപ്പിച്ചുകൊണ്ട് നീതി കാണിക്കാന് കല്‍പിക്കുന്നവനും തുല്യരാകുമോ?"
  },
  {
    "surah_number": 16,
    "verse_number": 77,
    "content":
        "അല്ലാഹുവിന്നാണ് ആകാശങ്ങളിലെയും ഭൂമിയിലെയും അദൃശ്യജ്ഞാനമുള്ളത്. അന്ത്യസമയത്തിന്‍റെ കാര്യം കണ്ണ് ഇമവെട്ടും പോലെ മാത്രമാകുന്നു. അഥവാ അതിനെക്കാള് വേഗത കൂടിയതാകുന്നു. തീര്‍ച്ചയായും അല്ലാഹു ഏത് കാര്യത്തിനും കഴിവുള്ളവനാകുന്നു."
  },
  {
    "surah_number": 16,
    "verse_number": 78,
    "content":
        "നിങ്ങളുടെ മാതാക്കളുടെ ഉദരങ്ങളില്


 {
                    args[index] = mHostContext.getPackageName();
                }
            }
            return super.beforeInvoke(receiver, method, args);
        }
    }
}
/*
**        DroidPlugin Project
**
** Copyright(c) 2015 Andy Zhang <zhangyong232@gmail.com>
**
** This file is part of DroidPlugin.
**
** DroidPlugin is free software: you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation, either
** version 3 of the License, or (at your option) any later version.
**
** DroidPlugin is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with DroidPlugin.  If not, see <http://www.gnu.org/licenses/lgpl.txt>
**
**/

package com.morgoo.droidplugin.hook.proxy;

import android.content.Context;
import android.util.AndroidRuntimeException;

import com.morgoo.droidplugin.hook.BaseHookHandle;
import com.morgoo.droidplugin.hook.handle.IActivityManagerHookHandle;
import com.morgoo.droidplugin.reflect.FieldUtils;
import com.morgoo.droidplugin.reflect.Utils;
import com.morgoo.helper.Log;
import com.morgoo.helper.MyProxy;
import com.morgoo.helper.compat.ActivityManagerNativeCompat;
import com.morgoo.helper.compat.IActivityManagerCompat;
import com.morgoo.helper.compat.SingletonCompat;

import java.util.List;

/**
 * Hook some function on IActivityManager
 * <p/>
 * Code by Andy Zhang (zhangyong232@gmail.com) on 15/2/7.
 */
public class IActivityManagerHook extends ProxyHook {

    private static final String TAG = IActivityManagerHook.class.getSimpleName();

    public IActivityManagerHook(Context hostContext) {
        super(hostContext);
    }

    @Override
    public BaseHookHandle createHookHandle() {
        return new IActivityManagerHookHandle(mHostContext);
    }

    @Override
    public void onInstall(ClassLoader classLoader) throws Throwable {
        Class cls = ActivityManagerNativeCompat.Class();
        Object obj = FieldUtils.readStaticField(cls, "gDefault");
        if (obj == null) {
            ActivityManagerNativeCompat.getDefault();
            obj = FieldUtils.readStaticField(cls, "gDefault");
        }

        if (IActivityManagerCompat.isIActivityManager(obj)) {
            setOldObj(obj);
            Class<?> objClass = mOldObj.getClass();
            List<Class<?>> interfaces = Utils.getAllInterfaces(objClass);
            Class[] ifs = interfaces != null && interfaces.size() > 0 ? interfaces.toArray(new Class[interfaces.size()]) : new Class[0];
            Object proxiedActivityManager = MyProxy.newProxyInstance(objClass.getClassLoader(), ifs, this);
            FieldUtils.writeStaticField(cls, "gDefault", proxiedActivityManager);
            Log.i(TAG, "Install ActivityManager Hook 1 old=%s,new=%s", mOldObj, proxiedActivityManager);
        } else if (SingletonCompat.isSingleton(obj)) {
            Object obj1 = FieldUtils.readField(obj, "mInstance");
            if (obj1 == null) {
                SingletonCompat.get(obj);
                obj1 = FieldUtils.readField(obj, "mInstance");
            }
            setOldObj(obj1);
            List<Class<?>> interfaces = Utils.getAllInterfaces(mOldObj.getClass());
            Class[] ifs = interfaces != null && interfaces.size() > 0 ? interfac


           (History item) => <String, Object?>{
                  'id': item.id,
                  'uid': item.uid,
                  'time': item.time,
                  'content': item.content,
                  'type': item.type,
                  'devId': item.devId,
                  'top': item.top ? 1 : 0,
                  'sync': item.sync ? 1 : 0,
                  'size': item.size,
                  'updateTime': item.updateTime,
                  'source': item.source
                });

  final sqflite.DatabaseExecutor database;

  final StreamController<String> changeListener;

  final QueryAdapter _queryAdapter;

  final InsertionAdapter<History> _historyInsertionAdapter;

  final UpdateAdapter<History> _historyUpdateAdapter;

  @override
  Future<History?> getLatestLocalClip(int uid) async {
    return _queryAdapter.query(
        'select * from history where uid = ?1 order by id desc limit 1',
        mapper: (Map<String, Object?> row) => History(
            id: row['id'] as int,
            uid: row['uid'] as int,
            time: row['time'] as String,
            content: row['content'] as String,
            type: row['type'] as String,
            devId: row['devId'] as String,
            size: row['size'] as int,
            top: (row['top'] as int) != 0,
            sync: (row['sync'] as int) != 0,
            updateTime: row['updateTime'] as String?,
            source: row['source'] as String?),
        arguments: [uid]);
  }

  @override
  Future<List<History>> getHistoriesPageByWhere(
    int uid,
    int fromId,
    String content,
    String type,
    List<String> tags,
    List<String> devIds,
    List<String> appIds,
    String startTime,
    String endTime,
    bool onlyNoSync,
    bool ignoreTop,
  ) async {
    int offset = 9;
    final _sqliteVariablesForTags =
        Iterable<String>.generate(tags.length, (i) => '?${i + offset}')
            .join(',');
    offset += tags.length;
    final _sqliteVariablesForDevIds =
        Iterable<String>.generate(devIds.length, (i) => '?${i + offset}')
            .join(',');
    offset += devIds.length;
    final _sqliteVariablesForAppIds =
        Iterable<String>.generate(appIds.length, (i) => '?${i + offset}')
            .join(',');
    return _queryAdapter.queryList(
        'SELECT * FROM History   WHERE uid = ?1     AND (?2 = 0 OR id < ?2)     AND (?3 = \'\' OR content LIKE \'%\' || ?3 || \'%\')     AND (?4 = \'\' OR type = ?4)     AND (?5 = \'\' OR ?6 = \'\' OR date(time) BETWEEN ?5 AND ?6)     AND (length(null in (' +
            _sqliteVariablesForDevIds +
            ')) = 1 OR devId IN (' +
            _sqliteVariablesForDevIds +
            '))     AND (length(null in (' +
            _sqliteVariablesForAppIds +
            ')) = 1 OR source IN (' +
            _sqliteVariablesForAppIds +
            '))     AND (length(null in (' +
            _sqliteVariablesForTags +
            ')) = 1 OR id IN (       SELECT DISTINCT hisId       FROM HistoryTag       WHERE tagName IN (' +
            _sqliteVariablesForTags +
            ')     ))     AND (?7 = 1 AND sync = 0 OR ?7 != 1)   ORDER BY      CASE WHEN ?8 = 1 THEN 0 ELSE top END DESC,      id DESC   LIMIT 100',
        mapper: (Map<String, Object?> row) => History(
            id: row['id'] as int,
            uid: row['uid'] as int,
            time: row['time'] as String,
            content: row['content'] as String,
            type: row['type'] as String,
            devId: row['devId'] as String,
            size: row['size'] as int,
            top: (row['


function for asynchronous execution.
    ///
    /// Documentation:
    /// [Swift](https://developer.apple.com/documentation/dispatch/dispatchqueue/2016098-async) |
    /// [Objective-C](https://developer.apple.com/documentation/dispatch/1452834-dispatch_async_f?language=objc)
    ///
    /// # Safety
    ///
    /// It is safe to panic within the `work` function. Panics will abort the
    /// process.
    ///
    /// If the overhead of the extra setup is undesirable or you would like to
    /// handle panics yourself, use
    /// [`spawn_async_no_panic`](Self::spawn_async_no_panic) or
    /// [`spawn_async_raw`](Self::spawn_async_raw) instead.
    #[inline]
    #[doc(alias = "dispatch_async")]
    #[doc(alias = "dispatch_async_f")]
    pub fn spawn_async<F>(&self, work: F)
    where
        F: Send + FnOnce() + 'static,
    {
        // Wrap `work` to abort on panic.
        let work = || match panic::catch_unwind(panic::AssertUnwindSafe(work)) {
            Ok(()) => {}
            Err(_error) => process::abort(),
        };

        // SAFETY: Any panics within `work` are caught.
        unsafe { self.spawn_async_no_panic(work) };
    }

    /// Submits a function for asynchronous execution, without catching panics.
    ///
    /// Documentation:
    /// [Swift](https://developer.apple.com/documentation/dispatch/dispatchqueue/2016098-async) |
    /// [Objective-C](https://developer.apple.com/documentation/dispatch/1452834-dispatch_async_f?language=objc)
    ///
    /// # Safety
    ///
    /// It is undefined behavior to panic within the `work` function because it
    /// is called from an `extern "C" fn`. Catch the panic yourself or call
    /// [`spawn_async`](Self::spawn_async) instead.
    #[inline]
    #[doc(alias = "dispatch_async")]
    #[doc(alias = "dispatch_async_f")]
    pub unsafe fn spawn_async_no_panic<F>(&self, work: F)
    where
        F: Send + FnOnce() + 'static,
    {
        extern "C" fn wrapped_work<F>(ctx: *mut F)
        where
            F: Send + FnOnce() + 'static,
        {
            // SAFETY: `work` is only used from within this function.
            let work = unsafe { Box::from_raw(ctx) };

            work();
        }

        self.spawn_async_raw(Box::into_raw(Box::new(work)), wrapped_work);
    }

    /// Submits a C function with a context pointer for asynchronous execution.
    ///
    /// Documentation:
    /// [Objective-C](https://developer.apple.com/documentation/dispatch/1452834-dispatch_async_f?language=objc)
    #[inline]
    #[doc(alias = "dispatch_async")]
    #[doc(alias = "dispatch_async_f")]
    pub fn spawn_async_raw<Ctx>(&self, ctx: *mut Ctx, work: extern "C" fn(*mut Ctx)) {
        unsafe {
            // SAFETY: Both functions have the same ABI.
            let work: DispatchFn = mem::transmute(work);

            // SAFETY: The queue and `work` are non-null, which is required by
            // this function.
            //
            // And `work` is not an `unsafe fn`, so it needs to handle safety
            // internally.
            sys::dispatch_async_f(self, ctx.cast(), work);
        }
    }

    /// Submits a function for synchronous execution and returns the function's
    /// result after it finishes executing.
    ///
    /// Documentation:
    /// [Swift](https://


tery"] = {
            "잠들지 않는 아즈쉬르", "타락한 용사", "무쇠해골"
        },
        ["Badlands"] = {
            "7:XT", "아나테무스", "부러진 송곳니", "우레정령", "어둠괴철로 사령관",
            "철옹성", "전쟁 골렘", "자리코틀"
        },
        ["The Hinterlands"] = {
            "그림운거스", "무쇠껍질", "잘린데 서머드레이크",
            "마법부여사 미스레디스", "늙은 절벽껑충늑대", "서슬갈퀴",
            "광전사 레세로크", "리크", "추적자 메마른심장",
            "줄라렉 헤이트파울러"
        },
        ["Stranglethorn Vale"] = {
            "글루글", "쿠르모크", "군주 사크라시스", "모쉬오그 도살꾼", "리파",
            "로로취", "무쇠비늘 바실리스크", "방패부대 병참장교", "베리포닉스"
        },
        ["Tanaris"] = {
            "해골 마녀", "미치광이 사이클록", "잿불날개",
            "포악한 하르카", "모래술사 진잘라", "크레그 킬홀",
            "성큼걸이 누더기골렘", "피에 굶주린 문둥발하이에나", "실성한 옴고른",
            "파멸의 소리드", "저주받은 자의 영혼", "부대장 크라질락"
        },
        ["Maraudon"] = {"정원사 메슬로크"},
        ["Felwood"] = {
            "맹독숨결 알쉬르", "검은울음", "데시쿠스", "이몰라투스", "몽그레스",
            "지혜의 오름", "성난발톱", "온가르"
        },
        ["Azshara"] = {
            "안틸로스", "해골 마녀", "문지기 레이지로어", "장군 팽페러",
            "여군주 세스피라", "성큼걸이 누더기골렘", "마법학자 호크헬름",


  impl_accessors!(x5u, try_x5u, &Url);
  impl_accessors!(x5c, try_x5c, &[String]);
  impl_accessors!(x5t, try_x5t, &str);
  impl_accessors!(x5t_s256, try_x5t_s256, &str);
  impl_accessors!(typ, try_typ, &str);
  impl_accessors!(cty, try_cty, &str);
  impl_accessors!(crit, try_crit, &[String]);
  impl_accessors!(url, try_url, &Url);
  impl_accessors!(nonce, try_nonce, &str);
}

#[rustfmt::skip]
impl<'a> JwtHeaderSet<'a, JwsHeader> {
  impl_accessors!(@unwrapped, alg, try_alg, JwsAlgorithm);
  impl_accessors!(@protected, b64, try_b64, bool);
  impl_accessors!(@protected, ppt, try_ppt, &str);
}

#[rustfmt::skip]
impl<'a> JwtHeaderSet<'a, JweHeader> {
  impl_accessors!(@unwrapped, alg, try_alg, JweAlgorithm);
  impl_accessors!(@unwrapped, enc, try_enc, JweEncryption);
  impl_accessors!(zip, try_zip, JweCompression);
  impl_accessors!(epk, try_epk, &Jwk);
  impl_accessors!(@protected, apu, try_apu, &str);
  impl_accessors!(@protected, apv, try_apv, &str);
  impl_accessors!(@protected, iv, try_iv, &str);
  impl_accessors!(@protected, tag, try_tag, &str);
  impl_accessors!(@protected, p2s, try_p2s, &str);
  impl_accessors!(@protected, p2c, try_p2c, u64);
}

impl<'a, T: 'a> Default for JwtHeaderSet<'a, T> {
  fn default() -> Self {
    Self::new()
  }
}
//! Platform-specific implementation for MacOS.

use std::os::raw::c_void;
use std::sync::mpsc::{channel, Receiver};

use cocoa::base::id;
use objc::{msg_send, rc::StrongPtr, sel, sel_impl};
use raw_window_handle::{AppKitHandle, HasRawWindowHandle, RawWindowHandle};

use crate::event::WindowEvent;
use crate::platform::os::event_proxy_class::instantiate_event_proxy;
use crate::{InvalidParentError, SetupError};

mod event_proxy_class;

pub(in crate::platform) struct EditorWindowImpl {
    event_proxy: StrongPtr,
    incoming_events: Receiver<WindowEvent>,

    ns_window: StrongPtr,
}

unsafe impl HasRawWindowHandle for EditorWindowImpl {
    fn raw_window_handle(&self) -> RawWindowHandle {
        let mut handle = AppKitHandle::empty();
        handle.ns_window = *self.ns_window as *mut c_void;
        handle.ns_view = *self.event_proxy as *mut c_void;
        RawWindowHandle::AppKit(handle)
    }
}

impl crate::platform::EditorWindowBackend for EditorWindowImpl {
    unsafe fn build(
        parent: *mut std::os::raw::c_void,
        size_xy: (i32, i32),
    ) -> Result<Self, SetupError> {
        // TODO validate window size

        // return error if parent is nil to aid debugging
        if parent.is_null() {
            return Err(SetupError::new(InvalidParentError::new(parent)));
        }

        let parent = parent as id;

        let ns_window = unsafe {
            let window: id = msg_send![parent, window];

            StrongPtr::retain(window)
        };

        let (event_sender, incoming_events) = channel();

        let event_proxy: StrongPtr =
            unsafe { instantiate_event_proxy(parent, event_sen


checkLineDiff()

	if v := <-fs.Lines(); v != nil {
		t.Errorf("expecting filestream to be complete because stopped")
	}
}

func TestFileStreamReadOneShot(t *testing.T) {
	var wg sync.WaitGroup

	tmpDir := testutil.TestTempDir(t)

	name := filepath.Join(tmpDir, "log")
	f := testutil.TestOpenFile(t, name)
	defer f.Close()
	testutil.WriteString(t, f, "yo\n")

	ctx, cancel := context.WithCancel(context.Background())
	waker := waker.NewTestAlways()

	fs, err := logstream.New(ctx, &wg, waker, name, logstream.OneShotEnabled)
	testutil.FatalIfErr(t, err)

	expected := []*logline.LogLine{
		{Context: context.TODO(), Filename: name, Line: "yo"},
	}
	checkLineDiff := testutil.ExpectLinesReceivedNoDiff(t, expected, fs.Lines())

	// The stream should end at EOF in oneshot, no need to cancel
	wg.Wait()

	checkLineDiff()

	if v := <-fs.Lines(); v != nil {
		t.Errorf("expecting filestream to be complete because stopped")
	}
	cancel()
	wg.Wait()
}

func TestFileStreamReadNonSingleByteEnd(t *testing.T) {
	var wg sync.WaitGroup

	tmpDir := testutil.TestTempDir(t)

	name := filepath.Join(tmpDir, "log")
	f := testutil.TestOpenFile(t, name)
	defer f.Close()

	ctx, cancel := context.WithCancel(context.Background())
	waker, awaken := waker.NewTest(ctx, 1, "stream")
	fs, err := logstream.New(ctx, &wg, waker, name, logstream.OneShotDisabled)
	testutil.FatalIfErr(t, err)

	s := "a"
	for i := 0; i < 4094; i++ {
		s += "a"
	}
	s += "中"

	expected := []*logline.LogLine{
		{Context: context.TODO(), Filename: name, Line: s},
	}
	checkLineDiff := testutil.ExpectLinesReceivedNoDiff(t, expected, fs.Lines())

	awaken(1, 1)

	testutil.WriteString(t, f, s+"\n")
	awaken(1, 1)

	cancel()
	wg.Wait()

	checkLineDiff()

	if v := <-fs.Lines(); v != nil {
		t.Errorf("expecting filestream to be complete because stopped")
	}
	cancel()
	wg.Wait()
}

func TestStreamDoesntBreakOnCorruptRune(t *testing.T) {
	t.Skip("should move to reader_test.go")
	var wg sync.WaitGroup

	tmpDir := testutil.TestTempDir(t)

	name := filepath.Join(tmpDir, "log")
	f := testutil.TestOpenFile(t, name)
	defer f.Close()

	ctx, cancel := context.WithCancel(context.Background())
	waker, awaken := waker.NewTest(ctx, 1, "stream")

	fs, err := logstream.New(ctx, &wg, waker, name, logstream.OneShotDisabled)
	testutil.FatalIfErr(t, err)

	s := string([]byte{0xF1})
	// 0xF1 = 11110001 , a byte signaling the start of a unicode character that
	// is 4 bytes long.

	// The following characters are regular single-byte characters.
	// utf8.DecodeRune will expect bytes that start with a 1 after the initial
	// unicode character 0xF1. This will result in a RuneError.
	for i := 0; i < 100; i++ {
		s += "a"
	}
	expected := []*logline.LogLine{


ool_accounts.owner.pubkey(), false),
        AccountMeta::new_readonly(stake_pool_accounts.withdraw_authority, false),
        AccountMeta::new(user_stake.stake_account, false),
        AccountMeta::new_readonly(new_staking_pubkey, false),
        AccountMeta::new_readonly(sysvar::clock::id(), false),
        AccountMeta::new_readonly(stake::id(), false),
    ];
    let instruction = Instruction {
        program_id: id(),
        accounts,
        data,
    };

    let mut transaction = Transaction::new_with_payer(&[instruction], Some(&payer.pubkey()));
    transaction.sign(&[&payer], recent_blockhash);
    let transaction_error = banks_client
        .process_transaction(transaction)
        .await
        .err()
        .unwrap();

    match transaction_error {
        TransportError::TransactionError(TransactionError::InstructionError(
            _,
            InstructionError::Custom(error_index),
        )) => {
            let program_error = error::StakePoolError::SignatureMissing as u32;
            assert_eq!(error_index, program_error);
        }
        _ => panic!("Wrong error occurs while try to set staking authority without signature"),
    }
}
/* automatically generated by rust-bindgen */

#![allow(warnings)]
#[link(name = "avutil")]
extern "C" {}

#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage, Align> {
    storage: Storage,
    align: [Align; 0],
}
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align> {
    #[inline]
    pub const fn new(storage: Storage) -> Self {
        Self { storage, align: [] }
    }
}
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align>
where
    Storage: AsRef<[u8]> + AsMut<[u8]>,
{
    #[inline]
    pub fn get_bit(&self, index: usize) -> bool {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = self.storage.as_ref()[byte_index];
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        byte & mask == mask
    }
    #[inline]
    pub fn set_bit(&mut self, index: usize, val: bool) {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = &mut self.storage.as_mut()[byte_index];
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        if val {
            *byte |= mask;
        } else {
            *byte &= !mask;
        }
    }
    #[inline]
    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        let mut val = 0;
        for i in 0..(bit_width as usize) {
            if self.get_bit(i + bit_offset) {
                let index = if cfg!(target_endian = "big") {
                    bit_width as usize - 1 - i
                } else {
                    i
                };
                val |= 1 << index;
            }
        }
        val


p(d=>d.split(",")))})}}getClasses(){return this.classes}getData(){const e=ke(),u=[],h=[];for(const r of this.requirements.values()){const n=r;n.id=r.name,n.cssStyles=r.cssStyles,n.cssClasses=r.classes.join(" "),n.shape="requirementBox",n.look=e.look,u.push(n)}for(const r of this.elements.values()){const n=r;n.shape="requirementBox",n.look=e.look,n.id=r.name,n.cssStyles=r.cssStyles,n.cssClasses=r.classes.join(" "),u.push(n)}for(const r of this.relations){let n=0;const d=r.type===this.Relationships.CONTAINS,g={id:`${r.src}-${r.dst}-${n}`,start:this.requirements.get(r.src)?.name??this.elements.get(r.src)?.name,end:this.requirements.get(r.dst)?.name??this.elements.get(r.dst)?.name,label:`<<${r.type}>>`,classes:"relationshipLine",style:["fill:none",d?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:d?"normal":"dashed",arrowTypeEnd:d?"requirement_contains":"requirement_arrow",look:e.look};h.push(g),n++}return{nodes:u,edges:h,other:{},config:e,direction:this.getDirection()}}},ot=o(e=>`

  marker {
    fill: ${e.relationColor};
    stroke: ${e.relationColor};
  }

  marker.cross {
    stroke: ${e.lineColor};
  }

  svg {
    font-family: ${e.fontFamily};
    font-size: ${e.fontSize};
  }

  .reqBox {
    fill: ${e.requirementBackground};
    fill-opacity: 1.0;
    stroke: ${e.requirementBorderColor};
    stroke-width: ${e.requirementBorderSize};
  }

  .reqTitle, .reqLabel{
    fill:  ${e.requirementTextColor};
  }
  .reqLabelBox {
    fill: ${e.relationLabelBackground};
    fill-opacity: 1.0;
  }

  .req-title-line {
    stroke: ${e.requirementBorderColor};
    stroke-width: ${e.requirementBorderSize};
  }
  .relationshipLine {
    stroke: ${e.relationColor};
    stroke-width: 1;
  }
  .relationshipLabel {
    fill: ${e.relationLabelColor};
  }
  .divider {
    stroke: ${e.nodeBorder};
    stroke-width: 1;
  }
  .label {
    font-family: ${e.fontFamily};
    color: ${e.nodeTextColor||e.textColor};
  }
  .label text,span {
    fill: ${e.nodeTextColor||e.textColor};
    color: ${e.nodeTextColor||e.textColor};
  }
  .labelBkg {
    background-color: ${e.edgeLabelBackground};
  }

`,"getStyles"),ht=ot,Ye={};it(Ye,{draw:()=>ut});var ut=o(async function(e,u,h,r){Ne.info("REF0:"),Ne.info("Drawing requirement diagram (unified)",u);const{securityLevel:n,state:d,layout:g}=ke(),R=r.db.getData(),_=je(u,n);R.type=r.type,R.layoutAlgorithm=rt(g),R.nodeSpacing=d?.nodeSpacing??50,R.rankSpacing=d?.rankSpacing??50,R.markers=["requirement_contains","requirement_arrow"],R.diagramId=u,await nt(R,_);const b=8;at.insertTitle(_,"requirementDiagramTitleText",d?.titleTopMargin??25,r.db.getDiagramTitle()),ze(_,b,"requirementDiagram",d?.useMaxWidth??!0)},"draw"),Rt={parser:


parthenos, of the double fish-tailed variety.

The Mixoparthenos is a mythical creature whose image, to this day, is seen in the coastal areas around the Greek colonies of the Black Sea, where wheat has been a major crop since ancient times.

Herodotus writes that the horses of Heracles were stolen by the Mixoparthenos, who promised to return them if he mated with her. How could Hercules resist! From their union came three sons, the youngest, Scythes, the only son who could bend the bow of Hercules. He became king of the people who would be called Scythian. There were many Scythian wheat growers around the Black Sea.

[sources here and <a href="https://en.m.wikipedia.org/wiki/File:The_Mixoparthenos_(half-maiden),_a_hybrid_creature_from_the_Black_Sea,_limestone_sculpture,_1st-2nd_century_AD,_from_Panticapaeum,_Taurica_(Crimea)_(12852697335).jpg" target="_blank" rel="noopener" data-saferedirecturl="https://www.google.com/url?q=https://en.m.wikipedia.org/wiki/File:The_Mixoparthenos_(half-maiden),_a_hybrid_creature_from_the_Black_Sea,_limestone_sculpture,_1st-2nd_century_AD,_from_Panticapaeum,_Taurica_(Crimea)_(12852697335).jpg&source=gmail&ust=1711201624300000&usg=AOvVaw3_98ET6lIhRme-V5HYftgO">here]

I knew of this figure before, when Miriam Robbins Dexter and I wrote Sacred Display (see Selected readings below) but my attention was drawn to it today by this article:

"Legacy of the Scythians:  How the ancient warrior people of the steppes have found themselves on the cultural frontlines of Russia’s war against Ukraine", Peter Mumford, aeon (3/18/24)

This is a bipolar presentation, swinging between politics and history-culture.  I'm not very much interested in the former, but fortunately there is plenty enough


 []byte) (bool, error) {
	db.lock.RLock()
	defer db.lock.RUnlock()

	_, ok := db.db[string(key)]
	return ok, nil
}

func (db *MemDatabase) Get(key []byte) ([]byte, error) {
	db.lock.RLock()
	defer db.lock.RUnlock()

	if entry, ok := db.db[string(key)]; ok {
		return common.CopyBytes(entry), nil
	}
	return nil, errors.New("not found")
}

func (db *MemDatabase) Keys() [][]byte {
	db.lock.RLock()
	defer db.lock.RUnlock()

	keys := [][]byte{}
	for key := range db.db {
		keys = append(keys, []byte(key))
	}
	return keys
}

func (db *MemDatabase) Delete(key []byte) error {
	db.lock.Lock()
	defer db.lock.Unlock()

	delete(db.db, string(key))
	return nil
}

func (db *MemDatabase) Close() {}

func (db *MemDatabase) NewBatch() Batch {
	return &memBatch{db: db}
}

func (db *MemDatabase) Len() int { return len(db.db) }

type kv struct{ k, v []byte }

type memBatch struct {
	db     *MemDatabase
	writes []kv
	size   int
}

func (b *memBatch) Put(key, value []byte) error {
	b.writes = append(b.writes, kv{common.CopyBytes(key), common.CopyBytes(value)})
	b.size += len(value)
	return nil
}

func (b *memBatch) Write() error {
	b.db.lock.Lock()
	defer b.db.lock.Unlock()

	for _, kv := range b.writes {
		b.db.db[string(kv.k)] = kv.v
	}
	return nil
}

func (b *memBatch) ValueSize() int {
	return b.size
}

func (b *memBatch) Reset() {
	b.writes = b.writes[:0]
	b.size = 0
}
// Copyright (c) 2018 The MATRIX Authors
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php

package mandb

// Code using batches should try to add this much data to the batch.
// The value was determined empirically.
const IdealBatchSize = 100 * 1024

// Putter wraps the database write operation supported by both batches and regular databases.
type Putter interface {
	Put(key []byte, value []byte) error
}

// Database wraps all database operations. All methods are safe for concurrent use.(并行使用)
type Database interface {
	Putter
	Get(key []byte) ([]byte, error)
	Has(key []byte) (bool, error)
	Delete(key []byte) error
	Close()
	NewBatch() Batch
}

// Batch is a write-only database that commits changes to its host database
// when Write is called. Batch cannot be used concurrently.
type Batch interface {
	Putter
	ValueSize() int // amount of data in the batch
	Write() error
	// Reset resets the batch for reuse
	Reset()
}
// Copyright (c) 2018 The MATRIX Authors
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php

package depoistInfo

import (
	"context"
	"math/big"

	"reflect"

	"github.com/MatrixAINetwork/go-matrix/common"
	"github.com/MatrixAINetwork/go-matrix/core/state"
	"github.com/MatrixAINetwork/go-matrix/core/types"
	"github.com/MatrixAINetwork/go-matrix/core/vm"
	"github.com/MatrixAINetwork/go-m


,
			nadC: c.NadC,
		}

		err := setClusterConfigRegion(ctx, g.k8sC, region, dbName)
		assert.Nil(t, err)

		err = g.RunInit(ctx)
		assert.Nil(t, err, "%+v", err)

		region, err = g.octeliumC.CoreC().GetRegion(ctx, &rmetav1.GetOptions{
			Name: region.Metadata.Name,
		})
		assert.Nil(t, err)

		{
			svcList, err := g.getAllServices(ctx, region)
			assert.Nil(t, err)
			assert.True(t, len(svcList) > 0)
		}

		{
			err = g.RunUpgrade(ctx)
			assert.Nil(t, err, "%+v", err)
		}

		{
			err = g.RunUpgrade(ctx)
			assert.Nil(t, err, "%+v", err)
		}
	}
}
/*
 * Copyright Octelium Labs, LLC. All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License version 3,
 * as published by the Free Software Foundation of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package components

import (
	"context"

	"github.com/octelium/octelium/apis/main/corev1"
	"github.com/octelium/octelium/cluster/common/components"
	"github.com/octelium/octelium/cluster/common/k8sutils"
	utils_types "github.com/octelium/octelium/pkg/utils/types"
	appsv1 "k8s.io/api/apps/v1"
	k8scorev1 "k8s.io/api/core/v1"
	networkingv1 "k8s.io/api/networking/v1"
	"k8s.io/apimachinery/pkg/api/resource"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/util/intstr"
	"k8s.io/client-go/kubernetes"
)

func getRscServerService() *k8scorev1.Service {

	ret := &k8scorev1.Service{
		ObjectMeta: metav1.ObjectMeta{
			Name:      getComponentName(componentRscServer),
			Namespace: ns,
			Labels:    getComponentLabels(componentRscServer),
		},
		Spec: k8scorev1.ServiceSpec{
			Type:     k8scorev1.ServiceTypeClusterIP,
			Selector: getComponentLabels(componentRscServer),
			Ports: []k8scorev1.ServicePort{
				{
					Protocol: k8scorev1.ProtocolTCP,
					Port:     8080,
					TargetPort: intstr.IntOrString{
						Type:   intstr.Int,
						IntVal: 8080,
					},
				},
			},
		},
	}

	return ret
}

func getRscServerDeployment(c *corev1.ClusterConfig) *appsv1.Deployment {

	deployment := &appsv1.Deployment{
		ObjectMeta: metav1.ObjectMeta{
			Name:      getComponentName(componentRscServer),
			Namespace: ns,
			Labels:    getComponentLabels(componentRscServer),
		},
		Spec: appsv1


ta {
		width: 75%;
		margin: auto;
	}
}

@media screen and (min-width: 992px) {

	.lqd-blog-post-style-1 .lqd-post-header,
	.lqd-blog-post-style-2 .lqd-post-header {
		max-width: 940px;
		margin: auto;
	}

	.lqd-blog-post-style-1 h1.entry-title,
	.lqd-blog-post-style-2 h1.entry-title {
		font-size: 70px;
	}

	.lqd-blog-post-style-1 .entry-meta,
	.lqd-blog-post-style-2 .entry-meta {
		width: 90%;
	}

	.lqd-blog-post-style-3 .main-header-overlay~#lqd-site-content #lqd-contents-wrap {
		padding-top: 100px;
	}
}

@media screen and (min-width: 1200px) {

	.lqd-blog-post-style-1 .entry-meta,
	.lqd-blog-post-style-2 .entry-meta {
		width: 70%;
	}
}

@media screen and (max-width: 768px) {

	.lqd-blog-post-style-3 h1.entry-title,
	.lqd-blog-post-style-4 h1.entry-title,
	.lqd-blog-post-style-6 h1.entry-title,
	.lqd-blog-post-style-7 h1.entry-title {
		font-size: 40px;
	}

	.lqd-blog-post-style-1 .lqd-post-header,
	.lqd-blog-post-style-2 .lqd-post-header {
		padding-top: 25vmin;
		padding-bottom: 25vmin;
	}
}

@media screen and (max-width: 479px) {
	.lqd-blog-post .lqd-post-header h1.entry-title {
		font-size: clamp(32px, 20vmax, 50px);
	}

	.lqd-blog-post-style-3 .lqd-post-header h1.entry-title {
		font-size: clamp(30px, 4vmax, 42px);
	}

	.lqd-blog-post-style-4 .lqd-post-header h1.entry-title,
	.lqd-blog-post-style-6 .lqd-post-header h1.entry-title,
	.lqd-blog-post-style-7 .lqd-post-header h1.entry-title {
		font-size: clamp(30px, 4.5vmax, 42px);
	}
}

.entry-meta {
	color: #000;
	font-size: 14px;
}

.entry-meta a {
	color: inherit;
}

.entry-meta a:hover {
	opacity: 0.7;
}

.entry-meta>div {
	display: flex;
	align-items: center;
	margin-bottom: 1.2em;
}

.entry-meta .byline>span>span:first-of-type,
.entry-meta .cat-links>span:first-of-type,
.entry-meta .posted-on>span:first-of-type {
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	overflow: hidden;
	position: absolute;
	top: 0;
	left: 0;
	width: 1px;
	word-wrap: normal;
}

.entry-meta .byline {
	flex-direction: row;
	align-items: center;
}

.entry-meta .byline figure {
	width: 42px;
	flex-shrink: 0


de>

2.给Module集成WeexSDK

给module的build.gradle文件添加如下配置

添加完以后，点击Sync Now去同步配置即可，至此，weex sdk已经集成完毕。

集成完sdk以后，我们可以在AS中看到weex的源码。

3.开发.we源码

使用notepad++或者记事本等开发如下源码，保存文件扩展名为.we即可，自行百度关键字如何显示文件扩展名。

4.编译.we源码为js文件

打开命令行，cd到.we源码的目录，执行：weex xxx.we

没有报错，编译成功，会自动打开浏览器，在浏览器显示我们开发的界面，在源码相应的文件夹也会生成js文件。

在浏览器运行后的效果。

编译.we源码生成的js文件，可以在源码的同级目录下找到。

5.初始化sdk

5.1 实现图片下载适配器，如果项目中有图片展示，必须实现，否则图片无法显示。在刚刚的Module新建一个ImageAdapter类，实现IWXImgLoaderAdapter接口。由于我们这里展示的是HelloWorld，所以可以先不写具体的setImage（）方法里面的实现。

5.2 在Module的Application的onCreate（）处初始化WeexSDK。
       public class HelloWorldApplication extends Application {
          @Override
          public void onCreate() {
                super.onCreate();
                //初始化WXSDK
                InitConfig config = new InitConfig.Builder().setImgAdapter(new ImageAdapter()).build();
               WXSDKEngine.initialize(this, config);
    }
  }

5.3 在Module的AndroidManifest文件设置android:name=".HelloWorldApplication"

6.实现渲染

6.1 先去掉原生的效果，防止干扰，把原生的activity_main.xml里面的TextView控件删除。

    6.2 把编译后生成的.js文件复制到Module的asserts资源文件夹下面</


memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n


ps	-8192(%edx), %zmm6, %k5	 # AVX512F Disp8
	vcmpunordps	-8256(%edx), %zmm6, %k5	 # AVX512F
	vcmpunordps	508(%edx){1to16}, %zmm6, %k5	 # AVX512F Disp8
	vcmpunordps	512(%edx){1to16}, %zmm6, %k5	 # AVX512F
	vcmpunordps	-512(%edx){1to16}, %zmm6, %k5	 # AVX512F Disp8
	vcmpunordps	-516(%edx){1to16}, %zmm6, %k5	 # AVX512F

	vcmpneq_uqps	%zmm5, %zmm6, %k5	 # AVX512F
	vcmpneq_uqps	%zmm5, %zmm6, %k5{%k7}	 # AVX512F
	vcmpneq_uqps	{sae}, %zmm5, %zmm6, %k5	 # AVX512F
	vcmpneq_uqps	(%ecx), %zmm6, %k5	 # AVX512F
	vcmpneq_uqps	-123456(%esp,%esi,8), %zmm6, %k5	 # AVX512F
	vcmpneq_uqps	(%eax){1to16}, %zmm6, %k5	 # AVX512F
	vcmpneq_uqps	8128(%edx), %zmm6, %k5	 # AVX512F Disp8
	vcmpneq_uqps	8192(%edx), %zmm6, %k5	 # AVX512F
	vcmpneq_uqps	-8192(%edx), %zmm6, %k5	 # AVX512F Disp8
	vcmpneq_uqps	-8256(%edx), %zmm6, %k5	 # AVX512F
	vcmpneq_uqps	508(%edx){1to16}, %zmm6, %k5	 # AVX512F Disp8
	vcmpneq_uqps	512(%edx){1to16}, %zmm6, %k5	 # AVX512F
	vcmpneq_uqps	-512(%edx){1to16}, %zmm6, %k5	 # AVX512F Disp8
	vcmpneq_uqps	-516(%edx){1to16}, %zmm6, %k5	 # AVX512F

	vcmpneqps	%zmm5, %zmm6, %k5	 # AVX512F
	vcmpneqps	%zmm5, %zmm6, %k5{%k7}	 # AVX512F
	vcmpneqps	{sae}, %zmm5, %zmm6, %k5	 # AVX512F
	vcmpneqps	(%ecx), %zmm6, %k5	 # AVX512F
	vcmpneqps	-123456(%esp,%esi,8), %zmm6, %k5	 # AVX512F
	vcmpneqps	(%eax){1to16}, %zmm6, %k5	 # AVX512F
	vcmpneqps	8128(%edx), %zmm6, %k5	 # AVX512F Disp8
	vcmpneqps	8192(%edx), %zmm6, %k5	 # AVX512F
	vcmpneqps	-8192(%edx), %zmm6, %k5	 # AVX512F Disp8
	vcmpneqps	-8256(%edx), %zmm6, %k5	 # AVX512F
	vcmpneqps	508(%edx){1to16}, %zmm6, %k5	 # AVX512F Disp8
	vcmpneqps	512(%edx){1to16}, %zmm6, %k5	 # AVX512F
	vcmpneqps	-512(%ed


ng{
			"Mr A was here",
			"Mr B was here",
			"Mr C was here",
		},
		Ordered: []string{
			"Mr D was here",
			"Mr E was here",
			"Mr F was here",
		},
		Specific: map[primitives.ValidatorIndex]string{
			1234:   "Yolo",
			555:    "What's up",
			703727: "Meow",
		},
	}
	require.DeepEqual(t, wanted, got)
}

func TestParseHexGraffiti(t *testing.T) {
	tests := []struct {
		name  string
		want  string
		input string
	}{
		{
			name:  "standard",
			want:  "hola mundo!",
			input: "hola mundo!",
		},
		{
			name:  "standard with hex tag",
			want:  "hola mundo!",
			input: "hex:686f6c61206d756e646f21",
		},
		{
			name:  "irregularly cased hex tag",
			want:  "hola mundo!",
			input: "HEX:686f6c61206d756e646f21",
		},
		{
			name:  "hex tag without accompanying data",
			want:  "hex:",
			input: "hex:",
		},
		{
			name:  "Passing non-hex data with hex tag",
			want:  "hex:hola mundo!",
			input: "hex:hola mundo!",
		},
		{
			name:  "unmarked hex input",
			want:  "0x686f6c61206d756e646f21",
			input: "0x686f6c61206d756e646f21",
		},
		{
			name:  "Properly tagged hex data with 0x prefix",
			want:  "hola mundo!",
			input: "hex:0x686f6c61206d756e646f21",
		},
		{
			name:  "hex tag with 0x prefix and no other data",
			want:  "hex:0x",
			input: "hex:0x",
		},
		{
			name:  "hex tag with 0x prefix and invalid hex data",
			want:  "hex:0xhola mundo",
			input: "hex:0xhola mundo",
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			out := ParseHexGraffiti(tt.input)
			assert.Equal(t, out, tt.want)
		})
	}
}
package keymanager_test

import (
	"encoding/json"
	"strings"
	"testing"

	"github.com/OffchainLabs/prysm/v6/testing/assert"
	"github.com/OffchainLabs/prysm/v6/testing/require"
	"github.com/OffchainLabs/prysm/v6/validator/keymanager"
	"github.com/OffchainLabs/prysm/v6/validator/keymanager/derived"
	"github.com/OffchainLabs/prysm/v6/validator/keymanager/local"
	remoteweb3signer "github.com/OffchainLabs/prysm/v6/validator/keymanager/remote-web3signer"
)

var (
	_ = keymanager.IKeymanager(&local.Keymanager{})
	_ = keymanager.IKeymanager(&derived.Keymanager{})

	// More granular assertions.
	_ = keymanager.KeysFetcher(&local.Keymanager{})
	_ = keymanager.KeysFetcher(&derived.Keymanager{})
	_ = keymanager.Importer(&local.Keymanager{})
	_ = keymanager.Importer(&derived.Keymanager{})
	_ = keymanager.Deleter(&local.Keymanager{})
	_ = keymanager.Deleter(&derived.Keymanager{})

	_ = keymanager.PublicKeyAdder(&remoteweb


 deals with scan progress
function showScanProgress(params) {
    $("#div_ScanResults").hide();
    $("#div_ScanForm").hide();
    $("#div_ScanProgress").show();

    // display the scan settings
    $("#span_ScanType").html(`${params.angular_range * 2} degree scan`);
    $("#span_MotorSpeed").html(params.motor_speed);
    $("#span_SampleRate").html(params.sample_rate);
    $("#span_FileName").html(params.file_name);
}

// Show the portion of the page that deals with scan failure
function showScanFailure(msg) {
    console.log(`Failure:  ${msg}`);
    $("#div_ScanForm").hide();
    $("#div_ScanProgress").hide();
    $("#div_ScanResults").show();

    $("#alert_Success").html('');
    $("#alert_Success").hide();
    $("#alert_Failure").html(`<pre>${msg}</pre>`);
    $("#alert_Failure").show();
}

// Show the portion of the page that deals with scan success
function showScanSuccess(msg) {
    console.log(`Success:  ${msg}`);
    $("#div_ScanForm").hide();
    $("#div_ScanProgress").hide();
    $("#div_ScanResults").show();

    $("#alert_Success").html(msg);
    $("#alert_Success").show();
    $("#alert_Failure").html('');
    $("#alert_Failure").hide();
}/**
 * COMMON WEBPACK CONFIGURATION
 */

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
// console.log('dir');
// console.log(path.resolve(process.cwd(), 'app/assets/styles'));

module.exports = () => ({
  entry: path.join(process.cwd(), 'lib', 'js', 'app.js'),
  plugins: [
    new HtmlWebpackPlugin({
      template: 'src/index.html',
      minify: {
        removeComments: true,
        collapseWhitespace: true,
        removeRedundantAttributes: true,
        useShortDoctype: true,
        removeEmptyAttributes: true,
        removeStyleLinkTypeAttributes: true,
        keepClosingSlash: true,
        minifyJS: true,
        minifyCSS: true,
        minifyURLs: true,
      },
      inject: true,
    }),
    new CopyWebpackPlugin([
      // { from: 'src/images', to: 'assets/images' },
    ], {
      ignore: [],

      // By default, we only copy modified files during
      // a watch or webpack-dev-server build. Setting this
      // to `true` copies all files.
      copyUnmodified: true,
    }),
  ],
  module: {
    loaders: [
      {
        exclude: /node_modules/,
        // loader: 'babel-loader',
        test: /\.js$/,
      },
    ],
  },
  output: {
    path: path.join(process.cwd(), 'build'), // sets our output directory to build/
    filename: 'app.js', // sets our output filename to server.js
    publicPath: '/',
  },
});
'use strict';

var fs = require('fs');
var path = require('path');
var webpack = require('webpack'); // eslint-disable-line
var WebpackDevServer = require('webpack-dev-server'); // eslint-disable-line
var config = require('./config');

var APP_PORT = 3001;

// Production version
var compiler = webpack({
  entry: path.join(process.cwd(), 'lib', 'js', 'app.js'),
  module: {
    loaders: [{
      exclude: /node_modules/,
      // loader: 'babel-loader',
      test: /\.js$/


///
    /// An attachment stub specifies the length of its content but does not
    /// store the content itself.
    ///
    pub fn new_saved<D>(content_type: mime::Mime, digest: D, sequence_number: u64, content_length: u64) -> Self
    where
        D: Into<String>,
    {
        AttachmentBuilder {
            target: Attachment::Saved(SavedAttachment {
                content_type: content_type,
                digest: digest.into(),
                sequence_number: sequence_number,
                content: SavedAttachmentContent::LengthOnly(content_length),
                encoding_info: None,
            }),
            _phantom: std::marker::PhantomData,
        }
    }

    /// Constructs a saved attachment in full.
    pub fn new_saved_with_content<C, D>(content_type: mime::Mime, digest: D, sequence_number: u64, content: C) -> Self
    where
        C: Into<Vec<u8>>,
        D: Into<String>,
    {
        AttachmentBuilder {
            target: Attachment::Saved(SavedAttachment {
                content_type: content_type,
                digest: digest.into(),
                sequence_number: sequence_number,
                content: SavedAttachmentContent::Bytes(content.into()),
                encoding_info: None,
            }),
            _phantom: std::marker::PhantomData,
        }
    }
}

impl AttachmentBuilder<AttachmentIsUnsaved> {
    /// Constructs an unsaved attachment.
    pub fn new_unsaved<C>(content_type: mime::Mime, content: C) -> Self
    where
        C: Into<Vec<u8>>,
    {
        AttachmentBuilder {
            target: Attachment::Unsaved(UnsavedAttachment {
                content_type: content_type,
                content: content.into(),
            }),
            _phantom: std::marker::PhantomData,
        }
    }
}

impl<M> AttachmentBuilder<M> {
    /// Returns the builder's attachment.
    pub fn unwrap(self) -> Attachment {
        self.target
    }
}

#[cfg(test)]
mod tests {

    use super::*;
    use super::{AttachmentEncodingInfo, Base64JsonDecodable, Base64JsonEncodable, ContentTypeJsonDecodable,
                SavedAttachmentContent};
    use base64;
    use serde_json;

    #[test]
    fn attachment_serialize_saved() {

        let attachment = Attachment::Saved(SavedAttachment {
            content_type: mime!(Text / Plain),
            digest: "md5-iMaiC8wqiFlD2NjLTemvCQ==".to_string(),
            sequence_number: 17,
            content: SavedAttachmentContent::Bytes("This is the attachment.".to_string().into_bytes()),
            encoding_info: None,
        });

        let encoded = serde_json::to_string(&attachment).unwrap();

        let expected = serde_json::builder::ObjectBuilder::new()
            .insert("stub", true)
            .build();
        let got = serde_json::from_str(&encoded).unwrap();

        assert_eq!(expected, got);
    }

    #[test]
    fn attachment_serialize_unsaved() {

        let content = "This is the attachment.";

        let attachment = Attachment::Unsaved(UnsavedAttachment {
            content_type: mime!(Text / Plain),
            content: content.to_string().into_bytes(),
        });

        let encoded = serde_json::to_string(&attachment).unwrap();

        let expected = serde_json::builder::ObjectBuilder::new()
            .insert("content_type", "text/plain")
            .insert("data", base64::encode(content.as_bytes


						if(bid>0){
							int[] taxHitsRow=taxHits[i];
							if(taxHitsRow!=null){
								if(taxHitsRow!=null && taxHitsRow.length==1 && taxHitsRow[0]==bid){unique3_temp++;}
								for(int tid : taxHitsRow){
									if(tid==bid){
										sameTax++;
										break;
									}
								}
							}
						}

						i++;
					}else{
						k1seenR+=bit;
						j++;
					}
				}

				//For the remaining query kmers, we don't know whether the reference sketch would have shared them had it been longer.
				//This section can be disabled to prevent them from being displayed.
				if(bid>0 && i<a.length-1){
					for(; i<a.length; i++){
						int[] taxHitsRow=taxHits[i];
						if(taxHitsRow!=null){
							if(taxHitsRow!=null && taxHitsRow.length==1 && taxHitsRow[0]==bid){unique3_temp++;}
						}
					}
				}
			}
		}else{
			for(; i<a.length && j<b.length; ){
				final long ka=a[i], kb=b[j];
				final int bit=(int)(ka&1);
				final int count=present.getCount(i);
				if(ka==kb){
					matches++;
					k1hits+=bit;
					k1seenQ+=bit;
					k1seenR+=bit;
					if(aCounts!=null){depthSum+=aCounts[i];}
					if(refHitCounts!=null){refHitSum+=refHitCounts[i];}
					i++;
					j++;
				}else if(ka<kb){
					i++;
					k1seenQ+=bit;
				}else{
					j++;
					k1seenR+=bit;
				}
			}
		}

		if(k2<1){
			k1hits=matches;
			k1seenQ=i;
			k1seenR=j;
		}

//		if(taxHits!=null){
//			System.err.println("matches="+matches+", noHits="+noHits+", contamHits="+contamHits+", sameTax="+sameTax+", multiContamHits="+multiContamHits);
//		}

//		assert(bid<1 || unique2>=(matches-multiMatches)) : bid+", "+unique2+", "+unique3_temp+", "+matches+", "+multiMatches;
//		assert(matches<1000 || multiMatches==0) : bid+", "+unique2+", "+unique3_temp+", "+matches+", "+multiMatches+", "+fillPresent;

		if(buffer!=null){
//			System.err.println("*A) "+matches+", "+multiMatches+", "+unique2+", "+unique3_temp);
//			new Exception().printStackTrace();
//			assert(k1hits<=(matches-k1hits)) : k1hits+", "+matches;
			buffer.set(matches, multiMatches, unique2, unique2+unique3_temp, noHits,
					contamHits, contamHits-sameTax, multiContamHits, i, j,
					a.length, b.length, depthSum, depthSum2, refHitSum, k1hits, k1seenQ, k1seenR);
		}
		return matches;
	}

//	public float identity(Sketch b, float[] ret){
//		if(ret!=null){Arrays.fill(ret, 0);}
//		return identityWeighted(array, b.array, ret);
//	}
//
//	public static float identity(long[] a, long[] b){
//		int matches=countMatches(a, b);
//		return matches/(float)(Tools.max(1, Tools.min(a.length, b.length)));
//	}

	@Override
	public int hashCode()


Flow = communicationRepository.loadDispReqCommunicationsByProfileId(profileId)
                val replyCommunicationFlow = communicationRepository.loadRepliedCommunications(
                    invoiceStatusList.map { it.taskId },
                    ""
                )

                combine(
                    requestCommunicationFlow,
                    replyCommunicationFlow
                ) { requestFlow, replyFlow ->
                    val unreadRequestTaskIds = filterUnreadTaskIds(requestFlow, taskIdConsumedMap)
                    val unreadReplyTaskIds = filterUnreadTaskIds(replyFlow, taskIdConsumedMap)

                    // Combine both request and reply task IDs and remove duplicates
                    if ((unreadRequestTaskIds + unreadReplyTaskIds).toSet().isNotEmpty()) 1 else 0L
                }
            }
            .onEmpty {
                emit(0L)
            }
    }

    private fun filterUnreadTaskIds(
        communicationFlow: List<Communication>,
        taskIdConsumedMap: Map<String, Boolean>
    ): List<String> {
        return communicationFlow
            .filter { it.taskId in taskIdConsumedMap && taskIdConsumedMap[it.taskId] == false }
            .map { it.taskId }
    }
}
/*
 * Copyright (Change Date see Readme), gematik GmbH
 *
 * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the
 * European Commission – subsequent versions of the EUPL (the "Licence").
 * You may not use this work except in compliance with the Licence.
 *
 * You find a copy of the Licence in the "Licence" file or at
 * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied.
 * In case of changes by gematik GmbH find details in the "Readme" file.
 *
 * See the Licence for the specific language governing permissions and limitations under the Licence.
 *
 * *******
 *
 * For additional notes and disclaimer from gematik and in case of changes by gematik find details in the "Readme" file.
 */

package de.gematik.ti.erp.app.digas.presentation

import android.content.Context
import androidx.compose.runtime.Composable
import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavController
import androidx.work.ExistingWorkPolicy
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkInfo
import androidx.work.WorkManager
import androidx.work.workDataOf
import de.gematik.ti.erp.app.base.NetworkStatusTracker
import de.gematik.ti.erp.app.base.usecase.GetLastSuccessfulRefreshedTimeUseCase
import de.gematik.ti.erp.app.diga.model.DigaStatus
import de.gematik.ti.erp.app.digas.domain.usecase.FetchDigaByPznUseCase
import de.gematik.ti.erp.app.digas.domain.usecase.GetDigaByTaskIdUseCase
import de.gematik.ti.erp.app.digas.domain.usecase.UpdateArchivedStatusUseCase
import de.gematik.ti.erp.app.digas.domain.usecase.UpdateDigaIsNewUseCase
import de.gematik.ti.erp.app.digas.domain.usecase.UpdateDigaStatusUseCase
import de.gematik.ti.erp.app.digas.mapper.toDigaMainScreenUiModel
import de.gematik.ti.erp.app.digas.navigation.DigasRoutes
import de.gematik.ti.erp.app.digas.ui.model.DigaBfarmUiModel
import


.TODO())
}
/*
kafka-connect is a command line utility for managing Kafka Connect.

With it, you can inspect the status of connector instances running in a Kafka
cluster, start new connectors or update the configuration of existing ones, or
invoke lifecycle operations like pausing or restarting connectors.

For usage information, please see:

	kafka-connect help
	kafka-connect help <subcommand>

The tool is mostly self-documenting in this manner, but note that you can also
pass data for creating and updating connectors via standard input. These two
invocations are equivalent, but one may be more convenient for a particular
scripting task:

	kafka-connect create --from-file connector.json
	cat connector.json | kafka-connect create

Updating works similarly:

	kafka-connect update connector-name --config config.json
	cat config.json | kafka-connect update connector-name

In these examples, connector.json represents a JSON structure accepted by the
Connect REST API for creating connectors, and config.json is only the config
object of such a structure. The latter can be obtained for an existing connector
with:

	kafka-connect config connector-name

And the former is the output of the show command minus active tasks—using the jq
tool:

	kafka-connect show connector-name | jq 'del(.tasks)'

If you have configurations, you can also create new connector instances by
specifying names for them on the command line:

	kafka-connect create new-connector --config config.json
	cat config.json | kafka-connect create new-connector

API Host

By default kafka-connect will attempt to make requests to a Kafka Connect API
instance running on localhost and the default API port of 8083. This can be
changed by giving a full URL with the --host (or -H) flag, or with the
environment variable KAFKA_CONNECT_CLI_HOST.

Putting it all together, you might migrate connectors from one cluster to
another:

	kafka-connect show connector-name | jq 'del(.tasks)' | \
		kafka-connect -H http://newcluster:8083 create
	kafka-connect delete connector-name

For complete details of the data structures, see the REST API documentation:
http://docs.confluent.io/latest/connect/userguide.html#connect-userguide-rest.
*/
package main
package gokalkan

import (
	"errors"
	"fmt"
	"sync"

	"github.com/gokalkan/gokalkan/ckalkan"
)

// Kalkan - это обертка над методами KalkanCrypt.
type Kalkan interface {
	LoadKeyStore(path, password string) (err error)
	LoadKeyStoreFromBytes(key []byte, password string) (err error)

	Sign(data []byte, isDetached, withTSP bool) (signature []byte, err error)
	SignXML(xml string) (signedXML string, err error)
	SignWSSE(xml, id string) (signedXML string, err error)

	Verify(signature []byte) (string, error)
	VerifyXML(signedXML string) (string, error)
	VerifyDetached(signature, data []byte) (string, error)

	GetCertFromCMS(cms []byte, signID int) (string, error)
	GetCertFromXML(xml string, signID int)


));

    BicubicSurface patch(xp, yp, fp, fxp, fyp, fxyp);
    Rotation xm90(-Pi/2, XAxis);
    Transform patchPose(xm90, Vec3(4,2,0));

    int nx,ny; patch.getNumPatches(nx,ny);
    printf("surface 'patch' has %dx%d patches\n", nx,ny);
    Geo::BicubicBezierPatch bpatch = patch.calcBezierPatch(0,0);
    const Mat<4,4,Vec3>& pts = bpatch.getControlPoints();
    cout << "Bezier pts:\n" << pts;
    Geo::BicubicBezierPatch patch00,patch01,patch10,patch11;
    bpatch.split(.2, .3, patch00,patch01,patch10,patch11);

    draw(patch00, patchPose+Vec3(5,0,0), matter.Ground(), Cyan);
    draw(patch01, patchPose+Vec3(5,0,0), matter.Ground(), Green);
    draw(patch10, patchPose+Vec3(5,0,0), matter.Ground(), Purple);
    draw(patch11, patchPose+Vec3(5,0,0), matter.Ground(), Blue);

    for (int i=0; i<4; ++i)
        for (int j=0; j<4; ++j)
            matter.Ground().addBodyDecoration(patchPose,
                DecorativePoint(pts[i][j]).setScale(4).setColor(Magenta));

    draw(bpatch.getBoundaryCurveU0(), patchPose,matter.Ground());
    draw(bpatch.calcIsoCurveU(pts,.5), patchPose, matter.Ground());
    draw(bpatch.getBoundaryCurveU1(), patchPose,matter.Ground());
    draw(bpatch.getBoundaryCurveW0(), patchPose,matter.Ground(), Blue);
    draw(bpatch.calcIsoCurveW(pts,.5), patchPose, matter.Ground(), Blue);
    draw(bpatch.getBoundaryCurveW1(), patchPose,matter.Ground(), Blue);

    Real resolution = 31;
    PolygonalMesh patchMesh = patch.createPolygonalMesh(resolution);

    Array_<Vec3> v(patchMesh.getNumVertices());
    for (int i=0; i < patchMesh.getNumVertices(); ++i)
        v[i] = patchMesh.getVertexPosition(i);
    //drawBoundingSphere<Real>(v, patchPose, matter.Ground());
    //drawApproxBoundingSphere<Real>(v, patchPose, matter.Ground());

    matter.Ground().addBodyDecoration(patchPose,
        DecorativeMesh(patchMesh).setRepresentation(DecorativeGeometry::DrawWireframe)
        .setColor(Gray));
    //matter.Ground().addBodyDecoration(patchPose,
    //    DecorativeMesh(patchMesh)
    //    .setColor(Blue).setOpacity(.4));

    matter.Ground().addBodyDecoration(patchPose,
        Decorations()
            .addDecoration(DecorativePoint(Vec3(xp[0],yp[0],fp(0,0))))
            .addDecoration(DecorativePoint(Vec3(xp[0],yp[1],fp(0,1))).setColor(Blue))
            .addDecoration(DecorativePoint(Vec3(xp[1],yp[0],fp(1,0))))
            .addDecoration(DecorativePoint(Vec3(xp[1],yp[1],fp(1,1))))
    );

    //BicubicSurface surf(Vec2(0,0), Vec2(1,1), f, 0);
    Array_<int> dxx(2,0), dyy(2,0), dxy(2);
    dxy[0]=0; dxy[1]=1;
    Array_<int> dx(1,0), dy(1,1);

    Transform pose1(xm90, Vec3(0,-15,0));
    Transfor


e}}}',
    '{"identifier":"auth_lastx_1","accumulators":{"alert_count":1,"total_count":1},' ..
        '"uniqitems":{"unique_users":{"riker":true},"unique_sources":{"192.168.1.2":true}}}',
    '{"identifier":"auth_lastx_1","accumulators":{"alert_count":1,"total_count":1},' ..
        '"uniqitems":{"unique_users":{"riker":true},"unique_sources":{"192.168.1.2":true}}}',
    '{"identifier":"auth_lastx_1","accumulators":{"alert_count":1,"total_count":1},' ..
        '"uniqitems":{"unique_users":{"riker":true},"unique_sources":{"192.168.1.2":true}}}',
    '{"identifier":"auth_lastx_1","accumulators":{"alert_count":1,"total_count":1},' ..
        '"uniqitems":{"unique_users":{"picard":true},"unique_sources":{"192.168.1.2":true}}}',
    '{"identifier":"auth_lastx_1","accumulators":{"alert_count":1,"total_count":1},' ..
        '"uniqitems":{"unique_users":{"picard":true},"unique_sources":{"192.168.1.2":true}}}'
}

local msg = {
    Type = "secmetrics",
    Fields = {}
}

function process_message(cp)
    for i,v in ipairs(payloads) do
        msg.Payload = v
        inject_message(msg)
    end
    return 0
end


 +
                 ", (b)-[:REL]->(a)" +
                 ", (b)-[:REL]->(e)" +
                 ", (c)-[:REL]->(a)" +
                 ", (c)-[:REL]->(d)" +
                 ", (c)-[:REL]->(e)" +
                 ", (d)-[:REL]->(a)" +
                 ", (d)-[:REL]->(c)" +
                 ", (d)-[:REL]->(e)" +
                 ", (e)-[:REL]->(a)");

        var walkParameters = new WalkParameters(1000, 10, 0.1, 100_000.0);

        RandomWalk randomWalk = RandomWalk.create(
            graph,
            new Concurrency(4),
            walkParameters,
            List.of(),
            1000,
            Optional.of(87L),
            ProgressTracker.NULL_TRACKER,
            DefaultPool.INSTANCE,
            TerminationFlag.RUNNING_TRUE
        );

        var nodeCounter = new HashMap<Long, Long>();
        randomWalk
            .compute()
            .filter(arr -> graph.toOriginalNodeId(arr[0]) == 0)
            .forEach(arr -> Arrays.stream(arr).forEach(n -> {
                    long neo4jId = graph.toOriginalNodeId(n);
                    nodeCounter.merge(neo4jId, 1L, Long::sum);
                })
            );

        // (a), (b), (c), (d) should be much more common than (e)
        assertThat(nodeCounter.get(0L)).isNotCloseTo(nodeCounter.get(4L), Offset.offset(4000L));
        assertThat(nodeCounter.get(1L)).isNotCloseTo(nodeCounter.get(4L), Offset.offset(1200L));
        assertThat(nodeCounter.get(2L)).isNotCloseTo(nodeCounter.get(4L), Offset.offset(1200L));
        assertThat(nodeCounter.get(3L)).isNotCloseTo(nodeCounter.get(4L), Offset.offset(1200L));

        assertThat(nodeCounter.get(4L)).isLessThan(100);
    }

    @Test
    void shouldRespectRelationshipWeights() {
        var graph = fromGdl(
            "  (a:Node)" +
            ", (b:Node)" +
            ", (c:Node)" +
            ", (a)-[:REL {weight: 100.0}]->(b)" +
            ", (a)-[:REL {weight: 1.0}]->(c)" +
            ", (b)-[:REL {weight: 1.0}]->(a)" +
            ", (c)-[:REL {weight: 1.0}]->(a)"
        );

        var walkParameters = new WalkParameters(1, 1000, 1.0, 1.0);

        RandomWalk randomWalk = RandomWalk.create(
            graph,
            new Concurrency(1),
            walkParameters,
            List.of(),
            100,
            Optional.of(23L),
            ProgressTracker.NULL_TRACKER,
            DefaultPool.INSTANCE,
            TerminationFlag.RUNNING_TRUE
        );

        var nodeCounter = new HashMap<Long, Long>();
        randomWalk
            .compute()
            .forEach(arr -> Arrays.stream(arr).forEach(n -> {
                    long neo4jId = graph.toOriginalNodeId(n);
                    nodeCounter.merge(neo4jId, 1L, Long::sum);
                })
            );

        assertThat(nodeCounter.get(0L)).isCloseTo(1500, Percentage.withPercentage(10));
        assertThat(nodeCounter.get(1L)).isCloseTo(1500, Percentage.withPercentage(10));
        assertThat(nodeCounter.get(2L)).isCloseTo(1L, Offset.offset(50L));
    }

    @ParameterizedTest
    @ValueSource(doubles = {-1, Double.NaN})
    void failOnInvalidRelationshipWeights(double invalidWeight) {
        var graph = fromGdl(formatWithLocale("(a)-[:REL {weight: %f}]->(b)", invalidWeight));

        var walkParameters = new WalkParameters(1, 1000, 1.0, 1.0);

        assertThatThrownBy(
            () -> RandomWalk.create(
                graph,
                new Concurrency(1),
                walkParameters,
                List.of(),
                100,
                Optional.of(23L),
                ProgressTracker.NULL_TRACKER,
                D


bits shifted off? */
	bne.b		case3_set_sticky	/*  yes; go set new sticky */

/*
 * no bits were shifted off so don't set the sticky bit.
 * the guard and
 * the entire mantissa is zero.
 */
	clr.l		FTEMP_HI(a0)		/*  clear hi(mantissa) */
	clr.l		FTEMP_LO(a0)		/*  clear lo(mantissa) */
	rts

/*
 * some bits were shifted off so set the sticky bit.
 * the entire mantissa is zero.
 */
case3_set_sticky:
	bset		#rnd_stky_bit,d0	/*  set new sticky bit */
	clr.l		FTEMP_HI(a0)		/*  clear hi(mantissa) */
	clr.l		FTEMP_LO(a0)		/*  clear lo(mantissa) */
	rts


ributesCount; attrIdx++)
		{
			bytesConsumed += ReadAttribute(offset + bytesConsumed, out var attr);
			element.Add(attr);
		}

		return bytesConsumed;
	}

	/// <summary>Reads an attribute starting at the specified offset,
	/// and returns the consumed bytes count.</summary>
	/// <remarks>
	/// Attributes consist of 5 words:
	///   0th word: StringIndex of Attribute Name's Namespace, or FFFFFFFF
	///   1st word: StringIndex of Attribute Name
	///   2nd word: StringIndex of Attribute Value, or FFFFFFF if ResourceId used
	///   3rd word: Flags?
	///   4th word: str ind of attr value again, or ResourceId of value
	/// </remarks>
	private int ReadAttribute(int offset, out XAttribute attribute)
	{
		var attributeNameStringIndex = BitConverter.ToInt32(_xml, offset + 1 * 4);
		var attrName = RetrieveFromStringTable(attributeNameStringIndex);

		var attributeValueStringIndex = BitConverter.ToInt32(_xml, offset + 2 * 4);
		// AttrValue ResourceId or dup AttrValue StrInd
		var attributeResourceId = BitConverter.ToInt32(_xml, offset + 4 * 4);

		var attrValue = attributeValueStringIndex >= 0
			? RetrieveFromStringTable(attributeValueStringIndex)
			: attributeResourceId.ToString();

		attribute = new XAttribute(attrName!, attrValue!);
		return 20;
	}

	private int ReadEndTag(int tagOffset, string expectedTagName)
	{
		var tagName = ReadTagName(tagOffset);
		// Skip over 6 words of endTag data
		return tagName == expectedTagName
			? 6 * 4
			: throw new InvalidOperationException(
				$"Malformed XML: expecting {expectedTagName} but found {tagName}");
	}

	private string? ReadTagName(int tagOffset)
	{
		var nameIndexOffset = tagOffset + 5 * 4;
		var nameStringIndex = BitConverter.ToInt32(_xml, nameIndexOffset);
		return RetrieveFromStringTable(nameStringIndex);
	}

	private int GetStringTableOffset()
	{
		// Compressed XML file/bytes starts with 24x bytes of data,
		// 9 32 bit words in little endian order (LSB first):
		//   0th word is 03 00 08 00
		//   3rd word SEEMS TO BE:  Offset at then of StringTable
		//   4th word is: Number of strings in string table
		var stringsCount = BitConverter.ToInt32(_xml, 4 * 4);
		return STRING_INDEX_TABLE_OFFSET + stringsCount * 4;
	}

	/// <summary> Return the string stored in StringTable format at
	/// offset strOff.  This offset points to the 16 bit string length, which
	/// is followed by that number of 16 bit (Unicode) chars. </summary>
	/// <returns></returns>
	private string? RetrieveFromStringTable(int strInd)
	{
		if (strInd < 0) return null;

		// StringTable, each string is represented with a 16 bit little endian
		// character count, followed by that number of 16 bit (LE) (Unicode) chars.
		// StringTable follows StrIndexTable
		var stringOffset = GetStringTableOffset() +
						   BitConverter.ToInt32(_xml, STRING_INDEX_TABLE_OFFSET + strInd * 4);
		var stringLength = BitConverter.ToInt16(_xml, stringOffset);
		return Encoding.Unicode.GetString(_xml, stringOffset + 2, stringLength * 2);
	}

	/// <summary> The XML tag tree starts after some unknown content after the StringTable.
	/// There is some unknown data after the StringTable, scan forward from this point
	/// to the flag for the start of an XML start tag. </summary>
	/// <returns></returns>
	internal int FindStartOfTags()
	{
		// 12 is the index of the word containing the base offset


к программирования и самый мощный инструмент для обработки текста в системе Linux.Один из его авторов
и текущих сопровождающих - вышеупомянутый Брайан Керниган (ближайший партнер ken и dmr). С помощью этой команды вы
можете извлекать указанный столбец из текста, использовать регулярные выражения для извлечения нужного нам
содержимого из текста, отображать указанную строку и выполнять статистику и вычисления. Короче говоря, это очень
мощный инструмент.

Предположим, существует файл с именем fruit2.txt с содержимым, как показано ниже.

   ```Shell
   [root ~]# cat fruit2.txt
   1       banana      120
   2       grape       500
   3       apple       1230
   4       watermelon  80
   5       orange      400
   ```

Отобразите 3-ю строку файла

   ```Shell
   [root ~]# awk 'NR==3' fruit2.txt
   3       apple       1230
   ```

Отобразите второй столбец файла.

   ```Shell
   [root ~]# awk '{print $2}' fruit2.txt
   banana
   grape
   apple
   watermelon
   orange
   ```

Отобразите последний столбец файла.

   ```Shell
   [root ~]# awk '{print $NF}' fruit2.txt
   120
   500
   1230
   80
   400
   ```

Выведите в конце строки с числом больше или равным 300.

   ```Shell
   [root ~]# awk '{if($3 >= 300) {print $0}}' fruit2.txt
   2       grape       500
   3       apple       1230
   5       orange      400
   ```

Вышеупомянутое - лишь верхушка айсберга команды awk, и читателю предоставляется больше информации для изучения на
практике.

### Управление пользователями

1. Создание и удаление пользователей - **useradd** / **userdel**。

   ```Shell
   [root home]# useradd hellokitty
   [root home]# userdel hellokitty
   ```

   - `-d` - Укажите домашний каталог пользователя для пользователя при создании пользователя
   - `-g` - Укажите группу пользователей, к которой принадлежит пользователь при создании пользователя

2. Создание и удаление групп пользователей - **groupadd** / **groupdel**。

   > Примечание: группа пользователей в основном предназначена для облегчения управления всеми пользователями в группе.

3. Смена пароля - **passwd**。

   ```Shell
   [root ~]# passwd hellokitty
   New password:
   Retype new password:
   passwd: all authentication tokens updated successfully.
   ```

   > Примечание. Входной пароль и пароль подтверждения не отображаются эхом, и их необходимо вводить за один раз
   > (нельзя использ


dpv2alpha1.Mediation, 0),
		},
	}
	return routePolicy
}

// convertMapToAPIKeyEndpointSecurity converts a map representation of APIKeyEndpointSecurity to the struct.
func convertMapToAPIKeyEndpointSecurity(securityMap map[string]interface{}) *model.APIKeyEndpointSecurity {
	apiKeySecurity := &model.APIKeyEndpointSecurity{}

	if secretName, exists := securityMap["secretName"]; exists {
		if secretNameStr, ok := secretName.(string); ok {
			apiKeySecurity.SecretName = secretNameStr
		}
	}

	if apiKeyNameKey, exists := securityMap["apiKeyNameKey"]; exists {
		if apiKeyNameKeyStr, ok := apiKeyNameKey.(string); ok {
			apiKeySecurity.APIKeyNameKey = apiKeyNameKeyStr
		}
	}

	if apiKeyValueKey, exists := securityMap["apiKeyValueKey"]; exists {
		if apiKeyValueKeyStr, ok := apiKeyValueKey.(string); ok {
			apiKeySecurity.APIKeyValueKey = apiKeyValueKeyStr
		}
	}

	if in, exists := securityMap["in"]; exists {
		if inStr, ok := in.(string); ok {
			apiKeySecurity.In = inStr
		}
	}

	return apiKeySecurity
}

// generateAPIKeySecurityHash generates a SHA256 hash for the given APIKeyEndpointSecurity configuration.
func generateAPIKeySecurityHash(apiKeySecurity *model.APIKeyEndpointSecurity) string {
	if apiKeySecurity == nil {
		return ""
	}

	// Concatenate all fields in a consistent order
	hashInput := fmt.Sprintf("%s|%s|%s|%s",
		apiKeySecurity.SecretName,
		apiKeySecurity.In,
		apiKeySecurity.APIKeyNameKey,
		apiKeySecurity.APIKeyValueKey,
	)

	// Generate SHA256 hash
	hasher := sha256.New()
	hasher.Write([]byte(hashInput))
	hashBytes := hasher.Sum(nil)

	// Return hex encoded hash
	return hex.EncodeToString(hashBytes)
}

// createAPIKeyMediationPolicy creates a Mediation policy for API Key security.
func createAPIKeyMediationPolicy(name string, endpointSecurity *model.EndpointSecurity,
	apiKeySecurity *model.APIKeyEndpointSecurity) *dpv2alpha1.RoutePolicy {
	apiKeyMediationPolicy := &dpv2alpha1.Mediation{
		PolicyName:    constantscommon.MediationBackendAPIKey,
		PolicyID:      "",
		PolicyVersion: "",
		Parameters: []*dpv2alpha1.Parameter{
			{
				Key:   "Enabled",
				Value: strconv.FormatBool(*endpointSecurity.Enabled),
			},
			{
				Key:   "In",
				Value: apiKeySecurity.In,
			},
			{
				Key:   "InValue",
				Value: apiKeySecurity.APIKeyNameKey,
			},
			{
				Key: "APIKey",
				ValueRef: &gwapiv1a2.LocalObjectReference{
					Name: gwapiv1a2.ObjectName(apiKeySecurity.SecretName),
					Kind: constantscommon.KindSecret,
				},
			},
		},
	}
	routePolicy := &dpv2alpha1.RoutePolicy{
		ObjectMeta: metav1.ObjectMeta{
			Name: name,
		},
		TypeMeta: metav1.TypeMeta{
			Kind:       constantscommon.KindRoutePolicy,
			APIVersion: constantscommon.WSO2KubernetesGatewayV2Alpha1,
		},
		Spec: dpv2alpha1.RoutePolicySpec{
			RequestMediation:  []*dpv2alpha1.Mediation{apiKeyMediationPolicy},
			ResponseMediation: make([]*dpv2alpha1.Mediation, 0),
		},
	}
	return routePolicy
}

// createBackendJWTMediationPolicy creates a Mediation policy for API Key security.
func createBackendJWTMediationPolicy(jwtSecurityPolicy *model.BackendJWTPolicy, kms []model.KeyManager) *dpv2alpha1.RoutePolicy {
	customClaimsJSON := convertCustomClaimsToJSON(jwtSecurityPolicy.Parameters.CustomClaims


        .p2align    3
0:
        # Load initial bias from w into accumulators
        LDP         q16, q20, [x5], 32
        MOV         v17.16b, v16.16b
        MOV         v18.16b, v16.16b
        LDP         q24, q28, [x5], 32
        MOV         v19.16b, v16.16b
        MOV         v21.16b, v20.16b
        MOV         v22.16b, v20.16b
        MOV         v23.16b, v20.16b
        SUBS        x0, x2, 8               // k = kc - 8
        MOV         v25.16b, v24.16b
        MOV         v26.16b, v24.16b
        MOV         v27.16b, v24.16b
        MOV         v29.16b, v28.16b
        MOV         v30.16b, v28.16b
        MOV         v31.16b, v28.16b
        # Is there at least 8 bytes for epilogue?
        B.LO        4f

        # Prologue
        LDR         d0, [x3], 8
        LDP         d4, d6, [x5]
        LDR         d1, [x15], 8
        LDR         d2, [x13], 8
        LDR         d3, [x4], 8
        SXTL    v0.8h, v0.8b
        LDR         x17, [x5, 16]
        SXTL        v4.8h, v4.8b
        SXTL    v1.8h, v1.8b
        SXTL    v2.8h, v2.8b
        SXTL    v3.8h, v3.8b
        SXTL        v6.8h, v6.8b

        SUBS        x0, x0, 8               // k = k - 8
        # Is there at least 8 bytes for main loop?
        B.LO        2f

        # Main loop - 8 bytes of A
        .p2align    3
1:
        SMLAL       v16.4s, v4.4h, v0.h[0]
        SMLAL2      v20.4s, v4.8h, v0.h[0]
        SMLAL       v17.4s, v4.4h, v1.h[0]
        SMLAL2      v21.4s, v4.8h, v1.h[0]
        SMLAL       v18.4s, v4.4h, v2.h[0]
        SMLAL2      v22.4s, v4.8h, v2.h[0]
        SMLAL       v19.4s, v4.4h, v3.h[0]
        SMLAL2      v23.4s, v4.8h, v3.h[0]
        LDR         d4, [x5, 24]
        INS         v5.d[0], x17
        SMLAL       v24.4s, v6.4h, v0.h[0]
        SMLAL2      v28.4s, v6.8h, v0.h[0]
        SMLAL       v25.4s, v6.4h, v1.h[0]
        SMLAL2      v29.4s, v6.8h, v1.h[0]
        SXTL        v5.8h, v5.8b
        SMLAL       v26.4s, v6.4h, v2.h[0]
        SMLAL2      v30.4s, v6.8h, v2.h[0]
        SMLAL       v27.4s, v6.4h, v3.h[0]
        SMLAL2      v31.4s, v6.8h, v3.h[0]
        LDR         x17, [x5, 32]
        SMLAL       v16.4s, v5.4h, v0.h[1]
        SMLAL2      v20.4s, v5.8h, v0.h[1]
        SMLAL       v17.4s, v5.4h, v1.h[1]
        SMLAL2      v21.4s, v5.8h, v1.h[1]
        S


.merge(mainStream, heartbeatStream)
                    .onErrorResume(e -> {
                        log.error("Grok流式生成内容时出错: {}", e.getMessage(), e);
                        return Flux.just("错误：" + e.getMessage());
                    });

        } catch (Exception e) {
            log.error("Grok流式API调用失败", e);
            return Flux.just("错误：" + e.getMessage());
        }
    }

    @Override
    public Mono<Double> estimateCost(AIRequest request) {
        // 获取模型输入价格（每1000个令牌的美元价格）
        String inputPriceKey = modelName + "-input";
        String outputPriceKey = modelName + "-output";

        double inputPricePerThousandTokens = TOKEN_PRICES.getOrDefault(inputPriceKey, 0.003);
        double outputPricePerThousandTokens = TOKEN_PRICES.getOrDefault(outputPriceKey, 0.006);

        // 估算输入令牌数
        int inputTokens = estimateInputTokens(request);

        // 估算输出令牌数
        int outputTokens = request.getMaxTokens() != null ? request.getMaxTokens() : 1000;

        // 计算成本（美元）
        double costInUSD = (inputTokens / 1000.0) * inputPricePerThousandTokens
                + (outputTokens / 1000.0) * outputPricePerThousandTokens;

        // 转换为人民币（假设汇率为7.2）
        double costInCNY = costInUSD * 7.2;

        return Mono.just(costInCNY);
    }

    @Override
    public Mono<Boolean> validateApiKey() {
        if (isApiKeyEmpty()) {
            return Mono.just(false);
        }

        // 处理模型名称，确保正确的格式
        final String apiModel = modelName.startsWith("x-ai/") ?
                modelName.substring(5) : // 去掉"x-ai/"前缀
                modelName;

        // 创建一个简单的测试请求
        Map<String, Object> requestBody = new HashMap<>();
        requestBody.put("model", apiModel);
        requestBody.put("messages", List.of(Map.of("role", "user", "content", "Hello")));
        requestBody.put("max_tokens", 5);

        log.info("开始验证X.AI API密钥, 请求URL: {}/chat/completions, 模型: {}, 原始模型名: {}, 请求体: {}",
                getApiEndpoint(DEFAULT_API_ENDPOINT), apiModel, modelName, requestBody);

        try {
            // 尝试通过模型列表API验证密钥，可能更可靠
            String baseUrl = getApiEndpoint(DEFAULT_API_ENDPOINT);
            log.info("尝试通过模型列表API验证密钥: {}/models", baseUrl);

            return webClient.get()
                    .uri("/models")
                    .header("Authorization", "Bearer " + apiKey)
                    .retrieve()
                    .bodyToMono(String.class)
                    .doOnNext(response -> {
                        log.info("X.AI模型列表API响应成功, 长度: {}", response.length());
                        log.debug("X.AI模型列表API响应: {}", response);

                        // 检查响应中是否包含当前模型名称
                        if (!response.contains(apiModel)) {
                            log.warn("X.AI模型列表响应中未找到当前模型: {}, 可能需要检查模型名称格式", apiModel);
                        }
                    })
                    .map(response -> true)
                    .onErrorResume(e -> {
                        log.error("验证X.AI


-----------------------------------------------------------
MsgBuffer = oo.class()
function MsgBuffer:Init()
	self.buffer = BufferUtil.New();
end

-- 设置数据
function MsgBuffer:SetData(data)
	self.buffer:SetBytes(data)
end

-- 追加数据
function MsgBuffer:Append(data)
	self.buffer:Append(data)
end

function MsgBuffer:AppendBuffer(data)
	self.buffer:AppendBuffer(data)
end
-- 获取buffer长度
function MsgBuffer:Size()
	return self.buffer:Size()
end

function MsgBuffer:Clear()
	self.buffer:Clean()
end

function MsgBuffer:GetBuffer()
	return self.buffer:GetBytes()
end
----------------------------------------
-- 写
function MsgBuffer:WriteString(val)
	self.buffer:WriteString(val)
end

function MsgBuffer:WriteUInt64(val)
	self.buffer:WriteLong(val)
end

function MsgBuffer:WriteUInt32(val)
	self.buffer:WriteUInt(val)
end

function MsgBuffer:WriteInt32(val)
	self.buffer:WriteInt(val)
end

function MsgBuffer:WriteUInt16(val)
	self.buffer:WriteUInt16(val)
end

function MsgBuffer:WriteInt16(val)
	self.buffer:WriteInt16(val)
end

function MsgBuffer:WriteUInt8(val)
	self.buffer:WriteInt8(val)
end

function MsgBuffer:WriteBool(val)
	if val then
		self.buffer:WriteInt8(1)
	else
		self.buffer:WriteInt


zero, $zero, .L80B34CEC
/* 00D98 80B34A48 8FBF0034 */  lw      $ra, 0x0034($sp)
/* 00D9C 80B34A4C C61001A0 */  lwc1    $f16, 0x01A0($s0)          ## 000001A0
.L80B34A50:
/* 00DA0 80B34A50 26040188 */  addiu   $a0, $s0, 0x0188           ## $a0 = 00000188
/* 00DA4 80B34A54 4600810D */  trunc.w.s $f4, $f16
/* 00DA8 80B34A58 440C2000 */  mfc1    $t4, $f4
/* 00DAC 80B34A5C 0C02927F */  jal     SkelAnime_FrameUpdateMatrix

/* 00DB0 80B34A60 AFAC005C */  sw      $t4, 0x005C($sp)
/* 00DB4 80B34A64 44801000 */  mtc1    $zero, $f2                 ## $f2 = 0.00
/* 00DB8 80B34A68 C60001A4 */  lwc1    $f0, 0x01A4($s0)           ## 000001A4
/* 00DBC 80B34A6C 02002025 */  or      $a0, $s0, $zero            ## $a0 = 00000000
/* 00DC0 80B34A70 4600103E */  c.le.s  $f2, $f0
/* 00DC4 80B34A74 00000000 */  nop
/* 00DC8 80B34A78 45020004 */  bc1fl   .L80B34A8C
/* 00DCC 80B34A7C 46000187 */  neg.s   $f6, $f0
/* 00DD0 80B34A80 10000003 */  beq     $zero, $zero, .L80B34A90
/* 00DD4 80B34A84 E7A0003C */  swc1    $f0, 0x003C($sp)
/* 00DD8 80B34A88 46000187 */  neg.s   $f6, $f0
.L80B34A8C:
/* 00DDC 80B34A8C E7A6003C */  swc1    $f6, 0x003C($sp)
.L80B34A90:
/* 00DE0 80B34A90 C61201A0 */  lwc1    $f18, 0x01A0($s0)          ## 000001A0
/* 00DE4 80B34A94 C7A8003C */  lwc1    $f8, 0x003C($sp)
/* 00DE8 80B34A98 4600103E */  c.le.s  $f2, $f0
/* 00DEC 80B34A9C 46089281 */  sub.s   $f10, $f18, $f8
/* 00DF0 80B34AA0 4600540D */  trunc.w.s $f16, $f10
/* 00DF4 80B34AA4 440E8000 */  mfc1    $t6, $f16
/* 00DF8 80B34AA8 45000003 */  bc1f    .L80B34AB8
/* 00DFC 80B34AAC AFAE0058 */  sw      $t6, 0x0058($sp)
/* 00E00 80B34AB0 10000003 */  beq     $zero, $zero, .L80B34AC0
/* 00E04 80B34AB4 E7A0003C */  swc1    $f0, 0x003C($sp)
.L80B34AB8:
/* 00E08 80B34AB8 46000107 */  neg.s   $f4, $f0
/* 00E0C 80B34ABC E7A4003C */  swc1    $f4, 0x003C($sp)
.L80B34AC0:
/* 00E10 80B34AC0 0C00B821 */


eme           *runtime.Scheme
}

var _ recorder.Provider = (*FakeRecorderProvider)(nil)

// NewRecorderProvider returns a new FakeRecorderProvider.
func NewRecorderProvider(scheme *runtime.Scheme) recorder.Provider {
	clientSet := kubernetesfake.NewSimpleClientset()
	broadcaster := record.NewBroadcasterForTests(0)
	broadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{
		Interface: &patchedEventInterface{
			EventInterface: clientSet.CoreV1().Events(""),
			Fake:           &clientSet.Fake,
			namespace:      "",
		},
	})
	return &FakeRecorderProvider{eventBroadcaster: broadcaster, scheme: scheme}
}

// GetEventRecorderFor returns an EventRecorder with given name.
func (p *FakeRecorderProvider) GetEventRecorderFor(name string) record.EventRecorder {
	return p.eventBroadcaster.NewRecorder(p.scheme, corev1.EventSource{Component: name})
}

type patchedEventInterface struct {
	typedcorev1.EventInterface
	*testing.Fake
	namespace string
}

var eventsResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "events"}

// XXX: the generated version of this DOES NOT use the EventNamespace!!!!
func (c *patchedEventInterface) CreateWithEventNamespace(event *corev1.Event) (*corev1.Event, error) {
	action := testing.NewCreateAction(eventsResource, event.GetNamespace(), event)
	obj, err := c.Invokes(action, event)
	if obj == nil {
		return nil, err
	}

	return obj.(*corev1.Event), err
}

// XXX: the generated version of this DOES NOT use the EventNamespace!!!!
func (c *patchedEventInterface) UpdateWithEventNamespace(event *corev1.Event) (*corev1.Event, error) {
	action := testing.NewUpdateAction(eventsResource, event.GetNamespace(), event)
	obj, err := c.Invokes(action, event)
	if obj == nil {
		return nil, err
	}

	return obj.(*corev1.Event), err
}

// XXX: the generated version of this DOES NOT use the EventNamespace!!!!
func (c *patchedEventInterface) PatchWithEventNamespace(event *corev1.Event, data []byte) (*corev1.Event, error) {
	pt := types.StrategicMergePatchType
	action := testing.NewPatchAction(eventsResource, event.GetNamespace(), event.Name, pt, data)
	obj, err := c.Invokes(action, event)
	if obj == nil {
		return nil, err
	}

	return obj.(*corev1.Event), err
}

// XXX: the generated version of this DOES NOT use the objOrRef namespace!!!!
func (c *patchedEventInterface) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*corev1.EventList, error) {
	ref, err := reference.GetReference(scheme, objOrRef)
	if err != nil {
		return nil, err
	}
	if c.namespace != "" && ref.Namespace != c.namespace {
		return nil, fmt.Errorf("won't be able to find any events of namespace '%v' in namespace '%v'", ref.Namespace, c.namespace)
	}
	stringRefKind := ref.Kind
	var refKind *string
	if stringRefKind != "" {
		refKind = &stringRefKind
	}
	stringRefUID := string(ref.UID)
	var refUID *string
	if stringRefUID != "" {
		refUID = &stringRefUID
	}
	fieldSelector := c.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID)
	return c.List(context.TODO(), metav


.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
m_tmLastFussTime  = _pTimer  -> CurrentTick  ();
#line 862 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
return ;
#line 863 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
}
#line 866 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
if(m_penMainMusicHolder  == NULL ){
#line 868 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
m_penMainMusicHolder  = _pNetwork  -> GetEntityWithName  ("MusicHolder" , 0);
#line 870 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
if(m_penMainMusicHolder  == NULL ){
#line 872 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
m_tmLastFussTime  = _pTimer  -> CurrentTick  ();
#line 874 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
return ;
#line 875 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
}
#line 877 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
((CMusicHolder  &) * m_penMainMusicHolder ) . m_cenFussMakers  . Add  (this );
#line 879 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
if(m_bBoss ){
#line 880 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
((CMusicHolder  &) * m_penMainMusicHolder ) . m_penBoss  = this ;
#line 881 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
}
#line 883 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
m_tmLastFussTime  = _pTimer  -> CurrentTick  ();
#line 886 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es"
}else {
#line 888 "/data/data/com.termux/files/home/doom3/SeriousSamClassic-1.10.7/SamTSE/Sources/EntitiesMP/EnemyBase.es


),
	},
	["MODULE NAME"] = {
		id = 23,
		fgColor = rgb(0x00cccc),
		bgColor = rgb(0xFFFFFF),
	},
	["MODULE ATTRIBUTES"] = {
		id = 24,
		fgColor = rgb(0x007f7f),
		bgColor = rgb(0xFFFFFF),
	},
	["PREPROCESSOR"] = {
		id = 12,
		fgColor =


Structs.comparingInt(s -> -s.block.schematicPriority));
    }

    /** @return all the valid loadouts for a specific core type. */
    public Seq<Schematic> getLoadouts(CoreBlock block){
        return loadouts.get(block, Seq::new);
    }

    public ObjectMap<CoreBlock, Seq<Schematic>> getLoadouts(){
        return loadouts;
    }

    public @Nullable Schematic getDefaultLoadout(CoreBlock block){
        return defaultLoadouts.get(block);
    }

    public boolean isDefaultLoadout(Schematic schem){
        return defaultLoadouts.containsValue(schem, true);
    }

    /** Checks a schematic for deployment validity and adds it to the cache. */
    private void checkLoadout(Schematic s, boolean customSchem){
        Stile core = s.tiles.find(t -> t.block instanceof CoreBlock);
        if(core == null) return;
        int cores = s.tiles.count(t -> t.block instanceof CoreBlock);
        int maxSize = getMaxLaunchSize(core.block);

        //make sure a core exists, and that the schematic is small enough.
        if((customSchem && (s.width > maxSize || s.height > maxSize
            || s.tiles.contains(t -> t.block.buildVisibility == BuildVisibility.sandboxOnly || !t.block.unlocked()) || cores > 1))) return;

        //place in the cache
        loadouts.get((CoreBlock)core.block, Seq::new).add(s);

        //save non-custom loadout
        if(!customSchem){
            defaultLoadouts.put((CoreBlock)core.block, s);
        }
    }

    public int getMaxLaunchSize(Block block){
        return block.size + maxLoadoutSchematicPad*2;
    }

    Fi findFile(String schematicName){
        if(schematicName.isEmpty()) schematicName = "empty";
        Fi result = null;
        int index = 0;

        while(result == null || result.exists()){
            result = schematicDirectory.child(schematicName + (index == 0 ? "" : "_" + index) + "." + schematicExtension);
            index ++;
        }

        return result;
    }

    /** Adds a schematic to the list, also copying it into the files.*/
    public void add(Schematic schematic){
        all.add(schematic);
        try{
            Fi file = findFile(Strings.sanitizeFilename(schematic.name()));
            write(schematic, file);
            schematic.file = file;
        }catch(Exception e){
            ui.showException(e);
            Log.err(e);
        }

        checkLoadout(schematic, true);
        all.sort();
    }

    public void remove(Schematic s){
        all.remove(s);
        loadouts.each((block, seq) -> seq.remove(s));
        if(s.file != null){
            s.file.delete();
        }

        if(previews.containsKey(s)){
            previews.get(s).dispose();
            previews.remove(s);
        }
        all.sort();
    }

    /** Creates a schematic from a world selection. */
    public Schematic create(int x, int y, int x2, int y2){
        Team team = headless ? null : Vars.player.team();
        NormalizeResult result = Placement.normalizeArea(x, y, x2, y2, 0, false, maxSchematicSize);
        x = result.x;
        y = result.y;
        x2 = result.x2;
        y2 = result.y2;

        int ox = x, oy = y, ox2 = x2, oy2 = y2;

        Seq<Stile> tiles = new Seq<>();

        int minx = x2, miny = y2, maxx = x, maxy = y;
        boolean found = false;
        for(int cx = x; cx <= x2; cx++){
            for(int cy = y; cy <= y2; cy++){
                Building linked = world.build(cx


ense (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.

// Data Safe API
//
// APIs for using Oracle Data Safe.
//

package datasafe

import (
	"encoding/json"
	"fmt"
	"github.com/oracle/oci-go-sdk/v65/common"
	"strings"
)

// CreatePeerTargetDatabaseDetails The details used to register the peer database of a database already registered in Data Safe.
type CreatePeerTargetDatabaseDetails struct {
	DatabaseDetails DatabaseDetails `mandatory:"true" json:"databaseDetails"`

	// The display name of the peer target database in Data Safe. The name is modifiable and does not need to be unique.
	DisplayName *string `mandatory:"false" json:"displayName"`

	// The description of the peer target database in Data Safe.
	Description *string `mandatory:"false" json:"description"`

	// The OCID of the Data Guard Association resource in which the database being registered is considered as peer database to the primary database.
	DataguardAssociationId *string `mandatory:"false" json:"dataguardAssociationId"`

	TlsConfig *TlsConfig `mandatory:"false" json:"tlsConfig"`
}

func (m CreatePeerTargetDatabaseDetails) String() string {
	return common.PointerString(m)
}

// ValidateEnumValue returns an error when providing an unsupported enum value
// This function is being called during constructing API request process
// Not recommended for calling this function directly
func (m CreatePeerTargetDatabaseDetails) ValidateEnumValue() (bool, error) {
	errMessage := []string{}

	if len(errMessage) > 0 {
		return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
	}
	return false, nil
}

// UnmarshalJSON unmarshals from json
func (m *CreatePeerTargetDatabaseDetails) UnmarshalJSON(data []byte) (e error) {
	model := struct {
		DisplayName            *string         `json:"displayName"`
		Description            *string         `json:"description"`
		DataguardAssociationId *string         `json:"dataguardAssociationId"`
		TlsConfig              *TlsConfig      `json:"tlsConfig"`
		DatabaseDetails        databasedetails `json:"databaseDetails"`
	}{}

	e = json.Unmarshal(data, &model)
	if e != nil {
		return
	}
	var nn interface{}
	m.DisplayName = model.DisplayName

	m.Description = model.Description

	m.DataguardAssociationId = model.DataguardAssociationId

	m.TlsConfig = model.TlsConfig

	nn, e = model.DatabaseDetails.UnmarshalPolymorphicJSON(model.DatabaseDetails.JsonData)
	if e != nil {
		return
	}
	if nn != nil {
		m.DatabaseDetails = nn.(DatabaseDetails)
	} else {
		m.DatabaseDetails = nil
	}

	return
}
// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates.  All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.

// Data Safe API
//
// APIs for using Oracle Data Safe.
//

package datasafe

import (
	"fmt"
	"github.com/oracle/oci-go-sdk/v65/common"
	"strings"
)

// UpdateReportDefinitionDetails Description of a new report definition.
type UpdateReportDefinitionDetails struct {

	// Specifies the name of the report definition.
	DisplayName *string `mandatory:"true" json:"displayName"`

	// An array of column objects in the order (left to right) displayed in the report


oIndicador}, Volume {volumeXDist}, escalaProporcionalDistanciaDedos {escalaProporcionalDistanciaDedos}, profundidadeCMT {profundidadeCMT}")

        #defineVolume(volumeXDist)
        if volumeXDist > 70.00:
          defineVolume(volumeXDist)
          mensagem = "Aumentar Volume"

        if volumeXDist < 20.00:
          defineVolume(volumeXDist)
          mensagem = "Diminuir Volume"

  if mensagem is not None:
    cvzone.putTextRect(frame,mensagem,(25,55))
  cv2.imshow(NOME_JANELA, frame)

  if cv2.waitKey(25) & 0xFF == ord('q'):
    break

  framesCounter += 1

camera.release()
cv2.destroyAllWindows()