exSetWithIndex_1, value);
    return NSIndexSet._(_ret, _lib, retain: true, release: true);
  }

  static NSIndexSet indexSetWithIndexesInRange_(AVFAudio _lib, NSRange range) {
    final _ret = _lib._objc_msgSend_83(
        _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range);
    return NSIndexSet._(_ret, _lib, retain: true, release: true);
  }

  NSIndexSet initWithIndexesInRange_(NSRange range) {
    final _ret =
        _lib._objc_msgSend_83(_id, _lib._sel_initWithIndexesInRange_1, range);
    return NSIndexSet._(_ret, _lib, retain: true, release: true);
  }

  NSIndexSet initWithIndexSet_(NSIndexSet? indexSet) {
    final _ret = _lib._objc_msgSend_84(
        _id, _lib._sel_initWithIndexSet_1, indexSet?._id ?? ffi.nullptr);
    return NSIndexSet._(_ret, _lib, retain: true, release: true);
  }

  NSIndexSet initWithIndex_(int value) {
    final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithIndex_1, value);
    return NSIndexSet._(_ret, _lib, retain: true, release: true);
  }

  bool isEqualToIndexSet_(NSIndexSet? indexSet) {
    return _lib._objc_msgSend_85(
        _id, _lib._sel_isEqualToIndexSet_1, indexSet?._id ?? ffi.nullptr);
  }

  int get count {
    return _lib._objc_msgSend_10(_id, _lib._sel_count1);
  }

  int get firstIndex {
    return _lib._objc_msgSend_10(_id, _lib._sel_firstIndex1);
  }

  int get lastIndex {
    return _lib._objc_msgSend_10(_id, _lib._sel_lastIndex1);
  }

  int indexGreaterThanIndex_(int value) {
    return _lib._objc_msgSend_86(_id, _lib._sel_indexGreaterThanIndex_1, value);
  }

  int indexLessThanIndex_(int value) {
    return _lib._objc_msgSend_86(_id, _lib._sel_indexLessThanIndex_1, value);
  }

  int indexGreaterThanOrEqualToIndex_(int value) {
    return _lib._objc_msgSend_86(
        _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value);
  }

  int indexLessThanOrEqualToIndex_(int value) {
    return _lib._objc_msgSend_86(
        _id, _lib._sel_indexLessThanOrEqualToIndex_1, value);
  }

  int getIndexes_maxCount_inIndexRange_(ffi.Pointer<NSUInteger> indexBuffer,
      int bufferSize, NSRangePointer range) {
    return _lib._objc_msgSend_87(
        _id,
        _lib._sel_getIndexes_maxCount_inIndexRange_1,
        indexBuffer,
        bufferSize,
        range);
  }

  int countOfIndexesInRange_(NSRange range) {
    return _lib._objc_msgSend_88(_id, _lib._sel_countOfIndexesInRange_1, range);
  }

  bool containsIndex_(int value) {
    return _lib._objc_msgSend_89(_id, _lib._sel_containsIndex_1, value);
  }

  bool containsIndexesInRange_(NSRange range) {
    return _lib._objc_msgSend_90(
        _id, _lib._sel_containsIndexesInRange_1, range);
  }

  bool containsIndexes_(NSIndexSet? indexSet) {
    return _lib._objc_msgSend_85(
        _id, _lib._sel_containsIndexes_1, indexSet?._id ?? ffi.nullptr);
  }


     krb5_get_init_creds_opt_free(context, opts);
        exit(1);
    }

    if (result_code) {
        if (krb5_chpw_message(context, &result_string, &message) != 0)
            message = NULL;
        printf("%.*s%s%s\n",
               (int)result_code_string.length, result_code_string.data,
               message ? ": " : "", message ? message : NULL);
        krb5_free_string(context, message);
        krb5_get_init_creds_opt_free(context, opts);
        exit(2);
    }

    free(result_string.data);
    free(result_code_string.data);
    krb5_get_init_creds_opt_free(context, opts);

    printf(_("Password changed.\n"));
    exit(0);
}


u may need to fix this if you're using C++.
	 */
	/DISCARD/ : { *(.eh_frame) }

	. = ALIGN(4);
	end = .;
}

PROVIDE(_stack = ORIGIN(ram) + LENGTH(ram));


local rogallyx_lcd_refresh_rates = {
    48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
    58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
    68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
    78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
    88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
    98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
    108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
    118, 119, 120
}

gamescope.config.known_displays.rogallyx_lcd = {
    pretty_name = "ASUS ROG Ally X LCD",
    hdr = {
        -- Setup some fallbacks for undocking with HDR, meant
        -- for the internal panel. It does not support HDR.
        supported = false,
        force_enabled = false,
        eotf = gamescope.eotf.gamma22,
        max_content_light_level = 500,
        max_frame_average_luminance = 500,
        min_content_light_level = 0.5
    },
    -- Use the EDID colorimetry for now, but someone should check
    -- if the EDID colorimetry truly matches what the display is capable of.
    dynamic_refresh_rates = rogallyx_lcd_refresh_rates,
    -- Follow the Steam Deck OLED style for modegen by variang the VFP (Vertical Front Porch)
    --
    -- Given that this display is VRR and likely has an FB/Partial FB in the DDIC:
    -- it should be able to handle this method, and it is more optimal for latency
    -- than elongating the clock.
    dynamic_modegen = function(base_mode, refresh)
        debug("Generating mode "..refresh.."Hz for ROG Ally w


sPointControl {
			continue
		}
		for _, pt2 := range app.AccessPoints {
			if pt2.Type != dbmodel.AccessPointControl {
				continue
			}

			if pt1.Port == pt2.Port {
				controlPortEqual = true
				break
			}
		}

		// If a match is found, we can break.
		if controlPortEqual {
			break
		}
	}

	return controlPortEqual
}

// Get old apps from the machine db object and new apps retrieved from the machine remotely
// and merge them into one list of all, unique apps.
func mergeNewAndOldApps(db *dbops.PgDB, dbMachine *dbmodel.Machine, discoveredApps []*agentcomm.App) ([]*dbmodel.App, string) {
	// If there are any new apps then get their state and add to db.
	// Old ones are just updated. Use GetAppsByMachine to retrieve
	// machine's apps with their daemons.
	oldAppsList, err := dbmodel.GetAppsByMachine(db, dbMachine.ID)
	if err != nil {
		log.Error(err)
		return nil, "Cannot get machine's apps from db"
	}

	// Count the number of apps of each type.
	oldAppsCounts := make(map[dbmodel.AppType]int)
	for _, dbApp := range oldAppsList {
		oldAppsCounts[dbApp.Type]++
	}

	// Count the number of apps of each type.
	newAppsCounts := make(map[dbmodel.AppType]int)
	for _, app := range discoveredApps {
		newAppsCounts[dbmodel.AppType(app.Type)]++
	}

	// new and old apps
	allApps := []*dbmodel.App{}

	// old apps found in new apps fetched from the machine
	matchedApps := []*dbmodel.App{}
	for _, app := range discoveredApps {
		// try to match apps on machine with old apps from database
		var dbApp *dbmodel.App
		for _, dbAppOld := range oldAppsList {
			// If there is one app of a given type detected on the machine and one app recorded in the database
			// we assume that this is the same app. If there are more apps of a given type than used to be,
			// or there are less apps than it used to be we have to compare their access control information
			// to identify matching ones.
			if (app.Type == dbAppOld.Type.String() && oldAppsCounts[dbAppOld.Type] == 1 && newAppsCounts[dbAppOld.Type] == 1) ||
				appCompare(dbAppOld, app) {
				dbApp = dbAppOld
				matchedApps = append(matchedApps, dbApp)
				break
			}
		}
		// if no old app in db then prepare new record
		if dbApp == nil {
			dbApp = &dbmodel.App{
				ID:        0,
				MachineID: dbMachine.ID,
				Machine:   dbMachine,
				Type:      dbmodel.AppType(app.Type),
			}
		} else {
			dbApp.Machine = dbMachine
		}
		allApps = append(allApps, dbApp)

		// add or update access points
		var accessPoints []*dbmodel.AccessPoint
		for _, point := range app.AccessPoints {
			accessPoints = append(accessPoints, &dbmodel.AccessPoint{
				Type:              point.Type,
				Address:           point.Address,
				Port:              point.Port,
				Key:               point.Key,
				UseSecureProtocol: point.UseSecureProtocol,
			})
		}
		dbApp.AccessPoints = accessPoints
	}

	// add old, not matched apps to all apps
	for _, dbApp := range oldAppsList {
		toAdd := true
		for _, app := range matchedApps {
			if dbApp == app {
				toAdd = false
				break
			}
		}
		if toAdd {
			dbApp.Machine = dbMachine
			allApps = append(allApps, dbApp)
		}


uille te laten downloaden, zoals Cake Wallet (iOS/Android), Monerujo (Android) of MyMonero (iOS), stuur ze een beetje Monero en laat ze wat terugsturen.
\n
Het kan ook nuttig zijn om een transactie tussen bijvoorbeeld Bitcoin en Monero te vergelijken in een verkenner zoals ExploreMonero om ze te laten zien hoe weinig informatie openbaar wordt gemaakt bij transacties met Monero in vergelijking met andere transparante blockchains.
';

  @override
  String get knowledge250Sbcontributing250Sb3250Sbtitle => 'Bewustwording en betrokkenheid';

  @override
  String get knowledge250Sbcontributing250Sb4250Sbtext => '
Als u al een tijdje betrokken bent met Monero of goed begrijpt hoe u het moet gebruiken en problemen kunt oplossen, kunt u meedoen door naar de subreddit r/monerosupport te gaan en ondersteuning bieden aan gebruikers die daar posten.
\n
Er zijn constant gebruikers die hulp nodig hebben bij (normaal gesproken) basisproblemen, en er zijn er maar een aantal van ons die actief zijn in de subreddit om hen te helpen. Het zou geweldig zijn als meer mensen zich inzetten en bijdragen om nieuwe en bestaande gebruikers te helpen hun problemen op te lossen!
';

  @override
  String get knowledge250Sbcontributing250Sb4250Sbtitle => 'r/monerosupport';

  @override
  String get knowledge250Sbcontributing250Sb5250Sbtext => '
Bijna alle communitydiscussies over specifieke onderwerpen vinden plaats in Matrix of IRC, dus als u geïnteresseerd bent in het leren van/het volgen van vergaderingen of als u actief wilt deelnemen, moet u een van die chats instellen op . netwerken.
\n
Als u dat eenmaal heeft gedaan, houdt dan de onderwerpen in de gaten voor elke kamer waarin u zich bevindt of op de Monero-meta-opslagplaats voor geplande vergaderingen.
\n
Als u ervoor kiest om deel te nemen, respecteer dan de onderwerpen, blijf bij het onderwerp en probeer u alleen uit te spreken wanneer nodig/opgeroepen.
';

  @override
  String get knowledge250Sbcontributing250Sb5250Sbtitle => 'Samenkomsten van de gemeenschap';

  @override
  String get knowledge250Sbcontributing250Sb6250Sbtext => '
Voor degenen die twee-of meertalig zijn, is een zeer belangrijke manier om bij te dragen, om te helpen met vertalingen van het Engels naar andere ta


= false;

  // Daten stehen bereit (nach Laden von Server)
  public dataReady = false;

  // Metadaten der darzustellenden Tabelle
  private _tabledefinition: Tabledefinition;
  @Input() get tabledefinition() { return this._tabledefinition; }
  set tabledefinition(value) {
    this.propertyDescriptors = value.propertyDescriptors;
    this._tabledefinition = value;
    this.getData();
  }

  constructor(private apiService: ApiService) { }

  ngOnInit() {
  }

  // Daten laden
  async getData() {
    this.dataReady = false;

    try {
      // Primäre Daten für die ausgewählte Tabelle laden
      this.data = <object[]>await this.apiService.getTabledata(this._tabledefinition);

      // Für alle Lookup-Felder die Daten laden
      await this.apiService.resolveLookups(this.propertyDescriptors);

      this.dataReady = true;
    }
    catch (e) {
      this.showError(e);
    }

  }

  // Editor anzeigen und Form initialisieren
  edit(entity: object) {

    if (entity) {
      // ausgewähltes Objekt soll geändert werden
      this.selectedEntity = entity;
    }
    else {
      // ein neues Objekt wird angelegt
      this.editNewEntity = true;
      this.selectedEntity = {};

      // Primary Key setzen (Einschränkung: nur ein Key vom Typ int erlaubt)
      this.selectedEntity[this._tabledefinition.primaryKey] = 0
    }

    // Objekt ist jetzt in Bearbeitung
    this.editorActive = true;

    this.editorActiveChanged.emit(this.editorActive);
  }

  // Entität löschen
  async delete(entity: object) {

    // Sind Sie sicher...
    if (!confirm("Wirklich löschen?")) return;

    try {
      // und weg damit
      await this.apiService.deleteEntity(this._tabledefinition, entity[this._tabledefinition.primaryKey]);
    }
    catch (e) {
      this.showError(e);
    }

    // Daten neu laden
    await this.getData();
  }

  // Daten für Tabellendarstellung laden
  getValue(entity: object, propertyDescriptor: PropertyDescriptorBase) {

    // Der Originalwert
    let value = entity[propertyDescriptor.name];

    // Falls ein Datum dargestellt werden soll, umwandeln
    if (propertyDescriptor.displayType == "date")
      value = new Date(value).toLocaleDateString();

    // dito für Zahlenwerte
    if (propertyDescriptor.displayType == "number" && value.toLocaleString)
      value = value.toLocaleString();

    // für die einfache Text-Darstellung war's das
    if (propertyDescriptor.controlType == "textbox") return value;

    // für Lookup-Felder muss der Lookup-Wert ermittelt werden
    if (propertyDescriptor.controlType == "dropdown") {
      let options = (<PropertyDescriptorSelector>propertyDescriptor).options;
      if (!options) return "";
      let o = options.find(o => o.key == value);
      if (o) return o.value;
    }

    // äh - das war nicht geplant
    return "???";
  }

  // Objekt speichern
  async saveEntity(entity: object) {

    // let d = JSON.stringify(entity);
    // alert("Save: " + d);

    // Editor wird geschlossen
    this.selectedEntity = undefined;

    try {

      // war das was neues?
      if (this.editNewEntity) {
        // ja, hinzufügen mit POST
        await this.apiService.postEntityData(this._tabledefinition, entity);
        this.editNewEntity = false;


se ADC_DINPUT_0: /* TODO */
        default:
            retval = hummeradc_prev;
            break;
    }
#ifdef HUMMERADC_DEBUG_ENABLED
    HUMMERADC_DEBUG(" read: value %02x, state %i", retval, hummeradc_state);
#endif
    return retval;
}

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

void hummeradc_init(void)
{
    if (hummeradc_log == LOG_DEFAULT) {
        hummeradc_log = log_open("HUMMERADC");
    }
    hummeradc_reset();
    return;
}

void hummeradc_shutdown(void)
{
    return;
}

void hummeradc_reset(void)
{
    hummeradc_state = ADC_IDLE;
    hummeradc_command = ADC_NONE;
    hummeradc_value = 0;
    hummeradc_channel = 0;
    hummeradc_control = 0;
    hummeradc_prev = 0;
    hummeradc_chanattr = 0;
    hummeradc_chanwakeup = 0;
    return;
}


, 0], {z0.b - z3.b}, {z0.b - z3.b}  // 11000001-10100001-00010100-00010000
// CHECK-INST: udot    za.s[w8, 0, vgx4], { z0.b - z3.b }, { z0.b - z3.b }
// CHECK-ENCODING: [0x10,0x14,0xa1,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1a11410 <unknown>

udot    za.s[w10, 5, vgx4], {z8.b - z11.b}, {z20.b - z23.b}  // 11000001-10110101-01010101-00010101
// CHECK-INST: udot    za.s[w10, 5, vgx4], { z8.b - z11.b }, { z20.b - z23.b }
// CHECK-ENCODING: [0x15,0x55,0xb5,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1b55515 <unknown>

udot    za.s[w10, 5], {z8.b - z11.b}, {z20.b - z23.b}  // 11000001-10110101-01010101-00010101
// CHECK-INST: udot    za.s[w10, 5, vgx4], { z8.b - z11.b }, { z20.b - z23.b }
// CHECK-ENCODING: [0x15,0x55,0xb5,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1b55515 <unknown>

udot    za.s[w11, 7, vgx4], {z12.b - z15.b}, {z8.b - z11.b}  // 11000001-10101001-01110101-10010111
// CHECK-INST: udot    za.s[w11, 7, vgx4], { z12.b - z15.b }, { z8.b - z11.b }
// CHECK-ENCODING: [0x97,0x75,0xa9,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1a97597 <unknown>

udot    za.s[w11, 7], {z12.b - z15.b}, {z8.b - z11.b}  // 11000001-10101001-01110101-10010111
// CHECK-INST: udot    za.s[w11, 7, vgx4], { z12.b - z15.b }, { z8.b - z11.b }
// CHECK-ENCODING: [0x97,0x75,0xa9,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1a97597 <unknown>

udot    za.s[w11, 7, vgx4], {z28.b - z31.b}, {z28.b - z31.b}  // 11000001-10111101-01110111-10010111
// CHECK-INST: udot    za.s[w11, 7, vgx4], { z28.b - z31.b }, { z28.b - z31.b }
// CHECK-ENCODING: [0x97,0x77,0xbd,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1bd7797 <unknown>

udot    za.s[w11, 7], {z28.b - z31.b}, {z28.b - z31.b}  // 11000001-10111101-01110111-10010111
// CHECK-INST: udot    za.s[w11, 7, vgx4], { z28.b - z31.b }, { z28.b - z31.b }
// CHECK-ENCODING: [0x97,0x77,0xbd,0xc1]
// CHECK-ERROR:


t();
    #endregion

    #region Assert
    Assert.True(success);
    int updatedInventory = store.Inventory[productId];
    Assert.Equal(initialInventory - quantityToBuy, updatedInventory);
    #endregion
  }

  [Fact]
  public void Checkout_ShouldFailWhenLowInventory()
  {
    // Arrange
    int productId = 1;
    int initialInventory = 10;
    Store store = CreateStore(productId, initialInventory);
    Cart sut = new(store);
    int quantityToBuy = 15;

    // Act
    sut.AddItems(productId, quantityToBuy);
    bool success = sut.Checkout();

    // Assert
    Assert.False(success);
    int updatedInventory = store.Inventory[productId];
    Assert.Equal(initialInventory, updatedInventory);
  }
}


