 Vector3()
        var f1 = Vector3()
        var f2 = Vector3()

        var testAxis = Vector3()

        var center = Vector3()
        var extents = Vector3()

        var triangleNormal = Vector3()

    }

}
/*
 * Copyright (c) 2024 ModCore Inc. All rights reserved.
 *
 * This code is part of ModCore Inc.'s Essential Mod repository and is protected
 * under copyright registration # TX0009138511. For the full license, see:
 * https://github.com/EssentialGG/Essential/blob/main/LICENSE
 *
 * You may not use, copy, reproduce, modify, sell, license, distribute,
 * commercialize, or otherwise exploit, or create derivative works based
 * upon, this file or any other in this repository, all of which is reserved by Essential.
 */
package gg.essential.model.bones

import gg.essential.model.Bones
import gg.essential.model.EnumPart
import gg.essential.model.Side
import gg.essential.model.Vector3
import gg.essential.model.backend.PlayerPose
import gg.essential.model.util.Quaternion
import kotlin.collections.any
import kotlin.collections.component1
import kotlin.collections.component2
import kotlin.collections.iterator
import kotlin.let

class BedrockModelState(
    val playerPose: PlayerPose,
    val bakedAnimations: BakedAnimations,
    val userOffset: Vector3,
    val side: Side?,
    val hiddenBones: Set<String>,
    val visibleParts: Set<EnumPart>,
) {
    fun apply(bones: Bones) {
        applyPose(bones, playerPose)

        bakedAnimations.apply(bones)

        if (userOffset != Vector3.ZERO) {
            for (bone in bones.byPart.values) {
                if (bone.part == EnumPart.ROOT) continue
                bone.userOffsetX = userOffset.x
                bone.userOffsetY = userOffset.y
                bone.userOffsetZ = userOffset.z
            }
        }

        applyVisibility(bones)

        // Note: Gimbal propagation needs to read the final rotation of all bones. So it needs to happen last.
        if (bakedAnimations.bakedBones.any { it.gimbal }) {
            val entityRotation = bakedAnimations.entityRotation
                .let { it.copy(x = -it.x, y = -it.y) } // see RenderLivingBase.prepareScale
            // TODO maybe optimize traversal, don't need to compute subtrees that do not even have any gimbal parts
            bones.root.propagateGimbal(Quaternion.Identity, entityRotation)
        }
    }

    fun reset(bones: Bones) {
        // Player pose does not need to be reset because properties of all parts are overwritten each time

        bakedAnimations.reset(bones)

        if (userOffset != Vector3.ZERO) {
            for (bone in bones.byPart.values) {
                if (bone.part == EnumPart.ROOT) continue
                bone.userOffsetX = 0f
                bone.userOffsetY = 0f
                bone.userOffsetZ = 0f
            }
        }

        resetVisibility(bones)

        // Gimbal propagation does not need resetting, the `gimbal` flag is already reset by `bakedAnimations.reset`
    }

    private fun applyVisibility(bones: Bones) {
        for ((part, bone) in bones.byPart) {
            bone.visible = part in visibleParts
        }
        for (hiddenBone in hiddenBones) {
            bones[hiddenBone]?.visible = false
        }
        bones.root.propagateVisibility(true, side)
    }

    private fun resetVisibility(bones: Bones) {
        for ((_, bone) in bones.byPart) {
            bone.visible = null
        }
        for (hiddenBone in hiddenBones) {
            b


73v194.70840579c0 12.46608696 9.37924638 22.67640579 21.48915942 24.21982609zM438.39072464 98.24463769h147.21855072v146.03130434H438.39072464v-146.03130434zM171.26028986 536.33855073h316.40115941V681.77623188h48.67710146V536.33855073H852.73971014V681.77623188h48.67710145V513.89959421c0-14.4844058-11.75373913-26.23814493-26.23814493-26.23814494H536.33855073V342.10504348h-48.67710146v145.67513043H150.83965217c-15.55292754 0-28.25646377 12.70353623-28.25646376 28.25646378V681.77623188h48.67710145V536.33855073zM609.3542029 731.04695652H414.6457971c-13.41588406 0-24.33855073 10.92266666-24.33855072 24.33855073v194.70840579c0 13.41588406 10.92266666 24.33855073 24.33855072 24.33855073h194.7084058c13.41588406 0 24.33855073-10.92266666 24.33855072-24.33855073V755.38550725c0-13.41588406-10.92266666-24.33855073-24.33855072-24.33855073z m-24.33855073 194.70840579h-146.03130434v-146.03130434h146.03130434v146.03130434zM244.27594203 731.04695652h-194.7084058c-13.41588406 0-24.33855073 10.92266666-24.33855072 24.33855073v194.70840579c0 13.41588406 10.92266666 24.33855073 24.33855072 24.33855073h194.7084058c13.41588406 0 24.33855073-10.92266666 24.33855072-24.33855073V755.38550725c0-13.41588406-10.92266666-24.33855073-24.33855072-24.33855073z m-24.33855072 194.70840579H73.90608696v-146.03130434h146.03130435v146.03130434zM974.43246377 731.04695652h-194.7084058c-13.41588406 0-24.33855073 10.92266666-24.33855072 24.33855073v194.70840579c0 13.41588406 10.92266666 24.33855073 24.33855072 24.33855073h194.7084058c13.41588406 0 24.33855073-10.92266666 24.33855072-24.33855073V755.38550725c0-14.60313044-9.73542029-24.33855073-24.33855072-24.33855073z m-24.33855073 194.70840579H804.06260869v-146.03130434h146.03130435v146.03130434z"  ></path></symbol><symbol id="icon-card" viewBox="0 0 1024 1024"><path d="M96.8 466.9h414.8V98.2H96.8v368.7z m46.1-322.6h322.6v276.5H142.9V144.3z m0 0M557.7 927.8h368.7V651.3H557.7v276.5z m46.1-230


from __future__ import annotations

from dask.dataframe.io.orc.core import read_orc, to_orc


| 0x40000000;
            sigY = sigA + (expA ? 0x40000000 : sigA);
            expDiff = -expDiff;
        } else {
            /*----------------------------------------------------------------
            *----------------------------------------------------------------*/
            if ( expA == 0xFF ) {
                if ( sigA ) goto propagateNaN;
                uiZ = uiA;
                goto uiZ;
            }
            expZ = expA - 1;
            sigX = sigA | 0x40000000;
            sigY = sigB + (expB ? 0x40000000 : sigB);
        }
        return
            softfloat_normRoundPackToF32(
                signZ, expZ, sigX - softfloat_shiftRightJam32( sigY, expDiff )
            );
    }
    /*------------------------------------------------------------------------
    *------------------------------------------------------------------------*/
 propagateNaN:
    uiZ = softfloat_propagateNaNF32UI( uiA, uiB );
 uiZ:
    uZ.ui = uiZ;
    return uZ.f;

}


inal-group: 1001;
    box-shadow: 0 0 50px 8px ActiveCaption;
    content: "";
    display: -moz-box;
    height: 0;
    margin: 0 50px;
    position: absolute;
    pointer-events: none;
    top: 100%;
    width: -moz-available;
  }

  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) #TabsToolbar:not(:-moz-lwtheme):-moz-window-inactive::after {
    box-shadow: 0 0 50px 8px InactiveCaption;
  }

  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) toolbar[customindex]:not(:-moz-lwtheme),
  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) #PersonalToolbar:not(:-moz-lwtheme) {
    position: relative;
  }

  /* Need to constrain the box shadow fade to avoid overlapping layers, see bug 886281. */
  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) #navigator-toolbox:not(:-moz-lwtheme) {
    overflow: -moz-hidden-unscrollable;
  }

  /**
   * When the tabstrip is overflowed, pinned tab separators get position: absolute,
   * which makes the pinned tab separators leak over the nav-bar highlight. Forcing
   * the element to snap to the bottom of the client rect works around the issue.
   */
  #main-window[tabsintitlebar] #tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned]::before {
    bottom: 0px;
  }

  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) #TabsToolbar .toolbarbutton-1 {
    position: relative;
    z-index: 1;
  }

  /**
   * With the tabbrowser-tabs element z-index'd above the nav-bar, we now get the
   * scrollbox button borders leaking over the nav-bar highlight. This transparent bottom
   * border forces the scrollbox button borders to terminate a pixel early, working
   * around the issue.
   */
  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) .tabbrowser-arrowscrollbox > .scrollbutton-up,
  #main-window[tabsintitlebar]:not([sizemode=fullscreen]) .tabbrowser-arrowscrollbox > .scrollbutton-down {
    border-bottom: 1px solid transparent;
  }

  #main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel:-moz-lwtheme {
    /* Render a window top border: */
    background-image: linear-gradient(to bottom,
          ThreeDLightShadow 0, ThreeDLightShadow 1px,
          ThreeDHighlight 1px, ThreeDHighlight 2px,
          ActiveBorder 2px, ActiveBorder 4px, transparent 4px);
  }

  /* End classic titlebar gradient */

  #main-window[tabsintitlebar]:not([inFullscreen]) :-moz-any(#TabsToolbar, #toolbar-menubar) toolbarbutton:not(:-moz-lwtheme) {
    color: inherit;
  }
}

/* Render a window top border for lwthemes on WinXP modern themes: */
@media (-moz-windows-theme: luna-blue) {
  #main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel:-moz-lwtheme {
    background-image: linear-gradient(to bottom,
        rgb(8, 49, 216) 0, rgb(8, 49, 216) 1px,
        rgb(15, 77, 227) 1px, rgb(15, 77, 227) 2px,
        rgb(22, 106, 238) 2px, rgb(22, 106, 238) 3px,
        rgb(8, 85, 221) 3px, rgb(8, 85, 221) 4px,
        transparent 4px);
  }


a href="lib-locales.html#lib.facet.ctype.char.members"> [lib.facet.ctype.char.members] paragraph 10 and 11 from:

        char        narrow(char c, char /*dfault*/) const;
        const char* narrow(const char* low, const char* high,
                           char /*dfault*/, char* to) const;

        Returns: do_narrow(low, high, to).

to:

        char        narrow(char c, char dfault) const;
        const char* narrow(const char* low, const char* high,
                           char dfault, char* to) const;

        Returns: do_narrow(c, dfault) or
                 do_narrow(low, high, dfault, to), respectively.

[Kona: 1) the problem occurs in additional places, 2) a user
defined version could be different.]

[Post-Tokyo: Dietmar provided the above wording at the request of
the LWG. He could find no other places the problem occurred. He
asks for clarification of the Kona "a user defined
version..." comment above.  Perhaps it was a circuitous way of
saying "dfault" needed to be uncommented?]

[Post-Toronto: the issues list maintainer has merged in the
proposed resolution from issue 207, which addresses the
same paragraphs.]

154. Missing <tt>double</tt> specifier for <tt>do_get()</tt>

Section: 22.2.2.1.2  [lib.facet.num.get.virtuals]  Status: TC  Submitter: Dietmar Kühl  Date: 20 Jul 1999

The table in paragraph 7 for the length modifier does not list the length
modifier <tt>l</tt> to be applied if the type is <tt>double</tt>. Thus, the
standard asks the implementation to do undefined things when using <tt>scanf()</tt>
(the missing length modifier for <tt>scanf()</tt> when scanning <tt>double</tt>s
is actually a problem I found quite often in production code, too).

Proposed resolution:

In 22.2.2.1.2  [lib.facet.num.get.virtuals], paragraph 7, add a row in the Length
Modifier table to say that for <tt>double</tt> a length modifier
<tt>l</tt> is to be used.

Rationale:

The standard makes an embarrassing beginner's mistake.

155. Typo in naming the class defining the class <tt>Init</tt>

