small,
      };
      break;
    case 'hulk':
      buttonSize = {
        height: `${calcRem(90)}`,
        font: `${calcRem(40)}`,
        padding: `${calcRem(0)} ${calcRem(50)}`,
        boxShadow: theme.boxShadow.default,
      };
      break;
    default:
      buttonSize = {
        height: `${calcRem(56)}`,
        font: `${calcRem(24)}`,
        padding: `${calcRem(0)} ${calcRem(36)}`,
        boxShadow: theme.boxShadow.tiny,
      };
      break;
  }
  return buttonSize;
};
import { Point, Matrix } from "./types";

export function distance(pt1: Point, pt2: Point): number {
  return Math.sqrt((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2);
}

export function add(pt1: Point, pt2: Point): Point {
  return [pt1[0] + pt2[0], pt1[1] + pt2[1]];
}

export function sub(pt1: Point, pt2: Point): Point {
  return add(pt1, scalar(pt2, -1));
}

export function scalar(pt: Point, value: number): Point {
  return [pt[0] * value, pt[1] * value];
}

export function normalize(pt: Point): Point {
  const zero: Point = [0, 0];
  const length = distance(zero, pt);

  return scalar(pt, 1 / length);
}

export function floor(pt: Point): Point {
  return pt.map(x => Math.floor(x)) as Point;
}

export function dotProduct(a: Point, b: Point): number {
  return a[0] * b[0] + a[1] * b[1];
}

export function mtxProduct(vector: Point, mtx: Matrix): Point {
  return [dotProduct(vector, mtx[0]), dotProduct(vector, mtx[1])];
}

export function getRadians(degrees: number) {
  return (degrees * Math.PI) / 180;
}

export function getRotationMtx(angle): Matrix {
  const rads = getRadians(angle);
  const { cos, sin } = Math;

  return [[cos(rads), -sin(rads)], [sin(rads), cos(rads)]];
}

function rotate(point: Point, angle: number): Point {
  const rotMtx = getRotationMtx(angle);

  return mtxProduct(point, rotMtx);
}
class Salario {
    hAula: number;
    nAula: number;
    dInss: number;

    constructor(p_hAula: number, p_nAula: number, p_Inss: number) {
        this.hAula = p_hAula;
        this.nAula = p_nAula;
        this.dInss = p_Inss;
    }

    rSalario(): number {
        return (this.hAula * this.nAula) * (1 - (this.dInss/100));
    }
}

let horaA:number = Number(prompt(`Digite o valor hora aula`));
let numeroA:number = Number(prompt(`Digite a Quantidade de Aulas`));
let inss:number = Number(prompt(`Digite valor do INSS`));

let x = new Salario(horaA, numeroA, inss);
alert(`${x.rSalario()}`);
console.log(x.rSalario());import { OperationType } from './document'
import { Field } from './document/field'
import { Dict } from './utils'

/**
 * Collects the fields of a given document.
 */
export class Fields<TypeLock extends Dict> {
  /* State */

  // WIP: Try dictionary structure for fields?
  private fields: Field[]
  private readonly response: Response<TypeLock>

  /* Initializer */

  constructor(data?: TypeLock) {
    // Set selection to none.
    this.fields = []

    // Set response according to the given data.
    if (data) {
      const response = new ResponseData<TypeLock>(data)
      this.response = { type: 'fetched', response }
    } else {
      this


rId string) *PrehireDefaultCostCenterUpdateBuilder {
	builder.costCenterId = costCenterId
	builder.costCenterIdFlag = true
	return builder
}

// 是否继承岗位/部门的默认成本中心
//
// 示例值：false
func (builder *PrehireDefaultCostCenterUpdateBuilder) IsHerit(isHerit bool) *PrehireDefaultCostCenterUpdateBuilder {
	builder.isHerit = isHerit
	builder.isHeritFlag = true
	return builder
}

func (builder *PrehireDefaultCostCenterUpdateBuilder) Build() *PrehireDefaultCostCenterUpdate {
	req := &PrehireDefaultCostCenterUpdate{}
	if builder.costCenterIdFlag {
		req.CostCenterId = &builder.costCenterId

	}
	if builder.isHeritFlag {
		req.IsHerit = &builder.isHerit

	}
	return req
}

type PrehireSeniorityAdjustInformation struct {
	SeniorityAdjustment *float64 `json:"seniority_adjustment,omitempty"` // 调整值;- 精确度：两位小数;- 单位：年;- 自动计算逻辑：如果这个值为空，司龄调整的开始日期和结束日期均不为空，会自动计算出调整值

	SeniorityAdjustmentType *string `json:"seniority_adjustment_type,omitempty"` // 调整类型;- 可通过[【获取字段详情】](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/get_by_param)接口查询，查询参数如下：;  - object_api_name：seniority_adjust_information;  - custom_api_name：seniority_adjustment_type

	ReasonsForSeniorityAdjustment *string `json:"reasons_for_seniority_adjustment,omitempty"` // 司龄调整原因

	StartDate *string `json:"start_date,omitempty"` // 开始日期;- 格式： yyyy-mm-dd

	EndDate *string `json:"end_date,omitempty"` // 结束日期;- 格式： yyyy-mm-dd

	CustomFields []*ObjectFieldData `json:"custom_fields,omitempty"` // 自定义字段
}

type PrehireSeniorityAdjustInformationBuilder struct {
	seniorityAdjustment     float64 // 调整值;- 精确度：两位小数;- 单位：年;- 自动计算逻辑：如果这个值为空，司龄调整的开始日期和结束日期均不为空，会自动计算出调整值
	seniorityAdjustmentFlag bool

	seniorityAdjustmentType     string // 调整类型;- 可通过[【获取字段详情】](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/get_by_param)接口查询，查询参数如下：;  - object_api_name：seniority_adjust_information;  - custom_api_name：seniority_adjustment_type
	seniorityAdjustmentTypeFlag bool

	reasonsForSeniorityAdjustment     string // 司龄调整原因
	reasonsForSeniorityAdjustmentFlag bool

	startDate     string // 开始日期;- 格式： yyyy-mm-dd
	startDateFlag bool

	endDate     string // 结束日期;- 格式： yyyy-mm-dd
	endDateFlag bool

	customFields     []*ObjectFieldData // 自定义字段
	customFieldsFlag bool
}

func NewPrehireSeniorityAdjustInformationBuilder() *PrehireSeniorityAdjustInformationBuilder {
	builder := &PrehireSeniorityAdjustInformationBuilder{}
	return builder
}

// 调整


 需要显示两个相机的版本号
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, textCellHeight);
        if (CameraType.ZENMUSE_XT2 == cameraTypeMap.get(cameraIndex)) {
            if (cameraViews.get(cameraIndex.value()) != null && cameraViews.get(cameraIndex.value() + 1) != null) {
                //倒着清除
                cameraVersionLy.removeView(cameraViews.get(cameraIndex.value() + 1));
                cameraVersionLy.removeView(cameraViews.get(cameraIndex.value()));
            }
            textCells = new TextCell[]{new TextCell(getContext()), new TextCell(getContext())};
            cameraViews.put(cameraIndex.value(), textCells[0]);
            cameraViews.put(cameraIndex.value() + 1, textCells[1]);
            cameraVersionLy.addView(textCells[0], layoutParams);
            cameraVersionLy.addView(textCells[1], layoutParams);
        } else {
            if (cameraViews.get(cameraIndex.value()) != null) {
                cameraVersionLy.removeView(cameraViews.get(cameraIndex.value()));
            }
            textCells = new TextCell[]{new TextCell(getContext())};
            cameraViews.put(cameraIndex.value(), textCells[0]);
            cameraVersionLy.addView(textCells[0], layoutParams);
        }
        if (textCells.length == 1) {
            textCells[0].setContent(version);
            textCells[0].setTitle(getResources().getString(R.string.uxsdk_setting_menu_common_camera_version, cameraName));
        } else {
            //XT2 通过相机1、相机2区分不同相机的版本号
            textCells[0].setContent(version);
            textCells[0].setTitle(getResources().getString(R.string.uxsdk_setting_menu_common_camera_version, cameraName) + "1");
            textCells[1].setContent(getXT2Version(version));
            textCells[1].setTitle(getResources().getString(R.string.uxsdk_setting_menu_common_camera_version, cameraName) + "2");
        }
    }

    /**
     * 获取XT2另一个相机的版本号
     *
     * @param origin 相机版本号
     */
    private String getXT2Version(String origin) {
        int dotIndex = origin.lastIndexOf('.');
        String forthNum = origin.substring(dotIndex + 1);
        String remain = origin.substring(0, dotIndex);
        dotIndex = remain.lastIndexOf('.');
        String thirdNum = remain.substring(dotIndex + 1);
        remain = remain.substring(0, dotIndex);
        int realValue = Integer.parseInt(forthNum) + 100 * Integer.parseInt(thirdNum);
        byte[] bytes = BytesUtil.getBytes(realValue & 0xFFFF);
        return remain + "." + (BytesUtil.getInt(bytes[1]) >= 10 ? "" : "0") + BytesUtil.getInt(bytes[1])
                + "." + (BytesUtil.getInt(bytes[0]) > 10 ? "" : "0") + BytesUtil.getInt(bytes[0]);
    }

    private void updateCameraSerialNumber(TextCell cell, String sn, ComponentIndexType cameraIndex) {
        if (TextUtils.isEmpty(sn)) {
            cell.setVisibility(View.GONE);
            return;
        }
        addDisposable(widgetModel.getCameraName(cameraIndex)
                .subscribe(name -> {
                    cell.setVisibility(View.VISIBLE);
                    cell.setTitle(getResources().getString(R.string.uxsdk_setting_menu_common_camera_version, name)
                            + getResources().getString(R.string.uxsdk_setting_menu_common_serial));
                    cell.setContent(sn);
                }));
    }

    public void updateProductVersion(String version) {
        fcVerCell.setContent(version);
    }

    public void updateFlycSerialNumber(String serialNum) {
        flycSerialCell.setContent(serialNum);
    }

    public void updateRcSerialNumber(String serialNum) {
        rcSerialCell.setContent(serialNum);
    }


 action::*;
pub use memory::*;
pub use processor::*;
pub use program::*;

mod action;
pub mod instructions;
mod memory;
mod processor;
mod program;
<reponame>SmuliS/timetracker-dbus
use dbus_crossroads::Context;
use dbus_crossroads::IfaceBuilder;

use crate::data::Timetracker;

// TODO: find a way to pass empty arguments for getter
const NO_ARGUMENTS: (&str,) = ("__not_relevant__",);

pub fn build_timetracker_interface(builder: &mut IfaceBuilder<Timetracker>) {
  builder.signal::<(String,), _>("updated", ("sender",));
  builder.method(
    "get",
    NO_ARGUMENTS,
    ("status",),
    |_ctx: &mut Context, data: &mut Timetracker, (_name,): (String,)| {
      let rv = data.get_status();
      println!("Get called: {}", rv);
      Ok((rv,))
    },
  );
  builder.method(
    "set",
    ("value",),
    ("status",),
    |ctx: &mut Context, data: &mut Timetracker, (value,): (String,)| {
      data.set_status(&value);
      ctx.push_msg(ctx.make_signal("updated", (&value,)));
      println!("Set called: {}", &value);
      Ok((value.to_string(),))
    },
  );
}
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
pub fn main() {
    crustlib::main();
}
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

#[cfg(any(feature = "v1_10", feature = "dox"))]
use glib::object::ObjectType as ObjectType_;
#[cfg(any(feature = "v1_10", feature = "dox"))]
use glib::signal::connect_raw;
#[cfg(any(feature = "v1_10", feature = "dox"))]
use glib::signal::SignalHandlerId;
use glib::translate::*;
#[cfg(any(feature = "v1_10", feature = "dox"))]
use glib_sys;
use nm_sys;
#[cfg(any(feature = "v1_10", feature = "dox"))]
use std::boxed::Box as Box_;
use std::fmt;
#[cfg(any(feature = "v1_10", feature = "dox"))]
use std::mem::transmute;
use Device;
use Object;

glib_wrapper! {
    pub struct DeviceDummy(Object<nm_sys::NMDeviceDummy, nm_sys::NMDeviceDummyClass, DeviceDummyClass>) @extends Device, Object;

    match fn {
        get_type => || nm_sys::nm_device_dummy_get_type(),
    }
}

impl DeviceDummy {
    #[cfg(any(feature = "v1_10", feature = "dox"))]
    pub fn connect_property_hw_address_notify<F: Fn(&DeviceDummy) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_hw_address_trampoline<F: Fn(&DeviceDummy) + 'static>(
            this: *mut nm_sys::NMDeviceDummy,
            _param_spec: glib_sys::gpointer,
            f: glib_sys::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::hw-address\0".as_ptr() as *const _,
                Some(transmute(notify_hw_address_trampoline::<F> as usize)),
                Box_::into_raw(f),
            )
        }
    }
}

impl fmt::Display for DeviceDummy {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "DeviceDummy")
    }
}
<gh_star


->HaveNbrE)
  {
    udata->Erecv = new sunrealtype[udata->ny_loc];
    udata->Esend = new sunrealtype[udata->ny_loc];
  }
  if (udata->HaveNbrS)
  {
    udata->Srecv = new sunrealtype[udata->nx_loc];
    udata->Ssend = new sunrealtype[udata->nx_loc];
  }
  if (udata->HaveNbrN)
  {
    udata->Nrecv = new sunrealtype[udata->nx_loc];
    udata->Nsend = new sunrealtype[udata->nx_loc];
  }

  // MPI neighborhood information
  int nbcoords[2];

  // West neighbor
  if (udata->HaveNbrW)
  {
    nbcoords[0] = coords[0] - 1;
    nbcoords[1] = coords[1];
    flag        = MPI_Cart_rank(udata->comm_c, nbcoords, &(udata->ipW));
    if (flag != MPI_SUCCESS)
    {
      cerr << "Error in MPI_Cart_rank = " << flag << endl;
      return -1;
    }
  }

  // East neighbor
  if (udata->HaveNbrE)
  {
    nbcoords[0] = coords[0] + 1;
    nbcoords[1] = coords[1];
    flag        = MPI_Cart_rank(udata->comm_c, nbcoords, &(udata->ipE));
    if (flag != MPI_SUCCESS)
    {
      cerr << "Error in MPI_Cart_rank = " << flag << endl;
      return -1;
    }
  }

  // South neighbor
  if (udata->HaveNbrS)
  {
    nbcoords[0] = coords[0];
    nbcoords[1] = coords[1] - 1;
    flag        = MPI_Cart_rank(udata->comm_c, nbcoords, &(udata->ipS));
    if (flag != MPI_SUCCESS)
    {
      cerr << "Error in MPI_Cart_rank = " << flag << endl;
      return -1;
    }
  }

  // North neighbor
  if (udata->HaveNbrN)
  {
    nbcoords[0] = coords[0];
    nbcoords[1] = coords[1] + 1;
    flag        = MPI_Cart_rank(udata->comm_c, nbcoords, &(udata->ipN));
    if (flag != MPI_SUCCESS)
    {
      cerr << "Error in MPI_Cart_rank = " << flag << endl;
      return -1;
    }
  }

  // Return success
  return 0;
}

