 $150K; c1=Bachelors Degree\n"
        + "c0=$130K - $150K; c1=Graduate Degree\n"
        + "c0=$130K - $150K; c1=High School Degree\n"
        + "c0=$130K - $150K; c1=Partial College\n"
        + "c0=$130K - $150K; c1=Partial High School\n"
        + "c0=$150K +; c1=Bachelors Degree\n"
        + "c0=$150K +; c1=Graduate Degree\n"
        + "c0=$150K +; c1=High School Degree\n"
        + "c0=$150K +; c1=Partial College\n"
        + "c0=$150K +; c1=Partial High School\n"
        + "c0=$30K - $50K; c1=Bachelors Degree\n"
        + "c0=$30K - $50K; c1=Graduate Degree\n"
        + "c0=$30K - $50K; c1=High School Degree\n"
        + "c0=$30K - $50K; c1=Partial College\n"
        + "c0=$30K - $50K; c1=Partial High School\n"
        + "c0=$70K - $90K; c1=Bachelors Degree\n"
        + "c0=$70K - $90K; c1=Graduate Degree\n"
        + "c0=$70K - $90K; c1=High School Degree\n"
        + "c0=$70K - $90K; c1=Partial College\n"
        + "c0=$70K - $90K; c1=Partial High School\n"
        + "c0=$90K - $110K; c1=Bachelors Degree\n"
        + "c0=$90K - $110K; c1=Graduate Degree\n"
        + "c0=$90K - $110K; c1=High School Degree\n"
        + "c0=$90K - $110K; c1=Partial College\n"
        + "c0=$90K - $110K; c1=Partial High School\n",
      "ignore:select \"time_by_day\".\"the_year\" as \"c0\", \"product_class\".\"product_family\" as \"c1\", \"customer\".\"state_province\" as \"c2\", \"customer\".\"city\" as \"c3\", sum(\"sales_fact_1997\".\"unit_sales\") as \"m0\" from \"time_by_day\" as \"time_by_day\", \"sales_fact_1997\" as \"sales_fact_1997\", \"product_class\" as \"product_class\", \"product\" as \"product\", \"customer\" as \"customer\" where \"sales_fact_1997\".\"time_id\" = \"time_by_day\".\"time_id\" and \"time_by_day\".\"the_year\" = 1997 and \"sales_fact_1997\".\"product_id\" = \"product\".\"product_id\" and \"product\".\"product_class_id\" = \"product_class\".\"product_class_id\" and \"product_class\".\"product_family\" = 'Drink' and \"sales_fact_1997\".\"customer_id\" = \"customer\".\"customer_id\" and \"customer\".\"state_province\" = 'WA' and \"customer\".\"city\" in ('Anacortes', 'Ballard', 'Bellingham', 'Bremerton', 'Burien', 'Edmonds', 'Everett', 'Issaquah', 'Kirkland', 'Lynnwood', 'Marysville', 'Olympia', 'Port Orchard', 'Puyallup', 'Redmond', 'Renton', 'Seattle', 'Sedro Woolley', 'Spokane', 'Tacoma', 'Walla Walla', 'Yakima') group by \"time_by_day\".\"the_year\", \"product_class\".\"product_family\", \"customer\".\"state_province\", \"customer\".\"city\"",
      "c0=1997; c1=Drink; c2=WA; c3


code: string,
        name: string,
        dob: string,
        gender: string,
        address: string,
        pincode: string,
        email: string,
        phone: string,
        division: string,
        dateOfJoining: string,
        subjects: { name: string, code: string }[]
    ) {
        this.teachercode = teachercode;
        this.name = name;
        this.dob = dob;
        this.gender = gender;
        this.address = address;
        this.pincode = pincode;
        this.email = email;
        this.phone = phone;
        this.division = division;
        this.dateOfJoining = dateOfJoining;
        this.subjects = subjects;
    }
}import { Pipe, PipeTransform } from '@angular/core';

/*
 * Create initials from a name:
 * Matti => M.
 * Pekka-Liisa => P.-L.
 * Raija E. Ruusu => R. E. R.
 */
@Pipe({
  name: 'initials'
})
export class InitialsPipe implements PipeTransform {

  transform(value: string): string {
    // Can't use lookbehing for the first parenthesized group as it's not widely supported
    return value.replace(/(^| |\-)([^\s\-])[^\s\-]+/ig, "$1$2.");
  }
}
import { Entity } from './Entity'
import { UniqueId } from './UniqueId'

class TestEntity extends Entity<void> {
  constructor(props: void, id: UniqueId) {
    super(props, id)
  }
}

describe('Entity', () => {
  const UNIQUE_ID_1 = new UniqueId()
  const UNIQUE_ID_2 = new UniqueId()

  it('creates an Entity', () => {
    const entity = new TestEntity(undefined, UNIQUE_ID_1)

    expect(entity).toBeDefined()
  })

  describe('isEntity', () => {
    it('returns false if given value is undefined', () => {
      expect(Entity.isEntity(undefined)).toBeFalse()
    })

    it('returns false if given value is null', () => {
      expect(Entity.isEntity(null)).toBeFalse()
    })

    it('returns false if given value is an empty object', () => {
      expect(Entity.isEntity({})).toBeFalse()
    })

    it('returns true if given value is an entity', () => {
      const entity = new TestEntity(undefined, UNIQUE_ID_1)

      expect(Entity.isEntity(entity)).toBeTrue()
    })
  })

  describe('equals', () => {
    it('returns true when given entity is itself', () => {
      const entity = new TestEntity(undefined, UNIQUE_ID_1)

      expect(entity.equals(entity)).toBeTrue()
    })

    it('returns false when given entity has different ID', () => {
      const entity1 = new TestEntity(undefined, UNIQUE_ID_1)
      const entity2 = new TestEntity(undefined, UNIQUE_ID_2)

      expect(entity1.equals(entity2)).toBeFalse()
    })

    it('returns true when given entity has equal ID', () => {
      const entity1 = new TestEntity(undefined, UNIQUE_ID_1)
      const entity2 = new TestEntity(undefined, UNIQUE_ID_1)

      expect(entity1.equals(entity2)).toBeTrue()
    })
  })
})
import { MidaBrokerAccount } from "#brokers/MidaBrokerAccount";
import { MidaEvent } from "#events/MidaEvent";
import { MidaEmitter } from "#utilities/emitters/MidaEmitter";
import { GenericObject } from "#utilities/GenericObject";
import { MidaSymbolTick } from "#ticks/MidaSymbolTick";

/** WORK IN PROGRESS. */
export class MidaMarketWatcher {
    private readonly _brokerAccount: MidaBrokerAccount;
    private readonly _watchedTicks: Map<string, boolean>;
    private reado


// *************************************************************
// project:  graphql-aspnet
// --
// repo: https://github.com/graphql-aspnet
// docs: https://graphql-aspnet.github.io
// --
// License:  MIT
// *************************************************************

namespace GraphQL.AspNet.Tests.Execution
{
    using System;
    using System.Collections.Generic;
    using System.Runtime.InteropServices;
    using System.Threading.Tasks;
    using GraphQL.AspNet.Tests.Execution.TestData.VariableExecutionTestData;
    using GraphQL.AspNet.Tests.Framework;
    using GraphQL.AspNet.Tests.Framework.CommonHelpers;
    using Microsoft.Extensions.Hosting;
    using NSubstitute;
    using NUnit.Framework;

    [TestFixture]
    public class VariableKitchenSinkTests
    {
        private static List<object[]> _allBuildInScalarTestCases;
        private static List<object[]> _deeplyNestedInputObjectTestCases;

