ay also be purchased from INFORION, LLC,
 * for users who do not want their programs protected by the GPL.
 * Contact us for details kopycat@inforion.ru
 *
 * 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
package ru.inforion.lab403.kopycat.gdbstub

import ru.inforion.lab403.common.extensions.ifNotNull
import ru.inforion.lab403.common.extensions.otherwise
import ru.inforion.lab403.common.logging.INFO
import ru.inforion.lab403.common.logging.logger
import ru.inforion.lab403.common.network.Network
import ru.inforion.lab403.kopycat.gdbstub.parser.Context
import ru.inforion.lab403.kopycat.gdbstub.parser.Packet
import ru.inforion.lab403.kopycat.gdbstub.parser.PacketIterator.Companion.packetSequence
import ru.inforion.lab403.kopycat.interfaces.IDebugger
import java.io.Closeable
import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.TimeUnit
import kotlin.concurrent.thread
import kotlin.time.measureTimedValue

@Suppress("UNUSED_PARAMETER")
/**
 * {RU}
 *
 * @param port номер порта для GDB
 * @param binaryProtoEnabled разрешить использование бинарного протокола GDB (команда X)
 * {RU}
 */
class GDBServer constructor(
    port: Int,
    host: String = "0.0.0.0",
    val packetSize: Int = 0x4000,
    val binaryProtoEnabled: Boolean = false
) : Closeable {

    companion object {
        @Transient val log = logger(INFO)
    }

    private val network = Network("GDB_SERVER", port, host, 0x1000, 1).onConnect {
        if (debugger == null)
            log.severe { "GDB Client connected but debugger wasn't initialized!" }

        hasClient = true

        thread {
            debugger ifNotNull {
                val context = Context(this@onConnect, this, this@GDBServer)

                do {
                    val packet = packets.poll(1000, TimeUnit.MILLISECONDS) ?: continue
                    log.finest { "RECV: [$packet]" }
                    context.parseAndProcess(packet)
                } while (hasClient)
            } otherwise {
                log.severe { "Can't process client due to GDB debugger wasn't set!" }
                sendRejectResponse()
            }
        }

        inputStream
            .packetSequence()
            .forEach { packets.put(it) }

        debugger ifNotNull {
            breakpoints.forEach { bptClr(it) }
            breakpoints.clear()
        }

        hasClient = false

        packets.clear()

        // do not process client, all processing in this function
        false
    }

    // required to remove breakpoints because ida don't do it
    internal val breakpoints = mutableListOf<ULong>()

    private var debugger: IDebugger? = null

    fun debuggerModule(newDebugger: IDebugger?) {
        require(!hasClient || debugger == null) {
            "Can't set debugger module=$newDebugger due to GDB client is now processing message, please wait a while


using System;
using Avalonia;

namespace Avalonia_NativeAOT_SingleFile;

public static class Program
{
    /// <summary>
    ///     Application entry point. Initializes and configures the Avalonia application with platform-specific settings
    ///     before starting the desktop lifetime manager.
    ///     Don't use any Avalonia, third-party APIs or any
    ///     SynchronizationContext-reliant code before AppMain is called: things aren't initialized
    ///     yet and stuff might break.
    /// </summary>
    /// <param name="args">Command-line arguments passed to the application</param>
    /// <remarks>
    ///     Configures Win32-specific options:
    ///     <para>- Uses ANGLE rendering via EGL for hardware-accelerated graphics</para>
    ///     <para>- Enables per-monitor DPI awareness for proper high-DPI display scaling<


球菌",
"Staphylococcus epidermidis":"[医] 表皮葡萄球菌",
"Staphylococcus fulvus":"[医] 赭黄色葡萄球菌",
"Staphylococcus haemorrhagicus":"[医] 出血性葡萄球菌",
"Staphylococcus mitis":"[医] 缓和葡萄球菌",
"Staphylococcus muscae":"[医] 蝇葡萄球菌",
"Staphylococcus parvulus":"[医] 微细葡萄球菌",
"Staphylococcus pharyngis":"[医] 咽葡萄球菌",
"Staphylococcus plicatilus":"[医] 折迭葡萄球菌",
"Staphylococcus pyogenes citreus":"[医] 柠檬色酿脓葡萄球菌",
"Staphylococcus pyogenes var. albus":"[医] 白色酿脓葡萄球菌",
"Staphylococcus pyogenes var. aureus":"[医] 金黄色酿脓葡萄球菌",
"Staphylococcus pyosepticus":"[医] 脓毒败血症葡萄球菌",
"Staphylococcus salivarius pyogenes":"[医] 酿脓性涎葡萄球菌",
"staphylococcus sera":"[医] 抗葡萄球菌血清",
"Staphylococcus tetragenus":"[医] 四联球菌",
"staphylococcus toxin":"[医] 葡萄球菌毒素",
"staphylococcus toxoid":"[医] 葡萄球菌类毒素",
"Staphylococcus ureae":"[医] 脲葡萄球菌",
"Staphylococcus viridis flavescens":"[医] 黄绿色葡萄球菌",
"staphylocoecolysin":"[医] 葡萄球菌溶素",
"staphylocosis":"[医] 葡萄球菌病",
"staphyloderma":"[医] 葡萄球菌性皮肤化脓",
"staphylodermatitis":"[医] 葡萄球菌性皮炎",
"staphylodialysis":"[医] 悬雍垂松弛",
"staphyloedema":"[医] 悬雍垂水肿",
"staphylogenes sycosis":"[医] 葡萄球菌性须疮, 寻常须疮",
"staphylohemia":"[医] 葡萄球菌菌血症",
"staphylohemolysin":"[医] 葡萄球菌溶血素",
"staphylokinase":"[医] 葡萄球菌激酶",
"staphyloleukocidin":"[医] 葡萄球菌杀白细胞素",
"staphylolysin":"[医] 葡萄球菌溶血素",
"staphyloma":"n. [医]葡萄肿",
"staphylomatou


ldStart) {
                    row = fold.end.row+1;
                    fold = this.$foldData[i++];
                    foldStart = fold ?fold.start.row :Infinity;
                }
            }
        }

        return screenRows;
    }

    // For every keystroke this gets called once per char in the whole doc!!
    // Wouldn't hurt to make it a bit faster for c >= 0x1100
    function isFullWidth(c) {
        if (c < 0x1100)
            return false;
        return c >= 0x1100 && c <= 0x115F ||
               c >= 0x11A3 && c <= 0x11A7 ||
               c >= 0x11FA && c <= 0x11FF ||
               c >= 0x2329 && c <= 0x232A ||
               c >= 0x2E80 && c <= 0x2E99 ||
               c >= 0x2E9B && c <= 0x2EF3 ||
               c >= 0x2F00 && c <= 0x2FD5 ||
               c >= 0x2FF0 && c <= 0x2FFB ||
               c >= 0x3000 && c <= 0x303E ||
               c >= 0x3041 && c <= 0x3096 ||
               c >= 0x3099 && c <= 0x30FF ||
               c >= 0x3105 && c <= 0x312D ||
               c >= 0x3131 && c <= 0x318E ||
               c >= 0x3190 && c <= 0x31BA ||
               c >= 0x31C0 && c <= 0x31E3 ||
               c >= 0x31F0 && c <= 0x321E ||
               c >= 0x3220 && c <= 0x3247 ||
               c >= 0x3250 && c <= 0x32FE ||
               c >= 0x3300 && c <= 0x4DBF ||
               c >= 0x4E00 && c <= 0xA48C ||
               c >= 0xA490 && c <= 0xA4C6 ||
               c >= 0xA960 && c <= 0xA97C ||
               c >= 0xAC00 && c <= 0xD7A3 ||
               c >= 0xD7B0 && c <= 0xD7C6 ||
               c >= 0xD7CB && c <= 0xD7FB ||
               c >= 0xF900 && c <= 0xFAFF ||
               c >= 0xFE10 && c <= 0xFE19 ||
               c >= 0xFE30 && c <= 0xFE52 ||
               c >= 0xFE54 && c <= 0xFE66 ||
               c >= 0xFE68 && c <= 0xFE6B ||
               c >= 0xFF01 && c <= 0xFF60 ||
               c >= 0xFFE0 && c <= 0xFFE6;
    };

}).call(EditSession.prototype);

require("./edit_session/folding").Folding.call(EditSession.prototype);
require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype);

exports.EditSession = EditSession;
});
/* vim:ts=4:sts=4:sw=4:
 * ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (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.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is Ajax.org Code Editor (ACE).
 *
 * The Initial Developer of the Original Code is
 * Ajax.org B.V.
 * Portions created by the Initial Developer are Copyright (C) 2010
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *      Fabian Jakobs <fabian AT ajax DOT org>
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL


border-radius: 8px;
    background-color: transparent;
}

/*^ Icon */
.h2B3SGR_w4RWdrnsRZEcD ._16jZ3HEbtaJTl80pQINN2Y ._1KU9eASfov1GnFQRbyLIdR ._1Yo-ZsBr-KbVMyAMXEYszd svg,
.gQWgnAxVrOM- .qxuaSNtrNvE- .v2uRRqcZpzM- .B6Smo5P5blM- ._5f3k46d-01g- svg {
    display: none;
}

.h2B3SGR_w4RWdrnsRZEcD ._16jZ3HEbtaJTl80pQINN2Y ._1KU9eASfov1GnFQRbyLIdR ._1Yo-ZsBr-KbVMyAMXEYszd::before,
.gQWgnAxVrOM- .qxuaSNtrNvE- .v2uRRqcZpzM- .B6Smo5P5blM- ._5f3k46d-01g-::before {
    content: "\f69a" !important;
    margin-right: 6px;
    font-size: 18px;
    color: #dcdedf;
    font-family: FluentSystemIcons-Filled !important;
    font-style: normal;
    font-weight: normal !important;
    font-variant: normal;
    text-transform: none;
    line-height: 18px;
    -webkit-font-smoothing: antialiased;
}

/*
! Search results
*/
.h2B3SGR_w4RWdrnsRZEcD ._16jZ3HEbtaJTl80pQINN2Y ._2GxMhpm7OC2WWXN_wjgA78,
.gQWgnAxVrOM- .qxuaSNtrNvE- .ZaHNigq8DMs- {
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 3px solid rgb(var(--st-color-5));
    border-radius: 8px;
    background: unset;
    background-color: rgb(var(--st-color-2));
}

/* Result lable/title */
.h2B3SGR_w4RWdrnsRZEcD ._16jZ3HEbtaJTl80pQINN2Y ._2GxMhpm7OC2WWXN_wjgA78 ._2V9568XIc6vv9aEQ3EIVlG,
.gQWgnAxVrOM- .qxuaSNtrNvE- .ZaHNigq8DMs- .hkaaZt8UNuI- {
    display: none;
}

/** Games */
.h2B3SGR_w4RWdrnsRZEcD ._16jZ3HEbtaJTl80pQINN2Y ._2GxMhpm7OC2WWXN_wjgA78 ._3Z1skIYVoqLbYiP2wy46Ce,
.gQWgnAxVrOM- .qxuaSNtrNvE- .ZaHNigq8DMs- .qRybCqH-jtw- {
    gap: 12px;
    background: unset;
}

/*^ Image */
.h2B3SGR_w4RWdrnsRZEcD ._16jZ3HEbtaJTl80pQINN2Y ._2GxMhpm7OC2WWXN_wjgA78 ._2qsM52VkK9BR1Vi0H


ars the "owner" edge to the User entity.
func (_u *CarUpdateOne) ClearOwner() *CarUpdateOne {
	_u.mutation.ClearOwner()
	return _u
}

// Where appends a list predicates to the CarUpdate builder.
func (_u *CarUpdateOne) Where(ps ...predicate.Car) *CarUpdateOne {
	_u.mutation.Where(ps...)
	return _u
}

// Select allows selecting one or more fields (columns) of the returned entity.
// The default is selecting all fields defined in the entity schema.
func (_u *CarUpdateOne) Select(field string, fields ...string) *CarUpdateOne {
	_u.fields = append([]string{field}, fields...)
	return _u
}

// Save executes the query and returns the updated Car entity.
func (_u *CarUpdateOne) Save(ctx context.Context) (*Car, error) {
	return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)
}

// SaveX is like Save, but panics if an error occurs.
func (_u *CarUpdateOne) SaveX(ctx context.Context) *Car {
	node, err := _u.Save(ctx)
	if err != nil {
		panic(err)
	}
	return node
}

// Exec executes the query on the entity.
func (_u *CarUpdateOne) Exec(ctx context.Context) error {
	_, err := _u.Save(ctx)
	return err
}

// ExecX is like Exec, but panics if an error occurs.
func (_u *CarUpdateOne) ExecX(ctx context.Context) {
	if err := _u.Exec(ctx); err != nil {
		panic(err)
	}
}

