e>Properties

Activity

string | number | boolean | ReactElement<PropsWithElementAttributes<{ activity: EnrichedActivity<UT, AT, CT, RT, CRT>; Card?: string | number | boolean | ReactElement<PropsWithElementAttributes<{ alt?: string | undefined; handleClose?: ((e: SyntheticEvent<Element, Event>) => void) | undefined; image?: string | ... 1...

<
  UT extends DefaultUT = DefaultUT,
  AT extends DefaultAT = DefaultAT,
  CT extends UR = UR,
  RT extends UR = UR,
  CRT extends UR = UR
>({
  Header = DefaultActivityHeader,
  HeaderRight,
  Content = DefaultActivityContent,
  Footer,
  Card = DefaultCard,
  activity,
  icon,
  onClickHashtag,
  onClickMention,
  onClickUser,
  Repost = DefaultRepost,
  userId,
  feedGroup,
  className,
  style,
}: ActivityProps<UT, AT, CT, RT, CRT>) =>


# AI 硬件 [1]

智能硬件比如现在流行的智能音箱和智能手环等

## 不确定性 [6]

智能硬件产品不仅具有极端的不确定性还具有比互联网产品经理需要花更多精力打磨的地方，比如供应链，核心元件：例如芯片、电池等。总的体会来说智能硬件产品经理包含了部分互联网产品经理的职能，在这条路上个人最大额体会是：确定的事情是留给机器人（智能硬件）做的，不确定的研究创新是给人（产品经理）做的，看来不停地专研是产品经理的常态！

## 方案+研究+生产

做方案：

1. 研究市场需求
2. 出MDR，定义市场需求（定目标人群、定卖点、定关键特性、定价）
3. 和ID（工业设计）团队一起出方案，出效果图
4. 拿方案在内部评审可行性，直到比较有把握
5. ID开始设计和打样，做Mockup
6. 做市场调查，找用户提提意见
7. 拿方案去对客户宣讲，看看客户的反馈（一般是合作过的老客户，比如运营商、渠道商；新客户都是拿成品去拓展的）
8. 根据市场调研反馈修改设计

研发和生产阶段：

![AI赋能智能软硬件整体产品设计与开发过程](../img/AI_hardware_process.jpg)

1. ID团队出正式的方案（中间需要反复修改设计、去喷漆厂调色、做高保真Mockup）
1. MD（结构设计）出结构方案
1. 硬件出硬件方案
1. MD和硬件一起选购元器件，定BOM
1. 软件研发软件方案
1. 开模，需多次修模
1. 量产

产品立项书模板内容: https://zhuanlan.zhihu.com/p/313721146

## 硬件AI PM

智能硬件产品经理一种是规划应用AI技术，统筹规划设计生产出智能硬件产品的产品经理角色。

硬能力核心流程如下图：

![硬件AI PM](../img/hardwareAI_PM.png)

## 硬件PM VS 互联网PM

### 知识面不同： [2]

- 软件产品经理通常需要关注市场和用户调研和分析、产品设


calc(-.3*var(--s)) calc(-.3*var(--s))/var(--_g),
    conic-gradient(from 90deg at 20% 20%,var(--c2) 25%,var(--c1) 0)
     0 0/var(--s) var(--s);
}
</style><button>Copy the CSS</button>

      <button>Copy the CSS</button>

      <button>Copy the CSS</button>

      <button>Copy the CSS</button>


 in the `peers` map, and signals passed to that
based off the `sender` parameter in the Signal. The sender parameter is set
server side *should* be secure to use.
*/

import { Signaller, Channel } from '../signal'
import { RTCStream } from './RTCStream'

export type Signal = {
  type: string,
  content: Object,
  sender: string
}

class P2PStream {
  signaller: Signaller
  setStream: (stream: MediaStream) => void
  setError: (a: string | Error) => void
  localStream?: MediaStream
  connectionStatusCallback: (a: any) => void
  peers = new Map<string, RTCStream>()
  defaultPeer?: string

  constructor(signaller: Signaller, setStream: (a: MediaStream) => void,
    setConnStatus: (a: any) => void,
    setError: (a: string | Error) => void
  ) {
    this.signaller = signaller
    this.setStream = setStream
    this.setError = setError
    this.connectionStatusCallback = setConnStatus

    signaller.registerRTCCallback((signal) => this.handleSignal(signal), Channel.Private)
    signaller.registerRTCCallback((signal) => this.handleDirectSignal(signal), Channel.User)

  }

  connectToVideo(client: string) {
    let stream = this.createStream({sender: client})

    // Explicitly set we want to recieve video from this client

    stream.handleRemoteStream(this.setStream)
    stream.start()

    this.signaller.send({
      type: "VIDEO_START"
    }, client)
  }

  setLocalStream(stream: MediaStream) {
    this.localStream = stream

    this.peers.forEach((peer) => peer.setLocalStream(stream))
  }

  setRemoteStreamCallback(f: (a: MediaStream) => void) {
    this.setStream = f

    this.peers.forEach((peer) => peer.handleRemoteStream(f))
  }

  setConnectionStatusCallback(f: (a: any) => void) {
    this.connectionStatusCallback = f

    this.peers.forEach((peer) => peer.setConnectionCallback(f))
  }

  sendDefaultVideoStreamBeacon(): void {
    this.signaller.send({
      type: 'VIDEO_JOIN',
    })
  }

  // Presume only the default stream will happen on the default channel
  handleSignal(signal: Signal) {
    switch (signal.type) {
      case "VIDEO_JOIN":
        this.handleDefaultJoin(signal)
        break
      case 'VIDEO_OFFER':
        this.handleDefaultOffer(signal)
        break
      default:
        console.log(`Unknown message: \n ${JSON.stringify(signal)}`)
    }
  }

  handleDirectSignal(signal: Signal) {
    switch (signal.type) {
      case "VIDEO_START":
        this.handleJoin(signal)
        break
      case 'VIDEO_OFFER':
        this.handleOffer(signal)
        break
      case 'VIDEO_ANSWER':
        this.handleVideoAnswer(signal)
        break
      case 'NEW_ICE_CANDIDATE':
        this.handleNewICECandidate(signal)
        break
      default:
        break
    }
  }

  handleJoin(signal: Signal) {
    this.peers.get(signal.sender)?.close()

    let stream = this.createStream(signal)

    if (this.localStream) {
      stream.setLocalStream(this.localStream)
    }

    stream.setImpolite()
    stream.start()
  }

  handleDefaultJoin(signal: Signal) {
    if (this.defaultPeer) {
      this.peers.get(this.defaultPeer)?.close()
    }

    let stream = this.createDefaultStream(signal)

    stream.setImpolite()


)), [Quentin Groom](https://orcid.org/0000-0002-0596-5376) ([Botanic Garden Meise](http://www.wikidata.org/entity/Q3052500)), [Stijn Van Hoey](https://orcid.org/0000-0001-6413-3185) ([Instituut voor Natuur- en Bosonderzoek (INBO)](http://www.wikidata.org/entity/Q7315097)), [David Bloom](https://orcid.org/0000-0003-1273-1807) ([VertNet](http://www.wikidata.org/entity/Q98382028)), [Paula Zermoglio](https://orcid.org/0000-0002-6056-5084) ([VertNet](http://www.wikidata.org/entity/Q98382028)), [Robert Guralnick](https://orcid.org/0000-0001-6682-1504) ([University of Florida](http://www.wikidata.org/entity/Q501758)), [John Deck](https://orcid.org/0000-0002-5905-1617) ([Genomic Biodiversity Working Group](http://www.wikidata.org/entity/Q98382041)), [Gail Kampmeier](https://orcid.org/0000-0002-5178-4170) ([Illinois Natural History Survey](http://www.wikidata.org/entity/Q5999587)), [Dave Vieglais](https://orcid.org/0000-0002-6513-4996) ([KU Natural History Museum](http://www.wikidata.org/entity/Q1111807)), [Renato De Giovanni](https://orcid.org/0000-0002-7104-7266) ([Centro de Referência em Informação Ambiental](http://www.wikidata.org/entity/Q29168927)), [Campbell Webb](https://orcid.org/0000-0003-1031-3249) ([TDWG RDF/OWL Task Group](http://www.wikidata.org/entity/Q4914768)), [Paul J. Morris](http://purl.oclc.org/net/edu.harvard.huh/guid/uuid/5e51de22-d841-4c47-b0c4-d5ad0bd03035) ([Harvard University Herbaria/Museum of Comparative Zoölogy](http://www.wikidata.org/entity/Q51926077)), [Mark Schildhauer](https://orcid.org/0000-0003-0632-7576) ([National Center for Ecological Analysis and Synthesis](http://www.wikidata.org/entity/Q6971323)), [Sophia Ratcliffe](https://orcid.org/0000-0001-9284-7900) ([National Biodiversity Network Trust](http://www.wikidata.org/entity/Q6970988)), [Teresa J. Mayfield-Meyer](https://orcid.org/0000-0002-1970-7044) ([The University of New Mexico, Arctos](http://www.wikidata.org/entity/Q1190812)), [Christian Bölling](https://orcid.org/0000-0002-6544-1363) ([Museum für Naturkunde Berlin - Leibniz-Institut für Evolutions- und Biodiversitätsforschung](http://www.wikidata.org/entity/Q233098))

Creator
: Darwin Core Maintenance Group

Bibliographic citation
: Darwin Core Maintenance Group. 2023. Darwin Core List of Terms. Biodiversity Information Standards (TDWG). <http://rs.tdwg.org/dwc/doc/list/2023-09-18>

## 1 Introduction (Informative)

This document contains terms that are part of the most recent version of the Darwin Core vocabulary (<http://rs.tdwg.org/version/dwc/2023-09-18>).

This document includes terms in four namespaces that contain recommended terms: `dwc:`, `dwciri:`, `dc:`, and `dcterms:`. However, some terms in these namespaces are deprecated or superseded and should no longer be used. Deprecation or supersession is noted in the term metadata. Namespaces that contain only deprecated terms are not included in this document, but metadata about those terms can be retrieved by dereferencing their IRIs.


type: ActionType.LOAD_FILS,
              payload: [adaptFilm({fake: true})],
            });
          });
  });

  it(`Should make a correct API call to /films/promo`, () => {
    const apiMock = new MockAdapter(api);
    const dispatch = jest.fn();
    const cardLoader = Operations.loadFilmCard();

    apiMock
      .onGet(`/films/promo`)
      .reply(200, [{fake: true}]);

    return cardLoader(dispatch, () => {}, api)
          .then(() => {
            expect(dispatch).toHaveBeenCalledTimes(2);
            expect(dispatch).toHaveBeenCalledWith({
              type: ActionType.LOAD_FILM_CARD,
              payload: adaptFilm({fake: true}),
            });
          });
  });

  it(`Should make the correct API call to /comments/1`, () => {
    const apiMock = new MockAdapter(api);
    const dispatch = jest.fn();
    const reviewsLoader = Operations.loadFilmReviews(1);

    apiMock
      .onGet(`/comments/1`)
      .reply(200, [{fake: true}]);

    return reviewsLoader(dispatch, () => {}, api)
          .then(() => {
            expect(dispatch).toHaveBeenCalledTimes(1);
            expect(dispatch).toHaveBeenCalledWith({
              type: ActionType.LOAD_FILM_REVIEWS,
              payload: [{fake: true}],
            });
          });
  });

  it(`Should send favorite film status`, () => {
    const apiMock = new MockAdapter(api);
    const dispatch = jest.fn();
    const favoriteFilmsLoader = Operations.loadFavoriteFilms();

    apiMock
      .onGet(`/favorite`)
      .reply(200, [{fake: true}]);

    return favoriteFilmsLoader(dispatch, () => {}, api)
          .then(() => {
            expect(dispatch).toHaveBeenCalledTimes(1);
            expect(dispatch).toHaveBeenCalledWith({
              type: ActionType.LOAD_FAVORITE_FILMS,
              payload: [adaptFilm({fake: true})],
            });
          });
  });

  it(`Should send review to /comments/1`, () => {
    const review = {
      rating: 5,
      comment: ``,
    };

    const apiMock = new MockAdapter(api);
    const dispatch = jest.fn();
    const pushReview = Operations.pushReview(1, review);

    apiMock
      .onPost(`/comments/1`)
      .reply(200, [{fake: true}]);

    return pushReview(dispatch, () => {}, api)
          .then(() => {
            expect(dispatch).toHaveBeenCalledWith({
              type: ActionType.CHECK_IS_DATA_SENDING,
              payload: true,
            });
          });
  });

  it(`Should send favorite film status`, () => {
    const apiMock = new MockAdapter(api);
    const dispatch = jest.fn();
    const sendFilmStatus = Operations.changeIsFilmFavorite(1, true);

    apiMock
      .onPost(`/favorite/1/1`)
      .reply(200, [{fake: true}]);

    return sendFilmStatus(dispatch, () => {}, api)
          .then(() => {
            expect(dispatch).toHaveBeenCalledWith({
              type: ActionType.CHECK_IS_DATA_SENDING,
              payload: false,
            });
          });
  });
});
import { FAIL_BOOKMARKS, RECEIVE_BOOKMARKS, REQUEST_BOOKMARKS, SET_BOOKMARK_ID } from "./actions";
import { data } from "./data";
import { IActions, IBookmarkState } from "./types";

