{
    val warehouseAdapter = moshi.adapter(Warehouse::class.java)
    val warehouse = Warehouse.Builder()
      .warehouse_id(1976)
      .warehouse_token("W_ACDFD")
      .dropoff_points(
        mapOf(
          "station-1" to "left of north door A",
          "station-2" to "right of office",
          "station-3" to "left of center"
        )
      )
      .build()
    val json = warehouseAdapter.indent(" ").toJson(warehouse)
    assertThat(json).isEqualToAsJson(
      """
        |{
        | "warehouse_id": 1976,
        | "warehouse_token": "W_ACDFD",
        | "alternates": [],
        | "dropoff_points": {
        | "station-1": "left of north door A",
        | "station-2": "right of office",
        | "station-3": "left of center"
        | },
        | "robots": {}
        |}""".trimMargin()
    )
    assertThat(warehouseAdapter.fromJson(json)).isEqualTo(warehouse)
  }

  @Test
  fun mapsOfMessages() {
    val warehouseAdapter = moshi.adapter(Warehouse::class.java)
    val warehouse = Warehouse.Builder()
      .warehouse_id(1976)
      .warehouse_token("W_ACDFD")
      .robots(
        mapOf(
          34 to Robot.Builder()
            .robot_id(34)
            .robot_token("R_93498")
            .build(),
          56 to Robot.Builder()
            .robot_id(56)
            .robot_token("R_DFGDD")
            .build()
        )
      )
      .build()
    val json = warehouseAdapter.indent(" ").toJson(warehouse)
    assertThat(json).isEqualToAsJson(
      """
        |{
        | "warehouse_id": 1976,
        | "warehouse_token": "W_ACDFD",
        | "alternates": [],
        | "dropoff_points": {},
        | "robots": {
        |  "34": {
        |   "robot_id": 34,
        |   "robot_token": "R_93498"
        |  },
        |  "56": {
        |   "robot_id": 56,
        |   "robot_token": "R_DFGDD"
        |  }
        | }
        |}
        |""".trimMargin()
    )
    assertThat(warehouseAdapter.fromJson(json)).isEqualTo(warehouse)
  }

  @Test
  fun detectsAndFailsOnMultipleOneOfs() {
    val shipmentAdapter = moshi.adapter(Shipment::class.java)
    assertThat(
      assertFailsWith<IllegalArgumentException> {
        shipmentAdapter.fromJson(
          """
        |{
        | "shipment_id": 100075,
        | "shipment_token": "P_AAAAA",
        | "load_ratio": 0.75,
        | "deleted": true,
        | "account_token": "AC_5765",
        | "card_token": "CC_34531"
        |}
        |""".trimMargin()
        )
      }
    ).hasMessage("at most one of account_token, card_token, transfer_id may be non-null")
  }

  @Test
  fun cyclicalTypes() {
    val warehouseAdapter = moshi.adapter(Warehouse::class.java)
    val warehouse = Warehouse.Builder()
      .warehouse_token("CDCDC")
      .warehouse_id(755L)
      .central_repo(
        Warehouse.Builder()
          .warehouse_id(1L)
          .warehouse_token("AAAAA")
          .build()
      )
      .alternates(
        listOf(
          Warehouse.Builder()
            .warehouse_


lse;
      }

      return false;
    } else if (Option == "fp") {
      return parseDirectiveModuleFP();
    }

    return Error(L, "'" + Twine(Option) + "' is not a valid .module option.");
  }

  return false;
}

/// parseDirectiveModuleFP
///  ::= =32
///  ::= =xx
///  ::= =64
bool MipsAsmParser::parseDirectiveModuleFP() {
  MCAsmParser &Parser = getParser();
  MCAsmLexer &Lexer = getLexer();

  if (Lexer.isNot(AsmToken::Equal)) {
    reportParseError("unexpected token, expected equals sign '='");
    return false;
  }
  Parser.Lex(); // Eat '=' token.

  MipsABIFlagsSection::FpABIKind FpABI;
  if (!parseFpABIValue(FpABI, ".module"))
    return false;

  if (getLexer().isNot(AsmToken::EndOfStatement)) {
    reportParseError("unexpected token, expected end of statement");
    return false;
  }

  // Emit appropriate flags.
  getTargetStreamer().emitDirectiveModuleFP(FpABI, isABI_O32());
  Parser.Lex(); // Consume the EndOfStatement.
  return false;
}

bool MipsAsmParser::parseFpABIValue(MipsABIFlagsSection::FpABIKind &FpABI,
                                    StringRef Directive) {
  MCAsmParser &Parser = getParser();
  MCAsmLexer &Lexer = getLexer();

  if (Lexer.is(AsmToken::Identifier)) {
    StringRef Value = Parser.getTok().getString();
    Parser.Lex();

    if (Value != "xx") {
      reportParseError("unsupported value, expected 'xx', '32' or '64'");
      return false;
    }

    if (!isABI_O32()) {
      reportParseError("'" + Directive + " fp=xx' requires the O32 ABI");
      return false;
    }

    FpABI = MipsABIFlagsSection::FpABIKind::XX;
    return true;
  }

  if (Lexer.is(AsmToken::Integer)) {
    unsigned Value = Parser.getTok().getIntVal();
    Parser.Lex();

    if (Value != 32 && Value != 64) {
      reportParseError("unsupported value, expected 'xx', '32' or '64'");
      return false;
    }

    if (Value == 32) {
      if (!isABI_O32()) {
        reportParseError("'" + Directive + " fp=32' requires the O32 ABI");
        return false;
      }

      FpABI = MipsABIFlagsSection::FpABIKind::S32;
    } else
      FpABI = MipsABIFlagsSection::FpABIKind::S64;

    return true;
  }

  return false;
}

bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) {
  MCAsmParser &Parser = getParser();
  StringRef IDVal = DirectiveID.getString();

  if (IDVal == ".cpload")
    return parseDirectiveCpLoad(DirectiveID.getLoc());
  if (IDVal == ".dword") {
    parseDataDirective(8, DirectiveID.getLoc());
    return false;
  }
  if (IDVal == ".ent") {
    StringRef SymbolName;

    if (Parser.parseIdentifier(SymbolName)) {
      reportParseError("expected identifier after .ent");
      return false;
    }

    // There's an undocumented extension that allows an integer to
    // follow the name of the procedure which AFAICS is ignored by GAS.
    // Example: .ent foo,2
    if (getLexer().isNot(AsmToken::EndOfStatement)) {
      if (getLexer().isNot(AsmToken::Comma)) {
        // Even though we accept this undocumented extension for compatibility
        // reasons, the additional integer argument does not actually change
        // the behaviour of the '.


, control, BOTTOMRIGHT, 2, 2)

    ZO_MenuHighlight:SetHidden(false)

    if not control.isHighlighted then
        control.nameLabel:SetColor(control.nameLabel.highlightColor:UnpackRGBA())
    end
end

function ZO_Menu_UnselectItem(control)
    ZO_MenuHighlight:SetHidden(true)

    if not control.isHighlighted then
        control.nameLabel:SetColor(control.nameLabel.normalColor:UnpackRGBA())
    end
end

function ZO_Menu_SetSelectedIndex(index)
    if not ZO_Menu.items then
        return
    end

    if index then
        index = zo_max(zo_min(index, #ZO_Menu.items), 1)
    end

    if selectedIndex ~= index then
        if selectedIndex then
            local entry = ZO_Menu.items[selectedIndex]
            if entry then
                local control = entry.item
                if control then
                    ZO_Menu_UnselectItem(control)
                end
            end
        end

        selectedIndex = index

        if selectedIndex then
            local entry = ZO_Menu.items[selectedIndex]
            if entry then
                local control = entry.item

                if control then
                    ZO_Menu_SelectItem(control)
                end
            end
        end
    end
end

function ZO_Menu_GetNumMenuItems()
    return #ZO_Menu.items
end

function ZO_Menu_GetSelectedIndex()
    return selectedIndex
end

function ZO_Menu_GetSelectedText()
    local control = ZO_Menu.items[selectedIndex].item
    if control then
        return control.nameLabel:GetText()
    end
end

function ZO_Menu_EnterItem(control)
    ZO_Menu_SetSelectedIndex(control.menuIndex)

    if type(control.onEnter) == "function" then
        control.onEnter(control)
    end
end

function ZO_Menu_ExitItem(control)
    if selectedIndex == control.menuIndex then
        ZO_Menu_SetSelectedIndex(nil)

        if type(control.onExit) == "function" then
            control.onExit(control)
        end
    end
end

function ZO_Menu_ClickItem(control, button)
    if button == MOUSE_BUTTON_INDEX_LEFT then
        ZO_Menu_SetLastCommandWasFromMenu(true)
        local menuEntry = ZO_Menu.items[control.menuIndex]
        if menuEntry and menuEntry.checkbox then
            -- Treat this like the checkbox was clicked.
            ZO_CheckButton_OnClicked(menuEntry.checkbox, button)
        else
            -- Treat it like the label was clicked
            if control.OnSelect then
                control.OnSelect()
            else
                -- ESO-804925
                internalassert(false, string.format("Attempting to click menu entry [%s] but it has no OnSelect behavior defined.", control.nameLabel:GetText()))
            end

            if control.enabled ~= false then
                if ZO_Menu.menuType == MENU_TYPE_MULTISELECT_COMBO_BOX then
                    control.isHighlighted = not control.isHighlighted

                    if control.isHighlighted then
                        ZO_Menu_AcquireAndApplyHighlight(control)
                    else
                        ZO_Menu_ReleaseHighlight(control)
                    end
                else
                    ClearMenu()
                end
            end


() should have returned 2");
        assertFalse(cmMessage.isUnicode(), "Should not be unicode");
    }

    @Test
    public void testGSM338AndEQ2MAXGSMMESSAGELENGTH() {

        StringBuilder sb = new StringBuilder();
        for (int index = 0; index < (2 * CMConstants.MAX_GSM_MESSAGE_LENGTH_PER_PART_IF_MULTIPART); index++) {
            sb.append("a");
        }

        final CMMessage cmMessage = new CMMessage(validNumber, sb.toString());
        cmMessage.setUnicodeAndMultipart(CMConstants.DEFAULT_MULTIPARTS);

        assertEquals(2, cmMessage.getMultiparts(), "Call to getMultiparts() should have returned 2");
        assertFalse(cmMessage.isUnicode(), "Should not be unicode");
    }

    @Test
    public void testGSM338AndGT2MAXGSMMESSAGELENGTH() {
        StringBuilder sb = new StringBuilder();
        for (int index = 0; index < (2 * CMConstants.MAX_GSM_MESSAGE_LENGTH_PER_PART_IF_MULTIPART + 1); index++) {
            sb.append("a");
        }

        final CMMessage cmMessage = new CMMessage(validNumber, sb.toString());
        cmMessage.setUnicodeAndMultipart(CMConstants.DEFAULT_MULTIPARTS);

        assertEquals(3, cmMessage.getMultiparts(), "Call to getMultiparts() should have returned 3");
        assertFalse(cmMessage.isUnicode(), "Should not be unicode");
    }

    @Test
    public void testGSM338AndEQ8MAXGSMMESSAGELENGTH() {
        StringBuilder sb = new StringBuilder();
        for (int index = 0; index < (8 * CMConstants.MAX_GSM_MESSAGE_LENGTH_PER_PART_IF_MULTIPART); index++) {
            sb.append("a");
        }

        final CMMessage cmMessage = new CMMessage(validNumber, sb.toString());
        cmMessage.setUnicodeAndMultipart(CMConstants.DEFAULT_MULTIPARTS);

        assertEquals(8, cmMessage.getMultiparts(), "Call to getMultiparts() should have returned 8");
        assertFalse(cmMessage.isUnicode(), "Should not be unicode");
    }

    @Test
    public void testGSM338AndGT8MAXGSMMESSAGELENGTH() {

        StringBuilder sb = new StringBuilder();
        for (int index = 0; index < (8 * CMConstants.MAX_GSM_MESSAGE_LENGTH_PER_PART_IF_MULTIPART + 1); index++) {
            sb.append("a");
        }

        final CMMessage cmMessage = new CMMessage(validNumber, sb.toString());
        cmMessage.setUnicodeAndMultipart(CMConstants.DEFAULT_MULTIPARTS);

        assertEquals(8, cmMessage.getMultiparts(), "Call to getMultiparts() should have returned 8");
        assertFalse(cmMessage.isUnicode(), "Should not be unicode");
    }

    /*
     * Unicode Messages
     */

    @Test
    public void testUnicodeAndLTMAXGSMMESSAGELENGTH() {

        String ch = "\uF400";

        // 0338 and less than 160 char -> 1 part

        StringBuilder sb = new StringBuilder();
        for (int index = 0; index < CMConstants.MAX_UNICODE_MESSAGE_LENGTH; index++) {
            sb.append(ch);
        }

        final CMMessage cmMessage = new CMMessage(validNumber, sb.toString());
        cmMessage.setUnicodeAndMultipart(CMConstants.DEFAULT_MULTIPARTS);

        assertEquals(1, cmMessage.getMultiparts(), "Call to getMultiparts() should have returned 1");
        assertTrue(cmMessage.isUnicode(), "Should have been unicode");
    }

    @Test
    public void testUnicodeAndEQMAXGSMMESSAGELENGTH() {
        // 0338 and length is exactly 160 -> 1 part

        String ch = "\uF400";

        StringBuilder sb = new StringBuilder();
        for (int index = 0; index < CMConstants.MAX_UNICODE_MESSAGE_LENGTH; index++) {
            sb


  print("wasm-opt aborted with a CalledProcessError or OSError. Trying again after 1 minute...")
                    sleep(60)
                    # Wrapping this in str() seems necessary for Python 3.7.x and lower.
                    # See Python issue 31961
                    subprocess.run([str(ensure_binaryen(BINARYEN_URL, BINARYEN_VERSION)),
                                    str(seed),
                                    "--translate-to-fuzz",
                                    "--disable-simd",
                                    "--output", str(seed_wasm_output),
                                    f"--emit-js-wrapper={seed_wrapper_output}"], check=True)
                break
            sleep(sleep_time)
            sleep_time *= 2
    assert seed_wrapper_output.is_file()
    assert seed_wasm_output.is_file()

    return (seed_wrapper_output, seed_wasm_output)


.global gti2DeliverReliableMessage
gti2DeliverReliableMessage:
/* 8034A574 003461D4  94 21 FF 80 */	stwu r1, -0x80(r1)
/* 8034A578 003461D8  7C 08 02 A6 */	mflr r0
/* 8034A57C 003461DC  90 01 00 84 */	stw r0, 0x84(r1)
/* 8034A580 003461E0  39 61 00 80 */	addi r11, r1, 0x80
/* 8034A584 003461E4  4B E7 CB 9D */	bl _savegpr_25
/* 8034A588 003461E8  A0 E3 00 66 */	lhz r7, 0x66(r3)
/* 8034A58C 003461EC  2C 04 00 00 */	cmpwi r4, 0
/* 8034A590 003461F0  7C 7E 1B 78 */	mr r30, r3
/* 8034A594 003461F4  7C BF 2B 78 */	mr r31, r5
/* 8034A598 003461F8  38 07 00 01 */	addi r0, r7, 1
/* 8034A59C 003461FC  7C D9 33 78 */	mr r25, r6
/* 8034A5A0 00346200  B0 03 00 66 */	sth r0, 0x66(r3)
/* 8034A5A4 00346204  40 82 01 20 */	bne lbl_8034A6C4
/* 8034A5A8 00346208  80 83 00 0C */	lwz r4, 0xc(r3)
/* 8034A5AC 0034620C  2C 84 00 05 */	cmpwi cr1, r4, 5
/* 8034A5B0 00346210  41 86 00 9C */	beq cr1, lbl_8034A64C
/* 8034A5B4 00346214  2C 04 00 06 */	cmpwi r4, 6
/* 8034A5B8 00346218  41 82 00 94 */	beq lbl_8034A64C
/* 8034A5BC 0034621C  40 84 00 54 */	bge cr1, lbl_8034A610
/* 8034A5C0 00346220  80 03 00 10 */	lwz r0, 0x10(r3)
/* 8034A5C4 00346224  2C 00 00 00 */	cmpwi r0, 0
/* 8034A5C8 00346228  41 82 00 2C */	beq lbl_8034A5F4
/* 8034A5CC 0034622C  4B FF F3 25 */	bl gti2ConnectionClosed
/* 8034A5D0 00346230  7F C3 F3 78 */	mr r3, r30
/* 8034A5D4 00346234  38 80 00 07 */	li r4, 7
/* 8034A5D8 00346238  38 A0 00 00 */	li r5, 0
/* 8034A5DC 0034623C  38 C0 00 00 */	li r6, 0
/* 8034A5E0 00346240  4B FF E6 39 */	bl gti2ConnectedCallback
/* 8034A5E4 00346244  2C 03 00 00 */	cmpwi r3, 0
/* 8034A5E8 00346248  40 82 00 50 */	bne lbl_8034A638
/* 8034A5EC 0034624C  38 00 00 00 */	li r0, 0
/* 8034A5F0 00346250  48 00 00 4C */	b lbl_8034A63C
lbl_8034A5F4:
/* 8034A5F4 00346254  2C 04 00 04 */	cmpwi r4, 4
/* 8034A5F8 00346258  40 82 00 0C */	bne lbl_8034A604
/* 8034A5FC 0034625C  38 00 00 01 */	li r0, 1
/* 8034A600 00346260  90 03 00 14


).toBe(2601);
  });
  test('Friday 5pm', () => {
    expect(getWeek(new Date("2019-11-08T17:00:00.000Z"), 0)).toBe(2601);
  });
  test('Friday 6pm', () => {
    expect(getWeek(new Date("2019-11-08T18:00:00.000Z"), 0)).toBe(2601);
  });
  test('Friday 7pm', () => {
    expect(getWeek(new Date("2019-11-08T19:00:00.000Z"), 0)).toBe(2601);
  });
  test('Friday 8pm', () => {
    expect(getWeek(new Date("2019-11-08T20:00:00.000Z"), 0)).toBe(2601);
  });
  test('Friday 9pm', () => {
    expect(getWeek(new Date("2019-11-08T21:00:00.000Z"), 0)).toBe(2601);
  });
  test('Friday 10pm', () => {
    expect(getWeek(new Date("2019-11-08T22:00:00.000Z"), 0)).toBe(2601);
  });
  test('Friday 11pm', () => {
    expect(getWeek(new Date("2019-11-08T23:00:00.000Z"), 0)).toBe(2601);
  });
}

// Saturday
{
  test('Saturday 12am', () => {
    expect(getWeek(new Date("2019-11-09T00:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 1am', () => {
    expect(getWeek(new Date("2019-11-09T01:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 2am', () => {
    expect(getWeek(new Date("2019-11-09T02:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 3am', () => {
    expect(getWeek(new Date("2019-11-09T03:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 4am', () => {
    expect(getWeek(new Date("2019-11-09T04:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 5am', () => {
    expect(getWeek(new Date("2019-11-09T05:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 6am', () => {
    expect(getWeek(new Date("2019-11-09T06:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 7am', () => {
    expect(getWeek(new Date("2019-11-09T07:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 8am', () => {
    expect(getWeek(new Date("2019-11-09T08:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 9am', () => {
    expect(getWeek(new Date("2019-11-09T09:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 10am', () => {
    expect(getWeek(new Date("2019-11-09T10:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 11am', () => {
    expect(getWeek(new Date("2019-11-09T11:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 12pm', () => {
    expect(getWeek(new Date("2019-11-09T12:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 1pm', () => {
    expect(getWeek(new Date("2019-11-09T13:00:00.000Z"), 0)).toBe(2601);
  });
  test('Saturday 2pm', () => {


 if (!(o instanceof PlayerSettingInfo)) {
        return false;
      }
      PlayerSettingInfo other = (PlayerSettingInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasDisplayRecordType() || displayRecordType == other.displayRecordType)
        && (!hasB1() || b1 == other.b1)
        && (!hasB4() || b4 == other.b4)
        && (!hasB3() || b3 == other.b3)
        && (!hasB6() || b6 == other.b6)
        && (!hasB2() || b2 == other.b2)
        && (!hasB5() || b5 == other.b5);
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 96);
        output.writeEnumNoTag(displayRecordType);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 16);
        output.writeBoolNoTag(b1);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 24);
        output.writeBoolNoTag(b4);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 32);
        output.writeBoolNoTag(b3);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 40);
        output.writeBoolNoTag(b6);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 64);
        output.writeBoolNoTag(b2);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawByte((byte) 104);
        output.writeBoolNoTag(b5);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeEnumSizeNoTag(displayRecordType);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 2;
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public PlayerSettingInfo mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 96: {
            // displayRecordType
            final int value = input.readInt32();
            if (DisplayRecordTypeOuterClass.DisplayRecordType.forNumber(value) != null) {
              displayRecordType = value;
              bitField0_ |= 0x00000001;
            }
            tag = input.readTag();
            if (tag != 16) {
              break;
            }
          }
          case 16: {
            // b1
            b1 = input.readBool();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 24) {
              break;
            }
          }
          case 24


()
	// Synchronously add a dummy pod into the watch channel so we
	// know the RunUntil go routine is in the watch handler.
	fw.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}})

	cancel(errors.New("done"))
	resultCh := fw.ResultChan()
	for {
		select {
		case <-doneCh:
			if resultCh == nil {
				return // both closed
			}
			doneCh = nil
		case _, ok := <-resultCh:
			if ok {
				t.Fatalf("Watch channel left open after stopping the watch")
			}
			if doneCh == nil {
				return // both closed
			}
			resultCh = nil
		case <-time.After(wait.ForeverTestTimeout):
			t.Fatalf("the cancellation is at least %s late", wait.ForeverTestTimeout.String())
		}
	}
}

func TestReflectorResyncChan(t *testing.T) {
	s := NewStore(MetaNamespaceKeyFunc)
	g := NewReflector(&ListWatch{}, &v1.Pod{}, s, time.Millisecond)
	a, _ := g.resyncChan()
	b := time.After(wait.ForeverTestTimeout)
	select {
	case <-a:
		t.Logf("got timeout as expected")
	case <-b:
		t.Errorf("resyncChan() is at least 99 milliseconds late??")
	}
}

// TestReflectorWatchStoppedBefore ensures that neither List nor Watch are
// called if the stop channel is closed before Reflector.watch is called.
func TestReflectorWatchStoppedBefore(t *testing.T) {
	_, ctx := ktesting.NewTestContext(t)
	ctx, cancel := context.WithCancelCause(ctx)
	cancel(errors.New("don't run"))

	lw := &ListWatch{
		ListFunc: func(_ metav1.ListOptions) (runtime.Object, error) {
			t.Fatal("ListFunc called unexpectedly")
			return nil, nil
		},
		WatchFunc: func(_ metav1.ListOptions) (watch.Interface, error) {
			// If WatchFunc is never called, the watcher it returns doesn't need to be stopped.
			t.Fatal("WatchFunc called unexpectedly")
			return nil, nil
		},
	}
	target := NewReflector(lw, &v1.Pod{}, nil, 0)

	err := target.watch(ctx, nil, nil)
	require.NoError(t, err)
}

// TestReflectorWatchStoppedAfter ensures that neither the watcher is stopped if
// the stop channel is closed after Reflector.watch has started watching.
func TestReflectorWatchStoppedAfter(t *testing.T) {
	_, ctx := ktesting.NewTestContext(t)
	ctx, cancel := context.WithCancelCause(ctx)

	var watchers []*watch.FakeWatcher

	lw := &ListWatch{
		ListFunc: func(_ metav1.ListOptions) (runtime.Object, error) {
			t.Fatal("ListFunc called unexpectedly")
			return nil, nil
		},
		WatchFunc: func(_ metav1.ListOptions) (watch.Interface, error) {
			// Simulate the stop channel being closed after watching has started
			go func() {
				time.Sleep(10 * time.Millisecond)
				cancel(errors.New("10ms timeout reached"))
			}()
			// Use a fake watcher that never sends events
			w := watch.NewFake()
			watchers = append(watchers, w)
			return w, nil
		},
	}
	target := NewReflector(lw, &v1.Pod{}, nil, 0)

	err := target.watch(ctx, nil, nil)
	require.NoError(t, err)
	require.Len(t, watchers, 1)
	require.True(t, watchers[0].IsStopped())
}

func BenchmarkReflectorResyncChanMany(b *testing.B) {
	s := NewStore(MetaNamespaceKeyFunc)
	g := NewReflector(&ListWatch{}, &v1.Pod{}, s, 25*time.Millisecond)
	// The improvement to this (calling


o
            click there? */
}
.topic-browser-menu li > .sub-menu-custom .submenu-title .topic-link {
  margin-left: -5px;
  padding: 0 5px;
}
.topic-browser-menu li > .sub-menu-custom .submenu-title .topic-link:hover {
  background: #46a8bf;
}
.topic-browser-menu li > .sub-menu-custom .submenu-title > a {
  color: #ffffff;
}
.topic-browser-menu li > .sub-menu-custom .submenu-title {
  color: #ffffff;
}
.topic-browser-menu li > .sub-menu-custom .grade-group-header,
.topic-browser-menu li > .sub-menu-custom .subjects-header {
  margin: 15px 8px 4px;
}
.topic-browser-menu li > .sub-menu-custom .art-history-header,
.topic-browser-menu li > .sub-menu-custom .partner-content-header {
  margin-top: 31px;
}
.topic-browser-menu li > .sub-menu-custom .grade-group .secondary-children {
  clear: none;
  float: left;
  width: 48.93%;
}
.topic-browser-menu li > .sub-menu-custom .grade-group .secondary-children:nth-child(2n+1) {
  clear: both;
}
.topic-browser-menu li > .sub-menu-custom.sub-menu-custom.computing li,
.topic-browser-menu li > .sub-menu-custom.sub-menu-custom .sat li {
  width: 45%;
}
.topic-browser-menu li > .sub-menu-custom.sub-menu-custom.computing li a,
.topic-browser-menu li > .sub-menu-custom.sub-menu-custom .sat li a {
  font-size: 15px;
}
.topic-browser-menu li > .sub-menu-custom.sub-menu-custom.computing li a p,
.topic-browser-menu li > .sub-menu-custom.sub-menu-custom .sat li a p {
  font-size: 12px;
  margin-top: 10px;
  opacity: 0.9;
}
.topic-browser-menu li > .sub-menu-custom.sub-menu-custom.computing li:first-of-type,
.topic-browser-menu li > .sub-menu-custom.sub-menu-custom .sat li:first-of-type {
  margin-right: 20px;
}
.topic-browser-menu li > .sub-menu-custom .grade-group-header strong,
.topic-browser-menu li > .sub-menu-custom .subjects-header strong {
  color: #fff;
  font-size: 13px;
  opacity: 0.5;
  text-transform: uppercase;
}
.topic-browser-menu li > .sub-menu-custom .subjects-header a {
  color: inherit;
}
.topic-browser-menu li > .sub-menu-custom .menulink,
.topic-browser-menu li > .sub-menu-custom .menulink:link,
.topic-browser-menu li > .sub-menu-custom .menulink:visited {
  color: #ffffff;
  font: 13px/1.3 'Proxima Nova', sans-serif;
  width: auto;
}
.topic-browser-menu li > .sub-menu-custom .menulink:hover,
.topic-browser-menu li > .sub-menu-custom .topic-link:hover {
  background: #4d6779;
}
.topic-browser-menu li > .sub-menu-custom.science .menulink:hover,
.topic-browser-menu li > .sub-menu-custom.science .topic-link:hover {
  background: #9d4a5a;
}
.topic-browser-menu li > .sub-menu-custom.humanities .menulink:hover,
.topic-browser-menu li > .sub-menu-custom.humanities .topic-link:hover {


n: cumWALSecondaryWriteDuration,
			unflushedMemTableTooLarge:    unflushedMemTableTooLarge,
			smoothedIntL0CompactedBytes:  smoothedIntL0CompactedBytes,
			smoothedCompactionByteTokens: smoothedCompactionByteTokens,
			smoothedNumFlushTokens:       smoothedNumFlushTokens,
			flushUtilTargetFraction:      flushUtilTargetFraction,
			totalNumByteTokens:           totalNumByteTokens,
			byteTokensAllocated:          0,
			byteTokensUsed:               0,
			byteTokensUsedByElasticWork:  0,
			totalNumElasticByteTokens:    totalNumElasticByteTokens,
			elasticByteTokensAllocated:   0,
		},
		aux: adjustTokensAuxComputations{
			intL0AddedBytes:                 intL0AddedBytes,
			intL0CompactedBytes:             intL0CompactedBytes,
			intFlushTokens:                  intFlushTokens,
			intFlushDuration:                flushWriteThroughput.WorkDuration,
			intWriteStalls:                  intWriteStalls,
			intWALFailover:                  intWALFailover,
			prevTokensUsed:                  prev.byteTokensUsed,
			prevTokensUsedByElasticWork:     prev.byteTokensUsedByElasticWork,
			tokenKind:                       tokenKind,
			usedCompactionTokensLowerBound:  usedCompactionTokensLowerBound,
			recentUnflushedMemTableTooLarge: recentUnflushedMemTableTooLarge,
			doLogFlush:                      doLogFlush,
		},
		ioThreshold: ioThreshold,
	}
}

// adjustTokensResult encapsulates all the numerical state of ioLoadListener.
type adjustTokensResult struct {
	ioLoadListenerState
	requestEstimates storeRequestEstimates
	l0WriteLM        tokensLinearModel
	l0IngestLM       tokensLinearModel
	ingestLM         tokensLinearModel
	writeAmpLM       tokensLinearModel
	aux              adjustTokensAuxComputations
	ioThreshold      *admissionpb.IOThreshold // never nil
}

func (res adjustTokensResult) SafeFormat(p redact.SafePrinter, _ rune) {
	ib := humanizeutil.IBytes
	// NB: "≈" indicates smoothed quantities.
	p.Printf("compaction score %v (%d ssts, %d sub-levels), ", res.ioThreshold, res.ioThreshold.L0NumFiles, res.ioThreshold.L0NumSubLevels)
	var recentFlushBackogStr string
	if res.aux.recentUnflushedMemTableTooLarge {
		recentFlushBackogStr = " (flush-backlog) "
	}
	p.Printf("L0 growth %s%s (write %s (ignored %s) ingest %s (ignored %s)): ",
		ib(res.aux.intL0AddedBytes),
		redact.SafeString(recentFlushBackogStr),
		ib(res.aux.perWorkTokensAux.intL0WriteBytes),
		ib(res.aux.perWorkTokensAux.intL0IgnoredWriteBytes),
		ib(res.aux.perWorkTokensAux.intL0IngestedBytes),
		ib(res.aux.perWorkTokensAux.intL0IgnoredIngestedBytes))
	// Writes to L0 that we expected because requests told admission control.
	// This is the "easy path", from an estimation perspective, if all regular
	// writes accurately tell us what they write, and all ingests tell us what
	// they ingest and all of ingests into L0.
	p.Printf("requests %d (%d bypassed) with ", res.aux.perWorkTokensAux.intWorkCount,
		res.aux.perWorkTokensAux.intBypassedWorkCount)
	p.Printf("%s acc-write (%s bypassed) + ",
		ib(res.aux.perWorkTokensAux.intL0WriteAccountedBytes),
		ib(res.aux.perWorkTokensAux.intL0WriteBypassedAccountedBytes))
	// Ingestion bytes that we expected because requests told admission control.
	p.Printf("%s acc-ingest (%s bypassed) + ",
		ib(res.aux.perWorkTok


ermitted 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.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "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 COPYRIGHT
// OWNER OR CONTRIBUTORS 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.

#include <google/protobuf/util/json_util.h>

#include <cstdint>
#include <list>
#include <string>

#include <google/protobuf/util/internal/testdata/maps.pb.h>
#include <google/protobuf/util/json_format.pb.h>
#include <google/protobuf/util/json_format_proto3.pb.h>
#include <gtest/gtest.h>
#include <google/protobuf/descriptor_database.h>
#include <google/protobuf/dynamic_message.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/util/type_resolver.h>
#include <google/protobuf/util/type_resolver_util.h>

namespace google {
namespace protobuf {
namespace util {
namespace {

using proto3::BAR;
using proto3::FOO;
using proto3::TestAny;
using proto3::TestEnumValue;
using proto3::TestMap;
using proto3::TestMessage;
using proto3::TestOneof;
using proto_util_converter::testing::MapIn;

// As functions defined in json_util.h are just thin wrappers around the
// JSON conversion code in //net/proto2/util/converter, in this test we
// only cover some very basic cases to make sure the wrappers have forwarded
// parameters to the underlying implementation correctly. More detailed
// tests are contained in the //net/proto2/util/converter directory.
class JsonUtilTest : public ::testing::Test {
 protected:
  JsonUtilTest() {}

  std::string ToJson(const Message& message, const JsonPrintOptions& options) {
    std::string result;
    GOOGLE_CHECK_OK(MessageToJsonString(message, &result, options));
    return result;
  }

  bool FromJson(const std::string& json, Message* message,
                const JsonParseOptions& options) {
    return JsonStringToMessage(json, message, options).ok();
  }

  bool FromJson(const std::string& json, Message* message) {
    return FromJson(json, message, JsonParseOptions());
  }

  std::unique_ptr<TypeResolver> resolver_;
};

TEST_F(JsonUtilTest, TestWhitespaces) {
  TestMessage m;
  m.mutable_message_value();

  JsonPrintOptions options;
  EXPECT_EQ("{\"messageValue\":{}}", ToJson(m, options));
  options.add_whitespace = true;
  EXPECT_EQ(
      "{\n"
      " \"


'
|contents
',
      },
      '<CR>',
      {
        '
',
        '  |contents',
        '
',
      }
    )
    spec.assert(
      {
        '
|contents
',
      },
      '<CR>',
      {
        '
',
        '  |contents',
        '
',
      }
    )
    spec.assert(
      {
        '
|contents
',
      },
      '<CR>',
      {
        '
',
        '  |contents',
        '
',
      }
    )
  end)
end)


"
	"crypto/md5"
	"crypto/rand"
	"crypto/rsa"
	"crypto/sha256"
	"crypto/x509"
	"encoding/asn1"
	"encoding/base64"
	"encoding/binary"
	"encoding/hex"
	"encoding/pem"
	"errors"
	"fmt"
	"io"
	"math/big"
	"strings"

	"github.com/xxx/wscan/mylib/ssh/internal/bcrypt_pbkdf"
)

// Public key algorithms names. These values can appear in PublicKey.Type,
// ClientConfig.HostKeyAlgorithms, Signature.Format, or as AlgorithmSigner
// arguments.
const (
	KeyAlgoRSA        = "ssh-rsa"
	KeyAlgoDSA        = "ssh-dss"
	KeyAlgoECDSA256   = "ecdsa-sha2-nistp256"
	KeyAlgoSKECDSA256 = "sk-ecdsa-sha2-nistp256@openssh.com"
	KeyAlgoECDSA384   = "ecdsa-sha2-nistp384"
	KeyAlgoECDSA521   = "ecdsa-sha2-nistp521"
	KeyAlgoED25519    = "ssh-ed25519"
	KeyAlgoSKED25519  = "sk-ssh-ed25519@openssh.com"

	// KeyAlgoRSASHA256 and KeyAlgoRSASHA512 are only public key algorithms, not
	// public key formats, so they can't appear as a PublicKey.Type. The
	// corresponding PublicKey.Type is KeyAlgoRSA. See RFC 8332, Section 2.
	KeyAlgoRSASHA256 = "rsa-sha2-256"
	KeyAlgoRSASHA512 = "rsa-sha2-512"
)

const (
	// Deprecated: use KeyAlgoRSA.
	SigAlgoRSA = KeyAlgoRSA
	// Deprecated: use KeyAlgoRSASHA256.
	SigAlgoRSASHA2256 = KeyAlgoRSASHA256
	// Deprecated: use KeyAlgoRSASHA512.
	SigAlgoRSASHA2512 = KeyAlgoRSASHA512
)

// parsePubKey parses a public key of the given algorithm.
// Use ParsePublicKey for keys with prepended algorithm.
func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err error) {
	switch algo {
	case KeyAlgoRSA:
		return parseRSA(in)
	case KeyAlgoDSA:
		return parseDSA(in)
	case KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521:
		return parseECDSA(in)
	case KeyAlgoSKECDSA256:
		return parseSKECDSA(in)
	case KeyAlgoED25519:
		return parseED25519(in)
	case KeyAlgoSKED25519:
		return parseSKEd25519(in)
	case CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoSKECDSA256v01, CertAlgoED25519v01, CertAlgoSKED25519v01:
		cert, err := parseCert(in, certKeyAlgoNames[algo])
		if err != nil {
			return nil, nil, err
		}
		return cert, nil, nil
	}
	return nil, nil, fmt.Errorf("ssh: unknown key algorithm: %v", algo)
}

// parseAuthorizedKey parses a public key in OpenSSH authorized_keys format
// (see sshd(8) manual page) once the options and key type fields have been
// removed.
func parseAuthorizedKey(in []byte) (out PublicKey, comment string, err error) {
	in = bytes.TrimSpace(in)

	i := bytes.IndexAny(in, " \t")
	if i == -1 {
		i = len(in)
	}
	base64Key := in[:i]

	key := make([]byte, base64.StdEncoding.DecodedLen(len(base64Key)))
	n, err := base64.StdEncoding.Decode(key, base64Key)
	if err != nil {
		return nil, "", err
	}
	key = key[:n]
	out, err = ParsePublicKey(key)
	if err != nil {


\r\nDate: Sat, 04 Jan 2025 11:32:01 GMT\r\nServer: nginx/1.19.0\r\nX-Powered-By: PHP/5.6.40-38+ubuntu20.04.1+deb.sury.org+1\r\n\r\n\nWarning: mysql_connect(): Connection refused in /hj/var/www/database_connect.php on line 2\nWebsite is out of order. Please visit back later. Thank you for understanding."]],"extra":{"param":{}}},"plugin":"baseline/sensitive/server-error","target":{"url":"http://testphp.vulnweb.com/secured/newuser.php"}})</script>
<script class='web-vulns'>webVulns.push({"create_time":1735990386062,"detail":{"addr":"http://testphp.vulnweb.com/secured/phpinfo.php","payload":"/secured/phpinfo.php","snapshot":[["GET /secured/phpinfo.php HTTP/1.1\r\nHost: testphp.vulnweb.com\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0\r\nContent-Length: 175\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7\r\nCache-Control: max-age=0\r\nContent-Type: application/x-www-form-urlencoded\r\nOrigin: http://testphp.vulnweb.com\r\nReferer: http://testphp.vulnweb.com/signup.php\r\nSpider-Name: crawlergo\r\nUpgrade-Insecure-Requests: 1\r\nAccept-Encoding: gzip\r\n\r\nuaddress=C\u0026ucc=Crawlergo\u0026uemail=crawlergo%40gmail.com\u0026upass=Crawlergo6.\u0026upass2=Crawlergo6.\u0026uphone=18812345678\u0026urname=crawlergo%40gmail.com\u0026uuname=rcarwalwelregrogo%40gmail.com","HTTP/1.1 200 OK\r\nConnection: keep-alive\r\nContent-Type: text/html; charset=UTF-8\r\nDate: Sat, 04 Jan 2025 11:33:05 GMT\r\nServer: nginx/1.19.0\r\nX-Powered-By: PHP/5.6.40-38+ubuntu20.04.1+deb.sury.org+1\r\n\r\n\u003c!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\"\u003e\r\n\u003chtml\u003e\u003chead\u003e\r\n\u003cstyle type=\"text/css\"\u003e\r\nbody {background-color: #ffffff; color: #000000;}\r\nbody, td, th, h1, h2 {font-family: sans-serif;}\r\npre {margin: 0px; font-family: monospace;}\r\na:link {color: #000099; text-decoration: none; background-color: #ffffff;}\r\na:hover {text-decoration: underline;}\r\ntable {border-collapse: collapse;}\r\n.center {text-align: center;}\r\n.center table { margin-left: auto; margin-right: auto; text-align: left;}\r\n.center th { text-align: center !important; }\r\ntd, t


PENDSVSET_BIT    ( 1UL << 28UL )
    #define portEND_SWITCHING_ISR( xSwitchRequired )    if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
    #define portYIELD_FROM_ISR( x )                     portEND_SWITCHING_ISR( x )
/*-----------------------------------------------------------*/

/**
 * @brief Critical section management.
 */
    #define portSET_INTERRUPT_MASK_FROM_ISR()         ulSetInterruptMask()
    #define portCLEAR_INTERRUPT_MASK_FROM_ISR( x )    vClearInterruptMask( x )
    #define portDISABLE_INTERRUPTS()                  ulSetInterruptMask()
    #define portENABLE_INTERRUPTS()                   vClearInterruptMask( 0 )
    #define portENTER_CRITICAL()                      vPortEnterCritical()
    #define portEXIT_CRITICAL()                       vPortExitCritical()
/*-----------------------------------------------------------*/

/**
 * @brief Tickless idle/low power functionality.
 */
    #ifndef portSUPPRESS_TICKS_AND_SLEEP
        extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime );
        #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )    vPortSuppressTicksAndSleep( xExpectedIdleTime )
    #endif
/*-----------------------------------------------------------*/

/**
 * @brief Task function macros as described on the FreeRTOS.org WEB site.
 */
    #define portTASK_FUNCTION_PROTO( vFunction, pvParameters )    void vFunction( void * pvParameters )
    #define portTASK_FUNCTION( vFunction, pvParameters )          void vFunction( void * pvParameters )
/*-----------------------------------------------------------*/

    #if ( configENABLE_TRUSTZONE == 1 )

/**
 * @brief Allocate a secure context for the task.
 *
 * Tasks are not created with a secure context. Any task that is going to call
 * secure functions must call portALLOCATE_SECURE_CONTEXT() to allocate itself a
 * secure context before it calls any secure function.
 *
 * @param[in] ulSecureStackSize The size of the secure stack to be allocated.
 */
        #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )    vPortAllocateSecureContext( ulSecureStackSize )

/**
 * @brief Called when a task is deleted to delete the task's secure context,
 * if it has one.
 *
 * @param[in] pxTCB The TCB of the task being deleted.
 */
        #define portCLEAN_UP_TCB( pxTCB )                           vPortFreeSecureContext( ( uint32_t * ) pxTCB )
    #else
        #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )
        #define portCLEAN_UP_TCB( pxTCB )
    #endif /* configENABLE_TRUSTZONE */
/*-----------------------------------------------------------*/

    #if ( configENABLE_MPU == 1 )

/**
 * @brief Checks whether or not the processor is privileged.
 *
 * @return 1 if the processor is already privileged, 0 otherwise.
 */
        #define portIS_PRIVILEGED()      xIsPrivileged()

/**
 * @brief Raise an SVC request to raise privilege.
 *
 * The SVC handler checks that the SVC was raised from a system call and only
 * then it raises the privilege. If this is called from any other place,
 * the privilege is not raised.
 */
        #define portRAISE_PRIVILEGE()    __asm volatile ( "svc %0 \n" ::"i" ( portSVC_RAISE_PRIVILEGE ) : "memory" );

/**
 * @brief Lowers the privilege level by setting the bit 0 of the CONTROL
 * register.
 */
        #define portRESET_PRIVILEGE()    vResetPrivilege()
    #else
        #define portIS_PRIVILEGED()
        #define portRAISE_PRIVILEGE()
        #define portRESET_PRIVILEGE()
    #endif /* configENABLE_MPU */
/*-----------------------------------------------------------*/

/**
 * @brief Barriers.
 */
    #define portMEMORY_BARRIER()    __asm volatile ( "" ::: "memory" )
/*-----------------------------------------------------------*/

    #ifdef __cplusplus
        }
    #endif

#endif /* PORTMACRO_H */


   console.log(chaine)
    const { data } = await api.get<PhotoSchema>(chaine)
    const photo = new Photo(data)
    return  photo
  }
}

export default Photoimport { Pipe, PipeTransform } from '@angular/core';
import { PaginationService } from '../services/pagination.service';

export interface PaginationParams {
  itemsPerPage: number;
  currentPage: number;
}

type Pages = Array<unknown[]>;

@Pipe({
  name: 'paginate',
})
export class PaginatePipe implements PipeTransform {
  constructor(private paginationService: PaginationService) {}

  // TODO: create better typing
  transform(items: unknown[], params: PaginationParams): unknown[] {
    this.paginationService.setCurrentPage(params.currentPage);

    const pages: Pages = [];

    for (let i = 0; i < items.length; i += params.itemsPerPage) {
      const pageEnd = i + params.itemsPerPage;

      pages.push(items[pageEnd] ? items.slice(i, pageEnd) : items.slice(i));
    }

    this.paginationService.setTotalPages(pages.length);

    const currentPage = params.currentPage - 1;
    return pages[currentPage];
  }
}

import {Injectable} from "angular2/core";  // TODO: Research me ... used as a decorater
import {Http, Headers, RequestOptions, Response} from "angular2/http";  // TODO: Research me
import {Observable, Subject} from "rxjs/Rx"; // TODO: Research me ... stream of data
import {Claimant} from "../classes/claimant";

// What does Injectable() do?
@Injectable()
export class ClaimantService {
  constructor (private http: Http) {
    this._claimantBaseUrl = "http://localhost:50299/";
    this._claimantsUrl = this._claimantBaseUrl + "api/values";  // URL to web api
  }

  private _claimantBaseUrl: string;
  private _claimantsUrl: string;

  // https://angular.io/docs/ts/latest/cookbook/component-communication.html#!#bidirectional-service
  // Observable Claimant streams
  private _claimantList = new Subject<Claimant[]>(); // Subject is an observer and observable
  claimantList$ = this._claimantList.asObservable();

  // Only works if the web client lives on the same domain as _claimantsUrl.
  // This is because of the Same-origin policy (a rule enforced by browsers).
  // https://angular.io/docs/ts/latest/guide/server-communication.html#!#jsonp
  getClaimants() {
    // let claimants: Claimant[];
    // let claimant: Claimant;
    // claimant.Id = "foo";
    // claimant.Name = "bar";
    // claimant.Nickname = "kylos";
    // claimants.push(claimant);
     return this.http.get(this._claimantsUrl)
                    .map(res => <Claimant[]> res.json()) // map is a RxJS  function
                    // .do(data => console.log(data)) // TODO: ditch me, this is just for inspection...do is a RxJS  function
                    .catch(this.handleError);
  }

  addClaimant (Name: string, Nickname: string): Observable<Claimant[]> {

    // relevant to web api receiving data, http://www.asp.net/web-api/overview/advanced/sending-html-form-data-part-1#sending_complex_types
    let theClaimant: Claimant = {
      Id: null,
      Name: Name,
      Nickname: Nickname
    };
    let


in it. (No need to mention variable types)

  // One way to pass data from component to component is calling @Input()
  // persons: string[] = ['Max', 'Manuel', 'Anna'];

  // onPersonCreated(name: string) { // Not needed because using Angular service
  //   this.persons.push(name);
  // }
}
import {Component} from "@angular/core";

@Component({
    selector: 'noteLazyLoad',
    template: `

NoteLazyLoad

      I am a lazy loaded component that's loaded on a per needed basis, kind of like require([...])
      `
})

export class NoteLazyLoad {
    constructor(){
        console.log('lazy loaded NoteLazyLoad');
    }
}

import { Edge } from './Edge';
import { Graph } from './Graph';
import { dfs_rec } from './algorithms/dfs';
import { dijkstra } from './algorithms/dijkstra';

const graph = new Graph([]);

/*
graph.push(new Edge(1, 2));
graph.push(new Edge(2, 1));

graph.push(new Edge(1, 3));
graph.push(new Edge(3, 1));

graph.push(new Edge(2, 4));
graph.push(new Edge(4, 2));

graph.push(new Edge(2, 5));
graph.push(new Edge(5, 2));

graph.push(new Edge(4, 8));
graph.push(new Edge(8, 4));

graph.push(new Edge(5, 9));
graph.push(new Edge(9, 5));

graph.push(new Edge(3, 6));
graph.push(new Edge(6, 3));

graph.push(new Edge(3, 7));
graph.push(new Edge(7, 3));
*/

graph.push(new Edge(1, 3, 6));
graph.push(new Edge(1, 4, 3));
graph.push(new Edge(2, 1, 3));
graph.push(new Edge(3, 4, 2));
graph.push(new Edge(4, 2, 1));
graph.push(new Edge(4, 3, 1));
graph.push(new Edge(5, 2, 4));
graph.push(new Edge(5, 4, 2));
console.log(graph.edges);

dijkstra(5, graph);
import winston from 'winston';
import DailyRotateFile from 'winston-daily-rotate-file';

import { LogLevel } from './log-level';
import { getLogFilePath, getLogDirectoryPath, ensureDir } from './helpers';

const MAX_LOG_FILES = 14;

const { combine, printf, timestamp } = winston.format;

function initializeWinston(filename: string): winston.LogMethod {
  const fileLogger = new DailyRotateFile({
    filename: filename,
    level: 'info',
    maxFiles: MAX_LOG_FILES
  });

  const consoleLogger = new winston.transports.Console({
    level: 'debug'
  });

  winston.configure({
    format: combine(
      timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS' }),
      printf(info => `${info.timestamp} [${info.level}]: ${info.message}`)
    ),
    transports: [consoleLogger, fileLogger]
  });

  return winston.log;
}

let loggerPromise: Promise<winston.LogMethod> | null = null;

function getLogger(): Promise<winston.LogMethod> {
  if (loggerPromise) {
    return loggerPromise;
  }

  loggerPromise = new Promise<winston.LogMethod>((resolve, reject) => {
    const logDirectory = getLogDirectoryPath();
    try {
      ensureDir(logDirectory);


nt,
                      textColor: Colors.white,
                      child: Text("USE CAMERA"),
                      onPressed: () async {
                        final String path = await getImage(ImageSource.camera);
                        _startDetection(path);
                      })),
              Container(
                  width: MediaQuery.of(context).size.width,
                  child: RaisedButton(
                      color: Colors.blueAccent,
                      textColor: Colors.white,
                      child: Text("PICK FROM GALLERY"),
                      onPressed: () async {
                        final String path = await getImage(ImageSource.gallery);
                        _startDetection(path);
                      })),
            ],
          ),
        ));
  }
}
/*
    Copyright 2020-2021. Huawei Technologies Co., Ltd. All rights reserved.

    Licensed under the Apache License, Version 2.0 (the "License")
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        https://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

import 'package:flutter/material.dart';

Widget detectionButton({String label, @required Function onPressed}) =>
    Container(
        width: double.infinity,
        padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
        child: RaisedButton(
          color: Colors.lightBlue,
          textColor: Colors.white,
          padding: EdgeInsets.symmetric(vertical: 10),
          child: Text(label ?? "Start analyze"),
          onPressed: onPressed,
        ));
/*
    Copyright 2020-2024. Huawei Technologies Co., Ltd. All rights reserved.

    Licensed under the Apache License, Version 2.0 (the "License")
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        https://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

library huawei_ads;

import 'dart:async';
import 'dart:collection';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

part '/src/adslite/bidding_param.dart';
part 'src/adslite/ad_param.dart';
part 'src/adslite/ad_size.dart';
part 'src/adslite/advertiser_info.dart';
part 'src/adslite/banner/banner_ad.dart';
part 'src/adslite/banner/banner_ad_size.dart';
part 'src/adslite/banner/banner_view.dart';
part 'src/adslite/bidding_info.dart';
part 'src/adslite/consent/ad_provider.dart';
part 'src/adslite/consent/consent.dart';
part 'src/adslite/hw_ads.dart';
part 'src/adslite/instream/instream_ad.dart';
part 'src/adslite/instream/instream_ad_loader.dart';
part 'src/adslite/instream/instream_ad_view.dart';
part 'src/adslite/instream/instream_ad_view_elements.dart';
part 'src/adslite/interstitial/interstitial_ad.dart';
part 'src/adslite/nativead/app_info.dart';
part 'src/adslite/nativead/detailed_creative_type.dart';


        }
      }

      this.vramDirty = true;
    }
  }

  public void uploadData15(final Rect4i rect, final int[] data) {
    final int rectX = rect.x;
    final int rectY = rect.y;
    final int rectW = rect.w;
    final int rectH = rect.h;

    assert rectX + rectW <= this.vramWidth : "Rect right (" + (rectX + rectW) + ") overflows VRAM width (" + this.vramWidth + ')';
    assert rectY + rectH <= this.vramHeight : "Rect bottom (" + (rectY + rectH) + ") overflows VRAM height (" + this.vramHeight + ')';

    LOGGER.debug("Copying (%d, %d, %d, %d) from CPU to VRAM", rectX, rectY, rectW, rectH);

    synchronized(this.vramLock) {
      int i = 0;
      for(int y = rectY; y < rectY + rectH; y++) {
        for(int x = rectX; x < rectX + rectW; x++) {
          this.setVramPixel(x, y, colour15To24(data[i]), data[i]);
          i++;
        }
      }

      this.vramDirty = true;
    }
  }

  public void downloadData15(final Rect4i rect, final FileData out) {
    final int rectX = rect.x;
    final int rectY = rect.y;
    final int rectW = rect.w;
    final int rectH = rect.h;

    assert rectX + rectW <= this.vramWidth : "Rect right (" + (rectX + rectW) + ") overflows VRAM width (" + this.vramWidth + ')';
    assert rectY + rectH <= this.vramHeight : "Rect bottom (" + (rectY + rectH) + ") overflows VRAM height (" + this.vramHeight + ')';

    LOGGER.debug("Copying (%d, %d, %d, %d) from VRAM to byte array", rectX, rectY, rectW, rectH);

    synchronized(this.vramLock) {
      int i = 0;
      for(int y = rectY; y < rectY + rectH; y++) {
        for(int x = rectX; x < rectX + rectW; x++) {
          final int pixel = this.getPixel15(x, y);
          out.writeByte(i, (byte)(pixel & 0xff));
          out.writeByte(i + 1, (byte)(pixel >>> 8));
          i += 2;
        }
      }
    }
  }

  public void downloadData15(final Rect4i rect, final int[] out) {
    final int rectX = rect.x;
    final int rectY = rect.y;
    final int rectW = rect.w;
    final int rectH = rect.h;

    assert rectX + rectW <= this.vramWidth : "Rect right (" + (rectX + rectW) + ") overflows VRAM width (" + this.vramWidth + ')';
    assert rectY + rectH <= this.vramHeight : "Rect bottom (" + (rectY + rectH) + ") overflows VRAM height (" + this.vramHeight + ')';

    LOGGER.debug("Copying (%d, %d, %d, %d) from VRAM to byte array", rectX, rectY, rectW, rectH);

    synchronized(this.vramLock) {
      int i = 0;
      for(int y = rectY; y < rectY + rectH; y++) {
        for(int x = rectX; x < rectX + rectW; x++) {
          out[i++] = this.getPixel15(x, y);
        }
      }
    }
  }

  public void copyVramToVram(final int sourceX, final int sourceY, final int destX, final int destY, final int width, final int height) {
    LOGGER.debug("COPY VRAM VRAM from %d %d to %d %d size %d %d", sourceX, sourceY, destX, destY, width, height);

    synchronized(this.vramLock) {
      for(int y


图如图  19(c)和图  19(d)所示，这两种体积的求取对真实目标物体的包装运输有一定的现实意义[78]。

# 四，软件运行和测试

本节将使用本文开发的点云处理及三维重建软件对不同场景的点云数据进行点云处理预处理实验、点云配准实验、点云表面重建实验、点云分割实验以及点云属性计算实验，以验证本文软件的有效性和实用性。图  20为选取的两个主要的实验点云图像，图  20(a)为桌子的点云图像，该点云图像数据量较大，有460400个数据点。从图像中可以看出，该点云中含有较多的离群噪声点，且点云空间不闭合，对此类点云进行三维重建的难度较大。图  20(b)为中国龙的点云图像，该点云数据量也较大，共有437645个数据点，与图  20(a)不同，该点云的空间特性呈闭合形态，但是该点云表面曲率复杂且变化大，有较多的凸起区域，对其进行三维重建同样也有较大难度。

![P1775C1T111\#yIS1](README.assets/2f48aefc257530aa8fc430748153d840.png)

![P1777C2T111\#yIS1](README.assets/c4540c4922798949489ffec02a898bed.png)

图  20 实验点云对象

## 4.1 点云预处理功能测试

如图  21(a)和图  21(b)所示，为使用本文软件对两个点云图像进行加载显示的主界面。然后点击软件功能按钮，对当前点云图像进行离群点移除（使用KD-TREE加速的KANN-DBSCAN离群点移除算法）、滤波平滑（高斯滤波）以及下采样（基于体素的下采样）等预处理操作。图  21(c)和图  21(d)为软件处理点云时的工作示意图。图  21(e)和图  21(f)为点云预处理之后的结果。从图中可以看到，本文软件不仅将两幅点云图像中的离群点移除干净，还使得点云数据在保留其表面特征的前提下，其点云规模得到极大的精简。从表 6中可以看到，对桌子点云的点云预处理时间为1955 ms，点云精简率为0.07。中国龙点云的处理时间为1373 ms，其精简率为0.055。虽然两点云图像点云规模都从十万级精简到了万级，但是点云的轮廓特征并没有受到影响。

| ![P1783C1T112\#yIS1](introduction/media/bdf0e057f776da1263286f2c45dfcc7b.png) 桌子点云图像加载完成 | ![P1785C2T112\#yIS1](introduction/media/4f82a2a5bf4cbb680e04df904c56f153.png) 中国龙点云图像加载完成 |
| ------------------------------------------------------------ | ----------------------------------------


,
                        mode: 'xy',
                    },
                    zoom: {
                        wheel: {
                            enabled: true,
                        },
                        pinch: {
                            enabled: true
                        },
                        mode: 'xy',
                    }
                }
            },
            responsive: true,
        }
    });
    // Zoom control buttons
    document.getElementById('zoomIn').addEventListener('click', () => {
        dataChart.zoom(1.1);
    });

    document.getElementById('zoomOut').addEventListener('click', () => {
        dataChart.zoom(0.9);
    });

    document.getElementById('resetZoom').addEventListener('click', () => {
        dataChart.resetZoom();
    });

    </script>
{% endblock %}
{% extends 'layout.html' %}

{% block content %}

I need more info!

                As I've already said, you can find more info about Flask Kit on
                GitHub.
                There is nothing to learn, just follow the proposed project structure.

                This Kit uses some popular extensions, like
                Flask-DebugToolbar and
                Flask-SQLAlchemy.
                Feel free to install more, but don't forget to define them in ext.py and to register them
                in settings.py. You can find examples in the code.

{% endblock %}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>$projectname: $title</title>
<title>$title</title>
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>

$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet


.MIN_VALUE, nm)
        }
    }

    @Test
    fun to_imperial_components_works() {
        val length = 1.miles + 1.yards + 1.feet + 1.inches
        length.toUnitedStatesCustomaryComponents { miles, yards, feet, inches ->
            assertEquals(1L, miles)
            assertEquals(1L, yards)
            assertEquals(1L, feet)
            assertEquals(1.0, inches)
        }
    }

    @Test
    fun to_imperial_components_positive_infinity_max_value_every_component() {
        POSITIVE_INFINITY.nanometers.toUnitedStatesCustomaryComponents { miles, yards, feet, inches ->
            assertEquals(Long.MAX_VALUE, miles)
            assertEquals(Long.MAX_VALUE, yards)
            assertEquals(Long.MAX_VALUE, feet)
            assertEquals(Double.POSITIVE_INFINITY, inches)
        }
    }

    @Test
    fun to_imperial_components_negative_infinity_min_value_every_component() {
        NEGATIVE_INFINITY.nanometers.toUnitedStatesCustomaryComponents { miles, yards, feet, inches ->
            assertEquals(Long.MIN_VALUE, miles)
            assertEquals(Long.MIN_VALUE, yards)
            assertEquals(Long.MIN_VALUE, feet)
            assertEquals(Double.NEGATIVE_INFINITY, inches)
        }
    }

    @Test
    @WasmWasiIgnore // See: https://youtrack.jetbrains.com/issue/KT-60964.
    fun default_to_string_renders_into_metric_components() {
        val length = 10_000.meters
        assertEquals(
            expected = "10.00km",
            actual = length.toString(),
        )
    }

    @Test
    fun to_string_infinity() {
        assertEquals("Infinity", POSITIVE_INFINITY.nanometers.toString())
        assertEquals("-Infinity", NEGATIVE_INFINITY.nanometers.toString())
    }

    @Test
    fun to_double_converts_miles_to_km_correctly() {
        assertEquals(1.609344, 1.miles.toDouble(LengthUnit.International.Kilometer))
    }

    @Test
    fun length_mul_length_maximum_nanometers_component_is_lost_to_precision() {
        // 0.998001998 millimeters², but we lose precision.
        val nanos = 999_999.nanometers
        assertEquals(0.mm2, nanos * nanos)
    }

    @Test
    fun length_mul_length_gigameters_is_infinite() {
        assertEquals(POSITIVE_INFINITY.mm2, 1.gigameters * 1.gigameters)
        assertEquals(NEGATIVE_INFINITY.mm2, 1.gigameters * (-1).gigameters)
        assertEquals(POSITIVE_INFINITY.mm2, (-1).gigameters * (-1).gigameters)
        assertEquals(NEGATIVE_INFINITY.mm2, (-1).gigameters * 1.gigameters)
    }

    @Test
    fun length_mul_length_megameter_overflow() {
        assertEquals(POSITIVE_INFINITY.mm2, 100.megameters * 10.megameters)
    }

    @Test
    fun length_mul_length_megameter_no_overflow() {
        assertEquals(
            expected = 8_000_000_000_000_000_000L.mm2,
            actual = 4.megameters * 2.megameters
        )
    }

    @Test
    fun length_squared_is_correct() {
        assertEquals(
            expected = 1_000_000.mm2,
            actual = 1.meters.squared(),
        )
    }

    @Test
    fun infinite_length_div_infinite_time_throws() {
        assertFailsWith<IllegalArgumentException> {
            POSITIVE_INFINITY.nanometers / Duration.INFINITE
        }
        assertFailsW


Array = context.obtainStyledAttributes(attrs, R.styleable.LoadingView, defStyle, 0)

        with(typeArray){
            duration = getInt(R.styleable.LoadingView_duration, duration)

            outerColor = getColor(R.styleable.LoadingView_outer_color, Color.BLACK)
            innerColor = getColor(R.styleable.LoadingView_inner_color, Color.BLACK)

            startAngle = getFloat(R.styleable.LoadingView_start_angle, startAngle)

            arcWidth = getDimension(R.styleable.LoadingView_arc_width, arcWidth)
            intervalWidth = getDimension(R.styleable.LoadingView_interval_width, intervalWidth)

            recycle()
        }

        outerPaint = initPaint(outerColor)
        innerPaint = initPaint(innerColor)

        outerRectF = initOuterRectF()
        innerRectF = initInnerRectF()

        initValueAnimator()
    }

    private fun initPaint(color: Int): Paint {

        val paint = Paint()

        paint.isAntiAlias = true
        paint.style = Paint.Style.STROKE
        paint.strokeWidth = arcWidth
        // 设置拐角的形状
        paint.strokeJoin = Paint.Join.ROUND
        // 设置线头的形状
        paint.strokeCap = Paint.Cap.ROUND
        paint.color = color

        return paint
    }

    private fun initOuterRectF(): RectF {
        val leftTop = arcWidth
        val rightBottom = defaultSize - arcWidth

        return RectF().also { it.set(leftTop, leftTop, rightBottom, rightBottom) }
    }

    private fun initInnerRectF(): RectF {
        val leftTop = intervalWidth + arcWidth
        val rightBottom = defaultSize - intervalWidth - arcWidth

        return RectF().also { it.set(leftTop, leftTop, rightBottom, rightBottom) }
    }

    private fun initValueAnimator() {
        valueAnimator.duration = duration.toLong()
        valueAnimator.interpolator = LinearInterpolator()
        //无限循环
        valueAnimator.repeatCount = ValueAnimator.INFINITE
        valueAnimator.repeatMode = ValueAnimator.RESTART

        valueAnimator.addUpdateListener { valueAnimator ->
            val curValue = valueAnimator.animatedValue as Float
            startAngle = 360 * curValue
            invalidate()
        }
    }

    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec)

        val width = measureSize(widthMeasureSpec, defaultSize)
        val height = measureSize(heightMeasureSpec, defaultSize)

        defaultSize = Math.min(width, height)
        setMeasuredDimension(defaultSize, defaultSize)
    }

    //根据不同的model处理不同的尺寸
    private fun measureSize(measureSpec: Int, defaultSize: Int): Int {
        var result = 0
        val model = MeasureSpec.getMode(measureSpec)
        val size = MeasureSpec.getSize(measureSpec)
        when (model) {
            //不限制，使用默认的尺寸
            MeasureSpec.UNSPECIFIED -> result = defaultSize
            // 最大上限
            MeasureSpec.AT_MOST -> result = Math.min(defaultSize, size)
            MeasureSpec.EXACTLY -> result = size
        }

        return result
    }

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)

        // 画外弧
        canvas?.drawArc(outerRectF, startAngle, outerArcAngle, false, outerPaint)

        // 画内弧
        canvas?.drawArc(innerRectF, 360 - startAngle, innerArcAngle, false, innerPaint)
    }

    fun start(


C6FE82819C6E1D55
        L0_3 = L0_3.S12F63EE47FFCB183
        L0_3()
      end
      while true do
        L0_3 = cDFF6D3D5
        L0_3 = L0_3.f6E019F84
        L1_3 = "UI_DECIDE"
        L0_3 = L0_3(L1_3)
        if not L0_3 then
          L0_3 = cDFF6D3D5
          L0_3 = L0_3.f6E019F84
          L1_3 = "UI_CANCEL"
          L0_3 = L0_3(L1_3)
          if not L0_3 then
            goto lbl_38
          end
        end
        L0_3 = A3_2
        if L0_3 then
          L0_3 = C512D905984DB3137
          L0_3 = L0_3.S951721F06005846C
          L1_3 = E366415E12D9CEAB1
          L1_3 = L1_3.BOOK
          L0_3(L1_3)
        end
        L0_3 = L5_2
        L0_3[12] = false
        L0_3 = CC6FE82819C6E1D55
        L0_3 = L0_3.S12F63EE47FFCB183
        L0_3()
        do break end
        ::lbl_38::
        L0_3 = CC6FE82819C6E1D55
        L0_3 = L0_3.S12F63EE47FFCB183
        L0_3()
      end
    end
    L14_2 = L11_2
    L12_2 = L12_2(L13_2, L14_2)
    A0_2[11] = L12_2
    A0_2[12] = true
  end
end

_ENV["CB7516F181FFC9BAE"]["prototype"]["F26D083E42E9191C7"] = function(A0_2)

  local L1_2
  L1_2 = A0_2[12]
  return L1_2
end

_ENV["CB7516F181FFC9BAE"]["prototype"]["F5740566D15644DE5"] = function(A0_2)

  local L1_2, L2_2, L3_2, L4_2, L5_2, L6_2, L7_2
  L1_2 = A0_2[10]
  L2_2 = L1_2
  L1_2 = L1_2.f3271DED8
  L3_2 = "N_context"
  L1_2, L2_2, L3_2 = L1_2(L2_2, L3_2)
  L4_2 = {}
  L5_2 = L1_2
  L6_2 = L2_2
  L7_2 = L3_2
  L4_2[1] = L5_2
  L4_2[2] = L6_2
  L4_2[3] = L7_2
  return L4_2
end

L68_1 = _ENV["CB7516F181FFC9BAE"]["prototype"]
L69_1 = _ENV["CB7516F181FFC9BAE"]
L68_1.__class__ = L69_1
L68_1 = _ENV["CB7516F181FFC9BAE"]
L69_1 = "__super__"
L69_1 = _ENV["CB7516F181FFC9BAE"]["prototype"]
L70_1 = {}
L71_1 = "__index"


SetAlphaAnim(cg_btnRT, cg_btnRTA)
    SetAlphaAnim(cg_btnSkill, cg_btnSkillA)
    -- masks
    CSAPI.SetGOActive(maskUpBreak, not (curCenter == nil or curCenter == "up" or curCenter == "tupo"))
    CSAPI.SetGOActive(maskRT, not (curCenter == nil or curCenter == "talent"))
    CSAPI.SetGOActive(maskSkill, not (curCenter == nil or curCenter == "skill"))
end

function SetAlphaAnim(obj, target, delay)
    -- talentLines
    local func = nil
    if (obj == cg_lines) then
        if (curCenter and curCenter == "up" or curCenter == "tupo") then
            func = function()
                cg_talentLines.alpha = 0
            end
        else
            cg_talentLines.alpha = 1
        end
    end

    local cur = obj.alpha
    if (cur ~= target) then
        UIUtil:SetObjFade(obj.gameObject, cur, target, func, 300, delay, cur)
    end
end

function SetLines()
    CSAPI.SetGOActive(l, curCenter and curCenter == "talent")
end

-- 更换中心
function ChangeCenter(str)
    if (curCenter == nil and str == nil) then
        return
    end

    curCenter = str

    -- node位置与大小
    SetNode()

    -- btn
    CSAPI.SetGOActive(btnChangeRole, curCenter == nil)
    -- role
    if (curCenter and (curCenter == "up" or curCenter == "tupo")) then
        CSAPI.SetGOActive(iconParent, true)
        CSAPI.SetGOActive(objSelectUp, curCenter == "up")
        CSAPI.SetGOActive(objSelectTupo, curCenter == "tupo")
        -- anim
        if (oldCurCenter == nil or (oldCurCenter ~= "up" and oldCurCenter ~= "tupo")) then
            UIUtil:SetPObjMove(iconNode, -200, 0, 0, 0, 0, 0, nil, 300, 300)
            UIUtil:SetObjFade(iconNode, 0, 1, nil, 300, 300)
        end
    else
        CSAPI.SetGOActive(iconParent, false)
        CSAPI.SetGOActive(objSelectUp, false)
        CSAPI.SetGOActive(objSelectTupo, false)
    end

    --
    SetTalentTips()

    -- 主按钮透明度
    SetBtnAlpha()
    -- 线条
    SetLines()

    -- 界面数据
    local _curPanelName = nil
    local elseData = nil
    if (curCenter == "up") then
        _curPanelNa


命令行参数注入到应用程序中，从而执行恶意代码。因为POC环境中包含FTP服务，并允许匿名用户写入，这存在一定的风险，例如，攻击者可能会利用FTP服务上传恶意文件并执行，从而导致更严重的投毒攻击。

**漏洞利用方式：**

1.  **条件：** 目标Craft CMS服务器的php.ini中启用了`register_argc_argv`。
2.  **攻击：** 攻击者构造包含恶意代码的HTTP请求，该恶意代码会被作为命令行参数传递给PHP脚本。
3.  **执行：** Craft CMS解析请求，由于`register_argc_argv`已启用，恶意代码会作为命令行参数被注册，并最终导致代码执行。

**投毒风险评估：**

虽然提供的代码主要是为了复现漏洞，但存在一定的投毒风险，主要体现在以下几个方面：

1.  **FTP服务：** Dockerfile配置了匿名可写的FTP服务。攻击者可以在环境中上传恶意文件。
2.  **.env文件：** Dockerfile中复制`.env`文件，这可能包含数据库凭据或其他敏感信息，如果这些信息被泄露，可能会导致更严重的攻击。
3.  **Composer依赖：** `composer.json` 文件指定了依赖包的版本，如果攻击者控制了依赖包的源，可能会注入恶意代码。

综合以上因素，虽然该POC的主要目的是验证漏洞，但其中一些配置可能会被恶意利用。因此，我们认为存在10%的投毒风险。

**项目地址:** [hmhlol/craft-cms-RCE-CVE-2024-56145](https://github.com/hmhlol/craft-cms-RCE-CVE-2024-56145)

**漏洞详情:** [CVE-2024-56145](https://nvd.nist.gov/vuln/detail/CVE-2024-56145)## CVE-2025-8088 WinRAR 路径遍历漏洞

**漏洞编号:** CVE-2025-8088

**漏洞类型:** 路径遍历

**影响应用:** WinRAR

**危害等级:** 高危，可导致任意代码执行

**影响版本:** <= 7.12 (Windows版本)

**利用条件:** 用户需要解压恶意RAR压缩包

**POC 可用性:** 是

**投毒风险:** 1%

## 详情

CVE-2025-8088是一个影响WinRAR Windows版本的路径遍历漏洞。攻击者可以制作恶意RAR压缩包，利用该


case WM_CREATE:
        break;

    case WM_SIZE:
        GetWindowText(hwnd, ach, sizeof(ach));
        GetClientRect(hwnd, &rc);
        hfont = GetFont(&rc);

        hdc = GetDC(hwnd);
        SelectObject(hdc, hfont);

        BeginPath(hdc);
            SetBkMode(hdc, TRANSPARENT);
            TextOut(hdc,0,0,ach,lstrlen(ach));
        EndPath(hdc);

        hrgnTxtA = PathToRegion(hdc);
        hrgnTxtB = CreateRectRgn(0, 0, 1, 1);
        hrgnTxtU = CreateRectRgn(0, 0, 1, 1);

        // Copy region A (our number) to a new region (B)

        CombineRgn(hrgnTxtB, hrgnTxtA, NULL, RGN_COPY);

        // Offset region B by two pixels in x and y

        OffsetRgn(hrgnTxtB, 2, 2);

        // Now create a region that is the union of A and B.
        // This gives us our number with 2 pixels worth of
        // room for shadowing.

        CombineRgn(hrgnTxtU, hrgnTxtA, hrgnTxtB, RGN_OR);
        DeleteObject(hrgnTxtA);
        DeleteObject(hrgnTxtB);
        SetWindowRgn(hwnd,hrgnTxtU,TRUE);

        ReleaseDC(hwnd, hdc);
        DeleteObject(hfont);
        break;

    case WM_TIMER:
        DestroyWindow(hwnd);
        return 0;

    case WM_PAINT:
        GetWindowText(hwnd, ach, sizeof(ach));
        GetClientRect(hwnd, &rc);
        hfont = GetFont(&rc);

        hdc = BeginPaint(hwnd, &ps);
        PatBlt(hdc, 0, 0, rc.right, rc.bottom, BLACKNESS | NOMIRRORBITMAP);
        SelectObject(hdc, hfont);
        SetTextColor(hdc, 0xFFFFFF);
        SetBkMode(hdc, TRANSPARENT);
        TextOut(hdc,0,0,ach,lstrlen(ach));
        EndPaint(hwnd, &ps);
        DeleteObject(hfont);
        break;
    }

    return DefWindowProc(hwnd,msg,wParam,lParam);
}

int Bail()
{
    POINT pt;
    POINT pt0;
    DWORD time0;
    DWORD d;

    d     = GetDoubleClickTime();
    time0 = GetMessageTime();
    pt0.x = (int)(short)LOWORD(GetMessagePos());
    pt0.y = (int)(short)HIWORD(GetMessagePos());

    if (GetTickCount()-time0 > d)
        return 2;

    if (!((GetAsyncKeyState(VK_LBUTTON) | GetAsyncKeyState(VK_RBUTTON)) & 0x8000))
        return 1;

    GetCursorPos(&pt);

    if ((pt.y - pt0.y) > 2 || (pt.y - pt0.y) < -2)
        return 1;

    if ((pt.x - pt0.x) > 2 || (pt.x - pt0.x) < -2)
        return 1;

    return 0;
}

void FlashText(LPCTSTR sz, LPRECT prc, BOOL fWait)
{
    HFONT hfont;
    SIZE  size;
    HDC   hdc;
    int   i;

    static HWND hWnd;

    if (hWnd && IsWindow(hWnd))
    {
        DestroyWindow(hWnd);
        hWnd = NULL;
    }

    if (sz == NULL)
        return;

    if (fWait)
    {
        while ((i=Bail()) == 0)
            ;

        if (i


ARY, 1);
        // The year should have 379 days.
        checkContinuity(cal, DAY_OF_YEAR);
        checkContinuity(cal, WEEK_OF_YEAR);

        logln("Default cutover");
        cal = new Koyomi();
        cal.set(1582, OCTOBER, 1);
        logln("  roll --DAY_OF_MONTH from 1582/10/01");
        cal.roll(DAY_OF_MONTH, -1);
        if (!cal.checkDate(1582, OCTOBER, 31)) {
            errln(cal.getMessage());
        }
        logln("  roll DAY_OF_MONTH+10 from 1582/10/31");
        cal.roll(DAY_OF_MONTH, +10);
        if (!cal.checkDate(1582, OCTOBER, 20)) {
            errln(cal.getMessage());
        }
        logln("  roll DAY_OF_MONTH-10 from 1582/10/20");
        cal.roll(DAY_OF_MONTH, -10);
        if (!cal.checkDate(1582, OCTOBER, 31)) {
            errln(cal.getMessage());
        }
        logln("  roll back one day further");
        cal.roll(DAY_OF_MONTH, +1);
        if (!cal.checkDate(1582, OCTOBER, 1)) {
            errln(cal.getMessage());
        }

        // should handle the gap between 1969/12/22 (Julian) to 1970/1/5 (Gregorian)
        logln("Cutover date is 1970/1/5");
        @SuppressWarnings("deprecation")
        Date d1 = new Date(1970 - 1900, JANUARY, 5);
        cal.setGregorianChange(d1);
        cal.set(ERA, AD);
        cal.set(YEAR, 1970);
        logln("  Set DAY_OF_YEAR to the 28th day of 1970");
        cal.set(DAY_OF_YEAR, 28);
        if (!cal.checkDate(1970, FEBRUARY, 1)) {
            errln(cal.getMessage());
        }
        if (!cal.checkFieldValue(WEEK_OF_YEAR, 5)) {
            errln(cal.getMessage());
        }
        logln("  1969/12/22 should be the 356th day of the year.");
        cal.set(1969, DECEMBER, 22);
        if (!cal.checkFieldValue(DAY_OF_YEAR, 356)) {
            errln(cal.getMessage());
        }
        logln("  Set DAY_OF_YEAR to autual maximum.");
        int actualMaxDayOfYear = cal.getActualMaximum(DAY_OF_YEAR);
        if (actualMaxDayOfYear != 356) {
            errln("actual maximum of DAY_OF_YEAR: got " + actualMaxDayOfYear + ", expected 356");
        }
        cal.set(DAY_OF_YEAR, actualMaxDayOfYear);
        if (!cal.checkDate(1969, DECEMBER, 22)) {
            errln(cal.getMessage());
        }
        cal.set(1969, DECEMBER, 22);
        cal.roll(DAY_OF_YEAR, +1);
        logln("  Set to 1969/12/22 and roll DAY_OF_YEAR++");
        if (!cal.checkDate(1969, JANUARY, 1)) {
            errln(cal.getMessage());
        }
        logln("  1970/1/5 should be the first day of the year.");
        cal.set(1970, JANUARY, 5);
        if (!cal.checkFieldValue(DAY_OF_YEAR, 1)) {
            errln(cal.getMessage());
        }
        logln("  roll --DAY_OF_MONTH from 1970/1/5");
        cal.roll(DAY_OF_MONTH, -1);
        if (!cal.checkDate(1970, JANUARY, 31)) {
            errln(cal.getMessage());
        }
        logln("  roll back one day of month");
        cal.roll(DAY_OF_MONTH, +1);
        if (!cal.checkDate(1970, JANUARY, 5)) {
            errln(cal.getMessage());
        }

        // Test "missing" dates in non


 and/or modify it under the
 * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
 * Foundation.
 *
 * You should have received a copy of the GNU Lesser General Public License along with this
 * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
 * or from the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * Copyright (c) 2002-2019 Hitachi Vantara..  All rights reserved.
 */

define([
  "pentaho/csrf/service"
], function(csrfService) {

  var local = {

    executableTypesUrl: 'api/repos/executableTypes',
    executableTypes: [],
    cutItems: [],
    multiSelectItems: [],

    _init: function () {

      var that = this; // trap this

      var serviceUrl = that.getUrlBase() + that.executableTypesUrl;
      that.getContent(serviceUrl, function (result) {
        that.executableTypes = result.executableFileTypeDto;
        console.log('Executable Types Loaded...');
      }, function (error) {
        console.log(error);
      });
    },

    applyHiddenFileLabelStyle: function (elementsArray) {
      for (var i=0;i<elementsArray.length;i++){
          $("#" + elementsArray[i].attr('id')).addClass("hiddenFileLabel");
      }
    },

    removeHiddenFileLabelStyle: function (elementsArray) {
      for (var i=0;i<elementsArray.length;i++){
          $("#" + elementsArray[i].attr('id')).removeClass("hiddenFileLabel");
      }
    },

    enableElements: function (elementsArray) {
      for (var i=0;i<elementsArray.length;i++){
          elementsArray[i].prop("disabled", false);
      }
    },

    disableElements: function (elementsArray) {
      for (var i=0;i<elementsArray.length;i++){
          elementsArray[i].prop("disabled", true);
      }
    },

    enableSpinners: function (modelsArray) {
      for (var i=0;i<modelsArray.length;i++){
          modelsArray[i].set("runSpinner", true);
      }
    },

    disableSpinners: function (modelsArray) {
      for (var i=0;i<modelsArray.length;i++){
          modelsArray[i].set("runSpinner", false);
          modelsArray[i].updateData();
      }
    },

    resetCutItemsStyle: function () {
      var that = this; // trap this
      var elementsArray = [];
      for (var i=0;i<that.cutItems.length;i++){
          elementsArray.push(that.cutItems[i].obj);
      }
      that.removeHiddenFileLabelStyle(elementsArray);
    },

    applyCutItemsStyle: function () {
        var that = this; // trap this
        var elementsArray = [];
        for (var i=0;i<that.cutItems.length;i++){
            elementsArray.push(that.cutItems[i].obj);
        }
        that.applyHiddenFileLabelStyle(elementsArray);
    },

    trackItems: function (cutItems, multiSelectItems) {
      var that = this; // trap this
      // remove hiddenFileLabel class
      that.resetCutItemsStyle();
      //reset cutItems to currently cut items
      that.cutItems = cutItems;
      //keep track of previously selected items
      that.multiSelectItems = multiSelectItems;
      //apply hiddenFileLable class to currently cut items
      that.applyCutItemsStyle();
    },

    uiButtonFeedback: function (elementsToDisableArray, elementsToEnableArray) {
      var that = this; // trap this
      that.enableElements(elementsToEnableArray);
      that.disableElements(e


#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "lodepng.h"

#define ROWS 36
#define COLS 64

#define IMG_WIDTH   1920
#define IMG_HEIGHT  1080

int grid[ROWS][COLS] = {0};
int buff[ROWS][COLS] = {0};

// ONE STEP ENCODING TO FILE
void encodeOneStep(const char* filename, const unsigned char* image) {
  unsigned error = lodepng_encode32_file(filename, image, IMG_WIDTH, IMG_HEIGHT);
  if(error) printf("error %u: %s\n", error, lodepng_error_text(error));
}

void convert_to_image(unsigned char* image) {
    float x_ratio = (float)IMG_WIDTH   / COLS;
    float y_ratio = (float)IMG_HEIGHT  / ROWS;

    for(int y = 0; y < IMG_HEIGHT; y++) {
        for(int x = 0; x < IMG_WIDTH; x++) {
            int src_x = (int)x / x_ratio;
            int src_y = (int)y / y_ratio;

            if (src_y >= ROWS) src_y = ROWS - 1;
            if (src_x >= COLS) src_x = COLS - 1;

            int dst = 4 * y * IMG_WIDTH + 4 * x;
            image[dst+0] = grid[src_y][src_x] ? 255 : 0;
            image[dst+1] = grid[src_y][src_x] ? 255 : 0;
            image[dst+2] = grid[src_y][src_x] ? 255 : 0;
            image[dst+3] = 255;
        }
    }

}

void display() {
    for (int y = 0; y < ROWS; ++y) {
        for (int x = 0; x < COLS; ++x) {
            if (grid[y][x]) {
                printf("#");
            } else {
                printf(".");
            }
        }
        printf("\n");
    }
}

int mod(int a, int b) {
    return (a%b + b)%b;
}

int count_neighbours(int cx, int cy) {
    int neighbours = 0;
    for(int dx = -1; dx <= 1; dx++) {
        for(int dy = -1; dy <= 1; dy++) {
            int x = mod(cx+dx, COLS);
            int y = mod(cy+dy, ROWS);
            if(grid[y][x]) neighbours++;
        }
    }

    return neighbours;
}

void step() {
    for(int y = 0; y < ROWS; y++) {
        for(int x = 0; x < COLS; x++) {
            int neighbours = count_neighbours(x, y);
            buff[y][x] = grid[y][x] ? (neighbours == 2 || neighbours == 3) : neighbours == 3;
        }
    }
}

void generate(){
    int fd = open("/dev/urandom", O_RDONLY);

    for(int y = 0; y < ROWS; y++) {
        for(int x = 0; x < COLS; x++) {
            int num;
            read(fd, &num, sizeof(num));
            grid[y][x] = num%2;
        }
    }
}

int main(int argc, char* argv[]) {
    if(argc != 2) {
        printf("Usage: %s <path to wallpaper>\n", argv[0]);
        return 1;
    }
    char* filepath = argv[1];
    generate();

    unsigned char* image = malloc(IMG_WIDTH * IMG_HEIGHT * 4);
    char* command = "nitrogen --set-zoom-fill";

    asprintf(&command, "nitrogen --set-zoom-fill %s", filepath);
    convert_to_image(image);
    encodeOneStep(filepath, image);
    system(command);

    int iter = 0;
    while (1) {
        convert_to_image(image);
        encodeOneStep(filepath, image);
        step();
        memcpy(grid, buff, sizeof(grid));
        usleep(5000*1000);
        iter++;
        if(iter%10 == 0) generate();
    }

    return 0;
}


   + "(SELECT * FROM " + mapName + " WHERE f0 = " + c[1] + " AND f1 = " + c[1] + ")";

        preparePrunableMap(asList("f0", "f1"), mapName, c);

        SqlPlanImpl.SelectPlan selectPlan = assertQueryPlan(query);

        // When
        assertQueryResult(selectPlan, asList(
                new Row(c[0], c[0], c[0], "" + c[0]),
                new Row(c[1], c[1], c[1], "" + c[1])));

        // Then
        var partitionsToUse = planExecutor.tryUsePrunability(selectPlan, eec);
        assertPrunability(c.length, partitionsToUse);
    }

    @Test
    public void when_unionAllTwoMapsWithCompoundPruningKey_then_prunable() {
        final String secondMapName = randomName();
        final int[] c = new int[]{2, 3}; // constants
        final String query = "(SELECT f2 FROM " + mapName + " WHERE f0 = " + c[0] + " AND f1 = " + c[0] + ")"
                + " UNION ALL "
                + "(SELECT f2 FROM " + secondMapName + " WHERE f0 = " + c[1] + " AND f1 = " + c[1] + ")";

        preparePrunableMap(asList("f0", "f1"), mapName, c[0]);
        preparePrunableMap(asList("f0", "f1"), secondMapName, c[1]);

        expectedPartitionsAndMembers = calculateExpectedPartitions(2, c);

        SqlPlanImpl.SelectPlan selectPlan = assertQueryPlan(query);

        assertQueryResult(selectPlan, asList(new Row(c[0]), new Row(c[1])));

        // Then
        var partitionsToUse = planExecutor.tryUsePrunability(selectPlan, eec);
        assertPrunability(2, partitionsToUse);
    }

    @Test
    public void when_unionAllTwoMapsAndOneMapIsNotPrunable_then_nonPrunable() {
        final String secondMapName = randomName();
        final int[] c = new int[]{2, 3}; // constants
        final String query = "(SELECT f2 FROM " + mapName + " WHERE f0 = " + c[0] + " AND f1 = " + c[0] + ")"
                + " UNION ALL "
                + "(SELECT f2 FROM " + secondMapName + " WHERE f0 = " + c[1] + " AND f1 = " + c[1] + ")";

        preparePrunableMap(asList("f0", "f1"), mapName, c);
        // now prepare non-prunable map
        IMap<Pojo, String> map2 = instance().getMap(secondMapName);
        createMapping(secondMapName, Pojo.class, String.class);
        map2.put(new Pojo(c[1], c[1], c[1]), "3");

        SqlPlanImpl.SelectPlan selectPlan = assertQueryPlan(query);

        assertQueryResult(selectPlan, asList(new Row(2), new Row(3)));
        assertEquals(0, planExecutor.tryUsePrunability(selectPlan, eec).size());
    }

    @Ignore("https://hazelcast.atlassian.net/browse/HZ-2796")
    @Test
    public void when_unionWithSimplePruningKey_then_non_prunable() {
        // Note: it is a test for the future implementation of prunable Aggregation.
        //  Union converts to UnionAll + Aggregation, and  prunable Aggregation implementor
        //  easily may miss that fact during testing.
        final String mapName = randomName();
        final int c = 2; // constant
        final String query = "(SELECT f2 FROM " + mapName + " WHERE f0 = " + c + ")"
                + " UNION "
                + "(SELECT f2 FROM " + mapName + " WHERE f0 = " + c + ")";

        preparePrunableMap(emptyList(), mapName, c);

        SqlPlanImpl.SelectPlan selectPlan = assertQueryPlan(query);

        assertQueryResult(selectPlan, singletonList(new Row(c)));
        assertEquals(0, planExecutor.tryUsePrunability(


b           .L801E1C8C
/* 006A7C 801E1C7C 3C040001 */   lui        $a0, (0x1056A >> 16)
.L801E1C80:
/* 006A80 801E1C80 0C02A806 */  jal         func_800AA018
/* 006A84 801E1C84 3484057B */   ori        $a0, $a0, (0x1057B & 0xFFFF)
/* 006A88 801E1C88 3C040001 */  lui         $a0, (0x1056A >> 16)
.L801E1C8C:
/* 006A8C 801E1C8C 3484056A */  ori         $a0, $a0, (0x1056A & 0xFFFF)
/* 006A90 801E1C90 0C02AA19 */  jal         func_800AA864
/* 006A94 801E1C94 24050001 */   addiu      $a1, $zero, 0x1
/* 006A98 801E1C98 3C058005 */  lui         $a1, %hi(D_8004A7C4)
/* 006A9C 801E1C9C 8CA5A7C4 */  lw          $a1, %lo(D_8004A7C4)($a1)
/* 006AA0 801E1CA0 3C01800F */  lui         $at, %hi(D_800EA520)
/* 006AA4 801E1CA4 00002025 */  m


      }
    }
    this.storage.setItem(key, serialize(val))

    if (success) {
      success(value)
    }
    // eslint-disable-next-line consistent-return
    return Promise.resolve(val)
  },

  getStorage(params: getStorageProps): any {
    const { key, success } = params
    if (!key || this.disabled) {
      return undefined
    }
    let value = deserialize(this.storage.getItem(key))

    if (value && value.expires) {
      // 值已经过期
      if (value.timestamp + value.expires * 1000 < new Date()) {
        this.clearStorage({ key })
        value = ''
      } else {
        // 值没有过期
        value = value.value
      }
    }

    if (success) {
      success(value)
    }

    return Promise.resolve(value)
  },

  clearStorage(params: clearStorageProps) {
    const { key, success } = params

    if (!key) {
      return
    }

    if (success) {
      success()
    }
    this.storage.removeItem(key)
  },

}

export default localStorage
import {CustomError} from "../utils/error_constructor";
import db from "../model";

/**
 * 账单类型
 * @author huangchunmao
 * @email sujinw@qq.com
 * @version v1.0.0
 * @date 2020/12/30
*/

export class BillCateController {
  /**
   * @api {post} /bill/add
   * @apiDescription  修改文章
   * @apiName add
   * @apiGroup Api
   * @apiVersion 1.0.0
   */
  public async add (ctx: any) {
    const {name, type = 1, icon, uid} = ctx.request.body
    if (!name || !type || !uid) throw new CustomError('缺少必要参数', { msg: 'name和belong不能为空' })

    const result = await db.BillCateModel.create({
      uid,
      name,
      type,
      icon
    })
    ctx.result['data'] = {
      info: result,
    };
  }

  /**
   * @api {post} /bill/update
   * @apiDescription  修改文章
   * @apiName update
   * @apiGroup Api
   * @apiVersion 1.0.0
   */
  public async update(ctx: any) {
    const {id, name, status, type, icon, uid, remark} = ctx.request.body;
    if (!id)
      throw new CustomError('缺少参数', {msg: 'name、type 缺少'});

    const updateData:any = {}
    if (name !== undefined && name !== null) updateData.name = name
    if (type !== undefined && type !== null) updateData.type = type
    if (icon !== undefined && icon !== null) updateData.icon = icon
    if (remark !== undefined && remark !== null) updateData.remark = remark
    if (status !== undefined && status !== null) updateData.status = status
    const result = await db.BillCateModel.update(
      updateData,
      {
        where: {id},
      }
    );

    ctx.result['data'] = !!result;
  }

  /**
   * 分类列表
   * @param ctx
   */
  public async lists(ctx: any) {
    const {uid} = ctx.request.query;
    if (!uid)
      throw new CustomError('缺少参数', {msg: 'id缺少'});

  ctx.result['data'] = await db.BillCateModel.findAll(
      {
        where: {
          uid
        },
        order: [
          ['id', 'DESC']
        ]
      }
    );
  }
}import { Component, OnInit } from '@angular/core';

@Component({


 disconnect(bot: Bot, guild: str, voice: dict, timeout: dict,
                     voiceffmpeg: dict, LOCK: dict, msgid: dict,
                     voicechannelid: dict, channel: dict, singleloops: dict,
                     playtime: dict, duration: dict, port: dict, pop_now: dict,
                     task_id: dict, add_LOCK: dict, logger: Logger):
    try:
        process = Process(voiceffmpeg[guild].pid)
        for proc in process.children(recursive=True):
            proc.kill()
        process.kill()
    except Exception as e:
        logger.warning(e)
    voice[guild].is_exit = True
    del timeout[guild]
    del voiceffmpeg[guild]
    del voice[guild]
    del LOCK[guild]
    del msgid[guild]
    del voicechannelid[guild]
    del channel[guild]
    del singleloops[guild]
    del playtime[guild]
    del duration[guild]
    del port[guild]
    del pop_now[guild]
    del task_id[guild]
    del add_LOCK[guild]
    await bot.client.update_listening_music(f"已用槽位:{str(len(voice))}", "KO-ON",
                                            SoftwareTypes.CLOUD_MUSIC)
    logger.warning(str(guild) + " disconnected")

@func_set_timeout(7)
def delay_alignment(p: Popen, run_status: dict, logger: Logger):
    while p.poll() is None:
        assert p.stdout is not None
        line = p.stdout.readline().strip()
        logger.warning(line)
        if "#0:0" in line:
            run_status['status'] = 'FINISH'
            break

async def async_run_in_executor(f, *args, loop: AbstractEventLoop,
                                executor: ThreadPoolExecutor, run_status: dict,
                                **kwargs):
    try:
        result = await loop.run_in_executor(executor,
                                            partial(f, *args, **kwargs))
        return result
    except FunctionTimedOut:
        run_status['status'] = 'TIMEOUT'

async def start_delay(bot: Bot, guild: str, voiceffmpeg: dict, logger: Logger,
                      event_loop: AbstractEventLoop,
                      executor: ThreadPoolExecutor, playlist: dict,
                      duration: dict, playtime: dict, LOCK: dict,
                      channel: dict):
    try:
        run_status = {'status': 'RUNNING'}
        ensure_future(async_run_in_executor(delay_alignment,
                                            voiceffmpeg[guild],
                                            run_status,
                                            logger,
                                            loop=event_loop,
                                            executor=executor,
                                            run_status=run_status),
                      loop=event_loop)
        while run_status['status'] == 'RUNNING':
            await sleep(0.1)
        if run_status['status'] == 'TIMEOUT':
            logger.warning('RUN IN EXECUTOR TIMEOUT')
            raise FunctionTimedOut
    except FunctionTimedOut:
        playlist[guild].pop(0)
        duration[guild] = 0
        playtime[guild] = 0
        LOCK[guild] = False
        await bot.client.send(
            channel[guild],
            '发生错误，请重试',
        )
        return 'ERROR'

async def play_lyrics(guild: str, lrc_dict: dict, lrc_roma_dict: dict,
                      lrc_trans_dict: dict, enable_roma: bool,
                      enable_trans: bool, lyrics_broadid: str, config: dict,
                      botid: str, session: ClientSession, logger: Logger,
                      event_loop: AbstractEventLoop, duration: dict):
    now_time = 0.000
    new_now_time = 0.000
    while True:
        cm = CardMessage()
        c = Card(theme=Types.Theme.NONE)
        endflag = True
        new_now_time = 0.000

        for key in sorted(lrc_dict.keys()):
            s = ""
            if lrc_dict[key] == "":
                continue
            if key >= now_time and key < (now_time + 5.000):
                endflag = False
                if enable_roma:
                    try:
                        if lrc_roma_dict[key] != "":
                            s += "*" + lrc_roma_dict[key] + "*\n"
                    except:
                        s += "\n"
                s += "**" + lrc_dict[key] + "**\n"
                if enable_trans:
                    try:
                        if lrc_trans_dict[key] != "":
                            s += lrc_trans_dict[key] + "\n"
                    except:
                        s += "\n"
                s += "---"
                new_now_time = key


aoxiang.vo.ProductInfoVO;
import cn.chenhaoxiang.vo.ProductVO;
import cn.chenhaoxiang.vo.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created with IntelliJ IDEA.
 * User: 陈浩翔.
 * Date: 2018/1/9.
 * Time: 下午 7:32.
 * Explain:买家商品
 */
@RestController
@RequestMapping(value = "/buyer/product")
@Slf4j
public class BuyerProductController {
    @Autowired
    private ProductInfoService productInfoService;
    @Autowired
    private ProductCategoryService productCategoryService;
    @GetMapping("list")
    @Cacheable(cacheNames = "product",key = "123",unless = "#result.getCode() != 0")
    //Redis缓存注解  Cacheable第一次访问会访问到方内的内容，方法会返回一个对象，返回对象的时候，会把这个对象存储。下一次访问的时候，不会进去这个方法，直接从redis缓存中拿
    //上面的key的值是可以动态写的@Cacheable(cacheNames = "product",key = "#sellerId")  sellerId为方法中的参数名
    //condition判断是否成立的条件  例如key = "#sellerId",condition = "#sellerId.length() > 3"  只有条件成立才会对结果缓存，结果不成立是不缓存的
    //依据结果来判断是否缓存 unless = "#result.getCode() != 0",#result其实就是ResultVO，也就是返回的对象
    //unless(除什么之外,如果不 的意思) 如果=0就缓存，需要写成!=0。理解起来就是，除了不等于0的情况之外，才缓存，也就是等于0才缓存。
    //其实就是，你想要什么条件下缓存，你反过来写就行了
    //测试缓存的话，你可以在方法内打一个断点进行测试
    //注意，返回的缓存对象一定要实现序列化！！！
    public ResultVO list(){
        //1.先查询所有的上架商品
        List<ProductInfo> productInfoList = productInfoService.findUpAll();

        //2.查询类目(一次性查询) 查询需要的
        //一定不要把数据库的查询放到for循环中
        //传统方法
//        List<Integer> categoryTypeList = new ArrayList<>();
//        for(ProductInfo productInfo:productInfoList){
//            categoryTypeList.add(productInfo.getCategoryType());
//        }
        //精简方法 (java8 lambda) 推荐
        List<Integer> categoryTypeList =  productInfoList.stream().map(e->e.getCategoryType())
                .collect(Collectors.toList());
        List<ProductCategory> productCategoryList = productCategoryService.findByCategoryTypeIn(categoryTypeList);

        //3.数据拼装 - 拼装成前端需要的格式
        List<ProductVO> productVOList = new ArrayList<>();
            //先遍历类目
        for (ProductCategory productCategory:productCategoryList){
            ProductVO productVO = new ProductVO();
            productVO.setCategoryType(productCategory.getCategoryType());
            productVO.setCategoryName(productCategory.getCategoryName());
            //遍历商品详情
            List<ProductInfoVO> productInfoVOList = new ArrayList<>();
            for (ProductInfo productInfo:productInfoList){
                if(productInfo.getCategoryType().equals(productCategory.getCategoryType())){
                    ProductInfoVO productInfoVO = new ProductInfoVO();
                    BeanUtils.


 throws IOException {
        ObjectUtil.checkNotNull(channel, "channel");
        ObjectUtil.checkNotNull(current, "current");
        ObjectUtil.checkNotNull(newKeys, "newKeys");

        // Validate incoming values
        for (Entry<InetAddress, byte[]> e : newKeys.entrySet()) {
            final byte[] key = e.getValue();
            if (e.getKey() == null) {
                throw new IllegalArgumentException("newKeys contains an entry with null address: " + newKeys);
            }
            ObjectUtil.checkNotNull(key, "newKeys[" + e.getKey() + ']');
            if (key.length == 0) {
                throw new IllegalArgumentException("newKeys[" + e.getKey() + "] has an empty key.");
            }
            if (key.length > Native.TCP_MD5SIG_MAXKEYLEN) {
                throw new IllegalArgumentException("newKeys[" + e.getKey() +
                    "] has a key with invalid length; should not exceed the maximum length (" +
                        Native.TCP_MD5SIG_MAXKEYLEN + ')');
            }
        }

        // Remove mappings not present in the new set.
        for (InetAddress addr : current) {
            if (!newKeys.containsKey(addr)) {
                channel.socket.setTcpMd5Sig(addr, null);
            }
        }

        if (newKeys.isEmpty()) {
            return Collections.emptySet();
        }

        // Set new mappings and store addresses which we set.
        final Collection<InetAddress> addresses = new ArrayList<InetAddress>(newKeys.size());
        for (Entry<InetAddress, byte[]> e : newKeys.entrySet()) {
            channel.socket.setTcpMd5Sig(e.getKey(), e.getValue());
            addresses.add(e.getKey());
        }

        return addresses;
    }

    private TcpMd5Util() {
    }
}
/*
 * Copyright 2014 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.channel.epoll;

/**
 * <p>
 * struct tcp_info
 * {
 *      __u8    tcpi_state;
 *      __u8    tcpi_ca_state;
 *      __u8    tcpi_retransmits;
 *      __u8    tcpi_probes;
 *      __u8    tcpi_backoff;
 *      __u8    tcpi_options;
 *      __u8    tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
 *
 *      __u32   tcpi_rto;
 *      __u32   tcpi_ato;
 *      __u32   tcpi_snd_mss;
 *      __u32   tcpi_rcv_mss;
 *
 *      __u32   tcpi_unacked;
 *      __u32   tcpi_sacked;
 *      __u32   tcpi_lost;
 *      __u32   tcpi_retrans;
 *      __u32   tcpi_fackets;
 *
 *      __u32   tcpi_last_data_sent;
 *      __u32   tcpi_last_ack_sent;
 *      __u32   tcpi_last_data_recv;
 *      __u32   tcpi_last_ack_recv;
 *
 *      __u32   tcpi_pmtu;
 *      __u32   tcpi_rcv_ssthresh;
 *      __u32   tcpi_