        static VariableKitchenSinkTests()
        {
            _allBuildInScalarTestCases = new List<object[]>();
            _deeplyNestedInputObjectTestCases = new List<object[]>();

            _allBuildInScalarTestCases.Add(
            new object[]
            {
                 @"{
                    ""regularSbyte"": -3e1,
                    ""nullSbyte"": 3,

                    ""regularShort"": -3e2,
                    ""nullShort"": -1,

                    ""regularInt"": 5,
                    ""nullInt"": 3,

                    ""regularLong"": -5,
                    ""nullLong"": 3,

                    ""regularByte"": 15,
                    ""nullByte"": 4,

                    ""regularUshort"": 300,
                    ""nullUshort"": 5,

                    ""regularUint"": 99,
                    ""nullUint"": 100,

                    ""regularUlong"": 2000,
                    ""nullUlong"": 3123,

                    ""regularFloat"": 1.2,
                    ""nullFloat"": 3,

                    ""regularDouble"": 12.4,
                    ""nullDouble"": 5,

                    ""regularDecimal"": 19.8,
                    ""nullDecimal"": 6,

                    ""regularBoolean"": true,
                    ""nullBoolean"": true,

                    ""regularString"": ""bob"",
                    ""nullString"": ""smith"",

                    ""regularId"": ""id1"",
                    ""nullId"": ""id2"",

                    ""regularUri"": ""http://sample.com"",
                    ""nullUri"": ""/segment1/segment2"",

                    ""regularGuid"" : ""3348e83f-8ccd-4f69-a580-76988c619aee"",
                    ""nullGuid"":  ""f7e18db6-0cfe-4467-bdab-74e66915cad2"",

                    ""regularDateTime"": ""2022-12-30T18:30:38.259+00:00"",
                    ""nullDateTime"": ""2022-12-31T19:30:39.255+00:00"",

                    ""regularDateTimeNumber"": 1672425038259,
                    ""nullDateTimeNumber"": 1672515039255,

                    ""regularDateTimeOffset"": ""2022-12-30T18:30:38.259+00:00"",
                    ""nullDateTimeOffset"": ""2022-12-31T19:30:39.255+00:00"",

                    ""regularDateTimeOffsetNumber"": 1672425038259,
                    ""nullDateTimeOffsetNumber"": 1672515039255,

                    ""regularDateOnly"": ""2022-12-30T18:30:38.259+00:00"",
                    ""nullDateOnly"": ""2022-12-31T19:30:39.255+00:00"",

                    ""regularDateOnlyNumber"": 1672425038259,
                    ""nullDateOnlyNumber"": 1672515039255,

                    ""regularTimeOnly"": ""18:30:38.259"",
                    ""nullTimeOnly"": ""19


			train_list.add(train_one);
			}

			/**
			 * 巩俐参演的电影评分在8.5分以下的有哪些、巩俐参演的电影评分小于8.5分的有哪些
			 */
			String lowScoreMovies = loadFile("question/【9】演员参演的电影评分【小于】.txt");
			sentences = lowScoreMovies.split("`");
			for (String sentence : sentences) {
				double[] array = sentenceToArrays(sentence);
				LabeledPoint train_one = new LabeledPoint(9.0, Vectors.dense(array));
				train_list.add(train_one);
			}

			/**
			 * 章子怡演过哪些类型的电影
			 */
			String actorMovieGenres = loadFile("question/【10】某演员出演过哪些类型的电影.txt");
			sentences = actorMovieGenres.split("`");
			for (String sentence : sentences) {
				double[] array = sentenceToArrays(sentence);
				LabeledPoint train_one = new LabeledPoint(10.0, Vectors.dense(array));
				train_list.add(train_one);
			}

			/**
			 * 章子怡与李连杰合作过哪些电影、章子怡和巩俐一起演过什么电影
			 */
			String withMovies = loadFile("question/【11】演员A和演员B合作了哪些电影.txt");
			sentences = withMovies.split("`");
			for (String sentence : sentences) {
				double[] array = sentenceToArrays(sentence);
				LabeledPoint train_one = new LabeledPoint(11.0, Vectors.dense(array));
				train_list.add(train_one);
			}

			/**
			 * 章子怡与李连杰合作过哪些电影、章子怡和巩俐一起演过什么电影
			 */
			String countMovies = loadFile("question/【12】某演员一共演过多少电影.txt");
			sentences = countMovies.split("`");
			for (String sentence : sentences) {
				double[] array = sentenceToArrays(sentence);
				LabeledPoint train_one = new LabeledPoint(12.0, Vectors.dense(array));
				train_list.add(train_one);
			}

			/**
			 * 章子怡的生日是多少、章子怡的出生日期是什么时候
			 */
			String actorBirthdayQuestion = loadFile("question/【13】演员出生日期.txt");
			sentences = actorBirthdayQuestion.split("`");
			for (String sentence : sentences) {
				double[] array = sentenceToArrays(sentence);
				LabeledPoint train_one = new LabeledPoint(13.0, Vectors.dense(array));
				train_list.add(train_one);
			}

			/**
			 * SPARK的核心是RDD(弹性分布式数据集)
			 * Spark是Scala写的,JavaRDD就是Spark为Java写的一套API
			 * JavaSparkContext sc = new JavaSparkContext(sparkConf);    //对应JavaRDD
			 * SparkContext	    sc = new SparkContext(sparkConf)    ;    //对应RDD
			 */
			JavaRDD<LabeledPoint> trainingRDD = sc.parallelize(train_list);
			NaiveBayesModel nb_model = NaiveBayes.train(trainingRDD.rdd());

			/**
			 * 记得关闭资源
			 */
			sc.close();

			/**
			 * 返回贝叶斯分类器
			 */
			return nb_model;

	}

	/**
	 * 加载问�


ins[i]) origin[i] = destMins[i]
    }
    return Vec3(origin[0], origin[1], origin[2])
}

fun EntityPlayer.getPing(): Int {
    val playerInfo = MinecraftInstance.mc.netHandler.getPlayerInfo(uniqueID)
    return playerInfo?.responseTime ?: 0
}
val Entity.rotation: Rotation
    get() = Rotation(rotationYaw, rotationPitch)
package net.minusmc.minusbounce.utils.render

import net.minecraft.client.renderer.GLAllocation
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.renderer.RenderHelper
import net.minecraft.util.Vec3
import org.lwjgl.opengl.GL11
import java.nio.FloatBuffer

object GLUtils {
    private var colorBuffer: FloatBuffer? = null
    private var LIGHT0_POS: Vec3? = null
    private var LIGHT1_POS: Vec3? = null
    fun disableGUIStandardItemLighting() {
        GlStateManager.disableLighting()
        GlStateManager.popMatrix()
        GlStateManager.enableLighting()
        GlStateManager.enableDepth()
        RenderHelper.enableStandardItemLighting()
    }

    fun disableStandardItemLighting() {
        GlStateManager.disableLighting()
        GlStateManager.disableLight(0)
        GlStateManager.disableLight(1)
        GlStateManager.disableColorMaterial()
    }

    fun startSmooth() {
        GL11.glEnable(2848)
        GL11.glEnable(2881)
        GL11.glEnable(2832)
        GL11.glEnable(3042)
        GL11.glBlendFunc(770, 771)
        GL11.glHint(3154, 4354)
        GL11.glHint(3155, 4354)
        GL11.glHint(3153, 4354)
    }

    fun endSmooth() {
        GL11.glDisable(2848)
        GL11.glDisable(2881)
        GL11.glEnable(2832)
    }

    fun enableStandardItemLighting() {
        GlStateManager.enableLighting()
        GlStateManager.enableLight(0)
        GlStateManager.enableLight(1)
        GlStateManager.enableColorMaterial()
        GlStateManager.colorMaterial(1032, 5634)
        val n = 0.4f
        val n2 = 0.6f
        val n3 = 0.0f
        GL11.glLight(16384, 4611, setColorBuffer(LIGHT0_POS!!.xCoord, LIGHT0_POS!!.yCoord, LIGHT0_POS!!.zCoord, 0.0))
        GL11.glLight(16384, 4609, setColorBuffer(n2, n2, n2, 1.0f))
        GL11.glLight(16384, 4608, setColorBuffer(0.0f, 0.0f, 0.0f, 1.0f))
        GL11.glLight(16384, 4610, setColorBuffer(n3, n3, n3, 1.0f))
        GL11.glLight(16385, 4611, setColorBuffer(LIGHT1_POS!!.xCoord, LIGHT1_POS!!.yCoord, LIGHT1_POS!!.zCoord, 0.0))
        GL11.glLight(16385, 4609, setColorBuffer(n2, n2, n2, 1.0f))
        GL11.glLight(16385, 4608, setColorBuffer(0.0f, 0.0f, 0.0f, 1.0f))
        GL11.glLight(16385, 4610, setColorBuffer(n3, n3, n3, 1.0f))
        GlStateManager.shadeModel(7424)
        GL11.glLightModel(2899, setColorBuffer(n, n, n, 1.0f))
    }

    private fun setColorBuffer(
        p_setColorBuffer_0_: Double,
        p_setColorBuffer_2_: Double,
        p_setColorBuffer_4_: Double,
        p_setColorBuffer_6_: Double
    ): FloatBuffer? {
        return setColorBuffer(
            p_setColorBuffer_0_.toFloat(),
            p_setColorBuffer_2_.toFloat(),
            p_setColorBuffer_4_.toFloat


var globalInheritQUIC = new(inheritQUIC)

type inheritQUIC struct {
	inherited   []*net.UDPConn
	active      []*Listener
	mutex       sync.Mutex
	inheritOnce sync.Once

	//传递需要继承的文件句柄列表方法
	addInherited func([]*Listener, map[string]string)
	// 获取从父进程继承过来的句柄列表
	getInherited func() []int
}

// 添加files列表到环境变量，让子进程继承，
// 1. 只有在reboot使用
// 2. 不支持windows系统
func (that *inheritQUIC) setInherited() error {
	listeners, err := that.activeListeners()
	if err != nil {
		return err
	}
	if that.addInherited != nil {
		that.addInherited(listeners, nil)
	}
	return nil
}

// 获取当前进程正在使用的监听句柄
func (that *inheritQUIC) activeListeners() ([]*Listener, error) {
	that.mutex.Lock()
	defer that.mutex.Unlock()
	ls := make([]*Listener, len(that.active))
	copy(ls, that.active)
	return ls, nil
}

// InheritedListen 监听地址，需要先判断是否有继承过来的句柄，
// 如果是子进程，并且已经继承了该地址的监听，则返回已监听的句柄
// 如果未发现该地址的监听，则重新创建监听
func (that *inheritQUIC) inheritedListen(network string, udpAddr *net.UDPAddr, tlsConf *tls.Config, config *quic.Config) (*Listener, error) {
	//初始化继承过来的句柄,只会初始化一次
	if err := that.inherit(); err != nil {
		return nil, err
	}

	that.mutex.Lock()
	defer that.mutex.Unlock()

	var udpConn *net.UDPConn

	// look for an inherited listener
	for i, conn := range that.inherited {
		//如果继承过来的句柄变成了nil，则跳过
		if conn == nil {
			continue
		}
		//如果将要监听的地址已经在继承列表中，则直接返回该继承的句柄
		if utils.IsSameAddr(conn.LocalAddr(), udpAddr) {
			that.inherited[i] = nil //如果地址相同，则把改地址从继承列表拿出来使用
			udpConn = conn
		}
	}

	//如果不在继承列表中，则直接新建一个监听,并把它加入到活跃列表
	var l *Listener
	var err error
	if udpConn == nil {
		l, err = ListenUDPAddr(network, udpAddr, tlsConf, config)
	} else {
		l, err = Listen(udpConn, tlsConf, config)
	}
	if err != nil {
		return nil, err
	}
	that.active = append(that.active, l)
	return l, nil
}

// 从父进程继承的句柄初始化
// 注意，这里使用了 sync.Once 逻辑，保证了仅能执行一次
func (that *inheritQUIC) inherit() error {
	var retErr error
	that.inheritOnce.Do(func() {
		that.mutex.Lock()
		defer that.mutex.Unlock()
		if that.getInherited == nil {
			return
		}
		fds := that.getInherited()
		if len(fds) <= 0 {
			return
		}
		for _, fd := r


 = await getAllClusters();

  let found: false | Cluster;
  found = false;

  if (result && result.kubernetes_clusters) {
    result.kubernetes_clusters.forEach(
      (cluster: Cluster): void => {
        if (cluster.name === name) {
          found = cluster;
        }
      }
    );
  }

  return found;
};

// checks to see if we have an existing cluster and if it's in a running state
export const clusterExists = async (req: Request): Promise<boolean> => {
  const name = getName(req);
  const cluster = await getClusterByName(name);

  if (!cluster || !cluster.id || !cluster.status) return false;

  if (cluster.status.state === "provisioning") {
    console.log("found a cluster in a provisioning state...");
    const result = await waitForProvisioningCluster(req, cluster.id);
    console.log(result);
    return true;
  }

  if (cluster.status.state === "running") {
    return true;
  }

  return false;
};

export const checkAndCreateCluster = async (req: Request): Promise<void> => {
  let result = await clusterExists(req);

  if (!result) {
    await createClusterAndWait(req);
  }
};
import { fetchCocktailsForIngredient } from '../cocktailService';
// eslint-disable-next-line no-unused-vars
import { Cocktail } from '../../interfaces/Cocktail';
import { fetchCocktailsForIngredient as fetchCocktailsForIngredientAPI } from '../../helpers/cocktailAPIClient';

import { putCocktailsListForIngredient } from '../../database/cocktailsRepository';

const inDBingredient = 'inDB';
const mockedCocktail: Cocktail = { strDrink: 'drink name', strDrinkThum: 'drink thumb', idDrink: 'drink id' };
jest.mock('../../database/cocktailsRepository', () => ({
  getCocktailsListForIngredient: jest.fn(i => (i === inDBingredient ? [mockedCocktail] : [])),
  putCocktailsListForIngredient: jest.fn(),
}));
jest.mock('../../helpers/cocktailAPIClient', () => ({
  fetchCocktailsForIngredient: jest.fn(() => [mockedCocktail]),
}));
describe('cocktails service tests', () => {
  it('fetchCocktailsForIngredient should throw an error with missing or wrong parameter', async () => {
    await expect(fetchCocktailsForIngredient(null)).rejects.toThrow('ingredient missing');
    await expect(fetchCocktailsForIngredient(undefined)).rejects.toThrow('ingredient missing');
    // @ts-ignore
    await expect(fetchCocktailsForIngredient(1)).rejects.toThrow('ingredient missing');
  });

  it('fetchCocktailsForIngredient should not hit the API if the data is already in the DB', async () => {
    const cocktails: Cocktail[] = await fetchCocktailsForIngredient(inDBingredient);
    expect(cocktails).toEqual([mockedCocktail]);
    expect(fetchCocktailsForIngredientAPI).not.toHaveBeenCalled();
    expect(putCocktailsListForIngredient).not.toHaveBeenCalled();
  });
  it('fetchCocktailsForIngredient should ask the API if the data is not in the DB', async () => {
    const cocktails: Cocktail[] = await fetchCocktailsForIngredient('another');
    expect(cocktails).toEqual([mocked


ror	byte
skipped4:
	cpi	byte, 0xfc
skipped3:
	brcc	skip4
	in	odd, USB_IN		; sample bit 5
	andi	odd, USB_MASK
	eor	even, odd
	subi	even, 1
	ror	byte
skipped5:
	cpi	byte, 0xfc
	brcc	skip5
	dec	count
	in	even, USB_IN		; sample bit 6
	brmi	overflow		; ==> overflow
	andi	even, USB_MASK
	eor	odd, even
	subi	odd, 1
	ror	byte
skipped6:
	cpi	byte, 0xfc
	brcc	skip6
	in	odd, USB_IN		; sample bit 7
	andi	odd, USB_MASK
	eor	even, odd
	subi	even, 1
	ror	byte
	cpi	byte, 0xfc
	brcs	rxloop			; 2 cycles
	rjmp	skip7

eop:
	rjmp	eop2
overflow:
	rjmp	ignore

; ----------------------------------------------------------------------
; out-of-line code to skip stuffing bits
; ----------------------------------------------------------------------
skip0:					; 1+6 cycles
	eor	even, usbmask
	in	odd, USB_IN		; resample bit 1
	andi	odd, USB_MASK
	cbr	byte, (1<<7)
	sbr	fixup, (1<<0)
	rjmp	skipped0

skip1:					; 2+5 cycles
	cbr	byte, (1<<7)
	sbr	fixup, (1<<1)
	in	even, USB_IN		; resample bit 2
	andi	even, USB_MASK
	eor	odd, usbmask
	rjmp	skipped1

skip2:					; 3+7 cycles
	cbr	byte, (1<<7)
	sbr	fixup, (1<<2)
	eor	even, usbmask
	in	odd, USB_IN		; resample bit 3
	andi	odd, USB_MASK
	eor	even, odd
	subi	even, 1
	ror	byte
	rjmp	skipped2

skip3:					; 4+7 cycles
	cbr	byte, (1<<7)
	sbr	fixup, (1<<3)
	eor	odd, usbmask
	ori	byte, 1
	in	even, USB_IN		; resample bit 4
	andi	even, USB_MASK
	eor	odd, even
	subi	odd, 1
	ror	byte
	rjmp	skipped3

skip4:					; 5 cycles
	cbr	byte, (1<<7)
	sbr	fixup, (1<<4)
	eor	even, usbmask
	rjmp	skipped4

skip5:					; 5 cycles
	cbr	byte, (1<<7)
	sbr	fixup, (1<<5)
	eor	odd, usbmask
	rjmp	skipped5

skip6:					; 5 cycles
	cbr	byte, (1<<7)
	sbr	fixup, (1<<6)
	eor	even, usbmask
	rjmp	skipped6

skip7:					; 7 cycles
	cbr	byte, (1<<7)
	sbr	fixup, (1<<7)
	eor	odd, usbmask
	nop2
	rjmp	rxloop

; ----------------------------------------------------------------------
; end-of-packet detected (worst-case: 3 cycles after end of SE0)
; ----------------------------------------------------------------------
eop2:
	; clear pending interrupt (SE0+3)
	ldi	byte, 1<<USB_INT_PENDING_BIT
	out	USB_INT_PENDING, byte	; clear pending bit at end of packet
	; calculate packet length
	subi	count, USB_BUFSIZE
	neg	count			; count = packet length
	; get PID
	sub	YL, count
	sbci	YH, 0
	ld	pid, Y
	; separate out the non-Token packets (SE0+11)
	sbrc	pid, 1
	rjmp	is_data_handshake	; jump for Data or Handshake packet
	; check ADDR of Token packet (SE0+13)
	ldd	addr, Y+1
	andi	addr, 0x7f
	lds	tmp, usb_address
	cp	addr, tmp		; is this packet for me?
	brne	ignore			; no, ignore
	; dispatch Token packets (SE0+20)
	cpi	pid, USB_PID_IN
	brne	is_setup_out		; handle SETUP and OUT packets

; ----------------------------------------------------------------------


0 000 2h.333l-.28.84L1 10v7.5a1.5 1.5 0 103 0V17h12v.5a1.5 1.5 0 003 0V10l-.19-.568-1.858 1.86zM4.5 13a1.5 1.5 0 110-3 1.5 1.5 0 010 3z"],"lab-test":["M13 2a1 1 0 010 2v4l4 8v1a1 1 0 01-1 1H4a1 1 0 01-1-1v-1l4-8V4a1 1 0 110-2h6zm-2 2H9v4l-2 4h6l-2-4V4z"],label:["M3 12h14v-1H3v1zm11-9H1c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h18c.55 0 1-.45 1-1V9l-6-6zm4 12H2V5h11v3H3v1h10v1h5v5zm-4-6V5l4 4h-4z"],layer:["M19.5 9.1l-9-5c-.2-.1-.3-.1-.5-.1s-.3 0-.5.1l-9 5c-.3.2-.5.5-.5.9s.2.7.5.9l9 5c.2.1.3.1.5.1s.3 0 .5-.1l9-5c.3-.2.5-.5.5-.9s-.2-.7-.5-.9z"],"layer-outline":["M9.514 4.126l-9 5a1 1 0 000 1.748l9 5a1 1 0 00.972 0l9-5a1 1 0 000-1.748l-9-5a1 1 0 00-.972 0zM10 6.144l6.94 3.855L10 13.855 3.059 9.999 10 6.144z"],layers:["M.5 6.9l9 5c.2.1.3.1.5.1s.3 0 .5-.1l9-5c.3-.2.5-.5.5-.9s-.2-.7-.5-.9l-9-5c-.2-.1-.3-.1-.5-.1s-.3 0-.5.1l-9 5c-.3.2-.5.5-.5.9s.2.7.5.9z","M19 9c-.2 0-.3 0-.5.1L10 13.9 1.5 9.1C1.3 9 1.2 9 1 9c-.6 0-1 .4-1 1 0 .4.2.7.5.9l9 5c.2.1.3.1.5.1s.3 0 .5-.1l9-5c.3-.2.5-.5.5-.9 0-.6-.4-1-1-1z","M19 13c-.2 0-.3 0-.5.1L10 17.9l-8.5-4.7c-.2-.2-.3-.2-.5-.2-.6 0-1 .4-1 1 0 .4.2.7.5.9l9 5c.2.1.3.1.5.1s.3 0 .5-.1l9-5c.3-.2.5-.5.5-.9 0-.6-.4-1-1-1z"],layout:["M18 6c-1.1 0-2 .9-2 2 0 .37.11.71.28 1.01l-2.27 2.27c-.3-.17-.64-.28-1.01-.28-.93 0-1.71.64-1.93 1.5H8.93c-.22-.86-1-1.5-1.93-1.5-.37 0-.71.11-1.01.28L3.72 9.01C3.89 8.71 4 8.37 4 8c0-.34-.09-.66-.24-.94l3.66-3.38c.31.2.68.32 1.08.32 1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2c0 .34.09.66.24.94L3.08 6.32C2.77 6.12 2.4 6 2 6 .9 6 0 6.9 0 8s.9 2 2 2c.37 0


8030114C 002FDF4C  D0 01 00 08 */	stfs f0, 8(r1)
/* 80301150 002FDF50  80 01 00 08 */	lwz r0, 8(r1)
/* 80301154 002FDF54  90 01 00 0C */	stw r0, 0xc(r1)
/* 80301158 002FDF58  C0 01 00 0C */	lfs f0, 0xc(r1)
/* 8030115C 002FDF5C  D0 1E 00 54 */	stfs f0, 0x54(r30)
/* 80301160 002FDF60  80 7E 00 04 */	lwz r3, 4(r30)
/* 80301164 002FDF64  38 63 0B B4 */	addi r3, r3, 0xbb4
/* 80301168 002FDF68  48 08 0C 05 */	bl func_80381D6C
/* 8030116C 002FDF6C  7F C3 F3 78 */	mr r3, r30
/* 80301170 002FDF70  E3 E1 00 38 */	psq_l f31, 56(r1), 0, qr0
/* 80301174 002FDF74  CB E1 00 30 */	lfd f31, 0x30(r1)
/* 80301178 002FDF78  E3 C1 00 28 */	psq_l f30, 40(r1), 0, qr0
/* 8030117C 002FDF7C  CB C1 00 20 */	lfd f30, 0x20(r1)
/* 80301180 002FDF80  83 E1 00 1C */	lwz r31, 0x1c(r1)
/* 80301184 002FDF84  83 C1 00 18 */	lwz r30, 0x18(r1)
/* 80301188 002FDF88  83 A1 00 14 */	lwz r29, 0x14(r1)
/* 8030118C 002FDF8C  80 01 00 44 */	lwz r0, 0x44(r1)
/* 80301190 002FDF90  83 81 00 10 */	lwz r28, 0x10(r1)
/* 80301194 002FDF94  7C 08 03 A6 */	mtlr r0
/* 80301198 002FDF98  38 21 00 40 */	addi r1, r1, 0x40
/* 8030119C 002FDF9C  4E 80 00 20 */	blr
/* 803011A0 002FDFA0  94 21 FF 90 */	stwu r1, -0x70(r1)
/* 803011A4 002FDFA4  7C 08 02 A6 */	mflr r0
/* 803011A8 002FDFA8  90 01 00 74 */	stw r0, 0x74(r1)
/* 803011AC 002FDFAC  DB E1 00 60 */	stfd f31, 0x60(r1)
/* 803011B0 002FDFB0  F3 E1 00 68 */	psq_st f31, 104(r1), 0, qr0
/* 803011B4 002FDFB4  DB C1 00 50 */	stfd f30, 0x50(r1)
/* 803011B8 002FDFB8  F3 C1 00 58 */	psq_st f30, 88(r1), 0, qr0
/* 803011BC 002FDFBC  39 61 00 50 */	addi r11, r1, 0x50
/* 803011C0 002FDFC0  48 0A C9 95 */	bl _savegpr_27
/* 803011C4 002FDFC4  7C 7B 1B 78 */	mr r27, r3
/* 803011C8 002FDFC8  3C 60 80 4E */	lis r3, lbl_804DA648@ha
/* 803011CC 002FDFCC  80 1B 00 0C */


02ADDB7_StaticFields*)il2cpp_codegen_static_fields_for(GUISkin_tE22941292F37A41BE0EDF70FC3A9CD9EB02ADDB7_il2cpp_TypeInfo_var))->get_ms_Error_29();
		NullCheck(L_3);
		GUIStyle_set_name_m3D232D5A8EAD7B29F1F2DA3ADD01B99EFF83F1D7(L_3, _stringLiteralA93D2B140984CB1ED70E8B2F25565EF16927EE77, /*hidden argument*/NULL);
	}

IL_0029:
	{
		GUIStyle_t671F175A201A19166385EE3392292A5F50070572 * L_4 = ((GUISkin_tE22941292F37A41BE0EDF70FC3A9CD9EB02ADDB7_StaticFields*)il2cpp_codegen_static_fields_for(GUISkin_tE22941292F37A41BE0EDF70FC3A9CD9EB02ADDB7_il2cpp_TypeInfo_var))->get_ms_Error_29();
		V_1 = L_4;
		goto IL_0031;
	}

IL_0031:
	{
		GUIStyle_t671F175A201A19166385EE3392292A5F50070572 * L_5 = V_1;
		return L_5;
	}
}
// System.Void UnityEngine.GUISkin::Apply()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void GUISkin_Apply_mA93B0EEE3C2DE1F8D867A472130CDA98814C8A49 (GUISkin_tE22941292F37A41BE0EDF70FC3A9CD9EB02ADDB7 * __this, const RuntimeMethod* method)
{
	static bool s_Il2CppMethodInitialized;
	if (!s_Il2CppMethodInitialized)
	{
		il2cpp_codegen_initialize_method (GUISkin_Apply_mA93B0EEE3C2DE1F8D867A472130CDA98814C8A49_MetadataUsageId);
		s_Il2CppMethodInitialized = true;
	}
	bool V_0 = false;
	{
		GUIStyleU5BU5D_t2F343713D6ADFF41BBCF1D17BAE79F51BD745DBB* L_0 = __this->get_m_CustomStyles_27();
		V_0 = (bool)((((RuntimeObject*)(GUIStyleU5BU5D_t2F343713D6ADFF41BBCF1D17BAE79F51BD745DBB*)L_0) == ((RuntimeObject*)(RuntimeObject *)NULL))? 1 : 0);
		bool L_1 = V_0;
		if (!L_1)
		{
			goto IL_0019;
		}
	}
	{
		IL2CPP_RUNTIME_CLASS_INIT(Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var);
		Debug_Log_m4B7C70BAFD477C6BDB59C88A0934F0B018D03708(_stringLiteral0D421A870FA2CD6E6DCF150A4ACE67EC7405AF75, /*hidden argument*/NULL);
	}

IL_0019:
	{
		GUISkin_BuildStyleCache_m2C68BB5521EAF11FC98C86D7E60008901D61866A(__this, /*hidden argument*/NULL);
		return;
	}
}
// System.Void UnityEngine.GUISkin::BuildStyleCache()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void GUISkin_BuildStyleCache_m2C68BB5521EAF11FC98C86D7E60008901D61866A (GUISkin_tE22941292F37A41BE0EDF70FC3A9CD9EB02


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if MM_TEXTMESHPRO
using TMPro;
#endif