const initialState = data;

const setBookmarkId = (bookmarkIds: number[], bookmarkId: number) => {
  const bookmarkIdIndex = bookmarkIds.indexOf(bookmarkId


han dispels the effect."
function modifier_imba_chen_holy_persuasion_teleport:OnTakeDamage(keys)
	if not IsServer() then return end

	if keys.unit == self:GetParent() and keys.attacker ~= self:GetParent() and (keys.attacker:IsRealHero() or keys.attacker:IsRoshan()) and keys.original_damage > 0 then
		self:Destroy()
	end
end

-------------------------------------------
-- HOLY PERSUASION IMMORTALIZED MODIFIER --
-------------------------------------------

function modifier_imba_chen_holy_persuasion_immortalized:IsDebuff()			return false end
function modifier_imba_chen_holy_persuasion_immortalized:IsPurgable()		return false end
function modifier_imba_chen_holy_persuasion_immortalized:RemoveOnDeath()	return false end

function modifier_imba_chen_holy_persuasion_immortalized:GetStatusEffectName()
	return "particles/status_fx/status_effect_medusa_stone_gaze.vpcf"
end

function modifier_imba_chen_holy_persuasion_immortalized:OnCreated()
	self.distance	= self:GetAbility():GetSpecialValueFor("teleport_distance")

	if not IsServer() then return end

	if self:GetCaster() and not self:GetCaster():IsNull() and self:GetAbility() and self:GetParent():IsAlive() and self:GetCaster():IsAlive() then
		-- If the initial immortalize vector for the ability hasn't been set yet, do so now (starts North-East)
		if not self:GetAbility().immortalize_vector then
			self:GetAbility().immortalize_vector = RotatePosition(Vector(0, 0, 0), QAngle(0, 45, 0), Vector(self.distance * 2, 0, 0))
		end

		-- Use the saved immortalize vector for this modifier/creep instance
		self.immortalize_vector	= self:GetAbility().immortalize_vector

		self:GetParent():SetAbsOrigin(GetGroundPosition(self:GetCaster():GetAbsOrigin() + self.immortalize_vector, nil))
		self:GetParent():MoveToNPC(self:GetCaster())

		-- Rotate the immortalize vector 90 degrees clockwise to use for the next unit that gets ported
		self:GetAbility().immortalize_vector = RotatePosition(Vector(0, 0, 0), QAngle(0, -90, 0), self:GetAbility().immortalize_vector)

		-- self:GetParent():SetForwardVector(self.immortalize_vector)
		-- self:GetParent():Stop()
		-- self:StartIntervalThink(FrameTime())
		self:StartIntervalThink(0.1)
	else
		self:GetParent():ForceKill(false)
	end
end

-- function modifier_imba_chen_holy_persuasion_immortalized:OnIntervalThink()
	-- if not IsServer() then return end

	-- if self:GetCaster() and not self:GetCaster():IsNull() and self:GetAbility() and self:GetParent():IsAlive() and self:GetCaster():IsAlive() then
		-- self:GetParent():SetAbsOrigin(GetGroundPosition(self:GetCaster():GetAbsOrigin() + self.immortalize_vector, nil))
		-- self:GetParent():SetForwardVector(self.immortalize_vector)
	-- else
		-- self:GetParent():ForceKill(false)
		-- self:StartIntervalThink(-1)
		-- self:Destroy()
	-- end
-- end

function modifier_imba_chen_holy_persuasion_immortalized:OnIntervalThink()
	if not self:GetAbility() then
		self:GetParent():ForceKill(false)
	end
	-- if ((self:GetCaster():GetAbsOrigin() + self.immortalize_vector) - self:GetParent():GetAbsOrigin()):Length2D() > self.distance then
		-- self:GetParent():SetAbsOrigin(GetGroundPosition(


.thin-line-t {
  position: relative;
}
.thin-line-t:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 0.026667rem;
  left: 0;
  background-color: #e7e7e7;
  transform: scaleY(.5);
  -webkit-transform: scaleY(.5);
}
html.night-mode .thin-line-t:before {
  background-color: #2a2a2a;
}
.thin-line-t:before {
  top: 0;
}
.defalut-face {
  position: relative;
}
.defalut-face:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-image: url(//s1.hdslb.com/bfs/static/jinkela/read-mobile/assets/noface.gif);
  z-index: -1;
}
.bg-icon {
  display: inline-block;
  font-style: normal;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 50%;
}
.icon-live {
  background-image: url(//s1.hdslb.com/bfs/static/jinkela/read-mobile/assets/icon_live_animation.gif);
}
.icon-circle-loading {
  background-image: url(//s1.hdslb.com/bfs/static/jinkela/read-mobile/assets/circle-loading.png);
  background-size: cover;
  -webkit-animation: circleLoading .3s linear infinite;
  animation: circleLoading .3s linear infinite;
}
.lazy-module {
  border-color: #f4f4f4;
}
html.night-mode .lazy-module {
  border-color: #030303;
}
.lazy-module:not(.is-loaded) {
  background-color: #f4f4f4;
}
html.night-mode .lazy-module:not(.is-loaded) {
  background-color: #030303;
}
.v-btn--info .ic_more {
  display: none;
}
.v-drawer__wrap {
  -webkit-transform: none;
  transform: none;
}
.v-drawer__footer {
  font-size: 0.373333rem;
}
.v-toast,
.v-toast__wrap {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.center-toast {
  font-size: 0.373333rem;
}
.night-mode .theme-color-label {
  color: var(--dark-theme-color)!important;
}
.night-mode .drawer-scroll-box {
  background-color: rgba(0,0,0,.5);
}
.night-mode .like-action-circle,
.night-mode .tabbar-cnt-box {
  -webkit-box-shadow: none;
  box-shadow: none;
}
.night-mode .long-like-progress .light {
  display: none;
}
.night-mode .long-like-progress .dark {
  display: block;
}
.night-mode .read-list-btn {
  -webkit-box-shadow: none;
  box-shadow: none;
}
.night-mode .read-list-cnt .list-cnt-item.is-active .item-icon-box {
  position: relative;
  height: 0.426667rem;
}
.night-mode .read-list-cnt .list-cnt-item.is-active .item-icon-box:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0


public INDArray floor(INDArray x) {
    NDValidation.validateNumerical("floor", "x", x);
    return Nd4j.exec(new org.nd4j.linalg.api.ops.impl.transforms.same.Floor(x));
  }

  /**
   * Pairwise floor division operation, out = floor(x / y)

   *
   * Note: supports broadcasting if x and y have different shapes and are broadcastable.

   * For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]

   * Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html

   *
   * @param x Input variable (NUMERIC type)
   * @param y Input variable (NUMERIC type)
   * @return output Output variable (NUMERIC type)
   */
  public INDArray floorDiv(INDArray x, INDArray y) {
    NDValidation.validateNumerical("floorDiv", "x", x);
    NDValidation.validateNumerical("floorDiv", "y", y);
    return Nd4j.exec(new org.nd4j.linalg.api.ops.impl.transforms.pairwise.arithmetic.FloorDivOp(x, y))[0];
  }

  /**
   * Pairwise Modulus division operation

   *
   * Note: supports broadcasting if x and y have different shapes and are broadcastable.

   * For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]

   * Broadcast rules are the same as NumPy: https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html

   *
   * @param x Input variable (NUMERIC type)
   * @param y Input variable (NUMERIC type)
   * @return output Output variable (NUMERIC type)
   */
  public INDArray floorMod(INDArray x, INDArray y) {
    NDValidation.validateNumerical("floorMod", "x", x);
    NDValidation.validateNumerical("floorMod", "y", y);
    return Nd4j.exec(new org.nd4j.linalg.api.ops.impl.transforms.pairwise.arithmetic.FloorModOp(x, y))[0];
  }

  /**
   * Scalar floor modulus operation

   *
   * @param x Input variable (NUMERIC type)
   * @param value Scalar value for op
   * @return output Output variable (NUMERIC type)
   */
  public INDArray floorMod(INDArray x, double value) {
    NDValidation.validateNumerical("floorMod", "x", x);
    return Nd4j.exec(new org.nd4j.linalg.api.ops.impl.scalar.ScalarFMod(x, value));
  }

  /**
   * Hamming distance reduction operation. The output contains the cosine distance for each

   * tensor/subset along the specified dimensions:

   * out = count( x[i] != y[i] )

   *
   * @param x Input variable x (NUMERIC type)
   * @param y Input variable y (NUMERIC type)
   * @param keepDims Whether to preserve original dimensions or not
   * @param isComplex Depending on the implementation, such as distance calculations, this can determine whether all distance calculations for all points should be done.
   * @param dimensions Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
   * @return output Output variable (NUMERIC type)
   */
  public INDArray hammingDistance(INDArray x, INDArray y, boolean keepDims, boolean isComplex,
      long... dimensions) {
    NDValidation.validateNumerical("hammingDistance", "x", x);
    NDValidation.validateNumerical("hammingDistance", "y", y);
    Preconditions.checkArgument(dimensions.length >= 0, "dimensions has


llback2 closure, arg1, arg2) native;
}

makeA() native;

void setup() {
  JS('', r"""
(function(){
  function A() {}
  A.prototype.foo0 = function(closure) { return closure(); };
  A.prototype.foo1 = function(closure, arg1) { return closure(arg1); };
  A.prototype.foo2 = function(closure, arg1, arg2) {
    return closure(arg1, arg2);
  };
  self.makeA = function(){return new A()};
  self.nativeConstructor(A);
})()""");
  applyTestExtensions(['A']);
}

main() {
  nativeTesting();
  setup();
  var a = makeA();
  Expect.equals(42, a.foo0(() => 42));
  Expect.equals(43, a.foo1((arg1) => arg1, 43));
  Expect.equals(44, a.foo2((arg1, arg2) => arg1 + arg2, 21, 23));

  A aa = a;
  Expect.equals(42, aa.foo0(() => 42));
  Expect.equals(43, aa.foo1((arg1) => arg1, 43));
  Expect.equals(44, aa.foo2((arg1, arg2) => arg1 + arg2, 21, 23));
}
// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import "native_testing.dart";

// Test to see if resolving a hidden native class's method interferes with
// subsequent resolving the subclass's method.  This might happen if the
// superclass caches the method in the prototype, so shadowing the dispatcher
// stored on Object.prototype.

@Native("A")
class A {
  foo() => 'A.foo ${bar()}';
  bar() => 'A.bar';
}

@Native("B")
class B extends A {
  bar() => 'B.bar';
}

@Native("C")
class C extends B {
  foo() => 'C.foo; super.foo = ${super.foo()}';
  bar() => 'C.bar';
}

@Native("D")
class D extends C {
  bar() => 'D.bar';
}

makeA() native;
makeB() native;
makeC() native;
makeD() native;

void setup() {
  JS('', r"""
(function(){
  // This code is inside 'setup' and so not accessible from the global scope.
  function inherits(child, parent) {
    if (Object.getPrototypeOf(child.prototype)) {
      Object.setPrototypeOf(child.prototype, parent.prototype);
    } else {
      function tmp() {};
      tmp.prototype = parent.prototype;
      child.prototype = new tmp();
      child.prototype.constructor = child;
    }
  }

  function A(){}
  function B(){}
  inherits(B, A);
  function C(){}
  inherits(C, B);
  function D(){}
  inherits(D, C);

  self.makeA = function(){return new A()};
  self.makeB = function(){return new B()};
  self.makeC = function(){return new C()};
  self.makeD = function(){return new D()};

  self.nativeConstructor(A);
  self.nativeConstructor(B);
  self.nativeConstructor(C);
  self.nativeConstructor(D);
})()""");
  applyTestExtensions(['A', 'B', 'C', 'D']);
}

main() {
  nativeTesting();
  setup();

  var a = makeA();
  var b = makeB();
  var c = makeC();
  var d = makeD();

  Expect.equals('A.foo A.bar', a.foo());
  Expect.equals('A.foo B.bar', b.foo());
  Expect.equals('C.foo; super.foo = A.foo C.bar', c.foo());
  Expect.equals('C.foo; super.foo = A.foo D.bar', d.foo());
}
// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
// for details. All rights


rs = {
        {
            id = 5133434,
            username = 'aqualls',
            name = 'Amy Qualls',
            state = 'active',
            locked = false,
            avatar_url = 'https://gitlab.com/uploads/-/system/user/avatar/5133434/avatar.png',
            web_url = 'https://gitlab.com/aqualls',
        },
    },
    source_project_id = 34675721,
    target_project_id = 34675721,
    labels = {
        'Category:GitLab CLI',
        'Support Team Contributions',
        'Technical Writing',
        'cli',
        'devops::create',
        'documentation',
        'group::code review',
        'maintenance::refactor',
        'section::dev',
        'type::maintenance',
    },
    draft = false,
    imported = false,
    imported_from = 'none',
    work_in_progress = false,
    milestone = {
        id = 4599724,
        iid = 108,
        group_id = 9970,
        title = '17.9',
        description = nil,
        state = 'active',
        created_at = '2024-05-24T19:18:50.640Z',
        updated_at = '2024-05-24T19:18:50.640Z',
        due_date = '2025-02-14',
        start_date = '2025-01-11',
        expired = false,
        web_url = 'https://gitlab.com/groups/gitlab-org/-/milestones/108',
    },
    merge_when_pipeline_succeeds = false,
    merge_status = 'unchecked',
    detailed_merge_status = 'unchecked',
    merge_after = nil,
    sha = 'a9173a2bd75187ec8f5cdec4f09aeb81b36b29da',
    merge_commit_sha = nil,
    squash_commit_sha = nil,
    discussion_locked = nil,
    should_remove_source_branch = nil,
    force_remove_source_branch = true,
    prepared_at = '2025-02-10T13:52:45.253Z',
    reference = '!1906',
    references = {
        short = '!1906',
        relative = '!1906',
        full = 'gitlab-org/cli!1906',
    },
    web_url = 'https://gitlab.com/gitlab-org/cli/-/merge_requests/1906',
    time_stats = {
        time_estimate = 0,
        total_time_spent = 0,
        human_time_estimate = nil,
        human_total_time_spent = nil,
    },
    squash = true,
    squash_on_merge = true,
    task_completion_status = {
        count = 1,
        completed_count = 1,
    },
    has_conflicts = false,
    blocking_discussions_resolved = true,
    approvals_before_merge = nil,
}


 Headers({ "Content-Type": "application/json" }),
};

@Injectable({ providedIn: "root" })
export class ContactService {
  public static BaseUrl = "http://localhost:6565/";

  constructor(private http: HttpClient) {}

  /**
   *
   * @param data :Object
   * POST /contacts
   */
  postcontactdata(data) {
    try {
      return this.http
        .post(ContactService.BaseUrl + "contacts", data)
        .pipe(map((response: Response) => response));
    } catch (exception) {
      return of();
    }
  }
}
import {
  IMakeRequestSuccessResponse, IMakeRequestFailureResponse, IMakeRequestOptions
} from '../types.ts';

/**
 * Wrapper of fetch function. Logic is applied to standardize error handling mechanism.
 */
export const makeRequest = async (
  method: string,
  url: string,
  responseType = 'json',
  options?: IMakeRequestOptions
): Promise<
  IMakeRequestSuccessResponse | IMakeRequestFailureResponse
> => {
  try {
    const response: Response = await fetch(url, {
      method,
      headers: options?.headers,
      body: options?.body
    });

    const responseHeaders: Headers = response.headers;
    const payload = responseType === 'json'
      ? await response.json()
      : responseType === 'blob'
        ? await response.blob()
        : await response.text();

    return {
      status: 'SUCCESS',
      responseHeaders,
      payload
    };
  } catch (error) {
    return {
      status: 'FAILED',
      errorCode: 'CATCHED_MAKE_REQUEST_ERROR',
      detail: error.message
    };
  }
};

/**
 * Detects if the reponse payload is a success one or not.
 * Type guards applied here.
 */
export const isRequestSuccess = (
  object: IMakeRequestSuccessResponse | IMakeRequestFailureResponse
): object is IMakeRequestSuccessResponse => object && !Object.prototype.hasOwnProperty.call(object, 'errorCode');
import { Application, NextFunction, Request, Response } from "express";
import { StatusCodes } from "http-status-codes";

interface IError extends Error {
	message: string;
	httpStatusCode: StatusCodes;
}

const badRequestHandler = (
	err: IError,
	req: Request,
	res: Response,
	next: NextFunction
) => {
	if (err.httpStatusCode === StatusCodes.BAD_REQUEST) {
		return res
			.status(400)
			.json({ errors: err.message || "Bad Request!", code: 400 });
	}
	next(err);
};

const notFoundHandler = (
	err: IError,
	req: Request,
	res: Response,
	next: NextFunction
) => {
	if (err.httpStatusCode === StatusCodes.NOT_FOUND) {
		return res.status(StatusCodes.NOT_FOUND).json({
			errors: err.message || "Not Found",
			code: StatusCodes.NOT_FOUND,
		});
	}
	next(err);
};

const unAuthorizedHandler = (
	err: IError,
	req: Request,
	res: Response,
	next: NextFunction
) => {
	if (err.httpStatusCode === StatusCodes.UNAUTHORIZED) {
		return res.status(StatusCodes.UNAUTHORIZED).json({
			error: err.message || "Unauthorized",
			code: StatusCodes.UNAUTHORIZED,
		});
	}

	next(err);
};

const forbiddenHandler = (
	err: IError,
	req: Request,
	res: Response,
	next: NextFunctio


.vertices.sort_by(|a, b| angle_to(a)
                .partial_cmp(&angle_to(b))
                .unwrap_or(Ordering::Equal));
            // Insert the mouse as a vertex for the center of the polygon
            self.vertices.insert(0, Vertex {
                pos: mouse,
                tex_pos: None,
                col: Color::white()
            });
        }
    }

    fn draw(&mut self, window: &mut Window) {
        window.clear(Color::black());
        if self.vertices.len() >= 3 {
            // Calculate the number of triangles needed to draw the poly
            let triangle_count = self.vertices.len() as u32 - 1;
            let indices = repeat(0.0)
                // Prepare an iterator with the correct amount of items
                .take(triangle_count as usize)
                // Index each item in the iterator
                .enumerate()
                // Convert the indices to drawable triangles
                .map(|(index, z)| GpuTriangle {
                    z,
                    indices: [0,
                        index as u32 + 1,
                        (index as u32 + 1) % triangle_count + 1],
                    image: None
                });
            // Draw the light
            window.add_vertices(self.vertices.iter().cloned(), indices);
        }
        window.present();
    }
}

fn main() {
    run::<Raycast>(WindowBuilder::new("Raycast", 800, 600));
}
<filename>src/models/pusher.rs
//! Matrix pusher.

use diesel::pg::PgConnection;
use diesel::prelude::*;
use diesel::result::Error as DieselError;
use ruma_identifiers::UserId;

use crate::error::ApiError;
use crate::schema::pushers;

/// Data need for kind is http.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct PusherData {
    /// Required if kind is http. The URL to use to send notifications to.
    pub url: Option<String>,
}

/// Options for updating pusher
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct PusherOptions {
    /// The preferred language for receiving notifications (e.g. 'en' or 'en-US')
    pub lang: String,
    /// The kind of pusher. "http" is a pusher that sends HTTP pokes.
    pub kind: String,
    /// A dictionary of information for the pusher implementation itself.
    pub data: PusherData,
    /// A string that will allow the user to identify what device owns this pusher.
    pub device_display_name: String,
    /// This is a reverse-DNS style identifier for the application. Max length, 64 chars.
    pub app_id: String,
    /// This string determines which set of device specific rules this pusher executes.
    pub profile_tag: Option<String>,
    /// This is a unique identifier for this pusher. Max length, 512 bytes.
    pub pushkey: String,
    /// A string that will allow the user to identify what application owns this pusher.
    pub app_display_name: String,
    /// If true, the homeserver should add another pusher with the given pushkey and
    /// App ID in addition to any others with different user IDs.
    /// Otherwise, the homeserver must remove any other pushers
    /// with the same App ID and pushkey for different users.
    ///
    /// The default is false.
    #[serde(default = "default_append")]
    #[serde(skip_serializing_if = "super::is_false")]
    pub append: bool,
}

impl PusherOptions {
    /// Check for url when kind is http.
    pub fn is_valid(&self) -> bool {
        if self.kind == "http" {
            return self.data.url.is_some();
        }
        true
    }
}

impl From<Pusher> for PusherOptions {
    fn from(pusher: Pusher) -> Self {
        Self {
            lang: pusher.lang,
            kind: pusher.kind,
            data: PusherData { url: pusher


users_table();
    let sean = find_user_by_name("Sean", &connection);
    let new_post = sean.new_post("Hello", Some("world"));
    insert(&new_post).into(posts::table).execute(&connection).unwrap();

    let changes = Changes { user_id: 1, title: None, body: "earth".into() };
    update(posts::table)
        .set(&changes)
        .execute(&connection)
        .unwrap();
    let post = posts::table.order(posts::id.desc()).first::<Post>(&connection).unwrap();

    let expected_post = Post::new(post.id, sean.id, "Hello".into(), Some("earth".into()));
    assert_eq!(expected_post, post);
}

#[test]
fn can_update_with_struct_containing_single_field() {
    #[changeset_for(posts)]
    struct SetBody {
        body: String,
    }

    let connection = connection_with_sean_and_tess_in_users_table();
    let sean = find_user_by_name("Sean", &connection);
    let new_post = sean.new_post("Hello", Some("world"));
    insert(&new_post).into(posts::table).execute(&connection).unwrap();

    let changes = SetBody { body: "earth".into() };
    update(posts::table)
        .set(&changes)
        .execute(&connection)
        .unwrap();
    let post = posts::table.order(posts::id.desc()).first::<Post>(&connection).unwrap();

    let expected_post = Post::new(post.id, sean.id, "Hello".into(), Some("earth".into()));
    assert_eq!(expected_post, post);
}

#[test]
fn struct_with_option_fields_treated_as_null() {
    #[changeset_for(posts, treat_none_as_null="true")]
    #[derive(Identifiable)]
    #[table_name="posts"]
    struct UpdatePost {
        id: i32,
        title: String,
        body: Option<String>,
    }

    let connection = connection_with_sean_and_tess_in_users_table();
    let sean = find_user_by_name("Sean", &connection);
    let new_post = sean.new_post("Hello", Some("world"));
    insert(&new_post).into(posts::table)
        .execute(&connection).unwrap();
    let post = posts::table.order(posts::id.desc()).first::<Post>(&connection).unwrap();

    let changes = UpdatePost { id: post.id, title: "<NAME>".into(), body: None };
    let expected_post = Post::new(post.id, sean.id, "<NAME>".into(), None);
    let updated_post = changes.save_changes(&connection);
    let post_in_database = posts::table.find(post.id).first(&connection);

    assert_eq!(Ok(&expected_post), updated_post.as_ref());
    assert_eq!(Ok(&expected_post), post_in_database.as_ref());
}
<gh_stars>0
extern crate cgmath;
type Float3 = cgmath::Vector3<f64>;
pub use cgmath::prelude::*;

use material::Material;
use std::f64::*;

#[derive(Copy, Clone)]
pub struct Hit {
    pub p: Float3,
    pub n: Float3,
    pub t: f64,
    pub material: Material,
}

impl Hit {
    // Spawn a new Hit result data structure
    pub fn new(p: Float3, n: Float3, t: f64, material: Material) -> Hit


ANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
}
.annotationRange.warning {
	/* images/squiggly_warning.png */
	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
}
.annotationRange.currentBracket {
}
.annotationRange.matchingBracket {
	outline: 1px solid red;
}
.annotationRange.readOccurrence {
	background-color: lightgray;
}
.annotationRange.writeOccurrence {
	background-color: yellow;
}
.annotationRange.matchingSearch {
	background-color: #C3E1FF;
}
.annotationRange.currentSearch {
	background-color: #53D1FF;
}
.annotationRange.linkedGroup {
	outline: 1px solid grey;
}
.annotationRange.currentLinkedGroup {
	background-color: #C3E1FF;
}
.annotationRange.selectedLinkedGroup {
	background-color: #53D1FF;
}

/* Styles for lines of text */
.annotationLine {
}
.annotationLine.currentLine {
	background-color: #EAF2FE;
}

/*
Layout classes used in Orion.
The model is one of a "side panel" defaulting to 1/3 width on the left and a "main panel" taking the rest
of the room.  A page always has a fixed header but may have a fluid footer (at the bottom of content) or
a fixed footer on the bottom of the page.

To split a page in different proportions, modify the left hand position of the split bar to override the
33% width position described in the class splitLayout

The transition delays used for splitter animation (0.5) have a relationship with the animation delay used
by the splitter bar.  If these values change, then change the delay in the splitter.

Items that should appear on top of other orion visual components should have a z-index of 100 or greater.  Values
under 100 are used to achieve layering of the header, footer, and splitters.
*/

/*
There are implied LESS variables here, for now set up as layout classes that live here and refer to the
hard-coded numbers elsewhere.
*/

/* $HeaderHeight */
.headerLayout {
	height: 35px;
}

/* $ToolbarHeight */
.toolbarLayout {
	height: 35px;

	display: -webkit-box;
	display: -moz-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	display: flex;
	flex-


// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)

using System;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.NRefactory.TypeSystem;

namespace ICSharpCode.NRefactory.VB.Ast
{
	public enum ClassType
	{
		Class,
		Struct,
		Interface,
		Module
	}

	public class TypeDeclaration : AttributedNode
	{
		public readonly static Role<AttributedNode> MemberRole = new Role<AttributedNode>("Member");
		public readonly static Role<AstType> InheritsTypeRole = new Role<AstType>("InheritsType", AstType.Null);
		public readonly static Role<AstType> ImplementsTypesRole = new Role<AstType>("ImplementsTypes", AstType.Null);

		public AstNodeCollection<AttributedNode> Members {
			get { return base.GetChildrenByRole(MemberRole); }
		}

		public ClassType ClassType { get; set; }

		public Identifier Name {
			get { return GetChildByRole(Roles.Identifier); }
			set { SetChildByRole(Roles.Identifi


访问，以致拖累了整个微服务1的性能，可把聚合a，从微服务1中剥离，独立为微服务2以应对高性能场景
- 随业务发展，发现微服务3的领域模型变化，聚合d会更适合放到微服务1的领域模型。即可将聚合d整体迁移到微服务1。注意定义好聚合间的代码边界
- 架构演进后，微服务1从最初包含聚合a、b、c，演进为包含聚合b、c、d的新领域模型和微服务

可见，好的聚合和代码模型的边界设计，可让你快速应对业务变化，轻松实现领域模型和微服务架构演进。

### 微服务内服务的演进

在微服务内部，实体的方法被领域服务组合和封装，领域服务又被应用服务组合和封装。在服务逐层组合和封装的过程中，你会发现这样一个有趣的现象。
![](https://img-blog.csdnimg.cn/20201011030454710.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_SmF2YUVkZ2U=,size_16,color_FFFFFF,t_70#pic_center)
服务设计时，你并不一定能完整预测有哪些下层服务会被多少个上层服务组装，因此领域层通常只提供一些原子服务，比如领域服务a、b、c。但随系统功能增强和外部接入越来越多，应用服务不断丰富。终有一日，你会发现领域服务b和c同时多次被多个应用服务调用了，执行顺序也基本一致。这时你可以考虑将b和c合并，再将应用服务中b、c的功能下沉到领域层，演进为新的领域服务（b+c）。这样既减少了服务的数量，也减轻了上层服务组合和编排的复杂度。

这就是服务演进，领域模型会越来越能适应需求快速变化。

## 4 从MVC跨越到DDD

由于层间低耦合，可专注本层设计，而不必关心其它层，也不必担心自己的设计会影响其它层。即DDD成功降低层与层之间的依赖。

分层架构使得程序结构更清晰，升级和维护更容易。修改某层代码时，只要本层接口参数不变，其它层不必修改。即使本层接口发生变化，也只影响相邻的上层，修改工作量小且可控。

传统企业应用大多是单体架构，而单体架构则大多是三层架构。三层架构解决了程序内代码间调用复�


Run module.
    outputs = module(*inputs)
    for hook in hooks:
        hook.remove()

    # Identify unique outputs, parameters, and buffers.
    tensors_seen = set()
    for e in entries:
        e.unique_params = [t for t in e.mod.parameters() if id(t) not in tensors_seen]
        e.unique_buffers = [t for t in e.mod.buffers() if id(t) not in tensors_seen]
        e.unique_outputs = [t for t in e.outputs if id(t) not in tensors_seen]
        tensors_seen |= {id(t) for t in e.unique_params + e.unique_buffers + e.unique_outputs}

    # Filter out redundant entries.
    if skip_redundant:
        entries = [e for e in entries if len(e.unique_params) or len(e.unique_buffers) or len(e.unique_outputs)]

    # Construct table.
    rows = [[type(module).__name__, 'Parameters', 'Buffers', 'Output shape', 'Datatype']]
    rows += [['---'] * len(rows[0])]
    param_total = 0
    buffer_total = 0
    submodule_names = {mod: name for name, mod in module.named_modules()}
    for e in entries:
        name = '<top-level>' if e.mod is module else submodule_names[e.mod]
        param_size = sum(t.numel() for t in e.unique_params)
        buffer_size = sum(t.numel() for t in e.unique_buffers)
        output_shapes = [str(list(t.shape)) for t in e.outputs]
        output_dtypes = [str(t.dtype).split('.')[-1] for t in e.outputs]
        rows += [[
            name + (':0' if len(e.outputs) >= 2 else ''),
            str(param_size) if param_size else '-',
            str(buffer_size) if buffer_size else '-',
            (output_shapes + ['-'])[0],
            (output_dtypes + ['-'])[0],
        ]]
        for idx in range(1, len(e.outputs)):
            rows += [[name + f':{idx}', '-', '-', output_shapes[idx], output_dtypes[idx]]]
        param_total += param_size
        buffer_total += buffer_size
    rows += [['---'] * len(rows[0])]
    rows += [['Total', str(param_total), str(buffer_total), '-', '-']]

    # Print table.
    widths = [max(len(cell) for cell in column) for column in zip(*rows)]
    print()
    for row in rows:
        print('  '.join(cell + ' ' * (width - len(cell)) for cell, width in zip(row, widths)))
    print()

#----------------------------------------------------------------------------
# Tile a batch of images into a 2D grid.

def tile_images(x, w, h):
    assert x.ndim == 4 # NCHW => CHW
    return x.reshape(h, w, *x.shape[1:]).permute(2, 0, 3, 1, 4).reshape(x.shape[1], h * x.shape[2], w * x.shape[3])

#----------------------------------------------------------------------------


.deleteIfExists()
                }

                if (result.exit != 0) {
                    fail = true
                    logger.error("Patch ${patch.patchFile.path} failed:\n" + log.readText())
                }
            } else {
                upstream.path.resolve(patch.path.get())
                    .copyTo(patch.outputFile.path.createParentDirectories(), true)
            }
        }
        if (fail) {
            throw PaperweightException("Patch apply failures, review the log above")
        }
    }
}
@file:Suppress("UnstableApiUsage")

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        mavenCentral()
        maven("https://repo.papermc.io/repository/maven-public/")
    }
}

pluginManagement {
    includeBuild("build-logic")
    repositories {
        mavenCentral()
        gradlePluginPortal()
    }
}

plugins {
    id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
}

rootProject.name = "velocity"

sequenceOf(
    "api",
    "native",
    "proxy",
).forEach {
    val project = ":velocity-$it"
    include(project)
    project(project).projectDir = file(it)
}

// Include Configurate 3
val deprecatedConfigurateModule = ":deprecated-configurate3"
include(deprecatedConfigurateModule)
project(deprecatedConfigurateModule).projectDir = file("proxy/deprecated/configurate3")

// Log4J2 plugin
val log4j2ProxyPlugin = ":velocity-proxy-log4j2-plugin"
include(log4j2ProxyPlugin)
project(log4j2ProxyPlugin).projectDir = file("proxy/log4j2-plugin")
package com.paperpig.maimaidata.network

import okhttp3.OkHttpClient
import java.security.SecureRandom
import java.security.cert.X509Certificate
import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager

object UnsafeOkHttpClient {
    // Create a trust manager that does not validate certificate chains
    @JvmStatic
    val unsafeOkHttpClient: OkHttpClient.Builder

    // Install the all-trusting trust manager

        // Create an ssl socket factory with our all-trusting manager
        get() = try {
            // Create a trust manager that does not validate certificate chains
            val trustAllCerts =
                arrayOf<TrustManager>(
                    object : X509TrustManager {
                        override fun checkClientTrusted(
                            chain: Array<X509Certificate>,
                            authType: String
                        ) = Unit

                        override fun checkServerTrusted(
                            chain: Array<X509Certificate>,
                            authType: String
                        ) = Unit

                        override fun getAcceptedIssuers(): Array<X509Certificate> {
                            return arrayOf()
                        }
                    }
                )

            // Install the all-trusting trust manager
            val sslContext =
                SSLContext.getInstance("SSL")
            sslContext.init(null, trustAllCerts, SecureRandom())

            // Create an ssl socket factory with our all-trusting manager
            val sslSocketFactory = sslContext.socketFactory
            val builder = OkHttpClient.Builder()
            builder.sslSocketFactory(
                sslSocketFactory,
                trustAllCerts[0] as X509TrustManager
            )
            builder.hostnameVerifier { _, _ -> true }
        } catch (e: Exception) {
            throw RuntimeException(e)
        }
}package com.paperpig.maimaidata.network

import com.google.gson.JsonElement
import io.reactivex.Observabl


ransform='rotate(-22 6.499 8.175)' fill='%23000' fill-rule='nonzero'%3E%3Cuse filter='url(%23a)' xlink:href='%23b'/%3E%3Cpath stroke='%23FFF' d='M5.407.675c.52 0 .991.213 1.332.56.338.342.548.816.548 1.34v3.753l4.54.512a1.87 1.87 0 0 1 1.195.624c.297.337.477.781.477 1.264v5.047c0 .503-.198.986-.548 1.341a1.87 1.87 0 0 1-1.332.56H4.102l-4.349-3.449c-.06-1.896.354-2.26.771-2.472l.104-.05a1.862 1.862 0 0 1 1.494-.042l1.405.57V2.575c0-.524.21-.998.548-1.34.34-.347.812-.56 1.332-.56z' fill-rule='evenodd'/%3E%3C/g%3E%3Cg transform='translate(18 1)'%3E%3Cuse fill='%23000' filter='url(%23c)' xlink:href='%23d'/%3E%3Cpath stroke='%23D0F8FB' d='M51 .5c.966 0 1.841.392 2.475 1.025A3.489 3.489 0 0 1 54.5 4v6c0 .966-.392 1.841-1.025 2.475A3.489 3.489 0 0 1 51 13.5H4a3.489 3.489 0 0 1-2.475-1.025A3.489 3.489 0 0 1 .5 10V.5z' stroke-linejoin='square' fill='%2310A8BE'/%3E%3C/g%3E%3Cg fill='%23FFF' fill-rule='nonzero'%3E%3Cpath d='M33.17 11.166h4.041V10.05h-2.709V4.497H33.17zM38.372 11.166h1.332v-6.67h-1.332zM41.342 11.166h2.376c1.467 0 2.574-.621 2.574-1.962 0-.891-.522-1.404-1.242-1.575v-.036c.567-.207.91-.828.91-1.45 0-1.241-1.045-1.646-2.413-1.646h-2.205v6.669zm1.332-3.951V5.523h.792c.801 0 1.197.234 1.197.819 0 .53-.36.873-1.206.873h-.783zm0 2.925V8.196h.927c.918 0 1.395.279 1.395.927 0 .693-.495 1.017-1.395 1.017h-.927zM48.803 7.593V5.559h.864c.855 0 1.323.243 1.323.963 0 .71-.468 1.07-1.323 1.07h-.864zm2.295 3.573h1.485l-1.557-2.727c.765-.297 1.27-.918 1.27-1.917 0-1.53-1.108-2.025-2.512-2.025h-2.313v6.669h1.332v-2.52h.927l1.368 2.52zM52.682 11.166h1.35l.468-1.71h2.151l.468 1.71h1.404l-2.133-6.67h-1.575l-2.133 6.67zm2.106-2.745l.198-.73c.198-.692.387-1.448.567-2.177h.036c.198.71.378 1.485.585 2.178l.198.729h-1.584zM60.638 7.593V5.559h.864c.855 0 1.323.243 1.323.963 0 .71-.468 1.07-1.323 1.07h-.864zm2.295 3.573h1.485l-1.557-2.727c.765-.297 1.27-.918 1.27


rkflow:workflow-scm-step:2.11",
    "org.jenkins-ci.plugins.workflow:workflow-step-api:2.22",
    "org.jenkins-ci.plugins.workflow:workflow-support:3.5"
  )
  jenkinsPluginDependencies.forEach {
    "jenkinsPlugins"(it)
  }
  "jenkinsPlugins"("org.jenkins-ci.main:jenkins-core:2.222.4") {
    isTransitive = false
  }
}

tasks {
  wrapper {
    gradleVersion = "6.8"
  }

  dependencyUpdates {
    val rejectPatterns = listOf("alpha", "beta", "rc", "cr", "m").map { qualifier ->
      Regex("(?i).*[.-]$qualifier[.\\d-]*")
    }
    resolutionStrategy {
      componentSelection {
        all {
          if (rejectPatterns.any { it.matches(candidate.version) }) {
            reject("Release candidate")
          }
        }
      }
    }
  }

  withType<Jar>().configureEach {
    from(project.projectDir) {
      include("LICENSE.txt")
      into("META-INF")
    }
    manifest {
      attributes(
        mapOf(
          "Build-Revision" to gitCommitSha,
          "Implementation-Version" to project.version
        )
      )
    }
  }

  withType<Javadoc>().configureEach {
    options {
      header = project.name
      encoding = "UTF-8"
    }
  }

  withType<KotlinCompile>().configureEach {
    kotlinOptions.jvmTarget = "1.8"
  }

  test {
    useJUnitPlatform()
    systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
    project.findProperty("gradleTestVersions")?.let {
      // Will rerun some tests unfortunately using this method, but helps with CI
      systemProperty("testsupport.junit.ForGradleVersions.versions", it)
    }
    if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
      jvmArgs("-XshowSettings:vm", "-Xlog:gc*", "-Xmx512m", "-Xms256m")
    } else {
      jvmArgs("-XshowSettings:vm", "-XX:+PrintGCTimeStamps", "-XX:+UseG1GC", "-Xmx512m", "-Xms256m")
    }
  }

  val sourcesJar by registering(Jar::class) {
    group = JavaBasePlugin.DOCUMENTATION_GROUP
    description = "Assembles a JAR of the source code"
    archiveClassifier.set("sources")
    from(sourceSets.main.map { it.allSource })
  }

  // No Java code, so don't need the javadoc task.
  // Dokka generates our documentation.
  javadoc {
    enabled = false
  }

  dokka {
    dependsOn(sourceSets.main.map { it.classesTaskName })
    jdkVersion = 8
    outputFormat = "html"
    outputDirectory = "$buildDir/javadoc"
    sourceDirs = sourceSets.main.get().kotlin.srcDirs
    externalDocumentationLink {
      url = URL("https://docs.gradle.org/${GradleVersion.current().version}/javadoc/")
    }
    externalDocumentationLink {
      url = URL("https://docs.oracle.com/javase/8/docs/api/")
    }
    externalDocumentationLink {
      url = URL("https://square.github.io/javapoet/javadoc/javapoet/")
    }
  }

  val javadocJar by registering(Jar::class) {
    description = "Assembles a JAR of the generated Javadoc"
    from(dokka.map { it.outputDirectory })
    group = JavaBasePlugin.DOCUMENTATION


// Modified by Princeton University on June 9th, 2015
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T1 Processor File: tlu_tba_test.s
* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
*
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ========== Copyright Header End ============================================
*/
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Diag: tlu_tba_test.s
!! No. Threads: 1..4
!! Description:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#define PCONTEXT	0x10
#define SCONTEXT	0x10

#define MAIN_PAGE_NUCLEUS_ALSO
#define MAIN_PAGE_HV_ALSO

#include "enable_traps.h"
#include "boot.s"

#define T0_HTRAP_BASE_VA	0x100000
#define T0_TRAP_BASE_VA		0x1100000
#define T0_TRAP_BASE_PA		0x1001100000

#define T1_HTRAP_BASE_VA	0x300000
#define T1_TRAP_BASE_VA		0x1300000
#define T1_TRAP_BASE_PA		0x1001300000

#define T2_HTRAP_BASE_VA	0x500000
#define T2_TRAP_BASE_VA		0x1500000
#define T2_TRAP_BASE_PA		0x1001500000

#define T3_HTRAP_BASE_VA	0x700000
#define T3_TRAP_BASE_VA		0x1700000
#define T3_TRAP_BASE_PA		0x1001700000

.text
.global main
main:
	ta	T_CHANGE_HPRIV
	rdhpr	%hpstate, %l0
	rdpr	%pstate, %l1
	rd		%asr26, %l3
	and		%l3, 0x300, %l3
	sllx	%l3, 13, %l3
	setx	T0_HTRAP_BASE_VA, %g1, %g2
	wrhpr	%g2, %l3, %htba
	setx	T0_TRAP_BASE_VA, %g1, %g2
	wrpr	%g2, %l3, %tba
	wrpr	%l1, 4, %pstate
	wrhpr	%l0, 4, %hpsta


7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"],lightbulb:[384,512,[128161],"f0eb","M297.2 248.9C311.6 228.3 320 203.2 320 176c0-70.7-57.3-128-128-128S64 105.3 64 176c0 27.2 8.4 52.3 22.8 72.9c3.7 5.3 8.1 11.3 12.8 17.7c0 0 0 0 0 0c12.9 17.7 28.3 38.9 39.8 59.8c10.4 19 15.7 38.8 18.3 57.5L109 384c-2.2-12-5.9-23.7-11.8-34.5c-9.9-18-22.2-34.9-34.5-51.8c0 0 0 0 0 0s0 0 0 0c-5.2-7.1-10.4-14.2-15.4-21.4C27.6 247.9 16 213.3 16 176C16 78.8 94.8 0 192 0s176 78.8 176 176c0 37.3-11.6 71.9-31.4 100.3c-5 7.2-10.2 14.3-15.4 21.4c0 0 0 0 0 0s0 0 0 0c-12.3 16.8-24.6 33.7-34.5 51.8c-5.9 10.8-9.6 22.5-11.8 34.5l-48.6 0c2.6-18.7 7.9-38.6 18.3-57.5c11.5-20.9 26.9-42.1 39.8-59.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0c4.7-6.4 9-12.4 12.7-17.7zM192 128c-26.5 0-48 21.5-48 48c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16s-7.2 16-16 16zm0 384c-44.2 0-80-35.8-80-80l0-16 160 0 0 16c0 44.2-35.8 80-80 80z"],flag:[448,512,[127988,61725],"f024","M48 24C48 10.7 37.3 0 24 0S0 10.7 0 24L0 64 0 350.5 0 400l0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-100 80.3-20.1c41.


ProfileStream);

            try
            {
                // Save to JPEG Lossless CMYK
                using (JpegImage image = (JpegImage)Image.Load("056.jpg"))
                {
                    JpegOptions options = new JpegOptions();
                    options.ColorType = JpegCompressionColorMode.Cmyk;
                    options.CompressionType = JpegCompressionMode.Lossless;

                    // The custom profiles will be used.
                    options.RgbColorProfile = rgbColorProfile;
                    options.CmykColorProfile = cmykColorProfile;

                    image.Save(jpegStream, options);
                }

                // Load from JPEG Lossless CMYK
                jpegStream.Position = 0;
                rgbProfileStream.Position = 0;
                cmykProfileStream.Position = 0;
                using (JpegImage image = (JpegImage)Image.Load(jpegStream))
                {
                    image.RgbColorProfile = rgbColorProfile;
                    image.CmykColorProfile = cmykColorProfile;
                    image.Save("056_cmyk_custom_profiles.png", new PngOptions());
                }
                }
            finally
            {
                jpegStream.Dispose();
                rgbProfileStream.Dispose();
                cmykProfileStream.Dispose();
            }
            // ExEnd:SupportForCMYKAndYCCKColorModesInJPEGLosslessUsingRGBProfile

        }
    }

}


