gReturnTypes)) {
            continue;
        }

        // If the expression is an variable declared in the parent function, add the ! to the variable
        if (ts.isIdentifier(expression)) {
            const declaringVariableInitializer = getVariableInitializerForExpression(request, expression, functionLike);
            if (declaringVariableInitializer !== undefined) {
                mutations.push(createNonNullAssertion(request, declaringVariableInitializer));
                continue;
            }
        }

        // Otherwise, add it at the end of the expression
        mutations.push(createNonNullAssertion(request, expression));
    }

    return mutations;
};
export interface GeoCoordinates{
    latitude : number,
    longitude : number,
}

export interface GeoCoordinatesBound{
    northeast : GeoCoordinates,
    southwest : GeoCoordinates,
    // northwest : GeoCoordinates,
    // southeast : GeoCoordinates,
}import { ReactElement } from 'react';
import { StyleProp, ViewStyle } from 'react-native';

export class IndexPath {

  constructor(readonly row: number, readonly section?: number) {
  }

  get groupIndex(): IndexPath {
    return this.section >= 0 && new IndexPath(this.row);
  }

  public toString(): string {
    if (this.section >= 0) {
      return `${this.section + 1}.${this.row + 1}`;
    }
    return (this.row + 1).toString();
  }

  public equals = (other: IndexPath): boolean => {
    if (!other) {
      return false;
    }
    return this.row === other.row && this.section === other.section;
  };
}

export type StyleType = StyleProp<ViewStyle>;
export type ChildrenProp<Element extends ReactElement = ReactElement> = Element | Element[];
export type ChildrenWithProps<Props = {}> = ChildrenProp<ReactElement<Props>>;
export type RenderProp<Props = {}> = (props?: Props) => ReactElement;

/*
 * @see https://github.com/piotrwitek/utility-types#overwritet-u
 */
export type Overwrite<T extends object, U extends object, I = Diff<T, U> & Intersection<U, T>> = Pick<I, keyof I>;

/*
 * @see https://github.com/piotrwitek/utility-types#intersectiont-u
 */
export type Intersection<T extends object, U extends object> =
  Pick<T, Extract<keyof T, keyof U> & Extract<keyof U, keyof T>>;

/*
 * @see https://github.com/piotrwitek/utility-types#setdifferencea-b-same-as-exclude
 */
export type SetDifference<A, B> = A extends B ? never : A;

/*
 * @see https://github.com/piotrwitek/utility-types#difft-u
 */
export type Diff<T extends object, U extends object> = Pick<T, SetDifference<keyof T, keyof U>>;

export type StatusType =
  | 'basic'
  | 'primary'
  | 'success'
  | 'info'
  | 'warning'
  | 'danger'
  | string;

export type SizeType =
  | 'mini'
  | 'small'
  | 'medium'
  | 'large'
  | 'big'
  | string;

export type ButtonType =
  | 'filled'
  | 'outline'
  | 'ghost';

export type ShapeType =
  | 'round'
  | 'rounded'
  | 'square'
  | string;

export type InputSizeType =
  | 'small'
  | 'medium'
  | 'large'
  | string;

export type TextCategoryType =
  | 'h1'
  | 'h2'
  | 'h3'
  | 'h4'
  | 'h5'
  | 'h6'
  | 's1'
  | 's2'
  | 'p1'
  | 'p2'
  | 'c1'
  | 'c2'
  | 'label'
  | string;