// -----------------------------------------------------------------------------
// Functions called by the integrator
// -----------------------------------------------------------------------------

// fi routine to compute the slow-implicit part of ODE RHS function.
static int fi(sunrealtype t, N_Vector u, N_Vector f, void* user_data)
{
  int flag;
  sunindextype i, j;

  // Start timer
  double t1 = MPI_Wtime();

  // Access problem data
  UserData* udata = (UserData*)user_data;

  // Shortcuts to local number of nodes
  sunindextype nx_loc = udata->nx_loc;
  sunindextype ny_loc = udata->ny_loc;

  // Access data arrays
  sunrealtype* uarray = N_VGetArrayPointer(u);
  if (check_flag((void*)uarray, "N_VGetArrayPointer", 0)) { return -1; }

  sunrealtype* farray = N_VGe


1 01 18 */	psq_st f29, 280(r1), 0, qr0
/* 800454BC 000423FC  DB 81 01 00 */	stfd f28, 0x100(r1)
/* 800454C0 00042400  F3 81 01 08 */	psq_st f28, 264(r1), 0, qr0
/* 800454C4 00042404  DB 61 00 F0 */	stfd f27, 0xf0(r1)
/* 800454C8 00042408  F3 61 00 F8 */	psq_st f27, 248(r1), 0, qr0
/* 800454CC 0004240C  DB 41 00 E0 */	stfd f26, 0xe0(r1)
/* 800454D0 00042410  F3 41 00 E8 */	psq_st f26, 232(r1), 0, qr0
/* 800454D4 00042414  DB 21 00 D0 */	stfd f25, 0xd0(r1)
/* 800454D8 00042418  F3 21 00 D8 */	psq_st f25, 216(r1), 0, qr0
/* 800454DC 0004241C  BF 21 00 B4 */	stmw r25, 0xb4(r1)
/* 800454E0 00042420  7C 7F 1B 78 */	mr r31, r3
/* 800454E4 00042424  7C 9E 23 78 */	mr r30, r4
/* 800454E8 00042428  A8 03 01 40 */	lha r0, 0x140(r3)
/* 800454EC 0004242C  3C 60 43 30 */	lis r3, 0x4330
/* 800454F0 00042430  90 61 00 28 */	stw r3, 0x28(r1)
/* 800454F4 00042434  7C B9 2B 78 */	mr r25, r5
/* 800454F8 00042438  6C 00 80 00 */	xoris r0, r0, 0x8000
/* 800454FC 0004243C  C0 44 00 08 */	lfs f2, 8(r4)
/* 80045500 00042440  90 01 00 2C */	stw r0, 0x2c(r1)
/* 80045504 00042444  C0 24 00 00 */	lfs f1, 0(r4)
/* 80045508 00042448  C8 62 85 40 */	lfd f3, lbl_805168A0@sda21(r2)
/* 8004550C 0004244C  C8 01 00 28 */	lfd f0, 0x28(r1)
/* 80045510 00042450  EC 22 08 28 */	fsubs f1, f2, f1
/* 80045514 00042454  EC 00 18 28 */	fsubs f0, f0, f3
/* 80045518 00042458  FC 01 00 40 */	fcmpo cr0, f1, f0
/* 8004551C 0004245C  4C 41 13 82 */	cror 2, 1, 2
/* 80045520 00042460  40 82 06 1C */	bne .L_80045B3C
/* 80045524 00042464  A8 1F 01 42 */	lha r0, 0x142(r31)
/* 80045528 00042468  90 61 00 28 */	stw r3, 0x28(r1)
/* 8004552C 0004246C  6C 00 80 00 */	xoris r0, r0, 0x8000
/* 80045530 00042470  C0 5E 00 0C */	lfs f2, 0xc(r30)
/* 80045534 00042474  90 01 00 2C */	stw r0, 0x2c(r1)
/* 80045538 00042478  C0 3E 00 04 */	lfs f1, 4(r30)
/* 8004553C 0004247C  C8 01 00 28 */	lfd f0, 0x28(r1)
/* 80045540 00042480  EC 22 08 28 */	fsub


 this.source = source;
            this.frameCount = frameCount;
            this.frameCountType = frameCountType;
        }

        protected override IDisposable SubscribeCore(IObserver<T> observer, IDisposable cancel)
        {
            var d = new MultipleAssignmentDisposable();
            d.Disposable = UnityObservable.TimerFrame(frameCount, frameCountType)
                .SubscribeWithState3(observer, d, source, (_, o, disp, s) =>
                {
                    disp.Disposable = s.Subscribe(o);
                });

            return d;
        }
    }
}


 0 "" 2
#NO_APP
$LBE1128 = .
$LBE1127 = .
$LBE1126 = .
	.loc 4 153 0
$LBE1125 = .
$LBE1124 = .
$LBE1123 = .
	.loc 1 1863 0
	move	$2,$0
$L181:
	.loc 1 1864 0
	lw	$31,28($sp)
	lw	$18,24($sp)
	lw	$17,20($sp)
	lw	$16,16($sp)
	.set	noreorder
	.set	nomacro
	j	$31
	addiu	$sp,$sp,32
	.set	macro
	.set	reorder

	.cfi_def_cfa_offset 0
	.cfi_restore 16
	.cfi_restore 17
	.cfi_restore 18
	.cfi_restore 31
	.end	rtk_idleNaptConnection
	.cfi_endproc
$LFE3274:
	.size	rtk_idleNaptConnection, .-rtk_idleNaptConnection
	.align	2
	.globl	rtl_fpTimer_update
$LFB3275 = .
	.loc 1 1871 0
	.cfi_startproc
	.set	nomips16
	.ent	rtl_fpTimer_update
	.type	rtl_fpTimer_update, @function
rtl_fpTimer_update:
	.frame	$sp,72,$31		# vars= 32, regs= 6/0, args= 16, gp= 0
	.mask	0x801f0000,-4
	.fmask	0x00000000,0
	.set	noreorder
	.set	nomacro
	addiu	$sp,$sp,-72
	.cfi_def_cfa_offset 72
	.loc 1 1881 0
	lui	$2,%hi(jiffies)
	.loc 1 1883 0
	move	$5,$0
	.loc 1 1871 0
	sw	$19,60($sp)
	sw	$16,48($sp)
	sw	$31,68($sp)
	.cfi_offset 19, -12
	.cfi_offset 16, -24
	.cfi_offset 31, -4
	move	$16,$4
	sw	$20,64($sp)
	sw	$18,56($sp)
	sw	$17,52($sp)
	.cfi_offset 20, -8
	.cfi_offset 18, -16
	.cfi_offset 17, -20
	.loc 1 1881 0
	lw	$19,%lo(jiffies)($2)
	.loc 1 1883 0
	jal	rtl_get_ct_protonum
	nop

	li	$3,17			# 0x11
	bne	$2,$3,$L192
	move	$4,$16

	.loc 1 1886 0
	jal	rtl_get_ct_udp_status
	nop

	andi	$2,$2,0x2
	bne	$2,$0,$L208
	li	$4,1			# 0x1

	.loc 1 1889 0
	move	$4,$0
$L208:
	move	$5,$16
	jal	udp_get_timeouts_by_state
	li	$6,1			# 0x1

	move	$18,$2
	.loc 1 1884 0
	j	$L194
	li	$20,1			# 0x1

$L192:
	.loc 1 1904 0
	jal	rtl_get_ct_protonum
	move	$5,$0

	li	$3,6			# 0x6
	bne	$2,$3,$L206
	li	$2,-1			# 0xffffffffffffffff

	.loc 1 1905 0 discriminator 1
	jal	rtl_get_ct_tcp_state
	move	$4,$16

	.loc 1 1904 0 discriminator 1
	sltu	$2,$2,6
	beq	$2,$0,$L206
	li


	return fmt.Errorf("some deletions failed")
		}

		return nil
	},
}
package skill

import (
	"context"
	"testing"

	"github.com/helixml/helix/api/pkg/agent"
	"github.com/helixml/helix/api/pkg/rag"
	"github.com/helixml/helix/api/pkg/types"
	"github.com/helixml/helix/api/pkg/util/jsonschema"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"go.uber.org/mock/gomock"
)

func TestNewKnowledgeSkill(t *testing.T) {
	knowledge := &types.Knowledge{
		Name:        "Test Knowledge",
		Description: "Test knowledge base for testing",
		RAGSettings: types.RAGSettings{
			Threshold:        0.8,
			DistanceFunction: "cosine",
			ResultsCount:     5,
		},
	}

	// Create a mock RAG client
	var mockRAG rag.RAG

	skill := NewKnowledgeSkill(mockRAG, knowledge, []string{})
	assert.NotNil(t, skill)

	t.Run("BasicProperties", func(t *testing.T) {
		assert.Equal(t, "Knowledge_Test_Knowledge", skill.Name)
		assert.Equal(t, "Contains expert knowledge on topics: 'Test knowledge base for testing'", skill.Description)
		assert.Equal(t, knowledgeBaseMainPrompt, skill.SystemPrompt)
	})

	t.Run("ToolCount", func(t *testing.T) {
		assert.Equal(t, 1, len(skill.Tools))
	})

	t.Run("ToolProperties", func(t *testing.T) {
		tool := skill.Tools[0].(*KnowledgeQueryTool)
		assert.Equal(t, "KnowledgeQuery", tool.Name())
		assert.Equal(t, "Contains expert knowledge on topics: 'Test knowledge base for testing'", tool.Description())
		assert.Equal(t, "SchoolIcon", tool.Icon())
		assert.Equal(t, "Searching the knowledge base", tool.StatusMessage())
	})

	t.Run("OpenAISchema", func(t *testing.T) {
		tool := skill.Tools[0].(*KnowledgeQueryTool)
		openAiSpec := tool.OpenAI()

		parameters := openAiSpec[0].Function.Parameters.(jsonschema.Definition)

		queryProperty, ok := parameters.Properties["query"]
		require.True(t, ok)

		// Check query property description and type
		assert.Equal(t, "For query use concise, main keywords as the engine is performing both semantic and full text search", queryProperty.Description)
		assert.Equal(t, jsonschema.String, queryProperty.Type)

		// Check that query is required
		assert.Equal(t, []string{"query"}, parameters.Required)
	})
}

