 device for connection set up, mutual authentication, and
 * exchanging short lived session keys.  The handshake depends on a CC.
 */
struct usb_handshake {
	__u8 bMessageNumber;
	__u8 bStatus;
	__u8 tTKID[3];
	__u8 bReserved;
	__u8 CDID[16];
	__u8 nonce[16];
	__u8 MIC[8];
} __attribute__((packed));

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

/* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC).
 * A CC may also be set up using non-wireless secure channels (including
 * wired USB!), and some devices may support CCs with multiple hosts.
 */
struct usb_connection_context {
	__u8 CHID[16];		/* persistent host id */
	__u8 CDID[16];		/* device id (unique w/in host context) */
	__u8 CK[16];		/* connection key */
} __attribute__((packed));

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

/* USB 2.0 defines three speeds, here's how Linux identifies them */

enum usb_device_speed {
	USB_SPEED_UNKNOWN = 0,			/* enumerating */
	USB_SPEED_LOW, USB_SPEED_FULL,		/* usb 1.1 */
	USB_SPEED_HIGH,				/* usb 2.0 */
	USB_SPEED_WIRELESS,			/* wireless (usb 2.5) */
	USB_SPEED_SUPER,			/* usb 3.0 */
};

enum usb_device_state {
	/* NOTATTACHED isn't in the USB spec, and this state acts
	 * the same as ATTACHED ... but it's clearer this way.
	 */
	USB_STATE_NOTATTACHED = 0,

	/* chapter 9 and authentication (wireless) device states */
	USB_STATE_ATTACHED,
	USB_STATE_POWERED,			/* wired */
	USB_STATE_RECONNECTING,			/* auth */
	USB_STATE_UNAUTHENTICATED,		/* auth */
	USB_STATE_DEFAULT,			/* limited function */
	USB_STATE_ADDRESS,
	USB_STATE_CONFIGURED,			/* most functions */

	USB_STATE_SUSPENDED

	/* NOTE:  there are actually four different SUSPENDED
	 * states, returning to POWERED, DEFAULT, ADDRESS, or
	 * CONFIGURED respectively when SOF tokens flow again.
	 * At this level there's no difference between L1 and L2
	 * suspend states.  (L2 being original USB 1.1 suspend.)
	 */
};

enum usb3_link_state {
	USB3_LPM_U0 = 0,
	USB3_LPM_U1,
	USB3_LPM_U2,
	USB3_LPM_U3
};

/*
 * A U1 timeout of 0x0 means the parent hub will reject any transitions to U1.
 * 0xff means the parent hub will accept transitions to U1, but will not
 * initiate a transition.
 *
 * A U1 timeout of 0x1 to 0x7F also causes the hub to initiate a transition to
 * U1 after that many microseconds.  Timeouts of 0x80 to 0xFE are reserved
 * values.
 *
 * A U2 timeout of 0x0 means the parent hub will reject any transitions to U2.
 * 0xff means the parent hub will accept transitions to U2, but will not
 * initiate a transition.
 *
 * A U2 timeout of 0x1 to 0xFE also causes the hub to initiate a transition to
 * U2 after N*256 microseconds.  Therefore a U2 timeout value of 0x1 means a U2
 * idle timer of 256 microseconds, 0x2 means 512 microseconds, 0xFE means
 * 65.024ms.
 */
#define USB3_LPM_DISABLED		0x0
#define USB3_LPM_U1_MAX_TIMEOUT		0x7F
#define USB3_LPM_U2_MAX_TIMEOUT		0xFE
#define USB3_LPM_DEVICE_INITIATED	0xFF

struct usb_set_sel_req {
	__u8	u1_sel;
	__u8	u1_pel;
	__le16	u2_sel;
	__le16	u2_pel;
} __attribute__ ((packed));

/*
 * The Set System Exit Latency control transfer provides one byte each for
 * U1 SEL and U1 PEL, so the max exit latency is 0xFF.  U2 SEL and U2 PEL each
 * are two bytes long.
 */
#define USB3_LPM_MAX_U1_SEL_PEL		0xFF
#define USB3_LPM_MAX_U2_SEL_PEL		0xFFFF

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

/*
 * As per USB compliance update, a device that is actively drawing
 * more than 100mA from USB must report itself as bus-powered in
 * the GetStatus(DEVICE) call.
 * http://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#34
 */
#define USB_SELF_POWER_VBUS_MAX_DRAW		100

#endif /* _UAPI__LINUX_USB_CH9_H */


, we've gotta do this again! Buddy up, we'll meet back here in a couple days!"
	},
	ins_reply_112_2_2 = {
		value = "Such exquisite beef... But isn't this method a bit wasteful?"
	},
	ins_reply_112_2_3 = {
		value = "way tooo goooood!"
	},
	ins_op_112_1_1 = {
		value = "Share."
	},
	op_reply_112_1_1 = {
		value = "should i save some for you next time?"
	},
	ins_op_112_1_2 = {
		value = "You must be pretty happy if you're offering."
	},
	op_reply_112_1_2 = {
		value = "yep! nothing makes me happier than having delicious meat in my belly!"
	},
	ins_113 = {
		value = "#AwaOdori My Commander, please enjoy my dance~♥"
	},
	ins_discuss_113_1 = {
		value = "Woahhh, is this a special Sakura Empire dance? Looks like a lot of fun!"
	},
	ins_reply_113_1_1 = {
		value = "Y-you again?! What do you want?!"
	},
	ins_reply_113_1_2 = {
		value = "Let's play together! I wanna learn that dance too!"
	},
	ins_reply_113_1_3 = {
		value = "NO. BEGONE."
	},
	ins_discuss_113_2 = {
		value = "Oh my. There's no harm in that, is there? Not all dances must be for the gods, as there is joy to be had simply through the art itself."
	},
	ins_reply_113_2_1 = {
		value = "Let's all dance together! I'm getting excited just thinking about it~"
	},
	ins_reply_113_2_2 = {
		value = "My plan to draw my Commander's full, undivided attention..."
	},
	ins_op_113_1_1 = {
		value = "What a fiery dance!"
	},
	op_reply_113_1_1 = {
		value = "Yes, my Commander! For you, I would dance until I go up into flames, should you will it~"
	},
	ins_op_113_1_2 = {
		value = "Stunning! If only I could see it in person!"
	},
	op_reply_113_1_2 = {
		value = "Gladly, my Commander! Afterwards, I can offer you a different type of dance, if you wish~♥"
	},
	ins_114 = {
		value = "Noooooooooooo! I failed to flip the okonomiyaki again :("
	},
	ins_discuss_114_1 = {
		value = "Don't worry. Just be more careful, and you'll be sure to succeed next time~"
	},
	ins_reply_114_1_1 = {
		value = "Thank you for your kind words,,,"
	},
	ins_reply_114_1_2 = {
		value = "Well, it doesn't seem to have affected the taste. It's still delicious, I'd say."
	},
	ins_discuss_114_2 = {
		value = "Ohhhhh! I totally understand, Lady Mikasa! I too know the bitter defeat of failing the flip..."
	},
	ins_reply_114_2_1 = {
		value = "I've disgraced myself before those who look up to me. How shameful... :("
	},
	ins_reply_114_2_2 = {
		value = "Next time, let's practice the art of okonomiyaki flipping, together!"
	},
	ins_reply_114_2_3 = {
		value = "I suppose I'll foot the bill for both of you next time? Hehe~"
	},
	ins_op_114_1_1 = {
		value = "You two, it's not that big of a deal."
	},
	op_reply_114_1_1 = {
		value = "I have bee


ref' && name != '$id')) {
          BSON.checkKey(name);
        }

        if(value == null) {
          // Write the type
          buffer[index++] = BSON.BSON_DATA_NULL;
          // Write the name
          if(name != null) {
            index = index + buffer.write(name, index, 'utf8') + 1;
            buffer[index - 1] = 0;
          }
        } else if(typeof value == 'string') {
          // Write the type
          buffer[index++] = BSON.BSON_DATA_STRING;
          // Write the name
          if(name != null) {
            index = index + buffer.write(name, index, 'utf8') + 1;
            buffer[index - 1] = 0;
          }

          // Calculate size
          size = Buffer.byteLength(value) + 1;
          // Write the size of the string to buffer
          buffer[index + 3] = (size >> 24) & 0xff;
          buffer[index + 2] = (size >> 16) & 0xff;
          buffer[index + 1] = (size >> 8) & 0xff;
          buffer[index] = size & 0xff;
          // Ajust the index
          index = index + 4;
          // Write the string
          buffer.write(value, index, 'utf8');
          // Update index
          index = index + size - 1;
          // Write zero
          buffer[index++] = 0;
        } else if(typeof value == 'number' && value === parseInt(value, 10)) {
          // Write the type
          buffer[index++] = value >= BSON.BSON_INT32_MAX || value < BSON.BSON_INT32_MIN ? BSON.BSON_DATA_LONG : BSON.BSON_DATA_INT;
          // Write the name
          if(name != null) {
            index = index + buffer.write(name, index, 'utf8') + 1;
            buffer[index - 1] = 0;
          }

          if(value >= BSON.BSON_INT32_MAX || value < BSON.BSON_INT32_MIN) {
            // Write the number
            var long = Long.fromNumber(value);
            binaryutils.encodeIntInPlace(long.getLowBits(), buffer, index);
            binaryutils.encodeIntInPlace(long.getHighBits(), buffer, index + 4);
            index += 8;
          } else {
            // Write the int value to the buffer
            buffer[index + 3] = (value >> 24) & 0xff;
            buffer[index + 2] = (value >> 16) & 0xff;
            buffer[index + 1] = (value >> 8) & 0xff;
            buffer[index] = value & 0xff;
            // Ajust the index
            index = index + 4;
          }
        } else if(typeof value == 'number' || toString.call(value) === '[object Number]') {
          // Write the type
          buffer[index++] = BSON.BSON_DATA_NUMBER;
          // Write the name
          if(name != null) {
            index = index + buffer.write(name, index, 'utf8') + 1;
            buffer[index - 1] = 0;
          }

          // Write float
          ieee754.writeIEEE754(buffer, value, index, 'little', 52, 8);
          // Ajust index
          index = index + 8;
        } else if(typeof value == 'boolean' || toString.call(value) === '[object Boolean]') {
          // Write the type
          buffer[index++] = BSON.BSON_DATA_BOOLEAN;
          // Write the name
          if(name != null) {
            index = index + buffer.write(name, index, 'utf8') + 1;
            buffer[index - 1] = 0;
          }

          buffer[index++] = value ? 1 : 0;
        } else if(value instanceof Date || toString.call(value) === '[object Date]') {
          // Write the type
          buffer[index++] = BSON.BSON_DATA_DATE;
          // Write the name
          if(name != null) {
            index = index + buffer.write(name,


ht: VIDEO_HEIGHT,
  });

  console.log(`🎬 Recording: ${scenario.title}...`);

  // Create temporary demo page
  const tempFile = path.join(__dirname, "temp-mcp-demo.html");
  await fs.writeFile(tempFile, DEMO_PAGE_HTML);

  try {
    // Navigate to demo page
    await page.goto(`file://${tempFile}`);
    await page.waitForTimeout(2000);

    // Execute scenario actions
    for (const action of scenario.actions) {
      switch (action.type) {
        case "wait":
          await page.waitForTimeout(action.duration);
          break;
        case "click":
          if (action.selector) {
            await page.click(action.selector);
          }
          break;
        case "type":
          if (action.text) {
            await page.keyboard.type(action.text);
          }
          break;
        case "scroll":
          if (action.direction === "down") {
            await page.evaluate(() => window.scrollBy(0, 300));
          } else if (action.direction === "up") {
            await page.evaluate(() => window.scrollBy(0, -300));
          }
          break;
      }
      await page.waitForTimeout(DELAY_BETWEEN_ACTIONS);
    }

    // Final wait
    await page.waitForTimeout(3000);
  } finally {
    // Cleanup
    await fs.unlink(tempFile).catch(() => {});
    await page.close();
  }

  console.log(`✅ Completed: ${scenario.name}`);
  return {
    name: scenario.name,
    title: scenario.title,
    description: scenario.description,
    duration: scenario.duration,
  };
}

/**
 * Generate all MCP demo videos
 */