"""
Shared fixtures for job manager tests
"""

import pytest
from unittest.mock import Mock, AsyncMock

# Module-level mock fixtures that can be used by all test classes
@pytest.fixture
def mock_job_executor() -> Mock:
    """Create a mock job executor with all needed methods"""
    executor = Mock()
    executor.start_process = AsyncMock()
    executor.monitor_process_output = AsyncMock()
    executor.execute_command = AsyncMock()
    executor.execute_prune_task = AsyncMock()
    executor.execute_cloud_sync_task = AsyncMock()
    return executor

@pytest.fixture
def mock_database_manager() -> Mock:
    """Create a mock database manager"""
    db_manager = Mock()
    db_manager.get_repository_data = AsyncMock()
    db_manager.update_job_status = AsyncMock()
    db_manager.update_task_status = AsyncMock()
    db_manager.create_job = AsyncMock()
    db_manager.create_task = AsyncMock()
    db_manager.create_database_job = AsyncMock()
    return db_manager

@pytest.fixture
def mock_output_manager() -> Mock:
    """Create a mock output manager"""
    output_manager = Mock()
    output_manager.create_job_output = Mock()
    output_manager.add_output_line = AsyncMock()
    output_manager.stream_job_output = Mock()
    output_manager.get_job_output = Mock()
    return output_manager