namespace MoreMountains.Feedbacks
{
	/// <summary>
	/// This feedback will let you reveal words, lines, or characters in a target TMP, one at a time
	/// </summary>
	[AddComponentMenu("")]
	[FeedbackHelp("This feedback will let you reveal words, lines, or characters in a target TMP, one at a time")]
	[FeedbackPath("TextMesh Pro/TMP Text Reveal")]
	public class MMFeedbackTMPTextReveal : MMFeedback
	{
		/// a static bool used to disable all feedbacks of this type at once
		public static bool FeedbackTypeAuthorized = true;
		#if UNITY_EDITOR
		public override Color FeedbackColor
		{
			get { return MMFeedbacksInspectorColors.TMPColor; }
		}
		#endif

		#if MM_TEXTMESHPRO
		/// the duration of this feedback
		public override float FeedbackDuration
		{
			get
			{
				if (DurationMode == DurationModes.TotalDuration)
				{
					return RevealDuration;
				}
				else
				{
					if ((TargetTMPText == null) || (TargetTMPText.textInfo == null))
					{
						return 0f;
					}

					switch (RevealMode)
					{
						case RevealModes.Character:
							return RichTextLength(TargetTMPText.text) * IntervalBetweenReveals;
						case RevealModes.Lines:
							return TargetTMPText.textInfo.lineCount * IntervalBetweenReveals;
						case RevealModes.Words:
							return TargetTMPText.textInfo.wordCount * IntervalBetweenReveals;
					}

					return 0f;
				}
			}
			set
			{
				if (DurationMode == DurationModes.TotalDuration)
				{
					RevealDuration = value;
				}
				else
				{
					if (TargetTMPText != null)
					{
						switch (RevealMode)
						{
							case RevealModes.Character:
								IntervalBetweenReveals = value / RichTextLength(TargetTMPText.text);
								break;
							case RevealModes.Lines:
								IntervalBetweenReveals = value / TargetTMPText.textInfo.lineCount;
								break;
							case RevealModes.Words:
								IntervalBetweenReveals = value / TargetTMPText.textInfo.wordCount;
								break;
						}
					}
				}
			}
		}
		#endif

		/// the possible ways to reveal the text
		public enum RevealModes
		{
			Character,
			Lines,
			Words
		}

		/// whether to define duration by the time interval between two unit reveals, or by the total duration the reveal should take
		public enum DurationModes
		{
			Interval,
			TotalDuration
		}

		#if MM_TEXTMESHPRO
		[Header("TextMesh Pro")]
		/// the target TMP_Text component we want to change the text on
		[Tooltip("the target TMP_Text component we want to change the text on")]
		public TMP_Text TargetTMPText;
		#endif

		[Header("Change Text")]
		/// whether or not to replace the current TMP target's text on play
		[Tooltip("whether or not to replace the current TMP target's text on play")]
		public bool ReplaceText = false;

		/// the new text to replace the old one with
		[Tooltip("the new text to replace the old one with")] [TextArea]
		public string NewText = "Hello World";

		[Header("Reveal")]
		/// the selected way to reveal the text (character by character, word by word, or line by line)
		[Tooltip("the selected way to reveal the text (character by character, word by word, or line by line)")]
		public RevealModes RevealMode = RevealModes.Character;