#appendix-I.4
func (fq *Fq) tonelliShanks(elem *Fq) (*Fq, bool) {
	// c1 := 32
	// c2 := (q - 1) / (2^c1)
	//c2 := [4]uint64{
	//	0x0994a8dd8c46eb21,
	//	0x00000000224698fc,
	//	0x0000000000000000,
	//	0x0000000040000000,
	//}
	// c3 := (c2 - 1) / 2
	c3 := [4]uint64{
		0x04ca546ec6237590,
		0x0000000011234c7e,
		0x0000000000000000,
		0x0000000020000000,
	}
	//c4 := generator
	//c5 := new(Fq).pow(&generator, c2)
	c5 := &Fq{
		0x218077428c9942de,
		0xcc49578921b60494,
		0xac2e5d27b2efbee2,
		0xb79fa897f2db056,
	}

	z := new(Fq).pow(elem, c3)
	t := new(Fq).Square(z)
	t.Mul(t, elem)

	z.Mul(z, elem)

	b := new(Fq).Set(t)
	c := new(Fq).Set(c5)
	flags := map[bool]int{
		true:  1,
		false: 0,
	}

	for i := s; i >= 2; i-- {
		for j := 1; j <= i-2; j++ {
			b.Square(b)
		}
		z.CMove(z, new(Fq).Mul(z, c), flags[!b.IsOne()])
		c.Square(c)
		t.CMove(t, new(Fq).Mul(t, c), flags[!b.IsOne()])
		b.Set(t)
	}
	wasSquare := c.Square(z).Equal(elem)
	return fq.Set(z), wasSquare
}

// Invert this element i.e. compute the multiplicative inverse
// return false, zero if this element is zero
func (fq *Fq) Invert(elem *Fq) (*Fq, bool) {
	// computes elem^(p - 2) mod p
	exp := [4]uint64{
		0x8c46eb20ffffffff,
		0x224698fc0994a8dd,
		0x0000000000000000,
		0x4000000000000000}
	return fq.pow(elem, exp), !elem.IsZero()
}

// Mul returns the result from multiplying this element by rhs
func (fq *Fq) Mul(lhs, rhs *Fq) *Fq {
	dlhs := (*fiat_pasta_fq_montgomery_domain_field_element)(lhs)
	drhs := (*fiat_pasta_fq_montgomery_domain_field_element)(rhs)
	fiat_pasta_fq_mul((*fiat_pasta_fq_montgomery_domain_field_element)(fq), dlhs, drhs)
	return fq
}

// Sub returns the result from subtracting rhs from this element
func (fq *Fq) Sub(lhs, rhs *Fq) *Fq {
	dlhs := (*fiat_pasta_fq_montgomery_domain_field_element)(lhs)
	drhs := (*fiat_pasta_fq_montgomery_domain_field_element)(rhs)
	fiat_pasta_fq_sub((*fiat_pasta_fq_montgomery_domain_field_element)(fq), dlhs, drhs)
	return fq
}

// Add returns the result from adding rhs to this element
func (fq *Fq) Add(lhs, rhs *Fq) *Fq {
	dlhs := (*fiat_pasta_fq_montgomery_domain_field_element)(lhs)
	drhs := (*fiat_pasta_fq_montgomery_domain_field_element)(rhs)
	fiat_pasta_fq_add((*fiat_pasta_fq_montgomery_domain_field_element)(fq), dlhs, drhs)
	return fq
}

// Neg returns negation of t


 | stretch)
@mixin align-items($value: stretch) {

  $alt-value: $value;

  @if $value == "flex-start" {
    $alt-value: start;
  }

  @else if $value == "flex-end" {
    $alt-value: end;
  }

  // 2009
  @include prefixer(box-align, $alt-value, webkit moz spec);

  // 2012
  @include prefixer(align-items, $value, webkit moz ms o spec);

  // 2011 (IE 10)
  -ms-flex-align: $alt-value;
}

// 2011 - flex-item-align (auto | start | end | center | baseline | stretch)
// 2012 - align-self (auto | flex-start | flex-end | center | baseline | stretch)
@mixin align-self($value: auto) {

  $value-2011: $value;
  @if $value == "flex-start" {
    $value-2011: start;
  }

  @else if $value == "flex-end" {
    $value-2011: end;
  }

  // 2012
  @include prefixer(align-self, $value, webkit moz spec);

  // 2011 (IE 10)
  -ms-flex-item-align: $value-2011;
}