@pytest.fixture
def mock_queue_manager() -> Mock:
    """Create a mock queue manager"""
    queue_manager = Mock()
    queue_manager.add_job = Mock()
    queue_manager.get_next_job = Mock()
    queue_manager.remove_job = Mock()
    queue_manager.initialize = AsyncMock()
    return queue_manager

@pytest.fixture
def mock_event_broadcaster() -> Mock:
    """Create a mock event broadcaster"""
    broadcaster = Mock()
    broadcaster.broadcast_job_update = Mock()
    broadcaster.broadcast_task_update = Mock()
    broadcaster.initialize = AsyncMock()
    return broadcaster

@pytest.fixture
def mock_secure_borg_command() -> Mock:
    """Create a mock secure borg command context manager"""
    mock_cm = Mock()
    mock_cm.__aenter__ = AsyncMock(
        return_value=(
            ["borg", "create", "repo::test-archive", "/tmp"],
            {"BORG_PASSPHRASE": "test"},
            None,
        )
    )
    mock_cm.__aexit__ = AsyncMock(return_value=None)
    return mock_cm

@pytest.fixture
def mock_notification_service() -> Mock:
    """Create a mock notification service"""
    notification_service = Mock()
    notification_service.load_config_from_storage = Mock()
    notification_service.send_notification = AsyncMock()
    return notification_service