export interface StyledComponentProps {
  key?: number;
  style: StyleType;
  appearance?: string;
}
import { getConnection, Repository } from 'typeorm';
import { UserEntity } from 'entity/User';
import { UserInput } from


	max[z].x = max[z].y = max[z].count = max[z].fullcount = 0;
			}
		}

		long long progress = -1;

		long long ip;
		for (ip = 0; ip < indices; ip++) {
			unsigned xx, yy;
			decode_index(map[ip].ix, &xx, &yy);

			long long nprogress = 100 * ip / indices;
			if (nprogress != progress) {
				progress = nprogress;
				if (!quiet && !quiet_progress && progress_time()) {
					fprintf(stderr, "Base zoom/drop rate: %lld%% \r", progress);
				}
			}

			int z;
			for (z = 0; z <= MAX_ZOOM; z++) {
				unsigned xxx = 0, yyy = 0;
				if (z != 0) {
					xxx = xx >> (32 - z);
					yyy = yy >> (32 - z);
				}

				double scale = (double) (1LL << (64 - 2 * (z + 8)));

				if (tile[z].x != xxx || tile[z].y != yyy) {
					if (tile[z].count > max[z].count) {
						max[z] = tile[z];
					}

					tile[z].x = xxx;
					tile[z].y = yyy;
					tile[z].count = 0;
					tile[z].fullcount = 0;
					tile[z].gap = 0;
					tile[z].previndex = 0;
				}

				tile[z].fullcount++;

				if (manage_gap(map[ip].ix, &tile[z].previndex, scale, gamma, &tile[z].gap)) {
					continue;
				}

				tile[z].count++;
			}
		}

		int z;
		for (z = MAX_ZOOM; z >= 0; z--) {
			if (tile[z].count > max[z].count) {
				max[z] = tile[z];
			}
		}

		int max_features = 50000 / (basezoom_marker_width * basezoom_marker_width);

		int obasezoom = basezoom;
		if (basezoom < 0) {
			basezoom = MAX_ZOOM;

			for (z = MAX_ZOOM; z >= 0; z--) {
				if (max[z].count < max_features) {
					basezoom = z;
				}

				// printf("%d/%u/%u %lld\n", z, max[z].x, max[z].y, max[z].count);
			}

			if (!quiet) {
				fprintf(stderr, "Choosing a base zoom of -B%d to keep %lld features in tile %d/%u/%u.\n", basezoom, max[basezoom].count, basezoom, max[basezoom].x, max[basezoom].y);
			}
		}

		if (obasezoom < 0 && basezoom > maxzoom) {
			fprintf(stderr, "Couldn't find a suitable base zoom. Working from the other direction.\n");
			if (gamma == 0) {
				fprintf(stderr, "You might want to try -g1 to limit near-duplicates.\n");
			}

			if (droprate < 0) {
				if (maxzoom == 0) {
					droprate = 2.5;
				} else {
					droprate = exp(log((long double) max[0].count / max[maxzoom].count) / (maxzoom));
					if (!quiet) {
						fprintf(stderr, "Choosing a drop rate of -r%f to get from %lld to %lld in %d zooms\n", droprate, max[maxzoom].count, max[0].count, maxzoom);
					}
				}
			}

			basezoom = 0;
			for (z = 0; z <= maxzoom; z++) {
				double zoomdiff = log((long double) max[z].count / max_features) / log(droprate);
				if (zoomdiff + z > basezoom) {
					basezoom = ceil(zoomdiff + z);
				}
			}

			if (!quiet) {
				fprintf(stderr


; background-color: rgba(0,0,0,0.1); }

	.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonUp,
	.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonUp,
	.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonUp{ background-position: -112px -72px; }

	.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonDown,
	.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonDown,
	.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonDown{ background-position: -112px -92px; }

	.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonLeft,
	.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonLeft,
	.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -120px -112px; }

	.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonRight,
	.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonRight,
	.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonRight{	background-position: -120px -128px; }

	/* theme "inset-2", "inset-2-dark" */

	.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail,
	.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail{
		background-color: transparent;
		border-width: 1px;
		border-style: solid;
		border-color: #fff;
		border-color: rgba(255,255,255,0.2);
		-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
	}

	.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail{ border-color: #000; border-color: rgba(0,0,0,0.2); }

	/* theme "inset-3", "inset-3-dark" */

	.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail{ background-color: #fff; background-color: rgba(255,255,255,0.6); }

	.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail{ background-color: #000; background-color: rgba(0,0,0,0.6); }

	.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.75); }

	.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.85); }

	.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
	.mCS-inset-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.9); }

	.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ background-color: #fff; background-color: rgba(255,255,255,0.75); }

	.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #fff; background-color: rgba(255,255,255,0.85); }

	.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
	.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #fff; background-color: rgba(255,255,255,0.9); }

	/* ---------------------------------


cept">optional object intercept</param>
		/// <param name="displayEquation">optional object displayEquation</param>
		[CustomMethod]
		[SupportByVersion("Word", 14,15,16)]
		public NetOffice.WordApi.Trendline Add(object type, object order, object period, object forward, object backward, object intercept, object displayEquation)
		{
			return Factory.ExecuteKnownReferenceMethodGet<NetOffice.WordApi.Trendline>(this, "Add", NetOffice.WordApi.Trendline.LateBindingApiWrapperType, new object[]{ type, order, period, forward, backward, intercept, displayEquation });
		}

		/// <summary>
		/// SupportByVersion Word 14, 15, 16
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Word.Trendlines.Add"/> </remarks>
		/// <param name="type">optional NetOffice.WordApi.Enums.XlTrendlineType Type = -4132</param>
		/// <param name="order">optional object order</param>
		/// <param name="period">optional object period</param>
		/// <param name="forward">optional object forward</param>
		/// <param name="backward">optional object backward</param>
		/// <param name="intercept">optional object intercept</param>
		/// <param name="displayEquation">optional object displayEquation</param>
		/// <param name="displayRSquared">optional object displayRSquared</param>
		[CustomMethod]
		[SupportByVersion("Word", 14,15,16)]
		public NetOffice.WordApi.Trendline Add(object type, object order, object period, object forward, object backward, object intercept, object displayEquation, object displayRSquared)
		{
			return Factory.ExecuteKnownReferenceMethodGet<NetOffice.WordApi.Trendline>(this, "Add", NetOffice.WordApi.Trendline.LateBindingApiWrapperType, new object[]{ type, order, period, forward, backward, intercept, displayEquation, displayRSquared });
		}

		/// <summary>
		/// SupportByVersion Word 14, 15, 16
		/// </summary>
		/// <param name="index">optional obje


ype', '3': 5, '4': 1, '5': 5, '10': 'type'},
    {
      '1': 'button',
      '3': 6,
      '4': 1,
      '5': 11,
      '6': '.bilibili.app.dynamic.v2.RcmdTopButton',
      '10': 'button'
    },
    {
      '1': 'switch_label',
      '3': 7,
      '4': 1,
      '5': 11,
      '6': '.bilibili.app.dynamic.v2.CampusLabel',
      '10': 'switchLabel'
    },
    {
      '1': 'notice_label',
      '3': 8,
      '4': 1,
      '5': 11,
      '6': '.bilibili.app.dynamic.v2.CampusLabel',
      '10': 'noticeLabel'
    },
    {'1': 'desc2', '3': 9, '4': 1, '5': 9, '10': 'desc2'},
    {'1': 'desc3', '3': 10, '4': 1, '5': 9, '10': 'desc3'},
    {
      '1': 'invite_label',
      '3': 11,
      '4': 1,
      '5': 11,
      '6': '.bilibili.app.dynamic.v2.CampusLabel',
      '10': 'inviteLabel'
    },
    {
      '1': 'reserve_label',
      '3': 12,
      '4': 1,
      '5': 11,
      '6': '.bilibili.app.dynamic.v2.CampusLabel',
      '10': 'reserveLabel'
    },
    {'1': 'reserve_number', '3': 13, '4': 1, '5': 3, '10': 'reserveNumber'},
    {'1': 'max_reserve', '3': 14, '4': 1, '5': 3, '10': 'maxReserve'},
    {
      '1': 'school_label',
      '3': 15,
      '4': 1,
      '5': 11,
      '6': '.bilibili.app.dynamic.v2.CampusLabel',
      '10': 'schoolLabel'
    },
    {
      '1': 'mng_label',
      '3': 16,
      '4': 1,
      '5': 11,
      '6': '.bilibili.app.dynamic.v2.CampusLabel',
      '10': 'mngLabel'
    },
    {
      '1': 'rcmd_topic',
      '3': 17,
      '4': 1,
      '5': 11,
      '6': '.bilibili.app.dynamic.v2.CampusHomeRcmdTopic',
      '10': 'rcmdTopic'
    },
    {
      '1': 'audit_before_open',
      '3': 18,
      '4': 1,
      '5': 8,
      '10': 'auditBeforeOpen'
    },
    {'1': 'audit_message', '3': 19, '4': 1, '5': 9, '10': 'auditMessage'},
  ],
};

/// Descriptor for `CampusRcmdTop`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List campusRcmdTopDescriptor = $convert.base64Decode(
    'Cg1DYW1wdXNSY21kVG9wEhsKCWNhbXB1c19pZBgBIAEoA1IIY2FtcHVzSWQSHwoLY2FtcHVzX2'
    '5hbWUYAiABKAlSCmNhbXB1c05hbW


glabel func_808A75B8
/* 013A8 808A75B8 27BDFFC8 */  addiu   $sp, $sp, 0xFFC8           ## $sp = FFFFFFC8
/* 013AC 808A75BC AFBF0034 */  sw      $ra, 0x0034($sp)
/* 013B0 808A75C0 AFB00030 */  sw      $s0, 0x0030($sp)
/* 013B4 808A75C4 AFA5003C */  sw      $a1, 0x003C($sp)
/* 013B8 808A75C8 8482016C */  lh      $v0, 0x016C($a0)           ## 0000016C
/* 013BC 808A75CC 00808025 */  or      $s0, $a0, $zero            ## $s0 = 00000000
/* 013C0 808A75D0 8CA61C44 */  lw      $a2, 0x1C44($a1)           ## 00001C44
/* 013C4 808A75D4 10400003 */  beq     $v0, $zero, .L808A75E4
/* 013C8 808A75D8 244FFFFF */  addiu   $t7, $v0, 0xFFFF           ## $t7 = FFFFFFFF
/* 013CC 808A75DC A48F016C */  sh      $t7, 0x016C($a0)           ## 0000016C
/* 013D0 808A75E0 8482016C */  lh      $v0, 0x016C($a0)           ## 0000016C
.L808A75E4:
/* 013D4 808A75E4 10400038 */  beq     $v0, $zero, .L808A76C8
/* 013D8 808A75E8 3C014316 */  lui     $at, 0x4316                ## $at = 43160000
/* 013DC 808A75EC C6040090 */  lwc1    $f4, 0x0090($s0)           ## 00000090
/* 013E0 808A75F0 44813000 */  mtc1    $at, $f6                   ## $f6 = 150.00
/* 013E4 808A75F4 3C014248 */  lui     $at, 0x4248                ## $at = 42480000
/* 013E8 808A75F8 4606203C */  c.lt.s  $f4, $f6
/* 013EC 808A75FC 00000000 */  nop
/* 013F0 808A7600 45000008 */  bc1f    .L808A7624
/* 013F4 808A7604 00000000 */  nop
/* 013F8 808A7608 C6080094 */  lwc1    $f8, 0x0094($s0)           ## 00000094
/* 013FC 808A760C 44815000 */  mtc1    $at, $f10                  ## $f10 = 50.00
/* 01400 808A7610 00000000 */  nop
/* 01404 808A7614 460A403C */  c.lt.s  $f8, $f10
/* 01408 808A7618 00000000 */  nop
/* 0140C 808A761C 4503002B */  bc1tl   .L808A76CC
/* 01410 808A7620 8E190118 */  lw      $t9, 0x0118($s0)           ## 00000118
.L808A7624:
/* 01414 808A7624 0C00B75E */  jal     func_8002DD78
/* 01418 808A7628 00C02025 */  or      $a0, $a2, $zero            ## $a0 = 00000000
/* 0141C 808A762C 10400034 */  beq     $v0, $zero, .L808A7700
/* 01420 808A7630 3C0143A0 */  lui     $at, 0x43A0                ## $at = 43A00000
/* 014


-4.14C36.743 -4.319 37.267 -4.07 37.557 -4.265C39.31 -5.442 39.308 -7.478 39.414 -9.388C39.464 -10.272 39.66 -11.589 40.8 -12.2z",
      stroke: "none",
      fill: "#000",
    },
    {
      transform: "matrix(1,0,0,1,200,200)",
      path: "M31.959 -16.666C32.083 -16.743 31.928 -17.166 32.037 -17.382C32.199 -17.706 32.602 -17.894 32.764 -18.218C32.873 -18.434 32.71 -18.814 32.846 -18.956C35.179 -21.403 35.436 -24.427 34.4 -27.4C35.424 -28.02 35.485 -29.282 35.06 -30.129C34.207 -31.829 34.014 -33.755 33.039 -35.298C32.237 -36.567 30.659 -37.811 29.288 -36.508C28.867 -36.108 28.546 -35.321 28.824 -34.609C28.888 -34.446 29.173 -34.3 29.146 -34.218C29.039 -33.894 28.493 -33.67 28.487 -33.398C28.457 -31.902 27.503 -30.391 28.133 -29.062C28.905 -27.433 29.724 -25.576 30.4 -23.8C29.166 -21.684 30.199 -19.235 28.446 -17.358C28.31 -17.212 28.319 -16.826 28.441 -16.624C28.733 -16.138 29.139 -15.732 29.625 -15.44C29.827 -15.319 30.175 -15.317 30.375 -15.441C30.953 -15.803 31.351 -16.29 31.959 -16.666z",
      stroke: "none",
      fill: "#000",
    },
    {
      transform: "matrix(1,0,0,1,200,200)",
      path: "M94.771 -26.977C96.16 -25.185 96.45 -22.39 94.401 -21C94.951 -17.691 98.302 -19.67 100.401 -20.2C100.292 -20.588 100.519 -20.932 100.802 -20.937C101.859 -20.952 102.539 -21.984 103.601 -21.8C104.035 -23.357 105.673 -24.059 106.317 -25.439C108.043 -29.134 107.452 -33.407 104.868 -36.653C104.666 -36.907 104.883 -37.424 104.759 -37.786C104.003 -39.997 101.935 -40.312 100.001 -41C98.824 -44.875 98.163 -48.906 96.401 -52.6C94.787 -52.85 94.089 -54.589 92.752 -55.309C91.419 -56.028 90.851 -54.449 90.892 -53.403C90.899 -53.198 91.351 -52.974 91.181 -52.609C91.105 -52.445 90.845 -52.334 90.845 -52.2C90.846 -52.065 91.067 -51.934 91.201 -51.8C90.283 -50.98 88.86 -50.503 88.565 -49.358C87.611 -45.648 90.184 -42.523 91.852 -39.322C92.443 -38.187 91.707 -36.916 90.947 -35.708C90.509 -35.013 90.617 -33.886 90.893 -33.03C91.645 -30.699 93.236 -28.96 94.771 -26


port.KEY_COL_ESITO_CONTESTO)){
					if(StringUtils.isNotEmpty(t.getEsitoContesto())){
						oneLine.add(esitoUtils.getEsitoContestoLabelFromValue(t.getEsitoContesto()));
					} else {
						oneLine.add(CostantiExport.EMPTY_STRING);
					}
				} else if(keyColonna.equals(CostantiExport.KEY_COL_EVENTI_GESTIONE)){
					if(StringUtils.isNotEmpty(t.getEventiGestione())){
						oneLine.add(t.getEventiGestione());
					} else {
						oneLine.add(CostantiExport.EMPTY_STRING);
					}
				} else if(keyColonna.equals(CostantiExport.KEY_COL_FAULT_COOPERAZIONE)){
					if(StringUtils.isNotEmpty(t.getFaultCooperazione())){
						oneLine.add(t.getFaultCooperazionePretty());
					} else {
						oneLine.add(CostantiExport.EMPTY_STRING);
					}
				} else if(keyColonna.equals(CostantiExport.KEY_COL_FAULT_INTEGRAZIONE)){
					if(StringUtils.isNotEmpty(t.getFaultIntegrazione())){
						oneLine.add(t.getFaultIntegrazionePretty());
					} else {
						oneLine.add(CostantiExport.EMPTY_STRING);
					}
				} else if(keyColonna.equals(CostantiExport.KEY_COL_HEADER_PROTOCOLLO_RICHIESTA)){
					if(StringUtils.isNotEmpty(t.getHeaderProtocolloRichiesta())){
						oneLine.add(t.getHeaderProtocolloRichiesta());
					} else {
						oneLine.add(CostantiExport.EMPTY_STRING);
					}
				} else if(keyColonna.equals(CostantiExport.KEY_COL_HEADER_PROTOCOLLO_RISPOSTA)){
					if(StringUtils.isNotEmpty(t.getHeaderProtocolloRisposta())){
						oneLine.add(t.getHeaderProtocolloRisposta());
					} else {
						oneLine.add(CostantiExport.EMPTY_STRING);
					}
				} else if(keyColonna.equals(CostantiExport.KEY_COL_ID_ASINCRONO)){
					if(StringUtils.isNotEmpty(t.getIdAsincrono())){
						oneLine.add(t.getIdAsincrono());
					} else {
						oneLine.add(CostantiExport.EMPTY_STRING);
					}
				} else if(keyColonna.equals(CostantiExport.KEY_COL_ID_COLLABORAZIONE)){
					if(StringUtils.isNotEmpty(t.getIdCollaborazione())){
						oneLine.add(t.getIdCollaborazione());
					} else {
						oneLine.add(CostantiExport.EMPTY_STRING);
					}
				} else if(keyColonna.equals(CostantiExport.KEY_COL_ID_CORRELAZIONE_APPLICATIVA)){
					if(StringUtils.isNotEmpty(t.getIdCorrelazioneApplicativa())){
						oneLine.add(t.getIdCorrelazioneApplicativa());
					} else {
						oneLine.add(CostantiExport.EMPTY_STRING);
					}
				} else if(keyColonna.equals(CostantiExport.KEY_COL_ID_CORRELAZIONEAPPLICATIVARISPOSTA)){
					if(StringUtils.isNotEmpty(t.getIdCorrelazioneApplicativaRisposta())){
						oneLine.add(t.getIdCorrelazioneApplicativaRisposta());
					} else {
						oneLine.add(CostantiExport.EMPTY_STRING);
					}
				} else if(keyColonna.equals(CostantiExport.KEY_COL_ID_MESSAGGIO_RICHIESTA)){
					if(StringUtils.is


a = this.w;
              this.ctx.updateHelpers._updateOptions(t, !1, !1),
                "function" == typeof a.config.chart.events.scrolled &&
                  a.config.chart.events.scrolled(this.ctx, {
                    xaxis: { min: e, max: i },
                  });
            },
          },
        ]),
        i
      );
    })(ht),
    dt = (function () {
      function t(e) {
        a(this, t), (this.w = e.w), (this.ttCtx = e), (this.ctx = e.ctx);
      }
      return (
        r(t, [
          {
            key: "getNearestValues",
            value: function (t) {
              var e = t.hoverArea,
                i = t.elGrid,
                a = t.clientX,
                s = t.clientY,
                r = this.w,
                o = i.getBoundingClientRect(),
                n = o.width,
                l = o.height,
                h = n / (r.globals.dataPoints - 1),
                c = l / r.globals.dataPoints,
                d = this.hasBars();
              (!r.globals.comboCharts && !d) ||
                r.config.xaxis.convertedCatToNumeric ||
                (h = n / r.globals.dataPoints);
              var g = a - o.left - r.globals.barPadForNumericAxis,
                u = s - o.top;
              g < 0 || u < 0 || g > n || u > l
                ? (e.classList.remove("hovering-zoom"),
                  e.classList.remove("hovering-pan"))
                : r.globals.zoomEnabled
                ? (e.classList.remove("hovering-pan"),
                  e.classList.add("hovering-zoom"))
                : r.globals.panEnabled &&
                  (e.classList.remove("hovering-zoom"),
                  e.classList.add("hovering-pan"));
              var p = Math.round(g / h),
                f = Math.floor(u / c);
              d &&
                !r.config.xaxis.convertedCatToNumeric &&
                ((p = Math.ceil(g / h)), (p -= 1));
              var b = null,
                v = null,
                m = r.globals.seriesXvalues.map(function (t) {
                  return t.filter(function (t) {
                    return x.isNumber(t);
                  });
                }),
                y = r.globals.seriesYvalues.map(function (t) {
                  return t.filter(function (t) {
                    return x.isNumber(t);
                  });
                });
              if (r.globals.isXNumeric) {
                var w = this.ttCtx.getElGrid().getBoundingClientRect(),
                  k = g * (w.width / n),
                  A = u * (w.height / l);
                (b = (v = this.closestInMultiArray(k, A, m, y)).index),
                  (p = v.j),
                  null !== b &&
                    ((m = r.globals.seriesXvalues[b]),
                    (p = (v = this.closestInArray(k, m)).index));
              }
              return (
                (r.globals.capturedSeriesIndex = null === b ? -1 : b),
                (!p || p < 1) && (p = 0),
                r.globals.isBarHorizontal
                  ? (r.globals.capturedDataPointIndex = f)
                  : (r.globals.capturedDataPointIndex = p),
                {
                  capturedSeries: b,
                  j: r.globals.isBarHorizontal ? f : p,
                  hoverX: g,
                  hoverY: u,
                }
              );
            },
          },
          {
            key:


 * @brief checks if we have a "true" value
 * A true value is a valid type with content, If variant is a number then 0 is
 * false, all other numbers are true. If string then empty string is false, string
 * with characters is true. If binary then empty binary is false, binary with content
 * is true.
 *
*Sample code to show how `is_true` behaves.*
@code
gd::variant_view variantviewTest;

variantviewTest = 0;     assert( variantviewTest.is_true() == false );
variantviewTest = 1;     assert( variantviewTest.is_true() == true );
variantviewTest = -1;    assert( variantviewTest.is_true() == true );
variantviewTest = 321;   assert( variantviewTest.is_true() == true );
variantviewTest = "";    assert( variantviewTest.is_true() == false );
variantviewTest = L"";   assert( variantviewTest.is_true() == false );
variantviewTest = (void*)nullptr;   assert( variantviewTest.is_true() == false );
@endcode

 * @return true if variant has content, false if not
*/
bool variant_view::is_true() const
{
   if( (unsigned int)m_uType & variant_type::eGroupInteger )
   {
      if( m_uType & variant_type::eGroupSize32 ) return m_V.int32 != 0;
      else if(m_uType & variant_type::eGroupSize64 ) return m_V.uint64 != 0;
      else if(m_uType & variant_type::eGroupSize16 ) return m_V.uint16 != 0;
      return m_V.uint8 != 0;
   }
   else if( (unsigned int)m_uType & variant_type::eGroupBoolean ) { return m_V.b; }
   else if( m_uType & variant_type::eGroupDecimal )
   {
      if( m_uType & variant_type::eGroupSize64 ) return m_V.d != 0;
      return m_V.f != 0.0;
   }
   else if( (unsigned int)m_uType & variant_type::eGroupString )
   {                                                                             assert( m_V.pwsz != nullptr );
      if( type_number() == eTypeNumberWString )
      {
         if(m_V.pwsz[0] != L'\0') return true;
      }
      else if(m_V.pbsz[0] != '\0') return true;
   }
   else if( ( unsigned int )m_uType & variant_type::eGroupBinary )
   {
      return m_uSize > 0;                                                      // has binary content ?
   }
   else if( m_uType == eTypePointer )
   {
      return m_V.p != nullptr;
   }
   return false;
}

