using it to \string{{{escape {{wacky}} curlies}}}.
`,

		Outputs: Files{
			"hello-world.html": `

Hello, world!

Here's a code block:

I'm a code block.

	I'm indented more.

		I'm indented even more.

I'm indented less.

\reference{hello-world}

\\some-method\{Some argument.\}

One more line, with meaning.

And here I'm just using it to escape {{wacky}} curlies.

`,
		},
	}),
)
package stages

import (
	"fmt"
	"os"
	"reflect"
	"sync"
	"time"

	"github.com/sirupsen/logrus"
	"github.com/vito/booklit"
	"github.com/vito/booklit/ast"
)

// Evaluate is an ast.Visitor that builds up the booklit.Content for a given
// section.
type Evaluate struct {
	// The section which acts as the evaluation context. The section's plugins
	// are used for evaluating Invoke nodes.
	Section *booklit.Section

	// Duration after which to log a warning for a slow \invoke.
	SlowInvokeThreshold time.Duration

	// The evaluated content after calling (ast.Node).Visit.
	Result booklit.Content
}

// VisitString appends the string's text to the result using booklit.Append.
func (eval *Evaluate) VisitString(str ast.String) error {
	eval.Result = booklit.Append(eval.Result, booklit.String(str))
	return nil
}

// VisitSequence visits each node within the sequence.
func (eval *Evaluate) VisitSequence(seq ast.Sequence) error {
	for _, node := range seq {
		err := node.Visit(eval)
		if err != nil {
			return err
		}
	}

	return nil
}

// VisitParagraph visits each line in the paragraph and builds up a
// booklit.Paragraph containing each evaluated line.
//
// Any lines which evaluate to a nil result are skipped, i.e. a Invoke which
// performed side effects and returned nothing. If the paragraph is empty as a
// result, the Result is unaffected.
//
// If the Result contains a single non-flow content, it is unwrapped and
// appended to the Result.
//
// Otherwise, i.e. a normal paragraph of flow content, the paragraph is
// appended to the Result.
func (eval *Evaluate) VisitParagraph(node ast.Paragraph) error {
	previous := eval.Result

	para := booklit.Paragraph{}
	for _, line := range node {
		eval.Result = nil

		err := line.Visit(eval)
		if err != nil {
			return err
		}

		if eval.Result != nil {
			para = append(para, eval.Result)
		}
	}

	eval.Result = nil

	if len(para) == 0 {
		// paragraph resulted in no content (e.g. an invoke with no return value)
		eval.Result = previous
		return nil
	}

	if len(para) == 1 && !para[0].IsFlow() {
		// paragraph resulted in block content (e.g. a section)
		eval.Result = booklit.Append(previous, para[0])
		return nil
	}

	eval.Result = booklit.Append(previous, para)

	return nil
}

// VisitPreformatted behaves similarly to VisitParagraph, but with no
// special-case for block content, and it appends a booklit.Preformatted
// instead.
func (eval *Evaluate) VisitPreformatted(node ast.Preformatted) error {
	previous := eval.Result

	pre := booklit.Preformatted{}
	for _, line := range node {
		eval.Result = nil

		err := line.Visit(eval)
		if err != nil {
			return err
		}

		if eval.Res


4609_Ed3
- ST0601.19
- ST0902.1

↑ [Back to top](#table-of-contents)

## Installation

The installation can be done from the QGIS Python Plugins Repository or from the [zip](https://github.com/All4Gis/QGISFMV/releases).

↑ [Back to top](#table-of-contents)

## Installation on Windows

Windows automatically installs all, with user permission,If an error occurs, you should perform some checks.

[![Watch the video (Spanish)](https://i.imgur.com/eHhh2GPl.png)](https://youtu.be/9C973pz5i6k "Como usa QGISFMV en windows")

## Installation on Ubuntu

Ubuntu automatically installs all the dependencies if the user wants, for this his password will be requested.

If it does not install automatically, you should run:

**Python dependencies**

`sudo pip3 install matplotlib python-apt`

The installation of **OpenCV** and **OpenCV-contrib** requires a lot of time for this reason you will have to install these dependencies using this [script](code/install-opencv.sh)

`sh install-opencv.sh`

**FFMPEG**

`sudo apt-get -y install ffmpeg`

**GStreamer/QT5 Plugins**

`sudo apt-get -y install python3-pyqt5.qtmultimedia gst123 libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio libqt5gstreamer-1.0-0 libqt5multimedia5-plugins`

You need to restart QGIS after this.

**NOTE :** If you only see the videos with .mp4 extension, make sure you don't have it installed `gstreamer1.0-vaapi`. If you have it installed, you must delete it.

`sudo apt-get remove gstreamer1.0-vaapi`

## Installation on Archlinux

_Archlinux installation :_

```
pacman -S qgis python-matplotlib opencv ffmpeg
```

_ Set FFmpeg path in $HOME/.local/share/QGIS/QGIS3/profiles/[profile_name]/python/plugins/QGIS_FMV/settings.ini _

```
ffmpeg : "/usr/bin/"
ffprobe : "/usr/bin/"
```

## Slides

- [Official presentation](https://slides.com/franraga/qgis-fmv/fullscreen)
- [SIG libre 2021 WorkShop](https://slides.com/franraga/sig-libre-2021/fullscreen)
- [SIG libre 2021 Video (Spanish)](http://hdl.handle.net/10256.1/6237)

↑ [Back to top](#table-of-contents)

## Mentions

- [Beyond imagery and Video](https://docs.google.com/presentation/d/1b9FVFcThSJJLq4Q31C9Yx3pEsconY3QxKPZ4sifIAu4/edit?usp=sharing)

- [MXF Experimentation, Lessons Learned, _UK DSTL_](https://drive.google.com/file/d/1PvvD8RQBDkVgDYuKwqtFB3a9BEkWyn90/view?usp=sharing)

- [QGIS Mexico, FMV, Luis Gallardo](https://youtu.be/edk6sbNgiAw)


_ucFirst(name)}';

  /// The key in the json object for this property.
  final String jsonKey;

  /// The Dart type for this property.
  final DartType type;

  /// Whether this property overrides a super property.
  ///
  /// Overrides must have a more specific type. This means no setter for this
  /// property will be generated on subclasses. A more specific getter, and a
  /// more specific constructor param are generated.
  final bool isOverride;

  /// Whether the setter is private.
  ///
  /// By default, setters are hidden. Constructors are visible and constructors
  /// have required parameters for all required fields. This force the generate
  /// syntax API user to provide all required fields.
  ///
  /// Some use cases require public setters as the object is constructed peace
  /// meal. See [SchemaAnalyzer.publicSetters].
  final bool setterPrivate;

  /// Whether the validate method is private.
  ///
  /// By default, the validate methods for individual fields are hidden, only
  /// the validate method for all fields is public. However, in some use cases
  /// it can be useful to have access to the validators for individual fields.
  /// See [SchemaAnalyzer.publicValidators].
  final bool validatorPrivate;

  PropertyInfo({
    required this.name,
    required this.jsonKey,
    required this.type,
    this.isOverride = false,
    this.setterPrivate = true,
    this.validatorPrivate = true,
  });

  @override
  String toString() =>
      '''
PropertyInfo(
  name: $name,
  jsonKey: $jsonKey,
  type: ${type.toSerializedString()},
  isOverride: $isOverride,
  setterPrivate: $setterPrivate,
)''';
}

String _ucFirst(String str) {
  if (str.isEmpty) {
    return '';
  }
  return str[0].toUpperCase() + str.substring(1);
}
// Copyright (c) 2023, 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.

import 'dart:io';

import 'package:code_assets/code_assets.dart';
import 'package:data_assets/data_assets.dart';
import 'package:hooks/hooks.dart';
import 'package:logging/logging.dart';
import 'package:native_test_helpers/native_test_helpers.dart';
import 'package:test/test.dart';

const keepTempKey = 'KEEP_TEMPORARY_DIRECTORIES';

Future<void> inTempDir(
  Future<void> Function(Uri tempUri) fun, {
  String? prefix,
  bool keepTemp = false,
}) async {
  final tempDir = await Directory.systemTemp.createTemp(prefix);
  // Deal with Windows temp folder aliases.
  final tempUri = Directory(
    await tempDir.resolveSymbolicLinks(),
  ).uri.normalizePath();
  try {
    await fun(tempUri);
  } finally {
    if ((!Platform.environment.containsKey(keepTempKey) ||
            Platform.environment[keepTempKey]!.isEmpty) &&
        !keepTemp) {
      try {
        await tempDir.delete(recursive: true);
      } on FileSystemException {
        // On Windows, the temp dir might still be locked even though all
        // process invocations have finished.
        if (!Platform.isWindows) rethrow;
      }
    } else {
      print('$keepTempKey $tempUri');
    }
  }
}

Uri packageUri = findPackageRoot('hooks');

/// Archiver provided by the environment.
///
/// Provided on Dart CI.
final Uri? _ar = Platform.environment['DART_HOOK_TESTING_C_COMPILER__AR']
    ?.asFileUri();

/// Compiler


,
	"De",
	"Debnath",
	"Dei",
	"dela Cruz",
	"Delgado",
	"Dembele",
	"Demir",
	"Deng",
	"Devi",
	"Dey",
	"Di",
	"Diallo",
	"Diarra",
	"Dias",
	"Diaz",
	"Din",
	"Ding",
	"Dinh",
	"Diop",
	"Dlamini",
	"do Nascimento",
	"Do",
	"Doan",
	"Domingos",
	"Dominguez",
	"Dong",
	"dos Santos",
	"Dou",
	"Du",
	"Duan",
	"Duarte",
	"Dube",
	"Duong",
	"Duran",
	"Dutta",
	"Edwards",
	"Ei",
	"Elias",
	"Emmanuel",
	"Escobar",
	"Espinosa",
	"Espinoza",
	"Estrada",
	"Evans",
	"Eze",
	"Fan",
	"Fang",
	"Farah",
	"Farooq",
	"Fatima",
	"Fei",
	"Felix",
	"Feng",
	"Fernandes",
	"Fernandez",
	"Fernando",
	"Ferreira",
	"Figueroa",
	"Fischer",
	"Flores",
	"Fofana",
	"Fonseca",
	"Francis",
	"Francisco",
	"Franco",
	"Freitas",
	"Fu",
	"Fuentes",
	"Gabriel",
	"Gamal",
	"Gan",
	"Gao",
	"Garba",
	"Garcia",
	"Gayakwad",
	"Ge",
	"Geng",
	"George",
	"Getachew",
	"Ghosh",
	"Ghulam",
	"Gil",
	"Giri",
	"Girma",
	"Gogoi",
	"Gomes",
	"Gomez",
	"Gonçalves",
	"Gong",
	"Gonzales",
	"Gonzalez",
	"Gou",
	"Green",
	"Gu",
	"Guan",
	"Guerra",
	"Guerrero",
	"Guevara",
	"Gul",
	"Guo",
	"Gupta",
	"Gutierrez",
	"Guzman",
	"Ha",
	"Habib",
	"Hadi",
	"Haider",
	"Hailu",
	"Haji",
	"Halder",
	"Hall",
	"Hamad",
	"Hamed",
	"Hameed",
	"Hamid",
	"Hamza",
	"Han",
	"Hansen",
	"Hao",
	"Haque",
	"Harris",
	"Haruna",
	"Hasan",
	"Hassan",
	"Hayashi",
	"Hayat",
	"He",
	"Henrique",
	"Hernandez",
	"Herrera",
	"Hidayat",
	"Hill",
	"Hnin",
	"Ho",
	"Hoang",
	"Hong",
	"Hoque",
	"Hosen",
	"Hossain",
	"Hosseini",
	"Hossen",
	"Hou",
	"Hu",
	"Hua",
	"Huang",
	"Hughes",
	"Huo",
	"Husain",
	"Hussain",
	"Hussein",
	"Huynh",
	"Hwang",
	"I",
	"Ibarra",
	"Ibrahim",
	"Idris",
	"Ilunga",
	"Im",
	"Imran",
	"Inoue",
	"Iqbal",


line: 24, column: 25}},
					},
				})
			})

			t.Run("does not consider non-type definitions", func(t *testing.T) {
				ExpectSDLErrors(t, `
        query Foo { __typename }
        fragment Foo on Query { __typename }
        directive @Foo on QUERY

        type Query {
          foo: Foo
        }
      `)([]Err{
					{
						message:   `Unknown type "Foo".`,
						locations: []Loc{{line: 7, column: 16}},
					},
				})
			})

			t.Run("reference standard types inside extension document", func(t *testing.T) {
				schema := BuildSchema("type Foo")
				sdl := `
        type SomeType {
          string: String
          int: Int
          float: Float
          boolean: Boolean
          id: ID
          introspectionType: __EnumValue
        }
      `

				ExpectValidSDL(t, sdl, schema)
			})

			t.Run("reference types inside extension document", func(t *testing.T) {
				schema := BuildSchema("type Foo")
				sdl := `
        type QueryRoot {
          foo: Foo
          bar: Bar
        }

        scalar Bar

        schema {
          query: QueryRoot
        }
      `

				ExpectValidSDL(t, sdl, schema)
			})

			t.Run("unknown type references inside extension document", func(t *testing.T) {
				schema := BuildSchema("type A")
				sdl := `
        type B

        type SomeObject implements C {
          e(d: D): E
        }

        union SomeUnion = F | G

        interface SomeInterface {
          i(h: H): I
        }

        input SomeInput {
          j: J
        }

        directive @SomeDirective(k: K) on QUERY

        schema {
          query: L
          mutation: M
          subscription: N
        }
      `

				ExpectSDLErrors(t, sdl, schema)([]Err{
					{
						message:   `Unknown type "C". Did you mean "A" or "B"?`,
						locations: []Loc{{line: 4, column: 36}},
					},
					{
						message:   `Unknown type "D". Did you mean "A", "B", or "ID"?`,
						locations: []Loc{{line: 5, column: 16}},
					},
					{
						message:   `Unknown type "E". Did you mean "A" or "B"?`,
						locations: []Loc{{line: 5, column: 20}},
					},
					{
						message:   `Unknown type "F". Did you mean "A" or "B"?`,
						locations: []Loc{{line: 8, column: 27}},
					},
					{
						message:   `Unknown type "G". Did you mean "A" or "B"?`,
						locations: []Loc{{line: 8, column: 31}},
					},
					{
						message:   `Unknown type "H". Did you mean "A" or "B"?`,
						locations: []Loc{{line: 11, column: 16}},
					},
					{
						message:   `Unknown type "I". Did you mean "A", "B", or "ID"?`,
						locations: []Loc{{line: 11, column: 20}},
					},
					{
						message:   `Unknown type "J". Did you mean "A" or "B"?`,
						locations: []Loc{{line: 15, column: 14}},
					},
					{
						message:   `Unknown type "K". Did you mean "A" or "B"?`,
						locations: []Loc{{line: 18, column: 37}},
					},
					{
						message:   `Unknown type "L". Did you mean "A" or "B"?`,
						locations: []Loc{{line: 21, column: 18}},
					},
					{
						message:   `Unknown type "M". Did you mean "A" or "B"?`,
						locations: []Loc{{line: 22, column: 21}},
					},
					{
						message:   `Unknown type "N". Did you mean "A" or "B"?`,
						location


1.1.1.2.2.cmml">G</mi><mn id="A2.T5.27.27.25.1.m1.1.1.2.3" mathsize="90%" xref="A2.T5.27.27.25.1.m1.1.1.2.3.cmml">9</mn></msub><mo id="A2.T5.27.27.25.1.m1.1.1.1" xref="A2.T5.27.27.25.1.m1.1.1.1.cmml"></mo><mi id="A2.T5.27.27.25.1.m1.1.1.3" mathsize="90%" xref="A2.T5.27.27.25.1.m1.1.1.3.cmml">B</mi></mrow><annotation-xml encoding="MathML-Content" id="A2.T5.27.27.25.1.m1.1b"><apply id="A2.T5.27.27.25.1.m1.1.1.cmml" xref="A2.T5.27.27.25.1.m1.1.1"><times id="A2.T5.27.27.25.1.m1.1.1.1.cmml" xref="A2.T5.27.27.25.1.m1.1.1.1"></times><apply id="A2.T5.27.27.25.1.m1.1.1.2.cmml" xref="A2.T5.27.27.25.1.m1.1.1.2"><csymbol cd="ambiguous" id="A2.T5.27.27.25.1.m1.1.1.2.1.cmml" xref="A2.T5.27.27.25.1.m1.1.1.2">subscript</csymbol><ci id="A2.T5.27.27.25.1.m1.1.1.2.2.cmml" xref="A2.T5.27.27.25.1.m1.1.1.2.2">𝐺</ci><cn id="A2.T5.27.27.25.1.m1.1.1.2.3.cmml" type="integer" xref="A2.T5.27.27.25.1.m1.1.1.2.3">9</cn></apply><ci id="A2.T5.27.27.25.1.m1.1.1.3.cmml" xref="A2.T5.27.27.25.1.m1.1.1.3">𝐵</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="A2.T5.27.27.25.1.m1.1c">G_{9}B</annotation><annotation encoding="application/x-llamapun" id="A2.T5.27.27.25.1.m1.1d">italic_G start_POSTSUBSCRIPT 9 end_POSTSUBSCRIPT italic_B</annotation></semantics></math>

     74.85
<td class="ltx_td ltx_align_center" id="A2.T5.27.27.25.3" style="pa


close();
			return;
		}
		super.onBackPressed();
	}

	/**
	 * @description: 刷新风景数据
	 * @author: chenshiqiang E-mail:csqwyyx@163.com
	 */
	public void refreshScenenrys(){
		//异步加载风景
		new CsqBackgroundTask<List<Scenery>>(this) {
			@Override
			protected List<Scenery> onRun() {
				// TODO Auto-generated method stub
				return SceneryDb.getInstance().queryScenerys(extra_track_id);
			}

			@Override
			protected void onResult(List<Scenery> result) {
				// TODO Auto-generated method stub
				scenerysLoaded(result);
			}
		}.start();
	}
	/**
	 * @description: 风景列表加载回调
	 * @author: chenshiqiang E-mail:csqwyyx@163.com
	 * @param ss
	 */
	public void scenerysLoaded(List<Scenery> ss){
		synchronized (this) {
			this.scenerys = ss;
			adapter.notifyDataSetChanged();
		}

		int curPageIndex = extra_scenery_index;
		if(curPageIndex < 0){
			curPageIndex = 0;
		}
		if(curPageIndex > scenerys.size()){
			curPageIndex = scenerys.size() - 1;
		}

		vDetailDrawer.updateTrack(extra_track_id);

		final int to = curPageIndex;
		vpMedie.post(new Runnable() {
			@Override
			public void run() {
				// TODO Auto-generated method stub
				vpMedie.setCurrentItem(to);
				pageChanged();
			}
		});

	}

	@Override
	protected void releaseResources() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		// TODO Auto-generated method stub
		super.onConfigurationChanged(newConfig);
	}

	// --------------------- Methods public ----------------------

	// --------------------- Methods private ---------------------

	private int lastPageIndex = 0;
	protected void pageChanged(){
		if(scenerys == null){
			return;
		}

		//先暂停上一个展示的页面
		View last = vpMedie.findViewWithTag("" + lastPageIndex);
		if(last != null){
			((ScenenryItemView)last).onHide();
		}
		int newPage = vpMedie.getCurrentItem();
		//再播放这一个展示的页面
		View thisView = vpMedie.findViewWithTag("" + newPage);
		if(thisView != null){
			((ScenenryItemView)thisView).onShow();
		}

		tvIndex.setText((newPage+1) + " / " + scenerys.size());

		vDetailDrawer.updateScenerys(scenerys, newPage);

		lastPageIndex = newPage;

	}

	public void onEventMainThread(EventSceneryUpdated event){
		scenerys.set(lastPageIndex, event.scenery);
		vDetailDrawer.updateScenery(event.scenery);
	}

	// --------------------- Getter & Setter ---------------------

	// --------------- Inner and Anonymous Classes ---------------

	private List<SoftReference<ScenenryImageItemView>> imageCache
		= new LinkedList<SoftReference<ScenenryImageItemView>>();

	private List<SoftReference<ScenenryVideoItemView>> videoCache
		= new LinkedList<SoftReference<ScenenryVideoItemView>>();

	private class SceneryPagerAdapter extends PagerAdapter{
		public SceneryPagerAdapter(){
		}

		@Override
		public int getCount() {
			// TODO Auto-generated method stub
			if(scenerys != null){
				return scenerys.size();
			}
			return 0;
		}

		public Sc


gelir.

Maliyet Verimliliği: Maliyetleri düşürmek için üretim programlarını ve kaynak tahsisini optimize edin.

AI ve ML, geçmiş verileri, talep tahminlerini ve gerçek zamanlı üretim koşullarını analiz ederek üretim programlarını optimize etmeyi sağlar. Bu veri odaklı yaklaşım, iş yüklerini dengelemeye, boş süreleri azaltmaya ve kaynakların etkili bir şekilde tahsis edilmesini sağlamaya yardımcı olur. Örneğin, AI en verimli makine kullanımını önerebilir, üreticilerin enerji tüketimini ve hammadde israfını en aza indirmesine yardımcı olur. ML algoritmaları verilerden sürekli öğrenir, işletme maliyetlerini düşüren, genel üretkenliği artıran ve işletmelerin maliyet duyarlı bir pazarda rekabetçi kalmasına yardımcı olan üretim programı ayarlamaları yapar. Daha iyi planlama ve kaynak yönetimi ile üreticiler aşırı üretimden ve gereksiz stok biriktirmekten de kaçınabilir.

Veri Odaklı Kararlar: Daha akıllı, daha stratejik karar verme için veri içgörülerinden yararlanın.

AI ve ML, birden çok kaynaktan gelen büyük miktarda veriyi analiz ederek üreticilerin daha bilinçli kararlar almasını sağlar. Bu, üretim hatlarından, envanter yönetim sistemlerinden, tedarik zincirlerinden ve hatta müşteri geri bildirimlerinden gelen verileri içerir. AI, performans trendleri hakkında gerçek zamanlı içgörüler sağlayabilir, üretimdeki darboğazları belirleyebilir ve iş akışlarında iyileştirmeler önerebilir. Bu içgörüleri kullanarak, üreticiler envanter yönetiminden ekipman yükseltmelerine ve süreç iyileştirmelerine kadar her konuda stratejik kararlar alabilir. Ayrıca, bu veri odaklı yaklaşım, işletmelerin zorlukları ortaya çıkmadan önce öngörmesini, tedarik zinciri yönetimini iyileştirmesini ve uzun vadeli stratejileri geliştirmesini sağlayarak genel operasyonel verimliliği ve karlılığı artırır.

Bu teknolojiler gelişmeye devam ederken, üreticilerin rekabette öne çıkmak için AI ve ML çözümlerine yatırım yapma zamanı şimdi. Otomasyon ve veri odaklı karar vermeyi benimseyerek, üreticiler yeni büyüme fırsatlarının kilidini açabilir, operasyonları düzenleyebilir ve müşterileri için daha fazla değer yaratabilir. Üretim süreçlerinizi geliştirmeye ve inovasyonu yönlendirmeye hazırsanız, size yardımcı olmak için buradayız.

Ekibimiz,


Classname(classname: string, tree: FileNode)
    {
        var nameFound = false;
        var type = classname;

        if (classname.startsWith("\\")) {
            // Assume FQN already
            nameFound = true;
        } else {
            // Check if we are "use"ing this class
            for (var i = 0, l = tree.namespaceUsings.length; i < l; i++) {
                var item = tree.namespaceUsings[i];

                if (
                    item.name.endsWith("\\" + classname)
                    || item.alias == classname
                ) {
                    // Class found, add namespace to name (handling alias)
                    type = item.name;
                    nameFound = true;
                    break;
                }
            }

            if (!nameFound && tree.namespaces.length > 0) {
                type = "\\" + tree.namespaces[0].name + "\\" + classname;
            }
        }

        return type;
    }
}
import cloneDeep from 'lodash/cloneDeep';
import reduce from 'lodash/reduce';
import { netlify } from '@helpers/network-provider';
import { AxiosResponse } from 'axios';
import { Post } from '../typings/Post';
import { RootState } from '../typings/RootState';

export const simpleStore = ((state: RootState) => ({
    state,

    getTotalDislikes(): number {
        return reduce(
            this.state.posts,
            (counter: number, post: Post) => counter + post.dislikes,
            0
        );
    },

    async loadLivePosts(): Promise<void> {
        const { data }: AxiosResponse<Post[]> = await netlify({
            url: '/posts-31'
        });

        this.state.posts = [
            ...this.state.posts,
            ...data,
        ];
    },

    increasePostDislikes(id: string): void {
        const target = this.state.posts.find((post: Post) => post.id === id);

        if (!target) {
            return;
        }

        target.dislikes += 1;
    }
}))(cloneDeep(window.__INITIAL_STATE__) as RootState)
import { RateLimiter, RateLimiterOptions, KeyMapper } from './index';
const expect = require('expect.js');

describe('Rate Limiter', () => {
    describe('Using default limits and ip keyMapper', () => {
        const keyMapper:KeyMapper = (req) => req.ip;
        const limiter = new RateLimiter({ keyMapper });
        beforeEach(() => {
            limiter.start();
        });
        afterEach(() => {
            limiter.stop();
        });
        it(`should reject req after being made ${RateLimiter.DEFAULT_REQUESTS_LIMIT} inside ${RateLimiter.DEFAULT_TIME_WINDOW}ms time window`, () => {
            const req = {
                ip: '1.1.1.1',
            };
            Array.from(Array(RateLimiter.DEFAULT_REQUESTS_LIMIT)).forEach(() => limiter.isValid(req));
            expect(limiter.isValid(req)).not.to.be.ok();
        });
        it(`should accept req which has reached limit after ${RateLimiter.DEFAULT_TIME_WINDOW}ms time window`, () => {
            const req = {
                ip: '1.1.1.1',
            };
            Array.from(Array(RateLimiter.DEFAULT_REQUESTS_LIMIT)).forEach(() => limiter.isValid(req));
            setTimeout(() => {
                expect(limiter.isValid(req)).to.be.ok();
            }, RateLimiter.DEFAULT_TIME_WINDOW);
        });
        it(`should accept req which has reached limit after a reset all inside time window`, () => {
            const req = {
                ip: '1.1.1.1',


t = UIManager.StageHeight;
                this.scenes[i].onStageResize();
            }
            for (let i = 0; i < this.dialogs.length; i++) {
                this.dialogs[i].width = UIManager.StageWidth;
                this.dialogs[i].height = UIManager.StageHeight;
                this.dialogs[i].onStageResize();
            }
            for (let i = 0; i < this.groupStory.numChildren; ++i) {
                let item = this.groupStory.getChildAt(i);
                if (item instanceof UI) {
                    item.width = UIManager.StageWidth;
                    item.height = UIManager.StageHeight;
                    item.onStageResize();
                }
            }
        }

        public openWaitingUI() {
            if (this.netLoadingUI == null) {
                this.netLoadingUI = new NetLoading();
            }
            if (++this.netLoadingCount == 1) {
                this.addChild(this.netLoadingUI);
            }
        }

        public closeWaitingUI() {
            if (this.netLoadingCount <= 0) {
                console.warn("关闭loading次数过多");
                return;
            }

            if (--this.netLoadingCount == 0) {
                this.removeChild(this.netLoadingUI);
                // 加事件
            }
        }

        public isOpendWaitingUI() {
            return this.netLoadingCount > 0;
        }
        public removeTweenAll() {
            this.toastGroup.removeChildren();
            egret.Tween.removeAllTweens();
        }
        // private toastPos: egret.Point = new egret.Point();
        public toast(msg: string): void {
            if (msg == "请等待片刻(19909)" || msg == "游戏服务通用错误码(10000)") {
                return;
            }
            let toastUI = new ToastUI(msg);
            toastUI.horizontalCenter = "0";
            this.toastGroup.addChild(toastUI);
            this.toastGroup.bottom = UIManager.StageHeight / 2 + 30;
            toastUI.onStart();

            // let content: eui.Label = new eui.Label();
            // let back: eui.Image = new eui.Image("toast_backround_png");
            // let backW = 688;
            // let backH = 65;
            // let toast: eui.Group = new eui.Group();
            // toast.width = UIManager.StageWidth;
            // toast.height = backH;
            // toast.addChild(back);
            // toast.addChild(content);
            // toast.touchEnabled = false;
            // toast.touchChildren = false;

            // content.fontFamily = 'Microsoft Yahei'; //
            // content.size = 24;
            // content.height = 36;
            // content.width = toast.width;
            // content.lineSpacing = 8;
            // content.verticalAlign = "middle";
            // content.textAlign = egret.HorizontalAlign.CENTER;
            // content.textFlow = Util.RichText(msg);
            // // content.horizontalCenter = UIManager.StageWidth / 4;
            // content.x = toast.width / 4;
            // content.verticalCenter = "0";
            // egret.Tween.get(content)
            //     .to({ x: 0 }, 200, egret.Ease.sineOut)
            //     .call(()=>{
            //         egret.Tween.removeTweens(content);
            //         content.horizontalCenter = "0";
            //     });

            // // back.horizontalCenter = -UIManager.StageWidth / 4;
            // back.x = toast.width / 4 - back


Server Side Template Injectionできちゃうので…)

----

<!-- Page 49 -->
![const express = require('express');const \_ = require('lodash');const escapeHTML = require('escape-html');const app = express();app.get('/', (req, res) => \{  res.set('Content-Type', 'text/html');  const name = req.query.name  // Create a template from user input  const compiled = \_.template("Hello " + escapeHTML(name) + ".");  res.status(200).send(compiled());\});module.exports = app;](https://efcl.info/wp-content/uploads/2019/template-engine-security/49.png)

実装はこのような単純なものです。

が

----

<!-- Page 50 -->
![lodash.template + Server Side Template Injec7on•色々使い方がおかしい•ユーザー入力からテンプレートを作成してしまってる•lodash.templateは任意のJavaScriptコードを実行できる•Remote Code Execu9onが可能](https://efcl.info/wp-content/uploads/2019/template-engine-security/50.png)

しかし、`lodash.template` を使っているのに、`escapeHTML(name)` して結果をテンプレートにしています。

つまり、ユーザー入力からテンプレートを生成しています。

`lodash.template`は実質ただのJavaScriptなので、サーバーサイドで任意のコード実行ができます。

----

<!-- Page 51 -->
![h"ps://server-side-lodash-template-injec5on.azu.now.sh/?name=$\{JSON.stringify(process.env)\}注意: 今は修正されたものをデプロイしてあります](https://efcl.info/wp-content/uploads/2019/template-engine-security/51.png)

> <https://server-side-lodash-template-injection.azu.now.sh/?name=${JSON.stringify(process.env)}>

このようにNode.jsを動かしてる`process.env`の内容を出力することができてしまいます。

----

<!-- Page 52 -->
![lodash.template + Server Side Template Injec7on•\_.template("Hello $\{JSON.stringify(process.env)\}.");•process.env を返してくれる•Fix: ユーザー入力からテンプレートを作成しない•fix: fix server side template injec5on by azu · Pull Request #1 · azu/server-side-lodash-template-injec5on•テンプレートとデータモデルは分ける•ユーザー入力はデータモデル(パラメータ)に移動する](https://efcl.info/wp-content/uploads/2019/template-engine-security/52.png)

修正方法は単純です。

ユーザー入力からテンプレートを生成しないようにすることです。

何度も行ってますが、テンプレートとデータはきちんと分けて扱うようにします。

----

<!-- Page 53 -->
![FIX: lodash.template + Server Side Template Injec:onconst express = require('express');const \_ = require('lodash');const app = express();app.get('/', (req, res) => \{  res.set('Content-Type', 'text/html');  const


x000f < (op1 & 0x000f) + (op2 & 0x000f));
        Flag::C.set(flags, 0x00ff < (op1 & 0x00ff) + (op2 & 0x00ff));

        // Finish
        None
    }
}

pub mod and {
    use super::*;

    pub fn start(mut inst: Instruction, cpu: &mut Cpu) -> Option<Instruction> {
        // Check opcode
        match inst.opcode {
            0xa6 => {
                // Read (HL)
                let op2 = cpu.readbyte();
                inst.stack.push(op2);
                inst.exec = done;
                Some(inst)
            }
            0xe6 => {
                // Fetch d8
                let op2 = cpu.fetchbyte();
                inst.stack.push(op2);
                inst.exec = done;
                Some(inst)
            }
            0xa0..=0xa7 => {
                // Prepare op2
                let op2 = helpers::get_op8(cpu, inst.opcode & 0x07);
                inst.stack.push(op2);
                done(inst, cpu)
            }
            _ => panic!("Illegal instruction."),
        }
    }

    pub fn done(mut inst: Instruction, cpu: &mut Cpu) -> Option<Instruction> {
        // Execute AND
        let acc = *cpu.regs.a;
        let op2 = inst.stack.pop().unwrap();
        let res = acc.bitand(op2);
        *cpu.regs.a = res;

        // Set flags
        let flags = &mut cpu.regs.f;
        Flag::Z.set(flags, res == 0);
        Flag::N.set(flags, false);
        Flag::H.set(flags, true);
        Flag::C.set(flags, false);

        // Finish
        None
    }
}

pub mod bit {
    use super::*;

    pub fn start(mut inst: Instruction, cpu: &mut Cpu) -> Option<Instruction> {
        // Check opcode
        match inst.opcode {
            0x46 | 0x4e | 0x56 | 0x5e | 0x66 | 0x6e | 0x76 | 0x7e => {
                // Read (HL)
                let op2 = cpu.readbyte();
                inst.stack.push(op2);
                inst.exec = done;
                Some(inst)
            }
            0x40..=0x7f => {
                // Prepare op2
                let op2 = helpers::get_op8(cpu, inst.opcode & 0x07);
                inst.stack.push(op2);
                done(inst, cpu)
            }
            _ => panic!("Illegal instruction."),
        }
    }

    pub fn done(mut inst: Instruction, cpu: &mut Cpu) -> Option<Instruction> {
        // Execute BIT
        let op1 = (inst.opcode & 0x38) >> 3;
        let op2 = inst.stack.pop().unwrap();
        let res = (0b1 << op1) & op2;

        // Set flags
        let flags = &mut cpu.regs.f;
        Flag::Z.set(flags, res == 0);
        Flag::N.set(flags, false);
        Flag::H.set(flags, true);

        // Finish
        None
    }
}

pub mod call {
    use super::*;

    pub fn start(mut inst: Instruction, cpu: &mut Cpu) -> Option<Instruction> {
        // Check opcode
        match inst.opcode {
            0xc4 | 0xcc | 0xcd | 0xd4 | 0xdc => {
                // Fetch u16
                let op1 = cpu.fetchword();
                inst.stack.extend(op1.to_le_bytes());
                // Proceed
                inst.exec = evaluate;
                Some(inst)
            }
            _ => panic!("Illegal instruction."),
        }
    }

    pub fn evaluate(mut inst: Instruction, cpu: &mut Cpu) -> Option<Instruction> {


ursor: default;
  }
  .system-status-report__status-title:hover,
  .system-status-report__status-title:focus {
    text-decoration: none;
  }
  [dir="rtl"] .system-status-report__status-title {
    float: right;
  }
  html.js .system-status-report__status-title::-webkit-details-marker {
    display: none;
  }
  .collapse-processed > .system-status-report__status-title:before {
    position: relative;
    top: 3px;
  }
  .system-status-report__entry__value {
    display: block;
    float: right;
    width: calc(100% - 23em);
    padding-top: 1em;
    padding-left: 0; /* LTR */
  }
  [dir="rtl"] .system-status-report__entry__value {
    padding-right: 3em;
    padding-left: 0;
  }
}
/*
 * DO NOT EDIT THIS FILE.
 * See the following change record for more information,
 * https://www.drupal.org/node/2815083
 * @preserve
 */

/**
 * @file
 * Styles for Tour theme.
 */

/* Default styles for the container */

.joyride-tip-guide {
  color: #fff;
  border-radius: 5px;
  background: #000;
  background: rgba(0, 0, 0, 0.8);
}

/* Mobile */

@media only screen and (max-width: 767px) {
  .joyride-tip-guide {
    border-radius: 0;
  }
}

/* Add a little css triangle pip, older browser just miss out on the fanciness of it. */

.joyride-tip-guide .joyride-nub {
  border: solid 14px rgba(0, 0, 0, 0.8);
}

.joyride-tip-guide .joyride-nub.top {
  border-top-color: transparent;
  border-right-color: transparent;
  border-left-color: transparent;
}

.joyride-tip-guide .joyride-nub.bottom {
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-left-color: transparent;
}

.joyride-tip-guide .joyride-nub.right {
  border-top-color: transparent;
  border-right-color: transparent; /* LTR */
  border-bottom-color: transparent;
}

[dir="rtl"] .joyride-tip-guide .joyride-nub.right {
  border-right-color: rgba(0, 0, 0, 0.8);
  border-left-color: transparent;
}

.joyride-tip-guide .joyride-nub.left {
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-left-color: transparent; /* LTR */
}

[dir="rtl"] .joyride-tip-guide .joyride-nub.left {
  border-right-color: transparent;
  border-left-color: rgba(0, 0, 0, 0.8);
}

.joyride-tip-guide .joyride-nub.top-right {
  border-top-color: transparent;
  border-right-color: transparent;
  border-left-color: transparent;
}

/* Typography */

.joyride-tip-guide h2 {
  color: #fff;
}

.joyride-tip-guide p {
  line-height: 1.385em;
}

.joyride-tip-guide a {
  color: #fff;
}

/* Button Style */

.joyride-tip-guide .joyride-next-tip {
  margin: 0;
}

.joyride-timer-indicator-wrap {
  border: solid 1px rgba(255, 255, 255, 0.1);
}

.joyride-timer-indicator {
  background: rgba(255, 255, 255, 0.25);
}

.joyride-close-tip {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.4


room_id, broadcast=True,
                    include_self=False, namespace='/ws')
                continue

            users_in_room = utils.get_users_in_room(room_id).copy()
            for user_id_in_room, _ in users_in_room.items():
                if user_id_in_room in admins_in_room:
                    continue
                environ.env.emit(
                    'gn_user_joined', join_activity, room=user_id_in_room, broadcast=True,
                    include_self=False, namespace='/ws')

            for admin_id in admins_in_room:
                environ.env.emit(
                    'gn_user_visible', visible_activity, room=admin_id, broadcast=False, namespace='/ws')

@environ.env.observer.on('on_status')
def _on_status_set_status(arg: tuple) -> None:
    OnStatusHooks.set_status(arg)


from rest_framework import viewsets, mixins, response, status as s
from rest_framework.filters import SearchFilter, OrderingFilter
from .serializers import TaskListSerializer, TaskSerializer, AttachmentSerializer
from .models import Task, TaskList, Attachment, COMPLETE,NOT_COMPLETE
from rest_framework.decorators import action
from .permissions import IsAllowedToEditTaskListElseNone, IsAllowedToEditTaskElseNone, IsAllowedToEditAttachmentElseNone
from django.utils import timezone
from django_filters.rest_framework import DjangoFilterBackend

class TaskListViewSet(
        viewsets.GenericViewSet,
        mixins.CreateModelMixin,
        mixins.UpdateModelMixin,
        mixins.RetrieveModelMixin,
        mixins.DestroyModelMixin,
        #mixins.ListModelMixin
    ):
    permission_classes = [IsAllowedToEditTaskListElseNone]
    queryset = TaskList.objects.all()
    serializer_class = TaskListSerializer

class TaskViewSet(viewsets.ModelViewSet):
    permission_classes = [IsAllowedToEditTaskElseNone]
    queryset = Task.objects.all()
    serializer_class = TaskSerializer
    filter_backends = [SearchFilter, DjangoFilterBackend, OrderingFilter]
    search_fields = ['name', 'description',]
    filterset_fields = ['status',]
    ordering_fields = ['created_on', 'name']

    def get_queryset(self):
        queryset = super(TaskViewSet, self).get_queryset()
        user_profile = self.request.user.profile
        updated_queryset = queryset.filter(created_by=user_profile)
        return updated_queryset

    @action(detail=True, methods=['PATCH'], name='Update Task Status')
    def update_task_status(self, request, pk=None):
        try:
            task = self.get_object()
            profile = request.user.profile
            status = request.data['status']
            if status == NOT_COMPLETE:
                if task.status == COMPLETE:
                    task.status = NOT_COMPLETE
                    task.completed_on = None
                    task.completed_by = None
                else:
                    raise Exception('Task is already marked as not complete')
            elif status == COMPLETE:
                if task.status == NOT_COMPLETE:
                    task.status = COMPLETE
                    task.completed_on = timezone.now()
                    task.completed_by = profile
                else:
                    raise Exception('Task is already marked as not complete')
            else:
                raise Exception('Incorrec status provided')

            task.save
            serializer = TaskSerializer(instance=task, context={'request': request})
            return response.Response(serializer.data, status=s.HTTP_200_OK)
        except Exception as e:
            return response.Response({'detail': str(e)}, status=s.HTTP_400_BAD_REQUEST)

class AttachmentViewSet(
        viewsets.GenericViewSet,
        mixins.CreateModelMixin,
        mixins.UpdateModelMixin,
        mixins.RetrieveModelMixin,
        mixins.DestroyModelMixin,
        #mixins.ListModelMixin,
    ):
    permission_classes = [IsAllowedToEditAttachmentElseNone]
    queryset = Attachment.objects.all()
    serializer_class = AttachmentSerializer


 {
		return fmt.Errorf("could not decode pssmsg")
	}
	if asymmetric {
		if p.pubKeyRWPool[keyid] == nil {
			return fmt.Errorf("handle called on nil MsgReadWriter for key " + keyid)
		}
		vrw = p.pubKeyRWPool[keyid].(*PssReadWriter)
	} else {
		if p.symKeyRWPool[keyid] == nil {
			return fmt.Errorf("handle called on nil MsgReadWriter for key " + keyid)
		}
		vrw = p.symKeyRWPool[keyid].(*PssReadWriter)
	}
	vrw.injectMsg(pmsg)
	return nil
}

// check if (peer) symmetric key is currently registered with this topic
func (p *Protocol) isActiveSymKey(key string, topic Topic) bool {
	return p.symKeyRWPool[key] != nil
}

// check if (peer) asymmetric key is currently registered with this topic
func (p *Protocol) isActiveAsymKey(key string, topic Topic) bool {
	return p.pubKeyRWPool[key] != nil
}

// Creates a serialized (non-buffered) version of a p2p.Msg, used in the specialized internal p2p.MsgReadwriter implementations
func ToP2pMsg(msg []byte) (p2p.Msg, error) {
	payload := &ProtocolMsg{}
	if err := rlp.DecodeBytes(msg, payload); err != nil {
		return p2p.Msg{}, fmt.Errorf("pss protocol handler unable to decode payload as p2p message: %v", err)
	}

	return p2p.Msg{
		Code:       payload.Code,
		Size:       uint32(len(payload.Payload)),
		ReceivedAt: time.Now(),
		Payload:    bytes.NewBuffer(payload.Payload),
	}, nil
}

// Runs an emulated pss Protocol on the specified peer,
// linked to a specific topic
// `key` and `asymmetric` specifies what encryption key
// to link the peer to.
// The key must exist in the pss store prior to adding the peer.
func (p *Protocol) AddPeer(peer *p2p.Peer, topic Topic, asymmetric bool, key string) (p2p.MsgReadWriter, error) {
	rw := &PssReadWriter{
		Pss:   p.Pss,
		rw:    make(chan p2p.Msg),
		spec:  p.spec,
		topic: p.topic,
		key:   key,
	}
	if asymmetric {
		rw.sendFunc = p.Pss.SendAsym
	} else {
		rw.sendFunc = p.Pss.SendSym
	}
	if asymmetric {
		if !p.Pss.isPubKeyStored(key) {
			return nil, fmt.Errorf("asym key does not exist: %s", key)
		}
		p.RWPoolMu.Lock()
		p.pubKeyRWPool[key] = rw
		p.RWPoolMu.Unlock()
	} else {
		if !p.Pss.isSymKeyStored(key) {
			return nil, fmt.Errorf("symkey does not exist: %s", key)
		}
		p.RWPoolMu.Lock()
		p.symKeyRWPool[key] = rw
		p.RWPoolMu.Unlock()
	}
	go func() {
		err := p.proto.Run(peer, rw)
		log.Warn(fmt.Sprintf("pss vprotocol quit on %v topic %v: %v", peer, topic, err))
	}()
	return rw, nil
}

func (p *Protocol) RemovePeer(asymmetric bool, key string) {
	log.Debug("closing pss peer", "asym", asymmetric, "key", key)
	p.RWPoolMu.Lock()
	defer p.RWPoolMu.Unlock()
	if asymmetric {
		rw := p.pubKeyRWPool[key].(*PssReadWriter)
		rw.closed = true
		delete(p.pubKeyRWPool, key)
	} else {
		rw := p.symKeyRWPool[key].(*PssReadWriter)
		rw.closed = true
		delete(p.symKeyRWPool, key)
	}
}

// Uniform translation of protocol specifiers to topic
func ProtocolTopic(spec *protocol


     -- AH Window Initialization Events
    elseif showType == Enum.PlayerInteractionType.Auctioneer then
      self:AuctionHouseShown()
    elseif showType == Enum.PlayerInteractionType.ProfessionsCustomerOrder then
      Auctionator.CraftingInfo.InitializeCustomerOrdersFrame()
    end
  elseif event == "TRADE_SKILL_SHOW" then
    Auctionator.CraftingInfo.InitializeProfessionsFrame()
  end
end

function AuctionatorInitializeMainlineMixin:AuctionHouseShown()
  Auctionator.Debug.Message("AuctionatorInitializeMainlineMixin:AuctionHouseShown()")

  -- Avoids a lot of errors if this is loaded in a classic client
  if AuctionHouseFrame == nil then
    return
  end

  Auctionator.AH.Initialize()

  if Auctionator.State.AuctionatorFrame == nil then
    Auctionator.State.AuctionatorFrame = CreateFrame("FRAME", "AuctionatorAHFrame", AuctionHouseFrame, "AuctionatorAHFrameTemplate")
  end
end


able bad blocks: $reachableBadBlocksAndMessages" }
    extendedCexModel.setReachableBadBlocks(reachableBadBlocks)
    cexModel.setReachableBadBlocks(reachableBadBlocks)
    val mainDotMarked =
        markBadBlocksInDot(codeMap.dotMain, reachableBadBlocks, codeMap.edges, extendedCexModel)
    val subDotsMarked = codeMap.subDots.mapValues {
        markBadBlocksInDot(
            it.value,
            reachableBadBlocks,
            codeMap.edges,
            extendedCexModel
        )
    }

    val codemap = codeMap.copy(
        dotMain = mainDotMarked,
        subDots = subDotsMarked,
        cexModel = extendedCexModel
    )
    codemap.showSubsetInCodeText.addAll(codeMap.translateWithInternalFuncs(extendedCexModel.reachableNBIds))

    return codemap

}

fun addCounterexampleData(cexModel: CounterexampleModel, codeMap: CodeMap): CodeMap =
    when(cexModel) {
        is SMTCounterexampleModel -> addCounterexampleData(cexModel, codeMap)
        is CounterexampleModel.Empty -> codeMap
    }

fun addDifficultyInfo(codeMap: CodeMap, results: Verifier.JoinedResult): CodeMap {
    val difficultyInfo: ProcessDifficultiesResult = results.difficultyInfo ?: return codeMap

    logger.trace { "Got difficulty information $difficultyInfo" }

    // we scale difficulties because it comes up in the numerator, and if it's small, divided by deltaScale we get truncation
    // e.g., if difficulties are 0-7, and here the range of colors is of size 6, then deltaScale is 1.
    // It means that max difficulty maps to color 7, beyond the range of colors.
    // if we scale all difficulties by 1000, then deltaScale is 1166, and max difficulty maps to normalized 6, which is correct max.
    fun BigInteger.scale() = this.multiply(BigInteger.valueOf(1000))

    val lightest = DotColor.plum1
    val darkest = DotColor.purple4
    val minDifficulty = difficultyInfo.minDifficulty()?.scale() ?: BigInteger.ZERO
    val maxDifficulty = difficultyInfo.maxDifficulty()?.scale() ?: BigInteger.ZERO
    val deltaScale = (maxDifficulty - minDifficulty).divide((darkest.ordinal-lightest.ordinal).toBigInteger())
    fun computeColor(nodeId: String): DotColor {
        if (deltaScale == BigInteger.ZERO) {
            return DotColor.purple1
        }
        val difficulty = difficultyInfo.getBlockDifficulty(nodeId)?.scale()
        return if (difficulty == null) {
            DotColor.white
        } else {
            val normalized = ((difficulty - minDifficulty)/deltaScale).toInt()
            DotColor.entries.find { it.ordinal == lightest.ordinal + normalized }
                ?: throw IllegalStateException("Given $difficulty in range [${minDifficulty},${maxDifficulty}] and scale ${deltaScale}, " +
                        "normalized value should have been $normalized and be between ${lightest.ordinal} and ${darkest.ordinal}")
        }
    }
    fun updateDifficulty(dot: DotDigraph): DotDigraph {
        return dot.copy(nodes = dot.nodes
            .map { n ->
                n.copy(fillcolor = DotColorList(computeColor(n.id.id)), styles = listOf(DotStyle.filled))
            }
        )
    }
    return codeMap.copy(
        dotMain = updateDifficulty(codeMap.dotMain),
        subDots = codeMap.subDots.mapValues { updateDifficulty(it.value) }
    )
}

private fun TACCmd.Simple.AnnotationCmd.eventId(): Int? {
    val (k, v) = this.annot
    return when {
        k == CVL_LABEL_START -> this.meta[CVL_LABEL_START_ID]
        v is SnippetCmd.CVLSnippetCmd.EventI


	Name: "aws_location_tracker",
		F:    sweepTrackers,
	})

	resource.AddTestSweepers("aws_location_tracker_association", &resource.Sweeper{
		Name: "aws_location_tracker_association",
		F:    sweepTrackerAssociations,
	})
}

func sweepGeofenceCollections(region string) error {
	ctx := sweep.Context(region)
	client, err := sweep.SharedRegionalSweepClient(ctx, region)

	if err != nil {
		return fmt.Errorf("getting client: %w", err)
	}

	conn := client.LocationClient(ctx)
	input := &location.ListGeofenceCollectionsInput{}
	sweepResources := make([]sweep.Sweepable, 0)

	pages := location.NewListGeofenceCollectionsPaginator(conn, input)
	for pages.HasMorePages() {
		page, err := pages.NextPage(ctx)

		if awsv2.SkipSweepError(err) {
			log.Printf("[WARN] Skipping Location Service Geofence Collection sweep for %s: %s", region, err)
			return nil
		}

		if err != nil {
			return fmt.Errorf("error listing Location Service Geofence Collection for %s: %w", region, err)
		}

		for _, entry := range page.Entries {
			r := ResourceGeofenceCollection()
			d := r.Data(nil)

			id := aws.ToString(entry.CollectionName)
			d.SetId(id)

			sweepResources = append(sweepResources, sweep.NewSweepResource(r, d, client))
		}
	}

	if err := sweep.SweepOrchestrator(ctx, sweepResources); err != nil {
		return fmt.Errorf("error sweeping Location Service Geofence Collection for %s: %w", region, err)
	}

	return nil
}

func sweepMaps(region string) error {
	ctx := sweep.Context(region)
	client, err := sweep.SharedRegionalSweepClient(ctx, region)

	if err != nil {
		return fmt.Errorf("getting client: %w", err)
	}

	conn := client.LocationClient(ctx)

	input := &location.ListMapsInput{}
	sweepResources := make([]sweep.Sweepable, 0)

	pages := location.NewListMapsPaginator(conn, input)
	for pages.HasMorePages() {
		page, err := pages.NextPage(ctx)

		if awsv2.SkipSweepError(err) {
			log.Printf("[WARN] Skipping Location Service Map sweep for %s: %s", region, err)
			return nil
		}

		if err != nil {
			return fmt.Errorf("error listing Location Service Map for %s: %w", region, err)
		}

		for _, entry := range page.Entries {
			r := ResourceMap()
			d := r.Data(nil)

			id := aws.ToString(entry.MapName)
			d.SetId(id)

			sweepResources = append(sweepResources, sweep.NewSweepResource(r, d, client))
		}
	}

	if err := sweep.SweepOrchestrator(ctx, sweepResources); err != nil {
		return fmt.Errorf("error sweeping Location Service Map for %s: %w", region, err)
	}

	return nil
}

func sweepPlaceIndexes(region string) error {
	ctx := sweep.Context(region)
	client, err := sweep.SharedRegionalSweepClient(ctx, region)

	if err != nil {
		return fmt.Errorf("getting client: %w", err)
	}

	conn := client.LocationClient(ctx)

	input := &location.ListPlaceIndexesInput{}
	sweepResources := make([]sweep.Sweepable, 0)


 UI pixel shader"           ));
        add3DBlitShaderToMap(GL_RED_INTEGER,     true,  d3d11::CompilePS(device, g_PS_PassthroughR3DI,       "Blit11 3D R I pixel shader"            ));
        add3DBlitShaderToMap(GL_ALPHA,           false, d3d11::CompilePS(device, g_PS_PassthroughRGBA3D,     "Blit11 3D alpha pixel shader"          ));
        add3DBlitShaderToMap(GL_LUMINANCE,       false, d3d11::CompilePS(device, g_PS_PassthroughLum3D,      "Blit11 3D luminance pixel shader"      ));
        add3DBlitShaderToMap(GL_LUMINANCE_ALPHA, false, d3d11::CompilePS(device, g_PS_PassthroughLumAlpha3D, "Blit11 3D luminance alpha pixel shader"));
    }

    // Swizzling shaders (OpenGL ES 3+)
    if (mRenderer->isES3Capable())
    {
        addSwizzleShaderToMap(GL_FLOAT,        D3D_SRV_DIMENSION_TEXTURE2D,      d3d11::CompilePS(device, g_PS_SwizzleF2D,       "Blit11 2D F swizzle pixel shader" ));
        addSwizzleShaderToMap(GL_UNSIGNED_INT, D3D_SRV_DIMENSION_TEXTURE2D,      d3d11::CompilePS(device, g_PS_SwizzleUI2D,      "Blit11 2D UI swizzle pixel shader"));
        addSwizzleShaderToMap(GL_INT,          D3D_SRV_DIMENSION_TEXTURE2D,      d3d11::CompilePS(device, g_PS_SwizzleI2D,       "Blit11 2D I swizzle pixel shader" ));

        addSwizzleShaderToMap(GL_FLOAT,        D3D_SRV_DIMENSION_TEXTURECUBE,    d3d11::CompilePS(device, g_PS_SwizzleF2DArray,  "Blit11 2D Cube F swizzle pixel shader" ));
        addSwizzleShaderToMap(GL_UNSIGNED_INT, D3D_SRV_DIMENSION_TEXTURECUBE,    d3d11::CompilePS(device, g_PS_SwizzleUI2DArray, "Blit11 2D Cube UI swizzle pixel shader"));
        addSwizzleShaderToMap(GL_INT,          D3D_SRV_DIMENSION_TEXTURECUBE,    d3d11::CompilePS(device, g_PS_SwizzleI2DArray,  "Blit11 2D Cube I swizzle pixel shader" ));

        addSwizzleShaderToMap(GL_FLOAT,        D3D_SRV_DIMENSION_TEXTURE3D,      d3d11::CompilePS(device, g_PS_SwizzleF3D,       "Blit11 3D F swizzle pixel shader" ));
        addSwizzleShaderToMap(GL_UNSIGNED_INT, D3D_SRV_DIMENSION_TEXTURE3D,      d3d11::CompilePS(device, g_PS_SwizzleUI3D,      "Blit11 3D UI swizzle pixel shader"));
        addSwizzleShaderToMap(GL_INT,          D3D_SRV_DIMENSION_TEXTURE3D,      d3d11::CompilePS(device, g_PS_SwizzleI3D,       "Blit11 3D I swizzle pixel shader" ));

        addSwizzleShaderToMap(GL_FLOAT,        D3D_SRV_DIMENSION_TEXTURE2DARRAY, d3d11::CompilePS(device, g_PS_SwizzleF2DArray,  "Blit11 2D Array F swizzle pixel shader" ));
        addSwizzleShaderToMap(GL_UNSIGNED_INT, D3D_SRV_DIMENSION_TEXTURE2DARRAY, d3d11::CompilePS(device, g_PS_SwizzleUI2DArray, "Blit11 2D Array UI swizzle pixel shader"));
        addSwizzleShaderToMap(GL_INT,          D3D_SRV_DIMENSION_TEXTURE2DARRAY, d3d11::CompilePS(device, g_PS_SwizzleI2DArray,  "Blit11 2D Array I swizzle pixel shader" ));
    }
}

void Blit11::clearShaderMap()
{
    for (BlitShaderMap::iterator i = mBlitShaderMap.begin(); i != mBlitShaderMap.end(); ++i)


t>[
      ui.Offset.zero,
      ui.Offset(10, 10),
      ui.Offset(0, 20),
    ],
    textureCoordinates: const <ui.Offset>[
      ui.Offset.zero,
      ui.Offset(10, 10),
      ui.Offset(0, 20),
    ],
    colors: const <ui.Color>[
      ui.Color.fromRGBO(255, 0, 0, 1.0),
      ui.Color.fromRGBO(0, 255, 0, 1.0),
      ui.Color.fromRGBO(0, 0, 255, 1.0),
    ],
    indices: <int>[0, 1, 2],
  );
}

const List<double> _circularVertices = <double>[
  14.530723571777344,
  18.18381690979004,
  14.530723571777344,
  18.624177932739258,
  14.538220405578613,
  18.40399742126465,
  14.445072174072266,
  17.765277862548828,
  14.445072174072266,
  19.04271697998047,
  14.282388687133789,
  17.38067626953125,
  14.282388687133789,
  19.427318572998047,
  14.051292419433594,
  17.038639068603516,
  14.051292419433594,
  19.76935577392578,
  13.76040267944336,
  16.747783660888672,
  13.76040267944336,
  20.06021499633789,
  13.418340682983398,
  16.5167236328125,
  13.418340682983398,
  20.291275024414062,
  13.033727645874023,
  20.45391845703125,
  13.03372573852539,
  16.354080200195312,
  12.615180015563965,
  20.539527893066406,
  12.6151762008667,
  16.268470764160156,
  12.395000457763672,
  20.547000885009766,
  12.394994735717773,
  16.260997772216797,
  12.394994735717773,
  20.546998977661133,
  12.174847602844238,
  16.268516540527344,
  12.174847602844238,
  20.539480209350586,
  11.75637149810791,
  16.354188919067383,
  11.75637149810791,
  20.45380973815918,
  11.371832847595215,
  16.516868591308594,
  11.371832847595215,
  20.291126251220703,
  11.029844284057617,
  16.747943878173828,
  11.029844284057617,
  20.06005096435547,
  10.739023208618164,
  17.038795471191406,
  10.739023208618164,
  19.76919937133789,
  10.507984161376953,
  17.380809783935547,
  10.507984161376953,
  19.427188873291016,
  10.345342636108398,
  17.765365600585938,
  10.345342636108398,
  19.042633056640625,
  10.259716033935547,
  18.183849334716797,
  10.259716033935547,
  18.6241455078125,
  10.25222110748291,
  18.40399742126465,
];

const List<int> _circularVertexIndices = <int>[
  0,
  1,
  2,
  3,
  1,
  0,
  3,
  4,
  1,
  5,
  4,
  3,
  5,
  6,
  4,
  7,
  6,
  5,
  7,
  8,
  6,
  9,
  8,
  7,
  9,
  10,
  8,
  11,
  10,
  9,
  11,
  12,
  10,
  11,
  13,
  12,
  14,
  13,
  11,
  14,
  15,
  13,
  16,
  15,
  14,
  16,
  17,
  15,
  18,


    // application context
    Fld1Fstp_a();

    // make sure the values were changed by the tool test_iarg_partial_context - since that tool
    // an IARG_PARTIAL_CONTEXT that writes the fp-stack
    if (var1 != 0.0 || var2 != 0.0 || var3 != 0.0)
    {
        printf ("***Error in x87 values_1 var1 %f var2 %f var3 %f\n", var1, var2, var3);
       return (-1);
    }

    var1=2.0;
    var2=2.0;
    var3=2.0;

    // the test_iarg_partial_context tool will insert a call to an analysis routine
    // that changes the fp-stack contents and specifies to write it back to the
    // application context
    Fld1Fstp_b();

    // make sure the values were changed by the tool test_iarg_partial_context - since that tool
    // an IARG_PARTIAL_CONTEXT that writes the fp-stack
   if (var1 != 0.0 || var2 != 0.0 || var3 != 0.0)
    {
        printf ("***Error in x87 values_2 var1 %f var2 %f var3 %f\n", var1, var2, var3 );
       return (-1);
    }

    var1=2.0;
    var2=2.0;
    var3=2.0;

    // the test_iarg_partial_context tool will insert a call to an analysis routine
    // that changes the fp-stack contents and specifies to write it back to the
    // application context
    Fld1Fstp_c();

    // make sure the values were changed by the tool test_iarg_partial_context - since that tool
    // an IARG_PARTIAL_CONTEXT that writes the fp-stack
    if (var1 != 0.0 || var2 != 0.0 || var3 != 0.0)
    {
        printf ("***Error in x87 values_3\n");
       return (-1);
    }

    xmm_reg_t xmm_regs[NUM_XMM_SCRATCH_REGS];
    for (UINT32 i=0; i<NUM_XMM_SCRATCH_REGS; i++)
    {
       xmm_regs[i].dword[0] = xmm_regs[i].dword[1] = xmm_regs[i].dword[2] = xmm_regs[i].dword[3] = 0;
    }
    for (UINT32 i=0; i<NUM_XMM_SCRATCH_REGS; i++)
    {
        write_xmm_reg(i, 0xdeadbeef);
    }
    for (UINT32 i=0; i<NUM_XMM_SCRATCH_REGS; i++)
    {
        read_xmm_reg(i, xmm_regs[i]);
    }
    for (UINT32 i=0; i<NUM_XMM_SCRATCH_REGS; i++)
    {
        if (!(xmm_regs[i].dword[0]==0xdeadbeef && xmm_regs[i].dword[1]==0xdeadbeef &&
            xmm_regs[i].dword[2]==0xdeadbeef && xmm_regs[i].dword[3]==0xdeadbeef))
        {
            printf ("***Error in initializing xmm regs\n");
            return (-1);
        }
    }
    for (UINT32 i=0; i<NUM_XMM_SCRATCH_REGS; i++)
    {
        write_xmm_reg(i, 0xdeadbeef);
    }

    // the test_iarg_partial_context tool will insert a call to an analysis routine
    // after the third fld1 in Fld1Fstp that adds values to the xmm registers
    Fld1Fstp_e();

    // make sure the values were changed by the tool test_iarg_partial_


//
//     Generated by class-dump 3.5 (64 bit) (Debug version compiled Jul  5 2017 23:13:50).
//
//     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//

#import "WAJSEventHandler_BaseEvent.h"

#import "ABNewPersonViewControllerDelegate-Protocol.h"
#import "ABPeoplePickerNavigationControllerDelegate-Protocol.h"
#import "CNContactPickerDelegate-Protocol.h"
#import "CNContactViewControllerDelegate-Protocol.h"
#import "WCActionSheetDelegate-Protocol.h"

@class NSDictionary, NSString;

@interface WAJSEventHandler_addPhoneContact : WAJSEventHandler_BaseEvent <WCActionSheetDelegate, CNContactViewControllerDelegate, CNContactPickerDelegate, ABPeoplePickerNavigationControllerDelegate, ABNewPersonViewControllerDelegate>
{
    NSDictionary *_contact;
}

@property(retain, nonatomic) NSDictionary *contact; // @synthesize contact=_contact;
- (void).cxx_destruct;
- (void)openNewPersonViewController:(id)arg1 shouldContinueAfterSelectingPerson:(void *)arg2;
- (void)peoplePickerNavigationControllerDidCancel:(id)arg1;
- (void)peoplePickerNavigationController:(id)arg1 didSelectPerson:(void *)arg2 property:(int)arg3 identifier:(int)arg4;
- (void)peoplePickerNavigationController:(id)arg1 didSelectPerson:(void *)arg2;
- (_Bool)peoplePickerNavigationController:(id)arg1 shouldContinueAfterSelectingPerson:(void *)arg2 property:(int)arg3 identifier:(int)arg4;
- (_Bool)peoplePickerNavigationController:(id)arg1 shouldContinueAfterSelectingPerson:(void *)arg2;
- (void)newPersonViewController:(id)arg1 didCompleteWithNewPerson:(const void *)arg2;
- (void)contactPicker:(id)arg1 didSelectContact:(id)arg2;
- (void)contactPickerDidCancel:(id)arg1;
- (void)contactViewController:(id)arg1 didCompleteWithContact:(id)arg2;
- (void)copyToContact:(id)arg1;
- (void)copyToRecord:(void *)arg1;
- (void)createNewContact;
- (void)addToExistContact;
- (void)actionSheet:(id)arg1 clickedButtonAtIndex:(long long)arg2;
- (void)handleJSEvent:(id)arg1;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end


chString.getBytes(Charsets.UTF_8));

		Bundle input = new Bundle();
		input.setType(Bundle.BundleType.TRANSACTION);
		input.addEntry()
			.setFullUrl(pid1.getValue())
			.setResource(patch)
			.getRequest().setUrl(pid1.getValue());

		Bundle putBundle = new Bundle();
		putBundle.setType(Bundle.BundleType.TRANSACTION);
		putBundle.addEntry()
			.setFullUrl(pid1.getValue())
			.setResource(new Patient().setId(pid1.getIdPart()))
			.getRequest().setUrl(pid1.getValue()).setMethod(HTTPVerb.PUT);

		Bundle bundle = ourClient.transaction().withBundle(input).execute();
		ourLog.debug("Response: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));

		//Validate over all bundle response entry contents.
		assertEquals(Bundle.BundleType.TRANSACTIONRESPONSE, bundle.getType());
		assertThat(bundle.getEntry()).hasSize(1);
		Bundle.BundleEntryResponseComponent response = bundle.getEntry().get(0).getResponse();
		assertEquals("200 OK", response.getStatus());
		assertNotNull(response.getEtag());
		assertNotNull(response.getLastModified());
		assertEquals(pid1.getValue() + "/_history/2", response.getLocation());

		Patient newPt = ourClient.read().resource(Patient.class).withId(pid1.getIdPart()).execute();
		assertEquals("2", newPt.getIdElement().getVersionIdPart());
		assertFalse(newPt.getActive());
	}

	@Test
	public void testTransactionWithGetHardLimitLargeSynchronous() {
		List<String> ids = create20Patients();

		Bundle input = new Bundle();
		input.setType(BundleType.TRANSACTION);
		input
			.addEntry()
			.getRequest()
			.setMethod(HTTPVerb.GET)
			.setUrl("Patient?_count=5&_sort=_id");

		myStorageSettings.setMaximumSearchResultCountInTransaction(100);

		Bundle output = ourClient.transaction().withBundle(input).execute();
		ourLog.debug(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));

		assertThat(output.getEntry()).hasSize(1);
		Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
		assertThat(respBundle.getEntry()).hasSize(5);
		assertNull(respBundle.getLink("next"));
		List<String> actualIds = toIds(respBundle);
		assertThat(actualIds).containsExactly(ids.subList(0, 5).toArray(new String[0]));
	}

	@Test
	public void testTransactionWithGetNormalSearch() {
		List<String> ids = create20Patients();

		Bundle input = new Bundle();
		input.setType(BundleType.TRANSACTION);
		input
			.addEntry()
			.getRequest()
			.setMethod(HTTPVerb.GET)
			.setUrl("Patient?_count=5&_sort=name");

		Bundle output = ourClient.transaction().withBundle(input).execute();
		ourLog.debug(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));

		assertThat(output.getEntry()).hasSize(1);
		Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
		assertThat(respBundle.getEntry()).hasSize(5);
		List<String> actualIds = toIds(respBundle);
		assertThat(actualIds).containsExactly(ids.subList(0, 5).toArray(new String[0]));

		String nextPageLink = respBundle.getLink("next").getUrl();
		output = ourClient.loadPage().byUrl(nextPageLink).andReturnBundle(Bundle.class).execute();
		respBundle = output;
		assertThat(respBundle.getEntry()).hasSize(5);


test_counter === NUM_TESTS) {
    SimpleTest.finish();
  }
}

// ----------------------------------------------------------------------------
// Test 1: window.open(http:)
var httpWin = window.open("file_triggeringprincipal_window_open.html", "_blank", "width=10,height=10");
httpWin.onload = function() {
  var httpChannel = SpecialPowers.wrap(httpWin).docShell.currentDocumentChannel;
  var httpTriggeringPrincipal = httpChannel.loadInfo.triggeringPrincipal.URI.asciiSpec;
  var httpLoadingPrincipal = httpChannel.loadInfo.loadingPrincipal;

  is(httpTriggeringPrincipal.split("?")[0], TRIGGERING_PRINCIPAL_URI,
     "TriggeringPrincipal for window.open(http:) should be the principal of the document");

  is(httpWin.document.referrer.split("?")[0], TRIGGERING_PRINCIPAL_URI,
     "Referrer for window.open(http:) should be the principal of the document");

  is(httpLoadingPrincipal, null,
     "LoadingPrincipal for window.open(http:) should be null");

  httpWin.close();
  checkFinish();
};

// ----------------------------------------------------------------------------
// Test 2: window.open(javascript:)
var jsWin = window.open("javascript:'js';", "_blank", "width=10,height=10");
jsWin.onload = function() {
  var jsChannel = SpecialPowers.wrap(jsWin).docShell.currentDocumentChannel;
  var jsTriggeringPrincipal = jsChannel.loadInfo.triggeringPrincipal.URI.asciiSpec;
  var jsLoadingPrincipal = jsChannel.loadInfo.loadingPrincipal;

  is(jsTriggeringPrincipal.split("?")[0], TRIGGERING_PRINCIPAL_URI,
     "TriggeringPrincipal for window.open(javascript:) should be the principal of the document");

  is(jsWin.document.referrer, "",
     "Referrer for window.open(javascript:) should be empty");

  is(jsLoadingPrincipal, null,
     "LoadingPrincipal for window.open(javascript:) should be null");

  jsWin.close();
  checkFinish();
};

</script>

<!DOCTYPE html>

    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />


min = MIFXMINP;
        // mifxmax = MIFXMAXP;
        mifymin = MIFYMINP;
        mifymax = MIFYMAXP;
        mifdx = DXMIFP;
        mifdy = DYMIFP;
        devwidth = DXMIFP;
        devwidthmm = (int)(DXMIFP / 1000.0 * 25.4);
        devheight = DYMIFP;
        devheightmm = (int)(DYMIFP / 1000.0 * 25.4);
        mifticl = TICLP;
        fprintf(mifout, "<MIFFile 2.00> # %s\n", version);
        fprintf(mifout, "<Units Uin>\n");
        break;
    case 2:
    case 4:
        stroke();
        fprintf(mifout, "<Group <ID 1>>\n");
        /*	fprintf(mifout,">\n");*/
        fclose(mifout);
        if (!ptofile)
        {
            sprintf(sysbuf, "%s %s", mif_prstr, fname);
            system(sysbuf);
            unlink(fname);
        }
        // orientflag = 0 /*PORTRAIT*/;
        break;
    }
    return mode;
}

void drawmif(int x2, int y2, int mode)
{
    int xtmp, ytmp;

    if (x2 < 0 || y2 < 0) /* Eliminate garbage on output */
        return;

    xtmp = x2;
    ytmp = y2;

    if (mode) /* draw */
    {
        if (pathlength == MAXLINELEN)
        {
            stroke();
            xpoints[0] = xpoints[MAXLINELEN - 1];
            ypoints[0] = ypoints[MAXLINELEN - 1];
        }
    } /* moveto */
    else
    {
        /* Avoid excessive moveto's generated by grtool */
        if (xtmp == x_current && ytmp == y_current)
            return;
        stroke();
        pathlength = 0;
    }
    xpoints[pathlength] = xtmp;
    ypoints[pathlength++] = ytmp;
    x_current = xtmp;
    y_current = ytmp;
}

int xconvmif(double x)
{
    return ((int)(mifxmin + mifdx * xconv(x)));
}

int yconvmif(double y)
{
    return ((int)(mifymin + mifdy * yconv(y)));
}

int mifsetcolor(int c)
{
    if (c != mifcolor)
    {
        stroke();
        if ((mifcolor = c) > MAXCOLOR)
        {
            mifcolor = 1;
        }
        else if (mifcolor < MINCOLOR)
        {
            mifcolor = 1;
        }
    }
    return c;
}

int mifsetlinewidth(int c)
{
    if (c != miflinewidth)
    {
        stroke();
        if ((c = c % MAXLINEWIDTH) < MINLINEWIDTH)
            c = MINLINEWIDTH;
    }
    miflinewidth = c;
    return c;
}

void mifdrawtic(int x, int y, int dir, int updown)
{
    switch (dir)
    {
    case 0:
        switch (updown)
        {
        case 0:
            drawmif(x, y, 0);
            drawmif(x, y + devxticl, 1);
            break;
        case 1:
            drawmif(x, y, 0);
            drawmif(x, y - devxticl, 1);
            break;
        }
        break;
    case 1:
        switch (updown)
        {
        case 0:
            drawmif(x, y,


hmac::Hmac, mac::Mac, sha1::Sha1};
use http_client::{HttpClient, HttpRequest, Params};
use hyper::header::HeaderValue;
use url::Url;

use std::{collections::BTreeMap, str::FromStr};

use crate::{
    auth::canonicalized_resource,
    statics::{CONTENT_MD5, CONTENT_TYPE, OSS_CANONICALIZED_PREFIX},
    types::{Region, Request, Result, Schema},
    Response,
};

#[derive(Debug)]
pub struct OSSClient<C: HttpClient> {
    client: C,
    region: Region,
    access_key_id: String,
    access_key_secret: String,
    bucket: Option<String>,
    schema: Schema,
}

impl<C: HttpClient> OSSClient<C> {
    pub fn new<'a, R, S, B, S1, S2>(
        client: C,
        region: R,
        schema: S,
        bucket: B,
        access_key_id: S1,
        access_key_secret: S2,
    ) -> Self
    where
        R: AsRef<str>,
        S: Into<Option<&'a str>>,
        B: Into<Option<&'a str>>,
        S1: Into<String>,
        S2: Into<String>,
    {
        OSSClient {
            client,
            region: region.as_ref().parse().unwrap_or_default(),
            schema: schema
                .into()
                .and_then(|_schema| _schema.parse().ok())
                .unwrap_or_default(),
            bucket: bucket.into().map(|bucket| bucket.to_string()),
            access_key_id: access_key_id.into(),
            access_key_secret: access_key_secret.into(),
        }
    }
    pub fn get_bucket(&self) -> Option<&str> {
        self.bucket.as_ref().map(String::as_str)
    }
    pub fn get_signed_url<'a, H>(
        &self,
        object: Option<&str>,
        verb: &str,
        expires: u64,
        params: &Params,
        headers: H,
    ) -> String
    where
        H: Into<Option<BTreeMap<&'a str, &'a str>>>,
    {
        let mut content_type = "";
        let mut content_md5 = "";
        let mut oss_headers_str = String::new();
        if let Some(_headers) = headers.into() {
            for (k, v) in _headers {
                if k.starts_with(OSS_CANONICALIZED_PREFIX) {
                    oss_headers_str += k;
                    oss_headers_str += ":";
                    oss_headers_str += v;
                    oss_headers_str += "\n";
                } else if k == CONTENT_TYPE {
                    content_type = v;
                } else if k == CONTENT_MD5 {
                    content_md5 = v;
                }
            }
        }
        let oss_resource_str = canonicalized_resource(self.get_bucket(), object, params);
        let sign_str = format!(
            "{}\n{}\n{}\n{}\n{}{}",
            verb, content_md5, content_type, expires, oss_headers_str, oss_resource_str
        );
        let mut hasher = Hmac::new(Sha1::new(), self.access_key_secret.as_bytes());
        hasher.input(sign_str.as_bytes());
        let sign_str_base64 = encode(hasher.result().code());

        let auth_params = format!(
            "OSSAccessKeyId={}&Expires={}&


u    $a1, $a1, $t9
/* 02474 80834684 0C20CD8E */  jal     func_80833638
/* 02478 80834688 8CA53EDC */  lw      $a1, %lo(D_80853EDC)($a1)
/* 0247C 8083468C A6000834 */  sh      $zero, 0x0834($s0)         ## 00000834
/* 02480 80834690 A20006AC */  sb      $zero, 0x06AC($s0)         ## 000006AC
/* 02484 80834694 8FA40020 */  lw      $a0, 0x0020($sp)
/* 02488 80834698 0C20C8ED */  jal     func_808323B4
/* 0248C 8083469C 02002825 */  or      $a1, $s0, $zero            ## $a1 = 00000000
/* 02490 808346A0 8E08067C */  lw      $t0, 0x067C($s0)           ## 0000067C
/* 02494 808346A4 2401FEFF */  addiu   $at, $zero, 0xFEFF         ## $at = FFFFFEFF
/* 02498 808346A8 01014824 */  and     $t1, $t0, $at
/* 0249C 808346AC AE09067C */  sw      $t1, 0x067C($s0)           ## 0000067C
/* 024A0 808346B0 8FBF001C */  lw      $ra, 0x001C($sp)
/* 024A4 808346B4 8FB00018 */  lw      $s0, 0x0018($sp)
/* 024A8 808346B8 27BD0020 */  addiu   $sp, $sp, 0x0020           ## $sp = 00000000
/* 024AC 808346BC 03E00008 */  jr      $ra
/* 024B0 808346C0 00000000 */  nop


"""
Classifies: CHEBI:50263 2-hydroxydicarboxylic acid
"""
from rdkit import Chem

def is_2_hydroxydicarboxylic_acid(smiles: str):
    """
    Determines if a molecule is a 2-hydroxydicarboxylic acid based on its SMILES string.
    A 2-hydroxydicarboxylic acid must have two carboxylic acid groups and a hydroxy group
    on the alpha carbon to one of the carboxylic acids.

    Args:
        smiles (str): SMILES string of the molecule

    Returns:
        bool: True if molecule is a 2-hydroxydicarboxylic acid, False otherwise
        str: Reason for classification
    """

    # Parse SMILES
    mol = Chem.MolFromSmiles(smiles)
    if mol is None:
        return False, "Invalid SMILES string"

    # Look for the two carboxylic acid groups
    carboxy_pattern = Chem.MolFromSmarts("C(=O)O")
    carboxy_matches = mol.GetSubstructMatches(carboxy_pattern)
    if len(carboxy_matches) < 2:
        return False, "Less than two carboxylic acid groups found"

    # Look for the hydroxy group on the alpha carbon
    hydroxyl_alpha_carboxy_pattern = Chem.MolFromSmarts("C(O)C(=O)O")
    alpha_oh_matches = mol.GetSubstructMatches(hydroxyl_alpha_carboxy_pattern)
    if not alpha_oh_matches:
        return False, "No hydroxy group found on the alpha carbon to a carboxylic acid group"

    return True, "Contains two carboxylic acid groups and a hydroxy group on the alpha carbon"


ock"
        throw new CustomError(msg, 400)
      }

      // place order
      const sql = `
        INSERT INTO JohnnyOrderLog (time_created, employeeId, skuId, quantity, totalPrice)
        VALUES (now(),	?,	?,	?,	?)
      `;
      const orderResult = await connection.query(sql, [employeeId, skuId, quantity, (item.price * quantity)]);

      // Update product stock
      const skuUpdateQuery = `UPDATE johnnysku SET stock = (? - ?) WHERE id = ?`;
      await connection.query(skuUpdateQuery, [item.stock, quantity, skuId]);

      let paymentInsert, updateOrderwithPayment;
      if(paidInBox) {
        // record payment
        const paymentInsertQuery = `
          INSERT INTO JohnnyPaymentLog (time_created, employeeId, amount)
          VALUES (now(), ?, ?)
        `;
        paymentInsert = await connection.query(paymentInsertQuery, [employeeId, (item.price * quantity)]);

        // update order entry
        const updateOrderQuery = `UPDATE JohnnyOrderLog SET paidInBox = ? WHERE id = ?`;
        updateOrderwithPayment = await connection.query(updateOrderQuery, [paymentInsert.insertId, orderResult.insertId]);

      }

      await connection.query("COMMIT");
      return;

    } catch (err) {
      await connection.query("ROLLBACK");
      throw err;
    } finally {
      await connection.release();
    }
  }
}
import { ApiResource } from "../common/interfaces/serializer";
import { AccountDetails, Caption } from "./account-details.model";

export class AmcAccountHoldingsReq {
  accountNumber: string;
  formatted: boolean = true;
}

export class AmcAccountHoldingsResp extends ApiResource {
  accountHoldings = [];
  amcFunds: AccountDetails[] = [];

  canSwitchAndWithdraw:string;
  reason:string;

  constructor(json: any) {
    super(json);

    let _json = json.data;

    this.canSwitchAndWithdraw=_json.canSwitchAndWithdraw;
    this.reason=_json.reason;

    let accountDetails: AccountDetails[][] = [];
    let captions: Caption[] = [];

    for (var i = 0; i < _json.length; i++) {
      let detailsList: AccountDetails[] = [];
      for (var j = 0; j < _json[i].length; j++) {
        let details = new AccountDetails(_json[i][j]);
        detailsList.push(details);
        if (i == 0) {
          captions.push(details.caption);
        }
      }
      accountDetails.push(detailsList);
    }

    this.accountHoldings.push(accountDetails);
    this.accountHoldings.push(captions);

    //New AccountHolding Response
    if (_json.accountHolding) {
      let funds = _json.accountHolding;

      for (i = 0; i < funds.length; i++) {
        let fund = new AccountDetails(funds[i]);
        this.amcFunds.push(fund);
      }
    }
    //New AccountHolding Response

  }
}

export class AmcAccountHoldingsSerializer {

  toJson(obj: AmcAccountHoldingsReq): any {
    console.log('AmcAccountHoldingsSerializer toJson -> ', obj);
    return {
      accountNumber: obj.accountNumber,
      formatted: obj.formatted
    };
  }

  fromJson(json: any): AmcAccountHoldingsResp {
    console.log('AmcAccountHoldingsSerializer fromJson -> ', json);
    let response = new AmcAccountHoldingsResp(json);
    return response;
  }
}
export type TCreatePaginationProps = {
  pagesLength: number
  onChange: (pages: TPages) => void
  currentPage?: number
}

export type TPages = {
  currentPage: number
  pages: {
    action: string | null
    value: number | string
    isActive?: boolean
  }[]
}

export default function createPagination({ pagesLength = 1, currentPage


s: ["leaves", "roots"],
              },
            },
            interaction: {
              dragNodes: !0,
              dragView: !0,
              hideEdgesOnDrag: !1,
              hideEdgesOnZoom: !1,
              hideNodesOnDrag: !1,
              hover: !1,
              keyboard: {
                enabled: !1,
                speed: {
                  x: [10, 0, 40, 1],
                  y: [10, 0, 40, 1],
                  zoom: [0.02, 0, 0.1, 0.005],
                },
                bindToWindow: !0,
                autoFocus: !0,
              },
              multiselect: !1,
              navigationButtons: !1,
              selectable: !0,
              selectConnectedEdges: !0,
              hoverConnectedEdges: !0,
              tooltipDelay: [300, 0, 1e3, 25],
              zoomView: !0,
              zoomSpeed: [1, 0.1, 2, 0.1],
            },
            manipulation: { enabled: !1, initiallyActive: !1 },
            physics: {
              enabled: !0,
              barnesHut: {
                theta: [0.5, 0.1, 1, 0.05],
                gravitationalConstant: [-2e3, -3e4, 0, 50],
                centralGravity: [0.3, 0, 10, 0.05],
                springLength: [95, 0, 500, 5],
                springConstant: [0.04, 0, 1.2, 0.005],
                damping: [0.09, 0, 1, 0.01],
                avoidOverlap: [0, 0, 1, 0.01],
              },
              forceAtlas2Based: {
                theta: [0.5, 0.1, 1, 0.05],
                gravitationalConstant: [-50, -500, 0, 1],
                centralGravity: [0.01, 0, 1, 0.005],
                springLength: [95, 0, 500, 5],
                springConstant: [0.08, 0, 1.2, 0.005],
                damping: [0.4, 0, 1, 0.01],
                avoidOverlap: [0, 0, 1, 0.01],
              },
              repulsion: {
                centralGravity: [0.2, 0, 10, 0.05],
                springLength: [200, 0, 500, 5],
                springConstant: [0.05, 0, 1.2, 0.005],
                nodeDistance: [100, 0, 500, 5],
                damping: [0.09, 0, 1, 0.01],
              },
              hierarchicalRepulsion: {
                centralGravity: [0.2, 0, 10, 0.05],
                springLength: [100, 0, 500, 5],
                springConstant: [0.01, 0, 1.2, 0.005],
                nodeDistance: [120, 0, 500, 5],
                damping: [0.09, 0, 1, 0.01],
                avoidOverlap: [0, 0, 1, 0.01],
              },
              maxVelocity: [50, 0, 150, 1],
              minVelocity: [0.1, 0.01, 0.5, 0.01],
              solver: [
                "barnesHut",
                "forceAtlas2Based",
                "repulsion",
                "hierarchicalRepulsion",
              ],
              timestep: [0.5, 0.01, 1, 0.01],
              wind: { x: [0, -10, 10, 0.1], y: [0, -10, 10, 0.1] },
            },
          },
          bT = function (t, e, i) {
            var n;
            return !(
              !Nf(t).call(t, "physics") ||
              !Nf((n = mT.physics.solver)).call(n, e) ||
              i.physics.solver === e ||
              "wind" === e
            );
          },
          wT = Object.freeze({
            __proto__: null,
            configuratorHideOption: bT,
            allOptions: yT,
            configureOptions: mT,
          }),
          kT = (function () {
            function t() {
              Yd(this, t);
            }


s.xmlsoap.org/ws/2005/05/identity/claims/givenname"" xmlns:auth=""http://docs.oasis-open.org/wsfed/authorization/200706""><auth:DisplayName>Given Name</auth:DisplayName><auth:Description>The given name of the user</auth:Description></auth:ClaimType><auth:ClaimType Uri=""http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"" xmlns:auth=""http://docs.oasis-open.org/wsfed/authorization/200706""><auth:DisplayName>Name</auth:DisplayName><auth:Description>The unique name of the user</auth:Description></auth:ClaimType><auth:ClaimType Uri=""http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"" xmlns:auth=""http://docs.oasis-open.org/wsfed/authorization/200706""><auth:DisplayName>UPN</auth:DisplayName><auth:Description>The user principal name (UPN) of the user</auth:Description></auth:ClaimType><auth:ClaimType Uri=""http://schemas.xmlsoap.org/claims/CommonName"" xmlns:auth=""http://docs.oasis-open.org/wsfed/authorization/200706""><auth:DisplayName>Common Name</auth:DisplayName><auth:Description>The common name of the user</auth:Description></auth:ClaimType><auth:ClaimType Uri=""http://schemas.xmlsoap.org/claims/EmailAddress"" xmlns:auth=""http://docs.oasis-open.org/wsfed/authorization/200706""><auth:DisplayName>AD FS 1.x E-Mail Address</auth:DisplayName><auth:Description>The e-mail address of the user when interoperating with AD FS 1.1 or ADFS 1.0</auth:Description></auth:ClaimType><auth:ClaimType Uri=""http://schemas.xmlsoap.org/claims/Group"" xmlns:auth=""http://docs.oasis-open.org/wsfed/authorization/200706""><auth:DisplayName>Group</auth:DisplayName><auth:Description>A group that the user is a member of</auth:Description></auth:ClaimType><auth:ClaimType Uri=""http://schemas.xmlsoap.org/claims/UPN"" xmlns:auth=""http://docs.oasis-open.org/wsfed/authorization/200706""><auth:DisplayName>AD FS 1.x UPN</auth:DisplayName><auth:Description>The UPN of the user when interoperating with AD FS 1.1 or ADFS 1.0</auth:Description></auth:ClaimType><auth:ClaimType Uri=""http://schemas.microsoft.com/ws/2008/06/identity/claims/role"" xmlns:auth=""http://docs.oasis-open.org/wsfed/authorization/200706""><auth:DisplayName>Role</auth:DisplayName><auth:Description>A role that the user has</auth:Description></auth:ClaimType><auth:ClaimType Uri=""http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname"" xmlns:auth=""http://docs.oasis-open.org/wsfed/authorization/200706""><auth:DisplayName>Surname</auth:DisplayName><auth:Description>The surname of the user</auth


from torchstat import stat
from torchvision.models import resnet18
from models import SupResNet, SSLResNet, TextNet, VGG_11, DenseNet121, DenseNet169, DenseNet201, VGG_13,VGG_19, VGG_16
model = VGG_19()
stat(model, (3, 224, 224))


%r12]
	setx	0x000000800e4c6d60, %r1, %r12
	setx	0xcb07c9dcc8383e20, %r1, %r13
	stx	%r13, [%r12]
	ldx	[%r9], %r11
	setx	0x38b899a79eb6f37f, %r1, %r10
	cmp	%r10, %r11
	bne h_bad_end
	nop
!	data_array 0 = 0x000000fca8f12fd0 , rd_cntr = 42, wr_cntr = 42
!	data_array 1 = 0x000000c61bf8c728 , rd_cntr = 42, wr_cntr = 42
!	data_array 2 = 0x000000c1d795c2b0 , rd_cntr = 42, wr_cntr = 42
!	data_array 3 = 0x000000f0686b9a80 , rd_cntr = 42, wr_cntr = 42
	setx	0x000000800f4500e8, %r1, %r9
	setx	0x0d8547871e4fb14f, %r1, %r10
	stx	%r10, [%r9]
	setx	0x000000800e2d15f0, %r1, %r12
	setx	0xcb07c9dcc8383e20, %r1, %r13
	stx	%r13, [%r12]
	setx	0x000000800e2d15f0, %r1, %r12
	setx	0xcb07c9dcc8383e20, %r1, %r13
	stx	%r13, [%r12]
	setx	0x000000800f4500e8, %r1, %r12
	ldx	[%r12], %r11
	setx	0x000000c61bf8c728, %r1, %r12
	ldx	[%r12], %r11
	ldx	[%r9], %r11
	setx	0x0d8547871e4fb14f, %r1, %r10
	cmp	%r10, %r11
	bne h_bad_end
	nop
!	data_array 0 = 0x000000fca8f12fd0 , rd_cntr = 43, wr_cntr = 43
!	data_array 1 = 0x000000c61bf8c728 , rd_cntr = 43, wr_cntr = 43
!	data_array 2 = 0x000000800f4500e8 , rd_cntr = 43, wr_cntr = 43
!	data_array 3 = 0x000000f0686b9a80 , rd_cntr = 43, wr_cntr = 43
	setx	0x000000800f6160c8, %r1, %r9
	setx	0x410a96df84355231, %r1, %r10
	stx	%r10, [%r9]
	setx	0x000000fa6d7846d8, %r1, %r12
	setx	0x61d327ab2ddd0360, %r1, %r13
	stx	%r13, [%r12]
	setx	0x000000e4bd5fa388, %r1, %r12
	setx	0xa0a96998313bee65, %r1, %r13
	stx	%r13, [%r12]
	setx	0x000000800f4500e8, %r1, %r12
	ldx	[%r12], %r11
	setx	0x000000c61bf8c728, %r1, %r12
	ldx	[%r12], %r11
	ldx	[%r9], %r11
	setx	0x410a96df84355231, %r1, %r10
	cmp	%r10, %r11
	bne h_bad_end
	nop
!	data_array 0 = 0x000000


=10079F, num-nulls=0
        builder.set(
            "_string",
            BINARY_PREFIX + (INT_MIN_VALUE + i)); // min=BINARY测试_30, max=BINARY测试_79, num-nulls=0
        builder.set("_uuid", RANDOM_UUIDS.get(i)); // required, random uuid, always non-null
        builder.set("_required", "req"); // required, always non-null
        builder.set("_non_bloom", RANDOM_UUIDS.get(i)); // bloom filter not enabled
        builder.set("_all_nulls", null); // never non-null
        builder.set("_some_nulls", (i % 10 == 0) ? null : "some"); // includes some null values
        builder.set("_no_nulls", ""); // optional, but always non-null
        builder.set("_all_nans", Double.NaN); // never non-nan
        builder.set("_some_nans", (i % 10 == 0) ? Float.NaN : 2F); // includes some nan values
        builder.set("_no_nans", 3D); // optional, but always non-nan
        Record structNotNull = new Record(structSchema);
        structNotNull.put("_int_field", INT_MIN_VALUE + i);
        builder.set("_struct_not_null", structNotNull); // struct with int
        builder.set("_no_stats", TOO_LONG_FOR_STATS); // value longer than 4k will produce no stats
        builder.set("_boolean", i % 2 == 0);
        builder.set("_time", INSTANT.plusSeconds(i * 86400).toEpochMilli());
        builder.set("_date", INSTANT.plusSeconds(i * 86400).getEpochSecond());
        builder.set("_timestamp", INSTANT.plusSeconds(i * 86400).toEpochMilli());
        builder.set("_timestamptz", INSTANT.plusSeconds(i * 86400).toEpochMilli());
        builder.set("_binary", RANDOM_BYTES.get(i));
        builder.set("_int_decimal", new BigDecimal(String.valueOf(77.77 + i)));
        builder.set("_long_decimal", new BigDecimal(String.valueOf(88.88 + i)));
        builder.set("_fixed_decimal", new BigDecimal(String.valueOf(99.99 + i)));
        builder.set(compatibleFieldName, new BigDecimal(String.valueOf(77.77 + i)));

        appender.add(builder.build());
      }
    }

    InputFile inFile = Files.localInput(file);

    ParquetFileReader reader = ParquetFileReader.open(ParquetIO.file(inFile));

    assertThat(reader.getRowGroups()).as("Should create only one row group").hasSize(1);
    rowGroupMetadata = reader.getRowGroups().get(0);
    parquetSchema = reader.getFileMetaData().getSchema();
    bloomStore = reader.getBloomFilterDataReader(rowGroupMetadata);
  }

  @Test
  public void testNotNull() {
    boolean shouldRead =
        new ParquetBloomRowGroupFilter(SCHEMA, notNull("all_nulls"))
            .shouldRead(parquetSchema, rowGroupMetadata, bloomStore);
    assertThat(shouldRead).as("Should read: bloom filter doesn't help").isTrue();

    shouldRead =
        new ParquetBloomRowGroupFilter(SCHEMA, notNull("some_nulls"))
            .shouldRead(parquetSchema, rowGroupMetadata, bloomStore);
    assertThat(shouldRead).as("Should read: bloom filter doesn't help").isTrue();

    shouldRead =
        new ParquetBloomRowGroupFilter(SCHEMA, notNull("no_nulls"))
            .shouldRead(parquetSchema, rowGroupMetadata, bloomStore);
    assertThat(shouldRead).as("Should read: bloom filter doesn't help").isTrue();

    shouldRead =
        new ParquetBloomRowGroupFilter(SCHEMA, notNull("struct_not_null.int_field"))
            .shouldRead(parquetSchema, rowGroupMetadata, bloomStore);
    assertThat(shouldRead).as("Should read: bloom filter doesn't help")


te::peering::manager::update_salts_fn(config.drop_neighbors_on_salt_update());
    let delay = iter::repeat(SALT_UPDATE_SECS);
    task_mngr.repeat(f, delay, ctx, "Salt-Update", MAX_SHUTDOWN_PRIORITY);

    let ctx = QueryContext {
        request_mngr: request_mngr.clone(),
        entry_peers: entry_peers.clone(),
        active_peers: active_peers.clone(),
        replacements: replacements.clone(),
        server_tx: server_tx.clone(),
        event_tx: event_tx.clone(),
    };

    // Reverify old peers regularly.
    let f = query::reverify_fn();
    let delay = iter::repeat(BOOTSTRAP_VERIFICATION_DELAY)
        .take(BOOTSTRAP_MAX_VERIFICATIONS.min(active_peers.read().len()))
        .chain(iter::repeat(REVERIFY_INTERVAL_DEFAULT));
    task_mngr.repeat(f, delay, ctx.clone(), "Reverification", MAX_SHUTDOWN_PRIORITY);

    // Discover new peers regularly.
    let f = query::query_fn();
    let delay = iter::once(BOOTSTRAP_QUERY_DELAY).chain(iter::repeat(QUERY_INTERVAL_DEFAULT));
    task_mngr.repeat(f, delay, ctx, "Discovery", MAX_SHUTDOWN_PRIORITY);

    let ctx = UpdateContext {
        local,
        request_mngr,
        active_peers,
        nb_filter,
        outbound_nbh,
        server_tx,
    };

    // Update the outbound neighborhood regularly (interval depends on whether slots available or not).
    let f = update::update_outbound_neighborhood_fn();
    let delay = iter::once(BOOTSTRAP_UPDATE_DELAY).chain(delay::ManualDelayFactory::new(OPEN_OUTBOUND_NBH_UPDATE_SECS));
    task_mngr.repeat(f, delay, ctx, "Outbound neighborhood update", MAX_SHUTDOWN_PRIORITY);

    // Await the shutdown signal (in a separate task).
    tokio::spawn(async move {
        term_signal.await;
        task_mngr.shutdown().await?;
        Ok::<_, S::Error>(())
    });

    log::debug!("Autopeering initialized.");

    Ok(event_rx)
}
// Copyright 2017 The UNIC Project Developers.
//
// See the COPYRIGHT file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::str::FromStr;

use regex::Regex;

use source::utils::read;

pub struct EmojiDataVersion {
    pub major: u8,
    pub minor: u8,
    pub micro: u8,
}

lazy_static! {
    pub static ref EMOJI_VERSION: EmojiDataVersion =
        { read("data/emoji/ReadMe.txt").parse().unwrap() };
}

impl FromStr for EmojiDataVersion {
    type Err = ();

    fn from_str(str: &str) -> Result<Self, Self::Err> {
        lazy_static! {
            static ref REGEX: Regex = Regex::new(r"Unicode Emoji, Version (\d+).(\d+)").unwrap();
        }

        REGEX
            .captures(str)
            .map(|m| EmojiDataVersion {
                major: m[1].parse().unwrap(),
                minor: m[2].parse().unwrap(),
                micro: 0,
            }).ok_or(())
    }
}
<reponame>Eric-Arellano/rust
// run-rustfix

#![warn(clippy::result_map_or_into_option)]

fn main() {
    let opt: Result<u32, &str> = Ok(1);
    let _ = opt.map_or(None, Some);

    let


y entities.
		if ( !pEntity->GetClientNetworkable() )
		{
			m_aDeleteList.AddToTail( hEnt );
			pEntity->SetRemovalFlag( true );
		}
	}
}

void CClientThinkList::RemoveFromDeleteList( ClientEntityHandle_t hEnt )
{
	// Sanity check!
	Assert( hEnt != ClientEntityList().InvalidHandle() );
	if ( hEnt == ClientEntityList().InvalidHandle() )
		return;

	int nSize = m_aDeleteList.Count();
	for ( int iHandle = 0; iHandle < nSize; ++iHandle )
	{
		if ( m_aDeleteList[iHandle] == hEnt )
		{
			m_aDeleteList[iHandle] = ClientEntityList().InvalidHandle();

			C_BaseEntity *pEntity = ClientEntityList().GetBaseEntityFromHandle( hEnt );
			if ( pEntity )
			{
				pEntity->SetRemovalFlag( false );
			}
		}
	}
}

void CClientThinkList::CleanUpDeleteList()
{
	int nThinkCount = m_aDeleteList.Count();
	for ( int iThink = 0; iThink < nThinkCount; ++iThink )
	{
		ClientEntityHandle_t handle = m_aDeleteList[iThink];
		if ( handle != ClientEntityList().InvalidHandle() )
		{
			C_BaseEntity *pEntity = ClientEntityList().GetBaseEntityFromHandle( handle );
			if ( pEntity )
			{
				pEntity->SetRemovalFlag( false );
			}

			IClientThinkable *pThink = ClientEntityList().GetClientThinkableFromHandle( handle );
			if ( pThink )
			{
				pThink->Release();
			}
		}
	}

	m_aDeleteList.RemoveAll();
}

//========= Copyright  1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
//
// text_message.cpp
//
// implementation of CHudTextMessage class
//
// this class routes messages through titles.txt for localisation
//
#include "cbase.h"
#include "text_message.h"
#include "client_textmessage.h"
#include "vgui_controls/controls.h"
#include "vgui/ILocalize.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

//-----------------------------------------------------------------------------
// Purpose: Implements IHudTextMessage
//-----------------------------------------------------------------------------
class CHudTextMessage : public IHudTextMessage
{
public:
	virtual char *LocaliseTextString( const char *msg, char *dst_buffer, int buffer_size );
	virtual char *BufferedLocaliseTextString( const char *msg );
	virtual char *LookupString( const char *msg_name, int *msg_dest = NULL );
};

// Singleton
static CHudTextMessage g_HudTextMessage;
IHudTextMessage *hudtextmessage = &g_HudTextMessage;

//-----------------------------------------------------------------------------
// Purpose:  Searches through the string for any msg names (indicated by a '#')
// any found are looked up in titles.txt and the new message substituted
// the new value is pushed into dst_buffer
// Input  : *msg -
//			*dst_buffer -
//			buffer_size -
// Output : char
//-----------------------------------------------------------------------------
char *CHudTextMessage::LocaliseTextString( const char *msg, char *dst_buffer, int buffer_size )
{
	char *dst = dst_buffer;
	for ( char *src = (char*)msg; *src != 0 && buffer_size > 0; buffer_size-- )
	{
		if ( *src == '#' )
		{
			// cut msg name out of string
			static char word_buf[255];
			char *wdst = word_buf, *word_start = src;
			for (


arance: number;

  /** 攻击前摇 */
  attackDurationBefore: number;
  /** 攻击后摇 */
  attackDurationAfter: number;
}

// export type EUnit = {
//   turnReady: () => void, // 可以攻击
//   dead: () => void, // 死亡
//   beforeDamage: () => void; // 被攻击
// }

export interface EUnit {
  turnReady: () => void; // 可以攻击
  dead: () => void; // 死亡
  beforeDamage: () => void; // 被攻击
}

export class Unit extends SObject {
  ev: Emitter<EUnit>;
  attr = new Attribute<UnitAttr>(this).proxy();
  attack = new UnitAttack(this);

  @observable
  buffs: Buff[] = [];

  /** 是否存活，这个设计不是很好，先暂时使用。注意外部不要乱改 */
  isAlive = false;

  /** 当前动作，TODO: 对是否能施加action做检查 */
  currentAction: Action;

  $mobxDispose = [];

  constructor() {
    super();
    const attr = this.attr;
    attr.hp = 10;
    attr.hpMax = 10;
    attr.attack = 2;
    attr.attackRange = 3;
    attr.defense = 1;
    attr.direction = UnitDirection.Forward;
    attr.friendFlag = FriendFlag.Player;

    // 合并
    attr.$attr.mergeFunc.friendFlag = (a, b) => a | b;
    attr.$attr.enableFactor.friendFlag = false;
    attr.$attr.mergeFunc.direction = (a, b) => a | b;
    attr.$attr.enableFactor.direction = false;

    // HP 为 0 时死亡
    let r = when(
      () => attr.hp == 0,
      () => {
        this.isAlive = false;
        this.ev.emit('dead');
      }
    );
    this.$mobxDispose.push(r);

    this.$mobxDispose.push(arrayAdded(this.buffs as IObservableArray<Buff>, (items, disposer) => {
      items.forEach((item) => {
        ;
      });
    }));

    this.$mobxDispose.push(arrayRemoved(this.buffs as IObservableArray<Buff>, (items, disposer) => {
      items.forEach((item) => {
        ;
      });
    }));

    makeObservable(this);
  }

  /**
   * 造成伤害
   * @param attacker 攻击者
   * @param source 伤害来源，为null则为攻击者普攻
   * @param damage 伤害数值
   */
  doHarm(attacker: Unit, source: object, damage: number) {
    this.attr.hp -= damage - this.attr.defense;
  }

  @computed
  get state() {
    let state: BuffState = 0;
    for (const i of this.buffs) {
      state |= i.state;
    }
    return state;
  }

  dispose() {
    super.dispose()
    for (const dispose of this.$mobxDispose) {
      dispose();
    }
  }
  // 继承
  // ev: Emitter<TEvent>;
  // attr: AttributeProxy<TAttr>;
}
import { ComoUsar } from "./shared/como-usar.model";

export class ComoUsarService {

    public ComoUsar: ComoUsar[] = [
        {
			id: 1,
			descricao: "Não é necessário agendar"
		},
		{
			id: 2,
			descricao: "Válido de segunda a quinta das 12h as 23h"
		},
		{
			id: 3,
			descricao: "Não é necessário agendar"
		},
		{
			id: 4,
			descricao: "Necessário agendar com no mínimo 48 horas de antecedência"
		},
		{
			id: 5,
			descricao: "Válido de segunda a sábado das 12h as 23h. Necessário agendamento prévio"
		},
		{
			"id": 6,
			"descricao": "Não é necessário agendar. Sujeito à fi


Progress"]
  FASTCALL1 TOSTRING R9 [+2]
  GETIMPORT R8 K14 [tostring]
  CALL R8 1 1
  NAMECALL R6 R6 K15 ["format"]
  CALL R6 2 1
  FASTCALL1 GETMETATABLE R5 [+3]
  MOVE R8 R5
  GETIMPORT R7 K17 [getmetatable]
  CALL


        if (count > 1)
                {
                    Minion mnn = null;
                    if (triggerEffectMinion.entitiyID != tmp[0].entitiyID) mnn = tmp[0];
                    else mnn = tmp[1];

                    for (int i = 1; i < count; i++)
                    {
                        if (triggerEffectMinion.entitiyID == tmp[i].entitiyID) continue;
                        if (tmp[i].Hp < mnn.Hp) mnn = tmp[i]; //take the weakest
                    }
                    if (mnn != null) p.minionGetBuffed(mnn, 2, 2);
                }
            }

        }
    }
}


<img alt="" src="https://upload.thwiki.cc/thumb/6/65/%E5%8D%8E%E7%AC%A6%E3%80%8C%E8%8A%B3%E5%8D%8E%E7%BB%9A%E7%83%82%E3%80%8D%EF%BC%88%E7%BA%A2%E9%AD%94%E4%B9%A1%EF%BC%89.jpg/300px-%E5%8D%8E%E7%AC%A6%E3%80%8C%E8%8A%B3%E5%8D%8E%E7%BB%9A%E7%83%82%E3%80%8D%EF%BC%88%E7%BA%A2%E9%AD%94%E4%B9%A1%EF%BC%89.jpg" decoding="async" loading="lazy" width="300" height="350" class="thumbimage" srcset="https://upload.thwiki.cc/6/65/%E5%8D%8E%E7%AC%A6%E3%80%8C%E8%8A%B3%E5%8D%8E%E7%BB%9A%E7%83%82%E3%80%8D%EF%BC%88%E7%BA%A2%E9%AD%94%E4%B9%A1%EF%BC%89.jpg 1.5x" data-file-width="384" data-file-height="448">

华符「芳华绚烂」

3面道中BOSS红美铃Easy / Normal难度符卡。

<img alt="" src="https://upload.thwiki.cc/thumb/1/16/%E5%8D%8E%E7%AC%A6%E3%80%8CSelaginella_9%E3%80%8D%EF%BC%88%E7%BA%A2%E9%AD%94%E4%B9%A1%EF%BC%89.jpg/300px-%E5%8D%8E%E7%AC%A6%E3%80%8CSelaginella_9%E3%80%8D%EF%BC%88%E7%BA%A2%E9%AD%94%E4%B9%A1%EF%BC%89.jpg" decoding="async" loading="lazy" width="300" height="350" class="thumbimage" srcset="https://upload.thwiki.cc/1/16/%E5%8D%8E%E7%AC%A6%E3%80%8CSelaginella_9%E3%80%8D%EF%BC%88%E7%BA%A2%E9%AD%94%E4%B9%A1%EF%BC%89.jpg 1.5x" data-file-width="384" data-file-height="448">

<a href="./文件-华符「Selaginella_9」（红魔乡）.jpg.md


I | tADDcc_R
!!# 			 |  tADDcc_I | tADDC_R | tADDC_I | tADDCcc_R | tADDCcc_I | tAND_R
!!# 			 |  tAND_I | tANDcc_R | tANDcc_I | tANDN_R | tANDN_I | tANDNcc_R
!!#                          |  tANDNcc_I | tOR_R | tOR_I | tORcc_R | tORcc_I | tORN_R | tORN_I
!!#  			 |  tORNcc_R | tORNcc_I | tXOR_R | tXOR_I | tXORcc_R | tXORcc_I
!!# 			 |  tXNOR_R | tXNOR_I | tXNORcc_R | tXNORcc_I | tMOVcc_R | tMOVcc_I