odels/image_classification/overview) | tensorflow.org     |
 | 分类 |  MobileNetV2 | 在 Android 上认花 [Codelab](https://codelabs.developers.google.com/codelabs/recognize-flowers-with-tensorflow-on-android/#0) \| [Android](https://github.com/tensorflow/examples/tree/master/lite/codelabs/flower_classification/android)                                                                                |  TensorFlow 团队 |
 | 分类 |  MobileNetV2 | 皮损检测 [Android](https://github.com/AakashKumarNain/skin_cancer_detection/tree/master/demo)                                                                                | 社区 |
 | 分类 |  MobileNetV2 | 美国手语检测\| [Colab Notebook](https://colab.research.google.com/drive/1xsunX7Qj_XWBZwcZLyjsKBg4RI0DNo2-?usp=sharing) \| [Android](https://github.com/sayannath/American-Sign-Language-Detection)                                                                                | 社区 |
 | 分类 |  CNN + 量化意识训练 | 石头剪刀布检测 [Colab Notebook](https://colab.research.google.com/drive/1Wdso2N_76E8Xxniqd4C6T1sV5BuhKN1o?usp=sharing) \| [Flutter](https://github.com/sayannath/American-Sign-Language-Detection)                                                                                | 社区 |
 | 分类 |  EfficientNet-Lite0 ([download](https://github.com/margaretmz/icon-classifier/blob/master/ml-code/icons-50.tflite) ) | 图标分类器 [Colab & Android](https://github.com/margaretmz/icon-classifier) \| [tutorial 1](https://medium.com/swlh/icon-classifier-with-tflite-model-maker-9263c0021f72) \| [tutorial 2](https://medium.com/@margaretmz/icon-classifier-android-app-1fc0b727f761)                                                                                | 社区 |

#### Detection
 | 任务 | 型号 | 应用\| 参考 | 来源 |
| -|-|-|-|
 | 物体检测 | 量化的 COCO SSD MobileNet v1 ([download](https://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip)) | [Android](https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/android) \| [iOS](https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/ios) \| [Overview](https://www.tensorflow.org/lite/models/object_detection/overview#starter_model)                                                                                | tensorflow.org     |
 | 物体检测 | 约洛 | [Flutter](https://blog.francium.tech/real-time-object-detection-on-mobile-with-flutter-tensorflow-lite-and-yolo-android-part-a0042c


 evt) {
  if (evt['id'] == null || evt['location'] == null) {
    return;
  }
  try {
    final uiList = <UiType>[];
    for (var e in json.decode(evt['ui'] as String)) {
      final ui = UiType.create(e);
      if (ui != null) {
        uiList.add(ui);
      }
    }
    if (uiList.isNotEmpty) {
      addLocationUi(evt['location']!, evt['id']!, uiList);
    }
  } catch (e) {
    debugPrint('Failed handleReloading, json decode of ui, $e ');
  }
}

void handleOption(Map<String, dynamic> evt) {
  updateOption(
      evt['location'], evt['id'], evt['peer'] ?? '', evt['key'], evt['value']);
}
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:from_css_color/from_css_color.dart';

import '../../flutter_flow/lat_lng.dart';
import '../../flutter_flow/place.dart';
import '../../flutter_flow/uploaded_file.dart';

/// SERIALIZATION HELPERS

String dateTimeRangeToString(DateTimeRange dateTimeRange) {
  final startStr = dateTimeRange.start.millisecondsSinceEpoch.toString();
  final endStr = dateTimeRange.end.millisecondsSinceEpoch.toString();
  return '$startStr|$endStr';
}

String placeToString(FFPlace place) => jsonEncode({
      'latLng': place.latLng.serialize(),
      'name': place.name,
      'address': place.address,
      'city': place.city,
      'state': place.state,
      'country': place.country,
      'zipCode': place.zipCode,
    });

String uploadedFileToString(FFUploadedFile uploadedFile) =>
    uploadedFile.serialize();

String? serializeParam(
  dynamic param,
  ParamType paramType, [
  bool isList = false,
]) {
  try {
    if (param == null) {
      return null;
    }
    if (isList) {
      final serializedValues = (param as Iterable)
          .map((p) => serializeParam(p, paramType, false))
          .where((p) => p != null)
          .map((p) => p!)
          .toList();
      return json.encode(serializedValues);
    }
    switch (paramType) {
      case ParamType.int:
        return param.toString();
      case ParamType.double:
        return param.toString();
      case ParamType.String:
        return param;
      case ParamType.bool:
        return param ? 'true' : 'false';
      case ParamType.DateTime:
        return (param as DateTime).millisecondsSinceEpoch.toString();
      case ParamType.DateTimeRange:
        return dateTimeRangeToString(param as DateTimeRange);
      case ParamType.LatLng:
        return (param as LatLng).serialize();
      case ParamType.Color:
        return (param as Color).toCssString();
      case ParamType.FFPlace:
        return placeToString(param as FFPlace);
      case ParamType.FFUploadedFile:
        return uploadedFileToString(param as FFUploadedFile);
      case ParamType.JSON:
        return json.encode(param);

      default:
        return null;
    }
  } catch (e) {
    print('Error serializing parameter: $e');
    return null;
  }
}

/// END SERIALIZATION HELPERS

/// DESERIALIZATION HELPERS

DateTimeRange? dateTimeRangeFromString(String dateTimeRangeStr) {
  final pieces = dateTimeRangeStr.split('|');
  if (pieces.length != 2) {
    return null;
  }
  return DateTimeRange(
    start: DateTime.fromMillisecondsSinceEpoch(int.parse(


; shrh r15, r16, r17 }
	{ seq r5, r6, r7 ; slt r15, r16, r17 ; sh r25, r26 }
	{ seq r5, r6, r7 ; slte r15, r16, r17 ; prefetch r25 }
	{ seq r5, r6, r7 ; slth_u r15, r16, r17 }
	{ seq r5, r6, r7 ; slti_u r15, r16, 5 }
	{ seq r5, r6, r7 ; sra r15, r16, r17 ; lh_u r25, r26 }
	{ seq r5, r6, r7 ; sraih r15, r16, 5 }
	{ seq r5, r6, r7 ; sw r25, r26 ; andi r15, r16, 5 }
	{ seq r5, r6, r7 ; sw r25, r26 ; shli r15, r16, 5 }
	{ seq r5, r6, r7 ; xor r15, r16, r17 ; lh r25, r26 }
	{ seqb r15, r16, r17 ; adiffb_u r5, r6, r7 }
	{ seqb r15, r16, r17 ; intlh r5, r6, r7 }
	{ seqb r15, r16, r17 ; mulhha_ss r5, r6, r7 }
	{ seqb r15, r16, r17 ; mvnz r5, r6, r7 }
	{ seqb r15, r16, r17 ; sadah r5, r6, r7 }
	{ seqb r15, r16, r17 ; shri r5, r6, 5 }
	{ seqb r15, r16, r17 ; sltih_u r5, r6, 5 }
	{ seqb r15, r16, r17 ; xor r5, r6, r7 }
	{ seqb r5, r6, r7 ; icoh r15 }
	{ seqb r5, r6, r7 ; lhadd r15, r16, 5 }
	{ seqb r5, r6, r7 ; mnzh r15, r16, r17 }
	{ seqb r5, r6, r7 ; rli r15, r16, 5 }
	{ seqb r5, r6, r7 ; shr r15, r16, r17 }
	{ seqb r5, r6, r7 ; sltib r15, r16, 5 }
	{ seqb r5, r6, r7 ; swadd r15, r16, 5 }
	{ seqh r15, r16, r17 ; auli r5, r6, 0x1234 }
	{ seqh r15, r16, r17 ; maxih r5, r6, 5 }
	{ seqh r15, r16, r17 ; mulhl_ss r5, r6, r7 }
	{ seqh r15, r16, r17 ; mzh r5, r6, r7 }
	{ seqh r15, r16, r17 ; sadh_u r5, r6, r7 }
	{ seqh r15, r16, r17 ; slt_u r5, r6, r7 }
	{ seqh r15, r16, r17 ; sra r5, r6, r7 }
	{ seqh r5, r6, r7 ; addbs_u r15, r16, r17 }
	{ seqh r5, r6, r7 ; inthb r15, r16, r17 }
	{ seqh r5, r6, r7 ; lw_na r15, r16 }
	{ seqh r5, r6, r7 ; movelis r15, 0x1234 }
	{ seqh r5, r6, r7 ; sb r15, r16 }
	{ seqh r5, r6, r7 ; shrib r15, r16, 5 }
	{ seqh r5, r6, r7 ; sne r15, r16, r17 }
	{ seqh r5, r6, r7 ; xori r15,


lear(CLArgs const & args)
{
    Syntax              syn {args,"<in>.(fgmesh|tri) <out>.<ext>"};
    Mesh                mesh = loadMesh(syn.next());
    mesh.deltaMorphs.clear();
    mesh.targetMorphs.clear();
    saveMesh(mesh,syn.next());
}

void                cmdMorphCopy(CLArgs const & args)
{
    Syntax    syn(args,
        "<meshIn>.tri <meshOut>.tri ((d | t) <index>)*\n"
        "    d          - Delta morph\n"
        "    t          - Target morph\n"
        "    <index>    - morph index number (see 'morph list' command)\n"
        "COMMENTS:\n"
        "    If no morphs are specified, all morphs are copied *and destination morphs are overwritten*.\n"
        "    The meshes must have the same number of vertices and those vertices should correspond\n"
        "    to the same semantic locations."
        );

    string      nameIn = syn.next(),
                nameOut = syn.next();
    if (nameIn == nameOut)
        syn.error("Input and output meshes must be different");
    Mesh    meshIn = loadTri(nameIn);
    Mesh    meshOut = loadTri(nameOut);
    if (meshIn.verts.size() != meshOut.verts.size())
        syn.error("Meshes have different vertex counts");
    if (!syn.more()) {           // All morphs
        meshOut.deltaMorphs = meshIn.deltaMorphs;
        meshOut.targetMorphs = meshIn.targetMorphs;
    }
    while (syn.more()) {
        bool        delta = true;
        if (syn.next() == "t")
            delta = false;
        else if (syn.curr() != "d")
            syn.error("Invalid morph type flag",syn.curr());
        size_t      idx = syn.nextAs<size_t>();
        if (delta) {
            if (idx >= meshIn.deltaMorphs.size())
                syn.error("Invalid delta morph index",toStr(idx));
            meshOut.addDeltaMorph(meshIn.deltaMorphs[idx]);
        }
        else {
            if (idx >= meshIn.targetMorphs.size())
                syn.error("Invalid target morph index",toStr(idx));
            meshOut.addTargMorph(meshIn.targetMorphs[idx]);
        }
    }
    saveTri(nameOut,meshOut);
}

void                cmdMorphAdd(CLArgs const & args)
{
    Syntax              syn {args,R"([-i] <base>.<ext0> (d | t) (<targets> | <targsFile>.txt)
    -i              - ignore very small morphs (ie. do not create)
    <base>          - add morph to this mesh
    <ext0>          - (fgmesh | tri)
    (d | t)         - specify delta (aka blendshape) or target morph (target shape follows shape changes)
    <targets>       - (<targ>.<ext1> <morphName>)+
    <targ>          - target shape mesh containing the same number of vertices as <base>
    <ext1>          - )" + getMeshLoadExtsCLDescription() + R"(
    <targsFile>.txt - each line must be of the form <targ>.<ext1>, where the morph will be named <targ>
OUTPUT:
    <base>.<ext0> is saved with the new morph(s) added)"
    };
    bool                ignoreSmall = false;
    if (syn.peekNext() == "-i") {
        ignoreSmall = true;
        syn.next();
    }
    String              baseName = syn.next();
    Mesh                base = loadMesh(baseName);
    bool                asDeltaMorph = true;            // false == target morph
    if (syn.next() == "d")
        asDeltaMorph = true;
    else if (syn.curr() == "t")
        asDeltaMorph = false;
    else
        syn.error("Unknown morph type


 commits from './matcher/commits'
import files from './matcher/files'
import author from './matcher/author'
import * as github from '@actions/github'

/**
 * @param {string[]} labels that are newly derived
 * @param {Config} config of the labels
 */
export function mergeLabels(labels: string[], config: Config): string[] {
  const context = github.context
  const payload = context.payload.pull_request || context.payload.issue

  const currents =
    (payload?.labels?.map((label: any) => label.name as string) as string[]) ||
    []

  const removals = (config.labels || [])
    .filter(label => {
      // Is sync, not matched and currently added as a label in payload
      return (
        label.sync &&
        !labels.includes(label.label) &&
        currents.includes(label.label)
      )
    })
    .map(value => value.label)

  return difference(uniq(concat(labels, currents)), removals)
}

export async function labels(
  client: InstanceType<typeof GitHub>,
  config: Config
): Promise<string[]> {
  if (!config.labels?.length) {
    return []
  }

  const labels = await Promise.all([
    title(client, config),
    body(client, config),
    comment(client, config),
    branch(client, config),
    commits(client, config),
    files(client, config),
    author(client, config)
  ]).then(value => {
    return uniq(concat(...value))
  })

  return mergeLabels(labels, config)
}
import axios from "axios";
import createFetchRepos, { CANCELLED_EVENT_CODE } from './fetch-repos';
import MockAdapter from 'axios-mock-adapter';

const mock = new MockAdapter(axios);

describe('FetchRepos util', () => {
  beforeEach(() => {
    mock.reset();
  });

  it( 'should return list of repos after response',async (done) => {
    const data = { items: ['x', 'y'] };
    const fetchRepos = createFetchRepos();

    mock.onGet('https://api.github.com/search/repositories?q=react+in:name&sort=stars&page=1')
      .reply(200, data);

    await expect(fetchRepos('react', 1)).resolves.toMatchObject({ data });
    done();
  });

  it( 'should cancel first request if second request was sent faster then server responds',async (done) => {
    const fetchRepos = createFetchRepos();

    // mocking firest request with "reac" query
    mock.onGet('https://api.github.com/search/repositories?q=reac+in:name&sort=stars&page=1')
      .reply(200, { data: ['x', 'y', 'z'] });

    // mocking  second request with "react" query
    mock.onGet('https://api.github.com/search/repositories?q=react+in:name&sort=stars&page=1')
      .reply(200, { data: ['x', 'y'] });

    const firstRequest = fetchRepos('reac', 1);
    fetchRepos('react', 1);

    await expect(firstRequest).resolves.toEqual(CANCELLED_EVENT_CODE);
    done();
  });
  it( 'should use cache with repeating requests',async (done) => {
    const fetchRepos = createFetchRepos();

    // mocking  second request with "react" query
    mock.onGet('https://api.github.com/search/repositories?q=react+in:name&sort=stars&page=1')
      .reply(200, { data: ['x', 'y'] });

    // need to check also that first request is not cancelled and is actually made a request to server
    const firstRequest = fetchRepos('react', 1);
    await expect(firstRequest).resolves.not.


/* Copyright (C) 2022-2023 Salvatore Sanfilippo -- All Rights Reserved
 * See the LICENSE file for information about the license. */

#include "app.h"

#include <cc1101.h>

/* Read directly from the G0 CC1101 pin, and draw a black or white
 * dot depending on the level. */
void render_view_direct_sampling(Canvas* const canvas, ProtoViewApp* app) {
    if(!app->direct_sampling_enabled) {
        canvas_set_font(canvas, FontSecondary);
        canvas_draw_str(canvas, 2, 9, "Direct sampling is a special");
        canvas_draw_str(canvas, 2, 18, "mode that displays the signal");
        canvas_draw_str(canvas, 2, 27, "captured in real time. Like in");
        canvas_draw_str(canvas, 2, 36, "a old CRT TV. It's very slow.");
        canvas_draw_str(canvas, 2, 45, "Can crash your Flipper.");
        canvas_set_font(canvas, FontPrimary);
        canvas_draw_str(canvas, 14, 60, "To enable press OK");
        return;
    }

    for(int y = 0; y < 64; y++) {
        for(int x = 0; x < 128; x++) {
            bool level = furi_hal_gpio_read(&gpio_cc1101_g0);
            if(level) canvas_draw_dot(canvas, x, y);
            /* Busy loop: this is a terrible approach as it blocks
             * everything else, but for now it's the best we can do
             * to obtain direct data with some spacing. */
            uint32_t x = 250;
            while(x--)
                ;
        }
    }
    canvas_set_font(canvas, FontSecondary);
    canvas_draw_str_with_border(canvas, 36, 60, "Direct sampling", ColorWhite, ColorBlack);
}

/* Handle input */
void process_input_direct_sampling(ProtoViewApp* app, InputEvent input) {
    if(input.type == InputTypePress && input.key == InputKeyOk) {
        app->direct_sampling_enabled = !app->direct_sampling_enabled;
    }
}

/* Enter view. Stop the subghz thread to prevent access as we read
 * the CC1101 data directly. */
void view_enter_direct_sampling(ProtoViewApp* app) {
    if(app->txrx->txrx_state == TxRxStateRx && !app->txrx->debug_timer_sampling) {
        subghz_worker_stop(app->txrx->worker);
    } else {
        raw_sampling_worker_stop(app);
    }
}

/* Exit view. Restore the subghz thread. */
void view_exit_direct_sampling(ProtoViewApp* app) {
    if(app->txrx->txrx_state == TxRxStateRx && !app->txrx->debug_timer_sampling) {
        subghz_worker_start(app->txrx->worker);
    } else {
        raw_sampling_worker_start(app);
    }
    app->direct_sampling_enabled = false;
}


/*
RES = innerProd(MAT);
  Computes mat'*mat
  Odelia Schwartz, 8/97.
*/

#define V4_COMPAT
#include <matrix.h>

#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <strings.h>
#include <stdlib.h>

void mexFunction(int nlhs,           /* Num return vals on lhs */
                 mxArray *plhs[],    /* Matrices on lhs      */
                 int nrhs,           /* Num args on rhs    */
                 const mxArray *prhs[]     /* Matrices on rhs */
                 )
{
   register double *res, *mat, tmp;
   register int len, wid, i, k, j, jlen, ilen, imat, jmat;
   mxArray *arg;

   /* get matrix input argument */
   /* should be matrix in which num rows >= num columns */
   arg=prhs[0];
   mat= mxGetPr(arg);
   len = (int) mxGetM(arg);
   wid = (int) mxGetN(arg);
   if ( wid > len )
     printf("innerProd: Warning: width %d is greater than length %d.\n",wid,len);
   plhs[0] = (mxArray *) mxCreateDoubleMatrix(wid,wid,mxREAL);
   if (plhs[0] == NULL)
     mexErrMsgTxt(sprintf("Error allocating %dx%d result matrix",wid,wid));
   res = mxGetPr(plhs[0]);

   for(i=0, ilen=0; i<wid; i++, ilen+=len)
     {
      for(j=i, jlen=ilen; j<wid; j++, jlen+=len)
         {
   	    tmp = 0.0;
            for(k=0, imat=ilen, jmat=jlen; k<len; k++, imat++, jmat++)
	      tmp += mat[imat]*mat[jmat];
	    res[i*wid+j] = tmp;
            res[j*wid+i] = tmp;
         }
   }
   return;

}


tialised?')
                pass
            #issue with saving settings on successive runs, need some close() function

            ps.set_up_dir("z_up")
            ### Register a mesh
            for m in range(-1,Nmat):
                mat = mat_str[m]
                pts = mats_dict[mat]['pts']
                tris = mats_dict[mat]['tris']
                if m==-1:
                    color = (1,1,1)
                else:
                    color = tuple(npa(mats_dict[mat]['color'])/255.0)

                ps.register_surface_mesh(mat, pts, tris,color=color,edge_color=(0,0,0),edge_width=1)

        else:
            raise

        self.fig = fig

    def show(self,backend='mayavi'):
        if backend == 'mayavi':
            from mayavi import mlab
            mlab.show()
        elif backend == 'polyscope':
            import polyscope as ps
            # View the point cloud and mesh we just registered in the 3D UI
            ps.show()
        else:
            raise

    def print_stats(self):
        rg = self
        self.print(f'npts =  {rg.pts.shape[0]}')
        self.print(f'ntris = {rg.tris.shape[0]}')
        self.print(f'bmin = {rg.bmin}')
        self.print(f'bmax = {rg.bmax}')
        self.print(f'Lxyz = {(rg.bmax-rg.bmin)}')
        self.print(f'bbvol = {np.prod(rg.bmax-rg.bmin):.3f}m³')
        self.print(f'room vol = {rg.vol}m³')
        self.print(f'room SA = {rg.area}m²')
        self.print(f'room Sxyz = {rg.Sxyz}')
        self.print(f'room Rxyz = {rg.Rxyz}')
        for i in range(rg.Nmat):
            self.print(f'mat {i}: {rg.mat_str[i]}, {rg.mat_area[i]:.3f}m²')

def main():
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument('--json', type=str,help='json file to import')
    parser.add_argument('--backend', type=str,help='backend')
    parser.add_argument('--nodraw', action='store_true',help='draw')
    parser.add_argument('--drawnormals', action='store_true',help='draw normals')
    parser.add_argument('--az_el', nargs=2, type=float, help='two angles in deg')
    parser.set_defaults(nodraw=False)
    parser.set_defaults(drawnormals=False)
    parser.set_defaults(json=None)
    parser.set_defaults(backend='mayavi')
    parser.set_defaults(az_el=[0.,0.])

    args = parser.parse_args()

    assert args.json is not None
    assert args.backend in ['mayavi','polyscope']

    print(args)

    room = RoomGeo(args.json,az_el=args.az_el)
    room.print_stats()

    if not args.nodraw:
        room.draw(args.backend,plot_normals=args.drawnormals)
        room.show(args.backend)

if __name__ == '__main__':
    main()


f XPC_CHECK_WRAPPER_THREADSAFETY
    , mThread(PR_GetCurrentThread())
#endif
{
    mIdentity = aIdentity.get();

    NS_ASSERTION(mMaybeProto, "bad ctor param");
    NS_ASSERTION(mSet, "bad ctor param");

    DEBUG_TrackNewWrapper(this);
}

// This ctor is used if this object will NOT have a proto.
XPCWrappedNative::XPCWrappedNative(already_AddRefed<nsISupports> aIdentity,
                                   XPCWrappedNativeScope* aScope,
                                   XPCNativeSet* aSet)

    : mMaybeScope(TagScope(aScope)),
      mSet(aSet),
      mFlatJSObject(INVALID_OBJECT), // non-null to pass IsValid() test
      mScriptableInfo(nsnull),
      mWrapperWord(0)
#ifdef XPC_CHECK_WRAPPER_THREADSAFETY
    , mThread(PR_GetCurrentThread())
#endif
{
    mIdentity = aIdentity.get();

    NS_ASSERTION(aScope, "bad ctor param");
    NS_ASSERTION(aSet, "bad ctor param");

    DEBUG_TrackNewWrapper(this);
}

XPCWrappedNative::~XPCWrappedNative()
{
    DEBUG_TrackDeleteWrapper(this);

    Destroy();
}

void
XPCWrappedNative::Destroy()
{
    XPCWrappedNativeProto* proto = GetProto();

    if(mScriptableInfo &&
       (!HasProto() ||
        (proto && proto->GetScriptableInfo() != mScriptableInfo)))
    {
        delete mScriptableInfo;
        mScriptableInfo = nsnull;
    }

    XPCWrappedNativeScope *scope = GetScope();
    if(scope)
    {
        Native2WrappedNativeMap* map = scope->GetWrappedNativeMap();

        // scoped lock
        XPCAutoLock lock(GetRuntime()->GetMapLock());

        // Post-1.9 we should not remove this wrapper from the map if it is
        // uninitialized.
        map->Remove(this);
    }

    if(mIdentity)
    {
        XPCJSRuntime* rt = GetRuntime();
        if(rt && rt->GetDoingFinalization())
        {
            if(rt->DeferredRelease(mIdentity))
            {
                mIdentity = nsnull;
            }
            else
            {
                NS_WARNING("Failed to append object for deferred release.");
                // XXX do we really want to do this???
                NS_RELEASE(mIdentity);
            }
        }
        else
        {
            NS_RELEASE(mIdentity);
        }
    }

    mMaybeScope = nsnull;
}

// This is factored out so that it can be called publicly
// static
void
XPCWrappedNative::GatherProtoScriptableCreateInfo(
                        nsIClassInfo* classInfo,
                        XPCNativeScriptableCreateInfo& sciProto)
{
    NS_ASSERTION(classInfo, "bad param");
    NS_ASSERTION(!sciProto.GetCallback(), "bad param");

    nsXPCClassInfo *classInfoHelper = nsnull;
    CallQueryInterface(classInfo, &classInfoHelper);
    if(classInfoHelper)
    {
        nsCOMPtr<nsIXPCScriptable> helper =
          dont_AddRef(static_cast<nsIXPCScriptable*>(classInfoHelper));
        JSUint32 flags;
        nsresult rv = classInfoHelper->GetScriptableFlags(&flags);
        if(NS_FAILED(rv))
            flags = 0;

        sciProto.SetCallback(helper.forget());
        sciProto.SetFlags(flags);
        sciProto.SetInterfacesBitmap(classInfoHelper->GetInterfacesBitmap());

        return;
    }

    nsCOMPtr<nsISupports> possibleHelper;
    nsresult rv = classInfo->GetHelperForLanguage(
                                    nsIProgrammingLanguage::JAVASCRIPT,
                                    getter_AddRefs(possibleHelper));
    if(NS_SUCCEEDED(rv) && possibleHelper)
    {
        nsCOMPtr<


-----------------------------
	 * This function provides cortex_a57 specific
	 * register information for crash reporting.
	 * It needs to return with x6 pointing to
	 * a list of register names in ascii and
	 * x8 - x15 having values of registers to be
	 * reported.
	 * ---------------------------------------------
	 */
.section .rodata.cortex_a57_regs, "aS"
cortex_a57_regs:  /* The ascii list of register names to be reported */
	.asciz	"cpuectlr_el1", "cpumerrsr_el1", "l2merrsr_el1", ""

func cortex_a57_cpu_reg_dump
	adr	x6, cortex_a57_regs
	mrs	x8, CORTEX_A57_ECTLR_EL1
	mrs	x9, CORTEX_A57_MERRSR_EL1
	mrs	x10, CORTEX_A57_L2MERRSR_EL1
	ret
endfunc cortex_a57_cpu_reg_dump

declare_cpu_ops_wa cortex_a57, CORTEX_A57_MIDR, \
	cortex_a57_reset_func, \
	check_errata_cve_2017_5715, \
	CPU_NO_EXTRA2_FUNC, \
	cortex_a57_core_pwr_dwn, \
	cortex_a57_cluster_pwr_dwn


  ! 26: STW_R	stw	%r17, [%r3 + %r14]
thr2_ic_err_1:
!ic err IR_NIR
!$EV error(2,expr(@VA(.MAIN.thr2_ic_err_1), 16, 16),1,IC_DATA,IR_NIR,14,21)
	.word 0xe8412314  ! 26: LDSW_I	ldsw	[%r4 + 0x0314], %r20
	.word 0xe6312b96  ! 28: STH_I	sth	%r19, [%r4 + 0x0b96]
	.word 0xe47126b0  ! 28: STX_I	stx	%r18, [%r4 + 0x06b0]
	.word 0xfa32000c  ! 28: STH_R	sth	%r29, [%r8 + %r12]
	.word 0xf2292911  ! 29: STB_I	stb	%r25, [%r4 + 0x0911]
thr2_ic_err_2:
!ic err IR
!$EV error(2,expr(@VA(.MAIN.thr2_ic_err_2), 16, 16),1,IC_DATA,IR,24,x)
thr2_dc_err_1:
!$EV error(2,expr(@VA(.MAIN.thr2_dc_err_1), 16, 16),1,DC_DATA,53)
	.word 0xf0598009  ! 30: LDX_R	ldx	[%r6 + %r9], %r24
	ta T_CHANGE_NONPRIV !To allow ASI writes to D-I caches
	.word 0xf7f1200d  ! 32: CASXA_R	casxa	[%r4]%asi, %r13, %r27
	.word 0xa818e035  ! 34: XOR_I	xor 	%r3, 0x0035, %r20
	.word 0xfc31e1de  ! 35: STH_I	sth	%r30, [%r7 + 0x01de]
thr2_resum_intr_2:
!$EV trig_pc_d(2,expr(@VA(.MAIN.thr2_resum_intr_2), 16, 16)) -> intp(1, 3, 1)
	ta T_CHANGE_NONHPRIV !To allow ASI writes to D-I caches
	ta T_CHANGE_HPRIV !To allow ASI writes to D-I caches
	.word 0xe470e418  ! 38: STX_I	stx	%r18, [%r3 + 0x0418]
thr2_irf_ce_3:
!$EV error(2,expr(@VA(.MAIN.thr2_irf_ce_3), 16, 16), 1,IRF,ce,14,x, x,x,x, x,x,x)
	.word 0xfe21c00d  ! 39: STW_R	stw	%r31, [%r7 + %r13]
thr2_irf_ce_4:
!$EV error(2,expr(@VA(.MAIN.thr2_irf_ce_4), 16, 16), 1,IRF,ce,3,x, x,x,x, x,x,x)
	.word 0xe258e298  ! 39: LDX_I	ldx	[%r3 + 0x0298], %r17
	.word 0xfc21800b  ! 41: STW_R	stw	%r30, [%r6 + %r11]
	.word 0xf429c00e  ! 41: STB_R	stb	%r26, [%r7 + %r14]
	.word 0xe018e920  ! 41: LDD_I	ldd	[%r3 + 0x0920], %r16
	.word 0xfcb9abb8  !


-webkit-mask-image: var(--icon-Lock);
}

.field_clip.field-error-U {
  color: #6363a2;
  background-color: unset;
}

.field_clip.field-error-S {
  color: #aaa;
  background-color: unset;
}

/* Insert a zero-width space into each cell, to size cells to at least one line of text. */
.field_clip:empty::before { content: '\200B'; }

@media not print {
.selected_cursor {
  position: absolute;
  left: 0px;
  top: 0px;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.active_cursor {
  /* one pixel outline around the cell, and one inside the cell */
  outline: 1px solid var(--grist-theme-cursor, var(--grist-color-cursor));
  box-shadow: inset 0 0 0 1px var(--grist-theme-cursor, var(--grist-color-cursor));
  z-index: 1;
}
}

.column_name {
  color: var(--grist-header-color,
         var(--grist-theme-table-header-fg), unset);
  background-color: var(--grist-header-background-color,
                    var(--grist-theme-table-header-bg,
                    var(--grist-color-light-grey)));
  text-align: center;
  cursor: pointer;
  /* Column headers always show vertical gridlines, to make it clear how to resize them */
  border-right-color: var(--grist-theme-table-header-border, lightgray);
}

.column_names.record {
  border-left-color: var(--grist-theme-table-header-border, lightgray);
}

.column_name.selected > .selection {
  background-color: var(--grist-theme-selection-header);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gridview_data_row_num.selected {
  color: var(--grist-theme-table-header-selected-fg, unset);
  background-color: var(--grist-theme-table-header-selected-bg, var(--grist-color-medium-grey-opaque));
}

.link_selector_row > .gridview_data_row_num {
  color: var(--grist-theme-left-panel-active-page-fg, white);
  background-color: var(--grist-theme-left-panel-active-page-bg, var(--grist-color-dark-bg));
}

.link_selector_row > .record::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: var(--grist-theme-selection, var(--grist-color-selection));
  /* z-index should be higher than '.record .field.frozen' (10) to show for frozen columns,
   * but lower than '.gridview_stick-top' (20) to stay under column headers. */
  z-index: 15;
}

.gridview_data_row_info.linked_dst::before {
  position: absolute;
  content: '\25B8';
  text-align: left;
  left: 7px;
}

.text_wrapping {
  word-break: break-word;
  white-space: pre-wrap;
}

.diff-local, .diff-local-add {
  background-color: #dfdfff;
  --grist-diff-background-color: #dfdfff;
  --grist-diff-color: black;
}

.diff-parent, .diff-remote-remove {
  background-color: #ffdfdf;
  --grist-diff-background-color: #ffdfdf;
  --grist-diff-color: black;
  text-decoration: line-through;
}

.diff-local-remove {
  background-color: #dfdfdf;
  --grist-diff-backgroun


		-- 生存本能
	[27827] = true,		-- 救赎之魂
	[31224] = true,		-- 暗影斗篷
	[33206] = true,		-- 痛苦压制
	[45438] = true,		-- 冰箱
	[47585] = true,		-- 消散
	[47788] = true,		-- 守护之魂
	[48792] = true,		-- 冰封之韧
	[86659] = true,		-- 远古列王守卫
	[102342] = true,	-- 铁木树皮
	[102558] = true,	-- 熊化身
	[104773] = true,	-- 不灭决心
	[108271] = true,	-- 星界转移
	[110909] = true,	-- 操控时间
	[115203] = true,	-- 壮胆酒
	[116849] = true,	-- 作茧缚命
	[118038] = true,	-- 剑在人在
	[160029] = true,	-- 正在复活
	[186265] = true,	-- 灵龟守护
	[196555] = true,	-- 虚空行走
	[204018] = true,	-- 破咒祝福
	[204150] = true,	-- 圣光护盾
	[264735] = true,	-- 优胜劣汰
	[281195] = true,	-- 优胜劣汰
	[374348] = true,	-- 新生光焰
	[363916] = true,	-- 黑曜鳞片
}


                        }
                    },
                    Sign::Zero => {}
                }
            }
        },
    }
}
<reponame>JohanVikman/advent2020<gh_stars>0
use std::fs::File;
use std::io::Read;
//use std::str::Chars;
//use regex::Regex;
use std::convert::TryInto;

#[derive(PartialEq, Clone, Copy)]
enum MapSymbol {
    Tree,
    Empty,
}

pub struct Map {
    map: Vec<Vec<MapSymbol>>,
    linelength: u32,
}

impl Map {
    pub fn new(contents: &str) -> Map{
        let mut map: Vec<Vec<MapSymbol>> = Vec::new();
        let mut linelength = 0;
        for line in contents.lines() {
            if linelength == 0 {
                linelength = line.len().try_into().unwrap();
            }
            map.push(line.chars().map( |c|
                if c == '#' {MapSymbol::Tree}
                else {MapSymbol::Empty}).collect::<Vec<MapSymbol>>());
            }
        println!("Pushed {} onto map", map.len());
        Map{
            map: map,
            linelength: linelength,
        }
    }

    pub fn count_trees(&mut self, xstep: u32, ystep: u32) -> u32 {
        let mut x = 0;
        let mut y = 0;
        let mut ntrees = 0;
        for row in &self.map {
            if y == 0 {
                if row[(x % self.linelength) as usize] == MapSymbol::Tree
                    {
                        ntrees += 1;
                    }
            y = ystep;
            x += xstep;
            }
            y -= 1;
        }
        return ntrees;
    }
}

pub fn run() {
    let mut f = File::open("priv/day3input.txt").expect("File not found");
    let mut contents = String::new();
    f.read_to_string(&mut contents).expect("Something went wrong ");

    let mut map = Map::new(&contents);

    println!("Part1: N trees are {}", map.count_trees(3, 1));

//Part 2:
    let part2trees = map.count_trees(1,1) * map.count_trees(3,1) *
        map.count_trees(5,1) * map.count_trees(7, 1) *
        map.count_trees(1, 2);
    println!("Part2: Valid passwords {}", part2trees);
}
<filename>src/lib.rs<gh_stars>1-10
#![no_std]
#![warn(clippy::all, clippy::pedantic, rust_2018_idioms)]
#![allow(clippy::module_name_repetitions)]

use core::cmp::{Ord, Ordering, PartialOrd};
use core::fmt;
use core::hash::{Hash, Hasher};
use core::marker::PhantomData;

mod group;
pub use group::{array_group, group, ArrayFieldGroup, FieldGroup};

// This is a hack! It's not meant to be used by users, and may be removed without warning if a
// better method to do this appears!
// It has to be public to be used by the macros. Theoretically it could be embedded in the macros,
// but I don't want to create a trait and a type for every macro invocation, I want it to be as
// cheap as possible for better compile times.
#[doc(hidden)]
pub trait AmbiguousIfDeferIsImpl<A> {
    fn some_item(&self) {}
}

impl<T: ?Sized> AmbiguousIfDeferIsImpl<()> for *const T {}
impl<T: ?Sized + core::ops::Deref> AmbiguousIfDeferIsImpl<u8> for *const T {}

/// This creates a [`Field`] to a field of a type. The type cannot implement [`Deref`](core::ops::Deref), because deref can run arbitrary
/// code, which would mean that the method this library uses to reference fields isn't guar


scene.cameraFollowSprite(Jared)
Jared.ay = 55
Trampo = sprites.create(img`
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . a a b b b b b b b b a a . .
    . . a a 1 f 1 f 1 f 1 f a a . .
    . . a a f 1 f 1 f 1 f 1 a a . .
    . . a a b b b b b b b b a a . .
    . . a a . . . . . . . . a a . .
    . . a a . . . . . . . . a a . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
`, SpriteKind.Trampoline)
Jared.setPosition(300, 450)
Trampo.setPosition(300, 520)
let EvilDude = sprites.create(img`
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . 2 . . . . . . . . 2 . . .
    . . . 2 2 . . . . . . 2 2 . . .
    . . . 2 2 2 . . . . 2 2 2 . . .
    . . 2 2 2 2 2 2 2 2 2 2 2 2 . .
    . . 2 f f f 2 2 f f f f 2 2 . .
    . 2 2 2 f 2 2 2 2 f 2 2 2 2 2 .
    . 2 2 2 f 2 2 2 2 f 2 2 2 2 2 .
    . 2 2 2 2 2 2 2 2 2 2 2 2 2 . .
    4 2 2 2 f f f f f f 2 2 2 2 . .
    4 4 2 2 2 2 2 2 2 2 2 2 2 2 . .
    4 4 4 . . 2 2 2 2 2 2 2 . . . .
    . 4 4 4 2 . 2 2 2 2 2 2 2 . . .
    . . 4 4 2 2 2 2 2 2 2 2 2 2 . .
`, SpriteKind.Enemy)
EvilDude.setPosition(300, 670)
EvilDude.follow(Jared, 90)
let RocketPack = sprites.create(img`
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . .
    . . . f f f f f f f f f f . . .
    . . 4 4 c b b b b b b c 4 4 . .
    . . 4 4 b c b b b b c b 4 4 . .
    . . 4 4 b c b b b b c b 4 4 . .
    . . 4 4 b c b b b b c b 4 4 . .
    . . 4 4 b c b b b b c b 4 4 . .
    . . 4 4 b c b b b b c b 4 4 . .
    . . 4 4 b c b b b b c b 4 4 . .
    . . 4 4 c b b b b b b c 4 4 . .
    . . 2 2 . f f f f f f . 2 2 . .
    . . 2 2 . . . . . . . . 2 2 . .
`, SpriteKind.Food)
RocketPack.setPosition(550, 520)
info.startCountdown(60)
// Every time the game loads
game.onUpdate(function () {
    Jared.x += controller.dx()
})
import { Component, OnInit,
        Input,Output, EventEmitter } from '@angular/core';
import { Monster } from 'src/app/models/monster';
import { Spell } from 'src/app/models/spell';
@Component({
  selector: 'app-monster-form',
  templateUrl: './monster-form.component.html',
  styleUrls: ['./monster-form.component.css']
})
export class MonsterFormComponent implements OnInit {

  @Input() formObject: Mons


m-text-margin-left: 30px;
--bt-simple-sidebar-item-text-margin-top: -22px;
}
/* BTSection My Channel */
html[sidebar-style^="hitchhiker"][my-channel-btn="true"] {
/* outer */
--bt-my-channel-button-display: flex;
--bt-simple-sidebar-item-position: relative;
--bt-simple-sidebar-item-width: 186px;
--bt-simple-sidebar-item-height: 28px;
--bt-simple-sidebar-item-border: none;
--bt-simple-sidebar-item-margin-left: 10px;
/* inner */
--bt-simple-sidebar-item-inner-text-decoration: none;
--bt-simple-sidebar-item-inner-padding: 0 9px;
--bt-simple-sidebar-item-inner-margin: auto 0;
--bt-simple-sidebar-item-inner-height: 24px;
--bt-simple-sidebar-item-inner-width: 100%;
--bt-simple-sidebar-item-inner-font-size: 13px;
--bt-simple-sidebar-item-text-color: var(--yt-spec-text-primary);
/*  hover */
--bt-simple-sidebar-item-background-hover: var(--bt-sidebar-item-bg-hover);
--bt-simple-sidebar-item-inner-text-color-hover: #fff;
--bt-simple-sidebar-item-icon-bg-hover: no-repeat url(https://s.ytimg.com/yts/imgbin/www-hitchhiker-vflvB63an.png) 0px -1081px;
/* og icon */
--bt-simple-sidebar-item-icon-outline-display: inline-block;
--bt-simple-sidebar-item-icon-display: inline-block;
--bt-simple-sidebar-item-icon-bg: no-repeat url(https://s.ytimg.com/yts/imgbin/www-hitchhiker-vflvB63an.png) -71px -675px;
--bt-simple-sidebar-item-icon-margin-top: 2px;
--bt-simple-sidebar-item-icon-width: 20px;
--bt-simple-sidebar-item-icon-height: 20px;
--bt-simple-sidebar-item-svg-display: none;
/* text */
--bt-simple-sidebar-item-text-display: block;
--bt-simple-sidebar-item-text-margin-left: 30px;
--bt-simple-sidebar-item-text-margin-top: -22px;
}
html[sidebar-style^="hitchhiker-2013"][my-channel-btn="true"] {
--bt-simple-sidebar-item-margin-left: 0px;
--bt-simple-sidebar-item-text-margin-left: 0px;
--bt-simple-sidebar-item-text-margin-top: 4px;
}
html[sidebar-style="polymer-2019"] {
  --bt-sidebar-bg: var(--bt-guide-background);
  --bt-sidebar-width: 240px;
  --bt-sidebar-border-right: none;
  --bt-sidebar-section-padding: 0;
  --bt-sidebar-section-border-top: 1px solid var(--yt-spec-10-percent-layer);
  --bt-sidebar-section-margin-top: 10px;
  --bt-sidebar-section-margin-bottom: 10px;
  --bt-sidebar-section-padding-top: 10px;
  --bt-sidebar-first-section-padding-top: 12px;
  --bt-sidebar-non-item-text-color: var(--yt-spec-text-secondary);
  --bt-sidebar-non-item-text-transform: uppercase;
  --bt-sidebar-non-item-font-size: 1.4rem;
  --bt-sidebar-non-item-font-weight: 500;
  --bt-sidebar-non-item-padding: 10px 20px 4px;
  --bt-sidebar-item-height: 40px;


}.x4-strict .x4-ie7 .x4-btn-default-large-tl,.x4-strict .x4-ie7 .x4-btn-default-large-bl{position:relative;right:0}.x4-btn-default-large:after{display:none;content:"x-slicer:stretch:bottom, frame-bg:url(images/btn/btn-default-large-fbg.gif), bg:url(images/btn/btn-default-large-bg.gif), corners:url(images/btn/btn-default-large-corners.gif), sides:url(images/btn/btn-default-large-sides.gif)"}.x4-btn-default-large .x4-btn-inner{font-size:11px;font-weight:normal;font-family:tahoma,arial,verdana,sans-serif;color:#333;padding:0 3px}.x4-btn-default-large .x4-btn-arrow{background-image:url(images/button/arrow.gif)}.x4-btn-default-large .x4-btn-arrow-right{padding-right:12px}.x4-btn-default-large .x4-rtl.x4-btn-arrow-right{padding-right:0;padding-left:12px}.x4-btn-default-large .x4-btn-arrow-bottom{padding-bottom:12px}.x4-btn-default-large .x4-btn-glyph{font-size:32px;line-height:32px;color:#333;opacity:.5}.x4-ie8m .x4-btn-default-large .x4-btn-glyph{color:#999}.x4-btn-default-large-disabled{border-color:#e1e1e1;background-image:none;background-color:#f7f7f7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#f7f7f7),color-stop(48%,#f1f1f1),color-stop(52%,#dadada),color-stop(100%,#dfdfdf));background-image:-webkit-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:-moz-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:-o-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf)}.x4-btn-default-large-icon .x4-btn-button,.x4-btn-default-large-noicon .x4-btn-button{height:32px}.x4-btn-default-large-icon .x4-btn-inner,.x4-btn-default-large-noicon .x4-btn-inner{line-height:32px}.x4-btn-default-large-icon .x4-btn-arrow-right .x4-btn-inner,.x4-btn-default-large-noicon .x4-btn-arrow-right .x4-btn-inner,.x4-btn-default-large-icon-text-left .x4-btn-arrow-right .x4-btn-inner{padding-right:0}.x4-btn-default-large-icon .x4-btn-arrow-right .x4-rtl.x4-btn-inner,.x4-btn-default-large-noicon .x4-btn-arrow-right .x4-rtl.x4-btn-inner,.x4-btn-default-large-icon-text-left .x4-btn-arrow-right .x4-rtl.x4-btn-inner{padding-right:3px;padding-left:0}.x4-btn-default-large-icon .x4-btn-inner{width:32px;padding:0}.x4-btn-defau


ge:cometchat_uikit_shared/cometchat_uikit_shared.dart';
import 'package:flutter/material.dart';

class VideoBubbleSample extends StatelessWidget {
  const VideoBubbleSample({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('CometChatVideoBubble'),
      ),
      body: SingleChildScrollView(

          child:Center(
            // child: CometChatTextBubble(
            //   alignment: BubbleAlignment.right,
            //   width: 216,
            //   text: "I’m really looking forward to catching up with you soon. There’s so much I can’t wait to share and discuss. See you soon, and until then, take care!",
            // ),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                CometChatMessageBubble(
                  alignment: BubbleAlignment.right,
                  height: 400,
                  width: 300,
                  contentView:
                  CometChatVideoBubble(
                    height: 400,
                    videoUrl:"https://videos.pexels.com/video-files/17648574/17648574-hd_1080_1920_30fps.mp4"
                   // imageUrl: "https://images.unsplash.com/photo-1724190500687-52df2556aabf?q=80&w=2075&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
                  ),
                  // statusInfoView: CometChatReceipt(status: ReceiptStatus.delivered),
                  // statusInfoView: CometChatDate(
                  //   date: DateTime.now(),
                  // ),
                ),
              ],
            ),
          )
      ),
    );
  }
}
import 'package:flutter/material.dart';
import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  /// This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      localizationsDelegates: [
        Translations.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate
      ],
      supportedLocales: [
        Locale('en', ''),
        Locale('hi', ''),
        Locale('ar', ''),
        Locale('de', ''),
        Locale('es', ''),
        Locale('fr', ''),
        Locale('ms', ''),
        Locale('pt', ''),
        Locale('ru', ''),
        Locale('sv', ''),
        Locale('zh', ''),
      ],
      title: 'Flutter Demo',
      home: Home(),
    );
  }
}

class Home extends StatefulWidget {
  const Home({Key? key}) : super(key: key);

  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  final String appId = "APP_ID"; //Replace with your app id
  static const String authKey = "AUTH_KEY"; //Replace with your auth key";
  static const String region = "us"; ////Replace with your Region code ";

  bool isLoading = true;

  @override
  void initState() {
    super.initState();

    initializeCometChat();
  }

  initializeCometChat() async {
    //CometChat SDk should be initialized at the start of application. No need to initialize it again
    UIKitSettings uiKitSettings = (UIKitSettingsBuilder()
          ..subscriptionType =


case 404:
                    Toast({
                        message: '网络请求不存在',
                        duration: 1500,
                        forbidClick: true
                    });
                    break;
                // 其他错误，直接抛出错误提示
                default:
                    Toast({
                        message: error.response.data.message,
                        duration: 1500,
                        forbidClick: true
                    });
            }
            return Promise.reject(error.response);
        }
    }
});

/**
 * 封装get方法
 * @param url
 * @param data
 * @returns {Promise}
 */

export function fetch(url,params={}){
  return new Promise((resolve,reject) => {
    axios.get(url,{
      params:params
    })
    .then(response => {
      resolve(response.data);
    })
    .catch(err => {
      reject(err)
    })
  })
}

/**
 * 封装post请求
 * @param url
 * @param data
 * @returns {Promise}
 */

 export function post(url,data = {}){
   return new Promise((resolve,reject) => {
     axios.post(url,data)
          .then(response => {
            resolve(response.data);
          },err => {
            reject(err)
          })
   })
 }

 /**
 * 封装patch请求
 * @param url
 * @param data
 * @returns {Promise}
 */

export function patch(url,data = {}){
  return new Promise((resolve,reject) => {
    axios.patch(url,data)
         .then(response => {
           resolve(response.data);
         },err => {
           reject(err)
         })
  })
}

 /**
 * 封装put请求
 * @param url
 * @param data
 * @returns {Promise}
 */

export function put(url,data = {}){
  return new Promise((resolve,reject) => {
    axios.put(url,data)
         .then(response => {
           resolve(response.data);
         },err => {
           reject(err)
         })
  })
}

import * as uuid from 'uuid'

import { WatchItem } from '../models/WatchItem'
import { WatchItemUpdate } from '../models/WatchItemUpdate'
import { WatchItemRefresh } from '../models/WatchItemRefresh'
import { WatchItemInfoProvider } from '../models/WatchItemInfoProvider'
import { DbAccess } from '../dataLayer/dbAccess'
import { CreateWatchItemRequest } from '../requests/CreateWatchItemRequest'
import { UpdateWatchItemRequest } from '../requests/UpdateWatchItemRequest'

import { YahooFinanceInfoProvider } from './infoProviders'

export async function getWatchItems(
  userId: string
) : Promise<WatchItem[]> {
  const dbAccess = new DbAccess()
  return dbAccess.getWatchItems(userId)
}

export async function createWatchItem(
  createWatchItemRequest: CreateWatchItemRequest,
  userId: string
) : Promise<WatchItem> {

  const ticker = createWatchItemRequest.ticker

  const watchItemInfoProvider = createWatchItemInfoProvider()
  const itemInfo = await watchItemInfoProvider.getInfo(ticker)

  const dbAccess = new DbAccess()
  return await dbAccess.createWatchItem({
    userId: userId,
    watchId: uuid.v4(),
    ticker: ticker,
    alertPrice: null,
    alertTriggered: false,
    previousPrice: null,
    description: itemInfo.description,
    price: itemInfo.price,
    currency: itemInfo.currency,
    timeStamp: itemInfo.timeStamp
  })
}

export async function updateWatchItem(
  updateWatchItemRequest: UpdateWatchItemRequest,
  userId: string,
  watchId: string
) : Promise<WatchItem> {
  const dbAccess = new DbAccess()

  const itemExists = await dbAccess.


        put(51, "3");
        put(52, "4");
        put(53, "5");
        put(54, "6");
        put(55, "7");
        put(56, "8");
        put(57, "9");
        put(58, ":");
        put(59, ";");
        put(60, "<");
        put(61, "=");
        put(62, ">");
        put(63, "?");
        put(64, "@");
        put(65, "A");
        put(66, "B");
        put(67, "C");
        put(68, "D");
        put(69, "E");
        put(70, "F");
        put(71, "G");
        put(72, "H");
        put(73, "I");
        put(74, "J");
        put(75, "K");
        put(76, "L");
        put(77, "M");
        put(78, "N");
        put(79, "O");
        put(80, "P");
        put(81, "Q");
        put(82, "R");
        put(83, "S");
        put(84, "T");
        put(85, "U");
        put(86, "V");
        put(87, "W");
        put(88, "X");
        put(89, "Y");
        put(90, "Z");
        put(91, "[");
        put(92, "\\");
        put(93, "]");
        put(94, "^");
        put(95, "_");
        put(96, "`");
        put(97, "a");
        put(98, "b");
        put(99, "c");
        put(100, "d");
        put(101, "e");
        put(102, "f");
        put(103, "g");
        put(104, "h");
        put(105, "i");
        put(106, "j");
        put(107, "k");
        put(108, "l");
        put(109, "m");
        put(110, "n");
        put(111, "o");
        put(112, "p");
        put(113, "q");
        put(114, "r");
        put(115, "s");
        put(116, "t");
        put(117, "u");
        put(118, "v");
        put(119, "w");
        put(120, "x");
        put(121, "y");
        put(122, "z");
        put(123, "{");
        put(124, "|");
        put(125, "}");
        put(126, "~");
        put(161, "\u00a1");
        put(162, "\u00a2");
        put(163, "\u00a3");
        put(164, "\u00a4");
        put(165, "\u00a5");
        put(166, "\u00a6");
        put(167, "\u00a7");
        put(168, "\u00a8");
        put(169, "\u00a9");
        put(170, "\u00aa");
        put(171, "\u00ab");
        put(172, "\u00ac");
        put(174, "\u00ae");
        put(175, "\u00af");
        put(176, "\u00b0");
        put(177, "\u00b1");
        put(178, "\u00b2");
        put(179, "\u00b3");
        put(180, "\u00b4");
        put(181, "\u00b5");
        put(182, "\u00b6");
        put(183, "\u00b7");
        put(184, "\u00b8");
        put(185, "\u00b9");
        put(186, "\u00ba");
        put(187, "\u00bb");
        put(188, "\u00b


_v1530.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1530->pack(bref));
      }
      if (cqi_report_cfg_v1530.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1530->pack(bref));
      }
      if (ant_info_v1530.is_present()) {
        HANDLE_CODE(ant_info_v1530->pack(bref));
      }
      if (csi_rs_cfg_v1530.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1530->pack(bref));
      }
      if (ul_pwr_ctrl_ded_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_v1530->pack(bref));
      }
      if (semi_static_cfi_cfg_r15.is_present()) {
        HANDLE_CODE(semi_static_cfi_cfg_r15->pack(bref));
      }
      if (blind_pdsch_repeat_cfg_r15.is_present()) {
        HANDLE_CODE(blind_pdsch_repeat_cfg_r15->pack(bref));
      }
    }
    if (group_flags[11]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(spucch_cfg_v1550.is_present(), 1));
      if (spucch_cfg_v1550.is_present()) {
        HANDLE_CODE(spucch_cfg_v1550->pack(bref));
      }
    }
    if (group_flags[12]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pdsch_cfg_ded_v1610.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_ded_v1610.is_present(), 1));
      HANDLE_CODE(bref.pack(ce_csi_rs_feedback_r16_present, 1));
      HANDLE_CODE(bref.pack(res_reserv_cfg_ded_dl_r16.is_present(), 1));
      HANDLE_CODE(bref.pack(res_reserv_cfg_ded_ul_r16.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_add_r16.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_add_srs_r16.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_virtual_cell_id_r16.is_present(), 1));
      HANDLE_CODE(bref.pack(wideband_prg_r16.is_present(), 1));
      if (pdsch_cfg_ded_v1610.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1610->pack(bref));
      }
      if (pusch_cfg_ded_v1610.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1610->pack(bref));
      }
      if (res_reserv_cfg_ded_dl_r16.is_present()) {
        HANDLE_CODE(res_reserv_cfg_ded_dl_r16->pack(bref));
      }
      if (res_reserv_cfg_ded_ul_r16.is_present()) {
        HANDLE_CODE(res_reserv_cfg_ded_ul_r16->pack(bref));
      }
      if (srs_ul_cfg_ded_add_r16.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_add_r16->pack(bref));
      }
      if (ul_pwr_ctrl_add_srs_r16.is_present()) {


 1.476-.708 3.023-.018 4.5.782 1.69 3.223 1.88 4.114-.23.31-.732.57-3.206-.371-4.482-.498-.685-1.242-1.01-1.955-.975zm-8.44 4.01a.42.42 0 00-.222.004c-1.098.21-2.218.382-3.316.64-.54.122-.909.52-.89 1.127.03 1.07 1.178 1.158 1.515 1.215 1.867.017 3.106-1.127 3.043-2.568-.013-.168.02-.366-.13-.418zm-6.575 5.992c.16-.025.355.031.51.031 6.202-.019 12.218-.025 18.42-.006.318 0 .777-.207.777.463 0 .708-.52.465-.834.465l-18.33.008c-.347 0-.853.225-.834-.502.01-.326.132-.434.291-.46z"/></svg>';
  static const String affiliatetheme =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path fill="currentColor" d="M12.104 5c-1.867.016-4.728 1.95-7.067 4.955-2.879 3.7-3.89 7.604-2.256 8.74 1.634 1.126 5.303-.962 8.182-4.66 2.879-3.699 3.89-7.602 2.256-8.728-.307-.211-.685-.31-1.115-.307zm17.88 6c-3.8 6.359-9.896 9.542-13.625 7.266-1.284-.786-2.074-2.451-2.365-4.266-1.976 3.66-5.786 6.903-9.994 8 2.681 3.188 6.838 5 11.314 5 8.087 0 14.647-6.622 14.647-14.799.01-.459.066-.764.023-1.201z"/></svg>';
  static const String air_freshener =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path fill="currentColor" d="M16 2c-1.654 0-3 1.346-3 3 0 .854.363 1.621.938 2.168L9.056 14h2.076l-4 6H15v2H9v6h14v-6h-6v-2h7.867l-4-6h2.076l-4.879-6.832A2.986 2.986 0 0019 5c0-1.654-1.346-3-3-3zm0 2c.552 0 1 .449 1 1a.999.999 0 01-.59.906l-.076.028A.979.979 0 0116 6a.979.979 0 01-.334-.066l-.076-.028A.999.999 0 0115 5c0-.551.448-1 1-1zm-.193 3.992c.038.003.076 0 .115 0 .026 0 .051.008.078.008.027 0 .052-.007.078-.008.04 0 .078.003.117 0L19.057 12h-1.924l4 6H10.867l4-6h-1.924l2.864-4.008zM11 24h10v2H11v-2z"/></svg>';
  static const String airbnb =
      '<svg xmlns="http://www.w3.org/2000/svg" x


is_err());

        let circuit_1 =
            build_lc_circuit([-F::from(98973u32), F::from(4u32), F::zero(), F::from(79u32)])?;
        let circuit_2 = build_lc_circuit([F::one(), F::zero(), F::from(6u32), -F::from(9u32)])?;
        test_variable_independence_for_circuit(circuit_1, circuit_2)?;

        Ok(())
    }

    fn build_lc_circuit<F: PrimeField>(wires_in: [F; 4]) -> Result<PlonkCircuit<F>, PlonkError> {
        let mut circuit: PlonkCircuit<F> = PlonkCircuit::new_turbo_plonk();
        let wires_in: Vec<_> = wires_in
            .iter()
            .map(|val| circuit.create_variable(*val).unwrap())
            .collect();
        let coeffs = [F::from(2u32), F::from(3u32), F::from(5u32), F::from(2u32)];
        circuit.lc(&wires_in.try_into().unwrap(), &coeffs)?;
        circuit.finalize_for_arithmetization()?;
        Ok(circuit)
    }

    #[test]
    fn test_mul_add() -> Result<(), PlonkError> {
        test_mul_add_helper::<FqEd254>()?;
        test_mul_add_helper::<FqEd377>()?;
        test_mul_add_helper::<FqEd381>()?;
        test_mul_add_helper::<Fq377>()
    }

    fn test_mul_add_helper<F: PrimeField>() -> Result<(), PlonkError> {
        let mut circuit = PlonkCircuit::<F>::new_turbo_plonk();
        let wire_in_1: Vec<_> = [
            F::from(23u32),
            F::from(8u32),
            F::from(1u32),
            -F::from(20u32),
        ]
        .iter()
        .map(|val| circuit.create_variable(*val).unwrap())
        .collect();
        let wire_in_2: Vec<_> = [F::one(), -F::from(8u32), F::one(), F::one()]
            .iter()
            .map(|val| circuit.create_variable(*val).unwrap())
            .collect();
        let q_muls = [F::from(3u32), F::from(5u32)];
        let y_1 = circuit.mul_add(&wire_in_1.try_into().unwrap(), &q_muls)?;
        let y_2 = circuit.mul_add(&wire_in_2.try_into().unwrap(), &q_muls)?;

        // 3 * (23 * 8) + 5 * (1 * -20) = 452
        assert_eq!(circuit.witness(y_1)?, F::from(452u32));
        // 3 * (1 * -8) + 5 * (1 * 1)= -19
        assert_eq!(circuit.witness(y_2)?, -F::from(19u32));
        assert!(circuit.check_circuit_satisfiability(&[]).is_ok());
        *circuit.witness_mut(y_1) = F::from(34u32);
        assert!(circuit.check_circuit_satisfiability(&[]).is_err());
        // Check variable out of bound error.
        assert!(circuit
            .mul_add(&[0, 1, 1, circuit.num_vars()], &q_muls)
            .is_err());

        let circuit_1 =
            build_mul_add_circuit([-F::from(98973u32), F::from(4u32), F::zero(), F::from(79u32)])?;
        let circuit_2 =
            build_mul_add_circuit([F::one(), F::zero(), F::from(6u32), -F::from(9u32)])?;
        test_variable_independence_for_circuit(circuit_1, circuit_2)?;

        Ok(())
    }

    fn build_mul_add_circuit<F: PrimeField>(
        wires_in: [F; 4],
    ) -> Result<