Section: 27.3  [lib.iostream.objects]  Status: TC  Submitter


        public IHugeImageStorage HugeImageStorage => throw new NotImplementedException();

        public T GetData<T>(IProgressScope? parentScope = null)
            where T : class
        {
            return (T)datas[typeof(T)];
        }

        public IEnumerable<T> GetOfType<T>() where T : class
        {
            return datas.Values.OfType<T>();
        }

        public void SetData<T>(T value)
            where T : class
        {
            datas[typeof(T)] = value;
        }

        public Task<T> GetDataAsync<T>(IProgressScope? parentScope = null) where T : class
        {
            return Task.FromResult(GetData<T>(parentScope));
        }
    }
}


   /// <typeparam name="TValue">the specified type (must be serializable and have a public default constructor)</typeparam>
    /// <param name="createDefault">whether create the file with default values if not exist</param>
    public static FileProcess ParseJson<TValue>(bool createDefault = true) => ((_, path) =>
    {
        if (path == null) return null;
        var exist = File.Exists(path);
        if (exist)
        {
            using var fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read);
            var result = JsonSerializer.Deserialize<TValue>(fs);
            return result;
        }
        else
        {
            if (!createDefault) return null;
            var d = Activator.CreateInstance(typeof(TValue));
            using var fs = File.Open(path, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None);
            JsonSerializer.Serialize(fs, d, _ParseJsonCreateDefaultOptions);
            return d;
        }
    });

    public static FileProcess Deserialize<TValue>(IFileSerializer<TValue> serializer) => (_, path) =>
    {
        if (path is null)
            return null;
        using (var fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Read))
            return serializer.Deserialize(fs);
    };
}


sua busca clicando no botão \"Refrescar\"."
L["Select whether to sort search results in ascending or descending order."] = "Selecione para mostrar os resultados em ordem crescente ou decrescente"
L["Shift-Right-Click to clear all data for this item from AuctionDB."] = "Shift-Clique-Direito para limpar todos os dados para este item do AuctionDB."
L["Sort items by"] = "Ordenar items por"
L["This determines how many items are shown per page in results area of the \"Search\" tab of the AuctionDB page in the main TSM window. You may enter a number between 5 and 500 inclusive. If the page lags, you may want to decrease this number."] = "Determina quantos itens são mostrados por página na área de resultados da aba \"Busca\" da página do AuctionDB na janela principal do TSM. Você pode digitar um número entre 5 e 500 (inclusive). Se houver demora na página você pode querer diminuir este número."
L["Total Seen Count:"] = "Total de vezes visto"
L["Use the search box and category filters above to search the AuctionDB data."] = "Use a caixa de busca e filtros de categoria acima para procurar nos dados do AuctionDB."
L["You can


sn't need to be implemented
    -- The following is how the implementation would be
    --[[
    use = function(self, card, area, copier)
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.4,
            func = function()
                play_sound('tarot1')
                card:juice_up(0.3, 0.5)
                return true
            end
        }))
        for i = 1, #G.hand.highlighted do
            local percent = 1.15 - (i - 0.999) / (#G.hand.highlighted - 0.998) * 0.3
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.15,
                func = function()
                    G.hand.highlighted[i]:flip()
                    play_sound('card1', percent)
                    G.hand.highlighted[i]:juice_up(0.3, 0.3)
                    return true
                end
            }))
        end
        delay(0.2)
        for i = 1, #G.hand.highlighted do
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.1,
                func = function()
                    G.hand.highlighted[i]:set_ability(card.ability.mod_conv)
                    return true
                end
            }))
        end
        for i = 1, #G.hand.highlighted do
            local percent = 0.85 + (i - 0.999) / (#G.hand.highlighted - 0.998) * 0.3
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.15,
                func = function()
                    G.hand.highlighted[i]:flip()
                    play_sound('tarot2', percent, 0.6)
                    G.hand.highlighted[i]:juice_up(0.3, 0.3)
                    return true
                end
            }))
        end
        G.E_MANAGER:add_event(Event({
            trigger = 'after',
            delay = 0.2,
            func = function()
                G.hand:unhighlight_all()
                return true
            end
        }))
        delay(0.5)
    end,
    can_use = function(self, card)
        return G.hand and #G.hand.highlighted > 0 and #G.hand.highlighted <= card.ability.max_highlighted
    end
    --]]
}

-- The High Priestess
SMODS.Consumable {
    key = 'high_priestess',
    set = 'vremade_Tarot',
    pos = { x = 2, y = 0 },
    config = { extra = { planets = 2 } },
    loc_vars = function(self, info_queue, card)
        return { vars = { card.ability.extra.planets } }
    end,
    use = function(self, card, area, copier)
        for i = 1, math.min(card.ability.extra.planets, G.consumeables.config.card_limit - #G.consumeables.cards) do
            G.E_MANAGER:add_event(Event({
                trigger = 'after',
                delay = 0.4,
                func = function()
                    if G.consumeables.config.card_limit > #G.consumeables.cards then
                        play_sound('timpani')
                        SMODS.add_card({ set = 'Planet' })
                        card:juice_up(0.3, 0.5)
                    end
                    return true
                end
            }))
        end
        delay(0.6)
    end,
    can_use = function(self, card)
        return G.consumeables and


cancy-ad-context-\"])\ndiv[class*=\"f-test-vacancy-ad-context-\"]","div:has(> div[id][data-url])\ndiv[id][data-url]","div:has(> div[id^=\"M\"][id*=\"Composite\"])","div:has(> img[src*=\"ops.\"])","div:has(> ins)","div:has(> noindex > script)","div:not(.adv-wrapper):has(> ins)","div:not([id]):not([class]):has(> div + div + section + section) > div:first-child + div > div:only-child > div:first-child + div:last-child","div:not([id]):not([class])[style^=\"min-height:\"]","div[align=\"center\"] > a[href] > img[src*=\".gif\"]","div[align=\"center\"] > a[href][target=\"_blank\"]","div[align=\"center\"] > div[style^=\"background-color:\"][style*=\"height:300px;\"]\ndiv[align=\"center\"][style=\" background-color: #ececec;\"] > div[style*=\"font-size:\"]","div[align=\"center\"] > noindex","div[align=\"center\"] > table[width=\"160\"]\ndiv[align=\"center\"] > table[width=\"962\"]","div[align=\"center\"] a[target=\"_blank\"] > img\ndiv[class^=\"tm-article-banner\"]","div[align=\"center\"][class$=\"only\"]","div[align=\"center\"][style=\"display: block;\"]\ndiv[style=\"text-align: center; margin: auto;\"] > a[target=\"_blank\"]","div[bs_id]","div[class$=\" \"][style=\"display: inherit ;\"]","div[class$=\" feed-item\"]","div[class$=\"-ads\"]\nfigure","div[class$=\"-bannerContent\"]\ndiv[class=\"\"][style=\"\"] > noindex","div[class$=\"-prm\"]","div[class$=\"_ads\"]","div[class$=\"_branding\"]","div[class$=\"_ushki\"]\niframe[src*=\"banners.php\"]\ntd[style=\"width:180px; padding-left: 15px;\"] > table:last-child","div[class$=\"col\"] > .side ~ .side + .sidebtm ~ *","div[class*=\" ZNT_\"]","div[class*=\" min-h-\"]","div[class*=\" styles_bar_\"]","div[class*=\"-banner\"]","div[class*=\"-branding-\"] > a[target=\"_blank\"]","div[class*=\"-brnd\"]","div[class*=\"-fix \"][class$=\"as-desktop\"]\ndiv[data-modules=\"banner\"]","div[class*=\"300x600\"]\ndiv[class^=\"bnr-background\"]\ndiv[id^=\"bnr-background\"]\ndiv[id^=\"container\"]","div[class*=\"AdBox\"]","div[class*=\"Banner\"]","div[class*=\"Banners\"]","div[class*=\"HHC-Banner-\"]","div[class*=\"Media_banner__\"]","div[class*=\"__ads-\"]","div[class*=\"__bot-ad\"]\ndiv[class*=\"__top-ad\"]\ndiv[onclick*=\"partner\"]","div[class*=\"_place__\"]","div[class*=\"_promocodes \"]","div[class*=\"adfinity_block\"]\nimg[src*=\"/assets/ARu.\"]","div[class*=\"adfox\"]","div[class*=\"ads-fixed\"]","div[class*=\"ads-placement\"]","div[class*=\"adv-\"]","div[class*=\"adv-wrapper\"]","div[class*=\"advban\"]","div[class*=\"advbig\"]","div[class*=\"advert\"]","div[class*=\"advertising\


rot180)\\n            all_logits.append(torch.rot90(logits_rot180, k=-2, dims=[2, 3])) # Revert 180 deg\\n\\n            # 7. Rotate 270 degrees clockwise\\n            image_tensor_rot270 = torch.rot90(image_tensor_original, k=3, dims=[2, 3])\\n            with autocast('cuda'):\\n                logits_rot270 = self.model(image_tensor_rot270)\\n            all_logits.append(torch.rot90(logits_rot270, k=-3, dims=[2, 3])) # Revert 270 deg counter-clockwise\\n\\n            # Average the logits from all augmented predictions\\n            averaged_logits = torch.mean(torch.stack(all_logits), dim=0)\\n\\n            # Get class with highest probability for each pixel\\n            predicted_mask = torch.argmax(averaged_logits, dim=1).squeeze(0)\\n\\n            # Convert to NumPy array and adjust to 1-indexed class IDs (0-indexed to 1-indexed)\\n            pred_mask_np = predicted_mask.cpu().numpy() + 1\\n\\n        return pred_mask_np\\n\\n# Initialize and train the model\\nmodel = SemanticSegmentationModel()\\nmodel.train_model(training_data_paths)",
  "new_index": 822,
  "new_code": "# TODO:  1. Feel free to pip install and import any any useful libraries within the\\n#  rewrite cell.\\n\\n# TODO:  1. Feel free to pip install and import any useful libraries within the\\n#  rewrite cell.\\n\\nimport torch\\nimport torch.nn as nn\\nimport torch.optim as optim\\nfrom torch.optim import lr_scheduler\\nfrom torch.utils.data import Dataset, DataLoader\\nimport segmentation_models_pytorch as smp\\nimport numpy as np\\nfrom PIL import Image\\nimport os\\nimport albumentations as A\\nfrom albumentations.pytorch import ToTensorV2\\nfrom torch.amp import GradScaler, autocast\\n\\n# Constants for model training\\nNUM_CLASSES = 17\\nIMG_SIZE = 256 # DLRSD images are 256x256\\nBATCH_SIZE = 16 # Adjust based on GPU memory\\nLEARNING_RATE = 1e-4\\nEPOCHS = 350 # MODIFICATION: Increased epochs to allow for more convergence\\n\\n# Device configuration (CUDA if available, else CPU)\\ndevice = torch.device(\\"cuda\\" if torch.cuda.is_available() else \\"cpu\\")\\n\\n# Custom Dataset Class\\nclass DLRSDDataset(Dataset):\\n    def __init__(self, data_paths, transform=None):\\n        self.data_paths = data_paths\\n        self.transform = transform\\n\\n    def __len__(self):\\n        return len(self.data_paths)\\n\\n    def __getitem__(self, idx):\\n        image_path, label_path = self.data_paths[idx]\\n\\n        # Load image and ensure 3 channels (RGB)\\n        image = np.array(Image.open(image_path).convert(\\"RGB\\"))\\n        \\n        # Load label mask. Labels are 1-indexed (1 to 17) in the dataset.\\n        # PyTorch's CrossEntropyLoss expects 0-indexed targets (0 to 16).\\n        label_mask = np.array(Image.open(label_path), dtype=np.int64) - 1\\n\\n        if self.transform:\\n            # Albumentations expects images as HWC and masks as HW\\n            transformed = self.transform(image=image, mask=label_mask)\\n            image = transformed[\\"image\\"]\\n            label_mask = transformed[\\"mask\\"]\\n\\n        return image, label_mask\\n\\n# Define transformation pipelines for trainin


，为了安全起见，最好是在一个单独的 Kubernetes 集群上运行，或独立的硬件。这样一来，如果主集群被破坏，SPIRE 的私钥就不会有风险。

![图 6.9：SPIRE 服务器与工作负载在同一集群上。](../images/f6-9.jpg)
图 6.9：SPIRE 服务器与工作负载在同一集群上。

![图 6.10：为了安全起见，SPIRE 服务器在一个单独的集群上。](../images/f6-10.jpg)
图 6.10：为了安全起见，SPIRE 服务器在一个单独的集群上。

### Kubernetes 工作负载证明

SPIRE 代理包括一个 Kubernetes 工作负载验证器插件。该插件首先使用系统调用来识别工作负载的 PID。然后，它使用对 Kubelet 的本地调用来识别工作负载的 pod 名称、镜像和其他特征。这些特征可以作为注册条目的选择器。

### Kubernetes 负载条目自动注册

一个名为 Kubernetes Workload Registrar 的 SPIRE 扩展可以自动创建节点和工作负载注册条目，充当 Kubernetes API 服务器和 SPIRE 服务器之间的桥梁。它支持几种不同的方法来识别正在运行的 pod，并在创建条目方面具有一定的灵活性。

### 增加 Sidecar

对于尚未适应使用工作负载 API 的工作负载（见第 7 章：与其他机构的集成中的本地 SPIFFE 支持一节），Kubernetes 可以很容易地添加支持的 sidecar。Sidecar 可以是一个 SPIFFE 感知的代理，比如 Envoy。或者，它可以是一个与 SPIRE 一起开发的 sidecar，名为“SPIFFE Helper"，它监控工作负载 API，并在其 SVID 发生变化时重新配置工作负载。

![图 6.11：与 sidecar 容器一起部署的 Kubernetes 集群中的工作负载。](../images/f6-11.jpg)
图 6.11：与 sidecar 容器一起部署的 Kubernetes 集群中的工作负载。

## SPIRE 的性能考虑因素

当连接到服务器的 SPIRE 代理数量增加时，也会给服务器、数据存储和网络本身带来更多的负荷。多个因素都会造成负载，包括节点数量和每个节点的工作负载，以及你轮换秘钥的频率。使用 JWT-SVID 与嵌套的


/picture_host_manage/common/file_explorer/md_preview.dart';
import 'package:horopic/picture_host_manage/common/file_explorer/pdf_viewer.dart';

import 'package:horopic/picture_host_manage/aws/aws_bucket_list_page.dart';
import 'package:horopic/picture_host_manage/aws/aws_new_bucket_configure.dart';
import 'package:horopic/picture_host_manage/aws/aws_file_explorer.dart';
import 'package:horopic/picture_host_manage/aws/aws_file_information_page.dart';

import 'package:horopic/picture_host_manage/alist/alist_bucket_list_page.dart';
import 'package:horopic/picture_host_manage/alist/alist_bucket_information_page.dart';
import 'package:horopic/picture_host_manage/alist/alist_file_explorer.dart';
import 'package:horopic/picture_host_manage/alist/alist_file_information_page.dart';

import 'package:horopic/picture_host_manage/webdav/webdav_file_explorer.dart';
import 'package:horopic/picture_host_manage/webdav/webdav_file_information_page.dart';
import 'package:horopic/picture_host_manage/webdav/webdav_pic_preview.dart';

//webview
Handler webviewHandler = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
  String url = params['url']!.first;
  String title = params['title']!.first;
  bool enableJs = params['enableJs']!.first == 'true';
  return WebViewPage(url: url, title: title, enableJs: enableJs);
});