func TestNewKnowledgeSkill_Execute_WithFiltering(t *testing.T) {
	knowledge := &types.Knowledge{
		Name:        "Test Knowledge",
		Description: "Test knowledge base for testing",
		RAGSettings: types.RAGSettings{
			Threshold:        0.8,
			DistanceFunction: "cosine",
			ResultsCount:     5,
		},
	}

	ctrl := gomock.NewController(t)

	mockRAG := rag.NewMockRAG(ctrl)
	mockRAG.EXPECT().Query(context.Background(), &types.SessionRAGQuery{
		Prompt:            "test",
		DataEntityID:      knowledge.GetDataEntityID(),
		DistanceThreshold: knowledge.RAGSettings.Threshold,
		DistanceFunction:  knowledge.RAGSettings.DistanceFunction,
		MaxResults:        knowledge.RAGSettings.ResultsCount,
		DocumentIDList:    []string{"doc1", "doc2"},
	}).Return([]*types.SessionRAGRe


为什么创始人会迷茫？ 因为在很多年前他选择创业的时候， 首先不是建立在自己是否真的喜欢创业做的事情， 如果不是真正热爱自己创业做的事情， 是不会坚持下去的。 所以创业其实很多时候就是热爱+坚持。 静下心来坚持做你的事情， 不管外面的世界发生了任何事情， 坚持把你能做到做到极致， 失败了无怨无悔， 成功后大家都会拍马屁的反对他们在最初的时候讽刺你的观点。 走自己的创业路， 让没有思想的鹦鹉们喷去吧…

生态引爆点

生态引爆点， 其实就是中国以小博大的古语。 不要和这个行业的垄断者正面斗争， 在自己能够坚守的行业一点点做积累， 一旦积累到用户达到引爆点产生正向生态时， 所有的事情都是水到渠成的。 中国人的商业思路都是快钱， 做什么事情都忒浮躁， 恨不得快速在一两年解决战斗。 操作系统和中国的开源事业恰恰是一个最耗时间的持久战， 如果不潜心坚持十年， 是没法正真的达到引爆点。

深度5年

话说深度软件中心开发的时候， 我在思考一个问题， 我应该用什么语言去开发？Java这个企业化最为友好的语言？ 不适合， 因为整个Linux社区不像Windows和Mac那样在所有方面都有非常严格的标准， Linux社区和之上的开发都是大杂烩， 一个大家看到的程序， 可能融合各种语言各种库融化在一起而开发成的。 Linux仍然是C语言为主的社区， 用C语言开发？ 前面我提到， 开源社区要在中国发展起来， 就是行业信心， 信心要怎么构建？ 就是天下武功， 唯快不破， 我这里说的快不是程序的运行速度， 而是开发速度， 2011年那时候的开发速度最快的就是Python语言，Python语言本身就是一个脚本语言， 开发人员非常容易招聘， 不会给机会犯内存泄露的问题， 而且Python的库特别多还可以直接调用几乎所有的C库。 只有通过快速开发出各种软件解决Linux各种问


                       signal = 'BUY'
                    elif change_percent < -0.5:
                        signal = 'SELL'
                    else:
                        signal = 'HOLD'

                    self.performance_data['last_signal'] = signal

                    # 포지션 수 (신뢰도 기반)
                    if confidence > 0.7:
                        positions = 2
                    elif confidence > 0.5:
                        positions = 1
                    else:
                        positions = 0
                    self.performance_data['active_positions'] = positions

                else:
                    # 예측 데이터가 없으면 기본값
                    self.performance_data['last_signal'] = 'HOLD'
                    self.performance_data['active_positions'] = 0
            else:
                # 파일이 없으면 기본값
                self.performance_data['last_signal'] = 'HOLD'
                self.performance_data['active_positions'] = 0

        except Exception as e:
            # 오류 시 안전한 기본값
            self.performance_data['last_signal'] = 'HOLD'
            self.performance_data['active_positions'] = 0

        # Update timestamp
        self.performance_data['last_update'] = datetime.now().isoformat()

# Initialize monitor
monitor = TradingMonitor()

# Dashboard HTML template
DASHBOARD_HTML = """
<!DOCTYPE html>
<html>
<head>
    <title>🤖 AI Trading Dashboard</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            color: white;
            min-height: 100vh;
        }
        .header {
            background: rgba(0,0,0,0.3);
            padding: 20px;
            text-align: center;
            border-bottom: 2px solid rgba(255,255,255,0.1);
        }
        .header h1 { font-size: 2.5em; margin-bottom: 10px; }
        .subtitle { font-size: 1.2em; opacity: 0.8; }
        .container { padding: 20px; max-width: 1200px; margin: 0 auto; }
        .grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
        }
        .card {
            background: rgba(255,255,255,0.1);
            border-radius: 15px;
            padding: 20px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.2);
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }
        .card h3 {
            font-size: 1.3em;
            margin-bottom: 15px;
            color: #FFD700;
        }
        .metric {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 10px 0;
            padding: 10px;
            background: rgba(255,255,255,0.05);
            border-radius: 8px;
        }
        .metric-value {
            font-size: 1.4em;
            font-weight: bold;
        }
        .positive { color: #00ff88; }
        .negative { color: #ff4757; }
        .neutral { color: #ffa726; }
        .signal-buy { color: #00ff88; font-weight: bold; }
        .signal-sell { color: #ff4757; font-weight: bold; }
        .signal-hold { color: #ffa726; font-weight: bold; }
        .status {
            position: fixed;
            top: 20px;
            right: 20px;
            background: rgba(0,255,0,0.2);
            padding: 10px 15px;
            border-radius: 20px;
            border: 1px solid rgba(0,255,0,0.5);
            font-size: 0.9em;
        }
        .pulse {
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0% { opacity: 0.6; }
            50% { opacity: 1; }
            100% { opacity: 0.6; }
        }
        .chart-container {
            height: 300px;
            background: rgba(255,255,255,0.05);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255,255,255,0.6);
        }
        .footer {
            text-align: center;
            padding: 20px;
            color: rgba(255,255,255,0.6);
            border-top: 1px solid rgba(255,255,255,0.1);
        }
    </style>
    <script>


前农民对地主、旧式富农的欠租，一律免交。但对地主、旧式富农以外之业主的欠租，应视业佃双方经济情况酌量交还。 第七条无论任何租佃形式，如因不可抗拒的灾害而致歉收，或全部失收时，应酌情减少或免交地租。

   第八条  凡属工人、贫苦手工业者、贫苦自由职业者、贫苦革命军人家属与鳏、寡、孤、独、残废等，因缺乏劳动力而出租全部或一部份土地，其出租土地数量不超过一般中农所有土地的平均数者，可由区人民政府及同级农民协会酌议少减或不减。

   第九条  学田田租凡为学校经费之主要来源者，为维持文化教育事业起见，其原租额在百分之三十五以下者暂时不减，其原租额超过百份之三十五者照减，但以减至百分之三十五为限(原租额不足百分之三十五者亦不得增加)。其他用作社会公益事业的公田，如育婴堂、孤儿院、养老院等土地，亦照学田办理。

   第十条  族田、祠堂田，一般均应按本条例第二条之规定实行减租，如其田租收入确属实用于周济本族贫苦人民者，可按第九条学田减租办法处理之。

   第十一条 在减租以后，应确实保证佃权。地主不得收回土地转租、出典或出卖。其因生活困难而需收回土地自耕者，亦应由业佃双方协议，照顾原佃生活，经农民协会及当地区以上人民政府批准后，始得退佃一部。凡契约及习惯上有永佃权者，其永佃权仍继续有效。

   第十二条 凡进行减租地区，地主应按本条例减租，佃户亦应交租。

   第三章  若干特殊问题之处理

   第十三条 凡战争罪犯及反革命首要分子，应由县人民政府按级上呈省人民政府依法判处，没收其土地并分配给无地、少地农民和复员革命军人及贫苦烈属军属所有。其家属未参加反革命活动者，应保留其足以维


 = "\U0001f635" // dizzy face
	ExplodingHead       Emoji = "\U0001f92f" // exploding head
	// SUBGROUP: face-hat
	CowboyHatFace Emoji = "\U0001f920" // cowboy hat face
	PartyingFace  Emoji = "\U0001f973" // partying face
	DisguisedFace Emoji = "\U0001f978" // disguised face
	// SUBGROUP: face-glasses
	SmilingFaceWithSunglasses Emoji = "\U0001f60e" // smiling face with sunglasses
	NerdFace                  Emoji = "\U0001f913" // nerd face
	FaceWithMonocle           Emoji = "\U0001f9d0" // face with monocle
	// SUBGROUP: face-concerned
	ConfusedFace              Emoji = "\U0001f615"   // confused face
	WorriedFace               Emoji = "\U0001f61f"   // worried face
	SlightlyFrowningFace      Emoji = "\U0001f641"   // slightly frowning face
	FrowningFace              Emoji = "\u2639\ufe0f" // frowning face
	FaceWithOpenMouth         Emoji = "\U0001f62e"   // face with open mouth
	HushedFace                Emoji = "\U0001f62f"   // hushed face
	AstonishedFace            Emoji = "\U0001f632"   // astonished face
	FlushedFace               Emoji = "\U0001f633"   // flushed face
	PleadingFace              Emoji = "\U0001f97a"   // pleading face
	FrowningFaceWithOpenMouth Emoji = "\U0001f626"   // frowning face with open mouth
	AnguishedFace             Emoji = "\U0001f627"   // anguished face
	FearfulFace               Emoji = "\U0001f628"   // fearful face
	AnxiousFaceWithSweat      Emoji = "\U0001f630"   // anxious face with sweat
	SadButRelievedFace        Emoji = "\U0001f625"   // sad but relieved face
	CryingFace                Emoji = "\U0001f622"   // crying face
	LoudlyCryingFace          Emoji = "\U0001f62d"   // loudly crying face
	FaceScreamingInFear       Emoji = "\U0001f631"   // face screaming in fear
	ConfoundedFace            Emoji = "\U0001f616"   // confounded face
	PerseveringFace           Emoji = "\U0001f623"   // persevering face
	DisappointedFace          Emoji = "\U0001f61e"   // disappointed face
	DowncastFaceWithSweat     Emoji = "\U0001f613"   // downcast face with sweat
	WearyFace                 Emoji = "\U0001f629"   // weary face
	TiredFace                 Emoji = "\U0001f62b"   // tired face
	YawningFace               Emoji = "\U0001f971"   // yawning face
	// SUBGROUP: face-negative
	FaceWithSteamFromNose  Emoji = "\U0001f624"   // face with steam from nose
	PoutingFace            Emoji = "\U0001f621"   // pouting face
	AngryFace              Emoji = "\U0001f620"   // angry face
	FaceWithSymbolsOnMouth Emoji = "\U0001f92c"   // face with symbols on mouth
	SmilingFaceWithHorns   Emoji = "\U0001f608"   // smiling face with horns
	AngryFaceWithHorns     Emoji = "\U0001f47f"   // angry face with horns
	Skull                  Emoji = "\U0001f480"   // skull
	SkullAndCrossbones     Emoji = "\u2620\ufe0f" // skull and crossbones
	// SUBGROUP: face-costume
	PileOfPoo    Emoji = "\U0001f4a9" // pile of poo
	ClownFace    Emoji = "\U0001f921" // clown face
	Ogre         Emoji = "\U0001f479" // ogre
	Goblin       Emoji = "\U0001f47a" // goblin
	Ghost        Emoji = "\U0001f47b" // ghost
	Alien        Emoji = "\U0001f47d" // alien
	AlienM


8)
);

/* noto-sans-sc-[6]-700-normal */
@include font.face(
    $family: $scFamily,
    $weight: 700,
    $url: "~@fontsource/noto-sans-sc/files/noto-sans-sc-6-700-normal.woff2",
    $range: (U+f0a7, U+f0b2, U+f0b7, U+f0c9, U+f0d8, U+f0da, U+f0dc-f0dd, U+f0e0, U+f0e6, U+f0eb, U+f0fc, U+f101, U+f104-f105, U+f107, U+f10b, U+f11b, U+f14b, U+f18a, U+f193, U+f1d6-f1d7, U+f244, U+f27a, U+f296, U+f2ae, U+f471, U+f4b3, U+f610-f611, U+f880-f881, U+f8ec, U+f8f5, U+f8ff, U+f901, U+f90a, U+f92c-f92d, U+f934, U+f937, U+f941, U+f965, U+f967, U+f969, U+f96b, U+f96f, U+f974, U+f978-f979, U+f97e, U+f981, U+f98a, U+f98e, U+f997, U+f99c, U+f9b2, U+f9b5, U+f9ba, U+f9be, U+f9ca, U+f9d0-f9d1, U+f9dd, U+f9e0-f9e1, U+f9e4, U+f9f7, U+fa00-fa01, U+fa08, U+fa0a, U+fa11, U+fb01-fb02, U+fdfc, U+fe0e, U+fe30-fe31, U+fe33-fe44, U+fe49-fe52, U+fe54-fe57, U+fe59-fe66, U+fe68-fe6b, U+fe8e, U+fe92-fe93, U+feae, U+feb8, U+fecb-fecc, U+fee0)
);

/* noto-sans-sc-[21]-700-normal */
@include font.face(
    $family: $scFamily,
    $weight: 700,
    $url: "~@fontsource/noto-sans-sc/files/noto-sans-sc-21-700-normal.woff2",
    $range: (U+9f3d-9f3e, U+9f41, U+9f4a-9f4b, U+9f51-9f52, U+9f61-9f63, U+9f66-9f67, U+9f80-9f81, U+9f83, U+9f85-9f8d, U+9f90-9f91, U+9f94-9f96, U+9f98, U+9f9b-9f9c, U+9f9e, U+9fa0, U+9fa2, U+9ff4, U+a001, U+a007, U+a025, U+a046-a047, U+a057, U+a072, U+a078-a079, U+a083, U+a085, U+a100, U+a118, U+a132, U+a134, U+a1f4, U+a242, U+a4a6, U+a4aa, U+a4b0-a4b1, U+a4b3, U+a9c1-a9c2, U+ac00-


3, r0, #0
	ldr r0, [sp, #0x28]
	mov r1, #0
	str r0, [sp]
	add r0, r5, #0
	mov r2, #1
	bl sub_0208089C
	add r0, r5, #0
	bl CalcMonLevelAndStats
	add r0, r5, #0
	bl MonIsShiny
	cmp r0, #0
	beq _02248B08
	bl GF_AssertFail
_02248B08:
	add sp, #0x14
	pop {r4, r5, r6, r7, pc}

	thumb_func_start ov06_02248B0C
ov06_02248B0C: ; 0x02248B0C
	ldr r3, _02248B14 ; =MI_CpuFill8
	mov r1, #0
	mov r2, #0x18
	bx r3
	.align 2, 0
_02248B14: .word MI_CpuFill8

	thumb_func_start ov06_02248B18
ov06_02248B18: ; 0x02248B18
	strb r1, [r0, #3]
	bx lr

	thumb_func_start ov06_02248B1C
ov06_02248B1C: ; 0x02248B1C
	strb r1, [r0, #2]
	bx lr

	thumb_func_start ov06_02248B20
ov06_02248B20: ; 0x02248B20
	strb r1, [r0, #1]
	bx lr

	thumb_func_start ov06_02248B24
ov06_02248B24: ; 0x02248B24
	ldr r3, _02248B2C ; =CopyU16StringArrayN
	add r0, r0, #4
	mov r2, #8
	bx r3
	.align 2, 0
_02248B2C: .word CopyU16StringArrayN

	thumb_func_start ov06_02248B30
ov06_02248B30: ; 0x02248B30
	push {r3, r4, r5, lr}
	add r4, r1, #0
	add r5, r0, #0
	add r0, r4, #0
	bl sub_0202B5C8
	strb r0, [r5]
	str r4, [r5, #0x14]
	pop {r3, r4, r5, pc}
	.align 2, 0

	thumb_func_start ov06_02248B44
ov06_02248B44: ; 0x02248B44
	push {r3, lr}
	ldr r0, [r0, #0x14]
	cmp r0, #0
	beq _02248B50
	bl sub_0202B5CC
_02248B50:
	pop {r3, pc}
	.align 2, 0

	thumb_func_start ov06_02248B54
ov06_02248B54: ; 0x02248B54
	ldrb r0, [r0, #3]
	bx lr

	thumb_func_start ov06_02248B58
ov06_02248B58: ; 0x02248B58
	ldrb r0, [r0, #2]
	bx lr

	thumb_func_start ov06_02248B5C
ov06_02248B5C: ; 0x02248B5C
	add r0, r0, #4
	bx lr

	thumb_func_start ov06_02248B60
ov06_02248B60: ; 0x02248B60
	ldr r3, _02248B68 ; =sub_0202B5D8
	ldr r0, [r0, #0x14]
	bx r3
	nop
_02248B68: .word sub_0202B5D8


2, [r0, #4]
	ldr r6, _08057224 @ =gCurTask
	ldr r1, [r6]
	ldr r0, _08057228 @ =sub_8057F7C
	str r0, [r1, #8]
_080571C0:
	add sp, #4
	pop {r3, r4, r5}
	mov r8, r3
	mov sb, r4
	mov sl, r5
	pop {r4, r5, r6, r7}
	pop {r0}
	bx r0
	.align 2, 0
_080571D0: .4byte gWinRegs
_080571D4: .4byte gStageData
_080571D8: .4byte 0x03000008
_080571DC: .4byte 0x06008000
_080571E0: .4byte 0x0600A000
_080571E4: .4byte 0x03000032
_080571E8: .4byte 0x03000034
_080571EC: .4byte gDispCnt
_080571F0: .4byte gBgCntRegs
_080571F4: .4byte 0x00001408
_080571F8: .4byte gBgScrollRegs
_080571FC: .4byte 0x040000D4
_08057200: .4byte gUnknown_086AB768
_08057204: .4byte gBgPalette + 0xE0
_08057208: .4byte 0x80000090
_0805720C: .4byte gFlags
_08057210: .4byte gSaveGame
_08057214: .4byte 0x00000366
_08057218: .4byte 0x03000048
_0805721C: .4byte gUnknown_080D1D88
_08057220: .4byte gBldRegs
_08057224: .4byte gCurTask
_08057228: .4byte sub_8057F7C

	thumb_func_start sub_805722C
sub_805722C: @ 0x0805722C
	push {r4, r5, r6, r7, lr}
	ldr r7, _08057268 @ =gCurTask
	ldr r0, [r7]
	ldrh r2, [r0, #6]
	movs r0, #0xc0
	lsls r0, r0, #0x12
	adds r5, r2, r0
	ldrb r1, [r5, #1]
	adds r1, #4
	movs r6, #0
	strb r1, [r5, #1]
	ldrb r0, [r5, #2]
	subs r0, #4
	strb r0, [r5, #2]
	lsls r1, r1, #0x18
	lsls r0, r0, #0x18
	cmp r1, r0
	bhs _08057274
	ldr r1, _0805726C @ =0x03000048
	adds r0, r2, r1
	bl DisplaySprite
	ldr r2, _08057270 @ =gWinRegs
	ldrb r1, [r5, #1]
	lsls r1, r1, #8
	ldrb r0, [r5, #2]
	orrs r0, r1
	strh r0, [r2, #6]
	b _080572B2
	.align 2, 0
_08057268: .4byte gCurTask
_0805726C: .4byte 0x03000048
_08057270: .4byte gWinRegs
_08057274:
	ldr r2, _080572B8 @ =gDispCnt
	ldrh r1, [r2]
	ldr r0, _080572BC @


javaClass.simpleName
            AppRuntime.manifest.d("初始化部分Hook器: $hookerName")

            try {
                hooker.hook()
                AppRuntime.manifest.d("部分Hook器初始化成功: $hookerName")
            } catch (e: Exception) {
                AppRuntime.manifest.d("部分Hook器错误: ${e.message}")
                AppRuntime.manifest.e(e)
                set("adaptation_version", "0")
            }
        }

        AppRuntime.manifest.d("Hook器初始化成功, ${AppRuntime.manifest.appName}")

        // 成功通知
        if (!manifest.systemApp &&
            manifest.packageName != BuildConfig.APPLICATION_ID
        ) {
            CoroutineUtils.withMain {
                if (DataUtils.configBoolean(Setting.LOAD_SUCCESS, DefaultData.LOAD_SUCCESS)) {
                    MessageUtils.toast("自动记账加载成功")
                }
            }
        }
    }

    override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) {
        AppRuntime.modulePath = startupParam?.modulePath ?: ""
    }

}/*
 * Copyright (C) 2025 ankio(ankio@ankio.net)
 * Licensed under the Apache License, Version 3.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-3.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package net.ankio.auto.xposed.hooks.qianji.filter

import de.robv.android.xposed.XposedHelpers
import net.ankio.auto.xposed.core.api.HookerClazz
import net.ankio.auto.xposed.hooks.qianji.models.QjTagModel
import net.ankio.dex.model.Clazz

/**
 * 钱迹宿主 `TagsFilter` 的轻量包装（Xposed 反射委托）。
 * - 不复制逻辑，直接转发宿主；
 * - 接收/返回 `QjTagModel` 包装对象，便于统一风格。
 */
class TagsFilter private constructor(private var filterObj: Any?) {

    companion object : HookerClazz() {
        /** 宿主类名 */
        private const val CLAZZ = "com.mutangtech.qianji.filter.filters.TagsFilter"

        /** 精确类名规则 */
        override var rule = Clazz(name = this::class.java.name, nameRule = CLAZZ)

        /** 从宿主 `List<Tag>` 构造 */
        fun fromTagObjects(tags: List<Any>): TagsFilter =
            fromObject(XposedHelpers.newInstance(clazz(), tags))

        /** 包装已有宿主对象 */
        fun fromObject(obj: Any): TagsFilter {
            if (obj::class.java.name != CLAZZ) {
                throw IllegalArgumentException("${obj::class.java.name} must be instance of $CLAZZ")
            }
            return TagsFilter(obj)
        }
    }

    /** 返回底层宿主对象 */
    fun toObject(): Any = filterObj!!

    /** 键名固定为 "tags" */
    fun getKey(): String = XposedHelpe


\\te(1.4 * delay,1.4 * delay,\\\\txt.a)\" )", "delay = 450;\nDy = 70r", "Lua", false, false )
	Helical_Char_I_midline = effector.create_fx( "LOfx", "Helical_Char_I_midline", "Char", true, false, "#FFFFFF", "#848484", "#454545", "0", "0", "0", "l.start_time + syl.end_time", "l.end_time + 30mid1 + 10f + 520", "", "", "", "", "char.center", "char.middle", "", "", "5", "0", "fx.pos_x", "fx.pos_y, fx.pos_y + Dy * (-1) ^ j + (2 * Dy * (-1) ^ (j + 1)) * (char.i - 1) / char.n", "fx.dur - 1.4 * delay, fx.dur", "2", "", "char.text", "\"\\\\te(0,delay,0.8,\\\\frxo180)\\\\fad(0,200)\", tag.only( j == 2, \"\\\\134a255\\\\te(1.4 * delay,1.4 * delay,\\\\txt.a)\" )", "delay = 450;\nDy = 70r", "Lua", false, false )
	In_Mark_Syl_I = effector.create_fx( "LOfx", "In_Mark_Syl_I", "Syl", true, false, "#FFFFFF", "#61BCFF", "#454545", "255", "0", "0", "l.start_time + syl.end_time", "l.end_time + 50lo + 2f + 300", "", "", "", "", "syl.center", "syl.middle", "", "", "5", "0", "fx.pos_x", "fx.pos_y", "", "2", "", "(j == 1) and mi_shape or syl.text", "shape.rmove( 8r, 8r, fx.dur - 400, fx.dur, 1, { 2f } ), tag.only( j == 1, \"\\\\3a255\\\\te(400,600,\\\\3a0)\" ), \"\\\\fad(0,120)\"", "Sizex = syl.width + 8r;\nSizey = syl.height - l.descent / 2;\nmi_shape = \"{\\\\bord3r\\\\shad0}\" .. shape.displace( shape.size( shape.rectangle, Sizex, Sizey ), syl.width / 2 - Sizex / 2, l.descent - syl.height / 2 + Sizey / 2 );\nrandom_mode = \"syl\"", "Lua", false, false )
	In_Mark_Syl_I_buttline = effector.create_fx( "LOfx", "In_Mark_Syl_I_buttline", "Syl", true, false, "#FFFFFF", "#61BCFF", "#454545", "255", "0", "0", "l.start_time + syl.end_time", "l.end_time + 50mid2 + 11f + 300", "", "", "", "", "syl.center", "syl.middle", "", "", "5", "0", "fx.pos_x", "fx.pos_y", "", "2", "", "(j == 1) and mi_shape or syl.text", "shape.rmove( 8r, 8r, fx.dur - 400, fx.dur, 1, { 2f } ), tag.only( j == 1, \"\\\\3a255\\\\te(400,600,\\\\3a0)\" ), \"\\\\fad(0,120)\"", "Sizex = syl.width + 8r;\nSizey = syl.height - l.descent / 2;\nmi_shape = \"{\\\\bord3r\\\\shad0}\" .. shape.displace( shape.size( shape.rectangle, Sizex, Sizey ), syl.width / 2 - Sizex / 2, l.descent - syl.height / 2 + Sizey / 2 );\nrandom_mode = \"syl\"", "L


> | E-mail me

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>Bookmarking beyond the browser</title>

<meta  http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta  name="generator" content="Org-mode" />
<link rel="stylesheet" type="text/css" href="../css/foundation.min.css"></link>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'></link>
<link rel="stylesheet" type="text/css" href="../css/org-export.css"></link>
<link rel="stylesheet" type="text/css" href="../css/style.css"></link>
<link rel="stylesheet" type="text/css" href="../css/emacs-notes.css"></link>

Bookmarking beyond the browser

October 8th, 2005 -
http://sachachua.com/blog/p/3053

Bookmarking web pages is a breeze with tag-based bookmarking services
like del.icio.us, which reduced the need for
up-front organization and made it much easier to search for relevant
bookmarks. New tag-based search engines like Yahoo's
MyWeb 2.0 search not only the tag
descriptions but also the bookmarked web pages, allowing people to
create targeted search spaces. CiteULike
and Connotea automatically extract
bibliographic references from websites, making life easier for academic
researchers.

What if we took bookmarking beyond the browser? What if you could
bookmark any resource on your computer as easily as you bookmark web
pages now? What if you could organize those bookmarks into collections?

Some of these things are possible within applications. For example, the
Microsoft
Entourage personal information manager allows you to link mail,
events, tasks, notes, and contacts. In the Emacs text editor,
Planner allows you to link to almost
anything within the Emacs environment.

What if you could bookmark anything?

Some projects explore cross-application data sharing. For example,
Google Desktop for Microsoft Windows
exposes an event stream from multiple applications and presents a
sidebar of relevant items. GNOME
Dashboard provides a similar service for Linux.
OnLife for Mac OS X visualizes user
activity in Safari, Firefox, iTunes, iChat,


blocks(bp.block)
                        self.record_block_propagation_time(bp, round)
                        # 如果一个adv收到，其他adv也立即收到
                        if miner.isAdversary:
                            not_rcv_adv_miners = [m for m in self.adv_miners \
                                                if m.miner_id != miner.miner_id]
                            for adv_miner in not_rcv_adv_miners:
                                bp.update_trans_process(miner.miner_id, round)
                                adv_miner.receive_blocks(bp.block)
                                self.record_block_propagation_time(bp, round)
                # 更新recieve_prob
                if bp.recieve_prob < 1:
                    bp.recieve_prob += self.rcvprob_inc
                # 如果所有人都收到了，就丢弃该包
                if len(set(bp.received_miners)) == self.MINER_NUM:
                    died_packets.append(i)
                    self.save_trans_process(bp)
            # 丢弃传播完成的包，更新network_tape
            self.network_tape = [n for i, n in enumerate(self.network_tape) \
                                    if i not in died_packets]
            died_packets = []

    def record_block_propagation_time(self, block_packet: BlockPacketBDNet, r):
        '''calculate the block propagation time'''
        bp = block_packet
        rn = len(set(bp.received_miners))
        mn = self.MINER_NUM

        def is_closest_to_percentage(a, b, percentage):
            return a == round(b * percentage)

        rcv_rate = -1
        for p in self.target_percents:
            if is_closest_to_percentage(rn, mn, p):
                rcv_rate = p
                break
        if rcv_rate != -1 and rcv_rate in self.target_percents:
            logger.info(f"{bp.block.name}:{rn},{rcv_rate} at round {r}")
            bpt_key = f'{int(rcv_rate * 100)}%'
            self.ave_block_propagation_times[bpt_key] += r-bp.round

            self.block_num_bpt[self.target_percents.index(rcv_rate)] += 1

    def cal_block_propagation_times(self):
        for i , p in enumerate(self.target_percents):
            bpt_key = f'{int(p * 100)}%'
            total_bpt = self.ave_block_propagation_times[bpt_key]
            total_num = self.block_num_bpt[i]
            if total_num == 0:
                continue
            self.ave_block_propagation_times[bpt_key] = round(total_bpt/total_num, 3)
        return self.ave_block_propagation_times

    def save_trans_process(self, block_packet: BlockPacketBDNet):
        '''
        Save the transmission process of a specific block to network_log.txt
        '''
        bp = block_packet
        with open(self.NET_RESULT_PATH / 'network_log.txt', 'a') as f:
            result_str = f'{bp.block.name}:'+'\n'+'recieved miner in round'
            print(result_str, file=f)
            for miner_str,round in bp.trans_process_dict.items():
                print(' '*4, miner_str.ljust(10), ': ', round, file=f)


 pomocą [Kątów odchylenia, pochylenia i obrotu](http://en.wikipedia.org/wiki/Yaw,_pitch,_and_roll). Kąty te są czasem określane jako [kąty Eulera](http://en.wikipedia.org/wiki/Euler_angles) lub kąty Tait-Bryana. Odchylenie, Pochylenie i Obrót to powszechnie używane w lotnictwie określenia orientacji *(lub położenia)* ciała.

**Położenie = (x,y,z)** to wektor opisujący punkt, od którego będzie obliczana geometria obiektu *(w efekcie \"lokalne odniesienie położenia\" obiektu)*.

**Odchylenie-Pochylenie-Obrót = (y,p,r)** to krotka określająca położenie obiektu. Wartości dla y,p,r określają stopnie obrotu wokół każdej z osi z,y,x *(patrz uwaga)*.

```python
>>> App.ActiveDocument.Cylinder.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(10,20,30), App.Vector(0,0,0))
```

App.Rotation(10,20,30) = Kąt Eulera

**Odchylenie** = 10° *(**Z**)*

**Pochylenie** = 20° *(**Y**)*

**Obrót** = 30° *(**X**)*

![](images/Tache_Placement_Lacet_fr_Mini.gif )**Odchylenie** to obrót wokół **osi Z**, czyli obrót z lewej strony na prawą.
*(Kąt odchylenia jest równy **Psi ψ**)*.

![](images/Tache_Placement_Tangage_fr_Mini.gif )**Pochylenie** to obrót wokół **osi Y**, czyli do góry i do dołu.
*(Kąt nachylenia jest wartością **Phi φ**)*.

![](images/Tache_Placement_Roulis_fr_Mini.gif )**Obrót** to obrót wokół osi X, czyli w górę i w dół skrzydła.
*(Kąt obrotu to **Thêta θ**)*.

### Macierz

**Umiejscowienie = Macierz**

Trzecia forma **Umiejscowienia** opisuje położenie i orientację obiektu za pomocą macierzy transformacji afinicznej 4x4 *([Affine Transformation](http://en.wikipedia.org/wiki/Affine_transformation))*.

**Macierz** =

   ((r11,r12,r13,t1),
   (r21,r22,r23,t2),
   (r31,r32,r33,t3),
   (0,0,0,1)) , gdzie r*ij* określa obrót, a t*i* - przesunięcie.

## Okno dialogowe umiejscowienia

Okno dialogowe Umiejscowienia jest wywoływane z menu **Edycja**. Służy ono do precyzyjnego obracania / przesuwania obiektów. Jest ono również używane, gdy chcemy utworzyć szkic na \"niestandardowej\" płaszczyźnie lub zmienić orientację szkicu na nową płaszczyznę.

Sekcja **Przesunięcie** dostosowuje położenie obiektu w przestrzeni. Sekcja **Środek** dostosowuje oś obrotu do takiej, która nie przechodzi


        found = page.getByXPath(composeXPath(MAX_VISIBILITY_FIELDS)).size();
        assertTrue(found > 0, "Should have found an element, but found " + found);

        found = page.getByXPath(composeXPath(REDUCED_VISIBILITY_FIELDS)).size();
        assertTrue(found > 0, "Should have found an element, but found " + found);

        found = page.getByXPath(composeXPath(OTHER_FIELDS)).size();
        assertTrue(found > 0, "Should have found an element, but found " + found);
    }

    @Email(
            "http://jenkins.361315.n4.nabble.com/Change-remote-API-visibility-for-CaseResult-getStdout-getStderr-td395102.html")
    @Test
    void testRemoteApiNoDetails() throws Exception {
        FreeStyleBuild b = configureTestBuild("test-remoteapi");

        XmlPage page = (XmlPage) rule.createWebClient()
                .goTo(
                        "job/test-remoteapi/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/api/xml?depth=-1",
                        "application/xml");

        int found;

        found = page.getByXPath(composeXPath(MAX_VISIBILITY_FIELDS)).size();
        assertTrue(found > 0, "Should have found an element, but found " + found);

        found = page.getByXPath(composeXPath(REDUCED_VISIBILITY_FIELDS)).size();
        assertEquals(0, found, "Should have found 0 elements, but found " + found);

        found = page.getByXPath(composeXPath(OTHER_FIELDS)).size();
        assertTrue(found > 0, "Should have found an element, but found " + found);
    }

    @Email(
            "http://jenkins.361315.n4.nabble.com/Change-remote-API-visibility-for-CaseResult-getStdout-getStderr-td395102.html")
    @Test
    void testRemoteApiNameOnly() throws Exception {
        FreeStyleBuild b = configureTestBuild("test-remoteapi");

        XmlPage page = (XmlPage) rule.createWebClient()
                .goTo(
                        "job/test-remoteapi/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/api/xml?depth=-10",
                        "application/xml");

        int found;

        found = page.getByXPath(composeXPath(MAX_VISIBILITY_FIELDS)).size();
        assertTrue(found > 0, "Should have found an element, but found " + found);

        found = page.getByXPath(composeXPath(REDUCED_VISIBILITY_FIELDS)).size();
        assertEquals(0, found, "Should have found 0 elements, but found " + found);

        found = page.getByXPath(composeXPath(OTHER_FIELDS)).size();
        assertEquals(0, found, "Should have found 0 elements, but found " + found);
    }

    /**
     * Makes sure the summary page remains text/plain (see commit 7089a81 in JENKINS-1544) but
     * the index page must be in text/html.
     */
    @Issue("JENKINS-21261")
    @Test
    void testContentType() throws Exception {
        configureTestBuild("foo");
        JenkinsRule.WebClient wc = rule.createWebClient();
        wc.goTo("job/foo/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/", "text/html");

        wc.goTo("job/foo/1/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/summary", "text/plain");
    }

    /**
     * Execute twice a failing test and make sure its failing age is 2
     */
    @Issue("JENKINS-30413")
    @Test
    void testAge() throws Exception {
        String projectName = "tr-age-test";
        String testResultResourceFile = "JENKINS-30413.xml";

        // Create a job:
        FreeStyleProject p = rule.createFreeStyleProject(projectName);
        p.getPublishersList().add(new JUnitResultArchiver("*.xml"));
        // add builder copying test result file
        p.getBuildersList().add(new TestBuilder(


from enum import Enum

class Problems1D(str, Enum):
    DIFFUSION = "diffusion"  # Advection diffusion
    TAN_01 = "tan_01"  # tan(x+0.1)
    TAN_03 = "tan_03"  # tan(x+0.3)
    P07_01 = "P07_01"  # (x+0.1)^0.7
    P07_001 = "P07_001"  # (x+0.01)^0.7

class Problems2D(str, Enum):
    P07_01 = "P07_01_2D"  # (x+0.1)^0.7*(y+0.1)^0.7
    TAN_05 = "tan_05_2D"  # tan(x-0.5)*tan(y-0.5)


0x1000554;  /* U+0554 ARMENIAN CAPITAL LETTER KEH */
pub const KEY_Armenian_ke: Keysym = 0x1000584;  /* U+0584 ARMENIAN SMALL LETTER KEH */
pub const KEY_Armenian_O: Keysym = 0x1000555;  /* U+0555 ARMENIAN CAPITAL LETTER OH */
pub const KEY_Armenian_o: Keysym = 0x1000585;  /* U+0585 ARMENIAN SMALL LETTER OH */
pub const KEY_Armenian_FE: Keysym = 0x1000556;  /* U+0556 ARMENIAN CAPITAL LETTER FEH */
pub const KEY_Armenian_fe: Keysym = 0x1000586;  /* U+0586 ARMENIAN SMALL LETTER FEH */
pub const KEY_Armenian_apostrophe: Keysym = 0x100055a;  /* U+055A ARMENIAN APOSTROPHE */

/*
 * Georgian
 */

pub const KEY_Georgian_an: Keysym = 0x10010d0;  /* U+10D0 GEORGIAN LETTER AN */
pub const KEY_Georgian_ban: Keysym = 0x10010d1;  /* U+10D1 GEORGIAN LETTER BAN */
pub const KEY_Georgian_gan: Keysym = 0x10010d2;  /* U+10D2 GEORGIAN LETTER GAN */
pub const KEY_Georgian_don: Keysym = 0x10010d3;  /* U+10D3 GEORGIAN LETTER DON */
pub const KEY_Georgian_en: Keysym = 0x10010d4;  /* U+10D4 GEORGIAN LETTER EN */
pub const KEY_Georgian_vin: Keysym = 0x10010d5;  /* U+10D5 GEORGIAN LETTER VIN */
pub const KEY_Georgian_zen: Keysym = 0x10010d6;  /* U+10D6 GEORGIAN LETTER ZEN */
pub const KEY_Georgian_tan: Keysym = 0x10010d7;  /* U+10D7 GEORGIAN LETTER TAN */
pub const KEY_Georgian_in: Keysym = 0x10010d8;  /* U+10D8 GEORGIAN LETTER IN */
pub const KEY_Georgian_kan: Keysym = 0x10010d9;  /* U+10D9 GEORGIAN LETTER KAN */
pub const KEY_Georgian_las: Keysym = 0x10010da;  /* U+10DA GEORGIAN LETTER LAS */
pub const KEY_Georgian_man: Keysym = 0x10010db;  /* U+10DB GEORGIAN LETTER MAN */
pub const KEY_Georgian_nar: Keysym = 0x10010dc;  /* U+10DC GEORGIAN LETTER NAR */
pub const KEY_Georgian_on: Keysym = 0x10010dd;  /* U+10DD GEORGIAN LETTER ON */
pub const KEY_Georgian_par: Keysym = 0x10010de;  /* U+10DE GEORGIAN LETTER PAR */
pub const KEY_Georgian_zhar: Keysym = 0x10010df;  /* U+10DF GEORGIAN LETTER ZHAR */
pub const KEY_Georgian_rae: Keysym = 0x10010e0;  /* U+10E0 GEORGIAN LETTER RAE */
pub const KEY_Georgian_san: Keysym = 0x10010e1;  /* U+10E1 GEORGIAN LETTER SAN */
pub const KEY_Georgian_tar: Keysym = 0x10010e2;  /* U+10E2 GEORGIAN LETTER TAR */
pub const KEY_Georgian_un: Keysym = 0x10010e3;  /* U+10E3 GEORGIAN LETTER UN */
pub const KEY_Georgian_phar: Keysym = 0x10010e4;  /* U+10E4 GEORGIAN LETTER PHAR */
pub const KEY_Georgian_khar: Keysym = 0x10010e5;  /* U+10E5 GEORGIAN LETTER KHAR */
pub const KEY_Georgian_ghan: Keysym = 0x10010e6;  /* U+10E6 GEORGIAN LETTER GHAN */
pub const KEY_Georgian_qar


Interface().(binutil.SizedReader)
		if ok {
			bw.WriteFromSized(vv)
			return binutil.WALK_SKIP
		}
		return nil
	})

	err := bw.Err
	if closeErr := w.Close(); closeErr != nil && err == nil {
		err = closeErr
	}
	return err
}

// Create the syso and custom build file
func main() {

	outPtr := flag.String("o", "rsrc_windows.syso", "resource output pathname")
	printverPtr := flag.Bool("v", false, "print version to console (no .syso output)")
	printCustomVerPtr := flag.Bool("cv", false, "print custom version to console (no .syso output)")
	printCustomBuildPtr := flag.Bool("cb", false, "print custom build number to console (no .syso output)")
	printWinVerPtr := flag.Bool("w", false, "print windows format version to console (no .syso output)")
	iconPtr := flag.String("i", "../../media/icons/Keybase.ico", "icon pathname")
	kbfsIconPtr := flag.String("kbfsicon", "", "icon pathname")
	fileDescriptionPtr := flag.String("d", "Keybase utility", "File Description")
	originalFilenamePtr := flag.String("n", "keybase.exe", "File name")

	flag.Parse()

	var fv goversioninfo.FileVersion

	if int, err := fmt.Sscanf(libkb.Version, "%d.%d.%d", &fv.Major, &fv.Minor, &fv.Patch); int != 3 || err != nil {
		log.Printf("Error parsing version %v", err)
		os.Exit(3)
	}

	fv.Build, _ = strconv.Atoi(os.Getenv("KEYBASE_WINBUILD"))
	if fv.Build == 0 && libkb.PrereleaseBuild != "" {
		fv.Build, _ = strconv.Atoi(libkb.PrereleaseBuild)
	}

	semVer := fmt.Sprintf("%d.%d.%d-%d", fv.Major, fv.Minor, fv.Patch, fv.Build)

	if *printverPtr {
		fmt.Print(semVer)
		return
	}

	if *printWinVerPtr {
		fmt.Printf("%d.%d.%d.%d", fv.Major, fv.Minor, fv.Patch, fv.Build)
		return
	}

	if *printCustomVerPtr {
		customVer := fmt.Sprintf("%d.%d.%d-%s", fv.Major, fv.Minor, fv.Patch, getBuildName())
		fmt.Print(customVer)
		return
	}

	if *printCustomBuildPtr {
		fmt.Printf("%s", getBuildName())
		return
	}

	// Create a new container
	vi := &goversioninfo.VersionInfo{
		FixedFileInfo: goversioninfo.FixedFileInfo{
			FileVersion:    fv,
			ProductVersion: fv,
			FileFlagsMask:  "3f",
			FileFlags:      "00",
			FileOS:         "040004",
			FileType:       "01",
			FileSubType:    "00",
		},

		StringFileInfo: goversioninfo.StringFileInfo{
			CompanyName:      "Keybase, Inc.",
			FileDescription:  *fileDescriptionPtr,
			InternalName:     "Keybase",
			LegalCopyright:   "Copyright (c) 2015, Keybase",
			OriginalFilename: *originalFilenamePtr,
			ProductName:      "Keybase",
			ProductVersion:   libkb.VersionString(),
		},
		VarFileInfo: goversioninfo.VarFileInfo{
			Translation: goversioninfo.Translation{
				LangID:    0x409, // english
				CharsetID: 0x4B0, // unicode
			},
		},
	}

	// Fill the structures with config data
	vi.Build()

	// Write the data to a buffer
	vi.Walk()

	// Optionally, embed an icon by path


15-3.593-5.881-6-15.676-6m11.363 4.965-.195.563a.755.755 0 01-.664.472H21.496a.754.754 0 01-.664-.473l-.195-.563a.792.792 0 01.217-.797S23.399 39.999 32 39.999s11.146 2.168 11.146 2.168c.209.18.307.538.217.798"/></svg>';
  static const String ferris_wheel =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" preserveAspectRatio="xMidYMid meet" viewBox="0 0 64 64"><path fill="currentColor" d="M59.352 26.85h-2.117a.767.767 0 00-.253-.567 24.857 24.857 0 00-2.144-9.45v-4.617a2.65 2.65 0 00-2.648-2.645h-2.12a.775.775 0 00-.777-.777c-.05 0-.094.02-.142.028C44.675 4.596 38.642 2 32 2c-7.155 0-13.604 3.012-18.161 7.83H12.07a2.649 2.649 0 00-2.648 2.645v3.783a24.866 24.866 0 00-2.404 10.025.775.775 0 00-.25.566h-2.12A2.652 2.652 0 002 29.496v5.791a2.649 2.649 0 002.648 2.643h4.863a25.054 25.054 0 004.29 6.201h-1.989a2.649 2.649 0 00-2.65 2.645v5.791a2.649 2.649 0 002.65 2.643h3.603L12 62h2.594l3.419-6.832a2.64 2.64 0 002.239-2.602V51.02l.835-1.545a24.802 24.802 0 006.299 2.093 2.629 2.629 0 00-.931 1.997v5.789A2.65 2.65 0 0029.103 62h5.793a2.651 2.651 0 002.648-2.646v-5.789c0-.802-.366-1.511-.932-1.997a24.808 24.808 0 006.332-2.108l.543 1.005v1.841c0 1.375 1.062 2.497 2.409 2.62L49.406 62H52l-3.516-7.051h3.445a2.65 2.65 0 002.648-2.645v-5.789a2.648 2.648 0 00-2.648-2.646l-1.483.001a25.012 25.012 0 004.041-5.94h4.864a2.647 2.647 0 002.648-2.643v-5.791a2.647 2.647 0 00-2.647-2.646M3.559 32.391v-2.895c0-.602.488-1.088 1.09-1.088h2.394a24.95 24.95 0 00.547 3.982H3.559zm48.63-21.264c.602 0 1.092.488 1.092 1.09v1.665a24.949 24.949 0 00-1.968-2.755h.876m-1.678 3.983-5.206.001v-.002l2.942-2.942a22.104 22.104 0 012.264 2.943m-4.115-3.983h.062l-1.153 1.153v-.063c0-.602.49-1.09 1.091-1.09M33 5.025a22.26 22.26 0 012.979.358c.001.014.009.025.009.04v2.895H33V5.025m0 8.832h1.896a2.648 2.648 0 002.


0, 256)
                    bestRecursiveScore = recursiveScore
                }

                recursiveMatch = true
            }

            // Advance
            matches[nextMatch++] = strCurrIndex.toByte()
            ++patternCurIndex
        }

        ++strCurrIndex
    }

    // Determine if full pattern was matched
    val matched = patternCurIndex == pattern.length

    // Calculate score
    if (matched) {
        // Iterate str to end
        strCurrIndex = str.length

        // Initialize score
        outScore = 100

        // Apply leading letter penalty
        var penalty = LEADING_LETTER_PENALTY * matches[0]
        if (penalty < MAX_LEADING_LETTER_PENALTY) {
            penalty = MAX_LEADING_LETTER_PENALTY
        }
        outScore += penalty

        // Apply unmatched penalty
        val unmatched = strCurrIndex - nextMatch
        outScore += UNMATCHED_LETTER_PENALTY * unmatched

        // Apply ordering bonuses
        for (i in 0 until nextMatch) {
            val currIdx = matches[i].toUByte().toInt()

            if (i > 0) {
                val prevIdx = matches[i - 1].toUByte().toInt()

                // Sequential
                if (currIdx == prevIdx + 1) {
                    outScore += SEQUENTIAL_BONUS
                }
            }

            // Check for bonuses based on neighbor character value
            if (currIdx > 0) {
                // Camel case
                val neighbor = str[currIdx - 1]
                val curr = str[currIdx]
                if (neighbor.isLowerCase() && curr.isUpperCase()) {
                    outScore += CAMEL_BONUS
                }

                // Separator
                val neighborSeparator = neighbor == '_' || neighbor == ' ' || neighbor.isDigit()
                if (neighborSeparator) {
                    outScore += SEPARATOR_BONUS
                }
            } else {
                // First letter
                outScore += FIRST_LETTER_BONUS
            }
        }
    }

    // Return best result
    return if (recursiveMatch && (!matched || bestRecursiveScore > outScore)) {
        // Recursive score is better than "this"
        bestRecursiveMatches.copyInto(matches, 0, 0, maxMatches)
        outScore = bestRecursiveScore
        FuzzyMatchResult(true, outScore)
    } else if (matched) {
        // "this" score is better than recursive
        FuzzyMatchResult(true, outScore)
    } else {
        // no match
        FuzzyMatchResult(false, outScore)
    }
}
package io.github.takahirom.arbigent

import java.awt.Font
import kotlin.system.measureTimeMillis // For basic cache performance check
import kotlin.test.*

class FontPointUtilsTest {

    private val MIN_POINT_SIZE = 1

    @BeforeTest // Clear cache before each test method
    fun setup() {
        FontPointUtils.clearCache()
    }

    @AfterTest // Optional: Clear cache after each test
    fun teardown() {
        FontPointUtils.clearCache()
    }

    @Test
    fun estimateRecommendedPointSize_HD_SansSerif_Plain() {
        val fontName = Font.SANS_SERIF // Use logical font name
        val fontStyle = Font.PLAIN
        val width = 1920
        val height = 1080
        val expectedPointSize = 25 // EXAMPLE - ADJUST
        val actualSize = FontPointUtils.estimateRecommendedPointSize(fontName, fontStyle, width, height)

        assertTrue(
            actualSize in (expectedPointSize - 2)..(expectedPointSize + 2),
            "Point size for HD SansSerif Plain ($actualSize) not close to expected ($expectedPointSize). Font metrics may differ."
        )
        println("Test HD_SansSerif_Plain: Expected around $expectedPointSize, Got $actualSize (Env-dependent)")
    }

    @Test
    fun


;
  }

  parseVariableDeclaration(
    tn: Tokenizer,
    parentFlags: CommonFlags,
    parentDecorators: DecoratorNode[] | null,
    isFor: bool = false
  ): VariableDeclaration | null {

    // before: Identifier (':' Type)? ('=' Expression)?

    if (!tn.skipIdentifier()) {
      this.error(
        DiagnosticCode.Identifier_expected,
        tn.range()
      );
      return null;
    }
    let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());
    if (isIllegalVariableIdentifier(identifier.text)) {
      this.error(
        DiagnosticCode.Identifier_expected,
        identifier.range
      );
    }
    let flags = parentFlags;
    if (tn.skip(Token.Exclamation)) {
      flags |= CommonFlags.DefinitelyAssigned;
    }

    let type: TypeNode | null = null;
    if (tn.skip(Token.Colon)) {
      type = this.parseType(tn, true);
    }

    let initializer: Expression | null = null;
    if (tn.skip(Token.Equals)) {
      if (flags & CommonFlags.Ambient) {
        this.error(
          DiagnosticCode.Initializers_are_not_allowed_in_ambient_contexts,
          tn.range()
        ); // recoverable
      }
      initializer = this.parseExpression(tn, Precedence.Comma + 1);
      if (!initializer) return null;
      if (flags & CommonFlags.DefinitelyAssigned) {
        this.error(
          DiagnosticCode.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions,
          initializer.range
        );
      }
    } else if (!isFor) {
      if (flags & CommonFlags.Const) {
        if (!(flags & CommonFlags.Ambient)) {
          this.error(
            DiagnosticCode._const_declarations_must_be_initialized,
            identifier.range
          ); // recoverable
        }
      } else if (!type) { // neither type nor initializer
        this.error(
          DiagnosticCode.Type_expected,
          tn.range(tn.pos)
        ); // recoverable
      }
    }
    let range = Range.join(identifier.range, tn.range());
    if ((flags & CommonFlags.DefinitelyAssigned) != 0 && (flags & CommonFlags.Ambient) != 0) {
      this.error(
        DiagnosticCode.A_definite_assignment_assertion_is_not_permitted_in_this_context,
        range
      );
    }
    return Node.createVariableDeclaration(
      identifier,
      parentDecorators,
      flags,
      type,
      initializer,
      range
    );
  }

  parseEnum(
    tn: Tokenizer,
    flags: CommonFlags,
    decorators: DecoratorNode[] | null,
    startPos: i32
  ): EnumDeclaration | null {

    // at 'enum': Identifier '{' (EnumValueDeclaration (',' EnumValueDeclaration )*)? '}' ';'?

    if (tn.next() != Token.Identifier) {
      this.error(
        DiagnosticCode.Identifier_expected,
        tn.range()
      );
      return null;
    }
    let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());
    if (tn.next() != Token.OpenBrace) {
      this.error(
        DiagnosticCode._0_expected,
        tn.range(), "{"
      );
      return null;
    }
    let members = new Array<EnumValueDeclaration>();
    while (!tn.skip(Token.CloseBrace)) {
      let member = this.parseEnumValue(tn, CommonFlags.None);
      if (!member) return null;
      members.push(member);
      if (!tn.skip(Token.Comma)) {
        if (tn.skip(Token.CloseBrace)) {
          break;
        } else {
          this.error(


 text: String? = null
        var html: String? = null
        for (clip in clips.getClipboardsList()) {
            when (clip.format) {
                    ClipboardFormat.Text -> {
                        mimeTypes.add(ClipDescription.MIMETYPE_TEXT_PLAIN)
                    text = String(clip.content.toByteArray(), Charsets.UTF_8)
                }
                ClipboardFormat.Html -> {
                    mimeTypes.add(ClipDescription.MIMETYPE_TEXT_HTML)
                    html = String(clip.content.toByteArray(), Charsets.UTF_8)
                }
                ClipboardFormat.ImageRgba -> {
                }
                ClipboardFormat.ImagePng -> {
                }
                else -> {
                    Log.e(logTag, "Unsupported clipboard format: ${clip.format}")
                }
            }
        }

        val clipDescription = ClipDescription("clipboard", mimeTypes.toTypedArray())
        var item: ClipData.Item? = null
        if (text == null) {
            Log.e(logTag, "No text content in clipboard")
            return
        } else {
            if (html == null) {
                item = ClipData.Item(text)
            } else {
                item = ClipData.Item(text, html)
            }
        }
        if (item == null) {
            Log.e(logTag, "No item in clipboard")
            return
        }
        val clipData = ClipData(clipDescription, item)
        lastUpdatedClipData = clipData
        clipboardManager.setPrimaryClip(clipData)
    }
}
// Day10

import util.Direction
import java.io.File

val directions = mapOf<Pair<Char, Direction>, Direction>(
    Pair('|', Direction.UP) to Direction.UP,
    Pair('|', Direction.DOWN) to Direction.DOWN,
    Pair('-', Direction.LEFT) to Direction.LEFT,
    Pair('-', Direction.RIGHT) to Direction.RIGHT,
    Pair('L', Direction.DOWN) to Direction.RIGHT,
    Pair('L', Direction.LEFT) to Direction.UP,
    Pair('J', Direction.DOWN) to Direction.LEFT,
    Pair('J', Direction.RIGHT) to Direction.UP,
    Pair('7', Direction.UP) to Direction.LEFT,
    Pair('7', Direction.RIGHT) to Direction.DOWN,
    Pair('F', Direction.UP) to Direction.RIGHT,
    Pair('F', Direction.LEFT) to Direction.DOWN,
)

fun move(pos: Pair<Int, Int>, dir: Direction): Pair<Int, Int> {
    return when (dir) {
        Direction.UP -> Pair(pos.first, pos.second - 1)
        Direction.DOWN -> Pair(pos.first, pos.second + 1)
        Direction.LEFT -> Pair(pos.first - 1, pos.second)
        Direction.RIGHT -> Pair(pos.first + 1, pos.second)
    }
}

fun main(args: Array<String>) {
    val map = mutableMapOf<Pair<Int, Int>, Char>()
    val input = File("input10.txt").readLines()
    var start: Pair<Int, Int>? = null
    var maxX = 0
    var maxY = 0
    input.forEachIndexed { y, line ->
        line.forEachIndexed { x, char ->
            if (char == 'S') {
                start = Pair(x, y)
            }
            map[Pair(x, y)] = char
            print(char)
            maxX = x
        }
        println()
        maxY = y
    }

    var maxDist = 0
    var maxPath = listOf<Pair<Int, Int>>()
    var initialDir: Direction? = null
    var finalDir: Direction? = null
    listOf(Direction.DOWN, Direction.LEFT, Direction.UP, Direction.RIGHT).forEach { startDir ->
        println("starting at ${start} ${startDir}")

        var pos = move(start!!, startDir)


ck: bool) -> bool {
        let rng = &mut rng_seed_now();
        let deadline = Instant::now() + timeout;
        loop {
            let r = timeout_at(deadline, async {
                if self.lock_internal(is_write_lock) {
                    return true;
                }
                sleep_until(deadline, LOCK_RETRY_INTERVAL, Some(rng)).await;
                return false;
            })
            .await;
            match r {
                Ok(locked) => {
                    if locked {
                        return true;
                    }
                }
                Err(_) => {
                    return false; // timeout
                }
            }
        }
    }

    fn lock_internal(&mut self, is_write_lock: bool) -> bool {
        let mut locked = false;
        if is_write_lock {
            if self.refs == 0 && !self.is_write_lock {
                self.refs = 1;
                self.is_write_lock = true;
                locked = true;
            }
        } else {
            if !self.is_write_lock {
                self.refs += 1;
                locked = true;
            }
        }
        locked
    }

    fn unlock_internal(&mut self, is_write_lock: bool) -> bool {
        let mut unlocked = false;
        if is_write_lock {
            if self.is_write_lock && self.refs == 1 {
                self.refs = 0;
                self.is_write_lock = false;
                unlocked = true;
            }
        } else {
            if !self.is_write_lock && self.refs > 1 {
                self.refs -= 1;
                unlocked = true;
            }
        }
        unlocked
    }
}
<reponame>tuplecats/docker-client<gh_stars>1-10
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Default)]
pub struct IPAMConfigBuilder {

    ipv4_address: String,

    ipv6_address: String,

    link_local_ips: Vec<String>

}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct IPAMConfig {

    #[serde(rename = "IPV4Address")]
    ipv4_address: String,

    #[serde(rename = "IPV6Address")]
    ipv6_address: String,

    #[serde(rename = "LinkLocalIPs")]
    link_local_ips: Vec<String>

}

impl IPAMConfigBuilder {

    pub fn new() -> Self {
        IPAMConfigBuilder::default()
    }

    pub fn ipv4_address(&mut self, address: String) -> &mut Self {
        self.ipv4_address = address.clone();

        self
    }

    pub fn ipv6_address(&mut self, address: String) -> &mut Self {
        self.ipv6_address = address.clone();

        self
    }

    pub fn add_local_ip(&mut self, address: String) -> &mut Self {
        self.link_local_ips.push(address.clone());

        self
    }

    pub fn build(&self) -> IPAMConfig {
        IPAMConfig {
            ipv4_address: self.ipv4_address.clone(),
            ipv6_address: self.ipv6_address.clone(),
            link_local_ips: self.link_local_ips.clone()
        }
    }

}<filename>src/model/specs/dns/mod.rs<gh_stars>1-10
mod record;
mod spec;

pub use self::{record::*, spec::*};
mod constants;
mod glyph;
mod text;
mod tilemap;

pub use constants::*;
pub use glyph::


P_ARROW:
                this.moveForward = false;
                break;

                case config.Keys.A:
                case config.Keys.LEFT_ARROW:

                this.moveLeft= false;
                break;

                case config.Keys.S:
                case config.Keys.DOWN_ARROW:
                this.moveBackward = false;
                break;

                case config.Keys.D:
                case config.Keys.RIGHT_ARROW:
                this.moveRight = false;
                break;

                case config.Keys.SPACE:
                this.fire = false;

                break;

            }

        }

    }
}import {Directive, ElementRef, Input} from '@angular/core';
@Directive({
    selector: '[myHighlight]',
    // The host property refers to the DOM element that hosts our attribute directive
    host: {
        '(mouseenter)': 'onMouseEnter()',
        '(mouseleave)': 'onMouseLeave()'
    }
})
export class HighlightDirective {
    private _defaultColor = 'red';
    private _el:HTMLElement;

    // "input" property because data flows from the binding expression into our directive
    // Maybe we don't want that property name inside the directive perhaps because it doesn't express our intention well. We can alias the highlightColor property with the attribute name by passing myHighlight into the @Input decorator. (but we could use same name like this: @Input() myHighlight: string;)
    @Input('myHighlight') highlightColor: string;

    @Input() set defaultColor(colorName:string){
        this._defaultColor = colorName || this._defaultColor;
    }

    constructor(el: ElementRef) { this._el = el.nativeElement; }

    onMouseEnter() { this._highlight(this.highlightColor || this._defaultColor); }
    onMouseLeave() { this._highlight(null); }

    private _highlight(color:string) {
        this._el.style.backgroundColor = color;
    }
}
import { describe, expect, test } from "vitest";
import { compDict } from "../contrib/Functions.js";
import { numsOf } from "../contrib/Utils.js";
import { makeCircle } from "../shapes/Circle.js";
import { makeEllipse } from "../shapes/Ellipse.js";
import { makeImage } from "../shapes/Image.js";
import { makeLine } from "../shapes/Line.js";
import { makePath } from "../shapes/Path.js";
import { makePolygon } from "../shapes/Polygon.js";
import { makePolyline } from "../shapes/Polyline.js";
import { makeRectangle } from "../shapes/Rectangle.js";
import { makeCanvas, simpleContext } from "../shapes/Samplers.js";
import * as ad from "../types/ad.js";
import { Poly, Scale } from "../types/shapes.js";
import { black, floatV, ptListV, vectorV } from "../utils/Util.js";
import {
  BBox,
  bboxFromCircle,
  bboxFromEllipse,
  bboxFromLinelike,
  bboxFromPath,
  bboxFromPolygon,
  bboxFromRect,
  bboxFromRectlike,
} from "./BBox.js";

const canvas = makeCanvas(800, 700);

const expectBbox = (
  actual: BBox,
  expected: { width: number; height: number; center: [number, number] },
) => {
  const [width, height, x, y] = numsOf([
    actual.width,
    actual.height,
    actual.center[0],
    actual.center[1],
  ]);
  expect(width).toBeCloseTo(expected.width);
  expect(height).toBeCloseTo(expected.height);
  expect(x).toBeCloseTo(expected.center[0]);
  expect(y).toBeCloseTo(expected.center[1]);
};

const polyProps = (): Poly<ad.Num> & Scale<ad.Num> => ({
  points: ptListV(
    // https://en.wikipedia.org/wiki/Polygon#/media/File:Assorted_polygons.svg
    [
      [564, 24],
      [733, 54],
      [755, 154],
      [693, 257],
      [548, 216],
      [571, 145],
      [630, 146],
      [617, 180],
      [664, 196],


/*
 * Copyright 2010 IBM Corp, Benjamin Herrenschmidt <benh@kernel.crashing.org>
 *
 * Generic idle routine for Book3E processors
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

#include <linux/threads.h>
#include <asm/reg.h>
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
#include <asm/ppc-opcode.h>
#include <asm/processor.h>
#include <asm/thread_info.h>

/* 64-bit version only for now */
#ifdef CONFIG_PPC64

_GLOBAL(book3e_idle)
	/* Save LR for later */
	mflr	r0
	std	r0,16(r1)

	/* Hard disable interrupts */
	wrteei	0

	/* Now check if an interrupt came in while we were soft disabled
	 * since we may otherwise lose it (doorbells etc...). We know
	 * that since PACAHARDIRQEN will have been cleared in that case.
	 */
	lbz	r3,PACAHARDIRQEN(r13)
	cmpwi	cr0,r3,0
	beqlr

	/* Now we are going to mark ourse


usel - Video Plugin
 */
.owl-carousel .owl-video-wrapper {
  position: relative;
  height: 100%;
  background: #000;
}
.owl-carousel .owl-video-play-icon {
  position: absolute;
  height: 80px;
  width: 80px;
  left: 50%;
  top: 50%;
  margin-left: -40px;
  margin-top: -40px;
  background: url("owl.video.play.png") no-repeat;
  cursor: pointer;
  z-index: 1;
  -webkit-backface-visibility: hidden;
  -webkit-transition: scale 100ms ease;
  -moz-transition: scale 100ms ease;
  -ms-transition: scale 100ms ease;
  -o-transition: scale 100ms ease;
  transition: scale 100ms ease;
}
.owl-carousel .owl-video-play-icon:hover {
  -webkit-transition: scale(1.3, 1.3);
  -moz-transition: scale(1.3, 1.3);
  -ms-transition: scale(1.3, 1.3);
  -o-transition: scale(1.3, 1.3);
  transition: scale(1.3, 1.3);
}
.owl-carousel .owl-video-playing .owl-video-tn,
.owl-carousel .owl-video-playing .owl-video-play-icon {
  display: none;
}
.owl-carousel .owl-video-tn {
  opacity: 0;
  height: 100%;
  background-position: center center;
  background-repeat: no-repeat;
  -webkit-background-size: contain;
  -moz-background-size: contain;
  -o-background-size: contain;
  background-size: contain;
  -webkit-transition: opacity 400ms ease;
  -moz-transition: opacity 400ms ease;
  -ms-transition: opacity 400ms ease;
  -o-transition: opacity 400ms ease;
  transition: opacity 400ms ease;
}
.owl-carousel .owl-video-frame {
  position: relative;
  z-index: 1;
}
@selected-range-bg: #A7E69C;

.calendar-button-base {
  background: #eee;
  cursor: pointer;
  display: block;
  border: 0;
}

.date-range {
  display: flex;
}

.date-range__calendar {
  flex: 1;
  margin-right: 10px;
}

.date-range__quicklist {
  flex: 1;
  max-width: 150px;
  margin-right: 10px;
}

.calendar__container {
}

.calendar {
  width: 100%;
  border-spacing: 0;
}

.calendar__header-cell {
  padding: 1px;
}

.calendar-header {
  display: flex;
  flex-direction: row;
}

.calendar-header__content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.calendar-header__prev-month {
  .calendar-button-base;

  &:hover {
    background: #eee;
  }
  &:before {
    content: "<";
  }
}

.calendar-header__next-month {
  .calendar-button-base;

  &:hover {
    background: #eee;
  }
  &:before {
    content: ">";
  }
}
.calendar__month-name {
  flex: 1;
}

.calendar-quicklist {
  padding: 0;
}

.calendar-quicklist__title {
  margin: 0;
  margin-bottom: 10px;
  padding: 0 4px;
}

.calendar-quicklist__item {
  display: block;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  padding: 2px 4px;

  &:hover {
    background: #eee;
  }
  &:


'''
Data-Dependent Depth Discretization (D4)
Get depth level boundary values
- Hang Chu
'''
import os
import png
import numpy as np

'''
Function: read_img_16bit
    -Read a 16-bit png
in:
    -imgpath: path of image
out:
    -px_array: uint16 numpy array of image
'''
def read_img_16bit(imgpath):
    reader = png.Reader(imgpath)
    pngdata = reader.read()
    px_array = np.array(map(np.uint16, pngdata[2]))
    return px_array

'''
Function: get_depth_levels
    -Get depth level values with the proposed D4 scheme
-in:
    -d_img_path: 16-bit png depth image directory
    -num_of_levels: SurfConv levels
    -gamma: importance index of SurfConv
    -max_d: depth in meters corresponding to max 16-bit png value
    -num_of_bins: histogram resolution
-out:
    -depth_levels: colums are min/max/avg
'''
def get_depth_levels(
        d_img_path,
        num_of_levels,
        gamma,
        max_d=90.0,
        num_of_bins=1000):
    img_list = os.listdir(d_img_path)
    d_all = np.zeros((0))
    print('Collecting pixels...')
    for f in img_list:
        img = read_img_16bit(os.path.join(d_img_path, f))
        img = img.astype(float) / 65535.0 * max_d
        mask = img > 0
        d_all = np.append(d_all, img[mask])
    print('Computing histogram...')
    h, h_edges = np.histogram(d_all, bins=num_of_bins)
    h_c = (h_edges[:-1] + h_edges[1:]) / 2.0
    h_volume = np.multiply(h.astype(float), np.power(h_c, gamma))
    print('Finding boundary values...')
    idx = 0
    volume_thres = np.sum(h_volume) / num_of_levels
    depth_divide_id = np.zeros((num_of_levels, 2), dtype=int)
    for i in range(num_of_levels):
        volume_acc = 0.0
        depth_divide_id[i, 0] = int(idx)
        while True:
            volume_acc += h_volume[idx]
            idx += 1
            if idx > (num_of_bins - 1):
                idx -= 1
                break
            if volume_acc >= volume_thres:
                break
        depth_divide_id[i, 1] = int(idx)
    depth_levels = np.zeros((num_of_levels, 3))
    for i in range(num_of_levels):
        depth_levels[i, 0] = h_c[depth_divide_id[i, 0]]
        depth_levels[i, 1] = h_c[depth_divide_id[i, 1]]
        h_c_subset = h_c[depth_divide_id[i, 0]:(depth_divide_id[i, 1] + 1)]
        h_volume_subset = h_volume[depth_divide_id[i, 0]:(depth_divide_id[i, 1] + 1)]
        depth_levels[i, 2] = np.sum(np.multiply(h_c_subset, h_volume_subset)) / np.sum(h_volume_subset)
    depth_levels[0, 0] = 0.0
    depth_levels[num_of_levels - 1, 1] = np.inf
    return depth_levels

'''
Testing if main
'''
if __name__ == '__main__':
    d_img_path = '../dataset/KITTI/d_max90m_16bit/train/'
    num_of_levels = 4
    gamma = 1.0
    max_d = 90.0
    depth_levels = get_depth_levels(d_img_path, num_of_levels, gamma, max_d)
    print('--Depth images path: ' + d_img_path)
    print('--Number of SurfConv levels: ' + str(num_of_levels))
    print('--SurfConv importance index value: ' + str(gamma))
    print('Result depth levels (min/max/avg):')
    print(depth_levels)


地与实践 》**

**嘉宾介绍**

张稀虹，蚂蚁集团技术专家，专注于云原生相关技术在业务生产中的落地与实践，开源项目 MOSN 核心成员，目前关注云原生 ServiceMesh、Serverless 等相关领域。

**议题简介**

- ServiceMesh 可谓是站在风口上的技术热点，流量控制正是 Mesh 架构下的核心功能。Mesh 的架构优势使得业务可以更低成本的使用上通用的限流熔断能力，本次分享为大家介绍蚂蚁集团的 Mesh 限流能力的建设以及业务落地推广的实践经验。

**听众收获**

- 了解 Mesh 架构下的限流熔断技术优势
- 分享蚂蚁集团 Mesh 限流熔断能力建设经验
- 拓宽思路了解限流熔断未来的探索方向

**《Erda 关于云原生数据开发平台的思考和实践》**

**嘉宾介绍**

侯璐瑶，高级技术专家，Erda 数据团队负责人，主要负责基于云原生的数据平台的架构设计、负责数据应用产品架构和产品演进，对于大数据领域数据组件和数据应用等方向有比较深入的研究和实践经验。

**议题简介**

- 数据 on 云原生是必然的路径，云原生对于数据平台带来了比传统平台更容易的扩展性和便捷性。本次分享主要介绍 Erda 数据开发平台在云原生上的建设和实战经验。

**听众收获**

- 了解云原生的整体数据架构；
- 分享 Erda 的落地实践经验。

## 了解更多技术干货

使用钉钉搜索群号：**34197075**，即可加入，获取一手开源技术干货；

或微信扫码关注“金融级分布式架构”微信公众号👇

>![](https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*5aK0RYuH9vgAAAAAAAAAAAAAARQnAQ)
+++
draft= false
title = "Activities"
description = "SOFAStack community events"
+++

## Kube looks awesome. Who is it for?

We designed Kube as a small and inconspicuous helper for the professional developers and designers. Why an emphasis on “professional”? Well, because Kube is neither a kit


using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using gMKVToolNix.Forms;
using gMKVToolNix.MkvExtract;
using gMKVToolNix.Segments;

namespace gMKVToolNix.Jobs
{
    public delegate void gMkvExtractMethod(object parameterList);

    [Serializable]
    [System.Xml.Serialization.XmlInclude(typeof(List<gMKVSegment>))]
    [System.Xml.Serialization.XmlInclude(typeof(gMKVSegment))]
    [System.Xml.Serialization.XmlInclude(typeof(gMKVTrack))]
    [System.Xml.Serialization.XmlInclude(typeof(gMKVChapter))]
    [System.Xml.Serialization.XmlInclude(typeof(gMKVAttachment))]
    public class gMKVJob
    {
        public FormMkvExtractionMode ExtractionMode { get; set; }

        public string MKVToolnixPath { get; set; }

        public gMKVExtractSegmentsParameters ParametersList { get; set; }

        public gMKVJob(FormMkvExtractionMode argExtractionMode, string argMKVToolnixPath, gMKVExtractSegmentsParameters argParameters)
        {
            ExtractionMode = argExtractionMode;
            MKVToolnixPath = argMKVToolnixPath;
            ParametersList = argParameters;
        }

        public gMkvExtractMethod ExtractMethod(gMKVExtract argGmkvExtract)
        {
            switch (ExtractionMode)
            {
                case FormMkvExtractionMode.Tracks:
                    return argGmkvExtract.ExtractMKVSegmentsThreaded;
                case FormMkvExtractionMode.Cue_Sheet:
                    return argGmkvExtract.ExtractMkvCuesheetThreaded;
                case FormMkvExtractionMode.Tags:
                    return argGmkvExtract.ExtractMkvTagsThreaded;
                case FormMkvExtractionMode.Timecodes:
                    return argGmkvExtract.ExtractMKVTimecodesThreaded;
                case FormMkvExtractionMode.Tracks_And_Timecodes:
                    return argGmkvExtract.ExtractMKVSegmentsThreaded;
                case FormMkvExtractionMode.Cues:
                    return argGmkvExtract.ExtractMKVCuesThreaded;
                case FormMkvExtractionMode.Tracks_And_Cues:
                    return argGmkvExtract.ExtractMKVSegmentsThreaded;
                case FormMkvExtractionMode.Tracks_And_Cues_And_Timecodes:
                    return argGmkvExtract.ExtractMKVSegmentsThreaded;
                default:
                    throw new Exception("Unsupported Extraction Mode!");
            }
        }

        // For serialization only!!!
        internal gMKVJob() { }

        private string GetTracks(List<gMKVSegment> argSegmentList)
        {
            StringBuilder trackBuilder = new StringBuilder();
            foreach (gMKVSegment item in argSegmentList)
            {
                if (item is gMKVTrack track)
                {
                    trackBuilder.AppendFormat("[{0}:{1}]",
                        track.TrackType.ToString().Substring(0, 3),
                        track.TrackID);
                }
                else if (item is gMKVAttachment attachment)
                {
                    trackBuilder.AppendFormat("[Att:{0}]",


ACCESS));
        return EGL_FALSE;
    }

    if (eglSurface->getTextureFormat() == EGL_NO_TEXTURE)
    {
        SetGlobalError(Error(EGL_BAD_MATCH));
        return EGL_FALSE;
    }

    gl::Context *context = GetGlobalContext();
    if (context)
    {
        gl::Texture *textureObject = context->getTargetTexture(GL_TEXTURE_2D);
        ASSERT(textureObject != NULL);

        if (textureObject->isImmutable())
        {
            SetGlobalError(Error(EGL_BAD_MATCH));
            return EGL_FALSE;
        }

        eglSurface->bindTexImage(textureObject, buffer);
    }

    SetGlobalError(Error(EGL_SUCCESS));
    return EGL_TRUE;
}

EGLBoolean EGLAPIENTRY SurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
{
    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint attribute = %d, EGLint value = %d)",
        dpy, surface, attribute, value);

    Display *display = static_cast<Display*>(dpy);
    Surface *eglSurface = static_cast<Surface*>(surface);

    Error error = ValidateSurface(display, eglSurface);
    if (error.isError())
    {
        SetGlobalError(error);
        return EGL_FALSE;
    }

    UNIMPLEMENTED();   // FIXME

    SetGlobalError(Error(EGL_SUCCESS));
    return EGL_TRUE;
}

EGLBoolean EGLAPIENTRY ReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
{
    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint buffer = %d)", dpy, surface, buffer);

    Display *display = static_cast<Display*>(dpy);
    Surface *eglSurface = static_cast<Surface*>(surface);

    Error error = ValidateSurface(display, eglSurface);
    if (error.isError())
    {
        SetGlobalError(error);
        return EGL_FALSE;
    }

    if (buffer != EGL_BACK_BUFFER)
    {
        SetGlobalError(Error(EGL_BAD_PARAMETER));
        return EGL_FALSE;
    }

    if (surface == EGL_NO_SURFACE || eglSurface->getType() == EGL_WINDOW_BIT)
    {
        SetGlobalError(Error(EGL_BAD_SURFACE));
        return EGL_FALSE;
    }

    if (eglSurface->getTextureFormat() == EGL_NO_TEXTURE)
    {
        SetGlobalError(Error(EGL_BAD_MATCH));
        return EGL_FALSE;
    }

    gl::Texture *texture = eglSurface->getBoundTexture();

    if (texture)
    {
        eglSurface->releaseTexImage(buffer);
    }

    SetGlobalError(Error(EGL_SUCCESS));
    return EGL_TRUE;
}

EGLBoolean EGLAPIENTRY SwapInterval(EGLDisplay dpy, EGLint interval)
{
    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLint interval = %d)", dpy, interval);

    Display *display = static_cast<Display*>(dpy);

    Error error = ValidateDisplay(display);
    if (error.isError())
    {
        SetGlobalError(error);
        return EGL_FALSE;
    }

    Surface *draw_surface = static_cast<Surface*>(GetGlobalDrawSurface());

    if (draw_surface == NULL)
    {
        SetGlobalError(Error(EGL_BAD_SURFACE));
        return EGL_FALSE;
    }

    const egl::Config *surfaceConfig = draw_surfa


sY,  sZ, 0.0,
        //                uX,  uY,  uZ, 0.0,
        //               -fX, -fY, -fZ, 0.0,
        //                0.0,  0.0,  0.0, 1.0);
        //var translation = new Matrix4(
        //                1.0, 0.0, 0.0, -eye.x,
        //                0.0, 1.0, 0.0, -eye.y,
        //                0.0, 0.0, 1.0, -eye.z,
        //                0.0, 0.0, 0.0, 1.0);
        //return rotation.multiply(translation);
        if (!defined(result)) {
            return new Matrix4(
                    sX,   sY,  sZ, t0,
                    uX,   uY,  uZ, t1,
                   -fX,  -fY, -fZ, t2,
                    0.0, 0.0, 0.0, 1.0);
        }
        result[0] = sX;
        result[1] = uX;
        result[2] = -fX;
        result[3] = 0.0;
        result[4] = sY;
        result[5] = uY;
        result[6] = -fY;
        result[7] = 0.0;
        result[8] = sZ;
        result[9] = uZ;
        result[10] = -fZ;
        result[11] = 0.0;
        result[12] = t0;
        result[13] = t1;
        result[14] = t2;
        result[15] = 1.0;
        return result;

    };

     /**
      * Computes a Matrix4 instance representing a perspective transformation matrix.
      *
      * @param {Number} fovY The field of view along the Y axis in radians.
      * @param {Number} aspectRatio The aspect ratio.
      * @param {Number} near The distance to the near plane in meters.
      * @param {Number} far The distance to the far plane in meters.
      * @param {Matrix4} result The object in which the result will be stored.
      * @returns {Matrix4} The modified result parameter.
      *
      * @exception {DeveloperError} fovY must be in [0, PI).
      * @exception {DeveloperError} aspectRatio must be greater than zero.
      * @exception {DeveloperError} near must be greater than zero.
      * @exception {DeveloperError} far must be greater than zero.
      */
    Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) {
                if (fovY <= 0.0 || fovY > Math.PI) {
            throw new DeveloperError('fovY must be in [0, PI).');
        }
        if (aspectRatio <= 0.0) {
            throw new DeveloperError('aspectRatio must be greater than zero.');
        }
        if (near <= 0.0) {
            throw new DeveloperError('near must be greater than zero.');
        }
        if (far <= 0.0) {
            throw new DeveloperError('far must be greater than zero.');
        }
        if (!defined(result)) {
            throw new DeveloperError('result is required');
        }

        var bottom = Math.tan(fovY * 0.5);

        var column1Row1 = 1.0 / bottom;
        var column0Row0 = column1Row1 / aspectRatio;
        var column2Row2 = (far + near) / (near - far);
        var column3Row2 = (2.0 * far * near) / (near - far);

        result[0] = column0Row0;
        result[1] = 0.0;
        result[2] = 0.0;
        result[3] = 0.0;
        result[4] = 0.0;
        result[5] = column1Row1;
        result[6] = 0.0;
        result[7] = 0.0;
        result[8] = 0.0;
        result[9] = 0.0;
        result[10] = column2Row2;
        result[11] = -1.0;
        result[12] = 0.0;
        result[13] = 0.0;
        result[14] = column3R


firestore import get_database
from src.utils import logger

def safe_database_operation(database_name: str):
    """Operação segura com tratamento de erros."""

    db = get_database(database_name)

    if not db:
        logger.error(f"Banco {database_name} não disponível")
        return None

    try:
        # Sua operação aqui
        result = db.collection('test').limit(1).get()
        return result
    except Exception as e:
        logger.error(f"Erro ao acessar {database_name}: {e}")
        return None
`$language

## Logs e Monitoramento

O sistema gera logs detalhados sobre:

- Inicialização de conexões
- Seleção do banco principal
- Erros de conectividade
- Operações em bancos específicos

Exemplo de logs:

```text
INFO: Conexão estabelecida com banco: (default)
INFO: Conexão estabelecida com banco: knn-benefits
INFO: Banco principal definido: (default)
WARNING: Banco analytics não encontrado, usando banco principal
`$language

## Script de Teste

Use o script de exemplo para testar a funcionalidade:

```bash
python scripts/examples/multi_database_example.py
`$language

Este script demonstra:

- Listagem de bancos disponíveis
- Acesso ao banco principal
- Operações em bancos específicos
- Testes de conectividade
- Alternância entre bancos

## Migração de Código Existente

### Antes (código antigo)

```python
from src.config import FB_PROJECT_ID
from src.db.firestore import db

# Código usava FB_PROJECT_ID

project = FB_PROJECT_ID
`$language

### Depois (código atualizado)

```python
from src.config import FIRESTORE_PROJECT
from src.db.firestore import db, get_database

# Agora usa FIRESTORE_PROJECT

project = FIRESTORE_PROJECT

# Pode acessar bancos específicos

specific_db = get_database('knn-benefits')
`$language

## Considerações de Performance

1. **Conexões Reutilizadas**: As conexões são inicializadas uma vez e reutilizadas
2. **Lazy Loading**: Bancos são conectados apenas se estiverem na lista configurada
3. **Cache de Clientes**: Os clientes Firestore são armazenados em cache
4. **Fallback Inteligente**: Se um banco não estiver disponível, usa o principal

## Troubleshooting

### Problema: Banco não encontrado

```text
WARNING: Banco analytics não encontrado, usando banco principal
`$language

**Solução**: Verifique se o banco está listado em `FIRESTORE_DATABASES`

### Problema: Erro de inicialização

```text
ERROR: Erro ao conectar com banco knn-benefits: [Firestore] Database 'knn-benefits' does not exist
`$language

**Solução**: Verifique se o banco existe no projeto Firebase

### Problema: Credenciais

```text
ERROR: Erro ao inicializar Firebase com credenciais padrão
`$language

**Solução**: Configure as credenciais do Firebase ou use o emulador

## Migração para google-cloud-firestore

### Mudanças na Implementação

A partir da versão atual, o sistema migrou do `firebase-admin` para `google-cloud-firestore` para melhor suporte a múltiplos bancos:

#### Antes (firebase-admin)

```python
import firebase_admin
from firebase_admin import firestore


tory.findByName('any_name');

      expect(promise).rejects.toThrow(new Error());
    });

    test('should be successfully return the found tag', async () => {
      jest.spyOn(prisma.tag, 'findFirst').mockResolvedValue(makeFakeTag());

      expect(await repository.findByName('any_name')).toEqual(makeFakeTag());
    });
  });

  describe('findAll', () => {
    test('should be throw when findAll throws', async () => {
      jest.spyOn(prisma.tag, 'findMany').mockRejectedValue(new Error());

      const promise = repository.findAll();

      expect(promise).rejects.toThrow(new Error());
    });

    test('should be successfully return all tags', async () => {
      jest
        .spyOn(prisma.tag, 'findMany')
        .mockResolvedValue(makeFakeFindAllTags());

      expect(await repository.findAll()).toEqual(makeFakeFindAllTags());
    });
  });
});
import IColorModel from "./ColorModels/ColorModel";
import IColorSpace, { creatColorSpace } from "./ColorSpace/ColorSpace";
import { IObjectHSL, IObjectHSV, IObjectRGB, IObjectHWB, IObjectLab, IObjectXYZ } from "./core.const";
import ColorSpace from "./ColorSpace/ColorSpace";
export default class NulliceColor {
    colorModel?: IColorModel<any>;
    colorSpace?: IColorSpace;
    alpha: number;
    /**
     * 所有支持的色彩模型
     */
    static ColorModels: {
        RGB: IColorModel<IObjectRGB>;
        HSL: IColorModel<IObjectHSL>;
        HSV: IColorModel<IObjectHSV>;
        HWB: IColorModel<IObjectHWB>;
        Lab: IColorModel<IObjectLab>;
        XYZ: IColorModel<IObjectXYZ>;
    };
    static ColorSpaces: {
        sRGB: IColorSpace;
        sRGB_D65: IColorSpace;
        DisplayP3: IColorSpace;
        Rec709: IColorSpace;
        Rec2020: IColorSpace;
        ACES_CG_Linear: IColorSpace;
        AdobeRGB: IColorSpace;
        CIE_RGB: IColorSpace;
        AppleRGB: IColorSpace;
        ColorMatchRGB: IColorSpace;
        ProPhotoRGB: IColorSpace;
    };
    /** 根据配置创建色彩空间*/
    static creatColorSpace: typeof creatColorSpace;
    /** 根据色彩空间名获取色彩空间*/
    static getColorSpaceByName(name: string): any;
    constructor(...args: any[]);
    /**
     * 根据一个输入设置色彩值
     * @param args
     */
    set(...args: any[]): void;
    /**
     * 改变色彩空间
     * @param newColorSpace
     */
    changeColorSpace(newColorSpace: ColorSpace): NulliceColor;
    /**
     * 获取当前色彩在制定色彩空间的拷贝
     * @param newColorSpace
     * @param change 修改自身
     * @return {any}
     */
    getCopyWithColorSpace(newColorSpace: ColorSpace, change?: boolean): NulliceColor;
    /**
     * 基于当前色彩返回一个新的 ColorRGB 实例
     * @param targetColorSpace
     */
    getRGB(targetColorSpace?: IColorSpace): ColorRGB;
    /**
     * 基于当前色彩返回一个新的 ColorHSV 实例
     * @param targetColorSpace
     */
    getHSV(targetColorSpace?: IColorSpace): ColorHSV;
    /**
     * 基于当前色彩返回一个新的 ColorHSL 实例
     * @param targetColorSpace
     */
    getHSL(targetColorSpace?: IColorSpace): ColorHSV;
    /**
     * 基于当前色彩返回一个新的 ColorLab 实例
     * @param targetColorSpace
     */
    getLab(targetColorSpace?: IColorSpace): ColorHSV;
    /**
     * 基于当前色彩返回一个新的 ColorXYZ