:' ? 'wss' : 'ws';

const notificationSocket = new WebSocket(
  `${webSocketProtocol}://${window.location.host}/ws/notifications/${userId}/`
)

notificationSocket.onopen = function(e) {
     console.log('notification websocket is opened');
     console.log(`${webSocketProtocol}://${window.location.host}/ws/notifications/${userId}/`)
}

notificationSocket.onclose = function(e) {
     console.log('notification websocket is closed');
}
console.log(document.querySelector("#notifications-div"))

notificationSocket.onmessage = function(e) {
     const data = JSON.parse(e.data);
     console.log(data);
     console.log(document.querySelector("#notifications-div"))

     var notification_span = document.createElement('span');
     notification_span.innerHTML = `<p>${data.user_from_username}</p>`;

     document.querySelector("#notifications-div").appendChild(notification_span);
};
</script>
{% endblock %}{% extends 'users/channel.html' %}

{% block channel_content %}
{% include 'users/channel-menu.html' %}

Подписчики {{owner.followers.count}}

        {% if followers %}
        {% for i in followers %}

                    {% if i.username|length > 12 %}
                       {{ i.username|slice:12 }}..
                    {% else %}
                       {{ i.username }}
                    {% endif %}

        {% endfor %}
        {% else %}
        {% endif %}

Подписки {{owner.followed_by.count}}

        {% if followed_by %}
        {% for i in followed_by %}

                    {% if i.username|length > 12 %}
                       {{ i.username|slice:12 }}..
                    {% else %}
                       {{ i.username }}
                    {% endif %}

        {% endfor %}
        {% else %}
        {% endif %}

{% if archived_articles %}
    {% for post in archived_articles %}

 {{ post.author.username }} {% include 'Articles/like_percent.html' %}

{{ post.title }}

                {% if post.content|length > 500 %}
                     {{ post.content|slice:497|truncatewords:35 }}...
                {% else %}
                     {{ post.content }}
                {% endif %}

                {% if post.photo %}
                   <img src


import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from  selenium.webdriver.common.keys import Keys

@pytest.fixture(scope='class')
def setup(request):
    driver = webdriver.Chrome()
    driver.get('https://rahulshettyacademy.com/angularpractice/')
    driver.maximize_window()
    request.cls.driver = driver
    yield
    driver.close()


lds": [
    #                 # "first_name",
    #                 # "field_4",
    #             ],
    #         },
    #     ),
    # )

@admin.register(ContactPage, site=new_admin_site)
class ContactPageAdmin(ModelAdmin):
    compressed_fields = True

class TeamMemberInline(TabularInline):
    model = TeamMember
    extra = 0

@admin.register(AboutUs, site=new_admin_site)
class AbouUsAdmin(ModelAdmin):
    compressed_fields = True
    inlines = [TeamMemberInline]
    # list_display = ['branch']

    #Waiting for Issue to be replied in Unfold Github
    formfield_overrides = {
        models.TextField: {
            "widget": WysiwygWidget,
        },
    }


ic readonly MIN_ALLOWED = 0.01

  @ValidateIf(o => (o.higherValue != null) || (o.lowerValue != null))
  @IsEmpty({ message: ValidationErrors.CANNOT_STATE_VALID_SELECTION_REQUIRED })
  cannotState?: string

  @IsOptional()
  @IsPositive({ message: ValidationErrors.LOWER_VALUE_AMOUNT_NOT_VALID })
  @Fractions(0, 2, { message: ValidationErrors.AMOUNT_INVALID_DECIMALS })
  @Min(Amount.MIN_ALLOWED, { message: ValidationErrors.LOWER_VALUE_AMOUNT_NOT_VALID })
  @IsLessThanOrEqualTo('higherValue', { message: ValidationErrors.LOWER_VALUE_LESS_THAN_UPPER_NOT_VALID })
  lowerValue?: number

  @ValidateIf(o => o.cannotState == null)
  @IsAmountRangeDefined('cannotState', { message: ValidationErrors.VALID_SELECTION_REQUIRED })
  @IsAmountRangeNumber('cannotState', { message: ValidationErrors.HIGHER_VALUE_AMOUNT_NOT_VALID })
  @Fractions(0, 2, { message: ValidationErrors.AMOUNT_INVALID_DECIMALS })
  @MinAmountRange(Amount.MIN_ALLOWED, 'cannotState', { message: ValidationErrors.HIGHER_VALUE_AMOUNT_NOT_VALID })
  @MaxRangeAmount(Amount.MAX_ALLOWED, 'cannotState', { message: ValidationErrors.HIGHER_VALUE_AMOUNT_NOT_VALID })
  @IsSelectedAlong('cannotState', 'lowerValue', { message: ValidationErrors.VALID_SELECTION_REQUIRED })
  higherValue?: number

  constructor (lowerValue?: any, higherValue?: any, cannotState?: string) {
    this.lowerValue = lowerValue
    this.higherValue = higherValue
    this.cannotState = cannotState
  }

  static translateToNumber (input?: any): any {
    const numberValue = _.toNumber(input)
    const isExponential = numberValue.toString().match(new RegExp('\\d*[Ee][+-]?\\d*?'))

    if (!isNaN(numberValue) && !isExponential) {
      return numberValue
    } else {
      return input
    }
  }

  static fromObject (value?: any): Amount {
    if (!value) {
      return new Amount()
    }

    // change to undefined after class-validator version > 0.7.2 is released
    const lowerValue = value.lowerValue ? Amount.translateToNumber(value.lowerValue.replace(new RegExp(/,/g), '')) : null
    const higherValue = value.higherValue ? Amount.translateToNumber(value.higherValue.replace(new RegExp(/,/g), '')) : undefined
    const cannotState = value.cannotState ? value.cannotState : undefined

    return new Amount(lowerValue, higherValue, cannotState)
  }

  deserialize (input?: any): Amount {
    if (input) {
      this.lowerValue = input.lowerValue
      this.higherValue = input.higherValue
      this.cannotState = input.cannotState
    }

    return this
  }

  canNotState (): boolean {
    return this.cannotState === Amount.CANNOT_STATE_VALUE
  }

}
/**
 * Functions for setting className on DOM Elements
 */

import { isString } from "./isString";
import { escapeHtml } from "./escape";

/**
 * Keep only strings
 */
const filterClasses = (classes: unknown[]): string[] =>
  classes
    .filter(isString)
    .reduce((memo, cls) => [...memo, ...cls.split(/\s+/g)], [] as string[]);

export const addClass = (el: Element, ...classes: unknown[]): void =>
  // iterate, because classList.add does not support multiple arguments in IE
  filterClasses(classes).forEach((cls) => el.classList.add(cls));

export const removeClass = (el: Element, ...classes: unknown[]): void =>
  // iterate, because classList.remove does not support multiple arguments in IE
  filterClasses(classes).forEach((cls) => el.classList.remove(cls));

/**
 * Returns html-safe string, that can be passed to inner


angle2)).toBeFalsy;
      });
    });
  });

  describe('doesRectAndLineCollide', () => {
    const rectangle1 = new Rect(9, 9, 1, 1);

    describe('line and colliding rectangles', () => {
      const line = new Line(10, 10, 20);
      it('should return true', () => {
        expect(rectangle1.collides(line)).toBeTruthy;
      });
    });
  });

  describe('doesLineAndLineCollide', () => {
    const line1 = new Line(9, 9, 10);

    describe('two colliding Lines', () => {
      const line2 = new Line(10, 10, 20);
      it('should return true', () => {
        expect(line1.collides(line2)).toBeTruthy;
      });
    });
  });
});
export class AppareilService {
    appareils =[
        {
          name:'Télévision',
          status : 'éteint'

        },
        {
          name:'Machine à laver',
          status:'éteint'
        },
        {
          name:'Téléphone',
          status:'allumé'
        }
      ];

    switchOnAll() {
        for(let appareil of this.appareils){
            appareil.status='allumé';
        }
    }

    switchOffAll(){
        for(let appareil of this.appareils){
            appareil.status='éteint';
        }
    }

    switcOnOne(i:number){
        this.appareils[i].status==='allumé';
    }

    switcOffOne(i:number){
        this.appareils[i].status==='éteint';
    }

}/**
 * Generates a random number between `min` and `max`.
 * @param min min ≤ R
 * @param max max ≥ R
 * @param decimals Number of decimals to return
 */
export declare function random(min: number, max: number, decimals?: number): number;
/**
 * Generates a random integer between `min` and `max`.
 * @param min min ≤ R
 * @param max max ≥ R
 */
export declare function randomInteger(min: number, max: number): number;
import { isBefore } from "date-fns";
import Fuse from "fuse.js";
import { connect } from "react-redux";
import { IArticle } from "../../reducers/articles";
import component from "./component";

const getSearchedArticles = (articles: IArticle[], search: string) => {
  if (!search) {
    return articles;
  }
  const options = {
    distance: articles.length,
    keys: [
      "metadata.title",
      "metadata.excerpt",
      "metadata.ogDescription",
      "metadata.siteName",
      "link",
      "projects"
    ],
    location: 0,
    maxPatternLength: 32,
    minMatchCharLength: 1,
    shouldSort: false,
    threshold: 0.4,
    tokenize: true
  };
  const fuse = new Fuse(
    articles.map((t: IArticle) => {
      return {
        ...t,
        metadata: t.metadata
      };
    }),
    options as any
  );
  return fuse.search(search);
};