///root
Handler rootHandler = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
  return const PicHoroAPP();
});

///主页
var homePageHandler = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
  return const HomePage();
});

///相册
var albumUploadedImagesHandler = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
  return const UploadedImages();
});

///相册预览
var albumImagePreviewHandler = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
  var index = params['index']!.first;
  List images = params['images']!.first.split(',');
  return ImagePreview(
    index: int.parse(index),
    images: images,
  );
});

///webdav图片预览
var webdavImagePreviewHandler = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
  var index = params['index']!.first;
  List images = params['images']!.first.split(',');
  List headersList = json.decode(params['headersList']!.first);
  return WebdavImagePreview(
    index: int.parse(index),
    images: images,
    headersList: headersList,
  );
});

///本地文件相册预览
var localImagePreviewHandler = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
  var index = params['index']!.first;
  List images = params['images']!.first.split(',');
  return LocalImagePreview(
    index: int.parse(index),
    images: images,
  );
});

///配置页面
var configurePageHandler = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
  return const ConfigurePage();
});

///图片压缩设置页面
var compressConfigur


) 2024 TOSHIBA Digital Solutions Corporation
 * Copyright (c) The Apache Software Foundation (ASF)

 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at

 *    http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.toshiba.mwcloud.gs.arrow.adapter.binder;

import com.toshiba.mwcloud.gs.Row;
import com.toshiba.mwcloud.gs.GSType;
import com.toshiba.mwcloud.gs.GSException;
import java.sql.Types;
import org.apache.arrow.vector.BitVector;

/** A column binder for booleans. */
public class BitBinder extends BaseColumnBinder<BitVector> {
  public BitBinder(BitVector vector) {
    this(vector, GSType.BOOL);
  }

  public BitBinder(BitVector vector, GSType gsType) {
    super(vector, gsType);
  }

  @Override
  public void bind(Row row, int columnIndex, int rowIndex)
      throws GSException {
    // See BitVector#getBit
    final int byteIndex = rowIndex >> 3;
    final byte b = vector.getDataBuffer().getByte(byteIndex);
    final int bitIndex = rowIndex & 7;
    final int value = (b >> bitIndex) & 0x01;
    row.setBool(columnIndex, value != 0);
  }
}
package gsSample;

import java.util.Date;
import java.util.Properties;

import com.toshiba.mwcloud.gs.Aggregation;
import com.toshiba.mwcloud.gs.AggregationResult;
import com.toshiba.mwcloud.gs.GSException;
import com.toshiba.mwcloud.gs.GridStore;
import com.toshiba.mwcloud.gs.GridStoreFactory;
import com.toshiba.mwcloud.gs.Query;
import com.toshiba.mwcloud.gs.RowKey;
import com.toshiba.mwcloud.gs.RowSet;
import com.toshiba.mwcloud.gs.TimeOperator;
import com.toshiba.mwcloud.gs.TimeSeries;
import com.toshiba.mwcloud.gs.TimeUnit;
import com.toshiba.mwcloud.gs.TimestampUtils;

// Search and aggregation of time-series data
public class Sample3 {

	static class Point {
		@RowKey Date timestamp;
		boolean active;
		double voltage;
	}

	public static void main(String[] args) throws GSException {

		// Lower the consistency level because of read-only operation (default: IMMEDIATE)
		Properties props = new Properties();
		props.setProperty("notificationAddress", args[0]);
		props.setProperty("notificationPort", args[1]);
		props.setProperty("clusterName", args[2]);
		props.setProperty("user", args[3]);
		props.setProperty("password", args[4]);
		props.setProperty("consistency", "EVENTUAL");

		// Get a GridStore instance
		GridStore store = GridStoreFactory.getInstance().getGridStore(props);

		// Obtain a TimeSeries
		// ※ Use the Point class as in Sample 2
		TimeSeries<Point> ts = store.getTimeSeries("point01", Point.class);

		// Search for the locations whose voltage is not lower than a reference value, though not in action.
		Query<Point> query = ts.query(
				"select * from point01" +
				" where not active and voltage > 50");
		RowSet<Point> rs = query.fetch();

		while (rs.hasNext()) {
			// Examine each abnormal point

			Poin


input-disabled-10dot3-dark {
	background-color: #202020;
	color: #646464;
}

.bb-input::-webkit-input-placeholder {
	color: silver;
}

.bb-input-10dot3-light::-webkit-input-placeholder {
	color: #7B7B7B;
	font-style: italic;
}

.bb-input-10dot3-dark::-webkit-input-placeholder {
	color: #646464;
	font-style: italic;
}

.bb-input-cancel-button-light {
	background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEcAAABHCAYAAABVsFofAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyQjRDODEzODZEMjA2ODExQTYxM0YzNEI5Rjg0ODQxOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxOTNEODcwOUQ5QkQxMUUxOEEzQkQwRUE1NzY5NjQyQSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxOTNEODcwOEQ5QkQxMUUxOEEzQkQwRUE1NzY5NjQyQSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZj


recency == -1) Int.MAX_VALUE else game.recency }?.recency ?: error(
                    "No games in group $it")
        })

        if (currentGroup != null) {
            this.currentGroupIndex = this.gameGroups.indexOf(currentGroup)
        }
        this.currentGroupIndex = this.currentGroupIndex
    }
}package io.github.chrislo27.rhre3.editor.stage.advopt

import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.ShapeRenderer
import io.github.chrislo27.rhre3.editor.Editor
import io.github.chrislo27.rhre3.screen.EditorScreen
import io.github.chrislo27.toolboks.ui.*

class CopyGamesUsedButton(val editor: Editor, palette: UIPalette, parent: UIElement<EditorScreen>,
                          stage: Stage<EditorScreen>)
    : Button<EditorScreen>(palette, parent, stage) {

    companion object {
        val strings: List<String> = listOf("Copy\ngames", "[CYAN]Copied![]", "No\ngames...")
    }

    init {
        this.visible = false
    }

    private var resetTextIn: Float = 0f

    private val label: TextLabel<EditorScreen> = TextLabel(palette, this, stage).apply {
        this@CopyGamesUsedButton.addLabel(this)
        this.fontScaleMultiplier = 0.4f
        this.text = strings[0]
        this.isLocalizationKey = false
    }

    override var tooltipText: String?
        set(_) {}
        get() {
            return when (label.text) {
                strings[1] -> "Copied successfully to clipboard!"
                strings[2] -> "No games in remix"
                else -> "Click to copy games used to clipboard"
            }
        }

    override fun render(screen: EditorScreen, batch: SpriteBatch, shapeRenderer: ShapeRenderer) {
        super.render(screen, batch, shapeRenderer)
        if (resetTextIn > 0) {
            resetTextIn -= Gdx.graphics.deltaTime
            if (resetTextIn <= 0) {
                label.text = strings[0]
            }
        }
    }

    override fun onLeftClick(xPercent: Float, yPercent: Float) {
        super.onLeftClick(xPercent, yPercent)

        val games = editor.getGamesUsedInRemix()

        if (games.isEmpty()) {
            label.text = strings[2]
        } else {
            label.text = strings[1]
            Gdx.app.clipboard.contents = games
        }

        resetTextIn = 3f
    }
}package io.github.chrislo27.rhre3.track.tracker.musicvolume

import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.math.MathUtils
import io.github.chrislo27.rhre3.theme.Theme
import io.github.chrislo27.rhre3.track.tracker.Tracker
import io.github.chrislo27.rhre3.track.tracker.TrackerContainer
import java.util.*