		/// whether to define duration by the time interva


565, 0x2246a08
.word Function_2243584+1 @ =0x2243585, 0x2246a0c
.word Function_2243550+1 @ =0x2243551, 0x2246a10
.word Function_2243970+1 @ =0x2243971, 0x2246a14
.word Function_224398c+1 @ =0x224398d, 0x2246a18
.word Function_22439c8+1 @ =0x22439c9, 0x2246a1c
.word Function_22439e0+1 @ =0x22439e1, 0x2246a20
.word Function_2243a00+1 @ =0x2243a01, 0x2246a24
.word Function_2243a24+1 @ =0x2243a25, 0x2246a28
.word Function_2243a40+1 @ =0x2243a41, 0x2246a2c
.word Function_2243a8c+1 @ =0x2243a8d, 0x2246a30
.word Function_2243ae4+1 @ =0x2243ae5, 0x2246a34
.word Function_224391c+1 @ =0x224391d, 0x2246a38
.word Function_2243944+1 @ =0x2243945, 0x2246a3c
.word Function_2244f88+1 @ =0x2244f89, 0x2246a40
.word Function_2244fc0+1 @ =0x2244fc1, 0x2246a44
.word Function_2245134+1 @ =0x2245135, 0x2246a48
.word Function_2245154+1 @ =0x2245155, 0x2246a4c
.word Function_22451d8+1 @ =0x22451d9, 0x2246a50
.word Function_22451e8+1 @ =0x22451e9, 0x2246a54
.word Function_2245298+1 @ =0x2245299, 0x2246a58
.word Function_22452e0+1 @ =0x22452e1, 0x2246a5c
.word Function_22452fc+1 @ =0x22452fd, 0x2246a60
.word Function_22453b4+1 @ =0x22453b5, 0x2246a64
.word Function_22453e8+1 @ =0x22453e9, 0x2246a68
.word Function_2245590+1 @ =0x2245591, 0x2246a6c
.word Function_2245798+1 @ =0x2245799, 0x2246a70
.word Function_22457ec+1 @ =0x22457ed, 0x2246a74
.word Function_22455cc+1 @ =0x22455cd, 0x2246a78
.word Function_2245028+1 @ =0x2245029, 0x2246a7c
.word Function_2245058+1 @ =0x2245059, 0x2246a80
.word Function_22450bc+1 @ =0x22450bd, 0x2246a84
.word Function_22450e8+1 @ =0x22450e9, 0x2246a88
.word Function_2245108+1 @ =0x2245109, 0x2246a8c
.word Function_22457b8+1 @ =0x22457b9, 0x2246a90
.word Function_2245604+1 @ =0x2245605, 0x2246a94
.word Function_22456c8+1 @ =0x22456c9, 0x2246a98
.word Function_224553c+1 @ =0x224553d, 0x2246a9c
.word Function_2245560+1 @ =0x2245561, 0x2246aa0
@ 0x2246aa4

.incbin "./baserom/overlay/overlay_0094.bin", 0xb964, 0x2246abf - 0x2246aa4


(r4)
/* 804397C8 00434D08  7C 80 22 14 */	add r4, r0, r4
/* 804397CC 00434D0C  4B FE 93 F9 */	bl func_80422BC4
lbl_804397D0:
/* 804397D0 00434D10  39 61 00 20 */	addi r11, r1, 0x20
/* 804397D4 00434D14  7F A3 EB 78 */	mr r3, r29
/* 804397D8 00434D18  48 0D DD A9 */	bl func_80517580
/* 804397DC 00434D1C  80 01 00 24 */	lwz r0, 0x24(r1)
/* 804397E0 00434D20  7C 08 03 A6 */	mtlr r0
/* 804397E4 00434D24  38 21 00 20 */	addi r1, r1, 0x20
/* 804397E8 00434D28  4E 80 00 20 */	blr

.global func_804397EC
func_804397EC:
/* 804397EC 00434D2C  94 21 FF F0 */	stwu r1, -0x10(r1)
/* 804397F0 00434D30  7C 08 02 A6 */	mflr r0
/* 804397F4 00434D34  2C 05 00 01 */	cmpwi r5, 1
/* 804397F8 00434D38  90 01 00 14 */	stw r0, 0x14(r1)
/* 804397FC 00434D3C  38 00 00 00 */	li r0, 0
/* 80439800 00434D40  41 82 00 34 */	beq lbl_80439834
/* 80439804 00434D44  40 80 00 10 */	bge lbl_80439814
/* 80439808 00434D48  2C 05 00 00 */	cmpwi r5, 0
/* 8043980C 00434D4C  40 80 00 14 */	bge lbl_80439820
/* 80439810 00434D50  48 00 00 48 */	b lbl_80439858
lbl_80439814:
/* 80439814 00434D54  2C 05 00 03 */	cmpwi r5, 3
/* 80439818 00434D58  40 80 00 40 */	bge lbl_80439858
/* 8043981C 00434D5C  48 00 00 2C */	b lbl_80439848
lbl_80439820:
/* 80439820 00434D60  7C C5 33 78 */	mr r5, r6
/* 80439824 00434D64  7C E6 3B 78 */	mr r6, r7
/* 80439828 00434D68  48 00 00 45 */	bl func_8043986C
/* 8043982C 00434D6C  7C 60 1B 78 */	mr r0, r3
/* 80439830 00434D70  48 00 00 28 */	b lbl_80439858
lbl_80439834:
/* 80439834 00434D74  7C C5 33 78 */	mr r5, r6
/* 80439838 00434D78  7C E6 3B 78 */	mr r6, r7
/* 8043983C 00434D7C  48 00 02 31 */	bl func_80439A6C
/* 80439840 00434D80  7C 60 1B 78 */	mr r0, r3
/* 80439844 00434D84  48 00 00 14 */	b lbl_80439858
lbl_80439848:
/* 80439848 00434D88  7C C5 33 78 */	mr r5, r6
/* 8043984C 00434D8C  7C E6 3B 78 */	mr r6, r7
/* 80439850 00434D90  48 00 01 4D


	if o.UnparsedObject != nil {
		return datadog.Marshal(o.UnparsedObject)
	}
	if o.Page != nil {
		toSerialize["page"] = o.Page
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}
	return datadog.Marshal(toSerialize)
}

// UnmarshalJSON deserializes the given payload.
func (o *OrgConnectionListResponseMeta) UnmarshalJSON(bytes []byte) (err error) {
	all := struct {
		Page *OrgConnectionListResponseMetaPage `json:"page,omitempty"`
	}{}
	if err = datadog.Unmarshal(bytes, &all); err != nil {
		return datadog.Unmarshal(bytes, &o.UnparsedObject)
	}
	additionalProperties := make(map[string]interface{})
	if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
		datadog.DeleteKeys(additionalProperties, &[]string{"page"})
	} else {
		return err
	}

	hasInvalidField := false
	if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil {
		hasInvalidField = true
	}
	o.Page = all.Page

	if len(additionalProperties) > 0 {
		o.AdditionalProperties = additionalProperties
	}

	if hasInvalidField {
		return datadog.Unmarshal(bytes, &o.UnparsedObject)
	}

	return nil
}
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

package datadogV2

import (
	"fmt"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// HTTPTokenAuthUpdate The definition of `HTTPTokenAuthUpdate` object.
type HTTPTokenAuthUpdate struct {
	// The definition of `HTTPBody` object.
	Body *HTTPBody `json:"body,omitempty"`
	// The `HTTPTokenAuthUpdate` `headers`.
	Headers []HTTPHeaderUpdate `json:"headers,omitempty"`
	// The `HTTPTokenAuthUpdate` `tokens`.
	Tokens []HTTPTokenUpdate `json:"tokens,omitempty"`
	// The definition of `HTTPTokenAuthType` object.
	Type HTTPTokenAuthType `json:"type"`
	// The `HTTPTokenAuthUpdate` `url_parameters`.
	UrlParameters []UrlParamUpdate `json:"url_parameters,omitempty"`
	// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
	UnparsedObject       map[string]interface{} `json:"-"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

// NewHTTPTokenAuthUpdate instantiates a new HTTPTokenAuthUpdate object.
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewHTTPTokenAuthUpdate(typeVar HTTPTokenAuthType) *HTTPTokenAuthUpdate {
	this := HTTPTokenAuthUpdate{}
	this.Type = typeVar
	return &this
}

// NewHTTPTokenAuthUpdateWithDefaults instantiates a new HTTPTokenAuthUpdate object.
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set.
func NewHTTPTokenAuthUpdateWithDefaults() *HTTPTokenAuthUpdate {
	this := HTTPTokenAuthUpdate{}
	return &this
}

// GetBody returns the Body field value if set, zero value otherwi


               ret_value    = -1; /* Return value */

    FUNC_ENTER_API((-1))
    H5TRACE3("Zs", "ixz", id, name, size);

    /* Get the object pointer */
    if (NULL == (vol_obj = H5VL_vol_object(id)))
        HGOTO_ERROR(H5E_ID, H5E_BADTYPE, (-1), "invalid identifier")

    /* Set location parameters */
    loc_params.type     = H5VL_OBJECT_BY_SELF;
    loc_params.obj_type = H5I_get_type(id);

    /* Set up VOL callback arguments */
    vol_cb_args.op_type                = H5VL_OBJECT_GET_NAME;
    vol_cb_args.args.get_name.buf_size = size;
    vol_cb_args.args.get_name.buf      = name;
    vol_cb_args.args.get_name.name_len = &obj_name_len;

    /* Retrieve object's name */
    if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
        HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't retrieve object name")

    /* Set return value */
    ret_value = (ssize_t)obj_name_len;

done:
    FUNC_LEAVE_API(ret_value)
} /* end H5Iget_name() */


ktop.DBus.Error.Failed");
        let m = t.message().unwrap_or("Unknown error");
        MethodErr(String::from(n).into(), m.into())
    }
}

/// Result containing the Messages returned from the Method, or a MethodErr.
pub type MethodResult = Result<Vec<Message>, MethodErr>;

/// Associated data for different objects in a tree.
///
/// These currently require a debug bound, due to https://github.com/rust-lang/rust/issues/31518
pub trait DataType: Sized + Default {
    /// Type of associated data on the Tree.
    type Tree: fmt::Debug;
    /// Type of associated data on every ObjectPath.
    type ObjectPath: fmt::Debug;
    /// Type of associated data on every Property.
    type Property: fmt::Debug;
    /// Type of associated data on every Interface.
    type Interface: fmt::Debug;
    /// Type of associated data on every Method.
    type Method: fmt::Debug;
    /// Type of associated data on every Signal.
    type Signal: fmt::Debug;
}

/// No associated data for the tree.
impl DataType for () {
    type Tree = ();
    type ObjectPath = ();
    type Interface = ();
    type Property = ();
    type Method = ();
    type Signal = ();
}

/// A helper trait used internally to make the tree generic over MTFn, MTFnMut and MTSync.
///
/// You should not need to call these methods directly, it's primarily for internal use.
pub trait MethodType<D: DataType>: Sized + Default {
    /// For internal use.
    type Method: ?Sized;
    /// For internal use.
    type GetProp: ?Sized;
    /// For internal use.
    type SetProp: ?Sized;

    /// For internal use.
    fn call_getprop(_: &Self::GetProp, _: &mut IterAppend, _: &PropInfo<Self, D>) -> Result<(), MethodErr>;
    /// For internal use.
    fn call_setprop(_: &Self::SetProp, _: &mut Iter, _: &PropInfo<Self, D>) -> Result<(), MethodErr>;
    /// For internal use.
    fn call_method(_: &Self::Method, _: &MethodInfo<Self, D>) -> MethodResult;

    /// For internal use.
    fn make_getprop<H>(h: H) -> Box<Self::GetProp>
    where H: Fn(&mut IterAppend, &PropInfo<Self,D>) -> Result<(), MethodErr> + Send + Sync + 'static;
    /// For internal use.
    fn make_method<H>(h: H) -> Box<Self::Method>
    where H: Fn(&MethodInfo<Self,D>) -> MethodResult + Send + Sync + 'static;
}

/// An abstract type to represent Fn functions.
#[derive(Default, Debug, Copy, Clone)]
pub struct MTFn<D=()>(PhantomData<*const D>);

impl<D: DataType> MethodType<D> for MTFn<D> {
    type GetProp = dyn Fn(&mut IterAppend, &PropInfo<Self, D>) -> Result<(), MethodErr>;
    type SetProp = dyn Fn(&mut Iter, &PropInfo<Self, D>) -> Result<(), MethodErr>;
    type Method = dyn Fn(&MethodInfo<Self, D>) -> MethodResult;

    fn call_getprop(p: &Self::GetProp, i: &mut IterAppend, pinfo: &PropInfo<Self, D>)
        -> Result<(), MethodErr> { p(i, pinfo) }
    fn call_setprop(p: &Self::SetProp, i: &mut Iter, pinfo: &PropInfo<Self, D>)
        -> Result<(), MethodErr> { p(i, pinfo) }
    fn call_method(p: &Self::Method, minfo: &MethodInfo<Self, D>)
        -> MethodResult { p(minfo) }

