implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package gwt.material.design.client.sanitizer.handler;

import gwt.material.design.client.sanitizer.Patterns;

public class OghamSanitizeHandler extends AbstractSanitizeHandler {

    public OghamSanitizeHandler() {
    }

    @Override
    public boolean sanitize(String value) {
        return matches(Patterns.OGHAM, value, "Value must not contain Ogham characters");
    }
}
/*
 * Copyright 2014 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package com.google.gwt.site.markdown.toc;

import com.google.gwt.site.markdown.fs.MDNode;
import com.google.gwt.site.markdown.fs.MDParent;

import java.util.Arrays;
import java.util.List;

public class TocFromMdCreator implements TocCreator {

  public String createTocForNode(MDParent root, MDNode node) {

    StringBuffer buffer = new StringBuffer();
    buffer.append("
\n");
    render(root, buffer, node);
    buffer.append("
\n");

    return buffer.toString();
  }

  private void render(MDNode node, StringBuffer buffer, MDNode tocNode) {

    MDNode tmpNode = tocNode;
    while (tmpNode.getParent() != null) {
      if (tmpNode.isExcludeFromToc())
        return;
      tmpNode = tmpNode.getParent();
    }

    tmpNode = node;
    while (tmpNode.getParent() != null) {
      if (tmpNode.isExcludeFromToc())
        return;
      tmpNode = tmpNode.getParent();
    }

    // Use 4 spaces to indent
's, so as we have room for indenting
's
    String margin = spaces(4 * node.getDepth());

    if (node.isFolder()) {
      MDParent mdParent = node.asFolder();

      if (node.getDepth() != 0) {
        buffer.append(margin).append("
");
        buffer.append("");
        buffer.append(node.getDisplayName());
        buffer.append("\n");
        buffer.append(margin).append("
\n");
      }

      List<MDNode> children = mdParent.getChildren();
      for (MDNode child : children) {
        render(child, buffer, tocNode);
      }

      if (node.getDepth() != 0) {
        buffer.append(margin).append("
\n");
        buffer.append(margin).append("
\n");
      }
    } else {
      StringBuffer relativeUrl = new StringBuffer();
      if (tocNode.getDepth() > 0) {
        for (int i = 1; i < tocNode.getDepth(); i++) {
          relativeUrl.append("../");
        }
      }

      StringBuffer absoluteUrl = new StringBuffer();
      absoluteUrl.append("/");
      absoluteUrl.append(node.getRelativePath());

      relativeUrl.append(node.getRelativePath());

      buffer.append(margin).append("
");
      // TODO escape HTML
      buffer.append("")
          .append(node.getDisplayName()).append("");
      buffer.append("
\n");
    }
  }

  private String spaces(int count) {
    final byte[] spaceBytes = new byte[count];
    Arrays.fill(spaceBytes, (byte) ' ');
    return new String(spaceBytes);
  }
}
package gwt.react.client.components.lifecycle;
/* The MIT License (MIT)

Copyrigh


import { DeleteTaskRB } from '../classes/deleteTaskRB';

export const testDay1: WorkDay = {
    tasks: [],
    requiredMinPerDay: 450,
    actualDay: '2020-11-11',
    sumPerDay: 450,
    extraMinPerDay: 0,
    endTimeOfLatestTask: null
};

export const testDay2: WorkDay = {
    tasks: [],
    requiredMinPerDay: 450,
    actualDay: '2020-11-12',
    sumPerDay: 480,
    extraMinPerDay: 30,
    endTimeOfLatestTask: null
};

export const testDays: WorkDay[] = [
    testDay1,
    testDay2
];

export const testMonth1: WorkMonth = {
    days: testDays,
    date: '2020-11',
    sumPerMonth: 930,
    requiredMinPerMonth: 900,
    extraMinPerMonth: 30
};

export const testMonths: WorkMonth[] = [testMonth1];

const day1: Day = new Day('other-month', 2030, 1, 30);
const day2: Day = new Day('simple-day', 2030, 2, 3);
const day3: Day = new Day('simple-day', 2030, 2, 4);
const day4: Day = new Day('workday', 2030, 2, 5);
const day5: Day = new Day('workday', 2030, 2, 6);
const day6: Day = new Day('workday', 2030, 2, 7);
const day7: Day = new Day('workday', 2030, 2, 8);

export const testWeek: Week = {
    days: [day1, day2, day3, day4, day5, day6, day7]
};

export const testTask1: Task = {
    taskId: '1234',
    startTime: '11:00',
    endTime: '12:00',
    comment: 'mamamama',
    minPerTask: 60
};

export const testTask2: Task = {
    taskId: '2345',
    startTime: '08:00',
    endTime: '09:00',
    comment: 'bababa',
    minPerTask: 60
};

export const testTasks: Task[] = [
    testTask1,
    testTask2
];

export const testWorkDayRB: WorkDayRB = {
    year: 2020,
    month: 12,
    day: 12,
    requiredMinPerDay: 420
};

export const testStartTaskRB: StartTaskRB = {
    year: 2020,
    month: 12,
    day: 14,
    taskId: '1234',
    comment: 'wawawa',
    startTime: '10:10'
};

export const testFinishTaskRB: FinishTaskRB = {
    year: 2020,
    month: 12,
    day: 14,
    taskId: '1234',
    startTime: '10:10',
    endTime: '11:00'
};

export const testModifyTaskRB: ModifyTaskRB = {
    year: 2020,
    month: 12,
    day: 14,
    taskId: '1234',
    startTime: '10:10',
    newTaskId: '2345',
    newStartTime: '09:00',
    newEndTime: '10:00',
    newComment: 'mamama'
};

export const testDeleteTaskRB: DeleteTaskRB = {
    year: 2020,
    month: 12,
    day: 14,
    taskId: '1234',
    startTime: '10:10',
};

import type { TrieNode2, TrieNode2Branch, TrieNode2EOW, TrieNode2Root } from './TrieNode2';
import { END_OF_WORD as EOW } from './TrieNode2';

export class Trie2 {
    constructor(readonly root: TrieNode2Root) {}
}

const END_OF_WORD: TrieNode2EOW = Object.freeze({ i: 0, s: EOW });

export class Trie2Builder {
    protected nodes: TrieNode2[] = [END_OF_WORD];
    protected root: TrieNode2Root = { s: '', c: [] };

    insert(word: string): Trie2Builder {
        const location = this.findInsertLocation(this.root, word);
        this.splitNode(location);
        return this;
    }

    protected findInsertLocation(root: TrieNode2Branch, word: string): InsertLoc


bol":
   case "function":
   case "undefined":
    return a == b;

   case "object":
    if (a === b) return true;
    if (a instanceof Map || a instanceof Set) {
      if (a.size != b.size) return false;
      const v = [ ...a ], w = [ ...b ];
      for (let i = 0; i < v.length; i++) if (v[i] != w[i]) return false;
      return true;
    }
    if (Array.isArray(a)) {
      for (let i = 0; i < a.length; i++) if (!isSameAny(a[i], b[i])) return false;
      return true;
    }
    {
      const x = Object.values(a), y = Object.values(b);
      if (x.length != y.length) return false;
      for (let i = 0; i < x.length; i++) if (!isSameAny(x[i], y[i])) return false;
      return true;
    }

   default:
    return false;
  }
}

var import_obsidian2 = require("obsidian");

if ("undefined" != typeof window) (window.__svelte || (window.__svelte = {
  v: new Set
})).v.add(PUBLIC_VERSION);

var import_obsidian = require("obsidian");

function add_css(target) {
  append_styles(target, "svelte-1qfikme", ".markdownBody.svelte-1qfikme{user-select:text;-webkit-user-select:text}");
}

function create_fragment(ctx) {
  let div;
  return {
    c() {
      div = element("div");
      attr(div, "class", "markdownBody svelte-1qfikme");
      set_style(div, "min-height", "1em");
    },
    m(target, anchor) {
      insert(target, div, anchor);
      ctx[5](div);
    },
    p: noop,
    i: noop,
    o: noop,
    d(detaching) {
      if (detaching) detach(div);
      ctx[5](null);
    }
  };
}

function instance($$self, $$props, $$invalidate) {
  let el, {file = {
    path: ""
  }} = $$props, {observer} = $$props, {plugin} = $$props, renderedContent = "";
  function onAppearing(_) {
    if (file.content && el && renderedContent != file.content) {
      import_obsidian.MarkdownRenderer.render(plugin.app, file.content, el, file.path, plugin);
      $$invalidate(4, renderedContent = file.content);
    }
  }
  onMount((() => {
    observer.observe(el);
    el.addEventListener("appearing", onAppearing);
  }));
  onDestroy((() => {
    observer.unobserve(el);
    el.removeEventListener("appearing", onAppearing);
  }));
  $$self.$$set = $$props2 => {
    if ("file" in $$props2) $$invalidate(1, file = $$props2.file);
    if ("observer" in $$props2) $$invalidate(2, observer = $$props2.observer);
    if ("plugin" in $$props2) $$invalidate(3, plugin = $$props2.plugin);
  };
  $$self.$$.update = () => {
    if (27 & $$self.$$.dirty) if (renderedContent && file && file.content && el && renderedContent != file.content) {
      $$invalidate(0, el.style.minHeight = `${el.clientHeight}px`, el);
      $$invalidate(0, el.innerHTML = "", el);
      import_obsidian.MarkdownRenderer.render(plugin.app, file.content, el, file.path, plugin);


DataSource, refresh int) (*sparkline.SparkLine, error) {
	valueColIndex := -1
	for i, header := range csvData.Header {
		if header == w.ValueCol {
			valueColIndex = i
			break
		}
	}
	if valueColIndex == -1 {
		return nil, fmt.Errorf("column '%s' not found for widget '%s'", w.ValueCol, w.Title)
	}

	sp, err := sparkline.New(sparkline.Color(cell.ColorGreen))
	if err != nil {
		return nil, err
	}

	go periodic(ctx, time.Duration(refresh)*time.Second, func() error {
		var values []int
		for _, record := range csvData.Records {
			val, err := strconv.Atoi(record[valueColIndex])
			if err != nil {
				continue
			}
			values = append(values, val)
		}
		return sp.Add(values)
	})
	return sp, nil
}

// createGauge creates and starts a new gauge widget.
func createGauge(ctx context.Context, w *loader.WidgetConfig, csvData *loader.DataDataSource, refresh int) (*gauge.Gauge, error) {
	valueColIndex := -1
	for i, header := range csvData.Header {
		if header == w.ValueCol {
			valueColIndex = i
			break
		}
	}
	if valueColIndex == -1 {
		return nil, fmt.Errorf("column '%s' not found for widget '%s'", w.ValueCol, w.Title)
	}

	g, err := gauge.New()
	if err != nil {
		return nil, err
	}

	go periodic(ctx, time.Duration(refresh)*time.Second, func() error {
		if len(csvData.Records) > 0 {
			val, err := strconv.Atoi(csvData.Records[len(csvData.Records)-1][valueColIndex])
			if err == nil {
				return g.Percent(val)
			}
		}
		return nil
	})
	return g, nil
}

// createLineChart creates and starts a new line chart widget.
func createLineChart(ctx context.Context, w *loader.WidgetConfig, csvData *loader.DataDataSource, refresh int) (*linechart.LineChart, error) {
	xColIndex, yColIndex := -1, -1
	for i, header := range csvData.Header {
		if header == w.XCol {
			xColIndex = i
		}
		if header == w.YCol {
			yColIndex = i
		}
	}
	if xColIndex == -1 || yColIndex == -1 {
		return nil, fmt.Errorf("column 'x_col' or 'y_col' not found for widget '%s'", w.Title)
	}

	lc, err := linechart.New(
		linechart.AxesCellOpts(cell.FgColor(cell.ColorRed)),
		linechart.YLabelCellOpts(cell.FgColor(cell.ColorGreen)),
		linechart.XLabelCellOpts(cell.FgColor(cell.ColorGreen)),
	)
	if err != nil {
		return nil, err
	}

	go periodic(ctx, time.Duration(refresh)*time.Second, func() error {
		var inputs []float64
		xLabels := make(map[int]string)
		for i, record := range csvData.Records {
			val, err := strconv.ParseFloat(record[yColIndex], 64)
			if err != nil {
				continue
			}
			inputs = append(inputs, val)
			xLabels[i] = record[xColIndex]
		}
		return lc.Series(w.Title, inputs,
			linechart.SeriesCellOpts(cell.FgColor(cell.ColorNumber(42))),
			linechart.SeriesXLabels(xLabels),
		)
	})
	return lc, nil
}

// createBarChart creates and starts a new bar chart widget.
func createBarChart(ctx context.Context, w *loader.WidgetConfig, csvData *loader.DataDataSource, refresh int) (*barchart.BarChart, error) {
	xColIndex, yColIndex := -1, -1


 fract4dc engine (sources under /model) to support multiple precision. It's just an experiment about one possible approach to tackle the arbitrary precision support which would also need to change the compiler, among many other parts of the program.
Execute:
```
examples/cpp/mp_mandelbrot.sh
```
Then you should see a new file under `examples/output`.

### Benchmark: Creating a simple mandelbrot using a custom formula with MPFR
In this example we use [google microbenchmark support library] to get some feedback about calculations performance with [mpfr library](https://www.mpfr.org/).
Execute:
```
examples/cpp/mp_benchmark.sh
```
Check the output, it should be something like:
```shell
Run on (4 X 2300 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x4)
  L1 Instruction 32 KiB (x4)
  L2 Unified 256 KiB (x4)
  L3 Unified 6144 KiB (x4)
Load Average: 1.02, 0.55, 0.38
***WARNING*** Library was built as DEBUG. Timings may be affected.
----------------------------------------------------------------------
Benchmark                            Time             CPU   Iterations
----------------------------------------------------------------------
BM_fractal/min_time:120.000       5414 ms         5396 ms           31
```# PyPi

Preparation:

* run unit tests: `tests/wekatests/all_tests.py`
* increment version in `setup.py`
* increment versions/copyright in `doc/source/conf.py`
* increment CPU versions in `doc/source/docker.rst` (will be built later)
* update API documentation

  * cd python/weka
  * sphinx-apidoc -f -o ../../doc/source .
  * make sure that all modules are included in `index.rst` (apart from `modules.rst`)

* update package suggestions by generating list of packages/classes within `weka-HEAD/trunk/packages`:

    ```bash
    find -name "*.java" | grep -v "\/dist\/" | grep "src\/main" | \
        sed s/".*internal\/"//g | sed s/".*external\/"//g | \
        sed s/"\.java"//g | sed s/"\/src\/main\/java\/"/","/g | \
        sed s/"\/"/.""/g | grep -v "..weka," | grep -v "..wekaexamples," | sort -f > \
        /home/fracpete/development/projects/fracpete/python-weka-wrapper3/python/weka/lib/pkg_suggestions.csv
    ```

* add new changelog section in `CHANGES.rst`
* commit/push all changes

Commands for releasing on pypi.org (requires twine >= 1.8.0):

```
find -name "*~" -delete
rm dist/*
python3 setup.py clean
python3 setup.py sdist
twine upload dist/*
```

Commands for updating github pages (requires sphinx in venv and Java 8!):

```
find -name "*~" -delete
cd doc
make -e SPHINXBUILD=../venv/bin/sphinx-build clean
make -e SPHINXBUILD=../venv/bin/sphinx-build html
cd build/html
cp -R * ../../../../python-weka-wrapper3.gh-pages/
cd ../../../../python-weka-wrapper3.gh-pages/
git pull origin gh-pages
git add -A
git commit -a -m "updated documentation"
git rebase gh-pages
git push origin gh-pages
cd ../python-weka-wrapper3/
git pull
```

# Github

Steps:

* start new release (version: `vX.Y.Z`)
* enter release notes, i.e., significant change


class CompositorWorkerGlobalScope extends WorkerGlobalScope {
  // To suppress missing implicit constructor warnings.
  factory CompositorWorkerGlobalScope._() { throw new UnsupportedError("Not supported"); }

  @DomName('CompositorWorkerGlobalScope.messageEvent')
  @DocsEditable()
  @Experimental() // untriaged
  static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');

  @DomName('CompositorWorkerGlobalScope.cancelAnimationFrame')
  @DocsEditable()
  @Experimental() // untriaged
  void cancelAnimationFrame(int handle) native;

  @DomName('CompositorWorkerGlobalScope.postMessage')
  @DocsEditable()
  @Experimental() // untriaged
  void postMessage(/*any*/ message, [List<MessagePort> transfer]) {
    if (transfer != null) {
      var message_1 = convertDartToNative_SerializedScriptValue(message);
      _postMessage_1(message_1, transfer);
      return;
    }
    var message_1 = convertDartToNative_SerializedScriptValue(message);
    _postMessage_2(message_1);
    return;
  }
  @JSName('postMessage')
  @DomName('CompositorWorkerGlobalScope.postMessage')
  @DocsEditable()
  @Experimental() // untriaged
  void _postMessage_1(message, List<MessagePort> transfer) native;
  @JSName('postMessage')
  @DomName('CompositorWorkerGlobalScope.postMessage')
  @DocsEditable()
  @Experimental() // untriaged
  void _postMessage_2(message) native;

  @DomName('CompositorWorkerGlobalScope.requestAnimationFrame')
  @DocsEditable()
  @Experimental() // untriaged
  int requestAnimationFrame(FrameRequestCallback callback) native;

  @DomName('CompositorWorkerGlobalScope.onmessage')
  @DocsEditable()
  @Experimental() // untriaged
  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@DomName('Console')