const getSortedArticles = (articles: IArticle[], sort: string) => {
  return [...articles].sort((a: IArticle, b: IArticle) => {
    const aTitle =
      a.metadata && (a.metadata.title || a.metadata.ogTitle)
        ? a.metadata.title || a.metadata.ogTitle
        : a.url;

    const bTitle =
      b.metadata && (b.metadata.title || b.metadata.ogTitle)
        ? b.metadata.title || b.metadata.ogTitle
        : b.url;
    switch (sort) {
      case "title":
        return aTitle.localeCompare(bTitle);
      case "date":
        return isBefore(a.addedAt, b.addedAt) ? 1 : -1;
      case


COUNT + 0;

	/**
     * The feature id for the 'Value Expr' containment reference.
     *
	 *
     * @generated
     * @ordered
     */
	int VALUE_EXPRESSION_CASE_SIMPLE__VALUE_EXPR = VALUE_EXPRESSION_CASE_FEATURE_COUNT + 1;

	/**
     * The number of structural features of the 'Value Expression Case Simple' class.
     *
	 *
     * @generated
     * @ordered
     */
	int VALUE_EXPRESSION_CASE_SIMPLE_FEATURE_COUNT = VALUE_EXPRESSION_CASE_FEATURE_COUNT + 2;

	/**
     * The meta object id for the '{@link org.eclipse.datatools.modelbase.sql.query.impl.ValueExpressionCaseElseImpl Value Expression Case Else}' class.
     *
	 *
     * @see org.eclipse.datatools.modelbase.sql.query.impl.ValueExpressionCaseElseImpl
     * @see org.eclipse.datatools.modelbase.sql.query.impl.SQLQueryModelPackageImpl#getValueExpressionCaseElse()
     * @generated
     */
	int VALUE_EXPRESSION_CASE_ELSE = 61;

	/**
     * The feature id for the 'EAnnotations' containment reference list.
     *
	 *
     * @generated
     * @ordered
     */
	int VALUE_EXPRESSION_CASE_ELSE__EANNOTATIONS = SQL_QUERY_OBJECT__EANNOTATIONS;

	/**
     * The feature id for the 'Name' attribute.
     *
	 *
     * @generated
     * @ordered
     */
	int VALUE_EXPRESSION_CASE_ELSE__NAME = SQL_QUERY_OBJECT__NAME;

	/**
     * The feature id for the 'Dependencies' containment reference list.
     *
	 *
     * @generated
     * @ordered
     */
	int VALUE_EXPRESSION_CASE_ELSE__DEPENDENCIES = SQL_QUERY_OBJECT__DEPENDENCIES;

	/**
     * The feature id for the 'Description' attribute.
     *
	 *
     * @generated
     * @ordered
     */
	int VALUE_EXPRESSION_CASE_ELSE__DESCRIPTION = SQL_QUERY_OBJECT__DESCRIPTION;

	/**
     * The feature id for the 'Label' attribute.
     *
	 *
     * @generated
     * @ordered
     */
	int VALUE_EXPRESSION_CASE_ELSE__LABEL = SQL_QUERY_OBJECT__LABEL;

	/**
     * The feature id for the 'Comments' reference list.
     *
	 *
     * @generated
     * @ordered
     */
	int VALUE_EXPRESSION_CASE_ELSE__COMMENTS = SQL_QUERY_OBJECT__COMMENTS;

	/**
     * The feature id for the 'Extensions' containment reference list.
     *
     *
     * @generated
     * @ordered
     */
    int VALUE_EXPRESSION_CASE_ELSE__EXTENSIONS = SQL_QUERY_OBJECT__EXTENSIONS;

    /**
     * The feature id for the 'Privileges' reference list.
     *
	 *


File, info);
      return receiveInstance(result[0]);
    }
    class ExitStatus {
      name = "ExitStatus";
      constructor(status) {
        this.message = `Program terminated with exit(${status})`;
        this.status = status;
      }
    }
    var callRuntimeCallbacks = callbacks => {
      while (callbacks.length > 0) {
        callbacks.shift()(Module);
      }
    };
    var noExitRuntime = Module["noExitRuntime"] || true;
    var __abort_js = () => abort("");
    var __emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num);
    var runtimeKeepaliveCounter = 0;
    var __emscripten_runtime_keepalive_clear = () => {
      noExitRuntime = false;
      runtimeKeepaliveCounter = 0;
    };
    var timers = {};
    var handleException = e => {
      if (e instanceof ExitStatus || e == "unwind") {
        return EXITSTATUS;
      }
      quit_(1, e);
    };
    var keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0;
    var _proc_exit = code => {
      EXITSTATUS = code;
      if (!keepRuntimeAlive()) {
        Module["onExit"]?.(code);
        ABORT = true;
      }
      quit_(code, new ExitStatus(code));
    };
    var exitJS = (status, implicit) => {
      EXITSTATUS = status;
      _proc_exit(status);
    };
    var _exit = exitJS;
    var maybeExit = () => {
      if (!keepRuntimeAlive()) {
        try {
          _exit(EXITSTATUS);
        } catch (e) {
          handleException(e);
        }
      }
    };
    var callUserCallback = func => {
      if (ABORT) {
        return;
      }
      try {
        func();
        maybeExit();
      } catch (e) {
        handleException(e);
      }
    };
    var _emscripten_get_now = () => performance.now();
    var __setitimer_js = (which, timeout_ms) => {
      if (timers[which]) {
        clearTimeout(timers[which].id);
        delete timers[which];
      }
      if (!timeout_ms) return 0;
      var id = setTimeout(() => {
        delete timers[which];
        callUserCallback(() => __emscripten_timeout(which, _emscripten_get_now()));
      }, timeout_ms);
      timers[which] = {
        id,
        timeout_ms
      };
      return 0;
    };
    function _copy_pixels_1(compG_ptr, nb_pixels) {
      compG_ptr >>= 2;
      const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels);
      const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
      imageData.set(compG);
    }
    function _copy_pixels_3(compR_ptr, compG_ptr, compB_ptr, nb_pixels) {
      compR_ptr >>= 2;
      compG_ptr >>= 2;
      compB_ptr >>= 2;
      const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 3);
      const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr


class="" href="/blog/links.html">links
        projects
        feed

工欲善其事，必先利其器。作为更专业的前端工程师，我们需要强劲的IDE协助我们写出规范、美观、漂亮的JavaScript代码，首先要作的就是对代码进行合法性检查，而通过 www.jslint.com 进行手工操作又显得碍手碍脚。为了提高效率，这里推荐使用 jsLint + Vim(gVim)，能够协助你达到事半功倍的效果。

首先，和 JavaScriptLint 不同[注1]，jsLint 是需要 JavaScript 引擎的支持的，linux中可选的有基于 C 语言的 Spidermonkey 和基于 Java 的 Rhino，考虑到速度，推荐使用 Spidermonkey。另外，jsLint.vim 初始配置挂载的监听有些冗余，这会导致 Vim 运行很慢，影响编码的效率，这里我 hack 了一份 jslint.vim，只用F4键就可以开启/关闭语法检查，下面介绍配置方法（linux & windows）。

jsLint + vim for Linux

1，准备JS引擎

linux 下默认没有  JavaScript 引擎，需要安


: 1, // enemies target players (0), friendlies target enemies (1)
                NodeAiTarget.Friendly => friendlyType == 1 ? 0 : 1, // enemies target enemies (1), friendlies target players (0)
                _ => friendlyType
            };
        }

        return friendlyType;
    }

    private void FindNewTarget() {
        int friendlyType = GetTargetType();
        float sightSquared = actor.Value.Metadata.Distance.Sight;
        float sightHeightUp = actor.Value.Metadata.Distance.SightHeightUp;
        float sightHeightDown = actor.Value.Metadata.Distance.SightHeightDown;

        sightSquared *= sightSquared;

        IActor? nextTarget = null;
        float nextTargetDistance = float.MaxValue;
        List<(float, IActor)>? candidates = null;

        if (TargetType == NodeTargetType.RandAssociated || TargetType == NodeTargetType.Mid) {
            candidates = new List<(float, IActor)>();
        }

        if (friendlyType == 0) {
            foreach (FieldPlayer player in actor.Field.Players.Values) {
                if (ShouldTargetActor(player, sightSquared, sightHeightUp, sightHeightDown, ref nextTargetDistance, ca


../../settings/providers.dart';
import '../../../manage/providers.dart';
import '../types/booru_config.dart';

final hasBooruConfigsProvider = Provider<bool>((ref) {
  final configs = ref.watch(booruConfigProvider);
  return configs.isNotEmpty;
});

final orderedConfigsProvider = FutureProvider.autoDispose<IList<BooruConfig>>((
  ref,
) {
  final configs = ref.watch(booruConfigProvider);

  final configMap = {for (final config in configs) config.id: config};
  final orders = ref.watch(
    settingsProvider.select((value) => value.booruConfigIdOrderList),
  );

  if (configMap.length != orders.length) {
    return configMap.values.toIList();
  }

  try {
    return orders.map((e) => configMap[e]!).toIList();
  } catch (e) {
    return configMap.values.toIList();
  }
});

final firstMatchingConfigProvider =
    Provider.family<BooruConfig?, (int, String)>(
      (ref, params) {
        final (id, url) = params;
        final configs = ref.watch(booruConfigProvider);
        final idResult = configs
            .where(
              (config) => config.auth.booruIdHint == id || config.booruId == id,
            )
            .toList();

        if (idResult.isEmpty) {
          return null;
        }

        final config = idResult.firstWhereOrNull((config) {
          final authUrl = config.auth.url.endsWith('/')
              ? config.auth.url.substring(0, config.auth.url.length - 1)
              : config.auth.url;

          return url.contains(authUrl);
        });

        return config ?? idResult.firstOrNull;
      },
    );

final booruLoginDetailsProvider =
    Provider.family<BooruLoginDetails, BooruConfigAuth>(
      (ref, config) {
        final repo = ref
            .watch(booruEngineRegistryProvider)
            .getRepository(config.booruType);

        final loginDetails = repo?.loginDetails(config);

        if (loginDetails != null) {
          return loginDetails;
        }

        return DefaultBooruLoginDetails(
          login: config.login,
          apiKey: config.apiKey,
          url: config.url,
        );
      },
    );

final defaultLoginDetailsProvider =
    Provider.family<BooruLoginDetails, BooruConfigAuth>(
      (ref, config) {
        return DefaultBooruLoginDetails(
          login: config.login,
          apiKey: config.apiKey,
          url: config.url,
        );
      },
    );
// Flutter imports:
import 'package:flutter/material.dart';

// Package imports:
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:i18n/i18n.dart';

// Project imports:
import '../../../settings/settings.dart';
import '../../../settings/widgets.dart';
import '../../../widgets/widgets.dart';
import '../../config/types.dart';
import '../../create/providers.dart';
import 'create_booru_image_details_resolution_option_tile.dart';

class BooruConfigViewerView extends ConsumerWidget {
  const BooruConfigViewerView({
    super.key,
    this.postDetailsResolution,
    this.autoLoadNotes,
    this.videoQuality,
  });

  final Widget? postDetailsResolution;
  final Widget? autoLoadNotes;
  final Widget? videoQuality;

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final config = ref.watch(
      editBooruConfigProvider(ref.watch(editBooruConfigIdProvider)),
    );
    final viewerConfig = config.viewerTyped;
    final viewerEnabled = viewerConfig?.enable ?? false;

    return SingleChildScrollView(
      padding: const EdgeInsets.symmetric(horizontal: 12),
      child: Theme(
        data: Theme.of(context).copyWith(
          listTileTheme: Theme.of(context).listTile


Hours);
			ini.SetValue("Alarms", "FtpAlarmAction", FtpAlarm.Action);
			ini.SetValue("Alarms", "FtpAlarmActionParams", FtpAlarm.ActionParams);
			ini.SetValue("Alarms", "FtpAlarmBlueskyFile", FtpAlarm.BskyFile);

			ini.SetValue("Alarms", "ErrorAlarmSet", ErrorAlarm.Enabled);
			ini.SetValue("Alarms", "ErrorAlarmSound", ErrorAlarm.Sound);
			ini.SetValue("Alarms", "ErrorAlarmSoundFile", ErrorAlarm.SoundFile);
			ini.SetValue("Alarms", "ErrorAlarmNotify", ErrorAlarm.Notify);
			ini.SetValue("Alarms", "ErrorAlarmEmail", ErrorAlarm.Email);
			ini.SetValue("Alarms", "ErrorAlarmAction", ErrorAlarm.Action);
			ini.SetValue("Alarms", "ErrorAlarmActionParams", ErrorAlarm.ActionParams);
			ini.SetValue("Alarms", "ErrorAlarmActionWindow", ErrorAlarm.ShowWindow);
			ini.SetValue("Alarms", "ErrorAlarmBlueskyFile", ErrorAlarm.BskyFile);

			ini.SetValue("Alarms", "FromEmail", AlarmFromEmail);
			ini.SetValue("Alarms", "DestEmail", string.Join(";", AlarmDestEmail));
			ini.SetValue("Alarms", "UseHTML", AlarmEmailHtml);
			ini.SetValue("Alarms", "UseBCC", AlarmEmailUseBcc);

			// User Alarms
			for (var i = 0; i < UserAlarms.Count; i++)
			{
				ini.SetValue("UserAlarms", "AlarmName" + i, UserAlarms[i].Name);
				ini.SetValue("UserAlarms", "AlarmTag" + i, UserAlarms[i].WebTag);
				ini.SetValue("UserAlarms", "AlarmType" + i, UserAlarms[i].Type);
				ini.SetValue("UserAlarms", "AlarmValue" + i, UserAlarms[i].Value);
				ini.SetValue("UserAlarms", "AlarmEnabled" + i, UserAlarms[i].Enabled);
				ini.SetValue("UserAlarms", "AlarmEmail" + i, UserAlarms[i].Email);
				ini.SetValue("UserAlarms", "AlarmEmailMsg" + i, UserAlarms[i].EmailMsg);
				ini.SetValue("UserAlarms", "AlarmBlueskyFile" + i, UserAlarms[i].BskyFile);
				ini.SetValue("UserAlarms", "AlarmLatch" + i, UserAlarms[i].Latch);
				ini.SetValue("UserAlarms", "AlarmLatchHours" + i, UserAlarms[i].LatchHours);
				ini.SetValue("UserAlarms", "AlarmAction" + i, UserAlarms[i].Action);
				ini.SetValue("UserAlarms", "AlarmActionParams" + i, UserAlarms[i].ActionParams);
			}
			// remove any old alarms
			for (var i = UserAlarms.Count; i < 10; i++)
			{
				ini.DeleteValue("UserAlarms", "AlarmName" + i);
				ini.DeleteValue("UserAlarms", "AlarmTag" + i);
				ini.DeleteValue("UserAlarms", "AlarmType" + i);
				ini.DeleteValue("UserAlarms", "AlarmValue" + i);
				ini.DeleteValue("UserAlarms", "AlarmEnabled" + i);
				ini.DeleteValue("UserAlarms", "AlarmEmail" + i);
				ini.DeleteValue("UserAlarms", "AlarmEmailMsg" + i);
				ini.DeleteValue("UserAlarms", "AlarmLatch" + i);
				ini.DeleteValue("UserAlarms", "AlarmLatchHours" + i);
				ini.DeleteValue("UserAlarms", "AlarmAction" + i);
				ini.DeleteValue("UserAlarms", "AlarmActionParams" + i);
			}

			ini.SetValue("Offsets", "PressOffset", Calib.Press.Offset);
			ini.SetValue("Offsets", "PressSt


pub const SYS_mmap: c_long = 9;
pub const SYS_mprotect: c_long = 10;
pub const SYS_munmap: c_long = 11;
pub const SYS_nanosleep: c_long = 35;
pub const SYS_open: c_long = 2;
pub const SYS_poll: c_long = 7;
pub const SYS_read: c_long = 0;
pub const SYS_readlink: c_long = 89;
pub const SYS_readv: c_long = 19;
pub const SYS_recvfrom: c_long = 45;
pub const SYS_rt_sigaction: c_long = 13;
pub const SYS_rt_sigprocmask: c_long = 14;
pub const SYS_set_tid_address: c_long = 218;
pub const SYS_sendto: c_long = 44;
pub const SYS_setsockopt: c_long = 54;
pub const SYS_sigaltstack: c_long = 131;
pub const SYS_socket: c_long = 41;
pub const SYS_sync: c_long = 162;
pub const SYS_uname: c_long = 63;
pub const SYS_write: c_long = 1;
pub const SYS_writev: c_long = 20;
pub const TIOCGWINSZ: Ioctl = 0x5413;
<filename>tests/rule/responded_oute.rs
use std::collections::HashMap;

use usiagent::shogi::*;
use usiagent::rule::Rule;
use usiagent::rule::State;

use super::*;

#[test]
fn test_responded_oute_sente() {
	let blank_banmen = Banmen([[Blank; 9]; 9]);

	let mvs:Vec<Move> = vec![
		Move::To(KomaSrcPosition(9-5,8+1),KomaDstToPosition(9-4,7+1,false)),
		Move::Put(MochigomaKind::Fu,KomaDstPutPosition(9-4,7+1)),
		Move::To(KomaSrcPosition(9-4,8+1),KomaDstToPosition(9-4,7+1,false)),
		Move::To(KomaSrcPosition(9-4,8+1),KomaDstToPosition(9-5,7+1,false)),
		Move::To(KomaSrcPosition(9-3,8+1),KomaDstToPosition(9-3,7+1,false)),
		Move::To(KomaSrcPosition(9-4,8+1),KomaDstToPosition(9-4,7+1,false)),
		Move::To(KomaSrcPosition(9-4,8+1),KomaDstToPosition(9-4,7+1,false)),
	];

	let position_and_kinds:Vec<Vec<(usize,usize,KomaKind)>> = vec![
		vec![
			(5,8,SKin),(4,8,SOu),(3,8,SKin),(4,7,GKin)
		],
		vec![
			(5,8,SKin),(4,8,SOu),(3,8,SKin),(4,0,GKyou)
		],
		vec![
			(5,8,SKin),(4,8,SOu),(3,8,SKin),(4,7,GKin)
		],
		vec![
			(5,8,SKin),(4,8,SOu),(3,8,SKin),(4,0,GKyou)
		],
		vec![
			(5,8,SKin),(4,8,SOu),(3,8,SKin),(4,7,GKin)
		],
		vec![
			(5,8,SKin),(4,8,SOu),(3,8,SKin),(4,7,GKin),(4,0,GKyou)
		],
		vec![
			(5,8,SKin),(4,8,SOu),(3,8,SKin),(4,7,GKin),(4,6,GKin)
		],
	];

	let answer:[bool; 7] = [
		true,true,true,true,false,false,false
	];

	for ((pk


o_men_holding_hands", "two_women_holding_hands", "u5272", "u5408", "u55b6", "u6307", "u6708", "u6709", "u6e80", "u7121", "u7533", "u7981", "u7a7a", "uganda", "uk", "ukraine", "umbrella", "unamused", "underage", "unicorn", "united_arab_emirates", "unlock", "up", "upside_down_face", "uruguay", "us", "us_virgin_islands", "uzbekistan", "v", "vanuatu", "vatican_city", "vditor", "venezuela", "vertical_traffic_light", "vhs", "vibration_mode", "video_camera", "video_game", "vietnam", "violin", "virgo", "volcano", "volleyball", "vs", "vulcan_salute", "walking", "walking_man", "walking_woman", "wallis_futuna", "waning_crescent_moon", "waning_gibbous_moon", "warning", "wastebasket", "watch", "water_buffalo", "watermelon", "wave", "wavy_dash", "waxing_crescent_moon", "waxing_gibbous_moon", "wc", "weary", "wedding", "weight_lifting_man", "weight_lifting_woman", "western_sahara", "whale", "whale2", "wheel_of_dharma", "wheelchair", "white_check_mark", "white_circle", "white_flag", "white_flower", "white_large_square", "white_medium_small_square", "white_medium_square", "white_small_square", "white_square_button", "wide", "wilted_flower", "wind_chime", "wind_face", "wine_glass", "wink", "wolf", "woman", "woman_artist", "woman_astronaut", "woman_cartwheeling", "woman_cook", "woman_facepalming", "woman_factory_worker", "woman_farmer", "woman_firefighter", "woman_health_worker", "woman_judge", "woman_juggling", "woman_mechanic", "woman_office_worker", "woman_pilot", "woman_playing_handball", "woman_playing_water_polo", "woman_scientist", "woman_shrugging", "woman_singer", "woman_student", "woman_teacher", "woman_technologist", "woman_with_turban", "womans_clothes", "womans_hat", "women_wrestling", "womens", "world_map", "worried", "wrench", "writing_hand", "x", "yellow_heart", "yemen", "yen", "yin_yang", "yum", "zambia", "zap", "zero", "zimbabwe", "zipper_mouth_face", "zzz"
    };

    /**
     * Private constructor.
     */
    private Emotions() {
    }

    /**
     * Converts the specified content with emotions.
     *
     * @param content the specified content
     * @return converted content
     */
    public static String convert(final String content) {
        String ret = content;
        if (!EMOJI_PATTERN.matcher(ret).find()) {
            return ret;
        }

        ret = toUnicode(ret);
        for (final String emojiCode : EMOJIS) {
            String repl = "<img alt=\"" + emojiCode + "\" class=\"emoji\" src=\"https://file.fishpi.cn/vditor/3.8.13/dist/images/emoji/" + emojiCode;
            final String suffix = "huaji".equals(emojiCode) ? ".gif" : ".png";


none}.customize-support #wpadminbar .hide-if-customize,.customize-support .hide-if-customize,.customize-support .wp-core-ui .hide-if-customize,.customize-support.wp-core-ui .hide-if-customize,.no-customize-support #wpadminbar .hide-if-no-customize,.no-customize-support .hide-if-no-customize,.no-customize-support .wp-core-ui .hide-if-no-customize,.no-customize-support.wp-core-ui .hide-if-no-customize{display:none}#wpadminbar .screen-reader-text,#wpadminbar .screen-reader-text span{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}#wpadminbar .screen-reader-shortcut{position:absolute;top:-1000em}#wpadminbar .screen-reader-shortcut:focus{left:6px;top:7px;height:auto;width:auto;display:block;font-size:14px;font-weight:600;padding:15px 23px 14px;background:#f0f0f1;color:#2271b1;z-index:100000;line-height:normal;text-decoration:none;box-shadow:0 0 2px 2px rgba(0,0,0,.6)}@media screen and (max-width:782px){html #wpadminbar{height:46px;min-width:240px}#wpadminbar *{font-size:14px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:2.28571428}#wpadminbar .quicklinks .ab-empty-item,#wpadminbar .quicklinks>ul>li>a{padding:0;height:46px;line-height:3.28571428;width:auto}#wpadminbar .ab-icon{font:40px/1 dashicons!important;margin:0;padding:0;width:52px;height:46px;text-align:center}#wpadminbar .ab-icon:before{text-align:center}#wpadminbar .ab-submenu{padding:0}#wpadminbar #wp-admin-bar-my-account a.ab-item,#wpadminbar #wp-admin-bar-my-sites a.ab-item,#wpadminbar #wp-admin-bar-site-name a.ab-item{text-overflow:clip}#wpadminbar .quicklinks .menupop ul li .ab-item,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li .ab-item,#wpadminbar .shortlink-input,#wpadminbar.nojs .quicklinks .menupop:hover ul li .ab-item{line-height:1.6}#wpadminbar .ab-label{display:none}#wpadminbar .menupop li.hover>.ab-sub-wrapper,#wpadminbar .menupop li:hover>.ab-sub-wrapper{margin-top:-46px}#wpadminbar .ab-top-menu .menupop .ab-sub-wrapper .menupop>.ab-item{padding-right:30px}#wpadminbar .menupop .menupop>.ab-item:before{top:10px;right:6px}#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper .ab-item{font-size:16px;padding:8px 16px}#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper a:empty{display:none}#wpadminbar #wp-admin-bar-wp-logo>.ab-item{padding:0}#wpadminbar #wp-admin


port Activities from '../../infra/typeorm/entities/Activities';

class FakeActivitiesRepository implements IActivitiesRepository {
  private activities: Activities[] = [];

  public async findById(id: string): Promise<Activities | undefined> {
    const findActivitie = this.activities.find(
      activitie => activitie.id === id,
    );

    return findActivitie;
  }

  public async findByProject(
    project_id?: string,
  ): Promise<Activities[] | undefined> {
    const findActivitie = this.activities.filter(
      activitie => activitie.project_id === project_id,
    );

    return findActivitie;
  }

  public async findAllActivities(): Promise<Activities[]> {
    const { activities } = this;

    return activities;
  }

  public async create({
    name,
    project_id,
    finished,
    start_date,
    end_date,
  }: ICreateActivitieDTO): Promise<Activities> {
    const activitie = new Activities();

    Object.assign(activitie, {
      id: uuid(),
      name,
      project_id,
      finished,
      start_date,
      end_date,
    });

    this.activities.push(activitie);

    return activitie;
  }
}

export default FakeActivitiesRepository;
/**
 * Copyright 2019 City of Los Angeles
 *
 * 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.
 */

import type { UUID } from '@mds-core/mds-types'
import { AuthorizationError, getEnvVar } from '@mds-core/mds-utils'
import type express from 'express'
import jwt from 'jsonwebtoken'

export interface AuthorizationContext {
  token_type: 'None' | 'Basic' | 'Bearer'
  access_token?: string
}

export interface AuthorizerClaims {
  authorization: AuthorizationContext
  claims?: {
    principalId: string
    scope: string
    provider_id: UUID | null
    user_email: string | null
    jurisdictions: string | null
  }
}

export const NoAuthorizerClaims: AuthorizerClaims = { authorization: { token_type: 'None' } }

export type Authorizer = (authorization: string) => AuthorizerClaims
export type ApiAuthorizer = (req: express.Request) => AuthorizerClaims

export const CustomClaim = (claim: 'provider_id' | 'user_email' | 'jurisdictions') => {
  const { TOKEN_CUSTOM_CLAIM_NAMESPACE } = getEnvVar({
    TOKEN_CUSTOM_CLAIM_NAMESPACE: 'https://openmobilityfoundation.org'
  })
  return `${TOKEN_CUSTOM_CLAIM_NAMESPACE}${TOKEN_CUSTOM_CLAIM_NAMESPACE.endsWith('/') ? '' : '/'}${claim}`
}

export const ProviderIdClaim = () => {
  const { TOKEN_PROVIDER_ID_CLAIM } = getEnvVar({
    TOKEN_PROVIDER_ID_CLAIM: CustomClaim('provider_id')
  })
  return TOKEN_PROVIDER_ID_CLAIM
}

export const UserEmailClaim = () => {
  const { TOKEN_USER_EMAIL_CLAIM } = getEnvVar({
    TOKEN_USER_EMAIL_CLAIM: CustomClaim('user_email')
  })
  return TO


fifo_grow2() to increase FIFO size,
 *             decreasing FIFO size is not supported
 */
attribute_deprecated
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);

/**
 * Enlarge an AVFifoBuffer.
 * In case of reallocation failure, the old FIFO is kept unchanged.
 * The new fifo size may be larger than the requested size.
 *
 * @param f AVFifoBuffer to resize
 * @param additional_space the amount of space in bytes to allocate in addition to av_fifo_size()
 * @return <0 for failure, >=0 otherwise
 *
 * @deprecated use the new AVFifo-API with av_fifo_grow2(); note that unlike
 * this function it adds to the allocated size, rather than to the used size
 */
attribute_deprecated
int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space);

/**
 * Read and discard the specified amount of data from an AVFifoBuffer.
 * @param f AVFifoBuffer to read from
 * @param size amount of data to read in bytes
 *
 * @deprecated use the new AVFifo-API with av_fifo_drain2()
 */
attribute_deprecated
void av_fifo_drain(AVFifoBuffer *f, int size);

#if FF_API_FIFO_PEEK2
/**
 * Return a pointer to the data stored in a FIFO buffer at a certain offset.
 * The FIFO buffer is not modified.
 *
 * @param f    AVFifoBuffer to peek at, f must be non-NULL
 * @param offs an offset in bytes, its absolute value must be less
 *             than the used buffer size or the returned pointer will
 *             point outside to the buffer data.
 *             The used buffer size can be checked with av_fifo_size().
 * @deprecated use the new AVFifo-API with av_fifo_peek() or av_fifo_peek_to_cb()
 */
attribute_deprecated
static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
{
    uint8_t *ptr = f->rptr + offs;
    if (ptr >= f->end)
        ptr = f->buffer + (ptr - f->end);
    else if (ptr < f->buffer)
        ptr = f->end - (f->buffer - ptr);
    return ptr;
}
#endif
#endif

/**
 * @}
 */

#endif /* AVUTIL_FIFO_H */


rivate fun changeToConnectView() {
        mode = TestMode.UNKNOWN
        mainScope.launch {
            RecordingCaseDoKitView.changeMode(mode)
        }
    }

    private fun changeToTestView() {
        mode = TestMode.CLIENT
        mainScope.launch {
            RecordingCaseDoKitView.changeMode(mode)
        }
    }

    private fun onReceiveControl(textPackage: TextPackage) {
        val text = textPackage.data
        val autoTestMessage = GsonUtils.fromJson<AutoTestMessage>(text, AutoTestMessage::class.java)

        when (autoTestMessage.command) {
            "startRecord" -> {
                startRecord()
                val msg = AutoTestMessage(command = "control_response", message = "success")
                msg.params["command"] = autoTestMessage.command
                onResponseAutoTestMessage(msg)
            }
            "stopRecord" -> {
                stopRecord()
                val msg = AutoTestMessage(command = "control_response", message = "success")
                msg.params["command"] = autoTestMessage.command
                onResponseAutoTestMessage(msg)
            }
            "startAutoTest" -> {
                startAutoTest()
                val msg = AutoTestMessage(command = "control_response", message = "success")
                msg.params["command"] = autoTestMessage.command
                onResponseAutoTestMessage(msg)
            }
            "stopAutoTest" -> {
                onStopAutoTest(autoTestMessage)
            }
        }
    }

    private fun onStopAutoTest(autoTestMessage: AutoTestMessage) {
        delayHandler.postDelayed(object : Runnable {
            override fun run() {
                stopAutoTest()
                val msg = AutoTestMessage(command = "control_response", message = "success")
                msg.params["command"] = autoTestMessage.command
                onResponseAutoTestMessage(msg)
            }
        }, 3000)

    }

    /**
     * 控制消息响应
     */
    private fun onResponseAutoTestMessage(autoTestMessage: AutoTestMessage) {
        webSocketClient?.let {
            it.send(JsonParser.toJson(PackageType.AUTOTEST, autoTestMessage, "auto_test_control"))
        }
    }

    /**
     * 自动化测试行为事件响应
     */
    private fun onResponseAutoTestAction(autoTestMessage: AutoTestMessage) {
        webSocketClient?.let {
            it.send(JsonParser.toJson(PackageType.AUTOTEST, autoTestMessage, "action"))
        }
    }

    /**
     * 自动化测试行为事件响应
     */
    private fun onResponseAutoTestAction(autoTestMessage: AutoTestMessage, bitmap: Bitmap) {
        uploadScope.launch {
            val stream = ByteArrayOutputStream(2048)
            val ok = bitmap.compress(Bitmap.CompressFormat.WEBP, 10, stream)
            val bytes = stream.toByteArray()

            val textPackage = JsonParser.toTextPackage(PackageType.AUTOTEST, autoTestMessage, "action")
            val byteString = ByteParser.toByteString(textPackage, bytes)
            webSocketClient.send(byteString)
            stream.close()
        }
    }

    private fun isDiffTimeEvent(event: ControlEvent): Boolean {
        when (event.eventType) {
            EventType.WSE_CUSTOM_EVENT -> {
                event.params?.let {
                    var testRecording: String? = it["testRecording"]
                    if (testRecording == "false") {
                        return false
                    }
                }
                return true
            }
            EventType.WSE_TCP_EVENT,
            EventType.APP_ON_FOREGROUND,
            EventType.APP_ON_BACKGROUND,
            EventType.ACTIVITY_BACK_PRESSED -> {
                return true
            }
            EventType.WSE_COMMON_EVENT -> {
                event.viewC12c?.let {
                    when (it.actionType) {
                        ActionType.ON_LONG_CLICK,
                        ActionType.ON_SCROLL,


annibal2.skyhanni.utils.SkyBlockUtils
import at.hannibal2.skyhanni.utils.renderables.Renderable
import at.hannibal2.skyhanni.utils.renderables.container.VerticalContainerRenderable.Companion.vertical
import at.hannibal2.skyhanni.utils.renderables.primitives.StringRenderable
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import net.minecraft.entity.item.EntityArmorStand
import kotlin.time.Duration.Companion.seconds

@SkyHanniModule
object SummoningMobManager {

    private val config get() = SkyHanniMod.feature.combat.summonings
    private var mobs = mutableSetOf<Mob>()

    private var lastChatTime: SimpleTimeMark = SimpleTimeMark.farPast()
    private val timeOut = 2.seconds

    private val patternGroup = RepoPattern.group("summoning.mobs")

    /**
     * REGEX-TEST: §aYou have spawned your Tank Zombie §r§asoul! §r§d(249 Mana)
     */
    private val spawnPattern by patternGroup.pattern(
        "spawn",
        "§aYou have spawned your .+ §r§asoul! §r§d\\(\\d+ Mana\\)",
    )

    /**
     * REGEX-TEST: §cYou have despawned your monster!
     * REGEX-TEST: §cYou have despawned your monsters!
     */
    private val despawnPattern by patternGroup.pattern(
        "despawn",
        "§cYou have despawned your monsters?!",
    )

    /**
     * REGEX-TEST: §cThe Seraph recalled your 3 summoned allies!
     * REGEX-TEST: §cThe Seraph recalled your 10 summoned allies!
     */
    private val seraphRecallPattern by patternGroup.pattern(
        "seraphrecall",
        "§cThe Seraph recalled your \\d+ summoned allies!",
    )

    private val despawnPatterns = listOf(
        despawnPattern,
        seraphRecallPattern,
    )

    @HandleEvent(onlyOnSkyblock = true)
    fun onChat(event: SkyHanniChatEvent) {
        if (!config.summonMessages) return
        if (spawnPattern.matches(event.message)) event.blockedReason = "summoning_soul"

        if (despawnPatterns.any { it.matches(event.message) }) {
            event.blockedReason = "summoning_soul"
            lastChatTime = SimpleTimeMark.now()
        }
    }

    @HandleEvent
    fun onMobSpawn(event: MobEvent.Spawn.Summon) {
        if (!event.mob.belongsToPlayer()) return

        mobs += event.mob
        // TODO config option for color
        if (config.summoningMobColored) event.mob.highlight(LorenzColor.GREEN.toColor())
    }

    @HandleEvent
    fun onMobDeSpawn(event: MobEvent.DeSpawn.Summon) {
        val mob = event.mob
        if (mob !in mobs) return
        mobs -= mob

        // since MobEvent.DeSpawn can be fired while outside sb
        @Suppress("InSkyBlockEarlyReturn")
        if (!SkyBlockUtils.inSkyBlock) return
        if (!config.summonMessages) return

        if (!mob.isInRender()) return
        DelayedRun.runNextTick {
            if (lastChatTime.passedSince() > timeOut) {
                ChatUtils.chat("Your Summoning Mob just §cdied!")
            }
        }
    }

    @HandleEvent(priority = HandleEvent.HIGH, onlyOnSkyblock = true)
    fun onRenderLiving(event: SkyHanniRenderEntityEvent.Specials.Pre<EntityArmorStand>) {
        if (!config.summoningMobHideNamet


/*<license>
 -------------------------------------------------------------------------------
  Copyright (c) 2007 ConocoPhillips Company

  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.
 -------------------------------------------------------------------------------
 </license>*/
#ifndef _New_Cvm
#define _New_Cvm

#include "wproc.h"

class SLDelay;
class SLDialog;
class SLSmartForm;
class SL2Text;
class CvmApp;

typedef struct _new_cvm
 {
   SLDialog    *shell;
   SLSmartForm *work;
   SL2Text     *xtext;
   SL2Text     *ytext;
   SL2Text     *ztext;
   SL2Text     *mtext;
   char        xname[20];
   char        yname[20];
   char        zname[20];
   char        mname[80];
   CvmApp      *cvmapp;
 } new_cvm;

#ifdef __cplusplus
extern "C" {                 // for C++
#endif
SLDialog *NewGUI(Widget parent, CvmApp *data, HelpCtx Hctx);
#ifdef __cplusplus
}                   // for C++
#endif

#endif


it SomeRepositoryTrait {
  public function traitMethod() {
    echo 1;
  }
}
`)

	suite.Expect = []string{
		`
service repository => error
  This color rule is broken, call chain:
Service::method@service -> SomeRepositoryTrait::traitMethod@repository
`,
	}

	suite.RunAndMatch()
}

func TestClassAndInterface(t *testing.T) {
	suite := linttest.NewSuite(t)

	suite.Palette = `
controller group:
  - "controller": ""

service repository group:
  - "service repository": "error"
`
	suite.AddFile(`<?php
/**
 * @color service
 */
class Service {
  public function method(IRepository $repository) {
    $repository->getData();
  }
}

/**
 * @color repository
 */
interface IRepository {
  public function getData();
}

class Repository implements IRepository {
  public function getData() {
    return 1;
  }
}
`)

	suite.Expect = []string{
		`
service repository => error
  This color rule is broken, call chain:
Service::method@service -> IRepository::getData@repository
`,
	}

	suite.RunAndMatch()
}
package rules

import (
	"testing"

	"github.com/i582/cfmt/cmd/cfmt"

	"github.com/vkcom/nocolor/internal/linttest"
)

const defaultPalette = `
highload group:
- "highload no-highload": "Calling no-highload function from highload function"
- "highload allow-hh no-highload": ""

ssr group:
- "ssr has-db-access": "Calling function working with the database in the server side rendering function"
- "ssr ssr-allow-db has-db-access": ""

api group:
- "api has-curl": "Calling curl function from API functions"
- "api api-callback has-curl": ""
- "api api-allow-curl has-curl": ""

api2 group:
- "api2 has-curl": "Calling curl function from API2 functions"
- "api2 api-callback has-curl": ""
- "api2 api-allow-curl has-curl": ""

message-internals group:
- "message-internals": "Calling function marked as internal outside of functions with the color message-module"
- "message-module message-internals": ""

controller group:
- controller model: restricted dependency
- controller allow-model-call model: ""
`

func init() {
	cfmt.DisableColors()
}

func TestHighload(t *testing.T) {
	suite := linttest.NewSuite(t)

	suite.Palette = defaultPalette
	suite.AddFile(`<?php
/**
 * @color highload - optional comment
 * @return int
 */
function someHighload() {
    someNoHighload();
    return 2;
}

/**
 * @color no-highload
 */
function someA() {
    echo 1;
}

/**
 * @color no-highload
 */
function someNoHighload() {
    echo 1;
}

someHighload();
`)

	suite.Expect = []string{
		`
highload no-highload => Calling no-highload function from highload function
  This color rule is broken, call chain:
someHighload@highload -> someNoHighload@no-highload
`,
	}

	suite.RunAndMatch()
}
package walkers

import (
	"encoding/gob"
	"io"
	"log"

	"github.com/VKCOM/noverify/src/linter"
	"github.com/VKCOM/noverify/src/meta"

	"github.com/vkcom/nocolor/internal/symbols"
)

// GlobalContext is a structure for storing cache.
type GlobalContext struct {
	Info *meta.Info

	Func


��；巡航麦哲伦海峡；麦哲伦海峡巡弋",
"Strait of Messina":"[网络] 墨西拿海峡；着墨西拿海峡",
"Strait of Ormuz":"[网络] Ormuz海峡",
"strait-jacket":"[医] 约束衣",
"strait-jackets":"(strait-jacket 的复数) [医] 约束衣",
"strait-laced":"a. 固守道德观念的, 拘谨的",
"strait-waistcoat":"n. 拘束身子用的紧身衣",
"straiten":"vt. 使为难, 使穷困, 限制",
"straitened":"a. 困苦的, 拮据的, 困苦的",
"straitening":"vt. 限制；使…穷困；使…为难\\nvi. 变窄；变紧",
"straitens":"vt. 限制；使…穷困；使…为难\\nvi. 变窄；变紧",
"straitjacket":"n. 紧身衣",
"straitjackets":"n. 紧身衣( straitjacket的复数形式 )",
"straitlace":"vt.用系带缚紧, 约束",
"straitlaced":"a. 严格的, 刻板的, 固执的",
"straitly":"adv. 狭窄地, 严格地",
"straitness":"n. 狭窄, 狭小",
"straits":"n. [谓语用单数]海峡, 困难, 窘迫",
"Straits dollar":"马来西亚和新加坡元（旧英国海峡殖民地的货币单位）",
"Straits Settlements":"英属海峡殖民地",
"strake":"n. 轮箍, 条纹, 狭长草地",
"straked":"(strake 的过去分词) n. 轮箍, 条纹, 狭长草地",
"Straker":"n. [造船]列板；轮箍",
"strakes":"(strake 的第三人称 -s形式) n. 轮箍, 条纹, 狭长草地",
"Stralsund":"斯特拉尔松[德意志民主共和国北部港市]",
"stram":"vi.大踏步走",
"stramash":"n. 骚扰, 骚乱, 碰撞, 猛撞",
"stramineous":"稻草状的, 蒿状的",
"straminol":"麦秆醇",
"stramonium":"n. 曼陀罗叶\\n[化] 曼陀罗",
"stramonium fluidextract":"[医] 曼陀罗流浸膏",
"stramonium poultice":"[医] 曼陀罗泥罨",
"stramonium seed":"[医] 曼陀罗子",
"stramony":"n. [植](=jimsonweed)曼陀罗, (治气喘病的)曼陀罗叶",
"stranahan":" [人名] 斯特拉纳汉",
"strand":"n. (绳索的)股, 绳, 串, 海滨, 河岸\\nvi. 搁浅\


det = A[0] * A[3] - A[1] * A[1];
          // We should divide the following two by det, but instead, we multiply
          // X1_minus_X and X2_minus_X by det (which does not matter as we normalize the normals)
          // Therefore, no division is done: this is only for speedup
          ContainerDepth dx = (A[3] * b[0] - A[1] * b[1]);
          ContainerDepth dy = (-A[1] * b[0] + A[0] * b[1]);

          // Compute the dot product
          //Vec3T X = K_inv * Vec3T(x, y, 1) * depth(y, x);
          //Vec3T X1 = K_inv * Vec3T(x + 1, y, 1) * (depth(y, x) + dx);
          //Vec3T X2 = K_inv * Vec3T(x, y + 1, 1) * (depth(y, x) + dy);
          //Vec3T nor = (X1 - X).cross(X2 - X);
          multiply_by_K_inv(K_inv, d * det + (x + 1) * dx, y * dx, dx, X1_minus_X);
          multiply_by_K_inv(K_inv, x * dy, d * det + (y + 1) * dy, dy, X2_minus_X);
          Vec3T nor = X1_minus_X.cross(X2_minus_X);
          signNormal(nor, *normal);

          ++p_line;
          ++normal;
        }
      }

      return normals;
    }
  };
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace
{

  /** Given a set of 3d points in a depth image, compute the normals at each point
   * using the SRI method described in
   * ``Fast and Accurate Computation of Surface Normals from Range Images``
   * by H. Badino, D. Huber, Y. Park and T. Kanade
   */
  template<typename T>
  class SRI: public RgbdNormalsImpl
  {
  public:
    typedef cv::Matx<T, 3, 3> Mat33T;
    typedef cv::Vec<T, 9> Vec9T;
    typedef cv::Vec<T, 3> Vec3T;

    SRI(int rows, int cols, int window_size, int depth, const cv::Mat &K, cv::RgbdNormals::RGBD_NORMALS_METHOD method)
        :
          RgbdNormalsImpl(rows, cols, window_size, depth, K, method),
          phi_step_(0),
          theta_step_(0)
    {
    }

    /** Compute cached data
     */
    virtual void
    cache()
    {
      cv::Mat_<T> cos_theta, sin_theta, cos_phi, sin_phi;
      computeThetaPhi<T>(rows_, cols_, K_, cos_theta, sin_theta, cos_phi, sin_phi);

      // Create the derivative kernels
      getDerivKernels(kx_dx_, ky_dx_, 1, 0, window_size_, true, depth_);
      getDerivKernels(kx_dy_, ky_dy_, 0, 1, window_size_, true, depth_);

      // Get the mapping function for SRI
      float min_theta = std::asin(sin_theta(0, 0)), max_theta = std::asin(sin_theta(0, cols_ - 1));
      float min_phi = std::asin(sin_phi(0, cols_/2-1)), max_phi = std::asin(sin_phi(rows_ - 1, cols_/2-1));

      std::vector<cv::Point3f> points3d(cols_ * rows_);
      R_hat_.create(rows_, cols_);
      phi_step_ = float(max_phi - min_phi) / (rows_ - 1);
      theta_step_ = float(max_theta - min_theta) / (cols_ - 1);
      for (int phi_


String patternAzione = (azione != null ? azione.getPattern() : null);
				String nomePortaDeleganteAzione = (azione != null ? azione.getNomePortaDelegante() : null);
				StatoFunzionalita forceInterfaceBased = (azione != null ? azione.getForceInterfaceBased() : null);
				PortaDelegataAzioneIdentificazione modeAzione = (azione != null ? azione.getIdentificazione() : null);
				//Se il bean Azione nn e' presente allora non controllo nulla
				if(azione!=null){
					if(modeAzione==null || modeAzione.equals(""))
						modeAzione = PortaDelegataAzioneIdentificazione.STATIC;
					switch (modeAzione) {
					case CONTENT_BASED:
					case URL_BASED:
					case HEADER_BASED:
						if(patternAzione==null || patternAzione.equals("")) throw new DriverConfigurazioneException("Pattern Azione non impostato.");
						nomeAzione=null;
						break;
					case DELEGATED_BY:
						if(nomePortaDeleganteAzione==null || nomePortaDeleganteAzione.equals("")) throw new DriverConfigurazioneException("Nome Porta Delegante Azione non impostata.");
						nomeAzione=null;
						break;
					case INPUT_BASED:
					case SOAP_ACTION_BASED:
					case INTERFACE_BASED:
						//nessun campo obbligatorio
						break;
					case STATIC:
						//se non c'e' l'id dell'azione ci deve essere il nome
						if(idAzione<=0){
							if(nomeAzione==null || nomeAzione.equals("")) throw new DriverConfigurazioneException("Nome Azione non impostato.");
						}
						patternAzione=null;
						break;
					default:
						break;
					}
				}

				String utenteRichiedente = null;
				if(aPD.getProprietaOggetto()!=null && aPD.getProprietaOggetto().getUtenteRichiedente()!=null) {
					utenteRichiedente = aPD.getProprietaOggetto().getUtenteRichiedente();
				}
				else {
					utenteRichiedente = DBUtils.getSuperUserServizioSafe(DriverConfigurazioneDBLib.log, "CRUDPortaApplicativa",
							idServizioPD, con, DriverConfigurazioneDBLib.tipoDB);
				}

				Timestamp dataCreazione = null;
				if(aPD.getProprietaOggetto()!=null && aPD.getProprietaOggetto().getDataCreazione()!=null) {
					dataCreazione = new Timestamp(aPD.getProprietaOggetto().getDataCreazione().getTime());
				}
				else if(aPD.getOraRegistrazione()!=null){
					dataCreazione = new Timestamp(aPD.getOraRegistrazione().getTime());
				}
				else {
					dataCreazione = DateManager.getTimestamp();
				}

				// create
				ISQLQueryObject sqlQueryObject = SQLObjectFactory.createSQLQueryObject(DriverConfigurazioneDBLib.tipoDB);
				sqlQueryObject.addInsertTable(CostantiDB.PORTE_DELEGATE);
				sqlQueryObject.addInsertField("nome_porta", "?");
				sqlQueryObject.addInsertField("descrizione", "?");
				sqlQueryObject.addInsertField("id_soggetto_erogatore", "?");
				sqlQueryObject.addInsertField("tipo_soggetto_erogatore", "?");
				sqlQueryObject.addInsertField("nome_soggetto_erogatore", "?");
				sqlQueryObject.addInsertField("id_servizio", "?");
				sqlQueryObject.addInsertField("tipo_servizio", "?");
				sqlQueryObject.addInsertField("nome_servizio", "?");
				sqlQueryObject.addInsertField("versione_serv


   break;
    case 2:
      foo1();
      foo2();
      break;
    case 3:
      bar1();
      bar2();
      bar3();
      break;
  }
}
#endif
// Test ASan detection of stack-overflow condition when Linux sends SIGBUS.

// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/resource.h>

const int BS = 1024;
volatile char x;
volatile int y = 1;

void recursive_func(char *p) {
  char buf[BS];
  buf[rand() % BS] = 1;
  buf[rand() % BS] = 2;
  x = buf[rand() % BS];
  if (y)
    recursive_func(buf);
  x = 1; // prevent tail call optimization
  // CHECK: {{stack-overflow on address 0x.* \(pc 0x.* bp 0x.* sp 0x.* T.*\)}}
}

void LimitStackAndReexec(int argc, char **argv) {
  struct rlimit rlim;
  int res = getrlimit(RLIMIT_STACK, &rlim);
  assert(res == 0);
  if (rlim.rlim_cur == RLIM_INFINITY) {
    rlim.rlim_cur = 256 * 1024;
    res = setrlimit(RLIMIT_STACK, &rlim);
    assert(res == 0);

    execv(argv[0], argv);
    assert(0 && "unreachable");
  }
}

int main(int argc, char **argv) {
  LimitStackAndReexec(argc, argv);

  // Map some memory just before the start of the current stack vma.
  // When the stack grows down and crashes into it, Linux can send
  // SIGBUS instead of SIGSEGV. See:
  // http://lkml.iu.edu/hypermail/linux/kernel/1008.1/02299.html
  const long pagesize = sysconf(_SC_PAGESIZE);
  FILE *f = fopen("/proc/self/maps", "r");
  char a[1000];
  void *p = 0;
  while (fgets(a, sizeof a, f)) {
    if (strstr(a, "[stack]")) {
      unsigned long addr;
      if (sscanf(a, "%lx", &addr) == 1)
        p = mmap((void *)(addr - 4 * pagesize), pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    }
  }
  assert(p);

  recursive_func(0);
  return 0;
}
//===- unittests/Frontend/FrontendActionTest.cpp - FrontendAction tests ---===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Sema/Sema.h"
#include "llvm/ADT/


udaStreamWaitEvent(
        stream: cudaStream_t,
        event: cudaEvent_t,
        flags: ::libc::c_uint,
    ) -> cudaError_t;
}
pub type cudaStreamCallback_t = ::std::option::Option<
    unsafe extern "C" fn(stream: cudaStream_t, status: cudaError_t, userData: *mut ::libc::c_void),
>;
extern "C" {
    pub fn cudaStreamAddCallback(
        stream: cudaStream_t,
        callback: cudaStreamCallback_t,
        userData: *mut ::libc::c_void,
        flags: ::libc::c_uint,
    ) -> cudaError_t;
}
extern "C" {
    pub fn cudaStreamSynchronize(stream: cudaStream_t) -> cudaError_t;
}
extern "C" {
    pub fn cudaStreamQuery(stream: cudaStream_t) -> cudaError_t;
}
extern "C" {
    pub fn cudaStreamAttachMemAsync(
        stream: cudaStream_t,
        devPtr: *mut ::libc::c_void,
        length: usize,
        flags: ::libc::c_uint,
    ) -> cudaError_t;
}
extern "C" {
    pub fn cudaStreamBeginCapture(stream: cudaStream_t, mode: cudaStreamCaptureMode)
        -> cudaError_t;
}
extern "C" {
    pub fn cudaThreadExchangeStreamCaptureMode(mode: *mut cudaStreamCaptureMode) -> cudaError_t;
}
extern "C" {
    pub fn cudaStreamEndCapture(stream: cudaStream_t, pGraph: *mut cudaGraph_t) -> cudaError_t;
}
extern "C" {
    pub fn cudaStreamIsCapturing(
        stream: cudaStream_t,
        pCaptureStatus: *mut cudaStreamCaptureStatus,
    ) -> cudaError_t;
}
extern "C" {
    pub fn cudaStreamGetCaptureInfo(
        stream: cudaStream_t,
        pCaptureStatus: *mut cudaStreamCaptureStatus,
        pId: *mut ::libc::c_ulonglong,
    ) -> cudaError_t;
}
extern "C" {
    pub fn cudaEventCreate(event: *mut cudaEvent_t) -> cudaError_t;
}
extern "C" {
    pub fn cudaEventCreateWithFlags(event: *mut cudaEvent_t, flags: ::libc::c_uint) -> cudaError_t;
}
extern "C" {
    pub fn cudaEventRecord(event: cudaEvent_t, stream: cudaStream_t) -> cudaError_t;
}
extern "C" {
    pub fn cudaEventQuery(event: cudaEvent_t) -> cudaError_t;
}
extern "C" {
    pub fn cudaEventSynchronize(event: cudaEvent_t) -> cudaError_t;
}
extern "C" {
    pub fn cudaEventDestroy(event: cudaEvent_t) -> cudaError_t;
}
extern "C" {
    pub fn cudaEventElapsedTime(ms: *mut f32, start: cudaEvent_t, end: cudaEvent_t) -> cudaError_t;
}
extern "C" {
    pub fn cudaImportExternalMemory(
        extMem_out: *mut cudaExternalMemory_t,
        memHandleDesc: *const cudaExternalMemoryHandleDesc,
    ) -> cudaError_t;
}
extern "C" {
    pub fn cudaExternalMemoryGetMappedBuffer(
        devPtr: *mut *mut ::libc::c_void,
        extMem: cudaExternalMemory_t,
        bufferDesc: *const cudaExternalMemoryBufferDesc,
    ) -> cudaError_t;
}
extern "C" {
    pub fn cudaExternalMemoryGetMappedMipmappedArray(
        mipmap: *mut cudaMipmappedArray_t,
        extMem: cudaExternalMemory_t,


ray_eq!(1e-5, roots, [-3.6547f64, -1.67175f64, 0.455904f64]);
    }

    #[test]
    fn find_roots_sturm_tim_lueke() {
        // Try to find roots of the normalized quartic polynomial where the discriminant must be 0
        // (as reported by <NAME> in December 2019)
        // -14.0625*x^4-3.75*x^3+29.75*x^2+4.0*x^1-16.0*x^0 => {-1.1016116464173349, 0.9682783130840016}
        let polynom = [
            -3.75f64 / -14.0625f64,
            29.75f64 / -14.0625f64,
            4.0f64 / -14.0625f64,
            -16.0f64 / -14.0625f64,
        ];
        let roots: Vec<_> = find_roots_sturm(&polynom, &mut 1e-8f64)
            .iter()
            .filter_map(|s| match s {
                &Ok(ref x) => Some(*x),
                &Err(_) => None,
            })
            .collect();

        // these roots cannot be found
        assert_float_array_eq!(1e-5, roots, []);
        //assert_float_array_eq!(1e-5, roots, [-1.1016116464173349f64, 0.9682783130840016f64]);
    }
}
//! Method, error and parameter types for the Interactions endpoint.
#![allow(
    unused_imports,
)]
/*
 * GitHub v3 REST API
 *
 * GitHub's v3 REST API.
 *
 * OpenAPI spec version: 1.1.4
 *
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

use serde::Deserialize;

use crate::adapters::{AdapterError, FromJson, GitHubRequest, GitHubRequestBuilder, GitHubResponseExt};
use crate::auth::Auth;
use crate::models::*;

use super::PerPage;

use std::collections::HashMap;
use serde_json::value::Value;

pub struct Interactions<'api> {
    auth: &'api Auth
}

pub fn new(auth: &Auth) -> Interactions {
    Interactions { auth }
}

/// Errors for the [Get interaction restrictions for your public repositories](Interactions::get_restrictions_for_authenticated_user_async()) endpoint.
#[derive(Debug, thiserror::Error)]
pub enum InteractionsGetRestrictionsForAuthenticatedUserError {
    #[error(transparent)]
    AdapterError(#[from] AdapterError),
    #[error(transparent)]
    SerdeJson(#[from] serde_json::Error),
    #[error(transparent)]
    SerdeUrl(#[from] serde_urlencoded::ser::Error),

    // -- endpoint errors

    #[error("Response when there are no restrictions")]
    Status204,
    #[error("Status code: {}", code)]
    Generic { code: u16 },
}

/// Errors for the [Get interaction restrictions for an organization](Interactions::get_restrictions_for_org_async()) endpoint.
#[derive(Debug, thiserror::Error)]
pub enum InteractionsGetRestrictionsForOrgError {
    #[error(transparent)]
    AdapterError(#[from] AdapterError),
    #[error(transparent)]
    SerdeJson(#[from] serde_json::Error),
    #[error(transparent)]
    SerdeUrl(#[from] serde_urlencoded::ser::Error),

    // -- endpoint errors


    v3.4h, v14.4h , v28.4h

    saddl     v0.4s, v12.4h, v30.4h

    st1       {v30.2s}, [x9]

    smlal     v0.4s, v2.4h, v22.4h

    ld1       {v8.2s}, [x7], x6         // load from temp buffer 2
    ld1       {v9.2s}, [x7], x6         // load from temp buffer 3
    smlsl     v0.4s, v3.4h, v23.4h
    subs      x4, x4, #4

    sqrshrun  v10.8b, v8.8h, #5
    sqrshrun  v9.8b, v9.8h, #5
    mov       v10.s[1], v9.s[0]

    mov       v12.8b, v28.8b

    sqrshrun  v0.4h, v0.4s, #0xa
    mov       v6.8b, v14.8b
    mov       v8.8b, v16.8b

    uqxtn     v5.8b, v0.8h

    trn1      v4.2s, v4.2s, v5.2s
    trn2      v5.2s, v4.2s, v5.2s
    urhadd    v4.8b, v4.8b , v10.8b
    mov       v10.8b, v26.8b
    mov       v14.8b, v30.8b

    st1       {v4.s}[0], [x1], x3       // store row 2
    st1       {v4.s}[1], [x1], x3       // store row 3

    bgt       loop_4

end_func:
    //Restoring registers from stack
    ldp       x19, x20, [sp], #16
    pop_v_regs
    ret


19260820;language=lt', '_': { 'title': 'Advertisement', 'privacy_settings': 'Privatumo nuostatos' }, 'top': { 'enabled': false, 'adflow_enabled': true, 'format_id': 135099 }, 'inline': { 'enabled': true, 'adflow_enabled': true, 'format_id': 110354, 'max_slots': 20, 'max_blaze_slots': 20 }, 'belowpost': { 'enabled': false, 'adflow_enabled': true, 'format_id': 134071 }, 'bottom_sticky': { 'enabled': false, 'adflow_enabled': true, 'format_id': 117571 }, 'sidebar': { 'enabled': false, 'adflow_enabled': true, 'format_id': 134686 }, 'sidebar_sticky_right': { 'enabled': false, 'adflow_enabled': true, 'format_id': 135281 }, 'gutenberg_rectangle': { 'enabled': false, 'adflow_enabled': true, 'format_id': 134788 }, 'gutenberg_leaderboard': { 'enabled': false, 'adflow_enabled': true, 'format_id': 135073 }, 'gutenberg_mobile_leaderboard': { 'enabled': false, 'adflow_enabled': true, 'format_id': 135098 }, 'gutenberg_skyscraper': { 'enabled': false, 'adflow_enabled': true, 'format_id': 135088 }, 'sidebar_widget_mediumrectangle': { 'enabled': false, 'adflow_enabled': true, 'format_id': 137624 }, 'sidebar_widget_leaderboard': { 'enabled': false, 'adflow_enabled': true, 'format_id': 137625 }, 'sidebar_widget_wideskyscraper': { 'enabled': false, 'adflow_enabled': true, 'format_id': 137626 } }; wa_smart.cmd = [];
/* ]]> */
</script>
		<script type="text/javascript">
		function __ATA_CC() {var v = document.cookie.match('(^|;) ?personalized-ads-consent=([^;]*)(;|$)');return v ? 1 : 0;}
		var __ATA_PP = { 'pt': 1, 'ht': 1, 'tn': 'dyad', 'uloggedin': 0, 'amp': false, 'consent': __ATA_CC(), 'gdpr_applies': false, 'ad': { 'label': { 'text': 'Reklama' }, 'reportAd': { 'text': 'Report this ad' } }, 'disabled_slot_formats': [ 'IAD' ], 'siteid': 119260820, 'afp_ad_client': 'pub-2808988512799234' };
		var __ATA = __ATA || {};
		__ATA.cmd = __ATA.cmd || [];
		__ATA.criteo = __ATA.criteo || {};
		__ATA.criteo.cmd = __ATA.criteo.cmd || [];
		</script>
		<script type="text/javascript">
		(function(){var g=Date.now||function(){return+new Date};function h(a,b){a:{for(var c=a.length,d="string"==typeof a?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:"string"==typeof a?a.charAt(b):a[b]};function k(a,b,c){c=null!=c?"="+encodeURIComponent(String(c)):"";if(b+=c){c=a.indexOf("#");0>c&&(c=a.length);var d=a.indexOf("?");if(0>d||d>c){d=c;var e=""}else e=a.substring(d+1,c);a=[a.substr(0,d),e,a.substr(c)];c=a[1];a[1]=b?c?c+"&"+b:b:c;a=a[0]+(a[1]?"?"+a[1]:"")+a[2]}return a};var l=0;function m(a,b){var c=document.createElement("script");c.src=a;c.onload=function(){b&&b(void 0)};c.onerror=function(){b&&b("error")};a=document.getElementsByTagName("head");var d;a&&0!==a.length?d=a[0]:d=document.documentElement;d


hes in strings
- in Ruby fixed highlighting of keywords 'def' and 'class', same for 'sub' in
  Perl

## Version 2.0

- Ruby support by [Anton Kovalyov][ak]
- speed increased by orders of magnitude due to new way of parsing
- this same way allows now correct highlighting of keywords in some tricky
  places (like keyword "End" at the end of Delphi classes)

[ak]: http://anton.kovalyov.net/

## Version 1.0

Version 1.0 of javascript syntax highlighter is released!

It's the first version available with English description. Feel free to post
your comments and question to [highlight.js forum][forum]. And don't be afraid
if you find there some fancy Cyrillic letters -- it's for Russian users too :-)

[forum]: http://softwaremaniacs.org/forum/viewforum.php?id=6
# Класс CAccumulativeLookupLayer

<!-- TOC -->

- [Класс CAccumulativeLookupLayer](#класс-caccumulativelookuplayer)
    - [Настройки](#настройки)
    - [Обучаемые параметры](#обучаемые-параметры)
        - [Таблица векторов](#таблица-векторов)
    - [Входы](#входы)
    - [Выходы](#выходы)

<!-- /TOC -->

Класс реализует слой, сопоставляющий значениям дискретного признака векторы фиксированной длины и обучающий эти вектора.

Например, векторные представления слов ([Word2Vec](https://en.wikipedia.org/wiki/Word2vec), [GloVe](https://en.wikipedia.org/wiki/GloVe_(machine_learning)) и т.д.).

Данный слой поддерживает работу с одним признаком, и при получении нескольких значений признака возвращает сумму векторов, соответствующих этим значениям.

## Настройки

```c++
// Размер одной таблицы.
struct CLookupDimension {
    int VectorCount; // Количество векторов.
    int VectorSize; // Размер векторов.
};

void SetDimension( const CLookupDimension& newDimension );
```

Установка размера таблицы векторов.

## Обучаемые параметры

### Таблица векторов

```c++
CPtr<CDnnBlob> GetEmbeddings() const;
```

Блоб с обученными векторами, размера:

- `BatchLength` равен `GetDimension().VectorCount`;
- `BatchWidth` равен `GetDimension().VectorSize`.

## Входы

На единственный вход подаётся блоб с данными типа `int`, содержащий наборы значений, размера:

- `BatchLength * BatchWidth * ListSize` - количество наборов значений признака;
- `Height * Width * Depth * Channels` - количество значений признака в наборе.

##


stor pkmlPersistor, IPathAndValueBuildingBlockMapper<T, TBuildingBlock> mapper, string caption)
      {
         _dialogCreator = dialogCreator;
         _pkmlPersistor = pkmlPersistor;
         _mapper = mapper;
         _caption = caption;
      }

      protected override void PerformExecute()
      {
         var file = _dialogCreator.AskForFileToSave(_caption, Constants.Filter.PKML_FILE_FILTER, Constants.DirectoryKey.MODEL_PART, Subject.Name);
         if (string.IsNullOrEmpty(file))
            return;

         //first map to core building block
         var buildingBlock = _mapper.MapFrom(Subject);
         _pkmlPersistor.SaveToPKML(buildingBlock, file);
      }

   }
}


per the way that the compiler reads the sighash is very fun
 * and interesting; they copy *exactly* 4 bytes into memory starting at 0, then read the whole word, checking
 * this (big) constant against the expected sighash. Our model of copying fails miserably on this sub-word copy,
 * and instead of falling back on bounded precision cells, we special case this very common pattern.
 */
object SighashReadNormalizer {
    fun doWork(c: CoreTACProgram) : CoreTACProgram {
        val d = c.analysisCache.strictDef
        return c.parallelLtacStream().mapNotNull {
            it.maybeNarrow<TACCmd.Simple.ByteLongCopy>()?.takeIf {
                it.cmd.srcBase == TACKeyword.CALLDATA.toVar() && it.cmd.dstBase == TACKeyword.MEMORY.toVar() &&
                    d.source(it.ptr, it.cmd.length) == StrictDefAnalysis.Source.Const(DEFAULT_SIGHASH_SIZE) ||
                    d.source(it.ptr, it.cmd.srcOffset) == StrictDefAnalysis.Source.Const(BigInteger.ZERO)
            }?.let { longCopyLC ->
                longCopyLC `to?` (d.source(longCopyLC.ptr, longCopyLC.cmd.dstOffset) as? StrictDefAnalysis.Source.Const)?.n
            } ?: it.maybeNarrow<TACCmd.Simple.AssigningCmd.ByteStore>()?.takeIf {
                it.cmd.base == TACKeyword.MEMORY.toVar() && (it.cmd.value as? TACSymbol.Var)?.let { vS ->
                    c.analysisCache.gvn.equivBefore(it.ptr, vS).any {
                        it.meta[TACMeta.CALLDATA_OFFSET] == BigInteger.ZERO
                    }
                } == true
            }?.let { lc ->
                lc `to?` (d.source(lc.ptr, lc.cmd.loc) as? StrictDefAnalysis.Source.Const)?.n
            }
        }.filter { (_, offs) ->
            offs.mod(EVM_WORD_SIZE) + DEFAULT_SIGHASH_SIZE == EVM_WORD_SIZE
        }.patchForEach(c, check = true) { (where, offs) ->
            val tmp = TACKeyword.TMP(Tag.Bit256, "upperBits")
            val currContents = TACKeyword.TMP(Tag.Bit256, "currContents")
            val wordAligned = (offs - 0x1c.toBigInteger()).asTACSymbol()
            val sighashBitWidth = DEFAULT_SIGHASH_SIZE_INT * 8
            val repl = CommandWithRequiredDecls(listOf(
                TACCmd.Simple.AssigningCmd.ByteLoad(
                    lhs = currContents,
                    base = TACKeyword.MEMORY.toVar(),
                    loc = wordAligned
                ),
                TACCmd.Simple.AssigningCmd.ByteLoad(
                    lhs = tmp,
                    base = TACKeyword.CALLDATA.toVar(),
                    loc = TACSymbol.Zero
                )
            ), setOf(tmp, currContents)) andThen ExprUnfolder.unfoldPlusOneCmd("blit", TACExprFactoryExtensions.run {
                (currContents bwAnd bwNot(MASK_SIZE(sighashBitWidth).asTACExpr)) add (tmp shiftRLog (EVM_BITWIDTH256 - sighashBitWidth))
            }) {
                TACCmd.Simple.AssigningCmd.ByteStore(
                    loc = wordAligned,
                    base = TACKeyword.MEMORY.toVar(),
                    value = it.s
                )
            }
            replaceCommand(where.ptr, repl)
        }
    }
}
/*
 *     The Certora Prover
 *     Copyright (C) 2025  Certora Ltd.
 *
 *     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, version 3 of the License.
 *
 *     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.


失败，可以手动执行：

```bash
# 1. 创建并激活虚拟环境
python3 -m venv venv
source venv/bin/activate

# 2. 安装依赖
pip install fastapi uvicorn pydantic openai requests python-dotenv sqlalchemy alembic

# 3. 配置环境变量
cp .env.example .env
# 编辑 .env 文件，设置您的Azure OpenAI配置

# 4. 初始化数据库
python init_db.py

# 5. 启动MCP服务器
python mcp_server.py
```

系统启动成功后，您会看到：
```
🚀 启动MCP服务器...
📍 地址: http://localhost:8000
📖 API文档: http://localhost:8000/docs
```

## ⚙ 配置说明

### 环境配置

编辑 `.env` 文件设置配置：

```env
# Azure OpenAI 配置
AZURE_OPENAI_ENDPOINT=https://your-endpoint.openai.azure.com/openai/deployments/gpt-4.1/chat/completions?api-version=2025-01-01-preview
AZURE_OPENAI_API_KEY=your-api-key-here

# 数据库配置
DATABASE_URL=sqlite:///./smart_flight_booking.db

# MCP Server 配置
MCP_SERVER_HOST=localhost
MCP_SERVER_PORT=8000
```

### Azure OpenAI 配置步骤

1. 登录 [Azure Portal](https://portal.azure.com)
2. 创建或选择 Azure OpenAI 资源
3. 部署 GPT-4.1 模型
4. 获取 API 密钥和端点地址
5. 更新 `.env` 文件中的配置

## 🎮 使用指南

### 快速演示

```bash
# 激活虚拟环境
source venv/bin/activate

# 运行快速演示脚本
python quick_demo.py
```

### 运行智能助手

#### 1. 预订管理助手
```bash
source venv/bin/activate
python booking_agent.py
```

**交互示例:**
```
🎫 智能预订管理助手
============================================================

请输入命令或询问: create
📝 创建新预订
------------------------------
预订标题: 张三的商务出差
乘客姓名: 张三
航班号: CA1001
...
✅ 预订创建成功！预订ID: 1

请输入命令或询问: 帮


_descender: u32 = 0x100049a; /* U+049A CYRILLIC CAPITAL LETTER KA WITH DESCENDER */
pub const KEY_Cyrillic_ka_descender: u32 = 0x100049b; /* U+049B CYRILLIC SMALL LETTER KA WITH DESCENDER */
pub const KEY_Cyrillic_KA_vertstroke: u32 = 0x100049c; /* U+049C CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE */
pub const KEY_Cyrillic_ka_vertstroke: u32 = 0x100049d; /* U+049D CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE */
pub const KEY_Cyrillic_EN_descender: u32 = 0x10004a2; /* U+04A2 CYRILLIC CAPITAL LETTER EN WITH DESCENDER */
pub const KEY_Cyrillic_en_descender: u32 = 0x10004a3; /* U+04A3 CYRILLIC SMALL LETTER EN WITH DESCENDER */
pub const KEY_Cyrillic_U_straight: u32 = 0x10004ae; /* U+04AE CYRILLIC CAPITAL LETTER STRAIGHT U */
pub const KEY_Cyrillic_u_straight: u32 = 0x10004af; /* U+04AF CYRILLIC SMALL LETTER STRAIGHT U */
pub const KEY_Cyrillic_U_straight_bar: u32 = 0x10004b0; /* U+04B0 CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE */
pub const KEY_Cyrillic_u_straight_bar: u32 = 0x10004b1; /* U+04B1 CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE */
pub const KEY_Cyrillic_HA_descender: u32 = 0x10004b2; /* U+04B2 CYRILLIC CAPITAL LETTER HA WITH DESCENDER */
pub const KEY_Cyrillic_ha_descender: u32 = 0x10004b3; /* U+04B3 CYRILLIC SMALL LETTER HA WITH DESCENDER */
pub const KEY_Cyrillic_CHE_descender: u32 = 0x10004b6; /* U+04B6 CYRILLIC CAPITAL LETTER CHE WITH DESCENDER */
pub const KEY_Cyrillic_che_descender: u32 = 0x10004b7; /* U+04B7 CYRILLIC SMALL LETTER CHE WITH DESCENDER */
pub const KEY_Cyrillic_CHE_vertstroke: u32 = 0x10004b8; /* U+04B8 CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE */
pub const KEY_Cyrillic_che_vertstroke: u32 = 0x10004b9; /* U+04B9 CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE */
pub const KEY_Cyrillic_SHHA: u32 = 0x10004ba; /* U+04BA CYRILLIC CAPITAL LETTER SHHA */
pub const KEY_Cyrillic_shha: u32 = 0x10004bb; /* U+04BB CYRILLIC SMALL LETTER SHHA */

pub const KEY_Cyrillic_SCHWA: u32 = 0x10004d8; /* U+04D8 CYRILLIC CAPITAL LETTER SCHWA */
pub const KEY_Cyrillic_schwa: u32 = 0x10004d9; /* U+04D9 CYRILLIC SMALL LETTER SCHWA */
pub const KEY_Cyrillic_I_macron: u32 = 0x10004e2; /* U+04E2 CYRILLIC CAPITAL LETTER I WITH MACRON */
pub const KEY_Cyrillic_i_macron: u32 = 0x10004e3; /* U+04E3 CYRILLIC SMALL LETTER I WITH MACRON */
pub const KEY_Cyrillic_O_bar: u32 = 0x10004e8; /* U+04E8 CYRILL


}.fa-steam-symbol{--fa:"\f3f6"}/*!
 * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
 * Copyright 2024 Fonticons, Inc.
 */
@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype");unicode-range:u+f003,u+f006,u+f014,u+f016-f017,u+f01a-f01b,u+f01d,u+f022,u+f03e,u+f044,u+f046,u+f05c-f05d,u+f06e,u+f070,u+f087-f088,u+f08a,u+f094,u+f096-f097,u+f09d,u+f0a0,u+f0a2,u+f0a4-f0a7,u+f0c5,u+f0c7,u+f0e5-f0e6,u+f0eb,u+f0f6-f0f8,u+f10c,u+f114-f115,u+f118-f11a,u+f11c-f11d,u+f133,u+f147,u+f14e,u+f150-f152,u+f185-f186,u+f18e,u+f190-f192,u+f196,u+f1c1-f1c9,u+f1d9,u+f1db,u+f1e3,u+f1ea,u+f1f7,u+f1f9,u+f20a,u+f247-f248,u+f24a,u+f24d,u+f255-f25b,u+f25d,u+f271-f274,u+f278,u+f27b,u+f28c,u+f28e,u+f29c,u+f2b5,u+f2b7,u+f2ba,u+f2bc,u+f2be,u+f2c0-f2c1,u+f2c3,u+f2d0,u+f2d2,u+f2d4,u+f2dc}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-v4compatibility.woff2) format("woff2"),url(../webfonts/fa-v4compatibility.ttf) format("truetype");unicode-range:u+f041,u+f047,u+f065-f066,u+f07d-f07e,u+f080,u+f08b,u+f08e,u+f090,u+f09a,u+f0ac,u+f0ae,u+f0b2,u+f0d0,u+f0d6,u+f0e4,u+f0ec,u+f10a-f10b,u+f123,u+f13e,u+f148-f149,u+f14c,u+f156,u+f15e,u+f160-f161,u+f163,u+f175-f178,u+f195,u+f1f8,u+f219,u+f27a}PlayerHUD {

	.notifications {
		position: absolute


-weight:normal;font-size:0.8em}.post_text{font-size:80%;font-family:Helvetica,Arial,sans-serif}.site_column>h1{font-size:1.5em;padding-bottom:4px}.site_column>h2{font-size:1.4em;padding-bottom:4px}.site_column>h3{font-size:1.3em;padding-bottom:2px}.site_column>h4{font-size:1.2em;padding-bottom:2px}.site_column>h5{font-size:1.1em;padding-bottom:2px}form.boxed{background:#f3f7fa;border:1px solid #cad3db;margin:0px 0px 40px 0px;padding:15px 20px}form.boxed h3{font-size:1.3em;padding-bottom:15px}thead .button_to,thead .button,.actions .button_to,.actions .button,td .button_to,td .button{float:left;margin:0px}thead .button_to div,thead .button div,.actions .button_to div,.actions .button div,td .button_to div,td .button div{margin:0px}thead .button,.actions .button,td .button{margin:0 5px 0 0;font-size:0.92em;padding:3px 10px}thead .button.image,.actions .button.image,td .button.image{padding:3px 4px 0px;line-height:100%}#admin{padding-top:40px}
ul,ol{list-style:none}h1,h2,h3,h4,h5,h6,pre,code{font-size:1em}ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,body,html,p,blockquote,fieldset,input,dl,dt,dd{margin:0;padding:0}a img,:link img,:visited img,fieldset{border:none}address{font-style:normal}header,section,article,nav,footer,hgroup{display:block}body,html{background:#28323a}body{font:normal 12px Helvetica,Arial,sans-serif;color:#fff}body #content{margin-top:100px;border-top:1px solid #fff;border-bottom:1px solid #fff;background:#394651 url(https://media.eol.org//assets/v2/bg_not-found.gif) center top no-repeat;min-height:360px;text-align:center}body #content h1{font-size:3em;margin:180px 0 10px 0}body #content h2,body #content p{font-size:1.2em;line-height:140%}body #content a{color:#90bce4}body #content #message{width:800px;margin:0 auto}body #content form{margin:30px auto 20px auto;width:280px;position:relative}body #content form label{position:absolute;left:-9999px}body #content form .text{float:left;margin:0 10px 0 0;-moz-border-radius:180px;border-radius:180px;background-color:#fefeff;background-image:-ms-linear-gradient(top, #ccd2d7 0%, #fefeff 100%);background-image:-moz-linear-gradient(top, #ccd2d7 0%, #fefeff 100%);background-image:-o-linear-gradient(top, #ccd2d7 0%, #fefeff 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #ccd2d7), color-stop(1, #fefeff));background-image:-webkit-linear-gradient(top, #ccd2d7 0%, #fefeff 100%);background-image:linear-gradient(to bottom, #ccd2d7 0%, #fefeff 100%)}body #content form .text input[type="text"]{width:175px;height:18px;padding:6px 5px 6px 38px;font-size:1.16em;line-height:140%;color:#394651;outline:none;border:none;bac


投资者名为:{}", logInfo, investorName)
                } else {
                    logger.error("{}交易接口未能获取到投资者名", logInfo)
                }
            }
            if (bIsLast) {
                if (investorName.isBlank()) {
                    logger.warn("{}交易接口未能获取到投资者名,准备断开", logInfo)
                    ctpGatewayImpl.disconnect()
                }
                investorNameQueried = true
                // 防止被限流
                Thread.sleep(1000)
                // 查询所有合约
                logger.warn("{}交易接口开始查询合约信息", logInfo)
                val cThostFtdcQryInstrumentField = CThostFtdcQryInstrumentField()
                cThostFtdcTraderApi!!.ReqQryInstrument(cThostFtdcQryInstrumentField, reqId.incrementAndGet())
            }
        } catch (t: Throwable) {
            logger.error("{}处理查询投资者回报异常", logInfo, t)
            ctpGatewayImpl.disconnect()
        }

    }

    override fun OnRspQryTradingCode(
        pTradingCode: CThostFtdcTradingCodeField?,
        pRspInfo: CThostFtdcRspInfoField?,
        nRequestID: Int,
        bIsLast: Boolean
    ) {

    }

    override fun OnRspQryInstrumentMarginRate(
        pInstrumentMarginRate: CThostFtdcInstrumentMarginRateField?,
        pRspInfo: CThostFtdcRspInfoField?,
        nRequestID: Int,
        bIsLast: Boolean
    ) {

    }

    override fun OnRspQryInstrumentCommissionRate(
        pInstrumentCommissionRate: CThostFtdcInstrumentCommissionRateField?,
        pRspInfo: CThostFtdcRspInfoField?,
        nRequestID: Int,
        bIsLast: Boolean
    ) {

    }

    override fun OnRspQryExchange(
        pExchange: CThostFtdcExchangeField?,
        pRspInfo: CThostFtdcRspInfoField?,
        nRequestID: Int,
        bIsLast: Boolean
    ) {

    }

    override fun OnRspQryProduct(
        pProduct: CThostFtdcProductField?,
        pRspInfo: CThostFtdcRspInfoField?,
        nRequestID: Int,
        bIsLast: Boolean
    ) {

    }

    override fun OnRspQryInstrument(
        pInstrument: CThostFtdcInstrumentField?,
        pRspInfo: CThostFtdcRspInfoField?,
        nRequestID: Int,
        bIsLast: Boolean
    ) {
        try {
            if (pInstrument != null) {
                val contract = Contract()
                contract.symbol = pInstrument.instrumentID
                contract.exchange = CtpConstant.exchangeMapReverse[pInstrument.exchangeID] ?: ExchangeEnum.Unknown
                contract.productClass = CtpConstant.productTypeMapReverse[pInstrument.productClass] ?: ProductClassEnum.Unknown
                contract.uniformSymbol = contract.symbol + "@" + contract.exchange
                contract.name = pInstrument.instrumentName
                contract.fullName = pInstrument.instrumentName
                contract.thirdPartyId = contract.symbol
                if (pInstrument.volumeMultiple <= 0) {
                    contract.multiplier = 1.0
                } else {
                    contract.multiplier = pInstrument.volumeMultiple.toDouble()
                }
                contract.priceTick = pInstrument.priceTick
                contract.currency = CurrencyEnum.CNY // 默认人民币
                contract.lastTradeDateOrContractMonth = pInstrument.expireDate
                contract.strikePrice = pInstrument.strikePrice
                contract.optionsType =
                    CtpConstant.optionTypeMapReverse[pInstrument.optionsType] ?: OptionsTypeEnum.Unknown
                if (pInstrument.underlyingInstrID != null) {
                    contract.underlyingSymbol = pInstrument.und


cards;
	aligned_u64	rx_oos_packets;
	aligned_u64	rx_errors;
};

#define ifr__name       b.ifr_ifrn.ifrn_name
#define stats_ptr       b.ifr_ifru.ifru_data

/*
 * Ioctl definitions.
 */

#define	PPPIOCGFLAGS	_IOR('t', 90, int)	/* get configuration flags */
#define	PPPIOCSFLAGS	_IOW('t', 89, int)	/* set configuration flags */
#define	PPPIOCGASYNCMAP	_IOR('t', 88, int)	/* get async map */
#define	PPPIOCSASYNCMAP	_IOW('t', 87, int)	/* set async map */
#define	PPPIOCGUNIT	_IOR('t', 86, int)	/* get ppp unit number */
#define	PPPIOCGRASYNCMAP _IOR('t', 85, int)	/* get receive async map */
#define	PPPIOCSRASYNCMAP _IOW('t', 84, int)	/* set receive async map */
#define	PPPIOCGMRU	_IOR('t', 83, int)	/* get max receive unit */
#define	PPPIOCSMRU	_IOW('t', 82, int)	/* set max receive unit */
#define	PPPIOCSMAXCID	_IOW('t', 81, int)	/* set VJ max slot ID */
#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
#define PPPIOCXFERUNIT	_IO('t', 78)		/* transfer PPP unit */
#define PPPIOCSCOMPRESS	_IOW('t', 77, struct ppp_option_data)
#define PPPIOCGNPMODE	_IOWR('t', 76, struct npioctl) /* get NP mode */
#define PPPIOCSNPMODE	_IOW('t', 75, struct npioctl)  /* set NP mode */
#define PPPIOCSPASS	_IOW('t', 71, struct sock_fprog) /* set pass filter */
#define PPPIOCSACTIVE	_IOW('t', 70, struct sock_fprog) /* set active filt */
#define PPPIOCGDEBUG	_IOR('t', 65, int)	/* Read debug level */
#define PPPIOCSDEBUG	_IOW('t', 64, int)	/* Set debug level */
#define PPPIOCGIDLE	_IOR('t', 63, struct ppp_idle) /* get idle time */
#define PPPIOCNEWUNIT	_IOWR('t', 62, int)	/* create new ppp unit */
#define PPPIOCATTACH	_IOW('t', 61, int)	/* attach to ppp unit */
#define PPPIOCDETACH	_IOW('t', 60, int)	/* detach from ppp unit/chan */
#define PPPIOCSMRRU	_IOW('t', 59, int)	/* set multilink MRU */
#define PPPIOCCONNECT	_IOW('t', 58, int)	/* connect channel to unit */
#define PPPIOCDISCONN	_IO('t', 57)		/* disconnect channel */
#define PPPIOCATTCHAN	_IOW('t', 56, int)	/* attach to ppp channel */
#define PPPIOCGCHAN	_IOR('t', 55, int)	/* get ppp channel number */
#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)

#define SIOCGPPPSTATS   (SIOCDEVPRIVATE + 0)
#define SIOCGPPPVER     (SIOCDEVPRIVATE + 1)	/* NEVER change this!! */
#define SIOCGPPPCSTATS  (SIOCDEVPRIVATE + 2)

#if !defined(ifr_mtu)
#define ifr_mtu	ifr_ifru.ifru_metric
#endif

#endif /* _IF_PPP_H_ */


          *
//*/**/****************************************************************

package eu.abc4trust.cryptoEngine.user;

import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import org.junit.*;
import static org.junit.Assert.*;

import eu.abc4trust.smartcard.CardStorage;
import eu.abc4trust.xml.FriendlyDescription;
import eu.abc4trust.xml.ObjectFactory;
import eu.abc4trust.xml.PseudonymWithMetadata;
import eu.abc4trust.xml.util.XmlUtils;

public class PseudonymSerializerTest {

  List<PseudonymSerializer> getClasses() {
    List<PseudonymSerializer> cslist = new ArrayList<PseudonymSerializer>();
    CardStorage cardStorage = new CardStorage();
    cslist.add(new PseudonymSerializerXml(cardStorage));
    cslist.add(new PseudonymSerializerGzipXml(cardStorage));
    cslist.add(new PseudonymSerializerObject(cardStorage));
    cslist.add(new PseudonymSerializerObjectGzip(cardStorage));
    return cslist;
  }

  @Test
  public void friendlyGeneratorTest() {
    Map<String, String> tests = new TreeMap<String, String>();

    tests.put("hello", "hello");
    tests.put("hello:world", "world");
    tests.put("a:b:c", "c");
    tests.put("a:b:", "b");
    tests.put("http://blabla/", "//blabla/");
    tests.put("http://blabla/:blibli", "blibli");
    tests.put("hello:a+b", "a b");
    tests.put("hello:H%C3%A9llo", "H\u00e9llo");
    tests.put("hello:a/b", "a/b");

    for(String scope: tests.keySet()) {
      FriendlyDescription fd = AbstractPseudonymSerializer.generateFriendlyDescription(scope);
      assertEquals(tests.get(scope), fd.getValue());
      assertEquals("en", fd.getLang());
    }
  }

  @Test
  public void testConsistency() throws Exception {
    List<PwmWithName> clist = new ArrayList<PwmWithName>();
    clist.add(new PwmWithName("credCompressor/idemix3-standard-pseudonym.xml"));
    // clist.add(new PwmWithName("credCompressor/idemix3-exclusive-pseudonym.xml"));

    List<PseudonymSerializer> cslist = getClasses();
    cslist.add(new PseudonymSerializerBest(new CardStorage()));

    boolean ok = true;
    for(PwmWithName cn: clist) {
      System.out.print(cn.name + ": ");
      for(PseudonymSerializer cs: cslist) {
        try {
          int size = checkSerializeAndUnserialize(cs, cn.cred, cn.name);
          System.out.print(cs.magicHeader()+"="+size+"   ");
        } catch(Exception e) {
          System.out.println("FAIL");
          ok = false;
        }
      }
      System.out.println();
    }
    assertTrue(ok);
  }

  @Test
  public void testInconsistency() throws Exception {
    PwmWithName c = new PwmWithName("credCompressor/idemix3-standard-pseudonym.xml");
    for(PseudonymSerializer cs1: getClasses()) {
      for(PseudonymSerializer cs2: getClasses()) {
        byte[] ser = cs1.serializePseudonym(c.cred);
        try {
          cs2.unserializePseudonym(ser, URI.create("uprove-uri"));
          if (cs1.getClass() != cs2.getClass()) {
            fail("Serialization with different classes should fail");
          }
        } catch(Exception e) {
          if (cs1.getClass() == cs2.getClass()) {
            fail("Serialization with same class should not fail");
          }
        }
      }
    }
  }

  private int checkSerializeAndUnserialize(PseudonymSerializer cs, PseudonymWithMetadata c, String cname)
      throws Exception {
    byte[] ser = cs.serializePseudonym(c);
    PseudonymWithMetadata copy = cs.unserializePseudonym(ser, URI.create("uprove-uri"));

    // TODO: there is no real comparison function for credentials...
    ObjectFactory of = new ObjectFactory();
    assertEquals("Serializer: " +


					Scheme:   awssdk.String("https"),
					Hostname: (*gwv1.PreciseHostname)(awssdk.String("api.example.com")),
					Path: &gwv1.HTTPPathModifier{
						Type:               gwv1.PrefixMatchHTTPPathModifier,
						ReplacePrefixMatch: awssdk.String("/v2"),
					},
					StatusCode: awssdk.Int(302),
					Port:       &defaultPort,
				},
			},
		},
	},
	{
		Matches: []gwv1.HTTPRouteMatch{
			{
				Path: &gwv1.HTTPPathMatch{
					Type:  &[]gwv1.PathMatchType{gwv1.PathMatchExact}[0],
					Value: awssdk.String("/secure"),
				},
			},
		},
		Filters: []gwv1.HTTPRouteFilter{
			{
				Type: gwv1.HTTPRouteFilterRequestRedirect,
				RequestRedirect: &gwv1.HTTPRequestRedirectFilter{
					Scheme:     awssdk.String("https"),
					Hostname:   (*gwv1.PreciseHostname)(awssdk.String("secure.example.com")),
					Port:       &portNew,
					StatusCode: awssdk.Int(302),
				},
			},
		},
	},
}

var httpRouteRuleWithMatchesAndTargetGroupWeights = []gwv1.HTTPRouteRule{
	// rule 1
	{
		Matches: []gwv1.HTTPRouteMatch{
			{
				Path: &gwv1.HTTPPathMatch{
					Type:  &[]gwv1.PathMatchType{gwv1.PathMatchExact}[0],
					Value: awssdk.String(testPathString),
				},
			},
		},
		BackendRefs: []gwv1.HTTPBackendRef{
			{
				BackendRef: gwv1.BackendRef{
					BackendObjectReference: gwv1.BackendObjectReference{
						Name: defaultName,
						Port: &defaultPort,
					},
					Weight: awssdk.Int32(50),
				},
			},
		},
	},
	// rule 2
	{
		Matches: []gwv1.HTTPRouteMatch{
			{
				Path: &gwv1.HTTPPathMatch{
					Type:  &[]gwv1.PathMatchType{gwv1.PathMatchPathPrefix}[0],
					Value: awssdk.String(testPathString),
				},
				QueryParams: []gwv1.HTTPQueryParamMatch{
					{
						Name:  testQueryStringKeyOne,
						Value: testQueryStringValueOne,
					},
					{
						Name:  testQueryStringKeyTwo,
						Value: testQueryStringValueTwo,
					},
				},
			},
		},
		BackendRefs: []gwv1.HTTPBackendRef{
			{
				BackendRef: gwv1.BackendRef{
					BackendObjectReference: gwv1.BackendObjectReference{
						Name: defaultName,
						Port: &defaultPort,
					},
					Weight: awssdk.Int32(30),
				},
			},
		},
	},
	// rule 3
	{
		Matches: []gwv1.HTTPRouteMatch{
			{
				Path: &gwv1.HTTPPathMatch{
					Type:  &[]gwv1.PathMatchType{gwv1.PathMatchPathPrefix}[0],
					Value: awssdk.String(testPathString),
				},
				Headers: []gwv1.HTTPHeaderMatch{
					{
						Name:  testHttpHeaderNameOne,
						Value: testHttpHeaderValueOne,
					},
					{
						Name:  testHttpHeaderNameTwo,
						Value: testHttpHeaderValueTwo,
					},
				},
				Method: &[]gwv1.HTTPMethod{gwv1.HTTPMethodGet}[0],
			},
		},
		BackendRefs: []gwv1.HTTP


// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

//
// Copyright (C) 2015 Xamarin, Inc (http://www.xamarin.com)
//
// 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.
//

using System.Diagnostics.CodeAnalysis;

namespace System
{
    // A TypeName is wrapper around type names in display form
    // (that is, with special characters escaped).
    //
    // Note that in general if you unescape a type name, you will
    // lose information: If the type name's DisplayName is
    // Foo\+Bar+Baz (outer class ``Foo+Bar``, inner class Baz)
    // unescaping the first plus will give you (outer class Foo,
    // inner class Bar, innermost class Baz).
    //
    // The correct way to take a TypeName apart is to feed its
    // DisplayName to TypeSpec.Parse()
    //
    internal interface ITypeName : IEquatable<ITypeName>
    {
        string DisplayName
        {
            get;
        }

        // add a nested name under this one.
        ITypeName NestedName(ITypeIdentifier innerName);
    }

    // A type identifier is a single component of a type name.
    // Unlike a general typename, a type identifier can be be
    // converted to internal form without loss of information.
    internal interface ITypeIdentifier : ITypeName
    {
        string InternalName
        {
            get;
        }
    }

    internal static class TypeNames
    {
        internal static ITypeName FromDisplay(string displayName)
        {
            return new Display(displayName);
        }

        internal abstract class ATypeName : ITypeName
        {
            public abstract string DisplayName { get; }

            public abstract ITypeName NestedName(ITypeIdentifier innerName);

            public bool Equals(ITypeName? other)
            {
                return other != null && DisplayName == other.DisplayName;
            }

            public override int GetHashCode()
            {
                return DisplayName.GetHashCode();
            }

            public override bool Equals(object? other)
            {
                return Equals(other as ITypeName);
            }
        }

        private sealed class Display : ATypeName
        {
            private readonly string displayName;

            internal Display(string displayName)
            {
                this.displayNam


0,0,0,.05)}.rc-ThreadsListEntry.focused a,.rc-ThreadsListEntry:hover a{text-decoration:none}.rc-ThreadsListEntry .entry-metadata{margin-top:4px}.rc-ThreadsListEntry .entry-metadata .timestamp,.rc-ThreadsListEntry .entry-metadata .timestamp-separator{margin-left:4px}.rc-ThreadsListEntry .c-title{margin-bottom:4px}.rc-ThreadsListEntry .c-reply-area{margin-left:16px}.rc-ThreadsListEntry .c-reply-area .view-count{margin-right:12px}.rc-ThreadsListEntry .forum-info,.rc-ThreadsListEntry .question-title-bold{font-weight:700}.rc-ThreadsListEntry .pin-container{margin:0 13px 0 -51px;z-index:1000;cursor:default}.rc-ThreadsListEntry .pin-background{color:#a07e46}.rc-ThreadsListEntry .pin-icon{margin:10px 0 0 8.5px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg);color:#fff}.rc-ThreadsListEntry .rc-ThreadBadge{margin:0 12px 0 0}.rc-ThreadsListEntry .rc-Metadata .focused{text-decoration:underline;color:#428bca}.rc-ThreadsListEntry .entry-snippet{max-height:150px;overflow:hidden}.rc-ThreadsListEntry .forReader{height:0;width:0}@media (max-width:767px){.rc-ThreadsListEntry .c-reply-area .view-count{display:none}}.rc-ThreadsList .c-forum-label-area{margin-top:24px}.rc-ThreadsList .c-forum-label-area h3.headline-2-text,.rc-ThreadsList .c-forum-label-area p.big{margin-bottom:0}.rc-ThreadsList .c-forum-label-area .c-forum-label-section{padding-bottom:12px}.rc-ThreadsList .c-forum-label-area .c-forum-label-section .btn-subscribe{margin-left:8px}.rc-ThreadsList .c-forum-description{margin-bottom:32px}.rc-ThreadsList .rc-ListBody{padding:0 16px 16px}.rc-ThreadsList .discussions-sidebar{margin-left:30px}.rc-ModerationReasons .c-radio-group{list-style-type:none;padding-left:0}.rc-ModerationReasons li{margin:0 0 16px 16px}.rc-ModerationReasons a{text-decoration:underline}.rc-ModerationReasons label{font-weight:400}.rc-ModerationReasons .c-radio-label{display:inline-block;padding-left:16px}.rc-NotifyOption input{margin-right:16px}.rc-Delete .c-delete-warning{margin-bottom:40px}.rc-FlaggingModal .c-modal-content{min-height:120px}.rc-FlaggingModal .c-modal-content .modal-text{margin-top:20px}.rc-FlaggingModal .c-modal-content .modal-text.success{text-align:center;margin-top:24px}.rc-FlaggingModal .c-modal-content .button-container{margin-top:40px;margin-right:12px}.rc-FlaggingModal .c-modal-content .button-container .never-mind{margin-right:20px}.rc-CopyLink .link-input{padding:0 8px}.rc-CopyLink .box{min-width:250px;border:1px solid rgba(0,0,0,.1);background-color:#fff}.rc-CopyLink .box.copied{border:1px solid #2a73cc}.rc-CopyLink .box .link{overflow:hidden;border-radius:0;padding-left:12px;text-overflow:ellipsis;white-space:nowrap}.rc-CopyLink .clipboard-message{margin-top:8px;opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0)}.rc-CopyLink .clipboard-message.transition-in{op