.ts';
import { EnergyLevel } from '../defs/energy-level.model.ts';
import { getDateFromToday } from '../controllers/utils/get-date-from-today.ts';

export const energyLevels: EnergyLevel[] = [
  { value: 100, date: new Date() },
  { value: getRandomEnergyLevel(), date: getDateFromToday(-1) },
  { value: getRandomEnergyLevel(), date: getDateFromToday(-2) },
  { value: getRandomEnergyLevel(), date: getDateFromToday(-3) },
  { value: getRandomEnergyLevel(), date: getDateFromToday(-4) },
  { value: getRandomEnergyLevel(), date: getDateFromToday(-5) },
  { value: getRandomEnergyLevel(), date: getDateFromToday(-6) },
];

export let energyMock: { [userId: string]: EnergyLevel[] } = {
  miriam: energyLevels,
  123: energyLevels,
};
import * as path from 'path';
import { readFileSync } from 'fs';

const input: string[][] =
  readFileSync(path.join(__dirname, '..', 'inputs', 'day5.txt'), { encoding: 'utf-8' })
    .split('\n').map(r => r.split(''));

function coordinate(pass: string[], lowr: string, max: number): number {
  return pass.reduce((acc, n) => {
    // number of seats in the reduced range
    const range = (acc[1] - acc[0]) / 2;
    return (n === lowr) ?
      // calculate upper bound
      [acc[0], acc[0] + Math.floor(range)] :
      // calculate lower bound
      [acc[1] - Math.ceil(range), acc[1]];
  }, [0, max])[1];
}

const highestId = input.reduce((max, pass) => {
  const row = coordinate(pass.slice(0, 7), 'F', 127);
  const col = coordinate(pass.slice(7), 'L', 7);
  const id = row * 8 + col;
  return max < id ? id : max;
}, 0);

console.log(highestId);
import { AddProductUseCase } from '@/domain/usecases/product/AddProductUseCase'
import { Controller } from '@/presentation/protocols/Controller'
import { Validator } from '@/presentation/protocols/Validator'
import { HttpRequest } from '@/presentation/protocols/HttpRequest'
import { HttpResponse } from '@/presentation/protocols/HttpResponse'
import {
  badRequest,
  serverError,
  ok
} from '@/presentation/helpers/http-responses'
import { log } from '@/presentation/helpers/log-helper'

export class AddProductController implements Controller {
  constructor (
    private readonly validator: Validator,
    private readonly addProductUseCase: AddProductUseCase
  ) {}

  async handle (httpRequest: HttpRequest): Promise<HttpResponse> {
    try {
      const body = httpRequest.body
      const error = this.validator.validate({...body.product, purchasePrice: body.purchasePrice})
      if (error) {
        return badRequest(error)
      }
      const product = await this.addProductUseCase.add(httpRequest.body, httpRequest.currentUser!.id)
      return ok(product)
    } catch (error) {
      log(error)
      return serverError()
    }
  }
}
import { Discord as PrismaDiscord } from "@prisma/client";
import get from "../fetch/get";

export default class Discord {
    public static async get(): Promise<PrismaDiscord> {
        const resp = await get("/discord/get");
        return resp.data;
    }

    public static async connect(): Promise<string> {
        return (await get("/discord/connect")).data;
    }

    public static async disconnect(): Promise<{ message: string }> {
        return await get("/discord/disconnect");
    }