func (_u *CarUpdateOne) sqlSave(ctx context.Context) (_node *Car, err error) {
	_spec := sqlgraph.NewUpdateSpec(car.Table, car.Columns, sqlgraph.NewFieldSpec(car.FieldID, field.TypeInt))
	id, ok := _u.mutation.ID()
	if !ok {
		return nil, &ValidationError{Name: "id", err: errors.New(`entv1: missing "Car.id" for update`)}
	}
	_spec.Node.ID.Value = id
	if fields := _u.fields; len(fields) > 0 {
		_spec.Node.Columns = make([]string, 0, len(fields))
		_spec.Node.Columns = append(_spec.Node.Columns, car.FieldID)
		for _, f := range fields {
			if !car.ValidColumn(f) {
				return nil, &ValidationError{Name: f, err: fmt.Errorf("entv1: invalid field %q for query", f)}
			}
			if f != car.FieldID {
				_spec.Node.Columns = append(_spec.Node.Columns, f)
			}
		}
	}
	if ps := _u.mutation.predicates; len(ps) > 0 {
		_spec.Predicate = func(selector *sql.Selector) {
			for i := range ps {
				ps[i](selector)
			}
		}
	}
	if _u.mutation.OwnerCleared() {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2O,
			Inverse: true,
			Table:   car.OwnerTable,
			Columns: []string{car.OwnerColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt),
			},
		}
		_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
	}
	if nodes := _u.mutation.OwnerIDs(); len(nodes) > 0 {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2O,
			Inverse: true,
			Table:   car.OwnerTable,
			Columns: []string{car.OwnerColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt),
			}


の計算式を変更するか設定します。
 *    :1 にすることで後述の計算式が有効になります。
 *    :なお、アイテム/スキルのメモ欄で命中率の設定をしている場合は
 *    :このパラメータの設定に関わらず、その値を使用します。
 *
 * <Physical Hit Formula>
 * <Magical Hit Formula>
 *    :命中の計算式を設定します。
 *    :Physical~ で物理タイプの命中率、Magical~ で魔法タイプの命中率を
 *    :設定します。
 *    :1 に設定すると、必ず命中します。
 *
 * <Enabled Custom Eva>
 *    :回避の計算式を変更するか設定します。
 *    :1 にすることで後述の計算式が有効になります。
 *
 * <Physical Eva Formula>
 * <Magical Eva Formula>
 *    :回避の計算式を設定します。
 *    :Physical~ で物理タイプの回避率、Magical~ で魔法タイプの回避率を
 *    :設定します。
 *    :0 に設定すると、回避されなくなります。
 *
 *
 * [計算式(eval) の値について]
 * 計算式(eval)は、ダメージ計算式のように、計算式を入力することで、
 * 固定値以外の値を使用することができます。以下のコードを使用できます。
 *  a.param - 使用者のパラメータを参照します。(a.atk で使用者の攻撃力)
 *  b.param - 対象者のパラメータを参照します。
 *  s[x]    - スイッチID x の状態を参照します。
 *  v[x]    - 変数ID x の値を参照します。
 *  iv[x]   - アイテムのセルフ変数ID x の値を参照します。(*1)
 *  BattleManager._repeatCount - 1撃目を 0 として連続回数を参照します。
 *
 * (*1) セルフ変数を使用する場合は、FTKR_ItemSelfVariables.jsが必要です。
 *
 *
 * [設定例]
 * 1. 命中 - 回避にする場合
 * 命中側の処理で、命中 - 回避の計算を行い、回避処理は無視する。
 * この場合は回避メッセージを表示することはありません。
 * 命中処理
 * <Enabled Custom Hit>   : 1
 * <Physical Hit Formula> : a.hit - b.eva
 * <Magical Hit Formula>  : 1 - b.mev
 * 回避処理
 * <Enabled Custom Eva>   : 1
 * <Physical Eva Formula> : 0
 * <Magical Eva Formula>  : 0
 *
 * 2. 命中率が 100%を超えた分を、対象の回避から減らす場合
 * 命中処理(変更しない)
 * <Enabled Custom Hit>   : 0
 * 回避処理
 * <Enabled Custom Eva>   : 1
 * <Physical Eva Formula> : b.eva - Math.max(a.hit - 1, 0)
 * <Magical Eva Formula>  : b.mev
 *
 *
 *-----------------------------------------------------------------------------
 * 本プラグインのライセンスについて(License)
 *-----------------------------------------------------------------------------
 * 本プラグインはMITライセンスのもとで公開しています。
 * This plugin is released under the MIT License.
 *
 * Copyright (c) 2017 Futokoro
 * http://opensource.org/licenses/mit-license.php
 *
 *
 *-----------------------------------------------------------------------------
 * 変更来歴
 *-----------------------------------------------------------------------------
 *
 * v1.0.3 - 2017/06/23 : 不具合修正
 *    1. 回避率の取得処理でエラーが起きる不具合を修正。
 *
 * v1.0.2 - 2017/05/11 : 不具合修正
 *
 * v1.0.1 - 2017/04/29 : FTKR_ItemSelfVariables の v1.1.0以降に対応
 *
 * v1.0.0 - 2017/04/14 : 初版公開
 *
 *-----------------------------------------------------------------------------
 */
//=============================================================================

//==========================================================================


use crate::queries::AccountQuery;
use crate::service::CommandService;
use std::convert::Infallible;
use std::sync::Arc;
use warp::hyper::body::Bytes;
use warp::hyper::{Body, StatusCode};
use warp::Filter;

mod aggregate;
mod commands;
mod config;
mod events;
mod queries;
mod service;

#[tokio::main]
async fn main() {
    // Configure the CQRS framework using a Postgres database and two queries.
    // Database should automatically configure with `docker-compose up -d`,
    // see init file at `/db/init.sql` for more.
    let services = ServiceInjector::configured().await;

    // Configure the query endpoint at `GET /account/{{accountId}}
    // This will load a view for the sumbitted `accountId` to add to the respoonse.
    let query = warp::get()
        .and(warp::path("account"))
        .and(warp::path::param())
        .and(with_query(services.query_service()))
        .and_then(query_handler);

    // Configure the command endpoint at `POST /account/:accountId`
    // Response is a 204 status if successful or a 400 with error message if the command fails.
    // For a failure example, try withdrawing more money than is available.
    let command = warp::post()
        .and(warp::path("account"))
        .and(warp::path::param())
        .and(warp::body::bytes())
        .and(with_command(services.command_service()))
        .and_then(command_handler);

    // Combines the command and query routes and starts a warp server.
    let routes = warp::any().and(query).or(command);
    warp::serve(routes).run(([127, 0, 0, 1], 3030)).await
}

fn with_query(
    query: Arc<AccountQuery>,
) -> impl Filter<Extract = (Arc<AccountQuery>,), Error = Infallible> + Clone {
    warp::any().map(move || query.clone())
}

fn with_command(
    command_service: Arc<CommandService>,
) -> impl Filter<Extract = (Arc<CommandService>,), Error = Infallible> + Clone {
    warp::any().map(move || command_service.clone())
}

// Serves as our query endpoint to respond with the materialized BankAccountView
// for the requested account.
async fn query_handler(
    // The requested account id, injected by warp from the path parameter.
    account_id: String,
    // The account query repository, injected by warp from the configured `with_query` method.
    query_repo: Arc<AccountQuery>,
) -> std::result::Result<impl Reply, Rejection> {
    let response = match query_repo.load(account_id).await {
        None => Response::builder()
            .status(StatusCode::NOT_FOUND)
            .body(Body::empty()),
        Some(query) => {
            let body = serde_json::to_string(&query).unwrap();
            Response::builder()
                .header(warp::http::header::CONTENT_TYPE, "application/json")
                .body(Body::from(body))
        }
    };
    Ok(response)
}

// Serves as our command endpoint to make changes in our `BankAccount` aggregate
// for the requested account.
async fn command_handler(
    // The requested account id, injected by warp from the path parameter.
    account_id: String,
    // The body of the request, injected by warp.
    payload: Bytes,
    // A command service for handling commands, injected by warp from the configured `with_command` method.
    command_service: Arc<CommandService>,
) -> std::result::Result<impl Reply, Rejection> {
    let payload = std::str::from_utf8(payload.as_ref()).unwrap().to_string();
    let result = command_service.process_command(account_id.as_str(), payload.as_bytes());
    match resu


// TODO: Use resp.
	_ = resp
}

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

// Code generated by protoc-gen-go_gapic. DO NOT EDIT.

// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_sync]

package main

import (
	"context"

	cloudcontrolspartner "cloud.google.com/go/cloudcontrolspartner/apiv1beta"
	cloudcontrolspartnerpb "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &cloudcontrolspartnerpb.ListWorkloadsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListWorkloadsRequest.
	}
	it := c.ListWorkloads(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*cloudcontrolspartnerpb.ListWorkloadsResponse)
	}
}

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

// Code generated by protoc-gen-go_gapic. DO NOT EDIT.

// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_UpdateCustomer_sync]

package main

import (
	"context"

	cloudcontrolspartner "cloud.google.com/go/cloudcontrolspartner/apiv1"
	cloudcontrolspartnerpb "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb"
)

func main() {


     // remove any html a tags
                            pText = pText.replace(/<a .+">/ig, '').replace(/<\/a>/ig, '');

                            // clean text
                            pText = pText.replace(/See /ig, 'Please also visit gov.uk for ')
                                .replace(/ section/ig, ' topic')
                                .replace(/ page/ig, ' subject')
                                .replace(/ our /ig, ' gov.uk ')
                                .replace(/’/ig, `'`);
                        }
                        return pText;
                    }).join('');

                    // note title exists and text is at least 3 characters
                    if ($notes?.eq(i)?.text() && texts?.length > 3) {

                        const values = {
                            subject: $notes?.eq(i)?.text()?.trim(),
                            content: texts,
                            line: 1,
                            objectID: 0
                        };
                        values.objectID = this.hashCode(country + values.subject + values.line + values.content);

                        travelAdvices.push({
                            ...travelAdviceBase,
                            ...values
                        });
                    }
                } catch (error) {
                    errors.push(error);
                }
            })
        }

        if (errors?.length > 0) { throw errors }

        return travelAdvices;
    }

    public replaceSummaryData = async (travelAdvices: TravelAdvice[]): Promise<boolean> => {

        let countries = travelAdvices.map(s => s.country);
        countries = countries.filter((value, index, array) => array.indexOf(value) === index)

        const client: any = algoliasearch(Config.algoliaConfig.id, Config.algoliaConfig.adminKey);
        const algoliaIndex = client.initIndex(Config.algoliaConfig.travelAdviceIndex);

        try {
            for (const country of countries) {

                const deleted = await algoliaIndex.deleteBy({
                    filters: `country:"${country}" AND category:"Foreign travel advice"`
                });
            }
        } catch (error) { throw error; }

        try {
            await algoliaIndex.saveObjects(travelAdvices);
            return true;

        } catch (error) { throw error; }

    }

    private fetchData = async (urlToFetch: string): Promise<Response> => {
        try {
            const response = await fetch(urlToFetch);
            if (response.status !== 200) {
                throw Error("Error occurred while fetching data");
            }
            return response;
        } catch (error) {
            throw error;
        }
    }

    private hashCode = (s: string) => {
        let h = 0, i = 0;
        const l = s.length;
        if (l > 0)
            while (i < l)
                h = (h << 5) - h + s.charCodeAt(i++) | 0;
        return h;
    };
}import { Log } from './models/log.model';
var log
var dia = new Date();
dia.setHours(dia.getHours()-5);
function middleware(error:any, req:any, res:any, next:any): void {
    res.json({
        status:'error',
        name: error.name,
        message: error.message,
        date: Date(),
    });

    log = {
        nombre: error.name,
        mensaje: error.message,
        fecha : dia,
    };
    Log.create(log).then(logDB=>{
        // console.log('Se guardo con exito el log');
    }).catch(err => {
        next(err);
    })
};

module.exports =  middleware;
import {AI, Sprite, Rect, Serializable} from 'wglt';

import {Game} from '../game';

import {Monster} from './monster';
import {Player} from './player';
import { Sentiment } from './statsactor';
import { WindCrawler } from './windcrawler';

const SPRITE = new Sprite(288, 312, 16, 24, 2, true, undefined, 0xaad4e2ff);