env("OMP_NUM_THREADS", "2", 1);
  }

  // Add object that will finalize MPI on exit; Google Test owns this pointer
  ::testing::AddGlobalTestEnvironment(new MPIEnvironment);

  // Get the event listener list.
  ::testing::TestEventListeners& listeners =
    ::testing::UnitTest::GetInstance()->listeners();

  // Remove default listener
  delete listeners.Release(listeners.default_result_printer());

  // Adds MPI listener; Google Test owns this pointer
  listeners.Append(new MPIMinimalistPrinter);

  // Run tests, then clean up and exit
  return RUN_ALL_TESTS();
}
/*
  Tencent is pleased to support the open source community by making
  Plato available.
  Copyright (C) 2019 THL A29 Limited, a Tencent company.
  All rights reserved.

  Licensed under the BSD 3-Clause License (the "License"); you may
  not use this file except in compliance with the License. You may
  obtain a copy of the License at

  https://opensource.org/licenses/BSD-3-Clause

  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.

  See the AUTHORS file for names of contributors.
*/

#include "plato/util/aliastable.hpp"

#include <cmath>
#include <cstdio>
#include <vector>
#include <random>
#include <algorithm>

#include "gtest/gtest.h"
#include "gmock/gmock.h"

TEST(AliasMethod, FloatSampling) {
  std::vector<float> probs({ 0.1, 0.2, 0.5, 0.2 });
  plato::alias_table_t<float> alias(probs.data(), probs.size());

  for (size_t i = 1; i < probs.size(); ++i) {
    probs[i] = probs[i] + probs[i - 1];
  }

  std::mt19937 g1(777);
  std::uniform_real_distribution<float> dist(0, probs.back());
  const size_t total_count = 10000000;

  std::vector<size_t> pre_counts(probs.size(), 0);
  for (size_t i = 0; i < total_count; ++i) {
    float next = dist(g1);
    auto it = std::lower_bound(probs.begin(), probs.end(), next);
    pre_counts[it - probs.begin()]++;
  }
  for (size_t i = 0; i < pre_counts.size(); ++i) {
    fprintf(stderr, "native: %lu,%lu\n", i, pre_counts[i]);
  }

  std::mt19937 g2(777);
  std::vector<size_t> alias_counts(probs.size(), 0);
  for (size_t i = 0; i < total_count; ++i) {
    alias_counts[alias.sample(g2)]++;
  }
  for (size_t i = 0; i < pre_counts.size(); ++i) {
    fprintf(stderr, "alias: %lu,%lu\n", i, alias_counts[i]);
  }

  for (size_t i = 0; i < probs.size(); ++i) {
    ASSERT_L


(--text-color)}.editBox .homeHeader .setting[data-v-748aedbe]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1000;display:flex;flex-direction:row;justify-content:flex-start;align-items:center}.editBox .homeHeader .setting .warning[data-v-748aedbe]{color:red;margin-right:20px;cursor:pointer}.editBox .homeHeader .setting .publish[data-v-748aedbe]{color:var(--el-color-primary);margin-right:20px;cursor:pointer}.editBox .homeHeader .setting .desktop[data-v-748aedbe]{color:gray;cursor:pointer}.editBox .homeHeader .setting .desktop[data-v-748aedbe]:hover{color:var(--text-color)}.editBox .homeHeader .setting .dropdownLink[data-v-748aedbe]{color:gray;cursor:pointer}.editBox .homeHeader .setting .dropdownLink[data-v-748aedbe]:hover{color:var(--text-color)}.editBox .homeHeader .headerTool[data-v-748aedbe]{display:flex;flex-direction:row;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.editBox .homeHeader .headerTool .control[data-v-748aedbe]{color:#2a598a;cursor:pointer}.editBox .mainEdit[data-v-748aedbe]{padding:10px}.editBox .mainEdit .configForm[data-v-748aedbe]{margin-top:10px}.editBox .mainEdit .configForm .inLine[data-v-748aedbe]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.editBox .mainEdit .configForm .inLine .formItem[data-v-748aedbe]{flex:1;margin-right:10px}.editBox .mainEdit .configForm .inLine .formItem .initIcon[data-v-748aedbe]{width:22px;height:22px;cursor:pointer}.editBox .mainEdit .configForm .inLine .formItem .distUpload[data-v-748aedbe]{cursor:pointer}.editBox .mainEdit .configForm .inLine .formItem .distUpload[data-v-748aedbe]:hover{color:var(--text-color)}.editBox .mainEdit .configForm .inLine .formItem .editIcon[data-v-748aedbe]{cursor:pointer;font-size:20px;color:gray}.editBox .mainEdit .configForm .inLine .formItem .editIcon[data-v-748aedbe]:hover{color:var(--text-color)}.editBox .mainEdit .configForm .inLine .formItem .iconChange[data-v-748aedbe]{width:22px;height:22px;display:flex;justify-content:center;align-items:center;position:relative}.editBox .mainEdit .configForm .inLine .formItem .iconChange .closeIcon[data-v-748aedbe]{position:absolute;top:-6px;right:-6px;cursor:pointer}.editBox .mainEdit .configForm .inLine .formItem .iconPreview[data-v-748aedbe]{width:22px;height:22px;color:gray;border:1px dashed gray;border-radius:4px;display:flex;justify-content:center;align-items:center;cursor:pointer}.editBox .mainEdit .configForm .inLine .formItem .iconPreview[data-v-748aedbe]:hover{color:var(--text-color);border-color:var(--text-color)}.editBox .mainEdit .configForm .checkBox[data-v-748aedbe]{display:flex;flex-direction:row;


igram',
      },
      {
        id: Unit.MASS_ID,
        phrases: ['microgram', 'micrograms'],
        ratio: 1e-6,
        type: 'microgram',
      },
      {
        id: Unit.MASS_ID,
        phrases: ['imperialton'],
        ratio: '1.016e+6',
        type: 'imperialton',
      },
      {
        id: Unit.MASS_ID,
        phrases: ['uston'],
        ratio: '907185',
        type: 'uston',
      },
      {
        id: Unit.MASS_ID,
        phrases: ['stone', 'stones'],
        ratio: '6350.29',
        type: 'stone',
      },
      {
        id: Unit.MASS_ID,
        phrases: ['pound', 'pounds'],
        ratio: '453.592',
        type: 'pound',
      },
      {
        id: Unit.MASS_ID,
        phrases: ['ounce'],
        ratio: '28.3495',
        type: 'ounce',
      },
    ],
  );
}