    public static async process(


add %l3, %l6, %l3
ld [%l3], %l7
st %l7, [%l3]

P292: !DWST [14] (maybe <- 0x80006c) (Int)
mov %l4, %l6
sllx %l6, 32, %l6
stx %l6, [%i3 + 128 ]
add   %l4, 1, %l4

P293: !DWLD [1] (Int)
ldx [%i0 + 0], %o3
! move %o3(upper) -> %o3(upper)
! move %o3(lower) -> %o3(lower)

P294: !LD [14] (Int)
lduw [%i3 + 128], %o4
! move %o4(lower) -> %o4(upper)
sllx %o4, 32, %o4

P295: !CASX [9] (maybe <- 0x80006d) (Int)
add %i1, 512, %l7
ldx [%l7], %l6
mov %l6, %l3
! move %l3(upper) -> %o4(lower)
srlx %l3, 32, %l6
or %l6, %o4, %o4
!---- flushing int results buffer----
mov %o0, %o5
mov %o1, %o5
mov %o2, %o5
mov %o3, %o5
mov %o4, %o5
! move %l3(lower) -> %o0(upper)
sllx %l3, 32, %o0
sllx %l4, 32, %l6
add  %l4, 1, %l4
casx [%l7], %l3, %l6
! move %l6(upper) -> %o0(lower)
srlx %l6, 32, %l7
or %l7, %o0, %o0
! move %l6(lower) -> %o1(upper)
sllx %l6, 32, %o1

P296: !LD [12] (Int)
lduw [%i3 + 0], %l6
! move %l6(lower) -> %o1(lower)
or %l6, %o1, %o1

P297: !CASX [0] (maybe <- 0x80006e) (Int)
add %i0, 0, %l7
ldx [%l7], %o2
! move %o2(upper) -> %o2(upper)
! move %o2(lower) -> %o2(lower)
mov %o2, %l3
sllx %l4, 32, %o3
add  %l4, 1, %l4
or   %l4, %o3, %o3
add  %l4, 1, %l4
casx [%l7], %l3, %o3
! move %o3(upper) -> %o3(upper)
! move %o3(lower) -> %o3(lower)

P298: !PREFETCH [14] (Int)
prefetch [%i3 + 128], 1

P299: !PREFETCH [6] (Int)
prefetch [%i1 + 80], 1

P300: !CAS [5] (maybe <- 0x800070) (Int)
add %i1, 76, %l7
lduw [%l7], %o4
mov %o4, %l3
! move %l3(lower) -> %o4(upper)
sllx %l3, 32, %o4
mov %l4, %l6
cas [%l7], %l3, %l6
! move %l6(lower) -> %o4(lower)
sllx %l6, 32, %l7
srlx %l7, 32, %l7
or %l7, %o4, %o4
!---- flushing int results bu


\":\"Taxes\",\"url\":\"https://finance.yahoo.com/personal-finance/taxes/\"}]},{\"name\":\"Videos\",\"url\":\"https://finance.yahoo.com/videos/\",\"children\":[{\"name\":\"Latest\",\"url\":\"https://finance.yahoo.com/videos/latest/\"},{\"name\":\"Editor's Picks\",\"url\":\"https://finance.yahoo.com/videos/editor-picks/\"},{\"name\":\"Investing Insights\",\"url\":\"https://finance.yahoo.com/videos/investing-insights/\"},{\"name\":\"Trending Stocks\",\"url\":\"https://finance.yahoo.com/videos/trending-stocks/\"},{\"name\":\"All Shows\",\"url\":\"https://finance.yahoo.com/videos/series/\"},{\"name\":\"Morning Brief\",\"url\":\"https://finance.yahoo.com/videos/series/morning-brief/\"},{\"name\":\"Opening Bid\",\"url\":\"https://finance.yahoo.com/videos/series/opening-bid/\"},{\"name\":\"Wealth\",\"url\":\"https://finance.yahoo.com/videos/series/wealth/\"},{\"name\":\"Invest\",\"url\":\"https://finance.yahoo.com/videos/event/invest/\"},{\"name\":\"ETF Report\",\"url\":\"https://finance.yahoo.com/topic/etf-report/\"},{\"name\":\"YF Awards 2024\",\"url\":\"https://finance.yahoo.com/topic/company-of-the-year/\"}]},{\"name\":\"Streaming Now\",\"url\":\"https://finance.yahoo.com/live/\",\"children\":[]}]}}"}</script>
			<script type="application/json" data-sveltekit-fetched data-url="/xhr/ybar?lang=en-US&region=US" data-hash="1nve1sl" data-ttl="0">{"status":200,"statusText":"OK","headers":{"x-perf":"[{\"label\":\"ybar.service\",\"request\":null,\"response\":null,\"time\":[1737074004829,1737074004838]}]"},"body":"{\"assets\":{\"bottom\":{\"blob\":[{\"type\":\"style\",\"value\":\":root,html[data-color-scheme=dark] [data-maintain-color],html[data-color-theme-enabled] [data-color-scheme=light],html[data-color-theme-enabled][data-color-scheme=light]{--yb-default-font-family:\\\"Helvetica Neue\\\", Helvetica, Tahoma, Geneva, Arial, sans-serif;--yb-fuji2-font-family:\\\"YahooSans VF\\\", YahooSans, \\\"Yahoo Sans\\\", \\\"Helvetica Neue\\\", Helvetica, Arial, sans-serif;--yb-uh3-cond-font-family:\\\"Yahoo Sans Cond\\\", YahooSansCond, \\\"Yahoo Sans\\\", \\\"Helvetica Neue\\\", Helvetica, Arial, sans-serif;--yb-font-regular:400;--yb-font-medium:500;--yb-font-bold:600;--


            Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

DOCS

apis

audio-video

TextTrack

TextTracks

Summary

A media element can have a group of associated text tracks, known as the media element’s "list of text tracks".

Properties

activeCues

Returns the text track cues from the text track list of cues that are currently active (i.e. that start before the current playback position and end after it), as a TextTrackCueList object.

cues

Returns the text track list of cues, as a TextTrackCueList object.

inBandMetadataTrackDispatchType

Returns the text track in-band metadata track dispatch type string.
This is a string extracted from the media resource specifically for in-band metadata tracks, to enable such tracks to be dispatched to different scripts in the document.

kind

Returns the text track kind string.

label

Returns the text track label, if there is one, or the empty string otherwise (indicating that a custom label probably needs to be generated from the other attributes of the object if the object is exposed to the user).

language

Returns the text track language string.

mode

The text track mode, represented by a string from the following list. "disabled": The text track disabled mode. "hidden": The text track hidden mode. "showing": The text track showing mode.

Methods

addCue

Adds t


d>{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}	{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}	{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}

     * @param indices    a pointer to the location where the indices are stored
     * @param primCount  the number of instances of the indexed geometry that should be drawn
     * @param baseVertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays
     *
     * @see Reference Page
     */
    fun drawElementsInstancedBaseVertex(count: Int, type: IndexType, indices: Ptr<*>, primCount: Int, baseVertex: Int) =
        GL32C.nglDrawElementsInstancedBaseVertex(DrawMode.TRIANGLES.i, count, type.i, indices.adr.L, primCount, baseVertex)

//    /** TODO?
//     * Renders multiple instances of a set of primitives from array data with a per-element offset.
//     *
//     * @param mode       the kind of primitives to render. One of:

{@link GL11#GL_POINTS POINTS}	{@link GL11#GL_LINE_STRIP LINE_STRIP}	{@link GL11#GL_LINE_LOOP LINE_LOOP}	{@link GL11#GL_LINES LINES}	{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}	{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}	{@link GL11#GL_TRIANGLES TRIANGLES}

{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}	{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}	{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}	{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}	{@link GL40#GL_PATCHES PATCHES}	{@link GL11#GL_POLYGON POLYGON}	{@link GL11#GL_QUADS QUADS}

{@link GL11#GL_QUAD_STRIP QUAD_STRIP}

//     * @param type       the type of the values in {@code indices}. One of:

{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}	{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}	{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}

//     * @param indices    a pointer to the location where the indices are stored
//     * @param primcount  the number of instances of the indexed geometry that should be drawn
//     * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays
//     *
//     * @see Reference Page
//     */
//    public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) {
//        nglDrawElementsInstancedBaseVertex(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount, basevertex);
//    }
//
//    /**
//     * Renders multiple instances of a set of primitives from


    {
    final[0]='';
    for (j=1;j<29;j++) final[j]=j+64;
    // else for (j=1;j<29;j++) final[j]=(21+name[j-1]+5*j);
    final[29]=0;
    final[30]=comb.ord.fir;
    final[31]=comb.ord.thi;
    final[32]=comb.ord.fou;
    final[33]=comb.ord.sec;
    final[34]=0;
    sprintf(fname,"%s\\playgame.exe",path);
    insertstr(fname,final,PLAYBYTE,34);
    sprintf(fname,"%s\\xferplay.exe",path);
    insertstr(fname,final,XFERBYTE,34);
    }
  return(done);
  }

void insertstr(char *filename,char *str,long bytnum,int bytes)
  {
  FILE *fp;
  register int j;

  if ((fp = fopen(filename,"r+b")) == NULL)
    {
    printf("The File %s cannot be opened!",filename);
    }
  else
    {
    fseek(fp,bytnum,SEEK_SET);
    fwrite(str,bytes,1,fp);
    fclose(fp);
    }
  }

void CopyOver(char *src, char *dest,char disk)
  {
  char temp[81];

  if ((disk=='A')||(disk=='O'))
    {
    printf("------------------------COPYING TO THE A: DISK-------------------\n");
    sprintf(temp,"xcopy %s a:", src);
    system(temp);
    Register("a:");
    }

  if ((disk=='B')||(disk=='O'))
    {
    printf("------------------------COPYING TO THE B: DISK-------------------\n");
    sprintf(temp,"xcopy %s b:", src);
    system(temp);
    Register("b:");
    }
  CurCtr++;
  }

char LoadSerial(char *path)
  {
  char fname[81];
  FILE *fp;

  sprintf(fname,"%sserial.dat",path);

  if ((fp=fopen(fname,"rt"))==NULL) return (0);
  fscanf(fp,"%lu",&CurCtr);
  return(1);
  }

char SaveSerial(char *path)
  {
  char fname[81];
  FILE *fp;

  sprintf(fname,"%sserial.dat",path);

  if ((fp=fopen(fname,"wt"))==NULL) return (0);
  fprintf(fp,"%lu",CurCtr);
  return(1);
  }

int ParseFileName(const char *in,char *name,char *path)
  {
  int LastSlash=0;
  int l=0,pathctr=0,namectr=0;

  name[0]=0;
  path[0]=0;
  while ((in[l]!=0)&&(in[l]!='.'))
    {
    path[pathctr]=in[l];
    name[namectr]=in[l];
    if (in[l]=='\\')
      {
      LastSlash=pathctr;
      namectr=-1;
      }
    if (in[l]=='.') break;
    l++;
    pathctr++;
    namectr++;
    if (l>MAXFILENAMELEN) return(FALSE);
    }
  path[LastSlash+1]=0;
  name[namectr]=0;
  return(TRUE);
  }

char upcase(char c)
  {
  if ((c>='a')&&(c<='z')) return(c-('a'-'A'));
  return(c);
  }
#include "vidsaver.h"

void VideoSaver::Init(VideoMode *vid,uint MaxSave)
  {
  Vid     = vid;

  SetStdRoutines();
  Size    = vid->Size;
  Address =


vb-descriptionListHeadCell--minWidth63 {
  min-width: 63rem;
}
.vb-descriptionListHeadCell--minWidth64 {
  min-width: 64rem;
}
.vb-descriptionListHeadCell--minWidth65 {
  min-width: 65rem;
}
.vb-descriptionListHeadCell--minWidth66 {
  min-width: 66rem;
}
.vb-descriptionListHeadCell--minWidth67 {
  min-width: 67rem;
}
.vb-descriptionListHeadCell--minWidth68 {
  min-width: 68rem;
}
.vb-descriptionListHeadCell--minWidth69 {
  min-width: 69rem;
}
.vb-descriptionListHeadCell--minWidth70 {
  min-width: 70rem;
}
@media (max-width: 48rem) {
  .vb-descriptionListHeadCell--responsive {
    display: block;
    width: auto;
  }
  .vb-descriptionListHeadCell--responsive, .vb-descriptionListHeadCell--responsive:first-child, .vb-descriptionListHeadCell--responsive:last-child {
    padding: 1rem 1rem 0.25rem;
  }
}

.vb-descriptionListCell {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  line-height: 1.5;
}
@media (max-width: 48rem) {
  .vb-descriptionListCell--responsive {
    display: block;
    width: auto;
  }
  .vb-descriptionListCell--responsive, .vb-descriptionListCell--responsive:first-child, .vb-descriptionListCell--responsive:last-child {
    padding: 0.25rem 1rem 1rem;
  }
}

.vb-tableListHeadCell {
  border: none;
  border-spacing: 0;
  border-collapse: collapse;
  box-sizing: border-box;
  padding: 0.25rem 0.5rem;
  font: normal 0.75rem/1.5 "-apple-system", BlinkMacSystemFont, "Helvetica Neue", "ヒラギノ角ゴ ProN", Hiragino Kaku Gothic ProN, Arial, "メイリオ", Meiryo, sans-serif;
  height: 1.875rem;
  text-align: left;
  line-height: 1;
  vertical-align: middle;
  border-bottom: 1px solid #e9e7e7;
  position: relative;
  transition-duration: 0.3s;
  transition-property: background-color;
}
.vb-tableListHeadCell:first-child {
  padding-left: 1.5rem;
}
.vb-tableListHeadCell:last-child {
  padding-right: 1.5rem;
}
.vb-tableListHeadCell--alignCenter {
  text-align: center;
}
.vb-tableListHeadCell--alignRight {
  text-align: right;
}
.vb-tableListHeadCell--clickable:hover {
  background: #f0eded;
}
.vb-tableListHeadCell--fixedRowHeader {
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: #f7f5f5;
}
.vb-tableListHeadCell--width1 {
  width: 1rem;
}
.vb-tableListHeadCell--minWidth1 {
  min-width: 1rem;
}
.vb-tableListHeadCell--maxWidth1 {
  max-width: 1rem;
}
.vb-tableListHeadCell--fixedRowHeaderLeft1 {
  left: 1rem;
}
.vb-tableListHeadCell--width2 {
  width: 2rem;
}
.vb-tableListHeadCell--minWidth2 {
  min-width: 2rem;
}
.vb-tableListHeadCell--maxWidth2 {
  max-width: 2rem;
}
.vb-tableListHeadCell--fixedRowHeaderLeft2 {
  left: 2rem;
}
.vb-tableListHeadCell--width3 {
  width: 3rem;
}
.vb


escription: Validates the Chinese ID card number.
// Documentation: https://sakurajimamaii.github.io/AVE-DOC/documents/tools/core-topics/text/id-regex/

object IDRegex {
    /**
     * Verify the correctness of the Chinese resident ID card number.
     *
     * @param str Chinese resident ID card number string.
     * @return Validation results,"" indicates that the verification is
     *     successful.
     */
    @JvmStatic
    fun validateIDCardNumber(str: String): String {
        var errorInfo: String
        val valCodeArr = arrayOf(
            "1", "0", "x", "9", "8", "7", "6", "5", "4",
            "3", "2"
        )
        val wi = arrayOf(
            "7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7",
            "9", "10", "5", "8", "4", "2"
        )

        if (str.length != 15 && str.length != 18) {
            errorInfo = "身份证号码长度应该为15位或18位。"
            return errorInfo
        }

        var ai: String = if (str.length == 18) {
            str.substring(0, 17)
        } else {
            str.substring(0, 6) + "19" + str.substring(6, 15)
        }

        if (!ai.isNumeric()) {
            errorInfo = "身份证15位号码都应为数字 ; 18位号码除最后一位外，都应为数字。"
            return errorInfo
        }

        val strYear = ai.substring(6, 10) // year
        val strMonth = ai.substring(10, 12) // month
        val strDay = ai.substring(12, 14) // month
        if (!"$strYear-$strMonth-$strDay".isDate()) {
            errorInfo = "身份证生日无效。"
            return errorInfo
        }
        val gc = GregorianCalendar()
        val s = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
        try {
            if (gc[Calendar.YEAR] - strYear.toInt() > 150
                || gc.time.time - s.parse("$strYear-$strMonth-$strDay")!!.time < 0
            ) {
                errorInfo = "身份证生日不在有效范围。"
                return errorInfo
            }
        } catch (e: NumberFormatException) {
            Log.e("IDCardUtils", e.message.toString())
        } catch (e: ParseException) {
            Log.e("IDCardUtils", e.message.toString())
        }
        if (strMonth.toInt() > 12 || strMonth.toInt() == 0) {
            errorInfo = "身份证月份无效。"
            return errorInfo
        }
        if (strDay.toInt() > 31 || strDay.toInt() == 0) {
            errorInfo = "身份证日期无效。"
            return errorInfo
        }

        val h: Hashtable<String, String> = getAreaCode()
        if (h[ai.substring(0, 2)] == null) {
            errorInfo = "身份证地区编码错误。"
            return errorInfo
        }

        var totalmulAiWi = 0
        for (i in 0..16) {
            totalmulAiWi = (totalmulAiWi
                    + ai[i].toString().toInt() * wi[i].toInt())
        }
        val modValue = totalmulAiWi % 11
        val strVerifyCode = valCodeArr[modValue]
        ai += strVerifyCode
        if (str.length == 18) {
            if (ai != str) {
                errorInfo = "身份证无效，不是合法的身份证号码"
                return errorInfo
            }
        } else {
            return ""
        }

        return ""
    }

    /** Get area code */
    private fun getAreaCode(): Hashtable<String, String> {
        val hashtable = Hashtable<String, String>()


'🦐',
      'animal | camarão | comida | crustáceo',
    ),
    Emoji(
      '🦑',
      'animal | comida | lula | molusco',
    ),
    Emoji(
      '🌍',
      'África | Europa | globo mostrando Europa e África | Terra',
    ),
    Emoji(
      '🌎',
      'América | as Américas | globo mostrando as Américas | Terra',
    ),
    Emoji(
      '🌏',
      'Ásia | Austrália | globo mostrando Ásia e Oceania | Oceania | planeta terra | Terra',
    ),
    Emoji(
      '🌐',
      'globo com meridianos | meridianos',
    ),
    Emoji(
      '🌑',
      'escuro | lua | lua negra | noite | nova',
    ),
    Emoji(
      '🌒',
      'côncava | crescente | lua | noite',
    ),
    Emoji(
      '🌓',
      'lua | lua de quarto crescente | quarto | quarto crescente',
    ),
    Emoji(
      '🌔',
      'convexa | crescente | lua',
    ),
    Emoji(
      '🌕',
      'cheia | lua | luar',
    ),
    Emoji(
      '🌖',
      'convexa | lua | minguante',
    ),
    Emoji(
      '🌗',
      'lua | lua de quarto minguante | quarto | quarto minguante',
    ),
    Emoji(
      '🌘',
      'côncava | lua | minguante',
    ),
    Emoji(
      '🌙',
      'crescente | lua',
    ),
    Emoji(
      '🌚',
      'lua | lua nova | lua nova com rosto | rosto | rosto da lua nova',
    ),
    Emoji(
      '🌛',
      'crescente | lua | noite | quarto | rosto',
    ),
    Emoji(
      '🌜',
      'lua | lua com rosto | lua de quarto minguante | quarto minguante | quarto minguante com rosto | rosto | rosto da lua de quarto minguante',
    ),
    Emoji(
      '☀',
      'clima | dia claro | raios | sol | solar | tempo ',
    ),
    Emoji(
      '🌝',
      'cheia | lua | lua cheia com rosto | lua com rosto | rosto | rosto da lua cheia',
    ),
    Emoji(
      '🌞',
      'praia | rosto | sol',
    ),
    Emoji(
      '⭐',
      'estrela | estrela branca média',
    ),
    Emoji(
      '🌟',
      'brilhante | brilho | cintilante | estrela | luminosa | reluzente',
    ),
    Emoji(
      '🌠',
      'cadente | cai | estrela',
    ),
    Emoji(
      '☁',
      'clima | nuvem ',
    ),
    Emoji(
      '⛅',
      'clima | nublado | nuvem | sol | sol com nuvens | sol por trás das nuvens',
    ),
    Emoji(
      '⛈',
      'chuva | clima | nuvem | relâmpago | tempora


"""
Copyright (c) 2024 WindyLab of Westlake University, China
All rights reserved.

This software is provided "as is" without warranty of any kind, either
express or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose, or non-infringement.
In no event shall the authors or copyright holders be liable for any
claim, damages, or other liability, whether in an action of contract,
tort, or otherwise, arising from, out of, or in connection with the
software or the use or other dealings in the software.
"""

import argparse
import datetime
from pathlib import Path

def get_project_root():
    """Search upwards to find the project root directory."""
    current_path = Path.cwd()
    while True:
        if (
                (current_path / ".git").exists()
                or (current_path / ".project_root").exists()
                or (current_path / ".gitignore").exists()
        ):
            # use metagpt with git clone will land here
            return current_path
        parent_path = current_path.parent
        if parent_path == current_path:
            # use metagpt with pip install will land here
            cwd = Path.cwd()
            return cwd
        current_path = parent_path

class _RootManager:
    _instance = None

    def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = super().__new__(cls)
            cls.project_root = None
            cls.workspace_root = None
            cls.data_root = None
            cls._instance.update_root()
        return cls._instance

    def update_root(
            self, workspace_root: str = None, args: argparse.Namespace = None, ablation_path='',
    ) -> None:
        if workspace_root is None or args is not None:
            self.project_root = get_project_root()
            current_datetime = datetime.datetime.now()
            formatted_date = current_datetime.strftime("%Y-%m-%d_%H-%M-%S")
            generate_mode = ""
            task_name = ""
            if args is not None:
                if hasattr(args, "generate_mode"):
                    generate_mode = args.generate_mode
                if hasattr(args, "run_experiment_name"):
                    task_name = "_".join(args.run_experiment_name)
            self.workspace_root = (
                    self.project_root
                    / f"workspace/{generate_mode}/{ablation_path}/{task_name}/{formatted_date}"
            )
        else:
            self.workspace_root = Path(workspace_root)
        self.data_root = self.workspace_root / "data"

root_manager = _RootManager()


State       = false;
    }
    return state;
}

void Event::updateState(bool newState, bool newTemp, bool mustNotify)
{
    Mutex::Locker lock(&StateMutex);
    State       = newState;
    Temporary   = newTemp;
    if (mustNotify)
        StateWaitCondition.NotifyAll();
}

//-----------------------------------------------------------------------------------
// ***** Win32 Wait Condition Implementation

// Internal implementation class
class WaitConditionImpl : public NewOverrideBase
{
    // Event pool entries for extra events
    struct EventPoolEntry  : public NewOverrideBase
    {
        HANDLE          hEvent;
        EventPoolEntry  *pNext;
        EventPoolEntry  *pPrev;
    };

    Lock                WaitQueueLoc;
    // Stores free events that can be used later
    EventPoolEntry  *   pFreeEventList;

    // A queue of waiting objects to be signaled
    EventPoolEntry*     pQueueHead;
    EventPoolEntry*     pQueueTail;

    // Allocation functions for free events
    EventPoolEntry*     GetNewEvent();
    void                ReleaseEvent(EventPoolEntry* pevent);

    // Queue operations
    void                QueuePush(EventPoolEntry* pentry);
    EventPoolEntry*     QueuePop();
    void                QueueFindAndRemove(EventPoolEntry* pentry);

public:

    // Constructor/destructor
    WaitConditionImpl();
    ~WaitConditionImpl();

    // Release mutex and wait for condition. The mutex is re-acqured after the wait.
    bool    Wait(Mutex *pmutex, unsigned delay = OVR_WAIT_INFINITE);

    // Notify a condition, releasing at one object waiting
    void    Notify();
    // Notify a condition, releasing all objects waiting
    void    NotifyAll();
};

WaitConditionImpl::WaitConditionImpl()
{
    pFreeEventList  = 0;
    pQueueHead      =
    pQueueTail      = 0;
}

WaitConditionImpl::~WaitConditionImpl()
{
    // Free all the resources
    EventPoolEntry* p       = pFreeEventList;
    EventPoolEntry* pentry;

    while(p)
    {
        // Move to next
        pentry = p;
        p = p->pNext;
        // Delete old
        ::CloseHandle(pentry->hEvent);
        delete pentry;
    }
    // Shouldn't we also consider the queue?

    // To be safe
    pFreeEventList  = 0;
    pQueueHead      =
    pQueueTail      = 0;
}

// Allocation functions for free events
WaitConditionImpl::EventPoolEntry* WaitConditionImpl::GetNewEvent()
{
    EventPoolEntry* pentry;

    // If there are any free nodes, use them
    if (pFreeEventList)
    {
        pentry          = pFreeEventList;
        pFreeEventList  = pFreeEventList->pNext;
    }
    else
    {
        // Allocate a new node
        pentry          = new EventPoolEntry;
        pentry->pNext   = 0;
        pentry->pPrev   = 0;
        // Non-signaled manual event
        pentry->hEvent  = ::CreateEvent(NULL, TRUE, 0, NULL);
    }

    return pentry;
}

void WaitConditionImpl::ReleaseEvent(EventPoolEntry* pevent)
{
    // Mark event as non-signaled
    ::ResetEvent(pevent->hEvent);
    // And add it to free pool
    pevent->pNext   = pFreeEventList;
    pevent->pPrev   = 0;
    pFreeEventList  = pevent;
}

// Queue operations
void WaitConditionImpl::QueuePush(EventPoolEntry* pentry)
{
    // Items already exist? Just add to tail
    if (pQueueTail)
    {
        pentry->pPrev       = pQueueTail;
        pQueueTail->pNext   = pentry;
        pentry->pNext       = 0;
        pQueueTail


velopment to production:

🔨   No entry points or pages to configure - just HTML files with `<script type=module>`

🦦   Safely `import "packages"` from npm **_without installation_**

📦   Smart bundling and caching for npm dependencies

↻   Hot reloading for modules, Preact components and CSS

⚡   Lightning-fast JSX support that you can debug in the browser

💄   Import CSS files and [CSS Modules](https://github.com/css-modules/css-modules) (`*.module.css`)

🔩   Out-of-the-box support for [TypeScript](https://www.typescriptlang.org/)

📂   Static file serving with hot reloading of CSS and images

🗜   Highly optimized Rollup-based production output (`wmr build`)

📑   Crawls and pre-renders your app's pages to static HTML at build time

🏎   Built-in HTTP2 in dev and prod (`wmr serve --http2`)

🔧   Supports [Rollup plugins](packages/wmr/README.md#configuration-and-plugins), even in development where Rollup isn't used

## Quickstart _(recommended)_

Create a new project in seconds using [create-wmr](https://npm.im/create-wmr):

npm init wmr your-project-name

or

yarn create wmr your-project-name

> 💁 If you'd like ESLint to be set up for you, add `--eslint` to the command. _Note: this will use 150mb of disk space._

[Check out the docs to learn more](https://wmr.dev/docs)

## Packages

| Package                                              | Description                                              | Version                                                                                |
| ---------------------------------------------------- | :------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- |
| [wmr](packages/wmr)                                  | Tiny all-in-one development tool for modern web apps     | [![wmr npm](https://img.shields.io/npm/v/wmr.svg)](https://npm.im/wmr)                                                             |
| [create-wmr](packages/create-wmr)                    | Create a new WMR project in seconds                      | [![create-wmr npm](https://img.shields.io/npm/v/create-wmr.svg)](https://npm.im/create-wmr)                                        |
| [@wmrjs/directory-import](packages/directory-plugin) | Import a directory's files as an Array                   | [![@wmrjs/directory-import npm](https://img.shields.io/npm/v/@wmrjs/directory-import.svg)](https://npm.im/@wmrjs/directory-import) |
| [@wmrjs/nomodule](packages/nomodule-plugin)          | Generate legacy fallback bundles for older browsers      | [![@wmrjs/nomodule npm](https://img.shields.io/npm/v/@wmrjs/nomodule.svg)](https://npm.im/@wmrjs/nomodule)                         |
| [@wmrjs/service-worker](packages/sw-plugin)          | Bundle service workers                                   | [![@wmrjs/service-worker npm](https://img.shields.io/npm/v/@wmrjs/service-worker.svg)](https://npm.im/@wmrjs/


5, 0)
	LOAD_W_VEC_1(6, 0)
	LOAD_W_VEC_1(7, 0)
	LOAD_W_VEC_1(8, 0)
	LOAD_W_VEC_2(1, 0)
	LOAD_W_VEC_2(2, 0)
	LOAD_W_VEC_2(3, 0)
	LOAD_W_VEC_2(4, 0)
	LOAD_W_VEC_2(5, 0)
	LOAD_W_VEC_2(6, 0)
	LOAD_W_VEC_2(7, 0)
	LOAD_W_VEC_2(8, 0)
	LOAD_W_VEC_3(1, 0)
	LOAD_W_VEC_3(2, 0)
	LOAD_W_VEC_3(3, 0)
	LOAD_W_VEC_3(4, 0)
	LOAD_W_VEC_3(5, 0)
	LOAD_W_VEC_3(6, 0)
	LOAD_W_VEC_3(7, 0)
	LOAD_W_VEC_3(8, 0)

.balign 16
.Loop:
	/* Transform 0-3 */
	R1(ra, rb, rc, rd, re, rf, rg, rh, k_even, KL, 0, 0, IW, _, 0)
	R1(rd, ra, rb, rc, rh, re, rf, rg, k_odd,  _,  1, 1, IW, _, 0)
	R1(rc, rd, ra, rb, rg, rh, re, rf, k_even, KL, 2, 2, IW, _, 0)
	R1(rb, rc, rd, ra, rf, rg, rh, re, k_odd,  _,  3, 3, IW, _, 0)

	/* Transform 4-7 + Precalc 12-14 */
	R1(ra, rb, rc, rd, re, rf, rg, rh, k_even, KL, 4, 0, IW, _, 0)
	R1(rd, ra, rb, rc, rh, re, rf, rg, k_odd,  _,  5, 1, IW, _, 0)
	R1(rc, rd, ra, rb, rg, rh, re, rf, k_even, KL, 6, 2, IW, SCHED_W_W0W1W2W3W4W5_1, 12)
	R1(rb, rc, rd, ra, rf, rg, rh, re, k_odd,  _,  7, 3, IW, SCHED_W_W0W1W2W3W4W5_2, 12)

	/* Transform 8-11 + Precalc 12-17 */
	R1(ra, rb, rc, rd, re, rf, rg, rh, k_even, KL, 8, 0, IW, SCHED_W_W0W1W2W3W4W5_3, 12)
	R1(rd, ra, rb, rc, rh, re, rf, rg, k_odd,  _,  9, 1, IW, SCHED_W_W1W2W3W4W5W0_1, 15)
	R1(rc, rd, ra, rb, rg, rh, re, rf, k_even, KL, 10, 2, IW, SCHED_W_W1W2W3W4W5W0_2, 15)
	R1(rb, rc, rd, ra, rf, rg, rh, re, k_odd,  _,  11, 3, IW, SCHED_W_W1W2W3W4W5W0_3, 15)

	/* Transform 12-14 + Precalc 18-20 */
	R1(ra, rb, rc, rd, re, rf, rg, rh, k_even, KL, 12, 0, XW, SCHED_W_W2W3W4W5W0W1_1, 18)
	R1(rd, ra, rb, rc, rh, re, rf, rg, k_odd,  _,  13, 1, XW, SCHED_W_W2W3W4W5W0W1_


ill())
            cmpInstr->getOperand(0).setIsKill(false);
          if (cmpInstr->getOperand(1).isReg() &&
              cmpInstr->getOperand(1).isKill())
            cmpInstr->getOperand(1).setIsKill(false);
          cmpInstr->eraseFromParent();
          jmpInstr->eraseFromParent();
          ++nvjGenerated;
          ++NumNVJGenerated;
          break;
        }
      }
    }
  }

  return true;

}

FunctionPass *llvm::createHexagonNewValueJump() {
  return new HexagonNewValueJump();
}
//===-- AArch64MCExpr.cpp - AArch64 specific MC expression classes --------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the implementation of the assembly expression modifiers
// accepted by the AArch64 architecture (e.g. ":lo12:", ":gottprel_g1:", ...).
//
//===----------------------------------------------------------------------===//

#define DEBUG_TYPE "aarch64mcexpr"
#include "AArch64MCExpr.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCELF.h"
#include "llvm/Object/ELF.h"

using namespace llvm;

const AArch64MCExpr*
AArch64MCExpr::Create(VariantKind Kind, const MCExpr *Expr,
                      MCContext &Ctx) {
  return new (Ctx) AArch64MCExpr(Kind, Expr);
}

void AArch64MCExpr::PrintImpl(raw_ostream &OS) const {
  switch (Kind) {
  default: llvm_unreachable("Invalid kind!");
  case VK_AARCH64_GOT:              OS << ":got:"; break;
  case VK_AARCH64_GOT_LO12:         OS << ":got_lo12:"; break;
  case VK_AARCH64_LO12:             OS << ":lo12:"; break;
  case VK_AARCH64_ABS_G0:           OS << ":abs_g0:"; break;
  case VK_AARCH64_ABS_G0_NC:        OS << ":abs_g0_nc:"; break;
  case VK_AARCH64_ABS_G1:           OS << ":abs_g1:"; break;
  case VK_AARCH64_ABS_G1_NC:        OS << ":abs_g1_nc:"; break;
  case VK_AARCH64_ABS_G2:           OS << ":abs_g2:"; break;
  case VK_AARCH64_ABS_G2_NC:        OS << ":abs_g2_nc:"; break;
  case VK_AARCH64_ABS_G3:           OS << ":abs_g3:"; break;
  case VK_AARCH64_SABS_G0:          OS << ":abs_g0_s:"; break;
  case VK_AARCH64_SABS_G1:          OS << ":abs_g1_s:"; break;
  case VK_AARCH64_SABS_G2:          OS << ":abs_g2_s:"; break;
  case VK_AARCH64_DTPREL_G2:        OS << ":dtprel_g2:"; break;
  case VK_AARCH64_DTPREL_G1:        OS << ":dtprel_g1:"; break;
  case VK_AARCH64_DTPREL_G1_NC:     OS << ":dtprel_g1_nc:"; break;
  case VK_AARCH64_DTPREL_G0:        OS << ":dtprel_g0:"; break;
  case VK_AARCH64_DTPREL_G0_NC:     OS << ":dtprel_g0_nc:"; break;
  case VK_AARCH64_DTPREL_HI12:      OS << ":dtprel_hi12:"; break;
  case VK_AARCH64_DTPREL_LO12:      OS << ":dtprel_lo12:"; break;
  case VK_AARCH64_DTPREL_LO12_NC:   OS << ":dtprel_lo12_nc:"; break;
  case VK_AARCH64_GOTTPREL_G1:      OS << ":gottprel_g1:"; break;
  case VK_AARCH64_GOTTPREL_G0_NC:   OS << ":gottprel_g0_nc:"; break;
  case VK_AARCH64_GOTTPREL:         OS << ":gottprel:"; break;


 [Vector2.new]
  LOADN R3 0
  LOADN R4 0
  CALL R2 2 1
  SETTABLE R2 R0 R1
  GETUPVAL R2 1
  GETTABLEKS R1 R2 K9 ["S"]
  GETIMPORT R2 K6 [Vector2.new]
  LOADK R3 K7 [0.5]
  LOADN R4 0
  CALL R2 2 1
  SETTABLE R2 R0 R1
  GETUPVAL R2 1
  GETTABLEKS R1 R2 K10 ["SW"]
  GETIMPORT R2 K6 [Vector2.new]
  LOADN R3 1
  LOADN R4 0
  CALL R2 2 1
  SETTABLE R2 R0 R1
  GETUPVAL R2 1
  GETTABLEKS R1 R2 K11 ["W"]
  GETIMPORT R2 K6 [Vector2.new]
  LOADN R3 1
  LOADK R4 K7 [0.5]
  CALL R2 2 1
  SETTABLE R2 R0 R1
  GETUPVAL R2 1
  GETTABLEKS R1 R2 K12 ["NW"]
  GETIMPORT R2 K6 [Vector2.new]
  LOADN R3 1
  LOADN R4 1
  CALL R2 2 1
  SETTABLE R2 R0 R1
  GETUPVAL R2 1
  GETTABLEKS R1 R2 K13 ["N"]
  GETIMPORT R2 K6 [Vector2.new]
  LOADK R3 K7 [0.5]
  LOADN R4 1
  CALL R2 2 1
  SETTABLE R2 R0 R1
  GETUPVAL R2 1
  GETTABLEKS R1 R2 K14 ["NE"]
  GETIMPORT R2 K6 [Vector2.new]
  LOADN R3 0
  LOADN R4 1
  CALL R2 2 1
  SETTABLE R2 R0 R1
  NEWTABLE R1 8 0
  GETUPVAL R3 1
  GETTABLEKS R2 R3 K3 ["E"]
  GETIMPORT R3 K16 [UDim2.new]
  LOADN R4 1
  LOADN R5 0
  LOADK R6 K7 [0.5]
  LOADN R7 0
  CALL R3 4 1
  SETTABLE R3 R1 R2
  GETUPVAL R3 1
  GETTABLEKS R2 R3 K8 ["SE"]
  GETIMPORT R3 K16 [UDim2.new]
  LOADN R4 1
  LOADN R5 0
  LOADN R6 1
  LOADN R7 0
  CALL R3 4 1
  SETTABLE R3 R1 R2
  GETUPVAL R3 1
  GETTABLEKS R2 R3 K9 ["S"]
  GETIMPORT R3 K16 [UDim2.new]
  LOADK R4 K7 [0.5]
  LOADN R5 0
  LOADN R6 1
  LOADN R7 0
  CALL R3 4 1
  SETTABLE R3 R1 R2
  GETUPVAL R3 1
  GETTABLEKS R2 R3 K10 ["SW"]
  GETIMPORT R3 K16 [UDim2.new]
  LOADN R4 0
  LOADN R5 0
  LOADN R6 1
  LOADN R7 0
  CALL R3 4 1
  SETTABLE R3 R1 R2
  GETUPVAL R3 1
  GETTABLEKS R2 R3 K11 ["W"]
  GETIMPORT R3 K16 [UDim2.new]
  LOADN R4 0
  LOADN R5 0
  LOADK R6 K7 [0.5]
  LOADN R7 0
  CALL R3 4 1
  SETTABLE R3 R1 R2
  GETUPVAL R3 1
  GETTABLEKS R2 R3 K12 ["NW"]
  GETIMPORT R3 K16 [UDim2.new]
  LOADN R4 0
  LOADN R5 0
  LOADN R6 0
  LOADN R7 0
  CALL R3 4 1
  SETTABLE R3 R1 R2
  GETUPVAL R3 1
  GETTABLEKS R2 R3 K13 ["N"]
  GETIMPORT R3 K16 [UDim


def main():
    book_path = "books/frankenstein.txt"
    book_text = get_book_text(book_path)
    # print(text)
    word_count = count_words(book_text)
    # print("Word count:", word_count)

    counts = count_alpha_chars(book_text)
    """
    print("Character counts:")
    for char, count in counts.items():
        # Use repr(char) to clearly show spaces and special characters.
        print(f"{repr(char)}: {count}")
    """
# Print the report
    print("Report:")
    print("Total words:", word_count)
    print("Alphabet character counts:")

    # Sort keys alphabetically for a neat report
    for char in sorted(counts.keys()):
        print(f"The '{char}'character was found {counts[char]} times")

def get_book_text(path):
    with open(path) as f:
        return f.read()

def count_words(text):

    #Counts the number of words in the given text.
    # Split the text by whitespace and count the resulting parts.
    words = text.split()
    return len(words)

def count_alpha_chars(book_text):

    #Counts the frequency of each character in the given text.
    # Initialize an empty dictionary to store character counts.
    char_count = {}

    # Convert the entire text to lowercase and iterate through each character.
    for char in book_text.lower():

        if char.isalpha():  # Only count alphabet characters
            char_count[char] = char_count.get(char, 0) + 1

    return char_count

main()


(),
        false,
    );
    assert_eq!(
        kernel_space
            .page_table
            .translate(mid_data.floor())
            .unwrap()
            .executable(),
        false,
    );
    println!("remap_test passed!");
}
<gh_stars>1-10

#[no_mangle] // prevent rust from making ur function some weird name like [[name here]]
fn init() {
    println!("Hello from another lib o/");
}// Copyright 2022 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

use std::str;

use crate::netlink::*;
use thiserror::Error;

use data_model::DataInit;

const ACPI_EVENT_SIZE: usize = std::mem::size_of::<AcpiGenlEvent>();
const GENL_HDRLEN: usize = std::mem::size_of::<GenlMsgHdr>();
const NLA_HDRLEN: usize = std::mem::size_of::<NlAttr>();

#[derive(Error, Debug)]
pub enum AcpiEventError {
    #[error("GenmsghdrCmd or NlAttrType inappropriate for acpi event")]
    TypeAttrMissmatch,
    #[error("Something goes wrong: msg_len {0} is not correct")]
    InvalidMsgLen(usize),
}
type Result<T> = std::result::Result<T, AcpiEventError>;

/// attributes of AcpiGenlFamily
#[allow(dead_code)]
enum NlAttrType {
    AcpiGenlAttrUnspec,
    AcpiGenlAttrEvent, // acpi_event (needed by user space)
    AcpiGenlAttrMax,
}

/// commands supported by the AcpiGenlFamily
#[allow(dead_code)]
enum GenmsghdrCmd {
    AcpiGenlCmdUnspec,
    AcpiGenlCmdEvent, // kernel->user notifications for acpi_events
    AcpiGenlCmdMax,
}

#[repr(C)]
#[derive(Copy, Clone)]
struct AcpiGenlEvent {
    device_class: [::std::os::raw::c_char; 20usize],
    bus_id: [::std::os::raw::c_char; 15usize],
    _type: u32,
    data: u32,
}
unsafe impl DataInit for AcpiGenlEvent {}

pub struct AcpiNotifyEvent {
    pub device_class: String,
    pub bus_id: String,
    pub _type: u32,
    pub data: u32,
}

impl AcpiNotifyEvent {
    /// Create acpi event by decapsulating it from NetlinkMessage.
    pub fn new(netlink_message: NetlinkMessage) -> Result<Self> {
        let msg_len = netlink_message.data.len();
        if msg_len != GENL_HDRLEN + NLA_HDRLEN + ACPI_EVENT_SIZE {
            return Err(AcpiEventError::InvalidMsgLen(msg_len));
        }

        let genl_hdr = GenlMsgHdr::from_slice(&netlink_message.data[..GENL_HDRLEN])
            .expect("unable to get GenlMsgHdr from slice");

        let nlattr_end = GENL_HDRLEN + NLA_HDRLEN;
        let nl_attr = NlAttr::from_slice(&netlink_message.data[GENL_HDRLEN..nlattr_end])
            .expect("unable to get NlAttr from slice");

        // Sanity check that the headers have correct for acpi event `cmd` and `_type`
        if genl_hdr.cmd != GenmsghdrCmd::AcpiGenlCmdEvent as u8
            || nl_attr._type != NlAttrType::AcpiGenlAttrEvent as u16
        {


-time" lang="zh">

偽りの楽園を抜け出しもう一度生まれ変わるその時 全ては光の中

Shoot It Out 散りゆく花こそ輝く祈りの歌声

Shoot It Out 沈める闇こそいざ往け

明日のために叫ぶよ

人の世に生きる者は誰もが風の前の塵と同じく

吹き流されるまま流離う旅人…浮かんで消える春の日の夢

<tr class="tt-main-ja" id="=-21" data-pos="&#91


.run { if (isEmpty()) emptyList() else fold(mutableListOf(first())) { list, stack -> list.apply { if (!ItemStack.isSameItemSameTags(list.last(), stack)) add(stack) }}}

    fun getTooltipChancesForOutputAt(index: Int): Collection<Component> {
        val collapsedResults = getResultsChanceCollapsed()
        if (!collapsedResults.indices.contains(index)) return emptyList()
        val stack = collapsedResults[index]
        val matching = results.filter { ItemStack.isSameItemSameTags(it.stack, stack) }
        if (matching.all { it.chance == 1F }) return emptyList()
        return matching.map { TextComponent("${it.stack.count}x ${it.chance * 100}%") }
    }

    data class ConstructingResult(val stack: ItemStack, val chance: Float = 1F) {
        fun toNetwork(buffer: FriendlyByteBuf) {
            buffer.writeItem(stack)
            buffer.writeFloat(chance)
        }

        companion object {
            fun fromJson(json: JsonObject) = ConstructingResult(ShapedRecipe.itemStackFromJson(
                GsonHelper.getAsJsonObject(json, "item")),
                if (json.has("chance")) GsonHelper.getAsFloat(json, "chance") else 1F
            )

            fun fromNetwork(buffer: FriendlyByteBuf) = ConstructingResult(buffer.readItem(), buffer.readFloat())
        }
    }

    enum class OverlayType { NONE, CONSTRUCTING, RECYCLING, SMITHING }

    override fun matches(container: Container, level: Level) = container.containerSize > ingredientsList.size && ingredientsList.containerSatisfiesRequirements(container)
    override fun assemble(container: Container): ItemStack = resultItem.copy()
    override fun getId() = recipeID
    override fun getSerializer(): Serializer = RecipeSerializers.CONSTRUCTING.get()
    override fun getType() = RecipeTypes.CONSTRUCTING
    override fun isSpecial() = true
    override fun canCraftInDimensions(p_43999_: Int, p_44000_: Int) = true
    override fun getToastSymbol() = ItemStack(AnvilBlock.getAnvilByTier(tierLower))
    @Suppress("UNCHECKED_CAST")
    override fun getIngredients(): NonNullList<Ingredient> = ingredientsList as NonNullList<Ingredient>
    override fun getResultItem(): ItemStack = results.first().stack

    class Serializer : ForgeRegistryEntry<RecipeSerializer<*>>(), RecipeSerializer<AnvilConstructingRecipe> {
        override fun fromJson(id: ResourceLocation, json: JsonObject): AnvilConstructingRecipe {
            val ingredients = GsonHelper.getAsJsonArray(json, "ingredients").map(Ingredient::fromJson).map { it as? StackedIngredient ?: throw JsonParseException("Couldn't parse ingredient as StackedIngredient") }
            val ingredientsStupidMojangList = NonNullList.createWithCapacity<StackedIngredient>(ingredients.size)
            for (ingredient in ingredients) ingredientsStupidMojangList.add(ingredient)
            val results = GsonHelper.getAsJsonArray(json, "results").map { ConstructingResult.fromJson(it.asJsonObject) }
            val tierLower = GsonHelper.getAsInt(json, "tierLower")
            val tierUpper = GsonHelper.getAsInt(json, "tierUpper")
            return if (json.has("overlay")) {
                val overlay = try {
                    OverlayType.valueOf(GsonHelper.getAsString(json, "overlay").uppercase())
                } catch (e: IllegalArgumentException) {
                    throw JsonSyntaxException("Unexpected value for overlay type", e)
                }
                AnvilConstructingRecipe(id, ingredientsStupidMojangList, results, tierLower, tierUpper, ov


 rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Software, and to
** permit persons to whom the Software is furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be
** included in all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**
****************************************************************************/

#include "qextserialport.h"
#include "qextserialport_p.h"
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <QtCore/QMutexLocker>
#include <QtCore/QDebug>
#include <QtCore/QSocketNotifier>

void QextSerialPortPrivate::platformSpecificInit()
{
    fd = 0;
    readNotifier = 0;
}

/*!
    Standard destructor.
*/
void QextSerialPortPrivate::platformSpecificDestruct()
{
}

static QString fullPortName(const QString &name)
{
    if (name.startsWith(QLatin1Char('/')))
        return name;
    return QLatin1String("/dev/")+name;
}

bool QextSerialPortPrivate::open_sys(QIODevice::OpenMode mode)
{
    Q_Q(QextSerialPort);
    //note: linux 2.6.21 seems to ignore O_NDELAY flag
    if ((fd = ::open(fullPortName(port).toLatin1() ,O_RDWR | O_NOCTTY | O_NDELAY)) != -1) {

        /*In the Private class, We can not call QIODevice::open()*/
        q->setOpenMode(mode);             // Flag the port as opened
        ::tcgetattr(fd, &oldTermios);    // Save the old termios
        currentTermios = oldTermios;   // Make a working copy
        ::cfmakeraw(&currentTermios);   // Enable raw access

        /*set up other port settings*/
        currentTermios.c_cflag |= CREAD|CLOCAL;
        currentTermios.c_lflag &= (~(ICANON|ECHO|ECHOE|ECHOK|ECHONL|ISIG));
        currentTermios.c_iflag &= (~(INPCK|IGNPAR|PARMRK|ISTRIP|ICRNL|IXANY));
        currentTermios.c_oflag &= (~OPOST);
        currentTermios.c_cc[VMIN] = 0;
#ifdef _POSIX_VDISABLE  // Is a disable character available on this system?
        // Some systems allow for per-device disable-characters, so get the
        //  proper value for the configured device
        const long vdisable = ::fpathconf(fd, _PC_VDISABLE);
        currentTermios.c_cc[VINTR] = vdisable;
        currentTermios.c_cc[VQUIT] = vdisable;
        currentTermios.c_cc[VSTART] = vdisable;
        currentTermios.c_cc[VSTOP] = vdisable;
        currentTermios.c_cc[VSUSP] = vdisable;
#endif //_POSIX_VDISABLE
        settingsDirtyFlags = DFE_ALL;
        updatePortSettings();

        if (queryM


確定通知:** Session Orchestrator が確定プロファイルとセッションIDを通知。
6. **テレメトリ登録:** Telemetry & Insights がセッション初期メトリクスを生成。

```
Client        Orchestrator     Crypto       Policy       Telemetry
  |                |             |             |             |
  |---Beacon------>|             |             |             |
  |---Connect Req--------------->|             |             |
  |                |---Key Req-->|             |             |
  |                |<--Key Ack---|             |             |
  |                |---Profile Req----------->|             |
  |                |<--Profile Resp-----------|             |
  |<--Session Ack--|             |             |---Init----->|
```

## シーケンス: マルチストリーム制御
1. Stream QoS Scheduler がメインストリームを優先度順にキューイング。
2. Transport Abstraction がストリームごとに FEC 係数とバッチサイズを決定。
3. ネットワーク状態 (RTT/ロス率) を Telemetry & Insights から Pull。
4. ポリシー変更が必要な場合、Policy Engine へイベント通知。
5. Session Orchestrator が更新情報を各クライアントに配信。

## シーケンス: IoT省電力モード
1. IoTデバイスが「省電力ハートビート」を 10 分間隔で送信。
2. Policy Engine が電力予算を再評価し、送信頻度・バッチ転送時間帯を調整。
3. Telemetry & Insights が省電力効果を指標化し、SLI (平均電流) を更新。
4. 必要に応じて[docs/performance/scalability.md](../performance/scalability.md)で定義されたバッチモードへ切替。

## データ整合性と冪等性
- **セッション管理:** セッションIDは UUIDv7 等の時間順序を持つ形式。再送時には idempotency-key を付与し、重複処理を防止。
- **ストリーム制御:** QoS 更新はバージョン番号付き差分イベント。最新バージョンのみ適用。
- **テレメトリ:** 時系列データは append-only。集約処理は idempotent aggregator により実行。

## トランザクションとリトライ戦略
| 操作 | トランザクション境界 | リトライ戦略 | バックプレッシャ |
|------|----------------------|--------------|------------------|
| ハンドシェイク | Session Orchestrator + Crypto | 指数バックオフ (最大 3 回) | 再試行間隔中は Beacon 監視継続 |
| プロファイル更新 | Policy Engine | 逐次再評価、最大 2 回 | QoS Scheduler が旧設定を維持 |
| Telemetry Export


 newEvent(Create, "/foo", uint64(i), uint64(i))
		eh.addEvent(e)
		e, err := eh.scan("/foo", true, uint64(i-1))
		if i > 0 {
			if e == nil || err != nil {
				t.Fatalf("scan error [/foo] [%v] %v", i-1, i)
			}
		}
	}
}
package store

import (
	"fmt"
	"time"

	"github.com/coreos/etcd/third_party/github.com/goraft/raft"
)

// A lookup of factories by version.
var factories = make(map[int]CommandFactory)
var minVersion, maxVersion int

// The CommandFactory provides a way to create different types of commands
// depending on the current version of the store.
type CommandFactory interface {
	Version() int
	CreateUpgradeCommand() raft.Command
	CreateSetCommand(key string, dir bool, value string, expireTime time.Time) raft.Command
	CreateCreateCommand(key string, dir bool, value string, expireTime time.Time, unique bool) raft.Command
	CreateUpdateCommand(key string, value string, expireTime time.Time) raft.Command
	CreateDeleteCommand(key string, dir, recursive bool) raft.Command
	CreateCompareAndSwapCommand(key string, value string, prevValue string,
		prevIndex uint64, expireTime time.Time) raft.Command
	CreateCompareAndDeleteCommand(key string, prevValue string, prevIndex uint64) raft.Command
	CreateSyncCommand(now time.Time) raft.Command
	CreateGetCommand(key string, recursive, sorted bool) raft.Command
}

// RegisterCommandFactory adds a command factory to the global registry.
func RegisterCommandFactory(factory CommandFactory) {
	version := factory.Version()

	if GetCommandFactory(version) != nil {
		panic(fmt.Sprintf("Command factory already registered for version: %d", factory.Version()))
	}

	factories[version] = factory

	// Update compatibility versions.
	if minVersion == 0 || version > minVersion {
		minVersion = version
	}
	if maxVersion == 0 || version > maxVersion {
		maxVersion = version
	}
}

// GetCommandFactory retrieves a command factory for a given command version.
func GetCommandFactory(version int) CommandFactory {
	return factories[version]
}

// MinVersion returns the minimum compatible store version.
func MinVersion() int {
	return minVersion
}

// MaxVersion returns the maximum compatible store version.
func MaxVersion() int {
	return maxVersion
}
package store

import (
	"container/heap"
)

// An TTLKeyHeap is a min-heap of TTLKeys order by expiration time
type ttlKeyHeap struct {
	array  []*node
	keyMap map[*node]int
}

func newTtlKeyHeap() *ttlKeyHeap {
	h := &ttlKeyHeap{keyMap: make(map[*node]int)}
	heap.Init(h)
	return h
}

func (h ttlKeyHeap) Len() int {
	return len(h.array)
}

func (h ttlKeyHeap) Less(i, j int) bool {
	return h.array[i].ExpireTime.Before(h.array[j].ExpireTime)
}

func (h ttlKeyHeap) Swap(i, j int) {
	// swap node
	h.array[i], h.array[j] = h.array[j], h.array[i]

	// update map
	h.keyMap[h.array[i]] = i
	h.keyMap[h.array[j]] = j
}

func (h *t


rl) .. " | xclip -selection clipboard")
  elseif vim.fn.has("win32") == 1 then
    vim.fn.system("echo " .. vim.fn.shellescape(url) .. " | clip")
  else
    print("Unsupported OS")
  end
end

function M.open(firstLine, lastLine, path, action, mode)
  local url = generate.url(firstLine, lastLine, path, action, mode)

  if url == "" then
    return
  end

  open_remote(url)
end

function M.copy(firstLine, lastLine, path, action, mode)
  local url = generate.url(firstLine, lastLine, path, action, mode)

  url_clipboard(url)
  print("success to copy the URL to clipboard")
end

return M


032, -7340032},
		{8388608, 8388608},
		{-8388608, -8388608},
		{2147483647, 2147483647},
		{-2147483647, -2147483647},
		{-2147483648, -2147483648},

		// Values outside of the valid int32 range are limited to int32.
		{2147483648, 2147483647},
		{-2147483649, -2147483648},
		{1152921504606846975, 2147483647},
		{-1152921504606846975, -2147483648},
		{2305843009213693951, 2147483647},
		{-2305843009213693951, -2147483648},
		{4611686018427387903, 2147483647},
		{-4611686018427387903, -2147483648},
		{9223372036854775807, 2147483647},
		{-9223372036854775808, -2147483648},
	}

	for _, test := range tests {
		got := test.in.Int32()
		if got != test.want {
			t.Errorf("Int32: did not get expected value for %d - "+
				"got %d, want %d", test.in, got, test.want)
			continue
		}
	}
}
// Copyright (c) 2013-2017 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

package txscript

import (
	"encoding/hex"
	"fmt"
)

// asBool gets the boolean value of the byte array.
func asBool(t []byte) bool {
	for i := range t {
		if t[i] != 0 {
			// Negative 0 is also considered false.
			if i == len(t)-1 && t[i] == 0x80 {
				return false
			}
			return true
		}
	}
	return false
}

// fromBool converts a boolean into the appropriate byte array.
func fromBool(v bool) []byte {
	if v {
		return []byte{1}
	}
	return nil
}

// stack represents a stack of immutable objects to be used with bitcoin
// scripts.  Objects may be shared, therefore in usage if a value is to be
// changed it *must* be deep-copied first to avoid changing other values on the
// stack.
type stack struct {
	stk               [][]byte
	verifyMinimalData bool
}

// Depth returns the number of items on the stack.
func (s *stack) Depth() int32 {
	return int32(len(s.stk))
}

// PushByteArray adds the given back array to the top of the stack.
//
// Stack transformation: [... x1 x2] -> [... x1 x2 data]
func (s *stack) PushByteArray(so []byte) {
	s.stk = append(s.stk, so)
}

// PushInt converts the provided scriptNum to a suitable byte array then pushes
// it onto the top of the stack.
//
// Stack transformation: [... x1 x2] -> [... x1 x2 int]
func (s *stack) PushInt(val scriptNum) {
	s.PushByteArray(val.Bytes())
}

// PushBool converts the provided boolean to a suitable byte array then pushes
// it onto the top of the stack.
//
// Stack transformation: [... x1 x2] -> [... x1 x2 bool]
func (s *stack) PushBool(val bool) {
	s.PushByteArray(fromBool(val))
}

// PopByteArray pops the value off the top of the stack and returns it.
//
// Stack transformation: [... x1 x2 x3] -> [... x1 x2]
func (s *stack) PopByteArray() ([]byte, error) {
	return s.nipN(0)
}

// PopInt pops the value off the top of the stack, converts it


STORAGE
7:	mtspr	SPRN_SRR0, r10
	mtspr	SPRN_SRR1, r11
	mr	r10, r0
	bl	kvmppc_msr_interrupt
	b	fast_interrupt_c_return

3:	ld	r6, VCPU_KVM(r9)	/* not relocated, use VRMA */
	ld	r5, KVM_VRMA_SLB_V(r6)
	b	4b

/*
 * Try to handle an hcall in real mode.
 * Returns to the guest if we handle it, or continues on up to
 * the kernel if we can't (i.e. if we don't have a handler for
 * it, or if the handler returns H_TOO_HARD).
 *
 * r5 - r8 contain hcall args,
 * r9 = vcpu, r10 = pc, r11 = msr, r12 = trap, r13 = paca
 */
hcall_try_real_mode:
	ld	r3,VCPU_GPR(R3)(r9)
	andi.	r0,r11,MSR_PR
	/* sc 1 from userspace - reflect to guest syscall */
	bne	sc_1_fast_return
	clrrdi	r3,r3,2
	cmpldi	r3,hcall_real_table_end - hcall_real_table
	bge	guest_exit_cont
	/* See if this hcall is enabled for in-kernel handling */
	ld	r4, VCPU_KVM(r9)
	srdi	r0, r3, 8	/* r0 = (r3 / 4) >> 6 */
	sldi	r0, r0, 3	/* index into kvm->arch.enabled_hcalls[] */
	add	r4, r4, r0
	ld	r0, KVM_ENABLED_HCALLS(r4)
	rlwinm	r4, r3, 32-2, 0x3f	/* r4 = (r3 / 4) & 0x3f */
	srd	r0, r0, r4
	andi.	r0, r0, 1
	beq	guest_exit_cont
	/* Get pointer to handler, if any, and call it */
	LOAD_REG_ADDR(r4, hcall_real_table)
	lwax	r3,r3,r4
	cmpwi	r3,0
	beq	guest_exit_cont
	add	r12,r3,r4
	mtctr	r12
	mr	r3,r9		/* get vcpu pointer */
	ld	r4,VCPU_GPR(R4)(r9)
	bctrl
	cmpdi	r3,H_TOO_HARD
	beq	hcall_real_fallback
	ld	r4,HSTATE_KVM_VCPU(r13)
	std	r3,VCPU_GPR(R3)(r4)
	ld	r10,VCPU_PC(r4)
	ld	r11,VCPU_MSR(r4)
	b	fast_guest_return

sc_1_fast_return:
	mtspr	SPRN_SRR0,r10
	mtspr	SPRN_SRR1,r11
	li	r10, BOOK3S_INTERRUPT_SYSCALL
	bl	kvmppc_msr_interrupt
	mr	r4,r9
	b	fast_guest_return

	/* We've attempted a real mode hcall, but it's punted it back
	 * to userspace.  We need to restore some clobbered volatiles
	 * before resuming the pass-it-to-qemu path */
hcall_real_fallback:


 end: 30),
                  tablet: MyPortfolioText(start: 50, end: 40)),
              if (kIsWeb && Responsive.isLargeMobile(context))
                Container(
                  height: defaultPadding,
                  color: Colors.transparent,
                ),
              const CombineSubtitleText(),
              const SizedBox(height: defaultPadding / 2),
              const Responsive(
                desktop: AnimatedDescriptionText(start: 14, end: 15),
                largeMobile: AnimatedDescriptionText(start: 14, end: 12),
                mobile: AnimatedDescriptionText(start: 14, end: 12),
                tablet: AnimatedDescriptionText(start: 17, end: 14),
              ),
              const SizedBox(
                height: defaultPadding * 2,
              ),
              const DownloadButton(),
            ],
          ),
        ),
        const Spacer(),
        if (Responsive.isDesktop(context)) const AnimatedImageContainer(),
        const Spacer()
      ],
    );
  }
}
import 'dart:convert';
import 'dart:math';
import 'dart:typed_data';

import 'package:flutter_test/flutter_test.dart';
import 'package:veilid/veilid_encoding.dart';

const knownVectors = [
  ['', ''],
  ['f', 'Zg'],
  ['fo', 'Zm8'],
  ['foo', 'Zm9v'],
  ['foob', 'Zm9vYg'],
  ['fooba', 'Zm9vYmE'],
  ['foobar', 'Zm9vYmFy']
];

Future<void> _testEncodingKnownVector(Uint8List k, String v) async {
  final e = base64UrlNoPadEncode(k);
  expect(e, v, reason: 'encode mismatch');

  final d = base64UrlNoPadDecode(v);
  expect(d, k, reason: 'decode mismatch');

  final r = base64UrlNoPadDecode(e);
  expect(r, k, reason: 'round trip mismatch');
}

Future<void> testEncodingKnownVectors() async {
  for (final kv in knownVectors) {
    final k = Uint8List.fromList(kv[0].codeUnits);
    final v = kv[1];

    await _testEncodingKnownVector(k, v);
  }
}

Future<void> testEncodeDecodeGarbage() async {
  final random = Random(0);
  for (var n = 0; n < 8192; n++) {
    final kl = List<int>.empty(growable: true);
    for (var p = 0; p < n; p++) {
      final v = random.nextInt(256);
      kl.add(v);
    }
    final k = Uint8List.fromList(kl);

    final e = base64UrlNoPadEncode(k);
    final r = base64UrlNoPadDecode(e);

    expect(r, k, reason: 'garbage round trip mismatch');
  }
}

Future<void> testEncodeDecodeGarbagePad() async {
  final random = Random(0);
  for (var n = 0; n < 8192; n++) {
    final kl = List<int>.empty(growable: true);
    for (var p = 0; p < n; p++) {
      final v = random.nextInt(256);
      kl.add(v);
    }
    final k = Uint8List.fromList(kl);

    final e = base64Url.encode(k);
    final r = base64UrlNoPadDecode(e);

    expect(r, k, reason: 'garbage w/pad round trip mismatch');
  }
}
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'veilid_config.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

_$VeilidFFIConfigLoggingTerminalImpl
    _$$VeilidFFIConfigLoggingTerminalImplFromJson(Map<String, dynamic> json) =


 h && (y + j) < GetHeight(); j++)
    {
        CMP_HALF* pData = (CMP_HALF*)(GetData() + ((y + j) * m_dwPitch) + (x * nPixelSize));
        for (CMP_DWORD i = 0; i < dwWidth; i++)
        {
            pData[dwChannelIndex] = block[(j * w) + i];
            pData += nChannelCount;
        }
    }
    return true;
}

#pragma warning(push)
#pragma warning(disable : 4201)
typedef struct _R9G9B9E5
{
    union
    {
        struct
        {
            uint32_t rm : 9;  // r-mantissa
            uint32_t gm : 9;  // g-mantissa
            uint32_t bm : 9;  // b-mantissa
            uint32_t e : 5;   // shared exponent
        };
        uint32_t v;
    };

    operator uint32_t() const
    {
        return v;
    }

    _R9G9B9E5& operator=(const _R9G9B9E5& floatrgb9e5)
    {
        v = floatrgb9e5.v;
        return *this;
    }
    _R9G9B9E5& operator=(uint32_t Packed)
    {
        v = Packed;
        return *this;
    }
} R9G9B9E5;

#pragma warning(pop)

#define GET_PIXEL(i, j) &block[(((j * w) + i) * 4)]
bool CCodecBuffer_RGB9995EF::ReadBlockRGBA(CMP_DWORD x, CMP_DWORD y, CMP_BYTE w, CMP_BYTE h, float block[])
{
    assert(x < GetWidth());
    assert(y < GetHeight());
    assert(x % w == 0);
    assert(y % h == 0);

    if (x >= GetWidth() || y >= GetHeight())
        return false;

    CMP_DWORD dwWidth = cmp_minT(w, (GetWidth() - x));
    union
    {
        float   f;
        int32_t i;
    } fi;
    float     Scale = 0.0f;
    CMP_DWORD i, j;
    for (j = 0; j < h && (y + j) < GetHeight(); j++)
    {
        CMP_DWORD* pData = (CMP_DWORD*)(GetData() + ((y + j) * m_dwPitch) + (x * nPixelSize));
        R9G9B9E5   pTemp;

        pTemp.rm = ((*pData) & 0x000001ff);
        pTemp.gm = ((*pData) & 0x0003fe00) >> 9;
        pTemp.bm = ((*pData) & 0x07fc0000) >> 18;
        pTemp.e  = ((*pData) & 0xf8000000) >> 27;

        fi.i  = 0x33800000 + (pTemp.e << 23);
        Scale = fi.f;
        for (i = 0; i < dwWidth; i++)
        {
            float* pDest = GET_PIXEL(i, j);
            *pDest++     = Scale * float(pTemp.rm);
            *pDest++     = Scale * float(pTemp.gm);
            *pDest++     = Scale * float(pTemp.bm);
            *pDest++     = 1.0f;
            //pData += nChannelCount;
        }
        //float* pData = (float*) (GetData() + ((y + j) * m_dwPitch) + (x * nPixelSize));
        //for(i = 0; i < dwWidth; i++)
        //{
        //    float* pDest = GET_PIXEL(i, j);
        //    *pDest++ = *pData++;
        //    *pDest++ = 0.0f;
        //    *pDest++ = 0.0f;
        //    *pDest++ = 1.0f;
        //}

        // Pad line with previous values if necessary
        if (i < w)
            PadLine(i, w, 1, &block[j * w]);
    }

    // Pad block with previous values if necessary
    if (j < h)
        PadBlock(j, w, h, 1, block);
    return true;
}

bool CCodecBuffer_RGB9995EF::WriteBlockRGBA(CMP_DWORD x, CMP_DWORD y, CMP_BYTE w, CMP_BYTE h, float block[])
{
    assert(x < GetWidth());
    assert(y < GetHeight());
    assert(x % w == 0);
    assert(y % h == 0);

    if (x >= GetWidth() || y >= GetHeight())
        retu


 Instagram 过滤器的 Python 翻拍版（[https://github.com/lukexyz/CV-Instagram-Filters](https://github.com/lukexyz/CV-Instagram-Filters) （提示：使用 PIL`split()`、`merge()`和`numpy interp()`功能操作图像以创建通道插值（[https://www.youtube.com/watch?v=otLGDpBglEA &功能=播放器（嵌入](https://www.youtube.com/watch?v=otLGDpBglEA&feature=player_embedded)）。
4.  使用 scikit image 的`warp()`功能实现漩涡变换。注意，`swirl`变换也可以用以下等式表示：

![](img/2c570c4a-fc89-473b-a7a3-f239c015c44a.png)
![](img/51459643-e53c-486b-82f4-8fc0511da9ec.png)
![](img/bd5c5e92-720e-439e-8f38-4a53d6e7b42b.png)
![](img/6bce5f03-761b-44d5-a242-80619e87d319.png)

5.  执行以下给出的波形变换（提示：使用 scikit 图像的`warp()`：

![](img/f549ffb1-e9cb-4545-a977-f1f9f3d615a0.png)
![](img/8dbce145-83c1-4bad-919d-b29f38807f7d.png)

6.  使用 PIL 加载带有调色板的 RGB`.png`文件，并将其转换为灰度图像。此问题摘自此帖：[https://stackoverflow.com/questions/51676447/python-use-pil-to-load-png-file-gives-strange-results/51678271#51678271](https://stackoverflow.com/questions/51676447/python-use-pil-to-load-png-file-gives-strange-results/51678271#51678271) 。通过索引调色板，将以下 RGB 图像（来自`VOC2012`数据集）转换为灰度图像：

![](img/83385efa-3ad6-4868-96ec-ca91667242ad.png)

7.  为本章中使用的鹦鹉图像的每个颜色通道绘制 3D 图（提示：使用`mpl_toolkits.mplot3d`模块的`plot_surface()`功能和 NumPy 的`meshgrid()`功能）。

8.  使用 SCIKIT 图像的 To.T0.模块的莱娜 T1 来估计从源到目标图像的单应矩阵，并使用 AUT2 T2 函数嵌入在空白画布中的图像（如下所示）：

| **输入图像** | **输出图像** |
| ![](img/890be690-5faf-42e4-ae0d-acd95fffdc1e.png) | ![](img/64da19d9-51e6-481b-a00f-942f3949ced6.png) |

首先，试着自己解决问题。可在此处找到解决方案供您参考：[https://sandipanweb.wordpress.com/2018/07/30/some-image-processing-problems/](https://sandipanweb.wordpress.com/2018/07/30/some-image-processing-problems/) 。

# 进一步阅读

*   *数字


de <ntcr_thread.t.cpp>

// ntcp

#include <ntcp_datagramsocket.t.cpp>
#include <ntcp_interface.t.cpp>
#include <ntcp_listenersocket.t.cpp>
#include <ntcp_streamsocket.t.cpp>
#include <ntcp_thread.t.cpp>

// ntco

#include <ntco_devpoll.t.cpp>
#include <ntco_epoll.t.cpp>
#include <ntco_eventport.t.cpp>
#include <ntco_iocp.t.cpp>
#include <ntco_ioring.t.cpp>
#include <ntco_kqueue.t.cpp>
#include <ntco_poll.t.cpp>
#include <ntco_pollset.t.cpp>
#include <ntco_select.t.cpp>
#include <ntco_test.t.cpp>

// ntcf

// #include <ntcf_api.t.cpp>
#include <ntcf_system.t.cpp>
#include <ntcf_test.t.cpp>

//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2008-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interprocess for documentation.
//
//////////////////////////////////////////////////////////////////////////////

#ifndef BOOST_INTERPROCESS_MANAGED_XSI_SHARED_MEMORY_HPP
#define BOOST_INTERPROCESS_MANAGED_XSI_SHARED_MEMORY_HPP

#if (defined _MSC_VER) && (_MSC_VER >= 1200)
#  pragma once
#endif

#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>

#if !defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
#error "This header can't be used in operating systems without XSI (System V) shared memory support"
#endif

#include <boost/interprocess/detail/managed_memory_impl.hpp>
#include <boost/interprocess/detail/managed_open_or_create_impl.hpp>
#include <boost/interprocess/detail/xsi_shared_memory_file_wrapper.hpp>
#include <boost/interprocess/creation_tags.hpp>

namespace boost {

namespace interprocess {

//!A basic X/Open System Interface (XSI) shared memory named object creation class. Initializes the
//!shared memory segment. Inherits all basic functionality from
//!basic_managed_memory_impl<CharType, AllocationAlgorithm, IndexType>*/
template
      <
         class CharType,
         class AllocationAlgorithm,
         template<class IndexConfig> class IndexType
      >
class basic_managed_xsi_shared_memory
   : public detail::basic_managed_memory_impl
      <CharType, AllocationAlgorithm, IndexType
      ,detail::managed_open_or_create_impl<xsi_shared_memory_file_wrapper, false, true>::ManagedOpenOrCreateUserOffset>
   , private detail::managed_open_or_create_impl<xsi_shared_memory_file_wrapper, false, true>
{
   /// @cond
   public:
   typedef xsi_shared_memory_file_wrapper device_type;

   public:
   typedef detail::


�罩层
  OverlayEntry? _overlayEntry;
  late OverlayState _overlayState;
  // 类型
  VoiceType _voiceType = VoiceType.none;
  // 声音地址
  String? _path;
  // 声音时间
  int _second = 0;
  // 定时任务
  Timer? _timer;

  @override
  void initState() {
    super.initState();
    _overlayState = Overlay.of(context);
  }

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      behavior: HitTestBehavior.translucent,
      // 长按开始
      onLongPress: () async {
        // 权限
        bool result = await ToolsPerms.microphone();
        if (!result) {
          return;
        }
        // 更新状态
        setState(() {
          _voiceType = VoiceType.send;
        });
        // 显示遮罩
        await _showMask();
      },
      // 长按移动
      onLongPressMoveUpdate: (value) {
        // 更新状态
        setState(() {
          _voiceType =
              value.localPosition.dy > -50 ? VoiceType.send : VoiceType.cancel;
        });
        // 更新遮罩
        _updateMask();
      },
      // 长按结束
      onLongPressEnd: (value) async {
        // 隐藏遮罩
        await _hideMask();
        // 更新状态
        setState(() {
          _voiceType = VoiceType.none;
        });
      },
      child: Container(
        height: 45,
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(7),
        ),
        child: const Center(
          child: Text('按住 说话'),
        ),
      ),
    );
  }

  // 开始录制
  Future<void> _startVoice() async {
    _timer?.cancel();
    _second = 0;
    await widget.soundRecord.start();
    await widget.soundRecord.isRecording();
    _timer = Timer.periodic(const Duration(seconds: 1), (Timer t) {
      _second++;
      // 设置了最大录音时长
      if (_second >= 60) {
        _stopVoice();
      }
    });
  }

  // 停止录制
  Future<void> _stopVoice() async {
    _timer?.cancel();
    _path = await widget.soundRecord.stop();
  }

  // 显示遮罩
  Future<void> _showMask() async {
    // 隐藏遮罩
    await _hideMask();
    // 开始录音
    await _startVoice();
    // 显示遮罩
    _overlayEntry = OverlayEntry(builder: (BuildContext context) {
      return ChatVoiceMask(_voiceType);
    });
    _overlayState.insert(_overlayEntry!);
  }

  // 更新遮罩
  void _updateMask() {
    if (_overlayEntry == null) {
      return;
    }
    _overlayEntry?.markNeedsBuild();
  }

  // 隐藏遮罩
  Future<void> _hideMask() async {
    if (_overlayEntry == null) {
      return;
    }
    // 停止录音
    await _stopVoice();
    // 隐藏遮罩
    _overlayEntry?.remove();
    _overlayEntry = null;
    if (VoiceType.send != _voiceType) {
      return;
    }
    if (_second < 1) {
      EasyLoading.showToast('说话时间太短了');
      return;
    }
    // 发送声音
    _sendVoice();
  }

  // 发送声音消息
  _sendVoice() {
    Map<String, dynamic> content = {
      'data': _path,
      'second': _second,
      'title': '${const Uuid().v8()}.aac',
    };
    // 组装消息
    EventChatModel model = EventChatModel(
      ToolsStorage().chat(),
      MsgType.voice,
      content,
    );
    // 发布消息
    EventMessage().listenSend.add(model);
  }
}

// 扩展类型
enum VoiceType {
  none,
  send,
  cancel,
}

// 遮罩层
class ChatVoic


length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],a===n.length-1?r[s]=e:r[s]={},r=r[s]):(a===n.length-1?r[o]=e:r[o]={},r=r[o])}return i};var O=/^([^\[\.]+)\.(.+)?/,I=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function D(t){return"__"===t.slice(0,2)}f.expandObjectPaths=function(t){var e,r,n,i,a,o,s;if("object"==typeof t&&!Array.isArray(t))for(r in t)if(t.hasOwnProperty(r))if(e=r.match(O)){if(i=t[r],D(n=e[1]))continue;delete t[r],t[n]=f.extendDeepNoArrays(t[n]||{},f.objectFromPath(r,f.expandObjectPaths(i))[n])}else if(e=r.match(I)){if(i=t[r],D(n=e[1]))continue;if(a=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3])s=e[4],o=t[n][a]=t[n][a]||{},f.extendDeepNoArrays(o,f.objectFromPath(s,f.expandObjectPaths(i)));else{if(D(n))continue;t[n][a]=f.expandObjectPaths(i)}}else{if(D(r))continue;t[r]=f.expandObjectPaths(t[r])}return t},f.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,i=e.charAt(0),a=e.charAt(1),o=t.split("."),s=o[0],l=o.length>1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return z.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var R={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return U.apply(R,arguments)};var F={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return U.apply(F,arguments)};var B=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,N={max:10,count:0,name:"texttemplate",parseMultDiv:!0};f.texttemplateStringForShapes=function(){return U.apply(N,arguments)};var j=/^[:|\|]/;function U(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var u="_xother"===s||"_yother"===


ext) => ctx.mesh.edges
  })

  return (props: Props) => {
    drawSurface(props);
    drawWireframe(props);
  }
}

function memoizeMeshCreation(regl: Regl) {
  // Memoize vertex/element buffer creation
  let _dims: any;
  let _potential: any;
  let _bounds: any;

  let positions: Buffer;
  let cells: Elements;
  let edges: Elements;

  return (dims: any, potential: any, bounds: any) => {
    if (
      JSON.stringify(dims) !== JSON.stringify(_dims) ||
      potential !== _potential ||
      JSON.stringify(bounds) !== JSON.stringify(_bounds)
    ) {
      _dims = dims;
      _potential = potential;
      _bounds = bounds;
      const net = surfaceNets(dims, potential, bounds);
      positions = regl.buffer(net.positions);
      cells = regl.elements(net.cells);

      const edgesArray: [number, number][] = [];
      for (const cell of net.cells) {
        edgesArray.push(
          [cell[0], cell[1]],
          [cell[1], cell[2]],
          [cell[2], cell[0]]
        );
      }
      edges = regl.elements(edgesArray);
      console.log("recomputed mesh", net);
    }
    return { positions, cells, edges };
  };
}

type RecordItem = {
    tags: string[];
    notes: string;
    type: string;
    amount: number;
    createdAt?: Date; //可以写Date类
};

type Tag={
    id: string;
    name: string;
}
type TagListModel={
    data: Tag[];
    fetch: () => Tag[];
    update: (id: string,name: string) => 'success'|'not found'|'duplicated';
    create: (name: string) => 'success' | 'duplicated';  //success表示成功，duplicated表示重复
    save: () => void;
    remove: (id: string) => boolean;
}

interface Window{    //用来声明window上面有一个属性叫做tagList
    tagList: Tag[];
}import styled from '@emotion/styled'

export const Container = styled('div')({
  position: 'absolute',
  top: 0,
  left: 0,
  right: 0,
  bottom: 0,
  overflow: 'hidden',
  userSelect: 'none',
  touchAction: 'none',
  cursor: 'move',
})

const mediaStyles = {
  maxWidth: '100%',
  maxHeight: '100%',
  margin: 'auto',
  position: 'absolute',
  top: 0,
  bottom: 0,
  left: 0,
  right: 0,
  willChange: 'transform', // this improves performances and prevent painting issues on iOS Chrome
}

// @ts-ignore I don't want to duplicate mediaStyles
export const Img = styled('img')(mediaStyles)
// @ts-ignore I don't want to duplicate mediaStyles
export const Video = styled('video')(mediaStyles)

const lineBorder = '1px solid rgba(255, 255, 255, 0.5)'
const cropperLines = {
  content: '" "',
  boxSizing: 'border-box',
  position: 'absolute',
  border: lineBorder,
}
const cropperArea = {
  position: 'absolute',
  left: '50%',
  top: '50%',
  transform: 'translate(-50%, -50%)',
  border: lineBorder,
  boxSizing: 'border-box',
  boxShadow: '0 0 0 9999em',
  color: 'rgba(0,0,0,0.5)',
  overflow: 'hidden',
}
const gridLines = {
  '&::before': {
    ...cropperLines,
    top: 0,
    bottom: 0,
    left: '33.33%',
    right: '33.33%',
    borderTop: 0,
    borderBottom: 0,
  },


usive: T,
                                                       val step: Duration = Duration.ofMillis(1L))
    : Iterable<T>, Serializable where T : Temporal, T : Comparable<T> {

    init {
        require(!step.isZero) { "step must be non-zero" }
    }

    companion object {
        @JvmStatic
        @JvmOverloads
        fun <T> fromClosedRange(start: T, endInclusive: T, step: Duration = Duration.ofMillis(1))
        : TemporalProgression<T> where T : Temporal, T : Comparable<T> {
            require(!step.isZero) { "step must be non-zero" }
            return TemporalProgression(start, endInclusive, step)
        }
    }

    val first: T = start
    val last: T = getProgressionLastElement(start, endInclusive, step)
    open fun isEmpty(): Boolean = if(step.isPositive) first > last else first < last

    override fun equals(other: Any?): Boolean = when(other) {
        null                       -> false
        !is TemporalProgression<*> -> false
        else                       -> (isEmpty() && other.isEmpty()) ||
                                      (first == other.first && last == other.last && step == other.step)
    }

    override fun hashCode(): Int = if(isEmpty()) -1 else Objects.hash(first, last, step)

    override fun toString(): String = when {
        step.isZero     -> "$first..$last"
        step.isPositive -> "$first..$last step $step"
        else            -> "$first downTo $last step ${step.negated()}"
    }

    @Suppress("UNCHECKED_CAST")
    fun sequence(): Sequence<T> = sequence {
        var current = first
        while(current <= last) {
            yield(current)
            current = current.plus(step) as T
        }
    }

    override fun iterator(): Iterator<T> = TemporalProgressionIterator(first, last, step)

    /**
     * An iterator over a progression of values of type [java.time.temporal.Temporal].
     *
     * @property step the number by which the value is incremented on each step.
     */
    internal class TemporalProgressionIterator<T>(first: T,
                                                  last: T,
                                                  val step: Duration = Duration.ofMillis(1L))
        : TemporalIterator<T>() where T : Temporal, T : Comparable<T> {

        private val _finalElement: T = last
        private var _hasNext: Boolean = if(step.isPositive) first <= last else first >= last
        private var _next: T = if(_hasNext) first else _finalElement

        override fun hasNext(): Boolean = _hasNext

        override fun nextTemporal(): T {
            val value = _next
            if(value == _finalElement) {
                if(!_hasNext)
                    throw NoSuchElementException()
                _hasNext = false
            } else {
                @Suppress("UNCHECKED_CAST")
                _next = _next.plus(step) as T
            }
            return value
        }
    }
}/*
 * Copyright (c) 2016. Sunghyouk Bae <sunghyouk.bae@gmail.com>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.debop.kodatimes.ranges

import com.github.debop.kodatimes.AbstractKodaTimesTest
import com


#include<stdio.h>
#include<stdlib.h>
#include<pthread.h>
#include<time.h>
#include"parallel_fun.h"

struct for_index{
	int start;
	int end;
	int increment;
	double **A;
	double **B;
	double **C;
	int scale1;
	int scale2;
};

void parallel_for(int start, int end, int increment, void*(functor)(void*) ,void *arg , int num_threads){
    pthread_t* thread_handles=malloc(num_threads*sizeof(pthread_t));
	struct for_index* indice=malloc(num_threads*sizeof(struct for_index));

	struct for_index *data=(struct for_index *)arg;

	for(int i=0;i<num_threads;i++){
		indice[i].start=start+i*(end-start)/num_threads;
		indice[i].end=start+(i+1)*(end-start)/num_threads;
		indice[i].increment=increment;
		indice[i].A=data->A;
		indice[i].B=data->B;
		indice[i].C=data->C;
		indice[i].scale1=data->scale1;
		indice[i].scale2=data->scale2;

		pthread_create(&thread_handles[i], NULL, functor, &indice[i]);
	}

	for(int i=0;i<num_threads;i++){
		pthread_join(thread_handles[i], NULL);
	}

	free(thread_handles);
	free(indice);
	free(data);
}


_leg_quad_bubble_count
};

static int* hdiv_leg_index_to_order[2] =
{
  NULL,
  hdiv_leg_quad_index_to_order
};

HdivShapesetLegendre::HdivShapesetLegendre()
{
  shape_table[0] = hdiv_leg_shape_fn_table;
  shape_table[1] = hdiv_leg_shape_fn_table_x;
  shape_table[2] = hdiv_leg_shape_fn_table_y;
  shape_table[3] = NULL;
  shape_table[4] = NULL;
  shape_table[5] = NULL;

  vertex_indices = hdiv_leg_vertex_indices;
  edge_indices = hdiv_leg_edge_indices;
  bubble_indices = hdiv_leg_bubble_indices;
  bubble_count = hdiv_leg_bubble_count;
  index_to_order = hdiv_leg_index_to_order;

  ref_vert[0][0][0] = -1.0;
  ref_vert[0][0][1] = -1.0;
  ref_vert[0][1][0] =  1.0;
  ref_vert[0][1][1] = -1.0;
  ref_vert[0][2][0] = -1.0;
  ref_vert[0][2][1] =  1.0;

  ref_vert[1][0][0] = -1.0;
  ref_vert[1][0][1] = -1.0;
  ref_vert[1][1][0] =  1.0;
  ref_vert[1][1][1] = -1.0;
  ref_vert[1][2][0] =  1.0;
  ref_vert[1][2][1] =  1.0;
  ref_vert[1][3][0] = -1.0;
  ref_vert[1][3][1] =  1.0;

  max_order = 10;
  num_components = 2;

  max_index[0] = 149;
  max_index[1] = 307;

  ebias = 0;  // TODO

  comb_table = NULL;

  set_mode(HERMES_MODE_TRIANGLE);
}

//#endif
// This utility generates simple shape functions for quads.

#include <stdio.h>
#include <stdlib.h>
#ifdef _MSC_VER
#include <minmax.h>
#endif

void output_fn(int i, int j)
{
  char c = (i == 0 && j > 1 && (j & 1) || j == 1 && i > 1 && (i & 1)) ? '-' : ' ';

  if (((i == 0 || i == 1) && (j & 1) && (j != 1)) || ((j == 0 || j == 1) && (i & 1) && (i != 1))) {
    printf
    (
      "static double simple_quad_l%d_l%d_0(double x, double y)\n"
      "{\n"
      "  return %c l%d(x) * l%d(y);\n"
      "}\n\n"
      "static double simple_quad_l%d_l%dx_0(double x, double y)\n"
      "{\n"
      "  return %c dl%d(x) * l%d(y);\n"
      "}\n\n"
      "static double simple_quad_l%d_l%dy_0(double x, double y)\n"
      "{\n"
      "  return %c l%d(x) * dl%d(y);\n"
      "}\n\n"
      "static double simple_quad_l%d_l%dxx_0(double x, double y)\n"
      "{\n"
      "  return %c d2l%d(x) * l%d(y);\n"
      "}\n\n"


        grind(args);
        }
      """).create();

      await (await grind([
        "pkg-standalone-${CliPlatform.current}",
      ])).shouldExit(0);

      await d.archive("my_app/build/my_app-1.2.3-$_archiveSuffix", [
        d.dir("my_app", [
          d.file("foo$dotBat", anything),
          d.file("bar$dotBat", anything),
          d.file("qux$dotBat", anything),
          d.file("zip$dotBat", anything),
          if (!CliPlatform.current.useExe)
            d.dir("src", [
              d.file("foo.snapshot", anything),
              d.file("bar.snapshot", anything),
              d.file("zip.snapshot", anything),
            ]),
        ]),
      ]).validate();
    });

    // Normally each of these would be separate test cases, but running grinder
    // takes so long that we collapse them for efficiency.
    test("can be invoked", () async {
      await d
          .package(
            {
              "name": "my_app",
              "version": "1.2.3",
              "executables": {
                "foo": "foo",
                "bar": "bar",
                "qux": "bar",
                "const": "const",
              },
            },
            """
          void main(List<String> args) {
            // TODO(nweiz): Test spaces and commas when dart-lang/sdk#46050 and
            // #44995 are fixed.
            pkg.environmentConstants.value["my-const"] =
                ${riskyArgStringLiteral(invokedByDart: true, dartCompileExe: true)};

            pkg.addStandaloneTasks();
            grind(args);
          }
        """,
          )
          .create();

      await d.dir("my_app/bin", [
        d.file(
          "const.dart",
          "void main() => print(const String.fromEnvironment('my-const'));",
        ),
      ]).create();

      await (await grind([
        "pkg-standalone-${CliPlatform.current}",
      ])).shouldExit(0);
      await extract("my_app/build/my_app-1.2.3-$_archiveSuffix", "out");

      // Directly
      var executable = await TestProcess.start(
        d.path("out/my_app/foo$dotBat"),
        [],
        workingDirectory: d.sandbox,
      );
      expect(executable.stdout, emits("in foo 1.2.3"));
      await executable.shouldExit(0);

      // Through a redirect
      executable = await TestProcess.start(
        d.path("out/my_app/qux$dotBat"),
        [],
        workingDirectory: d.sandbox,
      );
      expect(executable.stdout, emits("in bar 1.2.3"));
      await executable.shouldExit(0);

      // We don't currently support resolving scripts through symlinks on
      // Windows. Although `%~dp0` refers to the symlink's location rather than
      // the script's, it's theoretically possible to determine the original
      // location by parsing the output of `dir /a %0`. However, that would
      // involve a lot of complex batch scripting, soif someone wants it they'll
      // need to add it themself.
      if (!Platform.isWindows) {
        // Through a relative symlink
        Link(d.path("foo-relative$dotBat")).createSync("out/my_app/foo$dotBat");
        executable = await TestProcess.start(
          d.path("foo-relative$dotBat"),
          [],
          workingDirectory: d.sandbox,
        );
        expect(executable.stdout, emits("in foo 1.2.3"));
        await executable.


okButton");
      okButton->setText("Close");
      okButton->setDefault(true);
      okButton->setAutoDefault(true);
      ObjectBrowserDialogLayout->addWidget(okButton, 2, 1, 1, 1);

      connect(okButton, SIGNAL(clicked()), this, SLOT(okClicked()));

      setTabOrder(okButton, objectBrowserWidget);
    }

  if (!name)
    setObjectName("ObjectBrowser");

  resize(420, 460);
  setWindowTitle(QString::fromUtf8("Object Browser"));
}

ObjectBrowserDialog::~ObjectBrowserDialog()
{}

void ObjectBrowserDialog::setOutputVector(std::vector< const CDataObject * > * pObjectVector)
{
  if (objectBrowserWidget) objectBrowserWidget->setOutputVector(pObjectVector);
}

void ObjectBrowserDialog::cancelClicked()
{
  close();
}

void ObjectBrowserDialog::okClicked()
{
  objectBrowserWidget->commitClicked();
  done(QDialog::Accepted);
}

void ObjectBrowserDialog::toggleViewClicked()
{
  if (toggleViewButton->text() == "Selected Items")
    toggleViewButton->setText("Tree View");
  else
    toggleViewButton->setText("Selected Items");

  objectBrowserWidget->toggleViewClicked();
}

void ObjectBrowserDialog::selectObjects(std::vector< const CDataObject * > * pObjectVector)
{
  if (objectBrowserWidget) objectBrowserWidget->selectObjects(pObjectVector);
}
// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the
// University of Virginia, University of Heidelberg, and University
// of Connecticut School of Medicine.
// All rights reserved.

// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and University of
// of Connecticut School of Medicine.
// All rights reserved.

// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and The University
// of Manchester.
// All rights reserved.

// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., EML Research, gGmbH, University of Heidelberg,
// and The University of Manchester.
// All rights reserved.

// Copyright (C) 2004 - 2007 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc. and EML Research, gGmbH.
// All rights reserved.

#include <iostream>
#include <sstream>

//Added by qt3to4:
#include <QContextMenuEvent>
#include <QCloseEvent>
#include <QMouseEvent>
#include <QtCore/QEvent>

#include "copasi/UI/SliderDialog.h"
#include "copasi/UI/DataModelGUI.h"
#include "copasi/UI/copasiui3window.h"
#include "copasi/UI/CQTrajectoryWidget.h"
#include "copasi/UI/SteadyStateWidget.h"
#include "copasi/UI/ScanWidget.h"
#include "copasi/UI/CQMCAWidget.h"
#include "copasi/UI/CQLNAWidget.h"
#include "copasi/UI/CQFittingWidget.h"
#include "copasi/UI/CQOptimizationWidget.h"
#include "copasi/UI/SliderSettingsDialog.h"
#include "copasi/UI/CQMessageBox.h"
#include "copasi/UI/CopasiSlider.h"
#include "copasi/UI/listviews.h"
#include "copasi/UI/qtUtilities.h"
#include "copasi/xml/CCopasiXMLInterface.h"
#include "copasi/CopasiDataModel/CDataModel.h"
#include "copasi/core/CRootContainer.h"
#include "copasi/utilities/CCopasiTask.h"
#include "copasi/utilities/CCopasiProblem.h"
#inc


this.m_regexBannedWords, (e) =>
                this.m_regexCleanWords && 0 == e.search(this.m_regexCleanWords)
                  ? e
                  : this.CreateProfanityReplacement(e.length),
              );
        }
      }
      let D;
      function R() {
        if (!D) {
          const e = new Set();
          let t = { sessionid: m.TS.SESSIONID, origin: E() };
          s()
            .get(m.TS.COMMUNITY_BASE_URL + "textfilter/ajaxgetfriendslist", {
              params: t,
              withCredentials: !0,
            })
            .then((t) => {
              var r, i;
              for (const n of null !==
                (i =
                  null === (r = t.data.friendslist) || void 0 === r
                    ? void 0
                    : r.friends) && void 0 !== i
                ? i
                : [])
                (0, c.S$)(n.efriendrelationship) &&
                  e.add(new g.b(n.ulfriendid).GetAccountID());
            }),
            (D = (t) => e.has(t));
        }
        return D;
      }
      (0, n.Cg)([l.sH], z.prototype, "m_TextFilterPreferences", void 0),
        (0, n.Cg)([l.sH], z.prototype, "m_mapPlayerCache", void 0),
        (0, n.Cg)([l.sH], z.prototype, "m_regexBannedWords", void 0),
        (0, n.Cg)([l.sH], z.prototype, "m_regexCleanWords", void 0),
        (0, n.Cg)([l.sH], z.prototype, "m_bInitialized", void 0),
        (0, n.Cg)([l.sH], z.prototype, "m_bFilterChangedWhileLoading", void 0),
        (0, n.Cg)([l.sH], z.prototype, "m_bOngoingLoad", void 0),
        (0, n.Cg)([l.XI], z.prototype, "Init", null),
        (0, n.Cg)([W.o], z.prototype, "OnTextFilterDictionaryChanged", null),
        (0, n.Cg)([l.XI], z.prototype, "UpdateCommunityPreferences", null),
        (0, n.Cg)([l.XI], z.prototype, "BRebuildFilter", null);
    },
  },
]);
/**** (c) Valve Corporation. Use is governed by the terms of the Steam Subscriber Agreement http://store.steampowered.com/subscriber_agreement/.
 ****/
(self.webpackChunkcommunity = self.webpackChunkcommunity || []).push([
  [8780],
  {
    56444: (e) => {
      e.exports = { Ctn: "ksXUj612xIKmPglVngiI0" };
    },
    28347: (e) => {
      e.exports = {
        DiffTableContainer: "_1T21rDXKcolUe7tHkC54OL",
        DiffButtonCtn: "_2iajX7nR6xNLkLocPzfuKe",
        DiffButton: "_3KPMmnZcO_XZ44Mxw1lqtg",
        DiffButtonTextVO: "_1DEeWecmFNeGBB2VJahh2k",
      };
    },
    63226: (e) => {
      e.exports = {
        PreviewYoutubeEditor: "f2X3toOiE6SBBj8gkgwsN",
        Selected: "_1s7z9aW7wZunEhIaxF8Q_y",
        SelectionOverlay: "ZBNgQGP99gSH15SNAtiFt",
        PreviewYoutubeEditorModal: "_2898lC8lJ2Jih-o_aYzoaG",
        Error: "_1U35sXRoYsDiZXSTPbY1mk",
      };
    },
    18041: (e) => {
      e.exports = {
        GridContainer: "_3j-plrh3xZ5oOezrdbmSAY",
        Grid: "_2okhjZqFXhVm6k_iJkj4ZJ",
        GridRow: "_1R9RAGwHaeg9PikX-1YGf0",
        GridBoxWrapper: "kDK8ylezM-FNeb2p15WPz",
        GridBox: "UC6fFaIO4-KZ8gQWNhwBX",


66CE64B8EF5BD81246F7(L_17, /*hidden argument*/NULL);
		V_1 = L_18;
		MethodBase_t * L_19 = ___m23;
		NullCheck(L_19);
		Type_t * L_20 = VirtFuncInvoker0< Type_t * >::Invoke(8 /* System.Type System.Reflection.MemberInfo::get_DeclaringType() */, L_19);
		int32_t L_21 = DefaultBinder_GetHierarchyDepth_m9F83693DC50F07E60C3566CE64B8EF5BD81246F7(L_20, /*hidden argument*/NULL);
		V_2 = L_21;
		int32_t L_22 = V_1;
		int32_t L_23 = V_2;
		if ((!(((uint32_t)L_22) == ((uint32_t)L_23))))
		{
			goto IL_0048;
		}
	}
	{
		return 0;
	}

IL_0048:
	{
		int32_t L_24 = V_1;
		int32_t L_25 = V_2;
		if ((((int32_t)L_24) >= ((int32_t)L_25)))
		{
			goto IL_004e;
		}
	}
	{
		return 2;
	}

IL_004e:
	{
		return 1;
	}

IL_0050:
	{
		return 0;
	}
}
// System.Int32 System.DefaultBinder::FindMostSpecificField(System.Reflection.FieldInfo,System.Reflection.FieldInfo)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t DefaultBinder_FindMostSpecificField_mE1F1A7614D5F22D24D965F1EFC9392C2C2015BD6 (FieldInfo_t * ___cur10, FieldInfo_t * ___cur21, const RuntimeMethod* method)
{
	int32_t V_0 = 0;
	int32_t V_1 = 0;
	{
		FieldInfo_t * L_0 = ___cur10;
		NullCheck(L_0);
		String_t* L_1 = VirtFuncInvoker0< String_t* >::Invoke(7 /* System.String System.Reflection.MemberInfo::get_Name() */, L_0);
		FieldInfo_t * L_2 = ___cur21;
		NullCheck(L_2);
		String_t* L_3 = VirtFuncInvoker0< String_t* >::Invoke(7 /* System.String System.Reflection.MemberInfo::get_Name() */, L_2);
		bool L_4 = String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE(L_1, L_3, /*hidden argument*/NULL);
		if (!L_4)
		{
			goto IL_0039;
		}
	}
	{
		FieldInfo_t * L_5 = ___cur10;
		NullCheck(L_5);
		Type_t * L_6 = VirtFuncInvoker0< Type_t * >::Invoke(8 /* System.Type System.Reflection.MemberInfo::get_DeclaringType() */, L_5);
		int32_t L_7 = DefaultBinder_GetHierarchyDepth_m9F83693DC50F07E60C3566CE64B8EF5BD81246F7(L_6, /*hidden argument*/NULL);
		V_0 = L_7;
		FieldInfo_t * L_8 = ___cur21;
		NullCheck(L_8);
		Type_t * L_9 = VirtFuncInvoker0< Type_t * >::Invoke(8 /* System.Type System.Reflection.MemberInfo::get_DeclaringType() */, L_8);
		int32_t L


nt(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) rgb(20.6,201.6,204.4);color:#000}:root{--bslib-value-box-shadow: none;--bslib-value-box-border-width-auto-yes: var(--bslib-value-box-border-width-baseline);--bslib-value-box-border-width-auto-no: 0;--bslib-value-box-border-width-baseline: 1px}.bslib-value-box{border-width:var(--bslib-value-box-border-width-auto-no, var(--bslib-value-box-border-width-baseline));container-name:bslib-value-box;container-type:inline-size}.bslib-value-box.card{box-shadow:var(--bslib-value-box-shadow)}.bslib-value-box.border-auto{border-width:var(--bslib-value-box-border-width-auto-yes, var(--bslib-value-box-border-width-baseline))}.bslib-value-box.default{--bslib-value-box-bg-default: var(--bs-card-bg, #050725);--bslib-value-box-border-color-default: var(--bs-card-border-color, rgba(0, 0, 0, 0.175));color:var(--bslib-value-box-color);background-color:var(--bslib-value-box-bg, var(--bslib-value-box-bg-default));border-color:var(--bslib-value-box-border-color, var(--bslib-value-box-border-color-default))}.bslib-value-box .value-box-grid{display:grid;grid-template-areas:"left right";align-items:center;overflow:hidden}.bslib-value-box .value-box-showcase{height:100%;max-height:var(---bslib-value-box-showcase-max-h, 100%)}.bslib-value-box .value-box-showcase,.bslib-value-box .value-box-showcase>.html-fill-item{width:100%}.bslib-value-box[data-full-screen=true] .value-box-showcase{max-height:var(---bslib-value-box-showcase-max-h-fs, 100%)}@media screen and (min-width: 575.98px){@container bslib-value-box (max-width: 300px){.bslib-value-box:not(.showcase-bottom) .value-box-grid{grid-template-columns:1fr !important;grid-template-rows:auto auto;grid-template-areas:"top" "bottom"}.bslib-value-box:not(.showcase-bottom) .value-box-grid .value-box-showcase{grid-area:top !important}.bslib-value-box:not(.showcase-bottom) .value-box-grid .value-box-area{grid-area:bottom !important;justify-content:end}}}.bslib-value-box .value-box-area{justify-content:center;padding:1.5rem 1rem;font-size:.9rem;font-weight:500}.bslib-value-box .value-box-area *{margin-bottom:0;margin-top:0}.bslib-value-box .value-box-title{font-size:1rem;margin-top:0;margin-bottom:.5rem;font-family:"Miriam Libre";font-weight:500;line-height:1.2}.bslib-value-box .value-box-title:empty::after{content:" "}.bslib-value-box .value-box-value{font-size:calc(1.29rem + 0.48vw);margin-top:0;


de.InEdges.Count == 0).ToList()[0];
                toolbarClassName = toolbarClassName + " db-child-sibling";
                addSiblingCssName = SelectedObjects[0].ID == rootNode.ID ? "tb-item-start tb-item-sibling" : "tb-item-start tb-item-child";
            }
            StateHasChanged();
        }
        /// <summary>
        /// This is used to remove the toolbar items class name.
        /// </summary>
        public void removeClassElement()
        {
            string space = " ";
            if (toolbarClassName.Contains(space))
            {
                int first = toolbarClassName.IndexOf(space);
                if (first != 0)
                {
                    toolbarClassName = toolbarClassName.Remove(20);
                }
            }

        }
        /// <summary>
        /// This is used to remove the toolbar items.
        /// </summary>
        private async Task HideToolBar()
        {
#pragma warning disable CA1307 // Specify StringComparison
            if (MenuHideIconCss.Contains("sf-icon-Collapse"))
#pragma warning restore CA1307 // Specify StringComparison
            {
                MenuHideIconCss = "sf-icon-DownArrow tb-icons";
            }
            else
            {
                MenuHideIconCss = "sf-icon-Collapse tb-icons";
            }
            if (jsRuntime != null)
                await jsRuntime.InvokeAsync<object>("hideMenubar").ConfigureAwait(true);
        }

        /// <summary>
        /// This is used to remove the toolbar items.
        /// </summary>
        public async Task HideElements(string eventname, bool isNewClick = false)
        {
            if (jsRuntime != null)
            {
                int adjustableHeight = Parent.MenubarRef.WindowMenuItems[0].IconCss == "sf-icon-Selection" ? 0 : 40;
                Parent.height = (await jsRuntime.InvokeAsync<int>("UtilityMethods_hideElements", eventname, isNewClick).ConfigureAwait(true) + adjustableHeight).ToString() + "px";
                Parent.StateChanged();
            }
        }
        #endregion
    }
#pragma warning restore BL0005
}