@Serializable('WindElementalAI')
class WindElementalAI extends AI {
  doAi() {
    const elemental = this.actor as WindElemental;
    if


tid31, 2;
--:-:-:-:0      XMAD.LO2 offset, offset2, 1x<32*36>, tid31;
</SCHEDULE_BLOCK>

--:-:-:-:6  @P1 BRA.U FILTER_SETUP;

##############################################################
IMAGE_SETUP:

<SCHEDULE_BLOCK>
// (GC32,GY,GX,N,6,6,32)
// offset += idx_C * YXN*32*36
--:-:-:-:1      XMAD.LO2C offset, idx_C, param_YXN_1152, offset;

--:-:-:-:1      LEA      track0.CC, offset, param_I[0],     [+ dtype_shift() +];
--:-:-:-:0      LEA.HI.X track1,    offset, param_I[1], RZ, [+ dtype_shift() +];
</SCHEDULE_BLOCK>

--:-:-:-:6      BRA.U LOAD;

##############################################################
FILTER_SETUP:

<SCHEDULE_BLOCK>
// writeS += 32*36*2*4
--:-:-:-:1      IADD writeS, writeS, 4x<32*36*2>;

// (GK32,GY,GX,N,6,6,32)
// offset += idx_K * YXN*32*36
--:-:-:-:1      XMAD.LO2C offset, idx_K, param_YXN_1152, offset;

--:-:-:-:1      LEA      track0.CC, offset, param_E[0],     [+ dtype_shift() +];
--:-:-:-:2      LEA.HI.X track1,    offset, param_E[1], RZ, [+ dtype_shift() +];
</SCHEDULE_BLOCK>

##############################################################
LOAD:

20:-:-:-:1  @P6 LDG.E.[+ vec_size() +] T0, [track + 4x<0*32 * $dtype_size>];
--:-:-:-:1  @P6 LDG.E.[+ vec_size() +] T1, [track + 4x<1*32 * $dtype_size>];
--:-:2:-:1  @P6 LDG.E.[+ vec_size() +] T2, [track + 4x<2*32 * $dtype_size>];

--:-:-:-:1 @!P6 LDS.U.[+ vec_size() +] T0, [addr_zero];
--:-:-:-:1 @!P6 LDS.U.[+ vec_size() +] T1, [addr_zero];
--:-:2:-:1 @!P6 LDS.U.[+ vec_size() +] T2, [addr_zero];

--:-:-:-:1  @P6 LDG.E.[+ vec_size() +] T3, [track + 4x<3*32 * $dtype_size>];
--:-:-:-:1  @P6 LDG.E.[+ vec_size() +] T4, [track + 4x<4*32 * $dtype_size>];
--:-:3:-:1  @P6 LDG.E.[+ vec_size() +] T5, [track + 4x<5*32 * $dtype_size>];

--:-:-:-:1 @!P6 LDS.U.[+ vec_size() +] T3, [addr_zero];
--:-:-:-:1 @!P6 LDS.U.[+ vec_size() +] T4, [addr_zero];
--:-:3:-:1 @!P6 LDS.U.[+ vec_size() +] T5, [addr_zero];

--:-:-:-:1  @P6 LDG.E.[+ vec_size() +] T6, [track + 4x<6*32 * $dtype_size>];
--:-:-:-:1  @P6 LDG.E.[+ vec_size()


',
            Old:'',
            Radical:'金',
            Strokes:'23',
            Grade:'S',
            Year_added:'',
            English_meaning:'specimen',
            Readings_kana:'カン、かんが-みる',
            Readings_romaji:'kan, kanga-miru'
        },
        {
            nr:'292',
            New:'丸',
            Old:'',
            Radical:'丶',
            Strokes:'3',
            Grade:'2',
            Year_added:'',
            English_meaning:'circle',
            Readings_kana:'ガン、まる、まる-い、まる-める',
            Readings_romaji:'gan, maru, maru-i, maru-meru'
        },
        {
            nr:'293',
            New:'含',
            Old:'',
            Radical:'口',
            Strokes:'7',
            Grade:'S',
            Year_added:'',
            English_meaning:'include',
            Readings_kana:'ガン、ふく-む、ふく-める',
            Readings_romaji:'gan, fuku-mu, fuku-meru'
        },
        {
            nr:'294',
            New:'岸',
            Old:'',
            Radical:'山',
            Strokes:'8',
            Grade:'3',
            Year_added:'',
            English_meaning:'beach',
            Readings_kana:'ガン、きし',
            Readings_romaji:'gan, kishi'
        },
        {
            nr:'295',
            New:'岩',
            Old:'',
            Radical:'山',
            Strokes:'8',
            Grade:'2',
            Year_added:'',
            English_meaning:'boulder',
            Readings_kana:'ガン、いわ',
            Readings_romaji:'gan, iwa'
        },
        {
            nr:'296',
            New:'玩',
            Old:'',
            Radical:'玉',
            Strokes:'8',
            Grade:'S',
            Year_added:'2010',
            English_meaning:'trifle with',
            Readings_kana:'ガン',
            Readings_romaji:'gan'
        },
        {
            nr:'297',
            New:'眼',
            Old:'',
            Radical:'目',
            Strokes:'11',
            Grade:'5',
            Year_added:'',
            English_meaning:'eyeball',
            Readings_kana:'ガン、（ゲン）、まなこ',
            Readings_romaji:'gan, (gen), manako'
        },
        {
            nr:'298',
            New:'頑',
            Old:'',
            Radical:'頁',
            Strokes:'13',
            Grade:'S',
            Year_added:'1981',
            English_meaning:'stubborn',
            Readings_kana:'ガン',
            Readings_romaji:'gan'
        },
        {
            nr:'299',
            New:'顔',
            Old:'',
            Radical:'頁',
            Strokes:'18',
            Grade:'2',
            Year_added:'',
            English_meaning:'face',
            Readings_kana:'ガン、かお',
            Readings_romaji:'gan, kao'
        },
        {
            nr:'300',
            New:'願',
            Old:'',
            Radical:'頁',
            Strokes:'19',
            Grade:'4',
            Year_added:'',
            English_meaning:'request',
            Readings_kana:'ガン、ねが-う',
            Readings_romaji:'gan, nega-u'
        },
        {
            nr:'301',
            New:'企',
            Old:'',
            Radical:'人',
            Strokes:'6',
            Grade:'S',
            Year_added:'',
            English_meaning:'plan',
            Readings_kana:'キ、くわだ-てる',
            Readings_r


l(t.result);
    });
  });
});
import {
  Module,
  VuexModule,
  Action,
} from 'vuex-module-decorators';
import {
  AxiosResponse,
  AxiosRequestConfig,
  Method,
} from 'axios';
import * as t from 'io-ts';
import iTypescriptCheck from '~/helpers/iTypescriptCheck';

export type AnyData = object | any[] | undefined;

export interface ApiQuery<
  Data extends AnyData = undefined,
  T = undefined,
  Params extends AnyData = undefined
> {
  url: string;
  params?: Params;
  headers?: any;
  IOType?: t.Type<T>;
  data?: Data;
}

export interface ApiSendQuery<
  Data extends AnyData,
  T = any,
  Params extends AnyData = undefined
> extends ApiQuery<Data, T, Params> {
  method: Method;
}

@Module({
  name: 'api',
  stateFactory: true,
  namespaced: true,
})
export default class Api extends VuexModule {
  @Action({ rawError: true })
  private send(
    {
      url,
      headers,
      method,
      params,
      data,
      IOType,
    }: ApiSendQuery<AnyData, any, AnyData>,
  ): Promise<AxiosResponse<any> | undefined> {
    const options: AxiosRequestConfig = {
      url,
      method,
      headers,
      data,
      params,
    };
    return this.store.$api(options)
      .then(async (response) => {
        if (IOType) iTypescriptCheck(IOType, response.data);
        return response;
      })
      .catch((error) => {
        // eslint-disable-next-line
        console.error(error);
        const { response } = error;
        return response;
      });
  }

  @Action({ rawError: true })
  public get(request: ApiQuery<AnyData, any, AnyData>): Promise<AxiosResponse<any> | undefined> {
    // console.log(Object.keys(this.context));
    return this.send({
      method: 'get',
      ...request,
    });
  }
}
export function objectEquals(obj1: any, obj2: any): boolean {
    const keys1 = Object.keys(obj1);
    const keys2 = Object.keys(obj2);
    if (keys1.length !== keys2.length) {
        return false;
    }
    for (let key1 in keys1) {
        if (!obj2.hasOwnProperty(key1)) {
            return false;
        }
        if (obj1[key1] !== obj2[key1]) {
            return false;
        }
    }
    return true;
}

export function padLeft(str: string, size: number, char: string = " "): string {
    while (str.length <= size) {
        str = char + str;
    }
    return str;
}

export function padRight(
    str: string,
    size: number,
    char: string = " "
): string {
    while (str.length <= size) {
        str = str + char;
    }
    return str;
}

export function merge(...objects: (object | undefined | null)[]) {
    return Object.assign({}, ...objects.filter((o) => o != null));
}

export function isThemeLight() {
    return document.body.className.includes("vscode-light");
}

export function isThemeDark() {
    return !isThemeLight();
}
import GenericInput from "../../core/GenericInput";

/**
 * Resolution input
 */
export default class ResolutionInput extends GenericInput<number | null> {
  protected nullValue: string = "auto";

  protected changeBehaviour(e: Event): void {
    let valueToSet: number = NaN


 externalExporters(agentsRes *agents.ListAgentsOK, nodeID string) []listResultAgent {
	var agentsList []listResultAgent
	for _, a := range agentsRes.Payload.ExternalExporter {
		if a.RunsOnNodeID == nodeID {
			agentsList = append(agentsList, listResultAgent{
				AgentType:   types.AgentTypeExternalExporter,
				AgentID:     a.AgentID,
				ServiceID:   a.ServiceID,
				Status:      getStatus(nil),
				Disabled:    a.Disabled,
				MetricsMode: getMetricsMode(a.PushMetricsEnabled),
				Port:        a.ListenPort,
			})
		}
	}
	return agentsList
}

func vmAgents(agentsRes *agents.ListAgentsOK, pmmAgentIDs map[string]struct{}) []listResultAgent {
	var agentsList []listResultAgent
	for _, a := range agentsRes.Payload.VMAgent {
		if _, ok := pmmAgentIDs[a.PMMAgentID]; ok {
			agentsList = append(agentsList, listResultAgent{
				AgentType:   types.AgentTypeVMAgent,
				AgentID:     a.AgentID,
				Status:      getStatus(a.Status),
				MetricsMode: getMetricsMode(true),
				Port:        a.ListenPort,
			})
		}
	}
	return agentsList
}

func nomadAgents(agentsRes *agents.ListAgentsOK, pmmAgentIDs map[string]struct{}) []listResultAgent {
	var agentsList []listResultAgent
	for _, a := range agentsRes.Payload.NomadAgent {
		if _, ok := pmmAgentIDs[a.PMMAgentID]; ok {
			agentsList = append(agentsList, listResultAgent{
				AgentType: types.AgentTypeNomadAgent,
				AgentID:   a.AgentID,
				Status:    getStatus(a.Status),
				Disabled:  a.Disabled,
				Port:      a.ListenPort,
			})
		}
	}
	return agentsList
}

func mysqldExporters(agentsRes *agents.ListAgentsOK, pmmAgentIDs map[string]struct{}) []listResultAgent {
	var agentsList []listResultAgent
	for _, a := range agentsRes.Payload.MysqldExporter {
		if _, ok := pmmAgentIDs[a.PMMAgentID]; ok {
			agentsList = append(agentsList, listResultAgent{
				AgentType:   types.AgentTypeMySQLdExporter,
				AgentID:     a.AgentID,
				ServiceID:   a.ServiceID,
				Status:      getStatus(a.Status),
				Disabled:    a.Disabled,
				MetricsMode: getMetricsMode(a.PushMetricsEnabled),
				Port:        a.ListenPort,
			})
		}
	}
	return agentsList
}

func nodeExporters(agentsRes *agents.ListAgentsOK, pmmAgentIDs map[string]struct{}) []listResultAgent {
	var agentsList []listResultAgent
	for _, a := range agentsRes.Payload.NodeExporter {
		if _, ok := pmmAgentIDs[a.PMMAgentID]; ok {
			agentsList = append(agentsList, listResultAgent{
				AgentType:   types.AgentTypeNodeExporter,
				AgentID:     a.AgentID,
				Status:      getStatus(a.Status),
				Disabled:    a.Disabled,
				MetricsMode: getMetricsMode(a.PushMetricsEnabled),
				Port:        a.ListenPort,
			})
		}
	}
	return agentsList
}
// Copyright (C) 2023 Percona LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//  http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,


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

"""This code example gets an availability forecast for an existing line item.

To determine which line items exist, run get_all_line_items.py.

"""

# Import appropriate modules from the client library.
from googleads import ad_manager

# Set the line item to get a forecast for.
LINE_ITEM_ID = 'INSERT_LINE_ITEM_ID_HERE'

def main(client, line_item_id):
  # Initialize appropriate service.
  forecast_service = client.GetService('ForecastService', version='v202502')

  # Set forecasting options.
  forecast_options = {
      'includeContendingLineItems': True,
      'includeTargetingCriteriaBreakdown': True,
  }

  # Get forecast for line item.
  forecast = forecast_service.getAvailabilityForecastById(
      line_item_id, forecast_options)
  matched = int(forecast['matchedUnits'])
  available_units = int(forecast['availableUnits'])

  if matched > 0:
    available_percent = (float(available_units) / matched) * 100.
  else:
    available_percent = 0

  contending_line_items = getattr(forecast, 'contentingLineItems', [])

  # Display results.
  print('%s %s matched.' % (matched, forecast['unitType'].lower()))
  print('%s%% %s available.' % (
      available_percent, forecast['unitType'].lower()))
  print('%d contending line items.' % len(contending_line_items))

  if 'possibleUnits' in forecast and matched:
    possible_percent = (int(forecast['possibleUnits'])/float(matched)) * 100.
    print('%s%% %s possible' % (possible_percent, forecast['unitType'].lower()))

if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client, LINE_ITEM_ID)


