ine::utohexstr(Value);
        break;
      case 1:
        OS << format("0x%02" PRIx64, Value);
        break;
      case 2:
        OS << format("0x%04" PRIx64, Value);
        break;
      case 4:
        OS << format("0x%08" PRIx64, Value);
        break;
      case 8:
        OS << format("0x%016" PRIx64, Value);
        break;
      }
    else
      OS << Value;
    return;
  }
  case MCExpr::SymbolRef: {
    const MCSymbolRefExpr &SRE = cast<MCSymbolRefExpr>(*this);
    const MCSymbol &Sym = SRE.getSymbol();
    // Parenthesize names that start with $ so that they don't look like
    // absolute names.
    bool UseParens = MAI && MAI->useParensForDollarSignNames() && !InParens &&
                     Sym.getName().starts_with('$');

    if (UseParens) {
      OS << '(';
      Sym.print(OS, MAI);
      OS << ')';
    } else
      Sym.print(OS, MAI);

    const MCSymbolRefExpr::VariantKind Kind = SRE.getKind();
    if (Kind != MCSymbolRefExpr::VK_None) {
      if (MAI && MAI->useParensForSymbolVariant()) // ARM
        OS << '(' << MCSymbolRefExpr::getVariantKindName(Kind) << ')';
      else
        OS << '@' << MCSymbolRefExpr::getVariantKindName(Kind);
    }

    return;
  }

  case MCExpr::Unary: {
    const MCUnaryExpr &UE = cast<MCUnaryExpr>(*this);
    switch (UE.getOpcode()) {
    case MCUnaryExpr::LNot:  OS << '!'; break;
    case MCUnaryExpr::Minus: OS << '-'; break;
    case MCUnaryExpr::Not:   OS << '~'; break;
    case MCUnaryExpr::Plus:  OS << '+'; break;
    }
    bool Binary = UE.getSubExpr()->getKind() == MCExpr::Binary;
    if (Binary) OS << "(";
    UE.getSubExpr()->print(OS, MAI);
    if (Binary) OS << ")";
    return;
  }

  case MCExpr::Binary: {
    const MCBinaryExpr &BE = cast<MCBinaryExpr>(*this);

    // Only print parens around the LHS if it is non-trivial.
    if (isa<MCConstantExpr>(BE.getLHS()) || isa<MCSymbolRefExpr>(BE.getLHS())) {
      BE.getLHS()->print(OS, MAI);
    } else {
      OS << '(';
      BE.getLHS()->print(OS, MAI);
      OS << ')';
    }

    switch (BE.getOpcode()) {
    case MCBinaryExpr::Add:
      // Print "X-42" instead of "X+-42".
      if (const MCConstantExpr *RHSC = dyn_cast<MCConstantExpr>(BE.getRHS())) {
        if (RHSC->getValue() < 0) {
          OS << RHSC->getValue();
          return;
        }
      }

      OS <<  '+';
      break;
    case MCBinaryExpr::AShr: OS << ">>"; break;
    case MCBinaryExpr::And:  OS <<  '&'; break;
    case MCBinaryExpr::Div:  OS <<  '/'; break;
    case MCBinaryExpr::EQ:   OS << "=="; break;
    case MCBinaryExpr::GT:   OS <<  '>'; break;
    case MCBinaryExpr::GTE:  OS << ">="; break;
    case MCBinaryExpr::LAnd: OS << "&&"; break;
    case MCBinaryExpr::LOr:  OS << "||"; break;
    case MCBinaryExpr::LShr: OS << ">>"; break;
    case MCBinaryExpr::LT:   OS <<  '<'; break;
    case MCBinaryExpr::LTE:  OS


^\\)]+\\), max= \\([^\\)]+\\)");

    @Test
    void testFrom_varargs_singlePoint() {
        // arrange
        final Vector3D p1 = Vector3D.of(-1, 2, -3);

        // act
        final Bounds3D b = Bounds3D.from(p1);

        // assert
        EuclideanTestUtils.assertCoordinatesEqual(p1, b.getMin(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(p1, b.getMax(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(Vector3D.ZERO, b.getDiagonal(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(p1, b.getCentroid(), TEST_EPS);
    }

    @Test
    void testFrom_varargs_multiplePoints() {
        // arrange
        final Vector3D p1 = Vector3D.of(1, 6, 7);
        final Vector3D p2 = Vector3D.of(0, 5, 11);
        final Vector3D p3 = Vector3D.of(3, 6, 8);

        // act
        final Bounds3D b = Bounds3D.from(p1, p2, p3);

        // assert
        EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0, 5, 7), b.getMin(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(3, 6, 11), b.getMax(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(3, 1, 4), b.getDiagonal(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(1.5, 5.5, 9), b.getCentroid(), TEST_EPS);
    }

    @Test
    void testFrom_iterable_singlePoint() {
        // arrange
        final Vector3D p1 = Vector3D.of(-1, 2, -3);

        // act
        final Bounds3D b = Bounds3D.from(Collections.singletonList(p1));

        // assert
        EuclideanTestUtils.assertCoordinatesEqual(p1, b.getMin(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(p1, b.getMax(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(Vector3D.ZERO, b.getDiagonal(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(p1, b.getCentroid(), TEST_EPS);
    }

    @Test
    void testFrom_iterable_multiplePoints() {
        // arrange
        final Vector3D p1 = Vector3D.of(1, 6, 7);
        final Vector3D p2 = Vector3D.of(2, 5, 9);
        final Vector3D p3 = Vector3D.of(3, 4, 8);

        // act
        final Bounds3D b = Bounds3D.from(Arrays.asList(p1, p2, p3));

        // assert
        EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(1, 4, 7), b.getMin(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(3, 6, 9), b.getMax(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(2, 2, 2), b.getDiagonal(), TEST_EPS);
        EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(2, 5, 8), b.getCentroid(), TEST_EPS);
    }

    @Test
    void testFrom_iterable_noPoints() {
        // act/assert
        GeometryTestUtils.assertThrowsWithMessage(() -> {
            Bounds3D.from(new ArrayList<>());
        }, IllegalStateException.class, NO_POINTS_MESSAGE);
    }

    @Test
    void testFrom_invalidBounds() {
        // arrange
        final Vector3D good = Vector3D.of(1, 1, 1);


 **/
input:where([type="checkbox"], [type="radio"])[disabled] {
	--choice-color-back: none;
	--choice-color-border: var(--choice-color-border-disabled);
	--choice-color-checked: var(--choice-color-disabled);
	box-shadow: none;
	cursor: not-allowed;
}

/** Checkbox & Toggle **/
input[type="checkbox"]:checked::after {
	content: "✓";
	inset: 0;
	font-weight: 700;
	color: var(--choice-color-icon);
	line-height: 1;
}

/** Radio **/
input[type="radio"] {
	--choice-rounded: 50%;
}
input[type="radio"]::after {
	inset: 3px;
	font-size: 9px;
	border-radius: var(--choice-rounded);
}

/** Toggle **/
input[type="checkbox"][data-variant="toggle"] {
	--choice-rounded: var(--choice-height);
	width: calc(var(--choice-height) * 2);
	aspect-ratio: 2/1;
}
input[type="checkbox"][data-variant="toggle"]::after {
	background: var(--choice-color-toggle);
	display: grid;
	inset: 1px;
	width: 0.8rem;
	font-size: 7px;
	border-radius: var(--choice-rounded);
	transition:
		margin-inline-start 0.075s ease-in-out,
		background 0.1s ease-in-out;
}
input[type="checkbox"][data-variant="toggle"]:checked {
	border-color: var(--choice-color-border);
}
input[type="checkbox"][data-variant="toggle"]:checked::after {
	background: var(--choice-color-checked);
	margin-inline-start: 50%;
}
:root {
	--shadow-sm:
			0 1px 3px 0 rgba(0, 0, 0, 0.1),
			0 1px 2px 0 rgba(0, 0, 0, 0.025);
	--shadow-md:
			0 4px 6px -1px rgba(0, 0, 0, 0.1),
			0 2px 4px -1px rgba(0, 0, 0, 0.05);
	--shadow-lg:
			0 10px 15px -3px rgba(0, 0, 0, 0.1),
			0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--shadow-xl:
			0 20px 25px -5px rgba(0, 0, 0, 0.1),
			0 10px 10px -5px rgba(0, 0, 0, 0.05);

	--shadow: var(--shadow-sm);
	--shadow-toolbar: rgba(0, 0, 0, 0.1) -2px 0 5px, var(--shadow),
		var(--shadow-xl);

	/** @deprecated */
	--shadow-outline: var(--color-focus, currentColor) 0 0 0 2px;
	--shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
	--shadow-sticky: rgba(0, 0, 0, 0.05) 0 2px 5px;
	--box-shadow-dropdown: var(--shadow-dropdown);
	--box-shadow-item: var(--shadow);
	--box-shadow-focus: var(--shadow-xl);
	--shadow-dropdown: var(--shadow-lg);
	--shadow-item: var(--shadow-sm);
}

:root:has(.k-panel[data-theme="dark"]) {
	--shadow-sm:
			0 1px 3px 0 rgba(0, 0, 0, 0.2),
			0 1px 2px 0 rgba(0, 0, 0, 0.125);
	--shadow-xl:
			0 20px 25px -5px rgba(0, 0, 0, 0.4),
			0 10px 10px -5px rgba(0, 0, 0, 0.35);
}* {
  margin: 0;
  pa


7\u5bb6\u8d77\u7acb\u9f13\u638c\u3002\uff09", "type": "paragraph"}, {"text": "\u6765\u6e90\uff1a", "type": "source"}, {"text": "\u300a\u4e2d\u592e\u89e3\u51b3\u5c71\u897f\u95ee\u9898\uff08\u6269\u5927\uff09\u4f1a\u8bae\u7eaa\u8981\u6c47\u96c6\u300b\uff0c\u5c71\u897f\u65e5\u62a5\uff08\u519b\u652f\uff09\u9769\u547d\u9020\u53cd\u603b\u90e8\u7f16\u5370\uff0c1967\u5e747\u670828\u65e5\u3002", "type": "paragraph"}]}
  </script>

    [返回索引页面]

   中央解决山西问题扩大会议纪要（之三）

   日期：1967-7-15 作者：康生, 关锋

   康生、关锋

    〖时间：一九六七年七月十五日晚九点半至十二点半，地点：北京人民大会堂安徽厅。主持人：康生同志。出席者：红总司（红总站、兵团）代表六十余人，红联站代表六十多人，省核心小组成员、省革命委员会常委和部分委员、省军区部分负责人、××军政委、×××部队校长、×××部队校长。此外，有晋中核心小组成员等。九点半，康老、关锋、吴法宪、刘格平一同进入会场，全体起立鼓掌，康老入座后即宣布开会。根据记录整理，未经审阅。〗

   康生：这几天有些同志身体不好，今晚的会议只开三个钟头。前两天一开就五、六个钟头，我们检讨，我们是习惯了。现在九点半，开到十二点半，三个钟头。晋中军分区的崔冰同志要求发言，现在先让任井夫同志讲，然后崔冰同志讲。希同志们讲话精简一点。

   （当任井夫同志发言讲到晋中7·7、7·8事件，晋中的总司把联络站的人揪到群众称作“白公馆”的七房七岭的地方时）

   康生：这是在那一个县？

   任井夫：在平遥县。

   （当任井夫同志讲到他来北京时在火车上接到通缉他的传单时，将传单交刘格平同志转给康老。）

   康老：这传单也很值得注意罗，刊印的！刊印的！不是一般油印复写的，刊印的！

    关锋


            num9 = num6;
                }
                num10 = num9;
            }
            if (Globals.candleSettings[10].rangeType == RangeType.RealBody)
            {
                num5 = Math.Abs((float)(inClose[EqualTrailingIdx - 1] - inOpen[EqualTrailingIdx - 1]));
            }
            else
            {
                float num4;
                if (Globals.candleSettings[10].rangeType == RangeType.HighLow)
                {
                    num4 = inHigh[EqualTrailingIdx - 1] - inLow[EqualTrailingIdx - 1];
                }
                else
                {
                    float num;
                    if (Globals.candleSettings[10].rangeType == RangeType.Shadows)
                    {
                        float num2;
                        float num3;
                        if (inClose[EqualTrailingIdx - 1] >= inOpen[EqualTrailingIdx - 1])
                        {
                            num3 = inClose[EqualTrailingIdx - 1];
                        }
                        else
                        {
                            num3 = inOpen[EqualTrailingIdx - 1];
                        }
                        if (inClose[EqualTrailingIdx - 1] >= inOpen[EqualTrailingIdx - 1])
                        {
                            num2 = inOpen[EqualTrailingIdx - 1];
                        }
                        else
                        {
                            num2 = inClose[EqualTrailingIdx - 1];
                        }
                        num = (inHigh[EqualTrailingIdx - 1] - num3) + (num2 - inLow[EqualTrailingIdx - 1]);
                    }
                    else
                    {
                        num = 0.0f;
                    }
                    num4 = num;
                }
                num5 = num4;
            }
            EqualPeriodTotal += num10 - num5;
            i++;
            NearTrailingIdx++;
            EqualTrailingIdx++;
            if (i <= endIdx)
            {
                goto Label_028E;
            }
            outNBElement = outIdx;
            outBegIdx = startIdx;
            return RetCode.Success;
        }
        public static int CdlGapSideSideWhiteLookback()
        {
            return (((Globals.candleSettings[8].avgPeriod <= Globals.candleSettings[10].avgPeriod) ? Globals.candleSettings[10].avgPeriod : Globals.candleSettings[8].avgPeriod) + 2);
        }
     }
}


.color)
	end
	if fontInfo.strokeColor then
		ed.setLabelStroke(label, fontInfo.strokeColor, fontInfo.strokeSize)
	end
	if fontInfo.shadowColor then
		ed.setLabelShadow(label, fontInfo.shadowColor, fontInfo.shadowOffset)
	end
end
ed.setLabelFontInfo = setLabelFontInfo
local function createLabelWithFontInfo(text, info, size)
	if nil == info then
		return
	end
	local fontInfo = EDTables.fontconfigs[info]
	if fontInfo == nil then
		print("fontInfo:" .. info .. "no found!!")
		return
	end
	font = ed.font
	if fontInfo.font then
		font = fontInfo.font
	end

	if not size then
		size = fontInfo.size
	end

	local label = ed.createLabelTTF("", size,font)
	setLabelFontInfo(label, info)
	ed.setLabelString(label, text)
	return label
end
ed.createLabelWithFontInfo = createLabelWithFontInfo
local function setLabelString(label, text, skipFormat)
	if tolua.isnull(label) then
		return
	end
	if not text then
		return
	end
	if not skipFormat then
		text = ed.formatText(text)
	end
	label:setString(text)
end
ed.setLabelString = setLabelString
local function createttf(text, size, font)
	return ed.createLabelTTF(text, size, font, true)
end
ed.createttf = createttf
local function setString(label, text)
	if not label then
		return
	end
	if not text then
		return
	end
	if not label.setString then
		return
	end
	if type(label) == "userdata" then
		ed.setLabelString(label, text, true)
	elseif type(label) == "table" then
		label:setString(text)
	end
end
ed.setString = setString
local setLabelShadow = function(label, color, offset)
	if tolua.isnull(label) then
		return
	end
	label:setShadow(color, offset)
end
ed.setLabelShadow = setLabelShadow
local setLabelStroke = function(label, color, size)
	if tolua.isnull(label) then
		return
	end
	label:setStroke(color, size)
end
ed.setLabelStroke = setLabelStroke
local setLabelColor = function(label, color)
	if tolua.isnull(label) then
		return
	end
	label:setColor(color)
end
ed.setLabelColor = setLabelColor
local setLabelDimensions = function(label, dimensions)
	if tolua.isnull(label) then
		return
	end
	label:setDimensions(dimensions)
end
ed.setLabelDimensions = setLabelDimensions
local function createFrameAnim(list, delay)
	delay = delay or 0.041666666666666664
	local spr
	local array = CCArray:createWithCapacity(#list)
	for i, v in ipairs(list) do
		spr = spr or createSprite(v)
		local frame = ed.getSpriteFrame(v)
		array:addObject(frame)
	end
	local animation = CCAnimation:createWithSpriteFrames(array, delay)
	local anim = CCAnimate:create(animation)
	return spr, anim
end
ed.createFrameAnim = createFrameAnim
local loadSpriteSheet = function(xml_file)
	local xfile = xml.load(xml_file)
	local xaltas = xfile:find("TextureAtlas")
	local texture = CCTextureCache:sharedTextureCache():addImage(xaltas.imagePath)
	for i = 1, #xaltas do
		local xsprite = xaltas[i]
		local rect = CCRectMake(xsprite.x, xsprite.y, xsprite.w, xsprite.h)
		xsprite.oX = xsprite.oX or 0


.xValue += value;
            break;
          case 180:
            waypoint.yValue += value;
            break;
          case 270:
            waypoint.xValue -= value;
            break;
        }
        break;
      }
      case Action.E: {
        switch (waypoint.rotation) {
          case 0:
            waypoint.xValue += value;
            break;
          case 90:
            waypoint.yValue += value;
            break;
          case 180:
            waypoint.xValue -= value;
            break;
          case 270:
            waypoint.yValue -= value;
            break;
        }
        break;
      }
      case Action.W: {
        switch (
          waypoint.rotation // -1 * East
        ) {
          case 0:
            waypoint.xValue -= value;
            break;
          case 90:
            waypoint.yValue -= value;
            break;
          case 180:
            waypoint.xValue += value;
            break;
          case 270:
            waypoint.yValue += value;
            break;
        }
        break;
      }
      case Action.L: {
        waypoint.rotation -= value;
        if (waypoint.rotation < 0) {
          waypoint.rotation += 360;
        }
        break;
      }
      case Action.R: {
        waypoint.rotation += value;
        if (waypoint.rotation > 270) {
          waypoint.rotation -= 360;
        }
        break;
      }
      case Action.F: {
        switch (waypoint.rotation) {
          case 0:
            shipEastValue += waypoint.xValue * value;
            shipNorthValue += waypoint.yValue * value;
            break;
          case 90:
            shipEastValue += waypoint.yValue * value;
            shipNorthValue += waypoint.xValue * value * -1;
            break;
          case 180:
            shipEastValue += waypoint.xValue * value * -1;
            shipNorthValue += waypoint.yValue * value * -1;
            break;
          case 270:
            shipEastValue += waypoint.yValue * value * -1;
            shipNorthValue += waypoint.xValue * value;
            break;
        }
        break;
      }
    }
  }

  return Math.abs(shipNorthValue) + Math.abs(shipEastValue);
};
import { Http, HTTP_PROVIDERS } from 'angular2/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import { Injectable } from 'angular2/core';

export class Article {
	description: string;
	upvotes: number;
	storyImageUrl: string;
	width: number;
	author: { userName: string, userImage: string };

	constructor( public headline: string, public timePosted: number, public link: string ) { }
}

@Injectable()
export class ArticleService {
	apiEndpoint = 'http://www.freecodecamp.com/news/hot';
	articles: Article[] = [];

	MAX_IMAGE_WID = 240;
	MIN_IMAGE_WID = 200;

	constructor( public http: Http ) {
		this.initialGet();
	}

	getArticles(): Observable<any> {
		return this.http.get(this.apiEndpoint).map(res => res.json());
	}

	initialGet() {
		this.getArticles()
			.subscribe(
				resultArr => {
					resultArr.map(
						resArticle => {
							let article = new Article(resArticle.headline, resArticle.timePosted, resArticle.link);
							article.description = resArticle.metaDescription;


test4(array, endptr);
  // CHECK4: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}}
  // CHECK4: READ of size 1
  if (!strcmp(argv[1], "test5")) test5(array, endptr);
  // CHECK5: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}}
  // CHECK5: READ of size 4
  if (!strcmp(argv[1], "test6")) test6(array, endptr);
  // CHECK6: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}}
  // CHECK6: READ of size 4
  if (!strcmp(argv[1], "test7")) test7(array, endptr);
  // CHECK7: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}}
  // CHECK7: READ of size 2
  free(array0);
  return 0;
}


for
until:
.br1:	cmp.b	(a5),d0
	beq.s	.found
	cmp.b	#13,(a5)+
	bne.s	.br1
	moveq	#-1,d0
	cmp.b	#10,(a5)+
	bne.s	.br
	rts
.br:	subq.w	#1,a5
	rts
.found:	moveq	#0,d0
	addq.w	#1,d6
	rts

untilwh:
.br1:	move.b	(a5)+,d0
	cmp.b	#" ",d0
	beq.s	.found
	cmp.b	#9,d0
	beq.s	.found
	cmp.b	#13,d0
	bne.s	.br1
	subq	#1,a5
	moveq	#-1,d0
	rts
.found:	subq	#1,a5
	moveq	#0,d0
	addq.w	#1,d6
	rts

get_quick:
	DS.W	1
get_value_:
	addq.l	#1,a5
get_value:
	cmp.b	#'<',(a5)
	beq.s	get_value_
	cmp.b	#'>',(a5)
	beq.s	get_value_
	cmp.b	#'<',-1(a5)
	seq.b	get_quick
	bsr.s	get_valueb
	tst.w	nb_par(pc)
	beq.s	.ici
	moveq	#-1,d5
.ici:
	rts

get_valueb:
	movem.l	d0/d2-d4/d7,-(sp)
;	tst.w	nb_par
;	bne.s	.ici
;	cmp.b	#'<',-1(a5)
;	seq.b	get_quick
;.ici:
	moveq	#-1,d5
	moveq	#0,d2
	moveq	#0,d3
	moveq	#0,d4
	moveq	#0,d6
	moveq	#0,d7
	bsr	get_val
	moveq	#1,d6
	muls.l	d5,d7:d6
* Check on arithmetic in expression, if so calculate it's value.
gsign:	move.b	(a5)+,d2
gshl:	cmp.w	#'>>',-1(a5)
	bne.s	gshr
	addq.l	#1,a5
	bsr	get_val
	neg.w	d5
	bgt.s	gshr0
gshl0:	neg.w	d5
	subq.w	#1,d5
	cmp.w	#31,d5
	bhi.s	gsign
.loop:	asr.l	d7
	roxr.l	d6
	dbra	d5,.loop
	bra.s	gsign
gshr:	cmp.w	#'<<',-1(a5)
	bne.s	gmul
	addq.l	#1,a5
	bsr	get_val
	tst.w	d5
	blt.s	gshl0
gshr0:	subq.w	#1,d5
	cmp.w	#31,d5
	bhi.s	gsign
.loop:	add.l	d6,d6
	addx.l	d7,d7
	dbra	d5,.loop
	bra.s	gsign
gmul:	cmp.b	#'*',d2
	bne.s	gdiv
	bsr	get_val
	muls.l	d5,d7:d6
	bra.s	gsign
gdiv:	cmp.b	#'/',d2
	bne.s	gplus
	bsr	get_val
	divs.l	d5,d7:d6
	moveq	#1,d5
	m


LE_HELMET = ITEMS.register("mobzilla_scale_helmet", () -> new ArmorItem(CAArmorMaterial.MOBZILLA_SCALE, EquipmentSlotType.HEAD, new Item.Properties().rarity(Rarity.EPIC).tab(CAItemGroups.EQUIPMENT)));
	public static final RegistryObject<ArmorItem> MOBZILLA_SCALE_CHESTPLATE = ITEMS.register("mobzilla_scale_chestplate", () -> new ArmorItem(CAArmorMaterial.MOBZILLA_SCALE, EquipmentSlotType.CHEST, new Item.Properties().rarity(Rarity.EPIC).tab(CAItemGroups.EQUIPMENT)));
	public static final RegistryObject<ArmorItem> MOBZILLA_SCALE_LEGGINGS = ITEMS.register("mobzilla_scale_leggings", () -> new ArmorItem(CAArmorMaterial.MOBZILLA_SCALE, EquipmentSlotType.LEGS, new Item.Properties().rarity(Rarity.EPIC).tab(CAItemGroups.EQUIPMENT)));
	public static final RegistryObject<ArmorItem> MOBZILLA_SCALE_BOOTS = ITEMS.register("mobzilla_scale_boots", () -> new ArmorItem(CAArmorMaterial.MOBZILLA_SCALE, EquipmentSlotType.FEET, new Item.Properties().rarity(Rarity.EPIC).tab(CAItemGroups.EQUIPMENT)));

	// Miners Dream
	public static final RegistryObject<MinersDreamItem> MINERS_DREAM = ITEMS.register("miners_dream", () -> new MinersDreamItem(new Item.Properties().tab(CAItemGroups.ITEMS).stacksTo(16)));

	// SPAWN EGGS
	public static final RegistryObject<CASpawnEggItem> ACACIA_ENT_SPAWN_EGG = ITEMS.register("acacia_ent_spawn_egg", () -> new CASpawnEggItem(() -> CAEntityTypes.ACACIA_ENT.get(), new Item.Properties().tab(CAItemGroups.SPAWN_EGGS)));
	public static final RegistryObject<CASpawnEggItem> APPLE_ENT_SPAWN_EGG = ITEMS.register("apple_ent_spawn_egg", () -> new CASpawnEggItem(() -> CAEntityTypes.APPLE_ENT.get(), new Item.Properties().tab(CAItemGroups.SPAWN_EGGS)));
	public static final RegistryObject<CASpawnEggItem> BIRCH_ENT_SPAWN_EGG = ITEMS.register("birch_ent_spawn_egg", () -> new CASpawnEggItem(() -> CAEntityTypes.BIRCH_ENT.get(), new Item.Properties().tab(CAItemGroups.SPAWN_EGGS)));
	public static final RegistryObject<CASpawnEggItem> CHERRY_ENT_SPAWN_EGG = ITEMS.register("cherry_ent_spawn_egg", () -> new CASpawnEggItem(() -> CAEntityTypes.CHERRY_ENT.get(), new Item.Properties().tab(CAItemGroups.SPAWN_EGGS)));
	public static final RegistryObject<CASpawnEggItem> CRIMSON_ENT_SPAWN_EGG = ITEMS.register("crimson_ent_spawn_egg", () -> new CASpawnEggItem(() -> CAEntityTypes.CRIMSON_ENT.get(), new Item.Properties().tab(CAItemGroups.SPAWN_EGGS)));
	public static final RegistryObject<CASpawnEggItem> DARK_OAK_ENT_SPAWN_EGG = ITEMS.register("dark_oak_ent_spawn_egg", () -> new CASpawnEggItem(() -> CAEntityTypes.DARK_OAK_ENT.get(), new Item.Properties().tab(CAItemGroups.SPAWN_EGGS)));
	public static final RegistryObject<CASpawnEggItem> JUNGLE_ENT_SPAWN_EGG = ITEMS.register("jungle_ent_spawn_egg", () -> new CASpawnEggItem(() -> CAEntityTypes.JUNGLE_ENT.get(), new Item.Properties().tab(CAItemGroups.


4c-.244.959-.915 2.153-1.368 2.886 1.033.316 2.12.488 3.262.488C18.07 23 23 18.079 23 12.009 23.018 5.921 18.089 1 12.009 1z"/></symbol><symbol id="utility-menu"width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 3.81818C0 3.36631 0.373745 3 0.834783 3H23.1652C23.6263 3 24 3.36631 24 3.81818C24 4.27005 23.6263 4.63636 23.1652 4.63636H0.834783C0.373745 4.63636 0 4.27005 0 3.81818ZM0 12C0 11.5481 0.373745 11.1818 0.834783 11.1818H23.1652C23.6263 11.1818 24 11.5481 24 12C24 12.4519 23.6263 12.8182 23.1652 12.8182H0.834783C0.373745 12.8182 0 12.4519 0 12ZM0.834783 19.3636C0.373745 19.3636 0 19.7299 0 20.1818C0 20.6337 0.373745 21 0.834783 21H23.1652C23.6263 21 24 20.6337 24 20.1818C24 19.7299 23.6263 19.3636 23.1652 19.3636H0.834783Z" fill="#1B1A1D"/></symbol><symbol id="utility-close"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M17.786 7.62l-.079.087L13.415 12l4.292 4.293a1 1 0 01-1.32 1.497l-.094-.083L12 13.415l-4.293 4.292a1 1 0 01-1.497-1.32l.083-.094L10.585 12 6.293 7.707a1 1 0 011.32-1.497l.094.083L12 10.585l4.293-4.292.087-.08c.88-.729 2.08.419 1.473 1.318l-.067.09z"/></symbol><symbol id="utility-plus"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 5a1 1 0 01.993.883L13 6v5h5l.133.007c1.156.124 1.156 1.862 0 1.986L18 13h-5v5a1 1 0 01-1.993.117L11 18v-5H6a1 1 0 01-.117-1.993L6 11h5V6a1 1 0 011-1z"/></symbol><symbol id="utility-minus"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M7 13a1 1 0 01-.117-1.993L7 11h10l.133.007c1.156.124 1.156 1.862 0 1.986L17 13H7z"/></symbol><symbol id="utility-arrow-right-large"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M13.613 5.21l.094.083 6 6c.036.035.068.073.097.112l.071.11.054.114.035.105.03.148L20 12l-.003.075-.017.126-.03.111-.044.111-.062.113-.064


!=size; ++i)   {     const int id = v[i]->GetId();     if (id > max_id)     {       max_id = id;       index_max_id = i;     }   }   return v[index_max_id]; }`
  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

![C++98](PicCpp98.png)![Boost](PicBoost.png) Answer using [C++98](Cpp98.md) and [Boost](CppBoost.md).Bind
-----------------------------------------------------------------------------------------------------------

  -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  ` #include <algorithm> #include <cassert> #include <vector> #include <boost/bind.hpp> #include <boost/lambda/lambda.hpp>  struct Person {   Person(const int id) : m_id(id) {}   int GetId() const { return m_id; }   const int m_id; };  const Person * GetMaxId(const std::vector<const Person *>& v) {   return *(std::max_element(     v.begin(),v.end(),     boost::bind(&Person::GetId,_2) > boost::bind(&Person::GetId,_1))); }`
  -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

![C++11](PicCpp11.png)![STL](PicStl.png) Answer using the [C++11](Cpp11.md) its [STL](CppStl.md)
--------------------------------------------------------------------------------------------------

  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  ` #include <algorithm> #include <vector>  struct Person {   Person(const int id) : m_id(id) {}   int GetId() const { return m_id; }   const int m_id; };  const Person * GetMaxId(const std::vector<const Person *>& v) {   return *(std::max_element(     v.begin(),v.end(),     [](const Person* const lhs,const Person* const rhs)       { return rhs->GetId() > lhs->GetId(); }     )); }`
  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

# ⚙ Provider Setup - Complete Configuration Guide

Comprehensive setup guide for all 9 AI providers supported by Brainarr. Each provider has been tested and optimized for music discovery.

## 🎯 **Quick Provider Comparison**

| Provider | Setup Time | Cost | Free Tier | Best For |
|----------|------------|------|-----------|----------|
| **Ollama** | 10 min | Free | ✅ Unlimited | Privacy + Control |
| **DeepSeek** | 2 min | Ultra Low | ✅ $5 credit | Budget + Quality |
| **Ge


         ## $a0 = 00000000
/* 00070 80A1FE30 3C0780A2 */  lui     $a3, %hi(D_80A21BBC)       ## $a3 = 80A20000
/* 00074 80A1FE34 8FA50020 */  lw      $a1, 0x0020($sp)
/* 00078 80A1FE38 24E71BBC */  addiu   $a3, $a3, %lo(D_80A21BBC)  ## $a3 = 80A21BBC
/* 0007C 80A1FE3C 02202025 */  or      $a0, $s1, $zero            ## $a0 = 00000000
/* 00080 80A1FE40 0C017114 */  jal     func_8005C450
/* 00084 80A1FE44 02003025 */  or      $a2, $s0, $zero            ## $a2 = 00000000
/* 00088 80A1FE48 260501E8 */  addiu   $a1, $s0, 0x01E8           ## $a1 = 000001E8
/* 0008C 80A1FE4C AFA50020 */  sw      $a1, 0x0020($sp)
/* 00090 80A1FE50 0C0170D9 */  jal     ActorCollider_AllocCylinder

/* 00094 80A1FE54 02202025 */  or      $a0, $s1, $zero            ## $a0 = 00000000
/* 00098 80A1FE58 3C0780A2 */  lui     $a3, %hi(D_80A21BE8)       ## $a3 = 80A20000
/* 0009C 80A1FE5C 8FA50020 */  lw      $a1, 0x0020($sp)
/* 000A0 80A1FE60 24E71BE8 */  addiu   $a3, $a3, %lo(D_80A21BE8)  ## $a3 = 80A21BE8
/* 000A4 80A1FE64 02202025 */  or      $a0, $s1, $zero            ## $a0 = 00000000
/* 000A8 80A1FE68 0C017114 */  jal     func_8005C450
/* 000AC 80A1FE6C 02003025 */  or      $a2, $s0, $zero            ## $a2 = 00000000
/* 000B0 80A1FE70 3C053C03 */  lui     $a1, 0x3C03                ## $a1 = 3C030000
/* 000B4 80A1FE74 34A5126F */  ori     $a1, $a1, 0x126F           ## $a1 = 3C03126F
/* 000B8 80A1FE78 0C00B58B */  jal     Actor_SetScale

/* 000BC 80A1FE7C 02002025 */  or      $a0, $s0, $zero            ## $a0 = 00000000
/* 000C0 80A1FE80 8E180004 */  lw      $t8, 0x0004($s0)           ## 00000004
/* 000C4 80A1FE84 2401FFFE */  addiu   $at, $zero, 0xFFFE         ## $at = FFFFFFFE
/* 000C8 80A1FE88 44801000 */  mtc1    $zero, $f2                 ## $f2 = 0.00
/* 000CC 80A1FE8C 0301C824 */  and     $t9, $t8, $at
/* 000D0 80A1FE90 C6000028 */  lwc1    $f0, 0x0028($s0)           ## 00000028
/* 000D4 80A1FE94 8608001C */  lh      $t0, 0x001C($s0)           ## 0000001C
/* 000D8 80A1FE98 3C014307 */  lui     $at, 0x4307                ## $at = 43070000
/* 000DC 80A1FE9C C6040024 */  lwc1    $f4, 0x


.3-205.3-205.3-14.9 0-29.7 1.7-43.8 4.7C161.3 40.7 137.7 32 112 32 50.2 32 0 82.2 0 144c0 25.7 8.7 49.3 23.3 68.2-2.9 14-4.7 28.9-4.7 43.8 0 113.5 91.9 205.3 205.3 205.3 14.9 0 29.7-1.7 43.8-4.7 19 14.6 42.6 23.3 68.2 23.3 61.8 0 112-50.2 112-112 .1-25.6-8.6-49.2-23.2-68.1zm-194.6 91.5c-65.6 0-120.5-29.2-120.5-65 0-16 9-30.6 29.5-30.6 31.2 0 34.1 44.9 88.1 44.9 25.7 0 42.3-11.4 42.3-26.3 0-18.7-16-21.6-42-28-62.5-15.4-117.8-22-117.8-87.2 0-59.2 58.6-81.1 109.1-81.1 55.1 0 110.8 21.9 110.8 55.4 0 16.9-11.4 31.8-30.3 31.8-28.3 0-29.2-33.5-75-33.5-25.7 0-42 7-42 22.5 0 19.8 20.8 21.8 69.1 33 41.4 9.3 90.7 26.8 90.7 77.6 0 59.1-57.1 86.5-112 86.5z"; // Skype

        public const string Slack_Logo_Brands =
            "M94.12 315.1c0 25.9-21.16 47.06-47.06 47.06S0 341 0 315.1c0-25.9 21.16-47.06 47.06-47.06h47.06v47.06zm23.72 0c0-25.9 21.16-47.06 47.06-47.06s47.06 21.16 47.06 47.06v117.84c0 25.9-21.16 47.06-47.06 47.06s-47.06-21.16-47.06-47.06V315.1zm47.06-188.98c-25.9 0-47.06-21.16-47.06-47.06S139 32 164.9 32s47.06 21.16 47.06 47.06v47.06H164.9zm0 23.72c25.9 0 47.06 21.16 47.06 47.06s-21.16 47.06-47.06 47.06H47.06C21.16 243.96 0 222.8 0 196.9s21.16-47.06 47.06-47.06H164.9zm188.98 47.06c0-25.9 21.16-47.06 47.06-47.06 25.9 0 47.06 21.16 47.06 47.06s-21.16 47.06-47.06 47.06h-47.06V196.9zm-23.72 0c0 25.9-21.16 47.06-47.06 47.06-25.9 0-47.06-21.16-47.06-47.06V79.06c0-25.9 21.16-47.06 47.06-47.06 25.9 0 47.06 21.16 47.06 47.06V196.9zM283.1 385.88c25.9 0 47.06 21.16 47.06 47.06 0 25.9-21.16 47.06-47.06 47.06-25.9 0-47.06-21.16-47.06-47.06v-47.06h47.06zm0-23.72c-25.9 0-47.06-21.16-47.06-47.06 0-25.9 21.16-47.06 47.06-47.06h117.84c25.9 0 47.06 21.16 47.06 47.06 0 25


0f;
			}
			[CompilerGenerated]
			private set
			{
			}
		}

		internal Material lightningMaterialMeshInternal
		{
			[CompilerGenerated]
			get
			{
				return null;
			}
			[CompilerGenerated]
			private set
			{
			}
		}

		internal Material lightningMaterialMeshNoGlowInternal
		{
			[CompilerGenerated]
			get
			{
				return null;
			}
			[CompilerGenerated]
			private set
			{
			}
		}

		public virtual void CreateLightningBolt(LightningBoltParameters p)
		{
		}

		public void CreateLightningBolts(ICollection<LightningBoltParameters> parameters)
		{
		}

		protected virtual void Awake()
		{
		}

		protected virtual void Start()
		{
		}

		protected virtual void Update()
		{
		}

		protected virtual void LateUpdate()
		{
		}

		protected virtual LightningBoltParameters OnCreateParameters()
		{
			return null;
		}

		protected LightningBoltParameters CreateParameters()
		{
			return null;
		}

		protected virtual void PopulateParameters(LightningBoltParameters parameters)
		{
		}

		private Coroutine StartCoroutineWrapper(IEnumerator routine)
		{
			return null;
		}

		private void OnSceneLoaded(Scene arg0, LoadSceneMode arg1)


msg+"]");
			return bodymsg;

		} catch (Exception e) {
			e.printStackTrace();ExceptionUtil.getInfo(e);
			return null;
		}
	}

	/**
	 * 编码订单确认（中标信息）
	 * @param callInfo
	 * @return
	 */
	public static String encoderZjCallWinningBid(CallInfo callInfo){

		try {
			String bodymsg = null;

			//乘客电话
			byte [] aphonebyte = ParseUtil.stringToByte(callInfo.getPassengerphone());
			int aphonelen = aphonebyte.length;

			//上车地
			byte [] startaddrbyte = ParseUtil.stringToByte(callInfo.getStartaddr());
			int startaddrlen = startaddrbyte.length;

			//目的地
			byte [] endaddrbyte = ParseUtil.stringToByte(callInfo.getEndaddr());
			int endaddrlen = endaddrbyte.length;

			//备注
			byte [] remarkbyte = ParseUtil.stringToByte(callInfo.getRemark());
			int remarklen = remarkbyte.length;

			byte[] bytes = new byte[14+aphonelen+startaddrlen+endaddrlen+remarklen];

			int dstPos = 0;
			//业务ID
			System.arraycopy(ParseUtil.str2Bcd(callInfo.getOrderid()), 0, bytes, dstPos, 6);
			dstPos += 6;
			//结果 0x00 失败；0x01 成功  0x02 电召已被抢答
			System.arraycopy(ParseUtil.sortToByte(ParseUtil.intToBytes(callInfo.getResult(),1)), 0, bytes, dstPos, 1);
			dstPos+=1;
			//业务类型
			System.arraycopy(ParseUtil.sortToByte(ParseUtil.intToBytes(callInfo.getOrdertype(),1)), 0, bytes, dstPos, 1);
			dstPos+=1;
			//要车时间
			System.arraycopy(ParseUtil.str2Bcd(DateUtil.dateToNumber(callInfo.getOrdertime())), 0, bytes, dstPos, 6);
			dstPos += 6;
			//上车地
			System.arraycopy(startaddrbyte, 0, bytes, dstPos, startaddrlen);
			dstPos += startaddrlen;
			//目的地
			System.arraycopy(endaddrbyte, 0, bytes, dstPos, endaddrlen);
			dstPos += endaddrlen;
			//乘客电话
			System.arraycopy(aphonebyte, 0, bytes, dstPos, aphonelen);
			dstPos += aphonelen;
			//备注
			System.arraycopy(remarkbyte, 0, bytes, dstPos, remarklen);
			dstPos += remarklen;

			bodymsg = ParseUtil.parseByteToHexStr(bytes);

			logger.info("编码订单确认（中标信息）: ["+bodymsg+"]");
			return bodymsg;

		} catch (Exception e) {
			e.printStackTrace();
			ExceptionUtil.getInfo(e);
			return null;
		}
	}

	/**
	 * 编码中心取消订单
	 * @param callInfo
	 * @return
	 */
	public static String encoderZjCenterCancel(CallInfo callInfo){

		try {
			byte[] bytes = new byte[6];
			int dstPos = 0;
			//业务ID
			System.arraycopy(ParseUtil.str2Bcd(callInfo.getOrderid()), 0, bytes, dstPos, 6);
			dstPos += 6;
			String bodymsg = ParseUtil.parseByteToHexStr(bytes);
			logger.info("编码中心取消订单: ["+bodymsg+"]");
			return bodymsg;

		} catch (Exception e) {
			e.printStackTrace();
			ExceptionUtil.getInfo(e);
			return null;
		}
	}

	/**
	 * 编码 电子服务证下发
	 * @param electronicStorage
	 * @return
	 */
	public static String encoderElectronicStorage(ElectronicStorage electr


 output: schema::OutputFormat,
    identity: String,
    encoding: String,
    profile: schema::Profile,
    validated: bool,
}

#[derive(Clone, Default, Debug)]
struct ShaderRecord {
    name: String,
    entry: String,
    artifacts: Vec<ShaderArtifact>,
}

fn compile_hlsl_to_dxil(
    records: Arc<RwLock<Vec<ShaderRecord>>>,
    config: &transport::Config,
    cache_path: &Path,
    identities: Arc<RwLock<Vec<(PathBuf, String)>>>,
    entry: &ParsedShaderEntry,
) -> Result<()> {
    if entry.language != "hlsl" {
        // Not an HLSL source file
        return Ok(());
    }

    if entry.output.iter().find(|name| name == &"dxil").is_none() {
        // DXIL output is not requested for this entry point
        return Ok(());
    }

    trace!(
        "Compiling '{}' [{}]: entry:[{}], file:[{:?}], DXIL, defines:{:#?}",
        entry.profile,
        entry.name,
        entry.entry_point,
        &cache_path.join(&entry.identity),
        &flatten_defines(&entry.defines),
    );

    let mut define_map: HashMap<String, String> = HashMap::new();
    entry.defines.iter().for_each(|(name, value)| {
        define_map.insert(name.to_string(), value.to_string());
    });

    let (target_profile, target_version) = parse_dxc_profile_version(entry.profile.as_ref());
    let options = drivers::dxc::CompileOptions {
        entry_point: entry.entry_point.clone(),
        definitions: define_map,
        input_format: drivers::dxc::InputFormat::Hlsl as i32,
        output_format: drivers::dxc::OutputFormat::Dxil as i32,
        target_version: target_version as i32,
        target_profile: target_profile as i32,
        optimization_level: drivers::dxc::OptimizationLevel::Two as i32,
        hlsl_version: drivers::dxc::HlslVersion::Edition2018 as i32,
        warning_level: drivers::dxc::WarningLevel::Default as i32,
        validation_level: drivers::dxc::ValidationLevel::Default as i32,
        code_generation: drivers::dxc::CodeGeneration::Enabled as i32,
        debug_info: drivers::dxc::DebugInfo::Enabled as i32,
        listing_info: drivers::dxc::ListingInfo::Enabled as i32,
        flow_control: drivers::dxc::FlowControl::Default as i32,
        denorm: drivers::dxc::DenormLevel::Any as i32,
        matrix_packing: drivers::dxc::MatrixPacking::Default as i32,
        signature_packing: drivers::dxc::SignaturePacking::PrefixStable as i32,
        all_resources_bound: false,
        enable_16bit_types: false,
        legacy_macro_expansion: false,
        color_coded_listing: true,
        strict_mode: false,
        force_ieee: false,
        output_include_depth: false,
        output_include_details: false,
        output_hex_literals: false,
        output_instruction_numbers: false,
        output_instruction_offsets: false,
        output_optimizer_commands: false,
        ignore_line_directives: false,
        deny_legacy_cbuffer_load: true,
        spirv: None,
    };

    let mut record = ShaderRecord {
        name: entry.name.to_owned(),
        entry: entry.entry_point.clone(),
        artifacts: Vec::new(),
    };

    let artifact_profile = match target_profile {
        drivers::


n, 1, 1)).to.equal(1);
			printBoard(boardAfterTurn);
		});

		it(`should be in game phase 'TurnPlayer2'`, async () => {
			const gamePhase = await instance.gamePhase();
			const gamePhaseNum = gamePhase.toNumber();
			expect(gamePhaseNum).to.equal(GamePhaseEnum.TurnPlayer2);
		});

		it("should be in turn #1", async () => {
			const elapsedTurns = await instance.elapsedTurns();
			expect(elapsedTurns.toNumber()).to.equal(1);
		});

		it(`should reject when performing turn #2 for player #1`, async () => {
			const boardBeforeTurn = await instance.board();
			expect(getBoardAt(boardBeforeTurn, 0, 1)).to.equal(0);
			sinon.spy(instance, "playerTurn");
			try {
				await instance.playerTurn(0, 1);
			} catch (err) {}
			expect(instance.playerTurn.returnValues[0]).to.be.rejectedWith(
				Error,
				`Not this player's turn.`
			);
			instance.playerTurn.restore();
			const boardAfterTurn = await instance.board();
			expect(getBoardAt(boardAfterTurn, 0, 1)).to.equal(0);
		});

		it(`should perform turn #2 for player #2`, async () => {
			const player2 = accounts[1];
			const boardBeforeTurn = await instance.board({ from: player2 });
			expect(getBoardAt(boardBeforeTurn, 0, 1)).to.equal(0);
			await instance.playerTurn(0, 1, { from: player2 });
			const boardAfterTurn = await instance.board({ from: player2 });
			expect(getBoardAt(boardAfterTurn, 0, 1)).to.equal(2);
			printBoard(boardAfterTurn);
		});

		it("should be in turn #1", async () => {
			const elapsedTurns = await instance.elapsedTurns();
			expect(elapsedTurns.toNumber()).to.equal(2);
		});
	});

	const playGame = async (players, turns) => {
		for (let i = 0; i < turns.length; ++i) {
			const playerNum = i % 2;
			const gamePhase = await instance.gamePhase();
			const gamePhaseNum = gamePhase.toNumber();
			expect(gamePhaseNum).to.equal(
				playerNum == 0
					? GamePhaseEnum.TurnPlayer1
					: GamePhaseEnum.TurnPlayer2
			);
			const currentTurn = turns[i];
			const player = players[playerNum];
			await instance.playerTurn(currentTurn.x, currentTurn.y, {
				from: player
			});
			const boardAtEnd = await instance.board();
			const elapsedTurns = await instance.elapsedTurns();
			printBoard(
				boardAtEnd,
				`Board after turn #${elapsedTurns} of player #${gamePhaseNum}.`
			);
		}
	};

	describe("Auto Test Game #1 (win player #1)", () => {
		before(async () => {
			instance = await TicTacToe.new();
			console.log(`Contract deployed @ ${instance.address}`);
		});

		it(`should be in game phase 'Join'`, async () => {
			const gamePhase = await instance.gamePhase();
			const gamePhaseNum = gamePhase.toNumber();
			expect(gamePhaseNum).to.equal(GamePhaseEnum.Join);
		});

		it("should be joinable for others", async () => {
			const joiningPlayers = accounts.slice(0, 2);
			for (let i = 0; i < joiningPlayers.length; ++i) {
				await instance.join({ from: joiningPlayers[i] });
			}
			const players = await instance.players();
			expect(players).to.have.length(2);
			expect(players).to.have.length(joiningPlayers.length);
			for (let i = 0; i < players.length; ++i) {
				expect(players


override this to update the height for a wrapped text if the width of a vertex is
 * changed, the following can be used.
 *
 * (code)
 * var mxVertexHandlerUnion = mxVertexHandler.prototype.union;
 * mxVertexHandler.prototype.union = function(bounds, dx, dy, index, gridEnabled, scale, tr, constrained)
 * {
 *   var result = mxVertexHandlerUnion.apply(this, arguments);
 *   var s = this.state;
 *
 *   if (this.graph.isHtmlLabel(s.cell) && (index == 3 || index == 4) &&
 *       s.text != null && s.style[mxConstants.STYLE_WHITE_SPACE] == 'wrap')
 *   {
 *     var label = this.graph.getLabel(s.cell);
 *     var fontSize = mxUtils.getNumber(s.style, mxConstants.STYLE_FONTSIZE, mxConstants.DEFAULT_FONTSIZE);
 *     var ww = result.width / s.view.scale - s.text.spacingRight - s.text.spacingLeft
 *
 *     result.height = mxUtils.getSizeForString(label, fontSize, s.style[mxConstants.STYLE_FONTFAMILY], ww).height;
 *   }
 *
 *   return result;
 * };
 * (end)
 */
mxVertexHandler.prototype.union = function(bounds, dx, dy, index, gridEnabled, scale, tr, constrained, centered)
{
	gridEnabled = (gridEnabled != null) ? gridEnabled && this.graph.gridEnabled : this.graph.gridEnabled;

	if (this.singleSizer)
	{
		var x = bounds.x + bounds.width + dx;
		var y = bounds.y + bounds.height + dy;

		if (gridEnabled)
		{
			x = this.graph.snap(x / scale) * scale;
			y = this.graph.snap(y / scale) * scale;
		}

		var rect = new mxRectangle(bounds.x, bounds.y, 0, 0);
		rect.add(new mxRectangle(x, y, 0, 0));

		return rect;
	}
	else
	{
		var w0 = bounds.width;
		var h0 = bounds.height;
		var left = bounds.x - tr.x * scale;
		var right = left + w0;
		var top = bounds.y - tr.y * scale;
		var bottom = top + h0;

		var cx = left + w0 / 2;
		var cy = top + h0 / 2;

		if (index > 4 /* Bottom Row */)
		{
			bottom = bottom + dy;

			if (gridEnabled)
			{
				bottom = this.graph.snap(bottom / scale) * scale;
			}
			else
			{
				bottom = Math.round(bottom / scale) * scale;
			}
		}
		else if (index < 3 /* Top Row */)
		{
			top = top + dy;

			if (gridEnabled)
			{
				top = this.graph.snap(top / scale) * scale;
			}
			else
			{
				top = Math.round(top / scale) * scale;
			}
		}

		if (index == 0 || index == 3 || index == 5 /* Left */)
		{
			left += dx;

			if (gridEnabled)
			{
				left = this.graph.snap(left / scale) * scale;
			}
			else
			{
				left = Math.round(left / scale) * scale;
			}
		}
		else if (index == 2 || index == 4 || index == 7 /* Right */)
		{
			right += dx;

			if (gridEnabled)
			{
				right = this.graph.snap(right / scale) * scale;
			}
			else
			{
				right = Math.round(right / scale) * scale;
			}
		}

		var width = right - left;
		var height = bottom - top;

		if (constrained)
		{
			var geo = this.graph.getCellGeometry(this.state.cell);

			if (geo != null)
			{
				var


akk := a[rk*lda+k]
		a[rk*lda+k] = 1

		// Compute kth column of F:
		//
		// Compute F[k+1:n, k] = tau[k]*A[rk:m, k+1:n]^T*A[rk:m, k].
		if k < n-1 {
			bi.Dgemv(blas.Trans, m-rk, n-k-1, tau[k],
				a[rk*lda+k+1:], lda,
				a[rk*lda+k:], lda,
				0,
				f[(k+1)*ldf+k:], ldf)
		}

		// Padding F[0:k, k] with zeros.
		for j := 0; j < k; j++ {
			f[j*ldf+k] = 0
		}

		// Incremental updating of F:
		//
		// F[0:n, k] := F[0:n, k] - tau[k]*F[0:n, 0:k-1]*A[rk:m, 0:k-1]^T*A[rk:m,k].
		if k > 0 {
			bi.Dgemv(blas.Trans, m-rk, k, -tau[k],
				a[rk*lda:], lda,
				a[rk*lda+k:], lda,
				0,
				auxv, 1)
			bi.Dgemv(blas.NoTrans, n, k, 1,
				f, ldf,
				auxv, 1,
				1,
				f[k:], ldf)
		}

		// Update the current row of A:
		//
		// A[rk, k+1:n] = A[rk, k+1:n] - A[rk, 0:k]*F[k+1:n, 0:k]^T.
		if k < n-1 {
			bi.Dgemv(blas.NoTrans, n-k-1, k+1, -1,
				f[(k+1)*ldf:], ldf,
				a[rk*lda:], 1,
				1,
				a[rk*lda+k+1:], 1)
		}

		// Update partial column norms.
		if rk < lastrk-1 {
			for j := k + 1; j < n; j++ {
				if vn1[j] == 0 {
					continue
				}

				// The following marked lines follow from the
				// analysis in Lapack Working Note 176.
				r := math.Abs(a[rk*lda+j]) / vn1[j] // *
				temp := math.Max(0, 1-r*r)          // *
				r = vn1[j] / vn2[j]                 // *
				temp2 := temp * r * r               // *
				if temp2 < tol3z {
					// vn2 is used here as a collection of
					// indices into vn2 and also a collection
					// of column norms.
					vn2[j] = float64(lsticc)
					lsticc = j
				} else {
					vn1[j] *= math.Sqrt(temp) // *
				}
			}
		}

		a[rk*lda+k] = akk
	}
	kb = k
	rk = offset + kb

	// Apply the block reflector to the rest of the matrix:
	//
	// A[offset+kb+1:m, kb+1:n] := A[offset+kb+1:m, kb+1:n] - A[offset+kb+1:m, 1:kb]*F[kb+1:n, 1:kb]^T.
	if kb < min(n, m-offset) {
		bi.Dgemm(blas.NoTrans, blas.Trans,
			m-rk, n-kb, kb, -1,
			a[rk*lda:], lda,
			f[kb*ldf:], ldf,
			1,
			a[rk*lda+kb:], lda)
	}

	// Recomputation of difficult columns.
	for lsticc >= 0 {
		itemp := int(vn2[lsticc])

		// NOTE: The computation of vn1[lsticc] relies on the fact that
		// Dnrm2 does not fai


   obj.tmuxMode = "◉ unmuted"
      muted = false
    end
  end

  obj.setAllInputsMuted(muted)
end

function obj.buildMenubar()
  local menutable = hs.fnutils.map(obj.getModes(), function(item)
    local title = ""
    if item.checked then
      title = req("utils").template(
        "{menu_title}\t\t {menu_keys}",
        { menu_title = tostring(item.title), menu_keys = obj.menuKeyFormatter(obj.momentaryKey) }
      )
    else
      title = item.title
    end

    return {
      title = title,
      fn = function() obj.setMode(item.mode) end,
      checked = item.checked,
    }
  end)

  return menutable
end

function obj.setMode(s)
  obj.mode = s
  log.df("Setting PTT mode to %s", s)

  -- local muted = obj.mode == "push-to-talk"
  -- hs.audiodevice.defaultInputDevice():setInputMuted(muted)

  if obj.menubar ~= nil then
    obj.menubar:setMenu(obj.buildMenubar())
    obj.menubar:setTitle(obj.icons[obj.mode])

    obj.updateMenubar()
  end
end
obj.setState = obj.setMode

function obj.toggleMode()
  local currentMode = obj.mode
  local toggle_to = hs.fnutils.find(obj.getModes(currentMode), function(item)
    if not item.checked then return item end
  end) or obj.mode

  obj.setMode(toggle_to.mode)

  log.df("Toggling PTT mode to %s", toggle_to.mode, currentMode)

  return toggle_to.mode
end

function obj.currentMode() return obj.tmuxMode end

function obj:start(opts)
  if opts["mode"] ~= nil then self.mode = opts["mode"] end

  self:stop()

  self.momentaryKeyWatcher = hs.eventtap.new({ hs.eventtap.event.types.flagsChanged }, function(evt)
    local modifiersMatch = function(modifiers)
      local modifiersMatch = true

      for _, key in ipairs(obj.momentaryKey) do
        if modifiers[key] ~= true then modifiersMatch = false end
      end

      return modifiersMatch
    end

    if modifiersMatch(evt:getFlags()) then
      self.pushed = true
    else
      self.pushed = false
    end

    require("utils").tmux.update()
    self.updateMenubar()
  end)
  self.momentaryKeyWatcher:start()

  if self.menubar == nil then self.menubar = hs.menubar.new() end

  self.setMode(self.mode)

  local toggleMod, toggleKey = table.unpack(self.toggleKey)
  hs.hotkey.bind(toggleMod, toggleKey, function()
    local newMode = self.toggleMode()
    hs.alert.closeAll()
    hs.alert.show("Toggled to -> " .. newMode)
  end)

  info(fmt("[START] %s (%s)", self.name, self.mode))

  return self
end

function obj:stop()
  if self.momentaryKeyWatcher then self.momentaryKeyWatcher:stop() end
  return self
end

return obj


getFileLocation().getFileName();
		}

		if (node.getParent() != null) {
			return getCorrespondingFile(node.getParent());
		}

		for (IASTNode modifiedNode : modificationStore.getRootModifications().getModifiedNodes()) {
			for (ASTModification modification : modificationStore.getRootModifications()
					.getModificationsForNode(modifiedNode)) {
				if (modification.getNewNode() == node) {
					return getCorrespondingFile(modification.getTargetNode());
				}
			}
		}
		return null;
	}
}
/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * https://www.eclipse.org/legal/epl-2.0/.
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

package org.eclipse.birt.report.engine.emitter;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;

import junit.framework.TestCase;

/**
 * Testcase for XMLWriter
 *
 */
public class XMLWriterTest extends TestCase {

	public void test() throws Exception {
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		XMLWriter writer = new XMLWriter();
		writer.open(out);
		writer.startWriter();
		writer.openTag("fo:root");
		writer.attribute("xmlns:fo", "http://www.w3.org/1999/XSL/Format");
		writer.openTag("fo:layout-master-set");
		writer.openTag("fo:simple-page-master");
		writer.attribute("master-name", "example");
		writer.attribute("page-height", "16.8in");
		writer.attribute("page-width", "21.2in");
		writer.attribute("margin-left", "1cm");
		writer.attribute("margin-top", "1cm");
		writer.attribute("margin-bottom", "1cm");
		writer.attribute("margin-right", "1cm");
		writer.openTag("fo:region-body");
		writer.closeTag("fo:region-body");
		writer.closeTag("fo:simple-page-master");
		writer.closeTag("fo:layout-master-set");
		writer.openTag("fo:page-sequence");
		writer.attribute("master-reference", "example");
		writer.openTag("fo:flow");
		writer.attribute("flow-name", "xsl-region-body");
		writer.openTag("fo:table");
		writer.attribute("width", "518mm");
		writer.openTag("fo:table-column");
		writer.attribute("number-columns-repeated", 2);
		writer.closeTag("fo:table-column");

		writer.openTag("fo:table-body");
		writer.openTag("fo:table-row");
		writer.attribute("height", "32pt");
		writer.openTag("fo:table-cell");
		writer.openTag("fo:block");
		writer.attribute("color", "blue");
		writer.text("cell-value");
		writer.closeTag("fo:block");
		writer.closeTag("fo:table-cell");
		writer.openTag("fo:table-cell");
		writer.closeTag("fo:table-cell");
		writer.closeTag("fo:table-row");
		writer.closeTag("fo:table-body");
		writer.closeTag("fo:table");
		writer.closeTag("fo:flow");
		writer.closeTag("fo:page-sequence");
		writer.closeTag("fo:root");
		writer.close();

		String result = out.toString("UTF-8");
		// System.out.println(result);
		InputStream


M_writer_step_beg(_writer, current_time);
    }
  }

  // End code time step

  void
  Coupling::time_step_end ()
  {
    // if there is a writer, a step is open and it is a writting step
    if (_writer != NULL && PDM_writer_is_open_step(_writer) == 1 && (_n_step % _freq_writer == 0)) {

      // some unexchanged visu ON
      std::map < string, Field * >::iterator it_f1 = _fields.begin();
      while (it_f1 != _fields.end()) {
        // field unexchanged visu ON
        if (it_f1->second->visuStatusGet() == CWP_STATUS_ON) {
          CWP_Field_exch_t exchange_type = it_f1->second->exchangeTypeGet();
          if (exchange_type == CWP_FIELD_EXCH_SEND || exchange_type == CWP_FIELD_EXCH_SENDRECV) {
            // has not been sent
            if (it_f1->second->is_send_yet_get() == 0) {
              it_f1->second->is_send_end_step_set(1);
              it_f1->second->write(CWP_FIELD_EXCH_SEND);
              it_f1->second->is_send_end_step_set(0);
            }
          }
          else if (exchange_type == CWP_FIELD_EXCH_RECV || exchange_type == CWP_FIELD_EXCH_SENDRECV) {
            // has not been received
            if (it_f1->second->is_recv_yet_get() == 0) {
              it_f1->second->is_recv_end_step_set(1);
              it_f1->second->write(CWP_FIELD_EXCH_RECV);
              it_f1->second->is_recv_end_step_set(0);
            }
          }
        }
        it_f1++;
      }

      // end step
      PDM_writer_step_end(_writer);
    }

    // increment step
    _n_step++;

    // reset field status to unexchanged
    std::map < string, Field * >::iterator it_f2 = _fields.begin();
    while (it_f2 != _fields.end()) {
      it_f2->second->is_send_yet_set(0);
      it_f2->second->is_recv_yet_set(0);
      it_f2++;
    }
  }

// A supprimer

  CWP_g_num_t*
  Coupling::globalNumGet(int id_block,int i_part)
  {
    return _mesh.globalNumGet(id_block,i_part);
  }

  // int
  // Coupling::isUpToDateGet ()
  // {
  //   return _is_up_to_date;
  // }

  // void
  // Coupling::isUpToDateSet ()
  // {
  //   _is_up_to_date = 1;
  // }

} // namespace cwipi

/**
 * \endcond
 */
/*
    Copyright 2013-2025 Onera.

    This file is part of Cassiopee.

    Cassiopee is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Cassiopee 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 Cassiopee.  If not, see <http://www.gnu.org/licenses/>.
*/

// Grille cartesienne reguliere
# include "FastS/fastS.h"

using namespace std;
using namespace K_FLD;

// ============================================================================
/* Create a cartesian mesh of nixnjxnk points
   IN: x0, y0, z0: orig


:
    import scanpy as sc

    raw_counts = pd.read_csv(raw_counts_path, sep='\t', index_col=0)
    spot_coord = pd.read_csv(spot_coord_path, sep='\t')
    spot_coord.index = spot_coord['x'].astype(str) + ['x' for _ in range(len(spot_coord))] + spot_coord['y'].astype(str)
    merged = pd.merge(spot_coord, raw_counts, left_index=True, right_index=True)
    raw_counts = raw_counts.reindex(merged.index)
    adata = sc.AnnData(raw_counts)
    col1 = merged['pixel_x'].values
    col2 = merged['pixel_y'].values
    matrix = (np.vstack((col1, col2))).T
    adata.obsm['spatial'] = matrix
    return adata

def ADT_to_adata(img_path, raw_counts_path):
    import scanpy as sc

    basedir = os.path.dirname(img_path)
    # combine spot coordinates into a single dataframe
    pre_adt_path= find_first_file_endswith(basedir, 'pre-ADT.tsv')
    post_adt_path = find_first_file_endswith(basedir, 'postADT.tsv')
    if post_adt_path is None:
        post_adt_path = find_first_file_endswith(basedir, 'post-ADT.tsv')
    counts = pd.read_csv(raw_counts_path, index_col=0, sep='\t')
    pre_adt = pd.read_csv(pre_adt_path, sep='\t')
    post_adt = pd.read_csv(post_adt_path, sep='\t')
    merged_coords = pd.concat([pre_adt, post_adt], ignore_index=True)
    merged_coords.index = [str(x) + 'x' + str(y) for x, y in zip(merged_coords['x'], merged_coords['y'])]
    merged = pd.merge(merged_coords, counts, left_index=True, right_index=True, how='inner')
    counts = counts.reindex(merged.index)
    adata = sc.AnnData(counts)
    col1 = merged['pixel_x'].values
    col2 = merged['pixel_y'].values
    matrix = (np.vstack((col1, col2))).T
    adata.obsm['spatial'] = matrix
    return adata


s.calculateValueType
import kotlin.reflect.KType
import kotlin.reflect.full.withNullability

/**
 * Implementation of [AggregatorAggregationHandler] which functions like a reducer:
 * it takes a sequence of values and returns a single value, which can be a completely different type.
 *
 * @param reducer This function actually does the reduction.
 *   Before it is called, nulls are filtered out. The type of the values is passed as [KType] to the reducer.
 * @param getReturnType This function must be supplied to give the return type of [reducer] given some input type and
 *   whether the input is empty.
 * @see [SelectingAggregationHandler]
 */
internal class ReducingAggregationHandler<in Value : Any, out Return : Any?>(
    val reducer: Reducer<Value, Return>,
    val getReturnType: CalculateReturnType,
) : AggregatorAggregationHandler<Value, Return> {

    /**
     * Base function of [Aggregator].
     *
     * Aggregates the given values, taking [valueType] into account,
     * filtering nulls (only if [valueType.type.isMarkedNullable][KType.isMarkedNullable]),
     * and computes a single resulting value.
     *
     * When the exact [valueType] is unknown, use [calculateValueType] or [aggregateCalculatingValueType].
     *
     * Calls the supplied [reducer].
     */
    @Suppress("UNCHECKED_CAST")
    override fun aggregateSequence(values: Sequence<Value?>, valueType: ValueType): Return {
        val (values, valueType) = aggregator!!.preprocessAggregation(values, valueType)
        return reducer(
            // values =
            if (valueType.isMarkedNullable) {
                values.filterNotNull()
            } else {
                values as Sequence<Value>
            },
            // type =
            valueType.withNullability(false),
        )
    }

    /** This function always returns `-1` because the result of a reducer is not in the input values. */
    override fun indexOfAggregationResultSingleSequence(values: Sequence<Value?>, valueType: ValueType): Int = -1

    /**
     * Give the return type of [reducer] given some input type and whether the input is empty.
     * Calls the supplied [getReturnType].
     */
    override fun calculateReturnType(valueType: KType, emptyInput: Boolean): KType =
        getReturnType(valueType.withNullability(false), emptyInput)

    override var aggregator: Aggregator<@UnsafeVariance Value, @UnsafeVariance Return>? = null
}
package org.jetbrains.kotlinx.dataframe.impl.columns.tree

import org.jetbrains.kotlinx.dataframe.AnyCol
import org.jetbrains.kotlinx.dataframe.DataFrame
import org.jetbrains.kotlinx.dataframe.api.asColumnGroup
import org.jetbrains.kotlinx.dataframe.api.isColumnGroup
import org.jetbrains.kotlinx.dataframe.columns.ColumnPath
import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath
import org.jetbrains.kotlinx.dataframe.impl.columns.addPath
import org.jetbrains.kotlinx.dataframe.impl.columns.changePath

internal tailrec fun <T> ReadonlyTreeNode<T>.getAncestor(depth: Int): ReadonlyTreeNode<T> {
    if (depth > this.depth) throw UnsupportedOperationException()
    if (depth == this.depth) return this
    val p = parent ?: throw UnsupportedOperationException()
    return p.getAncestor(depth)
}

internal fun <T> TreeNode<T?>.getOrPut(path: ColumnPath) = getOrPutEmpty(path, null)

internal fun <T> TreeNode<T>.getOrPutEmpty(path: ColumnPath, emptyData: T): TreeNode<T> =


tnCancel").LeftClick += (s, e) => Hide();
        }

        private void BtnOK_LeftClick(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(tbPresetName.Text))
                return;

            if (userPresets.GetConfigurationsForCurrentTheater().Exists(c => c.Theater.Equals(map.LoadedTheaterName, StringComparison.OrdinalIgnoreCase) && c.Name == tbPresetName.Text))
            {
                EditorMessageBox.Show(WindowManager,
                    Translate(this, "PresetAlreadyExists.Title", "Preset already exists"),
                    string.Format(Translate(this, "PresetAlreadyExists.Description",
                        "A preset with the name {0} already exists for the current theater!"), tbPresetName.Text),
                    MessageBoxButtons.OK);
                return;
            }

            SaveAccepted?.Invoke(this, tbPresetName.Text);
            Hide();
        }

        public void Open()
        {
            tbPresetName.Text = tbPresetName.Suggestion;
            Show();
        }
    }
}


 : BaseFloat>(persp : PerspectiveFov<S>) -> Matrix4<S>
{
	let mut m = Matrix4::<S>::zero();

	let two : S = cast(2).unwrap();
	let f = Rad::tan(persp.fovy / two);

	let a = S::one() / (persp.aspect * f);
	let b = S::one() / f;
	let c = (persp.far + persp.near) / (persp.far - persp.near);
	let d = S::one();
	let e = -(two * persp.far * persp.near) / (persp.far - persp.near);
	// glm::perspectiveRH_NO and glm::perspectiveLH_NO both Negate the e term.

	m[0][0] = a;
	m[1][1] = b;
	m[2][2] = c;
	m[2][3] = d;
	m[3][2] = e;

	return m;
}

// This outputs a right-handed erspective matrix that ranges in depth from 0 to
// 1
#[allow(dead_code)]
pub fn _dx_perspective_rh<S : BaseFloat>(persp : PerspectiveFov<S>) -> Matrix4<S>
{
	let mut m = Matrix4::<S>::zero();

	let two : S = cast(2).unwrap();
	let f = Rad::tan(persp.fovy / two);
	let height = f;
	let width = height / persp.aspect;
	let f_range = persp.far / (persp.far - persp.near);

	m[0][0] = width;
	m[1][1] = height;
	m[2][2] = f_range;
	m[2][3] = -S::one();
	m[3][2] = f_range * persp.near;

	return m;
}

// This outputs a left-handed erspective matrix that ranges in depth from 0 to 1
#[allow(dead_code)]
pub fn _dx_perspective_lh<S : BaseFloat>(persp : PerspectiveFov<S>) -> Matrix4<S>
{
	let mut m = Matrix4::<S>::zero();

	let two : S = cast(2).unwrap();
	let f = Rad::tan(persp.fovy / two);
	let height = f;
	let width = height / persp.aspect;
	let f_range = persp.far / (persp.far - persp.near);

	m[0][0] = width;
	m[1][1] = height;
	m[2][2] = f_range;
	m[2][3] = S::one();
	m[3][2] = -f_range * persp.near;

	return m;
}

#[allow(dead_code)]
pub fn perspective_lh<S : BaseFloat>(persp : PerspectiveFov<S>) -> Matrix4<S>
{
	_glm_perspective_lh(persp)
}

#[allow(dead_code)]
pub fn perspective_rh<S : BaseFloat>(persp : PerspectiveFov<S>) -> Matrix4<S>
{
	_glm_perspective_rh(persp)
}

#[cfg(test)]
mod transform_tests
{
	use crate::transforms;
	use cgmath::*;
	use std::f32::consts::PI;

	#[allow(dead_code)]
	const TEST_EYE : Point3<f32> = Point3::new(0.0, 0.0, -2.0);
	#[allow(dead_code)]
	const TEST_TARGET : Point3<f32> = Point3::new(0.0, 0.0, 0.0);
	#[allow(dead_code)]
	const UP : Vector3<


deployerConfigFilePath, yaml.dump(defaultDeployerConfig))
  }

  // Check read and write access rights to config file
  try {
    fs.accessSync(deployerConfigFilePath, fs.constants.R_OK | fs.constants.W_OK)
  } catch (e) {
    // Warn but don't abort job, return default config instead
    Logger.error(
      `Error: Failed to access config file: "${deployerConfigFilePath}". Using default values.`
    )
    Logger.debug(e)
    return defaultDeployerConfig
  }

  // Read and parse Deployer config file
  try {
    const deployerConfigFileText = fs.readFileSync(deployerConfigFilePath, 'utf8')
    const deployerConfig: any = yaml.load(deployerConfigFileText)

    // Find missing keys and add them to config
    let configKeysMissing = false
    Object.keys(defaultDeployerConfig).forEach((key) => {
      if (!Object.keys(deployerConfig).includes(key)) {
        deployerConfig[key] = defaultDeployerConfig[key]
        configKeysMissing = true
      }
    })

    // Find extra keys in deployerConfig and remove them
    let extraConfigKeys = false
    Object.keys(deployerConfig).forEach((key) => {
      if (!Object.keys(defaultDeployerConfig).includes(key)) {
        deployerConfig[key] = undefined
        extraConfigKeys = true
      }
    })
    if (configKeysMissing || extraConfigKeys) {
      fs.writeFileSync(deployerConfigFilePath, JSON.stringify(deployerConfig))
    }

    return deployerConfig
  } catch (e) {
    // Warn but don't abort job, return default config instead
    Logger.error('Error: Failed to parse deployer config. Using default values.')
    Logger.debug(e)
    return defaultDeployerConfig
  }
}

/**
 * Sets the environment variables that configure deployer.
 *
 * @remarks
 * The environment variables used by deployer are all prefixed with 'DEPLOYER_'.
 * The configuration is loaded with the priority of: `~./deployer/config.yml < cwd .env < CLI options`.
 * The global configuration file is guaranteed to exist.
 *
 * @param thisCommand - Parent commander Command.
 * @param actionCommand - Child commander subcommand Command.
 */
export function configureEnvironmentHook (thisCommand: Command, actionCommand: Command): void {
  const deployerConfig: DeployerConfig = loadDeployerConfig()
  const opts = thisCommand.opts()
  Object.keys(opts).forEach((key) => {
    deployerConfig[key] = opts[key]
  })
  const env: any = {}
  Object.keys(deployerConfig).forEach((key) => {
    return (env[`DEPLOYER_${key.replace(/([A-Z])/g, '_$1').toUpperCase()}`] = deployerConfig[key])
  })
  Object.keys(env).forEach((key) => {
    process.env[key] = env[key]
  })
  Logger.debug('Compiled environment:', env)
}

export default function createShader(gl: WebGLRenderingContext, type: number, source: string): WebGLShader {
  let shader = gl.createShader(type);
  gl.shaderSource(shader, source);
  gl.compileShader(shader);

  if (gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { return shader; }

  console.error(gl.getShaderInfoLog(shader));
  gl.deleteShader(shader);
}'use strict';
import { fetchRetrySuccess } from '../util/apiCall';
export const getUserCurrentlyPlayingSpotify = async (spotifyRefreshToken: string): Promise<any> => {
    try {
      const response = await fetchRetrySuccess('https://api.spotify.com/v1/me/player', {
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${spotifyRefreshToken}`
        }
      });


_extrinsic_name, move |params: Params| match params
		.parse::<Vec<u8>>()
	{
		Ok(encoded_params) => match Request::decode(&mut encoded_params.as_slice()) {
			Ok(request) => {
				let shard: ShardIdentifier = request.shard;
				let encrypted_trusted_call: Vec<u8> = request.cyphertext;
				let result = async {
					submit_watch_author.watch_top(encrypted_trusted_call.clone(), shard).await
				};
				let response: Result<Hash, RpcError> = executor::block_on(result);
				let json_value = match response {
					Ok(hash_value) => RpcReturnValue {
						do_watch: true,
						value: hash_value.encode(),
						status: DirectRequestStatus::TrustedOperationStatus(
							TrustedOperationStatus::Submitted,
						),
					}
					.encode(),
					Err(rpc_error) => compute_encoded_return_error(rpc_error.message),
				};
				Ok(json!(json_value))
			},
			Err(_) =>
				Ok(json!(compute_encoded_return_error("Could not decode request".to_owned()))),
		},
		Err(e) => {
			let error_msg: String = format!("Could not submit trusted call due to: {}", e);
			Ok(json!(compute_encoded_return_error(error_msg)))
		},
	});

	// author_submitExtrinsic
	let author_submit_extrinsic_name: &str = "author_submitExtrinsic";
	let submit_author = rpc_author.clone();
	rpc_methods_vec.push(author_submit_extrinsic_name);
	io.add_sync_method(author_submit_extrinsic_name, move |params: Params| {
		match params.parse::<Vec<u8>>() {
			Ok(encoded_params) => match Request::decode(&mut encoded_params.as_slice()) {
				Ok(request) => {
					let shard: ShardIdentifier = request.shard;
					let encrypted_trusted_op: Vec<u8> = request.cyphertext;
					let result = async {
						submit_author.submit_top(encrypted_trusted_op.clone(), shard).await
					};
					let response: Result<Hash, RpcError> = executor::block_on(result);
					let json_value = match response {
						Ok(hash_value) => RpcReturnValue {
							do_watch: false,
							value: hash_value.encode(),
							status: DirectRequestStatus::TrustedOperationStatus(
								TrustedOperationStatus::Submitted,
							),
						}
						.encode(),
						Err(rpc_error) => compute_encoded_return_error(rpc_error.message),
					};
					Ok(json!(json_value))
				},
				Err(_) =>
					Ok(json!(compute_encoded_return_error("Could not decode request".to_owned()))),
			},
			Err(e) => {
				let error_msg: String = format!("Could not submit trusted call due to: {}", e);
				Ok(json!(compute_encoded_return_error(error_msg)))
			},
		}
	});

	// author_pendingExtrinsics
	let author_pending_extrinsic_name: &str = "author_pendingExtrinsics";
	let pending_author = rpc_author;
	rpc_methods_vec.push(author_pending_extrinsic_name);
	io.add_sync_method(author_pending_extrinsic_name, move |params: Params| {
		match params.parse::<Vec<String>>() {
			Ok(shards) => {
				let mut retrieved_operations = vec![];
				for shard_base58 in shards.iter


using System;
using System.Drawing;
using System.Windows.Forms;

namespace YUNkefu
{
    public partial class frmWaitingBox : SkinMain
    {
        #region Properties
        private int _MaxWaitTime;
        private int _WaitTime;
        private bool _CancelEnable;
        private IAsyncResult _AsyncResult;
        private EventHandler<EventArgs> _Method;
        private bool _IsShown = true;
        private readonly int _EffectCount = 10;
        private readonly int _EffectTime = 500;
        /// <summary>
        /// 控制界面显示的特性
        /// </summary>
        private Timer _Timer;
        public string Message { get; private set; }
        public int TimeSpan { get; set; }
        public bool FormEffectEnable { get; set; }
        #endregion

        #region frmWaitingBox
        public frmWaitingBox(EventHandler<EventArgs> method, int maxWaitTime, string waitMessage, bool cancelEnable, bool timerVisable)
        {
            maxWaitTime *= 1000;
            Initialize(method, maxWaitTime, waitMessage, cancelEnable, timerVisable);
        }
        public frmWaitingBox(EventHandler<EventArgs> method)
        {
            int maxWaitTime = 60 * 1000;
            string waitMessage = "正在处理数据，请稍后...";
            bool cancelEnable = true;
            bool timerVisable = true;
            Initialize(method, maxWaitTime, waitMessage, cancelEnable, timerVisable);
        }
        public frmWaitingBox(EventHandler<EventArgs> method, string waitMessage)
        {
            int maxWaitTime = 60 * 1000;
            bool cancelEnable = true;
            bool timerVisable = true;
            Initialize(method, maxWaitTime, waitMessage, cancelEnable, timerVisable);
        }
        public frmWaitingBox(EventHandler<EventArgs> method, bool cancelEnable, bool timerVisable)
        {
            int maxWaitTime = 60 * 1000;
            string waitMessage = "正在处理数据，请稍后...";
            Initialize(method, maxWaitTime, waitMessage, cancelEnable, timerVisable);
        }
        #endregion

        #region Initialize
        private void Initialize(EventHandler<EventArgs> method, int maxWaitTime, string waitMessage, bool cancelEnable, bool timerVisable)
        {
            InitializeComponent();
            //initialize form
            this.FormBorderStyle = FormBorderStyle.None;
            this.StartPosition = FormStartPosition.CenterParent;
            this.ShowInTaskbar = false;
            Color[] c = GetRandColor();
            this.panel1.BackColor = c[0];
            this.BackColor = c[1];
            this.labMessage.Text = waitMessage;
            _Timer = new Timer();
            _Timer.Interval = _EffectTime / _EffectCount;
            _Timer.Tick += _Timer_Tick;
            this.Opacity = 0;
            FormEffectEnable = true;
            //para
            TimeSpan = 500;
            Message = string.Empty;
            _CancelEnable = cancelEnable;
            _MaxWaitTime = maxWaitTime;


 36),
      Pair(BufferId(2), 37),
      Pair(BufferId(3), 38),
      Pair(BufferId(4), 39)
    ))

    val copy = original.copy()
    copy.fromVariantMap(original.toVariantMap())
    assert(original.isEqual(copy)) {
      System.err.println("Original:\n$original")
      System.err.println("Copy:\n$copy")
    }
  }
}
/*
 * Quasseldroid - Quassel client for Android
 *
 * Copyright (c) 2020 Janne Mareike Koschinski
 * Copyright (c) 2020 The Quassel Project
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 3 as published
 * by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */

package de.kuschku.libquassel.ssl

import javax.security.auth.x500.X500Principal

val X500Principal.commonName
  get() = commonName(name)

fun commonName(distinguishedName: String) =
  X509Helper.COMMON_NAME.find(distinguishedName)?.groups?.get(1)?.value

val X500Principal.organization
  get() = organization(name)

fun organization(distinguishedName: String) =
  X509Helper.ORGANIZATION.find(distinguishedName)?.groups?.get(1)?.value

val X500Principal.organizationalUnit
  get() = organizationalUnit(name)

fun organizationalUnit(distinguishedName: String) =
  X509Helper.ORGANIZATIONAL_UNIT.find(distinguishedName)?.groups?.get(1)?.value
/*
 * Quasseldroid - Quassel client for Android
 *
 * Copyright (c) 2020 Janne Mareike Koschinski
 * Copyright (c) 2020 The Quassel Project
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 3 as published
 * by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */

package de.kuschku.libquassel.session

import de.justjanne.libquassel.annotations.ProtocolSide
import de.kuschku.libquassel.connection.Features
import de.kuschku.libquassel.protocol.IdentityId
import de.kuschku.libquassel.protocol.NetworkId
import de.kuschku.libquassel.protocol.QVariantList
import de.kuschku.libquassel.protocol.message.HandshakeMessage
import de.kuschku.libquassel.protocol.message.SignalProxyMessage
import de.kuschku.libquassel.quassel.QuasselFeatures
import de.kuschku.libquassel.quassel.syncables.Identity
import de.kuschku.libquassel.quassel.syncables.Network
import de.kuschku.libquassel.quassel.syncables.interfaces.ISyncableObject

interface SignalProxy {
  fun handle(f: SignalProxyMessage.SyncMessage) = false
  fun handle(f: SignalProxyMessage.RpcCall) = false
  fun handle(f: SignalProxyMessage.InitRequest) = false
  fun handle(f: SignalProxyMessage.InitData) = false
  fun handle(f: SignalProxyMessage.HeartBeat) = false
  fun handle(f: SignalProxyMessage.HeartBeatReply) = false

  fun handle(f: SignalProxyMessage): Boolean = when (f) {
    is Sign


ence):
        """De-tokenize the sequence (or not)

        Same args/returns as :func:`tokenize()`
        """

        if self.tokenizer_opt is not None and ''.join(sequence.split()) != '':
            return self.detokenize(sequence)
        return sequence

    def detokenize(self, sequence):
        """Detokenize a single sequence

        Same args/returns as :func:`tokenize()`
        """

        if self.tokenizer is None:
            raise ValueError("No tokenizer loaded")

        if self.tokenizer_opt["type"] == "sentencepiece":
            detok = self.tokenizer.DecodePieces(sequence.split())
        elif self.tokenizer_opt["type"] == "pyonmttok":
            detok = self.tokenizer.detokenize(sequence.split())

        return detok


0x3E = 60480 (= 59488 + 62 x 16) 0x3F = 60496 (= 59488 + 63 x 16)"]
    #[inline]
    pub fn fltv(&mut self) -> _FLTVW {
        _FLTVW { w: self }
    }
}
<reponame>trembel/ambiq-apollo1-pac
#![doc = "Peripheral access API for APOLLO1 microcontrollers (generated using svd2rust v0.17.0)\n\nYou can find an overview of the API [here].\n\n[here]: https://docs.rs/svd2rust/0.17.0/svd2rust/#peripheral-api"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(legacy_directory_ownership)]
#![deny(missing_docs)]
#![deny(no_mangle_generic_items)]
#![deny(non_shorthand_field_patterns)]
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(plugin_as_library)]
#![deny(private_in_public)]
#![deny(safe_extern_statics)]
#![deny(unconditional_recursion)]
#![deny(unions_with_drop_fields)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
#![deny(unused_parens)]
#![deny(while_true)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![no_std]
extern crate bare_metal;
extern crate cortex_m;
#[cfg(feature = "rt")]
extern crate cortex_m_rt;
extern crate vcell;
use core::marker::PhantomData;
use core::ops::Deref;
#[doc = r"Number available in the NVIC for configuring priority"]
pub const NVIC_PRIO_BITS: u8 = 3;
#[cfg(feature = "rt")]
extern "C" {
    fn BROWNOUT();
    fn WDT();
    fn CLKGEN_RTC();
    fn VCOMP();
    fn IOSLAVE();
    fn IOSLAVEACC();
    fn IOMSTR0();
    fn IOMSTR1();
    fn ADC();
    fn GPIO();
    fn CTIMER();
    fn UART();
}
#[doc(hidden)]
pub union Vector {
    _handler: unsafe extern "C" fn(),
    _reserved: u32,
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".vector_table.interrupts"]
#[no_mangle]
pub static __INTERRUPTS: [Vector; 12] = [
    Vector { _handler: BROWNOUT },
    Vector { _handler: WDT },
    Vector {
        _handler: CLKGEN_RTC,
    },
    Vector { _handler: VCOMP },
    Vector { _handler: IOSLAVE },
    Vector {
        _handler: IOSLAVEACC,
    },
    Vector { _handler: IOMSTR0 },
    Vector { _handler: IOMSTR1 },
    Vector { _handler: ADC },
    Vector { _handler: GPIO },
    Vector { _handler: CTIMER },
    Vector { _handler: UART },
];
#[doc = r"Enumeration of all the interrupts"]
#[derive(Copy, Clone, Debug)]
#[repr(u8)]
pub enum Interrupt {
    #[doc = "0 - BROWNOUT"]
    BROWNOUT = 0,
    #[doc = "1 - WDT"]
    WDT = 1,
    #[doc = "2 - CLKGEN_RTC"]
    CLKGEN_RTC = 2,
    #[doc = "3 - VCOMP"]
    VCOMP = 3,
    #[doc = "4 - IOSLAVE"]
    IOSLAVE = 4,
    #[doc = "5 - IOSLAVEACC"]
    IOSLAVEACC = 5,
    #[doc = "6 - IOMSTR0"]
    IOMSTR0 = 6,
    #[doc = "7 - IOMSTR1"]
    IOMSTR1 = 7,


'
                        newSpan.title = 'rating-score'
                        newSpan.textContent = 'Score: ' + ratingScore  // 将文本内容设置为评分
                        newSpan.style.marginLeft = '10px'  // 添加一些左边距以增加间距
                        newSpan.style.fontSize = '12px'  // 设置字体大小
                        scriptLink.insertAdjacentElement('afterend', newSpan)  // 将新 span 元素添加到 .script-link 后面
                    }
                }
            } else {
                // 如果 insertAtScriptLink 为 false，添加评分信息到 .script-list-ratings 内部
                if (!item.querySelector('.good-rating-count[title="rating-score"]')) {
                    let newSpan = document.createElement('span')
                    newSpan.className = 'good-rating-count'
                    newSpan.title = 'rating-score'
                    newSpan.textContent = 'Score: ' + ratingScore  // 将文本内容设置为评分
                    newSpan.style.marginLeft = '10px'  // 添加一些左边距以增加间距
                    newSpan.style.fontSize = '12px'  // 设置字体大小
                    item.insertAdjacentElement('beforeend', newSpan)  // 将新 span 元素添加为现有元素的子元素
                }
            }
        })
    }
    // 函数：处理脚本列表中的每个项
    function processScriptItem(article) {
        if (userlocalfav) {
            addlocalfav(article)
        }
        if (showRating) {
            addRatingSpan(article, true)
        }
        if (showSourceCode) {
            addLinkAboveScriptList(article)
        }
        if (showinstallbutton) {
            addInstallAndDownloadLinks(article)
        }
    }
    function initializeScriptList() {
        const articles = document.querySelectorAll('#browse-script-list > li, #user-script-list > li')
        if (articles.length > 0) {
            articles.forEach(article => {
                processScriptItem(article)
            })
        } else {
            return // 或者返回某个特定值，例如 return false;
        }
    }
    if (document.querySelectorAll('#browse-script-list > li, #user-script-list > li')) {
        // 初次调用处理现有脚本列表项
        initializeScriptList()
        // 创建 MutationObserver 以检测 DOM 中的变化
        const ScriptListobserver = new MutationObserver((mutations) => {
            mutations.forEach(mutation => {
                if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
                    mutation.addedNodes.forEach(node => {
                        if (node.nodeType === 1 && (node.id === 'user-script-list-section' || node.id === 'browse-script-list')) {
                            if (node.id === 'user-script-list-section') {
                                node = node.querySelector('#user-script-list')
                                logMessage('用户列表', '元素', true, node)
                            }
                            if (node.id === 'browse-script-list') {
                                logMessage('脚本列表', '元素', true, node)
                            }
                            Array.from(node.children).forEach(li => {
                                processScriptItem(li)
                            })
                        }
                        if (node.nodeType === 1 && (node.matches('#browse-script-list > li') || node.matches('#user-script-list > li'))) {
                            logMessage('脚本列表_规则2', '元素', true, node)
                            proc


/ int screenWidth = metrics.widthPixels;
			// int screenHeight =metrics.heightPixels;
			bitmap = EaseImageCache.getInstance().get(uri.getPath());
			if (bitmap == null) {
				EaseLoadLocalBigImgTask task = new EaseLoadLocalBigImgTask(this, uri.getPath(), image, loadLocalPb, ImageUtils.SCALE_IMAGE_WIDTH,
						ImageUtils.SCALE_IMAGE_HEIGHT);
				if (android.os.Build.VERSION.SDK_INT > 10) {
					task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
				} else {
					task.execute();
				}
			} else {
				image.setImageBitmap(bitmap);
			}
		} else if (remotepath != null) { //去服务器下载图片
			EMLog.d(TAG, "download remote image");
			Map<String, String> maps = new HashMap<String, String>();
			if (!TextUtils.isEmpty(secret)) {
				maps.put("share-secret", secret);
			}
			downloadImage(remotepath, maps);
		} else {
			image.setImageResource(default_res);
		}

		image.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});
	}

	/**
	 * 下载图片
	 *
	 * @param remoteFilePath
	 */
	private void downloadImage(final String remoteFilePath, final Map<String, String> headers) {
		String str1 = getResources().getString(R.string.Download_the_pictures);
		pd = new ProgressDialog(this);
		pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
		pd.setCanceledOnTouchOutside(false);
		pd.setMessage(str1);
		pd.show();
		File temp = new File(localFilePath);
		final String tempPath = temp.getParent() + "/temp_" + temp.getName();
		final EMCallBack callback = new EMCallBack() {
			public void onSuccess() {

				runOnUiThread(new Runnable() {
					@Override
					public void run() {
                        new File(tempPath).renameTo(new File(localFilePath));

                        DisplayMetrics metrics = new DisplayMetrics();
						getWindowManager().getDefaultDisplay().getMetrics(metrics);
						int screenWidth = metrics.widthPixels;
						int screenHeight = metrics.heightPixels;

						bitmap = ImageUtils.decodeScaleImage(localFilePath, screenWidth, screenHeight);
						if (bitmap == null) {
							image.setImageResource(default_res);
						} else {
							image.setImageBitmap(bitmap);
							EaseImageCache.getInstance().put(localFilePath, bitmap);
							isDownloaded = true;
						}
						if (EaseShowBigImageActivity.this.isFinishing() || EaseShowBigImageActivity.this.isDestroyed()) {
						    return;
						}
						if (pd != null) {
							pd.dismiss();
						}
					}
				});
			}

			public void onError(int error, String msg) {
				EMLog.e(TAG, "offline file transfer error:" + msg);
				File file = new File(tempPath);
				if (file.exists()&&file.isFile()) {
					file.delete();
				}
				runOnUiThread(new Runnable() {
					@Override
					public void run() {
						if (EaseShowBigImageActivity.this.isFinishing() || EaseShowBigImageActivity.this.isDestroyed()) {
						    return;
						}
                        image.setImageResource(default_res);
                        pd.dismiss();
					}
				});
			}

			public void onProgress(final int progress, String status) {
				EMLog.d(TAG, "Progress: " + progress);
				final String str2 = getResources().getString(R.string.Download_the_pictures_new);
				runOnUiThread(new Runnable() {
					@Override
					public void run() {
                        if (E


                // just show the text fully
                while (message.isNotEmpty()) {
                    topText.text += message.poll()
                }

                return@setOnMouseClicked
            }

            selectLine(localID)
        }

        boxPlayerLines.children.add(text)
    }

    private fun selectLine(choiceLocalID: Int) {
        boxPlayerLines.children.clear()
        nextLine(nextNodeFromChoice(choiceLocalID))
    }

    private fun playAudioLines(node: DialogueNode) {
        if (node.audioFileName.isEmpty())
            return

        // TODO: store audio being played, so we can stop as appropriate
        val audio = assetLoader.load<Music>(AssetType.MUSIC, assetLoader.getURL(node.audioFileName.replace("\\", "/")))

        audioPlayer.stopMusic(audio)
        audioPlayer.playMusic(audio)
    }

    private fun nextNode(): DialogueNode? {
        return graph.nextNode(currentNode)
    }

    private fun nextNodeFromChoice(optionID: Int): DialogueNode? {
        return graph.nextNode(currentNode, optionID)
    }

    private fun onOpen() {
        boxPlayerLines.opacity = 1.0
    }

    private fun onClose() {
        message.clear()
        boxPlayerLines.children.clear()
        onFinished.run()
    }

    private fun String.parseAndCallFunctions() {
        val funcCalls = this.split("\n".toRegex())

        funcCalls.forEach { line ->
            if (line.trim().isNotEmpty()) {
                dialogueScriptRunner.callFunction(line)
            }
        }
    }
}

/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB (almaslvl@gmail.com).
 * See LICENSE for details.
 */
@file:Suppress("JAVA_MODULE_DOES_NOT_DEPEND_ON_MODULE")
package com.almasb.fxgl.texture

import com.almasb.fxgl.test.RunWithFX
import javafx.geometry.HorizontalDirection
import javafx.geometry.Rectangle2D
import javafx.geometry.VerticalDirection
import javafx.scene.Node
import javafx.scene.effect.BlendMode
import javafx.scene.image.Image
import javafx.scene.image.WritableImage
import javafx.scene.paint.Color
import javafx.scene.shape.Rectangle
import org.hamcrest.CoreMatchers.`is`
import org.hamcrest.CoreMatchers.not
import org.hamcrest.MatcherAssert.assertThat
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.api.function.Executable
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.EnumSource

/**
 *
 *
 * @author Almas Baimagambetov (almaslvl@gmail.com)
 */
@ExtendWith(RunWithFX::class)
class TextureTest {

    private lateinit var texture: Texture

    companion object {
        private val image: Image = WritableImage(320, 320)
    }

    @BeforeEach
    fun setUp() {
        texture = Texture(image)
    }

    @Test
    fun `Width and Height`() {
        assertThat(texture.width, `is`(320.0))
        assertThat(texture.height, `is`(320.0))
    }

    @Test
    fun `Copy creates new node with same image`() {
        val copy = texture.copy()

        assertThat(texture !== copy, `is`(true))
        assertThat(texture.image === copy.image, `is`(true))
    }

    @Test
    fun `Test subtexture`() {
        val sub = texture.subTexture(Rectangle2D(0.0, 0.0, 128.0, 64.0))


레이** 기법을 사용하였음. 하지만 프로그래머가 직접 메모리를 관리해야 하고 멀티 태스킹이 어렵다는 문제가 있어 전반적인 메모리 부족 문제를 해결할 수 없었음.
- 물리 메모리에 프로그램을 배치하면 연속된 공간이 필요함. 프로그램이 종료되고 새로 로드되면서, 여기저기 공간들이 작게 남아있는 **단편화(Fragmentation)** 문제가 발생하여, 총 메모리 공간이 충분해도 프로그램 실행이 어려웠음.
- 여러 프로그램을 동시에 실행하는 멀티태스킹이 등장하면서 같은 메모리를 공유하다 보니 **메모리 충돌과 침범 문제**가 발생하였고, 운영체제는 이를 해결할 새로운 메모리 관리 기법이 필요했음.

---

### 2⃣ 가상 메모리

#### 가상 메모리란

- 가상 메모리는 실제 물리 메모리(RAM)보다 더 큰 논리적 메모리 공간을 제공하는 운영체제의 메모리 관리 기법.
- 프로그램이 실행될 때 필요한 부분만 메모리에 적재하고, 나머지는 디스크에 저장하여 필요한 순간에만 불러오는 방식.
- CPU가 가상 주소를 사용하여 메모리에 접근하고, 운영체제가 가상 주소를 실제 물리 주소로 변환하여 관리.

#### 필요성

- 프로그램의 **필요한 부분만 적재**하므로 RAM 크기에 상관없이 크기가 큰 프로그램 실행 가능.
- **페이징** 기법으로 프로그램을 작은 페이지로 나누어 관리하면서 메모리를 효율적으로 활용하고, 연속된 공간이 없어도 프로그램이 실행되어 단편화 문제 해결.
- �


e {
          cpudebug_printf("Invalid interrupt number\n");
        }
      } else {
        cpudebug_printf("Need an interrupt number\n");
      }
      break;
    case 't':
      tmppc = 1;
      if(*args) {
        tmppc = strtoul(args, &argsend, 16);
        if(argsend == args) tmppc = 1;
      }
      if(tmppc > 0) {
        while(tmppc--) {
          if(execstep) execstep();
          else s68000exec(starcontext, 1);
        }
        cpudebug_registerdump();
      }
      break;
    case 'r':
      cpudebug_registerdump();
      break;
    case 'q':
      return -1;
    case 's':
      if(*args) {
        tmppc = strtoul(args, &argsend, 10);
        if(tmppc > 0) return tmppc;
        else cpudebug_printf("Invalid CPU number\n");
      } else return 0;
      break;
    default:
/*      cpudebug_printf("Unknown command\n");*/
      break;
    }
  }
  return -1;
}


/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.dark-mode .accent-danger .custom-control-input:focus:not(:checked)~.custom-control-label::before,.dark-mode .accent-danger .custom-file-input:focus~.custom-file-label,.dark-mode .accent-danger .custom-select:focus,.dark-mode .accent-danger .form-control:focus:not(.is-invalid):not(.is-warning):not(.is-valid){border-color:#f5b4ae}.dark-mode .accent-danger .page-item .page-link{color:#e74c3c}.dark-mode .accent-danger .page-item.active .page-link,.dark-mode .accent-danger .page-item.active a{background-color:#e74c3c;border-color:#e74c3c;color:#fff}.dark-mode .accent-danger .page-item.disabled .page-link,.dark-mode .accent-danger .page-item.disabled a{background-color:#fff;border-color:#dee2e6;color:#6c757d}.dark-mode .accent-danger [class*=sidebar-dark-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link){color:#c2c7d0}.dark-mode .accent-danger [class*=sidebar-dark-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):hover{color:#fff}.dark-mode .accent-danger [class*=sidebar-light-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link){color:#343a40}.dark-mode .accent-danger [class*=sidebar-light-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):hover{color:#212529}.dark-mode .dark-mode.accent-danger .page-item .page-link:focus,.dark-mode .dark-mode.accent-danger .page-item .page-link:hover{color:#ea6153}.dark-mode .accent-light .btn-link,.dark-mode .accent-light .nav-tabs .nav-link,.dark-mode .accent-light a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):not(.page-link):not(.btn){color:#f8f9fa}.dark-mode .accent-light .btn-link:hover,.dark-mode .accent-light .nav-tabs .nav-link:hover,.dark-mode .accent-light a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):not(.page-link):not(.btn):hover{color:#cbd3da}.dark-mode .accent-light .dropdown-item.active,.dark-mode .accent-light .dropdown-item:active{background-color:#f8f9fa;color:#1f2d3d}.dark-mode .accent-light .custom-control-input:checked~.custom-control-label::before{background-color:#f8f9fa;border-color:#bdc6d0}.dark-mode .accent-light .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%231f2d3d' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.dark-mode .accent-light .custom-control-input:focus:not(:checked)~.custom-control-label


 {
				values[j] = v
				j++
				s.add(v.ID)
			}
		}
		if j == 0 {
			delete(f.NamedValues, name)
		} else {
			f.Names[i] = name
			i++
			for k := len(values) - 1; k >= j; k-- {
				values[k] = nil
			}
			f.NamedValues[name] = values[:j]
		}
	}
	clearNames := f.Names[i:]
	for j := range clearNames {
		clearNames[j] = LocalSlot{}
	}
	f.Names = f.Names[:i]

	pendingLines := f.cachedLineStarts // Holds statement boundaries that need to be moved to a new value/block
	pendingLines.clear()

	// Unlink values and conserve statement boundaries
	for i, b := range f.Blocks {
		if !reachable[b.ID] {
			// TODO what if control is statement boundary? Too late here.
			b.ResetControls()
		}
		for _, v := range b.Values {
			if !live[v.ID] {
				v.resetArgs()
				if v.Pos.IsStmt() == src.PosIsStmt && reachable[b.ID] {
					pendingLines.set(v.Pos, int32(i)) // TODO could be more than one pos for a line
				}
			}
		}
	}

	// Find new homes for lost lines -- require earliest in data flow with same line that is also in same block
	for i := len(order) - 1; i >= 0; i-- {
		w := order[i]
		if j := pendingLines.get(w.Pos); j > -1 && f.Blocks[j] == w.Block {
			w.Pos = w.Pos.WithIsStmt()
			pendingLines.remove(w.Pos)
		}
	}

	// Any boundary that failed to match a live value can move to a block end
	pendingLines.foreachEntry(func(j int32, l uint, bi int32) {
		b := f.Blocks[bi]
		if b.Pos.Line() == l && b.Pos.FileIndex() == j {
			b.Pos = b.Pos.WithIsStmt()
		}
	})

	// Remove dead values from blocks' value list. Return dead
	// values to the allocator.
	for _, b := range f.Blocks {
		i := 0
		for _, v := range b.Values {
			if live[v.ID] {
				b.Values[i] = v
				i++
			} else {
				f.freeValue(v)
			}
		}
		b.truncateValues(i)
	}

	// Remove dead blocks from WBLoads list.
	i = 0
	for _, b := range f.WBLoads {
		if reachable[b.ID] {
			f.WBLoads[i] = b
			i++
		}
	}
	clearWBLoads := f.WBLoads[i:]
	for j := range clearWBLoads {
		clearWBLoads[j] = nil
	}
	f.WBLoads = f.WBLoads[:i]

	// Remove unreachable blocks. Return dead blocks to allocator.
	i = 0
	for _, b := range f.Blocks {
		if reachable[b.ID] {
			f.Blocks[i] = b
			i++
		} else {
			if len(b.Values) > 0 {
				b.Fatalf("live values in unreachable block %v: %v", b, b.Values)
			}
			f.freeBlock(b)
		}
	}
	// zero remainder to help GC
	tail := f.Blocks[i:]
	for j := range tail {
		tail[j] = nil
	}
	f.Blocks = f.Blocks[:i]
}

// removeEdge removes the i'th outgoing edge from b (and
// the corresponding incoming edge from b.Succs[i].b).
func (b *Block) removeEdge(i int) {
	e := b.Succs[i]
	c := e.