// 2011 - flex-line-pack (start | end | center | justify | distribute | stretch)
// 2012 - align-content (flex-start | flex-end | center | space-between | space-around | stretch)
@mixin align-content($value: stretch) {

  $value-2011: $value;
  @if $value == "flex-start" {
    $value-2011: start;
  }

  @else if $value == "flex-end" {
    $value-2011: end;
  }

  @else if $value == "space-between" {
    $value-2011: justify;
  }

  @else if $value == "space-around" {
    $value-2011: distribute;
  }

  // 2012
  @include prefixer(align-content, $value, webkit moz spec);

  // 2011 (IE 10)
  -ms-flex-line-pack: $value-2011;
}
//************************************************************************//
// Helper function for linear/radial-gradient-parsers.
// Source: http://sassmeister.com/gist/9647408
//************************************************************************//
@function _str-to-num($string) {
  // Matrices
  $strings: '0' '1' '2' '3' '4' '5' '6' '7' '8' '9';
  $numbers:  0   1   2   3   4   5   6   7   8   9;

  // Result
  $result: 0;
  $divider: 0;
  $minus: false;

  // Looping through all characters
  @for $i from 1 through str-length($string) {
    $character: str-slice($string, $i, $i);
    $index: index($strings, $character);

    @if $character == '-' {
      $minus: true;
    }

    @else if $character == '.' {
      $divider: 1;
    }

    @else {
      @if not $index {
        $result: if($minus, $result * -1, $result);
        @return _convert-units($result, str-slice($string, $i));
      }

      $number: nth($numbers, $index);

      @if $divider == 0 {
        $result: $result * 10;
      }

      @else {
        // Move the decimal dot to the left
        $divider: $divider * 10;
        $number: $number / $divider;
      }

      $result: $result + $number;
    }
  }
  @return if($minus, $result * -1, $result);
}
@function _radial-arg-parser($G1, $G2, $pos, $shape-size) {
  @each $value in


![](https://mmbiz.qpic.cn/sz_mmbiz_png/L369x9IF3yPMwVHx9iaPDKDhBJiajRW2DIdq0Wxe7JcpgKDia3zMfgicaaD6Auwn6Q3GGm2vI0eNh1Qic6OUhHMjE7g/640?wx_fmt=png&from=appmsg "")

PS：有内网web自动化需求可以私信

01

—

导语

    一封看似普通的业务邮件，无需点击、无需下载，就能让企业最敏感数据自动流向攻击者服务器——这不是科幻电影情节，而是已被证实的AI安全噩梦

    网络安全研究人员发现，微软365 Copilot存在一个名为
**“EchoLeak”的零点击AI漏洞**
（CVE-2025-32711），攻击者只需向目标企业员工发送一封精心设计的电子邮件，就能在用户毫无察觉的情况下窃取敏感数据。

    该漏洞由Aim Security团队在2025年1月发现并报告给微软，CVSS评分高达
**9.3分**
，属于严重级别漏洞16。微软已在5月完成服务器端修复，用户无需采取任何行动。微软确认，没有证据表明该漏洞在修复前遭到恶意利用。

![](https://mmbiz.qpic.cn/sz_mmbiz_png/L369x9IF3yMxeUItembJ0jU0tvUmantn5UNKbQibZTy7s9kKMRJe210fsttAibQQ0icmiby8VFhju4gPRQwVic41Qtg/640?wx_fmt=png&from=appmsg "")
## 01 无声的攻击，零点击的灾难

    在传统网络安全威胁中，攻击成功往往需要用户执行某个动作——点击恶意链接、下载带毒文件或运行可疑程序。而EchoLeak漏洞的可怕之处在于它的
**“零点击”特性**
。

    攻击者只需向目标公司的员工发送一封
**看似正常的业务邮件**
。这封邮件不需要包含恶意代码，也不需要诱导用户点击任何内容。

    邮件内容经过特殊设计，看起来像是普通业务文档，可能是关于人力资源政策、财务报告或员工培训材料。

    当员工在几天甚至几周后使用Microsoft 365 Copilot处理相关业务时，例如询问“帮我总结最近的财报数据”，灾难便无声降临。
## 02 漏洞如何绕过层层防护

    EchoLeak攻击之所以能成功，在于它巧妙地绕过了微软部署的四重安全防线。

    攻击首先
**绕过微软的XPIA（跨提示注入攻击）分类器**
。研究人员将恶意指令伪装成给人类阅读的内容，而非针对AI系统的提示，欺骗了安全系统。


 : this.props.max, id : component_complex__$ComplexEasingId_ComplexEasingId_$Impl_$.numberInputId(this.props.id,1), context : this.props.context});
		var kind = tweenxcore_expr_UnaryOpKind.Clamp(this.props.min,this.props.max);
		var easing = this.props.easing;
		var tmp2;
		switch(kind[1]) {
		case 0:
			var repeat = kind[2];
			var func = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing);
			tmp2 = function(rate) {
				var p = (0 * (1 - rate) + repeat * rate) / 1.0;
				return func(p - Math.floor(p));
			};
			break;
		case 1:
			var to = kind[3];
			var from = kind[2];
			var func1 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing);
			tmp2 = function(rate1) {
				var rate2 = func1(rate1);
				return from * (1 - rate2) + to * rate2;
			};
			break;
		case 2:
			var max = kind[3];
			var min = kind[2];
			var func2 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing);
			tmp2 = function(rate3) {
				var value = func2(rate3);
				if(value <= min) {
					return min;
				} else if(max <= value) {
					return max;
				} else {
					return value;
				}
			};
			break;
		case 3:
			var roundTrip = kind[2];
			switch(roundTrip[1]) {
			case 0:
				var func3 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing);
				tmp2 = function(value1) {
					return func3((value1 < 0.5 ? value1 : 1 - value1) * 2);
				};
				break;
			case 1:
				var func4 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing);
				tmp2 = function(value2) {
					if(value2 < 0.5) {
						return func4(value2 * 2);
					} else {
						return 1 - func4((value2 - 0.5) * 2);
					}
				};
				break;
			}
			break;
		case 4:
			var op = kind[3];
			var easing2 = kind[2];
			switch(op[1]) {
			case 0:
				var func11 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing);
				var func21 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing2);
				tmp2 = function(rate4) {
					var tmp3 = func21(rate4);
					return func11(tmp3);
				};
				break;
			case 1:
				var func12 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing);
				var func22 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing2);
				tmp2 = function(rate5) {
					return func12(rate5) * func22(rate5);
				};
				break;
			case 2:
				var strength = op[2];
				var func13 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing);
				var func23 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing2);
				var a2 = func13;
				var a3 = func23;
				var a4 = strength;
				tmp2 = function(a1) {
					return tweenxcore_FloatTools.mixEasing(a1,a2,a3,a4);
				};
				break;
			case 3:
				var switchValue = op[3];
				var switchTime = op[2];
				var func14 = tweenxcore_expr_ComplexEasingKindTools.toFunction(easing);
				var func24 = tweenxcore_expr_ComplexEasingKind


    0xE8, 0x0B, 0x40, 0xF9,                             // LDR             X8, [SP,#0x30+var_20]
            0x08, 0x11, 0x00, 0x91,                             // ADD             X8, X8, #4
            0xE8, 0x0B, 0x00, 0xF9,                             // STR             X8, [SP,#0x30+var_20]
            0xF7, 0xFF, 0xFF, 0x17,                             // B               loc_590
            //                              ; ---------------------------------------------------------------------------

            //                              loc_5B8                                 ; CODE XREF: mono_arch_flush_icache(uchar *, int)+40↑j
            0x9F, 0x3B, 0x03, 0xD5,                             // DSB             ISH
            0xE8, 0x17, 0x40, 0xF9,                             // LDR             X8, [SP,#0x30+var_8]
            0x08, 0xF5, 0x7E, 0x92,                             // AND             X8, X8, #0xFFFFFFFFFFFFFFFC
            0xE8, 0x0B, 0x00, 0xF9,                             // STR             X8, [SP,#0x30+var_20]

            //                              loc_5C8                                 ; CODE XREF: mono_arch_flush_icache(uchar *, int)+90↓j
            0xE8, 0x0B, 0x40, 0xF9,                             // LDR             X8, [SP,#0x30+var_20]
            0xE9, 0x0F, 0x40, 0xF9,                             // LDR             X9, [SP,#0x30+var_18]
            0x1F, 0x01, 0x09, 0xEB,                             // CMP             X8, X9
            0xE2, 0x00, 0x00, 0x54,                             // B.CS            loc_5F0
            0xE8, 0x0B, 0x40, 0xF9,                             // LDR             X8, [SP,#0x30+var_20]
            0x28, 0x75, 0x0B, 0xD5,                             // SYS             #3, c7, c5, #1, X8
            0xE8, 0x0B, 0x40, 0xF9,                             // LDR             X8, [SP,#0x30+var_20]
            0x08, 0x11, 0x00, 0x91,                             // ADD             X8, X8, #4
            0xE8, 0x0B, 0x00, 0xF9,                             // STR             X8, [SP,#0x30+var_20]
            0xF7, 0xFF, 0xFF, 0x17,                             // B               loc_5C8
            //                               ; ---------------------------------------------------------------------------

            //                               loc_5F0                                 ; CODE XREF: mono_arch_flush_icache(uchar *, int)+78↑j
            0x9F, 0x3B, 0x03, 0xD5,                             // DSB             ISH
            0xDF, 0x3F, 0x03, 0xD5,                             // ISB
            0xFF, 0xC3, 0x00, 0x91,                             // ADD             SP, SP, #0x30 ; '0'
            0xC0, 0x03, 0x5F, 0xD6,                             // RET
        };

#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
        [Flags]
        public enum Protection
        {
            PAGE_NOACCESS = 0x01,
            PAGE_READONLY = 0x02,
            PAGE_READWRITE = 0x04,
            PAGE_WRITECOPY = 0x08,
            PAGE_EXECUTE = 0x10,
            PAGE_EXECUTE_READ = 0x20


paused: Boolean) {
        this.paused = paused
        taskList.forEach { updateTaskPauseState(it, paused) }
    }

    override fun isIdle(): Boolean {
        return taskList.all { it.isRunning.not() }
    }

    override fun isPaused(): Boolean {
        return paused
    }

    override fun isRunning(): Boolean {
        return taskList.any { it.isRunning }
    }

    override fun isAnyTaskRunning(taskMatcher: (Task) -> Boolean): Boolean {
        return taskList.filter(taskMatcher).any { it.isRunning }
    }

    private fun updateTaskPauseState(task: Task, paused: Boolean) {
        if (paused) {
            task.pause()
        } else {
            task.resume()
        }
    }

    companion object {
        private const val TAG = "TaskManager"
    }
}package me.gegenbauer.catspy.glog

sealed class LogLevel(
    val logName: String,
    val intValue: Int
) {
    object NONE : LogLevel("None", 0)
    object VERBOSE : LogLevel("Verbose", 2)
    object DEBUG : LogLevel("Debug", 3)
    object INFO : LogLevel("Info", 4)
    object WARN : LogLevel("Warn", 5)
    object ERROR : LogLevel("Error", 6)
    object FATAL : LogLevel("Fatal", 7)

    operator fun compareTo(level: LogLevel?): Int {
        level ?: return 1
        return intValue.compareTo(level.intValue)
    }
}

private val logLevels = arrayListOf(
    LogLevel.NONE,
    LogLevel.VERBOSE,
    LogLevel.DEBUG,
    LogLevel.INFO,
    LogLevel.WARN,
    LogLevel.ERROR,
    LogLevel.FATAL
)

private val flagToLevelMap = logLevels.associateBy({ it.flag }, { it })

val nameToLogLevel = logLevels.associateBy({ it.logName }, { it })

fun getLevelFromFlag(flag: String): LogLevel {
    return flagToLevelMap[flag] ?: LogLevel.VERBOSE
}

fun getLevelFromName(flag: String): LogLevel {
    return nameToLogLevel[flag] ?: LogLevel.VERBOSE
}

val LogLevel.flag: String
    get() = logName.first().toString()package me.gegenbauer.catspy.glog.jdk

import me.gegenbauer.catspy.glog.LogFormatter
import me.gegenbauer.catspy.glog.LogLevel
import java.util.logging.Formatter
import java.util.logging.LogRecord

open class JdkLogFormatter(private val logFormatter: LogFormatter): Formatter() {
    override fun format(record: LogRecord): String {
        return logFormatter.format(
            me.gegenbauer.catspy.glog.LogRecord(
            record.millis,
            fromJdkLevel(record.level),
            record.loggerName,
            record.message,
            record.thrown
        ))
    }

    private fun fromJdkLevel(level: java.util.logging.Level): LogLevel {
        return when (level) {
            java.util.logging.Level.SEVERE -> LogLevel.ERROR
            java.util.logging.Level.WARNING -> LogLevel.WARN
            java.util.logging.Level.INFO -> LogLevel.INFO
            java.util.logging.Level.CONFIG -> LogLevel.DEBUG
            java.util.logging.Level.FINE -> LogLevel.DEBUG
            java.util.logging.Level.FINER -> LogLevel.DEBUG
            java.util.logging.Level.FINEST -> LogLevel.DEBUG
            else -> LogLevel.VERBOSE
        }
    }
}import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.kotlin

object Kotlin {
    val groupName = "org.jetbrains.kotlinx"
    val version = "1.8.22"

    val coroutineVersion = "1.7.1"
    val coroutineCore = Dependency(groupName, "kotlin


, 0, 0, 1, 0, 0, 0, 1, 0,
    0,     };

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

extern int yy_flex_debug;
int yy_flex_debug = 0;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "faustlexer.l"
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4 -*- */
/* Scanner for the Faust language */
#line 6 "faustlexer.l"
#include "tree.hh"
#include "faustparser.hpp"
#if defined(WIN32)
#if !defined(__MINGW32__) && !defined(__MSYS__)
// We don't want to include compatibility.hh here, since it pulls in whole lot
// of unneeded stuff which breaks other things, so here's some stuff to make
// MSVC happy.
#include <io.h>
#define isatty _isatty
#define fileno _fileno
#define YY_NO_UNISTD_H
#endif
#else
#include "compatibility.hh"
#include "errormsg.hh"

#define YY_FATAL_ERROR lexerror
#endif

#define register        // suppress the deprecated 'register' warning

#line 1235 "faustlexer.cpp"

#line 1237 "faustlexer.cpp"

#define INITIAL 0
#define comment 1
#define doc 2
#define lst 3

#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
 * down here because we want the user's section 1 to have been scanned first.
 * The user has a chance to override it with an option.
 */
#include <unistd.h>
#endif

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

static int yy_init_globals ( void );

/* Accessor methods to globals.
   These are made visible to non-reentrant scanners for convenience. */

int yylex_destroy ( void );

int yyget_debug ( void );

void yyset_debug ( int debug_flag  );

YY_EXTRA_TYPE yyget_extra ( void );

void yyset_extra ( YY_EXTRA_TYPE user_defined  );

FILE *yyget_in ( void );

void yyset_in  ( FILE * _in_str  );

FILE *yyget_out ( void );

void yyset_out  ( FILE * _out_str  );

			yy_size_t yyget_leng ( void );

char *yyget_text ( void );

int yyget_lineno ( void );

void yyset_lineno ( int _line_number  );

/* Macros after this point can all be overridden by user definitions in
 * section 1.
 */

#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap ( void );
#else
extern int yywrap ( void );
#endif
#endif

#ifndef YY_NO_UNPUT

#endif

#ifndef yytext_ptr
static void yy_flex_strncpy ( char *, const char *, int );
#endif

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen ( const char * );
#endif

#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput ( void );
#else
static int input ( void


              Title = "Pack Folder into .tcd"
            };

            var folderBrowserDialogSuccess = folderBrowserDialog.ShowDialog();
            if (folderBrowserDialogSuccess == CommonFileDialogResult.Ok)
            {
                var fileBase = new DirectoryInfo(Path.GetFullPath(folderBrowserDialog.FileName)).Name;
                TCDEncodeDecode.PackTCDFile(
                    folderBrowserDialog.FileName,
                    fileBase,
                    (fileName, progress) =>
                    {
                        this.ProgressStatus = fileName;
                        this.Progress = progress;
                });
            }
        }

        public void OpenErrors()
        {
            ErrorsWindow.ShowWindow();
        }

        public void DataDump()
        {
            DataDumpWindow.ShowWindow();
        }
    }
}


es.fromJson(core.Map json_)
    : this(
        canDelete: json_['canDelete'] as core.bool?,
        canDisable: json_['canDisable'] as core.bool?,
        canEnable: json_['canEnable'] as core.bool?,
        canUpdate: json_['canUpdate'] as core.bool?,
      );

  core.Map<core.String, core.dynamic> toJson() => {
    if (canDelete != null) 'canDelete': canDelete!,
    if (canDisable != null) 'canDisable': canDisable!,
    if (canEnable != null) 'canEnable': canEnable!,
    if (canUpdate != null) 'canUpdate': canUpdate!,
  };
}