/**
     * 添加书签并持久化保存
     * @param name 书签名称，如果为空或空白字符串，则使用当前路径最后一个组件作为名称
     */
    fun addBookmark(name: String? = null) {
        val currentPath = directoryPath.joinToString("/")
        // 如果未提供名称或名称为空，使用当前路径最后一个组件作为书签名
        val bookmarkName = if (name.isNullOrBlank()) {
            // 如果路径为空，使用"根目录"作为名称
            if (directoryPath.isEmpty()) {
                "根目录"
            } else {
                // 否则使用路径的最后一个组件
                directoryPath.last()
            }
        } else {
            name
        }

        val bookmark = Bookmark(bookmarkName, currentPath)
        _bookmarks.add(bookmark)
        saveBookmarks()
    }

    /**
     * 删除书签并持久化保存
     */
    fun removeBookmark(bookmark: Bookmark) {
        _bookmarks.remove(bookmark)
        saveBookmarks()
    }

    /**
     * 导航到书签的路径
     */
    fun navigateToBookmark(bookmark: Bookmark) {
        directoryPath.clear()
        directoryPath.addAll(bookmark.path.split("/").filter { it.isNotEmpty() })
        loadFiles()
    }

    // 自动检测文件编码
    private fun detectEncoding(file: File): String {
        val detector = UniversalDetector(null)
        file.inputStream().use { input ->
            val buffer = ByteArray(4096)
            var nread: Int
            while (input.read(buffer).also { nread = it } > 0) {
                detector.handleData(buffer, 0, nread)
            }
        }
        detector.dataEnd()
        return detector.detectedCharset ?: "UTF-8"
    }

    private fun checkForUpdates() {
        coroutineScope.launch {
            try {
                val latestRelease = withContext(Dispatchers.IO) {
                    val response = URL("https://api.github.com/repos/$GITHUB_URL/releases/latest").readText()
                    Json.decodeFromString<GitHubRelease>(response)
                }

                // 比较版本号
                val currentVersion = VERSION.replace("v", "")
                val latestVersion = latestRelease.tag_name.replace("v", "")

                if (isNewerVersion(latestVersion, currentVersion)) {
                    _updateInfo.value = UpdateInfo(
                        version = latestRelease.tag_name,
                        releaseNotes = latestRelease.body,
                        downloadUrl = latestRelease.html_url
                    )
                    _showUpdateDialog.value = true
                }
            } catch (e: Exception) {
                // 处理检查更新失败的情况
            }
        }
    }

    private fun isNewerVersion(latest: String, current: String): Boolean {
        val latestParts = latest.split(".").map { it.toInt() }
        val currentParts = current.split(".").map { it.toInt() }

        for (i in 0 until minOf(latestParts.size, currentParts.size)) {
            if (latestParts[i] > currentParts[i]) return true
            if (latestParts[i] < currentParts[i]) return false
        }

        return latestParts.size > currentParts.size
    }

    fun dismissUpdateDialog() {
        _showUpdateDialog.value = false
    }
}