function setDigitalStorageUnits(units: IUseUnit[]): void {
  units.push(
    ...[
      {
        id: Unit.DIGITAL_ID,
        phrases: ['bit'],
        ratio: 1,
        type: 'bit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['kilobit', 'kB'],
        ratio: 1000,
        type: 'kilobit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['kibibit', 'kiB'],
        ratio: 1024,
        type: 'kibibit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['megabit', 'mB'],
        ratio: 1e6,
        type: 'megabit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['mebibit', 'miB'],
        ratio: '1.049e+6',
        type: 'mebibit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['gigabit', 'gB'],
        ratio: 1e9,
        type: 'gigabit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['gibibit', 'giB'],
        ratio: '1.074e+9',
        type: 'gibibit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['terabit', 'tB'],
        ratio: 1e12,
        type: 'terabit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['tebibit', 'tiB'],
        ratio: '1.1e+12',
        type: 'tebibit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['petabit', 'pB'],
        ratio: 1e15,
        type: 'petabit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['pebibit', 'piB'],
        ratio: '1.126e+15',
        type: 'pebibit',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['byte', 'b'],
        ratio: 8,
        type: 'byte',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['kilobyte', 'kb'],
        ratio: 8000,
        type: 'kilobyte',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['kibibyte', 'kib'],
        ratio: 8192,
        type: 'kibibyte',
      },
      {
        id: Unit.DIGITAL_ID,
        phrases: ['megabyte', 'mb'],
        ratio: 8e6,


 𝑢𝑠𝑒𝑟.
• /channel - 𝑡𝑜 𝑔𝑒𝑡 𝑙𝑖𝑠𝑡 𝑜𝑓 𝑡𝑜𝑡𝑎𝑙 𝑐𝑜𝑛𝑛𝑒𝑐𝑡𝑒𝑑 𝑐ℎ𝑎𝑛𝑛𝑒𝑙𝑠
• /broadcast - 𝑡𝑜 𝑏𝑟𝑜𝑎𝑑𝑐𝑎𝑠𝑡 𝑎 𝑚𝑒𝑠𝑠𝑎𝑔𝑒 𝑡𝑜 𝑎𝑙𝑙 𝑢𝑠𝑒𝑟𝑠
• /grp_broadcast - 𝑇𝑜 𝑏𝑟𝑜𝑎𝑑𝑐𝑎𝑠𝑡 𝑎 𝑚𝑒𝑠𝑠𝑎𝑔𝑒 𝑡𝑜 𝑎𝑙𝑙 𝑐𝑜𝑛𝑛𝑒𝑐𝑡𝑒𝑑 𝑔𝑟𝑜𝑢𝑝𝑠.
• /batch - 𝑡𝑜 𝑐𝑟𝑒𝑎𝑡𝑒 𝑙𝑖𝑛𝑘 𝑓𝑜𝑟 𝑚𝑢𝑙𝑡𝑖𝑝𝑙𝑒 𝑝𝑜𝑠𝑡𝑠
• /link - 𝑡𝑜 𝑐𝑟𝑒𝑎𝑡𝑒 𝑙𝑖𝑛𝑘 𝑓𝑜𝑟 𝑜𝑛𝑒 𝑝𝑜𝑠𝑡
• /status - 𝑌𝑜𝑢𝑟 𝐻𝑒𝑟𝑜𝑘𝑢 𝐴𝑃𝐼 𝐾𝑒𝑦 𝑡𝑜 𝑐ℎ𝑒𝑐𝑘 𝑑𝑦𝑛𝑜, 𝑏𝑜𝑡 𝑢𝑝𝑡𝑖𝑚𝑒 𝑎𝑛𝑑 𝑏𝑜𝑡 𝑤𝑜𝑟𝑘𝑖𝑛𝑔 𝑑𝑎𝑦 𝑝𝑟𝑒𝑑𝑖𝑐𝑡𝑖𝑜𝑛.
• /set_template - 𝑇𝑜 𝑠𝑒𝑡 𝑎 𝑐𝑢𝑠𝑡𝑜𝑚 𝐼𝑀𝐷𝑏 𝑡𝑒𝑚𝑝𝑙𝑎𝑡𝑒 𝑓𝑜𝑟 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑔𝑟𝑜𝑢𝑝𝑠
• /gfilter - 𝑇𝑜 𝑎𝑑𝑑 𝑔𝑙𝑜𝑏𝑎𝑙 𝑓𝑖𝑙𝑡𝑒𝑟𝑠.
• /gfilters - 𝑇𝑜 𝑣𝑖𝑒𝑤 𝑙𝑖𝑠𝑡 𝑜𝑓 𝑎𝑙𝑙 𝑔𝑙𝑜𝑏𝑎𝑙 𝑓𝑖𝑙𝑡𝑒𝑟𝑠.
• /delg - 𝑇𝑜 𝑑𝑒𝑙𝑒𝑡𝑒 𝑎 𝑠𝑝𝑒𝑐𝑖𝑓𝑖𝑐 𝑔𝑙𝑜𝑏𝑎𝑙 𝑓𝑖𝑙


        binary("2424007b8621700151517899553233323835372e3030302c562c333632372e313835342c4e2c30313034352e323130392c452c302e30302c372c3239303131332c2c2a31347c302e307c347c303030307c303030382c303030357c303235443030303230303541374432327c30367c303030314530353527f40d0a"),
                decoder.decode(null, null, binary("2424007B8621700151517899553233323835372E3030302C562C333632372E313835342C4E2C30313034352E323130392C452C302E30302C372C3239303131332C2C2A31347C302E307C347C303030307C303030382C303030357C303235443030303230303541374432327C30367C303030314530353527F40D0A")));

        assertEquals(
                binary("2424007b8621700151517899553233323835372e3030302c562c333632372e313835342c4e2c30313034352e323130392c452c302e30302c372c3239303131332c2c2a31347c302e307c347c303030307c303030382c303030357c303235443030303230303541374432327c30367c303030314530353527f40d0a"),
                decoder.decode(null, null, binary("002424007B8621700151517899553233323835372E3030302C562C333632372E313835342C4E2C30313034352E323130392C452C302E30302C372C3239303131332C2C2A31347C302E307C347C303030307C303030382C303030357C303235443030303230303541374432327C30367C303030314530353527F40D0A")));

    }

}
package org.traccar.protocol;

import org.junit.jupiter.api.Test;
import org.traccar.ProtocolTest;

public class FreematicsProtocolDecoderTest extends ProtocolTest {

    @Test
    public void testDecode() throws Exception {

        var decoder = inject(new FreematicsProtocolDecoder(null));

        verifyPositions(decoder, text(
                "UCFLFAYM#0:33770,24:300,82:53.000000,*F9"));

        verifyPositions(decoder, text(
                "M0ZR4X0#0:204391,11:140221,10:8445000,A:49.215920,B:18.737755,C:410,D:0,E:208,24:1252,20:0;0;0,82:47*B5"));

        verifyNull(decoder, text(
                "1#EV=2,TS=1871902,ID=ESP32305C06C40A24*AC"));

        verifyNull(decoder, text(
                "0#EV=1,TS=23930,ID=ID1C6606C40A24,SK=TEST_SERVER_KEY*49"));

        verifyPositions(decoder, text(
                "1#0:102560,20:0;0;0,24:425,10:4285580,A:-35.803696,B:175.748413,C:0.22,D:0.41,F:5,0:103174,20:0;0;0,24:423,10:4285660,A:-35.803696,B:175.748413,C:0.22,D:0.41,F:5,30:88193792*21"));

        verifyPositions(decoder, text(
                "1#0:49244,20:0;0;0,24:423,0:50779,20:0;0;0,24:425,30:32924444*38"));

        verifyNotNull(decoder, text(
                "1#0:47607,20:0;0;0,24:423,0:48732,20:0;0;0,24:428,10:4280140,A:0.000000,B:0.000000,C:0.00,D:18520000.00,F:2,30:32924444*BA"));

        verifyPositions(decoder, text(
                "1#0:68338,10D:79,30:1010,105:199


PoolMixin)
    Util.Mixin(_G.LootUpgradeAlertSystem.alertFramePool, Hook.ObjectPoolMixin)
    Util.Mixin(_G.MoneyWonAlertSystem.alertFramePool, Hook.ObjectPoolMixin)


}

    public sealed class GetHoursOfOperationInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Returns information on a specific Hours of Operation by hours of operation id
        /// </summary>
        [Input("hoursOfOperationId")]
        public Input<string>? HoursOfOperationId { get; set; }

        /// <summary>
        /// Reference to the hosting Amazon Connect Instance
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// Returns information on a specific Hours of Operation by name
        ///
        /// > **NOTE:** `instance_id` and one of either `name` or `hours_of_operation_id` is required.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
        /// </summary>
        [Input("region")]
        public Input<string>? Region { get; set; }

        [Input("tags")]
        private InputMap<string>? _tags;

        /// <summary>
        /// Map of tags to assign to the Hours of Operation.
        /// </summary>
        public InputMap<string> Tags
        {
            get => _tags ?? (_tags = new InputMap<string>());
            set => _tags = value;
        }

        public GetHoursOfOperationInvokeArgs()
        {
        }
        public static new GetHoursOfOperationInvokeArgs Empty => new GetHoursOfOperationInvokeArgs();
    }

    [OutputType]
    public sealed class GetHoursOfOperationResult
    {
        /// <summary>
        /// ARN of the Hours of Operation.
        /// </summary>
        public readonly string Arn;
        /// <summary>
        /// Configuration information for the hours of operation: day, start time, and end time . Config blocks are doc


= '/jmx-console/',
        method = 'HEAD'
      },
      {
        path = '/admin-console/',
        method = 'HEAD'
      }
    },
    matches = {
      {
        match = '',
        output = 'JBoss Console'
      }
    }
  });

table.insert(fingerprints, {
    category = 'management',
    probes = {
      {
        path = '/CFIDE/administrator/enter.cfm',
        method = 'HEAD'
      },
      {
        path = '/CFIDE/administrator/entman/index.cfm',
        method = 'HEAD'
      },
      {
        path = '/cfide/install.cfm',
        method = 'HEAD'
      },
      {
        path = '/CFIDE/administrator/archives/index.cfm',
        method = 'HEAD'
      },
      {
        path = '/CFIDE/wizards/common/_logintowizard.cfm',
        method = 'HEAD'
      },
      {
        path = '/CFIDE/componentutils/login.cfm',
        method = 'HEAD'
      },
      {
        path = '/CFIDE/Administrator/startstop.html',
        method = 'HEAD'
      },
    },
    matches = {
      {
        match = '',
        output = 'ColdFusion Admin Console'
      }
    }
  });

table.insert(fingerprints, {
    category = 'management',
    probes = {
      {
        path = '/common/help/en/go/login_ts.html',
        method = 'HEAD'
      },
      {
        path = '/system/login/',
        method = 'HEAD'
      },
      {
        path = '/system/login/reset?next=%2Fsystem%2Flogin&set-lang=en',
        method = 'HEAD'
      },
      {
        path = '/common/images/logos/img_logoMain.jpg',
        method = 'HEAD'
      },
    },
    matches = {
      {
        match = 'URL=http://www.macromedia.com/go/breeze_login_help_en',
        output = 'Adobe Acrobat Connect Pro'
      },
      {
        match = '<title>Connect Pro Central Login</title>',
        output = 'Adobe Acrobat Connect Pro'
      },
      {
        match = '<title>Forgot your password?</title>',
        output = 'Adobe Acrobat Connect Pro'
      },
      {
        match = 'Server: JRun Web Server',
        output = 'Adobe Acrobat Connect Pro'
      },
    }
  });

table.insert(fingerprints, {
    category = 'management',
    probes = {
      {
        path = '/Dashboard/Dashboard.html',
        method = 'GET'
      }
    },
    matches = {
      {
        match = 'Server: Kodak-RulesBasedAutomation',
        output = 'Prinergy Dashboard Client Login'
      },
      {
        match = '<title>Dashboard</title>',
        output = 'Prinergy Dashboard Client Login'
      }
    }
  });