		if err != nil {
			return echo.NewHTTPError(http.StatusInternalServerError, "Failed to unmarshal storage service id").SetInternal(err)
		}
		if storageServiceID == storageID {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Storage service %d is using", storageID))
		}
	}

	if err = s.Store.DeleteStorage(ctx, &store.DeleteStorage{ID: storageID}); err != nil {
		return echo.NewHTTPError(http.StatusInternalServerError, "Failed to delete storage").SetInternal(err)
	}
	return c.JSON(http.StatusOK, true)
}

// UpdateStorage godoc
//
//	@Summary	Update a storage
//	@Tags		storage
//	@Produce	json
//	@Param		storageId	path		int						true	"Storage ID"
//	@Param		patch		body		UpdateStorageRequest	true	"Patch request"
//	@Success	200			{object}	store.Storage			"Updated resource"
//	@Failure	400			{object}	nil						"ID is not a number: %s | Malformatted patch storage request | Malformatted post storage request"
//	@Failure	401			{object}	nil						"Missing user in session | Unauthorized"
//	@Failure	500			{object}	nil						"Failed to find user | Failed to patch storage | Failed to convert storage"
//	@Router		/api/v1/storage/{storageId} [PATCH]
func (s *APIV1Service) UpdateStorage(c echo.Context) error {
	ctx := c.Request().Context()
	userID, ok := c.Get(userIDContextKey).(int32)
	if !ok {
		return echo.NewHTTPError(http.StatusUnauthorized, "Missing user in session")
	}

	user, err := s.Store.GetUser(ctx, &store.FindUser{
		ID: &userID,
	})
	if err != nil {
		return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find user").SetInternal(err)
	}
	if user == nil || user.Role != store.RoleHost {
		return echo.NewHTTPError(http.StatusUnauthorized, "Unauthorized")
	}

	storageID, err := util.ConvertStringToInt32(c.Param("storageId"))
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("ID is not a number: %s", c.Param("storageId"))).SetInternal(err)
	}

	update := &UpdateStorageRequest{}
	if err := json.NewDecoder(c.Request().Body).Decode(update); err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, "Malformatted patch storage request").SetInternal(err)
	}
	storageUpdate := &store.UpdateStorage{
		ID: storageID,
	}
	if update.Name != nil {
		storageUpdate.Name = update.Name
	}
	if update.Config != nil {
		if update.Type == StorageS3 {
			configBytes, err := json.Marshal(update.Config.S3Config)
			if err != nil {
				return echo.NewHTTPError(http.StatusBadRequest, "Malformatted post storage request").SetInternal(err)
			}
			configString := string(configBytes)
			storageUpdate.Config = &configString
		}
	}

	storage, err := s.Store.UpdateStorage(ctx, storageUpdate)
	if err != nil {
		return echo.NewHTTPError(http.StatusInternalServerError, "Failed to patch storage").SetInternal(err)
	}
	storageMessage, err := ConvertStorageFromStore(storage)
	if err != nil {
		return echo.NewHTTPError(http.StatusInternalServerError, "Failed to convert storage").SetInternal(err)
	}
	return c.JSON(http.StatusOK, storageMessage)
}

func ConvertStorageFrom


2(pA);
                    pA += ch_im_in;
                    inB.word = *__SIMD32(pB);
                    pB += ch_im_in;
                    sum += inA.bytes[0] * inB.bytes[0];
                    sum2 += inA.bytes[1] * inB.bytes[1];
                    sum3 += inA.bytes[2] * inB.bytes[2];
                    sum4 += inA.bytes[3] * inB.bytes[3];
                    colCnt--;
                }

                *pOut++ = (q7_t) __SSAT((sum >> out_shift), 8);
                *pOut++ = (q7_t) __SSAT((sum2 >> out_shift), 8);
                *pOut++ = (q7_t) __SSAT((sum3 >> out_shift), 8);
                *pOut++ = (q7_t) __SSAT((sum4 >> out_shift), 8);

                rowCnt--;
            }

            rowCnt = ch_im_out & 0x3;
            while (rowCnt)
            {
                q7_t     *pB = colBuffer + row_shift;
                const q7_t *pA = wt + row_shift;
                q31_t     sum = ((q31_t)(*pBias++) << bias_shift) + NN_ROUND(out_shift);
                uint16_t  colCnt = (dim_kernel * dim_kernel);

                row_shift += 1;

                while (colCnt)
                {
                    q7_t      A1 = *pA;
                    q7_t      B1 = *pB;
                    pA += ch_im_in;
                    pB += ch_im_in;
                    sum += A1 * B1;

                    colCnt--;
                }
                *pOut++ = (q7_t) __SSAT((sum >> out_shift), 8);
                rowCnt--;
            }

            /* clear counter and pointers */
            pBuffer = colBuffer;
        }
    }

#else
    /* Run the following code as reference implementation for Cortex-M0 and Cortex-M3 */
    int       i_out_y, i_out_x, i_ch_out, i_ker_x, i_ker_y;
    int       conv_out;

    /* do some checking here, basically ch_im_in == ch_im_out */
    if (ch_im_in != ch_im_out)
    {
        return ARM_MATH_SIZE_MISMATCH;
    }

    for (i_out_y = 0; i_out_y < dim_im_out; i_out_y++)
    {
        for (i_out_x = 0; i_out_x < dim_im_out; i_out_x++)
        {
            for (i_ch_out = 0; i_ch_out < ch_im_out; i_ch_out++)
            {
                // for each output
                conv_out = ((q31_t)(bias[i_ch_out]) << bias_shift) + NN_ROUND(out_shift);
                for (i_ker_y = 0; i_ker_y < dim_kernel; i_ker_y++)
                {
                    for (i_ker_x = 0; i_ker_x < dim_kernel; i_ker_x++)
                    {
                        int       in_row = stride * i_out_y + i_ker_y - padding;
                        int       in_col = stride * i_out_x + i_ker_x - padding;
                        if (in_row >= 0 && in_col >= 0 && in_row < dim_im_in && in_col < dim_im_in)
                        {
                            conv_out +=
                                Im_in[(in_row *
                                       dim_im_in +
                                       in_col) *
                                      ch_im_in +
                                      i_ch_out] * wt[(i_ker_y * dim_kernel + i_ker_x) * ch_im_out + i_ch_out];
                        }
                    }
                }
                Im_out[(i_out_y * dim_im_out +
                        i_out_x) * ch_im_out + i_ch_out] = (q7_t) __SSAT((conv_out >> out_shift), 8);
            }
        }
    }

#endif                          /* ARM_MATH_DSP */

    /* Return to application */
    return ARM_MATH_SUCCESS;

}

