MULTIPLY_ALPHA";
      ALPHA_MODES[ALPHA_MODES["PREMULTIPLIED_ALPHA"] = 2] = "PREMULTIPLIED_ALPHA";
  })(ALPHA_MODES$5 || (ALPHA_MODES$5 = {}));
  /**
   * Configure whether filter textures are cleared after binding.
   *
   * Filter textures need not be cleared if the filter does not use pixel blending. {@link CLEAR_MODES.BLIT} will detect
   * this and skip clearing as an optimization.
   * @name CLEAR_MODES
   * @memberof PIXI
   * @static
   * @enum {number}
   * @property {number} BLEND - Do not clear the filter texture. The filter's output will blend on top of the output texture.
   * @property {number} CLEAR - Always clear the filter texture.
   * @property {number} BLIT - Clear only if {@link FilterSystem.forceClear} is set or if the filter uses pixel blending.
   * @property {number} NO - Alias for BLEND, same as `false` in earlier versions
   * @property {number} YES - Alias for CLEAR, same as `true` in earlier versions
   * @property {number} AUTO - Alias for BLIT
   */
  var CLEAR_MODES$5;
  (function (CLEAR_MODES) {
      CLEAR_MODES[CLEAR_MODES["NO"] = 0] = "NO";
      CLEAR_MODES[CLEAR_MODES["YES"] = 1] = "YES";
      CLEAR_MODES[CLEAR_MODES["AUTO"] = 2] = "AUTO";
      CLEAR_MODES[CLEAR_MODES["BLEND"] = 0] = "BLEND";
      CLEAR_MODES[CLEAR_MODES["CLEAR"] = 1] = "CLEAR";
      CLEAR_MODES[CLEAR_MODES["BLIT"] = 2] = "BLIT";
  })(CLEAR_MODES$5 || (CLEAR_MODES$5 = {}));
  /**
   * The gc modes that are supported by pixi.
   *
   * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for PixiJS textures is AUTO
   * If set to GC_MODE, the renderer will occasionally check textures usage. If they are not
   * used for a specified period of time they will be removed from the GPU. They will of course
   * be uploaded again when they are required. This is a silent behind the scenes process that
   * should ensure that the GPU does not  get filled up.
   *
   * Handy for mobile devices!
   * This property only affects WebGL.
   * @name GC_MODES
   * @enum {number}
   * @static
   * @memberof PIXI
   * @property {number} AUTO - Garbage collection will happen periodically automatically
   * @property {number} MANUAL - Garbage collection will need to be called manually
   */
  var GC_MODES$5;
  (function (GC_MODES) {
      GC_MODES[GC_MODES["AUTO"] = 0] = "AUTO";
      GC_MODES[GC_MODES["MANUAL"] = 1] = "MANUAL";
  })(GC_MODES$5 || (GC_MODES$5 = {}));
  /**
   * Constants that specify float precision in shaders.
   * @name PRECISION
   * @memberof PIXI
   * @constant
   * @static
   * @enum {string}
   * @property {string} [LOW='lowp'] -
   * @property {string} [MEDIUM='mediump'] -
   * @property {string} [HIGH='highp'] -
   */
  var PRECISION$5;
  (function (PRECISION) {
      PRECISION["LOW"] = "lowp";
      PRECISION["MEDIUM"] = "mediump";
      PRECISION["HIGH"] =


stomers' chats are displayed, so you as a merchant can reply:

## Have an issue?

Join our [Discord](https://discord.com/invite/zqbBWNCCFJ) community to get real-time help from our team

## Community

- [Blog](https://connectycube.com/blog)
- X (twitter)[@ConnectyCube](https://x.com/ConnectyCube)
- [Facebook](https://www.facebook.com/ConnectyCube)
- [Medium](https://medium.com/@connectycube)
- [Youtube](https://www.youtube.com/@ConnectyCube)

**Want to support our team**:

## License

MIT

# Custom scheduled jobs

A scheduled job is a function executed at a specified interval of time in the background of your Medusa application.

> Learn more about scheduled jobs in [this documentation](https://docs.medusajs.com/learn/fundamentals/scheduled-jobs).

A scheduled job is created in a TypeScript or JavaScript file under the `src/jobs` directory.

For example, create the file `src/jobs/hello-world.ts` with the following content:

```ts
import {
  MedusaContainer
} from "@medusajs/framework/types";

export default async function myCustomJob(container: MedusaContainer) {
  const productService = container.resolve("product")

  const products = await productService.listAndCountProducts();

  // Do something with the products
}

export const config = {
  name: "daily-product-report",
  schedule: "0 0 * * *", // Every day at midnight
};
```

A scheduled job file must export:

- The function to be executed whenever it’s time to run the scheduled job.
- A configuration object defining the job. It has three properties:
  - `name`: a unique name for the job.
  - `schedule`: a [cron expression](https://crontab.guru/).
  - `numberOfExecutions`: an optional integer, specifying how many times the job will execute before being removed

The `handler` is a function that accepts one parameter, `container`, which is a `MedusaContainer` instance used to resolve services.
# Contributing

## Development

To set up the development environment:

1.  **Clone the repository**
    ```bash
    git clone git@github.com:ConnectyCube/chat-widget-medusa-plugin.git
    cd chat-widget-medusa-plugin
    ```
2.  **Install dependencies**
    ```bash
    yarn
    ```
3.  **Start development mode**
    ```bash
    yarn dev
    ```
    This command will:
    * Watch for changes in the plugin. Whenever a file is changed, the plugin is automatically built.
    * Publish the plugin changes to the local package registry. This will automatically update the plugin in the Medusa     application using it.
    * Provide real-time HMR updates of admin extensions.
4.  **Build**
    ```bash
    yarn build
    ```

## How to publish a new version

1.  **Ensure you have Node 20 installed, then run `npm i`**
    ```bash
    npm i
    ```
2.  **Update the library version in `package.json`**
3.  **


vertical-align: middle;
}

.latest_post_holder.image_in_box .latest_post_inner {
	display: table;
	width: 100%;
	margin: 0 0 0 !important;
}

.latest_post_inner .post_infos{
	display: block;
    font-weight: 500;
}

.latest_post_inner .post_infos a{
	color:#303030;
}

.latest_post_inner .post_infos a{
	margin: 0 7px 0 0;
}

.latest_post_inner .post_infos a.post_comments{
	margin: 0;
}

.latest_post_inner .post_infos a:hover{
	color:#f25f33;
}

.latest_post_holder.minimal .latest_post_inner .post_infos{
	margin:0 0 3px 0;
}

.latest_post_holder.image_in_box .latest_post_text .latest_post_title {
	margin:-3px 0 2px 0;
}
.latest_post_holder.image_in_box .latest_post_text .excerpt {
	margin:0 0 8px 0;
}
.latest_post_holder .post_infos .dots{
	padding: 0 7px 0 7px;
}
.latest_post_holder .post_infos .dots i{
	font-size: 3px;
	vertical-align: middle;
}

/* ==========================================================================
   Blog Masonry Shortcode
   ========================================================================== */

.q_masonry_blog {
    margin-bottom: 50px;
    transition: none !important;
    overflow: visible !important;
    opacity: 0;
    filter: alpha(opacity=0);
}

.q_masonry_blog article,
.full_width .grid_section .q_masonry_blog article
{
	width: 31.2%;
	margin: 0 0 20px;
	padding: 0;
	text-align: left;
	vertical-align: top;
    z-index: 100;
    border: 0;
	background-color: #fff;
    float: left;
    display: block;
}
.full_width .q_masonry_blog article{
    width: 18.9%;
    margin-left: 0.5%;
    margin-right: 0.5%;
}
.q_masonry_blog article.format-link:hover,
.q_masonry_blog article.format-quote:hover{
	background-color: #f25f33;
}
.q_masonry_blog article.format-link .q_masonry_blog_post_title,
.q_masonry_blog article.format-quote .q_masonry_blog_post_title{
	padding: 0 0 0 60px;
}
.q_masonry_blog article.format-quote .q_masonry_blog_post_text i.qoute_mark,
.q_masonry_blog article.format-link .q_masonry_blog_post_text i.link_mark {
	margin: 7px 0 0;
	color: #c0c0c0;
	font-size: 36px;
}
.q_masonry_blog article.format-quote .q_masonry_blog_post_text p,
.q_masonry_blog article.format-link .q_masonry_blog_post_text p{
	font-size: 21px;
	line-height: 35px;
	color: #303030;
}
.q_masonry_blog article.format-link:hover .q_masonry_blog_post_info,
.q_masonry_blog article.format-link:hover .q_masonry_blog_post_info a,
.q_masonry_blog article.format-quote:hover .q_masonry_blog_post_info,
.q_masonry_blog article.format-quote:hover .q_masonry_blog_post_info


.9,271.06,144.3ZM565.27,328.1c-11.8-10.7-30.2-10-42.6,0L430.27,402a63.64,63.64,0,0,1-40,14H272a16,16,0,0,1,0-32h78.29c15.9,0,30.71-10.9,33.25-26.6a31.2,31.2,0,0,0,.46-5.46A32,32,0,0,0,352,320H192a117.66,117.66,0,0,0-74.1,26.29L71.4,384H16A16,16,0,0,0,0,400v96a16,16,0,0,0,16,16H372.77a64,64,0,0,0,40-14L564,377a32,32,0,0,0,1.28-48.9Z"],
    "hand-holding-water": [576, 512, [], "f4c1", "M288 256c53 0 96-42.1 96-94 0-40-57.1-120.7-83.2-155.6-6.4-8.5-19.2-8.5-25.6 0C249.1 41.3 192 122 192 162c0 51.9 43 94 96 94zm277.3 72.1c-11.8-10.7-30.2-10-42.6 0L430.3 402c-11.3 9.1-25.4 14-40 14H272c-8.8 0-16-7.2-16-16s7.2-16 16-16h78.3c15.9 0 30.7-10.9 33.3-26.6 3.3-20-12.1-37.4-31.6-37.4H192c-27 0-53.1 9.3-74.1 26.3L71.4 384H16c-8.8 0-16 7.2-16 16v96c0 8.8 7.2 16 16 16h356.8c14.5 0 28.6-4.9 40-14L564 377c15.2-12.1 16.4-35.3 1.3-48.9z"],
    "hand-lizard": [576, 512, [], "f258", "M384 480h192V363.778a95.998 95.998 0 0 0-14.833-51.263L398.127 54.368A48 48 0 0 0 357.544 32H24C10.745 32 0 42.745 0 56v16c0 30.928 25.072 56 56 56h229.981c12.844 0 21.556 13.067 16.615 24.923l-21.41 51.385A32 32 0 0 1 251.648 224H128c-35.346 0-64 28.654-64 64v8c0 13.255 10.745 24 24 24h147.406a47.995 47.995 0 0 1 25.692 7.455l111.748 70.811A24.001 24.001 0 0 1 384 418.539V480z"],
    "hand-middle-finger": [512, 512, [], "f806", "M479.93 317.12a37.33 37.33 0 0 0-28.28-36.19L416 272v-49.59c0-11.44-9.69-21.29-23.15-23.54l-38.4-6.4C336.63 189.5 320 200.86 320 216v32a8 8 0 0 1-16 0V50c0-26.28-20.25-49.2-46.52-50A48 48 0 0 0 208 48v200a8 8 0 0


length() - buffer.length;
    in.setRange(rangeStart, buffer.length);
    readOrDie(in, buffer, 0, buffer.length);
    int offset = locateStartOfEocd(buffer);
    if (offset == -1) {
      return -1;
    }
    return rangeStart + offset;
  }

  /**
   * Find the end-of-central-directory record by scanning backwards looking for the signature of the
   * record.
   * @param buffer the buffer in which to search
   * @return the offset in the buffer at which the first byte of the EOCD signature is located, or
   * -1 if the complete signature is not found
   */
  public static int locateStartOfEocd(byte[] buffer) {
    int last4Bytes = 0; // This is the 32 bits of data from the file
    for (int offset = buffer.length - 1; offset >= 0; offset--) {
      last4Bytes <<= 8;
      last4Bytes |= buffer[offset];
      if (last4Bytes == EOCD_SIGNATURE) {
        return offset;
      }
    }
    return -1;
  }

  /**
   * Parse the end-of-central-directory record and return the critical information from it.
   * @param in the input stream to read from, assumed to start at the first byte of the entry
   * @return the metadata
   * @throws IOException if unable to read
   * @throws ZipException if the metadata indicates this is a zip64 archive, which is not supported
   */
  public static MinimalCentralDirectoryMetadata parseEocd(InputStream in)
      throws IOException, ZipException {
    if (((int) read32BitUnsigned(in)) != EOCD_SIGNATURE) {
      throw new ZipException("Bad eocd header");
    }

    // *** 4 bytes encode EOCD_SIGNATURE, ignore (already found and verified).
    // 2 bytes encode disk number for this archive, ignore.
    // 2 bytes encode disk number for the central directory, ignore.
    // 2 bytes encode num entries in the central directory on this disk, ignore.
    // *** 2 bytes encode num entries in the central directory overall [READ THIS]
    // *** 4 bytes encode the length of the central directory [READ THIS]
    // *** 4 bytes encode the file offset of the central directory [READ THIS]
    // 2 bytes encode the length of the zip file comment, ignore.
    // Everything else from here to the EOF is the zip file comment, or junk. Ignore.
    skipOrDie(in, 2 + 2 + 2);
    int numEntriesInCentralDirectory = read16BitUnsigned(in);
    if (numEntriesInCentralDirectory == 0xffff) {
      // If 0xffff, this is a zip64 archive and this code doesn't handle that.
      throw new ZipException("No support for zip64");
    }
    long lengthOfCentralDirectory = read32BitUnsigned(in);
    long offsetOfCentralDirectory = read32BitUnsigned(in);
    return new MinimalCentralDirectoryMetadata(
        numEntriesInCentralDirectory, offsetOfCentralDirectory, lengthOfCentralDirectory);
  }
}
// Copyright 2016 Google Inc. All rights reserved.
//
// 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.google.archivepatcher.shared;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Tests for {@li


(e).value,{pairs:A}=t,n=A.length,r=N1.Location(t,e);return bn(n,1,1,(e=>(r.element=e,r)),!0)}function T1(e,t,A){const{objectId:n,groupId:r}=e;if(A===n){const e=x1.get(t).value;if(e.pairs[r])return N1.Loci(t,e,[r])}return __}function P1(e,t,A){let n=!1;if(N1.isLoci(e)){if(!MI.areEquivalent(e.data.structure,t))return!1;const r=x1.get(t).value;if(e.data.crossLinkRestraints!==r)return!1;for(const t of e.elements)A(Ir.ofSingleton(t))&&(n=!0)}return n}const O1={"cross-link-restraint":(e,t)=>KK("Cross-link restraint",e,t,_1)},K1={...Y1},J1={name:N1.Tag.CrossLinkRestraint,label:"Cross Link Restraint",description:"Displays cross-link restraints.",factory:function(e,t){return xV.createMulti("CrossLinkRestraint",e,t,rj,O1)},getParams:function(e,t){return Cn.clone(K1)},defaultValues:Cn.getDefaultValues(K1),defaultColorTheme:{name:N1.Tag.CrossLinkRestraint},defaultSizeTheme:{name:"uniform"},isApplicable:e=>N1.isApplicable(e),ensureCustomProperties:{attach:(e,t)=>x1.attach(e,t,void 0,!0),detach:e=>x1.ref(e,!1)}},j1=ke(13421772),z1={domain:Cn.Interval([.5,1.5],{step:.01}),list:Cn.ColorList("red-grey",{presetKind:"scale"})},q1={name:"cross-link",label:"Cross Link",category:m_.Category.Misc,factory:function e(t,A){let n,r;const i=t.structure&&x1.get(t.structure).value;if(i){r=Vo.create({domain:A.domain,listOrName:A.list.colors});const e=r.color;n=t=>{if(N1.isLocation(t)){const A=i.pairs[t.element];if(A)return e(N1.distance(A)/A.distanceThreshold)}return j1}}else n=()=>j1;return{factory:e,granularity:"group",color:n,props:A,description:"Colors cross-links by the deviation of the observed distance versus the modeled distance (e.g. modeled / `ihm_cross_link_restraint.distance_threshold`).",legend:r?r.legend:void 0}},getParams:function(e){return z1},defaultValues:Cn.getDefaultValues(z1),isApplicable:e=>!!e.structure&&N1.isApplicable(e.structure),ensureCustomProperties:{attach:(e,t)=>t.structure?x1.attach(e,t.structure,void 0,!0):Promise.resolve(),detach:e=>e.structure&&x1.ref(e.structure,!1)}},Z1=vZ.create({name:"integrative-cross-link-restraint",category:"custom-props",display:{name:"Cross Link Restraint"},ctor:class extends vZ.Handler{constructor(){super(...arguments),this.provider=D1.Provider}register(){this.provider.formatRegistry.add("mmCIF",W1),this.ctx.representation.structure.themes.colorThemeRegistry.add(q1),this.ctx.representation.structure.registry.add(J1)}unregister(){this.provider.formatRegistry.remove("mmCIF"),this.ctx.representation.structure.themes.colorThemeRegistry.remove(q1),this.ctx.representation.structure.registry.remove(J1


   );
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return true;
  }
}
import 'dart:ui';

import '../../ui/model/style.dart';
import '../api/model/grade.dart';
import '../api/model/subject.dart';

int roundGrade(double grade) {
  if (grade < 2) {
    return 1;
  }
  if (grade < 2.5) {
    return 2;
  }
  if (grade < 3.5) {
    return 3;
  }
  if (grade < 4.5) {
    return 4;
  }

  return 5;
}

int percentageToGrade(int grade) {
  if (grade < 50) {
    return 1;
  }
  if (grade < 60) {
    return 2;
  }
  if (grade < 70) {
    return 3;
  }
  if (grade < 80) {
    return 4;
  }

  return 5;
}

Color getGradeColor(double grade) {
  switch (roundGrade(grade)) {
    case 2:
      return appStyle.colors.grade2;
    case 3:
      return appStyle.colors.grade3;
    case 4:
      return appStyle.colors.grade4;
    case 5:
      return appStyle.colors.grade5;
    default:
      return appStyle.colors.grade1;
  }
}

extension GradeListExtension on List<Grade> {
  double getAverageBySubject(Subject subject) {
    var weightTotal = 0.00;
    var sum = 0.00;

    for (var grade in this) {
      if (grade.subject.uid == subject.uid) {
        if (grade.numericValue != null) {
          var weight = (grade.weightPercentage ?? 100) / 100.0;
          weightTotal += weight;

          sum += grade.numericValue! * weight;
        }
      }
    }

    return sum / weightTotal;
  }
}
/*
  Firka, alternative e-Kréta client.
  Copyright (C) 2025  QwIT Development

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

class Constants {
  static const clientId = "kreta-ellenorzo-student-mobile-ios";
}

class KretaEndpoints {
  static String kretaBase = "e-kreta.hu";
  static String kreta(String iss) {
    if (iss == "firka-test") {
      return kretaBase;
    } else {
      return "https://$iss.$kretaBase";
    }
  }

  static String kretaIdp = "https://idp.e-kreta.hu";
  static String kretaLoginUrl =
      "$kretaIdp/Account/Login?ReturnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fprompt%3Dlogin%26nonce%3DwylCrqT4oN6PPgQn2yQB0euKei9nJeZ6_ffJ-VpSKZU%26response_type%3Dcode%26code_challenge_method%3DS256%26scope%3Dopenid%2520email%2520offline_access%2520kreta-ellenorzo-webapi.public%2520kreta-eugyintezes-webapi.public%2520kreta-fileservice-webapi.public%2520kreta-mobile-global-webapi.public%2520kreta-dkt-webapi.public%2520kreta-ier-webapi.public%26code_challenge%3DHByZRRnPGb-Ko_wTI7ibIba1HQ6lor0ws4bcgReuYSQ%26redirect_uri%3Dhttps%253A


 x;
''',
      [
        error(CompileTimeErrorCode.undefinedIdentifier, 21, 1),
        error(WarningCode.deadCode, 21, 1),
        error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 21, 1),
      ],
    );
  }

  test_visitConditionalExpression_eager_true_invalid_int() async {
    await assertErrorsInCode(
      '''
const c = true ? x : 0;
''',
      [
        error(CompileTimeErrorCode.undefinedIdentifier, 17, 1),
        error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 17, 1),
        error(WarningCode.deadCode, 21, 1),
      ],
    );
  }

  test_visitConditionalExpression_lazy_false_int_int() async {
    await assertErrorsInCode(
      '''
const c = false ? 1 : 0;
''',
      [error(WarningCode.deadCode, 18, 1)],
    );
    var result = _topLevelVar('c');
    assertDartObjectText(result, r'''
int 0
  variable: <testLibrary>::@topLevelVariable::c
''');
  }

  test_visitConditionalExpression_lazy_false_int_invalid() async {
    await assertErrorsInCode(
      '''
const c = false ? 1 : new C();
''',
      [
        error(WarningCode.deadCode, 18, 1),
        error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 22, 7),
        error(CompileTimeErrorCode.newWithNonType, 26, 1),
      ],
    );
  }

  test_visitConditionalExpression_lazy_false_invalid_int() async {
    await assertErrorsInCode(
      '''
const c = false ? new C() : 0;
''',
      [
        error(WarningCode.deadCode, 18, 7),
        error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 18, 7),
        error(CompileTimeErrorCode.newWithNonType, 22, 1),
      ],
    );
  }

  test_visitConditionalExpression_lazy_invalid_int_int() async {
    await assertErrorsInCode(
      '''
const c = 3 ? 1 : 0;
''',
      [
        error(CompileTimeErrorCode.nonBoolCondition, 10, 1),
        error(CompileTimeErrorCode.constEvalTypeBool, 10, 1),
      ],
    );
  }

  test_visitConditionalExpression_lazy_true_int_int() async {
    await assertErrorsInCode(
      '''
const c = true ? 1 : 0;
''',
      [error(WarningCode.deadCode, 21, 1)],
    );
    var result = _topLevelVar('c');
    assertDartObjectText(result, r'''
int 1
  variable: <testLibrary>::@topLevelVariable::c
''');
  }

  test_visitConditionalExpression_lazy_true_int_invalid() async {
    await assertErrorsInCode(
      '''
const c = true ? 1: new C();
''',
      [
        error(WarningCode.deadCode, 20, 7),
        error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 20, 7),
        error(CompileTimeErrorCode.newWithNonType, 24, 1),
      ],
    );
  }

  test_visitConditionalExpression_lazy_true_invalid_int() async {
    await assertErrorsInCode(
      '''
const c = true ? new C() : 0;
class C {}
''',
      [
        error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 17, 7),
        error(WarningCode.deadCode, 27, 1),
      ],
    );
  }

  test_visitConditionalExpression_lazy_unknown_int_invalid() async {
    await assertErrorsInCode(
      '''
const c = identical(0, 0.0) ? 1 : new Object();
''',
      [
        error(
          CompileTimeErrorCode.constI


   3178
## # … with 76 more rows
```

---

```r
library(survival)
# Load in dataset
data(colon)
# Show first 6 rows of the dataset
head(colon)
```

```
##   id study      rx sex age obstruct perfor adhere nodes status differ extent
## 1  1     1 Lev+5FU   1  43        0      0      0     5      1      2      3
## 2  1     1 Lev+5FU   1  43        0      0      0     5      1      2      3
## 3  2     1 Lev+5FU   1  63        0      0      0     1      0      2      3
## 4  2     1 Lev+5FU   1  63        0      0      0     1      0      2      3
## 5  3     1     Obs   0  71        0      0      1     7      1      2      2
## 6  3     1     Obs   0  71        0      0      1     7      1      2      2
##   surg node4 time etype
## 1    0     1 1521     2
## 2    0     1  968     1
## 3    0     0 3087     2
## 4    0     0 3087     1
## 5    0     1  963     2
## 6    0     1  542     1
```

The `colon` dataset contains several variables, among which the treatment, sex (1 = male), age, and several trial-specific indicators. `etype` indicates the event of a death or a recurrence.
---
Several functions we've seen for transforming data:

1) select

2) filter

3) mutate

4) arrange

5) summarise

Exercise: let's do the following consecutive operations on our `colon` dataset (make sure to use the %>% operator!).

1) The `study` column only contains ones, so remove it for clarity

2) We only want rows with etype 2 (these are death events rather than recurrence)

3) Round time to months (for simplicity, assume a month has exactly 30 days)

4) Sort our dataframe by age (from low to high age)

5) Show a simple summary of the average survival time, in months, grouped by treatment.

---

### Solution

```r
colon %>%
  select(-study) %>%
  filter(etype == 2) %>%
  mutate(time = round(time/30)) %>%
  arrange(age) %>%
  group_by(rx) %>%
  summarise(avg_months = mean(time))
```

```
## `summarise()` ungrouping output (override with `.groups` argument)
```

```
## # A tibble: 3 x 2
##   rx      avg_months
##   <fct>        <dbl>
## 1 Obs           53.3
## 2 Lev           53.8
## 3 Lev+5FU       60.0
```

---

# Plotting with `ggplot2`

```r
flights %>%
    filter(arr_delay <= 360) %>%
    ggplot(aes(x = factor(month), y = arr_delay, color = origin)) +
    geom_boxplot() +
    ggtitle("Delay by Month") +
    xlab("Month") +
    ylab("Arrival Delay (min)")
```

![](lab1_files/figure-html/unnamed-chunk-25-1.png)<!-- -->

---
# Plotting with `ggplot2`

```r
fl


  L: 'yello',
  F: 'en',
  K: 'ch',
  G: 'arks',
  H: 'ea',
  I: 'ightg',
  J: 'wh'
};
const names$1 = {
  OiceXe: 'f0f8ff',
  antiquewEte: 'faebd7',
  aqua: 'ffff',
  aquamarRe: '7fffd4',
  azuY: 'f0ffff',
  beige: 'f5f5dc',
  bisque: 'ffe4c4',
  black: '0',
  blanKedOmond: 'ffebcd',
  Xe: 'ff',
  XeviTet: '8a2be2',
  bPwn: 'a52a2a',
  burlywood: 'deb887',
  caMtXe: '5f9ea0',
  KartYuse: '7fff00',
  KocTate: 'd2691e',
  cSO: 'ff7f50',
  cSnflowerXe: '6495ed',
  cSnsilk: 'fff8dc',
  crimson: 'dc143c',
  cyan: 'ffff',
  xXe: '8b',
  xcyan: '8b8b',
  xgTMnPd: 'b8860b',
  xWay: 'a9a9a9',
  xgYF: '6400',
  xgYy: 'a9a9a9',
  xkhaki: 'bdb76b',
  xmagFta: '8b008b',
  xTivegYF: '556b2f',
  xSange: 'ff8c00',
  xScEd: '9932cc',
  xYd: '8b0000',
  xsOmon: 'e9967a',
  xsHgYF: '8fbc8f',
  xUXe: '483d8b',
  xUWay: '2f4f4f',
  xUgYy: '2f4f4f',
  xQe: 'ced1',
  xviTet: '9400d3',
  dAppRk: 'ff1493',
  dApskyXe: 'bfff',
  dimWay: '696969',
  dimgYy: '696969',
  dodgerXe: '1e90ff',
  fiYbrick: 'b22222',
  flSOwEte: 'fffaf0',
  foYstWAn: '228b22',
  fuKsia: 'ff00ff',
  gaRsbSo: 'dcdcdc',
  ghostwEte: 'f8f8ff',
  gTd: 'ffd700',
  gTMnPd: 'daa520',
  Way: '808080',
  gYF: '8000',
  gYFLw: 'adff2f',
  gYy: '808080',
  honeyMw: 'f0fff0',
  hotpRk: 'ff69b4',
  RdianYd: 'cd5c5c',
  Rdigo: '4b0082',
  ivSy: 'fffff0',
  khaki: 'f0e68c',
  lavFMr: 'e6e6fa',
  lavFMrXsh: 'fff0f5',
  lawngYF: '7cfc00',
  NmoncEffon: 'fffacd',
  ZXe: 'add8e6',
  ZcSO: 'f08080',
  Zcyan: 'e0ffff',
  ZgTMnPdLw: 'fafad2',
  ZWay: 'd3d3d3',
  ZgYF: '90ee90',
  ZgYy: 'd3d3d3',
  ZpRk: 'ffb6c1',
  ZsOmon: 'ffa07a',
  ZsHgYF: '20b2aa',
  ZskyXe: '87cefa',
  ZUWay: '778899',
  ZUgYy: '778899',
  ZstAlXe: 'b0c4de',
  ZLw: 'ffffe0',
  lime: 'ff


distance.
   *

   *
   * @param me
   *          the mouse event over the chart.
   *
   * @param chart
   *          to search points within.
   *
   * @return e nearest {@link MouseEvent} to the given mouse
   *         event's screen coordinates or null if no point was
   *         found / service is not implemented.
   */
  public ITracePoint2D getNearestPoint(final MouseEvent me, final Chart2D chart);

}
/*
 *  ZoomableChart.java of project jchart2d, a chart enriched
 *  by zoom functionality in x dimension.
 *  Copyright (C) 2004 - 2011 Achim Westermann.
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA*
 *  If you modify or optimize the code in a useful way please let me know.
 *  Achim.Westermann@gmx.de
 *
 */
package info.monitorenter.gui.chart;

import info.monitorenter.gui.chart.rangepolicies.RangePolicyFixedViewport;
import info.monitorenter.gui.chart.rangepolicies.RangePolicyUnbounded;
import info.monitorenter.util.Range;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.util.Iterator;
import java.util.List;

/**
 * {@link info.monitorenter.gui.chart.Chart2D} enriched by a
 * zoom-functionality in the x and y dimension.
 *

 *
 * @author Alessio Sambarino (Contributor)
 * @author Klaus Pesendorfer (Bugfix contributor)
 * @author Anadi Mishra (Bugfix contributor)
 *
 * @version $Revision: 1.19 $
 *
 */
public class ZoomableChart extends Chart2D implements MouseListener, MouseMotionListener {

  /**
   * Generated serial version UID.
   *

   */
  private static final long serialVersionUID = 8799808716942023907L;

  /**
   * Store the last mouse click and test in the mouseDragged-method which
   * mouse-button was clicked.
   */
  private int m_lastPressedButton;

  /** The starting point of the mouse drag operation (click, then move). */
  private Point2D m_startPoint;

  /**
   * Range policy used to zoom out to the minimum bounds that show every data
   * point.
   */
  private IRangePolicy m_zoomAllRangePolicy = new RangePolicyUnbounded();

  /** The area to zoom. */
  private Rectangle2D m_zoomArea;

  /**
   * Defcon.
   *


tpbmc= 14394
IGNlbGVicmF0aW9u 14395
anU= 14396
IHNpbGx5 14397
RXVybw== 14398
IHRhdHQ= 14399
aWdodHk= 14400
Y29udHJvbGxlZA== 14401
VGVzdA== 14402
IFNpbmdo 14403
IHJhZ2U= 14404
IHJoeXRo 14405
b2ZmaWM= 14406
IFBoYW50b20= 14407
IGhlYWRsaW5lcw== 14408
IHJlc3BvbmRpbmc= 14409
IE1vcm5pbmc= 14410
IHZpdGFtaW4= 14411
IGJvb3Rz 14412
IFNpdGU= 14413
YWxpbg== 14414
cGk= 14415
IHZpcmFs 14416
IFVD 14417
REVS 14418
IFNleA== 14419
IHN0b2Nrcw== 14420
Y3VycmVudA== 14421
IGNodXJjaGVz 14422
IFJhcmU= 14423
IE11cnBoeQ== 14424
IGRlbmlhbA== 14425
IEdhbWluZw== 14426
IHRvdWc= 14427
IG5pY2s= 14428
IG1ha2Vycw== 14429
IFJvbmFsZA== 14430
IGdlbmVyb3Vz 14431
IERvYw== 14432
IE1vcnJpcw== 14433
IHRyYW5zZm9ybWVk 14434
IE5vcm1hbA== 14435
IDEwNA== 14436
IEtpY2tzdGFydGVy 14437
IFVwb24= 14438
T25saW5l 14439
IElSUw== 14440
IHdyYXA= 14441
IGxvdmluZw== 14442
IGFycml2ZXM= 14443
IER1ZQ== 14444
IGhldGVy 14445
IE1hZGU= 14446
IHJlbnRhbA== 14447
IGJlbG9uZ3M= 14448
IGF0dG9ybmV5cw== 14449
IGNyb3Bz 14450
IG1hdGNoZWQ= 14451
dWx1bQ== 14452
b2xpbmU= 14453
MTA5 14454
IGRpc3Bhcg== 14455
IGJ1eWVycw== 14456
IENhbWJyaWRnZQ== 14457
IGV0aGljcw== 14458
cm91cHM= 14459
IGp1c3RpZmllZA== 14460
IG1hcmdpbmFs 14461
IHJlc3BlY3RlZA== 14462
d2lubmluZw== 14463
IG5vZGRlZA== 14464
IFNlcmdl 14465
IEZvcm1lcg== 14466
Q3JhZnQ= 14467
IyMjIyMjIyMjIyMjIyMjIw== 14468
IFdhcm5lcg== 14469
IGRhc2g= 14470
ZXRl 14471
IGVudGVydA== 14472
IEVzY2FwZQ== 14473
b3V0aGVhc3Q= 14474
IGtuZWVz 14475
IEJvbWI= 14476
IHJ1Zw== 14477
UGFzcw== 14478
IGF0dGl0dWRlcw== 14479
Z292ZXJubWVudA== 14480
IFByaW9y 14481
IHF1YWxpdGllcw== 14482
IG5vdGlmaWNhdGlvbg== 14483
IFBob25l 14484
bGll 14485
IGFudGljaXBhdGVk 14486
IENvbWJhdA== 14487
IEJhcnJ5 14488
IDE5ODI= 14489
VXNlcnM= 14490
b25lcg=


ndow

export function main(param: GameMainParameterObject): void {

	const scene = new g.Scene({
		game: g.game,
		// このシーンで利用するアセットのIDを列挙し、シーンに通知します
		// tslint:disable-next-line: max-line-length
		assetIds: ["toomo", "nami", "nami_2", "nami_3", "hari", "hari_hanten", "karaoke", "bakkure_1", "doutei_toomo", "inu", "n_kou", "karaoke_2", "tuusinbo", "korean", "gozyou", "magao", "launch", "taoru", "intai", "kiyomizu", "GET", "GET_Short", "end", "result"]
	})
	let time = 70 // 制限時間
	if (param.sessionParameter.totalTimeLimit) {
		time = param.sessionParameter.totalTimeLimit // セッションパラメータで制限時間が指定されたらその値を使用します
	}
	// 市場コンテンツのランキングモードでは、g.game.vars.gameState.score の値をスコアとして扱います
	g.game.vars.gameState = { score: 0 }

	/** @param fishLevel 一度に釣れる量。 */
	let fishLevel = 2
	/** @param nowFishCount 釣れたかず */
	let nowFishCount = 0
	/** @param turibariList 釣り針の画像の配列 */
	const turibariList: g.Sprite[] = []
	/** @param fishList 生成した魚の配列 */
	const fishList: g.E[] = []
	/** @param turibariXposList 釣り針の横の位置の配列 */
	const turibariXposList: number[] = []
	/** @param turibariXposList 釣り針の縦の位置の配列 */
	const turibariYposList: number[] = []
	/** @param isGameEndImgShow 終了画面になったらtrue */
	let isGameEndImgShow = false
	/** @param wave 波の画像 */
	let wave: g.Sprite
	/** 釣った魚のInterface。TypeScriptの独自要素 */
	interface GetFishObj {
		/** 魚の名前 */
		name: string
		/** 魚のポイント */
		point: number
	}
	/** @param playAllGetFishList ゲームをプレイ中に釣った魚の配列。 */
	const playAllGetFishList: GetFishObj[] = []

	/**
	 * この関数はタイトル用のSceneを生成します。
	 * @returns 生成したSceneです。
	 */
	const createTitleScene = (): g.Scene => {
		const titlescene = new g.Scene({
			game: g.game,
			// このシーンで利用するアセットのIDを列挙し、シーンに通知します
			assetIds: ["title"]
		})
		// 読み込んだら
		titlescene.loaded.add(() => {
			// タイトル画像を召喚します
			const titleImage = new g.Sprite({
				scene: titlescene,
				src: titlescene.assets["title"]
			})
			titlescene.append(titleImage)
		})
		return titlescene
	}

	// タイトル表示
	const titleScene = createTitleScene()
	g.game.pushScene(titleScene)
	// 5秒経過すればゲーム開始。
	titleScene.setTimeout(() => {
		// ゲームロードできた
		scene.loaded.add(() => {
			// 5秒引いておく
			time -= 5
			// 多分放送画面が暗いと文字が見えないので水色をバックに
			const blueBack = new g.FilledRect({
				scene: scene,
				cssColor: "lightskyblue",
				width: g.game.width,
				height: g.game.height
			})
			scene.append(blueBack)

			// プレイヤーを生成します
			const player = new g.Sprite({
				scene: scene,
				src: scene.assets["toomo"],
				width: (scene.assets["toomo"] as g.ImageAsset).width,
				height: (scene.assets["toomo"] as g.ImageAsset).height,
				x: 50,
				y: 50
			})
			scene.append(player)

			// 波の生成
			// 長くなった


),
        new PathDate(null, null, "null/Test9"),
        new PathDate(null, null, ""), //Test10 Intentionally empty.
        new PathDate(
            new DateTime(2011, 10, 20, 20, 30, 0, 0, ISOChronology.getInstanceUTC()),
            null,
            "error/y=2011/m=10/d=20/H=20/M=42/S=72/Test11"
        ),
        new PathDate(null, IllegalFieldValueException.class, "error/y=2011/m=10/d=20/H=20/M=90/S=24/Test12"),
        new PathDate(null, IllegalFieldValueException.class, "error/y=2011/m=10/d=20/H=42/M=42/S=24/Test13"),
        new PathDate(null, IllegalFieldValueException.class, "error/y=2011/m=10/d=33/H=20/M=42/S=24/Test14"),
        new PathDate(null, IllegalFieldValueException.class, "error/y=2011/m=13/d=20/H=20/M=42/S=24/Test15")
    };

    checkToDate(FIFTEEN_MINUTE, Granularity.Formatter.DEFAULT, minuteChecks);
  }

  @Test
  public void testHourToDate()
  {
    PathDate[] hourChecks = {
        new PathDate(
            new DateTime(2011, 3, 15, 20, 0, 0, 0, ISOChronology.getInstanceUTC()),
            null,
            "y=2011/m=03/d=15/H=20/M=50/S=43/Test0"
        ),
        new PathDate(
            new DateTime(2011, 3, 15, 20, 0, 0, 0, ISOChronology.getInstanceUTC()),
            null,
            "/y=2011/m=03/d=15/H=20/M=50/S=43/Test0"
        ),
        new PathDate(
            new DateTime(2011, 3, 15, 20, 0, 0, 0, ISOChronology.getInstanceUTC()),
            null,
            "valid/y=2011/m=03/d=15/H=20/M=50/S=43/Test1"
        ),
        new PathDate(
            new DateTime(2011, 3, 15, 20, 0, 0, 0, ISOChronology.getInstanceUTC()),
            null,
            "valid/y=2011/m=03/d=15/H=20/M=50/Test2"
        ),
        new PathDate(
            new DateTime(2011, 3, 15, 20, 0, 0, 0, ISOChronology.getInstanceUTC()),
            null,
            "valid/y=2011/m=03/d=15/H=20/Test3"
        ),
        new PathDate(null, null, "valid/y=2011/m=03/d=15/Test4"),
        new PathDate(null, null, "valid/y=2011/m=03/Test5"),
        new PathDate(null, null, "valid/y=2011/Test6"),
        new PathDate(null, null, "null/y=/m=/d=/Test7"),
        new PathDate(null, null, "null/m=10/y=2011/d=23/Test8"),
        new PathDate(null, null, "null/Test9"),
        new PathDate(null, null, ""), //Test10 Intentionally empty.
        new PathDate(
            new DateTime(2011, 10, 20, 20, 0, 0, 0, ISOChronology.getInstanceUTC()),
            null,
            "error/y=2011/m=10/d=20/H=20/M=42/S=72/Test11"
        ),
        new PathDate(
            new DateTime(2011, 10, 20, 20, 0, 0, 0, ISOChronology.getInstanceUTC()),
            null,
            "error/y=2011/m=10/d=20/H=20/M=90/S=24/Test12"
        ),
        new PathDate(null,


                "Unexpected chat input; expected value 80 characters or less, " +
                    "input len: ${text.length}, input: $text"
            }
            require(colour in 0..20) {
                "Unexpected colour value: $colour, expected range: 0-20"
            }
            // No verification for mod icons, as servers often create custom ranks
        }
        val patternLength = if (colour in 13..20) colour - 12 else 0
        // Unlike most inputs, these are necessary to avoid crashes, so these can't be turned off.
        if (patternLength in 1..8) {
            requireNotNull(pattern) {
                "Pattern cannot be null if pattern length is defined."
            }
            require(pattern.size == patternLength) {
                "Pattern length does not match the size configured in the colour property."
            }
        }
        blocks.chat.colour = colour.toUByte()
        blocks.chat.effects = effects.toUByte()
        blocks.chat.modicon = modicon.toUByte()
        blocks.chat.autotyper = autotyper
        blocks.chat.text = text
        blocks.chat.pattern = pattern
        flags = flags or CHAT
    }

    /**
     * Sets an exact movement for this avatar. It should be noted
     * that this is done in conjunction with actual movement, as the
     * exact move extended info block is only responsible for visualizing
     * precise movement, and will synchronize to the real coordinate once
     * the exact movement has finished.
     *
     * @param deltaX1 the coordinate delta between the current absolute
     * x coordinate and where the avatar is going.
     * @param deltaZ1 the coordinate delta between the current absolute
     * z coordinate and where the avatar is going.
     * @param delay1 how many client cycles (20ms/cc) until the avatar arrives
     * at x/z 1 coordinate.
     * @param deltaX2 the coordinate delta between the current absolute
     * x coordinate and where the avatar is going.
     * @param deltaZ2 the coordinate delta between the current absolute
     * z coordinate and where the avatar is going.
     * @param delay2 how many client cycles (20ms/cc) until the avatar arrives
     * at x/z 2 coordinate.
     * @param angle the angle the avatar will be facing throughout the exact movement,
     * with 0 implying south, 512 west, 1024 north and 1536 east; interpolate
     * between to get finer directions.
     */
    public fun setExactMove(
        deltaX1: Int,
        deltaZ1: Int,
        delay1: Int,
        deltaX2: Int,
        deltaZ2: Int,
        delay2: Int,
        angle: Int,
    ) {
        checkCommunicationThread()
        verify {
            require(delay1 >= 0) {
                "First delay cannot be negative: $delay1"
            }
            require(delay2 >= 0) {
                "Second delay cannot be negative: $delay2"
            }
            require(angle in 0..2047) {
                "Unexpected angle value: $angle, expected range: 0..2047"
            }
            require(deltaX1 in SIGNED_BYTE_RANGE) {
                "Unexpected deltaX1: $deltaX1, expected range: $SIGNED_BYTE_RANGE"
            }
            require(deltaZ1 in SIGNED_BYTE_RANGE) {
                "Unexpected deltaZ1: $deltaZ1, expected range: $SIGNED_BYTE_RANGE"
            }
            require(deltaX2 in SIGNED_BYTE_RANGE) {
                "Unexpected deltaX1: $deltaX2, expected range: $SIGNED_BYTE_RANGE"
            }
            require(deltaZ2 in SIGNED_BYTE_RANGE) {
                "Unexpected deltaZ1: $deltaZ2, expected range: $SIGNED_BYTE_RANGE"
            }
        }
        blocks.exactMove.deltaX1 = deltaX1.toUByte()
        blocks.exactMove.deltaZ1 = deltaZ1.toUByte()
        blocks.exactMove.delay1


ide2d::shape::Cuboid;

fn main() {
    /*
     * Initialize the shapes.
     */
    let cube1 = Cuboid::new(Vector2::repeat(0.5));
    let cube2 = Cuboid::new(Vector2::new(1.0, 0.5));

    let cube1_pos = Isometry2::new(Vector2::y(), na::zero()); // 1.0 along the `y` axis.
    let cube2_pos = na::one::<Isometry2<f32>>(); // Id matrix.

    /*
     * Compute their bounding spheres.
     */
    let bounding_sphere_cube1 = bounding_volume::bounding_sphere(&cube1, &cube1_pos);
    let bounding_sphere_cube2 = bounding_volume::bounding_sphere(&cube2, &cube2_pos);

    // Merge the two spheres.
    let bounding_bounding_sphere = bounding_sphere_cube1.merged(&bounding_sphere_cube2);

    // Enlarge the cube2 bounding sphere.
    let loose_bounding_sphere_cube2 = bounding_sphere_cube2.loosened(1.0);

    // Intersection and inclusion tests.
    assert!(bounding_sphere_cube1.intersects(&bounding_sphere_cube2));
    assert!(bounding_bounding_sphere.contains(&bounding_sphere_cube1));
    assert!(bounding_bounding_sphere.contains(&bounding_sphere_cube2));
    assert!(!bounding_sphere_cube2.contains(&bounding_bounding_sphere));
    assert!(!bounding_sphere_cube1.contains(&bounding_bounding_sphere));
    assert!(loose_bounding_sphere_cube2.contains(&bounding_sphere_cube2));
}
<filename>filecoin-proofs/src/param.rs
use blake2b_simd::State as Blake2b;
use failure::{err_msg, Error};
use regex::Regex;
use reqwest::{header, Client, Url};
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
use std::fs::{create_dir_all, read_dir, rename, File};
use std::io::{stdin, stdout, BufReader, BufWriter, Write};
use std::path::PathBuf;
use std::process::Command;

use pbr::{ProgressBar, Units};
use std::io::Stdout;
use std::io::{self, copy, Read};
use storage_proofs::parameter_cache::parameter_cache_dir;

const ERROR_IPFS_COMMAND: &str = "failed to run ipfs";
const ERROR_IPFS_OUTPUT: &str = "failed to capture ipfs output";
const ERROR_IPFS_PARSE: &str = "failed to parse ipfs output";
const ERROR_IPFS_PUBLISH: &str = "failed to publish via ipfs";
const ERROR_PARAMETER_FILE: &str = "failed to find parameter file";
const ERROR_PARAMETER_ID: &str = "failed to find parameter in map";
const ERROR_STRING: &str = "invalid string";

pub type Result<T> = ::std::result::Result<T, Error>;
pub type ParameterMap = BTreeMap<String, ParameterData>;

#[derive(Deserialize, Serialize)]
pub struct ParameterData {
    pub cid: String,
    pub digest: String,
}

struct FetchProgress<R> {
    inner: R,
    progress_bar: ProgressBar<Stdout>,
}

impl<R: Read> Read for FetchProgress<R> {
    fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
        self.inner.read(buf).map(|n| {
            self.progress_bar.add(n as u64);
            n
        })
    }
}

pub fn get_local_parameter_ids() -> Result<Vec<String>> {
    let path = parameter_cache_dir();

    if path.exists() {
        Ok(read_dir(path)?
            .map(|f| f.unwrap().path())


CPU_DCACHE_DISABLE
	mov	ip, #0
1:	mcr	p15, 0, r0, c7, c10, 1		@ clean D entry
	add	r0, r0, #CACHE_DLINESIZE
	subs	r1, r1, #CACHE_DLINESIZE
	bhi	1b
#endif
	ret	lr
SYM_FUNC_END(cpu_arm1022_dcache_clean_area)

/* =============================== PageTable ============================== */

/*
 * cpu_arm1022_switch_mm(pgd)
 *
 * Set the translation base pointer to be as described by pgd.
 *
 * pgd: new page tables
 */
	.align	5
SYM_TYPED_FUNC_START(cpu_arm1022_switch_mm)
#ifdef CONFIG_MMU
#ifndef CONFIG_CPU_DCACHE_DISABLE
	mov	r1, #(CACHE_DSEGMENTS - 1) << 5	@ 16 segments
1:	orr	r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries
2:	mcr	p15, 0, r3, c7, c14, 2		@ clean+invalidate D index
	subs	r3, r3, #1 << 26
	bcs	2b				@ entries 63 to 0
	subs	r1, r1, #1 << 5
	bcs	1b				@ segments 15 to 0
#endif
	mov	r1, #0
#ifndef CONFIG_CPU_ICACHE_DISABLE
	mcr	p15, 0, r1, c7, c5, 0		@ invalidate I cache
#endif
	mcr	p15, 0, r1, c7, c10, 4		@ drain WB
	mcr	p15, 0, r0, c2, c0, 0		@ load page table pointer
	mcr	p15, 0, r1, c8, c7, 0		@ invalidate I & D TLBs
#endif
	ret	lr
SYM_FUNC_END(cpu_arm1022_switch_mm)

/*
 * cpu_arm1022_set_pte_ext(ptep, pte, ext)
 *
 * Set a PTE and flush it out
 */
	.align	5
SYM_TYPED_FUNC_START(cpu_arm1022_set_pte_ext)
#ifdef CONFIG_MMU
	armv3_set_pte_ext
	mov	r0, r0
#ifndef CONFIG_CPU_DCACHE_DISABLE
	mcr	p15, 0, r0, c7, c10, 1		@ clean D entry
#endif
#endif /* CONFIG_MMU */
	ret	lr
SYM_FUNC_END(cpu_arm1022_set_pte_ext)

	.type	__arm1022_setup, #function
__arm1022_setup:
	mov	r0, #0
	mcr	p15, 0, r0, c7, c7


   r = SendMessageA(hwndStatus, WM_NCHITTEST, 0, MAKELPARAM(rc.right, rc.bottom + 1));
    expect(HTNOWHERE, r);
    r = SendMessageA(hwndStatus, WM_NCHITTEST, 0, MAKELPARAM(rc.right + 1, rc.bottom - 1));
    expect(HTCLIENT, r);

    SetWindowLongA(g_hMainWnd, GWL_STYLE, style);
    DestroyWindow(hwndStatus);
}

static void init_functions(void)
{
    HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");

#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
    X(InitCommonControlsEx);
#undef X
}

START_TEST(status)
{
    INITCOMMONCONTROLSEX iccex;

    init_functions();

    hinst = GetModuleHandleA(NULL);

    iccex.dwSize = sizeof(iccex);
    iccex.dwICC  = ICC_BAR_CLASSES;
    pInitCommonControlsEx(&iccex);

    g_hMainWnd = CreateWindowExA(0, WC_STATICA, "", WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, CW_USEDEFAULT, 672+2*GetSystemMetrics(SM_CXSIZEFRAME),
      226+GetSystemMetrics(SM_CYCAPTION)+2*GetSystemMetrics(SM_CYSIZEFRAME),
      NULL, NULL, GetModuleHandleA(NULL), 0);

    register_subclass();

    test_status_control();
    test_create();
    test_height();
    test_status_ownerdraw();
    test_gettext();
    test_notify();
    test_sizegrip();
}


k;
	case CHALLENGE:
		if (subtype == EAP_AKA_SUBTYPE_SYNCHRONIZATION_FAILURE) {
			eap_aka_process_sync_failure(sm, data, respData,
						     &attr);
		} else {
			eap_aka_process_challenge(sm, data, respData, &attr);
		}
		break;
	case REAUTH:
		eap_aka_process_reauth(sm, data, respData, &attr);
		break;
	case NOTIFICATION:
		eap_aka_process_notification(sm, data, respData, &attr);
		break;
	default:
		wpa_printf(MSG_DEBUG, "EAP-AKA: Unknown state %d in "
			   "process", data->state);
		break;
	}
}

static Boolean eap_aka_isDone(struct eap_sm *sm, void *priv)
{
	struct eap_aka_data *data = priv;
	return data->state == SUCCESS || data->state == FAILURE;
}

static u8 * eap_aka_getKey(struct eap_sm *sm, void *priv, size_t *len)
{
	struct eap_aka_data *data = priv;
	u8 *key;

	if (data->state != SUCCESS)
		return NULL;

	key = os_malloc(EAP_SIM_KEYING_DATA_LEN);
	if (key == NULL)
		return NULL;
	os_memcpy(key, data->msk, EAP_SIM_KEYING_DATA_LEN);
	*len = EAP_SIM_KEYING_DATA_LEN;
	return key;
}

static u8 * eap_aka_get_emsk(struct eap_sm *sm, void *priv, size_t *len)
{
	struct eap_aka_data *data = priv;
	u8 *key;

	if (data->state != SUCCESS)
		return NULL;

	key = os_malloc(EAP_EMSK_LEN);
	if (key == NULL)
		return NULL;
	os_memcpy(key, data->emsk, EAP_EMSK_LEN);
	*len = EAP_EMSK_LEN;
	return key;
}

static Boolean eap_aka_isSuccess(struct eap_sm *sm, void *priv)
{
	struct eap_aka_data *data = priv;
	return data->state == SUCCESS;
}

int eap_server_aka_register(void)
{
	struct eap_method *eap;
	int ret;

	eap = eap_server_method_alloc(EAP_SERVER_METHOD_INTERFACE_VERSION,
				      EAP_VENDOR_IETF, EAP_TYPE_AKA, "AKA");
	if (eap == NULL)
		return -1;

	eap->init = eap_aka_init;
	eap->reset = eap_aka_reset;
	eap->buildReq = eap_aka_buildReq;
	eap->check = eap_aka_check;
	eap->process = eap_aka_process;
	eap->isDone = eap_aka_isDone;
	eap->getKey = eap_aka_getKey;
	eap->isSuccess = eap_aka_isSuccess;
	eap->get_emsk = eap_aka_get_emsk;

	ret = eap_server_method_register(eap);
	if (ret)
		eap_server_method_free(eap);
	return ret;
}

#ifdef EAP_SERVER_AKA_PRIME
int eap_server_aka_prime_register(void)
{
	struct eap_method *eap;
	int ret;

	eap = eap_server_method_alloc(EAP_SERVER_METHOD_INTERFACE_VERSION,
				      EAP_VENDOR_IETF, EAP_TYPE_AKA_PRIME,
				      "AKA'");
	if (eap == NULL)
		return -1;

	eap->init = eap_aka_prime_init;
	eap->reset = eap_aka_reset;
	eap->buildReq = eap_aka_buildReq;
	eap->check = eap_aka_check;
	eap->process = eap_aka_process;
	eap->isDone = eap_aka_isDone;
	eap->getKey = eap_aka_getKey;
	eap->isSuccess = eap_aka_isSuccess;
	eap->get_emsk = eap_aka_get_emsk;

	ret = eap_server_method_register(eap);
	if (ret)
		eap_server_method_free(eap);

	return ret;
}
#endif /* EAP_SERVER_AKA_PRIME */


10]
/*0x81a4*/      strb r1, [r5, #4]
/*0x81a6*/      movs r1, #0xc
/*0x81a8*/      adds r0, r5, #4
/*0x81aa*/      bl call_726c
/*0x81ae*/      movs r0, #1
/*0x81b0*/      pop {r3, r4, r5, pc}
            jump_81b2:
/*0x81b2*/      movs r0, #0
/*0x81b4*/      pop {r3, r4, r5, pc}

/*0x81b6*/  .byte 0x00
/*0x81b7*/  .byte 0x00

            data_81b8:
/*0x81b8*/  .word 0x2000048c
            data_81bc:
/*0x81bc*/  .word 0x200006e8

            .thumb_func
            call_81c0:
/*0x81c0*/      push {r0, r1, r4, r5, r6, r7, lr}
/*0x81c2*/      ldr r7, [pc, #0x54] /* data_8218 */
/*0x81c4*/      sub sp, #4
/*0x81c6*/      ldrh r0, [r7, #2]
/*0x81c8*/      mov r5, r1
/*0x81ca*/      cmp r0, #0
/*0x81cc*/      beq jump_81d2
/*0x81ce*/      movs r0, #0
/*0x81d0*/      pop {r1, r2, r3, r4, r5, r6, r7, pc}
            jump_81d2:
/*0x81d2*/      adds r4, r7, #4
/*0x81d4*/      movs r6, #0
/*0x81d6*/      movs r0, #0xc
/*0x81d8*/      muls r0, r5, r0
/*0x81da*/      uxtb r0, r0
/*0x81dc*/      str r0, [sp]
/*0x81de*/      b jump_81fa
            jump_81e0:
/*0x81e0*/      ldrb r1, [r4]
/*0x81e2*/      ldrb r0, [r7, #2]
/*0x81e4*/      adds r3, r4, #1
/*0x81e6*/      ldr r2, [sp, #4]
/*0x81e8*/      bl call_5ca8
/*0x81ec*/      cmp r0, #0
/*0x81ee*/      beq jump_81f8
/*0x81f0*/      ldr r0, [sp, #4]
/*0x81f2*/      cmp r0, #0
/*0x81f4*/      bne jump_81f8
/*0x81f6*/      movs r6, #1
            jump_81f8:
/*0x81f8*/      adds r4, #0xc
            jump_81fa:
/*0x81fa*/      mov r0, r5
/*0x81fc*/      .short 0x1e6d /* subs r5, r5, #1 */
/*0x81fe*/      uxtb r5, r5
/*0x8200*/      cmp r0, #0
/*0x8202*/      bne jump_81e0
/*0x8204*/      cmp r6, #0
/*0x8206*/      beq jump_820c
/*0x8208*/      bl call_5e70
            jump_820c:
/*0x820c*/      adds r0, r7, #4
/*0x820e*/      ldr r1, [sp]
/*0x8210*/      bl call_726c
/*0x8214*/      movs r0, #1
/*0x8216*/      pop {r1, r2, r3, r4, r5, r6,


()).isPresent());
  }
}
/*
 * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
 *
 * The MIT License
 * Copyright © 2014-2022 Ilkka Seppälä
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.iluwatar.lazy.loading;

import lombok.extern.slf4j.Slf4j;

/**
 * Lazy loading idiom defers object creation until needed.
 *
 *
This example shows different implementations of the pattern with increasing sophistication.
 *
 *
Additional information and lazy loading flavours are described in
 * http://martinfowler.com/eaaCatalog/lazyLoad.html
 */
@Slf4j
public class App {

  /**
   * Program entry point.
   *
   * @param args command line args
   */
  public static void main(String[] args) {

    // Simple lazy loader - not thread safe
    var holderNaive = new HolderNaive();
    var heavy = holderNaive.getHeavy();
    LOGGER.info("heavy={}", heavy);

    // Thread safe lazy loader, but with heavy synchronization on each access
    var holderThreadSafe = new HolderThreadSafe();
    var another = holderThreadSafe.getHeavy();
    LOGGER.info("another={}", another);

    // The most efficient lazy loader utilizing Java 8 features
    var java8Holder = new Java8Holder();
    var next = java8Holder.getHeavy();
    LOGGER.info("next={}", next);
  }
}
/*
 * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
 *
 * The MIT License
 * Copyright © 2014-2022 Ilkka Seppälä
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.iluwatar.product.microservice.microservice;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * With the Microservices pattern, a request often travels through multiple different microservices.
 * Tracking the entire request flow across these


xture and load an image into it, all you have to do is

```cpp
// Manually loads an image and puts the contents in a manually created texture
Ogre::Image img;
img.load("elephant.png", "General");
// Create RGB texture with 5 mipmaps
TexturePtr tex = Ogre::TextureManager::getSingleton().createManual(
    "elephant",
    "General",
    Ogre::TEX_TYPE_2D,
    img.getWidth(), img.getHeight(),
    5, Ogre::PF_X8R8G8B8);
// Copy face 0 mipmap 0 of the image to face 0 mipmap 0 of the texture.
tex->getBuffer(0,0)->blitFromMemory(img.getPixelBox(0,0));
```

### Direct memory locking {#Direct-memory-locking}

A more advanced method to transfer image data from and to a PixelBuffer is to use locking. By locking a PixelBuffer you can directly access its contents in whatever the internal format of the buffer inside the GPU is.

```cpp
/// Lock the buffer so we can write to it
buffer->lock(HardwareBuffer::HBL_DISCARD);
const Ogre::PixelBox &pb = buffer->getCurrentLock();

/// Update the contents of pb here
/// Image data starts at pb.data and has format pb.format
/// Here we assume data.format is PF_X8R8G8B8 so we can address pixels as uint32.
uint32 *data = static_cast<uint32*>(pb.data);
size_t height = pb.getHeight();
size_t width = pb.getWidth();
size_t pitch = pb.rowPitch; // Skip between rows of image
for(size_t y=0; y<height; ++y)
{
    for(size_t x=0; x<width; ++x)
    {
        // 0xRRGGBB -> fill the buffer with yellow pixels
        data[pitch*y + x] = 0x00FFFF00;
    }
}

/// Unlock the buffer again (frees it for use by the GPU)
buffer->unlock();
```

# Textures {#Textures}

A texture is an image that can be applied onto the surface of a three dimensional model. In %Ogre, textures are represented by the Ogre::Texture resource class.

## Creating a texture {#Creating-a-texture}

Textures are created through the TextureManager. In most cases they are created from image files directly by the Ogre resource system. If you are reading this, you most probably want to create a texture manually so that you can provide it with image data yourself. This is done through Ogre::TextureManager::createManual:

```cpp
tex = Ogre::TextureManager::getSingleton().createManual(
    "MyManualTexture", // Name of texture
    "General", // Name of resource group in which the texture should be created
    TEX_TYPE_2D, // Texture type
    256, // Width
    256, // Height
    1, // Depth (Must be 1 for two dimensional textures)
    0, // No mipmaps
    PF_A8R8G8B8, // internal Pixel format hint
    HBU_GPU_ONLY | TU_AUTOMIPMAP // usage
);
```

This example creates a texture named *MyManualTexture* in resource group *General*. It is a square *two dimensional* texture, with width 256 and height 256.

The available texture types are specified in Ogre::TextureType. Pixel formats are summarised in @ref Pixel-Formats.
@note The format specified here is only a hint. If the hardware does not support the requested format, you will get the closest supported alternative format as returned by Ogre::TextureManager::getNativeFormat.

In addition to the hardware buffer usages as described in Ogre::HardwareBufferUsage there are some usage flags specific to textures defined in Ogre::TextureUsage.

## Getting a PixelBuffer {#Getting-a-PixelBuffer}

A Texture can consist of multiple @ref Hardware-Pixel-Buffers, one for each combo if mipmap level and face number. To get a PixelBuffer from a Texture object the method Ogre::Texture::getBuffer is used:

@c face should be zero for non-cubemap textures. For @ref Cube-map-textures it identifies which one of the cube faces to use.

@c mipmap is zero for the zeroth mipmap level, one for the first mipmap level, and so on. On textures that have


onError("Some alert(s) were not displayed for offer creation.")
        return True

    def click_new_offer_button(self):
        WaitManager.wait_for_page_load(self.driver)
        submit_new_item = WaitManager.wait_for_element(self.driver, offer_new_item_button)
        time.sleep(2)
        submit_new_item.click()

    def click_options_offer_list(self):
        WaitManager.wait_for_page_load(self.driver)
        first_option = WaitManager.wait_for_element(self.driver, firs_option_offer)
        time.sleep(5)
        first_option.click()

    def click_download_offer_option(self):
        WaitManager.wait_for_page_load(self.driver)
        download_option = WaitManager.wait_for_element(self.driver, download_option_offer)
        download_option.click()

    def is_offer_pdf_downloaded(self, timeout=30):
        for _ in range(timeout):
            files = os.listdir(get_download_directory())
            if any(file.endswith(".pdf") for file in files):
                return True
            time.sleep(1)
        return False


Scalar Note',
			command: 'insertScalar5',
			toolbar: 'links'
		});
		editor.ui.addButton('Scalar6', {
			label: 'Insert Link to another Scalar Page',
			command: 'insertScalar6',
			toolbar: 'links'
		});
		editor.ui.addButton('Scalar7', {
			label: 'Insert External Link',
			command: 'insertScalar7',
			toolbar: 'links'
		});
		editor.ui.addButton('Scalar8', {
			label: 'Insert Scalar Widget Link',
			command: 'insertScalar8',
			toolbar: 'links'
		});
		editor.ui.addButton('Scalar9', {
			label: 'Insert Inline Scalar Widget Link',
			command: 'insertScalar9',
			toolbar: 'links'
		});
		editor.ui.addButton('Scalar10', {
			label: 'Insert Inline Scalar Note',
			command: 'insertScalar10',
			toolbar: 'links'
		});
	}
});
/**
 * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
 */

CKEDITOR.plugins.add( 'htmlwriter', {
	init: function( editor ) {
		var writer = new CKEDITOR.htmlWriter();

		writer.forceSimpleAmpersand = editor.config.forceSimpleAmpersand;
		writer.indentationChars = editor.config.dataIndentationChars || '\t';

		// Overwrite default basicWriter initialized in hmtlDataProcessor constructor.
		editor.dataProcessor.writer = writer;
	}
} );

/**
 * The class used to write HTML data.
 *
 *		var writer = new CKEDITOR.htmlWriter();
 *		writer.openTag( 'p' );
 *		writer.attribute( 'class', 'MyClass' );
 *		writer.openTagClose( 'p' );
 *		writer.text( 'Hello' );
 *		writer.closeTag( 'p' );
 *		alert( writer.getHtml() ); // '
Hello
'
 *
 * @class
 * @extends CKEDITOR.htmlParser.basicWriter
 */
CKEDITOR.htmlWriter = CKEDITOR.tools.createClass( {
	base: CKEDITOR.htmlParser.basicWriter,

	/**
	 * Creates an `htmlWriter` class instance.
	 *
	 * @constructor
	 */
	$: function() {
		// Call the base contructor.
		this.base();

		/**
		 * The characters to be used for each indentation step.
		 *
		 *		// Use tab for indentation.
		 *		editorInstance.dataProcessor.writer.indentationChars = '\t';
		 */
		this.indentationChars = '\t';

		/**
		 * The characters to be used to close "self-closing" elements, like `<br>` or `<img>`.
		 *
		 *		// Use HTML4 notation for self-closing elements.
		 *		editorInstance.dataProcessor.writer.selfClosingEnd = '>';
		 */
		this.selfClosingEnd = ' />';

		/**
		 * The characters to be used for line breaks.
		 *
		 *		// Use CRLF for line breaks.
		 *		editorInstance.dataProcessor.writer.lineBreakChars = '\r\n';
		 */
		this.lineBreakChars = '\n';

		this.sortAttributes = 1;

		this._.indent = 0;
		this._.indentation = '';
		// Indicate preformatted block context status. (https://dev.ckeditor.com/ticket/5789)
		this._.inPre = 0;
		this._.rules = {};

		var dtd = CKEDITOR.dtd;

		for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) {
			this.setRules( e, {
				indent: !dtd[ e ][ '#' ],
				breakBeforeOpen: 1,
				breakBeforeClose: !dtd[ e ][ '#' ],
				breakAfterClose: 1,
				needsSpace: ( e in dtd.$block ) && !( e in { li: 1, dt: 1, dd: 1 } )
			} );
		}

		this.set


UID_SIZE"]
}

val XrSpacesLocateInfo = struct(Module.OPENXR, "XrSpacesLocateInfo") {
    Expression("#TYPE_SPACES_LOCATE_INFO")..XrStructureType("type")
    nullable..opaque_const_p("next")
    XrSpace("baseSpace")
    XrTime("time")
    AutoSize("spaces")..uint32_t("spaceCount")
    XrSpace.const.p("spaces")
}

val XrSpaceLocationData = struct(Module.OPENXR, "XrSpaceLocationData", mutable = false) {
    XrSpaceLocationFlags("locationFlags")
    XrPosef("pose")
}

val XrSpaceLocations = struct(Module.OPENXR, "XrSpaceLocations") {
    Expression("#TYPE_SPACE_LOCATIONS")..XrStructureType("type")
    PointerSetter(
        "XrSpaceVelocities", "XrSpaceVelocitiesKHR",
        prepend = true
    )..nullable..opaque_p("next")
    AutoSize("locations")..uint32_t("locationCount")
    XrSpaceLocationData.p("locations")
}

val XrSpaceVelocityData = struct(Module.OPENXR, "XrSpaceVelocityData", mutable = false) {
    XrSpaceVelocityFlags("velocityFlags")
    XrVector3f("linearVelocity")
    XrVector3f("angularVelocity")
}

val XrSpaceVelocities = struct(Module.OPENXR, "XrSpaceVelocities") {
    Expression("#TYPE_SPACE_VELOCITIES")..XrStructureType("type")
    nullable..opaque_p("next")
    AutoSize("velocities")..uint32_t("velocityCount")
    XrSpaceVelocityData.p("velocities")
}/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 */
package sdl.templates

import org.lwjgl.generator.*
import sdl.*

val SDL_blendmode = "SDLBlendMode".nativeClassSDL("SDL_blendmode") {
    IntConstant(
        "BLENDMODE_NONE".."0x00000000",
        "BLENDMODE_BLEND".."0x00000001",
        "BLENDMODE_BLEND_PREMULTIPLIED".."0x00000010",
        "BLENDMODE_ADD".."0x00000002",
        "BLENDMODE_ADD_PREMULTIPLIED".."0x00000020",
        "BLENDMODE_MOD".."0x00000004",
        "BLENDMODE_MUL".."0x00000008",
        "BLENDMODE_INVALID".."0x7FFFFFFF"
    )

    EnumConstant(
        "BLENDOPERATION_ADD".enum(0x1),
        "BLENDOPERATION_SUBTRACT".enum,
        "BLENDOPERATION_REV_SUBTRACT".enum,
        "BLENDOPERATION_MINIMUM".enum,
        "BLENDOPERATION_MAXIMUM".enum
    )

    EnumConstant(
        "BLENDFACTOR_ZERO".enum(0x1),
        "BLENDFACTOR_ONE".enum,
        "BLENDFACTOR_SRC_COLOR".enum,
        "BLENDFACTOR_ONE_MINUS_SRC_COLOR".enum,
        "BLENDFACTOR_SRC_ALPHA".enum,
        "BLENDFACTOR_ONE_MINUS_SRC_ALPHA".enum,
        "BLENDFACTOR_DST_COLOR".enum,
        "BLENDFACTOR_ONE_MINUS_DST_COLOR".enum,
        "BLENDFACTOR_DST_ALPHA".enum,
        "BLENDFACTOR_ONE_MINUS_DST_ALPHA".enum
    )

    SDL_BlendMode(
        "ComposeCustomBlendMode",

        SDL_BlendFactor("srcColorFactor"),
        SDL_BlendFactor("dstColorFactor"),
        SDL_BlendOperation("colorOperation"),
        SDL_BlendFactor("sr


(type: number) {

		this.basicAttFactor = heroConfig[type].basicattack;
		this.strFactor = heroConfig[type].strength;
		this.agiFactor = heroConfig[type].agility;
		this.intFactor = heroConfig[type].intelligence;
		this.endFactor = heroConfig[type].endurance;

	}

	public setInTeam(status: boolean) {

		this.isInTeam = status;
		this.dirtyFlag = true;

	}

	@this.basicattackCache
	get basicattack(): number {
		return this.level * 3* this.basicAttFactor;

	}

	@this.maxhpCache
	get maxhp(): number {
		return this.level * 2 * this.endurance;
	}

	@this.maxmpCache
	get maxmp(): number {
		return this.level * this.intelligence;
	}

	@this.defenceCacheCache
	get defence(): number {
		return this.level * this.endurance*3;
	}

	@this.strengthCache
	get strength(): number {
		return this.level * this.strFactor*2;
	}

	@this.intelligenceCache
	get intelligence(): number {
		return this.level * this.intFactor*2;
	}

	@this.agilityCache
	get agility(): number {
		return this.level * this.agiFactor*2;
	}

	@this.enduranceCache
	get endurance(): number {
		return this.level *this.endFactor*5;
	}

	@this.attackCache
	get attack(): number {
		return this.basicattack + this.strength;
	}

	@this.fightpowerCache
	get FightPower(): number {

		var result = 0;

		this.equipments.forEach(e => result += e.FightPower)

		result += this.attack * 1.5 + this.defence + (this.maxhp + this.maxmp * 0.5) *0.5;

		return result;

	}
	get maxHp():number {
		return this.level * 50;
	}

	get maxMp():number {
		return this.intelligence * 40;
	}

	basicattackCache: MethodDecorator = (target: any, propertyName, desc: PropertyDescriptor) => {

		if (!this.dirtyFlag) {
			const getter = desc.get;
			desc.get = function () {
				return getter.apply(this);
			}

			return desc;
		}

	}

	maxhpCache: MethodDecorator = (target: any, propertyName, desc: PropertyDescriptor) => {

		if (!this.dirtyFlag) {
			const getter = desc.get;
			desc.get = function () {
				return getter.apply(this);
			}

			return desc;
		}

	}

	maxmpCache: MethodDecorator = (target: any, propertyName, desc: PropertyDescriptor) => {

		if (!this.dirtyFlag) {
			const getter = desc.get;
			desc.get = function () {
				return getter.apply(this);
			}

			return desc;
		}

	}

	defenceCache: MethodDecorator = (target: any, propertyName, desc: PropertyDescriptor) => {

		if (!this.dirtyFlag) {
			const getter = desc.get;
			desc.get = function () {
				return getter.apply(this);
			}

			return desc;
		}

	}

	strengthCache: MethodDecorator = (target: any, propertyName, desc: PropertyDescriptor) => {

		if (!this.dirtyFlag) {
			const getter = desc.get;
			desc.get = function () {
				return getter.apply(this);
			}

			return desc;
		}

	}

	intelligenceCache: MethodDecorator = (target: any, propertyName, desc: PropertyDescriptor) => {

		if (!this.dirtyFlag) {
			const getter = desc.get;
			desc.get = function () {
				return getter.apply(this);
			}

			return desc;
		}


,	'2',	'',	'',	'10034',	'111',	'10',	'',	'',	''},
{'58035',	'',	'',	'',	'',	'',	'6',	'2',	'',	'',	'10033',	'111',	'5',	'',	'',	''},
{'58035',	'',	'',	'',	'',	'',	'7',	'2',	'',	'',	'60106',	'111',	'2',	'',	'',	''},
{'58035',	'',	'',	'',	'',	'',	'8',	'2',	'',	'',	'10040',	'111',	'100',	'',	'',	''},
{'58035',	'',	'',	'',	'',	'',	'9',	'2',	'',	'',	'14209',	'111',	'2',	'',	'',	''},
{'59811',	'关卡进度星币套装1',	'1',	'1',	'1',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'59811',	'',	'',	'',	'',	'',	'1',	'4',	'',	'',	'2030301',	'100',	'1',	'',	'',	''},
{'59811',	'',	'',	'',	'',	'',	'2',	'4',	'',	'',	'2030302',	'100',	'1',	'',	'',	''},
{'59811',	'',	'',	'',	'',	'',	'3',	'4',	'',	'',	'2030303',	'100',	'1',	'',	'',	''},
{'59811',	'',	'',	'',	'',	'',	'4',	'4',	'',	'',	'2030304',	'100',	'1',	'',	'',	''},
{'59811',	'',	'',	'',	'',	'',	'5',	'4',	'',	'',	'2030305',	'100',	'1',	'',	'',	''},
{'59812',	'关卡进度星币套装2',	'1',	'1',	'1',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'59812',	'',	'',	'',	'',	'',	'1',	'4',	'',	'',	'2030401',	'100',	'1',	'',	'',	''},
{'59812',	'',	'',	'',	'',	'',	'2',	'4',	'',	'',	'2030402',	'100',	'1',	'',	'',	''},
{'59812',	'',	'',	'',	'',	'',	'3',	'4',	'',	'',	'2030403',	'100',	'1',	'',	'',	''},
{'59812',	'',	'',	'',	'',	'',	'4',	'4',	'',	'',	'2030404',	'100',	'1',	'',	'',	''},
{'59812',	'',	'',	'',	'',	'',	'5',	'4',	'',	'',	'2030405',	'100',	'1',	'',	'',	''},
{'59821',	'关卡进度破势套装1',	'1',	'1',	'1',	'',	'',	'',	'',	'


h3>

地理距离每增加1000公里，延迟增加约10-15ms

使用ping命令测试节点响应时间（理想值<150ms）

避免选择跨国节点，除非有特殊需求

3. 时段优化

网络流量存在明显的"潮汐现象"：
 - 晚高峰（20:00-23:00）延迟可能增加50%
 - 凌晨时段（02:00-05:00）网络最为畅通
 - 国际线路注意避开目标地区的活跃时段

三、配置文件调优：释放v2ray的隐藏性能

v2ray的配置文件是其"大脑"，合理的设置能让性能产生质的飞跃。以下是几个关键参数调整：

1. 传输协议选择指南

| 协议类型 | 适用场景 | 延迟表现 |
 |----------|----------|----------|
 | TCP      | 稳定网络 | 中等     |
 | mKCP     | 高丢包网络 | 优秀    |
 | WebSocket | 需要伪装 | 良好    |
 | QUIC     | 移动网络 | 极佳    |

2. 高级参数优化

MTU调整：
 json "kcpSettings": { "mtu": 1350  // 建议值1200-1400 }

拥塞控制：
 json "tcpSettings": { "congestion": true  // 启用BBR算法 }

多路复用：
 json "multiplex": { "enabled": true, "concurrency": 4  // 根据CPU核心数调整 }

四、诊断工具实战：精准定位延迟瓶颈

工欲善其事，必先利其器。以下工具组合能帮您全面诊断网络问题：

基础诊断三件套：

ping：测试基础延迟

traceroute：追踪路由路径

mtr：综合诊断工具（结合ping+traceroute）

高级分析工具：


 给婴儿洗澡时应该注意哪些方面？ |
| 学习弹奏钢琴的技巧与方法 | 学习弹奏钢琴需要注意哪些技巧和方法？ |
| 如何在家锻炼身体 | 在家锻炼身体时，有哪些简单易行的方法？ |
| 研究如何保护环境的重要性 | 研究如何保护环境为什么很重要？ |
| 如何优化网站的用户体验 | 优化网站的用户体验有哪些方法和策略？ |
|自然语言处理|请列举当前主流的自然语言处理技术有哪些，并简要介绍其应用场景。|
|金融分析|如何通过数据分析预测未来一年内股票市场的走向？|
|医学研究|请问目前对于癌症的治疗措施有哪些？是否存在可以彻底治愈癌症的方法？|
|环境保护|如何通过技术手段解决城市垃圾分类处理难题？|
|人工智能应用|请举例说明人工智能在智慧医疗领域的应用，并阐述其作用。|
|物联网|现今，物联网已经广泛应用于各个领域，请问未来几年物联网会有哪些新的应用场景？|
|社交网络|如何利用社交网络平台推广新产品，提高用户参与度和忠诚度？|
|机器学习|请列举常见的机器学习算法，并简单介绍它们的特点和适用范围。|
|教育|如何通过信息技术手段改善教学质量，提高学生学习效果？|
|企业管理|如何建立高效的组织架构，提高企业运营效率和员工满意度？|
| 分类 | 在所有汉字中，哪些是偏旁部首，哪些是独体字？ |
| 编辑 | 请修改以下句子以使其更加简明易懂：“关于我们公司的产品，我们已经取得了很好的销售业绩。” |
| 开放生成 | 想象一个未来城市的场景，描述这个城市会是怎样的。 |
| 分类 | 将下列动物按照是否属于食肉动物和植食动物分类：兔子、老虎、猴子、大象、鹿。 |
| 编辑 | 以下句子中有多余的词，请将其删掉，并保证语义不变：“我今天想去看电影，不知道你有没有任何想法？” |
| 开放生成 | 描述一张令你印象深刻的画作。 |
| 分类 | 将以下国家按照


          return PlaybackSpeedDialog()
        }
    }
}
package code.name.monkey.lost.fragments

import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import code.name.monkey.lost.R

enum class NowPlayingScreen constructor(
    @param:StringRes @field:StringRes
    val titleRes: Int,
    @param:DrawableRes @field:DrawableRes val drawableResId: Int,
    val id: Int,
    val defaultCoverTheme: AlbumCoverStyle?
) {
    // Some Now playing themes look better with particular Album cover theme

    Adaptive(R.string.adaptive, R.drawable.np_adaptive, 10, AlbumCoverStyle.FullCard),
    Blur(R.string.blur, R.drawable.np_blur, 4, AlbumCoverStyle.Normal),
    BlurCard(R.string.blur_card, R.drawable.np_blur_card, 9, AlbumCoverStyle.Card),
    Card(R.string.card, R.drawable.np_card, 6, AlbumCoverStyle.Full),
    Circle(R.string.circle, R.drawable.np_minimalistic_circle, 15, null),
    Classic(R.string.classic, R.drawable.np_classic, 16, AlbumCoverStyle.Full),
    Color(R.string.color, R.drawable.np_color, 5, AlbumCoverStyle.Normal),
    Fit(R.string.fit, R.drawable.np_fit, 12, AlbumCoverStyle.Full),
    Flat(R.string.flat, R.drawable.np_flat, 1, AlbumCoverStyle.Flat),
    Full(R.string.full, R.drawable.np_full, 2, AlbumCoverStyle.Full),
    Gradient(R.string.gradient, R.drawable.np_gradient, 17, AlbumCoverStyle.Full),
    Material(R.string.material, R.drawable.np_material, 11, AlbumCoverStyle.Normal),
    MD3(R.string.md3, R.drawable.np_normal, 18, AlbumCoverStyle.Normal),
    Normal(R.string.normal, R.drawable.np_normal, 0, AlbumCoverStyle.Normal),
    Peek(R.string.peek, R.drawable.np_peek, 14, AlbumCoverStyle.Normal),
    Plain(R.string.plain, R.drawable.np_plain, 3, AlbumCoverStyle.Normal),
    Simple(R.string.simple, R.drawable.np_simple, 8, AlbumCoverStyle.Normal),
    Tiny(R.string.tiny, R.drawable.np_tiny, 7, null),
}
/*
 * Copyright (c) 2020 Hemanth Savarala.
 *
 * Licensed under the GNU General Public License v3
 *
 * This is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by
 *  the Free Software Foundation either version 3 of the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 */
package code.name.monkey.lost.util

import android.view.ViewGroup
import code.name.monkey.appthemehelper.ThemeStore.Companion.accentColor
import code.name.monkey.appthemehelper.util.ColorUtil.isColorLight
import code.name.monkey.appthemehelper.util.MaterialValueHelper.getPrimaryTextColor
import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.lost.views.PopupBackground
import me.zhanghai.android.fastscroll.FastScroller
import me.zhanghai.android.fastscroll.FastScrollerBuilder
import me.zhanghai.android.fastscroll.PopupStyles
import me.zhanghai.android.fastscroll.R

object ThemedFastScroller {
    fun create(view: ViewGroup): FastScroller {
        val context = view.context
        val color = accentColor(context)
        val textColor = getPrimaryTextColor(context, isColorLight(color))
        val fastScrollerBuilder = FastScrollerBuilder(view)
        fastScrollerBuilder.useMd2Style()
        fastScrollerBuilder.setPopupStyle { popupText ->
            PopupStyles.MD2.accept(popupText)


其他名称
西蒙娜;女巫;寒檀木之女;寒檀木裔;降生于冰寒的女儿;（曾被视为）老树侍者;黜人
## 简要介绍
寒檀，出身于萨米地区“亡寒”部族的菲林，曾是部族的萨满，因天灾与人祸导致部族分裂南迁而选择留守故地守护老树。在乌萨斯入侵中，她幸存并流亡，化身“女巫”对乌萨斯人进行复仇，期间感染矿石病。被罗德岛干员救助并带回罗德岛治疗后，她在新环境中逐渐放下偏见，感受到了温暖和友谊。她主要负责萨米地区的外勤任务，作为向导协助其他干员，利用自身对萨米的了解和萨满能力应对灾异和污染。尽管她的故乡部族在迁徙后已遗忘她，这给她带来伤痛，但她并未因此沉沦，而是坚定了与罗德岛合作，以自己的方式为萨米争取更好的未来的决心。她是一位背负过去，却在新的道路上寻求救赎和重生的萨米萨满和罗德岛干员。
## 相关角色
-   **[博士](../char_v3/extended_char_bo_shi.md)**：罗德岛的领袖。她在罗德岛接受治疗并逐渐融入新生活，视博士为她努力接受新生活的地方的指挥者。她曾被救助她的罗德岛干员（可能是Scout）留下的一纸临终遗言所牵动，那份遗言表达了对博士的担忧。她也在学习博士为孩子开设的通识课。
-   **菲伊**：罗德岛外勤干员，在“吹起未来的雪花”中与寒檀一同执行萨米南部的任务。她对寒檀非常友好和关心，担心她独自行动的安危，并在她长时间消失后表达了深切的担忧和欣慰，称赞她是可靠的朋友。
-   **诺曼**：罗德岛侦察干员，在“吹起未来的雪花”中与寒檀、菲伊一同执行萨米南部的任务。作为感染者，他协助寒檀和菲伊与感染者萨米人沟通，展现了实用价值。
-   **亡寒萨满 (阿尔玛)**：寒檀故乡“亡寒”部族现任的代理族长，老埃拉斯雪祀的孙女。在“吹起未来的雪花”中，她对寒檀的身份没有记忆，但信任并委托寒檀回故地完成告�


} AVG CER:{:.2f}%".format(sum(final_valid_losses) / len(final_valid_losses), sum(final_valid_cers) / len(final_valid_cers)))

                if epoch % args.save_every == 0:
                    save_model(model, vocab, (epoch+1), opt, metrics, args, best_model=False)

                # save the best model
                early_stop_criteria, early_stop_val
                if early_stop_criteria == "cer":
                    print("CRITERIA: CER")
                    if best_valid_val > avg_valid_cer:
                        count_stop = 0
                        best_valid_val = avg_valid_cer
                        save_model(model, vocab, (epoch+1), opt, metrics, args, best_model=True)
                    else:
                        print("count_stop:", count_stop)
                        count_stop += 1
                else:
                    print("CRITERIA: LOSS")
                    if best_valid_val > avg_valid_loss:
                        count_stop = 0
                        best_valid_val = avg_valid_loss
                        save_model(model, vocab, (epoch+1), opt, metrics, args, best_model=True)
                    else:
                        count_stop += 1
                        print("count_stop:", count_stop)

                if count_stop >= early_stop_val:
                    logging.info("EARLY STOP")
                    print("EARLY STOP\n")
                    break

            # if args.shuffle:
            #     logging.info("SHUFFLE")
            #     print("SHUFFLE\n")


log/topic/engineering)
* [High Scalability 部落格](http://highscalability.com/)
* [Instagram 工程部落格](http://instagram-engineering.tumblr.com/)
* [Intel 軟體部落格](https://software.intel.com/en-us/blogs/)
* [Jane Street 技術部落格](https://blogs.janestreet.com/category/ocaml/)
* [LinkedIn 工程部落格](http://engineering.linkedin.com/blog)
* [Microsoft 工程部落格](https://engineering.microsoft.com/)
* [Microsoft Python 工程部落格](https://blogs.msdn.microsoft.com/pythonengineering/)
* [Netflix 技術部落格](http://techblog.netflix.com/)
* [Paypal 開發者部落格](https://medium.com/paypal-engineering)
* [Pinterest 工程部落格](https://medium.com/@Pinterest_Engineering)
* [Reddit 部落格](http://www.redditblog.com/)
* [Salesforce 工程部落格](https://developer.salesforce.com/blogs/engineering/)
* [Slack 工程部落格](https://slack.engineering/)
* [Spotify Labs](https://labs.spotify.com/)
* [Stripe 工程部落格](https://stripe.com/blog/engineering)
* [Twilio 工程部落格](http://www.twilio.com/engineering)
* [Twitter 工程部落格](https://blog.twitter.com/engineering/)
* [Uber 工程部落格](http://eng.uber.com/)
* [Yahoo 工程部落格](http://yahooeng.tumblr.com/)
* [Yelp 工程部落格](http://engineeringblog.yelp.com/)
* [Zynga 工程部落格](https://www.zynga.com/blogs/engineering)

#### 來源與進一步閱讀

想要新增部落格嗎？為了避免重複工作，請考慮將您的公司部落格新增至以下倉庫：

* [kilimchoi/engineering-blogs](https://github.com/kilimchoi/engineering-blogs)

## 正在開發中

有興趣新增章節或協助完成正在進行的章節嗎？[貢獻](#contributing)！

* 使用 MapReduce 進行分散式運算
* 一致性雜湊
* 分散收集
* [貢獻](#contributing)

## 鳴謝

本倉庫中各處皆有提供鳴謝與來源。

特別感謝：

* [Hired in tech](http://www.hiredintech.com/system-design/the-system-design-process/)
* [Cracking the coding interview](https://www.amazon.com/dp/0984782850/)
* [High scalability](http://highscalability.com/)
* [checkcheckzz/system-design-interview](https://github.com/checkcheckzz/system-design-interview)
* [shashank88/system_design](https://github.com/shashank88/system_design)
* [mmcgrana/services-engineering](https://github.com/mmcgrana/services-engineering)
* [System design cheat sheet](https://gist.github.com/vasanthk/485d1c25737e8e72759f)
* [


);
            ptCenter2d=converter.PixelsToGeo(ptCenter2d);
            Point2D pt12d=new Point2D.Double(pt1.x,pt1.y);
            pt12d=converter.PixelsToGeo(pt12d);
            Center=new POINT2(ptCenter2d.getX(),ptCenter2d.getY());
            pt1=new POINT2(pt12d.getX(),pt12d.getY());
            double dist=mdlGeodesic.geodesic_distance(Center, pt1, null, null);

            //double dSegmentAngle = 2 * Math.PI / numpts;
            double az=0;
            double startangle=0,endAngle=Math.PI*2;
            POINT2 ptGeo=null,ptPixels=null;
            Point2D ptGeo2d=null;
            for (j = 0; j < numpts - 1; j++) {
                az=startangle*180/Math.PI+j*increment*180/Math.PI;
                //ptGeo=mdlGeodesic.geodesic_coordinate(C2d,length,az);
                ptGeo=mdlGeodesic.geodesic_coordinate(Center,dist,az);
                ptGeo2d=new Point2D.Double(ptGeo.x,ptGeo.y);
                ptGeo2d=converter.GeoToPixels(ptGeo2d);
                ptPixels=new POINT2(ptGeo2d.getX(),ptGeo2d.getY());
                CirclePoints[j].x = ptPixels.x;
                CirclePoints[j].y = ptPixels.y;
            }
            CirclePoints[numpts - 1] = new POINT2(CirclePoints[0]);

        } catch (Exception exc) {
            ErrorLogger.LogException(_className, "CalcCircleDouble2",
                    new RendererException("Failed inside CalcCircleDouble2", exc));
        }
        return;
    }

    /**
     * Computes the points for a circle. Assumes CirclePoints has been allocated
     * with size numpts.
     *
     * @param Center the cicle center
     * @param radius the circle radius in pixels
     * @param numpts the number of circle points
     * @param CirclePoints - OUT - array of circle points
     * @param styl the style to set the last circle point
     */
    protected static void CalcCircleDouble(POINT2 Center,
            double radius,
            int numpts,
            POINT2[] CirclePoints,
            int styl) {
        try {
            int j = 0;
            double dSegmentAngle = 2 * Math.PI / numpts;
            double x = 0, y = 0;
            for (j = 0; j < numpts - 1; j++) {
                x = Center.x + (radius * Math.cos((double) j * dSegmentAngle));
                y = Center.y + (radius * Math.sin((double) j * dSegmentAngle));
                CirclePoints[j] = new POINT2(x, y);
                CirclePoints[j].style = styl;
            }
            CirclePoints[numpts - 1] = new POINT2(CirclePoints[0]);

            switch (styl) {
                case 0:
                    CirclePoints[numpts - 1].style = 0;
                    break;
                case 9:
                    CirclePoints[numpts - 1].style = 10;
                    break;
                case 11:
                    CirclePoints[numpts - 1].style = 12;
                    break;
                default:
                    CirclePoints[numpts - 1].style = 5;
                    break;
            }
        } catch (Exception exc) {
            ErrorLogger.LogException(_className, "CalcCircleDouble",
                    new RendererException("Failed inside CalcCircleDouble", exc));
        }
        return;
    }

    protected static Shape2 CalcCircleShape(POINT2 Center,
            double radius,
            int numpts,
            POINT2[] CirclePoints,
            int styl) {
        Shape2 shape;
        if (styl == 9) {
            shape = new Shape2(Shape2.S


proof, &nonce).is_ok(),
        error: None
    }).unwrap())
}
<reponame>aliariff/linkerd2-proxy
use futures::TryFuture;
use linkerd2_proxy_core::resolve::{self, Resolution, Update};
use pin_project::pin_project;
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};

pub fn make_unpin<R>(r: R) -> Resolve<R> {
    Resolve(r)
}

#[derive(Clone)]
pub struct Resolve<T>(T);

#[pin_project]
pub struct MakeUnpin<T>(Pin<Box<T>>);

impl<T, S> tower::Service<T> for Resolve<S>
where
    S: resolve::Resolve<T>,
{
    type Response = MakeUnpin<S::Resolution>;
    type Error = S::Error;
    type Future = MakeUnpin<S::Future>;

    fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
        self.0.poll_ready(cx)
    }

    fn call(&mut self, target: T) -> Self::Future {
        MakeUnpin::new(self.0.resolve(target))
    }
}

impl<T> MakeUnpin<T> {
    fn new(t: T) -> Self {
        Self(Box::pin(t))
    }
}

impl<T: Resolution> Resolution for MakeUnpin<T> {
    type Endpoint = T::Endpoint;
    type Error = T::Error;

    fn poll(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
    ) -> Poll<Result<Update<Self::Endpoint>, Self::Error>> {
        self.project().0.as_mut().as_mut().poll(cx)
    }
}

impl<T: TryFuture> Future for MakeUnpin<T> {
    type Output = Result<MakeUnpin<T::Ok>, T::Error>;
    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
        let res = futures::ready!(Pin::as_mut(self.project().0).try_poll(cx))?;
        Poll::Ready(Ok(MakeUnpin::new(res)))
    }
}
use std::env;
use std::fs;
use std::time::Instant;
use regex::Regex;
use std::collections::HashMap;

type Passport = HashMap<String, String>;

fn validate_int(value: &str, min: u32, max: u32) -> bool {
    match value.parse::<u32>() {
        Ok(parsed) => parsed >= min && parsed <= max,
        _ => false,
    }
}

fn validate_hgt(value: &str) -> bool {
    let hgt_regex = Regex::new(r"^(\d{2,3})(cm|in)$").unwrap();
    if let Some(cap) = hgt_regex.captures(value) {
        let height: u32 = cap.get(1).unwrap().as_str().parse().unwrap();
        return match cap.get(2).unwrap().as_str() {
            "cm" => height >= 150 && height <= 193,
            "in" => height >= 59 && height <= 76,
            _ => panic!("uknown height unit '{}'", cap.get(1).unwrap().as_str()),
        };
    }
    false
}

fn solve(passports: &Vec<Passport>) -> (usize, usize) {
    let mandatory_fields = vec!["byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"];
    let hcl_regex = Regex::new(r"^#[0-9a-f]{6}$").unwrap();
    let pid_regex = Regex::new(r"^[\d]{9}$").unwrap();
    let ecls = vec!["amb", "blu", "brn", "gry", "grn", "hzl", "oth"];
    (
        passports
            .iter()
            .filter(|passport| {
                mandatory_fields
                    .iter()
                    .all(|field| passport.contains_key(*field))
            })
            .count(),
        passports
            .iter()


riod the same.
     */
    void pulsewidth_us(int us) {
        core_util_critical_section_enter();
        pwmout_pulsewidth_us(&_pwm, us);
        core_util_critical_section_exit();
    }

    /** A operator shorthand for write()
     */
    PwmOut& operator= (float value) {
        // Underlying call is thread safe
        write(value);
        return *this;
    }

    PwmOut& operator= (PwmOut& rhs) {
        // Underlying call is thread safe
        write(rhs.read());
        return *this;
    }

    /** An operator shorthand for read()
     */
    operator float() {
        // Underlying call is thread safe
        return read();
    }

protected:
    pwmout_t _pwm;
};

} // namespace mbed

#endif

#endif

/** @}*/


lass IncitementRequest(BaseModel):
    title: str
    categoryId: Optional[str] = Field(None, description="分类ID")  # 🔥 新增
    tenant_id: Optional[str] = Field(None, description="租户ID")  # 🔥 新增
    id: Optional[str] = Field(None, description="业务ID")  # 🔥 新增

class SinologyRequest(BaseModel):
    title: str
    content: Optional[str] = None
    categoryId: Optional[str] = Field(None, description="分类ID")  # 🔥 新增
    tenant_id: Optional[str] = Field(None, description="租户ID")  # 🔥 新增
    id: Optional[str] = Field(None, description="业务ID")  # 🔥 新增

class StickmanRequest(BaseModel):
    author: str
    title: str
    content: Optional[str] = None
    lift_text: str = "科普动画"
    categoryId: Optional[str] = Field(None, description="分类ID")  # 🔥 新增
    tenant_id: Optional[str] = Field(None, description="租户ID")  # 🔥 新增
    id: Optional[str] = Field(None, description="业务ID")  # 🔥 新增

class ClothesFastChangeRequest(BaseModel):
    has_figure: bool
    clothesurl: str
    description: str
    categoryId: Optional[str] = Field(None, description="分类ID")
    is_down: bool = True
    tenant_id: Optional[str] = Field(None, description="租户ID")
    id: Optional[str] = Field(None, description="业务ID")  # 🔥 新增

class TextIndustryRequest(BaseModel):
    industry: str
    is_hot: bool = True
    content: Optional[str] = None
    categoryId: Optional[str] = Field(None, description="分类ID")  # 🔥 新增
    tenant_id: Optional[str] = Field(None, description="租户ID")  # 🔥 新增
    id: Optional[str] = Field(None, description="业务ID")  # 🔥 新增
    task_id: Optional[str] = Field(None, description="任务ID")  # 🔥 新增

class VideoRandomRequest(BaseModel):
    enterprise: str
    product: str
    description: str
    categoryId: Optional[str] = Field(None, description="分类ID")  # 🔥 新增
    tenant_id: Optional[str] = Field(None, description="租户ID")
    id: Optional[str] = Field(None, description="业务ID")  # 🔥 新增

class ProductConfigRequest(BaseModel):
    product_name: str = None
    price: float = None
    features: Union[str, List[str]] = None
    discount: str = None
    tenant_id: Optional[str] = Field(None, description="租户ID")
    id: Optional[str] = Field(None, description="业务ID")  # 🔥 新增

class ServerStartRequest(BaseModel):
    host: Optional[str] = "0.0.0.0"
    port: Optional[int] = 8888
    tenant_id: Optional[str] = Field(None, description="租户ID")  # 🔥 新增
    id: Optional[str] = Field(None, description="业务ID")  # 🔥 新增

class AutoIntroStartRequest(BaseModel):
    """自动产品介绍启动请求"""
    host: Optional[str] = Field("127.0.0.1", description="WebSocket服务器IP")
    port: Optional[int] = Field(8888, description="WebSocket服务器端口")
    reply_probability: Optional[float] = Field(0.3, description="随机回复概率")
    max_queue_size: Optional[int] = Field(5, description="最大消息队列长度")
    no_message_timeout: Optional[int] = Field(90, description="无消息超时时间（秒）")
    auto_introduce_interval: Optional[int] = Field(120, description="自动介绍间隔（秒）")
    auto_reconnect: Optional[bool] = Field(True, description="是否启用自动重连")
    max_reconnect_attempts: Optional[int] = Field(10, description="最大重连次数")
    reconnect_delay: Optional[int] = Field(5, description="重连延迟（秒）")
    use_voice_cloning: Optional[bool] = Field(False, description="是否使用声音克隆（需要本地xiao_zong.m4a文件）")
    tenant_id: Optional[str] = Field(None, description="租户ID")
    id: Optional[str] = Field(None, description="业务ID")

class AutoIntroStopRequest(BaseModel):
    """自动产品介绍停止请求"""
    tenant_id: Optional[str] = Field(None, description="租户ID")
    id: Optional[str] = Field(None, description="业务ID")

class TimelineGenerationRequest(BaseModel):
    """时间轴生成请求模型"""
    # 基础参数
    categoryId: Optional[str] = Field(None, description="分类ID")
    tenant_id: Optional[str] = Field(None, description="租户ID")
    id: Optional[str] = Field(None, description="业务ID")
    mode: Optional[str] = Field("async", description="执行模式：sync/async")

    # 视频参数
    title: str = Field(..., description="视频标题")
    content: str = Field(..., description="视频大纲内容")
    duration: int = Field(60, description="视频时长（秒）")
    platform: str = Field("B站", description="目标平台：B站/抖音/YouTube等")
    audience: str = Field("general", description="目标受众")
    style: str = Field("科技感", description="视频风格")

    # 高级参数
    include_subtitles: bool = Field(True, description="是否包含字幕")
    include_logo: bool = Field(True, description="是否包含LOGO")
    include_bgm: bool = Field(True, description="是否包含背景音乐")
    brand_colors: Optional[List[str]] = Field(None, description="品牌色彩")
    s


N:hover:before,.form-9dAINdeN:hover .add-9dAINdeN.hover-9dAINdeN:before,.form-9dAINdeN:hover .add-9dAINdeN:active:before,.form-9dAINdeN:hover .add-9dAINdeN:hover:before,.form-9dAINdeN:hover .menu-9dAINdeN.hover-9dAINdeN:before,.form-9dAINdeN:hover .menu-9dAINdeN:active:before,.form-9dAINdeN:hover .menu-9dAINdeN:hover:before{background-color:var(--tv-color-toolbar-button-background-hover,#f0f3fa);border-radius:var(--tv-toolbar-explicit-hover-border-radius,2px);bottom:var(--tv-toolbar-explicit-hover-margin,2px);content:"";display:block;left:var(--tv-toolbar-explicit-hover-margin,2px);position:absolute;right:var(--tv-toolbar-explicit-hover-margin,2px);top:var(--tv-toolbar-explicit-hover-margin,2px);z-index:-1}}html.theme-dark .form-9dAINdeN.interacting-9dAINdeN .add-9dAINdeN.hover-9dAINdeN:before,html.theme-dark .form-9dAINdeN.interacting-9dAINdeN .add-9dAINdeN:active:before,html.theme-dark .form-9dAINdeN.interacting-9dAINdeN .menu-9dAINdeN.hover-9dAINdeN:before,html.theme-dark .form-9dAINdeN.interacting-9dAINdeN .menu-9dAINdeN:active:before{background-color:var(--tv-color-toolbar-button-background-hover,#2a2e39)}@media (any-hover:hover),(min--moz-device-pixel-ratio:0){html.theme-dark .form-9dAINdeN.interacting-9dAINdeN .add-9dAINdeN:hover:before,html.theme-dark .form-9dAINdeN.interacting-9dAINdeN .menu-9dAINdeN:hover:before,html.theme-dark .form-9dAINdeN:hover .add-9dAINdeN.hover-9dAINdeN:before,html.theme-dark .form-9dAINdeN:hover .add-9dAINdeN:active:before,html.theme-dark .form-9dAINdeN:hover .add-9dAINdeN:hover:before,html.theme-dark .form-9dAINdeN:hover .menu-9dAINdeN.hover-9dAINdeN:before,html.theme-dark .form-9dAINdeN:hover .menu-9dAINdeN:active:before,html.theme-dark .form-9dAINdeN:hover .menu-9dAINdeN:hover:before{background-color:var(--tv-color-toolbar-button-background-hover,#2a2e39)}}.wrap-9dAINdeN{flex:1 0 auto}.input-9dAINdeN{background-color:initial;border:none;height:100%;margin:0;padding:0 2px;text-align:center;width:60px}.add-9dAINdeN,.menu-9dAINdeN{align-items:center;display:flex;height:100%}.menu-9dAINdeN{border-bottom-color:#e0e3eb;border-left:1px solid #e0e3eb;border-right:1px solid #e0e3eb;border-top-color:#e0e3eb;box-sizing:border-box;cursor:default;flex:1 0 auto;justify-content:space-between;padding:0 10px 0 6px}html.theme-dark .menu-9dAINdeN{border-color:#434651}.add-9dAINdeN{cursor:default;padding:0


ayui-nav-more{right:15px}.layui-nav-tree .layui-nav-item>a .layui-nav-more{padding:5px 0}.layui-nav-tree .layui-nav-bar{width:5px;height:0;background-color:#009688}.layui-side .layui-nav-tree .layui-nav-bar{width:2px}.layui-nav-tree .layui-nav-child dd.layui-this,.layui-nav-tree .layui-nav-child dd.layui-this a,.layui-nav-tree .layui-this,.layui-nav-tree .layui-this>a,.layui-nav-tree .layui-this>a:hover{background-color:#009688;color:#fff}.layui-nav-tree .layui-this:after{display:none}.layui-nav-itemed>a,.layui-nav-tree .layui-nav-title a,.layui-nav-tree .layui-nav-title a:hover{color:#fff!important}.layui-nav-tree .layui-nav-child{position:relative;z-index:0;top:0;border:none;box-shadow:none}.layui-nav-tree .layui-nav-child dd{margin:0}.layui-nav-tree .layui-nav-child a{color:#fff;color:rgba(255,255,255,.7)}.layui-nav-tree .layui-nav-child,.layui-nav-tree .layui-nav-child a:hover{background:0 0;color:#fff}.layui-nav-itemed>.layui-nav-child{display:block;background-color:rgba(0,0,0,.3)!important}.layui-nav-itemed>.layui-nav-child>.layui-this>.layui-nav-child{display:block}.layui-nav-side{position:fixed;top:0;bottom:0;left:0;overflow-x:hidden;z-index:999}.layui-breadcrumb{font-size:0}.layui-breadcrumb>*{font-size:14px}.layui-breadcrumb a{color:#999!important}.layui-breadcrumb a:hover{color:#5FB878!important}.layui-breadcrumb a cite{color:#666;font-style:normal}.layui-breadcrumb span[lay-separator]{margin:0 10px;color:#999}.layui-tab{margin:10px 0;text-align:left!important}.layui-tab[overflow]>.layui-tab-title{overflow:hidden}.layui-tab-title{position:relative;left:0;height:40px;white-space:nowrap;font-size:0;border-bottom-width:1px;border-bottom-style:solid;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;font-size:14px;transition:all .2s;-webkit-transition:all .2s;position:relative;line-height:40px;min-width:65px;padding:0 15px;text-align:center;cursor:pointer}.layui-tab-title li a{display:block;padding:0 15px;margin:0 -15px}.layui-tab-title .layui-this{color:#000}.layui-tab-title .layui-this:after{position:absolute;left:0;top:0;content:"";width:100%;height:41px;border-width:1px;border-style:solid;border-bottom-color:#fff;border-radius:2px 2px 0 0;box-sizing:border-box;pointer-events:none}.layui-tab-bar{position:absolute;right:0;top:0;z-index:10;width:30px;height:39px;line-height:39px;border-width:1px;border-style:solid;border-radius:2px;text-align:center;background-color:#fff;cursor:pointer}.layui


../interfaces'
import Set from '../Roaring Skies'

const card: Card = {
	name: {
		en: "Carbink",
		fr: "Strassie",
		es: "Carbink",
		it: "Carbink",
		pt: "Carbink",
		de: "Rocara"
	},
	illustrator: "Akira Komayama",
	rarity: "Rare",
	category: "Pokemon",

	set: Set,
	dexId: [
		703,
	],
	hp: 70,
	types: [
		"Fairy",
	],

	stage: "Basic",

	abilities: [
		{
			type: "Ability",
			name: {
				en: "Jewel Armor",
				fr: "Armure Joyau",
				es: "Armadura de Joyas",
				it: "Gemmascudo",
				pt: "Armadura de Joia",
				de: "Juwelenrüstung"
			},
			effect: {
				en: "As long as this Pokémon is on your Bench, prevent all damage done to this Pokémon by attacks (both yours and your opponent's).",
				fr: "Tant que ce Pokémon est sur votre Banc, évitez tous les dégâts infligés à ce Pokémon par des attaques (les vôtres et celles de votre adversaire).",
				es: "Mientras este Pokémon esté en tu Banca, evita todo el daño infligido a este Pokémon por ataques (tanto tuyos como de tu rival).",
				it: "Fintanto che questo Pokémon è nella tua panchina, previeni tutti i danni inflitti a questo Pokémon dagli attacchi, sia tuoi che del tuo avversario.",
				pt: "Desde que este Pokémon esteja em seu Banco, impede todos os danos causados a ele por ataques (seus e do seu oponente).",
				de: "Solang sich dieses Pokémon auf deiner Bank befindet, verhindere allen Schaden, der diesem Pokémon durch Angriffe (deine und die deines Gegners) zugefügt würde."
			},
		},
	],
	attacks: [
		{
			cost: [
				"Fairy",
				"Colorless",
				"Colorless",
			],
			name: {
				en: "Spin Tackle",
				fr: "Charge Tournoyante",
				es: "Placaje Giro",
				it: "Svoltazione",
				pt: "Investida Giratória",
				de: "Dreh-Tackle"
			},
			effect: {
				en: "Flip a coin. If tails, this Pokémon does 20 damage to itself.",
				fr: "Lancez une pièce. Si c'est pile, ce Pokémon s'inflige 20 dégâts.",
				es: "Lanza 1 moneda. Si sale cruz, este Pokémon se hace 20 puntos de daño a sí mismo.",
				it: "Lancia una moneta. Se esce croce, questo Pokémon infligge 20 danni a se stesso.",
				pt: "Jogue uma moeda. Se sair coroa, este Pokémon causará 20 de danos a ele mesmo.",
				de: "Wirf 1 Münze. Bei \"Zahl\" fügt sich dieses Pokémon selbst 20 Schadenspunkte zu."
			},
			damage: 60,

		},
	],
	weaknesses: [
		{
			type: "Metal",
			value: "×2"
		},
	],
	resistances: [
		{
			type: "Darkness",
			value: "-20"
		},
	],
	retreat: 2,

}

export default card
import AnimatedPoint from './AnimatedPoint';
import BoundaryPoints from './BoundaryPoints';

class Controller {
  x1: AnimatedPoint;
  x2: AnimatedPoint;
  activeLineBegin: AnimatedPoint;
  activeLineWidth: AnimatedPoint;

  boundaryPoints: BoundaryPoints;

  pointWidth: number;

  private _onValueChange: (values: [number, number]) => void;

  constructor(
    leftPointBeginPosition: number,
    pointsDistance: number,
    realBegin: number,
    realEnd: number,
    pointWidth: number,
    step: number,
    onValueChange: (values: [number, number]) => void,
    boundaryBegin?: number,
    boundaryEnd?: number,
  ) {


//
//  StylePreview.h
//  TTStyleBuilder
//
//  Created by Keith Lazuka on 6/18/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "TTStyleBuilderGlobal.h"

@interface StylePreview : TTView
{
    CGSize size;
    UIColor *fillColor;
    NSString *textForDelegate;
    UIImage *imageForDelegate;
}

// the properties that you define here will be exposed
// to the object editor controller (SettingsController)
// when asked to display the settings for a StylePreview instance.
//
// because of how this works, we define some properties here (like size and fillColor)
// that really could just use their UIView counterpart, but then it wouldn't be displayed
// in the list of properties that can be edited. As a result, for such properties you will
// probably want to hook into -[StylePreview setValue:forKey:] to re-route the new values
// into the UIView property (like |frame| or |backgroundColor|).
//
@property (nonatomic, assign) CGSize size;
@property (nonatomic, retain) UIColor *fillColor;
@property (nonatomic, retain) NSString *textForDelegate;
@property (nonatomic, retain) UIImage *imageForDelegate;

@end