async function generateMCPVideos() {
  console.log("🎬 Generating MCP Demo Videos");
  console.log("=".repeat(50));

  // Ensure videos directory exists
  await fs.mkdir(VIDEOS_DIR, { recursive: true });

  // Launch browser with video recording
  const browser = await chromium.launch({
    headless: false,
    slowMo: 1000,
    args: ["--no-sandbox", "--disable-dev-shm-usage"],
  });

  const createdVideos = [];

  try {
    // Record video for each scenario
    for (const scenario of MCP_SCENARIOS) {
      const context = await browser.newContext({
        viewport: { width: VIDEO_WIDTH, height: VIDEO_HEIGHT },
        recordVideo: {
          dir: VIDEOS_DIR,
          size: { width: VIDEO_WIDTH, height: VIDEO_HEIGHT },
        },
      });

      const page = await context.newPage();

      // Create temporary demo page
      const tempFile = path.join(__dirname, "temp-mcp-demo.html");
      await fs.writeFile(tempFile, DEMO_PAGE_HTML);

      try {
        // Navigate and execute actions
        await page.goto(`file://${tempFile}`);
        await page.waitForTimeout(2000);

        // Execute scenario actions with better timing
        for (const action of scenario.actions) {
          switch (action.type) {
            case "navigate":
              if (action.url.includes("localhost")) {
                console.log(
                  `⚠  Skipping localhost navigation for ${scenario.name} (demo server not running)`,
                );
                // Show demo page instead
                await page.goto(`file://${tempFile}`);
              } else {
                await page.goto(action.url);
              }
              break;
            case "wait":
              await page.waitForTimeout(action.duration);
              break;
            case "click":
              if (action.selector) {
                try {
                  await page.click(action.selector


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ManageLiteAV;

namespace TRTCCSharpDemo
{
    public partial class VedioSettingForm : Form
    {
        private TRTCVideoEncParam mEncParam;
        private ITRTCDeviceCollection mCameraDeviceList;
        private ITRTCCloud mTRTCCloud;
        private ITXDeviceManager mDeviceManager;
        private ITRTCDeviceInfo mCameraDevice;
        private TRTCMainForm mMainForm;
        public VedioSettingForm(TRTCMainForm mainform)
        {
            InitializeComponent();
            this.Disposed += new EventHandler(OnDisposed);

            this.mTRTCCloud = DataManager.GetInstance().trtcCloud;
            this.mDeviceManager = mTRTCCloud.getDeviceManager();

            this.resolutionComboBox.Items.Add("120 x 120");
            this.resolutionComboBox.Items.Add("160 x 160");
            this.resolutionComboBox.Items.Add("270 x 270");
            this.resolutionComboBox.Items.Add("480 x 480");
            this.resolutionComboBox.Items.Add("160 x 120");
            this.resolutionComboBox.Items.Add("240 x 180");
            this.resolutionComboBox.Items.Add("280 x 210");
            this.resolutionComboBox.Items.Add("320 x 240");
            this.resolutionComboBox.Items.Add("400 x 300");
            this.resolutionComboBox.Items.Add("480 x 360");
            this.resolutionComboBox.Items.Add("640 x 480");
            this.resolutionComboBox.Items.Add("960 x 720");
            this.resolutionComboBox.Items.Add("160 x 90");
            this.resolutionComboBox.Items.Add("256 x 144");
            this.resolutionComboBox.Items.Add("320 x 180");
            this.resolutionComboBox.Items.Add("480 x 270");
            this.resolutionComboBox.Items.Add("640 x 360");
            this.resolutionComboBox.Items.Add("960 x 540");
            this.resolutionComboBox.Items.Add("1280 x 720");

            this.fpsComboBox.Items.Add("15 fps");
            this.fpsComboBox.Items.Add("20 fps");
            this.fpsComboBox.Items.Add("24 fps");

            this.resolutionModeComboBox.Items.Add("横屏模式");
            this.resolutionModeComboBox.Items.Add("竖屏模式");

            mMainForm = mainform;
        }
        #region Form Move

        private bool mIsMouseDown = false;
        private Point mFormLocation;     // Form的location
        private Point mMouseOffset;      // 鼠标的按下位置

        private void OnFormMouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                mIsMouseDown = true;
                mFormLocation = this.Location;
                mMouseOffset = Control.MousePosition;
            }
        }

        private void OnFormMouseUp(object sender, MouseEventArgs e)
        {
            mIsMouseDown = false;
        }

        private void OnFormMouseMove(object sender, MouseEventArgs e)
        {
            if (mIsMouseDown)
            {
                Point pt = Control.MousePosition;
                int x = mMouseOffset.X - pt.X;
                int y = mMouseOffset.Y - pt.Y;

                this.Location = new Point(mFormLocation.X - x, mFormLocation.Y - y);
            }
        }

        #endregion
        public void OnDeviceChange(string deviceId, TRTCDeviceType type, TRTCDeviceState state)
        {
            if (type == TRTCDeviceType.TXMediaDeviceTypeCamera)
            {
                RefreshCameraDeviceList();
            }
        }
        private void OnDisposed(object sender, EventArgs e)
        {
            //清理资源
            if


式设计
- 可配置的样式选项

[创建 src/components/ResponsiveCard.vue 文件...]

用户: > 请添加点击动画效果

Claude: 我为卡片组件添加了点击动画效果：
- hover悬停效果
- 点击时的缩放动画
- 平滑的过渡效果

[更新组件代码...]
```

### 示例2：知识卡片生成
```bash
用户: > 生成一张关于TypeScript基础语法的知识卡片

Claude: 我将为您生成TypeScript基础语法的知识卡片，包含：
- 基本类型定义
- 接口和类的使用
- 泛型的概念
- 实用示例代码

[在 data/cards/typescript-basics/ 目录下生成文件...]

用户: > 预览这张卡片的效果

Claude: 卡片预览已生成，您可以通过以下方式查看：
- Web预览: http://localhost:8080/preview/typescript-basics
- 分享链接: [生成分享链接]
```

## 📱 移动端终端

### 触控优化

**输入方式**:
- 触屏键盘输入
- 语音输入（支持的浏览器）
- 快捷命令按钮

**显示优化**:
- 自动调整字体大小
- 滚动查看历史记录
- 触控友好的按钮尺寸

### 移动端专属功能

```bash
# 语音输入（如果支持）
> [语音] 帮我创建一个待办事项应用

# 快速操作
> [快捷按钮] 生成卡片
> [快捷按钮] 查看文件
> [快捷按钮] 帮助
```

## 🔧 高级功能

### 会话管理

```bash
# 查看当前会话状态
> session status

# 保存会话
> session save my-project-work

# 加载历史会话
> session load my-project-work

# 清理会话
> session clear
```

### 多任务处理

```bash
# 并行任务
> 同时执行以下任务：
1. 生成用户手册
2. 创建API文档
3. 编写测试用例

# 任务队列
> 队列执行：先生成组件，然后写测试，最后生成文档
```

### 上下文记忆

Claude会记住对话上下文：

```bash
用户: > 创建一个用户管理系统

Claude: [创建相关文件和结构...]

用户: > 为这个系统添加权限管理

Claude: 我将为刚才创建的用户管理系统添加权限管理功能...
[基于之前的上下文继续开发...]
```

## 🎨 自定义配置

### 个人偏好设置

`


  'hurry': ["🏃➡","🏃♀➡","🏃♂","🏃♂➡"],
  'hurt': ["🤕","🩼"],
  'hushed': ["😯"],
  'hut': ["🛖"],
  'hyacinth': ["🪻"],
  'hypnotized': ["😵💫"],
  'i': ["🇮","ℹ"],
  'i18n': ["🌐"],
  'ic': ["🇮🇨"],
  'ice_cream': ["🍨"],
  'ice_cube': ["🧊"],
  'ice_hockey': ["🏒"],
  'ice_skate': ["⛸"],
  'icecream': ["🍦"],
  'iceland': ["🇮🇸"],
  'icicles': ["🥶"],
  'icon': ["🆖","🔵","▪","▫","⬛","⬜","◼","◻","◾","◽"],
  'id': ["🆔","🪪","🇮🇩"],
  'idea': ["💡"],
  'identical': ["👯♀"],
  'identification': ["🪪"],
  'identification_card': ["🪪"],
  'identity': ["🫆"],
  'ideograph_advantage': ["🉐"],
  'idk': ["🤷♀"],
  'ie': ["🇮🇪"],
  'ignorance': ["🤷♀"],
  'ikea': ["🔧"],
  'il': ["🇮🇱"],
  'ill': ["🤢","😷"],
  'im': ["🇮🇲"],
  'immortal': ["🐦🔥"],
  'imp': ["👿"],
  'impressed': ["😮"],
  'improving': ["❤🩹"],
  'in': ["🇮🇳"],
  'inbox': ["✉","📨","📧","📪","📫","📬","📭","📤"],
  'inbox_tray': ["📥"],
  'incognito': ["🥸"],
  'incoming': ["📲"],
  'incoming_envelope': ["📨"],
  'increase': ["➕"],
  'index': ["🫰","🫵"],
  'index_pointing_at_the_viewer': ["🫵"],
  'india': ["🇮🇳"],
  'indian': ["👳♀","👳","🍛","🇮🇴"],
  'indifference': ["😐","😒","😕","🤷♀"],
  'indifferent': ["😑","🤷","🤷♂"],
  'indonesia': ["🇮🇩"],
  'industrial': ["🧑🏭","👩🏭","👨🏭"],
  'industry': ["🏭"],
  'infatuation': ["😍","🥰","😘","😗","😙","😚"],
  'infinity': ["♾"],
  'info': ["🚮"],
  'information': ["💁","💁♂","📄"],
  'information_


xternally
    actual var fillRule: CanvasFillRule? /* = CanvasFillRule.NONZERO */
        get() = definedExternally
        set(value) = definedExternally
    actual var id: String? /* = "" */
        get() = definedExternally
        set(value) = definedExternally
    actual var parentID: String? /* = null */
        get() = definedExternally
        set(value) = definedExternally
    actual var cursor: String? /* = "inherit" */
        get() = definedExternally
        set(value) = definedExternally
    actual var control: Element? /* = null */
        get() = definedExternally
        set(value) = definedExternally
    actual var label: String? /* = null */
        get() = definedExternally
        set(value) = definedExternally
    actual var role: String? /* = null */
        get() = definedExternally
        set(value) = definedExternally
}

@Suppress("UNUSED_PARAMETER")
public actual fun HitRegionOptions(path: Path2D?, fillRule: CanvasFillRule?, id: String?, parentID: String?, cursor: String?, control: Element?, label: String?, role: String?): HitRegionOptions = js("({ path: path, fillRule: fillRule, id: id, parentID: parentID, cursor: cursor, control: control, label: label, role: role })")

/**
 * Exposes the JavaScript [ImageData](https://developer.mozilla.org/en/docs/Web/API/ImageData) to Kotlin
 */
public actual external open class ImageData : ImageBitmapSource, TexImageSource, JsAny {
    actual constructor(sw: Int, sh: Int)
    actual constructor(data: Uint8ClampedArray, sw: Int, sh: Int)
    actual open val width: Int
    actual open val height: Int
    actual open val data: Uint8ClampedArray
}

/**
 * Exposes the JavaScript [Path2D](https://developer.mozilla.org/en/docs/Web/API/Path2D) to Kotlin
 */
public actual external open class Path2D actual constructor() : CanvasPath, JsAny {
    actual constructor(path: Path2D)
    actual constructor(paths: JsArray<Path2D>, fillRule: CanvasFillRule)
    actual constructor(d: String)
    actual fun addPath(path: Path2D, transform: JsAny?)
    actual override fun closePath()
    actual override fun moveTo(x: Double, y: Double)
    actual override fun lineTo(x: Double, y: Double)
    actual override fun quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double)
    actual override fun bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double)
    actual override fun arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double)
    actual override fun arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radiusX: Double, radiusY: Double, rotation: Double)
    actual override fun rect(x: Double, y: Double, w: Double, h: Double)
    actual override fun arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean /* = definedExternally */)
    actual override fun ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean /* = definedExternally */)
}

/**
 * Exposes the JavaScript [ImageBitmapRenderingContext](https://developer.mozilla.org/en/docs/Web/API/ImageBitmapRenderingContext) to Kotlin
 */
public actual external abstract class ImageBitmapRenderingContext : JsAny {
    actual open val canvas: HTMLCanvasElement
    actual fun transferFromImageBitmap(bitmap: ImageBitmap?)
}

public actual external interface ImageBitmapRenderingContextSettings : JsAny {
    actual var alpha: Boolean?


WindowPasteAndMatchStyle(w.c)
}

// Delete deletes the current text selection
func (w *Window) Delete() {
	C.GalliumWindowDelete(w.c)
}

// SelectAll selects all text in the current element
func (w *Window) SelectAll() {
	C.GalliumWindowSelectAll(w.c)
}

// Unselect unselects any text selection
func (w *Window) Unselect() {
	C.GalliumWindowUnselect(w.c)
}

// OpenDevTools opens the developer tools for this window.
func (w *Window) OpenDevTools() {
	C.GalliumWindowOpenDevTools(w.c)
}

// CloseDevTools closes the developer tools.
func (w *Window) CloseDevTools() {
	C.GalliumWindowCloseDevTools(w.c)
}

// DevToolsVisible returns whether the developer tools are showing
func (w *Window) DevToolsAreOpen() bool {
	return bool(C.GalliumWindowDevToolsAreOpen(w.c))
}

// NativeWindow gets a operating-system dependent handle for this window. Under macOS
// this is NSWindow*.
func (w *Window) NativeWindow() unsafe.Pointer {
	return unsafe.Pointer(C.GalliumWindowNativeWindow(w.c))
}

// NativeWindow gets an operating-system dependent handle for the window controller.
// Under macOS this is *NSWindowController.
func (w *Window) NativeController() unsafe.Pointer {
	return unsafe.Pointer(C.GalliumWindowNativeController(w.c))
}
// This has been ported and cherry picked from https://github.com/kovidgoyal/imaging/tree/master
// which is the most up to date fork for the popular imaging library
// There is a lot of good functionality there but I do not need the majority of it just the image resizing

package utils

import (
	"image"
	"image/color"
	"math"
)

type scanner struct {
	image   image.Image
	w, h    int
	palette []color.NRGBA
}

func newScanner(img image.Image) *scanner {
	s := &scanner{
		image: img,
		w:     img.Bounds().Dx(),
		h:     img.Bounds().Dy(),
	}
	if img, ok := img.(*image.Paletted); ok {
		s.palette = make([]color.NRGBA, max(256, len(img.Palette)))
		for i := 0; i < len(img.Palette); i++ {
			s.palette[i] = color.NRGBAModel.Convert(img.Palette[i]).(color.NRGBA)
		}
	}
	return s
}

// scan scans the given rectangular region of the image into dst.
func (s *scanner) scan(x1, y1, x2, y2 int, dst []uint8) {
	switch img := s.image.(type) {
	case *image.NRGBA:
		size := (x2 - x1) * 4
		j := 0
		i := y1*img.Stride + x1*4
		if size == 4 {
			for y := y1; y < y2; y++ {
				d := dst[j : j+4 : j+4]
				s := img.Pix[i : i+4 : i+4]
				d[0] = s[0]
				d[1] = s[1]
				d[2] = s[2]
				d[3] = s[3]
				j += size
				i += img.Stride
			}
		} else {
			for y := y1; y < y2; y++ {
				copy(dst[j:j+size], img.Pix[i:i+size])
				j += size
				i += img.Stride
			}
		}

	case *image.NRGBA64:
		j := 0
		for y := y1; y < y2; y++ {
			i := y*img.Stride + x1*8
			for x := x1; x < x2; x++ {
				s :=


padding: 10px 20px;
            font-size: 16px;
            border: none;
            border-radius: 50px;
            color: white;
            background-color: #4CAF50;
            cursor: pointer;
            box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease 0s;
        }

        button:hover {
            background-color: #45a049;
        }

        button:active {
            transform: scale(0.95);
            box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.1);
        }

        #forward {
            grid-area: forward;
        }

        #backward {
            grid-area: backward;
        }

        #left {
            grid-area: left;
        }

        #right {
            grid-area: right;
        }

        #stop {
            grid-area: stop;
            background-color: red;
        }
    </style>

        <button id="forward" onmousedown="buttonDown('forward')" onmouseup="buttonUp()">Forward</button>
        <button id="left" onmousedown="buttonDown('left')" onmouseup="buttonUp()">Left</button>
        <button id="stop" onmousedown="buttonDown('stop')" onmouseup="buttonUp()">Stop</button>
        <button id="right" onmousedown="buttonDown('right')" onmouseup="buttonUp()">Right</button>
        <button id="backward" onmousedown="buttonDown('backward')" onmouseup="buttonUp()">Backward</button>