table.insert(fingerprints, {
    category = 'management',
    probes = {
      {
        path = '/flexfm/',
        method = 'HEAD'
      }
    },
    matches = {
      {
        match = '',
        output = 'Flex File Manager'
      }
    }
  });

table.insert(fingerprints, {
    category = 'management',
    probes = {
      {
        path = '/lib/usermanagement/userInfo.php',
        method = 'HEAD'
      }
    },
    matches = {
      {
        match = '',
        output = 'Testlink TestManagement'
      }
    }
  });

table.insert(fingerprints, {
    category = 'management',
    probes = {
      {
        path = '/security/xamppsecurity.php',
        method = 'HEAD'
      }
    },
    matches =


DGE_COUNT) 1.5 else 1.0
        shapeDrawable.cornerRadius = parentBounds.height() * 0.5f
        shapeDrawable.setBounds(
            parentBounds.right - size.times(extraPadding).roundToInt(),
            0,
            parentBounds.right,
            parentBounds.top + size
        )
    }

    override fun setAlpha(alpha: Int) {
        shapeDrawable.alpha = alpha
    }

    override fun getOpacity(): Int = PixelFormat.TRANSLUCENT

    override fun setColorFilter(colorFilter: ColorFilter?) {}

    override fun draw(canvas: Canvas) {
        if (!shapeDrawable.bounds.isEmpty) {
            shapeDrawable.draw(canvas)

            if (count > 0) {
                drawText(canvas)
            }
        }
    }

    private fun drawText(canvas: Canvas) {
        val textBounds = Rect()
        val countText = if (count > MAX_BADGE_COUNT) {
            "$MAX_BADGE_COUNT+"
        } else {
            count.toString()
        }

        textPaint.getTextBounds(countText, 0, countText.length, textBounds)

        canvas.drawText(
            countText,
            shapeDrawable.bounds.exactCenterX() - textBounds.exactCenterX(),
            shapeDrawable.bounds.exactCenterY() + textBounds.height() / 2,
            textPaint
        )
    }
}import org.jetbrains.compose.ExperimentalComposeLibrary
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree

plugins {
    kotlin("android")
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.jetbrainsCompose)
    alias(libs.plugins.compose.compiler)
}

android {
    namespace = "org.ncgroup.formula1kmp"
    compileSdk = libs.versions.android.compileSdk.get().toInt()

    defaultConfig {
        applicationId = "org.ncgroup.formula1kmp"
        minSdk = libs.versions.android.minSdk.get().toInt()
        targetSdk = libs.versions.android.targetSdk.get().toInt()
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }
    packaging {
        resources {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"
        }
    }
    buildTypes {
        getByName("release") {
            isMinifyEnabled = false
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }
    buildFeatures {
        compose = true
    }
    dependencies {
        implementation(project(":app"))
        implementation(libs.androidx.activity.compose)
        implementation(libs.koin.android)
        debugImplementation(libs.compose.ui.tooling)
    }
}import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
    alias(libs.plugins.kotlinMultiplatform)
    alias(libs.plugins.androidLibrary)
    alias(libs.plugins.jetbrainsCompose)
    alias(libs.plugins.compose.compiler)
    alias(libs.plugins.kotlinx.serialization)
}

kotlin {

    js {
        browser()
    }

    wasmJs {
        browser()
    }

    androidTarget()

    iosX64()
    iosArm64()
    iosSimulatorArm64()

    jvm("desktop")

    @OptIn(ExperimentalKotlinGradlePluginApi::class)
    compilerOptions {
        languageVersion.set(KotlinVersion.KOTLIN_2_0)
    }

    sourceSets {

        val


FFFFFFFFFF00) == '::ffff:255.255.255.0'
    assert ipv6.int_to_str(0xFFFFFFFF0000) == '::ffff:255.255.0.0'
    assert ipv6.int_to_str(0xFFFFFF000000) == '::ffff:255.0.0.0'
    assert ipv6.int_to_str(0xFFFF000000) == '::ff:ff00:0'
    assert ipv6.int_to_str(0x1FFFF00000000) == '::1:ffff:0:0'
    # So this is strange. Even though on Windows we get decimal notation in a lot of the addresses above,
    # in case of 0.0.0.0 we get hex instead. Worth investigating, putting
    # the conditional assert here for now to make this visible.
    if platform.system() == 'Windows':
        assert ipv6.int_to_str(0xFFFF00000000) == '::ffff:0:0'
    else:
        assert ipv6.int_to_str(0xFFFF00000000) == '::ffff:0.0.0.0'

def test_strategy_ipv6_str_to_int_behaviour_legacy_mode():
    assert ipv6.str_to_int('::127') == 295

    with pytest.raises(AddrFormatError):
        ipv6.str_to_int('::0x7f')

    assert ipv6.str_to_int('::0177') == 375

    with pytest.raises(AddrFormatError):
        ipv6.str_to_int('::127.1')

    with pytest.raises(AddrFormatError):
        ipv6.str_to_int('::0x7f.1')

    with pytest.raises(AddrFormatError):
        ipv6.str_to_int('::0177.1')

    assert ipv6.str_to_int('::127.0.0.1') == 2130706433


, $12
    lw    $k1, 0x18($a1)
    ori   $t0, $t0, 2
    sw    $t0, 0x118($a1)
    sd    $s0, 0x98($a1)
    sd    $s1, 0xa0($a1)
    sd    $s2, 0xa8($a1)
    sd    $s3, 0xb0($a1)
    sd    $s4, 0xb8($a1)
    sd    $s5, 0xc0($a1)
    sd    $s6, 0xc8($a1)
    sd    $s7, 0xd0($a1)
    sd    $gp, 0xe8($a1)
    sd    $sp, 0xf0($a1)
    sd    $fp, 0xf8($a1)
    sd    $ra, 0x100($a1)
    beqz  $k1, .L80326D70
     sw    $ra, 0x11c($a1)
    cfc1  $k1, $31
    sdc1  $f20, 0x180($a1)
    sdc1  $f22, 0x188($a1)
    sdc1  $f24, 0x190($a1)
    sdc1  $f26, 0x198($a1)
    sdc1  $f28, 0x1a0($a1)
    sdc1  $f30, 0x1a8($a1)
    sw    $k1, 0x12c($a1)

.L80326D70:
    lui   $k1, %hi(PHYS_TO_K1(MI_INTR_MASK_REG))
    lw    $k1, %lo(PHYS_TO_K1(MI_INTR_MASK_REG))($k1)
    beqz  $a0, .L80326D88
     sw    $k1, 0x128($a1)
    jal   __osEnqueueThread
     nop
.L80326D88:
    j     __osDispatchThread
     nop

// enqueue and pop look like compiled functions?  but there's no easy way to extract them
glabel __osEnqueueThread
    lw    $t8, ($a0)
    lw    $t7, 4($a1)
    move  $t9, $a0
    lw    $t6, 4($t8)
    slt   $at, $t6, $t7
    bnez  $at, .L80326DC4
     nop
.L80326DAC:
    move  $t9, $t8
    lw    $t8, ($t8)
    lw    $t6, 4($t8)
    slt   $at, $t6, $t7
    beqz  $at, .L80326DAC
     nop
.L80326DC4:
    lw    $t8, ($t9)
    sw    $t8, ($a1)
    sw    $a1, ($t9)
    jr    $ra
     sw    $a0, 8($a1)

glabel __osPopThread
    lw    $v0, ($a0)
    lw    $t9, ($v0)
    jr    $ra
     sw    $t9, ($a0)

glabel __osDispatchThread
    lui   $a0, %hi(__osThreadTail + 0x8)
    jal   __osPopThread
     addiu $a0, %lo(__osThreadTail + 0x8)
    lui   $at, %hi(__osThreadTail + 0x10)
    sw    $v0, %lo(__osThreadTail + 0x10)($at)
    li    $t0, 4
    sh


0 then
                    if math.random()<0.8 then
                        TheWorld.shadetile_key_to_leaf_canopy_id[shadetile_key] = SpawnLeafCanopy(newx, newz)
                    elseif not no_lightrays then
                        if math.random()<0.5 then
                            local rays = SpawnPrefab("lightrays_canopy")
                            rays.Transform:SetPosition(newx, 0, newz)
                            table.insert(data.lightrays, rays)
                        end
                    end
                    TheWorld.shadetiles[shadetile_key] = 1
                else
                    TheWorld.shadetiles[shadetile_key] = TheWorld.shadetiles[shadetile_key] + 1
                end
            end
        end
    end

    return data
end

return { spawnshadow = spawnshadow }


-login-register .line-height-3 {
    line-height: 1.4 !important;
}
.oxyy-login-register .line-height-4 {
    line-height: 1.6 !important;
}
.oxyy-login-register .line-height-5 {
    line-height: 1.8 !important;
}

/* Font Weight */
.oxyy-login-register .font-weight-100 {
    font-weight: 100 !important;
}
.oxyy-login-register .font-weight-200 {
    font-weight: 200 !important;
}
.oxyy-login-register .font-weight-300 {
    font-weight: 300 !important;
}
.oxyy-login-register .font-weight-400 {
    font-weight: 400 !important;
}
.oxyy-login-register .font-weight-500 {
    font-weight: 500 !important;
}
.oxyy-login-register .font-weight-600 {
    font-weight: 600 !important;
}
.oxyy-login-register .font-weight-700 {
    font-weight: 700 !important;
}
.oxyy-login-register .font-weight-800 {
    font-weight: 800 !important;
}
.oxyy-login-register .font-weight-900 {
    font-weight: 900 !important;
}

/* Opacity */
.oxyy-login-register .opacity-0 {
    opacity: 0;
}
.oxyy-login-register .opacity-1 {
    opacity: 0.1;
}
.oxyy-login-register .opacity-2 {
    opacity: 0.2;
}
.oxyy-login-register .opacity-3 {
    opacity: 0.3;
}
.oxyy-login-register .opacity-4 {
    opacity: 0.4;
}
.oxyy-login-register .opacity-5 {
    opacity: 0.5;
}
.oxyy-login-register .opacity-6 {
    opacity: 0.6;
}
.oxyy-login-register .opacity-7 {
    opacity: 0.7;
}
.oxyy-login-register .opacity-8 {
    opacity: 0.8;
}
.oxyy-login-register .opacity-9 {
    opacity: 0.9;
}
.oxyy-login-register .opacity-10 {
    opacity: 1;
}

/* Background light */
.oxyy-login-register .bg-light-1 {
    background-color: #e9ecef !important;
}
.oxyy-login-register .bg-light-2 {
    background-color: #dee2e6 !important;
}
.oxyy-login-register .bg-light-3 {
    background-color: #ced4da !important;
}
.oxyy-login-register .bg-light-4 {
    background-color: #adb5bd !important;
}

/* Background Dark */
.oxyy-login-register .bg-dark {
    background-color: #111418 !important;
}
.oxyy-login-register .bg-dark-1 {
    background-color: #212529 !important;
}
.oxyy-login-register .bg-dark-2 {
    background-color: #343a40 !important;
}
.oxyy-login-register .bg-dark-3 {
    background-color: #495057 !important;
}
.oxyy-login-register .bg-dark-4 {
    background-color: #6c757d !important;
}
.oxyy-login-register hr {
    border-top: 1px solid rgba(16, 85, 96, 0.1);
}

/* =================================== */
/*  3. Layouts
/* =================================== */
#main-wrapper.oxyy-login-register {
    background: #fff;
}