/// Options for the selection field type.
class GoogleAppsDriveLabelsV2FieldSelectionOptions {
  /// The options available for this selection field.
  ///
  /// The list order is consistent, and modified with `insert_before_choice`.
  core.List<GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice>? choices;

  /// When specified, indicates this field supports a list of values.
  ///
  /// Once the field is published, this cannot be changed.
  GoogleAppsDriveLabelsV2FieldListOptions? listOptions;

  GoogleAppsDriveLabelsV2FieldSelectionOptions({
    this.choices,
    this.listOptions,
  });

  GoogleAppsDriveLabelsV2FieldSelectionOptions.fromJson(core.Map json_)
    : this(
        choices:
            (json_['choices'] as core.List?)
                ?.map(
                  (value) =>
                      GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice.fromJson(
                        value as core.Map<core.String, core.dynamic>,
                      ),
                )
                .toList(),
        listOptions:
            json_.containsKey('listOptions')
                ? GoogleAppsDriveLabelsV2FieldListOptions.fromJson(
                  json_['listOptions'] as core.Map<core.String, core.dynamic>,
                )
                : null,
      );

  core.Map<core.String, core.dynamic> toJson() => {
    if (choices != null) 'choices': choices!,
    if (listOptions != null) 'listOptions': listOptions!,
  };
}

/// Selection field choice.
class GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice {
  /// The capabilities related to this choice on applied metadata.
  ///
  /// Output only.
  GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities?
  appliedCapabilities;

  /// The time this choice was created.
  ///
  /// Output only.
  core.String? createTime;

  /// The user who created this choice.
  ///
  /// Output only.
  GoogleAppsDriveLabelsV2UserInfo? creator;

  /// The time this choice was disabled.
  ///
  /// This value has no meaning when the choice is not disabled.
  ///
  /// Output only.
  core.String? disableTime;

  /// The user who disabled this choice.
  ///
  /// This value has no meaning when the option is not disabled.
  ///
  /// Output only.
  GoogleAppsDriveLabelsV2UserInfo? disabler;

  /// UI display hints for rendering a choice.
  ///
  /// Output only.
  GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints? displayHints;

  /// The unique value of the choice.
  ///
  /// This ID is autogenerated. Matches the regex: `([a-zA-Z0-9_])+`.
  core.String? id;

  /// Lifecycle of the choice.
  ///
  /// Output only.
  GoogleAppsDriveLabelsV2Lifecycle? lifecycle;

  /// The `LockStatus` of this choice.
  ///
  /// Output only.
  GoogleAppsDriveLabelsV2LockStatus? lockStatus;

  /// Basic properties of the choice.
  GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties? properties;

  /// The time this choice was published.
  ///
  /// This value has no meaning when the choice is not published.
  ///
  /// Output only


b
 * block filled in and handles the request.
 */

int request_handle_processed(Session *sn, Request *rq);

/*
 * Complete a request by finding the service function and using it. Returns
 * REQ_NOACTION if no matching function was found.
 */

int request_service(Session *sn, Request *rq);

/*
 * request_handle handles one request from the session's inbuf.
 */

void request_handle(Session *sn);

/*
 * Moved here due to problems with interdependency. See object.h for
 * description.
 */

int object_findnext(Session *sn, Request *rq, httpd_object *obj);
int object_pathcheck(Session *sn, Request *rq, httpd_object *obj);
int object_findinfo(Session *sn, Request *rq, httpd_object *obj);
int object_findservice(Session *sn, Request *rq, httpd_object *obj);
int object_finderror(Session *sn, Request *rq, httpd_object *obj);
int object_findlogs(Session *sn, Request *rq, httpd_object *obj);

#endif


uted = null,Object? isPlaying = null,Object? songWithProgress = freezed,}) {
  return _then(_PlaybackState(
volume: null == volume ? _self.volume : volume // ignore: cast_nullable_to_non_nullable
as double,previousVolume: freezed == previousVolume ? _self.previousVolume : previousVolume // ignore: cast_nullable_to_non_nullable
as double?,isMuted: null == isMuted ? _self.isMuted : isMuted // ignore: cast_nullable_to_non_nullable
as bool,isPlaying: null == isPlaying ? _self.isPlaying : isPlaying // ignore: cast_nullable_to_non_nullable
as bool,songWithProgress: freezed == songWithProgress ? _self.songWithProgress : songWithProgress // ignore: cast_nullable_to_non_nullable
as SongWithProgress?,
  ));
}

/// Create a copy of PlaybackState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SongWithProgressCopyWith<$Res>? get songWithProgress {
    if (_self.songWithProgress == null) {
    return null;
  }

  return $SongWithProgressCopyWith<$Res>(_self.songWithProgress!, (value) {
    return _then(_self.copyWith(songWithProgress: value));
  });
}
}

/// @nodoc
mixin _$SongWithProgress {

 Duration get progress; Song get song;
/// Create a copy of SongWithProgress
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SongWithProgressCopyWith<SongWithProgress> get copyWith => _$SongWithProgressCopyWithImpl<SongWithProgress>(this as SongWithProgress, _$identity);

@override
bool operator ==(Object other) {
  return identical(this, other) || (other.runtimeType == runtimeType&&other is SongWithProgress&&(identical(other.progress, progress) || other.progress == progress)&&(identical(other.song, song) || other.song == song));
}

@override
int get hashCode => Object.hash(runtimeType,progress,song);

@override
String toString() {
  return 'SongWithProgress(progress: $progress, song: $song)';
}

}

/// @nodoc
abstract mixin class $SongWithProgressCopyWith<$Res>  {
  factory $SongWithProgressCopyWith(SongWithProgress value, $Res Function(SongWithProgress) _then) = _$SongWithProgressCopyWithImpl;
@useResult
$Res call({
 Duration progress, Song song
});

}
/// @nodoc
class _$SongWithProgressCopyWithImpl<$Res>
    implements $SongWithProgressCopyWith<$Res> {
  _$SongWithProgressCopyWithImpl(this._self, this._then);

  final SongWithProgress _self;
  final $Res Function(SongWithProgress) _then;

/// Create a copy of SongWithProgress
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? progress = null,Object? song = null,}) {
  return _then(_self.copyWith(
progress: null == progress ? _self.progress : progress // ignore: cast_nullable_to_non_nullable
as Duration,song: null == song ? _self.song : song // ignore: cast_nullable_to_non_nullable
as Song,
  ));
}

}

/// Adds pattern-matching-related methods to [SongWithProgress].
extension SongWithProgressPatterns on SongWithProgress {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
///   case final Subclass value:
///     return ...;
///   case _:
///     return orElse();
/// }
/// ```

@optionalTypeArgs TResult maybeMap


// SPDX-License-Identifier: GPL-2.0
#ifndef FILTERCONSTRAINTWIDGET_H
#define FILTERCONSTRAINTWIDGET_H

#include "core/filterconstraint.h"
#include <QWidget>
#include <memory>

class FilterConstraintModel;
class QComboBox;
class QDateEdit;
class QDoubleSpinBox;
class QGridLayout;
class QHBoxLayout;
class QLabel;
class QLineEdit;
class QListWidget;
class QPushButton;
class QTimeEdit;
class StarWidget;

// Technically, this is not a single widget, but numerous widgets,
// which are added to the row of a QGridLayout
class FilterConstraintWidget : public QObject {
	Q_OBJECT
public:
	FilterConstraintWidget(FilterConstraintModel *model, const QModelIndex &index, QGridLayout *layout);
	~FilterConstraintWidget();
	void moveToRow(int row); // call if the row of the widget has changed.
				 // this will update the index used to access the model as well as the position in the layout
	void update();
private
slots:
	void trash();
	void stringEdited(const QString &s);
	void multipleChoiceEdited();
	void negateEdited(int index);
	void rangeModeEdited(int index);
	void stringModeEdited(int index);
	void fromEditedInt(int i);
	void toEditedInt(int i);
	void fromEditedFloat(double f);
	void toEditedFloat(double f);
	void fromEditedTimestamp(const QDateTime &datetime);
	void toEditedTimestamp(const QDateTime &datetime);
private:
	QGridLayout *layout;
	FilterConstraintModel *model;
	int row;
	const filter_constraint_type type; // we don't support changing the type
	void addToLayout();
	void removeFromLayout();

	std::unique_ptr<QHBoxLayout> rangeLayout;
	std::unique_ptr<QPushButton> trashButton;
	std::unique_ptr<QLabel> typeLabel;
	std::unique_ptr<QComboBox> negate;
	std::unique_ptr<QComboBox> stringMode;
	std::unique_ptr<QComboBox> rangeMode;
	std::unique_ptr<QListWidget> multipleChoice;
	std::unique_ptr<QLineEdit> string;
	std::unique_ptr<StarWidget> starFrom, starTo;
	std::unique_ptr<QDoubleSpinBox> spinBoxFrom, spinBoxTo;
	std::unique_ptr<QDateEdit> dateFrom, dateTo;
	std::unique_ptr<QTimeEdit> timeFrom, timeTo;
	std::unique_ptr<QLabel> unitFrom, unitTo;
	std::unique_ptr<QLabel> toLabel;
};

#endif


          beamTargets[i].target.GetEntity()->Damage(this, owner.GetEntity(), org, damageFreq, (damagePower) ? damagePower : 1.0f, INVALID_JOINT);
                }
                else
                {
                    beamTargets[i].renderEntity.shaderParms[ SHADERPARM_RED ] =
                        beamTargets[i].renderEntity.shaderParms[ SHADERPARM_GREEN ] =
                            beamTargets[i].renderEntity.shaderParms[ SHADERPARM_BLUE ] =
                                beamTargets[i].renderEntity.shaderParms[ SHADERPARM_ALPHA ] = 0.0f;
                    bfgVision = false;
                }

                if (player)
                {
                    player->playerView.EnableBFGVision(bfgVision);
                }

                nextDamageTime = gameLocal.time + BFG_DAMAGE_FREQUENCY;
            }

            gameRenderWorld->UpdateEntityDef(beamTargets[i].modelDefHandle, &beamTargets[i].renderEntity);
        }

        if (secondModelDefHandle >= 0)
        {
            secondModel.origin = GetPhysics()->GetOrigin();
            gameRenderWorld->UpdateEntityDef(secondModelDefHandle, &secondModel);
        }

        idAngles ang;

        ang.pitch = (gameLocal.time & 4095) * 360.0f / -4096.0f;
        ang.yaw = ang.pitch;
        ang.roll = 0.0f;
        SetAngles(ang);

        ang.pitch = (gameLocal.time & 2047) * 360.0f / -2048.0f;
        ang.yaw = ang.pitch;
        ang.roll = 0.0f;
        secondModel.axis = ang.ToMat3();

        UpdateVisuals();
    }

    idProjectile::Think();
}

/*
=================
idBFGProjectile::Launch
=================
*/
void idBFGProjectile::Launch(const idVec3 &start, const idVec3 &dir, const idVec3 &pushVelocity, const float timeSinceFire, const float power, const float dmgPower)
{
    idProjectile::Launch(start, dir, pushVelocity, 0.0f, power, dmgPower);

    // dmgPower * radius is the target acquisition area
    // acquisition should make sure that monsters are not dormant
    // which will cut down on hitting monsters not actively fighting
    // but saves on the traces making sure they are visible
    // damage is not applied until the projectile explodes

    idEntity 	*ent;
    idEntity 	*entityList[ MAX_GENTITIES ];
    int			numListedEntities;
    idBounds	bounds;
    idVec3		damagePoint;

    float radius;
    spawnArgs.GetFloat("damageRadius", "512", radius);
    bounds = idBounds(GetPhysics()->GetOrigin()).Expand(radius);

    float beamWidth = spawnArgs.GetFloat("beam_WidthFly");
    const char *skin = spawnArgs.GetString("skin_beam");

    memset(&secondModel, 0, sizeof(secondModel));
    secondModelDefHandle = -1;
    const char *temp = spawnArgs.GetString("model_two");

    if (temp && *temp)
    {
        secondModel.hModel = renderModelManager->FindModel(temp);
        secondModel.bounds = secondModel.hModel->Bounds(&secondModel);
        secondModel.shaderParms[ SHADERPARM_RED ] =
            secondModel.shaderParms[ SHADERPARM_GREEN ] =
                secondModel.shaderParms[ SHADERPARM_BLUE ] =
                    secondModel.shaderParms[ SHADERPARM_ALPHA ] = 1.0f;
        secondModel.noSelfShadow = true;
        secondModel.noShadow = true;
        secondModel.origin = GetPhysics()->GetOrigin();
        secondModel.axis = GetPhysics()->GetAxis();
        secondModelDefHandle = gameRenderWorld->


		_icon = icon;
			Compiler.Uncache(this);
		}

		if (testScriptId != _testScriptId) {
			_testScriptId = testScriptId;
		}
	}
}

