var account = new Account("camera_ip", "camera_username", "camera_password");
var camera = Camera.Create(account, ex =>
{
    // exception
});

if (camera != null)
{
    //move...
    var vector1 = new PTZVector { PanTilt = new Vector2D { x = 0.5f } };
    var speed1 = new PTZSpeed { PanTilt = new Vector2D { x = 1f, y = 1f } };
    await camera.MoveAsync(MoveType.Absolute, vector1, speed1, 0);

    //zoom...
    var vector2 = new PTZVector { Zoom = new Vector1D { x = 1f } };
    var speed2 = new PTZSpeed { Zoom = new Vector1D { x = 1f } };
    await camera.MoveAsync(MoveType.Absolute, vector2, speed2, 0);

    //focus...
    //var focusMove = new FocusMove { Absolute=new AbsoluteFocus {   } };
    //await camera.FocusAsync(focusMove);
}

```
# cloudflare-ai-web

![readme.png](https://github.com/user-attachments/assets/e1c4e604-568d-4778-8780-29473619744f)

## 部署

### Vercel

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FJazee6%2Fcloudflare-ai-web&demo-title=Cloudflare%20AI%20Web&demo-url=https%3A%2F%2Fai.jaze.top)

示例：https://ai.jaze.top

### Docker

```bash
docker run -d --name cloudflare-ai-web \
  -e CF_ACCOUNT_ID=YOUR_CF_ACCOUNT_ID \
  -e CF_WORKERS_AI_TOKEN=YOUR_CF_WORKERS_AI_TOKEN \
  -p 3000:3000 \
  --restart=always \
  jazee6/cloudflare-ai-web
```

## 特性

- 使用 Cloudflare Workers AI 快速搭建多模型AI平台
- 支持 Serverless 快速部署
- 聊天记录本地存储
- 支持设置访问密码

## 部署说明

### 环境变量列表

| 名称                  | 描述                          |
|---------------------|-----------------------------|
| CF_ACCOUNT_ID       | Cloudflare 账户ID             |
| CF_WORKERS_AI_TOKEN | Cloudflare Workers AI Token |
| APP_PASSWORD        | 访问密码                        |

示例： 查看`.env.example`文件

#### CF_WORKERS_AI_TOKEN

- 管理账户 - 账户API令牌 - 创建令牌 - 使用Workers AI模板创建
# vite-react-mcp

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]

A Vite plugin that creates an MCP server to help LLMs understand your React App context

## Features

- `highlight-component`
  - description: Highlight React component based on the component name.
  - params:
    - `componentName`: string

  ![highlight-component](./playground/demo/demo_highlight_component.gif)

- `get-component-states`
  - description: Get the React component props, states, and contexts in JSON structure format.
  - params:
    - `componentName`: string

  ![get-component-states](./playground/demo/demo_get_states.gif)

- `get-component-tree`
  - description: Get the React component tree of the current page in ASCII format.
  - params:
    - `allComponent`: boolean, if truthy, return a tree for all components instead of your self-defined components only.

  ![get-component-tree](./playground/demo/demo_get_component_tree.gif)

- `get-unnecessary-rerenders`
  - description: Get the wasted re-rendered components of the current page.
  - params:
    - `timeframe`: number, if present, only get unnecessar


def build_hooks(cfg):
    return [HOOKS[hook](cfg) for hook in cfg.HOOKS]


 #item for #name {
                    fn key(&self) -> #attribute_map {
                        let mut keys = ::std::collections::HashMap::new();
                        #partition_key_insert
                        #sort_key_insert
                        keys
                    }
                }
            }
        })
        .unwrap_or(quote! {}))
}

/// Find a single `Field` from `fields` that has an attribute of the form
/// `#[dynomite(attribute_name)]`.
///
/// # Panics
/// - if there are multiple fields, in `fields`, with an attribute of the form
///   `#[dynomite(attribute_name)]`
fn field_with_attribute(
    fields: &[Field],
    attribute_name: &str,
) -> Option<Field> {
    let mut fields = fields.iter().cloned().filter(|field| {
        field.attrs.iter().any(|attr| match attr.parse_meta() {
            Ok(Meta::List(syn::MetaList { path, nested, .. })) => {
                if path.segments.len() > 1 {
                    return false;
                }

                if path.segments[0].ident != "dynomite" {
                    return false;
                }

                match nested.first() {
                    Some(syn::NestedMeta::Meta(syn::Meta::Path(path))) => {
                        if path.segments.len() > 1 {
                            return false;
                        }

                        path.segments[0].ident == attribute_name
                    }
                    _ => false,
                }
            }
            _ => false,
        })
    });
    let field = fields.next();
    if fields.next().is_some() {
        panic!("Can't set more than one `{}`", attribute_name);
    }
    field
}

/// ```rust,ignore
/// keys.insert(
///   "field_deser_name", to_attribute_value(field)
/// );
/// ```
fn get_key_inserter(field: &Field) -> syn::Result<impl ToTokens> {
    let to_attribute_value = quote!(::dynomite::Attribute::into_attr);
    let field_deser_name = &get_field_deser_name(field)?;
    let field_ident = &field.ident;
    Ok(quote! {
        keys.insert(
            #field_deser_name.to_string(),
            #to_attribute_value(self.#field_ident.clone())
        );
    })
}

/// ```rust,ignore
/// #[derive(Item, Debug, Clone, PartialEq)]
/// pub struct NameKey {
///    partition_key_field,
///    range_key
/// }
/// ```
fn get_key_struct(
    vis: &Visibility,
    name: &Ident,
    fields: &[Field],
) -> syn::Result<impl ToTokens> {
    let name = Ident::new(&format!("{}Key", name), Span::call_site());

    let partition_key_field = field_with_attribute(&fields, "partition_key")
        .map(|mut field| {
            // rename the field to the de/ser name
            if let Err(e) = rename_field_to_deser_name(&mut field) {
                return Err(e);
            }

            // remove attributes (because key structs don't need attrs) but
            // _after_ renaming the field so `get_field_deser_name` still works
            field.attrs = vec![];

            Ok(quote! {
                #field
            })
        })
        .transpose()?;

    let sort_key_field = field_with_attribute(&fields, "sort_key")
        .map(|mut field| {
            // rename the field to the de/ser


Reserved0;
    DWORD dwReserved1;
    char cFileName[260];
    char cAlternateFileName[14];
} WIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;

HANDLE __stdcall FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData);
BOOL __stdcall FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData);
BOOL __stdcall FindClose(HANDLE hFindFile);
]])

--
-- connect non-automatic libraries
--

local SHFileOperationA = ffi.load("Shell32").SHFileOperationA
local SHCreateDirectoryExA = ffi.load("Shell32").SHCreateDirectoryExA  -- deprecated api?
local PathCanonicalizeA = ffi.load("shlwapi.dll").PathCanonicalizeA

--------------------------
--------------------------

local function CheckForWinError(err, acceptable_errors)
   acceptable_errors = acceptable_errors or {}

   for i,v in ipairs(acceptable_errors) do
      acceptable_errors[tostring(v)] = true
   end

   if err ~= 0 and not acceptable_errors[tostring(err)] then
      print("")

      local str = ffi_charstr(1024, 0)
      local errlen = ffi.C.FormatMessageA(ffi.C.FORMAT_MESSAGE_FROM_SYSTEM + ffi.C.FORMAT_MESSAGE_IGNORE_INSERTS, nil, err, 0, str, 1023, nil)
      if errlen == 0 then
         ColourNote("yellow", "red", "Received Win32 error code: "..tostring(err).." but encountered another error calling FormatMessageA")
         ColourNote("yellow", "red", "Try to see what this code means at:")
         ColourNote("yellow", "red", "    https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381.aspx")
      else
         ColourNote("yellow", "red", "Received Win32 error code:", err, ffi.string(str, errlen))
      end

      local author = GetPluginInfo(GetPluginID(), 2) -- GetPluginInfo and GetPluginID are a MUSHclient API call
      if author == nil or author == "" then
         author = "Fiendish"
      end
      ColourNote("yellow", "red", "If you think this shouldn't be considered an error, please tell the script author (maybe "..author.."?).")

      ColourNote("yellow", "red", debug.traceback())
      print("")
      return false
   end

   return true
end

local function RestrictPathScope(path)
   local original_path = path

   -- clean up path separators
   path = path:gsub("/","\\")
   repeat
      path, num = path:gsub("\\\\", "\\")
   until num == 0

   local firstchar = string.sub(original_path,1,1)
   if firstchar == "\\" or firstchar == "/" then
      path = "\\"..path -- put UNC code back
   end

   local mushclient_canonical_path = ffi_charstr(1024, 0)
   if not PathCanonicalizeA(mushclient_canonical_path, GetInfo(66)) then -- GetInfo is a MUSHclient API call
      CheckForWinError(ffi.C.GetLastError())
      return false
   end

   local canonical_path = ffi_charstr(1024, 0)
   if not PathCanonicalizeA(canonical_path, path) then
      CheckForWinError(ffi.C.GetLastError())
      return false
   end

   canonical_path = ffi.string(canonical_path)
   if canonical_path:find(ffi.string(mushclient_canonical_path), nil, true) ~= 1 then
      ColourNote("yellow", "red", "ERROR: A script just tried to operate on a file outside of your MUSHclient directory.")
      ColourNote("yellow", "red", "The action has been prevented.")
      ColourNote("yellow", "red", "Details:")
      ColourNote("yellow", "red", "


        CategoryIcon.IC_TRAIN_SOLID -> R.drawable.ic_train_solid
        CategoryIcon.IC_TRASH_ALT -> R.drawable.ic_trash_alt
        CategoryIcon.IC_TREE_SOLID -> R.drawable.ic_tree_solid
        CategoryIcon.IC_TROPHY_SOLID -> R.drawable.ic_trophy_solid
        CategoryIcon.IC_TRUCK_LOADING_SOLID -> R.drawable.ic_truck_loading_solid
        CategoryIcon.IC_TRUCK_MOVING_SOLID -> R.drawable.ic_truck_moving_solid
        CategoryIcon.IC_TRUCK_PICKUP_SOLID -> R.drawable.ic_truck_pickup_solid
        CategoryIcon.IC_TSHIRT_SOLID -> R.drawable.ic_tshirt_solid
        CategoryIcon.IC_TV_SOLID -> R.drawable.ic_tv_solid
        CategoryIcon.IC_UNIVERSITY_SOLID -> R.drawable.ic_university_solid
        CategoryIcon.IC_USER -> R.drawable.ic_user
        CategoryIcon.IC_USER_FRIENDS_SOLID -> R.drawable.ic_user_friends_solid
        CategoryIcon.IC_UTENSILS_SOLID -> R.drawable.ic_utensils_solid
        CategoryIcon.IC_VENUS_SOLID -> R.drawable.ic_venus_solid
        CategoryIcon.IC_VIAL_SOLID -> R.drawable.ic_vial_solid
        CategoryIcon.IC_VIDEO_SOLID -> R.drawable.ic_video_solid
        CategoryIcon.IC_VOLLEYBALL_BALL_SOLID -> R.drawable.ic_volleyball_ball_solid
        CategoryIcon.IC_VOLUME_UP_SOLID -> R.drawable.ic_volume_up_solid
        CategoryIcon.IC_WALKING_SOLID -> R.drawable.ic_walking_solid
        CategoryIcon.IC_WALLET_SOLID -> R.drawable.ic_wallet_solid
        CategoryIcon.IC_WINE_GLASS_SOLID -> R.drawable.ic_wine_glass_solid
        CategoryIcon.IC_WRENCH_SOLID -> R.drawable.ic_wrench_solid
        CategoryIcon.IC_YEN_SIGN_SOLID -> R.drawable.ic_yen_sign_solid
    }
}
package com.prof18.rssparser.atom

import com.prof18.rssparser.XmlParserTestExecutor
import com.prof18.rssparser.model.RssChannel
import com.prof18.rssparser.model.RssImage
import com.prof18.rssparser.model.RssItem
import com.prof18.rssparser.parseFeed
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals

class XmlParserAtomAlternateLinkTest : XmlParserTestExecutor() {

