.cols.Count)
			{
				throw new ArgumentOutOfRangeException("count");
			}

			if (count >= this.cols.Count)
			{
				throw new ArgumentOutOfRangeException("count");
			}

			if (col + count > this.cols.Count)
			{
				// at least remain 1 cols
				throw new ArgumentOutOfRangeException("col + count, at least one column should be left");
			}

			#endregion // Check

#if DEBUG
			Stopwatch sw = Stopwatch.StartNew();
#endif

			int maxrow = MaxContentRow + 1;
			int maxcol = MaxContentCol + 1;

			int left = this.cols[col].Left;
			int endcol = col + count;
			int totalWidth = this.cols[endcol - 1].Right - this.cols[col].Left;
			RGFloat scaledTotalWidth = totalWidth * this.renderScaleFactor;

			suspendingUIUpdates = true;

			#region delete headers

			this.cols.RemoveRange(col, count);

			for (int c = col; c < this.cols.Count; c++)
			{
				cols[c].Col -= count;
				cols[c].Left -= totalWidth;

				if (cols[c].Text == null)
				{
					cols[c].RenderText = RGUtility.GetAlphaChar(c);
				}

				Debug.Assert(cols[c].Col >= 0);
			}

			#endregion // delete headers

			#region delete cells
			// left
			for (int r = 0; r <= this.rows.Count; r++)
			{
				// TODO: bounds test
				Cell cell = cells[r, col];

				if (r < this.rows.Count && cell != null)
				{
					if (!cell.MergeStartPos.IsEmpty && cell.MergeStartPos.Col < col)
					{
						// update colspan for range
						if (cell.MergeStartPos.Row == r)
						{
							Cell mergedStartCell = cells[cell.MergeStartPos.Row, cell.MergeStartPos.Col];
#if DEBUG
							Debug.Assert(mergedStartCell.Colspan > 0);
#endif

							int span = Math.Min(count, cell.MergeEndPos.Col - col + 1);
							mergedStartCell.Colspan -= (short)span;

							mergedStartCell.Width =
								this.cols[mergedStartCell.InternalCol + mergedStartCell.Colspan - 1].Right -
								this.cols[mergedStartCell.InternalCol].Left;

#if DEBUG
							Debug.Assert(mergedStartCell.Colspan > 0);
#endif
						}

						// update merge-end-col for range
						for (int c = cell.MergeStartPos.Col; c < col; c++)
						{
							Cell leftCell = cells[r, c];
							int span = Math.Min(count, leftCell.MergeEndPos.Col - col + 1);
							leftCell.MergeEndPos = leftCell.MergeEndPos.Offset(0, -span);
						}
					}
				}

				// if any borders exist in left side, it's need to update the span of borders.
				// from columns from 0 col no need to do this
				if (col > 0
					// is border at start column
					&& this.hBorders[r, col - 1] != null && this.hBorders[r, col - 1].Span > 0)
				{
					// find border to merge in right side
					int addspan = 0;

					// border exists in right side?
					if (this.hBorders[r, endcol] != null
						// this is not a same border range
						&& this.hBorders[r, endcol].Span + count + 1 != this.hBorders[r, col - 1].Span
						// does they have same style?
						&& this.hBorders[r, endcol].Style.Equals(this.hBorders[r, col - 1].Style)
						// does they have same owner position flag?
						&& this.hBorders[r, endcol].Pos == this.hBorders[r,


stall the [tty-markdown-cli](https://github.com/piotrmurach/tty-markdown-cli)
to use the `tty-markdown` executable in the terminal:

```bash
$ tty-markdown README.md
```

## Development

After checking out the repo, run `bin/setup` to install dependencies.
Then, run `rake spec` to run the tests. You can also run `bin/console`
for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`.
To release a new version, update the version number in `version.rb`, and then
run `bundle exec rake release`, which will create a git tag for the version,
push git commits and tags, and push the `.gem` file to
[rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at
https://github.com/piotrmurach/tty-markdown.
This project is intended to be a safe, welcoming space for collaboration,
and contributors are expected to adhere to the
[code of conduct](https://github.com/piotrmurach/tty-markdown/blob/master/CODE_OF_CONDUCT.md).

## License

The gem is available as open source under the terms of the
[MIT License](https://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the TTY::Markdown project’s codebases, issue trackers,
chat rooms and mailing lists is expected to follow the
[code of conduct](https://github.com/piotrmurach/tty-markdown/blob/master/CODE_OF_CONDUCT.md).

## Copyright

Copyright (c) 2018 Piotr Murach. See
[LICENSE.txt](https://github.com/piotrmurach/tty-markdown/blob/master/LICENSE.txt)
for further details.
# Change log

## [v0.10.0] - unreleased

### Added
* Add Spinner#log method for logging messages above the spinner
* Add new formats (:pulse_4, :toss, :lighthouse, :points, :points_2)
* Add ability to specify a custom mark for error, pause, success and stop methods

### Changed
* Change gemspec to include rake and rspec as dev dependencies
* Change all built-in formats to use consistent frames formatting

## [v0.9.3] - 2020-01-28

### Changed
* Change gemspec to add metadata, remove test artefacts and load version directly

## [v0.9.2] - 2019-12-08

### Fixed
* Fix multi spinner cursor hiding by @benklop

## [v0.9.1] - 2019-05-29

### Changed
* Change bundler to remove version limit
* Change to update tty-cursor dependency

## [v0.9.0] - 2018-12-01

### Changed
* Change tty-cursor dependency
* Change to Ruby >= 2.0
* Change to freeze all string literals
* Change #execute_job to stop evaluating in spinner context and just execute the job
* Change #register to accept a spinner instance by Shane Cavanaugh(@shanecav84)

### Fixed
* Fix to remove a stray single quote in spin_4 by Kristofer Rye(@rye)
* Fix Multi#line_inset to correctly assign styling in threaded environment
* Fix #stop & #auto_spin to always restore hidden cursor if enabled
* Fix deadlock when registering multi spinners

## [v0.8.0] - 2018-01-11

### Added
* Add new formats


: 2,
  operation: '!=',
  aliases: merge(numeric, str, dateTime, bool),
  notation: Notation.Infix,
};

describe('evaluation of \'!=\'', () => {
  describe('with numeric operands like', () => {
    runTestTable({
      ...config,
      testTable: `
        3i 3i = false
        3d 3d = false
        3f 3f = false

        3i -5i = true
        3d -5d = true
        3f -5f = true

         3i 3f = false
         3i 3d = false
         3d 3f = false
        -0f 0f = false

         INF  INF = false
        -INF -INF = false
         INF  3f  = true
         3f   INF = true
         INF  NaN = true
         NaN  NaN = true
         NaN  3f  = true
         3f   NaN = true
      `,
    });
  });

  describe('with string operands like', () => {
    runTestTable({
      ...config,
      testTable: `
        empty empty = false
        empty aaa   = true
        aaa   aaa   = false
        aaa   bbb   = true
      `,
    });
  });

  describe('with boolean operands like', () => {
    runTestTable({
      ...config,
      testTable: `
        true  true  = false
        true  false = true
        false true  = true
        false false = false
      `,
    });
  });

  describe('with dateTime operands like', () => {
    runTestTable({
      ...config,
      testTable: `
        earlyN earlyZ = false
        earlyN earlyN = false
        earlyZ earlyZ = false

        earlyN lateN  = true
        earlyN lateZ  = true
        earlyZ lateZ  = true
        earlyZ lateN  = true

        edge1 edge2   = false
      `,
    });
  });

  describe('with date operants like', () => {
    // Originates from: https://www.w3.org/TR/xpath-functions/#func-date-equal
    runTestTable({
      operation: '!=',
      arity: 2,
      notation: Notation.Infix,
      aliases: bool,
      testTable: `
        '${dateTyped('2004-12-25Z')}' '${dateTyped('2004-12-25+07:00')}' = true
        '${dateTyped('2004-12-25-12:00')}' '${dateTyped('2004-12-26+12:00')}' = false
      `,
    });
  });

  describe('with time operants like', () => {
    // Originates from: https://www.w3.org/TR/xpath-functions/#func-time-equal
    runTestTable({
      operation: '!=',
      arity: 2,
      notation: Notation.Infix,
      aliases: bool,
      testTable: `
        '${timeTyped('08:00:00+09:00')}' '${timeTyped('17:00:00-06:00')}' = true
        '${timeTyped('21:30:00+10:30')}' '${timeTyped('06:00:00-05:00')}' = false
        '${timeTyped('24:00:00+01:00')}' '${timeTyped('00:00:00+01:00')}' = false
      `,
    });
  });

  describe('with duration operants like', () => {
    // These tests are just inverse of the spec tests of =
    runTestTable({
      operation: '!=',
      arity: 2,
      notation: Notation.Infix,
      aliases: bool,
      testTable: `
        '${durationTyped('P1Y')}'


** args = zone()->NewArray<Node*>(kArgsCount);
  DCHECK((std::fill(&args[0], &args[kArgsCount], nullptr), true));
  args[arg1.index] = arg1.value;
  args[arg2.index] = arg2.value;
  args[arg3.index] = arg3.value;
  args[arg4.index] = arg4.value;
  args[kArgsCount - 1] = context;
  DCHECK_EQ(0, std::count(&args[0], &args[kArgsCount], nullptr));

  return raw_assembler_->TailCallN(call_descriptor, target, args);
}

Node* CodeAssembler::TailCallStub(const CallInterfaceDescriptor& descriptor,
                                  Node* target, Node* context, const Arg& arg1,
                                  const Arg& arg2, const Arg& arg3,
                                  const Arg& arg4, const Arg& arg5,
                                  size_t result_size) {
  CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
      isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
      CallDescriptor::kSupportsTailCalls, Operator::kNoProperties,
      MachineType::AnyTagged(), result_size);

  const int kArgsCount = 6;
  Node** args = zone()->NewArray<Node*>(kArgsCount);
  DCHECK((std::fill(&args[0], &args[kArgsCount], nullptr), true));
  args[arg1.index] = arg1.value;
  args[arg2.index] = arg2.value;
  args[arg3.index] = arg3.value;
  args[arg4.index] = arg4.value;
  args[arg5.index] = arg5.value;
  args[kArgsCount - 1] = context;
  DCHECK_EQ(0, std::count(&args[0], &args[kArgsCount], nullptr));

  return raw_assembler_->TailCallN(call_descriptor, target, args);
}

Node* CodeAssembler::TailCallBytecodeDispatch(
    const CallInterfaceDescriptor& interface_descriptor,
    Node* code_target_address, Node** args) {
  CallDescriptor* descriptor = Linkage::GetBytecodeDispatchCallDescriptor(
      isolate(), zone(), interface_descriptor,
      interface_descriptor.GetStackParameterCount());
  return raw_assembler_->TailCallN(descriptor, code_target_address, args);
}

Node* CodeAssembler::CallJS(Callable const& callable, Node* context,
                            Node* function, Node* receiver,
                            size_t result_size) {
  const int argc = 0;
  CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
      isolate(), zone(), callable.descriptor(), argc + 1,
      CallDescriptor::kNoFlags, Operator::kNoProperties,
      MachineType::AnyTagged(), result_size);
  Node* target = HeapConstant(callable.code());

  Node** args = zone()->NewArray<Node*>(argc + 4);
  args[0] = function;
  args[1] = Int32Constant(argc);
  args[2] = receiver;
  args[3] = context;

  return CallN(call_descriptor, target, args);
}

Node* CodeAssembler::CallJS(Callable const& callable, Node* context,
                            Node* function, Node* receiver, Node* arg1,
                            size_t result_size) {
  const int argc = 1;
  CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
      isolate(), zone(), callable.descriptor(), argc + 1,
      CallDescriptor::kNoFlags, Operator::kNoProperties,
      MachineType::AnyTagged(), result_size);
  Node* target = HeapConstant(callable.code());

  Node** args = zone()->NewArray<Node*>(argc + 4);
  args[0] = function;
  args[1] = Int32Constant(argc);
  args[2] = receiver;
  args[3] = arg1


	'',	'2',	'',	'纳格陵',	'Naglering',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'2002309',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2002309',	'',	'现在的她，应该仍然神志不清吧。',	'',	'',	'',	'',	'',	'',	'',	'',	'6005001',	'',	'',	'2',	'',	'纳格陵',	'Naglering',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'2002310',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2002310',	'',	'没关系，只要打一顿就可以了——',	'',	'',	'',	'',	'',	'',	'',	'',	'6005001',	'',	'',	'2',	'',	'纳格陵',	'Naglering',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'2002311',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2002311',	'',	'等等，纳格陵副队长，先别动手啊，会理亏的——！！！',	'',	'',	'',	'',	'',	'',	'',	'',	'4032001',	'',	'',	'2',	'',	'泡沫',	'Bubble',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'-1',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2002401',	'',	'唔呜……可恶，头好痛，眼睛也好痛，肚子也好痛……',	'',	'',	'Bg_9052.jpg',	'',	'',	'0.5,0.25',	'1',	'',	'7005004',	'',	'',	'2',	'',	'哈迪斯',	'Hades',	'[{"id":7005004,"pos":2,"enter":2}]',	'',	'',	'',	'',	'',	'',	'',	'',	'Plot_Daily_Normal',	'',	'2002402',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2002402',	'',	'快住手啦，纳格陵副队长！！！',	'',	'',	'',	'',	'',	'',	'',	'',	'4032001',	'',	'',	'2',	'',	'泡沫',	'Bubble',	'[{"id":4032001,"pos":2,"enter":2}]


domains is `["tobi"]`.
 *
 * @return {Array}
 * @public
 */

defineGetter(req, "subdomains", function subdomains(this: oven.ws.Request) {
    const hostname = this.hostname;

    if (!hostname) {
        return [];
    }

    const offset = this.app.$("subdomain offset");
    const subdomains = !isIP(hostname) ? hostname.split(".").reverse() : [hostname];

    return subdomains.slice(offset);
});

/**
 * Short-hand for `url.parse(req.url).pathname`.
 *
 * @return {String}
 * @public
 */

defineGetter(req, "path", function path(this: oven.ws.Request) {
    return parse(this).pathname;
});

/**
 * Parse the "Host" header field to a hostname.
 *
 * When the "trust proxy" setting trusts the socket
 * address, the "X-Forwarded-Host" header field will
 * be trusted.
 *
 * @return {String}
 * @public
 */

defineGetter(req, "hostname", function hostname(this: oven.ws.Request) {
    const trust = this.app.$("trust proxy fn");
    let host = this.get("X-Forwarded-Host");

    if (!host || !trust(this.socket.remoteAddress, 0)) {
        host = this.get("Host");
    } else if (host.indexOf(",") !== -1) {
        // Note: X-Forwarded-Host is normally only ever a
        //       single value, but this is to be safe.
        host = host.substring(0, host.indexOf(",")).trimRight();
    }

    if (!host) return;

    // IPv6 literal support
    const offset = host[0] === "[" ? host.indexOf("]") + 1 : 0;
    const index = host.indexOf(":", offset);

    return index !== -1 ? host.substring(0, index) : host;
});

/**
 * Check if the request is fresh, aka
 * Last-Modified and/or the ETag
 * still match.
 *
 * @return {Boolean}
 * @public
 */

defineGetter(req, "fresh", function (this: oven.ws.Request) {
    const method = this.method;
    const res = this.res;
    const status = res.statusCode;

    // GET or HEAD for weak freshness validation only
    if ("GET" !== method && "HEAD" !== method) return false;

    // 2xx or 304 as per rfc2616 14.26
    if ((status >= 200 && status < 300) || 304 === status) {
        return fresh(this.headers, {
            etag: res.get("ETag"),
            "last-modified": res.get("Last-Modified"),
        });
    }

    return false;
});

/**
 * Check if the request is stale, aka
 * "Last-Modified" and / or the "ETag" for the
 * resource has changed.
 *
 * @return {Boolean}
 * @public
 */

defineGetter(req, "stale", function stale(this: oven.ws.Request) {
    return !this.fresh;
});

/**
 * Check if the request was an _XMLHttpRequest_.
 *
 * @return {Boolean}
 * @public
 */

defineGetter(req, "xhr", function xhr(this: oven.ws.Request) {
    const val = this.get("X-Requested-With") || "";
    return val.toLowerCase() === "xmlhttprequest";
});

/**
 * Helper function for creating a getter on an object.
 *
 * @param {Object} obj
 * @param {String} name
 * @param {Function} getter
 * @private
 */
function defineGetter(obj: object, name: string, getter: () => void) {
    Object.defineProperty(obj, name, {
        configurable: true,
        enumerable: true,
        get: getter,
    });
}
import { RedisClient } from "redis";
import {promisify} from 'util'

export default async function(sid: string, hash:


lastLabelFormatter?: (value: number, unit: UnitKindEnum, largestUnitName: UnitNameEnum) => string;
  singleAxis: boolean = false;
  hideUnits: boolean = false;
  axisMax?: number;
  tickAmount: number = 8;
  plotLines?: PlotLines[];
  labelOptions: AxisLabels = {};

  constructor(data?: Partial<OnlyData<YAxisBehavior>>) {
    Object.assign(this, data);
  }

  private largestUnit(series: HistogramSeries[], unitKind: UnitKindEnum) {
    const largestValues: number[] = series.map(serie => {
      const maxHistogramPoint = _.maxBy(serie.points, dataPoint => dataPoint.y);
      return maxHistogramPoint?.y ? maxHistogramPoint.y : 0;
    });
    const largestValue = _.max([...largestValues, this.axisMax ?? 0]) || 0;
    return unitsFormatter.format(largestValue, unitKind).unit;
  }

  private getYAxisValue(value: number, showUnit: boolean, chartSeriesData: ChartSeriesData[], unitType: UnitKindEnum) {
    const yAxisUnits = this.getLargestValueUnitName(chartSeriesData, unitType);
    const formatted = unitsFormatter.convert(value, yAxisUnits);
    const valueString = formatted.getRounded(2);
    return `<span class="axis">${valueString} <b>${showUnit ? formatted.unit : ""}</b></span>`;
  }

  private getLargestValueUnitName(chartSeriesData: ChartSeriesData[], unitType: UnitKindEnum): UnitNameEnum {
    const histogramSeries = chartSeriesData
      .filter(serie => serie.visible)
      .map(chartSerieData => chartSerieData.histogram);
    return this.largestUnit(histogramSeries, unitType);
  }

  modifyConfig(chartOptions: Options, chartSeriesData: ChartSeriesData[]): void {
    const yAxisCommonOptions: AxisOptions = {
      title: undefined,
      plotLines: this.plotLines,
      gridLineColor: this.gridLineColor,
      showFirstLabel: this.showFirstLabel,
      showLastLabel: !!this.lastLabelFormatter,
      maxPadding: 0.3,
      gridLineWidth: 0,
      labels: {
        style: {
          ...BehaviorUtils.axisCommonLabelStyleOption,
          color: this.labelsColor,
        },
        x: 5,
        y: -5,
      },
    };
    if (this.axisMax) {
      const dataMax = _.max(chartSeriesData.map(({ histogram }) => histogram.peakValue)) ?? 0;
      if (this.axisMax > dataMax) {
        yAxisCommonOptions.max = this.axisMax;
      }
    }
    if (this.gridLineColor) {
      yAxisCommonOptions.gridLineWidth = 1;
      yAxisCommonOptions.gridLineColor = this.gridLineColor;
    }

    // in case we are using percent stacking on the series
    // we want y axis unit to be percents, even if data is of other unit type.
    const unitType =
      (chartSeriesData.length > 0 &&
        (chartSeriesData[0].stacking === "percent" ? UnitKindEnum.PERCENT : chartSeriesData[0].unitType)) ||
      UnitKindEnum.COUNT;
    if (unitType === UnitKindEnum.PERCENT) {
      // NOTE: Since first and last label are hidden, 0 and 120 aren't shown
      yAxisCommonOptions.tickPositions = [0, 20, 40, 60, 80, 100, 120];
    } else {
      yAxisCommonOptions.tickAmount = this.tickAmount;
    }

    // eslint-disable-next-line @typescript-eslint/no-this-alias
    const _this = this;
    chartOptions.yAxis = [
      {
        ...yAxisCommonOptions,
        startOnTick: true,
        endOnTick: true,
        labels: {
          ...yAxisCommonOptions.labels,
          align: "left",
          formatter(this: AxisLabelFormatterOptions): string {
            // eslint-disable-next-line @typescrip


#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/
gnome_sudoku/main.py, line 906, in start_game ()
    u = UI()
(gdb) py-up
#40 Frame 0x948e82c, for file /usr/lib/python2.6/site-packages/
gnome_sudoku/gnome_sudoku.py, line 22, in start_game(main=<module at remote 0xb771b7f4>)
    main.start_game()
(gdb) py-up
Unable to find an older python frame

so we’re at the top of the Python stack.

The frame numbers correspond to those displayed by GDB’s standard
backtrace command.
The command skips C frames which are not executing Python code.

Going back down:

(gdb) py-down
#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/gnome_sudoku/main.py, line 906, in start_game ()
    u = UI()
(gdb) py-down
#34 (unable to read python frame information)
(gdb) py-down
#23 (unable to read python frame information)
(gdb) py-down
#19 (unable to read python frame information)
(gdb) py-down
#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/game_selector.py, line 201, in run_swallowed_dialog (self=<NewOrSavedGameSelector(new_game_model=<gtk.ListStore at remote 0x98fab44>, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, 'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\n7 8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': <float at remote 0x984b474>, 'gsd.hints': 0, 'timer.active_time': <float at remote 0x984b494>, 'timer.total_time': <float at remote 0x984b464>}], dialog=<gtk.Dialog at remote 0x98faaa4>, saved_game_model=<gtk.ListStore at remote 0x98fad24>, sudoku_maker=<SudokuMaker(terminated=False, played=[], batch_siz...(truncated)
            swallower.run_dialog(self.dialog)
(gdb) py-down
#11 Frame 0x9aead74, for file /usr/lib/python2.6/site-packages/gnome_sudoku/dialog_swallower.py, line 48, in run_dialog (self=<SwappableArea(running=<gtk.Dialog at remote 0x98faaa4>, main_page=0) at remote 0x98fa6e4>, d=<gtk.Dialog at remote 0x98faaa4>)


orePtrCol

LoadModDirOk
	MOVE.W	FileNameScrollPos(PC),D0
	BSR.W	RedrawFileNames
	MOVE.W	#3,Action
	LEA	SelectModuleText,A0
	JSR	ShowStatusText
	BRA.W	RestorePtrCol

SaveModuleGadg
	CLR.W	lbW015B92
	TST.B	SaveIconsFlag
	BEQ.B	smogskip
	MOVE.W	#1,lbW015B92
smogskip
	CLR.W	makeExeModFlag
	BTST	#2,$DFF016	; right mouse button
	BNE.B	smogskip2
	MOVE.W	#1,makeExeModFlag
smogskip2
	BSR.W	SelectModules
	LEA	SaveModuleText,A0
	CMP.W	#1,makeExeModFlag
	BNE.B	smogskip3
	LEA	SaveExeText,A0
smogskip3
	BSR.W	AreYouSure
	BNE.W	Return1
	JSR	SaveModule
	MOVE.W	#3,Action
	JMP	ShowAllRight

DeleteModuleGadg
	BSR.W	WaitForButtonUp
	BSR.W	ClearFileNames
	BSR.W	SelectModules
	LEA	FileNamesPtr(PC),A5
	BSR.W	HasDiskChanged
	BEQ.B	DeleteModDirOk
	BSR.W	ClearDirTotal
	BSR.W	DirDisk
	BEQ.B	DeleteModDirOk
	BRA.W	RestorePtrCol

DeleteModDirOk
	MOVE.W	FileNameScrollPos(PC),D0
	BSR.W	RedrawFileNames
	MOVE.W	#4,Action
	LEA	SelectModuleText,A0
	JSR	ShowStatusText
	BRA.W	SetDeletePtrCol

;---- Sample Gadgets ----

LoadSampleGadg
	TST.W	DiskOpScreen2
	BNE.W	SavePatternGadg
	BSR.W	lbC002E76
	BSR.W	StorePtrCol
	BSR.W	WaitForButtonUp
	BSR.W	ClearFileNames
	BSR.W	SelectSamples
	LEA	FileNamesPtr(PC),A5
	BSR.W	HasDiskChanged
	BEQ.B	LoadSampleDirOk
	BSR.W	ClearDirTotal
	BSR.W	DirDisk
	BEQ.B	LoadSampleDirOk
	BRA.W	RestorePtrCol

LoadSampleDirOk
	MOVE.W	FileNameScrollPos(PC),D0
	BSR.W	RedrawFileNames
	MOVE.W	#5,Action
	LEA	SelectSampleText,A0
	JSR	ShowStatusText
	BRA.W	RestorePtrCol

xNotSampleNull	JMP	NotSampleNull

SaveSampleGadg
	TST.W	DiskOpScreen2
	BNE.W	SavePattern
	BSR.W	SelectSamples
	CLR.B	RawKeyCode
	MOVE.W	InsNum,D0
	BEQ.B	xNotSampleNull
	LEA	SaveSampleText,A0
	BSR.W	AreYouSure
	BNE.W	Return1
dosavesample
	BSR.W	StorePtrCol
	JSR	CreateSampleName
	CMP.B	#2,RawIFFPakMode
	BNE.W	WriteSample	; PAK flag disabled

	; Sample Crunch (PAK)
	TST.L	DiskDataLength
	BEQ.W	Return1
	LEA	FileName,A0
dssa


37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z",mdiCogPause:"M13.53 22H10C9.75 22 9.54 21.82 9.5 21.58L9.13 18.93C8.5 18.68 7.96 18.34 7.44 17.94L4.95 18.95C4.73 19.03 4.46 18.95 4.34 18.73L2.34 15.27C2.21 15.05 2.27 14.78 2.46 14.63L4.57 12.97C4.53 12.65 4.5 12.33 4.5 12S4.53 11.34 4.57 11L2.46 9.37C2.27 9.22 2.21 8.95 2.34 8.73L4.34 5.27C4.46 5.05 4.73 4.96 4.95 5.05L7.44 6.05C7.96 5.66 8.5 5.32 9.13 5.07L9.5 2.42C9.54 2.18 9.75 2 10 2H14C14.25 2 14.46 2.18 14.5 2.42L14.87 5.07C15.5 5.32 16.04 5.66 16.56 6.05L19.05 5.05C19.27 4.96 19.54 5.05 19.66 5.27L21.66 8.73C21.78 8.95 21.73 9.22 21.54 9.37L19.43 11C19.47 11.34 19.5 11.67 19.5 12C19.5 12.06 19.5 12.12 19.5 12.19C19 12.07 18.5 12 18 12C17.08 12 16.22 12.21 15.44 12.58C15.47 12.39 15.5 12.2 15.5 12C15.5 10.07 13.93 8.5 12 8.5S8.5 10.07 8.5 12 10.07 15.5 12 15.5C12.2 15.5 12.39 15.47 12.58 15.44C12.21 16.22 12 17.08 12 18C12 19.54 12.58 20.94 13.53 22M19 15H21V21H19M15 15H17V21H15V15Z",mdiCogPauseOutline:"M13.54 22H10C9.75 22 9.54 21.82 9.5 21.58L9.13 18.93C8.5 18.68 7.96 18.34 7.44 17.94L4.95 18.95C4.73 19.03 4.46 18.95 4.34 18.73L2.34 15.27C2.21 15.05 2.27 14.78 2.46 14.63L4.57 12.97L4.5 12L4.57 11L2.46 9.37C2.27 9.22 2.21 8.95 2.34 8.73L4.34 5.27C4.46 5.05 4.73 4.96 4.95 5.05L7.44 6.05C7.96 5.66 8.5 5.32 9.13 5.07L9.5 2.42C9.54 2.18 9.75 2 10 2H14C14.25 2 14.46 2.18 14.5 2.42L14.87 5.07C15.5 5.32 16.04 5.66 16.56 6.05L19.05 5.05C19.27 4.96 19.54 5.05 1


d add ValueChanged listener.
            listenPin.SetDriveMode(GpioPinDriveMode.Input);
            listenPin.ValueChanged += Pin_ValueChanged;

            // Start toggling the pin value every 500ms.
            timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromMilliseconds(500);
            timer.Tick += Timer_Tick;
            timer.Start();
        }

        void StopScenario()
        {
            // Stop the timer.
            if (timer != null)
            {
                timer.Stop();
                timer = null;
            }

            // Release the GPIO pins.
            if (setPin != null)
            {
                setPin.Dispose();
                setPin = null;
            }
            if (listenPin != null)
            {
                listenPin.ValueChanged -= Pin_ValueChanged;
                listenPin.Dispose();
                listenPin = null;
            }
        }

        void StartStopScenario_Click(object sender, RoutedEventArgs e)
        {
            if (timer != null)
            {
                StopScenario();
                StartStopButton.Content = "Start";
                ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                StartScenario();
                StartStopButton.Content = "Stop";
                ScenarioControls.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }
        private void Pin_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs e)
        {
            // Report the change in pin value.
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                CurrentPinValue.Text = listenPin.Read().ToString();
            });
        }

        private void Timer_Tick(object sender, object e)
        {
            // Toggle the existing pin value.
            currentValue = (currentValue == GpioPinValue.High) ? GpioPinValue.Low : GpioPinValue.High;
            setPin.Write(currentValue);
        }
    }
}


   */
  async updateContractState(
    dayId: number,
    blocks: number,
    gas: string
  ): Promise<any> {
    if (!this.contract) return;
    const res = await this.contract.addSummary(
      dayId,
      blocks,
      BigNumber.from(gas)
    );
    console.info("--UpdateContractState", dayId, blocks, gas, res);
    return res;
  }
}

export default new NetworkContractHelper();
import type { Db } from 'mongodb';
import { Agenda } from '@rocket.chat/agenda';
import { CronHistory } from '@rocket.chat/models';
import { Random } from '@rocket.chat/random';

const runCronJobFunctionAndPersistResult = async (fn: () => Promise<any>, jobName: string): Promise<void> => {
	const { insertedId } = await CronHistory.insertOne({
		_id: Random.id(),
		intendedAt: new Date(),
		name: jobName,
		startedAt: new Date(),
	});
	try {
		const result = await fn();
		await CronHistory.updateOne(
			{ _id: insertedId },
			{
				$set: {
					finishedAt: new Date(),
					result,
				},
			},
		);
		return result;
	} catch (error: any) {
		await CronHistory.updateOne(
			{ _id: insertedId },
			{
				$set: {
					finishedAt: new Date(),
					error: error?.stack ? error.stack : error,
				},
			},
		);
		throw error;
	}
};

type ReservedJob = {
	name: string;
	callback: () => any | Promise<any>;
} & (
	| {
			schedule: string;
			timestamped: false;
	  }
	| {
			when: Date;
			timestamped: true;
	  }
);

export class AgendaCronJobs {
	private reservedJobs: ReservedJob[] = [];

	private scheduler: Agenda | undefined;

	public get started(): boolean {
		return Boolean(this.scheduler);
	}

	public async start(mongo: Db): Promise<void> {
		this.scheduler = new Agenda({
			mongo,
			db: { collection: 'rocketchat_cron' },
			defaultConcurrency: 1,
		});
		await this.scheduler.start();

		for await (const job of this.reservedJobs) {
			if (job.timestamped) {
				await this.addAtTimestamp(job.name, job.when, job.callback);
			} else {
				await this.add(job.name, job.schedule, job.callback);
			}
		}

		this.reservedJobs = [];
	}

	public async add(name: string, schedule: string, callback: () => any | Promise<any>): Promise<void> {
		if (!this.scheduler) {
			return this.reserve({ name, schedule, callback, timestamped: false });
		}

		await this.define(name, callback);
		await this.scheduler.every(schedule, name, {}, {});
	}

	public async addAtTimestamp(name: string, when: Date, callback: () => any | Promise<any>): Promise<void> {
		if (!this.scheduler) {
			return this.reserve({ name, when, callback, timestamped: true });
		}

		await this.define(name, callback);
		await this.scheduler.schedule(when, name, {});
	}

	public async remove(name: string): Promise<void> {
		if (!this.scheduler) {
			return this.unreserve(name);
		}

		await this.scheduler.cancel({ name });
	}

	public async has(jobName: string): Promise<boolean> {
		if (!this.scheduler) {
			return Boolean(this.reservedJobs.find(({ name }) => name === jobName));
		}

		return this.scheduler.has({ name: jobName });
	}

	private async reserve(config: ReservedJob): Promise<void> {


iew::startDrag(a0) : startDrag(a0));
}

QStyleOptionViewItem sipQListWidget::sipProtectVirt_viewOptions(bool sipSelfWasArg) const
{
    return (sipSelfWasArg ? QListView::viewOptions() : viewOptions());
}

void sipQListWidget::sipProtectVirt_paintEvent(bool sipSelfWasArg,QPaintEvent *a0)
{
    (sipSelfWasArg ? QListView::paintEvent(a0) : paintEvent(a0));
}

int sipQListWidget::sipProtectVirt_horizontalOffset(bool sipSelfWasArg) const
{
    return (sipSelfWasArg ? QListView::horizontalOffset() : horizontalOffset());
}

int sipQListWidget::sipProtectVirt_verticalOffset(bool sipSelfWasArg) const
{
    return (sipSelfWasArg ? QListView::verticalOffset() : verticalOffset());
}

QModelIndex sipQListWidget::sipProtectVirt_moveCursor(bool sipSelfWasArg,int a0,Qt::KeyboardModifiers a1)
{
    return (sipSelfWasArg ? QListView::moveCursor((QAbstractItemView::CursorAction)a0,a1) : moveCursor((QAbstractItemView::CursorAction)a0,a1));
}

QRect sipQListWidget::sipProtect_rectForIndex(const QModelIndex& a0) const
{
    return QListView::rectForIndex(a0);
}

void sipQListWidget::sipProtect_setPositionForIndex(const QPoint& a0,const QModelIndex& a1)
{
    QListView::setPositionForIndex(a0,a1);
}

void sipQListWidget::sipProtectVirt_setSelection(bool sipSelfWasArg,const QRect& a0,QItemSelectionModel::SelectionFlags a1)
{
    (sipSelfWasArg ? QListView::setSelection(a0,a1) : setSelection(a0,a1));
}

QRegion sipQListWidget::sipProtectVirt_visualRegionForSelection(bool sipSelfWasArg,const QItemSelection& a0) const
{
    return (sipSelfWasArg ? QListView::visualRegionForSelection(a0) : visualRegionForSelection(a0));
}

QModelIndexList sipQListWidget::sipProtectVirt_selectedIndexes(bool sipSelfWasArg) const
{
    return (sipSelfWasArg ? QListView::selectedIndexes() : selectedIndexes());
}

void sipQListWidget::sipProtectVirt_updateGeometries(bool sipSelfWasArg)
{
    (sipSelfWasArg ? QListView::updateGeometries() : updateGeometries());
}

bool sipQListWidget::sipProtectVirt_isIndexHidden(bool sipSelfWasArg,const QModelIndex& a0) const
{
    return (sipSelfWasArg ? QListView::isIndexHidden(a0) : isIndexHidden(a0));
}

void sipQListWidget::sipProtectVirt_selectionChanged(bool sipSelfWasArg,const QItemSelection& a0,const QItemSelection& a1)
{
    (sipSelfWasArg ? QListView::selectionChanged(a0,a1) : selectionChanged(a0,a1));
}

void sipQListWidget::sipProtectVirt_currentChanged(bool sipSelfWasArg,const QModelIndex& a0,const QModelIndex& a1)
{
    (sipSelfWasArg ? QListView::currentChanged(a0,a1) : currentChanged(a0,a1));
}

QStringList sipQListWidget::sipProtectVirt_mimeTypes(bool sipSelfWasArg) const
{
    return (sipSelfWasArg ? QListWidget::mimeTypes() : mimeTypes());
}

QMimeData * sipQListWidget::s


from django.test import SimpleTestCase

from corehq.apps.userreports.reports.builder import const
from corehq.apps.userreports.reports.builder.filter_formats import get_pre_filter_format

class PreFilterFormatTest(SimpleTestCase):

    def test_empty_filter_format(self):
        self.assertEqual(const.PRE_FILTER_VALUE_IS_EMPTY, get_pre_filter_format({
            'pre_operator': '',
            'pre_value': '',
        }))

    def test_exists_filter_format(self):
        self.assertEqual(const.PRE_FILTER_VALUE_EXISTS, get_pre_filter_format({
            'pre_operator': '!=',
            'pre_value': '',
        }))

    def test_not_equal_filter_format(self):
        self.assertEqual(const.PRE_FILTER_VALUE_NOT_EQUAL, get_pre_filter_format({
            'pre_operator': 'distinct from',
            'pre_value': '',
        }))
        self.assertEqual(const.PRE_FILTER_VALUE_NOT_EQUAL, get_pre_filter_format({
            'pre_operator': 'distinct from',
            'pre_value': 'a_value',
        }))

    def test_value_filter_format(self):
        self.assertEqual(const.FORMAT_VALUE, get_pre_filter_format({
            'pre_operator': '=',
            'pre_value': 'a_value',
        }))

    def test_date_filter_format(self):
        # this is a bit weird but just documenting current behavior, which uses
        # the lack of value to assume it is a date
        self.assertEqual(const.FORMAT_DATE, get_pre_filter_format({
            'pre_operator': '=',
            'pre_value': '',
        }))


using Dpr.SubContents;
using Pml;
using Pml.Personal;
using Pml.PokePara;
using System;
using System.Collections.Generic;
using System.Text;
using Ug;
using UnityEngine;
using XLSXContent;
using static Dpr.EvScript.EvWork;

namespace Dpr.UnderGround
{
    public class UgPokeLottery
    {
        private UgRandMark.Sheettable randMarkData;
        private UgEncount monsData;
        private List<KeyValuePair<TypeAndSize, int>> MonsDataIndexs = new List<KeyValuePair<TypeAndSize, int>>();
        private List<ushort> buf_wazaTable = new List<ushort>();

        public List<PokeSlot> DoLottery(int randMarkID)
        {
            randMarkData = Array.Find(UgResManager.UgRandMark.table, x => x.id == randMarkID);
            monsData = UgResManager.GetUgEncount(randMarkID);

            // Returns all the enabled mons from the relevant UgEncount file and adds them to MonsDataIndexs
            UgEncount.Sheettable[] origList = GetEnablePokes(GetVersionNo(), GetStoryNo());

            // Number from 0-30 based on amount of statues?
            int statueBoost = UgFieldManager.Instance.statueBuff.GetPlusSlotNum();

            // Roll for if we have the minimum amount of slots or maximum
            int slotCountRoll = UnityEngine.Random.Range(0, 100);
            int Num = randMarkData.min;
            if (slotCountRoll < 50 + statueBoost)
            {
                Num = randMarkData.max;
            }

            int rarePokeRoll = UnityEngine.Random.Range(0, 100);
            bool hideoutFlag = FlagWork.GetFlag(FLAG_INDEX.FE_DONE_KAKUREGA);

            MonsNo rareMonsno = MonsNo.NULL;
            if (rarePokeRoll < 50 || !hideoutFlag)
            {
                // Returns a monsno of the rare poke to spawn, or 0 if theres none
                rareMonsno = GetRarePoke(randMarkID, PlayerWork.playerData.mystatus.rom_code);
                Num--; // Will still remove a slot even if no eligible rare pokes exist
            }

            List<PokeSlot> slots = CreateSlots(Num);

            byte rareTryCount;
            if (UgFieldManager.Instance.KousekiBonusTime <= 0.0)
            {
                rareTryCount = 1;
            }
            else
            {
                rareTryCount = 2;
            }

            // Fill the slots
            LotteryPoke(origList, slots, rareTryCount);

            // Add the rare mon if there is one
            if (rareMonsno != 0)
            {
                PokeSlot item = new PokeSlot(PokeType.NULL, MonsSize.S);
                item.param = CreatePokemonParam_by_Tokusei(rareMonsno, rareTryCount);
                slots.Add(item);
            }

            return slots;
        }

        private MonsNo GetRarePoke(int randMarkID, int versionID)
        {
            UgSpecialPokemon.SheetSheet1[] allRares = Array.FindAll(UgResManager.UgSpecialPokemon.Sheet1, x => x.id == randMarkID);

            if (allRares.Length == 0)
                return MonsNo.NULL;

            List<PokeRate> rates = new List<PokeRate>();
            foreach (var rare in allRares)
            {
                if (versionID == 0)
                    rates.Add(new PokeRate(rare.monsno, rare.Dspecialrate));
                else
                    rates.Add(new PokeRate(rare.monsno, rare.Pspecialrate));
            }

            string log = "";
            rates.ForEach(poke =>
            {
                if (poke.rate != 0)
                    log += Enum.GetName(typeof(MonsNo), poke.monsNo) + " ";
            });

            // This line (or similar) is presumed to have been commented out.
            //Debug.Log(log);


,	'',	'',	'',	'',	'',	'',	'',	'5030001',	'',	'',	'2',	'',	'刺蝽',	'Reduvia',	'[{"id":5030001,"pos":2,"moveTo":2},{"id":6028001,"pos":3,"out":2}]',	'',	'2',	'5',	'',	'',	'',	'',	'',	'none',	'',	'2081951',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2081951',	'',	'还有什么事情吗？',	'',	'',	'',	'',	'',	'',	'',	'',	'6028001',	'',	'',	'2',	'',	'克拉伦特',	'Clarent',	'[{"id":6028001,"pos":2,"enter":2}]',	'',	'4',	'',	'',	'',	'',	'',	'',	'',	'',	'2081952',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2081952',	'',	'……',	'',	'',	'',	'',	'',	'',	'',	'',	'5030001',	'',	'',	'2',	'',	'刺蝽',	'Reduvia',	'[{"id":5030001,"pos":2,"enter":2}]',	'',	'6',	'',	'',	'',	'',	'',	'',	'',	'',	'2081953',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2081953',	'',	'之前在办公室……我很抱歉。',	'',	'',	'',	'',	'',	'',	'',	'',	'5030001',	'',	'',	'2',	'',	'刺蝽',	'Reduvia',	'',	'',	'6',	'',	'',	'',	'',	'',	'',	'Plot_Daily_Normal',	'',	'2081954',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2081954',	'',	'……',	'',	'',	'',	'',	'',	'',	'',	'',	'6028001',	'',	'',	'2',	'',	'克拉伦特',	'Clarent',	'[{"id":6028001,"pos":2,"enter":2}]',	'',	'5',	'',	'',	'',	'',	'',	'',	'',	'',	'2081955',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2081955',	'',	'你的歉意，我也确实收下了——那我们前哨基地再见。',	'',	'',	'',	'',	'',	'',	'',	'',	'6028001',	'',	'',	'2',	'',	'克拉伦特',


const (
	FooIdFieldIndex    int = 0
	FooValueFieldIndex int = 1
	FooMaxFieldIndex   int = (2 - 1)
)

// A field set saying that all fields in Foo should be updated.
// For use as a 'fieldMask' parameter
var FooAllFields pggen.FieldSet = pggen.NewFieldSetFilled(2)

var defaultableColsForFoo = func() pggen.FieldSet {
	fs := pggen.NewFieldSet(FooMaxFieldIndex)
	fs.Set(FooIdFieldIndex, true)
	return fs
}()

var fieldsForFoo []fieldNameAndIdx = []fieldNameAndIdx{
	{name: `id`, idx: FooIdFieldIndex},
	{name: `value`, idx: FooValueFieldIndex},
}

// Update a Foo. 'value' must at the least have
// a primary key set. The 'fieldMask' field set indicates which fields
// should be updated in the database.
//
// Returns the primary key of the updated row.
func (p *PGClient) UpdateFoo(
	ctx context.Context,
	value *Foo,
	fieldMask pggen.FieldSet,
	opts ...pggen.UpdateOpt,
) (ret int64, err error) {
	return p.impl.updateFoo(ctx, value, fieldMask, opts...)
}

// Update a Foo. 'value' must at the least have
// a primary key set. The 'fieldMask' field set indicates which fields
// should be updated in the database.
//
// Returns the primary key of the updated row.
func (tx *TxPGClient) UpdateFoo(
	ctx context.Context,
	value *Foo,
	fieldMask pggen.FieldSet,
	opts ...pggen.UpdateOpt,
) (ret int64, err error) {
	return tx.impl.updateFoo(ctx, value, fieldMask, opts...)
}

// Update a Foo. 'value' must at the least have
// a primary key set. The 'fieldMask' field set indicates which fields
// should be updated in the database.
//
// Returns the primary key of the updated row.
func (conn *ConnPGClient) UpdateFoo(
	ctx context.Context,
	value *Foo,
	fieldMask pggen.FieldSet,
	opts ...pggen.UpdateOpt,
) (ret int64, err error) {
	return conn.impl.updateFoo(ctx, value, fieldMask, opts...)
}
func (p *pgClientImpl) updateFoo(
	ctx context.Context,
	value *Foo,
	fieldMask pggen.FieldSet,
	opts ...pggen.UpdateOpt,
) (ret int64, err error) {
	opt := pggen.UpdateOptions{}
	for _, o := range opts {
		o(&opt)
	}

	if !fieldMask.Test(FooIdFieldIndex) {
		return ret, p.client.errorConverter(fmt.Errorf(`primary key required for updates to 'foos'`))
	}

	updateStmt := genUpdateStmt(
		`foos`,
		"id",
		fieldsForFoo,
		fieldMask,
		"id",
	)

	args := make([]interface{}, 0, 2)
	if fieldMask.Test(FooIdFieldIndex) {
		args = append(args, value.Id)
	}
	if fieldMask.Test(FooValueFieldIndex) {
		args = append(args, value.Value)
	}

	// add the primary key arg for the WHERE condition
	args = append(args, value.Id)

	var id int64
	err = p.db.QueryRowContext(ctx, updateStmt, args...).
		Scan(&(id))
	if err != nil {
		return ret, p.client.errorConverter(err)
	}

	return id, nil
}

// Upsert a Foo value. If the given value conflicts with
// an existing row in the database, use the provided value to update that row
// rather than inserting it. Only the fields specified by 'fieldMask' are
// actually updated. All other fields are left as-is.
func (p *PGClient) UpsertFoo(
	ctx context.Context,
	value *Foo,
	constraintNames []string,
	fieldMask pggen.


)

### Bug Fixes

* enhance focus handling ([#2595](https://github.com/docsifyjs/docsify/issues/2595)) ([22ac7e8](https://github.com/docsifyjs/docsify/commit/22ac7e855de24b13280e9904930e58af58dbd6a7))
* enhance focus handling by adding smooth scroll to content area ([#2569](https://github.com/docsifyjs/docsify/issues/2569)) ([20d095b](https://github.com/docsifyjs/docsify/commit/20d095b53c827c4d0590dee5fd377ba21560d7fb))
* escape HTML in search keywords ([#2586](https://github.com/docsifyjs/docsify/issues/2586)) ([743e9cb](https://github.com/docsifyjs/docsify/commit/743e9cb484cc70859a582fb74d78ea1f52ef2c2a))
* exclude app-name-link from sidebar text overflow styling ([#2564](https://github.com/docsifyjs/docsify/issues/2564)) ([375c058](https://github.com/docsifyjs/docsify/commit/375c058e3e1b12f3507d97a41b3fd8d6c4e904b0))
* handle hash navigation to prevent duplicate callbacks ([#2575](https://github.com/docsifyjs/docsify/issues/2575)) ([72569de](https://github.com/docsifyjs/docsify/commit/72569dee8db92a01e8de5448e05c32afbd090fb2))
* heading link overflow style ([#2568](https://github.com/docsifyjs/docsify/issues/2568)) ([be21637](https://github.com/docsifyjs/docsify/commit/be2163725ae314de3aa9a56c1216ce8c774cfcc6))
* improve slug generation ([#2581](https://github.com/docsifyjs/docsify/issues/2581)) ([9bc58c9](https://github.com/docsifyjs/docsify/commit/9bc58c9ca24db513a90a06752181954aab0628ca))
* normalize slugs to NFC and remove emoji variation selector ([#2597](https://github.com/docsifyjs/docsify/issues/2597)) ([5999f09](https://github.com/docsifyjs/docsify/commit/5999f09a4bac23169766af68fbdc71215161c1c6))
* remove block display from anchor links to prevent layout issues ([#2576](https://github.com/docsifyjs/docsify/issues/2576)) ([6e45024](https://github.com/docsifyjs/docsify/commit/6e4502416886b9494cd7b510968c351c7e6fc3cd))
* **sidebar:** remove ignored headings and children ([#2580](https://github.com/docsifyjs/docsify/issues/2580)) ([2a49bd0](https://github.com/docsifyjs/docsify/commit/2a49bd0aa4bb17eeb3d9f363c6f2b01e61e778ac))
* update relative link handling ([#2579](https://github.com/docsifyjs/docsify/issues/2579)) ([eeacfcc](https://github.com/docsifyjs/docsify/commit/eeacfcce2a3df4e4146b5b54275553452b317352))

### Features

* GitHub style callouts ([#2487](https://github.com/docsifyjs/docsify/issues/2487)) ([2e59b0f](https://github.com/docsifyjs/docsify/commit/2e59b0f50cf8123b98e4c97c3053aa6985ae13a2))
* support config helper multi keys if supported ([#2571](https://github.com/docsifyjs/docsify/issues/2571)) ([


     // Create an attachment.
                    Entity NewAttachment = new Entity("annotation");
                    if (TempAttachment.Contains("subject"))
                        NewAttachment.Attributes.Add("subject", TempAttachment["subject"]);
                    if (TempAttachment.Contains("filename"))
                        NewAttachment.Attributes.Add("filename", TempAttachment["filename"]);
                    if (TempAttachment.Contains("notetext"))
                        NewAttachment.Attributes.Add("notetext", TempAttachment["notetext"]);
                    if (TempAttachment.Contains("mimetype"))
                        NewAttachment.Attributes.Add("mimetype", TempAttachment["mimetype"]);
                    if (TempAttachment.Contains("documentbody"))
                        NewAttachment.Attributes.Add("documentbody", TempAttachment["documentbody"]);
                    NewAttachment.Attributes.Add("objectid", new EntityReference(Letter.LogicalName, Letter.Id));
                    service.Create(NewAttachment);

                    if (Logging)
                        Log("New Attachment Added To Letter", LogFilePath);
                }
                else
                {
                    if (Logging)
                        Log("Temp Attachment does not exist", LogFilePath);
                }
                if (Logging)
                    Log("Workflow Executed Successfully", LogFilePath);
            }
            catch (Exception ex)
            {
                Log(ex.Message, LogFilePath);
            }
        }

        private void Log(string Message, string LogFilePath)
        {
            try
            {
                if (LogFilePath == "")
                    File.AppendAllText("C:\\Aspose Logs\\Aspose.AutoMerge.AttachToLetter.log", Environment.NewLine + DateTime.Now.ToString() + ":- " + Message);
                else
                    File.AppendAllText(LogFilePath + "\\Aspose.AutoMerge.AttachToLetter.log", Environment.NewLine + DateTime.Now.ToString() + ":- " + Message);
            }
            catch { }
        }
    }
}


-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{white-space:pre;-webkit-user-select:text;user-select:text}.monaco-editor-hover{cursor:default;position:absolute;overflow:hidden;background-color:#f3f3f3;border:1px solid #ccc;z-index:5;-webkit-user-select:text;-ms-user-select:text;-moz-user-select:text;-o-user-select:text;user-select:text;box-sizing:initial;animation:fadein .1s linear;line-height:1.5em}.monaco-editor-hover.hidden{display:none}.monaco-editor-hover .monaco-editor-hover-content{max-width:500px}.monaco-editor-hover .hover-row{padding:4px 5px}.monaco-editor-hover .hover-row:not(:first-child):not(:empty){border-top:1px solid hsla(0,0%,80%,.5)}.monaco-editor-hover p,.monaco-editor-hover ul{margin:8px 0}.monaco-editor-hover p:first-child,.monaco-editor-hover ul:first-child{margin-top:0}.monaco-editor-hover p:last-child,.monaco-editor-hover ul:last-child{margin-bottom:0}.monaco-editor-hover ul{list-style-position:inside;-webkit-padding-start:6px}.monaco-editor-hover code{background-color:hsla(0,0%,52%,.14);border-radius:3px;padding:0 .4em}.monaco-editor-hover .monaco-tokenized-source{white-space:pre-wrap;word-break:break-all}.monaco-editor .hoverHighlight{background:rgba(173,214,255,.15)}.monaco-editor.vs-dark .monaco-editor-hover{background-color:#2d2d30;border-color:#555}.monaco-editor.vs-dark .monaco-editor-hover a{color:#1c5daf}.monaco-editor.vs-dark .monaco-editor-hover .hover-row:not(:first-child):not(:empty){border-color:rgba(85,85,85,.5)}.monaco-editor.vs-dark .hoverHighlight{background:rgba(38,79,120,.25)}.monaco-editor.hc-black .monaco-editor-hover{background-color:#0c141f}.monaco-editor.hc-black .monaco-editor-hover a{color:#1c5daf}.monaco-editor .iPadShowKeyboard{width:58px;min-width:0;height:36px;min-height:0;margin:0;


::warning(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException& e)
{
    // print some details to error output and throw an
    // exception to abort the parsing
    cerr << "Warning at file " << StrX(e.getSystemId()) << ", line " << e.getLineNumber()
         << ", char " << e.getColumnNumber() << endl;
    throw e;
}

void Base::XMLReader::resetErrors()
{}

bool Base::XMLReader::testStatus(ReaderStatus pos) const
{
    return StatusBits.test(static_cast<size_t>(pos));
}

void Base::XMLReader::setStatus(ReaderStatus pos, bool on)
{
    StatusBits.set(static_cast<size_t>(pos), on);
}

void Base::XMLReader::setPartialRestore(bool on)
{
    setStatus(PartialRestore, on);
    setStatus(PartialRestoreInDocumentObject, on);
    setStatus(PartialRestoreInProperty, on);
    setStatus(PartialRestoreInObject, on);
}

void Base::XMLReader::clearPartialRestoreDocumentObject()
{
    setStatus(PartialRestoreInDocumentObject, false);
    setStatus(PartialRestoreInProperty, false);
    setStatus(PartialRestoreInObject, false);
}

void Base::XMLReader::clearPartialRestoreProperty()
{
    setStatus(PartialRestoreInProperty, false);
    setStatus(PartialRestoreInObject, false);
}

void Base::XMLReader::clearPartialRestoreObject()
{
    setStatus(PartialRestoreInObject, false);
}

// ----------------------------------------------------------

// NOLINTNEXTLINE
Base::Reader::Reader(std::istream& str, const std::string& name, int version)
    : std::istream(str.rdbuf())
    , _str(str)
    , _name(name)
    , fileVersion(version)
{}

std::string Base::Reader::getFileName() const
{
    return this->_name;
}

int Base::Reader::getFileVersion() const
{
    return fileVersion;
}

std::istream& Base::Reader::getStream()
{
    return this->_str;
}

void Base::Reader::initLocalReader(std::shared_ptr<Base::XMLReader> reader)
{
    this->localreader = reader;
}

std::shared_ptr<Base::XMLReader> Base::Reader::getLocalReader() const
{
    return (this->localreader);
}
// SPDX-License-Identifier: LGPL-2.1-or-later
/***************************************************************************
 *   Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de>              *
 *                                                                         *
 *   This file is part of the FreeCAD CAx development system.              *
 *                                                                         *
 *   This library is free software; you can redistribute it and/or         *
 *   modify it under the terms of the GNU Library General Public           *
 *   License as published by the Free Software Foundation; either          *
 *   version 2 of the License, or (at your option) any later version.      *
 *                                                                         *
 *   This library  is distributed in the hope that it will be useful,      *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU Library General Public License for more details.                  *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this library; see the file COPYING.LIB. If not,    *
 *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
 *   Suite 330, Boston, MA  02111-1307, USA                                *


uint = 1;
    pub const mips: ::libc::c_uint = 2;
    pub const mipsel: ::libc::c_uint = 3;
    pub const arm: ::libc::c_uint = 4;
    pub const armeb: ::libc::c_uint = 5;
    pub const thumb: ::libc::c_uint = 6;
    pub const arm64: ::libc::c_uint = 7;
    pub const ppc32: ::libc::c_uint = 8;
    pub const ppc64: ::libc::c_uint = 9;
    pub const sparc: ::libc::c_uint = 10;
    pub const systemz: ::libc::c_uint = 11;
    #[repr(C)]
    #[derive(Copy)]
    pub struct Struct_Unnamed1 {
        pub name: *const ::libc::c_char,
        pub addr: uint64_t,
    }
    impl ::std::clone::Clone for Struct_Unnamed1 {
        fn clone(&self) -> Self { *self }
    }
    impl ::std::default::Default for Struct_Unnamed1 {
        fn default() -> Self { unsafe { ::std::mem::zeroed() } }
    }
    pub type Reloc_A = Struct_Unnamed1;
    extern "C" {
        pub fn free_vec(vec: *mut byte) -> ();
        pub fn assemble(arch: Enum_Arch, instructions: *const ::libc::c_char,
                        addr: uint64_t, relocs: *const Reloc_A, n_relocs: size_t,
                        out: *mut *mut byte, out_len: *mut size_t)
                        -> ::libc::c_int;
    }
}

#[allow(non_camel_case_types)]
pub enum Arch {
    X86,
    X86_64,
    Mips,
    Mipsel,
    Arm,
    Armeb,
    Arm64,
    Thumb,
    PPC32,
    PPC64,
    Sparc,
    SystemZ
}

impl Arch {
    pub fn to_c(&self) -> u32 {
        match *self {
            Arch::X86 => extern_def::x86,
            Arch::X86_64 => extern_def::x86_64,
            Arch::Mips => extern_def::mips,
            Arch::Mipsel => extern_def::mipsel,
            Arch::Arm => extern_def::arm,
            Arch::Armeb => extern_def::armeb,
            Arch::Arm64 => extern_def::arm64,
            Arch::Thumb => extern_def::thumb,
            Arch::PPC32 => extern_def::ppc32,
            Arch::PPC64 => extern_def::ppc64,
            Arch::Sparc => extern_def::sparc,
            Arch::SystemZ => extern_def::systemz
        }
    }
}

pub struct Reloc {
    name: String,
    addr: u64
}

impl Reloc {
    pub fn to_c(&self) -> extern_def::Reloc_A {
        use std::ffi::CString;
        let c_name = CString::new(self.name.as_str()).unwrap();

        extern_def::Reloc_A {
            name: c_name.as_ptr(),
            addr: self.addr
        }
    }

    pub fn new(name: &str, addr: u64) -> Reloc {
        Reloc { name: name.to_string(), addr: addr }
    }
}

pub fn assemble(arch: Arch, input: &str) -> Option<Vec<u8>> {
    assemble2(arch, input, 0x1000, &[])
}

pub fn assemble2(arch: Arch, input: &str, addr: u64, relocs: &[Reloc])
    -> Option<Vec<u8>>
{
    use std::ffi::CString;
    use std::slice;
    use std::mem;
    use libc;

    let e_arch = arch.to_c();
    let ins = CString::new(input).unwrap();

    let n_relocs = rel


 50%;
	width: 20px;
	height: 20px;
	text-align: center;
	line-height: 20px;
	margin-top: -10px;
	margin-left: -10px;
	text-indent: 0
}

.wp-theme-4 .widget.tags-wr {
	padding-bottom: 15px
}

.wp-theme-4 .tags-list:before,.wp-theme-4 .tags-list:after {
	display: table;
	content: ""
}

.wp-theme-4 .tags-list:after {
	clear: both
}

.wp-theme-4 .tags-list {
	list-style: none;
	padding-left: 0;
	margin: 0
}

.wp-theme-4 .tags-list li {
	border: 1px solid #8ec449;
	background: #FFF;
	padding: 5px;
	float: left;
	margin-right: 5px;
	margin-bottom: 5px;
	color: #8ec449;
	font-size: 12px
}

.wp-theme-4 .tags-list li a {
	color: #8ec449;
	margin-left: 4px
}

.wp-theme-4 .tags-list li:hover {
	background: #8ec449;
	color: #FFF
}

.wp-theme-4 .tags-list li:hover a {
	color: #FFF;
	text-decoration: none
}

.wp-theme-5 .btn {
	font-weight: normal;
	white-space: nowrap;
	vertical-align: middle;
	cursor: pointer;
	background-image: none;
	border: 1px solid transparent;
	border-radius: 2px;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-o-user-select: none;
	user-select: none
}

.wp-theme-5 .btn i {
	margin-right: 4px
}

.wp-theme-5 .btn-lg {
	padding: 10px 16px;
	font-size: 18px;
	line-height: 1.33;
	border-radius: 3px
}

.wp-theme-5 .btn-lg i {
	font-size: 24px;
	position: relative;
	top: 3px
}

.wp-theme-5 .btn-xs {
	padding: 4px 10px
}

.wp-theme-5 .btn-one {
	background-color: none;
	border: 2px solid #FFF;
	color: #FFF
}

.wp-theme-5 .btn-one:hover,.wp-theme-5 .btn-one:focus,.wp-theme-5 .btn-one:active,.wp-theme-5 .btn-one.active,.wp-theme-5 .open .dropdown-toggle.btn-one
	{
	color: #f1c40f;
	background-color: #FFF;
	border-color: #FFF
}

.wp-theme-5 .btn-one:active,.wp-theme-5 .btn-one.active,.wp-theme-5 .open .dropdown-toggle.btn-one
	{
	background-image: none
}

.wp-theme-5 .btn-two {
	color: #ffffff;
	background-color: #f1c40f;
	border: 1px solid;
	border-color: #e7ba05
}

.wp-theme-5 .btn-two:hover,.wp-theme-5 .btn-two:focus,.wp-theme-5 .btn-two:active,.wp-theme-5 .btn-two.active,.wp-theme-5 .open .dropdown-toggle.btn-two
	{
	color: #ffffff;
	background-color: #ddb000;
	border-color: #ddb000
}

.wp-theme-5 .btn-two:active,.wp-theme-


] 0.125em
        [D3 barcount] 0.125em
        [C3] 0.125em
        [B2] 0.125em
        [A2] 0.125em
        [G2] 0.125em
        [F2] 0.125em
        [E2] 0.125em
        [D2 lyrics] 0.125em
        [min];
}

/* Key signature */

.alto-stave > [data-pitch="F♭"] { grid-row-start: F3; }
.alto-stave > [data-pitch="C♭"] { grid-row-start: C4; }
.alto-stave > [data-pitch="G♭"] { grid-row-start: G3; }
.alto-stave > [data-pitch="D♭"] { grid-row-start: D4; }
.alto-stave > [data-pitch="A♭"] { grid-row-start: A3; }
.alto-stave > [data-pitch="E♭"] { grid-row-start: E4; }
.alto-stave > [data-pitch="B♭"] { grid-row-start: B3; }
.alto-stave > [data-pitch="F♯"] { grid-row-start: F4; }
.alto-stave > [data-pitch="C♯"] { grid-row-start: C4; }
.alto-stave > [data-pitch="G♯"] { grid-row-start: G4; }
.alto-stave > [data-pitch="D♯"] { grid-row-start: D4; }
.alto-stave > [data-pitch="A♯"] { grid-row-start: A3; }
.alto-stave > [data-pitch="E♯"] { grid-row-start: E4; }
.alto-stave > [data-pitch="B♯"] { grid-row-start: B3; }

.stave {
    /* The SMuFL font spec says that a standard five-line stave is 1em high,
       making the stave line to stave line distance 0.25em, and a stave row 0.125em */
    /*--stem-height: 0.875em;*/

    display: grid;

    /* Allow staves that are not bars to hold content horizontally */
    grid-auto-columns: auto;
    column-gap: 0;
    justify-content: start;
    padding-left: 0.125em;

    /* Prevent stray content from breaking layout */
    grid-auto-rows: 0;
    row-gap: 0;

    /* By default, render staves at 32px high */
    font-size: 2em;

    /* Render the stave as a background image */
    --line-thickness: 1px;
    /*background-image:
    url('data:image/svg+xml;utf8,<svg viewBox="0 -5 1 10" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\
        <style>line{vector-effect:non-scaling-stroke;stroke:currentcolor;stroke-width:0.04em;stroke-linejoin:round;stroke-linecap:butt;fill:none;}</style>\
        <line x1="0" x2="1" y1="4" y2="4"></line>\
        <line x1="0" x2="1" y1="2" y2="2"></line>\
        <line x1="0" x2="1" y1="0" y2="0"></line>\
        <line x1="0" x2="1" y1="-2" y2="-2"></line>\
        <line x1="0" x2="1" y1="-4" y2="-4"></line>\
        <line x1="1" x2="1" y1="4" y2="-4" style="stroke-width:0.12em;"></line>\
    </svg>');*/
    background-image: linear-gradient


            oldonload();
                func();
            }
        }
    }
    addLoadEvent(firstFunction);
    addLoadEvent(secondFunction);
    ```
- nodeName 属性总是返回一个大写字母的值，即使元素在 HTML 文档里是小写字母
- onclick 事件处理函数，
  - 虽然它的名字“onclick”给人一种它只与鼠标点击动作相关联的印象，但在几乎所有的浏览器里，用Tab键移动到某个链接然后按下回车键的动作也会触发 onclick 事件
  - 最好不要使用 onkeypress 事件处理函数。onclick 事件处理函数已经能满足需要。虽然它叫“onclick”，但它对键盘访问的支持相当完美
- DOM 方法：getElementById, getElementsByTagName, getAttribute, setAttribute 都是 **DOM Core** 的组成部分。它们并不专属于JavaScript，支持DOM的任何一种程序设计语言都可以使用它们。它们的用途也并非仅限于处理网页，它们可以用来处理用任何一种标记语言（比如XML）编写出来的文档。
- 在使用 JavaScript 语言和 DOM 为 HTML 文件编写脚本时，还有许多属性可供选用。例如，我已经使用了一个属性 onclick，用于图片库中的事件管理。这些属性属于 **HTML-DOM**，它们在 **DOM Core** 出现之前很久就已经为人们所熟悉了。HTML-DOM 还提供了许多描述各种 HTML 元素的属性
  - 同样的操作既可以只使用 DOM Core 来实现，也可以使用 HTML-DOM 来实现
    ```javascript
    document.getElementByTagName("form")  // DOM Core
    element.getAttribute("src")           // DOM Core
    document.forms  // HTML-DOM
    element.src     // HTML-DOM
    ```
  - 正如大家看到的那样，HTML-DOM 代码通常会更短，必须提醒一下，它们只能用来处理 Web 文档。如果你打算用 DOM 处理其他类型的文档，请千万注意这一点。
  - 即使你决定只使用 DOM Core 方法，也应该了解 HTML-DOM。在阅读别人编写的脚本时难免会遇到各种 HTML-DOM 记号，你至少应该知道都是干什么用的。
  - 在本书的绝大多数章节里，只使用 DOM Core 来编写代码。虽然代码会因此而变得有点儿冗长，但 DOM Core 方法更容易使用
- 结构与行为的分离程度越大越好。

## 第7章 动态创建标记
- 两个过去使用的技术，document.write 和 innerHTML
  - document 对象的 write() 方法可以方便快捷地把字符串插入到文档里
  - document.write 的最大缺点是它违背了“行为应该与表现分离”的原则。即使把 document.write 语句挪到外部函数里，也还是需要在标记的`<body>`部分使用`<


/*
 * customerwidget.h
 * Copyright 2017 - ~, Apin <apin.klas@gmail.com>
 *
 * This file is part of Sultan.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef CUSTOMERWIDGET_H
#define CUSTOMERWIDGET_H

#include "messagehandler.h"
#include <QModelIndexList>
#include <QWidget>

namespace Ui {
class NormalWidget;
}

namespace LibGUI {

class TableWidget;
class CustomerAddDialog;
class TileWidget;

class CustomerWidget : public QWidget, public LibG::MessageHandler {
    Q_OBJECT
  public:
    CustomerWidget(LibG::MessageBus *bus, QWidget *parent = nullptr);

  protected:
    void messageReceived(LibG::Message *msg) override;

  private:
    Ui::NormalWidget *ui;
    TableWidget *mTableWidget;
    CustomerAddDialog *mAddDialog;
    TileWidget *mTileCredit;

  private slots:
    void addClicked();
    void updateClicked(const QModelIndex &index);
    void deleteClicked(const QModelIndexList &index);
    void customerAdded();
    void customerUpdated(int id);
    void creditClicked();
    void rewardClicked();
    void refreshSummary();

  signals:
    void requestOpenCustomerCredit(int id, const QString &number);
    void requestOpenCustomerReward(int id, const QString &number);
};

} // namespace LibGUI
#endif // CUSTOMERWIDGET_H


} unit       [unit of the value]
  */
  updatePr( exerciseId: string, newPr: number, type: string, unit: string ): any {
    var userId = this.fireAuth.currentUser.uid;

    // return updated value
    return this.userProfile.child(userId + '/exercises/' + exerciseId).update({
      Pr : newPr,
      Type: type,
      Unit: unit,
      Date: new Date().toDateString()
    })
  }

  /**
    [addExercise description]
    add new exercise into exercise's list
    @param {string} exerciseId [exercise's id]
    @param {number} newPr      [value of the new pr]
    @param {string} type       [type of the value]
    @param {string} unit       [unit of the value]
  */
  addExercise( name: string, pr: number, type: string, unit: string ){
    var userId = this.fireAuth.currentUser.uid;

    return this.userProfile.child(userId + '/exercises/').push({
      Name: name,
      Type: type,
      Unit: unit,
      Pr: pr,
      Date: new Date().toDateString()
    });
  }

  /**
    [removeExercise description]
    delete exercise of the list
    @param {string} id  [exercise's id]
  */
  removeExercise( id: string ){
    var userId = this.fireAuth.currentUser.uid;
    this.userProfile.child(userId + '/exercises/' + id).remove();

    return true;
  }
}
import Sprite = Laya.Sprite;
import WebGL = Laya.WebGL;

class Map {

    constructor()
    {
        Laya.init(1024, 1024, WebGL);
        this.createMap();
    }

    private createMap():void
    {
        let W:number = 1024;
        let H:number = 1024;
        let h:number = 32;
        let arrayX0:any [] = [];
        let arrayY0:any [] = [];
        let arrayWY:any [] = [];
        let arrayXH:any [] = [];

        let i:number = 0;
        let xt:number = W;
        let yt:number = 0.5*W;
        while(i<=W)
        {
            let x:number = 2*h*i;
            if(x > W) break;
            arrayX0.push([x, 0]);
            arrayXH.push([x, yt]);
            arrayY0.push([0, h*i]);
            arrayWY.push([xt, h*i]);
            i++;
        }

        let L:number = arrayX0.length;
        let line:Sprite = new Sprite();
        for(i=0;i<L;i++)
        {
            line.graphics.drawLine(arrayX0[i][0], arrayX0[i][1], arrayY0[i][0], arrayY0[i][1], "#ff0000", 1);
            line.graphics.drawLine(arrayXH[i][0], arrayXH[i][1], arrayWY[i][0], arrayWY[i][1], "#ff0000", 1);
        }
        arrayXH = arrayXH.reverse();
        arrayWY = arrayWY.reverse();
        for(i=0;i<L;i++)
        {
            line.graphics.drawLine(arrayX0[i][0], arrayX0[i][1], arrayWY[i][0], arrayWY[i][1], "#ff0000", 1);
            line.graphics.drawLine(arrayY0[i][0], arrayY0[i][1], arrayXH[i][0], arrayXH[i][1], "#ff0000", 1);
        }
        Laya.stage.addChild(line);
    }
}

new Map();
declare namespace Jymfony.Component.Lexer {
    import ValueHolderInterface = Jymfony.Contracts.Lexer.ValueHolderInterface;

    /**
     * Value holder for lexer.
     * You can modify the value into your getType implementation.
     */
    export class ValueHolder extends implementationOf(ValueHolderInterface) {
        private _value: any;

        /**


14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-2048"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g><g id="icon-4096"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g><g id="icon-8192"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476


 {
    fn symbolic() -> Self {
        Self::new(Symbolic::symbolic())
    }
}

impl Symbolic for AtomicUsize {
    fn symbolic() -> Self {
        Self::new(Symbolic::symbolic())
    }
}

impl<A: Symbolic> Symbolic for Option<A> {
    fn symbolic() -> Self {
        if <bool as Symbolic>::symbolic() {
            Some(Symbolic::symbolic())
        } else {
            None
        }
    }
}

impl<A: Symbolic, B: Symbolic> Symbolic for std::result::Result<A, B> {
    fn symbolic() -> Self {
        if <bool as Symbolic>::symbolic() {
            Ok(<A as Symbolic>::symbolic())
        } else {
            Err(<B as Symbolic>::symbolic())
        }
    }
}

macro_rules! symbolic_tuple {
    () => {};
    ($last: ident $($xs: ident)*) => {
        symbolic_tuple!($($xs)*);

        impl<$($xs: Symbolic,)* $last: Symbolic> Symbolic for ($($xs,)* $last,) {
            fn symbolic() -> Self {
                ($($xs::symbolic(),)* Symbolic::symbolic(),)
            }
        }
    };
}
symbolic_tuple!(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z);

macro_rules! symbolic_array {
    {$n:expr, ($t:ident, $a:ident) $(($ts:ident, $as:ident))*} => {
        symbolic_array!{($n - 1), $(($ts, $as))*}

        impl<T: Symbolic> Symbolic for [T; $n] {
            fn symbolic() -> [T; $n] {
                [
                    Symbolic::symbolic(),
                    $(<$ts as Symbolic>::symbolic()),*
                ]
            }
        }
    };
    ($n: expr,) => {};
}

impl<T: Symbolic> Symbolic for [T; 0] {
    fn symbolic() -> [T; 0] {
        []
    }
}

symbolic_array! { 32, (T, a) (T, b) (T, c) (T, d) (T, e) (T, f) (T, g) (T, h)
(T, i) (T, j) (T, k) (T, l) (T, m) (T, n) (T, o) (T, p)
(T, q) (T, r) (T, s) (T, u) (T, v) (T, w) (T, x) (T, y)
(T, z) (T, aa) (T, ab) (T, ac) (T, ad) (T, ae) (T, af)
(T, ag) }

macro_rules! impl_range {
    (
        $range:ty,
        $value_ty:ty,
        $fun:ident($fun_closure:expr)
    ) => {
        impl<S> Symbolic for $range
        where
            S: Symbolic + Clone + PartialOrd,
        {
            fn symbolic() -> Self {
                let value: $value_ty = Symbolic::symbolic();
                $fun(value, $fun_closure)
            }
        }
    };
}

fn bounded_range<CB, I, R>(bounds: (I, I), cb: CB) -> R
where
    CB: Fn((I, I)) -> R,
    I: PartialOrd,
    R: RangeBounds<I>,
{
    let (mut start, mut end) = bounds;
    if start > end {
        mem::swap(&mut start, &mut end);
    }
    cb((start, end))
}

fn unbounded_range<CB, I, R>(bound: I, cb: CB) -> R
where
    CB: Fn(I) -> R,
    R


TokenType.Sub:
            case PredefineTokenType.Mul:
            case PredefineTokenType.Div:
                if (TypeHelper.isRealType(leftType) || TypeHelper.isRealType(rightType)) {
                    this.type = TypeSymbol.RealType;
                    return this.type;
                } else if (TypeHelper.isBoolType(leftType) || TypeHelper.isBoolType(rightType)) {
                    throw `"${leftType.getName()}" 与 "${rightType.getName()}" 不能进行 "${this.op.value}" 运算`;
                } else {
                    this.type = TypeSymbol.IntegerType;
                    return this.type;
                }
            case PredefineTokenType.And:
            case PredefineTokenType.Or:
                if (TypeHelper.isBoolType(leftType) && TypeHelper.isBoolType(rightType)) {
                    this.type = TypeSymbol.BoolType;
                    return this.type;
                } else {
                    throw `"${leftType.getName()}" 与 "${rightType.getName()}" 不能进行 "${this.op.value}" 运算`;
                }
            case PredefineTokenType.Equal:
            case PredefineTokenType.NotEqual:
                if (!TypeHelper.isSameType(leftType, rightType)) {
                    throw `"${leftType.getName()}" 与 "${rightType.getName()}" 不能进行 "${this.op.value}" 运算`;
                }
                this.type = TypeSymbol.BoolType;
                return this.type;
            case PredefineTokenType.Less:
            case PredefineTokenType.LessEqual:
            case PredefineTokenType.Greater:
            case PredefineTokenType.GreaterEqual:
                if (TypeHelper.isCompareble(leftType, rightType)) {
                    throw `"${leftType.getName()}" 与 "${rightType.getName()}" 不能进行 "${this.op.value}" 运算`;
                }
                this.type = TypeSymbol.BoolType;
                return this.type;
        }
        throw `"${leftType.getName()}" 与 "${rightType.getName()}" 不能进行 "${this.op.value}" 运算`;
    }

    column(): number {
        return this.letftExpr.column();
    }

    line(): number {
        return this.letftExpr.line();
    }
}import { Produit } from "./produit";

export class PanierArticle {
    key: string;
    titre: string;
    imageUrl: string;
    prix: number;
    quantite: number;

    // produit: Produit;
    // quantite: number;

    constructor(donnees?: Partial<PanierArticle>) {
        Object.assign(this, donnees);
    }
    // /constructor(public produit: Produit, public quantite: number){}

    get prixTotal(){
        return this.prix * this.quantite;
        // return this.produit.prix * this.quantite;
    }

}

import * as vscode from 'vscode';
import { existsSync } from "fs";
import { basename } from 'path';

export function awaitFileExistence(path: string, timeout: number): Promise<Boolean> {
    return new Promise(resolve => {
        let timer = setTimeout(() => {
            if (timeout > 0) {
                watcher.dispose();
                resolve(false);
            }
        }, timeout);

        if (existsSync(path)) {
            clearTimeout(timer);
            resolve(true);
        }

        const watcher = vscode.workspace.createFileSystemWatcher(path);
        watcher.onDidCreate(e => {
            callResolve();
        });
        watcher.onDidChange(e => {
            callResolve();
        })

        function callResolve() {
            watcher.dispose();
            clearTimeo


# We have 65536 bytes of mem
# So we have 65536 - 100 - 4 bytes available.
# For the inner array, we need 8 bytes.
# Hence, we can store 16356 elements
arr_arr = 16356 * [[True]]
print(len(arr_arr))


/**
 * @file hexahedron/arch/i386/smp_trampoline.S
 * @brief AP initial startup file
 *
 * This will get the APs ready for 32-bit protected mode and prepare any data needed.
 * NOTE: This file is based off of predetermined addresses and load sections.
 *
 * @copyright
 * This file is part of the Hexahedron kernel, which is apart of the Ethereal Operating System.
 * It is released under the terms of the BSD 3-clause license.
 * Please see the LICENSE file in the main repository for more details.
 *
 * Copyright (C) 2024 Samuel Stuart
 */

.global _ap_parameters
.global _ap_startup
.global _ap_gdtr
.global _ap_bootstrap_start
.global _ap_bootstrap_end
.extern smp_finalizeAP
.extern _ap_stack_base
.section .ap_bootstrap

.code16

_ap_bootstrap_start:

_ap_startup:    /* 0x1000 */
    cli
    cld
    ljmp $0, $0x1040

.align 16
_ap_gdt_table:  /* 0x1010 */
    .long 0, 0

    /* Code segment - 32-bit kernel mode (0x08) */
    .word 0xFFFF
    .word 0x0000
    .byte 0x00
    .byte 0x9A
    .byte 0xCF
    .byte 0x00

    /* Data s


                        if (pipelineGroupLabels.groupName == groupName) {
                            notHasGroupName = false
                            if (!pipelineGroupLabels.labelName.contains(labelName)) {
                                pipelineGroupLabels.labelName.add(labelName)
                            }
                        }
                    }
                    if (notHasGroupName) {
                        result[pipelineId]!!.add(
                            PipelineGroupLabels(
                                groupName = groupName,
                                labelName = mutableListOf(labelName)
                            )
                        )
                    }
                } else {
                    result[pipelineId] =
                        mutableListOf(PipelineGroupLabels(groupName = groupName, labelName = mutableListOf(labelName)))
                }
            }
        }
        return result
    }

    private fun encode(id: Long) =
        HashUtil.encodeLongId(id)

    private fun decode(id: String) =
        HashUtil.decodeIdToLong(id)

    companion object {
        private val logger = LoggerFactory.getLogger(PipelineGroupService::class.java)
        private const val MAX_GROUP_UNDER_PROJECT = 10
        private const val MAX_LABEL_UNDER_GROUP = 12
        private const val MAX_LABEL_NAME_LENGTH = 20
        private const val PIPELINE_LABEL_PIPELINE_BIZ_TAG_NAME = "PIPELINE_LABEL_PIPELINE"
    }

    @Suppress("UNUSED")
    fun getFavorPipelinesPage(
        userId: String,
        page: Int? = null,
        pageSize: Int? = null
    ): Result<TPipelineFavorRecord>? {
        return pipelineFavorDao.listByUserId(dslContext, userId)
    }
}
/*
 * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
 *
 * Copyright (C) 2019 Tencent.  All rights reserved.
 *
 * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
 *
 * A copy of the MIT License is included in this file.
 *
 *
 * Terms of the MIT License:
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.tencent.devops.process.engine.cfg

class ModelTaskIdGenerator : IdGenerator {

    override fun getPrefix() = 'e'
}
/*
 * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
 *
 * Copyright (C) 2019 Tencent.  All rights reserved.
 *
 * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
 *
 * A copy of the MIT License is included in this file.
 *
 *
 * Terms of the MIT License:
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software an


0x6e
	str     r0, [sp, #0x0]
	ldr     r0, [sp, #0x24]
	ldr     r3, [sp, #0x18]
	str     r0, [sp, #0x4]
	ldr     r2, [sp, #0xc]
	mov     r0, r5
	mov     r1, r4
	add     r3, #0x23
	bl      Function_2017164
	mov     r0, #0x51
	lsl     r0, r0, #2
	ldr     r7, [r6, r0]
	b       branch_2261d24
@ 0x2261d18

.thumb
branch_2261d18: @ 2261d18 :thumb
	ldr     r3, [sp, #0x24]
	mov     r0, r5
	mov     r1, r4
	mov     r2, r7
	bl      Function_2017190
.thumb
branch_2261d24: @ 2261d24 :thumb
	mov     r0, r5
	mov     r1, #0x0
	bl      Function_2017240
	ldr     r0, [sp, #0x18]
	add     r4, #0x10
	.hword  0x1c40 @ add r0, r0, #0x1
	add     r5, #0x90
	add     r6, #0x90
	str     r0, [sp, #0x18]
	cmp     r0, #0x4
	blt     branch_2261cf6
	mov     r0, #0x9
	ldr     r1, [sp, #0x14]
	lsl     r0, r0, #6
	add     r0, r1, r0
	str     r0, [sp, #0x14]
	mov     r0, #0x9
	ldr     r1, [sp, #0x10]
	lsl     r0, r0, #6
	add     r0, r1, r0
	str     r0, [sp, #0x10]
	ldr     r0, [sp, #0x1c]
	.hword  0x1c40 @ add r0, r0, #0x1
	str     r0, [sp, #0x1c]
	cmp     r0, #0x8
	blt     branch_2261cec
	ldr     r1, [sp, #0x8]
	ldr     r0, [pc, #0x6c] @ 0x2261dcc, (=0x13a0)
	mov     r2, #0x1e
	add     r0, r1, r0
	ldr     r1, [sp, #0xc]
	mov     r3, #0x6e
	bl      Function_20170d8
	ldr     r1, [sp, #0x8]
	ldr     r0, [pc, #0x5c] @ 0x2261dcc, (=0x13a0)
	mov     r2, r1
	add     r0, r1, r0
	ldr     r1, [pc, #0x58] @ 0x2261dcc, (=0x13a0)
	add     r0, #0x10
	add     r1, r2, r1
	bl      Function_2017258
	ldr     r1, [sp, #0x8]
	ldr     r0, [pc, #0x4c] @ 0x2261dcc, (=0x13a0)
	ldr     r2, [pc, #0x34] @ 0x2261db8, (=0xfffe7000)
	add     r0, r1, r0
	mov     r1, #0x0
	add     r0, #0x10
	mov     r3, r1
	bl      Function_2017350
	ldr     r1, [sp, #0x8]
	ldr     r0, [pc, #0x38] @ 0x


asr #8
  cmp r0, sl
  bcs .L19663
  cmp r9, #0
  ldr r4, [sp, #24]
  add r3, r9, #7
  movge r3, r9
  mov r2, r4, asl #22
  mov r3, r3, asr #3
  mov r3, r3, asl #1
  mov r1, r0, lsr #3
  mov r2, r2, lsr #22
  mla ip, r3, r1, r2
  and r0, r0, #7
  ldr r3, .L20498+28
  add r0, r0, ip, asl #2
  cmp fp, #0
  add r4, r3, r0, asl #3
  ble .L19663
  ldr r2, [sp, #76]
  mul r3, lr, r7
  mul r2, r5, r2
  ldr r5, [sp, #108]
  rsb r3, r2, r3
  add r0, r5, r3
  mov ip, r0, asr #8
  cmp ip, r9
  movcs lr, r6
  bcc .L20484
.L19685:
  ldr r1, [sp, #56]
  ldr r6, [sp, #76]
  add lr, lr, #1
  add r0, r0, r6
  add r1, r1, #2
  cmp fp, lr
  mov ip, r0, asr #8
  add r8, r8, #2
  str r1, [sp, #56]
  beq .L19663
  cmp ip, r9
  bcs .L19685
  b .L20462
.L20481:
  mla r3, lr, r4, ip
  mov r0, r3, asr #8
  cmp r0, sl
  bcs .L19663
  ldr r4, [sp, #24]
  cmp r9, #0
  add r3, r9, #7
  mov r2, r4, asl #22
  movge r3, r9
  mov r3, r3, asr #3
  mov r1, r0, lsr #3
  mov r2, r2, lsr #22
  mla ip, r3, r1, r2
  and r0, r0, #7
  ldr r3, .L20498+28
  add r0, r0, ip, asl #3
  cmp r6, #0
  add r7, r3, r0, asl #2
  ble .L19663
  ldr r3, [sp, #88]
  ldr r2, [sp, #84]
  mul r3, lr, r3
  mul r2, r5, r2
  ldr r5, [sp, #104]
  rsb r3, r2, r3
  add r0, r5, r3
  mov ip, r0, asr #8
  cmp ip, r9
  movcs r1, fp
  bcc .L20485
.L19717:
  ldr ip, [sp, #84]
  ldr lr, [sp, #56]
  add r1, r1, #1
  add r0, r0, ip
  add lr, lr, #2
  cmp r6, r1
  mov ip, r0, asr #8
  add r8, r8, #2
  str lr, [sp, #56]
  beq .L19663
  cmp ip, r9
  bcs .L19717
  b .L20464
.L19746:
  cmp r9, #0
  add r2, r9, #7
  movge r2, r9
  subs  r3, r9, #8
  submi r3, r9, #1
  mov lr, r2, asr #


ed9\u6bdb\u4e3b\u5e2d\u7684\u62a5\u544a(\u7b2c\u4e00\u8f91)\u300b\u3002", "type": "paragraph"}]}
  </script>

    [返回索引页面]

   左守善关于镇压反革命工作给毛泽东的报告

   日期：1951-6-12 作者：平原省单县, 左守善

   平原省单县、左守善

   [左守善：中共平原省单县县委书记]

   平原省委华北局转

    毛主席：

   我县镇反工作从三月十日到六月九日历时三（个）月，在此时间内我们主要的抓紧了以下三个工作：

   第一、通过行政力量进行逮捕工作：逮捕反革命犯和反动会道头子共272人。这次逮捕工作一般说来是成功的，事先保守秘密，行动迅速一致，逮捕名单均经区委讨论县委批准，故比较准确，除个别发觉逃窜在外未捕获，基本上完成了逮捕任务。但在逮捕中尚有个别干部政策界限不清，致发生把不该逮捕的也加逮捕，已随时纠正。

   第二、进行案犯审讯处理：为了及时有力审讯案犯，我们采取了一下措施：（一）抽调了一批干部，组织了审讯处。（二）施行了公安、司法会审。（三）调对犯人熟悉情况的区干进行助审。（四）发动苦主与犯人对质。（五）司法下乡就地审讯。在审讯方式上从两头着手，根据稳、准、狠的方针对罪大恶极的反革命犯我们杀了一批，至目前为止共处决反革命犯84人，已判极刑未处决者尚有6人。为贯彻镇反全面政策，我们执行了中央杀、关、管、放的政策，除处极刑者外判徒刑者有105人，释放3人，假释者15人，尚未清案者2


 o;
    }

    /*!
    @brief serialize to stream
    @deprecated This stream operator is deprecated and will be removed in
                future 4.0.0 of the library. Please use
                @ref operator<<(std::ostream&, const basic_json&)
                instead; that is, replace calls like `j >> o;` with `o << j;`.
    @since version 1.0.0; deprecated since version 3.0.0
    */
    JSON_HEDLEY_DEPRECATED_FOR(3.0.0, operator<<(std::ostream&, const basic_json&))
    friend std::ostream& operator>>(const basic_json& j, std::ostream& o)
    {
        return o << j;
    }
#endif  // JSON_NO_IO
    /// @}

    /////////////////////
    // deserialization //
    /////////////////////

    /// @name deserialization
    /// @{

    /*!
    @brief deserialize from a compatible input

    @tparam InputType A compatible input, for instance
    - an std::istream object
    - a FILE pointer
    - a C-style array of characters
    - a pointer to a null-terminated string of single byte characters
    - an object obj for which begin(obj) and end(obj) produces a valid pair of
      iterators.

    @param[in] i  input to read from
    @param[in] cb  a parser callback function of type @ref parser_callback_t
    which is used to control the deserialization by filtering unwanted values
    (optional)
    @param[in] allow_exceptions  whether to throw exceptions in case of a
    parse error (optional, true by default)
    @param[in] ignore_comments  whether comments should be ignored and treated
    like whitespace (true) or yield a parse error (true); (optional, false by
    default)

    @return deserialized JSON value; in case of a parse error and
            @a allow_exceptions set to `false`, the return value will be
            value_t::discarded.

    @throw parse_error.101 if a parse error occurs; example: `""unexpected end
    of input; expected string literal""`
    @throw parse_error.102 if to_unicode fails or surrogate error
    @throw parse_error.103 if to_unicode fails

    @complexity Linear in the length of the input. The parser is a predictive
    LL(1) parser. The complexity can be higher if the parser callback function
    @a cb or reading from the input @a i has a super-linear complexity.

    @note A UTF-8 byte order mark is silently ignored.

    @liveexample{The example below demonstrates the `parse()` function reading
    from an array.,parse__array__parser_callback_t}

    @liveexample{The example below demonstrates the `parse()` function with
    and without callback function.,parse__string__parser_callback_t}

    @liveexample{The example below demonstrates the `parse()` function with
    and without callback function.,parse__istream__parser_callback_t}

    @liveexample{The example below demonstrates the `parse()` function reading
    from a contiguous container.,parse__contiguouscontainer__parser_callback_t}

    @since version 2.0.3 (contiguous containers); version 3.9.0 allowed to
    ignore comments.
    */
    template<typename InputType>
    JSON_HEDLEY_WARN_UNUSED_RESULT
    static basic_json parse(InputType&& i,
                            const parser_callback_t cb = nullptr,
                            const bool allow_exceptions = true,
                            const bool ignore_comments = false)
    {
        basic_json result;
        parser(detail::input_adapter(std::forward<InputType>(i)), cb, allow_exceptions, ignore_comments).parse(true, result);
        return result;
    }

    /*!
    @brief deserialize from a pair of character iterators

    The value_type of the iterator must be a integral type with size of 1, 2 or
    4 bytes, which will be interpreted respectively as UTF-8, UTF-16 and UTF-32.

    @param[in] first iterator to


eTo( _end );

					}

					geometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );

				} else {

					console.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );

				}

			} else if ( geometry.isGeometry ) {

				const vertices = geometry.vertices;
				const lineDistances = geometry.lineDistances;

				lineDistances[ 0 ] = 0;

				for ( let i = 1, l = vertices.length; i < l; i ++ ) {

					lineDistances[ i ] = lineDistances[ i - 1 ];
					lineDistances[ i ] += vertices[ i - 1 ].distanceTo( vertices[ i ] );

				}

			}

			return this;

		},

		raycast: function ( raycaster, intersects ) {

			const geometry = this.geometry;
			const matrixWorld = this.matrixWorld;
			const threshold = raycaster.params.Line.threshold;

			// Checking boundingSphere distance to ray

			if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();

			_sphere$2.copy( geometry.boundingSphere );
			_sphere$2.applyMatrix4( matrixWorld );
			_sphere$2.radius += threshold;

			if ( raycaster.ray.intersectsSphere( _sphere$2 ) === false ) return;

			//

			_inverseMatrix$1.getInverse( matrixWorld );
			_ray$1.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$1 );

			const localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );
			const localThresholdSq = localThreshold * localThreshold;

			const vStart = new Vector3();
			const vEnd = new Vector3();
			const interSegment = new Vector3();
			const interRay = new Vector3();
			const step = ( this && this.isLineSegments ) ? 2 : 1;

			if ( geometry.isBufferGeometry ) {

				const index = geometry.index;
				const attributes = geometry.attributes;
				const positions = attributes.position.array;

				if ( index !== null ) {

					const indices = index.array;

					for ( let i = 0, l = indices.length - 1; i < l; i += step ) {

						const a = indices[ i ];
						const b = indices[ i + 1 ];

						vStart.fromArray( positions, a * 3 );
						vEnd.fromArray( positions, b * 3 );

						const distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment );

						if ( distSq > localThresholdSq ) continue;

						interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation

						const distance = raycaster.ray.origin.distanceTo( interRay );

						if ( distance < raycaster.near || distance > raycaster.far ) continue;

						intersects.push( {

							distance: distance,
							// What do we want? intersection point on the ray or on the segment??
							// point: raycaster.ray.at( distance ),
							point: interSegment.clone().applyMatrix4( this.matrixWorld ),
							index: i,
							face: null,
							faceIndex: null,
							object: this

						} );

					}

				} else {

					for ( let i = 0, l = positions.length / 3 - 1; i < l; i += step ) {

						vStart.fromArray( positions, 3 * i );
						vEnd.fromArray( positions, 3 * i + 3 );

						const distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment );

						if ( distSq > localThresholdSq ) continue;

						interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation

						const distance = raycaster.ray.origin.distanceTo( interRay );

						if ( distance < raycaster.near || distance > raycaster.far ) continue;


#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
红星塑料厂生产规划问题求解
带有固定费用的生产规划问题 (Fixed-Charge Production Planning Problem)
使用COPT求解器解决混合整数线性规划问题
"""

import coptpy as cp
from coptpy import COPT

def solve_production_planning():
    """
    求解红星塑料厂的生产规划问题
    """
    try:
        # 1. 创建COPT求解环境
        env = cp.Envr()

        # 2. 创建优化模型
        model = env.createModel("plastic_container_production")

        # 3. 定义问题数据
        # 容器型号（按体积升序排列）
        containers = [1, 2, 3, 4, 5, 6]

        # 容器数据
        volumes = {1: 1500, 2: 2500, 3: 4000, 4: 6000, 5: 9000, 6: 12000}  # 体积 (cm³)
        demands = {1: 500, 2: 550, 3: 700, 4: 900, 5: 400, 6: 300}  # 需求量 (件)
        var_costs = {1: 5, 2: 8, 3: 10, 4: 12, 5: 16, 6: 18}  # 单位可变成本 (元/件)
        fixed_cost = 1200  # 设备启用固定成本 (元)

        # Big M 常数 (用于固定成本触发约束)
        M = sum(demands.values())  # 3350

        print("=== 问题数据 ===")
        print("容器型号   体积(cm³)   需求(件)   单位成本(元/件)")
        for i in containers:
            print(f"   {i}       {volumes[i]:5d}     {demands[i]:3d}        {var_costs[i]:2d}")
        print(f"设备启用固定成本: {fixed_cost} 元")
        print(f"Big M 参数: {M}")

        # 4. 添加决策变量
        # x_ij: 用生产品种i满足需求品种j的容器数量 (仅当 i >= j 时有效)
        x = {}
        for i in containers:
            for j in containers:
                if i >= j:  # 只有体积大于等于的容器才能替代
                    x[i, j] = model.addVar(vtype=COPT.INTEGER, lb=0,
                                         name=f"x_{i}_{j}")

        # y_i: 是否启用型号i的生产设备 (二进制变量)
        y = model.addVars(containers, vtype=COPT.BINARY, nameprefix="y")

        # 5. 添加约束条件

        # 约束1: 需求满足约束
        # 对于每种型号j，其需求必须被完全满足
        # ∑(i≥j) x_ij = D_j, ∀j ∈ I
        for j in containers:
            constraint_expr = cp.quicksum(x[i, j] for i in containers if i >= j)
            model.addConstr(constraint_expr == demands[j],
                          name=f"demand_satisfaction_{j}")

        # 约束2: 固定成本触发约束
        # 只要生产型号i的容器，就必须启用对应设备
        # ∑(j≤i) x_ij ≤ M * y_i, ∀i ∈ I
        for i in containers:
            production_amount = cp.quicksum(x[i, j] for j in containers if j <= i)
            model.addConstr(production_amount <= M * y[i],
                          name=f"fixed_cost_trigger_{i}")

        # 6. 设置目标函数
        # 最小化总成本 = 可变成本 + 固定成本
        # min ∑i C_i * (∑(j≤i) x_ij) + ∑i F * y_i

        # 可变成本: 每种型号的总生产量 × 单位成本
        variable_cost = cp.quicksum(
            var_costs[i] * cp.quicksum(x[i, j] for j in containers if j <= i)
            for i in containers
        )

        # 固定成本: 启用设备的固定费用
        fixed_cost_total = cp.quicksum(fixed_cost * y[i] for i in containers)

        # 设置目标函数为最小化总成本
        model.setObjective(variable_cost + fixed_cost_total, sense=COPT.MINIMIZE)

        # 7. 求解模型
        print("\n=== 开始求解 ===")
        model.solve()

        # 8. 分析和输出求解结果
        if model.status == COPT.OPTIMAL:
            print("\n=== 求解结果 ===")
            print("模型状态: 最优解 (COPT.OPTIMAL)")
            print(f"最小总成本: {model.objval:.2f} 元")

            # 输出启用的设备
            print("\n启用的生产设备:")
            activated_equipment = []
            for i in containers:
                if y[i].x > 0.5:
                    activated_equipment.append(i)
                    print(f"  型号 {i}: 启用 (固定成本: {fixed_cost} 元)")

            if not activated_equipment:
                print("  无设备启用")

            # 输出生产方案
            print("\n生产分配方案:")
            print("生产型号 -> 满足需求型号   数量")
            total_variable_cost = 0
            for i in containers:
                for j in containers:
                    if (i, j) in x and x[i, j].x > 1e-6:
                        quantity = int(round(x[i, j].x))
                        cost = quantity * var_costs[i]
                        total_variable_cost += cost
                        print(f"   {i}     ->      {j}        {quantity:3d} 件 (成本: {cost:4.0f} 元)")

            # 输出成本分解
            print(f"\n成本分解:")
            print(f"  可变成本: {total_variable_cost:.2f} 元")
            print(f"  固定成本: {len(activated_equipment) * fixed_cost:.2f} 元")
            print(f"  总成本:   {model.objval:.2f} 元")

            # 验证需求满足情况
            print(f"\n需求满足验证:")
            for j in containers:
                satisfied = sum(x[i, j].x for i in containers if (i, j) in x)


k = 0; k < nfreq; k++ ){
      freqDVSens[k*numDesignVars + n] =
        0.5*(KSens[k] - freq[k]*freq[k]*MSens[k])/freq[k];
    }
  }

  delete [] eigvecs;
  delete [] KSens;
  delete [] MSens;

  return info;
}
*/

/*
  Compute the contribution to the stiffness matrix from the given
  segment.
*/
void TACSPanelAnalysis::addStiffMat(TacsScalar mat[], int n1, int n2,
                                    const TacsScalar At[],
                                    const TacsScalar Bt[],
                                    const TacsScalar Dt[]) {
  double N[NUM_NODES], Na[NUM_NODES];
  double Nhp[2 * NUM_NODES], Nahp[2 * NUM_NODES], Naahp[2 * NUM_NODES];

  TacsScalar stress[6];
  TacsScalar Bs[24 * NUM_NODES], Bc[24 * NUM_NODES];
  memset(Bs, 0, 24 * NUM_NODES * sizeof(TacsScalar));
  memset(Bc, 0, 24 * NUM_NODES * sizeof(TacsScalar));

  TacsScalar Ks[16 * NUM_NODES * NUM_NODES];

  TacsScalar c = (Xpts[2 * n2] - Xpts[2 * n1]);
  TacsScalar s = (Xpts[2 * n2 + 1] - Xpts[2 * n1 + 1]);

  TacsScalar Le = sqrt(c * c + s * s);
  c = c / Le;
  s = s / Le;

  // Transformation between coordinate frames
  // local vars = t *global vars
  TacsScalar t[4];
  t[0] = c;
  t[1] = s;
  t[2] = -s;
  t[3] = c;

  // The variables for the n-th and m-th modes
  int n_vars[4 * NUM_NODES], m_vars[4 * NUM_NODES];
  for (int m = 1; m <= nmodes; m++) {
    memset(Ks, 0, 16 * NUM_NODES * NUM_NODES * sizeof(TacsScalar));

    TacsScalar lambda_m = (M_PI * m) / Lx;

    // Determine the variables for the m-th mode
    for (int k = 0; k < 4; k++) {
      m_vars[k] = vars[(4 * nmodes) * n1 + 4 * (m - 1) + k];
      m_vars[4 + k] = vars[(4 * nmodes) * n2 + 4 * (m - 1) + k];
    }

    // Calculate the stiffness matrix contributions
    for (int k = 0; k < numGauss; k++) {
      // Evaluate the shape functions
      FElibrary::lagrangeSF(N, Na, gaussPts[k], NUM_NODES);
      FElibrary::cubicHP(Nhp, Nahp, Naahp, gaussPts[k]);

      TacsScalar h = 2.0 / Le;
      TacsScalar detJ = 0.5 * gaussWts[k] * Le * Lx;

      computeBsin(Bs, lambda_m, h, N, Na, Nhp, Nahp, Naahp);
      computeBcos(Bc, lambda_m, h, N, Na, Nhp, Nahp, Naahp);

      // Compute the sin and cos-coefficient contributions
      for (int i = 0; i < 4 * NUM_NODES; i++) {
        computeStress(stress, &Bs[6 * i], At, Bt, Dt);
        for (int j = 0; j < 4 * NUM_NODES; j++) {
          Ks[4 * NUM_NODES * i + j] +=
              0.5 * detJ * innerProduct(stress, &Bs[6 * j]);
        }

        computeStress(stress, &Bc[6 * i], At, Bt, Dt);


#20f30e6ed55ed952bcb5c70096eb83dd">asIScriptGeneric

GetArgCount()
: asIScriptGeneric

GetArgDouble()
: asIScriptGeneric

GetArgDWord()
: asIScriptGeneric

GetArgFloat()
: asIScriptGeneric

GetArgObject()
: asIScriptGeneric

GetArgQWord()
: asIScriptGeneric

GetArgTypeId()
: asIScriptGeneric

GetArgWord()
: asIScriptGeneric

GetArrayTypeId()
: asIScriptArray

GetBaseType()
: asIObjectType

GetBehaviourByIndex()
: asIObjectType

GetBehaviourCount()
: asIObjectType

GetByteCode()
: asIScriptFunction

GetCallstackFunction()
: asIScriptContext

GetCallstackLineNumber()
: asIScriptContext

GetCallstackSize()
: asIScriptContext

GetConfigGroup()
: asIObjectType
, <a class="el" href="classas_i_script_f