Stunts 🚗💨

            <button id="s-drift" onmousedown="buttonDown('s-drift')" onmouseup="buttonUp()" style="background-color: grey;">🌀 S-Drift</button>
            <button id="donut" onmousedown="buttonDown('donut')" onmouseup="buttonUp()" style="background-color: grey;">🍩 Donut</button>
            <button id="reverse-donut" onmousedown="buttonDown('reverse-donut')" onmouseup="buttonUp()" style="background-color: grey;">↩ Reverse Donut</button>
            <button id="normal-drift" onmousedown="buttonDown('normal-drift')" onmouseup="buttonUp()" style="background-color: grey;">⏱ Normal 4 second drift</button>

"""

def handle_request(request):
    status_code = '200 OK'
    message = ''
    lines = request.split('\n')
    first_line = lines[0].split(' ')
    if len(first_line) >= 3:
        method, path, _ = first_line
    else:
        method, path = first_line[0], ''

    if method == 'POST':
        try:
            if path == '/forward':
                controller.move_forward()
                message = 'Moving forward'
            elif path == '/backward':
                controller.move_backward()
                message = 'Moving backward'
            elif path == '/left':
                controller.turn_left()
                message = 'Turning left'
            elif path == '/right':
                controller.turn_right()
                message = 'Turning right'
            elif path == '/stop':
                controller.stop()
                mes


:{video:"วีดีโอ",videoLink:"ลิงก์ของวีดีโอ",insert:"แทรกวีดีโอ",url:"ที่อยู่ URL ของวีดีโอ",providers:"(YouTube, Vimeo, Vine, Instagram, DailyMotion หรือ Youku)"},link:{link:"ตัวเชื่อมโยง",insert:"แทรกตัวเชื่อมโยง",unlink:"ยกเลิกตัวเชื่อมโยง",edit:"แก้ไข",textToDisplay:"ข้อความที่ให้แสดง",url:"ที่อยู่เว็บไซต์ที่ต้องการให้เชื่อมโยงไปถึง?",openInNewWindow:"เปิดในหน้าต่างใหม่"},table:{table:"ตาราง",addRowAbove:"เพิ่มแถวด้านบน",addRowBelow:"เพิ่มแถวด้านล่าง",addColLeft:"เพิ่มคอลัมน์ด้านซ้าย",addColRight:"เพิ่มคอลัมน์ด้านขวา",delRow:"ลบแถว",delCol:"ลบคอลัมน์",delTable:"ลบตาราง"},hr:{insert:"แทรกเส้นคั่น"},style:{style:"รูปแบบ",p:"ปกติ",blockquote:"ข้อความ",pre:"โค้ด",h1:"หัวข้อ 1",h2:"หัวข้อ 2",h3:"หัวข้อ 3",h4:"หัวข้อ 4",h5:"หัวข้อ 5",h6:"หัวข้อ 6"},lists:{unordered:"รายการแบบไม่มีลำดับ",ordered:"รายการแบบมีลำดับ"},options:{help:"ช่วยเหลือ",fullscreen:"ขยายเต็มหน้าจอ",codeview:"ซอร์สโค้ด"},paragraph:{paragraph:"ย่อหน้า",outdent:"เยื้องซ้าย",indent:"เยื้องขวา",left:"จัดหน้าชิดซ้าย",center:"จัดหน้ากึ่งกลาง",right:"จัดหน้าชิดขวา",justify:"จัดบรรทัดเสมอกัน"},color:{recent:"สีที่ใช้ล่าสุด",more:"สีอื่นๆ",background:"สีพื้นหลัง",foreground:"สีพื้นหน้า",transparent:"โปร่งแสง",setTransparent:"ตั้งค่าความโปร่งแสง",reset:"คืนค่า",resetToDefault:"คืนค่ามาตรฐาน"},shortcut:{shortcuts:"แป้นลัด",close:"ปิด",textFormatting:"การจัดรูปแบบข้อความ",action:"การกระทำ",paragraphFormatting:"การจัดรูปแบบย่อหน้า",documentStyle:"รูปแบบของเอกสาร",extraKeys:"Extra keys"},help:{insertParagraph:"Insert Paragraph",undo:"Undoes the last command",redo:"Redoes the last command",tab:"Tab",untab:"Untab",bold:"ทำตัวหนา",italic:"ทำตัวเอียง",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"To


getLastNameValue() {
        this.lastNameInput = this.element.querySelector('#last-name');
        return this.lastNameInput?.value;

    }
    getEmailValue() {
        this.emailInput = this.element.querySelector('#email');
        return this.emailInput?.value;
    }

    setError(err: string | null) {
        if (err === null) {
            this.element.classList.remove('error');
        } else {
            this.element.classList.add('error')
        }
    }

    //получаем юзера
    getObject() {
       let user={
           name: this.getNameValue(),
           lastName:this.getLastNameValue(),
           email:this.getEmailValue()
       };
        return user;
    }

    render(){
        this.element.innerHTML = `

                   Name -->
                    <input id="name" type="text" required>

                    Last Name -->
                    <input id="last-name" type="text" required>

                    E-mail -->
                   <input id="email" type="emai" required>

`;

        this.element.append(this.submitButton.node);

        return this.element;
    }

    //Validation
  validationOnLetters(){
        const letters = /^[A-Za-zА-я]+$/;
        if(this.nameInput?.value.match(letters))
        {
            return true;
        }
        else
        {
           this.nameInput?.focus();
        alert("name should be only letters")
           return false;
        }
    }
}

// class Button extends Control{
//     public node!: HTMLButtonElement;
//     public  onClick!:()=>void;
//
//     constructor(parentNode:HTMLElement,caption:string) {
//         super(parentNode,'button','register-btn',caption);
//         this.node.onclick=()=>{
//             this.onClick&&this.onClick();
//         }
//     }
// }
// let readAllButton= new Button(document.body,'Register')
// console.log(readAllButton)

// export  class ValidForm {
//     node: HTMLElement;
//     constructor(parentNode:HTMLElement | null =null, tagName:string='div',className:string='',content:string='') {
//         const el=document.createElement(tagName);
//         el.className=className;
//         el.textContent=content;
//         parentNode && parentNode.appendChild(el);
//         this.node=el;
//     }
// }
//
// export class Input extends ValidForm{
//     private name: string;
//     private caption:any;
//     private error: ValidForm;
//     private field:ValidForm;
//
//     constructor(parentNode=null, name:string,onValid:boolean) {
//         super(parentNode);
//         this.name=name;
//         this.caption=new ValidForm(this.node,'div');
//         this.field=new ValidForm(this.node,'input');
//         this.error=new ValidForm(this.node,'div');
//         this.field.node.addEventListener('input',()=>{
//             console.log("get value from input");
//             if (this.validate) {
//                 this.setError(this.validate(this.getValue()));
//             }
//             if(this.onInput){
//                 this.onInput();
//             }
//         });
//         this.validate = onValidate ;


alues at the current pixel position, if you release the SHIFT key again, then the min/max are accumulated
    again.

Context Menu

A click with the right mouse button on the diagram brings up a context menu
    which consists of the following menu items:

Properties...

        Edit several properties (colors, axes, etc.) of the diagram.

        Use this menu to set the axis' ranges to fixed values.

Copy

        Copies the diagram as image into the clipboard.

Save As...

        Save the diagram as image (PNG).

Print...

        Print the diagram.

Zoom In

Both Axes - Zoom in on both axes.

Domain Axes - Zoom in only on the domain axis.

Range Axes - Zoom in only on the range axis.

Zoom Out

Both Axes - Zoom out on both axes.

Domain Axes - Zoom out only on the domain axis.

Range Axes - Zoom out only on the range axis.

Auto Range

Both Axes - Adjusts both axes to the full data range.

                This is similar to holding the SHIFT key pressed.

Domain Axes - Adjusts the domain axis to the full data range.

Range Axes - Adjusts the range axis to the full data range.

In the following the tool buttons of the spectrum view are explained.

        Opens the Spectrum Chooser, which allows you to choose which spectra
        and bands to display and to alter their appearance.

        Toggles the visibility of the cursor spectrum.

        Toggles the visibility of the spectra of the selected pins.

        Toggles the visibility of all pin spectra.

        Switches the grid lines of the diagram on and off.

        Exports the spectra to a .csv file.

        Displays this help page.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>Help - Ionospheric Correction</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="../style.css">

        <td class="


// Copyright (c) Kurrent, Inc and/or licensed to Kurrent, Inc under one or more agreements.
// Kurrent, Inc licenses this file to you under the Kurrent License v1 (see LICENSE.md).

using System;
using System.Collections.Generic;
using KurrentDB.Common.Utils;

namespace KurrentDB.Projections.Core.Services.Processing;

public abstract class EventFilter {
	private readonly bool _allEvents;
	private readonly bool _includeDeletedStreamEvents;
	private readonly HashSet<string> _events;

	/// <summary>
	///
	/// </summary>
	/// <param name="allEvents"></param>
	/// <param name="includeDeletedStreamEvents">indicates whether non-link stream tombstone or
	/// metastream stream deleted events should be included. Links resolved into metastream
	/// stream deleted events are not restricted</param>
	/// <param name="events"></param>
	protected EventFilter(bool allEvents, bool includeDeletedStreamEvents, HashSet<string> events) {
		_allEvents = allE


 UsedAsBaseClass
    implements UsedAsInterface, InstantiatedButMethodsUnused {
  void usedInSubclass() {
    print('A');
  }
}

class ClassB extends UsedAsBaseClass
    implements UsedAsInterface, InstantiatedButMethodsUnused {
  void usedInSubclass() {
    print('B');
    calledFromB();
  }

  void calledFromSubclass() {}
}

void baseClassCall(UsedAsBaseClass object) {
  object.usedInSubclass();
}

void interfaceCall(UsedAsInterface object) {
  object.usedInSubclass();
}

void exactCallA(ClassA object) {
  object.usedInSubclass();
}

void exactCallB(ClassB object) {
  object.usedInSubclass();
}

unusedTopLevel() {
  print('Unused');
}

usedTopLevel() {}

main() {
  usedTopLevel();

  ClassA a = new ClassA();
  exactCallA(a);
  baseClassCall(a);
  interfaceCall(a);

  ClassB b = new ClassB();
  exactCallB(b);
  baseClassCall(b);
  interfaceCall(b);

  new InstantiatedButMethodsUnused();
}
// Copyright (c) 2021, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

class Const {
  const Const();
}

class Class {
  const Class(Object? message) : assert(false, message);
}

main() {
  expect(null, test(() {
    assert(false);
  }));
  expect(null, test(() {
    assert(false, null);
  }));
  expect('foo', test(() {
    assert(false, 'foo');
  }));
  expect(0, test(() {
    assert(false, 0);
  }));
  expect(const {}, test(() {
    assert(false, const {});
  }));
  expect(#_symbol, test(() {
    assert(false, #_symbol);
  }));
  expect(const Const(), test(() {
    assert(false, const Const());
  }));

  expect(null, test(() {
    Class(null);
  }));
  expect('foo', test(() {
    Class('foo');
  }));
  expect(0, test(() {
    Class(0);
  }));
  expect(const {}, test(() {
    Class(const {});
  }));
  expect(#_symbol, test(() {
    Class(#_symbol);
  }));
  expect(const Const(), test(() {
    Class(const Const());
  }));
}

expect(expected, actual) {
  if (expected != actual) throw 'Expected $expected, actual $actual';
}

Object? test(void Function() f) {
  try {
    f();
  } on AssertionError catch (e) {
    print(e);
    return e.message;
  } catch (e) {
    throw 'Unexpected exception $e (${e.runtimeType}';
  }
  throw 'Missing exception';
}
// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

class Class<T> {}

class ConcreteClass implements Class<ConcreteClass> {}

typedef F<X extends Class<X>> = X;

class G<X extends Class<X>> {}

F? field1a, field1b; // Ok
F<dynamic>? field2a, field2b; // Ok
F<Class>? field3a, field3b; // Ok
F<Class<dynamic>>? field4a, field4b; // Ok
F<ConcreteClass>? field5a, field5b; // Ok
F<Class<


t (
	"context"
	"database/sql"
	"strings"
	"time"

	"github.com/matrix-org/gomatrixserverlib/spec"
	"github.com/sirupsen/logrus"

	"github.com/matrix-org/dendrite/internal"
	"github.com/matrix-org/dendrite/internal/sqlutil"
	"github.com/matrix-org/dendrite/userapi/api"
	"github.com/matrix-org/dendrite/userapi/storage/tables"
	"github.com/matrix-org/dendrite/userapi/types"
)

const userDailyVisitsSchema = `
CREATE TABLE IF NOT EXISTS userapi_daily_visits (
    localpart TEXT NOT NULL,
	device_id TEXT NOT NULL,
	timestamp BIGINT NOT NULL,
	user_agent TEXT
);

-- Device IDs and timestamp must be unique for a given user per day
CREATE UNIQUE INDEX IF NOT EXISTS userapi_daily_visits_localpart_device_timestamp_idx ON userapi_daily_visits(localpart, device_id, timestamp);
CREATE INDEX IF NOT EXISTS userapi_daily_visits_timestamp_idx ON userapi_daily_visits(timestamp);
CREATE INDEX IF NOT EXISTS userapi_daily_visits_localpart_timestamp_idx ON userapi_daily_visits(localpart, timestamp);
`

const messagesDailySchema = `
CREATE TABLE IF NOT EXISTS userapi_daily_stats (
	timestamp BIGINT NOT NULL,
	server_name TEXT NOT NULL,
	messages BIGINT NOT NULL,
	sent_messages BIGINT NOT NULL,
	e2ee_messages BIGINT NOT NULL,
	sent_e2ee_messages BIGINT NOT NULL,
	active_rooms BIGINT NOT NULL,
	active_e2ee_rooms BIGINT NOT NULL,
	CONSTRAINT daily_stats_unique UNIQUE (timestamp, server_name)
);
`

const upsertDailyMessagesSQL = `
	INSERT INTO userapi_daily_stats (timestamp, server_name, messages, sent_messages, e2ee_messages, sent_e2ee_messages, active_rooms, active_e2ee_rooms)
	VALUES ($1, $2, $3, $4, $5, $6, $7, $8) ON CONFLICT (timestamp, server_name)
	DO UPDATE SET
	    messages=messages+excluded.messages, sent_messages=sent_messages+excluded.sent_messages,
	    e2ee_messages=e2ee_messages+excluded.e2ee_messages, sent_e2ee_messages=sent_e2ee_messages+excluded.sent_e2ee_messages,
	    active_rooms=MAX($7, active_rooms), active_e2ee_rooms=MAX($8, active_e2ee_rooms)
`

const selectDailyMessagesSQL = `
	SELECT messages, sent_messages, e2ee_messages, sent_e2ee_messages, active_rooms, active_e2ee_rooms
	FROM userapi_daily_stats
	WHERE server_name = $1 AND timestamp = $2;
`

const countUsersLastSeenAfterSQL = "" +
	"SELECT COUNT(*) FROM (" +
	" SELECT localpart FROM userapi_devices WHERE last_seen_ts > $1 " +
	" GROUP BY localpart" +
	" ) u"

// Note on the following countR30UsersSQL and countR30UsersV2SQL: The different checks are intentional.
// This is to ensure the values reported by Dendrite are the same as by Synapse.
// Queries are taken from: https://github.com/matrix-org/synapse/blob/9ce51a47f6e37abd0a1275281806399d874eb026/synapse/storage/databases/main/stats.py

/*
R30Users counts the number of 30 day retained users, defined as:
- Users who have created their accounts more than 30 days ago
- Where last seen at most 30 days ago
- Where account creation and last_seen are > 30 days apart
*/
const countR30UsersSQL = `
SELECT platform, COUNT(*) FROM (
	SELECT users.localpart, platform, users.created_ts, MAX(u


s.com/yiliao/1784.html'
        # 文章
        # article_link = 'http://m.cnys.com/yangshengzixun/2158.html'

        # 爱范儿
        # 视频
        # article_link = 'https://www.ifanr.com/video/1195120'
        # 图文
        # article_link = 'https://www.ifanr.com/1227137'
        # article_link = 'https://www.ifanr.com/app/1257907'

        # 科学松鼠会
        # article_link = 'https://songshuhui.net/archives/101270'

        # 界面新闻
        # article_link = 'https://www.jiemian.com/article/3265195.html'
        # 视频
        # article_link = 'https://www.jiemian.com/video/AGQCNwhhB24BP1Vh.html'

        # 澎湃网
        # article_link = 'https://m.thepaper.cn/newsDetail_forward_3839854'

        # 虎嗅网
        # article_link = 'https://m.huxiu.com/article/308402.html'

        # 南方周末
        # article_link = 'http://www.infzm.com/wap/#/content/153854'
        # article_link = 'http://www.infzm.com/wap/#/content/158165'

        # 好奇心日报
        # article_link = 'http://m.qdaily.com/mobile/articles/63484.html'

        # 西瓜视频
        # article_link = 'https://www.ixigua.com/i6623552886510977540/'

        # 梨视频
        # article_link = 'https://www.pearvideo.com/video_1584404'

        # 艾墨镇
        # article_link = 'https://aimozhen.com/view/15960/'

        # 美拍
        # article_link = 'https://www.meipai.com/media/1131644923'

        # 好看视频
        # article_link = 'https://haokan.baidu.com/v?vid=17448170737812377575&tab=shishang'

        # 七丽女性网
        # article_link = 'https://i.7y7.com/jiaju/97/386197.html'

        # 亲亲宝贝
        # article_link = 'https://m.qbaobei.com/v/video_25.html'

        # 发条网
        # article_link = 'https://mqtwj.fatiao.pro/detail/8937.html'

        # 觅糖
        # 视频
        # article_link = 'https://www.91mitang.com/pages/91022'
        # 图文
        # article_link = 'https://www.91mitang.com/pages/2106106'

        # 梨视频
        # article_link = 'https://www.pearvideo.com/video_1584072'
        # article_link = 'https://www.pearvideo.com/video_1598014'

        # 七丽女性网
        # article_link = 'https://i.7y7.com/hufu/84/385784.html'
        # article_link = 'https://i.7y7.com/hufu/37/385737.html'

        # 亲亲宝贝网
        # article_link = 'https://m.qbaobei.com/a/1372711.html'

        # 雪球
        # article_link = 'https://xueqiu.com/5157574024/130400677'

        # 5号女性网
        # article_link = 'http://m.5h.com/yl/148912.html'

        # 百思不得姐
        # article_link = 'http://www.budejie.com/detail-29752617.html'

        # 发条网
        # article_link = 'https://mart.fatiao.pro/detail/1522.html'

        # 来福爆笑娱乐网
        # article_link = 'http://www.laifudao.com/tupian/87109.htm?xid=tupian87109'

        # bilibili(firefox可正常打开, 但是cp server无法下载)
        # article_link = 'https://www.bilibili.com/video/av60965559?spm_id_from=333.334.b_62696c695f67756f636875616e67.42'

        # 快音视(全网短视频)
        # article_link = 'https://kuaiyinshi.com/?video_id=BMjAxODEyMDUyMDAxNDhfNDU4NTUxMzhfOTIzMTA5NzI5OV8xXzM=_b_Bdceec3ae37b9a0a335ee1282e9c1b62c&source=kuai-shou#search-form'

        # 搞笑gif图片集
        # article_link = 'https://m.gaoxiaogif.com/dongwugif/12298.html'

        # 酷燃视频
        # article_link = 'https://krcom.cn/7315375944/episodes/2358773:4438202283699380'

        # dy
        # article_link = 'https://v.douyin.com/se3wkb'

        # 金华广众网
        # article_link = 'https://news.jinhua.com.cn/shishi/2020-03-26/543480.html'

        # 金华热线
        article_link = 'http://m.0579.cn/read.php?tid=3138827'

        url = article_link

        return url

    def _request(self, target_url) -> str:
        '''
        测试用例
        :return:
        '''
        article_link = target_url

        now_timestamp = self.get_current_timestamp() - 5
        print('请求时间戳为: {}[{}]'.format(now_timestamp, str(timestamp_to_regulartime(now_timestamp))))
        new_url = b64encode(s=article_link.encode('utf-8')).decode('utf-8')
        print('b64编码后的article_link: {}'.format(new_url))
        params = {
            'access_key_id': self._access_key_id,
            'v': self._version,
            't': now_timestamp,                                                         # 10位
            # 'goods_link': b64encode(s=goods_link.encode('utf-8')).decode('utf-8'),  # 传str, 不传byte, server会识别
            'article_link': new_url,
        }
        # params.update({
        #     'sign': self._sign(params)
        # })
        # print('params如下:')
        # pprint(params)

        # url = 'http://127.0.0.1:5000/api/goods'


letConnectURIByIdData);
          break;
        case 'updateCacheHandlerKey':
          result.updateCacheHandlerKey = serializers.deserialize(value,
              specifiedType: const FullType(String)) as String?;
          break;
        case 'updateCacheHandlerContext':
          result.updateCacheHandlerContext = serializers.deserialize(value,
              specifiedType: const FullType(Map, const [
                const FullType(String),
                const FullType(dynamic)
              ])) as Map<String, dynamic>?;
          break;
        case 'fetchPolicy':
          result.fetchPolicy = serializers.deserialize(value,
                  specifiedType: const FullType(_i1.FetchPolicy))
              as _i1.FetchPolicy?;
          break;
        case 'executeOnListen':
          result.executeOnListen = serializers.deserialize(value,
              specifiedType: const FullType(bool))! as bool;
          break;
      }
    }

    return result.build();
  }
}

class _$GgetWalletConnectURIByIdReq extends GgetWalletConnectURIByIdReq {
  @override
  final _i3.GgetWalletConnectURIByIdVars vars;
  @override
  final _i4.Operation operation;
  @override
  final String? requestId;
  @override
  final _i2.GgetWalletConnectURIByIdData? Function(
          _i2.GgetWalletConnectURIByIdData?, _i2.GgetWalletConnectURIByIdData?)?
      updateResult;
  @override
  final _i2.GgetWalletConnectURIByIdData? optimisticResponse;
  @override
  final String? updateCacheHandlerKey;
  @override
  final Map<String, dynamic>? updateCacheHandlerContext;
  @override
  final _i1.FetchPolicy? fetchPolicy;
  @override
  final bool executeOnListen;

  factory _$GgetWalletConnectURIByIdReq(
          [void Function(GgetWalletConnectURIByIdReqBuilder)? updates]) =>
      (new GgetWalletConnectURIByIdReqBuilder()..update(updates))._build();

  _$GgetWalletConnectURIByIdReq._(
      {required this.vars,
      required this.operation,
      this.requestId,
      this.updateResult,
      this.optimisticResponse,
      this.updateCacheHandlerKey,
      this.updateCacheHandlerContext,
      this.fetchPolicy,
      required this.executeOnListen})
      : super._() {
    BuiltValueNullFieldError.checkNotNull(
        vars, r'GgetWalletConnectURIByIdReq', 'vars');
    BuiltValueNullFieldError.checkNotNull(
        operation, r'GgetWalletConnectURIByIdReq', 'operation');
    BuiltValueNullFieldError.checkNotNull(
        executeOnListen, r'GgetWalletConnectURIByIdReq', 'executeOnListen');
  }

  @override
  GgetWalletConnectURIByIdReq rebuild(
          void Function(GgetWalletConnectURIByIdReqBuilder) updates) =>
      (toBuilder()..update(updates)).build();

  @override
  GgetWalletConnectURIByIdReqBuilder toBuilder() =>
      new GgetWalletConnectURIByIdReqBuilder()..replace(this);

  @override
  bool operator ==(Object other) {
    if (identical(other, this)) return true;
    final dynamic _$dynamicOther = other;
    return other is GgetWalletConnectURIByIdReq &&
        vars == other.vars &&
        operation == other.operation &&
        requestId == other.requestId &&
        updateResult == _$dynamicOther.updateResult &&
        optimisticResponse == other.optimisticResponse &&
        updateCacheHandlerKey == other.updateCacheHandlerKey &&
        updateCacheHandlerContext == other.updateCacheHandlerContext &&
        fetchPolicy == other.fetchPolicy &&
        executeOnListen == other.executeOnListen;
  }

  @override
  i


    .dangling_is(Stake::from_value(Value::zero()))
        .and()
        .pools_total_stake_is(Stake::from_value(Value(997)));

    controller.removes_delegation(&alice, &mut ledger).unwrap();
    alice.confirm_transaction();

    LedgerStateVerifier::new(ledger.into())
        .info("after owner delegation removal")
        .distribution()
        .unassigned_is(Stake::from_value(Value(1994)))
        .and()
        .dangling_is(Stake::from_value(Value::zero()))
        .and()
        .pools_total_stake_is(Stake::from_value(Value::zero()));
}

#[test]
pub fn delegation_for_non_existing_account() {
    let (mut ledger, controller) = prepare_scenario()
        .with_initials(vec![wallet("Alice").with(1_000).owns("stake_pool")])
        .build()
        .unwrap();

    let alice = controller.wallet("Alice").unwrap();
    let bob = Wallet::from_value(Value(1_000));
    let stake_pool = controller.stake_pool("stake_pool").unwrap();

    assert!(controller
        .delegates_different_funder(&alice, &bob, &stake_pool, &mut ledger)
        .is_err());

    LedgerStateVerifier::new(ledger.into())
        .info("after owner delegation removal")
        .distribution()
        .unassigned_is(Stake::from_value(Value(1_000)))
        .and()
        .dangling_is(Stake::from_value(Value::zero()))
        .and()
        .pools_total_stake_is(Stake::from_value(Value::zero()));
}
<filename>examples/async-read-write.rs
// plctag-rs
//
// a rust wrapper of libplctag, with rust style APIs and useful extensions.
// Copyright: 2020-2021, Joylei <<EMAIL>>
// License: MIT

use plctag::futures::{AsyncTag, Error, TagEntry};

use tokio::runtime;

fn main() {
    let rt = runtime::Runtime::new().unwrap();
    let res: Result<_, Error> = rt.block_on(async {
        let path="protocol=ab-eip&plc=controllogix&path=1,0&gateway=192.168.1.120&name=MyTag1&elem_count=1&elem_size=16"; // YOUR TAG DEFINITION
        let tag = TagEntry::create(path).await?;
        let tag_ref = tag.get().await?;
        let offset = 0;
        let value: u16 = tag_ref.read_value(offset).await?;
        println!("tag value: {}", value);

        let value = value + 10;
        tag_ref.write_value(offset, value).await?;
        Ok(())
    });
    res.unwrap();
}
<gh_stars>0
use frankenstein::{ChatId, Error, GetUpdatesParams, SendMessageParams, TelegramApi, Update};
use tokio::sync::Mutex;
use tokio::task;

pub struct Api {
    api: Mutex<Box<frankenstein::Api>>,
    update_parameters: Mutex<GetUpdatesParams>,
}

impl Api {
    pub fn new(token: &str) -> Self {
        let timeout_seconds: u32 = 1;
        let mut params = GetUpdatesParams::new();
        params.set_timeout(Some(timeout_seconds));
        params.set_allowed_updates(Some(vec!["message".to_string()]));

        Self {
            api: Mutex::new(Box::new(frankenstein::Api::new(token))),
            update_parameters: Mutex::new(params),
        }
    }

    pub async fn get_updates(&self) -> Result<Vec<


uest extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:lt_ml_server.AnalyzedMatchRequest)
      AnalyzedMatchRequestOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use AnalyzedMatchRequest.newBuilder() to construct.
    private AnalyzedMatchRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private AnalyzedMatchRequest() {
      sentences_ = java.util.Collections.emptyList();
      textSessionID_ = emptyLongList();
    }

    @java.lang.Override
    @SuppressWarnings({"unused"})
    protected java.lang.Object newInstance(
        UnusedPrivateParameter unused) {
      return new AnalyzedMatchRequest();
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.languagetool.rules.ml.MLServerProto.internal_static_lt_ml_server_AnalyzedMatchRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.languagetool.rules.ml.MLServerProto.internal_static_lt_ml_server_AnalyzedMatchRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.languagetool.rules.ml.MLServerProto.AnalyzedMatchRequest.class, org.languagetool.rules.ml.MLServerProto.AnalyzedMatchRequest.Builder.class);
    }

    public static final int SENTENCES_FIELD_NUMBER = 1;
    @SuppressWarnings("serial")
    private java.util.List<org.languagetool.rules.ml.MLServerProto.AnalyzedSentence> sentences_;
    /**
     * repeated .lt_ml_server.AnalyzedSentence sentences = 1;
     */
    @java.lang.Override
    public java.util.List<org.languagetool.rules.ml.MLServerProto.AnalyzedSentence> getSentencesList() {
      return sentences_;
    }
    /**
     * repeated .lt_ml_server.AnalyzedSentence sentences = 1;
     */
    @java.lang.Override
    public java.util.List<? extends org.languagetool.rules.ml.MLServerProto.AnalyzedSentenceOrBuilder>
        getSentencesOrBuilderList() {
      return sentences_;
    }
    /**
     * repeated .lt_ml_server.AnalyzedSentence sentences = 1;
     */
    @java.lang.Override
    public int getSentencesCount() {
      return sentences_.size();
    }
    /**
     * repeated .lt_ml_server.AnalyzedSentence sentences = 1;
     */
    @java.lang.Override
    public org.languagetool.rules.ml.MLServerProto.AnalyzedSentence getSentences(int index) {
      return sentences_.get(index);
    }
    /**
     * repeated .lt_ml_server.AnalyzedSentence sentences = 1;
     */
    @java.lang.Override
    public org.languagetool.rules.ml.MLServerProto.AnalyzedSentenceOrBuilder getSentencesOrBuilder(
        int index) {
      return sentences_.get(index);
    }

    public static final int INPUTLOGGING_FIELD_NUMBER = 2;
    private boolean inputLogging_ = false;
    /**
     *

     * allow logging of input on error
     *

     *
     * bool inputLogging = 2;
     * @return The inputLogging.
     */
    @java.lang.Override
    public boolean getInputLogging() {
      return inputLogging_;
    }

    public static final int TEXTSESSIONID_FIELD_NUMBER = 3;
    @SuppressWarnings("serial")


"%s:%d", addr, port)
	return
}

func getRandomAddrPort() (addr string) {
	// 127.1-255.0-255.0-255:10000-50000
	ip := fmt.Sprintf("127.%d.%d.%d",
		rand.Int()%254+1, rand.Int()%255, rand.Int()%254)
	port := rand.Int()%40000 + 10000
	return fmt.Sprintf("%s:%d", ip, port)
}

func getRandomPort(ip string) (addr string) {
	// ip:1024-65535
	port := rand.Int()%(65536-1024) + 1024
	return fmt.Sprintf("%s:%d", ip, port)
}

func GetFreeAddrPort() (addrPort string) {
	timeout := time.Now().Add(time.Second)
	for {
		if runtime.GOOS == "linux" {
			addrPort = getRandomAddrPort()
		} else {
			addrPort = getRandomPort("127.0.0.1")
		}
		ln, err := net.Listen("tcp", addrPort)
		if err == nil {
			ln.Close()
			return
		}

		if time.Now().After(timeout) {
			panic("Can't found free address:port on localhost")
		}
	}
}

func kvmExists() bool {
	if _, err := os.Stat("/dev/kvm"); err != nil {
		return false
	}

	file, err := os.OpenFile("/dev/kvm", os.O_WRONLY, 0666)
	if err != nil {
		if os.IsPermission(err) {
			return false
		}
	}
	file.Close()

	return true
}

func (q *System) checkOopsPanic(s string) {
	if strings.Contains(s, "Kernel panic") {
		q.KernelPanic = true
		q.Log.Warn().Msg("kernel panic")
		time.Sleep(time.Second)
		// There is no reason to stay alive after kernel panic
		q.Stop()
	} else if strings.Contains(s, "BUG") {
		q.Log.Warn().Msg(s)
		time.Sleep(time.Second)
		// consider BUG() as non-recoverable state
		q.Stop()
	} else if strings.Contains(s, "WARNING") {
		q.Log.Warn().Msg(s)
	}
}

func (q System) cmdline() (s string) {
	s = "root=/dev/sda ignore_loglevel console=ttyS0 rw"

	if q.noKASLR {
		s += " nokaslr"
	}

	if q.noSMEP {
		s += " nosmep"
	}

	if q.noSMAP {
		s += " nosmap"
	}

	if q.noKPTI {
		s += " nokpti"
	}

	return
}

func (q System) Executable() string {
	return "qemu-system-" + string(q.arch)
}

func (q *System) Args() (qemuArgs []string) {
	if q.SSH.AddrPort == "" {
		q.SSH.AddrPort = GetFreeAddrPort()
	}
	hostfwd := fmt.Sprintf("hostfwd=tcp:%s-:22", q.SSH.AddrPort)
	qemuArgs = []string{"-nographic",
		"-hda", q.drivePath,
		"-kernel", q.kernel.KernelPath,
		"-smp", fmt.Sprintf("%d", q.Cpus),
		"-m", fmt.Sprintf("%d", q.Memory),
		"-device", "e1000,netdev=n1",
		"-netdev", "user,id=n1," + hostfwd,
	}

	if !q.Mutable {
		qemuArgs = append(qemuArgs, "-snapshot")
	}

	if q.debug {
		qemuArgs = append(qemuArgs, "-gdb", q.gdb)
	}

	if q.kernel.InitrdPath != "" {
		qemuArgs = append(qemuArgs, "-initrd", q.kernel.InitrdPath)
	}

	cpu := "max"
	if q.CPU.Model != "" {
		cpu = q.CPU.Model
	}


 *
 * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
 *
 * A copy of the MIT License is included in this file.
 *
 *
 * Terms of the MIT License:
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.tencent.devops.process.service

import com.tencent.devops.common.api.exception.ErrorCodeException
import com.tencent.devops.common.api.util.JsonUtil
import com.tencent.devops.common.api.util.Watcher
import com.tencent.devops.common.auth.api.AuthPermission
import com.tencent.devops.common.pipeline.pojo.element.Element
import com.tencent.devops.common.pipeline.pojo.element.atom.BeforeDeleteParam
import com.tencent.devops.common.pipeline.pojo.element.atom.ElementBatchCheckParam
import com.tencent.devops.common.pipeline.pojo.element.atom.ElementHolder
import com.tencent.devops.common.pipeline.pojo.element.atom.PipelineCheckFailedErrors
import com.tencent.devops.common.web.utils.I18nUtil
import com.tencent.devops.process.constant.ProcessMessageCode
import com.tencent.devops.process.constant.ProcessMessageCode.BK_PIPELINE_ELEMENT_CHECK_FAILED_MESSAGE
import com.tencent.devops.process.engine.atom.plugin.IElementBizPluginService
import com.tencent.devops.process.pojo.pipeline.SubPipelineIdAndName
import com.tencent.devops.process.engine.service.SubPipelineRefService
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

/**
 * 子流水线插件扩展点处理类
 */
@Service
class SubPipelineElementBizPluginService @Autowired constructor(
    private val subPipelineCheckService: SubPipelineCheckService,
    private val subPipelineRefService: SubPipelineRefService
) : IElementBizPluginService {

    companion object {
        private val logger = LoggerFactory.getLogger(SubPipelineElementBizPluginService::class.java)
    }

    override fun supportElement(element: Element): Boolean {
        return subPipelineCheckService.supportElement(element)
    }

    override fun supportAtomCode(atomCode: String): Boolean {
        return subPipelineCheckService.supportAtomCode(atomCode)
    }

    override fun beforeDelete(element: Element, param: BeforeDeleteParam) {
        element.id?.let {
            subPipelineRefService.delete(
                projectId = param.projectId,
                pipelineId = param.pipelineId,
                taskId = it
            )
        }
    }

    override fun batchCheck(elements: List<ElementHolder>, param: ElementBatchCheckParam) {
        if (param.projectId.isNullOrBlank() || param.isTemplate) return
        val errors = mutableListOf<PipelineCheckFailedErrors.ErrorInfo>()
        with(param) {
            val subPipelineElementMap = subPipelineCheckService.distinctSubPipeline(
                projectId = projectId!!,
                elements = elements,
                contextMap = contextMap
            )
            val watcher = Watcher("batch check sub pipeline|${param.pipelineId}")


Time.hour, _maxTime.hour];
  }

  /// calculate the range of minute
  List<int> _calcMinuteRange({currHour}) {
    int minMinute = 0, maxMinute = 59;
    int minHour = _minTime.hour;
    int maxHour = _maxTime.hour;
    currHour ??= _currHour;

    if (minHour == currHour) {
      // selected minimum hour, limit minute range
      minMinute = _minTime.minute;
    }
    if (maxHour == currHour) {
      // selected maximum hour, limit minute range
      maxMinute = _maxTime.minute;
    }
    return [minMinute, maxMinute];
  }

  /// calculate the range of second
  List<int> _calcSecondRange({currHour, currMinute}) {
    int minSecond = 0, maxSecond = 59;
    int minHour = _minTime.hour;
    int maxHour = _maxTime.hour;
    int minMinute = _minTime.minute;
    int maxMinute = _maxTime.minute;

    currHour ??= _currHour;
    currMinute ??= _currMinute;

    if (minHour == currHour && minMinute == currMinute) {
      // selected minimum hour and minute, limit second range
      minSecond = _minTime.second;
    }
    if (maxHour == currHour && maxMinute == currMinute) {
      // selected maximum hour and minute, limit second range
      maxSecond = _maxTime.second;
    }
    return [minSecond, maxSecond];
  }
}
import 'package:journal/components/bruno/src/theme/brn_theme_configurator.dart';
import 'package:journal/components/bruno/src/utils/css/brn_util.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:xml/xml_events.dart' as xml;

/// 超链接的点击回调
typedef BrnHyperLinkCallback = void Function(String text, String? url);

/// 用于将 HTML 标签转为 style
class BrnConvert {
  /// [cssContent] 带有html 标签文本
  /// [linkCallBack] 超链接的点击回调
  /// [defaultStyle] 外部传入的默认文本样式
  BrnConvert(
    String cssContent, {
    BrnHyperLinkCallback? linkCallBack,
    TextStyle? defaultStyle,
  }) {
    _eventList = xml.parseEvents(cssContent);
    _linkCallBack = linkCallBack;
    _defaultStyle = defaultStyle;
  }

  /// 超链接的点击回调
  BrnHyperLinkCallback? _linkCallBack;

  /// 外部传入的默认文本样式
  TextStyle? _defaultStyle;

  /// 标签的集合
  Iterable<xml.XmlEvent> _eventList = [];

  /// 标签对应的style
  List<_Tag> stack = [];

  /// 转换的思路：将 开始标签 的属性转为 合适的style, 并将其存入集合中
  ///             a开始标签支持的属性：href
  ///           文本标签 去获取style集合的最后一个元素 并应用style样式
  ///           结束标签 则将集合的最后一个元素删除
  List<TextSpan> convert() {
    // 优先使用外部提供的样式
    final TextStyle style = _defaultStyle ??
        TextStyle(
          fontSize: 14,
          decoration: TextDecoration.none,
          fontWeight: FontWeight.normal,
          color: BrnThemeConfigurator.instance
              .getConfig()
              .commonConfig
              .colorTextImportant,
        );

    final List<TextSpan> spans = [];
    for (var xmlEvent in _eventList) {
      if (xmlEvent is xml.XmlStartElementEvent) {
        if (!xmlEvent.isSelfClosing) {
          final _Tag tag = _Tag();
          TextStyle textStyle = style.copyWith();
          if (xmlEvent.name == 'font') {
            for (var attr in xmlEvent.attributes) {
              switch (attr.name) {
                case 'color':
                  te


To(number) <= 0 && number.compareTo(upper) < 0)
				result = result.add(countWays(number.subtract(pow), exponent, repetitions - 1));
		}
		ways.put(key, result);
		return result;
	}

}
/*
 * Library classes for GIF optimizer (Java)
 *
 * Copyright (c) 2018 Project Nayuki
 * All rights reserved. Contact Nayuki for licensing.
 * https://www.nayuki.io/page/gif-optimizer-java
 */

import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Objects;

/*
 * An input stream that converts GIF's subblock format to a plain byte stream.
 * This converter returns EOF after a zero-length subblock is encountered.
 */
final class SubblockInputStream extends InputStream {

	/*---- Fields ----*/

	private InputStream input;  // Underlying stream

	// -2 = stream ended correctly
	// -1 = unexpected EOF
	// 0 = need to read new block
	// 1 to 255 = bytes remaining
	private int bytesRemain;

	/*---- Constructors ----*/

	public SubblockInputStream(InputStream in) {
		input = Objects.requireNonNull(in);
		bytesRemain = 0;
	}

	/*---- Methods ----*/

	// Returns the next unsigned byte value in the stream, or -1 if the sequence of subblocks has ended.
	public int read() throws IOException {
		while (bytesRemain <= 0) {
			switch (bytesRemain) {
				case 0:  // Previous subblock ended, so read new one
					bytesRemain = input.read();
					if (bytesRemain == 0)
						bytesRemain = -2;
					break;
				case -1:
					throw new EOFException();
				case -2:
					return -1;  // Normal EOF
			}
		}

		int result = input.read();
		if (result == -1) {
			bytesRemain = -1;
			throw new EOFException();
		}
		bytesRemain--;
		return result;
	}

	public InputStream detach() {
		if (bytesRemain != -2 || input == null)
			throw new IllegalStateException();
		InputStream result = input;
		input = null;
		return result;
	}

}
/*
 * Library classes for GIF optimizer (Java)
 *
 * Copyright (c) 2018 Project Nayuki
 * All rights reserved. Contact Nayuki for licensing.
 * https://www.nayuki.io/page/gif-optimizer-java
 */

import java.io.IOException;
import java.util.Arrays;
import java.util.Objects;

/*
 * Compresses a byte array into GIF's dialect of LZW-encoded data, without making subblocks.
 * Multiple compressor functions are provided, with different time/space trade-offs.
 * The output from every compressor must decompress to the same data.
 */
final class GifLzwCompressor {

	/*---- Uncompressed encoder ----*/

	/*
	 * Compresses the given byte array to the given bit output stream using an "uncompressed" strategy.
	 * The compressor only emits codes for literals, never codes for newly added dictionary entries.
	 * The compressor emits dictionary-clear codes periodically to maintain a constant code bit width.
	 * The output length depends on the data length and code bits, but not the data values themselves.
	 */
	public static void encodeUncompressed(byte[] data, int codeSize, BitOutputStream out) throws IOException {
		// Check arguments
		Objects.requireNonNull(data);
		if (codeSize < 2 || codeSize > 8)
			throw new IllegalArgumentException();
		Objects.requireNonNull(out);

		// Compute numbers
		final int alphabetSize = 1 << codeSize;
		final int clearCode = alphabetSize;
		final int stopCode = clearCode + 1;
		codeSize++;  // Accommodate Clear and Stop symbols

		// Start encoding data
		out.writeBits(clearCode, cod


3549.1.5.10"),
    PBEWithSHA1AndRC2("1.2.840.113549.1.5.11"),
    PBKDF2WithHmacSHA1("1.2.840.113549.1.5.12"),
    PBES2("1.2.840.113549.1.5.13"),

    // PKCS7 1.2.840.113549.1.7.*
    PKCS7("1.2.840.113549.1.7"),
    Data("1.2.840.113549.1.7.1"),
    SignedData("1.2.840.113549.1.7.2"),
    JDK_OLD_Data("1.2.840.1113549.1.7.1"), // extra 1 in 4th component
    JDK_OLD_SignedData("1.2.840.1113549.1.7.2"),
    EnvelopedData("1.2.840.113549.1.7.3"),
    SignedAndEnvelopedData("1.2.840.113549.1.7.4"),
    DigestedData("1.2.840.113549.1.7.5"),
    EncryptedData("1.2.840.113549.1.7.6"),

    // PKCS9 1.2.840.113549.1.9.*
    EmailAddress("1.2.840.113549.1.9.1"),
    UnstructuredName("1.2.840.113549.1.9.2"),
    ContentType("1.2.840.113549.1.9.3"),
    MessageDigest("1.2.840.113549.1.9.4"),
    SigningTime("1.2.840.113549.1.9.5"),
    CounterSignature("1.2.840.113549.1.9.6"),
    ChallengePassword("1.2.840.113549.1.9.7"),
    UnstructuredAddress("1.2.840.113549.1.9.8"),
    ExtendedCertificateAttributes("1.2.840.113549.1.9.9"),
    IssuerAndSerialNumber("1.2.840.113549.1.9.10"),
    ExtensionRequest("1.2.840.113549.1.9.14"),
    SMIMECapability("1.2.840.113549.1.9.15"),
    TimeStampTokenInfo("1.2.840.113549.1.9.16.1.4"),
    SigningCertificate("1.2.840.113549.1.9.16.2.12"),
    SignatureTimestampToken("1.2.840.113549.1.9.16.2.14"),
    CHACHA20_POLY1305("1.2.840.113549.1.9.16.3.18", "CHACHA20-POLY1305"),
    FriendlyName("1.2.840.113549.1.9.20"),
    LocalKeyID("1.2.840.113549.1.9.21"),
    CertTypeX509("1.2.840.113549.1.9.22.1"),

    // PKCS12 1.2.840.113549.1.12.*
    PBEWithSHA1AndRC4_128("1.2.840.113549.1.12.1.1"),
    PBEWithSHA1AndRC4_40("1.2.840.113549.1.12.1.2"),
    PBEWithSHA1AndDESede("1.2.840.113549.1.12.1.3"),
    PBEWithSHA1AndRC2_128("1.2.840.113549.1.12.1.5"),
    PBEWithSHA1AndRC


  }

  @override
  Future<DashboardLayout?> read({String? id, int index = -1}) async {
    talker.info('[DashboardLayoutHiveRepository] Reading dashboard layout with uuid $id or index $index');
    assert(id != null || index >= 0, 'Either provide an uuid or an index >= 0');
    if (id != null) {
      return _box.get(id);
    } else {
      return _box.getAt(index);
    }
  }

  @override
  Future<void> update(DashboardLayout entity) async {
    talker.info('[DashboardLayoutHiveRepository] Updating dashboard layout with uuid ${entity.uuid}');
    if (!_box.containsKey(entity.uuid)) {
      throw MobilerakerException('DashboardLayout with uuid ${entity.uuid} does not exist! Please use create instead.');
    }
    await _box.put(entity.uuid, entity);
  }
}
/*
 * Copyright (c) 2023-2025. Patrick Schmidt.
 * All rights reserved.
 */
enum ConfigFileObjectIdentifiers {
  bed_mesh(null),
  bed_screws(null),
  configfile(null),
  controller_fan(null),
  display_status(null),
  dotstar(null),
  exclude_object(null),
  extruder(r'^extruder(\d*)$'),
  fan(null),
  fan_generic(null),
  filament_motion_sensor(null),
  filament_switch_sensor(null),
  firmware_retraction(null),
  gcode_macro(null),
  gcode_move(null),
  heater_bed(null),
  heater_fan(null),
  heater_generic(null),
  led(null),
  manual_probe(null),
  motion_report(null),
  neopixel(null),
  output_pin(null),
  pwm_tool(null),
  pca9533(null),
  pca9632(null),
  print_stats(null),
  printer(null),
  screws_tilt_adjust(null),
  stepper(null),
  temperature_fan(null),
  temperature_sensor(null),
  toolhead(null),
  virtual_sdcard(null),
  z_thermal_adjust(null),
  beacon(null),
  beacon_model(null),
  ;

  /// IF it is possible to check a object with a == (null) or startsWith (true)
  final String? regex;

  const ConfigFileObjectIdentifiers(this.regex);

  bool get isHeater => {
        ConfigFileObjectIdentifiers.extruder,
        ConfigFileObjectIdentifiers.heater_generic,
        ConfigFileObjectIdentifiers.heater_bed
      }.contains(this);

  static ConfigFileObjectIdentifiers? tryParse(String value) {
    for (final objectIdentifier in ConfigFileObjectIdentifiers.values) {
      if (objectIdentifier.regex != null) {
        if (RegExp(objectIdentifier.regex!).hasMatch(value)) return objectIdentifier;
      } else {
        if (value == objectIdentifier.name) return objectIdentifier;
      }
    }
    return null;
  }
}
/*
 * Copyright (c) 2024-2025. Patrick Schmidt.
 * All rights reserved.
 */

import 'package:freezed_annotation/freezed_annotation.dart';

part 'config_screw.freezed.dart';
part 'config_screw.g.dart';

/// Models a "screw" that is part of a configuration.
/// This can be a bed screw or an actual screw.
@freezed
class ConfigScrew with _$ConfigScrew {
  const ConfigScrew._();

  const factory ConfigScrew({
    // NOTE THE INDEX is 1-based (1, 2, 3, ...)
    required int index,
    re


id":362,"properties":{"Code":"NOAT","Name":"Noatak National Preserve"},"geometry":{"type":"Point","coordinates":[-161.1594590060686,68.09280652513834]}},{"type":"Feature","id":363,"properties":{"Code":"WRST","Name":"Wrangell - St Elias National Park & Preserve"},"geometry":{"type":"Point","coordinates":[-142.60357111369407,61.41843937955613]}},{"type":"Feature","id":364,"properties":{"Code":"YUCH","Name":"Yukon - Charley Rivers National Preserve"},"geometry":{"type":"Point","coordinates":[-142.79641659169639,65.09350238346386]}},{"type":"Feature","id":365,"properties":{"Code":"APPA","Name":"Appalachian National Scenic Trail"},"geometry":{"type":"Point","coordinates":[-72.7402535097141,43.691650670773555]}},{"type":"Feature","id":366,"properties":{"Code":"MAMC","Name":"Mary McLeod Bethune Council House National Historic Site"},"geometry":{"type":"Point","coordinates":[-77.03098188969467,38.908022591832854]}},{"type":"Feature","id":367,"properties":{"Code":"NACE","Name":"National Capital Parks-East"},"geometry":{"type":"Point","coordinates":[-77.09410104237618,38.67910430710282]}},{"type":"Feature","id":368,"properties":{"Code":"FODU","Name":"Fort Dupont Park"},"geometry":{"type":"Point","coordinates":[-76.94968629399797,38.87819616831813]}},{"type":"Feature","id":369,"properties":{"Code":"FRDO","Name":"Frederick Douglass National Historic Site"},"geometry":{"type":"Point","coordinates":[-76.98510303343785,38.862836277772715]}},{"type":"Feature","id":370,"properties":{"Code":"GWMP","Name":"George Washington Memorial Parkway"},"geometry":{"type":"Point","coordinates":[-77.05361153357251,38.71381953074352]}},{"type":"Feature","id":371,"properties":{"Code":"OXHI","Name":"Oxon Cove Park & Oxon Hill Farm"},"geometry":{"type":"Point","coordinates":[-77.0230745539023,38.79702173265857]}},{"type":"Feature","id":372,"properties":{"Code":"PISC","Name":"Piscataway Park"},"geometry":{"type":"Point","coordinates":[-77.06840167129472,38.68456179269082]}},{"type":"Feature","id":373,"properties":{"Code":"GREE","Name":"Greenbelt Park"},"geometry":{"type":"Point","coordinates":[-76.90602165862857,38.98055126072522]}},{"type":"Feature","id":374,"properties":{"Code":"WHHO","Name":"President\'s Park (White House)"},"geometry":{"type":"Point","coordinates":[-77.03656807555457,38.895430023853166]}},{"type":"Feature","id":375,"properties":{"Code":"KEAQ","Name":"Kenilworth Park & Aquatic Gardens"},"geometry":{"type":"Point","coordinates":[-76.94934274387278,38.912783049344085]}},{"type":"Feature","id":376,"properties":{"Code":"ROCR","Name":"Rock Creek Park"},"geometry":{"type":"Point","coordinates":[-77.04621414691562,38.96262227660261]}},{"type":"Feature","id":377,"properties":{"Code":"MEHI","Name":"Meridian Hill Park"},"geometry":{"type":"Point","coordinates":[-77.0357398248935,38.92108758653459]}},{"type":"Feature","id":378,"properties":{"Code":"OLST","Name":"The Old Stone House"},"geometry":{"type":"Point","coordinates":[-77.06029340095944,38.905699664469374]}},{"type":"Feature","id":379,"properties":{"Code":"LINC","Name":"Lincoln Memorial"},"geometry":{"type":"Point","coordinates":[-77.04448622323585,38.88852231375


MessageIdentifiers.h"
#include "ReadyEvent.h"
#include <assert.h>
#include "Kbhit.h"
#include "RakSleep.h"
#include "SocketLayer.h"
#include "FullyConnectedMesh2.h"
#include "ConnectionGraph2.h"

void PrintConnections();

using namespace RakNet;

RakPeerInterface *rakPeer;
ReadyEvent readyEventPlugin;

// These two plugins are just to automatically create a fully connected mesh so I don't have to call connect more than once
FullyConnectedMesh2 fcm2;
ConnectionGraph2 cg2;

int main(void)
{
	rakPeer=RakPeerInterface::GetInstance();

	printf("This project tests and demonstrates the ready event plugin.\n");
	printf("It is used in a peer to peer environment to have a group of\nsystems signal an event.\n");
	printf("It is useful for changing turns in a turn based game,\nor for lobby systems where everyone has to set ready before the game starts\n");
	printf("Difficulty: Beginner\n\n");

	rakPeer->AttachPlugin(&readyEventPlugin);
	rakPeer->AttachPlugin(&fcm2);
	rakPeer->AttachPlugin(&cg2);
	rakPeer->SetMaximumIncomingConnections(8);

	fcm2.SetAutoparticipateConnections(true);
	fcm2.SetConnectOnNewRemoteConnection(true, "");
	cg2.SetAutoProcessNewConnections(true);

	// Initialize the peers
	SocketDescriptor sd(60000,0);
	while (IRNS2_Berkley::IsPortInUse(sd.port,sd.hostAddress,sd.socketFamily,SOCK_DGRAM)==true)
		sd.port++;
	StartupResult sr = rakPeer->Startup(8, &sd, 1);
	RakAssert(sr==RAKNET_STARTED);
	printf("Started on port %i\n", sd.port);

	// Give the threads time to properly start
	RakSleep(200);

	printf("Peers initialized.\n");

	printf("'C' to connect\n");
	printf("'D' to disconnect\n");
	printf("'S' to signal\n");
	printf("'U' to unsignal\n");
	printf("'F' to force all systems to be completed (cannot be unset)\n");
	printf("'Q' to quit\n");
	printf("' ' to print wait status\n");

	char str[128];
	char ch=0;
	while (1)
	{
		if (kbhit())
			ch=getch();

		if (ch=='s' || ch=='S')
		{
			ch=0;
			if (readyEventPlugin.SetEvent(0,true))
				printf("This system is signaled\n");
			else
				printf("This system is signaled FAILED\n");
		}
		if (ch=='u' || ch=='U')
		{
			ch=0;
			if (readyEventPlugin.SetEvent(0,false))
				printf("This system is unsignaled\n");
			else
				printf("This system is unsignaled FAILED\n");
		}
		if (ch=='c' || ch=='C')
		{
			ch=0;
			printf("Which IP? (Press enter for 127.0.0.1)");
			gets(str);
			if (str[0]==0)
				strcpy(str, "127.0.0.1");
			char port[64];
			printf("Which port? (Press enter for 60000)");
			gets(port);
			if (port[0]==0)
				strcpy(port, "60000");
			ConnectionAttemptResult car = rakPeer->Connect(str, atoi(port), 0, 0, 0);
			RakAssert(car==CONNECTION_ATTEMPT_STARTED);
			printf("Connecting.\n");
		}
		if (ch=='d' || ch=='D')
		{
			ch=0;
			rakPeer->Shutdown(100,0);
			sr = rakPeer->Startup(8, &sd,


 = new NCompress::NLZMA::CEncoder;
  CMyComPtr<ICompressCoder> encoder = encoderSpec;

  PROPID propIDs[] =
  {
    NCoderPropID::kAlgorithm,
    NCoderPropID::kDictionarySize,
    NCoderPropID::kNumFastBytes,
  };
  const int kNumProps = sizeof(propIDs) / sizeof(propIDs[0]);
  PROPVARIANT properties[kNumProps];
  properties[0].vt = VT_UI4;
  properties[1].vt = VT_UI4;
  properties[2].vt = VT_UI4;
  properties[0].ulVal = (UInt32)2;
  properties[1].ulVal = (UInt32)dictionarySize;
  properties[2].ulVal = (UInt32)64;

  if (encoderSpec->SetCoderProperties(propIDs, properties, kNumProps) != S_OK)
    return 1;

  COutStreamRam *outStreamSpec = new COutStreamRam;
  if (outStreamSpec == 0)
    return SZE_OUTOFMEMORY;
  CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
  CInStreamRam *inStreamSpec = new CInStreamRam;
  if (inStreamSpec == 0)
    return SZE_OUTOFMEMORY;
  CMyComPtr<ISequentialInStream> inStream = inStreamSpec;

  outStreamSpec->Init(outBuffer, outSize);
  if (outStreamSpec->WriteByte(0) != S_OK)
    return SZE_OUT_OVERFLOW;

  if (encoderSpec->WriteCoderProperties(outStream) != S_OK)
    return SZE_OUT_OVERFLOW;
  if (outStreamSpec->Pos != kIdSize + kLzmaPropsSize)
    return 1;

  int i;
  for (i = 0; i < 8; i++)
  {
    UInt64 t = (UInt64)(inSize);
    if (outStreamSpec->WriteByte((Byte)((t) >> (8 * i))) != S_OK)
      return SZE_OUT_OVERFLOW;
  }

  Byte *filteredStream = 0;

  bool useFilter = (filterMode != SZ_FILTER_NO);
  if (useFilter)
  {
    if (inSize != 0)
    {
      filteredStream = (Byte *)MyAlloc(inSize);
      if (filteredStream == 0)
        return SZE_OUTOFMEMORY;
      memmove(filteredStream, inBuffer, inSize);
    }
    UInt32 _prevMask;
    UInt32 _prevPos;
    x86_Convert_Init(_prevMask, _prevPos);
    x86_Convert(filteredStream, (UInt32)inSize, 0, &_prevMask, &_prevPos, 1);
  }

  UInt32 minSize = 0;
  int numPasses = (filterMode == SZ_FILTER_AUTO) ? 3 : 1;
  bool bestIsFiltered = false;
  int mainResult = 0;
  size_t startPos = outStreamSpec->Pos;
  for (i = 0; i < numPasses; i++)
  {
    if (numPasses > 1 && i == numPasses - 1 && !bestIsFiltered)
      break;
    outStreamSpec->SetPos(startPos);
    bool curModeIsFiltered = false;
    if (useFilter && i == 0)
      curModeIsFiltered = true;
    if (numPasses > 1 && i == numPasses - 1)
      curModeIsFiltered = true;

    inStreamSpec->Init(curModeIsFiltered ? filteredStream : inBuffer, inSize);

    HRESULT lzmaResult = encoder->Code(inStream, outStream, 0, 0, 0);

    mainResult = 0;
    if (lzmaResult == E_OUTOFMEMORY)
    {
      mainResult = SZE_OUTOFMEMORY;
      break;
    }
    if (i == 0 || outStreamSpec->Pos <= minSize)
    {


us-java-transport-junixsocket","path":"dbus-java-transport-junixsocket","contentType":"directory"},{"name":"dbus-java-transport-native-unixsocket","path":"dbus-java-transport-native-unixsocket","contentType":"directory"},{"name":"dbus-java-transport-tcp","path":"dbus-java-transport-tcp","contentType":"directory"},{"name":"dbus-java-utils","path":"dbus-java-utils","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"src","path":"src","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"pom.xml","path":"pom.xml","contentType":"file"}],"totalCount":17}},"fileTreeProcessingTime":2.059724,"foldersToFetch":[],"repo":{"id":80993243,"defaultBranch":"master","name":"dbus-java","ownerLogin":"hypfvieh","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2017-02-05T13:04:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/4946099?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1709649242.0","canEdit":false,"refType":"branch","currentOid":"cb77cfc872eefbfb9a08109be1942c8339220a89"},"path":"LICENSE","currentUser":null,"blob":{"rawLines":["MIT License","","Copyright (c) 2005-2006 Matthew Johnson","Copyright (c) 2017-2021 David M.","","Permission is hereby granted, free of charge, to any person obtaining a copy","of this software and associated documentation files (the \"Software\"), to deal","in the Software without restriction, including without limitation the rights","to use, copy, modify, merge, publish, distribute, sublicense, and/or sell","copies of the Software, and to permit persons to whom the Software is","furnished to do so, subject to the following conditions:","","The above copyright notice and this permission notice shall be included in all","copies or substantial portions of the Software.","","THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR","IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,","FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE","AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER","LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,","OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE","SOFTWARE."],"stylingDirectives":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/hypfvieh/dbus-java/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"LICENSE","displayUrl":"https://github.com/hypfvieh/dbus-java/blob/master/LICENSE?raw=true","headerInfo":{"blobSize":"1.08 KB","deleteTooltip":"You must be signed in


amily: fontName),
      bodyText2: base.bodyText2?.copyWith(fontFamily: fontName),
      subtitle1: base.subtitle1?.copyWith(fontFamily: fontName),
      subtitle2: base.subtitle2?.copyWith(fontFamily: fontName),
      overline: base.overline?.copyWith(fontFamily: fontName),
    );
  }

  static ThemeData buildLightTheme() {
    final Color primaryColor = HexColor('#54D3C2');
    final Color secondaryColor = HexColor('#54D3C2');
    final ColorScheme colorScheme = const ColorScheme.light().copyWith(
      primary: primaryColor,
      secondary: secondaryColor,
    );
    final ThemeData base = ThemeData.light();
    return base.copyWith(
      colorScheme: colorScheme,
      primaryColor: primaryColor,
      indicatorColor: Colors.white,
      splashColor: Colors.white24,
      splashFactory: InkRipple.splashFactory,
      canvasColor: Colors.white,
      backgroundColor: const Color(0xFFFFFFFF),
      scaffoldBackgroundColor: const Color(0xFFF6F6F6),
      errorColor: const Color(0xFFB00020),
      buttonTheme: ButtonThemeData(
        colorScheme: colorScheme,
        textTheme: ButtonTextTheme.primary,
      ),
      textTheme: _buildTextTheme(base.textTheme),
      primaryTextTheme: _buildTextTheme(base.primaryTextTheme),
      platform: TargetPlatform.iOS,
    );
  }
}

class HexColor extends Color {
  HexColor(final String hexColor) : super(_getColorFromHex(hexColor));

  static int _getColorFromHex(String hexColor) {
    hexColor = hexColor.toUpperCase().replaceAll('#', '');
    if (hexColor.length == 6) {
      hexColor = 'FF' + hexColor;
    }
    return int.parse(hexColor, radix: 16);
  }
}
import 'package:equatable/equatable.dart';
import 'package:flutter/cupertino.dart';
import 'package:piggy_flutter/models/models.dart';

abstract class RecentTransactionsState extends Equatable {
  final GetTransactionsInput? filters;

  const RecentTransactionsState(this.filters);
  @override
  List<Object?> get props => [filters];
}

class RecentTransactionsEmpty extends RecentTransactionsState {
  RecentTransactionsEmpty(GetTransactionsInput? filters) : super(filters);
}

class RecentTransactionsLoading extends RecentTransactionsState {
  RecentTransactionsLoading(GetTransactionsInput? filters) : super(filters);
}

class RecentTransactionsLoaded extends RecentTransactionsState {
  final TransactionsResult allTransactions;
  final TransactionsResult filteredTransactions;
  final String latestTransactionDate;
  final GetTransactionsInput? filters;

  RecentTransactionsLoaded(
      {required this.allTransactions,
      required this.filteredTransactions,
      required this.latestTransactionDate,
      required this.filters})
      : super(filters);

  @override
  List<Object?> get props => [allTransactions, filteredTransactions, filters];
}

class RecentTransactionsError extends RecentTransactionsState {
  RecentTransactionsError(GetTransactionsInput? filters) : super(filters);
}
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:piggy_flutter/intro_views/Constants/constants.dart';
import 'package:piggy_flutter/intro_views/Models/slide_update_model.dart';

/// This class is used to get user gesture and work according to it.

class PageDragger extends StatefulWidget {
  //These bool variables are used to check whether user can drag left or right or none.


e;
	__le64 EndOfFile;
	__le64 AllocationSize;
	__le32 DosAttributes;
	__le64 Inode;
	__le32 DeviceId;
	__le32 Zero;
	/* beginning of POSIX Create Context Response */
	__le32 HardLinks;
	__le32 ReparseTag;
	__le32 Mode;
	u8     Sids[];
	/*
	 * var sized owner SID
	 * var sized group SID
	 * le32 filenamelength
	 * u8  filename[]
	 */
} __packed;

/* File System Information Classes */
#define FS_VOLUME_INFORMATION		1 /* Query */
#define FS_LABEL_INFORMATION		2 /* Set */
#define FS_SIZE_INFORMATION		3 /* Query */
#define FS_DEVICE_INFORMATION		4 /* Query */
#define FS_ATTRIBUTE_INFORMATION	5 /* Query */
#define FS_CONTROL_INFORMATION		6 /* Query, Set */
#define FS_FULL_SIZE_INFORMATION	7 /* Query */
#define FS_OBJECT_ID_INFORMATION	8 /* Query, Set */
#define FS_DRIVER_PATH_INFORMATION	9 /* Query */
#define FS_SECTOR_SIZE_INFORMATION	11 /* SMB3 or later. Query */
#define FS_POSIX_INFORMATION		100 /* SMB3.1.1 POSIX. Query */

struct smb2_fs_full_size_info {
	__le64 TotalAllocationUnits;
	__le64 CallerAvailableAllocationUnits;
	__le64 ActualAvailableAllocationUnits;
	__le32 SectorsPerAllocationUnit;
	__le32 BytesPerSector;
} __packed;

#define SSINFO_FLAGS_ALIGNED_DEVICE		0x00000001
#define SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE 0x00000002
#define SSINFO_FLAGS_NO_SEEK_PENALTY		0x00000004
#define SSINFO_FLAGS_TRIM_ENABLED		0x00000008

/* sector size info struct */
struct smb3_fs_ss_info {
	__le32 LogicalBytesPerSector;
	__le32 PhysicalBytesPerSectorForAtomicity;
	__le32 PhysicalBytesPerSectorForPerf;
	__le32 FSEffPhysicalBytesPerSectorForAtomicity;
	__le32 Flags;
	__le32 ByteOffsetForSectorAlignment;
	__le32 ByteOffsetForPartitionAlignment;
} __packed;

/* File System Control Information */
struct smb2_fs_control_info {
	__le64 FreeSpaceStartFiltering;
	__le64 FreeSpaceThreshold;
	__le64 FreeSpaceStopFiltering;
	__le64 DefaultQuotaThreshold;
	__le64 DefaultQuotaLimit;
	__le32 FileSystemControlFlags;
	__le32 Padding;
} __packed;

/* volume info struct - see MS-FSCC 2.5.9 */
#define MAX_VOL_LABEL_LEN	32
struct smb3_fs_vol_info {
	__le64	VolumeCreationTime;
	__u32	VolumeSerialNumber;
	__le32	VolumeLabelLength; /* includes trailing null */
	__u8	SupportsObjects; /* True if eg like NTFS, supports objects */
	__u8	Reserved;
	__u8	VolumeLabel[]; /* variable len */
} __packed;

/* See MS-SMB2 2.2.23 through 2.2.25 */
struct smb2_oplock_break {
	struct smb2_hdr hdr;
	__le16 StructureSize; /* Must be 24 */
	__u8   OplockLevel;
	__u8   Reserved;
	__le32 Reserved2;
	__u64  PersistentFid;
	__u64  VolatileFid;
} __packed;

#define SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED cpu_to_le32(0x01)

struct smb2_lease_break {
	struct smb2_hdr hdr;
	__le16 StructureSize; /* Must be 44 */
	__le16 Epoch;
	__le32 Flags;
	__u8   LeaseKey[16];
	__le32 CurrentLeaseState;
	__le32 NewLeaseState;
	__le32 BreakReason;
	__le32 AccessMaskHint;
	__le32 ShareMaskHint;
} __packed;

struct smb2_lease_ack {
	struct smb2_hdr hdr;
	__le16 StructureSize; /* Must be 36 */
	__le16 Reserved;
	__le32 Flags;
	__u8   LeaseKey[16];
	__le32 LeaseState;
	__le64 LeaseDuration;
} __packed;

#define OP_BREAK_STRUCT_SIZE_20		24
#define OP_BREAK_STRUCT_SIZE_21		36
#endif				/* _COMMON_SMB2PDU_H */


ave d6/d7/a0/a1
	jsr transfo_obs(pc)
	load d6/d7/a0/a1

	move.w d0,d4
	move.w d1,d5
	muls #ptf/180,d0
	muls #ptf/120,d1
	lea flags_test,a3
	move.w d2,d3
	neg.w d3
	cmp.w #100,d2		* plan avant
	ble.s objet_derriere
	cmp.w d3,d0		* IF -ze<=xe*ptf/175
	sge (a3)
	cmp.w d2,d0		* AND xe<=ze
	sle 1(a3)
	cmp.w d3,d1		* AND -ze<=ye
	sge 2(a3)
	cmp.w d2,d1		* AND ye<=ze
	sle 3(a3)
	cmp.w #1100,d2		* plan arriere
	sle 4(a3)
	cmp.w #100,d2		* plan avant
	sge 5(a3)

	moveq #6-1,d5
	moveq #-1,d0
tst_condi:	and.b (a3)+,d0
	dbf d5,tst_condi

	tst.b d0
	bne.s obj_visible

obj_pas_v:	add.w #2*4,a1		; objet suivant
	dbf d7,test_objet
	move.w d6,nb_obj_visi
	rts
obj_visible:	move.w d2,(a0)+
	move.l a1,(a0)+	; adresse de l'objet
	add.w #1,d6
	add.w #2*4,a1		; objet suivant
	dbf d7,test_objet
	move.w d6,nb_obj_visi
	rts
objet_derriere:cmp.w #100,d0
	sge (a3)
	cmp.w #-100,d0
	sle 1(a3)
	cmp.w #100,d1
	sge 2(a3)
	cmp.w #-100,d1
	sle 3(a3)

	move.w #4-1,d5
	moveq #-1,d0
tst_condi2:	and.b (a3)+,d0
	dbf d5,tst_condi2
	tst.b d0
	bne.s obj_visible
	bra.s obj_pas_v

*********** Mouvement de l'observateur ****
mouvement_observateur:		; MOUSE
	jsr deplacement(pc)	; deplacement de l'observateur
	jsr deplacement_mouse(pc)

	lea vis_x,a1		; deplacement sur axe ?
	lea flags_test,a2
	tst.w (a1)+
	sne (a2)
	tst.w (a1)+
	sne 1(a2)
	tst.w (a1)+
	sne 2(a2)

	moveq #0,d0
	move.b (a2),d0
	or.b 1(a2),d0
	or.b 2(a2),d0
	tst.w d0
	bne.s deplacement_visu

fin_depl_obs:	lea mat_obs,a0
	lea obs_a,a1
	movem.l (a1),d0-d2	; alpha,beta,gamma
	add.l d0,d0
	add.l d1,d1
	add.l d2,d2
	swap d0
	swap d1
	swap d2

	jsr calcul_matrice(pc)	; matrice


}
    RemoteServer &operator<<(int payload) { send(payload); return *this; }
    RemoteServer &operator<<(long payload) { send(payload); return *this; }
    RemoteServer &operator<<(std::stringstream &payload) { send(payload); return *this; }

    // Processes a package
    void process(const string &payload) throws;

private:

    // Reports an error to the GUI
    void handleError(const char *description);

    //
    // Subclass specific implementations
    //

private:

    virtual string doReceive() throws = 0;
    virtual void doSend(const string &payload) throws = 0;
    virtual void doProcess(const string &payload) throws = 0;

    //
    // Delegation methods
    //

    void didSwitch(SrvState from, SrvState to);
    virtual void didStart() { };
    virtual void didStop() { };
    virtual void didConnect() { };
    virtual void didDisconnect() { };
};

}


(t.slice(r,o),i);n.push(a),r=o}return n}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let i=0;const n=this.ends_,r=this.stride;for(let s=0,o=n.length;s<o;++s){const o=n[s];u(t,Gm(e,i,o,r,.5)),i=o}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=$n(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new Um(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return Sr(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Kn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}}var Xm=Um;class Vm extends kn{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){this.flatCoordinates?u(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()}clone(){const t=new Vm(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<oe(this.getExtent(),t,e))return n;const r=this.flatCoordinates,s=this.stride;for(let o=0,a=r.length;o<a;o+=s){const a=xi(t,e,r[o],r[o+1]);if(a<n){n=a;for(let t=0;t<s;++t)i[t]=r[o+t];i.length=s}}return n}getCoordinates(){return nr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new dr(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,i=this.stride,n=[];for(let r=0,s=t.length;r<s;r+=i){const s=new dr(t.slice(r,r+i),e);n.push(s)}return n}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,i=this.stride;for(let n=0,r=e.length;n<r;n+=i){if(he(t,e[n],e[n+1]))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Yn(this.flatCoordinates,0,t,this.stride),this.changed()}}var Wm=Vm;function Zm(t,e,i,n){const r=[];let s=[1/0,1/0,-1/0,-1/0];for(let o=0,a=i.length;o<a;++o){const a=i[o];s=pe(t,e,a[0],n),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=a[a.length-1]}return r}class Ym extends kn{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevisi