/*	$NetBSD: ata_raid.c,v 1.36 2015/08/20 14:40:17 christos Exp $	*/

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

/*
 * Support for autoconfiguration of RAID sets on ATA RAID controllers.
 */

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.36 2015/08/20 14:40:17 christos Exp $");

#include <sys/param.h>
#include <sys/buf.h>
#include <sys/bufq.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/disk.h>
#include <sys/disklabel.h>
#include <sys/fcntl.h>
#include <sys/malloc.h>
#include <sys/vnode.h>
#include <sys/proc.h>

#include <miscfs/specfs/specdev.h>

#include <dev/ata/atareg.h>
#include <dev/ata/atavar.h>
#include <dev/ata/wdvar.h>

#include <dev/ata/ata_raidreg.h>
#include <dev/ata/ata_raidvar.h>

#include "locators.h"
#include "ioconf.h"

#ifdef ATA_RAID_DEBUG
#define	DPRINTF(x)	printf x
#else
#define	DPRINTF(x)	/* nothing */
#endif

static int	ataraid_match(device_t, cfdata_t, void *);
static void	ataraid_attach(device_t, device_t, void *);
static int	ataraid_print(void *, const char *);

static int	ata_raid_finalize(device_t);

ataraid_array_info_list_t ataraid_array_info_list =
    TAILQ_HEAD_INITIALIZER(ataraid_array_info_list);
u_int ataraid_array_info_count;

CFATTACH_DECL_NEW(ataraid, 0,
    ataraid_match, ataraid_attach, NULL, NULL);

/*
 * ataraidattach:
 *
 *	Pseudo-device attach routine.
 */
void
ataraidattach(int count)
{

	/*
	 * Register a finalizer which will be used to actually configure
	 * the logical disks configured by ataraid.
	 */
	if (config_finalize_register(NULL, ata_raid_finalize) != 0)
		printf("WARNING: unable to register ATA RAID finalizer\n");
}

/*
 * ata_raid_type_name:
 *
 *	Return the type of ATA RAID.
 */
const char *
ata_raid_type_name(u_int type)
{
	static const char *ata_raid_type_names[] = {
		"Promise",
		"Adaptec",
		"VIA V-RAID",
		"nVidia",
		"JMicron",
		"Intel MatrixRAID"
	};

	if (type < __arraycount(ata_raid_type_names))
		return (ata_raid_type_names[type]);

	return (NULL);
}

/*
 * ata_raid_finalize:
 *
 *	Autoconfiguration finalizer for ATA RAID.
 */
static int
ata_raid_finalize(device_t self)
{
	static struct cfdata ataraid_cfdata = {
		.cf_name = "ataraid",
		.cf_atname = "ataraid",
		.cf_unit = 0,
		.cf_fstate = FSTATE_STAR,
	};
	extern struct cfdriver ataraid_cd;
	static int done_once;
	int error;

	/*
	 * Since we only handle real hardware, we only need to be
	 * called once.
	 */
	if (done_once)
		return (0);
	done_once = 1;

	if (TAILQ_EMPTY(&ataraid_array_info_list))
		goto out;

	error = config_cfattach_attach(ataraid_cd.cd_name, &ataraid_ca);
	if (error) {
		printf("%s: unable to register cfattach, error = %d\n",
		    ataraid_cd.cd_name, error);
		(void) config_cfdriver_detach(&ataraid_cd);
		goto out;
	}


span>(self, n: int, include_omission_info: bool = True, item_type: str = None) ‑> list

Retrieves the first n values from memory.

Args

n : int

The number of values to retrieve.

include_omission_info : bool

Whether to include an information message when some values are omitted.

item_type : str, optional

If provided, only retrieve memories of this type.

Expand source code

def retrieve_first(self, n: int, include_omission_info:bool=True, item_type:str=None) -> list:
    """
    Retrieves the first n values from memory.

    Args:
        n (int): The number of values to retrieve.
        include_omission_info (bool): Whether to include an information message when some values are omitted.
        item_type (str, optional): If provided, only retrieve memories of this type.
    """
    omisssion_info = [EpisodicMemory.MEMORY_BLOCK_OMISSION_INFO] if include_omission_info else []

    memories = self._memory_with_current_buffer() if item_type is None else self.filter_by_item_type(self._memory_with_current_buffer(), item_type)
    return memories[:n] + omisssion_info

def retrieve_last(self, n: int = None, include_omission_info: bool = True, item_type: str = None) ‑> list

Retrieves the last n values from memory.

Args

n : int

The number of values to retrieve, or None to retrieve all values.

include_omission_info : bool

Whether to include an information message when some values are omitted.

item_type : str, optional

If provided, only retrieve memories of this type.

Expand source code

def retrieve_last(self, n: int=None, include_omission_info:bool=True, item_type:str=None) -> list:
    """
    Retrieves the last n values from memory.

    Args:
        n (int): The number of values to retrieve, or None to retrieve all values.
        include_omission_info (bool): Whether to include an information message when some values are omitted.
        item_type (str, optional): If provided, only retrieve memories of this type.
    """
    omisssion_info = [EpisodicMemory.MEMORY_BLOCK_OMISSION_INFO] if include_omission_info else []

    memories = self._memory_with_current_buffer()


:::::::::::::::> [start] F_KleptoEscaped()")
    PedStop(pedKlepto.id)
    PedClearObjectives(pedKlepto.id)
    BlipRemoveFromChar(pedKlepto.id)
    F_PedSetDropItem(pedKlepto.id, 362, 100, 1)
    PedFlee(pedKlepto.id, gPlayer)
    PedMakeAmbient(pedKlepto.id)
    if VehicleIsValid(vehicleKleptoBike.id) then
        VehicleMakeAmbient(vehicleKleptoBike.id)
    end
    if VehicleIsValid(vehiclePlayerBike.id) then
        VehicleMakeAmbient(vehiclePlayerBike.id)
    end
    --print("()xxxxx[:::::::::::::::> [finish] F_KleptoEscaped()")
end

function F_CheckKleptoDistance()
    gPlayerX, gPlayerY = PedGetPosXYZ(gPlayer)
    gKleptoX, gKleptoY = PedGetPosXYZ(pedKlepto.id)
    gDistanceBetween = DistanceBetweenCoords2d(gPlayerX, gPlayerY, gKleptoX, gKleptoY)
    if gDistanceBetween >= gFailRange then
        return 2
    elseif gDistanceBetween >= gWarningRange then
        return 1
    end
    return 0
end

function F_CheckKleptoMusicDistance()
    gMusicPlayerX, gMusicPlayerY = PedGetPosXYZ(gPlayer)
    gMusicKleptoX, gMusicKleptoY = PedGetPosXYZ(pedKlepto.id)
    gMusicDistance = DistanceBetweenCoords2d(gMusicPlayerX, gMusicPlayerY, gMusicKleptoX, gMusicKleptoY)
    if gMusicDistance >= gMusicRange then
        return 1
    end
    return 0
end

function F_WaitForSpeech(pedID)
    --print("()xxxxx[:::::::::::::::> [start] F_WaitForSpeech()")
    if pedID == nil then
        while SoundSpeechPlaying() do
            Wait(0)
        end
    else
        while SoundSpeechPlaying(pedID) do
            Wait(0)
        end
    end
    --print("()xxxxx[:::::::::::::::> [finish] F_WaitForSpeech()")
end

function F_MissionCriticalShopKeeper()
    if pedStoreOwner.id and PedIsValid(pedStoreOwner.id) then
        PedSetInvulnerable(pedStoreOwner.id, false)
        PedSetFlag(pedStoreOwner.id, 113, false)
        PedSetStationary(pedStoreOwner.id, false)
        PedIgnoreStimuli(pedStoreOwner.id, false)
        PedMakeAmbient(pedStoreOwner.id)
    end
    --print("()xxxxx[:::::::::::::::> [start] F_MissionCriticalShopKeeper()")
    gMissionFailMessage = 2
    bMissionFailed = true
    --print("()xxxxx[:::::::::::::::> [finish] F_MissionCriticalShopKeeper()")
end

function F_DeleteAllBikes()
    local x, y, z = PlayerGetPosXYZ()
    bikes = VehicleFindInAreaXYZ(x, y, z, 100, false)
    --print("[RAUL] - FINDING BIKES ")
    if not bikes then
        return
    end
    --print("[RAUL] - FOUND BIKES ")
    for _, bike in bikes do
        --print("[RAUL] - OTHER BIKE FOUND")
        VehicleDelete(bike)
    end
end

function T_MonitorKlepto()
    --print("()xxxxx[:::::::::::::::> [start] T_MonitorKlepto()")
    while Miss


ed(__MINGW32__)
#define __aeabi_uldivmod __rt_udiv64
#endif

        .syntax unified
        .p2align 2
DEFINE_COMPILERRT_FUNCTION(__aeabi_uldivmod)
        push	{r11, lr}
        sub	sp, sp, #16
        add	r12, sp, #8
        str	r12, [sp]
#if defined(__MINGW32__)
        mov     r12, r0
        mov     r0, r2
        mov     r2, r12
        mov     r12, r1
        mov     r1, r3
        mov     r3, r12
#endif
        bl	SYMBOL_NAME(__udivmoddi4)
        ldr	r2, [sp, #8]
        ldr	r3, [sp, #12]
        add	sp, sp, #16
        pop	{r11, pc}
END_COMPILERRT_FUNCTION(__aeabi_uldivmod)

NO_EXEC_STACK_DIRECTIVE


rent=self.root)
                    self.show()
        except Exception as ex:
            messagebox.showerror("Error",f"Error due to {str(ex)}")

    def show(self):
        con=con=sqlite3.connect(database="python project.db")
        cur=con.cursor()
        try:
            cur.execute("select * from student")
            rows=cur.fetchall()
            self.c_table.delete(*self.c_table.get_children())
            for row in rows:
                self.c_table.insert('',END,values=row)
        except Exception as ex:
            messagebox.showerror("Error",f"Error due to {str(ex)}")

    def fetch_course(self):
        con=con=sqlite3.connect(database="python project.db")
        cur=con.cursor()
        try:
            cur.execute("select name from course")
            rows=cur.fetchall()
            if len(rows)>0:
              for row in rows:
                self.course_list.append(row[0] )
        except Exception as ex:
            messagebox.showerror("Error",f"Error due to {str(ex)}")

    def search(self):
        con=con=sqlite3.connect(database="python project.db")
        cur=con.cursor()
        try:
            cur.execute("select * from student where roll=?",(self.search_.get(),))
            row=cur.fetchone()
            if row!=None:
               self.c_table.delete(*self.c_table.get_children())
               self.c_table.insert('',END,values=row)
            else:
                messagebox.showerror("Error","No record found",parent=self.root)
        except Exception as ex:
            messagebox.showerror("Error",f"Error due to {str(ex)}")

if __name__=="__main__":
    root=Tk()
    obj=studentclass(root)
    root.mainloop()


Attendance`|`attendance`|`OAContentVacationAttendance`| 假勤组件-出差/外出/加班组件（control参数为Attendance）
`PunchCorrection`|`punch_correction`|`OAContentPunchCorrection`| 假勤组件-出差/外出/加班组件（control参数为Attendance）
`Location`|`location`|`OAContentLocation`| 位置控件（control参数为Location，且value参数为location）
`RelatedApproval`|`related_approval`|`[]OAContentRelatedApproval`| 关联审批单控件（control参数为RelatedApproval，且value参数为related_approval）
`Formula`|`formula`|`OAContentFormula`| 公式控件（control参数为Formula，且value参数为formula）
`DateRange`|`date_range`|`OAContentDateRange`| 时长组件（control参数为DateRange，且value参数为date_range）
`BankAccount`|`bank_account`|`OAContentBankAccount`| 收款账户控件（control参数为BankAccount）

### `OAContentDate` 日期/日期+时间内容

Name|JSON|Type|Doc
:---|:---|:---|:--
`Type`|`type`|`string`| 时间展示类型：day-日期；hour-日期+时间 ，和对应模板控件属性一致
`Timestamp`|`s_timestamp`|`string`| 时间戳-字符串类型，在此填写日期/日期+时间控件的选择值，以此为准

### `OAContentSelector` 类型标志，单选/多选控件的config中会包含此参数

Name|JSON|Type|Doc
:---|:---|:---|:--
`Type`|`type`|`string`| 选择方式：single-单选；multi-多选
`Options`|`options`|`[]OAContentSelectorOption`| 多选选项，多选属性的选择控件允许输入多个

### `OAContentSelectorOption` 多选选项，多选属性的选择控件允许输入多个

Name|JSON|Type|Doc
:---|:---|:---|:--
`Key`|`key`|`string`| 选项key，可通过“获取审批模板详情”接口获得
`Value`|`value`|`[]OAText`| 选项值，若配置了多语言则会包含中英文的选项值

### `OAContentMember` 所选成员内容，即申请人在此控件选择的成员，多选模式下可以有多个

Name|JSON|Type|Doc
:---|:---|:---|:--
`UserID`|`userid`|`string`| 所选成员的userid
`Name`|`name`|`string`| 成员名

### `OAContentDepartment` 所选部门内容，即申请人在此控件选择的部门，多选模式下可能有多个

Name|JSON|Type|Doc
:---|:---|:---|:--
`OpenAPIID`|`openapi_id`|`string`|


 显示键盘
	*/
	showKeyboard(obj:{defaultValue?: string,maxLength?: number,multiple?: boolean,confirmHold?: boolean,confirmType?: string,success?: Function,fail?: Function,complete?: Function});
	/**
	* 更新键盘输入框内容
	*/
	updateKeyboard(obj:{value?: string,success?: Function,fail?: Function,complete?: Function});
	/**
	* 获取菜单按钮的布局置信息
	*/
	getMenuButtonBoundingClientRect(): Object;
	/**
	* 动态设置通过右上角按钮拉起的菜单的样式
	*/
	setMenuStyle(obj:{style?: string,success?: Function,fail?: Function,complete?: Function});
	/**
	* 当在配置中设置 showStatusBarStyle 时，屏幕顶部会显示状态栏
	*/
	setStatusBarStyle(obj:{style?: string,success?: Function,fail?: Function,complete?: Function});
	/**
	* 取消监听窗口尺寸变化事件
	*/
	offWindowResize(callback:Function);
	/**
	* 监听窗口尺寸变化事件
	*/
	onWindowResize(callback:(res:{windowWidth: number,windowHeight: number})=>void);
	/**
	* 获取全局唯一的版本更新管理器，用于管理小程序更新
	*/
	getUpdateManager(): UpdateManager;
	/**
	* 创建一个 Worker 线程
	*/
	createWorker(scriptPath:string): Worker;
}
import * as vscode from 'vscode';

import { config } from '..';

class Help
{
	async getInput (placeHolder: string)
	{
		return await vscode.window.showInputBox({
			placeHolder
		});
	}

	running (str: string)
	{
		if (config.property('showRunning')) {
			vscode.window.showInformationMessage("Running: " + str);
		}
	}

	show (str: string)
	{
		if (config.property('showInfo')) {
			vscode.window.showInformationMessage(str);
		}
	}

	error (str: string)
	{
		if (config.property('showError')) {
			vscode.window.showErrorMessage("[Error]: " + str);
		}
	}

	warning (str: string)
	{
		if (config.property('showWarning')) {
			vscode.window.showWarningMessage("[Warning]: " + str);
		}

	}

	/**
	 * Creates a Dropdown with the options received
	 * @param {string[]} items is the options
	 */
	async dropdown (items: string[])
	{
		return await vscode.window.showQuickPick(items);
	}
}

export default new Help();import { getManConfig, getManPageConfig } from "./manPage";

describe('generates man config from docs array', () => {
    const docs = [{
        category: 'Setting',
        action: 'Split windows horizontally',
        keybinding: 'Super + b'
    },
    {
        category: 'Navigation',
        action: 'Swap focus to the parent window',
        keybinding: 'Super + a'
    },
    {
        category: 'Setting',
        action: 'Split windows vertically',
        keybinding: 'Super + v'
    }]

    it('should


ILD_WITHOUT_VARIANTS = "Building without adding glTFast Shader Variants";

        public int callbackOrder { get; }

        public void OnPreprocessBuild(BuildReport report)
        {
            if (!Application.isBatchMode && GraphicsSettingsUtility.IsMissingVariants())
            {
                var addShaderVariants = EditorUtility.DisplayDialog(BUILD_WARNING,
                    SUBDOMAIN_WARNING,
                    ADD_SHADER_VARIANTS,
                    CONTINUE_WITH_DEMO);

                if (addShaderVariants)
                {
                    GraphicsSettingsUtility.AddPreloadShaderVariants();
                }
                else
                {
                    SDKLogger.LogWarning(TAG, WARNING_BUILD_WITHOUT_VARIANTS);
                }
            }
        }
    }
}


/* Generated by RuntimeBrowser
   Image: /System/Library/PrivateFrameworks/AppleAccount.framework/AppleAccount
 */

@interface AAAuthenticationResponse : AAResponse {
    NSDictionary * _appleAccount;
    NSDictionary * _tokens;
}

@property (nonatomic, readonly) NSString *HSAAction;
@property (nonatomic, readonly) NSString *HSAData;
@property (nonatomic, readonly) NSString *altDSID;
@property (nonatomic, readonly) NSString *authToken;
@property (nonatomic, readonly) NSString *cloudKitToken;
@property (nonatomic, readonly) NSString *fmfAppToken;
@property (nonatomic, readonly) NSString *fmfToken;
@property (nonatomic, readonly) NSString *fmipLostModeToken;
@property (nonatomic, readonly) NSString *fmipToken;
@property (nonatomic, readonly) NSString *hsaToken;
@property (nonatomic, readonly) NSString *mapsToken;
@property (nonatomic, readonly) NSString *personID;

- (void).cxx_destruct;
- (id)HSAAction;
- (id)HSAData;
- (id)altDSID;
- (id)authToken;
- (id)cloudKitToken;
- (id)fmfAppToken;
- (id)fmfToken;
- (id)fmipLostModeToken;
- (id)fmipToken;
- (id)hsaToken;
- (id)initWithHTTPResponse:(id)arg1 data:(id)arg2;
- (id)mapsToken;
- (id)personID;

@end


center; LINE-HEIGHT: 12pt; mso-pagination: none; mso-line-height-rule: exactly"
      align=center>1st<o:p></o:p>

300<o:p></o:p>

<o:p
      > </o:p>

11th<o:p></o:p>

      <p class=10
      style="TEXT-ALIGN: center; LI


    if (mounted) {
      setState(() {
        if (allInfoList.isEmpty) {
          state = loading_state.LoadState.empty;
        } else {
          selectedFilesBool = List.filled(allInfoList.length, false, growable: true);
          state = loading_state.LoadState.success;
        }
      });
    }
  }

  @override
  bool isShowSortByDate() => false;

  downloadFile(String urlpath, String fileName) async {
    try {
      BaseOptions baseOptions = setBaseOptions();
      Dio dio = Dio(baseOptions);
      String tempDir = (await getTemporaryDirectory()).path;
      var tempfile = File('$tempDir/$fileName');
      var response = await dio.download(
        urlpath,
        tempfile.path,
        deleteOnError: false,
        options: Options(
          headers: {},
        ),
      );
      if (response.statusCode == 200) {
        return tempfile.path;
      }
      return 'error';
    } catch (e) {
      flogErr(e, {}, 'githubFileExplorerState', 'downloadFile');
    }
    return 'error';
  }

  bool isPublicFile() {
    if (widget.element['showedUsername'].toString().toLowerCase() != adminUserName.toLowerCase() ||
        widget.element['private'] == false) {
      return true;
    }
    return false;
  }

  @override
  Future<String> getShareUrl(int index) async {
    String defaultUrl =
        'https://raw.githubusercontent.com/${widget.element['showedUsername']}/${widget.element['name']}/${widget.element['default_branch']}/${widget.bucketPrefix}${allInfoList[index]['path']}';
    if (isPublicFile()) {
      return defaultUrl;
    }
    var res = await manageAPI.getRepoFileContent(
      widget.element['showedUsername'],
      widget.element['name'],
      widget.bucketPrefix + allInfoList[index]['path'],
    );
    if (res[0] != 'success') {
      return defaultUrl;
    }
    return Uri.decodeFull(res[1]['download_url']);
  }

  @override
  String getFileName(int index) => allInfoList[index]['path'];

  @override
  String getFileDate(int index) {
    return '';
  }

  @override
  String? getFileSizeForList(int index) {
    int size = int.parse((allInfoList[index]['size'] ?? 0).toString().split('.')[0]);
    return size > 0 ? getFileSize(size) : null;
  }

  @override
  Future<void> onFileItemTap(int index) async {
    if (index < dirAllInfoList.length) {
      Map newElement = Map.from(widget.element);
      String prefix = '${widget.bucketPrefix + allInfoList[index]['path']}/';
      newElement['bucketSha'] = allInfoList[index]['sha'];
      Application.router.navigateTo(context,
          '${Routes.githubFileExplorer}?element=${Uri.encodeComponent(jsonEncode(newElement))}&bucketPrefix=${Uri.encodeComponent(prefix)}',
          transition: TransitionType.cupertino);
    } else {
      String urlList = '';
      //判断是否为图片文本
      if (!Global.imgExt.contains(allInfoList[index]['path'].split('.').last.toLowerCase()) &&
          !Global.textExt.contains(allInfoList[index]['path'].split('.').last.toLowerCase())) {
        showToast('不支持的格式');
        return;
      }
      if (Global.imgExt.contains(allInfoList[index]['path'].split('.').last.toLowerCase())) {
        //预览图片
        if (isPublicFile()) {
          int newImageIndex = index - dirAllInfoList.


using System;
using System.ComponentModel.DataAnnotations;
using Cysharp.Threading;
using R3.Collections;

namespace R3;

public sealed class LogicLooperFrameProvider : FrameProvider, IDisposable
{
    bool disposed;
    long frameCount;
    FreeListCore<IFrameRunnerWorkItem> list;
    Task loop;
    internal long timestamp;
    internal TimeSpan deltaTime;
    readonly object gate = new object();

    public LogicLooperFrameProvider(ILogicLooper looper)
    {
        this.list = new FreeListCore<IFrameRunnerWorkItem>(gate);

        this.frameCount = looper.CurrentFrame;
        this.loop = looper.RegisterActionAsync(Run);
    }

    public override long GetFrameCount()
    {
        ThrowObjectDisposedIf(disposed, typeof(LogicLooperFrameProvider));
        return frameCount;
    }

    public override void Register(IFrameRunnerWorkItem callback)
    {
        ThrowObjectDisposedIf(disposed, typeof(LogicLooperFrameProvider));
        list.Add(callback, out _);
    }

    public void Dispose()
    {
        disposed = true;
        list.Dispose();
    }

    bool Run(in LogicLooperActionContext context)
    {
        if (disposed) return false;

        frameCount = context.Cu


arkMode ? "monokai" : "default";
  const method = isDarkMode ? "add" : "remove";

  $sel("body").classList[method]("dark-mode");

  // Apply the theme to all CodeMirror instances
  Object.keys(editors).forEach((editorKey) =>
    editors[editorKey].setOption("theme", desiredTheme)
  );
}

document.addEventListener("DOMContentLoaded", function () {
  $sel("#version_id").textContent = BUILD_VERSION;

  $all(".btn-copy").forEach((btn) =>
    btn.addEventListener("click", copyToClipboard)
  );
  $all(".btn-clear").forEach((btn) =>
    btn.addEventListener("click", clearTextarea)
  );
  $sel(".btn-encode").addEventListener("click", encodeJwt);
  $sel(".btn-decode").addEventListener("click", showDecoded);
  $sel(".btn-verify").addEventListener("click", verifyJwt);
  $all(".btn-newkey").forEach((btn) => btn.addEventListener("click", newKey));
  $sel("#btn-new-payload").addEventListener("click", newJson);
  $sel("#btn-new-header").addEventListener("click", newJson);

  populateEncSelectOptions();

  $all(".sel-key-coding").forEach((sel) =>
    sel.addEventListener("change", changeKeyCoding)
  );
  $sel("#mainalert").classList.add("fade");
  $sel("#mainalert").addEventListener("close.bs.alert", closeAlert);

  // editor for the encoded JWT (left hand column)
  editors.encodedjwt = CodeMirror.fromTextArea(
    document.getElementById("encodedjwt"),
    {
      mode: "encodedjwt",
      lineWrapping: true,
      singleCursorHeightPerLine: false
    }
  );
  editors.encodedjwt.on("inputRead", function (_cm, event) {
    /* event -> object{
       origin: string, can be '+input', '+move' or 'paste'
       doc for origins >> http://codemirror.net/doc/manual.html#selection_origin
       from: object {line, ch},
       to: object {line, ch},
       removed: array of removed strings
       text: array of pasted strings
       } */
    if (event.origin == "paste") {
      gtag("event", "paste", {
        event_category: "encodedJwt"
      });

      setTimeout(() => {
        removeNewlines(editors.encodedjwt);
        showDecoded();
      }, 220);
    }
  });
  //editors.encodedjwt.on('renderLine', decorateEncodedToken);

  // create editors for the public and private keys
  ["private", "public"].forEach((flavor) => {
    const keytype = flavor + "key", // private || public
      elementId = "ta_" + keytype;
    editors[keytype] = CodeMirror.fromTextArea(
      document.getElementById(elementId),
      {
        mode: "encodedjwt", // not really, its just plaintext
        lineWrapping: true,
        singleCursorHeightPerLine: false
      }
    );
    editors[keytype].on("inputRead", function (_cm, event) {
      gtag("event", "paste", {
        event_category: keytype
      });
      if (event.origin == "paste") {
        setTimeout(function () {
          const fieldvalue = reformNewlines(editors[keytype]);
          if (looksLikePem(fieldvalue)) {
            editors[keytype].setOption("mode", "encodedjwt");
            updateAsymmetricKeyValue(flavor, reformIndents(fieldvalue));
          } else {
            const possiblyJwks = looksLikeJwks(fieldvalue);
            if (possiblyJwks) {
              editors[keytype].setOption("mode", "javascript");
              const prettyPrintedJson = JSON.stringify(possiblyJwks, null, 2);
              editors


�𰃁𰃂𰃃𰃄𰃅𰃆𰃇𰃈𰃉𰃊𰃋𰃌𰃍𰃎𰃏𰃐𰃑𰃒𰃓𰃔𰃕𰃖𰃗𰃘𰃙𰃚𰃛𰃜𰃝𰃞𰃟𰃠𰃡𰃢𰃣𰃤𰃥𰃦𰃧𰃨𰃩𰃪𰃫𰃬𰃭𰃮𰃯𰃰𰃱𰃲𰃳𰃴𰃵𰃶𰃷𰃸𰃹𰃺𰃻𰃼𰃽𰃾𰃿𰄀"s);

    // Supplementary Special-purpose Plane
    allPassed &= test(L""s, u8"


Minimer"},"newpage":{"toolbar":"Ny side"},"pagebreak":{"alt":"Sideskift","toolbar":"Sett inn sideskift for utskrift"},"pastetext":{"button":"Lim inn som ren tekst","title":"Lim inn som ren tekst"},"pastefromword":{"confirmCleanup":"Teksten du limer inn ser ut til å være kopiert fra Word. Vil du renske den før du limer den inn?","error":"Det var ikke mulig å renske den innlimte teksten på grunn av en intern feil","title":"Lim inn fra Word","toolbar":"Lim inn fra Word"},"preview":{"preview":"Forhåndsvis"},"print":{"toolbar":"Skriv ut"},"removeformat":{"toolbar":"Fjern formatering"},"save":{"toolbar":"Lagre"},"selectall":{"toolbar":"Merk alt"},"showblocks":{"toolbar":"Vis blokker"},"sourcearea":{"toolbar":"Kilde"},"specialchar":{"options":"Alternativer for spesialtegn","title":"Velg spesialtegn","toolbar":"Sett inn spesialtegn"},"scayt":{"btn_about":"Om SCAYT","btn_dictionaries":"Ordbøker","btn_disable":"Slå av SCAYT","btn_enable":"Slå på SCAYT","btn_langs":"Språk","btn_options":"Valg","text_title":"Stavekontroll mens du skriver"},"stylescombo":{"label":"Stil","panelTitle":"Stilformater","panelTitle1":"Blokkstiler","panelTitle2":"Inlinestiler","panelTitle3":"Objektstiler"},"table":{"border":"Rammestørrelse","caption":"Tittel","cell":{"menu":"Celle","insertBefore":"Sett inn celle før","insertAfter":"Sett inn celle etter","deleteCell":"Slett celler","merge":"Slå sammen celler","mergeRight":"Slå sammen høyre","mergeDown":"Slå sammen ned","splitHorizontal":"Del celle horisontalt","splitVertical":"Del celle vertikalt","title":"Celleegenskaper","cellType":"Celletype","rowSpan":"Radspenn","colSpan":"Kolonnespenn","wordWrap":"Tekstbrytning","hAlign":"Horisontal justering","vAlign":"Vertikal justering","alignBaseline":"Grunnlinje","bgColor":"Bakgrunnsfarge","borderColor":"Rammefarge","data":"Data","header":"Overskrift","yes":"Ja","no":"Nei","invalidWidth":"Cellebredde må være et tall.","invalidHeight":"Cellehøyde må være et tall.","invalidRowSpan":"Radspenn må være et heltall.","invalidColSpan":"Kolonnespenn må være et heltall.","chooseColor":"Velg"},"cellPad":"Cellepolstring","cellSpace":"Cellemarg","column":{"menu":"Kolonne","insertBefore":"Sett inn kolonne før","insertAfter":"Sett inn kolonne etter","deleteColumn":"Slett kolonner"},"columns":"Kolonner","deleteTable":"Slett tabell","headers":"Overskrifter","headersBoth":"Begge","headersColumn":"Første kolonne","headersNone":"Ingen","headersRow":"Første rad","invalidBorder":"Rammestørrelse må være et tall.","invalidCellPadding":"Cellepolstring må være et positivt tall.","invalidCellSpacing":"Cellemarg må være et positivt tall.","invalidCols":"Antall kolonner må være et tall større enn 0.","invalidHeight":"Tabellhøyde må være et tall.","invalidRows":"Antall rader må være et tall større enn 0.","invalidWidth":"Tabellbredde må være et tall.","menu":"Egenskaper for tabell","row":{"menu":"Rader","insertBefore":"Sett inn rad før","insertAfter":"Sett inn rad etter","deleteRow":"Slett rader"},"rows":"Rader","summary":"Sammendrag","title":"Egenskaper for tabell","toolbar":"Tabell","widthPc":"prosent","widthPx":"piksler","widthUnit":"Bredde


Schema")%}

                                        {{item}}
                                        {{model.meta.prop(item)}}

                                {% endfor %}

                        </button>

    {%if loop.last or ((loop.index % 4) == 0)%}

    {%endif%}
{%endfor%}
"""


[1]="#",
						[2]="#"
					}
				},
				text="With at least 1000 Strength, {0}% of Damage dealt by your Raised Zombies is Leeched to you as Life"
			}
		},
		stats={
			[1]="zombie_damage_leeched_as_life_to_you_permyriad_if_over_1000_strength"
		}
	},
	[10226]={
		[1]={
			[1]={
				limit={
					[1]={
						[1]=1,
						[2]="#"
					}
				},
				text="Raised Zombies deal {0}% more Physical Damage"
			},
			[2]={
				[1]={
					k="negate",
					v=1
				},
				limit={
					[1]={
						[1]="#",
						[2]=-1
					}
				},
				text="Raised Zombies deal {0}% less Physical Damage"
			}
		},
		stats={
			[1]="zombie_physical_damage_+%_final"
		}
	},
	[10227]={
		[1]={
			[1]={
				limit={
					[1]={
						[1]=1,
						[2]="#"
					}
				},
				text="Raised Zombies' Slam Attack has {0}% increased Area of Effect"
			},
			[2]={
				[1]={
					k="negate",
					v=1
				},
				limit={
					[1]={
						[1]="#",
						[2]=-1
					}
				},
				text="Raised Zombies' Slam Attack has {0}% reduced Area of Effect"
			}
		},
		stats={
			[1]="zombie_slam_area_of_effect_+%"
		}
	},
	[10228]={
		[1]={
			[1]={
				limit={
					[1]={
						[1]="#",
						[2]="#"
					}
				},
				text="Raised Zombies' Slam Attack has {0}% increased Cooldown Recovery Rate"
			}
		},
		stats={
			[1]="zombie_slam_cooldown_speed_+%"
		}
	},
	[10229]={
		[1]={
			[1]={
				limit={
					[1]={
						[1]="#",
						[2]="#"
					}
				},
				text="Raised Zombies' Slam Attack deals {0}% increased Damage"
			}
		},
		stats={
			[1]="zombie_slam_damage_+%"
		}
	},
	[10230]={
		[1]={
			[1]={
				[1]={
					k="reminderstring",
					v="ReminderTextAggressiveMinions"
				},
				limit={
					[1]={
						[1]="#",
						[2]="#"
					}
				},
				text="Summoned Golems are Aggressive"
			}
		},
		stats={
			[1]="golems_larger_aggro_radius"
		}
	},
	[10231]={
		[1]={
			[1]={
				[1]={
					k="reminderstring",
					v="ReminderTextAggressiveMinions"
				},
				limit={
					[1]={
						[1]="#",
						[2]="#"
					}
				},
				text="Minions are Aggressive"
			}
		},
		stats={
			[1]="minion_larger_aggro_radius"
		}
	},
	[10232]={
		[1]={
			[1]={
				limit={
					[1]={
						[1]=1,
						[2]="#"
					},
					[2]={
						[1]=1,
						[2]="#"
					}
				},
				text="Notable Passive Skills in Radius are Transformed to\ninstead grant: {0}% increased Mana Cost


PatchBaselineID(id) || isPatchBaselineARN(id) {
					conn := meta.(*conns.AWSClient).SSMClient(ctx)

					baseline, err := findPatchBaselineByID(ctx, conn, id)
					if err != nil {
						return nil, fmt.Errorf("reading SSM Patch Baseline (%s): %w", id, err)
					}

					d.SetId(string(baseline.OperatingSystem))
				} else if vals := enum.Values[awstypes.OperatingSystem](); !slices.Contains(vals, id) {
					return nil, fmt.Errorf("ID (%s) must be either a Patch Baseline ID, Patch Baseline ARN, or one of %v", id, vals)
				}

				return []*schema.ResourceData{d}, nil
			},
		},

		Schema: map[string]*schema.Schema{
			"baseline_id": {
				Type:             schema.TypeString,
				Required:         true,
				ForceNew:         true,
				DiffSuppressFunc: diffSuppressPatchBaselineID,
				ValidateFunc: validation.Any(
					validatePatchBaselineID,
					validatePatchBaselineARN,
				),
			},
			"operating_system": {
				Type:             schema.TypeString,
				Required:         true,
				ForceNew:         true,
				ValidateDiagFunc: enum.Validate[awstypes.OperatingSystem](),
			},
		},
	}
}

func resourceDefaultPatchBaselineCreate(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics {
	var diags diag.Diagnostics
	conn := meta.(*conns.AWSClient).SSMClient(ctx)

	baselineID := d.Get("baseline_id").(string)
	patchBaseline, err := findPatchBaselineByID(ctx, conn, baselineID)

	if err != nil {
		return sdkdiag.AppendErrorf(diags, "reading SSM Patch Baseline (%s): %s", baselineID, err)
	}

	if pbOS, cOS := patchBaseline.OperatingSystem, awstypes.OperatingSystem(d.Get("operating_system").(string)); pbOS != cOS {
		return sdkdiag.AppendErrorf(diags, "Patch Baseline Operating System (%s) does not match %s", pbOS, cOS)
	}

	input := &ssm.RegisterDefaultPatchBaselineInput{
		BaselineId: aws.String(baselineID),
	}

	_, err = conn.RegisterDefaultPatchBaseline(ctx, input)

	if err != nil {
		return sdkdiag.AppendErrorf(diags, "registering SSM Default Patch Baseline (%s): %s", baselineID, err)
	}

	d.SetId(string(patchBaseline.OperatingSystem))

	return append(diags, resourceDefaultPatchBaselineRead(ctx, d, meta)...)
}

func resourceDefaultPatchBaselineRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics {
	var diags diag.Diagnostics
	conn := meta.(*conns.AWSClient).SSMClient(ctx)

	output, err := findDefaultPatchBaselineByOperatingSystem(ctx, conn, awstypes.OperatingSystem(d.Id()))

	if !d.IsNewResource() && tfresource.NotFound(err) {
		log.Printf("[WARN] SSM Default Patch Baseline (%s) not found, removing from state", d.Id())
		d.SetId("")
		return diags
	}

	if err != nil {
		return sdkdiag.AppendErrorf(diags, "reading SSM Default Patch Baseline (%s): %s", d.Id(), err)
	}

	d.Set("baseline_id", output.BaselineId)
	d.Set("operating_system", output.OperatingSystem)

	return diags
}

func resourceDefaultPatchBaselineDelete(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics {
	return defaultPatchBaselineRestoreOSDefault(ctx, meta.(*con


 // version needed
        target.writeShort ((short) (1 << 11)); // this flag indicates UTF-8 filename encoding
        target.writeShort (compressionLevel > 0 ? (short) 8 : (short) 0);
        writeTimeAndDate (target, fileTime);
        target.writeInt ((int) checksum);
        target.writeInt ((int) (uint32) compressedSize);
        target.writeInt ((int) (uint32) uncompressedSize);
        target.writeShort ((short) storedPathname.toUTF8().sizeInBytes() - 1);
        target.writeShort (0); // extra field length
    }

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Item)
};

//==============================================================================
ZipFile::Builder::Builder() {}
ZipFile::Builder::~Builder() {}

void ZipFile::Builder::addFile (const File& file, const int compression, const String& path)
{
    items.add (new Item (file, nullptr, compression,
                         path.isEmpty() ? file.getFileName() : path,
                         file.getLastModificationTime()));
}

void ZipFile::Builder::addEntry (InputStream* stream, int compression, const String& path, Time time)
{
    jassert (stream != nullptr); // must not be null!
    jassert (path.isNotEmpty());
    items.add (new Item (File(), stream, compression, path, time));
}

bool ZipFile::Builder::writeToStream (OutputStream& target, double* const progress) const
{
    const int64 fileStart = target.getPosition();

    for (int i = 0; i < items.size(); ++i)
    {
        if (progress != nullptr)
            *progress = (i + 0.5) / items.size();

        if (! items.getUnchecked (i)->writeData (target, fileStart))
            return false;
    }

    const int64 directoryStart = target.getPosition();

    for (int i = 0; i < items.size(); ++i)
        if (! items.getUnchecked (i)->writeDirectoryEntry (target))
            return false;

    const int64 directoryEnd = target.getPosition();

    target.writeInt (0x06054b50);
    target.writeShort (0);
    target.writeShort (0);
    target.writeShort ((short) items.size());
    target.writeShort ((short) items.size());
    target.writeInt ((int) (directoryEnd - directoryStart));
    target.writeInt ((int) (directoryStart - fileStart));
    target.writeShort (0);

    if (progress != nullptr)
        *progress = 1.0;

    return true;
}
/*
  ==============================================================================

   This file is part of the JUCE library.
   Copyright (c) 2016 - ROLI Ltd.

   Permission is granted to use this software under the terms of the ISC license
   http://www.isc.org/downloads/software-support-policy/isc-license/

   Permission to use, copy, modify, and/or distribute this software for any
   purpose with or without fee is hereby granted, provided that the above
   copyright notice and this permission notice appear in all copies.

   THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD
   TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
   OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
   TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
   OF THIS SOFTWARE.

   -----------------------------------------------------------------------------

   To release a closed-source product which uses other parts of JUCE not
   licensed under the ISC terms, commercial licenses are available: visit
   www.juce.com for more information.

  ==============================================================================
*/

#if JUCE_UNIT_TESTS

struct ListenerBase
{
    ListenerBase (int& counter) : c (counter) {}
    virtua


ext_media_color" to "true",
        "include_media_features" to "true",
        "include_my_retweet" to "1",
        "include_profile_interstitial_type" to "true",
        "include_profile_location" to "true",
        "include_reply_count" to "1",
        "include_trends" to "1",
        "include_user_entities" to "true",
        "include_user_hashtag_entities" to "true",
        "include_user_mention_entities" to "true",
        "include_user_symbol_entities" to "true",
        "live_video_in_hero" to "1",
        "pc" to "1",
        "tweet_mode" to "extended",
        "v" to "1473704494",
        *options
    )
}.jsonObject { MomentGuide(it, client) }

/**
 * Shorthand property to [Moments.guide].
 * @see Moments.guide
 */
public val Moments.guide: JsonObjectApiAction<MomentGuide>
    get() = guide()
/*
 * The MIT License (MIT)
 *
 *     Copyright (c) 2017-2020 StarryBlueSky
 *
 * 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.
 */

@file:Suppress("UNUSED")

package blue.starry.penicillin.endpoints.media

import io.ktor.http.*

/**
 * Represents media type.
 */
public enum class MediaType(
    /**
     * Content-type.
     */
    public val contentType: ContentType
) {
    /**
     * Jpeg image.
     */
    JPEG(ContentType.Image.JPEG),

    /**
     * Png image.
     */
    PNG(ContentType.Image.PNG),

    /**
     * Gif image or animation.
     */
    GIF(ContentType.Image.GIF),

    /**
     * WebP image.
     */
    WebP(ContentType("image", "webp")),

    /**
     * Mp4 video.
     */
    MP4(ContentType.Video.MP4)
}
/*
 * The MIT License (MIT)
 *
 *     Copyright (c) 2017-2020 StarryBlueSky
 *
 * 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


an="1">JN
12 Jan
2005F651
iPhone7,1_13A344

(nonpersistent) success

(persistent) success

JN
12 Jan
2005k389
iPhone5,3_12F70

(nonpersistent) success

(persistent) success

JN
12 Jan
2005f146
iPhone5,3_12B411

(nonpersistent) success

(persistent) success

JN
12 Jan
2005f649
iPhone7,2_13B143

(nonpersistent) success

(persistent) success

JN
12 Jan
2005k268
iPad4,4_12B1410

(nonpersistent) success

(persistent) success

pin locked

JN
12 Jan
2005G957
iPad2,5_12A365

(nonpersistent) success

(persistent) success

JN
12 Jan
2005k384
iPhone5,3_12H143

(nonpersistent) success

(persistent) success

JN
12 Jan
2005j965
iPad3,1_12H321

(nonpersistent) success

(persistent) success

Previous versions:

| 1
| 2
| 3
| 4
| 5
| 6
| 7
| 8
| <a href="page_44269595


ADIS16240_XACCL_OUT, ADIS16240_SCAN_ACC_X,
			BIT(IIO_CHAN_INFO_CALIBBIAS) | BIT(IIO_CHAN_INFO_PEAK),
			0, 10),
	ADIS_ACCEL_CHAN(Y, ADIS16240_YACCL_OUT, ADIS16240_SCAN_ACC_Y,
			BIT(IIO_CHAN_INFO_CALIBBIAS) | BIT(IIO_CHAN_INFO_PEAK),
			0, 10),
	ADIS_ACCEL_CHAN(Z, ADIS16240_ZACCL_OUT, ADIS16240_SCAN_ACC_Z,
			BIT(IIO_CHAN_INFO_CALIBBIAS) | BIT(IIO_CHAN_INFO_PEAK),
			0, 10),
	ADIS_TEMP_CHAN(ADIS16240_TEMP_OUT, ADIS16240_SCAN_TEMP, 0, 10),
	IIO_CHAN_SOFT_TIMESTAMP(6)
};

static struct attribute *adis16240_attributes[] = {
	&iio_dev_attr_in_accel_xyz_squared_peak_raw.dev_attr.attr,
	&iio_const_attr_sampling_frequency_available.dev_attr.attr,
	NULL
};

static const struct attribute_group adis16240_attribute_group = {
	.attrs = adis16240_attributes,
};

static const struct iio_info adis16240_info = {
	.attrs = &adis16240_attribute_group,
	.read_raw = &adis16240_read_raw,
	.write_raw = &adis16240_write_raw,
	.update_scan_mode = adis_update_scan_mode,
	.driver_module = THIS_MODULE,
};

static const char * const adis16240_status_error_msgs[] = {
	[ADIS16240_DIAG_STAT_PWRON_FAIL_BIT] = "Power on, self-test failed",
	[ADIS16240_DIAG_STAT_SPI_FAIL_BIT] = "SPI failure",
	[ADIS16240_DIAG_STAT_FLASH_UPT_BIT] = "Flash update failed",
	[ADIS16240_DIAG_STAT_POWER_HIGH_BIT] = "Power supply above 3.625V",
	[ADIS16240_DIAG_STAT_POWER_LOW_BIT] = "Power supply below 2.225V",
};

static const struct adis_data adis16240_data = {
	.write_delay = 35,
	.read_delay = 35,
	.msc_ctrl_reg = ADIS16240_MSC_CTRL,
	.glob_cmd_reg = ADIS16240_GLOB_CMD,
	.diag_stat_reg = ADIS16240_DIAG_STAT,

	.self_test_mask = ADIS16240_MSC_CTRL_SELF_TEST_EN,
	.startup_delay = ADIS16240_STARTUP_DELAY,

	.status_error_msgs = adis16240_status_error_msgs,
	.status_error_mask = BIT(ADIS16240_DIAG_STAT_PWRON_FAIL_BIT) |
		BIT(ADIS16240_DIAG_STAT_SPI_FAIL_BIT) |
		BIT(ADIS16240_DIAG_STAT_FLASH_UPT_BIT) |
		BIT(ADIS16240_DIAG_STAT_POWER_HIGH_BIT) |
		BIT(ADIS16240_DIAG_STAT_POWER_LOW_BIT),
};

static int adis16240_probe(struct spi_device *spi)
{
	int ret;
	struct adis *st;
	struct iio_dev *indio_dev;

	/* setup the industrialio driver allocated elements */
	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
	if (!indio_dev)
		return -ENOMEM;
	st = iio_priv(indio_dev);
	/* this is only used for removal purposes */
	spi_set_drvdata(spi, indio_dev);

	indio_dev->name = spi->dev.driver->name;
	indio_dev->dev.parent = &spi->dev;
	indio_dev->info = &adis16240_info;
	indio_dev->channels = adis16240_channels;
	indio_dev->num_channels = ARRAY_SIZE(adis16240_channels);
	indio_dev->modes = INDIO_DIRECT_MODE;

	ret = adis_init(st, indio_dev, spi, &adis16240_data);
	if (ret)
		return ret;
	ret = adis_setup_buffer_and_trigger(st, indio_dev, NULL);
	if (ret)
		return ret;

	/* Get the device into a sane initial state */
	ret = adis_initial_startup(st);
	if (ret)
		goto error_cleanup_buffer_trigger;
	ret = iio_device_register(indio_dev);
	if (ret)
		goto error_cleanup_buffer_trigger;
	return 0;

error_cleanup_buffer_trigger:
	adis_cleanup_buffer_and_trigger(st, indio_dev);
	return ret;
}

static int adis16240_remove(struct spi_device *spi)
{
	struct iio_dev *indio_dev = spi_get_drvdata(spi);
	struct adis *st = iio_priv(indio_dev);

	iio_device_unregister(indio_dev);
	adis_cleanup_buffer_and_trigger(st, indio_dev);

	return 0;
}

static struct spi_driver adis16240_driver = {
	.driver = {
		.name = "adis16240",
	},
	.probe = adis16240_probe,
	.remove = adis16240_remove,
};
module_spi_driver(adis16240_driver);

MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
MODULE_DESCRIPTION("Analog Devices Programmable Impact Sensor and Recorder");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("spi:adis16240");


	if ((g_ascii_isspace(m_match_contents[offset])) ||
	    (m_match_contents[offset] == '\0')) {
		_vte_debug_print(VTE_DEBUG_EVENTS,
                                 "Cursor is on whitespace.\n");
		return false;
	}

	/* Snip off any final newlines. */
	while (m_match_contents[eattr] == '\n' ||
               m_match_contents[eattr] == '\0') {
		eattr--;
	}
	/* and scan forwards to find the end of this line */
	while (!(m_match_contents[eattr] == '\n' ||
                 m_match_contents[eattr] == '\0')) {
		eattr++;
	}

	/* find the start of row */
	if (row == 0) {
		sattr = 0;
	} else {
		for (sattr = offset; sattr > 0; sattr--) {
			attr = &g_array_index(m_match_attributes,
					      struct _VteCharAttributes,
					      sattr);
			if (row > attr->row) {
				break;
			}
		}
	}
	/* Scan backwards to find the start of this line */
	while (sattr > 0 &&
		! (m_match_contents[sattr] == '\n' ||
                   m_match_contents[sattr] == '\0')) {
		sattr--;
	}
	/* and skip any initial newlines. */
	while (m_match_contents[sattr] == '\n' ||
               m_match_contents[sattr] == '\0') {
		sattr++;
	}
	if (eattr <= sattr) { /* blank line */
		return false;
	}
	if (eattr <= offset || sattr > offset) {
		/* nothing to match on this line */
		return false;
	}

        *offset_ptr = offset;
        *sattr_ptr = sattr;
        *eattr_ptr = eattr;

        _VTE_DEBUG_IF(VTE_DEBUG_REGEX) {
                struct _VteCharAttributes *_sattr, *_eattr;
                _sattr = &g_array_index(m_match_attributes,
                                        struct _VteCharAttributes,
                                        sattr);
                _eattr = &g_array_index(m_match_attributes,
                                        struct _VteCharAttributes,
                                        eattr - 1);
                g_printerr("Cursor is in line from %" G_GSIZE_FORMAT "(%ld,%ld) to %" G_GSIZE_FORMAT "(%ld,%ld)\n",
                           sattr, _sattr->column, _sattr->row,
                           eattr - 1, _eattr->column, _eattr->row);
        }

        return true;
}

/* creates a pcre match context with appropriate limits */
pcre2_match_context_8 *
VteTerminalPrivate::create_match_context()
{
        pcre2_match_context_8 *match_context;

        match_context = pcre2_match_context_create_8(nullptr /* general context */);
        pcre2_set_match_limit_8(match_context, 65536); /* should be plenty */
        pcre2_set_recursion_limit_8(match_context, 64); /* should be plenty */

        return match_context;
}

bool
VteTerminalPrivate::match_check_pcre(
                 pcre2_match_data_8 *match_data,
                 pcre2_match_context_8 *match_context,
                 VteRegex *regex,
                 guint32 match_flags,
                 gsize sattr,
                 gsize eattr,
                 gsize offset,
                 char **result_ptr,
                 gsize *start,
                 gsize *end,
                 gsize *sblank_ptr,
                 gsize *eblank_ptr)
{
        int (* match_fn) (const pcre2_code_8 *,
                          PCRE2_SPTR8, PCRE2_SIZE, PCRE2_SIZE, uint32_t,
                          pcre2_match_data_8 *, pcre2_match_context_8 *);
        gsize sblank = 0, eblank = G_MAXSIZE;
        gsize position, line_length;
        const char *line;
        int r = 0;

        if (_vte_regex_get_jited(regex))
                match_fn = pcre2_jit_match_8;
        else
                match_fn = pcre


-- Snap!Cloud Global Overrides
-- ===========================
--
-- Use this file to override lua defaults
-- or provide functions that are intended to be used anywhere.
-- A cloud backend for Snap!
--
-- Written by Bernat Romagosa and Michael Ball
--
-- Copyright (C) 2023 by Bernat Romagosa and Michael Ball
--
-- This file is part of Snap Cloud.
--
-- Snap Cloud is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as
-- published by the Free Software Foundation, either version 3 of
-- the License, or (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.

-- Print tables as JSON by default. Lets us


vatar img {
  width : 100%;
  max-width : 100%;
  height : auto;
  border : 0 none;
  border-radius : 1000px;
}
.avatar .badge-up {
  top : -8px;
  right : -11px;
}

.avatar-online i {
  background-color : #37BC9B;
}

.avatar-off i {
  background-color : #373A3C;
}

.avatar-busy i {
  background-color : #DA4453;
}

.avatar-away i {
  background-color : #F6BB42;
}

.avatar-100 {
  width : 100px;
}
.avatar-100 span.text-circle {
  width : 100px;
  height : 100px;
}
.avatar-100 i {
  height : 20px;
  width : 20px;
}

.avatar-50 {
  width : 50px;
}
.avatar-50 span.text-circle {
  width : 50px;
  height : 50px;
}
.avatar-50 i {
  height : 10px;
  width : 10px;
}

.avatar-lg {
  width : 144px;
}
.avatar-lg span.text-circle {
  width : 144px;
  height : 144px;
}
.avatar-lg i {
  right : 0;
  bottom : 0;
  height : 30px;
  width : 30px;
}

.avatar-md {
  width : 40px;
}
.avatar-md span.text-circle {
  width : 40px;
  height : 40px;
}
.avatar-md i {
  right : 0;
  bottom : 0;
  height : 12px;
  width : 12px;
}

.avatar-sm {
  width : 32px;
}
.avatar-sm span.text-circle {
  width : 32px;
  height : 32px;
}
.avatar-sm i {
  height : 10px;
  width : 10px;
}

.avatar-xs {
  width : 24px;
}
.avatar-xs span.text-circle {
  width : 24px;
  height : 24px;
}
.avatar-xs i {
  height : 9px;
  width : 9px;
}

/*=========================================================================================
	File Name: search.scss
	Description: Search  functionality.
	----------------------------------------------------------------------------------------
	Item Name: Robust - Responsive Admin Template
	Version: 2.0
	Author: PIXINVENT
	Author URL: http://www.themeforest.net/user/pixinvent
==========================================================================================*/
.navbar-container a.nav-link-search {
  float : left;
}

.navbar-container .search-input {
  float : left;
  padding-top : 1.2rem;
  width : 0;
}
.navbar-container .search-input .input {
  width : 0;
  border : none;
  background : none;
  -webkit-transition : all 0.2s ease-out;
       -o-transition : all 0.2s ease-out;
     -moz-transition : all 0.2s ease-out;
          transition : all 0.2s ease-out;
  line-height : 16px;
}
.navbar-container .search-input.open .input {
  width : 200px;
  padding : 5px 10px;
  outline : none;
  background


c"], ["c", "a", "b"].AsLinq().OrderBy(o => o).ToArray());

        Assert.AreEqual("a"
            , [{ Title: "b", Message: "b" }, { Title: "c", Message: "c" }, { Title: "a", Message: "a" }].AsLinq<any>().OrderBy(o => o.Title).First().Title);
    }

    OrderByDescending(): void
    {
        Assert.AreSequenceEqual([3, 2, 1], [3, 1, 2].AsLinq().OrderByDescending(o => o).ToArray(), null, "Failed to order");

        Assert.AreSequenceEqual([{ Value: 2 }, { Value: 1 }],
            [{ Value: 1 }, { Value: 2 }].AsLinq<any>().OrderByDescending(o => o.Value).ToArray()
            , (a, b) => a.Value == b.Value, "Failed to order objects");

        Assert.AreSequenceEqual([{ Value: 1 }, { Value: 2 }],
            [{ Value: 2 }, { Value: 1 }].AsLinq<any>()
                .OrderByDescending(o => o.Value, (a, b) => b - a).ToArray()
            , (a, b) => a.Value == b.Value, "Failed to order object with comparer");

        Assert.AreSequenceEqual([], [].AsLinq().OrderByDescending(o => o).ToArray(), null, "Failed to order empty arrays");
    }

    Reverse(): void
    {
        Assert.AreSequenceEqual([], [].AsLinq().Reverse().ToArray(), null, "Failed to reverse empty arrays");
        Assert.AreSequenceEqual([2, 1], [1, 2].AsLinq().Reverse().ToArray(), null, "Failed to reverse even arrays");
        Assert.AreSequenceEqual([3, 2, 1], [1, 2, 3].AsLinq().Reverse().ToArray(), null, "Failed to reverse odd arrays");
        Assert.AreSequenceEqual([{ Value: 1 }, { Value: 2 }]
            , [{ Value: 2 }, { Value: 1 }].AsLinq().Reverse().ToArray()
            , (a, b) => a.Value == b.Value, "Failed to reverse object arrays");

    }

    Select(): void
    {
        Assert.AreSequenceEqual(
            [1, 2, 3]
            , [{ Value: 1 }, { Value: 2 }, { Value: 3 }]
                .AsLinq<any>()
                .Select(o => o.Value).ToArray()
        );
    }

    SelectMany(): void
    {
        Assert.AreSequenceEqual([], [].AsLinq<any>().SelectMany(o => o).ToArray());

        Assert.AreSequenceEqual([1, 2, 3, 4, 5, 6]
            , [[1, 2, 3], [4, 5, 6]].AsLinq<any>().SelectMany(o => o).ToArray());

        Assert.AreSequenceEqual([1, 2, 3, 4]
            , [{ Values: [1, 2] }, { Values: [3, 4] }].AsLinq<any>()
                .SelectMany(o => o.Values).ToArray());

        Assert.AreSequenceEqual([10, 20, 30, 40]
            , [{ Values: [1, 2] }, { Values: [3, 4] }].AsLinq<any>()
                .SelectMany(o => o.Values, o => o * 10).ToArray());
    }

    SequenceEqual(): void
    {
        Assert.Throws(() => [].AsLinq().SequenceEqual(null));

        Assert.IsTrue([1, 2].AsLinq().SequenceEqual([1, 2]));
        Assert.IsFalse([1, 2].AsLinq().SequenceEqual([1, 2, 3]));
        Assert.IsFalse([1, 2].AsLinq().SequenceEqual([2, 1]));
    }

    Single(): void
    {
        Assert.Throws(() => [1, 2].AsLinq().Single());
        Assert.Throws(() => [1, 2, 3, 4].AsLinq().Single(


-1), _iView(LVS_REPORT), _fInited(false), _contextMenuColumn(-1)
{
}

CMessageView::~CMessageView()
{
}

BEGIN_MESSAGE_MAP(CMessageView, CListView)
    ON_COMMAND(ID_EDIT_DELETE, OnDelete)
    ON_COMMAND(IDC_BUTTONADDNEW, OnAddNew)
    ON_COMMAND(IDC_BUTTONADDSEQ, OnAddSeq)
    ON_COMMAND(IDC_BUTTONCLONE, OnCloneMessage)
    ON_COMMAND(ID_MESSAGE_EXPORT, OnExportMessage)
    ON_COMMAND(ID_MESSAGE_IMPORT, OnImportMessage)
    ON_NOTIFY_REFLECT(LVN_ITEMCHANGED, OnItemChanged)
    ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnClicked)
    ON_UPDATE_COMMAND_UI(ID_EDIT_RENAME, OnUpdateIfSelection)
    ON_UPDATE_COMMAND_UI(IDC_BUTTONADDSEQ, OnUpdateIfSelection)
    ON_UPDATE_COMMAND_UI(IDC_BUTTONCLONE, OnUpdateIfSelection)
	ON_UPDATE_COMMAND_UI(ID_EDIT_DELETE, OnUpdateIfSelection)
    ON_UPDATE_COMMAND_UI(ID_INDICATOR_AUDIOSIZE, OnCommandAudioSize)
    ON_COMMAND_RANGE(ID_GOTOVIEW1, ID_GOTOVIEW28, OnChooseMessageDefine)
    ON_WM_CONTEXTMENU()
END_MESSAGE_MAP()

void _EscapeString(CString &str);
void _UnescapeString(CString &str);

#define COL_STRING 0
#define COL_NOUN 1
#define COL_VERB 2
#define COL_CONDITION 3
#define COL_SEQUENCE 4
#define COL_TALKER 5

const struct
{
    PTSTR pszName; // Should be const, but the LVCOLUMN struct accepts only non-const
    int cx;
}
c_TextColumnInfo [] =
{
    { TEXT("Text"), 600 },
};

const struct
{
    PTSTR pszName; // Should be const, but the LVCOLUMN struct accepts only non-const
    int cx;
    MessagePropertyFlags Flags;
    int ColumnNumber;
}
c_MessageColumnInfo[] =
{
    { TEXT("Noun"), 110, MessagePropertyFlags::Noun, COL_NOUN },
    { TEXT("Verb"), 100, MessagePropertyFlags::Verb, COL_VERB },
    { TEXT("Cond."), 100, MessagePropertyFlags::Condition, COL_CONDITION },
    { TEXT("Seq."), 50, MessagePropertyFlags::Sequence, COL_SEQUENCE },
    { TEXT("Talker"), 110, MessagePropertyFlags::Talker, COL_TALKER },
};

CImageList g_messageImageList;
bool g_createdMessageImageList = false;

void CMessageView::_InitColumns()
{
    if (!g_createdMessageImageList)
    {
        g_messageImageList.Create(IDB_MESSAGEAUDIOICONS, 16, 32, RGB(255, 0, 255));
        g_createdMessageImageList = true;
    }
    GetListCtrl().SetImageList(&g_messageImageList, LVSIL_SMALL);

    const TextComponent &text = GetDocument()->GetResource()->GetComponent<TextComponent>();
    CListCtrl& listCtl = GetListCtrl();

    std::vector<int> orderArray;
    for (int i = 0; i < ARRAYSIZE(c_TextColumnInfo); i++)
    {
        // Name
        LVCOLUMN col = { 0 };
        col.mask = LVCF_FMT | LVCF_ORDER | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
        col.iImage = 0;
        col.iOrder = i;
        col.iSubItem = i;
        col.pszText = c_TextColumnInfo[i].pszName;
        col.cx = c_TextColumnInfo[i].cx;
        col.fmt = LVCFMT_RIGHT;
        _columns.push_back(col);
        listCtl.InsertColumn(i, &col);
    }
    int index = 1;
    for (int i = 0; i < ARRAYSIZE(c_MessageColumnInfo) ; i++)
    {
        if (IsFlagSet(text.Flags, c_MessageColumnInfo[i].Flags))
        {


object linear velocity |
| 408 - 410 |	object angle velocity |
| 411 - 417 |	goal pose |
| 418 - 421 |	goal rot - object rot |

#### Action Space

| Index | Description |
|  :----:  | :----:  |
| 0 - 19 |	right shadow hand actuated joint |
| 20 - 22 |	right shadow hand base translation |
| 23 - 25 |	right shadow hand base rotation |
| 26 - 45 |	left shadow hand actuated joint |
| 46 - 48 |	left shadow hand base translation |
| 49 - 51 |	left shadow hand base rotation |

#### Rewards

Rewards is the pose distance between object and goal, and the specific formula is as follows:
```python
goal_dist = torch.norm(target_pos - object_pos, p=2, dim=-1)

quat_diff = quat_mul(object_rot, quat_conjugate(target_rot))
rot_dist = 2.0 * torch.asin(torch.clamp(torch.norm(quat_diff[:, 0:3], p=2, dim=-1), max=1.0))

dist_rew = goal_dist

reward = torch.exp(-0.2*(dist_rew * dist_reward_scale + rot_dist))
```

### HandCatchOver2Underarm Environments

This environment is like made up of half Hand Over and Catch Underarm, the object needs to be thrown from the vertical hand to the palm-up hand. To use the HandCatchUnderarm environment, pass `--task=ShadowHandCatchOver2Underarm`

#### Observation Space

| Index | Description |
|  :----:  | :----:  |
| 0 - 397 |	dual hands observation shown in [Observation space of dual shadow hands](#obs_normal)|
| 398 - 404 |	object pose |
| 405 - 407 |	object linear velocity |
| 408 - 410 |	object angle velocity |
| 411 - 417 |	goal pose |
| 418 - 421 |	goal rot - object rot |

#### Action Space

| Index | Description |
|  :----:  | :----:  |
| 0 - 19 |	right shadow hand actuated joint |
| 20 - 22 |	right shadow hand base translation |
| 23 - 25 |	right shadow hand base rotation |
| 26 - 45 |	left shadow hand actuated joint |
| 46 - 48 |	left shadow hand base translation |
| 49 - 51 |	left shadow hand base rotation |

#### Rewards

Rewards is the pose distance between object and goal, and the specific formula is as follows:
```python
goal_dist = torch.norm(target_pos - object_pos, p=2, dim=-1)
# Orientation alignment for the cube in hand and goal cube
quat_diff = quat_mul(object_rot, quat_conjugate(target_rot)

rot_dist = 2.0 * torch.asin(torch.clamp(torch.norm(quat_diff[:, 0:3], p=2, dim=-1), max=1.0))

dist_rew = goal_dist

reward = torch.exp(-0.2*(dist_rew * dist_reward_scale + rot_dist))
```

### TwoCatchUnderarm Environments

This environment is similar to Catch Underarm, but with an object in each hand and the corresponding goal on the other hand. Therefore, the environment requires two objects to be thrown into the other hand at the same time, which requires a higher manipulation technique than the environment of a single object. To use the HandCatchUnderarm environment, pass `--task=ShadowHandTwoCatchUnderarm`

#### Observation Space

| Index | Description |
|  :----:


& 18 x_2 y_3
\end{array}
\]

That is... unwieldy. So, we note that there are a lot of terms that involve multiplications involving x1, y1, and y4, which would all disappear if we axis-align our curve, which is why aligning is a great idea.

</div>

Aligning our curve so that three of the eight coefficients become zero, and observing that scale does not affect finding `t` values, we end up with the following simple term function for *C(t)*:

\[
  \left ( 3 x_3 y_2+2 x_4 y_2+3 x_2 y_3-x_4 y_3 \right ) t^2 + \left ( 3 x_3 y_2-x_4 y_2-3 x_2 y_3 \right ) t + \left ( x_2 y_3-x_3 y_2 \right )
\]

That's a lot easier to work with: we see a fair number of terms that we can compute and then cache, giving us the following simplification:

\[
  \left.\begin{matrix}
    a = x_3 \cdot y_2 \\
    b = x_4 \cdot y_2 \\
    c = x_2 \cdot y_3 \\
    d = x_4 \cdot y_3
  \end{matrix}\right\}
  ~C(t) = (-3a + 2b + 3c - d)t^2 + (3a - b - 3c)t + (c - a)
\]

This is a plain quadratic curve, and we know how to solve *C(t) = 0*; we use the quadratic formula:

\[
  \left.\begin{matrix}
    x =& -3a + 2b + 3c - d \\
    y =& 3a - b - 3c \\
    z =& c - a
  \end{matrix}\right\}
  ~C(t) = 0 ~\Rightarrow~t = \frac{-y \pm \sqrt{y^2 - 4 x z}}{2x}
\]

We can easily compute this value *if* the discriminator isn't a negative number (because we only want real roots, not complex roots), and *if* *x* is not zero, because divisions by zero are rather useless.

Taking that into account, we compute *t*, we disregard any *t* value that isn't in the Bézier interval [0,1], and we now know at which *t* value(s) our curve will inflect.

<graphics-element title="Finding cubic Bézier curve inflections" src="./inflection.js"></graphics-element>
# Smallweb

Smallweb is a new take on self-hosting. The goal is to make it as easy as possible to host your own apps. To achieve this, it uses a "file-based hosting" approach: every subfolder in your smallweb folder becomes a unique subdomain.

Smallweb is obsessed with scaling down. No dev server or a build is required, and you don't even need to care about deployment. You can just write a single file, hit save, and voila! Your app is live.

## Example

Let's say I want to self-host my own drawing app.

First, I'll create a folder for my app:

```ts
mkdir -p ~/smallweb/draw
```

Then, I'll create a `main.ts` file in that folder:

```ts
// ~/smallweb/draw/main.ts
import { Excalidraw } from "jsr:@smallweb/excalidraw@0.9.1";

const excalidraw = new Excalidraw({
    rootDir: "./data"
});

export default excalidraw;
```

And voila! No need to run a single command, your website is already available at `https://draw.<your-domain>`! And each time the drawing is modified, it get automatically persited to `~/smallweb/draw/data/drawing.json`.

Tired of it ? Just run `rm -rf ~/smallweb/draw` and it's like it never existed.

## Try it out

Leave me a message at [excalidraw.smallweb.club](https://excalidraw.smallweb.club), and then go create your own website from [vscode.smallweb.club](https://vscode.smallweb.club)! Also feel free to join our [discord](https://discord.smallweb.run) to ask a


   @Override
    protected void run(ChannelHandlerContext ctx) {

        long nextDelay = allIdleTimeNanos;
        if (!reading) {
            nextDelay -= ticksInNanos() - Math.max(lastReadTime, lastWriteTime);
        }
        if (nextDelay <= 0) {
            // Both reader and writer are idle - set a new timeout and
            // notify the callback.
            allIdleTimeout = schedule(ctx, this, allIdleTimeNanos, TimeUnit.NANOSECONDS);

            boolean first = firstAllIdleEvent;
            firstAllIdleEvent = false;

            try {
                if (hasOutputChanged(ctx, first)) {
                    return;
                }

                IdleStateEvent event = newIdleStateEvent(IdleState.ALL_IDLE, first);
                channelIdle(ctx, event);
            } catch (Throwable t) {
                ctx.fireExceptionCaught(t);
            }
        } else {
            // Either read or write occurred before the timeout - set a new
            // timeout with shorter delay.
            allIdleTimeout = schedule(ctx, this, nextDelay, TimeUnit.NANOSECONDS);
        }
    }
}
```

**解读：**

1)表示这个监控着所有的事件。当读写事件发生时，都会记录。代码逻和写事件的的基本一致

2)需要大家注意的地方是
long nextDelay = allldleTimeNanos:
if(reading){
  //当前时间减去 最后一次写或读 的时间。若大于0，说明超时了
  nextDelay = ticksInNanos() - Math max(lastReadTime, lastWriteTime);

}

3)这里的时间计算是取读写事件中的最大值来的。然后像写事件一样，判断是否发生了写的慢的情况

### 小结 Netty 的心跳机制

1）IdleStateHandler 可以实现心跳功能，当服务器和客户端没有任何读写交互时，并超过了给定的时间，则会触发用户 handler 的 userEventTriggered 方法。用户可以在这个方法中尝试向对方发送信息，如果发送失败，则关闭连接。

2）IdleStateHandler 的实现基于 EventLoop 的定时任务，每次读写都会记录一个值，在定时任务运行的时候,通过计算当前时间和设置时间和上次事件发生时间的结果，来判断是否空闲。

3）内部有 3个定时任务，分别对应读事件，写事件，读写事件。通常用户监听该写事件就足够了。

4）同时，IdleStateHandler 内部也考虑了一些极端情况，客户端接收缓慢，一次接收数据的速度超过了设置的空闲时间。Netty 通过构造方法中的 observeOutput 属性来决定是否对出站缓冲区的情况进行判断。

5）如果出站缓慢，Netty 不认为这是空闲，也就不触发空闲事件。但第一次无论如何也是要触发的。因为第一次无法判断是出站缓慢还是空闲。当然，出站缓慢的话，可能造成OOM，OOM 比空闲的问题更大。

6）所以，当你的应用出现了内存溢出，OOM之类，并且写空闲极少发生(使用了observeOutput 为 true) 那么就需要往意是不是数据出站速度过慢。

7）还有一个注意的地方:就是 ReadTimeoutHandler ，它继承自 IdleStateHandler，当触发读空�


htmltext = event;
               break;
            case "30515-02.htm":
               giveItems(player, 2895, 1L);
               htmltext = event;
               break;
            case "30630-04.htm":
               giveItems(player, 2883, 1L);
               htmltext = event;
               break;
            case "30649-03.htm":
               if (hasQuestItems(player, 2912)) {
                  this.giveAdena(player, 161806L, true);
                  giveItems(player, 2879, 1L);
                  addExpAndSp(player, 894888L, 61408);
                  qs.exitQuest(false, true);
                  player.sendPacket(new SocialAction(player.getObjectId(), 3));
                  htmltext = event;
               }
               break;
            case "30682-02.htm":
               giveItems(player, 2888, 1L);
               htmltext = event;
         }

         return htmltext;
      }
   }

   @Override
   public String onKill(Npc npc, Player killer, boolean isSummon) {
      QuestState qs = this.getQuestState(killer, false);
      if (qs != null && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true)) {
         switch(npc.getId()) {
            case 20089:
            case 20090:
               if (hasQuestItems(killer, new int[]{2902, 2904})) {
                  int i0 = getRandom(100);
                  if (i0 > 65) {
                     if (!hasQuestItems(killer, 2909)) {
                        giveItems(killer, 2909, 1L);
                        playSound(killer, Quest.QuestSound.ITEMSOUND_QUEST_MIDDLE);
                     } else if (!hasQuestItems(killer, 2908)) {
                        giveItems(killer, 2908, 1L);
                        playSound(killer, Quest.QuestSound.ITEMSOUND_QUEST_MIDDLE);
                     }
                  } else if (i0 > 30) {
                     if (!hasQuestItems(killer, 2907)) {
                        giveItems(killer, 2907, 1L);
                        playSound(killer, Quest.QuestSound.ITEMSOUND_QUEST_MIDDLE);
                     } else if (!hasQuestItems(killer, 2906)) {
                        giveItems(killer, 2906, 1L);
                        playSound(killer, Quest.QuestSound.ITEMSOUND_QUEST_MIDDLE);
                     }
                  } else if (i0 > 0 && !hasQuestItems(killer, 2905)) {
                     giveItems(killer, 2905, 1L);
                     playSound(killer, Quest.QuestSound.ITEMSOUND_QUEST_MIDDLE);
                  }
               }
               break;
            case 20158:
               if (hasQuestItems(killer, 2895)) {
                  if (!hasQuestItems(killer, 2897)) {
                     giveItems(killer, 2897, 1L);
                     playSound(killer, Quest.QuestSound.ITEMSOUND_QUEST_MIDDLE);
                  } else if (!hasQuestItems(killer, 2898)) {
                     giveItems(killer, 2898, 1L);
                     playSound(killer, Quest.QuestSound.ITEMSOUND_QUEST_MIDDLE);
                  } else if (!hasQuestItems(killer, 2899)) {
                     giveItems(killer, 2899, 1L);
                     playSound(killer, Quest.QuestSound.ITEMSOUND_QUEST_MIDDLE);
                  } else if (!hasQuestItems(killer, 2900)) {
                     giveItems(killer, 2900, 1L);
                     playSound(killer, Quest.QuestSound.ITEMSOUND_QUEST_MIDDLE);
                  }
               }
               break;
            case 20213:
               if (hasQuestItems(killer, 2883)) {
                  giveItemRandomly(


vSQrb2omhAgKBrkPoCGEcNQICEekk30pkQzmkD6f+YN4EoAbeBAUiYcVnzGEAgFYDA0AEbjJftRNDXCx+AA9sp37UTQgQFA1yH0BDACyMoHy//J0AGBAQj0Cm+hMYAIBIA4PABmtznaiaEAga5Drhf/AABmvHfaiaEAQa5DrhY/AAG7SB/oA1NQi+QAFyMoHFcv/ydB3dIAYyMsFywIizxZQBfoCFMtrEszMyXP7AMhAFIEBCPRR8qcCAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAAr0AMntVA==';
  static const String v5R1State =
      'te6cckECFAEAAoEAART/APSkE/S88sgLAQIBIAINAgFIAwQC3NAg10nBIJFbj2Mg1wsfIIIQZXh0br0hghBzaW50vbCSXwPgghBleHRuuo60gCDXIQHQdNch+kAw+kT4KPpEMFi9kVvg7UTQgQFB1yH0BYMH9A5voTGRMOGAQNchcH/bPOAxINdJgQKAuZEw4HDiEA8CASAFDAIBIAYJAgFuBwgAGa3OdqJoQCDrkOuF/8AAGa8d9qJoQBDrkOuFj8ACAUgKCwAXsyX7UTQcdch1wsfgABGyYvtRNDXCgCAAGb5fD2omhAgKDrkPoCwBAvIOAR4g1wsfghBzaWduuvLgin8PAeaO8O2i7fshgwjXIgKDCNcjIIAg1yHTH9Mf0x/tRNDSANMfINMf0//XCgAK+QFAzPkQmiiUXwrbMeHywIffArNQB7Dy0IRRJbry4IVQNrry4Ib4I7vy0IgikvgA3gGkf8jKAMsfAc8Wye1UIJL4D95w2zzYEAP27aLt+wL0BCFukmwhjkwCIdc5MHCUIccAs44tAdcoIHYeQ2wg10nACPLgkyDXSsAC8uCTINcdBscSwgBSMLDy0InXTNc5MAGk6GwShAe78uCT10rAAPLgk+1V4tIAAcAAkVvg69csCBQgkXCWAdcsCBwS4lIQseMPINdKERITAJYB+kAB+kT4KPpEMFi68uCR7UTQgQFB1xj0BQSdf8jKAEAEgwf0U/Lgi44UA4MH9Fvy4Iwi1woAIW4Bs7Dy0JDiyFADzxYS9ADJ7VQAcjDXLAgkji0h8uCS0gDtRNDSAFETuvLQj1RQMJExnAGBAUDXIdcKAPLgjuLIygBYzxbJ7VST8sCN4gAQk1vbMeHXTNC01sNe';
  static const int defaultSubWalletId = 698983191;
}
import 'package:ton_dart/src/address/address.dart';
import 'package:ton_dart/src/boc/boc.dart';
import 'package:ton_dart/src/contracts/token/metadata/constant/constant.dart';
import 'package:ton_dart/src/serialization/serialization.dart';

class NFTItemData with JsonSerialization {
  final bool init;
  final BigInt index;
  final TonAddress? collectionAddress;
  final TonAddress? ownerAddress;
  final Cell? content;

  const NFTItemData(
      {required this.init,
      required this.index,
      this.collectionAddress,
      this.ownerAddress,
      this.content});

  String? parseUri() {
    if (!init) return null;
    final contentSlice = content!.beginParse();
    String? nftUri;
    try {
      /// collection-less metadata
      if (collectionAddress == null) {
        if (contentSlice.preloadUint(8) ==
            TonMetadataConstant.ftMetadataOffChainTag) {
          contentSlice.loadUint8();
          nftUri = contentSlice.loadStringTail();
        }
      } else {
        nftUri = contentSlice.loadStringTail();
      }
    } catch (e) {
      re


LET_SYSTEM_PODS_ARGS variable.
Based on your system, restart the kubelet service. For example,
systemctl daemon-reload
systemctl restart kubelet.service
Not Applicable.

### 4.2.8 Ensure that the eventRecordQPS argument is set to a level which ensures appropriate event capture (Manual)

**Result:** pass

**Remediation:**
If using a Kubelet config file, edit the file to set `eventRecordQPS` to an appropriate level.
If using command line arguments, edit the kubelet service file
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and
set the below parameter in KUBELET_SYSTEM_PODS_ARGS variable.
Based on your system, restart the kubelet service. For example,
systemctl daemon-reload
systemctl restart kubelet.service

**Audit:**

```bash
/bin/ps -fC kubelet
```

**Audit Config:**

```bash
/bin/cat /var/lib/rancher/rke2/agent/kubelet.kubeconfig
```

**Expected Result**:

```console
'{.eventRecordQPS}' is present OR '{.eventRecordQPS}' is not present
```

**Returned Value**:

```console
apiVersion: v1 clusters: - cluster: server: https://127.0.0.1:6443 certificate-authority: /var/lib/rancher/rke2/agent/server-ca.crt name: local contexts: - context: cluster: local namespace: default user: user name: Default current-context: Default kind: Config preferences: {} users: - name: user user: client-certificate: /var/lib/rancher/rke2/agent/client-kubelet.crt client-key: /var/lib/rancher/rke2/agent/client-kubelet.key
```

### 4.2.9 Ensure that the --tls-cert-file and --tls-private-key-file arguments are set as appropriate (Manual)

**Result:** pass

**Remediation:**
If using a Kubelet config file, edit the file to set `tlsCertFile` to the location
of the certificate file to use to identify this Kubelet, and `tlsPrivateKeyFile`
to the location of the corresponding private key file.
If using command line arguments, edit the kubelet service file
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and
set the below parameters in KUBELET_CERTIFICATE_ARGS variable.
--tls-cert-file=<path/to/tls-certificate-file\>
--tls-private-key-file=<path/to/tls-key-file\>
Based on your system, restart the kubelet service. For example,
systemctl daemon-reload
systemctl restart kubelet.service

**Audit:**

```bash
/bin/ps -fC kubelet
```

**Audit Config:**

```bash
/bin/cat /var/lib/rancher/rke2/agent/kubelet.kubeconfig
```

**Expected Result**:

```console
'--tls-cert-file' is present AND '--tls-private-key-file' is present
```

**Returned Value**:

```console
UID PID PPID C STIME TTY TIME CMD root 2236 2075 4 Sep11 ? 00:47:51 kubelet --volume-plugin-dir=/var/lib/kubelet/volumeplugins --file-check-frequency=5s --sync-frequency=30s --address=0.0.0.0 --alsologtostderr=false --anonymous-auth=false --authentication-token-webhook=true --authorization-mode=Webhook --cgroup-driver=systemd --client-ca-file=/var/lib/rancher/rke2/agent/client-ca.crt --cloud-provider=external --cluster-dns=10.43.0.10 --cluster-domain=cluster.local --container-runtime-endpoint=unix


ABLE WHERE brand =:brand")
    fun getGifticonByBrand(brand: String): Flow<List<GifticonEntity>>

    @Query(
        "SELECT EXISTS (SELECT * FROM $GIFTICON_TABLE " +
            "WHERE expire_at >= :time AND is_used = 0 AND user_id = :userId)",
    )
    fun hasUsableGifticon(userId: String, time: Date): Flow<Boolean>

    @Query("SELECT EXISTS(SELECT 1 from $GIFTICON_TABLE WHERE LOWER(brand)=LOWER(:brand) LIMIT 1)")
    suspend fun hasGifticonBrand(brand: String): Boolean

    @Query("UPDATE $GIFTICON_TABLE SET user_id = :newUserId WHERE user_id = :oldUserId")
    suspend fun moveUserIdGifticon(oldUserId: String, newUserId: String)

    /**
     * 오늘 날짜를 기준으로 사용 가능한 기프티콘의 브랜드명 갖고 오기
     */
    @Query(
        "SELECT DISTINCT brand FROM $GIFTICON_TABLE " +
            "WHERE user_id = :userId AND expire_at >= :time AND is_used = 0",
    )
    fun getGifticonBrands(userId: String, time: Date): Flow<List<String>>

    /**
     * 사용 가능한 기프티콘 중에서 count 만큼만 갖고 오기
     */
    @Query(
        "SELECT * FROM $GIFTICON_TABLE " +
            "WHERE user_id = :userId AND expire_at >= :time AND is_used = 0 " +
            "ORDER BY expire_at " +
            "LIMIT :count",
    )
    fun getSomeGifticons(userId: String, time: Date, count: Int): Flow<List<GifticonEntity>>
}
package com.stop.ui.routedetail

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.databinding.ViewDataBinding
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import com.stop.databinding.ItemRouteFirstBinding
import com.stop.databinding.ItemRouteLastBinding
import com.stop.databinding.ItemRoutePathBinding
import com.stop.model.route.RouteItem
import com.stop.model.route.RouteItemType

class RouteDetailAdapter(
    private val onRouteItemClickListener: OnRouteItemClickListener
) : ListAdapter<RouteItem, RecyclerView.ViewHolder>(diffUtil) {

    class FirstViewHolder(
        private val binding: ItemRouteFirstBinding
    ) : RecyclerView.ViewHolder(binding.root) {
        fun bind(routeItem: RouteItem) {
            binding.routeItem = routeItem
            binding.executePendingBindings()
        }
    }

    class PathViewHolder(
        private val binding: ItemRoutePathBinding
    ) : RecyclerView.ViewHolder(binding.root) {
        fun bind(routeItem: RouteItem) {
            binding.routeItem = routeItem
            binding.executePendingBindings()
        }
    }

    class LastViewHolder(
        private val binding: ItemRouteLastBinding
    ) : RecyclerView.ViewHolder(binding.root) {
        fun bind(routeItem: RouteItem) {
            binding.routeItem = routeItem
            binding.executePendingBindings()
        }
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
        val binding: ViewDataBinding
        val inflater = LayoutInflater.from(parent.context)
        val viewHolder: RecyclerView.ViewHolder = when (view


�이며, 기본 액세스 방법을 다른 Python 순서 객체 시퀀스(목록 및 튜플)와 공유합니다. 문자열(및 모든 시퀀스의 개별 멤버)에서 단일 문자를 추출하는 가장 간단한 방법은 해당 변수로 압축을 푸는 것입니다.

#### 언패킹 문자

```
language = 'Python'
a,b,c,d,e,f = language # unpacking sequence characters into variables
print(a) # P
print(b) # y
print(c) # t
print(d) # h
print(e) # o
print(f) # n
```

#### 인덱스로 문자열의 문자에 액세스

프로그래밍에서 카운팅은 0부터 시작합니다. 따라서 문자열의 첫 번째 문자는 인덱스가 0이고 문자열의 마지막 문자는 문자열의 길이에서 1을 뺀 값입니다.

![String index](../images/string_index.png)

```py
language = 'Python'
first_letter = language[0]
print(first_letter) # P
second_letter = language[1]
print(second_letter) # y
last_index = len(language) - 1
last_letter = language[last_index]
print(last_letter) # n
```

오른쪽 끝에서 시작하려면 음수 인덱싱을 사용할 수 있습니다. -1은 마지막 인덱스입니다.

```py
language = 'Python'
last_letter = language[-1]
print(last_letter) # n
second_last = language[-2]
print(second_last) # o
```

#### 파이썬 문자열 슬라이싱

파이썬에서는 문자열을 하위 문자열로 슬라이스할 수 있습니다.

```py
language = 'Python'
first_three = language[0:3] # starts at zero index and up to 3 but not include 3
print(first_three) #Pyt
last_three = language[3:6]
print(last_three) # hon
# Another way
last_three = language[-3:]
print(last_three)   # hon
last_three = language[3:]
print(last_three)   # hon
```

#### 문자열 리버스

파이썬에서 문자열을 쉽게 뒤집을 수 있습니다.

```py
greeting = 'Hello, World!'
print(greeting[::-1]) # !dlroW ,olleH
```

#### 슬라이싱하는 동안 문자 건너뛰기

슬라이스 메소드에 단계 인수를 전달하여 슬라이스하는 동안 문자를 건너뛸 수 있습니다.

```py
language = 'Python'
pto = language[0:6:2] #
print(pto) # Pt


ui-buttonWidget" data-ooui='{"_":"OO.ui.ButtonWidget","rel":["nofollow"],"framed":false,"icon":"share","label":"(discussiontools-replybutton)","flags":["progressive"],"classes":["ext-discussiontools-init-replybutton"]}'>(discussiontools-replybutton)

No, it is not possible to have both the 2010 and 2006 toolbar. You could however ask for an script that adds the missing buttons to the 2010 toolbar, which would be the hidden comment, quote and horizontal line.--Snaevar (talk) 16:53, 3 July 2019 (UTC)(discussiontools-replybutton)

That's


())));
	GULPS_CHECK_AND_ASSERT_THROW_MES(!(e == rct::identity()), "Exponent is point at infinity");
	return e;
}

multiexp_cache::multiexp_cache()
{
	std::vector<MultiexpData> data;
	for(size_t i = 0; i < maxN * maxM; ++i)
	{
		Hi_cache[i] = get_exponent(rct::H, i * 2);
		GULPS_CHECK_AND_ASSERT_THROW_MES(ge_frombytes_vartime(&Hi_p3_cache[i], Hi_cache[i].bytes) == 0, "ge_frombytes_vartime failed");
		Gi_cache[i] = get_exponent(rct::H, i * 2 + 1);
		GULPS_CHECK_AND_ASSERT_THROW_MES(ge_frombytes_vartime(&Gi_p3_cache[i], Gi_cache[i].bytes) == 0, "ge_frombytes_vartime failed");

		data.push_back({rct::zero(), Gi_cache[i]});
		data.push_back({rct::zero(), Hi_cache[i]});
	}

	s_cache.init_cache(data, STRAUS_SIZE_LIMIT);
	p_cache.init_cache(data, 0, false);

	GULPSF_INFO("Hi/Gi cache size: {} kB", (sizeof(Hi_cache) + sizeof(Gi_cache)) / 1024 );
	GULPSF_INFO("Hi_p3/Gi_p3 cache size: {} kB", (sizeof(Hi_p3_cache) + sizeof(Gi_p3_cache)) / 1024 );
	GULPSF_INFO("Straus cache size: {} kB", sizeof(straus_cache) / 1024 );
	GULPSF_INFO("Pippenger cache size: {} kB", sizeof(pippenger_cache) / 1024 );
	size_t cache_size = (sizeof(Hi_cache) + sizeof(Hi_p3_cache)) * 2 + sizeof(straus_cache) + sizeof(pippenger_cache);
	GULPSF_INFO("Total cache size: {}kB", cache_size / 1024 );
}

void straus_cache::init_cache(const std::vector<MultiexpData> &data, size_t N)
{
	MULTIEXP_PERF(PERF_TIMER_START_UNIT(multiples, 1000000));
	if (N == 0)
		N = data.size();
	GULPS_CHECK_AND_ASSERT_THROW_MES(N <= data.size(), "Bad cache base data");
	ge_p1p1 p1;
	ge_p3 p3;

	size = N;
	if(cache == nullptr || alloc_size < N)
	{
		alloc_size = std::max<size_t>(N, 64);
		cache = make_aligned_array<ge_cached_pad>(4096, ((1<<STRAUS_C)-1) * alloc_size);
	}

	for (size_t j=0;j<N;++j)
	{
		ge_p3_to_cached(st_offset(j, 1), &data[j].point);
		for (size_t i=2;i<1<<STRAUS_C;++i)
		{
			ge_add(&p1, &data[j].point, st_offset(j, i-1));
			ge_p1p1_to_p3(&p3, &p1);
			ge_p3_to_cached(st_offset(j, i), &p3);
		}
	}
	MULTIEXP_PERF(PERF_TIMER_STOP(multiples));
}

rct::key straus_cache::straus(const std::vector<MultiexpData> &data, size_t STEP) const
{
	GULPS_CHECK_AND_ASSERT_THROW_MES(cache != nullptr, "null cache");
	GULPS_CHECK_AND_ASSERT_THROW_MES(cache == NULL || size >= data.size


li>

d

e

f

g

i

m

n

p

r

s

t

u

w

- n -

NAN
: math.h

NONATOMIC_BLOCK
: atomic.h

NONATOMIC_FORCEOFF
: atomic.h

NONATOMIC_RESTORESTATE
: atomic.h

Automatically generated by Doxygen 1.5.7 on 6 Nov 2008.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">

<title>AVRDUDE: A.2 Windows</title>

<meta name="description" content="AVRDUDE: A.2 Windows">
<meta name="keywords" content="AVRDUDE: A.2 Windows">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=us-as


 {
        let old_path = envoy::path().unwrap_or_else(|| envoy::Var::from(""));
        let mut new_path = old_path.split();

        for remove_path in env_paths()? {
            new_path = new_path.remove(remove_path);
        }

        new_path
            .prefix(self.bins()?)
            .join()
            .with_context(build_path_error)
    }

    /// Determines the sourced version of npm that will be available, resolving the version bundled with Node, if needed
    pub fn resolve_npm(&self) -> Fallible<Sourced<Version>> {
        match &self.npm {
            Some(npm) => Ok(npm.clone()),
            None => load_default_npm_version(&self.node.value).map(|npm| Sourced {
                value: npm,
                source: self.node.source,
            }),
        }
    }
}
<gh_stars>1-10
use std::time::Instant;
use std::sync::{RwLock, Mutex, Arc};
use std::sync::atomic::{AtomicBool, Ordering};
use std::collections::HashMap;
use std::sync::mpsc::{Sender, Receiver};

use packet::{Packet, encode_payload, Payload, ID};

#[derive(Clone)]
#[doc(hidden)]
pub enum Transport {
    Polling(Sender<Packet>, Arc<Mutex<Receiver<Packet>>>),
}

#[derive(Clone)]
pub struct Socket {
    transport: Transport,
    sid: Arc<String>,
    last_pong: Arc<RwLock<Instant>>,
    last_ping: Arc<RwLock<Instant>>,
    closed: Arc<AtomicBool>,
    b64: bool,
    xhr2: bool,
    jsonp: Option<i32>,
    client_map: Arc<RwLock<HashMap<Arc<String>, Socket>>>,
    on_close: Arc<RwLock<Option<Box<Fn(&str) + 'static>>>>,
    on_message: Arc<RwLock<Option<Box<Fn(&[u8]) + 'static>>>>,
    on_packet: Arc<RwLock<Option<Box<Fn(Packet) + 'static>>>>,
    on_flush: Arc<RwLock<Option<Box<Fn(&[Packet]) + 'static>>>>,
}

unsafe impl Send for Socket {}
unsafe impl Sync for Socket {}

impl Socket {
    #[doc(hidden)]
    pub fn new(sid: Arc<String>,
               transport: Transport,
               client_map: Arc<RwLock<HashMap<Arc<String>, Socket>>>,
               b64: bool,
               jsonp: Option<i32>)
               -> Socket {
        Socket {
            transport: transport,
            sid: sid,
            last_pong: Arc::new(RwLock::new(Instant::now())),
            last_ping: Arc::new(RwLock::new(Instant::now())),
            closed: Arc::new(AtomicBool::new(false)),
            b64: b64,
            jsonp: jsonp,
            xhr2: !b64,
            client_map: client_map,
            on_close: Arc::new(RwLock::new(None)),
            on_message: Arc::new(RwLock::new(None)),
            on_packet: Arc::new(RwLock::new(None)),
            on_flush: Arc::new(RwLock::new(None)),
        }
    }

    pub fn id(&self) -> String {
        self.sid.clone().as_str().to_string()
    }

    #[doc(hidden)]
    pub fn reset_timeout(&self) {
        *self.last_pong.write().unwrap() = Instant::now();
    }

    #[doc(hidden)]
    pub fn reset_last_ping(&self) {
        let data = self.last_ping.clone();
        let mut instant = data.write().unwrap();
        *instant = Instant::now


 praia por 2 horas e ao sair o valor deve ser 10 reais, 5 reais por hora", function () {
	const parkingLot = new ParkingLot("beach", 500);
	parkingLot.checkin("AAA-1111", new Date("2021-10-01T10:00"));
	parkingLot.checkout("AAA-1111", new Date("2021-10-01T12:00"));
	const ticket = parkingLot.getTicket("AAA-1111");
	expect(ticket.price).toBe(10);
});

test("Deve estacionar o carro no shopping por 7 horas e ao sair o valor deve ser 22 reais, 10 reais as primeiras 3 horas e depois 3 reais por hora", function () {
	const parkingLot = new ParkingLot("shopping", 500);
	parkingLot.checkin("AAA-1111", new Date("2021-10-01T10:00"));
	parkingLot.checkout("AAA-1111", new Date("2021-10-01T17:00"));
	const ticket = parkingLot.getTicket("AAA-1111");
	expect(ticket.price).toBe(22);
});

test("Deve estacionar o carro no aeroporto por 3 dias e ao sair o valor deve ser 150 reais, 50 reais por dia", function () {
	const parkingLot = new ParkingLot("airport", 500);
	parkingLot.checkin("AAA-1111", new Date("2021-10-01T10:00"));
	parkingLot.checkout("AAA-1111", new Date("2021-10-04T10:00"));
	const ticket = parkingLot.getTicket("AAA-1111");
	expect(ticket.price).toBe(150);
});
import { Pipe, PipeTransform } from '@angular/core';
/**
 *  推荐度管道，转换推荐度
 */
@Pipe({
  name: 'recommendedPercent'
})
export class RecommendedPercentPipe implements PipeTransform {

  transform(value: string,  index?: any): any {
    value = ""+value;
    if(value.length==1){
      return value
    }
   return value.substring(index,index+1);
  }

}
import 'mocha'
import assert = require('assert')
import {tuple, TupleItem} from '../lib'

const floatBytes = (x: number) => {
  const result = Buffer.alloc(4)
  result.writeFloatBE(x, 0)
  return result
}

describe('tuple', () => {
  const assertRoundTrip = (val: TupleItem, strict: boolean = false) => {
    const packed = tuple.pack([val])
    const unpacked = tuple.unpack(packed, strict)[0]
    assert.deepStrictEqual(unpacked, val)
  }
  const assertRoundTripBytes = (orig: Buffer, strict: boolean = false) => {
    const val = tuple.unpack(orig, strict)[0] as TupleItem
    const packed = tuple.pack([val])
    // console.log(orig.toString('hex'), val, packed.toString('hex'))
    assert.deepStrictEqual(packed, orig)
  }

  it('roundtrips expected values', () => {
    const data = ['hi', null, '👾', 321, 0, -100]
    assertRoundTrip(data)

    assertRoundTrip(0.75)
    assertRoundTrip({type: 'float', value: 0.5, rawEncoding:floatBytes(0.5)}, true)
  })

  it('preserves encoding of values in strict mode', () => {
    // There's a few ways NaN is encoded.
    assertRoundTripBytes(Buffer.from('210007ffffffffffff', 'hex'), true) // double
    assertRoundTripBytes(Buffer.from('21fff8000000000000', 'hex'), true)
    assertRoundTripBytes(Buffer.from('20ffc00000', 'hex'), true) // TODO:
    assertRoundTripBytes(Buffer.from('20003fffff', 'hex'), true)
    // Do a


 "新月法杖",
[6506] = "步兵战靴",
[6507] = "步兵护腕",
[6508] = "步兵披风",
[6509] = "步兵腰带",
[6510] = "步兵护手",
[6511] = "旅者长袍",
[6512] = "信徒长袍",
[6513] = "信徒腰带",
[6514] = "信徒披风",
[6515] = "信徒手套",
[6516] = "小鬼召唤",
[6517] = "先锋腰带",
[6518] = "先锋战靴",
[6519] = "先锋护腕",
[6520] = "先锋披风",
[6521] = "先锋手套",
[6522] = "变异鱼",
[6523] = "铁扣背心",
[6524] = "钉甲皮背心",
[6525] = "步兵背心",
[6526] = "军用背心",
[6527] = "先祖长袍",
[6528] = "法师长袍",
[6529] = "闪光的小珠",
[6530] = "夜色虫",
[6531] = "布质符文长袍",
[6532] = "明亮的小珠",
[6533] = "水下诱鱼器",
[6534] = "锻造好的钢锭",
[6535] = "维尔加石板",
[6536] = "柳木外衣",
[6537] = "柳木战靴",
[6538] = "柳木长袍",
[6539] = "柳木腰带",
[6540] = "柳木短裤",
[6541] = "柳木手套",
[6542] = "柳木斗篷",
[6543] = "柳木护腕",
[6544] = "虚空行者召唤卷轴",
[6545] = "士兵护甲",
[6546] = "士兵护腿",
[6547] = "士兵护手",
[6548] = "士兵束带",
[6549] = "士兵披风",
[6550] = "士兵腕甲",
[6551] = "士兵战靴",
[6552] = "吟游诗人外套",
[6553] = "吟游诗人短裤",
[6554] = "吟游诗人手套",
[6555] = "吟游诗人披风",
[6556] = "吟游诗人护腕",
[6557] = "吟游诗人之靴",
[6558] = "吟游诗人腰带",
[6559] = "吟游诗人圆盾",
[6560] = "士兵之盾",
[6561] = "先知钉甲",
[6562] = "幻光战靴",
[6563] = "幻光护腕",
[6564] = "幻光披风


 invert(k, v)
            end
            return cval
        elseif type(cval) == "string" and cval ~= "none" then
            local hsl = hsluv.hex_to_hsluv(cval)

            if cname:find("bg$") and hsl[3] < 50 then
                hsl[3] = 98 - hsl[3]
                hsl[3] = hsl[3] + (98 - hsl[3]) * brightness_coeff
            else
                -- increase saturation
                hsl[2] = hsl[2] + (100 - hsl[2]) * saturation_coeff
                hsl[3] = 100 - hsl[3]
                if hsl[3] < 50 then
                    -- increase brightness
                    hsl[3] = hsl[3] + (100 - hsl[3]) * brightness_coeff
                end
            end
            return hsluv.hsluv_to_hex(hsl)
        end
    end

    for k, v in pairs(colors) do
        colors[k] = invert(k, v)
    end
    -- alt_bg is always darker than bg, therefore inverting means we need to swap
    -- afterwards
    colors["bg"], colors["alt_bg"] = colors["alt_bg"], colors["bg"]
    return colors
end

---Generates a template from a string containing variables of the form $VAR, and a table
---of corresponding replacement variables.
---
---SOURCE: https://github.com/folke/tokyonight.nvim/blob/main/lua/tokyonight/util.lua
---@param str string template string
---@param table table key value pairs to replace in the string
---@return string
function M.template(str, table)
    return (
        str:gsub("($%b{})", function(w)
            return vim.tbl_get(
                table,
                unpack(vim.split(w:sub(3, -2), ".", { plain = true }))
            ) or w
        end)
    )
end

return M


l::f32(value as f32),
                FloatSuffix::F64 => Literal::f64(value),
                FloatSuffix::None => Literal::float(value),
            },
            span: span,
        }
    }

    pub fn value(&self) -> f64 {
        value::parse_lit_float(&self.token.to_string())
    }

    pub fn suffix(&self) -> FloatSuffix {
        let value = self.token.to_string();
        for (s, suffix) in vec![("f32", FloatSuffix::F32), ("f64", FloatSuffix::F64)] {
            if value.ends_with(s) {
                return suffix;
            }
        }
        FloatSuffix::None
    }
}

macro_rules! lit_extra_traits {
    ($ty:ident, $field:ident) => {
        #[cfg(feature = "extra-traits")]
        impl Eq for $ty {}

        #[cfg(feature = "extra-traits")]
        impl PartialEq for $ty {
            fn eq(&self, other: &Self) -> bool {
                self.$field.to_string() == other.$field.to_string()
            }
        }

        #[cfg(feature = "extra-traits")]
        impl Hash for $ty {
            fn hash<H>(&self, state: &mut H)
            where
                H: Hasher,
            {
                self.$field.to_string().hash(state);
            }
        }
    }
}

lit_extra_traits!(LitStr, token);
lit_extra_traits!(LitByteStr, token);
lit_extra_traits!(LitByte, token);
lit_extra_traits!(LitChar, token);
lit_extra_traits!(LitInt, token);
lit_extra_traits!(LitFloat, token);
lit_extra_traits!(LitBool, value);
lit_extra_traits!(LitVerbatim, token);

ast_enum! {
    /// The style of a string literal, either plain quoted or a raw string like
    /// `r##"data"##`.
    ///
    /// *This type is available if Syn is built with the `"derive"` or `"full"`
    /// feature.*
    pub enum StrStyle #no_visit {
        /// An ordinary string like `"data"`.
        Cooked,
        /// A raw string like `r##"data"##`.
        ///
        /// The unsigned integer is the number of `#` symbols used.
        Raw(usize),
    }
}

ast_enum! {
    /// The suffix on an integer literal if any, like the `u8` in `127u8`.
    ///
    /// *This type is available if Syn is built with the `"derive"` or `"full"`
    /// feature.*
    pub enum IntSuffix #no_visit {
        I8,
        I16,
        I32,
        I64,
        I128,
        Isize,
        U8,
        U16,
        U32,
        U64,
        U128,
        Usize,
        None,
    }
}

ast_enum! {
    /// The suffix on a floating point literal if any, like the `f32` in
    /// `1.0f32`.
    ///
    /// *This type is available if Syn is built with the `"derive"` or `"full"`
    /// feature.*
    pub enum FloatSuffix #no_visit {
        F32,
        F64,
        None,
    }
}

#[cfg(feature = "parsing")]
pub mod parsing {
    use super::*;
    use synom::Synom;
    use buffer::Cursor;
    use parse_error;
    use synom::PResult;

    impl Synom for Lit {
        fn parse(input: Cursor) -> PResult<Self> {
            match input.literal() {
                Some((span, lit, rest)) => {
                    if lit.to_string().starts_with('/') {
                        // Doc comment literal which is not a Syn literal
                        parse_error()
                    } else {


500;
      padding: 0;
      font-weight: normal;
      font-style: normal;
      margin-top: -10px;
      margin-bottom: 20px;
    }

    input[type='text'],
    input[type='email'],
    input[type='password'],
    input[type='text']:hover,
    input[type='password']:hover {
      padding: 1px 10px 1px 19px;
      box-sizing: border-box;
      border: none;
      box-shadow: none;
      background: @cui-white;
      height: 44px;
      font-size: 14px;
      color: @cui-gray-800;
      font-weight: 400;
      resize: none;
      margin: 0;
      width: 100%;
    }

    input[type='submit'] {
      height: 45px;
      min-height: 45px;
      font-weight: normal;
      text-shadow: none;
      margin-left: 0;
      border-radius: 3px;
      font-size: 16px;
      margin-bottom: 55px;
    }
  }

  h4 {
    text-align: center;
    margin-bottom: 20px;
  }
}

input[type='password']::-ms-reveal {
  display: none;
}

.tooltip {
  z-index: 10000;
}

.trademark {
  .flex(0 1 auto);

  margin-left: auto;
  margin-right: auto;
  padding-bottom: 10px;
}

.svg-hue-logo-main {
  fill: @hue-primary-color-dark;
}

.svg-hue-logo-trunk {
  fill: @hue-trunk;
}

@-webkit-keyframes autofill {
  to {
    background: transparent;
  }
}

:-webkit-autofill {
  -webkit-animation-name: autofill;
  -webkit-animation-fill-mode: both;
}

:-webkit-autofill,
:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px white inset !important;
}
/*
 Licensed to Cloudera, Inc. under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  Cloudera, Inc. licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

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

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

div.spinedit {
  display: inline-block;
  position: relative;
}

input[type="text"].spinedit {
  width: 35px;
}

div.spinedit .fa-chevron-up,
div.spinedit .fa-chevron-down {
  position: relative;
  cursor: pointer;
  width: 12px;
  left: 8px;
}

div.spinedit .fa-chevron-up {
  top: -12px;
}

div.spinedit .fa-chevron-down {
  top: 3px;
  left: -4px;
}

.form-search div.spinedit, .form-inline div.spinedit, .form-horizontal div.spinedit {
  top: 5px;
}
/*!
Licensed to Cloudera, Inc. under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  Cloudera, Inc. licenses this file
to you under the Apache License, Version