/**
 * 排序类型枚举
 */
enum class SortType(val displayName: String) {
    TYPE_ASC("类型 (文件夹优先)"),
    TYPE_DESC("类型 (文件优先)"),
    NAME_ASC("


 = (_index + 1) % _prompts.length;
      });
    });
  }

  @override
  void dispose() {
    _timer.cancel();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return FractionallySizedBox(
      widthFactor: 1,
      child: SectionFrame(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            const Spacer(
              flex: 3,
            ),
            AnimatedSwitcher(
              duration: const Duration(milliseconds: 1000),
              switchInCurve: Curves.easeInOut,
              switchOutCurve: Curves.easeInOut,
              child: Text(
                key: ValueKey(_index),
                '${_prompts.keys.elementAt(_index)}\n\n',
                maxLines: 3,
                style: const TextStyle(
                  fontSize: 12,
                  fontStyle: FontStyle.italic,
                ),
                textAlign: TextAlign.center,
              ),
            ),
            const Spacer(),
            const Icon(
              Icons.arrow_downward_rounded,
              size: 32,
            ),
            const Spacer(),
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                for (int i = 0; i < (widget.showHorde ? 4 : 1); i++)
                  AnimatedComputeBox(animationOffset: 1 - i / 4),
              ],
            ),
            const Spacer(),
            const Icon(
              Icons.arrow_downward_rounded,
              size: 32,
            ),
            const Spacer(),
            AnimatedSwitcher(
              duration: const Duration(milliseconds: 1000),
              switchInCurve: Curves.easeInOut,
              switchOutCurve: Curves.easeInOut,
              child: Container(
                key: ValueKey(_index),
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(4),
                  boxShadow: [
                    BoxShadow(
                      color: Colors.black.withOpacity(0.55),
                      spreadRadius: 0,
                      blurRadius: 8,
                      offset: const Offset(0, 4), // changes position of shadow
                    ),
                  ],
                ),
                child: ClipRRect(
                  borderRadius: BorderRadius.circular(4),
                  child: SizedBox(
                    height: 128,
                    width: 128,
                    child: Image.asset(
                      _prompts.values.elementAt(_index),
                    ),
                  ),
                ),
              ),
            ),
            const Spacer(
              flex: 3,
            ),
          ],
        ),
      ),
    );
  }
}
// This is a basic Flutter widget test.
// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
// find child widgets in the widget tree, read text, and verify that the values of widget properties
// are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:hello_world/main.dart';