enum FOSync { UserFileOp, UserFileWrite, FilesXml, PrivateFileWrite }


      setHsvMode(value)
    }

  var presetsEnabled: Boolean
    get() {
       return arePresetsEnabled()
    }
    set(value) {
      setPresetsEnabled(value)
    }

  var presetsVisible: Boolean
    get() {
       return arePresetsVisible()
    }
    set(value) {
      setPresetsVisible(value)
    }

  var rawMode: Boolean
    get() {
       return isRawMode()
    }
    set(value) {
      setRawMode(value)
    }

  /**
   * ColorPicker::color_changed signal
   */
  val signalColorChanged: Signal1<Color> = Signal1("color_changed")

  /**
   * ColorPicker::preset_added signal
   */
  val signalPresetAdded: Signal1<Color> = Signal1("preset_added")

  /**
   * ColorPicker::preset_removed signal
   */
  val signalPresetRemoved: Signal1<Color> = Signal1("preset_removed")

  constructor() : this(null) {
    if (Godot.shouldInitHandle()) {
      _handle = __new()
    }
  }

  /**
   * Specialized setter for color
   */
  fun color(cb: Color.() -> Unit) {
    val _p = color
    cb(_p)
    color = _p
  }

  open fun _add_preset_pressed() {
    TODO()
  }

  open fun _focus_enter() {
    TODO()
  }

  open fun _focus_exit() {
    TODO()
  }

  open fun _hsv_draw(arg0: Int, arg1: Control) {
    TODO()
  }

  open fun _html_entered(arg0: String) {
    TODO()
  }

  open fun _html_focus_exit() {
    TODO()
  }

  open fun _preset_input(arg0: InputEvent) {
    TODO()
  }

  open fun _sample_draw() {
    TODO()
  }

  open fun _screen_input(arg0: InputEvent) {
    TODO()
  }

  open fun _screen_pick_pressed() {
    TODO()
  }

  open fun _text_type_toggled() {
    TODO()
  }

  open fun _update_presets() {
    TODO()
  }

  open fun _uv_input(arg0: InputEvent) {
    TODO()
  }

  open fun _value_changed(arg0: Float) {
    TODO()
  }

  open fun _w_input(arg0: InputEvent) {
    TODO()
  }

  fun addPreset(color: Color) {
    val self = this
    return Allocator.allocationScope {
      __method_bind.addPreset.call(self._handle, listOf(color), null)
    }
  }

  fun arePresetsEnabled(): Boolean {
    val self = this
    return Allocator.allocationScope {
      val _ret = alloc<BooleanVar>()
      val _retPtr = _ret.ptr
      __method_bind.arePresetsEnabled.call(self._handle, emptyList(), _retPtr)
      _ret.value
    }
  }

  fun arePresetsVisible(): Boolean {
    val self = this
    return Allocator.allocationScope {
      val _ret = alloc<BooleanVar>()
      val _retPtr = _ret.ptr
      __method_bind.arePresetsVisible.call(self._handle, emptyList(), _retPtr)
      _ret.value
    }
  }

  fun erasePreset(color: Color) {
    val self = this
    return Allocator.allocationScope {
      __method_bind.erasePreset.call(self._handle, listOf(color), null)
    }
  }

  fun getPickColor(): Color {
    val self = this
    return Allocator.allocationScope {
      val _ret = Color()
      val _retPtr = _ret._value.ptr
      __method_bind.getPickColor.call(self._handle, emptyList(), _retPtr)
      _ret.


行われていました。いくつかの要素を「非推奨」という、現仕様で定義されるが将来的に削除される事を明記したのです。こうすることで、より意味的な HTML の利用を推奨しようとしていました (詳しくは Web 標準のモデル をご覧ください)。

1999 年には改訂版である HTML 4.01 が公開されました (2001 年に正誤表が更新されています)。これが HTML の最終版になります。しかしながら、現在 HTML 5 の策定が進んでいる最中です。

2000 年に、W3C は XHTML 1.0 仕様を公開しました。これは、HTML を valid な XML 文書フォーマットになるよう再構成したものです。

HTML 文書の構造

シンプルで valid な HTML 文書は、次のようなものになるでしょう。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>サンプルページ</title>
  </head>
  <body>
    <h1>Hello world.</h1>
  </body>
</html>

HTML 文書は、「文書型」もしくは「DOCTYPE 宣言」と呼ばれるものから始まります (詳しくは Choosing the right doctype… をお読みください) 。DOCTYPE 宣言は、どのバージョンの HTML が利用されているか説明するものです。DOCTYPE 宣言があることで、ブラウザーはどのように文書を解釈すればよいのか、またその文書が仕様に従って書かれているのかを調べることができるわけです。

DOCTYPE 宣言の次にあるのが、html 要素の開始タグになります。これが、文書全体を囲む要素になります。ですから、html 要素の終了タグは、文書の最後に登場します。

html 要素の中には head 要素があります。これは、文書に関する情報 (メタデータ) を格納する部分になります。head 要素については 次の記事 でもっと詳しく解�


to de treinamento quanto o nome do experimento são suportados, e os erros não serão mais relatados)
- A lista de arquivos cancela a codificação utf8 obrigatória
- Resolver o problema de consumo de CPU causado pela busca do faiss durante alterações de voz em tempo real

Atualizações do 2-Key
- Treine o modelo de extração de pitch vocal de código aberto mais forte do momento, o RMVPE, e use-o para treinamento de RVC, inferência off-line/em tempo real, com suporte a PyTorch/Onnx/DirectML
- Suporte para placas gráficas AMD e Intel por meio do Pytorch_DML

(1) Mudança de voz em tempo real (2) Inferência (3) Separação do acompanhamento vocal (4) Não há suporte para treinamento no momento, mudaremos para treinamento de CPU; há suporte para inferência RMVPE de gpu por Onnx_Dml

### 2023-06-18
- Novos modelos v2 pré-treinados: 32k e 48k
- Correção de erros de inferência de modelo não-f0
- Para conjuntos de treinamento que excedam 1 hora, faça minibatch-kmeans automáticos para reduzir a forma dos recursos, de modo que o treinamento, a adição e a pesquisa do Index sejam muito mais rápidos.
- Fornecer um espaço de brinquedo vocal2guitar huggingface
- Exclusão automática de áudios de conjunto de treinamento de atalhos discrepantes
- Guia de exportação Onnx

Experimentos com falha:
- ~~Recuperação de recurso: adicionar recuperação de recurso temporal: não eficaz~~
- ~~Recuperação de recursos: adicionar redução de dimensionalidade PCAR: a busca é ainda mais lenta~~
- ~~Aumento de dados aleatórios durante o treinamento: não é eficaz~~

Lista de tarefas：
- ~~Vocos-RVC (vocoder minúsculo): não é eficaz~~
- ~~Suporte de crepe para treinamento: substituído pelo RMVPE~~
- ~~Inferência de crepe de meia precisão：substituída pelo RMVPE. E difícil de conseguir.


e: Int) {
        // add types here
        IMPORTED(0),
        GENERATED(1),
        LEDGER_NANO_X(2),
        KEYSTONE(3);

        companion object {
            fun get(value: Int) = when (value) {
                0 -> IMPORTED
                1 -> GENERATED
                2 -> LEDGER_NANO_X
                3 -> KEYSTONE
                else -> IMPORTED
            }
        }
    }

    companion object {
        const val TABLE_NAME = "owners"

        const val COL_ADDRESS = "address"
        const val COL_NAME = "name"
        const val COL_TYPE = "type"
        const val COL_PRIVATE_KEY = "private_key"
        const val COL_SEED_PHRASE = "seed_phrase"
        const val COL_KEY_DERIVATION_PATH = "derivation_path"
        const val COL_SOURCE_FINGERPRINT = "source_fingerprint"
    }
}

class OwnerTypeConverter {
    @TypeConverter
    fun toType(typeValue: Int): Owner.Type {
        return Owner.Type.get(typeValue)
    }

    @TypeConverter
    fun toValue(type: Owner.Type): Int {
        return type.value
    }
}
package io.gnosis.data.repositories

import io.gnosis.data.backend.GatewayApi
import io.gnosis.data.models.Page
import io.gnosis.data.models.Safe
import io.gnosis.data.models.transaction.*
import io.gnosis.data.utils.toSignatureString
import pm.gnosis.crypto.KeyPair
import pm.gnosis.crypto.utils.asEthereumAddressChecksumString
import pm.gnosis.model.Solidity
import pm.gnosis.utils.asEthereumAddress
import pm.gnosis.utils.hexToByteArray
import pm.gnosis.utils.removeHexPrefix
import java.math.BigInteger