class Console {

  const Console._safe();

  static const Console _safeConsole = const Console._safe();

  bool get _isConsoleDefined => JS('bool', 'typeof console != "undefined"');

  @DomName('Console.memory')
  MemoryInfo get memory => _isConsoleDefined ?
      JS('MemoryInfo', 'console.memory') : null;

  @DomName('Console.assertCondition')
  void assertCondition(bool condition, Object arg) => _isConsoleDefined ?
      JS('void', 'console.assertCondition(#, #)', condition, arg) : null;

  @DomName('Console.clear')
  void clear(Object arg) => _isConsoleDefined ?
      JS('void', 'console.clear(#)', arg) : null;

  @DomName('Console.count')
  void count(Object arg) => _isConsoleDefined ?
      JS('void', 'console.count(#)', arg) : null;

  @DomName('Console.debug')
  void debug(Object arg) => _isConsoleDefined ?
      JS('void', 'console.debug(#)', arg) : null;

  @DomName('Console.dir')
  void dir(Object arg) => _isConsoleDefined ?
      JS('void', 'console.dir(#)', arg) : null;

  @DomName('Console.dirxml')
  void dirxml(Object arg) => _isConsoleDefined ?
      JS('void', 'console.dirxml(#)', arg) : null;

  @DomName('Console.error')
  void error(Object arg) => _isConsoleDefined ?
      JS('void', 'console.error(#)', arg) : null;

