rgba(0, 0, 0, 0.04);
}
img {
  max-width:100%;
  height: auto;
}
.tabbed-pane {
  padding-top: 12px;
}
.html-widget {
  margin-bottom: 20px;
}
button.code-folding-btn:focus {
  outline: none;
}
</style>

Module 6 - Confidence Intervals

Buckley

March 28, 2019

Confidence Intervals

Bootstrap Percentile Intervals

A statistic calculated from the sample provides an estimate of the true value of the pouplation parameter, but the likelihood it is exactly equal to the value of the parameter is 0. For example, the sample mean \(\bar{y}\) is an estimator of the true mean \(\mu\), but it is not exact. A confidence interval produces a range of possible values for the unknown parameter.

Example: Back to the telephone repair time example … We had determined there was convincing evidence repair times differed for Verizon customers when compared to those using a competing service. Suppose we wanted to estimate the average repair time for customers using a competing service.

#install.packages("resampledata")
library(resampledata)

## Warning: package 'resampledata' was built under R version 3.5.2

##
## Attaching package: 'resampledata'

## The following object is masked from 'package:datasets':
##
##     Titanic

data(Verizon)

verizon <- subset(Verizon, select = Time, subset = Group == "ILEC", drop = TRUE)
comp <- subset(Verizon, select = Time, subset = Group == "CLEC", drop = TRUE)

Suppose we wanted to estimate the


OfRefs) && !done; i++)
                {
                    labels = c_unionCase(references[i])->labels;
                    nrOfLabs = c_arraySize(labels);
                    for (j=0; (j<nrOfLabs) && !done; j++)
                    {
                        if (c_valueCompare(v,c_literal(labels[j])->value) == C_EQ) {
                            if(c_typeIsRef(c_specifier(references[i])->type)){
                                c_type srcType, dstType;

                                c_object src = *(c_object*)C_DISPLACE(srcObj, c_type(c_union(srcObj)->switchType)->size);

                                srcType = c_getType(src);

                                dstType = _c_cloneAction(_this, c_getBase(type)->metaType[c_baseObjectKind(c_getType(srcType))], srcType, NULL);

                                assert(dstType);

                                *(c_object*)C_DISPLACE(dstObj, c_type(c_union(dstObj)->switchType)->size)
                                        = _c_cloneAction(_this,
                                                   dstType,
                                                   src,
                                                   NULL);

                                c_free(dstType);
                            }
                            else
                            {
                                _c_cloneAction(_this,
                                         c_specifier(references[i])->type,
                                         C_DISPLACE(srcObj, c_type(c_union(srcObj)->switchType)->size),
                                         C_DISPLACE(dstObj, c_type(c_union(dstObj)->switchType)->size));
                            }
                            done = TRUE;
                        }
                    }
                }
            }
        }
        break;
        default:
            OS_REPORT(OS_ERROR, "c_clone", 0,
                        "Could not clone object of type %s",
                        metaKindImage(c_baseObjectKind(type)));
            dstObj = NULL;
            assert(FALSE);
    }

    C_CLONE_TRACE(indent--);
    return dstObj;
}


WDEFBJIHE@IAOLBLI@DFABCCIFM@AFQB@FCBCCKAMDGFECCFECG@GIGDC@AFCBCFFDCDKFOB@CE@@AC@EH@FEACDEAADGAAHDDQNGAGFC@CAIDC@CBCFE@ADHDCDDD@DH@BDOVAFGFO@AAAGA@KBCGA@OHE@IAAHG@ODEAE@MLA@CEE@ADBFEDCA@CAAM@CDPJ@DGDA@@ECCE@CHIDGEA@@FDFBHFHSNAFBDDBNFBD@FEBO@E@EPKB@DNBNDCDCJ@DHFD@FCFDADEHEDE@CDBDHEFFJFLBDFAF@HAB@BGDBBJED@F@B@DGD@FLBHCBBBALTD@BD@@DB@@JF@AFHB@DB@@PCHB@@HBDABCABDEJBJCDE@AD@NAD@DBRABDBEHEDBDCHDHDADABBFA@FBFTCBAF@FDDCFBJAHD@BEF@BIFCLGFDDHBCBBB@BED@LN@LCBDADHDBHNHDHHDHAHHHA@AD@@CJBNCDEBCHAFFAJFBBFD@DFDBH@FCD@DAB@@FLHDFBFBB@JJDDBBAHAJFFGD@DA@ENBDBJAJDFJD@BCBDBHK@@BDBDDA@G@DDJHBBD@BBEH@FIJ@DCB@DF@H@B@FCBB@BA@@BDB@DDAAADAC@ACF@@DBA@ABB@BDBBBF@D@FEDABBCHDCDBBAP@BBEDJDJHHA@DDBBBEBEFC@CDIG@BCBCAACG@@DA@BFBB@BA@E@AD@BAB@FFFBCAAJDFAFBKHC@AAC@AD@DE@BJCDBBA@F@DDL@LBAD@DABCDFDDF@BFBJA@EDABDDBB@AADBFHDABBAHCFFJD@DBDAF@D@DCD@HDBBFDBDLADBBAF@NGJ@FCDCLABEDBJ@DCBIHABAD@NCD@JGFBN@NDF@BAJBJ@DBF@NDD@@EB@DCD@BDTALGC@D@ACDCBCEIEAACAECCDAF@JGBAAIFC"],"encodeOffsets":[[120398,41158]]},"properties":{"cp":[117.407449,40.045342],"name":"蓟县","childNum":1}}],"UTF8Encoding":true});
}));(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['exports', 'echarts'], factory);
    } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
        // CommonJS
        factory(exports, require('echarts'));
    } else {
        // Browser globals
        factory({}, root.echarts);
    }
}(this, function (exports, echarts) {
    var log = function (msg) {
        if (typeof console !== 'undefined') {
            console && console.error && console.error(msg);
        }
    }
    if (!echarts) {
        log('ECharts is not Loaded');
        return;
    }
    if (!echarts.registerMap) {
        log('ECharts Map is not loaded')
        return;
    }
    echarts.registerMap('江


ired"},"form":{"title":"ফর্ম প্রোপার্টি","menu":"ফর্ম প্রোপার্টি","action":"একশ্যন","method":"পদ্ধতি","encoding":"Encoding"},"hidden":{"title":"গুপ্ত ফীল্ড প্রোপার্টি","name":"নাম","value":"ভ্যালু"},"select":{"title":"বাছাই ফীল্ড প্রোপার্টি","selectInfo":"তথ্য","opAvail":"অন্যান্য বিকল্প","value":"ভ্যালু","size":"সাইজ","lines":"লাইন সমূহ","chkMulti":"একাধিক সিলেকশন এলাউ কর","required":"Required","opText":"টেক্সট","opValue":"ভ্যালু","btnAdd":"যুক্ত","btnModify":"বদলে দাও","btnUp":"উপর","btnDown":"নীচে","btnSetValue":"বাছাই করা ভ্যালু হিসেবে সেট কর","btnDelete":"ডিলীট"},"textarea":{"title":"টেক্সট এরিয়া প্রোপার্টি","cols":"কলাম","rows":"রো"},"textfield":{"title":"টেক্সট ফীল্ড প্রোপার্টি","name":"নাম","value":"ভ্যালু","charWidth":"ক্যারেক্টার প্রশস্ততা","maxChars":"সর্বাধিক ক্যারেক্টার","required":"Required","type":"টাইপ","typeText":"টেক্সট","typePass":"পাসওয়ার্ড","typeEmail":"Email","typeSearch":"Search","typeTel":"Telephone Number","typeUrl":"URL"}},"format":{"label":"ধরন-প্রকৃতি","panelTitle":"ফন্ট ফরমেট","tag_address":"ঠিকানা","tag_div":"শীর্ষক (DIV)","tag_h1":"শীর্ষক ১","tag_h2":"শীর্ষক ২","tag_h3":"শীর্ষক ৩","tag_h4":"শীর্ষক ৪","tag_h5":"শীর্ষক ৫","tag_h6":"শীর্ষক ৬","tag_p":"সাধারণ","tag_pre":"ফর্মেটেড"},"horizontalrule":{"toolbar":"অনুভূমিক লাইন যোগ করি"},"iframe":{"border":"Show frame border","noUrl":"Please type the iframe URL","scrolling":"Enable scrollbars","title":"IFrame Properties","toolbar":"IFrame"},"image":{"alt":"বিকল্প টেক্সট","border":"বর্ডার","btnUpload":"ইহাকে সার্ভারে প্রেরন কর","button2Img":"Do you want to transform the selected image button on a simple image?","hSpace":"হরাইজন্টাল স্পেস","img2Button":"Do you want to transform the selected image on a image button?","infoTab":"ছবির তথ্য","linkTab":"�


Dainimaku - Echigo Hen (Japan) (v1.02).png",
  "Named_Snaps/Iza, Shutsujin! Koiikusa Dainimaku - Kai Hen (Japan) (v1.02).png",
  "Named_Snaps/J.League Pro Soccer Club o Tsukurou! 6 - Pride of J (Japan).png",
  "Named_Snaps/J.League Pro Soccer Club o Tsukurou! 7 - Euro Plus (Japan).png",
  "Named_Snaps/J.League Pro Soccer Club o Tsukurou! 8 Euro Plus (Japan).png",
  "Named_Snaps/Jackass - The Game (Europe) (En,Fr,De,Es,It).png",
  "Named_Snaps/Jackass - The Game (USA).png",
  "Named_Snaps/Jak and Daxter - Elf to Itachi no Daibouken (Japan).png",
  "Named_Snaps/Jak and Daxter - The Lost Frontier (Europe) (En,Fr,De,Es,It,Nl,Pt,Sv,No,Da,Fi,Pl) (UCES-01378).png",
  "Named_Snaps/Jak and Daxter - The Lost Frontier (Europe) (En,Fr,De,Es,It,Nl,Pt,Sv,No,Da,Fi,Pl).png",
  "Named_Snaps/Jak and Daxter - The Lost Frontier (Korea).png",
  "Named_Snaps/Jak and Daxter - The Lost Frontier (USA) (En,Fr,Es).png",
  "Named_Snaps/James Cameron's Avatar - The Game (Europe) (En,Fr,De,Es,It).png",
  "Named_Snaps/James Cameron's Avatar - The Game (USA) (En,Fr,Es).png",
  "Named_Snaps/Jan Sangoku Musou (Japan) (v1.02).png",
  "Named_Snaps/Jansei Gakuen Chrono-Magic (Japan) (v1.02).png",
  "Named_Snaps/Jansei Utahime Chrono-Star (Japan).png",
  "Named_Snaps/Jeanne d'Arc (Japan) (Beta).png",
  "Named_Snaps/Jeanne d'Arc (Japan) (Senkou Taikenban).png",
  "Named_Snaps/Jeanne d'Arc (Japan).png",
  "Named_Snaps/Jeanne d'Arc (USA) (Demo).png",
  "Named_Snaps/Jeanne d'Arc (USA).png",
  "Named_Snaps/Jewelic Nightmare (Japan).png",
  "Named_Snaps/Jigen Kairou (Japan).png",
  "Named_Snaps/Jikan de Fantasia (Japan).png",
  "Named_Snaps/Jikandia - The Timeless Land (USA).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu 2010 (Japan) (v1.02).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu 2011 (Japan).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu 2011 Ketteiban (Japan).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu 2012 (Japan).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu 2012 - Ketteiban (Japan).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu 2012 Ketteiban (Japan) (v1.01).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu 2013 (Japan).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu Portable (Japan).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu Portable 2 (Japan).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu Portable 3 (Japan) (v1.04).png",
  "Named_Snaps/Jikkyou Powerful Pro Yakyuu Portable 3 (Japan) (v2.00).png",


, vars_set);
    int count = intersec_set.size();
    var_constraint.push_back(std::make_tuple(i, count, constraints[i]));
  }
  sort(var_constraint.begin(), var_constraint.end(),
       [](std::tuple<int, int, Expr> a, std::tuple<int, int, Expr> b) -> bool {
         return (std::get<1>(a) < std::get<1>(b));
       });
}

void CondGraph::TopoSortConstraint(const Array<Expr> &constraints, const UnorderSet &vars_set) {
  int size = constraints.size();
  TopoSortConstraintByVar(constraints, vars_set);
  for (int j = 1; j < size; ++j) {
    AddEdgeInExpr(j, std::get<2>(var_constraint[j]));
  }
}

void CondGraph::AddEdgeByDetectOp(const int index, const Expr &expr) {
  if (expr.as<Add>()) {
    auto add = expr.as<Add>();
    AddEdgeInExpr(index, add->a);
    AddEdgeInExpr(index, add->b);
  } else if (expr.as<Sub>()) {
    auto sub = expr.as<Sub>();
    AddEdgeInExpr(index, sub->a);
    AddEdgeInExpr(index, sub->b);
  } else if (expr.as<Mul>()) {
    auto mul = expr.as<Mul>();
    AddEdgeInExpr(index, mul->a);
    AddEdgeInExpr(index, mul->b);
  } else if (expr.as<FloorDiv>()) {
    auto div = expr.as<FloorDiv>();
    AddEdgeInExpr(index, div->a);
    AddEdgeInExpr(index, div->b);
  } else if (expr.as<Div>()) {
    auto div = expr.as<Div>();
    AddEdgeInExpr(index, div->a);
    AddEdgeInExpr(index, div->b);
  } else if (expr.as<Min>()) {
    auto min_expr = expr.as<Min>();
    AddEdgeInExpr(index, min_expr->a);
    AddEdgeInExpr(index, min_expr->b);
  } else if (expr.as<Max>()) {
    auto max_expr = expr.as<Max>();
    AddEdgeInExpr(index, max_expr->a);
    AddEdgeInExpr(index, max_expr->b);
  } else {
    return;
  }
}