void main() {
  testWidgets('Counter increments smoke test', (WidgetTester tester) async {
    // Build our app and trigge


SecondHand = true,
      this.hourHandColor = Colors.black,
      this.minuteHandColor = Colors.black,
      this.secondHandColor = Colors.redAccent,
      this.tickColor = Colors.grey,
      this.digitalClockColor = Colors.black,
      this.numberColor = Colors.black,
      this.showAllNumbers = false,
      this.textScaleFactor = 1.0,
      this.useMilitaryTime = true});

  @override
  void paint(Canvas canvas, Size size) {
    double scaleFactor = size.shortestSide / baseSize;

    if (showTicks) _paintTickMarks(canvas, size, scaleFactor);
    if (showNumbers) {
      _drawIndicators(canvas, size, scaleFactor, showAllNumbers);
    }

    if (showDigitalClock) {
      _paintDigitalClock(canvas, size, scaleFactor, useMilitaryTime);
    }

    _paintClockHands(canvas, size, scaleFactor);
    _paintPinHole(canvas, size, scaleFactor);
  }

  @override
  bool shouldRepaint(AnalogClockPainter oldDelegate) {
    return oldDelegate.dateTime.isBefore(dateTime);
  }

  _paintPinHole(canvas, size, scaleFactor) {
    Paint midPointStrokePainter = Paint()
      ..color = showSecondHand ? secondHandColor : minuteHandColor
      ..strokeWidth = strokeWidth * scaleFactor
      ..isAntiAlias = true
      ..style = PaintingStyle.stroke;

    canvas.drawCircle(size.center(Offset.zero), handPinHoleSize * scaleFactor,
        midPointStrokePainter);
  }

  void _drawIndicators(
      Canvas canvas, Size size, double scaleFactor, bool showAllNumbers) {
    TextStyle style = TextStyle(
        color: numberColor,
        fontWeight: FontWeight.bold,
        fontSize: 18.0 * scaleFactor * textScaleFactor);
    double p = 12.0;
    if (showTicks) p += 24.0;

    double r = size.shortestSide / 2;
    double longHandLength = r - (p * scaleFactor);

    for (var h = 1; h <= 12; h++) {
      if (!showAllNumbers && h % 3 != 0) continue;
      double angle = (h * pi / 6) - pi / 2; //+ pi / 2;
      Offset offset =
          Offset(longHandLength * cos(angle), longHandLength * sin(angle));
      TextSpan span = TextSpan(style: style, text: h.toString());
      TextPainter tp = TextPainter(
          text: span,
          textAlign: TextAlign.center,
          textDirection: TextDirection.ltr);
      tp.layout();
      tp.paint(canvas, size.center(offset - tp.size.center(Offset.zero)));
    }
  }

  Offset _getHandOffset(double percentage, double length) {
    final radians = 2 * pi * percentage;
    final angle = -pi / 2.0 + radians;

    return new Offset(length * cos(angle), length * sin(angle));
  }

  // ref: https://www.codenameone.com/blog/codename-one-graphics-part-2-drawing-an-analog-clock.html
  void _paintTickMarks(Canvas canvas, Size size, double scaleFactor) {
    double r = size.shortestSide / 2;
    double tick = 5 * scaleFactor,
        mediumTick = 2.0 * tick,
        longTick = 3.0 * tick;
    double p = longTick + 4 * scaleFactor;
    Paint tickPaint = Paint()
      ..color = tickColor
      ..strokeWidth = 2.0 * scaleFactor;

    for (int i = 1; i <= 60; i++) {
      // default tick length is short
      double len = tick;
      if (i % 15 == 0) {
        // Longest tick on quarters (every 15 ticks)
        len = longTick;
      } else if (i % 5 == 0) {
        // Medium ticks on the '5's (every 5 ticks)
        len = m


, current_fp_src=20
fmovs  %f16, %f20
fadds  %f16, %f17, %f16
st   %f20, [%i1 + 80 ]

P5796: !_CAS [9] (maybe <- 0x28001fb) (Int)
add %i1, 512, %o5
lduw [%o5], %o3
mov %o3, %l7
! move %l7(lower) -> %o3(upper)
sllx %l7, 32, %o3
mov %l4, %l6
cas [%o5], %l7, %l6
! move %l6(lower) -> %o3(lower)
srl %l6, 0, %o5
or %o5, %o3, %o3
add   %l4, 1, %l4

P5797: !_CASX [9] (maybe <- 0x28001fc) (Int)
add %i1, 512, %o5
ldx [%o5], %o4
! move %o4(upper) -> %o4(upper)
! move %o4(lower) -> %o4(lower)
!---- flushing int results buffer----
mov %o0, %l5
mov %o1, %l5
mov %o2, %l5
mov %o3, %l5
mov %o4, %l5
mov  %o4, %l7
sllx %l4, 32, %o0
casx [%o5], %l7, %o0
! move %o0(upper) -> %o0(upper)
! move %o0(lower) -> %o0(lower)
add  %l4, 1, %l4

P5798: !_ST [9] (maybe <- 0x4200003b) (FP)
! 0 th moved, current_fp_src=20
fmovs  %f16, %f20
fadds  %f16, %f17, %f16
st   %f20, [%i1 + 512 ]

P5799: !_ST [13] (maybe <- 0x28001fd) (Int)
stw   %l4, [%i3 + 64 ]
add   %l4, 1, %l4

P5800: !_DWST [8] (maybe <- 0x28001fe) (Int)
mov %l4, %l3
sllx %l3, 32, %l3
stx %l3, [%i1 + 256 ]
add   %l4, 1, %l4

P5801: !_ST [0] (maybe <- 0x28001ff) (Int)
stw   %l4, [%i0 + 0 ]
add   %l4, 1, %l4

P5802: !_CAS [9] (maybe <- 0x2800200) (Int)
add %i1, 512, %o5
lduw [%o5], %o1
mov %o1, %l7
! move %l7(lower) -> %o1(upper)
sllx %l7, 32, %o1
mov %l4, %l6
cas [%o5], %l7, %l6
! move %l6(lower) -> %o1(lower)
srl %l6, 0, %o5
or %o5, %o1, %o1
add   %l4, 1, %l4

P5803: !_ST [9] (maybe <- 0x2800201) (Int) (Branch target of P5237)
stw   %l4, [%i1 + 512 ]
add   %l4, 1, %l4
ba P5804
nop

TARGET5237:
ba RET5237
nop

P5804: !_LD [7] (Int)
lduw [%i1 + 84], %o2
! move %o2(lower) -> %o2(upper)
sllx %o2, 32, %o2

P5805: !_DWST [12]


%;
  float: left;
  display: inline;
}
.uxcore .kuma-layout-3c .kuma-layout-3c-mid {
  width: 100%;
  float: left;
  display: inline;
}
.uxcore .kuma-layout-3c .kuma-layout-3c-right {
  float: left;
  display: inline;
}
.uxcore .kuma-load-more {
  background: #f7f7f7;
  border: 1px solid #e8e8e8;
  height: 40px;
  box-sizing: border-box;
  line-height: 38px;
  text-align: center;
  vertical-align: top;
}
.uxcore .kuma-load-more-icon-loading {
  background-image: url(data:image/gif;base64,R0lGODlhGAAYAOZKAOzs7O/v7/z8/Pf39+np6f9mAPb29vHx8erq6u7u7vT09PPz8/+fYP+zgP/28P/j0P+MQP/s4P+WUP9vEPKmc+fe1/iGOf1uDv/ZwP/GoOnWyf7Xvv/PsOrXyvWWVvyJPOzGrP95IPt2HO7k3veOR/2UTu+/n/zWvPCugf7hzvWfZurOuvWyhv7Env7r3viZWfLf0+2+nvzz7O+2j/W8lvyvfPfHp/+8kPG3ke3RvvzDnP+CMP707vque/S6lPp+K/vn2/2eXvK5k/qka/ncyfv7+/7+/ufn5/n5+ebm5v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6


ION4
DEACTION4 --> PREPAREJSPARAM10
PREPAREJSPARAM2 --> PREPAREJSPARAM7 : [[$./attention_personnel_update#preparejsparam2-preparejsparam7{关注测试用例} 关注测试用例]]
PREPAREJSPARAM7 --> DEACTION5
DEACTION5 --> PREPAREJSPARAM10
PREPAREJSPARAM2 --> PREPAREJSPARAM6 : [[$./attention_personnel_update#preparejsparam2-preparejsparam6{关注执行用例} 关注执行用例]]
PREPAREJSPARAM6 --> DEACTION6
DEACTION6 --> PREPAREJSPARAM10
PREPAREJSPARAM2 --> PREPAREJSPARAM8 : [[$./attention_personnel_update#preparejsparam2-preparejsparam8{关注页面} 关注页面]]
PREPAREJSPARAM8 --> DEACTION7
DEACTION7 --> PREPAREJSPARAM10
PREPAREJSPARAM2 --> PREPAREJSPARAM9 : [[$./attention_personnel_update#preparejsparam2-preparejsparam9{关注讨论} 关注讨论]]
PREPAREJSPARAM9 --> DEACTION8
DEACTION8 --> PREPAREJSPARAM10

@enduml
```

### 处理步骤说明

#### 开始 :id=Begin<sup class="footnote-symbol"> <font color=gray size=1>[开始]</font></sup>

#### 注入脚本代码 :id=RAWJSCODE1<sup class="footnote-symbol"> <font color=gray size=1>[直接前台代码]</font></sup>

<p class="panel-title"><b>执行代码</b></p>

```javascript
const default_data =uiLogic.default;
let select_data =uiLogic.select_data;
for (let i = 0; i < default_data.length; i++){
  select_data.push(default_data[i]);
  select_data[i].owner_id = uiLogic.ctx.principal_id;
  if(default_data[i].user_id){
    select_data[i].user_id = default_data[i].user_id;
  }else{
    select_data[i].user_id = default_data[i].srfkey;
  }

}

```

#### 调试逻辑参数 :id=DEBUGPARAM2 [调试逻辑参数]

> [!NOTE|label:调试信息|icon:fa fa-bug]
> 调试输出参数`选中数据`的详细信息

#### 获取关注人员 :id=PREPAREJSPARAM2 [准备参数]

1. 将`select_data(选中数据)` 设置给  `commit_object(提交对象).attentions`

#### 页面 :id=PREPAREJSPARAM8 [准备参数]

1. 将`ctx(应用上下文).article_page` 设置给  `commit_object(提交对象).id`

#### 工作项 :id=PREPAREJSPARAM1 [准备参数]

1. 将`ctx(应用上下文).work_item` 设置给  `commit_object(提交对象).id`

#### 产品需求 :id=PREPAREJSPARAM3


mapFromDatabaseResponse(data['${effectivePrefix}R01']),
      r02: const IntType()
          .mapFromDatabaseResponse(data['${effectivePrefix}R02']),
      r03: const IntType()
          .mapFromDatabaseResponse(data['${effectivePrefix}R03']),
      r04: const IntType()
          .mapFromDatabaseResponse(data['${effectivePrefix}R04']),
      r05: const IntType()
          .mapFromDatabaseResponse(data['${effectivePrefix}R05']),
      r06: const IntType()
          .mapFromDatabaseResponse(data['${effectivePrefix}R06']),
      r07: const IntType()
          .mapFromDatabaseResponse(data['${effectivePrefix}R07']),
    );
  }
  @override
  Map<String, Expression> toColumns(bool nullToAbsent) {
    final map = <String, Expression>{};
    if (!nullToAbsent || id != null) {
      map['ID'] = Variable<int?>(id);
    }
    if (!nullToAbsent || tipoPagamento != null) {
      map['TIPO_PAGAMENTO'] = Variable<int?>(tipoPagamento);
    }
    if (!nullToAbsent || produto != null) {
      map['PRODUTO'] = Variable<int?>(produto);
    }
    if (!nullToAbsent || r01 != null) {
      map['R01'] = Variable<int?>(r01);
    }
    if (!nullToAbsent || r02 != null) {
      map['R02'] = Variable<int?>(r02);
    }
    if (!nullToAbsent || r03 != null) {
      map['R03'] = Variable<int?>(r03);
    }
    if (!nullToAbsent || r04 != null) {
      map['R04'] = Variable<int?>(r04);
    }
    if (!nullToAbsent || r05 != null) {
      map['R05'] = Variable<int?>(r05);
    }
    if (!nullToAbsent || r06 != null) {
      map['R06'] = Variable<int?>(r06);
    }
    if (!nullToAbsent || r07 != null) {
      map['R07'] = Variable<int?>(r07);
    }
    return map;
  }

  EcfLogTotaissCompanion toCompanion(bool nullToAbsent) {
    return EcfLogTotaissCompanion(
      id: id == null && nullToAbsent ? const Value.absent() : Value(id),
      tipoPagamento: tipoPagamento == null && nullToAbsent
          ? const Value.absent()
          : Value(tipoPagamento),
      produto: produto == null && nullToAbsent
          ? const Value.absent()
          : Value(produto),
      r01: r01 == null && nullToAbsent ? const Value.absent() : Value(r01),
      r02: r02 == null && nullToAbsent ? const Value.absent() : Value(r02),
      r03: r03 == null && nullToAbsent ? const Value.absent() : Value(r03),
      r04: r04 == null && nullToAbsent ? const Value.absent() : Value(r04),
      r05: r05 == null && nullToAbsent ? const Value.absent() : Value(r05),
      r06: r06 == null && nullToAbsent ? const Value.absent() : Value(r06),
      r07: r07 == null && nullToAbsent ? const Value.absent() : Value(r07),
    );
  }

  factory EcfLogTotais.fromJson(Map<String, dynamic> json,
      {ValueSerializer? serializer}) {
    serializer ??= driftRuntimeOptions.defaultSerializer;
    return EcfLogTotais(
      id: serializer.fromJson<int?>(json['


AR5+			; 239
	LMS *AR5+, *AR5+0%			; 240
	LMS *AR5+0%, *AR2			; 241
	LMS *AR5+0%, *AR2-			; 242
	LMS *AR5+0%, *AR2+			; 243
	LMS *AR5+0%, *AR2+0%			; 244
	LMS *AR5+0%, *AR3			; 245
	LMS *AR5+0%, *AR3-			; 246
	LMS *AR5+0%, *AR3+			; 247
	LMS *AR5+0%, *AR3+0%			; 248
	LMS *AR5+0%, *AR4			; 249
	LMS *AR5+0%, *AR4-			; 250
	LMS *AR5+0%, *AR4+			; 251
	LMS *AR5+0%, *AR4+0%			; 252
	LMS *AR5+0%, *AR5			; 253
	LMS *AR5+0%, *AR5-			; 254
	LMS *AR5+0%, *AR5+			; 255
	LMS *AR5+0%, *AR5+0%			; 256
	;  LTD : LTD Smem : 1
	LTD 43h					; 1
	;  LTD_I : LTD Smem_I : 120
	LTD *AR0				; 1
	LTD *AR0-				; 2
	LTD *AR0+				; 3
	LTD *AR0-0B				; 4
	LTD *AR0-0				; 5
	LTD *AR0+0				; 6
	LTD *AR0+0B				; 7
	LTD *AR0-%				; 8
	LTD *AR0-0%				; 9
	LTD *AR0+%				; 10
	LTD *AR0+0%				; 11
	LTD *AR0(02B40h)			; 12
	LTD *+AR0(02B41h)			; 13
	LTD *+AR0(02B42h)%			; 14
	LTD *(02B43h)				; 15
	LTD *AR1				; 16
	LTD *AR1-				; 17
	LTD *AR1+				; 18
	LTD *AR1-0B				; 19
	LTD *AR1-0				; 20
	LTD *AR1+0				; 21
	LTD *AR1+0B				; 22
	LTD *AR1-%				; 23
	LTD *AR1-0%				; 24
	LTD *AR1+%				; 25
	LTD *AR1+0%				; 26
	LTD *AR1(02B44h)			; 27
	LTD *+AR1(02B45h)			; 28
	LTD *+AR1(02B46h)%			; 29
	LTD *(02B47h)				; 30
	LTD *AR2				; 31
	LTD *AR2-				; 32
	LTD *AR2+				; 33
	LTD *AR2-0B				; 34
	LTD *AR2-0				; 35
	LTD *AR2+0				; 36
	LTD *AR2+0B				; 37
	LTD *AR2-%				; 38
	LTD *AR2-0%				; 39
	LTD *AR2+%				; 40
	LTD *AR2+0%				; 41
	LTD *AR2(02B48h)			; 42
	LTD *+AR2(02B49h)			; 43
	LTD *+AR2(02B4Ah)%			; 44
	LTD *(02B4Bh)				; 45
	LTD *AR3				; 46
	LTD


# This file is automatically generated. Please do not modify.

from . import AsciiArt

nixos_colorful = AsciiArt(match=r'''"nixos_colorful"*''', color='4 6 4 6 4 6', ascii=r"""
${c1}          ▗▄▄▄       ${c2}▗▄▄▄▄    ▄▄▄▖
${c1}          ▜███▙       ${c2}▜███▙  ▟███▛
${c1}           ▜███▙       ${c2}▜███▙▟███▛
${c1}            ▜███▙       ${c2}▜██████▛
${c1}     ▟█████████████████▙ ${c2}▜████▛     ${c3}▟▙
${c1}    ▟███████████████████▙ ${c2}▜███▙    ${c3}▟██▙
${c6}           ▄▄▄▄▖           ${c2}▜███▙  ${c3}▟███▛
${c6}          ▟███▛             ${c2}▜██▛ ${c3}▟███▛
${c6}         ▟███▛               ${c2}▜▛ ${c3}▟███▛
${c6}▟███████████▛                  ${c3}▟██████████▙
${c6}▜██████████▛                  ${c3}▟███████████▛
${c6}      ▟███▛ ${c5}▟▙               ${c3}▟███▛
${c6}     ▟███▛ ${c5}▟██▙             ${c3}▟███▛
${c6}    ▟███▛  ${c5}▜███▙           ${c3}▝▀▀▀▀
${c6}    ▜██▛    ${c5}▜███▙ ${c4}▜██████████████████▛
${c6}     ▜▛     ${c5}▟████▙ ${c4}▜████████████████▛
${c5}           ▟██████▙       ${c4}▜███▙
${c5}          ▟███▛▜███▙       ${c4}▜███▙
${c5}         ▟███▛  ▜███▙       ${c4}▜███▙
${c5}         ▝▀▀▀    ▀▀▀▀▘       ${c4}▀▀▀▘
""")


;

const int SND_SEQ_PORT_TYPE_MIDI_GM2 = 64;

const int SND_SEQ_PORT_TYPE_SYNTH = 1024;

const int SND_SEQ_PORT_TYPE_DIRECT_SAMPLE = 2048;

const int SND_SEQ_PORT_TYPE_SAMPLE = 4096;

const int SND_SEQ_PORT_TYPE_HARDWARE = 65536;

const int SND_SEQ_PORT_TYPE_SOFTWARE = 131072;

const int SND_SEQ_PORT_TYPE_SYNTHESIZER = 262144;

const int SND_SEQ_PORT_TYPE_PORT = 524288;

const int SND_SEQ_PORT_TYPE_APPLICATION = 1048576;

const int SND_SEQ_QUEUE_DIRECT = 253;

const int SND_SEQ_REMOVE_INPUT = 1;

const int SND_SEQ_REMOVE_OUTPUT = 2;

const int SND_SEQ_REMOVE_DEST = 4;

const int SND_SEQ_REMOVE_DEST_CHANNEL = 8;

const int SND_SEQ_REMOVE_TIME_BEFORE = 16;

const int SND_SEQ_REMOVE_TIME_AFTER = 32;

const int SND_SEQ_REMOVE_TIME_TICK = 64;

const int SND_SEQ_REMOVE_EVENT_TYPE = 128;

const int SND_SEQ_REMOVE_IGNORE_OFF = 256;

const int SND_SEQ_REMOVE_TAG_MATCH = 512;

typedef _c_access = ffi.Int32 Function(
  ffi.Pointer<ffi.Int8> __name,
  ffi.Int32 __type,
);

typedef _dart_access = int Function(
  ffi.Pointer<ffi.Int8> __name,
  int __type,
);

typedef _c_faccessat = ffi.Int32 Function(
  ffi.Int32 __fd,
  ffi.Pointer<ffi.Int8> __file,
  ffi.Int32 __type,
  ffi.Int32 __flag,
);

typedef _dart_faccessat = int Function(
  int __fd,
  ffi.Pointer<ffi.Int8> __file,
  int __type,
  int __flag,
);

typedef _c_lseek = ffi.Int64 Function(
  ffi.Int32 __fd,
  ffi.Int64 __offset,
  ffi.Int32 __whence,
);

typedef _dart_lseek = int Function(
  int __fd,
  int __offset,
  int __whence,
);

typedef _c_close = ffi.Int32 Function(
  ffi.Int32 __fd,
);

typedef _dart_close = int Function(
  int __fd,
);

typedef _c_read = ffi.Int64 Function(
  ffi.Int32 __fd,
  ffi.Pointer<ffi.Void> __buf,
  ffi.Uint64 __nbytes,
);

typedef _dart_read = int Function(
  int __fd,
  ffi.Pointer<ffi.Void> __buf,
  int __nbytes,
);

typedef _c_write = ffi.Int64 Function(
  ffi.Int32 __fd,
  ffi.Pointer<ffi.Void> __buf,
  ffi.Uint64 __n,
);

typedef _dart_write = int Function(
  int __fd,
  ffi.Pointer<ffi.Void> __buf,
  int __n,
);

typedef _c_pread = ffi.Int64 Function(
  ffi.Int32 __fd,
  ffi.Pointer<ffi.Void> __buf,
  ffi.Uint64 __nbytes,
  ffi.Int64 __offset,
);

typedef _dart_pread = int Function(
  int __fd,
  ffi.Pointer<ffi.Void> __buf,
  int __nbytes,
  int __offset,
);

typedef


 s.is_def_ratio() {
                builder.add_def_ratio("技能倍率", ratio);
            } else {
                builder.add_atk_ratio("技能倍率", ratio);
            }

            let after_q = match *config {
                CharacterSkillConfig::Noelle { after_q } => after_q,
                _ => false
            };
            if after_q {
                let def = context.attribute.get_value(AttributeName::DEF);
                let is_conste6 = context.character_common_data.constellation == 6;
                let atk_bonus_ratio = NOELLE_SKILL.elemental_burst_atk_bonus[s3] + if is_conste6 {
                    0.5
                } else {
                    0.0
                };
                let atk_bonus = def * atk_bonus_ratio;
                builder.add_extra_atk("大扫除加成", atk_bonus);
            }

            builder.damage(
                &context.attribute,
                &context.enemy,
                s.get_element(after_q),
                s.get_skill_type(),
                context.character_common_data.level
            )
        }
    }

    fn new_effect<A: Attribute>(_common_data: &CharacterCommonData, _config: &CharacterConfig) -> Option<Box<dyn ChangeAttribute<A>>> {
        None
    }

    fn get_target_function_by_role(role_index: usize, _team: &TeamQuantization, _c: &CharacterCommonData, _w: &WeaponCommonData) -> Box<dyn TargetFunction> {
        let role: NoelleRoleEnum = num::FromPrimitive::from_usize(role_index).unwrap();
        match role {
            NoelleRoleEnum::Main => Box::new(NoelleDefaultTargetFunction)
        }
    }
}
<filename>contracts/overseer/src/testing/tests.rs
use crate::contract::{execute, instantiate, query};
use crate::error::ContractError;
use crate::querier::query_epoch_state;
use crate::state::{read_epoch_state, store_epoch_state, EpochState};
use crate::testing::mock_querier::mock_dependencies;

use cosmwasm_bignumber::{Decimal256, Uint256};
use cosmwasm_std::testing::{mock_env, mock_info, MOCK_CONTRACT_ADDR};
use cosmwasm_std::{
    attr, from_binary, to_binary, Addr, Api, BankMsg, CanonicalAddr, Coin, CosmosMsg, Decimal,
    SubMsg, Uint128, WasmMsg,
};

use moneymarket::custody::ExecuteMsg as CustodyExecuteMsg;
use moneymarket::market::ExecuteMsg as MarketExecuteMsg;
use moneymarket::overseer::{
    AllCollateralsResponse, BorrowLimitResponse, CollateralsResponse, ConfigResponse, ExecuteMsg,
    InstantiateMsg, QueryMsg, WhitelistResponse, WhitelistResponseElem,
};
use moneymarket::querier::deduct_tax;

use std::str::FromStr;

#[test]
fn proper_initialization() {
    let mut deps = mock_dependencies(&[]);

    let msg = InstantiateMsg {
        owner_addr: "owner".to_string(),
        oracle_contract: "oracle".to_string(),
        market_contract: "market".to_string(),
        liquidation_contract: "liquidation".to_string(),
        collector_contract: "collector".to_string(),
        stable_denom: "uusd".to_string(),
        epoch_period: 86400u64,
        threshold_deposit_rate: Decimal256::permille(3),
        target_deposit_rate: Decimal256::permille(5),
        buffer_distribution_factor: Decimal256::percent(20),
        anc_purchase_factor: Decimal256::percent(20),
        price_timeframe: 60u6


SWEP.SetBreathDSP = false

local sfxconvar = GetConVar("arc9_breath_sfx")
local slomoconvar = GetConVar("arc9_breath_slowmo")
local togglconvar = GetConVar("arc9_togglebreath")
local ppconvar = GetConVar("arc9_breath_pp")
local hudconvar = GetConVar("arc9_breath_hud")
local swayconvar = GetConVar("arc9_mod_sway")

function SWEP:ThinkHoldBreath()
    if !swayconvar:GetBool() and !slomoconvar:GetBool() then return end
    if !self:GetOwner():IsPlayer() then return end
    local holdbreathtime = self:GetValue("HoldBreathTime")
    if holdbreathtime <= 0 then return end

    local sfx = sfxconvar:GetBool()

    local target_ts = 1

    if self:HoldingBreath() then
        self:SetBreath(self:GetBreath() - (FrameTime() * 100 / holdbreathtime))
        if self:GetBreath() < 0 then
            self:SetOutOfBreath(true)
            self:SetBreath(0)
            self.IsHoldingBreath = false

            if sfx then
                local soundtab = {
                    name = "breathrunout",
                    sound = self:RandomChoice(self:GetProcessedValue("BreathRunOutSound", true)),
                    channel = ARC9.CHAN_BREATH
                }

                self.BreathOutPlayed = true
                self.BreathInPlayed = nil
                if CLIENT then self:PlayTranslatedSound(soundtab) end

                -- if self.SetBreathDSP then
                --     self:GetOwner():SetDSP(0)
                --     self.SetBreathDSP = false
                -- end
            end
        else
            target_ts = Lerp(1 - (self:GetBreath() / 100), 0.33, 0.25)
            if sfx and !self.BreathInPlayed then
            -- if sfx and !self.SetBreathDSP then
                -- self:GetOwner():SetDSP(30)
                -- self.SetBreathDSP = true

                self.BreathInPlayed = true
                self.BreathOutPlayed = nil

                local soundtab = {
                    name = "breathin",
                    sound = self:RandomChoice(self:GetProcessedValue("BreathInSound", true)),
                    channel = ARC9.CHAN_BREATH
                }

                if CLIENT then self:PlayTranslatedSound(soundtab) end
            end
        end
    else
        if sfx and !self.BreathOutPlayed and !self:GetOutOfBreath() then
        -- if sfx and self.SetBreathDSP then
            -- self:GetOwner():SetDSP(0)
            -- self.SetBreathDSP = false
            local soundtab = {
                name = "breathout",
                sound = self:RandomChoice(self:GetProcessedValue("BreathOutSound", true)),
                channel = ARC9.CHAN_BREATH
            }

            self.BreathOutPlayed = true
            self.BreathInPlayed = nil

            if CLIENT then self:PlayTranslatedSound(soundtab) end
        end

        self:SetBreath(self:GetBreath() + (FrameTime() * 100 / self:GetProcessedValue("RestoreBreathTime", true)))
        if self:GetBreath() >= 100 then
            self:SetBreath(100)
            self:SetOutOfBrea


local function get_num_handles()
  local pid = vim.fn.getpid()
  local output = vim.fn.system({"lsof", "-p"}, tostring(pid))
  local lines = vim.split(output, "\n", { plain = true })
  return #lines
end

describe('compiler', function()
  it('reads errors from both stdout and stderr', function()
    local a = vim.api
    local bufnr = a.nvim_create_buf(true, true)
    a.nvim_buf_set_name(bufnr, "spec/both.py")
    a.nvim_set_current_buf(bufnr)
    a.nvim_buf_set_option(bufnr, 'errorformat', '%f:%l: %m')
    a.nvim_buf_set_option(bufnr, 'makeprg', 'python spec/both.py')

    local handles = get_num_handles()
    require('lint').try_lint('compiler')

    vim.wait(5000, functi


port com.github.minigdx.tiny.engine.GameOptions
import com.github.minigdx.tiny.graphic.PixelFormat
import com.github.minigdx.tiny.log.Logger
import com.github.minigdx.tiny.platform.DrawingMode
import com.github.minigdx.tiny.platform.WindowManager
import com.github.minigdx.tiny.render.NopRenderContext
import com.github.minigdx.tiny.render.OperationsRender
import com.github.minigdx.tiny.render.RenderContext
import com.github.minigdx.tiny.render.WriteRender
import com.github.minigdx.tiny.render.operations.DrawSprite
import com.github.minigdx.tiny.render.operations.DrawSprite.Companion.MAX_SPRITE_PER_COMMAND
import com.github.minigdx.tiny.render.operations.DrawingModeOperation
import com.github.minigdx.tiny.render.operations.RenderOperation
import com.github.minigdx.tiny.render.shader.FragmentShader
import com.github.minigdx.tiny.render.shader.ShaderProgram
import com.github.minigdx.tiny.render.shader.VertexShader

class OperationsShader(
    private val gl: Kgl,
    private val logger: Logger,
    private val gameOptions: GameOptions,
) : OperationsRender, WriteRender {
    private val program = ShaderProgram(gl, VShader(), FShader())

    override fun init(windowManager: WindowManager): RenderContext {
        program.compileShader()
        return NopRenderContext
    }

    override fun render(
        context: RenderContext,
        ops: List<RenderOperation>,
    ) {
        // Prepare to draw a list of operation, by preparing the shader and the viewport.
        program.use()
        program.disable(GL_DEPTH_TEST)
        ops.forEach { op -> op.executeGPU(context, this) }
    }

    private val vertexData = FloatArray(MAX_SPRITE_PER_COMMAND * FLOAT_PER_SPRITE)
    private val spr = FloatArray(MAX_SPRITE_PER_COMMAND * FLOAT_PER_SPRITE)

    /**
     * Execute the operation of drawing a sprite
     */
    override fun drawSprite(
        context: RenderContext,
        op: DrawSprite,
    ) {
        var indexVertex = 0
        op.attributes.forEach { a ->
            // A - Left/Up
            vertexData[indexVertex++] = a.positionLeft.toFloat()
            vertexData[indexVertex++] = a.positionUp.toFloat()
            // A - Right/Up
            vertexData[indexVertex++] = a.positionRight.toFloat()
            vertexData[indexVertex++] = a.positionUp.toFloat()
            // A - Right/Down
            vertexData[indexVertex++] = a.positionRight.toFloat()
            vertexData[indexVertex++] = a.positionDown.toFloat()
            // B - Right/Down
            vertexData[indexVertex++] = a.positionRight.toFloat()
            vertexData[indexVertex++] = a.positionDown.toFloat()
            // B - Left/Down
            vertexData[indexVertex++] = a.positionLeft.toFloat()
            vertexData[indexVertex++] = a.positionDown.toFloat()
            // B - Left/Up
            vertexData[indexVertex++] = a.positionLeft.toFloat()
            vertexData[indexVertex++] = a.positionUp.toFloat()
        }

        indexVertex = 0
        op.attributes.flatMap { a ->
            // A - Left/Up
            val v1 = a.uvLeft to a.uvUp
            // A - Right/Up
            val v2 = a.uvRight to a


 ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.math4.legacy.analysis.solvers;

import org.apache.commons.math4.legacy.analysis.differentiation.UnivariateDifferentiableFunction;

/**
 * Interface for (univariate real) rootfinding algorithms.
 * Implementations will search for only one zero in the given interval.
 *
 * @since 3.1
 */
public interface UnivariateDifferentiableSolver
    extends BaseUnivariateSolver<UnivariateDifferentiableFunction> {}

/*
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

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

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

package me.lemire.integercompression;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import me.lemire.integercompression.IntWrapper;
import me.lemire.integercompression.Kamikaze;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true)
public class Kamikaze_ESTest extends Kamikaze_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test00()  throws Throwable  {
      Kamikaze kamikaze0 = new Kamikaze();
      int[] intArray0 = new int[4];
      IntWrapper intWrapper0 = new IntWrapper((-1241));
      IntWrapper intWrapper1 = new IntWrapper(0);
      kamikaze0.uncompress0(intArray0, intWrapper1, 1594, intArray0, intWrapper0);
      assertEquals(1.0F, intWrapper1.floatValue(), 0.01F);
      assertEquals(1, intWrapper1.get());
  }

  @Test(timeout = 4000)
  public void test01()  throws Throwable  {
      Kamikaze kamikaze0 = new Kamikaze();
      int[] intArray0 = new int[9];
      IntWrapper intWrapper0 = new IntWrapper(0);
      int[] intArray1 = new int[4];
      kamikaze0.uncompress0(intArray0, intWrapper0, (-1), intArray1, intWrapper0);
      assertEquals((short)1, intWrapper0.shortValue());
      assertEquals(1, intWrapper0.intValue());
  }

  @Test(timeout = 4000)
  public void test02()  throws Throwable  {
      Kamikaze kamikaze0 = new Kamikaze();
      int[] int


        "before text\nHelloXXXX\nYYYY world\nafter text"
    );
}
use log::{debug,error};
use std::cell::RefCell;
use std::convert::Infallible;
use std::error::Error;
use std::io;
use std::rc::Rc;
use std::task;
use smithay_client_toolkit::environment::SimpleGlobal;
use smithay_client_toolkit::environment::Environment;
use smithay_client_toolkit::environment;
use smithay_client_toolkit::output::OutputHandling;
use smithay_client_toolkit::output::OutputInfo;
use smithay_client_toolkit::output::OutputStatusListener;
use smithay_client_toolkit::seat::SeatData;
use smithay_client_toolkit::seat::SeatHandling;
use smithay_client_toolkit::seat::SeatListener;
use tokio::io::unix::AsyncFd;
use wayland_client::Attached;
use wayland_client::DispatchData;
use wayland_client::protocol::wl_compositor::WlCompositor;
use wayland_client::protocol::wl_display::WlDisplay;
use wayland_client::protocol::wl_output::WlOutput;
use wayland_client::protocol::wl_pointer::{ButtonState,Axis};
use wayland_client::protocol::wl_seat::WlSeat;
use wayland_client::protocol::wl_shm::WlShm;
use wayland_client::protocol::wl_surface::WlSurface;
use wayland_protocols::unstable::xdg_output::v1::client::zxdg_output_manager_v1::ZxdgOutputManagerV1;
use wayland_protocols::wlr::unstable::data_control::v1::client::zwlr_data_control_manager_v1::ZwlrDataControlManagerV1;
use wayland_protocols::wlr::unstable::layer_shell::v1::client::zwlr_layer_shell_v1::ZwlrLayerShellV1;
use wayland_protocols::wlr::unstable::layer_shell::v1::client::zwlr_layer_surface_v1::ZwlrLayerSurfaceV1;
use wayland_protocols::xdg_shell::client::xdg_popup::XdgPopup;
use wayland_protocols::xdg_shell::client::xdg_surface::XdgSurface;
use wayland_protocols::xdg_shell::client::xdg_wm_base::XdgWmBase;

use crate::bar::Bar;
use crate::state::State;
use crate::util;

/// Wayland globals (access via [Environment::require_global])
pub struct Globals {
    sctk_compositor: SimpleGlobal<WlCompositor>,
    pub sctk_shm: smithay_client_toolkit::shm::ShmHandler,
    sctk_seats: smithay_client_toolkit::seat::SeatHandler,
    sctk_shell: smithay_client_toolkit::shell::ShellHandler,
    sctk_outputs: smithay_client_toolkit::output::OutputHandler,
    sctk_xdg_out: smithay_client_toolkit::output::XdgOutputHandler,

    layer_shell: SimpleGlobal<ZwlrLayerShellV1>,
    clipboard: SimpleGlobal<ZwlrDataControlManagerV1>,
}

environment!(Globals,
    singles = [
        WlCompositor => sctk_compositor,
        WlShm => sctk_shm,

        ZwlrLayerShellV1 => layer_shell,
        ZwlrDataControlManagerV1 => clipboard,
        XdgWmBase => sctk_shell,
        ZxdgOutputManagerV1 => sctk_xdg_out,
    ],
    multis = [
        WlSeat => sctk_seats,
        WlOutput => sctk_outputs,
    ],
);

/// Structures related to the Wayland display
pub struct WaylandClient {
    pub env : Environment<Globals>,
    pub wl_display : Attached<WlDisplay>,
    #[allow(unused)] // need to hold this handle for the callback to remain alive
    seat_watcher : SeatListener,
    flush : Option<task::Waker>,
    need_flush : bool,
}

impl WaylandClient {
    pub fn new() -> Result<(S


ization.
 *
 *
 *
 * Tests have to follow the pattern:
 * Supply a file with the expected serialized data that matches the pattern
 * "package/ClassName_methodName.xml".
 * Call these methods with their respective [TestInfo] so the file can be found.
 *
 *
 *
 *
 * Example:
 * [DeleteResultTest.testSerialization] provides the file
 * "src/test/resources/com/adobe/testing/s3mock/dto/DeleteResultTest_testSerialization.xml"
 *
 */
internal object DtoTestUtil {
  private val MAPPER: XmlMapper = XmlMapper.builder()
    .findAndAddModules()
    .enable(ToXmlGenerator.Feature.WRITE_XML_DECLARATION)
    .enable(ToXmlGenerator.Feature.AUTO_DETECT_XSI_TYPE)
    .enable(FromXmlParser.Feature.AUTO_DETECT_XSI_TYPE)
    .build()

  init {
    MAPPER.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
    MAPPER.factory.xmlOutputFactory
      .setProperty(WstxOutputProperties.P_USE_DOUBLE_QUOTES_IN_XML_DECL, true)
  }

  /**
   * Finds and reads the test file, serializes the iut and asserts the contents are the same.
   */
  @JvmStatic
  @Throws(IOException::class)
  fun serializeAndAssert(iut: Any?, testInfo: TestInfo) {
    val out = MAPPER.writeValueAsString(iut)
    assertThat(out).isNotNull()
    val expected = getExpected(testInfo)
    XmlAssert.assertThat(out)
      .and(expected)
      .ignoreChildNodesOrder()
      .ignoreWhitespace()
      .ignoreComments()
      .areIdentical()
  }

  /**
   * Finds and reads the test file and returns its contents deserialized as T.
   */
  @Throws(IOException::class)
  fun <T> deserialize(clazz: Class<T>, testInfo: TestInfo): T {
    val toDeserialize = getFile(testInfo)
    assertThat(toDeserialize).exists()
    return MAPPER.readValue(toDeserialize, clazz)
  }

  /**
   * Reads the test file and returns its contents.
   */
  @Throws(IOException::class)
  fun getExpected(testInfo: TestInfo): String {
    val file = getFile(testInfo)
    return file.readText()
  }

  private fun getFile(testInfo: TestInfo): File {
    val testClass = testInfo.testClass.get()
    val packageName = testClass.getPackage().name
    val className = testClass.simpleName
    val methodName = testInfo.testMethod.get().name
    val fileName = "${packageName.replace(".", "/")}/${className}_${methodName}.xml"
    val classLoader = testClass.classLoader
    return File(Objects.requireNonNull(classLoader.getResource(fileName)).file)
  }
}
/*
 *  Copyright 2017-2025 Adobe.
 *
 *  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.adobe.testing.s3mock.service

import com.adobe.testing.s3mock.S3Exception
import com.adobe.testing.s3mock.dto.BucketLifecycleConfiguration
import com.adobe.testing.s3mock.dto.ObjectLockConfiguration
import c