  @DomName('Console.group')
  void group(Object arg) => _isConsoleDef


3becf6a90c9b7fbf9327e7e3f6ecb61a35b64baee15bc7b72ca8ab7232a0a5811563e15f4cb4&scene=27#wechat_redirect)

文章简介:来源：人民网（ID：people_rmw）    　这几天，一段题为“老父挂号见医生儿子，相见只为让你歇会儿

文章作者:

[2016-01-31 07:56:37_【提醒】吓一跳！据说10年后中国的房子将是这样](http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=414483953&idx=2&sn=9e859b32a6015e5e0d3049bc95da756e&chksm=3bececb20c9b65a40abcc98aae39063e6bc9be06f5652421fd350eaccf02b4fa74e529c766cb&scene=27#wechat_redirect)

文章简介:一

文章作者:

[2016-01-31 07:56:37_【实用】脏纱窗不用拆，只要一张纸就能瞬间变干净！](http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=414483953&idx=3&sn=8754425a89576facfbabfcb2752c2e8f&chksm=3bececb20c9b65a437c96bbd8aeffe03b5822a8dd2152b99ebb9257f9b9f3dc7bac3a55ab2ad&scene=27#wechat_redirect)

文章简介:来源：央视财经（ID：cctvyscj）1、用牙膏去除白色家具表面的污迹　　家中的白色家具很容易弄脏，只用抹

文章作者:

[2016-01-31 07:56:37_【荐读】好的生活，不一定非要价格昂贵](http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=414483953&idx=4&sn=7f96d26ff2098db6cc2b541d9a4ce0e5&chksm=3bececb20c9b65a4e68983994e26e51a223266e0088f5bff467d5602ca73b2c791398964df17&scene=27#wechat_redirect)

文章简介:来源：十点读书（ID：duhaoshu）◆ ◆ ◆1　　松浦弥太郎，被称为是“全日本最会生活的男人”。　　在

文章作者:

[2016-01-31 07:56:37_明天起，一大波新规将影响你我的生活](http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=414483953&idx=1&sn=91a59cb246aa71b5a5e31e2c23d5d07b&chksm=3bececb20c9b65a4d401d501bf88accb93a9067e364de9a255afc016dd253073b2553043a652&sce


会叫研究生帮忙验收。但是小兵老师刀子嘴，豆腐心。小兵老师人还是非常好的，现在还记得他的76行sql语句吧。比较建议大家选赵亮老师的课程，因为长的帅，颜值即正义。

[@16-larry6799](<https://github.com/larry6799>)

#### 微机原理与系统设计

这个课还是比较难的，建议直接去旁听车向泉的课。

好像西电学堂上也有录播。

[@16-babydragon](<https://github.com/baolintian>)

这个课与大二下《计算机组织与体系结构》紧密联系，偏向于具体的实现，例如 8086 、8088。

要与上学期学的课程联想一下，这样有助于理解。

同时也要回忆起《数字电路与逻辑设计》中的各种电路的设计方法，这样有助于理解这学期的一些系统设计。

汇编语言也需要深刻的理解。

推荐一个电院老师讲的《微机原理与系统设计》：去 bilibili 搜索 "周佳社 微机原理与系统设计"。

[@16-wym6912](<https://github.com/wym6912>)

直接翘课去听车向泉老师的课，如果不放心可以借个账号看回放。回放不是在西电学堂，而是在教务系统，上完这节课后，不到一天就会有录播传上去，所以可以借个车向泉老师班上学生的账号登录教务系统看回放。（看来这个功能推广不够呀，知道的人不算多）另外配套实验做的东西都挺有趣的！

[@16-wkf](<https://github.com/kfwang-jpg>)

能选车老师的课程就选车老师的，选不了建议借选到的同学的账号看录播，尤其是车老师**最后一节课的总结内容**，会说考试内容形式，而不会像XX老师。

[@16-larry6799](<https://github.com/larry6799>)

### 方向必修

#### 计算机视觉（大数据方向必修）

苗院长讲了几课中途跑路了，新的老师没有能力把这门课讲好。。。

ppt直接照搬的康奈尔大学的课程，我当时做的大作业：[计算机视觉](https://github.com/baolintian/Computer-Vision)

建议自求多福。考试前把ppt里面的每个原理自己推一遍，实在不会推找大佬帮你推，找不到就死记硬背吧2333

考试点琐碎无比，所以要推理的一定自己手动推一遍，该死记硬背死记硬背。

反正上完这个课我是再也不想去碰计算计视觉了，直接当场劝退。


uint8_t *sl3=im2->scan_line(y);
    l=n->light;
    uint16_t *rem=n->remap;
    if (sx+n->x<x1) x1=sx+n->x;
    int x=0;
    for (; x<n->size; x++,sl++,rem++,l++)
    {
      r=*rem;

      off=(r+xoff);
      if (off>=iw) off-=iw;

      int32_t p1=*(paddr+sl2[off]);
      int32_t p2=*(paddr+sl3[off]);

      int r1=p1>>16,g1=(p1>>8)&0xff,b1=p1&0xff;
      int r2=p2>>16,g2=(p2>>8)&0xff,b2=p2&0xff;
      int r3=r1+(r2-r1)*fade256/256,
          g3=g1+(g2-g1)*fade256/256,
          b3=b1+(b2-b1)*fade256/256;

      uint8_t c=color_table->Lookup(r3>>3,g3>>3,b3>>3);

      *sl=*(white_light+((*l)/2+28+jrand()%4)*256+c);

    }
    if (sx+n->x+x>x2) x2=sx+n->x+x;

  }
  screen->AddDirty(ivec2(x1, sy), ivec2(x2 + 1, sy + mask_height));
}

void fade_in(image *im, int steps);
void fade_out(int steps);

class ex_char {
  public :
  uint8_t frame,char_num;
  int x,y;
  ex_char *next;
  ex_char (int X, int Y, int Frame, int Char_num, ex_char *Next) { x=X; y=Y; frame=Frame; char_num=Char_num; next=Next; }
} ;

void scale_put      (image *im, image *screen, int x, int y, short new_width, short new_height);
void scale_put_trans(image *im, image *screen, int x, int y, short new_width, short new_height);

void show_end2()
{
	//AR this crashes the game, probably because there are no images with those names in art/fore/endgame.spe
	//looking at the names my guess would be it was meant for the original plot with aliens/ants

  int i;
  int planet=cache.reg("art/fore/endgame.spe","planet",SPEC_IMAGE,1);
  int planet2=cache.reg("art/fore/endgame.spe","dead_planet",SPEC_IMAGE,1);
  int mask=cache.reg("art/fore/endgame.spe","mask",SPEC_IMAGE,1);
  int ship=cache.reg("art/fore/endgame.spe","ship",SPEC_IMAGE,1);

  int explo_snd = lnumber_value(LSymbol::FindOrCreate("P_EXPLODE_SND")->GetValue());
  int space_snd = lnumber_value(LSymbol::FindOrCreate("SPACE_SND")->GetValue());
  int zip_snd = lnumber_value(LSymbol::FindOrCreate("SHIP_ZIP_SND")->GetValue());

  mask_line *p=make_mask_lines(cache.img(mask),cache.img(planet)->Size().x);

  int explo_frames1[8],explo_frames2[7];

  for (i=0; i<8; i++)
  { char nm[100]; sprintf(nm,"small_wite%04d.pcx",i+1);
    explo_frames1[i]=cache.reg("art/exp1.spe",nm,SPEC_CHARACTER,1);
  }

  for (i=0; i<7; i+


 is negative.
            h *= 60;
            if (h < 0)
            {
                h += 360;
            }

            // Scale to the requirements of this
            // application. All values are between 0 and 255.
            return new HSV((int)(h / 360 * 255), (int)(s * 255), (int)(v * 255));
        }
    }
}


虑。当然后面的提示词也可以用权重来加强。上面的（（twintails））是一个例子。还有用指定倍数的方法来加强权重。（8，best quality:1.5）8K,最佳品质1.5倍。

负面提示词比较简单，就是把一些不想出现的东西加进去就可以了。

EasyNegative,Paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2),lowers, normal quality, ((monochrome)), ((grayscales)), skin spots, acnes, skin blemishes,age spot, glans, (6 more fingers on one hand),(deformity), multiple breasts,(mutated hands and fingers:1.5 ), (long body :1.3), (mutation, poorly drawn :1.2) ,bad anatomy, liquid body, liquid tongue, disfigured, malformed, mutated,anatomical nonsense, text font ui, error, malformed hands, long neck, blurred, lowers,lowres, bad anatomy, bad proportions, bad shadow, uncoordinated body, unnatural body,fused breasts, bad breasts, huge breasts, poorly drawn breasts, extra breasts, liquid breasts,heavy breasts, missing breasts, huge haunch, huge thighs, huge calf, bad hands, fused hand,missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs,fused ears, bad ears, poorly drawn ears, extra ears, liquid ears, heavy ears, missing ears,fused animal ears, bad animal ears, poorly drawn animal ears, extra animal ears, liquid animal ears,heavy animal ears, missing animal ears, text, ui, error, missing fingers, missing limb, fused fingers,one hand with more than 5 fingers, one hand with less than 5 fingers, one hand with more than 5 digit,one hand with less than 5 digit, extra digit, fewer digits, fused digit, missing digit, bad digit, liquid digit,colorful tongue, black tongue, cropped, watermark, username, blurry, JPEG artifacts,

## 镜头距离
我们把可以使用的视角prompt 放进X/Y/Z plot 比较一下，为了突出效果要提高权重，尽量不要加入面部描述eg beautiful face，否则多数都会变成半身照。以下prompts 会加上 1.5 权重。
- extreme close-up超近镜
- close-up近镜
- cowboy shot 七分身镜头
- medium


 Options](./doc/optimization_options.md).

### License
BSD 3-Clause License

### Cite Us
```
@article{fang2021patrickstar,
  title={PatrickStar: Parallel Training of Pre-trained Models via a Chunk-based Memory Management},
  author={Fang, Jiarui and Yu, Yang and Zhu, Zilin and Li, Shenggui and You, Yang and Zhou, Jie},
  journal={arXiv preprint arXiv:2108.05818},
  year={2021}
}
@article{fang2022parallel,
  title={Parallel Training of Pre-Trained Models via Chunk-Based Dynamic Memory Management},
  author={Fang, Jiarui and Zhu, Zilin and Li, Shenggui and Su, Hui and Yu, Yang and Zhou, Jie and You, Yang},
  journal={IEEE Transactions on Parallel and Distributed Systems},
  volume={34},
  number={1},
  pages={304--315},
  year={2022},
  publisher={IEEE}
}
```

### Contact Us
{jiaruifang, zilinzhu, josephyu}@tencent.com

Powered by WeChat AI Team, Tencent NLP Oteam.
For your convenience, a copy of  `./mcts_main --help` output is provided to
you below

Date is January 2019, so it may be outdated if newer versions are released

`./mcts_main --help`

Outputs the below result :

```
mcts_main: Warning: SetUsageMessage() never called

  Flags from external/com_github_gflags_gflags/src/gflags.cc:
    -flagfile (load flags from file) type: string default: ""
    -fromenv (set flags from the environment [use 'export FLAGS_flag1=value'])
      type: string default: ""
    -tryfromenv (set flags from the environment if present) type: string
      default: ""
    -undefok (comma-separated list of flag names that it is okay to specify on
      the command line even if the program does not define a flag with that
      name.  IMPORTANT: flags in this list that have arguments MUST use the
      flag=value format) type: string default: ""

  Flags from external/com_github_gflags_gflags/src/gflags_completions.cc:
    -tab_completion_columns (Number of columns to use in output for tab
      completion) type: int32 default: 80
    -tab_completion_word (If non-empty, HandleCommandLineCompletions() will
      hijack the process and attempt to do bash-style command line flag
      completion on this value.) type: string default: ""

  Flags from external/com_github_gflags_gflags/src/gflags_reporting.cc:
    -help (show help on all flags [tip: all flags can have two dashes])
      type: bool default: false currently: true
    -helpfull (show help on all flags -- same as -help) type: bool
      default: false
    -helpmatch (show help on modules whose name contains the specified substr)
      type: string default: ""
    -helpon (show help on the modules named by this flag value) type: string
      default: ""
    -helppackage (show help on all modules in the main package) type: bool
      default: false
    -helpshort (show help on only the main module for this program) type: bool
      default: false
    -helpxml (produce an xml version of help) type: bool default: false
    -version (show version and build info and exit) type: bool default: false

  Flags from external/com_github_google_glog/src/logging.cc:
    -alsologtoemail (log messages go to these email addresses in addition to
      logfiles) type: string default: ""
    -alsologtostderr (log messages go to stderr in addition to logfiles)
      type: bool default: false
    -colorlogtostderr (color messages logged to stderr (if supported by
      terminal)) type: bool default: false
    -drop_log_memory (Drop in-memory buffers of log contents. Logs can grow
      very quickly and th


  VC  0.5
#> 4  5.8   VC  0.5

# Box plots with jittered points
# :::::::::::::::::::::::::::::::::::::::::::::::::::
# Change outline colors by groups: dose
# Use custom color palette
# Add jitter points and change the shape by groups
 p <- ggboxplot(df, x = "dose", y = "len",
                color = "dose", palette =c("#00AFBB", "#E7B800", "#FC4E07"),
                add = "jitter", shape = "dose")
 p
```

![](tools/README-ggpubr-box-plot-dot-plots-strip-charts-1.png)<!-- -->

``` r

 # Add p-values comparing groups
 # Specify the comparisons you want
my_comparisons <- list( c("0.5", "1"), c("1", "2"), c("0.5", "2") )
p + stat_compare_means(comparisons = my_comparisons)+ # Add pairwise comparisons p-value
  stat_compare_means(label.y = 50)                   # Add global p-value
```

![](tools/README-ggpubr-box-plot-dot-plots-strip-charts-2.png)<!-- -->

``` r

# Violin plots with box plots inside
# :::::::::::::::::::::::::::::::::::::::::::::::::::
# Change fill color by groups: dose
# add boxplot with white fill color
ggviolin(df, x = "dose", y = "len", fill = "dose",
         palette = c("#00AFBB", "#E7B800", "#FC4E07"),
         add = "boxplot", add.params = list(fill = "white"))+
  stat_compare_means(comparisons = my_comparisons, label = "p.signif")+ # Add significance levels
  stat_compare_means(label.y = 50)                                      # Add global the p-value
```

![](tools/README-ggpubr-box-plot-dot-plots-strip-charts-3.png)<!-- -->

## Bar plots

### Demo data set

Load and prepare data:

``` r
# Load data
data("mtcars")
dfm <- mtcars
# Convert the cyl variable to a factor
dfm$cyl <- as.factor(dfm$cyl)
# Add the name colums
dfm$name <- rownames(dfm)
# Inspect the data
head(dfm[, c("name", "wt", "mpg", "cyl")])
#>                                name    wt  mpg cyl
#> Mazda RX4                 Mazda RX4 2.620 21.0   6
#> Mazda RX4 Wag         Mazda RX4 Wag 2.875 21.0   6
#> Datsun 710               Datsun 710 2.320 22.8   4
#> Hornet 4 Drive       Hornet 4 Drive 3.215 21.4   6
#> Hornet Sportabout Hornet Sportabout 3.440 18.7   8
#> Valiant                     Valiant 3.460 18.1   6
```

### Ordered bar plots

Change the fill color by the grouping variable “cyl”. Sorting will be
done globally, but not by groups.

``` r
ggbarplot(dfm, x = "name", y = "mpg",
          fill = "cyl",               # change fill color by cyl
          color = "white",            # Set bar border colors to white
          palette = "jco",            # jco journal color palett. see ?ggpar
          sort.val = "desc",          # Sort the value in dscending order
          sort.by.groups = FALSE,     # Don't sort inside each group
          x.text.angle = 90           # Rotate vertically x axis texts
          )
```

![](tools/README-ordered-bar-plots-1.png)<!-- -->

Sort bars inside each group. Use the argument **sort.by.groups = TRUE**.

``` r
ggbarplot(dfm, x = "name", y = "mpg


      debug!(logger; crypto.description => "start",);
        let result = server_handshake::perform_tls_server_handshake_temp_with_optional_client_auth(
            &self.csp,
            self.node_id,
            &self.registry_client,
            tcp_stream,
            allowed_authenticating_clients,
            registry_version,
        )
        .await;
        debug!(logger;
            crypto.description => "end",
            crypto.is_ok => result.is_ok(),
            crypto.error => log_err(result.as_ref().err()),
        );
        result
    }

    async fn perform_tls_client_handshake(
        &self,
        tcp_stream: TcpStream,
        server: NodeId,
        registry_version: RegistryVersion,
    ) -> Result<TlsStream, TlsClientHandshakeError> {
        let logger = new_logger!(&self.logger;
            crypto.trait_name => "TlsHandshake",
            crypto.method_name => "perform_tls_client_handshake",
            crypto.registry_version => registry_version.get(),
            crypto.tls_server => format!("{}", server),
        );
        debug!(logger; crypto.description => "start",);
        let result = client_handshake::perform_tls_client_handshake(
            &self.csp,
            self.node_id,
            &self.registry_client,
            tcp_stream,
            server,
            registry_version,
        )
        .await;
        debug!(logger;
            crypto.description => "end",
            crypto.is_ok => result.is_ok(),
            crypto.error => log_err(result.as_ref().err()),
        );
        result
    }
}

fn node_id_from_cert_subject_common_name(
    cert: &X509,
) -> Result<NodeId, MalformedPeerCertificateError> {
    let common_name_entry = ensure_exactly_one_subject_common_name_entry(cert)?;
    let common_name = common_name_entry_as_string(common_name_entry)?;
    let principal_id = parse_principal_id(common_name)?;
    Ok(NodeId::from(principal_id))
}

fn ensure_exactly_one_subject_common_name_entry(
    cert: &X509,
) -> Result<&X509NameEntryRef, MalformedPeerCertificateError> {
    if common_name_entries(cert).count() > 1 {
        return Err(MalformedPeerCertificateError::new(
            "Too many X509NameEntryRefs",
        ));
    }
    common_name_entries(cert)
        .next()
        .ok_or_else(|| MalformedPeerCertificateError::new("Missing X509NameEntryRef"))
}

fn common_name_entry_as_string(
    common_name_entry: &X509NameEntryRef,
) -> Result<OpensslString, MalformedPeerCertificateError> {
    common_name_entry.data().as_utf8().map_err(|e| {
        MalformedPeerCertificateError::new(&format!("ASN1 to UTF-8 conversion error: {}", e))
    })
}

fn parse_principal_id(
    common_name: OpensslString,
) -> Result<PrincipalId, MalformedPeerCertificateError> {
    PrincipalId::from_str(common_name.as_ref()).map_err(|e| {
        MalformedPeerCertificateError::new(&format!("Principal ID parse error: {}", e))
    })
}

fn common_name_entries(cert: &X509) -> X509NameEntries {
    cert.subject_name().entries_by_nid(Nid::COMMONNAME)
}

fn ensure_certificates_equal(
    peer_cert_from_handshake: &X509,
    trusted_cert_from_registry: X509PublicKeyCert,
) -> Result<(), PeerNotAllowedError> {
    let client_cert_from_handshake_der = peer_cert_from


     style="方块风格…",

            ctrl="控制设置…",
            key="键位设置…",
            touch="触屏设置…",
            showVK="显示虚拟按键",
            reTime="开局等待时间:",
            RS="旋转系统",
            menuPos="菜单按钮位置",
            sysCursor="使用系统光标",
            autoPause="失去焦点自动暂停",
            autoSave="破纪录自动保存",
            simpMode="简洁模式",
        },
        setting_video={
            title="画面设置",
            sound="←声音",
            game="游戏→",

            block="方块可见",
            smooth="平滑下落",
            upEdge="3D方块",
            bagLine="包分界线",

            ghostType="阴影样式",
            ghost="阴影不透明度:",
            center="旋转中心不透明度:",
            grid="网格不透明度:",
            lineNum="行号透明度:",

            lockFX="锁定特效:",
            dropFX="下落特效:",
            moveFX="移动特效:",
            clearFX="消除特效:",
            splashFX="溅射特效:",
            shakeFX="晃动特效:",
            atkFX="攻击特效:",

            frame="绘制帧率(%):",

            text="消行文本",
            score="分数动画",
            bufferWarn="缓冲预警",
            showSpike="爆发累计",
            nextPos="生成预览",
            highCam="超屏视野",
            warn="死亡预警",

            clickFX="点按特效",
            power="电量和时间",
            clean="绘制优化",
            fullscreen="全屏",
            portrait="竖屏",
            msaa="抗锯齿等级",

            bg_on="普通背景",
            bg_off="关闭背景",
            bg_custom="应用自定义背景",
            bg_custom_base64="从剪切板导入图片\n(Base64编码的PNG/JPG)",
            defaultBG="默认背景",
            resetDbg="改回默认",
            lockBG="锁定背景",
            noTheme="关闭节日主题",

            blockSatur="方块饱和度",
            fieldSatur="场地饱和度",
        },
        setting_sound={
            title="声音设置",
            game="←游戏",
            graphic="画面→",

            mainVol="总音量:",
            bgm="音乐:",
            sfx="音效:",
            stereo="立体声:",
            spawn="方块生成:",
            warn="危险警告:",
            vib="振动强度:",
            voc="语音:",

            autoMute="失去焦点自动静音",
            fine="非极简操作时播放提示音",
            sfxPack="音效包",
            vocPack="语音包",
            apply="应用",
        },
        setting_control={
            title="控制设置",
            preview="预览",

            das="DAS:",arr="ARR:",
            dascut="DAS打断:",
            irscut="IRS打断",
            dropcut="误硬降打断:",
            sddas="软降DAS:",sdarr="软降ARR:",
            ihs="提前Hold",
            irs="提前旋转",
            ims="提前移动",
            reset="重置",


--------------
	-- FUNCTIONS (FRAME)
	--------------------------------

	--------------------------------
	-- FUNCTIONS (MAIN)
	--------------------------------

	--------------------------------
	-- FUNCTIONS (ANIMATION)
	--------------------------------

	--------------------------------
	-- EVENTS
	--------------------------------

	do
		CallbackRegistry:Add("EVENT_CINEMATIC_START", function()
			Frame:Hide()
		end)

		CallbackRegistry:Add("EVENT_CINEMATIC_STOP", function()
			Frame:Show()
		end)
	end

	--------------------------------
	-- SETUP
	--------------------------------
end


经完成初始化
        pCurrentMap->SetIniertialBA2();
        pCurrentMap->SetIniertialBA1();
        pCurrentMap->SetImuInitialized();

    }

    //cout << "MergeMap init ID: " << pMergeMap->GetInitKFid() << "       CurrMap init ID: " << pCurrentMap->GetInitKFid() << endl;

    // Load KFs and MPs from merge map
    //cout << "updating current map" << endl;
    // Step 5 地图以旧换新。把融合帧所在地图里的关键帧和地图点从原地图里删掉，变更为当前关键帧所在地图。
    {
        // Get Merge Map Mutex (This section stops tracking!!)
        unique_lock<mutex> currentLock(pCurrentMap->mMutexMapUpdate); // We update the current map with the Merge information
        unique_lock<mutex> mergeLock(pMergeMap->mMutexMapUpdate); // We remove the Kfs and MPs in the merged area from the old map

        // 融合帧所在地图的所有关键帧和地图点
        vector<KeyFrame*> vpMergeMapKFs = pMergeMap->GetAllKeyFrames();
        vector<MapPoint*> vpMergeMapMPs = pMergeMap->GetAllMapPoints();

        // 遍历每个融合帧所在地图的关键帧
        for(KeyFrame* pKFi : vpMergeMapKFs)
        {
            if(!pKFi || pKFi->isBad() || pKFi->GetMap() != pMergeMap)
            {
                continue;
            }

            // Make sure connections are updated
            // 把该关键帧从融合帧所在地图删掉,加入到当前的地图中
            pKFi->UpdateMap(pCurrentMap);
            pCurrentMap->AddKeyFrame(pKFi);
            pMergeMap->EraseKeyFrame(pKFi);
        }

        // 遍历每个融合帧所在地图的地图点
        for(MapPoint* pMPi : vpMergeMapMPs)
        {
            if(!pMPi || pMPi->isBad() || pMPi->GetMap() != pMergeMap)
                continue;

            // 把地图点添加到当前帧所在地图,从融合帧所在地图删掉
            pMPi->UpdateMap(pCurrentMap);
            pCurrentMap->AddMapPoint(pMPi);
            pMergeMap->EraseMapPoint(pMPi);
        }
        // ? BUG! pMergeMap没有设置为BAD
        // ? 应该加入如下代码吧？
        // ? mpAtlas->SetMapBad(pMergeMap);

        // Save non corrected poses (already merged maps)
        // 存下所有关键帧在融合矫正之前的位姿
        vector<KeyFrame*> vpKFs = pCurrentMap->GetAllKeyFrames();
        for(KeyFrame* pKFi : vpKFs)
        {
            Sophus::SE3d Tiw = (pKFi->GetPose()).cast<double>();
            g2o::Sim3 g2oSiw(Tiw.unit_quaternion(),Tiw.translation(),1.0);
            NonCorrectedSim3[pKFi]=g2oSiw;
        }
    }

    //cout << "MergeMap init ID: " << pMergeMap->GetInitKFid() << "       CurrMap init ID: "


 (Z() - SPRITE_SPACE > planeh) break;
			lasth = planeh;
			DVector2 newpos = Pos() + sec->GetPortalDisplacement(sector_t::floor);
			sec = sec->Level->PointInSector(newpos);
			touching_sectorportallist = P_AddSecnode(sec, this, touching_sectorportallist, sec->sectorportal_thinglist);
		}
	}
}

void AActor::ClearRenderSectorList()
{
	P_DelSeclist(touching_sectorportallist, &sector_t::sectorportal_thinglist);
	touching_sectorportallist = nullptr;
}

void AActor::ClearRenderLineList()
{
	P_DelSeclist(touching_lineportallist, &FLinePortal::lineportal_thinglist);
	touching_lineportallist = nullptr;
}

//===========================================================================
//
// FBlockNode - allows to link actors into multiple blocks in the blockmap
//
//===========================================================================

FBlockNode *FBlockNode::FreeBlocks = nullptr;

FBlockNode *FBlockNode::Create(AActor *who, int x, int y, int group)
{
	FBlockNode *block;

	if (FreeBlocks != nullptr)
	{
		block = FreeBlocks;
		FreeBlocks = block->NextBlock;
	}
	else
	{
		block = (FBlockNode *)secnodearena.Alloc(sizeof(FBlockNode));
	}
	block->BlockIndex = x + y * who->Level->blockmap.bmapwidth;
	block->Me = who;
	block->NextActor = nullptr;
	block->PrevActor = nullptr;
	block->PrevBlock = nullptr;
	block->NextBlock = nullptr;
	return block;
}

void FBlockNode::Release()
{
	NextBlock = FreeBlocks;
	FreeBlocks = this;
}
/*
**
**
**---------------------------------------------------------------------------
** Copyright 2011 FDARI
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
**    notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
**    notice, this list of conditions and the following disclaimer in the
**    documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
**    derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
*/

#include "actorptrselect.h"
#include "actor.h"
#include "d_player.h"
#include "p_local.h"
#include "g_levellocals.h"

//==========================================================================
//
// Standard pointer acquisition functions
//
// Possible effective results at run-time
//   assigntov


/*
 * DBText module core functions
 *
 * Copyright (C) 2001-2003 FhG Fokus
 *
 * This file is part of Kamailio, a free SIP server.
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * Kamailio 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
 *
 * Kamailio is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#ifndef _DBTEXT_H_
#define _DBTEXT_H_

#include "../../lib/srdb1/db_con.h"
#include "../../lib/srdb1/db_res.h"
#include "../../lib/srdb1/db_key.h"
#include "../../lib/srdb1/db_op.h"
#include "../../lib/srdb1/db_val.h"

/*
 * Initialize database connection
 */
db1_con_t *dbt_init(const str *_sqlurl);

/*
 * Close a database connection
 */
void dbt_close(db1_con_t *_h);

/*
 * Free all memory allocated by get_result
 */
int dbt_free_result(db1_con_t *_h, db1_res_t *_r);

/*
 * Do a query
 */
int dbt_query(db1_con_t *_h, db_key_t *_k, db_op_t *_op, db_val_t *_v,
		db_key_t *_c, int _n, int _nc, db_key_t _o, db1_res_t **_r);

/*
 * fetch result
 */
int dbt_fetch_result(db1_con_t *_h, db1_res_t **_r, const int nrows);

/*
 * Raw SQL query
 */
int dbt_raw_query(db1_con_t *_h, str *_s, db1_res_t **_r);

/*
 * Insert a row into table
 */
int dbt_insert(db1_con_t *_h, db_key_t *_k, db_val_t *_v, int _n);

/*
 * Delete a row from table
 */
int dbt_delete(db1_con_t *_h, db_key_t *_k, db_op_t *_o, db_val_t *_v, int _n);

/*
 * Update a row in table
 */
int dbt_update(db1_con_t *_h, db_key_t *_k, db_op_t *_o, db_val_t *_v,
		db_key_t *_uk, db_val_t *_uv, int _n, int _un);

/*
 * replace a row in table
 */
int dbt_replace(
		db1_con_t *_h, db_key_t *_k, db_val_t *_v, int _n, int _nk, int _m);

/*
 * Affected rows
 */
int dbt_affected_rows(db1_con_t *_h);

#endif


or the trace
     * @param direction   A Vector pointing in the direction for the trace
     * @param yOffset     The trace begins vertically offset from the start vector
     * by this value
     * @param smooth      A boolean indicating whether the cast should be smooth.
     * Smooth casts will only include one block when intersecting multiple axis lines.
     * @param maxDistance This is the maximum distance in blocks for the
     * trace. Setting this value above 140 may lead to problems with
     * unloaded chunks. A value of 0 indicates no limit
     */
    init {
        var start: Vector = start
        start = start.add(0.0, yOffset, 0.0)

        end = if (maxDistance != 0.0) start.add(direction.normalize().mul(maxDistance))
        else null

        if (direction.isZero) this.foundEnd = true

        this.smooth = smooth

        val ray: Vector = direction.normalize()

        //which box of the map we're in
        mapX = start.blockX
        mapY = start.blockY
        mapZ = start.blockZ

        signums[0] = sign(direction.x).toInt().toShort()
        signums[1] = sign(direction.y).toInt().toShort()
        signums[2] = sign(direction.z).toInt().toShort()

        deltaDistX = if ((ray.x == 0.0)) 1e30 else abs(1 / ray.x)
        deltaDistY = if ((ray.y == 0.0)) 1e30 else abs(1 / ray.y) // Find grid intersections for x, y, z
        deltaDistZ =
            if ((ray.z == 0.0)) 1e30 else abs(1 / ray.z) // This works by calculating and storing the distance to the next grid intersection on the x, y and z axis

        //calculate step and initial sideDist
        sideDistX = if (ray.x < 0) (start.x - mapX) * deltaDistX
        else if (ray.x > 0) (mapX + signums[0] - start.x) * deltaDistX
        else Double.MAX_VALUE

        sideDistY = if (ray.y < 0) (start.y - mapY) * deltaDistY
        else if (ray.y > 0) (mapY + signums[1] - start.y) * deltaDistY
        else Double.MAX_VALUE

        sideDistZ = if (ray.z < 0) (start.z - mapZ) * deltaDistZ
        else if (ray.z > 0) (mapZ + signums[2] - start.z) * deltaDistZ
        else Double.MAX_VALUE
    }

    /**
     * Constructs the BlockIterator.
     *
     *
     * This considers all blocks as 1x1x1 in size.
     *
     * @param start       A Vector giving the initial position for the trace
     * @param direction   A Vector pointing in the direction for the trace
     * @param yOffset     The trace begins vertically offset from the start vector
     * by this value
     * @param maxDistance This is the maximum distance in blocks for the
     * trace. Setting this value above 140 may lead to problems with
     * unloaded chunks. A value of 0 indicates no limit
     */
    constructor(start: Vector, direction: Vector, yOffset: Double, maxDistance: Double) : this(
        start,
        direction,
        yOffset,
        maxDistance,
        false
    )

    /**
     * Returns true if the iteration has more elements
     */
    override fun hasNext(): Boolean {
        return !foundEnd
    }

    override fun remove() {
        throw UnsupportedOperationException("[BlockIterator] doesn't support block removal")
    }

    /**
     * Returns the next BlockPosition in the trace
     *
     * @return the next BlockPosition in the trace
     */
    override fun next(): Point<*> {
        if (foundEnd) throw NoSuchElementException()
        if (!extraPoints.isEmpty()) {
            val res = extraPoints.removeFirst()
            if (end != null && res.sameBlock(end!!)) foundEnd = true
            return res


 Vec::new();
    let mut rest = &mut data[..];
    while rest.len() > 0 {
        let chunk_len = 1 + rng(&mut state) % 512;
        let chunk_len = cmp::min(rest.len(), chunk_len as usize);
        let (fst, tail) = {rest}.split_at_mut(chunk_len);
        fst.sort();
        chunks.push(fst.iter().cloned());
        rest = tail;
    }

    // println!("Chunk lengths: {}", chunks.iter().format_with(", ", |elt, f| f(&elt.len())));

    b.iter(|| {
        chunks.iter().cloned().kmerge().count()
    })
}

fn fast_integer_sum<I>(iter: I) -> I::Item
    where I: IntoIterator,
          I::Item: Default + Add<Output=I::Item>
{
    iter.into_iter().fold(<_>::default(), |x, y| x + y)
}

#[bench]
fn step_vec_2(b: &mut test::Bencher) {
    let v = vec![0; 1024];
    b.iter(|| {
        fast_integer_sum(cloned(v.iter().step(2)))
    });
}

#[bench]
fn step_vec_10(b: &mut test::Bencher) {
    let v = vec![0; 1024];
    b.iter(|| {
        fast_integer_sum(cloned(v.iter().step(10)))
    });
}

#[bench]
fn step_range_2(b: &mut test::Bencher) {
    let v = black_box(0..1024);
    b.iter(|| {
        fast_integer_sum(v.clone().step(2))
    });
}

#[bench]
fn step_range_10(b: &mut test::Bencher) {
    let v = black_box(0..1024);
    b.iter(|| {
        fast_integer_sum(v.clone().step(10))
    });
}

#[bench]
fn cartesian_product_iterator(b: &mut test::Bencher)
{
    let xs = vec![0; 16];

    b.iter(|| {
        let mut sum = 0;
        for (&x, &y, &z) in iproduct!(&xs, &xs, &xs) {
            sum += x;
            sum += y;
            sum += z;
        }
        sum
    })
}

#[bench]
fn cartesian_product_fold(b: &mut test::Bencher)
{
    let xs = vec![0; 16];

    b.iter(|| {
        let mut sum = 0;
        iproduct!(&xs, &xs, &xs).fold((), |(), (&x, &y, &z)| {
            sum += x;
            sum += y;
            sum += z;
        });
        sum
    })
}

#[bench]
fn multi_cartesian_product_iterator(b: &mut test::Bencher)
{
    let xs = [vec![0; 16], vec![0; 16], vec![0; 16]];

    b.iter(|| {
        let mut sum = 0;
        for x in xs.into_iter().multi_cartesian_product() {
            sum += x[0];
            sum += x[1];
            sum += x[2];
        }
        sum
    })
}

#[bench]
fn multi_cartesian_product_fold(b: &mut test::Bencher)
{
    let xs = [vec![0; 16], vec![0; 16], vec![0; 16]];

    b.iter(|| {
        let mut sum = 0;
        xs.into_iter().multi_cartesian_product().fold((), |(), x| {
            sum += x[0];
            sum += x[1];
            sum += x[2];
        });
        sum
    })
}

#[bench]
fn cartesian_product_nested_for(b: &mut test::Bencher)
{
    let xs


llectionview_EditButton_"] svg */
._2q70uOe6xM3-c5XIVfBLe6 ._12pDikfkuNH_o3MHKU1skz svg {
    fill: rgb(var(--white));
    color: rgb(var(--white));
}

/* [class*="collectionview_Container_"] [class*="collectionview_EditButton_"] svg:hover */
._2q70uOe6xM3-c5XIVfBLe6 ._12pDikfkuNH_o3MHKU1skz svg:hover {
    fill: rgb(var(--white75));
    color: rgb(var(--white75));
}

/* [class*="collectionview_Container_"] [class*="collectionview_Header_"] [class*="collectionview_DynamicCollectionLabelAndButton_"] [class*="collectionview_DynamicCollectionLabel_"],
[class*="collectionview_Container_"] [class*="collectionview_Header_"] [class*="collectionview_DynamicCollectionLabelAndButton_"]:hover [class*="collectionview_DynamicCollectionLabel_"] */
._2q70uOe6xM3-c5XIVfBLe6 ._2rqTSCLSSEycEiuCS_OkpX ._8JUfQypf4Uxt2i_hxBk_t ._2cTiGDjpUyBonh9hRHHcwz, ._2q70uOe6xM3-c5XIVfBLe6 ._2rqTSCLSSEycEiuCS_OkpX ._8JUfQypf4Uxt2i_hxBk_t:hover ._2cTiGDjpUyBonh9hRHHcwz {
    color: rgb(var(--white));
}

/* [class*="collectionview_Container_"] [class*="collectionview_EditButton_"] svg */
._2q70uOe6xM3-c5XIVfBLe6 ._12pDikfkuNH_o3MHKU1skz svg {
    fill: rgb(var(--white));
    color: rgb(var(--white));
}

/* [class*="collectionview_Container_"] [class*="collectionview_EditButton_"] svg:hover */
._2q70uOe6xM3-c5XIVfBLe6 ._12pDikfkuNH_o3MHKU1skz svg:hover {
    fill: rgb(var(--white50));
    color: rgb(var(--white50));
}

/* [class*="collectionview_Container_"] [class*="collectionview_Header_"] [class*="collectionview_DynamicCollectionLabelAndButton_"]:hover */
._2q70uOe6xM3-c5XIVfBLe6 ._2rqTSCLSSEycEiuCS_OkpX ._8JUfQypf4Uxt2i_hxBk_t:hover {
    background-color: rgb(var(--white05));
}

/* [class*="shared_svg_library_SteamDeckCompatUnsupported_"], [class*="shared_svg_library_SteamDeckCompatUnknown_"] */
._2LAaxz6RtHXrJJj9NzCNL4, .xBqU_GerRwzHIs8N9ratU {
    color: rgb(var(--white75));
}

/* [class*="collectionview_Container_"] [class*="collectionview_Header_"] .DialogInput_Wrapper .DialogTextInputBase,
[class*="collectionview_Container_"] [class*="collectionview_Header_"] .DialogInput_Wrapper .DialogTextInputBase:hover */
._2q70uOe6xM3-c5XIVfBLe6 ._2rqTSCLSSEycEiuCS_OkpX .DialogInput_Wrapper .DialogTextInputBase, ._2q70uOe6xM


33333	17
3	1.7830037230933333	49
4	1.7830037230933333	19
5	1.7830037230933333	51
6	0.45367267733333344	101
7	0.24822168499199995	107
8	0.2998809452444444	103
9	0.27078669279999995	87
10	0.35009989324800006	106
11	0.36153334124088893	110
12	0.5044219813333333	102
13	0.4228977980444445	86
14	0.21972759904000003	93
15	0.2447894504888889	85
16	0.33897751608888893	78
17	0.23103606041600003	91
18	0.3188559254755556	96
19	0.4603000783111112	88
20	0.42095855593244447	116
21	0.5620364772693333	108
22	0.38974332839822223	76
23	0.33955455559111114	80
24	0.22977211564444444	69
25	0.6469147968	113
26	0.2116657717777778	68
27	0.36168292727466667	94
28	0.6957446353351112	115
29	0.7475009231075557	109
30	0.38924082827377776	79
<gh_stars>0
/*
Copyright (C) 2019 <NAME>

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

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

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

use std::fs;
use std::path::PathBuf;
use std::process;

use serde::Deserialize;

static CONFIG_EXAMPLE : &str = "\
#An example config file
repeat = false";

#[derive(Deserialize)]
pub struct Config {
    pub repeat: bool,
}

pub fn read_config(bb_dir: &PathBuf) -> Config {
    let config_path = config_path(bb_dir);
    let file_contents = fs::read_to_string(config_path).unwrap_or_else(|_err| {
        eprintln!("Unable to read bigbang.toml file in {}", bb_dir.to_string_lossy());
        process::exit(1);
    });

    let config: Config = toml::from_str(&*file_contents).unwrap_or_else(|_err| {
        eprintln!("bigbang.toml in {} cannot be parsed as TOML", bb_dir.to_string_lossy());
        process::exit(1)
    });

    config
}

pub fn write_config_file(bb_dir: &PathBuf) -> std::io::Result<()> {
    let config_path = config_path(bb_dir);
    fs::write(config_path,CONFIG_EXAMPLE)?;
    println!("Configuration file bigbang.toml written to {}", bb_dir.to_string_lossy());
    Ok(())
}

fn config_path(bb_dir: &PathBuf) -> PathBuf {
    let mut config_path = bb_dir.clone();
    config_path.push("bigbang.toml");
    config_path
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_deserialization() {
        let config: Config = toml::from_str(CONFIG_


6444655] = "sm_26_lnddcal02",
	[996091122] = "hw1_07_logo",
	[426059000] = "cs6_08a_land_00_decal",
	[1907273207] = "cs3_07_roadfence01b",
	[3611370757] = "cs4_10_store",
	[4110230792] = "sc1_12_church_d",
	[2294359307] = "v_ret_gc_ear03",
	[1636640013] = "cs6_04_prisontower3",
	[1178281232] = "sc1_20_gd02",
	[380708114] = "h4_mph4_ter03_coast_decal03b",
	[2389497290] = "h4_prop_bush_wandering_aa",
	[2223976251] = "v_ind_rc_rubbish2",
	[3182017703] = "v_ind_rc_rubbish",
	[444933400] = "ch1_07_g00_rail31",
	[1441229823] = "cs4_11_props_e_wire021",
	[1136026297] = "h4_prop_h4_table_isl_01a",
	[558179615] = "bh1_15_cablemesh5699_hvstd",
	[3583250193] = "h4_mph4_air_abandoned_014",
	[4044984925] = "cs6_04_canroof_ladder08",
	[3473220900] = "bh1_rd_furgrass_79",
	[3301752945] = "h4_mph4_air_gang_comp_emissive",
	[1601172277] = "h4_mph4_airstrip_fence_ruin_01_fiz",
	[1255157313] = "h4_mph4_air_gang_comp_fiz",
	[291185973] = "ch2_12_house02_rail",
	[525411639] = "bh1_36_grnd_02",
	[3356730808] = "ch1_07_d03_rail03",
	[4279969082] = "ch2_12_railing17",
	[2829526331] = "ap1_02_bld07df",
	[2484675900] = "prop_rub_wreckage_3",
	[2300549541] = "h4_mph4_air_cble14332_tstd001",
	[3280676161] = "CS1_Roads_PB_Sb",
	[3781695612] = "h4_mph4_air_cable189339_hvstd001",
	[3355518276] = "dt1_17_cloth1",
	[2759140679] = "ap1_01_d_wet00",
	[778296170] = "h4_mph4_air_cable189307_hvlit001",
	[541170887] = "h4_mph4_air_welcomegate",
	[1975461198] = "ch1_06_res2_decheg_03",
	[1972092397] = "h4_mph4_air_island_airstrip_weeds",
	[2182768573] = "h4_mph4_air_gang_comp_walls",
	[948911714] = "h4_mph4_air_airstrip_tower_rails",
	[1300833622] = "ch2_11b_armco01",
	[1971577905] = "h4_mph4_air_airstrip_tower_glue",
	[1872826619] = "h4_mph4_air_airstrip_substation",
	[3617006943] = "hw1_24_brk_wl01",
	[17701565


 isEnter } from '~client/modules/nav';

type Options = {
  stopPropagation?: boolean;
};

export const stopEventPropagation = <E extends HTMLElement = HTMLElement>(
  event: React.MouseEvent<E>,
): void => event.stopPropagation();

export type CTAEvents<E extends HTMLElement = HTMLElement> = {
  onClick: ReactEventHandler<E>;
  onKeyDown: ReactEventHandler<E>;
};

export function useCTA<E extends HTMLElement = HTMLElement>(
  onActivate: () => void,
  options?: Options,
): CTAEvents<E> {
  const stopPropagation = !!options?.stopPropagation;
  const events = useMemo(() => {
    const debouncedActivate = debounce(10, true, onActivate);
    return {
      onKeyDown: (event: React.KeyboardEvent<E>): void => {
        if (isEnter(event)) {
          debouncedActivate();
        }
      },
      onClick: (event: React.MouseEvent<E>): void => {
        if (stopPropagation) {
          stopEventPropagation(event);
        }
        debouncedActivate();
      },
    };
  }, [onActivate, stopPropagation]);

  return events;
}
export interface Model {
  id: number;
  name: string;
  size: string;
  maxDisplacement: number;
  compatibleEngines?: Engine[];
}

export interface Engine {
  id: number;
  name: string;
  displacement: number;
  gearbox: Gearbox[];
  price: number;
}

export interface Gearbox {
  id: number;
  name: string;
  price: number;
}

export interface Color {
  id: number;
  name: string;
}

export interface RootState {
  models: ModelsStateType;
  colors: ColorsStateType;
  summary: SummaryStateType;
}

export interface ModelsStateType {
  models: Model[];
  fetchModelsLoading: boolean;
  fetchModelsError: boolean;
  fetchModelEnginesLoading: boolean;
  fetchModelEnginesError: boolean;
}

export interface ColorsStateType {
  colors: Color[];
  fetchColorsLoading: boolean;
  fetchColorsError: boolean;
}

export interface SummaryStateType {
  summary: number;
  fetchSummaryLoading: boolean;
  fetchSummaryError: boolean;
}

export interface Summary {
  summary: number;
}

export interface fetchColorsAction {
  type: 'FETCH_COLORS';
  fetchColorsLoading: boolean;
  fetchColorsError: boolean;
}

export interface fetchColorsSuccessAction {
  type: 'FETCH_COLORS_SUCCESS';
  payload: Color[];
  fetchColorsLoading: boolean;
  fetchColorsError: boolean;
}

export interface fetchColorsFailedAction {
  type: 'FETCH_COLORS_FAILED';
  fetchColorsLoading: boolean;
  fetchColorsError: boolean;
}

export type ColorsAction =
  | fetchColorsAction
  | fetchColorsSuccessAction
  | fetchColorsFailedAction;

export interface fetchModelsAction {
  type: 'FETCH_MODELS';
  fetchModelsLoading: boolean;
  fetchModelsError: boolean;
}

export interface fetchModelsSuccessAction {
  type: 'FETCH_MODELS_SUCCESS';
  payload: Model[];
  fetchModelsLoading: boolean;
  fetchModelsError: boolean;
}

export interface fetchModelsFailedAction {
  type: 'FETCH_MODELS_FAILED';
  fetchModesLoading: boolean;
  fetchModesError: boolean;
}

export interface fetchModelEngineAction {
  type: 'FETCH_MODEL_ENGINE';
  fetchModelEngineLoading: boolean;
  fetchModelEngineError: boolean;
}

export interface fetchModelEngineSuc


box.Library.Forms.AlphaSelectorHorizontalPanel alphaSelectorHorizontalPanel1;
        private Toolbox.Library.Forms.STLabel stLabel7;
        private Toolbox.Library.Forms.STDropDownPanel stDropDownPanel4;
        private Toolbox.Library.Forms.STRadioButton radioBottomLeftBtn;
        private Toolbox.Library.Forms.STRadioButton radioTopLeftBtn;
        private Toolbox.Library.Forms.STRadioButton radioLeftBtn;
        private Toolbox.Library.Forms.STRadioButton radioBottomRightBtn;
        private Toolbox.Library.Forms.STRadioButton radioTopRightBtn;
        private Toolbox.Library.Forms.STRadioButton radioRightBtn;
        private Toolbox.Library.Forms.STRadioButton radioBottomBtn;
        private Toolbox.Library.Forms.STRadioButton radioTopBtn;
        private Toolbox.Library.Forms.STRadioButton radioCenterBtn;
        private Toolbox.Library.Forms.STCheckBox alphaChildrenChk;
        private Toolbox.


///
    /// More information:
    ///  - [ECMAScript reference][spec]
    ///
    /// [spec]: https://tc39.es/ecma262/#sec-createarrayfromlist
    pub(crate) fn create_array_from_list<I>(elements: I, context: &mut Context) -> JsObject
    where
        I: IntoIterator<Item = JsValue>,
    {
        // 1. Assert: elements is a List whose elements are all ECMAScript language values.
        // 2. Let array be ! ArrayCreate(0).
        let array = Self::array_create(0, None, context)
            .expect("creating an empty array with the default prototype must not fail");
        // 3. Let n be 0.
        // 4. For each element e of elements, do
        for (i, elem) in elements.into_iter().enumerate() {
            // a. Perform ! CreateDataPropertyOrThrow(array, ! ToString(𝔽(n)), e).
            array
                .create_data_property_or_throw(i, elem, context)
                .expect("new array must be extensible");
            // b. Set n to n + 1.
        }
        // 5. Return array.
        array
    }

    /// Creates a new `Array` instance.
    pub(crate) fn new_array(context: &mut Context) -> JsValue {
        Self::array_create(0, None, context)
            .expect("creating an empty array with the default prototype must not fail")
            .into()
    }

    /// Utility function for concatenating array objects.
    ///
    /// Returns a Boolean valued property that if `true` indicates that
    /// an object should be flattened to its array elements
    /// by `Array.prototype.concat`.
    fn is_concat_spreadable(this: &JsValue, context: &mut Context) -> JsResult<bool> {
        // 1. If Type(O) is not Object, return false.
        if !this.is_object() {
            return Ok(false);
        }
        // 2. Let spreadable be ? Get(O, @@isConcatSpreadable).
        let spreadable = this.get_field(WellKnownSymbols::is_concat_spreadable(), context)?;

        // 3. If spreadable is not undefined, return ! ToBoolean(spreadable).
        if !spreadable.is_undefined() {
            return Ok(spreadable.to_boolean());
        }
        // 4. Return ? IsArray(O).
        match this.as_object() {
            Some(obj) => Ok(obj.is_array()),
            _ => Ok(false),
        }
    }

    /// `get Array [ @@species ]`
    ///
    /// The `Array [ @@species ]` accessor property returns the Array constructor.
    ///
    /// More information:
    ///  - [ECMAScript reference][spec]
    ///  - [MDN documentation][mdn]
    ///
    /// [spec]: https://tc39.es/ecma262/#sec-get-array-@@species
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@species
    fn get_species(this: &JsValue, _: &[JsValue], _: &mut Context) -> JsResult<JsValue> {
        // 1. Return the this value.
        Ok(this.clone())
    }

    /// Utility function used to specify the creation of a new Array object using a constructor
    /// function that is derived from original_array.
    ///
    /// see: <https://tc39.es/ecma262/#sec-arrayspeciescreate>
    pub(crate) fn array_species_create(
        original_array: &JsObject,
        length: usize,
        context: &mut Context,
    ) -> JsResult<JsObject> {
        // 1. Let isArray be ? IsArray(originalArray).
        // 2. If isArray is false, return ? ArrayCreate(length).
        if !original_array.is_array() {
            return Self::array_create(length, None, context);
        }
        // 3. Let C be ? Get(originalArray, "constructor").
        let c = original_array.get


te 4 different marketing campaigns for {brand_name}, which is a {description}.

    TARGET AUDIENCE: {target_audience}
    UNIQUE SELLING POINT: {unique_selling_point}
    TONE & STYLE: {tone_style}

    Use the OATH framework with these audience segments:
    - **Oblivious**: {oblivious}
    - **Apathetic**: {apathetic}
    - **Thinking**: {thinking}
    - **Hurting**: {hurting}

    For each campaign:
    1. Create a compelling headline that captures attention
    2. Write 2-3 paragraphs that address the specific audience mindset
    3. End with a strong call to action
    4. Explain how the copy is tailored to that specific audience mindset

    Format each campaign clearly with "CAMPAIGN 1:", "CAMPAIGN 2:", etc. as headers.
    Make the copy authentic, specific to the brand, and focused on the target audience's needs and desires.
    """

    try:
        return llm_text_gen(prompt, system_prompt=system_prompt)
    except Exception as e:
        st.error(f"Error generating copy: {str(e)}")
        return None


ereum/go-ethereum"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/ethereum/go-ethereum/log"

	"github.com/ethereum-optimism/optimism/op-node/rollup"
	"github.com/ethereum-optimism/optimism/op-service/eth"
	"github.com/ethereum-optimism/optimism/op-service/testlog"
	"github.com/ethereum-optimism/optimism/op-service/testutils"
)

// TestL1TraversalNext tests that the `Next` function only returns
// a block reference once and then properly returns io.EOF afterwards
func TestL1TraversalNext(t *testing.T) {
	rng := rand.New(rand.NewSource(1234))
	a := testutils.RandomBlockRef(rng)
	// Load up the initial state with a reset
	l1Cfg := eth.SystemConfig{
		BatcherAddr: testutils.RandomAddress(rng),
		Overhead:    [32]byte{42},
		Scalar:      [32]byte{69},
	}
	sysCfgAddr := testutils.RandomAddress(rng)
	cfg := &rollup.Config{
		Genesis:               rollup.Genesis{SystemConfig: l1Cfg},
		L1SystemConfigAddress: sysCfgAddr,
	}
	tr := NewL1Traversal(testlog.Logger(t, log.LevelError), cfg, nil)

	_ = tr.Reset(context.Background(), a, l1Cfg)

	// First call should always succeed
	ref, err := tr.NextL1Block(context.Background())
	require.Nil(t, err)
	require.Equal(t, a, ref)

	// Subsequent calls should return io.EOF
	ref, err = tr.NextL1Block(context.Background())
	require.Equal(t, eth.L1BlockRef{}, ref)
	require.Equal(t, io.EOF, err)

	ref, err = tr.NextL1Block(context.Background())
	require.Equal(t, eth.L1BlockRef{}, ref)
	require.Equal(t, io.EOF, err)
}

// TestL1TraversalAdvance tests that the `Advance` function properly
// handles different error cases and returns the expected block ref
// if there is no error.
func TestL1TraversalAdvance(t *testing.T) {
	rng := rand.New(rand.NewSource(1234))
	a := testutils.RandomBlockRef(rng)
	b := testutils.NextRandomRef(rng, a)
	// x is at the same height as b but does not extend `a`
	x := testutils.RandomBlockRef(rng)
	x.Number = b.Number
	sysCfgAddr := testutils.RandomAddress(rng)

	tests := []struct {
		name         string
		startBlock   eth.L1BlockRef
		nextBlock    eth.L1BlockRef
		initialL1Cfg eth.SystemConfig
		l1Receipts   []*types.Receipt
		fetcherErr   error
		expectedErr  error
	}{
		{
			name:       "simple extension",
			startBlock: a,
			nextBlock:  b,
			initialL1Cfg: eth.SystemConfig{
				BatcherAddr: common.Address{11},
				Overhead:    [32]byte{22},
				Scalar:      [32]byte{33},
			},
			l1Receipts:  []*types.Receipt{},
			fetcherErr:  nil,
			expectedErr: nil,
		},
		{
			name:        "reorg",
			startBlock:  a,
			nextBlock:   x,
			fetcherErr:  nil,
			expectedErr: ErrReset,
		},
		{
			name:        "not found",
			startBlock:  a,
			nextBlock:   eth.L1BlockRef{},
			fetcherErr:  et


sklists[index]._id]).toBeUndefined();
    expect(list.length).toEqual(currentTasklists.length - 1);
  });

  it("ids still map to tasklists properly after modifications and task removal", () => {
    let list = getTLs(store);
    let ids = getTLids(store);
    for (let i = 0; i < list.length; i++) {
      let id = list[i]._id;
      let index = ids[id];
      expect(i).toEqual(index);
    }
  });

  // also tests immutability of an item retrieved with selector
  it("cant modify or remove tasklist if id is changed", () => {
    const tasklist = getRandomList(store);
    // if somehow we didn't get something, should never happen in this test @.@
    if (tasklist === null) {
      console.error("tasklist not returned from getRandomList");
      return;
    }
    const oldId = tasklist._id;
    // an id that cannot exist
    const id = "129385070";
    expect(() => tasklist._id = id).toThrowError(
      "Cannot assign to read only property '_id' of object '#<Object>'"
    );
    const moddable = {...tasklist};
    moddable._id = id;
    modTList(store, moddable);
    var ids = getTLids(store);
    var listBeforeRemove = getTLs(store);
    // ensure modification to tasklist's id
    // does not effect tasklist ids
    expect(ids[id]).toBeUndefined();
    // ensure modification to tasklist
    // does not effect tasklists array

    expect(listBeforeRemove[ids[oldId]]._id).toEqual(oldId);

    removeTList(store, moddable);
    var listAfterRemove = getTLs(store);
    var idsAfterRemove = getTLids(store);
    // same for removing SINCE that tasklist._id doesn't exist
    // in the store's copy of that tasklist
    expect(idsAfterRemove[oldId]).toBeDefined();
    expect(listBeforeRemove.length).toEqual(listAfterRemove.length);
  });

  it("selectors that separate tasks by stage work", () => {
    const tasklist = getRandomList(store);
    // if somehow we didn't get something, should never happen in this test @.@
    if (tasklist === null) {
      console.error("tasklist not returned from getRandomList");
      return;
    }
    const splitTasks = getTasksSplitFromID(store, tasklist._id);
    const checkSplit = (tasks: Array<TTasks> | null, listHolder: ITasklist) => {
      if (tasks === null) {
        console.error("tasklist somehow has no tasks");
        return;
      }
      // want last array to be empty
      expect(tasks[TaskStage.length].length).toEqual(0);
      // want each array to only contain tasks with appropriate stages
      let count = 0;
      for (let i = 0; i < tasks.length - 1; i++) {
        const sublist = tasks[i];
        count += sublist.length;
        for (let j = 0; j < sublist.length; j++) {
          expect(sublist[j].stage).toEqual(TaskStage[i]);
        }
      }
      // want to have ALL the tasks in the tasklist
      expect(count).toEqual(listHolder.tasks.length);
    }
    checkSplit(splitTasks, tasklist);
    const splitTasks2 = getTasksSplitFromIndex(store, 90);
    const tasklist2 = getTLByIndex(store, 90);
    if (tasklist2 === null) {
      console.error("tasklist not returned from index 90");
      return;
    }
    checkSplit(splitTasks2, tasklist2);
  });

  it.todo("state returned from a selector cannot be modified");
  it.todo("selectors return correct tasklists");
  it


he centroids present in 'self.centroids' of the fit model.
        :param X:
        :return:
        """
        distance_matrix = self._euclidean_distance_fully_vectorized(X.values, np.array(self.centroids))
        closest_centroids = np.argmin(distance_matrix, axis=1)
        return closest_centroids

    def getCost(self, X: DataFrame) -> float:
        """
        Returns the Within-Cluster Sum of Squares (WCSS) cost for the current centroids.
        :param X:
        :return:
        """
        X_vals = X.values  # converting dataframe to ndarray
        cost = 0

        distance_matrix = self._euclidean_distance_fully_vectorized(X_vals, np.array(self.centroids))
        closest_centroids = np.argmin(distance_matrix, axis=1)

        for i in range(self.n_clusters):
            points_assigned_to_centroid = X_vals[closest_centroids == i]
            cost += np.sum((points_assigned_to_centroid - self.centroids[i]) ** 2)

        return cost


        }

        public override void because()
        {
            sut.CheckValue(target);
        }

        [Test]
        public void should_throw_exception()
        {
            thrown_exception.ShouldBeOfType(typeof(ApplicationException));
        }

        [Test]
        public void should_state_that_bag_doesnt_match()
        {
            var exception = (ApplicationException)thrown_exception;
            exception.Message.ShouldEqual("Actual count (2) does not equal expected count (3)");
        }
    }

    [TestFixture]
    public class when_the_checked_list_has_different_elements : With_initialized_bag
    {
        public override void establish_context()
        {
            base.establish_context();
            target.GetterAndSetter = new[] {"bad", "bar", "foo"};
        }

        public override void because()
        {
            sut.CheckValue(target);
        }

        [Test]
        public void should_throw_exception()
        {
            thrown_exception.ShouldBeOfType(typeof(ApplicationException));
        }

        [Test]
        public void should_state_that_bag_doesnt_match()
        {
            var exception = (ApplicationException)thrown_exception;
            exception.Message.ShouldEqual("Actual count of item bad (1) does not equal expected item count (0)");
        }
    }

    [TestFixture]
    public class When_the_checked_list_has_transposed_items_of_the_expected_list : With_initialized_bag
    {
        public override void establish_context()
        {
            base.establish_context();
            target.GetterAndSetter = new[] { "baz", "bar", "foo" };
        }

        public override void because()
        {
            sut.CheckValue(target);
        }

        [Test]
        public void should_succeed()
        {
            thrown_exception.ShouldBeNull();
        }
    }
}


local server = require('luatest.server')
local t = require('luatest')

local pg = t.group(nil, t.helpers.matrix({op = {'get', 'delete', 'update'}}))

pg.before_all(function(cg)
    cg.server = server:new{
        alias   = 'dflt',
        box_cfg = {memtx_use_mvcc_engine = true}
    }
    cg.server:start()
    cg.server:exec(function()
        box.schema.create_space('s')
        box.space.s:create_index('pk')
    end)
end)

pg.after_all(function(cg)
    cg.server:drop()
end)

--[[
Checks that unserializable reads are tracked correctly after transaction
rollback.
]]
pg.test_unserializable_read_after_rollback = function(cg)
    local stream1 = cg.server.net_box:new_stream()
    local stream2 = cg.server.net_box:new_stream()
    local stream3 = cg.server.net_box:new_stream()

    stream1:begin()
    stream2:begin()
    stream3:begin()

    stream1.space.s:replace{0, 0}

    local args = {{0}}
    if cg.params.op == 'update' then
        table.insert(args, {{'=', 2, 0}})
    end
    stream2.space.s[cg.params.op](stream2.space.s, unpack(args))
    stream2.space.s:replace{1, 0}

    stream1:rollback()

    stream3.space.s:insert{0, 1}
    stream3:commit()

    local conflict_err_msg = 'Transaction has been aborted by conflict'
    t.asse


import cv2
import numpy as np

from rknn.api import RKNN
import os

if __name__ == '__main__':

    platform = 'rk3566'
    exp = 'yolov5s'
    Width = 640
    Height = 640
    # Model from https://github.com/airockchip/rknn_model_zoo
    MODEL_PATH = './onnx_models/yolov5s_relu.onnx'
    NEED_BUILD_MODEL = True
    # NEED_BUILD_MODEL = False
    im_file = './dog_bike_car_640x640.jpg'

    # Create RKNN object
    rknn = RKNN()

    OUT_DIR = "rknn_models"
    RKNN_MODEL_PATH = './{}/{}_{}.rknn'.format(
        OUT_DIR, exp+'-'+str(Width)+'-'+str(Height), platform)
    if NEED_BUILD_MODEL:
        DATASET = './dataset.txt'
        rknn.config(mean_values=[[0, 0, 0]], std_values=[
                    [255, 255, 255]], target_platform=platform)
        # Load model
        print('--> Loading model')
        ret = rknn.load_onnx(MODEL_PATH)
        if ret != 0:
            print('load model failed!')
            exit(ret)
        print('done')

        # Build model
        print('--> Building model')
        ret = rknn.build(do_quantization=True, dataset=DATASET)
        if ret != 0:
            print('build model failed.')
            exit(ret)
        print('done')

        # Export rknn model
        if not os.path.exists(OUT_DIR):
            os.mkdir(OUT_DIR)
        print('--> Export RKNN model: {}'.format(RKNN_MODEL_PATH))
        ret = rknn.export_rknn(RKNN_MODEL_PATH)
        if ret != 0:
            print('Export rknn model failed.')
            exit(ret)
        print('done')
    else:
        ret = rknn.load_rknn(RKNN_MODEL_PATH)

    rknn.release()


//using CommunityToolkit.Maui;
using CommunityToolkit.Maui;
using DotNurse.Injector;
using MemoryToolkit.Maui;
using Microsoft.Extensions.Logging;
using Mopups.Hosting;
using ReactiveUI;
using System.Reactive;
using UraniumUI;
using UraniumUI.Dialogs;
using UraniumUI.Options;
using UraniumUI.Validations;

namespace UraniumApp;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .UseMauiCommunityToolkit()
            .UseUraniumUI()
            .UseUraniumUIMaterial()
            .UseUraniumUIBlurs(false)
            .UseUraniumUIWebComponents()
            .ConfigureMopups()
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
                fonts.AddFontAwesomeIconFonts();
                fonts.AddMaterialSymbolsFonts();
                fonts.AddFluentIconFonts();
            });

#if DEBUG
        builder.Logging.AddDebug();


dialog_close_button{top:27px;background-image:url(images/sprites_ie6.png)}.cke_dialog_footer .cke_resizer{margin-top:27px}.cke_dialog_tabs{display:block;top:33px;margin-top:33px}.cke_rtl .cke_dialog_ui_labeled_content{_width:95%}a.cke_dialog_ui_button{background:0;padding:0}a.cke_dialog_ui_button span{width:70px;padding:5px 15px;text-align:center;color:#3b3b1f;background:#53d9f0 none;display:inline-block;cursor:default}a.cke_dialog_ui_button_ok span{background-image:none;background-color:#b8e834;margin-right:0}a.cke_dialog_ui_button_cancel span{background-image:none;background-color:#f65d20;margin-right:0}a.cke_dialog_ui_button:hover span,a.cke_dialog_ui_button:focus span,a.cke_dialog_ui_button:active span{background-image:none;background:#f7a922}div.cke_dialog_ui_input_password,textarea.cke_dialog_ui_input_textarea{width:99%}.cke_dialog_ui_checkbox_input,.cke_dialog_ui_ratio_input,.cke_btn_reset,.cke_btn_locked,.cke_btn_unlocked{border:1px solid red!important;filter:chroma(color=red)}.cke_dialog_ui_focused,.cke_btn_over{border:1px dotted #696969!important}/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
.cke_dialog{visibility:visible}.cke_dialog_body{z-index:1;border:solid 1px #ddd;padding:5px;background-color:#fff;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.cke_dialog strong{font-weight:bold}.cke_dialog_title{font-weight:bold;font-size:14px;padding:3px 3px 8px;cursor:move;position:relative;border-bottom:1px solid #eee}.cke_dialog_contents{background-color:#ebebeb;border:solid 1px #fff;border-bottom:0;overflow:auto;padding:17px 10px 5px 10px;-moz-border-radius-topleft:5px;-moz-border-radius-topright:5px;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;border-top-left-radius:5px;border-top-right-radius:5px;margin-top:22px}.cke_dialog_contents_body{overflow:auto;padding:17px 10px 5px 10px;margin-top:22px}.cke_dialog_footer{text-align:right;background-color:#ebebeb;border:solid 1px #fff;border-bottom:0;-moz-border-radius-bottomleft:5px;-moz-border-radius-bottomright:5px;-webkit-border-bottom-left-radius:5px;-webkit-border-bottom-right-radius:5px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.cke_rtl .cke_dialog_footer{text-align:left}.cke_dialog_footer .cke_resizer{margin-top:24px}.cke_dialog_footer .cke_resizer_ltr{border-right-color:#ccc}.cke_dialog_footer .cke_resizer_rtl{border-left-color:#ccc}.cke_hc .cke_dialog_footer .cke_resizer{margin-bottom:1px}.cke_hc .cke_dialog_footer .cke_resizer_ltr{margin-right:1px}.cke_hc .cke_dialog_footer .cke_resizer_rtl{margin-left:1px}.cke_dialog_tabs{height:23px;display:inline-block;margin-left:10


 MapPoint;
}

export function inBounds(point: MapPoint, bounds: MapBounds) {
  return !(
    point.lat > bounds.ne.lat ||
    point.lat < bounds.sw.lat ||
    point.lng > bounds.ne.lng ||
    point.lng < bounds.sw.lng
  );
}

export function locationToMapPoint(location: Location): MapPoint | null {
  if (!(location.lat && location.lng)) {
    return null;
  }

  return {
    lat: location.lat,
    lng: location.lng,
  };
}
// 01-tipos-variables.ts

// DUCK TYPING -> DUCK
let nombre:any = 'Bryan';
nombre = '1';
let edad:number | string = 21.2;
edad = '12';
let casado = false;
casado = true;
casado = null;
casado = undefined;

let arregloNumeros:number[] = [1,2,3];
arregloNumeros.push(3);

const bryan = {
    nombre:'Bryan',
    edad:21,
    casado:false,
    fechaNaciemiento: new Date(),
    saludar:()=>{
        return '';
    }
};

import { Column } from 'typeorm'
import { IsBoolean, Length } from 'class-validator'
import { ApiProperty } from '@nestjs/swagger'

export class CreateTodoDto {
   @ApiProperty({ example: 'Сходить в магазин' })
   @Length(1, 30, { message: 'Вы ничего не ввели' })
   readonly text: string

   @ApiProperty({ default: false })
   @IsBoolean()
   readonly checked: boolean
}
import * as signalR from "@microsoft/signalr";
import { useEffect, useState } from "react";

export interface SignalROperations {
  subscribe: (operation: string, eventHandler: any) => any;
  unsubscribe: (operation: string, eventHandler: any) => any;
}

export default function useSignalR(url: string): SignalROperations {
  const [connection, setConnection] = useState<signalR.HubConnection>();

  useEffect(() => {
    const conn = buildConnection(url);
    startConnection(conn);
    setConnection(conn);

    return () => {
      conn.stop().then().catch();
    };
  }, [url]);

  function subscribe(operation: string, eventHandler: () => any): () => any {
    connection?.on(operation, eventHandler);
    return () => {
      connection?.off(operation, eventHandler);
    };
  }

  function unsubscribe(operation: string, eventHandler: () => any) {
    connection?.off(operation, eventHandler);
  }

  return { subscribe, unsubscribe };
}

function startConnection(connection?: signalR.HubConnection) {
  if (connection) {
    connection
      .start()
      .then(() => console.log("connection started"))
      .catch(() => {
        console.log("Couldn't establish connection");
        connection.onclose(() => startConnection(connection));
      });
  }
}

function buildConnection(url: string): signalR.HubConnection {
  return new signalR.HubConnectionBuilder()
    .withAutomaticReconnect()
    .configureLogging(signalR.LogLevel.Debug)
    .withUrl(url)
    .build();
}
import {Listener} from './Listener';

export class EventListener {
  private static widthChangeListeners: Listener[] = [];

  constructor() {
    window.onresize = () => {
      // set screenWidth on screen size change
      this.notify(EventListener.widthChangeListeners, window.innerWidth);
    };
  }

  public static onWidthChangeListener(listen


T WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 *
 */

package org.apache.directory.shared.ldap.message.spi;

/**
 * All Service Provider Interfaces extend this super interface to corralate SPI
 * implementations with the appropriate provider.
 *
 * @author Apache Directory Project
 * @version $Revision: 437007 $
 */
public interface ProviderObject
{
    /**
     * Gets the Provider associated with this SPI implementation object.
     *
     * @return Provider.
     */
    Provider getProvider();

    /** @link dependency */
    /* # Provider lnkProvider; */
}
/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 *
 */
package org.apache.directory.shared.ldap.message.internal;

import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.message.SingleReplyRequest;
import org.apache.directory.shared.ldap.name.DN;

/**
 * Compare request protocol message that tests an entry to see if it abides by
 * an attribute value assertion.
 *
 * @author Apache Directory Project
 * @version $Revision: 918756 $
 */
public interface InternalCompareRequest extends SingleReplyRequest, InternalAbandonableRequest
{
    /** Compare request message type enum code */
    MessageTypeEnum TYPE = MessageTypeEnum.COMPARE_REQUEST;

    /** Compare response message type enum code */
    MessageTypeEnum RESP_TYPE = InternalCompareResponse.TYPE;

    /**
     * Gets the distinguished name of the entry to be compared using the
     * attribute value assertion.
     *
     * @return the DN of the compared entry.
     */
    DN getName();

    /**
     * Sets the distinguished name of the entry to be compared using the
     * attribute value assertion.
     *
     * @param name the DN of the compared entry.
     */
    void setName( DN name );

    /**
     * Gets the attribute value to use in making the comparison.
     *
     * @return the attribute value to used in comparison.
     */
    Value<?> getAssertionValue();

    /**
     * Sets the attribute value to use in the comparison.
     *
     * @param value the attribute value used in comparison.
     */
    void setAssertionValue( String value );

    /**
     * Sets the attribute value to use in the comparison.
     *
     * @param value the attribute value used in comparison.
     */
    void setAssertionValue( byte[] value );

    /**
     * Gets the attribute id use in making the comparison.
     *
     * @return the attribute id used in comparison.
     */
    String getAttributeId();

    /**
     * Sets the attribute id used in the comparison.
     *
     * @param attrId the attribute id used in comparison.
     */
    void setAttributeId( String attrId );
}
/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See


0; i < count; ++i) {
            uint8_t value = i2cService.eepromReadByte(addr + i);
            terminalView.print(value);
        }
    } else {
        // Mode HEX/ASCII
        terminalView.println("");
        for (uint32_t i = 0; i < count; i += bytesPerLine) {
            std::vector<uint8_t> line;
            for (uint8_t j = 0; j < bytesPerLine && (i + j) < count; ++j) {
                line.push_back(i2cService.eepromReadByte(addr + i + j));

                char c = terminalInput.readChar();
                if (c == '\n' || c == '\r') {
                    terminalView.println("\n❌ Dump interrupted by user.");
                    return;
                }
            }
            std::string formatted = argTransformer.toAsciiLine(addr + i, line);
            terminalView.println(formatted);
        }
    }
}

void I2cEepromShell::cmdErase() {
    bool confirm = userInputManager.readYesNo("⚠  Are you sure you want to erase the EEPROM?", false);
    if (confirm) {
        terminalView.println("Erasing...");
        i2cService.eepromErase(0xFF);
        terminalView.println("\n✅ EEPROM erased.");
    } else {
        terminalView.println("\n❌ Operation cancelled.");
    }
}#include "ICMPService.h"
#include <Arduino.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <vector>
#include <algorithm>
#include <ESP32Ping.h>

#include "lwip/inet.h"
#include "lwip/netdb.h"
#include "ping/ping_sock.h"
extern "C"
{
#include "esp_ping.h"
}

portMUX_TYPE ICMPService::icmpMux = portMUX_INITIALIZER_UNLOCKED;
std::vector<std::string> ICMPService::icmpLog;
bool ICMPService::stopICMPFlag = false;

// Task params
struct ICMPTaskParams
{
    std::string targetIP;
    int count;
    int timeout_ms;
    int interval_ms;
    ICMPService *service;
};

struct DiscoveryTaskParams
{
    std::string deviceIP;
    ICMPService *service;
};

ICMPService::ICMPService() {}

ICMPService::~ICMPService()
{
    cleanupICMPService();
}

void ICMPService::cleanupICMPService()
{
    // Reset last results
    pingReady = false;
    pingRC = ping_rc_t::ping_error;
    pingMedianMs = -1;
    pingTX = 0;
    pingRX = 0;
    report.clear();
}

std::string ICMPService::getPingHelp() const{
    std::string helpMenu = std::string("Usage: ping <host> [-c <count>] [-t <timeout>] [-i <interval>]\r\nOptions:\r\n ") +
        "\t-c <count>    Number of pings (default: 5)\r\n " +
        "\t-t <timeout>  Timeout in milliseconds (default: 1000)\r\n" +
        "\t-i <interval> Interval between pings in milliseconds (default: 200)";
    return helpMenu;
}

static bool resolve_ipv4_to_ip_addr(const std::string &targetIP, ip_addr_t &out)
{
    // literal first
    ip4_addr_t a4{};
    if (ip4addr_aton(targetIP.c_str(), &a4))
    {
        out.type = IPADDR_TYPE_V4;
        out.u_addr.ip4 = a4;
        return true;
    }
    // DNS fallback
    struct addrinfo hints{};
    hints.ai_family = AF_INET;
    struct addrinfo *res = nullptr;


cy.
	Items []*TenantUserAccountWithAttributes `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// Token for pagination, indicating the next set of results can be retrieved using this token.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *ListTenantUserAccountsWithAttributesResponse) Reset() {
	*x = ListTenantUserAccountsWithAttributesResponse{}
	mi := &file_nebius_iam_v1_tenant_user_account_with_attributes_service_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *ListTenantUserAccountsWithAttributesResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*ListTenantUserAccountsWithAttributesResponse) ProtoMessage() {}

func (x *ListTenantUserAccountsWithAttributesResponse) ProtoReflect() protoreflect.Message {
	mi := &file_nebius_iam_v1_tenant_user_account_with_attributes_service_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use ListTenantUserAccountsWithAttributesResponse.ProtoReflect.Descriptor instead.
func (*ListTenantUserAccountsWithAttributesResponse) Descriptor() ([]byte, []int) {
	return file_nebius_iam_v1_tenant_user_account_with_attributes_service_proto_rawDescGZIP(), []int{2}
}

func (x *ListTenantUserAccountsWithAttributesResponse) GetItems() []*TenantUserAccountWithAttributes {
	if x != nil {
		return x.Items
	}
	return nil
}

func (x *ListTenantUserAccountsWithAttributesResponse) GetNextPageToken() string {
	if x != nil {
		return x.NextPageToken
	}
	return ""
}

var File_nebius_iam_v1_tenant_user_account_with_attributes_service_proto protoreflect.FileDescriptor

const file_nebius_iam_v1_tenant_user_account_with_attributes_service_proto_rawDesc = "" +
	"\n" +
	"?nebius/iam/v1/tenant_user_account_with_attributes_service.proto\x12\rnebius.iam.v1\x1a\x18nebius/annotations.proto\x1a'nebius/iam/v1/tenant_user_account.proto\";\n" +
	")GetTenantUserAccountWithAttributesRequest\x12\x0e\n" +
	"\x02id\x18\x01 \x01(\tR\x02id\"\xb6\x01\n" +
	"+ListTenantUserAccountsWithAttributesRequest\x12\x1b\n" +
	"\tparent_id\x18\x01 \x01(\tR\bparentId\x12 \n" +
	"\tpage_size\x18\x02 \x01(\x03H\x00R\bpageSize\x88\x01\x01\x12\x1d\n" +
	"\n" +
	"page_token\x18\x03 \x01(\tR\tpageToken\x12\x1b\n" +
	"\x06filter\x18\x04 \x01(\tB\x03\xc0J\x01R\x06filterB\f\n" +
	"\n" +
	"_page_size\"\x9c\x01\n" +
	",ListTenantUserAccountsWithAttributesResponse\x12D\n" +
	"\x05items\x18\x01 \x03(\v2..nebius.iam.v1.TenantUserAccountWithAttributesR\x05items\x12&\n" +
	"\x0fnext_page_token\x


tem wichtig ist. Ein
Bootselektor gehört da garantiert nicht dazu!

 Festfrequenzmonitor mit der Nova?

Von Rainer Lodemann <Rainer_Lodemann@hm.maus.de>

Anschluss eines Festfrequenzmonitor an eine Nova Grafikkarte

Ich habe nach langem Hin- und Herprobieren einen SPEA GDM 1963 19
Zoll Festfrequenzmonitor an meinem Falcon mit NOVA Mach64 Grafikkarte
erfolgreich zum Arbeiten bewegen können.

Hardwaremäßig ist das eigentlich kein Problem, nur der
Nova VMG muss richtig programmiert werden:

        Horizontal  Vertikal
Total   1696        1296
Länge   1280        1024
Sync    56          28

Auf 256 Farben einstellen!

Die Monitordaten:

Bildfrequenz 75 Hz

Zeilenfrequenz 94 KHz

Pixelfrequenz 125 MHz

Damit läufts, wenn man die Feineinstellungen im
Monitorinneren nutzt (ist etwas unbequem).

Bis ich das raus hatte, hat es schon eine Weile gedauert, da die
Informationen zum Monitor spärlich und widersprüchlich sind.
Die entscheidende Info kam aus einer Anpassung des Monitors an ein
X-Window-System.

Jetzt läuft mein MiNT-Falcon in 1280x1024 und 256 Farben in
besserer Qualität als auf meinem Belinea 107040 (17 Zoll
Monitor). Nachteil: Es geht NUR diese Auflösung. Meine
Problemlösung: Zweit-Monitor mittels Umschaltbox und Nova-Switch
für die Bootmeldungen angeschlossen, ist im regulären
Betrieb nicht störend. Bei Problemen, Neuinstallationen oder
Systemupdates ist das Umlegen eines Schalters auch kein Akt.

Ich müsste nur noch etwas in der vertikalen machen, da das
Bild mit o.a. Einstellungen nicht den ganzen Bilschirm ausfüllt.
Ich habe trotz Feinjustage oben auf dem Screen noch ca. 5cm schwarzen
Rand, rechts (horizontal) noch 2cm. Leider weiß ich nicht,
welcher Wert im Nova VMG das beeinflusst.

 NOVA VDI

Damit NVDI zusammen mit NOVA-VDI bootet müssen drei Punkte
erfüllt sein:

- es muß ein NOVA-VDI V2.61 oder noch neuer vorhanden sein

- die NVDIDRV?.SYS Dateien müssen deaktiviert sein (Endung
".SYX")

- Die Reihenfolge im AUTO-Ordner muß EMULATOR.PRG,


t %p\n",
                    (unsigned long)pinfo->size, pinfo->pointer);
                pinfo = pinfo->next;
             }
          }
#endif
       }
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
       fprintf(STDERR, " Current memory allocation: %10d bytes\n",
           current_allocation);
       fprintf(STDERR, " Maximum memory allocation: %10d bytes\n",
           maximum_allocation);
       fprintf(STDERR, " Total   memory allocation: %10d bytes\n",
           total_allocation);
       fprintf(STDERR, "     Number of allocations: %10d\n",
           num_allocations);
#endif
   }

#ifdef PNGTEST_TIMING
   t_stop = (float)clock();
   t_misc += (t_stop - t_start);
   t_start = t_stop;
   fprintf(STDERR, " CPU time used = %.3f seconds",
       (t_misc+t_decode+t_encode)/(float)CLOCKS_PER_SEC);
   fprintf(STDERR, " (decoding %.3f,\n",
       t_decode/(float)CLOCKS_PER_SEC);
   fprintf(STDERR, "        encoding %.3f ,",
       t_encode/(float)CLOCKS_PER_SEC);
   fprintf(STDERR, " other %.3f seconds)\n\n",
       t_misc/(float)CLOCKS_PER_SEC);
#endif