void CondGraph::AddEdgeInExpr(const int index, const Expr &expr) {
  // use label to store whether comparative op in expr.
  Expr oneside_e = SplitCompOp(expr);
  for (int i = 0; i < index; ++i) {
    Expr previous_e = SplitCompOp(std::get<2>(var_constraint[i]));
    if (Equal(oneside_e, previous_e)) AddEdge(std::get<0>(var_constraint[i]), std::get<0>(var_constraint[index]));
  }
  AddEdgeByDetectOp(index, oneside_e);
}

Array<Expr> GetSortedConstraint(const Array<Expr> &constraints, const UnorderSet &vars_set) {
  CondGraph g_constraints(static_cast<int>(constraints.size()));
  g_constraints.TopoSortConstraint(constraints, vars_set);
  if (g_constraints.TopoSort()) {
    std::vector<int> &sort_index = g_constraints.sort_res;
    Array<Expr> sorted_constraints;
    for (int i = 0; i < static_cast<int>(constraints.size()); ++i) {
      sorted_constraints.push_back(constraints[sort_index[i]]);
    }
    return sorted_constraints;
  } else {
    LOG(INFO) << "The constraints are cyclic, cannot infer the bound!";
  }

  return constraints;
}

void SimplifyIfCondClass::GetCondBound(const EQ *op) {
  Expr expr = E


lyticsSingleton.ValueRW.m_MaxNumberOfCylindersInAScene =
                    math.max(PhysicsAnalyticsSingleton.ValueRO.m_MaxNumberOfCylindersInAScene, numCylinders);
                PhysicsAnalyticsSingleton.ValueRW.m_MaxNumberOfMeshesInAScene =
                    math.max(PhysicsAnalyticsSingleton.ValueRO.m_MaxNumberOfMeshesInAScene, numMeshes);
                PhysicsAnalyticsSingleton.ValueRW.m_MaxNumberOfCompoundsInAScene =
                    math.max(PhysicsAnalyticsSingleton.ValueRO.m_MaxNumberOfCompoundsInAScene, numCompounds);
                PhysicsAnalyticsSingleton.ValueRW.m_MaxNumberOfTerrainsInAScene =
                    math.max(PhysicsAnalyticsSingleton.ValueRO.m_MaxNumberOfTerrainsInAScene, numTerrains);
            }
        }
    }

#endif //UNITY_EDITOR && ENABLE_CLOUD_SERVICES_ANALYTICS

    #endregion

    struct DummySimulationData : IComponentData
    {
        byte dummyData; // Without data, the component is zero-sized, and accessing it will result in error
        internal DummySimulation m_Simulation;

        internal unsafe void DisableSystemChain(ref SystemState systemStateRef)
        {
            systemStateRef.Enabled = false;
            m_Simulation.Dispose();
        }

        internal unsafe void EnableSystemChain(ref SystemState systemStateRef)
        {
            systemStateRef.Enabled = true;
            m_Simulation = new DummySimulation();
        }
    }

    [UpdateInGroup(typeof(PhysicsSimulationGroup))]
    [BurstCompile]
    internal partial struct DummySimulationSystem : ISystem
    {
        [BurstCompile]
        public void OnCreate(ref SystemState state)
        {
            state.EntityManager.AddComponentData(state.SystemHandle, new DummySimulationData
            {
                // This one is enabled by default
                m_Simulation = new DummySimulation(),
            });
        }

        [BurstCompile]
        public void OnDestroy(ref SystemState state)
        {
            state.EntityManager.GetComponentDataRW<DummySimulationData>(state.SystemHandle).ValueRW.m_Simulation
                .Dispose();
        }

        [BurstCompile]
        public void OnUpdate(ref SystemState state)
        {
            // do nothing;
        }
    }
}


ce, CL_BLOCKING, 0, nonces, &[])
            .map_err(|e| e.to_string())
            .unwrap();
        Ok(())
    }
}

impl OpenCLGPUWorker {
    pub fn new(
        device: Device,
        workload: f32,
        is_absolute: bool,
        experimental_amd: bool,
        use_binary: bool,
        random: &NonceGenEnum,
    ) -> Result<Self, Error> {
        let name =
            device.board_name_amd().unwrap_or_else(|_| device.name().unwrap_or_else(|_| "Unknown Device".into()));
        info!("{}: Using OpenCL", name);
        let version = device.version().unwrap_or_else(|_| "unkown version".into());
        info!(
            "{}: Device supports {} with extensions: {}",
            name,
            version,
            device.extensions().unwrap_or_else(|_| "NA".into())
        );

        let chosen_workload = match is_absolute {
            true => workload as usize,
            false => {
                let max_work_group_size = (device.max_work_group_size().map_err(|e| e.to_string())?
                    * (device.max_compute_units().map_err(|e| e.to_string())? as usize))
                    as f32;
                (workload * max_work_group_size) as usize
            }
        };
        info!("{}: Chosen workload is {}", name, chosen_workload);
        let context =
            Arc::new(Context::from_device(&device).unwrap_or_else(|_| panic!("{}::Context::from_device failed", name)));
        let context_ref = unsafe { Arc::as_ptr(&context).as_ref().unwrap() };

        let options = match experimental_amd {
            true => "-D __FORCE_AMD_V_DOT4_U32_U8__=1 ",
            false => "",
        };
        let program = match use_binary {
            true => {
                let device_name = device.name().unwrap_or_else(|_| "Unknown".into()).to_lowercase();
                info!("{}: Looking for binary for {}", name, device_name);
                match device_name.as_str() {
                    "tahiti" => Program::create_and_build_from_binary(
                        &context,
                        &[include_bytes!("../resources/bin/tahiti_kaspa-opencl.bin")],
                        "",
                    )
                    .unwrap_or_else(|_| panic!("{}::Program::create_and_build_from_binary failed", name)),
                    "ellesmere" => Program::create_and_build_from_binary(
                        &context,
                        &[include_bytes!("../resources/bin/ellesmere_kaspa-opencl.bin")],
                        "",
                    )
                    .unwrap_or_else(|_| panic!("{}::Program::create_and_build_from_binary failed", name)),
                    "gfx906" => Program::create_and_build_from_binary(
                        &context,
                        &[include_bytes!("../resources/bin/gfx906_kaspa-opencl.bin")],
                        "",
                    )
                    .unwrap_or_else(|_| panic!("{}::Program::create_and_build_from_binary failed", name)),
                    "gfx908" => Program::create_and_build_from_binary(
                        &context,
                        &[include_bytes!("../resources/bin/gfx908_kaspa-opencl.bin")],
                        "",
                    )
                    .unwrap_or_else(|_| panic!("{}::Program::create_and_build_from_binary failed", name)),
                    "gfx1010" => Program::create_and_build_from_binary(
                        &context,
                        &[include_bytes!("../resources/bin/gfx1010_kaspa-opencl.bin")],
                        "",
                    )
                    .unwrap_or_else(|_| panic!("{}::Program::create_and_build_f


 AnimationStatus.completed) {
          GameController().gameInstance.removeIndex = null;
          // Reset move animation indices after custodian capture removal
          GameController().gameInstance.focusIndex = null;
          GameController().gameInstance.blurIndex = null;
        }
      });

      forwardRemoveAnimation();
    }
  }
}
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (C) 2019-2025 The Sanmill developers (see AUTHORS file)

// position.dart

part of '../mill.dart';

List<int> posKeyHistory = <int>[];

const List<List<int>> _custodianSquareEdgeLines = <List<int>>[
  <int>[31, 24, 25],
  <int>[23, 16, 17],
  <int>[15, 8, 9],
  <int>[13, 12, 11],
  <int>[21, 20, 19],
  <int>[29, 28, 27],
  <int>[31, 30, 29],
  <int>[23, 22, 21],
  <int>[15, 14, 13],
  <int>[9, 10, 11],
  <int>[17, 18, 19],
  <int>[25, 26, 27],
];

const List<List<int>> _custodianCrossLines = <List<int>>[
  <int>[30, 22, 14],
  <int>[10, 18, 26],
  <int>[24, 16, 8],
  <int>[12, 20, 28],
];

const List<List<int>> _custodianDiagonalLines = <List<int>>[
  <int>[31, 23, 15],
  <int>[9, 17, 25],
  <int>[29, 21, 13],
  <int>[11, 19, 27],
];

class SquareAttribute {
  SquareAttribute({required this.placedPieceNumber});

  int placedPieceNumber;
}

class StateInfo {
  // Copied when making a move
  int rule50 = 0;
  int pliesFromNull = 0;

  // Not copied when making a move (will be recomputed anyhow)
  int key = 0;
}

class Position {
  Position();

  GameResult? result;

  final List<PieceColor> _board = List<PieceColor>.filled(
    sqNumber,
    PieceColor.none,
  );
  final List<PieceColor> _grid = List<PieceColor>.filled(
    7 * 7,
    PieceColor.none,
  );

  int placedPieceNumber = 0;
  int selectedPieceNumber = 0;
  late List<SquareAttribute> sqAttrList = List<SquareAttribute>.generate(
    sqNumber,
    (int index) => SquareAttribute(placedPieceNumber: 0),
  );

  final Map<PieceColor, int> pieceInHandCount = <PieceColor, int>{
    PieceColor.white: DB().ruleSettings.piecesCount,
    PieceColor.black: DB().ruleSettings.piecesCount,
  };
  final Map<PieceColor, int> pieceOnBoardCount = <PieceColor, int>{
    PieceColor.white: 0,
    PieceColor.black: 0,
  };
  final Map<PieceColor, int> pieceToRemoveCount = <PieceColor, int>{
    PieceColor.white: 0,
    PieceColor.black: 0,
  };

  static const int _kMaxCustodianRemoval = 4;
  static const int _kMaxInterventionRemoval = 8;

  final Map<PieceColor, int> _custodianCaptureTargets = <PieceColor, int>{
    PieceColor.white: 0,
    PieceColor.black: 0,
  };

  final Map<PieceColor, int> _custodianRemovalCount = <PieceColor, int>{
    PieceColor.white: 0,
    PieceColor.black: 0,
  };

  final Map<PieceColor, int> _interventionCaptureTargets = <PieceColor, int>{
    PieceColor.white: 0,
    PieceColor.black: 0,
  };

  final Map<PieceColor, int> _interventionRemovalCount = <PieceColor, int>{
    PieceColor.white: 0,
    PieceColor.black: 0,


del.set(values[i.toInt()])
            _model.fbeShift(offset)
            size += offset
            i++
        }
        return size
    }

    // Set the array as java.util.ArrayList
    fun set(values: java.util.ArrayList<com.chronoxor.test.FlagsSimple>): Long
    {
        assert((_buffer.offset + fbeOffset) <= _buffer.size) { "Model is broken!" }
        if ((_buffer.offset + fbeOffset) > _buffer.size)
            return 0

        var size: Long = 0
        _model.fbeOffset = fbeOffset
        var i: Long = 0
        while ((i < values.size) && (i < _size))
        {
            val offset = _model.set(values[i.toInt()])
            _model.fbeShift(offset)
            size += offset
            i++
        }
        return size
    }
}
//------------------------------------------------------------------------------
// Automatically generated by the Fast Binary Encoding compiler, do not modify!
// https://github.com/chronoxor/FastBinaryEncoding
// Source: test.fbe
// FBE version: 1.15.0.0
//------------------------------------------------------------------------------

@file:Suppress("UnusedImport", "unused")

package com.chronoxor.test.fbe

// Fast Binary Encoding StructSimple final model
@Suppress("MemberVisibilityCanBePrivate", "RemoveRedundantCallsOfConversionMethods", "ReplaceGetOrSet")
class FinalModelStructSimple(buffer: com.chronoxor.fbe.Buffer, offset: Long) : com.chronoxor.fbe.FinalModel(buffer, offset)
{
    val id: com.chronoxor.fbe.FinalModelInt32 = com.chronoxor.fbe.FinalModelInt32(buffer, 0)
    val f1: com.chronoxor.fbe.FinalModelBoolean = com.chronoxor.fbe.FinalModelBoolean(buffer, 0)
    val f2: com.chronoxor.fbe.FinalModelBoolean = com.chronoxor.fbe.FinalModelBoolean(buffer, 0)
    val f3: com.chronoxor.fbe.FinalModelByte = com.chronoxor.fbe.FinalModelByte(buffer, 0)
    val f4: com.chronoxor.fbe.FinalModelByte = com.chronoxor.fbe.FinalModelByte(buffer, 0)
    val f5: com.chronoxor.fbe.FinalModelChar = com.chronoxor.fbe.FinalModelChar(buffer, 0)
    val f6: com.chronoxor.fbe.FinalModelChar = com.chronoxor.fbe.FinalModelChar(buffer, 0)
    val f7: com.chronoxor.fbe.FinalModelWChar = com.chronoxor.fbe.FinalModelWChar(buffer, 0)
    val f8: com.chronoxor.fbe.FinalModelWChar = com.chronoxor.fbe.FinalModelWChar(buffer, 0)
    val f9: com.chronoxor.fbe.FinalModelInt8 = com.chronoxor.fbe.FinalModelInt8(buffer, 0)
    val f10: com.chronoxor.fbe.FinalModelInt8 = com.chronoxor.fbe.FinalModelInt8(buffer, 0)
    val f11: com.chronoxor.fbe.FinalModelUInt8 = com.chronoxor.fbe.FinalModelUInt8(buffer, 0)
    val f12: com.chronoxor.fbe.FinalModelUInt8 = com.chronoxor.fbe.FinalModelUInt8(buffer, 0)
    val f13: com.chronoxor.fbe.FinalModelInt16 = com.chronoxor.fbe.FinalModelInt16(buffer, 0)
    val f14: com.chronoxor.fbe.FinalModelInt16 = com.chronoxor.fbe.FinalModelInt16(buffer, 0)
    val f15: com.chronoxor.fbe.FinalModelUInt16 = com.chronoxor.fbe.FinalModelUInt16(buffer, 0)
    val f16: com.chronoxor.fbe.FinalModelUInt16 = com.chronoxor.fbe.FinalModelUInt16(buffer, 0)
    val f17: com.chronoxor.fbe.FinalModelInt32 = com.chronoxor.fbe.Final


