M->TER & (1ul << 0)        )                    )     /* ITM Port #0 enabled */
  {
    while (ITM->PORT[0].u32 == 0);
    ITM->PORT[0].u8 = (uint8_t) ch;
  }
  return (ch);
}

/**
 * @brief  Inputs a character via variable ITM_RxBuffer
 *
 * @return      received character, -1 = no character received
 *
 * The function inputs a character via variable ITM_RxBuffer.
 * The function returns when no debugger is connected that has booked the output.
 * It is blocking when a debugger is connected, but the previous character send is not transmitted.
 */
static __INLINE int ITM_ReceiveChar (void) {
  int ch = -1;                               /* no character available */

  if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) {
    ch = ITM_RxBuffer;
    ITM_RxBuffer = ITM_RXBUFFER_EMPTY;       /* ready for next character */
  }

  return (ch);
}

/**
 * @brief  Check if a character via variable ITM_RxBuffer is available
 *
 * @return      1 = character available, 0 = no character available
 *
 * The function checks  variable ITM_RxBuffer whether a character is available or not.
 * The function returns '1' if a character is available and '0' if no character is available.
 */
static __INLINE int ITM_CheckChar (void) {

  if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) {
    return (0);                                 /* no character available */
  } else {
    return (1);                                 /*    character available */
  }
}

/*@}*/ /* end of group CMSIS_CM3_core_DebugInterface */

#ifdef __cplusplus
}
#endif

/*@}*/ /* end of group CMSIS_CM3_core_definitions */

#endif /* __CM3_CORE_H__ */

/*lint -restore */


 {string}  data The string to parse
 * @return {Promise.<GlobalScope>} The Abstract Systax Tree (AST).
 */
export async function parse(data: string): Promise<GlobalScope> {
  const parses = await getPossibleParses(data);
  if(!parses.length) {
    throw new SyntaxError('Something went wrong, input not parseable.');
  }
  return parses[0];
}import * as Program from './createProcessBarcode'
import * as fixture from './ProductData.fixture'
import { noUsefulInfoFound } from './failures'