   if (ierror == 0)
      fprintf(STDERR, " libpng passes test\n");

   else
      fprintf(STDERR, " libpng FAILS test\n");

   dummy_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
   fprintf(STDERR, " Default limits:\n");
   fprintf(STDERR, "  width_max  = %lu\n",
       (unsigned long) png_get_user_width_max(dummy_ptr));
   fprintf(STDERR, "  height_max = %lu\n",
       (unsigned long) png_get_user_height_max(dummy_ptr));
   if (png_get_chunk_cache_max(dummy_ptr) == 0)
      fprintf(STDERR, "  cache_max  = unlimited\n");
   else
      fprintf(STDERR, "  cache_max  = %lu\n",
          (unsigned long) png_get_chunk_cache_max(dummy_ptr));
   if (png_get_chunk_malloc_max(dummy_ptr) == 0)
      fprintf(STDERR, "  malloc_max = unlimited\n");
   else
      fprintf(STDERR, "  malloc_max = %lu\n",
          (unsigned long) png_get_chunk_malloc_max(dummy_ptr));
   png_destroy_read_struct(&dummy_ptr, NULL, NULL);

   return (int)(ierror != 0);
}
#else
int
main(void)
{
   fprintf(STDERR,
       " test ignored because libpng was not built with read support\n");
   /* And skip this test */
   return PNG_LIBPNG_VER < 10600 ? 0 : 77;
}
#endif

/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_26 Your_png_h_is_not_version_1_6_26;