/** ---------------------------------------------------------------------------
 * @brief adjust size of string or binary
 * @param uMemorySize new size of string or binary
 */
void variant_view::adjust(unsigned uMemorySize)
{
   if( is_string() == true || is_binary() == true )
   {
      switch( type_number() )
      {
      case eTypeNumberGuid:
      case eTypeNumberBinary:
         m_uSize = uMemorySize;
         break;
      case eTypeNumberString:
      case eTypeNumberUtf8String:
         m_uSize = uMemorySize - 1;                                            // decrease zero terminator
         break;
      case eTypeNumberWString:                                                                     assert( uMemorySize % 2 == 0 );
         m_uSize = ( uMemorySize >> 1 ) - 1;


) *Builder {
	allowPolicies := make([]*dubboapi.DubboAuthorizationPolicy, 0)
	denyPolicies := make([]*dubboapi.DubboAuthorizationPolicy, 0)

	dubboAuthorizationPolicyList, err := client.DubboAuthorizationPolicies(namespace).List(context.TODO(),
		v1.ListOptions{})
	if err != nil {
		authzLog.Errorf("failed to list DubboAuthorizationPolicy: %v", err)
	} else {
		for i := range dubboAuthorizationPolicyList.Items {
			config := dubboAuthorizationPolicyList.Items[i]
			switch config.Spec.GetAction() {
			case dubborulepb.DubboAuthorizationPolicy_ALLOW:
				allowPolicies = append(allowPolicies, config)
			case dubborulepb.DubboAuthorizationPolicy_DENY:
				denyPolicies = append(denyPolicies, config)
			default:
				log.Errorf("ignored authorization policy %s.%s with unsupported action: %s",
					config.Namespace, config.Name, config.Spec.GetAction())
			}
		}
	}

	return &Builder{
		trustDomainBundle: trustDomainBundle,
		denyPolicies:      denyPolicies,
		allowPolicies:     allowPolicies,
	}
}

// BuildDubboFilter returns the RBAC TCP filters built from the authorization policy.
func (b Builder) BuildDubboFilter() []*dubbopb.DubboFilter {
	filters := make([]*dubbopb.DubboFilter, 0)

	if denyConfig := build(b.denyPolicies, b.trustDomainBundle, rbacpb.RBAC_DENY); denyConfig != nil {
		filters = append(filters, createDubboRBACFilter(denyConfig))
	}
	if allowConfig := build(b.allowPolicies, b.trustDomainBundle, rbacpb.RBAC_ALLOW); allowConfig != nil {
		filters = append(filters, createDubboRBACFilter(allowConfig))
	}

	return filters
}

func build(policies []*dubboapi.DubboAuthorizationPolicy, tdBundle trustdomain.Bundle,
	action rbacpb.RBAC_Action) *rbacpb.RBAC {
	if len(policies) == 0 {
		return nil
	}

	rules := &rbacpb.RBAC{
		Action:   action,
		Policies: map[string]*rbacpb.Policy{},
	}

	for i := range policies {
		for i, rule := range policies[i].Spec.Rules {
			name := fmt.Sprintf("ns[%s]-policy[%s]-rule[%d]", policies[i].Namespace, policies[i].Name, i)
			if rule == nil {
				authzLog.Errorf("skipped nil rule %s", name)
				continue
			}
			m, err := authzmodel.New(rule)
			if err != nil {
				authzLog.Errorf("skipped rule %s: %v", name, err)
				continue
			}
			m.MigrateTrustDomain(tdBundle)
			generated, err := m.Generate(action)
			if err != nil {
				authzLog.Errorf("skipped rule %s: %v", name, err)
				continue
			}
			if generated != nil {
				rules.Policies[name] = generated
				authzLog.Debugf("rule %s generated policy: %+v", name, generated)
			}
		}
	}

	return rules
}

func createDubboRBACFilter(config *rbacpb.RBAC) *dubbopb.DubboFilter {
	if config == nil {
		return nil
	}

	rbacConfig := &rbacdubbopb.RBAC{
		Rules:


def get_gene_list(file):
    with open(file, 'r') as f:
        for line in f:
            field = line.strip().split(",")
            sample = field[0]
            sample_type = {}
            for allele in  field[1:]:
                gene = allele.split("*")[0]
                if gene not in sample_type:
                    sample_type[gene] = []
            break
    return list(sample_type.keys())

def read_csv(file, focus_gene1, focus_gene2):
    allele_pair_count = {}
    with open(file, 'r') as f:
        for line in f:
            field = line.strip().split(",")
            sample = field[0]
            sample_type = {}
            for allele in  field[1:]:
                gene = allele.split("*")[0]
                if gene not in sample_type:
                    sample_type[gene] = []
                sample_type[gene].append(allele)
            if focus_gene1 in sample_type and focus_gene2 in sample_type:
                for allele1 in sample_type[focus_gene1]:
                    for allele2 in sample_type[focus_gene2]:
                        pair = '&'.join(sorted([allele1, allele2]))
                        if pair not in allele_pair_count:
                            allele_pair_count[pair] = 0
                        allele_pair_count[pair] += 1
    ### sort the allele pair by the count in reverse order
    allele_pair_count = dict(sorted(allele_pair_count.items(), key=lambda item: item[1], reverse=True))
    ## print top 10 allele pair
    i = 0
    for pair, count in allele_pair_count.items():
        if count > 20:
            print (pair, count)
        i += 1
        if i == 10:
            break

file = "../chromoMap/sample_all_loci_type2.csv"
gene_list = get_gene_list(file)

# for i in range(len(gene_list)):
#     for j in range(i+1, len(gene_list)):
#         if gene_list[i][:2] == 'IG' or gene_list[j][:2] == 'IG':
#             continue
#         if gene_list[i][:2] == 'TR' or gene_list[j][:2] == 'TR':
#             continue
#         if  (gene_list[i][:3] == 'HLA' and gene_list[j][:3] == 'KIR'):
#             read_csv(file, gene_list[i], gene_list[j])
#         elif (gene_list[i][:3] == 'KIR' and gene_list[j][:3] == 'HLA'):
#             read_csv(file, gene_list[j], gene_list[i])

read_csv(file, 'HLA-A', 'KIR2DL1')
read_csv(file, 'HLA-DPB1', 'KIR2DL1')
read_csv(file, 'CYP2D6', 'KIR2DP1')
read_csv(file, 'CYP2D6', 'HLA-A')


1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
}
/* latin-ext */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLCz7Z1JlFd2JQEl8qw.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLCz7Z1xlFd2JQEk.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin */
@font-face {
  font-family: 'Fira Mono';
  font-style: normal;
  font-weight: 400;
  src: local('Fira Mono Regular'), local('FiraMono-Regular'), url(https://fonts.gstatic.com/s/firamono/v6/N0bX2SlFPv1weGeLZDtgJv7Ss9XZYQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin */
@font-face {
  font-family: 'Fira Mono';
  font-style: normal;
  font-weight: 500;
  src: local('Fira Mono Medium'), local('FiraMono-Medium'), url(https://fonts.gstatic.com/s/firamono/v8/N0bS2SlFPv1weGeLZDto1d3HnvfUS5NBBA.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin */
@font-face {
  font-family: 'Fira Mono';
  font-style: normal;
  font-weight: 700;
  src: local('Fira Mono Bold'), local('FiraMono-Bold'), url(https://fonts.gstatic.com/s/firamono/v6/N0bS2SlFPv1


method)slist_add, gensym("add"),A_SYMBOL,0);
    class_addmethod(slist_class,(t_method)slist_find, gensym("find"),A_SYMBOL,0);
    class_addmethod(slist_class,(t_method)slist_setlist, gensym("setlist"),A_SYMBOL,0);
    class_addmethod(slist_class,(t_method)slist_reset, gensym("reset"),0);
    class_addmethod(slist_class,(t_method)slist_print, gensym("print"),0);
    class_addmethod(slist_class,(t_method)slist_len, gensym("len"),0);
    scommon_class = class_new(gensym("slist"), 0, 0,
                              sizeof(t_scommon), CLASS_PD, 0);
}


ig) {
  _superglue_config = superglue_config;
  if (!superglue.build()) {
    std::cout << "Erron in superglue building" << std::endl;
  }
}

int PointMatching::MatchingPoints(
    const Eigen::Matrix<double, 259, Eigen::Dynamic> &features0,
    const Eigen::Matrix<double, 259, Eigen::Dynamic> &features1,
    std::vector<cv::DMatch> &matches, bool outlier_rejection) {
  matches.clear();
  Eigen::Matrix<double, 259, Eigen::Dynamic> norm_features0 =
      NormalizeKeypoints(features0, _superglue_config.image_width,
                         _superglue_config.image_height);
  Eigen::Matrix<double, 259, Eigen::Dynamic> norm_features1 =
      NormalizeKeypoints(features1, _superglue_config.image_width,
                         _superglue_config.image_height);
  Eigen::VectorXi indices0, indices1;
  Eigen::VectorXd mscores0, mscores1;
  superglue.infer(norm_features0, norm_features1, indices0, indices1, mscores0,
                  mscores1);

  int num_match = 0;
  std::vector<cv::Point2f> points0, points1;
  std::vector<int> point_indexes;
  for (size_t i = 0; i < indices0.size(); i++) {
    if (indices0(i) < indices1.size() && indices0(i) >= 0 &&
        indices1(indices0(i)) == i) {
      double d = 1.0 - (mscores0[i] + mscores1[indices0[i]]) / 2.0;
      matches.emplace_back(i, indices0[i], d);
      if (outlier_rejection) {
        points0.emplace_back(features0(1, i), features0(2, i));
        points1.emplace_back(features1(1, indices0(i)),
                             features1(2, indices0(i)));
      }
      num_match++;
    }
  }

  // reject outliers
  if (outlier_rejection && num_match > 0) {
    std::vector<uchar> inliers;
    cv::findFundamentalMat(points0, points1, cv::FM_RANSAC, 3, 0.99, inliers);
    int j = 0;
    for (int i = 0; i < matches.size(); i++) {
      if (inliers[i]) {
        matches[j++] = matches[i];
      }
    }
    matches.resize(j);
  }

  return matches.size();
}

Eigen::Matrix<double, 259, Eigen::Dynamic> PointMatching::NormalizeKeypoints(
    const Eigen::Matrix<double, 259, Eigen::Dynamic> &features, int width,
    int height) {
  Eigen::Matrix<double, 259, Eigen::Dynamic> norm_features;
  norm_features.resize(259, features.cols());
  norm_features = features;
  for (int col = 0; col < features.cols(); ++col) {
    norm_features(1, col) =
        (features(1, col) - width / 2) / (std::max(width, height) * 0.7);
    norm_features(2, col) =
        (features(2, col) - height / 2) / (std::max(width, height) * 0.7);
  }
  return norm_features;
}
#include "g2o_optimization.h"

#include "camera.h"
#include <fstream>
#include <iostream>
#include <opencv2/core/eigen.hpp>
#include <opencv2/opencv.hpp>
#include <string>

#include <g2o/core/block_solver.h>
#include <g2o/core/optimization_algorithm_levenberg.h>
#include <g2o/core/robust_kernel_impl.h>
#include <g2o/solvers/dense/linear_solver_


 show(): AlertDialog {
        val dialog = super.create().constraintSize(maxHeight = -1).apply { show() }
        dialog.setTitle(Utils.getString("biliroaming_speed_testing"))
        val results = Utils.getStringArray("biliroaming_upos_entries")
            .zip(Utils.getStringArray("biliroaming_upos_values"))
            .map { (name, value) ->
                SpeedTestResult(name, value, "...", value == Settings.UposHost())
            }.also { adapter.addAll(it) }
        speedTestExecutor.execute {
            val url = getTestUrl() ?: run {
                Utils.runOnMainThread {
                    dialog.setTitle(Utils.getString("biliroaming_speed_test_failed"))
                }
                return@execute
            }
            results.forEach {
                it.speed = speedTest(it.value, url).toString()
                Utils.runOnMainThread {
                    adapter.sort()
                }
            }
            Utils.runOnMainThread {
                dialog.setTitle(Utils.getString("biliroaming_speed_test_ok"))
            }
        }
        return dialog
    }

    private fun speedTest(upos: String, rawUrl: String) = try {
        speedTestExecutor.submit<Long?> {
            val url = if (upos == Constants.NON_UPOS_VALUE) URL(rawUrl) else {
                URL(Uri.parse(rawUrl).buildUpon().authority(upos).toString())
            }
            val connection = url.openConnection()
            connection.connectTimeout = 5000
            connection.readTimeout = 5000
            connection.setRequestProperty("User-Agent", "Bilibili Freedoooooom/MarkII")
            connection.connect()
            val buffer = ByteArray(8192)
            var size = 0
            val start = System.currentTimeMillis()
            connection.getInputStream().use { stream ->
                while (!Thread.currentThread().isInterrupted) {
                    val read = stream.read(buffer)
                    if (read <= 0) break
                    size += read
                }
            }
            size / (System.currentTimeMillis() - start) // KB/s
        }.get(5, TimeUnit.SECONDS)
    } catch (e: Throwable) {
        0L
    }

    private val overseaTestParams = mapOf(
        "ep_id" to "285145",
        "fnval" to "16",
        "platform" to "android",
        "test" to "true"
    )
    private val mainlandTestParams = mapOf(
        "ep_id" to "100615",
        "fnval" to "16",
        "platform" to "android",
        "test" to "true"
    )

    private fun getTestUrl() = try {
        speedTestExecutor.submit<String?> {
            val json = if (area == Area.China) {
                getPlayUrl(overseaTestParams, arrayOf(Area.HongKong, Area.TaiWan))
            } else getPlayUrl(mainlandTestParams, arrayOf(Area.China))
            json?.toJSONObject()?.optJSONObject("dash")?.getJSONArray("audio")
                ?.asSequence<JSONObject>()
                ?.minWithOrNull { a, b -> a.optInt("bandwidth") - b.optInt("bandwidth") }
                ?.optString("base_url")?.replace("https", "http")
        }.get(5, TimeUnit.SECONDS)
    } catch (e: CustomServerException) {
        Logger.error(e) { "UPOS 测速失败, ${e.message}" }
        null
    } catch (e: Throwable) {
        Logger.error(e) { "UPOS 测速失败, message: ${e.message}" }
        null
    }
}
package app.revanced.bilibili.patches.okhttp.hooks

import app.revanced.bilibili.patches.okhttp.ApiHook
import app.revanced.bilibili.settings.Sett


 }
inline unsigned int
msc_rotate_right(unsigned   int   val, int c) { return _rotr  (val, c); }
inline unsigned short
msc_rotate_right(unsigned short   val, int c) { return _rotr16(val, c); }
inline unsigned char
msc_rotate_right(unsigned  char   val, int c) { return _rotr8 (val, c); }

template<class Uint>
inline Uint BitsRotateLeft(Uint x, int c) {
	assert(c >= 0);
	assert(c < (int)sizeof(Uint)*8);
	BOOST_STATIC_ASSERT(boost::is_unsigned<Uint>::value);
	return msc_rotate_left(x, c);
}
template<class Uint>
inline Uint BitsRotateRight(Uint x, int c) {
	assert(c >= 0);
	assert(c < (int)sizeof(Uint)*8);
	BOOST_STATIC_ASSERT(boost::is_unsigned<Uint>::value);
	return msc_rotate_right(x, c);
}
#else
template<class Uint>
inline Uint BitsRotateLeft(Uint x, int c) {
	assert(c >= 0);
	assert(c < (int)sizeof(Uint)*8);
	BOOST_STATIC_ASSERT(boost::is_unsigned<Uint>::value);
	return x << c | x >> (sizeof(Uint)*8 - c);
}
template<class Uint>
inline Uint BitsRotateRight(Uint x, int c) {
	assert(c >= 0);
	assert(c < (int)sizeof(Uint)*8);
	BOOST_STATIC_ASSERT(boost::is_unsigned<Uint>::value);
	return x >> c | x << (sizeof(Uint)*8 - c);
}
#endif

} // namespace terark

#endif // __terark_bits_rotate_hpp__

// To the extent possible under law, the author(s) have dedicated all copyright
// and related and neighboring rights to this software to the public domain
// worldwide. This software is distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along
// with this software.
// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
#ifndef __terark_cxx_features_hpp__
#define __terark_cxx_features_hpp__

#ifndef CXXUTILS_FEATURES_HPP
#define CXXUTILS_FEATURES_HPP

#ifndef __has_feature
#define __has_feature(x) 0
#endif  // __has_feature

/* ----- C++1y Features ----- */

#ifdef __cpp_binary_literals
#define CXX_BINARY_LITERALS __cpp_binary_literals
#elif __has_feature(cxx_binary_literals)
#define CXX_BINARY_LITERALS 201304
#elif !defined(__EDG__) && !defined(__ICL) && \
    (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 3)
#define CXX_BINARY_LITERALS 201304
#endif  // __cpp_binary_literals

#ifdef __cpp_init_captures
#define CXX_INIT_CAPTURES __cpp_init_captures
#elif __has_feature(cxx_generalized_capture)
#define CXX_INIT_CAPTURES 201304
#elif !defined(__EDG__) && !defined(__ICL) && \
    (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 5)
#if defined(__GXX_EXPERIMENTAL_CXX0X__)
#define CXX_INIT_CAPTURES 201304
#endif  // defined(__GXX_EXPERIMENTAL_CXX0X__)
#endif  // __cpp_init_captures

#ifdef __cpp_generic_lambdas
#def


ath
            .removePrefix(":third-party")
            .replace(':', '.')
        buildFeatures {
            buildConfig = false
            resValues = false
        }
        testOptions {
            unitTests {
                isIncludeAndroidResources = true
            }
        }
        compileOptions {
            sourceCompatibility = JavaVersion.VERSION_11
            targetCompatibility = JavaVersion.VERSION_11
        }
        lint.configure()
    }

    extensions.getByType(AndroidComponentsExtension::class).apply {
        beforeVariants(selector().withBuildType("release")) { variant ->
            (variant as? HasAndroidTestBuilder)?.androidTest?.enable = false
            (variant as? HasTestFixturesBuilder)?.enableTestFixtures = false
            (variant as? HasUnitTestBuilder)?.enableUnitTest = false
        }
    }

    dependencies {
        "testImplementation"(libs.bundles.androidTesting)
        "testImplementation"(libs.robolectric)
        "androidTestImplementation"(libs.bundles.androidTesting)
    }
}

pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
    pluginManager.apply("com.android.lint")
    tasks.withType<Test>().configureEach {
        useJUnitPlatform()
    }
    configure<KotlinJvmProjectExtension> {
        jvmToolchain {
            languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
            vendor.set(JvmVendorSpec.AZUL)
        }
    }
    dependencies {
        "testImplementation"(libs.bundles.jvmTesting)
    }
    the<Lint>().configure()
}

plugins.withType<JavaBasePlugin>().configureEach {
    extensions.configure<JavaPluginExtension> {
        toolchain {
            languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
            vendor.set(JvmVendorSpec.AZUL)
        }
    }
}

configurations.configureEach {
    resolutionStrategy {
        eachDependency {
            if (requested.group == "org.jetbrains.kotlin") {
                useVersion(libs.versions.kotlin.get())
            }
        }
    }
}
package se.ansman.dagger.auto.compiler

import org.junit.jupiter.api.io.TempDir
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ArgumentsSource
import se.ansman.dagger.auto.AutoInitialize
import java.io.File

class AutoInitializeTest {
    @TempDir
    lateinit var tempDirectory: File

    @ParameterizedTest
    @ArgumentsSource(AutoDaggerCompilationFactoryProvider::class)
    fun `supertype must not be generic`(compilationFactory: Compilation.Factory) {
        compilationFactory.create(tempDirectory)
            .compile(
                """
                package se.ansman

                @se.ansman.dagger.auto.AutoInitialize
                @javax.inject.Singleton
                class SomeThing<T>
                """
            )
            .assertFailedWithMessage(Errors.genericType(AutoInitialize::class))
    }