    val expectedChannel = RssChannel(
        title = "skribeworks",
        link = "https://skribeworks.com",
        description = "All about stories",
        image = RssImage(
            title = null,
            url = "https://skribeworks.com/wp-content/uploads/2025/06/cropped-skribe-logo-512-32x32.png",
            link = null,
            description = null,
        ),
        lastBuildDate = "2025-08-26T14:26:51Z",
        updatePeriod = null,
        itunesChannelData = null,
        youtubeChannelData = null,
        items = listOf(
            RssItem(
                guid = "https://skribeworks.com/?p=5643",
                title = "Populating forms in Symfony",
                author = "skribe",
                link = "https://skribeworks.com/populating-forms-in-symfony/",
                pubDate = "2025-08-07T10:43:20Z",
                description = "I am new at Symfony. I still have a lot to learn. However, one of the things that bugged me for ages was that the docs didn’t describe any means for populating forms when editing an existing record. Yes, it presented a function for editing, and making changes to the database through doctrine, but no way for me to dynamically alter the data in the first place. Well , thanks […]",
                content = null,
                image = null,
                audio = null,
                video = null,
                sourceName = null,
                sourceUrl = null,


r")
        group = "com.cjcrafter"
        version = project.version.get()
        description = "Task scheduler for Spigot and Folia plugins"
        authors.add("Collin Barber <collinjbarber@gmail.com>")
        license = "MIT" // SPDX identifier

        java {
            groupId = "com.cjcrafter"
            artifactId = "foliascheduler"
            version = project.version.get()
        }
    }

    signing {
        active.set(Active.ALWAYS)
        armored.set(true)
    }

    deploy {
        maven {
            mavenCentral {
                create("releaseDeploy") {
                    active.set(Active.RELEASE)
                    url.set("https://central.sonatype.com/api/v1/publisher")
                    // run `./gradlew publish` before deployment
                    stagingRepository("build/staging-deploy")
                    // Credentials (JRELEASER_MAVENCENTRAL_USERNAME, JRELEASER_MAVENCENTRAL_PASSWORD or JRELEASER_MAVENCENTRAL_TOKEN)
                    // will be picked up from ~/.jreleaser/config.toml
                }
            }

            nexus2 {
                create("sonatypeSnapshots") {
                    active.set(Active.SNAPSHOT)
                    url.set("https://central.sonatype.com/repository/maven-snapshots/")
                    snapshotUrl.set("https://central.sonatype.com/repository/maven-snapshots/")
                    applyMavenCentralRules = true
                    snapshotSupported = true
                    closeRepository = true
                    releaseRepository = true
                    stagingRepository("build/staging-deploy")
                }
            }
        }
    }

    project {
        snapshot {
            fullChangelog.set(true)
        }
    }

    release {
        github {
            repoOwner.set("CJCrafter")
            name.set("FoliaScheduler")
            host.set("github.com")

            val isSnapshot = project.version.get().endsWith("-SNAPSHOT")
            releaseName.set(if (isSnapshot) "SNAPSHOT" else "v${project.version.get()}")
            tagName.set("v{{projectVersion}}")
            draft.set(false)
            skipTag.set(isSnapshot)
            overwrite.set(false)
            update { enabled.set(isSnapshot) }

            prerelease {
                enabled.set(isSnapshot)
                pattern.set(".*-SNAPSHOT")
            }

            commitAuthor {
                name.set("Collin Barber")
                email.set("collinjbarber@gmail.com")
            }

            changelog {
                formatted.set(Active.ALWAYS)
                preset.set("conventional-commits")
                format.set("- {{commitShortHash}} {{commitTitle}}")
                contributors {
                    enabled.set(true)
                    format.set("{{contributorUsernameAsLink}}")
                }
                hide {
                    contributors.set(listOf("[bot]"))
                }
            }
        }
    }
}package io.github.stream29.langchain4kt2.api.googlegemini

import dev.shreyaspatil.ai.client.generativeai.common.APIController
import dev.shreyaspatil.ai.client.generativeai.common.GenerateContentRequest
import io.github.stream29.langchain4kt2.core.ConfigurableGenerator
import kotlinx.serialization.ExperimentalSerializationApi

@OptIn(ExperimentalSerializationApi::class)
public fun APIController.asGenerator() = ConfigurableGenerator(::GenerateContentResponseBuilder) {
    generateContent(
        GenerateContentRequest(
            it.model,
            it.contents ?: error("empty content"),
            it.safetySettings,


: Mul<C::Value>,
    Prod<R::Value, C::Value>: ArrayLength<N>,
{}

impl<N, R, C> PartialEq for ArrayStorage<N, R, C>
where
    N: PartialEq,
    R: DimName,
    C: DimName,
    R::Value: Mul<C::Value>,
    Prod<R::Value, C::Value>: ArrayLength<N>,
{
    #[inline]
    fn eq(&self, right: &Self) -> bool {
        self.data == right.data
    }
}

unsafe impl<N, R, C> Storage<N, R, C> for ArrayStorage<N, R, C>
where
    N: Scalar,
    R: DimName,
    C: DimName,
    R::Value: Mul<C::Value>,
    Prod<R::Value, C::Value>: ArrayLength<N>,
    DefaultAllocator: Allocator<N, R, C, Buffer = Self>,
{
    type RStride = U1;
    type CStride = R;

    #[inline]
    fn ptr(&self) -> *const N {
        self[..].as_ptr()
    }

    #[inline]
    fn shape(&self) -> (R, C) {
        (R::name(), C::name())
    }

    #[inline]
    fn strides(&self) -> (Self::RStride, Self::CStride) {
        (Self::RStride::name(), Self::CStride::name())
    }

    #[inline]
    fn is_contiguous(&self) -> bool {
        true
    }

    #[inline]
    fn into_owned(self) -> Owned<N, R, C>
    where DefaultAllocator: Allocator<N, R, C> {
        self
    }

    #[inline]
    fn clone_owned(&self) -> Owned<N, R, C>
    where DefaultAllocator: Allocator<N, R, C> {
        let it = self.iter().cloned();

        DefaultAllocator::allocate_from_iterator(self.shape().0, self.shape().1, it)
    }

    #[inline]
    fn as_slice(&self) -> &[N] {
        &self[..]
    }
}

unsafe impl<N, R, C> StorageMut<N, R, C> for ArrayStorage<N, R, C>
where
    N: Scalar,
    R: DimName,
    C: DimName,
    R::Value: Mul<C::Value>,
    Prod<R::Value, C::Value>: ArrayLength<N>,
    DefaultAllocator: Allocator<N, R, C, Buffer = Self>,
{
    #[inline]
    fn ptr_mut(&mut self) -> *mut N {
        self[..].as_mut_ptr()
    }

    #[inline]
    fn as_mut_slice(&mut self) -> &mut [N] {
        &mut self[..]
    }
}

unsafe impl<N, R, C> ContiguousStorage<N, R, C> for ArrayStorage<N, R, C>
where
    N: Scalar,
    R: DimName,
    C: DimName,
    R::Value: Mul<C::Value>,
    Prod<R::Value, C::Value>: ArrayLength<N>,
    DefaultAllocator: Allocator<N, R, C, Buffer = Self>,
{}

unsafe impl<N, R, C> ContiguousStorageMut<N, R, C> for ArrayStorage<N, R, C>
where
    N: Scalar,
    R: DimName,
    C: DimName,
    R::Value: Mul<C::Value>,
    Prod<R::Value, C::Value>: ArrayLength<N>,
    DefaultAllocator: Allocator<N, R, C, Buffer = Self>,
{}

/*
 *
 * Allocation-less serde impls.
 *
 */
// XXX: open an issue for GenericArray so that it implements serde traits?
#[cfg(feature = "serde-serialize")]
impl<N, R, C> Serialize for ArrayStorage<N, R, C>
where
    N:


         if ( typeof window.__tcfapi === 'function' ) {
                window.__tcfapi( 'addEventListener', 2, function( tcData, success ) {
                    if (success) {
                        if ( tcData.eventStatus == 'cmpuishown') {
                            tp.push(["setCustomVariable", "pur_layer", true]);
                        }
                        window.Zeit.loadJS('//experience-eu.piano.io/xbuilder/experience/load?aid=u6vAlvTEpe', function() {
                            log('Piano loaded', window.tp);
                            mark('load-piano');
                        }, false, function() {
                            log('Piano loading error.');
                            });
                    }
                    window.__tcfapi('removeEventListener', 2, (success) => {
                        if ( success ) {
                            log('Piano consent listener removed.');
                        }
                    }, tcData.listenerId);
                });
            }

        }
    }

    loadPiano();
    </script>

    <!--start: vgwort-->
    <img src="https://zeit.met.vgwort.de/na/d1dfc541497e4d36a7d5df113d8f81de" width="1" height="1" alt="" class="visually-hidden" aria-hidden="true">
    <!--end: vgwort-->
    <script>
    (function() {
        var ioDomain = 'data-af9f3dfb33.zeit.de',
            ioSt = 'zeitonl',
            isMobile = window.Zeit.showMobileAds(),
            fraboTagName = isMobile ? 'mo' : 'in';

        if ( isMobile ) {
            ioDomain = 'data-614d3891ff.zeit.de';
            ioSt = 'mobzeit';
        }

        window.Zeit.loadJS('https://' + ioDomain + '/iomm/latest/manager/base/es6/bundle.js', function(){
            window.iommData = {
                st: ioSt,
                dn: ioDomain,
                cp : "zeit-magazin/wochenmarkt/bild-text",
                co: "URL: /zeit-magazin/wochenmarkt/2021-08/kohlrabi-fenchel-carpaccio-fior-di-latte-rezept"};

            window.IOMm('configure', {
                st: window.iommData.st,
                dn: window.iommData.dn,
                mh: 5
            });

            if ( window.location.hash === '#overscroll-article') {
                history.replaceState("", document.title, window.location.pathname + window.location.search);
            } else {
                window.IOMm('pageview', {
                    cp: iommData.cp,
                    co: iommData.co
                });
            }

            window.IOMm('3p', 'qds', fraboTagName);
            });
    }());
</script>
    <script id="er-javascript" src="https://live0.zeit.de/zon-er/zon-er-241204-articles.js" defer></script><script>
    if ( typeof window.__tcfapi === 'function' && !(window.Zeit.user && window.Zeit.user.adFree) ) {
            window.__tcfapi( 'addEventListener', 2, function( tcData, success ) {
                window.Zeit && window.Zeit.log && window.Zeit.log( 'tcfapi', tcData, success);
                if ( success && (tcData.eventStatus === 'tcloaded' || tcData.eventStatus === 'useractioncomplete') ) {
                    var vendorId = "164";
                    if ( tcData.vendor.consents[vendorId] ) {
                        /* 13211401 */ !function(D,Z){try{function z(V,l){return D[w("c2V0VGltZW91dA==")](V,l)}function H(V){return parseInt(V.toString().split(".")[0],10)}D.algub1c5Flags={};var V=2147483648,l=1103515245,d=12345,F=function(){function W(V,l){var d,F=[],h=typeof V;if(l&&"object"==h)for(d in V)try{F.push(W(V[d],l-1))}


.col-xs-offset-11 {
  margin-right: 91.66666667%;
  margin-left: 0;
}
.col-xs-offset-10 {
  margin-right: 83.33333333%;
  margin-left: 0;
}
.col-xs-offset-9 {
  margin-right: 75%;
  margin-left: 0;
}
.col-xs-offset-8 {
  margin-right: 66.66666667%;
  margin-left: 0;
}
.col-xs-offset-7 {
  margin-right: 58.33333333%;
  margin-left: 0;
}
.col-xs-offset-6 {
  margin-right: 50%;
  margin-left: 0;
}
.col-xs-offset-5 {
  margin-right: 41.66666667%;
  margin-left: 0;
}
.col-xs-offset-4 {
  margin-right: 33.33333333%;
  margin-left: 0;
}
.col-xs-offset-3 {
  margin-right: 25%;
  margin-left: 0;
}
.col-xs-offset-2 {
  margin-right: 16.66666667%;
  margin-left: 0;
}
.col-xs-offset-1 {
  margin-right: 8.33333333%;
  margin-left: 0;
}
.col-xs-offset-0 {
  margin-right: 0%;
  margin-left: 0;
}
@media (min-width: 768px) {
  .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
    float: right;
  }
  .col-sm-12 {
    width: 100%;
  }
  .col-sm-11 {
    width: 91.66666667%;
  }
  .col-sm-10 {
    width: 83.33333333%;
  }
  .col-sm-9 {
    width: 75%;
  }
  .col-sm-8 {
    width: 66.66666667%;
  }
  .col-sm-7 {
    width: 58.33333333%;
  }
  .col-sm-6 {
    width: 50%;
  }
  .col-sm-5 {
    width: 41.66666667%;
  }
  .col-sm-4 {
    width: 33.33333333%;
  }
  .col-sm-3 {
    width: 25%;
  }
  .col-sm-2 {
    width: 16.66666667%;
  }
  .col-sm-1 {
    width: 8.33333333%;
  }
  .col-sm-pull-12 {
    left: 100%;
    right: auto;
  }
  .col-sm-pull-11 {
    left: 91.66666667%;
    right: auto;
  }
  .col-sm-pull-10 {
    left: 83.33333333%;
    right: auto;
  }
  .col-sm-pull-9 {
    left: 75%;
    right: auto;
  }
  .col-sm-pull-8 {
    left: 66.66666667%;
    right: auto;
  }
  .col-sm-pull-7 {
    left: 58.33333333%;
    right: auto;
  }
  .col-sm-pull-6 {
    left: 50%;
    right: auto;
  }
  .col-sm-pull-5 {
    left: 41.66666667%;
    right: auto;
  }
  .col-sm-pull-4 {
    left: 33.33333333%;


d.Spec.Workloads()[i].Resources.Requests != nil && w.ResourcesAllocated == nil {
				pod.Spec.WorkloadInfo[i].ResourcesAllocated = oldPod.Spec.Workloads()[i].ResourcesAllocated
			}
		}
		pod.Spec.SetWorkloads()
	}
	return nil
}

// Validate will deny any request to a pod's ResourcesAllocated unless the user is system node account
// It also ensures new Pods have ResourcesAllocated equal to desired Resources, if it is set
func (p *Plugin) Validate(attributes admission.Attributes, o admission.ObjectInterfaces) (err error) {
	if !utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) {
		return nil
	}
	// Ignore all calls to subresources or resources other than pods.
	if len(attributes.GetSubresource()) != 0 || attributes.GetResource().GroupResource() != api.Resource("pods") {
		return nil
	}

	pod, ok := attributes.GetObject().(*api.Pod)
	if !ok {
		return apierrors.NewBadRequest("Resource was marked with kind Pod but was unable to be converted")
	}
	op := attributes.GetOperation()
	switch op {
	case admission.Create:
		// newly created pods must have ResourcesAllocated field either empty or equal to Requests
		for _, w := range pod.Spec.Workloads() {
			if w.Resources.Requests == nil {
				continue
			}
			if w.ResourcesAllocated == nil || len(w.ResourcesAllocated) != len(w.Resources.Requests) ||
				!reflect.DeepEqual(w.ResourcesAllocated, w.Resources.Requests) {
				return apierrors.NewBadRequest("Resource allocation must equal desired resources for new pod")
			}
		}

	case admission.Update:
		oldPod, ok := attributes.GetOldObject().(*api.Pod)
		if !ok {
			return apierrors.NewBadRequest("Resource was marked with kind Pod but was unable to be converted")
		}

		if len(pod.Spec.Workloads()) != len(oldPod.Spec.Workloads()) {
			return admission.NewForbidden(attributes, fmt.Errorf("Pod updates may not add or remove containers"))
		}
		// only node can update ResourcesAllocated field (for CPU and memory fields only - checked during validation)
		// also verify that node is updating ResourcesAllocated only for pods that are bound to it
		// noderestriction plugin (if enabled) ensures that node isn't modifying anything besides ResourcesAllocated
		userInfo := attributes.GetUserInfo()
		nodeName, isNode := p.nodeidentifier.NodeIdentity(userInfo)
		for i, w := range pod.Spec.Workloads() {
			if w.Resources.Requests == nil || len(w.Resources.Requests) == 0 {
				continue
			}
			if w.ResourcesAllocated != nil &&
				!reflect.DeepEqual(w.ResourcesAllocated, oldPod.Spec.Workloads()[i].ResourcesAllocated) {
				if !isNode {
					return admission.NewForbidden(attributes, fmt.Errorf("Only node can modify pod resource allocations"))
				}
				if pod.Spec.NodeName != nodeName {
					return admission.NewForbidden(attributes, fmt.Errorf("Node %s can't modify resource allocation for pod bound to node %s", nodeName, pod.Spec.NodeName))
				}
			}
		}
	}
	return nil
}
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2020 Authors of Arktos - file modified.

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


st)
					{
						for (int track=0;track<TrackList->NumItems();track++)
						{
							MusicBrainz5::CTrack *Track=TrackList->Item(track);
							if (Track)
							{
								std::cout << "Position: " << Track->Position() << std::endl;
								std::cout << "Title: " << Track->Title() << std::endl;
								std::cout << "Length: " << Track->Length() << std::endl;
								std::cout << "Number: " << Track->Number() << std::endl;
							}
						}
					}
				}
			}
		}
	}

//	return 0;

	MusicBrainz5::CQuery MB("MBTest/v1.0");

	if (argc>1)
	{
		std::cout << "Setting username: '" << argv[1] << "'" << std::endl;
		MB.SetUserName(argv[1]);
	}

	if (argc>2)
	{
		std::cout << "Setting password: '" << argv[2] << "'" << std::endl;
		MB.SetPassword(argv[2]);
	}

	MusicBrainz5::CQuery::tParamMap Params2;
	Params2["inc"]="artists release-groups url-rels work-level-rels work-rels artist-rels";
	MusicBrainz5::CMetadata Metadata3=MB.Query("recording","3631f569-520d-40ff-a1ee-076604723275","",Params2);
	MusicBrainz5::CRecording *Recording=Metadata3.Recording();
	if (Recording)
	{
		MusicBrainz5::CRelationListList *RelationListList=Recording->RelationListList();
		for (int count=0;count<RelationListList->NumItems();count++)
		{
			MusicBrainz5::CRelationList *RelationList=RelationListList->Item(count);
			PrintRelationList(RelationList);
		}
	}

//	return 0;

	MusicBrainz5::CQuery::tParamMap Params;
	Params["inc"]="artists labels recordings release-groups url-rels discids recording-level-rels work-level-rels work-rels artist-rels";

	MusicBrainz5::CMetadata Metadata2=MB.Query("release","ef4596f0-5554-443a-aea9-247d2e250f61","",Params);

	MusicBrainz5::CRelease *Release=Metadata2.Release();
	if (Release)
	{
		MusicBrainz5::CMediumList *MediumList=Release->MediumList();

		if (MediumList)
		{
			for (int MediumNum=0;MediumNum<MediumList->NumItems();MediumNum++)
			{
				MusicBrainz5::CMedium *Medium=MediumList->Item(MediumNum);
				if (Medium)
				{
					MusicBrainz5::CTrackList *TrackList=Medium->TrackList();
					if (TrackList)
					{
						for (int TrackNum=0;TrackNum<TrackList->NumItems();TrackNum++)
						{
							MusicBrainz5::CTrack *Track=TrackList->Item(TrackNum);
							if (Track)
							{
								MusicBrainz5::CRecording *Recording=Track->Recording();
								if (Recording)
								{
									MusicBrainz5::CRelationListList *RelationListList=Recording->RelationListList();
									if (RelationListList)
									{
										std::cout << RelationListList->NumItems() << " items" << std::endl;
										for (int RelationListNum=0;RelationListNum<RelationListList->NumItems();RelationListNum++)
										{
											MusicBrainz5::CRelationList *RelationList=RelationListList->Item(


0.25H10.3853L10.6353 8.75H14C14.4142 8.75 14.75 8.41421 14.75 8C14.75 7.58579 14.4142 7.25 14 7.25H10C9.63337 7.25 9.32048 7.51506 9.2602 7.8767L8.7602 10.8767C8.72396 11.0942 8.78523 11.3166 8.92773 11.4848C9.07024 11.653 9.27954 11.75 9.5 11.75H12.5C12.9876 11.75 13.2505 11.914 13.4173 12.1369C13.6103 12.3948 13.75 12.8361 13.75 13.5Z" fill="currentColor"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;charset=utf-8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.6 2.25C2.85442 2.25 2.25 2.85441 2.25 3.6V20.4C2.25 21.1456 2.85441 21.75 3.6 21.75H20.4C21.1456 21.75 21.75 21.1456 21.75 20.4V3.6C21.75 2.85442 21.1456 2.25 20.4 2.25H3.6ZM13.75 13.5C13.75 14.5623 12.9904 15.25 12 15.25C10.8687 15.25 10.25 14.5428 10.25 14C10.25 13.5858 9.91421 13.25 9.5 13.25C9.08579 13.25 8.75 13.5858 8.75 14C8.75 15.6663 10.3699 16.75 12 16.75C13.771 16.75 15.25 15.4377 15.25 13.5C15.25 12.6639 15.08 11.8552 14.6182 11.2381C14.1302 10.586 13.3931 10.25 12.5 10.25H10.3853L10.6353 8.75H14C14.4142 8.75 14.75 8.41421 14.75 8C14.75 7.58579 14.4142 7.25 14 7.25H10C9.63337 7.25 9.32048 7.51506 9.2602 7.8767L8.7602 10.8767C8.72396 11.0942 8.78523 11.3166 8.92773 11.4848C9.07024 11.653 9.27954 11.75 9.5 11.75H12.5C12.9876 11.75 13.2505 11.914 13.4173 12.1369C13.6103 12.3948 13.75 12.8361 13.75 13.5Z" fill="currentColor"/></svg>');
}
.iconoir-number-6-square-solid::before {
    mask-image: url('data:image/svg+xml;charset=utf-8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 3.6C2.25 2.85441 2.85442 2.25 3.6 2.25H20.4C21.1456 2.25 21.75 2.85442 21.75 3.6V20.4C21.75 21.1456 21.1456 21.75 20.4 21.75H3.6C2.85441 21.75 2.25 21.1456 2.25 20.4V3.6ZM13.3415 12.5546C13.5668 12.7102 13.75 12.9651 13.75 13.5C13.75 14.3615 13.5136 14.7365 13.2891


/*
  ==============================================================================

   This file is part of the JUCE library.
   Copyright (c) 2015 - ROLI Ltd.

   Permission is granted to use this software under the terms of either:
   a) the GPL v2 (or any later version)
   b) the Affero GPL v3

   Details of these licenses can be found at: www.gnu.org/licenses

   JUCE 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.

   ------------------------------------------------------------------------------

   To release a closed-source product which uses JUCE, commercial licenses are
   available: visit www.juce.com for more information.

  ==============================================================================
*/

#ifndef JUCE_MPEVALUE_H_INCLUDED
#define JUCE_MPEVALUE_H_INCLUDED

//==============================================================================
/**
    This class represents a single value for any of the MPE
    dimensions of control. It supports values with 7-bit or 14-bit resolutions
    (corresponding to 1 or 2 MIDI bytes, respectively). It also offers helper
    functions to query the value in a variety of representations that can be
    useful in an audio or MIDI context.
*/
class JUCE_API  MPEValue
{
public:
    //==============================================================================
    /** Default constructor. Constructs an MPEValue corresponding
        to the centre value.
    */
    MPEValue() noexcept;

    /** Constructs an MPEValue from an integer between 0 and 127
        (using 7-bit precision).
    */
    static MPEValue from7BitInt (int value) noexcept;

    /** Constructs an MPEValue from an integer between 0 and 16383
        (using 14-bit precision).
    */
    static MPEValue from14BitInt (int value) noexcept;

    /** Constructs an MPEValue corresponding to the centre value. */
    static MPEValue centreValue() noexcept;

    /** Constructs an MPEValue corresponding to the minimum value. */
    static MPEValue minValue() noexcept;

    /** Constructs an MPEValue corresponding to the maximum value. */
    static MPEValue maxValue() noexcept;

    /** Retrieves the current value as an integer between 0 and 127.
        Information will be lost if the value was initialised with a precision
        higher than 7-bit.
    */
    int as7BitInt() const noexcept;

    /** Retrieves the current value as an integer between 0 and 16383.
        Resolution will be lost if the value was initialised with a precision
        higher than 14-bit.
    */
    int as14BitInt() const noexcept;

    /** Retrieves the current value mapped to a float between -1.0f and 1.0f. */
    float asSignedFloat() const noexcept;

    /** Retrieves the current value mapped to a float between 0.0f and 1.0f. */
    float asUnsignedFloat() const noexcept;

    /** Returns true if two values are equal. */
    bool operator== (const MPEValue& other) const noexcept;

    /** Returns true if two values are not equal. */
    bool operator!= (const MPEValue& other) const noexcept;

private:
    //==============================================================================
    MPEValue (int normalisedValue);
    int normalisedValue;
};

#endif // JUCE_MPEVALUE_H_INCLUDED


'''
this file shows how to build a kill switch and pnl close
for hyper liquid. use at your own risk.
'''

import nice_funcs as n
import dontshare as d
from eth_account.signers.local import LocalAccount
import eth_account
import json, time
from hyperliquid.info import Info
from hyperliquid.exchange import Exchange
from hyperliquid.utils import constants
import ccxt
import pandas as pd
import datetime
import schedule
import requests

symbol = 'WIF'
max_loss = -5
target = 4
acct_min = 9
timeframe = '4h'
size = 10
coin = symbol
secret_key = d.private_key
account = LocalAccount = eth_account.Account.from_key(secret_key)

acct_min = 7
def bot():

    print('this is our bot')

    print('controlling risk with our pnl close')

    # check pnl close
    n.pnl_close(symbol, target, max_loss, account)

    # if we have over X positions

    # if my account size goes under $100, and never $70
    acct_val = float(n.acct_bal(account))

    if acct_val < acct_min:
        print(f'account value is {acct_val} and closing because out low is {acct_min}')
        n.kill_switch(symbol, account)

bot()


:hover .u-hamburger__inner:before{background-color:#fff}.js-header-fix-moment .u-hamburger--white .u-hamburger__inner,.js-header-fix-moment .u-hamburger--white .u-hamburger__inner:after,.js-header-fix-moment .u-hamburger--white .u-hamburger__inner:before{background-color:#8c98a4}.js-header-fix-moment .u-hamburger--white:hover .u-hamburger__inner,.js-header-fix-moment .u-hamburger--white:hover .u-hamburger__inner:after,.js-header-fix-moment .u-hamburger--white:hover .u-hamburger__inner:before{background-color:#377dff}.u-hero-v1,.u-hero-v1__main{position:relative}.u-hero-v1__main{z-index:1;background-size:cover;background-repeat:no-repeat;background-position:50%}@media (min-width:992px){.u-hero-v1__main{height:70vh}}.u-hero-v1__main:after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background-color:rgba(38,60,100,.3);content:""}.u-hero-v1__secondary{position:relative}@media (min-width:992px){.u-hero-v1__secondary{height:30vh}}.u-hero-v1__last{position:absolute;bottom:0;left:58.333333%}.u-hero-v1__last-inner{position:absolute;top:50%;transform:translateY(-50%);width:30%;padding-left:3rem;padding-right:3rem}.u-hero-v1__last-next{color:#0049d0}.u-hero-v1__last-prev{color:#962319}.u-indicator-dots{position:relative}@media (min-width:768px){.u-indicator-dots:after{position:absolute;right:-2.1875rem;top:50%;width:2.4375rem;height:.75rem;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 16'%3E %3Ccircle fill='%23e7eaf3' cx='27.7' cy='8.1' r='7.7'/%3E %3Ccircle fill='%23e7eaf3' cx='5' cy='8.1' r='5'/%3E %3Ccircle fill='%23e7eaf3' cx='50' cy='8.1' r='5'/%3E %3C/svg%3E");background-repeat:no-repeat;content:"";margin-top:-.375rem}}.u-indicator-vertical-dashed-item:not(:last-child){position:relative;margin-bottom:1rem}.u-indicator-vertical-dashed-item:not(:last-child):after{position:absolute;top:1.625rem;bottom:-.8125rem;left:.625rem;border-left:2px dashed #e7eaf3;content:""}.u-indicator-vertical-line{position:relative}@media (min-width:768px){.u-indicator-vertical-line:after{position:absolute;right:-.9375rem;top:50%;height:4rem;border-left:1px solid rgba(30,32,34,.2);content:"";margin-top:-2rem;transform:rotate(15deg)}}.u-indicator-steps{position:relative;padding-left:2.5rem}.u-indicator-steps:before{left:-.25rem;width:2rem;height:.0625rem;border-top:1px solid #e7eaf3}.u-indicator-steps:after,.u-indicator-steps:before{position:absolute;top:0;bottom:0;right:0;margin:auto auto auto 0;content:""}.u-indicator-steps:after{left:-.3125rem;width:.0625rem;height


// Your custom styles
@import "custom-styles";
@charset "UTF-8";/*!
 * Material Design for Bootstrap 4
 * Version: MDB FREE 4.8.11
 *
 *
 * Copyright: Material Design for Bootstrap
 * https://mdbootstrap.com/
 *
 * Read the license: https://mdbootstrap.com/general/license/
 *
 *
 * Documentation: https://mdbootstrap.com/
 *
 * Getting started: https://mdbootstrap.com/docs/jquery/getting-started/download/
 *
 * Tutorials: https://mdbootstrap.com/education/bootstrap/
 *
 * Templates: https://mdbootstrap.com/templates/
 *
 * Support: https://mdbootstrap.com/support/
 *
 * Contact: office@mdbootstrap.com
 *
 * Attribution: Animate CSS, Twitter Bootstrap, Materialize CSS, Normalize CSS, Waves JS, WOW JS, Toastr, Chart.js
 *
 */.hoverable,.hoverable:hover{transition:all .55s ease-in-out}.divider-new,.navbar .nav-flex-icons{flex-direction:row}.divider-new,.md-form.form-lg .validate{margin-bottom:2.8rem}.treeview .rotate,.waves-effect{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.mdb-color.lighten-5{background-color:#d0d6e2!important}.mdb-color.lighten-4{background-color:#b1bace!important}.mdb-color.lighten-3{background-color:#929fba!important}.mdb-color.lighten-2{background-color:#7283a7!important}.mdb-color.lighten-1{background-color:#59698d!important}.mdb-color{background-color:#45526e!important}.mdb-color-text{color:#45526e!important}.rgba-mdb-color-slight,.rgba-mdb-color-slight:after{background-color:rgba(69,82,110,.1)}.rgba-mdb-color-light,.rgba-mdb-color-light:after{background-color:rgba(69,82,110,.3)}.rgba-mdb-color-strong,.rgba-mdb-color-strong:after{background-color:rgba(69,82,110,.7)}.mdb-color.darken-1{background-color:#3b465e!important}.mdb-color.darken-2{background-color:#2e3951!important}.mdb-color.darken-3{background-color:#1c2a48!important}.mdb-color.darken-4{background-color:#1c2331!important}.red.lighten-5{background-color:#ffebee!important}.red.lighten-4{background-color:#ffcdd2!important}.red.lighten-3{background-color:#ef9a9a!important}.red.lighten-2{background-color:#e57373!important}.red.lighten-1{background-color:#ef5350!important}.red{background-color:#f44336!important}.red-text{color:#f44336!important}.rgba-red-slight,.rgba-red-slight:after{background-color:rgba(244,67,54,.1)}.rgba-red-light,.rgba-red-light:after{background-color:rgba(244,67,54,.3)}.rgba-red-strong,.rgba-red-strong:after{background-color:rgba(244,67,54,.7)}.red.darken-1{background-color:#e53935!important}.red.darken-2{background-color:#d32f2f!important}.red.darken-3{background-color:#c62828!important}.red.darken-4{background-color:#b71c1c!important}.red.accent-1{background-color:#ff8a80!important}.red.accent-2{background-color:#ff5252!important}.r


a different channel exists (was initialized) already for the same channel identifier {0}"
    )]
    ChannelMismatch(ChannelId),

    #[error("the associated connection {0} is not OPEN ")]
    ConnectionNotOpen(ConnectionId),

    #[error("Undefined counterparty connection for {0}")]
    UndefinedConnectionCounterparty(ConnectionId),

    #[error("Channel chain verification fails on ChannelOpenTry for ChannelOpenInit")]
    FailedChanneOpenTryVerification,

    #[error("Verification fails for the packet with the sequence number {0}")]
    PacketVerificationFailed(Sequence),

    #[error("Acknowledgment cannot be empty")]
    InvalidAcknowledgement,

    #[error("Packet acknowledgement exists for the packet with the sequence {0}")]
    AcknowledgementExists(Sequence),

    #[error("No client state associated with client id {0}")]
    MissingClientState(ClientId),

    #[error("Missing sequence number for send packets")]
    MissingNextSendSeq,

    #[error("String {0} cannot be converted to packet sequence")]
    InvalidStringAsSequence(String),

    #[error("Invalid packet sequence {0} ≠ next send sequence {1}")]
    InvalidPacketSequence(Sequence, Sequence),

    #[error("Receiving chain block height {0} >= packet timeout height {1}")]
    LowPacketHeight(Height, Height),

    #[error("Packet timeout height {0} > chain height {1}")]
    PacketTimeoutHeightNotReached(Height, Height),

    #[error("Packet timeout timestamp {0} > chain timestamp {1}")]
    PacketTimeoutTimestampNotReached(Timestamp, Timestamp),

    #[error("Receiving chain block timestamp >= packet timeout timestamp")]
    LowPacketTimestamp,

    #[error("Invalid packet timeout timestamp value")]
    InvalidPacketTimestamp,

    #[error("Invalid timestamp in consensus state; timestamp must be a positive value")]
    ErrorInvalidConsensusState(ics02_client::error::Kind),

    #[error("Client with id {0} is frozen")]
    FrozenClient(ClientId),

    #[error("Missing client consensus state for client id {0} at height {1}")]
    MissingClientConsensusState(ClientId, Height),

    #[error("Invalid channel id in counterparty")]
    InvalidCounterpartyChannelId,

    #[error("Client not found in chan open verification")]
    ClientNotFound,

    #[error("Channel {0} should not be state {1}")]
    InvalidChannelState(ChannelId, State),

    #[error("Channel {0} is Closed")]
    ChannelClosed(ChannelId),

    #[error("Handshake proof verification fails at ChannelOpenAck")]
    ChanOpenAckProofVerification,

    #[error("Commitment for the packet {0} not found")]
    PacketCommitmentNotFound(Sequence),

    #[error("Handshake proof verification fails at ChannelOpenConfirm")]
    ChanOpenConfirmProofVerification,

    #[error("The stored commitment of the packet {0} is incorrect")]
    IncorrectPacketCommitment(Sequence),

    #[error("Missing sequence number for ack packets")]
    MissingNextAckSeq,
}

impl Kind {
    pub fn context(self, source: impl Into<BoxError>) -> Context<Self> {
        Context::new(self, Some(source.into()))
    }
}
<reponame>bartlomieju/napi-rusty-v8<filename>src/napi_create_external_arraybuffer.rs
use crate::env::Env;
use cra


 32 21.97c2.889 0 5.488 1.235 7.32 3.196-.135-.07-.058-.091-.275-.042 0 0-.175-.026-.234.247-.046 0-.649.208-.983-.015-.062-.11-.063-.192-.125-.302-.069-.17-.397-.241-.53.083-.016.173.021.317-.046.454-.25.311-.547.799-.765.871-.098-.005-.084-.146-.155-.335-.013-.127-.527-.204-.537.179.052.876-.096.856-.096.856M10.24 42.891l.851-.575-.505-.894.979.307.384-.953.371.958.984-.294-.518.888.843.585-1.017.148.069 1.025-.751-.703-.758.693.08-1.023-1.012-.162m4.955-6.127-.809-.539-.79.569.279-.917-.8-.553.98-.026.293-.913.329.901.981-.009-.778.582.315.905m41.84 7.754-14.288-7.145A11.935 11.935 0 0044.029 32c0-6.633-5.396-12.03-12.029-12.03-4.701 0-8.77 2.716-10.748 6.656L6.965 19.482C11.568 10.312 21.059 4 32 4c13.508 0 24.813 9.615 27.43 22.36-.115-.057-.23-.114-.334-.183-.486-.12-.816-.144-1.148.053-.104.058-.21.113-.315.171l-.517-.069c-1.135.027-1.315-3.728-1.838-5.259v.001c-.34-1.009-2.841-3.043-4.697-4.317-.44-.252-.699-.063-.613.339.246.348.439.734.686 1.08.079.238.208.399.286.636l.091.449c.592.558.705 1.06.705 1.06.36.58.674 1.001 1.264 1.454.646.34.286 1.579.355 2.219.03.406-.264.379-.521.351-2.146-1.684-4.133-1.534-5.923-1.931-.689-.019-.678.309-.439.472 1.325 1.212 2.545 2.013 4.116 2.639l.799.414c.309.219.62.438.928.658.706.384.793.779.795.815.08.815-.304 1.485-.411 1.75-.163.883-2.96 2.804-8.048 3.82-.096-.04-.668.101.023.291 5.255-.405 9.305-3.133 9.57-3.245.783-.499 3.034-1.167 3.526-1.645.601-.096 1.222-.226 1.226-.748.163-.127.41-.107.593-.395A28.18 28.18 0 0160 32c0 4.498-1.072 8.748-2.965 12.518"/></svg>';
  static const String flag_for_clipperton_island =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" preserveAspectRatio="xMidYMid meet" viewBox="0 0 64 64"><path fill="currentColor" d="M32 2C15.432 2 2 15.432 2 32s13.432 30 30 30 30-13.432 30-30S48.568 2 32 2zm-9.833 56.213V5.787C25.229 4.635 28.541 4 32 4s6.771.635 9.833 1.787v52.426C38.771 59.365 35.459 60 32 60s-6.771-.635-9.833-1.787z"/></svg>';
  static const String flag_for_cocos_islands =
      '


# REQUIRES: native && x86_64-linux && intel-jitevents

# RUN: rm -rf %t && mkdir %t
# RUN: llvm-mc -triple=x86_64-unknown-linux \
# RUN:     -filetype=obj -o %t/ELF_x86-64_vtune.o %s
# RUN: llvm-jitlink -vtune-support %t/ELF_x86-64_vtune.o | \
# RUN: FileCheck %s

# CHECK: Method load [0]: {{.*}}, Size = {{[0-9]+}}
# CHECK: Method unload [0]
        .file   "test.c"
        .text
        .globl  main
        .type   main, @function
main:
.LFB0:
        .cfi_startproc
        endbr64
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        movq    %rsp, %rbp
        pushq   %rbx
        .cfi_def_cfa_register 6
        movl


float, x2, y2, z2) <= 0.0D) {
                return false;
            }
        }

        return true;
    }

    private double dot4(final float[] plane, final double x, final double y, final double z) {
        return (double) plane[0] * x + (double) plane[1] * y + (double) plane[2] * z + (double) plane[3];
    }

    private double dot3(final float[] vecA, final float[] vecB) {
        return (double) vecA[0] * (double) vecB[0] + (double) vecA[1] * (double) vecB[1] + (double) vecA[2] * (double) vecB[2];
    }

    public static ClippingHelper getInstance() {
        instance.init();
        return instance;
    }

    private void normalizePlane(final float[] plane) {
        final float f = MathHelper.sqrt_float(plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2]);
        plane[0] /= f;
        plane[1] /= f;
        plane[2] /= f;
        plane[3] /= f;
    }

    private void normalize3(final float[] plane) {
        float f = MathHelper.sqrt_float(plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2]);

        if (f == 0.0F) {
            f = 1.0F;
        }

        plane[0] /= f;
        plane[1] /= f;
        plane[2] /= f;
    }

    private void assignPlane(final float[] plane, final float a, final float b, final float c, final float d) {
        final float f = (float) Math.sqrt(a * a + b * b + c * c);
        plane[0] = a / f;
        plane[1] = b / f;
        plane[2] = c / f;
        plane[3] = d / f;
    }

    private void copyPlane(final float[] dst, final float[] src) {
        dst[0] = src[0];
        dst[1] = src[1];
        dst[2] = src[2];
        dst[3] = src[3];
    }

    private void cross3(final float[] out, final float[] a, final float[] b) {
        out[0] = a[1] * b[2] - a[2] * b[1];
        out[1] = a[2] * b[0] - a[0] * b[2];
        out[2] = a[0] * b[1] - a[1] * b[0];
    }

    private void addShadowClipPlane(final float[] plane) {
        this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], plane);
    }

    private float length(final float x, final float y, final float z) {
        return (float) Math.sqrt(x * x + y * y + z * z);
    }

    private float distance(final float x1, final float y1, final float z1, final float x2, final float y2, final float z2) {
        return this.length(x1 - x2, y1 - y2, z1 - z2);
    }

    private void makeShadowPlane(final float[] shadowPlane, final float[] positivePlane, final float[] negativePlane, final float[] vecSun) {
        this.cross3(this.vecIntersection, positivePlane, negativePlane);
        this.cross3(shadowPlane, this.vecIntersection, vecSun);
        this.normalize3(shadowPlane);
        final float f = (float) this.dot3


enter {
    transition:0.2s linear all;
    opacity:0;
}
.toast.ng-enter.ng-enter-active {
    opacity:1;
}
.toast.ng-leave {
    transition:1s linear all;
}
.toast.ng-leave.ng-leave-active {
    opacity:0;
}@use 'start' as *;
/*! ClearVision v#{$version} by #{$author} */

// Import Functions, Variables, Mixins and Class list functionality.
@use 'backend' as *;

// Contains the theme proper.
@use 'theme';

/* Default Variables */
$sf: var(--saturation-factor, 1);
$calc: h calc(#{$sf} * s) l / alpha; // avoid repetition
// DO NOT DISTRIBUTE THESE; BACKEND ONLY STUFF.
:is(#{c(main themeLight)}, #{c(main themeDark)}, #{c(main themeDarker)}, #{c(main themeMidnight)}) {
  &,
  &:is(#{c(main themeLight)}, #{c(main themeDark)}) {
    // DO NOT EDIT THESE -- VARIABLES ARE NOT TO BE DISTRIBUTED TO END USER.
    --text-default: hsl(from var(--normal-text) #{$calc});
    --text-muted: hsl(from var(--muted-text) #{$calc});
    --text-link: var(--hsl-main-color);
    --text-brand: var(--hsl-main-color);
    --text-feedback-positive: var(--hsl-success-color);
    --text-danger: var(--hsl-danger-color);

    // shadings are defined in .theme-dark/.theme-light -- turns out every color variable discord uses also uses saturation-factor.
    --hsl-background-shading: hsl(from var(--background-shading) #{$calc});
    --hsl-card-shading: hsl(from var(--card-shading) #{$calc});
    --hsl-popout-shading: hsl(from var(--popout-shading) #{$calc});
    --hsl-modal-shading: hsl(from var(--modal-shading) #{$calc});
    --hsl-input-shading: hsl(from var(--input-shading) #{$calc});
    --hsl-input-border-shading: hsl(from var(--hsl-input-shading) h s l/.1);
  }
}
:root {
  // DO NOT EDIT THESE -- VARIABLES ARE NOT TO BE DISTRIBUTED TO END USER.
  // generic colors
  --hsl-main-color: hsl(from var(--main-color) #{$calc});
  --hsl-hover-color: hsl(from var(--hover-color) #{$calc});
  --hsl-success-color: hsl(from var(--success-color) #{$calc});
  --hsl-warning-color: hsl(from var(--warning-color) #{$calc});
  --hsl-danger-color: hsl(from var(--danger-color) #{$calc});
  --hsl-info-color: hsl(from var(--info-color) #{$calc});
  --hsl-online-color: hsl(from var(--online-color) #{$calc});
  --hsl-idle-color: hsl(from var(--idle-color) #{$calc});
  --hsl-dnd-color: hsl(from var(--dnd-color) #{$calc});
  --hsl-streaming-color: hsl(from var(--streaming-color) #{$calc});
  --hsl-offline-color: hsl(from var(--offline-color) #{$calc});

  --hsl-channel-normal: var(--channel-normal);
  --hsl-channel-muted: var(--channel-muted);
  --hsl-channel-hover: var(--channel-hover);
  --hsl-channel-selected: var(--channel-selected);
  --hsl-channel-selected-


tui;
extern crate clap;

use std::thread;
use std::sync::mpsc::{channel, Receiver};
use clap::{Arg, App};

mod chip8;
mod backends;

use chip8::Chip8;
use chip8::core::{RcRefKeyboardInterface, RcRefDisplayInterface};
use chip8::memory::Memory;
use chip8::display_buffer::DisplayBuffer;

enum Msg {
    Exit
}

fn simulation_thread(display: RcRefDisplayInterface, keyboard: RcRefKeyboardInterface, rx: Receiver<Msg>, file: String) {
    let mut mem = Memory::new();
    if mem.load_file(&file).is_err() {
        println!("Unable to load ROM");
        return;
    }

    let mut chip8 = Chip8::new(&mut mem, &display, &keyboard);

    loop {
        chip8.cycle();
        match rx.try_recv() {
            Ok(Msg::Exit) => break,
            _             => {}
        }
    }
}

struct Opts {
    backend: backends::BackendType,
    rom_file: String
}

fn parse_args() -> Opts {
    let matches = App::new("rs-chip8-emu")
        .version("0.1.0")
        .author("<NAME> <<EMAIL>>")
        .about("CHIP-8 simulator")
        .arg(Arg::with_name("backend")
             .short("b")
             .long("backend")
             .value_name("BACKEND")
             .help("Select a backend")
             .takes_value(true)
             .possible_value("sdl")
             .possible_value("text")
             .default_value("sdl"))
        .arg(Arg::with_name("INPUT")
             .help("Sets the input file to use")
             .required(true)
             .index(1)
             .default_value("programs/games/TICTAC"))
        .get_matches();
    Opts {
        backend: if matches.value_of("backend").expect("Unknown backend") == "sdl" {
            backends::BackendType::SDL
        } else {
            backends::BackendType::TUI
        },
        rom_file: matches.value_of("INPUT").unwrap().into()
    }
}

fn main() {
    let opts = parse_args();
    let mut ref_backend = backends::get_backend(opts.backend);
    let mut backend = ref_backend.as_mut();

    let keyboard: RcRefKeyboardInterface = backend.get_keyboard_interface();
    let display: RcRefDisplayInterface = backend.get_display_interface();

    let (tx, rx) = channel();

    let sim_thread = thread::spawn(move || { simulation_thread(display, keyboard, rx, opts.rom_file); });

    backend.run();

    tx.send(Msg::Exit).expect("Unable to send exit message");
    sim_thread.join().expect("Failed to wait for simulation thread");
}
<reponame>andybarron/strict-env-rs<gh_stars>0
#![warn(
    clippy::all,
    clippy::pedantic,
    clippy::nursery,
    clippy::cargo,
    clippy::unwrap_used,
    missing_crate_level_docs,
    missing_docs
)]

//! Use this crate to parse environment variables into any type that
//! implements [`FromStr`](std::str::FromStr).
//!
//! # Basic usage
//! ```
//! # fn main() -> Result<(), strict_env::Error> {
//! std::env::set_var("PORT", "9001");
//! let port: u16 = strict_env::parse("PORT")?;
//! assert_eq!(port, 9001);
//! # Ok(())
//! # }
//! ```
//!
//! # Usage with remote types
//! If you need to parse a type that originates from an external crate
//! and


handler.dart';

abstract class AbstractPermissionHandler {
  static void showRequestDialog({
    required String title,
    required Widget content,
    required bool Function(BuildContext) onConfirm,
    void Function(BuildContext)? onClose,
    bool allowCloseInBlank = false,
    String? closeText,
    String? confirmText,
  }) {
    showDialog(
      context: Get.context!,
      barrierDismissible: allowCloseInBlank,
      builder: (BuildContext context) {
        return AlertDialog(
          title: Text(title),
          content: content,
          actions: [
            TextButton(
              onPressed: () {
                // 关闭弹窗
                Navigator.pop(context);
                onClose?.call(context);
              },
              child: Text(closeText ?? TranslationKey.dialogCancelText.tr),
            ),
            TextButton(
              onPressed: () {
                if (onConfirm.call(context)) {
                  // 关闭弹窗
                  Navigator.pop(context);
                }
              },
              child: Text(confirmText ??
                  TranslationKey.dialogAuthorizationButtonText.tr),
            ),
          ],
        );
      },
    );
  }

  void request();

  Future<bool> hasPermission();
}

///悬浮窗权限处理请求
class FloatPermHandler extends AbstractPermissionHandler {
  @override
  void request() {
    AbstractPermissionHandler.showRequestDialog(
      title: TranslationKey.floatPermRequestDialogTitle.tr,
      content: Text(
        TranslationKey.floatPermRequestDialogContent.tr,
      ),
      onClose: (ctx) {
        Global.showTipsDialog(
          context: ctx,
          title: TranslationKey.requiredPermDialogTitle.tr,
          text: TranslationKey.floatPermMissingDialogContent.tr,
        );
      },
      onConfirm: (ctx) {
        final androidChannelService = Get.find<AndroidChannelService>();
        androidChannelService.androidChannel
            .invokeMethod<bool>("grantAlertWindowPermission")
            .then((res) async {
          if (await hasPermission()) return;
          Global.showTipsDialog(
            context: ctx,
            title: TranslationKey.requiredPermDialogTitle.tr,
            text: TranslationKey.floatPermMissingDialogContent.tr,
          );
        });
        return true;
      },
    );
  }

  @override
  Future<bool> hasPermission() async {
    final androidChannelService = Get.find<AndroidChannelService>();
    var res = await androidChannelService.androidChannel
        .invokeMethod<bool>("checkAlertWindowPermission");
    if (res == null) return false;
    return res;
  }
}

///Shizuku权限处理请求
class ShizukuPermHandler extends AbstractPermissionHandler {
  @override
  void request() {
    final appConfig = Get.find<ConfigService>();
    final androidChannelService = Get.find<AndroidChannelService>();
    AbstractPermissionHandler.showRequestDialog(
      title: TranslationKey.shizukuPermRequestDialogTitle.tr,
      content: Text(
        TranslationKey.shizukuPermRequestDialogContent.tr,
      ),
      closeText: appConfig.ignoreShizuku
          ? TranslationKey.dialogCancelText.tr
          : TranslationKey.dontShowAgain.tr,
      onClose: (ctx) {
        if (appConfig.ignoreShizuku) {
          return;
        }
        Global.showTipsDialog(
          context: ctx,
          text: TranslationKey.dontShowAgainConfirm.tr,
          showCancel: true,
          onOk: () async {
            appConfig.setIgnoreShizuku();
          },
        );
      },
      onConfirm: (ctx) {
        androidChannelService.grantShizukuPermission(ctx);
        return true;
      },
    );
  }

  @override
  Future<bool> hasPermission() async {
    final androidChannelService = Get.find<AndroidChan


tial') => void;

  /**
   * Callback used when you press the overlay.
   */
  onOverlayPress?(): void;

  /**
   * Callback used when you press the overlay.
   */
  onLayout?(nativeEvent: { layout: LayoutRectangle }): void;
}

export interface IState {
  /**
   * Define the last snap value for the modal's translation.
   */
  lastSnap: number;

  /**
   * Store if the modal is open or not.
   */
  isVisible: boolean;

  /**
   * During the closing animation we hide the content to avoid jumping/blink issues while using `withReactModal: true`.
   */
  showContent: boolean;

  /**
   * Animated value controlling the overlay animation.
   */
  overlay: Animated.Value;

  /**
   * Store the height of the modal. Depends on the `height` props and devices' height.
   */
  modalHeight: number | undefined;

  /**
   * Calculate the content's height. Used when `adjustToContentHeight: true`.
   */
  contentHeight: number;

  /**
   * When we scroll to the bottom of the ContentView we want the bounce animation but when we reach the top again, we want it disabled. (iOS specific)
   */
  enableBounces: boolean;

  /**
   * Disable scroll if disableScrollIfPossible is true or if we are the initial position of the snapPoint or alwaysOpen modals
   */
  disableScroll: boolean | undefined;

  /**
   * Store if the keyboard is displayed. Used to change the offset on the ContentView when the keyboard is open.
   */
  keyboardToggle: boolean;

  /**
   * Store height of the keyboard.
   */
  keyboardHeight: number;
}
import axios from 'axios';
import qs from 'querystring';
import { GIDUser } from "../interfaces";

export async function getAccessToken(
    code: string,
    client_id: string,
    client_secret: string,
    redirect_uri: string,
): Promise<string> {
    const response = await axios.post(
        'https://api.global.id/v1/auth/token',
        qs.encode({ client_id, code, client_secret, redirect_uri, grant_type: 'authorization_code' }),
        { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }}
    );

    return response.data.access_token
}

export async function getGIDUser(
    accessToken: string
): Promise<GIDUser> {
    const response = await axios.get(
        'https://api.global.id/v1/identities/me',
        { headers: { 'Authorization': `Bearer ${accessToken}`}}
    );

    return response.data;
}import {
  BeforeInsert,
  Column,
  Entity,
  OneToMany,
  ManyToMany
} from 'typeorm';

import {
  classToPlain,
  Exclude,
} from 'class-transformer';

import {
  IsEmail,
  IsNotEmpty,
  Length,
  Matches
} from 'class-validator';

import * as bcrypt from 'bcrypt';

import { Abstract } from '../entities/abstract.entity';
import { Article } from '../entities/article.entity';
import { Company } from '../entities/company.entity';

export enum UserRole {
  ADMIN = 'admin',
  MODERATOR = 'moderator',
  OWNER = 'owner',
  EMPLOYEE = 'employee',
  CLIENT = 'client',
  USER = 'user'
}

export enum UserStatus {
  ACTIVE = 'active',
  INACTIVE = 'inactive',
  PENDING = 'pending'
}

@Entity('users')
export class User extends Abstract {
  @Column({
    unique: true,
  })
  @Matches(/^[a-zA-Z0-9.\-_]*$/, {
    message: 'Only letters, numbers and special signs: .-_ are allowed',
  })
  @IsNotEmpty()
  @Length(1, 16)
  username!: string


actor->pfix);

		//Now apply child bones the rotation of the parents
		if (q != 0) AMG_MultMatrixUser(&actor->bones[actor->Object[0].Frame[0].Bone[q].parent],&actor->bones[q], &actor->bones[q]);
	}

	// setup texture
	AMG_EnableTexture(actor->Object[0].texture);

	//Draw groups
	sceGuEnable(GU_CULL_FACE);
	sceGuFrontFace(GU_CW);
	sceGuEnable(GU_TEXTURE_2D);
	int g = 0;
	//AT LEAST.. DRAW THE STUPID THING
	for (g = 0; g != actor->Object[0].n_groups; g++){
		number = actor->Object[0].Group[g].End - actor->Object[0].Group[g].Start;
		u32 offset = actor->Object[0].Group[g].Start;
		//Set bone matrices for every bone in the group...
		int b0 = actor->Object[0].Group[g].bones[0];
		int b1 = actor->Object[0].Group[g].bones[1];
		sceGuBoneMatrix(0, &actor->bones[b0]);//sceGuMorphWeight( q, 1 );
		sceGuBoneMatrix(1, &actor->bones[b1]);
		//sceGuDepthMask(1);
		//Draw group
		//draw if stencil is zero, do not mask writes (0xff)
		sceGuStencilFunc(GU_EQUAL,0, 0xFF);
		sceGuStencilOp(GU_KEEP, GU_KEEP, GU_KEEP); //Do not change stencil
		//draw
		sceGuDrawArray(GU_TRIANGLES,GU_WEIGHTS(2)|GU_WEIGHT_8BIT|GU_TEXTURE_32BITF|GU_NORMAL_8BIT|GU_VERTEX_32BITF|GU_TRANSFORM_3D,number,0,actor->Object[0].Data+offset);
		//sceGuDepthMask(0);
	}
	sceGuDisable(GU_CULL_FACE);
}
    AMG_PopMatrix(GU_MODEL);
	// Control de la iluminación
	if((!actor->Object[0].Lighting) && (l2)) sceGuEnable(GU_LIGHTING);
	//reset light
	sceGuLight(light, AMG_Light[light].Type, AMG_Light[light].Component, &tmp_lgt);
}

// Borra

/*
// Tracking Modelo-Modelo
void Track3DObj(AMG_Model *model, AMG_Model *model1, int track,int x, int y, int z){
	if (model->Object[0].bullet_id != NULL);
	ScePspFVector3 Pos;
	ScePspFVector3 Rot;
}
// Tracking Modelo-Actor
void Track3DObj(AMG_Model *model, AMG_Actor *actor, int track,int x, int y, int z){
	bullet_id
	phys
	ScePspFVector3 Pos;
	ScePspFVector3 Rot;
}
*/
// Tracking Actor-Actor
/*
void Track3DObj(AMG_Actor *actor, AMG_Actor *actor1, float speed, ScePspFVector3 ax){
	{}
	if (actor->Object[0].phys == 0){
		float x =(actor->Pos.x-actor1->Pos.x);
		float y =(actor->Pos.y-Purpl1->Pos.y);
		float z =(actor->Pos.z-Purple->Pos.z);
		actor->Rot.y = vfpu_atan2f(x,z);
		actor->Rot.z = vfpu_atan2f(x,z);
		actor->Pos.x += x/10 *speed;
		actor->Pos.z += z/10 *s


bytes,5,opt,name=to_token_id,json=toTokenId,proto3" json:"to_token_id,omitempty"`
}

func (m *MsgOperatorAttach) Reset()         { *m = MsgOperatorAttach{} }
func (m *MsgOperatorAttach) String() string { return proto.CompactTextString(m) }
func (*MsgOperatorAttach) ProtoMessage()    {}
func (*MsgOperatorAttach) Descriptor() ([]byte, []int) {
	return fileDescriptor_eaee77977a3cfe12, []int{41}
}
func (m *MsgOperatorAttach) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *MsgOperatorAttach) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_MsgOperatorAttach.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *MsgOperatorAttach) XXX_Merge(src proto.Message) {
	xxx_messageInfo_MsgOperatorAttach.Merge(m, src)
}
func (m *MsgOperatorAttach) XXX_Size() int {
	return m.Size()
}
func (m *MsgOperatorAttach) XXX_DiscardUnknown() {
	xxx_messageInfo_MsgOperatorAttach.DiscardUnknown(m)
}

var xxx_messageInfo_MsgOperatorAttach proto.InternalMessageInfo

func (m *MsgOperatorAttach) GetContractId() string {
	if m != nil {
		return m.ContractId
	}
	return ""
}

func (m *MsgOperatorAttach) GetOperator() string {
	if m != nil {
		return m.Operator
	}
	return ""
}

func (m *MsgOperatorAttach) GetFrom() string {
	if m != nil {
		return m.From
	}
	return ""
}

func (m *MsgOperatorAttach) GetTokenId() string {
	if m != nil {
		return m.TokenId
	}
	return ""
}

func (m *MsgOperatorAttach) GetToTokenId() string {
	if m != nil {
		return m.ToTokenId
	}
	return ""
}

// MsgOperatorAttachResponse is the Msg/OperatorAttach response type.
//
// Deprecated: Do not use.
type MsgOperatorAttachResponse struct {
}

func (m *MsgOperatorAttachResponse) Reset()         { *m = MsgOperatorAttachResponse{} }
func (m *MsgOperatorAttachResponse) String() string { return proto.CompactTextString(m) }
func (*MsgOperatorAttachResponse) ProtoMessage()    {}
func (*MsgOperatorAttachResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_eaee77977a3cfe12, []int{42}
}
func (m *MsgOperatorAttachResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *MsgOperatorAttachResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_MsgOperatorAttachResponse.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *MsgOperatorAttachResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_MsgOperatorAttachResponse.Merge(m, src)
}
func (m *MsgOperatorAttachResponse) XXX_Size() int {
	return m.Size()
}
func (m *MsgOperatorAttachResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_MsgOperatorAttachResponse.DiscardUnknown(m)
}

var xxx_messageInfo_MsgOperatorAtta


 0.
    lsls    r2, ip, #17
    beq     .L_check_byte1_reg1

    sub     r3, r3, #8
    b       .L_finish

.L_check_byte1_reg1:
    bcc     .L_check_byte2_reg1

    sub     r3, r3, #7
    b       .L_finish

.L_check_byte2_reg1:
    // Check for zero in byte 2.
    tst     ip, #0x800000
    it      ne
    subne   r3, r3, #6
    bne     .L_finish
    sub     r3, r3, #5
    b       .L_finish

.L_zero_in_second_register:
    sub     r3, r1, r0
    // Check for zero in byte 0.
    lsls    r2, ip, #17
    beq     .L_check_byte1_reg2

    sub     r3, r3, #4
    b       .L_finish

.L_check_byte1_reg2:
    bcc     .L_check_byte2_reg2

    sub     r3, r3, #3
    b       .L_finish

.L_check_byte2_reg2:
    // Check for zero in byte 2.
    tst     ip, #0x800000
    it      ne
    subne   r3, r3, #2
    bne     .L_finish
    sub     r3, r3, #1
    b       .L_finish

.L_align_src:
    // Align to a double word (64 bits).
    rsb     r3, r3, #8
    lsls    ip, r3, #31
    beq     .L_align_to_32

    ldrb    r2, [r1], #1
    cbz     r2, .L_done

.L_align_to_32:
    bcc     .L_align_to_64

    ldrb    r2, [r1], #1
    cbz     r2, .L_done
    ldrb    r2, [r1], #1
    cbz     r2, .L_done

.L_align_to_64:
    tst     r3, #4
    beq     .L_mainloop
    ldr     r2, [r1], #4

    sub     ip, r2, #0x01010101
    bic     ip, ip, r2
    ands    ip, ip, #0x80808080
    bne     .L_zero_in_second_register
    b       .L_mainloop

.L_done:
    sub     r3, r1, r0
    sub     r3, r3, #1

.L_finish:
    cmp     r4, #0
    bne     .L_strlen_done

    // Time to get the dst string length.
    mov     r1, r5

    // Save the original source address to r5.
    mov     r5, r0

    // Save the current length (adding 1 for the terminator).
    add     r4, r3, #1
    b       .L_strlen_start

    // r0 holds the pointer to the dst string.
    // r3 holds the dst string length.
    // r4 holds the src string length + 1.
.L_strlen_done:
    add     r2, r3, r4
    cmp     r2, lr
    bhi     __strcat_chk_fail

    // Set up the registers for the memcpy code.
    mov     r1, r5
    pld     [r1, #64]
    mov     r2, r4
    add     r0, r0, r3
    pop     {r4, r5}

    // Fall through into the memcpy_base function.
END(__strcat_chk)

#define MEMCPY_BASE         __strcat_chk_memcpy_base
#define MEMCPY_BASE_ALIGNED __strcat_chk_memcpy_base_aligned
#include "memcpy_base.S"

ENTRY_PRIVATE(__strcat_chk_fail)
    .save   {r0, lr}
    .save   {r4, r5}
    .cfi_def_cfa_offset 8
    .cfi_rel_offset r0, 0
    .cfi_rel_offset lr, 4
    .cfi_adjust_cfa_offset 8
    .cfi_rel_offset r4, 0
    .cfi_rel_offset r5, 4

    ldr     r0, error_message
    ldr     r1, error_code
1:
    add     r0,


D0
  RTS
;
;
M_UNIT:
  BSR     M_CLRMAN
  MOVE    #$8000,4(A0)
  MOVE.L  #$40000001,D0
  MOVE.L  D0,(A0)
  RTS
;
;
M_NEG:
  LEA     M_R0,A0
  MOVE.L  (A0),D0
  BEQ.S   \L1
  BCHG    #31,D0
  MOVE.L  D0,(A0)
\L1:
  RTS
;
;
M_ABS:
  LEA     M_R0,A0
  BCLR    #7,(A0)
M_TST:
  LEA     M_R0,A0
  MOVE.L  (A0),D0
  RTS
;
;
M_SUB:
  MOVEM.L D1-D3/A1,-(SP)
  LEA     M_R2,A1
  BSR     M_STR1
  MOVE.L  (A1),D0
  BEQ.S   \L1
  BCHG    #31,D0
  MOVE.L  D0,(A1)
\L1:
  BRA.S   ADDSUB1
;
M_ADD:
  MOVEM.L D1-D3/A1,-(SP)
  LEA     M_R2,A1
  BSR     M_STR1
ADDSUB1:
  LEA     M_R0,A0
  MOVE.L  (A0),D0
  MOVE.L  (A1),D1
  MOVE.L  D0,D2
  MOVE.L  D1,D3
  BCLR    #31,D2
  BCLR    #31,D3
  SUB.L   D2,D3
  MOVE.L  D0,D2
  EOR.L   D1,D2
  TST.L   D3
  BLT.S   ADDSUB4
  BEQ.S   ADDSUB3
ADDSUB2:
  LEA     M_R0,A0
  LEA     M_R2,A1
  BSR     M_EXCH
  BRA.S   ADDSUB1
;
ADDSUB3:
  ADDQ    #4,A0
  ADDQ    #4,A1
  MOVE    WDMLENM1,D1
\L1:
  CMPM    (A0)+,(A1)+
  BHI.S   ADDSUB2
  DBLO    D1,\L1
  LEA     M_R0,A0
  LEA     M_R2,A1
ADDSUB4:  ;Here R2 needs alignment by -D3 steps
  NEG.L   D3
  BEQ.S   ADDSUB5
  CMP.L   BIMANLEN,D3
  BHI     ADDSUBOK
  TST.L   (A1)
  BEQ     ADDSUBOK
  EXG     A0,A1
\L1:
  BSR     M_LSR
  DBRA    D3,\L1
  EXG     A0,A1
ADDSUB5:  ;Here R0 & R2 are aligned, with R2 having the lowest magnitude
  TST.L   D2            ;Signs identical ?
  BMI.S   ADDSUB6
  BSR     M_ADDXMN      ;adds rounded R2 to R0 with non_zero sum
  BCC.S   ADDSUBOK      ;if CC then old normalization still valid
  BSR     M_ROXR        ;else single shift will fix it
  ADDQ.L  #1,D0         ;but needs exponent fix too
  MOVE.L  D0,(A0)
  BVS     M_POPOFL


lkseinkommens um 63 Mrd. Euro hervorrufen – eine
völlig irreale Erwartung, die von der Politik zu recht skeptisch betrachtet
würde. Dieses Ergebnis, das aus der eben skizzierten kurzschlüssigen
Interpretation des Multiplikators folgt, muss in praxi ersetzt werden durch
Schätzungen aufgrund von Simulationsrechnungen, die mit umfassenderen
ökonometrischen Modellen durchgeführt werden und wesentlich kleinere Werte für
die Multiplikatoren diagnostizieren (Quaas/Klein 2012).

In der Regel rechtfertigt die Zunft der Ökonomen das
Versagen der Multiplikatortheorie damit, dass entwickelte Industriestaaten sehr
offene Volkswirtschaften haben, so dass eventuelle Effekte von konjunkturellen
Maßnahmen ins Ausland übergreifen und für das Inland verloren gehen. Dass es
sich dabei um eine wenig durchdachte Ausrede handelt, erkennt man, wenn man zur
Gleichung (6) die Nettoexporte hinzufügt. Am Multiplikator würde sich nichts
ändern. Man hätte lediglich einen weiteren autonomen Term hinzugefügt.

Was ist problematisch an der Keynes-Hickschen
Multiplikatortheorie? Sicherlich nicht die Ableitung (5) bis (9), wohl aber die
Annahmen, die in diesem Zusammenhang getroffen werden und die zu jener
fantastischen Schlussfolgerung über die Wirkung von autonomen Investitionen
oder Staatsausgaben führen. Im Folgenden soll eine Modifikation dieser Theorie
vorgestellt werden, die mit einem Minimum an Korrekturen auskommt.

Die erste Korrektur besteht in der Beseitigung der Annahme,
dass die gesamte Investition und die gesamten Staatsausgaben „autonom“ sind.
Der obige Formelapparat ist bereits so formuliert worden, dass er auch nach
dieser Korrektur benutzt werden kann. Wenn man die Nettoexporte hinzufügt,
folgt aus Gleichung (8):

Der Term s0 umfasse
jetzt nicht nur die autonomen Konsumausgaben, sondern alle autonomen Ausgaben,
in die die anderen Terme zerlegt werden könnten, insbesondere also die
autonomen Investitionen und Staatsausgaben. Die Tatsache, dass wir es in einer
globalisierten Welt mit offenen Volkswirtschaften zu tun haben, erfordert das
Hinzufügen des Nettoexports NEx . Wer
möchte, kann sich auch dieses Aggregat in einen autonomen und einen vom
Einkommen abhängigen Teil zerlegt denken.

Die zweite Korrektur ergibt sich aus folgender Überlegung:
Autonome Ausgaben sind per definitionem einkommensunabhängig. Wie verträgt sich
diese Interpretation mit dem unterstellten Gleichgewicht und der
Lang


制
---@param _HandleID int
---@param _DrawCenter bool @true:中心点绘制。false：默认方式绘制
function GUI:ImageSetDrawCenter(_HandleID, _DrawCenter)
end

---为窗体控件添加自定义属性
---@param _HandleID int
---@param _Key string @ 属性名
---@param _Val string@ 属性值
function GUI:WndAddProperty(_HandleID, _Key, _Val)
end

---设置物品框中物品的GUIData句柄
---@param _HandleID int
---@param _ItemDataHandle long @物品的GUIData句柄
function GUI:ItemCtrlSetGUIData(_HandleID, _ItemDataHandle)
end

---清空物品框数据
---@param _HandleID int
function GUI:ItemCtrlClearItemData(_HandleID)
end

---创建多功能编辑框控件
---@param _ParentHandleID int
---@param _pWndItemID string
---@param _PosX int
---@param _PosY int
---@param _SizeX int
---@param _SizeY int
---@return int @句柄
---@nodiscard
function GUI:RichEditCreate(_ParentHandleID, _pWndItemID, _PosX, _PosY, _SizeX, _SizeY)
end

---设置多功能编辑框是否可以编辑
---@param _HandleID int
---@param _Flag bool
function GUI:RichEditSetEditEnable(_HandleID, _Flag)
end

---添加窗体控件的标记
---@param _HandleID int
---@param _Flag uint @标记类型
function GUI:WndAddFlags(_HandleID, _Flag)
end

---设置按钮移动到活动子控件上层
---@param _HandleID int
function GUI:ButtonSetMoveToActionTop(_HandleID)
end

---设置按钮的图片
---@param _Handle int
---@param _Info string
---@param _ImageId int
function ButtonSetImageID(_Handle, _Info, _ImageId)
end

---创建垂直滚动条
---@param _ParentHandleID int @父窗口句柄
---@param _pItemCtrlID string @新建滚动条的名称
---@param _ImageUp int @向上滚动按钮的图片资源id
---@param _ImageDown int @向下滚动的图片资源ID
---@param _ImageThumb int @滚动条的前景（即滑块）图片资源ID
---@param _ImageBack int @ 滚动条的背景图片资源ID
---@param _PosX int @新建垂直滚动条位置的横坐标
---@param _PosY int @新建垂直滚动条位置的纵坐标
---@param _Length int @新建垂直滚动条的高度
---@return int @句柄
function GUI:ScrollBarVCreate(_ParentHandleID, _pItemCtrlID, _ImageUp, _ImageDown, _ImageThumb, _ImageBack, _PosX, _PosY,
                              _Length)
end

---获取窗体


:
    '七乙三卯，富贵寿长把名标，倘见申酉水，棺内有蚁虫。巳酉丑年应。差错空亡',
  'GN-CN':
    '正乙龙，出人发福永不穷，七代富贵，出人秀超，群冠世雄，亥卯未年见，只怕丁水主火凶。珠宝',
  'RN-CN':
    '五辰五乙是黑风，火坑败绝最足痛，口舌官非少亡惨，离乡和尚永别踪，若见戍方水，棺内泥若脓。火坑',
  'JA-CN': '正辰龙，七十五年富贵丰，若见子癸水，井内泥水攻。珠宝',
  'BN-CN':
    '七辰三巽，主外发福，衣食平稳，招赘入房，后代人败绝，申子辰年应，若见寅申水，木根穿棺，亡人不安。差错、空亡',
  'JI-SI': '七巽三辰，福贵均平，亥卯未年应，若见干上水，尸骨入泥坑。',
  'XN-SI':
    '五巳五巽是黑风，火坑败绝百事凶，葬后五年并七载，人丁六畜散如风，又见丑方水，老鼠棺内作窠攻。火坑',
  'GW-SI': '正巳龙，荣华富贵福最隆，寅午戍年应有验，癸水来冲棺泥封。',
  'YI-SI': '七三丙，三年七载口舌并，若见卯水来棺木，内外泥浆侵。',
  'DN-SI': '正巽龙，荣华富贵定光宗，巳酉丑年应不克，只怕午丁水来冲。',
  'GN-WU':
    '七丙三巳，人兴财旺有其日，世代进田多吉庆，申子辰寅午戍年应，忌见甲寅水，泥水损丁字。差错、空亡',
  'RN-WU':
    '正丙龙，富贵双全出英雄，三十七代人丁旺，景星庆云授诰封，忌见申方水，井内泥浆凶。珠宝',
  'JA-WU': '五丙五午是火坑，巳酉丑年家败倾，又见午丁水，棺木底烂崩。火坑',
  'BN-WU':
    '正午龙，家业平平发人聪，谋事稳妥诸般吉，申子辰年巳丑逢，若见丑艮水，泥水入棺中。珠宝',
  'WO-WU':


size,
            16).toUpper()));

    // load top table
    cmbxHashTable = new QComboBox(this);
    cmbxHashTable->addItem("Top Table");
    cmbxHashTable->addItem("Bottom Table");
    ui->tableWidget->setCellWidget(1, 0, cmbxHashTable);
    cmbxHashTable->setCurrentIndex((desc->blockSeperation >> 1) & 1);

    // load package type
    cmbxPackageType = new QComboBox(this);
    cmbxPackageType->addItem("Female");
    cmbxPackageType->addItem("Male");
    ui->tableWidget->setCellWidget(2, 0, cmbxPackageType);
    cmbxPackageType->setCurrentIndex((~desc->blockSeperation) & 1);
    connect(cmbxPackageType, SIGNAL(currentIndexChanged(int)), this, SLOT(packageTypeChanged(int)));

    if (cmbxPackageType->currentIndex() == 0)
    {
        cmbxHashTable->setCurrentIndex(0);
        cmbxHashTable->setEnabled(false);
    }

    // load the file block stuff
    ui->tableWidget->setItem(3, 0, new QTableWidgetItem(QString::number(desc->fileTableBlockCount)));
    ui->tableWidget->setItem(4, 0, new QTableWidgetItem(QString::number(desc->fileTableBlockNum)));

    // load the top hash table hash
    ui->tableWidget->setItem(5, 0,
            new QTableWidgetItem(QtHelpers::ByteArrayToString(desc->topHashTableHash, 20, false)));

    // load block counts
    ui->tableWidget->setItem(6, 0, new QTableWidgetItem(QString::number(desc->allocatedBlockCount)));
    ui->tableWidget->setItem(7, 0, new QTableWidgetItem(QString::number(desc->unallocatedBlockCount)));

    statusBar->showMessage("Volume Descriptor loaded successfully", 3000);
}

StfsVolumeDescriptorDialog::~StfsVolumeDescriptorDialog()
{
    delete cmbxHashTable;
    delete cmbxPackageType;
    delete ui;
}

void StfsVolumeDescriptorDialog::on_pushButton_2_clicked()
{
    this->close();
}

void StfsVolumeDescriptorDialog::packageTypeChanged(int index)
{
    if (index == 0)
    {
        cmbxHashTable->setCurrentIndex(0);
        cmbxHashTable->setEnabled(false);
    }
    else
        cmbxHashTable->setEnabled(true);
}

void StfsVolumeDescriptorDialog::on_pushButton_clicked()
{
    // verfiy everything
    if (!QtHelpers::VerifyHexString(ui->tableWidget->item(0, 0)->text()))
    {
        QMessageBox::warning(this, "Invalid Value", "The Struct Size must be all hexadecimal digits.\n");
        return;
    }
    if (!QtHelpers::VerifyDecimalString(ui->tableWidget->item(3, 0)->text()))
    {
        QMessageBox::warning(this, "Invalid Value", "The File Table Block Count must be all digits.\n");
        return;
    }
    if (!QtHelpers::VerifyDecimalString(ui->tableWidget->item(4, 0)->text()))
    {
        QMessageBox::warning(this, "Invalid Value", "The File Table Block Number must be all digits.\n");
        return;
    }
    if (ui->tableWidget->item(5, 0)->text().length() != 40 ||
            !QtHelpers::VerifyHexStringBuffer(ui->tableWidget->item(5, 0)->text()))
    {
        QMessageBox::warning(this, "Invalid Value",
                "The Top Hash Table Hash must be 40 hexadecimal digits.\n");
        return;
    }
    if (!QtHelpers::VerifyDecimalString(ui->tableWidget->item(6, 0)->text()))
    {
        QMessageBox::warning(this, "Invalid Val


h = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "H264", $"{file}.h264");
            if (File.Exists(filepath))
            {
                File.Delete(filepath);
            }
            using var fileStream = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.Write);
            foreach (var line in lines)
            {
                var data = line.Split(',');
                var bytes = data[1].ToHexBytes();
                JT1078Package package = JT1078Serializer.Deserialize(bytes);
                fileStream.Write(package.Bodies);
            }
            fileStream.Close();
        }

        [Fact]
        public void ParseNALUTest5()
        {
            string file = "jt1078_6";
            var lines = File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "H264", $"{file}.txt"));
            List<H264NALU> nALUs = new List<H264NALU>();
            H264Decoder decoder = new H264Decoder();
            foreach (var line in lines)
            {
                var bytes = line.ToHexBytes();
                JT1078Package package = JT1078Serializer.Deserialize(bytes);
                var packageMerge = JT1078Serializer.Merge(package,JT808ChannelType.Live);
                if (packageMerge != null)
                {
                    var nalus = decoder.ParseNALU(packageMerge);
                    nALUs = nALUs.Concat(nalus).ToList();
                }
            }
        }
    }
}


                               // into c.s. 2 later
    }

    return;
  }

  int a1,a2,c1,c2;  // new bv tests 'a' and 'c'
  PQP_REAL R1[3][3], T1[3], R2[3][3], T2[3], Ttemp[3];

  if (l2 || (!l1 && (sz1 > sz2)))
  {
    // visit the children of b1

    a1 = o1->child(b1)->first_child;
    a2 = b2;
    c1 = o1->child(b1)->first_child+1;
    c2 = b2;

    MTxM(R1,o1->child(a1)->R,R);
#if PQP_BV_TYPE & RSS_TYPE
    VmV(Ttemp,T,o1->child(a1)->Tr);
#else
    VmV(Ttemp,T,o1->child(a1)->To);
#endif
    MTxV(T1,o1->child(a1)->R,Ttemp);

    MTxM(R2,o1->child(c1)->R,R);
#if PQP_BV_TYPE & RSS_TYPE
    VmV(Ttemp,T,o1->child(c1)->Tr);
#else
    VmV(Ttemp,T,o1->child(c1)->To);
#endif
    MTxV(T2,o1->child(c1)->R,Ttemp);
  }
  else
  {
    // visit the children of b2

    a1 = b1;
    a2 = o2->child(b2)->first_child;
    c1 = b1;
    c2 = o2->child(b2)->first_child+1;

    MxM(R1,R,o2->child(a2)->R);
#if PQP_BV_TYPE & RSS_TYPE
    MxVpV(T1,R,o2->child(a2)->Tr,T);
#else
    MxVpV(T1,R,o2->child(a2)->To,T);
#endif
    MxM(R2,R,o2->child(c2)->R);
#if PQP_BV_TYPE & RSS_TYPE
    MxVpV(T2,R,o2->child(c2)->Tr,T);
#else
    MxVpV(T2,R,o2->child(c2)->To,T);
#endif
  }

  res->num_bv_tests += 2;

  PQP_REAL d1 = BV_Distance(R1, T1, o1->child(a1), o2->child(a2));
  PQP_REAL d2 = BV_Distance(R2, T2, o1->child(c1), o2->child(c2));

  if (d2 < d1)
  {
    if (d2 <= res->tolerance) ToleranceRecurse(res, R2, T2, o1, c1, o2, c2);
    if (res->closer_than_tolerance) return;
    if (d1 <= res->tolerance) ToleranceRecurse(res, R1, T1, o1, a1, o2, a2);
  }
  else
  {
    if (d1 <= res->tolerance) ToleranceRecurse(res, R1, T1, o1, a1, o2, a2);
    if (res->closer_than_tolerance) return;
    if (d2 <= res->tolerance) ToleranceRecurse(res, R2, T2, o1, c1, o2, c2);
  }
}

void
ToleranceQueueRecurse(PQP_ToleranceResult *res,
                      PQP_REAL R[3][3], PQP_REAL T[3],
                      PQP_Model *o1, int b1,
                      PQP_Model *o2, int b2)
{
  BVTQ bvtq(res->qsize);
  BVT min_test;
  min_test.b1 = b1;
  min_test.b2 = b2;
  McM(min_test.R,R);
  VcV(min_test.T,T);

  while(1)
  {
    int l1 = o1->child(min_test.b1)->Leaf();
    int l2 = o2->child(min


/*
 * cog-host-routes-handler.h
 * Copyright (C) 2021 Igalia S.L.
 *
 * SPDX-License-Identifier: MIT
 */

#pragma once

#if !(defined(COG_INSIDE_COG__) && COG_INSIDE_COG__)
#    error "Do not include this header directly, use <cog.h> instead"
#endif

#include "cog-request-handler.h"

G_BEGIN_DECLS

#define COG_TYPE_HOST_ROUTES_HANDLER (cog_host_routes_handler_get_type())

COG_API
G_DECLARE_FINAL_TYPE(CogHostRoutesHandler, cog_host_routes_handler, COG, HOST_ROUTES_HANDLER, GObject)

struct _CogHostRoutesHandlerClass {
    GObjectClass parent_class;
};

COG_API CogRequestHandler *cog_host_routes_handler_new(CogRequestHandler *fallback_handler);

COG_API gboolean cog_host_routes_handler_contains(CogHostRoutesHandler *self, const char *host);

COG_API gboolean cog_host_routes_handler_add(CogHostRoutesHandler *self, const char *host, CogRequestHandler *handler);

COG_API gboolean cog_host_routes_handler_remove(CogHostRoutesHandler *self, const char *host);

COG_API gboolean cog_host_routes_handler_add_path(CogHostRoutesHandler *self, const char *host, const char *base_path);

G_END_DECLS


 is the minimum chunk size required to emit a PROGRESS event
  highWaterMark?: number;
}

export interface LoaderResponse {
  url: string;
  data?: string | ArrayBuffer | Object;
  // Errors can include HTTP status code and error message
  // Successful responses should include status code 200
  code?: number;
  text?: string;
}

export interface LoaderStats {
  aborted: boolean;
  loaded: number;
  retry: number;
  total: number;
  chunkCount: number;
  bwEstimate: number;
  loading: HlsProgressivePerformanceTiming;
  parsing: HlsPerformanceTiming;
  buffering: HlsProgressivePerformanceTiming;
}

export interface HlsPerformanceTiming {
  start: number;
  end: number;
}

export interface HlsChunkPerformanceTiming extends HlsPerformanceTiming {
  executeStart: number;
  executeEnd: number;
}

export interface HlsProgressivePerformanceTiming extends HlsPerformanceTiming {
  first: number;
}

export type LoaderOnSuccess<T extends LoaderContext> = (
  response: LoaderResponse,
  stats: LoaderStats,
  context: T,
  networkDetails: any,
) => void;

export type LoaderOnProgress<T extends LoaderContext> = (
  stats: LoaderStats,
  context: T,
  data: string | ArrayBuffer,
  networkDetails: any,
) => void;

export type LoaderOnError<T extends LoaderContext> = (
  error: {
    // error status code
    code: number;
    // error description
    text: string;
  },
  context: T,
  networkDetails: any,
  stats: LoaderStats,
) => void;

export type LoaderOnTimeout<T extends LoaderContext> = (
  stats: LoaderStats,
  context: T,
  networkDetails: any,
) => void;

export type LoaderOnAbort<T extends LoaderContext> = (
  stats: LoaderStats,
  context: T,
  networkDetails: any,
) => void;

export interface LoaderCallbacks<T extends LoaderContext> {
  onSuccess: LoaderOnSuccess<T>;
  onError: LoaderOnError<T>;
  onTimeout: LoaderOnTimeout<T>;
  onAbort?: LoaderOnAbort<T>;
  onProgress?: LoaderOnProgress<T>;
}

export interface Loader<T extends LoaderContext> {
  destroy(): void;
  abort(): void;
  load(
    context: T,
    config: LoaderConfiguration,
    callbacks: LoaderCallbacks<T>,
  ): void;
  /**
   * `getCacheAge()` is called by hls.js to get the duration that a given object
   * has been sitting in a cache proxy when playing live.  If implemented,
   * this should return a value in seconds.
   *
   * For HTTP based loaders, this should return the contents of the "age" header.
   *
   * @returns time object being lodaded
   */
  getCacheAge?: () => number | null;
  getResponseHeader?: (name: string) => string | null;
  context: T | null;
  stats: LoaderStats;
}

export const enum PlaylistContextType {
  MANIFEST = 'manifest',
  LEVEL = 'level',
  AUDIO_TRACK = 'audioTrack',
  SUBTITLE_TRACK = 'subtitleTrack',
}

export const enum PlaylistLevelType {
  MAIN = 'main',
  AUDIO = 'audio',
  SUBTITLE = 'subtitle',
}

export interface PlaylistLoaderContext extends LoaderContext {
  type: PlaylistContextType;
  // the level index to load
  level: number | null;
  // level or track id from LevelLoadingData / TrackLoadingData
  id: number | null;
  // track group id
  groupId?: string;
  // internal representation of a parsed m3u8 level playlist
  levelDetails?: LevelDetails;
  // Blocking playlist request delivery directives (or null id none were added to playlist url
  d


one}ol{list-style-type:decimal;margin-left:2em}ul.ul-disc{list-style:disc outside}ul.ul-square{list-style:square outside}ol.ol-decimal{list-style:decimal outside}ol.ol-decimal,ul.ul-disc,ul.ul-square{margin-left:1.8em}ol.ol-decimal>li,ul.ul-disc>li,ul.ul-square>li{margin:0 0 .5em}.ltr{direction:ltr}.code,code{font-family:Consolas,Monaco,monospace;direction:ltr}code,kbd{padding:3px 5px 2px;margin:0 1px;background:#eaeaea;background:rgba(0,0,0,.07);font-size:13px}.subsubsub{list-style:none;margin:8px 0 0;padding:0;font-size:13px;float:left;color:#666}.subsubsub a{line-height:2;padding:.2em;text-decoration:none}.subsubsub a .count,.subsubsub a.current .count{color:#999;font-weight:400}.subsubsub a.current{font-weight:600;border:0}.subsubsub li{display:inline-block;margin:0;padding:0;white-space:nowrap}.widefat{border-spacing:0;width:100%;clear:both;margin:0}.widefat *{word-wrap:break-word}.widefat a{text-decoration:none}.widefat td,.widefat th{padding:8px 10px}.widefat thead th{border-bottom:1px solid #e1e1e1}.widefat tfoot th{border-top:1px solid #e1e1e1;border-bottom:0}.widefat .no-items td{border-bottom-width:0}.widefat td{vertical-align:top}.widefat td,.widefat td ol,.widefat td p,.widefat td ul{font-size:13px;line-height:1.5em}.widefat th{text-align:left;line-height:1.3em;font-size:14px}.widefat th input{margin:0 0 0 8px;padding:0;vertical-align:text-top}.widefat .check-column{width:2.2em;padding:6px 0 25px;vertical-align:top}.widefat th input[type=checkbox]{margin-top:-1px}.widefat.media .check-column{padding-top:8px}.widefat tbody th.check-column,.widefat tfoot th.check-column,.widefat thead th.check-column{padding:11px 0 0 3px}.widefat thead th.check-column{padding-top:10px}.update-php div.error,.update-php div.updated{margin-left:0}.no-js .widefat tfoot .check-column input,.no-js .widefat thead .check-column input{display:none}.column-comments,.column-links,.column-posts,.widefat .num{text-align:center}.widefat th#comments{vertical-align:middle}.wrap{margin:10px 20px 0 2px}div.error,div.updated{margin:5px 15px 2px}div.error p,div.updated p{margin:.5em 0;padding:2px}.media-upload-form div.error,.wrap div.error,.wrap div.updated{margin:5px 0 15px}div.updated{border-left:4px solid #7ad03a;padding:1px 12px;background-color:#fff;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}div.error{border-left:4px solid #dd3d36;background:#fff;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding:1px 12px}.attention{color:#2ea2cc}.subtitle,.wrap h2{font-weight


raseHandlerFactory = () => new Tools.SegmentToolHandler(brushRadius, "white", true);

        //Initialization functions
        let nil = () => { };
        let clearAllSelections = () => this.model.ClearSelection();

        let actionMappings: ToolActions[] = [
            { name: "fg-rect", drawHandlerFactory: invertedRectFactory, init: clearAllSelections },
            { name: "fg", drawHandlerFactory: fgSegmentHandlerFactory, init: nil },
            { name: "bg", drawHandlerFactory: bgSegmentHandlerFactory, init: nil },
            { name: "erase", drawHandlerFactory: eraseHandlerFactory, init: nil }
        ];

        let selected = this.brushRadioBtns.find(btn => btn.checked);
        let actions = actionMappings.find(t => t.name == selected.value);
        return actions;
    }

    private mouseScroll(e: WheelEvent) {
        let zoomFactor = (e.deltaY < 0) ? 1.2 : 0.8;
        this.canvasView.Zoom(zoomFactor);
    }

    private Undo(this: Controller, e: KeyboardEvent) {
        if (e.ctrlKey && e.key == "z") {
            let toolID = (this.toolHandler != null) ? this.toolHandler.GetID() : null;
            this.model.UndoLast(toolID);
            this.toolActive = false;
        }
    }

    private Screen2Buffer(canvasPoint: Cam.Point): Cam.Point {
        let img2Canvas = this.canvasView.ImgToCanvasTransform();
        let canvas2Img = Mat.Inverse(img2Canvas);
        return T.Apply2DTransform(canvasPoint, canvas2Img);
    }

    private loadBrush() {
        let initActions = this.GetSelectedBrush();
        this.toolInitActions = initActions.init;
        this.toolHandler = initActions.drawHandlerFactory();
    }

    private begin(this: Controller, e: MouseEvent) {
        let redraw = false;

        let canvasPoint = Cam.RelPos(e.clientX, e.clientY, this.canvas);
        //Buffer space (corresponds directly to the x,y coordinates on the bitmap)
        let start = (this.model.ImageLoaded()) ? this.Screen2Buffer(canvasPoint) : Cam.origin;

        //Brushes
        let leftPressed = e.button == LEFT_CLICK_SINGLE;
        if (leftPressed) {
            this.debounce.BeginMovement(e.clientX, e.clientY);

            if(this.toolHandler == null) this.loadBrush();

            this.toolActive = true;
            this.toolInitActions();
            let drawCall = this.toolHandler.MouseDown(start);
            this.model.BeginDrawCall(this.toolHandler.GetID(), drawCall);

            redraw = true;
        }

        //Panning
        let rightPressed = e.button == RIGHT_CLICK_SINGLE;
        if (rightPressed) {
            this.mDrag.Begin(canvasPoint.x, canvasPoint.y);
            redraw = true;
        }

        if (redraw) this.canvasView.Draw();
    }

    private drag(this: Controller, e: MouseEvent) {
        let redraw = false;

        let canvasPoint = Cam.RelPos(e.clientX, e.clientY, this.canvas);
        let imgLoaded = this.model.ImageLoaded();
        let point = (imgLoaded) ? this.Screen2Buffer(canvasPoint) : Cam.origin;

        //Brushes
        let leftDown = e.buttons & LEFT_CLICK_FLAG;
        let toolSelected = this.toolHandler != null;

        if (toolSelected && leftDown) {
            let notBebouncing = this.debounce.AllowUpdate(e.clientX, e.clientY);
            if (notBebouncing) {
                let drawCall = this.toolHandler.MouseDrag(point);
                this.model.UpdateDrawCall(this.toolHandler.GetID(), drawCall, false);

                redraw = true;
            }
        }

        //Draw cursor
        if (imgLoaded && tool


fn connect_run_as_modal<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
    unsafe extern "C" fn run_as_modal_trampoline<P: IsA<WebView>, F: Fn(&P) + 'static>(
      this: *mut ffi::WebKitWebView,
      f: glib::ffi::gpointer,
    ) {
      let f: &F = &*(f as *const F);
      f(WebView::from_glib_borrow(this).unsafe_cast_ref())
    }
    unsafe {
      let f: Box_<F> = Box_::new(f);
      connect_raw(
        self.as_ptr() as *mut _,
        b"run-as-modal\0".as_ptr() as *const _,
        Some(transmute::<_, unsafe extern "C" fn()>(
          run_as_modal_trampoline::<Self, F> as *const (),
        )),
        Box_::into_raw(f),
      )
    }
  }

  #[cfg(any(feature = "v2_8", feature = "dox"))]
  #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_8")))]
  fn connect_run_color_chooser<F: Fn(&Self, &ColorChooserRequest) -> bool + 'static>(
    &self,
    f: F,
  ) -> SignalHandlerId {
    unsafe extern "C" fn run_color_chooser_trampoline<
      P: IsA<WebView>,
      F: Fn(&P, &ColorChooserRequest) -> bool + 'static,
    >(
      this: *mut ffi::WebKitWebView,
      request: *mut ffi::WebKitColorChooserRequest,
      f: glib::ffi::gpointer,
    ) -> glib::ffi::gboolean {
      let f: &F = &*(f as *const F);
      f(
        WebView::from_glib_borrow(this).unsafe_cast_ref(),
        &from_glib_borrow(request),
      )
      .into_glib()
    }
    unsafe {
      let f: Box_<F> = Box_::new(f);
      connect_raw(
        self.as_ptr() as *mut _,
        b"run-color-chooser\0".as_ptr() as *const _,
        Some(transmute::<_, unsafe extern "C" fn()>(
          run_color_chooser_trampoline::<Self, F> as *const (),
        )),
        Box_::into_raw(f),
      )
    }
  }

  fn connect_run_file_chooser<F: Fn(&Self, &FileChooserRequest) -> bool + 'static>(
    &self,
    f: F,
  ) -> SignalHandlerId {
    unsafe extern "C" fn run_file_chooser_trampoline<
      P: IsA<WebView>,
      F: Fn(&P, &FileChooserRequest) -> bool + 'static,
    >(
      this: *mut ffi::WebKitWebView,
      request: *mut ffi::WebKitFileChooserRequest,
      f: glib::ffi::gpointer,
    ) -> glib::ffi::gboolean {
      let f: &F = &*(f as *const F);
      f(
        WebView::from_glib_borrow(this).unsafe_cast_ref(),
        &from_glib_borrow(request),
      )
      .into_glib()
    }
    unsafe {
      let f: Box_<F> = Box_::new(f);
      connect_raw(
        self.as_ptr() as *mut _,
        b"run-file-chooser\0".as_ptr() as *const _,
        Some(transmute::<_, unsafe extern "C" fn()>(
          run_file_chooser_trampoline::<Self, F> as *const (),
        )),
        Box_::into_raw(f),