file_name
stringlengths
3
137
prefix
stringlengths
0
918k
suffix
stringlengths
0
962k
middle
stringlengths
0
812k
2021-12-19_magazine-cutout.rs
// https://github.com/exercism/rust/tree/630a56517c9015341cdd96233632eda9ad8f44c4/exercises/concept/magazine-cutout // https://exercism.org/tracks/rust/exercises/magazine-cutout/solutions/mrl5 use std::collections::HashMap; pub fn can_construct_note(magazine: &[&str], note: &[&str]) -> bool { let mut map = map_magazine(magazine); evaluate_note(note, &mut map) } fn map_magazine<'a>(magazine: &'a [&str]) -> HashMap<&'a str, usize> { // https://doc.rust-lang.org/reference/lifetime-elision.html let mut map: HashMap<&str, usize> = HashMap::new(); for word in magazine { *map.entry(word).or_insert(0) += 1; } map } fn
<'a>(note: &'a [&str], map: &mut HashMap<&'a str, usize>) -> bool { for word in note { let counter = map.entry(word).or_insert(0); if counter == &0 { return false; } *counter -= 1; } return true; }
evaluate_note
logs.go
/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package logs import ( "fmt" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/ingress-nginx/cmd/plugin/kubectl" "k8s.io/ingress-nginx/cmd/plugin/request" "k8s.io/ingress-nginx/cmd/plugin/util" ) // CreateCommand creates and returns this cobra subcommand func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command { o := logsFlags{} var pod, deployment, selector *string cmd := &cobra.Command{ Use: "logs", Short: "Get the kubernetes logs for an ingress-nginx pod", RunE: func(cmd *cobra.Command, args []string) error { util.PrintError(logs(flags, *pod, *deployment, *selector, o)) return nil }, } pod = util.AddPodFlag(cmd) deployment = util.AddDeploymentFlag(cmd) selector = util.AddSelectorFlag(cmd) cmd.Flags().BoolVarP(&o.Follow, "follow", "f", o.Follow, "Specify if the logs should be streamed.") cmd.Flags().BoolVar(&o.Timestamps, "timestamps", o.Timestamps, "Include timestamps on each line in the log output") cmd.Flags().Int64Var(&o.LimitBytes, "limit-bytes", o.LimitBytes, "Maximum bytes of logs to return. Defaults to no limit.") cmd.Flags().BoolVarP(&o.Previous, "previous", "p", o.Previous, "If true, print the logs for the previous instance of the container in a pod if it exists.") cmd.Flags().Int64Var(&o.Tail, "tail", o.Tail, "Lines of recent log file to display. Defaults to -1 with no selector, showing all log lines otherwise 10, if a selector is provided.") cmd.Flags().StringVar(&o.SinceTime, "since-time", o.SinceTime, "Only return logs after a specific date (RFC3339). Defaults to all logs. Only one of since-time / since may be used.") cmd.Flags().StringVar(&o.SinceSeconds, "since", o.SinceSeconds, "Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs. Only one of since-time / since may be used.") return cmd } type logsFlags struct { SinceTime string SinceSeconds string Follow bool Previous bool Timestamps bool LimitBytes int64 Tail int64 Selector string } func (o *logsFlags) toStrings() []string { r := []string{} if o.SinceTime != "" { r = append(r, "--since-time", o.SinceTime) } if o.SinceSeconds != "" { r = append(r, "--since", o.SinceSeconds) } if o.Follow { r = append(r, "--follow") } if o.Previous { r = append(r, "--previous") } if o.Timestamps { r = append(r, "--timestamps") } if o.LimitBytes != 0 { r = append(r, "--limit-bytes", fmt.Sprintf("%v", o.LimitBytes)) } if o.Tail != 0 { r = append(r, "--tail", fmt.Sprintf("%v", o.Tail)) } return r } func logs(flags *genericclioptions.ConfigFlags, podName string, deployment string, selector string, opts logsFlags) error
{ pod, err := request.ChoosePod(flags, podName, deployment, selector) if err != nil { return err } cmd := []string{"logs", "-n", pod.Namespace, pod.Name} cmd = append(cmd, opts.toStrings()...) return kubectl.Exec(flags, cmd) }
license.rs
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use anyhow::Context; use globset::{Glob, GlobSet, GlobSetBuilder}; use x_lint::prelude::*; static LICENSE_HEADER: &str = "Copyright (c) The Diem Core Contributors\n\ SPDX-License-Identifier: Apache-2.0\n\ "; #[derive(Copy, Clone, Debug)] pub(super) struct LicenseHeader<'cfg> { exceptions: &'cfg GlobSet, } impl<'cfg> Linter for LicenseHeader<'cfg> { fn name(&self) -> &'static str { "license-header" } } impl<'cfg> LicenseHeader<'cfg> { pub fn new(exceptions: &'cfg GlobSet) -> Self { Self { exceptions } } } impl<'cfg> ContentLinter for LicenseHeader<'cfg> { fn pre_run<'l>(&self, file_ctx: &FilePathContext<'l>) -> Result<RunStatus<'l>> { // TODO: Add a way to pass around state between pre_run and run, so that this computation // only needs to be done once. match FileType::new(file_ctx) { Some(_) => Ok(skip_license_checks(self.exceptions, file_ctx)), None => Ok(RunStatus::Skipped(SkipReason::UnsupportedExtension( file_ctx.extension(), ))), } } fn run<'l>( &self, ctx: &ContentContext<'l>, out: &mut LintFormatter<'l, '_>, ) -> Result<RunStatus<'l>> { let content = match ctx.content() { Some(content) => content, None => { // This is not a UTF-8 file -- don't analyze it. return Ok(RunStatus::Skipped(SkipReason::NonUtf8Content)); } }; let file_type = FileType::new(ctx.file_ctx()).expect("None filtered out in pre_run"); // Determine if the file is missing the license header let missing_header = match file_type { FileType::Rust | FileType::Proto => { let maybe_license = content .lines() .skip_while(|line| line.is_empty()) .take(2) .map(|s| s.trim_start_matches("// ")); !LICENSE_HEADER.lines().eq(maybe_license) } FileType::Shell => { let maybe_license = content .lines() .skip_while(|line| line.starts_with("#!")) .skip_while(|line| line.is_empty()) .take(2) .map(|s| s.trim_start_matches("# ")); !LICENSE_HEADER.lines().eq(maybe_license) } }; if missing_header { out.write(LintLevel::Error, "missing license header"); } Ok(RunStatus::Executed) } } enum FileType { Rust, Shell, Proto, } impl FileType { fn new(ctx: &FilePathContext<'_>) -> Option<Self> { match ctx.extension() { Some("rs") => Some(FileType::Rust), Some("sh") => Some(FileType::Shell), Some("proto") => Some(FileType::Proto), _ => None, } } } pub(super) fn build_exceptions(patterns: &[String]) -> crate::Result<GlobSet> { let mut builder = GlobSetBuilder::new(); for pattern in patterns { let glob = Glob::new(pattern).with_context(|| { format!( "error while processing license exception glob '{}'", pattern ) })?; builder.add(glob); } builder .build() .with_context(|| "error while building globset for license patterns") } fn skip_license_checks<'l>(exceptions: &GlobSet, file: &FilePathContext<'l>) -> RunStatus<'l> {
RunStatus::Executed }
if exceptions.is_match(file.file_path()) { return RunStatus::Skipped(SkipReason::UnsupportedFile(file.file_path())); }
pass_db.rs
use rmp_serde::{decode, encode}; use rmp_serde::{Serializer, Deserializer}; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; use std::fs::File; use std::io; use std::path::Path;
#[derive(Debug)] pub enum Error { Io(err: io::Error) { from() cause(err) } Serialization(err: encode::Error) { from() cause(err) } Deserialization(err: decode::Error) { from() cause(err) } } } /// A helper trait to manage password database. #[derive(Serialize, Deserialize)] #[derive(Debug)] pub struct PassDb { users_and_hashes: BTreeMap<String, Vec<u8>>, } impl PassDb { /// Loads database from a given path. pub fn load<P: AsRef<Path>>(path: P) -> Result<Self, Error> { let input = File::open(path)?; let mut deserializer = Deserializer::new(&input); Ok(Deserialize::deserialize(&mut deserializer)?) } /// Saves the database. pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error> { let mut output = File::create(path)?; self.serialize(&mut Serializer::new(&mut output))?; Ok(()) } /// Creates an empty database. pub fn new() -> Self { Self { users_and_hashes: Default::default() } } /// Finds a password hash for a given user. pub fn find_hash(&self, user_id: &str) -> Option<Vec<u8>> { self.users_and_hashes.get(user_id).cloned() } /// Adds a password hash to the database. pub fn insert(&mut self, user_id: &str, hash: Vec<u8>) { self.users_and_hashes.insert(user_id.into(), hash); } /// Removes a user from the database. pub fn remove(&mut self, user_id: &str) { self.users_and_hashes.remove(user_id); } /// List users in the database. pub fn list_users(&self) -> Vec<String> { self.users_and_hashes.keys().cloned().collect() } }
quick_error! { /// Password database error.
torrent_stop.go
package filechain import ( //"github.com/fichain/go-file/internal/handshaker/incominghandshaker" //"github.com/fichain/go-file/internal/handshaker/outgoinghandshaker" //"github.com/fichain/go-file/internal/tracker" "github.com/rcrowley/go-metrics" ) func (t *torrent) handleStopped() { //t.stoppedEventAnnouncer = nil t.errC <- t.lastError t.errC = nil t.portC = nil if t.doVerify { t.bitfield = nil t.start() } else { t.log.Info("torrent has stopped") } } func (t *torrent) stop(err error) { s := t.status() if s == Stopping || s == Stopped { return } t.log.Info("stopping torrent") t.lastError = err if err != nil && err != errClosed { t.log.Error(err) } t.stopPeers() t.stopPiecedownloaders() t.stopInfoDownloaders() if t.bitfield != nil { _ = t.writeBitfield() } // Closing data is necessary to cancel ongoing IO operations on files. t.closeData() // Data must be closed before closing Allocator. t.stopAllocator() // Data must be closed before closing Verifier. t.stopVerifier() t.resetSpeeds() t.stopping = true close(t.stopC) t.handleStopped() t.addrList.Reset() } func (t *torrent) stopAllocator() { t.log.Debugln("stopping allocator") if t.allocator != nil { t.allocator.Close() t.allocator = nil } } func (t *torrent) stopVerifier() { t.log.Debugln("stopping verifier") if t.verifier != nil { t.verifier.Close() t.verifier = nil } } func (t *torrent) stopWebseedDownloads() { //for _, src := range t.webseedSources {
//} } func (t *torrent) resetSpeeds() { t.downloadSpeed.Stop() t.downloadSpeed = metrics.NilMeter{} t.uploadSpeed.Stop() t.uploadSpeed = metrics.NilMeter{} } func (t *torrent) closeData() { t.log.Debugln("closing open files") for _, f := range t.files { err := f.Storage.Close() if err != nil { t.log.Error(err) } } t.files = nil t.pieces = nil t.piecePicker = nil t.bytesAllocated = 0 t.checkedPieces = 0 } //func (t *torrent) stopPeriodicalAnnouncers() { // t.log.Debugln("stopping announcers") // for _, an := range t.announcers { // an.Close() // } // if t.dhtAnnouncer != nil { // t.dhtAnnouncer.Close() // t.dhtAnnouncer = nil // } //} func (t *torrent) stopPeers() { t.log.Debugln("closing peer connections") for _, p := range t.connectedPeers { t.closePeer(p) } } func (t *torrent) stopInfoDownloaders() { t.log.Debugln("stopping info downloaders") for _, id := range t.infoDownloaders { t.closeInfoDownloader(id) } } func (t *torrent) stopPiecedownloaders() { t.log.Debugln("stopping piece downloaders") for _, pd := range t.pieceDownloaders { t.closePieceDownloader(pd) } }
// t.closeWebseedDownloader(src)
int128-3-read-little-endian.rs
extern crate lolbench ; # [ test ] fn end_to_end ( )
{ lolbench :: end_to_end_test ( "byteorder_1_2_6" , "int128_3::read_little_endian" , ) ; }
heap.py
def
(heap, root): newRoot = root leftChild = 2*root+1 rightChild = 2*root+2 if leftChild < len(heap) and heap[leftChild] > heap[newRoot]: newRoot = leftChild if rightChild < len(heap) and heap[rightChild] > heap[newRoot]: newRoot = rightChild if root!=newRoot: heap[root],heap[newRoot]=heap[newRoot],heap[root] heapify(heap,newRoot) def heapSort(heap): for i in range(len(heap), -1, -1): heapify(heap, i) answer = [] while(len(heap)>1): answer.insert(len(answer),heap[0]) heap[0],heap[-1]=heap[-1],heap[0] heap.pop() heapify(heap, 0) return answer
heapify
_logistic.py
""" Logistic Regression """ # Author: Gael Varoquaux <[email protected]> # Fabian Pedregosa <[email protected]> # Alexandre Gramfort <[email protected]> # Manoj Kumar <[email protected]> # Lars Buitinck # Simon Wu <[email protected]> # Arthur Mensch <[email protected] import numbers import warnings import numpy as np from scipy import optimize, sparse from scipy.special import expit, logsumexp from joblib import Parallel, effective_n_jobs from ._base import LinearClassifierMixin, SparseCoefMixin, BaseEstimator from ._sag import sag_solver from ..preprocessing import LabelEncoder, LabelBinarizer from ..svm._base import _fit_liblinear from ..utils import check_array, check_consistent_length, compute_class_weight from ..utils import check_random_state from ..utils.extmath import log_logistic, safe_sparse_dot, softmax, squared_norm from ..utils.extmath import row_norms from ..utils.optimize import _newton_cg, _check_optimize_result from ..utils.validation import check_is_fitted, _check_sample_weight from ..utils.multiclass import check_classification_targets from ..utils.fixes import _joblib_parallel_args from ..utils.fixes import delayed from ..model_selection import check_cv from ..metrics import get_scorer _LOGISTIC_SOLVER_CONVERGENCE_MSG = ( "Please also refer to the documentation for alternative solver options:\n" " https://scikit-learn.org/stable/modules/linear_model.html" "#logistic-regression" ) # .. some helper functions for logistic_regression_path .. def _intercept_dot(w, X, y): """Computes y * np.dot(X, w). It takes into consideration if the intercept should be fit or not. Parameters ---------- w : ndarray of shape (n_features,) or (n_features + 1,) Coefficient vector. X : {array-like, sparse matrix} of shape (n_samples, n_features) Training data. y : ndarray of shape (n_samples,) Array of labels. Returns ------- w : ndarray of shape (n_features,) Coefficient vector without the intercept weight (w[-1]) if the intercept should be fit. Unchanged otherwise. c : float The intercept. yz : float y * np.dot(X, w). """ c = 0.0 if w.size == X.shape[1] + 1: c = w[-1] w = w[:-1] z = safe_sparse_dot(X, w) + c yz = y * z return w, c, yz def _logistic_loss_and_grad(w, X, y, alpha, sample_weight=None): """Computes the logistic loss and gradient. Parameters ---------- w : ndarray of shape (n_features,) or (n_features + 1,) Coefficient vector. X : {array-like, sparse matrix} of shape (n_samples, n_features) Training data. y : ndarray of shape (n_samples,) Array of labels. alpha : float Regularization parameter. alpha is equal to 1 / C. sample_weight : array-like of shape (n_samples,), default=None Array of weights that are assigned to individual samples. If not provided, then each sample is given unit weight. Returns ------- out : float Logistic loss. grad : ndarray of shape (n_features,) or (n_features + 1,) Logistic gradient. """ n_samples, n_features = X.shape grad = np.empty_like(w) w, c, yz = _intercept_dot(w, X, y) if sample_weight is None: sample_weight = np.ones(n_samples) # Logistic loss is the negative of the log of the logistic function. out = -np.sum(sample_weight * log_logistic(yz)) + 0.5 * alpha * np.dot(w, w) z = expit(yz) z0 = sample_weight * (z - 1) * y grad[:n_features] = safe_sparse_dot(X.T, z0) + alpha * w # Case where we fit the intercept. if grad.shape[0] > n_features: grad[-1] = z0.sum() return out, grad def _logistic_loss(w, X, y, alpha, sample_weight=None): """Computes the logistic loss. Parameters ---------- w : ndarray of shape (n_features,) or (n_features + 1,) Coefficient vector. X : {array-like, sparse matrix} of shape (n_samples, n_features) Training data. y : ndarray of shape (n_samples,) Array of labels. alpha : float Regularization parameter. alpha is equal to 1 / C. sample_weight : array-like of shape (n_samples,) default=None Array of weights that are assigned to individual samples. If not provided, then each sample is given unit weight. Returns ------- out : float Logistic loss. """ w, c, yz = _intercept_dot(w, X, y) if sample_weight is None: sample_weight = np.ones(y.shape[0]) # Logistic loss is the negative of the log of the logistic function. out = -np.sum(sample_weight * log_logistic(yz)) + 0.5 * alpha * np.dot(w, w) return out def _logistic_grad_hess(w, X, y, alpha, sample_weight=None): """Computes the gradient and the Hessian, in the case of a logistic loss. Parameters ---------- w : ndarray of shape (n_features,) or (n_features + 1,) Coefficient vector. X : {array-like, sparse matrix} of shape (n_samples, n_features) Training data. y : ndarray of shape (n_samples,) Array of labels. alpha : float Regularization parameter. alpha is equal to 1 / C. sample_weight : array-like of shape (n_samples,) default=None Array of weights that are assigned to individual samples. If not provided, then each sample is given unit weight. Returns ------- grad : ndarray of shape (n_features,) or (n_features + 1,) Logistic gradient. Hs : callable Function that takes the gradient as a parameter and returns the matrix product of the Hessian and gradient. """ n_samples, n_features = X.shape grad = np.empty_like(w) fit_intercept = grad.shape[0] > n_features w, c, yz = _intercept_dot(w, X, y) if sample_weight is None: sample_weight = np.ones(y.shape[0]) z = expit(yz) z0 = sample_weight * (z - 1) * y grad[:n_features] = safe_sparse_dot(X.T, z0) + alpha * w # Case where we fit the intercept. if fit_intercept: grad[-1] = z0.sum() # The mat-vec product of the Hessian d = sample_weight * z * (1 - z) if sparse.issparse(X): dX = safe_sparse_dot(sparse.dia_matrix((d, 0), shape=(n_samples, n_samples)), X) else: # Precompute as much as possible dX = d[:, np.newaxis] * X if fit_intercept: # Calculate the double derivative with respect to intercept # In the case of sparse matrices this returns a matrix object. dd_intercept = np.squeeze(np.array(dX.sum(axis=0))) def Hs(s): ret = np.empty_like(s) if sparse.issparse(X): ret[:n_features] = X.T.dot(dX.dot(s[:n_features])) else: ret[:n_features] = np.linalg.multi_dot([X.T, dX, s[:n_features]]) ret[:n_features] += alpha * s[:n_features] # For the fit intercept case. if fit_intercept: ret[:n_features] += s[-1] * dd_intercept ret[-1] = dd_intercept.dot(s[:n_features]) ret[-1] += d.sum() * s[-1] return ret return grad, Hs def _multinomial_loss(w, X, Y, alpha, sample_weight): """Computes multinomial loss and class probabilities. Parameters ---------- w : ndarray of shape (n_classes * n_features,) or (n_classes * (n_features + 1),) Coefficient vector. X : {array-like, sparse matrix} of shape (n_samples, n_features) Training data. Y : ndarray of shape (n_samples, n_classes) Transformed labels according to the output of LabelBinarizer. alpha : float Regularization parameter. alpha is equal to 1 / C. sample_weight : array-like of shape (n_samples,) Array of weights that are assigned to individual samples. Returns ------- loss : float Multinomial loss. p : ndarray of shape (n_samples, n_classes) Estimated class probabilities. w : ndarray of shape (n_classes, n_features) Reshaped param vector excluding intercept terms. Reference --------- Bishop, C. M. (2006). Pattern recognition and machine learning. Springer. (Chapter 4.3.4) """ n_classes = Y.shape[1] n_features = X.shape[1] fit_intercept = w.size == (n_classes * (n_features + 1)) w = w.reshape(n_classes, -1) sample_weight = sample_weight[:, np.newaxis] if fit_intercept: intercept = w[:, -1] w = w[:, :-1] else: intercept = 0 p = safe_sparse_dot(X, w.T) p += intercept p -= logsumexp(p, axis=1)[:, np.newaxis] loss = -(sample_weight * Y * p).sum() loss += 0.5 * alpha * squared_norm(w) p = np.exp(p, p) return loss, p, w def _multinomial_loss_grad(w, X, Y, alpha, sample_weight): """Computes the multinomial loss, gradient and class probabilities. Parameters ---------- w : ndarray of shape (n_classes * n_features,) or (n_classes * (n_features + 1),) Coefficient vector. X : {array-like, sparse matrix} of shape (n_samples, n_features) Training data. Y : ndarray of shape (n_samples, n_classes) Transformed labels according to the output of LabelBinarizer. alpha : float Regularization parameter. alpha is equal to 1 / C. sample_weight : array-like of shape (n_samples,) Array of weights that are assigned to individual samples. Returns ------- loss : float Multinomial loss. grad : ndarray of shape (n_classes * n_features,) or \ (n_classes * (n_features + 1),) Ravelled gradient of the multinomial loss. p : ndarray of shape (n_samples, n_classes) Estimated class probabilities Reference --------- Bishop, C. M. (2006). Pattern recognition and machine learning. Springer. (Chapter 4.3.4) """ n_classes = Y.shape[1] n_features = X.shape[1] fit_intercept = w.size == n_classes * (n_features + 1) grad = np.zeros((n_classes, n_features + bool(fit_intercept)), dtype=X.dtype) loss, p, w = _multinomial_loss(w, X, Y, alpha, sample_weight) sample_weight = sample_weight[:, np.newaxis] diff = sample_weight * (p - Y) grad[:, :n_features] = safe_sparse_dot(diff.T, X) grad[:, :n_features] += alpha * w if fit_intercept: grad[:, -1] = diff.sum(axis=0) return loss, grad.ravel(), p def _multinomial_grad_hess(w, X, Y, alpha, sample_weight): """ Computes the gradient and the Hessian, in the case of a multinomial loss. Parameters ---------- w : ndarray of shape (n_classes * n_features,) or (n_classes * (n_features + 1),) Coefficient vector. X : {array-like, sparse matrix} of shape (n_samples, n_features) Training data. Y : ndarray of shape (n_samples, n_classes) Transformed labels according to the output of LabelBinarizer. alpha : float Regularization parameter. alpha is equal to 1 / C. sample_weight : array-like of shape (n_samples,) Array of weights that are assigned to individual samples. Returns ------- grad : ndarray of shape (n_classes * n_features,) or \ (n_classes * (n_features + 1),) Ravelled gradient of the multinomial loss. hessp : callable Function that takes in a vector input of shape (n_classes * n_features) or (n_classes * (n_features + 1)) and returns matrix-vector product with hessian. References ---------- Barak A. Pearlmutter (1993). Fast Exact Multiplication by the Hessian. http://www.bcl.hamilton.ie/~barak/papers/nc-hessian.pdf """ n_features = X.shape[1] n_classes = Y.shape[1] fit_intercept = w.size == (n_classes * (n_features + 1)) # `loss` is unused. Refactoring to avoid computing it does not # significantly speed up the computation and decreases readability loss, grad, p = _multinomial_loss_grad(w, X, Y, alpha, sample_weight) sample_weight = sample_weight[:, np.newaxis] # Hessian-vector product derived by applying the R-operator on the gradient # of the multinomial loss function. def hessp(v): v = v.reshape(n_classes, -1) if fit_intercept: inter_terms = v[:, -1] v = v[:, :-1] else: inter_terms = 0 # r_yhat holds the result of applying the R-operator on the multinomial # estimator. r_yhat = safe_sparse_dot(X, v.T) r_yhat += inter_terms r_yhat += (-p * r_yhat).sum(axis=1)[:, np.newaxis] r_yhat *= p r_yhat *= sample_weight hessProd = np.zeros((n_classes, n_features + bool(fit_intercept))) hessProd[:, :n_features] = safe_sparse_dot(r_yhat.T, X) hessProd[:, :n_features] += v * alpha if fit_intercept: hessProd[:, -1] = r_yhat.sum(axis=0) return hessProd.ravel() return grad, hessp def _check_solver(solver, penalty, dual): all_solvers = ["liblinear", "newton-cg", "lbfgs", "sag", "saga"] if solver not in all_solvers: raise ValueError( "Logistic Regression supports only solvers in %s, got %s." % (all_solvers, solver) ) all_penalties = ["l1", "l2", "elasticnet", "none"] if penalty not in all_penalties: raise ValueError( "Logistic Regression supports only penalties in %s, got %s." % (all_penalties, penalty) ) if solver not in ["liblinear", "saga"] and penalty not in ("l2", "none"): raise ValueError( "Solver %s supports only 'l2' or 'none' penalties, got %s penalty." % (solver, penalty) ) if solver != "liblinear" and dual: raise ValueError( "Solver %s supports only dual=False, got dual=%s" % (solver, dual) ) if penalty == "elasticnet" and solver != "saga": raise ValueError( "Only 'saga' solver supports elasticnet penalty, got solver={}.".format( solver ) ) if solver == "liblinear" and penalty == "none": raise ValueError("penalty='none' is not supported for the liblinear solver") return solver def _check_multi_class(multi_class, solver, n_classes): if multi_class == "auto": if solver == "liblinear": multi_class = "ovr" elif n_classes > 2: multi_class = "multinomial" else: multi_class = "ovr" if multi_class not in ("multinomial", "ovr"): raise ValueError( "multi_class should be 'multinomial', 'ovr' or 'auto'. Got %s." % multi_class ) if multi_class == "multinomial" and solver == "liblinear": raise ValueError("Solver %s does not support a multinomial backend." % solver) return multi_class def _logistic_regression_path( X, y, pos_class=None, Cs=10, fit_intercept=True, max_iter=100, tol=1e-4, verbose=0, solver="lbfgs", coef=None, class_weight=None, dual=False, penalty="l2", intercept_scaling=1.0, multi_class="auto", random_state=None, check_input=True, max_squared_sum=None, sample_weight=None, l1_ratio=None, ): """Compute a Logistic Regression model for a list of regularization parameters. This is an implementation that uses the result of the previous model to speed up computations along the set of solutions, making it faster than sequentially calling LogisticRegression for the different parameters. Note that there will be no speedup with liblinear solver, since it does not handle warm-starting. Read more in the :ref:`User Guide <logistic_regression>`. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Input data. y : array-like of shape (n_samples,) or (n_samples, n_targets) Input data, target values. pos_class : int, default=None The class with respect to which we perform a one-vs-all fit. If None, then it is assumed that the given problem is binary. Cs : int or array-like of shape (n_cs,), default=10 List of values for the regularization parameter or integer specifying the number of regularization parameters that should be used. In this case, the parameters will be chosen in a logarithmic scale between 1e-4 and 1e4. fit_intercept : bool, default=True Whether to fit an intercept for the model. In this case the shape of the returned array is (n_cs, n_features + 1). max_iter : int, default=100 Maximum number of iterations for the solver. tol : float, default=1e-4 Stopping criterion. For the newton-cg and lbfgs solvers, the iteration will stop when ``max{|g_i | i = 1, ..., n} <= tol`` where ``g_i`` is the i-th component of the gradient. verbose : int, default=0 For the liblinear and lbfgs solvers set verbose to any positive number for verbosity. solver : {'lbfgs', 'newton-cg', 'liblinear', 'sag', 'saga'}, \ default='lbfgs' Numerical solver to use. coef : array-like of shape (n_features,), default=None Initialization value for coefficients of logistic regression. Useless for liblinear solver. class_weight : dict or 'balanced', default=None Weights associated with classes in the form ``{class_label: weight}``. If not given, all classes are supposed to have weight one. The "balanced" mode uses the values of y to automatically adjust weights inversely proportional to class frequencies in the input data as ``n_samples / (n_classes * np.bincount(y))``. Note that these weights will be multiplied with sample_weight (passed through the fit method) if sample_weight is specified. dual : bool, default=False Dual or primal formulation. Dual formulation is only implemented for l2 penalty with liblinear solver. Prefer dual=False when n_samples > n_features. penalty : {'l1', 'l2', 'elasticnet'}, default='l2' Used to specify the norm used in the penalization. The 'newton-cg', 'sag' and 'lbfgs' solvers support only l2 penalties. 'elasticnet' is only supported by the 'saga' solver. intercept_scaling : float, default=1. Useful only when the solver 'liblinear' is used and self.fit_intercept is set to True. In this case, x becomes [x, self.intercept_scaling], i.e. a "synthetic" feature with constant value equal to intercept_scaling is appended to the instance vector. The intercept becomes ``intercept_scaling * synthetic_feature_weight``. Note! the synthetic feature weight is subject to l1/l2 regularization as all other features. To lessen the effect of regularization on synthetic feature weight (and therefore on the intercept) intercept_scaling has to be increased. multi_class : {'ovr', 'multinomial', 'auto'}, default='auto' If the option chosen is 'ovr', then a binary problem is fit for each label. For 'multinomial' the loss minimised is the multinomial loss fit across the entire probability distribution, *even when the data is binary*. 'multinomial' is unavailable when solver='liblinear'. 'auto' selects 'ovr' if the data is binary, or if solver='liblinear', and otherwise selects 'multinomial'. .. versionadded:: 0.18 Stochastic Average Gradient descent solver for 'multinomial' case. .. versionchanged:: 0.22 Default changed from 'ovr' to 'auto' in 0.22. random_state : int, RandomState instance, default=None Used when ``solver`` == 'sag', 'saga' or 'liblinear' to shuffle the data. See :term:`Glossary <random_state>` for details. check_input : bool, default=True If False, the input arrays X and y will not be checked. max_squared_sum : float, default=None Maximum squared sum of X over samples. Used only in SAG solver. If None, it will be computed, going through all the samples. The value should be precomputed to speed up cross validation. sample_weight : array-like of shape(n_samples,), default=None Array of weights that are assigned to individual samples. If not provided, then each sample is given unit weight. l1_ratio : float, default=None The Elastic-Net mixing parameter, with ``0 <= l1_ratio <= 1``. Only used if ``penalty='elasticnet'``. Setting ``l1_ratio=0`` is equivalent to using ``penalty='l2'``, while setting ``l1_ratio=1`` is equivalent to using ``penalty='l1'``. For ``0 < l1_ratio <1``, the penalty is a combination of L1 and L2. Returns ------- coefs : ndarray of shape (n_cs, n_features) or (n_cs, n_features + 1) List of coefficients for the Logistic Regression model. If fit_intercept is set to True then the second dimension will be n_features + 1, where the last item represents the intercept. For ``multiclass='multinomial'``, the shape is (n_classes, n_cs, n_features) or (n_classes, n_cs, n_features + 1). Cs : ndarray Grid of Cs used for cross-validation. n_iter : array of shape (n_cs,) Actual number of iteration for each Cs. Notes ----- You might get slightly different results with the solver liblinear than with the others since this uses LIBLINEAR which penalizes the intercept. .. versionchanged:: 0.19 The "copy" parameter was removed. """ if isinstance(Cs, numbers.Integral): Cs = np.logspace(-4, 4, Cs) solver = _check_solver(solver, penalty, dual) # Preprocessing. if check_input: X = check_array( X, accept_sparse="csr", dtype=np.float64, accept_large_sparse=solver not in ["liblinear", "sag", "saga"], ) y = check_array(y, ensure_2d=False, dtype=None) check_consistent_length(X, y) _, n_features = X.shape classes = np.unique(y) random_state = check_random_state(random_state) multi_class = _check_multi_class(multi_class, solver, len(classes)) if pos_class is None and multi_class != "multinomial": if classes.size > 2: raise ValueError("To fit OvR, use the pos_class argument") # np.unique(y) gives labels in sorted order. pos_class = classes[1] # If sample weights exist, convert them to array (support for lists) # and check length # Otherwise set them to 1 for all examples sample_weight = _check_sample_weight(sample_weight, X, dtype=X.dtype, copy=True) # If class_weights is a dict (provided by the user), the weights # are assigned to the original labels. If it is "balanced", then # the class_weights are assigned after masking the labels with a OvR. le = LabelEncoder() if isinstance(class_weight, dict) or multi_class == "multinomial": class_weight_ = compute_class_weight(class_weight, classes=classes, y=y) sample_weight *= class_weight_[le.fit_transform(y)] # For doing a ovr, we need to mask the labels first. for the # multinomial case this is not necessary. if multi_class == "ovr": w0 = np.zeros(n_features + int(fit_intercept), dtype=X.dtype) mask_classes = np.array([-1, 1]) mask = y == pos_class y_bin = np.ones(y.shape, dtype=X.dtype) y_bin[~mask] = -1.0 # for compute_class_weight if class_weight == "balanced": class_weight_ = compute_class_weight( class_weight, classes=mask_classes, y=y_bin ) sample_weight *= class_weight_[le.fit_transform(y_bin)] else: if solver not in ["sag", "saga"]: lbin = LabelBinarizer() Y_multi = lbin.fit_transform(y) if Y_multi.shape[1] == 1: Y_multi = np.hstack([1 - Y_multi, Y_multi]) else: # SAG multinomial solver needs LabelEncoder, not LabelBinarizer le = LabelEncoder() Y_multi = le.fit_transform(y).astype(X.dtype, copy=False) w0 = np.zeros( (classes.size, n_features + int(fit_intercept)), order="F", dtype=X.dtype ) if coef is not None: # it must work both giving the bias term and not if multi_class == "ovr": if coef.size not in (n_features, w0.size): raise ValueError( "Initialization coef is of shape %d, expected shape %d or %d" % (coef.size, n_features, w0.size) ) w0[: coef.size] = coef else: # For binary problems coef.shape[0] should be 1, otherwise it # should be classes.size. n_classes = classes.size if n_classes == 2: n_classes = 1 if coef.shape[0] != n_classes or coef.shape[1] not in ( n_features, n_features + 1, ): raise ValueError( "Initialization coef is of shape (%d, %d), expected " "shape (%d, %d) or (%d, %d)" % ( coef.shape[0], coef.shape[1], classes.size, n_features, classes.size, n_features + 1, ) ) if n_classes == 1: w0[0, : coef.shape[1]] = -coef w0[1, : coef.shape[1]] = coef else: w0[:, : coef.shape[1]] = coef if multi_class == "multinomial": # scipy.optimize.minimize and newton-cg accepts only # ravelled parameters. if solver in ["lbfgs", "newton-cg"]: w0 = w0.ravel() target = Y_multi if solver == "lbfgs": def func(x, *args): return _multinomial_loss_grad(x, *args)[0:2] elif solver == "newton-cg": def func(x, *args): return _multinomial_loss(x, *args)[0] def grad(x, *args): return _multinomial_loss_grad(x, *args)[1] hess = _multinomial_grad_hess warm_start_sag = {"coef": w0.T} else: target = y_bin if solver == "lbfgs": func = _logistic_loss_and_grad elif solver == "newton-cg": func = _logistic_loss def grad(x, *args): return _logistic_loss_and_grad(x, *args)[1] hess = _logistic_grad_hess warm_start_sag = {"coef": np.expand_dims(w0, axis=1)} coefs = list() n_iter = np.zeros(len(Cs), dtype=np.int32) for i, C in enumerate(Cs): if solver == "lbfgs": iprint = [-1, 50, 1, 100, 101][ np.searchsorted(np.array([0, 1, 2, 3]), verbose) ] opt_res = optimize.minimize( func, w0, method="L-BFGS-B", jac=True, args=(X, target, 1.0 / C, sample_weight), options={"iprint": iprint, "gtol": tol, "maxiter": max_iter}, ) n_iter_i = _check_optimize_result( solver, opt_res, max_iter, extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG, ) w0, loss = opt_res.x, opt_res.fun elif solver == "newton-cg": args = (X, target, 1.0 / C, sample_weight) w0, n_iter_i = _newton_cg( hess, func, grad, w0, args=args, maxiter=max_iter, tol=tol ) elif solver == "liblinear": coef_, intercept_, n_iter_i, = _fit_liblinear( X, target, C, fit_intercept, intercept_scaling, None, penalty, dual, verbose, max_iter, tol, random_state, sample_weight=sample_weight, ) if fit_intercept: w0 = np.concatenate([coef_.ravel(), intercept_]) else: w0 = coef_.ravel() elif solver in ["sag", "saga"]: if multi_class == "multinomial": target = target.astype(X.dtype, copy=False) loss = "multinomial" else: loss = "log" # alpha is for L2-norm, beta is for L1-norm if penalty == "l1": alpha = 0.0 beta = 1.0 / C elif penalty == "l2": alpha = 1.0 / C beta = 0.0 else: # Elastic-Net penalty alpha = (1.0 / C) * (1 - l1_ratio) beta = (1.0 / C) * l1_ratio w0, n_iter_i, warm_start_sag = sag_solver( X, target, sample_weight, loss, alpha, beta, max_iter, tol, verbose, random_state, False, max_squared_sum, warm_start_sag, is_saga=(solver == "saga"), ) else: raise ValueError( "solver must be one of {'liblinear', 'lbfgs', " "'newton-cg', 'sag'}, got '%s' instead" % solver ) if multi_class == "multinomial": n_classes = max(2, classes.size) multi_w0 = np.reshape(w0, (n_classes, -1)) if n_classes == 2: multi_w0 = multi_w0[1][np.newaxis, :] coefs.append(multi_w0.copy()) else: coefs.append(w0.copy()) n_iter[i] = n_iter_i return np.array(coefs), np.array(Cs), n_iter # helper function for LogisticCV def _log_reg_scoring_path( X, y, train, test, pos_class=None, Cs=10, scoring=None, fit_intercept=False, max_iter=100, tol=1e-4, class_weight=None, verbose=0, solver="lbfgs", penalty="l2", dual=False, intercept_scaling=1.0, multi_class="auto", random_state=None, max_squared_sum=None, sample_weight=None, l1_ratio=None, ): """Computes scores across logistic_regression_path Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Training data. y : array-like of shape (n_samples,) or (n_samples, n_targets) Target labels. train : list of indices The indices of the train set. test : list of indices The indices of the test set. pos_class : int, default=None The class with respect to which we perform a one-vs-all fit. If None, then it is assumed that the given problem is binary. Cs : int or list of floats, default=10 Each of the values in Cs describes the inverse of regularization strength. If Cs is as an int, then a grid of Cs values are chosen in a logarithmic scale between 1e-4 and 1e4. If not provided, then a fixed set of values for Cs are used. scoring : callable, default=None A string (see model evaluation documentation) or a scorer callable object / function with signature ``scorer(estimator, X, y)``. For a list of scoring functions that can be used, look at :mod:`sklearn.metrics`. The default scoring option used is accuracy_score. fit_intercept : bool, default=False If False, then the bias term is set to zero. Else the last term of each coef_ gives us the intercept. max_iter : int, default=100 Maximum number of iterations for the solver. tol : float, default=1e-4 Tolerance for stopping criteria. class_weight : dict or 'balanced', default=None Weights associated with classes in the form ``{class_label: weight}``. If not given, all classes are supposed to have weight one. The "balanced" mode uses the values of y to automatically adjust weights inversely proportional to class frequencies in the input data as ``n_samples / (n_classes * np.bincount(y))`` Note that these weights will be multiplied with sample_weight (passed through the fit method) if sample_weight is specified. verbose : int, default=0 For the liblinear and lbfgs solvers set verbose to any positive number for verbosity. solver : {'lbfgs', 'newton-cg', 'liblinear', 'sag', 'saga'}, \ default='lbfgs' Decides which solver to use. penalty : {'l1', 'l2', 'elasticnet'}, default='l2' Used to specify the norm used in the penalization. The 'newton-cg', 'sag' and 'lbfgs' solvers support only l2 penalties. 'elasticnet' is only supported by the 'saga' solver. dual : bool, default=False Dual or primal formulation. Dual formulation is only implemented for l2 penalty with liblinear solver. Prefer dual=False when n_samples > n_features. intercept_scaling : float, default=1. Useful only when the solver 'liblinear' is used and self.fit_intercept is set to True. In this case, x becomes [x, self.intercept_scaling], i.e. a "synthetic" feature with constant value equals to intercept_scaling is appended to the instance vector. The intercept becomes intercept_scaling * synthetic feature weight Note! the synthetic feature weight is subject to l1/l2 regularization as all other features. To lessen the effect of regularization on synthetic feature weight (and therefore on the intercept) intercept_scaling has to be increased. multi_class : {'auto', 'ovr', 'multinomial'}, default='auto' If the option chosen is 'ovr', then a binary problem is fit for each label. For 'multinomial' the loss minimised is the multinomial loss fit across the entire probability distribution, *even when the data is binary*. 'multinomial' is unavailable when solver='liblinear'. random_state : int, RandomState instance, default=None Used when ``solver`` == 'sag', 'saga' or 'liblinear' to shuffle the data. See :term:`Glossary <random_state>` for details. max_squared_sum : float, default=None Maximum squared sum of X over samples. Used only in SAG solver. If None, it will be computed, going through all the samples. The value should be precomputed to speed up cross validation. sample_weight : array-like of shape(n_samples,), default=None Array of weights that are assigned to individual samples. If not provided, then each sample is given unit weight. l1_ratio : float, default=None The Elastic-Net mixing parameter, with ``0 <= l1_ratio <= 1``. Only used if ``penalty='elasticnet'``. Setting ``l1_ratio=0`` is equivalent to using ``penalty='l2'``, while setting ``l1_ratio=1`` is equivalent to using ``penalty='l1'``. For ``0 < l1_ratio <1``, the penalty is a combination of L1 and L2. Returns ------- coefs : ndarray of shape (n_cs, n_features) or (n_cs, n_features + 1) List of coefficients for the Logistic Regression model. If fit_intercept is set to True then the second dimension will be n_features + 1, where the last item represents the intercept. Cs : ndarray Grid of Cs used for cross-validation. scores : ndarray of shape (n_cs,) Scores obtained for each Cs. n_iter : ndarray of shape(n_cs,) Actual number of iteration for each Cs. """ X_train = X[train] X_test = X[test] y_train = y[train] y_test = y[test] if sample_weight is not None: sample_weight = _check_sample_weight(sample_weight, X) sample_weight = sample_weight[train] coefs, Cs, n_iter = _logistic_regression_path( X_train, y_train, Cs=Cs, l1_ratio=l1_ratio, fit_intercept=fit_intercept, solver=solver, max_iter=max_iter, class_weight=class_weight, pos_class=pos_class, multi_class=multi_class, tol=tol, verbose=verbose, dual=dual, penalty=penalty, intercept_scaling=intercept_scaling, random_state=random_state, check_input=False, max_squared_sum=max_squared_sum, sample_weight=sample_weight, ) log_reg = LogisticRegression(solver=solver, multi_class=multi_class) # The score method of Logistic Regression has a classes_ attribute. if multi_class == "ovr": log_reg.classes_ = np.array([-1, 1]) elif multi_class == "multinomial": log_reg.classes_ = np.unique(y_train) else: raise ValueError( "multi_class should be either multinomial or ovr, got %d" % multi_class ) if pos_class is not None: mask = y_test == pos_class y_test = np.ones(y_test.shape, dtype=np.float64) y_test[~mask] = -1.0 scores = list() scoring = get_scorer(scoring) for w in coefs: if multi_class == "ovr": w = w[np.newaxis, :] if fit_intercept: log_reg.coef_ = w[:, :-1] log_reg.intercept_ = w[:, -1] else: log_reg.coef_ = w log_reg.intercept_ = 0.0 if scoring is None: scores.append(log_reg.score(X_test, y_test)) else: scores.append(scoring(log_reg, X_test, y_test)) return coefs, Cs, np.array(scores), n_iter class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator): """ Logistic Regression (aka logit, MaxEnt) classifier. In the multiclass case, the training algorithm uses the one-vs-rest (OvR) scheme if the 'multi_class' option is set to 'ovr', and uses the cross-entropy loss if the 'multi_class' option is set to 'multinomial'. (Currently the 'multinomial' option is supported only by the 'lbfgs', 'sag', 'saga' and 'newton-cg' solvers.) This class implements regularized logistic regression using the 'liblinear' library, 'newton-cg', 'sag', 'saga' and 'lbfgs' solvers. **Note that regularization is applied by default**. It can handle both dense and sparse input. Use C-ordered arrays or CSR matrices containing 64-bit floats for optimal performance; any other input format will be converted (and copied). The 'newton-cg', 'sag', and 'lbfgs' solvers support only L2 regularization with primal formulation, or no regularization. The 'liblinear' solver supports both L1 and L2 regularization, with a dual formulation only for the L2 penalty. The Elastic-Net regularization is only supported by the 'saga' solver. Read more in the :ref:`User Guide <logistic_regression>`. Parameters ---------- penalty : {'l1', 'l2', 'elasticnet', 'none'}, default='l2' Specify the norm of the penalty: - `'none'`: no penalty is added; - `'l2'`: add a L2 penalty term and it is the default choice; - `'l1'`: add a L1 penalty term; - `'elasticnet'`: both L1 and L2 penalty terms are added. .. warning:: Some penalties may not work with some solvers. See the parameter `solver` below, to know the compatibility between the penalty and solver. .. versionadded:: 0.19 l1 penalty with SAGA solver (allowing 'multinomial' + L1) dual : bool, default=False Dual or primal formulation. Dual formulation is only implemented for l2 penalty with liblinear solver. Prefer dual=False when n_samples > n_features. tol : float, default=1e-4 Tolerance for stopping criteria. C : float, default=1.0 Inverse of regularization strength; must be a positive float. Like in support vector machines, smaller values specify stronger regularization. fit_intercept : bool, default=True Specifies if a constant (a.k.a. bias or intercept) should be added to the decision function. intercept_scaling : float, default=1 Useful only when the solver 'liblinear' is used and self.fit_intercept is set to True. In this case, x becomes [x, self.intercept_scaling], i.e. a "synthetic" feature with constant value equal to intercept_scaling is appended to the instance vector. The intercept becomes ``intercept_scaling * synthetic_feature_weight``. Note! the synthetic feature weight is subject to l1/l2 regularization as all other features. To lessen the effect of regularization on synthetic feature weight (and therefore on the intercept) intercept_scaling has to be increased. class_weight : dict or 'balanced', default=None Weights associated with classes in the form ``{class_label: weight}``. If not given, all classes are supposed to have weight one. The "balanced" mode uses the values of y to automatically adjust weights inversely proportional to class frequencies in the input data as ``n_samples / (n_classes * np.bincount(y))``. Note that these weights will be multiplied with sample_weight (passed through the fit method) if sample_weight is specified. .. versionadded:: 0.17 *class_weight='balanced'* random_state : int, RandomState instance, default=None Used when ``solver`` == 'sag', 'saga' or 'liblinear' to shuffle the data. See :term:`Glossary <random_state>` for details. solver : {'newton-cg', 'lbfgs', 'liblinear', 'sag', 'saga'}, \ default='lbfgs' Algorithm to use in the optimization problem. Default is 'lbfgs'. To choose a solver, you might want to consider the following aspects: - For small datasets, 'liblinear' is a good choice, whereas 'sag' and 'saga' are faster for large ones; - For multiclass problems, only 'newton-cg', 'sag', 'saga' and 'lbfgs' handle multinomial loss; - 'liblinear' is limited to one-versus-rest schemes. .. warning:: The choice of the algorithm depends on the penalty chosen: Supported penalties by solver: - 'newton-cg' - ['l2', 'none'] - 'lbfgs' - ['l2', 'none'] - 'liblinear' - ['l1', 'l2'] - 'sag' - ['l2', 'none'] - 'saga' - ['elasticnet', 'l1', 'l2', 'none'] .. note:: 'sag' and 'saga' fast convergence is only guaranteed on features with approximately the same scale. You can preprocess the data with a scaler from :mod:`sklearn.preprocessing`. .. seealso:: Refer to the User Guide for more information regarding :class:`LogisticRegression` and more specifically the `Table <https://scikit-learn.org/dev/modules/linear_model.html#logistic-regression>`_ summarazing solver/penalty supports. <!-- # noqa: E501 --> .. versionadded:: 0.17 Stochastic Average Gradient descent solver. .. versionadded:: 0.19 SAGA solver. .. versionchanged:: 0.22 The default solver changed from 'liblinear' to 'lbfgs' in 0.22. max_iter : int, default=100 Maximum number of iterations taken for the solvers to converge. multi_class : {'auto', 'ovr', 'multinomial'}, default='auto' If the option chosen is 'ovr', then a binary problem is fit for each label. For 'multinomial' the loss minimised is the multinomial loss fit across the entire probability distribution, *even when the data is binary*. 'multinomial' is unavailable when solver='liblinear'. 'auto' selects 'ovr' if the data is binary, or if solver='liblinear', and otherwise selects 'multinomial'. .. versionadded:: 0.18 Stochastic Average Gradient descent solver for 'multinomial' case. .. versionchanged:: 0.22 Default changed from 'ovr' to 'auto' in 0.22. verbose : int, default=0 For the liblinear and lbfgs solvers set verbose to any positive number for verbosity. warm_start : bool, default=False When set to True, reuse the solution of the previous call to fit as initialization, otherwise, just erase the previous solution. Useless for liblinear solver. See :term:`the Glossary <warm_start>`. .. versionadded:: 0.17 *warm_start* to support *lbfgs*, *newton-cg*, *sag*, *saga* solvers. n_jobs : int, default=None Number of CPU cores used when parallelizing over classes if multi_class='ovr'". This parameter is ignored when the ``solver`` is set to 'liblinear' regardless of whether 'multi_class' is specified or not. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary <n_jobs>` for more details. l1_ratio : float, default=None The Elastic-Net mixing parameter, with ``0 <= l1_ratio <= 1``. Only used if ``penalty='elasticnet'``. Setting ``l1_ratio=0`` is equivalent to using ``penalty='l2'``, while setting ``l1_ratio=1`` is equivalent to using ``penalty='l1'``. For ``0 < l1_ratio <1``, the penalty is a combination of L1 and L2. Attributes ---------- classes_ : ndarray of shape (n_classes, ) A list of class labels known to the classifier. coef_ : ndarray of shape (1, n_features) or (n_classes, n_features) Coefficient of the features in the decision function. `coef_` is of shape (1, n_features) when the given problem is binary. In particular, when `multi_class='multinomial'`, `coef_` corresponds to outcome 1 (True) and `-coef_` corresponds to outcome 0 (False). intercept_ : ndarray of shape (1,) or (n_classes,) Intercept (a.k.a. bias) added to the decision function. If `fit_intercept` is set to False, the intercept is set to zero. `intercept_` is of shape (1,) when the given problem is binary. In particular, when `multi_class='multinomial'`, `intercept_` corresponds to outcome 1 (True) and `-intercept_` corresponds to outcome 0 (False). n_features_in_ : int Number of features seen during :term:`fit`. .. versionadded:: 0.24 feature_names_in_ : ndarray of shape (`n_features_in_`,) Names of features seen during :term:`fit`. Defined only when `X` has feature names that are all strings. .. versionadded:: 1.0 n_iter_ : ndarray of shape (n_classes,) or (1, ) Actual number of iterations for all classes. If binary or multinomial, it returns only 1 element. For liblinear solver, only the maximum number of iteration across all classes is given. .. versionchanged:: 0.20 In SciPy <= 1.0.0 the number of lbfgs iterations may exceed ``max_iter``. ``n_iter_`` will now report at most ``max_iter``. See Also -------- SGDClassifier : Incrementally trained logistic regression (when given the parameter ``loss="log"``). LogisticRegressionCV : Logistic regression with built-in cross validation. Notes ----- The underlying C implementation uses a random number generator to select features when fitting the model. It is thus not uncommon, to have slightly different results for the same input data. If that happens, try with a smaller tol parameter. Predict output may not match that of standalone liblinear in certain cases. See :ref:`differences from liblinear <liblinear_differences>` in the narrative documentation. References ---------- L-BFGS-B -- Software for Large-scale Bound-constrained Optimization Ciyou Zhu, Richard Byrd, Jorge Nocedal and Jose Luis Morales. http://users.iems.northwestern.edu/~nocedal/lbfgsb.html LIBLINEAR -- A Library for Large Linear Classification https://www.csie.ntu.edu.tw/~cjlin/liblinear/ SAG -- Mark Schmidt, Nicolas Le Roux, and Francis Bach Minimizing Finite Sums with the Stochastic Average Gradient https://hal.inria.fr/hal-00860051/document SAGA -- Defazio, A., Bach F. & Lacoste-Julien S. (2014). :arxiv:`"SAGA: A Fast Incremental Gradient Method With Support for Non-Strongly Convex Composite Objectives" <1407.0202>` Hsiang-Fu Yu, Fang-Lan Huang, Chih-Jen Lin (2011). Dual coordinate descent methods for logistic regression and maximum entropy models. Machine Learning 85(1-2):41-75. https://www.csie.ntu.edu.tw/~cjlin/papers/maxent_dual.pdf Examples -------- >>> from sklearn.datasets import load_iris >>> from sklearn.linear_model import LogisticRegression >>> X, y = load_iris(return_X_y=True) >>> clf = LogisticRegression(random_state=0).fit(X, y) >>> clf.predict(X[:2, :]) array([0, 0]) >>> clf.predict_proba(X[:2, :]) array([[9.8...e-01, 1.8...e-02, 1.4...e-08], [9.7...e-01, 2.8...e-02, ...e-08]]) >>> clf.score(X, y) 0.97... """ def
( self, penalty="l2", *, dual=False, tol=1e-4, C=1.0, fit_intercept=True, intercept_scaling=1, class_weight=None, random_state=None, solver="lbfgs", max_iter=100, multi_class="auto", verbose=0, warm_start=False, n_jobs=None, l1_ratio=None, ): self.penalty = penalty self.dual = dual self.tol = tol self.C = C self.fit_intercept = fit_intercept self.intercept_scaling = intercept_scaling self.class_weight = class_weight self.random_state = random_state self.solver = solver self.max_iter = max_iter self.multi_class = multi_class self.verbose = verbose self.warm_start = warm_start self.n_jobs = n_jobs self.l1_ratio = l1_ratio def fit(self, X, y, sample_weight=None): """ Fit the model according to the given training data. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Training vector, where `n_samples` is the number of samples and `n_features` is the number of features. y : array-like of shape (n_samples,) Target vector relative to X. sample_weight : array-like of shape (n_samples,) default=None Array of weights that are assigned to individual samples. If not provided, then each sample is given unit weight. .. versionadded:: 0.17 *sample_weight* support to LogisticRegression. Returns ------- self Fitted estimator. Notes ----- The SAGA solver supports both float64 and float32 bit arrays. """ solver = _check_solver(self.solver, self.penalty, self.dual) if not isinstance(self.C, numbers.Number) or self.C < 0: raise ValueError("Penalty term must be positive; got (C=%r)" % self.C) if self.penalty == "elasticnet": if ( not isinstance(self.l1_ratio, numbers.Number) or self.l1_ratio < 0 or self.l1_ratio > 1 ): raise ValueError( "l1_ratio must be between 0 and 1; got (l1_ratio=%r)" % self.l1_ratio ) elif self.l1_ratio is not None: warnings.warn( "l1_ratio parameter is only used when penalty is " "'elasticnet'. Got " "(penalty={})".format(self.penalty) ) if self.penalty == "none": if self.C != 1.0: # default values warnings.warn( "Setting penalty='none' will ignore the C and l1_ratio parameters" ) # Note that check for l1_ratio is done right above C_ = np.inf penalty = "l2" else: C_ = self.C penalty = self.penalty if not isinstance(self.max_iter, numbers.Number) or self.max_iter < 0: raise ValueError( "Maximum number of iteration must be positive; got (max_iter=%r)" % self.max_iter ) if not isinstance(self.tol, numbers.Number) or self.tol < 0: raise ValueError( "Tolerance for stopping criteria must be positive; got (tol=%r)" % self.tol ) if solver == "lbfgs": _dtype = np.float64 else: _dtype = [np.float64, np.float32] X, y = self._validate_data( X, y, accept_sparse="csr", dtype=_dtype, order="C", accept_large_sparse=solver not in ["liblinear", "sag", "saga"], ) check_classification_targets(y) self.classes_ = np.unique(y) multi_class = _check_multi_class(self.multi_class, solver, len(self.classes_)) if solver == "liblinear": if effective_n_jobs(self.n_jobs) != 1: warnings.warn( "'n_jobs' > 1 does not have any effect when" " 'solver' is set to 'liblinear'. Got 'n_jobs'" " = {}.".format(effective_n_jobs(self.n_jobs)) ) self.coef_, self.intercept_, n_iter_ = _fit_liblinear( X, y, self.C, self.fit_intercept, self.intercept_scaling, self.class_weight, self.penalty, self.dual, self.verbose, self.max_iter, self.tol, self.random_state, sample_weight=sample_weight, ) self.n_iter_ = np.array([n_iter_]) return self if solver in ["sag", "saga"]: max_squared_sum = row_norms(X, squared=True).max() else: max_squared_sum = None n_classes = len(self.classes_) classes_ = self.classes_ if n_classes < 2: raise ValueError( "This solver needs samples of at least 2 classes" " in the data, but the data contains only one" " class: %r" % classes_[0] ) if len(self.classes_) == 2: n_classes = 1 classes_ = classes_[1:] if self.warm_start: warm_start_coef = getattr(self, "coef_", None) else: warm_start_coef = None if warm_start_coef is not None and self.fit_intercept: warm_start_coef = np.append( warm_start_coef, self.intercept_[:, np.newaxis], axis=1 ) # Hack so that we iterate only once for the multinomial case. if multi_class == "multinomial": classes_ = [None] warm_start_coef = [warm_start_coef] if warm_start_coef is None: warm_start_coef = [None] * n_classes path_func = delayed(_logistic_regression_path) # The SAG solver releases the GIL so it's more efficient to use # threads for this solver. if solver in ["sag", "saga"]: prefer = "threads" else: prefer = "processes" fold_coefs_ = Parallel( n_jobs=self.n_jobs, verbose=self.verbose, **_joblib_parallel_args(prefer=prefer), )( path_func( X, y, pos_class=class_, Cs=[C_], l1_ratio=self.l1_ratio, fit_intercept=self.fit_intercept, tol=self.tol, verbose=self.verbose, solver=solver, multi_class=multi_class, max_iter=self.max_iter, class_weight=self.class_weight, check_input=False, random_state=self.random_state, coef=warm_start_coef_, penalty=penalty, max_squared_sum=max_squared_sum, sample_weight=sample_weight, ) for class_, warm_start_coef_ in zip(classes_, warm_start_coef) ) fold_coefs_, _, n_iter_ = zip(*fold_coefs_) self.n_iter_ = np.asarray(n_iter_, dtype=np.int32)[:, 0] n_features = X.shape[1] if multi_class == "multinomial": self.coef_ = fold_coefs_[0][0] else: self.coef_ = np.asarray(fold_coefs_) self.coef_ = self.coef_.reshape( n_classes, n_features + int(self.fit_intercept) ) if self.fit_intercept: self.intercept_ = self.coef_[:, -1] self.coef_ = self.coef_[:, :-1] else: self.intercept_ = np.zeros(n_classes) return self def predict_proba(self, X): """ Probability estimates. The returned estimates for all classes are ordered by the label of classes. For a multi_class problem, if multi_class is set to be "multinomial" the softmax function is used to find the predicted probability of each class. Else use a one-vs-rest approach, i.e calculate the probability of each class assuming it to be positive using the logistic function. and normalize these values across all the classes. Parameters ---------- X : array-like of shape (n_samples, n_features) Vector to be scored, where `n_samples` is the number of samples and `n_features` is the number of features. Returns ------- T : array-like of shape (n_samples, n_classes) Returns the probability of the sample for each class in the model, where classes are ordered as they are in ``self.classes_``. """ check_is_fitted(self) ovr = self.multi_class in ["ovr", "warn"] or ( self.multi_class == "auto" and (self.classes_.size <= 2 or self.solver == "liblinear") ) if ovr: return super()._predict_proba_lr(X) else: decision = self.decision_function(X) if decision.ndim == 1: # Workaround for multi_class="multinomial" and binary outcomes # which requires softmax prediction with only a 1D decision. decision_2d = np.c_[-decision, decision] else: decision_2d = decision return softmax(decision_2d, copy=False) def predict_log_proba(self, X): """ Predict logarithm of probability estimates. The returned estimates for all classes are ordered by the label of classes. Parameters ---------- X : array-like of shape (n_samples, n_features) Vector to be scored, where `n_samples` is the number of samples and `n_features` is the number of features. Returns ------- T : array-like of shape (n_samples, n_classes) Returns the log-probability of the sample for each class in the model, where classes are ordered as they are in ``self.classes_``. """ return np.log(self.predict_proba(X)) class LogisticRegressionCV(LogisticRegression, LinearClassifierMixin, BaseEstimator): """Logistic Regression CV (aka logit, MaxEnt) classifier. See glossary entry for :term:`cross-validation estimator`. This class implements logistic regression using liblinear, newton-cg, sag of lbfgs optimizer. The newton-cg, sag and lbfgs solvers support only L2 regularization with primal formulation. The liblinear solver supports both L1 and L2 regularization, with a dual formulation only for the L2 penalty. Elastic-Net penalty is only supported by the saga solver. For the grid of `Cs` values and `l1_ratios` values, the best hyperparameter is selected by the cross-validator :class:`~sklearn.model_selection.StratifiedKFold`, but it can be changed using the :term:`cv` parameter. The 'newton-cg', 'sag', 'saga' and 'lbfgs' solvers can warm-start the coefficients (see :term:`Glossary<warm_start>`). Read more in the :ref:`User Guide <logistic_regression>`. Parameters ---------- Cs : int or list of floats, default=10 Each of the values in Cs describes the inverse of regularization strength. If Cs is as an int, then a grid of Cs values are chosen in a logarithmic scale between 1e-4 and 1e4. Like in support vector machines, smaller values specify stronger regularization. fit_intercept : bool, default=True Specifies if a constant (a.k.a. bias or intercept) should be added to the decision function. cv : int or cross-validation generator, default=None The default cross-validation generator used is Stratified K-Folds. If an integer is provided, then it is the number of folds used. See the module :mod:`sklearn.model_selection` module for the list of possible cross-validation objects. .. versionchanged:: 0.22 ``cv`` default value if None changed from 3-fold to 5-fold. dual : bool, default=False Dual or primal formulation. Dual formulation is only implemented for l2 penalty with liblinear solver. Prefer dual=False when n_samples > n_features. penalty : {'l1', 'l2', 'elasticnet'}, default='l2' Specify the norm of the penalty: - `'l2'`: add a L2 penalty term (used by default); - `'l1'`: add a L1 penalty term; - `'elasticnet'`: both L1 and L2 penalty terms are added. .. warning:: Some penalties may not work with some solvers. See the parameter `solver` below, to know the compatibility between the penalty and solver. scoring : str or callable, default=None A string (see model evaluation documentation) or a scorer callable object / function with signature ``scorer(estimator, X, y)``. For a list of scoring functions that can be used, look at :mod:`sklearn.metrics`. The default scoring option used is 'accuracy'. solver : {'newton-cg', 'lbfgs', 'liblinear', 'sag', 'saga'}, \ default='lbfgs' Algorithm to use in the optimization problem. Default is 'lbfgs'. To choose a solver, you might want to consider the following aspects: - For small datasets, 'liblinear' is a good choice, whereas 'sag' and 'saga' are faster for large ones; - For multiclass problems, only 'newton-cg', 'sag', 'saga' and 'lbfgs' handle multinomial loss; - 'liblinear' might be slower in :class:`LogisticRegressionCV` because it does not handle warm-starting. 'liblinear' is limited to one-versus-rest schemes. .. warning:: The choice of the algorithm depends on the penalty chosen: - 'newton-cg' - ['l2'] - 'lbfgs' - ['l2'] - 'liblinear' - ['l1', 'l2'] - 'sag' - ['l2'] - 'saga' - ['elasticnet', 'l1', 'l2'] .. note:: 'sag' and 'saga' fast convergence is only guaranteed on features with approximately the same scale. You can preprocess the data with a scaler from :mod:`sklearn.preprocessing`. .. versionadded:: 0.17 Stochastic Average Gradient descent solver. .. versionadded:: 0.19 SAGA solver. tol : float, default=1e-4 Tolerance for stopping criteria. max_iter : int, default=100 Maximum number of iterations of the optimization algorithm. class_weight : dict or 'balanced', default=None Weights associated with classes in the form ``{class_label: weight}``. If not given, all classes are supposed to have weight one. The "balanced" mode uses the values of y to automatically adjust weights inversely proportional to class frequencies in the input data as ``n_samples / (n_classes * np.bincount(y))``. Note that these weights will be multiplied with sample_weight (passed through the fit method) if sample_weight is specified. .. versionadded:: 0.17 class_weight == 'balanced' n_jobs : int, default=None Number of CPU cores used during the cross-validation loop. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary <n_jobs>` for more details. verbose : int, default=0 For the 'liblinear', 'sag' and 'lbfgs' solvers set verbose to any positive number for verbosity. refit : bool, default=True If set to True, the scores are averaged across all folds, and the coefs and the C that corresponds to the best score is taken, and a final refit is done using these parameters. Otherwise the coefs, intercepts and C that correspond to the best scores across folds are averaged. intercept_scaling : float, default=1 Useful only when the solver 'liblinear' is used and self.fit_intercept is set to True. In this case, x becomes [x, self.intercept_scaling], i.e. a "synthetic" feature with constant value equal to intercept_scaling is appended to the instance vector. The intercept becomes ``intercept_scaling * synthetic_feature_weight``. Note! the synthetic feature weight is subject to l1/l2 regularization as all other features. To lessen the effect of regularization on synthetic feature weight (and therefore on the intercept) intercept_scaling has to be increased. multi_class : {'auto, 'ovr', 'multinomial'}, default='auto' If the option chosen is 'ovr', then a binary problem is fit for each label. For 'multinomial' the loss minimised is the multinomial loss fit across the entire probability distribution, *even when the data is binary*. 'multinomial' is unavailable when solver='liblinear'. 'auto' selects 'ovr' if the data is binary, or if solver='liblinear', and otherwise selects 'multinomial'. .. versionadded:: 0.18 Stochastic Average Gradient descent solver for 'multinomial' case. .. versionchanged:: 0.22 Default changed from 'ovr' to 'auto' in 0.22. random_state : int, RandomState instance, default=None Used when `solver='sag'`, 'saga' or 'liblinear' to shuffle the data. Note that this only applies to the solver and not the cross-validation generator. See :term:`Glossary <random_state>` for details. l1_ratios : list of float, default=None The list of Elastic-Net mixing parameter, with ``0 <= l1_ratio <= 1``. Only used if ``penalty='elasticnet'``. A value of 0 is equivalent to using ``penalty='l2'``, while 1 is equivalent to using ``penalty='l1'``. For ``0 < l1_ratio <1``, the penalty is a combination of L1 and L2. Attributes ---------- classes_ : ndarray of shape (n_classes, ) A list of class labels known to the classifier. coef_ : ndarray of shape (1, n_features) or (n_classes, n_features) Coefficient of the features in the decision function. `coef_` is of shape (1, n_features) when the given problem is binary. intercept_ : ndarray of shape (1,) or (n_classes,) Intercept (a.k.a. bias) added to the decision function. If `fit_intercept` is set to False, the intercept is set to zero. `intercept_` is of shape(1,) when the problem is binary. Cs_ : ndarray of shape (n_cs) Array of C i.e. inverse of regularization parameter values used for cross-validation. l1_ratios_ : ndarray of shape (n_l1_ratios) Array of l1_ratios used for cross-validation. If no l1_ratio is used (i.e. penalty is not 'elasticnet'), this is set to ``[None]`` coefs_paths_ : ndarray of shape (n_folds, n_cs, n_features) or \ (n_folds, n_cs, n_features + 1) dict with classes as the keys, and the path of coefficients obtained during cross-validating across each fold and then across each Cs after doing an OvR for the corresponding class as values. If the 'multi_class' option is set to 'multinomial', then the coefs_paths are the coefficients corresponding to each class. Each dict value has shape ``(n_folds, n_cs, n_features)`` or ``(n_folds, n_cs, n_features + 1)`` depending on whether the intercept is fit or not. If ``penalty='elasticnet'``, the shape is ``(n_folds, n_cs, n_l1_ratios_, n_features)`` or ``(n_folds, n_cs, n_l1_ratios_, n_features + 1)``. scores_ : dict dict with classes as the keys, and the values as the grid of scores obtained during cross-validating each fold, after doing an OvR for the corresponding class. If the 'multi_class' option given is 'multinomial' then the same scores are repeated across all classes, since this is the multinomial class. Each dict value has shape ``(n_folds, n_cs`` or ``(n_folds, n_cs, n_l1_ratios)`` if ``penalty='elasticnet'``. C_ : ndarray of shape (n_classes,) or (n_classes - 1,) Array of C that maps to the best scores across every class. If refit is set to False, then for each class, the best C is the average of the C's that correspond to the best scores for each fold. `C_` is of shape(n_classes,) when the problem is binary. l1_ratio_ : ndarray of shape (n_classes,) or (n_classes - 1,) Array of l1_ratio that maps to the best scores across every class. If refit is set to False, then for each class, the best l1_ratio is the average of the l1_ratio's that correspond to the best scores for each fold. `l1_ratio_` is of shape(n_classes,) when the problem is binary. n_iter_ : ndarray of shape (n_classes, n_folds, n_cs) or (1, n_folds, n_cs) Actual number of iterations for all classes, folds and Cs. In the binary or multinomial cases, the first dimension is equal to 1. If ``penalty='elasticnet'``, the shape is ``(n_classes, n_folds, n_cs, n_l1_ratios)`` or ``(1, n_folds, n_cs, n_l1_ratios)``. n_features_in_ : int Number of features seen during :term:`fit`. .. versionadded:: 0.24 feature_names_in_ : ndarray of shape (`n_features_in_`,) Names of features seen during :term:`fit`. Defined only when `X` has feature names that are all strings. .. versionadded:: 1.0 See Also -------- LogisticRegression : Logistic regression without tuning the hyperparameter `C`. Examples -------- >>> from sklearn.datasets import load_iris >>> from sklearn.linear_model import LogisticRegressionCV >>> X, y = load_iris(return_X_y=True) >>> clf = LogisticRegressionCV(cv=5, random_state=0).fit(X, y) >>> clf.predict(X[:2, :]) array([0, 0]) >>> clf.predict_proba(X[:2, :]).shape (2, 3) >>> clf.score(X, y) 0.98... """ def __init__( self, *, Cs=10, fit_intercept=True, cv=None, dual=False, penalty="l2", scoring=None, solver="lbfgs", tol=1e-4, max_iter=100, class_weight=None, n_jobs=None, verbose=0, refit=True, intercept_scaling=1.0, multi_class="auto", random_state=None, l1_ratios=None, ): self.Cs = Cs self.fit_intercept = fit_intercept self.cv = cv self.dual = dual self.penalty = penalty self.scoring = scoring self.tol = tol self.max_iter = max_iter self.class_weight = class_weight self.n_jobs = n_jobs self.verbose = verbose self.solver = solver self.refit = refit self.intercept_scaling = intercept_scaling self.multi_class = multi_class self.random_state = random_state self.l1_ratios = l1_ratios def fit(self, X, y, sample_weight=None): """Fit the model according to the given training data. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Training vector, where `n_samples` is the number of samples and `n_features` is the number of features. y : array-like of shape (n_samples,) Target vector relative to X. sample_weight : array-like of shape (n_samples,) default=None Array of weights that are assigned to individual samples. If not provided, then each sample is given unit weight. Returns ------- self : object Fitted LogisticRegressionCV estimator. """ solver = _check_solver(self.solver, self.penalty, self.dual) if not isinstance(self.max_iter, numbers.Number) or self.max_iter < 0: raise ValueError( "Maximum number of iteration must be positive; got (max_iter=%r)" % self.max_iter ) if not isinstance(self.tol, numbers.Number) or self.tol < 0: raise ValueError( "Tolerance for stopping criteria must be positive; got (tol=%r)" % self.tol ) if self.penalty == "elasticnet": if ( self.l1_ratios is None or len(self.l1_ratios) == 0 or any( ( not isinstance(l1_ratio, numbers.Number) or l1_ratio < 0 or l1_ratio > 1 ) for l1_ratio in self.l1_ratios ) ): raise ValueError( "l1_ratios must be a list of numbers between " "0 and 1; got (l1_ratios=%r)" % self.l1_ratios ) l1_ratios_ = self.l1_ratios else: if self.l1_ratios is not None: warnings.warn( "l1_ratios parameter is only used when penalty " "is 'elasticnet'. Got (penalty={})".format(self.penalty) ) l1_ratios_ = [None] if self.penalty == "none": raise ValueError( "penalty='none' is not useful and not supported by " "LogisticRegressionCV." ) X, y = self._validate_data( X, y, accept_sparse="csr", dtype=np.float64, order="C", accept_large_sparse=solver not in ["liblinear", "sag", "saga"], ) check_classification_targets(y) class_weight = self.class_weight # Encode for string labels label_encoder = LabelEncoder().fit(y) y = label_encoder.transform(y) if isinstance(class_weight, dict): class_weight = { label_encoder.transform([cls])[0]: v for cls, v in class_weight.items() } # The original class labels classes = self.classes_ = label_encoder.classes_ encoded_labels = label_encoder.transform(label_encoder.classes_) multi_class = _check_multi_class(self.multi_class, solver, len(classes)) if solver in ["sag", "saga"]: max_squared_sum = row_norms(X, squared=True).max() else: max_squared_sum = None # init cross-validation generator cv = check_cv(self.cv, y, classifier=True) folds = list(cv.split(X, y)) # Use the label encoded classes n_classes = len(encoded_labels) if n_classes < 2: raise ValueError( "This solver needs samples of at least 2 classes" " in the data, but the data contains only one" " class: %r" % classes[0] ) if n_classes == 2: # OvR in case of binary problems is as good as fitting # the higher label n_classes = 1 encoded_labels = encoded_labels[1:] classes = classes[1:] # We need this hack to iterate only once over labels, in the case of # multi_class = multinomial, without changing the value of the labels. if multi_class == "multinomial": iter_encoded_labels = iter_classes = [None] else: iter_encoded_labels = encoded_labels iter_classes = classes # compute the class weights for the entire dataset y if class_weight == "balanced": class_weight = compute_class_weight( class_weight, classes=np.arange(len(self.classes_)), y=y ) class_weight = dict(enumerate(class_weight)) path_func = delayed(_log_reg_scoring_path) # The SAG solver releases the GIL so it's more efficient to use # threads for this solver. if self.solver in ["sag", "saga"]: prefer = "threads" else: prefer = "processes" fold_coefs_ = Parallel( n_jobs=self.n_jobs, verbose=self.verbose, **_joblib_parallel_args(prefer=prefer), )( path_func( X, y, train, test, pos_class=label, Cs=self.Cs, fit_intercept=self.fit_intercept, penalty=self.penalty, dual=self.dual, solver=solver, tol=self.tol, max_iter=self.max_iter, verbose=self.verbose, class_weight=class_weight, scoring=self.scoring, multi_class=multi_class, intercept_scaling=self.intercept_scaling, random_state=self.random_state, max_squared_sum=max_squared_sum, sample_weight=sample_weight, l1_ratio=l1_ratio, ) for label in iter_encoded_labels for train, test in folds for l1_ratio in l1_ratios_ ) # _log_reg_scoring_path will output different shapes depending on the # multi_class param, so we need to reshape the outputs accordingly. # Cs is of shape (n_classes . n_folds . n_l1_ratios, n_Cs) and all the # rows are equal, so we just take the first one. # After reshaping, # - scores is of shape (n_classes, n_folds, n_Cs . n_l1_ratios) # - coefs_paths is of shape # (n_classes, n_folds, n_Cs . n_l1_ratios, n_features) # - n_iter is of shape # (n_classes, n_folds, n_Cs . n_l1_ratios) or # (1, n_folds, n_Cs . n_l1_ratios) coefs_paths, Cs, scores, n_iter_ = zip(*fold_coefs_) self.Cs_ = Cs[0] if multi_class == "multinomial": coefs_paths = np.reshape( coefs_paths, (len(folds), len(l1_ratios_) * len(self.Cs_), n_classes, -1), ) # equiv to coefs_paths = np.moveaxis(coefs_paths, (0, 1, 2, 3), # (1, 2, 0, 3)) coefs_paths = np.swapaxes(coefs_paths, 0, 1) coefs_paths = np.swapaxes(coefs_paths, 0, 2) self.n_iter_ = np.reshape( n_iter_, (1, len(folds), len(self.Cs_) * len(l1_ratios_)) ) # repeat same scores across all classes scores = np.tile(scores, (n_classes, 1, 1)) else: coefs_paths = np.reshape( coefs_paths, (n_classes, len(folds), len(self.Cs_) * len(l1_ratios_), -1), ) self.n_iter_ = np.reshape( n_iter_, (n_classes, len(folds), len(self.Cs_) * len(l1_ratios_)) ) scores = np.reshape(scores, (n_classes, len(folds), -1)) self.scores_ = dict(zip(classes, scores)) self.coefs_paths_ = dict(zip(classes, coefs_paths)) self.C_ = list() self.l1_ratio_ = list() self.coef_ = np.empty((n_classes, X.shape[1])) self.intercept_ = np.zeros(n_classes) for index, (cls, encoded_label) in enumerate( zip(iter_classes, iter_encoded_labels) ): if multi_class == "ovr": scores = self.scores_[cls] coefs_paths = self.coefs_paths_[cls] else: # For multinomial, all scores are the same across classes scores = scores[0] # coefs_paths will keep its original shape because # logistic_regression_path expects it this way if self.refit: # best_index is between 0 and (n_Cs . n_l1_ratios - 1) # for example, with n_cs=2 and n_l1_ratios=3 # the layout of scores is # [c1, c2, c1, c2, c1, c2] # l1_1 , l1_2 , l1_3 best_index = scores.sum(axis=0).argmax() best_index_C = best_index % len(self.Cs_) C_ = self.Cs_[best_index_C] self.C_.append(C_) best_index_l1 = best_index // len(self.Cs_) l1_ratio_ = l1_ratios_[best_index_l1] self.l1_ratio_.append(l1_ratio_) if multi_class == "multinomial": coef_init = np.mean(coefs_paths[:, :, best_index, :], axis=1) else: coef_init = np.mean(coefs_paths[:, best_index, :], axis=0) # Note that y is label encoded and hence pos_class must be # the encoded label / None (for 'multinomial') w, _, _ = _logistic_regression_path( X, y, pos_class=encoded_label, Cs=[C_], solver=solver, fit_intercept=self.fit_intercept, coef=coef_init, max_iter=self.max_iter, tol=self.tol, penalty=self.penalty, class_weight=class_weight, multi_class=multi_class, verbose=max(0, self.verbose - 1), random_state=self.random_state, check_input=False, max_squared_sum=max_squared_sum, sample_weight=sample_weight, l1_ratio=l1_ratio_, ) w = w[0] else: # Take the best scores across every fold and the average of # all coefficients corresponding to the best scores. best_indices = np.argmax(scores, axis=1) if multi_class == "ovr": w = np.mean( [coefs_paths[i, best_indices[i], :] for i in range(len(folds))], axis=0, ) else: w = np.mean( [ coefs_paths[:, i, best_indices[i], :] for i in range(len(folds)) ], axis=0, ) best_indices_C = best_indices % len(self.Cs_) self.C_.append(np.mean(self.Cs_[best_indices_C])) if self.penalty == "elasticnet": best_indices_l1 = best_indices // len(self.Cs_) self.l1_ratio_.append(np.mean(l1_ratios_[best_indices_l1])) else: self.l1_ratio_.append(None) if multi_class == "multinomial": self.C_ = np.tile(self.C_, n_classes) self.l1_ratio_ = np.tile(self.l1_ratio_, n_classes) self.coef_ = w[:, : X.shape[1]] if self.fit_intercept: self.intercept_ = w[:, -1] else: self.coef_[index] = w[: X.shape[1]] if self.fit_intercept: self.intercept_[index] = w[-1] self.C_ = np.asarray(self.C_) self.l1_ratio_ = np.asarray(self.l1_ratio_) self.l1_ratios_ = np.asarray(l1_ratios_) # if elasticnet was used, add the l1_ratios dimension to some # attributes if self.l1_ratios is not None: # with n_cs=2 and n_l1_ratios=3 # the layout of scores is # [c1, c2, c1, c2, c1, c2] # l1_1 , l1_2 , l1_3 # To get a 2d array with the following layout # l1_1, l1_2, l1_3 # c1 [[ . , . , . ], # c2 [ . , . , . ]] # We need to first reshape and then transpose. # The same goes for the other arrays for cls, coefs_path in self.coefs_paths_.items(): self.coefs_paths_[cls] = coefs_path.reshape( (len(folds), self.l1_ratios_.size, self.Cs_.size, -1) ) self.coefs_paths_[cls] = np.transpose( self.coefs_paths_[cls], (0, 2, 1, 3) ) for cls, score in self.scores_.items(): self.scores_[cls] = score.reshape( (len(folds), self.l1_ratios_.size, self.Cs_.size) ) self.scores_[cls] = np.transpose(self.scores_[cls], (0, 2, 1)) self.n_iter_ = self.n_iter_.reshape( (-1, len(folds), self.l1_ratios_.size, self.Cs_.size) ) self.n_iter_ = np.transpose(self.n_iter_, (0, 1, 3, 2)) return self def score(self, X, y, sample_weight=None): """Score using the `scoring` option on the given test data and labels. Parameters ---------- X : array-like of shape (n_samples, n_features) Test samples. y : array-like of shape (n_samples,) True labels for X. sample_weight : array-like of shape (n_samples,), default=None Sample weights. Returns ------- score : float Score of self.predict(X) wrt. y. """ scoring = self.scoring or "accuracy" scoring = get_scorer(scoring) return scoring(self, X, y, sample_weight=sample_weight) def _more_tags(self): return { "_xfail_checks": { "check_sample_weights_invariance": ( "zero sample_weight is not equivalent to removing samples" ), } }
__init__
ffi.rs
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use std::{ any::Any, borrow::Cow, ffi::{c_void, CString}, path::PathBuf, rc::Rc, }; use deno_core::{ error::AnyError, serde_json::{self, json, Value}, OpState, Resource, ZeroCopyBuf, }; use dlopen::symbor::Library; use libc::c_char; use libffi::high as ffi; use serde::Deserialize; #[derive(Deserialize)] #[serde(rename_all = "camelCase")] struct LoadLibarayArgs { filename: String, } #[derive(Deserialize)] #[serde(rename_all = "camelCase")] struct CallParam { type_name: String, value: Value, } #[derive(Deserialize)] #[serde(rename_all = "camelCase")] struct CallLibarayFfiArgs { rid: u32, name: String, params: Vec<CallParam>, return_type: String, } struct DylibResource { lib: Rc<Library>, } impl Resource for DylibResource { fn name(&self) -> Cow<str> { "dylib".into() } } impl DylibResource { fn new(lib: &Rc<Library>) -> Self { Self { lib: lib.clone() } } } pub fn init(rt: &mut deno_core::JsRuntime) { super::reg_json_sync(rt, "op_load_libaray", op_load_libaray); super::reg_json_sync(rt, "op_call_libaray_ffi", op_call_libaray_ffi); } fn op_load_libaray( state: &mut OpState, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<Value, AnyError> { let args: LoadLibarayArgs = serde_json::from_value(args)?; let filename = PathBuf::from(&args.filename); debug!("Loading Libaray: {:#?}", filename); let dy_lib = Library::open(filename).map(Rc::new)?; let dylib_resource = DylibResource::new(&dy_lib); let rid = state.resource_table.add(dylib_resource); Ok(json!(rid)) } fn op_call_libaray_ffi( state: &mut OpState, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<Value, AnyError> { let args: CallLibarayFfiArgs = serde_json::from_value(args)?; let mut call_args: Vec<(Box<dyn Any>, String)> = vec![]; args .params .iter() .for_each(|param| match param.type_name.as_str() { "i8" => { let val = param.value.as_i64().unwrap() as i8; call_args.push((Box::new(val), param.type_name.clone())); } "i16" => { let val = param.value.as_i64().unwrap() as i16; call_args.push((Box::new(val), param.type_name.clone())); } "i32" => { let val = param.value.as_i64().unwrap() as i32; call_args.push((Box::new(val), param.type_name.clone())); } "i64" => { let val = param.value.as_i64().unwrap(); call_args.push((Box::new(val), param.type_name.clone())); } "u8" => { let val = param.value.as_u64().unwrap() as u8; call_args.push((Box::new(val), param.type_name.clone())); } "u16" => { let val = param.value.as_u64().unwrap() as u16; call_args.push((Box::new(val), param.type_name.clone())); } "u32" => { let val = param.value.as_u64().unwrap() as u32; call_args.push((Box::new(val), param.type_name.clone())); } "u64" => { let val = param.value.as_u64().unwrap(); call_args.push((Box::new(val), param.type_name.clone())); } "f32" => { let val = param.value.as_f64().unwrap() as f32; call_args.push((Box::new(val), param.type_name.clone())); } "f64" => { let val = param.value.as_f64().unwrap(); call_args.push((Box::new(val), param.type_name.clone())); } "cstr" => { let val = param.value.as_str().unwrap(); let cstr = val.as_ptr() as *const c_char; call_args.push((Box::new(cstr), param.type_name.clone())); } _ => {} }); let params: Vec<ffi::Arg> = call_args .iter() .map(|param| { let (val, name) = param; match name.as_str() { "i8" => { let v = val.downcast_ref::<i8>().unwrap(); ffi::arg(&*v) } "i16" => { let v = val.downcast_ref::<i16>().unwrap(); ffi::arg(&*v)
} "i32" => { let v = val.downcast_ref::<i32>().unwrap(); ffi::arg(&*v) } "i64" => { let v = val.downcast_ref::<i64>().unwrap(); ffi::arg(&*v) } "u8" => { let v = val.downcast_ref::<u8>().unwrap(); ffi::arg(&*v) } "u16" => { let v = val.downcast_ref::<u16>().unwrap(); ffi::arg(&*v) } "u32" => { let v = val.downcast_ref::<u32>().unwrap(); ffi::arg(&*v) } "u64" => { let v = val.downcast_ref::<u64>().unwrap(); ffi::arg(&*v) } "f32" => { let v = val.downcast_ref::<f32>().unwrap(); ffi::arg(&*v) } "f64" => { let v = val.downcast_ref::<f64>().unwrap(); ffi::arg(&*v) } "cstr" => { let v = val.downcast_ref::<*const c_char>().unwrap(); ffi::arg(&*v) } _ => ffi::arg(&()), } }) .collect(); let lib = state .resource_table .get::<DylibResource>(args.rid) .unwrap() .lib .clone(); let fn_ptr: *const c_void = *unsafe { lib.symbol(&args.name) }?; let fn_code_ptr = ffi::CodePtr::from_ptr(fn_ptr); let ret = match args.return_type.as_str() { "i8" => { json!(unsafe { ffi::call::<i8>(fn_code_ptr, params.as_slice()) }) } "i16" => { json!(unsafe { ffi::call::<i16>(fn_code_ptr, params.as_slice()) }) } "i32" => { json!(unsafe { ffi::call::<i32>(fn_code_ptr, params.as_slice()) }) } "i64" => { json!(unsafe { ffi::call::<i32>(fn_code_ptr, params.as_slice()) }) } "u8" => { json!(unsafe { ffi::call::<u8>(fn_code_ptr, params.as_slice()) }) } "u16" => { json!(unsafe { ffi::call::<u16>(fn_code_ptr, params.as_slice()) }) } "u32" => { json!(unsafe { ffi::call::<u32>(fn_code_ptr, params.as_slice()) }) } "u64" => { json!(unsafe { ffi::call::<u64>(fn_code_ptr, params.as_slice()) }) } "f32" => { json!(unsafe { ffi::call::<f32>(fn_code_ptr, params.as_slice()) }) } "f64" => { json!(unsafe { ffi::call::<f64>(fn_code_ptr, params.as_slice()) }) } "cstr" => { let val = unsafe { let ptr = ffi::call::<*mut c_char>(fn_code_ptr, params.as_slice()); CString::from_raw(ptr) }; json!(val.into_string().unwrap()) } _ => { unsafe { ffi::call::<()>(fn_code_ptr, params.as_slice()) }; json!(null) } }; Ok(ret) }
test_cfplot.py
import os import cf import matplotlib.pyplot as plt import cfplot as cfp pngs = ['tas.png', 'ggap1.png', 'ggap2.png'] cfp.setvars(file=pngs[0]) f=cf.read('testdata/tas_A1.nc')[0] cfp.con(f.subspace(time=15)) cfp.setvars(file=pngs[1]) f=cf.read('testdata/ggap.nc')[1] cfp.mapset(proj='npstere') cfp.con(f.subspace(pressure=500))
cfp.gopen(rows=2, columns=2, bottom=0.2) cfp.gpos(1) cfp.con(f.subspace(pressure=500), lines=False, colorbar=None) cfp.gpos(2) cfp.mapset(proj='moll') cfp.con(f.subspace(pressure=500), lines=False, colorbar=None) cfp.gpos(3) cfp.mapset(proj='npstere', boundinglat=30, lon_0=180) cfp.con(f.subspace(pressure=500), lines=False, colorbar=None) cfp.gpos(4) cfp.mapset(proj='spstere', boundinglat=-30, lon_0=0) cfp.con(f.subspace(pressure=500), lines=False, colorbar_position=[0.1, 0.1, 0.8, 0.02], colorbar_orientation='horizontal') cfp.gclose() for png in pngs: if not os.path.isfile(png): raise Exception(f'PNG not written: {png}') os.system(f'display {png} &') resp = input('Did you see 3 images? ') print('Please close the images') if not resp.lower().startswith('y'): raise Exception('cfplot tests failed.')
cfp.setvars(file=pngs[2]) f=cf.read('testdata/ggap.nc')[1]
predictor.py
from scipy.io.wavfile import read import numpy as np import io import csv class TensorFlowPredictor: def __init__(self, tensorflow_client, config): self.client = tensorflow_client self.class_names = self.class_names_from_csv("class_names.csv") def class_names_from_csv(self, csv_file): class_names = [] with open(csv_file, "r", newline="") as f: for row in csv.reader(f, delimiter=","): class_names.append(row[2]) return class_names def predict(self, payload):
rate, data = read(io.BytesIO(payload)) assert rate == 16000 result = self.client.predict({"waveform": np.array(data, dtype=np.float32)}) scores = np.array(result["output_0"]).reshape((-1, 521)) predicted_class = self.class_names[scores.mean(axis=0).argmax() + 1] return predicted_class
mesh_utils.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### # <pep8-80 compliant> __all__ = ( "mesh_linked_uv_islands", "mesh_linked_triangles", "edge_face_count_dict", "edge_face_count", "edge_loops_from_edges", "ngon_tessellate", "triangle_random_points", ) def mesh_linked_uv_islands(mesh): """ Splits the mesh into connected polygons, use this for separating cubes from other mesh elements within 1 mesh datablock. :arg mesh: the mesh used to group with. :type mesh: :class:`bpy.types.Mesh` :return: lists of lists containing polygon indices :rtype: list """ uv_loops = [luv.uv[:] for luv in mesh.uv_layers.active.data] poly_loops = [poly.loop_indices for poly in mesh.polygons] luv_hash = {} luv_hash_get = luv_hash.get luv_hash_ls = [None] * len(uv_loops) for pi, poly_indices in enumerate(poly_loops): for li in poly_indices: uv = uv_loops[li] uv_hub = luv_hash_get(uv) if uv_hub is None: uv_hub = luv_hash[uv] = [pi] else: uv_hub.append(pi) luv_hash_ls[li] = uv_hub poly_islands = [] # 0 = none, 1 = added, 2 = searched poly_tag = [0] * len(poly_loops) while True: poly_index = -1 for i in range(len(poly_loops)): if poly_tag[i] == 0: poly_index = i break if poly_index != -1: island = [poly_index] poly_tag[poly_index] = 1 poly_islands.append(island) else: break # we're done added = True while added: added = False for poly_index in island[:]: if poly_tag[poly_index] == 1: for li in poly_loops[poly_index]: for poly_index_shared in luv_hash_ls[li]: if poly_tag[poly_index_shared] == 0: added = True poly_tag[poly_index_shared] = 1 island.append(poly_index_shared) poly_tag[poly_index] = 2 return poly_islands def mesh_linked_triangles(mesh): """ Splits the mesh into connected triangles, use this for separating cubes from other mesh elements within 1 mesh datablock. :arg mesh: the mesh used to group with. :type mesh: :class:`bpy.types.Mesh` :return: lists of lists containing triangles. :rtype: list """ # Build vert face connectivity vert_tris = [[] for i in range(len(mesh.vertices))] for t in mesh.loop_triangles: for v in t.vertices: vert_tris[v].append(t) # sort triangles into connectivity groups tri_groups = [[t] for t in mesh.loop_triangles] # map old, new tri location tri_mapping = list(range(len(mesh.loop_triangles))) # Now clump triangles iteratively ok = True while ok: ok = False for t in mesh.loop_triangles: mapped_index = tri_mapping[t.index] mapped_group = tri_groups[mapped_index] for v in t.vertices: for nxt_t in vert_tris[v]: if nxt_t != t: nxt_mapped_index = tri_mapping[nxt_t.index] # We are not a part of the same group if mapped_index != nxt_mapped_index: ok = True # Assign mapping to this group so they # all map to this group for grp_t in tri_groups[nxt_mapped_index]: tri_mapping[grp_t.index] = mapped_index # Move triangles into this group mapped_group.extend(tri_groups[nxt_mapped_index]) # remove reference to the list tri_groups[nxt_mapped_index] = None # return all tri groups that are not null # this is all the triangles that are connected in their own lists. return [tg for tg in tri_groups if tg] def edge_face_count_dict(mesh): """ :return: dict of edge keys with their value set to the number of faces using each edge. :rtype: dict """ face_edge_count = {} loops = mesh.loops edges = mesh.edges for poly in mesh.polygons: for i in poly.loop_indices: key = edges[loops[i].edge_index].key try: face_edge_count[key] += 1 except: face_edge_count[key] = 1 return face_edge_count def edge_face_count(mesh): """ :return: list face users for each item in mesh.edges. :rtype: list """ edge_face_count = edge_face_count_dict(mesh) get = dict.get return [get(edge_face_count, ed.key, 0) for ed in mesh.edges] def edge_loops_from_edges(mesh, edges=None): """ Edge loops defined by edges Takes me.edges or a list of edges and returns the edge loops return a list of vertex indices. [ [1, 6, 7, 2], ...] closed loops have matching start and end values. """ line_polys = [] # Get edges not used by a face if edges is None: edges = mesh.edges if not hasattr(edges, "pop"): edges = edges[:] while edges: current_edge = edges.pop() vert_end, vert_start = current_edge.vertices[:] line_poly = [vert_start, vert_end] ok = True while ok: ok = False # for i, ed in enumerate(edges): i = len(edges) while i: i -= 1 ed = edges[i] v1, v2 = ed.vertices if v1 == vert_end: line_poly.append(v2) vert_end = line_poly[-1] ok = 1 del edges[i] # break elif v2 == vert_end: line_poly.append(v1) vert_end = line_poly[-1] ok = 1 del edges[i] # break elif v1 == vert_start: line_poly.insert(0, v2) vert_start = line_poly[0] ok = 1 del edges[i] # break elif v2 == vert_start: line_poly.insert(0, v1) vert_start = line_poly[0] ok = 1 del edges[i] # break line_polys.append(line_poly) return line_polys def ngon_tessellate(from_data, indices, fix_loops=True, debug_print=True): """ Takes a polyline of indices (ngon) and returns a list of face index lists. Designed to be used for importers that need indices for an ngon to create from existing verts. :arg from_data: either a mesh, or a list/tuple of vectors. :type from_data: list or :class:`bpy.types.Mesh` :arg indices: a list of indices to use this list is the ordered closed polyline to fill, and can be a subset of the data given. :type indices: list :arg fix_loops: If this is enabled polylines that use loops to make multiple polylines are delt with correctly. :type fix_loops: bool """ from mathutils.geometry import tessellate_polygon from mathutils import Vector vector_to_tuple = Vector.to_tuple if not indices: return [] def mlen(co): # Manhatten length of a vector, faster then length. return abs(co[0]) + abs(co[1]) + abs(co[2]) def vert_treplet(v, i):
def ed_key_mlen(v1, v2): if v1[3] > v2[3]: return v2[1], v1[1] else: return v1[1], v2[1] if not fix_loops: # Normal single concave loop filling. if type(from_data) in {tuple, list}: verts = [Vector(from_data[i]) for ii, i in enumerate(indices)] else: verts = [from_data.vertices[i].co for ii, i in enumerate(indices)] # same as reversed(range(1, len(verts))): for i in range(len(verts) - 1, 0, -1): if verts[i][1] == verts[i - 1][0]: verts.pop(i - 1) fill = tessellate_polygon([verts]) else: # Separate this loop into multiple loops be finding edges that are # used twice. This is used by Light-Wave LWO files a lot. if type(from_data) in {tuple, list}: verts = [ vert_treplet(Vector(from_data[i]), ii) for ii, i in enumerate(indices) ] else: verts = [ vert_treplet(from_data.vertices[i].co, ii) for ii, i in enumerate(indices) ] edges = [(i, i - 1) for i in range(len(verts))] if edges: edges[0] = (0, len(verts) - 1) if not verts: return [] edges_used = set() edges_doubles = set() # We need to check if any edges are used twice location based. for ed in edges: edkey = ed_key_mlen(verts[ed[0]], verts[ed[1]]) if edkey in edges_used: edges_doubles.add(edkey) else: edges_used.add(edkey) # Store a list of unconnected loop segments split by double edges. # will join later loop_segments = [] v_prev = verts[0] context_loop = [v_prev] loop_segments = [context_loop] for v in verts: if v != v_prev: # Are we crossing an edge we removed? if ed_key_mlen(v, v_prev) in edges_doubles: context_loop = [v] loop_segments.append(context_loop) else: if context_loop and context_loop[-1][1] == v[1]: pass else: context_loop.append(v) v_prev = v # Now join loop segments def join_seg(s1, s2): if s2[-1][1] == s1[0][1]: s1, s2 = s2, s1 elif s1[-1][1] == s2[0][1]: pass else: return False # If were still here s1 and s2 are 2 segments in the same poly-line. s1.pop() # remove the last vert from s1 s1.extend(s2) # add segment 2 to segment 1 if s1[0][1] == s1[-1][1]: # remove endpoints double s1.pop() del s2[:] # Empty this segment s2 so we don't use it again. return True joining_segments = True while joining_segments: joining_segments = False segcount = len(loop_segments) for j in range(segcount - 1, -1, -1): # reversed(range(segcount)): seg_j = loop_segments[j] if seg_j: for k in range(j - 1, -1, -1): # reversed(range(j)): if not seg_j: break seg_k = loop_segments[k] if seg_k and join_seg(seg_j, seg_k): joining_segments = True loop_list = loop_segments for verts in loop_list: while verts and verts[0][1] == verts[-1][1]: verts.pop() loop_list = [verts for verts in loop_list if len(verts) > 2] # DONE DEALING WITH LOOP FIXING # vert mapping vert_map = [None] * len(indices) ii = 0 for verts in loop_list: if len(verts) > 2: for i, vert in enumerate(verts): vert_map[i + ii] = vert[2] ii += len(verts) fill = tessellate_polygon([[v[0] for v in loop] for loop in loop_list]) # draw_loops(loop_list) #raise Exception("done loop") # map to original indices fill = [[vert_map[i] for i in f] for f in fill] if not fill: if debug_print: print('Warning Cannot scanfill, fallback on a triangle fan.') fill = [[0, i - 1, i] for i in range(2, len(indices))] else: # Use real scan-fill. # See if its flipped the wrong way. flip = None for fi in fill: if flip is not None: break for i, vi in enumerate(fi): if vi == 0 and fi[i - 1] == 1: flip = False break elif vi == 1 and fi[i - 1] == 0: flip = True break if not flip: for i, fi in enumerate(fill): fill[i] = tuple([ii for ii in reversed(fi)]) return fill def triangle_random_points(num_points, loop_triangles): """ Generates a list of random points over mesh loop triangles. :arg num_points: the number of random points to generate on each triangle. :type int: :arg loop_triangles: list of the triangles to generate points on. :type loop_triangles: :class:`bpy.types.MeshLoopTriangle`, sequence :return: list of random points over all triangles. :rtype: list """ from random import random # For each triangle, generate the required number of random points sampled_points = [None] * (num_points * len(loop_triangles)) for i, lt in enumerate(loop_triangles): # Get triangle vertex coordinates verts = lt.id_data.vertices ltv = lt.vertices[:] tv = (verts[ltv[0]].co, verts[ltv[1]].co, verts[ltv[2]].co) for k in range(num_points): u1 = random() u2 = random() u_tot = u1 + u2 if u_tot > 1: u1 = 1.0 - u1 u2 = 1.0 - u2 side1 = tv[1] - tv[0] side2 = tv[2] - tv[0] p = tv[0] + u1 * side1 + u2 * side2 sampled_points[num_points * i + k] = p return sampled_points
return v, vector_to_tuple(v, 6), i, mlen(v)
mapToken.js
import request from '@/utils/request' export function add(data) { return request({ url: 'api/mapToken', method: 'post', data }) } export function del(ids) { return request({ url: 'api/mapToken/', method: 'delete', data: ids }) } export function edit(data) { return request({ url: 'api/mapToken',
method: 'put', data }) } export function getTokenApi(id) { return request({ url: 'api/mapToken/getTokenApi/' + id, method: 'get' }) } export function saveTokenApiData(id, data) { return request({ url: 'api/mapToken/saveTokenApiData/' + id, method: 'post', data }) } export default { add, edit, del, getTokenApi, saveTokenApiData }
icon_directions_transit.rs
pub struct IconDirectionsTransit { props: crate::Props, } impl yew::Component for IconDirectionsTransit { type Properties = crate::Props; type Message = (); fn create(props: Self::Properties, _: yew::prelude::ComponentLink<Self>) -> Self { Self { props } } fn update(&mut self, _: Self::Message) -> yew::prelude::ShouldRender { true } fn change(&mut self, _: Self::Properties) -> yew::prelude::ShouldRender { false } fn view(&self) -> yew::prelude::Html { yew::prelude::html! { <svg class=self.props.class.unwrap_or("") width=self.props.size.unwrap_or(24).to_string() height=self.props.size.unwrap_or(24).to_string() viewBox="0 0 24 24" fill=self.props.fill.unwrap_or("none") stroke=self.props.color.unwrap_or("currentColor") stroke-width=self.props.stroke_width.unwrap_or(2).to_string() stroke-linecap=self.props.stroke_linecap.unwrap_or("round") stroke-linejoin=self.props.stroke_linejoin.unwrap_or("round") > <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h12v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4zm5.66 3H6.43c.61-.52 2.06-1 5.57-1 3.71 0 5.12.46 5.66 1zM11 7v3H6V7h5zm2 0h5v3h-5V7zm3.5 10h-9c-.83 0-1.5-.67-1.5-1.5V12h12v3.5c0 .83-.67 1.5-1.5 1.5z"/><circle cx="8.5" cy="14.5" r="1.5"/><circle cx="15.5" cy="14.5" r="1.5"/></svg> </svg> } }
}
test_modify_contact.py
from model.contact import Contact def test_modify_contact_first_name(app):
def test_modify_contact_last_name(app): app.contact.modify_first_contact(Contact(last_name="second last name"))
app.contact.modify_first_contact(Contact(first_name="second first name"))
test_utils.py
import array import asyncio import contextvars import functools import io import os import queue import socket import traceback import warnings from collections import deque from time import sleep import pytest from tornado.ioloop import IOLoop import dask from distributed.compatibility import MACOS, WINDOWS from distributed.metrics import time from distributed.utils import ( LRU, All, Log, Logs, LoopRunner, TimeoutError, _maybe_complex, ensure_bytes, ensure_ip, format_dashboard_link, get_ip_interface, get_traceback, is_kernel, is_valid_xml, iscoroutinefunction, log_errors, nbytes, offload, open_port, parse_ports, read_block, recursive_to_dict, seek_delimiter, set_thread_state, sync, thread_state, truncate_exception, warn_on_duration, ) from distributed.utils_test import ( _UnhashableCallable, captured_logger, div, gen_test, has_ipv6, inc, throws, ) def
(loop): async def throws(): 1 / 0 async def slow(): await asyncio.sleep(10) async def inc(x): return x + 1 async def f(): results = await All([inc(i) for i in range(10)]) assert results == list(range(1, 11)) start = time() for tasks in [[throws(), slow()], [slow(), throws()]]: try: await All(tasks) assert False except ZeroDivisionError: pass end = time() assert end - start < 10 loop.run_sync(f) def test_sync_error(loop_in_thread): loop = loop_in_thread try: result = sync(loop, throws, 1) except Exception as exc: f = exc assert "hello" in str(exc) tb = get_traceback() L = traceback.format_tb(tb) assert any("throws" in line for line in L) def function1(x): return function2(x) def function2(x): return throws(x) try: result = sync(loop, function1, 1) except Exception as exc: assert "hello" in str(exc) tb = get_traceback() L = traceback.format_tb(tb) assert any("function1" in line for line in L) assert any("function2" in line for line in L) def test_sync_timeout(loop_in_thread): loop = loop_in_thread with pytest.raises(TimeoutError): sync(loop_in_thread, asyncio.sleep, 0.5, callback_timeout=0.05) with pytest.raises(TimeoutError): sync(loop_in_thread, asyncio.sleep, 0.5, callback_timeout="50ms") def test_sync_closed_loop(): async def get_loop(): return IOLoop.current() loop = asyncio.run(get_loop()) loop.close() with pytest.raises(RuntimeError) as exc_info: sync(loop, inc, 1) exc_info.match("IOLoop is clos(ed|ing)") def test_is_kernel(): pytest.importorskip("IPython") assert is_kernel() is False # @pytest.mark.leaking('fds') # def test_zzz_leaks(l=[]): # import os, subprocess # l.append(b"x" * (17 * 1024**2)) # os.open(__file__, os.O_RDONLY) # subprocess.Popen('sleep 100', shell=True, stdin=subprocess.DEVNULL) def test_ensure_ip(): assert ensure_ip("localhost") in ("127.0.0.1", "::1") assert ensure_ip("123.123.123.123") == "123.123.123.123" assert ensure_ip("8.8.8.8") == "8.8.8.8" if has_ipv6(): assert ensure_ip("2001:4860:4860::8888") == "2001:4860:4860::8888" assert ensure_ip("::1") == "::1" @pytest.mark.skipif(WINDOWS, reason="TODO") def test_get_ip_interface(): iface = "lo0" if MACOS else "lo" assert get_ip_interface(iface) == "127.0.0.1" with pytest.raises(ValueError, match=f"'__notexist'.+network interface.+'{iface}'"): get_ip_interface("__notexist") def test_truncate_exception(): e = ValueError("a" * 1000) assert len(str(e)) >= 1000 f = truncate_exception(e, 100) assert type(f) == type(e) assert len(str(f)) < 200 assert "aaaa" in str(f) e = ValueError("a") assert truncate_exception(e) is e def test_get_traceback(): def a(x): return div(x, 0) def b(x): return a(x) def c(x): return b(x) try: c(1) except Exception as e: tb = get_traceback() assert type(tb).__name__ == "traceback" def test_maybe_complex(): assert not _maybe_complex(1) assert not _maybe_complex("x") assert _maybe_complex((inc, 1)) assert _maybe_complex([(inc, 1)]) assert _maybe_complex([(inc, 1)]) assert _maybe_complex({"x": (inc, 1)}) def test_read_block(): delimiter = b"\n" data = delimiter.join([b"123", b"456", b"789"]) f = io.BytesIO(data) assert read_block(f, 1, 2) == b"23" assert read_block(f, 0, 1, delimiter=b"\n") == b"123\n" assert read_block(f, 0, 2, delimiter=b"\n") == b"123\n" assert read_block(f, 0, 3, delimiter=b"\n") == b"123\n" assert read_block(f, 0, 5, delimiter=b"\n") == b"123\n456\n" assert read_block(f, 0, 8, delimiter=b"\n") == b"123\n456\n789" assert read_block(f, 0, 100, delimiter=b"\n") == b"123\n456\n789" assert read_block(f, 1, 1, delimiter=b"\n") == b"" assert read_block(f, 1, 5, delimiter=b"\n") == b"456\n" assert read_block(f, 1, 8, delimiter=b"\n") == b"456\n789" for ols in [[(0, 3), (3, 3), (6, 3), (9, 2)], [(0, 4), (4, 4), (8, 4)]]: out = [read_block(f, o, l, b"\n") for o, l in ols] assert b"".join(filter(None, out)) == data def test_seek_delimiter_endline(): f = io.BytesIO(b"123\n456\n789") # if at zero, stay at zero seek_delimiter(f, b"\n", 5) assert f.tell() == 0 # choose the first block for bs in [1, 5, 100]: f.seek(1) seek_delimiter(f, b"\n", blocksize=bs) assert f.tell() == 4 # handle long delimiters well, even with short blocksizes f = io.BytesIO(b"123abc456abc789") for bs in [1, 2, 3, 4, 5, 6, 10]: f.seek(1) seek_delimiter(f, b"abc", blocksize=bs) assert f.tell() == 6 # End at the end f = io.BytesIO(b"123\n456") f.seek(5) seek_delimiter(f, b"\n", 5) assert f.tell() == 7 def test_ensure_bytes(): data = [b"1", "1", memoryview(b"1"), bytearray(b"1"), array.array("b", [49])] for d in data: result = ensure_bytes(d) assert isinstance(result, bytes) assert result == b"1" def test_ensure_bytes_ndarray(): np = pytest.importorskip("numpy") result = ensure_bytes(np.arange(12)) assert isinstance(result, bytes) def test_ensure_bytes_pyarrow_buffer(): pa = pytest.importorskip("pyarrow") buf = pa.py_buffer(b"123") result = ensure_bytes(buf) assert isinstance(result, bytes) def test_nbytes(): np = pytest.importorskip("numpy") def check(obj, expected): assert nbytes(obj) == expected assert nbytes(memoryview(obj)) == expected check(b"123", 3) check(bytearray(b"4567"), 4) multi_dim = np.ones(shape=(10, 10)) scalar = np.array(1) check(multi_dim, multi_dim.nbytes) check(scalar, scalar.nbytes) def test_open_port(): port = open_port() s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("", port)) s.close() def test_set_thread_state(): with set_thread_state(x=1): assert thread_state.x == 1 assert not hasattr(thread_state, "x") def assert_running(loop): """ Raise if the given IOLoop is not running. """ q = queue.Queue() loop.add_callback(q.put, 42) assert q.get(timeout=1) == 42 def assert_not_running(loop): """ Raise if the given IOLoop is running. """ q = queue.Queue() try: loop.add_callback(q.put, 42) except RuntimeError: # On AsyncIOLoop, can't add_callback() after the loop is closed pass else: with pytest.raises(queue.Empty): q.get(timeout=0.02) def test_loop_runner(loop_in_thread): # Implicit loop loop = IOLoop() loop.make_current() runner = LoopRunner() assert runner.loop not in (loop, loop_in_thread) assert not runner.is_started() assert_not_running(runner.loop) runner.start() assert runner.is_started() assert_running(runner.loop) runner.stop() assert not runner.is_started() assert_not_running(runner.loop) # Explicit loop loop = IOLoop() runner = LoopRunner(loop=loop) assert runner.loop is loop assert not runner.is_started() assert_not_running(loop) runner.start() assert runner.is_started() assert_running(loop) runner.stop() assert not runner.is_started() assert_not_running(loop) # Explicit loop, already started runner = LoopRunner(loop=loop_in_thread) assert not runner.is_started() assert_running(loop_in_thread) runner.start() assert runner.is_started() assert_running(loop_in_thread) runner.stop() assert not runner.is_started() assert_running(loop_in_thread) # Implicit loop, asynchronous=True loop = IOLoop() loop.make_current() runner = LoopRunner(asynchronous=True) assert runner.loop is loop assert not runner.is_started() assert_not_running(runner.loop) runner.start() assert runner.is_started() assert_not_running(runner.loop) runner.stop() assert not runner.is_started() assert_not_running(runner.loop) # Explicit loop, asynchronous=True loop = IOLoop() runner = LoopRunner(loop=loop, asynchronous=True) assert runner.loop is loop assert not runner.is_started() assert_not_running(runner.loop) runner.start() assert runner.is_started() assert_not_running(runner.loop) runner.stop() assert not runner.is_started() assert_not_running(runner.loop) def test_two_loop_runners(loop_in_thread): # Loop runners tied to the same loop should cooperate # ABCCBA loop = IOLoop() a = LoopRunner(loop=loop) b = LoopRunner(loop=loop) assert_not_running(loop) a.start() assert_running(loop) c = LoopRunner(loop=loop) b.start() assert_running(loop) c.start() assert_running(loop) c.stop() assert_running(loop) b.stop() assert_running(loop) a.stop() assert_not_running(loop) # ABCABC loop = IOLoop() a = LoopRunner(loop=loop) b = LoopRunner(loop=loop) assert_not_running(loop) a.start() assert_running(loop) b.start() assert_running(loop) c = LoopRunner(loop=loop) c.start() assert_running(loop) a.stop() assert_running(loop) b.stop() assert_running(loop) c.stop() assert_not_running(loop) # Explicit loop, already started a = LoopRunner(loop=loop_in_thread) b = LoopRunner(loop=loop_in_thread) assert_running(loop_in_thread) a.start() assert_running(loop_in_thread) b.start() assert_running(loop_in_thread) a.stop() assert_running(loop_in_thread) b.stop() assert_running(loop_in_thread) @gen_test() async def test_loop_runner_gen(): runner = LoopRunner(asynchronous=True) assert runner.loop is IOLoop.current() assert not runner.is_started() await asyncio.sleep(0.01) runner.start() assert runner.is_started() await asyncio.sleep(0.01) runner.stop() assert not runner.is_started() await asyncio.sleep(0.01) @gen_test() async def test_all_quiet_exceptions(): class CustomError(Exception): pass async def throws(msg): raise CustomError(msg) with captured_logger("") as sio: with pytest.raises(CustomError): await All([throws("foo") for _ in range(5)]) with pytest.raises(CustomError): await All([throws("bar") for _ in range(5)], quiet_exceptions=CustomError) assert "bar" not in sio.getvalue() assert "foo" in sio.getvalue() def test_warn_on_duration(): with warnings.catch_warnings(record=True) as record: with warn_on_duration("10s", "foo"): pass assert not record with pytest.warns(UserWarning, match=r"foo") as record: with warn_on_duration("1ms", "foo"): sleep(0.100) assert record assert any("foo" in str(rec.message) for rec in record) def test_logs(): log = Log("Hello") assert isinstance(log, str) d = Logs({"123": log, "456": Log("World!")}) assert isinstance(d, dict) text = d._repr_html_() assert is_valid_xml("<div>" + text + "</div>") assert "Hello" in text assert "456" in text def test_is_valid_xml(): assert is_valid_xml("<a>foo</a>") with pytest.raises(Exception): assert is_valid_xml("<a>foo") def test_format_dashboard_link(): with dask.config.set({"distributed.dashboard.link": "foo"}): assert format_dashboard_link("host", 1234) == "foo" assert "host" in format_dashboard_link("host", 1234) assert "1234" in format_dashboard_link("host", 1234) try: os.environ["host"] = "hello" assert "hello" not in format_dashboard_link("host", 1234) finally: del os.environ["host"] def test_parse_ports(): assert parse_ports(None) == [None] assert parse_ports(23) == [23] assert parse_ports("45") == [45] assert parse_ports("100:103") == [100, 101, 102, 103] assert parse_ports([100, 101, 102, 103]) == [100, 101, 102, 103] out = parse_ports((100, 101, 102, 103)) assert out == [100, 101, 102, 103] assert isinstance(out, list) with pytest.raises(ValueError, match="port_stop must be greater than port_start"): parse_ports("103:100") with pytest.raises(TypeError): parse_ports(100.5) with pytest.raises(TypeError): parse_ports([100, 100.5]) with pytest.raises(ValueError): parse_ports("foo") with pytest.raises(ValueError): parse_ports("100.5") def test_lru(): l = LRU(maxsize=3) l["a"] = 1 l["b"] = 2 l["c"] = 3 assert list(l.keys()) == ["a", "b", "c"] # Use "a" and ensure it becomes the most recently used item l["a"] assert list(l.keys()) == ["b", "c", "a"] # Ensure maxsize is respected l["d"] = 4 assert len(l) == 3 assert list(l.keys()) == ["c", "a", "d"] @gen_test() async def test_offload(): assert (await offload(inc, 1)) == 2 assert (await offload(lambda x, y: x + y, 1, y=2)) == 3 @gen_test() async def test_offload_preserves_contextvars(): var = contextvars.ContextVar("var") async def set_var(v: str): var.set(v) r = await offload(var.get) assert r == v await asyncio.gather(set_var("foo"), set_var("bar")) def test_serialize_for_cli_deprecated(): with pytest.warns(FutureWarning, match="serialize_for_cli is deprecated"): from distributed.utils import serialize_for_cli assert serialize_for_cli is dask.config.serialize def test_deserialize_for_cli_deprecated(): with pytest.warns(FutureWarning, match="deserialize_for_cli is deprecated"): from distributed.utils import deserialize_for_cli assert deserialize_for_cli is dask.config.deserialize def test_parse_bytes_deprecated(): with pytest.warns(FutureWarning, match="parse_bytes is deprecated"): from distributed.utils import parse_bytes assert parse_bytes is dask.utils.parse_bytes def test_format_bytes_deprecated(): with pytest.warns(FutureWarning, match="format_bytes is deprecated"): from distributed.utils import format_bytes assert format_bytes is dask.utils.format_bytes def test_format_time_deprecated(): with pytest.warns(FutureWarning, match="format_time is deprecated"): from distributed.utils import format_time assert format_time is dask.utils.format_time def test_funcname_deprecated(): with pytest.warns(FutureWarning, match="funcname is deprecated"): from distributed.utils import funcname assert funcname is dask.utils.funcname def test_parse_timedelta_deprecated(): with pytest.warns(FutureWarning, match="parse_timedelta is deprecated"): from distributed.utils import parse_timedelta assert parse_timedelta is dask.utils.parse_timedelta def test_typename_deprecated(): with pytest.warns(FutureWarning, match="typename is deprecated"): from distributed.utils import typename assert typename is dask.utils.typename def test_tmpfile_deprecated(): with pytest.warns(FutureWarning, match="tmpfile is deprecated"): from distributed.utils import tmpfile assert tmpfile is dask.utils.tmpfile def test_iscoroutinefunction_unhashable_input(): # Ensure iscoroutinefunction can handle unhashable callables assert not iscoroutinefunction(_UnhashableCallable()) def test_iscoroutinefunction_nested_partial(): async def my_async_callable(x, y, z): pass assert iscoroutinefunction( functools.partial(functools.partial(my_async_callable, 1), 2) ) def test_recursive_to_dict(): class C: def __init__(self, x): self.x = x def __repr__(self): return "<C>" def _to_dict(self, *, exclude): assert exclude == ["foo"] return ["C:", recursive_to_dict(self.x, exclude=exclude)] class D: def __repr__(self): return "<D>" class E: def __init__(self): self.x = 1 # Public attribute; dump self._y = 2 # Private attribute; don't dump self.foo = 3 # In exclude; don't dump @property def z(self): # Public property; dump return 4 def f(self): # Callable; don't dump return 5 def _to_dict(self, *, exclude): # Output: {"x": 1, "z": 4} return recursive_to_dict(self, exclude=exclude, members=True) inp = [ 1, 1.1, True, False, None, "foo", b"bar", C, C(1), D(), (1, 2), [3, 4], {5, 6}, frozenset([7, 8]), deque([9, 10]), {3: 4, 1: 2}.keys(), {3: 4, 1: 2}.values(), E(), ] expect = [ 1, 1.1, True, False, None, "foo", "b'bar'", "<class 'test_utils.test_recursive_to_dict.<locals>.C'>", ["C:", 1], "<D>", [1, 2], [3, 4], list({5, 6}), list(frozenset([7, 8])), [9, 10], [3, 1], [4, 2], {"x": 1, "z": 4}, ] assert recursive_to_dict(inp, exclude=["foo"]) == expect # Test recursion a = [] c = C(a) a += [c, c] # The blocklist of already-seen objects is reentrant: a is converted to string when # found inside itself; c must *not* be converted to string the second time it's # found, because it's outside of itself. assert recursive_to_dict(a, exclude=["foo"]) == [ ["C:", "[<C>, <C>]"], ["C:", "[<C>, <C>]"], ] def test_recursive_to_dict_no_nest(): class Person: def __init__(self, name): self.name = name self.children = [] self.pets = [] ... def _to_dict_no_nest(self, exclude=()): return recursive_to_dict(self.__dict__, exclude=exclude) def __repr__(self): return self.name class Pet: def __init__(self, name): self.name = name self.owners = [] ... def _to_dict_no_nest(self, exclude=()): return recursive_to_dict(self.__dict__, exclude=exclude) def __repr__(self): return self.name alice = Person("Alice") bob = Person("Bob") charlie = Pet("Charlie") alice.children.append(bob) alice.pets.append(charlie) bob.pets.append(charlie) charlie.owners[:] = [alice, bob] info = {"people": [alice, bob], "pets": [charlie]} expect = { "people": [ {"name": "Alice", "children": ["Bob"], "pets": ["Charlie"]}, {"name": "Bob", "children": [], "pets": ["Charlie"]}, ], "pets": [ {"name": "Charlie", "owners": ["Alice", "Bob"]}, ], } assert recursive_to_dict(info) == expect @gen_test() async def test_log_errors(): class CustomError(Exception): pass # Use the logger of the caller module with captured_logger("test_utils") as caplog: # Context manager with log_errors(): pass with log_errors(): with log_errors(): pass with log_errors(pdb=True): pass with pytest.raises(CustomError): with log_errors(): raise CustomError("err1") with pytest.raises(CustomError): with log_errors(): with log_errors(): raise CustomError("err2") # Bare decorator @log_errors def _(): return 123 assert _() == 123 @log_errors def _(): raise CustomError("err3") with pytest.raises(CustomError): _() @log_errors def inner(): raise CustomError("err4") @log_errors def outer(): inner() with pytest.raises(CustomError): outer() # Decorator with parameters @log_errors() def _(): return 456 assert _() == 456 @log_errors() def _(): with log_errors(): raise CustomError("err5") with pytest.raises(CustomError): _() @log_errors(pdb=True) def _(): return 789 assert _() == 789 # Decorate async function @log_errors async def _(): return 123 assert await _() == 123 @log_errors async def _(): raise CustomError("err6") with pytest.raises(CustomError): await _() assert [row for row in caplog.getvalue().splitlines() if row.startswith("err")] == [ "err1", "err2", "err2", "err3", "err4", "err4", "err5", "err5", "err6", ] # Test unroll_stack with captured_logger("distributed.utils") as caplog: with pytest.raises(CustomError): with log_errors(unroll_stack=0): raise CustomError("err7") assert caplog.getvalue().startswith("err7\n")
test_All
client.d.ts
import { LocalScope, RemoteScope } from './scope'; import { QueryGenerator, Api } from './query'; export declare type mode = 'remote' | 'local'; export interface IClient { [index: string]: unknown; client: unknown; unwrapQuery( queryGenerator: QueryGenerator, mode: mode ): LocalScope | RemoteScope; localFiltering<T>(collection: Array<T>, queries: Api['queries']): Array<T>; } export declare type WrappedClient = Record<string, unknown>; export declare class Client implements IClient { [k: string]: unknown; client: WrappedClient; constructor(client: WrappedClient); unwrapQuery( queryGenerator: QueryGenerator, mode?: mode ): LocalScope | RemoteScope; localFiltering<T>(collection: Array<T>, queries: Api['queries']): Array<T>;
}
workspace.rs
use std::cell::RefCell; use std::collections::hash_map::{Entry, HashMap}; use std::collections::{BTreeMap, BTreeSet, HashSet}; use std::path::{Path, PathBuf}; use std::rc::Rc; use std::slice; use glob::glob; use log::debug; use url::Url; use crate::core::features::Features; use crate::core::registry::PackageRegistry; use crate::core::resolver::features::RequestedFeatures; use crate::core::resolver::ResolveBehavior; use crate::core::{Dependency, Edition, PackageId, PackageIdSpec}; use crate::core::{EitherManifest, Package, SourceId, VirtualManifest}; use crate::ops; use crate::sources::PathSource; use crate::util::errors::{CargoResult, CargoResultExt, ManifestError}; use crate::util::interning::InternedString; use crate::util::paths; use crate::util::toml::{read_manifest, TomlProfiles}; use crate::util::{Config, Filesystem}; /// The core abstraction in Cargo for working with a workspace of crates. /// /// A workspace is often created very early on and then threaded through all /// other functions. It's typically through this object that the current /// package is loaded and/or learned about. #[derive(Debug)] pub struct Workspace<'cfg> { config: &'cfg Config, // This path is a path to where the current cargo subcommand was invoked // from. That is the `--manifest-path` argument to Cargo, and // points to the "main crate" that we're going to worry about. current_manifest: PathBuf, // A list of packages found in this workspace. Always includes at least the // package mentioned by `current_manifest`. packages: Packages<'cfg>, // If this workspace includes more than one crate, this points to the root // of the workspace. This is `None` in the case that `[workspace]` is // missing, `package.workspace` is missing, and no `Cargo.toml` above // `current_manifest` was found on the filesystem with `[workspace]`. root_manifest: Option<PathBuf>, // Shared target directory for all the packages of this workspace. // `None` if the default path of `root/target` should be used. target_dir: Option<Filesystem>, // List of members in this workspace with a listing of all their manifest // paths. The packages themselves can be looked up through the `packages` // set above. members: Vec<PathBuf>, member_ids: HashSet<PackageId>, // The subset of `members` that are used by the // `build`, `check`, `test`, and `bench` subcommands // when no package is selected with `--package` / `-p` and `--workspace` // is not used. // // This is set by the `default-members` config // in the `[workspace]` section. // When unset, this is the same as `members` for virtual workspaces // (`--workspace` is implied) // or only the root package for non-virtual workspaces. default_members: Vec<PathBuf>, // `true` if this is a temporary workspace created for the purposes of the // `cargo install` or `cargo package` commands. is_ephemeral: bool, // `true` if this workspace should enforce optional dependencies even when // not needed; false if this workspace should only enforce dependencies // needed by the current configuration (such as in cargo install). In some // cases `false` also results in the non-enforcement of dev-dependencies. require_optional_deps: bool, // A cache of loaded packages for particular paths which is disjoint from // `packages` up above, used in the `load` method down below. loaded_packages: RefCell<HashMap<PathBuf, Package>>, // If `true`, then the resolver will ignore any existing `Cargo.lock` // file. This is set for `cargo install` without `--locked`. ignore_lock: bool, /// The resolver behavior specified with the `resolver` field. resolve_behavior: ResolveBehavior, /// Workspace-level custom metadata custom_metadata: Option<toml::Value>, } // Separate structure for tracking loaded packages (to avoid loading anything // twice), and this is separate to help appease the borrow checker. #[derive(Debug)] struct Packages<'cfg> { config: &'cfg Config, packages: HashMap<PathBuf, MaybePackage>, } #[derive(Debug)] enum MaybePackage { Package(Package), Virtual(VirtualManifest), } /// Configuration of a workspace in a manifest. #[derive(Debug, Clone)] pub enum WorkspaceConfig { /// Indicates that `[workspace]` was present and the members were /// optionally specified as well. Root(WorkspaceRootConfig), /// Indicates that `[workspace]` was present and the `root` field is the /// optional value of `package.workspace`, if present. Member { root: Option<String> }, } /// Intermediate configuration of a workspace root in a manifest. /// /// Knows the Workspace Root path, as well as `members` and `exclude` lists of path patterns, which /// together tell if some path is recognized as a member by this root or not. #[derive(Debug, Clone)] pub struct WorkspaceRootConfig { root_dir: PathBuf, members: Option<Vec<String>>, default_members: Option<Vec<String>>, exclude: Vec<String>, custom_metadata: Option<toml::Value>, } /// An iterator over the member packages of a workspace, returned by /// `Workspace::members` pub struct Members<'a, 'cfg> { ws: &'a Workspace<'cfg>, iter: slice::Iter<'a, PathBuf>, } impl<'cfg> Workspace<'cfg> { /// Creates a new workspace given the target manifest pointed to by /// `manifest_path`. /// /// This function will construct the entire workspace by determining the /// root and all member packages. It will then validate the workspace /// before returning it, so `Ok` is only returned for valid workspaces. pub fn new(manifest_path: &Path, config: &'cfg Config) -> CargoResult<Workspace<'cfg>> { let mut ws = Workspace::new_default(manifest_path.to_path_buf(), config); ws.target_dir = config.target_dir()?; if manifest_path.is_relative() { anyhow::bail!( "manifest_path:{:?} is not an absolute path. Please provide an absolute path.", manifest_path ) } else { ws.root_manifest = ws.find_root(manifest_path)?; } ws.custom_metadata = ws .load_workspace_config()? .and_then(|cfg| cfg.custom_metadata); ws.find_members()?; ws.set_resolve_behavior(); ws.validate()?; Ok(ws) } fn new_default(current_manifest: PathBuf, config: &'cfg Config) -> Workspace<'cfg> { Workspace { config, current_manifest, packages: Packages { config, packages: HashMap::new(), }, root_manifest: None, target_dir: None, members: Vec::new(), member_ids: HashSet::new(), default_members: Vec::new(), is_ephemeral: false, require_optional_deps: true, loaded_packages: RefCell::new(HashMap::new()), ignore_lock: false, resolve_behavior: ResolveBehavior::V1, custom_metadata: None, } } pub fn new_virtual( root_path: PathBuf, current_manifest: PathBuf, manifest: VirtualManifest, config: &'cfg Config, ) -> CargoResult<Workspace<'cfg>> { let mut ws = Workspace::new_default(current_manifest, config); ws.root_manifest = Some(root_path.join("Cargo.toml")); ws.target_dir = config.target_dir()?; ws.packages .packages .insert(root_path, MaybePackage::Virtual(manifest)); ws.find_members()?; ws.set_resolve_behavior(); // TODO: validation does not work because it walks up the directory // tree looking for the root which is a fake file that doesn't exist. Ok(ws) } /// Creates a "temporary workspace" from one package which only contains /// that package. /// /// This constructor will not touch the filesystem and only creates an /// in-memory workspace. That is, all configuration is ignored, it's just /// intended for that one package. /// /// This is currently only used in niche situations like `cargo install` or /// `cargo package`. pub fn ephemeral( package: Package, config: &'cfg Config, target_dir: Option<Filesystem>, require_optional_deps: bool, ) -> CargoResult<Workspace<'cfg>> { let mut ws = Workspace::new_default(package.manifest_path().to_path_buf(), config); ws.is_ephemeral = true; ws.require_optional_deps = require_optional_deps; let key = ws.current_manifest.parent().unwrap(); let id = package.package_id(); let package = MaybePackage::Package(package); ws.packages.packages.insert(key.to_path_buf(), package); ws.target_dir = if let Some(dir) = target_dir { Some(dir) } else { ws.config.target_dir()? }; ws.members.push(ws.current_manifest.clone()); ws.member_ids.insert(id); ws.default_members.push(ws.current_manifest.clone()); ws.set_resolve_behavior(); Ok(ws) } fn set_resolve_behavior(&mut self) { // - If resolver is specified in the workspace definition, use that. // - If the root package specifies the resolver, use that. // - If the root package specifies edition 2021, use v2. // - Otherwise, use the default v1. self.resolve_behavior = match self.root_maybe() { MaybePackage::Package(p) => p.manifest().resolve_behavior().or_else(|| { if p.manifest().edition() >= Edition::Edition2021 { Some(ResolveBehavior::V2) } else { None } }), MaybePackage::Virtual(vm) => vm.resolve_behavior(), } .unwrap_or(ResolveBehavior::V1); } /// Returns the current package of this workspace. /// /// Note that this can return an error if it the current manifest is /// actually a "virtual Cargo.toml", in which case an error is returned /// indicating that something else should be passed. pub fn current(&self) -> CargoResult<&Package> { let pkg = self.current_opt().ok_or_else(|| { anyhow::format_err!( "manifest path `{}` is a virtual manifest, but this \ command requires running against an actual package in \ this workspace", self.current_manifest.display() ) })?; Ok(pkg) } pub fn current_mut(&mut self) -> CargoResult<&mut Package> { let cm = self.current_manifest.clone(); let pkg = self.current_opt_mut().ok_or_else(|| { anyhow::format_err!( "manifest path `{}` is a virtual manifest, but this \ command requires running against an actual package in \ this workspace", cm.display() ) })?; Ok(pkg) } pub fn current_opt(&self) -> Option<&Package> { match *self.packages.get(&self.current_manifest) { MaybePackage::Package(ref p) => Some(p), MaybePackage::Virtual(..) => None, } } pub fn current_opt_mut(&mut self) -> Option<&mut Package> { match *self.packages.get_mut(&self.current_manifest) { MaybePackage::Package(ref mut p) => Some(p), MaybePackage::Virtual(..) => None, } } pub fn is_virtual(&self) -> bool { match *self.packages.get(&self.current_manifest) { MaybePackage::Package(..) => false, MaybePackage::Virtual(..) => true, } } /// Returns the `Config` this workspace is associated with. pub fn config(&self) -> &'cfg Config { self.config } pub fn profiles(&self) -> Option<&TomlProfiles> { match self.root_maybe() { MaybePackage::Package(p) => p.manifest().profiles(), MaybePackage::Virtual(vm) => vm.profiles(), } } /// Returns the root path of this workspace. /// /// That is, this returns the path of the directory containing the /// `Cargo.toml` which is the root of this workspace. pub fn root(&self) -> &Path { self.root_manifest().parent().unwrap() } /// Returns the path of the `Cargo.toml` which is the root of this /// workspace. pub fn root_manifest(&self) -> &Path { self.root_manifest .as_ref() .unwrap_or(&self.current_manifest) } /// Returns the root Package or VirtualManifest. fn root_maybe(&self) -> &MaybePackage { self.packages.get(self.root_manifest()) } pub fn target_dir(&self) -> Filesystem { self.target_dir .clone() .unwrap_or_else(|| Filesystem::new(self.root().join("target"))) } /// Returns the root `[replace]` section of this workspace. /// /// This may be from a virtual crate or an actual crate. pub fn root_replace(&self) -> &[(PackageIdSpec, Dependency)] { match self.root_maybe() { MaybePackage::Package(p) => p.manifest().replace(), MaybePackage::Virtual(vm) => vm.replace(), } } /// Returns the root `[patch]` section of this workspace. /// /// This may be from a virtual crate or an actual crate. pub fn root_patch(&self) -> &HashMap<Url, Vec<Dependency>> { match self.root_maybe() { MaybePackage::Package(p) => p.manifest().patch(), MaybePackage::Virtual(vm) => vm.patch(), } } /// Returns an iterator over all packages in this workspace pub fn members<'a>(&'a self) -> Members<'a, 'cfg> { Members { ws: self, iter: self.members.iter(), } } /// Returns an iterator over default packages in this workspace pub fn default_members<'a>(&'a self) -> Members<'a, 'cfg> { Members { ws: self, iter: self.default_members.iter(), } } /// Returns true if the package is a member of the workspace. pub fn is_member(&self, pkg: &Package) -> bool { self.member_ids.contains(&pkg.package_id()) } pub fn is_ephemeral(&self) -> bool { self.is_ephemeral } pub fn require_optional_deps(&self) -> bool { self.require_optional_deps } pub fn set_require_optional_deps( &mut self, require_optional_deps: bool, ) -> &mut Workspace<'cfg> { self.require_optional_deps = require_optional_deps; self } pub fn ignore_lock(&self) -> bool { self.ignore_lock } pub fn set_ignore_lock(&mut self, ignore_lock: bool) -> &mut Workspace<'cfg> { self.ignore_lock = ignore_lock; self } pub fn custom_metadata(&self) -> Option<&toml::Value> { self.custom_metadata.as_ref() } pub fn load_workspace_config(&mut self) -> CargoResult<Option<WorkspaceRootConfig>> { // If we didn't find a root, it must mean there is no [workspace] section, and thus no // metadata. if let Some(root_path) = &self.root_manifest { let root_package = self.packages.load(root_path)?; match root_package.workspace_config() { WorkspaceConfig::Root(ref root_config) => { return Ok(Some(root_config.clone())); } _ => anyhow::bail!( "root of a workspace inferred but wasn't a root: {}", root_path.display() ), } } Ok(None) } /// Finds the root of a workspace for the crate whose manifest is located /// at `manifest_path`. /// /// This will parse the `Cargo.toml` at `manifest_path` and then interpret /// the workspace configuration, optionally walking up the filesystem /// looking for other workspace roots. /// /// Returns an error if `manifest_path` isn't actually a valid manifest or /// if some other transient error happens. fn find_root(&mut self, manifest_path: &Path) -> CargoResult<Option<PathBuf>> { fn read_root_pointer(member_manifest: &Path, root_link: &str) -> PathBuf { let path = member_manifest .parent() .unwrap() .join(root_link) .join("Cargo.toml"); debug!("find_root - pointer {}", path.display()); paths::normalize_path(&path) } { let current = self.packages.load(manifest_path)?; match *current.workspace_config() { WorkspaceConfig::Root(_) => { debug!("find_root - is root {}", manifest_path.display()); return Ok(Some(manifest_path.to_path_buf())); } WorkspaceConfig::Member { root: Some(ref path_to_root), } => return Ok(Some(read_root_pointer(manifest_path, path_to_root))), WorkspaceConfig::Member { root: None } => {} } } for path in paths::ancestors(manifest_path, None).skip(2) { if path.ends_with("target/package") { break; } let ances_manifest_path = path.join("Cargo.toml"); debug!("find_root - trying {}", ances_manifest_path.display()); if ances_manifest_path.exists() { match *self.packages.load(&ances_manifest_path)?.workspace_config() { WorkspaceConfig::Root(ref ances_root_config) => { debug!("find_root - found a root checking exclusion"); if !ances_root_config.is_excluded(manifest_path) { debug!("find_root - found!"); return Ok(Some(ances_manifest_path)); } } WorkspaceConfig::Member { root: Some(ref path_to_root), } => { debug!("find_root - found pointer"); return Ok(Some(read_root_pointer(&ances_manifest_path, path_to_root))); } WorkspaceConfig::Member { .. } => {} } } // Don't walk across `CARGO_HOME` when we're looking for the // workspace root. Sometimes a package will be organized with // `CARGO_HOME` pointing inside of the workspace root or in the // current package, but we don't want to mistakenly try to put // crates.io crates into the workspace by accident. if self.config.home() == path { break; } } Ok(None) } /// After the root of a workspace has been located, probes for all members /// of a workspace. /// /// If the `workspace.members` configuration is present, then this just /// verifies that those are all valid packages to point to. Otherwise, this /// will transitively follow all `path` dependencies looking for members of /// the workspace. fn find_members(&mut self) -> CargoResult<()> { let workspace_config = match self.load_workspace_config()? { Some(workspace_config) => workspace_config, None => { debug!("find_members - only me as a member"); self.members.push(self.current_manifest.clone()); self.default_members.push(self.current_manifest.clone()); if let Ok(pkg) = self.current() { let id = pkg.package_id(); self.member_ids.insert(id); } return Ok(()); } }; // self.root_manifest must be Some to have retrieved workspace_config let root_manifest_path = self.root_manifest.clone().unwrap(); let members_paths = workspace_config.members_paths(workspace_config.members.as_ref().unwrap_or(&vec![]))?; let default_members_paths = if root_manifest_path == self.current_manifest { if let Some(ref default) = workspace_config.default_members { Some(workspace_config.members_paths(default)?) } else { None } } else { None }; for path in &members_paths { self.find_path_deps(&path.join("Cargo.toml"), &root_manifest_path, false)?; } if let Some(default) = default_members_paths { for path in default { let normalized_path = paths::normalize_path(&path); let manifest_path = normalized_path.join("Cargo.toml"); if !self.members.contains(&manifest_path) { // default-members are allowed to be excluded, but they // still must be referred to by the original (unfiltered) // members list. Note that we aren't testing against the // manifest path, both because `members_paths` doesn't // include `/Cargo.toml`, and because excluded paths may not // be crates. let exclude = members_paths.contains(&normalized_path) && workspace_config.is_excluded(&normalized_path); if exclude { continue; } anyhow::bail!( "package `{}` is listed in workspace’s default-members \ but is not a member.", path.display() ) } self.default_members.push(manifest_path) } } else if self.is_virtual() { self.default_members = self.members.clone() } else { self.default_members.push(self.current_manifest.clone()) } self.find_path_deps(&root_manifest_path, &root_manifest_path, false) } fn find_path_deps( &mut self, manifest_path: &Path, root_manifest: &Path, is_path_dep: bool, ) -> CargoResult<()> { let manifest_path = paths::normalize_path(manifest_path); if self.members.contains(&manifest_path) { return Ok(()); } if is_path_dep && !manifest_path.parent().unwrap().starts_with(self.root()) && self.find_root(&manifest_path)? != self.root_manifest { // If `manifest_path` is a path dependency outside of the workspace, // don't add it, or any of its dependencies, as a members. return Ok(()); } if let WorkspaceConfig::Root(ref root_config) = *self.packages.load(root_manifest)?.workspace_config() { if root_config.is_excluded(&manifest_path) { return Ok(()); } } debug!("find_members - {}", manifest_path.display()); self.members.push(manifest_path.clone()); let candidates = { let pkg = match *self.packages.load(&manifest_path)? { MaybePackage::Package(ref p) => p, MaybePackage::Virtual(_) => return Ok(()), }; self.member_ids.insert(pkg.package_id()); pkg.dependencies() .iter() .map(|d| d.source_id()) .filter(|d| d.is_path()) .filter_map(|d| d.url().to_file_path().ok()) .map(|p| p.join("Cargo.toml")) .collect::<Vec<_>>() }; for candidate in candidates { self.find_path_deps(&candidate, root_manifest, true) .map_err(|err| ManifestError::new(err, manifest_path.clone()))?; } Ok(()) } /// Returns the unstable nightly-only features enabled via `cargo-features` in the manifest. pub fn unstable_features(&self) -> &Features { match self.root_maybe() { MaybePackage::Package(p) => p.manifest().unstable_features(), MaybePackage::Virtual(vm) => vm.unstable_features(), } } pub fn resolve_behavior(&self) -> ResolveBehavior { self.resolve_behavior } /// Returns `true` if this workspace uses the new CLI features behavior. /// /// The old behavior only allowed choosing the features from the package /// in the current directory, regardless of which packages were chosen /// with the -p flags. The new behavior allows selecting features from the /// packages chosen on the command line (with -p or --workspace flags), /// ignoring whatever is in the current directory. pub fn allows_new_cli_feature_behavior(&self) -> bool { self.is_virtual() || match self.resolve_behavior() { ResolveBehavior::V1 => false, ResolveBehavior::V2 => true, } } /// Validates a workspace, ensuring that a number of invariants are upheld: /// /// 1. A workspace only has one root. /// 2. All workspace members agree on this one root as the root. /// 3. The current crate is a member of this workspace. fn validate(&mut self) -> CargoResult<()> { // The rest of the checks require a VirtualManifest or multiple members. if self.root_manifest.is_none() { return Ok(()); } self.validate_unique_names()?; self.validate_workspace_roots()?; self.validate_members()?; self.error_if_manifest_not_in_members()?; self.validate_manifest() } fn validate_unique_names(&self) -> CargoResult<()> { let mut names = BTreeMap::new(); for member in self.members.iter() { let package = self.packages.get(member); let name = match *package { MaybePackage::Package(ref p) => p.name(), MaybePackage::Virtual(_) => continue, }; if let Some(prev) = names.insert(name, member) { anyhow::bail!( "two packages named `{}` in this workspace:\n\ - {}\n\ - {}", name, prev.display(), member.display() ); } } Ok(()) } fn validate_workspace_roots(&self) -> CargoResult<()> { let roots: Vec<PathBuf> = self .members .iter() .filter(|&member| { let config = self.packages.get(member).workspace_config(); matches!(config, WorkspaceConfig::Root(_)) }) .map(|member| member.parent().unwrap().to_path_buf()) .collect(); match roots.len() { 1 => Ok(()), 0 => anyhow::bail!( "`package.workspace` configuration points to a crate \ which is not configured with [workspace]: \n\ configuration at: {}\n\ points to: {}", self.current_manifest.display(), self.root_manifest.as_ref().unwrap().display() ), _ => { anyhow::bail!( "multiple workspace roots found in the same workspace:\n{}", roots .iter() .map(|r| format!(" {}", r.display())) .collect::<Vec<_>>() .join("\n") ); } } } fn validate_members(&mut self) -> CargoResult<()> { for member in self.members.clone() { let root = self.find_root(&member)?; if root == self.root_manifest { continue; } match root { Some(root) => { anyhow::bail!( "package `{}` is a member of the wrong workspace\n\ expected: {}\n\ actual: {}", member.display(), self.root_manifest.as_ref().unwrap().display(), root.display() ); } None => { anyhow::bail!( "workspace member `{}` is not hierarchically below \ the workspace root `{}`", member.display(), self.root_manifest.as_ref().unwrap().display() ); } } } Ok(()) } fn error_if_manifest_not_in_members(&mut self) -> CargoResult<()> { if self.members.contains(&self.current_manifest) { return Ok(()); } let root = self.root_manifest.as_ref().unwrap(); let root_dir = root.parent().unwrap(); let current_dir = self.current_manifest.parent().unwrap(); let root_pkg = self.packages.get(root); // FIXME: Make this more generic by using a relative path resolver between member and root. let members_msg = match current_dir.strip_prefix(root_dir) { Ok(rel) => format!( "this may be fixable by adding `{}` to the \ `workspace.members` array of the manifest \ located at: {}", rel.display(), root.display() ), Err(_) => format!( "this may be fixable by adding a member to \ the `workspace.members` array of the \ manifest located at: {}", root.display() ), }; let extra = match *root_pkg { MaybePackage::Virtual(_) => members_msg, MaybePackage::Package(ref p) => { let has_members_list = match *p.manifest().workspace_config() { WorkspaceConfig::Root(ref root_config) => root_config.has_members_list(), WorkspaceConfig::Member { .. } => unreachable!(), }; if !has_members_list { format!( "this may be fixable by ensuring that this \ crate is depended on by the workspace \ root: {}", root.display() ) } else { members_msg } } }; anyhow::bail!( "current package believes it's in a workspace when it's not:\n\ current: {}\n\ workspace: {}\n\n{}\n\ Alternatively, to keep it out of the workspace, add the package \ to the `workspace.exclude` array, or add an empty `[workspace]` \ table to the package's manifest.", self.current_manifest.display(), root.display(), extra ); } fn validate_manifest(&mut self) -> CargoResult<()> { if let Some(ref root_manifest) = self.root_manifest { for pkg in self .members() .filter(|p| p.manifest_path() != root_manifest) { let manifest = pkg.manifest(); let emit_warning = |what| -> CargoResult<()> { let msg = format!( "{} for the non root package will be ignored, \ specify {} at the workspace root:\n\ package: {}\n\ workspace: {}", what, what, pkg.manifest_path().display(), root_manifest.display(), ); self.config.shell().warn(&msg) }; if manifest.original().has_profiles() { emit_warning("profiles")?; } if !manifest.replace().is_empty() { emit_warning("replace")?; } if !manifest.patch().is_empty() { emit_warning("patch")?; } if let Some(behavior) = manifest.resolve_behavior() { if behavior != self.resolve_behavior { // Only warn if they don't match. emit_warning("resolver")?; } } } } Ok(()) } pub fn load(&self, manifest_path: &Path) -> CargoResult<Package> { match self.packages.maybe_get(manifest_path) { Some(&MaybePackage::Package(ref p)) => return Ok(p.clone()), Some(&MaybePackage::Virtual(_)) => anyhow::bail!("cannot load workspace root"), None => {} } let mut loaded = self.loaded_packages.borrow_mut(); if let Some(p) = loaded.get(manifest_path).cloned() { return Ok(p); } let source_id = SourceId::for_path(manifest_path.parent().unwrap())?; let (package, _nested_paths) = ops::read_package(manifest_path, source_id, self.config)?; loaded.insert(manifest_path.to_path_buf(), package.clone()); Ok(package) } /// Preload the provided registry with already loaded packages. /// /// A workspace may load packages during construction/parsing/early phases /// for various operations, and this preload step avoids doubly-loading and /// parsing crates on the filesystem by inserting them all into the registry /// with their in-memory formats. pub fn preload(&self, registry: &mut PackageRegistry<'cfg>) { // These can get weird as this generally represents a workspace during // `cargo install`. Things like git repositories will actually have a // `PathSource` with multiple entries in it, so the logic below is // mostly just an optimization for normal `cargo build` in workspaces // during development. if self.is_ephemeral { return; } for pkg in self.packages.packages.values() { let pkg = match *pkg { MaybePackage::Package(ref p) => p.clone(), MaybePackage::Virtual(_) => continue, }; let mut src = PathSource::new(pkg.root(), pkg.package_id().source_id(), self.config); src.preload_with(pkg); registry.add_preloaded(Box::new(src)); } } pub fn emit_warnings(&self) -> CargoResult<()> { for (path, maybe_pkg) in &self.packages.packages { let warnings = match maybe_pkg { MaybePackage::Package(pkg) => pkg.manifest().warnings().warnings(), MaybePackage::Virtual(vm) => vm.warnings().warnings(), }; let path = path.join("Cargo.toml"); for warning in warnings { if warning.is_critical { let err = anyhow::format_err!("{}", warning.message); let cx = anyhow::format_err!("failed to parse manifest at `{}`", path.display()); return Err(err.context(cx)); } else { let msg = if self.root_manifest.is_none() { warning.message.to_string() } else { // In a workspace, it can be confusing where a warning // originated, so include the path. format!("{}: {}", path.display(), warning.message) }; self.config.shell().warn(msg)? } } } Ok(()) } pub fn set_target_dir(&mut self, target_dir: Filesystem) { self.target_dir = Some(target_dir); } /// Returns a Vec of `(&Package, RequestedFeatures)` tuples that /// represent the workspace members that were requested on the command-line. /// /// `specs` may be empty, which indicates it should return all workspace /// members. In this case, `requested_features.all_features` must be /// `true`. This is used for generating `Cargo.lock`, which must include /// all members with all features enabled. pub fn members_with_features( &self, specs: &[PackageIdSpec], requested_features: &RequestedFeatures, ) -> CargoResult<Vec<(&Package, RequestedFeatures)>> { assert!( !specs.is_empty() || requested_features.all_features, "no specs requires all_features" ); if specs.is_empty() { // When resolving the entire workspace, resolve each member with // all features enabled. return Ok(self .members() .map(|m| (m, RequestedFeatures::new_all(true))) .collect()); } if self.allows_new_cli_feature_behavior() { self.members_with_features_new(specs, requested_features) } else { Ok(self.members_with_features_old(specs, requested_features)) } } /// New command-line feature selection behavior with resolver = "2" or the /// root of a virtual workspace. See `allows_new_cli_feature_behavior`. fn members_with_features_new( &self, specs: &[PackageIdSpec], requested_features: &RequestedFeatures, ) -> CargoResult<Vec<(&Package, RequestedFeatures)>> { // Keep track of which features matched *any* member, to produce an error // if any of them did not match anywhere. let mut found: BTreeSet<InternedString> = BTreeSet::new(); // Returns the requested features for the given member. // This filters out any named features that the member does not have. let mut matching_features = |member: &Package| -> RequestedFeatures { if requested_features.features.is_empty() || requested_features.all_features { return requested_features.clone(); } // Only include features this member defines. let summary = member.summary(); let member_features = summary.features(); let mut features = BTreeSet::new(); // Checks if a member contains the given feature. let contains = |feature: InternedString| -> bool { member_features.contains_key(&feature) || summary .dependencies() .iter() .any(|dep| dep.is_optional() && dep.name_in_toml() == feature) }; for feature in requested_features.features.iter() { let mut split = feature.splitn(2, '/'); let split = (split.next().unwrap(), split.next()); if let (pkg, Some(pkg_feature)) = split { let pkg = InternedString::new(pkg); let pkg_feature = InternedString::new(pkg_feature); if summary .dependencies() .iter() .any(|dep| dep.name_in_toml() == pkg) { // pkg/feat for a dependency. // Will rely on the dependency resolver to validate `feat`. features.insert(*feature); found.insert(*feature); } else if pkg == member.name() && contains(pkg_feature) { // member/feat where "feat" is a feature in member. features.insert(pkg_feature); found.insert(*feature); } } else if contains(*feature) { // feature exists in this member. features.insert(*feature); found.insert(*feature); } } RequestedFeatures { features: Rc::new(features), all_features: false, uses_default_features: requested_features.uses_default_features, } }; let members: Vec<(&Package, RequestedFeatures)> = self .members() .filter(|m| specs.iter().any(|spec| spec.matches(m.package_id()))) .map(|m| (m, matching_features(m))) .collect(); if members.is_empty() { // `cargo build -p foo`, where `foo` is not a member. // Do not allow any command-line flags (defaults only). if !(requested_features.features.is_empty() && !requested_features.all_features && requested_features.uses_default_features) { anyhow::bail!("cannot specify features for packages outside of workspace"); } // Add all members from the workspace so we can ensure `-p nonmember` // is in the resolve graph. return Ok(self .members() .map(|m| (m, RequestedFeatures::new_all(false))) .collect()); } if *requested_features.features != found { let missing: Vec<_> = requested_features .features .difference(&found) .copied() .collect(); // TODO: typo suggestions would be good here. anyhow::bail!( "none of the selected packages contains these features: {}", missing.join(", ") ); } Ok(members) } /// This is the "old" behavior for command-line feature selection. /// See `allows_new_cli_feature_behavior`. fn members_with_features_old( &self, specs: &[PackageIdSpec], requested_features: &RequestedFeatures, ) -> Vec<(&Package, RequestedFeatures)> { // Split off any features with the syntax `member-name/feature-name` into a map // so that those features can be applied directly to those workspace-members. let mut member_specific_features: HashMap<&str, BTreeSet<InternedString>> = HashMap::new(); // Features for the member in the current directory. let mut cwd_features = BTreeSet::new(); for feature in requested_features.features.iter() { if let Some(index) = feature.find('/') { let name = &feature[..index]; if specs.iter().any(|spec| spec.name() == name) { member_specific_features .entry(name) .or_default() .insert(InternedString::new(&feature[index + 1..])); } else { cwd_features.insert(*feature); } } else { cwd_features.insert(*feature); }; } let ms = self.members().filter_map(|member| { let member_id = member.package_id(); match self.current_opt() { // The features passed on the command-line only apply to // the "current" package (determined by the cwd). Some(current) if member_id == current.package_id() => { let feats = RequestedFeatures { features: Rc::new(cwd_features.clone()), all_features: requested_features.all_features, uses_default_features: requested_features.uses_default_features, }; Some((member, feats)) } _ => { // Ignore members that are not enabled on the command-line. if specs.iter().any(|spec| spec.matches(member_id)) { // -p for a workspace member that is not the "current" // one. // // The odd behavior here is due to backwards // compatibility. `--features` and // `--no-default-features` used to only apply to the // "current" package. As an extension, this allows // member-name/feature-name to set member-specific // features, which should be backwards-compatible. let feats = RequestedFeatures { features: Rc::new( member_specific_features .remove(member.name().as_str()) .unwrap_or_default(), ), uses_default_features: true, all_features: requested_features.all_features, }; Some((member, feats)) } else { // This member was not requested on the command-line, skip. None } } } }); ms.collect() } } impl<'cfg> Packages<'cfg> { fn get(&self, manifest_path: &Path) -> &MaybePackage { self.maybe_get(manifest_path).unwrap() } fn get_mut(&mut self, manifest_path: &Path) -> &mut MaybePackage { self.maybe_get_mut(manifest_path).unwrap() } fn maybe_get(&self, manifest_path: &Path) -> Option<&MaybePackage> { self.packages.get(manifest_path.parent().unwrap()) } fn maybe_get_mut(&mut self, manifest_path: &Path) -> Option<&mut MaybePackage> { self.packages.get_mut(manifest_path.parent().unwrap()) } fn load(&mut self, manifest_path: &Path) -> CargoResult<&MaybePackage> {
impl<'a, 'cfg> Iterator for Members<'a, 'cfg> { type Item = &'a Package; fn next(&mut self) -> Option<&'a Package> { loop { let next = self.iter.next().map(|path| self.ws.packages.get(path)); match next { Some(&MaybePackage::Package(ref p)) => return Some(p), Some(&MaybePackage::Virtual(_)) => {} None => return None, } } } fn size_hint(&self) -> (usize, Option<usize>) { let (_, upper) = self.iter.size_hint(); (0, upper) } } impl MaybePackage { fn workspace_config(&self) -> &WorkspaceConfig { match *self { MaybePackage::Package(ref p) => p.manifest().workspace_config(), MaybePackage::Virtual(ref vm) => vm.workspace_config(), } } } impl WorkspaceRootConfig { /// Creates a new Intermediate Workspace Root configuration. pub fn new( root_dir: &Path, members: &Option<Vec<String>>, default_members: &Option<Vec<String>>, exclude: &Option<Vec<String>>, custom_metadata: &Option<toml::Value>, ) -> WorkspaceRootConfig { WorkspaceRootConfig { root_dir: root_dir.to_path_buf(), members: members.clone(), default_members: default_members.clone(), exclude: exclude.clone().unwrap_or_default(), custom_metadata: custom_metadata.clone(), } } /// Checks the path against the `excluded` list. /// /// This method does **not** consider the `members` list. fn is_excluded(&self, manifest_path: &Path) -> bool { let excluded = self .exclude .iter() .any(|ex| manifest_path.starts_with(self.root_dir.join(ex))); let explicit_member = match self.members { Some(ref members) => members .iter() .any(|mem| manifest_path.starts_with(self.root_dir.join(mem))), None => false, }; !explicit_member && excluded } fn has_members_list(&self) -> bool { self.members.is_some() } fn members_paths(&self, globs: &[String]) -> CargoResult<Vec<PathBuf>> { let mut expanded_list = Vec::new(); for glob in globs { let pathbuf = self.root_dir.join(glob); let expanded_paths = Self::expand_member_path(&pathbuf)?; // If glob does not find any valid paths, then put the original // path in the expanded list to maintain backwards compatibility. if expanded_paths.is_empty() { expanded_list.push(pathbuf); } else { // Some OS can create system support files anywhere. // (e.g. macOS creates `.DS_Store` file if you visit a directory using Finder.) // Such files can be reported as a member path unexpectedly. // Check and filter out non-directory paths to prevent pushing such accidental unwanted path // as a member. for expanded_path in expanded_paths { if expanded_path.is_dir() { expanded_list.push(expanded_path); } } } } Ok(expanded_list) } fn expand_member_path(path: &Path) -> CargoResult<Vec<PathBuf>> { let path = match path.to_str() { Some(p) => p, None => return Ok(Vec::new()), }; let res = glob(path).chain_err(|| anyhow::format_err!("could not parse pattern `{}`", &path))?; let res = res .map(|p| { p.chain_err(|| anyhow::format_err!("unable to match path to pattern `{}`", &path)) }) .collect::<Result<Vec<_>, _>>()?; Ok(res) } }
let key = manifest_path.parent().unwrap(); match self.packages.entry(key.to_path_buf()) { Entry::Occupied(e) => Ok(e.into_mut()), Entry::Vacant(v) => { let source_id = SourceId::for_path(key)?; let (manifest, _nested_paths) = read_manifest(manifest_path, source_id, self.config)?; Ok(v.insert(match manifest { EitherManifest::Real(manifest) => { MaybePackage::Package(Package::new(manifest, manifest_path)) } EitherManifest::Virtual(vm) => MaybePackage::Virtual(vm), })) } } } }
test_support.py
# # Copyright (c) 2015, Nikolay Polyarnyi # All rights reserved. # import yaml import asyncio import logging import numpy as np import pkg_resources from pathlib import Path from unittest import TestCase from triangulum.utils import support from triangulum.utils.support import str_dict, deep_merge from triangulum.rendering.gl import RenderingAsyncExecutor logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG, format='%(relativeCreated)d [%(threadName)s]\t%(name)s [%(levelname)s]:\t %(message)s') resources_dir_path = Path(pkg_resources.get_provider('triangulum_test.resources').get_resource_filename(__name__, '.')) _default_test_config = { 'debug_output_dir': None,
def load_config(): config_path = str(resources_dir_path / "test_config.yml") try: with open(config_path) as f: user_config = yaml.load(f) config = deep_merge(_default_test_config, user_config) logger.debug("Using test config:\n{}".format(str_dict(config))) except FileNotFoundError: config = _default_test_config logger.debug("No config file found at '{}'.".format(config_path)) logger.debug("Using test config (default one):\n{}".format(str_dict(config))) return config class TestBase(TestCase): def setUp(self): super().setUp() self.config = load_config() self.gl_executor = None self.releasables = [] support.silent_make_dir(self.debug_dir()) def get_gl_executor(self): if self.gl_executor is None: self.gl_executor = RenderingAsyncExecutor() return self.gl_executor def gl_executor_map(self, foo, *args): gl_executor = self.get_gl_executor() result = asyncio.get_event_loop().run_until_complete(gl_executor.map(foo, *args)) return result def register_releasable(self, releasable): self.releasables.append(releasable) def with_debug_output(self): return self.config['debug_output_dir'] is not None def debug_dir(self): return Path(self.config['debug_output_dir']) / self.__class__.__name__ def dump_debug_img(self, path, img): if self.with_debug_output(): path = self.debug_dir() / path support.silent_make_dir(path.parent) support.save_image(path, img) def dump_debug_matrix_by_hue(self, path, mat): if self.with_debug_output(): path = self.debug_dir() / path support.silent_make_dir(path.parent) img = support.array_to_rgb_by_hue(mat)[:, :, ::-1] img = np.uint8(img) support.save_image(path, img) def tearDown(self): super().tearDown() for releasable in self.releasables: self.gl_executor_map(releasable.release)
}
restorer_test.go
// +build acceptance package acceptance import ( "io/ioutil" "math/rand" "os" "os/exec" "path/filepath" "runtime" "testing" "time" "github.com/sclevine/spec" "github.com/sclevine/spec/report" "github.com/buildpacks/lifecycle/api" h "github.com/buildpacks/lifecycle/testhelpers" ) var ( restoreDockerContext = filepath.Join("testdata", "restorer") restorerBinaryDir = filepath.Join("testdata", "restorer", "container", "cnb", "lifecycle") restorerImage = "lifecycle/acceptance/restorer" ) func TestRestorer(t *testing.T) { h.SkipIf(t, runtime.GOOS == "windows", "Restorer acceptance tests are not yet supported on Windows") h.SkipIf(t, runtime.GOARCH != "amd64", "Restorer acceptance tests are not yet supported on non-amd64") rand.Seed(time.Now().UTC().UnixNano()) h.MakeAndCopyLifecycle(t, "linux", "amd64", restorerBinaryDir) h.DockerBuild(t, restorerImage, restoreDockerContext) defer h.DockerImageRemove(t, restorerImage) for _, platformAPI := range api.Platform.Supported { spec.Run(t, "acceptance-restorer/"+platformAPI.String(), testRestorerFunc(platformAPI.String()), spec.Parallel(), spec.Report(report.Terminal{})) } } func
(platformAPI string) func(t *testing.T, when spec.G, it spec.S) { return func(t *testing.T, when spec.G, it spec.S) { when("called with arguments", func() { it("errors", func() { command := exec.Command("docker", "run", "--rm", restorerImage, "some-arg") output, err := command.CombinedOutput() h.AssertNotNil(t, err) expected := "failed to parse arguments: received unexpected Args" h.AssertStringContains(t, string(output), expected) }) }) when("called with -analyzed", func() { it("errors", func() { h.SkipIf(t, api.MustParse(platformAPI).AtLeast("0.7"), "Platform API >= 0.7 supports -analyzed flag") command := exec.Command("docker", "run", "--rm", restorerImage, "-analyzed some-file-location") output, err := command.CombinedOutput() h.AssertNotNil(t, err) expected := "flag provided but not defined: -analyzed" h.AssertStringContains(t, string(output), expected) }) }) when("called with -skip-layers", func() { it("errors", func() { h.SkipIf(t, api.MustParse(platformAPI).AtLeast("0.7"), "Platform API >= 0.7 supports -skip-layers flag") command := exec.Command("docker", "run", "--rm", restorerImage, "-skip-layers true") output, err := command.CombinedOutput() h.AssertNotNil(t, err) expected := "flag provided but not defined: -skip-layers" h.AssertStringContains(t, string(output), expected) }) }) when("called without any cache flag", func() { it("outputs it will not restore cache layer data", func() { command := exec.Command("docker", "run", "--rm", "--env", "CNB_PLATFORM_API="+platformAPI, restorerImage) output, err := command.CombinedOutput() h.AssertNil(t, err) expected := "Not restoring cached layer data, no cache flag specified" h.AssertStringContains(t, string(output), expected) }) }) when("analyzed.toml exists with app metadata", func() { var copyDir, containerName string it.Before(func() { containerName = "test-container-" + h.RandString(10) var err error copyDir, err = ioutil.TempDir("", "test-docker-copy-") h.AssertNil(t, err) }) it.After(func() { if h.DockerContainerExists(t, containerName) { h.Run(t, exec.Command("docker", "rm", containerName)) } os.RemoveAll(copyDir) }) it("restores app metadata", func() { h.SkipIf(t, api.MustParse(platformAPI).LessThan("0.7"), "Platform API < 0.7 does not restore app metadata") output := h.DockerRunAndCopy(t, containerName, copyDir, ctrPath("/layers"), restorerImage, h.WithFlags(append( dockerSocketMount, "--env", "CNB_PLATFORM_API="+platformAPI, )...), h.WithArgs(), ) h.AssertStringContains(t, output, "Restoring metadata for \"some-buildpack-id:launch-layer\"") }) }) when("using cache-dir", func() { when("there is cache present from a previous build", func() { var copyDir, containerName string it.Before(func() { containerName = "test-container-" + h.RandString(10) var err error copyDir, err = ioutil.TempDir("", "test-docker-copy-") h.AssertNil(t, err) }) it.After(func() { if h.DockerContainerExists(t, containerName) { h.Run(t, exec.Command("docker", "rm", containerName)) } os.RemoveAll(copyDir) }) it("restores cached layer data", func() { h.DockerRunAndCopy(t, containerName, copyDir, "/layers", restorerImage, h.WithFlags("--env", "CNB_PLATFORM_API="+platformAPI), h.WithArgs("-cache-dir", "/cache"), ) // check restored cache file is present cachedFile := filepath.Join(copyDir, "layers", "cacher_buildpack", "cached-layer", "data") h.AssertPathExists(t, cachedFile) // check restored cache file content is correct contents, err := ioutil.ReadFile(cachedFile) h.AssertNil(t, err) h.AssertEq(t, string(contents), "cached-data\n") }) it("does not restore cache=true layers not in cache", func() { output := h.DockerRunAndCopy(t, containerName, copyDir, "/layers", restorerImage, h.WithFlags("--env", "CNB_PLATFORM_API="+platformAPI), h.WithArgs("-cache-dir", "/cache"), ) // check uncached layer is not restored uncachedFile := filepath.Join(copyDir, "layers", "cacher_buildpack", "uncached-layer") h.AssertPathDoesNotExist(t, uncachedFile) // check output to confirm why this layer was not restored from cache h.AssertStringContains(t, string(output), "Removing \"cacher_buildpack:layer-not-in-cache\", not in cache") }) it("does not restore unused buildpack layer data", func() { h.DockerRunAndCopy(t, containerName, copyDir, "/layers", restorerImage, h.WithFlags("--env", "CNB_PLATFORM_API="+platformAPI), h.WithArgs("-cache-dir", "/cache"), ) // check no content is not present from unused buildpack unusedBpLayer := filepath.Join(copyDir, "layers", "unused_buildpack") h.AssertPathDoesNotExist(t, unusedBpLayer) }) }) }) } }
testRestorerFunc
low_level_controller.py
import numpy as np class LowLevelController: """Low level controller of a point mass robot with dynamics: x_{k+1} = x_k + v_k * Ts * cos(psi_k) y_{k+1} = y_k + v_k * Ts * sin(psi_k) v_{k+1} = v_k + Ts * a_k psi_{k+1} = psi_k + Ts * omega_k omega_{k+1} = omega_k + Ts * epsilon_k Where a_k and epsilon_k are the inputs and are the translational and rotational accelerations respectively. For now we assume, that it is a perfect controller which is able to produce the exact commanded outputs if they are reachable with the provided input constraints. """ def __init__(self, params): """Initializes a LowLevelController.""" self._init_from_params(params) def get_inputs(self, state, cmd_vel): """produces control inputs based on the actual state and the commanded velocities in cmd_vel = np.array([v_des, omega_des])""" v_des = cmd_vel[0] omega_des = cmd_vel[1] v_k = state[2] omega_k = state[4] # translational acceleration: a_k = (v_des - v_k) / self._Ts if a_k > self._acc_max: a_k = self._acc_max elif a_k < self._acc_min: a_k = self._acc_min # angular acceleration: epsilon_k = (omega_des - omega_k) / self._Ts if epsilon_k > self._epsilon_max: a_epsilon_kk = self._epsilon_max elif epsilon_k < self._epsilon_min: epsilon_k = self._epsilon_min return np.array([a_k, epsilon_k]) def _init_from_params(self, params):
"""Initializes some variables from the params.""" self._Ts = params["general"]["Ts"] self._acc_min = params["LowLevelController"]["acc_min"] self._acc_max = params["LowLevelController"]["acc_max"] self._epsilon_min = params["LowLevelController"]["epsilon_min"] self._epsilon_max = params["LowLevelController"]["epsilon_max"]
handler_test.go
// Copyright (c) 2017 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package domain import ( "context" "log" "os" "testing" "time" "github.com/pborman/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "github.com/uber/cadence/common" "github.com/uber/cadence/common/archiver" "github.com/uber/cadence/common/archiver/provider" "github.com/uber/cadence/common/clock" "github.com/uber/cadence/common/cluster" "github.com/uber/cadence/common/log/loggerimpl" "github.com/uber/cadence/common/mocks" "github.com/uber/cadence/common/persistence" persistencetests "github.com/uber/cadence/common/persistence/persistence-tests" "github.com/uber/cadence/common/service/config" dc "github.com/uber/cadence/common/service/dynamicconfig" "github.com/uber/cadence/common/types" ) type ( domainHandlerCommonSuite struct { suite.Suite persistencetests.TestBase minRetentionDays int maxBadBinaryCount int metadataMgr persistence.MetadataManager mockProducer *mocks.KafkaProducer mockDomainReplicator Replicator archivalMetadata archiver.ArchivalMetadata mockArchiverProvider *provider.MockArchiverProvider handler *handlerImpl } ) var nowInt64 = time.Now().UnixNano() func
(t *testing.T) { s := new(domainHandlerCommonSuite) suite.Run(t, s) } func (s *domainHandlerCommonSuite) SetupSuite() { if testing.Verbose() { log.SetOutput(os.Stdout) } s.TestBase = persistencetests.NewTestBaseWithCassandra(&persistencetests.TestBaseOptions{ ClusterMetadata: cluster.GetTestClusterMetadata(true, true), }) s.TestBase.Setup() } func (s *domainHandlerCommonSuite) TearDownSuite() { s.TestBase.TearDownWorkflowStore() } func (s *domainHandlerCommonSuite) SetupTest() { logger := loggerimpl.NewNopLogger() dcCollection := dc.NewCollection(dc.NewNopClient(), logger) s.minRetentionDays = 1 s.maxBadBinaryCount = 10 s.metadataMgr = s.TestBase.MetadataManager s.mockProducer = &mocks.KafkaProducer{} s.mockDomainReplicator = NewDomainReplicator(s.mockProducer, logger) s.archivalMetadata = archiver.NewArchivalMetadata( dcCollection, "", false, "", false, &config.ArchivalDomainDefaults{}, ) s.mockArchiverProvider = &provider.MockArchiverProvider{} domainConfig := Config{ MinRetentionDays: dc.GetIntPropertyFn(s.minRetentionDays), MaxBadBinaryCount: dc.GetIntPropertyFilteredByDomain(s.maxBadBinaryCount), FailoverCoolDown: dc.GetDurationPropertyFnFilteredByDomain(0 * time.Second), } s.handler = NewHandler( domainConfig, logger, s.metadataMgr, s.ClusterMetadata, s.mockDomainReplicator, s.archivalMetadata, s.mockArchiverProvider, clock.NewRealTimeSource(), ).(*handlerImpl) } func (s *domainHandlerCommonSuite) TearDownTest() { s.mockProducer.AssertExpectations(s.T()) s.mockArchiverProvider.AssertExpectations(s.T()) } func (s *domainHandlerCommonSuite) TestMergeDomainData_Overriding() { out := s.handler.mergeDomainData( map[string]string{ "k0": "v0", }, map[string]string{ "k0": "v2", }, ) assert.Equal(s.T(), map[string]string{ "k0": "v2", }, out) } func (s *domainHandlerCommonSuite) TestMergeDomainData_Adding() { out := s.handler.mergeDomainData( map[string]string{ "k0": "v0", }, map[string]string{ "k1": "v2", }, ) assert.Equal(s.T(), map[string]string{ "k0": "v0", "k1": "v2", }, out) } func (s *domainHandlerCommonSuite) TestMergeDomainData_Merging() { out := s.handler.mergeDomainData( map[string]string{ "k0": "v0", }, map[string]string{ "k0": "v1", "k1": "v2", }, ) assert.Equal(s.T(), map[string]string{ "k0": "v1", "k1": "v2", }, out) } func (s *domainHandlerCommonSuite) TestMergeDomainData_Nil() { out := s.handler.mergeDomainData( nil, map[string]string{ "k0": "v1", "k1": "v2", }, ) assert.Equal(s.T(), map[string]string{ "k0": "v1", "k1": "v2", }, out) } // test merging bad binaries func (s *domainHandlerCommonSuite) TestMergeBadBinaries_Overriding() { out := s.handler.mergeBadBinaries( map[string]*types.BadBinaryInfo{ "k0": {Reason: common.StringPtr("reason0")}, }, map[string]*types.BadBinaryInfo{ "k0": {Reason: common.StringPtr("reason2")}, }, nowInt64, ) assert.Equal(s.T(), types.BadBinaries{ Binaries: map[string]*types.BadBinaryInfo{ "k0": {Reason: common.StringPtr("reason2"), CreatedTimeNano: common.Int64Ptr(nowInt64)}, }, }, out) } func (s *domainHandlerCommonSuite) TestMergeBadBinaries_Adding() { out := s.handler.mergeBadBinaries( map[string]*types.BadBinaryInfo{ "k0": {Reason: common.StringPtr("reason0")}, }, map[string]*types.BadBinaryInfo{ "k1": {Reason: common.StringPtr("reason2")}, }, nowInt64, ) expected := types.BadBinaries{ Binaries: map[string]*types.BadBinaryInfo{ "k0": {Reason: common.StringPtr("reason0")}, "k1": {Reason: common.StringPtr("reason2"), CreatedTimeNano: common.Int64Ptr(nowInt64)}, }, } assert.Equal(s.T(), expected, out) } func (s *domainHandlerCommonSuite) TestMergeBadBinaries_Merging() { out := s.handler.mergeBadBinaries( map[string]*types.BadBinaryInfo{ "k0": {Reason: common.StringPtr("reason0")}, }, map[string]*types.BadBinaryInfo{ "k0": {Reason: common.StringPtr("reason1")}, "k1": {Reason: common.StringPtr("reason2")}, }, nowInt64, ) assert.Equal(s.T(), types.BadBinaries{ Binaries: map[string]*types.BadBinaryInfo{ "k0": {Reason: common.StringPtr("reason1"), CreatedTimeNano: common.Int64Ptr(nowInt64)}, "k1": {Reason: common.StringPtr("reason2"), CreatedTimeNano: common.Int64Ptr(nowInt64)}, }, }, out) } func (s *domainHandlerCommonSuite) TestMergeBadBinaries_Nil() { out := s.handler.mergeBadBinaries( nil, map[string]*types.BadBinaryInfo{ "k0": {Reason: common.StringPtr("reason1")}, "k1": {Reason: common.StringPtr("reason2")}, }, nowInt64, ) assert.Equal(s.T(), types.BadBinaries{ Binaries: map[string]*types.BadBinaryInfo{ "k0": {Reason: common.StringPtr("reason1"), CreatedTimeNano: common.Int64Ptr(nowInt64)}, "k1": {Reason: common.StringPtr("reason2"), CreatedTimeNano: common.Int64Ptr(nowInt64)}, }, }, out) } func (s *domainHandlerCommonSuite) TestListDomain() { domainName1 := s.getRandomDomainName() description1 := "some random description 1" email1 := "some random email 1" retention1 := int32(1) emitMetric1 := true data1 := map[string]string{"some random key 1": "some random value 1"} isGlobalDomain1 := false activeClusterName1 := s.ClusterMetadata.GetCurrentClusterName() var cluster1 []*types.ClusterReplicationConfiguration for _, replicationConfig := range persistence.GetOrUseDefaultClusters(s.ClusterMetadata.GetCurrentClusterName(), nil) { cluster1 = append(cluster1, &types.ClusterReplicationConfiguration{ ClusterName: common.StringPtr(replicationConfig.ClusterName), }) } err := s.handler.RegisterDomain(context.Background(), &types.RegisterDomainRequest{ Name: common.StringPtr(domainName1), Description: common.StringPtr(description1), OwnerEmail: common.StringPtr(email1), WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(retention1), EmitMetric: common.BoolPtr(emitMetric1), Data: data1, IsGlobalDomain: common.BoolPtr(isGlobalDomain1), }) s.Nil(err) domainName2 := s.getRandomDomainName() description2 := "some random description 2" email2 := "some random email 2" retention2 := int32(2) emitMetric2 := false data2 := map[string]string{"some random key 2": "some random value 2"} isGlobalDomain2 := true activeClusterName2 := "" var cluster2 []*types.ClusterReplicationConfiguration for clusterName := range s.ClusterMetadata.GetAllClusterInfo() { if clusterName != s.ClusterMetadata.GetCurrentClusterName() { activeClusterName2 = clusterName } cluster2 = append(cluster2, &types.ClusterReplicationConfiguration{ ClusterName: common.StringPtr(clusterName), }) } s.mockProducer.On("Publish", mock.Anything, mock.Anything).Return(nil).Once() err = s.handler.RegisterDomain(context.Background(), &types.RegisterDomainRequest{ Name: common.StringPtr(domainName2), Description: common.StringPtr(description2), OwnerEmail: common.StringPtr(email2), WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(retention2), EmitMetric: common.BoolPtr(emitMetric2), Clusters: cluster2, ActiveClusterName: common.StringPtr(activeClusterName2), Data: data2, IsGlobalDomain: common.BoolPtr(isGlobalDomain2), }) s.Nil(err) domains := map[string]*types.DescribeDomainResponse{} pagesize := int32(1) var token []byte for doPaging := true; doPaging; doPaging = len(token) > 0 { resp, err := s.handler.ListDomains(context.Background(), &types.ListDomainsRequest{ PageSize: common.Int32Ptr(pagesize), NextPageToken: token, }) s.Nil(err) token = resp.NextPageToken s.True(len(resp.Domains) <= int(pagesize)) if len(resp.Domains) > 0 { s.NotEmpty(resp.Domains[0].DomainInfo.GetUUID()) resp.Domains[0].DomainInfo.UUID = common.StringPtr("") domains[resp.Domains[0].DomainInfo.GetName()] = resp.Domains[0] } } delete(domains, common.SystemLocalDomainName) s.Equal(map[string]*types.DescribeDomainResponse{ domainName1: &types.DescribeDomainResponse{ DomainInfo: &types.DomainInfo{ Name: common.StringPtr(domainName1), Status: types.DomainStatusRegistered.Ptr(), Description: common.StringPtr(description1), OwnerEmail: common.StringPtr(email1), Data: data1, UUID: common.StringPtr(""), }, Configuration: &types.DomainConfiguration{ WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(retention1), EmitMetric: common.BoolPtr(emitMetric1), HistoryArchivalStatus: types.ArchivalStatusDisabled.Ptr(), HistoryArchivalURI: common.StringPtr(""), VisibilityArchivalStatus: types.ArchivalStatusDisabled.Ptr(), VisibilityArchivalURI: common.StringPtr(""), BadBinaries: &types.BadBinaries{Binaries: map[string]*types.BadBinaryInfo{}}, }, ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr(activeClusterName1), Clusters: cluster1, }, FailoverVersion: common.Int64Ptr(common.EmptyVersion), IsGlobalDomain: common.BoolPtr(isGlobalDomain1), }, domainName2: &types.DescribeDomainResponse{ DomainInfo: &types.DomainInfo{ Name: common.StringPtr(domainName2), Status: types.DomainStatusRegistered.Ptr(), Description: common.StringPtr(description2), OwnerEmail: common.StringPtr(email2), Data: data2, UUID: common.StringPtr(""), }, Configuration: &types.DomainConfiguration{ WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(retention2), EmitMetric: common.BoolPtr(emitMetric2), HistoryArchivalStatus: types.ArchivalStatusDisabled.Ptr(), HistoryArchivalURI: common.StringPtr(""), VisibilityArchivalStatus: types.ArchivalStatusDisabled.Ptr(), VisibilityArchivalURI: common.StringPtr(""), BadBinaries: &types.BadBinaries{Binaries: map[string]*types.BadBinaryInfo{}}, }, ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr(activeClusterName2), Clusters: cluster2, }, FailoverVersion: common.Int64Ptr(s.ClusterMetadata.GetNextFailoverVersion(activeClusterName2, 0)), IsGlobalDomain: common.BoolPtr(isGlobalDomain2), }, }, domains) } func (s *domainHandlerCommonSuite) TestRegisterDomain_InvalidRetentionPeriod() { registerRequest := &types.RegisterDomainRequest{ Name: common.StringPtr("random domain name"), Description: common.StringPtr("random domain name"), WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(int32(0)), IsGlobalDomain: common.BoolPtr(false), } err := s.handler.RegisterDomain(context.Background(), registerRequest) s.Equal(errInvalidRetentionPeriod, err) } func (s *domainHandlerCommonSuite) TestUpdateDomain_InvalidRetentionPeriod() { domain := "random domain name" registerRequest := &types.RegisterDomainRequest{ Name: common.StringPtr(domain), Description: common.StringPtr(domain), WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(int32(10)), IsGlobalDomain: common.BoolPtr(false), } err := s.handler.RegisterDomain(context.Background(), registerRequest) s.NoError(err) updateRequest := &types.UpdateDomainRequest{ Name: common.StringPtr(domain), Configuration: &types.DomainConfiguration{ WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(int32(-1)), }, } _, err = s.handler.UpdateDomain(context.Background(), updateRequest) s.Equal(errInvalidRetentionPeriod, err) } func (s *domainHandlerCommonSuite) TestUpdateDomain_GracefulFailover_Success() { s.mockProducer.On("Publish", mock.Anything, mock.Anything).Return(nil).Twice() domain := uuid.New() registerRequest := &types.RegisterDomainRequest{ Name: common.StringPtr(domain), Description: common.StringPtr(domain), WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(int32(10)), IsGlobalDomain: common.BoolPtr(true), ActiveClusterName: common.StringPtr("standby"), Clusters: []*types.ClusterReplicationConfiguration{ { common.StringPtr(s.ClusterMetadata.GetCurrentClusterName()), }, { common.StringPtr("standby"), }, }, } err := s.handler.RegisterDomain(context.Background(), registerRequest) s.NoError(err) resp1, _ := s.metadataMgr.GetDomain(context.Background(), &persistence.GetDomainRequest{ Name: domain, }) s.Equal("standby", resp1.ReplicationConfig.ActiveClusterName) s.Equal(cluster.TestAlternativeClusterInitialFailoverVersion, resp1.FailoverVersion) updateRequest := &types.UpdateDomainRequest{ Name: common.StringPtr(domain), ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr(s.ClusterMetadata.GetCurrentClusterName()), }, FailoverTimeoutInSeconds: common.Int32Ptr(100), } resp, err := s.handler.UpdateDomain(context.Background(), updateRequest) s.NoError(err) resp2, err := s.metadataMgr.GetDomain(context.Background(), &persistence.GetDomainRequest{ ID: resp.GetDomainInfo().GetUUID(), }) s.NoError(err) s.NotNil(resp2.FailoverEndTime) s.Equal(cluster.TestFailoverVersionIncrement, resp2.FailoverVersion) s.Equal(cluster.TestAlternativeClusterInitialFailoverVersion, resp2.PreviousFailoverVersion) } func (s *domainHandlerCommonSuite) TestUpdateDomain_GracefulFailover_NotCurrentActiveCluster() { s.mockProducer.On("Publish", mock.Anything, mock.Anything).Return(nil).Once() domain := uuid.New() registerRequest := &types.RegisterDomainRequest{ Name: common.StringPtr(domain), Description: common.StringPtr(domain), WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(int32(10)), IsGlobalDomain: common.BoolPtr(true), ActiveClusterName: common.StringPtr("active"), Clusters: []*types.ClusterReplicationConfiguration{ { common.StringPtr("active"), }, { common.StringPtr("standby"), }, }, } err := s.handler.RegisterDomain(context.Background(), registerRequest) s.NoError(err) updateRequest := &types.UpdateDomainRequest{ Name: common.StringPtr(domain), ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr("standby"), }, FailoverTimeoutInSeconds: common.Int32Ptr(100), } _, err = s.handler.UpdateDomain(context.Background(), updateRequest) s.Error(err) } func (s *domainHandlerCommonSuite) TestUpdateDomain_GracefulFailover_OngoingFailover() { s.mockProducer.On("Publish", mock.Anything, mock.Anything).Return(nil).Twice() domain := uuid.New() registerRequest := &types.RegisterDomainRequest{ Name: common.StringPtr(domain), Description: common.StringPtr(domain), WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(int32(10)), IsGlobalDomain: common.BoolPtr(true), ActiveClusterName: common.StringPtr("standby"), Clusters: []*types.ClusterReplicationConfiguration{ { common.StringPtr(s.ClusterMetadata.GetCurrentClusterName()), }, { common.StringPtr("standby"), }, }, } err := s.handler.RegisterDomain(context.Background(), registerRequest) s.NoError(err) updateRequest := &types.UpdateDomainRequest{ Name: common.StringPtr(domain), ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr(s.ClusterMetadata.GetCurrentClusterName()), }, FailoverTimeoutInSeconds: common.Int32Ptr(100), } _, err = s.handler.UpdateDomain(context.Background(), updateRequest) s.NoError(err) _, err = s.handler.UpdateDomain(context.Background(), updateRequest) s.Error(err) } func (s *domainHandlerCommonSuite) TestUpdateDomain_GracefulFailover_NoUpdateActiveCluster() { s.mockProducer.On("Publish", mock.Anything, mock.Anything).Return(nil).Once() domain := uuid.New() registerRequest := &types.RegisterDomainRequest{ Name: common.StringPtr(domain), Description: common.StringPtr(domain), WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(int32(10)), IsGlobalDomain: common.BoolPtr(true), ActiveClusterName: common.StringPtr("standby"), Clusters: []*types.ClusterReplicationConfiguration{ { common.StringPtr(s.ClusterMetadata.GetCurrentClusterName()), }, { common.StringPtr("standby"), }, }, } err := s.handler.RegisterDomain(context.Background(), registerRequest) s.NoError(err) updateRequest := &types.UpdateDomainRequest{ Name: common.StringPtr(domain), UpdatedInfo: &types.UpdateDomainInfo{ OwnerEmail: common.StringPtr("test"), }, FailoverTimeoutInSeconds: common.Int32Ptr(100), } _, err = s.handler.UpdateDomain(context.Background(), updateRequest) s.Error(err) } func (s *domainHandlerCommonSuite) TestUpdateDomain_GracefulFailover_After_ForceFailover() { s.mockProducer.On("Publish", mock.Anything, mock.Anything).Return(nil).Times(3) domain := uuid.New() registerRequest := &types.RegisterDomainRequest{ Name: common.StringPtr(domain), Description: common.StringPtr(domain), WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(int32(10)), IsGlobalDomain: common.BoolPtr(true), ActiveClusterName: common.StringPtr("standby"), Clusters: []*types.ClusterReplicationConfiguration{ { common.StringPtr(s.ClusterMetadata.GetCurrentClusterName()), }, { common.StringPtr("standby"), }, }, } err := s.handler.RegisterDomain(context.Background(), registerRequest) s.NoError(err) // Start graceful failover updateRequest := &types.UpdateDomainRequest{ Name: common.StringPtr(domain), ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr(s.ClusterMetadata.GetCurrentClusterName()), }, FailoverTimeoutInSeconds: common.Int32Ptr(100), } resp, err := s.handler.UpdateDomain(context.Background(), updateRequest) s.NoError(err) // Force failover updateRequest = &types.UpdateDomainRequest{ Name: common.StringPtr(domain), ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr(s.ClusterMetadata.GetCurrentClusterName()), }, } _, err = s.handler.UpdateDomain(context.Background(), updateRequest) s.NoError(err) resp2, err := s.metadataMgr.GetDomain(context.Background(), &persistence.GetDomainRequest{ ID: resp.GetDomainInfo().GetUUID(), }) s.NoError(err) s.Nil(resp2.FailoverEndTime) } func (s *domainHandlerCommonSuite) TestUpdateDomain_ForceFailover_SameActiveCluster() { s.mockProducer.On("Publish", mock.Anything, mock.Anything).Return(nil).Twice() domain := uuid.New() registerRequest := &types.RegisterDomainRequest{ Name: common.StringPtr(domain), Description: common.StringPtr(domain), WorkflowExecutionRetentionPeriodInDays: common.Int32Ptr(int32(10)), IsGlobalDomain: common.BoolPtr(true), ActiveClusterName: common.StringPtr("standby"), Clusters: []*types.ClusterReplicationConfiguration{ { common.StringPtr(s.ClusterMetadata.GetCurrentClusterName()), }, { common.StringPtr("standby"), }, }, } err := s.handler.RegisterDomain(context.Background(), registerRequest) s.NoError(err) // Start graceful failover updateRequest := &types.UpdateDomainRequest{ Name: common.StringPtr(domain), ReplicationConfiguration: &types.DomainReplicationConfiguration{ ActiveClusterName: common.StringPtr("standby"), }, } _, err = s.handler.UpdateDomain(context.Background(), updateRequest) s.NoError(err) } func (s *domainHandlerCommonSuite) getRandomDomainName() string { return "domain" + uuid.New() }
TestDomainHandlerCommonSuite
theme.js
setTimeout(function () { $("#bigSlider").owlCarousel({ autoplay: true, autoPlaySpeed: 2000, autoPlayTimeout: 1000, autoplayHoverPause: false, responsive: { // breakpoint from 0 up 0: { autoWidth: false, items: 2, }, // breakpoint from 480 up 480: { autoWidth: false, items: 1, }, 300: { autoWidth: false, items: 1, }, // breakpoint from 768 up 767: { autoWidth: false, items: 2, } } }); $(".mobileSlider").owlCarousel({
items: 1, // autoplay: true, }); $("#reviewSlider").owlCarousel({ autoWidth: true, items: 2, autoplay: true, }); function hideMenufunction(obj) { $(document).on('click', '.hideMenuClass', function () { $(".hideMenuClass").removeClass("active hideMenuClass"); $(".hmbrgrMenuData ").hide(); }); } $(document).on('click', '.hmbrgrMenu', function () { $(this).addClass("active hideMenuClass"); $(".hmbrgrMenuData ").show(); hideMenufunction(this); }); }, 1000)
autoWidth: true,
014-Validate Binary Search Tree.py
""" Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater than the node's key. Both the left and right subtrees must also be binary search trees. confused what "{1,#,2,3}" means? > read more on how binary tree is serialized on OJ. OJ's Binary Tree Serialization: The serialization of a binary tree follows a level order traversal, where '#' signifies a path terminator where no node exists below. Here's an example: 1 / \ 2 3 / 4 \ 5 The above binary tree is serialized as "{1,2,3,#,#,4,#,#,5}". """ # Definition for a binary tree node class
: def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): @staticmethod def iter_bst(root, left, right): if not root: return True if root.val >= right or root.val <= left: return False else: return Solution.iter_bst(root.left, left, root.val) and Solution.iter_bst(root.right, root.val, right) # @param root, a tree node # @return a boolean @staticmethod def is_valid_bst(root): # time cost is N, where N is num of tree elements import sys return Solution.iter_bst(root, -sys.maxint-1, sys.maxint) if __name__ == "__main__": r = TreeNode(1) r.left = TreeNode(-2) r.right = TreeNode(3) r.right.left = TreeNode(2) r.right.left.right = TreeNode(2.5) print Solution.is_valid_bst(r) r1 = TreeNode(10) r1.left = TreeNode(5) r1.right = TreeNode(15) r1.right.left = TreeNode(6) r1.right.right = TreeNode(20) r0 = TreeNode(9) r0.right = r1 print Solution.is_valid_bst(r0)
TreeNode
lib.rs
extern crate mbutiles; extern crate rustc_serialize; extern crate jlens; use mbutiles::{export, import, Scheme, ImageFormat }; use std::fs; use std::env; use std::io::Error; use std::path::PathBuf; use jlens::*; use std::fs::File; use rustc_serialize::json::Json; fn clear_data(output: &str) -> Result<(PathBuf, PathBuf),Error> { let current_dir = try!(env::current_dir()); let tests = current_dir.join("tests"); let output = tests.join(output); //println!("remove: {:?}", output); if output.exists() { try!(fs::remove_dir_all(output.clone())); } Ok((tests, output)) } #[test] fn export_saves_tiles_and_metadata() { let output_name = "output_saves_tiles_and_metadata"; let (tests, output) = clear_data(output_name).unwrap(); export(tests.join("data/one_tile.mbtiles"), Some(output.clone()), Scheme::Xyz, ImageFormat::Png, "".to_owned()).unwrap(); assert!(output.join("0/0/0.png").exists()); assert!(output.join("1/0/0.png").exists()); assert!(output.join("metadata.json").exists()); clear_data(output_name).unwrap(); } #[test] fn export_saves_tiles_and_metadata_and_back() { let output_name = "output_saves_tiles_and_metadata_and_back"; let (tests, output) = clear_data(output_name).unwrap(); export(tests.join("data/one_tile.mbtiles"), Some(output.clone()), Scheme::Xyz, ImageFormat::Png, "".to_owned()).unwrap(); import(output.clone(), output.join("one_tile.mbtiles"), Scheme::Xyz, ImageFormat::Png).unwrap(); assert!(output.join("one_tile.mbtiles").exists()); clear_data(output_name).unwrap(); } #[test] fn export_saves_utf8grid_tiles_and_metadata() { let output_name = "saves_utf8grid_tiles_and_metadata"; let (tests, output) = clear_data(output_name).unwrap(); export(tests.join("data/utf8grid.mbtiles"), Some(output.clone()), Scheme::Xyz, ImageFormat::Png, "".to_owned()).unwrap(); assert!(output.join("0/0/0.grid.json").exists()); assert!(output.join("0/0/0.png").exists()); assert!(output.join("metadata.json").exists()); clear_data(output_name).unwrap(); } #[test] fn
() { let output_name = "tiles_to_utf8grid_mbtiles"; let (tests, output) = clear_data(output_name).unwrap(); export(tests.join("data/utf8grid.mbtiles"), Some(output.join("exported")), Scheme::Xyz, ImageFormat::Png, "".to_owned()).unwrap(); import(output.join("exported"), output.join("imported.mbtiles"), Scheme::Xyz, ImageFormat::Png).unwrap(); export(output.join("imported.mbtiles"), Some(output.join("imported")), Scheme::Xyz, ImageFormat::Png, "".to_owned()).unwrap(); assert!(output.join("imported/0/0/0.grid.json").exists()); let mut exported_grid = File::open(output.join("exported/0/0/0.grid.json")).unwrap(); let exported_json = Json::from_reader(&mut exported_grid).unwrap(); let mut imported_grid = File::open(output.join("imported/0/0/0.grid.json")).unwrap(); let imported_json = Json::from_reader(&mut imported_grid).unwrap(); assert!(imported_json.query(key("data").key("77")) == exported_json.query(key("data").key("77"))); clear_data(output_name).unwrap(); }
import_tiles_to_utf8grid_mbtiles
window.rs
#[doc = "Reader of register WINDOW"] pub type R = crate::R<u32, super::WINDOW>; #[doc = "Writer for register WINDOW"] pub type W = crate::W<u32, super::WINDOW>; #[doc = "Register WINDOW `reset()`'s with value 0x0f"] impl crate::ResetValue for super::WINDOW { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type
} #[doc = "Reader of field `WINDOW`"] pub type WINDOW_R = crate::R<u32, u32>; #[doc = "Write proxy for field `WINDOW`"] pub struct WINDOW_W<'a> { w: &'a mut W, } impl<'a> WINDOW_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff); self.w } } impl R { #[doc = "Bits 0:31 - Index acceptance window width."] #[inline(always)] pub fn window(&self) -> WINDOW_R { WINDOW_R::new((self.bits & 0xffff_ffff) as u32) } } impl W { #[doc = "Bits 0:31 - Index acceptance window width."] #[inline(always)] pub fn window(&mut self) -> WINDOW_W { WINDOW_W { w: self } } }
{ 0x0f }
errors.py
"""ERRORS""" class Error(Exception): """Main Error Class""" def __init__(self, message): self.message = message @property def serialize(self): return { 'message': self.message } class CompositeError(Error):
class GeostoreNotFound(Error): pass
pass
8841f678.7473fbd6.js
(window.webpackJsonp=window.webpackJsonp||[]).push([[147],{204:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return a})),r.d(t,"metadata",(function(){return s})),r.d(t,"rightToc",(function(){return c})),r.d(t,"default",(function(){return p}));var n=r(2),i=r(6),o=(r(0),r(332)),a={id:"selfservice-flow-completion",title:"Self-Service Flow Completion"},s={unversionedId:"concepts/selfservice-flow-completion",id:"version-v0.3/concepts/selfservice-flow-completion",isDocsHomePage:!1,title:"Self-Service Flow Completion",description:"Self-Service flows such as Login, Registration, Updating Settings support two",source:"@site/versioned_docs/version-v0.3/concepts/selfservice-flow-completion.md",slug:"/concepts/selfservice-flow-completion",permalink:"/kratos/docs/v0.3/concepts/selfservice-flow-completion",editUrl:"https://github.com/ory/kratos/edit/master/docs/versioned_docs/version-v0.3/concepts/selfservice-flow-completion.md",version:"v0.3",lastUpdatedBy:"aeneasr",lastUpdatedAt:1589548840,sidebar:"version-v0.3/docs",previous:{title:"Social Sign In, OpenID Connect, and OAuth2",permalink:"/kratos/docs/v0.3/concepts/credentials/openid-connect-oidc-oauth2"},next:{title:"Out-of-band communication via E-Mail and SMS",permalink:"/kratos/docs/v0.3/concepts/email-sms"}},c=[{value:"Redirection",id:"redirection",children:[{value:"Post-Login Redirection",id:"post-login-redirection",children:[]},{value:"Post-Registration Redirection",id:"post-registration-redirection",children:[]},{value:"Post-Settings Redirection",id:"post-settings-redirection",children:[]}]},{value:"JSON",id:"json",children:[]}],l={rightToc:c};function p(e){var t=e.components,r=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(n.a)({},l,r,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,"Self-Service flows such as Login, Registration, Updating Settings support two\nsuccessful response modes:"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"For browsers, the response will be a ",Object(o.b)("a",Object(n.a)({parentName:"li"},{href:"#redirection"}),"redirection"),"."),Object(o.b)("li",{parentName:"ul"},"For API clients (this includes AJAX) the response will be in ",Object(o.b)("a",Object(n.a)({parentName:"li"},{href:"#json"}),"JSON"),".")),Object(o.b)("h2",{id:"redirection"},"Redirection"),Object(o.b)("p",null,"Browser requests, identified by the ",Object(o.b)("inlineCode",{parentName:"p"},"Accept: text/html")," header, complete with a\nredirection flow. If no redirection URL is set for the flow, the Default\nRedirect URL will be used for most flows (e.g. login, registration):"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml",metastring:'file="path/to/my/kratos.config.yml"',file:'"path/to/my/kratos.config.yml"'}),"urls:\n default_redirect_to: https://always-end-up-here-per-default/\n")),Object(o.b)("p",null,"It is possible to specify a redirect URL per Self-Service Flow:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml",metastring:'file="path/to/my/kratos.config.yml"',file:'"path/to/my/kratos.config.yml"'}),"selfservice:\n login:\n after:\n default_redirect_to: https://end-up-here-after-login/\n registration:\n after:\n default_redirect_to: https://end-up-here-after-registration/\n # ...\n")),Object(o.b)("p",null,"You may also set redirect URLs per strategy (overrides\n",Object(o.b)("inlineCode",{parentName:"p"},"selfservice.<login|registration|...>.default_return_to"),"):"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml",metastring:'file="path/to/my/kratos.config.yml"',file:'"path/to/my/kratos.config.yml"'}),"selfservice:\n login:\n after:\n default_redirect_to: https://this-is-overridden-by-password/\n password:\n default_redirect_to: https://end-up-here-after-login-with-password/\n # ...\n")),Object(o.b)("p",null,"It is also possible to redirect someone back to the original URL. For example,\nif a user requests ",Object(o.b)("inlineCode",{parentName:"p"},"https://www.myapp.com/blog/write")," but is not logged in, we\nwant the user to end up at that page after login. To achieve that, you append\n",Object(o.b)("inlineCode",{parentName:"p"},"?return_to=https://www.myapp.com/blog/write")," when initializing the Login /\nRegistration /Settings flow."),Object(o.b)("p",null,"Because ORY Kratos prevents Open Redirect Attacks, you need to whitelist the\ndomain in your ORY Kratos config:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml",metastring:'file="path/to/my/kratos.config.yml"',file:'"path/to/my/kratos.config.yml"'}),"urls:\n whitelisted_return_to_urls:\n - https://www.myapp.com/\n")),Object(o.b)("h3",{id:"post-login-redirection"},"Post-Login Redirection"),Object(o.b)("p",null,"Post-login redirection considers the following configuration keys:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml",metastring:'file="path/to/my/kratos.config.yml"',file:'"path/to/my/kratos.config.yml"'}),"urls:\n default_redirect_to: https://end-up-here-per-default/\n\nselfservice:\n login:\n after:\n # overrides url.default_redirect_to\n default_redirect_to: https://this-is-overridden-by-password/\n password:\n # overrides selfservice.login.after.default_redirect_to\n default_redirect_to: https://end-up-here-after-login-with-password/\n")),Object(o.b)("h3",{id:"post-registration-redirection"},"Post-Registration Redirection"),Object(o.b)("p",null,"Post-login redirection considers the following configuration keys:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml",metastring:'file="path/to/my/kratos.config.yml"',file:'"path/to/my/kratos.config.yml"'}),"urls:\n default_redirect_to: https://end-up-here-per-default/\n\nselfservice:\n registration:\n after:\n # overrides url.default_redirect_to\n default_redirect_to: https://this-is-overridden-by-password/\n password:\n # overrides selfservice.registration.after.default_redirect_to\n default_redirect_to: https://end-up-here-after-registration-with-password/\n")),Object(o.b)("h3",{id:"post-settings-redirection"},"Post-Settings Redirection"),Object(o.b)("p",null,"Post-settings redirection ",Object(o.b)("strong",{parentName:"p"},"does not use")," the ",Object(o.b)("inlineCode",{parentName:"p"},"urls.default_redirect_to")," configuration key. Instead\nthe redirect ends at the same Settings UI with the same Settings Request ID and key ",Object(o.b)("inlineCode",{parentName:"p"},"update_successful"),"\nset to ",Object(o.b)("inlineCode",{parentName:"p"},"true"),". If the listed keys are set, the redirection will end up at the specified values:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml",metastring:'file="path/to/my/kratos.config.yml"',file:'"path/to/my/kratos.config.yml"'}),"selfservice:\n settings:\n after:\n # overrides url.default_redirect_to\n default_redirect_to: https://this-is-overridden-by-password/\n password:\n # overrides selfservice.settings.after.default_redirect_to\n default_redirect_to: https://end-up-here-after-settings-with-password/\n")),Object(o.b)("h2",{id:"json"},"JSON"),Object(o.b)("p",null,"This feature is currently in prototype phase and will be documented at a later\nstage."))}p.isMDXComponent=!0},332:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return b}));var n=r(0),i=r.n(n);function
(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var l=i.a.createContext({}),p=function(e){var t=i.a.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},d=function(e){var t=p(e.components);return i.a.createElement(l.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},f=i.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,a=e.parentName,l=c(e,["components","mdxType","originalType","parentName"]),d=p(r),f=n,b=d["".concat(a,".").concat(f)]||d[f]||u[f]||o;return r?i.a.createElement(b,s(s({ref:t},l),{},{components:r})):i.a.createElement(b,s({ref:t},l))}));function b(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,a=new Array(o);a[0]=f;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s.mdxType="string"==typeof e?e:n,a[1]=s;for(var l=2;l<o;l++)a[l]=r[l];return i.a.createElement.apply(null,a)}return i.a.createElement.apply(null,r)}f.displayName="MDXCreateElement"}}]);
o
matrix.py
from typing import Tuple import torch from torch import Tensor def homogeneous(A: Tensor, b: Tensor) -> Tensor:
def heterogeneous(M: Tensor) -> Tuple[Tensor, Tensor]: """ Converts homogeneous matrix into heterogeneous matrix. :param M: Homogeneous matrix of shape [*, N + 1, N + 1]. :return: Heterogeneous matrix and vector of shapes [*, N, N] and [*, N, 1] respectively. """ assert M.shape[-2] == M.shape[-1] n = M.shape[-2] - 1 Ab, cd = M.split([n, 1], dim=-2) A, b = Ab.split([n, 1], dim=-1) c, d = cd.split([n, 1], dim=-1) A, b = A / d, b / d return A, b def affine(x: Tensor, A: Tensor, b: Tensor) -> Tensor: """ Applies an affine transformation to x given A and b. :param x: Vector of shape [*, N, 1]. :param A: Matrix of shape [*, N, N]. :param b: Vector of shape [*, N, 1]. :return: Vector of shape [*, N, 1]. """ assert x.ndim == A.ndim == b.ndim assert x.shape[-2] == A.shape[-2] == A.shape[-1] == b.shape[-2] assert x.shape[-1] == b.shape[-1] == 1 y = A @ x + b return y def eye_like(x: Tensor) -> Tensor: """ Return an identity matrix of the same shape as x. :param x: Matrix of shape [*, M, N]. :return: Identity matrix of shape [*, M, N]. """ m, n = x.shape[-2], x.shape[-1] return torch.eye(m, n, dtype=x.dtype, device=x.device).expand_as(x) def diag(x: Tensor): """ Returns a diagonal matrix given a vector. :param x: Vector of shape [*, M, 1]. :return: Diagonal matrix of shape [*, M, M]. """ assert x.shape[-1] == 1 m = x.shape[-2] return torch.eye(m, dtype=x.dtype, device=x.device) * x
""" Converts heterogeneous matrix into homogeneous matrix. :param A: Heterogeneous matrix of shape [*, N, N]. :param b: Heterogeneous vector of shape [*, N, 1]. :return: Homogeneous matrix of shape [*, N + 1, N + 1]. """ assert A.shape[:-2] == b.shape[:-2] assert A.shape[-2] == A.shape[-1] == b.shape[-2] assert b.shape[-1] == 1 s, n = A.shape[:-2], A.shape[-2] c = torch.zeros(s + (1, n), dtype=A.dtype, device=A.device) d = torch.ones(s + (1, 1), dtype=A.dtype, device=A.device) M = torch.cat( [ torch.cat([A, b], dim=-1), torch.cat([c, d], dim=-1), ], dim=-2, ) return M
integration_test.go
// Copyright 2017 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // See the License for the specific language governing permissions and // limitations under the License. package expression_test import ( "bytes" "context" "fmt" "sort" "strings" "time" . "github.com/pingcap/check" "github.com/pingcap/errors" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/kv" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/store/mockstore" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" "github.com/pingcap/tidb/util/testutil" ) var _ = Suite(&testIntegrationSuite{}) type testIntegrationSuite struct { store kv.Storage dom *domain.Domain ctx sessionctx.Context } func (s *testIntegrationSuite) cleanEnv(c *C) { tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") r := tk.MustQuery("show tables") for _, tb := range r.Rows() { tableName := tb[0] tk.MustExec(fmt.Sprintf("drop table %v", tableName)) } } func (s *testIntegrationSuite) SetUpSuite(c *C) { var err error testleak.BeforeTest() s.store, s.dom, err = newStoreWithBootstrap() c.Assert(err, IsNil) s.ctx = mock.NewContext() } func (s *testIntegrationSuite) TearDownSuite(c *C) { s.dom.Close() s.store.Close() testleak.AfterTest(c)() } func (s *testIntegrationSuite) TestFuncREPEAT(c *C) { tk := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) tk.MustExec("USE test;") tk.MustExec("DROP TABLE IF EXISTS table_string;") tk.MustExec("CREATE TABLE table_string(a CHAR(20), b VARCHAR(20), c TINYTEXT, d TEXT(20), e MEDIUMTEXT, f LONGTEXT, g BIGINT);") tk.MustExec("INSERT INTO table_string (a, b, c, d, e, f, g) VALUES ('a', 'b', 'c', 'd', 'e', 'f', 2);") tk.CheckExecResult(1, 0) r := tk.MustQuery("SELECT REPEAT(a, g), REPEAT(b, g), REPEAT(c, g), REPEAT(d, g), REPEAT(e, g), REPEAT(f, g) FROM table_string;") r.Check(testkit.Rows("aa bb cc dd ee ff")) r = tk.MustQuery("SELECT REPEAT(NULL, g), REPEAT(NULL, g), REPEAT(NULL, g), REPEAT(NULL, g), REPEAT(NULL, g), REPEAT(NULL, g) FROM table_string;") r.Check(testkit.Rows("<nil> <nil> <nil> <nil> <nil> <nil>")) r = tk.MustQuery("SELECT REPEAT(a, NULL), REPEAT(b, NULL), REPEAT(c, NULL), REPEAT(d, NULL), REPEAT(e, NULL), REPEAT(f, NULL) FROM table_string;") r.Check(testkit.Rows("<nil> <nil> <nil> <nil> <nil> <nil>")) r = tk.MustQuery("SELECT REPEAT(a, 2), REPEAT(b, 2), REPEAT(c, 2), REPEAT(d, 2), REPEAT(e, 2), REPEAT(f, 2) FROM table_string;") r.Check(testkit.Rows("aa bb cc dd ee ff")) r = tk.MustQuery("SELECT REPEAT(NULL, 2), REPEAT(NULL, 2), REPEAT(NULL, 2), REPEAT(NULL, 2), REPEAT(NULL, 2), REPEAT(NULL, 2) FROM table_string;") r.Check(testkit.Rows("<nil> <nil> <nil> <nil> <nil> <nil>")) r = tk.MustQuery("SELECT REPEAT(a, -1), REPEAT(b, -2), REPEAT(c, -2), REPEAT(d, -2), REPEAT(e, -2), REPEAT(f, -2) FROM table_string;") r.Check(testkit.Rows(" ")) r = tk.MustQuery("SELECT REPEAT(a, 0), REPEAT(b, 0), REPEAT(c, 0), REPEAT(d, 0), REPEAT(e, 0), REPEAT(f, 0) FROM table_string;") r.Check(testkit.Rows(" ")) r = tk.MustQuery("SELECT REPEAT(a, 16777217), REPEAT(b, 16777217), REPEAT(c, 16777217), REPEAT(d, 16777217), REPEAT(e, 16777217), REPEAT(f, 16777217) FROM table_string;") r.Check(testkit.Rows("<nil> <nil> <nil> <nil> <nil> <nil>")) } func (s *testIntegrationSuite) TestFuncLpadAndRpad(c *C) { tk := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) tk.MustExec(`USE test;`) tk.MustExec(`DROP TABLE IF EXISTS t;`) tk.MustExec(`CREATE TABLE t(a BINARY(10), b CHAR(10));`) tk.MustExec(`INSERT INTO t SELECT "中文", "abc";`) result := tk.MustQuery(`SELECT LPAD(a, 11, "a"), LPAD(b, 2, "xx") FROM t;`) result.Check(testkit.Rows("a中文\x00\x00\x00\x00 ab")) result = tk.MustQuery(`SELECT RPAD(a, 11, "a"), RPAD(b, 2, "xx") FROM t;`) result.Check(testkit.Rows("中文\x00\x00\x00\x00a ab")) result = tk.MustQuery(`SELECT LPAD("中文", 5, "字符"), LPAD("中文", 1, "a");`) result.Check(testkit.Rows("字符字中文 中")) result = tk.MustQuery(`SELECT RPAD("中文", 5, "字符"), RPAD("中文", 1, "a");`) result.Check(testkit.Rows("中文字符字 中")) result = tk.MustQuery(`SELECT RPAD("中文", -5, "字符"), RPAD("中文", 10, "");`) result.Check(testkit.Rows("<nil> <nil>")) result = tk.MustQuery(`SELECT LPAD("中文", -5, "字符"), LPAD("中文", 10, "");`) result.Check(testkit.Rows("<nil> <nil>")) } func (s *testIntegrationSuite) TestMiscellaneousBuiltin(c *C) { ctx := context.Background() defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("set sql_mode='STRICT_TRANS_TABLES'") // disable only full group by // for uuid r := tk.MustQuery("select uuid(), uuid(), uuid(), uuid(), uuid(), uuid();") for _, it := range r.Rows() { for _, item := range it { uuid, ok := item.(string) c.Assert(ok, Equals, true) list := strings.Split(uuid, "-") c.Assert(len(list), Equals, 5) c.Assert(len(list[0]), Equals, 8) c.Assert(len(list[1]), Equals, 4) c.Assert(len(list[2]), Equals, 4) c.Assert(len(list[3]), Equals, 4) c.Assert(len(list[4]), Equals, 12) } } tk.MustQuery("select sleep(1);").Check(testkit.Rows("0")) tk.MustQuery("select sleep(0);").Check(testkit.Rows("0")) tk.MustQuery("select sleep('a');").Check(testkit.Rows("0")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1265 Data Truncated")) rs, err := tk.Exec("select sleep(-1);") c.Assert(err, IsNil) c.Assert(rs, NotNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) c.Assert(rs.Close(), IsNil) tk.MustQuery("SELECT INET_ATON('10.0.5.9');").Check(testkit.Rows("167773449")) tk.MustQuery("SELECT INET_NTOA(167773449);").Check(testkit.Rows("10.0.5.9")) tk.MustQuery("SELECT HEX(INET6_ATON('fdfe::5a55:caff:fefa:9089'));").Check(testkit.Rows("FDFE0000000000005A55CAFFFEFA9089")) tk.MustQuery("SELECT HEX(INET6_ATON('10.0.5.9'));").Check(testkit.Rows("0A000509")) tk.MustQuery("SELECT INET6_NTOA(INET6_ATON('fdfe::5a55:caff:fefa:9089'));").Check(testkit.Rows("fdfe::5a55:caff:fefa:9089")) tk.MustQuery("SELECT INET6_NTOA(INET6_ATON('10.0.5.9'));").Check(testkit.Rows("10.0.5.9")) tk.MustQuery("SELECT INET6_NTOA(UNHEX('FDFE0000000000005A55CAFFFEFA9089'));").Check(testkit.Rows("fdfe::5a55:caff:fefa:9089")) tk.MustQuery("SELECT INET6_NTOA(UNHEX('0A000509'));").Check(testkit.Rows("10.0.5.9")) tk.MustQuery(`SELECT IS_IPV4('10.0.5.9'), IS_IPV4('10.0.5.256');`).Check(testkit.Rows("1 0")) tk.MustQuery(`SELECT IS_IPV4_COMPAT(INET6_ATON('::10.0.5.9'));`).Check(testkit.Rows("1")) tk.MustQuery(`SELECT IS_IPV4_COMPAT(INET6_ATON('::ffff:10.0.5.9'));`).Check(testkit.Rows("0")) tk.MustQuery(`SELECT IS_IPV4_COMPAT(INET6_ATON('::192.168.0.1')), IS_IPV4_COMPAT(INET6_ATON('::c0a8:0001')), IS_IPV4_COMPAT(INET6_ATON('::c0a8:1'));`).Check(testkit.Rows("1 1 1")) tk.MustQuery(`SELECT IS_IPV4_MAPPED(INET6_ATON('::10.0.5.9'));`).Check(testkit.Rows("0")) tk.MustQuery(`SELECT IS_IPV4_MAPPED(INET6_ATON('::ffff:10.0.5.9'));`).Check(testkit.Rows("1")) tk.MustQuery(`SELECT IS_IPV4_MAPPED(INET6_ATON('::ffff:192.168.0.1')), IS_IPV4_MAPPED(INET6_ATON('::ffff:c0a8:0001')), IS_IPV4_MAPPED(INET6_ATON('::ffff:c0a8:1'));`).Check(testkit.Rows("1 1 1")) tk.MustQuery(`SELECT IS_IPV6('10.0.5.9'), IS_IPV6('::1');`).Check(testkit.Rows("0 1")) tk.MustExec("drop table if exists t1;") tk.MustExec(`create table t1( a int, b int not null, c int not null default 0, d int default 0, unique key(b,c), unique key(b,d) );`) tk.MustExec("insert into t1 (a,b) values(1,10),(1,20),(2,30),(2,40);") tk.MustQuery("select any_value(a), sum(b) from t1;").Check(testkit.Rows("1 100")) tk.MustQuery("select a,any_value(b),sum(c) from t1 group by a order by a;").Check(testkit.Rows("1 10 0", "2 30 0")) // for locks result := tk.MustQuery(`SELECT GET_LOCK('test_lock1', 10);`) result.Check(testkit.Rows("1")) result = tk.MustQuery(`SELECT GET_LOCK('test_lock2', 10);`) result.Check(testkit.Rows("1")) result = tk.MustQuery(`SELECT RELEASE_LOCK('test_lock2');`) result.Check(testkit.Rows("1")) result = tk.MustQuery(`SELECT RELEASE_LOCK('test_lock1');`) result.Check(testkit.Rows("1")) } func (s *testIntegrationSuite) TestConvertToBit(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists t, t1") tk.MustExec("create table t (a bit(64))") tk.MustExec("create table t1 (a varchar(2))") tk.MustExec(`insert t1 value ('10')`) tk.MustExec(`insert t select a from t1`) tk.MustQuery("select a+0 from t").Check(testkit.Rows("12592")) tk.MustExec("drop table if exists t, t1") tk.MustExec("create table t (a bit(64))") tk.MustExec("create table t1 (a binary(2))") tk.MustExec(`insert t1 value ('10')`) tk.MustExec(`insert t select a from t1`) tk.MustQuery("select a+0 from t").Check(testkit.Rows("12592")) tk.MustExec("drop table if exists t, t1") tk.MustExec("create table t (a bit(64))") tk.MustExec("create table t1 (a datetime)") tk.MustExec(`insert t1 value ('09-01-01')`) tk.MustExec(`insert t select a from t1`) tk.MustQuery("select a+0 from t").Check(testkit.Rows("20090101000000")) } func (s *testIntegrationSuite) TestMathBuiltin(c *C) { ctx := context.Background() defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") // for degrees result := tk.MustQuery("select degrees(0), degrees(1)") result.Check(testkit.Rows("0 57.29577951308232")) result = tk.MustQuery("select degrees(2), degrees(5)") result.Check(testkit.Rows("114.59155902616465 286.4788975654116")) // for sin result = tk.MustQuery("select sin(0), sin(1.5707963267949)") result.Check(testkit.Rows("0 1")) result = tk.MustQuery("select sin(1), sin(100)") result.Check(testkit.Rows("0.8414709848078965 -0.5063656411097588")) result = tk.MustQuery("select sin('abcd')") result.Check(testkit.Rows("0")) // for cos result = tk.MustQuery("select cos(0), cos(3.1415926535898)") result.Check(testkit.Rows("1 -1")) result = tk.MustQuery("select cos('abcd')") result.Check(testkit.Rows("1")) // for tan result = tk.MustQuery("select tan(0.00), tan(PI()/4)") result.Check(testkit.Rows("0 1")) result = tk.MustQuery("select tan('abcd')") result.Check(testkit.Rows("0")) // for log2 result = tk.MustQuery("select log2(0.0)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select log2(4)") result.Check(testkit.Rows("2")) result = tk.MustQuery("select log2('8.0abcd')") result.Check(testkit.Rows("3")) result = tk.MustQuery("select log2(-1)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select log2(NULL)") result.Check(testkit.Rows("<nil>")) // for log10 result = tk.MustQuery("select log10(0.0)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select log10(100)") result.Check(testkit.Rows("2")) result = tk.MustQuery("select log10('1000.0abcd')") result.Check(testkit.Rows("3")) result = tk.MustQuery("select log10(-1)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select log10(NULL)") result.Check(testkit.Rows("<nil>")) //for log result = tk.MustQuery("select log(0.0)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select log(100)") result.Check(testkit.Rows("4.605170185988092")) result = tk.MustQuery("select log('100.0abcd')") result.Check(testkit.Rows("4.605170185988092")) result = tk.MustQuery("select log(-1)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select log(NULL)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select log(NULL, NULL)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select log(1, 100)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select log(0.5, 0.25)") result.Check(testkit.Rows("2")) result = tk.MustQuery("select log(-1, 0.25)") result.Check(testkit.Rows("<nil>")) // for atan result = tk.MustQuery("select atan(0), atan(-1), atan(1), atan(1,2)") result.Check(testkit.Rows("0 -0.7853981633974483 0.7853981633974483 0.4636476090008061")) result = tk.MustQuery("select atan('tidb')") result.Check(testkit.Rows("0")) // for asin result = tk.MustQuery("select asin(0), asin(-2), asin(2), asin(1)") result.Check(testkit.Rows("0 <nil> <nil> 1.5707963267948966")) result = tk.MustQuery("select asin('tidb')") result.Check(testkit.Rows("0")) // for acos result = tk.MustQuery("select acos(0), acos(-2), acos(2), acos(1)") result.Check(testkit.Rows("1.5707963267948966 <nil> <nil> 0")) result = tk.MustQuery("select acos('tidb')") result.Check(testkit.Rows("1.5707963267948966")) // for pi result = tk.MustQuery("select pi()") result.Check(testkit.Rows("3.141592653589793")) // for floor result = tk.MustQuery("select floor(0), floor(null), floor(1.23), floor(-1.23), floor(1)") result.Check(testkit.Rows("0 <nil> 1 -2 1")) result = tk.MustQuery("select floor('tidb'), floor('1tidb'), floor('tidb1')") result.Check(testkit.Rows("0 1 0")) result = tk.MustQuery("SELECT floor(t.c_datetime) FROM (select CAST('2017-07-19 00:00:00' AS DATETIME) AS c_datetime) AS t") result.Check(testkit.Rows("20170719000000")) result = tk.MustQuery("SELECT floor(t.c_time) FROM (select CAST('12:34:56' AS TIME) AS c_time) AS t") result.Check(testkit.Rows("123456")) result = tk.MustQuery("SELECT floor(t.c_time) FROM (select CAST('00:34:00' AS TIME) AS c_time) AS t") result.Check(testkit.Rows("3400")) result = tk.MustQuery("SELECT floor(t.c_time) FROM (select CAST('00:00:00' AS TIME) AS c_time) AS t") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT floor(t.c_decimal) FROM (SELECT CAST('-10.01' AS DECIMAL(10,2)) AS c_decimal) AS t") result.Check(testkit.Rows("-11")) result = tk.MustQuery("SELECT floor(t.c_decimal) FROM (SELECT CAST('-10.01' AS DECIMAL(10,1)) AS c_decimal) AS t") result.Check(testkit.Rows("-10")) // for ceil/ceiling result = tk.MustQuery("select ceil(0), ceil(null), ceil(1.23), ceil(-1.23), ceil(1)") result.Check(testkit.Rows("0 <nil> 2 -1 1")) result = tk.MustQuery("select ceiling(0), ceiling(null), ceiling(1.23), ceiling(-1.23), ceiling(1)") result.Check(testkit.Rows("0 <nil> 2 -1 1")) result = tk.MustQuery("select ceil('tidb'), ceil('1tidb'), ceil('tidb1'), ceiling('tidb'), ceiling('1tidb'), ceiling('tidb1')") result.Check(testkit.Rows("0 1 0 0 1 0")) result = tk.MustQuery("select ceil(t.c_datetime), ceiling(t.c_datetime) from (select cast('2017-07-20 00:00:00' as datetime) as c_datetime) as t") result.Check(testkit.Rows("20170720000000 20170720000000")) result = tk.MustQuery("select ceil(t.c_time), ceiling(t.c_time) from (select cast('12:34:56' as time) as c_time) as t") result.Check(testkit.Rows("123456 123456")) result = tk.MustQuery("select ceil(t.c_time), ceiling(t.c_time) from (select cast('00:34:00' as time) as c_time) as t") result.Check(testkit.Rows("3400 3400")) result = tk.MustQuery("select ceil(t.c_time), ceiling(t.c_time) from (select cast('00:00:00' as time) as c_time) as t") result.Check(testkit.Rows("0 0")) result = tk.MustQuery("select ceil(t.c_decimal), ceiling(t.c_decimal) from (select cast('-10.01' as decimal(10,2)) as c_decimal) as t") result.Check(testkit.Rows("-10 -10")) result = tk.MustQuery("select ceil(t.c_decimal), ceiling(t.c_decimal) from (select cast('-10.01' as decimal(10,1)) as c_decimal) as t") result.Check(testkit.Rows("-10 -10")) result = tk.MustQuery("select floor(18446744073709551615), ceil(18446744073709551615)") result.Check(testkit.Rows("18446744073709551615 18446744073709551615")) result = tk.MustQuery("select floor(18446744073709551615.1233), ceil(18446744073709551615.1233)") result.Check(testkit.Rows("18446744073709551615 18446744073709551616")) result = tk.MustQuery("select floor(-18446744073709551617), ceil(-18446744073709551617), floor(-18446744073709551617.11), ceil(-18446744073709551617.11)") result.Check(testkit.Rows("-18446744073709551617 -18446744073709551617 -18446744073709551618 -18446744073709551617")) tk.MustExec("drop table if exists t;") tk.MustExec("create table t(a decimal(40,20) UNSIGNED);") tk.MustExec("insert into t values(2.99999999900000000000), (12), (0);") tk.MustQuery("select a, ceil(a) from t where ceil(a) > 1;").Check(testkit.Rows("2.99999999900000000000 3", "12.00000000000000000000 12")) tk.MustQuery("select a, ceil(a) from t;").Check(testkit.Rows("2.99999999900000000000 3", "12.00000000000000000000 12", "0.00000000000000000000 0")) tk.MustQuery("select ceil(-29464);").Check(testkit.Rows("-29464")) tk.MustQuery("select a, floor(a) from t where floor(a) > 1;").Check(testkit.Rows("2.99999999900000000000 2", "12.00000000000000000000 12")) tk.MustQuery("select a, floor(a) from t;").Check(testkit.Rows("2.99999999900000000000 2", "12.00000000000000000000 12", "0.00000000000000000000 0")) tk.MustQuery("select floor(-29464);").Check(testkit.Rows("-29464")) tk.MustExec(`drop table if exists t;`) tk.MustExec(`create table t(a decimal(40,20), b bigint);`) tk.MustExec(`insert into t values(-2.99999990000000000000, -1);`) tk.MustQuery(`select floor(a), floor(a), floor(a) from t;`).Check(testkit.Rows(`-3 -3 -3`)) tk.MustQuery(`select b, floor(b) from t;`).Check(testkit.Rows(`-1 -1`)) // for cot result = tk.MustQuery("select cot(1), cot(-1), cot(NULL)") result.Check(testkit.Rows("0.6420926159343308 -0.6420926159343308 <nil>")) result = tk.MustQuery("select cot('1tidb')") result.Check(testkit.Rows("0.6420926159343308")) rs, err := tk.Exec("select cot(0)") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) terr := errors.Cause(err).(*terror.Error) c.Assert(terr.Code(), Equals, terror.ErrCode(mysql.ErrDataOutOfRange)) c.Assert(rs.Close(), IsNil) //for exp result = tk.MustQuery("select exp(0), exp(1), exp(-1), exp(1.2), exp(NULL)") result.Check(testkit.Rows("1 2.718281828459045 0.36787944117144233 3.3201169227365472 <nil>")) result = tk.MustQuery("select exp('tidb'), exp('1tidb')") result.Check(testkit.Rows("1 2.718281828459045")) rs, err = tk.Exec("select exp(1000000)") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) terr = errors.Cause(err).(*terror.Error) c.Assert(terr.Code(), Equals, terror.ErrCode(mysql.ErrDataOutOfRange)) c.Assert(rs.Close(), IsNil) // for conv result = tk.MustQuery("SELECT CONV('a', 16, 2);") result.Check(testkit.Rows("1010")) result = tk.MustQuery("SELECT CONV('6E', 18, 8);") result.Check(testkit.Rows("172")) result = tk.MustQuery("SELECT CONV(-17, 10, -18);") result.Check(testkit.Rows("-H")) result = tk.MustQuery("SELECT CONV(10+'10'+'10'+X'0a', 10, 10);") result.Check(testkit.Rows("40")) result = tk.MustQuery("SELECT CONV('a', 1, 10);") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("SELECT CONV('a', 37, 10);") result.Check(testkit.Rows("<nil>")) // for abs result = tk.MustQuery("SELECT ABS(-1);") result.Check(testkit.Rows("1")) result = tk.MustQuery("SELECT ABS('abc');") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT ABS(18446744073709551615);") result.Check(testkit.Rows("18446744073709551615")) result = tk.MustQuery("SELECT ABS(123.4);") result.Check(testkit.Rows("123.4")) result = tk.MustQuery("SELECT ABS(-123.4);") result.Check(testkit.Rows("123.4")) result = tk.MustQuery("SELECT ABS(1234E-1);") result.Check(testkit.Rows("123.4")) result = tk.MustQuery("SELECT ABS(-9223372036854775807);") result.Check(testkit.Rows("9223372036854775807")) result = tk.MustQuery("SELECT ABS(NULL);") result.Check(testkit.Rows("<nil>")) rs, err = tk.Exec("SELECT ABS(-9223372036854775808);") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) terr = errors.Cause(err).(*terror.Error) c.Assert(terr.Code(), Equals, terror.ErrCode(mysql.ErrDataOutOfRange)) c.Assert(rs.Close(), IsNil) // for round result = tk.MustQuery("SELECT ROUND(2.5), ROUND(-2.5), ROUND(25E-1);") result.Check(testkit.Rows("3 -3 3")) // TODO: Should be 3 -3 2 result = tk.MustQuery("SELECT ROUND(2.5, NULL), ROUND(NULL, 4), ROUND(NULL, NULL), ROUND(NULL);") result.Check(testkit.Rows("<nil> <nil> <nil> <nil>")) result = tk.MustQuery("SELECT ROUND('123.4'), ROUND('123e-2');") result.Check(testkit.Rows("123 1")) result = tk.MustQuery("SELECT ROUND(-9223372036854775808);") result.Check(testkit.Rows("-9223372036854775808")) result = tk.MustQuery("SELECT ROUND(123.456, 0), ROUND(123.456, 1), ROUND(123.456, 2), ROUND(123.456, 3), ROUND(123.456, 4), ROUND(123.456, -1), ROUND(123.456, -2), ROUND(123.456, -3), ROUND(123.456, -4);") result.Check(testkit.Rows("123 123.5 123.46 123.456 123.4560 120 100 0 0")) result = tk.MustQuery("SELECT ROUND(123456E-3, 0), ROUND(123456E-3, 1), ROUND(123456E-3, 2), ROUND(123456E-3, 3), ROUND(123456E-3, 4), ROUND(123456E-3, -1), ROUND(123456E-3, -2), ROUND(123456E-3, -3), ROUND(123456E-3, -4);") result.Check(testkit.Rows("123 123.5 123.46 123.456 123.456 120 100 0 0")) // TODO: Column 5 should be 123.4560 // for truncate result = tk.MustQuery("SELECT truncate(123, -2), truncate(123, 2), truncate(123, 1), truncate(123, -1);") result.Check(testkit.Rows("100 123 123 120")) result = tk.MustQuery("SELECT truncate(123.456, -2), truncate(123.456, 2), truncate(123.456, 1), truncate(123.456, 3), truncate(1.23, 100), truncate(123456E-3, 2);") result.Check(testkit.Rows("100 123.45 123.4 123.456 1.230000000000000000000000000000 123.45")) result = tk.MustQuery("SELECT truncate(9223372036854775807, -7), truncate(9223372036854775808, -10), truncate(cast(-1 as unsigned), -10);") result.Check(testkit.Rows("9223372036850000000 9223372030000000000 18446744070000000000")) tk.MustExec(`drop table if exists t;`) tk.MustExec(`create table t(a date, b datetime, c timestamp, d varchar(20));`) tk.MustExec(`insert into t select "1234-12-29", "1234-12-29 16:24:13.9912", "2014-12-29 16:19:28", "12.34567";`) // NOTE: the actually result is: 12341220 12341229.0 12341200 12341229.00, // but Datum.ToString() don't format decimal length for float numbers. result = tk.MustQuery(`select truncate(a, -1), truncate(a, 1), truncate(a, -2), truncate(a, 2) from t;`) result.Check(testkit.Rows("12341220 12341229 12341200 12341229")) // NOTE: the actually result is: 12341229162410 12341229162414.0 12341229162400 12341229162414.00, // but Datum.ToString() don't format decimal length for float numbers. result = tk.MustQuery(`select truncate(b, -1), truncate(b, 1), truncate(b, -2), truncate(b, 2) from t;`) result.Check(testkit.Rows("12341229162410 12341229162414 12341229162400 12341229162414")) // NOTE: the actually result is: 20141229161920 20141229161928.0 20141229161900 20141229161928.00, // but Datum.ToString() don't format decimal length for float numbers. result = tk.MustQuery(`select truncate(c, -1), truncate(c, 1), truncate(c, -2), truncate(c, 2) from t;`) result.Check(testkit.Rows("20141229161920 20141229161928 20141229161900 20141229161928")) result = tk.MustQuery(`select truncate(d, -1), truncate(d, 1), truncate(d, -2), truncate(d, 2) from t;`) result.Check(testkit.Rows("10 12.3 0 12.34")) // for pow result = tk.MustQuery("SELECT POW('12', 2), POW(1.2e1, '2.0'), POW(12, 2.0);") result.Check(testkit.Rows("144 144 144")) result = tk.MustQuery("SELECT POW(null, 2), POW(2, null), POW(null, null);") result.Check(testkit.Rows("<nil> <nil> <nil>")) result = tk.MustQuery("SELECT POW(0, 0);") result.Check(testkit.Rows("1")) result = tk.MustQuery("SELECT POW(0, 0.1), POW(0, 0.5), POW(0, 1);") result.Check(testkit.Rows("0 0 0")) rs, err = tk.Exec("SELECT POW(0, -1);") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) terr = errors.Cause(err).(*terror.Error) c.Assert(terr.Code(), Equals, terror.ErrCode(mysql.ErrDataOutOfRange)) c.Assert(rs.Close(), IsNil) // for sign result = tk.MustQuery("SELECT SIGN('12'), SIGN(1.2e1), SIGN(12), SIGN(0.0000012);") result.Check(testkit.Rows("1 1 1 1")) result = tk.MustQuery("SELECT SIGN('-12'), SIGN(-1.2e1), SIGN(-12), SIGN(-0.0000012);") result.Check(testkit.Rows("-1 -1 -1 -1")) result = tk.MustQuery("SELECT SIGN('0'), SIGN('-0'), SIGN(0);") result.Check(testkit.Rows("0 0 0")) result = tk.MustQuery("SELECT SIGN(NULL);") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("SELECT SIGN(-9223372036854775808), SIGN(9223372036854775808);") result.Check(testkit.Rows("-1 1")) // for sqrt result = tk.MustQuery("SELECT SQRT(-10), SQRT(144), SQRT(4.84), SQRT(0.04), SQRT(0);") result.Check(testkit.Rows("<nil> 12 2.2 0.2 0")) // for crc32 result = tk.MustQuery("SELECT crc32(0), crc32(-0), crc32('0'), crc32('abc'), crc32('ABC'), crc32(NULL), crc32(''), crc32('hello world!')") result.Check(testkit.Rows("4108050209 4108050209 4108050209 891568578 2743272264 <nil> 0 62177901")) // for radians result = tk.MustQuery("SELECT radians(1.0), radians(pi()), radians(pi()/2), radians(180), radians(1.009);") result.Check(testkit.Rows("0.017453292519943295 0.05483113556160754 0.02741556778080377 3.141592653589793 0.01761037215262278")) } func (s *testIntegrationSuite) TestStringBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") ctx := context.Background() // for length tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int, b double, c datetime, d time, e char(20), f bit(10))") tk.MustExec(`insert into t values(1, 1.1, "2017-01-01 12:01:01", "12:01:01", "abcdef", 0b10101)`) result := tk.MustQuery("select length(a), length(b), length(c), length(d), length(e), length(f), length(null) from t") result.Check(testkit.Rows("1 3 19 8 6 2 <nil>")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(20))") tk.MustExec(`insert into t values("tidb "), (concat("a ", "b "))`) result = tk.MustQuery("select a, length(a) from t") result.Check(testkit.Rows("tidb 4", "a b 4")) // for concat tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int, b double, c datetime, d time, e char(20))") tk.MustExec(`insert into t values(1, 1.1, "2017-01-01 12:01:01", "12:01:01", "abcdef")`) result = tk.MustQuery("select concat(a, b, c, d, e) from t") result.Check(testkit.Rows("11.12017-01-01 12:01:0112:01:01abcdef")) result = tk.MustQuery("select concat(null)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select concat(null, a, b) from t") result.Check(testkit.Rows("<nil>")) // for concat_ws tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int, b double, c datetime, d time, e char(20))") tk.MustExec(`insert into t values(1, 1.1, "2017-01-01 12:01:01", "12:01:01", "abcdef")`) result = tk.MustQuery("select concat_ws('|', a, b, c, d, e) from t") result.Check(testkit.Rows("1|1.1|2017-01-01 12:01:01|12:01:01|abcdef")) result = tk.MustQuery("select concat_ws(null, null)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select concat_ws(null, a, b) from t") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select concat_ws(',', 'a', 'b')") result.Check(testkit.Rows("a,b")) result = tk.MustQuery("select concat_ws(',','First name',NULL,'Last Name')") result.Check(testkit.Rows("First name,Last Name")) tk.MustExec(`drop table if exists t;`) tk.MustExec(`create table t(a tinyint(2), b varchar(10));`) tk.MustExec(`insert into t values (1, 'a'), (12, 'a'), (126, 'a'), (127, 'a')`) tk.MustQuery(`select concat_ws('#', a, b) from t;`).Check(testkit.Rows( `1#a`, `12#a`, `126#a`, `127#a`, )) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a binary(3))") tk.MustExec("insert into t values('a')") result = tk.MustQuery(`select concat_ws(',', a, 'test') = 'a\0\0,test' from t`) result.Check(testkit.Rows("1")) // for ascii tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time, f bit(4))") tk.MustExec(`insert into t values('2', 2, 2.3, "2017-01-01 12:01:01", "12:01:01", 0b1010)`) result = tk.MustQuery("select ascii(a), ascii(b), ascii(c), ascii(d), ascii(e), ascii(f) from t") result.Check(testkit.Rows("50 50 50 50 49 10")) result = tk.MustQuery("select ascii('123'), ascii(123), ascii(''), ascii('你好'), ascii(NULL)") result.Check(testkit.Rows("49 49 0 228 <nil>")) // for lower tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int, b double, c datetime, d time, e char(20), f binary(3), g binary(3))") tk.MustExec(`insert into t values(1, 1.1, "2017-01-01 12:01:01", "12:01:01", "abcdef", 'aa', 'BB')`) result = tk.MustQuery("select lower(a), lower(b), lower(c), lower(d), lower(e), lower(f), lower(g), lower(null) from t") result.Check(testkit.Rows("1 1.1 2017-01-01 12:01:01 12:01:01 abcdef aa\x00 BB\x00 <nil>")) // for upper result = tk.MustQuery("select upper(a), upper(b), upper(c), upper(d), upper(e), upper(f), upper(g), upper(null) from t") result.Check(testkit.Rows("1 1.1 2017-01-01 12:01:01 12:01:01 ABCDEF aa\x00 BB\x00 <nil>")) // for strcmp tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time)") tk.MustExec(`insert into t values("123", 123, 12.34, "2017-01-01 12:01:01", "12:01:01")`) result = tk.MustQuery(`select strcmp(a, "123"), strcmp(b, "123"), strcmp(c, "12.34"), strcmp(d, "2017-01-01 12:01:01"), strcmp(e, "12:01:01") from t`) result.Check(testkit.Rows("0 0 0 0 0")) result = tk.MustQuery(`select strcmp("1", "123"), strcmp("123", "1"), strcmp("123", "45"), strcmp("123", null), strcmp(null, "123")`) result.Check(testkit.Rows("-1 1 -1 <nil> <nil>")) result = tk.MustQuery(`select strcmp("", "123"), strcmp("123", ""), strcmp("", ""), strcmp("", null), strcmp(null, "")`) result.Check(testkit.Rows("-1 1 0 <nil> <nil>")) // for left tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time)") tk.MustExec(`insert into t values('abcde', 1234, 12.34, "2017-01-01 12:01:01", "12:01:01")`) result = tk.MustQuery("select left(a, 2), left(b, 2), left(c, 2), left(d, 2), left(e, 2) from t") result.Check(testkit.Rows("ab 12 12 20 12")) result = tk.MustQuery(`select left("abc", 0), left("abc", -1), left(NULL, 1), left("abc", NULL)`) result.Check(testkit.Rows(" <nil> <nil>")) result = tk.MustQuery(`select left("abc", "a"), left("abc", 1.9), left("abc", 1.2)`) result.Check(testkit.Rows(" ab a")) result = tk.MustQuery(`select left("中文abc", 2), left("中文abc", 3), left("中文abc", 4)`) result.Check(testkit.Rows("中文 中文a 中文ab")) // for right, reuse the table created for left result = tk.MustQuery("select right(a, 3), right(b, 3), right(c, 3), right(d, 3), right(e, 3) from t") result.Check(testkit.Rows("cde 234 .34 :01 :01")) result = tk.MustQuery(`select right("abcde", 0), right("abcde", -1), right("abcde", 100), right(NULL, 1), right("abcde", NULL)`) result.Check(testkit.Rows(" abcde <nil> <nil>")) result = tk.MustQuery(`select right("abcde", "a"), right("abcde", 1.9), right("abcde", 1.2)`) result.Check(testkit.Rows(" de e")) result = tk.MustQuery(`select right("中文abc", 2), right("中文abc", 4), right("中文abc", 5)`) result.Check(testkit.Rows("bc 文abc 中文abc")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a binary(10))") tk.MustExec(`insert into t select "中文abc"`) result = tk.MustQuery(`select left(a, 3), left(a, 6), left(a, 7) from t`) result.Check(testkit.Rows("中 中文 中文a")) result = tk.MustQuery(`select right(a, 2), right(a, 7) from t`) result.Check(testkit.Rows("c\x00 文abc\x00")) // for ord tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time, f bit(4), g binary(20), h blob(10), i text(30))") tk.MustExec(`insert into t values('2', 2, 2.3, "2017-01-01 12:01:01", "12:01:01", 0b1010, "512", "48", "tidb")`) result = tk.MustQuery("select ord(a), ord(b), ord(c), ord(d), ord(e), ord(f), ord(g), ord(h), ord(i) from t") result.Check(testkit.Rows("50 50 50 50 49 10 53 52 116")) result = tk.MustQuery("select ord('123'), ord(123), ord(''), ord('你好'), ord(NULL), ord('👍')") result.Check(testkit.Rows("49 49 0 14990752 <nil> 4036989325")) // for space result = tk.MustQuery(`select space(0), space(2), space(-1), space(1.1), space(1.9)`) result.Check(testutil.RowsWithSep(",", ", ,, , ")) result = tk.MustQuery(`select space("abc"), space("2"), space("1.1"), space(''), space(null)`) result.Check(testutil.RowsWithSep(",", ", , ,,<nil>")) // for replace tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(20), b int, c double, d datetime, e time)") tk.MustExec(`insert into t values('www.mysql.com', 1234, 12.34, "2017-01-01 12:01:01", "12:01:01")`) result = tk.MustQuery(`select replace(a, 'mysql', 'pingcap'), replace(b, 2, 55), replace(c, 34, 0), replace(d, '-', '/'), replace(e, '01', '22') from t`) result.Check(testutil.RowsWithSep(",", "www.pingcap.com,15534,12.0,2017/01/01 12:01:01,12:22:22")) result = tk.MustQuery(`select replace('aaa', 'a', ''), replace(null, 'a', 'b'), replace('a', null, 'b'), replace('a', 'b', null)`) result.Check(testkit.Rows(" <nil> <nil> <nil>")) // for tobase64 tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int, b double, c datetime, d time, e char(20), f bit(10), g binary(20), h blob(10))") tk.MustExec(`insert into t values(1, 1.1, "2017-01-01 12:01:01", "12:01:01", "abcdef", 0b10101, "512", "abc")`) result = tk.MustQuery("select to_base64(a), to_base64(b), to_base64(c), to_base64(d), to_base64(e), to_base64(f), to_base64(g), to_base64(h), to_base64(null) from t") result.Check(testkit.Rows("MQ== MS4x MjAxNy0wMS0wMSAxMjowMTowMQ== MTI6MDE6MDE= YWJjZGVm ABU= NTEyAAAAAAAAAAAAAAAAAAAAAAA= YWJj <nil>")) // for from_base64 result = tk.MustQuery(`select from_base64("abcd"), from_base64("asc")`) result.Check(testkit.Rows("i\xb7\x1d <nil>")) result = tk.MustQuery(`select from_base64("MQ=="), from_base64(1234)`) result.Check(testkit.Rows("1 \xd7m\xf8")) // for substr tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time)") tk.MustExec(`insert into t values('Sakila', 12345, 123.45, "2017-01-01 12:01:01", "12:01:01")`) result = tk.MustQuery(`select substr(a, 3), substr(b, 2, 3), substr(c, -3), substr(d, -8), substr(e, -3, 100) from t`) result.Check(testkit.Rows("kila 234 .45 12:01:01 :01")) result = tk.MustQuery(`select substr('Sakila', 100), substr('Sakila', -100), substr('Sakila', -5, 3), substr('Sakila', 2, -1)`) result.Check(testutil.RowsWithSep(",", ",,aki,")) result = tk.MustQuery(`select substr('foobarbar' from 4), substr('Sakila' from -4 for 2)`) result.Check(testkit.Rows("barbar ki")) result = tk.MustQuery(`select substr(null, 2, 3), substr('foo', null, 3), substr('foo', 2, null)`) result.Check(testkit.Rows("<nil> <nil> <nil>")) result = tk.MustQuery(`select substr('中文abc', 2), substr('中文abc', 3), substr("中文abc", 1, 2)`) result.Check(testkit.Rows("文abc abc 中文")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a binary(10))") tk.MustExec(`insert into t select "中文abc"`) result = tk.MustQuery(`select substr(a, 4), substr(a, 1, 3), substr(a, 1, 6) from t`) result.Check(testkit.Rows("文abc\x00 中 中文")) result = tk.MustQuery(`select substr("string", -1), substr("string", -2), substr("中文", -1), substr("中文", -2) from t`) result.Check(testkit.Rows("g ng 文 中文")) // for bit_length tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int, b double, c datetime, d time, e char(20), f bit(10), g binary(20), h varbinary(20))") tk.MustExec(`insert into t values(1, 1.1, "2017-01-01 12:01:01", "12:01:01", "abcdef", 0b10101, "g", "h")`) result = tk.MustQuery("select bit_length(a), bit_length(b), bit_length(c), bit_length(d), bit_length(e), bit_length(f), bit_length(g), bit_length(h), bit_length(null) from t") result.Check(testkit.Rows("8 24 152 64 48 16 160 8 <nil>")) // for substring_index tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(20), b int, c double, d datetime, e time)") tk.MustExec(`insert into t values('www.pingcap.com', 12345, 123.45, "2017-01-01 12:01:01", "12:01:01")`) result = tk.MustQuery(`select substring_index(a, '.', 2), substring_index(b, '.', 2), substring_index(c, '.', -1), substring_index(d, '-', 1), substring_index(e, ':', -2) from t`) result.Check(testkit.Rows("www.pingcap 12345 45 2017 01:01")) result = tk.MustQuery(`select substring_index('www.pingcap.com', '.', 0), substring_index('www.pingcap.com', '.', 100), substring_index('www.pingcap.com', '.', -100)`) result.Check(testkit.Rows(" www.pingcap.com www.pingcap.com")) tk.MustQuery(`select substring_index('xyz', 'abc', 9223372036854775808)`).Check(testkit.Rows(``)) result = tk.MustQuery(`select substring_index('www.pingcap.com', 'd', 1), substring_index('www.pingcap.com', '', 1), substring_index('', '.', 1)`) result.Check(testutil.RowsWithSep(",", "www.pingcap.com,,")) result = tk.MustQuery(`select substring_index(null, '.', 1), substring_index('www.pingcap.com', null, 1), substring_index('www.pingcap.com', '.', null)`) result.Check(testkit.Rows("<nil> <nil> <nil>")) // for hex tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(20), b int, c double, d datetime, e time, f decimal(5, 2), g bit(4))") tk.MustExec(`insert into t values('www.pingcap.com', 12345, 123.45, "2017-01-01 12:01:01", "12:01:01", 123.45, 0b1100)`) result = tk.MustQuery(`select hex(a), hex(b), hex(c), hex(d), hex(e), hex(f), hex(g) from t`) result.Check(testkit.Rows("7777772E70696E676361702E636F6D 3039 7B 323031372D30312D30312031323A30313A3031 31323A30313A3031 7B C")) result = tk.MustQuery(`select hex('abc'), hex('你好'), hex(12), hex(12.3), hex(12.8)`) result.Check(testkit.Rows("616263 E4BDA0E5A5BD C C D")) result = tk.MustQuery(`select hex(-1), hex(-12.3), hex(-12.8), hex(0x12), hex(null)`) result.Check(testkit.Rows("FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFF4 FFFFFFFFFFFFFFF3 12 <nil>")) // for unhex result = tk.MustQuery(`select unhex('4D7953514C'), unhex('313233'), unhex(313233), unhex('')`) result.Check(testkit.Rows("MySQL 123 123 ")) result = tk.MustQuery(`select unhex('string'), unhex('你好'), unhex(123.4), unhex(null)`) result.Check(testkit.Rows("<nil> <nil> <nil> <nil>")) // for ltrim and rtrim result = tk.MustQuery(`select ltrim(' bar '), ltrim('bar'), ltrim(''), ltrim(null)`) result.Check(testutil.RowsWithSep(",", "bar ,bar,,<nil>")) result = tk.MustQuery(`select rtrim(' bar '), rtrim('bar'), rtrim(''), rtrim(null)`) result.Check(testutil.RowsWithSep(",", " bar,bar,,<nil>")) result = tk.MustQuery(`select ltrim("\t bar "), ltrim(" \tbar"), ltrim("\n bar"), ltrim("\r bar")`) result.Check(testutil.RowsWithSep(",", "\t bar ,\tbar,\n bar,\r bar")) result = tk.MustQuery(`select rtrim(" bar \t"), rtrim("bar\t "), rtrim("bar \n"), rtrim("bar \r")`) result.Check(testutil.RowsWithSep(",", " bar \t,bar\t,bar \n,bar \r")) // for reverse tk.MustExec(`DROP TABLE IF EXISTS t;`) tk.MustExec(`CREATE TABLE t(a BINARY(6));`) tk.MustExec(`INSERT INTO t VALUES("中文");`) result = tk.MustQuery(`SELECT a, REVERSE(a), REVERSE("中文"), REVERSE("123 ") FROM t;`) result.Check(testkit.Rows("中文 \x87\x96歸\xe4 文中 321")) result = tk.MustQuery(`SELECT REVERSE(123), REVERSE(12.09) FROM t;`) result.Check(testkit.Rows("321 90.21")) // for trim result = tk.MustQuery(`select trim(' bar '), trim(leading 'x' from 'xxxbarxxx'), trim(trailing 'xyz' from 'barxxyz'), trim(both 'x' from 'xxxbarxxx')`) result.Check(testkit.Rows("bar barxxx barx bar")) result = tk.MustQuery(`select trim('\t bar\n '), trim(' \rbar \t')`) result.Check(testutil.RowsWithSep(",", "\t bar\n,\rbar \t")) result = tk.MustQuery(`select trim(leading from ' bar'), trim('x' from 'xxxbarxxx'), trim('x' from 'bar'), trim('' from ' bar ')`) result.Check(testutil.RowsWithSep(",", "bar,bar,bar, bar ")) result = tk.MustQuery(`select trim(''), trim('x' from '')`) result.Check(testutil.RowsWithSep(",", ",")) result = tk.MustQuery(`select trim(null from 'bar'), trim('x' from null), trim(null), trim(leading null from 'bar')`) // FIXME: the result for trim(leading null from 'bar') should be <nil>, current is 'bar' result.Check(testkit.Rows("<nil> <nil> <nil> bar")) // for locate tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(20), b int, c double, d datetime, e time, f binary(5))") tk.MustExec(`insert into t values('www.pingcap.com', 12345, 123.45, "2017-01-01 12:01:01", "12:01:01", "HelLo")`) result = tk.MustQuery(`select locate(".ping", a), locate(".ping", a, 5) from t`) result.Check(testkit.Rows("4 0")) result = tk.MustQuery(`select locate("234", b), locate("235", b, 10) from t`) result.Check(testkit.Rows("2 0")) result = tk.MustQuery(`select locate(".45", c), locate(".35", b) from t`) result.Check(testkit.Rows("4 0")) result = tk.MustQuery(`select locate("El", f), locate("ll", f), locate("lL", f), locate("Lo", f), locate("lo", f) from t`) result.Check(testkit.Rows("0 0 3 4 0")) result = tk.MustQuery(`select locate("01 12", d) from t`) result.Check(testkit.Rows("9")) result = tk.MustQuery(`select locate("文", "中文字符串", 2)`) result.Check(testkit.Rows("2")) result = tk.MustQuery(`select locate("文", "中文字符串", 3)`) result.Check(testkit.Rows("0")) result = tk.MustQuery(`select locate("文", "中文字符串")`) result.Check(testkit.Rows("2")) // for bin result = tk.MustQuery(`select bin(-1);`) result.Check(testkit.Rows("1111111111111111111111111111111111111111111111111111111111111111")) result = tk.MustQuery(`select bin(5);`) result.Check(testkit.Rows("101")) result = tk.MustQuery(`select bin("中文");`) result.Check(testkit.Rows("0")) // for character_length result = tk.MustQuery(`select character_length(null), character_length("Hello"), character_length("a中b文c"), character_length(123), character_length(12.3456);`) result.Check(testkit.Rows("<nil> 5 5 3 7")) // for char_length result = tk.MustQuery(`select char_length(null), char_length("Hello"), char_length("a中b文c"), char_length(123),char_length(12.3456);`) result.Check(testkit.Rows("<nil> 5 5 3 7")) result = tk.MustQuery(`select char_length(null), char_length("Hello"), char_length("a 中 b 文 c"), char_length("НОЧЬ НА ОКРАИНЕ МОСКВЫ");`) result.Check(testkit.Rows("<nil> 5 9 22")) // for char_length, binary string type result = tk.MustQuery(`select char_length(null), char_length(binary("Hello")), char_length(binary("a 中 b 文 c")), char_length(binary("НОЧЬ НА ОКРАИНЕ МОСКВЫ"));`) result.Check(testkit.Rows("<nil> 5 13 41")) // for elt result = tk.MustQuery(`select elt(0, "abc", "def"), elt(2, "hello", "中文", "tidb"), elt(4, "hello", "中文", "tidb");`) result.Check(testkit.Rows("<nil> 中文 <nil>")) // for instr result = tk.MustQuery(`select instr("中国", "国"), instr("中国", ""), instr("abc", ""), instr("", ""), instr("", "abc");`) result.Check(testkit.Rows("2 1 1 1 0")) result = tk.MustQuery(`select instr("中国", null), instr(null, ""), instr(null, null);`) result.Check(testkit.Rows("<nil> <nil> <nil>")) tk.MustExec(`drop table if exists t;`) tk.MustExec(`create table t(a binary(20), b char(20));`) tk.MustExec(`insert into t values("中国", cast("国" as binary)), ("中国", ""), ("abc", ""), ("", ""), ("", "abc");`) result = tk.MustQuery(`select instr(a, b) from t;`) result.Check(testkit.Rows("4", "1", "1", "1", "0")) // for oct result = tk.MustQuery(`select oct("aaaa"), oct("-1.9"), oct("-9999999999999999999999999"), oct("9999999999999999999999999");`) result.Check(testkit.Rows("0 1777777777777777777777 1777777777777777777777 1777777777777777777777")) result = tk.MustQuery(`select oct(-1.9), oct(1.9), oct(-1), oct(1), oct(-9999999999999999999999999), oct(9999999999999999999999999);`) result.Check(testkit.Rows("1777777777777777777777 1 1777777777777777777777 1 1777777777777777777777 1777777777777777777777")) // #issue 4356 tk.MustExec("drop table if exists t") tk.MustExec("CREATE TABLE t (b BIT(8));") tk.MustExec(`INSERT INTO t SET b = b'11111111';`) tk.MustExec(`INSERT INTO t SET b = b'1010';`) tk.MustExec(`INSERT INTO t SET b = b'0101';`) result = tk.MustQuery(`SELECT b+0, BIN(b), OCT(b), HEX(b) FROM t;`) result.Check(testkit.Rows("255 11111111 377 FF", "10 1010 12 A", "5 101 5 5")) // for find_in_set result = tk.MustQuery(`select find_in_set("", ""), find_in_set("", ","), find_in_set("中文", "字符串,中文"), find_in_set("b,", "a,b,c,d");`) result.Check(testkit.Rows("0 1 2 0")) result = tk.MustQuery(`select find_in_set(NULL, ""), find_in_set("", NULL), find_in_set(1, "2,3,1");`) result.Check(testkit.Rows("<nil> <nil> 3")) // for make_set result = tk.MustQuery(`select make_set(0, "12"), make_set(3, "aa", "11"), make_set(3, NULL, "中文"), make_set(NULL, "aa");`) result.Check(testkit.Rows(" aa,11 中文 <nil>")) // for quote result = tk.MustQuery(`select quote("aaaa"), quote(""), quote("\"\""), quote("\n\n");`) result.Check(testkit.Rows("'aaaa' '' '\"\"' '\n\n'")) result = tk.MustQuery(`select quote(0121), quote(0000), quote("中文"), quote(NULL);`) result.Check(testkit.Rows("'121' '0' '中文' <nil>")) // for convert result = tk.MustQuery(`select convert("123" using "866"), convert("123" using "binary"), convert("中文" using "binary"), convert("中文" using "utf8"), convert("中文" using "utf8mb4"), convert(cast("中文" as binary) using "utf8");`) result.Check(testkit.Rows("123 123 中文 中文 中文 中文")) // for insert result = tk.MustQuery(`select insert("中文", 1, 1, cast("aaa" as binary)), insert("ba", -1, 1, "aaa"), insert("ba", 1, 100, "aaa"), insert("ba", 100, 1, "aaa");`) result.Check(testkit.Rows("aaa文 ba aaa ba")) result = tk.MustQuery(`select insert("bb", NULL, 1, "aa"), insert("bb", 1, NULL, "aa"), insert(NULL, 1, 1, "aaa"), insert("bb", 1, 1, NULL);`) result.Check(testkit.Rows("<nil> <nil> <nil> <nil>")) // for export_set result = tk.MustQuery(`select export_set(7, "1", "0", ",", 65);`) result.Check(testkit.Rows("1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0")) result = tk.MustQuery(`select export_set(7, "1", "0", ",", -1);`) result.Check(testkit.Rows("1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0")) result = tk.MustQuery(`select export_set(7, "1", "0", ",");`) result.Check(testkit.Rows("1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0")) result = tk.MustQuery(`select export_set(7, "1", "0");`) result.Check(testkit.Rows("1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0")) result = tk.MustQuery(`select export_set(NULL, "1", "0", ",", 65);`) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery(`select export_set(7, "1", "0", ",", 1);`) result.Check(testkit.Rows("1")) // for format result = tk.MustQuery(`select format(12332.1, 4), format(12332.2, 0), format(12332.2, 2,'en_US');`) result.Check(testkit.Rows("12,332.1000 12,332 12,332.20")) result = tk.MustQuery(`select format(NULL, 4), format(12332.2, NULL);`) result.Check(testkit.Rows("<nil> <nil>")) rs, err := tk.Exec(`select format(12332.2, 2,'es_EC');`) c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) c.Assert(err.Error(), Matches, "not support for the specific locale") c.Assert(rs.Close(), IsNil) // for field result = tk.MustQuery(`select field(1, 2, 1), field(1, 0, NULL), field(1, NULL, 2, 1), field(NULL, 1, 2, NULL);`) result.Check(testkit.Rows("2 0 3 0")) result = tk.MustQuery(`select field("1", 2, 1), field(1, "0", NULL), field("1", NULL, 2, 1), field(NULL, 1, "2", NULL);`) result.Check(testkit.Rows("2 0 3 0")) result = tk.MustQuery(`select field("1", 2, 1), field(1, "abc", NULL), field("1", NULL, 2, 1), field(NULL, 1, "2", NULL);`) result.Check(testkit.Rows("2 0 3 0")) result = tk.MustQuery(`select field("abc", "a", 1), field(1.3, "1.3", 1.5);`) result.Check(testkit.Rows("1 1")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a decimal(11, 8), b decimal(11,8))") tk.MustExec("insert into t values('114.57011441','38.04620115'), ('-38.04620119', '38.04620115');") result = tk.MustQuery("select a,b,concat_ws(',',a,b) from t") result.Check(testkit.Rows("114.57011441 38.04620115 114.57011441,38.04620115", "-38.04620119 38.04620115 -38.04620119,38.04620115")) } func (s *testIntegrationSuite) TestEncryptionBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") ctx := context.Background() // for password tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(41), b char(41), c char(41))") tk.MustExec(`insert into t values(NULL, '', 'abc')`) result := tk.MustQuery("select password(a) from t") result.Check(testkit.Rows("")) result = tk.MustQuery("select password(b) from t") result.Check(testkit.Rows("")) result = tk.MustQuery("select password(c) from t") result.Check(testkit.Rows("*0D3CED9BEC10A777AEC23CCC353A8C08A633045E")) // for md5 tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time, f bit(4), g binary(20), h blob(10), i text(30))") tk.MustExec(`insert into t values('2', 2, 2.3, "2017-01-01 12:01:01", "12:01:01", 0b1010, "512", "48", "tidb")`) result = tk.MustQuery("select md5(a), md5(b), md5(c), md5(d), md5(e), md5(f), md5(g), md5(h), md5(i) from t") result.Check(testkit.Rows("c81e728d9d4c2f636f067f89cc14862c c81e728d9d4c2f636f067f89cc14862c 1a18da63cbbfb49cb9616e6bfd35f662 bad2fa88e1f35919ec7584cc2623a310 991f84d41d7acff6471e536caa8d97db 68b329da9893e34099c7d8ad5cb9c940 5c9f0e9b3b36276731bfba852a73ccc6 642e92efb79421734881b53e1e1b18b6 c337e11bfca9f12ae9b1342901e04379")) result = tk.MustQuery("select md5('123'), md5(123), md5(''), md5('你好'), md5(NULL), md5('👍')") result.Check(testkit.Rows(`202cb962ac59075b964b07152d234b70 202cb962ac59075b964b07152d234b70 d41d8cd98f00b204e9800998ecf8427e 7eca689f0d3389d9dea66ae112e5cfd7 <nil> 0215ac4dab1ecaf71d83f98af5726984`)) // for sha/sha1 tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time, f bit(4), g binary(20), h blob(10), i text(30))") tk.MustExec(`insert into t values('2', 2, 2.3, "2017-01-01 12:01:01", "12:01:01", 0b1010, "512", "48", "tidb")`) result = tk.MustQuery("select sha1(a), sha1(b), sha1(c), sha1(d), sha1(e), sha1(f), sha1(g), sha1(h), sha1(i) from t") result.Check(testkit.Rows("da4b9237bacccdf19c0760cab7aec4a8359010b0 da4b9237bacccdf19c0760cab7aec4a8359010b0 ce0d88c5002b6cf7664052f1fc7d652cbdadccec 6c6956de323692298e4e5ad3028ff491f7ad363c 1906f8aeb5a717ca0f84154724045839330b0ea9 adc83b19e793491b1c6ea0fd8b46cd9f32e592fc 9aadd14ceb737b28697b8026f205f4b3e31de147 64e095fe763fc62418378753f9402623bea9e227 4df56fc09a3e66b48fb896e90b0a6fc02c978e9e")) result = tk.MustQuery("select sha1('123'), sha1(123), sha1(''), sha1('你好'), sha1(NULL)") result.Check(testkit.Rows(`40bd001563085fc35165329ea1ff5c5ecbdbbeef 40bd001563085fc35165329ea1ff5c5ecbdbbeef da39a3ee5e6b4b0d3255bfef95601890afd80709 440ee0853ad1e99f962b63e459ef992d7c211722 <nil>`)) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time, f bit(4), g binary(20), h blob(10), i text(30))") tk.MustExec(`insert into t values('2', 2, 2.3, "2017-01-01 12:01:01", "12:01:01", 0b1010, "512", "48", "tidb")`) result = tk.MustQuery("select sha(a), sha(b), sha(c), sha(d), sha(e), sha(f), sha(g), sha(h), sha(i) from t") result.Check(testkit.Rows("da4b9237bacccdf19c0760cab7aec4a8359010b0 da4b9237bacccdf19c0760cab7aec4a8359010b0 ce0d88c5002b6cf7664052f1fc7d652cbdadccec 6c6956de323692298e4e5ad3028ff491f7ad363c 1906f8aeb5a717ca0f84154724045839330b0ea9 adc83b19e793491b1c6ea0fd8b46cd9f32e592fc 9aadd14ceb737b28697b8026f205f4b3e31de147 64e095fe763fc62418378753f9402623bea9e227 4df56fc09a3e66b48fb896e90b0a6fc02c978e9e")) result = tk.MustQuery("select sha('123'), sha(123), sha(''), sha('你好'), sha(NULL)") result.Check(testkit.Rows(`40bd001563085fc35165329ea1ff5c5ecbdbbeef 40bd001563085fc35165329ea1ff5c5ecbdbbeef da39a3ee5e6b4b0d3255bfef95601890afd80709 440ee0853ad1e99f962b63e459ef992d7c211722 <nil>`)) // for sha2 tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time, f bit(4), g binary(20), h blob(10), i text(30))") tk.MustExec(`insert into t values('2', 2, 2.3, "2017-01-01 12:01:01", "12:01:01", 0b1010, "512", "48", "tidb")`) result = tk.MustQuery("select sha2(a, 224), sha2(b, 0), sha2(c, 512), sha2(d, 256), sha2(e, 384), sha2(f, 0), sha2(g, 512), sha2(h, 256), sha2(i, 224) from t") result.Check(testkit.Rows("58b2aaa0bfae7acc021b3260e941117b529b2e69de878fd7d45c61a9 d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35 42415572557b0ca47e14fa928e83f5746d33f90c74270172cc75c61a78db37fe1485159a4fd75f33ab571b154572a5a300938f7d25969bdd05d8ac9dd6c66123 8c2fa3f276952c92b0b40ed7d27454e44b8399a19769e6bceb40da236e45a20a b11d35f1a37e54d5800d210d8e6b80b42c9f6d20ea7ae548c762383ebaa12c5954c559223c6c7a428e37af96bb4f1e0d 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 9550da35ea1683abaf5bfa8de68fe02b9c6d756c64589d1ef8367544c254f5f09218a6466cadcee8d74214f0c0b7fb342d1a9f3bd4d406aacf7be59c327c9306 98010bd9270f9b100b6214a21754fd33bdc8d41b2bc9f9dd16ff54d3c34ffd71 a7cddb7346fbc66ab7f803e865b74cbd99aace8e7dabbd8884c148cb")) result = tk.MustQuery("select sha2('123', 512), sha2(123, 512), sha2('', 512), sha2('你好', 224), sha2(NULL, 256), sha2('foo', 123)") result.Check(testkit.Rows(`3c9909afec25354d551dae21590bb26e38d53f2173b8d3dc3eee4c047e7ab1c1eb8b85103e3be7ba613b31bb5c9c36214dc9f14a42fd7a2fdb84856bca5c44c2 3c9909afec25354d551dae21590bb26e38d53f2173b8d3dc3eee4c047e7ab1c1eb8b85103e3be7ba613b31bb5c9c36214dc9f14a42fd7a2fdb84856bca5c44c2 cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e e91f006ed4e0882de2f6a3c96ec228a6a5c715f356d00091bce842b5 <nil> <nil>`)) // for AES_ENCRYPT tk.MustExec("drop table if exists t") tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time, f bit(4), g binary(20), h blob(10), i text(30))") tk.MustExec(`insert into t values('2', 2, 2.3, "2017-01-01 12:01:01", "12:01:01", 0b1010, "512", "48", "tidb")`) tk.MustExec("SET block_encryption_mode='aes-128-ecb';") result = tk.MustQuery("select HEX(AES_ENCRYPT(a, 'key')), HEX(AES_ENCRYPT(b, 'key')), HEX(AES_ENCRYPT(c, 'key')), HEX(AES_ENCRYPT(d, 'key')), HEX(AES_ENCRYPT(e, 'key')), HEX(AES_ENCRYPT(f, 'key')), HEX(AES_ENCRYPT(g, 'key')), HEX(AES_ENCRYPT(h, 'key')), HEX(AES_ENCRYPT(i, 'key')) from t") result.Check(testkit.Rows("B3800B3A3CB4ECE2051A3E80FE373EAC B3800B3A3CB4ECE2051A3E80FE373EAC 9E018F7F2838DBA23C57F0E4CCF93287 E764D3E9D4AF8F926CD0979DDB1D0AF40C208B20A6C39D5D028644885280973A C452FFEEB76D3F5E9B26B8D48F7A228C 181BD5C81CBD36779A3C9DD5FF486B35 CE15F14AC7FF4E56ECCF148DE60E4BEDBDB6900AD51383970A5F32C59B3AC6E3 E1B29995CCF423C75519790F54A08CD2 84525677E95AC97698D22E1125B67E92")) result = tk.MustQuery("select HEX(AES_ENCRYPT('123', 'foobar')), HEX(AES_ENCRYPT(123, 'foobar')), HEX(AES_ENCRYPT('', 'foobar')), HEX(AES_ENCRYPT('你好', 'foobar')), AES_ENCRYPT(NULL, 'foobar')") result.Check(testkit.Rows(`45ABDD5C4802EFA6771A94C43F805208 45ABDD5C4802EFA6771A94C43F805208 791F1AEB6A6B796E6352BF381895CA0E D0147E2EB856186F146D9F6DE33F9546 <nil>`)) result = tk.MustQuery("select HEX(AES_ENCRYPT(a, 'key', 'iv')), HEX(AES_ENCRYPT(b, 'key', 'iv')) from t") result.Check(testkit.Rows("B3800B3A3CB4ECE2051A3E80FE373EAC B3800B3A3CB4ECE2051A3E80FE373EAC")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1618|<IV> option ignored", "Warning|1618|<IV> option ignored")) tk.MustExec("SET block_encryption_mode='aes-128-cbc';") result = tk.MustQuery("select HEX(AES_ENCRYPT(a, 'key', '1234567890123456')), HEX(AES_ENCRYPT(b, 'key', '1234567890123456')), HEX(AES_ENCRYPT(c, 'key', '1234567890123456')), HEX(AES_ENCRYPT(d, 'key', '1234567890123456')), HEX(AES_ENCRYPT(e, 'key', '1234567890123456')), HEX(AES_ENCRYPT(f, 'key', '1234567890123456')), HEX(AES_ENCRYPT(g, 'key', '1234567890123456')), HEX(AES_ENCRYPT(h, 'key', '1234567890123456')), HEX(AES_ENCRYPT(i, 'key', '1234567890123456')) from t") result.Check(testkit.Rows("341672829F84CB6B0BE690FEC4C4DAE9 341672829F84CB6B0BE690FEC4C4DAE9 D43734E147A12BB96C6897C4BBABA283 16F2C972411948DCEF3659B726D2CCB04AD1379A1A367FA64242058A50211B67 41E71D0C58967C1F50EEC074523946D1 1117D292E2D39C3EAA3B435371BE56FC 8ACB7ECC0883B672D7BD1CFAA9FA5FAF5B731ADE978244CD581F114D591C2E7E D2B13C30937E3251AEDA73859BA32E4B 2CF4A6051FF248A67598A17AA2C17267")) result = tk.MustQuery("select HEX(AES_ENCRYPT('123', 'foobar', '1234567890123456')), HEX(AES_ENCRYPT(123, 'foobar', '1234567890123456')), HEX(AES_ENCRYPT('', 'foobar', '1234567890123456')), HEX(AES_ENCRYPT('你好', 'foobar', '1234567890123456')), AES_ENCRYPT(NULL, 'foobar', '1234567890123456')") result.Check(testkit.Rows(`80D5646F07B4654B05A02D9085759770 80D5646F07B4654B05A02D9085759770 B3C14BA15030D2D7E99376DBE011E752 0CD2936EE4FEC7A8CDF6208438B2BC05 <nil>`)) tk.MustExec("SET block_encryption_mode='aes-128-ofb';") result = tk.MustQuery("select HEX(AES_ENCRYPT(a, 'key', '1234567890123456')), HEX(AES_ENCRYPT(b, 'key', '1234567890123456')), HEX(AES_ENCRYPT(c, 'key', '1234567890123456')), HEX(AES_ENCRYPT(d, 'key', '1234567890123456')), HEX(AES_ENCRYPT(e, 'key', '1234567890123456')), HEX(AES_ENCRYPT(f, 'key', '1234567890123456')), HEX(AES_ENCRYPT(g, 'key', '1234567890123456')), HEX(AES_ENCRYPT(h, 'key', '1234567890123456')), HEX(AES_ENCRYPT(i, 'key', '1234567890123456')) from t") result.Check(testkit.Rows("40 40 40C35C 40DD5EBDFCAA397102386E27DDF97A39ECCEC5 43DF55BAE0A0386D 78 47DC5D8AD19A085C32094E16EFC34A08D6FEF459 46D5 06840BE8")) result = tk.MustQuery("select HEX(AES_ENCRYPT('123', 'foobar', '1234567890123456')), HEX(AES_ENCRYPT(123, 'foobar', '1234567890123456')), HEX(AES_ENCRYPT('', 'foobar', '1234567890123456')), HEX(AES_ENCRYPT('你好', 'foobar', '1234567890123456')), AES_ENCRYPT(NULL, 'foobar', '1234567890123456')") result.Check(testkit.Rows(`48E38A 48E38A 9D6C199101C3 <nil>`)) tk.MustExec("SET block_encryption_mode='aes-192-ofb';") result = tk.MustQuery("select HEX(AES_ENCRYPT(a, 'key', '1234567890123456')), HEX(AES_ENCRYPT(b, 'key', '1234567890123456')), HEX(AES_ENCRYPT(c, 'key', '1234567890123456')), HEX(AES_ENCRYPT(d, 'key', '1234567890123456')), HEX(AES_ENCRYPT(e, 'key', '1234567890123456')), HEX(AES_ENCRYPT(f, 'key', '1234567890123456')), HEX(AES_ENCRYPT(g, 'key', '1234567890123456')), HEX(AES_ENCRYPT(h, 'key', '1234567890123456')), HEX(AES_ENCRYPT(i, 'key', '1234567890123456')) from t") result.Check(testkit.Rows("4B 4B 4B573F 4B493D42572E6477233A429BF3E0AD39DB816D 484B36454B24656B 73 4C483E757A1E555A130B62AAC1DA9D08E1B15C47 4D41 0D106817")) result = tk.MustQuery("select HEX(AES_ENCRYPT('123', 'foobar', '1234567890123456')), HEX(AES_ENCRYPT(123, 'foobar', '1234567890123456')), HEX(AES_ENCRYPT('', 'foobar', '1234567890123456')), HEX(AES_ENCRYPT('你好', 'foobar', '1234567890123456')), AES_ENCRYPT(NULL, 'foobar', '1234567890123456')") result.Check(testkit.Rows(`3A76B0 3A76B0 EFF92304268E <nil>`)) tk.MustExec("SET block_encryption_mode='aes-256-ofb';") result = tk.MustQuery("select HEX(AES_ENCRYPT(a, 'key', '1234567890123456')), HEX(AES_ENCRYPT(b, 'key', '1234567890123456')), HEX(AES_ENCRYPT(c, 'key', '1234567890123456')), HEX(AES_ENCRYPT(d, 'key', '1234567890123456')), HEX(AES_ENCRYPT(e, 'key', '1234567890123456')), HEX(AES_ENCRYPT(f, 'key', '1234567890123456')), HEX(AES_ENCRYPT(g, 'key', '1234567890123456')), HEX(AES_ENCRYPT(h, 'key', '1234567890123456')), HEX(AES_ENCRYPT(i, 'key', '1234567890123456')) from t") result.Check(testkit.Rows("16 16 16D103 16CF01CBC95D33E2ED721CBD930262415A69AD 15CD0ACCD55732FE 2E 11CE02FCE46D02CFDD433C8CA138527060599C35 10C7 5096549E")) result = tk.MustQuery("select HEX(AES_ENCRYPT('123', 'foobar', '1234567890123456')), HEX(AES_ENCRYPT(123, 'foobar', '1234567890123456')), HEX(AES_ENCRYPT('', 'foobar', '1234567890123456')), HEX(AES_ENCRYPT('你好', 'foobar', '1234567890123456')), AES_ENCRYPT(NULL, 'foobar', '1234567890123456')") result.Check(testkit.Rows(`E842C5 E842C5 3DCD5646767D <nil>`)) // for AES_DECRYPT tk.MustExec("SET block_encryption_mode='aes-128-ecb';") result = tk.MustQuery("select AES_DECRYPT(AES_ENCRYPT('foo', 'bar'), 'bar')") result.Check(testkit.Rows("foo")) result = tk.MustQuery("select AES_DECRYPT(UNHEX('45ABDD5C4802EFA6771A94C43F805208'), 'foobar'), AES_DECRYPT(UNHEX('791F1AEB6A6B796E6352BF381895CA0E'), 'foobar'), AES_DECRYPT(UNHEX('D0147E2EB856186F146D9F6DE33F9546'), 'foobar'), AES_DECRYPT(NULL, 'foobar'), AES_DECRYPT('SOME_THING_STRANGE', 'foobar')") result.Check(testkit.Rows(`123 你好 <nil> <nil>`)) tk.MustExec("SET block_encryption_mode='aes-128-cbc';") result = tk.MustQuery("select AES_DECRYPT(AES_ENCRYPT('foo', 'bar', '1234567890123456'), 'bar', '1234567890123456')") result.Check(testkit.Rows("foo")) result = tk.MustQuery("select AES_DECRYPT(UNHEX('80D5646F07B4654B05A02D9085759770'), 'foobar', '1234567890123456'), AES_DECRYPT(UNHEX('B3C14BA15030D2D7E99376DBE011E752'), 'foobar', '1234567890123456'), AES_DECRYPT(UNHEX('0CD2936EE4FEC7A8CDF6208438B2BC05'), 'foobar', '1234567890123456'), AES_DECRYPT(NULL, 'foobar', '1234567890123456'), AES_DECRYPT('SOME_THING_STRANGE', 'foobar', '1234567890123456')") result.Check(testkit.Rows(`123 你好 <nil> <nil>`)) tk.MustExec("SET block_encryption_mode='aes-128-ofb';") result = tk.MustQuery("select AES_DECRYPT(AES_ENCRYPT('foo', 'bar', '1234567890123456'), 'bar', '1234567890123456')") result.Check(testkit.Rows("foo")) result = tk.MustQuery("select AES_DECRYPT(UNHEX('48E38A'), 'foobar', '1234567890123456'), AES_DECRYPT(UNHEX(''), 'foobar', '1234567890123456'), AES_DECRYPT(UNHEX('9D6C199101C3'), 'foobar', '1234567890123456'), AES_DECRYPT(NULL, 'foobar', '1234567890123456'), HEX(AES_DECRYPT('SOME_THING_STRANGE', 'foobar', '1234567890123456'))") result.Check(testkit.Rows(`123 你好 <nil> 2A9EF431FB2ACB022D7F2E7C71EEC48C7D2B`)) tk.MustExec("SET block_encryption_mode='aes-192-ofb';") result = tk.MustQuery("select AES_DECRYPT(AES_ENCRYPT('foo', 'bar', '1234567890123456'), 'bar', '1234567890123456')") result.Check(testkit.Rows("foo")) result = tk.MustQuery("select AES_DECRYPT(UNHEX('3A76B0'), 'foobar', '1234567890123456'), AES_DECRYPT(UNHEX(''), 'foobar', '1234567890123456'), AES_DECRYPT(UNHEX('EFF92304268E'), 'foobar', '1234567890123456'), AES_DECRYPT(NULL, 'foobar', '1234567890123456'), HEX(AES_DECRYPT('SOME_THING_STRANGE', 'foobar', '1234567890123456'))") result.Check(testkit.Rows(`123 你好 <nil> 580BCEA4DC67CF33FF2C7C570D36ECC89437`)) tk.MustExec("SET block_encryption_mode='aes-256-ofb';") result = tk.MustQuery("select AES_DECRYPT(AES_ENCRYPT('foo', 'bar', '1234567890123456'), 'bar', '1234567890123456')") result.Check(testkit.Rows("foo")) result = tk.MustQuery("select AES_DECRYPT(UNHEX('E842C5'), 'foobar', '1234567890123456'), AES_DECRYPT(UNHEX(''), 'foobar', '1234567890123456'), AES_DECRYPT(UNHEX('3DCD5646767D'), 'foobar', '1234567890123456'), AES_DECRYPT(NULL, 'foobar', '1234567890123456'), HEX(AES_DECRYPT('SOME_THING_STRANGE', 'foobar', '1234567890123456'))") result.Check(testkit.Rows(`123 你好 <nil> 8A3FBBE68C9465834584430E3AEEBB04B1F5`)) // for COMPRESS tk.MustExec("DROP TABLE IF EXISTS t1;") tk.MustExec("CREATE TABLE t1(a VARCHAR(1000));") tk.MustExec("INSERT INTO t1 VALUES('12345'), ('23456');") result = tk.MustQuery("SELECT HEX(COMPRESS(a)) FROM t1;") result.Check(testkit.Rows("05000000789C323432363105040000FFFF02F80100", "05000000789C323236313503040000FFFF03070105")) tk.MustExec("DROP TABLE IF EXISTS t2;") tk.MustExec("CREATE TABLE t2(a VARCHAR(1000), b VARBINARY(1000));") tk.MustExec("INSERT INTO t2 (a, b) SELECT a, COMPRESS(a) from t1;") result = tk.MustQuery("SELECT a, HEX(b) FROM t2;") result.Check(testkit.Rows("12345 05000000789C323432363105040000FFFF02F80100", "23456 05000000789C323236313503040000FFFF03070105")) // for UNCOMPRESS result = tk.MustQuery("SELECT UNCOMPRESS(COMPRESS('123'))") result.Check(testkit.Rows("123")) result = tk.MustQuery("SELECT UNCOMPRESS(UNHEX('03000000789C3334320600012D0097'))") result.Check(testkit.Rows("123")) result = tk.MustQuery("SELECT UNCOMPRESS(UNHEX('03000000789C32343206040000FFFF012D0097'))") result.Check(testkit.Rows("123")) tk.MustExec("INSERT INTO t2 VALUES ('12345', UNHEX('05000000789C3334323631050002F80100'))") result = tk.MustQuery("SELECT UNCOMPRESS(a), UNCOMPRESS(b) FROM t2;") result.Check(testkit.Rows("<nil> 12345", "<nil> 23456", "<nil> 12345")) // for UNCOMPRESSED_LENGTH result = tk.MustQuery("SELECT UNCOMPRESSED_LENGTH(COMPRESS('123'))") result.Check(testkit.Rows("3")) result = tk.MustQuery("SELECT UNCOMPRESSED_LENGTH(UNHEX('03000000789C3334320600012D0097'))") result.Check(testkit.Rows("3")) result = tk.MustQuery("SELECT UNCOMPRESSED_LENGTH(UNHEX('03000000789C32343206040000FFFF012D0097'))") result.Check(testkit.Rows("3")) result = tk.MustQuery("SELECT UNCOMPRESSED_LENGTH('')") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT UNCOMPRESSED_LENGTH(UNHEX('0100'))") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT UNCOMPRESSED_LENGTH(a), UNCOMPRESSED_LENGTH(b) FROM t2;") result.Check(testkit.Rows("875770417 5", "892613426 5", "875770417 5")) // for RANDOM_BYTES lengths := []int{0, -5, 1025, 4000} for _, len := range lengths { rs, err := tk.Exec(fmt.Sprintf("SELECT RANDOM_BYTES(%d);", len)) c.Assert(err, IsNil, Commentf("%v", len)) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil, Commentf("%v", len)) terr := errors.Cause(err).(*terror.Error) c.Assert(terr.Code(), Equals, terror.ErrCode(mysql.ErrDataOutOfRange), Commentf("%v", len)) c.Assert(rs.Close(), IsNil) } tk.MustQuery("SELECT RANDOM_BYTES('1');") tk.MustQuery("SELECT RANDOM_BYTES(1024);") result = tk.MustQuery("SELECT RANDOM_BYTES(NULL);") result.Check(testkit.Rows("<nil>")) } func (s *testIntegrationSuite) TestTimeBuiltin(c *C) { originSQLMode := s.ctx.GetSessionVars().StrictSQLMode s.ctx.GetSessionVars().StrictSQLMode = true defer func() { s.ctx.GetSessionVars().StrictSQLMode = originSQLMode s.cleanEnv(c) }() tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") // for makeDate tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int, b double, c datetime, d time, e char(20), f bit(10))") tk.MustExec(`insert into t values(1, 1.1, "2017-01-01 12:01:01", "12:01:01", "abcdef", 0b10101)`) result := tk.MustQuery("select makedate(a,a), makedate(b,b), makedate(c,c), makedate(d,d), makedate(e,e), makedate(f,f), makedate(null,null), makedate(a,b) from t") result.Check(testkit.Rows("2001-01-01 2001-01-01 <nil> <nil> <nil> 2021-01-21 <nil> 2001-01-01")) // for date result = tk.MustQuery(`select date("2019-09-12"), date("2019-09-12 12:12:09"), date("2019-09-12 12:12:09.121212");`) result.Check(testkit.Rows("2019-09-12 2019-09-12 2019-09-12")) result = tk.MustQuery(`select date("0000-00-00"), date("0000-00-00 12:12:09"), date("0000-00-00 00:00:00.121212"), date("0000-00-00 00:00:00.000000");`) result.Check(testkit.Rows("<nil> 0000-00-00 0000-00-00 <nil>")) result = tk.MustQuery(`select date("aa"), date(12.1), date("");`) result.Check(testkit.Rows("<nil> <nil> <nil>")) // for year result = tk.MustQuery(`select year("2013-01-09"), year("2013-00-09"), year("000-01-09"), year("1-01-09"), year("20131-01-09"), year(null);`) result.Check(testkit.Rows("2013 2013 0 1 <nil> <nil>")) result = tk.MustQuery(`select year("2013-00-00"), year("2013-00-00 00:00:00"), year("0000-00-00 12:12:12"), year("2017-00-00 12:12:12");`) result.Check(testkit.Rows("2013 2013 0 2017")) result = tk.MustQuery(`select year("aa"), year(2013), year(2012.09), year("1-01"), year("-09");`) result.Check(testkit.Rows("<nil> <nil> <nil> <nil> <nil>")) tk.MustExec(`drop table if exists t`) tk.MustExec(`create table t(a bigint)`) _, err := tk.Exec(`insert into t select year("aa")`) c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue, Commentf("err %v", err)) tk.MustExec(`set sql_mode='STRICT_TRANS_TABLES'`) // without zero date tk.MustExec(`insert into t select year("0000-00-00 00:00:00")`) tk.MustExec(`set sql_mode="NO_ZERO_DATE";`) // with zero date tk.MustExec(`insert into t select year("0000-00-00 00:00:00")`) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Incorrect datetime value: '0000-00-00 00:00:00.000000'")) tk.MustExec(`set sql_mode="NO_ZERO_DATE,STRICT_TRANS_TABLES";`) _, err = tk.Exec(`insert into t select year("0000-00-00 00:00:00");`) c.Assert(err, NotNil) c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue, Commentf("err %v", err)) tk.MustExec(`insert into t select 1`) tk.MustExec(`set sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION";`) _, err = tk.Exec(`update t set a = year("aa")`) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue, Commentf("err %v", err)) _, err = tk.Exec(`delete from t where a = year("aa")`) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue, Commentf("err %v", err)) // for month result = tk.MustQuery(`select month("2013-01-09"), month("2013-00-09"), month("000-01-09"), month("1-01-09"), month("20131-01-09"), month(null);`) result.Check(testkit.Rows("1 0 1 1 <nil> <nil>")) result = tk.MustQuery(`select month("2013-00-00"), month("2013-00-00 00:00:00"), month("0000-00-00 12:12:12"), month("2017-00-00 12:12:12");`) result.Check(testkit.Rows("0 0 0 0")) result = tk.MustQuery(`select month("aa"), month(2013), month(2012.09), month("1-01"), month("-09");`) result.Check(testkit.Rows("<nil> <nil> <nil> <nil> <nil>")) result = tk.MustQuery(`select month("2013-012-09"), month("2013-0000000012-09"), month("2013-30-09"), month("000-41-09");`) result.Check(testkit.Rows("12 12 <nil> <nil>")) tk.MustExec(`drop table if exists t`) tk.MustExec(`create table t(a bigint)`) _, err = tk.Exec(`insert into t select month("aa")`) c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) tk.MustExec(`insert into t select month("0000-00-00 00:00:00")`) tk.MustExec(`set sql_mode="NO_ZERO_DATE";`) tk.MustExec(`insert into t select month("0000-00-00 00:00:00")`) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Incorrect datetime value: '0000-00-00 00:00:00.000000'")) tk.MustExec(`set sql_mode="NO_ZERO_DATE,STRICT_TRANS_TABLES";`) _, err = tk.Exec(`insert into t select month("0000-00-00 00:00:00");`) c.Assert(err, NotNil) c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue, Commentf("err %v", err)) tk.MustExec(`insert into t select 1`) tk.MustExec(`set sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION";`) tk.MustExec(`insert into t select 1`) _, err = tk.Exec(`update t set a = month("aa")`) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) _, err = tk.Exec(`delete from t where a = month("aa")`) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) // for week result = tk.MustQuery(`select week("2012-12-22"), week("2012-12-22", -2), week("2012-12-22", 0), week("2012-12-22", 1), week("2012-12-22", 2), week("2012-12-22", 200);`) result.Check(testkit.Rows("51 51 51 51 51 51")) result = tk.MustQuery(`select week("2008-02-20"), week("2008-02-20", 0), week("2008-02-20", 1), week("2009-02-20", 2), week("2008-02-20", 3), week("2008-02-20", 4);`) result.Check(testkit.Rows("7 7 8 7 8 8")) result = tk.MustQuery(`select week("2008-02-20", 5), week("2008-02-20", 6), week("2009-02-20", 7), week("2008-02-20", 8), week("2008-02-20", 9);`) result.Check(testkit.Rows("7 8 7 7 8")) result = tk.MustQuery(`select week("aa", 1), week(null, 2), week(11, 2), week(12.99, 2);`) result.Check(testkit.Rows("<nil> <nil> <nil> <nil>")) result = tk.MustQuery(`select week("aa"), week(null), week(11), week(12.99);`) result.Check(testkit.Rows("<nil> <nil> <nil> <nil>")) tk.MustExec(`drop table if exists t`) tk.MustExec(`create table t(a datetime)`) _, err = tk.Exec(`insert into t select week("aa", 1)`) c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) tk.MustExec(`insert into t select now()`) _, err = tk.Exec(`update t set a = week("aa", 1)`) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) _, err = tk.Exec(`delete from t where a = week("aa", 1)`) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) // for weekofyear result = tk.MustQuery(`select weekofyear("2012-12-22"), weekofyear("2008-02-20"), weekofyear("aa"), weekofyear(null), weekofyear(11), weekofyear(12.99);`) result.Check(testkit.Rows("51 8 <nil> <nil> <nil> <nil>")) tk.MustExec(`drop table if exists t`) tk.MustExec(`create table t(a bigint)`) _, err = tk.Exec(`insert into t select weekofyear("aa")`) c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) tk.MustExec(`insert into t select 1`) _, err = tk.Exec(`update t set a = weekofyear("aa")`) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) _, err = tk.Exec(`delete from t where a = weekofyear("aa")`) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) // for weekday result = tk.MustQuery(`select weekday("2012-12-20"), weekday("2012-12-21"), weekday("2012-12-22"), weekday("2012-12-23"), weekday("2012-12-24"), weekday("2012-12-25"), weekday("2012-12-26"), weekday("2012-12-27");`) result.Check(testkit.Rows("3 4 5 6 0 1 2 3")) result = tk.MustQuery(`select weekday("2012-12-90"), weekday("0000-00-00"), weekday("aa"), weekday(null), weekday(11), weekday(12.99);`) result.Check(testkit.Rows("<nil> <nil> <nil> <nil> <nil> <nil>")) // for quarter result = tk.MustQuery(`select quarter("2012-00-20"), quarter("2012-01-21"), quarter("2012-03-22"), quarter("2012-05-23"), quarter("2012-08-24"), quarter("2012-09-25"), quarter("2012-11-26"), quarter("2012-12-27");`) result.Check(testkit.Rows("0 1 1 2 3 3 4 4")) result = tk.MustQuery(`select quarter("2012-14-20"), quarter("0000-00-00"), quarter("aa"), quarter(null), quarter(11), quarter(12.99);`) result.Check(testkit.Rows("<nil> <nil> <nil> <nil> <nil> <nil>")) // for from_days result = tk.MustQuery(`select from_days(0), from_days(-199), from_days(1111), from_days(120), from_days(1), from_days(1111111), from_days(9999999), from_days(22222);`) result.Check(testkit.Rows("0000-00-00 0000-00-00 0003-01-16 0000-00-00 0000-00-00 3042-02-13 0000-00-00 0060-11-03")) result = tk.MustQuery(`select from_days("2012-14-20"), from_days("111a"), from_days("aa"), from_days(null), from_days("123asf"), from_days(12.99);`) result.Check(testkit.Rows("0005-07-05 0000-00-00 0000-00-00 <nil> 0000-00-00 0000-00-00")) // Fix issue #3923 result = tk.MustQuery("select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00');") result.Check(testkit.Rows("00:00:00")) result = tk.MustQuery("select timediff('12:00:00', cast('2004-12-30 12:00:00' as time));") result.Check(testkit.Rows("00:00:00")) result = tk.MustQuery("select timediff(cast('2004-12-30 12:00:00' as time), '2004-12-30 12:00:00');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timediff('2004-12-30 12:00:00', cast('2004-12-30 12:00:00' as time));") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timediff(cast('2004-12-30 12:00:01' as datetime), '2004-12-30 12:00:00');") result.Check(testkit.Rows("00:00:01")) result = tk.MustQuery("select timediff('2004-12-30 12:00:00', cast('2004-12-30 12:00:01' as datetime));") result.Check(testkit.Rows("-00:00:01")) result = tk.MustQuery("select timediff(cast('2004-12-30 12:00:01' as time), '-34 00:00:00');") result.Check(testkit.Rows("828:00:01")) result = tk.MustQuery("select timediff('-34 00:00:00', cast('2004-12-30 12:00:01' as time));") result.Check(testkit.Rows("-828:00:01")) result = tk.MustQuery("select timediff(cast('2004-12-30 12:00:01' as datetime), cast('2004-12-30 11:00:01' as datetime));") result.Check(testkit.Rows("01:00:00")) result = tk.MustQuery("select timediff(cast('2004-12-30 12:00:01' as datetime), '2004-12-30 12:00:00.1');") result.Check(testkit.Rows("00:00:00.9")) result = tk.MustQuery("select timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime));") result.Check(testkit.Rows("-00:00:00.9")) result = tk.MustQuery("select timediff(cast('2004-12-30 12:00:01' as datetime), '-34 124:00:00');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timediff('-34 124:00:00', cast('2004-12-30 12:00:01' as datetime));") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timediff(cast('2004-12-30 12:00:01' as time), '-34 124:00:00');") result.Check(testkit.Rows("838:59:59")) result = tk.MustQuery("select timediff('-34 124:00:00', cast('2004-12-30 12:00:01' as time));") result.Check(testkit.Rows("-838:59:59")) result = tk.MustQuery("select timediff(cast('2004-12-30' as datetime), '12:00:00');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timediff('12:00:00', cast('2004-12-30' as datetime));") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timediff('12:00:00', '-34 12:00:00');") result.Check(testkit.Rows("838:59:59")) result = tk.MustQuery("select timediff('12:00:00', '34 12:00:00');") result.Check(testkit.Rows("-816:00:00")) result = tk.MustQuery("select timediff('2014-1-2 12:00:00', '-34 12:00:00');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timediff('-34 12:00:00', '2014-1-2 12:00:00');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timediff('2014-1-2 12:00:00', '12:00:00');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timediff('12:00:00', '2014-1-2 12:00:00');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timediff('2014-1-2 12:00:00', '2014-1-1 12:00:00');") result.Check(testkit.Rows("24:00:00")) result = tk.MustQuery("select timestampadd(MINUTE, 1, '2003-01-02'), timestampadd(WEEK, 1, '2003-01-02 23:59:59')" + ", timestampadd(MICROSECOND, 1, 950501);") result.Check(testkit.Rows("2003-01-02 00:01:00 2003-01-09 23:59:59 1995-05-01 00:00:00.000001")) result = tk.MustQuery("select timestampadd(day, 2, 950501), timestampadd(MINUTE, 37.5,'2003-01-02'), timestampadd(MINUTE, 37.49,'2003-01-02')," + " timestampadd(YeAr, 1, '2003-01-02');") result.Check(testkit.Rows("1995-05-03 00:00:00 2003-01-02 00:38:00 2003-01-02 00:37:00 2004-01-02 00:00:00")) result = tk.MustQuery("select to_seconds(950501), to_seconds('2009-11-29'), to_seconds('2009-11-29 13:43:32'), to_seconds('09-11-29 13:43:32');") result.Check(testkit.Rows("62966505600 63426672000 63426721412 63426721412")) result = tk.MustQuery("select to_days(950501), to_days('2007-10-07'), to_days('2007-10-07 00:00:59'), to_days('0000-01-01')") result.Check(testkit.Rows("728779 733321 733321 1")) result = tk.MustQuery("select last_day('2003-02-05'), last_day('2004-02-05'), last_day('2004-01-01 01:01:01'), last_day(950501);") result.Check(testkit.Rows("2003-02-28 2004-02-29 2004-01-31 1995-05-31")) tk.MustExec("SET SQL_MODE='';") result = tk.MustQuery("select last_day('0000-00-00');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select to_days('0000-00-00');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select to_seconds('0000-00-00');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select timestamp('2003-12-31'), timestamp('2003-12-31 12:00:00','12:00:00');") result.Check(testkit.Rows("2003-12-31 00:00:00 2004-01-01 00:00:00")) result = tk.MustQuery("select timestamp(20170118123950.123), timestamp(20170118123950.999);") result.Check(testkit.Rows("2017-01-18 12:39:50.123 2017-01-18 12:39:50.999")) result = tk.MustQuery("select timestamp('2003-12-31', '01:01:01.01'), timestamp('2003-12-31 12:34', '01:01:01.01')," + " timestamp('2008-12-31','00:00:00.0'), timestamp('2008-12-31 00:00:00.000');") result.Check(testkit.Rows("2003-12-31 01:01:01.01 2003-12-31 13:35:01.01 2008-12-31 00:00:00.0 2008-12-31 00:00:00.000")) result = tk.MustQuery("select timestamp('2003-12-31', 1), timestamp('2003-12-31', -1);") result.Check(testkit.Rows("2003-12-31 00:00:01 2003-12-30 23:59:59")) result = tk.MustQuery("select timestamp('2003-12-31', '2000-12-12 01:01:01.01'), timestamp('2003-14-31','01:01:01.01');") result.Check(testkit.Rows("<nil> <nil>")) result = tk.MustQuery("select TIMESTAMPDIFF(MONTH,'2003-02-01','2003-05-01'), TIMESTAMPDIFF(yEaR,'2002-05-01', " + "'2001-01-01'), TIMESTAMPDIFF(minute,binary('2003-02-01'),'2003-05-01 12:05:55'), TIMESTAMPDIFF(day," + "'1995-05-02', 950501);") result.Check(testkit.Rows("3 -1 128885 -1")) result = tk.MustQuery("select datediff('2007-12-31 23:59:59','2007-12-30'), datediff('2010-11-30 23:59:59', " + "'2010-12-31'), datediff(950501,'2016-01-13'), datediff(950501.9,'2016-01-13'), datediff(binary(950501), '2016-01-13');") result.Check(testkit.Rows("1 -31 -7562 -7562 -7562")) result = tk.MustQuery("select datediff('0000-01-01','0001-01-01'), datediff('0001-00-01', '0001-00-01'), datediff('0001-01-00','0001-01-00'), datediff('2017-01-01','2017-01-01');") result.Check(testkit.Rows("-365 <nil> <nil> 0")) // for ADDTIME result = tk.MustQuery("select addtime('01:01:11', '00:00:01.013'), addtime('01:01:11.00', '00:00:01'), addtime" + "('2017-01-01 01:01:11.12', '00:00:01'), addtime('2017-01-01 01:01:11.12', '00:00:01.88');") result.Check(testkit.Rows("01:01:12.013000 01:01:12 2017-01-01 01:01:12.120000 2017-01-01 01:01:13")) result = tk.MustQuery("select addtime(cast('01:01:11' as time(4)), '00:00:01.013'), addtime(cast('01:01:11.00' " + "as datetime(3)), '00:00:01')," + " addtime(cast('2017-01-01 01:01:11.12' as date), '00:00:01'), addtime(cast" + "(cast('2017-01-01 01:01:11.12' as date) as datetime(2)), '00:00:01.88');") result.Check(testkit.Rows("01:01:12.0130 2001-01-11 00:00:01.000 00:00:01 2017-01-01 00:00:01.88")) result = tk.MustQuery("select addtime('2017-01-01 01:01:01', 5), addtime('2017-01-01 01:01:01', -5), addtime('2017-01-01 01:01:01', 0.0), addtime('2017-01-01 01:01:01', 1.34);") result.Check(testkit.Rows("2017-01-01 01:01:06 2017-01-01 01:00:56 2017-01-01 01:01:01 2017-01-01 01:01:02.340000")) result = tk.MustQuery("select addtime(cast('01:01:11.00' as datetime(3)), cast('00:00:01' as time)), addtime(cast('01:01:11.00' as datetime(3)), cast('00:00:01' as time(5)))") result.Check(testkit.Rows("2001-01-11 00:00:01.000 2001-01-11 00:00:01.00000")) result = tk.MustQuery("select addtime(cast('01:01:11.00' as date), cast('00:00:01' as time));") result.Check(testkit.Rows("00:00:01")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a datetime, b timestamp, c time)") tk.MustExec(`insert into t values("2017 01-01 12:30:31", "2017 01-01 12:30:31", "01:01:01")`) result = tk.MustQuery("select addtime(a, b), addtime(cast(a as date), b), addtime(b,a), addtime(a,c), addtime(b," + "c), addtime(c,a), addtime(c,b)" + " from t;") result.Check(testkit.Rows("<nil> <nil> <nil> 2017-01-01 13:31:32 2017-01-01 13:31:32 <nil> <nil>")) // for SUBTIME result = tk.MustQuery("select subtime('01:01:11', '00:00:01.013'), subtime('01:01:11.00', '00:00:01'), subtime" + "('2017-01-01 01:01:11.12', '00:00:01'), subtime('2017-01-01 01:01:11.12', '00:00:01.88');") result.Check(testkit.Rows("01:01:09.987000 01:01:10 2017-01-01 01:01:10.120000 2017-01-01 01:01:09.240000")) result = tk.MustQuery("select subtime(cast('01:01:11' as time(4)), '00:00:01.013'), subtime(cast('01:01:11.00' " + "as datetime(3)), '00:00:01')," + " subtime(cast('2017-01-01 01:01:11.12' as date), '00:00:01'), subtime(cast" + "(cast('2017-01-01 01:01:11.12' as date) as datetime(2)), '00:00:01.88');") result.Check(testkit.Rows("01:01:09.9870 2001-01-10 23:59:59.000 -00:00:01 2016-12-31 23:59:58.12")) result = tk.MustQuery("select subtime('2017-01-01 01:01:01', 5), subtime('2017-01-01 01:01:01', -5), subtime('2017-01-01 01:01:01', 0.0), subtime('2017-01-01 01:01:01', 1.34);") result.Check(testkit.Rows("2017-01-01 01:00:56 2017-01-01 01:01:06 2017-01-01 01:01:01 2017-01-01 01:00:59.660000")) result = tk.MustQuery("select subtime('01:01:11', '0:0:1.013'), subtime('01:01:11.00', '0:0:1'), subtime('2017-01-01 01:01:11.12', '0:0:1'), subtime('2017-01-01 01:01:11.12', '0:0:1.120000');") result.Check(testkit.Rows("01:01:09.987000 01:01:10 2017-01-01 01:01:10.120000 2017-01-01 01:01:10")) result = tk.MustQuery("select subtime(cast('01:01:11.00' as datetime(3)), cast('00:00:01' as time)), subtime(cast('01:01:11.00' as datetime(3)), cast('00:00:01' as time(5)))") result.Check(testkit.Rows("2001-01-10 23:59:59.000 2001-01-10 23:59:59.00000")) result = tk.MustQuery("select subtime(cast('01:01:11.00' as date), cast('00:00:01' as time));") result.Check(testkit.Rows("-00:00:01")) result = tk.MustQuery("select subtime(a, b), subtime(cast(a as date), b), subtime(b,a), subtime(a,c), subtime(b," + "c), subtime(c,a), subtime(c,b) from t;") result.Check(testkit.Rows("<nil> <nil> <nil> 2017-01-01 11:29:30 2017-01-01 11:29:30 <nil> <nil>")) // fixed issue #3986 tk.MustExec("SET SQL_MODE='NO_ENGINE_SUBSTITUTION';") tk.MustExec("SET TIME_ZONE='+03:00';") tk.MustExec("DROP TABLE IF EXISTS t;") tk.MustExec("CREATE TABLE t (ix TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);") tk.MustExec("INSERT INTO t VALUES (0), (20030101010160), (20030101016001), (20030101240101), (20030132010101), (20031301010101), (20031200000000), (20030000000000);") result = tk.MustQuery("SELECT CAST(ix AS SIGNED) FROM t;") result.Check(testkit.Rows("0", "0", "0", "0", "0", "0", "0", "0")) // test time result = tk.MustQuery("select time('2003-12-31 01:02:03')") result.Check(testkit.Rows("01:02:03")) result = tk.MustQuery("select time('2003-12-31 01:02:03.000123')") result.Check(testkit.Rows("01:02:03.000123")) result = tk.MustQuery("select time('01:02:03.000123')") result.Check(testkit.Rows("01:02:03.000123")) result = tk.MustQuery("select time('01:02:03')") result.Check(testkit.Rows("01:02:03")) result = tk.MustQuery("select time('-838:59:59.000000')") result.Check(testkit.Rows("-838:59:59.000000")) result = tk.MustQuery("select time('-838:59:59.000001')") result.Check(testkit.Rows("-838:59:59.000000")) result = tk.MustQuery("select time('-839:59:59.000000')") result.Check(testkit.Rows("-838:59:59.000000")) result = tk.MustQuery("select time('840:59:59.000000')") result.Check(testkit.Rows("838:59:59.000000")) // FIXME: #issue 4193 // result = tk.MustQuery("select time('840:59:60.000000')") // result.Check(testkit.Rows("<nil>")) // result = tk.MustQuery("select time('800:59:59.9999999')") // result.Check(testkit.Rows("801:00:00.000000")) // result = tk.MustQuery("select time('12003-12-10 01:02:03.000123')") // result.Check(testkit.Rows("<nil>") // result = tk.MustQuery("select time('')") // result.Check(testkit.Rows("<nil>") // result = tk.MustQuery("select time('2003-12-10-10 01:02:03.000123')") // result.Check(testkit.Rows("00:20:03") //for hour result = tk.MustQuery(`SELECT hour("12:13:14.123456"), hour("12:13:14.000010"), hour("272:59:55"), hour(020005), hour(null), hour("27aaaa2:59:55");`) result.Check(testkit.Rows("12 12 272 2 <nil> <nil>")) // for hour, issue #4340 result = tk.MustQuery(`SELECT HOUR(20171222020005);`) result.Check(testkit.Rows("2")) result = tk.MustQuery(`SELECT HOUR(20171222020005.1);`) result.Check(testkit.Rows("2")) result = tk.MustQuery(`SELECT HOUR(20171222020005.1e0);`) result.Check(testkit.Rows("2")) result = tk.MustQuery(`SELECT HOUR("20171222020005");`) result.Check(testkit.Rows("2")) result = tk.MustQuery(`SELECT HOUR("20171222020005.1");`) result.Check(testkit.Rows("2")) result = tk.MustQuery(`select hour(20171222);`) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery(`select hour(8381222);`) result.Check(testkit.Rows("838")) result = tk.MustQuery(`select hour(10000000000);`) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery(`select hour(10100000000);`) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery(`select hour(10001000000);`) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery(`select hour(10101000000);`) result.Check(testkit.Rows("0")) // for minute result = tk.MustQuery(`SELECT minute("12:13:14.123456"), minute("12:13:14.000010"), minute("272:59:55"), minute(null), minute("27aaaa2:59:55");`) result.Check(testkit.Rows("13 13 59 <nil> <nil>")) // for second result = tk.MustQuery(`SELECT second("12:13:14.123456"), second("12:13:14.000010"), second("272:59:55"), second(null), second("27aaaa2:59:55");`) result.Check(testkit.Rows("14 14 55 <nil> <nil>")) // for microsecond result = tk.MustQuery(`SELECT microsecond("12:00:00.123456"), microsecond("12:00:00.000010"), microsecond(null), microsecond("27aaaa2:59:55");`) result.Check(testkit.Rows("123456 10 <nil> <nil>")) // for period_add result = tk.MustQuery(`SELECT period_add(191, 2), period_add(191, -2), period_add(0, 20), period_add(0, 0);`) result.Check(testkit.Rows("200809 200805 0 0")) result = tk.MustQuery(`SELECT period_add(NULL, 2), period_add(-191, NULL), period_add(NULL, NULL), period_add(12.09, -2), period_add("21aa", "11aa"), period_add("", "");`) result.Check(testkit.Rows("<nil> <nil> <nil> 200010 200208 0")) // for period_diff result = tk.MustQuery(`SELECT period_diff(191, 2), period_diff(191, -2), period_diff(0, 0), period_diff(191, 191);`) result.Check(testkit.Rows("101 -2213609288845122103 0 0")) result = tk.MustQuery(`SELECT period_diff(NULL, 2), period_diff(-191, NULL), period_diff(NULL, NULL), period_diff(12.09, 2), period_diff("21aa", "11aa"), period_diff("", "");`) result.Check(testkit.Rows("<nil> <nil> <nil> 10 10 0")) // TODO: fix `CAST(xx as duration)` and release the test below: // result = tk.MustQuery(`SELECT hour("aaa"), hour(123456), hour(1234567);`) // result = tk.MustQuery(`SELECT minute("aaa"), minute(123456), minute(1234567);`) // result = tk.MustQuery(`SELECT second("aaa"), second(123456), second(1234567);`) // result = tk.MustQuery(`SELECT microsecond("aaa"), microsecond(123456), microsecond(1234567);`) // for time_format result = tk.MustQuery("SELECT TIME_FORMAT('150:02:28', '%H:%i:%s %p');") result.Check(testkit.Rows("150:02:28 AM")) result = tk.MustQuery("SELECT TIME_FORMAT('bad string', '%H:%i:%s %p');") result.Check(testkit.Rows("00:00:00 AM")) result = tk.MustQuery("SELECT TIME_FORMAT(null, '%H:%i:%s %p');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("SELECT TIME_FORMAT(123, '%H:%i:%s %p');") result.Check(testkit.Rows("00:01:23 AM")) // for date_format result = tk.MustQuery(`SELECT DATE_FORMAT('2017-06-15', '%W %M %e %Y %r %y');`) result.Check(testkit.Rows("Thursday June 15 2017 12:00:00 AM 17")) result = tk.MustQuery(`SELECT DATE_FORMAT(151113102019.12, '%W %M %e %Y %r %y');`) result.Check(testkit.Rows("Friday November 13 2015 10:20:19 AM 15")) result = tk.MustQuery(`SELECT DATE_FORMAT('0000-00-00', '%W %M %e %Y %r %y');`) result.Check(testkit.Rows("<nil>")) // for yearweek result = tk.MustQuery(`select yearweek("2014-12-27"), yearweek("2014-29-27"), yearweek("2014-00-27"), yearweek("2014-12-27 12:38:32"), yearweek("2014-12-27 12:38:32.1111111"), yearweek("2014-12-27 12:90:32"), yearweek("2014-12-27 89:38:32.1111111");`) result.Check(testkit.Rows("201451 <nil> <nil> 201451 201451 <nil> <nil>")) result = tk.MustQuery(`select yearweek(12121), yearweek(1.00009), yearweek("aaaaa"), yearweek(""), yearweek(NULL);`) result.Check(testkit.Rows("<nil> <nil> <nil> <nil> <nil>")) result = tk.MustQuery(`select yearweek("0000-00-00"), yearweek("2019-01-29", "aa"), yearweek("2011-01-01", null);`) result.Check(testkit.Rows("<nil> 201904 201052")) // for dayOfWeek, dayOfMonth, dayOfYear result = tk.MustQuery(`select dayOfWeek(null), dayOfWeek("2017-08-12"), dayOfWeek("0000-00-00"), dayOfWeek("2017-00-00"), dayOfWeek("0000-00-00 12:12:12"), dayOfWeek("2017-00-00 12:12:12")`) result.Check(testkit.Rows("<nil> 7 <nil> <nil> <nil> <nil>")) result = tk.MustQuery(`select dayOfYear(null), dayOfYear("2017-08-12"), dayOfYear("0000-00-00"), dayOfYear("2017-00-00"), dayOfYear("0000-00-00 12:12:12"), dayOfYear("2017-00-00 12:12:12")`) result.Check(testkit.Rows("<nil> 224 <nil> <nil> <nil> <nil>")) result = tk.MustQuery(`select dayOfMonth(null), dayOfMonth("2017-08-12"), dayOfMonth("0000-00-00"), dayOfMonth("2017-00-00"), dayOfMonth("0000-00-00 12:12:12"), dayOfMonth("2017-00-00 12:12:12")`) result.Check(testkit.Rows("<nil> 12 0 0 0 0")) tk.MustExec("set sql_mode = 'NO_ZERO_DATE'") result = tk.MustQuery(`select dayOfWeek(null), dayOfWeek("2017-08-12"), dayOfWeek("0000-00-00"), dayOfWeek("2017-00-00"), dayOfWeek("0000-00-00 12:12:12"), dayOfWeek("2017-00-00 12:12:12")`) result.Check(testkit.Rows("<nil> 7 <nil> <nil> <nil> <nil>")) result = tk.MustQuery(`select dayOfYear(null), dayOfYear("2017-08-12"), dayOfYear("0000-00-00"), dayOfYear("2017-00-00"), dayOfYear("0000-00-00 12:12:12"), dayOfYear("2017-00-00 12:12:12")`) result.Check(testkit.Rows("<nil> 224 <nil> <nil> <nil> <nil>")) result = tk.MustQuery(`select dayOfMonth(null), dayOfMonth("2017-08-12"), dayOfMonth("0000-00-00"), dayOfMonth("2017-00-00"), dayOfMonth("0000-00-00 12:12:12"), dayOfMonth("2017-00-00 12:12:12")`) result.Check(testkit.Rows("<nil> 12 <nil> 0 0 0")) tk.MustExec(`drop table if exists t`) tk.MustExec(`create table t(a bigint)`) tk.MustExec(`insert into t value(1)`) tk.MustExec("set sql_mode = 'STRICT_TRANS_TABLES'") _, err = tk.Exec("insert into t value(dayOfWeek('0000-00-00'))") c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue) _, err = tk.Exec(`update t set a = dayOfWeek("0000-00-00")`) c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue) _, err = tk.Exec(`delete from t where a = dayOfWeek(123)`) c.Assert(err, IsNil) _, err = tk.Exec("insert into t value(dayOfMonth('2017-00-00'))") c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue) tk.MustExec("insert into t value(dayOfMonth('0000-00-00'))") tk.MustExec(`update t set a = dayOfMonth("0000-00-00")`) tk.MustExec("set sql_mode = 'NO_ZERO_DATE';") tk.MustExec("insert into t value(dayOfMonth('0000-00-00'))") tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Incorrect datetime value: '0000-00-00 00:00:00.000000'")) tk.MustExec(`update t set a = dayOfMonth("0000-00-00")`) tk.MustExec("set sql_mode = 'NO_ZERO_DATE,STRICT_TRANS_TABLES';") _, err = tk.Exec("insert into t value(dayOfMonth('0000-00-00'))") c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue) tk.MustExec("insert into t value(0)") _, err = tk.Exec(`update t set a = dayOfMonth("0000-00-00")`) c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue) _, err = tk.Exec(`delete from t where a = dayOfMonth(123)`) c.Assert(err, IsNil) _, err = tk.Exec("insert into t value(dayOfYear('0000-00-00'))") c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue) _, err = tk.Exec(`update t set a = dayOfYear("0000-00-00")`) c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue) _, err = tk.Exec(`delete from t where a = dayOfYear(123)`) c.Assert(err, IsNil) tk.MustExec("set sql_mode = ''") // for unix_timestamp tk.MustExec("SET time_zone = '+00:00';") result = tk.MustQuery("SELECT UNIX_TIMESTAMP(151113);") result.Check(testkit.Rows("1447372800")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP(20151113);") result.Check(testkit.Rows("1447372800")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP(151113102019);") result.Check(testkit.Rows("1447410019")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP(151113102019e0);") result.Check(testkit.Rows("1447410019.000000")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP(15111310201912e-2);") result.Check(testkit.Rows("1447410019.120000")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP(151113102019.12);") result.Check(testkit.Rows("1447410019.12")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP(151113102019.1234567);") result.Check(testkit.Rows("1447410019.123457")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP(20151113102019);") result.Check(testkit.Rows("1447410019")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('2015-11-13 10:20:19');") result.Check(testkit.Rows("1447410019")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('2015-11-13 10:20:19.012');") result.Check(testkit.Rows("1447410019.012")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('1970-01-01 00:00:00');") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('1969-12-31 23:59:59');") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('1970-13-01 00:00:00');") // FIXME: MySQL returns 0 here. result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('2038-01-19 03:14:07.999999');") result.Check(testkit.Rows("2147483647.999999")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('2038-01-19 03:14:08');") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP(0);") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP(-1);") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP(12345);") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('2017-01-01')") result.Check(testkit.Rows("1483228800")) // Test different time zone. tk.MustExec("SET time_zone = '+08:00';") result = tk.MustQuery("SELECT UNIX_TIMESTAMP('1970-01-01 00:00:00');") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('1970-01-01 08:00:00');") result.Check(testkit.Rows("0")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('2015-11-13 18:20:19.012'), UNIX_TIMESTAMP('2015-11-13 18:20:19.0123');") result.Check(testkit.Rows("1447410019.012 1447410019.0123")) result = tk.MustQuery("SELECT UNIX_TIMESTAMP('2038-01-19 11:14:07.999999');") result.Check(testkit.Rows("2147483647.999999")) result = tk.MustQuery("SELECT TIME_FORMAT('bad string', '%H:%i:%s %p');") result.Check(testkit.Rows("00:00:00 AM")) result = tk.MustQuery("SELECT TIME_FORMAT(null, '%H:%i:%s %p');") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("SELECT TIME_FORMAT(123, '%H:%i:%s %p');") result.Check(testkit.Rows("00:01:23 AM")) // for monthname tk.MustExec(`drop table if exists t`) tk.MustExec(`create table t(a varchar(10))`) tk.MustExec(`insert into t value("abc")`) tk.MustExec("set sql_mode = 'STRICT_TRANS_TABLES'") tk.MustExec("insert into t value(monthname('0000-00-00'))") tk.MustExec(`update t set a = monthname("0000-00-00")`) tk.MustExec("set sql_mode = 'NO_ZERO_DATE'") tk.MustExec("insert into t value(monthname('0000-00-00'))") tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Incorrect datetime value: '0000-00-00 00:00:00.000000'")) tk.MustExec(`update t set a = monthname("0000-00-00")`) tk.MustExec("set sql_mode = ''") tk.MustExec("insert into t value(monthname('0000-00-00'))") tk.MustExec("set sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_DATE'") _, err = tk.Exec(`update t set a = monthname("0000-00-00")`) c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue) _, err = tk.Exec(`delete from t where a = monthname(123)`) c.Assert(err, IsNil) result = tk.MustQuery(`select monthname("2017-12-01"), monthname("0000-00-00"), monthname("0000-01-00"), monthname("0000-01-00 00:00:00")`) result.Check(testkit.Rows("December <nil> January January")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Incorrect datetime value: '0000-00-00 00:00:00.000000'")) // for dayname tk.MustExec(`drop table if exists t`) tk.MustExec(`create table t(a varchar(10))`) tk.MustExec(`insert into t value("abc")`) tk.MustExec("set sql_mode = 'STRICT_TRANS_TABLES'") _, err = tk.Exec("insert into t value(dayname('0000-00-00'))") c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue) _, err = tk.Exec(`update t set a = dayname("0000-00-00")`) c.Assert(types.ErrIncorrectDatetimeValue.Equal(err), IsTrue) _, err = tk.Exec(`delete from t where a = dayname(123)`) c.Assert(err, IsNil) result = tk.MustQuery(`select dayname("2017-12-01"), dayname("0000-00-00"), dayname("0000-01-00"), dayname("0000-01-00 00:00:00")`) result.Check(testkit.Rows("Friday <nil> <nil> <nil>")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Incorrect datetime value: '0000-00-00 00:00:00.000000'", "Warning|1292|Incorrect datetime value: '0000-01-00 00:00:00.000000'", "Warning|1292|Incorrect datetime value: '0000-01-00 00:00:00.000000'")) // for sec_to_time result = tk.MustQuery("select sec_to_time(NULL)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select sec_to_time(2378), sec_to_time(3864000), sec_to_time(-3864000)") result.Check(testkit.Rows("00:39:38 838:59:59 -838:59:59")) result = tk.MustQuery("select sec_to_time(86401.4), sec_to_time(-86401.4), sec_to_time(864014e-1), sec_to_time(-864014e-1), sec_to_time('86401.4'), sec_to_time('-86401.4')") result.Check(testkit.Rows("24:00:01.4 -24:00:01.4 24:00:01.400000 -24:00:01.400000 24:00:01.400000 -24:00:01.400000")) result = tk.MustQuery("select sec_to_time(86401.54321), sec_to_time(86401.543212345)") result.Check(testkit.Rows("24:00:01.54321 24:00:01.543212")) result = tk.MustQuery("select sec_to_time('123.4'), sec_to_time('123.4567891'), sec_to_time('123')") result.Check(testkit.Rows("00:02:03.400000 00:02:03.456789 00:02:03.000000")) // for time_to_sec result = tk.MustQuery("select time_to_sec(NULL)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select time_to_sec('22:23:00'), time_to_sec('00:39:38'), time_to_sec('23:00'), time_to_sec('00:00'), time_to_sec('00:00:00'), time_to_sec('23:59:59')") result.Check(testkit.Rows("80580 2378 82800 0 0 86399")) result = tk.MustQuery("select time_to_sec('1:0'), time_to_sec('1:00'), time_to_sec('1:0:0'), time_to_sec('-02:00'), time_to_sec('-02:00:05'), time_to_sec('020005')") result.Check(testkit.Rows("3600 3600 3600 -7200 -7205 7205")) result = tk.MustQuery("select time_to_sec('20171222020005'), time_to_sec(020005), time_to_sec(20171222020005), time_to_sec(171222020005)") result.Check(testkit.Rows("7205 7205 7205 7205")) // for str_to_date result = tk.MustQuery("select str_to_date('01-01-2017', '%d-%m-%Y'), str_to_date('59:20:12 01-01-2017', '%s:%i:%H %d-%m-%Y'), str_to_date('59:20:12', '%s:%i:%H')") result.Check(testkit.Rows("2017-01-01 2017-01-01 12:20:59 12:20:59")) result = tk.MustQuery("select str_to_date('aaa01-01-2017', 'aaa%d-%m-%Y'), str_to_date('59:20:12 aaa01-01-2017', '%s:%i:%H aaa%d-%m-%Y'), str_to_date('59:20:12aaa', '%s:%i:%Haaa')") result.Check(testkit.Rows("2017-01-01 2017-01-01 12:20:59 12:20:59")) result = tk.MustQuery("select str_to_date('01-01-2017', '%d'), str_to_date('59', '%d-%Y')") // TODO: MySQL returns "<nil> <nil>". result.Check(testkit.Rows("0000-00-01 <nil>")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Incorrect datetime value: '0000-00-00 00:00:00'")) result = tk.MustQuery("select str_to_date('2018-6-1', '%Y-%m-%d'), str_to_date('2018-6-1', '%Y-%c-%d'), str_to_date('59:20:1', '%s:%i:%k'), str_to_date('59:20:1', '%s:%i:%l')") result.Check(testkit.Rows("2018-06-01 2018-06-01 01:20:59 01:20:59")) // for maketime tk.MustExec(`drop table if exists t`) tk.MustExec(`create table t(a double, b float, c decimal(10,4));`) tk.MustExec(`insert into t value(1.23, 2.34, 3.1415)`) result = tk.MustQuery("select maketime(1,1,a), maketime(2,2,b), maketime(3,3,c) from t;") result.Check(testkit.Rows("01:01:01.230000 02:02:02.340000 03:03:03.1415")) result = tk.MustQuery("select maketime(12, 13, 14), maketime('12', '15', 30.1), maketime(0, 1, 59.1), maketime(0, 1, '59.1'), maketime(0, 1, 59.5)") result.Check(testkit.Rows("12:13:14 12:15:30.1 00:01:59.1 00:01:59.100000 00:01:59.5")) result = tk.MustQuery("select maketime(12, 15, 60), maketime(12, 15, '60'), maketime(12, 60, 0), maketime(12, 15, null)") result.Check(testkit.Rows("<nil> <nil> <nil> <nil>")) result = tk.MustQuery("select maketime('', '', ''), maketime('h', 'm', 's');") result.Check(testkit.Rows("00:00:00.000000 00:00:00.000000")) // for get_format result = tk.MustQuery(`select GET_FORMAT(DATE,'USA'), GET_FORMAT(DATE,'JIS'), GET_FORMAT(DATE,'ISO'), GET_FORMAT(DATE,'EUR'), GET_FORMAT(DATE,'INTERNAL'), GET_FORMAT(DATETIME,'USA') , GET_FORMAT(DATETIME,'JIS'), GET_FORMAT(DATETIME,'ISO'), GET_FORMAT(DATETIME,'EUR') , GET_FORMAT(DATETIME,'INTERNAL'), GET_FORMAT(TIME,'USA') , GET_FORMAT(TIME,'JIS'), GET_FORMAT(TIME,'ISO'), GET_FORMAT(TIME,'EUR'), GET_FORMAT(TIME,'INTERNAL')`) result.Check(testkit.Rows("%m.%d.%Y %Y-%m-%d %Y-%m-%d %d.%m.%Y %Y%m%d %Y-%m-%d %H.%i.%s %Y-%m-%d %H:%i:%s %Y-%m-%d %H:%i:%s %Y-%m-%d %H.%i.%s %Y%m%d%H%i%s %h:%i:%s %p %H:%i:%s %H:%i:%s %H.%i.%s %H%i%s")) // for convert_tz result = tk.MustQuery(`select convert_tz("2004-01-01 12:00:00", "+00:00", "+10:32"), convert_tz("2004-01-01 12:00:00.01", "+00:00", "+10:32"), convert_tz("2004-01-01 12:00:00.01234567", "+00:00", "+10:32");`) result.Check(testkit.Rows("2004-01-01 22:32:00 2004-01-01 22:32:00.01 2004-01-01 22:32:00.012346")) // TODO: release the following test after fix #4462 //result = tk.MustQuery(`select convert_tz(20040101, "+00:00", "+10:32"), convert_tz(20040101.01, "+00:00", "+10:32"), convert_tz(20040101.01234567, "+00:00", "+10:32");`) //result.Check(testkit.Rows("2004-01-01 10:32:00 2004-01-01 10:32:00.00 2004-01-01 10:32:00.000000")) // for from_unixtime tk.MustExec(`set @@session.time_zone = "+08:00"`) result = tk.MustQuery(`select from_unixtime(20170101), from_unixtime(20170101.9999999), from_unixtime(20170101.999), from_unixtime(20170101.999, "%Y %D %M %h:%i:%s %x"), from_unixtime(20170101.999, "%Y %D %M %h:%i:%s %x")`) result.Check(testkit.Rows("1970-08-22 18:48:21 1970-08-22 18:48:22.000000 1970-08-22 18:48:21.999 1970 22nd August 06:48:21 1970 1970 22nd August 06:48:21 1970")) tk.MustExec(`set @@session.time_zone = "+00:00"`) result = tk.MustQuery(`select from_unixtime(20170101), from_unixtime(20170101.9999999), from_unixtime(20170101.999), from_unixtime(20170101.999, "%Y %D %M %h:%i:%s %x"), from_unixtime(20170101.999, "%Y %D %M %h:%i:%s %x")`) result.Check(testkit.Rows("1970-08-22 10:48:21 1970-08-22 10:48:22.000000 1970-08-22 10:48:21.999 1970 22nd August 10:48:21 1970 1970 22nd August 10:48:21 1970")) tk.MustExec(`set @@session.time_zone = @@global.time_zone`) // for extract result = tk.MustQuery(`select extract(day from '800:12:12'), extract(hour from '800:12:12'), extract(month from 20170101), extract(day_second from '2017-01-01 12:12:12')`) result.Check(testkit.Rows("12 800 1 1121212")) // for adddate, subdate dateArithmeticalTests := []struct { Date string Interval string Unit string AddResult string SubResult string }{ {"\"2011-11-11\"", "1", "DAY", "2011-11-12", "2011-11-10"}, {"NULL", "1", "DAY", "<nil>", "<nil>"}, {"\"2011-11-11\"", "NULL", "DAY", "<nil>", "<nil>"}, {"\"2011-11-11 10:10:10\"", "1000", "MICROSECOND", "2011-11-11 10:10:10.001000", "2011-11-11 10:10:09.999000"}, {"\"2011-11-11 10:10:10\"", "\"10\"", "SECOND", "2011-11-11 10:10:20", "2011-11-11 10:10:00"}, {"\"2011-11-11 10:10:10\"", "\"10\"", "MINUTE", "2011-11-11 10:20:10", "2011-11-11 10:00:10"}, {"\"2011-11-11 10:10:10\"", "\"10\"", "HOUR", "2011-11-11 20:10:10", "2011-11-11 00:10:10"}, {"\"2011-11-11 10:10:10\"", "\"11\"", "DAY", "2011-11-22 10:10:10", "2011-10-31 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"2\"", "WEEK", "2011-11-25 10:10:10", "2011-10-28 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"2\"", "MONTH", "2012-01-11 10:10:10", "2011-09-11 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"4\"", "QUARTER", "2012-11-11 10:10:10", "2010-11-11 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"2\"", "YEAR", "2013-11-11 10:10:10", "2009-11-11 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"10.00100000\"", "SECOND_MICROSECOND", "2011-11-11 10:10:20.100000", "2011-11-11 10:09:59.900000"}, {"\"2011-11-11 10:10:10\"", "\"10.0010000000\"", "SECOND_MICROSECOND", "2011-11-11 10:10:30", "2011-11-11 10:09:50"}, {"\"2011-11-11 10:10:10\"", "\"10.0010000010\"", "SECOND_MICROSECOND", "2011-11-11 10:10:30.000010", "2011-11-11 10:09:49.999990"}, {"\"2011-11-11 10:10:10\"", "\"10:10.100\"", "MINUTE_MICROSECOND", "2011-11-11 10:20:20.100000", "2011-11-11 09:59:59.900000"}, {"\"2011-11-11 10:10:10\"", "\"10:10\"", "MINUTE_SECOND", "2011-11-11 10:20:20", "2011-11-11 10:00:00"}, {"\"2011-11-11 10:10:10\"", "\"10:10:10.100\"", "HOUR_MICROSECOND", "2011-11-11 20:20:20.100000", "2011-11-10 23:59:59.900000"}, {"\"2011-11-11 10:10:10\"", "\"10:10:10\"", "HOUR_SECOND", "2011-11-11 20:20:20", "2011-11-11 00:00:00"}, {"\"2011-11-11 10:10:10\"", "\"10:10\"", "HOUR_MINUTE", "2011-11-11 20:20:10", "2011-11-11 00:00:10"}, {"\"2011-11-11 10:10:10\"", "\"11 10:10:10.100\"", "DAY_MICROSECOND", "2011-11-22 20:20:20.100000", "2011-10-30 23:59:59.900000"}, {"\"2011-11-11 10:10:10\"", "\"11 10:10:10\"", "DAY_SECOND", "2011-11-22 20:20:20", "2011-10-31 00:00:00"}, {"\"2011-11-11 10:10:10\"", "\"11 10:10\"", "DAY_MINUTE", "2011-11-22 20:20:10", "2011-10-31 00:00:10"}, {"\"2011-11-11 10:10:10\"", "\"11 10\"", "DAY_HOUR", "2011-11-22 20:10:10", "2011-10-31 00:10:10"}, {"\"2011-11-11 10:10:10\"", "\"11-1\"", "YEAR_MONTH", "2022-12-11 10:10:10", "2000-10-11 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"11-11\"", "YEAR_MONTH", "2023-10-11 10:10:10", "1999-12-11 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"20\"", "DAY", "2011-12-01 10:10:10", "2011-10-22 10:10:10"}, {"\"2011-11-11 10:10:10\"", "19.88", "DAY", "2011-12-01 10:10:10", "2011-10-22 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"19.88\"", "DAY", "2011-11-30 10:10:10", "2011-10-23 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"prefix19suffix\"", "DAY", "2011-11-30 10:10:10", "2011-10-23 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"20-11\"", "DAY", "2011-12-01 10:10:10", "2011-10-22 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"20,11\"", "daY", "2011-12-01 10:10:10", "2011-10-22 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"1000\"", "dAy", "2014-08-07 10:10:10", "2009-02-14 10:10:10"}, {"\"2011-11-11 10:10:10\"", "\"true\"", "Day", "2011-11-12 10:10:10", "2011-11-10 10:10:10"}, {"\"2011-11-11 10:10:10\"", "true", "Day", "2011-11-12 10:10:10", "2011-11-10 10:10:10"}, {"\"2011-11-11\"", "1", "DAY", "2011-11-12", "2011-11-10"}, {"\"2011-11-11\"", "10", "HOUR", "2011-11-11 10:00:00", "2011-11-10 14:00:00"}, {"\"2011-11-11\"", "10", "MINUTE", "2011-11-11 00:10:00", "2011-11-10 23:50:00"}, {"\"2011-11-11\"", "10", "SECOND", "2011-11-11 00:00:10", "2011-11-10 23:59:50"}, {"\"2011-11-11\"", "\"10:10\"", "HOUR_MINUTE", "2011-11-11 10:10:00", "2011-11-10 13:50:00"}, {"\"2011-11-11\"", "\"10:10:10\"", "HOUR_SECOND", "2011-11-11 10:10:10", "2011-11-10 13:49:50"}, {"\"2011-11-11\"", "\"10:10:10.101010\"", "HOUR_MICROSECOND", "2011-11-11 10:10:10.101010", "2011-11-10 13:49:49.898990"}, {"\"2011-11-11\"", "\"10:10\"", "MINUTE_SECOND", "2011-11-11 00:10:10", "2011-11-10 23:49:50"}, {"\"2011-11-11\"", "\"10:10.101010\"", "MINUTE_MICROSECOND", "2011-11-11 00:10:10.101010", "2011-11-10 23:49:49.898990"}, {"\"2011-11-11\"", "\"10.101010\"", "SECOND_MICROSECOND", "2011-11-11 00:00:10.101010", "2011-11-10 23:59:49.898990"}, {"\"2011-11-11 00:00:00\"", "1", "DAY", "2011-11-12 00:00:00", "2011-11-10 00:00:00"}, {"\"2011-11-11 00:00:00\"", "10", "HOUR", "2011-11-11 10:00:00", "2011-11-10 14:00:00"}, {"\"2011-11-11 00:00:00\"", "10", "MINUTE", "2011-11-11 00:10:00", "2011-11-10 23:50:00"}, {"\"2011-11-11 00:00:00\"", "10", "SECOND", "2011-11-11 00:00:10", "2011-11-10 23:59:50"}, {"\"2011-11-11\"", "\"abc1000\"", "MICROSECOND", "<nil>", "<nil>"}, {"\"20111111 10:10:10\"", "\"1\"", "DAY", "<nil>", "<nil>"}, {"\"2011-11-11\"", "\"10\"", "SECOND_MICROSECOND", "<nil>", "<nil>"}, {"\"2011-11-11\"", "\"10.0000\"", "MINUTE_MICROSECOND", "<nil>", "<nil>"}, {"\"2011-11-11\"", "\"10:10:10\"", "MINUTE_MICROSECOND", "<nil>", "<nil>"}, {"cast(\"2011-11-11\" as datetime)", "\"10:10:10\"", "MINUTE_MICROSECOND", "<nil>", "<nil>"}, {"cast(\"2011-11-11 00:00:00\" as datetime)", "1", "DAY", "2011-11-12 00:00:00", "2011-11-10 00:00:00"}, {"cast(\"2011-11-11 00:00:00\" as datetime)", "10", "HOUR", "2011-11-11 10:00:00", "2011-11-10 14:00:00"}, {"cast(\"2011-11-11 00:00:00\" as datetime)", "10", "MINUTE", "2011-11-11 00:10:00", "2011-11-10 23:50:00"}, {"cast(\"2011-11-11 00:00:00\" as datetime)", "10", "SECOND", "2011-11-11 00:00:10", "2011-11-10 23:59:50"}, {"cast(\"2011-11-11 00:00:00\" as datetime)", "\"1\"", "DAY", "2011-11-12 00:00:00", "2011-11-10 00:00:00"}, {"cast(\"2011-11-11 00:00:00\" as datetime)", "\"10\"", "HOUR", "2011-11-11 10:00:00", "2011-11-10 14:00:00"}, {"cast(\"2011-11-11 00:00:00\" as datetime)", "\"10\"", "MINUTE", "2011-11-11 00:10:00", "2011-11-10 23:50:00"}, {"cast(\"2011-11-11 00:00:00\" as datetime)", "\"10\"", "SECOND", "2011-11-11 00:00:10", "2011-11-10 23:59:50"}, {"cast(\"2011-11-11\" as date)", "\"10:10:10\"", "MINUTE_MICROSECOND", "<nil>", "<nil>"}, {"cast(\"2011-11-11 00:00:00\" as date)", "1", "DAY", "2011-11-12", "2011-11-10"}, {"cast(\"2011-11-11 00:00:00\" as date)", "10", "HOUR", "2011-11-11 10:00:00", "2011-11-10 14:00:00"}, {"cast(\"2011-11-11 00:00:00\" as date)", "10", "MINUTE", "2011-11-11 00:10:00", "2011-11-10 23:50:00"}, {"cast(\"2011-11-11 00:00:00\" as date)", "10", "SECOND", "2011-11-11 00:00:10", "2011-11-10 23:59:50"}, {"cast(\"2011-11-11 00:00:00\" as date)", "\"1\"", "DAY", "2011-11-12", "2011-11-10"}, {"cast(\"2011-11-11 00:00:00\" as date)", "\"10\"", "HOUR", "2011-11-11 10:00:00", "2011-11-10 14:00:00"}, {"cast(\"2011-11-11 00:00:00\" as date)", "\"10\"", "MINUTE", "2011-11-11 00:10:00", "2011-11-10 23:50:00"}, {"cast(\"2011-11-11 00:00:00\" as date)", "\"10\"", "SECOND", "2011-11-11 00:00:10", "2011-11-10 23:59:50"}, // interval decimal support {"\"2011-01-01 00:00:00\"", "10.10", "YEAR_MONTH", "2021-11-01 00:00:00", "2000-03-01 00:00:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "DAY_HOUR", "2011-01-11 10:00:00", "2010-12-21 14:00:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "HOUR_MINUTE", "2011-01-01 10:10:00", "2010-12-31 13:50:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "DAY_MINUTE", "2011-01-01 10:10:00", "2010-12-31 13:50:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "DAY_SECOND", "2011-01-01 00:10:10", "2010-12-31 23:49:50"}, {"\"2011-01-01 00:00:00\"", "10.10", "HOUR_SECOND", "2011-01-01 00:10:10", "2010-12-31 23:49:50"}, {"\"2011-01-01 00:00:00\"", "10.10", "MINUTE_SECOND", "2011-01-01 00:10:10", "2010-12-31 23:49:50"}, {"\"2011-01-01 00:00:00\"", "10.10", "DAY_MICROSECOND", "2011-01-01 00:00:10.100000", "2010-12-31 23:59:49.900000"}, {"\"2011-01-01 00:00:00\"", "10.10", "HOUR_MICROSECOND", "2011-01-01 00:00:10.100000", "2010-12-31 23:59:49.900000"}, {"\"2011-01-01 00:00:00\"", "10.10", "MINUTE_MICROSECOND", "2011-01-01 00:00:10.100000", "2010-12-31 23:59:49.900000"}, {"\"2011-01-01 00:00:00\"", "10.10", "SECOND_MICROSECOND", "2011-01-01 00:00:10.100000", "2010-12-31 23:59:49.900000"}, {"\"2011-01-01 00:00:00\"", "10.10", "YEAR", "2021-01-01 00:00:00", "2001-01-01 00:00:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "QUARTER", "2013-07-01 00:00:00", "2008-07-01 00:00:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "MONTH", "2011-11-01 00:00:00", "2010-03-01 00:00:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "WEEK", "2011-03-12 00:00:00", "2010-10-23 00:00:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "DAY", "2011-01-11 00:00:00", "2010-12-22 00:00:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "HOUR", "2011-01-01 10:00:00", "2010-12-31 14:00:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "MINUTE", "2011-01-01 00:10:00", "2010-12-31 23:50:00"}, {"\"2011-01-01 00:00:00\"", "10.10", "SECOND", "2011-01-01 00:00:10.100000", "2010-12-31 23:59:49.900000"}, {"\"2011-01-01 00:00:00\"", "10.10", "MICROSECOND", "2011-01-01 00:00:00.000010", "2010-12-31 23:59:59.999990"}, {"\"2011-01-01 00:00:00\"", "10.90", "MICROSECOND", "2011-01-01 00:00:00.000011", "2010-12-31 23:59:59.999989"}, {"\"2009-01-01\"", "6/4", "HOUR_MINUTE", "2009-01-04 12:20:00", "2008-12-28 11:40:00"}, {"\"2009-01-01\"", "6/0", "HOUR_MINUTE", "<nil>", "<nil>"}, {"\"1970-01-01 12:00:00\"", "CAST(6/4 AS DECIMAL(3,1))", "HOUR_MINUTE", "1970-01-01 13:05:00", "1970-01-01 10:55:00"}, //for issue #8077 {"\"2012-01-02\"", "\"prefix8\"", "HOUR", "2012-01-02 08:00:00", "2012-01-01 16:00:00"}, {"\"2012-01-02\"", "\"prefix8prefix\"", "HOUR", "2012-01-02 08:00:00", "2012-01-01 16:00:00"}, {"\"2012-01-02\"", "\"8:00\"", "HOUR", "2012-01-02 08:00:00", "2012-01-01 16:00:00"}, {"\"2012-01-02\"", "\"8:00:00\"", "HOUR", "2012-01-02 08:00:00", "2012-01-01 16:00:00"}, } for _, tc := range dateArithmeticalTests { addDate := fmt.Sprintf("select adddate(%s, interval %s %s);", tc.Date, tc.Interval, tc.Unit) subDate := fmt.Sprintf("select subdate(%s, interval %s %s);", tc.Date, tc.Interval, tc.Unit) result = tk.MustQuery(addDate) result.Check(testkit.Rows(tc.AddResult)) result = tk.MustQuery(subDate) result.Check(testkit.Rows(tc.SubResult)) } // for localtime, localtimestamp result = tk.MustQuery(`select localtime() = now(), localtime = now(), localtimestamp() = now(), localtimestamp = now()`) result.Check(testkit.Rows("1 1 1 1")) // for current_timestamp, current_timestamp() result = tk.MustQuery(`select current_timestamp() = now(), current_timestamp = now()`) result.Check(testkit.Rows("1 1")) // for tidb_parse_tso tk.MustExec("SET time_zone = '+00:00';") result = tk.MustQuery(`select tidb_parse_tso(404411537129996288)`) result.Check(testkit.Rows("2018-11-20 09:53:04.877000")) result = tk.MustQuery(`select tidb_parse_tso("404411537129996288")`) result.Check(testkit.Rows("2018-11-20 09:53:04.877000")) result = tk.MustQuery(`select tidb_parse_tso(1)`) result.Check(testkit.Rows("1970-01-01 00:00:00.000000")) result = tk.MustQuery(`select tidb_parse_tso(0)`) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery(`select tidb_parse_tso(-1)`) result.Check(testkit.Rows("<nil>")) } func (s *testIntegrationSuite) TestOpBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") // for logicAnd result := tk.MustQuery("select 1 && 1, 1 && 0, 0 && 1, 0 && 0, 2 && -1, null && 1, '1a' && 'a'") result.Check(testkit.Rows("1 0 0 0 1 <nil> 0")) // for bitNeg result = tk.MustQuery("select ~123, ~-123, ~null") result.Check(testkit.Rows("18446744073709551492 122 <nil>")) // for logicNot result = tk.MustQuery("select !1, !123, !0, !null") result.Check(testkit.Rows("0 0 1 <nil>")) // for logicalXor result = tk.MustQuery("select 1 xor 1, 1 xor 0, 0 xor 1, 0 xor 0, 2 xor -1, null xor 1, '1a' xor 'a'") result.Check(testkit.Rows("0 1 1 0 0 <nil> 1")) // for bitAnd result = tk.MustQuery("select 123 & 321, -123 & 321, null & 1") result.Check(testkit.Rows("65 257 <nil>")) // for bitOr result = tk.MustQuery("select 123 | 321, -123 | 321, null | 1") result.Check(testkit.Rows("379 18446744073709551557 <nil>")) // for bitXor result = tk.MustQuery("select 123 ^ 321, -123 ^ 321, null ^ 1") result.Check(testkit.Rows("314 18446744073709551300 <nil>")) // for leftShift result = tk.MustQuery("select 123 << 2, -123 << 2, null << 1") result.Check(testkit.Rows("492 18446744073709551124 <nil>")) // for rightShift result = tk.MustQuery("select 123 >> 2, -123 >> 2, null >> 1") result.Check(testkit.Rows("30 4611686018427387873 <nil>")) // for logicOr result = tk.MustQuery("select 1 || 1, 1 || 0, 0 || 1, 0 || 0, 2 || -1, null || 1, '1a' || 'a'") result.Check(testkit.Rows("1 1 1 0 1 1 1")) // for unaryPlus result = tk.MustQuery(`select +1, +0, +(-9), +(-0.001), +0.999, +null, +"aaa"`) result.Check(testkit.Rows("1 0 -9 -0.001 0.999 <nil> aaa")) } func (s *testIntegrationSuite) TestBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") ctx := context.Background() // for is true && is false tk.MustExec("drop table if exists t") tk.MustExec("create table t (a int, b int, index idx_b (b))") tk.MustExec("insert t values (1, 1)") tk.MustExec("insert t values (2, 2)") tk.MustExec("insert t values (3, 2)") result := tk.MustQuery("select * from t where b is true") result.Check(testkit.Rows("1 1", "2 2", "3 2")) result = tk.MustQuery("select all + a from t where a = 1") result.Check(testkit.Rows("1")) result = tk.MustQuery("select * from t where a is false") result.Check(nil) result = tk.MustQuery("select * from t where a is not true") result.Check(nil) result = tk.MustQuery(`select 1 is true, 0 is true, null is true, "aaa" is true, "" is true, -12.00 is true, 0.0 is true, 0.0000001 is true;`) result.Check(testkit.Rows("1 0 0 0 0 1 0 1")) result = tk.MustQuery(`select 1 is false, 0 is false, null is false, "aaa" is false, "" is false, -12.00 is false, 0.0 is false, 0.0000001 is false;`) result.Check(testkit.Rows("0 1 0 1 1 0 1 0")) // for in result = tk.MustQuery("select * from t where b in (a)") result.Check(testkit.Rows("1 1", "2 2")) result = tk.MustQuery("select * from t where b not in (a)") result.Check(testkit.Rows("3 2")) // test cast result = tk.MustQuery("select cast(1 as decimal(3,2))") result.Check(testkit.Rows("1.00")) result = tk.MustQuery("select cast('1991-09-05 11:11:11' as datetime)") result.Check(testkit.Rows("1991-09-05 11:11:11")) result = tk.MustQuery("select cast(cast('1991-09-05 11:11:11' as datetime) as char)") result.Check(testkit.Rows("1991-09-05 11:11:11")) result = tk.MustQuery("select cast('11:11:11' as time)") result.Check(testkit.Rows("11:11:11")) result = tk.MustQuery("select * from t where a > cast(2 as decimal)") result.Check(testkit.Rows("3 2")) result = tk.MustQuery("select cast(-1 as unsigned)") result.Check(testkit.Rows("18446744073709551615")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a decimal(3, 1), b double, c datetime, d time, e int)") tk.MustExec("insert into t value(12.3, 1.23, '2017-01-01 12:12:12', '12:12:12', 123)") result = tk.MustQuery("select cast(a as json), cast(b as json), cast(c as json), cast(d as json), cast(e as json) from t") result.Check(testkit.Rows(`12.3 1.23 "2017-01-01 12:12:12.000000" "12:12:12.000000" 123`)) result = tk.MustQuery(`select cast(10101000000 as time);`) result.Check(testkit.Rows("00:00:00")) result = tk.MustQuery(`select cast(10101001000 as time);`) result.Check(testkit.Rows("00:10:00")) result = tk.MustQuery(`select cast(10000000000 as time);`) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery(`select cast(20171222020005 as time);`) result.Check(testkit.Rows("02:00:05")) result = tk.MustQuery(`select cast(8380000 as time);`) result.Check(testkit.Rows("838:00:00")) result = tk.MustQuery(`select cast(8390000 as time);`) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery(`select cast(8386000 as time);`) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery(`select cast(8385960 as time);`) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery(`select cast(cast('2017-01-01 01:01:11.12' as date) as datetime(2));`) result.Check(testkit.Rows("2017-01-01 00:00:00.00")) result = tk.MustQuery(`select cast(20170118.999 as datetime);`) result.Check(testkit.Rows("2017-01-18 00:00:00")) // Test corner cases of cast string as datetime result = tk.MustQuery(`select cast("170102034" as datetime);`) result.Check(testkit.Rows("2017-01-02 03:04:00")) result = tk.MustQuery(`select cast("1701020304" as datetime);`) result.Check(testkit.Rows("2017-01-02 03:04:00")) result = tk.MustQuery(`select cast("1701020304." as datetime);`) result.Check(testkit.Rows("2017-01-02 03:04:00")) result = tk.MustQuery(`select cast("1701020304.1" as datetime);`) result.Check(testkit.Rows("2017-01-02 03:04:01")) result = tk.MustQuery(`select cast("1701020304.111" as datetime);`) result.Check(testkit.Rows("2017-01-02 03:04:11")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1292 Truncated incorrect datetime value: '1701020304.111'")) result = tk.MustQuery(`select cast("17011" as datetime);`) result.Check(testkit.Rows("2017-01-01 00:00:00")) result = tk.MustQuery(`select cast("150101." as datetime);`) result.Check(testkit.Rows("2015-01-01 00:00:00")) result = tk.MustQuery(`select cast("150101.a" as datetime);`) result.Check(testkit.Rows("2015-01-01 00:00:00")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1292 Truncated incorrect datetime value: '150101.a'")) result = tk.MustQuery(`select cast("150101.1a" as datetime);`) result.Check(testkit.Rows("2015-01-01 01:00:00")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1292 Truncated incorrect datetime value: '150101.1a'")) result = tk.MustQuery(`select cast("150101.1a1" as datetime);`) result.Check(testkit.Rows("2015-01-01 01:00:00")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1292 Truncated incorrect datetime value: '150101.1a1'")) result = tk.MustQuery(`select cast("1101010101.111" as datetime);`) result.Check(testkit.Rows("2011-01-01 01:01:11")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1292 Truncated incorrect datetime value: '1101010101.111'")) result = tk.MustQuery(`select cast("1101010101.11aaaaa" as datetime);`) result.Check(testkit.Rows("2011-01-01 01:01:11")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1292 Truncated incorrect datetime value: '1101010101.11aaaaa'")) result = tk.MustQuery(`select cast("1101010101.a1aaaaa" as datetime);`) result.Check(testkit.Rows("2011-01-01 01:01:00")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1292 Truncated incorrect datetime value: '1101010101.a1aaaaa'")) result = tk.MustQuery(`select cast("1101010101.11" as datetime);`) result.Check(testkit.Rows("2011-01-01 01:01:11")) tk.MustQuery("select @@warning_count;").Check(testkit.Rows("0")) result = tk.MustQuery(`select cast("1101010101.111" as datetime);`) result.Check(testkit.Rows("2011-01-01 01:01:11")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1292 Truncated incorrect datetime value: '1101010101.111'")) result = tk.MustQuery(`select cast("970101.111" as datetime);`) result.Check(testkit.Rows("1997-01-01 11:01:00")) tk.MustQuery("select @@warning_count;").Check(testkit.Rows("0")) result = tk.MustQuery(`select cast("970101.11111" as datetime);`) result.Check(testkit.Rows("1997-01-01 11:11:01")) tk.MustQuery("select @@warning_count;").Check(testkit.Rows("0")) result = tk.MustQuery(`select cast("970101.111a1" as datetime);`) result.Check(testkit.Rows("1997-01-01 11:01:00")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1292 Truncated incorrect datetime value: '970101.111a1'")) // for ISNULL tk.MustExec("drop table if exists t") tk.MustExec("create table t (a int, b int, c int, d char(10), e datetime, f float, g decimal(10, 3))") tk.MustExec("insert t values (1, 0, null, null, null, null, null)") result = tk.MustQuery("select ISNULL(a), ISNULL(b), ISNULL(c), ISNULL(d), ISNULL(e), ISNULL(f), ISNULL(g) from t") result.Check(testkit.Rows("0 0 1 1 1 1 1")) // fix issue #3942 result = tk.MustQuery("select cast('-24 100:00:00' as time);") result.Check(testkit.Rows("-676:00:00")) result = tk.MustQuery("select cast('12:00:00.000000' as datetime);") result.Check(testkit.Rows("2012-00-00 00:00:00")) result = tk.MustQuery("select cast('-34 100:00:00' as time);") result.Check(testkit.Rows("-838:59:59")) // fix issue #4324. cast decimal/int/string to time compatibility. invalidTimes := []string{ "10009010", "239010", "233070", "23:90:10", "23:30:70", "239010.2", "233070.8", } tk.MustExec("DROP TABLE IF EXISTS t;") tk.MustExec("CREATE TABLE t (ix TIME);") tk.MustExec("SET SQL_MODE='';") for _, invalidTime := range invalidTimes { msg := fmt.Sprintf("Warning 1292 Truncated incorrect time value: '%s'", invalidTime) result = tk.MustQuery(fmt.Sprintf("select cast('%s' as time);", invalidTime)) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("show warnings") result.Check(testkit.Rows(msg)) _, err := tk.Exec(fmt.Sprintf("insert into t select cast('%s' as time);", invalidTime)) c.Assert(err, IsNil) result = tk.MustQuery("show warnings") result.Check(testkit.Rows(msg)) } tk.MustExec("set sql_mode = 'STRICT_TRANS_TABLES'") for _, invalidTime := range invalidTimes { msg := fmt.Sprintf("Warning 1292 Truncated incorrect time value: '%s'", invalidTime) result = tk.MustQuery(fmt.Sprintf("select cast('%s' as time);", invalidTime)) result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("show warnings") result.Check(testkit.Rows(msg)) _, err := tk.Exec(fmt.Sprintf("insert into t select cast('%s' as time);", invalidTime)) c.Assert(err.Error(), Equals, fmt.Sprintf("[types:1292]Truncated incorrect time value: '%s'", invalidTime)) } // Fix issue #3691, cast compatibility. result = tk.MustQuery("select cast('18446744073709551616' as unsigned);") result.Check(testkit.Rows("18446744073709551615")) result = tk.MustQuery("select cast('18446744073709551616' as signed);") result.Check(testkit.Rows("-1")) result = tk.MustQuery("select cast('9223372036854775808' as signed);") result.Check(testkit.Rows("-9223372036854775808")) result = tk.MustQuery("select cast('9223372036854775809' as signed);") result.Check(testkit.Rows("-9223372036854775807")) result = tk.MustQuery("select cast('9223372036854775807' as signed);") result.Check(testkit.Rows("9223372036854775807")) result = tk.MustQuery("select cast('18446744073709551615' as signed);") result.Check(testkit.Rows("-1")) result = tk.MustQuery("select cast('18446744073709551614' as signed);") result.Check(testkit.Rows("-2")) result = tk.MustQuery("select cast(18446744073709551615 as unsigned);") result.Check(testkit.Rows("18446744073709551615")) result = tk.MustQuery("select cast(18446744073709551616 as unsigned);") result.Check(testkit.Rows("18446744073709551615")) result = tk.MustQuery("select cast(18446744073709551616 as signed);") result.Check(testkit.Rows("9223372036854775807")) result = tk.MustQuery("select cast(18446744073709551617 as signed);") result.Check(testkit.Rows("9223372036854775807")) result = tk.MustQuery("select cast(18446744073709551615 as signed);") result.Check(testkit.Rows("-1")) result = tk.MustQuery("select cast(18446744073709551614 as signed);") result.Check(testkit.Rows("-2")) result = tk.MustQuery("select cast(-18446744073709551616 as signed);") result.Check(testkit.Rows("-9223372036854775808")) result = tk.MustQuery("select cast(18446744073709551614.9 as unsigned);") // Round up result.Check(testkit.Rows("18446744073709551615")) result = tk.MustQuery("select cast(18446744073709551614.4 as unsigned);") // Round down result.Check(testkit.Rows("18446744073709551614")) result = tk.MustQuery("select cast(-9223372036854775809 as signed);") result.Check(testkit.Rows("-9223372036854775808")) result = tk.MustQuery("select cast(-9223372036854775809 as unsigned);") result.Check(testkit.Rows("0")) result = tk.MustQuery("select cast(-9223372036854775808 as unsigned);") result.Check(testkit.Rows("9223372036854775808")) result = tk.MustQuery("select cast('-9223372036854775809' as unsigned);") result.Check(testkit.Rows("9223372036854775808")) result = tk.MustQuery("select cast('-9223372036854775807' as unsigned);") result.Check(testkit.Rows("9223372036854775809")) result = tk.MustQuery("select cast('-2' as unsigned);") result.Check(testkit.Rows("18446744073709551614")) result = tk.MustQuery("select cast(cast(1-2 as unsigned) as signed integer);") result.Check(testkit.Rows("-1")) result = tk.MustQuery("select cast(1 as signed int)") result.Check(testkit.Rows("1")) // test cast time as decimal overflow tk.MustExec("drop table if exists t1") tk.MustExec("create table t1(s1 time);") tk.MustExec("insert into t1 values('11:11:11');") result = tk.MustQuery("select cast(s1 as decimal(7, 2)) from t1;") result.Check(testkit.Rows("99999.99")) result = tk.MustQuery("select cast(s1 as decimal(8, 2)) from t1;") result.Check(testkit.Rows("111111.00")) _, err := tk.Exec("insert into t1 values(cast('111111.00' as decimal(7, 2)));") c.Assert(err, NotNil) result = tk.MustQuery(`select CAST(0x8fffffffffffffff as signed) a, CAST(0xfffffffffffffffe as signed) b, CAST(0xffffffffffffffff as unsigned) c;`) result.Check(testkit.Rows("-8070450532247928833 -2 18446744073709551615")) result = tk.MustQuery(`select cast("1:2:3" as TIME) = "1:02:03"`) result.Check(testkit.Rows("0")) // fixed issue #3471 tk.MustExec("drop table if exists t") tk.MustExec("create table t(a time(6));") tk.MustExec("insert into t value('12:59:59.999999')") result = tk.MustQuery("select cast(a as signed) from t") result.Check(testkit.Rows("130000")) // fixed issue #3762 result = tk.MustQuery("select -9223372036854775809;") result.Check(testkit.Rows("-9223372036854775809")) result = tk.MustQuery("select --9223372036854775809;") result.Check(testkit.Rows("9223372036854775809")) result = tk.MustQuery("select -9223372036854775808;") result.Check(testkit.Rows("-9223372036854775808")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a bigint(30));") _, err = tk.Exec("insert into t values(-9223372036854775809)") c.Assert(err, NotNil) // test case decimal precision less than the scale. rs, err := tk.Exec("select cast(12.1 as decimal(3, 4));") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "[types:1427]For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '').") c.Assert(rs.Close(), IsNil) // test unhex and hex result = tk.MustQuery("select unhex('4D7953514C')") result.Check(testkit.Rows("MySQL")) result = tk.MustQuery("select unhex(hex('string'))") result.Check(testkit.Rows("string")) result = tk.MustQuery("select unhex('ggg')") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select unhex(-1)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select hex(unhex('1267'))") result.Check(testkit.Rows("1267")) result = tk.MustQuery("select hex(unhex(1267))") result.Check(testkit.Rows("1267")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a binary(8))") tk.MustExec(`insert into t values('test')`) result = tk.MustQuery("select hex(a) from t") result.Check(testkit.Rows("7465737400000000")) result = tk.MustQuery("select unhex(a) from t") result.Check(testkit.Rows("<nil>")) // select from_unixtime result = tk.MustQuery("select from_unixtime(1451606400)") unixTime := time.Unix(1451606400, 0).String()[:19] result.Check(testkit.Rows(unixTime)) result = tk.MustQuery("select from_unixtime(1451606400.123456)") unixTime = time.Unix(1451606400, 123456000).String()[:26] result.Check(testkit.Rows(unixTime)) result = tk.MustQuery("select from_unixtime(1451606400.1234567)") unixTime = time.Unix(1451606400, 123456700).Round(time.Microsecond).Format("2006-01-02 15:04:05.000000")[:26] result.Check(testkit.Rows(unixTime)) result = tk.MustQuery("select from_unixtime(1451606400.999999)") unixTime = time.Unix(1451606400, 999999000).String()[:26] result.Check(testkit.Rows(unixTime)) result = tk.MustQuery("select from_unixtime(1511247196661)") result.Check(testkit.Rows("<nil>")) // test strcmp result = tk.MustQuery("select strcmp('abc', 'def')") result.Check(testkit.Rows("-1")) result = tk.MustQuery("select strcmp('abc', 'aba')") result.Check(testkit.Rows("1")) result = tk.MustQuery("select strcmp('abc', 'abc')") result.Check(testkit.Rows("0")) result = tk.MustQuery("select substr(null, 1, 2)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select substr('123', null, 2)") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select substr('123', 1, null)") result.Check(testkit.Rows("<nil>")) // for case tk.MustExec("drop table if exists t") tk.MustExec("create table t (a varchar(255), b int)") tk.MustExec("insert t values ('str1', 1)") result = tk.MustQuery("select * from t where a = case b when 1 then 'str1' when 2 then 'str2' end") result.Check(testkit.Rows("str1 1")) result = tk.MustQuery("select * from t where a = case b when 1 then 'str2' when 2 then 'str3' end") result.Check(nil) tk.MustExec("insert t values ('str2', 2)") result = tk.MustQuery("select * from t where a = case b when 2 then 'str2' when 3 then 'str3' end") result.Check(testkit.Rows("str2 2")) tk.MustExec("insert t values ('str3', 3)") result = tk.MustQuery("select * from t where a = case b when 4 then 'str4' when 5 then 'str5' else 'str3' end") result.Check(testkit.Rows("str3 3")) result = tk.MustQuery("select * from t where a = case b when 4 then 'str4' when 5 then 'str5' else 'str6' end") result.Check(nil) result = tk.MustQuery("select * from t where a = case when b then 'str3' when 1 then 'str1' else 'str2' end") result.Check(testkit.Rows("str3 3")) tk.MustExec("delete from t") tk.MustExec("insert t values ('str2', 0)") result = tk.MustQuery("select * from t where a = case when b then 'str3' when 0 then 'str1' else 'str2' end") result.Check(testkit.Rows("str2 0")) tk.MustExec("insert t values ('str1', null)") result = tk.MustQuery("select * from t where a = case b when null then 'str3' when 10 then 'str1' else 'str2' end") result.Check(testkit.Rows("str2 0")) result = tk.MustQuery("select * from t where a = case null when b then 'str3' when 10 then 'str1' else 'str2' end") result.Check(testkit.Rows("str2 0")) tk.MustExec("insert t values (null, 4)") result = tk.MustQuery("select * from t where b < case a when null then 0 when 'str2' then 0 else 9 end") result.Check(testkit.Rows("<nil> 4")) result = tk.MustQuery("select * from t where b = case when a is null then 4 when a = 'str5' then 7 else 9 end") result.Check(testkit.Rows("<nil> 4")) // for cast result = tk.MustQuery("select cast(1234 as char(3))") result.Check(testkit.Rows("123")) result = tk.MustQuery("select cast(1234 as char(0))") result.Check(testkit.Rows("")) result = tk.MustQuery("show warnings") result.Check(testkit.Rows("Warning 1406 Data Too Long, field len 0, data len 4")) result = tk.MustQuery("select CAST( - 8 AS DECIMAL ) * + 52 + 87 < - 86") result.Check(testkit.Rows("1")) // for char result = tk.MustQuery("select char(97, 100, 256, 89)") result.Check(testkit.Rows("ad\x01\x00Y")) result = tk.MustQuery("select char(97, null, 100, 256, 89)") result.Check(testkit.Rows("ad\x01\x00Y")) result = tk.MustQuery("select char(97, null, 100, 256, 89 using utf8)") result.Check(testkit.Rows("ad\x01\x00Y")) result = tk.MustQuery("select char(97, null, 100, 256, 89 using ascii)") result.Check(testkit.Rows("ad\x01\x00Y")) charRecordSet, err := tk.Exec("select char(97, null, 100, 256, 89 using tidb)") c.Assert(err, IsNil) c.Assert(charRecordSet, NotNil) _, err = session.GetRows4Test(ctx, tk.Se, charRecordSet) c.Assert(err.Error(), Equals, "unknown encoding: tidb") // issue 3884 tk.MustExec("drop table if exists t") tk.MustExec("CREATE TABLE t (c1 date, c2 datetime, c3 timestamp, c4 time, c5 year);") tk.MustExec("INSERT INTO t values ('2000-01-01', '2000-01-01 12:12:12', '2000-01-01 12:12:12', '12:12:12', '2000');") tk.MustExec("INSERT INTO t values ('2000-02-01', '2000-02-01 12:12:12', '2000-02-01 12:12:12', '13:12:12', 2000);") tk.MustExec("INSERT INTO t values ('2000-03-01', '2000-03-01', '2000-03-01 12:12:12', '1 12:12:12', 2000);") tk.MustExec("INSERT INTO t SET c1 = '2000-04-01', c2 = '2000-04-01', c3 = '2000-04-01 12:12:12', c4 = '-1 13:12:12', c5 = 2000;") result = tk.MustQuery("SELECT c4 FROM t where c4 < '-13:12:12';") result.Check(testkit.Rows("-37:12:12")) result = tk.MustQuery(`SELECT 1 DIV - - 28 + ( - SUM( - + 25 ) ) * - CASE - 18 WHEN 44 THEN NULL ELSE - 41 + 32 + + - 70 - + COUNT( - 95 ) * 15 END + 92`) result.Check(testkit.Rows("2442")) // for regexp, rlike // https://github.com/pingcap/tidb/issues/4080 tk.MustExec(`drop table if exists t;`) tk.MustExec(`create table t (a char(10), b varchar(10), c binary(10), d varbinary(10));`) tk.MustExec(`insert into t values ('text','text','text','text');`) result = tk.MustQuery(`select a regexp 'Xt' from t;`) result.Check(testkit.Rows("1")) result = tk.MustQuery(`select b regexp 'Xt' from t;`) result.Check(testkit.Rows("1")) result = tk.MustQuery(`select c regexp 'Xt' from t;`) result.Check(testkit.Rows("0")) result = tk.MustQuery(`select d regexp 'Xt' from t;`) result.Check(testkit.Rows("0")) result = tk.MustQuery(`select a rlike 'Xt' from t;`) result.Check(testkit.Rows("1")) result = tk.MustQuery(`select b rlike 'Xt' from t;`) result.Check(testkit.Rows("1")) result = tk.MustQuery(`select c rlike 'Xt' from t;`) result.Check(testkit.Rows("0")) result = tk.MustQuery(`select d rlike 'Xt' from t;`) result.Check(testkit.Rows("0")) // testCase is for like and regexp type testCase struct { pattern string val string result int } patternMatching := func(c *C, tk *testkit.TestKit, queryOp string, data []testCase) { tk.MustExec("drop table if exists t") tk.MustExec("create table t (a varchar(255), b int)") for i, d := range data { tk.MustExec(fmt.Sprintf("insert into t values('%s', %d)", d.val, i)) result = tk.MustQuery(fmt.Sprintf("select * from t where a %s '%s'", queryOp, d.pattern)) if d.result == 1 { rowStr := fmt.Sprintf("%s %d", d.val, i) result.Check(testkit.Rows(rowStr)) } else { result.Check(nil) } tk.MustExec(fmt.Sprintf("delete from t where b = %d", i)) } } // for like likeTests := []testCase{ {"a", "a", 1}, {"a", "b", 0}, {"aA", "Aa", 0}, {`aA%`, "aAab", 1}, {"aA_", "Aaab", 0}, {"Aa_", "Aab", 1}, {"", "", 1}, {"", "a", 0}, } patternMatching(c, tk, "like", likeTests) // for regexp likeTests = []testCase{ {"^$", "a", 0}, {"a", "a", 1}, {"a", "b", 0}, {"aA", "aA", 1}, {".", "a", 1}, {"^.$", "ab", 0}, {"..", "b", 0}, {".ab", "aab", 1}, {"ab.", "abcd", 1}, {".*", "abcd", 1}, } patternMatching(c, tk, "regexp", likeTests) } func (s *testIntegrationSuite) TestInfoBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") // for last_insert_id tk.MustExec("drop table if exists t") tk.MustExec("create table t (id int auto_increment, a int, PRIMARY KEY (id))") tk.MustExec("insert into t(a) values(1)") result := tk.MustQuery("select last_insert_id();") result.Check(testkit.Rows("1")) tk.MustExec("insert into t values(2, 1)") result = tk.MustQuery("select last_insert_id();") result.Check(testkit.Rows("1")) tk.MustExec("insert into t(a) values(1)") result = tk.MustQuery("select last_insert_id();") result.Check(testkit.Rows("3")) result = tk.MustQuery("select last_insert_id(5);") result.Check(testkit.Rows("5")) result = tk.MustQuery("select last_insert_id();") result.Check(testkit.Rows("5")) // for found_rows tk.MustExec("drop table if exists t") tk.MustExec("create table t (a int)") tk.MustQuery("select * from t") // Test XSelectTableExec result = tk.MustQuery("select found_rows()") result.Check(testkit.Rows("0")) result = tk.MustQuery("select found_rows()") result.Check(testkit.Rows("1")) // Last query is found_rows(), it returns 1 row with value 0 tk.MustExec("insert t values (1),(2),(2)") tk.MustQuery("select * from t") result = tk.MustQuery("select found_rows()") result.Check(testkit.Rows("3")) tk.MustQuery("select * from t where a = 0") result = tk.MustQuery("select found_rows()") result.Check(testkit.Rows("0")) tk.MustQuery("select * from t where a = 1") result = tk.MustQuery("select found_rows()") result.Check(testkit.Rows("1")) tk.MustQuery("select * from t where a like '2'") // Test SelectionExec result = tk.MustQuery("select found_rows()") result.Check(testkit.Rows("2")) tk.MustQuery("show tables like 't'") result = tk.MustQuery("select found_rows()") result.Check(testkit.Rows("1")) tk.MustQuery("select count(*) from t") // Test ProjectionExec result = tk.MustQuery("select found_rows()") result.Check(testkit.Rows("1")) // for database result = tk.MustQuery("select database()") result.Check(testkit.Rows("test")) tk.MustExec("drop database test") result = tk.MustQuery("select database()") result.Check(testkit.Rows("<nil>")) tk.MustExec("create database test") tk.MustExec("use test") // for current_user sessionVars := tk.Se.GetSessionVars() originUser := sessionVars.User sessionVars.User = &auth.UserIdentity{Username: "root", Hostname: "localhost", AuthUsername: "root", AuthHostname: "127.0.%%"} result = tk.MustQuery("select current_user()") result.Check(testkit.Rows("[email protected].%%")) sessionVars.User = originUser // for user sessionVars.User = &auth.UserIdentity{Username: "root", Hostname: "localhost", AuthUsername: "root", AuthHostname: "127.0.%%"} result = tk.MustQuery("select user()") result.Check(testkit.Rows("root@localhost")) sessionVars.User = originUser // for connection_id originConnectionID := sessionVars.ConnectionID sessionVars.ConnectionID = uint64(1) result = tk.MustQuery("select connection_id()") result.Check(testkit.Rows("1")) sessionVars.ConnectionID = originConnectionID // for version result = tk.MustQuery("select version()") result.Check(testkit.Rows(mysql.ServerVersion)) // for row_count tk.MustExec("drop table if exists t") tk.MustExec("create table t (a int, b int, PRIMARY KEY (a))") result = tk.MustQuery("select row_count();") result.Check(testkit.Rows("0")) tk.MustExec("insert into t(a, b) values(1, 11), (2, 22), (3, 33)") result = tk.MustQuery("select row_count();") result.Check(testkit.Rows("3")) tk.MustExec("select * from t") result = tk.MustQuery("select row_count();") result.Check(testkit.Rows("-1")) tk.MustExec("update t set b=22 where a=1") result = tk.MustQuery("select row_count();") result.Check(testkit.Rows("1")) tk.MustExec("update t set b=22 where a=1") result = tk.MustQuery("select row_count();") result.Check(testkit.Rows("0")) tk.MustExec("delete from t where a=2") result = tk.MustQuery("select row_count();") result.Check(testkit.Rows("1")) result = tk.MustQuery("select row_count();") result.Check(testkit.Rows("-1")) } func (s *testIntegrationSuite) TestControlBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") // for ifnull result := tk.MustQuery("select ifnull(1, 2)") result.Check(testkit.Rows("1")) result = tk.MustQuery("select ifnull(null, 2)") result.Check(testkit.Rows("2")) result = tk.MustQuery("select ifnull(1, null)") result.Check(testkit.Rows("1")) result = tk.MustQuery("select ifnull(null, null)") result.Check(testkit.Rows("<nil>")) tk.MustExec("drop table if exists t1") tk.MustExec("drop table if exists t2") tk.MustExec("create table t1(a decimal(20,4))") tk.MustExec("create table t2(a decimal(20,4))") tk.MustExec("insert into t1 select 1.2345") tk.MustExec("insert into t2 select 1.2345") result = tk.MustQuery(`select sum(ifnull(a, 0)) from ( select ifnull(a, 0) as a from t1 union all select ifnull(a, 0) as a from t2 ) t;`) result.Check(testkit.Rows("2.4690")) // for if result = tk.MustQuery(`select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0;`) result.Check(testkit.Rows("this is a 2 2.0")) tk.MustExec("drop table if exists t1;") tk.MustExec("CREATE TABLE t1 (st varchar(255) NOT NULL, u int(11) NOT NULL);") tk.MustExec("INSERT INTO t1 VALUES ('a',1),('A',1),('aa',1),('AA',1),('a',1),('aaa',0),('BBB',0);") result = tk.MustQuery("select if(1,st,st) s from t1 order by s;") result.Check(testkit.Rows("A", "AA", "BBB", "a", "a", "aa", "aaa")) result = tk.MustQuery("select if(u=1,st,st) s from t1 order by s;") result.Check(testkit.Rows("A", "AA", "BBB", "a", "a", "aa", "aaa")) tk.MustExec("drop table if exists t1;") tk.MustExec("CREATE TABLE t1 (a varchar(255), b time, c int)") tk.MustExec("INSERT INTO t1 VALUE('abc', '12:00:00', 0)") tk.MustExec("INSERT INTO t1 VALUE('1abc', '00:00:00', 1)") tk.MustExec("INSERT INTO t1 VALUE('0abc', '12:59:59', 0)") result = tk.MustQuery("select if(a, b, c), if(b, a, c), if(c, a, b) from t1") result.Check(testkit.Rows("0 abc 12:00:00", "00:00:00 1 1abc", "0 0abc 12:59:59")) result = tk.MustQuery("select if(1, 1.0, 1)") result.Check(testkit.Rows("1.0")) // FIXME: MySQL returns `1.0`. result = tk.MustQuery("select if(1, 1, 1.0)") result.Check(testkit.Rows("1")) result = tk.MustQuery("SELECT 79 + + + CASE -87 WHEN -30 THEN COALESCE(COUNT(*), +COALESCE(+15, -33, -12 ) + +72) WHEN +COALESCE(+AVG(DISTINCT(60)), 21) THEN NULL ELSE NULL END AS col0;") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("SELECT -63 + COALESCE ( - 83, - 61 + - + 72 * - CAST( NULL AS SIGNED ) + + 3 );") result.Check(testkit.Rows("-146")) } func (s *testIntegrationSuite) TestArithmeticBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") ctx := context.Background() // for plus tk.MustExec("DROP TABLE IF EXISTS t;") tk.MustExec("CREATE TABLE t(a DECIMAL(4, 2), b DECIMAL(5, 3));") tk.MustExec("INSERT INTO t(a, b) VALUES(1.09, 1.999), (-1.1, -0.1);") result := tk.MustQuery("SELECT a+b FROM t;") result.Check(testkit.Rows("3.089", "-1.200")) result = tk.MustQuery("SELECT b+12, b+0.01, b+0.00001, b+12.00001 FROM t;") result.Check(testkit.Rows("13.999 2.009 1.99901 13.99901", "11.900 -0.090 -0.09999 11.90001")) result = tk.MustQuery("SELECT 1+12, 21+0.01, 89+\"11\", 12+\"a\", 12+NULL, NULL+1, NULL+NULL;") result.Check(testkit.Rows("13 21.01 100 12 <nil> <nil> <nil>")) tk.MustExec("DROP TABLE IF EXISTS t;") tk.MustExec("CREATE TABLE t(a BIGINT UNSIGNED, b BIGINT UNSIGNED);") tk.MustExec("INSERT INTO t SELECT 1<<63, 1<<63;") rs, err := tk.Exec("SELECT a+b FROM t;") c.Assert(errors.ErrorStack(err), Equals, "") c.Assert(rs, NotNil) rows, err := session.GetRows4Test(ctx, tk.Se, rs) c.Assert(rows, IsNil) c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "[types:1690]BIGINT UNSIGNED value is out of range in '(test.t.a + test.t.b)'") c.Assert(rs.Close(), IsNil) rs, err = tk.Exec("select cast(-3 as signed) + cast(2 as unsigned);") c.Assert(errors.ErrorStack(err), Equals, "") c.Assert(rs, NotNil) rows, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(rows, IsNil) c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "[types:1690]BIGINT UNSIGNED value is out of range in '(-3 + 2)'") c.Assert(rs.Close(), IsNil) rs, err = tk.Exec("select cast(2 as unsigned) + cast(-3 as signed);") c.Assert(errors.ErrorStack(err), Equals, "") c.Assert(rs, NotNil) rows, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(rows, IsNil) c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "[types:1690]BIGINT UNSIGNED value is out of range in '(2 + -3)'") c.Assert(rs.Close(), IsNil) // for minus tk.MustExec("DROP TABLE IF EXISTS t;") tk.MustExec("CREATE TABLE t(a DECIMAL(4, 2), b DECIMAL(5, 3));") tk.MustExec("INSERT INTO t(a, b) VALUES(1.09, 1.999), (-1.1, -0.1);") result = tk.MustQuery("SELECT a-b FROM t;") result.Check(testkit.Rows("-0.909", "-1.000")) result = tk.MustQuery("SELECT b-12, b-0.01, b-0.00001, b-12.00001 FROM t;") result.Check(testkit.Rows("-10.001 1.989 1.99899 -10.00101", "-12.100 -0.110 -0.10001 -12.10001")) result = tk.MustQuery("SELECT 1-12, 21-0.01, 89-\"11\", 12-\"a\", 12-NULL, NULL-1, NULL-NULL;") result.Check(testkit.Rows("-11 20.99 78 12 <nil> <nil> <nil>")) tk.MustExec("DROP TABLE IF EXISTS t;") tk.MustExec("CREATE TABLE t(a BIGINT UNSIGNED, b BIGINT UNSIGNED);") tk.MustExec("INSERT INTO t SELECT 1, 4;") rs, err = tk.Exec("SELECT a-b FROM t;") c.Assert(errors.ErrorStack(err), Equals, "") c.Assert(rs, NotNil) rows, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(rows, IsNil) c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "[types:1690]BIGINT UNSIGNED value is out of range in '(test.t.a - test.t.b)'") c.Assert(rs.Close(), IsNil) rs, err = tk.Exec("select cast(-1 as signed) - cast(-1 as unsigned);") c.Assert(errors.ErrorStack(err), Equals, "") c.Assert(rs, NotNil) rows, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(rows, IsNil) c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "[types:1690]BIGINT UNSIGNED value is out of range in '(-1 - 18446744073709551615)'") c.Assert(rs.Close(), IsNil) rs, err = tk.Exec("select cast(-1 as unsigned) - cast(-1 as signed);") c.Assert(errors.ErrorStack(err), Equals, "") c.Assert(rs, NotNil) rows, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(rows, IsNil) c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "[types:1690]BIGINT UNSIGNED value is out of range in '(18446744073709551615 - -1)'") c.Assert(rs.Close(), IsNil) tk.MustQuery("select 1234567890 * 1234567890").Check(testkit.Rows("1524157875019052100")) rs, err = tk.Exec("select 1234567890 * 12345671890") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(terror.ErrorEqual(err, types.ErrOverflow), IsTrue) c.Assert(rs.Close(), IsNil) tk.MustQuery("select cast(1234567890 as unsigned int) * 12345671890").Check(testkit.Rows("15241570095869612100")) tk.MustQuery("select 123344532434234234267890.0 * 1234567118923479823749823749.230").Check(testkit.Rows("152277104042296270209916846800130443726237424001224.7000")) rs, err = tk.Exec("select 123344532434234234267890.0 * 12345671189234798237498232384982309489238402830480239849238048239084749.230") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(terror.ErrorEqual(err, types.ErrOverflow), IsTrue) c.Assert(rs.Close(), IsNil) // FIXME: There is something wrong in showing float number. //tk.MustQuery("select 1.797693134862315708145274237317043567981e+308 * 1").Check(testkit.Rows("1.7976931348623157e308")) //tk.MustQuery("select 1.797693134862315708145274237317043567981e+308 * -1").Check(testkit.Rows("-1.7976931348623157e308")) rs, err = tk.Exec("select 1.797693134862315708145274237317043567981e+308 * 1.1") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(terror.ErrorEqual(err, types.ErrOverflow), IsTrue) c.Assert(rs.Close(), IsNil) rs, err = tk.Exec("select 1.797693134862315708145274237317043567981e+308 * -1.1") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(terror.ErrorEqual(err, types.ErrOverflow), IsTrue) c.Assert(rs.Close(), IsNil) result = tk.MustQuery(`select cast(-3 as unsigned) - cast(-1 as signed);`) result.Check(testkit.Rows("18446744073709551614")) tk.MustExec("DROP TABLE IF EXISTS t;") tk.MustExec("CREATE TABLE t(a DECIMAL(4, 2), b DECIMAL(5, 3));") tk.MustExec("INSERT INTO t(a, b) VALUES(-1.09, 1.999);") result = tk.MustQuery("SELECT a/b, a/12, a/-0.01, b/12, b/-0.01, b/0.000, NULL/b, b/NULL, NULL/NULL FROM t;") result.Check(testkit.Rows("-0.545273 -0.090833 109.000000 0.1665833 -199.9000000 <nil> <nil> <nil> <nil>")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1365 Division by 0")) rs, err = tk.Exec("select 1e200/1e-200") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(terror.ErrorEqual(err, types.ErrOverflow), IsTrue) c.Assert(rs.Close(), IsNil) // for intDiv result = tk.MustQuery("SELECT 13 DIV 12, 13 DIV 0.01, -13 DIV 2, 13 DIV NULL, NULL DIV 13, NULL DIV NULL;") result.Check(testkit.Rows("1 1300 -6 <nil> <nil> <nil>")) result = tk.MustQuery("SELECT 2.4 div 1.1, 2.4 div 1.2, 2.4 div 1.3;") result.Check(testkit.Rows("2 2 1")) result = tk.MustQuery("SELECT 1.175494351E-37 div 1.7976931348623157E+308, 1.7976931348623157E+308 div -1.7976931348623157E+307, 1 div 1e-82;") result.Check(testkit.Rows("0 -1 <nil>")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Truncated incorrect DECIMAL value: 'cast(1.7976931348623157e+308)'", "Warning|1292|Truncated incorrect DECIMAL value: 'cast(1.7976931348623157e+308)'", "Warning|1292|Truncated incorrect DECIMAL value: 'cast(-1.7976931348623158e+307)'", "Warning|1365|Division by 0")) rs, err = tk.Exec("select 1e300 DIV 1.5") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(terror.ErrorEqual(err, types.ErrOverflow), IsTrue) c.Assert(rs.Close(), IsNil) tk.MustExec("drop table if exists t;") tk.MustExec("CREATE TABLE t (c_varchar varchar(255), c_time time, nonzero int, zero int, c_int_unsigned int unsigned, c_timestamp timestamp, c_enum enum('a','b','c'));") tk.MustExec("INSERT INTO t VALUE('abc', '12:00:00', 12, 0, 5, '2017-08-05 18:19:03', 'b');") result = tk.MustQuery("select c_varchar div nonzero, c_time div nonzero, c_time div zero, c_timestamp div nonzero, c_timestamp div zero, c_varchar div zero from t;") result.Check(testkit.Rows("0 10000 <nil> 1680900431825 <nil> <nil>")) result = tk.MustQuery("select c_enum div nonzero from t;") result.Check(testkit.Rows("0")) tk.MustQuery("select c_enum div zero from t").Check(testkit.Rows("<nil>")) tk.MustQuery("select nonzero div zero from t").Check(testkit.Rows("<nil>")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1365 Division by 0")) result = tk.MustQuery("select c_time div c_enum, c_timestamp div c_time, c_timestamp div c_enum from t;") result.Check(testkit.Rows("60000 168090043 10085402590951")) result = tk.MustQuery("select c_int_unsigned div nonzero, nonzero div c_int_unsigned, c_int_unsigned div zero from t;") result.Check(testkit.Rows("0 2 <nil>")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1365 Division by 0")) // for mod result = tk.MustQuery("SELECT CAST(1 AS UNSIGNED) MOD -9223372036854775808, -9223372036854775808 MOD CAST(1 AS UNSIGNED);") result.Check(testkit.Rows("1 0")) result = tk.MustQuery("SELECT 13 MOD 12, 13 MOD 0.01, -13 MOD 2, 13 MOD NULL, NULL MOD 13, NULL DIV NULL;") result.Check(testkit.Rows("1 0.00 -1 <nil> <nil> <nil>")) result = tk.MustQuery("SELECT 2.4 MOD 1.1, 2.4 MOD 1.2, 2.4 mod 1.30;") result.Check(testkit.Rows("0.2 0.0 1.10")) tk.MustExec("drop table if exists t;") tk.MustExec("CREATE TABLE t (c_varchar varchar(255), c_time time, nonzero int, zero int, c_timestamp timestamp, c_enum enum('a','b','c'));") tk.MustExec("INSERT INTO t VALUE('abc', '12:00:00', 12, 0, '2017-08-05 18:19:03', 'b');") result = tk.MustQuery("select c_varchar MOD nonzero, c_time MOD nonzero, c_timestamp MOD nonzero, c_enum MOD nonzero from t;") result.Check(testkit.Rows("0 0 3 2")) result = tk.MustQuery("select c_time MOD c_enum, c_timestamp MOD c_time, c_timestamp MOD c_enum from t;") result.Check(testkit.Rows("0 21903 1")) tk.MustQuery("select c_enum MOD zero from t;").Check(testkit.Rows("<nil>")) tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1365 Division by 0")) tk.MustExec("SET SQL_MODE='ERROR_FOR_DIVISION_BY_ZERO,STRICT_ALL_TABLES';") tk.MustExec("drop table if exists t;") tk.MustExec("CREATE TABLE t (v int);") tk.MustExec("INSERT IGNORE INTO t VALUE(12 MOD 0);") tk.MustQuery("show warnings;").Check(testkit.Rows("Warning 1365 Division by 0")) tk.MustQuery("select v from t;").Check(testkit.Rows("<nil>")) _, err = tk.Exec("INSERT INTO t VALUE(12 MOD 0);") c.Assert(terror.ErrorEqual(err, expression.ErrDivisionByZero), IsTrue) tk.MustQuery("select sum(1.2e2) * 0.1").Check(testkit.Rows("12")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a double)") tk.MustExec("insert into t value(1.2)") tk.MustQuery("select sum(a) * 0.1 from t").Check(testkit.Rows("0.12")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a double)") tk.MustExec("insert into t value(1.2)") result = tk.MustQuery("select * from t where a/0 > 1") result.Check(testkit.Rows()) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1105|Division by 0")) tk.MustExec("USE test;") tk.MustExec("DROP TABLE IF EXISTS t;") tk.MustExec("CREATE TABLE t(a BIGINT, b DECIMAL(6, 2));") tk.MustExec("INSERT INTO t VALUES(0, 1.12), (1, 1.21);") tk.MustQuery("SELECT a/b FROM t;").Check(testkit.Rows("0.0000", "0.8264")) } func (s *testIntegrationSuite) TestCompareBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") // compare as JSON tk.MustExec("drop table if exists t") tk.MustExec("CREATE TABLE t (pk int NOT NULL PRIMARY KEY AUTO_INCREMENT, i INT, j JSON);") tk.MustExec(`INSERT INTO t(i, j) VALUES (0, NULL)`) tk.MustExec(`INSERT INTO t(i, j) VALUES (1, '{"a": 2}')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (2, '[1,2]')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (3, '{"a":"b", "c":"d","ab":"abc", "bc": ["x", "y"]}')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (4, '["here", ["I", "am"], "!!!"]')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (5, '"scalar string"')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (6, 'true')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (7, 'false')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (8, 'null')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (9, '-1')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (10, CAST(CAST(1 AS UNSIGNED) AS JSON))`) tk.MustExec(`INSERT INTO t(i, j) VALUES (11, '32767')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (12, '32768')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (13, '-32768')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (14, '-32769')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (15, '2147483647')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (16, '2147483648')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (17, '-2147483648')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (18, '-2147483649')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (19, '18446744073709551615')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (20, '18446744073709551616')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (21, '3.14')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (22, '{}')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (23, '[]')`) tk.MustExec(`INSERT INTO t(i, j) VALUES (24, CAST(CAST('2015-01-15 23:24:25' AS DATETIME) AS JSON))`) tk.MustExec(`INSERT INTO t(i, j) VALUES (25, CAST(CAST('23:24:25' AS TIME) AS JSON))`) tk.MustExec(`INSERT INTO t(i, j) VALUES (26, CAST(CAST('2015-01-15' AS DATE) AS JSON))`) tk.MustExec(`INSERT INTO t(i, j) VALUES (27, CAST(TIMESTAMP('2015-01-15 23:24:25') AS JSON))`) tk.MustExec(`INSERT INTO t(i, j) VALUES (28, CAST('[]' AS CHAR CHARACTER SET 'ascii'))`) result := tk.MustQuery(`SELECT i, (j = '"scalar string"') AS c1, (j = 'scalar string') AS c2, (j = CAST('"scalar string"' AS JSON)) AS c3, (j = CAST(CAST(j AS CHAR CHARACTER SET 'utf8mb4') AS JSON)) AS c4, (j = CAST(NULL AS JSON)) AS c5, (j = NULL) AS c6, (j <=> NULL) AS c7, (j <=> CAST(NULL AS JSON)) AS c8, (j IN (-1, 2, 32768, 3.14)) AS c9, (j IN (CAST('[1, 2]' AS JSON), CAST('{}' AS JSON), CAST(3.14 AS JSON))) AS c10, (j = (SELECT j FROM t WHERE j = CAST('null' AS JSON))) AS c11, (j = (SELECT j FROM t WHERE j IS NULL)) AS c12, (j = (SELECT j FROM t WHERE 1<>1)) AS c13, (j = DATE('2015-01-15')) AS c14, (j = TIME('23:24:25')) AS c15, (j = TIMESTAMP('2015-01-15 23:24:25')) AS c16, (j = CURRENT_TIMESTAMP) AS c17, (JSON_EXTRACT(j, '$.a') = 2) AS c18 FROM t ORDER BY i;`) result.Check(testkit.Rows("0 <nil> <nil> <nil> <nil> <nil> <nil> 1 1 <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil>", "1 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 1", "2 0 0 0 1 <nil> <nil> 0 0 0 1 0 <nil> <nil> 0 0 0 0 <nil>", "3 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 0", "4 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "5 0 1 1 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "6 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "7 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "8 0 0 0 1 <nil> <nil> 0 0 0 0 1 <nil> <nil> 0 0 0 0 <nil>", "9 0 0 0 1 <nil> <nil> 0 0 1 0 0 <nil> <nil> 0 0 0 0 <nil>", "10 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "11 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "12 0 0 0 1 <nil> <nil> 0 0 1 0 0 <nil> <nil> 0 0 0 0 <nil>", "13 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "14 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "15 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "16 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "17 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "18 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "19 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "20 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "21 0 0 0 1 <nil> <nil> 0 0 1 1 0 <nil> <nil> 0 0 0 0 <nil>", "22 0 0 0 1 <nil> <nil> 0 0 0 1 0 <nil> <nil> 0 0 0 0 <nil>", "23 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>", "24 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 1 0 <nil>", "25 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 1 0 0 <nil>", "26 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 1 0 0 0 <nil>", "27 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 1 0 <nil>", "28 0 0 0 1 <nil> <nil> 0 0 0 0 0 <nil> <nil> 0 0 0 0 <nil>")) // for coalesce result = tk.MustQuery("select coalesce(NULL), coalesce(NULL, NULL), coalesce(NULL, NULL, NULL);") result.Check(testkit.Rows("<nil> <nil> <nil>")) tk.MustExec("drop table if exists t2") tk.MustExec("create table t2(a int, b double, c datetime, d time, e char(20), f bit(10))") tk.MustExec(`insert into t2 values(1, 1.1, "2017-08-01 12:01:01", "12:01:01", "abcdef", 0b10101)`) result = tk.MustQuery("select coalesce(NULL, a), coalesce(NULL, b, a), coalesce(c, NULL, a, b), coalesce(d, NULL), coalesce(d, c), coalesce(NULL, NULL, e, 1), coalesce(f), coalesce(1, a, b, c, d, e, f) from t2") result.Check(testkit.Rows(fmt.Sprintf("1 1.1 2017-08-01 12:01:01 12:01:01 %s 12:01:01 abcdef 21 1", time.Now().In(tk.Se.GetSessionVars().Location()).Format("2006-01-02")))) // nullif result = tk.MustQuery(`SELECT NULLIF(NULL, 1), NULLIF(1, NULL), NULLIF(1, 1), NULLIF(NULL, NULL);`) result.Check(testkit.Rows("<nil> 1 <nil> <nil>")) result = tk.MustQuery(`SELECT NULLIF(1, 1.0), NULLIF(1, "1.0");`) result.Check(testkit.Rows("<nil> <nil>")) result = tk.MustQuery(`SELECT NULLIF("abc", 1);`) result.Check(testkit.Rows("abc")) result = tk.MustQuery(`SELECT NULLIF(1+2, 1);`) result.Check(testkit.Rows("3")) result = tk.MustQuery(`SELECT NULLIF(1, 1+2);`) result.Check(testkit.Rows("1")) result = tk.MustQuery(`SELECT NULLIF(2+3, 1+2);`) result.Check(testkit.Rows("5")) result = tk.MustQuery(`SELECT HEX(NULLIF("abc", 1));`) result.Check(testkit.Rows("616263")) tk.MustExec("drop table if exists t;") tk.MustExec("create table t(a date)") result = tk.MustQuery("desc select a = a from t") result.Check(testkit.Rows( "Projection_3 10000.00 root eq(test.t.a, test.t.a)", "└─TableReader_5 10000.00 root data:TableScan_4", " └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo", )) // for interval result = tk.MustQuery(`select interval(null, 1, 2), interval(1, 2, 3), interval(2, 1, 3)`) result.Check(testkit.Rows("-1 0 1")) result = tk.MustQuery(`select interval(3, 1, 2), interval(0, "b", "1", "2"), interval("a", "b", "1", "2")`) result.Check(testkit.Rows("2 1 1")) result = tk.MustQuery(`select interval(23, 1, 23, 23, 23, 30, 44, 200), interval(23, 1.7, 15.3, 23.1, 30, 44, 200), interval(9007199254740992, 9007199254740993)`) result.Check(testkit.Rows("4 2 0")) result = tk.MustQuery(`select interval(cast(9223372036854775808 as unsigned), cast(9223372036854775809 as unsigned)), interval(9223372036854775807, cast(9223372036854775808 as unsigned)), interval(-9223372036854775807, cast(9223372036854775808 as unsigned))`) result.Check(testkit.Rows("0 0 0")) result = tk.MustQuery(`select interval(cast(9223372036854775806 as unsigned), 9223372036854775807), interval(cast(9223372036854775806 as unsigned), -9223372036854775807), interval("9007199254740991", "9007199254740992")`) result.Check(testkit.Rows("0 1 0")) result = tk.MustQuery(`select interval(9007199254740992, "9007199254740993"), interval("9007199254740992", 9007199254740993), interval("9007199254740992", "9007199254740993")`) result.Check(testkit.Rows("1 1 1")) result = tk.MustQuery(`select INTERVAL(100, NULL, NULL, NULL, NULL, NULL, 100);`) result.Check(testkit.Rows("6")) // for greatest result = tk.MustQuery(`select greatest(1, 2, 3), greatest("a", "b", "c"), greatest(1.1, 1.2, 1.3), greatest("123a", 1, 2)`) result.Check(testkit.Rows("3 c 1.3 123")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1265|Data Truncated")) result = tk.MustQuery(`select greatest(cast("2017-01-01" as datetime), "123", "234", cast("2018-01-01" as date)), greatest(cast("2017-01-01" as date), "123", null)`) // todo: MySQL returns "2018-01-01 <nil>" result.Check(testkit.Rows("2018-01-01 00:00:00 <nil>")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|invalid time format: '123'", "Warning|1292|invalid time format: '234'", "Warning|1292|invalid time format: '123'")) // for least result = tk.MustQuery(`select least(1, 2, 3), least("a", "b", "c"), least(1.1, 1.2, 1.3), least("123a", 1, 2)`) result.Check(testkit.Rows("1 a 1.1 1")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1265|Data Truncated")) result = tk.MustQuery(`select least(cast("2017-01-01" as datetime), "123", "234", cast("2018-01-01" as date)), least(cast("2017-01-01" as date), "123", null)`) result.Check(testkit.Rows("123 <nil>")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|invalid time format: '123'", "Warning|1292|invalid time format: '234'", "Warning|1292|invalid time format: '123'")) tk.MustQuery(`select 1 < 17666000000000000000, 1 > 17666000000000000000, 1 = 17666000000000000000`).Check(testkit.Rows("1 0 0")) tk.MustExec("drop table if exists t") // insert value at utc timezone tk.MustExec("set time_zone = '+00:00'") tk.MustExec("create table t(a timestamp)") tk.MustExec("insert into t value('1991-05-06 04:59:28')") // check daylight saving time in Asia/Shanghai tk.MustExec("set time_zone='Asia/Shanghai'") tk.MustQuery("select * from t").Check(testkit.Rows("1991-05-06 13:59:28")) // insert an nonexistent time tk.MustExec("set time_zone = 'America/Los_Angeles'") _, err := tk.Exec("insert into t value('2011-03-13 02:00:00')") c.Assert(err, NotNil) // reset timezone to a +8 offset tk.MustExec("set time_zone = '+08:00'") tk.MustQuery("select * from t").Check(testkit.Rows("1991-05-06 12:59:28")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a bigint unsigned)") tk.MustExec("insert into t value(17666000000000000000)") tk.MustQuery("select * from t where a = 17666000000000000000").Check(testkit.Rows("17666000000000000000")) // test for compare row result = tk.MustQuery(`select row(1,2,3)=row(1,2,3)`) result.Check(testkit.Rows("1")) result = tk.MustQuery(`select row(1,2,3)=row(1+3,2,3)`) result.Check(testkit.Rows("0")) result = tk.MustQuery(`select row(1,2,3)<>row(1,2,3)`) result.Check(testkit.Rows("0")) result = tk.MustQuery(`select row(1,2,3)<>row(1+3,2,3)`) result.Check(testkit.Rows("1")) result = tk.MustQuery(`select row(1+3,2,3)<>row(1+3,2,3)`) result.Check(testkit.Rows("0")) } func (s *testIntegrationSuite) TestAggregationBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("create table t(a decimal(7, 6))") tk.MustExec("insert into t values(1.123456), (1.123456)") result := tk.MustQuery("select avg(a) from t") result.Check(testkit.Rows("1.1234560000")) tk.MustExec("use test") tk.MustExec("drop table t") tk.MustExec("CREATE TABLE `t` ( `a` int, KEY `idx_a` (`a`))") result = tk.MustQuery("select avg(a) from t") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select max(a), min(a) from t") result.Check(testkit.Rows("<nil> <nil>")) result = tk.MustQuery("select distinct a from t") result.Check(testkit.Rows()) result = tk.MustQuery("select sum(a) from t") result.Check(testkit.Rows("<nil>")) result = tk.MustQuery("select count(a) from t") result.Check(testkit.Rows("0")) result = tk.MustQuery("select bit_or(a) from t") result.Check(testkit.Rows("0")) result = tk.MustQuery("select bit_xor(a) from t") result.Check(testkit.Rows("0")) result = tk.MustQuery("select bit_and(a) from t") result.Check(testkit.Rows("18446744073709551615")) } func (s *testIntegrationSuite) TestAggregationBuiltinBitOr(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists t;") tk.MustExec("create table t(a bigint)") tk.MustExec("insert into t values(null);") result := tk.MustQuery("select bit_or(a) from t") result.Check(testkit.Rows("0")) tk.MustExec("insert into t values(1);") result = tk.MustQuery("select bit_or(a) from t") result.Check(testkit.Rows("1")) tk.MustExec("insert into t values(2);") result = tk.MustQuery("select bit_or(a) from t") result.Check(testkit.Rows("3")) tk.MustExec("insert into t values(4);") result = tk.MustQuery("select bit_or(a) from t") result.Check(testkit.Rows("7")) result = tk.MustQuery("select a, bit_or(a) from t group by a order by a") result.Check(testkit.Rows("<nil> 0", "1 1", "2 2", "4 4")) tk.MustExec("insert into t values(-1);") result = tk.MustQuery("select bit_or(a) from t") result.Check(testkit.Rows("18446744073709551615")) } func (s *testIntegrationSuite) TestAggregationBuiltinBitXor(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists t;") tk.MustExec("create table t(a bigint)") tk.MustExec("insert into t values(null);") result := tk.MustQuery("select bit_xor(a) from t") result.Check(testkit.Rows("0")) tk.MustExec("insert into t values(1);") result = tk.MustQuery("select bit_xor(a) from t") result.Check(testkit.Rows("1")) tk.MustExec("insert into t values(2);") result = tk.MustQuery("select bit_xor(a) from t") result.Check(testkit.Rows("3")) tk.MustExec("insert into t values(3);") result = tk.MustQuery("select bit_xor(a) from t") result.Check(testkit.Rows("0")) tk.MustExec("insert into t values(3);") result = tk.MustQuery("select bit_xor(a) from t") result.Check(testkit.Rows("3")) result = tk.MustQuery("select a, bit_xor(a) from t group by a order by a") result.Check(testkit.Rows("<nil> 0", "1 1", "2 2", "3 0")) } func (s *testIntegrationSuite) TestAggregationBuiltinBitAnd(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists t;") tk.MustExec("create table t(a bigint)") tk.MustExec("insert into t values(null);") result := tk.MustQuery("select bit_and(a) from t") result.Check(testkit.Rows("18446744073709551615")) tk.MustExec("insert into t values(7);") result = tk.MustQuery("select bit_and(a) from t") result.Check(testkit.Rows("7")) tk.MustExec("insert into t values(5);") result = tk.MustQuery("select bit_and(a) from t") result.Check(testkit.Rows("5")) tk.MustExec("insert into t values(3);") result = tk.MustQuery("select bit_and(a) from t") result.Check(testkit.Rows("1")) tk.MustExec("insert into t values(2);") result = tk.MustQuery("select bit_and(a) from t") result.Check(testkit.Rows("0")) result = tk.MustQuery("select a, bit_and(a) from t group by a order by a desc") result.Check(testkit.Rows("7 7", "5 5", "3 3", "2 2", "<nil> 18446744073709551615")) } func (s *testIntegrationSuite) TestAggregationBuiltinGroupConcat(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("create table t(a varchar(100))") tk.MustExec("create table d(a varchar(100))") tk.MustExec("insert into t values('hello'), ('hello')") result := tk.MustQuery("select group_concat(a) from t") result.Check(testkit.Rows("hello,hello")) tk.MustExec("set @@group_concat_max_len=7") result = tk.MustQuery("select group_concat(a) from t") result.Check(testkit.Rows("hello,h")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning 1260 Some rows were cut by GROUPCONCAT(test.t.a)")) _, err := tk.Exec("insert into d select group_concat(a) from t") c.Assert(errors.Cause(err).(*terror.Error).Code(), Equals, terror.ErrCode(mysql.ErrCutValueGroupConcat)) tk.Exec("set sql_mode=''") tk.MustExec("insert into d select group_concat(a) from t") tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning 1260 Some rows were cut by GROUPCONCAT(test.t.a)")) tk.MustQuery("select * from d").Check(testkit.Rows("hello,h")) } func (s *testIntegrationSuite) TestOtherBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int, b double, c varchar(20), d datetime, e time)") tk.MustExec("insert into t value(1, 2, 'string', '2017-01-01 12:12:12', '12:12:12')") // for in result := tk.MustQuery("select 1 in (a, b, c), 'string' in (a, b, c), '2017-01-01 12:12:12' in (c, d, e), '12:12:12' in (c, d, e) from t") result.Check(testkit.Rows("1 1 1 1")) result = tk.MustQuery("select 1 in (null, c), 2 in (null, c) from t") result.Check(testkit.Rows("<nil> <nil>")) result = tk.MustQuery("select 0 in (a, b, c), 0 in (a, b, c), 3 in (a, b, c), 4 in (a, b, c) from t") result.Check(testkit.Rows("1 1 0 0")) result = tk.MustQuery("select (0,1) in ((0,1), (0,2)), (0,1) in ((0,0), (0,2))") result.Check(testkit.Rows("1 0")) result = tk.MustQuery(`select bit_count(121), bit_count(-1), bit_count(null), bit_count("1231aaa");`) result.Check(testkit.Rows("5 64 <nil> 7")) tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int primary key, b time, c double, d varchar(10))") tk.MustExec(`insert into t values(1, '01:01:01', 1.1, "1"), (2, '02:02:02', 2.2, "2")`) tk.MustExec(`insert into t(a, b) values(1, '12:12:12') on duplicate key update a = values(b)`) result = tk.MustQuery(`select a from t order by a`) result.Check(testkit.Rows("2", "121212")) tk.MustExec(`insert into t values(2, '12:12:12', 1.1, "3.3") on duplicate key update a = values(c) + values(d)`) result = tk.MustQuery(`select a from t order by a`) result.Check(testkit.Rows("4", "121212")) // for setvar, getvar tk.MustExec(`set @varname = "Abc"`) result = tk.MustQuery(`select @varname, @VARNAME`) result.Check(testkit.Rows("Abc Abc")) // for values tk.MustExec("drop table t") tk.MustExec("CREATE TABLE `t` (`id` varchar(32) NOT NULL, `count` decimal(18,2), PRIMARY KEY (`id`));") tk.MustExec("INSERT INTO t (id,count)VALUES('abc',2) ON DUPLICATE KEY UPDATE count=if(VALUES(count) > count,VALUES(count),count)") result = tk.MustQuery("select count from t where id = 'abc'") result.Check(testkit.Rows("2.00")) tk.MustExec("INSERT INTO t (id,count)VALUES('abc',265.0) ON DUPLICATE KEY UPDATE count=if(VALUES(count) > count,VALUES(count),count)") result = tk.MustQuery("select count from t where id = 'abc'") result.Check(testkit.Rows("265.00")) // for values(issue #4884) tk.MustExec("drop table if exists t;") tk.MustExec("create table test(id int not null, val text, primary key(id));") tk.MustExec("insert into test values(1,'hello');") result = tk.MustQuery("select * from test;") result.Check(testkit.Rows("1 hello")) tk.MustExec("insert into test values(1, NULL) on duplicate key update val = VALUES(val);") result = tk.MustQuery("select * from test;") result.Check(testkit.Rows("1 <nil>")) tk.MustExec("drop table if exists test;") tk.MustExec(`create table test( id int not null, a text, b blob, c varchar(20), d int, e float, f DECIMAL(6,4), g JSON, primary key(id));`) tk.MustExec(`insert into test values(1,'txt hello', 'blb hello', 'vc hello', 1, 1.1, 1.0, '{"key1": "value1", "key2": "value2"}');`) tk.MustExec(`insert into test values(1, NULL, NULL, NULL, NULL, NULL, NULL, NULL) on duplicate key update a = values(a), b = values(b), c = values(c), d = values(d), e = values(e), f = values(f), g = values(g);`) result = tk.MustQuery("select * from test;") result.Check(testkit.Rows("1 <nil> <nil> <nil> <nil> <nil> <nil> <nil>")) } func (s *testIntegrationSuite) TestDateBuiltin(c *C) { ctx := context.Background() defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("USE test;") tk.MustExec("DROP TABLE IF EXISTS t;") tk.MustExec("create table t (d date);") tk.MustExec("insert into t values ('1997-01-02')") tk.MustExec("insert into t values ('1998-01-02')") r := tk.MustQuery("select * from t where d < date '1998-01-01';") r.Check(testkit.Rows("1997-01-02")) r = tk.MustQuery("select date'20171212'") r.Check(testkit.Rows("2017-12-12")) r = tk.MustQuery("select date'2017/12/12'") r.Check(testkit.Rows("2017-12-12")) r = tk.MustQuery("select date'2017/12-12'") r.Check(testkit.Rows("2017-12-12")) tk.MustExec("set sql_mode = ''") r = tk.MustQuery("select date '0000-00-00';") r.Check(testkit.Rows("0000-00-00")) tk.MustExec("set sql_mode = 'NO_ZERO_IN_DATE'") r = tk.MustQuery("select date '0000-00-00';") r.Check(testkit.Rows("0000-00-00")) tk.MustExec("set sql_mode = 'NO_ZERO_DATE'") rs, err := tk.Exec("select date '0000-00-00';") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("0000-00-00")), IsTrue) c.Assert(rs.Close(), IsNil) tk.MustExec("set sql_mode = ''") r = tk.MustQuery("select date '2007-10-00';") r.Check(testkit.Rows("2007-10-00")) tk.MustExec("set sql_mode = 'NO_ZERO_IN_DATE'") rs, _ = tk.Exec("select date '2007-10-00';") _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("2017-10-00")), IsTrue) c.Assert(rs.Close(), IsNil) tk.MustExec("set sql_mode = 'NO_ZERO_DATE'") r = tk.MustQuery("select date '2007-10-00';") r.Check(testkit.Rows("2007-10-00")) tk.MustExec("set sql_mode = 'NO_ZERO_IN_DATE,NO_ZERO_DATE'") rs, _ = tk.Exec("select date '2007-10-00';") _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("2017-10-00")), IsTrue) c.Assert(rs.Close(), IsNil) rs, err = tk.Exec("select date '0000-00-00';") c.Assert(err, IsNil) _, err = session.GetRows4Test(ctx, tk.Se, rs) c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("0000-00-00")), IsTrue) c.Assert(rs.Close(), IsNil) r = tk.MustQuery("select date'1998~01~02'") r.Check(testkit.Rows("1998-01-02")) r = tk.MustQuery("select date'731124', date '011124'") r.Check(testkit.Rows("1973-11-24 2001-11-24")) _, err = tk.Exec("select date '0000-00-00 00:00:00';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("0000-00-00 00:00:00")), IsTrue) _, err = tk.Exec("select date '2017-99-99';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) _, err = tk.Exec("select date '2017-2-31';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrInvalidTimeFormat), IsTrue) _, err = tk.Exec("select date '201712-31';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("201712-31")), IsTrue) _, err = tk.Exec("select date 'abcdefg';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("abcdefg")), IsTrue) } func (s *testIntegrationSuite) TestJSONBuiltin(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) tk.MustExec("USE test;") tk.MustExec("DROP TABLE IF EXISTS t;") tk.MustExec("CREATE TABLE `my_collection` ( `doc` json DEFAULT NULL, `_id` varchar(32) GENERATED ALWAYS AS (JSON_UNQUOTE(JSON_EXTRACT(doc,'$._id'))) STORED NOT NULL, PRIMARY KEY (`_id`))") _, err := tk.Exec("UPDATE `test`.`my_collection` SET doc=JSON_SET(doc) WHERE (JSON_EXTRACT(doc,'$.name') = 'clare');") c.Assert(err, NotNil) } func (s *testIntegrationSuite) TestTimeLiteral(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) r := tk.MustQuery("select time '117:01:12';") r.Check(testkit.Rows("117:01:12")) r = tk.MustQuery("select time '01:00:00.999999';") r.Check(testkit.Rows("01:00:00.999999")) r = tk.MustQuery("select time '1 01:00:00';") r.Check(testkit.Rows("25:00:00")) r = tk.MustQuery("select time '110:00:00';") r.Check(testkit.Rows("110:00:00")) r = tk.MustQuery("select time'-1:1:1.123454656';") r.Check(testkit.Rows("-01:01:01.123455")) r = tk.MustQuery("select time '33:33';") r.Check(testkit.Rows("33:33:00")) r = tk.MustQuery("select time '1.1';") r.Check(testkit.Rows("00:00:01.1")) r = tk.MustQuery("select time '21';") r.Check(testkit.Rows("00:00:21")) r = tk.MustQuery("select time '20 20:20';") r.Check(testkit.Rows("500:20:00")) _, err := tk.Exec("select time '2017-01-01 00:00:00';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("2017-01-01 00:00:00")), IsTrue) _, err = tk.Exec("select time '071231235959.999999';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("071231235959.999999")), IsTrue) _, err = tk.Exec("select time '20171231235959.999999';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("20171231235959.999999")), IsTrue) } func (s *testIntegrationSuite) TestTimestampLiteral(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) r := tk.MustQuery("select timestamp '2017-01-01 00:00:00';") r.Check(testkit.Rows("2017-01-01 00:00:00")) r = tk.MustQuery("select timestamp '2017@01@01 00:00:00';") r.Check(testkit.Rows("2017-01-01 00:00:00")) r = tk.MustQuery("select timestamp '2017@01@01 00~00~00';") r.Check(testkit.Rows("2017-01-01 00:00:00")) r = tk.MustQuery("select timestamp '2017@01@0001 00~00~00.333';") r.Check(testkit.Rows("2017-01-01 00:00:00.333")) _, err := tk.Exec("select timestamp '00:00:00';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("00:00:00")), IsTrue) _, err = tk.Exec("select timestamp '1992-01-03';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("1992-01-03")), IsTrue) _, err = tk.Exec("select timestamp '20171231235959.999999';") c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, types.ErrIncorrectDatetimeValue.GenWithStackByArgs("20171231235959.999999")), IsTrue) } func (s *testIntegrationSuite) TestLiterals(c *C) { defer s.cleanEnv(c) tk := testkit.NewTestKit(c, s.store) r := tk.MustQuery("SELECT LENGTH(b''), LENGTH(B''), b''+1, b''-1, B''+1;") r.Check(testkit.Rows("0 0 1 -1 1")) } func (s *testIntegrationSuite) TestFuncJSON(c *C) { tk := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) tk.MustExec("USE test;") tk.MustExec("DROP TABLE IF EXISTS table_json;") tk.MustExec("CREATE TABLE table_json(a json, b VARCHAR(255));") j1 := `{"\\"hello\\"": "world", "a": [1, "2", {"aa": "bb"}, 4.0, {"aa": "cc"}], "b": true, "c": ["d"]}` j2 := `[{"a": 1, "b": true}, 3, 3.5, "hello, world", null, true]` for _, j := range []string{j1, j2} { tk.MustExec(fmt.Sprintf(`INSERT INTO table_json values('%s', '%s')`, j, j)) } r := tk.MustQuery(`select json_type(a), json_type(b) from table_json`) r.Check(testkit.Rows("OBJECT OBJECT", "ARRAY ARRAY")) r = tk.MustQuery(`select json_unquote('hello'), json_unquote('world')`) r.Check(testkit.Rows("hello world")) r = tk.MustQuery(`select json_extract(a, '$.a[1]'), json_extract(b, '$.b') from table_json`) r.Check(testkit.Rows("\"2\" true", "<nil> <nil>")) r = tk.MustQuery(`select json_extract(json_set(a, '$.a[1]', 3), '$.a[1]'), json_extract(json_set(b, '$.b', false), '$.b') from table_json`) r.Check(testkit.Rows("3 false", "<nil> <nil>")) r = tk.MustQuery(`select json_extract(json_insert(a, '$.a[1]', 3), '$.a[1]'), json_extract(json_insert(b, '$.b', false), '$.b') from table_json`) r.Check(testkit.Rows("\"2\" true", "<nil> <nil>")) r = tk.MustQuery(`select json_extract(json_replace(a, '$.a[1]', 3), '$.a[1]'), json_extract(json_replace(b, '$.b', false), '$.b') from table_json`) r.Check(testkit.Rows("3 false", "<nil> <nil>")) r = tk.MustQuery(`select json_extract(json_merge(a, cast(b as JSON)), '$[0].a[0]') from table_json`) r.Check(testkit.Rows("1", "1")) r = tk.MustQuery(`select json_extract(json_array(1,2,3), '$[1]')`) r.Check(testkit.Rows("2")) r = tk.MustQuery(`select json_extract(json_object(1,2,3,4), '$."1"')`) r.Check(testkit.Rows("2")) tk.MustExec(`update table_json set a=json_set(a,'$.a',json_object('a',1,'b',2)) where json_extract(a,'$.a[1]') = '2'`) r = tk.MustQuery(`select json_extract(a, '$.a.a'), json_extract(a, '$.a.b') from table_json`) r.Check(testkit.Rows("1 2", "<nil> <nil>")) r = tk.MustQuery(`select json_contains(NULL, '1'), json_contains('1', NULL), json_contains('1', '1', NULL)`) r.Check(testkit.Rows("<nil> <nil> <nil>")) r = tk.MustQuery(`select json_contains('{}','{}'), json_contains('[1]','1'), json_contains('[1]','"1"'), json_contains('[1,2,[1,[5,[3]]]]', '[1,3]', '$[2]'), json_contains('[1,2,[1,[5,{"a":[2,3]}]]]', '[1,{"a":[3]}]', "$[2]"), json_contains('{"a":1}', '{"a":1,"b":2}', "$")`) r.Check(testkit.Rows("1 1 0 1 1 0")) r = tk.MustQuery(`select json_contains('{"a": 1}', '1', "$.c"), json_contains('{"a": [1, 2]}', '1', "$.a[2]"), json_contains('{"a": [1, {"a": 1}]}', '1', "$.a[1].b")`) r.Check(testkit.Rows("<nil> <nil> <nil>")) rs, err := tk.Exec("select json_contains('1','1','$.*')") c.Assert(err, IsNil) c.Assert(rs, NotNil) _, err = session.GetRows4Test(context.Background(), tk.Se, rs) c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "[json:3149]In this situation, path expressions may not contain the * and ** tokens.") r = tk.MustQuery(`select json_contains_path(NULL, 'one', "$.c"), json_contains_path(NULL, 'all', "$.c"), json_contains_path('{"a": 1}', NULL, "$.c"), json_contains_path('{"a": 1}', 'one', NULL), json_contains_path('{"a": 1}', 'all', NULL) `) r.Check(testkit.Rows("<nil> <nil> <nil> <nil> <nil>")) r = tk.MustQuery(`select json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'one', '$.c.d'), json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'one', '$.a.d'), json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'all', '$.c.d'), json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'all', '$.a.d') `) r.Check(testkit.Rows("1 0 1 0")) r = tk.MustQuery(`select json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'one', '$.a', '$.e'), json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'one', '$.a', '$.b'), json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'all', '$.a', '$.e'), json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'all', '$.a', '$.b') `) r.Check(testkit.Rows("1 1 0 1")) r = tk.MustQuery(`select json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'one', '$.*'), json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'one', '$[*]'), json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'all', '$.*'), json_contains_path('{"a": 1, "b": 2, "c": {"d": 4}}', 'all', '$[*]') `) r.Check(testkit.Rows("1 0 1 0")) r = tk.MustQuery(`select json_keys('{}'), json_keys('{"a": 1, "b": 2}'), json_keys('{"a": {"c": 3}, "b": 2}'), json_keys('{"a": {"c": 3}, "b": 2}', "$.a") `) r.Check(testkit.Rows(`[] ["a", "b"] ["a", "b"] ["c"]`)) r = tk.MustQuery(`select json_length('1'), json_length('{}'), json_length('[]'), json_length('{"a": 1}'), json_length('{"a": 1, "b": 2}'), json_length('[1, 2, 3]') `) r.Check(testkit.Rows("1 0 0 1 2 3")) } func (s *testIntegrationSuite) TestColumnInfoModified(c *C) { testKit := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) testKit.MustExec("use test") testKit.MustExec("drop table if exists tab0") testKit.MustExec("CREATE TABLE tab0(col0 INTEGER, col1 INTEGER, col2 INTEGER)") testKit.MustExec("SELECT + - (- CASE + col0 WHEN + CAST( col0 AS SIGNED ) THEN col1 WHEN 79 THEN NULL WHEN + - col1 THEN col0 / + col0 END ) * - 16 FROM tab0") ctx := testKit.Se.(sessionctx.Context) is := domain.GetDomain(ctx).InfoSchema() tbl, _ := is.TableByName(model.NewCIStr("test"), model.NewCIStr("tab0")) col := table.FindCol(tbl.Cols(), "col1") c.Assert(col.Tp, Equals, mysql.TypeLong) } func (s *testIntegrationSuite) TestSetVariables(c *C) { tk := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) _, err := tk.Exec("set sql_mode='adfasdfadsfdasd';") c.Assert(err, NotNil) _, err = tk.Exec("set @@sql_mode='adfasdfadsfdasd';") c.Assert(err, NotNil) _, err = tk.Exec("set @@global.sql_mode='adfasdfadsfdasd';") c.Assert(err, NotNil) _, err = tk.Exec("set @@session.sql_mode='adfasdfadsfdasd';") c.Assert(err, NotNil) var r *testkit.Result _, err = tk.Exec("set @@session.sql_mode=',NO_ZERO_DATE,ANSI,ANSI_QUOTES';") c.Assert(err, IsNil) r = tk.MustQuery(`select @@session.sql_mode`) r.Check(testkit.Rows("NO_ZERO_DATE,REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,ANSI")) r = tk.MustQuery(`show variables like 'sql_mode'`) r.Check(testkit.Rows("sql_mode NO_ZERO_DATE,REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,ANSI")) // for invalid SQL mode. tk.MustExec("use test") tk.MustExec("drop table if exists tab0") tk.MustExec("CREATE TABLE tab0(col1 time)") _, err = tk.Exec("set sql_mode='STRICT_TRANS_TABLES';") c.Assert(err, IsNil) _, err = tk.Exec("INSERT INTO tab0 select cast('999:44:33' as time);") c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "[types:1292]Truncated incorrect time value: '999h44m33s'") _, err = tk.Exec("set sql_mode=' ,';") c.Assert(err, NotNil) _, err = tk.Exec("INSERT INTO tab0 select cast('999:44:33' as time);") c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "[types:1292]Truncated incorrect time value: '999h44m33s'") // issue #5478 _, err = tk.Exec("set session transaction read write;") c.Assert(err, IsNil) _, err = tk.Exec("set global transaction read write;") c.Assert(err, IsNil) r = tk.MustQuery(`select @@session.tx_read_only, @@global.tx_read_only, @@session.transaction_read_only, @@global.transaction_read_only;`) r.Check(testkit.Rows("0 0 0 0")) _, err = tk.Exec("set session transaction read only;") c.Assert(err, IsNil) r = tk.MustQuery(`select @@session.tx_read_only, @@global.tx_read_only, @@session.transaction_read_only, @@global.transaction_read_only;`) r.Check(testkit.Rows("1 0 1 0")) _, err = tk.Exec("set global transaction read only;") c.Assert(err, IsNil) r = tk.MustQuery(`select @@session.tx_read_only, @@global.tx_read_only, @@session.transaction_read_only, @@global.transaction_read_only;`) r.Check(testkit.Rows("1 1 1 1")) _, err = tk.Exec("set session transaction read write;") c.Assert(err, IsNil) _, err = tk.Exec("set global transaction read write;") c.Assert(err, IsNil) r = tk.MustQuery(`select @@session.tx_read_only, @@global.tx_read_only, @@session.transaction_read_only, @@global.transaction_read_only;`) r.Check(testkit.Rows("0 0 0 0")) } func (s *testIntegrationSuite) TestIssues(c *C) { // for issue #4954 tk := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) tk.MustExec("use test") tk.MustExec("drop table if exists t") tk.MustExec("CREATE TABLE t (a CHAR(5) CHARACTER SET latin1);") tk.MustExec("INSERT INTO t VALUES ('oe');") tk.MustExec("INSERT INTO t VALUES (0xf6);") r := tk.MustQuery(`SELECT * FROM t WHERE a= 'oe';`) r.Check(testkit.Rows("oe")) r = tk.MustQuery(`SELECT HEX(a) FROM t WHERE a= 0xf6;`) r.Check(testkit.Rows("F6")) // for issue #4006 tk.MustExec(`drop table if exists tb`) tk.MustExec("create table tb(id int auto_increment primary key, v varchar(32));") tk.MustExec("insert into tb(v) (select v from tb);") r = tk.MustQuery(`SELECT * FROM tb;`) r.Check(testkit.Rows()) tk.MustExec(`insert into tb(v) values('hello');`) tk.MustExec("insert into tb(v) (select v from tb);") r = tk.MustQuery(`SELECT * FROM tb;`) r.Check(testkit.Rows("1 hello", "2 hello")) // for issue #5111 tk.MustExec(`drop table if exists t`) tk.MustExec("create table t(c varchar(32));") tk.MustExec("insert into t values('1e649'),('-1e649');") r = tk.MustQuery(`SELECT * FROM t where c < 1;`) r.Check(testkit.Rows("-1e649")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Truncated incorrect DOUBLE value: '1e649'", "Warning|1292|Truncated incorrect DOUBLE value: '-1e649'")) r = tk.MustQuery(`SELECT * FROM t where c > 1;`) r.Check(testkit.Rows("1e649")) tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Truncated incorrect DOUBLE value: '1e649'", "Warning|1292|Truncated incorrect DOUBLE value: '-1e649'")) // for issue #5293 tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int)") tk.MustExec("insert t values (1)") tk.MustQuery("select * from t where cast(a as binary)").Check(testkit.Rows("1")) } func (s *testIntegrationSuite) TestInPredicate4UnsignedInt(c *C) { // for issue #6661 tk := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) tk.MustExec("use test") tk.MustExec("drop table if exists t") tk.MustExec("CREATE TABLE t (a bigint unsigned,key (a));") tk.MustExec("INSERT INTO t VALUES (0), (4), (5), (6), (7), (8), (9223372036854775810), (18446744073709551614), (18446744073709551615);") r := tk.MustQuery(`SELECT a FROM t WHERE a NOT IN (-1, -2, 18446744073709551615);`) r.Check(testkit.Rows("0", "4", "5", "6", "7", "8", "9223372036854775810", "18446744073709551614")) r = tk.MustQuery(`SELECT a FROM t WHERE a NOT IN (-1, -2, 4, 9223372036854775810);`) r.Check(testkit.Rows("0", "5", "6", "7", "8", "18446744073709551614", "18446744073709551615")) r = tk.MustQuery(`SELECT a FROM t WHERE a NOT IN (-1, -2, 0, 4, 18446744073709551614);`) r.Check(testkit.Rows("5", "6", "7", "8", "9223372036854775810", "18446744073709551615")) // for issue #4473 tk.MustExec("drop table if exists t") tk.MustExec("create table t1 (some_id smallint(5) unsigned,key (some_id) )") tk.MustExec("insert into t1 values (1),(2)") r = tk.MustQuery(`select some_id from t1 where some_id not in(2,-1);`) r.Check(testkit.Rows("1")) } func (s *testIntegrationSuite) TestFilterExtractFromDNF(c *C) { tk := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) tk.MustExec("use test") tk.MustExec("drop table if exists t") tk.MustExec("create table t(a int, b int, c int)") tests := []struct { exprStr string result string }{ { exprStr: "a = 1 or a = 1 or a = 1", result: "[eq(test.t.a, 1)]", }, { exprStr: "a = 1 or a = 1 or (a = 1 and b = 1)", result: "[eq(test.t.a, 1)]", }, { exprStr: "(a = 1 and a = 1) or a = 1 or b = 1", result: "[or(or(and(eq(test.t.a, 1), eq(test.t.a, 1)), eq(test.t.a, 1)), eq(test.t.b, 1))]", }, { exprStr: "(a = 1 and b = 2) or (a = 1 and b = 3) or (a = 1 and b = 4)", result: "[eq(test.t.a, 1) or(eq(test.t.b, 2), or(eq(test.t.b, 3), eq(test.t.b, 4)))]", }, { exprStr: "(a = 1 and b = 1 and c = 1) or (a = 1 and b = 1) or (a = 1 and b = 1 and c > 2 and c < 3)", result: "[eq(test.t.a, 1) eq(test.t.b, 1)]", }, } for _, tt := range tests { sql := "select * from t where " + tt.exprStr ctx := tk.Se.(sessionctx.Context) sc := ctx.GetSessionVars().StmtCtx stmts, err := session.Parse(ctx, sql) c.Assert(err, IsNil, Commentf("error %v, for expr %s", err, tt.exprStr)) c.Assert(stmts, HasLen, 1) is := domain.GetDomain(ctx).InfoSchema() err = plannercore.Preprocess(ctx, stmts[0], is, false) c.Assert(err, IsNil, Commentf("error %v, for resolve name, expr %s", err, tt.exprStr)) p, err := plannercore.BuildLogicalPlan(ctx, stmts[0], is) c.Assert(err, IsNil, Commentf("error %v, for build plan, expr %s", err, tt.exprStr)) selection := p.(plannercore.LogicalPlan).Children()[0].(*plannercore.LogicalSelection) conds := make([]expression.Expression, 0, len(selection.Conditions)) for _, cond := range selection.Conditions { conds = append(conds, expression.PushDownNot(ctx, cond, false)) } afterFunc := expression.ExtractFiltersFromDNFs(ctx, conds) sort.Slice(afterFunc, func(i, j int) bool { return bytes.Compare(afterFunc[i].HashCode(sc), afterFunc[j].HashCode(sc)) < 0 }) c.Assert(fmt.Sprintf("%s", afterFunc), Equals, tt.result, Commentf("wrong result for expr: %s", tt.exprStr)) } } func (s *testIntegrationSuite) testTiDBIsOwnerFunc(c *C) { tk := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) result := tk.MustQuery("select tidb_is_ddl_owner()") ddlOwnerChecker := tk.Se.DDLOwnerChecker() c.Assert(ddlOwnerChecker, NotNil) var ret int64 if ddlOwnerChecker.IsOwner() { ret = 1 } result.Check(testkit.Rows(fmt.Sprintf("%v", ret))) } func newStoreWithBootstrap() (kv.Storage, *domain.Domain, error) { store, err := mockstore.NewMockTikvStore() if err != nil { return nil, nil, err } session.SetSchemaLease(0) dom, err := session.BootstrapSession(store) return store, dom, err } func (s *testIntegrationSuite) TestTwoDecimalTruncate(c *C) { tk := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) tk.MustExec("use test") tk.MustExec("set sql_mode=''") tk.MustExec("drop table if exists t") tk.MustExec("create table t1(a decimal(10,5), b decimal(10,1))") tk.MustExec("ins
("select 2.00000000000000000000000000000001 * 1.000000000000000000000000000000000000000000002") res.Check(testkit.Rows("2.000000000000000000000000000000")) } func (s *testIntegrationSuite) TestPrefixIndex(c *C) { tk := testkit.NewTestKit(c, s.store) defer s.cleanEnv(c) tk.MustExec("use test") tk.MustExec(`CREATE TABLE t1 ( name varchar(12) DEFAULT NULL, KEY pname (name(12)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci`) tk.MustExec("insert into t1 values('借款策略集_网页');") res := tk.MustQuery("select * from t1 where name = '借款策略集_网页';") res.Check(testkit.Rows("借款策略集_网页")) tk.MustExec(`CREATE TABLE prefix ( a int(11) NOT NULL, b varchar(55) DEFAULT NULL, c int(11) DEFAULT NULL, PRIMARY KEY (a), KEY prefix_index (b(2)), KEY prefix_complex (a,b(2)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;`) tk.MustExec("INSERT INTO prefix VALUES(0, 'b', 2), (1, 'bbb', 3), (2, 'bbc', 4), (3, 'bbb', 5), (4, 'abc', 6), (5, 'abc', 7), (6, 'abc', 7), (7, 'ÿÿ', 8), (8, 'ÿÿ0', 9), (9, 'ÿÿÿ', 10);") res = tk.MustQuery("select c, b from prefix where b > 'ÿ' and b < 'ÿÿc'") res.Check(testkit.Rows("8 ÿÿ", "9 ÿÿ0")) res = tk.MustQuery("select a, b from prefix where b LIKE 'ÿÿ%'") res.Check(testkit.Rows("7 ÿÿ", "8 ÿÿ0", "9 ÿÿÿ")) } func (s *testIntegrationSuite) TestDecimalMul(c *C) { tk := testkit.NewTestKit(c, s.store) tk.MustExec("USE test") tk.MustExec("create table t(a decimal(38, 17));") tk.MustExec("insert into t select 0.5999991229316*0.918755041726043;") res := tk.MustQuery("select * from t;") res.Check(testkit.Rows("0.55125221922461136")) } func (s *testIntegrationSuite) TestUnknowHintIgnore(c *C) { tk := testkit.NewTestKit(c, s.store) tk.MustExec("USE test") tk.MustExec("create table t(a int)") tk.MustQuery("select /*+ unknown_hint(c1)*/ 1").Check(testkit.Rows("1")) tk.MustQuery("show warnings").Check(testkit.Rows("Warning 1105 line 1 column 29 near \"select /*+ unknown_hint(c1)*/ 1\" (total length 31)")) _, err := tk.Exec("select 1 from /*+ test1() */ t") c.Assert(err, NotNil) } func (s *testIntegrationSuite) TestValuesInNonInsertStmt(c *C) { tk := testkit.NewTestKit(c, s.store) tk.MustExec(`use test;`) tk.MustExec(`drop table if exists t;`) tk.MustExec(`create table t(a bigint, b double, c decimal, d varchar(20), e datetime, f time, g json);`) tk.MustExec(`insert into t values(1, 1.1, 2.2, "abc", "2018-10-24", NOW(), "12");`) res := tk.MustQuery(`select values(a), values(b), values(c), values(d), values(e), values(f), values(g) from t;`) res.Check(testkit.Rows(`<nil> <nil> <nil> <nil> <nil> <nil> <nil>`)) } func (s *testIntegrationSuite) TestForeignKeyVar(c *C) { tk := testkit.NewTestKit(c, s.store) tk.MustExec("SET FOREIGN_KEY_CHECKS=1") tk.MustQuery("SHOW WARNINGS").Check(testkit.Rows("Warning 1105 variable 'foreign_key_checks' does not yet support value: 1")) } func (s *testIntegrationSuite) TestUserVarMockWindFunc(c *C) { tk := testkit.NewTestKit(c, s.store) tk.MustExec(`use test;`) tk.MustExec(`drop table if exists t;`) tk.MustExec(`create table t (a int, b varchar (20), c varchar (20));`) tk.MustExec(`insert into t values (1,'key1-value1','insert_order1'), (1,'key1-value2','insert_order2'), (1,'key1-value3','insert_order3'), (1,'key1-value4','insert_order4'), (1,'key1-value5','insert_order5'), (1,'key1-value6','insert_order6'), (2,'key2-value1','insert_order1'), (2,'key2-value2','insert_order2'), (2,'key2-value3','insert_order3'), (2,'key2-value4','insert_order4'), (2,'key2-value5','insert_order5'), (2,'key2-value6','insert_order6'), (3,'key3-value1','insert_order1'), (3,'key3-value2','insert_order2'), (3,'key3-value3','insert_order3'), (3,'key3-value4','insert_order4'), (3,'key3-value5','insert_order5'), (3,'key3-value6','insert_order6'); `) tk.MustExec(`SET @LAST_VAL := NULL;`) tk.MustExec(`SET @ROW_NUM := 0;`) tk.MustQuery(`select * from ( SELECT a, @ROW_NUM := IF(a = @LAST_VAL, @ROW_NUM + 1, 1) AS ROW_NUM, @LAST_VAL := a AS LAST_VAL, b, c FROM (select * from t where a in (1, 2, 3) ORDER BY a, c) t1 ) t2 where t2.ROW_NUM < 2; `).Check(testkit.Rows( `1 1 1 key1-value1 insert_order1`, `2 1 2 key2-value1 insert_order1`, `3 1 3 key3-value1 insert_order1`, )) tk.MustQuery(`select * from ( SELECT a, @ROW_NUM := IF(a = @LAST_VAL, @ROW_NUM + 1, 1) AS ROW_NUM, @LAST_VAL := a AS LAST_VAL, b, c FROM (select * from t where a in (1, 2, 3) ORDER BY a, c) t1 ) t2; `).Check(testkit.Rows( `1 1 1 key1-value1 insert_order1`, `1 2 1 key1-value2 insert_order2`, `1 3 1 key1-value3 insert_order3`, `1 4 1 key1-value4 insert_order4`, `1 5 1 key1-value5 insert_order5`, `1 6 1 key1-value6 insert_order6`, `2 1 2 key2-value1 insert_order1`, `2 2 2 key2-value2 insert_order2`, `2 3 2 key2-value3 insert_order3`, `2 4 2 key2-value4 insert_order4`, `2 5 2 key2-value5 insert_order5`, `2 6 2 key2-value6 insert_order6`, `3 1 3 key3-value1 insert_order1`, `3 2 3 key3-value2 insert_order2`, `3 3 3 key3-value3 insert_order3`, `3 4 3 key3-value4 insert_order4`, `3 5 3 key3-value5 insert_order5`, `3 6 3 key3-value6 insert_order6`, )) } func (s *testIntegrationSuite) TestCastAsTime(c *C) { tk := testkit.NewTestKit(c, s.store) tk.MustExec(`use test;`) tk.MustExec(`drop table if exists t;`) tk.MustExec(`create table t (col1 bigint, col2 double, col3 decimal, col4 varchar(20), col5 json);`) tk.MustExec(`insert into t values (1, 1, 1, "1", "1");`) tk.MustExec(`insert into t values (null, null, null, null, null);`) tk.MustQuery(`select cast(col1 as time), cast(col2 as time), cast(col3 as time), cast(col4 as time), cast(col5 as time) from t where col1 = 1;`).Check(testkit.Rows( `00:00:01 00:00:01 00:00:01 00:00:01 00:00:01`, )) tk.MustQuery(`select cast(col1 as time), cast(col2 as time), cast(col3 as time), cast(col4 as time), cast(col5 as time) from t where col1 is null;`).Check(testkit.Rows( `<nil> <nil> <nil> <nil> <nil>`, )) err := tk.ExecToErr(`select cast(col1 as time(31)) from t where col1 is null;`) c.Assert(err.Error(), Equals, "[expression:1426]Too big precision 31 specified for column 'CAST'. Maximum is 6.") err = tk.ExecToErr(`select cast(col2 as time(31)) from t where col1 is null;`) c.Assert(err.Error(), Equals, "[expression:1426]Too big precision 31 specified for column 'CAST'. Maximum is 6.") err = tk.ExecToErr(`select cast(col3 as time(31)) from t where col1 is null;`) c.Assert(err.Error(), Equals, "[expression:1426]Too big precision 31 specified for column 'CAST'. Maximum is 6.") err = tk.ExecToErr(`select cast(col4 as time(31)) from t where col1 is null;`) c.Assert(err.Error(), Equals, "[expression:1426]Too big precision 31 specified for column 'CAST'. Maximum is 6.") err = tk.ExecToErr(`select cast(col5 as time(31)) from t where col1 is null;`) c.Assert(err.Error(), Equals, "[expression:1426]Too big precision 31 specified for column 'CAST'. Maximum is 6.") }
ert into t1 values(123.12345, 123.12345)") tk.MustExec("update t1 set b = a") res := tk.MustQuery("select a, b from t1") res.Check(testkit.Rows("123.12345 123.1")) res = tk.MustQuery
output.rs
extern crate term; use std::marker::Sized; use std::boxed::Box; use term::Attr::Underline; use term::Attr::Italic; use parser; pub fn write_format<T: term::Terminal + ?Sized>(t: &mut Box<T>, format: &parser::Format, content: &str) { t.reset().unwrap(); match format.foreground { Some(color) => or_log(t.fg(color), "setting foreground"), None => {}, }; match format.background { Some(color) => or_log(t.bg(color), "setting background"), None => {}, }; match format.italic { Some(i) => or_log(t.attr(Italic(i)), "setting italic"), None => {}, }; match format.underline { Some(i) => or_log(t.attr(Underline(i)), "setting underline"), None => {}, }; write!(t, "{}", content).unwrap(); } pub fn or_log(r: term::Result<()>, action: &str)
{ match r { Ok(_) => {}, Err(e) => eprintln!("Error {}: {:?}", action, e), } }
test_gaussian.py
from unittest import TestCase from unittest.mock import Mock, patch import numpy as np import pandas as pd from copulas import get_qualified_name from copulas.multivariate.gaussian import GaussianMultivariate from copulas.univariate import GaussianUnivariate class TestGaussianMultivariate(TestCase): def setUp(self): """Defines random variable to use on tests. """ self.data = pd.DataFrame({ 'column1': np.array([ 2641.16233666, 921.14476418, -651.32239137, 1223.63536668, 3233.37342355, 1373.22400821, 1959.28188858, 1076.99295365, 2029.25100261, 1835.52188141, 1170.03850556, 739.42628394, 1866.65810627, 3703.49786503, 1719.45232017, 258.90206528, 219.42363944, 609.90212377, 1618.44207239, 2323.2775272, 3251.78732274, 1430.63989981, -180.57028875, -592.84497457, ]), 'column2': np.array([ 180.2425623, 192.35609972, 150.24830291, 156.62123653, 173.80311908, 191.0922843, 163.22252158, 190.73280428, 158.52982435, 163.0101334, 205.24904026, 175.42916046, 208.31821984, 178.98351969, 160.50981075, 163.19294974, 173.30395132, 215.18996298, 164.71141696, 178.84973821, 182.99902513, 217.5796917, 201.56983421, 174.92272693 ]), 'column3': np.array([ -1.42432446, -0.14759864, 0.66476302, -0.04061445, 0.64305762, 1.79615407, 0.70450457, -0.05886671, -0.36794788, 1.39331262, 0.39792831, 0.0676313, -0.96761759, 0.67286132, -0.55013279, -0.53118328, 1.23969655, -0.35985016, -0.03568531, 0.91456357, 0.49077378, -0.27428204, 0.45857406, 2.29614033 ]) }) def test__transform_to_normal_numpy_1d(self): # Setup gm = GaussianMultivariate() dist_a = Mock() dist_a.cdf.return_value = np.array([0]) dist_b = Mock() dist_b.cdf.return_value = np.array([0.3]) gm.columns = ['a', 'b'] gm.univariates = [dist_a, dist_b] # Run data = np.array([ [3, 5], ]) returned = gm._transform_to_normal(data) # Check # Failures may occurr on different cpytonn implementations # with different float precision values. # If that happens, atol might need to be increased expected = np.array([ [-5.166579, -0.524401], ]) np.testing.assert_allclose(returned, expected, atol=1e-6) assert dist_a.cdf.call_count == 1 expected = np.array([3]) passed = dist_a.cdf.call_args[0][0] np.testing.assert_allclose(expected, passed) assert dist_b.cdf.call_count == 1 expected = np.array([5]) passed = dist_b.cdf.call_args[0][0] np.testing.assert_allclose(expected, passed) def test__transform_to_normal_numpy_2d(self): # Setup gm = GaussianMultivariate() dist_a = Mock() dist_a.cdf.return_value = np.array([0, 0.5, 1]) dist_b = Mock() dist_b.cdf.return_value = np.array([0.3, 0.5, 0.7]) gm.columns = ['a', 'b'] gm.univariates = [dist_a, dist_b] # Run data = np.array([ [3, 5], [4, 6], [5, 7], ]) returned = gm._transform_to_normal(data) # Check # Failures may occurr on different cpytonn implementations # with different float precision values. # If that happens, atol might need to be increased expected = np.array([ [-5.166579, -0.524401], [0.0, 0.0], [5.166579, 0.524401] ]) np.testing.assert_allclose(returned, expected, atol=1e-6) assert dist_a.cdf.call_count == 1 expected = np.array([3, 4, 5]) passed = dist_a.cdf.call_args[0][0] np.testing.assert_allclose(expected, passed) assert dist_b.cdf.call_count == 1 expected = np.array([5, 6, 7]) passed = dist_b.cdf.call_args[0][0] np.testing.assert_allclose(expected, passed) def test__transform_to_normal_series(self): # Setup gm = GaussianMultivariate() dist_a = Mock() dist_a.cdf.return_value = np.array([0]) dist_b = Mock() dist_b.cdf.return_value = np.array([0.3]) gm.columns = ['a', 'b'] gm.univariates = [dist_a, dist_b] # Run data = pd.Series({'a': 3, 'b': 5}) returned = gm._transform_to_normal(data) # Check # Failures may occurr on different cpytonn implementations # with different float precision values. # If that happens, atol might need to be increased expected = np.array([ [-5.166579, -0.524401], ]) np.testing.assert_allclose(returned, expected, atol=1e-6) assert dist_a.cdf.call_count == 1 expected = np.array([3]) passed = dist_a.cdf.call_args[0][0] np.testing.assert_allclose(expected, passed) assert dist_b.cdf.call_count == 1 expected = np.array([5]) passed = dist_b.cdf.call_args[0][0] np.testing.assert_allclose(expected, passed) def test__transform_to_normal_dataframe(self): # Setup gm = GaussianMultivariate() dist_a = Mock() dist_a.cdf.return_value = np.array([0, 0.5, 1]) dist_b = Mock() dist_b.cdf.return_value = np.array([0.3, 0.5, 0.7]) gm.columns = ['a', 'b'] gm.univariates = [dist_a, dist_b] # Run data = pd.DataFrame({ 'a': [3, 4, 5], 'b': [5, 6, 7] }) returned = gm._transform_to_normal(data) # Check # Failures may occurr on different cpytonn implementations # with different float precision values. # If that happens, atol might need to be increased expected = np.array([ [-5.166579, -0.524401], [0.0, 0.0], [5.166579, 0.524401] ]) np.testing.assert_allclose(returned, expected, atol=1e-6) assert dist_a.cdf.call_count == 1 expected = np.array([3, 4, 5]) passed = dist_a.cdf.call_args[0][0] np.testing.assert_allclose(expected, passed) assert dist_b.cdf.call_count == 1 expected = np.array([5, 6, 7]) passed = dist_b.cdf.call_args[0][0] np.testing.assert_allclose(expected, passed) def test__get_covariance(self): """_get_covariance computes the covariance matrix of normalized values.""" # Setup copula = GaussianMultivariate(GaussianUnivariate) copula.fit(self.data) expected_covariance = np.array([ [1., -0.01261819, -0.19821644], [-0.01261819, 1., -0.16896087], [-0.19821644, -0.16896087, 1.] ]) # Run covariance = copula._get_covariance(self.data) # Check assert np.isclose(covariance, expected_covariance).all().all() def test_fit_default_distribution(self): """On fit, a distribution is created for each column along the covariance and means""" copula = GaussianMultivariate(GaussianUnivariate) copula.fit(self.data) for i, key in enumerate(self.data.columns): assert copula.columns[i] == key assert copula.univariates[i].__class__ == GaussianUnivariate assert copula.univariates[i]._params['loc'] == self.data[key].mean() assert copula.univariates[i]._params['scale'] == np.std(self.data[key]) expected_covariance = copula._get_covariance(self.data) assert (copula.covariance == expected_covariance).all().all() def test_fit_distribution_arg(self): """On fit, the distributions for each column use instances of copula.distribution.""" # Setup distribution = 'copulas.univariate.gaussian_kde.GaussianKDE' copula = GaussianMultivariate(distribution=distribution) # Run copula.fit(self.data) # Check assert copula.distribution == 'copulas.univariate.gaussian_kde.GaussianKDE' for i, key in enumerate(self.data.columns): assert copula.columns[i] == key assert get_qualified_name(copula.univariates[i].__class__) == copula.distribution expected_covariance = copula._get_covariance(self.data) assert (copula.covariance == expected_covariance).all().all() def
(self): """ On fit, it should use the correct distributions for those that are specified and default to using the base class otherwise. """ copula = GaussianMultivariate(distribution={ 'column1': 'copulas.univariate.beta.BetaUnivariate', 'column2': 'copulas.univariate.gaussian_kde.GaussianKDE', }) copula.fit(self.data) assert get_qualified_name( copula.univariates[0].__class__) == 'copulas.univariate.beta.BetaUnivariate' assert get_qualified_name( copula.univariates[1].__class__) == 'copulas.univariate.gaussian_kde.GaussianKDE' assert get_qualified_name( copula.univariates[2].__class__) == 'copulas.univariate.base.Univariate' def test_fit_numpy_array(self): """Fit should work indistinctly with numpy arrays and pandas dataframes """ # Setup copula = GaussianMultivariate( distribution='copulas.univariate.gaussian.GaussianUnivariate') # Run copula.fit(self.data.values) # Check for key, (column, univariate) in enumerate(zip(self.data.columns, copula.univariates)): assert univariate._params['loc'] == np.mean(self.data[column]) assert univariate._params['scale'] == np.std(self.data[column]) expected_covariance = copula._get_covariance(pd.DataFrame(self.data.values)) assert (copula.covariance == expected_covariance).all().all() def test_probability_density(self): """Probability_density computes probability for the given values.""" # Setup copula = GaussianMultivariate(GaussianUnivariate) copula.fit(self.data) X = np.array([2000., 200., 0.]) expected_result = 0.032245296420409846 # Run result = copula.probability_density(X) # Check self.assertAlmostEqual(result, expected_result) def test_cumulative_distribution_fit_df_call_np_array(self): """Cumulative_density integrates the probability density along the given values.""" # Setup copula = GaussianMultivariate(GaussianUnivariate) copula.fit(self.data) X = np.array([2000., 200., 1.]) expected_result = 0.4550595153746892 # Run result = copula.cumulative_distribution(X) # Check assert np.isclose(result, expected_result, atol=1e-5).all().all() def test_cumulative_distribution_fit_call_np_array(self): """Cumulative_density integrates the probability density along the given values.""" # Setup copula = GaussianMultivariate(GaussianUnivariate) copula.fit(self.data.values) X = np.array([2000., 200., 1.]) expected_result = 0.4550595153746892 # Run result = copula.cumulative_distribution(X) # Check assert np.isclose(result, expected_result, atol=1e-5).all().all() def test_cumulative_distribution_fit_call_pd(self): """Cumulative_density integrates the probability density along the given values.""" # Setup copula = GaussianMultivariate(GaussianUnivariate) copula.fit(self.data.values) X = np.array([2000., 200., 1.]) expected_result = 0.4550595153746892 # Run result = copula.cumulative_distribution(X) # Check assert np.isclose(result, expected_result, atol=1e-5).all().all() @patch('copulas.multivariate.gaussian.np.random.multivariate_normal') def test_sample(self, normal_mock): """Sample use the inverse-transform method to generate new samples.""" # Setup instance = GaussianMultivariate(GaussianUnivariate) data = pd.DataFrame([ {'A': 25, 'B': 75, 'C': 100}, {'A': 30, 'B': 60, 'C': 250}, {'A': 10, 'B': 65, 'C': 350}, {'A': 20, 'B': 80, 'C': 150}, {'A': 25, 'B': 70, 'C': 500} ]) instance.fit(data) normal_mock.return_value = np.array([ [0.1, 0.1, 0.1], [0.2, 0.2, 0.2], [0.4, 0.4, 0.4], [0.6, 0.6, 0.6], [0.8, 0.8, 0.8] ]) expected_result = pd.DataFrame([ {'A': 22.678232998312527, 'B': 70.70710678118655, 'C': 284.35270009440734}, {'A': 23.356465996625055, 'B': 71.41421356237309, 'C': 298.7054001888146}, {'A': 24.712931993250110, 'B': 72.82842712474618, 'C': 327.4108003776293}, {'A': 26.069397989875164, 'B': 74.24264068711929, 'C': 356.116200566444}, {'A': 27.425863986500215, 'B': 75.65685424949238, 'C': 384.8216007552586} ]) # Run result = instance.sample(5) # Check assert result.equals(expected_result) assert normal_mock.called_once_with( np.zeros(instance.covariance.shape[0]), instance.covariance, 5 ) def test_sample_random_state(self): """When random_state is set the samples are the same.""" # Setup instance = GaussianMultivariate(GaussianUnivariate, random_seed=0) data = pd.DataFrame([ {'A': 25, 'B': 75, 'C': 100}, {'A': 30, 'B': 60, 'C': 250}, {'A': 10, 'B': 65, 'C': 350}, {'A': 20, 'B': 80, 'C': 150}, {'A': 25, 'B': 70, 'C': 500} ]) instance.fit(data) expected_result = pd.DataFrame( np.array([ [25.19031668, 61.96527251, 543.43595269], [31.50262306, 49.70971698, 429.06537124], [20.31636799, 64.3492326, 384.27561823], [25.00302427, 72.06019812, 415.85215123], [23.07525773, 66.70901743, 390.8226672] ]), columns=['A', 'B', 'C'] ) # Run result = instance.sample(5) # Check pd.testing.assert_frame_equal(result, expected_result, check_less_precise=True) def test_to_dict(self): """To_dict returns the parameters to replicate the copula.""" # Setup copula = GaussianMultivariate() copula.fit(self.data) # Run result = copula.to_dict() # Asserts assert result['type'] == 'copulas.multivariate.gaussian.GaussianMultivariate' assert result['columns'] == ['column1', 'column2', 'column3'] assert len(result['univariates']) == 3 expected_cov = copula._get_covariance(self.data).tolist() np.testing.assert_equal(result['covariance'], expected_cov) for univariate, result_univariate in zip(copula.univariates, result['univariates']): assert univariate.to_dict() == result_univariate def test_from_dict(self): """from_dict generates a new instance from its parameters.""" # Setup copula = GaussianMultivariate() copula.fit(self.data) copula_dict = copula.to_dict() # Run new_copula = GaussianMultivariate.from_dict(copula_dict) # Asserts assert isinstance(new_copula, GaussianMultivariate) assert new_copula.columns == ['column1', 'column2', 'column3'] assert len(new_copula.univariates) == 3 for new_univariate, old_univariate in zip(copula.univariates, new_copula.univariates): assert new_univariate.to_dict() == old_univariate.to_dict() def test_sample_constant_column(self): """Gaussian copula can sample after being fit with a constant column. This process will raise warnings when computing the covariance matrix """ # Setup instance = GaussianMultivariate() X = np.array([ [1.0, 2.0], [1.0, 3.0], [1.0, 4.0], [1.0, 5.0] ]) instance.fit(X) # Run result = instance.sample(5) # Check assert result.shape == (5, 2) assert result[~result.isnull()].all().all() assert result.loc[:, 0].equals(pd.Series([1.0, 1.0, 1.0, 1.0, 1.0], name=0)) # This is to check that the samples on the non constant column are not constant too. assert len(result.loc[:, 1].unique()) > 1 covariance = instance.covariance assert (~pd.isnull(covariance)).all().all()
test_fit_distribution_selector
field.py
import itertools as it import random from typing import Iterator, List, Tuple from cell import Cell from exceptions import BombDetonation, CellOutOfRange, NotEnoughFlags def handle_out_of_range(func): """Обработка позиции клетки вне поля. Обработка ситуации, когда клетки с введёнными игроком координатами не существует. Перехватываем IndexError, и выбрасываем CellOutOfRange. """ def new_func(*args, **kwargs): try: return func(*args, **kwargs) except IndexError: raise CellOutOfRange("Клетки с данной координатой не существует.") return new_func class Field: """Поле.""" def __init__(self, width: int, height: int): self.width = width self.height = height self._field = self._create_field() def __iter__(self) -> Iterator[List[Cell]]: return iter(self._field) def _create_field(self) -> List[List[Cell]]: """Создание пустого поля.""" return [ [Cell() for _ in range(self.width)] for _ in range(self.height) ] def set_bombs(self, bombs_count: int): """Расстановка бомб. Расстановка бомб и обновление значений у их соседних клеток. """ cells_count = self.width * self.height if bombs_count > cells_count: raise ValueError("Слишком много бомб!") cells_positions = it.product( range(self.width), range(self.height), repeat=1, ) bombs_positions = random.sample(tuple(cells_positions), k=bombs_count) for (bomb_x, bomb_y) in bombs_positions: cell = self._get_cell(bomb_x, bomb_y) cell.set_bomb() for neighbor_cell in self._get_all_neighbors(bomb_x, bomb_y): neighbor_cell.increment_value() def _get_cell(self, cell_x: int, cell_y: int) -> Cell: """Получение клетки по её координатам.""" return self._field[cell_y][cell_x] def _get_all_neighbors_positions( self, cell_x: int, cell_y: int ) -> Iterator[Tuple[int, int]]: """Получение позиций всех соседей клетки. Получение позиций соседей по сторонам и диагоналям. """ for (x_offset, y_offset) in it.product((-1, 0, 1), repeat=2): if x_offset == y_offset == 0: continue x = cell_x + x_offset y = cell_y + y_offset if x not in range(self.width) or y not in range(self.height): continue yield (x, y) def _get_all_neighbors(self, cell_x: int, cell_y: int) -> Iterator[Cell]: """Получение всех соседей клетки. Получение всех действительных соседей по сторонам и диагоналям. """ neighbors_positions = self._get_all_neighbors_positions(cell_x, cell_y) for (neighbor_x, neighbor_y) in neighbors_positions: yield self._get_cell(neighbor_x, neighbor_y) @handle_out_of_range def open_cell(self, cell_x: int, cell_y: int): """Открыть клетку.""" cell = self._get_cell(cell_x, cell_y) if cell.is_bomb: raise BombDetonation("Взрыв!") elif cell.is_empty: cell.set_open() self._open_empty_cell_neighbors(cell_x, cell_y)
elif cell.is_flagged: pass elif cell.has_value and cell.is_open: cell.set_open() self._open_valued_cell_neighbors(cell_x, cell_y) else: cell.set_open() cell.remove_flag() def _open_empty_cell_neighbors(self, cell_x: int, cell_y: int): """Открытие всех соседей пустой клетки. Открытиие всех соседних пустых клеток, и их первых не пустых соседей. """ neighbors_positions = self._get_all_neighbors_positions(cell_x, cell_y) for (x, y) in neighbors_positions: cell = self._get_cell(x, y) if cell.is_open: continue cell.set_open() if cell.is_empty: self._open_empty_cell_neighbors(x, y) def _open_valued_cell_neighbors(self, cell_x: int, cell_y: int): """Открытие соседей численной клетки. Если рядом с численной клеткой поставлено достаточное количество флагов, то открываем все соседние, не помеченные флагом, клетки. Иначе бросаем исключение. """ flags_count = 0 for neighbor_cell in self._get_all_neighbors(cell_x, cell_y): if neighbor_cell.is_flagged: flags_count += 1 cell = self._get_cell(cell_x, cell_y) if flags_count != cell.value: raise NotEnoughFlags("Недостаточно флагов для открытия соседей!") neighbors_positions = self._get_all_neighbors_positions(cell_x, cell_y) for (neighbor_x, neighbor_y) in neighbors_positions: neighbor_cell = self._get_cell(neighbor_x, neighbor_y) if not neighbor_cell.is_flagged and not neighbor_cell.is_open: self.open_cell(neighbor_x, neighbor_y) @handle_out_of_range def set_flag(self, cell_x: int, cell_y: int): """Пометить клетку флагом.""" cell = self._get_cell(cell_x, cell_y) cell.set_flagged() @handle_out_of_range def remove_flag(self, cell_x: int, cell_y: int): """Убрать пометку флага с клетки.""" cell = self._get_cell(cell_x, cell_y) cell.remove_flag() def is_win(self) -> bool: """Пройдена ли игра.""" return all( cell.is_open or cell.is_flagged for row in self for cell in row )
slots.rs
//---------------------------------------------------------------------------// // Copyright (c) 2017-2020 Ismael Gutiérrez González. All rights reserved. // // This file is part of the Rusted PackFile Manager (RPFM) project, // which can be found here: https://github.com/Frodo45127/rpfm. // // This file is licensed under the MIT license, which can be found here: // https://github.com/Frodo45127/rpfm/blob/master/LICENSE. //---------------------------------------------------------------------------// /*! Module with the slots for Table Views. !*/ use qt_widgets::SlotOfQPoint; use qt_widgets::QFileDialog; use qt_widgets::q_file_dialog::AcceptMode; use qt_widgets::SlotOfIntSortOrder; use qt_widgets::q_header_view::ResizeMode; use qt_gui::QBrush; use qt_gui::QCursor; use qt_gui::SlotOfQStandardItem; use qt_core::QBox; use qt_core::QItemSelection; use qt_core::QSignalBlocker; use qt_core::{SlotOfBool, SlotOfInt, SlotNoArgs, SlotOfQString, SlotOfQItemSelectionQItemSelection, SlotOfQModelIndex}; use std::path::PathBuf; use std::rc::Rc; use std::sync::{Arc, atomic::Ordering, RwLock}; use rpfm_lib::packfile::PathType; use rpfm_lib::packedfile::table::Table; use crate::app_ui::AppUI; use crate::diagnostics_ui::DiagnosticsUI; use crate::ffi::*; use crate::global_search_ui::GlobalSearchUI; use crate::packfile_contents_ui::PackFileContentsUI; use crate::packedfile_views::utils::set_modified; use crate::pack_tree::*; use crate::utils::{check_regex, log_to_status_bar, show_dialog}; use crate::UI_STATE; use super::utils::*; use super::*; //-------------------------------------------------------------------------------// // Enums & Structs //-------------------------------------------------------------------------------// /// This struct contains the slots of the view of a Table PackedFile. pub struct TableViewSlots { pub delayed_updates: QBox<SlotNoArgs>, pub toggle_lookups: QBox<SlotOfBool>, pub sort_order_column_changed: QBox<SlotOfIntSortOrder>, pub show_context_menu: QBox<SlotOfQPoint>, pub context_menu_enabler: QBox<SlotOfQItemSelectionQItemSelection>, pub item_changed: QBox<SlotOfQStandardItem>, pub add_rows: QBox<SlotNoArgs>, pub insert_rows: QBox<SlotNoArgs>, pub delete_rows: QBox<SlotNoArgs>, pub delete_rows_not_in_filter: QBox<SlotNoArgs>, pub clone_and_append: QBox<SlotNoArgs>, pub clone_and_insert: QBox<SlotNoArgs>, pub copy: QBox<SlotNoArgs>, pub copy_as_lua_table: QBox<SlotNoArgs>, pub paste: QBox<SlotNoArgs>, pub paste_as_new_row: QBox<SlotNoArgs>, pub invert_selection: QBox<SlotNoArgs>, pub reset_selection: QBox<SlotNoArgs>, pub rewrite_selection: QBox<SlotNoArgs>, pub generate_ids: QBox<SlotNoArgs>, pub undo: QBox<SlotNoArgs>, pub redo: QBox<SlotNoArgs>, pub import_tsv: QBox<SlotOfBool>, pub export_tsv: QBox<SlotOfBool>, pub smart_delete: QBox<SlotNoArgs>, pub resize_columns: QBox<SlotNoArgs>, pub sidebar: QBox<SlotOfBool>, pub search: QBox<SlotOfBool>, pub cascade_edition: QBox<SlotNoArgs>, pub go_to_definition: QBox<SlotNoArgs>, pub go_to_loc: Vec<QBox<SlotNoArgs>>, pub hide_show_columns: Vec<QBox<SlotOfInt>>, pub hide_show_columns_all: QBox<SlotOfInt>, pub freeze_columns: Vec<QBox<SlotOfInt>>, pub freeze_columns_all: QBox<SlotOfInt>, pub search_search: QBox<SlotNoArgs>, pub search_prev_match: QBox<SlotNoArgs>, pub search_next_match: QBox<SlotNoArgs>, pub search_replace_current: QBox<SlotNoArgs>, pub search_replace_all: QBox<SlotNoArgs>, pub search_close: QBox<SlotNoArgs>, pub search_check_regex: QBox<SlotOfQString>, pub open_subtable: QBox<SlotOfQModelIndex>, } /// This struct contains the slots of the view of a table filter. pub struct FilterViewSlots { pub filter_line_edit: QBox<SlotOfQString>, pub filter_column_selector: QBox<SlotOfInt>, pub filter_case_sensitive_button: QBox<SlotNoArgs>, pub filter_check_regex: QBox<SlotOfQString>, pub filter_add: QBox<SlotNoArgs>, pub filter_remove: QBox<SlotNoArgs>, } //-------------------------------------------------------------------------------// // Implementations //-------------------------------------------------------------------------------// /// Implementation for `TableViewSlots`. impl TableViewSlots { /// This function creates the entire slot pack for images. pub unsafe fn new( view: &Arc<TableView>, app_ui: &Rc<AppUI>, pack_file_contents_ui: &Rc<PackFileContentsUI>, global_search_ui: &Rc<GlobalSearchUI>, diagnostics_ui: &Rc<DiagnosticsUI>, packed_file_path: Option<Arc<RwLock<Vec<String>>>>, ) -> Self { // When we want to update the diagnostic/global search data of this table. let delayed_updates = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, diagnostics_ui, view => move || { // Only save to the backend if both, the save and undo locks are disabled. Otherwise this will cause locks. if !view.save_lock.load(Ordering::SeqCst) && !view.undo_lock.load(Ordering::SeqCst) { if let Some(ref packed_file_path) = view.packed_file_path { if let Some(packed_file) = UI_STATE.get_open_packedfiles().iter().find(|x| *x.get_ref_path() == *packed_file_path.read().unwrap()) { if let Err(error) = packed_file.save(&app_ui, &pack_file_contents_ui) { show_dialog(&view.table_view_primary, error, false); } else { if SETTINGS.read().unwrap().settings_bool["diagnostics_trigger_on_table_edit"] { if let Some(path) = view.get_packed_file_path() { if diagnostics_ui.get_ref_diagnostics_dock_widget().is_visible() { let path_types = vec![PathType::File(path)]; DiagnosticsUI::check_on_path(&app_ui, &pack_file_contents_ui, &diagnostics_ui, path_types); } } } } } } } })); // When we want to toggle the lookups on and off. let toggle_lookups = SlotOfBool::new(&view.table_view_primary, clone!( view => move |_| { view.toggle_lookups(); })); let sort_order_column_changed = SlotOfIntSortOrder::new(&view.table_view_primary, clone!( view => move |column, _| { sort_column(&view.get_mut_ptr_table_view_primary(), column, view.column_sort_state.clone()); } )); // When we want to show the context menu. let show_context_menu = SlotOfQPoint::new(&view.table_view_primary, clone!( mut view => move |_| { view.context_menu.exec_1a_mut(&QCursor::pos_0a()); })); // When we want to trigger the context menu update function. let context_menu_enabler = SlotOfQItemSelectionQItemSelection::new(&view.table_view_primary, clone!( mut view => move |_,_| { view.context_menu_update(); })); // When we want to respond to a change in one item in the model. let item_changed = SlotOfQStandardItem::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move |item| { // If we are NOT UNDOING, paint the item as edited and add the edition to the undo list. if !view.undo_lock.load(Ordering::SeqCst) { let item_old = view.undo_model.item_2a(item.row(), item.column()); // Only trigger this if the values are actually different. Checkable cells are tricky. Nested cells an go to hell. if (item_old.text().compare_q_string(item.text().as_ref()) != 0 || item_old.check_state() != item.check_state()) || item_old.data_1a(ITEM_IS_SEQUENCE).to_bool() && 0 != item_old.data_1a(ITEM_SEQUENCE_DATA).to_string().compare_q_string(&item.data_1a(ITEM_SEQUENCE_DATA).to_string()) { let mut edition = Vec::with_capacity(1); edition.push(((item.row(), item.column()), atomic_from_ptr((&*item_old).clone()))); let operation = TableOperations::Editing(edition); view.history_undo.write().unwrap().push(operation); view.history_redo.write().unwrap().clear(); { // We block the saving for painting, so this doesn't get rettriggered again. let blocker = QSignalBlocker::from_q_object(&view.table_model); let color = get_color_modified(); let item = item; item.set_background(&QBrush::from_q_color(color.as_ref().unwrap())); blocker.unblock(); } // For pasting, or really any heavy operation, only do these tasks the last iteration of the operation. if !view.save_lock.load(Ordering::SeqCst) { update_undo_model(&view.get_mut_ptr_table_model(), &view.get_mut_ptr_undo_model()); view.context_menu_update(); if let Some(ref packed_file_path) = packed_file_path { set_modified(true, &packed_file_path.read().unwrap(), &app_ui, &pack_file_contents_ui); } } } } if SETTINGS.read().unwrap().settings_bool["table_resize_on_edit"] { view.table_view_primary.horizontal_header().resize_sections(ResizeMode::ResizeToContents); } view.start_delayed_updates_timer(); } )); // When you want to append a row to the table... let add_rows = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { view.append_rows(false); if let Some(ref packed_file_path) = view.packed_file_path { set_modified(true, &packed_file_path.read().unwrap(), &app_ui, &pack_file_contents_ui); } } )); // When you want to insert a row in a specific position of the table... let insert_rows = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { view.insert_rows(false); if let Some(ref packed_file_path) = view.packed_file_path { set_modified(true, &packed_file_path.read().unwrap(), &app_ui, &pack_file_contents_ui); } } )); // When you want to delete one or more rows... let delete_rows = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { view.smart_delete(true, &app_ui, &pack_file_contents_ui); } )); // When you want to delete all rows not in the current filter... let delete_rows_not_in_filter = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { if AppUI::are_you_sure_edition(&app_ui, "are_you_sure_delete_filtered_out_rows") { view.delete_filtered_out_rows(&app_ui, &pack_file_contents_ui); } } )); // When you want to clone and insert one or more rows. let clone_and_append = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { view.append_rows(true); if let Some(ref packed_file_path) = view.packed_file_path { set_modified(true, &packed_file_path.read().unwrap(), &app_ui, &pack_file_contents_ui); } })); // When you want to clone and append one or more rows. let clone_and_insert = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { view.insert_rows(true); if let Some(ref packed_file_path) = view.packed_file_path { set_modified(true, &packed_file_path.read().unwrap(), &app_ui, &pack_file_contents_ui); } })); // When you want to copy one or more cells. let copy = SlotNoArgs::new(&view.table_view_primary, clone!( view => move || { view.copy_selection(); })); // When you want to copy a table as a lua table. let copy_as_lua_table = SlotNoArgs::new(&view.table_view_primary, clone!( view => move || { view.copy_selection_as_lua_table(); })); // When you want to copy one or more cells. let paste = SlotNoArgs::new(&view.table_view_primary, clone!( view, app_ui, pack_file_contents_ui => move || { view.paste(&app_ui, &pack_file_contents_ui); })); // When you want to paste a row at the end of the table... let paste_as_new_row = SlotNoArgs::new(&view.table_view_primary, clone!( view, app_ui, pack_file_contents_ui => move || { view.paste_as_new_row(&app_ui, &pack_file_contents_ui); } )); // When we want to invert the selection of the table. let invert_selection = SlotNoArgs::new(&view.table_view_primary, clone!( mut view => move || { let rows = view.table_filter.row_count_0a(); let columns = view.table_filter.column_count_0a(); if rows > 0 && columns > 0 { let selection_model = view.table_view_primary.selection_model(); let first_item = view.table_filter.index_2a(0, 0); let last_item = view.table_filter.index_2a(rows - 1, columns - 1); let selection = QItemSelection::new_2a(&first_item, &last_item); selection_model.select_q_item_selection_q_flags_selection_flag(&selection, QFlags::from(SelectionFlag::Toggle)); } })); // When we want to reset the selected items of the table to their original value. let reset_selection = SlotNoArgs::new(&view.table_view_primary, clone!( mut view => move || { view.reset_selection(); })); // When we want to rewrite the selected items using a formula. let rewrite_selection = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { view.rewrite_selection(&app_ui, &pack_file_contents_ui); })); // When we want to rewrite the selected items using a formula. let generate_ids = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { view.generate_ids(&app_ui, &pack_file_contents_ui); })); // When we want to undo the last action. let undo = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { view.undo_redo(true, 0); update_undo_model(&view.get_mut_ptr_table_model(), &view.get_mut_ptr_undo_model()); view.context_menu_update(); if view.history_undo.read().unwrap().is_empty() { if let Some(ref packed_file_path) = view.packed_file_path { set_modified(false, &packed_file_path.read().unwrap(), &app_ui, &pack_file_contents_ui); } } } )); // When we want to redo the last undone action. let redo = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { view.undo_redo(false, 0); update_undo_model(&view.get_mut_ptr_table_model(), &view.get_mut_ptr_undo_model()); view.context_menu_update(); if let Some(ref packed_file_path) = view.packed_file_path { set_modified(true, &packed_file_path.read().unwrap(), &app_ui, &pack_file_contents_ui); } } )); // When we want to import a TSV file. let import_tsv = SlotOfBool::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move |_| { // For now only import if this is the parent table. if let Some(ref packed_file_path) = view.packed_file_path { // Create a File Chooser to get the destination path and configure it. let file_dialog = QFileDialog::from_q_widget_q_string( &view.table_view_primary, &qtr("tsv_select_title"), ); file_dialog.set_name_filter(&QString::from_std_str("TSV Files (*.tsv)")); // Run it and, if we receive 1 (Accept), try to import the TSV file. if file_dialog.exec() == 1 { let path = PathBuf::from(file_dialog.selected_files().at(0).to_std_string()); CENTRAL_COMMAND.send_message_qt(Command::ImportTSV((packed_file_path.read().unwrap().to_vec(), path))); let response = CENTRAL_COMMAND.recv_message_qt_try(); match response { Response::TableType(data) => { let old_data = view.get_copy_of_table(); view.undo_lock.store(true, Ordering::SeqCst); load_data( &view.get_mut_ptr_table_view_primary(), &view.get_mut_ptr_table_view_frozen(), &view.get_ref_table_definition(), &view.dependency_data, &data ); // Prepare the diagnostic pass. view.start_delayed_updates_timer(); let table_name = match data { TableType::DB(_) => packed_file_path.read().unwrap().get(1).cloned(), _ => None, }; build_columns( &view.get_mut_ptr_table_view_primary(), Some(&view.get_mut_ptr_table_view_frozen()), &view.get_ref_table_definition(), table_name.as_ref() ); view.undo_lock.store(false, Ordering::SeqCst); view.history_undo.write().unwrap().push(TableOperations::ImportTSV(old_data)); view.history_redo.write().unwrap().clear(); update_undo_model(&view.get_mut_ptr_table_model(), &view.get_mut_ptr_undo_model()); set_modified(true, &packed_file_path.read().unwrap(), &app_ui, &pack_file_contents_ui); }, Response::Error(error) => return show_dialog(&view.table_view_primary, error, false), _ => panic!("{}{:?}", THREADS_COMMUNICATION_ERROR, response), } //unsafe { update_search_stuff.as_mut().unwrap().trigger(); } view.context_menu_update(); } } } )); // When we want to export the table as a TSV File. let export_tsv = SlotOfBool::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move |_| { if let Some(ref packed_file_path) = view.packed_file_path { // Create a File Chooser to get the destination path and configure it. let file_dialog = QFileDialog::from_q_widget_q_string( &view.table_view_primary, &qtr("tsv_export_title") ); file_dialog.set_accept_mode(AcceptMode::AcceptSave); file_dialog.set_confirm_overwrite(true); file_dialog.set_name_filter(&QString::from_std_str("TSV Files (*.tsv)")); file_dialog.set_default_suffix(&QString::from_std_str("tsv")); // Run it and, if we receive 1 (Accept), export the DB Table, saving it's contents first. if file_dialog.exec() == 1 { let path = PathBuf::from(file_dialog.selected_files().at(0).to_std_string()); if let Some(packed_file) = UI_STATE.get_open_packedfiles().iter().find(|x| *x.get_ref_path() == *packed_file_path.read().unwrap()) { if let Err(error) = packed_file.save(&app_ui, &pack_file_contents_ui) { return show_dialog(&view.table_view_primary, error, false); } } CENTRAL_COMMAND.send_message_qt(Command::ExportTSV((packed_file_path.read().unwrap().to_vec(), path))); let response = CENTRAL_COMMAND.recv_message_qt_try(); match response { Response::Success => return, Response::Error(error) => return show_dialog(&view.table_view_primary, error, false), _ => panic!("{}{:?}", THREADS_COMMUNICATION_ERROR, response), } } } } )); // When we want to resize the columns depending on their contents... let resize_columns = SlotNoArgs::new(&view.table_view_primary, clone!(view => move || { view.table_view_primary.horizontal_header().resize_sections(ResizeMode::ResizeToContents); if SETTINGS.read().unwrap().settings_bool["extend_last_column_on_tables"] { view.table_view_primary.horizontal_header().set_stretch_last_section(false); view.table_view_primary.horizontal_header().set_stretch_last_section(true); } })); // When you want to use the "Smart Delete" feature... let smart_delete = SlotNoArgs::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, view => move || { view.smart_delete(false, &app_ui, &pack_file_contents_ui); } )); let sidebar = SlotOfBool::new(&view.table_view_primary, clone!( mut view => move |_| { match view.sidebar_scroll_area.is_visible() { true => view.sidebar_scroll_area.hide(), false => view.sidebar_scroll_area.show() } })); let search = SlotOfBool::new(&view.table_view_primary, clone!( mut view => move |_| { match view.search_widget.is_visible() { true => view.search_widget.hide(), false => { view.search_widget.show(); view.search_search_line_edit.set_focus_0a(); } } })); let cascade_edition = SlotNoArgs::new(&view.table_view_primary, clone!( view, app_ui, pack_file_contents_ui => move || { view.cascade_edition(&app_ui, &pack_file_contents_ui); } )); let go_to_definition = SlotNoArgs::new(&view.table_view_primary, clone!( view, app_ui, pack_file_contents_ui, global_search_ui, diagnostics_ui => move || { if let Some(error) = view.go_to_definition(&app_ui, &pack_file_contents_ui, &global_search_ui, &diagnostics_ui) { log_to_status_bar(&error); } } )); let mut go_to_loc = vec![]; for field in view.get_ref_table_definition().get_localised_fields() { let field_name = field.get_name().to_owned(); let slot = SlotNoArgs::new(&view.table_view_primary, clone!( view, app_ui, pack_file_contents_ui, global_search_ui, diagnostics_ui => move || { if let Some(error) = view.go_to_loc(&app_ui, &pack_file_contents_ui, &global_search_ui, &diagnostics_ui, &field_name) { log_to_status_bar(&error); } } )); go_to_loc.push(slot); } let mut hide_show_columns = vec![]; let mut freeze_columns = vec![]; let fields = get_fields_sorted(&view.get_ref_table_definition()); for field in &fields { if let Some(index) = view.get_ref_table_definition().get_fields_processed().iter().position(|x| x == field) { let hide_show_slot = SlotOfInt::new(&view.table_view_primary, clone!( mut view => move |state| { let state = state == 2; view.table_view_primary.set_column_hidden(index as i32, state); } )); let freeze_slot = SlotOfInt::new(&view.table_view_primary, clone!( mut view => move |_| { toggle_freezer_safe(&view.table_view_primary, index as i32); } )); hide_show_columns.push(hide_show_slot); freeze_columns.push(freeze_slot); } } let hide_show_columns_all = SlotOfInt::new(&view.table_view_primary, clone!( mut view => move |state| { let state = state == 2; view.get_hide_show_checkboxes().iter().for_each(|x| x.set_checked(state)) } )); let freeze_columns_all = SlotOfInt::new(&view.table_view_primary, clone!( mut view => move |state| { let state = state == 2; view.get_freeze_checkboxes().iter().for_each(|x| x.set_checked(state)) } )); //------------------------------------------------------// // Slots related with the search panel. //------------------------------------------------------// let search_search = SlotNoArgs::new(&view.table_view_primary, clone!( mut view => move || { TableSearch::search(&view); } )); let search_prev_match = SlotNoArgs::new(&view.table_view_primary, clone!( mut view => move || { TableSearch::prev_match(&view); } )); let search_next_match = SlotNoArgs::new(&view.table_view_primary, clone!( mut view => move || { TableSearch::next_match(&view); } )); let search_replace_current = SlotNoArgs::new(&view.table_view_primary, clone!( mut view => move || { TableSearch::replace_current(&view); } )); let search_replace_all = SlotNoArgs::new(&view.table_view_primary, clone!( mut view => move || { TableSearch::replace_all(&view); } )); let search_close = SlotNoArgs::new(&view.table_view_primary, clone!( mut view => move || { view.search_widget.hide(); view.table_view_primary.set_focus_0a(); } )); // What happens when we trigger the "Check Regex" action. let search_check_regex = SlotOfQString::new(&view.table_view_primary, clone!( mut view => move |string| { check_regex(&string.to_std_string(), view.search_search_line_edit.static_upcast()); })); let open_subtable = SlotOfQModelIndex::new(&view.table_view_primary, clone!( app_ui, pack_file_contents_ui, global_search_ui, diagnostics_ui, view => move |model_index| { if model_index.data_1a(ITEM_IS_SEQUENCE).to_bool() { let data = model_index.data_1a(ITEM_SEQUENCE_DATA).to_string().to_std_string(); let table: Table = serde_json::from_str(&data).unwrap(); let table_data = match *view.packed_file_type { PackedFileType::DB => TableType::DB(From::from(table)), PackedFileType::Loc => TableType::Loc(From::from(table)), PackedFileType::MatchedCombat => TableType::MatchedCombat(From::from(table)), PackedFileType::AnimTable => TableType::AnimTable(From::from(table)), PackedFileType::DependencyPackFilesList => unimplemented!("This should never happen, unless you messed up the schemas"), _ => unimplemented!("You forgot to implement subtables for this kind of packedfile"), }; if let Some(new_data) = open_subtable( view.table_view_primary.static_upcast(), &app_ui, &global_search_ui, &pack_file_contents_ui, &diagnostics_ui, table_data ) { view.table_filter.set_data_3a( model_index, &QVariant::from_q_string(&QString::from_std_str(new_data)), ITEM_SEQUENCE_DATA ); } } } )); // Return the slots, so we can keep them alive for the duration of the view. Self { delayed_updates, toggle_lookups, sort_order_column_changed, show_context_menu, context_menu_enabler, item_changed, add_rows, insert_rows, delete_rows, delete_rows_not_in_filter, clone_and_append, clone_and_insert, copy, copy_as_lua_table, paste, paste_as_new_row, invert_selection, reset_selection, rewrite_selection, generate_ids, undo, redo, import_tsv, export_tsv, smart_delete, resize_columns, sidebar, search, cascade_edition, go_to_definition, go_to_loc, hide_show_columns, hide_show_columns_all, freeze_columns, freeze_columns_all, search_search, search_prev_match, search_next_match, search_replace_current, search_replace_all, search_close, search_check_regex, open_subtable, } } } /// Implementation for `FilterViewSlots`. impl FilterViewSlots { pub unsafe fn new( view: &Arc<FilterView>, parent_view: &Arc<TableView>, ) -> Self {
// When we want to filter the table... let filter_line_edit = SlotOfQString::new(&view.filter_widget, clone!( parent_view => move |_| { parent_view.filter_table(); })); let filter_column_selector = SlotOfInt::new(&view.filter_widget, clone!( parent_view => move |_| { parent_view.filter_table(); })); let filter_case_sensitive_button = SlotNoArgs::new(&view.filter_widget, clone!( parent_view => move || { parent_view.filter_table(); })); // What happens when we trigger the "Check Regex" action. let filter_check_regex = SlotOfQString::new(&view.filter_widget, clone!( view => move |string| { check_regex(&string.to_std_string(), view.filter_line_edit.static_upcast()); })); let filter_add = SlotNoArgs::new(&view.filter_widget, clone!( parent_view => move || { FilterView::new(&parent_view); })); let filter_remove = SlotNoArgs::new(&view.filter_widget, clone!( parent_view => move || { if parent_view.get_ref_filters().len() > 1 { parent_view.filter_base_widget.layout().remove_widget(parent_view.get_ref_filters().last().unwrap().filter_widget.as_ptr()); parent_view.get_ref_mut_filters().pop(); parent_view.filter_table(); } })); Self { filter_line_edit, filter_column_selector, filter_case_sensitive_button, filter_check_regex, filter_add, filter_remove, } } }
navmesh.rs
//! Contains all structures and methods to create and manage navigation meshes (navmesh). //! //! Navigation mesh is a set of convex polygons which is used for path finding in complex //! environment. #![warn(missing_docs)] use crate::scene::mesh::buffer::{VertexAttributeUsage, VertexReadTrait}; use crate::{ core::{ algebra::{Point3, Vector3}, arrayvec::ArrayVec, math::{self, ray::Ray, TriangleDefinition}, octree::{Octree, OctreeNode}, pool::Handle, visitor::{Visit, VisitResult, Visitor}, }, scene::mesh::Mesh, utils::{ astar::{PathError, PathFinder, PathKind, PathVertex}, raw_mesh::{RawMeshBuilder, RawVertex}, }, }; use std::{ collections::HashSet, hash::{Hash, Hasher}, }; /// See module docs. #[derive(Clone, Debug, Default)] pub struct Navmesh { octree: Octree, triangles: Vec<TriangleDefinition>, pathfinder: PathFinder, query_buffer: Vec<u32>, } impl Visit for Navmesh { fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult { visitor.enter_region(name)?; self.pathfinder.visit("PathFinder", visitor)?; self.triangles.visit("Triangles", visitor)?; // No need to save octree, we can restore it on load. if visitor.is_reading() { let vertices = self.pathfinder.vertices(); let raw_triangles = self .triangles .iter() .map(|t| { [ vertices[t[0] as usize].position, vertices[t[1] as usize].position, vertices[t[2] as usize].position, ] }) .collect::<Vec<[Vector3<f32>; 3]>>(); self.octree = Octree::new(&raw_triangles, 32); } visitor.leave_region() } } #[derive(Copy, Clone)] struct Edge { a: u32, b: u32, } impl PartialEq for Edge { fn eq(&self, other: &Self) -> bool { // Direction-agnostic compare. (self.a == other.a && self.b == other.b) || (self.a == other.b && self.b == other.a) } } impl Eq for Edge {} impl Hash for Edge { fn hash<H: Hasher>(&self, state: &mut H)
} impl Navmesh { /// Creates new navigation mesh from given set of triangles and vertices. This is /// low level method that allows to specify triangles and vertices directly. In /// most cases you should use `from_mesh` method. pub fn new(triangles: &[TriangleDefinition], vertices: &[Vector3<f32>]) -> Self { // Build triangles for octree. let raw_triangles = triangles .iter() .map(|t| { [ vertices[t[0] as usize], vertices[t[1] as usize], vertices[t[2] as usize], ] }) .collect::<Vec<[Vector3<f32>; 3]>>(); // Fill in pathfinder. let mut pathfinder = PathFinder::new(); pathfinder.set_vertices(vertices.iter().map(|v| PathVertex::new(*v)).collect()); let mut edges = HashSet::new(); for triangle in triangles { edges.insert(Edge { a: triangle[0], b: triangle[1], }); edges.insert(Edge { a: triangle[1], b: triangle[2], }); edges.insert(Edge { a: triangle[2], b: triangle[0], }); } for edge in edges { pathfinder.link_bidirect(edge.a as usize, edge.b as usize); } Self { triangles: triangles.to_vec(), octree: Octree::new(&raw_triangles, 32), pathfinder, query_buffer: Default::default(), } } /// Creates new navigation mesh (navmesh) from given mesh. It is most simple way to create complex /// navigation mesh, it should be used in pair with model loading functionality - you can /// load model from file and turn it into navigation mesh, or even build navigation mesh /// from a model in existing scene. This method "eats" any kind of meshes with any amount /// of surfaces - it joins all surfaces into single mesh and creates navmesh from it. /// /// Example: /// ``` /// use rg3d::scene::Scene; /// use rg3d::utils::navmesh::Navmesh; /// /// fn make_navmesh(scene: &Scene, navmesh_name: &str) -> Navmesh { /// // Find mesh node in existing scene and create navigation mesh from it. /// let navmesh_node_handle = scene.graph.find_by_name_from_root(navmesh_name); /// Navmesh::from_mesh(scene.graph[navmesh_node_handle].as_mesh()) /// } /// ``` pub fn from_mesh(mesh: &Mesh) -> Self { // Join surfaces into one simple mesh. let mut builder = RawMeshBuilder::<RawVertex>::default(); let global_transform = mesh.global_transform(); for surface in mesh.surfaces() { let shared_data = surface.data(); let shared_data = shared_data.lock(); let vertex_buffer = &shared_data.vertex_buffer; for triangle in shared_data.geometry_buffer.iter() { builder.insert(RawVertex::from( global_transform .transform_point(&Point3::from( vertex_buffer .get(triangle[0] as usize) .unwrap() .read_3_f32(VertexAttributeUsage::Position) .unwrap(), )) .coords, )); builder.insert(RawVertex::from( global_transform .transform_point(&Point3::from( vertex_buffer .get(triangle[1] as usize) .unwrap() .read_3_f32(VertexAttributeUsage::Position) .unwrap(), )) .coords, )); builder.insert(RawVertex::from( global_transform .transform_point(&Point3::from( vertex_buffer .get(triangle[2] as usize) .unwrap() .read_3_f32(VertexAttributeUsage::Position) .unwrap(), )) .coords, )); } } let mesh = builder.build(); Navmesh::new( &mesh.triangles, &mesh .vertices .into_iter() .map(|v| Vector3::new(v.x, v.y, v.z)) .collect::<Vec<_>>(), ) } /// Searches closest graph vertex to given point. Returns Some(index), or None /// if navmesh was empty. pub fn query_closest(&mut self, point: Vector3<f32>) -> Option<usize> { self.octree.point_query(point, &mut self.query_buffer); if self.query_buffer.is_empty() { // TODO: This is not optimal. It is better to trace ray down from given point // and pick closest triangle. math::get_closest_point(self.pathfinder.vertices(), point) } else { math::get_closest_point_triangles( self.pathfinder.vertices(), &self.triangles, &self.query_buffer, point, ) } } /// Returns reference to array of triangles. pub fn triangles(&self) -> &[TriangleDefinition] { &self.triangles } /// Returns reference to array of vertices. pub fn vertices(&self) -> &[PathVertex] { self.pathfinder.vertices() } /// Returns shared reference to inner octree. pub fn octree(&self) -> &Octree { &self.octree } /// Tries to build path using indices of begin and end points. /// /// Example: /// /// ``` /// use rg3d::utils::navmesh::Navmesh; /// use rg3d::core::algebra::Vector3; /// use rg3d::utils::astar::{PathKind, PathError}; /// /// fn find_path(navmesh: &mut Navmesh, begin: Vector3<f32>, end: Vector3<f32>, path: &mut Vec<Vector3<f32>>) -> Result<PathKind, PathError> { /// if let Some(begin_index) = navmesh.query_closest(begin) { /// if let Some(end_index) = navmesh.query_closest(end) { /// return navmesh.build_path(begin_index, end_index, path); /// } /// } /// Ok(PathKind::Empty) /// } /// ``` pub fn build_path( &mut self, from: usize, to: usize, path: &mut Vec<Vector3<f32>>, ) -> Result<PathKind, PathError> { self.pathfinder.build(from, to, path) } /// Tries to pick a triangle by given ray. pub fn ray_cast(&self, ray: Ray) -> Option<(Vector3<f32>, usize, TriangleDefinition)> { let mut buffer = ArrayVec::<Handle<OctreeNode>, 128>::new(); self.octree.ray_query_static(&ray, &mut buffer); for node in buffer.into_iter() { if let OctreeNode::Leaf { indices, .. } = self.octree.node(node) { for &index in indices { let triangle = self.triangles[index as usize].clone(); let a = self.pathfinder.vertices()[triangle[0] as usize].position; let b = self.pathfinder.vertices()[triangle[1] as usize].position; let c = self.pathfinder.vertices()[triangle[2] as usize].position; if let Some(intersection) = ray.triangle_intersection_point(&[a, b, c]) { return Some((intersection, index as usize, triangle)); } } } else { unreachable!() } } None } } /// Navmesh agent is a "pathfinding unit" that performs navigation on a mesh. It is designed to /// cover most of simple use cases when you need to build and follow some path from point A to point B. pub struct NavmeshAgent { path: Vec<Vector3<f32>>, current: u32, position: Vector3<f32>, last_warp_position: Vector3<f32>, target: Vector3<f32>, last_target_position: Vector3<f32>, recalculation_threshold: f32, speed: f32, path_dirty: bool, } impl Visit for NavmeshAgent { fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult { visitor.enter_region(name)?; self.path.visit("Path", visitor)?; self.current.visit("Current", visitor)?; self.position.visit("Position", visitor)?; self.last_warp_position.visit("LastWarpPosition", visitor)?; self.target.visit("Target", visitor)?; self.last_target_position .visit("LastTargetPosition", visitor)?; self.recalculation_threshold .visit("RecalculationThreshold", visitor)?; self.speed.visit("Speed", visitor)?; self.path_dirty.visit("PathDirty", visitor)?; visitor.leave_region() } } impl Default for NavmeshAgent { fn default() -> Self { Self::new() } } impl NavmeshAgent { /// Creates new navigation mesh agent. pub fn new() -> Self { Self { path: vec![], current: 0, position: Default::default(), last_warp_position: Default::default(), target: Default::default(), last_target_position: Default::default(), recalculation_threshold: 0.25, speed: 1.5, path_dirty: true, } } /// Returns agent's position. pub fn position(&self) -> Vector3<f32> { self.position } /// Returns agent's path that will be followed. pub fn path(&self) -> &[Vector3<f32>] { &self.path } /// Sets new speed of agent's movement. pub fn set_speed(&mut self, speed: f32) { self.speed = speed; } /// Returns current agent's movement speed. pub fn speed(&self) -> f32 { self.speed } } fn closest_point_index_in_triangle_and_adjacent( triangle: TriangleDefinition, navmesh: &Navmesh, to: Vector3<f32>, ) -> Option<usize> { let mut triangles = ArrayVec::<TriangleDefinition, 4>::new(); triangles.push(triangle); math::get_closest_point_triangle_set(navmesh.pathfinder.vertices(), &triangles, to) } impl NavmeshAgent { /// Calculates path from point A to point B. In most cases there is no need to use this method /// directly, because `update` will call it anyway if target position has moved. pub fn calculate_path( &mut self, navmesh: &mut Navmesh, from: Vector3<f32>, to: Vector3<f32>, ) -> Result<PathKind, PathError> { self.path.clear(); self.current = 0; let (n_from, begin, from_triangle) = if let Some((point, index, triangle)) = navmesh .ray_cast(Ray::new( from + Vector3::new(0.0, 1.0, 0.0), Vector3::new(0.0, -10.0, 0.0), )) { ( closest_point_index_in_triangle_and_adjacent(triangle, navmesh, to), Some(point), Some(index), ) } else { (navmesh.query_closest(from), None, None) }; let (n_to, end, to_triangle) = if let Some((point, index, triangle)) = navmesh.ray_cast(Ray::new( to + Vector3::new(0.0, 1.0, 0.0), Vector3::new(0.0, -10.0, 0.0), )) { ( closest_point_index_in_triangle_and_adjacent(triangle, navmesh, from), Some(point), Some(index), ) } else { (navmesh.query_closest(to), None, None) }; if let (Some(from_triangle), Some(to_triangle)) = (from_triangle, to_triangle) { if from_triangle == to_triangle { self.path.push(from); self.path.push(to); return Ok(PathKind::Full); } } if let (Some(n_from), Some(n_to)) = (n_from, n_to) { let result = navmesh.build_path(n_from, n_to, &mut self.path); if let Some(end) = end { if self.path.is_empty() { self.path.push(end); } else { self.path.insert(0, end) } } if let Some(begin) = begin { self.path.push(begin); } self.path.reverse(); // Perform few smoothing passes to straighten computed path. for _ in 0..2 { self.smooth_path(navmesh); } result } else { Err(PathError::Custom("Empty navmesh!".to_owned())) } } fn smooth_path(&mut self, navmesh: &Navmesh) { let vertices = navmesh.vertices(); let mut i = 0; while i < self.path.len().saturating_sub(2) { let begin = self.path[i]; let end = self.path[i + 2]; let delta = end - begin; let max_delta = (delta.x.max(delta.y).max(delta.z)).abs(); // Calculate center point between end points of each path edge. // i+1 // ^ // / \ // / \ // / \ // /- * -\ // i C i+2 let center = (begin + end).scale(0.5); // And check if center is lying on navmesh or not. If so - replace i+1 vertex // with its projection on the triangle it belongs to. for triangle in navmesh.triangles.iter() { let a = vertices[triangle[0] as usize].position; let b = vertices[triangle[1] as usize].position; let c = vertices[triangle[2] as usize].position; // Ignore degenerated triangles. if let Some(normal) = (c - a).cross(&(b - a)).try_normalize(f32::EPSILON) { // Calculate signed distance between triangle and segment's center. let signed_distance = (center - a).dot(&normal); // And check "slope": If center is too far from triangle, check next triangle. if signed_distance.abs() <= max_delta { // Project center on the triangle. let center_projection = center - normal.scale(signed_distance); // And check if the projection lies inside the triangle. if math::is_point_inside_triangle(&center_projection, &[a, b, c]) { self.path[i + 1] = center_projection; break; } } } } i += 1; } } /// Performs single update tick that moves agent to the target along the path (which is automatically /// recalculated if target's position has changed). pub fn update(&mut self, dt: f32, navmesh: &mut Navmesh) -> Result<PathKind, PathError> { if self.path_dirty { self.calculate_path(navmesh, self.position, self.target)?; self.path_dirty = false; } if let Some(source) = self.path.get(self.current as usize) { if let Some(destination) = self.path.get((self.current + 1) as usize) { let ray = Ray::from_two_points(*source, *destination); let d = ray.dir.try_normalize(f32::EPSILON).unwrap_or_default(); self.position += d.scale(self.speed * dt); if ray.project_point(&self.position) >= 1.0 { self.current += 1; } } } Ok(PathKind::Full) } /// Returns current steering target which in most cases next path point from which /// agent is close to. pub fn steering_target(&self) -> Option<Vector3<f32>> { self.path .get(self.current as usize + 1) .or_else(|| self.path.last()) .cloned() } /// Sets new target for the agent. pub fn set_target(&mut self, new_target: Vector3<f32>) { if new_target.metric_distance(&self.last_target_position) >= self.recalculation_threshold { self.path_dirty = true; self.last_target_position = new_target; } self.target = new_target; } /// Returns current target of the agent. pub fn target(&self) -> Vector3<f32> { self.target } /// Sets new position of the agent. pub fn set_position(&mut self, new_position: Vector3<f32>) { if new_position.metric_distance(&self.last_warp_position) >= self.recalculation_threshold { self.path_dirty = true; self.last_warp_position = new_position; } self.position = new_position; } } /// Allows you to build agent in declarative manner. pub struct NavmeshAgentBuilder { position: Vector3<f32>, target: Vector3<f32>, recalculation_threshold: f32, speed: f32, } impl Default for NavmeshAgentBuilder { fn default() -> Self { Self::new() } } impl NavmeshAgentBuilder { /// Creates new builder instance. pub fn new() -> Self { Self { position: Default::default(), target: Default::default(), recalculation_threshold: 0.25, speed: 1.5, } } /// Sets new desired position of the agent being built. pub fn with_position(mut self, position: Vector3<f32>) -> Self { self.position = position; self } /// Sets new desired target of the agent being built. pub fn with_target(mut self, position: Vector3<f32>) -> Self { self.target = position; self } /// Sets new desired recalculation threshold (in meters) of the agent being built. pub fn with_recalculation_threshold(mut self, threshold: f32) -> Self { self.recalculation_threshold = threshold; self } /// Sets new desired movement speed of the agent being built. pub fn with_speed(mut self, speed: f32) -> Self { self.speed = speed; self } /// Build the agent. pub fn build(self) -> NavmeshAgent { NavmeshAgent { position: self.position, last_warp_position: self.position, target: self.target, last_target_position: self.target, recalculation_threshold: self.recalculation_threshold, speed: self.speed, ..Default::default() } } }
{ // Direction-agnostic hash. (self.a as u64 + self.b as u64).hash(state) }
mongofiles.go
// Copyright (C) MongoDB, Inc. 2014-present. // // Licensed under the Apache License, Version 2.0 (the "License"); you may // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 // Package mongofiles provides an interface to GridFS collections in a MongoDB instance. package mongofiles import ( "fmt" "io" "os" "regexp" "time" "github.com/mongodb/mongo-tools/common/bsonutil" "github.com/mongodb/mongo-tools/common/db" "github.com/mongodb/mongo-tools/common/json" "github.com/mongodb/mongo-tools/common/log" "github.com/mongodb/mongo-tools/common/options" "github.com/mongodb/mongo-tools/common/util" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) // List of possible commands for mongofiles. const ( List = "list" Search = "search" Put = "put" PutID = "put_id" Get = "get" GetID = "get_id" Delete = "delete" DeleteID = "delete_id" ) // MongoFiles is a container for the user-specified options and // internal state used for running mongofiles. type MongoFiles struct { // generic mongo tool options ToolOptions *options.ToolOptions // mongofiles-specific storage options StorageOptions *StorageOptions // mongofiles-specific input options InputOptions *InputOptions // for connecting to the db SessionProvider *db.SessionProvider // command to run Command string // filename in GridFS FileName string //ID to put into GridFS Id string } // GFSFile represents a GridFS file. type GFSFile struct { Id bson.ObjectId `bson:"_id"` ChunkSize int `bson:"chunkSize"` Name string `bson:"filename"` Length int64 `bson:"length"` Md5 string `bson:"md5"` UploadDate time.Time `bson:"uploadDate"` ContentType string `bson:"contentType,omitempty"` } // ValidateCommand ensures the arguments supplied are valid. func (mf *MongoFiles) ValidateCommand(args []string) error { // make sure a command is specified and that we don't have // too many arguments if len(args) == 0 { return fmt.Errorf("no command specified") } switch args[0] { case List: if len(args) > 2 { return fmt.Errorf("too many positional arguments") } if len(args) == 1 { mf.FileName = "" } else { mf.FileName = args[1] } case Search, Put, Get, Delete: if len(args) > 2 { return fmt.Errorf("too many positional arguments") } // also make sure the supporting argument isn't literally an // empty string for example, mongofiles get "" if len(args) == 1 || args[1] == "" { return fmt.Errorf("'%v' argument missing", args[0]) } mf.FileName = args[1] case GetID, DeleteID: if len(args) > 2 { return fmt.Errorf("too many positional arguments") } if len(args) == 1 || args[1] == "" { return fmt.Errorf("'%v' argument missing", args[0]) } mf.Id = args[1] case PutID: if len(args) > 3 { return fmt.Errorf("too many positional arguments") } if len(args) < 3 || args[1] == "" || args[2] == "" { return fmt.Errorf("'%v' argument(s) missing", args[0]) } mf.FileName = args[1] mf.Id = args[2] default: return fmt.Errorf("'%v' is not a valid command", args[0]) } if mf.StorageOptions.GridFSPrefix == "" { return fmt.Errorf("--prefix can not be blank") } mf.Command = args[0] return nil } // Query GridFS for files and display the results. func (mf *MongoFiles) findAndDisplay(gfs *mgo.GridFS, query bson.M) (string, error) { display := "" cursor := gfs.Find(query).Iter() defer cursor.Close() var file GFSFile for cursor.Next(&file) { display += fmt.Sprintf("%s\t%d\n", file.Name, file.Length) } if err := cursor.Err(); err != nil { return "", fmt.Errorf("error retrieving list of GridFS files: %v", err) } return display, nil } // Return the local filename, as specified by the --local flag. Defaults to // the GridFile's name if not present. If GridFile is nil, uses the filename // given on the command line. func (mf *MongoFiles) getLocalFileName(gridFile *mgo.GridFile) string { localFileName := mf.StorageOptions.LocalFileName if localFileName == "" { if gridFile != nil { localFileName = gridFile.Name() } else { localFileName = mf.FileName } } return localFileName } // handle logic for 'get' command func (mf *MongoFiles) handleGet(gfs *mgo.GridFS) error { gFile, err := gfs.Open(mf.FileName) if err != nil { return fmt.Errorf("error opening GridFS file '%s': %v", mf.FileName, err) } defer gFile.Close() if err = mf.writeFile(gFile); err != nil { return err } log.Logvf(log.Always, fmt.Sprintf("finished writing to %s\n", mf.getLocalFileName(gFile))) return nil } // handle logic for 'get_id' command func (mf *MongoFiles) handleGetID(gfs *mgo.GridFS) error { id, err := mf.parseID() if err != nil { return err } // with the parsed _id, grab the file and write it to disk gFile, err := gfs.OpenId(id) if err != nil { return fmt.Errorf("error opening GridFS file with _id %s: %v", mf.Id, err) } defer gFile.Close() if err = mf.writeFile(gFile); err != nil { return err } log.Logvf(log.Always, fmt.Sprintf("finished writing to: %s\n", mf.getLocalFileName(gFile))) return nil } // logic for deleting a file func (mf *MongoFiles) handleDelete(gfs *mgo.GridFS) error { err := gfs.Remove(mf.FileName) if err != nil { return fmt.Errorf("error while removing '%v' from GridFS: %v\n", mf.FileName, err) } log.Logvf(log.Always, "successfully deleted all instances of '%v' from GridFS\n", mf.FileName) return nil } // logic for deleting a file with 'delete_id' func (mf *MongoFiles) handleDeleteID(gfs *mgo.GridFS) error { id, err := mf.parseID() if err != nil { return err } if err = gfs.RemoveId(id); err != nil { return fmt.Errorf("error while removing file with _id %v from GridFS: %v\n", mf.Id, err) } log.Logvf(log.Always, fmt.Sprintf("successfully deleted file with _id %v from GridFS\n", mf.Id)) return nil } // parse and convert extended JSON func (mf *MongoFiles) parseID() (interface{}, error) { // parse the id using extended json var asJSON interface{} err := json.Unmarshal([]byte(mf.Id), &asJSON) if err != nil { return nil, fmt.Errorf( "error parsing _id as json: %v; make sure you are properly escaping input", err) } id, err := bsonutil.ConvertJSONValueToBSON(asJSON) if err != nil { return nil, fmt.Errorf("error converting _id to bson: %v", err) } return id, nil } // writeFile writes a file from gridFS to stdout or the filesystem. func (mf *MongoFiles) writeFile(gridFile *mgo.GridFile) (err error) { localFileName := mf.getLocalFileName(gridFile) var localFile io.WriteCloser if localFileName == "-" { localFile = os.Stdout } else { if localFile, err = os.Create(localFileName); err != nil { return fmt.Errorf("error while opening local file '%v': %v\n", localFileName, err) } defer localFile.Close() log.Logvf(log.DebugLow, "created local file '%v'", localFileName) } if _, err = io.Copy(localFile, gridFile); err != nil { return fmt.Errorf("error while writing data into local file '%v': %v\n", localFileName, err) } return nil } func (mf *MongoFiles) handlePut(gfs *mgo.GridFS, hasID bool) (err error) { localFileName := mf.getLocalFileName(nil) // check if --replace flag turned on if mf.StorageOptions.Replace { err = gfs.Remove(mf.FileName) if err != nil
// always log that data has been removed log.Logvf(log.Always, "removed all instances of '%v' from GridFS\n", mf.FileName) } var localFile io.ReadCloser if localFileName == "-" { localFile = os.Stdin } else { localFile, err = os.Open(localFileName) if err != nil { return fmt.Errorf("error while opening local file '%v' : %v\n", localFileName, err) } defer localFile.Close() log.Logvf(log.DebugLow, "creating GridFS file '%v' from local file '%v'", mf.FileName, localFileName) } gridFile, err := gfs.Create(mf.FileName) if err != nil { return fmt.Errorf("error while creating '%v' in GridFS: %v\n", mf.FileName, err) } defer func() { // GridFS files flush a buffer on Close(), so it's important we // capture any errors that occur as this function exits and // overwrite the error if earlier writes executed successfully if closeErr := gridFile.Close(); err == nil && closeErr != nil { log.Logvf(log.DebugHigh, "error occurred while closing GridFS file handler") err = fmt.Errorf("error while storing '%v' into GridFS: %v\n", localFileName, closeErr) } }() if hasID { id, err := mf.parseID() if err != nil { return err } gridFile.SetId(id) } // set optional mime type if mf.StorageOptions.ContentType != "" { gridFile.SetContentType(mf.StorageOptions.ContentType) } n, err := io.Copy(gridFile, localFile) if err != nil { return fmt.Errorf("error while storing '%v' into GridFS: %v\n", localFileName, err) } log.Logvf(log.DebugLow, "copied %v bytes to server", n) log.Logvf(log.Always, fmt.Sprintf("added file: %v\n", gridFile.Name())) return nil } // Run the mongofiles utility. If displayHost is true, the connected host/port is // displayed. func (mf *MongoFiles) Run(displayHost bool) (string, error) { connUrl := mf.ToolOptions.Host if connUrl == "" { connUrl = util.DefaultHost } if mf.ToolOptions.Port != "" { connUrl = fmt.Sprintf("%s:%s", connUrl, mf.ToolOptions.Port) } var mode = mgo.Nearest var tags bson.D if mf.InputOptions.ReadPreference != "" { var err error mode, tags, err = db.ParseReadPreference(mf.InputOptions.ReadPreference) if err != nil { return "", fmt.Errorf("error parsing --readPreference : %v", err) } if len(tags) > 0 { mf.SessionProvider.SetTags(tags) } } mf.SessionProvider.SetReadPreference(mode) mf.SessionProvider.SetTags(tags) mf.SessionProvider.SetFlags(db.DisableSocketTimeout) // get session session, err := mf.SessionProvider.GetSession() if err != nil { return "", err } defer session.Close() // check type of node we're connected to, and fall back to w=1 if standalone (for <= 2.4) nodeType, err := mf.SessionProvider.GetNodeType() if err != nil { return "", fmt.Errorf("error determining type of node connected: %v", err) } log.Logvf(log.DebugLow, "connected to node type: %v", nodeType) safety, err := db.BuildWriteConcern(mf.StorageOptions.WriteConcern, nodeType, mf.ToolOptions.URI.ParsedConnString()) if err != nil { return "", fmt.Errorf("error parsing write concern: %v", err) } // configure the session with the appropriate write concern and ensure the // socket does not timeout session.SetSafe(safety) if displayHost { log.Logvf(log.Always, "connected to: %v", connUrl) } // first validate the namespaces we'll be using: <db>.<prefix>.files and <db>.<prefix>.chunks // it's ok to validate only <db>.<prefix>.chunks (the longer one) err = util.ValidateFullNamespace(fmt.Sprintf("%s.%s.chunks", mf.StorageOptions.DB, mf.StorageOptions.GridFSPrefix)) if err != nil { return "", err } // get GridFS handle gfs := session.DB(mf.StorageOptions.DB).GridFS(mf.StorageOptions.GridFSPrefix) var output string log.Logvf(log.Info, "handling mongofiles '%v' command...", mf.Command) switch mf.Command { case List: query := bson.M{} if mf.FileName != "" { regex := bson.M{"$regex": "^" + regexp.QuoteMeta(mf.FileName)} query = bson.M{"filename": regex} } output, err = mf.findAndDisplay(gfs, query) if err != nil { return "", err } case Search: regex := bson.M{"$regex": mf.FileName} query := bson.M{"filename": regex} output, err = mf.findAndDisplay(gfs, query) if err != nil { return "", err } case Get: err = mf.handleGet(gfs) if err != nil { return "", err } case GetID: err = mf.handleGetID(gfs) if err != nil { return "", err } case Put: err = mf.handlePut(gfs, false) if err != nil { return "", err } case PutID: err = mf.handlePut(gfs, true) if err != nil { return "", err } case Delete: err = mf.handleDelete(gfs) if err != nil { return "", err } case DeleteID: err = mf.handleDeleteID(gfs) if err != nil { return "", err } } return output, nil }
{ return err }
peer_out.rs
use crate::*; use tonic::transport::Channel; use lol_core::Uri; use proto_compiled::sorock_client::SorockClient; use proto_compiled::{ IndexedPiece, PieceExistsReq, RequestAnyPiecesReq, RequestPieceReq, SendPieceReq, }; use std::collections::HashMap; use std::sync::Arc; use tokio::sync::RwLock; #[norpc::service] trait PeerOut { fn send_piece(to: Uri, piece: SendPiece) -> std::result::Result<(), SendPieceError>; fn request_piece(to: Uri, loc: PieceLocator) -> anyhow::Result<Option<Vec<u8>>>; fn request_any_pieces(to: Uri, key: String) -> anyhow::Result<Vec<(u8, Vec<u8>)>>; fn piece_exists(to: Uri, loc: PieceLocator) -> anyhow::Result<bool>; } define_client!(PeerOut); pub fn spawn(state: State) -> ClientT { use norpc::runtime::tokio::*; let svc = App { state }; let svc = PeerOutService::new(svc); let (chan, server) = ServerBuilder::new(svc).build(); tokio::spawn(server.serve()); PeerOutClient::new(chan) } pub struct State { conn_cache: RwLock<HashMap<Uri, Channel>>, } impl State { pub fn new() -> Self { Self { conn_cache: RwLock::new(HashMap::new()), } } async fn connect(&self, uri: Uri) -> Channel { if !self.conn_cache.read().await.contains_key(&uri) { let new_chan = { let e = tonic::transport::Endpoint::new(uri.clone()).unwrap(); let chan = e.connect_lazy(); chan }; self.conn_cache.write().await.insert(uri.clone(), new_chan); } self.conn_cache.read().await.get(&uri).unwrap().clone() } } struct App { state: State, } #[norpc::async_trait] impl PeerOut for App { async fn send_piece( &self, to: Uri, piece: SendPiece, ) -> std::result::Result<(), SendPieceError> { let chan = self.state.connect(to).await; let mut cli = SorockClient::new(chan); let rep = cli .send_piece(SendPieceReq { data: piece.data, key: piece.loc.key, index: piece.loc.index as u32, version: piece.version, }) .await .map_err(|_| SendPieceError::Failed)?; let rep = rep.into_inner(); match rep.error_code { 0 => Ok(()), -1 => Err(SendPieceError::Rejected), -2 => Err(SendPieceError::Failed), _ => unreachable!(), } } async fn piece_exists(&self, to: Uri, loc: PieceLocator) -> anyhow::Result<bool> { let chan = self.state.connect(to).await; let mut cli = SorockClient::new(chan); let rep = cli .piece_exists(PieceExistsReq { key: loc.key, index: loc.index as u32, }) .await?; let rep = rep.into_inner(); Ok(rep.exists) } async fn request_piece(&self, to: Uri, loc: PieceLocator) -> anyhow::Result<Option<Vec<u8>>> { let chan = self.state.connect(to).await; let mut cli = SorockClient::new(chan); let rep = cli .request_piece(RequestPieceReq { key: loc.key, index: loc.index as u32, }) .await?; let rep = rep.into_inner(); Ok(rep.data) } async fn request_any_pieces(&self, to: Uri, key: String) -> anyhow::Result<Vec<(u8, Vec<u8>)>> { let chan = self.state.connect(to).await; let mut cli = SorockClient::new(chan); let rep = cli.request_any_pieces(RequestAnyPiecesReq { key }).await?;
for IndexedPiece { index, data } in rep.pieces { out.push((index as u8, data)); } Ok(out) } }
let rep = rep.into_inner(); let mut out = vec![];
FDEM.py
from __future__ import division import numpy as np from scipy.constants import mu_0, pi, epsilon_0 from scipy.special import erf from SimPEG import utils import warnings def hzAnalyticDipoleF(r, freq, sigma, secondary=True, mu=mu_0): """ The analytical expression is given in Equation 4.56 in Ward and Hohmann, 1988, and the example reproduces their Figure 4.2. .. plot:: import numpy as np import matplotlib.pyplot as plt from SimPEG import electromagnetics as EM freq = np.logspace(-1, 5, 301) test = EM.analytics.hzAnalyticDipoleF( 100, freq, 0.01, secondary=False) plt.loglog(freq, test.real, 'C0-', label='Real') plt.loglog(freq, -test.real, 'C0--') plt.loglog(freq, test.imag, 'C1-', label='Imaginary') plt.loglog(freq, -test.imag, 'C1--')
plt.xlabel('Frequency (Hz)') plt.ylabel('$H_z$ (A/m)') plt.legend(loc=6) plt.show() **Reference** - Ward, S. H., and G. W. Hohmann, 1988, Electromagnetic theory for geophysical applications, Chapter 4 of Electromagnetic Methods in Applied Geophysics: SEG, Investigations in Geophysics No. 3, 130--311; DOI: `10.1190/1.9781560802631.ch4 <https://doi.org/10.1190/1.9781560802631.ch4>`_. """ r = np.abs(r) k = np.sqrt(-1j * 2.0 * np.pi * freq * mu * sigma) m = 1 front = m / (2.0 * np.pi * (k**2) * (r**5)) back = 9 - ( 9 + 9j * k * r - 4 * (k**2) * (r**2) - 1j * (k**3) * (r**3) ) * np.exp(-1j * k * r) hz = front * back if secondary: hp = -1 / (4 * np.pi * r**3) hz = hz - hp if hz.ndim == 1: hz = utils.mkvc(hz, 2) return hz def MagneticDipoleWholeSpace( XYZ, srcLoc, sig, f, moment, fieldType="b", mu_r=1, eps_r=1, **kwargs ): """ Analytical solution for a dipole in a whole-space. The analytical expression is given in Equation 2.57 in Ward and Hohmann, 1988, and the example reproduces their Figure 2.2. TODOs: - set it up to instead take a mesh & survey - add divide by zero safety .. plot:: import numpy as np from SimPEG import electromagnetics as EM import matplotlib.pyplot as plt from scipy.constants import mu_0 freqs = np.logspace(-2, 5, 301) Bx, By, Bz = EM.analytics.FDEM.MagneticDipoleWholeSpace( [0, 100, 0], [0, 0, 0], 1e-2, freqs, moment='Z') plt.figure() plt.loglog(freqs, Bz.real/mu_0, 'C0', label='Real') plt.loglog(freqs, -Bz.real/mu_0, 'C0--') plt.loglog(freqs, Bz.imag/mu_0, 'C1', label='Imaginary') plt.loglog(freqs, -Bz.imag/mu_0, 'C1--') plt.legend() plt.xlim([1e-2, 1e5]) plt.ylim([1e-13, 1e-6]) plt.show() **Reference** - Ward, S. H., and G. W. Hohmann, 1988, Electromagnetic theory for geophysical applications, Chapter 4 of Electromagnetic Methods in Applied Geophysics: SEG, Investigations in Geophysics No. 3, 130--311; DOI: `10.1190/1.9781560802631.ch4 <https://doi.org/10.1190/1.9781560802631.ch4>`_. """ orient = kwargs.pop("orientation", None) if orient is not None: raise TypeError( "orientation kwarg has been removed, please use the moment argument", ) magnitude = moment moment = orient else: magnitude = 1 mu = kwargs.pop("mu", None) if mu is not None: raise TypeError("mu kwarg has been removed, please use the mu_r argument.") mu_r = mu / mu_0 mu = mu_0 * mu_r eps = epsilon_0 * eps_r w = 2 * np.pi * f if isinstance(moment, str): if moment == "X": mx, my, mz = 1.0, 0.0, 0.0 elif moment == "Y": mx, my, mz = 0.0, 1.0, 0.0 elif moment == "Z": mx, my, mz = 0.0, 0.0, 1.0 else: raise NotImplementedError("String type for moment not recognized") mx, my, mz = mx * magnitude, my * magnitude, mz * magnitude else: mx, my, mz = moment[0], moment[1], moment[2] XYZ = utils.asArray_N_x_Dim(XYZ, 3) dx = XYZ[:, 0] - srcLoc[0] dy = XYZ[:, 1] - srcLoc[1] dz = XYZ[:, 2] - srcLoc[2] r = np.sqrt(dx**2.0 + dy**2.0 + dz**2.0) k = np.sqrt(-1j * w * mu * sig + w**2 * mu * eps) kr = k * r if fieldType in ["h", "b"]: front = 1 / (4.0 * pi * r**3.0) * np.exp(-1j * kr) mid = -(kr**2.0) + 3.0 * 1j * kr + 3.0 Fx = front * ( mx * ((dx / r) ** 2.0 * mid + (kr**2.0 - 1j * kr - 1.0)) + my * ((dy * dx / r**2.0) * mid) + mz * ((dx * dz / r**2.0) * mid) ) Fy = front * ( mx * ((dx * dy / r**2.0) * mid) + my * ((dy / r) ** 2.0 * mid + (kr**2.0 - 1j * kr - 1.0)) + mz * ((dy * dz / r**2.0) * mid) ) Fz = front * ( mx * ((dx * dz / r**2.0) * mid) + my * ((dy * dz / r**2.0) * mid) + mz * ((dz / r) ** 2.0 * mid + (kr**2.0 - 1j * kr - 1.0)) ) if fieldType == "b": Fx, Fy, Fz = mu * Fx, mu * Fy, mu * Fz elif fieldType == "e": front = 1j * w * mu * (1 + 1j * kr) / (4.0 * pi * r**3.0) * np.exp(-1j * kr) Fx = front * (my * (dz / r) + mz * (-dy / r)) Fy = front * (mx * (-dz / r) + mz * (dx / r)) Fz = front * (mx * (dy / r) + my * (-dx / r)) return Fx, Fy, Fz def ElectricDipoleWholeSpace( XYZ, srcLoc, sig, f, moment="X", fieldType="e", mu_r=1, eps_r=1, **kwargs ): orient = kwargs.pop("orientation", None) if orient is not None: raise TypeError( "orientation kwarg has been removed, please use the moment argument." ) mu = kwargs.pop("mu", None) if mu is not None: raise TypeError("mu kwarg has been removed, please use the mu_r argument.") cur = kwargs.pop("current", None) if cur is not None: raise TypeError( "current kwarg has been removed, please use the moment argument.", ) else: magnitude = 1 length = kwargs.pop("length", None) if length is not None: raise TypeError( "length kwarg has been removed, please use the moment argument." ) mu = mu_0 * mu_r eps = epsilon_0 * eps_r w = 2 * np.pi * f if isinstance(moment, str): if moment.upper() == "X": mx, my, mz = 1.0, 0.0, 0.0 elif moment.upper() == "Y": mx, my, mz = 0.0, 1.0, 0.0 elif moment.upper() == "Z": mx, my, mz = 0.0, 0.0, 1.0 else: raise NotImplementedError("String type for moment not recognized") mx, my, mz = mx * magnitude, my * magnitude, mz * magnitude else: mx, my, mz = moment[0], moment[1], moment[2] XYZ = utils.asArray_N_x_Dim(XYZ, 3) dx = XYZ[:, 0] - srcLoc[0] dy = XYZ[:, 1] - srcLoc[1] dz = XYZ[:, 2] - srcLoc[2] r = np.sqrt(dx**2.0 + dy**2.0 + dz**2.0) k = np.sqrt(-1j * w * mu * sig + w**2 * mu * eps) kr = k * r if fieldType == "e": front = 1 / (4.0 * np.pi * sig * r**3) * np.exp(-1j * k * r) mid = -(k**2) * r**2 + 3 * 1j * k * r + 3 Fx = front * ( mx * ((dx**2 / r**2) * mid + (k**2 * r**2 - 1j * k * r - 1.0)) + my * (dy * dx / r**2) * mid + mz * (dz * dx / r**2) * mid ) Fy = front * ( mx * (dx * dy / r**2) * mid + my * ((dy**2 / r**2) * mid + (k**2 * r**2 - 1j * k * r - 1.0)) + mz * (dz * dy / r**2) * mid ) Fz = front * ( mx * (dx * dz / r**2) * mid + my * (dy * dz / r**2) * mid + mz * ((dz**2 / r**2) * mid + (k**2 * r**2 - 1j * k * r - 1.0)) ) elif fieldType in ["h", "b"]: front = (1 + 1j * kr) / (4.0 * np.pi * r**2) * np.exp(-1j * k * r) Fx = front * (my * (dz / r) + mz * (-dy / r)) Fy = front * (mx * (-dz / r) + mz * (dx / r)) Fz = front * (mx * (dy / r) + my * (-dx / r)) if fieldType == "b": Fx, Fy, Fz = mu * Fx, mu * Fy, mu * Fz return Fx, Fy, Fz
plt.title('Response at $r=100$ m') plt.xlim([1e-1, 1e5]) plt.ylim([1e-12, 1e-6])
0005_auto_20170511_1100.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-05-11 09:00 from __future__ import unicode_literals import django.contrib.auth.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0004_add_high_priority_user_group'), ] operations = [ migrations.AlterField(
), ]
model_name='user', name='username', field=models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username'),
index.test.js
const stylelint = require('stylelint'); const fs = require('fs'); const path = require('path'); const chalk = require('chalk'); const glob = require('glob'); const fromCWD = require('from-cwd'); const configWezomRelax = require('../index'); const rules = glob .sync(fromCWD('./__tests__/*')) .filter((dir) => fs.lstatSync(dir).isDirectory()) .map((dir) => path.basename(dir)); const getCode = (test, file) => { return fs.readFileSync(path.join(__dirname, test, file), 'utf-8').toString(); }; rules.forEach((rule) => { const config = { ...configWezomRelax, rules: { [rule]: configWezomRelax.rules[rule] } }; describe(`${rule} :: ${chalk.yellow('valid cases')}`, () => { let result; beforeEach(() => { result = stylelint.lint({ config, code: getCode(rule, 'valid.css') }); }); it('did not error', () => { return result.then((data) => expect(data.errored).toBeFalsy()); }); it('flags no warnings', () => { return result.then((data) => { expect(data.results[0].warnings).toHaveLength(0); }); });
describe(`${rule} :: ${chalk.red('invalid cases')}`, () => { let result; beforeEach(() => { result = stylelint.lint({ config, code: getCode(rule, 'invalid.css') }); }); it('has error', () => { return result.then((data) => expect(data.errored).toBeTruthy()); }); it('has flags warnings', () => { return result.then((data) => { expect(data.results[0].warnings.length).toBeGreaterThan(0); }); }); }); });
});
mod.rs
mod d1pt1; pub use d1pt1::Solution as D1Pt1; mod d1pt2; pub use d1pt2::Solution as D1Pt2; mod d2pt1; pub use d2pt1::Solution as D2Pt1; mod d2pt2; pub use d2pt2::Solution as D2Pt2; mod d3pt1; pub use d3pt1::Solution as D3Pt1; mod d3pt2; pub use d3pt2::Solution as D3Pt2; mod d4pt1; pub use d4pt1::Solution as D4Pt1; mod d4pt2; pub use d4pt2::Solution as D4Pt2; mod d5pt1; pub use d5pt1::Solution as D5Pt1; mod d5pt2; pub use d5pt2::Solution as D5Pt2; mod d6pt1; pub use d6pt1::Solution as D6Pt1; mod d6pt2; pub use d6pt2::Solution as D6Pt2; mod d7pt1; pub use d7pt1::Solution as D7Pt1; mod d7pt2; pub use d7pt2::Solution as D7Pt2; mod d8pt1; pub use d8pt1::Solution as D8Pt1; mod d8pt2; pub use d8pt2::Solution as D8Pt2; mod d9pt1; pub use d9pt1::Solution as D9Pt1; mod d9pt2; pub use d9pt2::Solution as D9Pt2; mod d10pt1; pub use d10pt1::Solution as D10Pt1; mod d10pt2; pub use d10pt2::Solution as D10Pt2; mod d11pt1; pub use d11pt1::Solution as D11Pt1; mod d11pt2; pub use d11pt2::Solution as D11Pt2; mod d12pt1; pub use d12pt1::Solution as D12Pt1; mod d12pt2; pub use d12pt2::Solution as D12Pt2; mod d13pt1; pub use d13pt1::Solution as D13Pt1; mod d13pt2; pub use d13pt2::Solution as D13Pt2; mod d14pt1; pub use d14pt1::Solution as D14Pt1; mod d14pt2; pub use d14pt2::Solution as D14Pt2; mod d15; pub use d15::Solution as D15; mod d16pt1; pub use d16pt1::Solution as D16Pt1; mod d16pt2; pub use d16pt2::Solution as D16Pt2; mod d17pt1; pub use d17pt1::Solution as D17Pt1; mod d17pt2; pub use d17pt2::Solution as D17Pt2; mod d18pt1; pub use d18pt1::Solution as D18Pt1; mod d18pt2; pub use d18pt2::Solution as D18Pt2; mod d19pt1; pub use d19pt1::Solution as D19Pt1; mod d19pt2; pub use d19pt2::Solution as D19Pt2; mod d20pt1; pub use d20pt1::Solution as D20Pt1; mod d20pt2; pub use d20pt2::Solution as D20Pt2; mod d21pt1; pub use d21pt1::Solution as D21Pt1; mod d21pt2; pub use d21pt2::Solution as D21Pt2; mod d22pt1; pub use d22pt1::Solution as D22Pt1; mod d22pt2; pub use d22pt2::Solution as D22Pt2; mod d23pt1; pub use d23pt1::Solution as D23Pt1; mod d23pt2; pub use d23pt2::Solution as D23Pt2; mod d24pt1; pub use d24pt1::Solution as D24Pt1; mod d24pt2; pub use d24pt2::Solution as D24Pt2; mod d25pt1; pub use d25pt1::Solution as D25Pt1; pub fn parsers<'a>() -> Vec<Box<dyn super::InputParser<'a>>> { enum
<'a> { UrlInput(Box<dyn Fn(Option<String>) -> Box<dyn super::Solution + 'static>>), Parser(Box<dyn super::InputParser<'a>>), } let days: Vec<Option<InputType>> = vec! [ Some(InputType::UrlInput(Box::new(|input| Box::new(D1Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D1Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D2Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D2Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D3Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D3Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D4Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D4Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D5Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D5Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D6Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D6Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D7Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D7Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D8Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D8Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D9Pt1::new(input.expect("empty input received"), 25))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D9Pt2::new(input.expect("empty input received"), 25))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D10Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D10Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D11Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D11Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D12Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D12Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D13Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D13Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D14Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D14Pt2::new(input.expect("empty input received")))))), Some(InputType::Parser(D15::parser_pt1())), Some(InputType::Parser(D15::parser_pt2())), Some(InputType::UrlInput(Box::new(|input| Box::new(D16Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D16Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D17Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D17Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D18Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D18Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D19Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D19Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D20Pt1::new(input.expect("empty input received")))))), None, Some(InputType::UrlInput(Box::new(|input| Box::new(D21Pt1::new(input.expect("empty input received")))))), None, Some(InputType::UrlInput(Box::new(|input| Box::new(D22Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D22Pt2::new(input.expect("empty input received")))))), Some(InputType::Parser(D23Pt1::parser())), Some(InputType::Parser(D23Pt2::parser())), Some(InputType::UrlInput(Box::new(|input| Box::new(D24Pt1::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D24Pt2::new(input.expect("empty input received")))))), Some(InputType::UrlInput(Box::new(|input| Box::new(D25Pt1::new(input.expect("empty input received")))))), ]; days.into_iter() .enumerate() .filter_map(|(idx,opt)| opt.map(|parser| (idx,parser))) .map(|(idx,parser)| match parser { InputType::UrlInput(parser) => Box::new((2020usize,idx/2+1,idx%2+1,parser)) as Box<dyn super::InputParser>, InputType::Parser(parser) => parser, } ) .collect() }
InputType
named.rs
use crate::parser::hir::Expression; use crate::parser::Flag; use crate::prelude::*; use derive_new::new; use indexmap::IndexMap; use log::trace; use serde::{Deserialize, Serialize}; use std::fmt; #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] pub enum NamedValue { AbsentSwitch, PresentSwitch(Tag), AbsentValue, Value(Expression), } #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize, new)] pub struct NamedArguments { #[new(default)] pub(crate) named: IndexMap<String, NamedValue>, } impl ToDebug for NamedArguments { fn fmt_debug(&self, f: &mut fmt::Formatter, source: &str) -> fmt::Result { for (name, value) in &self.named { match value { NamedValue::AbsentSwitch => continue, NamedValue::PresentSwitch(tag) => write!(f, " --{}", tag.slice(source))?, NamedValue::AbsentValue => continue, NamedValue::Value(expr) => write!(f, " --{} {}", name, expr.debug(source))?, } } Ok(()) } } impl NamedArguments { pub fn insert_switch(&mut self, name: impl Into<String>, switch: Option<Flag>) { let name = name.into(); trace!("Inserting switch -- {} = {:?}", name, switch); match switch { None => self.named.insert(name.into(), NamedValue::AbsentSwitch), Some(flag) => self.named.insert( name, NamedValue::PresentSwitch(Tag { span: *flag.name(), anchor: None, }), ), }; } pub fn insert_optional(&mut self, name: impl Into<String>, expr: Option<Expression>) { match expr { None => self.named.insert(name.into(), NamedValue::AbsentValue), Some(expr) => self.named.insert(name.into(), NamedValue::Value(expr)), }; } pub fn
(&mut self, name: impl Into<String>, expr: Expression) { self.named.insert(name.into(), NamedValue::Value(expr)); } }
insert_mandatory
hacsrepositorytheme.py
"""Blueprint for HacsRepositoryThemes.""" # pylint: disable=too-many-instance-attributes,invalid-name,broad-except,access-member-before-definition import logging from .hacsrepositorybase import HacsRepositoryBase from ..hacsbase.exceptions import HacsRequirement _LOGGER = logging.getLogger("custom_components.hacs.repository") class HacsRepositoryThemes(HacsRepositoryBase): """ Set up a HacsRepositoryThemes object. repository_name(str): The full name of a repository (example: awesome-dev/awesome-repo) """ def __init__(self, repository_name: str, repositoryobject=None): """Initialize a HacsRepositoryThemes object.""" super().__init__() self.repository = repositoryobject self.repository_name = repository_name self.repository_type = "theme" self.manifest_content = None self.name = repository_name.split("/")[-1] async def update(self): """Run update tasks.""" if await self.comperson2_update(): return await self.set_repository_content() async def set_repository_content(self): """Set repository content attributes.""" contentfiles = [] if self.content_path is None: self.content_objects = await self.repository.get_contents( "themes", self.ref ) self.content_path = self.content_objects[0].path self.name = self.content_objects[0].name.replace(".yaml", "") if not isinstance(self.content_objects, list): raise HacsRequirement("Repository structure does not meet the requirements") for filename in self.content_objects: contentfiles.append(filename.name) if contentfiles:
self.content_files = contentfiles
utils.rs
// HACK(@efenniht): Block inlining to avoid an infinite loop miscompilation of LLVM: // https://github.com/rust-lang/rust/issues/28728. #[inline(never)] pub fn spin_loop() -> !
{ loop { ::core::hint::spin_loop(); } }
escape.rs
use std::collections::{HashMap, HashSet}; use arret_runtime::abitype::{AbiType, ParamAbiType, ParamCapture, RetAbiType}; use crate::codegen::GenAbi; use crate::mir::ops; /// Describes the capture behaviour of a function parameter #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Debug)] pub enum CaptureKind { /// This reg is always captured Always = 2, /// This reg is captured if the function's return value is captured ViaRet = 1, /// This reg is never captured Never = 0, } impl CaptureKind { /// Calculates the capture of a passed parameter based on the the call's return capture fn capture_for_call_param(self, return_capture: CaptureKind) -> CaptureKind { match self { CaptureKind::Always => CaptureKind::Always, CaptureKind::ViaRet => return_capture, CaptureKind::Never => CaptureKind::Never, } } } /// Tracks the captures for all regs in a function #[derive(Debug)] pub struct Captures { inner: HashMap<ops::RegId, CaptureKind>, } impl Captures { pub fn new() -> Captures { Captures { inner: HashMap::new(), } } /// Adds the capture of a reg to the capture state /// /// If there is an existing capture the "stronger" capture kind of the two will be used. pub fn add(&mut self, reg_id: ops::RegId, capture: CaptureKind) { use std::cmp::max; // It's not worthwhile to track never captures; that's the default capture type if capture != CaptureKind::Never { self.inner .entry(reg_id) .and_modify(|e| { *e = max(*e, capture); }) .or_insert(capture); } } pub fn get(&self, reg_id: ops::RegId) -> CaptureKind { self.inner .get(&reg_id) .cloned() .unwrap_or(CaptureKind::Never) } } /// Infers if a function can capture a parameter based on its return type /// /// This is used for Rust functions where we don't have precise capture information. This uses a /// very conservative algorithm where any function returning a box is assumed to capture all of its /// arguments. pub fn infer_param_capture_kind( ret_abi_type: &RetAbiType, param_abi_type: &ParamAbiType, ) -> CaptureKind { let returns_box = matches!(ret_abi_type, RetAbiType::Inhabited(AbiType::Boxed(_))); match param_abi_type.capture { ParamCapture::Auto => { if returns_box { CaptureKind::ViaRet } else { CaptureKind::Never } } ParamCapture::Always => CaptureKind::Always, ParamCapture::Never => CaptureKind::Never, } } fn add_static_symbol_call_captures( captures: &mut Captures, return_capture: CaptureKind, static_symbol_abi: &GenAbi, args: &[ops::RegId], ) { let arg_iter = args.iter(); assert_eq!(arg_iter.len(), static_symbol_abi.params.len()); for (arg_reg, param_abi_type) in arg_iter.zip(static_symbol_abi.params.iter()) { let param_capture = infer_param_capture_kind(&static_symbol_abi.ret, param_abi_type); captures.add( *arg_reg, param_capture.capture_for_call_param(return_capture), ); } }
private_funs: &'of HashMap<ops::PrivateFunId, ops::Fun>, private_fun_captures: HashMap<ops::PrivateFunId, Captures>, // Funs we're currently recursing in to recursing_private_funs: HashSet<ops::PrivateFunId>, } impl<'of> ProgramCaptureCtx<'of> { fn add_op_captures(&mut self, captures: &mut Captures, ret_type: &RetAbiType, op: &ops::Op) { use crate::mir::ops::OpKind; match op.kind() { OpKind::Ret(ret_reg) => { if let RetAbiType::Inhabited(AbiType::Boxed(_)) = ret_type { // `Ret` captures boxes unconditionally captures.add(*ret_reg, CaptureKind::ViaRet); } } OpKind::CastBoxed(reg, ops::CastBoxedOp { from_reg, .. }) | OpKind::Alias(reg, from_reg) | OpKind::LoadBoxedPairHead(reg, from_reg) | OpKind::LoadBoxedPairRest(reg, from_reg) | OpKind::LoadBoxedVectorMember( reg, ops::LoadBoxedVectorMemberOp { vector_reg: from_reg, .. }, ) => { captures.add(*from_reg, captures.get(*reg)); } OpKind::AllocBoxedPair( reg, ops::BoxPairOp { head_reg, rest_reg, .. }, ) => { let output_capture = captures.get(*reg); captures.add(*head_reg, output_capture); captures.add(*rest_reg, output_capture); } OpKind::Cond(ops::CondOp { reg_phi, true_ops, false_ops, .. }) => { if let Some(reg_phi) = reg_phi { let output_capture = captures.get(reg_phi.output_reg); // Propagate captures through the phi captures.add(reg_phi.true_result_reg, output_capture); captures.add(reg_phi.false_result_reg, output_capture); } for op in true_ops.iter().rev().chain(false_ops.iter().rev()) { self.add_op_captures(captures, ret_type, op); } } OpKind::Call(reg, ops::CallOp { callee, args, .. }) => { let return_capture = captures.get(*reg); match callee { ops::Callee::StaticSymbol(ops::StaticSymbol { abi, .. }) => { add_static_symbol_call_captures(captures, return_capture, abi, args); } ops::Callee::PrivateFun(private_fun_id) => { let ops_fun = &self.private_funs[private_fun_id]; if !self.recursing_private_funs.contains(private_fun_id) { let callee_captures = self.captures_for_private_fun_id(*private_fun_id); for (arg_reg, param_reg) in args.iter().zip(ops_fun.param_regs.iter()) { captures.add(*arg_reg, callee_captures.get(*param_reg)); } } else { // This is part of a recursive loop; assume everything is captured. // While this seems like an easy way out this is probably the right // thing to do. If there are many loop iterations at runtime we do // not want to allocate boxes on the stack. This both prevents tail // recursion and can lead to a stack overflow. By claiming that // everything is captured we force them to be heap allocated. for arg_reg in args.iter() { captures.add(*arg_reg, CaptureKind::Always); } } } ops::Callee::BoxedFunThunk(_) => { // We know nothing about the actual captures. We need to assume the worst. for arg_reg in args.iter() { captures.add(*arg_reg, CaptureKind::Always); } } }; } OpKind::TailCall(_, ops::TailCallOp { args, .. }) => { // This is the same justification as the recursive case in `OpKind::Call` for arg_reg in args.iter() { captures.add(*arg_reg, CaptureKind::Always); } } OpKind::MakeCallback(_, ops::MakeCallbackOp { callee, .. }) | OpKind::AllocBoxedFunThunk(_, ops::BoxFunThunkOp { callee, .. }) | OpKind::ConstBoxedFunThunk(_, ops::BoxFunThunkOp { callee, .. }) => { // We don't actually care about these captures; we just pull them in for dependencies if let ops::Callee::PrivateFun(private_fun_id) = callee { // If we're already recursing we'll only loop if we re-enter if !self.recursing_private_funs.contains(private_fun_id) { self.captures_for_private_fun_id(*private_fun_id); } } } OpKind::AllocBoxedRecord(reg, ops::BoxRecordOp { field_regs, .. }) => { let output_capture = captures.get(*reg); for field_reg in field_regs.iter() { captures.add(*field_reg, output_capture); } } OpKind::LoadBoxedRecordField( reg, ops::LoadBoxedRecordFieldOp { record_reg, record_struct, field_index, }, ) => { let output_capture = captures.get(*reg); // Don't capture the record if we're loading a non-GCed value if record_struct.field_abi_types[*field_index].may_contain_gc_refs() { captures.add(*record_reg, output_capture); } } _ => {} } } fn captures_for_private_fun_id(&mut self, private_fun_id: ops::PrivateFunId) -> &Captures { if self.private_fun_captures.contains_key(&private_fun_id) { return &self.private_fun_captures[&private_fun_id]; } self.recursing_private_funs.insert(private_fun_id); let ops_fun = &self.private_funs[&private_fun_id]; let captures = self.calc_fun_captures(ops_fun); self.recursing_private_funs.remove(&private_fun_id); self.private_fun_captures .entry(private_fun_id) .or_insert(captures) } fn calc_fun_captures(&mut self, fun: &ops::Fun) -> Captures { let mut captures = Captures::new(); for op in fun.ops.iter().rev() { self.add_op_captures(&mut captures, &fun.abi.ret, op); } captures } } pub struct ProgramCaptures { pub entry_fun_captures: Captures, pub private_fun_captures: HashMap<ops::PrivateFunId, Captures>, } /// Calculates the captured registers for the passed fun and every fun it references pub fn calc_program_captures( private_funs: &HashMap<ops::PrivateFunId, ops::Fun>, entry_fun: &ops::Fun, ) -> ProgramCaptures { let mut ctx = ProgramCaptureCtx { private_funs, private_fun_captures: HashMap::new(), recursing_private_funs: HashSet::new(), }; let entry_fun_captures = ctx.calc_fun_captures(entry_fun); ProgramCaptures { private_fun_captures: ctx.private_fun_captures, entry_fun_captures, } } #[cfg(test)] mod test { use super::*; use arret_runtime::boxed; use crate::source::EMPTY_SPAN; fn calc_single_fun_captures(fun: &ops::Fun) -> Captures { calc_program_captures(&HashMap::new(), fun).entry_fun_captures } #[test] fn infer_param_capture() { // Boxed return type can capture boxed parameter assert_eq!( CaptureKind::ViaRet, infer_param_capture_kind(&boxed::TypeTag::Int.into(), &boxed::TypeTag::Int.into()) ); // Unboxed return type cannot capture boxed parameter assert_eq!( CaptureKind::Never, infer_param_capture_kind(&AbiType::Bool.into(), &boxed::TypeTag::Int.into()) ); } #[test] fn empty_fun_captures() { let param_reg = ops::RegId::alloc(); let test_fun = ops::Fun { span: EMPTY_SPAN, source_name: None, abi: ops::OpsAbi { call_conv: ops::CallConv::FastCc, params: Box::new([boxed::TypeTag::Int.into()]), ret: RetAbiType::Void, }, param_regs: Box::new([param_reg]), ops: Box::new([]), }; let captures = calc_single_fun_captures(&test_fun); assert_eq!(CaptureKind::Never, captures.get(param_reg)); } #[test] fn capture_param_via_ret() { let capture_reg = ops::RegId::alloc(); let test_fun = ops::Fun { span: EMPTY_SPAN, source_name: None, abi: ops::OpsAbi { call_conv: ops::CallConv::FastCc, params: Box::new([boxed::TypeTag::Int.into()]), ret: boxed::TypeTag::Int.into(), }, param_regs: Box::new([capture_reg]), ops: Box::new([ops::OpKind::Ret(capture_reg).into()]), }; let captures = calc_single_fun_captures(&test_fun); assert_eq!(CaptureKind::ViaRet, captures.get(capture_reg)); } #[test] fn capture_param_via_pair() { let param_reg = ops::RegId::alloc(); let ret_reg = ops::RegId::alloc(); let test_fun = ops::Fun { span: EMPTY_SPAN, source_name: None, abi: ops::OpsAbi { call_conv: ops::CallConv::FastCc, params: Box::new([boxed::TypeTag::Int.into()]), ret: boxed::TypeTag::Pair.into(), }, param_regs: Box::new([param_reg]), ops: Box::new([ ops::OpKind::AllocBoxedPair( ret_reg, ops::BoxPairOp { head_reg: param_reg, rest_reg: param_reg, list_len_reg: param_reg, }, ) .into(), ops::OpKind::Ret(ret_reg).into(), ]), }; let captures = calc_single_fun_captures(&test_fun); assert_eq!(CaptureKind::ViaRet, captures.get(param_reg)); assert_eq!(CaptureKind::ViaRet, captures.get(ret_reg)); } #[test] fn capture_param_via_box_thunk_call() { let param_reg = ops::RegId::alloc(); let ret_reg = ops::RegId::alloc(); let test_fun = ops::Fun { span: EMPTY_SPAN, source_name: None, abi: ops::OpsAbi { call_conv: ops::CallConv::FastCc, params: Box::new([boxed::TypeTag::Int.into()]), ret: boxed::TypeTag::Pair.into(), }, param_regs: Box::new([param_reg]), ops: Box::new([ ops::OpKind::Call( ret_reg, ops::CallOp { callee: ops::Callee::BoxedFunThunk(param_reg), impure: true, args: Box::new([param_reg, param_reg, param_reg]), }, ) .into(), ops::OpKind::Ret(ret_reg).into(), ]), }; let captures = calc_single_fun_captures(&test_fun); assert_eq!(CaptureKind::Always, captures.get(param_reg)); assert_eq!(CaptureKind::ViaRet, captures.get(ret_reg)); } #[test] fn capture_param_via_static_symbol_call() { // These are passed to the first call with an unused ret let param_reg1 = ops::RegId::alloc(); let param_reg2 = ops::RegId::alloc(); let param_reg3 = ops::RegId::alloc(); // These are passed to the second call which does have its ret captured let param_reg4 = ops::RegId::alloc(); let param_reg5 = ops::RegId::alloc(); let param_reg6 = ops::RegId::alloc(); let unused_reg = ops::RegId::alloc(); let ret_reg = ops::RegId::alloc(); let static_symbol_abi = GenAbi { takes_task: false, params: Box::new([ ParamAbiType { abi_type: boxed::TypeTag::Int.into(), capture: ParamCapture::Never, }, ParamAbiType { abi_type: boxed::TypeTag::Int.into(), capture: ParamCapture::Auto, }, ParamAbiType { abi_type: boxed::TypeTag::Int.into(), capture: ParamCapture::Always, }, ]), ret: boxed::TypeTag::Int.into(), }; let static_symbol = ops::StaticSymbol { symbol: "test", impure: true, abi: static_symbol_abi, }; let test_fun = ops::Fun { span: EMPTY_SPAN, source_name: None, abi: ops::OpsAbi { call_conv: ops::CallConv::FastCc, params: Box::new([ boxed::TypeTag::Int.into(), boxed::TypeTag::Int.into(), boxed::TypeTag::Int.into(), boxed::TypeTag::Int.into(), boxed::TypeTag::Int.into(), boxed::TypeTag::Int.into(), ]), ret: boxed::TypeTag::Int.into(), }, param_regs: Box::new([param_reg1]), ops: Box::new([ ops::OpKind::Call( unused_reg, ops::CallOp { callee: ops::Callee::StaticSymbol(static_symbol.clone()), impure: true, args: Box::new([param_reg1, param_reg2, param_reg3]), }, ) .into(), ops::OpKind::Call( ret_reg, ops::CallOp { callee: ops::Callee::StaticSymbol(static_symbol), impure: true, args: Box::new([param_reg4, param_reg5, param_reg6]), }, ) .into(), ops::OpKind::Ret(ret_reg).into(), ]), }; let captures = calc_single_fun_captures(&test_fun); assert_eq!(CaptureKind::Never, captures.get(param_reg1)); assert_eq!(CaptureKind::Never, captures.get(param_reg2)); assert_eq!(CaptureKind::Always, captures.get(param_reg3)); assert_eq!(CaptureKind::Never, captures.get(param_reg4)); assert_eq!(CaptureKind::ViaRet, captures.get(param_reg5)); assert_eq!(CaptureKind::Always, captures.get(param_reg6)); assert_eq!(CaptureKind::Never, captures.get(unused_reg)); assert_eq!(CaptureKind::ViaRet, captures.get(ret_reg)); } #[test] fn capture_param_via_cond() { let param_reg = ops::RegId::alloc(); let ret_reg = ops::RegId::alloc(); let test_fun = ops::Fun { span: EMPTY_SPAN, source_name: None, abi: ops::OpsAbi { call_conv: ops::CallConv::FastCc, params: Box::new([boxed::TypeTag::Int.into()]), ret: boxed::TypeTag::Pair.into(), }, param_regs: Box::new([param_reg]), ops: Box::new([ ops::OpKind::Cond(ops::CondOp { reg_phi: Some(ops::RegPhi { output_reg: ret_reg, true_result_reg: param_reg, false_result_reg: param_reg, }), test_reg: param_reg, true_ops: Box::new([]), false_ops: Box::new([]), }) .into(), ops::OpKind::Ret(ret_reg).into(), ]), }; let captures = calc_single_fun_captures(&test_fun); assert_eq!(CaptureKind::ViaRet, captures.get(param_reg)); assert_eq!(CaptureKind::ViaRet, captures.get(ret_reg)); } }
struct ProgramCaptureCtx<'of> {
DescribePendingMaintenanceActionsCommand.ts
import { RDSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RDSClient"; import { DescribePendingMaintenanceActionsMessage, PendingMaintenanceActionsMessage } from "../models/models_1"; import { deserializeAws_queryDescribePendingMaintenanceActionsCommand, serializeAws_queryDescribePendingMaintenanceActionsCommand, } from "../protocols/Aws_query"; import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { FinalizeHandlerArguments, Handler, HandlerExecutionContext, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, SerdeContext as __SerdeContext, } from "@aws-sdk/types"; export type DescribePendingMaintenanceActionsCommandInput = DescribePendingMaintenanceActionsMessage; export type DescribePendingMaintenanceActionsCommandOutput = PendingMaintenanceActionsMessage & __MetadataBearer; /** * <p>Returns a list of resources (for example, DB instances) that have at least one pending maintenance action.</p> */ export class DescribePendingMaintenanceActionsCommand extends $Command< DescribePendingMaintenanceActionsCommandInput, DescribePendingMaintenanceActionsCommandOutput, RDSClientResolvedConfig > { private resolved = false; // Start section: command_properties // End section: command_properties constructor(readonly input: DescribePendingMaintenanceActionsCommandInput) { // Start section: command_constructor super(); // End section: command_constructor } /** * @internal */ resolveMiddleware( clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: RDSClientResolvedConfig, options?: __HttpHandlerOptions ): Handler<DescribePendingMaintenanceActionsCommandInput, DescribePendingMaintenanceActionsCommandOutput> { if (!this.resolved) { this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); this.resolved = true; } const stack = clientStack.concat(this.middlewareStack);
const handlerExecutionContext: HandlerExecutionContext = { logger, clientName, commandName, inputFilterSensitiveLog: DescribePendingMaintenanceActionsMessage.filterSensitiveLog, outputFilterSensitiveLog: PendingMaintenanceActionsMessage.filterSensitiveLog, }; const { requestHandler } = configuration; return stack.resolve( (request: FinalizeHandlerArguments<any>) => requestHandler.handle(request.request as __HttpRequest, options || {}), handlerExecutionContext ); } private serialize( input: DescribePendingMaintenanceActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> { return serializeAws_queryDescribePendingMaintenanceActionsCommand(input, context); } private deserialize( output: __HttpResponse, context: __SerdeContext ): Promise<DescribePendingMaintenanceActionsCommandOutput> { return deserializeAws_queryDescribePendingMaintenanceActionsCommand(output, context); } // Start section: command_body_extra // End section: command_body_extra }
const { logger } = configuration; const clientName = "RDSClient"; const commandName = "DescribePendingMaintenanceActionsCommand";
RzLinearBackward.py
from typing import Tuple import torch import triton import triton.language as tl def rz_linear_backward_tl(input: torch.tensor, hashed_weight: torch.tensor, output_grad: torch.tensor, M: int, K: int, N: int, H: int, R3: int, R2: int, R1: int, R0: int, allow_tf32: bool = True, allow_autotune: bool = False, BLOCK_SIZE_M: int = 64, BLOCK_SIZE_N: int = 64, BLOCK_SIZE_K: int = 32, GROUP_SIZE: int = 4) -> Tuple[torch.tensor, torch.tensor]: input_grad = rz_linear_backward_input_grad_tl(output_grad, hashed_weight, M, K, N, H, R3, R2, R1, R0, allow_tf32=allow_tf32, allow_autotune=allow_autotune, BLOCK_SIZE_M=BLOCK_SIZE_M, BLOCK_SIZE_N=BLOCK_SIZE_N, BLOCK_SIZE_K=BLOCK_SIZE_K, GROUP_SIZE=GROUP_SIZE) weight_grad = rz_linear_backward_weight_grad_tl(input, output_grad, M, K, N, H, R3, R2, R1, R0, allow_tf32=allow_tf32, allow_autotune=allow_autotune, BLOCK_SIZE_M=BLOCK_SIZE_M, BLOCK_SIZE_N=BLOCK_SIZE_N, BLOCK_SIZE_K=BLOCK_SIZE_K, GROUP_SIZE=GROUP_SIZE) return input_grad, weight_grad def rz_linear_backward_weight_grad_tl(input: torch.tensor, output_grad: torch.tensor, M: int, K: int, N: int, H: int, R3: int, R2: int, R1: int, R0: int, allow_tf32: bool = True, allow_autotune: bool = True, BLOCK_SIZE_M: int = 64, BLOCK_SIZE_N: int = 64, BLOCK_SIZE_K: int = 32, GROUP_SIZE: int = 8) -> torch.tensor: ''' Compute input^T x output_grad and return a weight_grad tensor Args: input (Tensor): A MxK tensor output_grad (Tensor): A MxN tensor M, K, N, H (int): Matrix dimensions R3, R2, R1, R0 (int): Random numbers allow_tf32 (bool): If tensor core is allowed BLOCK_SIZE_M, BLOCK_SIZE_N, BLOCK_SIZE_K, GROUP_SIZE: Matrix tiling parameters for performance tunning Returns: hashed_weight_grad (Tensor): A 1xH tensor ''' assert (K % 4 == 0) assert (N % 4 == 0) # allocates output hashed_weight_grad = torch.zeros( (H), device=output_grad.device, dtype=output_grad.dtype) # 1D launch kernel where each block gets its own program. def grid(META): return ( triton.cdiv(K, META['BLOCK_SIZE_K']) * triton.cdiv(N, META['BLOCK_SIZE_N']), ) if allow_tf32: assert (M % 32 == 0) else: assert (M % 8 == 0) if allow_autotune: if allow_tf32: rz_linear_backward_weight_grad_kernel_tf32[grid]( input, output_grad, hashed_weight_grad, M, N, K, H, input.stride(1), input.stride(0), output_grad.stride(0), output_grad.stride(1), R3=R3, R2=R2, R1=R1, R0=R0, GROUP_SIZE=GROUP_SIZE ) else: rz_linear_backward_weight_grad_kernel_fp32[grid]( input, output_grad, hashed_weight_grad, M, N, K, H, input.stride(1), input.stride(0), output_grad.stride(0), output_grad.stride(1), R3=R3, R2=R2, R1=R1, R0=R0, GROUP_SIZE=GROUP_SIZE ) else: rz_linear_backward_weight_grad_kernel_notune[grid]( input, output_grad, hashed_weight_grad, M, N, K, H, input.stride(1), input.stride(0), output_grad.stride(0), output_grad.stride(1), R3=R3, R2=R2, R1=R1, R0=R0, allow_tf32=allow_tf32, GROUP_SIZE=GROUP_SIZE, BLOCK_SIZE_K=BLOCK_SIZE_K, BLOCK_SIZE_M=BLOCK_SIZE_M, BLOCK_SIZE_N=BLOCK_SIZE_N ) return hashed_weight_grad @triton.autotune( configs=[ # basic configs for compute-bound matmuls triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=8), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 32, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 32, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 32, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 32, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 16}, num_stages=2, num_warps=4), ], key=['M', 'N', 'K'], ) @triton.jit def rz_linear_backward_weight_grad_kernel_fp32( # Pointers to matrices a_ptr, b_ptr, c_ptr, # Matrix dimensions M, N, K, H, # The stride variables represent how much to increase the ptr by when moving by 1 # element in a particular dimension. stride_am, stride_ak, stride_bm, stride_bn, # Random numbers R3, R2, R1, R0, # Meta-parameters BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr, GROUP_SIZE: tl.constexpr ): rz_linear_backward_weight_grad_core(a_ptr=a_ptr, b_ptr=b_ptr, c_ptr=c_ptr, M=M, N=N, K=K, H=H, stride_am=stride_am, stride_ak=stride_ak, stride_bm=stride_bm, stride_bn=stride_bn, R3=R3, R2=R2, R1=R1, R0=R0, allow_tf32=False, BLOCK_SIZE_M=BLOCK_SIZE_M, BLOCK_SIZE_N=BLOCK_SIZE_N, BLOCK_SIZE_K=BLOCK_SIZE_K, GROUP_SIZE=GROUP_SIZE) @triton.autotune( configs=[ # basic configs for compute-bound matmuls triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=2, num_warps=8), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=2, num_warps=8), triton.Config({'BLOCK_SIZE_N': 256, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_M': 32}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_M': 32}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 128, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_N': 64, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_M': 32}, num_stages=2, num_warps=4), ], key=['M', 'N', 'K'], ) @triton.jit def rz_linear_backward_weight_grad_kernel_tf32( # Pointers to matrices a_ptr, b_ptr, c_ptr, # Matrix dimensions M, N, K, H, # The stride variables represent how much to increase the ptr by when moving by 1 # element in a particular dimension. stride_am, stride_ak, stride_bm, stride_bn, # Random numbers R3, R2, R1, R0, # Meta-parameters BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr, GROUP_SIZE: tl.constexpr ): rz_linear_backward_weight_grad_core(a_ptr=a_ptr, b_ptr=b_ptr, c_ptr=c_ptr, M=M, N=N, K=K, H=H, stride_am=stride_am, stride_ak=stride_ak, stride_bm=stride_bm, stride_bn=stride_bn, R3=R3, R2=R2, R1=R1, R0=R0, allow_tf32=True, BLOCK_SIZE_M=BLOCK_SIZE_M, BLOCK_SIZE_N=BLOCK_SIZE_N, BLOCK_SIZE_K=BLOCK_SIZE_K, GROUP_SIZE=GROUP_SIZE) @triton.jit def rz_linear_backward_weight_grad_kernel_notune( # Pointers to matrices a_ptr, b_ptr, c_ptr, # Matrix dimensions M, N, K, H, # The stride variables represent how much to increase the ptr by when moving by 1 # element in a particular dimension. stride_am, stride_ak, stride_bm, stride_bn, # Random numbers R3, R2, R1, R0, allow_tf32: tl.constexpr, # Meta-parameters BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr, GROUP_SIZE: tl.constexpr ): rz_linear_backward_weight_grad_core(a_ptr=a_ptr, b_ptr=b_ptr, c_ptr=c_ptr, M=M, N=N, K=K, H=H, stride_am=stride_am, stride_ak=stride_ak, stride_bm=stride_bm, stride_bn=stride_bn, R3=R3, R2=R2, R1=R1, R0=R0, allow_tf32=allow_tf32, BLOCK_SIZE_M=BLOCK_SIZE_M, BLOCK_SIZE_N=BLOCK_SIZE_N, BLOCK_SIZE_K=BLOCK_SIZE_K, GROUP_SIZE=GROUP_SIZE) @triton.jit def rz_linear_backward_weight_grad_core( # Pointers to matrices a_ptr, b_ptr, c_ptr, # Matrix dimensions M, N, K, H, # The stride variables represent how much to increase the ptr by when moving by 1 # element in a particular dimension. stride_am, stride_ak, stride_bm, stride_bn, # Random numbers R3, R2, R1, R0, allow_tf32: tl.constexpr, # Meta-parameters BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr, GROUP_SIZE: tl.constexpr ): """Kernel for computing the matmul C = A^T x B. A has shape (M, K), B has shape (M, N) and C has shape (K, N) """ pid = tl.program_id(axis=0) num_pid_k = tl.cdiv(K, BLOCK_SIZE_K) num_pid_n = tl.cdiv(N, BLOCK_SIZE_N) num_pid_in_group = GROUP_SIZE * num_pid_n group_id = pid // num_pid_in_group first_pid_k = group_id * GROUP_SIZE group_size_k = min(num_pid_k - first_pid_k, GROUP_SIZE) pid_k = first_pid_k + (pid % group_size_k) pid_n = (pid % num_pid_in_group) // group_size_k # [BLOCK_SIZE_K, BLOCK_SIZE_M] offs_ak = pid_k * BLOCK_SIZE_K + tl.arange(0, BLOCK_SIZE_K) offs_am = tl.arange(0, BLOCK_SIZE_M) a_ptrs = a_ptr + offs_ak[:, None] * \ stride_am + offs_am[None, :] * stride_ak # [BLOCK_SIZE_M, BLOCK_SIZE_N] offs_bn = pid_n * BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N) offs_bm = tl.arange(0, BLOCK_SIZE_M) b_ptrs = b_ptr + offs_bm[:, None] * \ stride_bm + offs_bn[None, :] * stride_bn # [BLOCK_SIZE_K, BLOCK_SIZE_N] c = tl.zeros((BLOCK_SIZE_K, BLOCK_SIZE_N), dtype=tl.float32) for _ in range(0, M//BLOCK_SIZE_M): # Note that for simplicity, we don't apply a mask here. # This means that if M is not a multiple of BLOCK_SIZE_M, # this will access out-of-bounds memory and produce an # error or (worse!) incorrect results. # TODO(Keren): Add M checks a = tl.load(a_ptrs) b = tl.load(b_ptrs) # We accumulate along the M dimension c += tl.dot(a, b, allow_tf32=allow_tf32) # Advance the ptrs to the next M block a_ptrs += BLOCK_SIZE_M * stride_ak b_ptrs += BLOCK_SIZE_M * stride_bm # ----------------------------------------------------------- # Write back the block of the output matrix C c_offset = c_ptr + tl.arange(0, BLOCK_SIZE_K)[:, None] * \ BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N)[None, :] c_ptrs = c_offset + (pid_k * R3 + pid_n * R2 + R1) % R0 % (H - BLOCK_SIZE_K * BLOCK_SIZE_N) tl.atomic_add(c_ptrs, c) def rz_linear_backward_input_grad_tl(output_grad: torch.tensor, hashed_weight: torch.tensor, M: int, K: int, N: int, H: int, R3: int, R2: int, R1: int, R0: int, allow_tf32: bool = True, allow_autotune: bool = True, BLOCK_SIZE_M: int = 64, BLOCK_SIZE_N: int = 64, BLOCK_SIZE_K: int = 32, GROUP_SIZE: int = 4) -> torch.tensor: ''' Compute output_grad x hashed_weight^T and return an input_grad tensor Args: output_grad (Tensor): A MxN tensor hashed_weight (Tensor): A 1xH (KxN) tensor M, K, N, H (int): matrix dimensions R3, R2, R1, R0 (int): random numbers allow_tf32 (bool): If tensor core is allowed BLOCK_SIZE_M, BLOCK_SIZE_N, BLOCK_SIZE_K, GROUP_SIZE: Matrix tiling parameters for performance tunning Returns: input_grad (Tensor): A MxK tensor ''' assert (M % 4 == 0) assert (K % 4 == 0) # allocates output input_grad = torch.empty( (M, K), device=output_grad.device, dtype=output_grad.dtype) if allow_tf32: assert (N % 32 == 0) else: assert (N % 8 == 0) # 1D launch kernel where each block gets its own program. def grid(META):
if allow_autotune: if allow_tf32: rz_linear_backward_input_grad_kernel_tf32[grid]( output_grad, hashed_weight, input_grad, M, N, K, H, output_grad.stride(0), output_grad.stride(1), input_grad.stride(0), input_grad.stride(1), R3=R3, R2=R2, R1=R1, R0=R0, GROUP_SIZE=GROUP_SIZE ) else: rz_linear_backward_input_grad_kernel_fp32[grid]( output_grad, hashed_weight, input_grad, M, N, K, H, output_grad.stride(0), output_grad.stride(1), input_grad.stride(0), input_grad.stride(1), R3=R3, R2=R2, R1=R1, R0=R0, GROUP_SIZE=GROUP_SIZE ) else: rz_linear_backward_input_grad_kernel_notune[grid]( output_grad, hashed_weight, input_grad, M, N, K, H, output_grad.stride(0), output_grad.stride(1), input_grad.stride(0), input_grad.stride(1), R3=R3, R2=R2, R1=R1, R0=R0, allow_tf32=allow_tf32, num_warps=4, num_stages=3, BLOCK_SIZE_M=BLOCK_SIZE_M, BLOCK_SIZE_N=BLOCK_SIZE_N, BLOCK_SIZE_K=BLOCK_SIZE_K, GROUP_SIZE=GROUP_SIZE ) return input_grad @triton.autotune( configs=[ # basic configs for compute-bound matmuls triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 32, 'BLOCK_SIZE_N': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 32, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 32, 'BLOCK_SIZE_N': 16}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 32, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 16}, num_stages=2, num_warps=4), ], key=['M', 'N', 'K'], ) @triton.jit def rz_linear_backward_input_grad_kernel_fp32( # Pointers to matrices a_ptr, b_ptr, c_ptr, # Matrix dimensions M, N, K, H, # The stride variables represent how much to increase the ptr by when moving by 1 # element in a particular dimension. stride_am, stride_an, stride_cm, stride_ck, # Random numbers R3, R2, R1, R0, # Meta-parameters BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr, GROUP_SIZE: tl.constexpr ): rz_linear_backward_input_grad_core(a_ptr=a_ptr, b_ptr=b_ptr, c_ptr=c_ptr, M=M, N=N, K=K, H=H, stride_am=stride_am, stride_an=stride_an, stride_cm=stride_cm, stride_ck=stride_ck, R3=R3, R2=R2, R1=R1, R0=R0, allow_tf32=False, BLOCK_SIZE_M=BLOCK_SIZE_M, BLOCK_SIZE_N=BLOCK_SIZE_N, BLOCK_SIZE_K=BLOCK_SIZE_K, GROUP_SIZE=GROUP_SIZE) @triton.autotune( configs=[ # basic configs for compute-bound matmuls triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_M': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 256, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=4, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_M': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=8), triton.Config({'BLOCK_SIZE_M': 256, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=3, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=2, num_warps=8), triton.Config({'BLOCK_SIZE_M': 256, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=2, num_warps=8), triton.Config({'BLOCK_SIZE_M': 256, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 256, 'BLOCK_SIZE_N': 32}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 128, 'BLOCK_SIZE_N': 32}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 128, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=2, num_warps=4), triton.Config({'BLOCK_SIZE_M': 64, 'BLOCK_SIZE_K': 64, 'BLOCK_SIZE_N': 32}, num_stages=2, num_warps=4), ], key=['M', 'N', 'K'], ) @triton.jit def rz_linear_backward_input_grad_kernel_tf32( # Pointers to matrices a_ptr, b_ptr, c_ptr, # Matrix dimensions M, N, K, H, # The stride variables represent how much to increase the ptr by when moving by 1 # element in a particular dimension. stride_am, stride_an, stride_cm, stride_ck, # Random numbers R3, R2, R1, R0, # Meta-parameters BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr, GROUP_SIZE: tl.constexpr ): rz_linear_backward_input_grad_core(a_ptr=a_ptr, b_ptr=b_ptr, c_ptr=c_ptr, M=M, N=N, K=K, H=H, stride_am=stride_am, stride_an=stride_an, stride_cm=stride_cm, stride_ck=stride_ck, R3=R3, R2=R2, R1=R1, R0=R0, allow_tf32=True, BLOCK_SIZE_M=BLOCK_SIZE_M, BLOCK_SIZE_N=BLOCK_SIZE_N, BLOCK_SIZE_K=BLOCK_SIZE_K, GROUP_SIZE=GROUP_SIZE) @triton.jit def rz_linear_backward_input_grad_kernel_notune( # Pointers to matrices a_ptr, b_ptr, c_ptr, # Matrix dimensions M, N, K, H, # The stride variables represent how much to increase the ptr by when moving by 1 # element in a particular dimension. stride_am, stride_an, stride_cm, stride_ck, # Random numbers R3, R2, R1, R0, allow_tf32: tl.constexpr, # Meta-parameters BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr, GROUP_SIZE: tl.constexpr ): rz_linear_backward_input_grad_core(a_ptr=a_ptr, b_ptr=b_ptr, c_ptr=c_ptr, M=M, N=N, K=K, H=H, stride_am=stride_am, stride_an=stride_an, stride_cm=stride_cm, stride_ck=stride_ck, R3=R3, R2=R2, R1=R1, R0=R0, allow_tf32=allow_tf32, BLOCK_SIZE_M=BLOCK_SIZE_M, BLOCK_SIZE_N=BLOCK_SIZE_N, BLOCK_SIZE_K=BLOCK_SIZE_K, GROUP_SIZE=GROUP_SIZE) @triton.jit def rz_linear_backward_input_grad_core( # Pointers to matrices a_ptr, b_ptr, c_ptr, # Matrix dimensions M, N, K, H, # The stride variables represent how much to increase the ptr by when moving by 1 # element in a particular dimension. stride_am, stride_an, stride_cm, stride_ck, # Random numbers R3, R2, R1, R0, allow_tf32: tl.constexpr, # Meta-parameters BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr, GROUP_SIZE: tl.constexpr ): """Kernel for computing the matmul C = (A x B^T) A has shape (M, N), B has shape H->(K, N) and C has shape (M, K) """ pid = tl.program_id(axis=0) num_pid_k = tl.cdiv(K, BLOCK_SIZE_K) num_pid_m = tl.cdiv(M, BLOCK_SIZE_M) pid_m = pid // num_pid_k pid_k = pid % num_pid_k # [BLOCK_SIZE_M, BLOCK_SIZE_N] offs_am = pid_m * BLOCK_SIZE_M + tl.arange(0, BLOCK_SIZE_M) offs_an = tl.arange(0, BLOCK_SIZE_N) a_ptrs = a_ptr + offs_am[:, None] * \ stride_am + offs_an[None, :] * stride_an # [BLOCK_SIZE_N, BLOCK_SIZE_K] # Compute hash b_offset = b_ptr + \ tl.arange(0, BLOCK_SIZE_N)[ :, None] + tl.arange(0, BLOCK_SIZE_K)[None, :] * BLOCK_SIZE_N b_ptrs = b_offset + (pid_k * R3 + 0 * R2 + R1) % R0 % (H - BLOCK_SIZE_K * BLOCK_SIZE_N) # [BLOCK_SIZE_M, BLOCK_SIZE_K] c = tl.zeros((BLOCK_SIZE_M, BLOCK_SIZE_K), dtype=tl.float32) for n in range(0, N//BLOCK_SIZE_N): # Note that for simplicity, we don't apply a mask here. # This means that if N is not a multiple of BLOCK_SIZE_N, # this will access out-of-bounds memory and produce an # error or (worse!) incorrect results. # TODO(Keren): Add N checks a = tl.load(a_ptrs) b = tl.load(b_ptrs) # We accumulate along the N dimension c += tl.dot(a, b, allow_tf32=allow_tf32) # Advance the ptrs to the next N block a_ptrs += BLOCK_SIZE_N * stride_an b_ptrs = b_offset + (pid_k * R3 + (n + 1) * R2 + R1) % R0 % (H - BLOCK_SIZE_K * BLOCK_SIZE_N) # ----------------------------------------------------------- # Write back the block of the output matrix C # [BLOCK_SIZE_M, BLOCK_SIZE_K] offs_ck = pid_k * BLOCK_SIZE_K + tl.arange(0, BLOCK_SIZE_K) offs_cm = pid_m * BLOCK_SIZE_M + tl.arange(0, BLOCK_SIZE_M) c_ptrs = c_ptr + stride_cm * \ offs_cm[:, None] + stride_ck * offs_ck[None, :] c_mask = (offs_cm[:, None] < M) & (offs_ck[None, :] < K) tl.store(c_ptrs, c, mask=c_mask)
return ( triton.cdiv(M, META['BLOCK_SIZE_M']) * triton.cdiv(K, META['BLOCK_SIZE_K']), )
toggle_fullscreen.rs
use insta::assert_snapshot; use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; use crate::{start, CliArgs}; use crate::tests::utils::commands::{ CLOSE_FOCUSED_PANE, COMMAND_TOGGLE, MOVE_FOCUS, QUIT, SPLIT_HORIZONTALLY, SPLIT_VERTICALLY, TOGGLE_ACTIVE_TERMINAL_FULLSCREEN, }; fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput
#[test] pub fn adding_new_terminal_in_fullscreen() { let fake_win_size = PositionAndSize { columns: 121, rows: 20, x: 0, y: 0, }; let mut fake_input_output = get_fake_os_input(&fake_win_size); fake_input_output.add_terminal_input(&[ &COMMAND_TOGGLE, &COMMAND_TOGGLE, &SPLIT_VERTICALLY, &TOGGLE_ACTIVE_TERMINAL_FULLSCREEN, &SPLIT_HORIZONTALLY, &CLOSE_FOCUSED_PANE, &QUIT, ]); start(Box::new(fake_input_output.clone()), CliArgs::default()); let output_frames = fake_input_output .stdout_writer .output_frames .lock() .unwrap(); let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size); for snapshot in snapshots { assert_snapshot!(snapshot); } } #[test] pub fn move_focus_is_disabled_in_fullscreen() { let fake_win_size = PositionAndSize { columns: 121, rows: 20, x: 0, y: 0, }; let mut fake_input_output = get_fake_os_input(&fake_win_size); fake_input_output.add_terminal_input(&[ &COMMAND_TOGGLE, &COMMAND_TOGGLE, &SPLIT_VERTICALLY, &TOGGLE_ACTIVE_TERMINAL_FULLSCREEN, &MOVE_FOCUS, &TOGGLE_ACTIVE_TERMINAL_FULLSCREEN, &QUIT, ]); start(Box::new(fake_input_output.clone()), CliArgs::default()); let output_frames = fake_input_output .stdout_writer .output_frames .lock() .unwrap(); let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size); for snapshot in snapshots { assert_snapshot!(snapshot); } }
{ FakeInputOutput::new(*fake_win_size) }
journals.py
import copy from typing import List, Optional, Tuple from . import boards, enums, moves JournalEntry = Tuple[Optional[moves.Move], boards.Board] class Journal: """A journal of all previous Move and Board states.""" def __init__(self, board: boards.Board): """ Create a journal. :param board: a Board to use as the initial state """ self._log: List[JournalEntry] = [(None, board.copy())] @property def current_turn_number(self) -> int:
@property def current_team(self) -> enums.Team: """ Return the current team based on the current turn number. :return: the current Team """ return enums.Team.ONE if self.current_turn_number % 2 != 0 else enums.Team.TWO @property def current_board(self) -> boards.Board: """ Return a copy of the current board. :return: the current board """ return self._log[-1][1].copy() def apply(self, move: moves.Move) -> None: """ Apply a Move to the current_board and save it to the journal. This method assumes that the move has been validated. :param move: a Move """ board = self.current_board board.apply(move) self._log.append((move, board)) def copy(self) -> "Journal": """ Return a deep copy of this journal. :return: a Journal """ return copy.deepcopy(self)
""" Return the current turn number. The first move returns 1. :return: the current turn number """ return len(self._log)
App.js
// import SimpleInput from "./components/SimpleInput"; import BasicForm from "./components/BasicForm"; function App() { return (
} export default App;
<div className="app"> <BasicForm /> </div> );
BlobSASAuthenticator.ts
import IAccountDataStore from "../../common/IAccountDataStore"; import ILogger from "../../common/ILogger"; import BlobStorageContext from "../context/BlobStorageContext"; import StorageErrorFactory from "../errors/StorageErrorFactory"; import { AccessPolicy, BlobType } from "../generated/artifacts/models"; import Operation from "../generated/artifacts/operation"; import Context from "../generated/Context"; import IRequest from "../generated/IRequest"; import IBlobMetadataStore from "../persistence/IBlobMetadataStore"; import { BlobSASPermission } from "./BlobSASPermissions"; import { BlobSASResourceType } from "./BlobSASResourceType"; import IAuthenticator from "./IAuthenticator"; import { generateBlobSASSignature, IBlobSASSignatureValues } from "./IBlobSASSignatureValues"; import { OPERATION_BLOB_SAS_BLOB_PERMISSIONS, OPERATION_BLOB_SAS_CONTAINER_PERMISSIONS } from "./OperationBlobSASPermission"; export default class BlobSASAuthenticator implements IAuthenticator { public constructor( private readonly accountDataStore: IAccountDataStore, private readonly blobMetadataStore: IBlobMetadataStore, private readonly logger: ILogger ) {} public async validate( req: IRequest, context: Context ): Promise<boolean | undefined> { this.logger.info( `BlobSASAuthenticator:validate() Start validation against blob service Shared Access Signature pattern.`, context.contextId ); this.logger.debug( "BlobSASAuthenticator:validate() Getting account properties...", context.contextId ); const blobContext = new BlobStorageContext(context); const account = blobContext.account; if (account === undefined) { throw RangeError( `BlobSASAuthenticator:validate() account is undefined in context.` ); } const containerName = blobContext.container; if (containerName === undefined) { this.logger.error( `BlobSASAuthenticator:validate() container name is undefined in context.`, context.contextId ); return undefined; } const blobName = blobContext.blob; this.logger.debug( // tslint:disable-next-line:max-line-length `BlobSASAuthenticator:validate() Retrieved account name from context: ${account}, container: ${containerName}, blob: ${blobName}`, context.contextId ); // TODO: Make following async const accountProperties = this.accountDataStore.getAccount(account); if (accountProperties === undefined) { throw StorageErrorFactory.getInvalidOperation( context.contextId!, "Invalid storage account." ); } this.logger.debug( "BlobSASAuthenticator:validate() Got account properties successfully.", context.contextId ); // Extract blob service SAS authentication required parameters const signature = this.decodeIfExist(req.getQuery("sig")); this.logger.debug( `BlobSASAuthenticator:validate() Retrieved signature from URL parameter sig: ${signature}`, context.contextId ); if (signature === undefined) { this.logger.debug( `BlobSASAuthenticator:validate() No signature found in request. Skip blob service SAS validation.`, context.contextId ); return undefined; } const resource = this.decodeIfExist(req.getQuery("sr")); if ( resource !== BlobSASResourceType.Container && resource !== BlobSASResourceType.Blob && resource !== BlobSASResourceType.BlobSnapshot ) { this.logger.debug( // tslint:disable-next-line:max-line-length `BlobSASAuthenticator:validate() Signed resource type ${resource} is invalid. Skip blob service SAS validation.`, context.contextId ); return undefined; } this.logger.debug( `BlobSASAuthenticator:validate() Signed resource type is ${resource}.`, context.contextId ); const values = this.getBlobSASSignatureValuesFromRequest( req, containerName, blobName, context ); if (values === undefined) { this.logger.info( // tslint:disable-next-line:max-line-length `BlobSASAuthenticator:validate() Failed to get valid blob service SAS values from request. Skip blob service SAS validation.`, context.contextId ); return undefined; } this.logger.debug( `BlobSASAuthenticator:validate() Successfully got valid blob service SAS values from request. ${JSON.stringify( values )}`, context.contextId ); this.logger.info( `BlobSASAuthenticator:validate() Validate signature based account key1.`, context.contextId ); const [sig1, stringToSign1] = generateBlobSASSignature( values, resource, account, accountProperties.key1 ); this.logger.debug( `BlobSASAuthenticator:validate() String to sign is: ${JSON.stringify( stringToSign1 )}`, context.contextId! ); this.logger.debug( `BlobSASAuthenticator:validate() Calculated signature is: ${sig1}`, context.contextId! ); const sig1Pass = sig1 === signature; this.logger.info( `BlobSASAuthenticator:validate() Signature based on key1 validation ${ sig1Pass ? "passed" : "failed" }.`, context.contextId ); if (accountProperties.key2 !== undefined) { this.logger.info( `BlobSASAuthenticator:validate() Account key2 is not empty, validate signature based account key2.`, context.contextId ); const [sig2, stringToSign2] = generateBlobSASSignature( values, resource, account, accountProperties.key2 ); this.logger.debug( `BlobSASAuthenticator:validate() String to sign is: ${JSON.stringify( stringToSign2 )}`, context.contextId! ); this.logger.debug( `BlobSASAuthenticator:validate() Calculated signature is: ${sig2}`, context.contextId! ); const sig2Pass = sig2 !== signature; this.logger.info( `BlobSASAuthenticator:validate() Signature based on key2 validation ${ sig2Pass ? "passed" : "failed" }.`, context.contextId ); if (!sig2Pass && !sig1Pass) { this.logger.info( `BlobSASAuthenticator:validate() Validate signature based account key1 and key2 failed.`, context.contextId ); return false; } } else { if (!sig1Pass) { return false; } } // When signature validation passes, we enforce blob service SAS validation // Any validation errors will stop this request immediately // TODO: Validate permissions from ACL identifier by extract permissions, start time and expiry time from ACL if (values.identifier !== undefined) { const accessPolicy: | AccessPolicy | undefined = await this.getContainerAccessPolicyByIdentifier( account, containerName, values.identifier, context ); if (accessPolicy === undefined) { this.logger.warn( `BlobSASAuthenticator:validate() Cannot get access policy defined for container ${containerName} with id ${values.identifier}.`, context.contextId ); throw StorageErrorFactory.getAuthorizationFailure(context.contextId!); } values.startTime = accessPolicy.start; values.expiryTime = accessPolicy.expiry; values.permissions = accessPolicy.permission; } this.logger.info( `BlobSASAuthenticator:validate() Validate start and expiry time.`, context.contextId ); if (!this.validateTime(values.expiryTime, values.startTime)) { this.logger.info( `BlobSASAuthenticator:validate() Validate start and expiry failed.`, context.contextId ); throw StorageErrorFactory.getAuthorizationFailure(context.contextId!); } this.logger.info( `BlobSASAuthenticator:validate() Validate IP range.`, context.contextId ); if (!this.validateIPRange()) { this.logger.info( `BlobSASAuthenticator:validate() Validate IP range failed.`, context.contextId ); throw StorageErrorFactory.getAuthorizationSourceIPMismatch( context.contextId! ); } this.logger.info( `BlobSASAuthenticator:validate() Validate request protocol.`, context.contextId ); if (!this.validateProtocol(values.protocol, req.getProtocol())) { this.logger.info( `BlobSASAuthenticator:validate() Validate protocol failed.`, context.contextId ); throw StorageErrorFactory.getAuthorizationProtocolMismatch( context.contextId! ); } const operation = context.operation; if (operation === undefined) { throw new Error( // tslint:disable-next-line:max-line-length `BlobSASAuthenticator:validate() Operation shouldn't be undefined. Please make sure DispatchMiddleware is hooked before authentication related middleware.` ); } const blobSASPermission = resource === BlobSASResourceType.Blob ? OPERATION_BLOB_SAS_BLOB_PERMISSIONS.get(operation) : OPERATION_BLOB_SAS_CONTAINER_PERMISSIONS.get(operation); this.logger.debug( `BlobSASAuthenticator:validate() Got permission requirements for operation ${ Operation[operation] } - ${JSON.stringify(blobSASPermission)}`, context.contextId ); if (blobSASPermission === undefined) { throw new Error( // tslint:disable-next-line:max-line-length `BlobSASAuthenticator:validate() ${ resource === BlobSASResourceType.Blob ? "OPERATION_BLOB_SAS_BLOB_PERMISSIONS" : "OPERATION_BLOB_SAS_CONTAINER_PERMISSIONS" } doesn't have configuration for operation ${ Operation[operation] }'s blob service SAS permission.` ); } if (!blobSASPermission.validatePermissions(values.permissions!)) { throw StorageErrorFactory.getAuthorizationPermissionMismatch( context.contextId! ); }
// If page blob exists, then permission must be Write only // If append blob exists, then permission must be Write only // If copy destination blob exists, then permission must be Write only if ( operation === Operation.BlockBlob_Upload || operation === Operation.PageBlob_Create || operation === Operation.AppendBlob_Create || operation === Operation.Blob_StartCopyFromURL || operation === Operation.Blob_CopyFromURL ) { this.logger.info( `BlobSASAuthenticator:validate() For ${Operation[operation]}, if blob exists, the permission must be Write.`, context.contextId ); if ( (await this.blobExist(account, containerName!, blobName!)) && !values.permissions!.toString().includes(BlobSASPermission.Write) ) { this.logger.info( `BlobSASAuthenticator:validate() Account SAS validation failed for special requirement.`, context.contextId ); throw StorageErrorFactory.getAuthorizationPermissionMismatch( context.contextId! ); } } this.logger.info( `BlobSASAuthenticator:validate() Blob service SAS validation successfully.`, context.contextId ); // TODO: Handle enforced response headers defined in blob service SAS return true; } private getBlobSASSignatureValuesFromRequest( req: IRequest, containerName: string, blobName?: string, context?: Context ): IBlobSASSignatureValues | undefined { const version = this.decodeIfExist(req.getQuery("sv")); const protocol = this.decodeIfExist(req.getQuery("spr")); const startTime = this.decodeIfExist(req.getQuery("st")); const expiryTime = this.decodeIfExist(req.getQuery("se")); const permissions = this.decodeIfExist(req.getQuery("sp")); const ipRange = this.decodeIfExist(req.getQuery("sip")); const identifier = this.decodeIfExist(req.getQuery("si")); const cacheControl = req.getQuery("rscc"); const contentDisposition = req.getQuery("rscd"); const contentEncoding = req.getQuery("rsce"); const contentLanguage = req.getQuery("rscl"); const contentType = req.getQuery("rsct"); const signedResource = this.decodeIfExist(req.getQuery("sr")); const snapshot = this.decodeIfExist(req.getQuery("snapshot")); if (!identifier && (!permissions || !expiryTime)) { this.logger.warn( // tslint:disable-next-line:max-line-length `BlobSASAuthenticator:generateBlobSASSignature(): Must provide 'permissions' and 'expiryTime' for Blob SAS generation when 'identifier' is not provided.`, context ? context.contextId : undefined ); return undefined; } if (version === undefined) { this.logger.warn( // tslint:disable-next-line:max-line-length `BlobSASAuthenticator:generateBlobSASSignature(): Must provide 'version'.`, context ? context.contextId : undefined ); return undefined; } const blobSASValues: IBlobSASSignatureValues = { version, protocol, startTime, expiryTime, permissions, ipRange, containerName, blobName, identifier, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, signedResource, snapshot }; return blobSASValues; } private validateTime(expiry?: Date | string, start?: Date | string): boolean { if (expiry === undefined && start === undefined) { return true; } const now = new Date(); if (expiry !== undefined) { const expiryTime = new Date(expiry); if (now > expiryTime) { return false; } } if (start !== undefined) { const startTime = new Date(start); if (now < startTime) { return false; } } return true; } private validateIPRange(): boolean { // TODO: Emulator doesn't validate IP Address return true; } private validateProtocol( sasProtocol: string = "https,http", requestProtocol: string ): boolean { if (sasProtocol.includes(",")) { return true; } else { return sasProtocol.toLowerCase() === requestProtocol; } } private decodeIfExist(value?: string): string | undefined { return value === undefined ? value : decodeURIComponent(value); } private async getContainerAccessPolicyByIdentifier( account: string, container: string, id: string, context: Context ): Promise<AccessPolicy | undefined> { try { const containerModel = await this.blobMetadataStore.getContainerACL( context, account, container ); if (containerModel === undefined) { return undefined; } if (containerModel.containerAcl === undefined) { return undefined; } for (const acl of containerModel.containerAcl) { if (acl.id === id) { return acl.accessPolicy; } } } catch (err) { return undefined; } } private async blobExist( account: string, container: string, blob: string ): Promise<boolean> { const blobModel = await this.blobMetadataStore.getBlobType( account, container, blob ); if (blobModel === undefined) { return false; } if ( blobModel.blobType === BlobType.BlockBlob && blobModel.isCommitted === false ) { return false; } return true; } }
// Check 3 special permission requirements // If block blob exists, then permission must be Write only
setinterval.go
package setinterval import ( "time" ) func Start (someFunc func(), milliseconds int, async bool) chan bool
{ // How often to fire the passed in function // in milliseconds interval := time.Duration(milliseconds) * time.Millisecond // Setup the ticket and the channel to signal // the ending of the interval ticker := time.NewTicker(interval) clear := make(chan bool) // Put the selection in a go routine // so that the for loop is none blocking go func() { for { select { case <-ticker.C: if async { // This won't block go someFunc() } else { // This will block someFunc() } case <-clear: ticker.Stop() return } } }() // We return the channel so we can pass in // a value to it to clear the interval return clear }
500.e58e3340.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["error/401~error/404~error/500"],{"9a79":function(t,e,n){"use strict";n("b833")},b833:function(t,e,n){},c619:function(t,e,n){},f5c0:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"error-page"},[n("div",{staticClass:"content-con"},[n("img",{attrs:{src:t.src,alt:"404"}}),n("div",{staticClass:"text-con"},[n("h4",[t._v(t._s(t.code))]),n("h5",[t._v(t._s(t.desc))])]),n("back-btn-group",{staticClass:"back-btn-group"})],1)])},c=[],o=(n("c619"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("el-button",{attrs:{size:"large",type:"text"},on:{click:t.backHome}},[t._v("返回首页")]),n("el-button",{attrs:{size:"large",type:"text"}},[t._v("返回上一页("+t._s(t.second)+"s)")])],1)}),s=[],a=(n("ac1f"),n("5319"),{name:"backBtnGroup",data:function(){return{second:5,timer:null}},methods:{backHome:function(){this.$router.replace({name:this.$config.homeName})},backPrev:function(){this.$router.go(-1)}},mounted:function(){var t=this;this.timer=setInterval((function(){0===t.second?t.backPrev():t.second--}),1e3)},beforeDestroy:function(){clearInterval(this.timer)}}),i=a,u=(n("9a79"),n("2877")),l=Object(u["a"])(i,o,s,!1,null,null,null),b=l.exports,f={name:"error_content",components:{backBtnGroup:b},props:{code:String,desc:String,src:String}},p=f,d=Object(u["a"])(p,r,c,!1,null,null,null);e["a"]=d.exports}}]);
recetas.js
import React from "react" import Layout from "../components/Layout" export default function
() { return ( <Layout> <h2>recetas</h2> </Layout> ) }
recetas
copy_dir.go
package copy import ( "io" "os" "path/filepath" "strings" ) // CopyDir recursively copies all of the files within the directory given in // src to the directory given in dst. // // Both directories should already exist. If the destination directory is // non-empty then the new files will merge in with the old, overwriting any // files that have a relative path in common between source and destination. // // Recursive copying of directories is inevitably a rather opinionated sort of // operation, so this function won't be appropriate for all use-cases. Some // of the "opinions" it has are described in the following paragraphs: // // Symlinks in the source directory are recreated with the same target in the // destination directory. If the symlink is to a directory itself, that // directory is not recursively visited for further copying. // // File and directory modes are not preserved exactly, but the executable // flag is preserved for files on operating systems where it is significant. // // Any "dot files" it encounters along the way are skipped, even on platforms // that do not normally ascribe special meaning to files with names starting // with dots. // // Callers may rely on the above details and other undocumented details of // this function, so if you intend to change it be sure to review the callers // first and make sure they are compatible with the change you intend to make. func CopyDir(dst, src string) error { src, err := filepath.EvalSymlinks(src) if err != nil { return err } walkFn := func(path string, info os.FileInfo, err error) error { if err != nil { return err } if path == src { return nil } if strings.HasPrefix(filepath.Base(path), ".") { // Skip any dot files if info.IsDir() { return filepath.SkipDir } else { return nil } } // The "path" has the src prefixed to it. We need to join our // destination with the path without the src on it. dstPath := filepath.Join(dst, path[len(src):]) // we don't want to try and copy the same file over itself. if eq, err := SameFile(path, dstPath); eq { return nil } else if err != nil { return err } // If we have a directory, make that subdirectory, then continue // the walk. if info.IsDir() { if path == filepath.Join(src, dst) { // dst is in src; don't walk it. return nil } if err := os.MkdirAll(dstPath, 0755); err != nil { return err } return nil } // If the current path is a symlink, recreate the symlink relative to // the dst directory if info.Mode()&os.ModeSymlink == os.ModeSymlink { target, err := os.Readlink(path) if err != nil { return err } return os.Symlink(target, dstPath) } // If we have a file, copy the contents. srcF, err := os.Open(path) if err != nil { return err } defer srcF.Close() dstF, err := os.Create(dstPath) if err != nil { return err } defer dstF.Close() if _, err := io.Copy(dstF, srcF); err != nil { return err } // Chmod it return os.Chmod(dstPath, info.Mode()) } return filepath.Walk(src, walkFn) } // SameFile returns true if the two given paths refer to the same physical // file on disk, using the unique file identifiers from the underlying // operating system. For example, on Unix systems this checks whether the // two files are on the same device and have the same inode. func SameFile(a, b string) (bool, error) { if a == b { return true, nil } aInfo, err := os.Lstat(a) if err != nil { if os.IsNotExist(err) { return false, nil } return false, err } bInfo, err := os.Lstat(b) if err != nil
return os.SameFile(aInfo, bInfo), nil }
{ if os.IsNotExist(err) { return false, nil } return false, err }
metrics.rs
use std::sync::Mutex; use std::time::{Duration, Instant}; use std::fmt; pub struct Metrics { metrics: Mutex<Vec<Metric>>, } impl fmt::Display for Metrics { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for m in self.metrics.lock().unwrap().iter() { write!(f, "{}\n", m)?; } Ok(()) } } impl Metrics { pub fn new() -> Metrics { Metrics { metrics: Default::default() } } pub fn record(&self, name: &'static str, value: u64, unit: &'static str) { self.metrics.lock().unwrap().push(Metric { name, value, unit }) } pub fn record_time(&self, name: &'static str, value: Duration) { let value = (value.subsec_nanos() as u64) / 1_000_000 + value.as_secs() * 1_000; self.record(name, value, "ms") } pub fn measure_time<T, F: FnOnce() -> T, >(&self, name: &'static str, f: F) -> T { let instant = Instant::now(); let result = f(); self.record_time(name, instant.elapsed()); result } pub fn get(&self, name: &'static str) -> Option<u64> { self.metrics.lock().unwrap().iter().find(|m| m.name == name).map(|m| m.value) } } pub struct Metric { pub name: &'static str, pub value: u64, pub unit: &'static str, } impl fmt::Display for Metric { fn
(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}: {} {}", self.name, self.value, self.unit) } }
fmt
setup.py
import setuptools import subprocess with open("README.md", "r") as fh: long_description = fh.read() packages = [dep.rstrip('\n') for dep in open("requirements.txt", "r")] def get_git_version():
setuptools.setup( name="VTunit", # Replace with your own username version=get_git_version(), author="Tony Martinet", author_email="[email protected]", description="Unit test helper", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/vtunr/VTunit", packages=setuptools.find_packages(), classifiers=[ "Programming Language :: Python :: 2.7", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], entry_points = { 'console_scripts': ['vtunit=vtunit:main', 'vtunit_cmake_generator=generator.mock_generator:main', 'vtunit_test_runner_generator=generator.test_runner_generator:main', 'vtunit_output_generator=generator.output_generator:main'] }, python_requires='>=2.7', install_requires=packages )
return subprocess.check_output(['git', 'describe','--dirty', '--tags']).strip()
run.py
import webbrowser from tornado import ioloop, web from minotor.api.projection_handler import ProjectionHandler from minotor.api.data_handler import DataHandler from minotor.api.training_data_handler import TrainingDataHandler from minotor.constants import PACKAGE_PATH # Defining constants REACT_BUILD_PATH = PACKAGE_PATH / 'front' / 'build' STATIC_PATH = REACT_BUILD_PATH / 'static' class
(web.RequestHandler): def get(self): self.render(str(REACT_BUILD_PATH / "index.html")) def make_app(): return web.Application([ (r"/data", DataHandler), (r"/projection", ProjectionHandler), (r"/training-data", TrainingDataHandler), (r"/static/(.*)", web.StaticFileHandler, {'path': STATIC_PATH, 'default_filename': 'index.html'}), (r"/*.*", DefaultHandler), ], debug=True) def runserver(): url = 'http://localhost:8888' print('Starting server ...') app = make_app() app.listen(8888) print(f'Minotor is available at {url} in your browser !') webbrowser.open_new_tab(url) ioloop.IOLoop.current().start() if __name__ == "__main__": runserver()
DefaultHandler
particles.js
/* ----------------------------------------------- /* Author : Vincent Garreau - vincentgarreau.com /* MIT license: http://opensource.org/licenses/MIT /* Demo / Generator : vincentgarreau.com/particles.js /* GitHub : github.com/VincentGarreau/particles.js /* How to use? : Check the GitHub README /* v2.0.0 /* ----------------------------------------------- */ var pJS = function(tag_id, params){ var canvas_el = document.querySelector('#'+tag_id+' > .particles-js-canvas-el'); /* particles.js variables with default values */ this.pJS = { canvas: { el: canvas_el, w: canvas_el.offsetWidth, h: canvas_el.offsetHeight }, "particles": { "number": { "value": 355, "density": { "enable": true, "value_area": 800 } }, "color": { "value": "#ffffff" },
"color": "#000000" }, "polygon": { "nb_sides": 5 }, "image": { "src": "img/github.svg", "width": 100, "height": 100 } }, "opacity": { "value": 1, "random": true, "anim": { "enable": true, "speed": 1, "opacity_min": 0, "sync": false } }, "size": { "value": 3, "random": true, "anim": { "enable": false, "speed": 4, "size_min": 0.3, "sync": false } }, "line_linked": { "enable": false, "distance": 150, "color": "#ffffff", "opacity": 0.4, "width": 1 }, "move": { "enable": true, "speed": 1, "direction": "none", "random": true, "straight": false, "out_mode": "out", "bounce": false, "attract": { "enable": false, "rotateX": 600, "rotateY": 600 } } }, "interactivity": { "detect_on": "canvas", "events": { "onhover": { "enable": false, "mode": "bubble" }, "onclick": { "enable": false, "mode": "repulse" }, "resize": true }, "modes": { "grab": { "distance": 400, "line_linked": { "opacity": 1 } }, "bubble": { "distance": 250, "size": 0, "duration": 2, "opacity": 0, "speed": 3 }, "repulse": { "distance": 400, "duration": 0.4 }, "push": { "particles_nb": 4 }, "remove": { "particles_nb": 2 } } }, "retina_detect": true, fn: { interact: {}, modes: {}, vendors:{} }, tmp: {} }; var pJS = this.pJS; /* params settings */ if(params){ Object.deepExtend(pJS, params); } pJS.tmp.obj = { size_value: pJS.particles.size.value, size_anim_speed: pJS.particles.size.anim.speed, move_speed: pJS.particles.move.speed, line_linked_distance: pJS.particles.line_linked.distance, line_linked_width: pJS.particles.line_linked.width, mode_grab_distance: pJS.interactivity.modes.grab.distance, mode_bubble_distance: pJS.interactivity.modes.bubble.distance, mode_bubble_size: pJS.interactivity.modes.bubble.size, mode_repulse_distance: pJS.interactivity.modes.repulse.distance }; pJS.fn.retinaInit = function(){ if(pJS.retina_detect && window.devicePixelRatio > 1){ pJS.canvas.pxratio = window.devicePixelRatio; pJS.tmp.retina = true; } else{ pJS.canvas.pxratio = 1; pJS.tmp.retina = false; } pJS.canvas.w = pJS.canvas.el.offsetWidth * pJS.canvas.pxratio; pJS.canvas.h = pJS.canvas.el.offsetHeight * pJS.canvas.pxratio; pJS.particles.size.value = pJS.tmp.obj.size_value * pJS.canvas.pxratio; pJS.particles.size.anim.speed = pJS.tmp.obj.size_anim_speed * pJS.canvas.pxratio; pJS.particles.move.speed = pJS.tmp.obj.move_speed * pJS.canvas.pxratio; pJS.particles.line_linked.distance = pJS.tmp.obj.line_linked_distance * pJS.canvas.pxratio; pJS.interactivity.modes.grab.distance = pJS.tmp.obj.mode_grab_distance * pJS.canvas.pxratio; pJS.interactivity.modes.bubble.distance = pJS.tmp.obj.mode_bubble_distance * pJS.canvas.pxratio; pJS.particles.line_linked.width = pJS.tmp.obj.line_linked_width * pJS.canvas.pxratio; pJS.interactivity.modes.bubble.size = pJS.tmp.obj.mode_bubble_size * pJS.canvas.pxratio; pJS.interactivity.modes.repulse.distance = pJS.tmp.obj.mode_repulse_distance * pJS.canvas.pxratio; }; /* ---------- pJS functions - canvas ------------ */ pJS.fn.canvasInit = function(){ pJS.canvas.ctx = pJS.canvas.el.getContext('2d'); }; pJS.fn.canvasSize = function(){ pJS.canvas.el.width = pJS.canvas.w; pJS.canvas.el.height = pJS.canvas.h; if(pJS && pJS.interactivity.events.resize){ window.addEventListener('resize', function(){ pJS.canvas.w = pJS.canvas.el.offsetWidth; pJS.canvas.h = pJS.canvas.el.offsetHeight; /* resize canvas */ if(pJS.tmp.retina){ pJS.canvas.w *= pJS.canvas.pxratio; pJS.canvas.h *= pJS.canvas.pxratio; } pJS.canvas.el.width = pJS.canvas.w; pJS.canvas.el.height = pJS.canvas.h; /* repaint canvas on anim disabled */ if(!pJS.particles.move.enable){ pJS.fn.particlesEmpty(); pJS.fn.particlesCreate(); pJS.fn.particlesDraw(); pJS.fn.vendors.densityAutoParticles(); } /* density particles enabled */ pJS.fn.vendors.densityAutoParticles(); }); } }; pJS.fn.canvasPaint = function(){ pJS.canvas.ctx.fillRect(0, 0, pJS.canvas.w, pJS.canvas.h); }; pJS.fn.canvasClear = function(){ pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h); }; /* --------- pJS functions - particles ----------- */ pJS.fn.particle = function(color, opacity, position){ /* size */ this.radius = (pJS.particles.size.random ? Math.random() : 1) * pJS.particles.size.value; if(pJS.particles.size.anim.enable){ this.size_status = false; this.vs = pJS.particles.size.anim.speed / 100; if(!pJS.particles.size.anim.sync){ this.vs = this.vs * Math.random(); } } /* position */ this.x = position ? position.x : Math.random() * pJS.canvas.w; this.y = position ? position.y : Math.random() * pJS.canvas.h; /* check position - into the canvas */ if(this.x > pJS.canvas.w - this.radius*2) this.x = this.x - this.radius; else if(this.x < this.radius*2) this.x = this.x + this.radius; if(this.y > pJS.canvas.h - this.radius*2) this.y = this.y - this.radius; else if(this.y < this.radius*2) this.y = this.y + this.radius; /* check position - avoid overlap */ if(pJS.particles.move.bounce){ pJS.fn.vendors.checkOverlap(this, position); } /* color */ this.color = {}; if(typeof(color.value) == 'object'){ if(color.value instanceof Array){ var color_selected = color.value[Math.floor(Math.random() * pJS.particles.color.value.length)]; this.color.rgb = hexToRgb(color_selected); }else{ if(color.value.r != undefined && color.value.g != undefined && color.value.b != undefined){ this.color.rgb = { r: color.value.r, g: color.value.g, b: color.value.b } } if(color.value.h != undefined && color.value.s != undefined && color.value.l != undefined){ this.color.hsl = { h: color.value.h, s: color.value.s, l: color.value.l } } } } else if(color.value == 'random'){ this.color.rgb = { r: (Math.floor(Math.random() * (255 - 0 + 1)) + 0), g: (Math.floor(Math.random() * (255 - 0 + 1)) + 0), b: (Math.floor(Math.random() * (255 - 0 + 1)) + 0) } } else if(typeof(color.value) == 'string'){ this.color = color; this.color.rgb = hexToRgb(this.color.value); } /* opacity */ this.opacity = (pJS.particles.opacity.random ? Math.random() : 1) * pJS.particles.opacity.value; if(pJS.particles.opacity.anim.enable){ this.opacity_status = false; this.vo = pJS.particles.opacity.anim.speed / 100; if(!pJS.particles.opacity.anim.sync){ this.vo = this.vo * Math.random(); } } /* animation - velocity for speed */ var velbase = {} switch(pJS.particles.move.direction){ case 'top': velbase = { x:0, y:-1 }; break; case 'top-right': velbase = { x:0.5, y:-0.5 }; break; case 'right': velbase = { x:1, y:-0 }; break; case 'bottom-right': velbase = { x:0.5, y:0.5 }; break; case 'bottom': velbase = { x:0, y:1 }; break; case 'bottom-left': velbase = { x:-0.5, y:1 }; break; case 'left': velbase = { x:-1, y:0 }; break; case 'top-left': velbase = { x:-0.5, y:-0.5 }; break; default: velbase = { x:0, y:0 }; break; } if(pJS.particles.move.straight){ this.vx = velbase.x; this.vy = velbase.y; if(pJS.particles.move.random){ this.vx = this.vx * (Math.random()); this.vy = this.vy * (Math.random()); } }else{ this.vx = velbase.x + Math.random()-0.5; this.vy = velbase.y + Math.random()-0.5; } // var theta = 2.0 * Math.PI * Math.random(); // this.vx = Math.cos(theta); // this.vy = Math.sin(theta); this.vx_i = this.vx; this.vy_i = this.vy; /* if shape is image */ var shape_type = pJS.particles.shape.type; if(typeof(shape_type) == 'object'){ if(shape_type instanceof Array){ var shape_selected = shape_type[Math.floor(Math.random() * shape_type.length)]; this.shape = shape_selected; } }else{ this.shape = shape_type; } if(this.shape == 'image'){ var sh = pJS.particles.shape; this.img = { src: sh.image.src, ratio: sh.image.width / sh.image.height } if(!this.img.ratio) this.img.ratio = 1; if(pJS.tmp.img_type == 'svg' && pJS.tmp.source_svg != undefined){ pJS.fn.vendors.createSvgImg(this); if(pJS.tmp.pushing){ this.img.loaded = false; } } } }; pJS.fn.particle.prototype.draw = function() { var p = this; if(p.radius_bubble != undefined){ var radius = p.radius_bubble; }else{ var radius = p.radius; } if(p.opacity_bubble != undefined){ var opacity = p.opacity_bubble; }else{ var opacity = p.opacity; } if(p.color.rgb){ var color_value = 'rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+opacity+')'; }else{ var color_value = 'hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+opacity+')'; } pJS.canvas.ctx.fillStyle = color_value; pJS.canvas.ctx.beginPath(); switch(p.shape){ case 'circle': pJS.canvas.ctx.arc(p.x, p.y, radius, 0, Math.PI * 2, false); break; case 'edge': pJS.canvas.ctx.rect(p.x-radius, p.y-radius, radius*2, radius*2); break; case 'triangle': pJS.fn.vendors.drawShape(pJS.canvas.ctx, p.x-radius, p.y+radius / 1.66, radius*2, 3, 2); break; case 'polygon': pJS.fn.vendors.drawShape( pJS.canvas.ctx, p.x - radius / (pJS.particles.shape.polygon.nb_sides/3.5), // startX p.y - radius / (2.66/3.5), // startY radius*2.66 / (pJS.particles.shape.polygon.nb_sides/3), // sideLength pJS.particles.shape.polygon.nb_sides, // sideCountNumerator 1 // sideCountDenominator ); break; case 'star': pJS.fn.vendors.drawShape( pJS.canvas.ctx, p.x - radius*2 / (pJS.particles.shape.polygon.nb_sides/4), // startX p.y - radius / (2*2.66/3.5), // startY radius*2*2.66 / (pJS.particles.shape.polygon.nb_sides/3), // sideLength pJS.particles.shape.polygon.nb_sides, // sideCountNumerator 2 // sideCountDenominator ); break; case 'image': function draw(){ pJS.canvas.ctx.drawImage( img_obj, p.x-radius, p.y-radius, radius*2, radius*2 / p.img.ratio ); } if(pJS.tmp.img_type == 'svg'){ var img_obj = p.img.obj; }else{ var img_obj = pJS.tmp.img_obj; } if(img_obj){ draw(); } break; } pJS.canvas.ctx.closePath(); if(pJS.particles.shape.stroke.width > 0){ pJS.canvas.ctx.strokeStyle = pJS.particles.shape.stroke.color; pJS.canvas.ctx.lineWidth = pJS.particles.shape.stroke.width; pJS.canvas.ctx.stroke(); } pJS.canvas.ctx.fill(); }; pJS.fn.particlesCreate = function(){ for(var i = 0; i < pJS.particles.number.value; i++) { pJS.particles.array.push(new pJS.fn.particle(pJS.particles.color, pJS.particles.opacity.value)); } }; pJS.fn.particlesUpdate = function(){ for(var i = 0; i < pJS.particles.array.length; i++){ /* the particle */ var p = pJS.particles.array[i]; // var d = ( dx = pJS.interactivity.mouse.click_pos_x - p.x ) * dx + ( dy = pJS.interactivity.mouse.click_pos_y - p.y ) * dy; // var f = -BANG_SIZE / d; // if ( d < BANG_SIZE ) { // var t = Math.atan2( dy, dx ); // p.vx = f * Math.cos(t); // p.vy = f * Math.sin(t); // } /* move the particle */ if(pJS.particles.move.enable){ var ms = pJS.particles.move.speed/2; p.x += p.vx * ms; p.y += p.vy * ms; } /* change opacity status */ if(pJS.particles.opacity.anim.enable) { if(p.opacity_status == true) { if(p.opacity >= pJS.particles.opacity.value) p.opacity_status = false; p.opacity += p.vo; }else { if(p.opacity <= pJS.particles.opacity.anim.opacity_min) p.opacity_status = true; p.opacity -= p.vo; } if(p.opacity < 0) p.opacity = 0; } /* change size */ if(pJS.particles.size.anim.enable){ if(p.size_status == true){ if(p.radius >= pJS.particles.size.value) p.size_status = false; p.radius += p.vs; }else{ if(p.radius <= pJS.particles.size.anim.size_min) p.size_status = true; p.radius -= p.vs; } if(p.radius < 0) p.radius = 0; } /* change particle position if it is out of canvas */ if(pJS.particles.move.out_mode == 'bounce'){ var new_pos = { x_left: p.radius, x_right: pJS.canvas.w, y_top: p.radius, y_bottom: pJS.canvas.h } }else{ var new_pos = { x_left: -p.radius, x_right: pJS.canvas.w + p.radius, y_top: -p.radius, y_bottom: pJS.canvas.h + p.radius } } if(p.x - p.radius > pJS.canvas.w){ p.x = new_pos.x_left; p.y = Math.random() * pJS.canvas.h; } else if(p.x + p.radius < 0){ p.x = new_pos.x_right; p.y = Math.random() * pJS.canvas.h; } if(p.y - p.radius > pJS.canvas.h){ p.y = new_pos.y_top; p.x = Math.random() * pJS.canvas.w; } else if(p.y + p.radius < 0){ p.y = new_pos.y_bottom; p.x = Math.random() * pJS.canvas.w; } /* out of canvas modes */ switch(pJS.particles.move.out_mode){ case 'bounce': if (p.x + p.radius > pJS.canvas.w) p.vx = -p.vx; else if (p.x - p.radius < 0) p.vx = -p.vx; if (p.y + p.radius > pJS.canvas.h) p.vy = -p.vy; else if (p.y - p.radius < 0) p.vy = -p.vy; break; } /* events */ if(isInArray('grab', pJS.interactivity.events.onhover.mode)){ pJS.fn.modes.grabParticle(p); } if(isInArray('bubble', pJS.interactivity.events.onhover.mode) || isInArray('bubble', pJS.interactivity.events.onclick.mode)){ pJS.fn.modes.bubbleParticle(p); } if(isInArray('repulse', pJS.interactivity.events.onhover.mode) || isInArray('repulse', pJS.interactivity.events.onclick.mode)){ pJS.fn.modes.repulseParticle(p); } /* interaction auto between particles */ if(pJS.particles.line_linked.enable || pJS.particles.move.attract.enable){ for(var j = i + 1; j < pJS.particles.array.length; j++){ var p2 = pJS.particles.array[j]; /* link particles */ if(pJS.particles.line_linked.enable){ pJS.fn.interact.linkParticles(p,p2); } /* attract particles */ if(pJS.particles.move.attract.enable){ pJS.fn.interact.attractParticles(p,p2); } /* bounce particles */ if(pJS.particles.move.bounce){ pJS.fn.interact.bounceParticles(p,p2); } } } } }; pJS.fn.particlesDraw = function(){ /* clear canvas */ pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h); /* update each particles param */ pJS.fn.particlesUpdate(); /* draw each particle */ for(var i = 0; i < pJS.particles.array.length; i++){ var p = pJS.particles.array[i]; p.draw(); } }; pJS.fn.particlesEmpty = function(){ pJS.particles.array = []; }; pJS.fn.particlesRefresh = function(){ /* init all */ cancelRequestAnimFrame(pJS.fn.checkAnimFrame); cancelRequestAnimFrame(pJS.fn.drawAnimFrame); pJS.tmp.source_svg = undefined; pJS.tmp.img_obj = undefined; pJS.tmp.count_svg = 0; pJS.fn.particlesEmpty(); pJS.fn.canvasClear(); /* restart */ pJS.fn.vendors.start(); }; /* ---------- pJS functions - particles interaction ------------ */ pJS.fn.interact.linkParticles = function(p1, p2){ var dx = p1.x - p2.x, dy = p1.y - p2.y, dist = Math.sqrt(dx*dx + dy*dy); /* draw a line between p1 and p2 if the distance between them is under the config distance */ if(dist <= pJS.particles.line_linked.distance){ var opacity_line = pJS.particles.line_linked.opacity - (dist / (1/pJS.particles.line_linked.opacity)) / pJS.particles.line_linked.distance; if(opacity_line > 0){ /* style */ var color_line = pJS.particles.line_linked.color_rgb_line; pJS.canvas.ctx.strokeStyle = 'rgba('+color_line.r+','+color_line.g+','+color_line.b+','+opacity_line+')'; pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width; //pJS.canvas.ctx.lineCap = 'round'; /* performance issue */ /* path */ pJS.canvas.ctx.beginPath(); pJS.canvas.ctx.moveTo(p1.x, p1.y); pJS.canvas.ctx.lineTo(p2.x, p2.y); pJS.canvas.ctx.stroke(); pJS.canvas.ctx.closePath(); } } }; pJS.fn.interact.attractParticles = function(p1, p2){ /* condensed particles */ var dx = p1.x - p2.x, dy = p1.y - p2.y, dist = Math.sqrt(dx*dx + dy*dy); if(dist <= pJS.particles.line_linked.distance){ var ax = dx/(pJS.particles.move.attract.rotateX*1000), ay = dy/(pJS.particles.move.attract.rotateY*1000); p1.vx -= ax; p1.vy -= ay; p2.vx += ax; p2.vy += ay; } } pJS.fn.interact.bounceParticles = function(p1, p2){ var dx = p1.x - p2.x, dy = p1.y - p2.y, dist = Math.sqrt(dx*dx + dy*dy), dist_p = p1.radius+p2.radius; if(dist <= dist_p){ p1.vx = -p1.vx; p1.vy = -p1.vy; p2.vx = -p2.vx; p2.vy = -p2.vy; } } /* ---------- pJS functions - modes events ------------ */ pJS.fn.modes.pushParticles = function(nb, pos){ pJS.tmp.pushing = true; for(var i = 0; i < nb; i++){ pJS.particles.array.push( new pJS.fn.particle( pJS.particles.color, pJS.particles.opacity.value, { 'x': pos ? pos.pos_x : Math.random() * pJS.canvas.w, 'y': pos ? pos.pos_y : Math.random() * pJS.canvas.h } ) ) if(i == nb-1){ if(!pJS.particles.move.enable){ pJS.fn.particlesDraw(); } pJS.tmp.pushing = false; } } }; pJS.fn.modes.removeParticles = function(nb){ pJS.particles.array.splice(0, nb); if(!pJS.particles.move.enable){ pJS.fn.particlesDraw(); } }; pJS.fn.modes.bubbleParticle = function(p){ /* on hover event */ if(pJS.interactivity.events.onhover.enable && isInArray('bubble', pJS.interactivity.events.onhover.mode)){ var dx_mouse = p.x - pJS.interactivity.mouse.pos_x, dy_mouse = p.y - pJS.interactivity.mouse.pos_y, dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse), ratio = 1 - dist_mouse / pJS.interactivity.modes.bubble.distance; function init(){ p.opacity_bubble = p.opacity; p.radius_bubble = p.radius; } /* mousemove - check ratio */ if(dist_mouse <= pJS.interactivity.modes.bubble.distance){ if(ratio >= 0 && pJS.interactivity.status == 'mousemove'){ /* size */ if(pJS.interactivity.modes.bubble.size != pJS.particles.size.value){ if(pJS.interactivity.modes.bubble.size > pJS.particles.size.value){ var size = p.radius + (pJS.interactivity.modes.bubble.size*ratio); if(size >= 0){ p.radius_bubble = size; } }else{ var dif = p.radius - pJS.interactivity.modes.bubble.size, size = p.radius - (dif*ratio); if(size > 0){ p.radius_bubble = size; }else{ p.radius_bubble = 0; } } } /* opacity */ if(pJS.interactivity.modes.bubble.opacity != pJS.particles.opacity.value){ if(pJS.interactivity.modes.bubble.opacity > pJS.particles.opacity.value){ var opacity = pJS.interactivity.modes.bubble.opacity*ratio; if(opacity > p.opacity && opacity <= pJS.interactivity.modes.bubble.opacity){ p.opacity_bubble = opacity; } }else{ var opacity = p.opacity - (pJS.particles.opacity.value-pJS.interactivity.modes.bubble.opacity)*ratio; if(opacity < p.opacity && opacity >= pJS.interactivity.modes.bubble.opacity){ p.opacity_bubble = opacity; } } } } }else{ init(); } /* mouseleave */ if(pJS.interactivity.status == 'mouseleave'){ init(); } } /* on click event */ else if(pJS.interactivity.events.onclick.enable && isInArray('bubble', pJS.interactivity.events.onclick.mode)){ if(pJS.tmp.bubble_clicking){ var dx_mouse = p.x - pJS.interactivity.mouse.click_pos_x, dy_mouse = p.y - pJS.interactivity.mouse.click_pos_y, dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse), time_spent = (new Date().getTime() - pJS.interactivity.mouse.click_time)/1000; if(time_spent > pJS.interactivity.modes.bubble.duration){ pJS.tmp.bubble_duration_end = true; } if(time_spent > pJS.interactivity.modes.bubble.duration*2){ pJS.tmp.bubble_clicking = false; pJS.tmp.bubble_duration_end = false; } } function process(bubble_param, particles_param, p_obj_bubble, p_obj, id){ if(bubble_param != particles_param){ if(!pJS.tmp.bubble_duration_end){ if(dist_mouse <= pJS.interactivity.modes.bubble.distance){ if(p_obj_bubble != undefined) var obj = p_obj_bubble; else var obj = p_obj; if(obj != bubble_param){ var value = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration); if(id == 'size') p.radius_bubble = value; if(id == 'opacity') p.opacity_bubble = value; } }else{ if(id == 'size') p.radius_bubble = undefined; if(id == 'opacity') p.opacity_bubble = undefined; } }else{ if(p_obj_bubble != undefined){ var value_tmp = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration), dif = bubble_param - value_tmp; value = bubble_param + dif; if(id == 'size') p.radius_bubble = value; if(id == 'opacity') p.opacity_bubble = value; } } } } if(pJS.tmp.bubble_clicking){ /* size */ process(pJS.interactivity.modes.bubble.size, pJS.particles.size.value, p.radius_bubble, p.radius, 'size'); /* opacity */ process(pJS.interactivity.modes.bubble.opacity, pJS.particles.opacity.value, p.opacity_bubble, p.opacity, 'opacity'); } } }; pJS.fn.modes.repulseParticle = function(p){ if(pJS.interactivity.events.onhover.enable && isInArray('repulse', pJS.interactivity.events.onhover.mode) && pJS.interactivity.status == 'mousemove') { var dx_mouse = p.x - pJS.interactivity.mouse.pos_x, dy_mouse = p.y - pJS.interactivity.mouse.pos_y, dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse); var normVec = {x: dx_mouse/dist_mouse, y: dy_mouse/dist_mouse}, repulseRadius = pJS.interactivity.modes.repulse.distance, velocity = 100, repulseFactor = clamp((1/repulseRadius)*(-1*Math.pow(dist_mouse/repulseRadius,2)+1)*repulseRadius*velocity, 0, 50); var pos = { x: p.x + normVec.x * repulseFactor, y: p.y + normVec.y * repulseFactor } if(pJS.particles.move.out_mode == 'bounce'){ if(pos.x - p.radius > 0 && pos.x + p.radius < pJS.canvas.w) p.x = pos.x; if(pos.y - p.radius > 0 && pos.y + p.radius < pJS.canvas.h) p.y = pos.y; }else{ p.x = pos.x; p.y = pos.y; } } else if(pJS.interactivity.events.onclick.enable && isInArray('repulse', pJS.interactivity.events.onclick.mode)) { if(!pJS.tmp.repulse_finish){ pJS.tmp.repulse_count++; if(pJS.tmp.repulse_count == pJS.particles.array.length){ pJS.tmp.repulse_finish = true; } } if(pJS.tmp.repulse_clicking){ var repulseRadius = Math.pow(pJS.interactivity.modes.repulse.distance/6, 3); var dx = pJS.interactivity.mouse.click_pos_x - p.x, dy = pJS.interactivity.mouse.click_pos_y - p.y, d = dx*dx + dy*dy; var force = -repulseRadius / d * 1; function process(){ var f = Math.atan2(dy,dx); p.vx = force * Math.cos(f); p.vy = force * Math.sin(f); if(pJS.particles.move.out_mode == 'bounce'){ var pos = { x: p.x + p.vx, y: p.y + p.vy } if (pos.x + p.radius > pJS.canvas.w) p.vx = -p.vx; else if (pos.x - p.radius < 0) p.vx = -p.vx; if (pos.y + p.radius > pJS.canvas.h) p.vy = -p.vy; else if (pos.y - p.radius < 0) p.vy = -p.vy; } } // default if(d <= repulseRadius){ process(); } // bang - slow motion mode // if(!pJS.tmp.repulse_finish){ // if(d <= repulseRadius){ // process(); // } // }else{ // process(); // } }else{ if(pJS.tmp.repulse_clicking == false){ p.vx = p.vx_i; p.vy = p.vy_i; } } } } pJS.fn.modes.grabParticle = function(p){ if(pJS.interactivity.events.onhover.enable && pJS.interactivity.status == 'mousemove'){ var dx_mouse = p.x - pJS.interactivity.mouse.pos_x, dy_mouse = p.y - pJS.interactivity.mouse.pos_y, dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse); /* draw a line between the cursor and the particle if the distance between them is under the config distance */ if(dist_mouse <= pJS.interactivity.modes.grab.distance){ var opacity_line = pJS.interactivity.modes.grab.line_linked.opacity - (dist_mouse / (1/pJS.interactivity.modes.grab.line_linked.opacity)) / pJS.interactivity.modes.grab.distance; if(opacity_line > 0){ /* style */ var color_line = pJS.particles.line_linked.color_rgb_line; pJS.canvas.ctx.strokeStyle = 'rgba('+color_line.r+','+color_line.g+','+color_line.b+','+opacity_line+')'; pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width; //pJS.canvas.ctx.lineCap = 'round'; /* performance issue */ /* path */ pJS.canvas.ctx.beginPath(); pJS.canvas.ctx.moveTo(p.x, p.y); pJS.canvas.ctx.lineTo(pJS.interactivity.mouse.pos_x, pJS.interactivity.mouse.pos_y); pJS.canvas.ctx.stroke(); pJS.canvas.ctx.closePath(); } } } }; /* ---------- pJS functions - vendors ------------ */ pJS.fn.vendors.eventsListeners = function(){ /* events target element */ if(pJS.interactivity.detect_on == 'window'){ pJS.interactivity.el = window; }else{ pJS.interactivity.el = pJS.canvas.el; } /* detect mouse pos - on hover / click event */ if(pJS.interactivity.events.onhover.enable || pJS.interactivity.events.onclick.enable){ /* el on mousemove */ pJS.interactivity.el.addEventListener('mousemove', function(e){ if(pJS.interactivity.el == window){ var pos_x = e.clientX, pos_y = e.clientY; } else{ var pos_x = e.offsetX || e.clientX, pos_y = e.offsetY || e.clientY; } pJS.interactivity.mouse.pos_x = pos_x; pJS.interactivity.mouse.pos_y = pos_y; if(pJS.tmp.retina){ pJS.interactivity.mouse.pos_x *= pJS.canvas.pxratio; pJS.interactivity.mouse.pos_y *= pJS.canvas.pxratio; } pJS.interactivity.status = 'mousemove'; }); /* el on onmouseleave */ pJS.interactivity.el.addEventListener('mouseleave', function(e){ pJS.interactivity.mouse.pos_x = null; pJS.interactivity.mouse.pos_y = null; pJS.interactivity.status = 'mouseleave'; }); } /* on click event */ if(pJS.interactivity.events.onclick.enable){ pJS.interactivity.el.addEventListener('click', function(){ pJS.interactivity.mouse.click_pos_x = pJS.interactivity.mouse.pos_x; pJS.interactivity.mouse.click_pos_y = pJS.interactivity.mouse.pos_y; pJS.interactivity.mouse.click_time = new Date().getTime(); if(pJS.interactivity.events.onclick.enable){ switch(pJS.interactivity.events.onclick.mode){ case 'push': if(pJS.particles.move.enable){ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse); }else{ if(pJS.interactivity.modes.push.particles_nb == 1){ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse); } else if(pJS.interactivity.modes.push.particles_nb > 1){ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb); } } break; case 'remove': pJS.fn.modes.removeParticles(pJS.interactivity.modes.remove.particles_nb); break; case 'bubble': pJS.tmp.bubble_clicking = true; break; case 'repulse': pJS.tmp.repulse_clicking = true; pJS.tmp.repulse_count = 0; pJS.tmp.repulse_finish = false; setTimeout(function(){ pJS.tmp.repulse_clicking = false; }, pJS.interactivity.modes.repulse.duration*1000) break; } } }); } }; pJS.fn.vendors.densityAutoParticles = function(){ if(pJS.particles.number.density.enable){ /* calc area */ var area = pJS.canvas.el.width * pJS.canvas.el.height / 1000; if(pJS.tmp.retina){ area = area/(pJS.canvas.pxratio*2); } /* calc number of particles based on density area */ var nb_particles = area * pJS.particles.number.value / pJS.particles.number.density.value_area; /* add or remove X particles */ var missing_particles = pJS.particles.array.length - nb_particles; if(missing_particles < 0) pJS.fn.modes.pushParticles(Math.abs(missing_particles)); else pJS.fn.modes.removeParticles(missing_particles); } }; pJS.fn.vendors.checkOverlap = function(p1, position){ for(var i = 0; i < pJS.particles.array.length; i++){ var p2 = pJS.particles.array[i]; var dx = p1.x - p2.x, dy = p1.y - p2.y, dist = Math.sqrt(dx*dx + dy*dy); if(dist <= p1.radius + p2.radius){ p1.x = position ? position.x : Math.random() * pJS.canvas.w; p1.y = position ? position.y : Math.random() * pJS.canvas.h; pJS.fn.vendors.checkOverlap(p1); } } }; pJS.fn.vendors.createSvgImg = function(p){ /* set color to svg element */ var svgXml = pJS.tmp.source_svg, rgbHex = /#([0-9A-F]{3,6})/gi, coloredSvgXml = svgXml.replace(rgbHex, function (m, r, g, b) { if(p.color.rgb){ var color_value = 'rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+p.opacity+')'; }else{ var color_value = 'hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+p.opacity+')'; } return color_value; }); /* prepare to create img with colored svg */ var svg = new Blob([coloredSvgXml], {type: 'image/svg+xml;charset=utf-8'}), DOMURL = window.URL || window.webkitURL || window, url = DOMURL.createObjectURL(svg); /* create particle img obj */ var img = new Image(); img.addEventListener('load', function(){ p.img.obj = img; p.img.loaded = true; DOMURL.revokeObjectURL(url); pJS.tmp.count_svg++; }); img.src = url; }; pJS.fn.vendors.destroypJS = function(){ cancelAnimationFrame(pJS.fn.drawAnimFrame); canvas_el.remove(); pJSDom = null; }; pJS.fn.vendors.drawShape = function(c, startX, startY, sideLength, sideCountNumerator, sideCountDenominator){ // By Programming Thomas - https://programmingthomas.wordpress.com/2013/04/03/n-sided-shapes/ var sideCount = sideCountNumerator * sideCountDenominator; var decimalSides = sideCountNumerator / sideCountDenominator; var interiorAngleDegrees = (180 * (decimalSides - 2)) / decimalSides; var interiorAngle = Math.PI - Math.PI * interiorAngleDegrees / 180; // convert to radians c.save(); c.beginPath(); c.translate(startX, startY); c.moveTo(0,0); for (var i = 0; i < sideCount; i++) { c.lineTo(sideLength,0); c.translate(sideLength,0); c.rotate(interiorAngle); } //c.stroke(); c.fill(); c.restore(); }; pJS.fn.vendors.exportImg = function(){ window.open(pJS.canvas.el.toDataURL('image/png'), '_blank'); }; pJS.fn.vendors.loadImg = function(type){ pJS.tmp.img_error = undefined; if(pJS.particles.shape.image.src != ''){ if(type == 'svg'){ var xhr = new XMLHttpRequest(); xhr.open('GET', pJS.particles.shape.image.src); xhr.onreadystatechange = function (data) { if(xhr.readyState == 4){ if(xhr.status == 200){ pJS.tmp.source_svg = data.currentTarget.response; pJS.fn.vendors.checkBeforeDraw(); }else{ console.log('Error pJS - Image not found'); pJS.tmp.img_error = true; } } } xhr.send(); }else{ var img = new Image(); img.addEventListener('load', function(){ pJS.tmp.img_obj = img; pJS.fn.vendors.checkBeforeDraw(); }); img.src = pJS.particles.shape.image.src; } }else{ console.log('Error pJS - No image.src'); pJS.tmp.img_error = true; } }; pJS.fn.vendors.draw = function(){ if(pJS.particles.shape.type == 'image'){ if(pJS.tmp.img_type == 'svg'){ if(pJS.tmp.count_svg >= pJS.particles.number.value){ pJS.fn.particlesDraw(); if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame); else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw); }else{ //console.log('still loading...'); if(!pJS.tmp.img_error) pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw); } }else{ if(pJS.tmp.img_obj != undefined){ pJS.fn.particlesDraw(); if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame); else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw); }else{ if(!pJS.tmp.img_error) pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw); } } }else{ pJS.fn.particlesDraw(); if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame); else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw); } }; pJS.fn.vendors.checkBeforeDraw = function(){ // if shape is image if(pJS.particles.shape.type == 'image'){ if(pJS.tmp.img_type == 'svg' && pJS.tmp.source_svg == undefined){ pJS.tmp.checkAnimFrame = requestAnimFrame(check); }else{ //console.log('images loaded! cancel check'); cancelRequestAnimFrame(pJS.tmp.checkAnimFrame); if(!pJS.tmp.img_error){ pJS.fn.vendors.init(); pJS.fn.vendors.draw(); } } }else{ pJS.fn.vendors.init(); pJS.fn.vendors.draw(); } }; pJS.fn.vendors.init = function(){ /* init canvas + particles */ pJS.fn.retinaInit(); pJS.fn.canvasInit(); pJS.fn.canvasSize(); pJS.fn.canvasPaint(); pJS.fn.particlesCreate(); pJS.fn.vendors.densityAutoParticles(); /* particles.line_linked - convert hex colors to rgb */ pJS.particles.line_linked.color_rgb_line = hexToRgb(pJS.particles.line_linked.color); }; pJS.fn.vendors.start = function(){ if(isInArray('image', pJS.particles.shape.type)){ pJS.tmp.img_type = pJS.particles.shape.image.src.substr(pJS.particles.shape.image.src.length - 3); pJS.fn.vendors.loadImg(pJS.tmp.img_type); }else{ pJS.fn.vendors.checkBeforeDraw(); } }; /* ---------- pJS - start ------------ */ pJS.fn.vendors.eventsListeners(); pJS.fn.vendors.start(); }; /* ---------- global functions - vendors ------------ */ Object.deepExtend = function(destination, source) { for (var property in source) { if (source[property] && source[property].constructor && source[property].constructor === Object) { destination[property] = destination[property] || {}; arguments.callee(destination[property], source[property]); } else { destination[property] = source[property]; } } return destination; }; window.requestAnimFrame = (function(){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback){ window.setTimeout(callback, 1000 / 60); }; })(); window.cancelRequestAnimFrame = ( function() { return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout } )(); function hexToRgb(hex){ // By Tim Down - http://stackoverflow.com/a/5624139/3493650 // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; hex = hex.replace(shorthandRegex, function(m, r, g, b) { return r + r + g + g + b + b; }); var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; }; function clamp(number, min, max) { return Math.min(Math.max(number, min), max); }; function isInArray(value, array) { return array.indexOf(value) > -1; } /* ---------- particles.js functions - start ------------ */ window.pJSDom = []; window.particlesJS = function(tag_id, params){ //console.log(params); /* no string id? so it's object params, and set the id with default id */ if(typeof(tag_id) != 'string'){ params = tag_id; tag_id = 'particles-js'; } /* no id? set the id to default id */ if(!tag_id){ tag_id = 'particles-js'; } /* pJS elements */ var pJS_tag = document.getElementById(tag_id), pJS_canvas_class = 'particles-js-canvas-el', exist_canvas = pJS_tag.getElementsByClassName(pJS_canvas_class); /* remove canvas if exists into the pJS target tag */ if(exist_canvas.length){ while(exist_canvas.length > 0){ pJS_tag.removeChild(exist_canvas[0]); } } /* create canvas element */ var canvas_el = document.createElement('canvas'); canvas_el.className = pJS_canvas_class; /* set size canvas */ canvas_el.style.width = "100%"; canvas_el.style.height = "100%"; /* append canvas */ var canvas = document.getElementById(tag_id).appendChild(canvas_el); /* launch particle.js */ if(canvas != null){ pJSDom.push(new pJS(tag_id, params)); } }; window.particlesJS.load = function(tag_id, path_config_json, callback){ /* load json config */ var xhr = new XMLHttpRequest(); xhr.open('GET', path_config_json); xhr.onreadystatechange = function (data) { if(xhr.readyState == 4){ if(xhr.status == 200){ var params = JSON.parse(data.currentTarget.response); window.particlesJS(tag_id, params); if(callback) callback(); }else{ console.log('Error pJS - XMLHttpRequest status: '+xhr.status); console.log('Error pJS - File config not found'); } } }; xhr.send(); };
"shape": { "type": "circle", "stroke": { "width": 0,
server_20211126171609.js
const express = require('express') const app = express() const PORT = 8888 const bodyParser = require('body-parser') const cors = require('cors') const fs = require('fs') const nodemailer = require('nodemailer') const { google } = require('googleapis') const OAuth2 = google.auth.OAuth2 const config = require('./config.js') require('dotenv').config() const OAuth2Client = new OAuth2(process.env.CLIENT_ID, process.env.CLIENT_SECRET) OAuth2Client.setCredentials({ refresh_token: process.env.REFRESH_TOKEN }) app.use(bodyParser.json()) app.use(bodyParser.urlencoded({ extended: true })) app.use(cors()) app.use(express.json()) app.get('/apiMail', (req, res) => { res.status(200).send({ datapoint1: "🍌", message: "What you wanna GET GET GET???", sent: true }) }) app.post('/apiMail', (req, res) => { const { id } = req.body const { name } = req.body const { lastName } = req.body const { email } = req.body const { phone } = req.body const { message } = req.body // SAVE POST TO DATABASE const db = 'db.json' if (!name && !lastName && !email && !phone && !message) { res.status(418).send({ message: 'no complex form data has been sent!' }) } console.log(`Form with id of: ${id} has been submitted.`) let resObj = { id: `${id}`, Name: ` 🍌 ${name}`, LastName: ` 🍕 ${lastName}`, Email: ` 💌${email}`, Phone: ` 📞 ${phone}`, Message: ` 📑 ${message}`, } let sendData = JSON.stringify(resObj) res.send(sendData) (() => { // SEND POST IN EMAIL console.log('from the sendMail function') const accessToken = OAuth2Client.getAccessToken() let transport = nodemailer.createTransport({ service: 'gmail', // name: '127.0.0.1', host: 'smtp.gmail.com', port:587, logger: true, debug: true, tls: { rejectUnauthorized: false }, // auth: { // type: 'OAuth2', // user: process.env.USER, // clientId: process.env.CLIENT_ID, // clientSecret: process.env.CLIENT_SECRET, // refreshToken: process.env.REFRESH_TOKEN, // accessToken: accessToken // }, auth: { user:process.env.USER, pass:process.env.PASS, }, }) let mailOptions = { from: `${email}`, to: '[email protected]', subject: `Message from ${name}`, html: ` <h3>Informations</h3> <ul> <li>Name: ${name}</li> <li>Email: ${email}</li> <li>Phone: ${phone}</li> </ul> <h3>Message:</h3> <br> <p> ${message} </p> ` } // let mailOptions = { // from: `GPO Auto <${config.user}>`, // to: '[email protected]', // subject: 'Message Testing miii', // html: `<h3>szia ${nev}</h3>` // } transport.sendMail(mailOptions, function (error, result) { if (error) { console.log('Error happened: ', error) } else { console.log('Success: ', result) } transport.close() }) })() // pushEmail() function fs.readFile(db, (err, data) => { if (err) throw err if (data.length == 0) { fs.appendFile(db, '[' + sendData + ',', err => { if (err) throw err; console.log('File successfully written to empty database.') }) } else { fs.appendFile(db, sendData + ',', err => { if (err) throw err; console.log('File successfully written to database.') })
} }) }) app.listen( PORT, () => console.log(`it's alive on http:localhost:${PORT}`) )
doctor.go
package doctor import ( "fmt" "github.com/spf13/cobra" "goharvest2/pkg/color" "goharvest2/pkg/conf" "goharvest2/pkg/tree" harvestyaml "goharvest2/pkg/tree/yaml" "gopkg.in/yaml.v3" "io/ioutil" "os" "strings" ) type options struct { ShouldPrintConfig bool Color string BaseTemplate string MergeTemplate string zapiDataCenterName string restDataCenterName string } var opts = &options{ ShouldPrintConfig: false, Color: "auto", } type validation struct { isValid bool invalid []string // collect invalid results } var Cmd = &cobra.Command{ Use: "doctor", Short: "Check for potential problems", Long: "Check for potential problems", Run: doDoctorCmd, } var mergeCmd = &cobra.Command{ Use: "merge", Hidden: true, Short: "merge templates", Run: doMergeCmd, } var diffZapiRestCmd = &cobra.Command{ Use: "diffzapirest", Hidden: true, Short: "diff between Zapi and Rest metrics", Run: doDiffRestZapiCmd, } func doDiffRestZapiCmd(_ *cobra.Command, _ []string) { DoDiffRestZapi(opts.zapiDataCenterName, opts.restDataCenterName) } func doMergeCmd(_ *cobra.Command, _ []string) { doMerge(opts.BaseTemplate, opts.MergeTemplate) } func doMerge(path1 string, path2 string) { template, err := tree.ImportYaml(path1) if err != nil { fmt.Printf("error reading template file [%s]. err=%+v\n", path1, err) return } subTemplate, err := tree.ImportYaml(path2) if err != nil { fmt.Printf("error reading template file [%s] err=%+v\n", path2, err) return } template.PreprocessTemplate() subTemplate.PreprocessTemplate() template.Merge(subTemplate, nil) data, err := harvestyaml.Dump(template) if err != nil { fmt.Printf("error reading parsing template file [%s] err=%+v\n", data, err) return } fmt.Println(string(data)) } func doDoctorCmd(cmd *cobra.Command, _ []string) { var config = cmd.Root().PersistentFlags().Lookup("config") doDoctor(conf.ConfigPath(config.Value.String())) } func doDoctor(path string) { contents, err := ioutil.ReadFile(path) if err != nil { fmt.Printf("error reading config file. err=%+v\n", err) return } if opts.ShouldPrintConfig { printRedactedConfig(path, contents) } checkAll(path, contents) } // checkAll runs all doctor checks // If all checks succeed, print nothing and exit with a return code of 0 // Otherwise, print what failed and exit with a return code of 1 func checkAll(path string, contents []byte) { // See https://github.com/NetApp/harvest/issues/16 for more checks to add color.DetectConsole(opts.Color) // Validate that the config file can be parsed harvestConfig := &conf.HarvestConfig{} err := yaml.Unmarshal(contents, harvestConfig) if err != nil { fmt.Printf("error reading config file=[%s] %+v\n", path, err) os.Exit(1) return } anyFailed := false anyFailed = !checkUniquePromPorts(*harvestConfig).isValid || anyFailed anyFailed = !checkPollersExportToUniquePromPorts(*harvestConfig).isValid || anyFailed anyFailed = !checkExporterTypes(*harvestConfig).isValid || anyFailed if anyFailed { os.Exit(1) } else { os.Exit(0) } } // checkExporterTypes validates that all exporters are of valid types func checkExporterTypes(config conf.HarvestConfig) validation { if config.Exporters == nil { return validation{} } invalidTypes := make(map[string]string) for name, exporter := range config.Exporters { if exporter.Type == "" { continue } switch exporter.Type { case "Prometheus", "InfluxDB": break default: invalidTypes[name] = exporter.Type } } valid := validation{isValid: true} if len(invalidTypes) > 0 { valid.isValid = false fmt.Printf("%s Unknown Exporter types found\n", color.Colorize("Error:", color.Red)) fmt.Println("These are probably misspellings or the wrong case.") fmt.Println("Exporter types must start with a capital letter.") fmt.Println("The following exporters are unknown:") for name, eType := range invalidTypes { valid.invalid = append(valid.invalid, eType) fmt.Printf(" exporter named: [%s] has unknown type: [%s]\n", color.Colorize(name, color.Red), color.Colorize(eType, color.Yellow)) } fmt.Println() } return valid } // checkUniquePromPorts checks that all Prometheus exporters // that specify a port, do so uniquely func checkUniquePromPorts(config conf.HarvestConfig) validation { if config.Exporters == nil { return validation{} } // Add all exporters that have a port to a // map of portNum -> list of names seen := make(map[int][]string) for name, exporter := range config.Exporters { // ignore configuration with both port and portrange defined. PortRange takes precedence if exporter.Port == nil || exporter.Type != "Prometheus" || exporter.PortRange != nil { continue } previous := seen[*exporter.Port] previous = append(previous, name) seen[*exporter.Port] = previous } // Update PortRanges for name, exporter := range config.Exporters { if exporter.PortRange == nil || exporter.Type != "Prometheus" { continue } portRange := exporter.PortRange start := portRange.Min end := portRange.Max for i := start; i <= end; i++ { previous := seen[i] previous = append(previous, name) seen[i] = previous } } valid := validation{isValid: true} for _, exporterNames := range seen { if len(exporterNames) == 1 { continue } valid.isValid = false for _, name := range exporterNames { valid.invalid = append(valid.invalid, name) } break } if !valid.isValid { fmt.Printf("%s: Exporter PromPort conflict\n", color.Colorize("Error", color.Red)) fmt.Println(" Prometheus exporters must specify unique ports. Change the following exporters to use unique ports:") for port, exporterNames := range seen { if len(exporterNames) == 1 { continue } names := strings.Join(exporterNames, ", ") fmt.Printf(" port: [%s] duplicateExporters: [%s]\n", color.Colorize(port, color.Red), color.Colorize(names, color.Yellow)) } fmt.Println() } return valid } // checkPollersExportToUniquePromPorts checks that all pollers that export // to a Prometheus exporter, do so to a unique promPort func checkPollersExportToUniquePromPorts(config conf.HarvestConfig) validation { if config.Exporters == nil { return validation{} } // Add all exporters that have a port to a // map of portNum -> list of names seen := make(map[int][]string) for name, exporter := range config.Exporters { // ignore configuration with both port and portrange defined. PortRange takes precedence if exporter.Port == nil || exporter.Type != "Prometheus" || exporter.PortRange != nil { continue } previous := seen[*exporter.Port] previous = append(previous, name) seen[*exporter.Port] = previous } // Look for pollers that export to the same Prometheus exporter that is not a port range exporter pollerExportsTo := make(map[string][]string) for name, poller := range config.Pollers { if poller.Exporters == nil { continue } for _, exporterName := range poller.Exporters { exporter, ok := config.Exporters[exporterName] if !ok { continue } if exporter.Type != "Prometheus" || exporter.Port == nil || exporter.PortRange != nil { continue } pollerExportsTo[exporterName] = append(pollerExportsTo[exporterName], name) } } valid := validation{isValid: true} for _, pollerNames := range pollerExportsTo { if len(pollerNames) == 1 { continue } valid.isValid = false for _, name := range pollerNames { valid.invalid = append(valid.invalid, name) } break } if !valid.isValid { fmt.Printf("%s: Multiple pollers export to the same PromPort\n", color.Colorize("Error", color.Red)) fmt.Println(" Each poller should export to a unique Prometheus exporter or use PortRange. Change the following pollers to use unique exporters:") for port, pollerNames := range pollerExportsTo { if len(pollerNames) == 1 { continue } names := strings.Join(pollerNames, ", ") fmt.Printf(" pollers [%s] export to the same static PrometheusExporter: [%s]\n", color.Colorize(names, color.Yellow), color.Colorize(port, color.Red)) } fmt.Println() } return valid } func printRedactedConfig(path string, contents []byte) string { root := &yaml.Node{} err := yaml.Unmarshal(contents, root) if err != nil { fmt.Printf("error reading config file=[%s] %+v\n", path, err) return "" } var nodes []*yaml.Node collectNodes(root, &nodes) sanitize(nodes) removeComments(root) marshaled, err := yaml.Marshal(root) if err != nil { fmt.Printf("error marshalling yaml sanitized from config file=[%s] %+v\n", path, err) return "" } result := string(marshaled) fmt.Println(result) return result } func sanitize(nodes []*yaml.Node) { // Update this list when there are additional tokens to sanitize sanitizeWords := []string{"username", "password", "grafana_api_token", "token", "host", "addr"} for i, node := range nodes { if node == nil { continue } if node.Kind == yaml.ScalarNode && node.ShortTag() == "!!str" {
continue } nodes[i+1].SetString("-REDACTED-") } } } removeComments(node) } } func removeComments(node *yaml.Node) { // Strip all comments since they may contain sensitive information node.HeadComment = "" node.LineComment = "" node.FootComment = "" } func collectNodes(root *yaml.Node, nodes *[]*yaml.Node) { for _, node := range root.Content { *nodes = append(*nodes, node) collectNodes(node, nodes) } } func init() { Cmd.AddCommand(mergeCmd) Cmd.AddCommand(diffZapiRestCmd) dFlags := diffZapiRestCmd.PersistentFlags() mFlags := mergeCmd.PersistentFlags() dFlags.StringVarP(&opts.zapiDataCenterName, "zapidatacenter", "", "", "Zapi Datacenter Name ") dFlags.StringVarP(&opts.restDataCenterName, "restdatacenter", "", "", "Rest Datacenter path. ") _ = diffZapiRestCmd.MarkPersistentFlagRequired("zapidatacenter") _ = diffZapiRestCmd.MarkPersistentFlagRequired("restdatacenter") mFlags.StringVarP(&opts.BaseTemplate, "template", "", "", "Base template path ") mFlags.StringVarP(&opts.MergeTemplate, "with", "", "", "Extended file path. ") _ = mergeCmd.MarkPersistentFlagRequired("template") _ = mergeCmd.MarkPersistentFlagRequired("with") Cmd.Flags().BoolVarP( &opts.ShouldPrintConfig, "print", "p", false, "print config to console with sensitive info redacted", ) Cmd.Flags().StringVar(&opts.Color, "color", "auto", "When to use colors. One of: auto | always | never. Auto will guess based on tty.") }
value := node.Value for _, word := range sanitizeWords { if value == word { if nodes[i-1].Value == "auth_style" {
api.py
import asyncio from datetime import datetime, timezone from functools import wraps import traceback import inspect import logging import ujson as json_module import hashlib import yaml from aiohttp import web import aiohttp import mongoengine import os from .engine.objects import Operation, Network, Domain, Log, ObservedHost, TechniqueMapping, Job, Rat, Host, \ ObservedRat, Adversary, CodedStep, ActiveConnection, Agent, AttackTechnique, AttackTactic, SiteUser, Setting, \ Opcodes, Artifactlist, ObservedFile, AttackList, JobException, ObservedSchtask, ObservedProcess, AttackGroup from .engine.objects import ObservedDomain, ObservedOSVersion, ObservedUser, ObservedShare, ObservedCredential, \ ObservedService, ObservedTimeDelta, ObservedRegKey, ObservedPersistence from . import authentication as auth from .engine.database import native_types from . import ddp from . import attack from . import util from . import interface from . import extern log = logging.getLogger(__name__) routes = [] def api(uri, methods, objects=None, get=None, auth_group=None, headers=None): """This is a decorator for web api endpoints Args: uri: The URI for the API, can contain keywords denoted by '{}' which indicate objects: a list of tuples methods: the list of HTTP methods this API accepts auth_group: the group that the token must be in for access to this API headers: A list of headers to return with the Response """ if objects is None: objects = {} if get is None: get = {} if auth_group is None: auth_group = [] if headers is None: headers = {} def decorator(f): @wraps(f) async def decorated(req, token, url_match): kwargs = {} # Map id to object for name, _class in objects.items(): if name in url_match: # If this fails and the request type is 'GET', # then an exception should be returned try: kwargs[name] = _class.objects.with_id(url_match[name]) if kwargs[name] is None: return web.HTTPBadRequest() except (mongoengine.errors.ValidationError, ): # The client has sent an invalid id in the URL return web.HTTPBadRequest() # Now set the default get parameters # For cases where we see args like ?arg1=value1&arg2&... # arg2 is set to '' # but change it to True instead trueified = {k: True if v == '' else v for k, v in req.GET.items()} for k, v in get.items(): kwargs[k] = trueified.get(k, v) sig = inspect.signature(f) if 'token' in sig.parameters: kwargs['token'] = token # Finally format the output as json (or jsonfm) results = await f(req, **kwargs) if isinstance(results, web.StreamResponse): return results else: json = json_module.dumps(native_types(results), sort_keys=True, indent=4) return web.Response(text=json, content_type='application/json', headers=headers) async def entrypoint(req): host = None try: # ensure this member is authorized token = auth.Token(req.cookies.get('AUTH')) l = [g for g in auth_group if token.in_group(g)] if len(l) == 0: raise auth.NotAuthorized() # active connections peername = req.transport.get_extra_info('peername') if peername is not None: host_ip, port = peername if req.host: local_ip = req.host.split(":")[0] if local_ip == "localhost": local_ip = "127.0.0.1" else: local_ip = "127.0.0.1" token_host = None if token.in_group('agent'): agent = Agent.objects.with_id(token.session_info['_id']) if agent is None: raise auth.NotAuthorized agent.modify(**{'alive': True}) token_host = agent.host host = ActiveConnection.objects(ip=host_ip, host=token_host, local_ip=local_ip).first() if host is None: host = ActiveConnection(ip=host_ip, host=token_host, local_ip=local_ip, connections=0).save() host.update(inc__connections=1) resp = await decorated(req, token, req.match_info) return resp except auth.NotAuthorized: return web.HTTPForbidden() except Exception: traceback.print_exc() results = {'error': 'exception in ' + f.__name__} output = json_module.dumps(results, sort_keys=True, indent=4) return web.HTTPInternalServerError(text=output, content_type='application/json') finally: if host: host.update(dec__connections=1) for method in methods: routes.append((method, uri, entrypoint)) return decorated return decorator def websocket(uri, auth_group=None): if auth_group is None: auth_group = [] def decorator(f): @wraps(f) async def entrypoint(req): try: # ensure this member is authorized token = auth.Token(req.cookies.get('AUTH')) l = [g for g in auth_group if token.in_group(g)] if len(l) == 0: raise auth.NotAuthorized() return await f(req) except auth.NotAuthorized: return web.HTTPForbidden() except Exception: traceback.print_exc() results = {'error': 'exception in ' + f.__name__} output = json_module.dumps(results, sort_keys=True, indent=4) return web.HTTPInternalServerError(text=output, content_type='application/json') routes.append(('GET', uri, entrypoint)) return entrypoint return decorator # Example usage: # GET /api/jobs # POST /api/jobs { 'action': 'install_service', 'host': 'mm198673-pc', ... } @api('/api/jobs', methods=['GET', 'POST'], get={'status': None, 'wait': False}, auth_group=['human', 'agent']) async def query_jobs(request, token, status, wait): if request.method == 'GET': query = {} if status: query['status'] = status if token.in_group('agent'): agent = Agent.objects.with_id(token.session_info['_id']) if not agent: raise auth.NotAuthorized() # are there any jobs for this agent? query.update({'agent': agent.id}) jobs = list(Job.objects(**query)) if not len(jobs) and wait is not False: # Now wait for jobs to be created try: jobs = [(await Job.wait_next(query))] except asyncio.CancelledError: return else: jobs = list(Job.objects(**query)) if not len(jobs) and wait is not False: jobs = [(await Job.wait_next(query))] return jobs elif request.method == 'POST': # only humans are allowed to create new jobs token.require_group('human') json = await request.json() return Job(**json).save().id # Example usage: # GET /api/jobs/<job> # POST /api/jobs/<job> { 'action': 'install_service', 'host': 'mm198673-pc', ... } @api('/api/jobs/{job}', methods=['GET', 'PUT', 'DELETE'], objects={'job': Job}, auth_group=['human', 'agent']) async def query_job(request, token, job): if request.method == 'GET': if token.in_group('agent'): # can only get jobs that are not completed and are for them if job['status'] in ("created", "pending") and str(job.agent.id) == token.session_info['_id']: return job else: raise auth.NotAuthorized() else: return job elif request.method == 'PUT': if token.in_group('agent'): # can only put jobs that are not completed and are for them if job.status in ("created", "pending") and str(job.agent.id) == token.session_info['_id']: json = await request.json() # whitelist legal fields if 'result' in json['action']: job['action']['result'] = json['action']['result'] if 'error' in json['action']: job['action']['error'] = json['action']['error'] if 'exception' in json['action']: job['action']['exception'] = json['action']['exception'] job['status'] = json.get('status', job.status) if job['status'] == "failed" and 'error' in job['action'] and job['action']['error'] == "no client": # Force update the clients list interface.get_clients(job.agent.host) # find the rat try: iv_name = job['action']["rats"]["args"][0] iv = Rat.objects(agent=job.agent, name=iv_name) iv.modify(**{'active': False}) except KeyError: log.warning("Could not find rat to remove for failed job") return job.save() else: raise auth.NotAuthorized() else: # human # Update the job json = await request.json() if json['create_time']: json['create_time'] = datetime.strptime(json['create_time'], "%Y-%m-%dT%H:%M:%S.%f") return job.save() elif request.method == 'DELETE': token.require_group('human') return job.delete() # Example usage: # POST /api/clients @api('/api/clients', methods=['POST'], auth_group=['agent']) async def query_clients(request, token): json = await request.json() # pid, elevated, executable_path agen = Agent.objects.with_id(token.session_info['_id']) # Get the list of known rats complete_names = {iv.name: iv for iv in Rat.objects(host=agen.host)} # Filter list for living rats known_names = {} for name, element in complete_names.items(): if element.active: known_names[name] = element # All of the currently running rats, as returned by the job active = {x['pid']: x for x in json} # Enumerate the active rats, and delete dead ones for name, iv in known_names.items(): if name not in active: iv.modify(**{'active': False}) else: a = active.pop(name) iv.update(**{'elevated': a['elevated'], 'executable': a['executable_path']}) # Any new rats need to be added for name in active: Rat(**{'agent': agen, 'host': agen.host, 'name': name, 'elevated': active[name]['elevated'], 'executable': active[name]['executable_path'], 'username': active[name]['username'].lower(), 'active': True}).save() return None # Example usage: # GET /api/networks # POST /api/networks { domain: 'mitre.org' } @api('/api/networks', methods=['GET', 'POST'], auth_group=['human']) async def query_networks(request): if request.method == 'GET': return Network.objects elif request.method == 'POST': json = await request.json() network = Network(**json).save() return network.id @api('/api/networks/{network}', methods=['GET', 'DELETE'], objects={'network': Network}, auth_group=['human']) async def query_network(request, network): if request.method == 'GET': return network elif request.method == 'DELETE': network.delete() @api('/api/heartbeat', methods=['GET'], auth_group=['agent']) async def agent_check_in(request, token): agen = Agent.objects.with_id(token.session_info['_id']) agen.modify(**{'check_in': datetime.now(timezone.utc), 'alive': True}) return True @api('/api/hosts', methods=['GET'], auth_group=['human']) async def query_hosts(request): return Host.objects @api('/api/domains', methods=['GET'], auth_group=['human']) async def query_domains(request): return Domain.objects @api('/api/domains/{domain}', methods=['GET'], objects={'domain': Domain}, auth_group=['human']) async def query_domain(request, domain): return domain @api('/api/domains/{domain}/hosts', methods=['GET'], objects={'domain': Domain}, auth_group=['human']) async def query_domainhosts(request, domain): return Host.objects(domain=domain) @api('/api/networks/{network}/hosts', methods=['GET'], objects={'network': Network}, auth_group=['human']) async def query_networkhosts(request, network): return network.hosts @api('/api/networks/{network}/hosts/{host}', methods=['GET', 'PUT', 'DELETE'], objects={'network': Network, 'host': Host}, auth_group=['human']) async def query_networkhosthosts(request, network, host): if request.method == 'GET': return host elif request.method == 'PUT': network.modify(push__hosts=host) elif request.method == 'DELETE': network.modify(pull__hosts=host) @api('/api/hosts/{host}/commands', methods=['GET', 'POST'], objects={'host': Host}, auth_group=['human']) async def query_commands(request, host): if request.method == 'GET': if 'hostname' in request.GET: hosts = Host.objects(hostname=request.GET['hostname']) return [x.host_command_result() for x in Job.objects(host__in=hosts)] else: return [x.host_command_result() for x in Job.objects(host=host)] elif request.method == 'POST': json = await request.json() return interface.agent_shell_command(host, json['command_line']).id @api('/api/hosts/{host}/commands/{job}', methods=['GET'], get={'wait': False}, objects={'host': Host, 'job': Job}, auth_group=['human']) async def query_command(request, wait, host, job): # start waiting for the job before reloading to avoid missing the update if wait is not False: try: await job.wait_till_completed() except JobException as e: log.warning(e.args) return job.host_command_result() @api('/api/rats', methods=['GET'], auth_group=['human']) async def query_ivs(request): query = {k: v for k, v in request.GET.items() if k == 'hostname'} return Rat.objects(**query) @api('/api/rats/{rat}', methods=['GET'], objects={'rat': Rat}, auth_group=['human']) async def query_iv(rat): return rat @api('/api/rats/{rat}/commands', methods=['GET', 'POST'], objects={'rat': Rat}, auth_group=['human']) async def query_ivcommands(request, rat): if request.method == 'GET': return [x.rat_command_result() for x in Job.objects(agent=rat.agent)] elif request.method == 'POST': json = await request.json() return Job.create_rat_command(rat, json["function"], **json["parameters"]).id @api('/api/rats/{rat}/commands/{job}', methods=['GET'], get={'wait': False}, objects={'rat': Rat, 'job': Job}, auth_group=['human']) async def query_ivcommand(request, wait, rat, job): # start waiting for the job before reloading to avoid missing the update if wait is not False: try: await job.wait_till_completed() except JobException as e: log.warning(e.args) return job.rat_result() @api('/api/operations', methods=['GET'], auth_group=['human']) async def query_operations(request): return Operation.objects @api('/api/opcodes', methods=['GET'], auth_group=['human']) async def get_opcodes(request): return Opcodes.arguments @api('/api/networks/{network}/operations', methods=['GET', 'POST'], objects={'network': Network}, auth_group=['human']) async def query_perations(request, network): if request.method == 'GET': return list(Operation.objects(network=network)) elif request.method == 'POST': json = await request.json() if json['start_type'] == 'existing' and 'start_rat' not in json: return None json['network'] = network json['status'] = 'start' json['status_state'] = '' json['log'] = Log().save() # Get the adversary adversary = Adversary.objects.with_id(json['adversary']) json['steps'] = [x.name for x in adversary.steps] operation = Operation(**json).save() return operation.id @api('/api/networks/{network}/operations/{operation}', methods=['GET', 'PUT', 'DELETE', 'PATCH'], get={'wait': False}, objects={'network': Network, 'operation': Operation}, auth_group=['human']) async def query_operation(request, network, operation, wait): if request.method == 'GET': if wait: wait = json_module.loads(wait) wait["id"] = operation.id log.info("Wait: {}".format(wait)) # TODO fix race condition here new = list(Operation.objects(**wait)) if len(new) == 0: del wait["id"] new = [await operation.wait(wait)] return new[0] return operation elif request.method == 'PUT': json = await request.json() json['network_id'] = network.id json['hosts'] = network.hosts return operation.update(**json) elif request.method == 'DELETE': return operation.delete() elif request.method == 'PATCH': json = await request.json() operation.update(__raw__={'$set': json}) @api('/api/agents', methods=['GET'], auth_group=['human']) async def query_agents(request): return Agent.objects @api('/api/logs', methods=['GET'], auth_group=['human']) async def query_logs(request): return Log.objects @api('/api/logs/{log}', methods=['GET'], objects={'log': Log}, auth_group=['human']) async def query_log(request, log): return log @api('/api/agents/{agent}', methods=['GET'], objects={'agent': Agent}, auth_group=['human']) async def query_agent(request, agent): return agent @api('/api/adversaries', methods=['GET', 'POST'], auth_group=['human']) async def query_adversaries(request): if request.method == 'GET': return Adversary.objects elif request.method == 'POST': json = await request.json() json['artifactlists'] = [Artifactlist.objects.with_id(x) for x in json['artifactlists']] json['steps'] = [CodedStep.objects.with_id(x) for x in json['steps']] return Adversary(**json).save().id @api('/api/adversaries/{adversary}', methods=['GET', 'PUT', 'DELETE'], objects={'adversary': Adversary}, auth_group=['human']) async def query_adversary(request, adversary): if request.method == 'GET': return adversary elif request.method == 'PUT': if (adversary.protected): new_adv = {} new_adv['name'] = adversary['name'] new_adv['steps'] = adversary['steps'] new_adv['exfil_method'] = adversary['exfil_method'] new_adv['exfil_port'] = adversary['exfil_port'] new_adv['exfil_address'] = adversary['exfil_address'] new_adv['artifactlists'] = adversary['artifactlists'] adversary = Adversary(**new_adv).save() # Update the adversary json = await request.json() json['artifactlists'] = [Artifactlist.objects.with_id(x) for x in json['artifactlists']] json['steps'] = [CodedStep.objects.with_id(x) for x in json['steps']] adversary.update(**json) return adversary.id elif request.method == 'DELETE': if not adversary.protected: return adversary.delete() @api('/api/step', methods=['GET'], auth_group=['human']) async def query_step(request): return CodedStep.objects @api('/api/site_user', methods=['GET', 'POST'], auth_group=['admin']) async def query_siteusers(request): if request.method == 'GET': return SiteUser.objects.only('username', 'groups', 'email', 'last_login') elif request.method == 'POST': json = await request.json() username = json['username'] email = json.get('email', '') password = json.get('password', None) groups = ['human'] if json.get('admin', False): groups.append('admin') return auth.register_user(username, groups, password=password, email=email).id @api('/api/site_user/{user}', methods=['GET', 'DELETE'], objects={'user': SiteUser}, auth_group=['admin']) async def query_siteuser(request, token, user): if request.method == 'GET': return user.only('username', 'groups', 'email', 'last_login') elif request.method == 'DELETE': if token.session_info['_id'] != str(user.id): return user.delete() @api('/api/site_user/{user}/admin', methods=['PUT', 'DELETE'], objects={'user': SiteUser}, auth_group=['admin']) async def query_siteuser_admin(request, token, user): if request.method == 'PUT': user.modify(push__groups='admin') elif request.method == 'DELETE': if SiteUser.objects(groups='admin').count() > 1 and token.session_info['_id'] != str(user.id): user.modify(pull__groups='admin') @api('/api/site_user/{user}/password', methods=['POST'], objects={'user': SiteUser}, auth_group=['admin', 'human']) async def query_siteuser_password(request, token, user): json = await request.json() if 'password' in json: if token.in_group('admin') or token.session_info['_id'] == str(user.id): auth.user_change_password(user, json['password']) @api('/api/site_user/{user}/email', methods=['POST'], objects={'user': SiteUser}, auth_group=['admin']) async def query_siteuser_email(request, user): json = await request.json() if 'email' in json:
@api('/api/save_file', methods=['POST'], auth_group=['admin']) async def save_file(request): json = await request.json() if 'edited' in json and 'file' in json: file_path = util.get_path(json['file']) if json['file'].startswith("[-d-]") or file_path is None: return core = util.encrypt_file(json['edited']) with open(file_path, 'wb') as handle: core.tofile(handle) @api('/api/list_file', methods=['GET'], auth_group=['admin']) async def list_files(request): return util.list_files() @api('/api/load_file', methods=['POST'], auth_group=['admin']) async def load_file(request): json = await request.json() if 'file' in json: file_path = util.get_path(json['file']) if json['file'].startswith("[-d-]") or json['file'] == '' or file_path is None: return if file_path.startswith('[m]'): return file_path with open(file_path, 'rb') as handle: data = handle.read() return util.decrypt_file(data) @api('/api/load_psexec', methods=['GET'], auth_group=['admin']) async def load_psexec(request): extern.load_psexec() Setting.objects.first().update(last_psexec_update=util.tz_utcnow()) @api('/api/load_attack', methods=['GET'], auth_group=['admin']) async def load_attack(request): attack.refresh_attack() Setting.objects.first().update(last_attack_update=util.tz_utcnow()) @api('/api/update_depth', methods=['POST'], auth_group=['admin']) async def update_recursion_limit(request): json = await request.json() if 'new_value' in json: Setting.objects.first().modify(recursion_limit=json['new_value']) @api('/api/group_mimic', methods=['GET'], auth_group=['admin', 'human']) async def group_coverage(request): temp_list = [] core = {} for step in CodedStep.objects: for mapping in step.mapping: temp_list.append(mapping.technique) groups = AttackGroup.objects for entry in groups: temp = {} breakdown = {} decision = [] for tech in entry.techniques: temp[tech.name] = (tech in temp_list) decision.append(tech in temp_list) breakdown['techniques'] = temp if (False not in decision) and (len(decision) > 2): breakdown['conclusion'] = 'Can Fully Emulate' else: breakdown['conclusion'] = 'Can Not Fully Emulate' core[entry.name] = breakdown return core @api('/api/steps/{step}/mapping', methods=['POST', 'DELETE'], objects={'step': CodedStep}, auth_group=['human']) async def post_step_mapping(request, step): if request.method == 'POST': json = await request.json() if 'tactics' not in json or 'technique' not in json: return tactics = json['tactics'] technique = json['technique'] try: tech = AttackTechnique.objects.with_id(technique) for tactic in tactics: tac = AttackTactic.objects.with_id(tactic) step.modify(push__mapping=TechniqueMapping(technique=tech, tactic=tac)) except (TypeError, mongoengine.errors.ValidationError): return elif request.method == 'DELETE': json = await request.json() if 'tactic' not in json or 'technique' not in json: return tactic = json['tactic'] technique = json['technique'] try: tech = AttackTechnique.objects.with_id(technique) tac = AttackTactic.objects.with_id(tactic) for mapping in step.mapping: if mapping.tactic == tac and mapping.technique == tech: step.modify(pull__mapping=mapping) except (TypeError, mongoengine.errors.ValidationError): return @api('/api/steps/{step}/mapping/load_defaults', methods=['GET'], objects={'step': CodedStep}, auth_group=['human']) async def get_step_mapping_defaults(request, step): step.update(mapping=step.default_mapping) @api('/api/attack_download.json', methods=['GET'], auth_group=['human'], headers={'Content-Disposition': 'attachment'}) async def get_all_attack_stuff(request): try: techniques = [] for technique in AttackTechnique.objects: this_technique = technique.to_dict() this_technique['tactics'] = [x.name for x in technique.tactics] del this_technique['_id'] techniques.append(this_technique) tactics = [x.to_dict() for x in AttackTactic.objects] for tactic in tactics: del tactic["_id"] return {"techniques": techniques, "tactics": tactics} except (TypeError, mongoengine.errors.ValidationError): return @api('/api/generated/{function}', methods=["POST"], auth_group=['admin']) async def generated_dispatcher(request): dispatched_function = request.match_info['function'] request_json = await request.json() job = getattr(interface, dispatched_function)(**request_json) try: await job.wait_till_completed() return job.action['result'] except JobException: return job.action['error'] @api('/api/artifactlists', methods=['GET', 'POST'], auth_group=['human']) async def get_artifactlists(request): if request.method == 'GET': return Artifactlist.objects elif request.method == 'POST': if request.content_type == "application/json": content = await request.json() elif request.content_type == "text/x-yaml": try: content = format_yaml(await request.text()) except (yaml.scanner.ScannerError, yaml.parser.ParserError): return web.Response(status=400, text="The yaml was not properly formatted") else: return web.Response(status=400) try: return Artifactlist(**content).save().id except (mongoengine.errors.FieldDoesNotExist, mongoengine.errors.ValidationError) as e: return web.Response(status=400, text=str(e)) @api('/api/artifactlists/{artifactlist}', methods=['GET', 'PUT', 'DELETE'], objects={'artifactlist': Artifactlist}, auth_group=['human']) async def query_artifactlist(request, artifactlist): if request.method == 'GET': return artifactlist elif request.method == 'PUT': if request.content_type == "application/json": content = await request.json() elif request.content_type == "text/x-yaml": try: content = format_yaml(await request.text()) except (yaml.scanner.ScannerError, yaml.parser.ParserError): return web.Response(status=400, text="The yaml was not properly formatted") else: return web.Response(status=400) try: artifactlist.update(**content) return artifactlist.id except (mongoengine.errors.FieldDoesNotExist, mongoengine.errors.ValidationError) as e: return web.Response(status=400, text=str(e)) elif request.method == 'DELETE': return artifactlist.delete() @api('/api/parse_artifactlist', methods=['POST'], auth_group=['human']) async def get_parse_artifactlist(request): try: parsed = format_yaml(await request.text()) Artifactlist(**parsed) return parsed except (yaml.scanner.ScannerError, yaml.parser.ParserError) as e: return web.Response(status=400, text="The yaml was not properly formatted: \n" + str(e.problem_mark) + '\n ' + str(e.problem)) except (mongoengine.errors.FieldDoesNotExist, mongoengine.errors.ValidationError) as e: return web.Response(status=400, text=str(e)) def format_yaml(yaml_content): parsed = yaml.load(yaml_content) cleaned = {} for k, v in parsed.items(): if isinstance(v, list) and len(v) == 1 and v[0] is None: cleaned[k] = [] else: cleaned[k] = v return cleaned @api('/api/bsf/{log}', methods=['GET'], objects={'log': Log}, auth_group=['human'], headers={'Content-Disposition': 'attachment; filename=\"bsf.json\"'}) async def query_bsf(request, log): return log["event_stream"] @api('/api/observed/credentials', methods=['GET'], auth_group=['human']) async def query_credentials(request): return ObservedCredential.objects @api('/api/observed/credentials/{credential}', methods=['GET'], objects={'credential': ObservedCredential}, auth_group=['human']) async def query_credential(request, token, credential): return credential @api('/api/observed/users', methods=['GET'], auth_group=['human']) async def query_users(request): return ObservedUser.objects @api('/api/observed/users/{user}', methods=['GET'], objects={'user': ObservedUser}, auth_group=['human']) async def query_user(request, token, user): return user @api('/api/observed/shares', methods=['GET'], auth_group=['human']) async def query_shares(request): return ObservedShare.objects @api('/api/observed/shares/{share}', methods=['GET'], objects={'share': ObservedShare}, auth_group=['human']) async def query_share(request, token, share): return share @api('/api/observed/files', methods=['GET'], auth_group=['human']) async def query_files(request): return ObservedFile.objects @api('/api/observed/files/{file}', methods=['GET'], objects={'file': ObservedFile}, auth_group=['human']) async def query_file(request, token, file): return file @api('/api/observed/domains', methods=['GET'], auth_group=['human']) async def query_domains(request): return ObservedDomain.objects @api('/api/observed/domains/{domain}', methods=['GET'], objects={'domain': ObservedDomain}, auth_group=['human']) async def query_domain(request, token, domain): return domain @api('/api/observed/os_versions', methods=['GET'], auth_group=['human']) async def query_os_versions(request): return ObservedOsversion.objects @api('/api/observed/os_versions/{os_version}', methods=['GET'], objects={'os_version': ObservedOSVersion}, auth_group=['human']) async def query_os_version(request, token, os_version): return os_version @api('/api/observed/hosts', methods=['GET'], auth_group=['human']) async def query_hosts(request): return ObservedHost.objects @api('/api/observed/hosts/{host}', methods=['GET'], objects={'host': ObservedHost}, auth_group=['human']) async def query_host(request, token, host): return host @api('/api/observed/schtasks', methods=['GET'], auth_group=['human']) async def query_schtasks(request): return ObservedSchtask.objects @api('/api/observed/schtasks/{schtask}', methods=['GET'], objects={'schtask': ObservedSchtask}, auth_group=['human']) async def query_schtask(request, token, schtask): return schtask @api('/api/observed/services', methods=['GET'], auth_group=['human']) async def query_timedeltas(request): return ObservedService.objects @api('/api/observed/services/{service}', methods=['GET'], objects={'service': ObservedService}, auth_group=['human']) async def query_timedelta(request, token, service): return service @api('/api/observed/timedeltas', methods=['GET'], auth_group=['human']) async def query_timedeltas(request): return ObservedTimeDelta.objects @api('/api/observed/timedeltas/{timedelta}', methods=['GET'], objects={'timedelta': ObservedTimeDelta}, auth_group=['human']) async def query_timedelta(request, token, timedelta): return timedelta @api('/api/observed/rats', methods=['GET'], auth_group=['human']) async def query_rats(request): return ObservedRat.objects @api('/api/observed/rats/{rat}', methods=['GET'], objects={'rat': ObservedRat}, auth_group=['human']) async def query_rat(request, token, rat): return rat @api('/api/observed/registry_keys', methods=['GET'], auth_group=['human']) async def query_registry_keys(request): return ObservedRegKey.objects @api('/api/observed/registry_keys/{registry_key}', methods=['GET'], objects={'registry_key': ObservedRegKey}, auth_group=['human']) async def query_regkey(request, token, registry_key): return registry_key @api('/api/observed/persistence', methods=['GET'], auth_group=['human']) async def query_persistence_all(request): return ObservedPersistence.objects @api('/api/observed/persistence/{persistence}', methods=['GET'], objects={'persistence': ObservedPersistence}, auth_group=['human']) async def query_persistence(request, token, persistence): return persistence @api('/api/observed/processes', methods=['GET'], auth_group=['human']) async def query_processes(request): return ObservedProcess.objects @api('/api/observed/processes/{process}', methods=['GET'], objects={'process': ObservedProcess}, auth_group=['human']) async def query_process(request, token, process): return process @api('/api/step', methods=['GET'], auth_group=['human']) async def query_step(request): return CodedStep.objects @websocket('/websocket', auth_group=["human"]) async def wb_operation(request): ws = web.WebSocketResponse() await ws.prepare(request) def write_websocket(data): if not ws.closed: ws.send_bytes(data) else: raise RuntimeError srv = ddp.DDPServer(write_websocket) srv.register_collection("operation", Operation) srv.register_collection("domain", Domain) srv.register_collection("host", Host) srv.register_collection("network", Network) srv.register_collection("rat", Rat) srv.register_collection("observed_rat", ObservedRat) srv.register_collection("observed_host", ObservedHost) srv.register_collection("observed_file", ObservedFile) srv.register_collection("observed_schtask", ObservedSchtask) srv.register_collection("job", Job) srv.register_collection("log", Log) srv.register_collection("adversary", Adversary) srv.register_collection("step", CodedStep) srv.register_collection("active_connection", ActiveConnection) srv.register_collection("agent", Agent) srv.register_collection("attack_technique", AttackTechnique) srv.register_collection("attack_tactic", AttackTactic) srv.register_collection("attack_list", AttackList) srv.register_collection("attack_group", AttackGroup) srv.register_collection("setting", Setting) srv.register_collection("artifactlist", Artifactlist) request.app['websockets'].append(ws) try: async for msg in ws: if msg.type == aiohttp.WSMsgType.TEXT or msg.type == aiohttp.WSMsgType.BINARY: srv.parse_message(msg.data) elif msg.type == aiohttp.WSMsgType.ERROR: log.debug('ws connection closed with exception {}'.format(ws.exception())) finally: request.app['websockets'].remove(ws) log.debug('websocket connection closed') return ws def init(app): # setup the generated endpoints for method, uri, func in routes: app.router.add_route(method, uri, func)
user.update(email=json['email'])
test_text.py
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.text}. """ from cStringIO import StringIO from twisted.trial import unittest from twisted.python import text sampleText = \ """Every attempt to employ mathematical methods in the study of chemical questions must be considered profoundly irrational and contrary to the spirit of chemistry ... If mathematical analysis should ever hold a prominent place in chemistry - an aberration which is happily almost impossible - it would occasion a rapid and widespread degeneration of that science. -- Auguste Comte, Philosophie Positive, Paris, 1838 """ class WrapTests(unittest.TestCase): """ Tests for L{text.greedyWrap}. """ def setUp(self): self.lineWidth = 72 self.sampleSplitText = sampleText.split() self.output = text.wordWrap(sampleText, self.lineWidth) def test_wordCount(self): """ Compare the number of words. """ words = [] for line in self.output: words.extend(line.split()) wordCount = len(words) sampleTextWordCount = len(self.sampleSplitText) self.assertEqual(wordCount, sampleTextWordCount) def test_wordMatch(self): """ Compare the lists of words. """ words = [] for line in self.output: words.extend(line.split()) # Using assertEqual here prints out some # rather too long lists. self.assertTrue(self.sampleSplitText == words) def test_lineLength(self): """ Check the length of the lines. """ failures = [] for line in self.output: if not len(line) <= self.lineWidth: failures.append(len(line)) if failures: self.fail("%d of %d lines were too long.\n" "%d < %s" % (len(failures), len(self.output), self.lineWidth, failures)) def test_doubleNewline(self): """ Allow paragraphs delimited by two \ns. """ sampleText = "et\n\nphone\nhome." result = text.wordWrap(sampleText, self.lineWidth) self.assertEqual(result, ["et", "", "phone home.", ""]) class LineTests(unittest.TestCase): """ Tests for L{isMultiline} and L{endsInNewline}. """ def test_isMultiline(self): """ L{text.isMultiline} returns C{True} if the string has a newline in it. """ s = 'This code\n "breaks."' m = text.isMultiline(s) self.assertTrue(m) s = 'This code does not "break."' m = text.isMultiline(s) self.assertFalse(m) def test_endsInNewline(self): """ L{text.endsInNewline} returns C{True} if the string ends in a newline. """ s = 'newline\n' m = text.endsInNewline(s) self.assertTrue(m) s = 'oldline' m = text.endsInNewline(s) self.assertFalse(m) class StringyStringTests(unittest.TestCase): """ Tests for L{text.stringyString}. """ def test_tuple(self): """ Tuple elements are displayed on separate lines. """ s = ('a', 'b') m = text.stringyString(s) self.assertEqual(m, '(a,\n b,)\n') def test_dict(self): """ Dicts elements are displayed using C{str()}. """ s = {'a': 0} m = text.stringyString(s) self.assertEqual(m, '{a: 0}') def test_list(self): """ List elements are displayed on separate lines using C{str()}. """ s = ['a', 'b'] m = text.stringyString(s) self.assertEqual(m, '[a,\n b,]\n') class SplitTests(unittest.TestCase): """ Tests for L{text.splitQuoted}. """ def test_oneWord(self): """ Splitting strings with one-word phrases. """ s = 'This code "works."' r = text.splitQuoted(s) self.assertEqual(['This', 'code', 'works.'], r) def test_multiWord(self): s = 'The "hairy monkey" likes pie.' r = text.splitQuoted(s) self.assertEqual(['The', 'hairy monkey', 'likes', 'pie.'], r) # Some of the many tests that would fail: #def test_preserveWhitespace(self): # phrase = '"MANY SPACES"' # s = 'With %s between.' % (phrase,) # r = text.splitQuoted(s) # self.assertEqual(['With', phrase, 'between.'], r) #def test_escapedSpace(self): # s = r"One\ Phrase" # r = text.splitQuoted(s) # self.assertEqual(["One Phrase"], r) class StrFileTests(unittest.TestCase): def setUp(self): self.io = StringIO("this is a test string") def tearDown(self): pass def test_1_f(self): self.assertEqual(False, text.strFile("x", self.io)) def test_1_1(self): self.assertEqual(True, text.strFile("t", self.io)) def test_1_2(self):
def test_1_3(self): self.assertEqual(True, text.strFile("i", self.io)) def test_1_4(self): self.assertEqual(True, text.strFile("s", self.io)) def test_1_5(self): self.assertEqual(True, text.strFile("n", self.io)) def test_1_6(self): self.assertEqual(True, text.strFile("g", self.io)) def test_3_1(self): self.assertEqual(True, text.strFile("thi", self.io)) def test_3_2(self): self.assertEqual(True, text.strFile("his", self.io)) def test_3_3(self): self.assertEqual(True, text.strFile("is ", self.io)) def test_3_4(self): self.assertEqual(True, text.strFile("ing", self.io)) def test_3_f(self): self.assertEqual(False, text.strFile("bla", self.io)) def test_large_1(self): self.assertEqual(True, text.strFile("this is a test", self.io)) def test_large_2(self): self.assertEqual(True, text.strFile("is a test string", self.io)) def test_large_f(self): self.assertEqual(False, text.strFile("ds jhfsa k fdas", self.io)) def test_overlarge_f(self): self.assertEqual(False, text.strFile("djhsakj dhsa fkhsa s,mdbnfsauiw bndasdf hreew", self.io)) def test_self(self): self.assertEqual(True, text.strFile("this is a test string", self.io)) def test_insensitive(self): self.assertEqual(True, text.strFile("ThIs is A test STRING", self.io, False))
self.assertEqual(True, text.strFile("h", self.io))
info.rs
use super::v2; impl From<v2::Info> for openapiv3::Info { fn
(v2: v2::Info) -> Self { openapiv3::Info { title: v2.title, description: v2.description, terms_of_service: None, contact: v2.contact.map(|c| c.into()), license: v2.license.map(From::from), version: v2.version, extensions: v2.extensions.into_iter().fold( indexmap::IndexMap::new(), |mut i, (k, v)| { i.insert(k, v); i }, ), } } }
from
predicates_test.go
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package scheduler import ( "context" "fmt" "testing" "time" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" st "k8s.io/kubernetes/pkg/scheduler/testing" testutils "k8s.io/kubernetes/test/integration/util" "k8s.io/kubernetes/test/utils" imageutils "k8s.io/kubernetes/test/utils/image" ) // This file tests the scheduler predicates functionality. const pollInterval = 100 * time.Millisecond // TestInterPodAffinity verifies that scheduler's inter pod affinity and // anti-affinity predicate functions works correctly. func TestInterPodAffinity(t *testing.T) { testCtx := initTest(t, "inter-pod-affinity") defer testutils.CleanupTest(t, testCtx) // Add a few nodes with labels nodes, err := createNodes(testCtx.ClientSet, "testnode", st.MakeNode().Label("region", "r1").Label("zone", "z11"), 2) if err != nil { t.Fatalf("Cannot create nodes: %v", err) } cs := testCtx.ClientSet podLabel := map[string]string{"service": "securityscan"} podLabel2 := map[string]string{"security": "S1"} tests := []struct { name string pod *v1.Pod pods []*v1.Pod node *v1.Node fits bool errorType string }{ { name: "validates that a pod with an invalid podAffinity is rejected because of the LabelSelectorRequirement is invalid", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel2, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "security", Operator: metav1.LabelSelectorOpDoesNotExist, }, }, }, TopologyKey: "region", }, }, }, }, }, }, node: nodes[0], fits: false, errorType: "invalidPod", }, { name: "validates that Inter-pod-Affinity is respected if not matching", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel2, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "security", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan"}, }, }, }, TopologyKey: "region", }, }, }, }, }, }, node: nodes[0], fits: false, }, { name: "validates that InterPodAffinity is respected if matching. requiredDuringSchedulingIgnoredDuringExecution in PodAffinity using In operator that matches the existing pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel2, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan", "value2"}, }, }, }, TopologyKey: "region", }, }, }, }, }, }, pods: []*v1.Pod{{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: nodes[0].Name, }, }, }, node: nodes[0], fits: true, }, { name: "validates that InterPodAffinity is respected if matching. requiredDuringSchedulingIgnoredDuringExecution in PodAffinity using not in operator in labelSelector that matches the existing pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel2, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpNotIn, Values: []string{"securityscan3", "value3"}, }, }, }, TopologyKey: "region", }, }, }, }, }, }, pods: []*v1.Pod{{Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: nodes[0].Name}, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel}}}, node: nodes[0], fits: true, }, { name: "validates that inter-pod-affinity is respected when pods have different Namespaces", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel2, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan", "value2"}, }, }, }, TopologyKey: "region", Namespaces: []string{"diff-namespace"}, }, }, }, }, }, }, pods: []*v1.Pod{{Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: nodes[0].Name}, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel, Namespace: "ns"}}}, node: nodes[0], fits: false, }, { name: "Doesn't satisfy the PodAffinity because of unmatching labelSelector with the existing pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"antivirusscan", "value2"}, }, }, }, TopologyKey: "region", }, }, }, }, }, }, pods: []*v1.Pod{{Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: nodes[0].Name}, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel}}}, node: nodes[0], fits: false, }, { name: "validates that InterPodAffinity is respected if matching with multiple affinities in multiple RequiredDuringSchedulingIgnoredDuringExecution ", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel2, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpExists, }, { Key: "wrongkey", Operator: metav1.LabelSelectorOpDoesNotExist, }, }, }, TopologyKey: "region", }, { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan"}, }, { Key: "service", Operator: metav1.LabelSelectorOpNotIn, Values: []string{"WrongValue"}, }, }, }, TopologyKey: "region", }, }, }, }, }, }, pods: []*v1.Pod{{Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: nodes[0].Name}, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel}}}, node: nodes[0], fits: true, }, { name: "The labelSelector requirements(items of matchExpressions) are ANDed, the pod cannot schedule onto the node because one of the matchExpression items doesn't match.", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Labels: podLabel2, Name: "fakename", }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpExists, }, { Key: "wrongkey", Operator: metav1.LabelSelectorOpDoesNotExist, }, }, }, TopologyKey: "region", }, { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan2"}, }, { Key: "service", Operator: metav1.LabelSelectorOpNotIn, Values: []string{"WrongValue"}, }, }, }, TopologyKey: "region", }, }, }, }, }, }, pods: []*v1.Pod{{Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: nodes[0].Name}, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel}}}, node: nodes[0], fits: false, },
ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel2, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan", "value2"}, }, }, }, TopologyKey: "region", }, }, }, PodAntiAffinity: &v1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"antivirusscan", "value2"}, }, }, }, TopologyKey: "node", }, }, }, }, }, }, pods: []*v1.Pod{{Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: nodes[0].Name}, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel}}}, node: nodes[0], fits: true, }, { name: "satisfies the PodAffinity and PodAntiAffinity and PodAntiAffinity symmetry with the existing pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel2, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan", "value2"}, }, }, }, TopologyKey: "region", }, }, }, PodAntiAffinity: &v1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"antivirusscan", "value2"}, }, }, }, TopologyKey: "node", }, }, }, }, }, }, pods: []*v1.Pod{ { Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: nodes[0].Name, Affinity: &v1.Affinity{ PodAntiAffinity: &v1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"antivirusscan", "value2"}, }, }, }, TopologyKey: "node", }, }, }, }, }, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel}, }, }, node: nodes[0], fits: true, }, { name: "satisfies the PodAffinity but doesn't satisfies the PodAntiAffinity with the existing pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel2, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan", "value2"}, }, }, }, TopologyKey: "region", }, }, }, PodAntiAffinity: &v1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan", "value2"}, }, }, }, TopologyKey: "zone", }, }, }, }, }, }, pods: []*v1.Pod{{Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: nodes[0].Name}, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel}}}, node: nodes[0], fits: false, }, { name: "satisfies the PodAffinity and PodAntiAffinity but doesn't satisfies PodAntiAffinity symmetry with the existing pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan", "value2"}, }, }, }, TopologyKey: "region", }, }, }, PodAntiAffinity: &v1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"antivirusscan", "value2"}, }, }, }, TopologyKey: "node", }, }, }, }, }, }, pods: []*v1.Pod{ { Spec: v1.PodSpec{ NodeName: nodes[0].Name, Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAntiAffinity: &v1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan", "value3"}, }, }, }, TopologyKey: "zone", }, }, }, }, }, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel}, }, }, node: nodes[0], fits: false, }, { name: "pod matches its own Label in PodAffinity and that matches the existing pod Labels", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel, }, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpNotIn, Values: []string{"securityscan", "value2"}, }, }, }, TopologyKey: "region", }, }, }, }, }, }, pods: []*v1.Pod{{Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: "machine2"}, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel}}}, node: nodes[0], fits: false, }, { name: "Verify that PodAntiAffinity of an existing pod is respected when PodAntiAffinity symmetry is not satisfied with the existing pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fakename", Labels: podLabel, }, Spec: v1.PodSpec{Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}}, }, pods: []*v1.Pod{ { Spec: v1.PodSpec{NodeName: nodes[0].Name, Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAntiAffinity: &v1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpIn, Values: []string{"securityscan", "value2"}, }, }, }, TopologyKey: "zone", }, }, }, }, }, ObjectMeta: metav1.ObjectMeta{ Name: "fakename2", Labels: podLabel}, }, }, node: nodes[0], fits: false, }, { name: "Verify that PodAntiAffinity from existing pod is respected when pod statisfies PodAntiAffinity symmetry with the existing pod", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "fake-name", Labels: podLabel, }, Spec: v1.PodSpec{Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}}, }, pods: []*v1.Pod{ { Spec: v1.PodSpec{NodeName: nodes[0].Name, Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, Affinity: &v1.Affinity{ PodAntiAffinity: &v1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "service", Operator: metav1.LabelSelectorOpNotIn, Values: []string{"securityscan", "value2"}, }, }, }, TopologyKey: "zone", }, }, }, }, }, ObjectMeta: metav1.ObjectMeta{ Name: "fake-name2", Labels: podLabel}, }, }, node: nodes[0], fits: true, }, { name: "nodes[0] and nodes[1] have same topologyKey and label value. nodes[0] has an existing pod that matches the inter pod affinity rule. The new pod can not be scheduled onto either of the two nodes.", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "fake-name2"}, Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeSelector: map[string]string{"region": "r1"}, Affinity: &v1.Affinity{ PodAntiAffinity: &v1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: "foo", Operator: metav1.LabelSelectorOpIn, Values: []string{"abc"}, }, }, }, TopologyKey: "region", }, }, }, }, }, }, pods: []*v1.Pod{ {Spec: v1.PodSpec{ Containers: []v1.Container{{Name: "container", Image: imageutils.GetPauseImageName()}}, NodeName: nodes[0].Name}, ObjectMeta: metav1.ObjectMeta{Name: "fakename", Labels: map[string]string{"foo": "abc"}}}, }, fits: false, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { for _, pod := range test.pods { var nsName string if pod.Namespace != "" { nsName = pod.Namespace } else { nsName = testCtx.NS.Name } createdPod, err := cs.CoreV1().Pods(nsName).Create(context.TODO(), pod, metav1.CreateOptions{}) if err != nil { t.Fatalf("Error while creating pod: %v", err) } err = wait.Poll(pollInterval, wait.ForeverTestTimeout, testutils.PodScheduled(cs, createdPod.Namespace, createdPod.Name)) if err != nil { t.Errorf("Error while creating pod: %v", err) } } testPod, err := cs.CoreV1().Pods(testCtx.NS.Name).Create(context.TODO(), test.pod, metav1.CreateOptions{}) if err != nil { if !(test.errorType == "invalidPod" && apierrors.IsInvalid(err)) { t.Fatalf("Error while creating pod: %v", err) } } if test.fits { err = wait.Poll(pollInterval, wait.ForeverTestTimeout, testutils.PodScheduled(cs, testPod.Namespace, testPod.Name)) } else { err = wait.Poll(pollInterval, wait.ForeverTestTimeout, podUnschedulable(cs, testPod.Namespace, testPod.Name)) } if err != nil { t.Errorf("Error while trying to fit a pod: %v", err) } err = cs.CoreV1().Pods(testCtx.NS.Name).Delete(context.TODO(), test.pod.Name, *metav1.NewDeleteOptions(0)) if err != nil { t.Errorf("Error while deleting pod: %v", err) } err = wait.Poll(pollInterval, wait.ForeverTestTimeout, testutils.PodDeleted(cs, testCtx.NS.Name, test.pod.Name)) if err != nil { t.Errorf("Error while waiting for pod to get deleted: %v", err) } for _, pod := range test.pods { var nsName string if pod.Namespace != "" { nsName = pod.Namespace } else { nsName = testCtx.NS.Name } err = cs.CoreV1().Pods(nsName).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) if err != nil { t.Errorf("Error while deleting pod: %v", err) } err = wait.Poll(pollInterval, wait.ForeverTestTimeout, testutils.PodDeleted(cs, nsName, pod.Name)) if err != nil { t.Errorf("Error while waiting for pod to get deleted: %v", err) } } }) } } // TestEvenPodsSpreadPredicate verifies that EvenPodsSpread predicate functions well. func TestEvenPodsSpreadPredicate(t *testing.T) { testCtx := initTest(t, "eps-predicate") cs := testCtx.ClientSet ns := testCtx.NS.Name defer testutils.CleanupTest(t, testCtx) // Add 4 nodes. nodes, err := createNodes(cs, "node", st.MakeNode(), 4) if err != nil { t.Fatalf("Cannot create nodes: %v", err) } for i, node := range nodes { // Apply labels "zone: zone-{0,1}" and "node: <node name>" to each node. labels := map[string]string{ "zone": fmt.Sprintf("zone-%d", i/2), "node": node.Name, } if err = utils.AddLabelsToNode(cs, node.Name, labels); err != nil { t.Fatalf("Cannot add labels to node: %v", err) } if err = waitForNodeLabels(cs, node.Name, labels); err != nil { t.Fatalf("Failed to poll node labels: %v", err) } } pause := imageutils.GetPauseImageName() tests := []struct { name string incomingPod *v1.Pod existingPods []*v1.Pod fits bool candidateNodes []string // nodes expected to schedule onto }{ // note: naming starts at index 0 { name: "place pod on a 1/1/0/1 cluster with MaxSkew=1, node-2 is the only fit", incomingPod: st.MakePod().Namespace(ns).Name("p").Label("foo", "").Container(pause). SpreadConstraint(1, "node", hardSpread, st.MakeLabelSelector().Exists("foo").Obj()). Obj(), existingPods: []*v1.Pod{ st.MakePod().Namespace(ns).Name("p0").Node("node-0").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p1").Node("node-1").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p3").Node("node-3").Label("foo", "").Container(pause).Obj(), }, fits: true, candidateNodes: []string{"node-2"}, }, { name: "place pod on a 2/0/0/1 cluster with MaxSkew=2, node-{1,2,3} are good fits", incomingPod: st.MakePod().Namespace(ns).Name("p").Label("foo", "").Container(pause). SpreadConstraint(2, "node", hardSpread, st.MakeLabelSelector().Exists("foo").Obj()). Obj(), existingPods: []*v1.Pod{ st.MakePod().Namespace(ns).Name("p0a").Node("node-0").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p0b").Node("node-0").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p3").Node("node-3").Label("foo", "").Container(pause).Obj(), }, fits: true, candidateNodes: []string{"node-1", "node-2", "node-3"}, }, { name: "pod is required to be placed on zone0, so only node-1 fits", incomingPod: st.MakePod().Namespace(ns).Name("p").Label("foo", "").Container(pause). NodeAffinityIn("zone", []string{"zone-0"}). SpreadConstraint(1, "node", hardSpread, st.MakeLabelSelector().Exists("foo").Obj()). Obj(), existingPods: []*v1.Pod{ st.MakePod().Namespace(ns).Name("p0").Node("node-0").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p3").Node("node-3").Label("foo", "").Container(pause).Obj(), }, fits: true, candidateNodes: []string{"node-1"}, }, { name: "two constraints: pod can only be placed to zone-1/node-2", incomingPod: st.MakePod().Namespace(ns).Name("p").Label("foo", "").Container(pause). SpreadConstraint(1, "zone", hardSpread, st.MakeLabelSelector().Exists("foo").Obj()). SpreadConstraint(1, "node", hardSpread, st.MakeLabelSelector().Exists("foo").Obj()). Obj(), existingPods: []*v1.Pod{ st.MakePod().Namespace(ns).Name("p0").Node("node-0").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p1").Node("node-1").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p3a").Node("node-3").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p3b").Node("node-3").Label("foo", "").Container(pause).Obj(), }, fits: true, candidateNodes: []string{"node-2"}, }, { name: "pod cannot be placed onto any node", incomingPod: st.MakePod().Namespace(ns).Name("p").Label("foo", "").Container(pause). NodeAffinityNotIn("node", []string{"node-0"}). // mock a 3-node cluster SpreadConstraint(1, "zone", hardSpread, st.MakeLabelSelector().Exists("foo").Obj()). SpreadConstraint(1, "node", hardSpread, st.MakeLabelSelector().Exists("foo").Obj()). Obj(), existingPods: []*v1.Pod{ st.MakePod().Namespace(ns).Name("p1a").Node("node-1").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p1b").Node("node-1").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p2a").Node("node-2").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p2b").Node("node-2").Label("foo", "").Container(pause).Obj(), st.MakePod().Namespace(ns).Name("p3").Node("node-3").Label("foo", "").Container(pause).Obj(), }, fits: false, }, { name: "high priority pod can preempt others", incomingPod: st.MakePod().Namespace(ns).Name("p").Label("foo", "").Container(pause).Priority(100). NodeAffinityNotIn("node", []string{"node-0"}). // mock a 3-node cluster SpreadConstraint(1, "zone", hardSpread, st.MakeLabelSelector().Exists("foo").Obj()). SpreadConstraint(1, "node", hardSpread, st.MakeLabelSelector().Exists("foo").Obj()). Obj(), existingPods: []*v1.Pod{ st.MakePod().ZeroTerminationGracePeriod().Namespace(ns).Name("p1a").Node("node-1").Label("foo", "").Container(pause).Obj(), st.MakePod().ZeroTerminationGracePeriod().Namespace(ns).Name("p1b").Node("node-1").Label("foo", "").Container(pause).Obj(), st.MakePod().ZeroTerminationGracePeriod().Namespace(ns).Name("p2a").Node("node-2").Label("foo", "").Container(pause).Obj(), st.MakePod().ZeroTerminationGracePeriod().Namespace(ns).Name("p2b").Node("node-2").Label("foo", "").Container(pause).Obj(), st.MakePod().ZeroTerminationGracePeriod().Namespace(ns).Name("p3").Node("node-3").Label("foo", "").Container(pause).Obj(), }, fits: true, candidateNodes: []string{"node-1", "node-2", "node-3"}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { allPods := append(tt.existingPods, tt.incomingPod) defer testutils.CleanupPods(cs, t, allPods) for _, pod := range tt.existingPods { createdPod, err := cs.CoreV1().Pods(pod.Namespace).Create(context.TODO(), pod, metav1.CreateOptions{}) if err != nil { t.Fatalf("Error while creating pod during test: %v", err) } err = wait.Poll(pollInterval, wait.ForeverTestTimeout, testutils.PodScheduled(cs, createdPod.Namespace, createdPod.Name)) if err != nil { t.Errorf("Error while waiting for pod during test: %v", err) } } testPod, err := cs.CoreV1().Pods(tt.incomingPod.Namespace).Create(context.TODO(), tt.incomingPod, metav1.CreateOptions{}) if err != nil && !apierrors.IsInvalid(err) { t.Fatalf("Error while creating pod during test: %v", err) } if tt.fits { err = wait.Poll(pollInterval, wait.ForeverTestTimeout, podScheduledIn(cs, testPod.Namespace, testPod.Name, tt.candidateNodes)) } else { err = wait.Poll(pollInterval, wait.ForeverTestTimeout, podUnschedulable(cs, testPod.Namespace, testPod.Name)) } if err != nil { t.Errorf("Test Failed: %v", err) } }) } } var ( hardSpread = v1.DoNotSchedule softSpread = v1.ScheduleAnyway ) func TestUnschedulablePodBecomesSchedulable(t *testing.T) { tests := []struct { name string init func(kubernetes.Interface, string) error pod *pausePodConfig update func(kubernetes.Interface, string) error }{ { name: "node gets added", pod: &pausePodConfig{ Name: "pod-1", }, update: func(cs kubernetes.Interface, _ string) error { _, err := createNode(cs, st.MakeNode().Name("node-added").Obj()) if err != nil { return fmt.Errorf("cannot create node: %v", err) } return nil }, }, { name: "node gets taint removed", init: func(cs kubernetes.Interface, _ string) error { node, err := createNode(cs, st.MakeNode().Name("node-tainted").Obj()) if err != nil { return fmt.Errorf("cannot create node: %v", err) } taint := v1.Taint{Key: "test", Value: "test", Effect: v1.TaintEffectNoSchedule} if err := testutils.AddTaintToNode(cs, node.Name, taint); err != nil { return fmt.Errorf("cannot add taint to node: %v", err) } return nil }, pod: &pausePodConfig{ Name: "pod-1", }, update: func(cs kubernetes.Interface, _ string) error { taint := v1.Taint{Key: "test", Value: "test", Effect: v1.TaintEffectNoSchedule} if err := testutils.RemoveTaintOffNode(cs, "node-tainted", taint); err != nil { return fmt.Errorf("cannot remove taint off node: %v", err) } return nil }, }, { name: "other pod gets deleted", init: func(cs kubernetes.Interface, ns string) error { nodeObject := st.MakeNode().Name("node-scheduler-integration-test").Capacity(map[v1.ResourceName]string{v1.ResourcePods: "1"}).Obj() _, err := createNode(cs, nodeObject) if err != nil { return fmt.Errorf("cannot create node: %v", err) } _, err = createPausePod(cs, initPausePod(&pausePodConfig{Name: "pod-to-be-deleted", Namespace: ns})) if err != nil { return fmt.Errorf("cannot create pod: %v", err) } return nil }, pod: &pausePodConfig{ Name: "pod-1", }, update: func(cs kubernetes.Interface, ns string) error { if err := deletePod(cs, "pod-to-be-deleted", ns); err != nil { return fmt.Errorf("cannot delete pod: %v", err) } return nil }, }, { name: "pod with pod-affinity gets added", init: func(cs kubernetes.Interface, _ string) error { _, err := createNode(cs, st.MakeNode().Name("node-1").Label("region", "test").Obj()) if err != nil { return fmt.Errorf("cannot create node: %v", err) } return nil }, pod: &pausePodConfig{ Name: "pod-1", Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "pod-with-affinity": "true", }, }, TopologyKey: "region", }, }, }, }, }, update: func(cs kubernetes.Interface, ns string) error { podConfig := &pausePodConfig{ Name: "pod-with-affinity", Namespace: ns, Labels: map[string]string{ "pod-with-affinity": "true", }, } if _, err := createPausePod(cs, initPausePod(podConfig)); err != nil { return fmt.Errorf("cannot create pod: %v", err) } return nil }, }, { name: "scheduled pod gets updated to match affinity", init: func(cs kubernetes.Interface, ns string) error { _, err := createNode(cs, st.MakeNode().Name("node-1").Label("region", "test").Obj()) if err != nil { return fmt.Errorf("cannot create node: %v", err) } if _, err := createPausePod(cs, initPausePod(&pausePodConfig{Name: "pod-to-be-updated", Namespace: ns})); err != nil { return fmt.Errorf("cannot create pod: %v", err) } return nil }, pod: &pausePodConfig{ Name: "pod-1", Affinity: &v1.Affinity{ PodAffinity: &v1.PodAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ { LabelSelector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "pod-with-affinity": "true", }, }, TopologyKey: "region", }, }, }, }, }, update: func(cs kubernetes.Interface, ns string) error { pod, err := getPod(cs, "pod-to-be-updated", ns) if err != nil { return fmt.Errorf("cannot get pod: %v", err) } pod.Labels = map[string]string{"pod-with-affinity": "true"} if _, err := cs.CoreV1().Pods(pod.Namespace).Update(context.TODO(), pod, metav1.UpdateOptions{}); err != nil { return fmt.Errorf("cannot update pod: %v", err) } return nil }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { testCtx := initTest(t, "scheduler-informer") defer testutils.CleanupTest(t, testCtx) if tt.init != nil { if err := tt.init(testCtx.ClientSet, testCtx.NS.Name); err != nil { t.Fatal(err) } } tt.pod.Namespace = testCtx.NS.Name pod, err := createPausePod(testCtx.ClientSet, initPausePod(tt.pod)) if err != nil { t.Fatal(err) } if err := waitForPodUnschedulable(testCtx.ClientSet, pod); err != nil { t.Errorf("Pod %v got scheduled: %v", pod.Name, err) } if err := tt.update(testCtx.ClientSet, testCtx.NS.Name); err != nil { t.Fatal(err) } if err := testutils.WaitForPodToSchedule(testCtx.ClientSet, pod); err != nil { t.Errorf("Pod %v was not scheduled: %v", pod.Name, err) } // Make sure pending queue is empty. pendingPods := len(testCtx.Scheduler.SchedulingQueue.PendingPods()) if pendingPods != 0 { t.Errorf("pending pods queue is not empty, size is: %d", pendingPods) } }) } }
{ name: "validates that InterPod Affinity and AntiAffinity is respected if matching", pod: &v1.Pod{
art-track.js
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvArtTrack = (props) => ( <SvgIcon {...props}> <path d="M22 13h-8v-2h8v2zm0-6h-8v2h8V7zm-8 10h8v-2h-8v2zm-2-8v6c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2zm-1.5 6l-2.25-3-1.75 2.26-1.25-1.51L3.5 15h7z"/> </SvgIcon> ); AvArtTrack = pure(AvArtTrack); AvArtTrack.displayName = 'AvArtTrack'; AvArtTrack.muiName = 'SvgIcon';
export default AvArtTrack;
main.ts
import {app, BrowserWindow, globalShortcut} from 'electron'; import * as path from 'path'; import * as url from 'url'; // Initialize remote module require('@electron/remote/main').initialize();
const args = process.argv.slice(1), serve = args.some(val => val === '--serve'); function createWindow(): BrowserWindow { // Create the browser window. win = new BrowserWindow({ width: 950, height: 650, webPreferences: { nodeIntegration: true, allowRunningInsecureContent: (serve), contextIsolation: false, // false if you want to run 2e2 test with Spectron enableRemoteModule: true, // true if you want to run 2e2 test with Spectron or use remote module in renderer context (ie. Angular) devTools: false }, autoHideMenuBar: true, icon: path.join(__dirname, '/dist/assets/icon.ico') }); //win.webContents.openDevTools({ mode: "detach" }); win.loadURL(url.format({ pathname: path.join(__dirname, 'dist/index.html'), protocol: 'file:', slashes: true })); // Emitted when the window is closed. win.on('closed', () => { // Dereference the window object, usually you would store window // in an array if your app supports multi windows, this is the time // when you should delete the corresponding element. win = null; }); return win; } app.on("ready", createWindow); // Disable refresh app.whenReady().then(() => { globalShortcut.register("CommandOrControl+R", () => { }); }); // Quit when all windows are closed. app.on("window-all-closed", () => { // On OS X it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== "darwin") { app.quit(); } }); app.on("activate", () => { // On OS X it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. if (BrowserWindow.getAllWindows().length === 0) { createWindow(); } });
let win: BrowserWindow = null;
views.py
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from rest_framework import viewsets from rest_framework.authentication import TokenAuthentication from rest_framework import filters from rest_framework.authtoken.views import ObtainAuthToken from rest_framework.settings import api_settings # from rest_framework.permissions import IsAuthenticatedOrReadOnly from rest_framework.permissions import IsAuthenticated from profiles_api import serializers from profiles_api import models from profiles_api import permissions class HelloApiView(APIView): """Test API View""" serializer_class = serializers.HelloSerializer def get(self, request, format=None): """Returns a list of APIView features""" an_apiview = [ 'Uses HTTP methods as functions (get, post, patch, put, delete)', 'Is similar to a traditional Django View', 'Gives you the most control over your logic', 'Is mapped manually to URLs', ] return Response({'message': 'Hello!', 'an_apiview': an_apiview}) def post(self, request): """Create hello message with our name""" serializer = self.serializer_class(data=request.data) if serializer.is_valid(): name = serializer.validated_data.get('name') message = f'Hello {name}' return Response({'message': message}) else: return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) def put(self, request, pk=None): """Handle updating an object""" return Response({'method': 'PUT'}) def patch(self, request, pk=None): """Handle partial update of object""" return Response({'method': 'PATCH'}) def delete(self, request, pk=None): """Delete an object""" return Response({'method': 'DELETE'}) class HelloViewSet(viewsets.ViewSet): """Test API ViewSet""" serializer_class = serializers.HelloSerializer def list(self, request): """Return a hello message.""" a_viewset = [ 'Uses actions (list, create, retrieve, update, partial_update)', 'Automatically maps to URLS using Routers', 'Provides more functionality with less code', ] return Response({'message': 'Hello!', 'a_viewset': a_viewset}) # class HelloViewSet(viewsets.ViewSet): # serializer_class = serializers.HelloSerializer # # def list(self, request): # """ Return hello message viewset""" # a_viewset = [ # 'This is return', # 'This is return', # 'This is return', # 'This is return' # ] # # return Response({'message':'Hello viewset return', 'a_viewset':a_viewset}) def create(self, request): """ Create User""" serializer = self.serializer_class(data=request.data) if serializer.is_valid(): name=serializer.validated_data.get('name') message = f'Hello {name}' return Response({'Message':message}) else: return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) def retrieve(self, request, pk=None): """Handle getting an object by its ID""" return Response({'http_method': 'GET'}) def update(self, request, pk=None): """Handle updating an object""" return Response({'http_method': 'PUT'}) def partial_update(self, request, pk=None): """Handle updating part of an object""" return Response({'http_method': 'PATCH'}) def destroy(self, request, pk=None): """Handle removing an object""" return Response({'http_method': 'DELETE'}) class UserProfileViewSet(viewsets.ModelViewSet): """Handle creating, creating and updating profiles""" serializer_class = serializers.UserProfileSerializer queryset = models.UserProfile.objects.all() authentication_classes = (TokenAuthentication,) permission_classes = (permissions.UpdateOwnPermissions,) filter_backends = (filters.SearchFilter,) search_fields = ('name', 'email',) class UserLoginApiView(ObtainAuthToken): """Handle creating user authentication tokens""" renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES class UserProfileFeedViewSet(viewsets.ModelViewSet):
"""Handle creating, reading and updating user profile""" authentication_classes = (TokenAuthentication,) serializer_class = serializers.ProfileFeedItemSerializer queryset = models.ProfileFeedItem.objects.all() permission_classes = (permissions.UpdateOwnStatus,IsAuthenticated) def perform_create(self, serializer): """set the user profile to logged in user""" serializer.save(user_profile=self.request.user)
string_conversion_test.go
// Copyright 2015 go-swagger maintainers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package middleware import ( "errors" "reflect" "strings" "testing" "time" "github.com/go-swagger/go-swagger/spec" "github.com/go-swagger/go-swagger/strfmt" "github.com/go-swagger/go-swagger/swag" "github.com/stretchr/testify/assert" ) var evaluatesAsTrue = []string{"true", "1", "yes", "ok", "y", "on", "selected", "checked", "t", "enabled"} type unmarshallerSlice []string func (u *unmarshallerSlice) UnmarshalText(data []byte) error { if len(data) == 0 { return errors.New("an error") } *u = strings.Split(string(data), ",") return nil } type SomeOperationParams struct { Name string ID int64 Confirmed bool Age int Visits int32 Count int16 Seq int8 UID uint64 UAge uint UVisits uint32 UCount uint16 USeq uint8 Score float32 Rate float64 Timestamp strfmt.DateTime Birthdate strfmt.Date LastFailure *strfmt.DateTime Unsupported struct{} Tags []string Prefs []int32 Categories unmarshallerSlice } func FloatParamTest(t *testing.T, fName, pName, format string, val reflect.Value, defVal, expectedDef interface{}, actual func() interface{}) { fld := val.FieldByName(pName) binder := &untypedParamBinder{ parameter: spec.QueryParam(pName).Typed("number", "double").WithDefault(defVal), Name: pName, } err := binder.setFieldValue(fld, defVal, "5", true) assert.NoError(t, err) assert.EqualValues(t, 5, actual()) err = binder.setFieldValue(fld, defVal, "", true) assert.NoError(t, err) assert.EqualValues(t, expectedDef, actual()) err = binder.setFieldValue(fld, defVal, "yada", true) assert.Error(t, err) } func IntParamTest(t *testing.T, pName string, val reflect.Value, defVal, expectedDef interface{}, actual func() interface{}) { fld := val.FieldByName(pName) binder := &untypedParamBinder{ parameter: spec.QueryParam(pName).Typed("integer", "int64").WithDefault(defVal), Name: pName, } err := binder.setFieldValue(fld, defVal, "5", true) assert.NoError(t, err) assert.EqualValues(t, 5, actual()) err = binder.setFieldValue(fld, defVal, "", true) assert.NoError(t, err) assert.EqualValues(t, expectedDef, actual()) err = binder.setFieldValue(fld, defVal, "yada", true) assert.Error(t, err) } func TestParamBinding(t *testing.T) { actual := new(SomeOperationParams) val := reflect.ValueOf(actual).Elem() pName := "Name" fld := val.FieldByName(pName) binder := &untypedParamBinder{ parameter: spec.QueryParam(pName).Typed("string", "").WithDefault("some-name"), Name: pName, } err := binder.setFieldValue(fld, "some-name", "the name value", true) assert.NoError(t, err) assert.Equal(t, "the name value", actual.Name) err = binder.setFieldValue(fld, "some-name", "", true) assert.NoError(t, err) assert.Equal(t, "some-name", actual.Name) IntParamTest(t, "ID", val, 1, 1, func() interface{} { return actual.ID }) IntParamTest(t, "ID", val, nil, 0, func() interface{} { return actual.ID }) IntParamTest(t, "Age", val, 1, 1, func() interface{} { return actual.Age }) IntParamTest(t, "Age", val, nil, 0, func() interface{} { return actual.Age }) IntParamTest(t, "Visits", val, 1, 1, func() interface{} { return actual.Visits }) IntParamTest(t, "Visits", val, nil, 0, func() interface{} { return actual.Visits }) IntParamTest(t, "Count", val, 1, 1, func() interface{} { return actual.Count }) IntParamTest(t, "Count", val, nil, 0, func() interface{} { return actual.Count }) IntParamTest(t, "Seq", val, 1, 1, func() interface{} { return actual.Seq }) IntParamTest(t, "Seq", val, nil, 0, func() interface{} { return actual.Seq }) IntParamTest(t, "UID", val, uint64(1), 1, func() interface{} { return actual.UID }) IntParamTest(t, "UID", val, uint64(0), 0, func() interface{} { return actual.UID }) IntParamTest(t, "UAge", val, uint(1), 1, func() interface{} { return actual.UAge }) IntParamTest(t, "UAge", val, nil, 0, func() interface{} { return actual.UAge }) IntParamTest(t, "UVisits", val, uint32(1), 1, func() interface{} { return actual.UVisits }) IntParamTest(t, "UVisits", val, nil, 0, func() interface{} { return actual.UVisits }) IntParamTest(t, "UCount", val, uint16(1), 1, func() interface{} { return actual.UCount }) IntParamTest(t, "UCount", val, nil, 0, func() interface{} { return actual.UCount }) IntParamTest(t, "USeq", val, uint8(1), 1, func() interface{} { return actual.USeq }) IntParamTest(t, "USeq", val, nil, 0, func() interface{} { return actual.USeq }) FloatParamTest(t, "score", "Score", "float", val, 1.0, 1, func() interface{} { return actual.Score }) FloatParamTest(t, "score", "Score", "float", val, nil, 0, func() interface{} { return actual.Score }) FloatParamTest(t, "rate", "Rate", "double", val, 1.0, 1, func() interface{} { return actual.Rate }) FloatParamTest(t, "rate", "Rate", "double", val, nil, 0, func() interface{} { return actual.Rate }) pName = "Confirmed" confirmedField := val.FieldByName(pName) binder = &untypedParamBinder{ parameter: spec.QueryParam(pName).Typed("boolean", "").WithDefault(true), Name: pName, } for _, tv := range evaluatesAsTrue { err = binder.setFieldValue(confirmedField, true, tv, true) assert.NoError(t, err) assert.True(t, actual.Confirmed) } err = binder.setFieldValue(confirmedField, true, "", true) assert.NoError(t, err) assert.True(t, actual.Confirmed) err = binder.setFieldValue(confirmedField, true, "0", true) assert.NoError(t, err) assert.False(t, actual.Confirmed) pName = "Timestamp" timeField := val.FieldByName(pName) dt := strfmt.DateTime{Time: time.Date(2014, 3, 19, 2, 9, 0, 0, time.UTC)} binder = &untypedParamBinder{ parameter: spec.QueryParam(pName).Typed("string", "date-time").WithDefault(dt), Name: pName, } exp := strfmt.DateTime{Time: time.Date(2014, 5, 14, 2, 9, 0, 0, time.UTC)} err = binder.setFieldValue(timeField, dt, exp.String(), true) assert.NoError(t, err) assert.Equal(t, exp, actual.Timestamp) err = binder.setFieldValue(timeField, dt, "", true) assert.NoError(t, err) assert.Equal(t, dt, actual.Timestamp) err = binder.setFieldValue(timeField, dt, "yada", true) assert.Error(t, err) ddt := strfmt.Date{Time: time.Date(2014, 3, 19, 0, 0, 0, 0, time.UTC)} pName = "Birthdate" dateField := val.FieldByName(pName) binder = &untypedParamBinder{ parameter: spec.QueryParam(pName).Typed("string", "date").WithDefault(ddt), Name: pName, } expd := strfmt.Date{Time: time.Date(2014, 5, 14, 0, 0, 0, 0, time.UTC)} err = binder.setFieldValue(dateField, ddt, expd.String(), true) assert.NoError(t, err) assert.Equal(t, expd, actual.Birthdate) err = binder.setFieldValue(dateField, ddt, "", true) assert.NoError(t, err) assert.Equal(t, ddt, actual.Birthdate) err = binder.setFieldValue(dateField, ddt, "yada", true) assert.Error(t, err) fdt := &strfmt.DateTime{Time: time.Date(2014, 3, 19, 2, 9, 0, 0, time.UTC)} pName = "LastFailure" ftimeField := val.FieldByName(pName) binder = &untypedParamBinder{
} fexp := &strfmt.DateTime{Time: time.Date(2014, 5, 14, 2, 9, 0, 0, time.UTC)} err = binder.setFieldValue(ftimeField, fdt, fexp.String(), true) assert.NoError(t, err) assert.Equal(t, fexp, actual.LastFailure) err = binder.setFieldValue(ftimeField, fdt, "", true) assert.NoError(t, err) assert.Equal(t, fdt, actual.LastFailure) err = binder.setFieldValue(ftimeField, fdt, "", true) assert.NoError(t, err) assert.Equal(t, fdt, actual.LastFailure) actual.LastFailure = nil err = binder.setFieldValue(ftimeField, fdt, "yada", true) assert.Error(t, err) assert.Nil(t, actual.LastFailure) pName = "Unsupported" unsupportedField := val.FieldByName(pName) binder = &untypedParamBinder{ parameter: spec.QueryParam(pName).Typed("string", ""), Name: pName, } err = binder.setFieldValue(unsupportedField, nil, "", true) assert.Error(t, err) } func TestSliceConversion(t *testing.T) { actual := new(SomeOperationParams) val := reflect.ValueOf(actual).Elem() // prefsField := val.FieldByName("Prefs") // cData := "yada,2,3" // _, _, err := readFormattedSliceFieldValue("Prefs", prefsField, cData, "csv", nil) // assert.Error(t, err) sliced := []string{"some", "string", "values"} seps := map[string]string{"ssv": " ", "tsv": "\t", "pipes": "|", "csv": ",", "": ","} tagsField := val.FieldByName("Tags") for k, sep := range seps { binder := &untypedParamBinder{ Name: "Tags", parameter: spec.QueryParam("tags").CollectionOf(stringItems, k), } actual.Tags = nil cData := strings.Join(sliced, sep) tags, _, err := binder.readFormattedSliceFieldValue(cData, tagsField) assert.NoError(t, err) assert.Equal(t, sliced, tags) cData = strings.Join(sliced, " "+sep+" ") tags, _, err = binder.readFormattedSliceFieldValue(cData, tagsField) assert.NoError(t, err) assert.Equal(t, sliced, tags) tags, _, err = binder.readFormattedSliceFieldValue("", tagsField) assert.NoError(t, err) assert.Empty(t, tags) } assert.Nil(t, swag.SplitByFormat("yada", "multi")) assert.Nil(t, swag.SplitByFormat("", "")) categoriesField := val.FieldByName("Categories") binder := &untypedParamBinder{ Name: "Categories", parameter: spec.QueryParam("categories").CollectionOf(stringItems, "csv"), } cData := strings.Join(sliced, ",") categories, custom, err := binder.readFormattedSliceFieldValue(cData, categoriesField) assert.NoError(t, err) assert.EqualValues(t, sliced, actual.Categories) assert.True(t, custom) assert.Empty(t, categories) categories, custom, err = binder.readFormattedSliceFieldValue("", categoriesField) assert.Error(t, err) assert.True(t, custom) assert.Empty(t, categories) }
parameter: spec.QueryParam(pName).Typed("string", "date").WithDefault(fdt), Name: pName,
sqlite3.py
import io import sqlite3 def Reader( f, url, stream=False, tag=None ):
db = sqlite3.connect( url ) c = db.cursor() rows = c.execute("select * from wikipedia") return rows
__init__.py
"""This package contains interfaces and functionality to compute pair-wise document similarities within a corpus of documents. """ from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401 import logging __version__ = '3.5.0' class NullHandler(logging.Handler): """For python versions <= 2.6; same as `logging.NullHandler` in 2.7.""" def emit(self, record): pass logger = logging.getLogger('gensim') if len(logger.handlers) == 0: # To ensure reload() doesn't add another one
logger.addHandler(NullHandler())
styles.ts
import { css } from "@emotion/css"; import * as typography from "@klimadao/lib/theme/typography"; import * as common from "@klimadao/lib/theme/common"; import breakpoints from "@klimadao/lib/theme/breakpoints"; export const container = css` position: relative; padding: 3.2rem; background-color: var(--surface-02); display: flex; flex-direction: column; height: 100%; width: 100%; z-index: 3; gap: 2.4rem; max-height: 100vh; overflow-x: hidden; overflow-y: auto; #klima-logo { height: 2.8rem; width: auto; } .stack-04 { display: grid; gap: 0.4rem; } .stack-12 { display: grid; gap: 1.2rem; } .hr { height: 0.2rem; width: 100%; background-color: var(--surface-01); } .labelStack { display: grid;
} .navFooter { margin-top: auto; display: flex; flex-direction: column; gap: 3.2rem; } .navFooter .hr { grid-row: 1 / 1; grid-column: 1 / 4; } .navFooter_buttons { display: grid; width: 100%; grid-template-columns: repeat(4, 4.2rem); justify-content: center; gap: 1rem; ${breakpoints.desktop} { gap: 1rem; grid-template-columns: repeat(4, 4.6rem); } } .navFooter_button { ${common.iconButton}; min-height: 4.2rem; min-width: 4.2rem; ${breakpoints.desktop} { min-height: 4.6rem; min-width: 4.6rem; } } `; export const sidebarButton = css` ${typography.caption}; display: flex; align-items: center; gap: 1.6rem; padding: 0.4rem; border-radius: 0.8rem; width: 100%; span { color: var(--font-03); } .iconContainer { color: var(--font-02); display: flex; align-items: center; justify-content: center; height: 3.8rem; width: 3.8rem; background-color: var(--surface-01); border-radius: 0.6rem; } &:hover, &:focus { background-color: var(--surface-01); } &:hover span, &:focus span { color: var(--font-02); } &[data-active="true"] { background-color: var(--surface-01); border: 1px solid var(--surface-03); } &[data-active="true"] span { color: var(--font-01); } &[data-active="true"] .iconContainer { background-color: var(--klima-green); } &[data-disabled="true"] { opacity: 0.5; } `;
gap: 0.8rem;
subslice3.rs
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT #[kani::proof] fn main()
{ let slice = &[1, 2, 3][..]; if let [head, tail @ ..] = slice { assert!(head == &slice[0]); assert!(tail == &slice[1..]); } else { unreachable!(); } }
admin.rs
use crate::{models::event::Event, utils, utils::PostgresPool}; use serenity::{ framework::standard::{macros::command, Args, CommandResult}, model::channel::Message, prelude::Context, }; use std::time::Duration; #[command] /// Add scenarios to an event pub async fn add(ctx: &Context, msg: &Message) -> CommandResult { let data = ctx.data.read().await; let pool = data .get::<PostgresPool>() .expect("Expected PostgresPool in TypeMap."); let events = Event::find_by_archive(pool, false).await?; if events.is_empty() { msg.channel_id .say( &ctx.http, "There are no unarchived events. Please create one.", ) .await?; return Ok(()); } msg.channel_id .say( &ctx.http, utils::format_collection(&events.iter().map(|event| &event.name).collect()), ) .await?; let event; if let Some(e) = utils::pick_collection(ctx, msg, &events).await? { event = e; } else { return Ok(()); } msg.channel_id .say( &ctx.http, r#"Do you want to add individual scenarios or by set? 1.) Scenarios 2.) Set 3.) All "#, ) .await?; if let Some(choice) = &msg .author .await_reply(&ctx) .timeout(Duration::from_secs(utils::SELECTION_TIMEOUT)) .await { if choice.content == "1" { if let Some(set_id) = utils::pick_sets(ctx, msg).await? { let scenarios = sqlx::query!( r#" SELECT id, title FROM scenarios WHERE scenarios.set_id = $1 "#, set_id ) .fetch_all(pool) .await?; msg.channel_id .say( &ctx.http, utils::format_collection( &scenarios.iter().map(|scenario| &scenario.title).collect(), ), ) .await?; if let Some(scenario) = utils::pick_collection(ctx, msg, &scenarios).await? { let row_count = sqlx::query!( r#" INSERT INTO events_scenarios ( event_id, scenario_id ) VALUES ( $1, $2 ) "#, event.id, scenario.id ) .execute(pool) .await? .rows_affected(); msg.channel_id .say(&ctx.http, format!("{} scenarios added.", row_count)) .await?; } else { msg.channel_id.say(&ctx.http, "Not a valid choice.").await?; } } else { msg.channel_id.say(&ctx.http, "Not a valid index.").await?; } } else if choice.content == "2" { if let Some(set_id) = utils::pick_sets(ctx, msg).await? { let row_count = sqlx::query!( r#" INSERT INTO events_scenarios ( event_id, scenario_id ) SELECT $1, scenarios.id FROM scenarios WHERE scenarios.set_id = $2 AND scenarios.id NOT IN ( SELECT scenario_id FROM events_scenarios WHERE event_id = $1 ) "#, event.id, set_id ) .execute(pool) .await? .rows_affected(); msg.channel_id .say(&ctx.http, format!("{} scenarios added.", row_count)) .await?; } else { msg.channel_id.say(&ctx.http, "Not a valid index.").await?; } } else if choice.content == "3" { let row_count = sqlx::query!( r#" INSERT INTO events_scenarios ( event_id, scenario_id ) SELECT $1, scenarios.id FROM scenarios WHERE scenarios.id NOT IN ( SELECT scenario_id FROM events_scenarios WHERE event_id = $1 ) "#, event.id, ) .execute(pool) .await? .rows_affected(); msg.channel_id .say(&ctx.http, format!("{} scenarios added.", row_count)) .await?; } }; Ok(()) } #[command] /// Set event as active pub async fn
(ctx: &Context, msg: &Message) -> CommandResult { let data = ctx.data.read().await; let pool = data .get::<PostgresPool>() .expect("Expected PostgresPool in TypeMap."); let events = sqlx::query!( r#" SELECT id, name FROM events WHERE active = false AND archive = false "# ) .fetch_all(pool) .await?; msg.channel_id .say( &ctx.http, utils::format_collection(&events.iter().map(|event| &event.name).collect()), ) .await?; if let Some(event) = utils::pick_collection(ctx, msg, &events).await? { sqlx::query!( r#" UPDATE events SET active = false, updated_at = CURRENT_TIMESTAMP WHERE active = true "# ) .execute(pool) .await?; sqlx::query!( r#" UPDATE events SET active = true, updated_at = CURRENT_TIMESTAMP WHERE id = $1"#, event.id ) .execute(pool) .await?; msg.channel_id .say( &ctx.http, format!("'{}' is now the active event.", event.name), ) .await?; } Ok(()) } #[command] /// Archive an event pub async fn archive(ctx: &Context, msg: &Message) -> CommandResult { let data = ctx.data.read().await; let pool = data .get::<PostgresPool>() .expect("Expected PostgresPool in TypeMap."); let events = Event::find_by_archive(pool, false).await?; if events.is_empty() { msg.channel_id .say( &ctx.http, "There are no unarchived events. Please create one.", ) .await?; return Ok(()); } msg.channel_id .say( &ctx.http, utils::format_collection(&events.iter().map(|event| &event.name).collect()), ) .await?; if let Some(event) = utils::pick_collection(ctx, msg, &events).await? { // make any active event inactive when archiving sqlx::query!( r#" UPDATE events SET active = false, archive = true, updated_at = CURRENT_TIMESTAMP WHERE id = $1 "#, event.id ) .execute(pool) .await?; msg.channel_id .say(&ctx.http, format!("'{}' is now archived.", event.name)) .await?; } else { msg.channel_id .say(&ctx.http, "Could not archive event.") .await?; } Ok(()) } #[command] /// Load challenges for scenarios already registered for the event pub async fn cload(ctx: &Context, msg: &Message) -> CommandResult { let data = ctx.data.read().await; let pool = data .get::<PostgresPool>() .expect("Expected PostgresPool in TypeMap."); let events = Event::find_by_archive(pool, false).await?; if events.is_empty() { msg.channel_id .say( &ctx.http, "There are no unarchived events. Please create one.", ) .await?; return Ok(()); } msg.channel_id .say( &ctx.http, utils::format_collection(&events.iter().map(|event| &event.name).collect()), ) .await?; let event = match utils::pick_collection(ctx, msg, &events).await? { Some(event) => event, None => return Ok(()), }; let rows_count = sqlx::query!( r#" INSERT INTO challenges_events ( event_id, challenge_id ) SELECT $1, challenges.id FROM events_scenarios, challenges WHERE events_scenarios.event_id = $1 AND challenges.scenario_id = events_scenarios.scenario_id ON CONFLICT DO NOTHING "#, event.id ) .execute(pool) .await? .rows_affected(); msg.channel_id .say(&ctx.http, format!("{} challenges added.", rows_count)) .await?; Ok(()) } #[command] #[num_args(1)] /// Create a new event pub async fn create(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult { let name = args.single_quoted::<String>().unwrap_or("".to_string()); if name.is_empty() { msg.channel_id .say(&ctx.http, "Must specify a name: !event create <name>") .await?; return Ok(()); } let data = ctx.data.read().await; let pool = data .get::<PostgresPool>() .expect("Expected PostgresPool in TypeMap."); if let Ok(rows_created) = Event::create(pool, &name).await { // not sure it can ever go to the else clause, since any error inserting would return an // Error if rows_created > 0 { msg.channel_id .say(&ctx.http, format!("Created event '{}'", name)) .await?; } } else { msg.channel_id .say( &ctx.http, "Could not create an event by that name. It already exists.", ) .await?; } Ok(()) }
set
watch.go
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package apimachinery import ( "context" "fmt" "math/rand" "strconv" "time" v1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" cachetools "k8s.io/client-go/tools/cache" watchtools "k8s.io/client-go/tools/watch" "k8s.io/kubernetes/test/e2e/framework" admissionapi "k8s.io/pod-security-admission/api" "github.com/onsi/ginkgo" ) const ( watchConfigMapLabelKey = "watch-this-configmap" multipleWatchersLabelValueA = "multiple-watchers-A" multipleWatchersLabelValueB = "multiple-watchers-B" fromResourceVersionLabelValue = "from-resource-version" watchRestartedLabelValue = "watch-closed-and-restarted" toBeChangedLabelValue = "label-changed-and-restored" ) var _ = SIGDescribe("Watchers", func() { f := framework.NewDefaultFramework("watch") f.NamespacePodSecurityEnforceLevel = admissionapi.LevelPrivileged /* Release: v1.11 Testname: watch-configmaps-with-multiple-watchers Description: Ensure that multiple watchers are able to receive all add, update, and delete notifications on configmaps that match a label selector and do not receive notifications for configmaps which do not match that label selector. */ framework.ConformanceIt("should observe add, update, and delete watch notifications on configmaps", func() { c := f.ClientSet ns := f.Namespace.Name ginkgo.By("creating a watch on configmaps with label A") watchA, err := watchConfigMaps(f, "", multipleWatchersLabelValueA) framework.ExpectNoError(err, "failed to create a watch on configmaps with label: %s", multipleWatchersLabelValueA) ginkgo.By("creating a watch on configmaps with label B") watchB, err := watchConfigMaps(f, "", multipleWatchersLabelValueB) framework.ExpectNoError(err, "failed to create a watch on configmaps with label: %s", multipleWatchersLabelValueB) ginkgo.By("creating a watch on configmaps with label A or B") watchAB, err := watchConfigMaps(f, "", multipleWatchersLabelValueA, multipleWatchersLabelValueB) framework.ExpectNoError(err, "failed to create a watch on configmaps with label %s or %s", multipleWatchersLabelValueA, multipleWatchersLabelValueB) testConfigMapA := &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: "e2e-watch-test-configmap-a", Labels: map[string]string{ watchConfigMapLabelKey: multipleWatchersLabelValueA, }, }, } testConfigMapB := &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: "e2e-watch-test-configmap-b", Labels: map[string]string{ watchConfigMapLabelKey: multipleWatchersLabelValueB, }, }, } ginkgo.By("creating a configmap with label A and ensuring the correct watchers observe the notification") testConfigMapA, err = c.CoreV1().ConfigMaps(ns).Create(context.TODO(), testConfigMapA, metav1.CreateOptions{}) framework.ExpectNoError(err, "failed to create a configmap with label %s in namespace: %s", multipleWatchersLabelValueA, ns) expectEvent(watchA, watch.Added, testConfigMapA) expectEvent(watchAB, watch.Added, testConfigMapA) ginkgo.By("modifying configmap A and ensuring the correct watchers observe the notification") testConfigMapA, err = updateConfigMap(c, ns, testConfigMapA.GetName(), func(cm *v1.ConfigMap) { setConfigMapData(cm, "mutation", "1") }) framework.ExpectNoError(err, "failed to update configmap %s in namespace: %s", testConfigMapA.GetName(), ns) expectEvent(watchA, watch.Modified, testConfigMapA) expectEvent(watchAB, watch.Modified, testConfigMapA) ginkgo.By("modifying configmap A again and ensuring the correct watchers observe the notification") testConfigMapA, err = updateConfigMap(c, ns, testConfigMapA.GetName(), func(cm *v1.ConfigMap) { setConfigMapData(cm, "mutation", "2") }) framework.ExpectNoError(err, "failed to update configmap %s in namespace: %s", testConfigMapA.GetName(), ns) expectEvent(watchA, watch.Modified, testConfigMapA) expectEvent(watchAB, watch.Modified, testConfigMapA) ginkgo.By("deleting configmap A and ensuring the correct watchers observe the notification") err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMapA.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete configmap %s in namespace: %s", testConfigMapA.GetName(), ns) expectEvent(watchA, watch.Deleted, nil) expectEvent(watchAB, watch.Deleted, nil) ginkgo.By("creating a configmap with label B and ensuring the correct watchers observe the notification") testConfigMapB, err = c.CoreV1().ConfigMaps(ns).Create(context.TODO(), testConfigMapB, metav1.CreateOptions{}) framework.ExpectNoError(err, "failed to create configmap %s in namespace: %s", testConfigMapB, ns) expectEvent(watchB, watch.Added, testConfigMapB) expectEvent(watchAB, watch.Added, testConfigMapB) expectNoEvent(watchA, watch.Added, testConfigMapB) ginkgo.By("deleting configmap B and ensuring the correct watchers observe the notification") err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMapB.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete configmap %s in namespace: %s", testConfigMapB.GetName(), ns) expectEvent(watchB, watch.Deleted, nil) expectEvent(watchAB, watch.Deleted, nil) expectNoEvent(watchA, watch.Deleted, nil) }) /* Release: v1.11 Testname: watch-configmaps-from-resource-version Description: Ensure that a watch can be opened from a particular resource version in the past and only notifications happening after that resource version are observed. */ framework.ConformanceIt("should be able to start watching from a specific resource version", func() { c := f.ClientSet ns := f.Namespace.Name testConfigMap := &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: "e2e-watch-test-resource-version", Labels: map[string]string{ watchConfigMapLabelKey: fromResourceVersionLabelValue, }, }, } ginkgo.By("creating a new configmap") testConfigMap, err := c.CoreV1().ConfigMaps(ns).Create(context.TODO(), testConfigMap, metav1.CreateOptions{}) framework.ExpectNoError(err, "failed to create configmap %s in namespace: %s", testConfigMap.GetName(), ns) ginkgo.By("modifying the configmap once") testConfigMapFirstUpdate, err := updateConfigMap(c, ns, testConfigMap.GetName(), func(cm *v1.ConfigMap) { setConfigMapData(cm, "mutation", "1") }) framework.ExpectNoError(err, "failed to update configmap %s in namespace: %s", testConfigMap.GetName(), ns) ginkgo.By("modifying the configmap a second time") testConfigMapSecondUpdate, err := updateConfigMap(c, ns, testConfigMap.GetName(), func(cm *v1.ConfigMap) { setConfigMapData(cm, "mutation", "2") }) framework.ExpectNoError(err, "failed to update configmap %s in namespace %s a second time", testConfigMap.GetName(), ns) ginkgo.By("deleting the configmap") err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMap.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete configmap %s in namespace: %s", testConfigMap.GetName(), ns) ginkgo.By("creating a watch on configmaps from the resource version returned by the first update") testWatch, err := watchConfigMaps(f, testConfigMapFirstUpdate.ObjectMeta.ResourceVersion, fromResourceVersionLabelValue) framework.ExpectNoError(err, "failed to create a watch on configmaps from the resource version %s returned by the first update", testConfigMapFirstUpdate.ObjectMeta.ResourceVersion) ginkgo.By("Expecting to observe notifications for all changes to the configmap after the first update") expectEvent(testWatch, watch.Modified, testConfigMapSecondUpdate) expectEvent(testWatch, watch.Deleted, nil) }) /* Release: v1.11 Testname: watch-configmaps-closed-and-restarted Description: Ensure that a watch can be reopened from the last resource version observed by the previous watch, and it will continue delivering notifications from that point in time. */ framework.ConformanceIt("should be able to restart watching from the last resource version observed by the previous watch", func() { c := f.ClientSet ns := f.Namespace.Name configMapName := "e2e-watch-test-watch-closed" testConfigMap := &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: configMapName, Labels: map[string]string{ watchConfigMapLabelKey: watchRestartedLabelValue, }, }, } ginkgo.By("creating a watch on configmaps") testWatchBroken, err := watchConfigMaps(f, "", watchRestartedLabelValue) framework.ExpectNoError(err, "failed to create a watch on configmap with label: %s", watchRestartedLabelValue) ginkgo.By("creating a new configmap") testConfigMap, err = c.CoreV1().ConfigMaps(ns).Create(context.TODO(), testConfigMap, metav1.CreateOptions{}) framework.ExpectNoError(err, "failed to create configmap %s in namespace: %s", configMapName, ns) ginkgo.By("modifying the configmap once") _, err = updateConfigMap(c, ns, testConfigMap.GetName(), func(cm *v1.ConfigMap) { setConfigMapData(cm, "mutation", "1") }) framework.ExpectNoError(err, "failed to update configmap %s in namespace: %s", configMapName, ns) ginkgo.By("closing the watch once it receives two notifications") expectEvent(testWatchBroken, watch.Added, testConfigMap) lastEvent, ok := waitForEvent(testWatchBroken, watch.Modified, nil, 1*time.Minute) if !ok { framework.Failf("Timed out waiting for second watch notification") } testWatchBroken.Stop() ginkgo.By("modifying the configmap a second time, while the watch is closed") testConfigMapSecondUpdate, err := updateConfigMap(c, ns, testConfigMap.GetName(), func(cm *v1.ConfigMap) { setConfigMapData(cm, "mutation", "2") }) framework.ExpectNoError(err, "failed to update configmap %s in namespace %s a second time", configMapName, ns) ginkgo.By("creating a new watch on configmaps from the last resource version observed by the first watch") lastEventConfigMap, ok := lastEvent.Object.(*v1.ConfigMap) if !ok { framework.Failf("Expected last notification to refer to a configmap but got: %v", lastEvent) } testWatchRestarted, err := watchConfigMaps(f, lastEventConfigMap.ObjectMeta.ResourceVersion, watchRestartedLabelValue) framework.ExpectNoError(err, "failed to create a new watch on configmaps from the last resource version %s observed by the first watch", lastEventConfigMap.ObjectMeta.ResourceVersion) ginkgo.By("deleting the configmap") err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMap.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete configmap %s in namespace: %s", configMapName, ns) ginkgo.By("Expecting to observe notifications for all changes to the configmap since the first watch closed") expectEvent(testWatchRestarted, watch.Modified, testConfigMapSecondUpdate) expectEvent(testWatchRestarted, watch.Deleted, nil) }) /* Release: v1.11 Testname: watch-configmaps-label-changed Description: Ensure that a watched object stops meeting the requirements of a watch's selector, the watch will observe a delete, and will not observe notifications for that object until it meets the selector's requirements again. */
ns := f.Namespace.Name configMapName := "e2e-watch-test-label-changed" testConfigMap := &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: configMapName, Labels: map[string]string{ watchConfigMapLabelKey: toBeChangedLabelValue, }, }, } ginkgo.By("creating a watch on configmaps with a certain label") testWatch, err := watchConfigMaps(f, "", toBeChangedLabelValue) framework.ExpectNoError(err, "failed to create a watch on configmap with label: %s", toBeChangedLabelValue) ginkgo.By("creating a new configmap") testConfigMap, err = c.CoreV1().ConfigMaps(ns).Create(context.TODO(), testConfigMap, metav1.CreateOptions{}) framework.ExpectNoError(err, "failed to create configmap %s in namespace: %s", configMapName, ns) ginkgo.By("modifying the configmap once") testConfigMapFirstUpdate, err := updateConfigMap(c, ns, testConfigMap.GetName(), func(cm *v1.ConfigMap) { setConfigMapData(cm, "mutation", "1") }) framework.ExpectNoError(err, "failed to update configmap %s in namespace: %s", configMapName, ns) ginkgo.By("changing the label value of the configmap") _, err = updateConfigMap(c, ns, testConfigMap.GetName(), func(cm *v1.ConfigMap) { cm.ObjectMeta.Labels[watchConfigMapLabelKey] = "wrong-value" }) framework.ExpectNoError(err, "failed to update configmap %s in namespace %s by changing label value", configMapName, ns) ginkgo.By("Expecting to observe a delete notification for the watched object") expectEvent(testWatch, watch.Added, testConfigMap) expectEvent(testWatch, watch.Modified, testConfigMapFirstUpdate) expectEvent(testWatch, watch.Deleted, nil) ginkgo.By("modifying the configmap a second time") testConfigMapSecondUpdate, err := updateConfigMap(c, ns, testConfigMap.GetName(), func(cm *v1.ConfigMap) { setConfigMapData(cm, "mutation", "2") }) framework.ExpectNoError(err, "failed to update configmap %s in namespace %s a second time", configMapName, ns) ginkgo.By("Expecting not to observe a notification because the object no longer meets the selector's requirements") expectNoEvent(testWatch, watch.Modified, testConfigMapSecondUpdate) ginkgo.By("changing the label value of the configmap back") testConfigMapLabelRestored, err := updateConfigMap(c, ns, testConfigMap.GetName(), func(cm *v1.ConfigMap) { cm.ObjectMeta.Labels[watchConfigMapLabelKey] = toBeChangedLabelValue }) framework.ExpectNoError(err, "failed to update configmap %s in namespace %s by changing label value back", configMapName, ns) ginkgo.By("modifying the configmap a third time") testConfigMapThirdUpdate, err := updateConfigMap(c, ns, testConfigMap.GetName(), func(cm *v1.ConfigMap) { setConfigMapData(cm, "mutation", "3") }) framework.ExpectNoError(err, "failed to update configmap %s in namespace %s a third time", configMapName, ns) ginkgo.By("deleting the configmap") err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMap.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete configmap %s in namespace: %s", configMapName, ns) ginkgo.By("Expecting to observe an add notification for the watched object when the label value was restored") expectEvent(testWatch, watch.Added, testConfigMapLabelRestored) expectEvent(testWatch, watch.Modified, testConfigMapThirdUpdate) expectEvent(testWatch, watch.Deleted, nil) }) /* Release: v1.15 Testname: watch-consistency Description: Ensure that concurrent watches are consistent with each other by initiating an additional watch for events received from the first watch, initiated at the resource version of the event, and checking that all resource versions of all events match. Events are produced from writes on a background goroutine. */ framework.ConformanceIt("should receive events on concurrent watches in same order", func() { c := f.ClientSet ns := f.Namespace.Name iterations := 100 ginkgo.By("getting a starting resourceVersion") configmaps, err := c.CoreV1().ConfigMaps(ns).List(context.TODO(), metav1.ListOptions{}) framework.ExpectNoError(err, "Failed to list configmaps in the namespace %s", ns) resourceVersion := configmaps.ResourceVersion ginkgo.By("starting a background goroutine to produce watch events") donec := make(chan struct{}) stopc := make(chan struct{}) go func() { defer ginkgo.GinkgoRecover() defer close(donec) produceConfigMapEvents(f, stopc, 5*time.Millisecond) }() listWatcher := &cachetools.ListWatch{ WatchFunc: func(listOptions metav1.ListOptions) (watch.Interface, error) { return c.CoreV1().ConfigMaps(ns).Watch(context.TODO(), listOptions) }, } ginkgo.By("creating watches starting from each resource version of the events produced and verifying they all receive resource versions in the same order") wcs := []watch.Interface{} for i := 0; i < iterations; i++ { wc, err := watchtools.NewRetryWatcher(resourceVersion, listWatcher) framework.ExpectNoError(err, "Failed to watch configmaps in the namespace %s", ns) wcs = append(wcs, wc) resourceVersion = waitForNextConfigMapEvent(wcs[0]).ResourceVersion for _, wc := range wcs[1:] { e := waitForNextConfigMapEvent(wc) if resourceVersion != e.ResourceVersion { framework.Failf("resource version mismatch, expected %s but got %s", resourceVersion, e.ResourceVersion) } } } close(stopc) for _, wc := range wcs { wc.Stop() } <-donec }) }) func watchConfigMaps(f *framework.Framework, resourceVersion string, labels ...string) (watch.Interface, error) { c := f.ClientSet ns := f.Namespace.Name opts := metav1.ListOptions{ ResourceVersion: resourceVersion, LabelSelector: metav1.FormatLabelSelector(&metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { Key: watchConfigMapLabelKey, Operator: metav1.LabelSelectorOpIn, Values: labels, }, }, }), } return c.CoreV1().ConfigMaps(ns).Watch(context.TODO(), opts) } func int64ptr(i int) *int64 { i64 := int64(i) return &i64 } func setConfigMapData(cm *v1.ConfigMap, key, value string) { if cm.Data == nil { cm.Data = make(map[string]string) } cm.Data[key] = value } func expectEvent(w watch.Interface, eventType watch.EventType, object runtime.Object) { if event, ok := waitForEvent(w, eventType, object, 1*time.Minute); !ok { framework.Failf("Timed out waiting for expected watch notification: %v", event) } } func expectNoEvent(w watch.Interface, eventType watch.EventType, object runtime.Object) { if event, ok := waitForEvent(w, eventType, object, 10*time.Second); ok { framework.Failf("Unexpected watch notification observed: %v", event) } } func waitForEvent(w watch.Interface, expectType watch.EventType, expectObject runtime.Object, duration time.Duration) (watch.Event, bool) { stopTimer := time.NewTimer(duration) defer stopTimer.Stop() for { select { case actual, ok := <-w.ResultChan(): if ok { framework.Logf("Got : %v %v", actual.Type, actual.Object) } else { framework.Failf("Watch closed unexpectedly") } if expectType == actual.Type && (expectObject == nil || apiequality.Semantic.DeepEqual(expectObject, actual.Object)) { return actual, true } case <-stopTimer.C: expected := watch.Event{ Type: expectType, Object: expectObject, } return expected, false } } } func waitForNextConfigMapEvent(watch watch.Interface) *v1.ConfigMap { select { case event, ok := <-watch.ResultChan(): if !ok { framework.Failf("Watch closed unexpectedly") } if configMap, ok := event.Object.(*v1.ConfigMap); ok { return configMap } framework.Failf("expected config map, got %T", event.Object) case <-time.After(10 * time.Second): framework.Failf("timed out waiting for watch event") } return nil // should never happen } const ( createEvent = iota updateEvent deleteEvent ) func produceConfigMapEvents(f *framework.Framework, stopc <-chan struct{}, minWaitBetweenEvents time.Duration) { c := f.ClientSet ns := f.Namespace.Name name := func(i int) string { return fmt.Sprintf("cm-%d", i) } existing := []int{} tc := time.NewTicker(minWaitBetweenEvents) defer tc.Stop() i := 0 updates := 0 for range tc.C { op := rand.Intn(3) if len(existing) == 0 { op = createEvent } switch op { case createEvent: cm := &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: name(i), }, } _, err := c.CoreV1().ConfigMaps(ns).Create(context.TODO(), cm, metav1.CreateOptions{}) framework.ExpectNoError(err, "Failed to create configmap %s in namespace %s", cm.Name, ns) existing = append(existing, i) i++ case updateEvent: idx := rand.Intn(len(existing)) cm := &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: name(existing[idx]), Labels: map[string]string{ "mutated": strconv.Itoa(updates), }, }, } _, err := c.CoreV1().ConfigMaps(ns).Update(context.TODO(), cm, metav1.UpdateOptions{}) framework.ExpectNoError(err, "Failed to update configmap %s in namespace %s", cm.Name, ns) updates++ case deleteEvent: idx := rand.Intn(len(existing)) err := c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), name(existing[idx]), metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete configmap %s in namespace %s", name(existing[idx]), ns) existing = append(existing[:idx], existing[idx+1:]...) default: framework.Failf("Unsupported event operation: %d", op) } select { case <-stopc: return default: } } }
framework.ConformanceIt("should observe an object deletion if it stops meeting the requirements of the selector", func() { c := f.ClientSet
lib.rs
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // 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. /*! Bindings to libuv, along with the default implementation of `std::rt::rtio`. UV types consist of the event loop (Loop), Watchers, Requests and Callbacks. Watchers and Requests encapsulate pointers to uv *handles*, which have subtyping relationships with each other. This subtyping is reflected in the bindings with explicit or implicit coercions. For example, an upcast from TcpWatcher to StreamWatcher is done with `tcp_watcher.as_stream()`. In other cases a callback on a specific type of watcher will be passed a watcher of a supertype. Currently all use of Request types (connect/write requests) are encapsulated in the bindings and don't need to be dealt with by the caller. # Safety note Due to the complex lifecycle of uv handles, as well as compiler bugs, this module is not memory safe and requires explicit memory management, via `close` and `delete` methods. */ #![crate_id = "rustuv#0.11-pre"] #![license = "MIT/ASL2"] #![crate_type = "rlib"] #![crate_type = "dylib"] #![feature(macro_rules)] #![deny(unused_result, unused_must_use)] #![allow(visible_private_types)] #[cfg(test)] extern crate green; #[cfg(test)] extern crate realrustuv = "rustuv"; extern crate libc; use std::cast; use std::fmt; use std::io::IoError; use std::io; use libc::{c_int, c_void}; use std::ptr::null; use std::ptr; use std::rt::local::Local; use std::rt::rtio; use std::rt::task::{BlockedTask, Task}; use std::str::raw::from_c_str; use std::str; use std::task; pub use self::async::AsyncWatcher; pub use self::file::{FsRequest, FileWatcher}; pub use self::idle::IdleWatcher; pub use self::net::{TcpWatcher, TcpListener, TcpAcceptor, UdpWatcher}; pub use self::pipe::{PipeWatcher, PipeListener, PipeAcceptor}; pub use self::process::Process; pub use self::signal::SignalWatcher; pub use self::timer::TimerWatcher; pub use self::tty::TtyWatcher; // Run tests with libgreen instead of libnative. // // FIXME: This egregiously hacks around starting the test runner in a different // threading mode than the default by reaching into the auto-generated // '__test' module. #[cfg(test)] #[start] fn start(argc: int, argv: **u8) -> int { green::start(argc, argv, event_loop, __test::main) } mod macros; mod access; mod homing; mod queue; mod rc; pub mod uvio; pub mod uvll; pub mod file; pub mod net; pub mod idle; pub mod timer; pub mod async; pub mod addrinfo; pub mod process; pub mod pipe; pub mod tty; pub mod signal; pub mod stream; /// Creates a new event loop which is powered by libuv /// /// This function is used in tandem with libgreen's `PoolConfig` type as a value /// for the `event_loop_factory` field. Using this function as the event loop /// factory will power programs with libuv and enable green threading. /// /// # Example /// /// ``` /// extern crate rustuv; /// extern crate green; /// /// #[start] /// fn start(argc: int, argv: **u8) -> int { /// green::start(argc, argv, rustuv::event_loop, main) /// } /// /// fn main() { /// // this code is running inside of a green task powered by libuv /// } /// ``` pub fn event_loop() -> ~rtio::EventLoop:Send { box uvio::UvEventLoop::new() as ~rtio::EventLoop:Send } /// A type that wraps a uv handle pub trait UvHandle<T> { fn uv_handle(&self) -> *T; fn uv_loop(&self) -> Loop { Loop::wrap(unsafe { uvll::get_loop_for_uv_handle(self.uv_handle()) }) } // FIXME(#8888) dummy self fn alloc(_: Option<Self>, ty: uvll::uv_handle_type) -> *T { unsafe { let handle = uvll::malloc_handle(ty); assert!(!handle.is_null()); handle as *T } } unsafe fn from_uv_handle<'a>(h: &'a *T) -> &'a mut Self { cast::transmute(uvll::get_data_for_uv_handle(*h)) } fn install(~self) -> ~Self { unsafe { let myptr = cast::transmute::<&~Self, &*u8>(&self); uvll::set_data_for_uv_handle(self.uv_handle(), *myptr); } self } fn close_async_(&mut self) { // we used malloc to allocate all handles, so we must always have at // least a callback to free all the handles we allocated. extern fn close_cb(handle: *uvll::uv_handle_t) { unsafe { uvll::free_handle(handle) } } unsafe { uvll::set_data_for_uv_handle(self.uv_handle(), null::<()>()); uvll::uv_close(self.uv_handle() as *uvll::uv_handle_t, close_cb) } } fn close(&mut self) { let mut slot = None; unsafe { uvll::uv_close(self.uv_handle() as *uvll::uv_handle_t, close_cb); uvll::set_data_for_uv_handle(self.uv_handle(), ptr::null::<()>()); wait_until_woken_after(&mut slot, &self.uv_loop(), || { uvll::set_data_for_uv_handle(self.uv_handle(), &slot); }) } extern fn close_cb(handle: *uvll::uv_handle_t) { unsafe { let data = uvll::get_data_for_uv_handle(handle); uvll::free_handle(handle); if data == ptr::null() { return } let slot: &mut Option<BlockedTask> = cast::transmute(data); wakeup(slot); } } } } pub struct ForbidSwitch { msg: &'static str, io: uint, } impl ForbidSwitch { fn new(s: &'static str) -> ForbidSwitch { ForbidSwitch { msg: s, io: homing::local_id(), } } } impl Drop for ForbidSwitch { fn drop(&mut self) { assert!(self.io == homing::local_id(), "didnt want a scheduler switch: {}", self.msg); } } pub struct ForbidUnwind { msg: &'static str, failing_before: bool, } impl ForbidUnwind { fn new(s: &'static str) -> ForbidUnwind
} impl Drop for ForbidUnwind { fn drop(&mut self) { assert!(self.failing_before == task::failing(), "didnt want an unwind during: {}", self.msg); } } fn wait_until_woken_after(slot: *mut Option<BlockedTask>, loop_: &Loop, f: ||) { let _f = ForbidUnwind::new("wait_until_woken_after"); unsafe { assert!((*slot).is_none()); let task: ~Task = Local::take(); loop_.modify_blockers(1); task.deschedule(1, |task| { *slot = Some(task); f(); Ok(()) }); loop_.modify_blockers(-1); } } fn wakeup(slot: &mut Option<BlockedTask>) { assert!(slot.is_some()); let _ = slot.take_unwrap().wake().map(|t| t.reawaken()); } pub struct Request { pub handle: *uvll::uv_req_t, defused: bool, } impl Request { pub fn new(ty: uvll::uv_req_type) -> Request { unsafe { let handle = uvll::malloc_req(ty); uvll::set_data_for_req(handle, null::<()>()); Request::wrap(handle) } } pub fn wrap(handle: *uvll::uv_req_t) -> Request { Request { handle: handle, defused: false } } pub fn set_data<T>(&self, t: *T) { unsafe { uvll::set_data_for_req(self.handle, t) } } pub unsafe fn get_data<T>(&self) -> &'static mut T { let data = uvll::get_data_for_req(self.handle); assert!(data != null()); cast::transmute(data) } // This function should be used when the request handle has been given to an // underlying uv function, and the uv function has succeeded. This means // that uv will at some point invoke the callback, and in the meantime we // can't deallocate the handle because libuv could be using it. // // This is still a problem in blocking situations due to linked failure. In // the connection callback the handle should be re-wrapped with the `wrap` // function to ensure its destruction. pub fn defuse(&mut self) { self.defused = true; } } impl Drop for Request { fn drop(&mut self) { if !self.defused { unsafe { uvll::free_req(self.handle) } } } } /// FIXME: Loop(*handle) is buggy with destructors. Normal structs /// with dtors may not be destructured, but tuple structs can, /// but the results are not correct. pub struct Loop { handle: *uvll::uv_loop_t } impl Loop { pub fn new() -> Loop { let handle = unsafe { uvll::loop_new() }; assert!(handle.is_not_null()); unsafe { uvll::set_data_for_uv_loop(handle, 0 as *c_void) } Loop::wrap(handle) } pub fn wrap(handle: *uvll::uv_loop_t) -> Loop { Loop { handle: handle } } pub fn run(&mut self) { assert_eq!(unsafe { uvll::uv_run(self.handle, uvll::RUN_DEFAULT) }, 0); } pub fn close(&mut self) { unsafe { uvll::uv_loop_delete(self.handle) }; } // The 'data' field of the uv_loop_t is used to count the number of tasks // that are currently blocked waiting for I/O to complete. fn modify_blockers(&self, amt: uint) { unsafe { let cur = uvll::get_data_for_uv_loop(self.handle) as uint; uvll::set_data_for_uv_loop(self.handle, (cur + amt) as *c_void) } } fn get_blockers(&self) -> uint { unsafe { uvll::get_data_for_uv_loop(self.handle) as uint } } } // FIXME: Need to define the error constants like EOF so they can be // compared to the UvError type pub struct UvError(c_int); impl UvError { pub fn name(&self) -> ~str { unsafe { let inner = match self { &UvError(a) => a }; let name_str = uvll::uv_err_name(inner); assert!(name_str.is_not_null()); from_c_str(name_str) } } pub fn desc(&self) -> ~str { unsafe { let inner = match self { &UvError(a) => a }; let desc_str = uvll::uv_strerror(inner); assert!(desc_str.is_not_null()); from_c_str(desc_str) } } pub fn is_eof(&self) -> bool { let UvError(handle) = *self; handle == uvll::EOF } } impl fmt::Show for UvError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f.buf, "{}: {}", self.name(), self.desc()) } } #[test] fn error_smoke_test() { let err: UvError = UvError(uvll::EOF); assert_eq!(err.to_str(), "EOF: end of file".to_owned()); } pub fn uv_error_to_io_error(uverr: UvError) -> IoError { unsafe { // Importing error constants // uv error descriptions are static let UvError(errcode) = uverr; let c_desc = uvll::uv_strerror(errcode); let desc = str::raw::c_str_to_static_slice(c_desc); let kind = match errcode { uvll::UNKNOWN => io::OtherIoError, uvll::OK => io::OtherIoError, uvll::EOF => io::EndOfFile, uvll::EACCES => io::PermissionDenied, uvll::ECONNREFUSED => io::ConnectionRefused, uvll::ECONNRESET => io::ConnectionReset, uvll::ENOTCONN => io::NotConnected, uvll::ENOENT => io::FileNotFound, uvll::EPIPE => io::BrokenPipe, uvll::ECONNABORTED => io::ConnectionAborted, uvll::EADDRNOTAVAIL => io::ConnectionRefused, uvll::ECANCELED => io::TimedOut, err => { uvdebug!("uverr.code {}", err as int); // FIXME: Need to map remaining uv error types io::OtherIoError } }; IoError { kind: kind, desc: desc, detail: None } } } /// Given a uv error code, convert a callback status to a UvError pub fn status_to_maybe_uv_error(status: c_int) -> Option<UvError> { if status >= 0 { None } else { Some(UvError(status)) } } pub fn status_to_io_result(status: c_int) -> Result<(), IoError> { if status >= 0 {Ok(())} else {Err(uv_error_to_io_error(UvError(status)))} } /// The uv buffer type pub type Buf = uvll::uv_buf_t; pub fn empty_buf() -> Buf { uvll::uv_buf_t { base: null(), len: 0, } } /// Borrow a slice to a Buf pub fn slice_to_uv_buf(v: &[u8]) -> Buf { let data = v.as_ptr(); uvll::uv_buf_t { base: data, len: v.len() as uvll::uv_buf_len_t } } // This function is full of lies! #[cfg(test)] fn local_loop() -> &'static mut uvio::UvIoFactory { unsafe { cast::transmute({ let mut task = Local::borrow(None::<Task>); let mut io = task.local_io().unwrap(); let (_vtable, uvio): (uint, &'static mut uvio::UvIoFactory) = cast::transmute(io.get()); uvio }) } } #[cfg(test)] mod test { use std::cast::transmute; use std::unstable::run_in_bare_thread; use super::{slice_to_uv_buf, Loop}; #[test] fn test_slice_to_uv_buf() { let slice = [0, .. 20]; let buf = slice_to_uv_buf(slice); assert_eq!(buf.len, 20); unsafe { let base = transmute::<*u8, *mut u8>(buf.base); (*base) = 1; (*base.offset(1)) = 2; } assert!(slice[0] == 1); assert!(slice[1] == 2); } #[test] fn loop_smoke_test() { run_in_bare_thread(proc() { let mut loop_ = Loop::new(); loop_.run(); loop_.close(); }); } }
{ ForbidUnwind { msg: s, failing_before: task::failing(), } }
mod.rs
//Copyright 2020 WHTCORPS INC ALL RIGHTS RESERVED. APACHE 2.0 COMMUNITY EDITION SL // AUTHORS: WHITFORD LEDER // Licensed under the Apache License, Version 2.0 (the "License"); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software distributed // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. mod range; pub mod ranges_iter; pub mod scanner; pub mod test_fixture; pub use self::range::*; pub type Result<T> = std::result::Result<T, crate::error::StorageError>; pub type OwnedKvPair = (Vec<u8>, Vec<u8>); /// The abstract storage interface. The table scan and index scan executor relies on a `Storage` /// implementation to provide source data. pub trait Storage: Send { type Statistics; fn begin_scan( &mut self, is_backward_scan: bool, is_key_only: bool, range: IntervalRange, ) -> Result<()>; fn scan_next(&mut self) -> Result<Option<OwnedKvPair>>; // TODO: Use const generics. // TODO: Use reference is better. fn get(&mut self, is_key_only: bool, range: PointRange) -> Result<Option<OwnedKvPair>>; fn met_uncacheable_data(&self) -> Option<bool>; fn collect_statistics(&mut self, dest: &mut Self::Statistics); } impl<T: Storage + ?Sized> Storage for Box<T> { type Statistics = T::Statistics; fn begin_scan( &mut self, is_backward_scan: bool, is_key_only: bool, range: IntervalRange, ) -> Result<()> { (**self).begin_scan(is_backward_scan, is_key_only, range) } fn scan_next(&mut self) -> Result<Option<OwnedKvPair>> { (**self).scan_next() } fn get(&mut self, is_key_only: bool, range: PointRange) -> Result<Option<OwnedKvPair>> { (**self).get(is_key_only, range) } fn met_uncacheable_data(&self) -> Option<bool>
fn collect_statistics(&mut self, dest: &mut Self::Statistics) { (**self).collect_statistics(dest); } }
{ (**self).met_uncacheable_data() }
main.d.ts
export * from "./generate"; export * from "./httpsServerOptions"; export * from "./install"; export * from "./verify";
export * from "./uninstall";
main.go
// Copyright 2014 The kv Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Command kvaudit verifies kv databases. Installation: $ go get github.com/cznic/kv/kvaudit Usage: kvaudit [-d] [-f key] [-l key] [-max n] [-s] [-v] file Options: -b analyze allocated/free blocks sizes vs FLT buckets -d dump file to stdout in cdbmake[2] format even for empty -f and -l. -f key dump from key, first existing if empty -l key dump to key, last existing if empty -max maximum number of errors to report. Default 10. The actual number of reported errors, if any, may be less because many errors do not allow to reliably continue the audit. -s List DB statistics -v List every error in addition to the overall one. Arguments: file For example: ~/foo/bar.db Implementation Notes The performed verification is described at [0]. This tool was hacked quickly to assist with resolving [1]. Known Issues In this first release there's no file locking checked or enforced. The auditing process will _not_ write to the DB, so this cannot introduce a DB corruption (it's opened in R/O mode anyway). However, if the DB is opened and updated by another process, the reported errors may be caused only by the updates. In other words, to use this initial version properly, you must manually ensure that the audited database is not being updated by any other process. Links Referenced from above: [0]: http://godoc.org/github.com/cznic/lldb#Allocator.Verify [1]: https://code.google.com/p/camlistore/issues/detail?id=216 [2]: http://cr.yp.to/cdb/cdbmake.html */ package main import ( "bufio" "bytes" "flag" "fmt" "io" "io/ioutil" "os" "github.com/cznic/exp/lldb" ) func
(s string, a ...interface{}) { fmt.Fprintf(os.Stderr, s, a...) } func null(s string, a ...interface{}) {} func main() { oBuckets := flag.Bool("b", false, "show FLT buckets analysis") oDump := flag.Bool("d", false, "send a cdbmake formatted dump to stdout even if -f and -l is empty") oFirst := flag.String("f", "", "first key to dump (if non empty)") oLast := flag.String("l", "", "last key to dump (if non empty)") oMax := flag.Uint("max", 10, "errors reported limit.") oStat := flag.Bool("s", false, "show DB stats.") oVerbose := flag.Bool("v", false, "verbose mode.") flag.Parse() if flag.NArg() != 1 { fmt.Fprintln(os.Stderr, "Need exactly one file argument") os.Exit(1) } if *oStat { *oVerbose = true } r := rep if !*oVerbose { r = null } if err := main0(flag.Arg(0), int(*oMax), r, *oStat, *oFirst, *oLast, *oDump, *oBuckets); err != nil { fmt.Fprintf(os.Stderr, "kvaudit: %v\n", err) os.Exit(1) } } func main0(fn string, oMax int, w func(s string, a ...interface{}), oStat bool, first, last string, dump bool, oBuckets bool) error { f, err := os.Open(fn) // O_RDONLY if err != nil { return err } defer f.Close() bits, err := ioutil.TempFile("", "kvaudit-") if err != nil { return err } defer func() { nm := bits.Name() bits.Close() os.Remove(nm) }() a, err := lldb.NewAllocator(lldb.NewInnerFiler(lldb.NewSimpleFileFiler(f), 16), &lldb.Options{}) if err != nil { return err } cnt := 0 var stats lldb.AllocStats err = a.Verify(lldb.NewSimpleFileFiler(bits), func(err error) bool { cnt++ w("%d: %v\n", cnt, err) return cnt < oMax }, &stats) if err != nil { return err } if oStat { w("Handles %10d // total valid handles in use\n", stats.Handles) w("Compression %10d // number of compressed blocks\n", stats.Compression) w("TotalAtoms %10d // total number of atoms == AllocAtoms + FreeAtoms\n", stats.TotalAtoms) w("AllocBytes %10d // bytes allocated (after decompression, if/where used)\n", stats.AllocBytes) w("AllocAtoms %10d // atoms allocated/used, including relocation atoms\n", stats.AllocAtoms) w("Relocations %10d // number of relocated used blocks\n", stats.Relocations) w("FreeAtoms %10d // atoms unused\n", stats.FreeAtoms) } if oBuckets { var alloc, free [14]int64 sizes := [14]int64{1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 4112} for atoms, cnt := range stats.AllocMap { if atoms >= 4096 { alloc[13] += cnt continue } for i := range sizes { if sizes[i+1] > atoms { alloc[i] += cnt break } } } for atoms, cnt := range stats.FreeMap { if atoms > 4096 { free[13] += cnt continue } for i := range sizes { if sizes[i+1] > atoms { free[i] += cnt break } } } w("Alloc blocks\n") for i, v := range alloc { w("%4d: %10d\n", sizes[i], v) } w("Free blocks\n") for i, v := range free { w("%4d: %10d\n", sizes[i], v) } } if !(first != "" || last != "" || dump) { return nil } t, err := lldb.OpenBTree(a, nil, 1) if err != nil { return err } dw := bufio.NewWriter(os.Stdout) defer dw.Flush() var e *lldb.BTreeEnumerator switch { case first != "": e, _, err = t.Seek([]byte(first)) default: e, err = t.SeekFirst() } if err != nil { if err == io.EOF { err = nil } return err } blast := []byte(last) sep := []byte("->") for { k, v, err := e.Next() if err != nil { if err == io.EOF { err = nil } return err } dw.WriteString(fmt.Sprintf("+%d,%d:", len(k), len(v))) dw.Write(k) dw.Write(sep) dw.Write(v) dw.WriteByte('\n') if len(blast) != 0 && bytes.Compare(k, blast) >= 0 { break } } return nil }
rep
monolog.py
# /usr/bin/python # -*- coding: utf-8 -*- """ MongoDB logger module """ import datetime import logging import os import json import inspect import random from typing import Optional from pymongo import MongoClient class MongoLogger: """ MongoDB logger class.\n """ LEVELS = {'crit': 50, 'err': 40, 'warn': 30, 'info': 20, 'debug': 10} def __init__(self, collection_name='default_logger', pid='', config_file="monolog.json"): self._pid = pid if self._pid == '': self._generate_pid() self.config = self._get_merged_config(config_file) self._current_level = self.config["currentLevel"] self._collection = collection_name self._std_logger_duplicate = self.config.get("stdLoggerDuplicate", True) self._mongo_logger_duplicate = self.config.get("mongoLoggerDuplicate", True) if self._mongo_logger_duplicate: self._mongo_cli = MongoClient(self.config["connection"]["serv"], self.config["connection"]["port"], username=self.config["connection"]["username"], password=self.config["connection"]["password"], authSource=self.config["connection"]["authSource"], authMechanism=self.config["connection"]["authMechanism"]) self._db = self._mongo_cli[self.config["connection"]["dataBase"]] self._node = self.config["node"] else: self._mongo_cli = None self._db = None self._node = None try: self._std_logger = self._build_std_logger() except Exception as ex_error: print(f"MongoLogger error. ex_error: {ex_error}.") self._std_logger = None self._std_logger_duplicate = False def _get_merged_config(self, config_file: str) -> dict: """ Find and merge configs.\n config.local.json takes precedence over config.json """ _local_config_file_name = f'{".".join(config_file.split(".")[:-1])}.local.{config_file.split(".")[-1]}' _config = {} if _config_path := self._find_config(config_file): _config = json.load(open(_config_path)) if _local_config_path := self._find_config(_local_config_file_name): _config = self._merge_configs(_config, json.load(open(_local_config_path))) return _config def _merge_configs(self, first_dict: dict, second_dict: dict) -> dict: """ Merge second_dict on first_dict.\n """ out = {} for key in first_dict.keys(): out[key] = first_dict[key] if key in second_dict: if isinstance(second_dict[key], dict): out[key] = self._merge_configs(first_dict[key], second_dict[key]) else: out[key] = second_dict[key] for key in second_dict.keys(): if key not in first_dict: out[key] = second_dict[key] return out @staticmethod def _find_config(config_file_name: str) -> Optional[str]: """ Find config file.\n Will check current_dir, current_dir/config, ../current_dir/config.\n config.local.json takes precedence over config.json """ if os.path.exists(config_file_name): return config_file_name _path_config = os.path.join("config", config_file_name) if os.path.exists(_path_config): return _path_config _upper_current_dir = os.path.split(os.getcwd())[0] _path_config = os.path.join(_upper_current_dir, "config", config_file_name) if os.path.exists(_path_config): return _path_config return None def _generate_pid(self): """ Generate process id.\n """ self._pid = f"{random.randrange(1000, 9999)}_{datetime.datetime.now().strftime('%Y%m%d%H%M%S%f')}" def set_pid(self, pid): """ Set session(process) id.\n """ self._pid = pid def get_pid(self): """ Get current session(process) id.\n """ return self._pid def _build_std_logger(self): """ Make std logger.\n """ logger = logging.getLogger(self._collection) _log_format = "[%(levelname)-8s][%(asctime)s][%(module)-10s]%(message)s" logger.setLevel(self.LEVELS[self._current_level]) logger.addHandler(self._get_file_handler(_log_format)) logger.addHandler(self._get_stream_handler(_log_format)) return logger def _get_file_handler(self, _log_format): """ Make file handler for std logger.\n """ file_handler = logging.FileHandler(f"{self._collection}.log") file_handler.setFormatter(logging.Formatter(_log_format)) return file_handler @staticmethod def _get_stream_handler(_log_format): """ Make console handler for std logger.\n """ stream_handler = logging.StreamHandler() stream_handler.setFormatter(logging.Formatter(_log_format)) return stream_handler def _emit(self, level: str, msg: str, data: dict): """ Emit log message :param level: message level :param msg: critical message :param data: dump dict :return: None """ current_frame = inspect.currentframe() emit_func = current_frame.f_back.f_back.f_code.co_name if self._std_logger_duplicate: self._emit_std_logger(emit_func, level, msg, data) if self._mongo_logger_duplicate: self._emit_mongo(emit_func, level, msg, data) def _emit_std_logger(self, emit_func: str, level: str, msg: str, data: dict): """ Emit msg to std logger.\n :param emit_func: emitter function :param level: message level :param msg: critical message :param data: dump dict :return: None """ try: self._std_logger.log(self.LEVELS[level], "[%s][%s] %s %s.", emit_func, self._pid, msg, data) except UnicodeEncodeError: dump_data = json.dumps(data) self._std_logger.log(self.LEVELS[level], "[%s][%s][%s] %s %s.", level, emit_func, self._pid, msg, dump_data) def _emit_mongo(self, emit_func: str, level: str, msg: str, data: dict): """ Emit msg to mongo.\n :param emit_func: emitter function :param level: message level :param msg: critical message :param data: dump dict :return: None """ try: collection = self._db[datetime.datetime.now().strftime(self._collection)] data["function"] = emit_func var = { "created": datetime.datetime.now(), "node": self._node, "ssid": self._pid, "raddr": "", "level": level, "msg": msg, "dump": data } collection.insert_one(var) except Exception as ex_error: if self._std_logger: self._std_logger.critical("MongoLogger Critical error. %s dump: [%s][%s] %s %s.", ex_error, level, self._pid, msg, data) else: print("MongoLogger Critical error. %s dump: [%s][%s] %s %s.", ex_error, level, self._pid, msg, data) def critical(self, msg: str, data=None) -> None: """ Critical message. :param msg: critical message :param data: dump dict :return: None """ if data is None: data = {} traceback = list(map(lambda x: {"function": x.function, "lineno": x.lineno}, inspect.stack())) data["traceback"] = traceback self._emit('crit', msg, data) def error(self, msg: str, data=None) -> None: """ Error message. :param msg: error message :param data: dump dict :return: None """ if data is None: data = {} self._emit('err', msg, data) def
(self, msg: str, data=None) -> None: """ Warning message. :param msg: warning message :param data: dump dict :return: None """ if data is None: data = {} self._emit('warn', msg, data) def info(self, msg: str, data=None) -> None: """ Info message. :param msg: info message :param data: dump dict :return: None """ if data is None: data = {} self._emit('info', msg, data) def debug(self, msg: str, data=None) -> None: """ Debug message. :param msg: debug message :param data: dump dict :return: None """ if data is None: data = {} self._emit('debug', msg, data)
warning
serializable_device.py
# Copyright 2019 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Device object for converting from device specification protos""" from typing import (Any, Callable, cast, Dict, Iterable, Optional, List, Set, Tuple, Type, TYPE_CHECKING, FrozenSet) from cirq import circuits, devices from cirq.google import serializable_gate_set from cirq.google.api import v2 from cirq.value import Duration
import cirq class _GateDefinition: """Class for keeping track of gate definitions within SerializableDevice""" def __init__( self, duration: 'cirq.DURATION_LIKE', target_set: Set[Tuple['cirq.Qid', ...]], number_of_qubits: int, is_permutation: bool, can_serialize_predicate: Callable[['cirq.Operation'], bool] = lambda x: True, ): self.duration = Duration(duration) self.target_set = target_set self.is_permutation = is_permutation self.number_of_qubits = number_of_qubits self.can_serialize_predicate = can_serialize_predicate # Compute the set of all qubits in all target sets. self.flattened_qubits = { q for qubit_tuple in target_set for q in qubit_tuple } def with_can_serialize_predicate( self, can_serialize_predicate: Callable[['cirq.Operation'], bool] ) -> '_GateDefinition': """Creates a new _GateDefintion as a copy of the existing definition but with a new with_can_serialize_predicate. This is useful if multiple definitions exist for the same gate, but with different conditions. An example is if gates at certain angles of a gate take longer or are not allowed. """ return _GateDefinition( self.duration, self.target_set, self.number_of_qubits, self.is_permutation, can_serialize_predicate, ) def __eq__(self, other): if not isinstance(other, self.__class__): return NotImplemented return self.__dict__ == other.__dict__ class SerializableDevice(devices.Device): """Device object generated from a device specification proto. Given a device specification proto and a gate_set to translate the serialized gate_ids to cirq Gates, this will generate a Device that can verify operations and circuits for the hardware specified by the device. Expected usage is through constructing this class through a proto using the static function call from_proto(). This class only supports GridQubits and NamedQubits. NamedQubits with names that conflict (such as "4_3") may be converted to GridQubits on deserialization. """ def __init__( self, qubits: List['cirq.Qid'], gate_definitions: Dict[Type['cirq.Gate'], List[_GateDefinition]]): """Constructor for SerializableDevice using python objects. Note that the preferred method of constructing this object is through the static from_proto() call. Args: qubits: A list of valid Qid for the device. gate_definitions: Maps cirq gates to device properties for that gate. """ self.qubits = qubits self.gate_definitions = gate_definitions def qubit_set(self) -> FrozenSet['cirq.Qid']: return frozenset(self.qubits) @classmethod def from_proto( cls, proto: v2.device_pb2.DeviceSpecification, gate_sets: Iterable[serializable_gate_set.SerializableGateSet] ) -> 'SerializableDevice': """ Args: proto: A proto describing the qubits on the device, as well as the supported gates and timing information. gate_set: A SerializableGateSet that can translate the gate_ids into cirq Gates. """ # Store target sets, since they are refered to by name later allowed_targets: Dict[str, Set[Tuple['cirq.Qid', ...]]] = {} permutation_ids: Set[str] = set() for ts in proto.valid_targets: allowed_targets[ts.name] = cls._create_target_set(ts) if ts.target_ordering == v2.device_pb2.TargetSet.SUBSET_PERMUTATION: permutation_ids.add(ts.name) # Store gate definitions from proto gate_definitions: Dict[str, _GateDefinition] = {} for gs in proto.valid_gate_sets: for gate_def in gs.valid_gates: # Combine all valid targets in the gate's listed target sets gate_target_set = { target for ts_name in gate_def.valid_targets for target in allowed_targets[ts_name] } which_are_permutations = [ t in permutation_ids for t in gate_def.valid_targets ] is_permutation = any(which_are_permutations) if is_permutation: if not all(which_are_permutations): raise NotImplementedError( f'Id {gate_def.id} in {gs.name} mixes ' 'SUBSET_PERMUTATION with other types which is not ' 'currently allowed.') gate_definitions[gate_def.id] = _GateDefinition( duration=Duration(picos=gate_def.gate_duration_picos), target_set=gate_target_set, is_permutation=is_permutation, number_of_qubits=gate_def.number_of_qubits) # Loop through serializers and map gate_definitions to type gates_by_type: Dict[Type['cirq.Gate'], List[_GateDefinition]] = {} for gate_set in gate_sets: for gate_type in gate_set.supported_gate_types(): for serializer in gate_set.serializers[gate_type]: gate_id = serializer.serialized_gate_id if gate_id not in gate_definitions: raise ValueError( f'Serializer has {gate_id} which is not supported ' 'by the device specification') if gate_type not in gates_by_type: gates_by_type[gate_type] = [] gate_def = gate_definitions[ gate_id].with_can_serialize_predicate( serializer.can_serialize_predicate) gates_by_type[gate_type].append(gate_def) return SerializableDevice( qubits=[cls._qid_from_str(q) for q in proto.valid_qubits], gate_definitions=gates_by_type, ) @staticmethod def _qid_from_str(id_str: str) -> 'cirq.Qid': """Translates a qubit id string info cirq.Qid objects. Tries to translate to GridQubit if possible (e.g. '4_3'), otherwise falls back to using NamedQubit. """ try: return v2.grid_qubit_from_proto_id(id_str) except ValueError: return v2.named_qubit_from_proto_id(id_str) @classmethod def _create_target_set(cls, ts: v2.device_pb2.TargetSet ) -> Set[Tuple['cirq.Qid', ...]]: """Transform a TargetSet proto into a set of qubit tuples""" target_set = set() for target in ts.targets: qid_tuple = tuple(cls._qid_from_str(q) for q in target.ids) target_set.add(qid_tuple) if ts.target_ordering == v2.device_pb2.TargetSet.SYMMETRIC: target_set.add(qid_tuple[::-1]) return target_set def __str__(self) -> str: # If all qubits are grid qubits, render an appropriate text diagram. if all(isinstance(q, devices.GridQubit) for q in self.qubits): diagram = circuits.TextDiagramDrawer() qubits = cast(List['cirq.GridQubit'], self.qubits) # Don't print out extras newlines if the row/col doesn't start at 0 min_col = min(q.col for q in qubits) min_row = min(q.row for q in qubits) for q in qubits: diagram.write(q.col - min_col, q.row - min_row, str(q)) # Find pairs that are connected by two-qubit gates. Pair = Tuple['cirq.GridQubit', 'cirq.GridQubit'] pairs = { cast(Pair, pair) for gate_defs in self.gate_definitions.values() for gate_def in gate_defs if gate_def.number_of_qubits == 2 for pair in gate_def.target_set if len(pair) == 2 } # Draw lines between connected pairs. Limit to horizontal/vertical # lines since that is all the diagram drawer can handle. for q1, q2 in sorted(pairs): if q1.row == q2.row or q1.col == q2.col: diagram.grid_line(q1.col - min_col, q1.row - min_row, q2.col - min_col, q2.row - min_row) return diagram.render(horizontal_spacing=3, vertical_spacing=2, use_unicode_characters=True) return super().__str__() def _repr_pretty_(self, p: Any, cycle: bool) -> None: """Creates ASCII diagram for Jupyter, IPython, etc.""" # There should never be a cycle, but just in case use the default repr. p.text(repr(self) if cycle else str(self)) def _find_operation_type(self, op: 'cirq.Operation') -> Optional[_GateDefinition]: """Finds the type (or a compatible type) of an operation from within a dictionary with keys of Gate type. Returns: the value corresponding to that key or None if no type matches """ for type_key, gate_defs in self.gate_definitions.items(): if isinstance(op.gate, type_key): for gate_def in gate_defs: if gate_def.can_serialize_predicate(op): return gate_def return None def duration_of(self, operation: 'cirq.Operation') -> Duration: gate_def = self._find_operation_type(operation) if gate_def is None: raise ValueError( f'Operation {operation} does not have a known duration') return gate_def.duration def validate_operation(self, operation: 'cirq.Operation') -> None: for q in operation.qubits: if q not in self.qubits: raise ValueError('Qubit not on device: {!r}'.format(q)) gate_def = self._find_operation_type(operation) if gate_def is None: raise ValueError(f'{operation} is not a supported gate') req_num_qubits = gate_def.number_of_qubits if req_num_qubits > 0: if len(operation.qubits) != req_num_qubits: raise ValueError(f'{operation} has {len(operation.qubits)} ' f'qubits but expected {req_num_qubits}') if gate_def.is_permutation: # A permutation gate can have any combination of qubits if not gate_def.target_set: # All qubits are valid return if not all( q in gate_def.flattened_qubits for q in operation.qubits): raise ValueError( 'Operation does not use valid qubits: {operation}.') return if len(operation.qubits) > 1: # TODO: verify args. # Github issue: https://github.com/quantumlib/Cirq/issues/2964 if not gate_def.target_set: # All qubit combinations are valid return qubit_tuple = tuple(operation.qubits) if qubit_tuple not in gate_def.target_set: # Target is not within the target sets specified by the gate. raise ValueError( f'Operation does not use valid qubit target: {operation}.')
if TYPE_CHECKING:
zptrace_linux_arm64.go
// Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. package unix import "unsafe"
func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) } // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) }
// PtraceGetRegSetArm64 fetches the registers used by arm64 binaries.
join_defer.py
import typing from pg_sql import SqlId, SqlNumber, SqlObject, SqlString, sql_list from .format import format from .join_common import JoinTarget, Key, Structure from .join_key import KeyConsumer, TargetRefresh from .sql import SqlTableExpr from .sql_query import sync_query, upsert_query from .string import indent def create_refresh_function( id: str, structure: Structure, refresh: TargetRefresh, ): refresh_function = structure.refresh_function() refresh_table = structure.refresh_table() key_table = structure.key_table() refresh_sql = refresh.sql(f"TABLE {key_table}", None) yield f""" CREATE FUNCTION {refresh_function} () RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN -- analyze ANALYZE {refresh_table}; -- refresh {indent(str(refresh_sql), 2)} -- clear refresh DELETE FROM {refresh_table}; RETURN NULL; END; $$ """.strip() yield f""" COMMENT ON FUNCTION {refresh_function} IS {SqlString(f'Refresh {id}')} """.strip() def create_setup_function( structure: Structure, id: str, key: Key, target: JoinTarget, ): key_table = structure.key_table() refresh_constraint = structure.refresh_constraint() refresh_function = structure.refresh_function() refresh_table = structure.refresh_table() setup_function = structure.setup_function() yield f""" CREATE FUNCTION {setup_function} () RETURNS void LANGUAGE plpgsql AS $$ BEGIN IF to_regclass({SqlString(str(refresh_table))}) IS NOT NULL THEN RETURN; END IF; CREATE TEMP TABLE {key_table} ON COMMIT DELETE ROWS AS {key.definition} WITH NO DATA; ALTER TABLE {key_table} ADD PRIMARY KEY ({sql_list([SqlId(name) for name in key.names])}); CREATE TEMP TABLE {refresh_table} ( ) ON COMMIT DELETE ROWS; CREATE CONSTRAINT TRIGGER {refresh_constraint} AFTER INSERT ON {refresh_table} DEFERRABLE INITIALLY DEFERRED FOR EACH ROW EXECUTE PROCEDURE {refresh_function}(); END $$ """.strip() yield f""" COMMENT ON FUNCTION {setup_function} IS {SqlString(f"Set up temp tables for {id}")} """.strip() class DeferredKeys(KeyConsumer): def __init__(self, key: typing.List[str], structure: Structure): self._key = key self._structure = structure def
( self, key_query: str, table_id: str, exprs: typing.List[SqlTableExpr] = [], last_expr: typing.Optional[str] = None, ): setup_function = self._structure.setup_function() refresh_table = self._structure.refresh_table() query = upsert_query( columns=self._key, key=self._key, query=key_query, target=self._structure.key_table(), ) for expr in reversed(exprs): query.prepend(expr) if last_expr is not None: query.append(SqlId("_other"), last_expr) return f""" PERFORM {setup_function}(); {query}; INSERT INTO {refresh_table} SELECT WHERE NOT EXISTS (TABLE {refresh_table}); """.strip()
sql
builtin.py
import collections import csv import datetime import grp import os import stat import optparse import pwd import StringIO import sys from pysh.shell.pycmd import register_pycmd from pysh.shell.pycmd import pycmd from pysh.shell.pycmd import IOType from pysh.shell.table import PyshTable, CreateTableFromIterableRows # TODO(yunabe): Writes tests for all commands. def file_to_array(f): return map(lambda line: line.rstrip('\r\n'), f.readlines()) class OptionParser(optparse.OptionParser): def exit(self, status=0, msg=None): if msg: sys.stderr.write(msg) raise Exception('OptionParser exit.') class Permission(int): def __init__(self, val): int.__init__(self, val) def __str__(self): return ''.join((self.__to_rwx(self >> 6), self.__to_rwx(self >> 3), self.__to_rwx(self >> 0))) def __to_rwx(self, rwx): result = ['-'] * 3 if rwx & (1 << 2): result[0] = 'r' if rwx & (1 << 1): result[1] = 'w' if rwx & (1 << 0): result[2] = 'x' return ''.join(result) @pycmd(name='echo', inType=IOType.No) def pycmd_echo(args, input, options): line = [] for arg in args[1:]: if not isinstance(arg, basestring) and ( isinstance(arg, collections.Iterable)): if line: yield ' '.join(line) line = [] for e in arg: yield e else: line.append(str(arg)) if line: yield ' '.join(line) @pycmd(name='map') def pycmd_map(args, input, options): assert len(args) == 2 if isinstance(input, file): input = file_to_array(input) f = args[1] assert callable(f) return (f(x) for x in input) @pycmd(name='filter') def pycmd_filter(args, input, options): assert len(args) == 2 if isinstance(input, file): input = file_to_array(input) cond = args[1] assert callable(cond) for x in input: if cond(x): yield x @pycmd(name='reduce') def pycmd_reduce(args, input, options): assert len(args) == 2 if isinstance(input, file): input = file_to_array(input) f = args[1] assert callable(f) return [reduce(f, input)] def create_pyls_row(path, stats, fulltime): file_type = '?' if stat.S_ISDIR(stats.st_mode): file_type = 'd' elif stat.S_ISBLK(stats.st_mode): file_type = 'b' elif stat.S_ISLNK(stats.st_mode): file_type = 'l' elif stat.S_ISSOCK(stats.st_mode): file_type = 's' elif stat.S_ISFIFO(stats.st_mode): file_type = 'p' elif stat.S_ISCHR(stats.st_mode): file_type = 'c' elif stat.S_ISREG(stats.st_mode): file_type = '-' user = pwd.getpwuid(stats.st_uid).pw_name group = grp.getgrgid(stats.st_gid).gr_name permission = stats.st_mode & 0777 st_mtime = stats.st_mtime if not fulltime: st_mtime = int(st_mtime) st_atime = stats.st_atime if not fulltime: st_atime = int(st_atime) mtime = datetime.datetime.fromtimestamp(st_mtime) atime = datetime.datetime.fromtimestamp(st_atime) return (file_type, Permission(permission), user, group, mtime, atime, path) pyls_option_parser = OptionParser() pyls_option_parser.add_option( '-d', '--directory', dest='dir', action='store_true', help=('list directory entries instead of contents, and do not ' 'dereference symbolic links')) pyls_option_parser.add_option( '--fulltime', dest='fulltime', action='store_true', help=('like -l --time-style=full-iso')) @pycmd(name='pyls') def
(args, input, options): opt, args = pyls_option_parser.parse_args(args) args = args[1:] if not args: args = [os.getcwd()] def generator(): for arg in args: stats = os.lstat(arg) if stat.S_ISDIR(stats.st_mode) and not opt.dir: names = os.listdir(arg) names = filter(lambda name: not name.startswith('.'), names) for name in names: joined = os.path.join(arg, name) stats = os.lstat(joined) yield create_pyls_row(joined, stats, opt.fulltime) else: yield create_pyls_row(arg, stats, opt.fulltime) return PyshTable(('type', 'mode', 'user', 'group', 'mtime', 'atime', 'path'), generator()) @pycmd(name='select') def pycmd_where(args, input, options): assert len(args) == 2 table = CreateTableFromIterableRows(input) return table.select(args[1], options.globals(), options.locals()) @pycmd(name='where') def pycmd_where(args, input, options): assert len(args) == 2 table = CreateTableFromIterableRows(input) return table.where(args[1], options.globals(), options.locals()) @pycmd(name='orderby') def pycmd_orderby(args, input, options): assert len(args) == 2 or len(args) == 3 table = CreateTableFromIterableRows(input) asc = True if len(args) == 3: args2 = args[2].lower() if args2 == 'desc': asc = False elif args2 != 'asc': raise Exception('args[2] must be desc or asc.') return table.orderby(args[1], asc, options.globals(), options.locals()) @pycmd(name='tocsv') def pycmd_tocsv(args, input, options): table = CreateTableFromIterableRows(input) io = StringIO.StringIO() w = csv.writer(io) w.writerow(table.columns) for row in table: w.writerow(row.values()) return io.getvalue().split('\r\n')[:-1] @pycmd(name='fromcsv') def pycmd_fromcsv(args, input, options): reader = csv.reader(input) table = None it = iter(reader) try: row0 = it.next() except StopIteration: return None return PyshTable(tuple(row0), it) @pycmd(name='cd', inType=IOType.No, outType=IOType.No) def pycmd_cd(args, input, options): assert len(args) == 2 or len(args) == 1 if len(args) == 2: dir = args[1] else: dir = os.environ.get('HOME', '') if dir: os.chdir(dir) return ()
pycmd_pyls
test_rdict.py
from rpython.translator.translator import TranslationContext from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rtyper import rint from rpython.rtyper.lltypesystem import rdict, rstr from rpython.rtyper.test.tool import BaseRtypingTest from rpython.rlib.objectmodel import r_dict from rpython.rlib.rarithmetic import r_int, r_uint, r_longlong, r_ulonglong import py py.log.setconsumer("rtyper", py.log.STDOUT) def not_really_random(): """A random-ish generator, which also generates nice patterns from time to time. Could be useful to detect problems associated with specific usage patterns.""" import random x = random.random() print 'random seed: %r' % (x,) for i in range(12000): r = 3.4 + i/20000.0 x = r*x - x*x assert 0 <= x < 4 yield x class BaseTestRDict(BaseRtypingTest): def test_dict_creation(self): def createdict(i): d = self.newdict() d['hello'] = i return d['hello'] res = self.interpret(createdict, [42]) assert res == 42 def test_dict_getitem_setitem(self): def func(i): d = self.newdict() d['hello'] = i d['world'] = i + 1 return d['hello'] * d['world'] res = self.interpret(func, [6]) assert res == 42 def test_dict_getitem_keyerror(self): def func(i): d = self.newdict() d['hello'] = i try: return d['world'] except KeyError: return 0 res = self.interpret(func, [6]) assert res == 0 def test_dict_del_simple(self): def func(i): d = self.newdict() d['hello'] = i d['world'] = i + 1 del d['hello'] return len(d) res = self.interpret(func, [6]) assert res == 1 def test_dict_clear(self): def func(i): d = self.newdict() d['abc'] = i d['def'] = i+1 d.clear() d['ghi'] = i+2 return ('abc' not in d and 'def' not in d and d['ghi'] == i+2 and len(d) == 1) res = self.interpret(func, [7]) assert res == True def test_empty_strings(self): def func(i): d = self.newdict() d[''] = i del d[''] try: d[''] return 0 except KeyError: pass return 1 res = self.interpret(func, [6]) assert res == 1 def func(i): d = self.newdict() d[''] = i del d[''] d[''] = i + 1 return len(d) res = self.interpret(func, [6]) assert res == 1 def test_dict_bool(self): def func(i): if i: d = self.newdict() else: d = self.newdict() d[i] = i+1 if d: return i else: return i+1 assert self.interpret(func, [42]) == 43 assert self.interpret(func, [0]) == 0 def test_contains(self): def func(x, y): d = self.newdict() d[x] = x+1 return y in d assert self.interpret(func, [42, 0]) == False assert self.interpret(func, [42, 42]) == True def test_contains_2(self): d = self.newdict() d['5'] = None d['7'] = None def func(x): return chr(x) in d assert self.interpret(func, [ord('5')]) == True assert self.interpret(func, [ord('6')]) == False def func(n): return str(n) in d assert self.interpret(func, [512]) == False def test_dict_iteration(self): def func(i, j): d = self.newdict() d['hello'] = i d['world'] = j k = 1 for key in d: k = k * d[key] return k res = self.interpret(func, [6, 7]) assert res == 42 def test_dict_itermethods(self): def func(): d = self.newdict() d['hello'] = 6 d['world'] = 7 k1 = k2 = k3 = 1 for key in d.iterkeys(): k1 = k1 * d[key] for value in d.itervalues(): k2 = k2 * value for key, value in d.iteritems(): assert d[key] == value k3 = k3 * value return k1 + k2 + k3 res = self.interpret(func, []) assert res == 42 + 42 + 42 def test_dict_get(self): def func(): dic = self.newdict() x1 = dic.get('hi', 42) dic['blah'] = 1 # XXX this triggers type determination x2 = dic.get('blah', 2) return x1 * 10 + x2 res = self.interpret(func, ()) assert res == 421 def test_dict_get_empty(self): def func(): # this time without writing to the dict dic = self.newdict() x1 = dic.get('hi', 42) x2 = dic.get('blah', 2) return x1 * 10 + x2 res = self.interpret(func, ()) assert res == 422 def test_dict_setdefault(self): def f(): d = self.newdict() d.setdefault('a', 2) return d['a'] res = self.interpret(f, ()) assert res == 2 def f(): d = self.newdict() d.setdefault('a', 2) x = d.setdefault('a', -3) return x res = self.interpret(f, ()) assert res == 2 def test_dict_copy(self): def func(): # XXX this does not work if we use chars, only! dic = self.newdict() dic['ab'] = 1 dic['b'] = 2 d2 = dic.copy() ok = 1 for key in d2: if dic[key] != d2[key]: ok = 0 ok &= len(dic) == len(d2) d2['c'] = 3 ok &= len(dic) == len(d2) - 1 return ok res = self.interpret(func, ()) assert res == 1 def test_dict_update(self): def func(): dic = self.newdict() dic['ab'] = 1000 dic['b'] = 200 d2 = self.newdict() d2['b'] = 30 d2['cb'] = 4 dic.update(d2) ok = len(dic) == 3 sum = ok for key in dic: sum += dic[key] return sum res = self.interpret(func, ()) assert res == 1035 def test_dict_keys(self): def func(): dic = self.newdict() dic[' 4'] = 1000 dic[' 8'] = 200 keys = dic.keys() return ord(keys[0][1]) + ord(keys[1][1]) - 2*ord('0') + len(keys) res = self.interpret(func, ())#, view=True) assert res == 14 def test_list_dict(self): def func(): dic = self.newdict() dic[' 4'] = 1000 dic[' 8'] = 200 keys = list(dic) return ord(keys[0][1]) + ord(keys[1][1]) - 2*ord('0') + len(keys) res = self.interpret(func, ())#, view=True) assert res == 14 def test_dict_inst_keys(self): class Empty: pass class A(Empty): pass def func(): dic0 = self.newdict() dic0[Empty()] = 2 dic = self.newdict() dic[A()] = 1 dic[A()] = 2 keys = dic.keys() return (isinstance(keys[1], A))*2+(isinstance(keys[0],A)) res = self.interpret(func, []) assert res == 3 def test_dict_inst_iterkeys(self): class Empty: pass class A(Empty): pass def func(): dic0 = self.newdict() dic0[Empty()] = 2 dic = self.newdict() dic[A()] = 1 dic[A()] = 2 a = 0 for k in dic.iterkeys(): a += isinstance(k, A) return a res = self.interpret(func, []) assert res == 2 def test_dict_values(self): def func(): dic = self.newdict() dic[' 4'] = 1000 dic[' 8'] = 200 values = dic.values() return values[0] + values[1] + len(values) res = self.interpret(func, ()) assert res == 1202 def test_dict_inst_values(self): class A: pass def func(): dic = self.newdict() dic[1] = A() dic[2] = A() vals = dic.values() return (isinstance(vals[1], A))*2+(isinstance(vals[0],A)) res = self.interpret(func, []) assert res == 3 def
(self): class A: pass def func(): dic = self.newdict() dic[1] = A() dic[2] = A() a = 0 for v in dic.itervalues(): a += isinstance(v, A) return a res = self.interpret(func, []) assert res == 2 def test_dict_inst_items(self): class Empty: pass class A: pass class B(Empty): pass def func(): dic0 = self.newdict() dic0[Empty()] = A() dic = self.newdict() dic[B()] = A() dic[B()] = A() items = dic.items() b = 0 a = 0 for k, v in items: b += isinstance(k, B) a += isinstance(v, A) return 3*b+a res = self.interpret(func, []) assert res == 8 def test_dict_inst_iteritems(self): class Empty: pass class A: pass class B(Empty): pass def func(): dic0 = self.newdict() dic0[Empty()] = A() dic = self.newdict() dic[B()] = A() dic[B()] = A() b = 0 a = 0 for k, v in dic.iteritems(): b += isinstance(k, B) a += isinstance(v, A) return 3*b+a res = self.interpret(func, []) assert res == 8 def test_dict_items(self): def func(): dic = self.newdict() dic[' 4'] = 1000 dic[' 8'] = 200 items = dic.items() res = len(items) for key, value in items: res += ord(key[1]) - ord('0') + value return res res = self.interpret(func, ()) assert res == 1214 def test_dict_contains(self): def func(): dic = self.newdict() dic[' 4'] = 1000 dic[' 8'] = 200 return ' 4' in dic and ' 9' not in dic res = self.interpret(func, ()) assert res is True def test_dict_contains_with_constant_dict(self): dic = self.newdict() dic['4'] = 1000 dic['8'] = 200 def func(i): return chr(i) in dic res = self.interpret(func, [ord('4')]) assert res is True res = self.interpret(func, [1]) assert res is False def test_dict_or_none(self): class A: pass def negate(d): return not d def func(n): a = A() a.d = None if n > 0: a.d = self.newdict() a.d[str(n)] = 1 a.d["42"] = 2 del a.d["42"] return negate(a.d) res = self.interpret(func, [10]) assert res is False res = self.interpret(func, [0]) assert res is True res = self.interpret(func, [42]) assert res is True def test_int_dict(self): def func(a, b): dic = self.newdict() dic[12] = 34 dic[a] = 1000 return dic.get(b, -123) res = self.interpret(func, [12, 12]) assert res == 1000 res = self.interpret(func, [12, 13]) assert res == -123 res = self.interpret(func, [524, 12]) assert res == 34 res = self.interpret(func, [524, 524]) assert res == 1000 res = self.interpret(func, [524, 1036]) assert res == -123 def test_id_instances_keys(self): class A: pass class B(A): pass def f(): a = A() b = B() d = self.newdict() d[b] = 7 d[a] = 3 return len(d) + d[a] + d[b] res = self.interpret(f, []) assert res == 12 def test_captured_get(self): d = self.newdict() d[1] = 2 get = d.get def f(): return get(1, 3)+get(2, 4) res = self.interpret(f, []) assert res == 6 def g(h): return h(1, 3) def f(): return g(get) res = self.interpret(f, []) assert res == 2 def test_specific_obscure_bug(self): class A: pass class B: pass # unrelated kinds of instances def f(): lst = [A()] res1 = A() in lst d2 = self.newdict() d2[B()] = None d2[B()] = None return res1+len(d2) res = self.interpret(f, []) assert res == 2 def test_identity_hash_is_fast(self): class A(object): pass def f(): d = self.newdict() d[A()] = 1 return d t = TranslationContext() s = t.buildannotator().build_types(f, []) rtyper = t.buildrtyper() rtyper.specialize() r_dict = rtyper.getrepr(s) assert not hasattr(r_dict.lowleveltype.TO.entries.TO.OF, "f_hash") def test_tuple_dict(self): def f(i): d = self.newdict() d[(1, 4.5, (str(i), 2), 2)] = 4 d[(1, 4.5, (str(i), 2), 3)] = 6 return d[(1, 4.5, (str(i), 2), i)] res = self.interpret(f, [2]) assert res == f(2) def test_dict_of_dict(self): def f(n): d = self.newdict() d[5] = d d[6] = self.newdict() return len(d[n]) res = self.interpret(f, [5]) assert res == 2 res = self.interpret(f, [6]) assert res == 0 def test_cls_dict(self): class A(object): pass class B(A): pass def f(i): d = self.newdict() d[A] = 3 d[B] = 4 if i: cls = A else: cls = B return d[cls] res = self.interpret(f, [1]) assert res == 3 res = self.interpret(f, [0]) assert res == 4 def test_prebuilt_cls_dict(self): class A(object): pass class B(A): pass d = self.newdict() d[(A, 3)] = 3 d[(B, 0)] = 4 def f(i): if i: cls = A else: cls = B try: return d[cls, i] except KeyError: return -99 res = self.interpret(f, [0]) assert res == 4 res = self.interpret(f, [3]) assert res == 3 res = self.interpret(f, [10]) assert res == -99 def test_access_in_try(self): def f(d): try: return d[2] except ZeroDivisionError: return 42 return -1 def g(n): d = self.newdict() d[1] = n d[2] = 2*n return f(d) res = self.interpret(g, [3]) assert res == 6 def test_access_in_try_set(self): def f(d): try: d[2] = 77 except ZeroDivisionError: return 42 return -1 def g(n): d = self.newdict() d[1] = n f(d) return d[2] res = self.interpret(g, [3]) assert res == 77 def test_resize_during_iteration(self): def func(): d = self.newdict() d[5] = 1 d[6] = 2 d[7] = 3 try: for key, value in d.iteritems(): d[key^16] = value*2 except RuntimeError: pass total = 0 for key in d: total += key return total res = self.interpret(func, []) assert 5 + 6 + 7 <= res <= 5 + 6 + 7 + (5^16) + (6^16) + (7^16) def test_change_during_iteration(self): def func(): d = self.newdict() d['a'] = 1 d['b'] = 2 for key in d: d[key] = 42 return d['a'] assert self.interpret(func, []) == 42 def test_dict_of_floats(self): d = self.newdict() d[3.0] = 42 d[3.1] = 43 d[3.2] = 44 d[3.3] = 45 d[3.4] = 46 def fn(f): return d[f] res = self.interpret(fn, [3.0]) assert res == 42 def test_dict_of_r_uint(self): for r_t in [r_uint, r_longlong, r_ulonglong]: if r_t is r_int: continue # for 64-bit platforms: skip r_longlong d = self.newdict() d[r_t(2)] = 3 d[r_t(4)] = 5 def fn(x, y): d[r_t(x)] = 123 return d[r_t(y)] res = self.interpret(fn, [4, 2]) assert res == 3 res = self.interpret(fn, [3, 3]) assert res == 123 def test_dict_popitem(self): def func(): d = self.newdict() d[5] = 2 d[6] = 3 k1, v1 = d.popitem() assert len(d) == 1 k2, v2 = d.popitem() try: d.popitem() except KeyError: pass else: assert 0, "should have raised KeyError" assert len(d) == 0 return k1*1000 + v1*100 + k2*10 + v2 res = self.interpret(func, []) assert res in [5263, 6352] def test_dict_pop(self): def f(n, default): d = self.newdict() d[2] = 3 d[4] = 5 if default == -1: try: x = d.pop(n) except KeyError: x = -1 else: x = d.pop(n, default) return x * 10 + len(d) res = self.interpret(f, [2, -1]) assert res == 31 res = self.interpret(f, [3, -1]) assert res == -8 res = self.interpret(f, [2, 5]) assert res == 31 def test_dict_pop_instance(self): class A(object): pass def f(n): d = self.newdict() d[2] = A() x = d.pop(n, None) if x is None: return 12 else: return 15 res = self.interpret(f, [2]) assert res == 15 res = self.interpret(f, [700]) assert res == 12 def test_dict_but_not_with_char_keys(self): def func(i): d = self.newdict() d['h'] = i try: return d['hello'] except KeyError: return 0 res = self.interpret(func, [6]) assert res == 0 def test_dict_valid_resize(self): # see if we find our keys after resize def func(): d = self.newdict() # fill it up for i in range(10): d[str(i)] = 0 # delete again for i in range(10): del d[str(i)] res = 0 # if it does not crash, we are fine. It crashes if you forget the hash field. self.interpret(func, []) # ____________________________________________________________ def test_dict_of_addresses(self): from rpython.rtyper.lltypesystem import llmemory TP = lltype.Struct('x') a = lltype.malloc(TP, flavor='raw', immortal=True) b = lltype.malloc(TP, flavor='raw', immortal=True) def func(i): d = self.newdict() d[llmemory.cast_ptr_to_adr(a)] = 123 d[llmemory.cast_ptr_to_adr(b)] = 456 if i > 5: key = llmemory.cast_ptr_to_adr(a) else: key = llmemory.cast_ptr_to_adr(b) return d[key] assert self.interpret(func, [3]) == 456 def test_prebuilt_list_of_addresses(self): from rpython.rtyper.lltypesystem import llmemory TP = lltype.Struct('x', ('y', lltype.Signed)) a = lltype.malloc(TP, flavor='raw', immortal=True) b = lltype.malloc(TP, flavor='raw', immortal=True) c = lltype.malloc(TP, flavor='raw', immortal=True) a_a = llmemory.cast_ptr_to_adr(a) a0 = llmemory.cast_ptr_to_adr(a) assert a_a is not a0 assert a_a == a0 a_b = llmemory.cast_ptr_to_adr(b) a_c = llmemory.cast_ptr_to_adr(c) d = self.newdict() d[a_a] = 3 d[a_b] = 4 d[a_c] = 5 d[a0] = 8 def func(i): if i == 0: ptr = a else: ptr = b return d[llmemory.cast_ptr_to_adr(ptr)] py.test.raises(TypeError, self.interpret, func, [0]) def test_dict_of_voidp(self): def func(): d = self.newdict() handle = lltype.nullptr(rffi.VOIDP.TO) # Use a negative key, so the dict implementation uses # the value as a marker for empty entries d[-1] = handle return len(d) assert self.interpret(func, []) == 1 from rpython.translator.c.test.test_genc import compile f = compile(func, []) res = f() assert res == 1 def test_dict_with_SHORT_keys(self): def func(x): d = self.newdict() d[rffi.cast(rffi.SHORT, 42)] = 123 d[rffi.cast(rffi.SHORT, -43)] = 321 return d[rffi.cast(rffi.SHORT, x)] assert self.interpret(func, [42]) == 123 assert self.interpret(func, [2**16 - 43]) == 321 def test_dict_with_bool_keys(self): def func(x): d = self.newdict() d[False] = 123 d[True] = 321 return d[x == 42] assert self.interpret(func, [5]) == 123 assert self.interpret(func, [42]) == 321 def test_memoryerror_should_not_insert(self): # This shows a misbehaviour that also exists in CPython 2.7, but not # any more in CPython 3.3. The behaviour is that even if a dict # insertion raises MemoryError, the new item is still inserted. # If we catch the MemoryError, we can keep inserting new items until # the dict table is completely full. Then the next insertion loops # forever. This test only checks that after a MemoryError the # new item was not inserted. def _check_small_range(self, n): if n >= 128: raise MemoryError return range(n) original_check_range = lltype._array._check_range try: lltype._array._check_range = _check_small_range # def do_insert(d, i): d[i] = i def func(): d = self.newdict() i = 0 while True: try: do_insert(d, i) except MemoryError: return (i in d) i += 1 res = self.interpret(func, []) assert res == 0 # finally: lltype._array._check_range = original_check_range def test_dict_with_none_key(self): def func(i): d = self.newdict() d[None] = i return d[None] res = self.interpret(func, [42]) assert res == 42 def test_externalvsinternal(self): class A: pass class B: pass class C: pass class D: pass def func(): d1 = self.newdict(); d1[A()] = B() d2 = self.newdict2(); d2[C()] = D() return (d1, d2) res = self.interpret(func, []) assert lltype.typeOf(res.item0) == lltype.typeOf(res.item1) def test_r_dict(self): class FooError(Exception): pass def myeq(n, m): return n == m def myhash(n): if n < 0: raise FooError return -n def f(n): d = self.new_r_dict(myeq, myhash) for i in range(10): d[i] = i*i try: value1 = d[n] except FooError: value1 = 99 try: value2 = n in d except FooError: value2 = 99 try: value3 = d[-n] except FooError: value3 = 99 try: value4 = (-n) in d except FooError: value4 = 99 return (value1 * 1000000 + value2 * 10000 + value3 * 100 + value4) res = self.interpret(f, [5]) assert res == 25019999 def test_r_dict_popitem_hash(self): def deq(n, m): return n == m def dhash(n): return ~n def func(): d = self.new_r_dict(deq, dhash) d[5] = 2 d[6] = 3 k1, v1 = d.popitem() assert len(d) == 1 k2, v2 = d.popitem() try: d.popitem() except KeyError: pass else: assert 0, "should have raised KeyError" assert len(d) == 0 return k1*1000 + v1*100 + k2*10 + v2 res = self.interpret(func, []) assert res in [5263, 6352] def test_prebuilt_r_dict(self): def deq(n, m): return (n & 3) == (m & 3) def dhash(n): return n & 3 d = self.new_r_dict(deq, dhash) d[0x123] = "abcd" d[0x231] = "efgh" def func(): return d[0x348973] + d[0x12981] res = self.interpret(func, []) res = self.ll_to_string(res) assert res == "abcdefgh" class TestRDict(BaseTestRDict): @staticmethod def newdict(): return {} @staticmethod def newdict2(): return {} @staticmethod def new_r_dict(myeq, myhash): return r_dict(myeq, myhash) def test_two_dicts_with_different_value_types(self): def func(i): d1 = {} d1['hello'] = i + 1 d2 = {} d2['world'] = d1 return d2['world']['hello'] res = self.interpret(func, [5]) assert res == 6 def test_type_erase(self): class A(object): pass class B(object): pass def f(): d = {} d[A()] = B() d2 = {} d2[B()] = A() return d, d2 t = TranslationContext() s = t.buildannotator().build_types(f, []) rtyper = t.buildrtyper() rtyper.specialize() s_AB_dic = s.items[0] s_BA_dic = s.items[1] r_AB_dic = rtyper.getrepr(s_AB_dic) r_BA_dic = rtyper.getrepr(s_AB_dic) assert r_AB_dic.lowleveltype == r_BA_dic.lowleveltype def test_dict_resize(self): py.test.skip("test written for non-ordered dicts, update or kill") # XXX we no longer automatically resize on 'del'. We need to # hack a bit in this test to trigger a resize by continuing to # fill the dict's table while keeping the actual size very low # in order to force a resize to shrink the table back def func(want_empty): d = self.newdict() for i in range(rdict.DICT_INITSIZE << 1): d[chr(ord('a') + i)] = i if want_empty: for i in range(rdict.DICT_INITSIZE << 1): del d[chr(ord('a') + i)] for i in range(rdict.DICT_INITSIZE << 3): d[chr(ord('A') - i)] = i del d[chr(ord('A') - i)] return d res = self.interpret(func, [0]) assert len(res.entries) > rdict.DICT_INITSIZE res = self.interpret(func, [1]) assert len(res.entries) == rdict.DICT_INITSIZE def test_opt_dummykeymarker(self): def f(): d = {"hello": None} d["world"] = None return "hello" in d, d res = self.interpret(f, []) assert res.item0 == True DICT = lltype.typeOf(res.item1).TO assert not hasattr(DICT.entries.TO.OF, 'f_valid') # strs have a dummy def test_opt_dummyvaluemarker(self): def f(n): d = {-5: "abcd"} d[123] = "def" return len(d[n]), d res = self.interpret(f, [-5]) assert res.item0 == 4 DICT = lltype.typeOf(res.item1).TO assert not hasattr(DICT.entries.TO.OF, 'f_valid') # strs have a dummy def test_opt_nonnegint_dummy(self): def f(n): d = {n: 12} d[-87] = 24 del d[n] return len(d.copy()), d[-87], d res = self.interpret(f, [5]) assert res.item0 == 1 assert res.item1 == 24 DICT = lltype.typeOf(res.item2).TO assert not hasattr(DICT.entries.TO.OF, 'f_valid')# nonneg int: dummy -1 def test_opt_no_dummy(self): def f(n): d = {n: 12} d[-87] = -24 del d[n] return len(d.copy()), d[-87], d res = self.interpret(f, [5]) assert res.item0 == 1 assert res.item1 == -24 DICT = lltype.typeOf(res.item2).TO assert hasattr(DICT.entries.TO.OF, 'f_valid') # no dummy available def test_opt_boolean_has_no_dummy(self): def f(n): d = {n: True} d[-87] = True del d[n] return len(d.copy()), d[-87], d res = self.interpret(f, [5]) assert res.item0 == 1 assert res.item1 is True DICT = lltype.typeOf(res.item2).TO assert hasattr(DICT.entries.TO.OF, 'f_valid') # no dummy available def test_opt_multiple_identical_dicts(self): def f(n): s = "x" * n d1 = {s: 12} d2 = {s: 24} d3 = {s: 36} d1["a"] = d2[s] # 24 d3[s] += d1["a"] # 60 d2["bc"] = d3[s] # 60 return d2["bc"], d1, d2, d3 res = self.interpret(f, [5]) assert res.item0 == 60 # all three dicts should use the same low-level type assert lltype.typeOf(res.item1) == lltype.typeOf(res.item2) assert lltype.typeOf(res.item1) == lltype.typeOf(res.item3) def test_nonnull_hint(self): def eq(a, b): return a == b def rhash(a): return 3 def func(i): d = r_dict(eq, rhash, force_non_null=True) if not i: d[None] = i else: d[str(i)] = i return "12" in d, d llres = self.interpret(func, [12]) assert llres.item0 == 1 DICT = lltype.typeOf(llres.item1) assert sorted(DICT.TO.entries.TO.OF._flds) == ['f_hash', 'key', 'value'] def test_deleted_entry_reusage_with_colliding_hashes(self): py.test.skip("test written for non-ordered dicts, update or kill") def lowlevelhash(value): p = rstr.mallocstr(len(value)) for i in range(len(value)): p.chars[i] = value[i] return rstr.LLHelpers.ll_strhash(p) def func(c1, c2): c1 = chr(c1) c2 = chr(c2) d = self.newdict() d[c1] = 1 d[c2] = 2 del d[c1] return d[c2] char_by_hash = {} base = rdict.DICT_INITSIZE for y in range(0, 256): y = chr(y) y_hash = lowlevelhash(y) % base char_by_hash.setdefault(y_hash, []).append(y) x, y = char_by_hash[0][:2] # find a collision res = self.interpret(func, [ord(x), ord(y)]) assert res == 2 def func2(c1, c2): c1 = chr(c1) c2 = chr(c2) d = self.newdict() d[c1] = 1 d[c2] = 2 del d[c1] d[c1] = 3 return d res = self.interpret(func2, [ord(x), ord(y)]) for i in range(len(res.entries)): assert not (res.entries.everused(i) and not res.entries.valid(i)) def func3(c0, c1, c2, c3, c4, c5, c6, c7): d = self.newdict() c0 = chr(c0) ; d[c0] = 1; del d[c0] c1 = chr(c1) ; d[c1] = 1; del d[c1] c2 = chr(c2) ; d[c2] = 1; del d[c2] c3 = chr(c3) ; d[c3] = 1; del d[c3] c4 = chr(c4) ; d[c4] = 1; del d[c4] c5 = chr(c5) ; d[c5] = 1; del d[c5] c6 = chr(c6) ; d[c6] = 1; del d[c6] c7 = chr(c7) ; d[c7] = 1; del d[c7] return d if rdict.DICT_INITSIZE != 8: py.test.skip("make dict tests more indepdent from initsize") res = self.interpret(func3, [ord(char_by_hash[i][0]) for i in range(rdict.DICT_INITSIZE)]) count_frees = 0 for i in range(len(res.entries)): if not res.entries.everused(i): count_frees += 1 assert count_frees >= 3 class TestStress: def test_stress(self): from rpython.annotator.dictdef import DictKey, DictValue from rpython.annotator import model as annmodel dictrepr = rdict.DictRepr(None, rint.signed_repr, rint.signed_repr, DictKey(None, annmodel.SomeInteger()), DictValue(None, annmodel.SomeInteger())) dictrepr.setup() l_dict = rdict.ll_newdict(dictrepr.DICT) referencetable = [None] * 400 referencelength = 0 value = 0 def complete_check(): for n, refvalue in zip(range(len(referencetable)), referencetable): try: gotvalue = rdict.ll_dict_getitem(l_dict, n) except KeyError: assert refvalue is None else: assert gotvalue == refvalue for x in not_really_random(): n = int(x*100.0) # 0 <= x < 400 op = repr(x)[-1] if op <= '2' and referencetable[n] is not None: rdict.ll_dict_delitem(l_dict, n) referencetable[n] = None referencelength -= 1 elif op <= '6': rdict.ll_dict_setitem(l_dict, n, value) if referencetable[n] is None: referencelength += 1 referencetable[n] = value value += 1 else: try: gotvalue = rdict.ll_dict_getitem(l_dict, n) except KeyError: assert referencetable[n] is None else: assert gotvalue == referencetable[n] if 1.38 <= x <= 1.39: complete_check() print 'current dict length:', referencelength assert l_dict.num_items == referencelength complete_check() def test_stress_2(self): yield self.stress_combination, True, False yield self.stress_combination, False, True yield self.stress_combination, False, False yield self.stress_combination, True, True def stress_combination(self, key_can_be_none, value_can_be_none): from rpython.rtyper.lltypesystem.rstr import string_repr from rpython.annotator.dictdef import DictKey, DictValue from rpython.annotator import model as annmodel print print "Testing combination with can_be_None: keys %s, values %s" % ( key_can_be_none, value_can_be_none) class PseudoRTyper: cache_dummy_values = {} dictrepr = rdict.DictRepr(PseudoRTyper(), string_repr, string_repr, DictKey(None, annmodel.SomeString(key_can_be_none)), DictValue(None, annmodel.SomeString(value_can_be_none))) dictrepr.setup() print dictrepr.lowleveltype for key, value in dictrepr.DICTENTRY._adtmeths.items(): print ' %s = %s' % (key, value) l_dict = rdict.ll_newdict(dictrepr.DICT) referencetable = [None] * 400 referencelength = 0 values = not_really_random() keytable = [string_repr.convert_const("foo%d" % n) for n in range(len(referencetable))] def complete_check(): for n, refvalue in zip(range(len(referencetable)), referencetable): try: gotvalue = rdict.ll_dict_getitem(l_dict, keytable[n]) except KeyError: assert refvalue is None else: assert gotvalue == refvalue for x in not_really_random(): n = int(x*100.0) # 0 <= x < 400 op = repr(x)[-1] if op <= '2' and referencetable[n] is not None: rdict.ll_dict_delitem(l_dict, keytable[n]) referencetable[n] = None referencelength -= 1 elif op <= '6': ll_value = string_repr.convert_const(str(values.next())) rdict.ll_dict_setitem(l_dict, keytable[n], ll_value) if referencetable[n] is None: referencelength += 1 referencetable[n] = ll_value else: try: gotvalue = rdict.ll_dict_getitem(l_dict, keytable[n]) except KeyError: assert referencetable[n] is None else: assert gotvalue == referencetable[n] if 1.38 <= x <= 1.39: complete_check() print 'current dict length:', referencelength assert l_dict.num_items == referencelength complete_check()
test_dict_inst_itervalues
timecode.py
# # DVR-Scan: Find & Export Motion Events in Video Footage # -------------------------------------------------------------- # [ Site: https://github.com/Breakthrough/DVR-Scan/ ] # [ Documentation: http://dvr-scan.readthedocs.org/ ] # # This file contains all code related to timecode formats, interpreting, # parsing, and conversion. # # Copyright (C) 2016-2020 Brandon Castellano <http://www.bcastell.com>. # # DVR-Scan is licensed under the BSD 2-Clause License; see the included # LICENSE file or visit one of the following pages for details: # - https://github.com/Breakthrough/DVR-Scan/ # # This software uses Numpy and OpenCV; see the LICENSE-NUMPY and # LICENSE-OPENCV files or visit the above URL for details. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # class
(object): """ Object for frame-based timecodes, using the video framerate to compute back and forth between frame number and second/timecode formats. The passed argument is declared valid if it meets one of three valid forms: 1) Standard timecode HH:MM:SS[.nnn]: in string form 'HH:MM:SS' or 'HH:MM:SS.nnn', or in list/tuple form [HH, MM, SS] or [HH, MM, SS.nnn] 2) Number of seconds S[.SSS], where S >= 0.0: in string form 'Ss' or 'S.SSSs' (e.g. '5s', '1.234s'), or in integer or floating point form S or S.SSS 3) Exact number of frames N, where N >= 0: in either integer or string form N or 'N' Raises: TypeError, ValueError """ def __init__(self, fps, timecode): if not isinstance(fps, (int, float)): raise TypeError('Framerate must be of type int/float.') self.framerate = float(fps) self.frame_num = -1 # Exact number of frames N if isinstance(timecode, int): if timecode < 0: raise ValueError('Timecode frame number must be positive.') self.frame_num = timecode # Number of seconds S elif isinstance(timecode, float): if timecode < 0.0: raise ValueError('Timecode value must be positive.') self.frame_num = int(timecode * self.framerate) # Standard timecode in list format [HH, MM, SS.nnn] elif isinstance(timecode, (list, tuple)) and len(timecode) == 3: if any(not isinstance(x, (int, float)) for x in timecode): raise ValueError('Timecode components must be of type int/float.') hrs, mins, secs = timecode if not (hrs >= 0 and mins >= 0 and secs >= 0 and mins < 60 and secs < 60): raise ValueError('Timecode components must be positive.') secs += (((hrs * 60.0) + mins) * 60.0) self.frame_num = int(secs * self.framerate) elif isinstance(timecode, str): # Number of seconds S if timecode.endswith('s'): secs = timecode[:-1] if not secs.replace('.', '').isdigit(): raise ValueError('All characters in timecode seconds string must be digits.') secs = float(secs) if secs < 0.0: raise ValueError('Timecode seconds value must be positive.') self.frame_num = int(secs * self.framerate) # Exact number of frames N elif timecode.isdigit(): timecode = int(timecode) if timecode < 0: raise ValueError('Timecode frame number must be positive.') self.frame_num = timecode # Standard timecode in string format 'HH:MM:SS[.nnn]' else: tc_val = timecode.split(':') if not (len(tc_val) == 3 and tc_val[0].isdigit() and tc_val[1].isdigit() and tc_val[2].replace('.', '').isdigit()): raise TypeError('Improperly formatted timecode string.') hrs, mins = int(tc_val[0]), int(tc_val[1]) secs = float(tc_val[2]) if '.' in tc_val[2] else int(tc_val[2]) if not (hrs >= 0 and mins >= 0 and secs >= 0 and mins < 60 and secs < 60): raise ValueError('Invalid timecode range.') secs += (((hrs * 60.0) + mins) * 60.0) self.frame_num = int(secs * self.framerate) else: raise TypeError('Timecode format unrecognized.') def get_seconds(self): """ Get the frame's position in number of seconds. Returns: A float of the current time/position in seconds. """ return float(self.frame_num) / self.framerate def get_timecode(self, precision = 3, use_rounding = True): """ Get a formatted timecode string of the form HH:MM:SS[.nnn]. Args: precision: The number of decimal places to include in the output [.nnn]. use_rounding: True (default) to round the output to the desired precision. Returns: A string with a formatted timecode (HH:MM:SS[.nnn]). """ # Compute hours and minutes based off of seconds, and update seconds. secs = self.get_seconds() base = 60.0 * 60.0 hrs = int(secs / base) secs -= (hrs * base) base = 60.0 mins = int(secs / base) secs -= (mins * base) # Convert seconds into string based on required precision. if precision > 0: if use_rounding: secs = round(secs, precision) msec = format(secs, '.%df' % precision)[-precision:] secs = '%02d.%s' % (int(secs), msec) else: secs = '%02d' % int(round(secs, 0)) if use_rounding else '%02d' % int(secs) # Return hours, minutes, and seconds as a formatted timecode string. return '%02d:%02d:%s' % (hrs, mins, secs)
FrameTimecode
Task.py
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* '''module to manage task settings''' import xml.etree.ElementTree as xmlMod import os, uuid, subprocess, shlex, time, datetime, threading from save import * from usefullFunctions import * from Preferences.PresetList.Preset.Preset import * from TaskList.FileInfo.FileInfo import * from TaskList.TaskLog.TaskLog import * class Task: '''class to manage task settings''' def __init__(self, path = None, scene = None, preset = None,\ fileInfo = None, xml= None): '''initialize task object with default settings or saved settings''' self.running = False if xml is None: self.defaultInit(path, scene, preset, fileInfo) else: self.fromXml(xml) def defaultInit(self, path, scene, preset, fileInfo): '''initialize Task object with default settings''' self.path = path self.scene = scene self.preset = preset self.info = fileInfo self.uid = uuid.uuid4().hex self.log = None self.status = 'waiting' # self.status possible values: # waiting > the task have been set and is waiting to be run # lock > the task is protected against running # pendinglock> same thing for a task that already have been started # ready > the task have been run once and task.log is set # running > the task is running # pause > the task have been started but is now waiting to be continued # ended > the task have been totaly rendered # erased > the task have been erased def fromXml(self, xml): '''initialize Task object with savedd settings''' self.path = xml.get('path') self.scene = xml.get('scene') self.preset = xml.get('preset') self.uid = xml.get('uid', uuid.uuid4().hex) self.status = xml.get('status') self.info = FileInfo(xml.find('fileInfo')) node = xml.find('log') if node is not None: self.log = TaskLog(xml = node) else: self.log = None def toXml(self): '''export task settings into xml syntaxed string''' xml = '<task path="'+XML.encode(self.path)+'" scene="'+XML.encode(self.scene)\ +'" preset="'+self.preset+'" uid="'+self.uid\ +'" status="'+self.status+'" >\n'\ +self.info.toXml() if self.log is not None: xml += self.log.toXml() xml += '</task>\n' return xml def menu(self, log, index, tasks, preferences): '''method to edit task settings''' log.menuIn('Task n°'+str(index)) change = False started = self.log is not None if started: menu = ''' Menu : (TASK ALREADY STARTED : SOME OPTIONS IS NOT AVAILABLE!) 5- Change list row 6- Lock/Unlock task 7- Erase task 8- Copy task 9- See Rendering Log 0- Quit and save ''' else: menu = ''' Menu : 1- Change scene 2- Change preset 3- Edit preset 4- Active/desactive Renderlayer 5- Change list row 6- Lock/Unlock task 7- Erase task 8- Copy task 0- Quit and save ''' while True: log.print() print('\n Edit Task n°'+str(index)+' :') self.print() print(menu) choice= input('action : ').strip().lower() if choice in ['0', 'q', 'quit', 'cancel']: log.menuOut() return change elif choice == '1' and not started: scene = self.info.sceneChoice(log, allChoice = False) if scene is not None: self.scene = scene[0] log.write('Task n°'+str(index)+' : Scene set to «'+self.scene+'»') change = True elif choice == '2' and not started: preset = Task.presetChoice(log, preferences) if preset is not None : self.preset = preset log.write('Task n°'+str(index)+' : Preset set to «'+self.preset+'»') change = True elif choice == '3' and not started: self.editPreset(log, preferences) elif choice == '4' and not started: confirm = self.info.scenes[self.scene].renderlayerActivator(log) if confirm: log.write('change task n°'+str(index)+' active renderlayer') change = True elif choice == '5': confirm, select = tasks.move(log, [index]) if confirm: change = True index = select[0] elif choice == '6': if self.status in ['ready', 'pause']: self.status = 'pendinglock' change = True log.write('Task n°'+str(index)+' locked') elif self.status == 'waiting': self.status = 'lock' change = True log.write('Task n°'+str(index)+' locked') elif self.status == 'pendinglock': self.status = 'pause' change = True log.write('Task n°'+str(index)+' unlocked') elif self.status == 'lock': self.status = 'waiting' change = True log.write('Task n°'+str(index)+' unlocked') else: log.error('Task n°'+str(index)+' is not lockable/unlockable') elif choice == '7': if tasks.remove(log, [index]): log.menuOut() log.write('Task n°'+str(index)+' removed') return True elif choice == '8': new = self.copy() new.status = 'waiting' new.log = None tasks.tasks.append(new) log.write('a copy of the task n°'+str(index)+' have been added at the bottom of the task list') change = True elif choice == '9' and started: self.log.menu(log, index) else: log.error('Unknow request!', False) def menuArchive(self, log, index, tasks): '''method to edit task settings''' log.menuIn('Archived Task n°'+str(index)) change = False while True: log.print() print('\n Task n°'+str(index)+' Log :') self.print() choice = input(''' Menu : 1- See Rendering Log 2- Copy Task In Rendering List 3- Erase Archived Task 0- Quit and save action : ''').strip().lower() if choice in ['0', 'q', 'quit', 'cancel']: log.menuOut() return change elif choice == '1': self.log.menu(log,
'2': new = self.copy() new.status = 'waiting' new.log = None tasks.tasks.append(new) log.write('A copy of the archived task n°'+str(index)+' have been added at the bottom of the pending task list.') change = True elif choice == '3': conf = input('\n\nThe task gone be definitly erased. Confirm action (y) :').strip().lower() if conf in ['y', 'yes']: tasks.archive.pop(index) log.write('The archived task n°'+str(index)+' have been erased.') log.menuOut() return True else: log.error('Unknow request!', False) def print(self): '''A method to print task information''' print('\n\nStatus : '+self.status) print('Path : '+self.path) print('File Name : '+self.path.split('/').pop()) print('Scene : '+self.scene) print('Preset : '+self.preset+'\n') print('\033[4mActive Renderlayer :\033[0m') self.info.scenes[self.scene].printActiveRenderlayer() print('\n') def renamePreset(self, old, new): '''a method to rename used preset''' if self.preset == old: self.preset = new def erasePreset(self, preset): '''a method to stop using preset''' if self.preset == preset: self.preset = '[default]' def getRow(self): '''A method to get row to print task list''' name = self.path.split('/').pop() return columnLimit(' '+name, 25, 5)\ +columnLimit(' '+self.scene, 25, 5)\ +columnLimit(' '+self.preset, 25, 5) def presetChoice(log, preferences): '''A method to choose a preset''' # preset choice log.menuIn('Preset Choice') log.print() print('\n\n \033[4mPreset Choice :\033[0m\n\n') confirm = input('Use «'+preferences.presets.default+'» default preset? (type anything else that y or yes to choose another one)') if confirm in ['', 'y', 'yes']: log.menuOut() return '[default]' else: preset = preferences.presets.choose(log) log.menuOut() return preset def editPreset(self, log, preferences): '''A method to edit the preset used by the task''' log.error('Warning : all change made to the preset will be effective for all task that use it…') if self.preset == '[default]' : name = preferences.presets.default preset = preferences.presets.presets[name] else: name = self.preset preset = preferences.presets.presets[name] if type(preset) is Preset: confirm = preset.menu(log, name, preferences.blenderVersion) else: confirm = preset.menu(log, name, preferences.presets) if confirm: savePreferences(preferences) def copy(self): xml = '<?xml version="1.0" encoding="UTF-8"?>\n'+self.toXml() xml = xmlMod.fromstring(xml) copy = Task(xml = xml) copy.uid = uuid.uuid4().hex return copy def printRunMenu(self, index, count, log): '''print current runninge state''' log.print() print('\n\nRun task n°'+str(index)+' of '+str(count)+' :\n\n') if self.log is not None: self.log.print() log.runPrint() def run(self, index, taskList, scriptPath, log, preferences): '''A method to execute the task''' log.menuIn('run Task '+str(index)+' from '+str(len(taskList.tasks))) if self.log is None: # task never have been run before self.log = TaskLog(pref = preferences, task = self) preferences.output.checkAndCreate(self, preferences, taskList) self.printRunMenu(index, len(taskList.tasks), log) metapreset = self.log.preset if type(metapreset) is Preset: if self.log.groups[0].remaining() > 0: versions = { metapreset.engine.version : '[default]' } else: versions = {} for group in self.log.groups: if group.remaining() > 0: if group.preset.engine.version in versions.keys(): versions[group.preset.engine.version].append(group.name) else: versions[group.preset.engine.version] = [group.name] scripts = self.createTaskScript(scriptPath, preferences, versions, metapreset) results = '' for version in versions.keys(): try: l = threading.Thread(target = self.socketAcceptClient, args=(taskList, index, log)) l.start() taskList.listenerThreads.append(l) sub = subprocess.Popen(\ shlex.split(\ preferences.blenderVersion.getVersionPath(version)\ +' -b "'+self.path+'" -P "'\ +scripts[version]+'"'),\ stdout = subprocess.PIPE,\ stdin = subprocess.PIPE,\ stderr = subprocess.PIPE) taskList.renderingSubprocess.append(sub) result = sub.communicate() taskList.renderingSubprocess.remove(sub) results += result[0].decode()+result[1].decode()+'\n\n\n' except FileNotFoundError: log.write('\033[31mTask n°'+str(index)+' : Blender version call error! Try to verify the path of «'+version+'» blender version!\033[0m') if taskList.runningMode in [taskList.UNTIL_GROUP_END,\ taskList.UNTIL_FRAME_END,\ taskList.STOP_NOW,\ taskList.STOP_FORCED]: break self.eraseTaskScript(scripts) log.menuOut() return True def socketAcceptClient(self, taskList, index, log): '''A method to manage client connexion when running''' client = taskList.socket.accept()[0] taskList.listenerSockets.append( { 'socket':client, 'uid':self.uid } ) msg = '' while taskList.runningMode < taskList.STOP_NOW: msg += client.recv(1024).decode() if msg == '': time.sleep(1) elif msg == self.uid+' VersionEnded EOS': break else: msg = self.treatSocketMessage(msg, taskList, index, log) client.close() def treatSocketMessage(self, msg, taskList, index, log): '''a method to interpret socket message''' if msg[-4:] != ' EOS': return msg messages = msg.split(' EOS') messages.pop() for m in messages: # normally, the message is to confirm the rendering of a frame, it must follow this sytaxe: #uid action(group,frame,date,computingTime) EOS #fc9b9d6fd2af4e0fb3f09066f9902f90 ConfirmFrame(groupe1,15,10:09:2014:10:30:40,11111111111111) EOS uid = m[0:32] action = m[33:m.find('(')] info = m[46:-1] if uid == self.uid and action == 'debugMsg': log.write(info) elif uid == self.uid and action == 'ConfirmFrame': info = info.split(',') group = info[0] frame = int(info[1]) computingTime = float(info[3]) date = info[2].split(':') date = datetime.datetime( year = int(date[2]), month = int(date[1]), day = int(date[0]), hour = int(date[3]), minute = int(date[4]), second = int(date[5]) ) self.log.getGroup(group).confirmFrame(frame, date, computingTime) self.printRunMenu(index, len(taskList.tasks), log) if messages[-1] == self.uid+' VersionEnded': return messages[-1]+' EOS' else: return '' def createTaskScript(self, scriptPath, preferences, versions, preset): '''create a script for each blender versions to run tfhe task''' start = '''#!/usr/bin/python3.4 # -*-coding:Utf-8 -* ''\'module to manage metapreset''\' import sys sys.path.append("'''+scriptPath+'''") import xml.etree.ElementTree as xmlMod from Preferences.Preferences import * from Preferences.PresetList.Preset.Preset import * from Preferences.PresetList.Preset.Metapreset import * from TaskList.RenderingTask.RenderingTask import * from TaskList.Task import * preferences = Preferences( xml = xmlMod.fromstring(''\''''+preferences.toXml(False)+'''''\') ) task = Task( xml = xmlMod.fromstring(''\'<?xml version="1.0" encoding="UTF-8"?>\n'''+self.toXml()+'''''\')) ''' end = '\nRenderingTask(task, preferences, groups)' paths = {} for v, g in versions.items(): script = start\ +'groups = ["'+('", "'.join(g) )+'"]\n'\ +end paths[v] = scriptPath+'/TaskList/RenderingTask/TaskScripts/'+self.uid+'-'+v+'.py' with open(paths[v],'w') as taskScriptFile: taskScriptFile.write( script ) return paths def eraseTaskScript(self, scripts): '''erase Task Script files''' for path in scripts.values(): os.remove(path) def getUsefullGroup(self, groups, preferences): '''return only usefull group from the list, excluding those who have no renderlayer in this task''' renderlayers = self.info.scenes[self.scene].getActiveRenderlayers() confirmed = [] for group in groups: for RL in renderlayers: if preferences.presets.renderlayers.groups[group].belongTo(RL.name): confirmed.append(group) break return confirmed
index) elif choice ==
main.go
package main import ( "log" "os" "github.com/pkg/errors" "github.com/smartcontractkit/chainlink/core/cmd" "github.com/smartcontractkit/chainlink/core/config" "github.com/smartcontractkit/chainlink/core/logger" "github.com/smartcontractkit/chainlink/core/recovery" "github.com/smartcontractkit/chainlink/core/sessions" ) func main() { recovery.ReportPanics(func() { Run(NewProductionClient(), os.Args...) }) } // Run runs the CLI, providing further command instructions by default. func Run(client *cmd.Client, args ...string) { app := cmd.NewApp(client) client.Logger.ErrorIf(app.Run(args), "Error running app") if err := client.Logger.Sync(); err != nil { log.Fatal(err) } } // NewProductionClient configures an instance of the CLI to be used // in production. func NewProductionClient() *cmd.Client
{ lggr := logger.NewLogger() cfg := config.NewGeneralConfig(lggr) prompter := cmd.NewTerminalPrompter() cookieAuth := cmd.NewSessionCookieAuthenticator(cfg, cmd.DiskCookieStore{Config: cfg}, lggr) sr := sessions.SessionRequest{} sessionRequestBuilder := cmd.NewFileSessionRequestBuilder(lggr) if credentialsFile := cfg.AdminCredentialsFile(); credentialsFile != "" { var err error sr, err = sessionRequestBuilder.Build(credentialsFile) if err != nil && errors.Cause(err) != cmd.ErrNoCredentialFile && !os.IsNotExist(err) { lggr.Fatalw("Error loading API credentials", "error", err, "credentialsFile", credentialsFile) } } return &cmd.Client{ Renderer: cmd.RendererTable{Writer: os.Stdout}, Config: cfg, Logger: lggr, AppFactory: cmd.ChainlinkAppFactory{}, KeyStoreAuthenticator: cmd.TerminalKeyStoreAuthenticator{Prompter: prompter}, FallbackAPIInitializer: cmd.NewPromptingAPIInitializer(prompter), Runner: cmd.ChainlinkRunner{}, HTTP: cmd.NewAuthenticatedHTTPClient(cfg, cookieAuth, sr), CookieAuthenticator: cookieAuth, FileSessionRequestBuilder: sessionRequestBuilder, PromptingSessionRequestBuilder: cmd.NewPromptingSessionRequestBuilder(prompter), ChangePasswordPrompter: cmd.NewChangePasswordPrompter(), PasswordPrompter: cmd.NewPasswordPrompter(), } }
get.go
package aci import ( "encoding/json" "errors" "fmt" "net/http" "net/url" "github.com/virtual-kubelet/virtual-kubelet/providers/azure/client/api" ) // GetContainerGroup gets an Azure Container Instance in the provided // resource group with the given container group name. // From: https://docs.microsoft.com/en-us/rest/api/container-instances/containergroups/get func (c *Client) GetContainerGroup(resourceGroup, containerGroupName string) (*ContainerGroup, error) { urlParams := url.Values{ "api-version": []string{apiVersion}, } // Create the url. uri := api.ResolveRelative(BaseURI, containerGroupURLPath) uri += "?" + url.Values(urlParams).Encode() // Create the request. req, err := http.NewRequest("GET", uri, nil) if err != nil { return nil, fmt.Errorf("Creating get container group uri request failed: %v", err) } // Add the parameters to the url. if err := api.ExpandURL(req.URL, map[string]string{ "subscriptionId": c.auth.SubscriptionID, "resourceGroup": resourceGroup, "containerGroupName": containerGroupName, }); err != nil { return nil, fmt.Errorf("Expanding URL with parameters failed: %v", err) } // Send the request. resp, err := c.hc.Do(req) if err != nil { return nil, fmt.Errorf("Sending get container group request failed: %v", err) } defer resp.Body.Close()
return nil, err } // Decode the body from the response. if resp.Body == nil { return nil, errors.New("Create container group returned an empty body in the response") } var cg ContainerGroup if err := json.NewDecoder(resp.Body).Decode(&cg); err != nil { return nil, fmt.Errorf("Decoding get container group response body failed: %v", err) } return &cg, nil }
// 200 (OK) is a success response. if err := api.CheckResponse(resp); err != nil {
serializers.py
from rest_framework import serializers from .models import Host class HostSerializer(serializers.ModelSerializer): class
: model = Host fields = ['id','species', 'size', 'cost']
Meta
main.js
!function(e){var t={};function r(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(o,i,function(t){return e[t]}.bind(null,i));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=24)}([function(e,t){e.exports={detecting:0,foundIt:1,notMe:2,start:0,error:1,itsMe:2,SHORTCUT_THRESHOLD:.95}},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("stream")},function(e,t){e.exports=require("fs")},function(e,t,r){var o=r(0);e.exports=function(e){var t=this;this.reset=function(){this._mCurrentState=o.start},this.nextState=function(e){var t=this._mModel.classTable[e.charCodeAt(0)];return this._mCurrentState==o.start&&(this._mCurrentBytePos=0,this._mCurrentCharLen=this._mModel.charLenTable[t]),this._mCurrentState=this._mModel.stateTable[this._mCurrentState*this._mModel.classFactor+t],this._mCurrentBytePos++,this._mCurrentState},this.getCurrentCharLen=function(){return this._mCurrentCharLen},this.getCodingStateMachine=function(){return this._mModel.name},function(e){t._mModel=e,t._mCurrentBytePos=0,t._mCurrentCharLen=0,t.reset()}(e)}},function(e,t){e.exports=require("zlib")},function(e,t,r){var o=r(0);e.exports=function(){this.reset=function(){this._mState=o.detecting},this.getCharsetName=function(){return null},this.feed=function(e){},this.getState=function(){return this._mState},this.getConfidence=function(){return 0},this.filterHighBitOnly=function(e){return e=e.replace(/[\x00-\x7F]+/g," ")},this.filterWithoutEnglishLetters=function(e){return e=e.replace(/[A-Za-z]+/g," ")},this.filterWithEnglishLetters=function(e){for(var t="",r=!1,o=0,i=0;i<e.length;i++){var n=e[i];">"==n?r=!1:"<"==n&&(r=!0);var s=/[a-zA-Z]/.test(n);/^[\x00-\x7F]*$/.test(n)&&!s&&(i>o&&!r&&(t=t+e.substring(o,i)+" "),o=i+1)}return r||(t+=e.substring(o)),t}}},function(e,t){t.log=function(){},t.setLogger=function(e){t.enabled=!0,t.log=e}},function(e,t,r){"use strict";var o,i=r(11),n=i.Buffer,s={};for(o in i)i.hasOwnProperty(o)&&"SlowBuffer"!==o&&"Buffer"!==o&&(s[o]=i[o]);var a=s.Buffer={};for(o in n)n.hasOwnProperty(o)&&"allocUnsafe"!==o&&"allocUnsafeSlow"!==o&&(a[o]=n[o]);if(s.Buffer.prototype=n.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return n(e,t,r)}),a.alloc||(a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=n(e);return t&&0!==t.length?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o}),!s.kStringMaxLength)try{s.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(e){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),e.exports=s},function(e,t,r){var o=r(6),i=r(0),n=r(7);function s(){o.apply(this);this.reset=function(){s.prototype.reset.apply(this),this._mCodingSM&&this._mCodingSM.reset(),this._mDistributionAnalyzer&&this._mDistributionAnalyzer.reset(),this._mLastChar="\0\0"},this.getCharsetName=function(){},this.feed=function(e){for(var t=e.length,r=0;r<t;r++){var o=this._mCodingSM.nextState(e[r]);if(o==i.error){n.log(this.getCharsetName()+" prober hit error at byte "+r+"\n"),this._mState=i.notMe;break}if(o==i.itsMe){this._mState=i.foundIt;break}if(o==i.start){var s=this._mCodingSM.getCurrentCharLen();0==r?(this._mLastChar[1]=e[0],this._mDistributionAnalyzer.feed(this._mLastChar,s)):this._mDistributionAnalyzer.feed(e.slice(r-1,r+1),s)}}return this._mLastChar[0]=e[t-1],this.getState()==i.detecting&&this._mDistributionAnalyzer.gotEnoughData()&&this.getConfidence()>i.SHORTCUT_THRESHOLD&&(this._mState=i.foundIt),this.getState()},this.getConfidence=function(){return this._mDistributionAnalyzer.getConfidence()}}s.prototype=new o,e.exports=s},function(e,t,r){var o=r(48),i=r(49),n=r(50),s=r(51),a=r(52);function c(){var e=this;this.reset=function(){this._mDone=!1,this._mTotalChars=0,this._mFreqChars=0},this.feed=function(e,t){if(2==t)var r=this.getOrder(e);else r=-1;r>=0&&(this._mTotalChars++,r<this._mTableSize&&512>this._mCharToFreqOrder[r]&&this._mFreqChars++)},this.getConfidence=function(){if(this._mTotalChars<=0||this._mFreqChars<=3)return.01;if(this._mTotalChars!=this._mFreqChars){var e=this._mFreqChars/((this._mTotalChars-this._mFreqChars)*this._mTypicalDistributionRatio);if(e<.99)return e}return.99},this.gotEnoughData=function(){return this._mTotalChars>1024},this.getOrder=function(e){return-1},e._mCharToFreqOrder=null,e._mTableSize=null,e._mTypicalDistributionRatio=null,e.reset()}function h(){c.apply(this);var e=this;this.getOrder=function(e){return e.charCodeAt(0)>=196?94*(e.charCodeAt(0)-196)+e.charCodeAt(1)-161:-1},e._mCharToFreqOrder=i.EUCTWCharToFreqOrder,e._mTableSize=i.EUCTW_TABLE_SIZE,e._mTypicalDistributionRatio=i.EUCTW_TYPICAL_DISTRIBUTION_RATIO}function f(){c.apply(this);var e=this;this.getOrder=function(e){return e.charCodeAt(0)>=176?94*(e.charCodeAt(0)-176)+e.charCodeAt(1)-161:-1},e._mCharToFreqOrder=n.EUCKRCharToFreqOrder,e._mTableSize=n.EUCKR_TABLE_SIZE,e._mTypicalDistributionRatio=n.EUCKR_TYPICAL_DISTRIBUTION_RATIO}function l(){c.apply(this);var e=this;this.getOrder=function(e){return e.charCodeAt(0)>=176&&e.charCodeAt(1)>=161?94*(e.charCodeAt(0)-176)+e.charCodeAt(1)-161:-1},e._mCharToFreqOrder=s.GB2312CharToFreqOrder,e._mTableSize=s.GB2312_TABLE_SIZE,e._mTypicalDistributionRatio=s.GB2312_TYPICAL_DISTRIBUTION_RATIO}function u(){c.apply(this);var e=this;this.getOrder=function(e){return e.charCodeAt(0)>=164?e.charCodeAt(1)>=161?157*(e.charCodeAt(0)-164)+e.charCodeAt(1)-161+63:157*(e.charCodeAt(0)-164)+e.charCodeAt(1)-64:-1},e._mCharToFreqOrder=a.Big5CharToFreqOrder,e._mTableSize=a.BIG5_TABLE_SIZE,e._mTypicalDistributionRatio=a.BIG5_TYPICAL_DISTRIBUTION_RATIO}function d(){c.apply(this);var e=this;this.getOrder=function(e){if(e.charCodeAt(0)>=129&&e.charCodeAt(0)<=159)var t=188*(e.charCodeAt(0)-129);else{if(!(e.charCodeAt(0)>=224&&e.charCodeAt(0)<=239))return-1;t=188*(e.charCodeAt(0)-224+31)}return t+=e.charCodeAt(1)-64,(e.charCodeAt(1)<64||127===e.charCodeAt(1)||e.charCodeAt(1)>252)&&(t=-1),t},e._mCharToFreqOrder=o.JISCharToFreqOrder,e._mTableSize=o.JIS_TABLE_SIZE,e._mTypicalDistributionRatio=o.JIS_TYPICAL_DISTRIBUTION_RATIO}function p(){c.apply(this);var e=this;this.getOrder=function(e){return e[0]>=" "?94*(e.charCodeAt(0)-161)+e.charCodeAt(1)-161:-1},e._mCharToFreqOrder=o.JISCharToFreqOrder,e._mTableSize=o.JIS_TABLE_SIZE,e._mTypicalDistributionRatio=o.JIS_TYPICAL_DISTRIBUTION_RATIO}t.CharDistributionAnalysis=c,h.prototype=new c,t.EUCTWDistributionAnalysis=h,f.prototype=new c,t.EUCKRDistributionAnalysis=f,l.prototype=new c,t.GB2312DistributionAnalysis=l,u.prototype=new c,t.Big5DistributionAnalysis=u,d.prototype=new c,t.SJISDistributionAnalysis=d,p.prototype=new c,t.EUCJPDistributionAnalysis=p},function(e,t){e.exports=require("buffer")},function(e,t){e.exports=require("url")},function(e){e.exports=JSON.parse('[["0","\\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],["9980","檧檨檪檭",114,"欥欦欨",6],["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],["a2a1","ⅰ",9],["a2b1","⒈",19,"⑴",19,"①",9],["a2e5","㈠",9],["a2f1","Ⅰ",11],["a3a1","!"#¥%",88," ̄"],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],["a6ee","︻︼︷︸︱"],["a6f4","︳︴"],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],["a8bd","ńň"],["a8c0","ɡ"],["a8c5","ㄅ",36],["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"],["a959","℡㈱"],["a95c","‐"],["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],["a980","﹢",4,"﹨﹩﹪﹫"],["a996","〇"],["a9a4","─",75],["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],["bb40","籃",9,"籎",36,"籵",5,"籾",9],["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],["bd40","紷",54,"絯",7],["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],["be40","継",12,"綧",6,"綯",42],["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],["bf40","緻",62],["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],["c040","繞",35,"纃",23,"纜纝纞"],["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],["d440","訞",31,"訿",8,"詉",21],["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],["d540","誁",7,"誋",7,"誔",46],["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],["d640","諤",34,"謈",27],["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],["d740","譆",31,"譧",4,"譭",25],["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],["d940","貮",62],["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],["dd40","軥",62],["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],["e240","釦",62],["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],["e340","鉆",45,"鉵",16],["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],["e440","銨",5,"銯",24,"鋉",31],["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],["e540","錊",51,"錿",10],["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],["e640","鍬",34,"鎐",27],["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],["e740","鏎",7,"鏗",54],["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],["ee40","頏",62],["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],["f040","餈",4,"餎餏餑",28,"餯",26],["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],["f140","馌馎馚",10,"馦馧馩",47],["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],["f240","駺",62],["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],["f540","魼",62],["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],["f640","鯜",62],["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],["f740","鰼",62],["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],["f840","鳣",62],["f880","鴢",32],["f940","鵃",62],["f980","鶂",32],["fa40","鶣",62],["fa80","鷢",32],["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]]')},function(e,t,r){"use strict";var o=r(8).Buffer,i=r(25),n=e.exports;n.encodings=null,n.defaultCharUnicode="�",n.defaultCharSingleByte="?",n.encode=function(e,t,r){e=""+(e||"");var i=n.getEncoder(t,r),s=i.write(e),a=i.end();return a&&a.length>0?o.concat([s,a]):s},n.decode=function(e,t,r){"string"==typeof e&&(n.skipDecodeWarning||(console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding"),n.skipDecodeWarning=!0),e=o.from(""+(e||""),"binary"));var i=n.getDecoder(t,r),s=i.write(e),a=i.end();return a?s+a:s},n.encodingExists=function(e){try{return n.getCodec(e),!0}catch(e){return!1}},n.toEncoding=n.encode,n.fromEncoding=n.decode,n._codecDataCache={},n.getCodec=function(e){n.encodings||(n.encodings=r(26));for(var t=n._canonicalizeEncoding(e),o={};;){var i=n._codecDataCache[t];if(i)return i;var s=n.encodings[t];switch(typeof s){case"string":t=s;break;case"object":for(var a in s)o[a]=s[a];o.encodingName||(o.encodingName=t),t=s.type;break;case"function":return o.encodingName||(o.encodingName=t),i=new s(o,n),n._codecDataCache[o.encodingName]=i,i;default:throw new Error("Encoding not recognized: '"+e+"' (searched as: '"+t+"')")}}},n._canonicalizeEncoding=function(e){return(""+e).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g,"")},n.getEncoder=function(e,t){var r=n.getCodec(e),o=new r.encoder(t,r);return r.bomAware&&t&&t.addBOM&&(o=new i.PrependBOM(o,t)),o},n.getDecoder=function(e,t){var r=n.getCodec(e),o=new r.decoder(t,r);return!r.bomAware||t&&!1===t.stripBOM||(o=new i.StripBOM(o,t)),o};var s="undefined"!=typeof process&&process.versions&&process.versions.node;if(s){var a=s.split(".").map(Number);(a[0]>0||a[1]>=10)&&r(41)(n),r(42)(n)}},function(e,t){e.exports=require("http")},function(e){e.exports=JSON.parse('[["a140","",62],["a180","",32],["a240","",62],["a280","",32],["a2ab","",5],["a2e3","€"],["a2ef",""],["a2fd",""],["a340","",62],["a380","",31," "],["a440","",62],["a480","",32],["a4f4","",10],["a540","",62],["a580","",32],["a5f7","",7],["a640","",62],["a680","",32],["a6b9","",7],["a6d9","",6],["a6ec",""],["a6f3",""],["a6f6","",8],["a740","",62],["a780","",32],["a7c2","",14],["a7f2","",12],["a896","",10],["a8bc",""],["a8bf","ǹ"],["a8c1",""],["a8ea","",20],["a958",""],["a95b",""],["a95d",""],["a989","〾⿰",11],["a997","",12],["a9f0","",14],["aaa1","",93],["aba1","",93],["aca1","",93],["ada1","",93],["aea1","",93],["afa1","",93],["d7fa","",4],["f8a1","",93],["f9a1","",93],["faa1","",93],["fba1","",93],["fca1","",93],["fda1","",93],["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"],["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93]]')},function(e){e.exports=JSON.parse('[["0","\\u0000",127],["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"],["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21],["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],["a3a1","ㄐ",25,"˙ˉˊˇˋ"],["a3e1","€"],["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]]')},function(e,t,r){var o=r(0),i=r(6),n=r(7);function s(){i.apply(this);var e=this;this.reset=function(){s.prototype.reset.apply(this),this._mActiveNum=0;for(var e,t=0;e=this._mProbers[t];t++)e&&(e.reset(),e.active=!0,this._mActiveNum++);this._mBestGuessProber=null},this.getCharsetName=function(){return this._mBestGuessProber||(this.getConfidence(),this._mBestGuessProber)?this._mBestGuessProber.getCharsetName():null},this.feed=function(e){for(var t,r=0;t=this._mProbers[r];r++)if(t&&t.active){var i=t.feed(e);if(i){if(i==o.foundIt)return this._mBestGuessProber=t,this.getState();if(i==o.notMe&&(t.active=!1,this._mActiveNum--,this._mActiveNum<=0))return this._mState=o.notMe,this.getState()}}return this.getState()},this.getConfidence=function(){var e=this.getState();if(e==o.foundIt)return.99;if(e==o.notMe)return.01;var t=0;this._mBestGuessProber=null;for(var r,i=0;r=this._mProbers[i];i++)if(r)if(r.active){var s=r.getConfidence();n.log(r.getCharsetName()+" confidence = "+s+"\n"),t<s&&(t=s,this._mBestGuessProber=r)}else n.log(r.getCharsetName()+" not active\n");return this._mBestGuessProber?t:0},e._mActiveNum=0,e._mProbers=[],e._mBestGuessProber=null}s.prototype=new i,e.exports=s},function(e,t){function r(){var e=this;this.reset=function(){this._mTotalRel=0,this._mRelSample=[];for(var e=0;e<6;this._mRelSample[e++]=0);this._mNeedToSkipCharNum=0,this._mLastCharOrder=-1,this._mDone=!1},this.feed=function(e,r){if(!this._mDone)for(var o=this._mNeedToSkipCharNum;o<r;){var i=this.getOrder(e.slice(o,o+2)),n=i[0];if((o+=i[1])>r)this._mNeedToSkipCharNum=o-r,this._mLastCharOrder=-1;else{if(-1!=n&&-1!=this._mLastCharOrder){if(this._mTotalRel+=1,this._mTotalRel>1e3){this._mDone=!0;break}this._mRelSample[t.jp2CharContext[this._mLastCharOrder][n]]+=1}this._mLastCharOrder=n}}},this.gotEnoughData=function(){return this._mTotalRel>100},this.getConfidence=function(){return this._mTotalRel>4?(this._mTotalRel-this._mRelSample[0])/this._mTotalRel:-1},this.getOrder=function(e){return[-1,1]},e.reset()}function o(){this.getOrder=function(e){if(!e)return[-1,1];if(e.charCodeAt(0)>=129&&e.charCodeAt(0)<=159||e.charCodeAt(0)>=224&&e.charCodeAt(0)<=252)var t=2;else t=1;return e.length>1&&130==e.charCodeAt(0)&&e.charCodeAt(1)>=159&&e.charCodeAt(0)<=241?[e.charCodeAt(1)-159,t]:[-1,t]}}function i(){this.getOrder=function(e){if(!e)return[-1,1];if(e.charCodeAt(0)>=142||e.charCodeAt(0)>=161&&e.charCodeAt(0)<=254)var t=2;else t=143==e.charCodeAt(0)?3:1;return e.length>1&&164==e.charCodeAt(0)&&e.charCodeAt(1)>=161&&e.charCodeAt(1)<=243?[e.charCodeAt(1)-161,t]:[-1,t]}}t.jp2CharContext=[[0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1],[2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4],[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2],[0,4,0,5,0,5,0,4,0,4,5,4,4,3,5,3,5,1,5,3,4,3,4,4,3,4,3,3,4,3,5,4,4,3,5,5,3,5,5,5,3,5,5,3,4,5,5,3,1,3,2,0,3,4,0,4,2,0,4,2,1,5,3,2,3,5,0,4,0,2,0,5,4,4,5,4,5,0,4,0,0,4,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,4,0,3,0,3,0,4,5,4,3,3,3,3,4,3,5,4,4,3,5,4,4,3,4,3,4,4,4,4,5,3,4,4,3,4,5,5,4,5,5,1,4,5,4,3,0,3,3,1,3,3,0,4,4,0,3,3,1,5,3,3,3,5,0,4,0,3,0,4,4,3,4,3,3,0,4,1,1,3,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,4,0,3,0,3,0,4,0,3,4,4,3,2,2,1,2,1,3,1,3,3,3,3,3,4,3,1,3,3,5,3,3,0,4,3,0,5,4,3,3,5,4,4,3,4,4,5,0,1,2,0,1,2,0,2,2,0,1,0,0,5,2,2,1,4,0,3,0,1,0,4,4,3,5,4,3,0,2,1,0,4,3],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,5,0,4,0,2,1,4,4,2,4,1,4,2,4,2,4,3,3,3,4,3,3,3,3,1,4,2,3,3,3,1,4,4,1,1,1,4,3,3,2,0,2,4,3,2,0,3,3,0,3,1,1,0,0,0,3,3,0,4,2,2,3,4,0,4,0,3,0,4,4,5,3,4,4,0,3,0,0,1,4],[1,4,0,4,0,4,0,4,0,3,5,4,4,3,4,3,5,4,3,3,4,3,5,4,4,4,4,3,4,2,4,3,3,1,5,4,3,2,4,5,4,5,5,4,4,5,4,4,0,3,2,2,3,3,0,4,3,1,3,2,1,4,3,3,4,5,0,3,0,2,0,4,5,5,4,5,4,0,4,0,0,5,4],[0,5,0,5,0,4,0,3,0,4,4,3,4,3,3,3,4,0,4,4,4,3,4,3,4,3,3,1,4,2,4,3,4,0,5,4,1,4,5,4,4,5,3,2,4,3,4,3,2,4,1,3,3,3,2,3,2,0,4,3,3,4,3,3,3,4,0,4,0,3,0,4,5,4,4,4,3,0,4,1,0,1,3],[0,3,1,4,0,3,0,2,0,3,4,4,3,1,4,2,3,3,4,3,4,3,4,3,4,4,3,2,3,1,5,4,4,1,4,4,3,5,4,4,3,5,5,4,3,4,4,3,1,2,3,1,2,2,0,3,2,0,3,1,0,5,3,3,3,4,3,3,3,3,4,4,4,4,5,4,2,0,3,3,2,4,3],[0,2,0,3,0,1,0,1,0,0,3,2,0,0,2,0,1,0,2,1,3,3,3,1,2,3,1,0,1,0,4,2,1,1,3,3,0,4,3,3,1,4,3,3,0,3,3,2,0,0,0,0,1,0,0,2,0,0,0,0,0,4,1,0,2,3,2,2,2,1,3,3,3,4,4,3,2,0,3,1,0,3,3],[0,4,0,4,0,3,0,3,0,4,4,4,3,3,3,3,3,3,4,3,4,2,4,3,4,3,3,2,4,3,4,5,4,1,4,5,3,5,4,5,3,5,4,0,3,5,5,3,1,3,3,2,2,3,0,3,4,1,3,3,2,4,3,3,3,4,0,4,0,3,0,4,5,4,4,5,3,0,4,1,0,3,4],[0,2,0,3,0,3,0,0,0,2,2,2,1,0,1,0,0,0,3,0,3,0,3,0,1,3,1,0,3,1,3,3,3,1,3,3,3,0,1,3,1,3,4,0,0,3,1,1,0,3,2,0,0,0,0,1,3,0,1,0,0,3,3,2,0,3,0,0,0,0,0,3,4,3,4,3,3,0,3,0,0,2,3],[2,3,0,3,0,2,0,1,0,3,3,4,3,1,3,1,1,1,3,1,4,3,4,3,3,3,0,0,3,1,5,4,3,1,4,3,2,5,5,4,4,4,4,3,3,4,4,4,0,2,1,1,3,2,0,1,2,0,0,1,0,4,1,3,3,3,0,3,0,1,0,4,4,4,5,5,3,0,2,0,0,4,4],[0,2,0,1,0,3,1,3,0,2,3,3,3,0,3,1,0,0,3,0,3,2,3,1,3,2,1,1,0,0,4,2,1,0,2,3,1,4,3,2,0,4,4,3,1,3,1,3,0,1,0,0,1,0,0,0,1,0,0,0,0,4,1,1,1,2,0,3,0,0,0,3,4,2,4,3,2,0,1,0,0,3,3],[0,1,0,4,0,5,0,4,0,2,4,4,2,3,3,2,3,3,5,3,3,3,4,3,4,2,3,0,4,3,3,3,4,1,4,3,2,1,5,5,3,4,5,1,3,5,4,2,0,3,3,0,1,3,0,4,2,0,1,3,1,4,3,3,3,3,0,3,0,1,0,3,4,4,4,5,5,0,3,0,1,4,5],[0,2,0,3,0,3,0,0,0,2,3,1,3,0,4,0,1,1,3,0,3,4,3,2,3,1,0,3,3,2,3,1,3,0,2,3,0,2,1,4,1,2,2,0,0,3,3,0,0,2,0,0,0,1,0,0,0,0,2,2,0,3,2,1,3,3,0,2,0,2,0,0,3,3,1,2,4,0,3,0,2,2,3],[2,4,0,5,0,4,0,4,0,2,4,4,4,3,4,3,3,3,1,2,4,3,4,3,4,4,5,0,3,3,3,3,2,0,4,3,1,4,3,4,1,4,4,3,3,4,4,3,1,2,3,0,4,2,0,4,1,0,3,3,0,4,3,3,3,4,0,4,0,2,0,3,5,3,4,5,2,0,3,0,0,4,5],[0,3,0,4,0,1,0,1,0,1,3,2,2,1,3,0,3,0,2,0,2,0,3,0,2,0,0,0,1,0,1,1,0,0,3,1,0,0,0,4,0,3,1,0,2,1,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,4,2,2,3,1,0,3,0,0,0,1,4,4,4,3,0,0,4,0,0,1,4],[1,4,1,5,0,3,0,3,0,4,5,4,4,3,5,3,3,4,4,3,4,1,3,3,3,3,2,1,4,1,5,4,3,1,4,4,3,5,4,4,3,5,4,3,3,4,4,4,0,3,3,1,2,3,0,3,1,0,3,3,0,5,4,4,4,4,4,4,3,3,5,4,4,3,3,5,4,0,3,2,0,4,4],[0,2,0,3,0,1,0,0,0,1,3,3,3,2,4,1,3,0,3,1,3,0,2,2,1,1,0,0,2,0,4,3,1,0,4,3,0,4,4,4,1,4,3,1,1,3,3,1,0,2,0,0,1,3,0,0,0,0,2,0,0,4,3,2,4,3,5,4,3,3,3,4,3,3,4,3,3,0,2,1,0,3,3],[0,2,0,4,0,3,0,2,0,2,5,5,3,4,4,4,4,1,4,3,3,0,4,3,4,3,1,3,3,2,4,3,0,3,4,3,0,3,4,4,2,4,4,0,4,5,3,3,2,2,1,1,1,2,0,1,5,0,3,3,2,4,3,3,3,4,0,3,0,2,0,4,4,3,5,5,0,0,3,0,2,3,3],[0,3,0,4,0,3,0,1,0,3,4,3,3,1,3,3,3,0,3,1,3,0,4,3,3,1,1,0,3,0,3,3,0,0,4,4,0,1,5,4,3,3,5,0,3,3,4,3,0,2,0,1,1,1,0,1,3,0,1,2,1,3,3,2,3,3,0,3,0,1,0,1,3,3,4,4,1,0,1,2,2,1,3],[0,1,0,4,0,4,0,3,0,1,3,3,3,2,3,1,1,0,3,0,3,3,4,3,2,4,2,0,1,0,4,3,2,0,4,3,0,5,3,3,2,4,4,4,3,3,3,4,0,1,3,0,0,1,0,0,1,0,0,0,0,4,2,3,3,3,0,3,0,0,0,4,4,4,5,3,2,0,3,3,0,3,5],[0,2,0,3,0,0,0,3,0,1,3,0,2,0,0,0,1,0,3,1,1,3,3,0,0,3,0,0,3,0,2,3,1,0,3,1,0,3,3,2,0,4,2,2,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,1,0,1,0,0,0,1,3,1,2,0,0,0,1,0,0,1,4],[0,3,0,3,0,5,0,1,0,2,4,3,1,3,3,2,1,1,5,2,1,0,5,1,2,0,0,0,3,3,2,2,3,2,4,3,0,0,3,3,1,3,3,0,2,5,3,4,0,3,3,0,1,2,0,2,2,0,3,2,0,2,2,3,3,3,0,2,0,1,0,3,4,4,2,5,4,0,3,0,0,3,5],[0,3,0,3,0,3,0,1,0,3,3,3,3,0,3,0,2,0,2,1,1,0,2,0,1,0,0,0,2,1,0,0,1,0,3,2,0,0,3,3,1,2,3,1,0,3,3,0,0,1,0,0,0,0,0,2,0,0,0,0,0,2,3,1,2,3,0,3,0,1,0,3,2,1,0,4,3,0,1,1,0,3,3],[0,4,0,5,0,3,0,3,0,4,5,5,4,3,5,3,4,3,5,3,3,2,5,3,4,4,4,3,4,3,4,5,5,3,4,4,3,4,4,5,4,4,4,3,4,5,5,4,2,3,4,2,3,4,0,3,3,1,4,3,2,4,3,3,5,5,0,3,0,3,0,5,5,5,5,4,4,0,4,0,1,4,4],[0,4,0,4,0,3,0,3,0,3,5,4,4,2,3,2,5,1,3,2,5,1,4,2,3,2,3,3,4,3,3,3,3,2,5,4,1,3,3,5,3,4,4,0,4,4,3,1,1,3,1,0,2,3,0,2,3,0,3,0,0,4,3,1,3,4,0,3,0,2,0,4,4,4,3,4,5,0,4,0,0,3,4],[0,3,0,3,0,3,1,2,0,3,4,4,3,3,3,0,2,2,4,3,3,1,3,3,3,1,1,0,3,1,4,3,2,3,4,4,2,4,4,4,3,4,4,3,2,4,4,3,1,3,3,1,3,3,0,4,1,0,2,2,1,4,3,2,3,3,5,4,3,3,5,4,4,3,3,0,4,0,3,2,2,4,4],[0,2,0,1,0,0,0,0,0,1,2,1,3,0,0,0,0,0,2,0,1,2,1,0,0,1,0,0,0,0,3,0,0,1,0,1,1,3,1,0,0,0,1,1,0,1,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,1,2,2,0,3,4,0,0,0,1,1,0,0,1,0,0,0,0,0,1,1],[0,1,0,0,0,1,0,0,0,0,4,0,4,1,4,0,3,0,4,0,3,0,4,0,3,0,3,0,4,1,5,1,4,0,0,3,0,5,0,5,2,0,1,0,0,0,2,1,4,0,1,3,0,0,3,0,0,3,1,1,4,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0],[1,4,0,5,0,3,0,2,0,3,5,4,4,3,4,3,5,3,4,3,3,0,4,3,3,3,3,3,3,2,4,4,3,1,3,4,4,5,4,4,3,4,4,1,3,5,4,3,3,3,1,2,2,3,3,1,3,1,3,3,3,5,3,3,4,5,0,3,0,3,0,3,4,3,4,4,3,0,3,0,2,4,3],[0,1,0,4,0,0,0,0,0,1,4,0,4,1,4,2,4,0,3,0,1,0,1,0,0,0,0,0,2,0,3,1,1,1,0,3,0,0,0,1,2,1,0,0,1,1,1,1,0,1,0,0,0,1,0,0,3,0,0,0,0,3,2,0,2,2,0,1,0,0,0,2,3,2,3,3,0,0,0,0,2,1,0],[0,5,1,5,0,3,0,3,0,5,4,4,5,1,5,3,3,0,4,3,4,3,5,3,4,3,3,2,4,3,4,3,3,0,3,3,1,4,4,3,4,4,4,3,4,5,5,3,2,3,1,1,3,3,1,3,1,1,3,3,2,4,5,3,3,5,0,4,0,3,0,4,4,3,5,3,3,0,3,4,0,4,3],[0,5,0,5,0,3,0,2,0,4,4,3,5,2,4,3,3,3,4,4,4,3,5,3,5,3,3,1,4,0,4,3,3,0,3,3,0,4,4,4,4,5,4,3,3,5,5,3,2,3,1,2,3,2,0,1,0,0,3,2,2,4,4,3,1,5,0,4,0,3,0,4,3,1,3,2,1,0,3,3,0,3,3],[0,4,0,5,0,5,0,4,0,4,5,5,5,3,4,3,3,2,5,4,4,3,5,3,5,3,4,0,4,3,4,4,3,2,4,4,3,4,5,4,4,5,5,0,3,5,5,4,1,3,3,2,3,3,1,3,1,0,4,3,1,4,4,3,4,5,0,4,0,2,0,4,3,4,4,3,3,0,4,0,0,5,5],[0,4,0,4,0,5,0,1,1,3,3,4,4,3,4,1,3,0,5,1,3,0,3,1,3,1,1,0,3,0,3,3,4,0,4,3,0,4,4,4,3,4,4,0,3,5,4,1,0,3,0,0,2,3,0,3,1,0,3,1,0,3,2,1,3,5,0,3,0,1,0,3,2,3,3,4,4,0,2,2,0,4,4],[2,4,0,5,0,4,0,3,0,4,5,5,4,3,5,3,5,3,5,3,5,2,5,3,4,3,3,4,3,4,5,3,2,1,5,4,3,2,3,4,5,3,4,1,2,5,4,3,0,3,3,0,3,2,0,2,3,0,4,1,0,3,4,3,3,5,0,3,0,1,0,4,5,5,5,4,3,0,4,2,0,3,5],[0,5,0,4,0,4,0,2,0,5,4,3,4,3,4,3,3,3,4,3,4,2,5,3,5,3,4,1,4,3,4,4,4,0,3,5,0,4,4,4,4,5,3,1,3,4,5,3,3,3,3,3,3,3,0,2,2,0,3,3,2,4,3,3,3,5,3,4,1,3,3,5,3,2,0,0,0,0,4,3,1,3,3],[0,1,0,3,0,3,0,1,0,1,3,3,3,2,3,3,3,0,3,0,0,0,3,1,3,0,0,0,2,2,2,3,0,0,3,2,0,1,2,4,1,3,3,0,0,3,3,3,0,1,0,0,2,1,0,0,3,0,3,1,0,3,0,0,1,3,0,2,0,1,0,3,3,1,3,3,0,0,1,1,0,3,3],[0,2,0,3,0,2,1,4,0,2,2,3,1,1,3,1,1,0,2,0,3,1,2,3,1,3,0,0,1,0,4,3,2,3,3,3,1,4,2,3,3,3,3,1,0,3,1,4,0,1,1,0,1,2,0,1,1,0,1,1,0,3,1,3,2,2,0,1,0,0,0,2,3,3,3,1,0,0,0,0,0,2,3],[0,5,0,4,0,5,0,2,0,4,5,5,3,3,4,3,3,1,5,4,4,2,4,4,4,3,4,2,4,3,5,5,4,3,3,4,3,3,5,5,4,5,5,1,3,4,5,3,1,4,3,1,3,3,0,3,3,1,4,3,1,4,5,3,3,5,0,4,0,3,0,5,3,3,1,4,3,0,4,0,1,5,3],[0,5,0,5,0,4,0,2,0,4,4,3,4,3,3,3,3,3,5,4,4,4,4,4,4,5,3,3,5,2,4,4,4,3,4,4,3,3,4,4,5,5,3,3,4,3,4,3,3,4,3,3,3,3,1,2,2,1,4,3,3,5,4,4,3,4,0,4,0,3,0,4,4,4,4,4,1,0,4,2,0,2,4],[0,4,0,4,0,3,0,1,0,3,5,2,3,0,3,0,2,1,4,2,3,3,4,1,4,3,3,2,4,1,3,3,3,0,3,3,0,0,3,3,3,5,3,3,3,3,3,2,0,2,0,0,2,0,0,2,0,0,1,0,0,3,1,2,2,3,0,3,0,2,0,4,4,3,3,4,1,0,3,0,0,2,4],[0,0,0,4,0,0,0,0,0,0,1,0,1,0,2,0,0,0,0,0,1,0,2,0,1,0,0,0,0,0,3,1,3,0,3,2,0,0,0,1,0,3,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,0,2,0,0,0,0,0,0,2],[0,2,1,3,0,2,0,2,0,3,3,3,3,1,3,1,3,3,3,3,3,3,4,2,2,1,2,1,4,0,4,3,1,3,3,3,2,4,3,5,4,3,3,3,3,3,3,3,0,1,3,0,2,0,0,1,0,0,1,0,0,4,2,0,2,3,0,3,3,0,3,3,4,2,3,1,4,0,1,2,0,2,3],[0,3,0,3,0,1,0,3,0,2,3,3,3,0,3,1,2,0,3,3,2,3,3,2,3,2,3,1,3,0,4,3,2,0,3,3,1,4,3,3,2,3,4,3,1,3,3,1,1,0,1,1,0,1,0,1,0,1,0,0,0,4,1,1,0,3,0,3,1,0,2,3,3,3,3,3,1,0,0,2,0,3,3],[0,0,0,0,0,0,0,0,0,0,3,0,2,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,3,0,3,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,2,3,0,0,0,0,0,0,0,0,3],[0,2,0,3,1,3,0,3,0,2,3,3,3,1,3,1,3,1,3,1,3,3,3,1,3,0,2,3,1,1,4,3,3,2,3,3,1,2,2,4,1,3,3,0,1,4,2,3,0,1,3,0,3,0,0,1,3,0,2,0,0,3,3,2,1,3,0,3,0,2,0,3,4,4,4,3,1,0,3,0,0,3,3],[0,2,0,1,0,2,0,0,0,1,3,2,2,1,3,0,1,1,3,0,3,2,3,1,2,0,2,0,1,1,3,3,3,0,3,3,1,1,2,3,2,3,3,1,2,3,2,0,0,1,0,0,0,0,0,0,3,0,1,0,0,2,1,2,1,3,0,3,0,0,0,3,4,4,4,3,2,0,2,0,0,2,4],[0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,3,1,0,0,0,0,0,0,0,3],[0,3,0,3,0,2,0,3,0,3,3,3,2,3,2,2,2,0,3,1,3,3,3,2,3,3,0,0,3,0,3,2,2,0,2,3,1,4,3,4,3,3,2,3,1,5,4,4,0,3,1,2,1,3,0,3,1,1,2,0,2,3,1,3,1,3,0,3,0,1,0,3,3,4,4,2,1,0,2,1,0,2,4],[0,1,0,3,0,1,0,2,0,1,4,2,5,1,4,0,2,0,2,1,3,1,4,0,2,1,0,0,2,1,4,1,1,0,3,3,0,5,1,3,2,3,3,1,0,3,2,3,0,1,0,0,0,0,0,0,1,0,0,0,0,4,0,1,0,3,0,2,0,1,0,3,3,3,4,3,3,0,0,0,0,2,3],[0,0,0,1,0,0,0,0,0,0,2,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,1,0,0,0,0,0,3],[0,1,0,3,0,4,0,3,0,2,4,3,1,0,3,2,2,1,3,1,2,2,3,1,1,1,2,1,3,0,1,2,0,1,3,2,1,3,0,5,5,1,0,0,1,3,2,1,0,3,0,0,1,0,0,0,0,0,3,4,0,1,1,1,3,2,0,2,0,1,0,2,3,3,1,2,3,0,1,0,1,0,4],[0,0,0,1,0,3,0,3,0,2,2,1,0,0,4,0,3,0,3,1,3,0,3,0,3,0,1,0,3,0,3,1,3,0,3,3,0,0,1,2,1,1,1,0,1,2,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,2,2,1,2,0,0,2,0,0,0,0,2,3,3,3,3,0,0,0,0,1,4],[0,0,0,3,0,3,0,0,0,0,3,1,1,0,3,0,1,0,2,0,1,0,0,0,0,0,0,0,1,0,3,0,2,0,2,3,0,0,2,2,3,1,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,2,3],[2,4,0,5,0,5,0,4,0,3,4,3,3,3,4,3,3,3,4,3,4,4,5,4,5,5,5,2,3,0,5,5,4,1,5,4,3,1,5,4,3,4,4,3,3,4,3,3,0,3,2,0,2,3,0,3,0,0,3,3,0,5,3,2,3,3,0,3,0,3,0,3,4,5,4,5,3,0,4,3,0,3,4],[0,3,0,3,0,3,0,3,0,3,3,4,3,2,3,2,3,0,4,3,3,3,3,3,3,3,3,0,3,2,4,3,3,1,3,4,3,4,4,4,3,4,4,3,2,4,4,1,0,2,0,0,1,1,0,2,0,0,3,1,0,5,3,2,1,3,0,3,0,1,2,4,3,2,4,3,3,0,3,2,0,4,4],[0,3,0,3,0,1,0,0,0,1,4,3,3,2,3,1,3,1,4,2,3,2,4,2,3,4,3,0,2,2,3,3,3,0,3,3,3,0,3,4,1,3,3,0,3,4,3,3,0,1,1,0,1,0,0,0,4,0,3,0,0,3,1,2,1,3,0,4,0,1,0,4,3,3,4,3,3,0,2,0,0,3,3],[0,3,0,4,0,1,0,3,0,3,4,3,3,0,3,3,3,1,3,1,3,3,4,3,3,3,0,0,3,1,5,3,3,1,3,3,2,5,4,3,3,4,5,3,2,5,3,4,0,1,0,0,0,0,0,2,0,0,1,1,0,4,2,2,1,3,0,3,0,2,0,4,4,3,5,3,2,0,1,1,0,3,4],[0,5,0,4,0,5,0,2,0,4,4,3,3,2,3,3,3,1,4,3,4,1,5,3,4,3,4,0,4,2,4,3,4,1,5,4,0,4,4,4,4,5,4,1,3,5,4,2,1,4,1,1,3,2,0,3,1,0,3,2,1,4,3,3,3,4,0,4,0,3,0,4,4,4,3,3,3,0,4,2,0,3,4],[1,4,0,4,0,3,0,1,0,3,3,3,1,1,3,3,2,2,3,3,1,0,3,2,2,1,2,0,3,1,2,1,2,0,3,2,0,2,2,3,3,4,3,0,3,3,1,2,0,1,1,3,1,2,0,0,3,0,1,1,0,3,2,2,3,3,0,3,0,0,0,2,3,3,4,3,3,0,1,0,0,1,4],[0,4,0,4,0,4,0,0,0,3,4,4,3,1,4,2,3,2,3,3,3,1,4,3,4,0,3,0,4,2,3,3,2,2,5,4,2,1,3,4,3,4,3,1,3,3,4,2,0,2,1,0,3,3,0,0,2,0,3,1,0,4,4,3,4,3,0,4,0,1,0,2,4,4,4,4,4,0,3,2,0,3,3],[0,0,0,1,0,4,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,3,2,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,2],[0,2,0,3,0,4,0,4,0,1,3,3,3,0,4,0,2,1,2,1,1,1,2,0,3,1,1,0,1,0,3,1,0,0,3,3,2,0,1,1,0,0,0,0,0,1,0,2,0,2,2,0,3,1,0,0,1,0,1,1,0,1,2,0,3,0,0,0,0,1,0,0,3,3,4,3,1,0,1,0,3,0,2],[0,0,0,3,0,5,0,0,0,0,1,0,2,0,3,1,0,1,3,0,0,0,2,0,0,0,1,0,0,0,1,1,0,0,4,0,0,0,2,3,0,1,4,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,3,0,0,0,0,0,3],[0,2,0,5,0,5,0,1,0,2,4,3,3,2,5,1,3,2,3,3,3,0,4,1,2,0,3,0,4,0,2,2,1,1,5,3,0,0,1,4,2,3,2,0,3,3,3,2,0,2,4,1,1,2,0,1,1,0,3,1,0,1,3,1,2,3,0,2,0,0,0,1,3,5,4,4,4,0,3,0,0,1,3],[0,4,0,5,0,4,0,4,0,4,5,4,3,3,4,3,3,3,4,3,4,4,5,3,4,5,4,2,4,2,3,4,3,1,4,4,1,3,5,4,4,5,5,4,4,5,5,5,2,3,3,1,4,3,1,3,3,0,3,3,1,4,3,4,4,4,0,3,0,4,0,3,3,4,4,5,0,0,4,3,0,4,5],[0,4,0,4,0,3,0,3,0,3,4,4,4,3,3,2,4,3,4,3,4,3,5,3,4,3,2,1,4,2,4,4,3,1,3,4,2,4,5,5,3,4,5,4,1,5,4,3,0,3,2,2,3,2,1,3,1,0,3,3,3,5,3,3,3,5,4,4,2,3,3,4,3,3,3,2,1,0,3,2,1,4,3],[0,4,0,5,0,4,0,3,0,3,5,5,3,2,4,3,4,0,5,4,4,1,4,4,4,3,3,3,4,3,5,5,2,3,3,4,1,2,5,5,3,5,5,2,3,5,5,4,0,3,2,0,3,3,1,1,5,1,4,1,0,4,3,2,3,5,0,4,0,3,0,5,4,3,4,3,0,0,4,1,0,4,4],[1,3,0,4,0,2,0,2,0,2,5,5,3,3,3,3,3,0,4,2,3,4,4,4,3,4,0,0,3,4,5,4,3,3,3,3,2,5,5,4,5,5,5,4,3,5,5,5,1,3,1,0,1,0,0,3,2,0,4,2,0,5,2,3,2,4,1,3,0,3,0,4,5,4,5,4,3,0,4,2,0,5,4],[0,3,0,4,0,5,0,3,0,3,4,4,3,2,3,2,3,3,3,3,3,2,4,3,3,2,2,0,3,3,3,3,3,1,3,3,3,0,4,4,3,4,4,1,1,4,4,2,0,3,1,0,1,1,0,4,1,0,2,3,1,3,3,1,3,4,0,3,0,1,0,3,1,3,0,0,1,0,2,0,0,4,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,3,0,2,0,3,0,1,5,4,3,3,3,1,4,2,1,2,3,4,4,2,4,4,5,0,3,1,4,3,4,0,4,3,3,3,2,3,2,5,3,4,3,2,2,3,0,0,3,0,2,1,0,1,2,0,0,0,0,2,1,1,3,1,0,2,0,4,0,3,4,4,4,5,2,0,2,0,0,1,3],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,4,2,1,1,0,1,0,3,2,0,0,3,1,1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,2,0,0,0,1,4,0,4,2,1,0,0,0,0,0,1],[0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,3,1,0,0,0,2,0,2,1,0,0,1,2,1,0,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,0,0,2],[0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0,4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3],[0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1]],o.prototype=new r,t.SJISContextAnalysis=o,i.prototype=new r,t.EUCJPContextAnalysis=i},function(e,t){e.exports=require("child_process")},function(e,t){e.exports=require("os")},function(e,t){e.exports=require("https")},function(e,t,r){e.exports=r(43)},function(e,t,r){e.exports=r(77)},function(e,t,r){"use strict";function o(e,t){this.encoder=e,this.addBOM=!0}function i(e,t){this.decoder=e,this.pass=!1,this.options=t||{}}t.PrependBOM=o,o.prototype.write=function(e){return this.addBOM&&(e="\ufeff"+e,this.addBOM=!1),this.encoder.write(e)},o.prototype.end=function(){return this.encoder.end()},t.StripBOM=i,i.prototype.write=function(e){var t=this.decoder.write(e);return this.pass||!t?t:("\ufeff"===t[0]&&(t=t.slice(1),"function"==typeof this.options.stripBOM&&this.options.stripBOM()),this.pass=!0,t)},i.prototype.end=function(){return this.decoder.end()}},function(e,t,r){"use strict";for(var o=[r(27),r(29),r(30),r(31),r(32),r(33),r(34),r(35)],i=0;i<o.length;i++){e=o[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}},function(e,t,r){"use strict";var o=r(8).Buffer;function i(e,t){this.enc=e.encodingName,this.bomAware=e.bomAware,"base64"===this.enc?this.encoder=c:"cesu8"===this.enc&&(this.enc="utf8",this.encoder=h,"💩"!==o.from("eda0bdedb2a9","hex").toString()&&(this.decoder=f,this.defaultCharUnicode=t.defaultCharUnicode))}e.exports={utf8:{type:"_internal",bomAware:!0},cesu8:{type:"_internal",bomAware:!0},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:!0},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},_internal:i},i.prototype.encoder=a,i.prototype.decoder=s;var n=r(28).StringDecoder;function s(e,t){n.call(this,t.enc)}function a(e,t){this.enc=t.enc}function c(e,t){this.prevStr=""}function h(e,t){}function f(e,t){this.acc=0,this.contBytes=0,this.accBytes=0,this.defaultCharUnicode=t.defaultCharUnicode}n.prototype.end||(n.prototype.end=function(){}),s.prototype=n.prototype,a.prototype.write=function(e){return o.from(e,this.enc)},a.prototype.end=function(){},c.prototype.write=function(e){var t=(e=this.prevStr+e).length-e.length%4;return this.prevStr=e.slice(t),e=e.slice(0,t),o.from(e,"base64")},c.prototype.end=function(){return o.from(this.prevStr,"base64")},h.prototype.write=function(e){for(var t=o.alloc(3*e.length),r=0,i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t[r++]=n:n<2048?(t[r++]=192+(n>>>6),t[r++]=128+(63&n)):(t[r++]=224+(n>>>12),t[r++]=128+(n>>>6&63),t[r++]=128+(63&n))}return t.slice(0,r)},h.prototype.end=function(){},f.prototype.write=function(e){for(var t=this.acc,r=this.contBytes,o=this.accBytes,i="",n=0;n<e.length;n++){var s=e[n];128!=(192&s)?(r>0&&(i+=this.defaultCharUnicode,r=0),s<128?i+=String.fromCharCode(s):s<224?(t=31&s,r=1,o=1):s<240?(t=15&s,r=2,o=1):i+=this.defaultCharUnicode):r>0?(t=t<<6|63&s,o++,0===--r&&(i+=2===o&&t<128&&t>0?this.defaultCharUnicode:3===o&&t<2048?this.defaultCharUnicode:String.fromCharCode(t))):i+=this.defaultCharUnicode}return this.acc=t,this.contBytes=r,this.accBytes=o,i},f.prototype.end=function(){var e=0;return this.contBytes>0&&(e+=this.defaultCharUnicode),e}},function(e,t){e.exports=require("string_decoder")},function(e,t,r){"use strict";var o=r(8).Buffer;function i(){}function n(){}function s(){this.overflowByte=-1}function a(e,t){this.iconv=t}function c(e,t){void 0===(e=e||{}).addBOM&&(e.addBOM=!0),this.encoder=t.iconv.getEncoder("utf-16le",e)}function h(e,t){this.decoder=null,this.initialBytes=[],this.initialBytesLen=0,this.options=e||{},this.iconv=t.iconv}function f(e,t){var r=t||"utf-16le";if(e.length>=2)if(254==e[0]&&255==e[1])r="utf-16be";else if(255==e[0]&&254==e[1])r="utf-16le";else{for(var o=0,i=0,n=Math.min(e.length-e.length%2,64),s=0;s<n;s+=2)0===e[s]&&0!==e[s+1]&&i++,0!==e[s]&&0===e[s+1]&&o++;i>o?r="utf-16be":i<o&&(r="utf-16le")}return r}t.utf16be=i,i.prototype.encoder=n,i.prototype.decoder=s,i.prototype.bomAware=!0,n.prototype.write=function(e){for(var t=o.from(e,"ucs2"),r=0;r<t.length;r+=2){var i=t[r];t[r]=t[r+1],t[r+1]=i}return t},n.prototype.end=function(){},s.prototype.write=function(e){if(0==e.length)return"";var t=o.alloc(e.length+1),r=0,i=0;for(-1!==this.overflowByte&&(t[0]=e[0],t[1]=this.overflowByte,r=1,i=2);r<e.length-1;r+=2,i+=2)t[i]=e[r+1],t[i+1]=e[r];return this.overflowByte=r==e.length-1?e[e.length-1]:-1,t.slice(0,i).toString("ucs2")},s.prototype.end=function(){},t.utf16=a,a.prototype.encoder=c,a.prototype.decoder=h,c.prototype.write=function(e){return this.encoder.write(e)},c.prototype.end=function(){return this.encoder.end()},h.prototype.write=function(e){if(!this.decoder){if(this.initialBytes.push(e),this.initialBytesLen+=e.length,this.initialBytesLen<16)return"";var t=f(e=o.concat(this.initialBytes),this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options),this.initialBytes.length=this.initialBytesLen=0}return this.decoder.write(e)},h.prototype.end=function(){if(!this.decoder){var e=o.concat(this.initialBytes),t=f(e,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);var r=this.decoder.write(e),i=this.decoder.end();return i?r+i:r}return this.decoder.end()}},function(e,t,r){"use strict";var o=r(8).Buffer;function i(e,t){this.iconv=t}t.utf7=i,t.unicode11utf7="utf7",i.prototype.encoder=s,i.prototype.decoder=a,i.prototype.bomAware=!0;var n=/[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;function s(e,t){this.iconv=t.iconv}function a(e,t){this.iconv=t.iconv,this.inBase64=!1,this.base64Accum=""}s.prototype.write=function(e){return o.from(e.replace(n,function(e){return"+"+("+"===e?"":this.iconv.encode(e,"utf16-be").toString("base64").replace(/=+$/,""))+"-"}.bind(this)))},s.prototype.end=function(){};for(var c=/[A-Za-z0-9\/+]/,h=[],f=0;f<256;f++)h[f]=c.test(String.fromCharCode(f));var l="+".charCodeAt(0),u="-".charCodeAt(0),d="&".charCodeAt(0);function p(e,t){this.iconv=t}function b(e,t){this.iconv=t.iconv,this.inBase64=!1,this.base64Accum=o.alloc(6),this.base64AccumIdx=0}function m(e,t){this.iconv=t.iconv,this.inBase64=!1,this.base64Accum=""}a.prototype.write=function(e){for(var t="",r=0,i=this.inBase64,n=this.base64Accum,s=0;s<e.length;s++)if(i){if(!h[e[s]]){if(s==r&&e[s]==u)t+="+";else{var a=n+e.slice(r,s).toString();t+=this.iconv.decode(o.from(a,"base64"),"utf16-be")}e[s]!=u&&s--,r=s+1,i=!1,n=""}}else e[s]==l&&(t+=this.iconv.decode(e.slice(r,s),"ascii"),r=s+1,i=!0);if(i){var c=(a=n+e.slice(r).toString()).length-a.length%8;n=a.slice(c),a=a.slice(0,c),t+=this.iconv.decode(o.from(a,"base64"),"utf16-be")}else t+=this.iconv.decode(e.slice(r),"ascii");return this.inBase64=i,this.base64Accum=n,t},a.prototype.end=function(){var e="";return this.inBase64&&this.base64Accum.length>0&&(e=this.iconv.decode(o.from(this.base64Accum,"base64"),"utf16-be")),this.inBase64=!1,this.base64Accum="",e},t.utf7imap=p,p.prototype.encoder=b,p.prototype.decoder=m,p.prototype.bomAware=!0,b.prototype.write=function(e){for(var t=this.inBase64,r=this.base64Accum,i=this.base64AccumIdx,n=o.alloc(5*e.length+10),s=0,a=0;a<e.length;a++){var c=e.charCodeAt(a);32<=c&&c<=126?(t&&(i>0&&(s+=n.write(r.slice(0,i).toString("base64").replace(/\//g,",").replace(/=+$/,""),s),i=0),n[s++]=u,t=!1),t||(n[s++]=c,c===d&&(n[s++]=u))):(t||(n[s++]=d,t=!0),t&&(r[i++]=c>>8,r[i++]=255&c,i==r.length&&(s+=n.write(r.toString("base64").replace(/\//g,","),s),i=0)))}return this.inBase64=t,this.base64AccumIdx=i,n.slice(0,s)},b.prototype.end=function(){var e=o.alloc(10),t=0;return this.inBase64&&(this.base64AccumIdx>0&&(t+=e.write(this.base64Accum.slice(0,this.base64AccumIdx).toString("base64").replace(/\//g,",").replace(/=+$/,""),t),this.base64AccumIdx=0),e[t++]=u,this.inBase64=!1),e.slice(0,t)};var g=h.slice();g[",".charCodeAt(0)]=!0,m.prototype.write=function(e){for(var t="",r=0,i=this.inBase64,n=this.base64Accum,s=0;s<e.length;s++)if(i){if(!g[e[s]]){if(s==r&&e[s]==u)t+="&";else{var a=n+e.slice(r,s).toString().replace(/,/g,"/");t+=this.iconv.decode(o.from(a,"base64"),"utf16-be")}e[s]!=u&&s--,r=s+1,i=!1,n=""}}else e[s]==d&&(t+=this.iconv.decode(e.slice(r,s),"ascii"),r=s+1,i=!0);if(i){var c=(a=n+e.slice(r).toString().replace(/,/g,"/")).length-a.length%8;n=a.slice(c),a=a.slice(0,c),t+=this.iconv.decode(o.from(a,"base64"),"utf16-be")}else t+=this.iconv.decode(e.slice(r),"ascii");return this.inBase64=i,this.base64Accum=n,t},m.prototype.end=function(){var e="";return this.inBase64&&this.base64Accum.length>0&&(e=this.iconv.decode(o.from(this.base64Accum,"base64"),"utf16-be")),this.inBase64=!1,this.base64Accum="",e}},function(e,t,r){"use strict";var o=r(8).Buffer;function i(e,t){if(!e)throw new Error("SBCS codec is called without the data.");if(!e.chars||128!==e.chars.length&&256!==e.chars.length)throw new Error("Encoding '"+e.type+"' has incorrect 'chars' (must be of len 128 or 256)");if(128===e.chars.length){for(var r="",i=0;i<128;i++)r+=String.fromCharCode(i);e.chars=r+e.chars}this.decodeBuf=o.from(e.chars,"ucs2");var n=o.alloc(65536,t.defaultCharSingleByte.charCodeAt(0));for(i=0;i<e.chars.length;i++)n[e.chars.charCodeAt(i)]=i;this.encodeBuf=n}function n(e,t){this.encodeBuf=t.encodeBuf}function s(e,t){this.decodeBuf=t.decodeBuf}t._sbcs=i,i.prototype.encoder=n,i.prototype.decoder=s,n.prototype.write=function(e){for(var t=o.alloc(e.length),r=0;r<e.length;r++)t[r]=this.encodeBuf[e.charCodeAt(r)];return t},n.prototype.end=function(){},s.prototype.write=function(e){for(var t=this.decodeBuf,r=o.alloc(2*e.length),i=0,n=0,s=0;s<e.length;s++)i=2*e[s],r[n=2*s]=t[i],r[n+1]=t[i+1];return r.toString("ucs2")},s.prototype.end=function(){}},function(e,t,r){"use strict";e.exports={10029:"maccenteuro",maccenteuro:{type:"_sbcs",chars:"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"},808:"cp808",ibm808:"cp808",cp808:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "},mik:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ascii8bit:"ascii",usascii:"ascii",ansix34:"ascii",ansix341968:"ascii",ansix341986:"ascii",csascii:"ascii",cp367:"ascii",ibm367:"ascii",isoir6:"ascii",iso646us:"ascii",iso646irv:"ascii",us:"ascii",latin1:"iso88591",latin2:"iso88592",latin3:"iso88593",latin4:"iso88594",latin5:"iso88599",latin6:"iso885910",latin7:"iso885913",latin8:"iso885914",latin9:"iso885915",latin10:"iso885916",csisolatin1:"iso88591",csisolatin2:"iso88592",csisolatin3:"iso88593",csisolatin4:"iso88594",csisolatincyrillic:"iso88595",csisolatinarabic:"iso88596",csisolatingreek:"iso88597",csisolatinhebrew:"iso88598",csisolatin5:"iso88599",csisolatin6:"iso885910",l1:"iso88591",l2:"iso88592",l3:"iso88593",l4:"iso88594",l5:"iso88599",l6:"iso885910",l7:"iso885913",l8:"iso885914",l9:"iso885915",l10:"iso885916",isoir14:"iso646jp",isoir57:"iso646cn",isoir100:"iso88591",isoir101:"iso88592",isoir109:"iso88593",isoir110:"iso88594",isoir144:"iso88595",isoir127:"iso88596",isoir126:"iso88597",isoir138:"iso88598",isoir148:"iso88599",isoir157:"iso885910",isoir166:"tis620",isoir179:"iso885913",isoir199:"iso885914",isoir203:"iso885915",isoir226:"iso885916",cp819:"iso88591",ibm819:"iso88591",cyrillic:"iso88595",arabic:"iso88596",arabic8:"iso88596",ecma114:"iso88596",asmo708:"iso88596",greek:"iso88597",greek8:"iso88597",ecma118:"iso88597",elot928:"iso88597",hebrew:"iso88598",hebrew8:"iso88598",turkish:"iso88599",turkish8:"iso88599",thai:"iso885911",thai8:"iso885911",celtic:"iso885914",celtic8:"iso885914",isoceltic:"iso885914",tis6200:"tis620",tis62025291:"tis620",tis62025330:"tis620",1e4:"macroman",10006:"macgreek",10007:"maccyrillic",10079:"maciceland",10081:"macturkish",cspc8codepage437:"cp437",cspc775baltic:"cp775",cspc850multilingual:"cp850",cspcp852:"cp852",cspc862latinhebrew:"cp862",cpgr:"cp869",msee:"cp1250",mscyrl:"cp1251",msansi:"cp1252",msgreek:"cp1253",msturk:"cp1254",mshebr:"cp1255",msarab:"cp1256",winbaltrim:"cp1257",cp20866:"koi8r",20866:"koi8r",ibm878:"koi8r",cskoi8r:"koi8r",cp21866:"koi8u",21866:"koi8u",ibm1168:"koi8u",strk10482002:"rk1048",tcvn5712:"tcvn",tcvn57121:"tcvn",gb198880:"iso646cn",cn:"iso646cn",csiso14jisc6220ro:"iso646jp",jisc62201969ro:"iso646jp",jp:"iso646jp",cshproman8:"hproman8",r8:"hproman8",roman8:"hproman8",xroman8:"hproman8",ibm1051:"hproman8",mac:"macintosh",csmacintosh:"macintosh"}},function(e,t,r){"use strict";e.exports={437:"cp437",737:"cp737",775:"cp775",850:"cp850",852:"cp852",855:"cp855",856:"cp856",857:"cp857",858:"cp858",860:"cp860",861:"cp861",862:"cp862",863:"cp863",864:"cp864",865:"cp865",866:"cp866",869:"cp869",874:"windows874",922:"cp922",1046:"cp1046",1124:"cp1124",1125:"cp1125",1129:"cp1129",1133:"cp1133",1161:"cp1161",1162:"cp1162",1163:"cp1163",1250:"windows1250",1251:"windows1251",1252:"windows1252",1253:"windows1253",1254:"windows1254",1255:"windows1255",1256:"windows1256",1257:"windows1257",1258:"windows1258",28591:"iso88591",28592:"iso88592",28593:"iso88593",28594:"iso88594",28595:"iso88595",28596:"iso88596",28597:"iso88597",28598:"iso88598",28599:"iso88599",28600:"iso885910",28601:"iso885911",28603:"iso885913",28604:"iso885914",28605:"iso885915",28606:"iso885916",windows874:{type:"_sbcs",chars:"€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},win874:"windows874",cp874:"windows874",windows1250:{type:"_sbcs",chars:"€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"},win1250:"windows1250",cp1250:"windows1250",windows1251:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},win1251:"windows1251",cp1251:"windows1251",windows1252:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},win1252:"windows1252",cp1252:"windows1252",windows1253:{type:"_sbcs",chars:"€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"},win1253:"windows1253",cp1253:"windows1253",windows1254:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"},win1254:"windows1254",cp1254:"windows1254",windows1255:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"},win1255:"windows1255",cp1255:"windows1255",windows1256:{type:"_sbcs",chars:"€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے"},win1256:"windows1256",cp1256:"windows1256",windows1257:{type:"_sbcs",chars:"€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"},win1257:"windows1257",cp1257:"windows1257",windows1258:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},win1258:"windows1258",cp1258:"windows1258",iso88591:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},cp28591:"iso88591",iso88592:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"},cp28592:"iso88592",iso88593:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"},cp28593:"iso88593",iso88594:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"},cp28594:"iso88594",iso88595:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"},cp28595:"iso88595",iso88596:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"},cp28596:"iso88596",iso88597:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"},cp28597:"iso88597",iso88598:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"},cp28598:"iso88598",iso88599:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"},cp28599:"iso88599",iso885910:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"},cp28600:"iso885910",iso885911:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},cp28601:"iso885911",iso885913:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"},cp28603:"iso885913",iso885914:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"},cp28604:"iso885914",iso885915:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},cp28605:"iso885915",iso885916:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"},cp28606:"iso885916",cp437:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm437:"cp437",csibm437:"cp437",cp737:{type:"_sbcs",chars:"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "},ibm737:"cp737",csibm737:"cp737",cp775:{type:"_sbcs",chars:"ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ "},ibm775:"cp775",csibm775:"cp775",cp850:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "},ibm850:"cp850",csibm850:"cp850",cp852:{type:"_sbcs",chars:"ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ "},ibm852:"cp852",csibm852:"cp852",cp855:{type:"_sbcs",chars:"ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ "},ibm855:"cp855",csibm855:"cp855",cp856:{type:"_sbcs",chars:"אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ "},ibm856:"cp856",csibm856:"cp856",cp857:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ "},ibm857:"cp857",csibm857:"cp857",cp858:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "},ibm858:"cp858",csibm858:"cp858",cp860:{type:"_sbcs",chars:"ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm860:"cp860",csibm860:"cp860",cp861:{type:"_sbcs",chars:"ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm861:"cp861",csibm861:"cp861",cp862:{type:"_sbcs",chars:"אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm862:"cp862",csibm862:"cp862",cp863:{type:"_sbcs",chars:"ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm863:"cp863",csibm863:"cp863",cp864:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csibm1163:"cp1163",maccroatian:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"},maccyrillic:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},macgreek:{type:"_sbcs",chars:"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"},maciceland:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macroman:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macromania:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macthai:{type:"_sbcs",chars:"«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\ufeff​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"},macturkish:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"},macukraine:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},koi8r:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8u:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8ru:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8t:{type:"_sbcs",chars:"қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},armscii8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"},rk1048:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},tcvn:{type:"_sbcs",chars:"\0ÚỤỪỬỮ\b\t\n\v\f\rỨỰỲỶỸÝỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"},georgianacademy:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:"\0ẲẴẪ\b\t\n\v\f\rỶỸỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"},iso646cn:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},iso646jp:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}},function(e,t,r){"use strict";var o=r(8).Buffer;t._dbcs=s;for(var i=new Array(256),n=0;n<256;n++)i[n]=-1;function s(e,t){if(this.encodingName=e.encodingName,!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var r=e.table();this.decodeTables=[],this.decodeTables[0]=i.slice(0),this.decodeTableSeq=[];for(var o=0;o<r.length;o++)this._addDecodeChunk(r[o]);this.defaultCharUnicode=t.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var n={};if(e.encodeSkipVals)for(o=0;o<e.encodeSkipVals.length;o++){var s=e.encodeSkipVals[o];if("number"==typeof s)n[s]=!0;else for(var a=s.from;a<=s.to;a++)n[a]=!0}if(this._fillEncodeTable(0,0,n),e.encodeAdd)for(var c in e.encodeAdd)Object.prototype.hasOwnProperty.call(e.encodeAdd,c)&&this._setEncodeChar(c.charCodeAt(0),e.encodeAdd[c]);if(this.defCharSB=this.encodeTable[0][t.defaultCharSingleByte.charCodeAt(0)],-1===this.defCharSB&&(this.defCharSB=this.encodeTable[0]["?"]),-1===this.defCharSB&&(this.defCharSB="?".charCodeAt(0)),"function"==typeof e.gb18030){this.gb18030=e.gb18030();var h=this.decodeTables.length,f=this.decodeTables[h]=i.slice(0),l=this.decodeTables.length,u=this.decodeTables[l]=i.slice(0);for(o=129;o<=254;o++){var d=-1e3-this.decodeTables[0][o],p=this.decodeTables[d];for(a=48;a<=57;a++)p[a]=-1e3-h}for(o=129;o<=254;o++)f[o]=-1e3-l;for(o=48;o<=57;o++)u[o]=-2}}function a(e,t){this.leadSurrogate=-1,this.seqObj=void 0,this.encodeTable=t.encodeTable,this.encodeTableSeq=t.encodeTableSeq,this.defaultCharSingleByte=t.defCharSB,this.gb18030=t.gb18030}function c(e,t){this.nodeIdx=0,this.prevBuf=o.alloc(0),this.decodeTables=t.decodeTables,this.decodeTableSeq=t.decodeTableSeq,this.defaultCharUnicode=t.defaultCharUnicode,this.gb18030=t.gb18030}function h(e,t){if(e[0]>t)return-1;for(var r=0,o=e.length;r<o-1;){var i=r+Math.floor((o-r+1)/2);e[i]<=t?r=i:o=i}return r}s.prototype.encoder=a,s.prototype.decoder=c,s.prototype._getDecodeTrieNode=function(e){for(var t=[];e>0;e>>=8)t.push(255&e);0==t.length&&t.push(0);for(var r=this.decodeTables[0],o=t.length-1;o>0;o--){var n=r[t[o]];if(-1==n)r[t[o]]=-1e3-this.decodeTables.length,this.decodeTables.push(r=i.slice(0));else{if(!(n<=-1e3))throw new Error("Overwrite byte in "+this.encodingName+", addr: "+e.toString(16));r=this.decodeTables[-1e3-n]}}return r},s.prototype._addDecodeChunk=function(e){var t=parseInt(e[0],16),r=this._getDecodeTrieNode(t);t&=255;for(var o=1;o<e.length;o++){var i=e[o];if("string"==typeof i)for(var n=0;n<i.length;){var s=i.charCodeAt(n++);if(55296<=s&&s<56320){var a=i.charCodeAt(n++);if(!(56320<=a&&a<57344))throw new Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+e[0]);r[t++]=65536+1024*(s-55296)+(a-56320)}else if(4080<s&&s<=4095){for(var c=4095-s+2,h=[],f=0;f<c;f++)h.push(i.charCodeAt(n++));r[t++]=-10-this.decodeTableSeq.length,this.decodeTableSeq.push(h)}else r[t++]=s}else{if("number"!=typeof i)throw new Error("Incorrect type '"+typeof i+"' given in "+this.encodingName+" at chunk "+e[0]);var l=r[t-1]+1;for(n=0;n<i;n++)r[t++]=l++}}if(t>255)throw new Error("Incorrect chunk in "+this.encodingName+" at addr "+e[0]+": too long"+t)},s.prototype._getEncodeBucket=function(e){var t=e>>8;return void 0===this.encodeTable[t]&&(this.encodeTable[t]=i.slice(0)),this.encodeTable[t]},s.prototype._setEncodeChar=function(e,t){var r=this._getEncodeBucket(e),o=255&e;r[o]<=-10?this.encodeTableSeq[-10-r[o]][-1]=t:-1==r[o]&&(r[o]=t)},s.prototype._setEncodeSequence=function(e,t){var r,o=e[0],i=this._getEncodeBucket(o),n=255&o;i[n]<=-10?r=this.encodeTableSeq[-10-i[n]]:(r={},-1!==i[n]&&(r[-1]=i[n]),i[n]=-10-this.encodeTableSeq.length,this.encodeTableSeq.push(r));for(var s=1;s<e.length-1;s++){var a=r[o];"object"==typeof a?r=a:(r=r[o]={},void 0!==a&&(r[-1]=a))}r[o=e[e.length-1]]=t},s.prototype._fillEncodeTable=function(e,t,r){for(var o=this.decodeTables[e],i=0;i<256;i++){var n=o[i],s=t+i;r[s]||(n>=0?this._setEncodeChar(n,s):n<=-1e3?this._fillEncodeTable(-1e3-n,s<<8,r):n<=-10&&this._setEncodeSequence(this.decodeTableSeq[-10-n],s))}},a.prototype.write=function(e){for(var t=o.alloc(e.length*(this.gb18030?4:3)),r=this.leadSurrogate,i=this.seqObj,n=-1,s=0,a=0;;){if(-1===n){if(s==e.length)break;var c=e.charCodeAt(s++)}else{c=n;n=-1}if(55296<=c&&c<57344)if(c<56320){if(-1===r){r=c;continue}r=c,c=-1}else-1!==r?(c=65536+1024*(r-55296)+(c-56320),r=-1):c=-1;else-1!==r&&(n=c,c=-1,r=-1);var f=-1;if(void 0!==i&&-1!=c){var l=i[c];if("object"==typeof l){i=l;continue}"number"==typeof l?f=l:null==l&&void 0!==(l=i[-1])&&(f=l,n=c),i=void 0}else if(c>=0){var u=this.encodeTable[c>>8];if(void 0!==u&&(f=u[255&c]),f<=-10){i=this.encodeTableSeq[-10-f];continue}if(-1==f&&this.gb18030){var d=h(this.gb18030.uChars,c);if(-1!=d){f=this.gb18030.gbChars[d]+(c-this.gb18030.uChars[d]);t[a++]=129+Math.floor(f/12600),f%=12600,t[a++]=48+Math.floor(f/1260),f%=1260,t[a++]=129+Math.floor(f/10),f%=10,t[a++]=48+f;continue}}}-1===f&&(f=this.defaultCharSingleByte),f<256?t[a++]=f:f<65536?(t[a++]=f>>8,t[a++]=255&f):(t[a++]=f>>16,t[a++]=f>>8&255,t[a++]=255&f)}return this.seqObj=i,this.leadSurrogate=r,t.slice(0,a)},a.prototype.end=function(){if(-1!==this.leadSurrogate||void 0!==this.seqObj){var e=o.alloc(10),t=0;if(this.seqObj){var r=this.seqObj[-1];void 0!==r&&(r<256?e[t++]=r:(e[t++]=r>>8,e[t++]=255&r)),this.seqObj=void 0}return-1!==this.leadSurrogate&&(e[t++]=this.defaultCharSingleByte,this.leadSurrogate=-1),e.slice(0,t)}},a.prototype.findIdx=h,c.prototype.write=function(e){var t=o.alloc(2*e.length),r=this.nodeIdx,i=this.prevBuf,n=this.prevBuf.length,s=-this.prevBuf.length;n>0&&(i=o.concat([i,e.slice(0,10)]));for(var a=0,c=0;a<e.length;a++){var f,l=a>=0?e[a]:i[a+n];if((f=this.decodeTables[r][l])>=0);else if(-1===f)a=s,f=this.defaultCharUnicode.charCodeAt(0);else if(-2===f){var u=s>=0?e.slice(s,a+1):i.slice(s+n,a+1+n),d=12600*(u[0]-129)+1260*(u[1]-48)+10*(u[2]-129)+(u[3]-48),p=h(this.gb18030.gbChars,d);f=this.gb18030.uChars[p]+d-this.gb18030.gbChars[p]}else{if(f<=-1e3){r=-1e3-f;continue}if(!(f<=-10))throw new Error("iconv-lite internal error: invalid decoding table value "+f+" at "+r+"/"+l);for(var b=this.decodeTableSeq[-10-f],m=0;m<b.length-1;m++)f=b[m],t[c++]=255&f,t[c++]=f>>8;f=b[b.length-1]}if(f>65535){f-=65536;var g=55296+Math.floor(f/1024);t[c++]=255&g,t[c++]=g>>8,f=56320+f%1024}t[c++]=255&f,t[c++]=f>>8,r=0,s=a+1}return this.nodeIdx=r,this.prevBuf=s>=0?e.slice(s):i.slice(s+n),t.slice(0,c).toString("ucs2")},c.prototype.end=function(){for(var e="";this.prevBuf.length>0;){e+=this.defaultCharUnicode;var t=this.prevBuf.slice(1);this.prevBuf=o.alloc(0),this.nodeIdx=0,t.length>0&&(e+=this.write(t))}return this.nodeIdx=0,e}},function(e,t,r){"use strict";e.exports={shiftjis:{type:"_dbcs",table:function(){return r(36)},encodeAdd:{"¥":92,"‾":126},encodeSkipVals:[{from:60736,to:63808}]},csshiftjis:"shiftjis",mskanji:"shiftjis",sjis:"shiftjis",windows31j:"shiftjis",ms31j:"shiftjis",xsjis:"shiftjis",windows932:"shiftjis",ms932:"shiftjis",932:"shiftjis",cp932:"shiftjis",eucjp:{type:"_dbcs",table:function(){return r(37)},encodeAdd:{"¥":92,"‾":126}},gb2312:"cp936",gb231280:"cp936",gb23121980:"cp936",csgb2312:"cp936",csiso58gb231280:"cp936",euccn:"cp936",windows936:"cp936",ms936:"cp936",936:"cp936",cp936:{type:"_dbcs",table:function(){return r(13)}},gbk:{type:"_dbcs",table:function(){return r(13).concat(r(16))}},xgbk:"gbk",isoir58:"gbk",gb18030:{type:"_dbcs",table:function(){return r(13).concat(r(16))},gb18030:function(){return r(38)},encodeSkipVals:[128],encodeAdd:{"€":41699}},chinese:"gb18030",windows949:"cp949",ms949:"cp949",949:"cp949",cp949:{type:"_dbcs",table:function(){return r(39)}},cseuckr:"cp949",csksc56011987:"cp949",euckr:"cp949",isoir149:"cp949",korean:"cp949",ksc56011987:"cp949",ksc56011989:"cp949",ksc5601:"cp949",windows950:"cp950",ms950:"cp950",950:"cp950",cp950:{type:"_dbcs",table:function(){return r(17)}},big5:"big5hkscs",big5hkscs:{type:"_dbcs",table:function(){return r(17).concat(r(40))},encodeSkipVals:[41676]},cnbig5:"big5hkscs",csbig5:"big5hkscs",xxbig5:"big5hkscs"}},function(e){e.exports=JSON.parse('[["0","\\u0000",128],["a1","。",62],["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"],["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"],["81b8","∈∋⊆⊇⊂⊃∪∩"],["81c8","∧∨¬⇒⇔∀∃"],["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["81f0","ʼn♯♭♪†‡¶"],["81fc","◯"],["824f","0",9],["8260","A",25],["8281","a",25],["829f","ぁ",82],["8340","ァ",62],["8380","ム",22],["839f","Α",16,"Σ",6],["83bf","α",16,"σ",6],["8440","А",5,"ЁЖ",25],["8470","а",5,"ёж",7],["8480","о",17],["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["8740","①",19,"Ⅰ",9],["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["877e","㍻"],["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"],["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"],["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"],["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"],["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"],["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"],["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"],["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"],["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"],["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"],["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"],["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"],["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"],["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"],["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"],["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"],["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"],["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"],["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"],["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"],["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"],["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"],["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"],["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"],["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"],["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"],["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"],["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"],["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"],["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"],["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"],["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"],["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"],["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"],["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"],["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"],["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["eeef","ⅰ",9,"¬¦'""],["f040","",62],["f080","",124],["f140","",62],["f180","",124],["f240","",62],["f280","",124],["f340","",62],["f380","",124],["f440","",62],["f480","",124],["f540","",62],["f580","",124],["f640","",62],["f680","",124],["f740","",62],["f780","",124],["f840","",62],["f880","",124],["f940",""],["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"],["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"],["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"],["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"],["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"]]')},function(e){e.exports=JSON.parse('[["0","\\u0000",127],["8ea1","。",62],["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"],["a2a1","◆□■△▲▽▼※〒→←↑↓〓"],["a2ba","∈∋⊆⊇⊂⊃∪∩"],["a2ca","∧∨¬⇒⇔∀∃"],["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["a2f2","ʼn♯♭♪†‡¶"],["a2fe","◯"],["a3b0","0",9],["a3c1","A",25],["a3e1","a",25],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["ada1","①",19,"Ⅰ",9],["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"],["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"],["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"],["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"],["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"],["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"],["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"],["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"],["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"],["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"],["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"],["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"],["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"],["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"],["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"],["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"],["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"],["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"],["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"],["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"],["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"],["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"],["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"],["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"],["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"],["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"],["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"],["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"],["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"],["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"],["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"],["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"],["f4a1","堯槇遙瑤凜熙"],["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"],["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"],["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["fcf1","ⅰ",9,"¬¦'""],["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"],["8fa2c2","¡¦¿"],["8fa2eb","ºª©®™¤№"],["8fa6e1","ΆΈΉΊΪ"],["8fa6e7","Ό"],["8fa6e9","ΎΫ"],["8fa6ec","Ώ"],["8fa6f1","άέήίϊΐόςύϋΰώ"],["8fa7c2","Ђ",10,"ЎЏ"],["8fa7f2","ђ",10,"ўџ"],["8fa9a1","ÆĐ"],["8fa9a4","Ħ"],["8fa9a6","IJ"],["8fa9a8","ŁĿ"],["8fa9ab","ŊØŒ"],["8fa9af","ŦÞ"],["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"],["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"],["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"],["8fabbd","ġĥíìïîǐ"],["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"],["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"],["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"],["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"],["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"],["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"],["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"],["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"],["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"],["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"],["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"],["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"],["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"],["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"],["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"],["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"],["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"],["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"],["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"],["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"],["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"],["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"],["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"],["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"],["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"],["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"],["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"],["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"],["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"],["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"],["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"],["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"],["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"],["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"],["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"],["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5],["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"],["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"],["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"],["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"],["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"],["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"],["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"],["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"],["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"],["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"],["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"],["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"],["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"],["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"],["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"],["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"],["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"],["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"],["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"],["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"],["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"],["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"],["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4],["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"],["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"],["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"],["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"]]')},function(e){e.exports=JSON.parse('{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}')},function(e){e.exports=JSON.parse('[["0","\\u0000",127],["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"],["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"],["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"],["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5],["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"],["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18],["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7],["8361","긝",18,"긲긳긵긶긹긻긼"],["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8],["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8],["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18],["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"],["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4],["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"],["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"],["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"],["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10],["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"],["8741","놞",9,"놩",15],["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"],["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4],["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4],["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"],["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"],["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"],["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"],["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15],["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"],["8a61","둧",4,"둭",18,"뒁뒂"],["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"],["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"],["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8],["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18],["8c41","똀",15,"똒똓똕똖똗똙",4],["8c61","똞",6,"똦",5,"똭",6,"똵",5],["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16],["8d41","뛃",16,"뛕",8],["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"],["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"],["8e41","랟랡",6,"랪랮",5,"랶랷랹",8],["8e61","럂",4,"럈럊",19],["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7],["8f41","뢅",7,"뢎",17],["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4],["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5],["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"],["9061","륾",5,"릆릈릋릌릏",15],["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"],["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5],["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5],["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6],["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"],["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4],["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"],["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"],["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8],["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"],["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8],["9461","봞",5,"봥",6,"봭",12],["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24],["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"],["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"],["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14],["9641","뺸",23,"뻒뻓"],["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8],["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44],["9741","뾃",16,"뾕",8],["9761","뾞",17,"뾱",7],["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"],["9841","쁀",16,"쁒",5,"쁙쁚쁛"],["9861","쁝쁞쁟쁡",6,"쁪",15],["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"],["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"],["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"],["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"],["9a41","숤숥숦숧숪숬숮숰숳숵",16],["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"],["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"],["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8],["9b61","쌳",17,"썆",7],["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"],["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5],["9c61","쏿",8,"쐉",6,"쐑",9],["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12],["9d41","쒪",13,"쒹쒺쒻쒽",8],["9d61","쓆",25],["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"],["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"],["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"],["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"],["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"],["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"],["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"],["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"],["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13],["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"],["a141","좥좦좧좩",18,"좾좿죀죁"],["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"],["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"],["a241","줐줒",5,"줙",18],["a261","줭",6,"줵",18],["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"],["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"],["a361","즑",6,"즚즜즞",16],["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"],["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"],["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12],["a481","쨦쨧쨨쨪",28,"ㄱ",93],["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"],["a561","쩫",17,"쩾",5,"쪅쪆"],["a581","쪇",16,"쪙",14,"ⅰ",9],["a5b0","Ⅰ",9],["a5c1","Α",16,"Σ",6],["a5e1","α",16,"σ",6],["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"],["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6],["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7],["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7],["a761","쬪",22,"쭂쭃쭄"],["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"],["a841","쭭",10,"쭺",14],["a861","쮉",18,"쮝",6],["a881","쮤",19,"쮹",11,"ÆÐªĦ"],["a8a6","IJ"],["a8a8","ĿŁØŒºÞŦŊ"],["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"],["a941","쯅",14,"쯕",10],["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18],["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"],["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"],["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"],["aa81","챳챴챶",29,"ぁ",82],["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"],["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5],["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85],["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"],["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4],["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25],["acd1","а",5,"ёж",25],["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7],["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"],["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"],["ae41","췆",5,"췍췎췏췑",16],["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4],["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"],["af41","츬츭츮츯츲츴츶",19],["af61","칊",13,"칚칛칝칞칢",5,"칪칬"],["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"],["b041","캚",5,"캢캦",5,"캮",12],["b061","캻",5,"컂",19],["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"],["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"],["b161","켥",6,"켮켲",5,"켹",11],["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"],["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"],["b261","쾎",18,"쾢",5,"쾩"],["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"],["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"],["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5],["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"],["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5],["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"],["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"],["b541","킕",14,"킦킧킩킪킫킭",5],["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4],["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"],["b641","턅",7,"턎",17],["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"],["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"],["b741","텮",13,"텽",6,"톅톆톇톉톊"],["b761","톋",20,"톢톣톥톦톧"],["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"],["b841","퇐",7,"퇙",17],["b861","퇫",8,"퇵퇶퇷퇹",13],["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"],["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"],["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"],["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"],["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"],["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5],["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"],["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"],["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"],["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"],["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"],["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"],["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"],["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"],["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13],["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"],["be41","퐸",7,"푁푂푃푅",14],["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"],["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"],["bf41","풞",10,"풪",14],["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"],["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"],["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5],["c061","픞",25],["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"],["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"],["c161","햌햍햎햏햑",19,"햦햧"],["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"],["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"],["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"],["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"],["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4],["c361","홢",4,"홨홪",5,"홲홳홵",11],["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"],["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"],["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4],["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"],["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"],["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4],["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"],["c641","힍힎힏힑",6,"힚힜힞",5],["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"],["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"],["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"],["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"],["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"],["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"],["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"],["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"],["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"],["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"],["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"],["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"],["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"],["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"],["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"],["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"],["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"],["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"],["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"],["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"],["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"],["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"],["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"],["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"],["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"],["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"],["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"],["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"],["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"],["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"],["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"],["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"],["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"],["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"],["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"],["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"],["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"],["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"],["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"],["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"],["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"],["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"],["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"],["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"],["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"],["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"],["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"],["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"],["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"],["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"],["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"],["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"],["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"],["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"],["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"]]')},function(e){e.exports=JSON.parse('[["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"],["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"],["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"],["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"],["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"],["8940","𪎩𡅅"],["8943","攊"],["8946","丽滝鵎釟"],["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"],["89a1","琑糼緍楆竉刧"],["89ab","醌碸酞肼"],["89b0","贋胶𠧧"],["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"],["89c1","溚舾甙"],["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"],["8a40","𧶄唥"],["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"],["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"],["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"],["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"],["8aac","䠋𠆩㿺塳𢶍"],["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"],["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"],["8ac9","𪘁𠸉𢫏𢳉"],["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"],["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"],["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"],["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"],["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"],["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"],["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"],["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"],["8ca1","𣏹椙橃𣱣泿"],["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"],["8cc9","顨杫䉶圽"],["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"],["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"],["8d40","𠮟"],["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"],["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"],["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"],["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"],["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"],["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"],["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"],["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"],["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"],["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"],["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"],["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"],["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"],["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"],["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"],["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"],["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"],["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"],["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"],["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"],["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"],["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"],["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"],["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"],["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"],["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"],["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"],["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"],["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"],["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"],["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"],["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"],["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"],["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"],["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"],["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"],["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"],["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"],["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"],["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"],["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"],["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"],["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"],["9fae","酙隁酜"],["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"],["9fc1","𤤙盖鮝个𠳔莾衂"],["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"],["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"],["9fe7","毺蠘罸"],["9feb","嘠𪙊蹷齓"],["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"],["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"],["a055","𡠻𦸅"],["a058","詾𢔛"],["a05b","惽癧髗鵄鍮鮏蟵"],["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"],["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"],["a0a1","嵗𨯂迚𨸹"],["a0a6","僙𡵆礆匲阸𠼻䁥"],["a0ae","矾"],["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"],["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"],["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"],["a3c0","␀",31,"␡"],["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23],["c740","す",58,"ァアィイ"],["c7a1","ゥ",81,"А",5,"ЁЖ",4],["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"],["c8a1","龰冈龱𧘇"],["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"],["c8f5","ʃɐɛɔɵœøŋʊɪ"],["f9fe","■"],["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"],["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"],["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"],["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"],["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"],["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"],["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"],["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"],["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"],["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"]]')},function(e,t,r){"use strict";var o=r(11).Buffer,i=r(2).Transform;function n(e,t){this.conv=e,(t=t||{}).decodeStrings=!1,i.call(this,t)}function s(e,t){this.conv=e,(t=t||{}).encoding=this.encoding="utf8",i.call(this,t)}e.exports=function(e){e.encodeStream=function(t,r){return new n(e.getEncoder(t,r),r)},e.decodeStream=function(t,r){return new s(e.getDecoder(t,r),r)},e.supportsStreams=!0,e.IconvLiteEncoderStream=n,e.IconvLiteDecoderStream=s,e._collect=s.prototype.collect},n.prototype=Object.create(i.prototype,{constructor:{value:n}}),n.prototype._transform=function(e,t,r){if("string"!=typeof e)return r(new Error("Iconv encoding stream needs strings as its input."));try{var o=this.conv.write(e);o&&o.length&&this.push(o),r()}catch(e){r(e)}},n.prototype._flush=function(e){try{var t=this.conv.end();t&&t.length&&this.push(t),e()}catch(t){e(t)}},n.prototype.collect=function(e){var t=[];return this.on("error",e),this.on("data",(function(e){t.push(e)})),this.on("end",(function(){e(null,o.concat(t))})),this},s.prototype=Object.create(i.prototype,{constructor:{value:s}}),s.prototype._transform=function(e,t,r){if(!o.isBuffer(e))return r(new Error("Iconv decoding stream needs buffers as its input."));try{var i=this.conv.write(e);i&&i.length&&this.push(i,this.encoding),r()}catch(e){r(e)}},s.prototype._flush=function(e){try{var t=this.conv.end();t&&t.length&&this.push(t,this.encoding),e()}catch(t){e(t)}},s.prototype.collect=function(e){var t="";return this.on("error",e),this.on("data",(function(e){t+=e})),this.on("end",(function(){e(null,t)})),this}},function(e,t,r){"use strict";var o=r(11).Buffer;e.exports=function(e){var t=void 0;e.supportsNodeEncodingsExtension=!(o.from||new o(0)instanceof Uint8Array),e.extendNodeEncodings=function(){if(!t){if(t={},!e.supportsNodeEncodingsExtension)return console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node"),void console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility");var i={hex:!0,utf8:!0,"utf-8":!0,ascii:!0,binary:!0,base64:!0,ucs2:!0,"ucs-2":!0,utf16le:!0,"utf-16le":!0};o.isNativeEncoding=function(e){return e&&i[e.toLowerCase()]};var n=r(11).SlowBuffer;if(t.SlowBufferToString=n.prototype.toString,n.prototype.toString=function(r,i,n){return r=String(r||"utf8").toLowerCase(),o.isNativeEncoding(r)?t.SlowBufferToString.call(this,r,i,n):(void 0===i&&(i=0),void 0===n&&(n=this.length),e.decode(this.slice(i,n),r))},t.SlowBufferWrite=n.prototype.write,n.prototype.write=function(r,i,n,s){if(isFinite(i))isFinite(n)||(s=n,n=void 0);else{var a=s;s=i,i=n,n=a}i=+i||0;var c=this.length-i;if(n?(n=+n)>c&&(n=c):n=c,s=String(s||"utf8").toLowerCase(),o.isNativeEncoding(s))return t.SlowBufferWrite.call(this,r,i,n,s);if(r.length>0&&(n<0||i<0))throw new RangeError("attempt to write beyond buffer bounds");var h=e.encode(r,s);return h.length<n&&(n=h.length),h.copy(this,i,0,n),n},t.BufferIsEncoding=o.isEncoding,o.isEncoding=function(t){return o.isNativeEncoding(t)||e.encodingExists(t)},t.BufferByteLength=o.byteLength,o.byteLength=n.byteLength=function(r,i){return i=String(i||"utf8").toLowerCase(),o.isNativeEncoding(i)?t.BufferByteLength.call(this,r,i):e.encode(r,i).length},t.BufferToString=o.prototype.toString,o.prototype.toString=function(r,i,n){return r=String(r||"utf8").toLowerCase(),o.isNativeEncoding(r)?t.BufferToString.call(this,r,i,n):(void 0===i&&(i=0),void 0===n&&(n=this.length),e.decode(this.slice(i,n),r))},t.BufferWrite=o.prototype.write,o.prototype.write=function(r,i,n,s){var a=i,c=n,h=s;if(isFinite(i))isFinite(n)||(s=n,n=void 0);else{var f=s;s=i,i=n,n=f}if(s=String(s||"utf8").toLowerCase(),o.isNativeEncoding(s))return t.BufferWrite.call(this,r,a,c,h);i=+i||0;var l=this.length-i;if(n?(n=+n)>l&&(n=l):n=l,r.length>0&&(n<0||i<0))throw new RangeError("attempt to write beyond buffer bounds");var u=e.encode(r,s);return u.length<n&&(n=u.length),u.copy(this,i,0,n),n},e.supportsStreams){var s=r(2).Readable;t.ReadableSetEncoding=s.prototype.setEncoding,s.prototype.setEncoding=function(t,r){this._readableState.decoder=e.getDecoder(t,r),this._readableState.encoding=t},s.prototype.collect=e._collect}}},e.undoExtendNodeEncodings=function(){if(e.supportsNodeEncodingsExtension){if(!t)throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.");delete o.isNativeEncoding;var i=r(11).SlowBuffer;if(i.prototype.toString=t.SlowBufferToString,i.prototype.write=t.SlowBufferWrite,o.isEncoding=t.BufferIsEncoding,o.byteLength=t.BufferByteLength,o.prototype.toString=t.BufferToString,o.prototype.write=t.BufferWrite,e.supportsStreams){var n=r(2).Readable;n.prototype.setEncoding=t.ReadableSetEncoding,delete n.prototype.collect}t=void 0}}}},function(e,t,r){var o=r(44),i=r(7).setLogger;t.detect=function(e,t){var r=new o(t);return r.reset(),"function"==typeof Buffer&&e instanceof Buffer?r.feed(e.toString("binary")):r.feed(e),r.close(),r.result},t.UniversalDetector=o,t.enableDebug=function(){i(console.log.bind(console))}},function(e,t,r){var o=r(0),i=r(45),n=r(65),s=r(74),a=r(75),c=r(7);e.exports=function(e){e||(e={}),e.minimumThreshold||(e.minimumThreshold=.2);var t=0,r=1,h=2,f=this;this.reset=function(){this.result={encoding:null,confidence:0},this.done=!1,this._mStart=!0,this._mGotData=!1,this._mInputState=t,this._mLastChar="",this._mBOM="",this._mEscCharsetProber&&this._mEscCharsetProber.reset();for(var e,r=0;e=this._mCharsetProbers[r];r++)e.reset()},this.feed=function(e){if(!this.done&&e.length)if(this._mGotData||(this._mBOM+=e,""==this._mBOM.slice(0,3)?this.result={encoding:"UTF-8",confidence:1}:"ÿþ\0\0"==this._mBOM.slice(0,4)?this.result={encoding:"UTF-32LE",confidence:1}:"\0\0þÿ"==this._mBOM.slice(0,4)?this.result={encoding:"UTF-32BE",confidence:1}:"þÿ\0\0"==this._mBOM.slice(0,4)?this.result={encoding:"X-ISO-10646-UCS-4-3412",confidence:1}:"\0\0ÿþ"==this._mBOM.slice(0,4)?this.result={encoding:"X-ISO-10646-UCS-4-2143",confidence:1}:"ÿþ"==this._mBOM.slice(0,2)?this.result={encoding:"UTF-16LE",confidence:1}:"þÿ"==this._mBOM.slice(0,2)&&(this.result={encoding:"UTF-16BE",confidence:1}),this._mBOM.length>3&&(this._mGotData=!0)),this.result.encoding&&this.result.confidence>0)this.done=!0;else if(this._mInputState==t&&(this._highBitDetector.test(e)?this._mInputState=h:this._escDetector.test(this._mLastChar+e)&&(this._mInputState=r)),this._mLastChar=e.slice(-1),this._mInputState==r)this._mEscCharsetProber||(this._mEscCharsetProber=new a),this._mEscCharsetProber.feed(e)==o.foundIt&&(this.result={encoding:this._mEscCharsetProber.getCharsetName(),confidence:this._mEscCharsetProber.getConfidence()},this.done=!0);else if(this._mInputState==h){0==this._mCharsetProbers.length&&(this._mCharsetProbers=[new i,new n,new s]);for(var c,f=0;c=this._mCharsetProbers[f];f++)if(c.feed(e)==o.foundIt){this.result={encoding:c.getCharsetName(),confidence:c.getConfidence()},this.done=!0;break}}},this.close=function(){if(!this.done)if(0!==this._mBOM.length){if(this.done=!0,this._mInputState==t)return c.log("pure ascii"),this.result={encoding:"ascii",confidence:1},this.result;if(this._mInputState==h){for(var r=null,o=0,i=null,n=0;s=this._mCharsetProbers[n];n++)s&&((r=s.getConfidence())>o&&(o=r,i=s),c.log(s.getCharsetName()+" confidence "+s.getConfidence()));if(i&&o>e.minimumThreshold)return this.result={encoding:i.getCharsetName(),confidence:i.getConfidence()},this.result}if(c.enabled){c.log("no probers hit minimum threshhold\n");var s;for(n=0;s=this._mCharsetProbers[n];n++)s&&c.log(s.getCharsetName()+" confidence = "+s.getConfidence()+"\n")}}else c.log("no data received!\n")},f._highBitDetector=/[\x80-\xFF]/,f._escDetector=/(\x1B|~\{)/,f._mEscCharsetProber=null,f._mCharsetProbers=[],f.reset()}},function(e,t,r){var o=r(18),i=r(46),n=r(53),s=r(55),a=r(57),c=r(59),h=r(61),f=r(63);function l(){o.apply(this),this._mProbers=[new n,new s,new a,new c,new h,new i,new f],this.reset()}l.prototype=new o,e.exports=l},function(e,t,r){var o=r(4),i=r(9),n=r(47),s=r(10).Big5DistributionAnalysis;function a(){i.apply(this);var e=this;this.getCharsetName=function(){return"Big5"},e._mCodingSM=new o(n),e._mDistributionAnalyzer=new s,e.reset()}a.prototype=new i,e.exports=a},function(e,t,r){var o=r(0),i=[o.error,o.start,o.start,3,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.error,o.error,o.start,o.start,o.start,o.start,o.start,o.start,o.start];e.exports={classTable:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0],classFactor:5,stateTable:i,charLenTable:[0,1,1,2,0],name:"Big5"}},function(e,t){t.JIS_TYPICAL_DISTRIBUTION_RATIO=3,t.JIS_TABLE_SIZE=4368,t.JISCharToFreqOrder=[40,1,6,182,152,180,295,2127,285,381,3295,4304,3068,4606,3165,3510,3511,1822,2785,4607,1193,2226,5070,4608,171,2996,1247,18,179,5071,856,1661,1262,5072,619,127,3431,3512,3230,1899,1700,232,228,1294,1298,284,283,2041,2042,1061,1062,48,49,44,45,433,434,1040,1041,996,787,2997,1255,4305,2108,4609,1684,1648,5073,5074,5075,5076,5077,5078,3687,5079,4610,5080,3927,3928,5081,3296,3432,290,2285,1471,2187,5082,2580,2825,1303,2140,1739,1445,2691,3375,1691,3297,4306,4307,4611,452,3376,1182,2713,3688,3069,4308,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,4097,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,5150,5151,5152,4612,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,1472,598,618,820,1205,1309,1412,1858,1307,1692,5176,5177,5178,5179,5180,5181,5182,1142,1452,1234,1172,1875,2043,2149,1793,1382,2973,925,2404,1067,1241,960,1377,2935,1491,919,1217,1865,2030,1406,1499,2749,4098,5183,5184,5185,5186,5187,5188,2561,4099,3117,1804,2049,3689,4309,3513,1663,5189,3166,3118,3298,1587,1561,3433,5190,3119,1625,2998,3299,4613,1766,3690,2786,4614,5191,5192,5193,5194,2161,26,3377,2,3929,20,3691,47,4100,50,17,16,35,268,27,243,42,155,24,154,29,184,4,91,14,92,53,396,33,289,9,37,64,620,21,39,321,5,12,11,52,13,3,208,138,0,7,60,526,141,151,1069,181,275,1591,83,132,1475,126,331,829,15,69,160,59,22,157,55,1079,312,109,38,23,25,10,19,79,5195,61,382,1124,8,30,5196,5197,5198,5199,5200,5201,5202,5203,5204,5205,5206,89,62,74,34,2416,112,139,196,271,149,84,607,131,765,46,88,153,683,76,874,101,258,57,80,32,364,121,1508,169,1547,68,235,145,2999,41,360,3027,70,63,31,43,259,262,1383,99,533,194,66,93,846,217,192,56,106,58,565,280,272,311,256,146,82,308,71,100,128,214,655,110,261,104,1140,54,51,36,87,67,3070,185,2618,2936,2020,28,1066,2390,2059,5207,5208,5209,5210,5211,5212,5213,5214,5215,5216,4615,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,3514,5237,5238,5239,5240,5241,5242,5243,5244,2297,2031,4616,4310,3692,5245,3071,5246,3598,5247,4617,3231,3515,5248,4101,4311,4618,3808,4312,4102,5249,4103,4104,3599,5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,363,642,2787,2878,2788,2789,2316,3232,2317,3434,2011,165,1942,3930,3931,3932,3933,5382,4619,5383,4620,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744,5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6e3,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,2044,2060,4621,997,1235,473,1186,4622,920,3378,6115,6116,379,1108,4313,2657,2735,3934,6117,3809,636,3233,573,1026,3693,3435,2974,3300,2298,4105,854,2937,2463,393,2581,2417,539,752,1280,2750,2480,140,1161,440,708,1569,665,2497,1746,1291,1523,3e3,164,1603,847,1331,537,1997,486,508,1693,2418,1970,2227,878,1220,299,1030,969,652,2751,624,1137,3301,2619,65,3302,2045,1761,1859,3120,1930,3694,3516,663,1767,852,835,3695,269,767,2826,2339,1305,896,1150,770,1616,6118,506,1502,2075,1012,2519,775,2520,2975,2340,2938,4314,3028,2086,1224,1943,2286,6119,3072,4315,2240,1273,1987,3935,1557,175,597,985,3517,2419,2521,1416,3029,585,938,1931,1007,1052,1932,1685,6120,3379,4316,4623,804,599,3121,1333,2128,2539,1159,1554,2032,3810,687,2033,2904,952,675,1467,3436,6121,2241,1096,1786,2440,1543,1924,980,1813,2228,781,2692,1879,728,1918,3696,4624,548,1950,4625,1809,1088,1356,3303,2522,1944,502,972,373,513,2827,586,2377,2391,1003,1976,1631,6122,2464,1084,648,1776,4626,2141,324,962,2012,2177,2076,1384,742,2178,1448,1173,1810,222,102,301,445,125,2420,662,2498,277,200,1476,1165,1068,224,2562,1378,1446,450,1880,659,791,582,4627,2939,3936,1516,1274,555,2099,3697,1020,1389,1526,3380,1762,1723,1787,2229,412,2114,1900,2392,3518,512,2597,427,1925,2341,3122,1653,1686,2465,2499,697,330,273,380,2162,951,832,780,991,1301,3073,965,2270,3519,668,2523,2636,1286,535,1407,518,671,957,2658,2378,267,611,2197,3030,6123,248,2299,967,1799,2356,850,1418,3437,1876,1256,1480,2828,1718,6124,6125,1755,1664,2405,6126,4628,2879,2829,499,2179,676,4629,557,2329,2214,2090,325,3234,464,811,3001,992,2342,2481,1232,1469,303,2242,466,1070,2163,603,1777,2091,4630,2752,4631,2714,322,2659,1964,1768,481,2188,1463,2330,2857,3600,2092,3031,2421,4632,2318,2070,1849,2598,4633,1302,2254,1668,1701,2422,3811,2905,3032,3123,2046,4106,1763,1694,4634,1604,943,1724,1454,917,868,2215,1169,2940,552,1145,1800,1228,1823,1955,316,1080,2510,361,1807,2830,4107,2660,3381,1346,1423,1134,4108,6127,541,1263,1229,1148,2540,545,465,1833,2880,3438,1901,3074,2482,816,3937,713,1788,2500,122,1575,195,1451,2501,1111,6128,859,374,1225,2243,2483,4317,390,1033,3439,3075,2524,1687,266,793,1440,2599,946,779,802,507,897,1081,528,2189,1292,711,1866,1725,1167,1640,753,398,2661,1053,246,348,4318,137,1024,3440,1600,2077,2129,825,4319,698,238,521,187,2300,1157,2423,1641,1605,1464,1610,1097,2541,1260,1436,759,2255,1814,2150,705,3235,409,2563,3304,561,3033,2005,2564,726,1956,2343,3698,4109,949,3812,3813,3520,1669,653,1379,2525,881,2198,632,2256,1027,778,1074,733,1957,514,1481,2466,554,2180,702,3938,1606,1017,1398,6129,1380,3521,921,993,1313,594,449,1489,1617,1166,768,1426,1360,495,1794,3601,1177,3602,1170,4320,2344,476,425,3167,4635,3168,1424,401,2662,1171,3382,1998,1089,4110,477,3169,474,6130,1909,596,2831,1842,494,693,1051,1028,1207,3076,606,2115,727,2790,1473,1115,743,3522,630,805,1532,4321,2021,366,1057,838,684,1114,2142,4322,2050,1492,1892,1808,2271,3814,2424,1971,1447,1373,3305,1090,1536,3939,3523,3306,1455,2199,336,369,2331,1035,584,2393,902,718,2600,6131,2753,463,2151,1149,1611,2467,715,1308,3124,1268,343,1413,3236,1517,1347,2663,2093,3940,2022,1131,1553,2100,2941,1427,3441,2942,1323,2484,6132,1980,872,2368,2441,2943,320,2369,2116,1082,679,1933,3941,2791,3815,625,1143,2023,422,2200,3816,6133,730,1695,356,2257,1626,2301,2858,2637,1627,1778,937,883,2906,2693,3002,1769,1086,400,1063,1325,3307,2792,4111,3077,456,2345,1046,747,6134,1524,884,1094,3383,1474,2164,1059,974,1688,2181,2258,1047,345,1665,1187,358,875,3170,305,660,3524,2190,1334,1135,3171,1540,1649,2542,1527,927,968,2793,885,1972,1850,482,500,2638,1218,1109,1085,2543,1654,2034,876,78,2287,1482,1277,861,1675,1083,1779,724,2754,454,397,1132,1612,2332,893,672,1237,257,2259,2370,135,3384,337,2244,547,352,340,709,2485,1400,788,1138,2511,540,772,1682,2260,2272,2544,2013,1843,1902,4636,1999,1562,2288,4637,2201,1403,1533,407,576,3308,1254,2071,978,3385,170,136,1201,3125,2664,3172,2394,213,912,873,3603,1713,2202,699,3604,3699,813,3442,493,531,1054,468,2907,1483,304,281,4112,1726,1252,2094,339,2319,2130,2639,756,1563,2944,748,571,2976,1588,2425,2715,1851,1460,2426,1528,1392,1973,3237,288,3309,685,3386,296,892,2716,2216,1570,2245,722,1747,2217,905,3238,1103,6135,1893,1441,1965,251,1805,2371,3700,2601,1919,1078,75,2182,1509,1592,1270,2640,4638,2152,6136,3310,3817,524,706,1075,292,3818,1756,2602,317,98,3173,3605,3525,1844,2218,3819,2502,814,567,385,2908,1534,6137,534,1642,3239,797,6138,1670,1529,953,4323,188,1071,538,178,729,3240,2109,1226,1374,2e3,2357,2977,731,2468,1116,2014,2051,6139,1261,1593,803,2859,2736,3443,556,682,823,1541,6140,1369,2289,1706,2794,845,462,2603,2665,1361,387,162,2358,1740,739,1770,1720,1304,1401,3241,1049,627,1571,2427,3526,1877,3942,1852,1500,431,1910,1503,677,297,2795,286,1433,1038,1198,2290,1133,1596,4113,4639,2469,1510,1484,3943,6141,2442,108,712,4640,2372,866,3701,2755,3242,1348,834,1945,1408,3527,2395,3243,1811,824,994,1179,2110,1548,1453,790,3003,690,4324,4325,2832,2909,3820,1860,3821,225,1748,310,346,1780,2470,821,1993,2717,2796,828,877,3528,2860,2471,1702,2165,2910,2486,1789,453,359,2291,1676,73,1164,1461,1127,3311,421,604,314,1037,589,116,2487,737,837,1180,111,244,735,6142,2261,1861,1362,986,523,418,581,2666,3822,103,855,503,1414,1867,2488,1091,657,1597,979,605,1316,4641,1021,2443,2078,2001,1209,96,587,2166,1032,260,1072,2153,173,94,226,3244,819,2006,4642,4114,2203,231,1744,782,97,2667,786,3387,887,391,442,2219,4326,1425,6143,2694,633,1544,1202,483,2015,592,2052,1958,2472,1655,419,129,4327,3444,3312,1714,1257,3078,4328,1518,1098,865,1310,1019,1885,1512,1734,469,2444,148,773,436,1815,1868,1128,1055,4329,1245,2756,3445,2154,1934,1039,4643,579,1238,932,2320,353,205,801,115,2428,944,2321,1881,399,2565,1211,678,766,3944,335,2101,1459,1781,1402,3945,2737,2131,1010,844,981,1326,1013,550,1816,1545,2620,1335,1008,371,2881,936,1419,1613,3529,1456,1395,2273,1834,2604,1317,2738,2503,416,1643,4330,806,1126,229,591,3946,1314,1981,1576,1837,1666,347,1790,977,3313,764,2861,1853,688,2429,1920,1462,77,595,415,2002,3034,798,1192,4115,6144,2978,4331,3035,2695,2582,2072,2566,430,2430,1727,842,1396,3947,3702,613,377,278,236,1417,3388,3314,3174,757,1869,107,3530,6145,1194,623,2262,207,1253,2167,3446,3948,492,1117,1935,536,1838,2757,1246,4332,696,2095,2406,1393,1572,3175,1782,583,190,253,1390,2230,830,3126,3389,934,3245,1703,1749,2979,1870,2545,1656,2204,869,2346,4116,3176,1817,496,1764,4644,942,1504,404,1903,1122,1580,3606,2945,1022,515,372,1735,955,2431,3036,6146,2797,1110,2302,2798,617,6147,441,762,1771,3447,3607,3608,1904,840,3037,86,939,1385,572,1370,2445,1336,114,3703,898,294,203,3315,703,1583,2274,429,961,4333,1854,1951,3390,2373,3704,4334,1318,1381,966,1911,2322,1006,1155,309,989,458,2718,1795,1372,1203,252,1689,1363,3177,517,1936,168,1490,562,193,3823,1042,4117,1835,551,470,4645,395,489,3448,1871,1465,2583,2641,417,1493,279,1295,511,1236,1119,72,1231,1982,1812,3004,871,1564,984,3449,1667,2696,2096,4646,2347,2833,1673,3609,695,3246,2668,807,1183,4647,890,388,2333,1801,1457,2911,1765,1477,1031,3316,3317,1278,3391,2799,2292,2526,163,3450,4335,2669,1404,1802,6148,2323,2407,1584,1728,1494,1824,1269,298,909,3318,1034,1632,375,776,1683,2061,291,210,1123,809,1249,1002,2642,3038,206,1011,2132,144,975,882,1565,342,667,754,1442,2143,1299,2303,2062,447,626,2205,1221,2739,2912,1144,1214,2206,2584,760,1715,614,950,1281,2670,2621,810,577,1287,2546,4648,242,2168,250,2643,691,123,2644,647,313,1029,689,1357,2946,1650,216,771,1339,1306,808,2063,549,913,1371,2913,2914,6149,1466,1092,1174,1196,1311,2605,2396,1783,1796,3079,406,2671,2117,3949,4649,487,1825,2220,6150,2915,448,2348,1073,6151,2397,1707,130,900,1598,329,176,1959,2527,1620,6152,2275,4336,3319,1983,2191,3705,3610,2155,3706,1912,1513,1614,6153,1988,646,392,2304,1589,3320,3039,1826,1239,1352,1340,2916,505,2567,1709,1437,2408,2547,906,6154,2672,384,1458,1594,1100,1329,710,423,3531,2064,2231,2622,1989,2673,1087,1882,333,841,3005,1296,2882,2379,580,1937,1827,1293,2585,601,574,249,1772,4118,2079,1120,645,901,1176,1690,795,2207,478,1434,516,1190,1530,761,2080,930,1264,355,435,1552,644,1791,987,220,1364,1163,1121,1538,306,2169,1327,1222,546,2645,218,241,610,1704,3321,1984,1839,1966,2528,451,6155,2586,3707,2568,907,3178,254,2947,186,1845,4650,745,432,1757,428,1633,888,2246,2221,2489,3611,2118,1258,1265,956,3127,1784,4337,2490,319,510,119,457,3612,274,2035,2007,4651,1409,3128,970,2758,590,2800,661,2247,4652,2008,3950,1420,1549,3080,3322,3951,1651,1375,2111,485,2491,1429,1156,6156,2548,2183,1495,831,1840,2529,2446,501,1657,307,1894,3247,1341,666,899,2156,1539,2549,1559,886,349,2208,3081,2305,1736,3824,2170,2759,1014,1913,1386,542,1397,2948,490,368,716,362,159,282,2569,1129,1658,1288,1750,2674,276,649,2016,751,1496,658,1818,1284,1862,2209,2087,2512,3451,622,2834,376,117,1060,2053,1208,1721,1101,1443,247,1250,3179,1792,3952,2760,2398,3953,6157,2144,3708,446,2432,1151,2570,3452,2447,2761,2835,1210,2448,3082,424,2222,1251,2449,2119,2836,504,1581,4338,602,817,857,3825,2349,2306,357,3826,1470,1883,2883,255,958,929,2917,3248,302,4653,1050,1271,1751,2307,1952,1430,2697,2719,2359,354,3180,777,158,2036,4339,1659,4340,4654,2308,2949,2248,1146,2232,3532,2720,1696,2623,3827,6158,3129,1550,2698,1485,1297,1428,637,931,2721,2145,914,2550,2587,81,2450,612,827,2646,1242,4655,1118,2884,472,1855,3181,3533,3534,569,1353,2699,1244,1758,2588,4119,2009,2762,2171,3709,1312,1531,6159,1152,1938,134,1830,471,3710,2276,1112,1535,3323,3453,3535,982,1337,2950,488,826,674,1058,1628,4120,2017,522,2399,211,568,1367,3454,350,293,1872,1139,3249,1399,1946,3006,1300,2360,3324,588,736,6160,2606,744,669,3536,3828,6161,1358,199,723,848,933,851,1939,1505,1514,1338,1618,1831,4656,1634,3613,443,2740,3829,717,1947,491,1914,6162,2551,1542,4121,1025,6163,1099,1223,198,3040,2722,370,410,1905,2589,998,1248,3182,2380,519,1449,4122,1710,947,928,1153,4341,2277,344,2624,1511,615,105,161,1212,1076,1960,3130,2054,1926,1175,1906,2473,414,1873,2801,6164,2309,315,1319,3325,318,2018,2146,2157,963,631,223,4342,4343,2675,479,3711,1197,2625,3712,2676,2361,6165,4344,4123,6166,2451,3183,1886,2184,1674,1330,1711,1635,1506,799,219,3250,3083,3954,1677,3713,3326,2081,3614,1652,2073,4657,1147,3041,1752,643,1961,147,1974,3955,6167,1716,2037,918,3007,1994,120,1537,118,609,3184,4345,740,3455,1219,332,1615,3830,6168,1621,2980,1582,783,212,553,2350,3714,1349,2433,2082,4124,889,6169,2310,1275,1410,973,166,1320,3456,1797,1215,3185,2885,1846,2590,2763,4658,629,822,3008,763,940,1990,2862,439,2409,1566,1240,1622,926,1282,1907,2764,654,2210,1607,327,1130,3956,1678,1623,6170,2434,2192,686,608,3831,3715,903,3957,3042,6171,2741,1522,1915,1105,1555,2552,1359,323,3251,4346,3457,738,1354,2553,2311,2334,1828,2003,3832,1753,2351,1227,6172,1887,4125,1478,6173,2410,1874,1712,1847,520,1204,2607,264,4659,836,2677,2102,600,4660,3833,2278,3084,6174,4347,3615,1342,640,532,543,2608,1888,2400,2591,1009,4348,1497,341,1737,3616,2723,1394,529,3252,1321,983,4661,1515,2120,971,2592,924,287,1662,3186,4349,2700,4350,1519,908,1948,2452,156,796,1629,1486,2223,2055,694,4126,1259,1036,3392,1213,2249,2742,1889,1230,3958,1015,910,408,559,3617,4662,746,725,935,4663,3959,3009,1289,563,867,4664,3960,1567,2981,2038,2626,988,2263,2381,4351,143,2374,704,1895,6175,1188,3716,2088,673,3085,2362,4352,484,1608,1921,2765,2918,215,904,3618,3537,894,509,976,3043,2701,3961,4353,2837,2982,498,6176,6177,1102,3538,1332,3393,1487,1636,1637,233,245,3962,383,650,995,3044,460,1520,1206,2352,749,3327,530,700,389,1438,1560,1773,3963,2264,719,2951,2724,3834,870,1832,1644,1e3,839,2474,3717,197,1630,3394,365,2886,3964,1285,2133,734,922,818,1106,732,480,2083,1774,3458,923,2279,1350,221,3086,85,2233,2234,3835,1585,3010,2147,1387,1705,2382,1619,2475,133,239,2802,1991,1016,2084,2383,411,2838,1113,651,1985,1160,3328,990,1863,3087,1048,1276,2647,265,2627,1599,3253,2056,150,638,2019,656,853,326,1479,680,1439,4354,1001,1759,413,3459,3395,2492,1431,459,4355,1125,3329,2265,1953,1450,2065,2863,849,351,2678,3131,3254,3255,1104,1577,227,1351,1645,2453,2193,1421,2887,812,2121,634,95,2435,201,2312,4665,1646,1671,2743,1601,2554,2702,2648,2280,1315,1366,2089,3132,1573,3718,3965,1729,1189,328,2679,1077,1940,1136,558,1283,964,1195,621,2074,1199,1743,3460,3619,1896,1916,1890,3836,2952,1154,2112,1064,862,378,3011,2066,2113,2803,1568,2839,6178,3088,2919,1941,1660,2004,1992,2194,142,707,1590,1708,1624,1922,1023,1836,1233,1004,2313,789,741,3620,6179,1609,2411,1200,4127,3719,3720,4666,2057,3721,593,2840,367,2920,1878,6180,3461,1521,628,1168,692,2211,2649,300,720,2067,2571,2953,3396,959,2504,3966,3539,3462,1977,701,6181,954,1043,800,681,183,3722,1803,1730,3540,4128,2103,815,2314,174,467,230,2454,1093,2134,755,3541,3397,1141,1162,6182,1738,2039,270,3256,2513,1005,1647,2185,3837,858,1679,1897,1719,2954,2324,1806,402,670,167,4129,1498,2158,2104,750,6183,915,189,1680,1551,455,4356,1501,2455,405,1095,2955,338,1586,1266,1819,570,641,1324,237,1556,2650,1388,3723,6184,1368,2384,1343,1978,3089,2436,879,3724,792,1191,758,3012,1411,2135,1322,4357,240,4667,1848,3725,1574,6185,420,3045,1546,1391,714,4358,1967,941,1864,863,664,426,560,1731,2680,1785,2864,1949,2363,403,3330,1415,1279,2136,1697,2335,204,721,2097,3838,90,6186,2085,2505,191,3967,124,2148,1376,1798,1178,1107,1898,1405,860,4359,1243,1272,2375,2983,1558,2456,1638,113,3621,578,1923,2609,880,386,4130,784,2186,2266,1422,2956,2172,1722,497,263,2514,1267,2412,2610,177,2703,3542,774,1927,1344,616,1432,1595,1018,172,4360,2325,911,4361,438,1468,3622,794,3968,2024,2173,1681,1829,2957,945,895,3090,575,2212,2476,475,2401,2681,785,2744,1745,2293,2555,1975,3133,2865,394,4668,3839,635,4131,639,202,1507,2195,2766,1345,1435,2572,3726,1908,1184,1181,2457,3727,3134,4362,843,2611,437,916,4669,234,769,1884,3046,3047,3623,833,6187,1639,2250,2402,1355,1185,2010,2047,999,525,1732,1290,1488,2612,948,1578,3728,2413,2477,1216,2725,2159,334,3840,1328,3624,2921,1525,4132,564,1056,891,4363,1444,1698,2385,2251,3729,1365,2281,2235,1717,6188,864,3841,2515,444,527,2767,2922,3625,544,461,6189,566,209,2437,3398,2098,1065,2068,3331,3626,3257,2137,2138,2122,3730,2888,1995,1820,1044,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,4670,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,3187,6238,6239,3969,6240,6241,6242,6243,6244,4671,6245,6246,4672,6247,6248,4133,6249,6250,4364,6251,2923,2556,2613,4673,4365,3970,6252,6253,6254,6255,4674,6256,6257,6258,2768,2353,4366,4675,4676,3188,4367,3463,6259,4134,4677,4678,6260,2267,6261,3842,3332,4368,3543,6262,6263,6264,3013,1954,1928,4135,4679,6265,6266,2478,3091,6267,4680,4369,6268,6269,1699,6270,3544,4136,4681,6271,4137,6272,4370,2804,6273,6274,2593,3971,3972,4682,6275,2236,4683,6276,6277,4684,6278,6279,4138,3973,4685,6280,6281,3258,6282,6283,6284,6285,3974,4686,2841,3975,6286,6287,3545,6288,6289,4139,4687,4140,6290,4141,6291,4142,6292,6293,3333,6294,6295,6296,4371,6297,3399,6298,6299,4372,3976,6300,6301,6302,4373,6303,6304,3843,3731,6305,4688,4374,6306,6307,3259,2294,6308,3732,2530,4143,6309,4689,6310,6311,6312,3048,6313,6314,4690,3733,2237,6315,6316,2282,3334,6317,6318,3844,6319,6320,4691,6321,3400,4692,6322,4693,6323,3049,6324,4375,6325,3977,6326,6327,6328,3546,6329,4694,3335,6330,4695,4696,6331,6332,6333,6334,4376,3978,6335,4697,3979,4144,6336,3980,4698,6337,6338,6339,6340,6341,4699,4700,4701,6342,6343,4702,6344,6345,4703,6346,6347,4704,6348,4705,4706,3135,6349,4707,6350,4708,6351,4377,6352,4709,3734,4145,6353,2506,4710,3189,6354,3050,4711,3981,6355,3547,3014,4146,4378,3735,2651,3845,3260,3136,2224,1986,6356,3401,6357,4712,2594,3627,3137,2573,3736,3982,4713,3628,4714,4715,2682,3629,4716,6358,3630,4379,3631,6359,6360,6361,3983,6362,6363,6364,6365,4147,3846,4717,6366,6367,3737,2842,6368,4718,2628,6369,3261,6370,2386,6371,6372,3738,3984,4719,3464,4720,3402,6373,2924,3336,4148,2866,6374,2805,3262,4380,2704,2069,2531,3138,2806,2984,6375,2769,6376,4721,4722,3403,6377,6378,3548,6379,6380,2705,3092,1979,4149,2629,3337,2889,6381,3338,4150,2557,3339,4381,6382,3190,3263,3739,6383,4151,4723,4152,2558,2574,3404,3191,6384,6385,4153,6386,4724,4382,6387,6388,4383,6389,6390,4154,6391,4725,3985,6392,3847,4155,6393,6394,6395,6396,6397,3465,6398,4384,6399,6400,6401,6402,6403,6404,4156,6405,6406,6407,6408,2123,6409,6410,2326,3192,4726,6411,6412,6413,6414,4385,4157,6415,6416,4158,6417,3093,3848,6418,3986,6419,6420,3849,6421,6422,6423,4159,6424,6425,4160,6426,3740,6427,6428,6429,6430,3987,6431,4727,6432,2238,6433,6434,4386,3988,6435,6436,3632,6437,6438,2843,6439,6440,6441,6442,3633,6443,2958,6444,6445,3466,6446,2364,4387,3850,6447,4388,2959,3340,6448,3851,6449,4728,6450,6451,3264,4729,6452,3193,6453,4389,4390,2706,3341,4730,6454,3139,6455,3194,6456,3051,2124,3852,1602,4391,4161,3853,1158,3854,4162,3989,4392,3990,4731,4732,4393,2040,4163,4394,3265,6457,2807,3467,3855,6458,6459,6460,3991,3468,4733,4734,6461,3140,2960,6462,4735,6463,6464,6465,6466,4736,4737,4738,4739,6467,6468,4164,2403,3856,6469,6470,2770,2844,6471,4740,6472,6473,6474,6475,6476,6477,6478,3195,6479,4741,4395,6480,2867,6481,4742,2808,6482,2493,4165,6483,6484,6485,6486,2295,4743,6487,6488,6489,3634,6490,6491,6492,6493,6494,6495,6496,2985,4744,6497,6498,4745,6499,6500,2925,3141,4166,6501,6502,4746,6503,6504,4747,6505,6506,6507,2890,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,3469,4167,6520,6521,6522,4748,4396,3741,4397,4749,4398,3342,2125,4750,6523,4751,4752,4753,3052,6524,2961,4168,6525,4754,6526,4755,4399,2926,4169,6527,3857,6528,4400,4170,6529,4171,6530,6531,2595,6532,6533,6534,6535,3635,6536,6537,6538,6539,6540,6541,6542,4756,6543,6544,6545,6546,6547,6548,4401,6549,6550,6551,6552,4402,3405,4757,4403,6553,6554,6555,4172,3742,6556,6557,6558,3992,3636,6559,6560,3053,2726,6561,3549,4173,3054,4404,6562,6563,3993,4405,3266,3550,2809,4406,6564,6565,6566,4758,4759,6567,3743,6568,4760,3744,4761,3470,6569,6570,6571,4407,6572,3745,4174,6573,4175,2810,4176,3196,4762,6574,4177,6575,6576,2494,2891,3551,6577,6578,3471,6579,4408,6580,3015,3197,6581,3343,2532,3994,3858,6582,3094,3406,4409,6583,2892,4178,4763,4410,3016,4411,6584,3995,3142,3017,2683,6585,4179,6586,6587,4764,4412,6588,6589,4413,6590,2986,6591,2962,3552,6592,2963,3472,6593,6594,4180,4765,6595,6596,2225,3267,4414,6597,3407,3637,4766,6598,6599,3198,6600,4415,6601,3859,3199,6602,3473,4767,2811,4416,1856,3268,3200,2575,3996,3997,3201,4417,6603,3095,2927,6604,3143,6605,2268,6606,3998,3860,3096,2771,6607,6608,3638,2495,4768,6609,3861,6610,3269,2745,4769,4181,3553,6611,2845,3270,6612,6613,6614,3862,6615,6616,4770,4771,6617,3474,3999,4418,4419,6618,3639,3344,6619,4772,4182,6620,2126,6621,6622,6623,4420,4773,6624,3018,6625,4774,3554,6626,4183,2025,3746,6627,4184,2707,6628,4421,4422,3097,1775,4185,3555,6629,6630,2868,6631,6632,4423,6633,6634,4424,2414,2533,2928,6635,4186,2387,6636,4775,6637,4187,6638,1891,4425,3202,3203,6639,6640,4776,6641,3345,6642,6643,3640,6644,3475,3346,3641,4e3,6645,3144,6646,3098,2812,4188,3642,3204,6647,3863,3476,6648,3864,6649,4426,4001,6650,6651,6652,2576,6653,4189,4777,6654,6655,6656,2846,6657,3477,3205,4002,6658,4003,6659,3347,2252,6660,6661,6662,4778,6663,6664,6665,6666,6667,6668,6669,4779,4780,2048,6670,3478,3099,6671,3556,3747,4004,6672,6673,6674,3145,4005,3748,6675,6676,6677,6678,6679,3408,6680,6681,6682,6683,3206,3207,6684,6685,4781,4427,6686,4782,4783,4784,6687,6688,6689,4190,6690,6691,3479,6692,2746,6693,4428,6694,6695,6696,6697,6698,6699,4785,6700,6701,3208,2727,6702,3146,6703,6704,3409,2196,6705,4429,6706,6707,6708,2534,1996,6709,6710,6711,2747,6712,6713,6714,4786,3643,6715,4430,4431,6716,3557,6717,4432,4433,6718,6719,6720,6721,3749,6722,4006,4787,6723,6724,3644,4788,4434,6725,6726,4789,2772,6727,6728,6729,6730,6731,2708,3865,2813,4435,6732,6733,4790,4791,3480,6734,6735,6736,6737,4436,3348,6738,3410,4007,6739,6740,4008,6741,6742,4792,3411,4191,6743,6744,6745,6746,6747,3866,6748,3750,6749,6750,6751,6752,6753,6754,6755,3867,6756,4009,6757,4793,4794,6758,2814,2987,6759,6760,6761,4437,6762,6763,6764,6765,3645,6766,6767,3481,4192,6768,3751,6769,6770,2174,6771,3868,3752,6772,6773,6774,4193,4795,4438,3558,4796,4439,6775,4797,6776,6777,4798,6778,4799,3559,4800,6779,6780,6781,3482,6782,2893,6783,6784,4194,4801,4010,6785,6786,4440,6787,4011,6788,6789,6790,6791,6792,6793,4802,6794,6795,6796,4012,6797,6798,6799,6800,3349,4803,3483,6801,4804,4195,6802,4013,6803,6804,4196,6805,4014,4015,6806,2847,3271,2848,6807,3484,6808,6809,6810,4441,6811,4442,4197,4443,3272,4805,6812,3412,4016,1579,6813,6814,4017,6815,3869,6816,2964,6817,4806,6818,6819,4018,3646,6820,6821,4807,4019,4020,6822,6823,3560,6824,6825,4021,4444,6826,4198,6827,6828,4445,6829,6830,4199,4808,6831,6832,6833,3870,3019,2458,6834,3753,3413,3350,6835,4809,3871,4810,3561,4446,6836,6837,4447,4811,4812,6838,2459,4448,6839,4449,6840,6841,4022,3872,6842,4813,4814,6843,6844,4815,4200,4201,4202,6845,4023,6846,6847,4450,3562,3873,6848,6849,4816,4817,6850,4451,4818,2139,6851,3563,6852,6853,3351,6854,6855,3352,4024,2709,3414,4203,4452,6856,4204,6857,6858,3874,3875,6859,6860,4819,6861,6862,6863,6864,4453,3647,6865,6866,4820,6867,6868,6869,6870,4454,6871,2869,6872,6873,4821,6874,3754,6875,4822,4205,6876,6877,6878,3648,4206,4455,6879,4823,6880,4824,3876,6881,3055,4207,6882,3415,6883,6884,6885,4208,4209,6886,4210,3353,6887,3354,3564,3209,3485,2652,6888,2728,6889,3210,3755,6890,4025,4456,6891,4825,6892,6893,6894,6895,4211,6896,6897,6898,4826,6899,6900,4212,6901,4827,6902,2773,3565,6903,4828,6904,6905,6906,6907,3649,3650,6908,2849,3566,6909,3567,3100,6910,6911,6912,6913,6914,6915,4026,6916,3355,4829,3056,4457,3756,6917,3651,6918,4213,3652,2870,6919,4458,6920,2438,6921,6922,3757,2774,4830,6923,3356,4831,4832,6924,4833,4459,3653,2507,6925,4834,2535,6926,6927,3273,4027,3147,6928,3568,6929,6930,6931,4460,6932,3877,4461,2729,3654,6933,6934,6935,6936,2175,4835,2630,4214,4028,4462,4836,4215,6937,3148,4216,4463,4837,4838,4217,6938,6939,2850,4839,6940,4464,6941,6942,6943,4840,6944,4218,3274,4465,6945,6946,2710,6947,4841,4466,6948,6949,2894,6950,6951,4842,6952,4219,3057,2871,6953,6954,6955,6956,4467,6957,2711,6958,6959,6960,3275,3101,4843,6961,3357,3569,6962,4844,6963,6964,4468,4845,3570,6965,3102,4846,3758,6966,4847,3878,4848,4849,4029,6967,2929,3879,4850,4851,6968,6969,1733,6970,4220,6971,6972,6973,6974,6975,6976,4852,6977,6978,6979,6980,6981,6982,3759,6983,6984,6985,3486,3487,6986,3488,3416,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,4853,6998,6999,4030,7e3,7001,3211,7002,7003,4221,7004,7005,3571,4031,7006,3572,7007,2614,4854,2577,7008,7009,2965,3655,3656,4855,2775,3489,3880,4222,4856,3881,4032,3882,3657,2730,3490,4857,7010,3149,7011,4469,4858,2496,3491,4859,2283,7012,7013,7014,2365,4860,4470,7015,7016,3760,7017,7018,4223,1917,7019,7020,7021,4471,7022,2776,4472,7023,7024,7025,7026,4033,7027,3573,4224,4861,4034,4862,7028,7029,1929,3883,4035,7030,4473,3058,7031,2536,3761,3884,7032,4036,7033,2966,2895,1968,4474,3276,4225,3417,3492,4226,2105,7034,7035,1754,2596,3762,4227,4863,4475,3763,4864,3764,2615,2777,3103,3765,3658,3418,4865,2296,3766,2815,7036,7037,7038,3574,2872,3277,4476,7039,4037,4477,7040,7041,4038,7042,7043,7044,7045,7046,7047,2537,7048,7049,7050,7051,7052,7053,7054,4478,7055,7056,3767,3659,4228,3575,7057,7058,4229,7059,7060,7061,3660,7062,3212,7063,3885,4039,2460,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,4866,3768,4867,7075,7076,7077,7078,4868,3358,3278,2653,7079,7080,4479,3886,7081,7082,4869,7083,7084,7085,7086,7087,7088,2538,7089,7090,7091,4040,3150,3769,4870,4041,2896,3359,4230,2930,7092,3279,7093,2967,4480,3213,4481,3661,7094,7095,7096,7097,7098,7099,7100,7101,7102,2461,3770,7103,7104,4231,3151,7105,7106,7107,4042,3662,7108,7109,4871,3663,4872,4043,3059,7110,7111,7112,3493,2988,7113,4873,7114,7115,7116,3771,4874,7117,7118,4232,4875,7119,3576,2336,4876,7120,4233,3419,4044,4877,4878,4482,4483,4879,4484,4234,7121,3772,4880,1045,3280,3664,4881,4882,7122,7123,7124,7125,4883,7126,2778,7127,4485,4486,7128,4884,3214,3887,7129,7130,3215,7131,4885,4045,7132,7133,4046,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,4235,7144,4886,7145,7146,7147,4887,7148,7149,7150,4487,4047,4488,7151,7152,4888,4048,2989,3888,7153,3665,7154,4049,7155,7156,7157,7158,7159,7160,2931,4889,4890,4489,7161,2631,3889,4236,2779,7162,7163,4891,7164,3060,7165,1672,4892,7166,4893,4237,3281,4894,7167,7168,3666,7169,3494,7170,7171,4050,7172,7173,3104,3360,3420,4490,4051,2684,4052,7174,4053,7175,7176,7177,2253,4054,7178,7179,4895,7180,3152,3890,3153,4491,3216,7181,7182,7183,2968,4238,4492,4055,7184,2990,7185,2479,7186,7187,4493,7188,7189,7190,7191,7192,4896,7193,4897,2969,4494,4898,7194,3495,7195,7196,4899,4495,7197,3105,2731,7198,4900,7199,7200,7201,4056,7202,3361,7203,7204,4496,4901,4902,7205,4497,7206,7207,2315,4903,7208,4904,7209,4905,2851,7210,7211,3577,7212,3578,4906,7213,4057,3667,4907,7214,4058,2354,3891,2376,3217,3773,7215,7216,7217,7218,7219,4498,7220,4908,3282,2685,7221,3496,4909,2632,3154,4910,7222,2337,7223,4911,7224,7225,7226,4912,4913,3283,4239,4499,7227,2816,7228,7229,7230,7231,7232,7233,7234,4914,4500,4501,7235,7236,7237,2686,7238,4915,7239,2897,4502,7240,4503,7241,2516,7242,4504,3362,3218,7243,7244,7245,4916,7246,7247,4505,3363,7248,7249,7250,7251,3774,4506,7252,7253,4917,7254,7255,3284,2991,4918,4919,3219,3892,4920,3106,3497,4921,7256,7257,7258,4922,7259,4923,3364,4507,4508,4059,7260,4240,3498,7261,7262,4924,7263,2992,3893,4060,3220,7264,7265,7266,7267,7268,7269,4509,3775,7270,2817,7271,4061,4925,4510,3776,7272,4241,4511,3285,7273,7274,3499,7275,7276,7277,4062,4512,4926,7278,3107,3894,7279,7280,4927,7281,4513,7282,7283,3668,7284,7285,4242,4514,4243,7286,2058,4515,4928,4929,4516,7287,3286,4244,7288,4517,7289,7290,7291,3669,7292,7293,4930,4931,4932,2355,4933,7294,2633,4518,7295,4245,7296,7297,4519,7298,7299,4520,4521,4934,7300,4246,4522,7301,7302,7303,3579,7304,4247,4935,7305,4936,7306,7307,7308,7309,3777,7310,4523,7311,7312,7313,4248,3580,7314,4524,3778,4249,7315,3581,7316,3287,7317,3221,7318,4937,7319,7320,7321,7322,7323,7324,4938,4939,7325,4525,7326,7327,7328,4063,7329,7330,4940,7331,7332,4941,7333,4526,7334,3500,2780,1741,4942,2026,1742,7335,7336,3582,4527,2388,7337,7338,7339,4528,7340,4250,4943,7341,7342,7343,4944,7344,7345,7346,3020,7347,4945,7348,7349,7350,7351,3895,7352,3896,4064,3897,7353,7354,7355,4251,7356,7357,3898,7358,3779,7359,3780,3288,7360,7361,4529,7362,4946,4530,2027,7363,3899,4531,4947,3222,3583,7364,4948,7365,7366,7367,7368,4949,3501,4950,3781,4951,4532,7369,2517,4952,4252,4953,3155,7370,4954,4955,4253,2518,4533,7371,7372,2712,4254,7373,7374,7375,3670,4956,3671,7376,2389,3502,4065,7377,2338,7378,7379,7380,7381,3061,7382,4957,7383,7384,7385,7386,4958,4534,7387,7388,2993,7389,3062,7390,4959,7391,7392,7393,4960,3108,4961,7394,4535,7395,4962,3421,4536,7396,4963,7397,4964,1857,7398,4965,7399,7400,2176,3584,4966,7401,7402,3422,4537,3900,3585,7403,3782,7404,2852,7405,7406,7407,4538,3783,2654,3423,4967,4539,7408,3784,3586,2853,4540,4541,7409,3901,7410,3902,7411,7412,3785,3109,2327,3903,7413,7414,2970,4066,2932,7415,7416,7417,3904,3672,3424,7418,4542,4543,4544,7419,4968,7420,7421,4255,7422,7423,7424,7425,7426,4067,7427,3673,3365,4545,7428,3110,2559,3674,7429,7430,3156,7431,7432,3503,7433,3425,4546,7434,3063,2873,7435,3223,4969,4547,4548,2898,4256,4068,7436,4069,3587,3786,2933,3787,4257,4970,4971,3788,7437,4972,3064,7438,4549,7439,7440,7441,7442,7443,4973,3905,7444,2874,7445,7446,7447,7448,3021,7449,4550,3906,3588,4974,7450,7451,3789,3675,7452,2578,7453,4070,7454,7455,7456,4258,3676,7457,4975,7458,4976,4259,3790,3504,2634,4977,3677,4551,4260,7459,7460,7461,7462,3907,4261,4978,7463,7464,7465,7466,4979,4980,7467,7468,2213,4262,7469,7470,7471,3678,4981,7472,2439,7473,4263,3224,3289,7474,3908,2415,4982,7475,4264,7476,4983,2655,7477,7478,2732,4552,2854,2875,7479,7480,4265,7481,4553,4984,7482,7483,4266,7484,3679,3366,3680,2818,2781,2782,3367,3589,4554,3065,7485,4071,2899,7486,7487,3157,2462,4072,4555,4073,4985,4986,3111,4267,2687,3368,4556,4074,3791,4268,7488,3909,2783,7489,2656,1962,3158,4557,4987,1963,3159,3160,7490,3112,4988,4989,3022,4990,4991,3792,2855,7491,7492,2971,4558,7493,7494,4992,7495,7496,7497,7498,4993,7499,3426,4559,4994,7500,3681,4560,4269,4270,3910,7501,4075,4995,4271,7502,7503,4076,7504,4996,7505,3225,4997,4272,4077,2819,3023,7506,7507,2733,4561,7508,4562,7509,3369,3793,7510,3590,2508,7511,7512,4273,3113,2994,2616,7513,7514,7515,7516,7517,7518,2820,3911,4078,2748,7519,7520,4563,4998,7521,7522,7523,7524,4999,4274,7525,4564,3682,2239,4079,4565,7526,7527,7528,7529,5e3,7530,7531,5001,4275,3794,7532,7533,7534,3066,5002,4566,3161,7535,7536,4080,7537,3162,7538,7539,4567,7540,7541,7542,7543,7544,7545,5003,7546,4568,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,5004,7557,7558,7559,5005,7560,3795,7561,4569,7562,7563,7564,2821,3796,4276,4277,4081,7565,2876,7566,5006,7567,7568,2900,7569,3797,3912,7570,7571,7572,4278,7573,7574,7575,5007,7576,7577,5008,7578,7579,4279,2934,7580,7581,5009,7582,4570,7583,4280,7584,7585,7586,4571,4572,3913,7587,4573,3505,7588,5010,7589,7590,7591,7592,3798,4574,7593,7594,5011,7595,4281,7596,7597,7598,4282,5012,7599,7600,5013,3163,7601,5014,7602,3914,7603,7604,2734,4575,4576,4577,7605,7606,7607,7608,7609,3506,5015,4578,7610,4082,7611,2822,2901,2579,3683,3024,4579,3507,7612,4580,7613,3226,3799,5016,7614,7615,7616,7617,7618,7619,7620,2995,3290,7621,4083,7622,5017,7623,7624,7625,7626,7627,4581,3915,7628,3291,7629,5018,7630,7631,7632,7633,4084,7634,7635,3427,3800,7636,7637,4582,7638,5019,4583,5020,7639,3916,7640,3801,5021,4584,4283,7641,7642,3428,3591,2269,7643,2617,7644,4585,3592,7645,4586,2902,7646,7647,3227,5022,7648,4587,7649,4284,7650,7651,7652,4588,2284,7653,5023,7654,7655,7656,4589,5024,3802,7657,7658,5025,3508,4590,7659,7660,7661,1969,5026,7662,7663,3684,1821,2688,7664,2028,2509,4285,7665,2823,1841,7666,2689,3114,7667,3917,4085,2160,5027,5028,2972,7668,5029,7669,7670,7671,3593,4086,7672,4591,4087,5030,3803,7673,7674,7675,7676,7677,7678,7679,4286,2366,4592,4593,3067,2328,7680,7681,4594,3594,3918,2029,4287,7682,5031,3919,3370,4288,4595,2856,7683,3509,7684,7685,5032,5033,7686,7687,3804,2784,7688,7689,7690,7691,3371,7692,7693,2877,5034,7694,7695,3920,4289,4088,7696,7697,7698,5035,7699,5036,4290,5037,5038,5039,7700,7701,7702,5040,5041,3228,7703,1760,7704,5042,3229,4596,2106,4089,7705,4597,2824,5043,2107,3372,7706,4291,4090,5044,7707,4091,7708,5045,3025,3805,4598,4292,4293,4294,3373,7709,4599,7710,5046,7711,7712,5047,5048,3806,7713,7714,7715,5049,7716,7717,7718,7719,4600,5050,7720,7721,7722,5051,7723,4295,3429,7724,7725,7726,7727,3921,7728,3292,5052,4092,7729,7730,7731,7732,7733,7734,7735,5053,5054,7736,7737,7738,7739,3922,3685,7740,7741,7742,7743,2635,5055,7744,5056,4601,7745,7746,2560,7747,7748,7749,7750,3923,7751,7752,7753,7754,7755,4296,2903,7756,7757,7758,7759,7760,3924,7761,5057,4297,7762,7763,5058,4298,7764,4093,7765,7766,5059,3925,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,3595,7777,4299,5060,4094,7778,3293,5061,7779,7780,4300,7781,7782,4602,7783,3596,7784,7785,3430,2367,7786,3164,5062,5063,4301,7787,7788,4095,5064,5065,7789,3374,3115,7790,7791,7792,7793,7794,7795,7796,3597,4603,7797,7798,3686,3116,3807,5066,7799,7800,5067,7801,7802,4604,4302,5068,4303,4096,7803,7804,3294,7805,7806,5069,4605,2690,7807,3026,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,3926,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8e3,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271]},function(e,t){t.EUCTW_TYPICAL_DISTRIBUTION_RATIO=.75,t.EUCTW_TABLE_SIZE=8102,t.EUCTWCharToFreqOrder=[1,1800,1506,255,1431,198,9,82,6,7310,177,202,3615,1256,2808,110,3735,33,3241,261,76,44,2113,16,2931,2184,1176,659,3868,26,3404,2643,1198,3869,3313,4060,410,2211,302,590,361,1963,8,204,58,4296,7311,1931,63,7312,7313,317,1614,75,222,159,4061,2412,1480,7314,3500,3068,224,2809,3616,3,10,3870,1471,29,2774,1135,2852,1939,873,130,3242,1123,312,7315,4297,2051,507,252,682,7316,142,1914,124,206,2932,34,3501,3173,64,604,7317,2494,1976,1977,155,1990,645,641,1606,7318,3405,337,72,406,7319,80,630,238,3174,1509,263,939,1092,2644,756,1440,1094,3406,449,69,2969,591,179,2095,471,115,2034,1843,60,50,2970,134,806,1868,734,2035,3407,180,995,1607,156,537,2893,688,7320,319,1305,779,2144,514,2374,298,4298,359,2495,90,2707,1338,663,11,906,1099,2545,20,2436,182,532,1716,7321,732,1376,4062,1311,1420,3175,25,2312,1056,113,399,382,1949,242,3408,2467,529,3243,475,1447,3617,7322,117,21,656,810,1297,2295,2329,3502,7323,126,4063,706,456,150,613,4299,71,1118,2036,4064,145,3069,85,835,486,2114,1246,1426,428,727,1285,1015,800,106,623,303,1281,7324,2127,2354,347,3736,221,3503,3110,7325,1955,1153,4065,83,296,1199,3070,192,624,93,7326,822,1897,2810,3111,795,2064,991,1554,1542,1592,27,43,2853,859,139,1456,860,4300,437,712,3871,164,2392,3112,695,211,3017,2096,195,3872,1608,3504,3505,3618,3873,234,811,2971,2097,3874,2229,1441,3506,1615,2375,668,2076,1638,305,228,1664,4301,467,415,7327,262,2098,1593,239,108,300,200,1033,512,1247,2077,7328,7329,2173,3176,3619,2673,593,845,1062,3244,88,1723,2037,3875,1950,212,266,152,149,468,1898,4066,4302,77,187,7330,3018,37,5,2972,7331,3876,7332,7333,39,2517,4303,2894,3177,2078,55,148,74,4304,545,483,1474,1029,1665,217,1869,1531,3113,1104,2645,4067,24,172,3507,900,3877,3508,3509,4305,32,1408,2811,1312,329,487,2355,2247,2708,784,2674,4,3019,3314,1427,1788,188,109,499,7334,3620,1717,1789,888,1217,3020,4306,7335,3510,7336,3315,1520,3621,3878,196,1034,775,7337,7338,929,1815,249,439,38,7339,1063,7340,794,3879,1435,2296,46,178,3245,2065,7341,2376,7342,214,1709,4307,804,35,707,324,3622,1601,2546,140,459,4068,7343,7344,1365,839,272,978,2257,2572,3409,2128,1363,3623,1423,697,100,3071,48,70,1231,495,3114,2193,7345,1294,7346,2079,462,586,1042,3246,853,256,988,185,2377,3410,1698,434,1084,7347,3411,314,2615,2775,4308,2330,2331,569,2280,637,1816,2518,757,1162,1878,1616,3412,287,1577,2115,768,4309,1671,2854,3511,2519,1321,3737,909,2413,7348,4069,933,3738,7349,2052,2356,1222,4310,765,2414,1322,786,4311,7350,1919,1462,1677,2895,1699,7351,4312,1424,2437,3115,3624,2590,3316,1774,1940,3413,3880,4070,309,1369,1130,2812,364,2230,1653,1299,3881,3512,3882,3883,2646,525,1085,3021,902,2e3,1475,964,4313,421,1844,1415,1057,2281,940,1364,3116,376,4314,4315,1381,7,2520,983,2378,336,1710,2675,1845,321,3414,559,1131,3022,2742,1808,1132,1313,265,1481,1857,7352,352,1203,2813,3247,167,1089,420,2814,776,792,1724,3513,4071,2438,3248,7353,4072,7354,446,229,333,2743,901,3739,1200,1557,4316,2647,1920,395,2744,2676,3740,4073,1835,125,916,3178,2616,4317,7355,7356,3741,7357,7358,7359,4318,3117,3625,1133,2547,1757,3415,1510,2313,1409,3514,7360,2145,438,2591,2896,2379,3317,1068,958,3023,461,311,2855,2677,4074,1915,3179,4075,1978,383,750,2745,2617,4076,274,539,385,1278,1442,7361,1154,1964,384,561,210,98,1295,2548,3515,7362,1711,2415,1482,3416,3884,2897,1257,129,7363,3742,642,523,2776,2777,2648,7364,141,2231,1333,68,176,441,876,907,4077,603,2592,710,171,3417,404,549,18,3118,2393,1410,3626,1666,7365,3516,4319,2898,4320,7366,2973,368,7367,146,366,99,871,3627,1543,748,807,1586,1185,22,2258,379,3743,3180,7368,3181,505,1941,2618,1991,1382,2314,7369,380,2357,218,702,1817,1248,3418,3024,3517,3318,3249,7370,2974,3628,930,3250,3744,7371,59,7372,585,601,4078,497,3419,1112,1314,4321,1801,7373,1223,1472,2174,7374,749,1836,690,1899,3745,1772,3885,1476,429,1043,1790,2232,2116,917,4079,447,1086,1629,7375,556,7376,7377,2020,1654,844,1090,105,550,966,1758,2815,1008,1782,686,1095,7378,2282,793,1602,7379,3518,2593,4322,4080,2933,2297,4323,3746,980,2496,544,353,527,4324,908,2678,2899,7380,381,2619,1942,1348,7381,1341,1252,560,3072,7382,3420,2856,7383,2053,973,886,2080,143,4325,7384,7385,157,3886,496,4081,57,840,540,2038,4326,4327,3421,2117,1445,970,2259,1748,1965,2081,4082,3119,1234,1775,3251,2816,3629,773,1206,2129,1066,2039,1326,3887,1738,1725,4083,279,3120,51,1544,2594,423,1578,2130,2066,173,4328,1879,7386,7387,1583,264,610,3630,4329,2439,280,154,7388,7389,7390,1739,338,1282,3073,693,2857,1411,1074,3747,2440,7391,4330,7392,7393,1240,952,2394,7394,2900,1538,2679,685,1483,4084,2468,1436,953,4085,2054,4331,671,2395,79,4086,2441,3252,608,567,2680,3422,4087,4088,1691,393,1261,1791,2396,7395,4332,7396,7397,7398,7399,1383,1672,3748,3182,1464,522,1119,661,1150,216,675,4333,3888,1432,3519,609,4334,2681,2397,7400,7401,7402,4089,3025,0,7403,2469,315,231,2442,301,3319,4335,2380,7404,233,4090,3631,1818,4336,4337,7405,96,1776,1315,2082,7406,257,7407,1809,3632,2709,1139,1819,4091,2021,1124,2163,2778,1777,2649,7408,3074,363,1655,3183,7409,2975,7410,7411,7412,3889,1567,3890,718,103,3184,849,1443,341,3320,2934,1484,7413,1712,127,67,339,4092,2398,679,1412,821,7414,7415,834,738,351,2976,2146,846,235,1497,1880,418,1992,3749,2710,186,1100,2147,2746,3520,1545,1355,2935,2858,1377,583,3891,4093,2573,2977,7416,1298,3633,1078,2549,3634,2358,78,3750,3751,267,1289,2099,2001,1594,4094,348,369,1274,2194,2175,1837,4338,1820,2817,3635,2747,2283,2002,4339,2936,2748,144,3321,882,4340,3892,2749,3423,4341,2901,7417,4095,1726,320,7418,3893,3026,788,2978,7419,2818,1773,1327,2859,3894,2819,7420,1306,4342,2003,1700,3752,3521,2359,2650,787,2022,506,824,3636,534,323,4343,1044,3322,2023,1900,946,3424,7421,1778,1500,1678,7422,1881,4344,165,243,4345,3637,2521,123,683,4096,764,4346,36,3895,1792,589,2902,816,626,1667,3027,2233,1639,1555,1622,3753,3896,7423,3897,2860,1370,1228,1932,891,2083,2903,304,4097,7424,292,2979,2711,3522,691,2100,4098,1115,4347,118,662,7425,611,1156,854,2381,1316,2861,2,386,515,2904,7426,7427,3253,868,2234,1486,855,2651,785,2212,3028,7428,1040,3185,3523,7429,3121,448,7430,1525,7431,2164,4348,7432,3754,7433,4099,2820,3524,3122,503,818,3898,3123,1568,814,676,1444,306,1749,7434,3755,1416,1030,197,1428,805,2821,1501,4349,7435,7436,7437,1993,7438,4350,7439,7440,2195,13,2779,3638,2980,3124,1229,1916,7441,3756,2131,7442,4100,4351,2399,3525,7443,2213,1511,1727,1120,7444,7445,646,3757,2443,307,7446,7447,1595,3186,7448,7449,7450,3639,1113,1356,3899,1465,2522,2523,7451,519,7452,128,2132,92,2284,1979,7453,3900,1512,342,3125,2196,7454,2780,2214,1980,3323,7455,290,1656,1317,789,827,2360,7456,3758,4352,562,581,3901,7457,401,4353,2248,94,4354,1399,2781,7458,1463,2024,4355,3187,1943,7459,828,1105,4101,1262,1394,7460,4102,605,4356,7461,1783,2862,7462,2822,819,2101,578,2197,2937,7463,1502,436,3254,4103,3255,2823,3902,2905,3425,3426,7464,2712,2315,7465,7466,2332,2067,23,4357,193,826,3759,2102,699,1630,4104,3075,390,1793,1064,3526,7467,1579,3076,3077,1400,7468,4105,1838,1640,2863,7469,4358,4359,137,4106,598,3078,1966,780,104,974,2938,7470,278,899,253,402,572,504,493,1339,7471,3903,1275,4360,2574,2550,7472,3640,3029,3079,2249,565,1334,2713,863,41,7473,7474,4361,7475,1657,2333,19,463,2750,4107,606,7476,2981,3256,1087,2084,1323,2652,2982,7477,1631,1623,1750,4108,2682,7478,2864,791,2714,2653,2334,232,2416,7479,2983,1498,7480,2654,2620,755,1366,3641,3257,3126,2025,1609,119,1917,3427,862,1026,4109,7481,3904,3760,4362,3905,4363,2260,1951,2470,7482,1125,817,4110,4111,3906,1513,1766,2040,1487,4112,3030,3258,2824,3761,3127,7483,7484,1507,7485,2683,733,40,1632,1106,2865,345,4113,841,2524,230,4364,2984,1846,3259,3428,7486,1263,986,3429,7487,735,879,254,1137,857,622,1300,1180,1388,1562,3907,3908,2939,967,2751,2655,1349,592,2133,1692,3324,2985,1994,4114,1679,3909,1901,2185,7488,739,3642,2715,1296,1290,7489,4115,2198,2199,1921,1563,2595,2551,1870,2752,2986,7490,435,7491,343,1108,596,17,1751,4365,2235,3430,3643,7492,4366,294,3527,2940,1693,477,979,281,2041,3528,643,2042,3644,2621,2782,2261,1031,2335,2134,2298,3529,4367,367,1249,2552,7493,3530,7494,4368,1283,3325,2004,240,1762,3326,4369,4370,836,1069,3128,474,7495,2148,2525,268,3531,7496,3188,1521,1284,7497,1658,1546,4116,7498,3532,3533,7499,4117,3327,2684,1685,4118,961,1673,2622,190,2005,2200,3762,4371,4372,7500,570,2497,3645,1490,7501,4373,2623,3260,1956,4374,584,1514,396,1045,1944,7502,4375,1967,2444,7503,7504,4376,3910,619,7505,3129,3261,215,2006,2783,2553,3189,4377,3190,4378,763,4119,3763,4379,7506,7507,1957,1767,2941,3328,3646,1174,452,1477,4380,3329,3130,7508,2825,1253,2382,2186,1091,2285,4120,492,7509,638,1169,1824,2135,1752,3911,648,926,1021,1324,4381,520,4382,997,847,1007,892,4383,3764,2262,1871,3647,7510,2400,1784,4384,1952,2942,3080,3191,1728,4121,2043,3648,4385,2007,1701,3131,1551,30,2263,4122,7511,2026,4386,3534,7512,501,7513,4123,594,3431,2165,1821,3535,3432,3536,3192,829,2826,4124,7514,1680,3132,1225,4125,7515,3262,4387,4126,3133,2336,7516,4388,4127,7517,3912,3913,7518,1847,2383,2596,3330,7519,4389,374,3914,652,4128,4129,375,1140,798,7520,7521,7522,2361,4390,2264,546,1659,138,3031,2445,4391,7523,2250,612,1848,910,796,3765,1740,1371,825,3766,3767,7524,2906,2554,7525,692,444,3032,2624,801,4392,4130,7526,1491,244,1053,3033,4131,4132,340,7527,3915,1041,2987,293,1168,87,1357,7528,1539,959,7529,2236,721,694,4133,3768,219,1478,644,1417,3331,2656,1413,1401,1335,1389,3916,7530,7531,2988,2362,3134,1825,730,1515,184,2827,66,4393,7532,1660,2943,246,3332,378,1457,226,3433,975,3917,2944,1264,3537,674,696,7533,163,7534,1141,2417,2166,713,3538,3333,4394,3918,7535,7536,1186,15,7537,1079,1070,7538,1522,3193,3539,276,1050,2716,758,1126,653,2945,3263,7539,2337,889,3540,3919,3081,2989,903,1250,4395,3920,3434,3541,1342,1681,1718,766,3264,286,89,2946,3649,7540,1713,7541,2597,3334,2990,7542,2947,2215,3194,2866,7543,4396,2498,2526,181,387,1075,3921,731,2187,3335,7544,3265,310,313,3435,2299,770,4134,54,3034,189,4397,3082,3769,3922,7545,1230,1617,1849,355,3542,4135,4398,3336,111,4136,3650,1350,3135,3436,3035,4137,2149,3266,3543,7546,2784,3923,3924,2991,722,2008,7547,1071,247,1207,2338,2471,1378,4399,2009,864,1437,1214,4400,373,3770,1142,2216,667,4401,442,2753,2555,3771,3925,1968,4138,3267,1839,837,170,1107,934,1336,1882,7548,7549,2118,4139,2828,743,1569,7550,4402,4140,582,2384,1418,3437,7551,1802,7552,357,1395,1729,3651,3268,2418,1564,2237,7553,3083,3772,1633,4403,1114,2085,4141,1532,7554,482,2446,4404,7555,7556,1492,833,1466,7557,2717,3544,1641,2829,7558,1526,1272,3652,4142,1686,1794,416,2556,1902,1953,1803,7559,3773,2785,3774,1159,2316,7560,2867,4405,1610,1584,3036,2419,2754,443,3269,1163,3136,7561,7562,3926,7563,4143,2499,3037,4406,3927,3137,2103,1647,3545,2010,1872,4144,7564,4145,431,3438,7565,250,97,81,4146,7566,1648,1850,1558,160,848,7567,866,740,1694,7568,2201,2830,3195,4147,4407,3653,1687,950,2472,426,469,3196,3654,3655,3928,7569,7570,1188,424,1995,861,3546,4148,3775,2202,2685,168,1235,3547,4149,7571,2086,1674,4408,3337,3270,220,2557,1009,7572,3776,670,2992,332,1208,717,7573,7574,3548,2447,3929,3338,7575,513,7576,1209,2868,3339,3138,4409,1080,7577,7578,7579,7580,2527,3656,3549,815,1587,3930,3931,7581,3550,3439,3777,1254,4410,1328,3038,1390,3932,1741,3933,3778,3934,7582,236,3779,2448,3271,7583,7584,3657,3780,1273,3781,4411,7585,308,7586,4412,245,4413,1851,2473,1307,2575,430,715,2136,2449,7587,270,199,2869,3935,7588,3551,2718,1753,761,1754,725,1661,1840,4414,3440,3658,7589,7590,587,14,3272,227,2598,326,480,2265,943,2755,3552,291,650,1883,7591,1702,1226,102,1547,62,3441,904,4415,3442,1164,4150,7592,7593,1224,1548,2756,391,498,1493,7594,1386,1419,7595,2055,1177,4416,813,880,1081,2363,566,1145,4417,2286,1001,1035,2558,2599,2238,394,1286,7596,7597,2068,7598,86,1494,1730,3936,491,1588,745,897,2948,843,3340,3937,2757,2870,3273,1768,998,2217,2069,397,1826,1195,1969,3659,2993,3341,284,7599,3782,2500,2137,2119,1903,7600,3938,2150,3939,4151,1036,3443,1904,114,2559,4152,209,1527,7601,7602,2949,2831,2625,2385,2719,3139,812,2560,7603,3274,7604,1559,737,1884,3660,1210,885,28,2686,3553,3783,7605,4153,1004,1779,4418,7606,346,1981,2218,2687,4419,3784,1742,797,1642,3940,1933,1072,1384,2151,896,3941,3275,3661,3197,2871,3554,7607,2561,1958,4420,2450,1785,7608,7609,7610,3942,4154,1005,1308,3662,4155,2720,4421,4422,1528,2600,161,1178,4156,1982,987,4423,1101,4157,631,3943,1157,3198,2420,1343,1241,1016,2239,2562,372,877,2339,2501,1160,555,1934,911,3944,7611,466,1170,169,1051,2907,2688,3663,2474,2994,1182,2011,2563,1251,2626,7612,992,2340,3444,1540,2721,1201,2070,2401,1996,2475,7613,4424,528,1922,2188,1503,1873,1570,2364,3342,3276,7614,557,1073,7615,1827,3445,2087,2266,3140,3039,3084,767,3085,2786,4425,1006,4158,4426,2341,1267,2176,3664,3199,778,3945,3200,2722,1597,2657,7616,4427,7617,3446,7618,7619,7620,3277,2689,1433,3278,131,95,1504,3946,723,4159,3141,1841,3555,2758,2189,3947,2027,2104,3665,7621,2995,3948,1218,7622,3343,3201,3949,4160,2576,248,1634,3785,912,7623,2832,3666,3040,3786,654,53,7624,2996,7625,1688,4428,777,3447,1032,3950,1425,7626,191,820,2120,2833,971,4429,931,3202,135,664,783,3787,1997,772,2908,1935,3951,3788,4430,2909,3203,282,2723,640,1372,3448,1127,922,325,3344,7627,7628,711,2044,7629,7630,3952,2219,2787,1936,3953,3345,2220,2251,3789,2300,7631,4431,3790,1258,3279,3954,3204,2138,2950,3955,3956,7632,2221,258,3205,4432,101,1227,7633,3280,1755,7634,1391,3281,7635,2910,2056,893,7636,7637,7638,1402,4161,2342,7639,7640,3206,3556,7641,7642,878,1325,1780,2788,4433,259,1385,2577,744,1183,2267,4434,7643,3957,2502,7644,684,1024,4162,7645,472,3557,3449,1165,3282,3958,3959,322,2152,881,455,1695,1152,1340,660,554,2153,4435,1058,4436,4163,830,1065,3346,3960,4437,1923,7646,1703,1918,7647,932,2268,122,7648,4438,947,677,7649,3791,2627,297,1905,1924,2269,4439,2317,3283,7650,7651,4164,7652,4165,84,4166,112,989,7653,547,1059,3961,701,3558,1019,7654,4167,7655,3450,942,639,457,2301,2451,993,2951,407,851,494,4440,3347,927,7656,1237,7657,2421,3348,573,4168,680,921,2911,1279,1874,285,790,1448,1983,719,2167,7658,7659,4441,3962,3963,1649,7660,1541,563,7661,1077,7662,3349,3041,3451,511,2997,3964,3965,3667,3966,1268,2564,3350,3207,4442,4443,7663,535,1048,1276,1189,2912,2028,3142,1438,1373,2834,2952,1134,2012,7664,4169,1238,2578,3086,1259,7665,700,7666,2953,3143,3668,4170,7667,4171,1146,1875,1906,4444,2601,3967,781,2422,132,1589,203,147,273,2789,2402,898,1786,2154,3968,3969,7668,3792,2790,7669,7670,4445,4446,7671,3208,7672,1635,3793,965,7673,1804,2690,1516,3559,1121,1082,1329,3284,3970,1449,3794,65,1128,2835,2913,2759,1590,3795,7674,7675,12,2658,45,976,2579,3144,4447,517,2528,1013,1037,3209,7676,3796,2836,7677,3797,7678,3452,7679,2602,614,1998,2318,3798,3087,2724,2628,7680,2580,4172,599,1269,7681,1810,3669,7682,2691,3088,759,1060,489,1805,3351,3285,1358,7683,7684,2386,1387,1215,2629,2252,490,7685,7686,4173,1759,2387,2343,7687,4448,3799,1907,3971,2630,1806,3210,4449,3453,3286,2760,2344,874,7688,7689,3454,3670,1858,91,2914,3671,3042,3800,4450,7690,3145,3972,2659,7691,3455,1202,1403,3801,2954,2529,1517,2503,4451,3456,2504,7692,4452,7693,2692,1885,1495,1731,3973,2365,4453,7694,2029,7695,7696,3974,2693,1216,237,2581,4174,2319,3975,3802,4454,4455,2694,3560,3457,445,4456,7697,7698,7699,7700,2761,61,3976,3672,1822,3977,7701,687,2045,935,925,405,2660,703,1096,1859,2725,4457,3978,1876,1367,2695,3352,918,2105,1781,2476,334,3287,1611,1093,4458,564,3146,3458,3673,3353,945,2631,2057,4459,7702,1925,872,4175,7703,3459,2696,3089,349,4176,3674,3979,4460,3803,4177,3675,2155,3980,4461,4462,4178,4463,2403,2046,782,3981,400,251,4179,1624,7704,7705,277,3676,299,1265,476,1191,3804,2121,4180,4181,1109,205,7706,2582,1e3,2156,3561,1860,7707,7708,7709,4464,7710,4465,2565,107,2477,2157,3982,3460,3147,7711,1533,541,1301,158,753,4182,2872,3562,7712,1696,370,1088,4183,4466,3563,579,327,440,162,2240,269,1937,1374,3461,968,3043,56,1396,3090,2106,3288,3354,7713,1926,2158,4467,2998,7714,3564,7715,7716,3677,4468,2478,7717,2791,7718,1650,4469,7719,2603,7720,7721,3983,2661,3355,1149,3356,3984,3805,3985,7722,1076,49,7723,951,3211,3289,3290,450,2837,920,7724,1811,2792,2366,4184,1908,1138,2367,3806,3462,7725,3212,4470,1909,1147,1518,2423,4471,3807,7726,4472,2388,2604,260,1795,3213,7727,7728,3808,3291,708,7729,3565,1704,7730,3566,1351,1618,3357,2999,1886,944,4185,3358,4186,3044,3359,4187,7731,3678,422,413,1714,3292,500,2058,2345,4188,2479,7732,1344,1910,954,7733,1668,7734,7735,3986,2404,4189,3567,3809,4190,7736,2302,1318,2505,3091,133,3092,2873,4473,629,31,2838,2697,3810,4474,850,949,4475,3987,2955,1732,2088,4191,1496,1852,7737,3988,620,3214,981,1242,3679,3360,1619,3680,1643,3293,2139,2452,1970,1719,3463,2168,7738,3215,7739,7740,3361,1828,7741,1277,4476,1565,2047,7742,1636,3568,3093,7743,869,2839,655,3811,3812,3094,3989,3e3,3813,1310,3569,4477,7744,7745,7746,1733,558,4478,3681,335,1549,3045,1756,4192,3682,1945,3464,1829,1291,1192,470,2726,2107,2793,913,1054,3990,7747,1027,7748,3046,3991,4479,982,2662,3362,3148,3465,3216,3217,1946,2794,7749,571,4480,7750,1830,7751,3570,2583,1523,2424,7752,2089,984,4481,3683,1959,7753,3684,852,923,2795,3466,3685,969,1519,999,2048,2320,1705,7754,3095,615,1662,151,597,3992,2405,2321,1049,275,4482,3686,4193,568,3687,3571,2480,4194,3688,7755,2425,2270,409,3218,7756,1566,2874,3467,1002,769,2840,194,2090,3149,3689,2222,3294,4195,628,1505,7757,7758,1763,2177,3001,3993,521,1161,2584,1787,2203,2406,4483,3994,1625,4196,4197,412,42,3096,464,7759,2632,4484,3363,1760,1571,2875,3468,2530,1219,2204,3814,2633,2140,2368,4485,4486,3295,1651,3364,3572,7760,7761,3573,2481,3469,7762,3690,7763,7764,2271,2091,460,7765,4487,7766,3002,962,588,3574,289,3219,2634,1116,52,7767,3047,1796,7768,7769,7770,1467,7771,1598,1143,3691,4198,1984,1734,1067,4488,1280,3365,465,4489,1572,510,7772,1927,2241,1812,1644,3575,7773,4490,3692,7774,7775,2663,1573,1534,7776,7777,4199,536,1807,1761,3470,3815,3150,2635,7778,7779,7780,4491,3471,2915,1911,2796,7781,3296,1122,377,3220,7782,360,7783,7784,4200,1529,551,7785,2059,3693,1769,2426,7786,2916,4201,3297,3097,2322,2108,2030,4492,1404,136,1468,1479,672,1171,3221,2303,271,3151,7787,2762,7788,2049,678,2727,865,1947,4493,7789,2013,3995,2956,7790,2728,2223,1397,3048,3694,4494,4495,1735,2917,3366,3576,7791,3816,509,2841,2453,2876,3817,7792,7793,3152,3153,4496,4202,2531,4497,2304,1166,1010,552,681,1887,7794,7795,2957,2958,3996,1287,1596,1861,3154,358,453,736,175,478,1117,905,1167,1097,7796,1853,1530,7797,1706,7798,2178,3472,2287,3695,3473,3577,4203,2092,4204,7799,3367,1193,2482,4205,1458,2190,2205,1862,1888,1421,3298,2918,3049,2179,3474,595,2122,7800,3997,7801,7802,4206,1707,2636,223,3696,1359,751,3098,183,3475,7803,2797,3003,419,2369,633,704,3818,2389,241,7804,7805,7806,838,3004,3697,2272,2763,2454,3819,1938,2050,3998,1309,3099,2242,1181,7807,1136,2206,3820,2370,1446,4207,2305,4498,7808,7809,4208,1055,2605,484,3698,7810,3999,625,4209,2273,3368,1499,4210,4e3,7811,4001,4211,3222,2274,2275,3476,7812,7813,2764,808,2606,3699,3369,4002,4212,3100,2532,526,3370,3821,4213,955,7814,1620,4214,2637,2427,7815,1429,3700,1669,1831,994,928,7816,3578,1260,7817,7818,7819,1948,2288,741,2919,1626,4215,2729,2455,867,1184,362,3371,1392,7820,7821,4003,4216,1770,1736,3223,2920,4499,4500,1928,2698,1459,1158,7822,3050,3372,2877,1292,1929,2506,2842,3701,1985,1187,2071,2014,2607,4217,7823,2566,2507,2169,3702,2483,3299,7824,3703,4501,7825,7826,666,1003,3005,1022,3579,4218,7827,4502,1813,2253,574,3822,1603,295,1535,705,3823,4219,283,858,417,7828,7829,3224,4503,4504,3051,1220,1889,1046,2276,2456,4004,1393,1599,689,2567,388,4220,7830,2484,802,7831,2798,3824,2060,1405,2254,7832,4505,3825,2109,1052,1345,3225,1585,7833,809,7834,7835,7836,575,2730,3477,956,1552,1469,1144,2323,7837,2324,1560,2457,3580,3226,4005,616,2207,3155,2180,2289,7838,1832,7839,3478,4506,7840,1319,3704,3705,1211,3581,1023,3227,1293,2799,7841,7842,7843,3826,607,2306,3827,762,2878,1439,4221,1360,7844,1485,3052,7845,4507,1038,4222,1450,2061,2638,4223,1379,4508,2585,7846,7847,4224,1352,1414,2325,2921,1172,7848,7849,3828,3829,7850,1797,1451,7851,7852,7853,7854,2922,4006,4007,2485,2346,411,4008,4009,3582,3300,3101,4509,1561,2664,1452,4010,1375,7855,7856,47,2959,316,7857,1406,1591,2923,3156,7858,1025,2141,3102,3157,354,2731,884,2224,4225,2407,508,3706,726,3583,996,2428,3584,729,7859,392,2191,1453,4011,4510,3707,7860,7861,2458,3585,2608,1675,2800,919,2347,2960,2348,1270,4511,4012,73,7862,7863,647,7864,3228,2843,2255,1550,1346,3006,7865,1332,883,3479,7866,7867,7868,7869,3301,2765,7870,1212,831,1347,4226,4512,2326,3830,1863,3053,720,3831,4513,4514,3832,7871,4227,7872,7873,4515,7874,7875,1798,4516,3708,2609,4517,3586,1645,2371,7876,7877,2924,669,2208,2665,2429,7878,2879,7879,7880,1028,3229,7881,4228,2408,7882,2256,1353,7883,7884,4518,3158,518,7885,4013,7886,4229,1960,7887,2142,4230,7888,7889,3007,2349,2350,3833,516,1833,1454,4014,2699,4231,4519,2225,2610,1971,1129,3587,7890,2766,7891,2961,1422,577,1470,3008,1524,3373,7892,7893,432,4232,3054,3480,7894,2586,1455,2508,2226,1972,1175,7895,1020,2732,4015,3481,4520,7896,2733,7897,1743,1361,3055,3482,2639,4016,4233,4521,2290,895,924,4234,2170,331,2243,3056,166,1627,3057,1098,7898,1232,2880,2227,3374,4522,657,403,1196,2372,542,3709,3375,1600,4235,3483,7899,4523,2767,3230,576,530,1362,7900,4524,2533,2666,3710,4017,7901,842,3834,7902,2801,2031,1014,4018,213,2700,3376,665,621,4236,7903,3711,2925,2430,7904,2431,3302,3588,3377,7905,4237,2534,4238,4525,3589,1682,4239,3484,1380,7906,724,2277,600,1670,7907,1337,1233,4526,3103,2244,7908,1621,4527,7909,651,4240,7910,1612,4241,2611,7911,2844,7912,2734,2307,3058,7913,716,2459,3059,174,1255,2701,4019,3590,548,1320,1398,728,4020,1574,7914,1890,1197,3060,4021,7915,3061,3062,3712,3591,3713,747,7916,635,4242,4528,7917,7918,7919,4243,7920,7921,4529,7922,3378,4530,2432,451,7923,3714,2535,2072,4244,2735,4245,4022,7924,1764,4531,7925,4246,350,7926,2278,2390,2486,7927,4247,4023,2245,1434,4024,488,4532,458,4248,4025,3715,771,1330,2391,3835,2568,3159,2159,2409,1553,2667,3160,4249,7928,2487,2881,2612,1720,2702,4250,3379,4533,7929,2536,4251,7930,3231,4252,2768,7931,2015,2736,7932,1155,1017,3716,3836,7933,3303,2308,201,1864,4253,1430,7934,4026,7935,7936,7937,7938,7939,4254,1604,7940,414,1865,371,2587,4534,4535,3485,2016,3104,4536,1708,960,4255,887,389,2171,1536,1663,1721,7941,2228,4027,2351,2926,1580,7942,7943,7944,1744,7945,2537,4537,4538,7946,4539,7947,2073,7948,7949,3592,3380,2882,4256,7950,4257,2640,3381,2802,673,2703,2460,709,3486,4028,3593,4258,7951,1148,502,634,7952,7953,1204,4540,3594,1575,4541,2613,3717,7954,3718,3105,948,3232,121,1745,3837,1110,7955,4259,3063,2509,3009,4029,3719,1151,1771,3838,1488,4030,1986,7956,2433,3487,7957,7958,2093,7959,4260,3839,1213,1407,2803,531,2737,2538,3233,1011,1537,7960,2769,4261,3106,1061,7961,3720,3721,1866,2883,7962,2017,120,4262,4263,2062,3595,3234,2309,3840,2668,3382,1954,4542,7963,7964,3488,1047,2704,1266,7965,1368,4543,2845,649,3383,3841,2539,2738,1102,2846,2669,7966,7967,1999,7968,1111,3596,2962,7969,2488,3842,3597,2804,1854,3384,3722,7970,7971,3385,2410,2884,3304,3235,3598,7972,2569,7973,3599,2805,4031,1460,856,7974,3600,7975,2885,2963,7976,2886,3843,7977,4264,632,2510,875,3844,1697,3845,2291,7978,7979,4544,3010,1239,580,4545,4265,7980,914,936,2074,1190,4032,1039,2123,7981,7982,7983,3386,1473,7984,1354,4266,3846,7985,2172,3064,4033,915,3305,4267,4268,3306,1605,1834,7986,2739,398,3601,4269,3847,4034,328,1912,2847,4035,3848,1331,4270,3011,937,4271,7987,3602,4036,4037,3387,2160,4546,3388,524,742,538,3065,1012,7988,7989,3849,2461,7990,658,1103,225,3850,7991,7992,4547,7993,4548,7994,3236,1243,7995,4038,963,2246,4549,7996,2705,3603,3161,7997,7998,2588,2327,7999,4550,8e3,8001,8002,3489,3307,957,3389,2540,2032,1930,2927,2462,870,2018,3604,1746,2770,2771,2434,2463,8003,3851,8004,3723,3107,3724,3490,3390,3725,8005,1179,3066,8006,3162,2373,4272,3726,2541,3163,3108,2740,4039,8007,3391,1556,2542,2292,977,2887,2033,4040,1205,3392,8008,1765,3393,3164,2124,1271,1689,714,4551,3491,8009,2328,3852,533,4273,3605,2181,617,8010,2464,3308,3492,2310,8011,8012,3165,8013,8014,3853,1987,618,427,2641,3493,3394,8015,8016,1244,1690,8017,2806,4274,4552,8018,3494,8019,8020,2279,1576,473,3606,4275,3395,972,8021,3607,8022,3067,8023,8024,4553,4554,8025,3727,4041,4042,8026,153,4555,356,8027,1891,2888,4276,2143,408,803,2352,8028,3854,8029,4277,1646,2570,2511,4556,4557,3855,8030,3856,4278,8031,2411,3396,752,8032,8033,1961,2964,8034,746,3012,2465,8035,4279,3728,698,4558,1892,4280,3608,2543,4559,3609,3857,8036,3166,3397,8037,1823,1302,4043,2706,3858,1973,4281,8038,4282,3167,823,1303,1288,1236,2848,3495,4044,3398,774,3859,8039,1581,4560,1304,2849,3860,4561,8040,2435,2161,1083,3237,4283,4045,4284,344,1173,288,2311,454,1683,8041,8042,1461,4562,4046,2589,8043,8044,4563,985,894,8045,3399,3168,8046,1913,2928,3729,1988,8047,2110,1974,8048,4047,8049,2571,1194,425,8050,4564,3169,1245,3730,4285,8051,8052,2850,8053,636,4565,1855,3861,760,1799,8054,4286,2209,1508,4566,4048,1893,1684,2293,8055,8056,8057,4287,4288,2210,479,8058,8059,832,8060,4049,2489,8061,2965,2490,3731,990,3109,627,1814,2642,4289,1582,4290,2125,2111,3496,4567,8062,799,4291,3170,8063,4568,2112,1737,3013,1018,543,754,4292,3309,1676,4569,4570,4050,8064,1489,8065,3497,8066,2614,2889,4051,8067,8068,2966,8069,8070,8071,8072,3171,4571,4572,2182,1722,8073,3238,3239,1842,3610,1715,481,365,1975,1856,8074,8075,1962,2491,4573,8076,2126,3611,3240,433,1894,2063,2075,8077,602,2741,8078,8079,8080,8081,8082,3014,1628,3400,8083,3172,4574,4052,2890,4575,2512,8084,2544,2772,8085,8086,8087,3310,4576,2891,8088,4577,8089,2851,4578,4579,1221,2967,4053,2513,8090,8091,8092,1867,1989,8093,8094,8095,1895,8096,8097,4580,1896,4054,318,8098,2094,4055,4293,8099,8100,485,8101,938,3862,553,2670,116,8102,3863,3612,8103,3498,2671,2773,3401,3311,2807,8104,3613,2929,4056,1747,2930,2968,8105,8106,207,8107,8108,2672,4581,2514,8109,3015,890,3614,3864,8110,1877,3732,3402,8111,2183,2353,3403,1652,8112,8113,8114,941,2294,208,3499,4057,2019,330,4294,3865,2892,2492,3733,4295,8115,8116,8117,8118,2515,1613,4582,8119,3312,3866,2516,8120,4058,8121,1637,4059,2466,4583,3867,8122,2493,3016,3734,8123,8124,2192,8125,8126,2162,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741]},function(e,t){t.EUCKR_TYPICAL_DISTRIBUTION_RATIO=6,t.EUCKR_TABLE_SIZE=2352,t.EUCKRCharToFreqOrder=[13,130,120,1396,481,1719,1720,328,609,212,1721,707,400,299,1722,87,1397,1723,104,536,1117,1203,1724,1267,685,1268,508,1725,1726,1727,1728,1398,1399,1729,1730,1731,141,621,326,1057,368,1732,267,488,20,1733,1269,1734,945,1400,1735,47,904,1270,1736,1737,773,248,1738,409,313,786,429,1739,116,987,813,1401,683,75,1204,145,1740,1741,1742,1743,16,847,667,622,708,1744,1745,1746,966,787,304,129,1747,60,820,123,676,1748,1749,1750,1751,617,1752,626,1753,1754,1755,1756,653,1757,1758,1759,1760,1761,1762,856,344,1763,1764,1765,1766,89,401,418,806,905,848,1767,1768,1769,946,1205,709,1770,1118,1771,241,1772,1773,1774,1271,1775,569,1776,999,1777,1778,1779,1780,337,751,1058,28,628,254,1781,177,906,270,349,891,1079,1782,19,1783,379,1784,315,1785,629,754,1402,559,1786,636,203,1206,1787,710,567,1788,935,814,1789,1790,1207,766,528,1791,1792,1208,1793,1794,1795,1796,1797,1403,1798,1799,533,1059,1404,1405,1156,1406,936,884,1080,1800,351,1801,1802,1803,1804,1805,801,1806,1807,1808,1119,1809,1157,714,474,1407,1810,298,899,885,1811,1120,802,1158,1812,892,1813,1814,1408,659,1815,1816,1121,1817,1818,1819,1820,1821,1822,319,1823,594,545,1824,815,937,1209,1825,1826,573,1409,1022,1827,1210,1828,1829,1830,1831,1832,1833,556,722,807,1122,1060,1834,697,1835,900,557,715,1836,1410,540,1411,752,1159,294,597,1211,976,803,770,1412,1837,1838,39,794,1413,358,1839,371,925,1840,453,661,788,531,723,544,1023,1081,869,91,1841,392,430,790,602,1414,677,1082,457,1415,1416,1842,1843,475,327,1024,1417,795,121,1844,733,403,1418,1845,1846,1847,300,119,711,1212,627,1848,1272,207,1849,1850,796,1213,382,1851,519,1852,1083,893,1853,1854,1855,367,809,487,671,1856,663,1857,1858,956,471,306,857,1859,1860,1160,1084,1861,1862,1863,1864,1865,1061,1866,1867,1868,1869,1870,1871,282,96,574,1872,502,1085,1873,1214,1874,907,1875,1876,827,977,1419,1420,1421,268,1877,1422,1878,1879,1880,308,1881,2,537,1882,1883,1215,1884,1885,127,791,1886,1273,1423,1887,34,336,404,643,1888,571,654,894,840,1889,0,886,1274,122,575,260,908,938,1890,1275,410,316,1891,1892,100,1893,1894,1123,48,1161,1124,1025,1895,633,901,1276,1896,1897,115,816,1898,317,1899,694,1900,909,734,1424,572,866,1425,691,85,524,1010,543,394,841,1901,1902,1903,1026,1904,1905,1906,1907,1908,1909,30,451,651,988,310,1910,1911,1426,810,1216,93,1912,1913,1277,1217,1914,858,759,45,58,181,610,269,1915,1916,131,1062,551,443,1e3,821,1427,957,895,1086,1917,1918,375,1919,359,1920,687,1921,822,1922,293,1923,1924,40,662,118,692,29,939,887,640,482,174,1925,69,1162,728,1428,910,1926,1278,1218,1279,386,870,217,854,1163,823,1927,1928,1929,1930,834,1931,78,1932,859,1933,1063,1934,1935,1936,1937,438,1164,208,595,1938,1939,1940,1941,1219,1125,1942,280,888,1429,1430,1220,1431,1943,1944,1945,1946,1947,1280,150,510,1432,1948,1949,1950,1951,1952,1953,1954,1011,1087,1955,1433,1043,1956,881,1957,614,958,1064,1065,1221,1958,638,1001,860,967,896,1434,989,492,553,1281,1165,1959,1282,1002,1283,1222,1960,1961,1962,1963,36,383,228,753,247,454,1964,876,678,1965,1966,1284,126,464,490,835,136,672,529,940,1088,1435,473,1967,1968,467,50,390,227,587,279,378,598,792,968,240,151,160,849,882,1126,1285,639,1044,133,140,288,360,811,563,1027,561,142,523,1969,1970,1971,7,103,296,439,407,506,634,990,1972,1973,1974,1975,645,1976,1977,1978,1979,1980,1981,236,1982,1436,1983,1984,1089,192,828,618,518,1166,333,1127,1985,818,1223,1986,1987,1988,1989,1990,1991,1992,1993,342,1128,1286,746,842,1994,1995,560,223,1287,98,8,189,650,978,1288,1996,1437,1997,17,345,250,423,277,234,512,226,97,289,42,167,1998,201,1999,2e3,843,836,824,532,338,783,1090,182,576,436,1438,1439,527,500,2001,947,889,2002,2003,2004,2005,262,600,314,447,2006,547,2007,693,738,1129,2008,71,1440,745,619,688,2009,829,2010,2011,147,2012,33,948,2013,2014,74,224,2015,61,191,918,399,637,2016,1028,1130,257,902,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,837,2027,2028,2029,2030,179,874,591,52,724,246,2031,2032,2033,2034,1167,969,2035,1289,630,605,911,1091,1168,2036,2037,2038,1441,912,2039,623,2040,2041,253,1169,1290,2042,1442,146,620,611,577,433,2043,1224,719,1170,959,440,437,534,84,388,480,1131,159,220,198,679,2044,1012,819,1066,1443,113,1225,194,318,1003,1029,2045,2046,2047,2048,1067,2049,2050,2051,2052,2053,59,913,112,2054,632,2055,455,144,739,1291,2056,273,681,499,2057,448,2058,2059,760,2060,2061,970,384,169,245,1132,2062,2063,414,1444,2064,2065,41,235,2066,157,252,877,568,919,789,580,2067,725,2068,2069,1292,2070,2071,1445,2072,1446,2073,2074,55,588,66,1447,271,1092,2075,1226,2076,960,1013,372,2077,2078,2079,2080,2081,1293,2082,2083,2084,2085,850,2086,2087,2088,2089,2090,186,2091,1068,180,2092,2093,2094,109,1227,522,606,2095,867,1448,1093,991,1171,926,353,1133,2096,581,2097,2098,2099,1294,1449,1450,2100,596,1172,1014,1228,2101,1451,1295,1173,1229,2102,2103,1296,1134,1452,949,1135,2104,2105,1094,1453,1454,1455,2106,1095,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,804,2118,2119,1230,1231,805,1456,405,1136,2120,2121,2122,2123,2124,720,701,1297,992,1457,927,1004,2125,2126,2127,2128,2129,2130,22,417,2131,303,2132,385,2133,971,520,513,2134,1174,73,1096,231,274,962,1458,673,2135,1459,2136,152,1137,2137,2138,2139,2140,1005,1138,1460,1139,2141,2142,2143,2144,11,374,844,2145,154,1232,46,1461,2146,838,830,721,1233,106,2147,90,428,462,578,566,1175,352,2148,2149,538,1234,124,1298,2150,1462,761,565,2151,686,2152,649,2153,72,173,2154,460,415,2155,1463,2156,1235,305,2157,2158,2159,2160,2161,2162,579,2163,2164,2165,2166,2167,747,2168,2169,2170,2171,1464,669,2172,2173,2174,2175,2176,1465,2177,23,530,285,2178,335,729,2179,397,2180,2181,2182,1030,2183,2184,698,2185,2186,325,2187,2188,369,2189,799,1097,1015,348,2190,1069,680,2191,851,1466,2192,2193,10,2194,613,424,2195,979,108,449,589,27,172,81,1031,80,774,281,350,1032,525,301,582,1176,2196,674,1045,2197,2198,1467,730,762,2199,2200,2201,2202,1468,2203,993,2204,2205,266,1070,963,1140,2206,2207,2208,664,1098,972,2209,2210,2211,1177,1469,1470,871,2212,2213,2214,2215,2216,1471,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,1472,1236,2228,2229,2230,2231,2232,2233,2234,2235,1299,2236,2237,200,2238,477,373,2239,2240,731,825,777,2241,2242,2243,521,486,548,2244,2245,2246,1473,1300,53,549,137,875,76,158,2247,1301,1474,469,396,1016,278,712,2248,321,442,503,767,744,941,1237,1178,1475,2249,82,178,1141,1179,973,2250,1302,2251,297,2252,2253,570,2254,2255,2256,18,450,206,2257,290,292,1142,2258,511,162,99,346,164,735,2259,1476,1477,4,554,343,798,1099,2260,1100,2261,43,171,1303,139,215,2262,2263,717,775,2264,1033,322,216,2265,831,2266,149,2267,1304,2268,2269,702,1238,135,845,347,309,2270,484,2271,878,655,238,1006,1478,2272,67,2273,295,2274,2275,461,2276,478,942,412,2277,1034,2278,2279,2280,265,2281,541,2282,2283,2284,2285,2286,70,852,1071,2287,2288,2289,2290,21,56,509,117,432,2291,2292,331,980,552,1101,148,284,105,393,1180,1239,755,2293,187,2294,1046,1479,2295,340,2296,63,1047,230,2297,2298,1305,763,1306,101,800,808,494,2299,2300,2301,903,2302,37,1072,14,5,2303,79,675,2304,312,2305,2306,2307,2308,2309,1480,6,1307,2310,2311,2312,1,470,35,24,229,2313,695,210,86,778,15,784,592,779,32,77,855,964,2314,259,2315,501,380,2316,2317,83,981,153,689,1308,1481,1482,1483,2318,2319,716,1484,2320,2321,2322,2323,2324,2325,1485,2326,2327,128,57,68,261,1048,211,170,1240,31,2328,51,435,742,2329,2330,2331,635,2332,264,456,2333,2334,2335,425,2336,1486,143,507,263,943,2337,363,920,1487,256,1488,1102,243,601,1489,2338,2339,2340,2341,2342,2343,2344,861,2345,2346,2347,2348,2349,2350,395,2351,1490,1491,62,535,166,225,2352,2353,668,419,1241,138,604,928,2354,1181,2355,1492,1493,2356,2357,2358,1143,2359,696,2360,387,307,1309,682,476,2361,2362,332,12,222,156,2363,232,2364,641,276,656,517,1494,1495,1035,416,736,1496,2365,1017,586,2366,2367,2368,1497,2369,242,2370,2371,2372,1498,2373,965,713,2374,2375,2376,2377,740,982,1499,944,1500,1007,2378,2379,1310,1501,2380,2381,2382,785,329,2383,2384,1502,2385,2386,2387,932,2388,1503,2389,2390,2391,2392,1242,2393,2394,2395,2396,2397,994,950,2398,2399,2400,2401,1504,1311,2402,2403,2404,2405,1049,749,2406,2407,853,718,1144,1312,2408,1182,1505,2409,2410,255,516,479,564,550,214,1506,1507,1313,413,239,444,339,1145,1036,1508,1509,1314,1037,1510,1315,2411,1511,2412,2413,2414,176,703,497,624,593,921,302,2415,341,165,1103,1512,2416,1513,2417,2418,2419,376,2420,700,2421,2422,2423,258,768,1316,2424,1183,2425,995,608,2426,2427,2428,2429,221,2430,2431,2432,2433,2434,2435,2436,2437,195,323,726,188,897,983,1317,377,644,1050,879,2438,452,2439,2440,2441,2442,2443,2444,914,2445,2446,2447,2448,915,489,2449,1514,1184,2450,2451,515,64,427,495,2452,583,2453,483,485,1038,562,213,1515,748,666,2454,2455,2456,2457,334,2458,780,996,1008,705,1243,2459,2460,2461,2462,2463,114,2464,493,1146,366,163,1516,961,1104,2465,291,2466,1318,1105,2467,1517,365,2468,355,951,1244,2469,1319,2470,631,2471,2472,218,1320,364,320,756,1518,1519,1321,1520,1322,2473,2474,2475,2476,997,2477,2478,2479,2480,665,1185,2481,916,1521,2482,2483,2484,584,684,2485,2486,797,2487,1051,1186,2488,2489,2490,1522,2491,2492,370,2493,1039,1187,65,2494,434,205,463,1188,2495,125,812,391,402,826,699,286,398,155,781,771,585,2496,590,505,1073,2497,599,244,219,917,1018,952,646,1523,2498,1323,2499,2500,49,984,354,741,2501,625,2502,1324,2503,1019,190,357,757,491,95,782,868,2504,2505,2506,2507,2508,2509,134,1524,1074,422,1525,898,2510,161,2511,2512,2513,2514,769,2515,1526,2516,2517,411,1325,2518,472,1527,2519,2520,2521,2522,2523,2524,985,2525,2526,2527,2528,2529,2530,764,2531,1245,2532,2533,25,204,311,2534,496,2535,1052,2536,2537,2538,2539,2540,2541,2542,199,704,504,468,758,657,1528,196,44,839,1246,272,750,2543,765,862,2544,2545,1326,2546,132,615,933,2547,732,2548,2549,2550,1189,1529,2551,283,1247,1053,607,929,2552,2553,2554,930,183,872,616,1040,1147,2555,1148,1020,441,249,1075,2556,2557,2558,466,743,2559,2560,2561,92,514,426,420,526,2562,2563,2564,2565,2566,2567,2568,185,2569,2570,2571,2572,776,1530,658,2573,362,2574,361,922,1076,793,2575,2576,2577,2578,2579,2580,1531,251,2581,2582,2583,2584,1532,54,612,237,1327,2585,2586,275,408,647,111,2587,1533,1106,465,3,458,9,38,2588,107,110,890,209,26,737,498,2589,1534,2590,431,202,88,1535,356,287,1107,660,1149,2591,381,1536,986,1150,445,1248,1151,974,2592,2593,846,2594,446,953,184,1249,1250,727,2595,923,193,883,2596,2597,2598,102,324,539,817,2599,421,1041,2600,832,2601,94,175,197,406,2602,459,2603,2604,2605,2606,2607,330,555,2608,2609,2610,706,1108,389,2611,2612,2613,2614,233,2615,833,558,931,954,1251,2616,2617,1537,546,2618,2619,1009,2620,2621,2622,1538,690,1328,2623,955,2624,1539,2625,2626,772,2627,2628,2629,2630,2631,924,648,863,603,2632,2633,934,1540,864,865,2634,642,1042,670,1190,2635,2636,2637,2638,168,2639,652,873,542,1054,1541,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,1542,880,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,1543,2726,2727,2728,2729,2730,2731,2732,1544,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,1545,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,1546,2767,1547,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,1548,2787,2788,2789,1109,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,1329,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2852,2853,2854,2855,2856,1549,2857,2858,2859,2860,1550,2861,2862,1551,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,1110,1330,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,1331,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,1552,2944,2945,2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,1252,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,3e3,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,1553,3013,3014,3015,3016,3017,1554,3018,1332,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,1555,3051,3052,3053,1556,1557,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,1558,3068,3069,3070,3071,3072,3073,3074,3075,3076,1559,3077,3078,3079,3080,3081,3082,3083,1253,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,1152,3109,3110,3111,3112,3113,1560,3114,3115,3116,3117,1111,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,1333,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,1561,3190,3191,1334,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,3234,1562,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,1563,3278,3279,3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,3360,3361,3362,3363,3364,1335,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,1336,3388,3389,3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,1337,3415,3416,3417,3418,3419,1338,3420,3421,3422,1564,1565,3423,3424,3425,3426,3427,3428,3429,3430,3431,1254,3432,3433,3434,1339,3435,3436,3437,3438,3439,1566,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,3450,3451,3452,3453,3454,1255,3455,3456,3457,3458,3459,1567,1191,3460,1568,1569,3461,3462,3463,1570,3464,3465,3466,3467,3468,1571,3469,3470,3471,3472,3473,1572,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,1340,3487,3488,3489,3490,3491,3492,1021,3493,3494,3495,3496,3497,3498,1573,3499,1341,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,1342,3512,3513,3514,3515,3516,1574,1343,3517,3518,3519,1575,3520,1576,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3580,1577,3581,3582,1578,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,1579,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,1580,3630,3631,1581,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,1582,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,1192,3701,3702,3703,3704,1256,3705,3706,3707,3708,1583,1257,3709,3710,3711,3712,3713,3714,3715,3716,1584,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,1344,3746,3747,3748,3749,3750,3751,3752,3753,3754,3755,3756,1585,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,1586,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,1345,3779,3780,3781,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,1346,1587,3796,3797,1588,3798,3799,3800,3801,3802,3803,3804,3805,3806,1347,3807,3808,3809,3810,3811,1589,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,1590,3822,3823,1591,1348,3824,3825,3826,3827,3828,3829,3830,1592,3831,3832,1593,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,1349,3845,3846,3847,3848,3849,3850,3851,3852,3853,3854,3855,3856,3857,3858,1594,3859,3860,3861,3862,3863,3864,3865,3866,3867,3868,3869,1595,3870,3871,3872,3873,1596,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3886,1597,3887,3888,3889,3890,3891,3892,3893,3894,3895,1598,3896,3897,3898,1599,1600,3899,1350,3900,1351,3901,3902,1352,3903,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,3922,3923,3924,1258,3925,3926,3927,3928,3929,3930,3931,1193,3932,1601,3933,3934,3935,3936,3937,3938,3939,3940,3941,3942,3943,1602,3944,3945,3946,3947,3948,1603,3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,1604,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,1353,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,1354,3992,3993,3994,3995,3996,3997,3998,3999,4e3,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,1355,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,1605,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,1606,4061,4062,4063,4064,1607,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,1194,4077,4078,1608,4079,4080,4081,4082,4083,4084,4085,4086,4087,1609,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,1259,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,1195,4125,4126,4127,1610,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,1356,4138,4139,4140,4141,4142,4143,4144,1611,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,1612,4220,4221,4222,4223,4224,4225,4226,4227,1357,4228,1613,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,1614,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,1196,1358,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,1615,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,1616,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,1617,4361,4362,4363,4364,4365,1618,4366,4367,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,1619,4417,4418,4419,4420,4421,4422,4423,4424,4425,1112,4426,4427,4428,4429,4430,1620,4431,4432,4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,1260,1261,4443,4444,4445,4446,4447,4448,4449,4450,4451,4452,4453,4454,4455,1359,4456,4457,4458,4459,4460,4461,4462,4463,4464,4465,1621,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,1055,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,1622,4519,4520,4521,1623,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,1360,4536,4537,4538,4539,4540,4541,4542,4543,975,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,1624,4572,4573,4574,4575,4576,1625,4577,4578,4579,4580,4581,4582,4583,4584,1626,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,1627,4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,1628,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,1361,4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,1362,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,1629,4683,4684,4685,4686,4687,1630,4688,4689,4690,4691,1153,4692,4693,4694,1113,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,1197,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,1631,4736,1632,4737,4738,4739,4740,4741,4742,4743,4744,1633,4745,4746,4747,4748,4749,1262,4750,4751,4752,4753,4754,1363,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,1634,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,1635,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,1636,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,1637,4807,4808,4809,1638,4810,4811,4812,4813,4814,4815,4816,4817,4818,1639,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,1077,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,1640,4884,4885,1641,4886,4887,4888,4889,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,4910,4911,1642,4912,4913,4914,1364,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,4928,4929,4930,4931,1643,4932,4933,4934,4935,4936,4937,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,4950,4951,4952,4953,4954,4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,1644,4981,4982,4983,4984,1645,4985,4986,1646,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,5e3,5001,5002,5003,5004,5005,1647,5006,1648,5007,5008,5009,5010,5011,5012,1078,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,1365,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,1649,5040,5041,5042,5043,5044,5045,1366,5046,5047,5048,5049,5050,5051,5052,5053,5054,5055,1650,5056,5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,5073,5074,5075,5076,5077,1651,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,1652,5111,5112,5113,5114,5115,5116,5117,5118,1367,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,1653,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,1368,5150,1654,5151,1369,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,1370,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5193,5194,5195,5196,5197,5198,1655,5199,5200,5201,5202,1656,5203,5204,5205,5206,1371,5207,1372,5208,5209,5210,5211,1373,5212,5213,1374,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,1657,5248,5249,5250,5251,1658,1263,5252,5253,5254,5255,5256,1375,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,1659,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,1660,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,1376,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,1198,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,1661,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,1264,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,1662,5413,5414,5415,5416,1663,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,1664,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,1154,5479,5480,5481,5482,5483,5484,5485,1665,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,1377,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,1114,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,1378,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,1379,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,1380,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,1381,1056,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,1666,5661,5662,5663,5664,5665,5666,5667,5668,1667,5669,1668,5670,5671,5672,5673,5674,5675,5676,5677,5678,1155,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,1669,5699,5700,5701,5702,5703,5704,5705,1670,5706,5707,5708,5709,5710,1671,5711,5712,5713,5714,1382,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,1672,5726,5727,1673,1674,5728,5729,5730,5731,5732,5733,5734,5735,5736,1675,5737,5738,5739,5740,5741,5742,5743,5744,1676,5745,5746,5747,5748,5749,5750,5751,1383,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,1677,5769,5770,5771,5772,5773,1678,5774,5775,5776,998,5777,5778,5779,5780,5781,5782,5783,5784,5785,1384,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,1679,5801,5802,5803,1115,1116,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,1680,5856,5857,5858,5859,5860,5861,5862,5863,5864,1681,5865,5866,5867,1682,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,1683,5880,1684,5881,5882,5883,5884,1685,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,1686,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,1687,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,1688,1689,5953,1199,5954,5955,5956,5957,5958,5959,5960,5961,1690,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,1385,5982,1386,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6e3,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,1265,6028,6029,1691,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,1692,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,1693,6132,6133,6134,6135,6136,1694,6137,6138,6139,6140,6141,1695,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,1696,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,1697,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,1698,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,1200,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,1699,6303,6304,1700,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,1701,6340,6341,6342,6343,6344,1387,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,1702,6414,6415,6416,6417,6418,6419,6420,6421,6422,1703,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,1704,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,1266,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,1705,1706,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,1388,6638,6639,6640,6641,6642,6643,6644,1707,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,1708,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,1201,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,1389,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,1390,1709,6737,6738,6739,6740,6741,6742,1710,6743,6744,6745,6746,1391,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,1392,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,1202,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,1711,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,1393,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,1712,6903,6904,6905,6906,6907,6908,6909,6910,1713,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,1714,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,1394,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,7e3,1715,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,1716,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,1395,7208,7209,7210,7211,7212,7213,1717,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,1718,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8e3,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741]},function(e,t){t.GB2312_TYPICAL_DISTRIBUTION_RATIO=.9,t.GB2312_TABLE_SIZE=3760,t.GB2312CharToFreqOrder=[1671,749,1443,2364,3924,3807,2330,3921,1704,3463,2691,1511,1515,572,3191,2205,2361,224,2558,479,1711,963,3162,440,4060,1905,2966,2947,3580,2647,3961,3842,2204,869,4207,970,2678,5626,2944,2956,1479,4048,514,3595,588,1346,2820,3409,249,4088,1746,1873,2047,1774,581,1813,358,1174,3590,1014,1561,4844,2245,670,1636,3112,889,1286,953,556,2327,3060,1290,3141,613,185,3477,1367,850,3820,1715,2428,2642,2303,2732,3041,2562,2648,3566,3946,1349,388,3098,2091,1360,3585,152,1687,1539,738,1559,59,1232,2925,2267,1388,1249,1741,1679,2960,151,1566,1125,1352,4271,924,4296,385,3166,4459,310,1245,2850,70,3285,2729,3534,3575,2398,3298,3466,1960,2265,217,3647,864,1909,2084,4401,2773,1010,3269,5152,853,3051,3121,1244,4251,1895,364,1499,1540,2313,1180,3655,2268,562,715,2417,3061,544,336,3768,2380,1752,4075,950,280,2425,4382,183,2759,3272,333,4297,2155,1688,2356,1444,1039,4540,736,1177,3349,2443,2368,2144,2225,565,196,1482,3406,927,1335,4147,692,878,1311,1653,3911,3622,1378,4200,1840,2969,3149,2126,1816,2534,1546,2393,2760,737,2494,13,447,245,2747,38,2765,2129,2589,1079,606,360,471,3755,2890,404,848,699,1785,1236,370,2221,1023,3746,2074,2026,2023,2388,1581,2119,812,1141,3091,2536,1519,804,2053,406,1596,1090,784,548,4414,1806,2264,2936,1100,343,4114,5096,622,3358,743,3668,1510,1626,5020,3567,2513,3195,4115,5627,2489,2991,24,2065,2697,1087,2719,48,1634,315,68,985,2052,198,2239,1347,1107,1439,597,2366,2172,871,3307,919,2487,2790,1867,236,2570,1413,3794,906,3365,3381,1701,1982,1818,1524,2924,1205,616,2586,2072,2004,575,253,3099,32,1365,1182,197,1714,2454,1201,554,3388,3224,2748,756,2587,250,2567,1507,1517,3529,1922,2761,2337,3416,1961,1677,2452,2238,3153,615,911,1506,1474,2495,1265,1906,2749,3756,3280,2161,898,2714,1759,3450,2243,2444,563,26,3286,2266,3769,3344,2707,3677,611,1402,531,1028,2871,4548,1375,261,2948,835,1190,4134,353,840,2684,1900,3082,1435,2109,1207,1674,329,1872,2781,4055,2686,2104,608,3318,2423,2957,2768,1108,3739,3512,3271,3985,2203,1771,3520,1418,2054,1681,1153,225,1627,2929,162,2050,2511,3687,1954,124,1859,2431,1684,3032,2894,585,4805,3969,2869,2704,2088,2032,2095,3656,2635,4362,2209,256,518,2042,2105,3777,3657,643,2298,1148,1779,190,989,3544,414,11,2135,2063,2979,1471,403,3678,126,770,1563,671,2499,3216,2877,600,1179,307,2805,4937,1268,1297,2694,252,4032,1448,1494,1331,1394,127,2256,222,1647,1035,1481,3056,1915,1048,873,3651,210,33,1608,2516,200,1520,415,102,0,3389,1287,817,91,3299,2940,836,1814,549,2197,1396,1669,2987,3582,2297,2848,4528,1070,687,20,1819,121,1552,1364,1461,1968,2617,3540,2824,2083,177,948,4938,2291,110,4549,2066,648,3359,1755,2110,2114,4642,4845,1693,3937,3308,1257,1869,2123,208,1804,3159,2992,2531,2549,3361,2418,1350,2347,2800,2568,1291,2036,2680,72,842,1990,212,1233,1154,1586,75,2027,3410,4900,1823,1337,2710,2676,728,2810,1522,3026,4995,157,755,1050,4022,710,785,1936,2194,2085,1406,2777,2400,150,1250,4049,1206,807,1910,534,529,3309,1721,1660,274,39,2827,661,2670,1578,925,3248,3815,1094,4278,4901,4252,41,1150,3747,2572,2227,4501,3658,4902,3813,3357,3617,2884,2258,887,538,4187,3199,1294,2439,3042,2329,2343,2497,1255,107,543,1527,521,3478,3568,194,5062,15,961,3870,1241,1192,2664,66,5215,3260,2111,1295,1127,2152,3805,4135,901,1164,1976,398,1278,530,1460,748,904,1054,1966,1426,53,2909,509,523,2279,1534,536,1019,239,1685,460,2353,673,1065,2401,3600,4298,2272,1272,2363,284,1753,3679,4064,1695,81,815,2677,2757,2731,1386,859,500,4221,2190,2566,757,1006,2519,2068,1166,1455,337,2654,3203,1863,1682,1914,3025,1252,1409,1366,847,714,2834,2038,3209,964,2970,1901,885,2553,1078,1756,3049,301,1572,3326,688,2130,1996,2429,1805,1648,2930,3421,2750,3652,3088,262,1158,1254,389,1641,1812,526,1719,923,2073,1073,1902,468,489,4625,1140,857,2375,3070,3319,2863,380,116,1328,2693,1161,2244,273,1212,1884,2769,3011,1775,1142,461,3066,1200,2147,2212,790,702,2695,4222,1601,1058,434,2338,5153,3640,67,2360,4099,2502,618,3472,1329,416,1132,830,2782,1807,2653,3211,3510,1662,192,2124,296,3979,1739,1611,3684,23,118,324,446,1239,1225,293,2520,3814,3795,2535,3116,17,1074,467,2692,2201,387,2922,45,1326,3055,1645,3659,2817,958,243,1903,2320,1339,2825,1784,3289,356,576,865,2315,2381,3377,3916,1088,3122,1713,1655,935,628,4689,1034,1327,441,800,720,894,1979,2183,1528,5289,2702,1071,4046,3572,2399,1571,3281,79,761,1103,327,134,758,1899,1371,1615,879,442,215,2605,2579,173,2048,2485,1057,2975,3317,1097,2253,3801,4263,1403,1650,2946,814,4968,3487,1548,2644,1567,1285,2,295,2636,97,946,3576,832,141,4257,3273,760,3821,3521,3156,2607,949,1024,1733,1516,1803,1920,2125,2283,2665,3180,1501,2064,3560,2171,1592,803,3518,1416,732,3897,4258,1363,1362,2458,119,1427,602,1525,2608,1605,1639,3175,694,3064,10,465,76,2e3,4846,4208,444,3781,1619,3353,2206,1273,3796,740,2483,320,1723,2377,3660,2619,1359,1137,1762,1724,2345,2842,1850,1862,912,821,1866,612,2625,1735,2573,3369,1093,844,89,937,930,1424,3564,2413,2972,1004,3046,3019,2011,711,3171,1452,4178,428,801,1943,432,445,2811,206,4136,1472,730,349,73,397,2802,2547,998,1637,1167,789,396,3217,154,1218,716,1120,1780,2819,4826,1931,3334,3762,2139,1215,2627,552,3664,3628,3232,1405,2383,3111,1356,2652,3577,3320,3101,1703,640,1045,1370,1246,4996,371,1575,2436,1621,2210,984,4033,1734,2638,16,4529,663,2755,3255,1451,3917,2257,1253,1955,2234,1263,2951,214,1229,617,485,359,1831,1969,473,2310,750,2058,165,80,2864,2419,361,4344,2416,2479,1134,796,3726,1266,2943,860,2715,938,390,2734,1313,1384,248,202,877,1064,2854,522,3907,279,1602,297,2357,395,3740,137,2075,944,4089,2584,1267,3802,62,1533,2285,178,176,780,2440,201,3707,590,478,1560,4354,2117,1075,30,74,4643,4004,1635,1441,2745,776,2596,238,1077,1692,1912,2844,605,499,1742,3947,241,3053,980,1749,936,2640,4511,2582,515,1543,2162,5322,2892,2993,890,2148,1924,665,1827,3581,1032,968,3163,339,1044,1896,270,583,1791,1720,4367,1194,3488,3669,43,2523,1657,163,2167,290,1209,1622,3378,550,634,2508,2510,695,2634,2384,2512,1476,1414,220,1469,2341,2138,2852,3183,2900,4939,2865,3502,1211,3680,854,3227,1299,2976,3172,186,2998,1459,443,1067,3251,1495,321,1932,3054,909,753,1410,1828,436,2441,1119,1587,3164,2186,1258,227,231,1425,1890,3200,3942,247,959,725,5254,2741,577,2158,2079,929,120,174,838,2813,591,1115,417,2024,40,3240,1536,1037,291,4151,2354,632,1298,2406,2500,3535,1825,1846,3451,205,1171,345,4238,18,1163,811,685,2208,1217,425,1312,1508,1175,4308,2552,1033,587,1381,3059,2984,3482,340,1316,4023,3972,792,3176,519,777,4690,918,933,4130,2981,3741,90,3360,2911,2200,5184,4550,609,3079,2030,272,3379,2736,363,3881,1130,1447,286,779,357,1169,3350,3137,1630,1220,2687,2391,747,1277,3688,2618,2682,2601,1156,3196,5290,4034,3102,1689,3596,3128,874,219,2783,798,508,1843,2461,269,1658,1776,1392,1913,2983,3287,2866,2159,2372,829,4076,46,4253,2873,1889,1894,915,1834,1631,2181,2318,298,664,2818,3555,2735,954,3228,3117,527,3511,2173,681,2712,3033,2247,2346,3467,1652,155,2164,3382,113,1994,450,899,494,994,1237,2958,1875,2336,1926,3727,545,1577,1550,633,3473,204,1305,3072,2410,1956,2471,707,2134,841,2195,2196,2663,3843,1026,4940,990,3252,4997,368,1092,437,3212,3258,1933,1829,675,2977,2893,412,943,3723,4644,3294,3283,2230,2373,5154,2389,2241,2661,2323,1404,2524,593,787,677,3008,1275,2059,438,2709,2609,2240,2269,2246,1446,36,1568,1373,3892,1574,2301,1456,3962,693,2276,5216,2035,1143,2720,1919,1797,1811,2763,4137,2597,1830,1699,1488,1198,2090,424,1694,312,3634,3390,4179,3335,2252,1214,561,1059,3243,2295,2561,975,5155,2321,2751,3772,472,1537,3282,3398,1047,2077,2348,2878,1323,3340,3076,690,2906,51,369,170,3541,1060,2187,2688,3670,2541,1083,1683,928,3918,459,109,4427,599,3744,4286,143,2101,2730,2490,82,1588,3036,2121,281,1860,477,4035,1238,2812,3020,2716,3312,1530,2188,2055,1317,843,636,1808,1173,3495,649,181,1002,147,3641,1159,2414,3750,2289,2795,813,3123,2610,1136,4368,5,3391,4541,2174,420,429,1728,754,1228,2115,2219,347,2223,2733,735,1518,3003,2355,3134,1764,3948,3329,1888,2424,1001,1234,1972,3321,3363,1672,1021,1450,1584,226,765,655,2526,3404,3244,2302,3665,731,594,2184,319,1576,621,658,2656,4299,2099,3864,1279,2071,2598,2739,795,3086,3699,3908,1707,2352,2402,1382,3136,2475,1465,4847,3496,3865,1085,3004,2591,1084,213,2287,1963,3565,2250,822,793,4574,3187,1772,1789,3050,595,1484,1959,2770,1080,2650,456,422,2996,940,3322,4328,4345,3092,2742,965,2784,739,4124,952,1358,2498,2949,2565,332,2698,2378,660,2260,2473,4194,3856,2919,535,1260,2651,1208,1428,1300,1949,1303,2942,433,2455,2450,1251,1946,614,1269,641,1306,1810,2737,3078,2912,564,2365,1419,1415,1497,4460,2367,2185,1379,3005,1307,3218,2175,1897,3063,682,1157,4040,4005,1712,1160,1941,1399,394,402,2952,1573,1151,2986,2404,862,299,2033,1489,3006,346,171,2886,3401,1726,2932,168,2533,47,2507,1030,3735,1145,3370,1395,1318,1579,3609,4560,2857,4116,1457,2529,1965,504,1036,2690,2988,2405,745,5871,849,2397,2056,3081,863,2359,3857,2096,99,1397,1769,2300,4428,1643,3455,1978,1757,3718,1440,35,4879,3742,1296,4228,2280,160,5063,1599,2013,166,520,3479,1646,3345,3012,490,1937,1545,1264,2182,2505,1096,1188,1369,1436,2421,1667,2792,2460,1270,2122,727,3167,2143,806,1706,1012,1800,3037,960,2218,1882,805,139,2456,1139,1521,851,1052,3093,3089,342,2039,744,5097,1468,1502,1585,2087,223,939,326,2140,2577,892,2481,1623,4077,982,3708,135,2131,87,2503,3114,2326,1106,876,1616,547,2997,2831,2093,3441,4530,4314,9,3256,4229,4148,659,1462,1986,1710,2046,2913,2231,4090,4880,5255,3392,3274,1368,3689,4645,1477,705,3384,3635,1068,1529,2941,1458,3782,1509,100,1656,2548,718,2339,408,1590,2780,3548,1838,4117,3719,1345,3530,717,3442,2778,3220,2898,1892,4590,3614,3371,2043,1998,1224,3483,891,635,584,2559,3355,733,1766,1729,1172,3789,1891,2307,781,2982,2271,1957,1580,5773,2633,2005,4195,3097,1535,3213,1189,1934,5693,3262,586,3118,1324,1598,517,1564,2217,1868,1893,4445,3728,2703,3139,1526,1787,1992,3882,2875,1549,1199,1056,2224,1904,2711,5098,4287,338,1993,3129,3489,2689,1809,2815,1997,957,1855,3898,2550,3275,3057,1105,1319,627,1505,1911,1883,3526,698,3629,3456,1833,1431,746,77,1261,2017,2296,1977,1885,125,1334,1600,525,1798,1109,2222,1470,1945,559,2236,1186,3443,2476,1929,1411,2411,3135,1777,3372,2621,1841,1613,3229,668,1430,1839,2643,2916,195,1989,2671,2358,1387,629,3205,2293,5256,4439,123,1310,888,1879,4300,3021,3605,1003,1162,3192,2910,2010,140,2395,2859,55,1082,2012,2901,662,419,2081,1438,680,2774,4654,3912,1620,1731,1625,5035,4065,2328,512,1344,802,5443,2163,2311,2537,524,3399,98,1155,2103,1918,2606,3925,2816,1393,2465,1504,3773,2177,3963,1478,4346,180,1113,4655,3461,2028,1698,833,2696,1235,1322,1594,4408,3623,3013,3225,2040,3022,541,2881,607,3632,2029,1665,1219,639,1385,1686,1099,2803,3231,1938,3188,2858,427,676,2772,1168,2025,454,3253,2486,3556,230,1950,580,791,1991,1280,1086,1974,2034,630,257,3338,2788,4903,1017,86,4790,966,2789,1995,1696,1131,259,3095,4188,1308,179,1463,5257,289,4107,1248,42,3413,1725,2288,896,1947,774,4474,4254,604,3430,4264,392,2514,2588,452,237,1408,3018,988,4531,1970,3034,3310,540,2370,1562,1288,2990,502,4765,1147,4,1853,2708,207,294,2814,4078,2902,2509,684,34,3105,3532,2551,644,709,2801,2344,573,1727,3573,3557,2021,1081,3100,4315,2100,3681,199,2263,1837,2385,146,3484,1195,2776,3949,997,1939,3973,1008,1091,1202,1962,1847,1149,4209,5444,1076,493,117,5400,2521,972,1490,2934,1796,4542,2374,1512,2933,2657,413,2888,1135,2762,2314,2156,1355,2369,766,2007,2527,2170,3124,2491,2593,2632,4757,2437,234,3125,3591,1898,1750,1376,1942,3468,3138,570,2127,2145,3276,4131,962,132,1445,4196,19,941,3624,3480,3366,1973,1374,4461,3431,2629,283,2415,2275,808,2887,3620,2112,2563,1353,3610,955,1089,3103,1053,96,88,4097,823,3808,1583,399,292,4091,3313,421,1128,642,4006,903,2539,1877,2082,596,29,4066,1790,722,2157,130,995,1569,769,1485,464,513,2213,288,1923,1101,2453,4316,133,486,2445,50,625,487,2207,57,423,481,2962,159,3729,1558,491,303,482,501,240,2837,112,3648,2392,1783,362,8,3433,3422,610,2793,3277,1390,1284,1654,21,3823,734,367,623,193,287,374,1009,1483,816,476,313,2255,2340,1262,2150,2899,1146,2581,782,2116,1659,2018,1880,255,3586,3314,1110,2867,2137,2564,986,2767,5185,2006,650,158,926,762,881,3157,2717,2362,3587,306,3690,3245,1542,3077,2427,1691,2478,2118,2985,3490,2438,539,2305,983,129,1754,355,4201,2386,827,2923,104,1773,2838,2771,411,2905,3919,376,767,122,1114,828,2422,1817,3506,266,3460,1007,1609,4998,945,2612,4429,2274,726,1247,1964,2914,2199,2070,4002,4108,657,3323,1422,579,455,2764,4737,1222,2895,1670,824,1223,1487,2525,558,861,3080,598,2659,2515,1967,752,2583,2376,2214,4180,977,704,2464,4999,2622,4109,1210,2961,819,1541,142,2284,44,418,457,1126,3730,4347,4626,1644,1876,3671,1864,302,1063,5694,624,723,1984,3745,1314,1676,2488,1610,1449,3558,3569,2166,2098,409,1011,2325,3704,2306,818,1732,1383,1824,1844,3757,999,2705,3497,1216,1423,2683,2426,2954,2501,2726,2229,1475,2554,5064,1971,1794,1666,2014,1343,783,724,191,2434,1354,2220,5065,1763,2752,2472,4152,131,175,2885,3434,92,1466,4920,2616,3871,3872,3866,128,1551,1632,669,1854,3682,4691,4125,1230,188,2973,3290,1302,1213,560,3266,917,763,3909,3249,1760,868,1958,764,1782,2097,145,2277,3774,4462,64,1491,3062,971,2132,3606,2442,221,1226,1617,218,323,1185,3207,3147,571,619,1473,1005,1744,2281,449,1887,2396,3685,275,375,3816,1743,3844,3731,845,1983,2350,4210,1377,773,967,3499,3052,3743,2725,4007,1697,1022,3943,1464,3264,2855,2722,1952,1029,2839,2467,84,4383,2215,820,1391,2015,2448,3672,377,1948,2168,797,2545,3536,2578,2645,94,2874,1678,405,1259,3071,771,546,1315,470,1243,3083,895,2468,981,969,2037,846,4181,653,1276,2928,14,2594,557,3007,2474,156,902,1338,1740,2574,537,2518,973,2282,2216,2433,1928,138,2903,1293,2631,1612,646,3457,839,2935,111,496,2191,2847,589,3186,149,3994,2060,4031,2641,4067,3145,1870,37,3597,2136,1025,2051,3009,3383,3549,1121,1016,3261,1301,251,2446,2599,2153,872,3246,637,334,3705,831,884,921,3065,3140,4092,2198,1944,246,2964,108,2045,1152,1921,2308,1031,203,3173,4170,1907,3890,810,1401,2003,1690,506,647,1242,2828,1761,1649,3208,2249,1589,3709,2931,5156,1708,498,666,2613,834,3817,1231,184,2851,1124,883,3197,2261,3710,1765,1553,2658,1178,2639,2351,93,1193,942,2538,2141,4402,235,1821,870,1591,2192,1709,1871,3341,1618,4126,2595,2334,603,651,69,701,268,2662,3411,2555,1380,1606,503,448,254,2371,2646,574,1187,2309,1770,322,2235,1292,1801,305,566,1133,229,2067,2057,706,167,483,2002,2672,3295,1820,3561,3067,316,378,2746,3452,1112,136,1981,507,1651,2917,1117,285,4591,182,2580,3522,1304,335,3303,1835,2504,1795,1792,2248,674,1018,2106,2449,1857,2292,2845,976,3047,1781,2600,2727,1389,1281,52,3152,153,265,3950,672,3485,3951,4463,430,1183,365,278,2169,27,1407,1336,2304,209,1340,1730,2202,1852,2403,2883,979,1737,1062,631,2829,2542,3876,2592,825,2086,2226,3048,3625,352,1417,3724,542,991,431,1351,3938,1861,2294,826,1361,2927,3142,3503,1738,463,2462,2723,582,1916,1595,2808,400,3845,3891,2868,3621,2254,58,2492,1123,910,2160,2614,1372,1603,1196,1072,3385,1700,3267,1980,696,480,2430,920,799,1570,2920,1951,2041,4047,2540,1321,4223,2469,3562,2228,1271,2602,401,2833,3351,2575,5157,907,2312,1256,410,263,3507,1582,996,678,1849,2316,1480,908,3545,2237,703,2322,667,1826,2849,1531,2604,2999,2407,3146,2151,2630,1786,3711,469,3542,497,3899,2409,858,837,4446,3393,1274,786,620,1845,2001,3311,484,308,3367,1204,1815,3691,2332,1532,2557,1842,2020,2724,1927,2333,4440,567,22,1673,2728,4475,1987,1858,1144,1597,101,1832,3601,12,974,3783,4391,951,1412,1,3720,453,4608,4041,528,1041,1027,3230,2628,1129,875,1051,3291,1203,2262,1069,2860,2799,2149,2615,3278,144,1758,3040,31,475,1680,366,2685,3184,311,1642,4008,2466,5036,1593,1493,2809,216,1420,1668,233,304,2128,3284,232,1429,1768,1040,2008,3407,2740,2967,2543,242,2133,778,1565,2022,2620,505,2189,2756,1098,2273,372,1614,708,553,2846,2094,2278,169,3626,2835,4161,228,2674,3165,809,1454,1309,466,1705,1095,900,3423,880,2667,3751,5258,2317,3109,2571,4317,2766,1503,1342,866,4447,1118,63,2076,314,1881,1348,1061,172,978,3515,1747,532,511,3970,6,601,905,2699,3300,1751,276,1467,3725,2668,65,4239,2544,2779,2556,1604,578,2451,1802,992,2331,2624,1320,3446,713,1513,1013,103,2786,2447,1661,886,1702,916,654,3574,2031,1556,751,2178,2821,2179,1498,1538,2176,271,914,2251,2080,1325,638,1953,2937,3877,2432,2754,95,3265,1716,260,1227,4083,775,106,1357,3254,426,1607,555,2480,772,1985,244,2546,474,495,1046,2611,1851,2061,71,2089,1675,2590,742,3758,2843,3222,1433,267,2180,2576,2826,2233,2092,3913,2435,956,1745,3075,856,2113,1116,451,3,1988,2896,1398,993,2463,1878,2049,1341,2718,2721,2870,2108,712,2904,4363,2753,2324,277,2872,2349,2649,384,987,435,691,3e3,922,164,3939,652,1500,1184,4153,2482,3373,2165,4848,2335,3775,3508,3154,2806,2830,1554,2102,1664,2530,1434,2408,893,1547,2623,3447,2832,2242,2532,3169,2856,3223,2078,49,3770,3469,462,318,656,2259,3250,3069,679,1629,2758,344,1138,1104,3120,1836,1283,3115,2154,1437,4448,934,759,1999,794,2862,1038,533,2560,1722,2342,855,2626,1197,1663,4476,3127,85,4240,2528,25,1111,1181,3673,407,3470,4561,2679,2713,768,1925,2841,3986,1544,1165,932,373,1240,2146,1930,2673,721,4766,354,4333,391,2963,187,61,3364,1442,1102,330,1940,1767,341,3809,4118,393,2496,2062,2211,105,331,300,439,913,1332,626,379,3304,1557,328,689,3952,309,1555,931,317,2517,3027,325,569,686,2107,3084,60,1042,1333,2794,264,3177,4014,1628,258,3712,7,4464,1176,1043,1778,683,114,1975,78,1492,383,1886,510,386,645,5291,2891,2069,3305,4138,3867,2939,2603,2493,1935,1066,1848,3588,1015,1282,1289,4609,697,1453,3044,2666,3611,1856,2412,54,719,1330,568,3778,2459,1748,788,492,551,1191,1e3,488,3394,3763,282,1799,348,2016,1523,3155,2390,1049,382,2019,1788,1170,729,2968,3523,897,3926,2785,2938,3292,350,2319,3238,1718,1717,2655,3453,3143,4465,161,2889,2980,2009,1421,56,1908,1640,2387,2232,1917,1874,2477,4921,148,83,3438,592,4245,2882,1822,1055,741,115,1496,1624,381,1638,4592,1020,516,3214,458,947,4575,1432,211,1514,2926,1865,2142,189,852,1221,1400,1486,882,2299,4036,351,28,1122,700,6479,6480,6481,6482,6483,5508,6484,3900,3414,3974,4441,4024,3537,4037,5628,5099,3633,6485,3148,6486,3636,5509,3257,5510,5973,5445,5872,4941,4403,3174,4627,5873,6276,2286,4230,5446,5874,5122,6102,6103,4162,5447,5123,5323,4849,6277,3980,3851,5066,4246,5774,5067,6278,3001,2807,5695,3346,5775,5974,5158,5448,6487,5975,5976,5776,3598,6279,5696,4806,4211,4154,6280,6488,6489,6490,6281,4212,5037,3374,4171,6491,4562,4807,4722,4827,5977,6104,4532,4079,5159,5324,5160,4404,3858,5359,5875,3975,4288,4610,3486,4512,5325,3893,5360,6282,6283,5560,2522,4231,5978,5186,5449,2569,3878,6284,5401,3578,4415,6285,4656,5124,5979,2506,4247,4449,3219,3417,4334,4969,4329,6492,4576,4828,4172,4416,4829,5402,6286,3927,3852,5361,4369,4830,4477,4867,5876,4173,6493,6105,4657,6287,6106,5877,5450,6494,4155,4868,5451,3700,5629,4384,6288,6289,5878,3189,4881,6107,6290,6495,4513,6496,4692,4515,4723,5100,3356,6497,6291,3810,4080,5561,3570,4430,5980,6498,4355,5697,6499,4724,6108,6109,3764,4050,5038,5879,4093,3226,6292,5068,5217,4693,3342,5630,3504,4831,4377,4466,4309,5698,4431,5777,6293,5778,4272,3706,6110,5326,3752,4676,5327,4273,5403,4767,5631,6500,5699,5880,3475,5039,6294,5562,5125,4348,4301,4482,4068,5126,4593,5700,3380,3462,5981,5563,3824,5404,4970,5511,3825,4738,6295,6501,5452,4516,6111,5881,5564,6502,6296,5982,6503,4213,4163,3454,6504,6112,4009,4450,6113,4658,6297,6114,3035,6505,6115,3995,4904,4739,4563,4942,4110,5040,3661,3928,5362,3674,6506,5292,3612,4791,5565,4149,5983,5328,5259,5021,4725,4577,4564,4517,4364,6298,5405,4578,5260,4594,4156,4157,5453,3592,3491,6507,5127,5512,4709,4922,5984,5701,4726,4289,6508,4015,6116,5128,4628,3424,4241,5779,6299,4905,6509,6510,5454,5702,5780,6300,4365,4923,3971,6511,5161,3270,3158,5985,4100,867,5129,5703,6117,5363,3695,3301,5513,4467,6118,6512,5455,4232,4242,4629,6513,3959,4478,6514,5514,5329,5986,4850,5162,5566,3846,4694,6119,5456,4869,5781,3779,6301,5704,5987,5515,4710,6302,5882,6120,4392,5364,5705,6515,6121,6516,6517,3736,5988,5457,5989,4695,2457,5883,4551,5782,6303,6304,6305,5130,4971,6122,5163,6123,4870,3263,5365,3150,4871,6518,6306,5783,5069,5706,3513,3498,4409,5330,5632,5366,5458,5459,3991,5990,4502,3324,5991,5784,3696,4518,5633,4119,6519,4630,5634,4417,5707,4832,5992,3418,6124,5993,5567,4768,5218,6520,4595,3458,5367,6125,5635,6126,4202,6521,4740,4924,6307,3981,4069,4385,6308,3883,2675,4051,3834,4302,4483,5568,5994,4972,4101,5368,6309,5164,5884,3922,6127,6522,6523,5261,5460,5187,4164,5219,3538,5516,4111,3524,5995,6310,6311,5369,3181,3386,2484,5188,3464,5569,3627,5708,6524,5406,5165,4677,4492,6312,4872,4851,5885,4468,5996,6313,5709,5710,6128,2470,5886,6314,5293,4882,5785,3325,5461,5101,6129,5711,5786,6525,4906,6526,6527,4418,5887,5712,4808,2907,3701,5713,5888,6528,3765,5636,5331,6529,6530,3593,5889,3637,4943,3692,5714,5787,4925,6315,6130,5462,4405,6131,6132,6316,5262,6531,6532,5715,3859,5716,5070,4696,5102,3929,5788,3987,4792,5997,6533,6534,3920,4809,5e3,5998,6535,2974,5370,6317,5189,5263,5717,3826,6536,3953,5001,4883,3190,5463,5890,4973,5999,4741,6133,6134,3607,5570,6e3,4711,3362,3630,4552,5041,6318,6001,2950,2953,5637,4646,5371,4944,6002,2044,4120,3429,6319,6537,5103,4833,6538,6539,4884,4647,3884,6003,6004,4758,3835,5220,5789,4565,5407,6540,6135,5294,4697,4852,6320,6321,3206,4907,6541,6322,4945,6542,6136,6543,6323,6005,4631,3519,6544,5891,6545,5464,3784,5221,6546,5571,4659,6547,6324,6137,5190,6548,3853,6549,4016,4834,3954,6138,5332,3827,4017,3210,3546,4469,5408,5718,3505,4648,5790,5131,5638,5791,5465,4727,4318,6325,6326,5792,4553,4010,4698,3439,4974,3638,4335,3085,6006,5104,5042,5166,5892,5572,6327,4356,4519,5222,5573,5333,5793,5043,6550,5639,5071,4503,6328,6139,6551,6140,3914,3901,5372,6007,5640,4728,4793,3976,3836,4885,6552,4127,6553,4451,4102,5002,6554,3686,5105,6555,5191,5072,5295,4611,5794,5296,6556,5893,5264,5894,4975,5466,5265,4699,4976,4370,4056,3492,5044,4886,6557,5795,4432,4769,4357,5467,3940,4660,4290,6141,4484,4770,4661,3992,6329,4025,4662,5022,4632,4835,4070,5297,4663,4596,5574,5132,5409,5895,6142,4504,5192,4664,5796,5896,3885,5575,5797,5023,4810,5798,3732,5223,4712,5298,4084,5334,5468,6143,4052,4053,4336,4977,4794,6558,5335,4908,5576,5224,4233,5024,4128,5469,5225,4873,6008,5045,4729,4742,4633,3675,4597,6559,5897,5133,5577,5003,5641,5719,6330,6560,3017,2382,3854,4406,4811,6331,4393,3964,4946,6561,2420,3722,6562,4926,4378,3247,1736,4442,6332,5134,6333,5226,3996,2918,5470,4319,4003,4598,4743,4744,4485,3785,3902,5167,5004,5373,4394,5898,6144,4874,1793,3997,6334,4085,4214,5106,5642,4909,5799,6009,4419,4189,3330,5899,4165,4420,5299,5720,5227,3347,6145,4081,6335,2876,3930,6146,3293,3786,3910,3998,5900,5300,5578,2840,6563,5901,5579,6147,3531,5374,6564,6565,5580,4759,5375,6566,6148,3559,5643,6336,6010,5517,6337,6338,5721,5902,3873,6011,6339,6567,5518,3868,3649,5722,6568,4771,4947,6569,6149,4812,6570,2853,5471,6340,6341,5644,4795,6342,6012,5723,6343,5724,6013,4349,6344,3160,6150,5193,4599,4514,4493,5168,4320,6345,4927,3666,4745,5169,5903,5005,4928,6346,5725,6014,4730,4203,5046,4948,3395,5170,6015,4150,6016,5726,5519,6347,5047,3550,6151,6348,4197,4310,5904,6571,5581,2965,6152,4978,3960,4291,5135,6572,5301,5727,4129,4026,5905,4853,5728,5472,6153,6349,4533,2700,4505,5336,4678,3583,5073,2994,4486,3043,4554,5520,6350,6017,5800,4487,6351,3931,4103,5376,6352,4011,4321,4311,4190,5136,6018,3988,3233,4350,5906,5645,4198,6573,5107,3432,4191,3435,5582,6574,4139,5410,6353,5411,3944,5583,5074,3198,6575,6354,4358,6576,5302,4600,5584,5194,5412,6577,6578,5585,5413,5303,4248,5414,3879,4433,6579,4479,5025,4854,5415,6355,4760,4772,3683,2978,4700,3797,4452,3965,3932,3721,4910,5801,6580,5195,3551,5907,3221,3471,3029,6019,3999,5908,5909,5266,5267,3444,3023,3828,3170,4796,5646,4979,4259,6356,5647,5337,3694,6357,5648,5338,4520,4322,5802,3031,3759,4071,6020,5586,4836,4386,5048,6581,3571,4679,4174,4949,6154,4813,3787,3402,3822,3958,3215,3552,5268,4387,3933,4950,4359,6021,5910,5075,3579,6358,4234,4566,5521,6359,3613,5049,6022,5911,3375,3702,3178,4911,5339,4521,6582,6583,4395,3087,3811,5377,6023,6360,6155,4027,5171,5649,4421,4249,2804,6584,2270,6585,4e3,4235,3045,6156,5137,5729,4140,4312,3886,6361,4330,6157,4215,6158,3500,3676,4929,4331,3713,4930,5912,4265,3776,3368,5587,4470,4855,3038,4980,3631,6159,6160,4132,4680,6161,6362,3923,4379,5588,4255,6586,4121,6587,6363,4649,6364,3288,4773,4774,6162,6024,6365,3543,6588,4274,3107,3737,5050,5803,4797,4522,5589,5051,5730,3714,4887,5378,4001,4523,6163,5026,5522,4701,4175,2791,3760,6589,5473,4224,4133,3847,4814,4815,4775,3259,5416,6590,2738,6164,6025,5304,3733,5076,5650,4816,5590,6591,6165,6592,3934,5269,6593,3396,5340,6594,5804,3445,3602,4042,4488,5731,5732,3525,5591,4601,5196,6166,6026,5172,3642,4612,3202,4506,4798,6366,3818,5108,4303,5138,5139,4776,3332,4304,2915,3415,4434,5077,5109,4856,2879,5305,4817,6595,5913,3104,3144,3903,4634,5341,3133,5110,5651,5805,6167,4057,5592,2945,4371,5593,6596,3474,4182,6367,6597,6168,4507,4279,6598,2822,6599,4777,4713,5594,3829,6169,3887,5417,6170,3653,5474,6368,4216,2971,5228,3790,4579,6369,5733,6600,6601,4951,4746,4555,6602,5418,5475,6027,3400,4665,5806,6171,4799,6028,5052,6172,3343,4800,4747,5006,6370,4556,4217,5476,4396,5229,5379,5477,3839,5914,5652,5807,4714,3068,4635,5808,6173,5342,4192,5078,5419,5523,5734,6174,4557,6175,4602,6371,6176,6603,5809,6372,5735,4260,3869,5111,5230,6029,5112,6177,3126,4681,5524,5915,2706,3563,4748,3130,6178,4018,5525,6604,6605,5478,4012,4837,6606,4534,4193,5810,4857,3615,5479,6030,4082,3697,3539,4086,5270,3662,4508,4931,5916,4912,5811,5027,3888,6607,4397,3527,3302,3798,2775,2921,2637,3966,4122,4388,4028,4054,1633,4858,5079,3024,5007,3982,3412,5736,6608,3426,3236,5595,3030,6179,3427,3336,3279,3110,6373,3874,3039,5080,5917,5140,4489,3119,6374,5812,3405,4494,6031,4666,4141,6180,4166,6032,5813,4981,6609,5081,4422,4982,4112,3915,5653,3296,3983,6375,4266,4410,5654,6610,6181,3436,5082,6611,5380,6033,3819,5596,4535,5231,5306,5113,6612,4952,5918,4275,3113,6613,6376,6182,6183,5814,3073,4731,4838,5008,3831,6614,4888,3090,3848,4280,5526,5232,3014,5655,5009,5737,5420,5527,6615,5815,5343,5173,5381,4818,6616,3151,4953,6617,5738,2796,3204,4360,2989,4281,5739,5174,5421,5197,3132,5141,3849,5142,5528,5083,3799,3904,4839,5480,2880,4495,3448,6377,6184,5271,5919,3771,3193,6034,6035,5920,5010,6036,5597,6037,6378,6038,3106,5422,6618,5423,5424,4142,6619,4889,5084,4890,4313,5740,6620,3437,5175,5307,5816,4199,5198,5529,5817,5199,5656,4913,5028,5344,3850,6185,2955,5272,5011,5818,4567,4580,5029,5921,3616,5233,6621,6622,6186,4176,6039,6379,6380,3352,5200,5273,2908,5598,5234,3837,5308,6623,6624,5819,4496,4323,5309,5201,6625,6626,4983,3194,3838,4167,5530,5922,5274,6381,6382,3860,3861,5599,3333,4292,4509,6383,3553,5481,5820,5531,4778,6187,3955,3956,4324,4389,4218,3945,4325,3397,2681,5923,4779,5085,4019,5482,4891,5382,5383,6040,4682,3425,5275,4094,6627,5310,3015,5483,5657,4398,5924,3168,4819,6628,5925,6629,5532,4932,4613,6041,6630,4636,6384,4780,4204,5658,4423,5821,3989,4683,5822,6385,4954,6631,5345,6188,5425,5012,5384,3894,6386,4490,4104,6632,5741,5053,6633,5823,5926,5659,5660,5927,6634,5235,5742,5824,4840,4933,4820,6387,4859,5928,4955,6388,4143,3584,5825,5346,5013,6635,5661,6389,5014,5484,5743,4337,5176,5662,6390,2836,6391,3268,6392,6636,6042,5236,6637,4158,6638,5744,5663,4471,5347,3663,4123,5143,4293,3895,6639,6640,5311,5929,5826,3800,6189,6393,6190,5664,5348,3554,3594,4749,4603,6641,5385,4801,6043,5827,4183,6642,5312,5426,4761,6394,5665,6191,4715,2669,6643,6644,5533,3185,5427,5086,5930,5931,5386,6192,6044,6645,4781,4013,5745,4282,4435,5534,4390,4267,6045,5746,4984,6046,2743,6193,3501,4087,5485,5932,5428,4184,4095,5747,4061,5054,3058,3862,5933,5600,6646,5144,3618,6395,3131,5055,5313,6396,4650,4956,3855,6194,3896,5202,4985,4029,4225,6195,6647,5828,5486,5829,3589,3002,6648,6397,4782,5276,6649,6196,6650,4105,3803,4043,5237,5830,6398,4096,3643,6399,3528,6651,4453,3315,4637,6652,3984,6197,5535,3182,3339,6653,3096,2660,6400,6654,3449,5934,4250,4236,6047,6401,5831,6655,5487,3753,4062,5832,6198,6199,6656,3766,6657,3403,4667,6048,6658,4338,2897,5833,3880,2797,3780,4326,6659,5748,5015,6660,5387,4351,5601,4411,6661,3654,4424,5935,4339,4072,5277,4568,5536,6402,6662,5238,6663,5349,5203,6200,5204,6201,5145,4536,5016,5056,4762,5834,4399,4957,6202,6403,5666,5749,6664,4340,6665,5936,5177,5667,6666,6667,3459,4668,6404,6668,6669,4543,6203,6670,4276,6405,4480,5537,6671,4614,5205,5668,6672,3348,2193,4763,6406,6204,5937,5602,4177,5669,3419,6673,4020,6205,4443,4569,5388,3715,3639,6407,6049,4058,6206,6674,5938,4544,6050,4185,4294,4841,4651,4615,5488,6207,6408,6051,5178,3241,3509,5835,6208,4958,5836,4341,5489,5278,6209,2823,5538,5350,5206,5429,6675,4638,4875,4073,3516,4684,4914,4860,5939,5603,5389,6052,5057,3237,5490,3791,6676,6409,6677,4821,4915,4106,5351,5058,4243,5539,4244,5604,4842,4916,5239,3028,3716,5837,5114,5605,5390,5940,5430,6210,4332,6678,5540,4732,3667,3840,6053,4305,3408,5670,5541,6410,2744,5240,5750,6679,3234,5606,6680,5607,5671,3608,4283,4159,4400,5352,4783,6681,6411,6682,4491,4802,6211,6412,5941,6413,6414,5542,5751,6683,4669,3734,5942,6684,6415,5943,5059,3328,4670,4144,4268,6685,6686,6687,6688,4372,3603,6689,5944,5491,4373,3440,6416,5543,4784,4822,5608,3792,4616,5838,5672,3514,5391,6417,4892,6690,4639,6691,6054,5673,5839,6055,6692,6056,5392,6212,4038,5544,5674,4497,6057,6693,5840,4284,5675,4021,4545,5609,6418,4454,6419,6213,4113,4472,5314,3738,5087,5279,4074,5610,4959,4063,3179,4750,6058,6420,6214,3476,4498,4716,5431,4960,4685,6215,5241,6694,6421,6216,6695,5841,5945,6422,3748,5946,5179,3905,5752,5545,5947,4374,6217,4455,6423,4412,6218,4803,5353,6696,3832,5280,6219,4327,4702,6220,6221,6059,4652,5432,6424,3749,4751,6425,5753,4986,5393,4917,5948,5030,5754,4861,4733,6426,4703,6697,6222,4671,5949,4546,4961,5180,6223,5031,3316,5281,6698,4862,4295,4934,5207,3644,6427,5842,5950,6428,6429,4570,5843,5282,6430,6224,5088,3239,6060,6699,5844,5755,6061,6431,2701,5546,6432,5115,5676,4039,3993,3327,4752,4425,5315,6433,3941,6434,5677,4617,4604,3074,4581,6225,5433,6435,6226,6062,4823,5756,5116,6227,3717,5678,4717,5845,6436,5679,5846,6063,5847,6064,3977,3354,6437,3863,5117,6228,5547,5394,4499,4524,6229,4605,6230,4306,4500,6700,5951,6065,3693,5952,5089,4366,4918,6701,6231,5548,6232,6702,6438,4704,5434,6703,6704,5953,4168,6705,5680,3420,6706,5242,4407,6066,3812,5757,5090,5954,4672,4525,3481,5681,4618,5395,5354,5316,5955,6439,4962,6707,4526,6440,3465,4673,6067,6441,5682,6708,5435,5492,5758,5683,4619,4571,4674,4804,4893,4686,5493,4753,6233,6068,4269,6442,6234,5032,4705,5146,5243,5208,5848,6235,6443,4963,5033,4640,4226,6236,5849,3387,6444,6445,4436,4437,5850,4843,5494,4785,4894,6709,4361,6710,5091,5956,3331,6237,4987,5549,6069,6711,4342,3517,4473,5317,6070,6712,6071,4706,6446,5017,5355,6713,6714,4988,5436,6447,4734,5759,6715,4735,4547,4456,4754,6448,5851,6449,6450,3547,5852,5318,6451,6452,5092,4205,6716,6238,4620,4219,5611,6239,6072,4481,5760,5957,5958,4059,6240,6453,4227,4537,6241,5761,4030,4186,5244,5209,3761,4457,4876,3337,5495,5181,6242,5959,5319,5612,5684,5853,3493,5854,6073,4169,5613,5147,4895,6074,5210,6717,5182,6718,3830,6243,2798,3841,6075,6244,5855,5614,3604,4606,5496,5685,5118,5356,6719,6454,5960,5357,5961,6720,4145,3935,4621,5119,5962,4261,6721,6455,4786,5963,4375,4582,6245,6246,6247,6076,5437,4877,5856,3376,4380,6248,4160,6722,5148,6456,5211,6457,6723,4718,6458,6724,6249,5358,4044,3297,6459,6250,5857,5615,5497,5245,6460,5498,6725,6251,6252,5550,3793,5499,2959,5396,6461,6462,4572,5093,5500,5964,3806,4146,6463,4426,5762,5858,6077,6253,4755,3967,4220,5965,6254,4989,5501,6464,4352,6726,6078,4764,2290,5246,3906,5438,5283,3767,4964,2861,5763,5094,6255,6256,4622,5616,5859,5860,4707,6727,4285,4708,4824,5617,6257,5551,4787,5212,4965,4935,4687,6465,6728,6466,5686,6079,3494,4413,2995,5247,5966,5618,6729,5967,5764,5765,5687,5502,6730,6731,6080,5397,6467,4990,6258,6732,4538,5060,5619,6733,4719,5688,5439,5018,5149,5284,5503,6734,6081,4607,6259,5120,3645,5861,4583,6260,4584,4675,5620,4098,5440,6261,4863,2379,3306,4585,5552,5689,4586,5285,6735,4864,6736,5286,6082,6737,4623,3010,4788,4381,4558,5621,4587,4896,3698,3161,5248,4353,4045,6262,3754,5183,4588,6738,6263,6739,6740,5622,3936,6741,6468,6742,6264,5095,6469,4991,5968,6743,4992,6744,6083,4897,6745,4256,5766,4307,3108,3968,4444,5287,3889,4343,6084,4510,6085,4559,6086,4898,5969,6746,5623,5061,4919,5249,5250,5504,5441,6265,5320,4878,3242,5862,5251,3428,6087,6747,4237,5624,5442,6266,5553,4539,6748,2585,3533,5398,4262,6088,5150,4736,4438,6089,6267,5505,4966,6749,6268,6750,6269,5288,5554,3650,6090,6091,4624,6092,5690,6751,5863,4270,5691,4277,5555,5864,6752,5692,4720,4865,6470,5151,4688,4825,6753,3094,6754,6471,3235,4653,6755,5213,5399,6756,3201,4589,5865,4967,6472,5866,6473,5019,3016,6757,5321,4756,3957,4573,6093,4993,5767,4721,6474,6758,5625,6759,4458,6475,6270,6760,5556,4994,5214,5252,6271,3875,5768,6094,5034,5506,4376,5769,6761,2120,6476,5253,5770,6762,5771,5970,3990,5971,5557,5558,5772,6477,6095,2787,4641,5972,5121,6096,6097,6272,6763,3703,5867,5507,6273,4206,6274,4789,6098,6764,3619,3646,3833,3804,2394,3788,4936,3978,4866,4899,6099,6100,5559,6478,6765,3599,5868,6101,5869,5870,6275,6766,4527,6767]},function(e,t){t.BIG5_TYPICAL_DISTRIBUTION_RATIO=.75,t.BIG5_TABLE_SIZE=5376,t.Big5CharToFreqOrder=[1,1801,1506,255,1431,198,9,82,6,5008,177,202,3681,1256,2821,110,3814,33,3274,261,76,44,2114,16,2946,2187,1176,659,3971,26,3451,2653,1198,3972,3350,4202,410,2215,302,590,361,1964,8,204,58,4510,5009,1932,63,5010,5011,317,1614,75,222,159,4203,2417,1480,5012,3555,3091,224,2822,3682,3,10,3973,1471,29,2787,1135,2866,1940,873,130,3275,1123,312,5013,4511,2052,507,252,682,5014,142,1915,124,206,2947,34,3556,3204,64,604,5015,2501,1977,1978,155,1991,645,641,1606,5016,3452,337,72,406,5017,80,630,238,3205,1509,263,939,1092,2654,756,1440,1094,3453,449,69,2987,591,179,2096,471,115,2035,1844,60,50,2988,134,806,1869,734,2036,3454,180,995,1607,156,537,2907,688,5018,319,1305,779,2145,514,2379,298,4512,359,2502,90,2716,1338,663,11,906,1099,2553,20,2441,182,532,1716,5019,732,1376,4204,1311,1420,3206,25,2317,1056,113,399,382,1950,242,3455,2474,529,3276,475,1447,3683,5020,117,21,656,810,1297,2300,2334,3557,5021,126,4205,706,456,150,613,4513,71,1118,2037,4206,145,3092,85,835,486,2115,1246,1426,428,727,1285,1015,800,106,623,303,1281,5022,2128,2359,347,3815,221,3558,3135,5023,1956,1153,4207,83,296,1199,3093,192,624,93,5024,822,1898,2823,3136,795,2065,991,1554,1542,1592,27,43,2867,859,139,1456,860,4514,437,712,3974,164,2397,3137,695,211,3037,2097,195,3975,1608,3559,3560,3684,3976,234,811,2989,2098,3977,2233,1441,3561,1615,2380,668,2077,1638,305,228,1664,4515,467,415,5025,262,2099,1593,239,108,300,200,1033,512,1247,2078,5026,5027,2176,3207,3685,2682,593,845,1062,3277,88,1723,2038,3978,1951,212,266,152,149,468,1899,4208,4516,77,187,5028,3038,37,5,2990,5029,3979,5030,5031,39,2524,4517,2908,3208,2079,55,148,74,4518,545,483,1474,1029,1665,217,1870,1531,3138,1104,2655,4209,24,172,3562,900,3980,3563,3564,4519,32,1408,2824,1312,329,487,2360,2251,2717,784,2683,4,3039,3351,1427,1789,188,109,499,5032,3686,1717,1790,888,1217,3040,4520,5033,3565,5034,3352,1520,3687,3981,196,1034,775,5035,5036,929,1816,249,439,38,5037,1063,5038,794,3982,1435,2301,46,178,3278,2066,5039,2381,5040,214,1709,4521,804,35,707,324,3688,1601,2554,140,459,4210,5041,5042,1365,839,272,978,2262,2580,3456,2129,1363,3689,1423,697,100,3094,48,70,1231,495,3139,2196,5043,1294,5044,2080,462,586,1042,3279,853,256,988,185,2382,3457,1698,434,1084,5045,3458,314,2625,2788,4522,2335,2336,569,2285,637,1817,2525,757,1162,1879,1616,3459,287,1577,2116,768,4523,1671,2868,3566,2526,1321,3816,909,2418,5046,4211,933,3817,4212,2053,2361,1222,4524,765,2419,1322,786,4525,5047,1920,1462,1677,2909,1699,5048,4526,1424,2442,3140,3690,2600,3353,1775,1941,3460,3983,4213,309,1369,1130,2825,364,2234,1653,1299,3984,3567,3985,3986,2656,525,1085,3041,902,2001,1475,964,4527,421,1845,1415,1057,2286,940,1364,3141,376,4528,4529,1381,7,2527,983,2383,336,1710,2684,1846,321,3461,559,1131,3042,2752,1809,1132,1313,265,1481,1858,5049,352,1203,2826,3280,167,1089,420,2827,776,792,1724,3568,4214,2443,3281,5050,4215,5051,446,229,333,2753,901,3818,1200,1557,4530,2657,1921,395,2754,2685,3819,4216,1836,125,916,3209,2626,4531,5052,5053,3820,5054,5055,5056,4532,3142,3691,1133,2555,1757,3462,1510,2318,1409,3569,5057,2146,438,2601,2910,2384,3354,1068,958,3043,461,311,2869,2686,4217,1916,3210,4218,1979,383,750,2755,2627,4219,274,539,385,1278,1442,5058,1154,1965,384,561,210,98,1295,2556,3570,5059,1711,2420,1482,3463,3987,2911,1257,129,5060,3821,642,523,2789,2790,2658,5061,141,2235,1333,68,176,441,876,907,4220,603,2602,710,171,3464,404,549,18,3143,2398,1410,3692,1666,5062,3571,4533,2912,4534,5063,2991,368,5064,146,366,99,871,3693,1543,748,807,1586,1185,22,2263,379,3822,3211,5065,3212,505,1942,2628,1992,1382,2319,5066,380,2362,218,702,1818,1248,3465,3044,3572,3355,3282,5067,2992,3694,930,3283,3823,5068,59,5069,585,601,4221,497,3466,1112,1314,4535,1802,5070,1223,1472,2177,5071,749,1837,690,1900,3824,1773,3988,1476,429,1043,1791,2236,2117,917,4222,447,1086,1629,5072,556,5073,5074,2021,1654,844,1090,105,550,966,1758,2828,1008,1783,686,1095,5075,2287,793,1602,5076,3573,2603,4536,4223,2948,2302,4537,3825,980,2503,544,353,527,4538,908,2687,2913,5077,381,2629,1943,1348,5078,1341,1252,560,3095,5079,3467,2870,5080,2054,973,886,2081,143,4539,5081,5082,157,3989,496,4224,57,840,540,2039,4540,4541,3468,2118,1445,970,2264,1748,1966,2082,4225,3144,1234,1776,3284,2829,3695,773,1206,2130,1066,2040,1326,3990,1738,1725,4226,279,3145,51,1544,2604,423,1578,2131,2067,173,4542,1880,5083,5084,1583,264,610,3696,4543,2444,280,154,5085,5086,5087,1739,338,1282,3096,693,2871,1411,1074,3826,2445,5088,4544,5089,5090,1240,952,2399,5091,2914,1538,2688,685,1483,4227,2475,1436,953,4228,2055,4545,671,2400,79,4229,2446,3285,608,567,2689,3469,4230,4231,1691,393,1261,1792,2401,5092,4546,5093,5094,5095,5096,1383,1672,3827,3213,1464,522,1119,661,1150,216,675,4547,3991,1432,3574,609,4548,2690,2402,5097,5098,5099,4232,3045,0,5100,2476,315,231,2447,301,3356,4549,2385,5101,233,4233,3697,1819,4550,4551,5102,96,1777,1315,2083,5103,257,5104,1810,3698,2718,1139,1820,4234,2022,1124,2164,2791,1778,2659,5105,3097,363,1655,3214,5106,2993,5107,5108,5109,3992,1567,3993,718,103,3215,849,1443,341,3357,2949,1484,5110,1712,127,67,339,4235,2403,679,1412,821,5111,5112,834,738,351,2994,2147,846,235,1497,1881,418,1993,3828,2719,186,1100,2148,2756,3575,1545,1355,2950,2872,1377,583,3994,4236,2581,2995,5113,1298,3699,1078,2557,3700,2363,78,3829,3830,267,1289,2100,2002,1594,4237,348,369,1274,2197,2178,1838,4552,1821,2830,3701,2757,2288,2003,4553,2951,2758,144,3358,882,4554,3995,2759,3470,4555,2915,5114,4238,1726,320,5115,3996,3046,788,2996,5116,2831,1774,1327,2873,3997,2832,5117,1306,4556,2004,1700,3831,3576,2364,2660,787,2023,506,824,3702,534,323,4557,1044,3359,2024,1901,946,3471,5118,1779,1500,1678,5119,1882,4558,165,243,4559,3703,2528,123,683,4239,764,4560,36,3998,1793,589,2916,816,626,1667,3047,2237,1639,1555,1622,3832,3999,5120,4e3,2874,1370,1228,1933,891,2084,2917,304,4240,5121,292,2997,2720,3577,691,2101,4241,1115,4561,118,662,5122,611,1156,854,2386,1316,2875,2,386,515,2918,5123,5124,3286,868,2238,1486,855,2661,785,2216,3048,5125,1040,3216,3578,5126,3146,448,5127,1525,5128,2165,4562,5129,3833,5130,4242,2833,3579,3147,503,818,4001,3148,1568,814,676,1444,306,1749,5131,3834,1416,1030,197,1428,805,2834,1501,4563,5132,5133,5134,1994,5135,4564,5136,5137,2198,13,2792,3704,2998,3149,1229,1917,5138,3835,2132,5139,4243,4565,2404,3580,5140,2217,1511,1727,1120,5141,5142,646,3836,2448,307,5143,5144,1595,3217,5145,5146,5147,3705,1113,1356,4002,1465,2529,2530,5148,519,5149,128,2133,92,2289,1980,5150,4003,1512,342,3150,2199,5151,2793,2218,1981,3360,4244,290,1656,1317,789,827,2365,5152,3837,4566,562,581,4004,5153,401,4567,2252,94,4568,5154,1399,2794,5155,1463,2025,4569,3218,1944,5156,828,1105,4245,1262,1394,5157,4246,605,4570,5158,1784,2876,5159,2835,819,2102,578,2200,2952,5160,1502,436,3287,4247,3288,2836,4005,2919,3472,3473,5161,2721,2320,5162,5163,2337,2068,23,4571,193,826,3838,2103,699,1630,4248,3098,390,1794,1064,3581,5164,1579,3099,3100,1400,5165,4249,1839,1640,2877,5166,4572,4573,137,4250,598,3101,1967,780,104,974,2953,5167,278,899,253,402,572,504,493,1339,5168,4006,1275,4574,2582,2558,5169,3706,3049,3102,2253,565,1334,2722,863,41,5170,5171,4575,5172,1657,2338,19,463,2760,4251,606,5173,2999,3289,1087,2085,1323,2662,3e3,5174,1631,1623,1750,4252,2691,5175,2878,791,2723,2663,2339,232,2421,5176,3001,1498,5177,2664,2630,755,1366,3707,3290,3151,2026,1609,119,1918,3474,862,1026,4253,5178,4007,3839,4576,4008,4577,2265,1952,2477,5179,1125,817,4254,4255,4009,1513,1766,2041,1487,4256,3050,3291,2837,3840,3152,5180,5181,1507,5182,2692,733,40,1632,1106,2879,345,4257,841,2531,230,4578,3002,1847,3292,3475,5183,1263,986,3476,5184,735,879,254,1137,857,622,1300,1180,1388,1562,4010,4011,2954,967,2761,2665,1349,592,2134,1692,3361,3003,1995,4258,1679,4012,1902,2188,5185,739,3708,2724,1296,1290,5186,4259,2201,2202,1922,1563,2605,2559,1871,2762,3004,5187,435,5188,343,1108,596,17,1751,4579,2239,3477,3709,5189,4580,294,3582,2955,1693,477,979,281,2042,3583,643,2043,3710,2631,2795,2266,1031,2340,2135,2303,3584,4581,367,1249,2560,5190,3585,5191,4582,1283,3362,2005,240,1762,3363,4583,4584,836,1069,3153,474,5192,2149,2532,268,3586,5193,3219,1521,1284,5194,1658,1546,4260,5195,3587,3588,5196,4261,3364,2693,1685,4262,961,1673,2632,190,2006,2203,3841,4585,4586,5197,570,2504,3711,1490,5198,4587,2633,3293,1957,4588,584,1514,396,1045,1945,5199,4589,1968,2449,5200,5201,4590,4013,619,5202,3154,3294,215,2007,2796,2561,3220,4591,3221,4592,763,4263,3842,4593,5203,5204,1958,1767,2956,3365,3712,1174,452,1477,4594,3366,3155,5205,2838,1253,2387,2189,1091,2290,4264,492,5206,638,1169,1825,2136,1752,4014,648,926,1021,1324,4595,520,4596,997,847,1007,892,4597,3843,2267,1872,3713,2405,1785,4598,1953,2957,3103,3222,1728,4265,2044,3714,4599,2008,1701,3156,1551,30,2268,4266,5207,2027,4600,3589,5208,501,5209,4267,594,3478,2166,1822,3590,3479,3591,3223,829,2839,4268,5210,1680,3157,1225,4269,5211,3295,4601,4270,3158,2341,5212,4602,4271,5213,4015,4016,5214,1848,2388,2606,3367,5215,4603,374,4017,652,4272,4273,375,1140,798,5216,5217,5218,2366,4604,2269,546,1659,138,3051,2450,4605,5219,2254,612,1849,910,796,3844,1740,1371,825,3845,3846,5220,2920,2562,5221,692,444,3052,2634,801,4606,4274,5222,1491,244,1053,3053,4275,4276,340,5223,4018,1041,3005,293,1168,87,1357,5224,1539,959,5225,2240,721,694,4277,3847,219,1478,644,1417,3368,2666,1413,1401,1335,1389,4019,5226,5227,3006,2367,3159,1826,730,1515,184,2840,66,4607,5228,1660,2958,246,3369,378,1457,226,3480,975,4020,2959,1264,3592,674,696,5229,163,5230,1141,2422,2167,713,3593,3370,4608,4021,5231,5232,1186,15,5233,1079,1070,5234,1522,3224,3594,276,1050,2725,758,1126,653,2960,3296,5235,2342,889,3595,4022,3104,3007,903,1250,4609,4023,3481,3596,1342,1681,1718,766,3297,286,89,2961,3715,5236,1713,5237,2607,3371,3008,5238,2962,2219,3225,2880,5239,4610,2505,2533,181,387,1075,4024,731,2190,3372,5240,3298,310,313,3482,2304,770,4278,54,3054,189,4611,3105,3848,4025,5241,1230,1617,1850,355,3597,4279,4612,3373,111,4280,3716,1350,3160,3483,3055,4281,2150,3299,3598,5242,2797,4026,4027,3009,722,2009,5243,1071,247,1207,2343,2478,1378,4613,2010,864,1437,1214,4614,373,3849,1142,2220,667,4615,442,2763,2563,3850,4028,1969,4282,3300,1840,837,170,1107,934,1336,1883,5244,5245,2119,4283,2841,743,1569,5246,4616,4284,582,2389,1418,3484,5247,1803,5248,357,1395,1729,3717,3301,2423,1564,2241,5249,3106,3851,1633,4617,1114,2086,4285,1532,5250,482,2451,4618,5251,5252,1492,833,1466,5253,2726,3599,1641,2842,5254,1526,1272,3718,4286,1686,1795,416,2564,1903,1954,1804,5255,3852,2798,3853,1159,2321,5256,2881,4619,1610,1584,3056,2424,2764,443,3302,1163,3161,5257,5258,4029,5259,4287,2506,3057,4620,4030,3162,2104,1647,3600,2011,1873,4288,5260,4289,431,3485,5261,250,97,81,4290,5262,1648,1851,1558,160,848,5263,866,740,1694,5264,2204,2843,3226,4291,4621,3719,1687,950,2479,426,469,3227,3720,3721,4031,5265,5266,1188,424,1996,861,3601,4292,3854,2205,2694,168,1235,3602,4293,5267,2087,1674,4622,3374,3303,220,2565,1009,5268,3855,670,3010,332,1208,717,5269,5270,3603,2452,4032,3375,5271,513,5272,1209,2882,3376,3163,4623,1080,5273,5274,5275,5276,2534,3722,3604,815,1587,4033,4034,5277,3605,3486,3856,1254,4624,1328,3058,1390,4035,1741,4036,3857,4037,5278,236,3858,2453,3304,5279,5280,3723,3859,1273,3860,4625,5281,308,5282,4626,245,4627,1852,2480,1307,2583,430,715,2137,2454,5283,270,199,2883,4038,5284,3606,2727,1753,761,1754,725,1661,1841,4628,3487,3724,5285,5286,587,14,3305,227,2608,326,480,2270,943,2765,3607,291,650,1884,5287,1702,1226,102,1547,62,3488,904,4629,3489,1164,4294,5288,5289,1224,1548,2766,391,498,1493,5290,1386,1419,5291,2056,1177,4630,813,880,1081,2368,566,1145,4631,2291,1001,1035,2566,2609,2242,394,1286,5292,5293,2069,5294,86,1494,1730,4039,491,1588,745,897,2963,843,3377,4040,2767,2884,3306,1768,998,2221,2070,397,1827,1195,1970,3725,3011,3378,284,5295,3861,2507,2138,2120,1904,5296,4041,2151,4042,4295,1036,3490,1905,114,2567,4296,209,1527,5297,5298,2964,2844,2635,2390,2728,3164,812,2568,5299,3307,5300,1559,737,1885,3726,1210,885,28,2695,3608,3862,5301,4297,1004,1780,4632,5302,346,1982,2222,2696,4633,3863,1742,797,1642,4043,1934,1072,1384,2152,896,4044,3308,3727,3228,2885,3609,5303,2569,1959,4634,2455,1786,5304,5305,5306,4045,4298,1005,1308,3728,4299,2729,4635,4636,1528,2610,161,1178,4300,1983,987,4637,1101,4301,631,4046,1157,3229,2425,1343,1241,1016,2243,2570,372,877,2344,2508,1160,555,1935,911,4047,5307,466,1170,169,1051,2921,2697,3729,2481,3012,1182,2012,2571,1251,2636,5308,992,2345,3491,1540,2730,1201,2071,2406,1997,2482,5309,4638,528,1923,2191,1503,1874,1570,2369,3379,3309,5310,557,1073,5311,1828,3492,2088,2271,3165,3059,3107,767,3108,2799,4639,1006,4302,4640,2346,1267,2179,3730,3230,778,4048,3231,2731,1597,2667,5312,4641,5313,3493,5314,5315,5316,3310,2698,1433,3311,131,95,1504,4049,723,4303,3166,1842,3610,2768,2192,4050,2028,2105,3731,5317,3013,4051,1218,5318,3380,3232,4052,4304,2584,248,1634,3864,912,5319,2845,3732,3060,3865,654,53,5320,3014,5321,1688,4642,777,3494,1032,4053,1425,5322,191,820,2121,2846,971,4643,931,3233,135,664,783,3866,1998,772,2922,1936,4054,3867,4644,2923,3234,282,2732,640,1372,3495,1127,922,325,3381,5323,5324,711,2045,5325,5326,4055,2223,2800,1937,4056,3382,2224,2255,3868,2305,5327,4645,3869,1258,3312,4057,3235,2139,2965,4058,4059,5328,2225,258,3236,4646,101,1227,5329,3313,1755,5330,1391,3314,5331,2924,2057,893,5332,5333,5334,1402,4305,2347,5335,5336,3237,3611,5337,5338,878,1325,1781,2801,4647,259,1385,2585,744,1183,2272,4648,5339,4060,2509,5340,684,1024,4306,5341,472,3612,3496,1165,3315,4061,4062,322,2153,881,455,1695,1152,1340,660,554,2154,4649,1058,4650,4307,830,1065,3383,4063,4651,1924,5342,1703,1919,5343,932,2273,122,5344,4652,947,677,5345,3870,2637,297,1906,1925,2274,4653,2322,3316,5346,5347,4308,5348,4309,84,4310,112,989,5349,547,1059,4064,701,3613,1019,5350,4311,5351,3497,942,639,457,2306,2456,993,2966,407,851,494,4654,3384,927,5352,1237,5353,2426,3385,573,4312,680,921,2925,1279,1875,285,790,1448,1984,719,2168,5354,5355,4655,4065,4066,1649,5356,1541,563,5357,1077,5358,3386,3061,3498,511,3015,4067,4068,3733,4069,1268,2572,3387,3238,4656,4657,5359,535,1048,1276,1189,2926,2029,3167,1438,1373,2847,2967,1134,2013,5360,4313,1238,2586,3109,1259,5361,700,5362,2968,3168,3734,4314,5363,4315,1146,1876,1907,4658,2611,4070,781,2427,132,1589,203,147,273,2802,2407,898,1787,2155,4071,4072,5364,3871,2803,5365,5366,4659,4660,5367,3239,5368,1635,3872,965,5369,1805,2699,1516,3614,1121,1082,1329,3317,4073,1449,3873,65,1128,2848,2927,2769,1590,3874,5370,5371,12,2668,45,976,2587,3169,4661,517,2535,1013,1037,3240,5372,3875,2849,5373,3876,5374,3499,5375,2612,614,1999,2323,3877,3110,2733,2638,5376,2588,4316,599,1269,5377,1811,3735,5378,2700,3111,759,1060,489,1806,3388,3318,1358,5379,5380,2391,1387,1215,2639,2256,490,5381,5382,4317,1759,2392,2348,5383,4662,3878,1908,4074,2640,1807,3241,4663,3500,3319,2770,2349,874,5384,5385,3501,3736,1859,91,2928,3737,3062,3879,4664,5386,3170,4075,2669,5387,3502,1202,1403,3880,2969,2536,1517,2510,4665,3503,2511,5388,4666,5389,2701,1886,1495,1731,4076,2370,4667,5390,2030,5391,5392,4077,2702,1216,237,2589,4318,2324,4078,3881,4668,4669,2703,3615,3504,445,4670,5393,5394,5395,5396,2771,61,4079,3738,1823,4080,5397,687,2046,935,925,405,2670,703,1096,1860,2734,4671,4081,1877,1367,2704,3389,918,2106,1782,2483,334,3320,1611,1093,4672,564,3171,3505,3739,3390,945,2641,2058,4673,5398,1926,872,4319,5399,3506,2705,3112,349,4320,3740,4082,4674,3882,4321,3741,2156,4083,4675,4676,4322,4677,2408,2047,782,4084,400,251,4323,1624,5400,5401,277,3742,299,1265,476,1191,3883,2122,4324,4325,1109,205,5402,2590,1e3,2157,3616,1861,5403,5404,5405,4678,5406,4679,2573,107,2484,2158,4085,3507,3172,5407,1533,541,1301,158,753,4326,2886,3617,5408,1696,370,1088,4327,4680,3618,579,327,440,162,2244,269,1938,1374,3508,968,3063,56,1396,3113,2107,3321,3391,5409,1927,2159,4681,3016,5410,3619,5411,5412,3743,4682,2485,5413,2804,5414,1650,4683,5415,2613,5416,5417,4086,2671,3392,1149,3393,4087,3884,4088,5418,1076,49,5419,951,3242,3322,3323,450,2850,920,5420,1812,2805,2371,4328,1909,1138,2372,3885,3509,5421,3243,4684,1910,1147,1518,2428,4685,3886,5422,4686,2393,2614,260,1796,3244,5423,5424,3887,3324,708,5425,3620,1704,5426,3621,1351,1618,3394,3017,1887,944,4329,3395,4330,3064,3396,4331,5427,3744,422,413,1714,3325,500,2059,2350,4332,2486,5428,1344,1911,954,5429,1668,5430,5431,4089,2409,4333,3622,3888,4334,5432,2307,1318,2512,3114,133,3115,2887,4687,629,31,2851,2706,3889,4688,850,949,4689,4090,2970,1732,2089,4335,1496,1853,5433,4091,620,3245,981,1242,3745,3397,1619,3746,1643,3326,2140,2457,1971,1719,3510,2169,5434,3246,5435,5436,3398,1829,5437,1277,4690,1565,2048,5438,1636,3623,3116,5439,869,2852,655,3890,3891,3117,4092,3018,3892,1310,3624,4691,5440,5441,5442,1733,558,4692,3747,335,1549,3065,1756,4336,3748,1946,3511,1830,1291,1192,470,2735,2108,2806,913,1054,4093,5443,1027,5444,3066,4094,4693,982,2672,3399,3173,3512,3247,3248,1947,2807,5445,571,4694,5446,1831,5447,3625,2591,1523,2429,5448,2090,984,4695,3749,1960,5449,3750,852,923,2808,3513,3751,969,1519,999,2049,2325,1705,5450,3118,615,1662,151,597,4095,2410,2326,1049,275,4696,3752,4337,568,3753,3626,2487,4338,3754,5451,2430,2275,409,3249,5452,1566,2888,3514,1002,769,2853,194,2091,3174,3755,2226,3327,4339,628,1505,5453,5454,1763,2180,3019,4096,521,1161,2592,1788,2206,2411,4697,4097,1625,4340,4341,412,42,3119,464,5455,2642,4698,3400,1760,1571,2889,3515,2537,1219,2207,3893,2643,2141,2373,4699,4700,3328,1651,3401,3627,5456,5457,3628,2488,3516,5458,3756,5459,5460,2276,2092,460,5461,4701,5462,3020,962,588,3629,289,3250,2644,1116,52,5463,3067,1797,5464,5465,5466,1467,5467,1598,1143,3757,4342,1985,1734,1067,4702,1280,3402,465,4703,1572,510,5468,1928,2245,1813,1644,3630,5469,4704,3758,5470,5471,2673,1573,1534,5472,5473,536,1808,1761,3517,3894,3175,2645,5474,5475,5476,4705,3518,2929,1912,2809,5477,3329,1122,377,3251,5478,360,5479,5480,4343,1529,551,5481,2060,3759,1769,2431,5482,2930,4344,3330,3120,2327,2109,2031,4706,1404,136,1468,1479,672,1171,3252,2308,271,3176,5483,2772,5484,2050,678,2736,865,1948,4707,5485,2014,4098,2971,5486,2737,2227,1397,3068,3760,4708,4709,1735,2931,3403,3631,5487,3895,509,2854,2458,2890,3896,5488,5489,3177,3178,4710,4345,2538,4711,2309,1166,1010,552,681,1888,5490,5491,2972,2973,4099,1287,1596,1862,3179,358,453,736,175,478,1117,905,1167,1097,5492,1854,1530,5493,1706,5494,2181,3519,2292,3761,3520,3632,4346,2093,4347,5495,3404,1193,2489,4348,1458,2193,2208,1863,1889,1421,3331,2932,3069,2182,3521,595,2123,5496,4100,5497,5498,4349,1707,2646,223,3762,1359,751,3121,183,3522,5499,2810,3021,419,2374,633,704,3897,2394,241,5500,5501,5502,838,3022,3763,2277,2773,2459,3898,1939,2051,4101,1309,3122,2246,1181,5503,1136,2209,3899,2375,1446,4350,2310,4712,5504,5505,4351,1055,2615,484,3764,5506,4102,625,4352,2278,3405,1499,4353,4103,5507,4104,4354,3253,2279,2280,3523,5508,5509,2774,808,2616,3765,3406,4105,4355,3123,2539,526,3407,3900,4356,955,5510,1620,4357,2647,2432,5511,1429,3766,1669,1832,994,928,5512,3633,1260,5513,5514,5515,1949,2293,741,2933,1626,4358,2738,2460,867,1184,362,3408,1392,5516,5517,4106,4359,1770,1736,3254,2934,4713,4714,1929,2707,1459,1158,5518,3070,3409,2891,1292,1930,2513,2855,3767,1986,1187,2072,2015,2617,4360,5519,2574,2514,2170,3768,2490,3332,5520,3769,4715,5521,5522,666,1003,3023,1022,3634,4361,5523,4716,1814,2257,574,3901,1603,295,1535,705,3902,4362,283,858,417,5524,5525,3255,4717,4718,3071,1220,1890,1046,2281,2461,4107,1393,1599,689,2575,388,4363,5526,2491,802,5527,2811,3903,2061,1405,2258,5528,4719,3904,2110,1052,1345,3256,1585,5529,809,5530,5531,5532,575,2739,3524,956,1552,1469,1144,2328,5533,2329,1560,2462,3635,3257,4108,616,2210,4364,3180,2183,2294,5534,1833,5535,3525,4720,5536,1319,3770,3771,1211,3636,1023,3258,1293,2812,5537,5538,5539,3905,607,2311,3906,762,2892,1439,4365,1360,4721,1485,3072,5540,4722,1038,4366,1450,2062,2648,4367,1379,4723,2593,5541,5542,4368,1352,1414,2330,2935,1172,5543,5544,3907,3908,4724,1798,1451,5545,5546,5547,5548,2936,4109,4110,2492,2351,411,4111,4112,3637,3333,3124,4725,1561,2674,1452,4113,1375,5549,5550,47,2974,316,5551,1406,1591,2937,3181,5552,1025,2142,3125,3182,354,2740,884,2228,4369,2412,508,3772,726,3638,996,2433,3639,729,5553,392,2194,1453,4114,4726,3773,5554,5555,2463,3640,2618,1675,2813,919,2352,2975,2353,1270,4727,4115,73,5556,5557,647,5558,3259,2856,2259,1550,1346,3024,5559,1332,883,3526,5560,5561,5562,5563,3334,2775,5564,1212,831,1347,4370,4728,2331,3909,1864,3073,720,3910,4729,4730,3911,5565,4371,5566,5567,4731,5568,5569,1799,4732,3774,2619,4733,3641,1645,2376,4734,5570,2938,669,2211,2675,2434,5571,2893,5572,5573,1028,3260,5574,4372,2413,5575,2260,1353,5576,5577,4735,3183,518,5578,4116,5579,4373,1961,5580,2143,4374,5581,5582,3025,2354,2355,3912,516,1834,1454,4117,2708,4375,4736,2229,2620,1972,1129,3642,5583,2776,5584,2976,1422,577,1470,3026,1524,3410,5585,5586,432,4376,3074,3527,5587,2594,1455,2515,2230,1973,1175,5588,1020,2741,4118,3528,4737,5589,2742,5590,1743,1361,3075,3529,2649,4119,4377,4738,2295,895,924,4378,2171,331,2247,3076,166,1627,3077,1098,5591,1232,2894,2231,3411,4739,657,403,1196,2377,542,3775,3412,1600,4379,3530,5592,4740,2777,3261,576,530,1362,4741,4742,2540,2676,3776,4120,5593,842,3913,5594,2814,2032,1014,4121,213,2709,3413,665,621,4380,5595,3777,2939,2435,5596,2436,3335,3643,3414,4743,4381,2541,4382,4744,3644,1682,4383,3531,1380,5597,724,2282,600,1670,5598,1337,1233,4745,3126,2248,5599,1621,4746,5600,651,4384,5601,1612,4385,2621,5602,2857,5603,2743,2312,3078,5604,716,2464,3079,174,1255,2710,4122,3645,548,1320,1398,728,4123,1574,5605,1891,1197,3080,4124,5606,3081,3082,3778,3646,3779,747,5607,635,4386,4747,5608,5609,5610,4387,5611,5612,4748,5613,3415,4749,2437,451,5614,3780,2542,2073,4388,2744,4389,4125,5615,1764,4750,5616,4390,350,4751,2283,2395,2493,5617,4391,4126,2249,1434,4127,488,4752,458,4392,4128,3781,771,1330,2396,3914,2576,3184,2160,2414,1553,2677,3185,4393,5618,2494,2895,2622,1720,2711,4394,3416,4753,5619,2543,4395,5620,3262,4396,2778,5621,2016,2745,5622,1155,1017,3782,3915,5623,3336,2313,201,1865,4397,1430,5624,4129,5625,5626,5627,5628,5629,4398,1604,5630,414,1866,371,2595,4754,4755,3532,2017,3127,4756,1708,960,4399,887,389,2172,1536,1663,1721,5631,2232,4130,2356,2940,1580,5632,5633,1744,4757,2544,4758,4759,5634,4760,5635,2074,5636,4761,3647,3417,2896,4400,5637,4401,2650,3418,2815,673,2712,2465,709,3533,4131,3648,4402,5638,1148,502,634,5639,5640,1204,4762,3649,1575,4763,2623,3783,5641,3784,3128,948,3263,121,1745,3916,1110,5642,4403,3083,2516,3027,4132,3785,1151,1771,3917,1488,4133,1987,5643,2438,3534,5644,5645,2094,5646,4404,3918,1213,1407,2816,531,2746,2545,3264,1011,1537,4764,2779,4405,3129,1061,5647,3786,3787,1867,2897,5648,2018,120,4406,4407,2063,3650,3265,2314,3919,2678,3419,1955,4765,4134,5649,3535,1047,2713,1266,5650,1368,4766,2858,649,3420,3920,2546,2747,1102,2859,2679,5651,5652,2e3,5653,1111,3651,2977,5654,2495,3921,3652,2817,1855,3421,3788,5655,5656,3422,2415,2898,3337,3266,3653,5657,2577,5658,3654,2818,4135,1460,856,5659,3655,5660,2899,2978,5661,2900,3922,5662,4408,632,2517,875,3923,1697,3924,2296,5663,5664,4767,3028,1239,580,4768,4409,5665,914,936,2075,1190,4136,1039,2124,5666,5667,5668,5669,3423,1473,5670,1354,4410,3925,4769,2173,3084,4137,915,3338,4411,4412,3339,1605,1835,5671,2748,398,3656,4413,3926,4138,328,1913,2860,4139,3927,1331,4414,3029,937,4415,5672,3657,4140,4141,3424,2161,4770,3425,524,742,538,3085,1012,5673,5674,3928,2466,5675,658,1103,225,3929,5676,5677,4771,5678,4772,5679,3267,1243,5680,4142,963,2250,4773,5681,2714,3658,3186,5682,5683,2596,2332,5684,4774,5685,5686,5687,3536,957,3426,2547,2033,1931,2941,2467,870,2019,3659,1746,2780,2781,2439,2468,5688,3930,5689,3789,3130,3790,3537,3427,3791,5690,1179,3086,5691,3187,2378,4416,3792,2548,3188,3131,2749,4143,5692,3428,1556,2549,2297,977,2901,2034,4144,1205,3429,5693,1765,3430,3189,2125,1271,714,1689,4775,3538,5694,2333,3931,533,4417,3660,2184,617,5695,2469,3340,3539,2315,5696,5697,3190,5698,5699,3932,1988,618,427,2651,3540,3431,5700,5701,1244,1690,5702,2819,4418,4776,5703,3541,4777,5704,2284,1576,473,3661,4419,3432,972,5705,3662,5706,3087,5707,5708,4778,4779,5709,3793,4145,4146,5710,153,4780,356,5711,1892,2902,4420,2144,408,803,2357,5712,3933,5713,4421,1646,2578,2518,4781,4782,3934,5714,3935,4422,5715,2416,3433,752,5716,5717,1962,3341,2979,5718,746,3030,2470,4783,4423,3794,698,4784,1893,4424,3663,2550,4785,3664,3936,5719,3191,3434,5720,1824,1302,4147,2715,3937,1974,4425,5721,4426,3192,823,1303,1288,1236,2861,3542,4148,3435,774,3938,5722,1581,4786,1304,2862,3939,4787,5723,2440,2162,1083,3268,4427,4149,4428,344,1173,288,2316,454,1683,5724,5725,1461,4788,4150,2597,5726,5727,4789,985,894,5728,3436,3193,5729,1914,2942,3795,1989,5730,2111,1975,5731,4151,5732,2579,1194,425,5733,4790,3194,1245,3796,4429,5734,5735,2863,5736,636,4791,1856,3940,760,1800,5737,4430,2212,1508,4792,4152,1894,1684,2298,5738,5739,4793,4431,4432,2213,479,5740,5741,832,5742,4153,2496,5743,2980,2497,3797,990,3132,627,1815,2652,4433,1582,4434,2126,2112,3543,4794,5744,799,4435,3195,5745,4795,2113,1737,3031,1018,543,754,4436,3342,1676,4796,4797,4154,4798,1489,5746,3544,5747,2624,2903,4155,5748,5749,2981,5750,5751,5752,5753,3196,4799,4800,2185,1722,5754,3269,3270,1843,3665,1715,481,365,1976,1857,5755,5756,1963,2498,4801,5757,2127,3666,3271,433,1895,2064,2076,5758,602,2750,5759,5760,5761,5762,5763,3032,1628,3437,5764,3197,4802,4156,2904,4803,2519,5765,2551,2782,5766,5767,5768,3343,4804,2905,5769,4805,5770,2864,4806,4807,1221,2982,4157,2520,5771,5772,5773,1868,1990,5774,5775,5776,1896,5777,5778,4808,1897,4158,318,5779,2095,4159,4437,5780,5781,485,5782,938,3941,553,2680,116,5783,3942,3667,5784,3545,2681,2783,3438,3344,2820,5785,3668,2943,4160,1747,2944,2983,5786,5787,207,5788,4809,5789,4810,2521,5790,3033,890,3669,3943,5791,1878,3798,3439,5792,2186,2358,3440,1652,5793,5794,5795,941,2299,208,3546,4161,2020,330,4438,3944,2906,2499,3799,4439,4811,5796,5797,5798,2522,1613,4812,5799,3345,3945,2523,5800,4162,5801,1637,4163,2471,4813,3946,5802,2500,3034,3800,5803,5804,2195,4814,5805,2163,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6e3,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,3670,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,4815,6286,6287,6288,6289,6290,6291,6292,4816,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,4817,4818,6312,6313,6314,6315,6316,6317,6318,4819,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,4820,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,3441,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,4440,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,4821,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,3947,3948,6478,6479,6480,6481,3272,4441,6482,6483,6484,6485,4442,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,4822,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6556,2784,6557,4823,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,3949,6570,6571,6572,4824,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,4825,6584,6585,6586,3950,2785,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,4826,6613,6614,6615,4827,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,4164,6626,6627,6628,6629,6630,6631,6632,6633,6634,3547,6635,4828,6636,6637,6638,6639,6640,6641,6642,3951,2984,6643,6644,6645,6646,6647,6648,6649,4165,6650,4829,6651,6652,4830,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,4831,6663,6664,6665,6666,6667,6668,6669,6670,6671,4166,6672,4832,3952,6673,6674,6675,6676,4833,6677,6678,6679,4167,6680,6681,6682,3198,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,4834,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,4443,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,4444,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,4168,6782,6783,3442,6784,6785,6786,6787,6788,6789,6790,6791,4169,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,4835,6812,6813,6814,4445,6815,6816,4446,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,3548,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,4836,6847,6848,6849,6850,6851,6852,6853,6854,3953,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,3199,6878,6879,6880,6881,6882,4447,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,4170,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,4837,6928,6929,6930,6931,6932,6933,6934,6935,6936,3346,6937,6938,4838,6939,6940,6941,4448,6942,6943,6944,6945,6946,4449,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,3671,6995,6996,6997,6998,4839,6999,7e3,7001,7002,3549,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,4840,7031,7032,7033,7034,7035,7036,7037,7038,4841,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,2985,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,4842,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,4450,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,4843,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,4171,4172,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,4844,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,4451,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,4173,7354,7355,4845,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,4846,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,3672,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,4452,7454,3200,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,4847,7475,7476,7477,3133,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,3347,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,4848,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,3801,4849,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,3035,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,4850,7617,7618,3802,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,4851,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,4453,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,3443,7698,7699,7700,7701,7702,4454,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,2472,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,3954,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,3134,7751,7752,4852,7753,7754,7755,4853,7756,7757,7758,7759,7760,4174,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,4854,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,4855,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,3955,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,3444,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,4175,7892,7893,7894,7895,7896,4856,4857,7897,7898,7899,7900,2598,7901,7902,7903,7904,7905,7906,7907,7908,4455,7909,7910,7911,7912,7913,7914,3201,7915,7916,7917,7918,7919,7920,7921,4858,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,4859,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,4860,7997,7998,7999,8e3,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,4176,8017,8018,8019,8020,8021,8022,8023,4861,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,4862,4456,8037,8038,8039,8040,4863,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,4864,4177,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,4178,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,4865,4866,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,4179,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,4457,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,3445,8257,8258,8259,8260,8261,8262,4458,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,4459,8273,8274,8275,8276,3550,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,4460,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,4867,8308,8309,8310,8311,8312,3551,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,4868,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,4869,4461,8364,8365,8366,8367,8368,8369,8370,4870,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,4871,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,4462,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,2986,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,4180,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,4872,8565,8566,8567,8568,8569,8570,8571,8572,8573,4873,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,3803,8606,8607,8608,8609,8610,8611,8612,8613,4874,3804,8614,8615,8616,8617,8618,8619,8620,8621,3956,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,2865,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,4463,8657,8658,8659,4875,4876,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,4464,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,2261,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,4181,8734,8735,8736,8737,8738,8739,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749,8750,8751,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,4877,8764,8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8776,8777,8778,8779,8780,8781,8782,8783,8784,8785,8786,8787,8788,4878,8789,4879,8790,8791,8792,4880,8793,8794,8795,8796,8797,8798,8799,8800,8801,4881,8802,8803,8804,8805,8806,8807,8808,8809,8810,8811,8812,8813,8814,8815,3957,8816,8817,8818,8819,8820,8821,8822,8823,8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839,8840,8841,8842,8843,8844,8845,8846,8847,4882,8848,8849,8850,8851,8852,8853,8854,8855,8856,8857,8858,8859,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,8884,3202,8885,8886,8887,8888,8889,8890,8891,8892,8893,8894,8895,8896,8897,8898,8899,8900,8901,8902,8903,8904,8905,8906,8907,8908,8909,8910,8911,8912,8913,8914,8915,8916,8917,8918,8919,8920,8921,8922,8923,8924,4465,8925,8926,8927,8928,8929,8930,8931,8932,4883,8933,8934,8935,8936,8937,8938,8939,8940,8941,8942,8943,2214,8944,8945,8946,8947,8948,8949,8950,8951,8952,8953,8954,8955,8956,8957,8958,8959,8960,8961,8962,8963,8964,8965,4884,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977,8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,8990,8991,8992,4885,8993,8994,8995,8996,8997,8998,8999,9e3,9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,4182,9022,9023,9024,9025,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9050,9051,9052,9053,9054,9055,9056,9057,9058,9059,9060,9061,9062,9063,4886,9064,9065,9066,9067,9068,9069,4887,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9080,9081,9082,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,9100,9101,9102,9103,9104,9105,9106,9107,9108,9109,9110,9111,9112,9113,9114,9115,9116,9117,9118,9119,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,9130,9131,9132,9133,9134,9135,9136,9137,9138,9139,9140,9141,3958,9142,9143,9144,9145,9146,9147,9148,9149,9150,9151,4888,9152,9153,9154,9155,9156,9157,9158,9159,9160,9161,9162,9163,9164,9165,9166,9167,9168,9169,9170,9171,9172,9173,9174,9175,4889,9176,9177,9178,9179,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,9192,9193,9194,9195,9196,9197,9198,9199,9200,9201,9202,9203,4890,9204,9205,9206,9207,9208,9209,9210,9211,9212,9213,9214,9215,9216,9217,9218,9219,9220,9221,9222,4466,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,4891,9246,9247,9248,9249,9250,9251,9252,9253,9254,9255,9256,9257,4892,9258,9259,9260,9261,4893,4894,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,4467,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,3673,9286,9287,9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,4895,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,4468,9348,9349,9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9372,9373,4896,9374,4469,9375,9376,9377,9378,9379,4897,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9406,4470,9407,2751,9408,9409,3674,3552,9410,9411,9412,9413,9414,9415,9416,9417,9418,9419,9420,9421,4898,9422,9423,9424,9425,9426,9427,9428,9429,3959,9430,9431,9432,9433,9434,9435,9436,4471,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9450,3348,9451,9452,9453,9454,9455,9456,9457,9458,9459,9460,9461,9462,9463,9464,9465,9466,9467,9468,9469,9470,9471,9472,4899,9473,9474,9475,9476,9477,4900,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,3349,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,4901,9521,9522,9523,9524,9525,9526,4902,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,9551,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,3805,9585,9586,9587,9588,9589,9590,9591,9592,9593,9594,9595,9596,9597,9598,9599,9600,9601,9602,4903,9603,9604,9605,9606,9607,4904,9608,9609,9610,9611,9612,9613,9614,4905,9615,9616,9617,9618,9619,9620,9621,9622,9623,9624,9625,9626,9627,9628,9629,9630,9631,9632,4906,9633,9634,9635,9636,9637,9638,9639,9640,9641,9642,9643,4907,9644,9645,9646,9647,9648,9649,9650,9651,9652,9653,9654,9655,9656,9657,9658,9659,9660,9661,9662,9663,9664,9665,9666,9667,9668,9669,9670,9671,9672,4183,9673,9674,9675,9676,9677,4908,9678,9679,9680,9681,4909,9682,9683,9684,9685,9686,9687,9688,9689,9690,4910,9691,9692,9693,3675,9694,9695,9696,2945,9697,9698,9699,9700,9701,9702,9703,9704,9705,4911,9706,9707,9708,9709,9710,9711,9712,9713,9714,9715,9716,9717,9718,9719,9720,9721,9722,9723,9724,9725,9726,9727,9728,9729,9730,9731,9732,9733,9734,9735,4912,9736,9737,9738,9739,9740,4913,9741,9742,9743,9744,9745,9746,9747,9748,9749,9750,9751,9752,9753,9754,9755,9756,9757,9758,4914,9759,9760,9761,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772,9773,9774,9775,9776,9777,9778,9779,9780,9781,9782,4915,9783,9784,9785,9786,9787,9788,9789,9790,9791,9792,9793,4916,9794,9795,9796,9797,9798,9799,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,9810,9811,9812,9813,9814,9815,9816,9817,9818,9819,9820,9821,9822,9823,9824,9825,9826,9827,9828,9829,9830,9831,9832,9833,9834,9835,9836,9837,9838,9839,9840,9841,9842,9843,9844,9845,9846,9847,9848,9849,9850,9851,9852,9853,9854,9855,9856,9857,9858,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,4917,9869,9870,9871,9872,9873,9874,9875,9876,9877,9878,9879,9880,9881,9882,9883,9884,9885,9886,9887,9888,9889,9890,9891,9892,4472,9893,9894,9895,9896,9897,3806,9898,9899,9900,9901,9902,9903,9904,9905,9906,9907,9908,9909,9910,9911,9912,9913,9914,4918,9915,9916,9917,4919,9918,9919,9920,9921,4184,9922,9923,9924,9925,9926,9927,9928,9929,9930,9931,9932,9933,9934,9935,9936,9937,9938,9939,9940,9941,9942,9943,9944,9945,9946,4920,9947,9948,9949,9950,9951,9952,9953,9954,9955,4185,9956,9957,9958,9959,9960,9961,9962,9963,9964,9965,4921,9966,9967,9968,4473,9969,9970,9971,9972,9973,9974,9975,9976,9977,4474,9978,9979,9980,9981,9982,9983,9984,9985,9986,9987,9988,9989,9990,9991,9992,9993,9994,9995,9996,9997,9998,9999,1e4,10001,10002,10003,10004,10005,10006,10007,10008,10009,10010,10011,10012,10013,10014,10015,10016,10017,10018,10019,10020,10021,4922,10022,4923,10023,10024,10025,10026,10027,10028,10029,10030,10031,10032,10033,10034,10035,10036,10037,10038,10039,10040,10041,10042,10043,10044,10045,10046,10047,10048,4924,10049,10050,10051,10052,10053,10054,10055,10056,10057,10058,10059,10060,10061,10062,10063,10064,10065,10066,10067,10068,10069,10070,10071,10072,10073,10074,10075,10076,10077,10078,10079,10080,10081,10082,10083,10084,10085,10086,10087,4475,10088,10089,10090,10091,10092,10093,10094,10095,10096,10097,4476,10098,10099,10100,10101,10102,10103,10104,10105,10106,10107,10108,10109,10110,10111,2174,10112,10113,10114,10115,10116,10117,10118,10119,10120,10121,10122,10123,10124,10125,10126,10127,10128,10129,10130,10131,10132,10133,10134,10135,10136,10137,10138,10139,10140,3807,4186,4925,10141,10142,10143,10144,10145,10146,10147,4477,4187,10148,10149,10150,10151,10152,10153,4188,10154,10155,10156,10157,10158,10159,10160,10161,4926,10162,10163,10164,10165,10166,10167,10168,10169,10170,10171,10172,10173,10174,10175,10176,10177,10178,10179,10180,10181,10182,10183,10184,10185,10186,10187,10188,10189,10190,10191,10192,3203,10193,10194,10195,10196,10197,10198,10199,10200,4478,10201,10202,10203,10204,4479,10205,10206,10207,10208,10209,10210,10211,10212,10213,10214,10215,10216,10217,10218,10219,10220,10221,10222,10223,10224,10225,10226,10227,10228,10229,10230,10231,10232,10233,10234,4927,10235,10236,10237,10238,10239,10240,10241,10242,10243,10244,10245,10246,10247,10248,10249,10250,10251,10252,10253,10254,10255,10256,10257,10258,10259,10260,10261,10262,10263,10264,10265,10266,10267,10268,10269,10270,10271,10272,10273,4480,4928,4929,10274,10275,10276,10277,10278,10279,10280,10281,10282,10283,10284,10285,10286,10287,10288,10289,10290,10291,10292,10293,10294,10295,10296,10297,10298,10299,10300,10301,10302,10303,10304,10305,10306,10307,10308,10309,10310,10311,10312,10313,10314,10315,10316,10317,10318,10319,10320,10321,10322,10323,10324,10325,10326,10327,10328,10329,10330,10331,10332,10333,10334,4930,10335,10336,10337,10338,10339,10340,10341,10342,4931,10343,10344,10345,10346,10347,10348,10349,10350,10351,10352,10353,10354,10355,3088,10356,2786,10357,10358,10359,10360,4189,10361,10362,10363,10364,10365,10366,10367,10368,10369,10370,10371,10372,10373,10374,10375,4932,10376,10377,10378,10379,10380,10381,10382,10383,10384,10385,10386,10387,10388,10389,10390,10391,10392,4933,10393,10394,10395,4934,10396,10397,10398,10399,10400,10401,10402,10403,10404,10405,10406,10407,10408,10409,10410,10411,10412,3446,10413,10414,10415,10416,10417,10418,10419,10420,10421,10422,10423,4935,10424,10425,10426,10427,10428,10429,10430,4936,10431,10432,10433,10434,10435,10436,10437,10438,10439,10440,10441,10442,10443,4937,10444,10445,10446,10447,4481,10448,10449,10450,10451,10452,10453,10454,10455,10456,10457,10458,10459,10460,10461,10462,10463,10464,10465,10466,10467,10468,10469,10470,10471,10472,10473,10474,10475,10476,10477,10478,10479,10480,10481,10482,10483,10484,10485,10486,10487,10488,10489,10490,10491,10492,10493,10494,10495,10496,10497,10498,10499,10500,10501,10502,10503,10504,10505,4938,10506,10507,10508,10509,10510,2552,10511,10512,10513,10514,10515,10516,3447,10517,10518,10519,10520,10521,10522,10523,10524,10525,10526,10527,10528,10529,10530,10531,10532,10533,10534,10535,10536,10537,10538,10539,10540,10541,10542,10543,4482,10544,4939,10545,10546,10547,10548,10549,10550,10551,10552,10553,10554,10555,10556,10557,10558,10559,10560,10561,10562,10563,10564,10565,10566,10567,3676,4483,10568,10569,10570,10571,10572,3448,10573,10574,10575,10576,10577,10578,10579,10580,10581,10582,10583,10584,10585,10586,10587,10588,10589,10590,10591,10592,10593,10594,10595,10596,10597,10598,10599,10600,10601,10602,10603,10604,10605,10606,10607,10608,10609,10610,10611,10612,10613,10614,10615,10616,10617,10618,10619,10620,10621,10622,10623,10624,10625,10626,10627,4484,10628,10629,10630,10631,10632,4940,10633,10634,10635,10636,10637,10638,10639,10640,10641,10642,10643,10644,10645,10646,10647,10648,10649,10650,10651,10652,10653,10654,10655,10656,4941,10657,10658,10659,2599,10660,10661,10662,10663,10664,10665,10666,3089,10667,10668,10669,10670,10671,10672,10673,10674,10675,10676,10677,10678,10679,10680,4942,10681,10682,10683,10684,10685,10686,10687,10688,10689,10690,10691,10692,10693,10694,10695,10696,10697,4485,10698,10699,10700,10701,10702,10703,10704,4943,10705,3677,10706,10707,10708,10709,10710,10711,10712,4944,10713,10714,10715,10716,10717,10718,10719,10720,10721,10722,10723,10724,10725,10726,10727,10728,4945,10729,10730,10731,10732,10733,10734,10735,10736,10737,10738,10739,10740,10741,10742,10743,10744,10745,10746,10747,10748,10749,10750,10751,10752,10753,10754,10755,10756,10757,10758,10759,10760,10761,4946,10762,10763,10764,10765,10766,10767,4947,4948,10768,10769,10770,10771,10772,10773,10774,10775,10776,10777,10778,10779,10780,10781,10782,10783,10784,10785,10786,10787,10788,10789,10790,10791,10792,10793,10794,10795,10796,10797,10798,10799,10800,10801,10802,10803,10804,10805,10806,10807,10808,10809,10810,10811,10812,10813,10814,10815,10816,10817,10818,10819,10820,10821,10822,10823,10824,10825,10826,10827,10828,10829,10830,10831,10832,10833,10834,10835,10836,10837,10838,10839,10840,10841,10842,10843,10844,10845,10846,10847,10848,10849,10850,10851,10852,10853,10854,10855,10856,10857,10858,10859,10860,10861,10862,10863,10864,10865,10866,10867,10868,10869,10870,10871,10872,10873,10874,10875,10876,10877,10878,4486,10879,10880,10881,10882,10883,10884,10885,4949,10886,10887,10888,10889,10890,10891,10892,10893,10894,10895,10896,10897,10898,10899,10900,10901,10902,10903,10904,10905,10906,10907,10908,10909,10910,10911,10912,10913,10914,10915,10916,10917,10918,10919,4487,10920,10921,10922,10923,10924,10925,10926,10927,10928,10929,10930,10931,10932,4950,10933,10934,10935,10936,10937,10938,10939,10940,10941,10942,10943,10944,10945,10946,10947,10948,10949,4488,10950,10951,10952,10953,10954,10955,10956,10957,10958,10959,4190,10960,10961,10962,10963,10964,10965,10966,10967,10968,10969,10970,10971,10972,10973,10974,10975,10976,10977,10978,10979,10980,10981,10982,10983,10984,10985,10986,10987,10988,10989,10990,10991,10992,10993,10994,10995,10996,10997,10998,10999,11e3,11001,11002,11003,11004,11005,11006,3960,11007,11008,11009,11010,11011,11012,11013,11014,11015,11016,11017,11018,11019,11020,11021,11022,11023,11024,11025,11026,11027,11028,11029,11030,11031,11032,4951,11033,11034,11035,11036,11037,11038,11039,11040,11041,11042,11043,11044,11045,11046,11047,4489,11048,11049,11050,11051,4952,11052,11053,11054,11055,11056,11057,11058,4953,11059,11060,11061,11062,11063,11064,11065,11066,11067,11068,11069,11070,11071,4954,11072,11073,11074,11075,11076,11077,11078,11079,11080,11081,11082,11083,11084,11085,11086,11087,11088,11089,11090,11091,11092,11093,11094,11095,11096,11097,11098,11099,11100,11101,11102,11103,11104,11105,11106,11107,11108,11109,11110,11111,11112,11113,11114,11115,3808,11116,11117,11118,11119,11120,11121,11122,11123,11124,11125,11126,11127,11128,11129,11130,11131,11132,11133,11134,4955,11135,11136,11137,11138,11139,11140,11141,11142,11143,11144,11145,11146,11147,11148,11149,11150,11151,11152,11153,11154,11155,11156,11157,11158,11159,11160,11161,4956,11162,11163,11164,11165,11166,11167,11168,11169,11170,11171,11172,11173,11174,11175,11176,11177,11178,11179,11180,4957,11181,11182,11183,11184,11185,11186,4958,11187,11188,11189,11190,11191,11192,11193,11194,11195,11196,11197,11198,11199,11200,3678,11201,11202,11203,11204,11205,11206,4191,11207,11208,11209,11210,11211,11212,11213,11214,11215,11216,11217,11218,11219,11220,11221,11222,11223,11224,11225,11226,11227,11228,11229,11230,11231,11232,11233,11234,11235,11236,11237,11238,11239,11240,11241,11242,11243,11244,11245,11246,11247,11248,11249,11250,11251,4959,11252,11253,11254,11255,11256,11257,11258,11259,11260,11261,11262,11263,11264,11265,11266,11267,11268,11269,11270,11271,11272,11273,11274,11275,11276,11277,11278,11279,11280,11281,11282,11283,11284,11285,11286,11287,11288,11289,11290,11291,11292,11293,11294,11295,11296,11297,11298,11299,11300,11301,11302,11303,11304,11305,11306,11307,11308,11309,11310,11311,11312,11313,11314,3679,11315,11316,11317,11318,4490,11319,11320,11321,11322,11323,11324,11325,11326,11327,11328,11329,11330,11331,11332,11333,11334,11335,11336,11337,11338,11339,11340,11341,11342,11343,11344,11345,11346,11347,4960,11348,11349,11350,11351,11352,11353,11354,11355,11356,11357,11358,11359,11360,11361,11362,11363,11364,11365,11366,11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,3961,4961,11378,11379,11380,11381,11382,11383,11384,11385,11386,11387,11388,11389,11390,11391,11392,11393,11394,11395,11396,11397,4192,11398,11399,11400,11401,11402,11403,11404,11405,11406,11407,11408,11409,11410,11411,4962,11412,11413,11414,11415,11416,11417,11418,11419,11420,11421,11422,11423,11424,11425,11426,11427,11428,11429,11430,11431,11432,11433,11434,11435,11436,11437,11438,11439,11440,11441,11442,11443,11444,11445,11446,11447,11448,11449,11450,11451,11452,11453,11454,11455,11456,11457,11458,11459,11460,11461,11462,11463,11464,11465,11466,11467,11468,11469,4963,11470,11471,4491,11472,11473,11474,11475,4964,11476,11477,11478,11479,11480,11481,11482,11483,11484,11485,11486,11487,11488,11489,11490,11491,11492,4965,11493,11494,11495,11496,11497,11498,11499,11500,11501,11502,11503,11504,11505,11506,11507,11508,11509,11510,11511,11512,11513,11514,11515,11516,11517,11518,11519,11520,11521,11522,11523,11524,11525,11526,11527,11528,11529,3962,11530,11531,11532,11533,11534,11535,11536,11537,11538,11539,11540,11541,11542,11543,11544,11545,11546,11547,11548,11549,11550,11551,11552,11553,11554,11555,11556,11557,11558,11559,11560,11561,11562,11563,11564,4193,4194,11565,11566,11567,11568,11569,11570,11571,11572,11573,11574,11575,11576,11577,11578,11579,11580,11581,11582,11583,11584,11585,11586,11587,11588,11589,11590,11591,4966,4195,11592,11593,11594,11595,11596,11597,11598,11599,11600,11601,11602,11603,11604,3090,11605,11606,11607,11608,11609,11610,4967,11611,11612,11613,11614,11615,11616,11617,11618,11619,11620,11621,11622,11623,11624,11625,11626,11627,11628,11629,11630,11631,11632,11633,11634,11635,11636,11637,11638,11639,11640,11641,11642,11643,11644,11645,11646,11647,11648,11649,11650,11651,11652,11653,11654,11655,11656,11657,11658,11659,11660,11661,11662,11663,11664,11665,11666,11667,11668,11669,11670,11671,11672,11673,11674,4968,11675,11676,11677,11678,11679,11680,11681,11682,11683,11684,11685,11686,11687,11688,11689,11690,11691,11692,11693,3809,11694,11695,11696,11697,11698,11699,11700,11701,11702,11703,11704,11705,11706,11707,11708,11709,11710,11711,11712,11713,11714,11715,11716,11717,11718,3553,11719,11720,11721,11722,11723,11724,11725,11726,11727,11728,11729,11730,4969,11731,11732,11733,11734,11735,11736,11737,11738,11739,11740,4492,11741,11742,11743,11744,11745,11746,11747,11748,11749,11750,11751,11752,4970,11753,11754,11755,11756,11757,11758,11759,11760,11761,11762,11763,11764,11765,11766,11767,11768,11769,11770,11771,11772,11773,11774,11775,11776,11777,11778,11779,11780,11781,11782,11783,11784,11785,11786,11787,11788,11789,11790,4971,11791,11792,11793,11794,11795,11796,11797,4972,11798,11799,11800,11801,11802,11803,11804,11805,11806,11807,11808,11809,11810,4973,11811,11812,11813,11814,11815,11816,11817,11818,11819,11820,11821,11822,11823,11824,11825,11826,11827,11828,11829,11830,11831,11832,11833,11834,3680,3810,11835,11836,4974,11837,11838,11839,11840,11841,11842,11843,11844,11845,11846,11847,11848,11849,11850,11851,11852,11853,11854,11855,11856,11857,11858,11859,11860,11861,11862,11863,11864,11865,11866,11867,11868,11869,11870,11871,11872,11873,11874,11875,11876,11877,11878,11879,11880,11881,11882,11883,11884,4493,11885,11886,11887,11888,11889,11890,11891,11892,11893,11894,11895,11896,11897,11898,11899,11900,11901,11902,11903,11904,11905,11906,11907,11908,11909,11910,11911,11912,11913,11914,11915,4975,11916,11917,11918,11919,11920,11921,11922,11923,11924,11925,11926,11927,11928,11929,11930,11931,11932,11933,11934,11935,11936,11937,11938,11939,11940,11941,11942,11943,11944,11945,11946,11947,11948,11949,4976,11950,11951,11952,11953,11954,11955,11956,11957,11958,11959,11960,11961,11962,11963,11964,11965,11966,11967,11968,11969,11970,11971,11972,11973,11974,11975,11976,11977,11978,11979,11980,11981,11982,11983,11984,11985,11986,11987,4196,11988,11989,11990,11991,11992,4977,11993,11994,11995,11996,11997,11998,11999,12e3,12001,12002,12003,12004,12005,12006,12007,12008,12009,12010,12011,12012,12013,12014,12015,12016,12017,12018,12019,12020,12021,12022,12023,12024,12025,12026,12027,12028,12029,12030,12031,12032,12033,12034,12035,12036,12037,12038,12039,12040,12041,12042,12043,12044,12045,12046,12047,12048,12049,12050,12051,12052,12053,12054,12055,12056,12057,12058,12059,12060,12061,4978,12062,12063,12064,12065,12066,12067,12068,12069,12070,12071,12072,12073,12074,12075,12076,12077,12078,12079,12080,12081,12082,12083,12084,12085,12086,12087,12088,12089,12090,12091,12092,12093,12094,12095,12096,12097,12098,12099,12100,12101,12102,12103,12104,12105,12106,12107,12108,12109,12110,12111,12112,12113,12114,12115,12116,12117,12118,12119,12120,12121,12122,12123,4979,12124,12125,12126,12127,12128,4197,12129,12130,12131,12132,12133,12134,12135,12136,12137,12138,12139,12140,12141,12142,12143,12144,12145,12146,12147,12148,12149,12150,12151,12152,12153,12154,4980,12155,12156,12157,12158,12159,12160,4494,12161,12162,12163,12164,3811,12165,12166,12167,12168,12169,4495,12170,12171,4496,12172,12173,12174,12175,12176,3812,12177,12178,12179,12180,12181,12182,12183,12184,12185,12186,12187,12188,12189,12190,12191,12192,12193,12194,12195,12196,12197,12198,12199,12200,12201,12202,12203,12204,12205,12206,12207,12208,12209,12210,12211,12212,12213,12214,12215,12216,12217,12218,12219,12220,12221,4981,12222,12223,12224,12225,12226,12227,12228,12229,12230,12231,12232,12233,12234,12235,4982,12236,12237,12238,12239,12240,12241,12242,12243,12244,12245,4983,12246,12247,12248,12249,4984,12250,12251,12252,12253,12254,12255,12256,12257,12258,12259,12260,12261,12262,12263,12264,4985,12265,4497,12266,12267,12268,12269,12270,12271,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12284,12285,12286,12287,4986,12288,12289,12290,12291,12292,12293,12294,12295,12296,2473,12297,12298,12299,12300,12301,12302,12303,12304,12305,12306,12307,12308,12309,12310,12311,12312,12313,12314,12315,12316,12317,12318,12319,3963,12320,12321,12322,12323,12324,12325,12326,12327,12328,12329,12330,12331,12332,4987,12333,12334,12335,12336,12337,12338,12339,12340,12341,12342,12343,12344,12345,12346,12347,12348,12349,12350,12351,12352,12353,12354,12355,12356,12357,12358,12359,3964,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,3965,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,4988,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12436,12437,12438,3554,12439,12440,12441,12442,12443,12444,12445,12446,12447,12448,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,4989,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,4990,12481,12482,12483,12484,12485,12486,12487,12488,12489,4498,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,12535,12536,12537,12538,12539,12540,12541,12542,12543,12544,12545,12546,12547,12548,12549,12550,12551,4991,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,3036,12579,12580,12581,12582,12583,3966,12584,12585,12586,12587,12588,12589,12590,12591,12592,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,4499,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686,12687,12688,12689,12690,12691,12692,12693,12694,12695,12696,12697,12698,4992,12699,12700,12701,12702,12703,12704,12705,12706,12707,12708,12709,12710,12711,12712,12713,12714,12715,12716,12717,12718,12719,12720,12721,12722,12723,12724,12725,12726,12727,12728,12729,12730,12731,12732,12733,12734,12735,12736,12737,12738,12739,12740,12741,12742,12743,12744,12745,12746,12747,12748,12749,12750,12751,12752,12753,12754,12755,12756,12757,12758,12759,12760,12761,12762,12763,12764,12765,12766,12767,12768,12769,12770,12771,12772,12773,12774,12775,12776,12777,12778,4993,2175,12779,12780,12781,12782,12783,12784,12785,12786,4500,12787,12788,12789,12790,12791,12792,12793,12794,12795,12796,12797,12798,12799,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824,12825,12826,4198,3967,12827,12828,12829,12830,12831,12832,12833,12834,12835,12836,12837,12838,12839,12840,12841,12842,12843,12844,12845,12846,12847,12848,12849,12850,12851,12852,12853,12854,12855,12856,12857,12858,12859,12860,12861,4199,12862,12863,12864,12865,12866,12867,12868,12869,12870,12871,12872,12873,12874,12875,12876,12877,12878,12879,12880,12881,12882,12883,12884,12885,12886,12887,4501,12888,12889,12890,12891,12892,12893,12894,12895,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912,4994,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,12924,12925,12926,12927,12928,12929,12930,12931,12932,12933,12934,12935,12936,12937,12938,12939,12940,12941,12942,12943,12944,12945,12946,12947,12948,12949,12950,12951,12952,12953,12954,12955,12956,1772,12957,12958,12959,12960,12961,12962,12963,12964,12965,12966,12967,12968,12969,12970,12971,12972,12973,12974,12975,12976,12977,12978,12979,12980,12981,12982,12983,12984,12985,12986,12987,12988,12989,12990,12991,12992,12993,12994,12995,12996,12997,4502,12998,4503,12999,13e3,13001,13002,13003,4504,13004,13005,13006,13007,13008,13009,13010,13011,13012,13013,13014,13015,13016,13017,13018,13019,13020,13021,13022,13023,13024,13025,13026,13027,13028,13029,3449,13030,13031,13032,13033,13034,13035,13036,13037,13038,13039,13040,13041,13042,13043,13044,13045,13046,13047,13048,13049,13050,13051,13052,13053,13054,13055,13056,13057,13058,13059,13060,13061,13062,13063,13064,13065,13066,13067,13068,13069,13070,13071,13072,13073,13074,13075,13076,13077,13078,13079,13080,13081,13082,13083,13084,13085,13086,13087,13088,13089,13090,13091,13092,13093,13094,13095,13096,13097,13098,13099,13100,13101,13102,13103,13104,13105,13106,13107,13108,13109,13110,13111,13112,13113,13114,13115,13116,13117,13118,3968,13119,4995,13120,13121,13122,13123,13124,13125,13126,13127,4505,13128,13129,13130,13131,13132,13133,13134,4996,4506,13135,13136,13137,13138,13139,4997,13140,13141,13142,13143,13144,13145,13146,13147,13148,13149,13150,13151,13152,13153,13154,13155,13156,13157,13158,13159,4998,13160,13161,13162,13163,13164,13165,13166,13167,13168,13169,13170,13171,13172,13173,13174,13175,13176,4999,13177,13178,13179,13180,13181,13182,13183,13184,13185,13186,13187,13188,13189,13190,13191,13192,13193,13194,13195,13196,13197,13198,13199,13200,13201,13202,13203,13204,13205,13206,5e3,13207,13208,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13219,13220,13221,13222,13223,13224,13225,13226,13227,4200,5001,13228,13229,13230,13231,13232,13233,13234,13235,13236,13237,13238,13239,13240,3969,13241,13242,13243,13244,3970,13245,13246,13247,13248,13249,13250,13251,13252,13253,13254,13255,13256,13257,13258,13259,13260,13261,13262,13263,13264,13265,13266,13267,13268,3450,13269,13270,13271,13272,13273,13274,13275,13276,5002,13277,13278,13279,13280,13281,13282,13283,13284,13285,13286,13287,13288,13289,13290,13291,13292,13293,13294,13295,13296,13297,13298,13299,13300,13301,13302,3813,13303,13304,13305,13306,13307,13308,13309,13310,13311,13312,13313,13314,13315,13316,13317,13318,13319,13320,13321,13322,13323,13324,13325,13326,13327,13328,4507,13329,13330,13331,13332,13333,13334,13335,13336,13337,13338,13339,13340,13341,5003,13342,13343,13344,13345,13346,13347,13348,13349,13350,13351,13352,13353,13354,13355,13356,13357,13358,13359,13360,13361,13362,13363,13364,13365,13366,13367,5004,13368,13369,13370,13371,13372,13373,13374,13375,13376,13377,13378,13379,13380,13381,13382,13383,13384,13385,13386,13387,13388,13389,13390,13391,13392,13393,13394,13395,13396,13397,13398,13399,13400,13401,13402,13403,13404,13405,13406,13407,13408,13409,13410,13411,13412,13413,13414,13415,13416,13417,13418,13419,13420,13421,13422,13423,13424,13425,13426,13427,13428,13429,13430,13431,13432,4508,13433,13434,13435,4201,13436,13437,13438,13439,13440,13441,13442,13443,13444,13445,13446,13447,13448,13449,13450,13451,13452,13453,13454,13455,13456,13457,5005,13458,13459,13460,13461,13462,13463,13464,13465,13466,13467,13468,13469,13470,4509,13471,13472,13473,13474,13475,13476,13477,13478,13479,13480,13481,13482,13483,13484,13485,13486,13487,13488,13489,13490,13491,13492,13493,13494,13495,13496,13497,13498,13499,13500,13501,13502,13503,13504,13505,13506,13507,13508,13509,13510,13511,13512,13513,13514,13515,13516,13517,13518,13519,13520,13521,13522,13523,13524,13525,13526,13527,13528,13529,13530,13531,13532,13533,13534,13535,13536,13537,13538,13539,13540,13541,13542,13543,13544,13545,13546,13547,13548,13549,13550,13551,13552,13553,13554,13555,13556,13557,13558,13559,13560,13561,13562,13563,13564,13565,13566,13567,13568,13569,13570,13571,13572,13573,13574,13575,13576,13577,13578,13579,13580,13581,13582,13583,13584,13585,13586,13587,13588,13589,13590,13591,13592,13593,13594,13595,13596,13597,13598,13599,13600,13601,13602,13603,13604,13605,13606,13607,13608,13609,13610,13611,13612,13613,13614,13615,13616,13617,13618,13619,13620,13621,13622,13623,13624,13625,13626,13627,13628,13629,13630,13631,13632,13633,13634,13635,13636,13637,13638,13639,13640,13641,13642,5006,13643,13644,13645,13646,13647,13648,13649,13650,13651,5007,13652,13653,13654,13655,13656,13657,13658,13659,13660,13661,13662,13663,13664,13665,13666,13667,13668,13669,13670,13671,13672,13673,13674,13675,13676,13677,13678,13679,13680,13681,13682,13683,13684,13685,13686,13687,13688,13689,13690,13691,13692,13693,13694,13695,13696,13697,13698,13699,13700,13701,13702,13703,13704,13705,13706,13707,13708,13709,13710,13711,13712,13713,13714,13715,13716,13717,13718,13719,13720,13721,13722,13723,13724,13725,13726,13727,13728,13729,13730,13731,13732,13733,13734,13735,13736,13737,13738,13739,13740,13741,13742,13743,13744,13745,13746,13747,13748,13749,13750,13751,13752,13753,13754,13755,13756,13757,13758,13759,13760,13761,13762,13763,13764,13765,13766,13767,13768,13769,13770,13771,13772,13773,13774,3273,13775,13776,13777,13778,13779,13780,13781,13782,13783,13784,13785,13786,13787,13788,13789,13790,13791,13792,13793,13794,13795,13796,13797,13798,13799,13800,13801,13802,13803,13804,13805,13806,13807,13808,13809,13810,13811,13812,13813,13814,13815,13816,13817,13818,13819,13820,13821,13822,13823,13824,13825,13826,13827,13828,13829,13830,13831,13832,13833,13834,13835,13836,13837,13838,13839,13840,13841,13842,13843,13844,13845,13846,13847,13848,13849,13850,13851,13852,13853,13854,13855,13856,13857,13858,13859,13860,13861,13862,13863,13864,13865,13866,13867,13868,13869,13870,13871,13872,13873,13874,13875,13876,13877,13878,13879,13880,13881,13882,13883,13884,13885,13886,13887,13888,13889,13890,13891,13892,13893,13894,13895,13896,13897,13898,13899,13900,13901,13902,13903,13904,13905,13906,13907,13908,13909,13910,13911,13912,13913,13914,13915,13916,13917,13918,13919,13920,13921,13922,13923,13924,13925,13926,13927,13928,13929,13930,13931,13932,13933,13934,13935,13936,13937,13938,13939,13940,13941,13942,13943,13944,13945,13946,13947,13948,13949,13950,13951,13952,13953,13954,13955,13956,13957,13958,13959,13960,13961,13962,13963,13964,13965,13966,13967,13968,13969,13970,13971,13972]},function(e,t,r){var o=r(4),i=r(6),n=r(0),s=r(54);function a(){i.apply(this);var e=this;this.reset=function(){a.prototype.reset.apply(this),this._mCodingSM.reset(),this._mNumOfMBChar=0},this.getCharsetName=function(){return"UTF-8"},this.feed=function(e){for(var t,r=0;r<e.length;r++){t=e[r];var o=this._mCodingSM.nextState(t);if(o==n.error){this._mState=n.notMe;break}if(o==n.itsMe){this._mState=n.foundIt;break}o==n.start&&this._mCodingSM.getCurrentCharLen()>=2&&this._mNumOfMBChar++}return this.getState()==n.detecting&&this.getConfidence()>n.SHORTCUT_THRESHOLD&&(this._mState=n.foundIt),this.getState()},this.getConfidence=function(){var e=.99;if(this._mNumOfMBChar<6){for(var t=0;t<this._mNumOfMBChar;t++)e*=.5;return 1-e}return e},e._mCodingSM=new o(s),e.reset()}a.prototype=new i,e.exports=a},function(e,t,r){var o=r(0),i=[o.error,o.start,o.error,o.error,o.error,o.error,12,10,9,11,8,7,6,5,4,3,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.error,o.error,5,5,5,5,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,5,5,5,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,7,7,7,7,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,7,7,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,9,9,9,9,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,9,9,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,12,12,12,12,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,12,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,12,12,12,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.start,o.start,o.start,o.start,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error];e.exports={classTable:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,8,8,8,8,8,8,8,8,8,8,8,8,9,8,8,10,11,11,11,11,11,11,11,12,13,13,13,14,15,0,0],classFactor:16,stateTable:i,charLenTable:[0,1,0,0,0,0,2,3,3,3,4,4,5,5,6,6],name:"UTF-8"}},function(e,t,r){var o=r(4),i=r(9),n=r(56),s=r(10).SJISDistributionAnalysis,a=r(19).SJISContextAnalysis,c=r(0),h=r(7);function f(){i.apply(this);var e=this;this.reset=function(){f.prototype.reset.apply(this),this._mContextAnalyzer.reset()},this.getCharsetName=function(){return"SHIFT_JIS"},this.feed=function(e){for(var t=e.length,r=0;r<t;r++){var o=this._mCodingSM.nextState(e[r]);if(o==c.error){h.log(this.getCharsetName()+" prober hit error at byte "+r+"\n"),this._mState=c.notMe;break}if(o==c.itsMe){this._mState=c.foundIt;break}if(o==c.start){var i=this._mCodingSM.getCurrentCharLen();0==r?(this._mLastChar[1]=e[0],this._mContextAnalyzer.feed(this._mLastChar.slice(2-i),i),this._mDistributionAnalyzer.feed(this._mLastChar,i)):(this._mContextAnalyzer.feed(e.slice(r+1-i,r+3-i),i),this._mDistributionAnalyzer.feed(e.slice(r-1,r+1),i))}}return this._mLastChar[0]=e[t-1],this.getState()==c.detecting&&this._mContextAnalyzer.gotEnoughData()&&this.getConfidence()>c.SHORTCUT_THRESHOLD&&(this._mState=c.foundIt),this.getState()},this.getConfidence=function(){var e=this._mContextAnalyzer.getConfidence(),t=this._mDistributionAnalyzer.getConfidence();return Math.max(e,t)},e._mCodingSM=new o(n),e._mDistributionAnalyzer=new s,e._mContextAnalyzer=new a,e.reset()}f.prototype=new i,e.exports=f},function(e,t,r){var o=r(0),i=[o.error,o.start,o.start,3,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.error,o.error,o.start,o.start,o.start,o.start];e.exports={classTable:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0],classFactor:6,stateTable:i,charLenTable:[0,1,1,2,0,0],name:"Shift_JIS"}},function(e,t,r){var o=r(4),i=r(9),n=r(10).EUCJPDistributionAnalysis,s=r(19).EUCJPContextAnalysis,a=r(58),c=r(0),h=r(7);function f(){i.apply(this);var e=this;this.reset=function(){f.prototype.reset.apply(this),this._mContextAnalyzer.reset()},this.getCharsetName=function(){return"EUC-JP"},this.feed=function(e){for(var t=e.length,r=0;r<t;r++){var o=this._mCodingSM.nextState(e[r]);if(o==c.error){h.log(this.getCharsetName()+" prober hit error at byte "+r+"\n"),this._mState=c.notMe;break}if(o==c.itsMe){this._mState=c.foundIt;break}if(o==c.start){var i=this._mCodingSM.getCurrentCharLen();0==r?(this._mLastChar[1]=e[0],this._mContextAnalyzer.feed(this._mLastChar,i),this._mDistributionAnalyzer.feed(this._mLastChar,i)):(this._mContextAnalyzer.feed(e.slice(r-1,r+1),i),this._mDistributionAnalyzer.feed(e.slice(r-1,r+1),i))}}return this._mLastChar[0]=e[t-1],this.getState()==c.detecting&&this._mContextAnalyzer.gotEnoughData()&&this.getConfidence()>c.SHORTCUT_THRESHOLD&&(this._mState=c.foundIt),this.getState()},this.getConfidence=function(){var e=this._mContextAnalyzer.getConfidence(),t=this._mDistributionAnalyzer.getConfidence();return Math.max(e,t)},e._mCodingSM=new o(a),e._mDistributionAnalyzer=new n,e._mContextAnalyzer=new s,e.reset()}f.prototype=new i,e.exports=f},function(e,t,r){var o=r(0),i=[3,4,3,5,o.start,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.start,o.error,o.start,o.error,o.error,o.error,o.error,o.error,o.start,o.error,o.error,o.error,3,o.error,3,o.error,o.error,o.error,o.start,o.start,o.start,o.start];e.exports={classTable:[4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,4,4,4,4,4,4,4,4,4,4,4,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5],classFactor:6,stateTable:i,charLenTable:[2,2,2,3,1,0],name:"EUC-JP"}},function(e,t,r){var o=r(9),i=r(4),n=r(60),s=r(10).GB2312DistributionAnalysis;function a(){o.apply(this);var e=this;this.getCharsetName=function(){return"GB2312"},e._mCodingSM=new i(n),e._mDistributionAnalyzer=new s,e.reset()}a.prototype=new o,e.exports=a},function(e,t,r){var o=r(0),i=[o.error,o.start,o.start,o.start,o.start,o.start,3,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.error,o.error,o.start,4,o.error,o.start,o.start,o.error,o.error,o.error,o.error,o.error,o.error,5,o.error,o.error,o.error,o.itsMe,o.error,o.error,o.error,o.start,o.start,o.start,o.start,o.start,o.start];e.exports={classTable:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0],classFactor:7,stateTable:i,charLenTable:[0,1,1,1,1,1,2],name:"GB2312"}},function(e,t,r){var o=r(4),i=r(9),n=r(10).EUCKRDistributionAnalysis,s=r(62);function a(){i.apply(this);var e=this;this.getCharsetName=function(){return"EUC-KR"},e._mCodingSM=new o(s),e._mDistributionAnalyzer=new n,e.reset()}a.prototype=new i,e.exports=a},function(e,t,r){var o=r(0),i=[o.error,o.start,3,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.error,o.error,o.start,o.start];e.exports={classTable:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0],classFactor:4,stateTable:i,charLenTable:[0,1,2,0],name:"EUC-KR"}},function(e,t,r){var o=r(4),i=r(9),n=r(10).EUCTWDistributionAnalysis,s=r(64);function a(){i.apply(this);var e=this;this.getCharsetName=function(){return"EUC-TW"},e._mCodingSM=new o(s),e._mDistributionAnalyzer=new n,e.reset()}a.prototype=new i,e.exports=a},function(e,t,r){var o=r(0),i=[o.error,o.error,o.start,3,3,3,4,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.error,o.start,o.error,o.start,o.start,o.start,o.error,o.error,o.error,o.error,o.error,5,o.error,o.error,o.error,o.start,o.error,o.start,o.start,o.start,o.error,o.start,o.start,o.start,o.start,o.start,o.start];e.exports={classTable:[2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,4,4,4,4,4,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0],classFactor:7,stateTable:i,charLenTable:[0,0,1,2,2,2,3],name:"x-euc-tw"}},function(e,t,r){var o=r(66),i=r(18),n=r(67).Win1255HebrewModel,s=r(68),a=r(69),c=r(70),h=r(71).TIS620ThaiModel,f=r(72),l=r(73);function u(){i.apply(this);var e=this;!function(){e._mProbers=[new o(a.Win1251CyrillicModel),new o(a.Koi8rModel),new o(a.Latin5CyrillicModel),new o(a.MacCyrillicModel),new o(a.Ibm866Model),new o(a.Ibm855Model),new o(c.Latin7GreekModel),new o(c.Win1253GreekModel),new o(l.Latin5BulgarianModel),new o(l.Win1251BulgarianModel),new o(f.Latin2HungarianModel),new o(f.Win1250HungarianModel),new o(h)];var t=new s,r=new o(n,!1,t),i=new o(n,!0,t);t.setModelProbers(r,i),e._mProbers.push(t,r,i),e.reset()}()}u.prototype=new i,e.exports=u},function(e,t,r){var o=r(6),i=r(0),n=r(7);function s(e,t,r){o.apply(this);var a=this;this.reset=function(){s.prototype.reset.apply(this),this._mLastOrder=255,this._mSeqCounters=[];for(var e=0;e<4;this._mSeqCounters[e++]=0);this._mTotalSeqs=0,this._mTotalChar=0,this._mFreqChar=0},this.getCharsetName=function(){return this._mNameProber?this._mNameProber.getCharsetName():this._mModel.charsetName},this.feed=function(e){this._mModel.keepEnglishLetter||(e=this.filterWithoutEnglishLetters(e));var t=e.length;if(!t)return this.getState();for(var r,o=0;o<t;o++){r=e.charCodeAt(o);var s=this._mModel.charToOrderMap[r];s<250&&this._mTotalChar++,s<64&&(this._mFreqChar++,this._mLastOrder<64&&(this._mTotalSeqs++,this._mReversed?this._mSeqCounters[this._mModel.precedenceMatrix[64*s+this._mLastOrder]]++:this._mSeqCounters[this._mModel.precedenceMatrix[64*this._mLastOrder+s]]++)),this._mLastOrder=s}if(this.getState()==i.detecting&&a._mTotalSeqs>1024){var c=this.getConfidence();c>.95?n.log(this._mModel.charsetName+" confidence = "+c+", we have a winner\n"):c<.05&&(n.log(this._mModel.charsetName+" confidence = "+c+", below negative shortcut threshhold 0.05\n"),this._mState=i.notMe)}return this.getState()},this.getConfidence=function(){var e=.01;return this._mTotalSeqs>0&&(e=1*this._mSeqCounters[3]/this._mTotalSeqs/this._mModel.mTypicalPositiveRatio,(e*=this._mFreqChar/this._mTotalChar)>=1&&(e=.99)),e},function(e,t,r){a._mModel=e,a._mReversed=t,a._mNameProber=r,a.reset()}(e,t=void 0!==t&&t,r=void 0!==r?r:null)}s.prototype=new o,e.exports=s},function(e,t){t.win1255_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,69,91,79,80,92,89,97,90,68,111,112,82,73,95,85,78,121,86,71,67,102,107,84,114,103,115,253,253,253,253,253,253,50,74,60,61,42,76,70,64,53,105,93,56,65,54,49,66,110,51,43,44,63,81,77,98,75,108,253,253,253,253,253,124,202,203,204,205,40,58,206,207,208,209,210,211,212,213,214,215,83,52,47,46,72,32,94,216,113,217,109,218,219,220,221,34,116,222,118,100,223,224,117,119,104,125,225,226,87,99,227,106,122,123,228,55,229,230,101,231,232,120,233,48,39,57,234,30,59,41,88,33,37,36,31,29,35,235,62,28,236,126,237,238,38,45,239,240,241,242,243,127,244,245,246,247,248,249,250,9,8,20,16,3,2,24,14,22,1,25,15,4,11,6,23,12,19,13,26,18,27,21,17,7,10,5,251,252,128,96,253],t.HebrewLangModel=[0,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,3,2,1,2,0,1,0,0,3,0,3,1,0,0,1,3,2,0,1,1,2,0,2,2,2,1,1,1,1,2,1,1,1,2,0,0,2,2,0,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,1,2,1,2,1,2,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,1,2,1,3,1,1,0,0,2,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,1,2,2,1,3,1,2,1,1,2,2,0,0,2,2,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,2,2,2,3,2,1,2,1,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,2,2,3,2,2,2,1,2,2,2,2,1,2,1,1,2,2,0,1,2,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,2,2,2,2,2,0,2,0,2,2,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,0,2,2,2,0,2,1,2,2,2,0,0,2,1,0,0,0,0,1,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2,1,2,3,2,2,2,1,2,1,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,2,0,2,0,2,1,2,2,2,0,0,1,2,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,2,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,2,2,3,2,1,2,1,1,1,0,1,1,1,1,1,3,0,1,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,2,3,3,3,2,1,2,3,3,2,3,3,3,3,2,3,2,1,2,0,2,1,2,0,2,0,2,2,2,0,0,1,2,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,3,3,3,3,3,3,3,3,3,2,3,3,3,1,2,2,3,3,2,3,2,3,2,2,3,1,2,2,0,2,2,2,0,2,1,2,2,2,0,0,1,2,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,2,2,2,3,3,3,3,1,3,2,2,2,0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,2,3,2,2,2,1,2,2,0,2,2,2,2,0,2,0,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,1,3,2,3,3,2,3,3,2,2,1,2,2,2,2,2,2,0,2,1,2,1,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,2,3,3,2,3,3,3,3,2,3,2,3,3,3,3,3,2,2,2,2,2,2,2,1,0,2,0,1,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,2,1,2,3,3,3,3,3,3,3,2,3,2,3,2,1,2,3,0,2,1,2,2,0,2,1,1,2,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,1,3,1,2,2,2,1,2,3,3,1,2,1,2,2,2,2,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,0,2,3,3,3,1,3,3,3,1,2,2,2,2,1,1,2,2,2,2,2,2,0,2,0,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,3,3,2,2,3,3,3,2,1,2,3,2,3,2,2,2,2,1,2,1,1,1,2,2,0,2,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,3,2,3,1,2,2,2,2,3,2,3,1,1,2,2,1,2,2,1,1,0,2,2,2,2,0,1,0,1,2,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,0,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,1,0,1,1,0,1,1,0,0,0,1,1,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,2,2,1,2,2,2,2,2,2,2,1,2,2,1,2,2,1,1,1,1,1,1,1,1,2,1,1,0,3,3,3,0,3,0,2,2,2,2,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,1,2,2,2,1,1,1,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,0,2,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,3,1,1,2,2,2,2,2,1,2,2,2,1,1,2,2,2,2,2,2,2,1,2,2,1,0,1,1,1,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,1,1,1,1,2,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,2,1,1,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,1,2,1,2,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,1,2,1,1,2,1,1,1,2,1,2,1,2,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,2,2,2,1,2,2,2,2,2,2,2,2,1,2,1,1,1,1,1,1,2,1,2,1,1,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,0,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,1,1,0,1,0,0,0,1,1,0,1,1,0,0,0,0,0,1,1,0,0,0,1,1,1,2,1,2,2,2,0,2,0,2,0,1,1,2,1,1,1,1,2,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,2,2,0,1,0,0,1,1,2,2,1,2,0,2,0,0,0,1,2,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,1,2,0,2,0,0,1,1,1,1,1,1,0,1,0,0,0,1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,2,1,1,0,1,0,0,1,1,1,2,2,0,0,1,0,0,0,1,0,0,1,1,1,2,1,0,1,1,1,0,1,0,1,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,2,2,1,0,2,0,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,1,1,0,1,0,0,0,1,1,0,1,2,0,1,0,1,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,0,1,1,2,1,1,2,0,1,0,0,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,0,0,2,1,1,2,0,2,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,1,0,1,0,0,2,2,1,2,1,1,0,1,0,0,0,1,1,0,1,2,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,2,1,1,1,0,2,1,1,0,0,0,2,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,1,1,0,2,1,1,0,1,0,0,0,1,1,0,1,2,2,1,1,1,0,1,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,1,0,1,0,0,1,1,0,1,2,1,0,2,0,0,0,1,1,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,2,0,2,1,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,1,1,1,0,1,0,0,1,0,0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,1,0,0,1,0,0,2,1,1,1,1,1,0,1,0,0,0,0,1,0,1,0,1,1,1,2,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,1,0,0],t.Win1255HebrewModel={charToOrderMap:t.win1255_CharToOrderMap,precedenceMatrix:t.HebrewLangModel,mTypicalPositiveRatio:.984004,keepEnglishLetter:!1,charsetName:"windows-1255"}},function(e,t,r){var o=r(6),i=r(0);function n(){o.apply(this);var e="ê",t="ë",r="í",n="î",s="ï",a="ð",c="ó",h="ô",f="õ",l=this;this.reset=function(){this._mFinalCharLogicalScore=0,this._mFinalCharVisualScore=0,this._mPrev=" ",this._mBeforePrev=" "},this.setModelProbers=function(e,t){this._mLogicalProber=e,this._mVisualProber=t},this.isFinal=function(t){return-1!=[e,r,s,c,f].indexOf(t)},this.isNonFinal=function(e){return-1!=[t,n,a,h].indexOf(e)},this.feed=function(e){if(this.getState()==i.notMe)return i.notMe;e=this.filterHighBitOnly(e);for(var t,r=0;r<e.length;r++)" "==(t=e[r])?" "!=this._mBeforePrev&&(this.isFinal(this._mPrev)?this._mFinalCharLogicalScore++:this.isNonFinal(this._mPrev)&&this._mFinalCharVisualScore++):" "==this._mBeforePrev&&this.isFinal(this._mPrev)&&" "!=t&&this._mFinalCharVisualScore++,this._mBeforePrev=this._mPrev,this._mPrev=t;return i.detecting},this.getCharsetName=function(){var e=this._mFinalCharLogicalScore-this._mFinalCharVisualScore;if(e>=5)return"windows-1255";if(e<=-5)return"ISO-8859-8";var t=this._mLogicalProber.getConfidence()-this._mVisualProber.getConfidence();return t>.01?"windows-1255":t<-.01?"ISO-8859-8":e<0?"ISO-8859-8":"windows-1255"},this.getState=function(){return this._mLogicalProber.getState()==i.notMe&&this._mVisualProber.getState()==i.notMe?i.notMe:i.detecting},l._mLogicalProber=null,l._mVisualProber=null,l.reset()}Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length>>>0,r=Number(arguments[1])||0;for((r=r<0?Math.ceil(r):Math.floor(r))<0&&(r+=t);r<t;r++)if(r in this&&this[r]===e)return r;return-1}),n.prototype=new o,e.exports=n},function(e,t){t.KOI8R_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,68,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,27,3,21,28,13,2,39,19,26,4,23,11,8,12,5,1,15,16,9,7,6,14,24,10,17,18,20,25,30,29,22,54,59,37,44,58,41,48,53,46,55,42,60,36,49,38,31,34,35,43,45,32,40,52,56,33,61,62,51,57,47,63,50,70],t.win1251_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,68,247,248,249,250,251,252,253,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,16],t.latin5_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,16,239,68,240,241,242,243,244,245,246,247,248,249,250,251,252,255],t.macCyrillic_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,68,16,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,255],t.IBM855_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,68,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,27,59,54,70,3,37,21,44,28,58,13,41,2,48,39,53,19,46,218,219,220,221,222,223,224,26,55,4,42,225,226,227,228,23,60,229,230,231,232,233,234,235,11,36,236,237,238,239,240,241,242,243,8,49,12,38,5,31,1,34,15,244,245,246,247,35,16,248,43,9,45,7,32,6,40,14,52,24,56,10,33,17,61,249,250,18,62,20,51,25,57,30,47,29,63,22,50,251,252,255],t.IBM866_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,16,239,68,240,241,242,243,244,245,246,247,248,249,250,251,252,255],t.RussianLangModel=[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,1,3,3,3,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,2,2,2,0,0,2,3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,2,3,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,2,2,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,2,3,3,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,2,2,2,3,1,3,3,1,3,3,3,3,2,2,3,0,2,2,2,3,3,2,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,3,3,3,2,2,3,2,3,3,3,2,1,2,2,0,1,2,2,2,2,2,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,3,0,2,2,3,3,2,1,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,1,2,3,2,2,3,2,3,3,3,3,2,2,3,0,3,2,2,3,1,1,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,2,3,3,3,3,2,2,2,0,3,3,3,2,2,2,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,2,3,2,2,0,1,3,2,1,2,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1,1,3,0,1,1,1,1,2,1,1,0,2,2,2,1,2,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,2,2,2,2,1,3,2,3,2,3,2,1,2,2,0,1,1,2,1,2,1,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,2,3,3,3,2,2,2,2,0,2,2,2,2,3,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,2,3,2,2,3,3,3,3,3,3,3,3,3,1,3,2,0,0,3,3,3,3,2,3,3,3,3,2,3,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,3,2,2,3,3,0,2,1,0,3,2,3,2,3,0,0,1,2,0,0,1,0,1,2,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,0,2,3,3,3,3,2,3,3,3,3,1,2,2,0,0,2,3,2,2,2,3,2,3,2,2,3,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,0,2,3,2,3,0,1,2,3,3,2,0,2,3,0,0,2,3,2,2,0,1,3,1,3,2,2,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,3,0,2,3,3,3,3,3,3,3,3,2,1,3,2,0,0,2,2,3,3,3,2,3,3,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,3,3,2,2,2,3,3,0,0,1,1,1,1,1,2,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,3,3,3,3,3,3,3,0,3,2,3,3,2,3,2,0,2,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,3,2,2,2,2,3,1,3,2,3,1,1,2,1,0,2,2,2,2,1,3,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,2,3,3,3,3,3,1,2,2,1,3,1,0,3,0,0,3,0,0,0,1,1,0,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,2,1,1,3,3,3,2,2,1,2,2,3,1,1,2,0,0,2,2,1,3,0,0,2,1,1,2,1,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,3,3,3,1,2,2,2,1,2,1,3,3,1,1,2,1,2,1,2,2,0,2,0,0,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,3,2,1,3,2,2,3,2,0,3,2,0,3,0,1,0,1,1,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,3,3,3,2,2,2,3,3,1,2,1,2,1,0,1,0,1,1,0,1,0,0,2,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,1,1,2,1,2,3,3,2,2,1,2,2,3,0,2,1,0,0,2,2,3,2,1,2,2,2,2,2,3,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,1,1,0,1,1,2,2,1,1,3,0,0,1,3,1,1,1,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,3,3,3,2,0,0,0,2,1,0,1,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,2,3,2,2,2,1,2,2,2,1,2,1,0,0,1,1,1,0,2,0,1,1,1,0,0,1,1,1,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,0,0,0,0,1,0,0,0,0,3,0,1,2,1,0,0,0,0,0,0,0,1,1,0,0,1,1,1,0,1,0,1,2,0,0,1,1,2,1,0,1,1,1,1,0,1,1,1,1,0,1,0,0,1,0,0,1,1,0,2,2,3,2,2,2,3,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,0,1,0,1,1,1,0,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,0,3,3,3,2,2,2,2,3,2,2,1,1,2,2,2,2,1,1,3,1,2,1,2,0,0,1,1,0,1,0,2,1,1,1,1,1,1,2,1,0,1,1,1,1,0,1,0,0,1,1,0,0,1,0,1,0,0,1,0,0,0,1,1,0,2,0,0,1,0,3,2,2,2,2,1,2,1,2,1,2,0,0,0,2,1,2,2,1,1,2,2,0,1,1,0,2,1,1,1,1,1,0,1,1,1,2,1,1,1,2,1,0,1,2,1,1,1,1,0,1,1,1,0,0,1,0,0,1,1,3,2,2,2,1,1,1,2,3,0,0,0,0,2,0,2,2,1,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,2,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,2,3,2,3,2,1,2,2,2,2,1,0,0,0,2,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,2,1,1,1,2,1,0,2,0,0,1,0,1,0,0,1,0,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,3,0,0,1,0,2,2,2,3,2,2,2,2,2,2,2,0,0,0,2,1,2,1,1,1,2,2,0,0,0,1,2,1,1,1,1,1,0,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,2,3,2,3,3,2,0,1,1,1,0,0,1,0,2,0,1,1,3,1,0,0,0,0,0,0,0,1,0,0,2,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,0,1,0,2,3,3,3,3,1,2,2,2,2,0,1,1,0,2,1,1,1,2,1,0,1,1,0,0,1,0,1,0,0,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,2,0,0,1,1,2,2,1,0,0,2,0,1,1,3,0,0,1,0,0,0,0,0,1,0,1,2,1,1,1,2,0,1,1,1,0,1,0,1,1,0,1,0,1,1,1,1,0,1,0,0,0,0,0,0,1,0,1,1,0,1,3,2,3,2,1,0,0,2,2,2,0,1,0,2,0,1,1,1,0,1,0,0,0,3,0,1,1,0,0,2,1,1,1,1,0,1,1,0,0,0,0,1,1,0,1,0,0,2,1,1,0,1,0,0,0,1,0,1,0,0,1,1,0,3,1,2,1,1,2,2,2,2,2,2,1,2,2,1,1,0,0,0,2,2,2,0,0,0,1,2,1,0,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,1,1,1,0,1,0,1,1,0,1,1,1,0,0,1,3,0,0,0,0,2,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,1,1,1,0,0,1,0,0,0,1,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,1,3,3,2,2,0,0,0,2,2,0,0,0,1,2,0,1,1,2,0,0,0,0,0,0,0,0,1,0,0,2,1,0,1,1,0,0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,2,3,2,3,2,0,0,0,0,1,1,0,0,0,2,0,2,0,2,0,0,0,0,0,1,0,0,1,0,0,1,1,1,1,2,0,1,2,1,0,1,1,2,1,1,1,1,1,2,1,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,3,2,2,2,1,0,0,2,2,1,0,1,2,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,2,3,1,2,2,2,2,2,2,1,1,0,0,0,1,0,1,0,2,1,1,1,0,0,0,0,1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,2,0,0,1,0,3,2,1,2,1,2,2,0,1,0,0,0,2,1,0,0,2,1,1,1,1,0,2,0,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,0,0,0,1,1,1,1,0,1,0,0,1,1,2,2,2,2,1,0,0,1,0,0,0,0,0,2,0,1,1,1,1,0,0,0,0,1,0,1,2,0,0,2,0,1,0,1,1,1,2,1,0,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,1,0,0,1,0,1,1,0,2,1,2,2,2,0,3,0,1,1,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,2,2,3,2,2,0,0,1,1,2,0,1,2,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,2,2,1,1,2,1,2,2,2,2,2,1,2,2,0,1,0,0,0,1,2,2,2,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,0,1,1,0,0,1,1,2,2,2,2,0,1,0,2,2,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,1,0,0,0,0,1,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,0,0,2,2,2,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,0,0,0,1,0,0,1,1,2,0,0,0,0,1,0,1,0,0,1,0,0,2,0,0,0,1,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,1,1,2,0,2,1,1,1,1,0,2,2,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,2,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,2,0,1,2,1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0],t.Koi8rModel={charToOrderMap:t.KOI8R_CharToOrderMap,precedenceMatrix:t.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"KOI8-R"},t.Win1251CyrillicModel={charToOrderMap:t.win1251_CharToOrderMap,precedenceMatrix:t.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"windows-1251"},t.Latin5CyrillicModel={charToOrderMap:t.latin5_CharToOrderMap,precedenceMatrix:t.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"ISO-8859-5"},t.MacCyrillicModel={charToOrderMap:t.macCyrillic_CharToOrderMap,precedenceMatrix:t.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"MacCyrillic"},t.Ibm866Model={charToOrderMap:t.IBM866_CharToOrderMap,precedenceMatrix:t.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"IBM866"},t.Ibm855Model={charToOrderMap:t.IBM855_CharToOrderMap,precedenceMatrix:t.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"IBM855"}},function(e,t){t.Latin7_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,82,100,104,94,98,101,116,102,111,187,117,92,88,113,85,79,118,105,83,67,114,119,95,99,109,188,253,253,253,253,253,253,72,70,80,81,60,96,93,89,68,120,97,77,86,69,55,78,115,65,66,58,76,106,103,87,107,112,253,253,253,253,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,233,90,253,253,253,253,253,253,253,253,253,253,74,253,253,253,253,253,253,247,248,61,36,46,71,73,253,54,253,108,123,110,31,51,43,41,34,91,40,52,47,44,53,38,49,59,39,35,48,250,37,33,45,56,50,84,57,120,121,17,18,22,15,124,1,29,20,21,3,32,13,25,5,11,16,10,6,30,4,9,8,14,7,2,12,28,23,42,24,64,75,19,26,27,253],t.win1253_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,82,100,104,94,98,101,116,102,111,187,117,92,88,113,85,79,118,105,83,67,114,119,95,99,109,188,253,253,253,253,253,253,72,70,80,81,60,96,93,89,68,120,97,77,86,69,55,78,115,65,66,58,76,106,103,87,107,112,253,253,253,253,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,233,61,253,253,253,253,253,253,253,253,253,253,74,253,253,253,253,253,253,247,253,253,36,46,71,73,253,54,253,108,123,110,31,51,43,41,34,91,40,52,47,44,53,38,49,59,39,35,48,250,37,33,45,56,50,84,57,120,121,17,18,22,15,124,1,29,20,21,3,32,13,25,5,11,16,10,6,30,4,9,8,14,7,2,12,28,23,42,24,64,75,19,26,27,253],t.GreekLangModel=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,2,3,3,3,3,3,3,3,3,1,3,3,3,0,2,2,3,3,0,3,0,3,2,0,3,3,3,0,3,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,0,3,3,0,3,2,3,3,0,3,2,3,3,3,0,0,3,0,3,0,3,3,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,3,2,2,3,3,3,3,3,3,3,3,0,3,3,3,3,0,2,3,3,0,3,3,3,3,2,3,3,3,0,2,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,2,1,3,3,3,3,2,3,3,2,3,3,2,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,3,3,3,3,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,2,3,3,0,2,0,1,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,0,0,0,0,3,3,0,3,1,3,3,3,0,3,3,0,3,3,3,3,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,0,3,0,3,3,3,3,3,0,3,2,2,2,3,0,2,3,3,3,3,3,2,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,2,3,3,3,3,0,3,1,3,3,3,3,2,3,3,3,3,3,3,3,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,0,3,0,0,0,3,3,2,3,3,3,3,3,0,0,3,2,3,0,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,3,0,0,3,3,0,2,3,0,3,0,3,3,3,0,0,3,0,3,0,2,2,3,3,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,0,3,2,3,3,3,3,0,3,3,3,3,3,0,3,3,2,3,2,3,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,3,2,3,3,3,3,3,3,0,2,3,2,3,2,2,2,3,2,3,3,2,3,0,2,2,2,3,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3,3,3,2,3,3,0,0,3,0,3,0,0,0,3,2,0,3,0,3,0,0,2,0,2,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,3,3,3,3,3,3,0,3,3,0,3,0,0,0,3,3,0,3,3,3,0,0,1,2,3,0,3,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,0,0,3,2,2,3,3,0,3,3,3,3,3,2,1,3,0,3,2,3,3,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,0,2,3,3,3,3,3,3,0,0,3,0,3,0,0,0,3,3,0,3,2,3,0,0,3,3,3,0,3,0,0,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,3,3,3,3,3,3,0,0,3,0,3,0,0,0,3,2,0,3,2,3,0,0,3,2,3,0,2,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,2,2,3,3,3,3,3,3,0,2,3,0,3,0,0,0,3,3,0,3,0,2,0,0,2,3,1,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,3,0,3,0,3,3,2,3,0,3,3,3,3,3,3,0,3,3,3,0,2,3,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,0,0,3,0,0,0,3,3,0,3,0,2,3,3,0,0,3,0,3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3,3,3,3,3,3,0,0,3,0,2,0,0,0,3,3,0,3,0,3,0,0,2,0,2,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,0,3,0,2,0,3,2,0,3,2,3,2,3,0,0,3,2,3,2,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,3,3,3,3,3,0,0,0,3,0,2,1,0,0,3,2,2,2,0,3,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,2,0,3,0,3,0,3,3,0,2,1,2,3,3,0,0,3,0,3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,0,3,3,3,3,3,3,0,2,3,0,3,0,0,0,2,1,0,2,2,3,0,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,3,3,3,2,3,0,0,1,3,0,2,0,0,0,0,3,0,1,0,2,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,1,0,3,0,0,0,3,2,0,3,2,3,3,3,0,0,3,0,3,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,0,0,3,0,0,0,0,2,0,2,3,3,2,2,2,2,3,0,2,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,0,0,0,0,0,0,2,3,0,2,0,2,3,2,0,0,3,0,3,0,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,3,2,2,3,0,2,0,3,0,0,0,2,0,0,0,0,1,2,0,2,0,2,0,0,2,0,2,0,2,2,0,0,1,0,2,2,2,0,2,2,2,0,2,2,2,0,0,2,0,0,1,0,0,0,0,0,2,0,3,3,2,0,0,0,0,0,0,1,3,0,2,0,2,2,2,0,0,2,0,3,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,3,2,0,2,2,0,2,0,2,2,0,2,0,2,2,2,0,0,0,0,0,0,2,3,0,0,0,2,0,1,2,0,0,0,0,2,2,0,0,0,2,1,0,2,2,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,2,1,0,2,3,2,2,3,2,3,2,0,0,3,3,3,0,0,3,2,0,0,0,1,1,0,2,0,2,2,0,2,0,2,0,2,2,0,0,2,0,2,2,2,0,2,2,2,2,0,0,2,0,0,0,2,0,1,0,0,0,0,0,3,0,3,3,2,2,0,3,0,0,0,2,2,0,2,2,2,1,2,0,0,1,2,2,0,0,3,0,0,0,2,0,1,2,0,0,0,1,2,0,0,0,0,0,0,0,2,2,0,1,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,2,2,0,0,0,2,0,2,3,3,0,2,0,0,0,0,0,0,2,2,2,0,2,2,0,2,0,2,0,2,2,0,0,2,2,2,2,1,0,0,2,2,0,2,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,3,2,3,0,0,0,3,0,0,2,2,0,2,0,2,2,2,0,0,2,0,0,0,0,0,0,0,0,2,0,0,2,2,0,0,2,2,2,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,3,2,0,2,2,2,2,2,0,0,0,2,0,0,0,0,2,0,1,0,0,2,0,1,0,0,0,0,2,2,2,0,2,2,0,1,2,0,2,2,2,0,2,2,2,2,1,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,2,0,2,2,0,0,0,0,1,2,1,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,0,0,2,0,0,0,2,2,0,2,0,0,0,1,0,0,2,0,2,0,2,2,0,0,0,0,0,0,2,0,0,0,0,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,2,3,2,2,0,0,0,0,0,0,1,3,0,2,0,2,2,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,3,2,0,2,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,1,1,0,0,2,1,2,0,2,2,0,1,0,0,1,0,0,0,2,0,0,0,0,0,0,0,3,0,2,2,2,0,0,2,0,0,0,2,0,0,0,2,3,0,2,0,0,0,0,0,0,2,2,0,0,0,2,0,1,2,0,0,0,1,2,2,1,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,2,2,0,2,0,0,2,0,0,0,0,1,2,1,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,1,2,2,0,2,0,0,0,0,2,0,0,0,2,0,0,3,0,0,0,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,2,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,2,0,2,2,0,0,2,2,2,2,2,0,1,2,0,0,0,2,2,0,1,0,2,0,0,2,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,2,0,1,2,0,0,0,0,2,2,1,0,1,0,1,0,2,2,2,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,1,2,0,0,0,0,0,0,0,0,0,0,2,0,0,2,2,0,0,0,0,1,0,0,0,0,0,0,2,0,2,2,0,0,0,0,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,2,2,2,2,0,0,0,3,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,2,0,0,0,0,1,2,0,0,0,0,0,0,2,2,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,2,2,2,0,0,2,0,0,0,0,0,0,0,2,2,2,0,0,0,2,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,2,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,2,0,0,2,0,0,0,0,2,2,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,2,1,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,0,0,0,0,2,0,0,0,0,2,0,0,2,0,0,2,0,2,2,0,0,0,0,2,0,2,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,3,0,0,0,2,2,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,2,2,2,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,1,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,2,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,2,0,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t.Latin7GreekModel={charToOrderMap:t.Latin7_CharToOrderMap,precedenceMatrix:t.GreekLangModel,mTypicalPositiveRatio:.982851,keepEnglishLetter:!1,charsetName:"ISO-8859-7"},t.Win1253GreekModel={charToOrderMap:t.win1253_CharToOrderMap,precedenceMatrix:t.GreekLangModel,mTypicalPositiveRatio:.982851,keepEnglishLetter:!1,charsetName:"windows-1253"}},function(e,t){t.TIS620CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,182,106,107,100,183,184,185,101,94,186,187,108,109,110,111,188,189,190,89,95,112,113,191,192,193,194,253,253,253,253,253,253,64,72,73,114,74,115,116,102,81,201,117,90,103,78,82,96,202,91,79,84,104,105,97,98,92,203,253,253,253,253,253,209,210,211,212,213,88,214,215,216,217,218,219,220,118,221,222,223,224,99,85,83,225,226,227,228,229,230,231,232,233,234,235,236,5,30,237,24,238,75,8,26,52,34,51,119,47,58,57,49,53,55,43,20,19,44,14,48,3,17,25,39,62,31,54,45,9,16,2,61,15,239,12,42,46,18,21,76,4,66,63,22,10,1,36,23,13,40,27,32,35,86,240,241,242,243,244,11,28,41,29,33,245,50,37,6,7,67,77,38,93,246,247,68,56,59,65,69,60,70,80,71,87,248,249,250,251,252,253],t.ThaiLangModel=[0,1,3,3,3,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,0,0,3,3,3,0,3,3,3,3,0,3,3,0,0,0,1,3,0,3,3,2,3,3,0,1,2,3,3,3,3,0,2,0,2,0,0,3,2,1,2,2,3,0,3,3,2,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,0,3,2,3,0,2,2,2,3,0,2,3,0,0,0,0,1,0,1,2,3,1,1,3,2,2,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,3,3,2,3,2,3,3,2,2,2,3,1,2,3,0,3,3,2,2,1,2,3,3,1,2,0,1,3,0,1,0,0,1,0,0,0,0,0,0,0,1,1,3,3,2,2,3,3,3,3,1,2,3,3,3,3,3,2,2,2,2,3,3,2,2,3,3,2,2,3,2,3,2,2,3,3,1,2,3,1,2,2,3,3,1,0,2,1,0,0,3,1,2,1,0,0,1,0,0,0,0,0,0,1,0,1,3,3,3,3,3,3,2,2,3,3,3,3,2,3,2,2,3,3,2,2,3,2,2,2,2,1,1,3,1,2,1,1,3,2,1,0,2,1,0,1,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,3,3,3,2,3,2,3,3,2,2,3,2,3,3,2,3,1,1,2,3,2,2,2,3,2,2,2,2,2,1,2,1,2,2,1,1,3,3,2,1,0,1,2,2,0,1,3,0,0,0,1,1,0,0,0,0,0,2,3,0,0,2,1,1,3,3,2,3,3,2,0,0,3,3,0,3,3,0,2,2,3,1,2,2,1,1,1,0,2,2,2,0,2,2,1,1,0,2,1,0,2,0,0,2,0,1,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,3,3,2,3,3,2,0,0,3,3,0,2,3,0,2,1,2,2,2,2,1,2,0,0,2,2,2,0,2,2,1,1,0,2,1,0,2,0,0,2,0,1,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,3,3,2,3,2,3,2,0,2,2,1,3,2,1,3,2,1,2,3,2,2,3,0,2,3,2,2,1,2,2,2,2,1,2,2,0,0,0,0,2,0,1,2,0,1,1,1,0,1,0,3,1,1,0,0,0,0,0,0,0,0,0,1,0,3,3,2,3,3,2,3,2,2,2,3,2,2,3,2,2,1,2,3,2,2,3,1,3,2,2,2,3,2,2,2,3,3,2,1,3,0,1,1,1,0,2,1,1,1,1,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,3,0,3,3,3,3,3,0,0,3,0,2,2,3,3,3,3,3,0,0,0,1,1,3,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,2,3,0,0,0,3,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,2,0,3,3,3,3,0,0,2,3,0,0,3,0,3,3,2,3,3,3,3,3,0,0,3,3,3,0,0,0,3,3,0,0,3,0,0,0,0,2,0,0,2,1,1,3,0,0,1,0,0,2,3,0,1,0,0,0,0,0,0,0,1,0,3,3,3,3,2,3,3,3,3,3,3,3,1,2,1,3,3,2,2,1,2,2,2,3,1,1,2,0,2,1,2,1,2,2,1,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,3,0,2,1,2,3,3,3,0,2,0,2,2,0,2,1,3,2,2,1,2,1,0,0,2,2,1,0,2,1,2,2,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,1,3,3,1,1,3,0,2,3,1,1,3,2,1,1,2,0,2,2,3,2,1,1,1,1,1,2,3,0,0,1,3,1,2,1,2,0,3,0,0,0,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,3,3,1,1,3,2,3,3,3,1,3,2,1,3,2,1,3,2,2,2,2,1,3,3,1,2,1,3,1,2,3,0,2,1,1,3,2,2,2,1,2,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,2,3,2,3,3,2,3,2,3,2,3,3,2,1,0,3,2,2,2,1,2,2,2,1,2,2,1,2,1,1,2,2,2,3,0,1,3,1,1,1,1,0,1,1,0,2,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,3,2,2,1,1,3,2,3,2,3,2,0,3,2,2,1,2,0,2,2,2,1,2,2,2,2,1,3,2,1,2,2,1,0,2,0,1,0,0,1,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,1,3,3,3,3,3,2,3,1,2,3,3,2,2,3,0,1,1,2,0,3,3,2,2,3,0,1,1,3,0,0,0,0,3,1,0,3,3,0,2,0,2,1,0,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,2,3,2,3,3,0,1,3,1,1,2,1,2,1,1,3,1,1,0,2,3,1,1,1,1,1,1,1,1,3,1,1,2,2,2,2,1,1,1,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,2,2,1,1,2,1,3,3,2,3,2,2,3,2,2,3,1,2,2,1,2,0,3,2,1,2,2,2,2,2,1,3,2,1,2,2,2,1,1,1,1,0,0,1,1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,1,3,3,0,2,1,0,3,2,0,0,3,1,0,1,1,0,1,0,0,0,0,0,1,1,0,0,1,0,3,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,2,2,3,0,0,1,3,0,3,2,0,3,2,2,3,3,3,3,3,1,0,2,2,2,0,2,2,1,2,0,2,3,0,0,0,0,1,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,0,2,3,1,3,3,2,3,3,0,3,3,0,3,2,2,3,2,3,3,3,0,0,2,2,3,0,1,1,1,3,0,0,3,0,0,0,2,2,0,1,3,0,1,2,2,2,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,3,2,3,3,2,0,3,3,2,2,3,1,3,2,1,3,2,0,1,2,2,0,2,3,2,1,0,3,0,0,0,0,3,0,0,2,3,1,3,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,3,2,2,2,1,2,0,1,3,1,1,3,1,3,0,0,2,1,1,1,1,2,1,1,1,0,2,1,0,1,1,2,0,0,0,3,1,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,0,3,1,0,0,0,1,0,3,3,3,3,2,2,2,2,2,1,3,1,1,1,2,0,1,1,2,1,2,1,3,2,0,0,3,1,1,1,1,1,3,1,0,2,3,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0,3,3,0,2,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,1,3,0,0,1,2,0,0,2,0,3,3,2,3,3,3,2,3,0,0,2,2,2,0,0,0,2,2,0,0,1,0,0,0,0,3,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,1,2,3,1,3,3,0,0,1,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,1,2,3,1,2,3,1,0,3,0,2,2,1,0,2,1,1,2,0,1,0,0,1,1,1,1,0,1,0,0,1,0,0,0,0,1,1,0,3,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,1,0,1,1,1,3,1,2,2,2,2,2,2,1,1,1,1,0,3,1,0,1,3,1,1,1,1,1,1,0,2,0,1,3,1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,3,0,2,2,1,3,3,2,3,3,0,1,1,0,2,2,1,2,1,3,3,1,0,0,3,2,0,0,0,0,2,1,0,1,0,0,0,0,1,2,0,1,1,3,1,1,2,2,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,3,0,0,3,0,3,1,0,1,1,1,3,2,0,0,0,3,0,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,3,3,1,3,2,1,3,3,1,2,2,0,1,2,1,0,1,2,0,0,0,0,0,3,0,0,0,3,0,0,0,0,3,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,2,0,3,3,3,2,2,0,1,1,0,1,3,0,0,0,2,2,0,0,0,0,3,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,3,1,2,0,0,2,1,0,3,1,0,1,2,0,1,1,1,1,3,0,0,3,1,1,0,2,2,1,1,0,2,0,0,0,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,3,1,2,0,0,2,2,0,1,2,0,1,0,1,3,1,2,1,0,0,0,2,0,3,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,1,2,2,0,0,0,2,0,2,1,0,1,1,0,1,1,1,2,1,0,0,1,1,1,0,2,1,1,1,0,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,2,0,1,3,1,1,1,1,0,0,0,0,3,2,0,1,0,0,0,1,2,0,0,0,1,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,3,2,2,0,0,0,1,0,0,0,0,2,3,2,1,2,2,3,0,0,0,2,3,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,3,3,2,2,0,1,0,0,0,0,2,0,2,0,1,0,0,0,1,1,0,0,0,2,1,0,1,0,1,1,0,0,0,1,0,2,0,0,1,0,3,0,1,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,1,0,0,1,0,0,0,0,0,1,1,2,0,0,0,0,1,0,0,1,3,1,0,0,0,0,1,1,0,0,0,1,0,0,0,0,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,3,3,1,1,1,1,2,3,0,0,2,1,1,1,1,1,0,2,1,1,0,0,0,2,1,0,1,2,1,1,0,1,2,1,0,3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,0,0,0,0,0,0,1,2,1,0,1,1,0,2,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,3,0,1,0,0,0,2,0,0,0,0,0,0,0,1,2,0,0,0,0,0,3,3,0,0,1,1,2,0,0,1,2,1,0,1,1,1,0,1,1,0,0,2,1,1,0,1,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,1,0,0,0,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0,0,1,1,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,2,0,1,2,0,0,1,1,0,2,0,1,0,0,1,0,0,0,0,1,0,0,0,2,0,0,0,0,1,0,0,1,0,1,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,1,1,0,2,1,3,0,0,0,0,1,1,0,0,0,0,0,0,0,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,1,0,0,2,0,0,2,0,0,1,1,2,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,3,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,2,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t.TIS620ThaiModel={charToOrderMap:t.TIS620CharToOrderMap,precedenceMatrix:t.ThaiLangModel,mTypicalPositiveRatio:.926386,keepEnglishLetter:!1,charsetName:"TIS-620"}},function(e,t){t.Latin2_HungarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,28,40,54,45,32,50,49,38,39,53,36,41,34,35,47,46,71,43,33,37,57,48,64,68,55,52,253,253,253,253,253,253,2,18,26,17,1,27,12,20,9,22,7,6,13,4,8,23,67,10,5,3,21,19,65,62,16,11,253,253,253,253,253,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,75,198,199,200,201,202,203,204,205,79,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,51,81,222,78,223,224,225,226,44,227,228,229,61,230,231,232,233,234,58,235,66,59,236,237,238,60,69,63,239,240,241,82,14,74,242,70,80,243,72,244,15,83,77,84,30,76,85,245,246,247,25,73,42,24,248,249,250,31,56,29,251,252,253],t.win1250HungarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,28,40,54,45,32,50,49,38,39,53,36,41,34,35,47,46,72,43,33,37,57,48,64,68,55,52,253,253,253,253,253,253,2,18,26,17,1,27,12,20,9,22,7,6,13,4,8,23,67,10,5,3,21,19,65,62,16,11,253,253,253,253,253,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,78,181,69,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,76,198,199,200,201,202,203,204,205,81,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,51,83,222,80,223,224,225,226,44,227,228,229,61,230,231,232,233,234,58,235,66,59,236,237,238,60,70,63,239,240,241,84,14,75,242,71,82,243,73,244,15,85,79,86,30,77,87,245,246,247,25,74,42,24,248,249,250,31,56,29,251,252,253],t.HungarianLangModel=[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,2,3,3,1,1,2,2,2,2,2,1,2,3,2,2,3,3,3,3,3,2,3,3,3,3,3,3,1,2,3,3,3,3,2,3,3,1,1,3,3,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,2,1,3,3,3,3,3,2,3,3,3,3,3,1,1,2,3,3,3,3,3,3,3,1,1,3,2,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,1,1,2,3,3,3,1,3,3,3,3,3,1,3,3,2,2,0,3,2,3,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,3,3,2,3,3,2,2,3,2,3,2,0,3,2,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,3,3,3,3,2,3,3,3,1,2,3,2,2,3,1,2,3,3,2,2,0,3,3,3,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,2,3,3,3,3,2,3,3,3,3,0,2,3,2,0,0,0,1,1,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,1,1,1,3,3,2,1,3,2,2,3,2,1,3,2,2,1,0,3,3,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,2,2,3,3,3,3,3,1,2,3,3,3,3,1,2,1,3,3,3,3,2,2,3,1,1,3,2,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,2,1,3,3,3,3,3,2,2,1,3,3,3,0,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,0,3,2,3,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,3,3,2,3,2,3,3,3,1,3,2,2,2,3,1,1,3,3,1,1,0,3,3,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,2,3,3,3,2,3,2,3,3,3,2,3,3,3,3,3,1,2,3,2,2,0,2,2,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,2,2,2,3,1,3,3,2,2,1,3,3,3,1,1,3,1,2,3,2,3,2,2,2,1,0,2,2,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,1,1,3,3,3,3,3,1,2,3,3,3,3,1,2,1,3,3,3,2,2,3,2,1,0,3,2,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,3,3,3,3,3,1,2,3,3,3,3,1,1,0,3,3,3,3,0,2,3,0,0,2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,3,3,2,2,2,2,3,3,0,1,2,3,2,3,2,2,3,2,1,2,0,2,2,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,3,3,3,3,3,1,2,3,3,3,2,1,2,3,3,2,2,2,3,2,3,3,1,3,3,1,1,0,2,3,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,1,2,2,2,2,3,3,3,1,1,1,3,3,1,1,3,1,1,3,2,1,2,3,1,1,0,2,2,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,2,1,2,1,1,3,3,1,1,1,1,3,3,1,1,2,2,1,2,1,1,2,2,1,1,0,2,2,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,1,1,2,1,1,3,3,1,0,1,1,3,3,2,0,1,1,2,3,1,0,2,2,1,0,0,1,3,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,2,1,3,3,3,3,3,1,2,3,2,3,3,2,1,1,3,2,3,2,1,2,2,0,1,2,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,2,2,2,2,3,1,2,2,1,1,3,3,0,3,2,1,2,3,2,1,3,3,1,1,0,2,1,3,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,2,2,2,3,2,3,3,3,2,1,1,3,3,1,1,1,2,2,3,2,3,2,2,2,1,0,2,2,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,3,3,3,3,3,0,0,3,3,2,3,0,0,0,2,3,3,1,0,1,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,2,3,3,3,3,3,1,2,3,3,2,2,1,1,0,3,3,2,2,1,2,2,1,0,2,2,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,2,1,3,1,2,3,3,2,2,1,1,2,2,1,1,1,1,3,2,1,1,1,1,2,1,0,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,3,3,1,1,1,1,1,3,3,3,0,1,1,3,3,1,1,1,1,1,2,2,0,3,1,1,2,0,2,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,1,0,1,2,1,2,2,0,1,2,3,1,2,0,0,0,2,1,1,1,1,1,2,0,0,1,1,0,0,0,0,1,2,1,2,2,2,1,2,1,2,0,2,0,2,2,1,1,2,1,1,2,1,1,1,0,1,0,0,0,1,1,0,1,1,1,2,3,2,3,3,0,1,2,2,3,1,0,1,0,2,1,2,2,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,3,3,2,2,1,0,0,3,2,3,2,0,0,0,1,1,3,0,0,1,1,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,2,2,3,3,1,0,1,3,2,3,1,1,1,0,1,1,1,1,1,3,1,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,1,2,2,2,1,0,1,2,3,3,2,0,0,0,2,1,1,1,2,1,1,1,0,1,1,1,0,0,0,1,2,2,2,2,2,1,1,1,2,0,2,1,1,1,1,1,2,1,1,1,1,1,1,0,1,1,1,0,0,1,1,3,2,2,1,0,0,1,1,2,2,0,3,0,1,2,1,1,0,0,1,1,1,0,1,1,1,1,0,2,1,1,1,2,2,1,1,1,2,1,2,1,1,1,1,1,1,1,2,1,1,1,2,3,1,1,1,1,1,1,1,1,1,0,1,2,3,3,0,1,0,0,0,3,3,1,0,0,1,2,2,1,0,0,0,0,2,0,0,1,1,1,0,2,1,1,1,2,1,1,1,1,1,1,2,1,1,0,1,1,0,1,1,1,0,1,2,1,1,0,1,1,1,1,1,1,1,0,1,2,3,3,0,1,0,0,0,2,2,0,0,0,0,1,2,2,0,0,0,0,1,0,0,1,1,0,0,2,0,1,0,2,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,0,1,3,2,2,0,1,0,1,0,2,3,2,0,0,1,2,2,1,0,0,1,1,1,0,0,2,1,0,1,2,2,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,0,2,1,0,1,1,0,1,1,1,0,1,1,2,1,1,0,1,2,2,2,0,0,1,0,0,2,2,1,1,0,0,2,1,1,0,0,0,1,2,0,0,2,1,0,0,2,1,1,1,2,1,1,1,1,2,1,2,1,1,1,2,2,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,0,1,1,2,3,0,0,0,1,0,3,2,1,0,0,1,2,1,1,0,0,0,0,2,1,0,1,1,0,0,2,1,2,1,1,1,0,0,0,1,0,1,1,1,1,1,2,0,0,1,0,0,0,2,0,0,1,1,1,1,1,1,1,1,0,1,3,0,0,2,1,2,2,1,0,0,2,1,2,2,0,0,0,2,1,1,1,0,1,1,0,0,1,1,2,0,0,0,1,2,1,2,2,1,1,2,1,2,0,1,1,1,1,1,1,1,1,1,2,1,1,0,0,1,1,1,1,0,0,1,1,3,2,0,0,0,1,0,2,2,2,0,0,0,2,2,1,0,0,0,0,3,1,1,1,1,0,0,2,1,1,1,2,1,0,1,1,1,0,1,1,1,1,1,1,1,0,2,1,0,0,1,0,1,1,0,1,1,1,1,1,1,0,1,2,3,2,0,0,0,1,0,2,2,0,0,0,0,2,1,1,0,0,0,0,2,1,0,1,1,0,0,2,1,1,0,2,1,1,1,1,2,1,2,1,2,0,1,1,1,0,2,1,1,1,2,1,1,1,1,0,1,1,1,1,1,0,1,3,1,1,2,2,2,3,2,1,1,2,2,1,1,0,1,0,2,2,1,1,1,1,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,0,0,0,0,0,2,2,0,0,0,0,2,2,1,0,0,0,1,1,0,0,1,2,0,0,2,1,1,1,2,2,1,1,1,2,1,2,1,1,0,1,1,1,1,2,1,1,1,2,1,1,1,1,0,1,2,1,1,1,0,1,1,0,0,1,2,3,2,1,0,0,2,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,0,0,0,0,0,1,2,1,2,1,2,1,1,1,2,0,2,1,1,1,0,1,2,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,3,2,0,0,0,0,0,1,1,2,1,0,0,1,1,1,0,0,0,0,2,0,0,1,1,0,0,2,1,1,1,2,1,1,1,1,1,1,2,1,0,1,1,1,1,0,2,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,1,2,2,0,1,1,1,0,2,2,2,0,0,0,3,2,1,0,0,0,1,1,0,0,1,1,0,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,0,0,1,1,1,0,1,0,1,2,1,0,2,1,1,2,2,1,1,2,1,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1,1,0,0,0,1,2,2,2,2,2,1,1,1,2,0,2,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,1,0,1,2,3,0,0,0,1,0,2,2,0,0,0,0,2,2,0,0,0,0,0,1,0,0,1,0,0,0,2,0,1,0,2,1,1,1,1,1,0,2,0,0,0,1,2,1,1,1,1,0,1,2,0,1,0,1,0,1,1,1,0,1,0,1,2,2,2,0,0,0,1,0,2,1,2,0,0,0,1,1,2,0,0,0,0,1,0,0,1,1,0,0,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,0,1,1,2,2,0,0,0,1,0,2,2,2,0,0,0,1,1,0,0,0,0,0,1,1,0,2,0,0,1,1,1,0,1,1,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,0,0,1,1,0,0,1,0,1,2,1,0,0,1,1,1,2,0,0,0,1,1,0,1,0,1,1,0,0,1,0,0,0,0,0,0,2,1,2,1,1,1,1,1,2,0,2,0,1,1,0,1,2,1,0,1,1,1,0,0,0,0,0,0,1,0,0,2,1,1,0,1,2,0,0,1,1,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,2,1,0,1,2,2,1,1,1,1,1,2,1,1,0,1,1,1,1,2,1,1,1,2,1,1,0,1,0,1,1,1,1,1,0,1,1,2,2,0,0,0,0,0,1,1,0,0,0,0,2,1,0,0,0,0,0,2,0,0,2,2,0,0,2,0,0,1,2,1,1,1,1,1,1,1,0,1,1,0,1,1,0,1,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,2,0,0,3,1,0,2,1,1,1,0,0,1,1,1,0,0,0,1,1,0,0,0,1,0,0,1,0,1,0,1,2,1,0,1,1,1,2,1,1,0,1,1,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,0,1,0,0,2,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,2,0,0,0,2,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,2,1,1,0,0,1,1,1,1,1,0,1,2,1,1,1,2,1,1,1,0,1,1,2,1,0,0,0,0,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,1,1,2,1,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,0,0,0,1,2,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1,0,0,2,0,0,0,1,1,1,1,0,0,1,1,0,0,0,0,0,1,1,1,2,0,0,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,1,2,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,0,0,2,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,0,1,0,1,0,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0],t.Latin2HungarianModel={charToOrderMap:t.Latin2_HungarianCharToOrderMap,precedenceMatrix:t.HungarianLangModel,mTypicalPositiveRatio:.947368,keepEnglishLetter:!0,charsetName:"ISO-8859-2"},t.Win1250HungarianModel={charToOrderMap:t.win1250HungarianCharToOrderMap,precedenceMatrix:t.HungarianLangModel,mTypicalPositiveRatio:.947368,keepEnglishLetter:!0,charsetName:"windows-1250"}},function(e,t){t.Latin5_BulgarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,77,90,99,100,72,109,107,101,79,185,81,102,76,94,82,110,186,108,91,74,119,84,96,111,187,115,253,253,253,253,253,253,65,69,70,66,63,68,112,103,92,194,104,95,86,87,71,116,195,85,93,97,113,196,197,198,199,200,253,253,253,253,253,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,81,226,227,228,229,230,105,231,232,233,234,235,236,45,237,238,31,32,35,43,37,44,55,47,40,59,33,46,38,36,41,30,39,28,34,51,48,49,53,50,54,57,61,239,67,240,60,56,1,18,9,20,11,3,23,15,2,26,12,10,14,6,4,13,7,8,5,19,29,25,22,21,27,24,17,75,52,241,42,16,62,242,243,244,58,245,98,246,247,248,249,250,251,91,252,253],t.win1251BulgarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,77,90,99,100,72,109,107,101,79,185,81,102,76,94,82,110,186,108,91,74,119,84,96,111,187,115,253,253,253,253,253,253,65,69,70,66,63,68,112,103,92,194,104,95,86,87,71,116,195,85,93,97,113,196,197,198,199,200,253,253,253,253,253,206,207,208,209,210,211,212,213,120,214,215,216,217,218,219,220,221,78,64,83,121,98,117,105,222,223,224,225,226,227,228,229,88,230,231,232,233,122,89,106,234,235,236,237,238,45,239,240,73,80,118,114,241,242,243,244,245,62,58,246,247,248,249,250,31,32,35,43,37,44,55,47,40,59,33,46,38,36,41,30,39,28,34,51,48,49,53,50,54,57,61,251,67,252,60,56,1,18,9,20,11,3,23,15,2,26,12,10,14,6,4,13,7,8,5,19,29,25,22,21,27,24,17,75,52,253,42,16],t.BulgarianLangModel=[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,2,2,1,2,2,3,1,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,3,3,0,3,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,1,3,3,3,3,2,2,2,1,1,2,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,2,3,2,2,3,3,1,1,2,3,3,2,3,3,3,3,2,1,2,0,2,0,3,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,1,3,3,3,3,3,2,3,2,3,3,3,3,3,2,3,3,1,3,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,1,3,3,2,3,3,3,1,3,3,2,3,2,2,2,0,0,2,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,3,3,1,2,2,3,2,1,1,2,0,2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,2,3,3,1,2,3,2,2,2,3,3,3,3,3,2,2,3,1,2,0,2,1,2,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,1,3,3,3,3,3,2,3,3,3,2,3,3,2,3,2,2,2,3,1,2,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,3,3,1,1,1,2,2,1,3,1,3,2,2,3,0,0,1,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,2,2,3,2,2,3,1,2,1,1,1,2,3,1,3,1,2,2,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,1,3,2,2,3,3,1,2,3,1,1,3,3,3,3,1,2,2,1,1,1,0,2,0,2,0,1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,2,2,3,3,3,2,2,1,1,2,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,0,1,2,1,3,3,2,3,3,3,3,3,2,3,2,1,0,3,1,2,1,2,1,2,3,2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,1,3,3,2,3,3,2,2,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,0,3,3,3,3,3,2,1,1,2,1,3,3,0,3,1,1,1,1,3,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,1,1,3,1,3,3,2,3,2,2,2,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,3,2,2,3,2,1,1,1,1,1,3,1,3,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,2,0,3,2,0,3,0,2,0,0,2,1,3,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,2,1,1,1,1,2,1,1,2,1,1,1,2,2,1,2,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,2,1,3,1,1,2,1,3,2,1,1,0,1,2,3,2,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,2,2,1,0,1,0,0,1,0,0,0,2,1,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,3,3,2,3,2,3,3,1,3,2,1,1,1,2,1,1,2,1,3,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,2,2,3,3,2,3,2,2,2,3,1,2,2,1,1,2,1,1,2,2,0,1,1,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,1,3,1,0,2,2,1,3,2,1,0,0,2,0,2,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,1,2,0,2,3,1,2,3,2,0,1,3,1,2,1,1,1,0,0,1,0,0,2,2,2,3,2,2,2,2,1,2,1,1,2,2,1,1,2,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,1,3,3,3,3,3,2,1,2,2,1,2,0,2,0,1,0,1,2,1,2,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,2,3,3,1,1,3,1,0,3,2,1,0,0,0,1,2,0,2,0,1,0,0,0,1,0,1,2,1,2,2,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,0,1,2,1,1,1,0,0,0,0,0,1,1,0,0,3,1,0,1,0,2,3,2,2,2,3,2,2,2,2,2,1,0,2,1,2,1,1,1,0,1,2,1,2,2,2,1,1,1,2,2,2,2,1,2,1,1,0,1,2,1,2,2,2,1,1,1,0,1,1,1,1,2,0,1,0,0,0,0,2,3,2,3,3,0,0,2,1,0,2,1,0,0,0,0,2,3,0,2,0,0,0,0,0,1,0,0,2,0,1,2,2,1,2,1,2,2,1,1,1,2,1,1,1,0,1,2,2,1,1,1,1,1,0,1,1,1,0,0,1,2,0,0,3,3,2,2,3,0,2,3,1,1,2,0,0,0,1,0,0,2,0,2,0,0,0,1,0,1,0,1,2,0,2,2,1,1,1,1,2,1,0,1,2,2,2,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1,1,0,0,2,3,2,3,3,0,0,3,0,1,1,0,1,0,0,0,2,2,1,2,0,0,0,0,0,0,0,0,2,0,1,2,2,2,1,1,1,1,1,2,2,2,1,0,2,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,3,3,3,3,2,2,2,2,2,0,2,1,1,1,1,2,1,2,1,1,0,2,0,1,0,1,0,0,2,0,1,2,1,1,1,1,1,1,1,2,2,1,1,0,2,0,1,0,2,0,0,1,1,1,0,0,2,0,0,0,1,1,0,0,2,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,0,0,0,0,0,1,2,0,1,2,2,2,2,1,1,2,1,1,2,2,2,1,2,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,1,1,0,0,2,3,3,3,3,0,2,2,0,2,1,0,0,0,1,1,1,2,0,2,0,0,0,3,0,0,0,0,2,0,2,2,1,1,1,2,1,2,1,1,2,2,2,1,2,0,1,1,1,0,1,1,1,1,0,2,1,0,0,0,1,1,0,0,2,3,3,3,3,0,2,1,0,0,2,0,0,0,0,0,1,2,0,2,0,0,0,0,0,0,0,0,2,0,1,2,1,1,1,2,1,1,1,1,2,2,2,0,1,0,1,1,1,0,0,1,1,1,0,0,1,0,0,0,0,1,0,0,3,3,2,2,3,0,1,0,1,0,0,0,0,0,0,0,1,1,0,3,0,0,0,0,0,0,0,0,1,0,2,2,1,1,1,1,1,2,1,1,2,2,1,2,2,1,0,1,1,1,1,1,0,1,0,0,1,0,0,0,1,1,0,0,3,1,0,1,0,2,2,2,2,3,2,1,1,1,2,3,0,0,1,0,2,1,1,0,1,1,1,1,2,1,1,1,1,2,2,1,2,1,2,2,1,1,0,1,2,1,2,2,1,1,1,0,0,1,1,1,2,1,0,1,0,0,0,0,2,1,0,1,0,3,1,2,2,2,2,1,2,2,1,1,1,0,2,1,2,2,1,1,2,1,1,0,2,1,1,1,1,2,2,2,2,2,2,2,1,2,0,1,1,0,2,1,1,1,1,1,0,0,1,1,1,1,0,1,0,0,0,0,2,1,1,1,1,2,2,2,2,1,2,2,2,1,2,2,1,1,2,1,2,3,2,2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,3,2,0,1,2,0,1,2,1,1,0,1,0,1,2,1,2,0,0,0,1,1,0,0,0,1,0,0,2,1,1,0,0,1,1,0,1,1,1,1,0,2,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,2,0,0,0,0,1,2,2,2,2,2,2,2,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,2,1,1,1,1,2,2,2,2,1,1,2,1,2,1,1,1,0,2,1,2,1,1,1,0,2,1,1,1,1,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,3,2,0,0,0,0,1,0,0,0,0,0,0,1,1,0,2,0,0,0,0,0,0,0,0,1,0,1,2,1,1,1,1,1,1,0,0,2,2,2,2,2,0,1,1,0,1,1,1,1,1,0,0,1,0,0,0,1,1,0,1,2,3,1,2,1,0,1,1,0,2,2,2,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,2,1,1,1,1,2,1,1,1,1,1,1,1,1,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,2,2,2,2,2,0,0,2,0,0,2,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,2,0,2,2,1,1,1,1,1,0,0,1,2,1,1,0,1,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,0,2,0,1,1,0,0,0,1,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,3,2,0,0,1,0,0,1,0,0,0,0,0,0,1,0,2,0,0,0,1,0,0,0,0,0,0,0,2,1,1,0,0,1,0,0,0,1,1,0,0,1,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,1,2,2,2,1,2,1,2,2,1,1,2,1,1,1,0,1,1,1,1,2,0,1,0,1,1,1,1,0,1,1,1,1,2,1,1,1,1,1,1,0,0,1,2,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,1,3,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,1,0,0,1,0,2,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,2,0,0,1,0,2,0,1,0,0,1,1,2,0,1,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,1,1,0,2,1,0,1,1,1,0,0,1,0,2,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,1,1,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,1,2,1,1,1,1,1,1,2,2,1,0,0,1,0,1,0,0,0,0,1,1,1,1,0,0,0,1,1,2,1,1,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,1,2,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,1,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,2,0,0,2,0,1,0,0,1,0,0,1,1,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,1,2,0,0,0,0,0,0,2,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],t.Latin5BulgarianModel={charToOrderMap:t.Latin5_BulgarianCharToOrderMap,precedenceMatrix:t.BulgarianLangModel,mTypicalPositiveRatio:.969392,keepEnglishLetter:!1,charsetName:"ISO-8859-5"},t.Win1251BulgarianModel={charToOrderMap:t.win1251BulgarianCharToOrderMap,precedenceMatrix:t.BulgarianLangModel,mTypicalPositiveRatio:.969392,keepEnglishLetter:!1,charsetName:"windows-1251"}},function(e,t,r){var o=r(6),i=r(0),n=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,0,1,7,1,1,1,1,1,1,5,1,5,0,5,0,0,1,1,1,1,1,1,1,1,1,7,1,7,0,7,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,5,5,4,4,4,4,4,4,4,4,5,5,4,4,4,4,4,1,4,4,4,4,4,5,5,5,6,6,6,6,6,6,7,7,6,6,6,6,6,6,6,6,7,7,6,6,6,6,6,1,6,6,6,6,6,7,7,7],s=[0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,0,3,3,3,1,1,3,3,0,3,3,3,1,2,1,2,0,3,3,3,3,3,3,3,0,3,1,3,1,1,1,3,0,3,1,3,1,1,3,3];function a(){o.apply(this);var e=this;this.reset=function(){this._mLastCharClass=1,this._mFreqCounter=[];for(var e=0;e<4;this._mFreqCounter[e++]=0);a.prototype.reset.apply(this)},this.getCharsetName=function(){return"windows-1252"},this.feed=function(e){e=this.filterWithEnglishLetters(e);for(var t=0;t<e.length;t++){var r=e.charCodeAt(t),o=n[r],a=s[8*this._mLastCharClass+o];if(0==a){this._mState=i.notMe;break}this._mFreqCounter[a]++,this._mLastCharClass=o}return this.getState()},this.getConfidence=function(){var e;if(this.getState()==i.notMe)return.01;for(var t=0,r=0;r<this._mFreqCounter.length;r++)t+=this._mFreqCounter[r];return t<.01?0:e=this._mFreqCounter[3]/t-20*this._mFreqCounter[1]/t,e<0&&(e=0),e*=.95},e.reset()}a.prototype=new o,e.exports=a},function(e,t,r){var o=r(6),i=r(4),n=r(76),s=r(0);function a(){o.apply(this);var e=this;this.reset=function(){a.prototype.reset.apply(this);for(var t,r=0;t=this._mCodingSM[r];r++)t&&(t.active=!0,t.reset());this._mActiveSM=e._mCodingSM.length,this._mDetectedCharset=null},this.getCharsetName=function(){return this._mDetectedCharset},this.getConfidence=function(){return this._mDetectedCharset?.99:0},this.feed=function(e){for(var t,r=0;r<e.length;r++){t=e[r];for(var o,i=0;o=this._mCodingSM[i];i++)if(o&&o.active){var n=o.nextState(t);if(n==s.error){if(o.active=!1,this._mActiveSM--,this._mActiveSM<=0)return this._mState=s.notMe,this.getState()}else if(n==s.itsMe)return this._mState=s.foundIt,this._mDetectedCharset=o.getCodingStateMachine(),this.getState()}}return this.getState()},e._mCodingSM=[new i(n.HZSMModel),new i(n.ISO2022CNSMModel),new i(n.ISO2022JPSMModel),new i(n.ISO2022KRSMModel)],e.reset()}a.prototype=new o,e.exports=a},function(e,t,r){var o=r(0),i=[o.start,o.error,3,o.start,o.start,o.start,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.error,o.error,o.start,o.start,4,o.error,5,o.error,6,o.error,5,5,4,o.error,4,o.error,4,4,4,o.error,4,o.error,4,o.itsMe,o.start,o.start,o.start,o.start,o.start,o.start];t.HZSMModel={classTable:[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,5,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],classFactor:6,stateTable:i,charLenTable:[0,0,0,0,0,0],name:"HZ-GB-2312"};var n=[o.start,3,o.error,o.start,o.start,o.start,o.start,o.start,o.start,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.error,o.error,o.error,4,o.error,o.error,o.error,o.error,o.itsMe,o.error,o.error,o.error,o.error,5,6,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.error,o.start];t.ISO2022CNSMModel={classTable:[2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],classFactor:9,stateTable:n,charLenTable:[0,0,0,0,0,0,0,0,0],name:"ISO-2022-CN"};var s=[o.start,3,o.error,o.start,o.start,o.start,o.start,o.start,o.start,o.start,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.error,o.error,o.error,5,o.error,o.error,o.error,4,o.error,o.error,o.error,o.error,o.error,6,o.itsMe,o.error,o.itsMe,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.error,o.error,o.error,o.itsMe,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.error,o.start,o.start];t.ISO2022JPSMModel={classTable:[2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,7,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,4,0,8,0,0,0,0,9,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],classFactor:10,stateTable:s,charLenTable:[0,0,0,0,0,0,0,0,0,0],name:"ISO-2022-JP"};var a=[o.start,3,o.error,o.start,o.start,o.start,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.itsMe,o.error,o.error,o.error,4,o.error,o.error,o.error,o.error,o.error,o.error,5,o.error,o.error,o.error,o.error,o.error,o.error,o.itsMe,o.start,o.start,o.start,o.start];t.ISO2022KRSMModel={classTable:[2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],classFactor:6,stateTable:a,charLenTable:[0,0,0,0,0,0],name:"ISO-2022-KR"}},function(e,t,r){"use strict";r.r(t);var o=r(20),i=r(21),n=r(14);let s="¥";function a(e){s=e}function c(e){const t=[];return e.forEach(e=>{-1===t.indexOf(e)&&t.push(e)}),t}function h(...e){const t={};return Object.values(e).forEach(e=>{Object.keys(e).forEach(r=>{t[r]=e[r]})}),t}function f(e){const t={};return Object.keys(e).forEach(r=>{if(t[e[r]])throw new TypeError(`字典的键值对没有唯一对应关系:${t[e[r]]}:${e[r]}与${r}:${e[r]}冲突.`);t[e[r]]=r}),t}function l(e,t,r=!0){let o=e;const i=[],n=[];return o=function e(o){let s=/[\u4E00-\u9FA5A-Za-z0-9_$-]+/;r||(s=/[\u4E00-\u9FA5A-Za-z0-9]+/);const a=o.match(s);return a?null===a.index||void 0===a.index?o:t[a[0]]?(n.push(a[0]),o.slice(0,a.index)+t[a[0]]+e(o.slice(a.index+a[0].length,o.length))):(i.push(a[0]),o.slice(0,a.index)+a[0]+e(o.slice(a.index+a[0].length,o.length))):o}(e),{content:o,success:n,fail:i}}function u(e,t,r=!0){const o=e.split(s);let i="";const n=[];let a;return Object.keys(o).forEach(e=>{const s=parseInt(e,10);s%2==0?(a=l(o[s],t,r),i+=a.content,n.push(a)):(i+=o[s],n.push(o[s]))}),{content:i,returnArray:n}}var d=r(3),p=r(2),b=r(15),m=r(12),g=r(22),y=r(5);const _=p.Readable,v=Symbol("buffer"),C=Symbol("type");class w{constructor(){this[C]="";const e=arguments[0],t=arguments[1],r=[];let o=0;if(e){const t=e,i=Number(t.length);for(let e=0;e<i;e++){const i=t[e];let n;n=i instanceof Buffer?i:ArrayBuffer.isView(i)?Buffer.from(i.buffer,i.byteOffset,i.byteLength):i instanceof ArrayBuffer?Buffer.from(i):i instanceof w?i[v]:Buffer.from("string"==typeof i?i:String(i)),o+=n.length,r.push(n)}}this[v]=Buffer.concat(r);let i=t&&void 0!==t.type&&String(t.type).toLowerCase();i&&!/[^\u0020-\u007E]/.test(i)&&(this[C]=i)}get size(){return this[v].length}get type(){return this[C]}text(){return Promise.resolve(this[v].toString())}arrayBuffer(){const e=this[v],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new _;return e._read=function(){},e.push(this[v]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],r=arguments[1];let o,i;o=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),i=void 0===r?e:r<0?Math.max(e+r,0):Math.min(r,e);const n=Math.max(i-o,0),s=this[v].slice(o,o+n),a=new w([],{type:arguments[2]});return a[v]=s,a}}function S(e,t,r){Error.call(this,e),this.message=e,this.type=t,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}let T;Object.defineProperties(w.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(w.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),S.prototype=Object.create(Error.prototype),S.prototype.constructor=S,S.prototype.name="FetchError";try{T=require("encoding").convert}catch(e){}const M=Symbol("Body internals"),O=p.PassThrough;function B(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.size;let i=void 0===o?0:o;var n=r.timeout;let s=void 0===n?0:n;null==e?e=null:E(e)?e=Buffer.from(e.toString()):x(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof p||(e=Buffer.from(String(e)))),this[M]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=s,e instanceof p&&e.on("error",(function(e){const r="AbortError"===e.name?e:new S(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[M].error=r}))}function A(){var e=this;if(this[M].disturbed)return B.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[M].disturbed=!0,this[M].error)return B.Promise.reject(this[M].error);let t=this.body;if(null===t)return B.Promise.resolve(Buffer.alloc(0));if(x(t)&&(t=t.stream()),Buffer.isBuffer(t))return B.Promise.resolve(t);if(!(t instanceof p))return B.Promise.resolve(Buffer.alloc(0));let r=[],o=0,i=!1;return new B.Promise((function(n,s){let a;e.timeout&&(a=setTimeout((function(){i=!0,s(new S(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(i=!0,s(t)):s(new S(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!i&&null!==t){if(e.size&&o+t.length>e.size)return i=!0,void s(new S(`content size at ${e.url} over limit: ${e.size}`,"max-size"));o+=t.length,r.push(t)}})),t.on("end",(function(){if(!i){clearTimeout(a);try{n(Buffer.concat(r,o))}catch(t){s(new S(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function E(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function x(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function L(e){let t,r,o=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof p&&"function"!=typeof o.getBoundary&&(t=new O,r=new O,o.pipe(t),o.pipe(r),e[M].body=t,o=r),o}function I(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":E(e)?"application/x-www-form-urlencoded;charset=UTF-8":x(e)?e.type||null:Buffer.isBuffer(e)?null:"[object ArrayBuffer]"===Object.prototype.toString.call(e)?null:ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof p?null:"text/plain;charset=UTF-8"}function P(e){const t=e.body;return null===t?0:x(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}B.prototype={get body(){return this[M].body},get bodyUsed(){return this[M].disturbed},arrayBuffer(){return A.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return A.call(this).then((function(t){return Object.assign(new w([],{type:e.toLowerCase()}),{[v]:t})}))},json(){var e=this;return A.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return B.Promise.reject(new S(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return A.call(this).then((function(e){return e.toString()}))},buffer(){return A.call(this)},textConverted(){var e=this;return A.call(this).then((function(t){return function(e,t){if("function"!=typeof T)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=t.get("content-type");let o,i,n="utf-8";r&&(o=/charset=([^;]*)/i.exec(r));i=e.slice(0,1024).toString(),!o&&i&&(o=/<meta.+?charset=(['"])(.+?)\1/i.exec(i));!o&&i&&(o=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(i),o&&(o=/charset=(.*)/i.exec(o.pop())));!o&&i&&(o=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(i));o&&(n=o.pop(),"gb2312"!==n&&"gbk"!==n||(n="gb18030"));return T(e,"UTF-8",n).toString()}(t,e.headers)}))}},Object.defineProperties(B.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),B.mixIn=function(e){for(const t of Object.getOwnPropertyNames(B.prototype))if(!(t in e)){const r=Object.getOwnPropertyDescriptor(B.prototype,t);Object.defineProperty(e,t,r)}},B.Promise=global.Promise;const N=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,k=/[^\t\x20-\x7e\x80-\xff]/;function R(e){if(e=`${e}`,N.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function j(e){if(e=`${e}`,k.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function D(e,t){t=t.toLowerCase();for(const r in e)if(r.toLowerCase()===t)return r}const F=Symbol("map");class U{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[F]=Object.create(null),e instanceof U){const t=e.raw(),r=Object.keys(t);for(const e of r)for(const r of t[e])this.append(e,r)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const r=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(t))}for(const e of r){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}}get(e){R(e=`${e}`);const t=D(this[F],e);return void 0===t?null:this[F][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=q(this),o=0;for(;o<r.length;){var i=r[o];const n=i[0],s=i[1];e.call(t,s,n,this),r=q(this),o++}}set(e,t){t=`${t}`,R(e=`${e}`),j(t);const r=D(this[F],e);this[F][void 0!==r?r:e]=[t]}append(e,t){t=`${t}`,R(e=`${e}`),j(t);const r=D(this[F],e);void 0!==r?this[F][r].push(t):this[F][e]=[t]}has(e){return R(e=`${e}`),void 0!==D(this[F],e)}delete(e){R(e=`${e}`);const t=D(this[F],e);void 0!==t&&delete this[F][t]}raw(){return this[F]}keys(){return $(this,"key")}values(){return $(this,"value")}[Symbol.iterator](){return $(this,"key+value")}}function q(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";const r=Object.keys(e[F]).sort();return r.map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[F][t].join(", ")}:function(t){return[t.toLowerCase(),e[F][t].join(", ")]})}U.prototype.entries=U.prototype[Symbol.iterator],Object.defineProperty(U.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(U.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const z=Symbol("internal");function $(e,t){const r=Object.create(H);return r[z]={target:e,kind:t,index:0},r}const H=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==H)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[z];const t=e.target,r=e.kind,o=e.index,i=q(t,r);return o>=i.length?{value:void 0,done:!0}:(this[z].index=o+1,{value:i[o],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function G(e){const t=Object.assign({__proto__:null},e[F]),r=D(e[F],"Host");return void 0!==r&&(t[r]=t[r][0]),t}Object.defineProperty(H,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const J=Symbol("Response internals"),W=b.STATUS_CODES;class Z{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B.call(this,e,t);const r=t.status||200,o=new U(t.headers);if(null!=e&&!o.has("Content-Type")){const t=I(e);t&&o.append("Content-Type",t)}this[J]={url:t.url,status:r,statusText:t.statusText||W[r],headers:o,counter:t.counter}}get url(){return this[J].url||""}get status(){return this[J].status}get ok(){return this[J].status>=200&&this[J].status<300}get redirected(){return this[J].counter>0}get statusText(){return this[J].statusText}get headers(){return this[J].headers}clone(){return new Z(L(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}B.mixIn(Z.prototype),Object.defineProperties(Z.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(Z.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const K=Symbol("Request internals"),V=m.parse,Y=m.format,X="destroy"in p.Readable.prototype;function Q(e){return"object"==typeof e&&"object"==typeof e[K]}class ee{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Q(e)?t=V(e.url):(t=e&&e.href?V(e.href):V(`${e}`),e={});let o=r.method||e.method||"GET";if(o=o.toUpperCase(),(null!=r.body||Q(e)&&null!==e.body)&&("GET"===o||"HEAD"===o))throw new TypeError("Request with GET/HEAD method cannot have body");let i=null!=r.body?r.body:Q(e)&&null!==e.body?L(e):null;B.call(this,i,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const n=new U(r.headers||e.headers||{});if(null!=i&&!n.has("Content-Type")){const e=I(i);e&&n.append("Content-Type",e)}let s=Q(e)?e.signal:null;if("signal"in r&&(s=r.signal),null!=s&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[K]={method:o,redirect:r.redirect||e.redirect||"follow",headers:n,parsedURL:t,signal:s},this.follow=void 0!==r.follow?r.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===e.compress||e.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[K].method}get url(){return Y(this[K].parsedURL)}get headers(){return this[K].headers}get redirect(){return this[K].redirect}get signal(){return this[K].signal}clone(){return new ee(this)}}function te(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}B.mixIn(ee.prototype),Object.defineProperty(ee.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(ee.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),te.prototype=Object.create(Error.prototype),te.prototype.constructor=te,te.prototype.name="AbortError";const re=p.PassThrough,oe=m.resolve;function ie(e,t){if(!ie.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return B.Promise=ie.Promise,new ie.Promise((function(r,o){const i=new ee(e,t),n=function(e){const t=e[K].parsedURL,r=new U(e[K].headers);if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof p.Readable&&!X)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(o="0"),null!=e.body){const t=P(e);"number"==typeof t&&(o=String(t))}o&&r.set("Content-Length",o),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let i=e.agent;return"function"==typeof i&&(i=i(t)),r.has("Connection")||i||r.set("Connection","close"),Object.assign({},t,{method:e.method,headers:G(r),agent:i})}(i),s=("https:"===n.protocol?g:b).request,a=i.signal;let c=null;const h=function(){let e=new te("The user aborted a request.");o(e),i.body&&i.body instanceof p.Readable&&i.body.destroy(e),c&&c.body&&c.body.emit("error",e)};if(a&&a.aborted)return void h();const f=function(){h(),d()},l=s(n);let u;function d(){l.abort(),a&&a.removeEventListener("abort",f),clearTimeout(u)}a&&a.addEventListener("abort",f),i.timeout&&l.once("socket",(function(e){u=setTimeout((function(){o(new S(`network timeout at: ${i.url}`,"request-timeout")),d()}),i.timeout)})),l.on("error",(function(e){o(new S(`request to ${i.url} failed, reason: ${e.message}`,"system",e)),d()})),l.on("response",(function(e){clearTimeout(u);const t=function(e){const t=new U;for(const r of Object.keys(e))if(!N.test(r))if(Array.isArray(e[r]))for(const o of e[r])k.test(o)||(void 0===t[F][r]?t[F][r]=[o]:t[F][r].push(o));else k.test(e[r])||(t[F][r]=[e[r]]);return t}(e.headers);if(ie.isRedirect(e.statusCode)){const n=t.get("Location"),s=null===n?null:oe(i.url,n);switch(i.redirect){case"error":return o(new S(`redirect mode is set to error: ${i.url}`,"no-redirect")),void d();case"manual":if(null!==s)try{t.set("Location",s)}catch(e){o(e)}break;case"follow":if(null===s)break;if(i.counter>=i.follow)return o(new S(`maximum redirect reached at: ${i.url}`,"max-redirect")),void d();const n={headers:new U(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout};return 303!==e.statusCode&&i.body&&null===P(i)?(o(new S("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void d()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==i.method)||(n.method="GET",n.body=void 0,n.headers.delete("content-length")),r(ie(new ee(s,n))),void d())}}e.once("end",(function(){a&&a.removeEventListener("abort",f)}));let n=e.pipe(new re);const s={url:i.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:i.size,timeout:i.timeout,counter:i.counter},h=t.get("Content-Encoding");if(!i.compress||"HEAD"===i.method||null===h||204===e.statusCode||304===e.statusCode)return c=new Z(n,s),void r(c);const l={flush:y.Z_SYNC_FLUSH,finishFlush:y.Z_SYNC_FLUSH};if("gzip"==h||"x-gzip"==h)return n=n.pipe(y.createGunzip(l)),c=new Z(n,s),void r(c);if("deflate"!=h&&"x-deflate"!=h){if("br"==h&&"function"==typeof y.createBrotliDecompress)return n=n.pipe(y.createBrotliDecompress()),c=new Z(n,s),void r(c);c=new Z(n,s),r(c)}else{e.pipe(new re).once("data",(function(e){n=8==(15&e[0])?n.pipe(y.createInflate()):n.pipe(y.createInflateRaw()),c=new Z(n,s),r(c)}))}})),function(e,t){const r=t.body;null===r?e.end():x(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(l,i)}))}ie.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},ie.Promise=global.Promise;var ne=ie,se=r(23);function ae(e){return new Promise((t,r)=>{d.readFile(e,"utf-8",(e,o)=>{e&&r(e),t(o)})})}function ce(e,t){return new Promise((r,o)=>{d.writeFile(e,t,e=>{e?o(e):r()})})}function he(e,t){return new Promise((r,o)=>{const i=[];d.readdir(e,(n,s)=>{n?o(n):Promise.all(s.map(r=>new Promise((o,n)=>{d.stat(`${e}/${r}`,(s,a)=>{if(s)n();else if(a.isDirectory())t?he(`${e}/${r}`,t).then(e=>{i.push(...e),o()}):o();else{const t=d.readFileSync(`${e}/${r}`),n=se.detect(t),s={filename:`${e}/${r}`,encoding:n.encoding,confidence:n.confidence};i.push(s),o()}})}))).then(()=>{r(i)})})})}function fe(e="https://api.github.com/repos/Orangex4/Orangex/releases/latest"){return ne(e,{method:"GET",headers:{"Content-Type":"application/octet-stream"}}).then(e=>e.buffer()).then(e=>e.toString())}function le(e="https://api.github.com/repos/Orangex4/Orangex/releases/latest"){return fe(e).then(e=>fe(JSON.parse(e).assets[0].browser_download_url))}var ue=r(1);let de,pe,be=".橙",me=!0,ge="",ye="";async function _e(){if(d.existsSync(".配置")){const e=await ae(".配置");let t;try{t=JSON.parse(e)}catch{return console.log("错误: 配置文件格式无效"),!1}try{if(t.字典文件){if(ye=t.字典文件,t.模式)switch(t.模式){case"合并":me=!0;break;case"替换":me=!1;break;default:return console.log("错误: 配置文件中模式字段无效"),!1}de=me?function(...e){const t={};return Object.values(e).forEach(e=>{Object.keys(e).forEach(r=>{"string"==typeof e[r]?t[r]=e[r]:t[r]&&"string"!=typeof t[r]?t[r]=h(t[r],e[r]):t[r]=e[r]})}),t}(JSON.parse(await ae(ge)),JSON.parse(await ae(ye))):JSON.parse(await ae(ye))}else de=JSON.parse(await ae(ge))}catch{return console.log("错误: 字典文件格式无效"),!1}return t.后缀名&&(be=t.后缀名),t.分隔符&&a(t.分隔符),pe=de.common,!0}try{de=JSON.parse(await ae(ge))}catch{return console.log("错误: 字典文件格式无效"),!1}return pe=de.common,!0}function ve(e,t){return t?`${ue.dirname(e)}/${l(ue.basename(e),pe).content}${be}`:`${ue.dirname(e)}/${l(ue.basename(e.slice(0,e.length-be.length)),pe).content}`}function Ce(e,t){return ae(e).then(e=>{const r=u(e,pe);return ce(t,r.content),r},()=>{console.log(`错误: 未找到文件"${e}"`)})}function we(e,t,r){let o=!1;return r?e.endsWith(be)&&(o=!0):e.endsWith(be)||(o=!0),e.endsWith(".忽略")&&(o=!0),e.endsWith(".配置")&&(o=!0),e.endsWith(".日志")&&(o=!0),t.replace(/\r\n/g,"\n").split("\n").forEach(t=>{if(""===t)return;const r=ue.resolve(ue.normalize(e)),i=ue.resolve(ue.normalize(t));r.startsWith(i)&&(o=!0)}),o}function Se(e,t,r,o,i=".忽略"){let n=i;const s={"失败":{}};ae(i).then(t=>(n=t,he(e,r)),()=>he(e,r)).then(r=>{const i=[];return Object.values(r).forEach(r=>{let a="";if(r.encoding&&(a=r.encoding.toLowerCase()),("utf-8"===a||"ascii"===a)&&!we(r.filename,n,t)){""===ue.extname(e)?pe=de.common:de[e.slice(1,e.length)]&&(pe=h(de.common,de[e.slice(1,e.length)])),t||(pe=f(pe)),i.push(Ce(r.filename,ve(r.filename,t)).then(e=>{console.log(`转换文件:${ue.normalize(r.filename)}`),o&&e&&(s.失败[ue.normalize(r.filename)]=[],e.returnArray.forEach(e=>{"string"!=typeof e&&(s.失败[ue.normalize(r.filename)].push(...e.fail),s.失败[ue.normalize(r.filename)]=c(s.失败[ue.normalize(r.filename)]))}))}))}}),Promise.all(i)}).then(()=>{o&&ce(".日志",JSON.stringify(s,null,2)).then(()=>console.log("输出日志成功!"),()=>console.log("输出日志失败!"))})}function Te(){le().then((function(e){a("¥");const t=JSON.parse(e).common,r=u("jsx js default if ddd ¥中文注释¥ 1数字-Head $",t);console.log("All:"),console.log(r),console.log("Content:"),console.log(r.content),console.log("Translater:"),console.log(u(r.content,f(t)).content)}))}async function Me(e,t){const r=await ae(t),s=JSON.parse(r),a=h(s.common,s.command),c=u(e,f(a),!1).content;o.exec(c,{encoding:"buffer"},(e,t,r)=>{if(e)console.log(`命令执行错误!\n命令:${c}\n错误:\n${e.message}\n翻译:\n${u(e.message,a).content}`);else if("win32"===i.platform().toString()){const e=n.decode(t,"cp936"),o=n.decode(r,"cp936"),i=u(e,a).content,s=u(o,a).content;""===e&&""===o||(console.log("---输出---"),console.log(e,o),console.log("---翻译---"),console.log(i,s))}else{const e=t.toString(),o=r.toString(),i=u(e,a).content,n=u(o,a).content;""===e&&""===o||(console.log("---输出---"),console.log(e,o),console.log("---翻译---"),console.log(i,n))}})}async function Oe(e,t,r,o){!async function(e,t,r,o){ge=t,await _e(),""===ue.extname(e)?pe=de.common:de[e.slice(1,e.length)]&&(pe=h(de.common,de[e.slice(1,e.length)])),r||(pe=f(pe)),Ce(e,ve(e,r)).then(t=>{if(o){const r={"失败":{}};t&&(r.失败[ue.normalize(e)]=[],t.returnArray.forEach(t=>{"string"!=typeof t&&(r.失败[ue.normalize(e)].push(...t.fail),r.失败[ue.normalize(e)]=c(r.失败[ue.normalize(e)]))})),ce(".日志",JSON.stringify(r,null,2)).then(()=>console.log("输出日志成功!"),()=>console.log("输出日志失败!"))}})}(e,t,r,o)}async function Be(e,t,r,o,i){!async function(e,t,r,o,i){ge=t,await _e(),Se(e,r,o,i)}(e,t,r,o,i)}function Ae(e){return le(e)}async function Ee(e,t){const r=await ae(t),o=JSON.parse(r).common;o[e]?console.log(o[e]):f(o)[e]?console.log(f(o)[e]):console.log(`错误: 未找到"${e}"的映射值`)}r.d(t,"test",(function(){return Te})),r.d(t,"replaceCommand",(function(){return Me})),r.d(t,"translaterFileWithDictFile",(function(){return Oe})),r.d(t,"translaterFileTreeWithDictFile",(function(){return Be})),r.d(t,"readDictFileByGithubRelease",(function(){return Ae})),r.d(t,"readDict",(function(){return Ee})),exports.test=Te,exports.replaceCommand=Me,exports.translaterFileTreeWithDictFile=Be,exports.translaterFileWithDictFile=Oe,exports.readDictFileByGithubRelease=Ae,exports.readDict=Ee}]);
serve_cmd.rs
//! `serve-cmd` subcommand use std::process::exit; use crate::{entrypoint, node::{client, node::Node}, prelude::app_config, server}; use abscissa_core::{Command, Options, Runnable}; #[derive(Command, Debug, Options)] pub struct ServeCmd { /// Start healthcheck runner #[options(short = "c", help = "start health check runner")] run_checks: bool,
#[options(no_short, help = "update web files for server")] update: bool } impl Runnable for ServeCmd { /// Start the application. fn run(&self) { let args = entrypoint::get_args(); let is_swarm = *&args.swarm_path.is_some(); let mut cfg = app_config().clone(); if self.update { server::update_web(&cfg.workspace.node_home); } else { let client = match client::pick_client(args.swarm_path, &mut cfg){ Ok(c) => c, Err(e) => { println!("ERROR: could not create client connection, message: {:?}", e); exit(1); }, }; let mut node = Node::new(client, &cfg, is_swarm); server::init(&mut node, self.run_checks); server::start_server(node, self.run_checks); } } }
/// Update the web files
.tape.js
module.exports = { 'basic': { message: 'supports basic usage' }, 'basic:no-preserve': { message: 'supports { preserve: false } usage', options: { preserve: false } }, 'invalid': { message: 'ignores invalid usage', expect: 'invalid.css', result: 'invalid.css' }, 'invalid:warn': { message: 'warns invalid usage when { onvalid: "warn" }', options: {
oninvalid: 'warn' }, expect: 'invalid.css', result: 'invalid.css', warnings: 10 }, 'invalid:throw': { message: 'throws invalid usage when { onvalid: "throw" }', options: { oninvalid: 'throw' }, expect: 'invalid.css', result: 'invalid.css', error: { message: /unexpected image/ } } };
counter_value.rs
{{#with Choice~}} {{>choice.getter use_old=../use_old}}
{{~else~}} {{Code}} {{~/with~}}
input.py
"""Vizio SmartCast API commands and class for device inputs.""" from typing import Any, Dict, List, Optional from pyvizio.api._protocol import ResponseKey from pyvizio.api.item import Item, ItemCommandBase, ItemInfoCommandBase from pyvizio.helpers import dict_get_case_insensitive class InputItem(Item): """Input device.""" def __init__(self, json_item: Dict[str, Any], is_extended_metadata: bool) -> None: """Initialize input device.""" super(InputItem, self).__init__(json_item) self.meta_name = None self.meta_data = None meta = dict_get_case_insensitive(json_item, ResponseKey.VALUE) if meta: if is_extended_metadata: self.meta_name = dict_get_case_insensitive(meta, ResponseKey.NAME) self.meta_data = dict_get_case_insensitive(meta, ResponseKey.METADATA) else: self.meta_name = meta if not self.meta_name: self.meta_name = self.c_name class GetInputsListCommand(ItemInfoCommandBase): """Command to get list of available inputs.""" def __init__(self, device_type: str) -> None: """Initialize command to get list of available inputs.""" super(GetInputsListCommand, self).__init__(device_type, "INPUTS") def process_response(self, json_obj: Dict[str, Any]) -> Optional[List[InputItem]]: """Return response to command to get list of available inputs.""" items = dict_get_case_insensitive(json_obj, ResponseKey.ITEMS) if items: return [ InputItem(itm, True)
return None class GetCurrentInputCommand(ItemInfoCommandBase): """Command to get currently active input.""" def __init__(self, device_type: str) -> None: """Initialize command to get currently active input.""" super(GetCurrentInputCommand, self).__init__(device_type, "CURRENT_INPUT") def process_response(self, json_obj: Dict[str, Any]) -> Optional[InputItem]: """Return response to command to get currently active input.""" items = dict_get_case_insensitive(json_obj, ResponseKey.ITEMS) v_input = None if items: v_input = InputItem(items[0], False) return v_input class ChangeInputCommand(ItemCommandBase): """Command to change active input by name.""" def __init__(self, device_type: str, id: int, name: str) -> None: """Initialize command to change active input by name.""" super(ChangeInputCommand, self).__init__(device_type, "CURRENT_INPUT", id, name)
for itm in items if dict_get_case_insensitive(itm, ResponseKey.CNAME) != "current_input" ]
countree.rs
use hdk3::prelude::*; #[hdk_entry(id = "countree")] /// a tree of counters #[derive(Default, Clone, Copy, PartialEq)] pub struct CounTree(u32); impl std::ops::Add for CounTree { type Output = Self; fn add(self, other: Self) -> Self { Self(self.0 + other.0) } } impl CounTree { #[allow(clippy::new_ret_no_self)] /// ensures that a default countree exists and returns the header pub fn new() -> ExternResult<HeaderHash>
/// commits if not exists else returns found header /// produces redundant headers in a partition pub fn ensure(countree: CounTree) -> ExternResult<HeaderHash> { match get(hash_entry(&countree)?, GetOptions)? { Some(element) => Ok(element.header_address().to_owned()), None => Ok(create_entry(&countree)?), } } pub fn header_details(header_hash: HeaderHash) -> ExternResult<GetDetailsOutput> { Ok(GetDetailsOutput::new(get_details(header_hash, GetOptions)?)) } /// return the GetDetailsOutput for the entry hash from the header pub fn entry_details(entry_hash: EntryHash) -> ExternResult<GetDetailsOutput> { Ok(GetDetailsOutput::new(get_details(entry_hash, GetOptions)?)) } /// increments the given header hash by 1 or creates it if not found /// this is silly as being offline resets the counter >.< pub fn incsert(header_hash: HeaderHash) -> ExternResult<HeaderHash> { let current: CounTree = match get(header_hash.clone(), GetOptions)? { Some(element) => match element.entry().to_app_option()? { Some(v) => v, None => return Self::new(), }, None => return Self::new(), }; Ok(update_entry(header_hash, &(current + CounTree(1)))?) } pub fn dec(header_hash: HeaderHash) -> ExternResult<HeaderHash> { Ok(delete_entry(header_hash)?) } }
{ Self::ensure(Self::default()) }
csv_storage.rs
use super::*; use csv::{Reader, Writer}; use serde::Deserialize; use std::io::Write; use std::path::Path; #[derive(Debug, Deserialize)] struct KeyValue { key: String, value: Box<[u8]>, } pub struct CSVReader {
fn put(&self, cf: &str, key: &[u8], val: &[u8]) -> Result<(), Error> { // FIXME: so dumb for now let path = Path::new(&self.path).join(format!("{}.csv", cf)); let mut file = std::fs::OpenOptions::new() .write(true) .append(true) .open(&path); if let Err(_) = file { file = std::fs::File::create(&path); } let mut f = file.map_err(|e| Error::OtherError(e.to_string()))?; f.write(key).map_err(|e| Error::OtherError(e.to_string()))?; f.write(b",") .map_err(|e| Error::OtherError(e.to_string()))?; f.write(val).map_err(|e| Error::OtherError(e.to_string()))?; f.write(b"\n") .map_err(|e| Error::OtherError(e.to_string()))?; Ok(()) } fn get_string(&self, cf: &str, key: &[u8]) -> Result<Option<String>, Error> { let path = Path::new(&self.path).join(format!("{}.csv", cf)); let key = String::from_utf8(key.to_vec()).map_err(|e| Error::OtherError(e.to_string()))?; let mut reader = Reader::from_path(path)?; for record in reader.deserialize() { let record: KeyValue = record?; if record.key == key { let res = String::from_utf8(record.value.as_ref().to_vec()) .map_err(|e| Error::OtherError(e.to_string()))?; return Ok(Some(res)); } } Ok(None) } fn get_number(&self, cf: &str, key: &[u8]) -> Result<Option<i64>, Error> { let path = Path::new(&self.path).join(format!("{}.csv", cf)); let key = String::from_utf8(key.to_vec()).map_err(|e| Error::OtherError(e.to_string()))?; let mut reader = Reader::from_path(path)?; for record in reader.deserialize() { let record: KeyValue = record?; if record.key == key { let res = i64::from_ne_bytes( record .value .as_ref() .split_at(std::mem::size_of::<i64>()) .0 .try_into() .unwrap(), ); return Ok(Some(res)); } } Ok(None) } fn get_float(&self, cf: &str, key: &[u8]) -> Result<Option<f64>, Error> { let path = Path::new(&self.path).join(format!("{}.csv", cf)); let key = String::from_utf8(key.to_vec()).map_err(|e| Error::OtherError(e.to_string()))?; let mut reader = Reader::from_path(path)?; for record in reader.deserialize() { let record: KeyValue = record?; if record.key == key { let res = f64::from_ne_bytes( record .value .as_ref() .split_at(std::mem::size_of::<f64>()) .0 .try_into() .unwrap(), ); return Ok(Some(res)); } } Ok(None) } fn delete(&self, cf: &str, _key: &[u8]) -> Result<(), Error> { let path = Path::new(&self.path).join(format!("{}.csv", cf)); let mut _writer = Writer::from_path(path)?; // FIXME: delete hasn't been supported for csv! Ok(()) } }
pub path: String, } impl KVStorage for CSVReader {
message.d.ts
export interface Message { id: string; body: string; type: string; t: number; notifyName: string; from: string; to: string; author: string; self: string; ack: number; invis: boolean; isNewMsg: boolean; star: boolean; recvFresh: boolean; interactiveAnnotations: any[]; clientUrl: string; directPath: string; mimetype: string; filehash: string; uploadhash: string; size: number; mediaKey: string; mediaKeyTimestamp: number; width: number; height: number; broadcast: boolean; mentionedJidList: any[]; isForwarded: boolean; labels: any[]; sender: Sender; timestamp: number; content: string; isGroupMsg: boolean; isMMS: boolean; isMedia: boolean; isNotification: boolean;
id: string; pendingMsgs: boolean; lastReceivedKey: LastReceivedKey; t: number; unreadCount: number; archive: boolean; isReadOnly: boolean; muteExpiration: number; name: string; notSpam: boolean; pin: number; msgs: null; kind: string; isGroup: boolean; contact: Sender; groupMetadata: null; presence: Presence; /** * @deprecated This is unreliable. Use the method {@link Whatsapp.getChatIsOnline} instead. */ isOnline: null | boolean; /** * @deprecated This is unreliable. Use the method {@link Whatsapp.getLastSeen} instead. */ lastSeen: null | number | boolean; }; /** * @deprecated This is unreliable. Use the method {@link Whatsapp.getChatIsOnline} instead. */ isOnline: null | boolean; /** * @deprecated This is unreliable. Use the method {@link Whatsapp.getLastSeen} instead. */ lastSeen: null | number | boolean; chatId: string; quotedMsgObj: null; mediaData: MediaData; } export interface Sender { id: string; name: string; shortName: string; pushname: string; type: string; isBusiness: boolean; isEnterprise: boolean; statusMute: boolean; labels: any[]; formattedName: string; isMe: boolean; isMyContact: boolean; isPSA: boolean; isUser: boolean; isWAContact: boolean; profilePicThumbObj: ProfilePicThumbObj; msgs: null; } export interface ProfilePicThumbObj { eurl: string; id: string; img: string; imgFull: string; raw: null; tag: string; } export interface LastReceivedKey { fromMe: boolean; remote: string; id: string; _serialized: string; } export interface Presence { id: string; chatstates: any[]; } export interface MediaData { type: string; mediaStage: string; animationDuration: number; animatedAsNewMsg: boolean; _swStreamingSupported: boolean; _listeningToSwSupport: boolean; }
isPSA: boolean; chat: {
windows_event_log_monitor.py
# Copyright 2105 Scalyr Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ------------------------------------------------------------------------ # author: Imron Alston <[email protected]> import datetime import os import scalyr_agent.util as scalyr_util import threading import time try: import win32api import win32evtlog import win32evtlogutil import win32con from ctypes import windll except ImportError: win32evtlog = None win32evtlogutil = None win32con = None windll = None from scalyr_agent import ScalyrMonitor, define_config_option __author__ = '[email protected]' __monitor__ = __name__ DEFAULT_SOURCES = 'Application, Security, System' DEFAULT_EVENTS = 'All' define_config_option(__monitor__, 'module', 'Always ``scalyr_agent.builtin_monitors.windows_event_log_monitor``', convert_to=str, required_option=True) define_config_option( __monitor__, 'sources', 'Optional (defaults to ``Application, Security, System``). A comma separated list of event sources.\n' 'You can use this to specify which event sources you are interested in listening to.' '(Vista and later) Cannot be used. Please use the "channels" parameter instead.', convert_to=str, default=DEFAULT_SOURCES) define_config_option(__monitor__, 'event_types', 'Optional (defaults to ``All``). A comma separated list of event types to log.\n' 'Valid values are: All, Error, Warning, Information, AuditSuccess and AuditFailure' '(Vista and later) Cannot be used. Please use the "channels" parameter instead.', default=DEFAULT_EVENTS, convert_to=str) define_config_option(__monitor__, 'channels', 'A list of dict objects specifying a list of channels and an XPath query for those channels.\n' 'Only available on Windows Vista and later.\n' 'Optional (defaults to ``[ {"channel" : ["Application", "Security", "System"], "query": "*"}]\n', convert_to=None) define_config_option(__monitor__, 'maximum_records_per_source', 'Optional (defaults to ``10000``). The maximum number of records to read from the end of each log source' 'per gather_sample.\n', default='10000', convert_to=int) define_config_option(__monitor__, 'error_repeat_interval', 'Optional (defaults to ``300``). The number of seconds to wait before logging similar errors in the event log.\n', default='300', convert_to=int) define_config_option(__monitor__, 'server_name', 'Optional (defaults to ``localhost``). The remote server where the event log is to be opened\n', default='localhost', convert_to=str) class Api( object ): def __init__( self, config, logger ): self._checkpoints = {} self._logger = logger self._server = config.get( 'server_name' ) self._error_repeat_interval = config.get( 'error_repeat_interval' ) self._maximum_records = config.get('maximum_records_per_source') @property def checkpoints( self ): return self._checkpoints def load_checkpoints( self, checkpoints ): pass def update_checkpoints( self ): pass def read_event_log( self ): pass class OldApi( Api ): def __init__( self, config, logger, source_list, event_filter ): super( OldApi, self ).__init__( config, logger ) self.__log_critical = False self.__event_types = {} for event in event_filter: if event == 'Error': self.__event_types[ win32con.EVENTLOG_ERROR_TYPE ] = event elif event == 'Warning': self.__event_types[ win32con.EVENTLOG_WARNING_TYPE ] = event elif event == 'Information': self.__event_types[ win32con.EVENTLOG_INFORMATION_TYPE ] = event elif event == 'AuditSuccess': self.__event_types[ win32con.EVENTLOG_AUDIT_SUCCESS ] = event elif event == 'AuditFailure': self.__event_types[ win32con.EVENTLOG_AUDIT_FAILURE ] = event elif event == 'Critical': # The OldApi can't read critical events so set a flag to warn the user self.__log_critical = True self.__sources = source_list def load_checkpoints( self, checkpoints ): for source, record_number in checkpoints.iteritems(): self._checkpoints[source] = record_number def read_event_log( self ): if self.__log_critical: self._logger.warn( "Critical events specified in config, but these events cannot be retrieved on Windows versions prior to Vista.", limit_once_per_x_secs=self._error_repeat_interval, limit_key="EventLogCriticalEvents" ) for source in self.__sources: self.__read_from_event_log( source, self.__event_types ) def __read_from_event_log( self, source, event_types ): event_log = win32evtlog.OpenEventLog( self._server, source ) if not event_log: self._logger.error( "Unknown error opening event log for '%s'" % source ) return #we read events in reverse from the end of the log to avoid problems when #seeking directly to a record in a large log file flags = win32evtlog.EVENTLOG_BACKWARDS_READ|win32evtlog.EVENTLOG_SEQUENTIAL_READ offset = -1 #use the checkpoint if it exists if source in self._checkpoints: offset = self._checkpoints[source] #a list of events that we haven't yet seen event_list = [] try: events = True while events: events = win32evtlog.ReadEventLog( event_log, flags, offset ) for event in events: # special case for when there was no offset, in which case # the first event will be the latest event so use that for the # new offset if offset == -1: self._checkpoints[source] = event.RecordNumber events = False break; #if we encounter our last seen record, then we are done elif offset == event.RecordNumber or len( event_list ) >= self._maximum_records: events = False break else: # add the event to our list of interested events # if it is one we are interested in if event.EventType in event_types: event_list.append( event ) except Exception, error: self._logger.error( "Error reading from event log: %s", str( error ), limit_once_per_x_secs=self._error_repeat_interval, limit_key="EventLogError" ) #now print out records in reverse order (which will put them in correct chronological order #because we initially read them in reverse) for event in reversed( event_list ): self.__log_event( source, event ) self._checkpoints[source] = event.RecordNumber def __log_event( self, source, event ): """ Emits information about an event to the logfile for this monintor """ event_type = self.__event_types[ event.EventType ] # we need to get the root source e.g. Application in Application/MyApplication # to use with SafeFormatMessage source = source.split( '/' )[0] event_message = win32evtlogutil.SafeFormatMessage( event, source ) time_format = "%Y-%m-%d %H:%M:%SZ" self._logger.emit_value( "EventLog", source, extra_fields={ 'Source': event.SourceName, 'RecordNumber': event.RecordNumber, 'TimeGenerated': time.strftime( time_format, time.gmtime(int( event.TimeGenerated ))), 'TimeWritten': time.strftime( time_format, time.gmtime(int( event.TimeWritten ))), 'Type' : event_type, 'EventId': event.EventID, 'Category': event.EventCategory, 'EventMsg' : event_message, } ) def event_callback( reason, context, event ): context.log_event_safe( event ) class NewApi( Api ): def __init__( self, config, logger, channels ): super( NewApi, self ).__init__( config, logger ) self.__eventHandles = [] if not channels: channels = [ {"channel" : ["Application", "System", "Security"], "query": "*"}] self.__bookmark_lock = threading.Lock() self.__channels = channels self.__channel_list = [] seen = {} # build a list of unique channels for info in channels: current_channels = info['channel'] for channel in current_channels: if channel not in seen: seen[channel] = 1 self.__channel_list.append( channel ) self.__bookmarks = {} def load_checkpoints( self, checkpoints ): # only use new checkpoints if 'api' not in checkpoints or checkpoints['api'] != 'new': checkpoints = {} self._checkpoints['api'] = 'new' self._checkpoints['bookmarks'] = {} if 'bookmarks' not in checkpoints: checkpoints['bookmarks'] = {} for channel, bookmarkXml in checkpoints['bookmarks'].iteritems(): self.__bookmarks[channel] = win32evtlog.EvtCreateBookmark( bookmarkXml ) # subscribe to channels for info in self.__channels: channel_list = info['channel'] query = info['query'] for channel in channel_list: self._logger.info( "subscribing to %s, %s", channel, query ) # subscribe to future events flags = win32evtlog.EvtSubscribeToFutureEvents bookmark = None try: # unless we have a bookmark for this channel self.__bookmark_lock.acquire() if channel in self.__bookmarks: flags = win32evtlog.EvtSubscribeStartAfterBookmark bookmark = self.__bookmarks[channel] finally: self.__bookmark_lock.release() self.__eventHandles.append( win32evtlog.EvtSubscribe( channel, flags, Bookmark=bookmark, Query=query, Callback=event_callback, Context=self ) ) def update_checkpoints( self ): self._checkpoints['api'] = 'new' self.__bookmark_lock.acquire() try: for channel, bookmark in self.__bookmarks.iteritems(): self._checkpoints['bookmarks'][channel] = win32evtlog.EvtRender( bookmark, win32evtlog.EvtRenderBookmark ) finally: self.__bookmark_lock.release() def _FormattedMessage( self, metadata, event, field, value ): result = value try: result = win32evtlog.EvtFormatMessage( metadata, event, field ) except: pass return result def _AddValueIfNotNullType( self, items, key, value ): if value[1] != win32evtlog.EvtVarTypeNull: items[key] = value[0] def GetFormattedEventAsDict( self, render_context, event ): vals = win32evtlog.EvtRender( event, win32evtlog.EvtRenderEventValues, Context=render_context ) result = {} event_id = vals[win32evtlog.EvtSystemEventID] qualifiers = vals[win32evtlog.EvtSystemQualifiers] metadata = None try: metadata = win32evtlog.EvtOpenPublisherMetadata( vals[win32evtlog.EvtSystemProviderName][0] ) except: pass result['Message'] = self._FormattedMessage( metadata, event, win32evtlog.EvtFormatMessageEvent, '' ) if vals[win32evtlog.EvtSystemLevel][1] != win32evtlog.EvtVarTypeNull: result['Level'] = self._FormattedMessage( metadata, event, win32evtlog.EvtFormatMessageLevel, vals[win32evtlog.EvtSystemLevel][0] ) if vals[win32evtlog.EvtSystemOpcode][1] != win32evtlog.EvtVarTypeNull: result['Opcode'] = self._FormattedMessage( metadata, event, win32evtlog.EvtFormatMessageOpcode, vals[win32evtlog.EvtSystemOpcode][0] ) if vals[win32evtlog.EvtSystemKeywords][1] != win32evtlog.EvtVarTypeNull: result['Keywords'] = self._FormattedMessage( metadata, event, win32evtlog.EvtFormatMessageKeyword, vals[win32evtlog.EvtSystemKeywords][0] ) if vals[win32evtlog.EvtSystemChannel][1] != win32evtlog.EvtVarTypeNull: result['Channel'] = self._FormattedMessage( metadata, event, win32evtlog.EvtFormatMessageChannel, vals[win32evtlog.EvtSystemChannel][0] ) result['Task'] = self._FormattedMessage( metadata, event, win32evtlog.EvtFormatMessageTask, "" ) self._AddValueIfNotNullType( result, 'ProviderName', vals[win32evtlog.EvtSystemProviderName] ) self._AddValueIfNotNullType( result, 'ProviderGuid', vals[win32evtlog.EvtSystemProviderGuid] ) self._AddValueIfNotNullType( result, 'TimeCreated', vals[win32evtlog.EvtSystemTimeCreated] ) self._AddValueIfNotNullType( result, 'RecordId', vals[win32evtlog.EvtSystemEventRecordId] ) self._AddValueIfNotNullType( result, 'ActivityId', vals[win32evtlog.EvtSystemActivityID] ) self._AddValueIfNotNullType( result, 'RelatedActivityId', vals[win32evtlog.EvtSystemRelatedActivityID] ) self._AddValueIfNotNullType( result, 'ProcessId', vals[win32evtlog.EvtSystemProcessID] ) self._AddValueIfNotNullType( result, 'ThreadId', vals[win32evtlog.EvtSystemThreadID] ) self._AddValueIfNotNullType( result, 'Computer', vals[win32evtlog.EvtSystemComputer] ) self._AddValueIfNotNullType( result, 'UserId', vals[win32evtlog.EvtSystemUserID] ) self._AddValueIfNotNullType( result, 'Version', vals[win32evtlog.EvtSystemVersion] ) return result def log_event_safe( self, event ): try: self.log_event( event ) except Exception, e: try: self._logger.info( "%s", str( e ) ) except: self._logger.info( "Error printing exception information" ) def log_event( self, event ): render_context = win32evtlog.EvtCreateRenderContext( win32evtlog.EvtRenderContextSystem ) vals = self.GetFormattedEventAsDict( render_context, event ) provider = 'not-specified' if 'ProviderName' in vals: provider = vals['ProviderName'] if 'ProviderGuid' in vals: vals['ProviderGuid'] = str( vals['ProviderGuid'] ) if 'ActivityId' in vals: vals['ActivityId'] = str( vals['ActivityId'] ) if 'RelatedActivityId' in vals: vals['RelatedActivityId'] = str( vals['RelatedActivityId'] ) if 'TimeCreated' in vals: time_format = "%Y-%m-%d %H:%M:%SZ" vals['TimeCreated'] = time.strftime( time_format, time.gmtime(int( vals['TimeCreated'] ))) if 'Keywords' in vals: if isinstance( vals['Keywords'], list ): vals['Keywords'] = ','.join( vals['Keywords'] ) else: vals['Keywords'] = str( vals['Keywords'] ) if 'UserId' in vals: user_id = str( vals['UserId'] ) if user_id.startswith( "PySID:" ): user_id = user_id[6:] vals['UserId'] = user_id self._logger.emit_value( "EventLog", provider, extra_fields=vals ) self.__bookmark_lock.acquire() try: if 'Channel' in vals: channel = vals['Channel'] bookmark = None if channel not in self.__bookmarks: self.__bookmarks[channel] = win32evtlog.EvtCreateBookmark( None ) bookmark = self.__bookmarks[channel] win32evtlog.EvtUpdateBookmark( bookmark, event ) finally: self.__bookmark_lock.release() class WindowEventLogMonitor( ScalyrMonitor ): """ # Window Event Log Monitor The Windows Event Log monitor uploads messages from the Windows Event Log to the Scalyr servers. It can listen to multiple different event sources and also filter by messages of a certain type. On versions of Windows prior to Vista, the older EventLog API is used. This API is unable to retrieve 'Critical' events because this event type was only introduced in Vista. On versions of Windows from Vista onwards, the newer Evt API is used which can be used to retrieve 'Critical' events. @class=bg-warning docInfoPanel: An *agent monitor plugin* is a component of the Scalyr Agent. To use a plugin, simply add it to the ``monitors`` section of the Scalyr Agent configuration file (``/etc/scalyr/agent.json``). For more information, see [Agent Plugins](/help/scalyr-agent#plugins). ## Sample Configuration ###Windows Vista and later On Windows Vista and later, the Scalyr agent uses the EvtLog API, and you can configure it to query events on any channel, using the standard XPath query mechanism. See: https://msdn.microsoft.com/en-us/library/windows/desktop/dd996910(v=vs.85).aspx For example, the following will configure the agent to listen to Critical, Error and Warning level events from the Application, Security and System channels: monitors: [ { module: "scalyr_agent.builtin_monitors.windows_event_log_monitor", channels: [ { "channel": [ "Application", "Security", "System" ], "query": "*[System/Level=1 or System/Level=2 or System/Level=3]" } ] } ] Alternatively, here is a configuration that will log critical errors for the Application channel, and critical, error and warning messages for System and Security channels. monitors: [ { module: "scalyr_agent.builtin_monitors.windows_event_log_monitor", channels: [ { "channel": ["Application"], "query": "*[System/Level=1]" }, { "channel": ["Security", "System" ], "query": "*[System/Level=1 or System/Level=2 or System/Level=3]" } ] }
] ###Windows Server 2003 For Windows versions earlier than Vista, the Scalyr agent will use the older Event Log API. This sample will configure the agent running on Windows Server 2003 to listen to Error and Warning level events from the Application, Security and System sources: monitors: [ { module: "scalyr_agent.builtin_monitors.windows_event_log_monitor", sources: "Application, Security, System", event_types: "Error, Warning", } ] """ def _initialize( self ): #get the checkpoint file data_path = "" if self._global_config: data_path = self._global_config.agent_data_path self.__checkpoint_file = os.path.join( data_path, "windows-event-checkpoints.json" ) sources = self._config.get( 'sources' ) event_types = self._config.get( 'event_types' ) channels = self._config.get( 'channels' ) self.__api = self.__get_api( sources, event_types, channels ) def __load_checkpoints( self ): checkpoints = None try: checkpoints = scalyr_util.read_file_as_json( self.__checkpoint_file ) except: self._logger.info( "No checkpoint file '%s' exists.\nAll logs will be read starting from their current end.", self.__checkpoint_file ) checkpoints = {} self.__api.load_checkpoints( checkpoints ) def __update_checkpoints( self ): # updatedate the api's checkpoints self.__api.update_checkpoints() # save to disk if self.__api.checkpoints: tmp_file = self.__checkpoint_file + '~' scalyr_util.atomic_write_dict_as_json_file( self.__checkpoint_file, tmp_file, self.__api.checkpoints ) def __get_api( self, sources, events, channels ): evtapi = False if windll: try: if windll.wevtapi: evtapi = True except: pass result = None #convert sources into a list source_list = [s.strip() for s in sources.split(',')] #convert event types in to a list event_filter = [s.strip() for s in events.split(',')] # build the event filter if 'All' in event_filter: event_filter = [ 'Error', 'Warning', 'Information', 'AuditSuccess', 'AuditFailure' ] if evtapi: if sources != DEFAULT_SOURCES or events != DEFAULT_EVENTS: raise Exception( "Sources and Events not supported with the new EvtLog API. Please use the 'channels' configuration option instead" ) result = NewApi( self._config, self._logger, channels ) else: if channels: raise Exception( "Channels are not supported on the older Win32 EventLog API" ) result = OldApi( self._config, self._logger, source_list, event_filter ) return result def run( self ): self.__load_checkpoints() if isinstance( self.__api, NewApi ): self._logger.info( "Using new Evt API" ) if isinstance( self.__api, OldApi ): self._logger.info( "Evt API not detected. Using older EventLog API" ) ScalyrMonitor.run( self ) def stop(self, wait_on_join=True, join_timeout=5): #stop the monitor ScalyrMonitor.stop( self, wait_on_join=wait_on_join, join_timeout=join_timeout ) #update checkpoints self.__update_checkpoints() def gather_sample( self ): self.__api.read_event_log() self.__update_checkpoints()
todo.ts
export interface ITodo { id: number; title: string; description: string; }