    fn make_getprop<H>(h: H) -> Box<Self::GetProp>
    where H: Fn(&mut IterAppend, &PropInfo<Self,D


th';

import { readJsonFile } from '../../../utils/fs';

const STORAGE_PATH = path.resolve(__dirname, './storage');

export function getWordsFromFilePart(part: number): TE.TaskEither<Error, Array<string>> {
  return pipe(
    readJsonFile<Array<{ word: string }>>(path.join(STORAGE_PATH, `part-${part}.json`)),
    TE.map(AR.map((l) => l.word)),
    TE.alt(
      () => TE.right<Error, Array<string>>([])
    ),
  );
}
import $$ from '../TestHelpers'
import { sanitizeInput } from '../../src/builder/dom'

describe('custom XMLReader', () => {

  test('skip DocType', () => {
    const xml = $$.t`
    <?xml version="1.0"?>
    <!DOCTYPE root PUBLIC "pub" "sys">
    <root xmlns="ns"/>`

    const doc = $$.create({ parser: { docType: () => undefined } }, xml).doc()
    expect(doc.end()).toBe('<?xml version="1.0"?><root xmlns="ns"/>')
  })

  test('skip all nodes', () => {
    const xml = $$.t`
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!DOCTYPE root PUBLIC "pub" "sys">
    <root>
      <ele>simple element</ele>
      <person age="35">
        <name>John</name>
        <?pi val?>
        <?pi?>
        <!--Good guy-->
        <![CDATA[well formed!]]>
        <address>
          <city>Istanbul</city>
          <street>End of long and winding road</street>
        </address>
        <contact>
          <phone>555-1234</phone>
          <phone>555-1235</phone>
        </contact>
        <id>42</id>
        <details>classified</details>
      </person>
    </root>
    `

    const doc = $$.create({
      parser: {
        attribute: () => undefined,
        cdata: () => undefined,
        docType: () => undefined,
        element: () => undefined,
        instruction: () => undefined,
        text: () => undefined,
        comment: () => undefined
      }
    }).ele('root').ele(xml).doc()

    expect($$.printTree(doc.node)).toBe($$.t`
      root
      `)
  })

  test('skip DocType', () => {
    const xml = $$.t`
    <?xml version="1.0"?>
    <!DOCTYPE root PUBLIC "pub" "sys">
    <root xmlns="ns"/>`

    const doc = $$.create({ parser: { docType: () => undefined } }, xml).doc()
    expect(doc.end()).toBe('<?xml version="1.0"?><root xmlns="ns"/>')
  })

  test("invalidCharReplacement should apply before parser functions", () => {
    const xml = `
    <root>
      <node1\x00/>
      <node2/>
    </root>
    `

    const obj = $$.convert({
      invalidCharReplacement: '',
      parser: {
        element: (parent, ns, name: string) => {
          expect(sanitizeInput(name, '')).toBe(name)
          return parent.ele(name)
        }
      }
    }, xml, { format: 'object' })
    expect(obj).toEqual({
      root: {
        node1: {},
        node2: {}
      }
    })
  })

  test("skip whitespace only text", () => {
    const xml = $$.t`
    <?xml version="1.0"?>
    <root>
      <ele>      </ele>
    </root>`

    const doc = $$.create({ skipWhitespaceOnlyText: true }, xml).doc()
    expect(doc.end()).toBe(`<?xml version="1.0"?><root><ele/></root>`)
  })

  test("retain whitespace only text", () => {
    const xml = $


severity: 68, duration: '30min' },
    { location: 'Central Ave & Oak St', severity: 62, duration: '20min' },
    { location: 'Westside Bridge', severity: 54, duration: '15min' },
    { location: 'South Industrial Park', severity: 43, duration: '10min' },
  ],
  trafficIncidents: [
    { type: 'Accident', location: 'Highway 101 & 5th Ave', time: '08:32', status: 'Active', severity: 'Major' },
    { type: 'Construction', location: 'Main St between 1st-3rd', time: '07:00', status: 'Active', severity: 'Moderate' },
    { type: 'Disabled Vehicle', location: 'Westbound Bridge', time: '08:45', status: 'Clearing', severity: 'Minor' },
  ],
  modeDistribution: [
    { name: 'Private Cars', value: 65 },
    { name: 'Public Transit', value: 18 },
    { name: 'Cycling', value: 7 },
    { name: 'Walking', value: 8 },
    { name: 'Other', value: 2 },
  ],
  optimizationStats: {
    trafficLightOptimization: 68,
    routeSuggestionAcceptance: 42,
    congestionReduction: 23,
    fuelSavings: 18,
    emissionReduction: 15
  }
};

// Main dashboard component
const TrafficDashboard = () => {
  // State
  const [dashboardData, setDashboardData] = useState(FALLBACK_DATA);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState(null);
  const [timeRange, setTimeRange] = useState('day'); // 'day', 'week', 'month'
  const [showSettings, setShowSettings] = useState(false);
  const [areaFilter, setAreaFilter] = useState('all');

  // Refs
  const refreshTimerRef = useRef(null);

  // Data fetching function
  const fetchDashboardData = async () => {
    try {
      setLoading(true);
      const response = await axios.get(`${API_BASE_URL}/dashboard?timeRange=${timeRange}&area=${areaFilter}`);
      setDashboardData(response.data);
      setError(null);
    } catch (err) {
      console.error('Error fetching traffic data:', err);
      setError('Failed to load traffic data. Using cached data instead.');
      // We don't overwrite existing data on error to keep showing the last successful data
    } finally {
      setLoading(false);
    }
  };

  // On mount effect
  useEffect(() => {
    fetchDashboardData();

    // Setup refresh interval
    refreshTimerRef.current = setInterval(fetchDashboardData, REFRESH_INTERVAL);

    // Cleanup
    return () => {
      if (refreshTimerRef.current) {
        clearInterval(refreshTimerRef.current);
      }
    };
  }, [timeRange, areaFilter]);

  // Format date/time
  const formatDateTime = (dateString) => {
    const date = new Date(dateString);
    return date.toLocaleString();
  };

  // Export/download dashboard data
  const exportData = () => {
    const dataStr = JSON.stringify(dashboardData, null, 2);
    const dataUri = `data:application/json;charset=utf-8,${encodeURIComponent(dataStr)}`;

    const exportName = `traffic_data_${new Date().toISOString().split('T')[0]}`;
    const linkElement = document.createElement('a');
    linkElement.setAttribute('href', dataUri);
    linkElement.setAttribute('download', `${exportName}.json`);
    linkElement.click();
  };

  // Render loading or error state
  if (loading && !dashboardData) {
    return (

          <RefreshCw className="animate-spin


y, result);
        }

        [Fact]
        public void FindRegistered_Doesnt_Find_Nonregistered_Property()
        {
            var result = AvaloniaPropertyRegistry.Instance.FindRegistered(typeof(Class1), "Bar");

            Assert.Null(result);
        }

        [Fact]
        public void FindRegistered_Finds_Unqualified_Attached_Property_On_Registering_Type()
        {
            var result = AvaloniaPropertyRegistry.Instance.FindRegistered(typeof(AttachedOwner), "Attached");

            Assert.Same(AttachedOwner.AttachedProperty, result);
        }

        [Fact]
        public void FindRegistered_Finds_AddOwnered_Attached_Property()
        {
            var result = AvaloniaPropertyRegistry.Instance.FindRegistered(typeof(Class3), "Attached");

            Assert.Same(AttachedOwner.AttachedProperty, result);
        }

        [Fact]
        public void FindRegistered_Doesnt_Find_Non_AddOwnered_Attached_Property()
        {
            var result = AvaloniaPropertyRegistry.Instance.FindRegistered(typeof(Class2), "Attached");

            Assert.Null(result);
        }

        private class Class1 : AvaloniaObject
        {
            public static readonly StyledProperty<string> FooProperty =
                AvaloniaProperty.Register<Class1, string>("Foo");

            public static readonly StyledProperty<string> BazProperty =
                AvaloniaProperty.Register<Class1, string>("Baz");

            public static readonly StyledProperty<int> QuxProperty =
                AvaloniaProperty.Register<Class1, int>("Qux");
        }

        private class Class2 : Class1
        {
            public static readonly StyledProperty<string> BarProperty =
                AvaloniaProperty.Register<Class2, string>("Bar");

            public static readonly StyledProperty<double> FlobProperty =
                AvaloniaProperty.Register<Class2, double>("Flob");

            public static readonly StyledProperty<double?> FredProperty =
                AvaloniaProperty.Register<Class2, double?>("Fred");
        }

        private class Class3 : Class1
        {
            public static readonly AttachedProperty<string> AttachedProperty =
                AttachedOwner.AttachedProperty.AddOwner<Class3>();
        }

        private class AttachedOwner : Class1
        {
            public static readonly AttachedProperty<string> AttachedProperty =
                AvaloniaProperty.RegisterAttached<AttachedOwner, Class1, string>("Attached");
        }

        private class AttachedOwner2 : AttachedOwner
        {
        }

        private class Class4 : AvaloniaObject
        {
        }
    }
}


 i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AddTrackToPlaylistResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'wavenet'), createEmptyInstance: create)
    ..aOM<ActionResponse>(1, _omitFieldNames ? '' : 'status', subBuilder: ActionResponse.create)
    ..a<$core.int>(2, _omitFieldNames ? '' : 'addedTrackId', $pb.PbFieldType.O3, protoName: 'addedTrackId')
    ..hasRequiredFields = false
  ;

  @$core.Deprecated(
  'Using this can add significant overhead to your binary. '
  'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
  'Will be removed in next major version')
  AddTrackToPlaylistResponse clone() => AddTrackToPlaylistResponse()..mergeFromMessage(this);
  @$core.Deprecated(
  'Using this can add significant overhead to your binary. '
  'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
  'Will be removed in next major version')
  AddTrackToPlaylistResponse copyWith(void Function(AddTrackToPlaylistResponse) updates) => super.copyWith((message) => updates(message as AddTrackToPlaylistResponse)) as AddTrackToPlaylistResponse;

  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static AddTrackToPlaylistResponse create() => AddTrackToPlaylistResponse._();
  AddTrackToPlaylistResponse createEmptyInstance() => create();
  static $pb.PbList<AddTrackToPlaylistResponse> createRepeated() => $pb.PbList<AddTrackToPlaylistResponse>();
  @$core.pragma('dart2js:noInline')
  static AddTrackToPlaylistResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<AddTrackToPlaylistResponse>(create);
  static AddTrackToPlaylistResponse? _defaultInstance;

  @$pb.TagNumber(1)
  ActionResponse get status => $_getN(0);
  @$pb.TagNumber(1)
  set status(ActionResponse v) { setField(1, v); }
  @$pb.TagNumber(1)
  $core.bool hasStatus() => $_has(0);
  @$pb.TagNumber(1)
  void clearStatus() => clearField(1);
  @$pb.TagNumber(1)
  ActionResponse ensureStatus() => $_ensure(0);

  @$pb.TagNumber(2)
  $core.int get addedTrackId => $_getIZ(1);
  @$pb.TagNumber(2)
  set addedTrackId($core.int v) { $_setSignedInt32(1, v); }
  @$pb.TagNumber(2)
  $core.bool hasAddedTrackId() => $_has(1);
  @$pb.TagNumber(2)
  void clearAddedTrackId() => clearField(2);
}

class MoveTrackInPlaylistRequest extends $pb.GeneratedMessage {
  factory MoveTrackInPlaylistRequest({
    $core.int? playlistTrackId,
    $core.int? afterPlaylistTrackId,
  }) {
    final $result = create();
    if (playlistTrackId != null) {
      $result.playlistTrackId = playlistTrackId;
    }
    if (afterPlaylistTrackId != null) {
      $result.afterPlaylistTrackId = afterPlaylistTrackId;
    }
    return $result;
  }
  MoveTrackInPlaylistRequest._() : super();
  factory MoveTrackInPlaylistRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
  factory MoveTrackInPlaylistRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJso


or = "RIGHT"
		elseif (align == "ANCHOR_LEFT") then
			xAnchor = "LEFT"
		else
			xAnchor = "RIGHT"
		end
		if (enhTooltipParentRect.cy < sHeight/2) then
			yAnchor = "TOP"
		else
			yAnchor = "BOTTOM"
		end

		-- Handle the situation where there isn't enough room on the choosen side of
		-- the parent to display the tooltip. In that case we'll just shift tooltip
		-- enough to the left or right so that it doesn't hang off the screen.
		local xOffset = 0;
		if (xAnchor == "RIGHT" and enhTooltipParentRect.r + width > sWidth - 5) then
			xOffset = -(enhTooltipParentRect.r + width - sWidth + 5);
		elseif (xAnchor == "LEFT" and enhTooltipParentRect.l - width < 5) then
			xOffset = -(enhTooltipParentRect.l - width - 5);
		end

		-- Handle the situation where there isn't enough room on the top or bottom of
		-- the parent to display the tooltip. In that case we'll just shift tooltip
		-- enough up or down so that it doesn't hang off the screen.
		local yOffset = 0;
		local totalHeight = height + currentTooltip:GetHeight();
		if (yAnchor == "TOP" and enhTooltipParentRect.t + totalHeight > sHeight - 5) then
			yOffset = -(enhTooltipParentRect.t + totalHeight - sHeight + 5);
		elseif (yAnchor == "BOTTOM" and enhTooltipParentRect.b - totalHeight < 5) then
			yOffset = -(enhTooltipParentRect.b - totalHeight - 5);
		end

		currentTooltip:ClearAllPoints()
		EnhancedTooltip:ClearAllPoints()
		local anchor = yAnchor..xAnchor

		if (anchor == "TOPLEFT") then
			EnhancedTooltip:SetPoint("BOTTOMRIGHT", parentObject, "TOPLEFT", -5 + xOffset, 5 + yOffset)
			currentTooltip:SetPoint("BOTTOMRIGHT", EnhancedTooltip, "TOPRIGHT", 0,0)
		elseif (anchor == "TOPRIGHT") then
			EnhancedTooltip:SetPoint("BOTTOMLEFT", parentObject, "TOPRIGHT", 5 + xOffset, 5 + yOffset)
			currentTooltip:SetPoint("BOTTOMLEFT", EnhancedTooltip, "TOPLEFT", 0,0)
		elseif (anchor == "BOTTOMLEFT") then
			currentTooltip:SetPoint("TOPRIGHT", parentObject, "BOTTOMLEFT", -5 + xOffset, -5 + yOffset)
			EnhancedTooltip:SetPoint("TOPRIGHT", currentTooltip, "BOTTOMRIGHT", 0,0)
		else -- BOTTOMRIGHT
			currentTooltip:SetPoint("TOPLEFT", parentObject, "BOTTOMRIGHT", 5 + xOffset, -5 + yOffset)
			EnhancedTooltip:SetPoint("TOPLEFT", currentTooltip, "BOTTOMLEFT", 0,0)
		end

	else
		-- No parent
		-- The only option is to tack the object underneath / shuffle it up if there aint enuff room
		self.showIgnore=true;
		currentTooltip:Show()
		self.showIgnore=false;
		enhTooltipTipRect = getRect(currentTooltip, enhTooltipTipRect)

		if (enhTooltipTipRect.b - height < 60) then
			currentTooltip:ClearAllPoints()
			currentTooltip:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", enhTooltipTipRect.l, height+60)
		end
		EnhancedTooltip:ClearAllPoints()
		if (enhTooltipTipRect.cx < 6*sWidth/10) then
			EnhancedTooltip:SetPoint("TOPLEFT", currentTooltip, "BOTTOMLEFT", 0,0)
		else
			EnhancedTooltip:SetPoint("TOPRIGHT", currentTool


STIPPLE_REPEAT = 0x0B26;
	int GL_LIST_MODE = 0x0B30;
	int GL_MAX_LIST_NESTING = 0x0B31;
	int GL_LIST_BASE = 0x0B32;
	int GL_LIST_INDEX = 0x0B33;
	int GL_POLYGON_MODE = 0x0B40;
	int GL_POLYGON_SMOOTH = 0x0B41;
	int GL_POLYGON_STIPPLE = 0x0B42;
	int GL_EDGE_FLAG = 0x0B43;
	int GL_CULL_FACE = 0x0B44;
	int GL_CULL_FACE_MODE = 0x0B45;
	int GL_FRONT_FACE = 0x0B46;
	int GL_LIGHTING = 0x0B50;
	int GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51;
	int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52;
	int GL_LIGHT_MODEL_AMBIENT = 0x0B53;
	int GL_SHADE_MODEL = 0x0B54;
	int GL_COLOR_MATERIAL_FACE = 0x0B55;
	int GL_COLOR_MATERIAL_PARAMETER = 0x0B56;
	int GL_COLOR_MATERIAL = 0x0B57;
	int GL_FOG = 0x0B60;
	int GL_FOG_INDEX = 0x0B61;
	int GL_FOG_DENSITY = 0x0B62;
	int GL_FOG_START = 0x0B63;
	int GL_FOG_END = 0x0B64;
	int GL_FOG_MODE = 0x0B65;
	int GL_FOG_COLOR = 0x0B66;
	int GL_DEPTH_RANGE = 0x0B70;
	int GL_DEPTH_TEST = 0x0B71;
	int GL_DEPTH_WRITEMASK = 0x0B72;
	int GL_DEPTH_CLEAR_VALUE = 0x0B73;
	int GL_DEPTH_FUNC = 0x0B74;
	int GL_ACCUM_CLEAR_VALUE = 0x0B80;
	int GL_STENCIL_TEST = 0x0B90;
	int GL_STENCIL_CLEAR_VALUE = 0x0B91;
	int GL_STENCIL_FUNC = 0x0B92;
	int GL_STENCIL_VALUE_MASK = 0x0B93;
	int GL_STENCIL_FAIL = 0x0B94;
	int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95;
	int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96;
	int GL_STENCIL_REF = 0x0B97;
	int GL_STENCIL_WRITEMASK = 0x0B98;
	int GL_MATRIX_MODE = 0x0BA0;
	int GL_NORMALIZE = 0x0BA1;
	int GL_VIEWPORT = 0x0BA2;
	int GL_MODELVIEW_STACK_DEPTH = 0x0BA3;
	int GL_PROJECTION_STACK_DEPTH = 0x0BA4;
	int GL_TEXTURE_STACK_DEPTH = 0x0BA5;
	int GL_MODELVIEW_MATRIX = 0x0BA6;
	int GL_PROJECTION_MATRIX = 0x0BA7;
	int GL_TEXTURE_MATRIX = 0x0BA8;
	int GL_ATTRIB_STACK_DEPTH = 0x0BB0;
	int GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1;
	int GL_ALPHA_TEST = 0x0BC0;
	int GL_ALPHA_TEST_FUNC = 0x0BC1;
	int GL_ALPHA_TEST_REF = 0x0BC2;
	int GL_DITHER = 0x0BD0;
	int GL_BLEND_DST = 0x0BE0;
	int GL_BLEND_SRC = 0x0BE1;


   } else {
            0
        };
        let mut existing_files_enum = existing_files.iter().enumerate().rev();
        for (_, file) in existing_files_enum.by_ref().take(num_files_rm) {
            println!("Removing the following file: {}", file);
            fs::remove_file(file)?
        }
        for (i, file) in existing_files_enum {
            let new_file = format!("{}.{}", logfile_base, i + 1);
            println!("Renaming file {} to {}", file, new_file);
            fs::rename(file, new_file)?
        }
        if num_discarded > 0 {
            Ok((self.num_old_logs as u64, num_discarded))
        } else {
            Ok((num_files_rm as u64, 0))
        }
    }
}