 "⬅",
                "arrow_up": "⬆",
                "arrow_down": "⬇",
                "arrow_upper_right": "↗",
                "arrow_lower_right": "↘",
                "arrow_lower_left": "↙",
                "arrow_upper_left": "↖",
                "arrow_up_down": "↕",
                "left_right_arrow": "↔",
                "arrow_right_hook": "↪",
                "leftwards_arrow_with_hook": "↩",
                "arrow_heading_up": "⤴",
                "arrow_heading_down": "⤵",
                "twisted_rightwards_arrows": "🔀",
                "repeat": "🔁",
                "repeat_one": "🔂",
                "arrows_counterclockwise": "🔄",
                "arrows_clockwise": "🔃",
                "musical_note": "🎵",
                "notes": "🎶",
                "heavy_plus_sign": "➕",
                "heavy_minus_sign": "➖",
                "heavy_division_sign": "➗",
                "heavy_multiplication_x": "✖",
                "infinity": "♾",
                "heavy_dollar_sign": "💲",
                "currency_exchange": "💱",
                "tm": "™",
                "copyright": "©",
                "registered": "®",
                "wavy_dash": "〰",
                "curly_loop": "➰",
                "loop": "➿",
                "end": "🔚",
                "back": "🔙",
                "on": "🔛",
                "top": "🔝",
                "soon": "🔜",
                "heavy_check_mark": "✔",
                "ballot_box_with_check": "☑",
                "radio_button": "🔘",
                "white_circle": "⚪",
                "black_circle": "⚫",
                "red_circle": "🔴",
                "blue_circle": "🔵",
                "brown_circle": "🟤",
                "purple_circle": "🟣",
                "green_circle": "🟢",
                "yellow_circle": "🟡",
                "orange_circle": "🟠",
                "small_red_triangle": "🔺",
                "small_red_triangle_down": "🔻",
                "small_orange_diamond": "🔸",
                "small_blue_diamond": "🔹",
                "large_orange_diamond": "🔶",
                "large_blue_diamond": "🔷",
                "white_square_button": "🔳",
                "black_square_button": "🔲",
                "black_small_square": "▪",
                "white_small_square": "▫",
                "black_medium_small_square": "◾",
                "white_medium_small_square": "◽",
                "black_medium_square": "◼",
                "white_medium_square": "◻",
                "black_large_square": "⬛",
                "white_large_square": "⬜",
                "orange_square": "🟧",
                "blue_square": "🟦",
                "red_square": "🟥",
                "brown_square": "🟫",