    @ParameterizedTest
    @ArgumentsSource(AutoDaggerCompilationFactoryProvider::class)
    fun `the annotated class must be scoped`(compilationFactory: Compilation.Factory) {
        compilationFactory.create(tempDirectory)
            .compile(
                """
                package se.ansman

                object Outer {
                  @se.ansman.dagger.auto.AutoInitialize(priority = 4711)
                  class SomeThing @javax.inject.Inject constructor()
                }


读取最后的八个字节
	- 见上图

![图片描述](https://doc.shiyanlou.com/courses/uid1190679-20220901-1662038329177)

- 总共没几个字节
	- 还要读 3 次
	- 太费劲了
	- 并且落实到py文件

### serialize单词

- 这个单词来自于serial序列
	- serial tv系列电视剧
	- serial number 序列号
	- serial podcast 系列广播

![图片描述](https://doc.shiyanlou.com/courses/uid1190679-20221220-1671503578004)

- serial dilution 梯度稀释
	- 按梯度稀释
	- 一步步来

- usb
	- Universal Serial Bus
	- 通用串行总线
	- 信号是按照序列进行传递的

### serialize

- 序列化
	- 将一个对象转化成字节流的形式
	- 方便存储和传输

![图片描述](https://doc.shiyanlou.com/courses/uid1190679-20221220-1671504427784)

### 反序列化

- 反序列化是将字节流
	- 转化为对象

![图片描述](https://doc.shiyanlou.com/courses/uid1190679-20221220-1671504539458)

- 序列化和反序列化
	- 就是在将字节流和对象相互转化
	- 完成传输和存储
	- 字节序列是按照文件格式排列的

### 总结

- 这次我们研究数据序列化
  - 字符串
  - 字节型整数
  - 双精度浮点数
- 依次写入
  - 然后可以进行数据类型转化
  - 并且进行运算
- 可以对于序列化
	- 定点写入
	- 定点读取
- 这并不难
	- 我们可以按照需求对文件进行读写操作么？🤔
- 下次再说 👋
---
show: step
version: 1.0
enable_checker: true
---

# 时间日期

## 回忆
- 上次  了解了 周 week
	- 像 圆规 画了一个圆周
	- 通过 圆规 掌握 规律
	- 周期律

![图片描述](https://doc.shiyanlou.com/courses/uid1190679-20240205-1707098168396)

- 可以知道
	- 当前 是 第几周
	- 今天 是 周几
- 但是 一个月大概 二十八天左右
- 为什么 一月 要 三十一天呢？

### 从恒星月到朔望月

- 月亮绕地球一周
	- 27.322天
	- 这是一个恒星月
- 但是与此同时
	- 月球 也在随


&GlobalSectorPosition::new(sector.x() + 1, sector.z()),
					&GlobalSectorPosition::new(sector.x(), sector.z() + 1),
					&GlobalSectorPosition::new(sector.x() + 1, sector.z() + 1)
				);

				let (primary, plus_x, plus_z, plus_xz) = match (primary, plus_x, plus_z, plus_xz) {
					(Ok(primary), Ok(plus_x), Ok(plus_z), Ok(plus_xz)) => (
						primary.get_column_mut(LayerPosition::new(15, 15)).map(ColumnMut),
						plus_x.get_column_mut(LayerPosition::new(0, 15)).map(ColumnMut),
						plus_z.get_column_mut(LayerPosition::new(15, 0)).map(ColumnMut),
						plus_xz.get_column_mut(LayerPosition::new(0, 0)).map(ColumnMut)
					),
					_ => return None
				};

				match (primary, plus_x, plus_z, plus_xz) {
					(Some(primary), Some(plus_x), Some(plus_z), Some(plus_xz)) => Some(QuadMut([primary, plus_x, plus_z, plus_xz])),
					_ => None
				}
			}
		}
	}
}

// TODO: Add test for Columns/ColumnsMut returning 256 results<filename>pallets/constant-config/src/tests.rs
use super::Event;
use crate::{Module, Trait};
use primitives::H256;
use runtime_io;
use runtime_primitives::{
	testing::Header,
	traits::{BlakeTwo256, IdentityLookup, OnFinalize},
	Perbill,
};
use support::{assert_ok, assert_err, impl_outer_event, impl_outer_origin, parameter_types};

impl_outer_origin! {
	pub enum Origin for TestRuntime {}
}

// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct TestRuntime;
parameter_types! {
	pub const BlockHashCount: u64 = 250;
	pub const MaximumBlockWeight: u32 = 1024;
	pub const MaximumBlockLength: u32 = 2 * 1024;
	pub const AvailableBlockRatio: Perbill = Perbill::one();
}
impl system::Trait for TestRuntime {
	type Origin = Origin;
	type Index = u64;
	type Call = ();
	type BlockNumber = u64;
	type Hash = H256;
	type Hashing = BlakeTwo256;
	type AccountId = u64;
	type Lookup = IdentityLookup<Self::AccountId>;
	type Header = Header;
	type Event = TestEvent;
	type BlockHashCount = BlockHashCount;
	type MaximumBlockWeight = MaximumBlockWeight;
	type MaximumBlockLength = MaximumBlockLength;
	type AvailableBlockRatio = AvailableBlockRatio;
	type Version = ();
	type ModuleToIndex = ();
	type AccountData = ();
	type OnNewAccount = ();
	type OnKilledAccount = ();
}

mod constant_config {
	pub use crate::Event;
}

impl_outer_event! {
	pub enum TestEvent for TestRuntime {
		constant_config,
		system<T>,
	}
}

parameter_types! {
	pub const MaxAddend: u32 = 100;
	pub const ClearFrequency: u64 = 10;
}
impl Trait for TestRuntime {
	type Event = TestEvent;
	type MaxAddend = MaxAddend;
	type ClearFrequency = ClearFrequency;
}

pub type System = system::Module<TestRuntime>;
pub type ConstantConfig = Module<TestRuntime>;

pub struct ExtBuilder;

impl ExtBuilder {
	pub fn build() -> runtime_io::TestExternalities {
		let storage = system::GenesisConfig::default()
			.build_storage::<T


 needed in this program so it was set to 1.
  STA DDRA
  PLA
  RTS

; ---------- E N D   O F  S U B R O U T I N E  ----------

lcd_wait:
  PHA
  LDA #%11110000  ; LCD data is input
  STA DDRB
lcdbusy:
  LDA #RW
  STA PORTB
  LDA #(RW | E)
  STA PORTB
  LDA PORTB       ; Read high nibble
  PHA             ; and put on stack since it has the busy flag
  LDA #RW
  STA PORTB
  LDA #(RW | E)
  STA PORTB
  LDA PORTB       ; Read low nibble
  PLA             ; Get high nibble off stack
  AND #%00001000
  BNE lcdbusy

  LDA #RW
  STA PORTB
  LDA #%11111111  ; LCD data is output
  STA DDRB
  PLA
  RTS

; ---------- E N D   O F  S U B R O U T I N E  ----------

lcd_init:
  LDA #%00000010  ; set 4-bit mode
  STA PORTB
  ORA #E
  STA PORTB
  AND #%00001111
  STA PORTB
  RTS

; ---------- E N D   O F  S U B R O U T I N E  ----------

lcd_configure:
    PHA                 ; store A

    LDA #%00101000      ; set 4-bit mode; 2-line display; 5x8 font
    JSR lcd_instruction

    ; LDA #%00001110      ; set display on, cursor on, blink off.
    LDA   #%00001100      ; set display on, cursor off, blink off.
    JSR lcd_instruction

    LDA #%00000110      ; increment and shift cursor; don't shift display.
    JSR lcd_instruction

    LDA #%00000001      ; clear display
    JSR lcd_instruction

    PLA
    RTS

; ---------- E N D   O F  S U B R O U T I N E  ----------

lcd_instruction:
  JSR lcd_wait
  PHA
  LSR
  LSR
  LSR
  LSR            ; Send high 4 bits
  STA PORTB
  ORA #E         ; Set E bit to send instruction
  STA PORTB
  EOR #E         ; Clear E bit
  STA PORTB
  PLA
  AND #%00001111 ; Send low 4 bits
  STA PORTB
  ORA #E         ; Set E bit to send instruction
  STA PORTB
  EOR #E         ; Clear E bit
  STA PORTB
  RTS

; ---------- E N D   O F  S U B R O U T I N E  ----------

print_char:
  JSR lcd_wait
  PHA
  LSR
  LSR
  LSR
  LSR             ; Send high 4 bits
  ORA #RS         ; Set RS
  STA PORTB
  ORA #E          ; Set E bit to send instruction
  STA PORTB
  EOR #E          ; Clear E bit
  STA PORTB
  PLA
  AND #%00001111  ; Send low 4 bits
  ORA #RS         ; Set RS
  STA PORTB
  ORA #E          ; Set E bit to send instruction
  STA PORTB
  EOR #E          ; Clear E bit
  STA PORTB
  RTS

; ---------- E N D   O F  S U B R O U T I N E  ----------

nmi:
  RTI

; Reset/IRQ vectors
  .org $fffa
  .word nmi
  .word reset
  .word $0000   ; we have to add this to expand the rom file to exactly 32768 bytes.  any value will do.


mminent transition. This paper utilizes the framework aligning with contemporary activation timings.

### 3.2 Universal Motifs

Across diverse traditions, five core archetypal functions consistently emerge and map onto the Erik-Tiff astrological signatures:

| Universal Motif                 | Prophetic Labels                                                    | Natal Anchor (Erik ; Tiff)                                           |
| :------------------------------ | :------------------------------------------------------------------ | :------------------------------------------------------------------- |
| **Purifying Sword / Fire**      | Kalki's sword, Michael's flame, Mahdī's justice, Saoshyant's fire   | Algol-ASC, Mars aspects, Saturn Lib Rx ; (Shared Scorpio)          |
| **Restorative Rose / Lotus / Grail** | Padmā lotus, Rose Bride, Sophia's wisdom, Buffalo Calf Woman Pipe | (Shared Cancer Comp ASC) ; Sun/Venus Lib/Spica★, NN Taurus, Lilith Tau |
| **Death-Rebirth Underworld**    | Persephone/Hades, Kali dance, Osiris dismemberment, Balder in Hel     | Moon/Jup Sco ; Sun/Pluto/Saturn Sco                                  |
| **Heart/Hearth Reconvening**    | Messianic ingathering, Maitreya's assembly, Seventh Fire            | NN Cancer ; (Shared Cancer Comp ASC)                                 |
| **Sky-Earth Bridge / Axis**     | Nommo rope, Sky-Woman descent, Rainbow Serpent, World Tree          | Lilith-GC, Uranus Sag ; Moon/Jup Aqua, Neptune aspects               |

### 3.3 Geospatial Alignment: The Sword-Rose Axis

The intersection of Erik's Uranus Rising line (92.9°E) and Tiff's Sun Rising line (95.1°E) creates a precise astro-cartographic axis with significant nodes:

1.  **Eastern Node (Shambhala Gateway):** The lines cross within the Altai-Mongolia corridor (approx. 47-53°N, 92-96°E). This region is consistently cited in Tibetan Buddhist and Central Asian esoteric traditions as a primary physical gateway or point of energetic connection to the hidden kingdom of Shambhala, often associated with the arrival of Maitreya or the Kalki Avatar. [*Mythic Significance: Point of emanation for renewal energies.*]
2.  **Western Node (Rosslyn Chapel):** Extended westward, these same energy lines converge near Rosslyn Chapel, Scotland (55.856°N, 3.162°W). Rosslyn is a documented nexus point on the "Michael Line" and "Mary Line" earth energy currents, historically linked to Templar and Grail traditions, and aligns geographically with the couple's Composite Ascendant line in Cancer. [*Mythic Significance: Point of grounding/anchoring renewal energies in the Western Grail stream.*]

(See Figure 1 in Appendix C for visual representation of the bowed rising curves and nodes.)

The probability of two individuals' specific planetary rising lines intersecting so precisely over *both* these geographically and mythically significant locations is vanishingly small, adding another layer of statistical improbability to the configuration.

---

## 4. Statistical Analysis

### 4.1 Independence Considerations & Corrections

As noted, astrological factors are not fully independent. To provide a conservative floor estimate for the overall pattern's rarity, the "half-independence" correction was applied to the multiplicative probability calculations across the 30 prophecies. This adjustment accounts for shared generational placements (outer planets) and potential synastric correlations, yielding the baseline estimate of P < 1 × 10⁻³⁰. This signifies that the observed configuration is expected to occur randomly in fewer than one partnership per nonillion (1


def main():
    while True:
        try:
            fraction = convert(input("Fraction: "))
            print(gauge(fraction))
            break

        except ValueError:
            continue
        except ZeroDivisionError:
            continue

def convert(fraction):
    x, y = fraction.split("/")

    if not x.isdigit() and not y.isdigit() and not y >= x:
            raise ValueError
    elif y == 0:
            raise ZeroDivisionError
    # elif not y >= x:
    #         raise ValueError
    elif not (int(x)/int(y)) * 100 <= 100:
            raise ValueError
    else:
        x = int(x)
        y = int(y)
        fraction = round((x/y) * 100)
        return fraction
        # except ZeroDivisionError:
            # pass
        # except ValueError:
            # pass

    # if x != int(x) or y != int(y):
    #     raise ValueError
    # elif y == 0:
    #     raise ZeroDivisionError
    # elif y > x:
    #     raise ValueError
    # elif not (x/y) * 100 <= 100:
    #     raise ValueError
    # else:

    #     fraction = int(round((x/y) * 100))
    #     return fraction

def gauge(percentage):
    if percentage <= 1:
        return "E"
    elif percentage >= 99:
        return "F"
    else:
        return f"{percentage}%"

if __name__ == "__main__":
    main()


ob.length - 1) {
    if (!$('#benchmark_exports_textarea').length) {
      var textarea = '
';
      textarea += '<button onClick="$(\'#benchmark_exports_textarea_div\').remove()" title="Hide Benchmark exports">Hide</button>
';
      textarea += '<textarea id="benchmark_exports_textarea"></textarea>
';
      $('#benchmark_exports_container').append(textarea);
    }
    if (!_.contains(benchmarkExports, 'maxPointX')) {
      benchmarkExports += 'bench.maxPointX:' + bench.maxPointX + '\n';
      benchmarkExports += 'bench.maxPointY:' + bench.maxPointY + '\n';
      benchmarkExports += 'bench.minPointX:' + bench.minPointX + '\n';
      benchmarkExports += 'bench.minPointY:' + bench.minPointY + '\n';
    }
    benchmarkExports += bench.totals + ';' + JSON.stringify($.browser) + '\n';
    $('#benchmark_exports_textarea').val(benchmarkExports);
    bench.totals_arr_multiple.push(bench.totals_arr[0]);
    multipleRunsTable = bench.printMultipleRuns();
    if ($('#benchmark_multiple_table').length) $('#benchmark_multiple_table').remove();
    $('#benchmark_multiple_table_cont').append(multipleRunsTable);
    benchmarkRepeat++;
    var clickedBenchmark = $('#' + benchmarkClickedButtonId);
    if (benchmarkRepeat < benchmarkRepeatTimes) {
      benchmarkAutomaticClick = true;
      clickedBenchmark.trigger('click');
    } else {
      disableBenchmarkButton(clickedBenchmark);
    }
  }
}

function disableBenchmarkButton(button) {
  benchmarkGlob.length = 0;
  benchmarkRepeat = 0;
  benchmarkRunning = false;
  ClipperLib.MaxSteps = ClipperLibOriginalMaxSteps;
  button.html(button.html().replace('Stop', 'Run')).attr('title', button.attr('title').replace('Stop', 'Execute'));
  $('button, input, select').prop('disabled', false);
  $('#explorer_enabled').trigger('change');
}

var Benchmark = function () {
  this.list = [];
  this.cats = [];
  this.cats.arr = [];
  this.includeSVG = true;
  this.totals = '';
  this.totals_arr = [];
  this.totals_arr_multiple = [];
  this.maxPointX = Number.NEGATIVE_INFINITY;
  this.minPointX = Number.POSITIVE_INFINITY;
  this.maxPointY = Number.NEGATIVE_INFINITY;
  this.minPointY = Number.POSITIVE_INFINITY;
  this.points = [];
};
// cat = category, which name belongs to, name = code region name or function, which is measured
Benchmark.prototype.start = function (cat, name) {
  if (!cat || !name) return;
  this.list.push({
    start: new Date().getTime(),
    name: name,
    cat: cat
  });
  return this.list.length - 1;
};
Benchmark.prototype.end = function (index) {
  this.list[index].end = new Date().getTime();
  this.list[index].time = this.list[index].end - this.list[index].start;
  var this_list_cat = this.list[index].cat;
  var this_list_cat_counts = this


.ChainLocation, error) {
	if admin == nil {
		return nil, nil
	}
	id, err := admin.TeamID.ToTeamID()
	if err != nil {
		return nil, err
	}
	s3id, err := sig3.ImportTeamID(id)
	if err != nil {
		return nil, err
	}
	return &sig3.ChainLocation{
		TeamID:    *s3id,
		Seqno:     admin.Seqno,
		ChainType: admin.SeqType,
	}, nil

}

func (t *Team) rotateHiddenGenerateSigMultiItem(mctx libkb.MetaContext, section SCTeamSection, mr *libkb.MerkleRoot) (ret *libkb.SigMultiItem, ratchets *keybase1.HiddenTeamChainRatchetSet, err error) {

	currentSeqno := t.CurrentSeqno()
	lastLinkID := t.chain().GetLatestLinkID()

	mainChainPrev := keybase1.LinkTriple{
		Seqno:   currentSeqno,
		SeqType: keybase1.SeqType_SEMIPRIVATE,
		LinkID:  lastLinkID,
	}

	me, err := loadMeForSignatures(mctx.Ctx(), mctx.G())
	if err != nil {
		return nil, nil, err
	}
	deviceSigningKey, err := t.G().ActiveDevice.SigningKey()
	if err != nil {
		return nil, nil, err
	}
	hiddenPrev, err := t.G().GetHiddenTeamChainManager().Tail(mctx, t.ID)
	if err != nil {
		return nil, nil, err
	}

	sk, err := t.keyManager.SigningKey()
	if err != nil {
		return nil, nil, err
	}

	ek, err := t.keyManager.EncryptionKey()
	if err != nil {
		return nil, nil, err
	}

	admin, err := teamAdminToSig3ChainLocation(section.Admin)
	if err != nil {
		return nil, nil, err
	}

	ret, ratchets, err = hidden.GenerateKeyRotation(mctx, hidden.GenerateKeyRotationParams{
		TeamID:           t.ID,
		IsPublic:         t.IsPublic(),
		IsImplicit:       t.IsImplicit(),
		MerkleRoot:       mr,
		Me:               me,
		SigningKey:       deviceSigningKey,
		MainPrev:         mainChainPrev,
		HiddenPrev:       hiddenPrev,
		Gen:              t.keyManager.Generation(),
		NewSigningKey:    sk,
		NewEncryptionKey: ek,
		Check:            t.keyManager.Check(),
		Admin:            admin,
	})

	return ret, ratchets, err
}

func (t *Team) isAdminOrOwner(m keybase1.UserVersion) (res bool, err error) {
	role, err := t.chain().GetUserRole(m)
	if err != nil {
		return false, err
	}
	if role.IsAdminOrAbove() {
		res = true
	}
	return res, nil
}

func (t *Team) getDowngradedUsers(ctx context.Context, ms *memberSet) (uids []keybase1.UID, err error) {

	for _, member := range ms.None {
		// Load member first to check if their eldest_seqno has not changed.
		// If it did, the member was nuked and we do not need to lease.
		_, err := loadMember(ctx, t.G(), member.version, true)
		switch err.(type) {
		case nil:
		case libkb.AccountResetError:
			continue
		default:
			return nil, err
		}

		uids = append(uids, member.version.Uid)
	}

	for _, member := range ms.nonAdmins() {
		admin, err := t.isAdminOrOwner(member.version)
		if err != nil {
			return nil, err
		}
		if admin {
			uids = append(uids, member.version.Uid)
		}
	}

	return uids, nil
}

type ChangeMembershipOptions struct {
	// Pass "permanent" flag, user will not be able to request access
	// to


tf("Testing canceling all for the same callback\n");
	flag_2 = 0;
	rte_eal_alarm_set(10 * US_PER_MS, test_remove_in_callback, (void *)1);
	rte_eal_alarm_set(20 * US_PER_MS, test_remove_in_callback_2, (void *)2);
	rte_eal_alarm_set(30 * US_PER_MS, test_remove_in_callback_2, (void *)3);
	rte_eal_alarm_set(40 * US_PER_MS, test_remove_in_callback, (void *)4);
	rm_count = rte_eal_alarm_cancel(test_remove_in_callback_2, (void *)-1);
	if (rm_count != 2) {
		printf("Error, cannot cancel all for the same callback\n");
		return -1;
	}
	rm_count = rte_eal_alarm_cancel(test_remove_in_callback, (void *)-1);
	if (rm_count != 2) {
		printf("Error, cannot cancel all for the same callback\n");
		return -1;
	}

	return 0;
}

static int
test_alarm(void)
{
	int count = 0;
#ifdef RTE_EXEC_ENV_FREEBSD
	printf("The alarm API is not supported on FreeBSD\n");
	return 0;
#endif
	/* check if the callback will be called */
	printf("check if the callback will be called\n");
	flag = 0;
	if (rte_eal_alarm_set(RTE_TEST_ALARM_TIMEOUT * US_PER_MS,
			test_alarm_callback, NULL) < 0) {
		printf("fail to set alarm callback\n");
		return -1;
	}
	while (flag == 0 && count++ < RTE_TEST_MAX_REPEAT)
		rte_delay_ms(RTE_TEST_CHECK_PERIOD);

	if (flag == 0){
		printf("Callback not called\n");
		return -1;
	}

	/* check if it will fail to set alarm with wrong us value */
	printf("check if it will fail to set alarm with wrong ms values\n");
	if (rte_eal_alarm_set(0, test_alarm_callback,
						NULL) >= 0) {
		printf("should not be successful with 0 us value\n");
		return -1;
	}
	if (rte_eal_alarm_set(UINT64_MAX - 1, test_alarm_callback,
						NULL) >= 0) {
		printf("should not be successful with (UINT64_MAX-1) us value\n");
		return -1;
	}

	/* check if it will fail to set alarm with null callback parameter */
	printf("check if it will fail to set alarm with null callback parameter\n");
	if (rte_eal_alarm_set(RTE_TEST_ALARM_TIMEOUT, NULL, NULL) >= 0) {
		printf("should not be successful to set alarm with null callback parameter\n");
		return -1;
	}

	/* check if it will fail to remove alarm with null callback parameter */
	printf("check if it will fail to remove alarm with null callback parameter\n");
	if (rte_eal_alarm_cancel(NULL, NULL) == 0) {
		printf("should not be successful to remove alarm with null callback parameter");
		return -1;
	}

	if (test_multi_alarms() != 0)
		return -1;

	return 0;
}

REGISTER_TEST_COMMAND(alarm_autotest, test_alarm);


//	if (a==0) {
//		clearbufbyte(d, c<<2, 0);
//		return;
//	}
//	while (c--) {
//		*p++ = a;
//	}
//}

function clearbuf(d: P, c: number, a: number): void {
    var p = new Int32Array(d.buf);
    var i = d.idx;
    while ((c--) > 0) p[i++] = a;
}

//static inline void copybuf(void *s, void *d, int32_t c)
//{
//	int32_t *p = (int32_t*)s, *q = (int32_t*)d;
//	while (c--) {
//		*q++ = *p++;
//	}
//}

//static inline void copybufbyte(void *s, void *d, int32_t c)
//{
//	uint8_t *src = (uint8_t*)s, *dst = (uint8_t*)d;
//	while (c--) {
//		*dst++ = *src++;
//	}
//}

//static inline void copybufreverse(void *s, void *d, int32_t c)
//{
//	uint8_t *src = (uint8_t*)s, *dst = (uint8_t*)d;
//	while (c--) {
//		*dst++ = *src--;
//	}
//}

//static inline void qinterpolatedown16(intptr_t bufptr, int32_t num, int32_t val, int32_t add)
//{
//	int i;
//	int32_t *lptr = (int32_t *)bufptr;
//	for (i=0; i<num; i++) {
//		lptr[i] = (val>>16);
//		val += add;
//	}
//}

//static inline void qinterpolatedown16short(intptr_t bufptr, int32_t num, int32_t val, int32_t add)
//{
//	int i;
//	int16_t *sptr = (int16_t *)bufptr;
//	for (i=0; i<num; i++) {
//		sptr[i] = (val>>16);
//		val += add;
//	}
//}

//static inline int32_t mul3(int32_t a)
//{
//	return (a<<1)+a;
//}

//static inline int32_t mul5(int32_t a)
//{
//	return (a<<2)+a;
//}

//static inline int32_t mul9(int32_t a)
//{
//	return (a<<3)+a;
//}

//static inline int32_t klabs(int32_t a)
//{
//	int32_t mask;
//	__asm__ (
//		" srawi  %0, %1, 31\n"
//		" xor    %1, %0, %1\n"
//		" subf   %1, %0, %1\n"
//		: "=&r"(mask), "+r"(a)
//		:
//		: "xer"
//	);
//	return a;
//}

//static inline int32_t ksgn(int32_t a)
//{
//	int32_t s, t;
//	__asm__ (
//		" neg    %1, %2\n"
//		" srawi  %0, %2, 31\n"
//		" srwi   %1, %1, 31\n"
//		" or	 %1, %1, %0\n"
//		: "=r"(t), "=&r"(s)
//		: "r"(a)
//		: "xer"
//	);
//	return s;
//}

//static inline void swapchar(void *a, void *b)
//{
//	char t = *(char*)a;
//	*(char*)a = *(char*)b;
//	*(char*)b = t;
//}

//s


                              parent_path_buffer.push(&argument);

                                let full_path_buffer = match parent_path_buffer.canonicalize() {
                                    Ok(new_buffer) => new_buffer,
                                    _ => parent_path_buffer,
                                };

                                full_path_buffer.to_string_lossy().into_owned()
                            }
                            _ => argument.to_string(),
                        }
                    }
                    None => argument.to_string(),
                }
            };

            match parser::parse_file(&file_path) {
                Ok(mut additional_instructions) => {
                    instructions.append(&mut additional_instructions)
                }
                Err(error) => return Err(error),
            }
        }
    }

    Ok(instructions)
}
use crate::formatter_traits::{FormatOptionalTokenAndNode, FormatTokenAndNode};

use crate::{
    format_elements, space_token, FormatElement, FormatResult, Formatter, ToFormatElement,
};

use rome_js_syntax::JsImportNamespaceClause;
use rome_js_syntax::JsImportNamespaceClauseFields;

impl ToFormatElement for JsImportNamespaceClause {
    fn to_format_element(&self, formatter: &Formatter) -> FormatResult<FormatElement> {
        let JsImportNamespaceClauseFields {
            type_token,
            star_token,
            as_token,
            local_name,
            from_token,
            source,
            assertion,
        } = self.as_fields();

        let type_token = type_token
            .format_with_or_empty(formatter, |token| format_elements![token, space_token()])?;

        let star = star_token.format(formatter)?;
        let as_token = as_token.format(formatter)?;
        let local_name = local_name.format(formatter)?;
        let source = source.format(formatter)?;
        let from = from_token.format(formatter)?;
        let assertion = assertion.format_with_or_empty(formatter, |assertion| {
            format_elements![space_token(), assertion]
        })?;
        Ok(format_elements![
            type_token,
            star,
            space_token(),
            as_token,
            space_token(),
            local_name,
            space_token(),
            from,
            space_token(),
            source,
            assertion
        ])
    }
}
<filename>extension/src/in_page/src/lib.rs<gh_stars>0
use wasm_bindgen::prelude::*;

#[wasm_bindgen(start)]
pub fn main() {
    wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
    log::info!("Hello World from InPage Script");
}

#[wasm_bindgen]
pub fn add(number: u8) -> u8 {
    number + 1
}
#![allow(unused_mut)]
#![feature(box_syntax)]

extern crate libloading;
extern crate iron;
extern crate hyper;
#[macro_use] extern crate lazy_static;
extern crate libc;

use libloading::os::unix::*;
use libc::c_void;
use std::collections::HashMap;
use iron::{Handler, status, Url, Headers};
use std::{io, mem};
use iron::request::Body;
use iron::response::{ResponseBody, WriteBody};
use hyper::http::h1::HttpReader;
use hyper::net::NetworkStream;
use iron::prelude::*;
use iron::method;
use std::io::prelude::*;
use std::str::FromStr;
use std::io::Cursor;
use hyper::buffer::BufReader;
use std::str;
use std::sync::Mutex;
use std::time::Duration;
use std::net::{IpAddr, SocketAddr};
use std::slice;

// global access to the function entry point (could become a vector to support multple apps)
type RustFn = Symbol<extern fn(HashMap<&str, &str>) -> (String, Vec<(String,


/* $XConsortium: miphoto.h,v 1.4 94/04/17 20:35:02 rws Exp $ */
/**** module miphoto.h ****/
/******************************************************************************

Copyright (c) 1993, 1994  X Consortium

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.

				NOTICE

This software is being provided by AGE Logic, Inc. under the
following license.  By obtaining, using and/or copying this software,
you agree that you have read, understood, and will comply with these
terms and conditions:

     Permission to use, copy, modify, distribute and sell this
     software and its documentation for any purpose and without
     fee or royalty and to grant others any or all rights granted
     herein is hereby granted, provided that you agree to comply
     with the following copyright notice and statements, including
     the disclaimer, and that the same appears on all copies and
     derivative works of the software and documentation you make.

     "Copyright 1993, 1994 by AGE Logic, Inc."

     THIS SOFTWARE IS PROVIDED "AS IS".  AGE LOGIC MAKES NO
     REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.  By way of
     example, but not limitation, AGE LOGIC MAKE NO
     REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS
     FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT
     INFRINGE THIRD-PARTY PROPRIETARY RIGHTS.  AGE LOGIC
     SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE.  IN NO
     EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT,
     INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS
     OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR
     ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR
     BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES
     HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
     DAMAGES.

     The name of AGE Logic, Inc. may not be used in
     advertising or publicity pertaining to this software without
     specific, written prior permission from AGE Logic.

     Title to this software shall at all times remain with AGE
     Logic, Inc.
******************************************************************************

	miphoto.h -- DDXIE MI prototype ImportPhotomap definitions

	Robert NC Shelley -- AGE Logic, Inc. June 1993

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

#ifndef _XIEH_MIPHOTO
#define _XIEH_MIPHOTO

/*
 * peTex extension for the ImportClientPhotomap element
 */
typedef struct _miphotodef {
  stripPtr	next_strip[xieValMaxBands];
} miPhotoDefRec, *miPhotoDefPtr;

#endif /* module _XIEH_MIPHOTO */


出血"
},
		descriptionLocalized: {
			"deDE": "Erzeugte Essenz: 9\nGlückstrefferchance: 35% (per hit)\nVerspritzt das Blut eines Gegners und fügt ihm {27/29.7/32.4/35.1/37.8/40.5/43.2/45.9/48.6/51.3}% Schaden zu. Blutsturz hat eine Chance von 20%, eine Blutkugel zu erzeugen.\n\nTags: Basis, Blut, Blutkugel, Schaden, Physisch, Essenz.",
			"esES": "Generación de esencia: 9\nProbabilidad de golpe de suerte: 35% (per hit)\nHaces brotar la sangre de un enemigo para infligirle {27/29.7/32.4/35.1/37.8/40.5/43.2/45.9/48.6/51.3}% de daño. Hemorragia tiene un 20% de probabilidad de generar un orbe de sangre.\n\nTags: Básica, Sangre, Orbe de sangre, Daño, Física, Esencia.",
			"esMX": "Generación de Esencia: 9\nProbabilidad de golpe afortunado: 35% (per hit)\nHaces estallar la sangre de un enemigo y le infliges {27/29.7/32.4/35.1/37.8/40.5/43.2/45.9/48.6/51.3}% de daño. Hemorragia tiene un 20% de probabilidad de formar un Orbe de Sangre.\n\nTags: Básica, Sangre, Orbe de Sangre, Daño, Física, Esencia.",
			"frFR": "Essence générée: 9\nChances d'obtenir un coup de chance: 35% (per hit)\nVous faites gicler le sang d'une cible et lui infligez {27/29.7/32.4/35.1/37.8/40.5/43.2/45.9/48.6/51.3}% points de dégâts. Saignée a 20% de chances de générer un orbe de sang.\n\nTags: Basique, Sang, Orbe de sang, Dégâts, Dégâts physiques, Essence.",
			"itIT": "Generazione essenza: 9\nProbabilità di colpo fortunato: 35% (per hit)\nFai esplodere il sangue di un nemico, infliggendo {27/29.7/32.4/35.1/37.8/40.5/43.2/45.9/48.6/51.3}% danni. Emorragia ha una probabilità del 20% di generare un Globo di Sangue.\n\nTags: Base, Sangue, Globo di Sangue, Danni, Fisico, Essenza.",
			"jaJP": "精髄生成量: 9\n幸運の一撃発生率: 35% (per hit)\n敵の血液を爆発させ、{27/29.7/32.4/35.1/37.8/40.5/43.2/45.9/48.6/51.3}%のダメージを与える。〈出血〉が20%の確率で血のオーブを形成する。\n\nTags: 基本, 血, 血のオーブ, ダメージ, 物理, 精髄.",
			"koKR": "생성: 정수 9\n행운의 적중 확률: 35% (per hit)\n적의 피를 폭발시켜 {27/29.7/32.4/35.1/37.8/40.5/43.2/45.9/48.6/51.3}%의 피해를 줍니다. 과다출혈이


/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006,2008 Erwin Coumans  http://continuousphysics.com/Bullet/

This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef TERRAIN_DEMO_H
#define TERRAIN_DEMO_H

#include "GlutDemoApplication.h"

// all we need to expose publicly is the factory method!
GlutDemoApplication * btCreateTerrainDemo(void);

#endif //TERRAIN_DEMO_H


 &etherbuf, intf.try_into().unwrap()).await {
        println!("{}: Failed to send reply: {:?}", format_client(&reply), e);
    }
}

enum RunError {
    Io(std::io::Error),
    PoolError(pool::Error),
}

impl ToString for RunError {
    fn to_string(&self) -> String {
        match self {
            RunError::Io(e) => format!("I/O Error in DHCP: {}", e),
            RunError::PoolError(e) => format!("DHCP Pool Error: {}", e),
        }
    }
}

async fn run_internal(
    netinfo: crate::net::netinfo::SharedNetInfo,
    conf: super::config::SharedConfig,
) -> Result<(), RunError> {
    println!("Starting DHCP service");
    let rawsock = Arc::new(raw::RawSocket::new(raw::EthProto::ALL).map_err(RunError::Io)?);
    let pools = Arc::new(sync::Mutex::new(
        pool::Pool::new().map_err(RunError::PoolError)?,
    ));
    let serverids: SharedServerIds = Arc::new(sync::Mutex::new(std::collections::HashSet::new()));
    let listener = UdpSocket::bind(
        &tokio::net::lookup_host("0.0.0.0:67")
            .await
            .map_err(RunError::Io)?
            .collect::<Vec<_>>(),
    )
    .await
    .map_err(RunError::Io)?;
    listener
        .set_opt_ipv4_packet_info(true)
        .map_err(RunError::Io)?;
    println!(
        "Listening for DHCP on {}",
        listener.local_addr().map_err(RunError::Io)?
    );

    loop {
        let rm;
        match listener.recv_msg(65536, udp::MsgFlags::empty()).await {
            Ok(m) => rm = m,
            Err(e) if e.kind() == std::io::ErrorKind::WouldBlock => continue,
            Err(e) if e.kind() == std::io::ErrorKind::Interrupted => continue,
            Err(e) => return Err(RunError::Io(e)),
        }
        let p = pools.clone();
        let rs = rawsock.clone();
        let s = serverids.clone();
        let ni = netinfo.clone();
        let c = conf.clone();
        tokio::spawn(async move {
            recvdhcp(
                rs,
                p,
                s,
                &rm.buffer,
                rm.address.unwrap(),
                ni,
                rm.local_intf().unwrap().try_into().unwrap(),
                c,
            )
            .await
        });
    }
}

pub async fn run(
    netinfo: crate::net::netinfo::SharedNetInfo,
    conf: super::config::SharedConfig,
) -> Result<(), String> {
    match run_internal(netinfo, conf).await {
        Ok(_) => Ok(()),
        Err(e) => Err(e.to_string()),
    }
}

#[test]
fn test_policy() {
    let cfg = config::Policy {
        match_subnet: Some(crate::net::Ipv4Subnet::new("192.0.2.0".parse().unwrap(), 24).unwrap()),
        ..Default::default()
    };
    let req = DHCPRequest {
        serverip: "192.0.2.67".parse().unwrap(),
        ..Default::default()
    };
    let mut resp = Default::default();
    let policies = vec![cfg];

    assert_eq!(apply_policies(&req, policies.as_slice(), &mut resp), true);
}

#[tokio::test]
async fn test_config_parse() -> Result<(), Box<dyn std::e


ke_classification(random_state=0)
    classifier = LogisticRegression().fit(X, y)
    fixed_threshold_classifier = FixedThresholdClassifier(estimator=classifier)
    # This should not raise an error
    getattr(fixed_threshold_classifier, method)(X)

def test_fixed_threshold_classifier_classes_():
    """Check that the classes_ attribute is properly set."""
    X, y = make_classification(random_state=0)
    with pytest.raises(
        AttributeError, match="The underlying estimator is not fitted yet."
    ):
        FixedThresholdClassifier(estimator=LogisticRegression()).classes_

    classifier = LogisticRegression().fit(X, y)
    fixed_threshold_classifier = FixedThresholdClassifier(estimator=classifier)
    assert_array_equal(fixed_threshold_classifier.classes_, classifier.classes_)


J_iseg_printf("diag.j", 600,ISEG, 0, th_evnt, "!st_trpd: store rsvd\n");
!!# 		       IJ_iseg_printf("diag.j", 601,ISEG, 0, th_evnt, "\t.word 0xf472008d\n");
!!# 		    }
!!# 	| d901 store
!!# 		    {
!!# 		       IJ_iseg_printf("diag.j", 605,ISEG, 0, th_evnt, "!st_trpd:Normal store\n");
!!# 		       IJ_iseg_generate ("diag.j", 606,ISEG, 0, th_evnt, $2);
!!# 		    }
!!# ;
!!#
!!# icerr_alu_st_trpd:  d909 icerr_iseg
!!# 		    {
!!# 		       IJ_iseg_printf("diag.j", 612,ISEG, 0, th_evnt, "!icerr_alu_st_trpd: icerr alu rsvd\n");
!!# 		       IJ_iseg_printf("diag.j", 613,ISEG, 0, th_evnt, "\t.word 0xba00808c\n");
!!# 		    }
!!# 		   | d903 icerr_iseg
!!# 		    {
!!# 		       IJ_iseg_printf("diag.j", 617,ISEG, 0, th_evnt, "!icerr_alu_st_trpd: icerr store rsvd\n");
!!# 		       IJ_iseg_printf("diag.j", 618,ISEG, 0, th_evnt, "\t.word 0xf472008d\n");
!!# 		    }
!!# 		   | d904
!!# 		    {
!!# 		       IJ_iseg_printf("diag.j", 622,ISEG, 0, th_evnt, "!icerr_alu_st_trpd: alu rsvd\n");
!!# 		       IJ_iseg_printf ("diag.j", 623,ISEG, 0, th_evnt, "\t.word 0xba00808c\n");
!!# 		    }
!!# 		   | d905
!!# 		    {
!!# 		       IJ_iseg_printf("diag.j", 627,ISEG, 0, th_evnt, "!icerr_alu_st_trpd: store rsvd\n");
!!# 		       IJ_iseg_printf("diag.j", 628,ISEG, 0, th_evnt, "\t.word 0xf472008d\n");
!!# 		    }
!!# 	   	   | d915 store
!!# 		    {
!!# 		       IJ_iseg_printf("diag.j", 632,ISEG, 0, th_evnt, "!icerr_alu_st_trpd: Normal store\n");
!!# 		       IJ_iseg_generate ("diag.j", 633,ISEG, 0, th_evnt, $2);
!!# 		    }
!!# 	   	   | d916 alu_tokens
!!# 		    {
!!# 		       IJ_iseg_printf("diag.j", 637,ISEG, 0, th_evnt, "!icerr_alu_st_trpd: Normal alu\n");
!!# 		       IJ_iseg_generate ("diag.j", 638,ISEG, 0, th_evnt, $2);
!!# 		    }
!!# 		   | d902 icerr_iseg store
!!# 		    {
!!# 		       IJ_iseg_printf("diag.j", 642,ISEG, 0, th_evnt, "!icerr_alu_st_trpd: icerr store\n");
!!# 		       IJ_iseg_generate ("diag.j", 643,ISEG, 0, th_evnt, $3);
!!# 		    }
!!# ;
!!#
!!# load: load_i | load_r
!!# ;
!!#
!!# load_i: tLDSB


scr-max};

    @each $breakpoint, $value in $breakpoints {
        @if $value > $bp-class-generation {
            @include mediaq('>#{$value}') {
                --breakpoint: #{$value};
                --container: calc(
                    var(--breakpoint) - (var(--grid-gutter-width) / 2)
                );
            }

            @if $value <= 1200 {
                @include mediaq('>#{$value}') {
                    --breakpoint-small: #{$value};
                    --container-small: calc(
                        var(--breakpoint-small) - (var(--grid-gutter-width) / 2)
                    );
                }
            }
        }
    }

    --half-container: var(--grid-gutter-width);

    @include mediaq('>XS') {
        --half-container: calc(
            ((100% - var(--container)) / 2) + (var(--grid-gutter-width))
        );
    }
}

/* Container
========================================================================== */

.o-container {
    @include make-container();
    max-width: var(--container);
}

.o-container--small {
    @include make-container();
    max-width: var(--container-small);
}
/* ==========================================================================
    Settings / Config
========================================================================== */

/* Breakpoints
========================================================================== */

$scr-xxs: 320px;
$scr-xs: 480px;
$scr-sm: 768px;
$scr-md: 991px;
$scr-lg: 1200px;
$scr-xlg: 1450px;
$scr-xxlg: 1650px;
$scr-max: 1920px;

$breakpoints: (
    XXS: $scr-xxs,
    XS: $scr-xs,
    SM: $scr-sm,
    MD: $scr-md,
    LG: $scr-lg,
    XLG: $scr-xlg,
    XXLG: $scr-xxlg,
    // MAX: $scr-max
) !default;

/* Sizes
========================================================================== */

$list-size: ('thinner', 'thin', 'normal', 'large', 'larger') !default;

/* Text align
========================================================================== */

$list-text-align: (center, left, right) !default;

/* Grid
========================================================================== */

$grid-columns: 12;
$grid-gutter-width: 16px;
$bp-class-generation: $scr-xs - 1;

/* Spacing
========================================================================== */

$spacing-responsive-initial: 65px;
$spacing-responsive-increment: 15px;

$spacing-initial: 17px;
$spacing-ratio: 1.3;

$margin-initial: 12px;
$margin-ratio: 1.1;

$padding-initial: 12px;
$padding-ratio: 1.1;

/* Activate features
========================================================================== */

$activate-grid-classes: false;
$activate-align-classes: true;
/* ==========================================================================
    Generic / Normalize
========================================================================== */

/**
 * Normalization of HTML elements, manually forked from Normalize.css to remove
 * styles targeting irrelevant browsers while applying new styles.
 * Normalize is licensed MIT. https://github.com/necolas/normalize.css
 */

/**
 * Document
 *
 * Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/**
 * Body
 *
 * 1. Prevent adjustments of font size after orientation changes in iO


anager.UpdateExpiry(allAccessCtx, expected.GetId(), &common.VulnRequestParams{
		Comment: "update",
		Expiry:  &storage.RequestExpiry{},
	})
	s.NoError(err)
	s.Equal(expected.GetId(), req.GetId())
}
//go:build sql_integration

package requestmgr

import (
	"context"
	"fmt"
	"testing"
	"time"

	imageCVEDS "github.com/stackrox/rox/central/cve/image/datastore"
	deploymentMockDS "github.com/stackrox/rox/central/deployment/datastore/mocks"
	imageDS "github.com/stackrox/rox/central/image/datastore"
	imageCVEEdgeDS "github.com/stackrox/rox/central/imagecveedge/datastore"
	reprocessorMocks "github.com/stackrox/rox/central/reprocessor/mocks"
	sensorConnMgrMocks "github.com/stackrox/rox/central/sensor/service/connection/mocks"
	vulnReqCache "github.com/stackrox/rox/central/vulnmgmt/vulnerabilityrequest/cache"
	"github.com/stackrox/rox/central/vulnmgmt/vulnerabilityrequest/common"
	vulnReqDS "github.com/stackrox/rox/central/vulnmgmt/vulnerabilityrequest/datastore"
	v1 "github.com/stackrox/rox/generated/api/v1"
	"github.com/stackrox/rox/generated/internalapi/central"
	"github.com/stackrox/rox/generated/storage"
	"github.com/stackrox/rox/pkg/concurrency"
	"github.com/stackrox/rox/pkg/cve"
	"github.com/stackrox/rox/pkg/features"
	"github.com/stackrox/rox/pkg/fixtures"
	"github.com/stackrox/rox/pkg/postgres/pgtest"
	"github.com/stackrox/rox/pkg/protocompat"
	"github.com/stackrox/rox/pkg/protoconv"
	"github.com/stackrox/rox/pkg/sac"
	"github.com/stackrox/rox/pkg/search"
	"github.com/stackrox/rox/pkg/set"
	"github.com/stackrox/rox/pkg/sliceutils"
	"github.com/stackrox/rox/pkg/uuid"
	"github.com/stretchr/testify/suite"
	"go.uber.org/mock/gomock"
	"golang.org/x/sync/semaphore"
)

const (
	imageOS = "windows-me"
)

var (
	allAllowedCtx             = sac.WithAllAccess(context.Background())
	expiryLoopDurationForTest = 5 * time.Second // use a much quicker loop for testing purposes
)

func TestVulnRequestManager(t *testing.T) {
	suite.Run(t, new(VulnRequestManagerTestSuite))
}

type VulnRequestManagerTestSuite struct {
	mockCtrl *gomock.Controller
	suite.Suite

	ctx    context.Context
	testDB *pgtest.TestPostgres

	vulnReqDataStore      vulnReqDS.DataStore
	deployments           *deploymentMockDS.MockDataStore
	imageDataStore        imageDS.DataStore
	imageCVEDataStore     imageCVEDS.DataStore
	imageCVEEdgeDataStore imageCVEEdgeDS.DataStore
	sensorConnMgrMocks    *sensorConnMgrMocks.MockManager
	reprocessor           *reprocessorMocks.MockLoop
	manager               *managerImpl
	pendingReqCache       vulnReqCache.VulnReqCache
	activeReqCache        vulnReqCache.VulnReqCache
}

func (s *VulnRequestManagerTestSuite) SetupTest() {
	s.ctx = context.Background()
	s.mockCtrl = gomock.NewController(s.T())
	s.testDB


u_u400k_cleaned_trim_sp_pytorch_train/decode_dev_gss12.ep.10/result.wrd.txt
|  SPKR     |  # Snt    # Wrd   |  Corr       Sub      Del       Ins       Err    S.Err   |
|  Sum/Avg  |  7437     58881   |  52.2      32.4     15.4       7.4      55.3     81.1   |
```

# Default transformer - rnn transducer
  - Environments (obtained by `$ get_sys_info.sh`)
      - system information: `Linux 5.3.0-42-generic #34~18.04.1-Ubuntu SMP Fri Feb 28 13:42:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux`
      - python version: `Python 3.7.3`
      - espnet version: `espnet 0.8.0`
      - chainer version: `chainer 6.0.0`
      - pytorch version: `pytorch 1.0.1.post2`
      - Git hash: `2627f362d99daacc2368386d9cd8ea4727e4ff6a`
  - Model files link `https://drive.google.com/file/d/1q5R1_SlyDkhrSnQaufq0qV3MkDFfS3xa/view?usp=sharing`
    - training config file: `conf/train.yaml`
    - decoding config file: `conf/decode.yml`
    - cmvn file: `data/train_worn_simu_u400k_cleaned_trim_sp/cmvn.ark`
    - e2e file: `exp/train_worn_simu_u400k_cleaned_trim_nonpos_sp_transformer_rnn_transducer/model.loss.best.ep.10`
    - e2e JSON file: `exp/train_worn_simu_u400k_cleaned_trim_nonpos_sp_transformer_rnn_transducer/model.json`
  - Decoding results:
```
CER (or TER) result in exp/train_worn_simu_u400k_cleaned_trim_nonpos_sp_transformer_rnn_transducer/decode_dev_gss12.ep.10/result.txt
|  SPKR    |  # Snt    # Wrd   |  Corr      Sub       Del      Ins      Err    S.Err  |
|  Sum/Avg |  7437     280767  |  67.3     15.2      17.5     10.9     43.6     81.3  |
WER result in exp/train_worn_simu_u400k_cleaned_trim_nonpos_sp_transformer_rnn_transducer/decode_dev_gss12.ep.10/result.wrd.txt
|  SPKR     |  # Snt    # Wrd   |  Corr       Sub      Del       Ins       Err    S.Err   |
|  Sum/Avg  |  7437     58881   |  48.6      36.7     14.7       8.9      60.3     78.6   |
```
# Conformer (elayers=12, dlayers=6, units=2048, 4 GPUs, specaug) + large LM

  - Model files (archived to model.tar.gz by `$ pack_model.sh`)
    - model link: https://drive.google.com/file/d/11CN3tPF4MXM6wKdTFo7GjX3TlhhZobk-
    - training config file: `conf/tuning/train_conformer.yaml`
    - decoding config file: `conf/decode.yaml`
    - preprocess config file: `conf/specaug.yaml`
    - cmvn file: `data/train_trim_sp/cmvn.ark`
    - e2e file: `exp/t


 configs
---@param fallback CodeCompanion.History.Pickers Fallback provider name
---@return CodeCompanion.History.Pickers available provider name
local function find_available_picker(providers, configs, fallback)
    for _, key in ipairs(providers) do
        local config = configs[key]
        if config then
            local success, loaded_module = pcall(require, config.module)
            if success then
                if config.condition then
                    if config.condition(loaded_module) then
                        return key
                    end
                else
                    return key
                end
            end
        end
    end
    return fallback
end

---Get the best available history picker
---@return CodeCompanion.History.Pickers resolved picker name
local function get_history_picker()
    -- Priority order for history pickers
    local providers = { "telescope", "fzf-lua", "snacks" }
    return find_available_picker(providers, picker_configs, "default")
end

return {
    history = get_history_picker(),
}


}
	return c.Context.Value(key)
}
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package reflect

import "unsafe"

// Swapper returns a function that swaps the elements in the provided
// slice.
//
// Swapper panics if the provided interface is not a slice.
func Swapper(slice interface{}) func(i, j int) {
	v := ValueOf(slice)
	if v.Kind() != Slice {
		panic(&ValueError{Method: "Swapper", Kind: v.Kind()})
	}
	// Fast path for slices of size 0 and 1. Nothing to swap.
	switch v.Len() {
	case 0:
		return func(i, j int) { panic("reflect: slice index out of range") }
	case 1:
		return func(i, j int) {
			if i != 0 || j != 0 {
				panic("reflect: slice index out of range")
			}
		}
	}

	typ := v.Type().Elem().(*rtype)
	size := typ.Size()
	hasPtr := typ.ptrdata != 0

	// Some common & small cases, without using memmove:
	if hasPtr {
		if size == ptrSize {
			ps := *(*[]unsafe.Pointer)(v.ptr)
			return func(i, j int) { ps[i], ps[j] = ps[j], ps[i] }
		}
		if typ.Kind() == String {
			ss := *(*[]string)(v.ptr)
			return func(i, j int) { ss[i], ss[j] = ss[j], ss[i] }
		}
	} else {
		switch size {
		case 8:
			is := *(*[]int64)(v.ptr)
			return func(i, j int) { is[i], is[j] = is[j], is[i] }
		case 4:
			is := *(*[]int32)(v.ptr)
			return func(i, j int) { is[i], is[j] = is[j], is[i] }
		case 2:
			is := *(*[]int16)(v.ptr)
			return func(i, j int) { is[i], is[j] = is[j], is[i] }
		case 1:
			is := *(*[]int8)(v.ptr)
			return func(i, j int) { is[i], is[j] = is[j], is[i] }
		}
	}

	s := (*sliceHeader)(v.ptr)
	tmp := unsafe_New(typ) // swap scratch space

	return func(i, j int) {
		if uint(i) >= uint(s.Len) || uint(j) >= uint(s.Len) {
			panic("reflect: slice index out of range")
		}
		val1 := arrayAt(s.Data, i, size, "i < s.Len")
		val2 := arrayAt(s.Data, j, size, "j < s.Len")
		typedmemmove(typ, tmp, val1)
		typedmemmove(typ, val1, val2)
		typedmemmove(typ, val2, tmp)
	}
}
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package strconv

import "math/bits"

const fastSmalls = true // enable fast path for small integers

// FormatUint returns the string representation of i in the given base,
// for 2 <= base <= 36. The result uses the lower-case letters 'a' to 'z'
// for digit values >= 10.
func FormatUint(i uint64, base int) string {
	if fastSmalls && i < nSmalls && base == 10 {
		return small(int(i))
	}
	_, s := formatBits(nil, i, base, false, false)
	return s
}

// FormatInt returns the string representation of i in the given base,
// for 2 <= base <= 36. The result uses the lower-case letters 'a' to 'z'
// for digit


.success(f"บันทึกการตั้งค่า KPI '{selected_kpi}' เรียบร้อยแล้ว")
        st.info(f"ความสำเร็จปัจจุบัน: {success_percent:.1f}%")

        # แสดงคำแนะนำในการปรับปรุง
        if success_percent < 80:
            st.warning("คำแนะนำในการปรับปรุง: KPI นี้ยังต่ำกว่าเป้าหมายมาก ควรตรวจสอบและวิเคราะห์สาเหตุโดยด่วน")
        elif success_percent < 95:
            st.info("คำแนะนำในการปรับปรุง: KPI นี้ใกล้ถึงเป้าหมาย ควรมีการปรับปรุงเล็กน้อย")
        else:
            st.success("KPI นี้เป็นไปตามเป้าหมายแล้ว ควรรักษาระดับนี้ไว้")

    # เพิ่ม KPI ใหม่
    st.subheader("เพิ่ม KPI ใหม่")

    col1, col2, col3 = st.columns(3)

    with col1:
        new_kpi_name = st.text_input("ชื่อ KPI ใหม่")

    with col2:
        new_kpi_unit = st.text_input("หน่วย")

    with col3:
        new_kpi_target = st.number_input("ค่าเป้าหมาย", min_value=0.0, step=0.1)

    if st.button("เพิ่ม KPI ใหม่"):
        if new_kpi_name and new_kpi_unit:
            st.success(f"เพิ่ม KPI '{new_kpi_name}' เรียบร้อยแล้ว")
        else:
            st.error("กรุณาระบุชื่อ KPI และหน่วย")

    # ตัวอย่าง KPI ที่แนะนำ
    st.subheader("ตัวอย่าง KPI ที่แนะนำสำหรับระบบไฮโดรโปนิก")

    recommended_kpi = {
        "KPI": [
            "คุณภาพผลผลิต (คะแนน 1-10)",
            "ระยะเวลาการเก็บเกี่ยว (วัน)",
            "อัตราการเจริญเติบโตสัปดาห์แรก (%)",
            "อัตราการสูญเสียพืช (%)",
            "ประสิทธิภาพการใช้ปุ๋ย (kg/kg)",
            "ต้นทุนต่อกิโลกรัม (บาท/kg)"
        ],
        "คำอธิบาย": [
            "วัดคุณภาพของผลผลิตด้วยการให้คะแนนจากสี ขนาด รสชาติ และลักษณะภายนอก",
            "วัดจำนวนวันตั้งแต่เริ่มปลูกจนถึงวันเก็บเกี่ยว",
            "วัดการเติบโตในสัปดาห์แรกเทียบกับค่าเป้าหมาย",
            "เปอร์เซ็นต์ของพืชที่ไม่สามารถเติบโตจนเก็บเกี่ยวได้",
            "วัดปริมาณปุ๋ยที่ใช้ต่อปริมาณผลผลิตที่ได้",
            "คำนวณต้นทุนทั้งหมดต่อปริมาณผลผลิต 1 กิโลกรัม"
        ]
    }

    recommended_kpi_df = pd.DataFrame(recommended_kpi)
    st.dataframe(recommended_kpi_df, use_container_width=True)

# สร้างส่วนท้าย
st.sidebar.markdown("---")
st.sidebar.info("ระบบพัฒนาโดย Hydroponics Analytics")
st.sidebar.text("เวอร์ชัน 1.0.0")