class MusicVolumeChange(container: TrackerContainer<MusicVolumeChange>, beat: Float, width: Float, volume: Int)
    : Tracker<MusicVolumeChange>(container, beat, width) {

    companion object {
        val MAX_VOLUME: Int = 200

        fun getFormattedText(volume: Int): String = "♬\ue13c➡$volume%"
    }

    val volume: Int = volume.coerceIn(0, MAX_VOLUME)
    val previousVolume: Int
        get() = (container.map as NavigableMap).lowerEntry(beat)?.value?.volume ?: 100

    init {
        text = getFormattedText(volume)
    }

    override fun getSlope(): Int {
        return


base.entity.CouponSummary;
import lk.project.marketing.repository.CouponReceiveDetailRepository;
import lk.project.marketing.repository.CouponRepository;
import lk.project.marketing.repository.CouponSummaryRepository;
import lk.project.marketing.service.AccountRuleService;
import lk.project.marketing.service.CouponConsumeService;
import lk.project.marketing.service.CouponSummaryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

import static lk.project.marketing.base.enums.AccountRuleRewardTypeEnum.DISCOUNT;
import static lk.project.marketing.base.enums.AccountRuleRewardTypeEnum.GIFT;

/**
 * Created by gupei on 2018/12/07.
 */
@Service
@Slf4j
public class CouponSummaryServiceImpl implements CouponSummaryService {

    @Autowired
    CouponRepository couponRepository;

    @Autowired
    CouponConsumeService couponConsumeService;

    @Autowired
    CouponSummaryRepository couponSummaryRepository;

    @Autowired
    CouponReceiveDetailRepository couponReceiveDetailRepository;

    @Override
    public List<CouponSummaryBo> getUserCouponSummary(String userId) {

        List<CouponSummary> userCouponSummaryList = couponSummaryRepository.queryUserCoupons(userId);

        if (CollectionUtils.isEmpty(userCouponSummaryList)){
            return Collections.EMPTY_LIST;
        }
        else{
            return userCouponSummaryList.stream()
                    .map( o->{
                        CouponSummaryBo couponSummaryBo = new CouponSummaryBo();
                        couponSummaryBo.setCouponSummary(o);
                        Coupon coupon = couponRepository.getCouponById(o.getCouponId());
                        couponSummaryBo.setCompanyId(coupon.getCompanyId());
                        couponSummaryBo.setCouponType(coupon.getCouponType());
                        couponSummaryBo.setCouponName(coupon.getCouponName());
                        couponSummaryBo.setCouponDesc(coupon.getCouponDesc());
                        couponSummaryBo.setIcon(coupon.getIcon());
                        return couponSummaryBo;
                    })
                    .collect(Collectors.toList());
        }

    }

    @Override
    public List<CouponSummaryDetailBo> getUserCouponDetail(String userId, Long couponId) {

        return couponReceiveDetailRepository.getUserCouponReceiveDetailListByCouponId(couponId, userId);
    }

    @Override
    public Long getCouponAvailableQuantityForOrder(Long couponId,
                                                   OrderBo orderReqBo,
                                                   OrderItemBo orderItemReqBo,
                                                   MemberBo memberReqBo) {

        BigDecimal totalAmount = BigDecimal.ZERO;
        BigDecimal goodsSalePrice = BigDecimal.ZERO;
        Long totalGoodsQuantity = 0L;

        if (orderReqBo!=null){
            totalAmount = orderReqBo.getTotalOrderAmount();
        }
        else if(orderItemReqBo!=null){
            totalAmount = orderItemReqBo.getTotalGoodsAmount();
            goodsSalePrice = orderItemReqBo.getGoodsSalePrice();
            totalGoodsQuantity = orderItemReqBo.getGoodsQuantity();
        }

        if (totalAmount == null || totalAmount.compar


parameters-title">Parameters

start: number

count: number

Optional materialIndex: number

Returns void

Inherited from BufferGeometry.addGroup

Defined in node_modules/@types/three/src/core/BufferGeometry.d.ts:102

add<wbr/>Index<svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg>

add<wbr/>Index(index: any): void<svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg>

Deprecated

Use .setIndex() instead.

Parameters

index: any

Returns void

Inherited from BufferGeometry.addIndex

Defined in node_modules/@types/three/src/core/BufferGeometry.d.ts:174

<section class="tsd-panel tsd-member tsd-kind-me


rySelectorAll('x-menu'));
    //var attributes = {};

    // Let's process the case where `<x-video>` tag has a src attribute or sub `<source>` elements.
    if (!videos.length) {
      // Single video.
      // Create the inner video element.
      var innerVideo = document.createElement('video');

      playlist[0] = videoSrcElement(
        xVideo.getAttribute('id'),
        xVideo.getAttribute('src'), // @todo Fix it as it won't work with source elements.
        innerVideo,
        xVideo.getAttribute('label')
      );

      // Doest it have inner source/track elements?
      tracks = xtag.toArray(xVideo.querySelectorAll('x-video > track'));
      if (tracks.length) {
        playlist[0].trackRange = range(0, tracks.length);
      }

      // Move all source elements.
      var sources = xtag.toArray(xVideo.querySelectorAll('x-video > source'));
      sources.forEach(function(source) {
        innerVideo.appendChild(source);
      });

      tracks.forEach(function(source) {
        innerVideo.appendChild(source);
      });

      // We replicate the attribute on both <x-video> and the inner video elements.
      VIDEO_ATTRIBUTES.forEach(function(attr) {
        if (xVideo.hasAttribute(attr)) {
          innerVideo.setAttribute(attr, xVideo.getAttribute(attr));
        }
      });

      // Propagate events of inner video element to x-video element.
      VIDEO_EVENT_TYPES.forEach(function(eventType) {
        innerVideo.addEventListener(eventType, function(event) {
          xtag.fireEvent(xVideo, eventType);
        }, false);
      });

      xVideo.xtag.mediaControls.appendChild(innerVideo);

      videos = [innerVideo];
    } else {
      // Multiple videos playlist.
      var tracksLength = 0;

      videos.forEach(function(video, currentIndex) {
        xVideo.xtag.mediaControls.appendChild(video); // Move video element.

        playlist[currentIndex] = videoSrcElement(
          video.getAttribute('id'),
          // Sometime the video is not loaded, so we can't rely on .currentSrc,
          // so we use .src, but that wouldn't work with <source> elements.
          // @todo Find a workaround that work with <source> elements too.
            video.currentSrc || video.src, // @todo Fix me!
          video,
          video.getAttribute('label')
        );

        var videoTracks = xtag.toArray(video.querySelectorAll('track'));
        if (videoTracks.length) {
          playlist[currentIndex].trackRange = range(tracksLength, videoTracks.length);

          tracks = tracks.concat(videoTracks); // To be appended to inner video.
          tracksLength += videoTracks.length;
        }

        // Propagate events of inner video element to x-video element.
        VIDEO_EVENT_TYPES.forEach(function(eventType) {
          video.addEventListener(eventType, function(event) {
            xtag.fireEvent(xVideo, eventType);
          }, false);
        });
      });

      /*if (videos[0]) {
       // Copy HTML attributes of the first <video> tag on <x-video> tag.
       VIDEO_ATTRIBUTES.forEach(function(attribute) {
       if (videos[0].hasAttribute(attribute)) {
       attributes[attribute] = videos[0].getAttribute(attribute);
       }
       });
       if (videos[0].hasAttribute('controls')) {


[i], _ = fValueValue(v1, v2)
						}
					}
				}
				return nil
			}

			if c2 {
				v2, null2 := p2.GetValue(0)
				if null2 {
					nulls.AddRange(rsVec.GetNulls(), 0, uint64(length))
				} else {
					if p1.WithAnyNullValue() {
						nulls.Or(rsVec.GetNulls(), parameters[0].GetNulls(), rsVec.GetNulls())
						rowCount := uint64(length)
						for i := uint64(0); i < rowCount; i++ {
							v1, null1 := p1.GetValue(i)
							if null1 {
								continue
							}
							r, _ := fValueValue(v1, v2)
							rss[i] = r
						}
					} else {
						rowCount := uint64(length)
						for i := uint64(0); i < rowCount; i++ {
							v1, _ := p1.GetValue(i)
							rss[i], _ = fValueValue(v1, v2)
						}
					}
				}
				return nil
			}

			// basic case.
			if p1.WithAnyNullValue() || p2.WithAnyNullValue() {
				nulls.Or(parameters[0].GetNulls(), parameters[1].GetNulls(), rsVec.GetNulls())
			}

			rowCount := uint64(length)
			for i := uint64(0); i < rowCount; i++ {
				v1, _ := p1.GetValue(i)
				v2, _ := p2.GetValue(i)
				rss[i], _ = fValueValue(v1, v2)
			}
			return nil
		}
	}

	// return null if all params were null. but not certain if only one param was null.
	// result will be not null if all params were not null.
	if alwaysNull3 && neverNull && (!alwaysNull1 && !alwaysNull2) {
		return func(parameters []*vector.Vector, result vector.FunctionResultWrapper, _ *process.Process, length int, selectList *FunctionSelectList) error {
			result.UseOptFunctionParamFrame(2)
			rs := vector.MustFunctionResult[T2](result)
			p1 := vector.OptGetParamFromWrapper[T1](rs, 0, parameters[0])
			p2 := vector.OptGetParamFromWrapper[T1](rs, 1, parameters[1])
			rsVec := rs.GetResultVector()
			rss := vector.MustFixedColNoTypeCheck[T2](rsVec)

			c1, c2 := parameters[0].IsConst(), parameters[1].IsConst()

			if c1 && c2 {
				v1, null1 := p1.GetValue(0)
				v2, null2 := p2.GetValue(0)
				if null1 && null2 {
					nulls.AddRange(rsVec.GetNulls(), 0, uint64(length))
				} else if null1 {
					v, rnull := fNullValue(v2)
					if rnull {
						nulls.AddRange(rsVec.GetNulls(), 0, uint64(length))
					} else {
						rowCount := uint64(length)
						for i := uint64(0); i < rowCount; i++ {
							rss[i] = v
						}
					}
				} else if null2 {
					v, rnull := fValueNull(v1)
					if rnull {
						nulls.AddRange(rsVec.GetNulls(), 0, uint64(length))
					} else {
						rowCount := uint64(length)
						for i := uint64(0); i < rowCount; i++ {
							rss[i] = v
						}
					}
				} else {
					v, _ := fValueValue(v1, v2)
					rowCount := uint64(length)
					for i := uint64(0); i < rowCount; i++ {
						rss[i] = v
					}
				}

				return nil
			}

			if c1 {
				v1, null1 := p1.GetValue(0)
				if !null1 {
					if p2.WithAnyNullValue() {
						nulls.Or(


());
      while (scanner.scanChar($comma)) {
        argumentTypes.add(parseType());
      }
    }

    scanner
      ..scan(_whitespace)
      ..expectChar($closeParen)
      ..scan(_whitespace)
      ..expectDone();

    return KnownSqliteFunction(argumentTypes, returnType);
  }

  String toJson() {
    String toString(ResolvedType type) {
      switch (type.type!) {
        case BasicType.nullType:
          return 'NULL';
        case BasicType.int:
          return 'INTEGER';
        case BasicType.real:
          return 'REAL';
        case BasicType.text:
          return 'TEXT';
        case BasicType.blob:
          return 'BLOB';
        case BasicType.any:
          return 'ANY';
      }
    }

    final types = argumentTypes.map(toString).join(', ');
    return '${toString(returnType)}($types)';
  }

  static final _word = RegExp(r'\w+');
  static final _null = RegExp(r'\s+null', caseSensitive: false);
  static final _whitespace = RegExp(r'\s*');
}

class _SqliteVersionConverter extends JsonConverter<SqliteVersion, String> {
  static final _versionRegex = RegExp(r'(\d+)\.(\d+)');

  const _SqliteVersionConverter();

  @override
  SqliteVersion fromJson(String json) {
    final match = _versionRegex.firstMatch(json);
    if (match == null) {
      throw ArgumentError.value(
        json,
        'json',
        'Not a valid sqlite version: Expected format major.minor (e.g. 3.34)',
      );
    }

    final major = int.parse(match.group(1)!);
    final minor = int.parse(match.group(2)!);

    final version = SqliteVersion(major, minor, 0);
    if (version < SqliteVersion.minimum) {
      throw ArgumentError.value(
        json,
        'json',
        'Version is not supported for analysis (minimum is '
            '${SqliteVersion.minimum}).',
      );
    } else if (version > SqliteVersion.current) {
      throw ArgumentError.value(
        json,
        'json',
        'Version is not supported for analysis (current maximum is '
            '${SqliteVersion.current}).',
      );
    }

    return version;
  }

  @override
  String toJson(SqliteVersion object) {
    return '${object.major}.${object.minor}';
  }
}

/// Set of sqlite modules that require special knowledge from the generator.
enum SqlModule {
  /// Enables support for the json1 module and its functions when parsing sql
  /// queries.
  json1,

  /// Enables support for the fts5 module and its functions when parsing sql
  /// queries.
  fts5,

  /// Enables support for mathematical functions only available in `moor_ffi`.
  // note: We're ignoring the warning because we can't change the json key
  // ignore: constant_identifier_names
  moor_ffi,

  /// Enables support for [built in math functions][math funs] when analysing
  /// sql queries.
  ///
  /// [math funs]: https://www.sqlite.org/lang_mathfunc.html
  math,

  /// Enables support for the rtree module and its functions when parsing sql
  /// queries.
  rtree,

  spellfix1,

  /// The Geopoly module is an alternative interface to the R-Tree extension
  /// that uses the GeoJSON notation (RFC-7946)
  /// to describe two-dimensional polygons.
  ///
  /// Geopoly includes functions for detecting
  /// when one polygon is contained within or overlaps with another,
  /// for computing the area enclosed by a polygon
  /// for doing linear transformations of polygons,
  /// for rendering polygons as SVG, an


Status,
        CHUNK_SIZE, WORLD_HEIGHT_CHUNKS,
    },
    comms::RleEncode,
    world_type::GeneratorType,
};
use nalgebra_glm::Vec3;

use crate::{generator::WorldGenerator, world_store::WorldStore};

pub struct ServerWorldHandler {
    store: WorldStore,
    buffer: ChunkBuffer,
    generator: WorldGenerator,
    generate_requests: HashMap<ChunkColumnPos, usize>,
    max_outstanding_work: usize,
    outstanding_work: usize,
}

impl ServerWorldHandler {
    /// Create a new world
    pub fn new(seed: u32, description: &str, world_type: GeneratorType) -> Self {
        ServerWorldHandler {
            store: WorldStore::new(seed, description, world_type),
            buffer: ChunkBuffer::new(),
            generator: WorldGenerator::new(seed, world_type),
            generate_requests: HashMap::new(),
            max_outstanding_work: num_cpus::get() * 2,
            outstanding_work: 0,
        }
    }

    /// Load an existing world
    pub fn load(seed: u32) -> Self {
        let store = WorldStore::load(seed).unwrap();
        let world_type = store.world_def().world_type;
        ServerWorldHandler {
            store,
            buffer: ChunkBuffer::new(),
            generator: WorldGenerator::new(seed, world_type),
            generate_requests: HashMap::new(),
            max_outstanding_work: num_cpus::get() * 2,
            outstanding_work: 0,
        }
    }

    pub fn time_on_start(&self) -> f32 {
        self.store.world_def().gametime
    }

    pub fn get_top_z(&self, wbx: i16, wby: i16) -> i16 {
        self.buffer.get_top_z(wbx, wby)
    }

    pub fn get_block(&mut self, wbx: i16, wby: i16, wbz: i16) -> Block {
        self.buffer.get_block(wbx, wby, wbz)
    }

    pub fn prepare_spawn_area(&mut self, col: ChunkColumnPos, chunk_range: i16) {
        // Load stored columns or put the generator to work
        for cy in col.y - chunk_range..col.y + chunk_range {
            for cx in col.x - chunk_range..col.x + chunk_range {
                let new_col = ChunkColumnPos::new(cx, cy);
                if let Some(chunks) = self.store.load_column(col) {
                    self.buffer
                        .store_column(ChunkColumn::new(col, ColumnStatus::Stored, chunks));
                } else {
                    self.buffer.store_column(ChunkColumn::new(
                        new_col,
                        ColumnStatus::Requested,
                        Vec::new(),
                    ));
                    self.outstanding_work += 1;
                    self.generator.generate(new_col);
                }
            }
        }
        // And wait until the work is done
        while self.outstanding_work > 0 {
            if self.try_get_generated_column(false).is_none() {
                sleep(time::Duration::from_millis(100));
            }
        }
    }

    /// Change a block in the world
    pub fn set_block(&mut self, wbx: i16, wby: i16, wbz: i16, block: Block) {
        let cp = ChunkPos::from_world_pos(Vec3::new(wbx as f32, wby as f32, wbz as f32));
        if cp.z >= 0 && cp.z < WORLD_HEIGHT_CHUNKS as i16 {
            let col = ChunkColumnPos::from_chunk_pos(cp);
            if let Some(column) = self.buffer.get_mut_column(col.x, col.y) {
                let chunk = &mut column.chunks[cp.z as usize];
                chunk.set_block(
                    (wbx - cp.x * CHUNK_SIZE as i16) as usize,
                    (wby - cp.y * CHUNK_SIZE as i16) as usize,
                    (wbz - cp.z * CHUNK_SIZE as i16) as usize,
                    block,
                );


ag-off": F1220,
  "tag-off-outline": F1221,
  "tag-outline": F04FC,
  "tag-plus": F0722,
  "tag-plus-outline": F1222,
  "tag-remove": F0723,
  "tag-remove-outline": F1223,
  "tag-search": F1907,
  "tag-search-outline": F1908,
  "tag-text": F1224,
  "tag-text-outline": F04FD,
  "tailwind": F13FF,
  "tangram": F04F8,
  "tank": F0D3A,
  "tanker-truck": F0FE5,
  "tape-drive": F16DF,
  "tape-measure": F0B4D,
  "target": F04FE,
  "target-account": F0BD0,
  "target-variant": F0A77,
  "taxi": F04FF,
  "tea": F0D9E,
  "tea-outline": F0D9F,
  "teamviewer": F0500,
  "teddy-bear": F18FB,
  "telescope": F0B4E,
  "television": F0502,
  "television-ambient-light": F1356,
  "television-box": F0839,
  "television-classic": F07F4,
  "television-classic-off": F083A,
  "television-guide": F0503,
  "television-off": F083B,
  "television-pause": F0F89,
  "television-play": F0ECF,
  "television-shimmer": F1110,
  "television-stop": F0F8A,
  "temperature-celsius": F0504,
  "temperature-fahrenheit": F0505,
  "temperature-kelvin": F0506,
  "tennis": F0DA0,
  "tennis-ball": F0507,
  "tent": F0508,
  "terraform": F1062,
  "terrain": F0509,
  "test-tube": F0668,
  "test-tube-empty": F0911,
  "test-tube-off": F0912,
  "text": F09A8,
  "text-account": F1570,
  "text-box": F021A,
  "text-box-check": F0EA6,
  "text-box-check-outline": F0EA7,
  "text-box-minus": F0EA8,
  "text-box-minus-outline": F0EA9,
  "text-box-multiple": F0AB7,
  "text-box-multiple-outline": F0AB8,
  "text-box-outline": F09ED,
  "text-box-plus": F0EAA,
  "text-box-plus-outline": F0EAB,
  "text-box-remove": F0EAC,
  "text-box-remove-outline": F0EAD,
  "text-box-search": F0EAE,
  "text-box-search-outline": F0EAF,
  "text-long": F09AA,
  "text-recognition": F113D,
  "text-search": F13B8,
  "text-shadow": F0669,
  "text-short": F09A9,
  "text-to-speech": F050A,
  "text-to-speech-off": F050B,
  "texture": F050C,
  "texture-box": F0FE6,
  "theater": F050D,
  "theme-light-dark": F050E,
  "thermometer": F050F,
  "thermometer-alert": F0E01,
  "thermometer-bluetooth": F1895,
  "thermometer-chevron-down": F0E02,


// dnlib: See LICENSE.txt for more info

using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using dnlib.DotNet.MD;
using dnlib.DotNet.Pdb.Symbols;
using dnlib.IO;
using dnlib.PE;

namespace dnlib.DotNet.Pdb.Portable {
	static class SymbolReaderFactory {
		public static SymbolReader TryCreate(PdbReaderContext pdbContext, DataReaderFactory pdbStream, bool isEmbeddedPortablePdb) {
			bool disposePdbStream = true;
			try {
				if (!pdbContext.HasDebugInfo)
					return null;
				if (pdbStream is null)
					return null;
				if (pdbStream.Length < 4)
					return null;
				if (pdbStream.CreateReader().ReadUInt32() != 0x424A5342)
					return null;

				var debugDir = pdbContext.CodeViewDebugDirectory;
				if (debugDir is null)
					return null;
				// Don't check that debugDir.MinorVersion == PortablePdbConstants.PortableCodeViewVersionMagic
				// and debugDir.MajorVersion == PortablePdbConstants.FormatVersion since it could be a converted
				// WindowsPDB file: https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/specs/PE-COFF.md#codeview-debug-directory-entry-type-2
				if (!pdbContext.TryGetCodeViewData(out var pdbGuid, out uint age))
					return null;

				var reader = new PortablePdbReader(pdbStream, isEmbeddedPortablePdb ? PdbFileKind.EmbeddedPortablePDB : PdbFileKind.PortablePDB);
				if (!reader.MatchesModule(pdbGuid, debugDir.TimeDateStamp, age))
					return null;
				disposePdbStream = false;
				return reader;
			}
			catch (IOException) {
			}
			finally {
				if (disposePdbStream)
					pdbStream?.Dispose();
			}
			return null;
		}

		public stat


")
      }
      println("child end")
    }

    println("Parent end")
  }
}package com.hsicen.a05_cooperate

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlin.coroutines.EmptyCoroutineContext

/******====== 65.协程间的协作和等待 ======******/
/**
 * 1.使用 Job.join() 挂起当前协程，直到调用join的协程结束
 * 2.使用 Defer.await() 挂起当前协程，直到调用await的协程结束
 * 3.CountDownLatch 等待多个协程结束
 */
fun main(): Unit = runBlocking {
    test1()
    delay(5000)
}

private fun test1() {
    val scope = CoroutineScope(EmptyCoroutineContext)
    val stateFlow = MutableStateFlow(0)

    scope.launch {
        delay(100)
        stateFlow.emit(1)

        delay(100)
        stateFlow.emit(2)

        delay(100)
        stateFlow.emit(3)

        delay(100)
        stateFlow.emit(4)
    }

    stateFlow.onEach {
        println("Flow1: $it")
    }.launchIn(scope)
}
package com.hsicen.a29_hotfix

import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.hsicen.a29_hotfix.databinding.ActivityMainBinding
import dalvik.system.BaseDexClassLoader
import dalvik.system.PathClassLoader
import okio.buffer
import okio.sink
import okio.source
import java.io.File

class MainActivity : AppCompatActivity() {
    private lateinit var mBinding: ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(mBinding.root)

        mBinding.showTitleBt.setOnClickListener {
            mBinding.titleTv.text = Title().getTitle()
        }

        //从网络下载文件保存到缓存目录
        mBinding.hotfixBt.setOnClickListener {
            //loadHotfixDex()
        }

        mBinding.removeHotfixBt.setOnClickListener {
            //删除文件
        }

        mBinding.killSelfBt.setOnClickListener {
            android.os.Process.killProcess(android.os.Process.myPid())
        }
    }

    /*** 全量更新，加载整个apk文件*/
    private fun loadHotfixDex() {
        try {//复制apk文件(生产环境是从网络下载dex文件)
            val apk = File("$cacheDir/29_hotfix.apk")
            assets.open("apk/hotfix.apk").source().use {
                apk.sink().buffer().writeAll(it)
            }

            try {
                val loaderClass = BaseDexClassLoader::class.java
                val pathListField = loaderClass.getDeclaredField("pathList")
                pathListField.isAccessible = true

                val pathListObject = pathListField.get(classLoader) // getClassLoader().pathList
                val pathListClass = pathListObject.javaClass
                val dexElementsField = pathListClass.getDeclaredField("dexElements")
                dexElementsField.isAccessible = true

                val dexElementsObject = dexElementsField.get(pathListObject)
                val newClassLoader = PathClassLoader(apk.path, null)
                val newPathListObject = pathListField.get(newClassL


C 60 80 48 */	lis r3, lbl_80484070@ha
/* 80244550 00241490  38 04 1A E8 */	addi r0, r4, __vt__Q34Game4Cave10RandMapMgr@l
/* 80244554 00241494  38 80 00 00 */	li r4, 0
/* 80244558 00241498  90 1E 00 00 */	stw r0, 0(r30)
/* 8024455C 0024149C  38 03 40 70 */	addi r0, r3, lbl_80484070@l
/* 80244560 002414A0  7F C3 F3 78 */	mr r3, r30
/* 80244564 002414A4  90 9E 00 18 */	stw r4, 0x18(r30)
/* 80244568 002414A8  90 9E 00 1C */	stw r4, 0x1c(r30)
/* 8024456C 002414AC  90 9E 00 20 */	stw r4, 0x20(r30)
/* 80244570 002414B0  90 9E 00 24 */	stw r4, 0x24(r30)
/* 80244574 002414B4  90 9E 00 28 */	stw r4, 0x28(r30)
/* 80244578 002414B8  90 9E 00 2C */	stw r4, 0x2c(r30)
/* 8024457C 002414BC  90 9E 00 30 */	stw r4, 0x30(r30)
/* 80244580 002414C0  90 9E 00 34 */	stw r4, 0x34(r30)
/* 80244584 002414C4  90 9E 00 38 */	stw r4, 0x38(r30)
/* 80244588 002414C8  98 9E 00 3C */	stb r4, 0x3c(r30)
/* 8024458C 002414CC  90 9E 00 40 */	stw r4, 0x40(r30)
/* 80244590 002414D0  9B FE 00 44 */	stb r31, 0x44(r30)
/* 80244594 002414D4  90 1E 00 14 */	stw r0, 0x14(r30)
/* 80244598 002414D8  83 E1 00 0C */	lwz r31, 0xc(r1)
/* 8024459C 002414DC  83 C1 00 08 */	lwz r30, 8(r1)
/* 802445A0 002414E0  80 01 00 14 */	lwz r0, 0x14(r1)
/* 802445A4 002414E4  7C 08 03 A6 */	mtlr r0
/* 802445A8 002414E8  38 21 00 10 */	addi r1, r1, 0x10
/* 802445AC 002414EC  4E 80 00 20 */	blr
.endfn __ct__Q34Game4Cave10RandMapMgrFb

.fn loadResource__Q34Game4Cave10RandMapMgrFPQ24Game16MapUnitInterfaceiPQ34Game4Cave9FloorInfobPQ34Game4Cave11EditMapUnit, global
/* 802445B0 002414F0  94 21 FF E0 */	stwu r1, -0x20(r1)
/* 802445B4 002414F4  7C 08 02 A6 */	mflr r0
/* 802445B8 002414F8  90 01 00 24 */	stw r0, 0x24(r1)
/* 802445BC 002414FC  BF 41 00 08 */	stmw r26, 8(r1)
/* 802445C0 00241500  7C 7F 1B 78 */	mr r31, r3
/* 802445C4 00241504  7C 9A 23 78 */	mr r26, r4
/* 802445C8 00241508  7C BB 2B 78 */	mr r27, r5
/* 802445CC 0024150C  7C DC 33 78 */	mr r28, r


# -*- coding: utf-8 -*-
# Copyright (c) Louis Brulé Naudet. All Rights Reserved.
# This software may be used and distributed according to the terms of License Agreement.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import (
    IO,
    TYPE_CHECKING,
    Any,
    Dict,
    List,
    Type,
    Tuple,
    Union,
    Mapping,
    TypeVar,
    Callable,
    Optional,
    Sequence,
)

from googleapiclient.discovery import build

class GoogleSearch:
    """
    A class to interact with the Google Custom Search API.

    Attributes
    ----------
    developer_key : str
        The developer key for accessing the API.

    cx : str
        The custom search engine ID.

    service : object
        The service object for interacting with the API.

    Methods
    -------
    __init__(developer_key, cx)
        Initializes the GoogleSearch object with the developer key and custom search engine ID (CX).

    search(query)
        Perform a Google search using the Custom Search API.
    """
    def __init__(
        self,
        developer_key:str,
        cx:str
    ) -> None:
        """
        Initializes the GoogleSearch object.

        Parameters
        ----------
        developer_key : str
            The developer key for accessing the API.

        cx : str
            The custom search engine ID.
        """
        self.service = build(
            "customsearch",
            "v1",
            developerKey=developer_key
        )

        self.cx = cx

    def search(
        self,
        query:str
    ) -> list:
        """
        Perform a Google search using the Custom Search API.

        Parameters
        ----------
        query : str
            The search query.

        Returns
        -------
        list
            A list of search results as dictionaries.
        """
        try:
            # Execute the search query
            res = self.service.cse().list(
                q=query,
                cx=self.cx
            ).execute()

            # Return the search results
            return res.get('items', [])

        except Exception as e:
            # Handle exceptions gracefully
            print(f"An error occurred: {e}")
            return []


= 80812BE8
/* 05A34 80809774 8F050000 */  lw      $a1, 0x0000($t8)           ## 00000000
/* 05A38 80809778 0C00084C */  jal     osSyncPrintf

/* 05A3C 8080977C 24A50002 */  addiu   $a1, $a1, 0x0002           ## $a1 = 00000002
/* 05A40 80809780 3C048081 */  lui     $a0, %hi(D_80812C08)       ## $a0 = 80810000
/* 05A44 80809784 24842C08 */  addiu   $a0, $a0, %lo(D_80812C08)  ## $a0 = 80812C08
/* 05A48 80809788 0C00084C */  jal     osSyncPrintf

/* 05A4C 8080978C 9205140A */  lbu     $a1, 0x140A($s0)           ## 8015FA6A
/* 05A50 80809790 3C048081 */  lui     $a0, %hi(D_80812C24)       ## $a0 = 80810000
/* 05A54 80809794 24842C24 */  addiu   $a0, $a0, %lo(D_80812C24)  ## $a0 = 80812C24
/* 05A58 80809798 0C00084C */  jal     osSyncPrintf

/* 05A5C 8080979C 9205140A */  lbu     $a1, 0x140A($s0)           ## 8015FA6A
/* 05A60 808097A0 3C048081 */  lui     $a0, %hi(D_80812C40)       ## $a0 = 80810000
/* 05A64 808097A4 24842C40 */  addiu   $a0, $a0, %lo(D_80812C40)  ## $a0 = 80812C40
/* 05A68 808097A8 0C00084C */  jal     osSyncPrintf

/* 05A6C 808097AC 9205140A */  lbu     $a1, 0x140A($s0)           ## 8015FA6A
/* 05A70 808097B0 3C048081 */  lui     $a0, %hi(D_80812C5C)       ## $a0 = 80810000
/* 05A74 808097B4 0C00084C */  jal     osSyncPrintf

/* 05A78 808097B8 24842C5C */  addiu   $a0, $a0, %lo(D_80812C5C)  ## $a0 = 80812C5C
/* 05A7C 808097BC 0C03D9C0 */  jal     func_800F6700
/* 05A80 808097C0 8204140A */  lb      $a0, 0x140A($s0)           ## 8015FA6A
/* 05A84 808097C4 3C048081 */  lui     $a0, %hi(D_80812C60)       ## $a0 = 80810000
/* 05A88 808097C8 0C00084C */  jal     osSyncPrintf

/* 05A8C 808097CC 24842C60 */  addiu   $a0, $a0, %lo(D_80812C60)  ## $a0 = 80812C60
/* 05A90 808097D0 10000079 */  beq     $zero, $zero, .L808099B8
/* 05A94 808097D4 8FBF0024 */  lw      $ra, 0x0024($sp)
.L808097D8:
/* 05A98 808097D8 34218000 */  ori     $at, $at, 0x8000           ## $at = 00008000
/* 05A9C 808097DC 02011821 */  addu    $v1, $s0, $at
/* 05AA0 808097E0 84624ABA */  lh      $v0, 0x4ABA($v1)           ## 00004ABA
/* 05AA


       return "WalletMobileClientDebugMode";
      case UnleashFeature.walletEarlyAccess:
        return "WalletEarlyAccess";
      case UnleashFeature.disableBuyMobile:
        return "DisableBuyMobile";
      case UnleashFeature.importPaperWallet:
        return "ImportPaperWallet";
      case UnleashFeature.walletBackupAlert:
        return "WalletBackupAlert";
      case UnleashFeature.inAppReviewFreeUser:
        return "InAppReviewFreeUser";
      case UnleashFeature.walletMessageSigner:
        return "WalletMessageSigner";
      case UnleashFeature.walletExportTransaction:
        return "WalletExportTransaction";
    }
  }

  /// Returns the default toggle configuration for the feature, if applicable
  ToggleConfig? get defaultValue {
    switch (this) {
      case UnleashFeature.disableBuyMobile:
        return ToggleConfig(
          enabled: true,
          impressionData: false,
          variant: Variant(enabled: false, name: 'disabled'),
        );
      default:
        return null;
    }
  }
}

class UnleashDataProvider extends DataProvider {
  /// Unleash client for feature toggles
  late final UnleashClient unleashClient;

  /// API client for feature flags
  final FrbUnleashClient frbUnleashClient;

  /// API environment configuration
  final ApiEnv apiEnv;

  /// refresh interval
  final duration = const Duration(minutes: 2).inSeconds;

  /// Timer for periodic refresh
  Timer? refreshTimer;

  UnleashDataProvider(this.apiEnv, this.frbUnleashClient) {
    final hostApiPath = apiEnv.apiPath;
    const appName = 'ProtonWallet';
    unleashClient = UnleashClient(
        url: Uri.parse('$hostApiPath/feature/v2/frontend'),
        clientKey: '-',
        appName: appName,
        refreshInterval: duration,
        disableMetrics: true,
        disableRefresh: true,
        bootstrapOverride: false,
        bootstrap: getDefaultToggles(),
        fetcher: (http.Request request) async {
          final response = await frbUnleashClient.fetchToggles();
          return http.Response.bytes(
            response.body.toList(),
            response.statusCode,
          );
        });
    setupUnleashListeners();
  }

  /// Sets up Unleash event listeners
  void setupUnleashListeners() {
    unleashClient.on('ready', (value) {
      if (unleashClient.isEnabled('WalletFirstFlag')) {
        logger.i('WalletFirstFlag is enabled');
      } else {
        logger.i('WalletFirstFlag is disabled');
      }
    });

    unleashClient.on('error', (error) {
      logger.e('UnleashClient Error: $error');
    });

    unleashClient.on('initialized', (value) {
      logger.i('UnleashClient initialized: $value');
    });

    unleashClient.on('update', (value) {
      logger.i('UnleashClient update: $value');
    });

    unleashClient.on('impression', (value) {
      logger.i('UnleashClient impression: $value');
    });
  }

  /// Starts the Unleash client and sets up auto-refresh
  Future<void> start() async {
    await unleashClient.start();
    startPeriodicRefresh();
  }

  /// Starts periodic refresh if not already running
  void startPeriodicRefresh() {
    if (refreshTimer == null || !refreshTimer!.isActive) {
      refreshTimer = Timer.periodic(
        Duration(seconds: duration),
        (_) => unleashClient.start(),
      );
    }
  }

  /// Stops and cleans up resources
  @override


	);
		auto LiveCostumeChangeView_setIdolCostume_addr = il2cpp_symbols::get_method_pointer(
			"PRISM.Interactions.Live.dll", "PRISM.Interactions",
			"LiveCostumeChangeView", "_setIdolCostume", 3
		);

		LiveCostumeChangeModel_get_Idol = reinterpret_cast<decltype(LiveCostumeChangeModel_get_Idol)>(il2cpp_symbols::get_method_pointer(
			"PRISM.Adapters.dll", "PRISM.Adapters",
			"LiveCostumeChangeModel", "get_Idol", 0
		));

		auto LiveCostumeChangeModel_GetDress_addr = il2cpp_symbols::get_method_pointer(
			"PRISM.Adapters.dll", "PRISM.Adapters",
			"LiveCostumeChangeModel", "GetDress", 1
		);
		auto LiveCostumeChangeModel_GetHairstyle_addr = il2cpp_symbols::get_method_pointer(
			"PRISM.Adapters.dll", "PRISM.Adapters",
			"LiveCostumeChangeModel", "GetHairstyle", 1
		);
		auto LiveCostumeChangeModel_GetAccessory_addr = il2cpp_symbols::get_method_pointer(
			"PRISM.Adapters.dll", "PRISM.Adapters",
			"LiveCostumeChangeModel", "GetAccessory", 1
		);
		auto LiveCostumeChangeModel_ctor_addr = il2cpp_symbols::get_method_pointer(
			"PRISM.Adapters.dll", "PRISM.Adapters",
			"LiveCostumeChangeModel", ".ctor", 4
		);

		auto AssembleCharacter_ApplyParam_addr = il2cpp_symbols::get_method_pointer(
			"PRISM.Legacy.dll", "PRISM",
			"AssembleCharacter", "ApplyParam", 6
		);
		/*
		auto AssembleCharacter_ApplyParam_addr = il2cpp_symbols::find_method("PRISM.Legacy.dll", "PRISM", "AssembleCharacter", [=](const MethodInfo* mtd) {
			const std::string mtdName = mtd->name;

			if ((mtdName == "ApplyParam") && (mtd->parameters_count == 6)) {
				if (mtd->methodPointer != AssembleCharacter_ApplyParam_mdl_addr) {
					return true;
				}
			}

			return false;
			});*/

		auto MainThreadDispatcher_LateUpdate_addr = il2cpp_symbols::get_method_pointer(
			"UniRx.dll", "UniRx",
			"MainThreadDispatcher", "LateUpdate", 0
		);

		auto LiveMVUnit_GetMemberChangeRequestData_addr = il2cpp_symbols::get_method_pointer(
			"PRISM.Legacy.dll", "PRISM.Live",
			"LiveMVUnit", "GetMemberChangeRequestData", 3
		);

		auto LiveMVUnitMemberChangePresenter_klass = il2cpp_symbols::get_class("PRISM.Adapters.dll", "PRISM.Adapters", "LiveMvUnitMemberChangePresenter");
		auto LiveMVUnitMemberChangePresenter_c__DisplayClass7_0_klass
			= il2cpp_symbols::find_nested_class_from_name(LiveMVUnitMemberChangePresenter_klass, "<>c__DisplayClass5_0");
		auto LiveMVUnitMemberChangePresenter_c__DisplayClass7_0_klass_initializeAsync_b__4_d_klass
			= il2cpp_symbols::find_nested_class_from_name(LiveMVUnitMemberChangePresenter_c__DisplayClass7_0_klass, "<<InitializeAsync>b__0>d");
		auto LiveMVUnitMemberChangePresenter_initializeAsync_b_4_MoveNext_method =
			il2cpp_class_get_method_from_name(LiveMVUnitMemberChangePresenter_c__DisplayClass7_0_klass_initializeAsync_b__4_d_kla


string(bs)]; ok {
				if firstParamChange {
					orig := path.Parameters
					path.Parameters = make([]spec.Parameter, len(orig))
					copy(path.Parameters, orig)
					firstParamChange = false
				}

				path.Parameters[i] = spec.Parameter{
					Refable: spec.Refable{
						Ref: spec.MustCreateRef("#/parameters/" + name),
					},
				}
				pathChanged = true
			}
		}

		if pathChanged {
			if firstPathChange {
				clone := *sp
				ret = &clone

				pathsClone := *ret.Paths
				ret.Paths = &pathsClone

				ret.Paths.Paths = make(map[string]spec.PathItem, len(sp.Paths.Paths))
				for k, v := range sp.Paths.Paths {
					ret.Paths.Paths[k] = v
				}

				firstPathChange = false
			}
			ret.Paths.Paths[k] = path
		}
	}

	return ret, nil
}
/*
Copyright 2019 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package drain

import (
	"context"
	"fmt"
	"strings"
	"time"

	appsv1 "k8s.io/api/apps/v1"
	corev1 "k8s.io/api/core/v1"
	apierrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
	daemonSetFatal      = "DaemonSet-managed Pods (use --ignore-daemonsets to ignore)"
	daemonSetWarning    = "ignoring DaemonSet-managed Pods"
	localStorageFatal   = "Pods with local storage (use --delete-emptydir-data to override)"
	localStorageWarning = "deleting Pods with local storage"
	unmanagedFatal      = "cannot delete Pods that declare no controller (use --force to override)"
	unmanagedWarning    = "deleting Pods that declare no controller"
)

// PodDelete informs filtering logic whether a pod should be deleted or not
type PodDelete struct {
	Pod    corev1.Pod
	Status PodDeleteStatus
}

// PodDeleteList is a wrapper around []PodDelete
type PodDeleteList struct {
	items []PodDelete
}

// Pods returns a list of all pods marked for deletion after filtering.
func (l *PodDeleteList) Pods() []corev1.Pod {
	pods := []corev1.Pod{}
	for _, i := range l.items {
		if i.Status.Delete {
			pods = append(pods, i.Pod)
		}
	}
	return pods
}

// Warnings returns all warning messages concatenated into a string.
func (l *PodDeleteList) Warnings() string {
	ps := make(map[string][]string)
	for _, i := range l.items {
		if i.Status.Reason == PodDeleteStatusTypeWarning {
			ps[i.Status.Message] = append(ps[i.Status.Message], fmt.Sprintf("%s/%s", i.Pod.Namespace, i.Pod.Name))
		}
	}

	msgs := []string{}
	for key, pods := range ps {
		msgs = append(msgs, fmt.Sprintf("%s: %s", key, strings.Join(pods, ", ")))
	}
	return strings.Join(msgs, "; ")
}

func (l *PodDeleteList) errors() []error {
	failedPods := make(map[string][]string)
	for _, i := range l.items {
		if i.Status.Reason == PodDeleteStatusTypeError {
			msg := i.Status.Message


-control-input-info.custom-control-input-outline:checked[type=checkbox]~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%2317a2b8' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")!important}.custom-control-input-info.custom-control-input-outline:checked[type=radio]~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%2317a2b8'/%3E%3C/svg%3E")!important}.custom-control-input-info:focus~.custom-control-label::before{box-shadow:inset 0 0 0 transparent,0 0 0 .2rem rgba(23,162,184,.25)}.custom-control-input-info:focus:not(:checked)~.custom-control-label::before{border-color:#63d9ec}.custom-control-input-info:not(:disabled):active~.custom-control-label::before{background-color:#90e4f1;border-color:#90e4f1}.custom-control-input-warning:checked~.custom-control-label::before{border-color:#ffc107;background-color:#ffc107}.custom-control-input-warning.custom-control-input-outline:checked[type=checkbox]~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23ffc107' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")!important}.custom-control-input-warning.custom-control-input-outline:checked[type=radio]~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23ffc107'/%3E%3C/svg%3E")!important}.custom-control-input-warning:focus~.custom-control-label::before{box-shadow:inset 0 0 0 transparent,0 0 0 .2rem rgba(255,193,7,.25)}.custom-control-input-warning:focus:not(:checked)~.custom-control-label::before{border-color:#ffe187}.custom-control-input-warning:not(:disabled):active~.custom-control-label::before{background-color:#ffeeba;border-color:#ffeeba}.custom-control-input-danger:checked~.custom-control-label::before{border-color:#dc3545;background-color:#dc3545}.custom-control-input-danger.custom-control-input-outline:checked[type=checkbox]~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23dc3545' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")!important}.custom-control-input-danger.custom-control-input-outline:checked[type=radio]~.custom-control


err(io::Error::from_raw_os_error)
                        .context("snp::enarxcall deref")?
                };
                let mut vcek_reader = get_vcek_reader()?;
                *ret = std::io::copy(&mut vcek_reader, &mut vcek_buf)? as _;
                if *ret == 0 {
                    bail!("Could not get SEV-SNP vcek! Run `enarx snp vcek update`")
                }
                Ok(None)
            }
            _ => return Ok(Some(Item::Enarxcall(enarxcall, data))),
        }
    }
}

pub struct Backend;

impl super::Backend for Backend {
    #[inline]
    fn name(&self) -> &'static str {
        "sev"
    }

    #[inline]
    fn shim(&self) -> &'static [u8] {
        super::kvm::Backend.shim()
    }

    #[inline]
    fn have(&self) -> bool {
        self.data().iter().all(|x| x.pass)
    }

    fn data(&self) -> Vec<super::Datum> {
        let mut data = vec![
            system_info(),
            dev_sev(),
            sev_enabled_in_kernel(),
            dev_sev_readable(),
            dev_sev_writable(),
            dev_kvm(),
            kvm_version(),
            has_reasonable_memlock_rlimit(),
        ];
        data.extend(CPUIDS.iter().map(|c| c.into()));
        data
    }

    #[inline]
    fn keep(&self, shim: &[u8], exec: &[u8]) -> Result<Arc<dyn super::Keep>> {
        builder::Builder::load(shim, exec)
    }

    #[inline]
    fn hash(&self, _shim: &[u8], _exec: &[u8]) -> Result<Vec<u8>> {
        Ok(Vec::new())
    }
}
<gh_stars>0
pub mod lookup;
pub mod random;
pub mod related;

pub mod session;
pub mod types;

mod constants;

#[cfg(test)]
mod tests {}
use std::str;
use std::{io, net::UdpSocket};
fn main() -> io::Result<()> {
    let socket = UdpSocket::bind("127.0.0.1:8000")?;
    socket.connect("127.0.0.1:8080")?;
    loop {
        let mut input = String::new();
        io::stdin().read_line(&mut input)?;
        socket.send(input.as_bytes())?;
        let mut buf = [0u8; 1024];
        socket.recv_from(&mut buf)?;
        println!(
            "recieve from server:{}",
            str::from_utf8(&buf).expect("could not write byte with string")
        );
    }
}
use crate::{ParamConductivity, StrError};
use russell_tensor::Tensor2;

pub struct ModelConductivity {
    // for constant, linear or pedroso-zhang-ehlers models
    kk_sat: Tensor2,

    // for constant model
    is_constant: bool,

    // for linear model
    is_linear: bool,
    lambda: f64,

    // for pedroso-zhang-ehlers model
    lambda_0: f64,
    lambda_1: f64,
    alpha: f64,
    beta: f64,
    b: f64,
    c1: f64,
    c2: f64,
    c3: f64,
}

impl ModelConductivity {
    pub fn new(params: &ParamConductivity, two_dim: bool) -> Result<Self, StrError> {
        let mut model = ModelConductivity {
            kk_sat: Tensor2::new(true, two_dim),
            is_constant: false,
            is_linear: false,
            lambda: 0.0,
            lambda_0: 0.0,
            lambda_1: 0.0,
            alpha: 0.0,
            beta: 0.0,
            b: 0.0,
            c1: 0.0,
            c2: 0.0,
            c3: 0.0,
        };
        let (kx, ky, kz) = match params {
            &ParamConductivity::Constant { kx, ky,


canner object"));
					scanner = Scanner.open(Common.mainActivity);
				}
				catch (IllegalArgumentException e)
				{
					Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "1 Cannot instantiate scanner"));
				}
				catch (IllegalAccessException e)
				{
					Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "2 Cannot instantiate scanner"));
				}
				catch (InvocationTargetException e)
				{
					Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "3 Cannot instantiate scanner"));
				}
			}
			else
			{
				Common.logger.add(new LogEntry(LogEntry.PB_LOG_INFO, "opening Scanner object"));
				scanner = Scanner.open(Common.mainActivity);
			}

			currentUser.setScannerEnabled(true);
			Scanner.registerScanEventCallback(EmdkScannerServiceRebranded.this, scanner);
			Common.elementsCore.setScannerEnabled(true);

			try
			{
				Method enableMethod = scannerClass.getMethod("enable", null);
				enableMethod.invoke(scanner, new Object[] {});
			}
			catch(NoSuchMethodException e)
			{
				Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "Old BSP. Ignoring internal enable"));
			}
			catch (IllegalArgumentException e)
			{
				Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "1 Cannot enable scanner"));
			}
			catch (IllegalAccessException e)
			{
				Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "2 Cannot enable scanner"));
			}
			catch (InvocationTargetException e)
			{
				Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "3 Cannot enable scanner"));
			}
			catch (NullPointerException e)
			{
				Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "4 Cannot enable scanner"));
			}

		}
		catch (ClassNotFoundException e)
		{
			Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "Cannot find scanner class"));
		}
	}

	private void disable(ScannerUser currentUser)
	{
		//If its on the openStack
		synchronized(openStack)
		{
			for(int j = 0; j < openStack.size(); j++)
			{
				IScannerClient testClient = openStack.get(j).getClient();
				if(testClient.equals(currentUser.getClient()))
				{
					currentUser.setScannerEnabled(false);

					int stackSize = openStack.size();
					if(stackSize == 1)
					{
						Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "Removing open scanner user: clear"));
						openStack.clear();
						try {scanner.stopScanning(); /*TODO is this sensible?*/}
						catch (NullPointerException e) {Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, e.getMessage()));}
						Common.elementsCore.setScannerEnabled(false);
					}
					else if(stackSize > 1)
					{
						Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "Removing open scanner user"));
						openStack.remove(stackSize - 1);
						try
						{
							scanner.setParameters(openStack.get(stackSize -2).getParameters()); //TODO why -2?
						}
						catch (ScannerExceptions e)
						{
							Common.logger.add(new LogEntry(LogEntry.PB_LOG_WARNING, "Unsuccessful scanner parameter change: " + e.getMessage()));
						}
					}

					try
					{

						Class scannerClass = Class.forName("com.symbol.scanning.Scanner");
						try
						{
							Method disableMethod = scannerClass.getMethod("disable


        // 检查冷却时间
        if (isInErrorCooldown("search")) {
            return Mono.delay(Duration.ofMillis(ERROR_THRESHOLD_MS))
                    .flatMapMany(tick -> search(queryVector, filter, limit));
        }

        log.info("搜索向量，过滤条件: {}, 限制: {}", filter, limit);

        Mono<List<SearchResult>> operation = Mono.fromCallable(() -> {
            try {
                // 验证并可能调整向量维度
                float[] adjustedVector = validateAndAdjustEmbeddingDimension(queryVector);

                // 创建查询嵌入
                Embedding queryEmbedding = Embedding.from(adjustedVector);

                // 提取关键词列表（如果有）
                List<String> keywords = null;
                if (filter != null && filter.containsKey("keywords")) {
                    Object keywordsObj = filter.get("keywords");
                    if (keywordsObj instanceof List<?>) {
                        @SuppressWarnings("unchecked")
                        List<String> casted = (List<String>) keywordsObj;
                        keywords = casted;
                        log.info("提取到关键词列表用于过滤: {}", keywords);
                    }
                }

                // 创建过滤条件的元数据（移除keywords字段，它不是标准元数据）
                final Map<String, Object> metadataFilter;
                if (filter != null) {
                    metadataFilter = new HashMap<>(filter);
                    metadataFilter.remove("keywords");
                } else {
                    metadataFilter = null;
                }

                // TODO: 这里应该使用metadataFilter进行精确过滤，但当前ChromaEmbeddingStore不支持
                // 目前我们先检索更多结果，然后在后处理中进行过滤

                // 执行搜索 - 使用新的搜索API
                EmbeddingSearchRequest searchRequest = EmbeddingSearchRequest.builder()
                        .queryEmbedding(queryEmbedding)
                        .maxResults(limit * 4) // 多检索一些结果以便后处理过滤
                        .build();

                EmbeddingSearchResult<TextSegment> searchResult = embeddingStore.search(searchRequest);
                List<EmbeddingMatch<TextSegment>> matches = searchResult.matches();

                // 转换结果
                List<SearchResult> results = matches.stream()
                        .map(match -> {
                            SearchResult result = new SearchResult();
                            result.setContent(match.embedded().text());
                            result.setScore(match.score());

                            // 提取元数据
                            Metadata metadata = match.embedded().metadata();
                            if (metadata != null) {
                                Map<String, Object> resultMetadata = metadata.toMap();
                                result.setMetadata(resultMetadata);

                                // 设置ID（如果存在）
                                if (resultMetadata.containsKey("id")) {
                                    result.setId(String.valueOf(resultMetadata.get("id")));
                                }
                            }

                            return result;
                        })
                        .collect(Collectors.toList());

                // 应用元数据过滤
                if (metadataFilter != null && !metadataFilter.isEmpty()) {
                    results = results.stream()
                            .filter(result -> {
                                if (result.getMetadata() == null) {
                                    return false;
                                }

                                return metadataFilter.entrySet().stream()
                                        .allMatch(entry -> {
                                            Object value = result.getMetadata().get(entry.getKey());
                                            return value != null && value.equals(entry.getValue());
                                        });
                            })
                            .collect(Collectors.toList());

                    log.info("元数据过滤后剩余结果数量: {}", results.size());
                }


458109048] = "hei_id1_20_critical_0",
	[2670183552] = "vw_vwint03_light_fixture123",
	[4131505284] = "par_spoiler_f",
	[3182281867] = "bd2_rollcage2",
	[2380776588] = "grow_mir_ac_l",
	[2809906320] = "yose2_dechrome_a",
	[2116011153] = "cerb_spear_f_l",
	[2699019410] = "itali2_bumperf_q",
	[27116694] = "bh1_32_strm_0",
	[1326564510] = "knjosj_skirt_3",
	[1935918239] = "hei_vb_07_strm_0",
	[1489618087] = "sem2_arch_a1",
	[2685781169] = "v_49_tat2emissives",
	[82166963] = "sf_int1_art1_mainrm",
	[3814835388] = "pey3_wheel_2",
	[1791739082] = "ch_chint02_penetrator_neon",
	[3908420816] = "ch_chint08_sec_screen_01",
	[3032728796] = "v_13_rec_main_deta",
	[2195309809] = "lr_id1_19",
	[1684129022] = "pentr_exh_1",
	[3369714949] = "hei_genbank_dlc_depbox02",
	[2748391013] = "ch_chint03_tool_box_01a",
	[772916492] = "sf_mpapyacht_stairslamps",
	[351913230] = "h4_mph4_island",
	[113231119] = "hei_ch2_03c_strm_1",
	[1662108951] = "bkr_barpipes01",
	[2135278877] = "dom8_hlightr2_b",
	[1361560881] = "ch_chint08_sec_elec01",
	[2025702709] = "wheel_4smod5b",
	[2289550647] = "wheel_2smod25",
	[3793601849] = "prev_bucketc2_smod",
	[3381380411] = "cerb2_lvl1_door_rf",
	[3896100162] = "ex_office2c_rug",
	[2148648259] = "ch1_06b_strm_1",
	[3550008665] = "dom6_door_2l",
	[3530540359] = "hei_ss1_08_strm_0",
	[3872638280] = "buff4_wing_2a",
	[3804480841] = "jug_splita",
	[1417052720] = "h4_mpapyacht_glass03",
	[3272066391] = "metro_newwaldoors",
	[3622815068] = "cs1_13",
	[2956969310] = "apa_dining_art_new",
	[3136144736] = "bkr_ware05_laptop",
	[4078814563] = "reevr_vis_1a",
	[949339492] = "cheb_bumf_b",
	[2939667814] = "ts2_aabarrel",
	[2215757159] = "sab2_wing_1",
	[2713568621] = "apa_mp_h_05_entry_details",
	[658359664] = "sf_int1_art1_operations",
	[604226929] = "hei_ch3_12_casino_aircon",
	[1517405555] = "vtc_bucketa


(),
            len,
        }
    }
}

impl<I> IntoSTLIterator for I
where
    I: IntoIterator<Item = STLFace>,
    I::IntoIter: ExactSizeIterator,
{
    type IntoIter = I::IntoIter;
    fn into_iter(self) -> I::IntoIter { self.into_iter() }
}

fn signup_vector(vector: [f32; 3], map: &mut HashMap<[i64; 3], usize>) -> usize {
    let vector = [
        ((vector[0] as f64 + TOLERANCE * 0.25) / (TOLERANCE * 0.5)) as i64,
        ((vector[1] as f64 + TOLERANCE * 0.25) / (TOLERANCE * 0.5)) as i64,
        ((vector[2] as f64 + TOLERANCE * 0.25) / (TOLERANCE * 0.5)) as i64,
    ];
    let len = map.len();
    *map.entry(vector).or_insert_with(|| len)
}

impl FromIterator<STLFace> for PolygonMesh {
    fn from_iter<I: IntoIterator<Item = STLFace>>(iter: I) -> PolygonMesh {
        let mut positions = HashMap::<[i64; 3], usize>::default();
        let mut normals = HashMap::<[i64; 3], usize>::default();
        let faces: Vec<[Vertex; 3]> = iter
            .into_iter()
            .map(|face| {
                let n = signup_vector(face.normal, &mut normals);
                let p = [
                    signup_vector(face.vertices[0], &mut positions),
                    signup_vector(face.vertices[1], &mut positions),
                    signup_vector(face.vertices[2], &mut positions),
                ];
                [
                    (p[0], None, Some(n)).into(),
                    (p[1], None, Some(n)).into(),
                    (p[2], None, Some(n)).into(),
                ]
            })
            .collect();
        let faces = Faces::from_tri_and_quad_faces(faces, Vec::new());
        let mut positions: Vec<([i64; 3], usize)> = positions.into_iter().collect();
        positions.sort_by(|a, b| a.1.cmp(&b.1));
        let positions: Vec<Point3> = positions
            .into_iter()
            .map(|(p, _)| {
                Point3::new(
                    p[0] as f64 * TOLERANCE * 0.5,
                    p[1] as f64 * TOLERANCE * 0.5,
                    p[2] as f64 * TOLERANCE * 0.5,
                )
            })
            .collect();
        let mut normals: Vec<([i64; 3], usize)> = normals.into_iter().collect();
        normals.sort_by(|a, b| a.1.cmp(&b.1));
        let normals: Vec<Vector3> = normals
            .into_iter()
            .map(|(p, _)| {
                Vector3::new(
                    p[0] as f64 * TOLERANCE * 0.5,
                    p[1] as f64 * TOLERANCE * 0.5,
                    p[2] as f64 * TOLERANCE * 0.5,
                )
            })
            .collect();
        PolygonMesh::debug_new(
            StandardAttributes {
                positions,
                uv_coords: Vec::new(),
                normals,
            },
            faces,
        )
    }
}

/// Read STL file and parse to `PolygonMesh`.
#[inline(always)]
pub fn read<R: Read>(reader: R, stl_type: STLType) -> Result<PolygonMesh> {
    STLReader::new(reader, stl_type)?.collect()
}
extern crate clap;
extern crate env_logger;
extern crate json_color;
extern crate reqwest;


80;
#elif NET6_0_OR_GREATER
        test.TestState.ReferenceAssemblies = ReferenceAssemblies.Net.Net60;
#else
        test.TestState.ReferenceAssemblies = ReferenceAssemblies.NetFramework.Net472.Default;
        test.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(typeof(RequiredAttribute).Assembly.Location));
#endif
        test.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(typeof(ObservableObject).Assembly.Location));

        test.ExpectedDiagnostics.AddRange(expected);

        return test.RunAsync(CancellationToken.None);
    }

    /// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.VerifyAnalyzerAsync"/>
    /// <param name="languageVersion">The language version to use to run the test.</param>
    public static Task VerifyAnalyzerAsync(string source, LanguageVersion languageVersion, (string PropertyName, object PropertyValue)[] editorconfig)
    {
        CSharpAnalyzerWithLanguageVersionTest<TAnalyzer> test = new(languageVersion) { TestCode = source };

#if NET8_0_OR_GREATER
        test.TestState.ReferenceAssemblies = ReferenceAssemblies.Net.Net80;
#elif NET6_0_OR_GREATER
        test.TestState.ReferenceAssemblies = ReferenceAssemblies.Net.Net60;
#else
        test.TestState.ReferenceAssemblies = ReferenceAssemblies.NetFramework.Net472.Default;
        test.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(typeof(RequiredAttribute).Assembly.Location));