.oxyy-login-register .section {
    position: relative;
    padding: 4.5rem 0;
    overflow: hidden;
}
@media (max-width: 767.98px) {
    .oxyy-login-register .section {
        pa


 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.
 *
 * ========================= eCAL LICENSE =================================
*/

#include <gtest/gtest.h>
#include <ecal/ecal.h>
#include <ecal/pubsub/publisher.h>
#include <ecal/pubsub/subscriber.h>
#include <ecal/pubsub/types.h>

#include <vector>
#include <unordered_set>
#include <thread>
#include <chrono>
#include <algorithm>

using namespace eCAL;
using namespace std::chrono_literals;

// store just the topic ID and event type
struct PubEvent {
  STopicId          id;
  ePublisherEvent   type;
};

struct SubEvent {
  STopicId           id;
  eSubscriberEvent   type;
};

class PubSubEventTest : public ::testing::Test
{
protected:
  void SetUp() override
  {
    eCAL::Configuration config;
    config.registration.registration_refresh = 100;
    eCAL::Initialize(config, "PubSubEventTest");
  }

  void TearDown() override
  {
    eCAL::Finalize();
  }

  void wait_disc() const
  {
    std::this_thread::sleep_for(200ms);
  }
};

using core_cpp_pubsub_event = PubSubEventTest;

TEST_F(core_cpp_pubsub_event, PublisherCallback_TopicIdsMatchSubscribers)
{
  std::vector<PubEvent> events;
  std::unordered_set<STopicId> expected_ids;

  {
    CPublisher pub(
      "MyTopic",
      SDataTypeInformation(),
      [&events](const STopicId& tid, const SPubEventCallbackData& d)
      {
        events.push_back({ tid, d.event_type });
      });
    wait_disc();

    {
      CSubscriber sub1("MyTopic");  expected_ids.insert(sub1.GetTopicId());
      CSubscriber sub2("MyTopic");  expected_ids.insert(sub2.GetTopicId());
      wait_disc();
      CSubscriber sub3("MyTopic");  expected_ids.insert(sub3.GetTopicId());
      wait_disc();
      //wait_disc();
    }
    wait_disc();
  } // destroy also Publisher

  std::unordered_set<STopicId> conn_ids, disc_ids;
  for (auto& e : events)
  {
    if (e.type == ePublisherEvent::connected)    conn_ids.insert(e.id);
    if (e.type == ePublisherEvent::disconnected) disc_ids.insert(e.id);
  }

  EXPECT_EQ(conn_ids, expected_ids);
  EXPECT_EQ(disc_ids, expected_ids);
}

TEST_F(core_cpp_pubsub_event, PublisherCallback_LongSleepInCallback)
{
  bool disconnect_called = false;
  {
    CPublisher pub(
      "MyTopic",
      SDataTypeInformation(),
      [&disconnect_called](const STopicId& /*tid*/, const SPubEventCallbackData& d)
      {
        if (d.event_type == ePublisherEvent::disconnected)
        {
          std::this_thread::sleep_for(1s);
          disconnect_called = true;
        }
      });
    wait_disc();

    {
      CSubscriber sub("MyTopic");
      wait_disc();
    }
    wait_disc();
  } // destroy also Publisher

  EXPECT_TRUE(disconnect_called) << "Disconnect has not been called";
}

TEST_F(core_cpp_pubsub_event, SubscriberCallback_TopicIdsMatchPublishers)
{
  std::vector<SubEvent> events;
  std::unordered_set<STopicId> expected_ids;

  {
    CSubscriber sub(
      "MyTopic",
      SD


v[v_tmp], v[v_in_iwi_list+1], v[v_tmp]
    v_mul_lo_u32 v[v_tmp], s[s_in_stride_wi], v[v_tmp]
    v_add_u32 v[v_in_os+1], v[v_tmp+4], v[v_tmp]
    v_cmp_gt_u32 vcc, s[s_n], v[v_in_in]
    v_cndmask_b32 v[v_tmp], 0, 1, vcc
    v_lshl_or_b32 v[v_in_flag_n], v[v_tmp], 1, v[v_in_flag_n]
    v_cmp_gt_u32 vcc, s[s_hi], v[v_in_ihi_list+1]
    v_cndmask_b32 v[v_in_flag+1], 0, v[v_tmp], vcc
    v_cmp_gt_u32 vcc, s[s_wi], v[v_in_iwi_list+1]
    v_cndmask_b32 v[v_in_flag+1], 0, v[v_in_flag+1], vcc
    s_mov_b32 s[s_p_in+2], 0xffffffff
    s_mov_b32 s[s_p_in+3], 0x27000
    ; load input, nxe:0
    .v_clear_nc v_gld_a, 8
    v_cmpx_le_u32 vcc, 1, v[v_in_flag]
    buffer_load_dwordx4 v[v_gld_a:v_gld_a+3], v[v_in_os], s[s_p_in:s_p_in+3], s[s_in_offset] offen offset:0
    s_mov_b64 exec, -1
    v_cmpx_le_u32 vcc, 1, v[v_in_flag+1]
    buffer_load_dwordx4 v[v_gld_a+4:v_gld_a+4+3], v[v_in_os+1], s[s_p_in:s_p_in+3], s[s_in_offset] offen offset:0
    s_mov_b64 exec, -1

    v_mov_b32 v[v_tmp+5], v0
    ; xdlops mapping, get source matrix gemm index, k_pack:16, v_pack:1, k_pack_per_thread:1
    v_and_b32 v[v_gemm_in], 31, v[v_tmp+5]           ; block_n index
    v_and_b32 v[v_gemm_im], 31, v[v_tmp+5]           ; block_m index
    v_lshlrev_b32 v[v_gemm_in], 4, v[v_gemm_in]   ; shift left k_pack:16
    v_lshlrev_b32 v[v_gemm_im], 4, v[v_gemm_im]   ; shift left k_pack:16
    v_lshrrev_b32 v[v_tmp+5], 5, v[v_tmp+5]
    v_and_b32 v[v_tmp + 0], 1, v[v_tmp+5]          ; block_k_per_wave index
    v_and_b32 v[v_tmp + 1], 0, v[v_tmp + 0]   ; and k_pack_per_thread:1
    v_lshrrev_b32 v[v_tmp + 0], 0, v[v_tmp + 0] ; shift right k_pack_per_thread:1
    v_lshl_or_b32 v[v_gemm_in],  v[v_tmp + 1], 4, v[v_gemm_in]


        return true
      })
      .catch(() => false)
  }

  static downloadData(id: string) {
    return db
      .transaction('rw', db.recordingFragments, db.recordings, async () => {
        const recording = await db.recordings.get(id)
        if (!recording) throw new Error('invalid recording ID')

        if (!recording.saveAt) {
          db.recordings
            .update(id, {
              saveAt: new Date().getTime(),
            })
            .then((updated) => {
              if (!updated) throw new Error('Recording download failed')
            })
        }

        const fileName = `${formatTimestamp(
          new Date(recording.finishAt!),
          'YYYYMMDDhhmm',
        )}_sample.webm`

        const blob = await RecordingFragmentDB.getSeekableBlobFromFragments(
          recording.id,
        )
        const objectURL = window.URL.createObjectURL(blob)
        const downLoadLink = document.createElement('a')
        downLoadLink.href = objectURL
        downLoadLink.download = fileName
        downLoadLink.click()
        downLoadLink.remove()

        return true
      })
      .catch(() => false)
  }
}
/*
 * Copyright © 2020 Atomist, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { logger } from "@atomist/automation-client/lib/util/logger";
import {
    ProgressLog,
    ProgressLogFactory,
} from "../../spi/log/ProgressLog";
import { format } from "./format";

/**
 * Implementation of ProgressLog log that returns
 * an undefined link because it isn't actually persisted.
 * Used when we are not storing a local log.
 * Writes to logger at info level.
 */
class EphemeralProgressLog implements ProgressLog {

    public log: string = "";

    public url: string = undefined;

    constructor(public name: string, private readonly writeToLog: boolean = true) { }

    public async isAvailable(): Promise<boolean> { return true; }

    public flush(): Promise<void> {
        return Promise.resolve();
    }

    public async close(): Promise<void> {
        if (this.writeToLog) {
            logger.info(`Progress log '${this.name}'\n${this.log.trim()}`);
        }
    }

    public write(what: string, ...args: string[]): void {
        if (!what && what !== "") {
            return;
        }
        let line = format(what, ...args);
        if (!line.endsWith("\n")) {
            line += "\n";
        }
        this.log += line;
    }

}

export const createEphemeralProgressLog: ProgressLogFactory = async (context, sdmGoal) => new EphemeralProgressLog(sdmGoal.uniqueName);
enum DungeonTileType {
    Unused = 0,
    DirtWall,
    DirtFloor,
    StoneWall,
    Corridor,
    Door,
    Mud,
    Forrest
}

class Dimension {
    width: number;
    height: number;
    area: number;
    constructor (public _width: number, public _height:


port net.minecraft.util.EnumFacing;
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
import net.minecraftforge.client.model.pipeline.VertexLighterFlat;
import net.minecraftforge.common.ForgeModContainer;
import net.minecraftforge.fml.client.FMLClientHandler;
import org.apache.commons.lang3.tuple.Pair;

import javax.annotation.Nullable;
import javax.vecmath.Matrix4f;
import java.util.ArrayList;
import java.util.List;

/**
 * Custom baked model that stores a list of texture names and sets the lighting to full brightness for any quads
 * with one of those textures. Most of this code was copied and adapted from refined storage, which is licensed under
 * the MIT license. https://github.com/raoulvdberge/refinedstorage

 *

 * N.B. This doesn't cover item models, and all of the code/model solutions to this that I have tried haven't worked.
 * However, I noticed that the shade tag seems to work perfectly for items, so instead I've simply duplicated the block
 * models into the item models folder and add {@code "shade":false} where appropriate. (If it works, it works, right?)
 *
 * @author Electroblob
 * @author raoulvdberge
 */
public class BakedModelGlowingOverlay implements IBakedModel {

	// Something something something cache, says Forge
	// This breaks randomised block models (because it's cached, duh...) but simply including the rand parameter will
	// completely defeat the point of the cache so I need some way of storing the randomised model variants... hmmm...
	// See WeightedBakedModel for more on randomisation (it's pretty similar to my 1.7 implementation from years ago)

//	private class CacheKey {
//
//		private IBakedModel base;
//		private String suffix;
//		private IBlockState state;
//		private EnumFacing side;
//
//		public CacheKey(IBakedModel base, String suffix, IBlockState state, EnumFacing side){
//			this.base = base;
//			this.suffix = suffix;
//			this.state = state;
//			this.side = side;
//		}
//
//		@Override
//		public boolean equals(Object o){
//
//			if(this == o) return true;
//			if(o == null || getClass() != o.getClass()) return false;
//
//			CacheKey cacheKey = (CacheKey)o;
//
//			if(cacheKey.side != side) return false;
//			if(!state.equals(cacheKey.state)) return false;
//
//			return true;
//		}
//
//		@Override
//		public int hashCode() {
//			return state.hashCode() + (31 * (side != null ? side.hashCode() : 0));
//		}
//	}
//
//	private static final LoadingCache<CacheKey, List<BakedQuad>> CACHE = CacheBuilder.newBuilder().build(new CacheLoader<CacheKey, List<BakedQuad>>() {
//		@Override
//		public List<BakedQuad> load(CacheKey key) {
//			return transformQuads(key.base.getQuads(key.state, key.side, 0), key.suffix);
//		}
//	});

	private final IBakedModel delegate;
	private String suffix;

	public BakedModelGlowingOverlay(IBakedModel delegate, String suffix){
		this.delegate = delegate;
		this.suffix = suffix;
	}

	@Override
	public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand){
		if(state == null) return delegate.getQuads(state, side, rand);
		return transformQuads(delegate.getQuads(state, side, rand), suffix);
		//return CACHE.getUnchecked(new CacheKey(delegate, suffix, state instanceof IExtendedBlockState ? ((IExtendedBlockState) state).getClean() : state, side));
	}

	// I would write these myself but I'd end up with almost the exact same thing anyway
	// They replace the quads from the original (delegate) model


= F2(
	function (func, _n0) {
		var genA = _n0.a;
		return elm$random$Random$Generator(
			function (seed0) {
				var _n1 = genA(seed0);
				var a = _n1.a;
				var seed1 = _n1.b;
				return _Utils_Tuple2(
					func(a),
					seed1);
			});
	});
var elm$random$Random$cmdMap = F2(
	function (func, _n0) {
		var generator = _n0.a;
		return elm$random$Random$Generate(
			A2(elm$random$Random$map, func, generator));
	});
_Platform_effectManagers['Random'] = _Platform_createManager(elm$random$Random$init, elm$random$Random$onEffects, elm$random$Random$onSelfMsg, elm$random$Random$cmdMap);
var elm$random$Random$command = _Platform_leaf('Random');
var elm$random$Random$generate = F2(
	function (tagger, generator) {
		return elm$random$Random$command(
			elm$random$Random$Generate(
				A2(elm$random$Random$map, tagger, generator)));
	});
var elm$random$Random$addOne = function (value) {
	return _Utils_Tuple2(1, value);
};
var elm$core$Basics$abs = function (n) {
	return (n < 0) ? (-n) : n;
};
var elm$random$Random$peel = function (_n0) {
	var state = _n0.a;
	var word = (state ^ (state >>> ((state >>> 28) + 4))) * 277803737;
	return ((word >>> 22) ^ word) >>> 0;
};
var elm$random$Random$float = F2(
	function (a, b) {
		return elm$random$Random$Generator(
			function (seed0) {
				var seed1 = elm$random$Random$next(seed0);
				var range = elm$core$Basics$abs(b - a);
				var n1 = elm$random$Random$peel(seed1);
				var n0 = elm$random$Random$peel(seed0);
				var lo = (134217727 & n1) * 1.0;
				var hi = (67108863 & n0) * 1.0;
				var val = ((hi * 1.34217728e8) + lo) / 9.007199254740992e15;
				var scaled = (val * range) + a;
				return _Utils_Tuple2(
					scaled,
					elm$random$Random$next(seed1));
			});
	});
var elm$random$Random$getByWeight = F3(
	function (_n0, others, countdown) {
		getByWeight:
		while (true) {
			var weight = _n0.a;
			var value = _n0.b;
			if (!others.b) {
				return value;
			} else {
				var second = others.a;
				var otherOthers = others.b;
				if (_Utils_cmp(
					countdown,
					elm$core$Basics$abs(weight)) < 1) {
					return value;
				} else {
					var $temp$_n0 = second,
						$temp$others = otherOthers,
						$temp$countdown = countdown - elm$core$Basics$abs(weight);
					_n0 = $temp$_n0;
					others = $temp$others;
					countdown = $temp$countdown;
					continue getByWeight;
				}
			}
		}
	});
var elm$random$Random$weighted = F2(
	function (first, others) {
		var normalize = function (_n0) {