describe('createProcessBarcode', () => {
  let searchBarcode: Program.SearchBarcode
  let fetchProductPage: Program.FetchProductPage
  let scrapeProductPage: Program.ScrapeProductPage
  let translateProductData: Program.TranslateProductData
  let deps: Program.Deps

  const scrapeFirstPage: Program.ScrapeProductPage = () => ({
    ingredients: fixture.productPageData.ingredients,
  })
  const defaultFetchProductPage: Program.FetchProductPage = (link) =>
    Promise.resolve({ link, html: `html from ${link}` })

  beforeEach(() => {
    searchBarcode = jest.fn(() => Promise.resolve(fixture.productSearchData))
    fetchProductPage = jest.fn(defaultFetchProductPage)
    scrapeProductPage = jest.fn(scrapeFirstPage)
    translateProductData = jest.fn(() =>
      Promise.resolve(fixture.translatedProductData),
    )
    deps = {
      searchBarcode,
      fetchProductPage,
      scrapeProductPage,
      translateProductData,
    }
  })

  it('searches barcode', async () => {
    await Program.createProcessBarcode(deps)(fixture.barcode)
    expect(searchBarcode).toHaveBeenCalledWith(fixture.barcode)
  })

  it('fetches all product pages', async () => {
    await Program.createProcessBarcode(deps)(fixture.barcode)
    expect(fetchProductPage).toHaveBeenCalledTimes(
      fixture.productSearchData.links.length,
    )
  })

  it('translates data', async () => {
    await Program.createProcessBarcode(deps)(fixture.barcode)
    expect(translateProductData).toHaveBeenCalledWith(fixture.productData)
  })

  it('aggregates data from all pages', async () => {
    const origin = 'Finland'
    const scrapeSecondPage: Program.ScrapeProductPage = () => ({
      ingredients: 'discard',
      origin,
    })
    ;(scrapeProductPage as jest.Mock)
      .mockImplementationOnce(scrapeFirstPage)
      .mockImplementationOnce(scrapeSecondPage)

    await Program.createProcessBarcode(deps)(fixture.barcode)

    expect(translateProductData).toHaveBeenCalledWith({
      ...fixture.productData,
      origin,
    })
  })

  it('returns translated product data', async () => {
    const productData = await Program.createProcessBarcode(deps)(
      fixture.barcode,
    )
    expect(productData).toEqual(fixture.translatedProductData)
  })

  it('handles fetch product page failure', async () => {
    ;(fetchProductPage as jest.Mock)
      .mockImplementationOnce(defaultFetchProductPage)
      .mockImplementationOnce(() => Promise.reject())
    const productData = await Program.createProcessBarcode(deps)(
      fixture.barcode,
    )
    expect(productData).toEqual(fixture.translatedProductData)
  })

  it('throws noUsefulInfoFound error if productData only contains links', async () => {
    const onlyLinksProductData = {
      links: ['http://link1.com', 'http://link2


.09);
}

input[type="color"]:focus,
input[type="date"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="email"]:focus,
input[type="month"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="text"]:focus,
input[type="time"]:focus,
input[type="url"]:focus,
input[type="week"]:focus,
input:not([type]):focus,
textarea:focus {
	outline: none;
}

input[type="color"]:disabled,
input[type="date"]:disabled,
input[type="datetime"]:disabled,
input[type="datetime-local"]:disabled,
input[type="email"]:disabled,
input[type="month"]:disabled,
input[type="number"]:disabled,
input[type="password"]:disabled,
input[type="search"]:disabled,
input[type="tel"]:disabled,
input[type="text"]:disabled,
input[type="time"]:disabled,
input[type="url"]:disabled,
input[type="week"]:disabled,
input:not([type]):disabled,
textarea:disabled {
	cursor: not-allowed;
}

input[type="file"] {
	margin: 10px 0 6px 0;
}

textarea {
	resize: vertical;
	min-height: 190px;
}

select {
	width: 100%;
}

[type="checkbox"],
[type="radio"] {
	display: inline;
}

table {
	border-collapse: collapse;
	table-layout: fixed;
	width: 100%;
}

tr,
td,
th {
	vertical-align: middle;
}

th {
	text-align: left;
}

.monadic-input-choices {
	position: absolute;
	left: -9999px;
}

.monadic-input-choices + span {
	cursor: pointer;
	position: relative;
	display: inline-block;
	vertical-align: top;
	margin-right: 50px;
}

.monadic-input-choices + span:before,
.monadic-input-choices + span:after {
	position: absolute;
	-webkit-transition: all .2s;
	transition: all .2s;
}

.monadic-input-choices + span:before {
	content: '';
}

.monadic-input-choices--checkbox + span,
.monadic-input-choices--radio + span {
	padding-left: 40px;
}

.monadic-input-choices--checkbox + span:before,
.monadic-input-choices--checkbox + span:after,
.monadic-input-choices--radio + span:before,
.monadic-input-choices--radio + span:after {
	left: 0;
	top: 4px;
	width: 20px;
	height: 20px;
	line-height: 20px;
}

.monadic-input-choices--checkbox + span:before,
.monadic-input-choices--radio + span:before {
	border: 1px solid #DDDDDF;
	background: #fff;
	border-radius: 2px;
}

.monadic-input-choices--checkbox + span:after,
.monadic-input-choices--radio + span:after {
	font-size: 20px;
	opacity: 0;
	-webkit-transform: scale(0);
	transform: scale(0);
}

.monadic-input-choices--checkbox:checked + span:after,
.monadic-input-choices--radio:checked + span:after {
	opacity: 1;
	-webkit-transform: scale(1);
	transform: scale(1);
}


�� ◌ ◆-----◇ ◌ ◌ ◌ ◌ ◌
        range_map.insert(2..5, ());
        // 0 1 2 3 4 5 6 7 8 9
        // ◌ ◌ ◌ ◌ ◆ ◌ ◌ ◌ ◌ ◌
        let outer_range = 4..4;
        let mut gaps = range_map.gaps(&outer_range);
        // Should yield no gaps.
        assert_eq!(gaps.next(), None);
        // Gaps iterator should be fused.
        assert_eq!(gaps.next(), None);
        assert_eq!(gaps.next(), None);
    }

    ///
    /// impl Debug
    ///

    #[test]
    fn map_debug_repr_looks_right() {
        let mut map: RangeMap<u32, ()> = RangeMap::new();

        // Empty
        assert_eq!(format!("{:?}", map), "{}");

        // One entry
        map.insert(2..5, ());
        assert_eq!(format!("{:?}", map), "{2..5: ()}");

        // Many entries
        map.insert(6..7, ());
        map.insert(8..9, ());
        assert_eq!(format!("{:?}", map), "{2..5: (), 6..7: (), 8..9: ()}");
    }

    // Iterator Tests

    #[test]
    fn into_iter_matches_iter() {
        // Just use vec since that's the same implementation we'd expect
        let mut range_map: RangeMap<u32, bool> = RangeMap::new();
        range_map.insert(1..3, false);
        range_map.insert(3..5, true);

        let cloned = range_map.to_vec();
        let consumed = range_map.into_iter().collect::<Vec<_>>();

        // Correct value
        assert_eq!(cloned, vec![(1..3, false), (3..5, true)]);

        // Equality
        assert_eq!(cloned, consumed);
    }

    // impl Serialize

    #[cfg(feature = "serde1")]
    #[test]
    fn serialization() {
        let mut range_map: RangeMap<u32, bool> = RangeMap::new();
        // 0 1 2 3 4 5 6 7 8 9
        // ◌ ◆---◇ ◌ ◌ ◌ ◌ ◌ ◌
        range_map.insert(1..3, false);
        // 0 1 2 3 4 5 6 7 8 9
        // ◌ ◌ ◌ ◌ ◌ ◆---◇ ◌ ◌
        range_map.insert(5..7, true);
        let output = serde_json::to_string(&range_map).expect("Failed to serialize");
        assert_eq!(output, "[[[1,3],false],[[5,7],true]]");
    }

    // impl Deserialize

    #[cfg(feature = "serde1")]
    #[test]
    fn deserialization() {
        let input = "[[[1,3],false],[[5,7],true]]";
        let range_map: RangeMap<u32, bool> =
            serde_json::from_str(input).expect("Failed to deserialize");
        let reserialized = serde_json::to_string(&range_map).expect("Failed to re-serialize");
        assert_eq!(reserialized, input);
    }
}
use std::io::Write;
use std::sync;

use liquid_error::Result;
use liquid_interpreter as interpreter;
use liquid_interpreter::PartialStore;
use liquid_interpreter::Renderable;

pub struct Template {
    pub(crate) template: interpreter::Template,
    pub(crate) partials: Option<sync::Arc<PartialStore + Send + Sync>>,
}

impl Template {
    /// Renders an instance of the Template, using the given globals.
    pub fn render(&self, globals: &interpreter::ValueStore) -> Result<String> {
        const BEST_GUESS: usize = 10_000;
        let mut data = Vec::with_capacity(BEST_GUESS);
        self.


(
          int index, emu.grasscutter.net.proto.EDAHOHEGPPFOuterClass.EDAHOHEGPPF value) {
        if (gLKDCCOKANHBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureGLKDCCOKANHIsMutable();
          gLKDCCOKANH_.add(index, value);
          onChanged();
        } else {
          gLKDCCOKANHBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * repeated .EDAHOHEGPPF GLKDCCOKANH = 7;
       */
      public Builder addGLKDCCOKANH(
          emu.grasscutter.net.proto.EDAHOHEGPPFOuterClass.EDAHOHEGPPF.Builder builderForValue) {
        if (gLKDCCOKANHBuilder_ == null) {
          ensureGLKDCCOKANHIsMutable();
          gLKDCCOKANH_.add(builderForValue.build());
          onChanged();
        } else {
          gLKDCCOKANHBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * repeated .EDAHOHEGPPF GLKDCCOKANH = 7;
       */
      public Builder addGLKDCCOKANH(
          int index, emu.grasscutter.net.proto.EDAHOHEGPPFOuterClass.EDAHOHEGPPF.Builder builderForValue) {
        if (gLKDCCOKANHBuilder_ == null) {
          ensureGLKDCCOKANHIsMutable();
          gLKDCCOKANH_.add(index, builderForValue.build());
          onChanged();
        } else {
          gLKDCCOKANHBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * repeated .EDAHOHEGPPF GLKDCCOKANH = 7;
       */
      public Builder addAllGLKDCCOKANH(
          java.lang.Iterable<? extends emu.grasscutter.net.proto.EDAHOHEGPPFOuterClass.EDAHOHEGPPF> values) {
        if (gLKDCCOKANHBuilder_ == null) {
          ensureGLKDCCOKANHIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, gLKDCCOKANH_);
          onChanged();
        } else {
          gLKDCCOKANHBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * repeated .EDAHOHEGPPF GLKDCCOKANH = 7;
       */
      public Builder clearGLKDCCOKANH() {
        if (gLKDCCOKANHBuilder_ == null) {
          gLKDCCOKANH_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
          onChanged();
        } else {
          gLKDCCOKANHBuilder_.clear();
        }
        return this;
      }
      /**
       * repeated .EDAHOHEGPPF GLKDCCOKANH = 7;
       */
      public Builder removeGLKDCCOKANH(int index) {
        if (gLKDCCOKANHBuilder_ == null) {
          ensureGLKDCCOKANHIsMutable();
          gLKDCCOKANH_.remove(index);
          onChanged();
        } else {
          gLKDCCOKANHBuilder_.remove(index);
        }
        return this;
      }
      /**
       * re


#     print("当无batch增强时indexs是否包含index1且顺序一致:", result)
        #     print("位置为",ii)
        #     # mask1 = torch.isin(index1, zt_index)

            # print('当维度相同时索引是否相同',mask1.all().item())
        if epoch < args.memory_start_epoch:
            if (i + 1) == len(train_loader):
                res = len(train_loader.dataset) % len(train_loader)
                #last_batch_each_gpu = math.ceil(len(index) / len(trloader))
                mask = torch.zeros_like(index1, dtype=torch.bool)

                for j in range(len(index1), res, -1):
                    mask[ j - 1] = True

                index = index[(~mask)]
                #print(index)
                z_teacher = z_teacher[(~mask).repeat(2)]
                z_student =  z_student[(~mask).repeat(2)]
                p = p[(~mask).repeat(2)]

        # neg_logits, loss_sample_wise, loss_ood= nt_xent(out, t=0.05,
        #                                                           index=index,
        #                                                           sup_weight=0.2,
        #                                                           COLT=True)

        #     z_teacher, p, z_student, args, epoch=epoch,
        #     memory=student_nn_replacer.bank.to(device))
        neg_logits, loss_reshape, loss = loss_fn(z_teacher, p, z_student, zt_index,p_index,
                                                 zs_index,student_nn_replacer.bank.to(device),
                                                 student_nn_replacer.index_bank.to(device),epoch)

        #print('neg_logits',neg_logits.shape)
        beta=0.97
        k_largest_logits=10
        #print(z_teacher.shape[0])
        #print(bsz)
        if epoch >= args.memory_start_epoch and args.enhance_batch and not args.use_nnclr:
            neg_logits = neg_logits.detach()
            #print(neg_logits.shape)
            index=zs_index

            for count in range(index.shape[0]):
                if not int(index[count]) == -1:
                    new_average = neg_logits[count].sort(descending=True)[0][
                                      :k_largest_logits].sum().clone().detach()
                    shadow[int(index[count])] = new_average
                    momentum_tail_score[epoch-1, int(index[count])] = new_average

        else:
            #print(index)
            #print(index.shape)
            neg_logits = neg_logits.mean(dim=0).detach()
            #print( neg_logits.shape)
            for count in range(index.shape[0] //2):
                if not index[count] == -1:
                    if epoch > 1:
                        new_average = (1.0 - beta) * neg_logits[count].sort(descending=True)[0][
                                                                        :k_largest_logits].sum().clone().detach() \
                                      + beta * shadow[index[count]]
                    else:
                        new_average = neg_logits[count].sort(descending=True)[0][
                                      :k_largest_logits].sum().clone().detach()
                    shadow[index[count]] = new_average
                    momentum_tail_score[epoch-1, index[count]] = new_average

        # loss_state = beclr_loss(
        # loss_dy = loss_state['loss']
        # loss=loss_dy+0.2*loss_ood
        #loss=loss_dy

        #print('loss_ood',loss_ood.item())
        #print('loss_all',loss.item())
        # update student weights through backpropagation
        optimizer.zero_grad()
        loss.backward()
        cancel_gradients_last_layer(epoch, student,
                                    args.freeze_last_layer)
        optimizer.step()

        # update teacher weights through EMA
        with torch.no_grad():
            m = momentum_schedule[global_it]  # momentum parameter
            for param_q, param_k in zip(params_q, params_k):
                param_k.data.mul_(m).add_((1 - m) * param_q.detach().data)

        # logging
        loss_hist.update(loss.item(), bsz)
        #loss_pos_hist.update(loss_state["loss_pos"].item(), bsz)
        #loss_neg_hist.update(loss_state["loss_neg"].item(), bsz)
        #std_hist.update(loss_state["std"].item(), bsz)
        batch_time.update(time.time() - end)
        end = time.time()

        if (it + 1) % args.print_freq == 0:
            print('Train: [{0}][{1}/{2}]\t'
                  'BT {


 [0,1]
	-- cost: = 15+deck_capacity*5
	if variable == "shuffle_deck_when_empty" then
		local random = Random(0, 1)
		if t_gun["force_unshuffle"] == 1 then
			random = 1
			if cost < (15 + deck_capacity * 5) then
				-- print( "DEBUG THIS SHOULDN'T HAPPEN!")
			end
		end

		-- clamped unshuffles to deck capacity 9
		if random == 1 and cost >= (15 + deck_capacity * 5) and deck_capacity <= 9 then
			t_gun[variable] = 0
			t_gun["cost"] = t_gun["cost"] - (15 + deck_capacity * 5)
			-- print("unshuffling the deck ")
		end
		return
	end

	-- actions_per_round: [1-5]
	-- cost: *
	if variable == "actions_per_round" then
		local action_costs = {
			0,
			5 + (deck_capacity * 2),
			15 + (deck_capacity * 3.5),
			35 + (deck_capacity * 5),
			45 + (deck_capacity * deck_capacity),
		}

		local min = 1
		local max = 1
		for i, acost in ipairs(action_costs) do
			if acost <= cost then max = i end
		end
		max = clamp(max, 1, deck_capacity)

		t_gun[variable] = math.floor(clamp(RandomDistribution(probs.min, probs.max, probs.mean, probs.sharpness), min, max))
		local temp_cost = action_costs[clamp(t_gun[variable], 1, #action_costs)]
		-- print( "t_gun: ", t_gun[variable] )
		-- print( "temp_cost: ", temp_cost )
		t_gun["cost"] = t_gun["cost"] - temp_cost
		return
	end
end

---------------------------------------------------------------------------------

function WandDiff(gun, wand)
	local score = 0
	score = score + (math.abs(gun.fire_rate_wait - wand.fire_rate_wait) * 2)
	score = score + (math.abs(gun.actions_per_round - wand.actions_per_round) * 20)
	score = score + (math.abs(gun.shuffle_deck_when_empty - wand.shuffle_deck_when_empty) * 30)
	score = score + (math.abs(gun.deck_capacity - wand.deck_capacity) * 5)
	score = score + math.abs(gun.spread_degrees - wand.spread_degrees)
	score = score + math.abs(gun.reload_time - wand.reload_time)
	return score
end

function GetWand(gun)
	local best_wand = nil
	local best_score = 1000
	local gun_in_wand_space = {}
	--[[

	-- convert the values to wand_array space
	-- fire_rate_wait:            0  -  2   / 1 - 30 (50)
	-- actions_per_round:         0  -  2 	/  1 - 3
	-- shuffle_deck_when_empty:   0  -  1 	/
	-- deck_capacity:             0  -  7 	/ 3 - 10 / 20
	-- spread_degrees:            0  -  2 	/ -5 - 10 / -35 - 35
	-- reload_time:               0  -  2 	/ 5 - 100

		deck_capacity
		0 = 3-4
		1 = 5-6
		2 = 7-8
		3 = 8-9
		4 = 10-12
		5 = 13-15
		6 = 15-17
		7 = 17+
	]]
	--

	gun_in_wand_space.fire_rate_wait = clamp(((gun["fire_rate_wait"] + 5) / 7) - 1, 0, 4)
	gun_in_wand_space.actions_per_round = clamp(gun["actions_per_round"] - 1, 0, 2)
	gun_in_wand_space.shuffle_deck_when_empty = clamp(gun


/**
 * @file   featurepropertiesdialog.h
 * @author Wei-Ning Huang (AZ) <aitjcize@gmail.com>
 *
 * Copyright (C) 2012 - 2014 Wei-Ning Huang (AZ) <aitjcize@gmail.com>
 * All Rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef __FEATUREPROPERTIESDIALOG_H__
#define __FEATUREPROPERTIESDIALOG_H__

#include <QDialog>

#include "symbol.h"

namespace Ui {
  class FeaturePropertiesDialog;
}

class FeaturePropertiesDialog : public QDialog
{
  Q_OBJECT

public:
  explicit FeaturePropertiesDialog(QWidget *parent = 0);
  ~FeaturePropertiesDialog();

public slots:
  void update(Symbol* symbol);

private:
  Ui::FeaturePropertiesDialog *ui;
};

#endif // __FEATUREPROPERTIESDIALOG_H__


se std::path::Path;

pub fn load_gltf<P>(path: P)
where
    P: AsRef<Path>,
{
    let gltf = Gltf::open(path).expect("[gltf] Does not exist.");

    // let mut geometries: Vec<GeometryData> = Vec::new();
    let mut buffers_data: Vec<Vec<u8>> = Vec::new();

    for buffer in gltf.buffers() {
        match buffer.source() {
            Source::Bin => {
                if let Some(blob) = gltf.blob.as_deref() {
                    buffers_data.push(blob.into());
                }
            }
            _ => unimplemented!(),
        }
    }

    // for mesh in gltf.meshes() {
    //     for primitive in mesh.primitives() {
    //         geometries.push(create_geometry(&buffers_data, primitive));
    //     }
    // }

    // let mut world = World::new();
    // for scene in gltf.scenes() {
    //     let root = world.reserve_entity();
    //     world.insert_one(root, Transform::new()).unwrap();

    //     for node in scene.nodes() {
    //         let entity = world.reserve_entity();

    //         world
    //             .insert_one(
    //                 entity,
    //                 Transform::from_matrix4(Mat4::from_cols_array_2d(&node.transform().matrix())),
    //             )
    //             .unwrap();

    //         if let Some(mesh) = node.mesh() {
    //             let geometries: Vec<GeometryData> = mesh
    //                 .primitives()
    //                 .map(|primitive| create_geometry(&buffers_data, primitive))
    //                 .collect();
    //             world.insert_one(entity, geometries).unwrap();
    //         }
    //     }
    // }

    // world
}

// fn create_geometry(buffers_data: &Vec<Vec<u8>>, primitive: gltf::Primitive) -> GeometryData {
//     let reader = primitive.reader(|buffer| Some(&buffers_data[buffer.index()]));

//     let mut data = GeometryData::new();

//     if let Some(values) = reader
//         .read_positions()
//         .map(|v| VertexValues::Float3(v.collect()))
//     {
//         data.set_attribute(GeometryData::ATTRIBUTE_POSITION, values);
//     }

//     if let Some(values) = reader
//         .read_normals()
//         .map(|v| VertexValues::Float3(v.collect()))
//     {
//         data.set_attribute(GeometryData::ATTRIBUTE_NORMAL, values);
//     }

//     if let Some(values) = reader
//         .read_tex_coords(0)
//         .map(|v| VertexValues::Float2(v.into_f32().collect()))
//     {
//         data.set_attribute(GeometryData::ATTRIBUTE_TEX_COORD, values);
//     }

//     if let Some(values) = reader
//         .read_indices()
//         .map(|v| IndiceValues::U32(v.into_u32().collect()))
//     {
//         data.set_indices(Some(values));
//     }

//     data
// }

// fn create_node(buffers_data: &Vec<Vec<u8>>, node: gltf::Node, parent: &Entity, world: &mut World) {
//     let entity = world.reserve_entity();

//     world
//         .insert_one(
//             entity,
//             Transform::from_matrix4(Mat4::from_cols_array_2d(&node.transform().matrix())),
//         )
//         .unwrap();

//     if let Some(mesh) = node.


인터럽트 컨트롤러**가 실행되어 인터럽트의 처리 순서를 결정한다. 이때 **여러개의 인터럽트가 동시에 발생했다**면, **인터럽트의 우선순위를 고려하여 중요한 인터럽트부터** 처리하도록 순서를 결정한다.
3. 먼저 처리할 인터럽트가 결정되면 인터럽트 벡터에 등록된 인터럽트 핸들러가 실행된다.
4. 인터럽트 벡터에 연결된 핸들러가 인터럽트 처리를 마치면 일시 정지된 프로세스가 다시 실행되거나 종료된다.(발생한 인터럽트가 입출력 완료 같은 경우에는 일시 정지된 프로세스가 다시 실행되고, 다른 프로세스의 메모리 영역 침범이나 오류 같은 경우이면 종료된다.)

## 인터럽트와 이중모드

프로세스는 커널 프로세스와 사용자 프로세스로 나뉜다.

### 커널 프로세스

- 운영체제와 관련된 커널 프로세스가 실행되는 상태

### 사용자 프로세스

- 사용자 프로세스가 실행되는 상태

### 이중 모드

사용자와 커널 두 모드을 전환하며 일 처리 하는 것

**상황**

사용자 프로세스가 커널의 기능(하드디스크 입출력, 프로세스 생성)을 사용하기 위해 시스템 호출을 이용하여 커널 프로세스에 작업을 요청했을때

1. 사용자 프로세스는 시스템 호출을 요청한 후 대기 상태로 전환
2. 커널 프로세스는 요청받은 작업을 처리

사용자 모드에서 커널 모드로 전환된다.

**목적**

운영체


ConflictZoneSet")
if self.Intel then
self.Intel.conflictzoneset:AddSet(ConflictZoneSet)
else
self:E(self.lid.."*****NO detection has been set up (yet)!")
end
return self
end
function PLAYERTASKCONTROLLER:RemoveAcceptZone(AcceptZone)
self:T(self.lid.."RemoveAcceptZone")
if self.Intel then
self.Intel:RemoveAcceptZone(AcceptZone)
else
self:E(self.lid.."*****NO detection has been set up (yet)!")
end
return self
end
function PLAYERTASKCONTROLLER:RemoveRejectZone(RejectZone)
self:T(self.lid.."RemoveRejectZone")
if self.Intel then
self.Intel:RemoveRejectZone(RejectZone)
else
self:E(self.lid.."*****NO detection has been set up (yet)!")
end
return self
end
function PLAYERTASKCONTROLLER:RemoveConflictZone(ConflictZone)
self:T(self.lid.."RemoveConflictZone")
if self.Intel then
self.Intel:RemoveConflictZone(ConflictZone)
else
self:E(self.lid.."*****NO detection has been set up (yet)!")
end
return self
end
function PLAYERTASKCONTROLLER:SetMenuName(Name)
self:T(self.lid.."SetMenuName: "..Name)
self.MenuName=Name
return self
end
function PLAYERTASKCONTROLLER:SetParentMenu(Menu)
self:T(self.lid.."SetParentMenu")
return self
end
function PLAYERTASKCONTROLLER:SetupIntel(RecceName)
self:T(self.lid.."SetupIntel")
self.RecceSet=SET_GROUP:New():FilterCoalitions(self.CoalitionName):FilterPrefixes(RecceName):FilterStart()
self.Intel=INTEL:New(self.RecceSet,self.Coalition,self.Name.."-Intel")
self.Intel:SetClusterAnalysis(true,false,false)
self.Intel:SetClusterRadius(self.ClusterRadius or 0.5)
self.Intel.statusupdate=25
self.Intel:SetAcceptZones()
self.Intel:SetRejectZones()
if self.Type==PLAYERTASKCONTROLLER.Type.A2G or self.Type==PLAYERTASKCONTROLLER.Type.A2GS then
self.Intel:SetDetectStatics(true)
end
self.Intel:__Start(2)
local function NewCluster(Cluster)
if not self.usecluster then return self end
local cluster=Cluster
local type=cluster.ctype
self:T({type,self.Type})
if(type==INTEL.Ctype.AIRCRAFT and self.Type==PLAYERTASKCONTROLLER.Type.A2A)or(type==INTEL.Ctype.NAVAL and(self.Type==PLAYERTASKCONTROLLER.Type.A2S or self.Type==PLAYERTASKCONTROLLER.Type.A2GS))then
self:T("A2A or A2S")
local contacts=cluster.Contacts
local targetset=SET_GROUP:New()
for _,_object in pairs(contacts)do
local contact=_object
self:T("Adding group: "..contact.groupname)
targetset:AddGroup(contact.group,true)
end
self:AddTarget(targetset)
elseif(type==INTEL.Ctype.GROUND or type==INTEL.Ctype.STRUCTURE)and(self.Type==PLAYERTASKCONTROLLER.Type.A2G or self.Type==PLAYERTASKCONTROLLER.Type.A2GS)then
self:T("A2G")
local contacts=cluster.Contacts
local targetset=nil
if type==INTEL.Ctype.GROUND then
targetset=SET_GROUP:New()
for _,_object in pairs(contacts)do
local contact=_object
self:T("Adding group: "..contact.groupname)
targetset:AddGroup(contact.group,true)
end
elseif type==INTEL.Ctype.STRUCTURE then


l=https://mmbiz.qpic.cn/sz_mmbiz_png/UicQ7HgWiaUb3q20ZIUA3ARYblibNHE4dLVwWqImO3XGa7xcmuNu9Cw0xicD2z3eBG7tW3FvxqWCxpfkJ6ydOiaETyw/640?wx_fmt=png&from=appmsg" alt="">

AI发现新型抗生素，280多种候选

这项发明，是人类对抗抗生素耐药性的转折点。

MIT医学工程与科学教授James Collins表示，通过这项研究，我们可以看到为了预测哪些分子可以成为良好的抗生素，AI模型是如何学习的。

「从化学结构的角度来看，我们的工作提供了一个在迄今为止从未有过的框架，在时间和资源上都很高效，同时具备深刻的洞察力。」

为了预测全新化合物的活性和毒性，团队使用的是深度学习模型。

模型使用人工神经网络自动从数据中学习和表征数据，无需显式编程。

这种图神经网络，越来越多地被用于药物发现中，来加速识别潜在的候选药物，预测其特性，并且优化药物的开发过程。

用于预测抗生素活性和人细胞毒性的深度学习模型的集成

为了研究耐甲氧西林金黄色葡萄球菌 (MRSA)，MIT的研究团队使用扩展的数据集，训练了一个广泛扩展的深度学习模型。

为了创建训练数据，团队评估了大约39000种化合物对MRSA的抗生素活性。

随后，他们将所得数据和有关化合物化学结构的细节，输入到模型中。

论文主要作者之一、MIT工学院和哈佛博士后Felix Wong表示，这个过程，仿佛就像在打开一个黑匣子。

「这些模型由模拟神经连接的超大规模数字计算组成，没有人真正知道引擎盖下面究竟发生了什么。」

<img src="https://api.allorigins.win/raw?url=https://mmbiz.qpic.cn/sz_mmbiz_png/UicQ7HgWiaUb3q20ZIUA3ARYblibNHE4dLVeza5oV6fmKbhAN3uXgnjP52qkWYLMicRxibLcTdFZ6X1U


::registry().with(layer).set_default();
        b.iter(|| black_box(fibonacci(3)));
    });
    group.bench_function("locations", |b| {
        let (layer, _guard) = tracing_chrome::ChromeLayerBuilder::new()
            .include_args(false)
            .include_locations(true)
            .writer(std::io::sink())
            .build();
        let _subscriber = tracing_subscriber::registry().with(layer).set_default();
        b.iter(|| black_box(fibonacci(3)));
    });
    group.bench_function("minimal", |b| {
        let (layer, _guard) = tracing_chrome::ChromeLayerBuilder::new()
            .include_args(false)
            .include_locations(false)
            .writer(std::io::sink())
            .build();
        let _subscriber = tracing_subscriber::registry().with(layer).set_default();
        b.iter(|| black_box(fibonacci(3)));
    });
}

fn event_benchmark(c: &mut Criterion) {
    let mut group = c.benchmark_group("event");
    group.throughput(criterion::Throughput::Elements(1));

    group.bench_function("locations_and_args", |b| {
        let (layer, _guard) = tracing_chrome::ChromeLayerBuilder::new()
            .include_args(true)
            .include_locations(true)
            .writer(std::io::sink())
            .build();
        let _subscriber = tracing_subscriber::registry().with(layer).set_default();
        b.iter(|| {
            info!(arg = 42, "Something Happen");
        });
    });
    group.bench_function("locations", |b| {
        let (layer, _guard) = tracing_chrome::ChromeLayerBuilder::new()
            .include_args(false)
            .include_locations(true)
            .writer(std::io::sink())
            .build();
        let _subscriber = tracing_subscriber::registry().with(layer).set_default();
        b.iter(|| {
            info!(arg = 42, "Something Happen");
        });
    });
    group.bench_function("minimal", |b| {
        let (layer, _guard) = tracing_chrome::ChromeLayerBuilder::new()
            .include_args(false)
            .include_locations(false)
            .writer(std::io::sink())
            .build();
        let _subscriber = tracing_subscriber::registry().with(layer).set_default();
        b.iter(|| {
            info!(arg = 42, "Something Happen");
        });
    });
}

criterion_group!(benches, instrument_benchmark, event_benchmark);
criterion_main!(benches);
<reponame>jdesiloniz/svpdev
#[macro_use]
extern crate clap;
use clap::App;

use std::error::Error;
use std::fs::File;
use std::io::prelude::*;

pub struct Config {
    pub input_filename: String,
    pub output_prefix: String,
    pub reverse_endianness: bool,
    pub split_binary: bool,
    pub split_size_kb: u16,
}

impl Config {
    pub fn new_from_args() -> Result<Config, ()> {
        let yaml = load_yaml!("cli.yml");
        let matches = App::from_yaml(yaml).get_matches();

        match (matches.value_of("INPUT"), matches.value_of("OUTPUT")) {
            (Some(input), Some(output)) => {
                let reverse_endianness = matches.occurrences_of("reverse_endianness") > 0;
                let split_binary = matches.occurrences_of("split_binary") > 0;

                let split_size_kb =
                    if let Some(kbs) = matches.value_of("split_size_kb").map(|v| v.parse()) {
                        if let Ok(size) = kbs {
                            if size > 4096 {


emptiness".substring(9,9).equals("")),
			"Error : test_substring failed - 12");
		try {
			String str = "emptiness".substring(10,10);
			harness.fail("Error : test_substring failed - 13");
		}catch( IndexOutOfBoundsException e ){ harness.check(true);}
		try {
			String str = "emptiness".substring(1110,1110);
			harness.fail("Error : test_substring failed - 14");
		}catch( IndexOutOfBoundsException e ){ harness.check(true);}

	}

	public void test_concat( )
	{

	     harness.checkPoint("concat(java.lang.String)java.lang.String");
		try {
			String str = "help".concat(null);
			harness.fail("Error : test_concat failed - 1");
		}catch ( NullPointerException e){}

		harness.check(!( !"help".concat("me").equals("helpme")),
			"Error : test_concat failed - 2");

		harness.check(!( ! "to".concat("get").concat("her").equals("together")),
			"Error : test_concat failed - 3");

		harness.check(!( "hi".concat("") != "hi"),
			"Error : test_concat failed - 4");

		String str1 = "".concat("there");
		harness.check(!( !str1.equals("there")),
			"Error : test_concat failed - 5");

	// EJWcr00467
		String str2 = new String();
		try {
		    str2 = str2.concat("hello");
		    if (!str2.equals("hello")) {
			harness.fail("Error : test_concat failed - 7");
		    }
		} catch (Exception e) {
			harness.fail("Error : test_concat failed - 6");
		}
	}

	public void test_replace()
	{

	     harness.checkPoint("replace(char,char)java.lang.String");
		harness.check(!( !"mesquite in your cellar".replace('e' , 'o' ).equals(
			          "mosquito in your collar" )),
			"Error : test_replace failed - 1");

		harness.check(!( !"the war of baronets".replace('r' , 'y' ).equals(
			          "the way of bayonets" )),
			"Error : test_replace failed - 2");

		harness.check(!( !"sparring with a purple porpoise".replace('p' , 't' ).equals(
			          "starring with a turtle tortoise" )),
			"Error : test_replace failed - 3");

		harness.check(!( !"JonL".replace('q' , 'x' ).equals("JonL" )),
			"Error : test_replace failed - 4");

		harness.check(!( !"ppppppppppppp".replace('p' , 'p' ).equals("ppppppppppppp")),
			"Error : test_replace failed - 5");

		harness.check(!( !"ppppppppppppp".replace('p' , '1' ).equals("1111111111111")),
			"Error : test_replace failed - 6");
		harness.check(!( !"hp".replace('c' , 'd' ).equals("hp")),
			"Error : test_replace failed - 7");
		harness.check(!( !"vmhere".replace('a' , 'd' ).equals("vmhere")),
			"Error : test_replace failed - 8");
		harness.check(!( !"hp\nnf\t".replace('\n' , 'd').equals("hpdnf\t")),
			"Error : test_replace failed - 9");
		harness.check(!( !"vmhere".replace('e' , '\t').equals("vmh\tr\t")),
			"Error : test_replace failed - 10");

	}

	public void test_toLowerCase()
	{

	     harness.checkPoint("toLowerCase()java.lang.String");
		harness.check(!( !"".toLowerCase().equals("")),
			"Error :


            ],
          ),
        ),
        new Flexible(
          child: new Row(
            justifyContent: FlexJustifyContent.start,
            alignItems: FlexAlignItems.end,
            children: <Widget>[
              new Padding(
                padding: const EdgeDims.only(right: 16.0),
                child: new Text('SHARE', style: buttonStyle),
              ),
              new Text('EXPLORE', style: buttonStyle),
            ],
          ),
        ),
        new Text(destination.description[0], style: descriptionStyle),
      ],
    );
  }
}

class Bingo {
  Bingo({nothing: null, children: null});
}

class Widget {}

class Text extends Widget {
  Text(a, {style: null});
}

class Flexible extends Widget {
  Flexible({child: null});
}

class Padding extends Widget {
  Padding({padding: null, child: null});
}

class Row extends Widget {
  Row({justifyContent: null, alignItems: null, children: null});
}

class FlexJustifyContent {
  static const start = null;
}

class FlexAlignItems {
  static const end = null;
}

class EdgeDims {
  const EdgeDims.only({right: null});
}
// Constructor Tearoffs
// https://github.com/dart-lang/language/blob/master/accepted/future-releases/constructor-tearoffs/feature-specification.md

class C<T> {
  final T x;
  const C.new(this.x); // Same as: `const C(this.x);`
  C.other(T x) : this.new(x); // Same as: `: this(x)`
  factory C.d(T x) = D<T>.new;  // same as: `= D<T>;`
}
class D<T> extends C<T> {
  const D(T x) : super.new(x); // Same as: `: super(x);`
}
void main() {
  const C.new(0); // Same as: `const C(0);`. (Inferred `T` = `int`.)
  const C<num>.new(0); // Same as: `const C<num>(0);`.
  new C.new(0); // Same as `new C(0);`.
  new C<num>.new(0); // Same as `new C<num>(0);`.
  C.new(0); // Same as `C(0);`.
  C<num>.new(0); // Same as `C<num>(0);`.
  var f1 = C.new; // New tear-off, not expressible without `.new`.
  var f2 = C<num>.new; // New tear-off, not expressible without `.new`.
}

var v1 = C.name(args);
var v2 = (C.name)(args);

var v3 = C<typeArgs>.name(args);
var v4 = (C<typeArgs>.name)(args);
var v5 = (C.name)<typeArgs>(args);

class A {
  static List<E> filled$tearoff<E>(int count, E fill) => List<E>.filled(count, fill);
}

typedef IntList = List<int>; // Non-generic alias.
typedef NumList<T extends num> = List<T>; // Generic alias.
typedef MyList<T extends dynamic> = List<T>; // Generic alias *and* "proper rename" of List.

C<typeArgs> A$name$tearoff<typeParams>(params) => C<typeArgs>.name(args);

List<int> IntList$filled$tearoff(int length, int value) =>
    List<int>.filled(length, value);

List<T> NumList$filled$tearoff<T extends num>(int length, T value) =>
    List<T>.filled(length, value);

List<T> MyList$filled$tearoff<T extends dynamic>(int length, T value) =>
    List<T>.filled(length, value);

List<int> Function(int, int) f = NumList.filled;
// equivalent for inference:   = NumLi


import nuke

def extract_channels():
    """
    Extracts all unique channel layers from selected 'Read' nodes
    and creates Shuffle nodes for each layer.
    """
    # Get selected nodes of type 'Read'
    nodes = nuke.selectedNodes(filter='Read')

    if not nodes:
        # Show message if no 'Read' nodes are selected
        nuke.message("Please select a 'Read' node/s")
        return

    for read in nodes:
        # Get all channel names in the node
        channels_list_all = read.channels()

        channels_list_each = []

        # Extract unique layer names from channels
        for each in channels_list_all:
            layer_name = each.split('.')[0]
            if not layer_name in channels_list_each:
                channels_list_each.append(layer_name)

        if not channels_list_each or not channels_list_all:
            if nuke.ask(f"{read} does not have any channels\nDo you wish to continue?"):
                continue
            else:
                break

        for each in channels_list_each:
            # Create Shuffle node for each unique layer
            shuffle = nuke.createNode('Shuffle')
            shuffle['in'].setValue(each)
            shuffle.setXpos(read.xpos() + ((channels_list_each.index(each) + 1) * 200))
            shuffle.setYpos(read.ypos() + 20)
            shuffle['label'].setValue("<b>[value in]</b>")
            shuffle['note_font_color'].setValue(int("FFFFFFFF", 16))

            # Deselect the last node in the list
            if channels_list_each[-1] == each:
                shuffle['selected'].setValue(False)

            # Connect the first Shuffle node to the Read node
            elif channels_list_each[0] == each:
                shuffle.setInput(0, read)


   s =
                      MIR_Binary.create(PPC_ADDI,
                                        I(phys.getGPR(LAST_SCRATCH_GPR)),
                                        I(phys.getGPR(LAST_SCRATCH_GPR)),
                                        IC(PPCMaskLower16(signatureId)));
                  p.insertBefore(s);
                  instructionCount += 2;
                }
              }
            }
          }
          instructionCount++;
        }
        break;
        case LABEL_opcode:
        case BBEND_opcode:
        case UNINT_BEGIN_opcode:
        case UNINT_END_opcode:
          // These generate no code, so don't count them.
          break;
        case RESOLVE_opcode: {
          Register zero = phys.getGPR(0);
          Register JTOC = phys.getJTOC();
          Register CTR = phys.getCTR();
          if (VM.VerifyAssertions) VM._assert(p.getBytecodeIndex() >= 0 && p.position() != null);
          Offset offset = Entrypoints.optResolveMethod.getOffset();
          if (fits(offset, 16)) {
            p.insertBefore(MIR_Load.create(PPC_LAddr, A(zero), A(JTOC), IC(PPCMaskLower16(offset))));
          } else {
            if (VM.VerifyAssertions) VM._assert(fits(offset, 32)); //not implemented
            p.insertBefore(MIR_Binary.create(PPC_ADDIS, A(zero), A(JTOC), IC(PPCMaskUpper16(offset))));
            p.insertBefore(MIR_Load.create(PPC_LAddr, A(zero), A(zero), IC(PPCMaskLower16(offset))));
            instructionCount += 1;
          }
          p.insertBefore(MIR_Move.create(PPC_MTSPR, A(CTR), A(zero)));
          instructionCount += 3;
          // Because the GC Map code holds a reference to the original
          // instruction, it is important that we mutate the last instruction
          // because this will be the GC point.
          MIR_Call.mutate0(p, PPC_BCTRL, null, null);
          break;
        }
        case YIELDPOINT_PROLOGUE_opcode: {
          Register TSR = phys.getTSR();
          BasicBlock yieldpoint = findOrCreateYieldpointBlock(ir, RVMThread.PROLOGUE);
          // Because the GC Map code holds a reference to the original
          // instruction, it is important that we mutate the last instruction
          // because this will be the GC point.
          MIR_CondCall.mutate0(p,
                               PPC_BCL,
                               null,
                               null,
                               I(TSR),
                               PowerPCConditionOperand.NOT_EQUAL(),
                               yieldpoint.makeJumpTarget());
          p.getBasicBlock().insertOut(yieldpoint);
          conditionalBranchCount++;
        }
        break;
        case YIELDPOINT_BACKEDGE_opcode: {
          BasicBlock yieldpoint = findOrCreateYieldpointBlock(ir, RVMThread.BACKEDGE);
          Register zero = phys.getGPR(0);
          Register TSR = phys.getTSR();
          Register TR = phys.getTR();
          Offset offset = Entrypoints.takeYieldpointField.getOffset();
          if (VM.VerifyAssertions) VM._assert(fits(offset, 16));
          p.insertBefore(MIR_Load.create(PPC_LInt, I(zero), A(TR), IC(PPCMaskLower16(offset))));
          p.insertBefore(MIR_Binary.create(PPC_CMPI, I(TSR), I(zero), IC(0)));
          instructionCount += 2;
          // Because the GC Map code holds a reference to the original
          // instruction, it is important that we mutate the last instruction
          // because this will be the GC point.
          MIR_Cond


 laserOffR = Vector.rotateAbout(this.laserPos, (targetDist - r) * laserWidth, this.position);
                    let sub = Vector.normalise(Vector.sub(laserOffR, this.position));
                    laserOffR = Vector.add(laserOffR, Vector.mult(sub, rangeWidth));
                    ctx.lineTo(laserOffR.x, laserOffR.y);

                    let laserOffL = Vector.rotateAbout(this.laserPos, (targetDist - r) * -laserWidth, this.position);
                    sub = Vector.normalise(Vector.sub(laserOffL, this.position));
                    laserOffL = Vector.add(laserOffL, Vector.mult(sub, rangeWidth));
                    ctx.lineTo(laserOffL.x, laserOffL.y);
                    ctx.fillStyle = `rgba(0,0,255,${Math.max(0, 0.6 * r / targetDist)})`
                    ctx.fill();
                }
            } else {
                this.laserPos = this.position;
            }
        }
    },
    // focuser(x, y, radius = 30 + Math.ceil(Math.random() * 10)) {
    //     radius = Math.ceil(radius * 0.7);
    //     mobs.spawn(x, y, 4, radius, "rgb(0,0,255)");
    //     let me = mob[mob.length - 1];
    //     Matter.Body.setDensity(me, 0.003); //extra dense //normal is 0.001
    //     me.restitution = 0;
    //     me.laserPos = me.position; //required for laserTracking
    //     me.repulsionRange = 1200000; //squared
    //     me.accelMag = 0.00009 * simulation.accelScale;
    //     me.frictionStatic = 0;
    //     me.friction = 0;
    //     me.onDamage = function () {
    //         this.laserPos = this.position;
    //     };
    //     spawn.shield(me, x, y);
    //     me.do = function () {
    //         this.seePlayerByLookingAt();
    //         this.checkStatus();
    //         this.attraction();
    //         const dist2 = this.distanceToPlayer2();
    //         //laser Tracking
    //         if (this.seePlayer.yes && dist2 < 4000000) {
    //             const rangeWidth = 2000; //this is sqrt of 4000000 from above if()
    //             //targeting laser will slowly move from the mob to the player's position
    //             this.laserPos = Vector.add(this.laserPos, Vector.mult(Vector.sub(player.position, this.laserPos), 0.1));
    //             let targetDist = Vector.magnitude(Vector.sub(this.laserPos, m.pos));
    //             const r = 12;
    //             ctx.beginPath();
    //             ctx.moveTo(this.position.x, this.position.y);
    //             if (targetDist < r + 16) {
    //                 targetDist = r + 10;
    //                 //charge at player
    //                 const forceMag = this.accelMag * 40 * this.mass;
    //                 const angle = Math.atan2(this.seePlayer.position.y - this.position.y, this.seePlayer.position.x - this.position.x);
    //                 this.force.x += forceMag * Math.cos(angle);
    //                 this.force.y += forceMag * Math.sin(angle);
    //             }
    //             // else {
    //             //high friction if can't lock onto player
    //             // Matter.Body.setVelocity(this, {
    //             //   x: this.velocity.x * 0.98,
    //             //   y: this.velocity.y * 0.98
    //             // });
    //             // }
    //             if (dist2 > 80000) {
    //                 const laserWidth = 0.002;
    //                 let laserOffR = Vector.rotateAbout(this.laser


](https://github.com/mkrd/DictDataBase)

` Python` `Star:168`

一个python NoSQL数据库，它使用字典，并提供线程和进程安全。

#### 2. [deepxde](https://github.com/lululxvi/deepxde)

` Python` `Star:1.6k`

用于科学机器学习和物理信息学习的库。

#### 3. [PyWeb3D](https://github.com/Bruno-Odinukweze/PyWeb3D)

` Python` `Star:64`

通过python语法了解three.js。

#### 4. [File-Injector](https://github.com/carlospuenteg/File-Injector)

` Python` `Star:397`

File-Injector是一个脚本，允许你将任何文件隐藏的存储在图像中。

#### 5. [flastapi](https://github.com/maarten-dp/flastapi)

` Python` `Star:43`

Flastapi 是一个小型flask插件，用于启用类似 Fastapi 的接口来使用 pydantic 构建 API 端点。

#### 6. [odd-platform](https://github.com/opendatadiscovery/odd-platform)

` Java` `Star:750`

ODD 是面向数据团队的开源数据发现和可观测性工具，通过现代用户友好型环境帮助有效地实现数据处理和分析。

#### 7. [java-http](https://github.com/FusionAuth/java-http)

` Java` `Star:165`

一个功能齐全、独立、高性能的 HTTP 服务器和客户端，完全用普通 Java 编写。

#### 8. [benthos](https://github.com/benthosdev/benthos)

` Go` `Star:6k`

Benthos 是一种高性能和弹性流处理器，能够以各种代理模式连接各种源和汇，并对有效载荷执行水合、富集、转换和过滤器。

#### 9. [glow](https://github.com/charmbracelet/glow)

`Go` `Star:12.1k`

Glow 是一款基于终端的降价阅读器，从头开始设计，旨在展现 CLI 的美感和功能。

#### 10. [wasi-libc](https://github.com/WebAssembly/wasi-libc)

` C` `Star:656`

WebAssembly 的 WASI libc 实现。

## 资源工具

#### 1. [awesome-cto](https://github.com/kuchin/awesome-cto)

为CTO和VP R&D提供精心策划和固执己见的资源列表，重点是面向初创公司和高速增长的公司。

#### 2. [devenv](https://devenv.sh/getting-started/)

使用 Nix 的快速、声明式、可重现和可组合的开发人员环境

####


)
	opts.SetUsername(config.Username)
	opts.SetPassword(config.Password)
	SetAutoReconnect(config, opts)
	client := mqtt.NewClient(opts)
	token := client.Connect()
	for !token.WaitTimeout(3 * time.Second) {
	}
	if err := token.Error(); err != nil {
		log.Fatal(err)
	}
	return client
}

func connectByMQTTS(config Config) mqtt.Client {
	var tlsConfig tls.Config
	if config.Tls && config.CaCert == "" {
		log.Fatalln("TLS field in config is required")
	}
	certpool := x509.NewCertPool()
	ca, err := ioutil.ReadFile(config.CaCert)
	if err != nil {
		log.Fatalln(err.Error())
	}
	certpool.AppendCertsFromPEM(ca)
	tlsConfig.RootCAs = certpool

	opts := mqtt.NewClientOptions()
	broker := fmt.Sprintf("ssl://%s:%d", config.Host, config.Port)
	println(broker)
	opts.AddBroker(broker)
	opts.SetUsername(config.Username)
	opts.SetPassword(config.Password)
	opts.SetTLSConfig(&tlsConfig)
	SetAutoReconnect(config, opts)
	client := mqtt.NewClient(opts)
	token := client.Connect()
	for !token.WaitTimeout(100 * time.Millisecond) {
	}
	if err := token.Error(); err != nil {
		log.Fatal(err)
	}
	return client
}

func connectByWS(config Config) mqtt.Client {
	opts := mqtt.NewClientOptions()
	broker := fmt.Sprintf("ws://%s:%d/mqtt", config.Host, config.Port)
	opts.AddBroker(broker)
	opts.SetUsername(config.Username)
	opts.SetPassword(config.Password)
	SetAutoReconnect(config, opts)
	client := mqtt.NewClient(opts)
	token := client.Connect()
	for !token.WaitTimeout(3 * time.Second) {
	}
	if err := token.Error(); err != nil {
		log.Fatal(err)
	}
	return client
}

func connectByWSS(config Config) mqtt.Client {
	var tlsConfig tls.Config
	if config.Tls && config.CaCert == "" {
		log.Fatalln("TLS field in config is required")
	}
	certpool := x509.NewCertPool()
	ca, err := ioutil.ReadFile(config.CaCert)
	if err != nil {
		log.Fatalln(err.Error())
	}
	certpool.AppendCertsFromPEM(ca)
	tlsConfig.RootCAs = certpool

	opts := mqtt.NewClientOptions()
	broker := fmt.Sprintf("wss://%s:%d/mqtt", config.Host, config.Port)
	opts.AddBroker(broker)
	opts.SetUsername(config.Username)
	opts.SetPassword(config.Password)
	opts.SetTLSConfig(&tlsConfig)
	SetAutoReconnect(config, opts)
	client := mqtt.NewClient(opts)
	token := client.Connect()
	for !token.WaitTimeout(3 * time.Second) {
	}
	if err := token.Error(); err != nil {
		log.Fatal(err)
	}
	return client
}
package orderedmap

import (
	"bytes"
	"errors"
	"fmt"
	"github.com/goccy/go-json"
	"iter"
	"reflect"


visit_mt(mt, self);
    }

    fn visit_field(&mut self, field: &mut Field) {
        noop_visit_field(field, self);
    }

    fn visit_where_clause(&mut self, where_clause: &mut WhereClause) {
        noop_visit_where_clause(where_clause, self);
    }

    fn visit_where_predicate(&mut self, where_predicate: &mut WherePredicate) {
        noop_visit_where_predicate(where_predicate, self);
    }

    fn visit_vis(&mut self, vis: &mut Visibility) {
        noop_visit_vis(vis, self);
    }

    fn visit_id(&mut self, _id: &mut NodeId) {
        // Do nothing.
    }

    fn visit_span(&mut self, _sp: &mut Span) {
        // Do nothing.
    }
}

/// Use a map-style function (`FnOnce(T) -> T`) to overwrite a `&mut T`. Useful
/// when using a `flat_map_*` or `filter_map_*` method within a `visit_`
/// method.
//
// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
pub fn visit_clobber<T, F>(t: &mut T, f: F) where F: FnOnce(T) -> T {
    unsafe { std::ptr::write(t, f(std::ptr::read(t))); }
}

// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
#[inline]
pub fn visit_vec<T, F>(elems: &mut Vec<T>, mut visit_elem: F) where F: FnMut(&mut T) {
    for elem in elems {
        visit_elem(elem);
    }
}

// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
#[inline]
pub fn visit_opt<T, F>(opt: &mut Option<T>, mut visit_elem: F) where F: FnMut(&mut T) {
    if let Some(elem) = opt {
        visit_elem(elem);
    }
}

// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
pub fn visit_attrs<T: MutVisitor>(attrs: &mut Vec<Attribute>, vis: &mut T) {
    visit_vec(attrs, |attr| vis.visit_attribute(attr));
}

// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
pub fn visit_thin_attrs<T: MutVisitor>(attrs: &mut ThinVec<Attribute>, vis: &mut T) {
    for attr in attrs.iter_mut() {
        vis.visit_attribute(attr);
    }
}

// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
pub fn visit_exprs<T: MutVisitor>(exprs: &mut Vec<P<Expr>>, vis: &mut T) {
    exprs.flat_map_in_place(|expr| vis.filter_map_expr(expr))
}

// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
pub fn visit_bounds<T: MutVisitor>(bounds: &mut GenericBounds, vis: &mut T) {
    visit_vec(bounds, |bound| vis.visit_param_bound(bound));
}

// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
pub fn visit_method_sig<T: MutVisitor>(MethodSig { header, decl }: &mut MethodSig, vis: &mut T) {
    vis.visit_fn_header(header);
    vis.visit_fn_decl(decl);
}

pub fn noop_visit_use_tree<T: MutVisitor>(use_tree: &mut UseTree, vis: &mut T) {
    let UseTree { prefix, kind, span } = use_tree;
    vis.visit_path(prefix);
    match kind {


t.ManagedFields = nil
				client.CreationTimestamp = metav1.Time{}
				client.Generation = 0
				client.SelfLink = "" //nolint:staticcheck  // old API servers still set this field

				require.Equal(t, tt.client, client)
				return
			}

			if tt.fixWant != nil {
				want = tt.fixWant(t, err, want)
			}

			want = groupFix.Replace(want)

			// old API servers have slightly different error messages
			if needsErrFix && !strings.Contains(want, "Duplicate value:") {
				want = errFix.Replace(want)
			}

			require.EqualError(t, err, want)
		})
	}
}

func makeErrFix(reallyOld bool) []string {
	const total = 10                  // should be enough indexes
	out := make([]string, 0, total*6) // good enough allocation

	// these servers do not show the actual index of where the error occurred
	for i := range total {
		idx := fmt.Sprintf("[%d]", i)
		out = append(out, idx+":", ":")
		out = append(out, idx+" ", " ")
	}

	if reallyOld {
		// these servers display empty values differently
		out = append(out, "0:", `"":`)

		// these servers do not show the actual invalid value
		for _, s := range []string{
			"of",
			"oob",
			"zone",
			"panda",
			"client0oauth1pinniped2dev-regex",
		} {
			out = append(out,
				fmt.Sprintf(`Invalid value: "%s"`, s),
				`Invalid value: ""`)
		}
	}

	return out
}

func TestOIDCClientControllerValidations_Parallel(t *testing.T) {
	env := testlib.IntegrationEnv(t)

	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
	t.Cleanup(cancel)

	secrets := testlib.NewKubernetesClientset(t).CoreV1().Secrets(env.SupervisorNamespace)
	oidcClients := testlib.NewSupervisorClientset(t).ConfigV1alpha1().OIDCClients(env.SupervisorNamespace)

	tests := []struct {
		name           string
		client         *supervisorconfigv1alpha1.OIDCClient
		secret         *corev1.Secret
		wantPhase      string
		wantConditions []metav1.Condition
	}{
		{
			name: "invalid AllowedGrantTypes and AllowedScopes (missing minimum required values), with no Secret",
			client: &supervisorconfigv1alpha1.OIDCClient{
				ObjectMeta: metav1.ObjectMeta{
					GenerateName: "client.oauth.pinniped.dev-",
				},
				Spec: supervisorconfigv1alpha1.OIDCClientSpec{
					AllowedRedirectURIs: []supervisorconfigv1alpha1.RedirectURI{"https://some-redirect-url.test.pinniped.dev/some/path"},
					AllowedGrantTypes:   []supervisorconfigv1alpha1.GrantType{"refresh_token"}, // needs to have authorization_code
					AllowedScopes:       []supervisorconfigv1alpha1.Scope{"username"},          // needs to have openid
				},
			},
			wantPhase: "Error",
			wantConditions: []metav1.Condition{
				{
					Type:    "AllowedGrantTypesValid",
					Status:  "False",
					Reason:  "MissingRequiredValue",
					Message: `"authorization_code" must always be included in "allowedGrantTypes"`,
				},
				{
					Type:    "AllowedScopesValid",
					Status:  "False",
					Reason:  "MissingRequiredValue",
					Message: `"openid" must always be included in "allowedScopes"; "offline_access" must be included in "allowedScopes" when "


tion notes: certificate should be valid 37273 starting
     * from 13 Nov 2008
     * If it brcomes invalidated regenerate it using following commands:
     * 1. openssl genrsa -des3 -out test.key 1024
     * 2. openssl req -new -key test.key -out test.csr
     * 3. cp test.key test.key.org
     * 4. openssl rsa -in test.key.org -out test.key
     * 5. openssl x509 -req -days 37273 -in test.csr -signkey test.key -out test.cert
     * */

        String certName = Support_Resources.getURL("test.cert");
        InputStream is = new URL(certName).openConnection().getInputStream();
        CertificateFactory cf = CertificateFactory.getInstance("X.509");

        Certificate cert = cf.generateCertificate(is);

        Cipher c = Cipher.getInstance("RSA");

        c.init(Cipher.ENCRYPT_MODE, cert, new SecureRandom());
        c = Cipher.getInstance("DES/CBC/PKCS5Padding");
        try {
            c.init(Cipher.ENCRYPT_MODE, cert, new SecureRandom());
            fail("InvalidKeyException expected");
        } catch (InvalidKeyException e) {
            //expected
        }
    }

    @TestTargets({
        @TestTargetNew(
            level = TestLevel.COMPLETE,
            notes = "",
            method = "unwrap",
            args = {byte[].class, java.lang.String.class, int.class}
        ),
        @TestTargetNew(
                level = TestLevel.COMPLETE,
                notes = "",
                clazz = CipherSpi.class,
                method = "engineUnwrap",
                args = {byte[].class, java.lang.String.class, int.class}
        )
    })
    public void test_unwrap$BLjava_lang_StringI () throws NoSuchAlgorithmException,
    NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException,
    IllegalBlockSizeException {
        SecureRandom sr = new SecureRandom();
        byte[] iv = new byte[8];
        sr.nextBytes(iv);
        AlgorithmParameterSpec ap = new IvParameterSpec(iv);

        Cipher c = Cipher.getInstance("DES/CBC/PKCS5Padding");

        c.init(Cipher.WRAP_MODE, cipherKeyDES, ap, sr);
        byte[] arDES = c.wrap(cipherKeyDES);
        byte[] ar    = c.wrap(cipherKey);

        try {
            c.unwrap(arDES, "DES", Cipher.SECRET_KEY);
            fail("IllegalStateException expected");
        } catch (IllegalStateException e) {
            //expected
        }

        c.init(Cipher.UNWRAP_MODE, cipherKeyDES, ap, sr);
        assertTrue(cipherKeyDES.equals(c.unwrap(arDES, "DES", Cipher.SECRET_KEY)));
        assertFalse(cipherKeyDES.equals(c.unwrap(ar, "DES", Cipher.SECRET_KEY)));

        try {
            c.unwrap(arDES, "RSA38", Cipher.PUBLIC_KEY);
            fail("NoSuchAlgorithmException expected");
        } catch (NoSuchAlgorithmException e) {
            //expected
        }

        c = Cipher.getInstance("DESede/CBC/PKCS5Padding");
        c.init(Cipher.UNWRAP_MODE, cipherKey, ap, sr);
        try {
            c.unwrap(arDES, "DESede", Cipher.SECRET_KEY);
            fail("InvalidKeyException expected");
        } catch (InvalidKeyException e) {
            //expected
        }
    }

    @TestTargets({
        @TestTargetNew(
            level = TestLevel.COMPLETE,
            notes = "",
            method = "update",
            args = {java.nio.ByteBuffer.class, java.nio.ByteBuffer.class}
        ),
        @TestTargetNew(
                level = TestLevel.COMPLETE,
                notes = "",
                clazz = CipherSpi.class,
                method = "engineUpdate",
                args = {java.nio.ByteBuffer.class, java.nio.ByteBuffer.class}


// Copyright 2020-2022 Andreas Atteneder
//
// 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.
//

#if UNITY_ANIMATION

using System;

namespace GLTFast.Schema {

    [Serializable]
    public class GltfAnimation : NamedObject
    {
        /// <summary>
		/// An array of channels, each of which targets an animation's sampler at a
		/// node's property. Different channels of the same animation can't have equal
		/// targets.
		/// </summary>
		public AnimationChannel[] channels;

		/// <summary>
		/// An array of samplers that combines input and output accessors with an
		/// interpolation algorithm to define a keyframe graph (but not its target).
		/// </summary>
		public AnimationSampler[] samplers;

		internal void GltfSerialize(JsonWriter writer) {
			writer.AddObject();
			GltfSerializeRoot(writer);

            if(channels != null && channels.Length > 0)
            {
                writer.AddArray("channels");
                foreach( var channel in channels) {
                    channel.GltfSerialize(writer);
                }
                writer.CloseArray();
            }

            if (samplers != null && samplers.Length > 0)
            {
                writer.AddArray("samplers");
                foreach( var sample in samplers) {
                    sample.GltfSerialize(writer);
                }
                writer.CloseArray();
            }

            writer.Close();
		}
    }

    [Serializable]
    public class AnimationChannel
    {
	    public enum Path {
		    unknown,
		    invalid,
		    translation,
		    rotation,
		    scale,
		    weights
	    }

	    /// <summary>
	    /// The index of a sampler in this animation used to compute the value for the
	    /// target, e.g., a node's translation, rotation, or scale (TRS).
	    /// </summary>
	    public int sampler;

	    /// <summary>
	    /// The index of the node and TRS property to target.
	    /// </summary>
	    public AnimationChannelTarget target;

	    internal void GltfSerialize(JsonWriter writer) {

            writer.AddObject();

            writer.AddProperty("sampler", sampler);

            writer.AddProperty("target");
            target.GltfSerialize(writer);
            // writer.Close();

            writer.Close();
	    }
    }

    [Serializable]
    public class AnimationChannelTarget {
	    /// <summary>
	    /// The index of the node to target.
	    /// </summary>
	    public int node;

	    /// <summa


      }

                        if (ServerAction.hasRegOK == action)
                        {
                            DdzRCLogic.getInstance().doorHasRegOK(session, doc, item);

                            continue;
                        }

                        if (ServerAction.hasRegKO == action)
                        {
                            DdzRCLogic.getInstance().doorHasRegKO(session, doc, item);

                            continue;
                        }

                        if (ServerAction.needProof == action)
                        {
                            DdzRCLogic.getInstance().doorNeedProof(session, doc, item);

                            continue;
                        }

                        if (ServerAction.proofOK == action)
                        {
                            DdzRCLogic.getInstance().doorProofOK(session, doc, item);

                            continue;
                        }

                        if (ServerAction.proofKO == action)
                        {
                            DdzRCLogic.getInstance().doorProofKO(session, doc, item);

                            continue;
                        }

                        if (ServerAction.loadGOK == action)
                        {
                            DdzRCLogic.getInstance().doorLoadGOK(session, doc, item);

                            continue;
                        }

                        //

                        if (ServerAction.chkEveryDayLoginAndGetOK == action)
                        {
                            DdzRCLogic.getInstance().doorChkEveryDayLoginAndGetOK(session, doc, item);

                            continue;
                        }

                    }

                    #endregion

                    //Logger.WriteStr("ЧЭ:" + action);
                    Log.WriteStr(SR.GetString(SR.Invalid_protocol_num, action));

                }//end for

                //
                DdzLogic.getInstance().TimedAutoMatchRoom();
                DdzLogic.getInstance().TimedWaitReconnection();
                DdzLogic.getInstance().TimedChkHeartBeat();

           }
           catch (Exception exd)
           {
                Log.WriteStrByException(CLASS_NAME, "msgTimedEvent", exd.Message,exd.StackTrace);
           }

        }

        /// <summary>
        ///
        /// </summary>
        public static SessionMsgQueue msgList
        {
            get { return _msgList; }
        }

        public static System.Timers.Timer msgTimer
        {
            get { return _msgTimer; }
        }

    }
}


": true`. 另外就是指定索引名称、要分配的分片id、和要将分片分配到的节点名称, 这里只指定`primary`分片, replicat分片会自动找节点存储.

```json
POST /_cluster/reroute
{
    "commands" : [
        {
            "allocate_stale_primary" : {
                "index" : "索引名",
                "shard" : 分片id, // 整型数值
                "node" : "目标主机id",
                "accept_data_loss": true
            }
        }
    ]
}
```

###

不过我还是在本地尝试了一下这个接口的使用方法. 在重新分配分片之前, 分片分布如下

![](https://gitee.com/generals-space/gitimg/raw/master/bd134e8de5cca3abee082a60f535a32b.png)

可以看到, 分片0, 1在节点`esc-data-1`上, 而分片2, 3, 4则在`esc-data-0`上.

> 只有主分片, 没有副本(之前手动改的)

我们尝试将分片2分配到`esc-data-1`节点上.

```json
POST /_cluster/reroute
{
    "commands" : [
        {
            "allocate_stale_primary" : {
                "index" : "nginx-log-2020.09.16",
                "shard" : 2,
                "node" : "esc-data-1",
                "accept_data_loss": false
            }
        }
    ]
}
```

> 由于是对完整的索引进行分片重新分配, 并不是为了修复什么问题, 所以这里将`accept_data_loss`字段置为`false`.

参考文章1提到了2个操作`allocate_stale_primary`, `allocate_empty_primary`, 但这两个其实是针对集群中存在异常的索引而做的, 我所实验的索引一切正常, 这导致在发起上面的请求时出现了如下错误

```json
{
  "error": {
    "root_cause": [
      {
        "type": "remote_transport_exception",
        "reason": "[esc-master-2][172.18.0.2:9300][cluster:admin/reroute]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "[allocate_stale_primary] primary [nginx-log-2020.09.16][2] is already assigned"
  },
  "status": 400
}
```

ta说分片2已经存在于集群中的某个节点, 不需要做这样的操作.

于是我就又找了找有没有移动切片的方法, 从参考文章2(官方文档)中找到, `reroute`接口其实有5种操作, 多出来的3个是

1. `move`: 把分片从一节点移动到另一个节点, 可以指定索引名和分片号.
2. `cancel`: 取消分配一个正在分配的分片. 可以指定索引名和分片号. node参数可以指定在那个节点取消正在分配的分片, `allow_primary`参数支持取消分配主分片.
3. `allocate_replica`: 分配一个未分配的分片到指定节点, 可以指定索引名和分片号, `node`参数指定分配到那个节点, `allow_primary`参数可以强制分配主分片, 不过这样可能导致数据丢失. (一般用来清空某个未分配分片的数据的时候才设置这个参数)

上面3个参数的说明来自参考文章3, 不过这篇文章中写到, 对于未分配的分片, 可以使用`allocate_r


� 간편결제에 대해 허브형과 다이렉트 호출을 지원합니다.

NHN KCP에서 지원하는 결제수단은 아래와 같습니다.

- 카드

- 실시간 계좌이체

- 가상계좌

- 휴대폰 소액결제

- 상품권 결제(컬쳐랜드/해피머니/도서문화상품권)

- 간편결제 (허브형/다이렉트)
  - 카카오페이
  - 네이버페이
  - 페이코
  - SSG페이
  - L페이
  - 삼성페이
  - 애플페이
  - 토스페이

이 외에도 SDK/API 빌링키 발급, 에스크로, API 가상계좌 발급, 면세 금액 지정, 상점분담무이자 등의 기능을 지원합니다.

NHN KCP 연동에 대해 자세히 알고 싶다면 [→ NHN KCP 연동가이드](https://developers.portone.io/docs/ko/v2-payment/pg/kcp-v2?v=v2) 에서 확인하실 수 있습니다.
## [0.12.1](https://github.com/portone-io/portone_flutter/tree/main)
- tierCode 결제창 호출 기능을 추가했습니다.

## [0.12.0](https://github.com/portone-io/portone_flutter/tree/v0.12.0)
- Flutter 3.28 컴파일 오류의 원인인 iamport_webview_flutter 에서 v1 android embedding 제거

## [0.11.0](https://github.com/portone-io/portone_flutter/tree/v0.11.0)
- portone_flutter 패키지로 이전

## [0.10.21](https://github.com/portone/portone_flutter/tree/v0.10.21)
- iamport_flutter discontinued 안내 추가

## [0.10.20](https://github.com/portone/portone_flutter/tree/v0.10.20)
- Flutter 3.27.0 부터 발생하는 오류를 해결했습니다.

## [0.10.19](https://github.com/portone-io/portone_flutter/tree/v0.10.19)
- 안드로이드 gradle plugin 버전을 8.4.2로 업데이트했습니다.
- uni_links를 app_links로 변경했습니다.

## [0.10.18](https://github.com/portone-io/portone_flutter/tree/v0.10.18)
- customer_id 파라


rr2str(error));
		return error;
	}
	return 0;
}

int test_transcode()
{
	AVFormatContext *input_format_context = NULL, *output_format_context = NULL;
	AVCodecContext *input_codec_context = NULL, *output_codec_context = NULL;
	SwrContext *resample_context = NULL;
	AVAudioFifo *fifo = NULL;
	int ret = AVERROR_EXIT;

	//if (argc != 3) {
	//	fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]);
	//	exit(1);
	//}

	const char *inputfile = "WAS_2019-09-05_14_19_42_109.wav";
	const char *outputfile = "transcode.aac";

	/* Open the input file for reading. */
	if (open_input_file(inputfile, &input_format_context,
		&input_codec_context))
		goto cleanup;
	/* Open the output file for writing. */
	if (open_output_file(outputfile, input_codec_context,
		&output_format_context, &output_codec_context))
		goto cleanup;
	/* Initialize the resampler to be able to convert audio sample formats. */
	if (init_resampler(input_codec_context, output_codec_context,
		&resample_context))
		goto cleanup;
	/* Initialize the FIFO buffer to store audio samples to be encoded. */
	if (init_fifo(&fifo, output_codec_context))
		goto cleanup;
	/* Write the header of the output file container. */
	if (write_output_file_header(output_format_context))
		goto cleanup;

	/* Loop as long as we have input samples to read or output samples
	* to write; abort as soon as we have neither. */
	while (1) {
		/* Use the encoder's desired frame size for processing. */
		const int output_frame_size = output_codec_context->frame_size;
		int finished = 0;

		/* Make sure that there is one frame worth of samples in the FIFO
		* buffer so that the encoder can do its work.
		* Since the decoder's and the encoder's frame size may differ, we
		* need to FIFO buffer to store as many frames worth of input samples
		* that they make up at least one frame worth of output samples. */
		while (av_audio_fifo_size(fifo) < output_frame_size) {
			/* Decode one frame worth of audio samples, convert it to the
			* output sample format and put it into the FIFO buffer. */
			if (read_decode_convert_and_store(fifo, input_format_context,
				input_codec_context,
				output_codec_context,
				resample_context, &finished))
				goto cleanup;

			/* If we are at the end of the input file, we continue
			* encoding the remaining audio samples to the output file. */
			if (finished)
				break;
		}

		/* If we have enough samples for the encoder, we encode them.
		* At the end of the file, we pass the remaining samples to
		* the encoder. */
		while (av_audio_fifo_size(fifo) >= output_frame_size ||
			(finished && av_audio_fifo_size(fifo) > 0))
			/* Take one frame worth of audio samples from the FIFO buffer,
			* encode it and write it to the output file. */
			if (load_encode_and_write(fifo, output_format_context,
				output_codec_context))
				goto cleanup;

		/* If we are at the end of the input file and have encoded
		* all remaining samples, we can exit this loop and finish. */
		if (finished) {
			int data_written;
			/* Flush the encoder as it may have delayed frames. */
			do {
				data_written = 0;
				if (encode_audio_frame(NULL, output_format_context,
					output_codec_context, &data


sage(s,{transfer:n})}:t=>{i=!0};let s=null;const o=Nn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,o,r);else if("getWorkerSource"in this.parent){const t=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,t[0],o.source)[t[1]](o,r)}else r(new Error(`Could not find function ${e.type}`));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},t.D=Ar,t.E=X,t.F=function(t,e){const i={};for(let n=0;n<e.length;n++){const r=e[n];r in t&&(i[r]=t[r])}return i},t.G=eu,t.H=iu,t.I=oc,t.J=h,t.K=d,t.L=Qc,t.M=P,t.N=Ys,t.O=uu,t.P=s,t.Q=Mr,t.R=Uo,t.S=Cs,t.T=hr,t.U=ou,t.V=class extends Lr{},t.W=lu,t.X=function(t,e){const i=window.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let e=0;e<t.length;e++){const n=window.document.createElement("source");j(t[e])||(i.crossOrigin="Anonymous"),n.src=t[e],i.appendChild(n)}return{cancel:()=>{}}},t.Y=at,t.Z=function(){var t=new Eo(16);return Eo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t._=e,t.a=M,t.a$=class extends Kr{},t.a0=function(t,e,i){var n=i[0],r=i[1],s=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.a1=Co,t.a2=function(){return _++},t.a3=ts,t.a4=Fc,t.a5=function(){ar.isLoading()||ar.isLoaded()||"deferred"!==sr()||or()},t.a6=Hi,t.a7=no,t.a8=lr,t.a9=fu,t.aA=ir,t.aB=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=K(t[i],e[t[i].ref]));return t},t.aC=function(t){if("custom"===t.type)return new $c(t);switch(t.type){case"background":return new Wc(t);case"circle":return new Bo(t);case


900\uC2DC", "IT"};
        String JST[] = new String[] {"\uc77c\ubcf8 \ud45c\uc900\uc2dc", "JST",
                                     "\uc77c\ubcf8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "JDT",
                                     "\uC77C\uBCF8 \uD45C\uC900\uC2DC", "JT"};
        String KRAT[] = new String[] {"\ud06c\ub77c\uc2a4\ub178\uc57c\ub974\uc2a4\ud06c \uc2dc\uac04", "KRAT",
                                      "\ud06c\ub77c\uc2a4\ub178\uc57c\ub974\uc2a4\ud06c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "KRAST",
                                      "\uD06C\uB77C\uC2A4\uB178\uC57C\uB974\uC2A4\uD06C \uD45C\uC900\uC2DC", "KRAT"};
        String KST[] = new String[] {"\ud55c\uad6d \ud45c\uc900\uc2dc", "KST",
                                     "\ud55c\uad6d \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "KDT",
                                     "\uB300\uD55C\uBBFC\uAD6D \uD45C\uC900\uC2DC", "KT"};
        String LORD_HOWE[] = new String[] {"\ub85c\ub4dc \ud558\uc6b0 \ud45c\uc900\uc2dc", "LHST",
                                           "\ub85c\ub4dc \ud558\uc6b0 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "LHDT",
                                           "\uB85C\uB4DC\uD558\uC6B0 \uD45C\uC900\uC2DC", "LHT"};
        String MHT[] = new String[] {"\ub9c8\uc15c\uc81c\ub3c4 \uc2dc\uac04", "MHT",
                                     "\ub9c8\uc15c\uc81c\ub3c4 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "MHST",
                                     "\uB9C8\uC15C \uC81C\uB3C4 \uD45C\uC900\uC2DC", "MHT"};
        String MMT[] = new String[] {"\ubbf8\uc580\ub9c8 \uc2dc\uac04", "MMT",
                                     "\ubbf8\uc580\ub9c8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "MMST",
                                     "\uBBF8\uC580\uB9C8 \uD45C\uC900\uC2DC", "MMT"};
        String MSK[] = new String[] {"\ubaa8\uc2a4\ud06c\ubc14 \ud45c\uc900\uc2dc", "MSK",
                                     "\ubaa8\uc2a4\ud06c\ubc14 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "MSD",
                                     "\uBAA8\uC2A4\uD06C\uBC14 \uD45C\uC900\uC2DC", "MT"};
        String MST[] = new String[] {"\uc0b0\uc9c0 \ud45c\uc900\uc2dc", "MST",
                                     "\uc0b0\uc9c0 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "MDT",


-emphasis-dark:    @emphasis-dark;

	--light:            @light;
	--dark:             @dark;

	--primary:          @primary;
	--primary-dark:     @primary-dark;
	--primary-alert:    @primary-alert;
	--primary-border:   @primary-border;

	--secondary:        @secondary;
	--secondary-dark:   @secondary-dark;
	--secondary-alert:  @secondary-alert;
	--secondary-border: @secondary-border;

	--tertiary:         @tertiary;
	--tertiary-dark:    @tertiary-dark;
	--tertiary-alert:   @tertiary-alert;
	--tertiary-border:  @tertiary-border;

	--success:          @success;
	--success-dark:     @success-dark;
	--success-alert:    @success-alert;
	--success-border:   @success-border;

	--danger:           @danger;
	--danger-dark:      @danger-dark;
	--danger-alert:     @danger-alert;
	--danger-border:    @danger-border;

	--warning:          @warning;
	--warning-dark:     @warning-dark;
	--warning-alert:    @warning-alert;
	--warning-border:   @warning-border;

	--info:             @info;
	--info-dark:        @info-dark;
	--info-alert:       @info-alert;
	--info-border:      @info-border;

	--text:             @text;
	--text-light:       @text-light;
}

/* Text color */
each(@text-colors, {
	.text-@{value} {
		color: @@value;
	}
});

/* BG color */
each(@bg-colors, {
	.bg-@{value} {
		background-color: @@value;
	}
});

html {
	background-color: @body;
}
@font-default-size: 14px;
@font-h1-size: 32px;
@font-h2-size: 24px;
@font-h3-size: 18px;
@font-h4-size: 16px;
@font-h5-size: 14px;
@font-p-size:  @font-default-size;

@font-face {
	font-family: 'NotoSans';
	src: url('/fonts/NotoSans.ttf');
	font-weight: 400;
}

:root {
	--font-size: @font-default-size;
	--font-family: NotoSans
}

html {
	font-family: var(--font-family);
	font-family: var(--font-size);
}

/* Font Weight */
each(range(100, 1000, 100), {
	.text-weight-@{value} {
		font-weight: @value
	}
});

/* Font Style */
.text-center {
	text-align: center;
}

.text-bold {
	font-weight: bold;
}

.text-italic {
	font-style: italic;
}

/* Margin */
h1 {
	margin: (@spacing * 5) 0;
	font-size: @font-h1-size;
}

h2 {
	margin: (@spacing * 3) 0;
	font-size: @font-h2-size;
}

h3 {
	margin: (@spacing * 2) 0;
	font-size: @font-h3-size;
}

h4 {
	margin: (@spacing * 2) 0;
	font-size: @font-h4-size;
}

h5 {
	margin: (@spacing * 2) 0;
	font-size: @font-h5-size;
}

p {
	margin: (@spacing * 2) 0;
	font-size: @font-p-size;
}
:root {
  font-family: Poppins, sans-serif;
  --font-family: Poppins, sans-serif;
  --surface-a: #161d21;
  --surface-b: #0e


(kline.getOpenPrice());
                }
                if (coinThumb.getHigh().compareTo(kline.getHighestPrice()) < 0) {
                    coinThumb.setHigh(kline.getHighestPrice());
                }
                if (kline.getLowestPrice().compareTo(BigDecimal.ZERO) > 0 && coinThumb.getLow().compareTo(kline.getLowestPrice()) > 0) {
                    coinThumb.setLow(kline.getLowestPrice());
                }
                if (kline.getClosePrice().compareTo(BigDecimal.ZERO) > 0) {
                    coinThumb.setClose(kline.getClosePrice());
                }
                coinThumb.setVolume(coinThumb.getVolume().add(kline.getVolume()));
                coinThumb.setTurnover(coinThumb.getTurnover().add(kline.getTurnover()));
            }
            coinThumb.setChange(coinThumb.getClose().subtract(coinThumb.getOpen()));
            if (coinThumb.getOpen().compareTo(BigDecimal.ZERO) > 0) {
                coinThumb.setChg(coinThumb.getChange().divide(coinThumb.getOpen(), 4, RoundingMode.UP));
            }
            coinThumb.setCloseStr(coinThumb.getClose().setScale(baseScale, RoundingMode.DOWN).toPlainString());
            try {
                BigDecimal cnyPrice = coinThumb.getClose().multiply(coinThumb.getBaseUsdRate()).multiply(BigDecimal.valueOf(6.8)).setScale(2, BigDecimal.ROUND_HALF_DOWN);
                coinThumb.setCnyPrice(cnyPrice == null ? "0" : cnyPrice.toPlainString());
            } catch (Exception e) {
                logger.info("初始化价格为空");
            }
        }
        prepareLines(lines, dayLines);
    }

    private void prepareLines(List<KLine> lines, List<KLine> dayLines) {
        Calendar calendar = Calendar.getInstance();
        //将秒、微秒字段置为0
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        int min = (calendar.get(Calendar.MINUTE) / 5) * 5;
        calendar.set(Calendar.MINUTE, min);
        long last5Min = calendar.getTimeInMillis();
        min = (calendar.get(Calendar.MINUTE) / 15) * 15;
        calendar.set(Calendar.MINUTE, min);
        long last15Min = calendar.getTimeInMillis();
        min = (calendar.get(Calendar.MINUTE) / 30) * 30;
        calendar.set(Calendar.MINUTE, min);
        long last30Min = calendar.getTimeInMillis();
        calendar.set(Calendar.MINUTE, 0);
        long lastHour = calendar.getTimeInMillis();
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        long lastWeek = DateUtil.getThisWeekMonday(calendar.getTime()).getTime();
        currentKLine5m = lines.stream().filter(line -> line.getTime() >= last5Min).sorted(Comparator.comparing(KLine::getTime)).reduce(currentKLine5m, (lineA, lineB) -> {
            processKLine(lineA, lineB);
            return lineA;
        });
        currentKLine15m = lines.stream().filter(line -> line.getTime() >= last15Min).sorted(Comparator.comparing(KLine::getTime)).reduce(currentKLine15m, (lineA, lineB) -> {
            processKLine(lineA, lineB);
            return lineA;
        });
        currentKLine30m = lines.stream().filter(line -> line.getTime() >= last30Min).sorted(Comparator.comparing(KLine::getTime)).reduce(currentKLine30m, (lineA, lineB) -> {
            processKLine(lineA, lineB);
            return lineA;
        });
        currentKLine1h = lines.stream().filter(line -> line.getTime() >= lastHour).sorted(Comparator.comparing(KLin


"""
====================
Parallel Betweenness
====================

Example of parallel implementation of betweenness centrality using the
multiprocessing module from Python Standard Library.

The function betweenness centrality accepts a bunch of nodes and computes
the contribution of those nodes to the betweenness centrality of the whole
network. Here we divide the network in chunks of nodes and we compute their
contribution to the betweenness centrality of the whole network.

Note: The example output below shows that the non-parallel implementation is
faster. This is a limitation of our CI/CD pipeline running on a single core.

Depending on your setup, you will likely observe a speedup.
"""
from multiprocessing import Pool
import time
import itertools

import matplotlib.pyplot as plt
import networkx as nx

def chunks(l, n):
    """Divide a list of nodes `l` in `n` chunks"""
    l_c = iter(l)
    while 1:
        x = tuple(itertools.islice(l_c, n))
        if not x:
            return
        yield x

def betweenness_centrality_parallel(G, processes=None):
    """Parallel betweenness centrality  function"""
    p = Pool(processes=processes)
    node_divisor = len(p._pool) * 4
    node_chunks = list(chunks(G.nodes(), G.order() // node_divisor))
    num_chunks = len(node_chunks)
    bt_sc = p.starmap(
        nx.betweenness_centrality_subset,
        zip(
            [G] * num_chunks,
            node_chunks,
            [list(G)] * num_chunks,
            [True] * num_chunks,
            [None] * num_chunks,
        ),
    )

    # Reduce the partial solutions
    bt_c = bt_sc[0]
    for bt in bt_sc[1:]:
        for n in bt:
            bt_c[n] += bt[n]
    return bt_c

G_ba = nx.barabasi_albert_graph(1000, 3)
G_er = nx.gnp_random_graph(1000, 0.01)
G_ws = nx.connected_watts_strogatz_graph(1000, 4, 0.1)
for G in [G_ba, G_er, G_ws]:
    print("")
    print("Computing betweenness centrality for:")
    print(nx.info(G))
    print("\tParallel version")
    start = time.time()
    bt = betweenness_centrality_parallel(G)
    print(f"\t\tTime: {(time.time() - start):.4F} seconds")
    print(f"\t\tBetweenness centrality for node 0: {bt[0]:.5f}")
    print("\tNon-Parallel version")
    start = time.time()
    bt = nx.betweenness_centrality(G)
    print(f"\t\tTime: {(time.time() - start):.4F} seconds")
    print(f"\t\tBetweenness centrality for node 0: {bt[0]:.5f}")
print("")

nx.draw(G_ba, node_size=100)
plt.show()


/*	$NetBSD: brh_start.S,v 1.1 2003/01/25 02:00:17 thorpej Exp $	*/

/*
 * Copyright (c) 2002 Wasabi Systems, Inc.
 * All rights reserved.
 *
 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed for the NetBSD Project by
 *	Wasabi Systems, Inc.
 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
 *    or promote products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <machine/asm.h>
#include <arm/armreg.h>
#include <arm/arm32/pte.h>

#include <arm/xscale/beccreg.h>

#include <evbarm/adi_brh/brhreg.h>

	.section .start,"ax",%progbits

	.global	_C_LABEL(brh_start)
_C_LABEL(brh_start):
	/*
	 * Get a pointer to the LED (physical address).
	 */
	mov	ip, #(BRH_LED_BASE)

	/*
	 * We will go ahead and disable the MMU here so that we don't
	 * have to worry about flushing caches, etc.
	 *
	 * Note that we may not currently be running VA==PA, which means
	 * we'll need to leap to the next insn after disabing the MMU.
	 */
	add	r8, pc, #(.Lunmapped - . - 8)
	bic	r8, r8, #0xff000000	/* clear upper 8 bits */
	or


erl",1585}]}.
    {call_ext,2,{extfunc,io,format,2}}.
    {bif,is_function,{f,315},[{float,3.14},{literal,{a,b,c}}],{x,0}}.
    {test,is_eq_exact,{f,315},[{x,0},{atom,true}]}.
    {jump,{f,316}}.
  {label,315}.
    {move,{atom,false},{x,0}}.
  {label,316}.
    {test,is_eq_exact,{f,566},[{x,0},{atom,false}]}.
    {move,{literal,[{is_function,3.14,[a,list]}]},{x,1}}.
    {move,{literal,"~p\n"},{x,0}}.
    {line,[{location,"unoptimized_literal_tests.erl",1595}]}.
    {call_ext,2,{extfunc,io,format,2}}.
    {bif,is_function,{f,317},[{float,3.14},{literal,[a,list]}],{x,0}}.
    {test,is_eq_exact,{f,317},[{x,0},{atom,true}]}.
    {jump,{f,318}}.
  {label,317}.
    {move,{atom,false},{x,0}}.
  {label,318}.
    {test,is_eq_exact,{f,565},[{x,0},{atom,false}]}.
    {move,{literal,[{is_function,3.14,<<1,2,3>>}]},{x,1}}.
    {move,{literal,"~p\n"},{x,0}}.
    {line,[{location,"unoptimized_literal_tests.erl",1605}]}.
    {call_ext,2,{extfunc,io,format,2}}.
    {bif,is_function,{f,319},[{float,3.14},{literal,<<1,2,3>>}],{x,0}}.
    {test,is_eq_exact,{f,319},[{x,0},{atom,true}]}.
    {jump,{f,320}}.
  {label,319}.
    {move,{atom,false},{x,0}}.
  {label,320}.
    {test,is_eq_exact,{f,564},[{x,0},{atom,false}]}.
    {move,{literal,[{is_function,3.14,<<0,21,0:1>>}]},{x,1}}.
    {move,{literal,"~p\n"},{x,0}}.
    {line,[{location,"unoptimized_literal_tests.erl",1615}]}.
    {call_ext,2,{extfunc,io,format,2}}.
    {bif,is_function,{f,321},[{float,3.14},{literal,<<0,21,0:1>>}],{x,0}}.
    {test,is_eq_exact,{f,321},[{x,0},{atom,true}]}.
    {jump,{f,322}}.
  {label,321}.
    {move,{atom,false},{x,0}}.
  {label,322}.
    {test,is_eq_exact,{f,563},[{x,0},{atom,false}]}.
    {line,[{location,"unoptimized_literal_tests.erl",1625}]}.
    {gc_bif,'-',{f,0},0,[{integer,3}],{x,0}}.
    {test_heap,6,1}.
    {put_tuple2,{x,0},{list,[{atom,is_function},{x,0},{integer,42}]}}.
    {put_list,{x,0},nil,{x,1}}.
    {move,{literal,"~p\n"},{x,0}}.
    {line,[{location,"unoptimized_literal_tests.erl",1625}]}.
    {call_ext,2,{extfunc,io,format,2}}.
    {gc_bif,'-',{f,323},0,[{integer,3}],{x,0}}.
    {bif,is_function,{f,323},[{x,0},{integer,42}],{x,0}}.
    {test,is_e


 != 0 }
func (n *Name) Addrtaken() bool             { return n.flags&nameAddrtaken != 0 }
func (n *Name) InlFormal() bool             { return n.flags&nameInlFormal != 0 }
func (n *Name) InlLocal() bool              { return n.flags&nameInlLocal != 0 }
func (n *Name) OpenDeferSlot() bool         { return n.flags&nameOpenDeferSlot != 0 }
func (n *Name) LibfuzzerExtraCounter() bool { return n.flags&nameLibfuzzerExtraCounter != 0 }

func (n *Name) SetCaptured(b bool)              { n.flags.set(nameCaptured, b) }
func (n *Name) SetReadonly(b bool)              { n.flags.set(nameReadonly, b) }
func (n *Name) SetByval(b bool)                 { n.flags.set(nameByval, b) }
func (n *Name) SetNeedzero(b bool)              { n.flags.set(nameNeedzero, b) }
func (n *Name) SetKeepalive(b bool)             { n.flags.set(nameKeepalive, b) }
func (n *Name) SetAutoTemp(b bool)              { n.flags.set(nameAutoTemp, b) }
func (n *Name) SetUsed(b bool)                  { n.flags.set(nameUsed, b) }
func (n *Name) SetIsClosureVar(b bool)          { n.flags.set(nameIsClosureVar, b) }
func (n *Name) SetIsOutputParamHeapAddr(b bool) { n.flags.set(nameIsOutputParamHeapAddr, b) }
func (n *Name) SetAssigned(b bool)              { n.flags.set(nameAssigned, b) }
func (n *Name) SetAddrtaken(b bool)             { n.flags.set(nameAddrtaken, b) }
func (n *Name) SetInlFormal(b bool)             { n.flags.set(nameInlFormal, b) }
func (n *Name) SetInlLocal(b bool)              { n.flags.set(nameInlLocal, b) }
func (n *Name) SetOpenDeferSlot(b bool)         { n.flags.set(nameOpenDeferSlot, b) }
func (n *Name) SetLibfuzzerExtraCounter(b bool) { n.flags.set(nameLibfuzzerExtraCounter, b) }

type Param struct {
	Ntype    *Node
	Heapaddr *Node // temp holding heap address of param

	// ONAME PAUTOHEAP
	Stackcopy *Node // the PPARAM/PPARAMOUT on-stack slot (moved func params only)

	// ONAME closure linkage
	// Consider:
	//
	//	func f() {
	//		x := 1 // x1
	//		func() {
	//			use(x) // x2
	//			func() {
	//				use(x) // x3
	//				--- parser is here ---
	//			}()
	//		}()
	//	}
	//
	// There is an original declaration of x and then a chain of mentions of x
	// leading into the current function. Each time x is mentioned in a new closure,
	// we create a variable representing x for use in that specific closure,
	// since the way you get to x is different in each closure.
	//
	// Let's number the specific variables as shown in the code:
	// x1 is the original x, x2 is when mentioned in the closure,
	// and x3 is when mentioned in the closure in the closure.
	//
	// We keep these linked (assume N > 1):
	//
	//   - x1.Defn = original declaration statement for x (like most variables)
	//   - x1.Innermost = current innermost closure x (in this case x3), or nil for none
	//   - x1.IsClosureVar() = false
	//
	//   - xN.Defn = x1, N > 1
	//   - xN.IsClosureVar() = true, N > 1
	//   - x2.Outer = nil
	//   - xN.Outer = x(N-1), N > 2
	//
	//
	// When we look up x in the symbol table, we always get x1.
	// Then we can use x1.Innermost (if not nil) to get the x
	// for the


 converts OCI linux seccomp rules into RuleSets that can be used by
// the seccomp package to build a seccomp program.
func convertRules(s *specs.LinuxSeccomp) ([]seccomp.RuleSet, error) {
	// NOTE: Architectures are only really relevant when calling 32bit syscalls
	// on a 64bit system. Since we don't support that in gVisor anyway, we
	// ignore Architectures and only test against the native architecture.

	ruleset := []seccomp.RuleSet{}

	for _, syscall := range s.Syscalls {
		sysRules := seccomp.NewSyscallRules()

		action, err := convertAction(syscall.Action)
		if err != nil {
			return nil, err
		}

		// Args
		rule, err := convertArgs(syscall.Args)
		if err != nil {
			return nil, err
		}

		for _, name := range syscall.Names {
			syscallNo, err := lookupSyscallNo(nativeArchAuditNo, name)
			if err != nil {
				// If there is an error looking up the syscall number, assume it is
				// not supported on this architecture and ignore it. This is, for
				// better or worse, what runc does.
				log.Warningf("OCI seccomp: ignoring syscall %q", name)
				continue
			}

			sysRules.Add(uintptr(syscallNo), rule)
		}

		ruleset = append(ruleset, seccomp.RuleSet{
			Rules:  sysRules,
			Action: action,
		})
	}

	return ruleset, nil
}

// convertArgs converts an OCI seccomp argument rule to a list of seccomp.Rule.
func convertArgs(args []specs.LinuxSeccompArg) (seccomp.SyscallRule, error) {
	argCounts := make([]uint, 6)

	for _, arg := range args {
		if arg.Index > 6 {
			return nil, fmt.Errorf("invalid index: %d", arg.Index)
		}

		argCounts[arg.Index]++
	}

	// NOTE: If multiple rules apply to the same argument (same index) the
	// action is triggered if any one of the rules matches (OR). If not, then
	// all rules much match in order to trigger the action (AND). This appears to
	// be some kind of legacy behavior of runc that nevertheless needs to be
	// supported to maintain compatibility.

	hasMultipleArgs := false
	for _, count := range argCounts {
		if count > 1 {
			hasMultipleArgs = true
			break
		}
	}

	if hasMultipleArgs {
		rules := seccomp.Or{}

		// Old runc behavior - do this for compatibility.
		// Add rules as ORs by adding separate Rules.
		for _, arg := range args {
			rule := seccomp.PerArg{nil, nil, nil, nil, nil, nil}

			if err := convertRule(arg, &rule); err != nil {
				return nil, err
			}

			rules = append(rules, rule)
		}

		return rules, nil
	}

	// Add rules as ANDs by adding to the same Rule.
	rule := seccomp.PerArg{nil, nil, nil, nil, nil, nil}
	for _, arg := range args {
		if err := convertRule(arg, &rule); err != nil {
			return nil, err
		}
	}

	return rule, nil
}

// convertRule converts and adds the arg to a PerArg rule.
func convertRule(arg specs.LinuxSeccompArg, perArg *seccomp.PerArg) error {
	switch arg.Op {
	case specs.OpEqualTo:
		perArg[arg.Index] = seccomp.EqualTo(arg.Value)
	case specs.OpNotEqual:
		perArg[arg.Index] = seccomp.NotEqual(arg.Value)
	case specs.OpGreaterThan:
		perArg[arg.Index] = seccomp.Greater


Coord (0, 0, 0)));
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (1, 0, 0)));
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (1, 1, 0)));
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (0, 1, 0)));
		body.AddLine (new JSM.BodyLine (0, 1));
		body.AddLine (new JSM.BodyLine (1, 2));
		body.AddLine (new JSM.BodyLine (2, 3));
		body.AddLine (new JSM.BodyLine (3, 0));
		RenderBody (viewer, body, null, renderFinished);
	}, 'references/renderer/lines_default_material.png');

	canvasTester.AddTest (rendererSuite, function (renderFinished) {
		var body = new JSM.Body ();
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (0, 0, 0)));
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (1, 0, 0)));
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (1, 1, 0)));
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (0, 1, 0)));
		body.AddLine (new JSM.BodyLine (0, 1));
		body.AddLine (new JSM.BodyLine (1, 2));
		body.AddLine (new JSM.BodyLine (2, 3));
		body.AddLine (new JSM.BodyLine (3, 0));
		var materials = new JSM.MaterialSet ();
		materials.AddMaterial (new JSM.Material ({ambient : 0xcc0000, diffuse : 0xcc0000}));
		materials.AddMaterial (new JSM.Material ({ambient : 0x00cc00, diffuse : 0x00cc00}));
		body.SetLinesMaterialIndex (0);
		RenderBody (viewer, body, materials, renderFinished);
	}, 'references/renderer/lines_same_material.png');

	canvasTester.AddTest (rendererSuite, function (renderFinished) {
		var body = new JSM.Body ();
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (0, 0, 0)));
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (1, 0, 0)));
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (1, 1, 0)));
		body.AddVertex (new JSM.BodyVertex (new JSM.Coord (0, 1, 0)));
		body.AddLine (new JSM.BodyLine (0, 1));
		body.AddLine (new JSM.BodyLine (1, 2));
		body.AddLine (new JSM.BodyLine (2, 3));
		body.AddLine (new JSM.BodyLine (3, 0));
		var materials = new JSM.MaterialSet ();
		materials.AddMaterial (new JSM.Material ({ambient : 0xcc0000, diffuse : 0xcc0000}));
		materials.AddMaterial (new JSM.Material ({ambient : 0x0000cc, diffuse : 0x0000cc}));
		body.GetLine (0).SetMaterialIndex (0);
		body.GetLine (2).SetMaterialIndex (1);
		RenderBody (viewer, body, materials, renderFinished);
	}, 'references/renderer/lines_multiple_materials.png');

	canvasTester.AddTest (rendererSuite, function (renderFinished) {
		var body = new JSM.Body ();
		var i, beg, end, line;
		for (i = 0; i < 6; i++) {
			beg = body.AddVertex (new JSM.BodyVertex (new JSM.Coord (0, i * 0.5, 0)));
			end = body.AddVertex (new JSM.BodyVertex (new JSM.Coord (1, i * 0.5, 0)));
			line = new JSM.BodyLine (beg, end);
			line.SetMaterialIndex (i);
			body.AddLine (line);
		}
		var