pub struct LogState<'a> {
    mmaps: HashMap<String, (u32, &'a [u8])>,
    old_logs: OldLogState,
    buf_size: usize,
}

impl<'a> LogState<'a> {
    pub fn new(old_log_num: usize, buf_size: usize) -> Self {
        LogState { old_logs: OldLogState::new(old_log_num),
                   mmaps: HashMap::new(), buf_size }
    }

    pub fn handle_log(&mut self, logfile: &str) -> Result<(), LogHandleError> {
        let mmap_open = self.mmaps.contains_key(logfile);
        if !mmap_open {
            unsafe {
                match libc::open(logfile as *const _ as *const i8, libc::O_RDWR) {
                    i if i < 0 => Err(LogHandleError::from_errno()),
                    i => {
                        let mmap_ptr = libc::mmap(ptr::null_mut(), self.buf_size, libc::PROT_READ,
                                                  libc::MAP_SHARED, i, 0);
                        self.mmaps.insert(logfile.to_owned(),
                                          (i as u32,
                                           slice::from_raw_parts(
                                               mmap_ptr as *const u8, self.buf_size)
                                           ));
                        Ok(())
                    },
                }?;
            };
        }
        let current_size = fs::metadata(logfile)?.len();
        if current_size > self.buf_size as u64 {
            self.logrotate(logfile, current_size)?
        }
        Ok(())
    }

    fn strip_log_head(&self, logfile_base: &str, end_num: u64, num_drop: usize)
                      -> Result<(), LogHandleError> {
        if let Some(&(fd, mmap)) = self.mmaps.get(logfile_base) {
            if num_drop > 0 {
                if unsafe { libc::fallocate(fd as libc::c_int, libc::FALLOC_FL_COLLAPSE_RANGE,
                                            0, (self.buf_size * num_drop) as libc::c_long) } < 0 {
                    return Err(LogHandleError::from_errno());
                }
            }
            for file_num in 0..end_num {
                let mut f = File::create(&format!("{}.{}", logfile_base, file_num))?;
                f.write_all(mmap)?;
                if unsafe { libc::fallocate(fd as libc::c_int, libc::FALLOC_FL_COLLAPSE_RANGE,
                                            0, self.buf_size as libc::c_long) } < 0 {
                    return Err(LogHandleError::from_errno());
                }
            }
        }

        Ok(())
    }

    fn logrotate(&mut self, path: &str, current_size: u64) -> Result<(), LogHandleError> {
        let (end_num, num_drop) = self.old_logs.


OpenList(tempStart, endPoint, item);
                    }
                }
                if (PointListHelp.getPoint(this.OpenList, endPoint)) {
                    return PointListHelp.getPoint(this.OpenList, endPoint);
                }
            }
            return PointListHelp.getPoint(this.OpenList, endPoint);
        }

        /**
         * 找出与 point 点相邻的8个节点
         * @private
         * @param {Point} point
         * @param {boolean} IsIngnoreCorner
         * @returns {Array<Point>}
         * @memberof AStart
         */
        private SurroundPoints(point: Point, IsIngnoreCorner: boolean): Array<Point> {
            let surroundPoint = [];
            for (let x: number = point.X - 1; x <= point.X + 1; x++) {
                for (let y: number = point.Y - 1; y <= point.Y + 1; y++) {
                    if (this.canReach(point, x, y, IsIngnoreCorner)) {
                        let targetPoint: Point = new Point(x, y);
                        surroundPoint.push(targetPoint);
                    }
                }
            }
            return surroundPoint;
        }

        /**
         * (x,y)点是否可以到达
         * @private
         * @param {Point} start
         * @param {number} x
         * @param {number} y
         * @param {Boolean} IsIngnoreCorner
         * @returns {boolean}
         * @memberof AStart
         */
        private canReach(start: Point, x: number, y: number, IsIngnoreCorner: boolean): boolean {
            if (!this.notObstacles(x, y) || PointListHelp.xyIsExistInList(this.CloseList, x, y)) {
                //是障碍物，或者在关闭列表中，为不能到达的点
                return false;
            }
            //不是障碍物，也不在关闭列表中（关闭列表中的点不再进行检查），属于正常需要检查的点
            if (Math.abs(x - start.X) + Math.abs(y - start.Y) == 1) {//上下左右相邻的点（X+Y的间隔之和为1个单位）
                return true;
            } else {
                //如果是斜方向，判断是否是'绊脚'
                //(方法：判断当前点横坐标的后一个点和纵坐标的后一个点不是障碍物，则该斜方向即可行走)
                if (this.notObstacles(Math.abs(x - 1), y) && this.notObstacles(x, Math.abs(y - 1))) {
                    return true;
                }
                return IsIngnoreCorner;
            }
        }

        /**
         * 是否为障碍物（0：不是障碍物；1：障碍物）
         * @private
         * @param {number} x
         * @param {number} y
         * @returns {boolean}
         * @memberof AStart
         */
        private notObstacles(x: number, y: number): boolean {
            return this.mapArray[y][x] == 0;
        }

        /**
         * 在开启列表中找到点，更新 G 和 F 的值，如果计算出来的 G 值比原来小，则更新父节点，并重新计算 G 值和 F 值
         * @private
         * @param {Point} tempStart 父节点
         * @param {Point} point     子节点（周围的8个可以到达节点之一）
         * @memberof AStart
         */
        private findPointInOpenList(tempStart: Point, point: Point): void {
            let G:


tion",
			Examples:    []string{"scalingo --app my-app domains-remove example.com"},
			SeeAlso:     []string{"domains", "domains-add"},
		}.Render(),

		Action: func(ctx context.Context, c *cli.Command) error {
			currentApp := detect.CurrentApp(c)
			utils.CheckForConsent(ctx, currentApp, utils.ConsentTypeContainers)
			var err error
			if c.Args().Len() == 1 {
				err = domains.Remove(ctx, currentApp, c.Args().First())
			} else {
				_ = cli.ShowCommandHelp(ctx, c, "domains-remove")
			}

			if err != nil {
				errorQuit(ctx, err)
			}
			return nil
		},
		ShellComplete: func(ctx context.Context, c *cli.Command) {
			_ = autocomplete.CmdFlagsAutoComplete(c, "domains-remove")
			_ = autocomplete.DomainsRemoveAutoComplete(ctx, c)
		},
	}

	// TODO: Split the two operations (enable/disable) into two subcommands
	DomainsSSLCommand = cli.Command{
		Name:      "domains-ssl",
		Category:  "Custom Domains",
		Usage:     "Enable or disable SSL for your custom domains",
		ArgsUsage: "domain [disable]",
		Flags: []cli.Flag{&appFlag,
			&cli.StringFlag{Name: "cert", Usage: "SSL Signed Certificate", Value: "domain.crt"},
			&cli.StringFlag{Name: "key", Usage: "SSL Keypair", Value: "domain.key"},
		},
		Description: CommandDescription{
			Description: "Enable or disable SSL for your custom domains",
			Examples: []string{
				"scalingo --app my-app domains-ssl --cert certificate.crt --key keyfile.key example.com",
				"scalingo --app my-app domains-ssl example.com disable",
			},
			SeeAlso: []string{"domains", "domains-add"},
		}.Render(),

		Action: func(ctx context.Context, c *cli.Command) error {
			currentApp := detect.CurrentApp(c)
			utils.CheckForConsent(ctx, currentApp, utils.ConsentTypeContainers)
			if c.Args().Len() == 2 && c.Args().Slice()[1] == "disable" {
				err := domains.DisableSSL(ctx, currentApp, c.Args().First())
				if err != nil {
					errorQuit(ctx, err)
				}
			} else if c.Args().Len() == 1 {
				certContent, keyContent, err := validateTLSParams(ctx, c.String("cert"), c.String("key"))
				if err != nil {
					errorQuit(ctx, err)
				}
				err = domains.EnableSSL(ctx, currentApp, c.Args().First(), certContent, keyContent)
				if err != nil {
					errorQuit(ctx, err)
				}
			} else {
				_ = cli.ShowCommandHelp(ctx, c, "domains-ssl")
			}
			return nil
		},
		ShellComplete: func(_ context.Context, c *cli.Command) {
			_ = autocomplete.CmdFlagsAutoComplete(c, "domains-ssl")
		},
	}

	setCanonicalDomainCommand = cli.Command{
		Name:      "set-canonical-domain",
		Category:  "App Management",
		Flags:     []cli.Flag{&appFlag},
		Usage:     "Set a canonical domain.",
		ArgsUsage: "domain",
		Description: CommandDescription{
			Description: `After defining multiple domains on an application, one can need to redirect all requests towards its application to a specific domain.
This domain is called the canonical domain. This command sets the canonical domain`,
			Examples: []string{"scalingo -a myapp set-canonical-domain example.com"},
			SeeAlso:  []string{"domains", "domains-add", "unset-canonical-domain"},
		}.Render(),

		Action: func(ctx context.


no_pairwise()
            || caps.mgmt_frame_protection_req()
            || caps.joint_multiband()
            || caps.peerkey_enabled()
            || caps.ssp_amsdu_req()
            || caps.pbac()
            || caps.extended_key_id())
    });

    group_data_supported && pairwise_supported && akm_supported && caps_supported
}

pub fn get_rsna(
    device_info: &DeviceInfo,
    credential: &fidl_sme::Credential,
    bss: &BssDescription,
) -> Result<Option<Rsna>, failure::Error> {
    let a_rsne_bytes = match credential {
        fidl_sme::Credential::None(_) => {
            ensure!(bss.rsn.is_none(), "password required for secure network, but none provided");
            return Ok(None);
        }
        fidl_sme::Credential::Psk(_) | fidl_sme::Credential::Password(_) => {
            ensure!(bss.rsn.is_some(), "password provided for open network, but none expected");
            &bss.rsn.as_ref().unwrap()[..]
        }
        _ => bail!("unsupported credential type"),
    };

    // Credentials supplied and BSS is protected.
    let a_rsne = rsne::from_bytes(a_rsne_bytes)
        .to_full_result()
        .map_err(|e| format_err!("invalid RSNE {:02x?}: {:?}", a_rsne_bytes, e))?;
    let s_rsne = derive_s_rsne(&a_rsne)?;
    let negotiated_rsne = NegotiatedRsne::from_rsne(&s_rsne)?;
    let psk = compute_psk(credential, &bss.ssid[..])?;
    let supplicant = wlan_rsn::Supplicant::new_wpa2psk_ccmp128(
        // Note: There should be one Reader per device, not per SME.
        // Follow-up with improving on this.
        NonceReader::new(&device_info.addr[..])?,
        psk,
        device_info.addr,
        s_rsne,
        bss.bssid,
        a_rsne,
    )
    .map_err(|e| format_err!("failed to create ESS-SA: {:?}", e))?;
    Ok(Some(Rsna { negotiated_rsne, supplicant: Box::new(supplicant) }))
}

fn compute_psk(credential: &fidl_sme::Credential, ssid: &[u8]) -> Result<psk::Psk, failure::Error> {
    match credential {
        fidl_sme::Credential::Password(password) => psk::compute(&password[..], ssid),
        fidl_sme::Credential::Psk(psk) => {
            ensure!(psk.len() == 32, "PSK must be 32 octets but was {}", psk.len());
            Ok(psk.clone().into_boxed_slice())
        }
        _ => bail!("unsupported credentials configuration"),
    }
}