class TransactionRepository(
    private val gatewayApi: GatewayApi
) {

    suspend fun getQueuedTransactions(safe: Safe): Page<TxListEntry> =
        gatewayApi.loadTransactionsQueue(chainId = safe.chainId, address = safe.address.asEthereumAddressChecksumString())

    suspend fun getHistoryTransactions(safe: Safe): Page<TxListEntry> =
        gatewayApi.loadTransactionsHistory(chainId = safe.chainId, address = safe.address.asEthereumAddressChecksumString())

    suspend fun loadTransactionsPage(pageLink: String): Page<TxListEntry> =
        gatewayApi.loadTransactionsPage(pageLink)

    suspend fun getTransactionDetails(chainId: BigInteger, txId: String): TransactionDetails =
        gatewayApi.loadTransactionDetails(transactionId = txId, chainId = chainId)

    suspend fun submitConfirmation(safeTxHash: String, signedSafeTxHash: String, chainId: BigInteger): TransactionDetails =
        gatewayApi.submitConfirmation(safeTxHash = safeTxHash, txConfirmationRequest = TransactionConfirmationRequest(signedSafeTxHash), chainId = chainId)

    suspend fun estimateTransaction(
        chainId: BigInteger,
        safeAddress: Solidity.Address,
        to: Solidity.Address,
        value: BigInteger = BigInteger.ZERO,
        data: String? = null,
        operation: Operation = Operation.DELEGATE,
    ): TransactionEstimation {
        return gatewayApi.estimateTransaction(
            chainId,
            safeAddress.asEthereumAddressChecksumString(),
            TransactionEstimationRequest(
                to,
                value,
                data,
                operation,
                chainId
            )
        )
    }

    suspend fun proposeTransaction(
        chainId: BigInteger,
        safeAddress: Solidity.Address,
        toAddress: Solidity.Address,
        value: BigInteger = BigInteger.ZERO,
        data: String? = null,
        nonce: BigInteger,
        operation: Operation = Operation.CALL,


.matchers.shouldNotBe
import java.io.File

class GeneralStyleTest :
    BehaviorSpec({
        Given("Correct trime.yaml") {
            val dir = File("src/test/assets")
            Rime.startupRime(
                dir.absolutePath,
                dir.absolutePath,
                BuildConfig.BUILD_VERSION_NAME,
                false,
            )

            When("loaded") {
                val generalStyle = Theme.decodeByConfigId("trime").generalStyle

                Then("it should not be null") {
                    generalStyle shouldNotBe null
                    generalStyle.autoCaps shouldBe "false"

                    generalStyle.candidateFont shouldBe listOf("han.ttf")
                }
            }

            Rime.exitRime()
        }

        Given("Empty trime.yaml") {
            val dir = File("src/test/assets")
            Rime.startupRime(
                dir.absolutePath,
                dir.absolutePath,
                BuildConfig.BUILD_VERSION_NAME,
                false,
            )

            When("loaded") {
                val generalStyle = Theme.decodeByConfigId("incorrect").generalStyle

                Then("with default value without exception") {
                    generalStyle.autoCaps shouldBe ""
                    generalStyle.candidateBorder shouldBe 0
                    generalStyle.candidateFont shouldBe emptyList()
                    generalStyle.commentPosition shouldBe GeneralStyle.CommentPosition.UNKNOWN

                    generalStyle.enterLabel shouldNotBe null
                    generalStyle.enterLabel.go shouldBe "go"
                }
            }

            Rime.exitRime()
        }
    })
// SPDX-FileCopyrightText: 2015 - 2024 Rime community
//
// SPDX-License-Identifier: GPL-3.0-or-later

package com.osfans.trime.util

import android.content.res.Resources
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Color
import android.graphics.Rect
import android.graphics.drawable.NinePatchDrawable
import android.util.DisplayMetrics
import timber.log.Timber
import java.io.File
import java.nio.ByteBuffer
import java.nio.ByteOrder

/**
 * Read non-compiled Nine Patch image from file system.
 * https://stackoverflow.com/a/29824210
 */
object NinePatchBitmapFactory {
    private const val NO_COLOR = 0x00000001
    private const val TRANSPARENT_COLOR = 0x00000000

    fun createNinePatchDrawable(
        res: Resources?,
        bitmap: Bitmap,
    ): NinePatchDrawable {
        val rangeLists = checkBitmap(bitmap)
        val trimedBitmap = trimBitmap(bitmap)
        return createNinePatchWithCapInsets(
            res,
            trimedBitmap,
            rangeLists.rangeListX,
            rangeLists.rangeListY,
            null,
        )
    }

    private fun createNinePatchWithCapInsets(
        res: Resources?,
        bitmap: Bitmap,
        rangeListX: List<Range>,
        rangeListY: List<Range>,
        srcName: String?,
    ): NinePatchDrawable {
        val buffer =
            getByteBuffer(rangeListX, rangeListY)
        return NinePatchDrawable(res, bitmap, buffer.array(), Rect(), srcName)
    }

    private fun getByteBuffer(
        rangeListX: List<Range>,
        rangeListY: List<Range>,
    ): ByteBuffer {
        val buffer =
            ByteBuffer
                .allocate(4 + 4 * 7 + 4 * 2 * rangeListX.size + 4 * 2 * rangeListY.size + 4 * 9)
                .order(
                    ByteOrder.nativeOrder(),
                )
        buffer.put(0x01.toByte()) // was serialised
        buffer.put((rangeListX.size *


/*
 * Copyright (c) 2024 Jiri Svoboda
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * - Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * - Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 * - The name of the author may not be used to endorse or promote products
 *   derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/** @addtogroup taskbar-cfg
 * @{
 */
/**
 * @file Start menu configuration tab
 */

#ifndef STARTMENU_H
#define STARTMENU_H

#include <tbarcfg/tbarcfg.h>
#include "types/startmenu.h"
#include "types/taskbar-cfg.h"

extern errno_t startmenu_create(taskbar_cfg_t *, startmenu_t **);
extern errno_t startmenu_populate(startmenu_t *, tbarcfg_t *);
extern void startmenu_destroy(startmenu_t *);
extern errno_t startmenu_insert(startmenu_t *, smenu_entry_t *,
    startmenu_entry_t **);
extern startmenu_entry_t *startmenu_get_selected(startmenu_t *);
extern void startmenu_new_entry(startmenu_t *);
extern void startmenu_sep_entry(startmenu_t *);
extern void startmenu_edit(startmenu_t *);
extern errno_t startmenu_entry_update(startmenu_entry_t *);
extern void startmenu_repaint(startmenu_t *);

#endif

/** @}
 */


S1 : str = "GAGCCTACTAACGGGAT"
S2 : str = "CATCGTAATGACGGCCT"

def d_h(S1: str, S2: str) -> int:
    hamming_distance = 0
    # s1とs2をそれぞれ同時に左から巡回
    for i,j in zip(S1, S2):
        if i != j:
            hamming_distance += 1
    return hamming_distance

print(d_h(S1, S2))
```

上記の処理を高速化すると以下のようになる。

```python
S1 : str = "GAGCCTACTAACGGGAT"
S2 : str = "CATCGTAATGACGGCCT"

hamming_distance = sum([1 for i in range(len(S1)) if S1[i] != S2[i]])
print(hamming_distance)
```

## モチーフの探索

例えば以下のような塩基配列のうち、モチーフMの開始indexは以下のようになる。
(pythonのインデックスは1ではなく0からスタートすることに注意)
```Python
DNA : str = "GATATATGCATATACTT"
M : str = "ATAT"

#モチーフの開始インデックスは
# 1, 3, 9の3つ
```

上記のようなモチーフの開始インデックスを探索する方法について考える。
無数の方法があるが、シンプルでわかりやすい方法を考えた。

始めに、pythonのリストのappend構文の例を示す。

```python
a : list = []
a.append(1)
a.append(2)
a.append(3)

# a = [1,2,3]

b : list = []
for i in range(1,4):
    b.append(i)

# b = [1,2,3]
```

モチーフ探索アルゴリズム

```python
DNA : str = "GATATATGCATATACTT"
M : str = "ATAT"

def find_motif_1(DNA: str, M: str) -> list:
    motif_indices = []
    for i in range(len(DNA)-len(M)+1):
        if DNA[i:i+len(M)] == M:
            motif_indices.append(i)
    return motif_indices

print(find_motif_1(DNA, M))
```

言葉で説明すれば、モチーフMをDNA配列の左側から一つずつ右にずらしながら比較し、一致する場合にそのインデックスをmotif_indicesにappendする。

このような処理をシンプルに書くと以下のようになる。

```python
def find_motif_2(DNA: str, M: str) -> list:
    return [i for i in range(len(DNA)-len(M)+1) if DNA[i:i+len(M)] == M]

print(find_motif_2(DNA, M))
```

## 最長共通モチーフの探索アルゴリズム

複数の塩基配列から共通するモチーフのうち最長のものを探索する場合について考える。

### ファイルの読み込み

FASTAフォーマットで与えられるテキストデータをpythonで読み込むには、以下のファイル読み込みの構文を使用する。この構文はcsvやexcelなどさまざまなファイルを読み込む際にも使用するため、頻


:	00          	halt
   5fc40:	73 00       	tstd $0x0 [d-float]
   5fc42:	00          	halt
   5fc43:	00          	halt
   5fc44:	1d 00       	bvs 5fc46 <op+0xdea>
   5fc46:	00          	halt
   5fc47:	00          	halt
   5fc48:	04          	ret
   5fc49:	00          	halt
   5fc4a:	00          	halt
   5fc4b:	00          	halt
   5fc4c:	70 00 00    	movd $0x0 [d-float],$0x0 [d-float]
   5fc4f:	00          	halt
   5fc50:	01          	nop
   5fc51:	01          	nop
   5fc52:	00          	halt
   5fc53:	00          	halt
   5fc54:	29 00 00 00 	cmpc3 $0x0,$0x0,$0x0
   5fc58:	04          	ret
   5fc59:	00          	halt
   5fc5a:	00          	halt
   5fc5b:	00          	halt
   5fc5c:	70 00 00    	movd $0x0 [d-float],$0x0 [d-float]
   5fc5f:	00          	halt
   5fc60:	fd 00       	.word 0xfd00
   5fc62:	00          	halt
   5fc63:	00          	halt
   5fc64:	28 00 00 00 	movc3 $0x0,$0x0,$0x0
   5fc68:	04          	ret
   5fc69:	00          	halt
   5fc6a:	00          	halt
   5fc6b:	00          	halt
   5fc6c:	70 00 00    	movd $0x0 [d-float],$0x0 [d-float]
   5fc6f:	00          	halt
   5fc70:	02          	rei
   5fc71:	01          	nop
   5fc72:	00          	halt
   5fc73:	00          	halt
   5fc74:	27 00 00 00 	divp $0x0,$0x0,$0x0,$0x4,$0x0,$0x0
   5fc78:	04 00 00
   5fc7b:	00          	halt
   5fc7c:	70 00 00    	movd $0x0 [d-float],$0x0 [d-float]
   5fc7f:	00          	halt
   5fc80:	fe 00       	.word 0xfe00
   5fc82:	00          	halt
   5fc83:	00          	halt
   5fc84:	26 00 00 00 	cvttp $0x0,$0x0,$0x0,$0x4,$0x0
   5fc88:	04 00
   5fc8a:	00          	halt
   5fc8b:	00          	halt
   5fc8c:	70 00 00    	movd $0x0 [d-float],$0x0 [d-float]
   5fc8f:	00          	halt
   5fc90:	03          	bpt
   5fc91:	01          	nop
   5fc92:	00          	halt
   5fc93:	00          	halt
   5fc94:	25 00 00 00 	mulp $0x0,$0x0,$0x0,$0x4,$0x0,$0x0
   5fc98:	04 00 00
   5fc9b:	00          	halt
   5fc9c:	70 00 00    	movd $0x0 [d-float],$0x0 [d-float]
   5fc9f:	00          	halt
   5fca0:	ff 00       	.word 0xff00
   5fca2:	00          	halt
   5fca3


5.32-.16.45-.29.13-.13.23-.29.3-.47V1H5a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h6a2 2 0 0 0 2-2v-1.1ZM9.59 8.48a.5.5 0 0 0-.09-.99H6.41a.5.5 0 0 0 .09 1h3.09Zm.41 3a.5.5 0 0 1-.41.5H6.5a.5.5 0 0 1-.09-.99H9.5c.28 0 .5.22.5.5Z\"/>") { } }
    public class DocumentPdf : Icon { public DocumentPdf() : base("DocumentPdf", IconVariant.Regular, IconSize.Size16, "<path d=\"M2.5 10a1.5 1.5 0 0 1 0 3H2v1.5a.5.5 0 0 1-1 0v-4c0-.28.22-.5.5-.5h1ZM2 12h.5a.5.5 0 0 0 0-1H2v1Zm4-2c.83 0 1.5.67 1.5 1.5v2c0 .83-.67 1.5-1.5 1.5H5a.5.5 0 0 1-.5-.5v-4c0-.28.22-.5.5-.5h1Zm-.5 4H6a.5.5 0 0 0 .5-.5v-2A.5.5 0 0 0 6 11h-.5v3Zm5.5-4a.5.5 0 0 1 0 1H9.5v1h1a.5.5 0 0 1 0 1h-1v1.5a.5.5 0 0 1-1 0v-4c0-.28.22-.5.5-.5h2ZM9.59 1c.39 0 .78.16 1.06.44l2.91 2.91c.28.28.44.67.44 1.06V13a2 2 0 0 1-2 2h-1.59c.06-.16.09-.32.09-.5V14H12a1 1 0 0 0 1-1V6h-2.5A1.5 1.5 0 0 1 9 4.5V2H6a1 1 0 0 0-1 1v6c-.38 0-.73.15-1 .38V3c0-1.1.9-2 2-2h3.59ZM10 4.5c0 .28.22.5.5.5h2.29L10 2.21V4.5Z\"/>") { } }
    public class DocumentPerson : Icon { public DocumentPerson() : base("DocumentPerson", IconVariant.Regular, IconSize.Size16, "<path d=\"M5 1a2 2 0 0 0-2 2v2.4c.3-.17.64-.3 1-.36V3a1 1 0 0 1 1-1h3v2.5C8 5.33 8.67 6 9.5 6H12v7a1 1 0 0 1-1 1H8.63c-.19.36-.45.7-.8.98L7.8 15H11a2 2 0 0 0 2-2V5.41c0-.4-.16-.78-.44-1.06L9.65 1.44A1.5 1.5 0 0 0 8.59 1H5Zm6.8 4H9.5a.5.5 0 0 1-.5-.5V2.2L11.8 5ZM6.5 8a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 12.5C8 13.75 7 15 4.5 15S1 13.75 1 12.5c0-.83.67-1.5 1.5-1.5h4c.83 0 1.5.67 1.5 1.5Z\"/>") { } }
    public class DocumentPy : Icon { public DocumentPy() : base("DocumentPy", IconVariant.Regular, IconSize.Size16, "<path d=\"m9.65 1.44 2.91 2.91c.28.28.44.67


erial data.
#[derive(Debug, Clone, Default)]
pub struct AabbIntersector {
    pub pos: Vector3,
    pub size: Vector3,
}

impl Intersect for AabbIntersector {
    fn intersect(&self, ray: &Ray) -> Option<Hit> {
        let ro = ray.origin - self.pos;
        let s = Vector3::new(
            -ray.direction.x.signum(),
            -ray.direction.y.signum(),
            -ray.direction.z.signum(),
        );

        let t1 = ray.inverse() * (-ro + (s * self.size));
        let t2 = ray.inverse() * (-ro - (s * self.size));
        let tn = f64::max(f64::max(t1.x, t1.y), t1.z);
        let tf = f64::min(f64::min(t2.x, t2.y), t2.z);

        if tn > tf || tf < 0. {
            return None;
        }

        let normal = if t1.x > t1.y && t1.x > t1.z {
            Vector3::new(s.x, 0., 0.)
        } else if t1.y > t1.z {
            Vector3::new(0., s.y, 0.)
        } else {
            Vector3::new(0., 0., s.z)
        };

        let pn = ray.along(tn);
        let pf = ray.along(tf);

        let pns = (Vector3::new(1., 1., 1.) - normal.abs()) * (pn - self.pos) / self.size;

        #[rustfmt::skip]
        let uv: (f64, f64) = match normal {
            Vector3 { y, .. } if y == 1. => (pns.x, pns.z),
            Vector3 { y, .. } if y == -1. => (-pns.x, -pns.z),
            Vector3 { x, .. } if x == 1. => (-pns.z, -pns.y),
            Vector3 { x, .. } if x == -1. => (pns.z, -pns.y),
            Vector3 { z, .. } if z == 1. => (pns.x, -pns.y),
            Vector3 { z, .. } if z == -1. => (-pns.x, -pns.y),
            _ => (0., 0.),
        };

        Some(Hit::new(
            normal,
            (tn, pn),
            (tf, pf),
            (uv.0 as f32 * 0.5 + 0.5, uv.1 as f32 * 0.5 + 0.5),
        ))
    }
}

impl AabbIntersector {
    pub fn bounds(&self) -> (Vector3, Vector3) {
        (self.pos - self.size, self.pos + self.size)
    }
}

impl From<acceleration::Aabb> for AabbIntersector {
    fn from(aabb: acceleration::Aabb) -> Self {
        Self {
            pos: aabb.centroid,
            size: aabb.max - aabb.min,
        }
    }
}

/// An axis-aligned box, short for axis-aligned bounding box.
#[derive(Debug, Clone, Default)]
pub struct Aabb {
    intersector: AabbIntersector,
    pub material: Material,
}

impl Aabb {
    /// Instantiate a new `Aabb` scene object. Internally, this also instantiates
    /// an `AabbIntersector`, to which this type wraps around.
    pub fn new(pos: Vector3, size: Vector3, material: Material) -> Self {
        Self {
            intersector: AabbIntersector { pos, size },
            material,
        }
    }

    /// Gets the `pos` of the inner `AabbIntersector`.
    pub fn pos(&self) -> Vector3 {
        self.intersector.pos
    }

    /// Gets the `size` of the inner `AabbIntersector`.
    pub fn size(&self) -> Vector3 {
        self.intersector.size
    }

    /// Consumes this `Aabb`, returning the inner `AabbIntersector`.
    pub fn into_inner(self) -> AabbIntersector {
        self.intersector
    }
}

impl Intersect for Aabb {
    fn intersect(&self, ray: &Ray) -> Option<Hit> {


_cb_attrs()
  local adder = {
    Div = function(el)
      if el.classes:includes('cell') then
        local source_line_numbers = tostring(el.attributes["source-line-numbers"])
        local output_line_numbers = tostring(el.attributes["output-line-numbers"])
        local ht_pat = el.attributes['ht-pattern']
        local div = el:walk(
          add_attrs_to_cb(source_line_numbers, output_line_numbers, ht_pat)
          )
        return div
      end
   end
  }
  return adder
end

-- highlight the code blocks
local function highlight_cb()
  local highlighter = {
    CodeBlock = function(cb)
      local pattern
      local pattern_attr = cb.attributes['ht-pattern']
      if not isEmpty(pattern_attr) then
        pattern = escape_pattern(pattern_attr) .. "$"
      else
        pattern = PATTERN
      end
      local lines_to_ht =  get_lines_to_ht(cb, pattern)
      local line_number
      local line_number_attr
      if cb.classes:includes('cell-code') then
        -- for executable code chunk
        line_number_attr = cb.attributes['source-line-numbers']
        line_number = isEmpty(lines_to_ht) and line_number_attr or lines_to_ht
        cb.attributes['data-code-line-numbers'] = line_number
      elseif cb.classes:includes('highlight') then
        -- for code output
        line_number_attr = cb.attributes['output-line-numbers']
        line_number = line_number_attr
        cb.attributes['data-code-line-numbers'] = line_number
      else
        -- for markdown CodeBlock
        if not isEmpty(lines_to_ht) then
          line_number = lines_to_ht
        elseif cb.attributes["source-line-numbers"] then
          line_number = cb.attributes["source-line-numbers"]
        else
          line_number = ""
        end
        cb.attributes["data-code-line-numbers"] = line_number
      end
      cb.text = remove_pattern(get_lines(cb.text), pattern)
      return cb
    end
  }
  return highlighter
end

if FORMAT == "html" then
  -- ensuring dependencies for line-highlighting
  ensureHtmlDeps()

  function Pandoc(doc)
    local doc = doc:walk(add_cb_attrs())
    return doc:walk(highlight_cb())
  end
end


ent xmlDocument = new XmlDocument();

            //Act
            XmlElement elemTest = xmlDocument.CreateElement("TestCommand");
            var helper = new XmlElementHelper(elemTest);
            //DeserializeCore method is looking for the attributes ShowErrors and CancelRun, then we need to set them up before calling the method.
            helper.SetAttribute("X", 100);
            helper.SetAttribute("Y", 100);
            helper.SetAttribute("DefaultPosition", true);
            helper.SetAttribute("TransformCoordinates", true);
            helper.SetAttribute("NodeName", "TestNode");

            XmlElement elemTestChild = xmlDocument.CreateElement("TestCommandChild");
            elemTest.AppendChild(elemTestChild);

            var createNodeCommand = DynCmd.CreateNodeCommand.DeserializeCore(elemTest);
            var serializedCommand = createNodeCommand.Serialize(xmlDocument);

            createNodeCommand.TrackAnalytics();

            //Assert
            Assert.IsNotNull(createNodeCommand);
            Assert.IsNotNull(serializedCommand);
        }

        private CodeBlockNodeModel CreateCodeBlockNode()
        {
            var cbn = new CodeBlockNodeModel(CurrentDynamoModel.LibraryServices);
            var command = new DynCmd.CreateNodeCommand(cbn, 0, 0, true, false);

            CurrentDynamoModel.ExecuteCommand(command);

            Assert.IsNotNull(cbn);
            return cbn;
        }
    }
}


%;line-height:45px}.layui-nav-tree .layui-nav-item a{position:relative;height:45px;line-height:45px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-nav-tree .layui-nav-item a:hover{background-color:#4E5465}.layui-nav-tree .layui-nav-bar{width:5px;height:0;background-color:#009688}.layui-nav-tree .layui-nav-child dd.layui-this,.layui-nav-tree .layui-nav-child dd.layui-this a,.layui-nav-tree .layui-this,.layui-nav-tree .layui-this>a,.layui-nav-tree .layui-this>a:hover{background-color:#009688;color:#fff}.layui-nav-tree .layui-this:after{display:none}.layui-nav-itemed>a,.layui-nav-tree .layui-nav-title a,.layui-nav-tree .layui-nav-title a:hover{color:#fff!important}.layui-nav-tree .layui-nav-child{position:relative;z-index:0;top:0;border:none;box-shadow:none}.layui-nav-tree .layui-nav-child a{height:40px;line-height:40px;color:#fff;color:rgba(255,255,255,.7)}.layui-nav-tree .layui-nav-child,.layui-nav-tree .layui-nav-child a:hover{background:0 0;color:#fff}.layui-nav-tree .layui-nav-more{right:10px}.layui-nav-itemed>.layui-nav-child{display:block;padding:0;background-color:rgba(0,0,0,.3)!important}.layui-nav-itemed>.layui-nav-child>.layui-this>.layui-nav-child{display:block}.layui-nav-side{position:fixed;top:0;bottom:0;left:0;overflow-x:hidden;z-index:999}.layui-bg-blue .layui-nav-bar,.layui-bg-blue .layui-nav-itemed:after,.layui-bg-blue .layui-this:after{background-color:#93D1FF}.layui-bg-blue .layui-nav-child dd.layui-this{background-color:#1E9FFF}.layui-bg-blue .layui-nav-itemed>a,.layui-nav-tree.layui-bg-blue .layui-nav-title a,.layui-nav-tree.layui-bg-blue .layui-nav-title a:hover{background-color:#007DDB!important}.layui-breadcrumb{font-size:0}.layui-breadcrumb>*{font-size:14px}.layui-breadcrumb a{color:#999!important}.layui-breadcrumb a:hover{color:#5FB878!important}.layui-breadcrumb a cite{color:#666;font-style:normal}.layui-breadcrumb span[lay-separator]{margin:0 10px;color:#999}.layui-tab{margin:10px 0;text-align:left!important}.layui-tab[overflow]>.layui-tab-title{overflow:hidden}.layui-tab-title{position:relative;left:0;height:40px;white-space:nowrap;font-size:0;border-bottom-width:1px;border-bottom-style:solid;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;font-size:14px;transition:all .2s;-webkit-transition:all .2s;position:relative;line-height:40px;min-width:65px;padding:0 15px;text-align:center;cursor:pointer}.layui-tab-title li a{display:block}.layui-tab-title .layui-this{color:#000}.


86 158-147.5t98-107q36-45.5 50-81t14-70.5q0-60-40-100t-100-40q-47 0-87 26.5T518-680h-76q-15-41-55-67.5T300-774q-60 0-100 40t-40 100q0 35 14 70.5t50 81q36 45.5 98 107T480-228Zm0-273Z"/></svg>
        <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="grey"><path d="M720-80q-50 0-85-35t-35-85q0-7 1-14.5t3-13.5L322-392q-17 15-38 23.5t-44 8.5q-50 0-85-35t-35-85q0-50 35-85t85-35q23 0 44 8.5t38 23.5l282-164q-2-6-3-13.5t-1-14.5q0-50 35-85t85-35q50 0 85 35t35 85q0 50-35 85t-85 35q-23 0-44-8.5T638-672L356-508q2 6 3 13.5t1 14.5q0 7-1 14.5t-3 13.5l282 164q17-15 38-23.5t44-8.5q50 0 85 35t35 85q0 50-35 85t-85 35Zm0-640q17 0 28.5-11.5T760-760q0-17-11.5-28.5T720-800q-17 0-28.5 11.5T680-760q0 17 11.5 28.5T720-720ZM240-440q17 0 28.5-11.5T280-480q0-17-11.5-28.5T240-520q-17 0-28.5 11.5T200-480q0 17 11.5 28.5T240-440Zm480 280q17 0 28.5-11.5T760-200q0-17-11.5-28.5T720-240q-17 0-28.5 11.5T680-200q0 17 11.5 28.5T720-160Zm0-600ZM240-480Zm480 280Z"/></svg>

ROBOT AI

Lorem ipsum dolor sit amet consectetur adipisicing elit. Magni praesentium dolores similique porro minima corporis delectus ducimus ratione ad possimus assumenda est reiciendis eligendi saepe veritatis, rerum, debitis officiis repellendus.

235 K

Lorem Ipsum

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>Quick Start to Server Side COM and Python</TITLE>
<META NAME="Version" CONTENT="8.0.3410">
<META NAME="Date" CONTENT="10/11/96">
<META NAME="Template" CONTENT="D:\Program Files\Microsoft Office\Office\html.dot">

Quick Start to Server side COM and Python

Introduction

This documents how to quickly start implementing COM objects in Python. It is not a thorough discussion of the COM system, or of the concepts introduced by COM.

For more details information on Python and COM, please see the COM Tutorial given by Greg Stein and Mark Hammond at SPAM 6 (HTML format) or download the same tutorial <A HREF="http://www.python.org/windows/win32com/COMTuto


'Queue', () => {
  it('should create a queue', () => {
    const queue = createQueue();
    expect(queue).toBeDefined();
    expect(queue.items.toArray()).toEqual([]);
    expect(queue.toString()).toEqual('');
  });

  it('should enqueue an item', () => {
    const queue = createQueue();
    const initialValues = [1, false, 'a', 2];

    initialValues.forEach((val) => queue.enqueue(val));

    expect(queue.items.toArray()).toEqual(initialValues);
    queue.enqueue('b');
    expect(queue.items.toArray()).toEqual([...initialValues, 'b']);
  });

  it('should dequeue an item', () => {
    const queue = createQueue();
    const initialValues = [1, false, {key: 'test'}];

    initialValues.forEach((val) => queue.enqueue(val));

    expect(queue.dequeue()).toEqual(1);
    expect(queue.items.toArray()).toEqual([false, {key: 'test'}]);
    expect(queue.dequeue()).toEqual(false);
    expect(queue.dequeue()).toEqual({key: 'test'});
    expect(queue.dequeue()).toBeUndefined();
  });

  it('should peek the first item in the queue', () => {
    const queue = createQueue();
    const initialValues = ['x', 'y', 'z'];

    expect(queue.peek()).toBeUndefined();
    initialValues.forEach((val) => queue.enqueue(val));

    expect(queue.peek()).toEqual('x');
    queue.dequeue();
    expect(queue.peek()).toEqual('y');
  });

  it('should check if the queue is empty', () => {
    const queue = createQueue();

    expect(queue.isEmpty()).toBe(true);
    expect(queue.enqueue(0).isEmpty()).toBe(false);
  });
});
export function limitText(text: string, maxChars: number) {
	if (text.length > maxChars) {
		return text.substring(0, maxChars);
	}
	return text;
}
import { ChangeDetectionStrategy, Component, ContentChild, EventEmitter, inject, Input, Output } from '@angular/core';
import { ColorService } from '../../services/color/index';
import { AlertIconDirective } from './alert-icon.directive';

@Component({
    selector: 'ux-alert',
    templateUrl: './alert.component.html',
    changeDetection: ChangeDetectionStrategy.OnPush,
    host: {
        'role': 'alert',
        '[class.ux-alert-info]': 'type === "info" && !_isCustomColor',
        '[class.ux-alert-error]': 'type === "error" && !_isCustomColor',
        '[class.ux-alert-warning]': 'type === "warning" && !_isCustomColor',
        '[class.ux-alert-success]': 'type === "success" && !_isCustomColor',
        '[class.ux-alert-dark]': 'type === "dark" && !_isCustomColor',
        '[style.background-color]': '_backgroundColor',
        '[style.color]': '_foregroundColor'
    }
})
export class AlertComponent {

    private readonly colorService = inject(ColorService);

    /** Determine the style of the alert */
    @Input() type: AlertType = 'info';

    /** Determine the the alert can be dismissed */
    @Input() dismissible: boolean = false;

    /** Define a custom background color */
    @Input() backgroundColor: string;

    /** Define a custom foreground color */
    @Input() foregroundColor: string;

    /** Define a custom aria label for the dismiss button */
    @Input() dismissAriaLabel: string = 'Dismiss Alert';

    /** Emit when the dismiss button is pressed */
    @Output() dismiss = new EventEmitter<void>();

    /** Identify if we have an icon */
    @ContentChild(AlertIconDirective


using System.Collections.Generic;
using Arrowgene.Buffers;

namespace Arrowgene.Ddon.Shared.Entity.Structure
{
    public class CDataQuestLog
    {
        public CDataQuestLog() {
            QuestAnnounceList = new List<CDataQuestAnnounce>();
            QuestTalkInfoList = new List<CDataQuestTalkInfo>();
        }

        public List<CDataQuestAnnounce> QuestAnnounceList;
        public List<CDataQuestTalkInfo> QuestTalkInfoList;

        public class Serializer : EntitySerializer<CDataQuestLog>
        {
            public override void Write(IBuffer buffer, CDa


      try {
        Path p = new Path(path);
        Configuration conf = getConf() != null ? getConf() : HBaseConfiguration.create();
        URI uri = p.toUri();

        if (uri.getScheme() == null) {
          return false;
        }

        FileSystem.get(uri, conf);
        return true;
      } catch (Exception e) {
        return false;
      }
    }

    private String getTablesForSet(String name) throws IOException {
      try (final BackupSystemTable table = new BackupSystemTable(conn)) {
        List<TableName> tables = table.describeBackupSet(name);

        if (tables == null) {
          return null;
        }

        return StringUtils.join(tables, BackupRestoreConstants.TABLENAME_DELIMITER_IN_COMMAND);
      }
    }

    @Override
    protected void printUsage() {
      System.out.println(CREATE_CMD_USAGE);
      Options options = new Options();
      options.addOption(OPTION_WORKERS, true, OPTION_WORKERS_DESC);
      options.addOption(OPTION_BANDWIDTH, true, OPTION_BANDWIDTH_DESC);
      options.addOption(OPTION_SET, true, OPTION_SET_BACKUP_DESC);
      options.addOption(OPTION_TABLE, true, OPTION_TABLE_LIST_DESC);
      options.addOption(OPTION_YARN_QUEUE_NAME, true, OPTION_YARN_QUEUE_NAME_DESC);
      options.addOption(OPTION_DEBUG, false, OPTION_DEBUG_DESC);
      options.addOption(OPTION_IGNORECHECKSUM, false, OPTION_IGNORECHECKSUM_DESC);

      HelpFormatter helpFormatter = new HelpFormatter();
      helpFormatter.setLeftPadding(2);
      helpFormatter.setDescPadding(8);
      helpFormatter.setWidth(100);
      helpFormatter.setSyntaxPrefix("Options:");
      helpFormatter.printHelp(" ", null, options, USAGE_FOOTER);
    }
  }

  public static class HelpCommand extends Command {
    HelpCommand(Configuration conf, CommandLine cmdline) {
      super(conf);
      this.cmdline = cmdline;
    }

    @Override
    public void execute() throws IOException {
      if (cmdline == null) {
        printUsage();
        throw new IOException(INCORRECT_USAGE);
      }

      String[] args = cmdline.getArgs();
      if (args == null || args.length == 0) {
        printUsage();
        throw new IOException(INCORRECT_USAGE);
      }

      if (args.length != 2) {
        System.out.println("ERROR: Only supports help message of a single command type");
        printUsage();
        throw new IOException(INCORRECT_USAGE);
      }

      String type = args[1];

      if (BackupCommand.CREATE.name().equalsIgnoreCase(type)) {
        System.out.println(CREATE_CMD_USAGE);
      } else if (BackupCommand.DESCRIBE.name().equalsIgnoreCase(type)) {
        System.out.println(DESCRIBE_CMD_USAGE);
      } else if (BackupCommand.HISTORY.name().equalsIgnoreCase(type)) {
        System.out.println(HISTORY_CMD_USAGE);
      } else if (BackupCommand.PROGRESS.name().equalsIgnoreCase(type)) {
        System.out.println(PROGRESS_CMD_USAGE);
      } else if (BackupCommand.DELETE.name().equalsIgnoreCase(type)) {
        System.out.println(DELETE_CMD_USAGE);
      } else if (BackupCommand.SET.name().equalsIgnoreCase(type)) {
        System.out.println(SET_CMD_USAGE);
      } else {
        System.out.println("Unknown command : " + type);
        printUsage();
      }
    }

    @Override
    protected void printUsage() {
      System.out.println(USAGE);
    }
  }

  public static class DescribeCommand extends Command {
    DescribeCommand(Configuration conf, CommandLine cmdline) {
      super(conf);


receivedSecretShares[id] = secretShare
	return nil
}

/*ComputeDKGKeyShare - Derive the share for each miner through polynomial substitution method */
func (dkg *DKG) GetSecretSharesSize() int {
	dkg.secretSharesMutex.RLock()
	defer dkg.secretSharesMutex.RUnlock()
	return len(dkg.receivedSecretShares)
}

/*ComputeDKGKeyShare - Derive the share for each miner through polynomial substitution method */
func (dkg *DKG) HasAllSecretShares() bool {
	dkg.secretSharesMutex.RLock()
	defer dkg.secretSharesMutex.RUnlock()
	return len(dkg.receivedSecretShares) >= dkg.T
}

func (dkg *DKG) HasSecretShare(key string) bool {
	dkg.secretSharesMutex.RLock()
	defer dkg.secretSharesMutex.RUnlock()
	_, ok := dkg.receivedSecretShares[ComputeIDdkg(key)]
	return ok
}

func (dkg *DKG) GetSecretShare(key string) (Key, bool) {
	dkg.secretSharesMutex.RLock()
	defer dkg.secretSharesMutex.RUnlock()
	share, ok := dkg.receivedSecretShares[ComputeIDdkg(key)]
	return share, ok
}

// Sign - sign using the group secret key share
func (dkg *DKG) Sign(msg string) *Sign {
	logging.Logger.Debug("dkg sign",
		zap.String("key", dkg.Si.GetHexString()),
		zap.String("pi", dkg.Pi.GetHexString()))
	return dkg.Si.Sign(msg)
}

// VerifySignature - verify the signature using the group public key share
func (dkg *DKG) VerifySignature(sig *Sign, msg string, id PartyID) bool {
	dkg.gmpkMutex.Lock()
	defer dkg.gmpkMutex.Unlock()
	verifyStart := time.Now()
	defer func() {
		if time.Since(verifyStart) > 200*time.Millisecond {
			logging.Logger.Debug("[dkg_timing] Verify signature slow",
				zap.Duration("duration", time.Since(verifyStart)))
		}
	}()

	key, ok := dkg.gmpk[id]
	if !ok {
		if dkg.mpksMap == nil {
			mpks, err := dkg.getMpkMap()
			if err != nil {
				logging.Logger.Error("dkg verify signature, failed to get mpk map",
					zap.Error(err))
				return false
			}
			dkg.mpksMap = mpks
		}

		var err error
		key, err = aggregatePublicKeysForID(dkg.mpksMap, id)
		if err != nil {
			logging.Logger.Error("dkg verify signature, failed to aggregate public key shares",
				zap.Error(err))
			return false
		}

		dkg.gmpk[id] = key
	}
	logging.Logger.Debug("dkg verify",
		zap.String("id", id.GetHexString()),
		zap.String("key", key.GetHexString()),
		zap.String("msg", msg),
		zap.String("sig", sig.GetHexString()))
	return sig.Verify(&key, msg)
}

func (dkg *DKG) getMpkMap() (map[PartyID][]PublicKey, error) {
	startTime := time.Now()
	defer func() {
		logging.Logger.Debug("[dkg_timing] Parallel MPK map conversion",
			zap.Duration("duration", time.Since(startTime)))
	}()

	result := make(map[PartyID][]PublicKey)
	var (
		numWorkers = runtime.NumCPU()
		wg         sync.WaitGroup
		mu         sync.Mutex
		errChan    = make(chan error, 1)
	)

	// Cr


use serde_json;

use crate::http_util;
use octobot_lib::errors::*;

#[async_trait]
pub trait Handler: Send + Sync {
    async fn handle_ok(&self, req: Request<Body>) -> Response<Body> {
        match self.handle(req).await {
            Ok(r) => r,
            Err(e) => {
                error!("Request handler error: {}", e);
                http_util::new_empty_error_resp()
            }
        }
    }

    async fn handle(&self, req: Request<Body>) -> Result<Response<Body>>;

    fn respond_with(&self, status: StatusCode, msg: &str) -> Response<Body> {
        http_util::new_msg_resp(status, msg.to_string())
    }

    fn respond_error(&self, err: &str) -> Response<Body> {
        error!("InternalServerError: {}", err);
        http_util::new_empty_resp(StatusCode::INTERNAL_SERVER_ERROR)
    }
}

pub trait Filter: Send + Sync {
    fn filter(&self, req: Request<Body>) -> FilterResult;
}

pub enum FilterResult {
    Halt(Response<Body>),
    Continue(Request<Body>),
}

pub struct FilteredHandler {
    filter: Box<dyn Filter>,
    handler: Box<dyn Handler>,
}

pub struct NotFoundHandler;

impl FilteredHandler {
    pub fn new(filter: Box<dyn Filter>, handler: Box<dyn Handler>) -> Box<FilteredHandler> {
        Box::new(FilteredHandler { filter, handler })
    }
}

#[async_trait]
impl Handler for FilteredHandler {
    async fn handle(&self, req: Request<Body>) -> Result<Response<Body>> {
        let req = match self.filter.filter(req) {
            FilterResult::Halt(resp) => return Ok(resp),
            FilterResult::Continue(req) => req,
        };

        self.handler.handle(req).await
    }
}

#[async_trait]
impl Handler for NotFoundHandler {
    async fn handle(&self, _: Request<Body>) -> Result<Response<Body>> {
        Ok(http_util::new_empty_resp(StatusCode::NOT_FOUND))
    }
}

pub async fn parse_json<T: DeserializeOwned>(req: Request<Body>) -> Result<T> {
    let bytes = match hyper::body::to_bytes(req.into_body()).await {
        Ok(b) => b,
        Err(e) => {
            return Err(failure::format_err!("Failed to read request body: {}", e));
        }
    };

    serde_json::from_slice::<T>(bytes.as_ref())
        .map_err(|e| failure::format_err!("Failed to parse JSON: {}", e))
}
// Require use of WinMain entrypoint so cmd doesn't flash open
// See RFC 1665 for additional details
#![windows_subsystem = "windows"]

use std::process::{Command, exit};
use std::env;
use std::ffi::c_void;
use std::io::Error;
use std::path::{PathBuf, Path};
use std::ptr::null_mut;
use windows::{
    Win32::{
        UI::{
            Shell::ShellExecuteW,
            WindowsAndMessaging::{
                MessageBoxW,
                SW_SHOW, MB_ICONINFORMATION, MB_YESNO, IDYES,
            },
        },
        System::Registry::{
            RegGetValueW,
            HKEY,
            HKEY_CURRENT_USER, RRF_RT_REG_SZ,
        },
        Foundation::{
            ERROR_SUCCESS
        },
    }
};

const MB_TILE: &str = "Fabric Installer";
const MB_BODY: &str = "The Fabric Installer could not find a valid Java installation.\n\nWould


_u64, 10841254275107988496_u64, 293873_u64])
}

pub const LN2LO_SCALE: PreciseNumber = PreciseNumber {
  value: ln2lo_scale(),
};

// 6.666666666666735130e-01
#[inline]
pub const fn l1() -> InnerUint {
  U192([666666666666673513_u64, 0_u64, 0_u64])
}
pub const L1: PreciseNumber = PreciseNumber { value: l1() };

#[inline]
pub const fn l2() -> InnerUint {
  U192([399999999994094190_u64, 0_u64, 0_u64])
}
pub const L2: PreciseNumber = PreciseNumber { value: l2() };

#[inline]
pub const fn l3() -> InnerUint {
  U192([285714287436623914_u64, 0_u64, 0_u64])
}
pub const L3: PreciseNumber = PreciseNumber { value: l3() };

#[inline]
pub const fn l4() -> InnerUint {
  U192([222221984321497839_u64, 0_u64, 0_u64])
}
pub const L4: PreciseNumber = PreciseNumber { value: l4() };

#[inline]
pub const fn l5() -> InnerUint {
  U192([181835721616180501_u64, 0_u64, 0_u64])
}
pub const L5: PreciseNumber = PreciseNumber { value: l5() };

pub const fn l6() -> InnerUint {
  U192([153138376992093733_u64, 0_u64, 0_u64])
}
pub const L6: PreciseNumber = PreciseNumber { value: l6() };

#[inline]
pub const fn l7() -> InnerUint {
  U192([147981986051165859_u64, 0_u64, 0_u64])
}
pub const L7: PreciseNumber = PreciseNumber { value: l7() };

#[inline]
pub const fn sqrt2overtwo() -> InnerUint {
  U192([707106781186547600_u64, 0_u64, 0_u64])
}
pub const SQRT2OVERTWO: PreciseNumber = PreciseNumber {
  value: sqrt2overtwo(),
};

#[inline]
pub const fn half() -> InnerUint {
  U192([500000000000000000_u64, 0_u64, 0_u64])
}
pub const HALF: PreciseNumber = PreciseNumber { value: half() };

/// The number 0 as a PreciseNumber, used for easier calculations.
#[inline]
pub const fn zero() -> InnerUint {
  U192([0_u64, 0_u64, 0_u64])
}

impl PreciseNumber {
  pub fn signed(&self) -> SignedPreciseNumber {
    SignedPreciseNumber {
      value: self.clone(),
      is_negative: false,
    }
  }

  /// Correction to apply to avoid truncation errors on division.  Since
  /// integer operations will always floor the result, we artifically bump it
  /// up by one half to get the expect result.
  fn rounding_correction() -> InnerUint {
    InnerUint::from(ONE / 2)
  }

  pub fn zero() -> Self {
    Self { value: zero() }
  }

  pub fn one() -> Self {
    Self { value: one() }
  }

  /// Create a precise number from an imprecise u128, should always succeed
  pub fn new(value: u128) -> Option<Self> {
    let value = InnerUint::from(value).checked_mul(one())?;
    Some(Self { value })
  }

  /// Convert a precise number back to u128
  pub fn to_imprecise(&self) -> Option<u128> {
    self
      .value
      .checked_add(Self::rounding_correction())?
      .checked_div(one())
      .map(|v| v.as_u128())
  }

  /// Che