/**
 * @} end of NNConv group
 */


) / 2,
                    (outerPoints[i].Y + outerPoints[nextIndex].Y) / 2
                );

                ctx.QuadraticBezierTo(controlPoint, endPoint, true, false);
            }

            ctx.QuadraticBezierTo(outerPoints[0], outerPoints[0], true


using System;
using System.Threading.Tasks;
using WaveEngine.Common.Math;
using WebAssembly;
using WebGLDotNET;

namespace Samples
{
    // https://www.ibiblio.org/e-notes/webgl/gpu/bounce.htm
    // https://webglreport.com/?v=2
    public class TransformFeedback : ISample
    {
        private const string ButtonId = "transformNext";

        private WebGL2RenderingContext gl;

        private uint aPosLoc;
        private WebGLBuffer bufA;
        private WebGLBuffer bufB;

        private bool shouldDraw = true;

        private Vector4 clearColor;
        private JSObject canvas;

        private int canvasWidth;
        private int canvasHeight;

        public bool EnableFullScreen => false;

        public string Description => "Simple Transform Feedback WebGL 2 demo " +
            "from here. " +
            "Points from vertex shader output are swapped between buffers. " +
            "Then we unbind it and swap buffers for the next draw.";

        public Task InitAsync(JSObject canvas, Vector4 clearColor)
        {
            this.clearColor = clearColor;
            this.canvas = canvas;

            canvasWidth = (int)canvas.GetObjectProperty("width");
            canvasHeight = (int)canvas.GetObjectProperty("height");

            HtmlHelper.AddButton(ButtonId, "Next");
            HtmlHelper.AttachButtonOnClickEvent(ButtonId, new Action<JSObject>(clickEvent =>
            {
                shouldDraw = true;
                clickEvent.Dispose();
            }));

            return Task.CompletedTask;
        }

        public void Run()
        {
            gl = new WebGL2RenderingContext(canvas);

            var vertexShaderCode =
@"#version 300 es
in vec4 aPos;
void main(void)
{
   gl_PointSize = 20.;
   gl_Position = vec4(-aPos.x, aPos.yzw);
}
";

            var fragmentShaderCode =
@"#version 300 es
precision highp float;
out vec4 fragColor;
void main(void)
{
    fragColor = vec4(1., 0., 0., 1. );
}
";
            var vertexShader = GLExtensions.GetShader(
                gl,
                vertexShaderCode,
                WebGLRenderingContextBase.VERTEX_SHADER);
            var fragmentShader = GLExtensions.GetShader(
                gl,
                fragmentShaderCode,


using System;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Core;
using DevExpress.ExpressApp.DC;
using DevExpress.ExpressApp.Security;
using DevExpress.ExpressApp.Security.ClientServer;
using DevExpress.ExpressApp.Xpo;

namespace Blazor.ServerSide.Services {
    public class ObjectSpaceProviderFactory : IObjectSpaceProviderFactory {
        readonly ISecurityStrategyBase security;
        readonly IXpoDataStoreProvider xpoDataStoreProvider;
        readonly ITypesInfo typesInfo;

        readonly IServiceProvider serviceProvider;
        public ObjectSpaceProviderFactory(ISe


: RistrettoPoint) -> Self {
        Self(point)
    }
}

impl ReprBytes for RistrettoPublic {
    type Size = U32;
    type Error = KeyError;

    fn from_bytes(src: &GenericArray<u8, U32>) -> Result<Self, KeyError> {
        Ok(Self(
            CompressedRistretto::from_slice(src.as_slice())
                .decompress()
                .ok_or(KeyError::InvalidPublicKey)?,
        ))
    }

    fn to_bytes(&self) -> GenericArray<u8, U32> {
        self.0.compress().to_bytes().into()
    }
}

derive_serde_from_repr_bytes!(RistrettoPublic);
derive_prost_message_from_repr_bytes!(RistrettoPublic);
derive_into_vec_from_repr_bytes!(RistrettoPublic);
derive_try_from_slice_from_repr_bytes!(RistrettoPublic);

// Many historical APIs assumed TryFrom<&[u8;32]> existed for RistrettoPublic
// This will work fine in code that is not generic over the size of the key
impl TryFrom<&[u8; 32]> for RistrettoPublic {
    type Error = KeyError;
    fn try_from(src: &[u8; 32]) -> Result<Self, KeyError> {
        Self::try_from(&src[..])
    }
}

impl RistrettoPublic {
    // Many historical APIs based on ReprBytes32 in mobilecoin use to_bytes() -> [u8;32].
    // This is okay in non-generic code
    pub fn to_bytes(&self) -> [u8; 32] {
        self.0.compress().to_bytes()
    }

    /// Verify a deterministic Schnorrkel signature created with the corresponding [`RistrettoPrivate::sign_schnorrkel()`] method.
    pub fn verify_schnorrkel(
        &self,
        context: &'static [u8],
        message: &[u8],
        signature: &RistrettoSignature,
    ) -> Result<(), SchnorrkelError> {
        let ctx = schnorrkel::signing_context(context);
        let pubkey = SchnorrkelPublic::from_point(*self.as_ref());
        pubkey.verify(ctx.bytes(&message), &signature.try_into()?)
    }
}

impl PartialOrd for RistrettoPublic {
    fn partial_cmp(&self, other: &RistrettoPublic) -> Option<Ordering> {
        self.to_bytes().partial_cmp(&other.to_bytes())
    }
}

impl Ord for RistrettoPublic {
    fn cmp(&self, other: &RistrettoPublic) -> Ordering {
        self.to_bytes().cmp(&other.to_bytes())
    }
}

impl Hash for RistrettoPublic {
    fn hash<H: Hasher>(&self, state: &mut H) {
        self.to_bytes().hash(state)
    }
}

impl Eq for RistrettoPublic {}

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

impl PublicKey for RistrettoPublic {}

impl From<&RistrettoPrivate> for RistrettoPublic {
    fn from(private: &RistrettoPrivate) -> Self {
        let x = private.0;
        let G = RISTRETTO_BASEPOINT_POINT;
        let Y = x * G;

        Self(Y)
    }
}

impl From<&RistrettoEphemeralPrivate> for RistrettoPublic {
    fn from(private: &RistrettoEphemeralPrivate) -> Self {
        let x = private.0;
        let G = RISTRETTO_BASEPOINT_POINT;
        let Y = x * G;

        Self(Y)
    }
}

impl Debug for


which can be part of an
/// external crate), it deletes the marked foreign item and replaces all its uses
/// with uses of the matching foreign item in `MOD_PATH`.  If a replacement item
/// has a different type than the original, it also inserts the necessary casts at
/// each use of the item.
pub struct CanonicalizeExterns {
    path: String,
}

fn is_foreign_symbol(tcx: TyCtxt, did: DefId) -> bool {
    tcx.is_foreign_item(did) &&
    matches!([tcx.def_kind(did)] Some(DefKind::Fn), Some(DefKind::Static))
}

impl Transform for CanonicalizeExterns {
    fn transform(&self, krate: &mut Crate, st: &CommandState, cx: &RefactorCtxt) {
        let tcx = cx.ty_ctxt();

        // List all extern fns in the target library module
        let lib_path = self.path.split("::").map(|s| Ident::from_str(s)).collect::<Vec<_>>();
        let lib = resolve::resolve_absolute(tcx, &lib_path);

        let mut symbol_map = HashMap::new();

        for (_sym, def) in resolve::module_children(tcx, lib.def_id()) {
            let did = def.def_id();
            if is_foreign_symbol(tcx, did) {
                // Foreign fns can't have region or type params, so empty substs should be fine.
                let inst = Instance::new(did, tcx.intern_substs(&[]));
                // Get the actual linker symbol for this extern item, considering both the item's
                // name and its attributes.  This is distinct from the `ast::symbol::Symbol`
                // produced by `module_children`, which is simply the name of the item.
                let sym = tcx.symbol_name(inst).name.as_symbol();
                symbol_map.insert(sym, did);
            }
        }

        for (&sym, &def) in &symbol_map {
            info!("  found symbol {} :: {:?} at {:?}", self.path, sym, def);
        }

        // Collect DefIds of marked externs whose symbols match something in `symbol_map`

        // Map from replaced fn DefId to replacement fn DefId
        let mut replace_map = HashMap::new();

        visit_nodes(krate, |fi: &ForeignItem| {
            if !st.marked(fi.id, "target") {
                return;
            }

            let did = cx.node_def_id(fi.id);
            if !is_foreign_symbol(tcx, did) {
                return;
            }

            let inst = Instance::new(did, tcx.intern_substs(&[]));
            let sym = tcx.symbol_name(inst).name.as_symbol();
            if let Some(&repl_did) = symbol_map.get(&sym) {
                replace_map.insert(did, repl_did);
            }
        });

        // Consult the types of the old and new externs to figure out where we'll need to add casts

        /// In `ty_replace_map`, which types need replacing?
        #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
        enum TyLoc {
            /// The type of a function argument
            Arg(usize),
            /// The return type of a function
            Ret,
            /// The type of the whole item
            Whole,
        }
        let mut ty_replace_map: HashMap<(DefId, TyLoc), (Ty, Ty)> = HashMap::new();

        for (&old_did, &new_did) in &replace_map {
            let old_ty = cx.def_type(old_did);
            let new_ty = cx.def_type(new_did);

            if !matches!([old_ty.sty] TyKind::FnDef(..)) {
                // Non-fn items are easy to handle.
                if old_ty != new_ty {
                    ty_repl


**********
 * Name: up_earlyserialinit, up_serialinit, and up_putc
 *
 * Description:
 *   stubs that may be needed.  These stubs would be used if all UARTs are
 *   disabled.  In that case, the logic in common/up_initialize() is not
 *   smart enough to know that there are not UARTs and will still expect
 *   these interfaces to be provided.
 *
 ****************************************************************************/
#else /* HAVE_UART_DEVICE */
void up_earlyserialinit(void)
{
}

void up_serialinit(void)
{
}

int up_putc(int ch)
{
  return ch;
}

#endif /* HAVE_UART_DEVICE */
#else /* USE_SERIALDRIVER */

/****************************************************************************
 * Name: up_putc
 *
 * Description:
 *   Provide priority, low-level access to support OS debug writes
 *
 ****************************************************************************/

int up_putc(int ch)
{
#ifdef HAVE_SERIAL_CONSOLE
  /* Check for LF */

  if (ch == '\n')
    {
      /* Add CR */

      up_lowputc('\r');
    }

  up_lowputc(ch);
#endif
  return ch;
}

#endif /* USE_SERIALDRIVER */


t until stack.size) {
      val pos = stack[i].key
      if (pos == -1) error("invalid position $pos for key")
      writeOffset(stack[i].key, byteWidth)
    }
    // Then the types.
    return Value(T_VECTOR_KEY, -1, bitWidth, vloc)
  }

  private inline fun createVector(key: Int, start: Int, length: Int, keys: Value? = null): Value {
    return createAnyVector(key, start, length, T_VECTOR, keys) {
      // add types since we are not creating a typed vector.
      buffer.requestAdditionalCapacity(stack.size)
      for (i in start until stack.size) {
        buffer.put(stack[i].storedPackedType(it))
      }
    }
  }

  private fun putMap(key: Int, start: Int, length: Int, keys: Value? = null): Value {
    return createAnyVector(key, start, length, T_MAP, keys) {
      // add types since we are not creating a typed vector.
      buffer.requestAdditionalCapacity(stack.size)
      for (i in start until stack.size) {
        buffer.put(stack[i].storedPackedType(it))
      }
    }
  }

  private inline fun createTypedVector(
    key: Int,
    start: Int,
    length: Int,
    keys: Value? = null,
  ): Value {
    // We assume the callers of this method guarantees all elements are of the same type.
    val elementType: FlexBufferType = stack[start].type
    for (i in start + 1 until length) {
      if (elementType != stack[i].type)
        error("TypedVector does not support array of different element types")
    }
    if (!elementType.isTypedVectorElementType())
      error("TypedVector does not support this element type")
    return createAnyVector(key, start, length, elementType.toTypedVector(), keys)
  }

  private inline fun createAnyVector(
    key: Int,
    start: Int,
    length: Int,
    type: FlexBufferType,
    keys: Value? = null,
    crossinline typeBlock: (BitWidth) -> Unit = {},
  ): Value {
    // Figure out the smallest bit width we can store this vector with.
    var bitWidth = W_8.max(length.toULong().widthInUBits())
    var prefixElems = 1
    if (keys != null) {
      // If this vector is part of a map, we will pre-fix an offset to the keys
      // to this vector.
      bitWidth = bitWidth.max(keys.elemWidth(buffer.writePosition, 0))
      prefixElems += 2
    }
    // Check bit widths and types for all elements.
    for (i in start until stack.size) {
      val elemWidth = stack[i].elemWidth(buffer.writePosition, i + prefixElems)
      bitWidth = bitWidth.max(elemWidth)
    }
    val byteWidth = align(bitWidth)
    // Write vector. First the keys width/offset if available, and size.
    if (keys != null) {
      writeOffset(keys.iValue.toInt(), byteWidth)
      writeInt(1 shl keys.minBitWidth.value, byteWidth)
    }
    // write the size
    writeInt(length, byteWidth)

    // Then the actual data.
    val vloc: Int = buffer.writePosition
    for (i in start until stack.size) {
      writeAny(stack[i], byteWidth)
    }

    // Optionally you can introduce the types for non-typed vector
    typeBlock(bitWidth)
    return Value(type, key, bitWidth, vloc.toULong())
  }

  // A lambda to sort map keys
  internal val keyComparator =
    object : Comparator<Value> {
      override fun compare(a: Value, b: Value): Int {
        var ia: Int = a.key
        var io: Int = b.key
        var c1: Byte
        var c2: Byte


 {
  overflow: hidden;
  position: relative;
  padding-bottom: 4px;
}

.sl-vue-tree-node-list {
  position: relative;
  display: flex;
  flex-direction: row;
}

.sl-vue-tree-node-item {
  position: relative;
  display: flex;
  flex-direction: row;
}
.sl-vue-tree-node-item.sl-vue-tree-cursor-inside {
  outline: 1px solid rgba(100, 100, 255, 0.5);
}

.sl-vue-tree-gap {
  width: 20px;
  min-height: 1px;
}

.sl-vue-tree-sidebar {
  margin-left: auto;
}

.sl-vue-tree-cursor {
  position: absolute;
  border: 1px solid rgba(100, 100, 255, 0.5);
  height: 1px;
  width: 100%;
}

.sl-vue-tree-drag-info {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0.5;
  margin-left: 20px;
  margin-bottom: 20px;
  padding: 5px 10px;
}
/*
 * @author: tvc12 - Thien Vi
 * @created: 5/4/21, 6:00 PM
 */

@import '~@/themes/scss/mixin.scss';
@import 'src/shared/components/charts/custom-table/DefaultTableStyle';

.custom-table {
  border-radius: 4px;
}

.infinite-table {
  //overflow: auto;
  border-radius: 4px;
  font-size: 13px;
  display: flex;
  flex: auto;
  align-items: flex-start;

  > .table-boundary {
    position: relative;

    .fake-scroll-area {
      position: absolute;
    }
  }

  @mixin cell() {
    min-width: var(--column-width);
    max-width: var(--max-column-width);

    padding-left: 12px;
    padding-right: 12px;
    text-overflow: ellipsis;
    overflow: hidden;

    font-weight: normal;
    font-stretch: normal;
    font-style: normal;
    line-height: normal;
    letter-spacing: 0.2px;
  }

  tbody tr {
    &.expanded td {
      font-weight: bold;
    }

    @mixin row-common-style() {
      font-size: var(--row-font-size, $default-row-font-size);
      font-family: var(--row-font-family, $default-row-font-family), sans-serif;
      white-space: var(--row-white-space, $default-row-white-space);
      text-align: $default-row-text-align;
      font-stretch: normal;
      font-style: normal;
      line-height: normal;
      letter-spacing: 0.23px;
    }

    &.even > * {
      background-color: var(--row-even-background-color, $default-row-even-background-color);
      color: var(--row-even-color, $default-row-even-color);
      @include row-common-style();
    }

    &.odd > * {
      background-color: var(--row-odd-background-color, $default-row-odd-background-color);
      color: var(--row-odd-color, $default-row-odd-color);
      @include row-common-style();
    }
    .text-align-right {
      text-align: right;
    }
  }

  /**
 style icon collapsed
 */

  td.expandable {
    display: flex;
    align-items: center;

    > div.collapse-icon {
      float: left;
      //background: var(--icon-background-color, #FFFFFF19);
      margin-right: 5px;

      text-align: center;
      font-size: 18px;
      line-height: 16px;
      font-weight: bold


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

// Generated by the Codegen C++ plugin.
// If you make any local changes, they will be lost.
// source: google/cloud/iap/v1/service.proto

#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_IDEMPOTENCY_POLICY_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_IDEMPOTENCY_POLICY_H

#include "google/cloud/iap/v1/identity_aware_proxy_o_auth_connection_idempotency_policy.h"

namespace google {
namespace cloud {
namespace iap {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use
/// iap_v1::MakeDefaultIdentityAwareProxyOAuthServiceConnectionIdempotencyPolicy
/// directly.
using ::google::cloud::iap_v1::
    MakeDefaultIdentityAwareProxyOAuthServiceConnectionIdempotencyPolicy;

/// @deprecated Use
/// iap_v1::IdentityAwareProxyOAuthServiceConnectionIdempotencyPolicy directly.
using ::google::cloud::iap_v1::
    IdentityAwareProxyOAuthServiceConnectionIdempotencyPolicy;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace iap
}  // namespace cloud
}  // namespace google

#endif  // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_IDEMPOTENCY_POLICY_H


ributes,
            AttributeType.ARTIST,
            artists,
            false,
            BADGE_CONST,
            Site.ASMHENTAI
        )
        parseAttributes(
            attributes,
            AttributeType.TAG,
            tags,
            false,
            BADGE_CONST,
            Site.ASMHENTAI
        )
        parseAttributes(
            attributes,
            AttributeType.SERIE,
            series,
            false,
            BADGE_CONST,
            Site.ASMHENTAI
        )
        parseAttributes(
            attributes,
            AttributeType.CHARACTER,
            characters,
            false,
            BADGE_CONST,
            Site.ASMHENTAI
        )
        parseAttributes(
            attributes,
            AttributeType.LANGUAGE,
            languages,
            false,
            BADGE_CONST,
            Site.ASMHENTAI
        )
        content.putAttributes(attributes)
        if (updateImages) {
            content.qtyPages = 0
            content.setImageFiles(emptyList())
        }
        return content
    }
}package me.devsaki.hentoid.parsers.content

import me.devsaki.hentoid.database.domains.Content
import me.devsaki.hentoid.enums.Site
import me.devsaki.hentoid.enums.StatusContent
import me.devsaki.hentoid.json.sources.ehentai.EHentaiGalleryQuery
import me.devsaki.hentoid.retrofit.sources.EHentaiServer
import timber.log.Timber
import java.io.IOException

class EhentaiContent : BaseContentParser() {
    override fun update(content: Content, url: String, updateImages: Boolean): Content {
        val galleryUrlParts = url.split("/")
        if (galleryUrlParts.size > 5) {
            val query = EHentaiGalleryQuery(galleryUrlParts[4], galleryUrlParts[5])
            try {
                val metadata =
                    EHentaiServer.ehentaiApi.getGalleryMetadata(query, null).execute().body()
                if (metadata != null) return metadata.update(
                    content,
                    Site.EHENTAI,
                    updateImages
                )
            } catch (e: IOException) {
                Timber.e(e, "Error parsing content.")
            }
        }
        return Content(site = Site.EXHENTAI, status = StatusContent.IGNORED)
    }
}package me.devsaki.hentoid.parsers.content

import androidx.core.net.toUri
import me.devsaki.hentoid.database.domains.Attribute
import me.devsaki.hentoid.database.domains.AttributeMap
import me.devsaki.hentoid.database.domains.Content
import me.devsaki.hentoid.database.domains.ImageFile
import me.devsaki.hentoid.enums.AttributeType
import me.devsaki.hentoid.enums.Site
import me.devsaki.hentoid.enums.StatusContent
import me.devsaki.hentoid.json.sources.deviantart.RELATIVE_URL_PREFIX
import me.devsaki.hentoid.parsers.cleanup
import me.devsaki.hentoid.parsers.getUserAgent
import me.devsaki.hentoid.parsers.images.DeviantArtParser
import me.devsaki.hentoid.parsers.parseAttributes
import me.devsaki.hentoid.retrofit.DeviantArtServer
import me.devsaki.hentoid.util.exception.ParseException
import me.devsaki.hentoid.util.network.getCookies
import me.devsaki.hentoid.util.parseDatetimeToEpoch
import org.jsoup.nodes.Element
import pl.droidsonroids.jspoon.annotation.Selector
import timber.log.Timber
import java.io.IOException

class DeviantArtContent : BaseContentParser() {
    @Selector(


st_strategy::Arbitrary)]
// TODO: generate all variants
enum BytesRepresentation {
    Bytes(bytes_representation::Bytes),
    #[weight(0)]
    Advanced(AdvancedDataLayoutName),
}

mod bytes_representation {
    use serde::{Deserialize, Serialize};

    #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, test_strategy::Arbitrary)]
    pub(crate) struct Bytes;
}

impl Default for BytesRepresentation {
    fn default() -> Self {
        Self::Bytes(bytes_representation::Bytes)
    }
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, test_strategy::Arbitrary)]
pub(crate) struct TypeInt;

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, test_strategy::Arbitrary)]
pub(crate) struct TypeFloat;

fn is_default<D: Default + PartialEq>(d: &D) -> bool {
    *d == D::default()
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
#[derive(test_strategy::Arbitrary)]
pub(crate) struct TypeMap {
    key_type: TypeName,

    value_type: TypeTerm,

    #[serde(default, skip_serializing_if = "is_default")]
    value_nullable: bool,

    #[serde(default, skip_serializing_if = "is_default")]
    representation: MapRepresentation,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(rename_all = "lowercase")]
#[derive(test_strategy::Arbitrary)]
// TODO: generate all variants
enum MapRepresentation {
    Map(map_representation::Map),
    StringPairs(map_representation::StringPairs),
    ListPairs(map_representation::ListPairs),
    #[weight(0)]
    Advanced(AdvancedDataLayoutName),
}

mod map_representation {
    use serde::{Deserialize, Serialize};

    #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, test_strategy::Arbitrary)]
    pub(crate) struct Map;

    #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
    #[serde(rename_all = "camelCase")]
    #[derive(test_strategy::Arbitrary)]
    pub(crate) struct StringPairs {
        #[strategy("[^\"]+")]
        pub(crate) inner_delim: String,

        #[strategy("[^\"]+")]
        pub(crate) entry_delim: String,
    }

    #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, test_strategy::Arbitrary)]
    pub(crate) struct ListPairs;
}

impl Default for MapRepresentation {
    fn default() -> Self {
        Self::Map(map_representation::Map)
    }
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
#[derive(test_strategy::Arbitrary)]
pub(crate) struct TypeList {
    value_type: TypeTerm,

    #[serde(default, skip_serializing_if = "is_default")]
    value_nullable: bool,

    #[serde(default, skip_serializing_if = "is_default")]
    representation: ListRepresentation,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, test_strategy::Arbitrary)]
enum ListRepresentation {
    List(list_representation::List),
    #[weight(0)]
    Advanced(AdvancedDataLayoutName),


        Operand dstAddr)
{
    if (value->isConstant()) {
        masm.memoryBarrier(access.barrierBefore());

        const MConstant* mir = value->toConstant();
        Imm32 cst = Imm32(mir->type() == MIRType::Int32 ? mir->toInt32() : mir->toInt64());

        size_t storeOffset = masm.size();
        switch (access.type()) {
          case Scalar::Int8:
          case Scalar::Uint8:
            masm.movb(cst, dstAddr);
            break;
          case Scalar::Int16:
          case Scalar::Uint16:
            masm.movw(cst, dstAddr);
            break;
          case Scalar::Int32:
          case Scalar::Uint32:
            masm.movl(cst, dstAddr);
            break;
          case Scalar::Int64:
          case Scalar::Float32:
          case Scalar::Float64:
          case Scalar::Uint8Clamped:
          case Scalar::BigInt64:
          case Scalar::BigUint64:
          case Scalar::MaxTypedArrayViewType:
            MOZ_CRASH("unexpected array type");
        }
        masm.append(access, storeOffset, masm.framePushed());

        masm.memoryBarrier(access.barrierAfter());
    } else {
        masm.wasmStore(access, ToAnyRegister(value), dstAddr);
    }
}

template <typename T>
void
CodeGeneratorX64::emitWasmLoad(T* ins)
{
    const MWasmLoad* mir = ins->mir();

    uint32_t offset = mir->access().offset();
    MOZ_ASSERT(offset < wasm::OffsetGuardLimit);

    const LAllocation* ptr = ins->ptr();
    Operand srcAddr = ptr->isBogus()
                      ? Operand(HeapReg, offset)
                      : Operand(HeapReg, ToRegister(ptr), TimesOne, offset);

    if (mir->type() == MIRType::Int64)
        masm.wasmLoadI64(mir->access(), srcAddr, ToOutRegister64(ins));
    else
        masm.wasmLoad(mir->access(), srcAddr, ToAnyRegister(ins->output()));
}

void
CodeGeneratorX64::visitWasmLoad(LWasmLoad* ins)
{
    emitWasmLoad(ins);
}

void
CodeGeneratorX64::visitWasmLoadI64(LWasmLoadI64* ins)
{
    emitWasmLoad(ins);
}

template <typename T>
void
CodeGeneratorX64::emitWasmStore(T* ins)
{
    const MWasmStore* mir = ins->mir();

    uint32_t offset = mir->access().offset();
    MOZ_ASSERT(offset < wasm::OffsetGuardLimit);

    const LAllocation* value = ins->getOperand(ins->ValueIndex);
    const LAllocation* ptr = ins->ptr();
    Operand dstAddr = ptr->isBogus()
                      ? Operand(HeapReg, offset)
                      : Operand(HeapReg, ToRegister(ptr), TimesOne, offset);

    wasmStore(mir->access(), value, dstAddr);
}

void
CodeGeneratorX64::visitWasmStore(LWasmStore* ins)
{
    emitWasmStore(ins);
}

void
CodeGeneratorX64::visitWasmStoreI64(LWasmStoreI64* ins)
{
    emitWasmStore(ins);
}

void
CodeGeneratorX64::visitAsmJSLoadHeap(LAsmJSLoadHeap* ins)
{
    const MAsmJSLoadHeap* mir = ins->mir();
    MOZ_ASSERT(mir->offset() < wasm::OffsetGuardLimit);

    const LAllocation


idden by another breakpoint.	\n
\n
\n           flex-offset-xs	\n           width < 600px	\n
\n
\n           flex-offset-gt-xs	\n           width >= 600px	\n
\n
\n           flex-offset-sm	\n           600px <= width < 960px	\n
\n
\n           flex-offset-gt-sm	\n           width >= 960px	\n
\n
\n           flex-offset-md	\n           960px <= width < 1280px	\n
\n
\n           flex-offset-gt-md	\n           width >= 1280px	\n
\n
\n           flex-offset-lg	\n           1280px <= width < 1920px	\n
\n
\n           flex-offset-gt-lg	\n           width >= 1920px	\n
\n
\n           flex-offset-xl	\n           width >= 1920px	\n
\n
\n\n\n
\n')}]),angular.module("docsApp").run(["$templateCache",function(e){e.put("partials/layout-container.tmpl.html",'
\n\n
Layout and Containers
\n\n
\n    Use the layout directive on a container element to specify the layout direction for its children:\n    horizontally in a row (layout="row") or vertically in a column (layout="column").\n    Note that row is the default layout direction if you specify the layout directive without a value.\n
\n\n
\n
\n      row	\n      Items arranged horizontally. max-height = 100% and max-width  is the width of the items in the container.	\n
\n
\n      column	\n      Items arranged vertically. max-width = 100%  and max-height is the height of the items in the container.	\n
\n
\n\n
\n\n  <docs-demo demo-title="Layout Directive" class="small-demo colorNested">\n    <demo-file name="index.html">\n
\n
First item in row
\n
Second item in row
\n
\n
\n
First item in column
\n
Second item in column
\n
\n    </demo-file>\n  </docs-demo>\n\n
\n      Note that layout only affects the flow direction for that container\'s im


17.7 0 32-14.3 32-32V256c0-17.7-14.3-32-32-32zm-40 568H136V296h120v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56h148v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56h148v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56h120v496z",fill:a}}]}},name:"contacts",theme:"twotone"};t.default=e},99962:function(v,t){Object.defineProperty(t,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v529c0-.6.4-1 1-1h219.3l5.2 24.7C397.6 708.5 450.8 752 512 752s114.4-43.5 126.4-103.3l5.2-24.7H863c.6 0 1 .4 1 1V96c0-17.7-14.3-32-32-32zM712 493c0 4.4-3.6 8-8 8H320c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h384c4.4 0 8 3.6 8 8v48zm0-160c0 4.4-3.6 8-8 8H320c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h384c4.4 0 8 3.6 8 8v48zm151 354H694.1c-11.6 32.8-32 62.3-59.1 84.7-34.5 28.6-78.2 44.3-123 44.3s-88.5-15.8-123-44.3a194.02 194.02 0 01-59.1-84.7H161c-.6 0-1-.4-1-1v242c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V686c0 .6-.4 1-1 1z"}}]},name:"container",theme:"filled"};t.default=e},77485:function(v,t){Object.defineProperty(t,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-40 824H232V687h97.9c11.6 32.8 32 62.3 59.1 84.7 34.5 28.5 78.2 44.3 123 44.3s88.5-15.7 123-44.3c27.1-22.4 47.5-51.9 59.1-84.7H792v-63H643.6l-5.2 24.7C626.4 708.5 573.2 752 512 752s-114.4-43.5-126.5-103.3l-5.2-24.7H232V136h560v752zM320 341h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8v48c0


heme-base16-zenburn-min .hljs-attribute,
.theme-base16-zenburn-min .hljs-function .hljs-title,
.theme-base16-zenburn-min .hljs-section,
.theme-base16-zenburn-min .hljs-title.function_,
.theme-base16-zenburn-min .ruby .hljs-property {
	color: #7cb8bb;
}
.theme-base16-zenburn-min .diff .hljs-meta,
.theme-base16-zenburn-min .hljs-keyword,
.theme-base16-zenburn-min .hljs-template-tag,
.theme-base16-zenburn-min .hljs-type {
	color: #dc8cc3;
}
.theme-base16-zenburn-min .hljs-emphasis {
	color: #dc8cc3;
	font-style: italic;
}
.theme-base16-zenburn-min .hljs-meta,
.theme-base16-zenburn-min .hljs-meta .hljs-keyword,
.theme-base16-zenburn-min .hljs-meta .hljs-string {
	color: #000;
}
.theme-base16-zenburn-min .hljs-meta .hljs-keyword,
.theme-base16-zenburn-min .hljs-meta-keyword {
	font-weight: 700;
}
.theme-brown-paper pre code.hljs {
	display: block;
	overflow-x: auto;
	padding: 1em;
}
.theme-brown-paper code.hljs {
	padding: 3px 5px;
}
.theme-brown-paper .hljs {
	color: #363c69;
	background: #b7a68e url(./brown-papersq.png);
}
.theme-brown-paper .hljs-keyword,
.theme-brown-paper .hljs-selector-tag,
.theme-brown-paper .hljs-literal {
	color: #059;
	font-weight: bold;
}
.theme-brown-paper .hljs-string,
.theme-brown-paper .hljs-title,
.theme-brown-paper .hljs-section,
.theme-brown-paper .hljs-type,
.theme-brown-paper .hljs-attribute,
.theme-brown-paper .hljs-symbol,
.theme-brown-paper .hljs-bullet,
.theme-brown-paper .hljs-built_in,
.theme-brown-paper .hljs-addition,
.theme-brown-paper .hljs-variable,
.theme-brown-paper .hljs-template-tag,
.theme-brown-paper .hljs-template-variable,
.theme-brown-paper .hljs-link,
.theme-brown-paper .hljs-name {
	color: #2c009f;
}
.theme-brown-paper .hljs-comment,
.theme-brown-paper .hljs-quote,
.theme-brown-paper .hljs-meta,
.theme-brown-paper .hljs-deletion {
	color: #802022;
}
.theme-brown-paper .hljs-keyword,
.theme-brown-paper .hljs-selector-tag,
.theme-brown-paper .hljs-literal,
.theme-brown-paper .hljs-doctag,
.theme-brown-paper .hljs-title,
.theme-brown-paper .hljs-section,
.theme-brown-paper .hljs-type,
.theme-brown-paper .hljs-name,
.theme-brown-paper .hljs-strong {
	font-weight: bold;
}
.theme-brown-paper .hljs-emphasis {
	font-style: italic;
}
.theme-brown-paper-min pre code.hljs {
	display: block;
	overflow-x: auto;
	padding: 1em;
}
.theme-brown-paper-min code.hljs {
	padding: 3px 5px;
}
.theme-brown-paper-min .hljs {
	color: #363c69;
	background: url(./brown-papersq.


 pubkey::Pubkey},
};

#[derive(Deserialize, Debug)]
struct JsonRaydiumFarm {
    name: String,
    lp: String,
    reward: String,
    #[serde(rename = "rewardB", default)]
    reward_b: String,
    #[serde(rename = "isStake")]
    is_stake: bool,
    fusion: bool,
    legacy: bool,
    dual: bool,
    version: u8,
    #[serde(rename = "programId")]
    program_id: String,
    #[serde(rename = "poolId", deserialize_with = "pubkey_deserialize")]
    farm_id: Pubkey,
    #[serde(rename = "poolAuthority", deserialize_with = "pubkey_deserialize")]
    farm_authority: Pubkey,
    #[serde(rename = "poolLpTokenAccount", deserialize_with = "pubkey_deserialize")]
    farm_lp_token_account: Pubkey,
    #[serde(
        rename = "poolRewardTokenAccount",
        deserialize_with = "pubkey_deserialize"
    )]
    farm_reward_token_account: Pubkey,
    #[serde(
        rename = "poolRewardTokenAccountB",
        deserialize_with = "optional_pubkey_deserialize",
        default
    )]
    farm_reward_token_account_b: Option<Pubkey>,
}

#[derive(Deserialize, Debug)]
struct JsonSaberFarm {
    name: String,
    tokens: Vec<GitToken>,
    #[serde(rename = "lpToken")]
    lp_token: GitToken,
    #[serde(deserialize_with = "pubkey_deserialize")]
    quarry: Pubkey,
}

#[derive(Deserialize, Debug)]
pub struct JsonOrcaFarm {
    pub name: String,
    #[serde(deserialize_with = "pubkey_deserialize")]
    pub address: Pubkey,
    #[serde(rename = "farmTokenMint", deserialize_with = "pubkey_deserialize")]
    pub farm_token_mint: Pubkey,
    #[serde(rename = "rewardTokenMint", deserialize_with = "pubkey_deserialize")]
    pub reward_token_mint: Pubkey,
    #[serde(rename = "rewardTokenDecimals")]
    pub reward_token_decimals: u8,
    #[serde(rename = "baseTokenMint", deserialize_with = "pubkey_deserialize")]
    pub base_token_mint: Pubkey,
    #[serde(rename = "baseTokenDecimals")]
    pub base_token_decimals: u8,
}

pub fn load(client: &FarmClient, config: &Config, data: &str, remove_mode: bool) {
    let parsed: Value = serde_json::from_str(data).unwrap();
    let last_index = client
        .get_refdb_last_index(&StorageType::Farm.to_string())
        .expect("Farm RefDB query error");

    if parsed["name"] == "Raydium Farms" {
        load_raydium_farm(client, config, remove_mode, &parsed, last_index);
    } else if parsed["name"] == "Orca Farms" {
        load_orca_farm(client, config, remove_mode, &parsed, last_index);
    } else if parsed["pools"] != json!(null) && parsed["addresses"] != json!(null) {
        load_saber_farm(client, config, remove_mode, &parsed, last_index);
    } else {
        panic!("Unsupported farms file");
    }
}

fn load_raydium_farm(
    client: &FarmClient,
    config: &Config,
    remove_mode: bool,
    parsed: &Value,
    last_index: u32,
) {
    let mut last_index = last_index;
    let router_id = client.get_program_id(&"RaydiumRouter


 fe, quadrature, cell_flags, face_quadrature, face_flags);
    CopyData cd;
    MeshWorker::mesh_loop(dof_handler.begin_active(),
                          dof_handler.end(),
                          cell_worker,
                          copier,
                          scratch_data,
                          cd,
                          MeshWorker::assemble_own_cells |
                            MeshWorker::assemble_boundary_faces |
                            MeshWorker::assemble_own_interior_faces_once,
                          boundary_worker,
                          face_worker);

    return solve_and_postprocess(system_matrix, solution, system_rhs);
  };

  mb_algo();
  mf_algo();
}

int
main(int argc, char **argv)
{
  initlog();

  deallog.depth_file(1);

  Utilities::MPI::MPI_InitFinalize mpi(argc, argv, 1);

  test<2>(/*degree=*/1);
  test<2>(/*degree=*/2);
  test<3>(/*degree=*/1);
  test<3>(/*degree=*/2);
}
// ------------------------------------------------------------------------
//
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (C) 2020 - 2024 by the deal.II authors
//
// This file is part of the deal.II library.
//
// Part of the source code is dual licensed under Apache-2.0 WITH
// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
// governing the source code and code contributions can be found in
// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
//
// ------------------------------------------------------------------------

// Test QGaussSimplex: output its quadrature points and weights.

#include <deal.II/base/quadrature_lib.h>

#include "../tests.h"

template <int dim>
void
test(const unsigned int n_points)
{
  QGaussSimplex<dim> quad(n_points);

  for (unsigned int q = 0; q < quad.size(); ++q)
    {
      deallog << quad.point(q) << ' ';
      deallog << quad.weight(q) << ' ';
      deallog << std::endl;
    }
}

int
main()
{
  initlog();

  {
    deallog.push("1d-1");
    test<1>(1 /*n_points*/);
    deallog.pop();
  }
  {
    deallog.push("1d-2");
    test<1>(2);
    deallog.pop();
  }
  {
    deallog.push("1d-3");
    test<1>(3);
    deallog.pop();
  }
  {
    deallog.push("2d-1");
    test<2>(1);
    deallog.pop();
  }
  {
    deallog.push("2d-3");
    test<2>(2);
    deallog.pop();
  }
  {
    deallog.push("2d-7");
    test<2>(3);
    deallog.pop();
  }

  {
    deallog.push("3d-1");
    test<3>(1);
    deallog.pop();
  }
  {
    deallog.push("3d-4");
    test<3>(2);
    deallog.pop();
  }
  {
    deallog.push("3d-10");
    test<3>(3);
    deallog.pop();
  }
}
/* ------------------------------------------------------------------------
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 * Copyright (C) 2020 - 2024 by the deal.II authors
 *
 * This file is part of the deal.II library.
 *
 * Part of the source code is dual licensed under Apache-2.0 WITH
 * LLVM-exception OR LGPL-2.1-or-later. Detailed license in


qe button:hover svg,.gb_Ud button:hover svg,.gb_d:hover{background-color:rgba(60,64,67,.08)}.gb_ya .gb_d.gb_Aa:hover{background-color:transparent}.gb_d[aria-expanded=true],.gb_d:hover[aria-expanded=true]{background-color:rgba(95,99,104,.24)}.gb_d[aria-expanded=true] .gb_i{fill:#5f6368;opacity:1}.gb_Jc .gb_Ud button:hover svg,.gb_Jc .gb_d:hover{background-color:rgba(232,234,237,.08)}.gb_Jc .gb_Ud button:focus svg,.gb_Jc .gb_Ud button:focus:hover svg,.gb_Jc .gb_d:focus,.gb_Jc .gb_d:focus:hover{background-color:rgba(232,234,237,.1)}.gb_Jc .gb_Ud button:active svg,.gb_Jc .gb_d:active{background-color:rgba(232,234,237,.12)}.gb_Jc .gb_d[aria-expanded=true],.gb_Jc .gb_d:hover[aria-expanded=true]{background-color:rgba(255,255,255,.12)}.gb_Jc .gb_d[aria-expanded=true] .gb_i{fill:#fff;opacity:1}.gb_v{padding:4px}.gb_Ka.gb_Od .gb_v{padding:4px 2px}.gb_Ka.gb_Od .gb_b.gb_v{padding-left:6px}.gb_0{z-index:991;line-height:normal}.gb_0.gb_Vd{left:0;right:auto}@media (max-width:350px){.gb_0.gb_Vd{left:0}}.gb_Wd .gb_0{top:56px}.gb_l .gb_d,.gb_Z .gb_l .gb_d{background-position:-64px -29px}.gb_E .gb_l .gb_d{background-position:-29px -29px;opacity:1}.gb_l .gb_d,.gb_l .gb_d:hover,.gb_l .gb_d:focus{opacity:1}.gb_ed{display:none}@media screen and (max-width:319px){.gb_ld:not(.gb_qd) .gb_l{display:none;visibility:hidden}}.gb_o{display:none}.gb_8c{font-family:Google Sans,Roboto,Helvetica,Arial,sans-serif;font-size:20px;font-weight:400;letter-spacing:0.25px;line-height:48px;margin-bottom:2px;opacity:1;overflow:hidden;padding-left:16px;position:relative;text-overflow:ellipsis;vertical-align:middle;top:2px;white-space:nowrap;-webkit-flex:1 1 auto;-webkit-box-flex:1;flex:1 1 auto}.gb_8c.gb_9c{color:#3c4043}.gb_Ka.gb_La .gb_8c{margin-bottom:0}.gb_ad.gb_bd .gb_8c{padding-left:4px}.gb_Ka.gb_La .gb_cd{position:relative;top:-2px}.gb_Ka{color:black;min-width:160px;position:relative;-webkit-transition:box-shadow 250ms;transition:box-shadow 250ms}.gb_Ka.gb_Rc{min-width:120px}.gb_Ka.gb_jd .gb_kd{display:none}.gb_Ka.gb_jd .gb_ld{height:56px}header.gb_Ka{display:block}.gb_Ka svg{fill:currentColor}.gb_md{position:fixed;top:0;width:100%}.gb_nd{-webkit-box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.


/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

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

#include <fluent-bit/flb_input_plugin.h>
#include <fluent-bit/flb_config.h>
#include <fluent-bit/flb_config_map.h>
#include <fluent-bit/flb_error.h>
#include <fluent-bit/flb_pack.h>

#include "we.h"
#include "we_cs.h"
#include "we_util.h"
#include "we_metric.h"

int we_cs_init(struct flb_we *ctx)
{
    ctx->cs.operational = FLB_FALSE;

    struct cmt_gauge *g;

    g = cmt_gauge_create(ctx->cmt, "windows", "cs", "logical_processors",
                         "Number of logical processors",
                         0, NULL);

    if (!g) {
        return -1;
    }
    ctx->cs.logical_processors = g;

    g = cmt_gauge_create(ctx->cmt, "windows", "cs", "physical_memory_bytes",
                         "Amount of bytes of physical memory",
                         0, NULL);

    if (!g) {
        return -1;
    }
    ctx->cs.physical_memory_bytes = g;

    g = cmt_gauge_create(ctx->cmt, "windows", "cs", "hostname",
                         "Value of Local Time",
                         3, (char *[]) {"hostname", "domain", "fqdn"});
    if (!g) {
        return -1;
    }
    ctx->cs.hostname = g;

    ctx->cs.operational = FLB_TRUE;

    return 0;
}

int we_cs_exit(struct flb_we *ctx)
{
    return 0;
}

int we_cs_update(struct flb_we *ctx)
{
    SYSTEM_INFO system_info;
    MEMORYSTATUSEX statex;
    char hostname[256] = "", domain[256] = "", fqdn[256] = "";
    DWORD size = 0;
    uint64_t timestamp = 0;

    if (!ctx->cs.operational) {
        flb_plg_error(ctx->ins, "cs collector not yet in operational state");

        return -1;
    }

    timestamp = cfl_time_now();

    statex.dwLength = sizeof (statex);
    GlobalMemoryStatusEx(&statex);

    GetSystemInfo(&system_info);

    size = _countof(hostname);
    if (!GetComputerNameExA(ComputerNameDnsHostname, hostname, &size)) {
        flb_plg_warn(ctx->ins, "Failed to retrieve hostname info");
    }
    size = _countof(domain);
    if (!GetComputerNameExA(ComputerNameDnsDomain, domain, &size)) {
        flb_plg_warn(ctx->ins, "Failed to retrieve domain info");
    }
    size = _countof(fqdn);
    if (!GetComputerNameExA(ComputerNameDnsFullyQualified, fqdn, &size)) {
        flb_plg_warn(ctx->ins, "Failed to retrieve fqdn info");
    }

    cmt_gauge_set(ctx->cs.logical_processors, timestamp, (double)system_info.dwNumberOfProcessors, 0, NULL);
    cmt_gauge_set(ctx->cs.physical_memory_bytes, timestamp, (double)statex.ullTotalPhys, 0, NULL);
    cmt_gauge_set(ctx->cs.hostname, timestamp, 1.0, 3, (char *[]) { hostname, domain, fqdn });

    return 0;
}


_n_4_vs_lib4

//                            1      2              3          4        5          6             7         8          9
// void kernel_dgemv_t_4_lib4(int k, double *alpha, int offA, double *A, int sda, double *x, double *beta, double *y, double *z);

	.align 16
	.globl kernel_dgemv_t_4_lib4
	.type kernel_dgemv_t_4_lib4, @function
kernel_dgemv_t_4_lib4:

	PROLOGUE

	// zero accumulation registers

	xorpd	%xmm0, %xmm0
	movapd	%xmm0, %xmm1
	movapd	%xmm0, %xmm2
	movapd	%xmm0, %xmm3

	// call inner dgemv kernel n

	movl	ARG1, %eax // k
	movl	ARG4, %ebx  // A
	movl	ARG5, %ecx // sda
	sall	$ 5, %ecx // 4*sda*sizeof(double)
	movl	ARG6, %edx  // x
	movl	ARG3, %esi  // offA

#if MACRO_LEVEL>=2
	INNER_EDGE_GEMV_ADD_T_4_LIB4
#else
	CALL(inner_edge_gemv_add_t_4_lib4)
#endif

#if MACRO_LEVEL>=2
	INNER_KERNEL_GEMV_ADD_T_4_LIB4
#else
	call inner_kernel_gemv_add_t_4_lib4
#endif

	// call inner blender t

	movl	ARG2, %eax // alpha
	movl	ARG7, %ebx   // beta
	movl	ARG8, %ecx // y

#if MACRO_LEVEL>=1
	INNER_BLEND_T_SCALE_AB_4_LIB4
#else
	call inner_blend_t_scale_ab_4_lib4
#endif

	// store

	movl	ARG9, %eax // z

#if MACRO_LEVEL>=1
	INNER_STORE_4_LIB4
#else
	call inner_store_4_lib4
#endif

	EPILOGUE

	ret

	.size	kernel_dgemv_t_4_lib4, .-kernel_dgemv_t_4_lib4

//                               1      2              3          4        5          6             7         8           9         10
// void kernel_dgemv_t_4_vs_lib4(int k, double *alpha, int offA, double *A, int sda, double *x, double *beta, double *y, double *z, int k1);

	.align 16
	.globl kernel_dgemv_t_4_vs_lib4
	.type kernel_dgemv_t_4_vs_lib4, @function
kernel_dgemv_t_4_vs_lib4:

	PROLOGUE

	// zero accumulation registers

	xorpd	%xmm0, %xmm0
	movapd	%xmm0, %xmm1
	movapd	%xmm0, %xmm2
	movapd	%xmm0, %xmm3

	// call inner dgemv kernel n

	movl	ARG1, %eax // k
	movl	ARG4, %ebx  // A
	movl	ARG5, %ecx // sda
	sall	$ 5, %ecx // 4*sda*sizeof(double)
	movl	ARG6, %edx  // x
	movl	ARG3, %esi  // offA

#if MACRO_LEVEL>=2
	INNER_EDGE_GEMV_ADD_T_4_LIB4
#else
	CALL(inner_edge_gemv_add_t_4_lib4)
#endif

#if MACRO_LEVEL>=2
	INNER_KERNEL_GEMV_ADD_T_4_LIB4
#else
	call inner_kernel_gemv_add


ow:none;padding:0}.bp5-input-ghost::-moz-placeholder{color:#5f6b7c;opacity:1}.bp5-input-ghost::placeholder{color:#5f6b7c;opacity:1}.bp5-input-ghost:focus{outline:none!important}.bp5-resizable-input-span{max-height:0;max-width:100%;min-width:80px;opacity:0;overflow:hidden;position:absolute;white-space:nowrap;z-index:-1}.bp5-toast{align-items:flex-start;background-color:#fff;border-radius:2px;box-shadow:inset 0 0 0 1px #11141833,0 2px 4px #11141833,0 8px 24px #11141833;display:flex;margin:20px 0 0;max-width:500px;min-width:300px;pointer-events:all;position:relative!important}.bp5-toast.bp5-toast-enter,.bp5-toast.bp5-toast-appear{transform:translateY(-40px)}.bp5-toast.bp5-toast-enter-active,.bp5-toast.bp5-toast-appear-active{transform:translateY(0);transition-delay:0;transition-duration:.3s;transition-property:transform;transition-timing-function:cubic-bezier(.54,1.12,.38,1.11)}.bp5-toast.bp5-toast-enter~.bp5-toast,.bp5-toast.bp5-toast-appear~.bp5-toast{transform:translateY(-40px)}.bp5-toast.bp5-toast-enter-active~.bp5-toast,.bp5-toast.bp5-toast-appear-active~.bp5-toast{transform:translateY(0);transition-delay:0;transition-duration:.3s;transition-property:transform;transition-timing-function:cubic-bezier(.54,1.12,.38,1.11)}.bp5-toast.bp5-toast-exit{opacity:1;filter:blur(0)}.bp5-toast.bp5-toast-exit-active{opacity:0;filter:blur(10px);transition-delay:0;transition-duration:.3s;transition-property:opacity,filter;transition-timing-function:cubic-bezier(.4,1,.75,.9)}.bp5-toast.bp5-toast-exit~.bp5-toast{transform:translateY(0)}.bp5-toast.bp5-toast-exit-active~.bp5-toast{transform:translateY(-40px);transition-delay:50ms;transition-duration:.1s;transition-property:transform;transition-timing-function:cubic-bezier(.4,1,.75,.9)}.bp5-toast .bp5-button-group{flex:0 0 auto;padding:5px 5px 5px 0}.bp5-toast>.bp5-icon{color:#5f6b7c;margin:12px 0 12px 12px}.bp5-toast.bp5-dark,.bp5-dark .bp5-toast{background-color:#404854;box-shadow:inset 0 0 0 1px #fff3,0 2px 4px #11141866,0 8px 24px #11141866}.bp5-toast.bp5-dark>.bp5-icon,.bp5-dark .bp5-toast>.bp5-icon{color:#abb3bf}.bp5-toast.bp5-dark .bp5-button .bp5-icon,.bp5-dark .bp5-toast .bp5-button .bp5-icon,.bp5-toast[class*=bp5-intent-] a{color:#ffffffb3}.bp5-toast[class*=bp5-intent-] a:hover{color


.6DLlOTYMqGV5yPAJoz5k_moKDBgEmZ3_HLLQ2zKDo74 of type ViewModuleImportResource. -->
		<script type="module">import * as m0 from "/_dotvvm/resource-myModule/myModule";dotvvm.viewModules.registerMany({"myModule": m0});</script>

		<!-- Resource viewModule.init.6DLlOTYMqGV5yPAJoz5k_moKDBgEmZ3_HLLQ2zKDo74 of type ViewModuleInitResource. -->
		<script type="module">dotvvm.events.init.subscribeOnce(() => {
    dotvvm.viewModules.init("myModule", "p0", document.body);
})</script>
	</head>
	<body>
		<input id="__dot_viewmodel_root" type="hidden" value="{
  "viewModel": {
    "$type": "4n/9KyUdRKOKC0n3",
    "$csrfToken": "Not a CSRF token."
  },
  "url": "/testpage",
  "virtualDirectory": "",
  "renderedResources": [
    "knockout",
    "dotvvm.internal",
    "dotvvm",
    "dotvvm.debug",
    "viewModule.import.6DLlOTYMqGV5yPAJoz5k_moKDBgEmZ3_HLLQ2zKDo74",
    "viewModule.init.6DLlOTYMqGV5yPAJoz5k_moKDBgEmZ3_HLLQ2zKDo74"
  ],
  "typeMetadata": {
    "4n/9KyUdRKOKC0n3": {"type":"object","debugName":"object","properties":{}}
  }
}">
		<script type="module">dotvvm.options.compressPOST=false;
window.dotvvm.init("en-US");</script>
	</body>
</html>
<!DOCTYPE html>
<html lang="en">
  <head>
    <base href="/">
    <meta charset="utf-8" />
    <meta
    http-equiv="Cache-Control"
    content="no-cache, no-store, must-revalidate, max-age=0"
  />
  <meta http-equiv="Pragma" content="no-cache" />
  <meta http-equiv="Expires" content="0" />
  <!-- The first thing in any HTML file should be the charset -->
  <meta charset="utf-8" />
  <!-- Make the page mobile compatible -->
  <meta name="viewport" content="width=device-width, initial-scale=1" />

  <!-- Allow installing the app to the homescreen -->
  <meta name="mobile-web-app-capable" content="yes" />

  <!-- Allow installing the app to the homescreen -->
  <meta name="mobile-web-app-capable" content="yes" />
  <title>
    RigelProtocol - Dapps for all your Defi Needs
  </title>
  <meta
    name="keywords"
    content="RigelProtocol, Rigel, Smart Swap, Limit, Set price, Auto invest, AutoTrade, Apply for Farms, Staking, , DEFI, Yield Farm, Secure Swap, High yield Farm"
  />
  <meta
    name="description"
    content="Rigel Protocol is the blockchain Decentralized protocol for all your Defi Needs.
    Several DeFi products featured are  smartswap operations, automated dexes trading, Liquidity mining, Launchpad & Product Token offering services, Influencers & New projects rewarding systems and other innovative features. Available on Binance Smart Chain, Polygon and Oasis "
  />

  <meta name="msapplication-TileColor" content="#da532c" />
  <meta name="theme-color" content="#ffffff" />

  <!-- Open Graph / Facebook -->
  <meta property="og:type" content="website" />
  <meta property="og:url" content="https://smartswap.rige


"""
Write a function to find area of a sector. The function takes the radius and angle as inputs. Function should return None if the angle is larger than 360 degrees.
assert sector_area(4,45)==6.283185307179586
"""

def sector_area(r, angle):
    if angle > 360:
        return None
    else:
        return (r**2)*(angle/360)