/// Constructs Supplicant's RSNE with:
/// Group Data Cipher: same as A-RSNE (CCMP-128 or TKIP)
/// Pairwise Cipher: CCMP-128
/// AKM: PSK
fn derive_s_rsne(a_rsne: &Rsne) -> Result<Rsne, failure::Error> {
    if !is_rsn_compatible(&a_rsne) {
        bail!("incompatible RSNE {:?}", a_rsne);
    }

    // If Authenticator's RSNE is supported, construct Supplicant's RSNE.
    let mut s_rsne = Rsne::new();
    s_rsne.group_data_cipher


Exception("Get sheetID Failed Message => " + e.Message);
            }
        }

        public static string GetSpreadSheetID(System.Type type)
        {
            try
            {
                var field = type.GetField("spreadSheetID",
                    System.Reflection.BindingFlags.NonPublic |
                    System.Reflection.BindingFlags.Static);
                var value = field.GetValue(null);
                return (string)value;
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e);
                throw new System.Exception("GetSpreadSheetId Failed Message => " + e.Message);
            }
        }
        public static string GetSheetID(System.Type type)
        {
            try
            {
                var field = type.GetField("spreadSheetID",
                    System.Reflection.BindingFlags.Static |
                    System.Reflection.BindingFlags.NonPublic |
                    System.Reflection.BindingFlags.Public);
                var value = field.GetValue(null);
                return (string)value;
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e);
                throw new System.Exception("Get sheetID Failed Message => " + e.Message);
            }
        }
    }
}


e Response
    {
        [MethodImpl(MethodImplOptions.InternalCall)]
        [return: MarshalAs(UnmanagedType.Interface)]
        get;
        [MethodImpl(MethodImplOptions.InternalCall)]
        [param: In]
        [param: MarshalAs(UnmanagedType.Interface)]
        set;
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    [return: MarshalAs(UnmanagedType.Interface)]
    ICoreWebView2Deferral GetDeferral();

    [DispId(1610678276)]
    COREWEBVIEW2_WEB_RESOURCE_CONTEXT ResourceContext
    {
        [MethodImpl(MethodImplOptions.InternalCall)]
        get;
    }
}


#
# Copyright 2024-present ScyllaDB
#
# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
#

import pytest

from test.nodetool.rest_api_mock import expected_request

def test_rebuild(nodetool):
    nodetool("rebuild", expected_requests=[
        expected_request(
            "POST",
            "/storage_service/rebuild",
            params = {},
            response = "SUCCESSFUL")
    ])

def test_rebuild_source_dc(nodetool):
    source_dc = "UNKNOWN_DC"
    nodetool("rebuild", source_dc, expected_requests=[
        expected_request(
            "POST",
            "/storage_service/rebuild",
            params = {"source_dc": source_dc},
            response = "SUCCESSFUL")
    ])

def test_rebuild_force_source_dc(nodetool, scylla_only):
    source_dc = "UNKNOWN_DC"
    nodetool("rebuild", "--force", source_dc, expected_requests=[
        expected_request(
            "POST",
            "/storage_service/rebuild",
            params = {
                "force": "true",
                "source_dc": source_dc
            },
            response = "SUCCESSFUL")
    ])

def test_rebuild_force_no_source_dc(nodetool):
    nodetool("rebuild", "--force", expected_requests=[
        expected_request(
            "POST",
            "/storage_service/rebuild",
            params = {
                "force": "true"
            },
            response = None,
            response_status = 500)
    ])


57C 84D0014C */  lh      $s0, 0x014C($a2)           ## 0000014C
/* 00190 80BAB580 2A010020 */  slti    $at, $s0, 0x0020
/* 00194 80BAB584 1020000C */  beq     $at, $zero, .L80BAB5B8
/* 00198 80BAB588 02002025 */  or      $a0, $s0, $zero            ## $a0 = 00000000
/* 0019C 80BAB58C 00042640 */  sll     $a0, $a0, 25
/* 001A0 80BAB590 00042403 */  sra     $a0, $a0, 16
/* 001A4 80BAB594 0C01DE1C */  jal     Math_Sins
              ## sins?
/* 001A8 80BAB598 AFA600B0 */  sw      $a2, 0x00B0($sp)
/* 001AC 80BAB59C 3C0180BB */  lui     $at, %hi(D_80BACB1C)       ## $at = 80BB0000
/* 001B0 80BAB5A0 C424CB1C */  lwc1    $f4, %lo(D_80BACB1C)($at)
/* 001B4 80BAB5A4 8FA600B0 */  lw      $a2, 0x00B0($sp)
/* 001B8 80BAB5A8 46040182 */  mul.s   $f6, $f0, $f4
/* 001BC 80BAB5AC E7A600A4 */  swc1    $f6, 0x00A4($sp)
/* 001C0 80BAB5B0 10000004 */  beq     $zero, $zero, .L80BAB5C4
/* 001C4 80BAB5B4 84D0014C */  lh      $s0, 0x014C($a2)           ## 0000014C
.L80BAB5B8:
/* 001C8 80BAB5B8 3C0180BB */  lui     $at, %hi(D_80BACB20)       ## $at = 80BB0000
/* 001CC 80BAB5BC C428CB20 */  lwc1    $f8, %lo(D_80BACB20)($at)
/* 001D0 80BAB5C0 E7A800A4 */  swc1    $f8, 0x00A4($sp)
.L80BAB5C4:
/* 001D4 80BAB5C4 2A010050 */  slti    $at, $s0, 0x0050
/* 001D8 80BAB5C8 14200009 */  bne     $at, $zero, .L80BAB5F0
/* 001DC 80BAB5CC 3C0280BB */  lui     $v0, %hi(D_80BAC9CF)       ## $v0 = 80BB0000
/* 001E0 80BAB5D0 00101823 */  subu    $v1, $zero, $s0
/* 001E4 80BAB5D4 00600821 */  addu    $at, $v1, $zero
/* 001E8 80BAB5D8 00031880 */  sll     $v1, $v1,  2
/* 001EC 80BAB5DC 00611823 */  subu    $v1, $v1, $at
/* 001F0 80BAB5E0 00031880 */  sll     $v1, $v1,  2
/* 001F4 80BAB5E4 246304B0 */  addiu   $v1, $v1, 0x04B0           ## $v1 = 000004B0
/* 001F8 80BAB5E8 10000002 */  beq     $zero, $zero, .L80BAB5F4
/* 001FC 80BAB5EC 306300FF */  andi    $v1, $v1, 0x00FF           ## $v1 = 000000B0
.L80BAB5F0:
/* 00200 80BAB5F0 240300FF */  addiu   $v1,


x, 0), 1);
        assert_eq!(*x, 0);

        assert_eq!(rusti::atomic_xadd(x, 1), 0);
        assert_eq!(rusti::atomic_xadd_acq(x, 1), 1);
        assert_eq!(rusti::atomic_xadd_rel(x, 1), 2);
        assert_eq!(*x, 3);

        assert_eq!(rusti::atomic_xsub(x, 1), 3);
        assert_eq!(rusti::atomic_xsub_acq(x, 1), 2);
        assert_eq!(rusti::atomic_xsub_rel(x, 1), 1);
        assert_eq!(*x, 0);
    }
}
use crate::parser::filter::{MatchTarget, ModifierMap};

pub trait MetadataModifier {
    fn replace_operation_mapping(&mut self, replacement: &str);
    fn replace_operation_id(&mut self, replacement: &str);
    fn replace_operation_mapping_n(&mut self, pat: &str, replacement: &str, count: usize);
    fn replace_operation_id_n(&mut self, pat: &str, replacement: &str, count: usize);
    fn operation_mapping(&self) -> String;
    fn operation_id(&self) -> String;

    fn contains_match_target(&self, match_target: &MatchTarget) -> bool {
        match match_target {
            MatchTarget::OperationId(id) => {
                if self.operation_id().contains(id.as_str()) {
                    return true;
                }
            }
            MatchTarget::OperationMap(mapping) => {
                if self.operation_mapping().contains(mapping.as_str()) {
                    return true;
                }
            }
        }
        false
    }

    fn apply_match_target(&mut self, match_target: &MatchTarget) {
        match match_target {
            MatchTarget::OperationId(replacement) => {
                self.replace_operation_id(replacement.as_ref());
            }
            MatchTarget::OperationMap(replacement) => {
                self.replace_operation_mapping(replacement.as_ref());
            }
        }
    }

    fn apply_match_targets(&mut self, match_targets: &[MatchTarget]) {
        for mat_target in match_targets {
            self.apply_match_target(mat_target);
        }
    }

    fn force_update_targets(&mut self, modifier_map: &ModifierMap) {
        for (_match_target, match_target_vec) in modifier_map.map.iter() {
            self.apply_match_targets(match_target_vec);
        }
    }

    fn update_targets(&mut self, modifier_map: &ModifierMap) {
        for (match_target, match_target_vec) in modifier_map.map.iter() {
            for mat_target in match_target_vec.iter() {
                match match_target {
                    MatchTarget::OperationId(id) => {
                        if self.operation_id().eq(id.as_str()) {
                            self.apply_match_target(mat_target);
                        }
                    }
                    MatchTarget::OperationMap(mapping) => {
                        if self.operation_mapping().eq(mapping.as_str()) {
                            self.apply_match_target(mat_target);
                        }
                    }
                }
            }
        }
    }
}
<reponame>ZiHao256/Code<gh_stars>1-10
// 用 ? 运算符简化 match 表达式

use std::io::{self, Read};
use std::fs::File;

fn main() {

    let file_name = get_string();

    let res = read_username_from_file(file_name);

    dbg!(res);

}

fn get_string()


}

  if (quoteTokenFarm.quoteToken.symbol === tokens.usdt.symbol) {
    const quoteTokenInUsdt = quoteTokenFarm.tokenPriceVsQuote
    return hasTokenPriceVsQuote && quoteTokenInUsdt
      ? new BigNumber(farm.tokenPriceVsQuote).times(quoteTokenInUsdt)
      : BIG_ZERO
  }

  // Catch in case token does not have immediate or once-removed USDT/WAVAX quoteToken
  return BIG_ZERO
}

const getFarmQuoteTokenPrice = (farm: Farm, quoteTokenFarm: Farm, avaxPriceUsdt: BigNumber): BigNumber => {
  if (farm.quoteToken.symbol === 'USDT') {
    return BIG_ONE
  }

  if (farm.quoteToken.symbol === 'WAVAX') {
    return avaxPriceUsdt
  }

  if (!quoteTokenFarm) {
    return BIG_ZERO
  }

  if (quoteTokenFarm.quoteToken.symbol === 'WAVAX') {
    return quoteTokenFarm.tokenPriceVsQuote ? avaxPriceUsdt.times(quoteTokenFarm.tokenPriceVsQuote) : BIG_ZERO
  }

  if (quoteTokenFarm.quoteToken.symbol === 'USDT') {
    return quoteTokenFarm.tokenPriceVsQuote ? new BigNumber(quoteTokenFarm.tokenPriceVsQuote) : BIG_ZERO
  }

  return BIG_ZERO
}

const fetchFarmsPrices = async (farms: Farm[]) => {
  const avaxUsdtFarm = farms.find((farm) => farm.pid === 17)
  const avaxPriceUsdt = avaxUsdtFarm.tokenPriceVsQuote ? BIG_ONE.div(avaxUsdtFarm.tokenPriceVsQuote) : BIG_ZERO

  const farmsWithPrices = farms.map((farm) => {
    const quoteTokenFarm = getFarmFromTokenSymbol(farms, farm.quoteToken.symbol)
    const tokenPriceUsdt = getFarmBaseTokenPrice(farm, quoteTokenFarm, avaxPriceUsdt)
    const quoteTokenPriceUsdt = getFarmQuoteTokenPrice(farm, quoteTokenFarm, avaxPriceUsdt)

    return {
      ...farm,
      tokenPriceUsdt: tokenPriceUsdt.toJSON(),
      quoteTokenPriceUsdt: quoteTokenPriceUsdt.toJSON(),
    }
  })

  return farmsWithPrices
}

export default fetchFarmsPrices
import { EventEmitter, Input, OnDestroy, OnInit, Output } from "@angular/core";
import { Component } from "@angular/core";
import { Subscription } from "rxjs";
import { People } from "src/app/models/people";
import { PeopleService } from "src/app/services/people-service";

@Component({
    selector: 'app-home',
    templateUrl: './home.component.html',
    styleUrls: ['./home.component.css']
  })

  export class HomeComponent implements OnInit, OnDestroy {

@Input() people: People

@Output()
public clickPeopleItem: EventEmitter<People> = new EventEmitter<People>()

    public peoples: People[]
    private subscription: Subscription = new Subscription()

constructor(private peopleService: PeopleService){}

ngOnInit(): void{
  this.subscription.add(
    this.peopleService.getPeople().subscribe(
      (p) => {
        this.peoples = p,
        console.log ("peoples ", p)
      }
    )
  )
}

ngOnDestroy(): void {
this.subscription.unsubscribe()
  }

public onClickSummon(id: number): void {
  this.clickPeopleItem.emit(this.peoples[0])
  console.log(this.peoples[0])
  this.peopleService.getPeopleById(id)
}

}import {Registers} from "../cpu/registers";
import {Memory} from "./memory";
/**
 * Created by hkamran on 12/11/2016.
 */
export class Stack {

    //Grows download
    //starts at 0xFFFE and grows down.

    private register: Registers;
    private memory: Memory;