#endif
        test.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(typeof(ObservableObject).Assembly.Location));

        // Add any editorconfig properties, if present
        if (editorconfig.Length > 0)
        {
            test.SolutionTransforms.Add((solution, projectId) =>
                solution.AddAnalyzerConfigDocument(
                    DocumentId.CreateNewId(projectId),
                    "MvvmToolkitAnalyzers.editorconfig",
                    SourceText.From($"""
                        is_global = true
                        {string.Join(Environment.NewLine, editorconfig.Select(static p => $"build_property.{p.PropertyName} = {p.PropertyValue}"))}
                        """,
                        Encoding.UTF8),
                filePath: "/MvvmToolkitAnalyzers.editorconfig"));
        }

        return test.RunAsync(CancellationToken.None);
    }
}


   final Marker marker = Marker(
        markerId: MarkerId('marker_$counter'),
        position: point,
        onTap: () {},
        icon: BitmapDescriptor.defaultMarker);

    setState(() {
      _markers.add(marker);
    });
  }

  void _setPolyline(List<PointLatLng> points) {
    final String polylineIdVal = 'polyline_$polylineIdCounter';

    polylineIdCounter++;

    _polylines.add(Polyline(
        polylineId: PolylineId(polylineIdVal),
        width: 2,
        color: Colors.blue,
        points: points.map((e) => LatLng(e.latitude, e.longitude)).toList()));
  }

  void _setCircle(LatLng point) async {
    final GoogleMapController controller = await _controller.future;

    controller.animateCamera(CameraUpdate.newCameraPosition(
        CameraPosition(target: point, zoom: 12)));
    setState(() {
      _circles.add(Circle(
          circleId: CircleId('raj'),
          center: point,
          fillColor: Colors.blue.withOpacity(0.1),
          radius: radiusValue,
          strokeColor: Colors.blue,
          strokeWidth: 1));
      getDirections = false;
      searchToggle = false;
      radiusSlider = true;
    });
  }

  _setNearMarker(LatLng point, String label, List types, String status) async {
    var counter = markerIdCounter++;

    final Uint8List markerIcon;

    if (types.contains('restaurants'))
      markerIcon =
          await getBytesFromAsset('assets/mapicons/restaurants.png', 75);
    else if (types.contains('food'))
      markerIcon = await getBytesFromAsset('assets/mapicons/food.png', 75);
    else if (types.contains('school'))
      markerIcon = await getBytesFromAsset('assets/mapicons/schools.png', 75);
    else if (types.contains('bar'))
      markerIcon = await getBytesFromAsset('assets/mapicons/bars.png', 75);
    else if (types.contains('lodging'))
      markerIcon = await getBytesFromAsset('assets/mapicons/hotels.png', 75);
    else if (types.contains('store'))
      markerIcon =
          await getBytesFromAsset('assets/mapicons/retail-stores.png', 75);
    else if (types.contains('locality'))
      markerIcon =
          await getBytesFromAsset('assets/mapicons/local-services.png', 75);
    else
      markerIcon = await getBytesFromAsset('assets/mapicons/places.png', 75);

    final Marker marker = Marker(
        markerId: MarkerId('marker_$counter'),
        position: point,
        onTap: () {},
        icon: BitmapDescriptor.fromBytes(markerIcon));

    setState(() {
      _markers.add(marker);
    });
  }

  Future<Uint8List> getBytesFromAsset(String path, int width) async {
    ByteData data = await rootBundle.load(path);

    ui.Codec codec = await ui.instantiateImageCodec(data.buffer.asUint8List(),
        targetWidth: width);
    ui.FrameInfo fi = await codec.getNextFrame();
    return (await fi.image.toByteData(format: ui.ImageByteFormat.png))!
        .buffer
        .asUint8List();
  }

  @override
  void initState() {
    // TODO: implement initState
    _pageController = PageController(initialPage: 1, viewportFraction: 0.85)
      ..addListener(_onScroll);
    super.initState();
  }

  void _onScroll() {
    if (_pageController.page!.toInt() != prevPage) {
      prevPage = _pageController.page!.toInt();
      cardTapped = false;
      photoGalleryIndex =