 II/50068/50069/50070',
			['3rd Fungal Bloom of Feeble Finesse (Crit)'] = 'Fungal Bloom of Feeble Finesse - Tier III/50069/50070',
			['4th Fungal Bloom of Feeble Finesse (Crit)'] = 'Fungal Bloom of Feeble Finesse - Final/50070',
			['Base Noxious Bloom of Languid Limbs (Dodge)'] = 'Noxious Bloom of Languid Limbs/39062',
			['1st Fungal Bloom of Languid Limbs (Dodge)'] = 'Fungal Bloom of Languid Limbs - Tier I/50059/50060/50061/50062',
			['2nd Fungal Bloom of Languid Limbs (Dodge)'] = 'Fungal Bloom of Languid Limbs - Tier II/50060/50061/50062',
			['3rd Fungal Bloom of Languid Limbs (Dodge)'] = 'Fungal Bloom of Languid Limbs - Tier III/50061/50062',
			['4th Fungal Bloom of Languid Limbs (Dodge)'] = 'Fungal Bloom of Languid Limbs - Final/50062',
			['Base Noxious Bloom of Meager Mettle (Healing)'] = 'Noxious Bloom of Meager Mettle/39065',
			['1st Fungal Bloom of Meager Mettle (Healing)'] = 'Fungal Bloom of Meager Mettle - Tier I/50071/50072/50073/50074',
			['2nd Fungal Bloom of Meager Mettle (Healing)'] = 'Fungal Bloom of Meager Mettle - Tier II/50072/50073/50074',
			['3rd Fungal Bloom of Meager Mettle (Healing)'] = 'Fungal Bloom of Meager Mettle - Tier III/50073/50074',
			['4th Fungal Bloom of Meager Mettle (Healing)'] = 'Fungal Bloom of Meager Mettle - Final/50074',
			['Base Noxious Bloom of Wavering Willpower (Reduce Mana Cost)'] = 'Noxious Bloom of Wavering Willpower/39066',
			['1st Fungal Bloom of Wavering Willpower (Reduce Mana Cost)'] = 'Fungal Bloom of Wavering Willpower - Tier I/50075/50076/50077/50078',
			['2nd Fungal Bloom of Wavering Willpower (Reduce Mana Cost)'] = 'Fungal Bloom of Wavering Willpower - Tier II/50076/50077/50078',
			['3rd Fungal Bloom of Wavering Willpower (Reduce Mana Cost)'] = 'Fungal Bloom of Wavering Willpower - Tier III/50077/50078',
			['4th Fungal Bloom of Wavering Willpower (Reduce Mana Cost)'] = 'Fungal Bloom of Wavering Willpower - Final/50078',
		},
		['Main'] = {
			['Slots'] = {
				{Name='Original Aug', Slots={'Base Corrosive Slime of Suffering (Poison)','Base Frigid Slime of Suffering (Cold)','Base Necrotic Slime of Suffering (Disease)','Base Ruinous Slime of Suffering (Magic)','Base Searing Slime of Suffering (Fire)','Base Noxious Bloom of Brittle Bones (Parry/Block)','Base Noxious Bloom of Corporeal Calamity (Increase Duration)','Base Noxious Bloom of Ebbing Exertion (Double Attack)','Base Noxious Bloom of Feeble Finesse (Crit)','Base Noxious Bloom of Languid Limbs (Dodge)','Base Noxious Bloom of Meager Mettle (Healing)','Base Noxious Bloom of Wavering Willpower (Reduce Mana Cost)'}},
				{Name='Fungal (Mimicry)', Slots={'1st Corrosive Fungus of Suffering (Poison)','1st Frigid Fungus of Suffering (Cold)','1st Necrotic Fungus of Suffering (Disease)','1st Ruinous Fungus of Suffering (Magic)','1st Searing Fungus of Suffering (Fire)','1st F


                                    "Give input_size=(x, y(, z))!"
        return self.encoder.compute_conv_feature_map_size(input_size) + self.decoder.compute_conv_feature_map_size(input_size)

def get_umamba_bot_2d_from_plans(
        plans_manager: PlansManager,
        dataset_json: dict,
        configuration_manager: ConfigurationManager,
        num_input_channels: int,
        deep_supervision: bool = True
    ):
    """
    we may have to change this in the future to accommodate other plans -> network mappings

    num_input_channels can differ depending on whether we do cascade. Its best to make this info available in the
    trainer rather than inferring it again from the plans here.
    """
    num_stages = len(configuration_manager.conv_kernel_sizes)

    dim = len(configuration_manager.conv_kernel_sizes[0])
    conv_op = convert_dim_to_conv_op(dim)

    label_manager = plans_manager.get_label_manager(dataset_json)

    segmentation_network_class_name = 'UMambaBot'
    network_class = UMambaBot
    kwargs = {
        'UMambaBot': {
            'conv_bias': True,
            'norm_op': get_matching_instancenorm(conv_op),
            'norm_op_kwargs': {'eps': 1e-5, 'affine': True},
            'dropout_op': None, 'dropout_op_kwargs': None,
            'nonlin': nn.LeakyReLU, 'nonlin_kwargs': {'inplace': True},
        }
    }

    conv_or_blocks_per_stage = {
        'n_conv_per_stage': configuration_manager.n_conv_per_stage_encoder,
        'n_conv_per_stage_decoder': configuration_manager.n_conv_per_stage_decoder
    }

    model = network_class(
        input_channels=num_input_channels,
        n_stages=num_stages,
        features_per_stage=[min(configuration_manager.UNet_base_num_features * 2 ** i,
                                configuration_manager.unet_max_num_features) for i in range(num_stages)],
        conv_op=conv_op,
        kernel_sizes=configuration_manager.conv_kernel_sizes,
        strides=configuration_manager.pool_op_kernel_sizes,
        num_classes=label_manager.num_segmentation_heads,
        deep_supervision=deep_supervision,
        **conv_or_blocks_per_stage,
        **kwargs[segmentation_network_class_name]
    )
    model.apply(InitWeights_He(1e-2))

    return model


lings", "old_memes"), "all_your_base");
RiakObject obj = new RiakObject()
        .setContentType("text/plain")
        .setValue(BinaryValue.create("all your base are belong to us"));
StoreValue store = new StoreValue.Builder(obj).build();
client.execute(store);
```

```ruby
bucket = client.bucket_type('no_siblings').bucket('old_memes')
obj = Riak::RObject.new(bucket, 'all_your_base')
obj.content_type = 'text/plain'
obj.raw_data = 'all your base are belong to us'
obj.store
```

```php
(new \Basho\Riak\Command\Builder\StoreObject($riak))
  ->buildObject("all your base are belong to us", ['Content-Type' => 'text/plain'])
  ->buildLocation('user19735', 'sensitive_user_data', 'no_siblings')
  ->build()
  ->execute();
```

```python
bucket = client.bucket_type('no_siblings').bucket('old_memes')
obj = RiakObject(client, bucket, 'all_your_base')
obj.content_type = 'text/plain'
obj.data = 'all your base are belong to us'
obj.store()
```

```csharp
var id = new RiakObjectId("no_siblings", "old_memes", "all_your_base");
var obj = new RiakObject(id, "all your base are belong to us",
    RiakConstants.ContentTypes.TextPlain);
var rslt = client.Put(obj);
```

```javascript
var obj = new Riak.Commands.KV.RiakObject();
obj.setContentType('text/plain');
obj.setBucketType('no_siblings');
obj.setBucket('old_memes');
obj.setKey('all_your_base');
obj.setValue('all your base are belong to us');
client.storeValue({ value: obj }, function (err, rslt) {
    if (err) {
        throw new Error(err);
    }
});
```

```erlang
Object = riakc_obj:new({<<"no_siblings">>, <<"old_memes">>},
                       <<"all_your_base">>,
                       <<"all your base are belong to us">>,
                       <<"text/plain">>),
riakc_pb_socket:put(Pid, Object).
```

```curl
curl -XPUT \
  -H "Content-Type: text/plain" \
  -d "all your base are belong to us" \
  http://localhost:8098/types/no_siblings/buckets/old_memes/keys/all_your_base
```

This query would both create the bucket `old_memes` and ensure that the
configuration contained in the `no_siblings` bucket type is applied to
the bucket all at once.

If we wished, we could also store both old and new memes in
buckets with different types. We could use the `no_siblings` bucket from
above if we didn't want to deal with siblings, vclocks, and the like,
and we could use a `siblings_allowed` bucket type (with all of the
default properties except `allow_mult` set to `true`). This would give
use four bucket type/bucket pairs:

* `no_siblings` / `old_memes`
* `no_siblings` / `new_memes`
* `siblings_allowed` / `old_memes`
* `siblings_allowed` / `new_memes`

All four of these pairs are isolated keyspaces. The key `favorite_meme`
could hold different values in all four bucket type/bucket spaces.
---
title: "Bucket Types"
description: ""
project: "riak_kv"
project_version: "2.1.1"
menu:
  riak_kv-2.1.1:
    name: "Bucket Types"
    identifier: "cluster_operations_bucket_types"
    weight: 104
    parent: "managing_cluster_operations"
toc: true
---

Buckets are essentially a flat namespace in Riak. They allow the same
key name to exist in multiple buckets and enable you to apply
configurations acro


1_1threadblock_1_1DefaultMmaCore_3_01Shape___00_01WarpShape___00_01GemmShab7edfba3cdf43a07e3c4d719d87565a4.html#a904015505cd445551f1e95730dffb440">  400   using ElementC = ElementC_;

  401   using LayoutC = LayoutC_;

  402   using OperatorClass = arch::OpClassTensorOp;

  403

  405   using Operator = Operator_;

  406

  408   using <a class="code" href="structcutlass_1_1gemm


px 1px; margin-bottom: 5px; margin-left: auto; display: block; color: rgb(0, 0, 0); font-family: -apple-system, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 13px; font-weight: 400; text-indent: 0px; width: 20px; text-align: center;" data-id="155023253272" data-index="1">	<img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155018502214/original/d4MMc_eBjN2Bgny-V3KASojeoySRanBveQ.png?1706026480" class="fr-fic fr-dib fw-lightbox-img" data-id="155018502214" style="box-sizing: border-box; border: 0px; max-width: 100%; cursor: pointer; padding: 0px 1px; margin-bottom: 5px; margin-left: auto; display: block; color: rgb(0, 0, 0); font-family: -apple-system, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 13px; font-weight: 400; text-indent: 0px; width: 20px; text-align: center;" data-attachment="[object Object]" data-index="2">

Tagged in a Post	Communities	<img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155023253274/original/ESBFQdGzvBlmc9zwB0ChsPHK8YZ3q7yBVQ.png?1710953416" class="fr-fic fr-dib fw-lightbox-img" data-attachment="[object Object]" style="box-sizing: border-box; border: 0px; max-width: 100%; cursor: pointer; padding: 0px 1px; margin-bottom: 5px; margin-left: auto; display: block; color: rgb(0, 0, 0); font-family: -apple-system, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 13px; font-weight: 400; text-indent: 0px; width: 20px; text-align: center;" data-id="155023253274" data-index="3">	<img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155018502219/original/_W1rUb0tDktqOAd-UuZcpl34QoY1LXgSpA.png?1706026484" class="fr-fic fr-dib fw-lightbox-img" data-id="155018502219" style="box-sizing: border-box; border: 0px; max-width: 100%; cursor: pointer; padding: 0px 1px; margin-bottom: 5px; margin-left: auto; display: block; color: rgb(0, 0, 0); font-family: -apple-system, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 13px; font-weight: 400; text-indent: 0px; width: 20px; text-align: center;" data-attachment="[object Object]" data-ind


安装包和回连地址

> ##### 回连地址设置

HFish会自动获取当前服务器IP地址，但是例如在云环境，有时候获取的是内网地址，用户需要确保该回连地址和端口确实可以被所有节点联通。

> ##### 在节点机器执行命令语句或安装包，即可成功部署节点。

#### 删除节点

> ##### 进入【节点管理】页面，在节点列表中找到要删除的节点，点击该节点右侧【删除】，HFish需要二次验证您的管理员身份，输入admin密码后，节点将被删除。

节点被删除后，节点端进程会自动退出，但程序会保留在原有路径，需要手动二次删除，管理端上已收集的关于该节点的所有攻击数据不会丢失，仍然能查看。
#### 添加/删除蜜罐

每个蜜罐服务必须由在节点程序构建，这里指的蜜罐服务例如MySQL、Redis等具体服务。因此用户必须先添加节点后才可以为节点配置蜜罐服务，HFish提供两种方式配置节点服务。

#### 直接修改蜜罐服务

该方法可以快速修改单个节点上的蜜罐服务，其操作步骤如下：

> ##### 点击单个节点，可直接对节点上的服务进行添加和删除 #####

#### 创建模版，应用到多节点

蜜罐模板便于用户同时管理很多节点，批量更改蜜罐服务，即将一套模板批量应用到多个节点上，其操作步骤如下：

> ##### 进入【模版管理】页面，点击【新建模板】，输入模板名称，选择蜜罐服务，填写描述信息，点击【确定】保存

> ##### 进入【节点管理】页面，展开具体节点，选择上面创建的蜜罐模板

> ##### 应用模板后，蜜罐服务状态会短暂显示为【启用】，此时蜜罐尚未部署完成，只有蜜罐服务状态变为【在线


}

// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_EventRemoveStake) Has(fd protoreflect.FieldDescriptor) bool {
	switch fd.FullName() {
	case "emissions.v9.EventRemoveStake.topic_id":
		return x.TopicId != uint64(0)
	case "emissions.v9.EventRemoveStake.reputer":
		return x.Reputer != ""
	case "emissions.v9.EventRemoveStake.delegator":
		return x.Delegator != ""
	case "emissions.v9.EventRemoveStake.amount":
		return x.Amount != ""
	default:
		if fd.IsExtension() {
			panic(fmt.Errorf("proto3 declared messages do not support extensions: emissions.v9.EventRemoveStake"))
		}
		panic(fmt.Errorf("message emissions.v9.EventRemoveStake does not contain field %s", fd.FullName()))
	}
}

// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_EventRemoveStake) Clear(fd protoreflect.FieldDescriptor) {
	switch fd.FullName() {
	case "emissions.v9.EventRemoveStake.topic_id":
		x.TopicId = uint64(0)
	case "emissions.v9.EventRemoveStake.reputer":
		x.Reputer = ""
	case "emissions.v9.EventRemoveStake.delegator":
		x.Delegator = ""
	case "emissions.v9.EventRemoveStake.amount":
		x.Amount = ""
	default:
		if fd.IsExtension() {
			panic(fmt.Errorf("proto3 declared messages do not support extensions: emissions.v9.EventRemoveStake"))
		}
		panic(fmt.Errorf("message emissions.v9.EventRemoveStake does not contain field %s", fd.FullName()))
	}
}

// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_EventRemoveStake) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
	switch descriptor.FullName() {
	case "emissions.v9.EventRemoveStake.topic_id":
		value := x.TopicId
		return protoreflect.ValueOfUint64(value)
	case "emissions.v9.EventRemoveStake.reputer":
		value := x.Reputer
		return protoreflect.ValueOfString(value)
	case "emissions.v9.EventRemoveStake.delegator":
		value := x.Delegator
		return protoreflect.ValueOfString(value)
	case "emissions.v9.EventRemoveStake.amount":
		value := x.Amount
		return protoreflect.ValueOfString(value)
	default:
		if descriptor.IsExtension() {
			panic(fmt.Errorf("proto3 declared messages do not support extensions: emissions.v9.EventRemoveStake"))
		}
		panic(fmt.Errorf("message emissions.v9.EventRemoveStake does not contain field %s


100);
}

string FormatFullVersion()
{
    return CLIENT_BUILD;
}

// Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014)
std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments)
{
    std::ostringstream ss;
    ss << "/";
    ss << name << ":" << FormatVersion(nClientVersion);
    if (!comments.empty())
        ss << "(" << boost::algorithm::join(comments, "; ") << ")";
    ss << "/";
    return ss.str();
}

#ifdef WIN32
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate)
{
    namespace fs = boost::filesystem;

    char pszPath[MAX_PATH] = "";

    if(SHGetSpecialFolderPathA(NULL, pszPath, nFolder, fCreate))
    {
        return fs::path(pszPath);
    }

    printf("SHGetSpecialFolderPathA() failed, could not obtain requested path.\n");
    return fs::path("");
}
#endif

void runCommand(std::string strCommand)
{
    int nErr = ::system(strCommand.c_str());
    if (nErr)
        printf("runCommand error: system(%s) returned %d\n", strCommand.c_str(), nErr);
}

void RenameThread(const char* name)
{
#if defined(PR_SET_NAME)
    // Only the first 15 characters are used (16 - NUL terminator)
    ::prctl(PR_SET_NAME, name, 0, 0, 0);
#elif 0 && (defined(__FreeBSD__) || defined(__OpenBSD__))
    // TODO: This is currently disabled because it needs to be verified to work
    //       on FreeBSD or OpenBSD first. When verified the '0 &&' part can be
    //       removed.
    pthread_set_name_np(pthread_self(), name);

// This is XCode 10.6-and-later; bring back if we drop 10.5 support:
// #elif defined(MAC_OSX)
//    pthread_setname_np(name);

#else
    // Prevent warnings for unused parameters...
    (void)name;
#endif
}

bool NewThread(void(*pfn)(void*), void* parg)
{
    try
    {
        boost::thread(pfn, parg); // thread detaches when out of scope
    } catch(boost::thread_resource_error &e) {
        printf("Error creating thread: %s\n", e.what());
        return false;
    }
    return true;
}
#include "qrcodedialog.h"
#include "ui_qrcodedialog.h"

#include "bitcoinunits.h"
#include "guiconstants.h"
#include "guiutil.h"
#include "optionsmodel.h"

#include <QPixmap>
#include <QUrl>

#include <qrencode.h>

QRCodeDialog::QRCodeDialog(const QString &addr, const QString &label, bool enableReq, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::QRCodeDialog),
    model(0),
    address(addr)
{
    ui->setupUi(this);
    if (label.trimmed().isEmpty()) {
        setWindowTitle(QString("Denarius - Generate QR Code"));
    } else {
        setWindowTitle(QString("Denarius - Generate QR Code for %1").arg(label));
    }
    ui->chkReqPayment->setVisible(enableReq);
    ui->lblAmount->setVisible(enableReq);
    ui->lnReqAmount->setVisible(enableReq);

    ui->lnLabel->setText(label);

    ui->btnSaveAs->setEnabled(false);

    genCode();
}

QRCodeDialog::~QRCodeDialog()
{
    delete ui;
}

void QRCodeDialog::setModel(OptionsModel *model)
{
    this->model = model;

    if (model)
        connect(mod


struct {
	VacancyID int64
	CreatedAt time.Time
}

func (q *Queries) VacancyViewDailyStatsUpsert(ctx context.Context, arg VacancyViewDailyStatsUpsertParams) error {
	_, err := q.exec(ctx, q.vacancyViewDailyStatsUpsertStmt, vacancyViewDailyStatsUpsert, arg.VacancyID, arg.CreatedAt)
	return err
}

const vacancyViewStats = `-- name: VacancyViewStats :many
SELECT s.vacancy_id,
       SUM(user_count) AS count
FROM vacancy_view_daily_stats s
WHERE s.vacancy_id = ANY ($1::BIGINT[])
  AND s.created_at >= $2::DATE
GROUP BY s.vacancy_id
`

type VacancyViewStatsParams struct {
	VacancyIds []int64
	From       time.Time
}

type VacancyViewStatsRow struct {
	VacancyID int64
	Count     int64
}

func (q *Queries) VacancyViewStats(ctx context.Context, arg VacancyViewStatsParams) ([]VacancyViewStatsRow, error) {
	rows, err := q.query(ctx, q.vacancyViewStatsStmt, vacancyViewStats, pq.Array(arg.VacancyIds), arg.From)
	if err != nil {
		return nil, err
	}
	defer rows.Close()
	var items []VacancyViewStatsRow
	for rows.Next() {
		var i VacancyViewStatsRow
		if err := rows.Scan(&i.VacancyID, &i.Count); err != nil {
			return nil, err
		}
		items = append(items, i)
	}
	if err := rows.Close(); err != nil {
		return nil, err
	}
	if err := rows.Err(); err != nil {
		return nil, err
	}
	return items, nil
}
package github

type UserResponse struct {
	ID    uint64 `json:"id"`
	Login string `json:"login"`
	Name  string `json:"name"`
	// NodeID            string      `json:"node_id"`
	// AvatarURL         string      `json:"avatar_url"`
	// GravatarID        string      `json:"gravatar_id"`
	// URL               string      `json:"url"`
	// HTMLURL           string      `json:"html_url"`
	// FollowersURL      string      `json:"followers_url"`
	// FollowingURL      string      `json:"following_url"`
	// GistsURL          string      `json:"gists_url"`
	// StarredURL        string      `json:"starred_url"`
	// SubscriptionsURL  string      `json:"subscriptions_url"`
	// OrganizationsURL  string      `json:"organizations_url"`
	// ReposURL          string      `json:"repos_url"`
	// EventsURL         string      `json:"events_url"`
	// ReceivedEventsURL string      `json:"received_events_url"`
	// Type              string      `json:"type"`
	// SiteAdmin         bool        `json:"site_admin"`
	// Company           interface{} `json:"company"`
	// Blog              string      `json:"blog"`
	// Location          string      `json:"location"`
	// Email             interface{} `json:"email"`
	// Hireable          interface{} `json:"hireable"`
	// Bio               interface{} `json:"bio"`
	// TwitterUsername   interface{} `json:"twitter_username"`
	// PublicRepos       int         `json:"public_repos"`
	// PublicGists       int         `json:"public_gists"`
	// Followers         int         `json:"followers"`
	// Following         int         `json:"following"`


Name("_serviceRequest")
external fun serviceRequest(
  particlePtr: WasmAddress,
  callPtr: WasmString,
  argsPtr: WasmString,
  tagPtr: WasmString
)

@SymbolName("_resolveUrl")
external fun resolveUrl(urlPtr: WasmString): WasmString

@SymbolName("write")
external fun write(msg: WasmString)

@SymbolName("flush")
external fun flush()

fun log(msg: String) {
  write(msg.toWasmString())
  flush()
}
package arcs.core.util

/**
 * A miniature lightweight "Optics" utility for Arcs. Mostly used for modifying immutable graph
 * data structures used by the [Allocator].
 *
 * # Lens
 * A lens is a kind of optic in functional programming that allows immutable data structures to
 * be updated compactly and elegantly. A [Lens] is constructed around a data structure and
 * allows its focus target (e.g. field member of a type) to be fetched, modified, or set.
 *
 * A [Lens] can be created easily by the [lens] function around a reference to a property, followed
 * by a code block to copy-construct a class with the modification.
 *
 * ## Example
 * ```kotlin
 * data class Person(name: String, age: Int)
 * val nameLens = lens(Person::name) { t,f -> t.copy(name = f) }
 *
 * val newPerson = nameLens.set(Person("John", 26), "Tom") // result: Person("Tom", 26)
 * val name = nameLens.get(newPerson)                      // result: "Tom"
 * val bang = nameLens.mod(newPerson) { "$it!" }           // result: "Tom!"
 * ```
 *
 * ## Composition
 * Two or more lens can be composed for deep object graph mutation.
 * ```kotlin
 * data class Manager(name: String, employee: Person)
 *
 * val employeeLens = lens(Manager::employee) { t,f -> t.copy(employee = f) }
 * val employeeName = employeeLens + nameLens
 * val manager = Manager("Sally", person)
 * val newManager = employeeName.set(manager, "Rita") // Manager("Sally", Person("Rita", 26))
 * ```
 *
 * ## Traversals
 * When you have a collection field, you need a lens with multiple focii, which is where
 * [Traversal] comes in. It allows you to mutate each member of a collection field (List or Map)
 * constructing a new collection. In the case of [Map], the map values are traversed, the keys
 * are left intact.
 *
 * ## Example: Modify the age of each child
 * ```kotlin
 * data class Parent(name: String, children: List<Person>)
 * val parent = Parent("Mary", listOf(Person("Jack", 4), Person("Jill", 3)))
 * val childrenLens = lens(Parent::children) { t, f = t.copy(children = f) }
 * val ageLens = lens(Person::age) { t,f -> t.copy(age = f) }
 *
 * val allChildren = childrenLens.traverse()
 * val newParent = allChildren.mod(parent) { it.copy(name = "Baby ${it.name}") }
 * // newParent = Parent("Mary", listOf(Person("Baby Jack", 4), Person("Baby Jill", 3)))
 * ```
 *
 * ## Traversal Composition
 * A [Traversal] can be combined with a [Lens], or a another [Traversal] to reach deep into
 * nested data structures.
 *
 * ```kotlin
 * val allChildrenAges = allChildren + ageLens
 * val newParent = allChildrenAges.mod(parent) { it + 1 }
 * // newParent = Parent("Mary", listOf(Person("Jack", 5), Person("Jill", 4)))
 * ```
 *
 * ## Reference
 * Based on the ideas in
 * [http://davids-code.blo


modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#pragma once
#include <stratosphere.hpp>

namespace ams::capsrv::server::jpeg {

    struct SoftwareJpegShrinkerInput {
        const void *jpeg;
        size_t jpeg_size;
        u32 width;
        u32 height;
        bool fancy_upsampling;
        bool block_smoothing;
    };

    struct SoftwareJpegShrinkerOutput {
        u64 *out_size;
        s32 *out_width;
        s32 *out_height;
        void *dst;
        size_t dst_size;
    };

    class SoftwareJpegShrinker {
        public:
            static Result ShrinkRgba8(SoftwareJpegShrinkerOutput &output, const SoftwareJpegShrinkerInput &input, int quality, void *work, size_t work_size);
    };

}/*
 * Copyright (c) Atmosphère-NX
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include <stratosphere.hpp>

namespace ams::nsd::impl::device {

    namespace {

        constexpr const char SettingsName[] = "nsd";
        constexpr const char SettingsKey[]  = "environment_identifier";

        constinit os::SdkMutex g_environment_identifier_lock;
        constinit EnvironmentIdentifier g_environment_identifier = {};
        constinit bool g_determined_environment_identifier = false;

    }

    const EnvironmentIdentifier &GetEnvironmentIdentifierFromSettings() {
        if (AMS_UNLIKELY(!g_determined_environment_identifier)) {
            std::scoped_lock lk(g_environment_identifier_lock);

            if (AMS_LIKELY(!g_determined_environment_identifier)) {
                /* Check size. */
                AMS_ABORT_UNLESS(settings::fwdbg::GetSettingsItemValueSize(SettingsName, SettingsKey) != 0);

                /* Get value. */
                const size_t size = settings::fwdbg::GetSettingsItemValue(g_environment_identifier.value, EnvironmentIdentifier::Size, SettingsName, SettingsKey);
                AMS_ABORT_UNLESS(size < EnvironmentIdentifier::Size);
                AMS_ABORT_UNLESS(g_environment_identifier == EnvironmentIdentifierOfProductDevice || g_environment_identifier == EnvironmentIdentifierOfNotProductDevice);

                g_determined_environment_identifier = true;
            }
        }

        return g_environment_identifier;
    }

}
/*
 * Copyright (c) Atmosphère-NX
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#pragma once
#include


ydsf40VLAn8etYBk5HxHEFprKi1viadDC7v\n" +
            "xl4erH45pmxbGiawOC2jX/W36Yfi/SDqoo5TeUHamdL4U6DWjLzxPcBVUm7HIyr9\n" +
            "2r+mwQuvWeIDJ6XjGVlpfsErSyOSgYh/XTCa1hawSRT5PAfOifOKMwF0Yqr5fXZY\n" +
            "BWTjm3M/PV+kamF118/Y+DZeEr6liG/OyIeWGcnv0IqxxxDukMbqZLuSZo9t1wEZ\n" +
            "lTganTsS5avNfrMuL29YQjdzmU2p471ZM381Z+a5sqD/T/+mpnv05Ae8DvgMJo7c\n" +
            "EE68r305AoGBAORFzo4iGNIVsCjRpSkMeQXN4UOG3Tv3orKJaMlas101lMQwHmu6\n" +
            "Ui8PqUK5rz8ziZvLyPJjo8lSbsVYO/RH9BxwJOIBxHbQTYTfSQyBeW5dom3LNN1k\n" +
            "xEXiGPqQcn/rGPYVCJffImQYE2UbMad6ju0qg2YHW0CWecTE5zC9nRl9AoGBAM5g\n" +
            "iTiK8/UL7yusph6lTxiNnDZztEskITE7xY5mda4VBkckRMO8J6hEyLMnbWvi645M\n" +
            "ckCoeTRklwJ4AdaSzKXdbFywIxVkB+ciYJ76juC7pIRmgaNaKgx0og1wtzc4e9KQ\n" +
            "Uch+2MIHkgfPQrY/vBmS+rBqE4cK/H8LLqpSbgrzAoGBAKQtLLz++vkGDjedaHsY\n" +
            "dGZfR3eIpM8/cK2VtF61NDGCmudrcEWssPUV/3d1EvyStZLuwyzJyv+9oNugdSZh\n" +
            "JcnaQjymZsXJVSeOa/xplotxHqR2tSPSGHPmhG6ZuzATR1WdlRudqR9yTWi3YUQC\n" +
            "Go+qtuyHt/LBBv0lXN2qUjYFAoGAUw4oy1eonJrj8zi1VioDLgd3sbZY/dCZhx3e\n" +
            "ANQdUiTl9OWUww1LDH46I1efwsZ9NDRx2rGyrbI5z+WKH9fOgoYdISRFyksKnyuH\n" +
            "pRODQtBhgmNakuord/3MZgpRweh6dKBeOYlLJLM1Qu1XlM8LnWM4fp0CJNv4CAzx\n" +
            "B9zKqp8CgYEAysNuHbhUCkr0ZuUjPaKmZegxjyiqkrahNSZJjVQJfmicTwJBlqAv\n" +
            "Z10/PLpJ7dXNS1DdHT5hLXczCd/9BA9EsmiU6Ny/TshHw2BcSBLfQBS7KYEh/+cQ\n" +
            "D256kKbCmQKlNYs3bZEuAcVsrBabIPNIfxMzc+bdxUsW+fTw8DP8zzE="
}
package io.embrace.android.embracesdk.internal.utils

import java.net.MalformedURLException
import java.net.URL
import java.nio.charset.Charset
import java.util.regex.Pattern

object NetworkUtils {

    private const val TRACE_ID_MAXIMUM_ALLOWED_LENGTH = 64
    private const val DNS_PATTERN =
        "([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,63}[a-zA-Z0-9])?)(\\.[a-zA-Z]{1,63})(\\.[a-zA-Z]{1,2})?$"
    private const val IPV4_PATTERN =
        "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
    private const val IPV6_PATTERN = "(([a-fA-F0-9]{1,4}|):){1,7}([a-fA-F0-9]{1,4}|:)"

    private val IpAddrPattern = Pattern.compile("$IPV4_PATTERN|$IPV6_PATTERN")
    private val DomainPattern = Pattern.compile("$DNS_PATTERN|$IPV4_PATTERN|$IPV6_P


})
      expect(section_checkbox).toBeVisible()
      expect(within(document.body).getByTestId('frequency-picker')).toBeVisible()
      expect(within(document.body).getByDisplayValue('Does not repeat')).toBeVisible()

      fireEvent.click(section_checkbox)
      await waitForRender()
      expect(within(document.body).queryByTestId('frequency-picker')).not.toBeVisible()
    })

    it('shows the duplicates when section dates are enabled', async () => {
      const sections = [{id: 1}]
      server.use(http.get('/api/v1/courses/21/sections', () => HttpResponse.json(sections)))

      const event = new CalendarEvent({
        context_code: 'course_1',
        sections_url: '/api/v1/courses/21/sections',
      })
      event.sync = () => {}

      new EditEventView({el: document.getElementById('content'), model: event})

      const section_checkbox = await within(document.body).findByRole('checkbox', {
        id: 'use_section_dates',
      })
      expect(section_checkbox).toBeVisible()
      expect(document.getElementById('duplicate_event')).not.toBeVisible()

      await userEvent.click(section_checkbox)

      expect(document.getElementById('duplicate_event')).toBeVisible()
    })

    it('renders update calendar event dialog', async () => {
      const view = render({series_uuid: '123', rrule: 'FREQ=WEEKLY;BYDAY=MO;INTERVAL=1;COUNT=5'})
      await waitForRender()
      view.submit(null)

      await waitFor(() =>
        expect(
          UpdateCalendarEventDialogModule.renderUpdateCalendarEventDialog,
        ).toHaveBeenCalledWith(expect.objectContaining(view.model.attributes)),
      )
    })

    it('does not render update calendar event dialog when saving a single event', async () => {
      render({series_uuid: null, rrule: null})
      await waitForRender()
      userEvent.click(await screen.findByText('Update Event'))

      await waitFor(() =>
        expect(
          UpdateCalendarEventDialogModule.renderUpdateCalendarEventDialog,
        ).not.toHaveBeenCalled(),
      )
    })

    it('does not render update calendar event dialog when changing series to a single event', async () => {
      render({series_uuid: '123', rrule: 'FREQ=WEEKLY;BYDAY=MO;INTERVAL=1;COUNT=5'})
      await waitForRender()
      userEvent.click(await screen.findByText('Frequency'))
      userEvent.click(await screen.findByText('Does not repeat'))
      userEvent.click(await screen.findByText('Update Event'))

      await waitFor(() =>
        expect(
          UpdateCalendarEventDialogModule.renderUpdateCalendarEventDialog,
        ).not.toHaveBeenCalled(),
      )
    })

    it('submits which params for recurring events', async () => {
      expect.assertions(1)
      const view = render({
        rrule: 'FREQ=DAILY;INTERVAL=1;COUNT=3',
        series_uuid: '123',
      })
      await waitForRender()
      view.renderWhichEditDialog = jest.fn(() => Promise.resolve('all'))
      view.model.save = jest.fn(() => {
        expect(view.model.get('which')).toEqual('all')
      })
      view.submit(null)
      await waitFor(() => {
        if (view.model.get('which') !== 'all') throw new Error('which was not set')
      })
    })
  })
})
/*
 * Copyright (C) 2017 - present Instructure, Inc.
 *
 * This file is part of Canvas.
 *
 * Canvas is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Canvas is distributed in the hope that it will


 NULL,
						   PRIMARY KEY (`id`),
						   UNIQUE KEY (`host`),
						   KEY `is_up` (`is_up`),
						   KEY `is_restricted` (`is_restricted`),
						   KEY `error_day_count` (`error_day_count`)
						) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;""");
				HashSet<String> servers=new HashSet<>();
				servers.addAll(new SQLQueryBuilder(conn).selectFrom("users").columns("domain").distinct().where("domain<>''").executeAsStream(rs->rs.getString(1).toLowerCase()).collect(Collectors.toSet()));
				servers.addAll(new SQLQueryBuilder(conn).selectFrom("groups").columns("domain").distinct().where("domain<>''").executeAsStream(rs->rs.getString(1).toLowerCase()).collect(Collectors.toSet()));
				PreparedStatement stmt=conn.prepareStatement("INSERT INTO `servers` (`host`) VALUES (?)");
				for(String domain:servers){
					stmt.setString(1, domain);
					stmt.execute();
				}
				conn.createStatement().execute("""
						CREATE TABLE `stats_daily` (
						  `day` date NOT NULL,
						  `type` int unsigned NOT NULL,
						  `object_id` int unsigned NOT NULL,
						  `count` int unsigned NOT NULL,
						  PRIMARY KEY (`day`,`type`,`object_id`)
						) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;""");
			}
			case 29 -> conn.createStatement().execute("ALTER TABLE `users` ADD `privacy` json DEFAULT NULL");
			case 30 ->{
				conn.createStatement().execute("""
						CREATE TABLE `mail_messages` (
						  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
						  `owner_id` int unsigned NOT NULL,
						  `sender_id` int unsigned NOT NULL,
						  `to` varbinary(1024) NOT NULL,
						  `cc` varbinary(1024) DEFAULT NULL,
						  `text` text NOT NULL,
						  `subject` text NOT NULL,
						  `attachments` json DEFAULT NULL,
						  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
						  `updated_at` timestamp NULL DEFAULT NULL,
						  `deleted_at` timestamp NULL DEFAULT NULL,
						  `read_receipts` varbinary(1024) DEFAULT NULL,
						  `ap_id` varchar(300) CHARACTER SET ascii COLLATE ascii_general_ci DEFAULT NULL,
						  `reply_info` json DEFAULT NULL,
						  `related_message_ids` varbinary(1024) DEFAULT NULL,
						  PRIMARY KEY (`id`),
						  KEY `owner_id` (`owner_id`),
						  KEY `sender_id` (`sender_id`),
						  KEY `ap_id` (`ap_id`),
						  KEY `deleted_at` (`deleted_at`),
						  KEY `read_receipts` (`read_receipts`),
						  FULLTEXT KEY `text` (`text`,`subject`),
						  CONSTRAINT `mail_messages_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
						) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;""");
				conn.createStatement().execute("""
						CREATE TABLE `mail_messages_peers` (
						  `owner_id` int unsigned NOT NULL,
						  `peer_id` int unsigned NOT NULL,
						  `message_id` bigint unsigned NOT NULL,
						  KEY `owner_id` (`owner_id`),
						  KEY `message_id` (`message_id`),
						  KEY `peer_id` (`peer_id`),
						  CONSTRAINT `mail_messages_peers_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
						  CONSTRAINT `mail_messages_peers_ibfk_2` FOREIGN KEY (`message_id`) REFERENCES `mail_messages` (`id`) ON DELETE CASCADE
						) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;""");
				con


te", nil, {"Vá à Bastilha da Presa Negra e consiga o Símbolo Sagrado do Comandante do Comandante Floraval, 5 feixes de Lunalenha e 5 Essências Fantasmagóricas."}},
[27436] = {"A tarefa do andarilho das sombras", nil, {"Vá à Bastilha da Presa Negra e consiga o Símbolo Sagrado do Comandante do Comandante Floraval, 5 feixes de Lunalenha e 5 Essências Fantasmagóricas."}},
[27437] = {"A ordem da clériga das trevas", nil, {"Vá à Bastilha da Presa Negra e consiga o Símbolo Sagrado do Comandante do Comandante Floraval, 5 feixes de Lunalenha e 5 Essências Fantasmagóricas."}},
[27438] = {"A grande fuga", nil, {"Fuja das Ruínas de Guilnéas com Artura e o cadáver de Lorde Godfrey."}},
[27439] = {"Cajado da Luz", nil, {"Vá à Bastilha da Presa Negra e consiga o Símbolo Sagrado do Comandante Floraval, 5 feixes de Lunalenha e 5 Essências Fantasmagóricas."}},
[27440] = {"Trolls, ogros, orcs... ai, ai...", nil, {"Mate o Senhor da Guerra Voone, o Grão-lorde Omokk e o Lorde Supremo Wyrmthalak."}},
[27441] = {"O cajado do vidente", nil, {"Vá à Bastilha da Presa Negra e consiga o Símbolo Sagrado do Comandante do Comandante Floraval, 5 feixes de Lunalenha e 5 Essências Fantasmagóricas."}},
[27442] = {"As muitas frentes de batalha", nil, {"Fale com o Clarividente Krogar, no Santuário Ocidental da Terra, que fica em Orgrimmar."}},
[27443] = {"As muitas frentes de batalha", nil, {"Fale com Oraterra Naraat no Santuário Oriental da Terra, que fica em Ventobravo."}},
[27444] = {"O falso Chefe Guerreiro", nil, {"Mate o Chefe Guerreiro Laceral Mão Negra."}},
[27445] = {"General Drakkisath, o braço direito de Nefarian", nil, {"Mate o General Drakkisath."}},
[27446] = {"O chamado de Tanaris", nil, {"Fale com Kelsey Fagulhaço em Geringontzan, que fica em Tanaris."}},
[27447] = {"O chamado de Tanaris", nil, {"Fale com Carlota Tomanota em Geringontzan, que fica em Tanaris."}},
[27448] = {"A jornada continua", nil, {"Embarque na Caravana da Fiona quando você estiver pronto para seguir para a próxima torre."}},
[27449] = {"Honra e força", nil, {"Passe no teste de força de Vex'tul."}},
[27450] = {"O apreço de Frederick por peixes", nil, {"Obtenha 8 Baiacus Empesteados, 8 Caramujões de Infectis e 8 Caranguejos-aranha de Infectis da Fenda Infectis."}},
[27451] = {"Matar com propósito", nil, {"Viaje para o Cruzamento de Corin, ao sul, e mate membros do Flagelo que habitam a cidade. Colete 7 pedaços de Putrefação Viva. Use o Almofariz e Pilão para moer a Putrefação Viva, de maneira a transformá-la em Putrefação Coagulada."}},
[27452] = {"Traje Sombrio", nil, {"Obtenha um Capuz de Sectário da Morte e Vestes de Sectário da Morte de sect


SettingsR\x12autoscalerSettings\x12E\n" +
	"\x0ffunction_schema\x18P \x01(\v2\x1c.modal.client.FunctionSchemaR\x0efunctionSchema\x12b\n" +
	"\x14experimental_options\x18Q \x03(\v2/.modal.client.Function.ExperimentalOptionsEntryR\x13experimentalOptions\x12:\n" +
	"\x19mount_client_dependencies\x18R \x01(\bR\x17mountClientDependencies\x12,\n" +
	"\x12flash_service_urls\x18S \x03(\tR\x10flashServiceUrls\x12.\n" +
	"\x13flash_service_label\x18T \x01(\tR\x11flashServiceLabel\x12.\n" +
	"\x13enable_gpu_snapshot\x18U \x01(\bR\x11enableGpuSnapshot\x120\n" +
	"\x14startup_timeout_secs\x18V \x01(\rR\x12startupTimeoutSecs\x12P\n" +
	"\x17supported_input_formats\x18W \x03(\x0e2\x18.modal.client.DataFormatR\x15supportedInputFormats\x12R\n" +
	"\x18supported_output_formats\x18X \x03(\x0e2\x18.modal.client.DataFormatR\x16supportedOutputFormats\x1ad\n" +
	"\x16MethodDefinitionsEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x124\n" +
	"\x05value\x18\x02 \x01(\v2\x1e.modal.client.MethodDefinitionR\x05value:\x028\x01\x1aF\n" +
	"\x18ExperimentalOptionsEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
	"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"k\n" +
	"\x0eDefinitionType\x12\x1f\n" +
	"\x1bDEFINITION_TYPE_UNSPECIFIED\x10\x00\x12\x1e\n" +
	"\x1aDEFINITION_TYPE_SERIALIZED\x10\x01\x12\x18\n" +
	"\x14DEFINITION_TYPE_FILE\x10\x02\"f\n" +
	"\fFunctionType\x12\x1d\n" +
	"\x19FUNCTION_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n" +
	"\x17FUNCTION_TYPE_GENERATOR\x10\x01\x12\x1a\n" +
	"\x16FUNCTION_TYPE_FUNCTION\x10\x02B\v\n" +
	"\t_proxy_idB\x11\n" +
	"\x0f_cloud_providerB\x16\n" +
	"\x14_scheduler_placementB\x19\n" +
	"\x17X_experimental_proxy_ipJ\x04\b\x14\x10\x15J\x04\b0\x101J\x04\b1\x102J\x04\b4\x105J\x04\b9\x10:J\x04\b:\x10;J\x04\b;\x10<\"\x98\x01\n" +
	"\x1aFunctionAsyncInvokeRequest\x12\x1f\n" +
	"\vfunction_id\x18\x01 \x01(\tR\n" +
	"functionId\x12&\n" +
	"\x0fparent_input_id\x18\x02 \x01(\tR\rparentInputId\x121\n" +
	"\x05input\x18\x03 \x01(\v2\x1b.modal.client.FunctionInputR\x05input\"|\n" +
	"\x1bFunctionAsyncInvokeResponse\x123\n" +
	"\x16ret


cm-s-qbjs .CodeMirror-line > span::-moz-selection, .cm-s-qbjs .CodeMirror-line > span > span::-moz-selection { background: rgba(69, 68, 59, .99); }
.cm-s-qbjs .CodeMirror-cursor { border-left: 1px solid #fff; } /* overflow: hidden; width: 0px;} */
.cm-s-qbjs pre { padding: 0 8px; }/*editable code holder*/

.cm-s-qbjs.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/

.cm-s-qbjs .CodeMirror-gutters { background: rgb(0, 49, 78); border-right:1px solid #aaa; }
.cm-s-qbjs .CodeMirror-guttermarker { color: #599eff; }
.cm-s-qbjs .CodeMirror-guttermarker-subtle { color: #777; }
.cm-s-qbjs .CodeMirror-linenumber { color: rgb(175, 175, 175); }

.cm-s-qbjs span.cm-header { color: #a0a; }
.cm-s-qbjs span.cm-quote { color: #090; }
.cm-s-qbjs span.cm-keyword { color: rgb(69, 118, 147); }
.cm-s-qbjs span.cm-atom { color: #C2B470; }
.cm-s-qbjs span.cm-number { color: rgb(216, 98, 78); }
.cm-s-qbjs span.cm-def { color: white; }
.cm-s-qbjs span.cm-variable { color:rgb(216, 216, 216); }
.cm-s-qbjs span.cm-variable-2 { color: #669199; }
.cm-s-qbjs span.cm-variable-3, .cm-s-qbjs span.cm-type { color: white; }
.cm-s-qbjs span.cm-property { color: #92A75C; }
.cm-s-qbjs span.cm-operator { color: #92A75C; }
.cm-s-qbjs span.cm-comment { color: rgb(98, 98, 98); }
.cm-s-qbjs span.cm-string { color: rgb(255, 167, 0); }
.cm-s-qbjs span.cm-string-2 { color: #f50; }
.cm-s-qbjs span.cm-meta { color: #738C73; }
.cm-s-qbjs span.cm-qualifier { color: #555; }
.cm-s-qbjs span.cm-builtin { color: rgb(69, 118, 147); }
.cm-s-qbjs span.cm-bracket { color: #EBEFE7; }
.cm-s-qbjs span.cm-tag { color: #669199; }
.cm-s-qbjs span.cm-attribute { color: #81a4d5; }
.cm-s-qbjs span.cm-hr { color: #999; }
.cm-s-qbjs span.cm-link { color: #7070E6; }
/*.cm-s-qbjs span.cm-error { color: #9d1e15; }*/
.cm-s-qbjs span.cm-error { color: #999; }

.cm-s-qbjs .CodeMirror-activeline-background { background: rgb(0, 49, 78); }
.cm-s-qbjs .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; }

.cm-s-qbjs .CodeMirror-search-field { font-family: dosvga; font-size: 1em; }
.cm-s-qbjs .cm-searching { color: #333 !important; background-color: #ccc; }

#help-nav a:hover { color: #fff;  }
#help-nav a:before { content: "< "; }
#help-nav a:after { content: " >"; }
#help-nav a { margin-right: 0px; }
.cm-s-blackout {


family: var(--o3-type-body-base-font-family);
	font-size: var(--o3-type-body-base-font-size);
	font-weight: var(--o3-type-body-base-font-weight);
	line-height: var(--o3-type-body-base-line-height);
}
@import '@financial-times/o-private-foundation/main';

@import 'src/scss/variables';
@import 'src/scss/mixins';
@import 'src/scss/grid';
@import 'src/scss/elements';
@import 'src/scss/layout';

@import 'src/scss/themes/branded';
@import 'src/scss/themes/full-bleed-offset';
@import 'src/scss/themes/split-text';
@import 'src/scss/themes/full-bleed-image';
@import 'src/scss/themes/package';
@import 'src/scss/themes/right-rail';
@import 'src/scss/themes/centered';
@import 'src/scss/themes/deep-portrait';
@import 'src/scss/themes/deep-landscape';

@mixin oTopper(
	$opts: (
		'themes': $_o-topper-themes,
		'elements': $_o-topper-elements,
		'colors': $_o-topper-colors,
	),
	$include-base-styles: true
) {
	@include oPrivateFoundation();

	// Get topper themes to include.
	$themes: map-get($opts, 'themes');
	$themes: if($themes, $themes, ());
	// Get topper elements to include.
	$elements: map-get($opts, 'elements');
	$elements: if($elements, $elements, ());
	// Get topper colors to include.
	$colors: map-get($opts, 'colors');
	$colors: if($colors, $colors, ());

	// Output base styles required by all themes.
	@if $include-base-styles {
		.o-topper {
			@include _oTopperBase;
		}
	}

	// Output chosen elements, colours, and themes.
	@include _oTopperElements($elements);
	@include _oTopperColors($colors);
	@include _oTopperThemes($themes, $colors);
}

@if ($o-topper-is-silent == false) {
	@include oTopper();
	$o-topper-is-silent: true !global;
}
@import '@financial-times/math';
@import '@financial-times/o-brand/main';

@import 'src/scss/variables';
@import 'src/scss/palette';
@import 'src/scss/use-cases';
@import 'src/scss/functions';
@import 'src/scss/mixins';

// Set the palette colors programatically
// NOTE: Only do this once as this partial will be included by many other components
// and the multiple nested loops can have a huge effect on compilation performance.
@if ($_o-colors-is-initialised == false) {
	@include _oColorsSetDefaultPaletteColors();
	@include _oColorsSetPaletteMixes();
	@include _oColorsSetPaletteTones();
	@include _oColorsSetDefaultUsecases();

	$_o-colors-is-initialised: true !global;
}

/// Output `o-colors` CSS.
///
/// @example Output all `o-colors` styles.
///     @include oColors();
///
/// @example Output only `o-colors` CSS custom properties ("CSS variables") for palette colours and usecases.
///     @include oColors($opts: (
///     	'palette-custom-properties': true,
///     	'usecase-custom-properties': true
///     ));
///
/// @example Output only `o-colors` classes for usecases.
///     @include oColors($opts: (
///     	'usecase-classes': tru


/*
 * libmad - MPEG audio decoder library
 * Copyright (C) 2000-2004 Underbit Technologies, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * $Id: frame.h,v 1.20 2004/01/23 09:41:32 rob Exp $
 */

# ifndef LIBMAD_FRAME_H
# define LIBMAD_FRAME_H

# include "fixed.h"
# include "timer.h"
# include "stream.h"

enum mad_layer {
  MAD_LAYER_I   = 1,			/* Layer I */
  MAD_LAYER_II  = 2,			/* Layer II */
  MAD_LAYER_III = 3			/* Layer III */
};

enum mad_mode {
  MAD_MODE_SINGLE_CHANNEL = 0,		/* single channel */
  MAD_MODE_DUAL_CHANNEL	  = 1,		/* dual channel */
  MAD_MODE_JOINT_STEREO	  = 2,		/* joint (MS/intensity) stereo */
  MAD_MODE_STEREO	  = 3		/* normal LR stereo */
};

enum mad_emphasis {
  MAD_EMPHASIS_NONE	  = 0,		/* no emphasis */
  MAD_EMPHASIS_50_15_US	  = 1,		/* 50/15 microseconds emphasis */
  MAD_EMPHASIS_CCITT_J_17 = 3,		/* CCITT J.17 emphasis */
  MAD_EMPHASIS_RESERVED   = 2		/* unknown emphasis */
};

struct mad_header {
  enum mad_layer layer;			/* audio layer (1, 2, or 3) */
  enum mad_mode mode;			/* channel mode (see above) */
  int mode_extension;			/* additional mode info */
  enum mad_emphasis emphasis;		/* de-emphasis to use (see above) */

  unsigned long bitrate;		/* stream bitrate (bps) */
  unsigned int samplerate;		/* sampling frequency (Hz) */

  unsigned short crc_check;		/* frame CRC accumulator */
  unsigned short crc_target;		/* final target CRC checksum */

  int flags;				/* flags (see below) */
  int private_bits;			/* private bits (see below) */

  mad_timer_t duration;			/* audio playing time of frame */
};

struct mad_frame {
  struct mad_header header;		/* MPEG audio header */

  int options;				/* decoding options (from stream) */

  mad_fixed_t sbsample[2][36][32];	/* synthesis subband filter samples */
  mad_fixed_t overlap[2][32][18];	/* Layer III block overlap data */

  mad_fixed_t xr_raw[576*2];
  mad_fixed_t tmp[576];
};

# define MAD_NCHANNELS(header)		((header)->mode ? 2 : 1)
# define MAD_NSBSAMPLES(header)  \
  ((header)->layer == MAD_LAYER_I ? 12 :  \
   (((header)->layer == MAD_LAYER_III &&  \
     ((header)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36))

enum {
  MAD_FLAG_NPRIVATE_III	= 0x0007,	/* number of Layer III private bits */
  MAD_FLAG_INCOMPLETE	= 0x0008,	/* header but not data is decoded */

  MAD_FLAG_PROTECTION	= 0x0010,	/* frame has CRC protection */
  MAD_FLAG_COPYRIGHT	= 0x0020,	/* frame is copyright */
  MAD_FLAG_ORIGINAL	= 0x0040,	/* frame is original (else copy) */
  MAD_FLAG_PADDING	= 0x0080,	/* frame has additional slot */

  MAD_FLAG_I_STEREO	= 0x0100,	/* uses intensity joint stereo */
  MAD_FLAG_MS_STEREO	= 0x0200,	/* uses middle/side joint stereo */
  MAD_FLAG_FREEFORMAT	= 0x0400,	/* uses free format bitrate */

  MAD_FLAG_LSF_EXT	= 0x1000,	/* lower sampling freq. extension */
  MAD_FLAG_MC_EXT	= 0x2000,	/* multichannel audio extension */
  MAD_FLAG_MPEG_2_5_EXT	= 0x4000	/* MPEG 2.5 (unofficial) extension */
};

enum {
  MAD_PRIVATE_HEADER	= 0x0100,	/* header private bit */
  MAD_PRIVATE_III	= 0x001f	/* Layer III private bits (up to 5) */
};

void mad_header_init(struct mad_header *);

# define mad_header_finish(header)  /* nothing */

int mad_header_decode(struct mad_header *, struct mad_stream *);

void mad_frame_init(struct mad_frame *);
void mad_frame_finish(struct mad_frame *);

int mad_frame_decode(struct mad_frame *, struct mad_stream *);

void mad_frame_mute(struct mad_frame *);

# endif


err_withmsg             ; Controller error
    zendif

    ; Dig further for errors

    and #ST4_ABNORMAL_TERM
    zif ne
        lda disk_status+1
        and #ST5_DRV_NOT_MOUNTED
        zif ne
            ; Was not mounted
            ldx drive_letter
            lda #<notmntederr_msg
            ldy #>notmntederr_msg
            jmp err_withchar
        zendif

        ; If we are here, there was an unexpected error

        ldx drive_letter
        lda #<unmnterr_msg
        ldy #>unmnterr_msg
        jmp err_withchar
    zendif

    jmp inf_done
zendproc

; Update config to flash. Not yet supported
;
zproc save_config
    lda #<unknown_msg
    ldy #>unknown_msg
    jsr err_withchar
    jmp err_usage
zendproc

; Create an empty image on the SD card.
;
zproc create_image

    jsr validate_image_name
    zif cs
        rts
    zendif

    ; Set filename1
    ;
    ; NOTE: We can do this because DMA_BUFFER is page aligned!
    ;
    ldy #4                          ; Skip image parameters
    lda #>DMA_BUFFER
    sty filename1+0
    sta filename1+1

    jsr set_image_name              ; Copy image name at DMA_BUFFER,Y
                                    ; On exit, Y points to the next char after
                                    ; image name in command line
    jsr skip_sp

    cmp #0                          ; End of command line?
    zif ne
        jsr get_option              ; No, get option
        zif cs
            jmp err_usage           ; Syntax error
        zendif
        cpx #'P'                    ; Create packaged image
        zif eq
            ldx #PACKAGED_IMG
            stx pk_flag
        zelse
            lda #<unknown_msg
            ldy #>unknown_msg
            jsr err_withchar        ; No other switches are supported
            jmp err_usage
        zendif
    zendif

    jsr skip_sp

    cmp #0
    zif ne
        jmp err_usage               ; Nothing else expected
    zendif

    lda #$01                        ; Set DMA direction bit to write
    sta HSRC

    ; Set buffer for sending mount info

    lda #BUFFER_DMA
    sta ADMA

    ; Prepare the command data

    lda #77                         ; Tracks
    sta DMA_BUFFER+0
    lda #26                         ; Sectors
    sta DMA_BUFFER+1
    lda #1                          ; Sector size ( 1 == 256bytes )
    ora pk_flag                     ; Whether or not is a packaged image
    sta DMA_BUFFER+2
    lda #0xe5                       ; Filler byte
    sta DMA_BUFFER+3
    ldy #EXT_CMD_NEW                ; Create image
    jsr fdc_exec_extended
    zif cs
        lda #<fdc_msg
        ldx #>fdc_msg
        jmp err_withmsg             ; Controller error
    zendif

    ; Dig further for errors

    lda disk_status
    and #ST4_ABNORMAL_TERM
    zif ne
        lda #ST5_IMG_NAME
        bit disk_status+1
        ; Testing for ST5_IMG_NAME
        zif ne
            lda #<imagerr_msg
            ldx #>imagerr_msg
            jmp err_withmsg
        zendif
        ; Testing for ST5_DISK_FULL (0b10000000)
        zif mi
            lda #<diskfull_msg
            ldx #>diskfull_msg
            jmp err_withmsg
        zendif
        ; Testing for ST5_IMG_EXIST


assert"
	"github.com/stretchr/testify/require"
)

func TestSetContextMetadata(t *testing.T) {
	{
		ctx := reporthandlingv2.ContextMetadata{}
		scanInfo := &ScanInfo{}
		scanInfo.setContextMetadata(context.TODO(), &ctx)

		assert.NotNil(t, ctx.ClusterContextMetadata)
		assert.Nil(t, ctx.DirectoryContextMetadata)
		assert.Nil(t, ctx.FileContextMetadata)
		assert.Nil(t, ctx.HelmContextMetadata)
		assert.Nil(t, ctx.RepoContextMetadata)
	}
	// TODO: tests were commented out due to actual http calls ; http calls should be mocked.
	/*{
		ctx := reporthandlingv2.ContextMetadata{}
		setContextMetadata(&ctx, "https://github.com/kubescape/kubescape")
		assert.Nil(t, ctx.ClusterContextMetadata)
		assert.Nil(t, ctx.DirectoryContextMetadata)
		assert.Nil(t, ctx.FileContextMetadata)
		assert.Nil(t, ctx.HelmContextMetadata)
		assert.NotNil(t, ctx.RepoContextMetadata)
		assert.Equal(t, "kubescape", ctx.RepoContextMetadata.Repo)
		assert.Equal(t, "kubescape", ctx.RepoContextMetadata.Owner)
		assert.Equal(t, "master", ctx.RepoContextMetadata.Branch)
	}*/
}

func TestGetHostname(t *testing.T) {
	// Test that the hostname is not empty
	assert.NotEqual(t, "", getHostname())
}

func TestGetScanningContext(t *testing.T) {
	repoRoot, err := os.MkdirTemp("", "repo")
	require.NoError(t, err)
	defer func(name string) {
		_ = os.Remove(name)
	}(repoRoot)
	_, err = git.PlainClone(repoRoot, false, &git.CloneOptions{
		URL: "https://github.com/kubescape/http-request",
	})
	require.NoError(t, err)
	tmpFile, err := os.CreateTemp("", "single.*.txt")
	require.NoError(t, err)
	defer func(name string) {
		_ = os.Remove(name)
	}(tmpFile.Name())
	tests := []struct {
		name  string
		input string
		want  ScanningContext
	}{
		{
			name:  "empty input",
			input: "",
			want:  ContextCluster,
		},
		{
			name:  "git URL input",
			input: "https://github.com/kubescape/http-request",
			want:  ContextGitRemote,
		},
		{
			name:  "local git input",
			input: repoRoot,
			want:  ContextGitLocal,
		},
		{
			name:  "single file input",
			input: tmpFile.Name(),
			want:  ContextFile,
		},
		{
			name:  "directory input",
			input: os.TempDir(),
			want:  ContextDir,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			scanInfo := &ScanInfo{}
			assert.Equalf(t, tt.want, scanInfo.getScanningContext(tt.input), "GetScanningContext(%v)", tt.input)
		})
	}
}

func TestScanInfoFormats(t *testing.T) {
	testCases := []struct {
		Input string
		Want  []string
	}{
		{"", []string{}},
		{"json", []string{"json"}},
		{"pdf", []string{"pdf"}},
		{"html", []string{"html"}},
		{"sarif", []string{"sarif"}},
		{"html,pdf,sarif", []string{"html", "pdf", "sarif"}},
		{"pretty-printer,pdf,sarif", []string{"pretty-printe


String> {
    //! Generates a Vec<String> of all the orderings

    let mut combinations = Vec::with_capacity(factsum(groups.len()));
    combinations.push(String::from("None"));

    for r in 1..=groups.len() {
        for i in groups.iter().permutations(r) {
            let combo: String = i.iter().map(|x| (**x)).collect();
            combinations.push(combo);
        }
    }

    combinations
}

/// This function exists to avoid a *lot* of string alloc
pub fn make_combo_tree(groups_count: usize) -> BTreeMap<Vec<usize>, usize> {
    let mut output: BTreeMap<Vec<usize>, usize> = BTreeMap::new();
    output.insert(vec![], 0_usize);
    let mut c: usize = 1;
    for r in 1..=groups_count {
        for i in (0..groups_count).permutations(r) {
            let combo: Vec<usize> = i.into_iter().collect();
            output.insert(combo, c);
            c += 1;
        }
    }

    output
}

/// This represents a row in the polling_places file
#[derive(Debug, Deserialize)]
#[allow(non_snake_case)] // look, this isn't aesthetic but it matches the file
pub struct BoothRecord {
    State: StateAb,
    DivisionID: usize,
    DivisionNm: String,
    PollingPlaceID: usize,
    PollingPlaceTypeID: usize,
    PollingPlaceNm: String,
    PremisesNm: String,
    PremisesAddress1: String,
    PremisesAddress2: String,
    PremisesAddress3: String,
    PremisesSuburb: String,
    PremisesStateAb: StateAb,
    PremisesPostCode: Option<usize>,
    Latitude: String, // yes these are floats, but we don't actually care about their values
    Longitude: String, // and now we don't have to care about deserialising them either
}

pub type DivBooth = (String, String);
pub type Parties = IndexMap<String, Vec<String>>;

// TODO: make this take Read objects instead of paths.
//       otherwise it'll never work in WASM.
pub fn booth_npps(
    parties: &Parties,
    state: &StateAb,
    formal_prefs_path: &Path,
    polling_places_path: &Path,
    npp_booths_path: &Path,
) -> Result<()> {
    // cut down for WIP-ing
    eprintln!("\tDistributing Preferences");
    let mut partykeys = Vec::with_capacity(parties.len());
    for i in parties.keys() {
        partykeys.push(i.as_str());
    }
    partykeys.sort_unstable();
    let partykeys = partykeys;

    let mut party_indices: HashMap<&str, usize> = HashMap::new();
    for (i, val) in partykeys.iter().enumerate() {
        party_indices.insert(val, i);
    }
    let party_indices = party_indices;

    let combo_tree = make_combo_tree(partykeys.len());

    let combinations = group_combos(&partykeys);
    // eprintln!("Combinations:\n{:#?}", combinations);

    // this should get obsoleted by the combo_tree method
    let mut combo_order: HashMap<String, usize> = HashMap::new();
    combo_order.insert("None".to_string(), 0);
    let mut c: usize = 1;
    for i in combinations.iter() {
        combo_order.insert(i.clone(), c);
        c += 1;
    }

    // eprintln!("Combo tree:\n");
    // for (k, v) in combo_tree.iter(){
    //     eprintln!("{:?}:\t{:?}\t{}", k, v, combinations[*v]);
    // }
    //
    // return;

    // this is now just for actual booth data
    // For some gods-forsaken reason,


vvvx
18-19 v: vvvvcvvvsfmvfmzxdvcv
2-6 h: qdlhcg
4-15 m: mmmmmmmmmmmmmmmm
2-5 s: hrssmjps
10-12 c: rccdcchccvcqcccccjc
17-20 r: rrfrdgnrrrkdrrrvrqnl
4-6 w: rkmwww
5-6 p: pdhphcq
7-13 b: bjbbzrbbbbbbbb
16-17 v: svvvvwvqvvvkwmvvvvvv
4-8 h: dqhgtkhhfhdh
16-18 r: ttjtbfhrrsgnnnjrmr
5-9 n: xwnxdspnwnnn
7-9 t: hhtttbqnt
12-13 j: jjjjjjjjjjjzjjjjjj
15-17 p: pxpppppppppppplph
17-18 c: vcccccccccccccczcc
5-10 j: jjjjjbjjjj
1-13 x: nxxwmxxxpxxkdxhxx
11-14 z: zzzzzzlrzzzzzk
1-2 s: tcsbn
3-4 p: pphd
6-7 r: rrrrrcrrrhr
5-13 z: hczzlzzdzvxjztbgxzzz
8-10 j: mjnjjncjtj
5-8 s: ssssqssc
2-5 t: httgpttstttdttttttt
2-3 x: jfxmxwx
4-7 x: xwkcxfxxx
2-9 w: zwpjnwnhwdh
12-14 q: qqqqqqqqqqqtql
8-10 g: gggggggggw
3-4 t: jtztc
4-6 g: ggggkgvgvg
2-3 g: qgggzg
3-5 n: nxpnzn
13-18 c: ccccncmccccctccccm
12-18 b: bbbbbbbbbbbbbbgbbbb
3-18 z: jhwspcbstmdfzxmgwz
2-6 v: scvvvl
2-10 p: bpvpzpttvwzpkrrr
6-7 v: vvvvvvv
6-9 h: thshdhtwhrkqcxc
5-6 l: llslllgzll
4-14 k: kkkkkkkkkkkkkhkk
3-9 r: rrjrrrrrt
2-13 x: xxxxxxxxxxxxwxx
12-15 m: fvbgmxhrxmqwzmdmd
3-15 c: ccfccccrccccctcccc
6-10 b: cbbjqrgpvcnnnz
8-9 z: zzzzzzzpj
2-7 m: mmmmmmwmmmqmmmmmmm
6-15 g: gggggqggggggggsgd
6-7 t: gmttvtt
15-18 v: wvvmvvvvvvvvvvvvvvvv
8-9 t: ttbpftjtttvttttt
10-14 b: xwzvbbbbbbbxbcq
3-4 n: nffsjnqbntlbg
2-8 z: zszzzzzgzz
2-4 l: klzf
8-11 r: rrrnrrrsrrrrr
14-17 w: wwmwwwwwwwwwhkwwwws
6-7 v: vvvvvlg
3-5 h: hhhhzhfhhh
4-5 q: whkbfhnnqtpsnn
2-3 w: whgv
3-5 z: jzdzc
4-6 g: ggdnggjgqnn
1-15 m: dwljbfnxwtpnhsmm
1-5 k: tkkkfkkk
14-15 x: xxxxxxxxxxxxxtbx
8-11 d: hnqngfddnrdr
1-6 t: bttmtttttk
2-6 f: fffffpf
7-12 m: mmmmmmmmmmmmm
1-8 t


/* aho_corasick.h - declarations for Aho Corasick implementations
   Copyright (C) 2007 Tideway Systems Limited.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef AHO_CORASICK_H
#define AHO_CORASICK_H

#include "ac_types.h"
#include "ac_list.h"

/**
 * Type for symbols used to build strings such as keywords and query phrases.
 * All symbols satisfy AC_MIN_SYMBOL <= symbol <= AC_MAX_SYMBOL.
 */
typedef char ac_symbol;

#define AC_MIN_SYMBOL 0     // Smallest ordinal for an ac_symbol.
#define AC_MAX_SYMBOL 255   // Greatest ordinal for an ac_symbol.

/**
 * Type for the index into a string of symbols or the length of a string of
 * symbols. We use 0-based indexing.
 */
typedef int ac_offset;

/**
 * Structure for a single query match, containing the span of the query phrase
 * that matched the keyword and a pointer associated with the keyword.
 */
typedef struct ac_result {
    /**
     * The offset of the first symbol in the matching substring of the query
     * phrase.
     */
    ac_offset   start;

    /** The offset of the symbol after the last symbol in the matching
     * substring of the query phrase.
     */
    ac_offset   end;

    /** Pointer associated with the keyword. */
    void*       object;
} ac_result;

void ac_result_list_free(ac_list*);

/**
 * Interface states for an index objects.
 */
typedef enum ac_index_state {

    /**
     * The index is 'unfixed'. New keywords can be entered but the index
     * cannot be queried.
     */
    AC_INDEX_UNFIXED,

    /**
     * The index in 'fixed'. The index can be queried but new keywords cannot
     * be entered.
     */
    AC_INDEX_FIXED

} ac_index_state;

/**
 * Structure for index objects.
 */
typedef struct ac_index {

    /** The interface state of the index. */
    ac_index_state      index_state;

    /** The top state node of the index's patten matching machine. */
    struct ac_state*    state_0;

} ac_index;

#ifdef __cplusplus
extern "C" ac_index* ac_index_new(void);
extern "C" ac_error_code ac_index_free(ac_index*, ac_list_item_free_function);
extern "C" ac_error_code ac_index_enter(ac_index*, ac_symbol*, ac_offset, void*);
extern "C" ac_error_code ac_index_fix(ac_index*);
extern "C" ac_error_code ac_index_query(ac_index*, ac_symbol*, ac_offset, ac_list*);
#else
// Operations for index objects.
ac_index* ac_index_new(void);
ac_error_code ac_index_free(ac_index*, ac_list_item_free_function);
ac_error_code ac_index_enter(ac_index*, ac_symbol*, ac_offset, void*);
ac_error_code ac_index_fix(ac_index*);
ac_error_code ac_index_query(ac_index*, ac_symbol*, ac_offset, ac_list*);
#endif

#endif // AHO_CORASICK_H


     <String, dynamic>{'nested': true},
            'value',
          ],
        },
      );

      expect(normalized, isNotNull);
      expect(normalized!['key'], isA<Map<String, dynamic>>());
      expect(normalized['42'], isA<List<dynamic>>());
    });

    test(
        'parseProductFromNative builds Android subscription with offer details',
        () {
      final product = parseProductFromNative(
        <String, dynamic>{
          'platform': 'android',
          'id': 'premium_yearly',
          'title': 'Premium Yearly',
          'description': 'Yearly access',
          'currency': 'USD',
          'displayPrice': '\$49.99',
          'price': 49.99,
          'subscriptionOfferDetailsAndroid': <Map<String, dynamic>>[
            <String, dynamic>{
              'basePlanId': 'base',
              'offerToken': 'token',
              'offerTags': <String>['tag'],
              'pricingPhases': <String, dynamic>{
                'pricingPhaseList': <Map<String, dynamic>>[
                  <String, dynamic>{
                    'billingCycleCount': 1,
                    'billingPeriod': 'P1Y',
                    'formattedPrice': '\$49.99',
                    'priceAmountMicros': '49990000',
                    'priceCurrencyCode': 'USD',
                    'recurrenceMode': 2,
                  },
                ],
              },
            },
          ],
        },
        'subs',
        fallbackIsIOS: false,
      );

      expect(product, isA<types.ProductSubscriptionAndroid>());
      final subscription = product as types.ProductSubscriptionAndroid;
      expect(subscription.subscriptionOfferDetailsAndroid, isNotNull);
      expect(subscription.subscriptionOfferDetailsAndroid.single.offerToken,
          'token');
    });

    test('parseProductFromNative creates iOS in-app product', () {
      final product = parseProductFromNative(
        <String, dynamic>{
          'platform': 'ios',
          'id': 'coins_small',
          'title': 'Coins Small',
          'description': 'Small pack',
          'currency': 'USD',
          'displayPrice': '\$0.99',
          'price': 0.99,
          'typeIOS': 'CONSUMABLE',
          'isFamilyShareableIOS': false,
          'jsonRepresentationIOS': '{}',
        },
        'inapp',
        fallbackIsIOS: true,
      );

      expect(product, isA<types.ProductIOS>());
      final iosProduct = product as types.ProductIOS;
      expect(iosProduct.id, 'coins_small');
      expect(iosProduct.type, types.ProductType.InApp);
    });
  });
}
import 'dart:collection';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_inapp_purchase_example/src/screens/subscription_flow_screen.dart';

void main() {
  TestWidgetsFlutterBinding.ensureInitialized();
  const channel = MethodChannel('flutter_inapp');

  late List<MethodCall> log;

  setUp(() {
    log = <MethodCall>[];
    channel.setMockMethodCallHandler((MethodCall call) async {
      log.add(call);
      switch (call.method) {
        case 'initConnection':
          return true;
        case 'fetchProducts':
          final args = call.arguments as Map<dynamic, dynamic>?;
          final type = (args?['type']?.toString() ?? 'subs')
              .replaceAll('-', '')
              .toLowerCase();
          if (type == 'subs') {
            return <Map<String, dynamic>>[
              <String, dynamic>{
                'platform': 'ios',
                'id': 'dev.hyo.martie.premium',
                'productId': 'dev.


ass*="mobile hidden"],[class*="or lower hidden"],[class*="tablet only"]:not(.mobile),[class*="widescreen only"]:not(.mobile){display:none!important}}@media only screen and (min-width:800px) and (max-width:1199px){[class*="computer only"]:not(.tablet),[class*="large screen only"]:not(.tablet),[class*="mobile only"]:not(.tablet),[class*="or lower hidden"]:not(.mobile),[class*="tablet hidden"],[class*="widescreen only"]:not(.tablet){display:none!important}}@media only screen and (min-width:1200px) and (max-width:1399px){[class*="computer hidden"],[class*="large screen only"]:not(.computer),[class*="mobile only"]:not(.computer),[class*="or lower hidden"]:not(.tablet):not(.mobile),[class*="tablet only"]:not(.computer),[class*="widescreen only"]:not(.computer){display:none!important}}@media only screen and (min-width:1400px) and (max-width:1799px){[class*="computer only"]:not([class*="large screen"]),[class*="large screen hidden"],[class*="mobile only"]:not([class*="large screen"]),[class*="or lower hidden"]:not(.computer):not(.tablet):not(.mobile),[class*="tablet only"]:not([class*="large screen"]),[class*="widescreen only"]:not([class*="large screen"]){display:none!important}}@media only screen and (min-width:1800px){[class*="computer only"]:not([class*=widescreen]),[class*="large screen only"]:not([class*=widescreen]),[class*="mobile only"]:not([class*=widescreen]),[class*="tablet only"]:not([class*=widescreen]),[class*="widescreen hidden"],[class*="widescreen or lower hidden"]{display:none!important}}
/*!
 * # Fomantic-UI - Button
 * http://github.com/fomantic/Fomantic-UI/
 *
 *
 * Released under the MIT license
 * http://opensource.org/licenses/MIT
 *
 */.ui.button{cursor:pointer;display:inline-block;min-height:1em;outline:none;border:none;vertical-align:baseline;background:#e0e1e2 none;color:rgba(0,0,0,.6);font-family:Open Sans,Helvetica Neue,Arial,Helvetica,sans-serif;margin:0 .25em 0 0;padding:.61111111em 1.5em;text-transform:none;text-shadow:none;font-weight:700;line-height:1em;font-style:normal;text-align:center;text-decoration:none;border-radius:.22222222rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;will-change:auto;-webkit-tap-highlight-color:transparent}.ui.button,.ui.button:hover{box-shadow:inset 0 0 0 1px transparent,inset 0 0 0 0 rgba(34,36,38,.15)}.ui.button:hover{background-color:#cacbcd;background-image:none;color:rgba(0,0,0,.8)}.ui.button:hover .icon{opacity:.85}.ui.button:focus{background-color:#cacbcd;color:rgba(0,0,0,.8);background-image:none;box-shadow:""}.ui.button:focus .icon{opacity:.85}.ui.active.button:active,.ui.button:active{background-color:#babbbc;background-image:"";color:rgba(0,0,0,.9);box-shadow:inset 0 0 0 1px


Client', '10': 'clients'},
    {'1': 'has_client_index', '3': 3001, '4': 1, '5': 8, '10': 'hasClientIndex'},
    {'1': 'client_index', '3': 3002, '4': 1, '5': 5, '10': 'clientIndex'},
    {'1': 'radius_stats', '3': 3003, '4': 1, '5': 11, '6': '.SpaceX.API.Device.RadiusStatsMap', '10': 'radiusStats'},
  ],
  '9': [
    {'1': 2, '2': 3},
    {'1': 5, '2': 6},
    {'1': 6, '2': 7},
    {'1': 7, '2': 8},
    {'1': 1001, '2': 1002},
    {'1': 1002, '2': 1003},
    {'1': 1006, '2': 1007},
    {'1': 1007, '2': 1008},
  ],
};

/// Descriptor for `WifiGetStatusResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List wifiGetStatusResponseDescriptor = $convert.base64Decode(
    'ChVXaWZpR2V0U3RhdHVzUmVzcG9uc2USOAoWY2FwdGl2ZV9wb3J0YWxfZW5hYmxlZBgBIAEoCE'
    'ICGAFSFGNhcHRpdmVQb3J0YWxFbmFibGVkEj4KC2RldmljZV9pbmZvGAMgASgLMh0uU3BhY2VY'
    'LkFQSS5EZXZpY2UuRGV2aWNlSW5mb1IKZGV2aWNlSW5mbxJBCgxkZXZpY2Vfc3RhdGUYBCABKA'
    'syHi5TcGFjZVguQVBJLkRldmljZS5EZXZpY2VTdGF0ZVILZGV2aWNlU3RhdGUSKQoQaXB2NF93'
    'YW5fYWRkcmVzcxjrByABKAlSDmlwdjRXYW5BZGRyZXNzEiUKDnBpbmdfZHJvcF9yYXRlGOwHIA'
    'EoAlIMcGluZ0Ryb3BSYXRlEicKD3BpbmdfbGF0ZW5jeV9tcxjtByABKAJSDXBpbmdMYXRlbmN5'
    'TXMSTAoOcmZfMmdoel9zdGF0dXMY8AcgASgLMiEuU3BhY2VYLkFQSS5EZXZpY2UuV2lmaUJhbm'
    'RTdGF0dXNCAhgBUgxyZjJnaHpTdGF0dXMSTAoOcmZfNWdoel9zdGF0dXMY8QcgASgLMiEuU3Bh'
    'Y2VYLkFQSS5EZXZpY2UuV2lmaUJhbmRTdGF0dXNCAhgBUgxyZjVnaHpTdGF0dXMSNgoGYWxlcn'
    'RzGPIHIAEoCzIdLlNwYWNlWC5BUEkuRGV2aWNlLldpZmlBbGVydHNSBmFsZXJ0cxIgCgtpc19h'
    'dmlhdGlvbhjzByABKAhS