    constructor(memory: Memory, register: Register


3.OpOption{}
	if wc.recursive {
		opts = append(opts, clientv3.WithPrefix())
	}
	getResp, err := wc.watcher.client.Get(wc.ctx, wc.key, opts...)
	if err != nil {
		return err
	}
	wc.initialRev = getResp.Header.Revision

	for _, kv := range getResp.Kvs {
		wc.sendEvent(parseKV(kv))
	}
	return nil
}

// startWatching does:
// - get current objects if initialRev=0; set initialRev to current rev
// - watch on given key and send events to process.
func (wc *watchChan) startWatching() {
	if wc.initialRev == 0 {
		if err := wc.sync(); err != nil {
			wc.sendError(err)
			return
		}
	}
	opts := []clientv3.OpOption{clientv3.WithRev(wc.initialRev + 1)}
	if wc.recursive {
		opts = append(opts, clientv3.WithPrefix())
	}
	wch := wc.watcher.client.Watch(wc.ctx, wc.key, opts...)
	for wres := range wch {
		if wres.Err() != nil {
			// If there is an error on server (e.g. compaction), the channel will return it before closed.
			wc.sendError(wres.Err())
			return
		}
		for _, e := range wres.Events {
			wc.sendEvent(parseEvent(e))
		}
	}
}

// processEvent processes events from etcd watcher and sends results to resultChan.
func (wc *watchChan) processEvent(wg *sync.WaitGroup) {
	defer wg.Done()

	for {
		select {
		case e := <-wc.incomingEventChan:
			res := wc.transform(e)
			if res == nil {
				continue
			}
			// If user couldn't receive results fast enough, we also block incoming events from watcher.
			// Because storing events in local will cause more memory usage.
			// The worst case would be closing the fast watcher.
			select {
			case wc.resultChan <- *res:
			case <-wc.ctx.Done():
				return
			}
		case <-wc.ctx.Done():
			return
		}
	}
}

// transform transforms an event into a result for user if not filtered.
// TODO (Optimization):
// - Save remote round-trip.
//   Currently, DELETE and PUT event don't contain the previous value.
//   We need to do another Get() in order to get previous object and have logic upon it.
//   We could potentially do some optimizations:
//   - For PUT, we can save current and previous objects into the value.
//   - For DELETE, See https://github.com/coreos/etcd/issues/4620
func (wc *watchChan) transform(e *event) (res *watch.Event) {
	curObj, oldObj, err := prepareObjs(wc.ctx, e, wc.watcher.client, wc.watcher.codec, wc.watcher.versioner)
	if err != nil {
		wc.sendError(err)
		return nil
	}

	switch {
	case e.isDeleted:
		if !wc.filter(oldObj) {
			return nil
		}
		res = &watch.Event{
			Type:   watch.Deleted,
			Object: oldObj,
		}
	case e.isCreated:
		if !wc.filter(curObj) {
			return nil
		}
		res = &watch.Event{
			Type:   watch.Added,
			Object: curObj,
		}
	default:
		curObjPasses := wc.filter(curObj)
		oldObjPasses := wc.filter(oldObj)
		switch {
		case curObjPasses && oldObjPasses:
			res = &watch.Event{
				Type:   watch.Modified,
				Object: curObj,
			}
		case curObjPasses && !oldObjPasses:
			res = &watch.Event{
				Type:   watch.Added,
				Object: curObj,
			}
		case !curObjPasses && oldObjPasses:
			res = &watch.Event{
				Type:   watch.Deleted,
				Object: oldObj,


core.resources.IResourceStatus;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;

/**
 * Reads version 1 of the workspace tree file format.
 */
public class WorkspaceTreeReader_1 extends WorkspaceTreeReader {
	protected Workspace workspace;

	public WorkspaceTreeReader_1(Workspace workspace) {
		this.workspace = workspace;
	}

	protected int getVersion() {
		return ICoreConstants.WORKSPACE_TREE_VERSION_1;
	}

	protected void linkBuildersToTrees(List<BuilderPersistentInfo> buildersToBeLinked, ElementTree[] trees, int index, IProgressMonitor monitor) {
		monitor = Policy.monitorFor(monitor);
		try {
			ArrayList<BuilderPersistentInfo> infos = null;
			String projectName = null;
			for (BuilderPersistentInfo info : buildersToBeLinked) {
				if (!info.getProjectName().equals(projectName)) {
					if (infos != null) { // if it is not the first iteration
						IProject project = workspace.getRoot().getProject(projectName);
						workspace.getBuildManager().setBuildersPersistentInfo(project, infos);
					}
					projectName = info.getProjectName();
					infos = new ArrayList<>(5);
				}
				info.setLastBuildTree(trees[index++]);
				infos.add(info);
			}
			if (infos != null) {
				IProject project = workspace.getRoot().getProject(projectName);
				workspace.getBuildManager().setBuildersPersistentInfo(project, infos);
			}
		} finally {
			monitor.done();
		}
	}

	protected void linkPluginsSavedStateToTrees(List<SavedState> states, ElementTree[] trees, IProgressMonitor monitor) {
		monitor = Policy.monitorFor(monitor);
		try {
			for (int i = 0; i < states.size(); i++) {
				SavedState state = states.get(i);
				// If the tree is too old (depends on the policy), the plug-in should not
				// get it back as a delta. It is expensive to maintain this information too long.
				final SaveManager saveManager = workspace.getSaveManager();
				if (!saveManager.isOldPluginTree(state.pluginId)) {
					state.oldTree = trees[i];
				} else {
					//clear information for this plugin from master table
					saveManager.clearDeltaExpiration(state.pluginId);
				}
			}
		} finally {
			monitor.done();
		}
	}

	protected BuilderPersistentInfo readBuilderInfo(IProject project, DataInputStream input, int index) throws IOException {
		//read the project name
		String projectName = input.readUTF();
		//use the name of the project handle if available
		if (project != null) {
			projectName = project.getName();
		}
		String builderName = input.readUTF();
		return new BuilderPersistentInfo(projectName, builderName, index);
	}

	protected void readBuildersPersistentInfo(IProject project, DataInputStream input, List<BuilderPersistentInfo> builders, IProgressMonitor monitor) throws IOException {
		monitor = Policy.monitorFor(monitor);
		try {
			int builderCount = input.readInt();
			for (int i = 0; i < builderCount; i++) {
				builders.add(readBuilderInfo(project, input, i));
			}
		} finally {
			monitor.done();
		}
	}

	protected void readPluginsSavedStates(DataInputStream input, HashMap<String, SavedState> savedStates, List<SavedState> plugins, IProgressMonitor monitor) throws IOException, CoreException {
		monitor = Policy.monitorFor(monitor);
		try {
			int stateCount = input.readInt();
			for (int i = 0; i < stateCount; i++) {
				String pluginId = input.readUTF();
				SavedState state = new SavedState(workspace, pluginId, null, null);
				savedStates


t   qh_setequal(setT *setA, setT *setB);
int   qh_setequal_except (setT *setA, void *skipelemA, setT *setB, void *skipelemB);
int   qh_setequal_skip (setT *setA, int skipA, setT *setB, int skipB);
void  qh_setfree(setT **set);
void  qh_setfree2( setT **setp, int elemsize);
void  qh_setfreelong(setT **set);
int   qh_setin(setT *set, void *setelem);
int   qh_setindex(setT *set, void *setelem);
void  qh_setlarger(setT **setp);
void *qh_setlast(setT *set);
setT *qh_setnew(int size);
setT *qh_setnew_delnthsorted(setT *set, int size, int nth, int prepend);
void  qh_setprint(FILE *fp, char* string, setT *set);
void  qh_setreplace(setT *set, void *oldelem, void *newelem);
int   qh_setsize(setT *set);
setT *qh_settemp(int setsize);
void  qh_settempfree(setT **set);
void  qh_settempfree_all(void);
setT *qh_settemppop(void);
void  qh_settemppush(setT *set);
void  qh_settruncate (setT *set, int size);
int   qh_setunique (setT **set, void *elem);
void  qh_setzero (setT *set, int index, int size);

#endif /* qhDEFset */


stem) async {
  final logoPath = system.logoPath;
  if (Strings.isBlank(logoPath)) {
    return null;
  }
  final file = File(logoPath);
  if (!file.existsSync()) {
    return null;
  }
  final imageData = await file.readAsBytes();
  return pw.Image(
    pw.MemoryImage(imageData),
    width: system.logoAspectRatio.width.toDouble(),
    height: system.logoAspectRatio.height.toDouble(),
  );
}
/*
 Copyright © OnePub IP Pty Ltd. S. Brett Sutton. All Rights Reserved.

 Note: This software is licensed under the GNU General Public License,
         with the following exceptions:
   • Permitted for internal use within your own business or organization only.
   • Any external distribution, resale, or incorporation into products
      for third parties is strictly prohibited.

 See the full license on GitHub:
 https://github.com/bsutton/hmb/blob/main/LICENSE
*/

// lib/src/ui/receipt/receipt_list_screen.dart
import 'package:flutter/material.dart';
import 'package:future_builder_ex/future_builder_ex.dart';

import '../../../dao/dao.g.dart';
import '../../../entity/entity.g.dart';
import '../../../util/flutter/flutter_util.g.dart';
import '../../widgets/layout/layout.g.dart';
import '../../widgets/media/photo_gallery.dart';
import '../../widgets/text/text.g.dart';
import '../base_full_screen/base_full_screen.g.dart';
import 'edit_receipt_screen.dart';

class ReceiptListScreen extends StatefulWidget {
  const ReceiptListScreen({super.key});

  @override
  State<ReceiptListScreen> createState() => _ReceiptListScreenState();
}

class _ReceiptListScreenState extends State<ReceiptListScreen> {
  @override
  Widget build(BuildContext context) => EntityListScreen<Receipt>(
    entityNameSingular: 'Receipt',
    entityNamePlural: 'Receipts',
    dao: DaoReceipt(),
    // ignore: discarded_futures
    fetchList: (_) => DaoReceipt().getByFilter(),
    onEdit: (receipt) => ReceiptEditScreen(receipt: receipt),
    listCardTitle: _getTitle,
    cardHeight: 480,
    listCard: (r) => HMBColumn(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        FutureBuilderEx(
          // ignore: discarded_futures
          future: DaoJob().getById(r.jobId),
          builder: (c, job) => HMBTextBody('Job: ${job?.summary ?? ''}'),
        ),
        FutureBuilderEx(
          // ignore: discarded_futures
          future: DaoSupplier().getById(r.supplierId),
          builder: (c, sup) => HMBTextBody('Supplier: ${sup?.name ?? ''}'),
        ),
        HMBTextBody('Excl. Tax: ${r.totalExcludingTax}'),
        HMBTextBody('Tax: ${r.tax}'),
        HMBTextBody('Incl. Tax: ${r.totalIncludingTax}'),
        PhotoGallery.forReceipt(receipt: r),
      ],
    ),
  );

  Future<Widget> _getTitle(Receipt receipt) async {
    final supplier = await DaoSupplier().getById(receipt.supplierId);

    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        HMBTextHeadline3(
          ' ${formatDate(receipt.receiptDate, format: 'Y M d')}',
        ),
        HMBTextHeadline3(supplier!.name),
      ],
    );
  }
}
/*
 Copyright © OnePub IP Pty Ltd. S. Brett Sutton. All Rights Reserved.

 Note: This software is licensed under the GNU General Public License,
         with the following exceptions:
   • Permitted for internal use within your own business or organization only.
   • Any external distribution, resale, or incorporation into products
      for third parties is strictly prohibited.

 See the full license on GitHub:
 https://github.com/bsutton/hmb/blob/main/LICENSE
*/

// lib/src/ui/receipt/receipt_edit_screen.dart
import 'package:deferred_state/deferred_state.dart';
import 'package:


				// declaration.
				assert(declaration.initializationExpression.isNil)
				val replacementDeclaration = newVariable(
					declaration.token,
					declaration.declaredType,
					declaration.typeExpression,
					popExpression())
				locals[indexInFrame - code.numArgs() - 1] =
					replacementDeclaration
				statements[statements.size - 1] = replacementDeclaration
				return
			}
			// This assignment wasn't the first mention of the variable.
			val valueNode = popExpression()
			val variableUse = newUse(declaration.token, declaration)
			val assignmentNode = newAssignment(variableUse, valueNode, false)
			if (expressionStack.isEmpty()
				|| peekExpression.phraseKind !== MARKER_PHRASE)
			{
				statements.add(assignmentNode)
			}
			else
			{
				// We had better see a dup marker, otherwise the code generator
				// didn't do what we expected.  Remove the marker and replace it
				// with the (embedded) assignment phrase itself.
				val duplicateExpression = popExpression()
				assert(duplicateExpression.equals(DUP.marker))
				expressionStack.add(assignmentNode)
			}
		}

		override fun L1_doGetLocalClearing()
		{
			L1_doGetLocal()
		}

		override fun L1_doPushOuter()
		{
			pushExpression(outers[instructionDecoder.getOperand() - 1])
		}

		override fun L1_doPop()
		{
			if (expressionStack.size == 1)
			{
				statements.add(popExpression())
			}
			else
			{
				// This is very rare – it's a non-first statement of a
				// FirstOfSequence phrase.  Determine if we're constructing or
				// extending an existing FirstOfSequence.
				val lastExpression = popExpression()
				val penultimateExpression = popExpression()
				val newStatements =
					if (penultimateExpression.phraseKind
						=== FIRST_OF_SEQUENCE_PHRASE)
					{
						// Extend an existing FirstOfSequence phrase.
						penultimateExpression.statements.appendCanDestroy(
							lastExpression, false)
					}
					else
					{
						// Create a two-element FirstOfSequence phrase.
						tuple(penultimateExpression, lastExpression)
					}
				pushExpression(newFirstOfSequenceNode(newStatements))
			}
		}

		override fun L1_doGetOuterClearing()
		{
			L1_doGetOuter()
		}

		override fun L1_doSetOuter()
		{
			val outer = outers[instructionDecoder.getOperand() - 1]
			val declaration =
				if (outer.phraseKindIsUnder(LITERAL_PHRASE))
				{
					// Writing into a synthetic literal (a byproduct of
					// decompiling a block without decompiling its outer
					// scopes).
					val token = outer.token
					val variableObject = token.literal()
					newModuleVariable(token, variableObject, nil, nil)
				}
				else
				{
					assert(outer.phraseKindIsUnder(VARIABLE_USE_PHRASE))
					outer.declaration
				}
			val use = newUse(declaration.token, declaration)
			val valueExpr = popExpression()
			val assignmentNode = newAssignment(use, valueExpr, false)
			if (expressionStack.isEmpty())
			{
				statements.add(assignmentNode)
			}
			else
			{
				// We had better see a dup marker, otherwise the code generator
				// didn't do what we expected.  Remove that marker and replace
				// it with the (embedded) assignment phrase itself.
				val duplicateExpression = popExpression()
				assert(duplicateExpression.equals(DUP.marker))
				expressionStack.add(assignmentNode)
			}
		}

		override fun L1_doGetLocal()
		{
			val localDeclaration = argOrLocalOrConstant(
				instructionDecoder.getOperand())
			assert(local