_base_ = [
    '../_base_/models/deeplabv3plus_r50-d8.py', '../_base_/datasets/mmseg_yreb.py',
    '../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
]
crop_size = (256, 256)
data_preprocessor = dict(
    size=crop_size,
    seg_pad_val=255.,
    mean = [1368.611, 1159.376, 1066.220, 1000.479, 1233.831,
            1868.624, 2124.804, 2111.797, 2322.861, 1078.598, 1715.745, 1081.012,
            -1487.655, -803.544],
    std = [491.791, 544.063, 557.462, 675.875, 660.595,
           602.205, 635.313, 645.017, 678.677, 557.957, 665.963, 528.291,
           430.152, 362.631],
    bgr_to_rgb = False,
)
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/segformer/mit_b0_20220624-7e0fe6dd.pth'  # noqa

model = dict(
    data_preprocessor=data_preprocessor,
    backbone=dict(
        in_channels=14
    ),
    decode_head=dict(
        num_classes=10,
        loss_decode=dict(type='CrossEntropyLoss')
    ),
    auxiliary_head=dict(
        num_classes=10,
        loss_decode=dict(type='CrossEntropyLoss')
    )
)

optim_wrapper = dict(
    _delete_=True,
    type='OptimWrapper',
    optimizer=dict(
        type='AdamW', lr=0.00006, betas=(0.9, 0.999), weight_decay=0.01),
    paramwise_cfg=dict(
        custom_keys={
            'pos_block': dict(decay_mult=0.),
            'norm': dict(decay_mult=0.),
            'head': dict(lr_mult=10.)
        }))

param_scheduler = [
    dict(
        type='LinearLR', start_factor=1e-6, by_epoch=False, begin=0, end=1500),
    dict(
        type='PolyLR',
        eta_min=0.0,
        power=1.0,
        begin=1500,
        end=80000,
        by_epoch=False,
    )
]

# train_dataloader = dict(batch_size=4, num_workers=4)
# val_dataloader = dict(batch_size=1, num_workers=4)
# test_dataloader = dict(batch_size=1, num_workers=4)

train_cfg = dict(type='IterBasedTrainLoop', max_iters=80000, val_interval=50)
default_hooks = dict(
    checkpoint=dict(by_epoch=False, interval=8000, max_keep_ckpts=2,
                    save_last=True, save_best=['mIoU'], type='CheckpointHook'))


art     memlog.Offset // log start
			segSize   int
			records   [][]byte
			offset    memlog.Offset // read offset
			batchSize int
		}{
			{
				name:      "log starts at 0, write 30 records, no purge, batch size 10",
				start:     0,
				segSize:   30,
				records:   memlog.NewTestDataSlice(t, 30),
				offset:    0,
				batchSize: 10,
			},
			{
				name:      "log starts at 0, write 10 records, no purge, read from 9, batch size 5",
				start:     0,
				segSize:   30,
				records:   memlog.NewTestDataSlice(t, 10),
				offset:    9,
				batchSize: 5,
			},
			{
				name:      "log starts at 0, write 30 records, no purge, read from 10, batch size 5",
				start:     0,
				segSize:   30,
				records:   memlog.NewTestDataSlice(t, 30),
				offset:    10,
				batchSize: 5,
			},
			{
				name:      "log starts at 10, write 40 records, no purge, read from 20, batch size 1",
				start:     10,
				segSize:   40,
				records:   memlog.NewTestDataSlice(t, 40),
				offset:    20,
				batchSize: 1,
			},
			{
				name:      "log starts at 0, write 30 records, with purge, read from 10, batch size 5",
				start:     0,
				segSize:   10,
				records:   memlog.NewTestDataSlice(t, 30),
				offset:    10,
				batchSize: 5,
			},
		}

		for _, tc := range testCases {
			t.Run(tc.name, func(t *testing.T) {
				ctx := context.Background()

				opts := []memlog.Option{
					memlog.WithClock(clock.NewMock()),
					memlog.WithStartOffset(tc.start),
					memlog.WithMaxSegmentSize(tc.segSize),
				}

				l, err := memlog.New(ctx, opts...)
				assert.NilError(t, err)

				for _, d := range tc.records {
					_, err = l.Write(ctx, d)
					assert.NilError(t, err)
				}

				records := make([]memlog.Record, tc.batchSize)

				var (
					count  int
					total  int
					offset = tc.offset
				)
				for err == nil {
					count, err = l.ReadBatch(ctx, offset, records)
					total += count
					offset += memlog.Offset(count)
				}

				assert.Assert(t, errors.Is(err, memlog.ErrFutureOffset))
				switch {
				// with purge
				case len(tc.records) > tc.segSize:
					assert.Equal(t, total, len(tc.records)-(2*tc.segSize)+int(tc.offset))
				// 	no purge
				default:
					assert.Equal(t, total, len(tc.records)-int(tc.offset-tc.start))
				}
			})
		}
	})
}

func TestLog_Checkpoint_Resume(t *testing.T) {
	const (
		sourceDataCount = 50
		start           = memlog.Offset(0)
		segSize         = 20
	)

	var (
		log *memlog.Log

		ctx        = context.Background()
		sourceData = memlog.NewTestDataSlice(t, sourceDataCount)
		checkpoint memlog.Offset
		records    []memlog.Record
	)

	t.Run("create log", func(t *testing.T) {
		opts := []memlog.Option{
			memlog.WithClock(clock.NewMock()),
			memlog.WithStartOffset(start),
			memlog.WithMaxSegmentSize(segSize),
		}

		l, err := memlog.New(ctx, opts...)
		assert.NilError(t, err)
		log = l


thod {
    type Error = InvalidMethod;

    #[inline]
    fn try_from(t: &'a [u8]) -> Result<Self, Self::Error> {
        Method::from_bytes(t)
    }
}

impl<'a> TryFrom<&'a str> for Method {
    type Error = InvalidMethod;

    #[inline]
    fn try_from(t: &'a str) -> Result<Self, Self::Error> {
        TryFrom::try_from(t.as_bytes())
    }
}

impl FromStr for Method {
    type Err = InvalidMethod;

    #[inline]
    fn from_str(t: &str) -> Result<Self, Self::Err> {
        TryFrom::try_from(t)
    }
}

impl InvalidMethod {
    fn new() -> InvalidMethod {
        InvalidMethod { _priv: () }
    }
}

impl fmt::Debug for InvalidMethod {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.debug_struct("InvalidMethod")
            // skip _priv noise
            .finish()
    }
}

impl fmt::Display for InvalidMethod {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.write_str("invalid HTTP method")
    }
}

impl Error for InvalidMethod {}

mod extension {
    use super::InvalidMethod;
    use std::str;

    #[derive(Clone, PartialEq, Eq, Hash)]
    // Invariant: the first self.1 bytes of self.0 are valid UTF-8.
    pub struct InlineExtension([u8; InlineExtension::MAX], u8);

    #[derive(Clone, PartialEq, Eq, Hash)]
    // Invariant: self.0 contains valid UTF-8.
    pub struct AllocatedExtension(Box<[u8]>);

    impl InlineExtension {
        // Method::from_bytes() assumes this is at least 7
        pub const MAX: usize = 15;

        pub fn new(src: &[u8]) -> Result<InlineExtension, InvalidMethod> {
            let mut data: [u8; InlineExtension::MAX] = Default::default();

            write_checked(src, &mut data)?;

            // Invariant: write_checked ensures that the first src.len() bytes
            // of data are valid UTF-8.
            Ok(InlineExtension(data, src.len() as u8))
        }

        pub fn as_str(&self) -> &str {
            let InlineExtension(ref data, len) = self;
            // Safety: the invariant of InlineExtension ensures that the first
            // len bytes of data contain valid UTF-8.
            unsafe {str::from_utf8_unchecked(&data[..*len as usize])}
        }
    }

    impl AllocatedExtension {
        pub fn new(src: &[u8]) -> Result<AllocatedExtension, InvalidMethod> {
            let mut data: Vec<u8> = vec![0; src.len()];

            write_checked(src, &mut data)?;

            // Invariant: data is exactly src.len() long and write_checked
            // ensures that the first src.len() bytes of data are valid UTF-8.
            Ok(AllocatedExtension(data.into_boxed_slice()))
        }

        pub fn as_str(&self) -> &str {
            // Safety: the invariant of AllocatedExtension ensures that self.0
            // contains valid UTF-8.
            unsafe {str::from_utf8_unchecked(&self.0)}
        }
    }

    // From the HTTP spec section 5.1.1, the HTTP method is case-sensitive and can
    // contain the following characters:
    //
    // ```
    // method = token
    // token = 1*tchar
    // tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
    //     "


t> {
  insertLogs: (driver_id: number, timezone: number, autoDispatch: boolean) => Promise<void>;
}

const DriverAutoDispatchLogsSchema = new mongoose.Schema(
  {
    driver_id: { type: Number, required: true, unique: true },
    auto_dispatch_logs: { type: Array, required: true, default: [] },
    timezone: { type: Number, required: false, default: 0 },
  },
  {
    usePushEach: true,
    collection: 'driver_auto_dispatch_logs',
    timestamps: {
      updatedAt: 'updated_at',
      createdAt: false,
    },
  }
);

DriverAutoDispatchLogsSchema.statics.insertLogs = async (
  driver_id: number,
  timezone: number,
  auto_dispatch: boolean
) => {
  const prevData = await DriverAutoDispatchLogs.findOne({ driver_id });
  if (!prevData) {
    await DriverAutoDispatchLogs.findOneAndUpdate(
      { driver_id },
      {
        $push: {
          auto_dispatch_logs: {
            auto_dispatch,
            timestamp: new Date().getTime(),
          },
        },
        timezone,
      },
      { upsert: true }
    );
  } else {
    const prevLogs = prevData.auto_dispatch_logs;
    const lastData = prevLogs[prevLogs.length - 1];

    if (lastData.auto_dispatch !== auto_dispatch) {
      // 이전 데이터와 다를 경우에만 insert
      await DriverAutoDispatchLogs.findOneAndUpdate(
        { driver_id },
        {
          $push: {
            auto_dispatch_logs: {
              auto_dispatch,
              timestamp: new Date().getTime(),
            },
          },
          timezone,
        },
        { upsert: true }
      );
    }
  }
};

const DriverAutoDispatchLogs = mongoose.model<DriverAutoDispatchLogsDocument, DriverAutoDispatchLogsModel>(
  'DriverAutoDispatchLog',
  DriverAutoDispatchLogsSchema
);

export default DriverAutoDispatchLogs;
import { Spec } from '@hayspec/spec';
import { stripAnsi } from '../../src';

const spec = new Spec();

spec.test('passes through on invalid parameters', (ctx) => {
  ctx.deepEqual(stripAnsi(null), null);
  ctx.deepEqual(stripAnsi(undefined), undefined);
});

spec.test('removes ANSI characters from a string', (ctx) => {
  ctx.is(
    stripAnsi('This is \u001b[32ma long'),
    'This is a long',
  );
});

export default spec;
import Promise = require("bluebird");
var bcrypt = require("bcrypt-nodejs");
export = compareHash;

function compareHash(unhashed: string, hashedString: string): Promise<boolean> {
    var promise = new Promise<boolean>((resolve, reject) => {
        bcrypt.compare(unhashed, hashedString, (err, isCorrect: boolean) => {
            if (err) return reject("[COMPARE] " + err);
            resolve(Promise.resolve(isCorrect));
        });
    });

    return promise;
}
export const ERROR_CODE = {
  // If an error occurs in the API Server.
  INTERNAL_ERROR: 1,

  // If you call an API that is not available in your licence.
  LICENCE_ERROR: 2,

  // If space licence has expired.
  LICENCE_EXPIRED_ERROR: 3,

  // If you access from an IP Address that is not allowed.
  ACCESS_DENIED_ERROR: 4,

  // If your operation is denied.
  UNAUTHORIZED_OPERATION_ERROR: 5,

  // If you access a resource that does not exist.
  NO_RESOURCE_ERROR: 6,

  // If you post a request with invalid parameters.
  INVALID_REQUEST_ERROR: 7,

  // If it exceeds the capacity of your space.
  SPACE_OVER_CAPACITY_ERROR: 8,

  // If you call an API to add a resource when it exceeds a limit provided in the resource.
  RESOURCE


 39, 1),
    ]);
  }

  test_extensionMethod() async {
    var a = newFile('$testPackageLibPath/a.dart', r'''
import 'package:meta/meta.dart';

extension A on int {
  @doNotSubmit
  void a() {}
}
''');

    var b = newFile('$testPackageLibPath/b.dart', r'''
import 'a.dart';

void b() {
  0.a();
}
''');

    await assertErrorsInFile2(a, []);
    await assertErrorsInFile2(b, [
      error(WarningCode.invalidUseOfDoNotSubmitMember, 33, 1),
    ]);
  }

  test_extensionSetter() async {
    var a = newFile('$testPackageLibPath/a.dart', r'''
import 'package:meta/meta.dart';

extension A on int {
  @doNotSubmit
  set a(int value) {}
}
''');

    var b = newFile('$testPackageLibPath/b.dart', r'''
import 'a.dart';

void b() {
  0.a = 0;
}
''');

    await assertErrorsInFile2(a, []);
    await assertErrorsInFile2(b, [
      error(WarningCode.invalidUseOfDoNotSubmitMember, 33, 1),
    ]);
  }

  test_function() async {
    var a = newFile('$testPackageLibPath/a.dart', r'''
import 'package:meta/meta.dart';

@doNotSubmit
void a() {}
''');

    var b = newFile('$testPackageLibPath/b.dart', r'''
import 'a.dart';

void b() => a();
''');

    await assertErrorsInFile2(a, []);
    await assertErrorsInFile2(b, [
      error(WarningCode.invalidUseOfDoNotSubmitMember, 30, 1),
    ]);
  }

  test_getter() async {
    var a = newFile('$testPackageLibPath/a.dart', r'''
import 'package:meta/meta.dart';

class A {
  @doNotSubmit
  int get a => 0;
}
''');

    var b = newFile('$testPackageLibPath/b.dart', r'''
import 'a.dart';

void b() {
  var a = A();
  print(a.a);
}
''');

    await assertErrorsInFile2(a, []);
    await assertErrorsInFile2(b, [
      error(WarningCode.invalidUseOfDoNotSubmitMember, 54, 1),
    ]);
  }

  test_invalidTargetOfClass() async {
    var a = newFile('$testPackageLibPath/a.dart', r'''
import 'package:meta/meta.dart';

@doNotSubmit
class A {}
''');

    var b = newFile('$testPackageLibPath/b.dart', r'''
import 'a.dart';

void b() {
  A();
}
''');

    await assertErrorsInFile2(a, [
      error(WarningCode.invalidAnnotationTarget, 35, 11),
    ]);
    await assertErrorsInFile2(b, []);
  }

  test_method() async {
    var a = newFile('$testPackageLibPath/a.dart', r'''
import 'package:meta/meta.dart';

class A {
  @doNotSubmit
  void a() {}
}
''');

    var b = newFile('$testPackageLibPath/b.dart', r'''
import 'a.dart';

void b() {
  var a = A();
  a.a();
}
''');

    await assertErrorsInFile2(a, []);
    await assertErrorsInFile2(b, [
      error(WarningCode.invalidUseOfDoNotSubmitMember, 48, 1),
    ]);
  }

  test_namedParameter() async {
    var a = newFile('$testPackageLibPath/a.d


ipt/issues/239)) ([7c87f24](https://github.com/anthropics/anthropic-sdk-typescript/commit/7c87f242d921adfbd2bb21ed5f2c37ada2043f95))

## 0.11.0 (2023-12-19)

Full Changelog: [v0.10.2...v0.11.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/v0.10.2...v0.11.0)

### Features

* **api:** add messages endpoint with streaming helpers ([#235](https://github.com/anthropics/anthropic-sdk-typescript/issues/235)) ([12b914f](https://github.com/anthropics/anthropic-sdk-typescript/commit/12b914f46f4aa625ff141ec0b6631400d0994f76))
* **client:** support reading the base url from an env variable ([#223](https://github.com/anthropics/anthropic-sdk-typescript/issues/223)) ([5bc3600](https://github.com/anthropics/anthropic-sdk-typescript/commit/5bc3600a487e7ed49d944aaf36a43e0d895e907b))

### Chores

* **ci:** run release workflow once per day ([#232](https://github.com/anthropics/anthropic-sdk-typescript/issues/232)) ([115479f](https://github.com/anthropics/anthropic-sdk-typescript/commit/115479f403838a6d2c81587220029b68a4371c02))
* **deps:** update dependency ts-jest to v29.1.1 ([#233](https://github.com/anthropics/anthropic-sdk-typescript/issues/233)) ([bec6ab1](https://github.com/anthropics/anthropic-sdk-typescript/commit/bec6ab127d9b20071ab673e8e37087a879467b74))
* **deps:** update jest ([#234](https://github.com/anthropics/anthropic-sdk-typescript/issues/234)) ([5506174](https://github.com/anthropics/anthropic-sdk-typescript/commit/5506174092d5248354f3d288c84da5ba4749375c))
* update dependencies ([#231](https://github.com/anthropics/anthropic-sdk-typescript/issues/231)) ([4e34536](https://github.com/anthropics/anthropic-sdk-typescript/commit/4e345362c9002528fb0d95ca739fb8211ab3aec8))
* update prettier ([#230](https://github.com/anthropics/anthropic-sdk-typescript/issues/230)) ([173603e](https://github.com/anthropics/anthropic-sdk-typescript/commit/173603e14fc5fe87c056553ecec3278059fe58d9))

### Documentation

* update examples to show claude-2.1 ([#227](https://github.com/anthropics/anthropic-sdk-typescript/issues/227)) ([4b00d84](https://github.com/anthropics/anthropic-sdk-typescript/commit/4b00d84aee56090b5d576fdff9c3a07386475c72))

### Build System

* specify `packageManager: yarn` ([#229](https://github.com/anthropics/anthropic-sdk-typescript/issues/229)) ([d31dae4](https://github.com/anthropics/anthropic-sdk-typescript/commit/d31dae455d750a61ae3b9a751ab73309b0f87417))

## 0.10.2 (2023-11-28)

Full Changelog: [v0.10.1...v0.10.2](https://github.com/anthropics/anthropic-sdk-typescript/compare/v0.10.1...v0.10.2)

## 0.10.1 (2023-


      winrt::event_token m_settingsToken{};
        winrt::event_token m_favoritedChangedToken{};
        winrt::event_token m_displayModeChangedToken{};
        winrt::event_token m_pinnedChangedToken{};
        winrt::event_token m_opacityChangedToken{};
        winrt::event_token m_themeChangedToken{};
        winrt::event_token m_visibleChangedToken{};
        winrt::event_token m_windowStateChangedToken{};
        winrt::event_token m_targetChangedToken{};
        winrt::event_token m_targetSettingChangedToken{};
        winrt::event_token m_notificationSettingChangedToken{};
        winrt::event_token m_windowBoundsChangedToken{};
        winrt::event_token m_hotkeySetChangedToken{};
        winrt::event_token m_compactModeEnabledChangedToken{};
    };
}

namespace winrt::WidgetAdvSample::factory_implementation
{
    struct Widget1 : Widget1T<Widget1, implementation::Widget1>
    {
    };
}


(&white), 13.41, epsilon = 0.01);
        assert_relative_eq!(c1.get_contrast_ratio(&black), 1.56, epsilon = 0.01);

        assert!(c1.has_min_contrast_text(&white));
        assert!(c1.has_min_contrast_large_text(&white));
        assert!(c1.has_enhanced_contrast_text(&white));
        assert!(c1.has_enhanced_contrast_large_text(&white));
        assert!(c1.has_min_contrast_graphics(&white));
        assert!(c1.has_min_contrast_text(&black) == false);
        assert!(c1.has_min_contrast_large_text(&black) == false);
        assert!(c1.has_enhanced_contrast_text(&black) == false);
        assert!(c1.has_enhanced_contrast_large_text(&black) == false);
        assert!(c1.has_min_contrast_graphics(&black) == false);

        let c1 = Srgb::from_str("#066").unwrap().into_format();

        assert_relative_eq!(c1.get_contrast_ratio(&white), 6.79, epsilon = 0.01);
        assert_relative_eq!(c1.get_contrast_ratio(&black), 3.09, epsilon = 0.01);

        let c1 = Srgb::from_str("#9f9").unwrap().into_format();

        assert_relative_eq!(c1.get_contrast_ratio(&white), 1.22, epsilon = 0.01);
        assert_relative_eq!(c1.get_contrast_ratio(&black), 17.11, epsilon = 0.01);
    }
}
//! Test.
//! テスト。
//!
//! `cargo run --example inline_table`

extern crate tomboy_toml_dom;

// use tomboy_toml_dom::Toml;

fn main() {
    // Read a Toml file.
    // let doc = Toml::from_file("./resource/inline-table.toml");

    // TODO
    /*
    assert_eq!(
        &format!("{:?}", doc.get_val_by_key("inline_table_3")),
        "{ name = \"b\", weight = 93.5 }"
    );
    */
}
// ERROR RESULTS FROM:

fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
    if x > y { x } else { y }
}

fn main() { }
<filename>src/err.rs
//! Errors
//
// Copyright 2020 <NAME> <<EMAIL>>
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use, copy,
// modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
use std::error::Error;
use std::fmt;

#[derive(PartialEq, Eq)]
pub enum BusError {
    Access,
    Alignment,
    ReadOnly,
}

impl fmt::Debug for BusError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {


lor: gold;
            }
        }

        .o_dashboard_graph {
            margin-bottom: -$o-horizontal-padding/2;
        }

        .o_field_widget.o_field_kanban_vat_activity {
            display: block;
        }
    }

    &.o_kanban_ungrouped {
        .o_kanban_record {
            width: 450px;
        }
    }

    .o_kanban_group {
        &:not(.o_column_folded) {
            --KanbanGroup-width: 500px;
        }
    }
}

// Style for the widget "dashboard_graph"
.o_dashboard_graph {
    position: relative;
    margin: 16px -16px;

    canvas {
        height: 75px;
    }

}

.o_sample_data .o_dashboard_graph.o_graph_linechart > svg g.nv-linesWrap g.nv-group.nv-series-0 {
    fill: gray !important;
    opacity: 0.1;
}

////////// COLOR SYSTEM //////////

$blue:              #5E50F9;
$indigo:            #6610f2;
$purple:            #6a008a;
$pink:              #E91E63;
$red:               #f96868;
$orange:            #f2a654;
$yellow:            #f6e84e;
$green:             #46c35f;
$teal:              #58d8a3;
$cyan:              #57c7d4;
$black:             #000;
$white:             #ffffff;
$white-smoke:       #f2f7f8;
$violet:            #41478a;
$darkslategray :    #2e383e;
$dodger-blue :      #3498db;

$colors: (
  blue:             $blue,
  indigo:           $indigo,
  purple:           $purple,
  pink:             $pink,
  red:              $red,
  orange:           $orange,
  yellow:           $yellow,
  green:            $green,
  teal:             $teal,
  cyan:             $cyan,
  white:            $white,
  gray:             #434a54,
  gray-light:       #aab2bd,
  gray-lighter:     #e8eff4,
  gray-lightest:    #e6e9ed,
  gray-dark:        #0f1531,
  black:            #000000
);

$theme-colors: (
  primary: #1F3BB3,
  secondary: #F1F1F1,
  success:#34B1AA,
  info: #52CDFF,
  warning: #ffaf00,
  danger: #F95F53,
  light: #fbfbfb,
  dark: #1E283D
);

$primary: #1F3BB3;
$secondary: #F1F1F1;
$success:#34B1AA;
$info: #52CDFF;
$warning: #ffaf00;
$danger: #F95F53;
$light: #fbfbfb;
$dark: #1E283D;
$gray:             #434a54;
$gray-light:       #aab2bd;
$gray-lighter:     #e8eff4;
$gray-lightest:    #e6e9ed;
$gray-dark:        #0f1531;
$black:            #000000;
$twitter: #2caae1;
$facebook: #3b579d;
$google: #dc4a38;
$linkedin: #0177b5;
$pinterest: #cc2127;
$youtube: #e52d27;
$github: #333333;
$behance: #1769ff;
$dribbble: #ea4c89;
$reddit: #ff4500;

$theme-gradient-colors: (
  primary:         linear-gradient(230deg, #759bff, #843cf6),
  secondary:       linear-gradient(to right, #e7ebf0, #868e


 deletions...
	for k, ep := range s2.Endpoints {
		if reflect.DeepEqual(s1.Endpoints[k], ep) {
			// No change
			log.Infof("TEST HARNESS: Skip updating unchanged endpoint/set %v", k)
			continue
		}
		k := k
		ep := ep
		ops = append(ops, func() {
			log.Infof("TEST HARNESS: Updating endpoint/set %v", k)
			idx.UpdateEndpointOrSet(k, uniquelabels.Make(ep.Labels), ep.CIDRs(), ep.Ports, ep.Parents)
		})
	}
	for k := range s1.Endpoints {
		if _, ok := s2.Endpoints[k]; ok {
			continue
		}
		k := k
		ops = append(ops, func() {
			log.Infof("TEST HARNESS: Deleting endpoint/set %v", k)
			idx.DeleteEndpoint(k)
		})
	}

	// Parent updates and deletions...
	dupeDone := false
	for k, p := range s2.Parents {
		if reflect.DeepEqual(s1.Parents[k], p) {
			// No change
			continue
		}
		k := k
		p := p
		ops = append(ops, func() {
			log.Infof("TEST HARNESS: Updating parent labels %v -> %v", k, p.Labels)
			idx.UpdateParentLabels(k, p.Labels)
		})
		if !dupeDone {
			ops = append(ops, func() {
				log.Infof("TEST HARNESS: Updating parent labels (dupe) %v -> %v", k, p.Labels)
				idx.UpdateParentLabels(k, p.Labels)
			})
			dupeDone = true
		}
	}
	for k := range s1.Parents {
		if _, ok := s2.Parents[k]; ok {
			continue
		}
		k := k
		ops = append(ops, func() {
			log.Infof("TEST HARNESS: Delete parent labels %v", k)
			idx.DeleteParentLabels(k)
		})
	}

	// IP set updates and deletions...
	dupeDone = false
	for k, s := range s2.IPSets {
		if reflect.DeepEqual(s1.IPSets[k], s) {
			// No change
			continue
		}
		k := k
		s := s
		ipSetID := "s:" + k
		ops = append(ops, func() {
			log.Infof("TEST HARNESS: Update IP set %v -> %s", k, s.Selector)
			idx.UpdateIPSet(ipSetID, s.ParsedSelector(), s.Protocol, s.Port)
		})
		if !dupeDone {
			// For coverage of "unchanged IP set" case.
			ops = append(ops, func() {
				log.Infof("TEST HARNESS: Update IP set (dupe) %v -> %s", k, s.Selector)
				idx.UpdateIPSet(ipSetID, s.ParsedSelector(), s.Protocol, s.Port)
			})
			dupeDone = true
		}
	}
	dupeDone = false
	for k := range s1.IPSets {
		if _, ok := s2.IPSets[k]; ok {
			continue
		}
		k := k
		ipSetID := "s:" + k
		ops = append(ops, func() {
			log.Infof("TEST HARNESS: Delete IP set %v", ipSetID)
			idx.DeleteIPSet(ipSetID)
		})
		if !dupeDone {
			ops = append(ops, func() {
				log.Infof("TEST HARNESS: Delete IP set (dupe) %v", ipSetID)
				idx.DeleteIPSet(ipSetID)
			})
			dupeDone = true
		}
	}

	// Apply the updates.
	if strategy == "reverse" {
		for i := len(ops) - 1; i >= 0; i-- {


other workers.

  // Accumulate the values produced by the other workers along with worker 0
  // result to reduce and provide all but the last histogram entry
  ld32step $a0, $base, $mscratch+=, $histStride

  RPT_ALIGNED_TO 2b 4
1:
  {ld32step $a0, $base, $mscratch+=, $histStride
   f32add $acc1, $acc1, $a0}
2:
  f32add $acc1, $acc1, $a0
  st32step $acc1, $base, $histPtr+=,1
  brnzdec $limCount, limit_loop_w0\@

  bri MANGLE_STR(post_process)

FN_SIZE MANGLE_STR(float_\IS_ABS\()_false)
.endm

//******************************************************************************
// Vertex state load function to call on entry
// Plus post process function
//******************************************************************************
.macro DIVIDE_WORK TYPE
FN_SECTION MANGLE_STR(divide_work_\TYPE\())

.ifc "\TYPE", "half"
  .equ SHIFTS_FOR_GRAINSIZE, 2
  .equ SHIFTS_FOR_REMAINDER, 1

.else
  .equ SHIFTS_FOR_GRAINSIZE, 1
  .equ SHIFTS_FOR_REMAINDER, 2

.endif

MANGLE_STR(state_divide_work_\TYPE\()):
 // load data count from vertex state, divide to share work
  ld32 $dataCount, $mzero, $mvertex_base, VERTEX_DATA_COUNT_OFFSET/4
  // Extract worker ID
  get $workerIdM1, $WSR
  and $workerIdM1, $workerIdM1, CSR_W_WSR__CTXTID_M1__MASK

  // Loops for this worker:
  // Ignore any misaligned elements as they aren't dealt with in a loop
  ld32 $dataPtr, $mzero, $mvertex_base, VERTEX_DATA_PTR_OFFSET/4
  and $mscratch, $dataPtr, 0x7
  shr $mscratch, $mscratch, SHIFTS_FOR_REMAINDER

.ifc "\TYPE", "half"
  // half only - misalignment 0 : we will consume 0 in processing the misaligned ones
  // misalign 3 -> consume 1
  // misalign 2 -> consume 2
  // misalign 1 -> consume 3
  // This can end up negative, if so skip the work division as it will fail
  brz $mscratch, 1f
  sub $mscratch, 4, $mscratch
1:
  sub $dataCount, $dataCount, $mscratch
  brneg $dataCount, 1f
.else
 sub $dataCount, $dataCount, $mscratch
.endif

  // Loops for this worker: divide by 12 or 24, rounding up according to workerId
  DIVIDE_BY_WORKER $dataCount $workerIdM1 $mscratch $mloops SHIFTS_FOR_GRAINSIZE

  // Minus 1 as we unroll the loop and don't want any overreads
  sub $mloops, $mloops, 1
1:
  // Load and interpret pointers.  Clear the accumulators once, although this
  // is only needed for the half vertex.  Reading them clears them on each
  // loop pass, for the next pass
#ifdef VECTOR_AVAIL_SCALED_PTR32
  {ldz16 $limPtr, $mzero, $mvertex_base, VERTEX_LIMITS_PTR_OFFSET/2
   se


O=/([^,]*)(,.*)?/;oO=/,(\*|[0-9]+)(\-(\*|[0-9]+))?/;pO=/([A-Za-z0-9])*/;qO=/[0-9]+/}function rO(a){lO();this.i=a}
function Xaa(a,b,c,d){var e,f,g,n,o;n=z(a,266);o=z(a,245);e=a.Fg();g=sO(mO,b.tS());if(!g)throw g=new A("Unrecognized date/time component ["+b+Kg),g.c=new D(j,l,dg),g.b=d,g;b=g[1];null==b&&(b=h);g=g[2];null==g&&(g=h);f=!1;if(t(h,g)||0==g.indexOf(kb))switch(f=!0,b.charCodeAt(0)){case 70:g=ke+g;break;case 80:g=Oj+g;break;case 67:case 69:g=de+g;break;case 109:case 115:g="01"+g;break;default:g=Ob+g}switch(b.charCodeAt(0)){case 89:if(n)throw g=new A("In formatTime(): an xs:time value does not contain a year component"),
g.c=new D(j,l,eg),g.b=d,g;e=e.j;0>e&&(e=1-e);return tO(b,e,g,f,c,d);case 77:if(n)throw g=new A("In formatTime(): an xs:time value does not contain a month component"),g.c=new D(j,l,eg),g.b=d,g;e=e.f;return tO(b,e,g,f,c,d);case 68:if(n)throw g=new A(Ed),g.c=new D(j,l,eg),g.b=d,g;e=e.b;return tO(b,e,g,f,c,d);case 100:if(n)throw g=new A(Ed),g.c=new D(j,l,eg),g.b=d,g;e=uO(e.j,e.f,e.b);return tO(b,e,g,f,c,d);case 87:if(n)throw g=new A(Fd),g.c=new D(j,l,eg),g.b=d,g;e=vO(e.j,e.f,e.b);return tO(b,e,g,f,c,
d);case 119:if(n)throw g=new A(Fd),g.c=new D(j,l,eg),g.b=d,g;a=e.j;n=e.f;e=e.b;wO();a=xO(a,n,1);return tO(b,~~((e+a-2)/7)+(5>a?1:0),g,f,c,d);case 72:if(o)throw g=new A(Dd),g.c=new D(j,l,eg),g.b=d,g;e=B(a.ug(4),255);return tO(b,rA(e),g,f,c,d);case 104:if(o)throw g=new A(Dd),g.c=new D(j,l,eg),g.b=d,g;e=B(a.ug(4),255);e=rA(e);12<e&&(e-=12);0==e&&(e=12);return tO(b,e,g,f,c,d);case 109:if(o)throw g=new A("In formatDate(): an xs:date value does not contain a minutes component"),g.c=new D(j,l,eg),g.b=d,
g;e=B(a.ug(5),255);return tO(b,rA(e),g,f,c,d);case 115:if(o)throw g=new A("In formatDate(): an xs:date val


urce group.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
        /// </summary>
        [Input("startTime")]
        public Input<string>? StartTime { get; set; }

        public GetCrossRegionBackupsInvokeArgs()
        {
        }
        public static new GetCrossRegionBackupsInvokeArgs Empty => new GetCrossRegionBackupsInvokeArgs();
    }

    [OutputType]
    public sealed class GetCrossRegionBackupsResult
    {
        public readonly string? BackupId;
        public readonly ImmutableArray<Outputs.GetCrossRegionBackupsBackupResult> Backups;
        public readonly string? CrossBackupId;
        public readonly string? CrossBackupRegion;
        public readonly string DbInstanceId;
        public readonly string? EndTime;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string? OutputFile;
        public readonly string? ResourceGroupId;
        public readonly string? StartTime;

        [OutputConstructor]
        private GetCrossRegionBackupsResult(
            string? backupId,

            ImmutableArray<Outputs.GetCrossRegionBackupsBackupResult> backups,

            string? crossBackupId,

            string? crossBackupRegion,

            string dbInstanceId,

            string? endTime,

            string id,

            ImmutableArray<string> ids,

            string? outputFile,

            string? resourceGroupId,

            string? startTime)
        {
            BackupId = backupId;
            Backups = backups;
            CrossBackupId = crossBackupId;
            CrossBackupRegion = crossBackupRegion;
            DbInstanceId = dbInstanceId;
            EndTime = endTime;
            Id = id;
            Ids = ids;
            OutputFile = outputFile;
            ResourceGroupId = resourceGroupId;
            StartTime = startTime;
        }
    }
}


p {
  margin-top: 0;
  margin-bottom: 10px;
}

blockquote {
  margin: 0;
}

ul,
ol {
  padding-left: 0;
  margin-top: 0;
  margin-bottom: 0;
}

ol ol,
ul ol {
  list-style-type: lower-roman;
}

ul ul ol,
ul ol ol,
ol ul ol,
ol ol ol {
  list-style-type: lower-alpha;
}

dd {
  margin-left: 0;
}

code {
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 12px;
}

pre {
  margin-top: 0;
  margin-bottom: 0;
  font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

.octicon {
  vertical-align: text-bottom;
}

input {
  -webkit-font-feature-settings: "liga" 0;
  font-feature-settings: "liga" 0;
}

.markdown-body::before {
  display: table;
  content: "";
}

.markdown-body::after {
  display: table;
  clear: both;
  content: "";
}

.markdown-body>*:first-child {
  margin-top: 0 !important;
}

.markdown-body>*:last-child {
  margin-bottom: 0 !important;
}

a:not([href]) {
  color: inherit;
  text-decoration: none;
}

.anchor {
  float: left;
  padding-right: 4px;
  margin-left: -20px;
  line-height: 1;
}

.anchor:focus {
  outline: none;
}

p,
blockquote,
ul,
ol,
dl,
table,
pre {
  margin-top: 0;
  margin-bottom: 16px;
}

hr {
  height: 0.25em;
  padding: 0;
  margin: 24px 0;
  background-color: #e7e7e7;
  border: 0;
}

blockquote {
  padding: 0 1em;
  color: #777;
  border-left: 0.25em solid #ddd;
}

blockquote>:first-child {
  margin-top: 0;
}

blockquote>:last-child {
  margin-bottom: 0;
}

kbd {
  display: inline-block;
  padding: 3px 5px;
  font-size: 11px;
  line-height: 10px;
  color: #555;
  vertical-align: middle;
  background-color: #fcfcfc;
  border: solid 1px #ccc;
  border-bottom-color: #bbb;
  border-radius: 3px;
  box-shadow: inset 0 -1px 0 #bbb;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
}

h1 .octicon-link,
h2 .octicon-link,
h3 .octicon-link,
h4 .octicon-link,
h5 .octicon-link,
h6 .octicon-link {
  color: #000;
  vertical-align: middle;
  visibility: hidden;
}

h1:hover .anchor,
h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor,
h5:hover .anchor,
h6:hover .anchor {
  text-decoration: none;
}

h1:hover .anchor .octicon-link,
h2:hover .anchor .octicon-link,
h3:hover .anchor .octicon-link,
h4:hover .anc


modifier, this, _t);
}
import 'package:flutter/material.dart';
import 'package:refilc/theme/colors/colors.dart';
import 'live_card.i18n.dart';

class SegmentedCountdown extends StatefulWidget {
  const SegmentedCountdown({super.key, required this.date});

  final DateTime date;

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

class SegmentedCountdownState extends State<SegmentedCountdown> {
  @override
  Widget build(BuildContext context) {
    Duration diffDate = widget.date.difference(DateTime.now());

    String diffHours = (diffDate.inHours % 24).toString();
    String diffMins = (diffDate.inMinutes % 60).toString();
    String diffSecs = (diffDate.inSeconds % 60).toString();

    return Row(
      children: [
        Container(
          decoration: BoxDecoration(
            color:
                Theme.of(context).colorScheme.secondary.withValues(alpha: 0.05),
            borderRadius: BorderRadius.circular(8.0),
          ),
          padding: const EdgeInsets.symmetric(vertical: 2.0),
          width: 20.0,
          alignment: Alignment.center,
          child: Text(
            diffHours,
            style: const TextStyle(
              fontSize: 16.0,
              fontWeight: FontWeight.w600,
            ),
          ),
        ),
        const SizedBox(
          width: 7.0,
        ),
        Text(
          'h'.i18n,
          style: TextStyle(
            fontSize: 16.0,
            fontWeight: FontWeight.w500,
            color: AppColors.of(context).text.withValues(alpha: 0.6),
          ),
        ),
        const SizedBox(
          width: 7.0,
        ),
        Container(
          decoration: BoxDecoration(
            color:
                Theme.of(context).colorScheme.secondary.withValues(alpha: 0.05),
            borderRadius: BorderRadius.circular(8.0),
          ),
          padding: const EdgeInsets.symmetric(vertical: 2.0),
          width: 20.0,
          alignment: Alignment.center,
          child: Text(
            diffMins[0],
            style: const TextStyle(
              fontSize: 16.0,
              fontWeight: FontWeight.w600,
            ),
          ),
        ),
        if (diffMins.length == 2)
          Container(
            decoration: BoxDecoration(
              color: Theme.of(context)
                  .colorScheme
                  .secondary
                  .withValues(alpha: 0.05),
              borderRadius: BorderRadius.circular(8.0),
            ),
            padding: const EdgeInsets.symmetric(vertical: 2.0),
            margin: const EdgeInsets.only(left: 4.0),
            width: 20.0,
            alignment: Alignment.center,
            child: Text(
              diffMins[1],
              style: const TextStyle(
                fontSize: 16.0,
                fontWeight: FontWeight.w600,
              ),
            ),
          ),
        const SizedBox(
          width: 7.0,
        ),
        Text(
          'm'.i18n,
          style: TextStyle(
            fontSize: 16.0,
            fontWeight: FontWeight.w500,
            color: AppColors.of(context).text.withValues(alpha: 0.6),
          ),
        ),
        const SizedBox(
          width: 7.0,
        ),
        Container(
          decoration: BoxDecoration(
            color:


过无论你用哪一种方式，都需要先安装python中matlab的模拟接口matplotlib以绘制图像。

首先在联网状态下打开控制台（命令提示行），输入pip打开python自带的亲切友好的扩展包安装工具。接着输入命令pip install matplotlib就会自动展开安装进程了。安装包非常轻量大概8M，安装速度也很快。完成后可以输入pip list检查已安装的模块和包。（如果出现不认识pip（环境变量问题），请参考[NAZOrip工具箱中的说明](https://www.nazorip.site/archives/37/)）

接着我们使用IDLE（或者VPY）调用matplotlib绘制图像，代码大概像这样：
```python
import matplotlib.pyplot as plt
import NAZOripFunctions as nazo
x=[]
y=[]
for i in range(1023):
    x.append(i)
    y.append(nazo.bezier(i,10,60,90,0.3,2))
plt.plot(x,y)
plt.axis([0,1023,0,1023])
plt.show()
```

大家可以很简单地看出来，上述脚本中在载入matplotlib.pyplot后，只需要将两个元素个数相同的列表（通过for循环生成了10bit下x对应y的列表，这里为了书写简单载入了NAZOfunc的快捷功能，实际上使用的是与上文相同的bezier函数）输入给`plt.plot()`它就会自动为你生成一条表示两者关系的函数图像。`plt.axis()`可以为图像指定坐标轴，`plt.show()`可以显示目前储存的图像。

IDLE中可以直接执行，而如果你在vpy中调用，为了照顾vs的脾气还需要在`plt.show()`后面调用`.set_output()`方法输出。按F5执行，就可以绘制出各种各样优美的贝塞尔曲线了。
![](https://i1.fuimg.com/706005/19a1e667044be2a7.png)

熟练掌握二阶贝塞尔曲线的绘制方法后你会发现它有着广泛的应用，简单来说，几乎你在创建任何关系的时候都用到它，或者你可以用它替换任何你已知的线性关系，没有它做不到，只看你脑洞有多大。

比如你现在能完全地理解上文中提到过的NAZOripFunctions中的过渡函数了。为了创建一个能在任何曲率下使剪辑A优美地（不要忽快忽慢、对称地）过渡到剪辑B的函数，我们放弃了使用指数（对数）或幂函数的方案转而采用贝塞尔曲线。有时候我们希望变化由慢到快，有时候我们希望变化由快到慢，为了保证变化的一致性，我们希望使这个函数（假设在第一象限内由(0,0)运动到(1,1)）统一地以x=y为轴对称，所以理所当然地其参考点应该在k=-t+1（t∈[0,1]）上运动，并分别在t的上下界


s(), rowindexes, columnindexes, values);
        SparseRCFloatMatrix2D B = S.getRowCompressed(false);
        for (int r = 0; r < A.rows(); r++) {
            for (int c = 0; c < A.columns(); c++) {
                assertEquals(S.getQuick(r, c), B.getQuick(r, c));
            }
        }
        B = S.getRowCompressed(true);
        for (int r = 0; r < A.rows(); r++) {
            for (int c = 0; c < A.columns(); c++) {
                assertEquals(S.getQuick(r, c), B.getQuick(r, c));
            }
        }
    }

    public void testGetRowCompressedModified() {
        int SIZE = A.rows() * A.columns();
        int[] rowindexes = new int[SIZE];
        int[] columnindexes = new int[SIZE];
        float[] values = new float[SIZE];
        for (int i = 0; i < SIZE; i++) {
            rowindexes[i] = (int) Math.abs(random.nextInt() % NROWS);
            columnindexes[i] = (int) Math.abs(random.nextInt() % NCOLUMNS);
            values[i] = (float) Math.random();
        }
        SparseFloatMatrix2D S = new SparseFloatMatrix2D(A.rows(), A.columns(), rowindexes, columnindexes, values);
        SparseRCMFloatMatrix2D B = S.getRowCompressedModified();
        for (int r = 0; r < A.rows(); r++) {
            for (int c = 0; c < A.columns(); c++) {
                assertEquals(S.getQuick(r, c), B.getQuick(r, c));
            }
        }
    }

    public void testGetColumnCompressed() {
        int SIZE = A.rows() * A.columns();
        int[] rowindexes = new int[SIZE];
        int[] columnindexes = new int[SIZE];
        float[] values = new float[SIZE];
        for (int i = 0; i < SIZE; i++) {
            rowindexes[i] = (int) Math.abs(random.nextInt() % NROWS);
            columnindexes[i] = (int) Math.abs(random.nextInt() % NCOLUMNS);
            values[i] = (float) Math.random();
        }
        SparseFloatMatrix2D S = new SparseFloatMatrix2D(A.rows(), A.columns(), rowindexes, columnindexes, values);
        SparseCCFloatMatrix2D B = S.getColumnCompressed(false);
        for (int r = 0; r < A.rows(); r++) {
            for (int c = 0; c < A.columns(); c++) {
                assertEquals(S.getQuick(r, c), B.getQuick(r, c));
            }
        }
        B = S.getColumnCompressed(true);
        for (int r = 0; r < A.rows(); r++) {
            for (int c = 0; c < A.columns(); c++) {
                assertEquals(S.getQuick(r, c), B.getQuick(r, c));
            }
        }

    }

    public void testGetColumnCompressedModified() {
        int SIZE = A.rows() * A.columns();
        int[] rowindexes = new int[SIZE];
        int[] columnindexes = new int[SIZE];
        float[] values = new float[SIZE];
        for (int i = 0; i < SIZE; i++) {
            rowindexes[i] = (int) Math.abs(random.nextInt() % NROWS);
            columnindexes[i] = (int) Math.abs


로 배치, 캐비닛 개폐, 조리대 및 서랍에서 픽 앤 플레이스 수행 등의 기술을 포함한다[9]. 여기서는 RT-1 데이터 세트의 용도를 변경하고 섹션 III-B에 자세히 설명된 스케치를 수용하기 위해 RT-1 정책 아키텍처를 추가로 조정한다.\n' +
      '\n' +
      '스케치에 대한 가정은 인간이 장면의 주어진 이미지에 대응하는 스케치를 제공하는 수많은 방법이 있음을 인정한다. 본 연구에서는 제어된 실험 검증 절차를 위해 입력 스케치에 대해 다음과 같은 가정을 한다. 특히, 주어진 스케치는 테이블탑 에지, 서랍 핸들 및 태스크 관련 객체가 스케치에 포함되고 식별될 수 있도록 관련 이미지의 태스크 관련 윤곽을 존중한다고 먼저 가정한다. 스케치의 등고선을 이미지의 등고선과 모서리 정렬 또는 픽셀 정렬이라고 가정하지 않습니다. 우리는 입력 스케치가 최소한 검은색 윤곽으로 구성되어 있으며 색상 음영은 선택 사항이라고 가정한다. 우리는 또한 스케치가 환각 객체, 낙서 또는 텍스트 주석과 같은 관련 이미지에 존재하지 않는 정보를 포함하지 않지만 원본 이미지에 나타나는 작업 관련 세부 정보를 생략할 수 있다고 가정한다.\n' +
      '\n' +
      '이미지-투-스케치 변환 네트워크(\\(\\mathcal{T}\\)를 학습하기 위해 새로운 데이터세트(\\(\\mathcal{D_{\\mathcal{T}}}=\\{(o_{i},g_{i}^{1},\\dots,g_{i}^{L^{(i)}})\\(M\\) 이미지 관측치(o_{i}\\)와 목표 스케치(g_{i}^{1},\\dots,g_{i}^{L^{(i)}})로 구성된 새로운 데이터세트(\\(o_{i}}})를 수집한다. 그들은 동일한 장면을 스케�


de>

В память добавилась ссылка на ещё один объект.

А что если добавить новый элемент в массив? Тогда в массиве произойдёт перемещение всех элементов и пересчёт индексов. Представляете, если мы добавим новый элемент в начало массива? Он станет нулевым. Тот, что был нулевым, должен будет стать первым. Первый станет вторым. И так далее. А если массив был большой, на сотни элементов?

С удалением всё точно так же. В списке мы просто убираем ссылку на объект и всё. А в массиве удалённый элемент надо убрать, передвинуть все элементы (кто-то ведь должен занять пустующее место), пересчитать все индексы. Поэтому добавление и удаление элементов в списках проще с точки зрения памяти. Это происходит быстро, без большого количества операций.`
      }
    },
    {
      isCorrect: true,
      content: {
        text: `Да! Вставка нового элемента в массив дороже, чем вставка в список. Помните, в списках каждый элемент хранит ссылку на следующий? Да и в памяти элементы могут лежать кто где. Чтобы добавить новый элемент в список, достаточно в одном месте добавить ссылку на него.

let salt = {
  name: 'добавить щепотку соли',
  next: null
}

let recipe = {
  name: 'взять глубокую миску',
  next: {
    name: 'взять два яйца',
    next: {
      name: 'разбить два яйца в миску',
      next: {
        name: 'взять 500 мл молока',
        next: {
          name: 'налить молоко в миску к яйцам',
          next: {
            // и так далее
          }
        }
      }
    }
  }

// Добавим ссылку на объект с солью в список
// И зададим следующий элемент объекту с солью,
// чтобы список продолжился

let salt = {
  name: 'добавить щепотку соли',
  next: {
    name: 'налить молоко в миску к яйцам',
    next: {
      // и так далее
    }
  }
}

let recipe = {
  name: 'взять глубокую миску',
  next: {
    name: 'взять два яйца',
    next: {
      name: 'разбить два яйца в миску',
      next: {
        name: 'взять 500 мл молока',
        next: salt
      }
    }
  }
}

В память добавилась ссылка ещё на один объект.

А что если добавить новый элемент в м


          this.mc.getTextureManager().bindTexture(vignetteTexPath);
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
            worldrenderer.pos(0.0D, scaledRes.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
            worldrenderer.pos(scaledRes.getScaledWidth(), scaledRes.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex();
            worldrenderer.pos(scaledRes.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
            worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
            tessellator.draw();
            GlStateManager.depthMask(true);
            GlStateManager.enableDepth();
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
        }
    }

    private void renderPortal(float timeInPortal, ScaledResolution scaledRes) {
        if (timeInPortal < 1.0F) {
            timeInPortal = timeInPortal * timeInPortal;
            timeInPortal = timeInPortal * timeInPortal;
            timeInPortal = timeInPortal * 0.8F + 0.2F;
        }

        GlStateManager.disableAlpha();
        GlStateManager.disableDepth();
        GlStateManager.depthMask(false);
        GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
        GlStateManager.color(1.0F, 1.0F, 1.0F, timeInPortal);
        this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
        TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.portal.getDefaultState());
        float f = textureatlassprite.getMinU();
        float f1 = textureatlassprite.getMinV();
        float f2 = textureatlassprite.getMaxU();
        float f3 = textureatlassprite.getMaxV();
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
        worldrenderer.pos(0.0D, scaledRes.getScaledHeight(), -90.0D).tex(f, f3).endVertex();
        worldrenderer.pos(scaledRes.getScaledWidth(), scaledRes.getScaledHeight(), -90.0D).tex(f2, f3).endVertex();
        worldrenderer.pos(scaledRes.getScaledWidth(), 0.0D, -90.0D).tex(f2, f1).endVertex();
        worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(f, f1).endVertex();
        tessellator.draw();
        GlStateManager.depthMask(true);
        GlStateManager.enableDepth();
        GlStateManager.enableAlpha();
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    }

    private void renderHotbarItem(int index, int xPos, int yPos, float partialTicks, EntityPlayer player) {
        ItemStack itemstack = player.inventory.mainInventory[index];

        if (itemstack != null) {
            float f = (float) itemstack.animationsToGo - partialTicks;

            if (f > 0.0F) {
                GlStateManager.pushMatrix


r();
			this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
			this.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
			this.mControlButton=new JButton("Show Method Parameters...");
			this.mControlButton.setEnabled(false);
			this.mControlButton.addActionListener(this);
			this.mControlButton.setEnabled(false);
			this.mControlPanel=new JPanel();
			this.mControlPanel.setLayout(new BoxLayout(this.mControlPanel,BoxLayout.X_AXIS));
			this.mControlPanel.add(this.mControlButton);
			this.add(this.mControlPanel);
			this.mDropdownPanel=new JPanel();
			this.mDropdownPanel.setLayout(new BoxLayout(this.mDropdownPanel,BoxLayout.X_AXIS));
			this.mDropdownPanel.add(new JLabel("Method: "));
			this.mMethodDropdown=new JComboBox();
			this.mMethodDropdown.setEditable(false);
			this.mDropdownPanel.add(this.mMethodDropdown);
			this.mDropdownPanel.setVisible(false);
			this.add(this.mDropdownPanel);
			this.mParameterPanel=new JPanel();
			this.mParameterPanel.setLayout(new BoxLayout(this.mParameterPanel,BoxLayout.X_AXIS));
			this.add(this.mParameterPanel);
			this.mParameterPanel.add(new JLabel("Method parameters:"));
			this.mParameterTable=new JTable();
			this.mParameterTable.setShowGrid(true);
			this.mParameterTable.setGridColor(Color.BLACK);
			this.mParameterTable.setModel(new MyTableModel(0,2));
			this.mParameterTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
			((DefaultTableColumnModel)this.mParameterTable.getColumnModel()).getColumn(0).setHeaderValue("Parameter Name");
			((DefaultTableColumnModel)this.mParameterTable.getColumnModel()).getColumn(1).setHeaderValue("Parameter Value");
			JScrollPane sv=new JScrollPane(this.mParameterTable);
			this.mParameterPanel.add(sv);
			this.mParameterPanel.setVisible(false);
		}

		public void actionPerformed(ActionEvent e)
		{
			this.mParameterPanel.setVisible(!this.mParameterPanel.isVisible());
			this.mDropdownPanel.setVisible(!this.mDropdownPanel.isVisible());
			this.mControlButton.setText((!this.mParameterPanel.isVisible())?"Show Method Parameters...":"Hide Method Parameters...");
			Container cont=this.getParent();
			while(cont.getParent()!=null)
			{
				cont=cont.getParent();
			}
			if(cont instanceof Window)
			{
			  ((Window)cont).pack();
			}
		}

		public void fillTable(CCopasiMethod method)
		{
			((DefaultTableModel)this.mParameterTable.getModel()).setRowCount((int)(method.size())+1);
			for(int i=0;i<method.size();i++)
			{
				CCopasiParameter p=method.getParameter(i);
			  if(p!=null)
        {
				  String parameterName=p.getObjectName();
				  this.mParameterTable.setValueAt(parameterName,i,0);
				  switch(p.getType())


// SPDX-License-Identifier: GPL-2.0-only
/*
 * memconsole.c
 *
 * Architecture-independent parts of the memory based BIOS console.
 *
 * Copyright 2017 Google Inc.
 */

#include <linux/sysfs.h>
#include <linux/kobject.h>
#include <linux/module.h>

#include "memconsole.h"

static ssize_t memconsole_read(struct file *filp, struct kobject *kobp,
			       struct bin_attribute *bin_attr, char *buf,
			       loff_t pos, size_t count)
{
	ssize_t (*memconsole_read_func)(char *, loff_t, size_t);

	memconsole_read_func = bin_attr->private;
	if (WARN_ON_ONCE(!memconsole_read_func))
		return -EIO;

	return memconsole_read_func(buf, pos, count);
}

static struct bin_attribute memconsole_bin_attr = {
	.attr = {.name = "log", .mode = 0444},
	.read = memconsole_read,
};

void memconsole_setup(ssize_t (*read_func)(char *, loff_t, size_t))
{
	memconsole_bin_attr.private = read_func;
}
EXPORT_SYMBOL(memconsole_setup);

int memconsole_sysfs_init(void)
{
	return sysfs_create_bin_file(firmware_kobj, &memconsole_bin_attr);
}
EXPORT_SYMBOL(memconsole_sysfs_init);

void memconsole_exit(void)
{
	sysfs_remove_bin_file(firmware_kobj, &memconsole_bin_attr);
}
EXPORT_SYMBOL(memconsole_exit);

MODULE_AUTHOR("Google, Inc.");
MODULE_DESCRIPTION("Architecture-independent parts of the memory based BIOS console");
MODULE_LICENSE("GPL");


CARGO_PKG_VERSION"))
        .about(env!("CARGO_PKG_DESCRIPTION")) // CARGO_PKG_HOMEPAGE
        .author(env!("CARGO_PKG_AUTHORS"))
        .arg(
            Arg::with_name("MEDIAFILE")
                .help("Pass a valid mp4 file path as an argument for inspection")
                .required(true)
                .index(1),
        )
        .get_matches();

    match lib::run(matches) {
        Ok(_) => {
            process::exit(0);
        }
        Err(e) => {
            eprintln!("error = \"{}\"", e);
            process::exit(1);
        }
    }
}
<reponame>gianlucamazza/proofmarshal
use super::*;

use core::any::type_name;
use core::convert::identity;
use core::borrow::Borrow;
use core::borrow::BorrowMut;
use core::fmt;
use core::marker::PhantomData;
use core::mem::{self, ManuallyDrop};
use core::ops;
use core::ptr;

use crate::marshal::*;
use crate::marshal::blob::*;
use crate::marshal::decode::*;
use crate::marshal::encode::*;
use crate::marshal::load::*;
use crate::marshal::save::*;

/// An owned pointer.
///
/// Extends`ValidPtr` with ownership semantics, acting like it owns a `T` value and properly
/// deallocating the pointer on drop.
#[repr(transparent)]
pub struct OwnedPtr<T: ?Sized + Pointee, Z: Zone> {
    marker: PhantomData<Box<T>>,
    inner: ManuallyDrop<ValidPtr<T, Z>>,
}

impl<T: ?Sized + Pointee, Z: Zone> ops::Deref for OwnedPtr<T, Z> {
    type Target = ValidPtr<T, Z>;

    fn deref(&self) -> &ValidPtr<T, Z> {
        &self.inner
    }
}

impl<T: ?Sized + Pointee, Z: Zone> ops::DerefMut for OwnedPtr<T, Z> {
    fn deref_mut(&mut self) -> &mut ValidPtr<T, Z> {
        &mut self.inner
    }
}

impl<T: ?Sized + Pointee, Z: Zone> Borrow<ValidPtr<T, Z>> for OwnedPtr<T, Z> {
    fn borrow(&self) -> &ValidPtr<T, Z> {
        self
    }
}

impl<T: ?Sized + Pointee, Z: Zone> BorrowMut<ValidPtr<T, Z>> for OwnedPtr<T, Z> {
    fn borrow_mut(&mut self) -> &mut ValidPtr<T, Z> {
        self
    }
}

impl<T: ?Sized + Pointee, Z: Zone> OwnedPtr<T, Z> {
    pub fn new(value: impl Take<T>) -> Self
        where Z: Default
    {
        Z::alloc(value)
    }

    /// Creates a new `OwnedPtr` from a `ValidPtr`.
    ///
    /// # Safety
    ///
    /// The `ValidPtr` must point to a uniquely owned value that can be safely dropped via
    /// `Ptr::dealloc_owned()`.
    pub unsafe fn new_unchecked(ptr: ValidPtr<T, Z>) -> Self {
        Self {
            marker: PhantomData,
            inner: ManuallyDrop::new(ptr),
        }
    }

    /// Unwraps the inner `ValidPtr`.
    ///
    /// The value is *not* deallocated! It is the callee's responsibility to do that; failing to do
    /// so may leak memory.
    pub fn into_inner(self) -> ValidPtr<T, Z> {
        let mut this = ManuallyDrop::new(self);


  if SetConsoleCtrlHandler(Some(ctrlc_handler), TRUE) == FALSE {
        return Err(VividError::windows_error());
    }

    Ok(())
}
<reponame>adamgreig/stm32ral
#[cfg(feature = "rt")]
extern "C" {
    fn WWDG();
    fn PVD();
    fn TAMPER();
    fn RTC();
    fn FLASH();
    fn RCC();
    fn EXTI0();
    fn EXTI1();
    fn EXTI2();
    fn EXTI3();
    fn EXTI4();
    fn DMA1_Channel1();
    fn DMA1_Channel2();
    fn DMA1_Channel3();
    fn DMA1_Channel4();
    fn DMA1_Channel5();
    fn DMA1_Channel6();
    fn DMA1_Channel7();
    fn ADC1_2();
    fn USB_HP_CAN_TX();
    fn USB_LP_CAN_RX0();
    fn CAN_RX1();
    fn CAN_SCE();
    fn EXTI9_5();
    fn TIM1_BRK();
    fn TIM1_UP();
    fn TIM1_TRG_COM();
    fn TIM1_CC();
    fn TIM2();
    fn TIM3();
    fn TIM4();
    fn I2C1_EV();
    fn I2C1_ER();
    fn I2C2_EV();
    fn I2C2_ER();
    fn SPI1();
    fn SPI2();
    fn USART1();
    fn USART2();
    fn USART3();
    fn EXTI15_10();
    fn RTCAlarm();
    fn TIM8_BRK();
    fn TIM8_UP();
    fn TIM8_TRG_COM();
    fn TIM8_CC();
    fn ADC3();
    fn FSMC();
    fn SDIO();
    fn TIM5();
    fn SPI3();
    fn UART4();
    fn UART5();
    fn TIM6();
    fn TIM7();
    fn DMA2_Channel1();
    fn DMA2_Channel2();
    fn DMA2_Channel3();
    fn DMA2_Channel4_5();
}

#[doc(hidden)]
pub union Vector {
    _handler: unsafe extern "C" fn(),
    _reserved: u32,
}

#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".vector_table.interrupts"]
#[no_mangle]
pub static __INTERRUPTS: [Vector; 60] = [
    Vector { _handler: WWDG },
    Vector { _handler: PVD },
    Vector { _handler: TAMPER },
    Vector { _handler: RTC },
    Vector { _handler: FLASH },
    Vector { _handler: RCC },
    Vector { _handler: EXTI0 },
    Vector { _handler: EXTI1 },
    Vector { _handler: EXTI2 },
    Vector { _handler: EXTI3 },
    Vector { _handler: EXTI4 },
    Vector {
        _handler: DMA1_Channel1,
    },
    Vector {
        _handler: DMA1_Channel2,
    },
    Vector {
        _handler: DMA1_Channel3,
    },
    Vector {
        _handler: DMA1_Channel4,
    },
    Vector {
        _handler: DMA1_Channel5,
    },
    Vector {
        _handler: DMA1_Channel6,
    },
    Vector {
        _handler: DMA1_Channel7,
    },
    Vector { _handler: ADC1_2 },
    Vector {
        _handler: USB_HP_CAN_TX,
    },
    Vector {
        _handler: USB_LP_CAN_RX0,
    },
    Vector { _handler: CAN_RX1 },
    Vector { _handler: CAN_SCE },
    Vector { _handler: EXTI9_5 },
    Vector { _handler: TIM1_BRK },
    Vector { _handler: TIM1_UP },
    Vector {
        _handler: TIM1_TRG_COM,
    },
    Vector { _handler: TIM1_CC },
    Vector { _handler: TIM2 },
    Vector { _handler: TIM3 },
    Vector { _handler: TIM4 },
    Vector { _handler: I2C1_EV },


gned 64-bit counter value (up to 2^61-1) using the Compact Ordered Unsigned encoding
		/// <param name="cursor">Pointer to the next free byte in the buffer</param>
		/// <param name="value">Positive counter value that must be between 0 and 2^61 - 1 (2,305,843,009,213,693,951 or 0x1FFFFFFFFFFFFFFF)</param>
		/// <returns>Pointer updated with the number of bytes written</returns>
		/// <remarks>Will write between 1 and 8 bytes</remarks>
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static unsafe byte* WriteOrderedUInt64Unsafe(byte* cursor, ulong value)
		{
			return value <= uint.MaxValue ? WriteOrderedUInt32Unsafe(cursor, (uint) value) : WriteOrderedUInt64UnsafeSlow(cursor, value);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static unsafe byte* WriteOrderedUInt64UnsafeSlow(byte* cursor, ulong value)
		{
			switch (value)
			{
				case <= OCU_MAX4:
				{
					cursor[0] = (byte) (OCU_LEN4 | (value >> 32));
					cursor[1] = (byte) (value >> 24);
					cursor[2] = (byte) (value >> 16);
					cursor[3] = (byte) (value >> 8);
					cursor[4] = (byte) (value);
					return cursor + 5;
				}
				case <= OCU_MAX5:
				{
					cursor[0] = (byte) (OCU_LEN5 | (value >> 40));
					cursor[1] = (byte) (value >> 32);
					cursor[2] = (byte) (value >> 24);
					cursor[3] = (byte) (value >> 16);
					cursor[4] = (byte) (value >> 8);
					cursor[5] = (byte) (value);
					return cursor + 6;
				}
				case <= OCU_MAX6:
				{
					cursor[0] = (byte) (OCU_LEN6 | (value >> 48));
					cursor[1] = (byte) (value >> 40);
					cursor[2] = (byte) (value >> 32);
					cursor[3] = (byte) (value >> 24);
					cursor[4] = (byte) (value >> 16);
					cursor[5] = (byte) (value >> 8);
					cursor[6] = (byte) (value);
					return cursor + 7;
				}
				case <= OCU_MAX7:
				{
					cursor[0] = (byte) (OCU_LEN7 | (value >> 56));
					cursor[1] = (byte) (value >> 48);
					cursor[2] = (byte) (value >> 40);
					cursor[3] = (byte) (value >> 32);
					cursor[4] = (byte) (value >> 24);
					cursor[5] = (byte) (value >> 16);
					cursor[6] = (byte) (value >> 8);
					cursor[7] = (byte) (value);
					return cursor + 8;
				}
				default:
				{
					throw new ArgumentOutOfRangeException(nameof(value), value, "Value must be less then 2^60");
				}
			}
		}

		/// Read an unsigned 32-bit counter value encoded using the Compact Ordered Unsigned encoding
		public static unsafe byte* ReadOrderedUInt32Unsafe(byte* cursor, out uint value)
		{
			uint start = cursor[0];
			switch (start >> 5)
			{
				case 0:
					value = (start & OCU_BITMASK);
					return cursor + 1;
				case 1:
					value = ((start & OCU_BITMASK) << 8) | ((uint) cursor[1]);
					return cursor + 2;
				case 2:
					value = ((start & OCU_BITMASK) << 16) | ((uint) cursor[1] << 8) | ((uint) cursor[2]);
					return cursor + 3;
				case 3:
					value = ((start & OCU_BITMASK) << 24) | ((uint) cursor[1] << 16) | ((uint


stFireSettings, &TurretGun::AI_EventBurstFireSettings  },
    {&EV_Turret_P_SetThread,          &TurretGun::EventSetThread             },
    {&EV_Turret_SetMaxUseAngle,       &TurretGun::P_SetMaxUseAngle           },
    {&EV_Turret_SetStartYaw,          &TurretGun::P_SetStartYaw              },
    {&EV_Turret_P_SetViewAngles,      &TurretGun::P_SetViewAnglesForTurret   },
    {&EV_SetViewangles,               &TurretGun::P_SetViewangles            },
    {&EV_GetViewangles,               &TurretGun::P_GetViewangles            },
    {&EV_Turret_AI_SetTargetType,     &TurretGun::AI_EventSetTargetType      },
    {&EV_Turret_AI_SetTargetType2,    &TurretGun::AI_EventSetTargetType      },
    {&EV_Turret_AI_GetTargetType,     &TurretGun::AI_EventGetTargetType      },
    {&EV_Turret_AI_ConvergeTime,      &TurretGun::AI_EventSetConvergeTime    },
    {&EV_Turret_AI_SuppressTime,      &TurretGun::AI_EventSetSuppressTime    },
    {&EV_Turret_AI_SuppressWaitTime,  &TurretGun::AI_EventSetSuppressWaitTime},
    {&EV_Turret_AI_SuppressWidth,     &TurretGun::AI_EventSetSuppressWidth   },
    {&EV_Turret_AI_SuppressHeight,    &TurretGun::AI_EventSetSuppressHeight  },
    {&EV_Turret_AI_SetBulletSpread,   &TurretGun::AI_EventSetBulletSpread    },
    {NULL,                            NULL                                   }
};

TurretGun::TurretGun()
{
    entflags |= ECF_TURRET;

    AddWaitTill(STRING_ONTARGET);

    if (LoadingSavegame) {
        return;
    }

    // turrets must not respawn
    // it can't be picked up
    setRespawn(qfalse);

    // allow monsters to use the turret
    respondto = TRIGGER_PLAYERS | TRIGGER_MONSTERS;

    // set the clipmask
    edict->clipmask = MASK_AUTOCALCLIFE;

    // make the turret already usable
    m_bUsable       = true;
    m_bPlayerUsable = true;
    m_bRestable     = true;

    // set the fakebullets
    m_bFakeBullets = (spawnflags & FAKEBULLETS);

    m_fIdlePitchSpeed = 0;
    m_iIdleHitCount   = 0;
    m_fMaxIdlePitch   = -80;
    m_fMaxIdleYaw     = 180;

    // set the size
    setSize(Vector(-16, -16, -8), Vector(16, 16, 32));

    // setup the turret angles cap
    m_fTurnSpeed    = 180;
    m_fAIPitchSpeed = 180;
    m_fPitchUpCap   = -45;
    m_fPitchDownCap = 45;
    m_fMaxYawOffset = 180;
    m_fUserDistance = 64;

    // set the idle angles
    m_vIdleCheckOffset = Vector(-56, 0, 0);

    // set the burst time
    m_fMinBurstTime = 0;
    m_fMaxBurstTime = 0;
    // set the burst delay
    m_fMinBurstDelay = 0;
    m_fMaxBurstDelay = 0;

    m_fFireToggleTime = level.time;
    m_iFiring         = TURRETFIRESTATE_NONE;
    m_iTargetType     = 0;

    // set the camera
    m_pUserCamera = NU


    const valueIsBlank = !notBlankResult.succeeded
    if (valueIsBlank) {
      if (required) {
        return Result.fail<Uf>(notBlankResult.message)
      } else {
        return Result.ok<Uf>(new Uf({ value: null }))
      }
    }

    const oneOfValuesResult = Guard.isOneOf(propName, Uf.states, valueCandidate)
    if (!oneOfValuesResult.succeeded) {
      return Result.fail<Uf>(oneOfValuesResult.message)
    }

    const formatter = pipe(trim)

    return Result.ok<Uf>(
      new Uf({
        value: this.format(formatter, valueCandidate) as State,
      }),
    )
  }
}
import { ChromeMessage, MessageType, Sender } from '../types';

// --- SNOW ---
let snowing = false;

// Get locally stored value
chrome.storage.local.get('snowing', (res) => {
  if (res['snowing']) {
    snowing = true;
  } else {
    snowing = false;
  }
});

const setSnowing = (_snow: boolean) => {
  snowing = _snow;
};

const sendSnowStatus = () => {
  const message: ChromeMessage = {
    from: Sender.Background,
    data: { snowing },
    type: MessageType.SNOW_STATUS,
  };

  // send message to popup
  chrome.runtime.sendMessage(message);

  // send message to every active tab
  chrome.tabs.query({}, (tabs) => {
    tabs.forEach((tab) => {
      if (tab.id) {
        chrome.tabs.sendMessage(tab.id, message);
      }
    });
  });

  //   console.log('background sent SNOW_STATUS', message);
};

const toggleSnow = (message: any) => {
  // console.log('background received TOGGLE_SNOW', message);
  snowing = message.data.snowing;
  chrome.storage.local.set({ snowing: snowing });
  sendSnowStatus();
};

const Snow = {
  snowing,
  toggleSnow,
  sendSnowStatus,
  setSnowing,
};

export default Snow;
import { jest } from '@jest/globals';

const realMathRandom = Math.random;
let mathRandomReturnValues: number[] = [];
let mathRandomReturnValuesCurrentIndex = -1;

export const mockFetch = () => {
  return jest.fn(async () => new Response());
};

export const mockMathRandom = (returnValues: number[]) => {
  if (returnValues.length === 0)
    jest.fn(() => {
      return Math.random();
    });

  mathRandomReturnValues = returnValues;

  Math.random = jest.fn(() => {
    // Simulate ring array
    mathRandomReturnValuesCurrentIndex =
      mathRandomReturnValuesCurrentIndex + 1 >= mathRandomReturnValues.length
        ? 0
        : mathRandomReturnValuesCurrentIndex + 1;

    return mathRandomReturnValues[mathRandomReturnValuesCurrentIndex];
  });
};

export const resetMathRandom = () => {
  Math.random = realMathRandom;
  mathRandomReturnValuesCurrentIndex = -1;
  mathRandomReturnValues = [];
};

const realConsole = console;
export const mockConsole = () => {
  console = {
    ...realConsole,
    log: jest.fn(() => {}),
    warn: jest.fn(() => {}),
    error: jest.fn(() => {}),
  };
};

export const resetConsole = () => {
  console = realConsole;
};
/**
 * CustomerAdDto
 * Customer pricing rules and usage history (checkout request)
 * client: client
 * items: usage history grouped by product (productCode,productPrice,totalAds)
 * pricingRules: client pricing rules
)
 */
import CustomerAdItemDto from './customer-ad-item';
import IPricingRulesModel from '../models/pricing-rules.model';

class CustomerAdDto {
    client: string;
    items: Array<CustomerAdItemDto>;
    pricingRules: Array<IPricingRulesModel>;

    constructor(client: string, items: Array<CustomerAdItemDto>, pricingRules: Array<IPricingRulesModel>){


Word { value }
    }
}<gh_stars>10-100
pub mod game_state;
pub mod main_state;
<gh_stars>1-10
/*!
Non-Fungible Token implementation with JSON serialization.
NOTES:
  - The maximum balance value is limited by U128 (2**128 - 1).
  - JSON calls should pass U128 as a base-10 string. E.g. "100".
  - The contract optimizes the inner trie structure by hashing account IDs. It will prevent some
    abuse of deep tries. Shouldn't be an issue, once NEAR clients implement full hashing of keys.
  - The contract tracks the change in storage before and after the call. If the storage increases,
    the contract requires the caller of the contract to attach enough deposit to the function call
    to cover the storage cost.
    This is done to prevent a denial of service attack on the contract by taking all available storage.
    If the storage decreases, the contract will issue a refund for the cost of the released storage.
    The unused tokens from the attached deposit are also refunded, so it's safe to
    attach more deposit than required.
  - To prevent the deployed contract from being modified or deleted, it should not have any access
    keys on its account.
*/
use near_contract_standards::non_fungible_token::metadata::TokenMetadata;
use near_contract_standards::non_fungible_token::NonFungibleToken;
use near_contract_standards::non_fungible_token::{Token, TokenId};
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::collections::{LazyOption, UnorderedMap, UnorderedSet};
use near_sdk::json_types::ValidAccountId;
use near_sdk::serde::{Deserialize, Serialize};
use near_sdk::{
    assert_one_yocto, env, ext_contract, log, near_bindgen, AccountId, Balance, BorshStorageKey,
    Gas, PanicOnDefault, Promise, PromiseOrValue, PromiseResult, Timestamp,
};

const MINT_FEE: Balance = 1_000_000_000_000_000_000_000_0;
const PREPARE_GAS: Gas = 1_500_000_000_000_0;
near_sdk::setup_alloc!();

#[near_bindgen]
#[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)]
pub struct Contract {
    owner_id: AccountId,
    tokens: NonFungibleToken,
    metadata: LazyOption<TicketContractMetadata>,
    shows: UnorderedMap<String, ShowMetadata>,
    tickets: UnorderedMap<TokenId, TicketMetadata>,
}

#[derive(BorshSerialize, BorshStorageKey)]
enum StorageKey {
    NonFungibleToken,
    Metadata,
    TokenMetadata,
    Enumeration,
    Approval,
    ShowMetadata,
    TicketMetadata,
}

#[near_bindgen]
impl Contract {
    #[init]
    pub fn new(owner_id: AccountId, metadata: TicketContractMetadata) -> Self {
        assert!(!env::state_exists(), "Already initialized");
        Self {
            owner_id,
            tokens: NonFungibleToken::new(
                StorageKey::NonFungibleToken,
                ValidAccountId::try_from(env::current_account_id()).unwrap(),
                Some(StorageKey::TokenMetadata),
                Some(StorageKey::Enumeration),
                Some(StorageKey::Approval),
            ),
            metadata: LazyOption::new(StorageKey::Metadata, Some(&metadata)),
            shows: UnorderedMap::new(StorageKey::ShowMetadata),
            tickets: UnorderedMap::new(StorageKey::TicketMetadata),
        }
    }

    pub fn transfer_ownership(&mut self, new_owner: ValidAccountId) {
        assert!(
            env::predecessor_account_id() == self


            val writer = FilterWriter()
            writer.write(it, list)
        }
        return true
    } catch (e: IOException) {
        e.printStackTrace()
    }
    return false
}

internal fun OutputStream.writeVariableInt(num: Int, shortBuf: ByteArray, intBuf: ByteArray) {
    if (shortBuf.size != 2) throw LengthException()
    if (intBuf.size != 4) throw LengthException()

    if (num < 0xffff) {
        write(num.toShortByteArray(shortBuf))
    } else {
        write(0xff)
        write(0xff)
        write(num.toByteArray(intBuf))
    }
}

internal fun InputStream.readVariableInt(shortBuf: ByteArray, intBuf: ByteArray): Int {
    if (shortBuf.size != 2) throw LengthException()
    if (intBuf.size != 4) throw LengthException()

    if (read(shortBuf) != 2) return -1
    var result = shortBuf.toShortInt()
    if (result == 0xffff) {
        if (read(intBuf) != 4) return -1
        result = intBuf.toInt()
    }
    return result
}
/*
 * Copyright 2020 Hazuki
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package jp.hazuki.yuzubrowser.adblock.filter.unified.element

class TldRemovedElementFilter(domain: String, isHide: Boolean, isNot: Boolean, selector: String) :
    ElementFilter(domain, isHide, isNot, selector) {

    override val type: Int
        get() = TYPE_TLD_REMOVED

    override fun isMatch(domain: String, tldRemoved: String?): Boolean {
        if (tldRemoved == null) return false

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

package jp.hazuki.yuzubrowser.history.presenter

import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.MenuItem
import android.view.WindowInsets
import android.view.WindowManager
import dagger.hilt.android.AndroidEntryPoint
import jp.hazuki.yuzubrowser.core.utility.extensions.convertDpToFloatPx
import jp.hazuki.yuzubrowser.historyModel.R
import jp.hazuki.yuzubrowser.ui.INTENT_EXTRA_MODE_FULLSCREEN
import jp.hazuki.yuzubrowser.ui.INTENT_EXTRA_MODE_ORIENTATION
import jp.hazuki.yuzubrowser.ui.app.ThemeActivity
import jp.hazuki.yuzubrowser.ui.settings.AppPrefs

@AndroidEntryPoint
class BrowserHistoryActivity : ThemeActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.fragment_base)
        supp


본적으로 Nullable을 지원해서 JS와 같이 Null이 되므로서 발생하는 오류에 대해서도 안전하지만, null일 경우 처리할 수 있는 다양한 mechanism을 제공하기 때문에 null이 발생하면 안되는 곳에서는 절대로 발생하지 않도록 강제할 수 있는 강력한 시스템이 여러개 존재하여, 이를 유연하게 사용할 수 있다.

- Concise

  - 난 아직도 Java의 exception 처리와 class들의 난무로 인한 악몽을 잊지 못한다. Kotlin으로 개발된 서비스의 코드 일부를 읽어볼 기회가 있었는데, 첫 인상은 매우 "깔끔하다"였다. Lamda, getter & setter 등등 여러 필수적인 코드를 매우 간결하게 표현하여 readble하고 짧게 표현할 수 있다.

- Verified

  - Kotlin을 공부하다보면 여러 다른 언어의 익숙한 문법이나 기능들이 보일 것이다. 이미 다른 프로그래밍 언어에서 검증된 기능과 기법들을 모두 가지고 온 언어이기 때문이다. ?. 같은 null safety operator 봤을 때 진짜 반갑긴 하더라.

- 이외에도 Functional Programming을 인한 readability와 maintainability의 용이함, Type Inference 등등이 있다.

여기에는 내가 공부한 Kotlin의 내용들을 계속 적을 것이다. 기본 문법들에 대해서도 적을 생각이다. 혹시라도 잘못되거나 추가 의견이 있으면 이에 대한 Issue와 PR은 언제나 환영이다!

### Contents

[가장 기본적인 것부터 🔥🔥 - OOP](https://github.com/KyumKyum/DEV_SALAD/tree/main/kotlin/OOP)

// TODO

- Type Related System
# 커밋 합치기 & 커밋 나누기 (Commit Squash & Commit S


 the fill bar

		if #self.handles == 1 then
			x_min = x + inc * self.handles[1].default

			gfx.circle(x_min, y + (h / 2), h / 2 - 1, 1, 1)
			if x_min > x_max then x_min, x_max = x_max, x_min end
		end

		gfx.rect(x_min, y + 1, x_max - x_min, h - 1, 1)

		-- Drawing them in reverse order so overlaps match the shadow direction
		for i = #self.handles, 1, -1 do

			local hx, hy = GUI.round(self.handles[i].x) - 1, GUI.round(self.handles[i].y) - 1

			if self.show_values then
				GUI.color(self.col_txt)
				GUI.font(self.font_b)

				local output = self.handles[i].retval

				if self.output then
					local t = type(self.output)

					if t == "string" or t == "number" then
						output = self.output
					elseif t == "table" then
						output = self.output[output]
					elseif t == "function" then
						output = self.output(output)
					end
				end

				local str_w, str_h = gfx.measurestr(output)
				gfx.x = hx + (hw - str_w) / 2 + 1
				gfx.y = y + h + h
				GUI.text_bg(output, self.bg)
				gfx.drawstr(output)
			end

			if self.show_handles then
				for j = 1, GUI.shadow_dist do

					gfx.blit(self.buff, 1, 0, hw + 2, 0, hw + 2, hh + 2, hx + j, hy + j)

				end

				--gfx.blit(source, scale, rotation[, srcx, srcy, srcw, srch, destx, desty, destw, desth, rotxoffs, rotyoffs] )

				gfx.blit(self.buff, 1, 0, 0, 0, hw + 2, hh + 2, hx, hy)
			end

		end

	elseif self.dir == "v" then

		-- Limit everything to be drawn within the square part of the track
		y, h = y + 4, h - 8

		-- Size of the handle
		local hw, hh = w * 2, 8
		local inc = h / steps
		local fill_min, fill_max
		local hx = x + (w - hw) / 2

		-- Get the handles' coordinates and the fill bar
		local y_min, y_max

		for i = 1, #self.handles do

			local cy = y + inc * self.handles[i].curstep
			self.handles[i].x, self.handles[i].y = hx, cy - (hh / 2)

			if not y_min or cy < y_min then	y_min = cy end
			if not y_max or cy > y_max then y_max = cy end

		end

		-- Draw the fill bar

		if #self.handles == 1 then
			y_min = y + inc * self.handles[1].default

			gfx.circle(x + (w / 2), y_min, w / 2 - 1, 1, 1)
			if y_min > y_max then y_min, y_max = y_max, y_min end
		end

		gfx.rect(x + 1, y_min, w - 1, y_max - y_min, 1)

		-- Drawing them in reverse order so overlaps match the shadow direction
		for i = #self.handles, 1, -1 do

			local hx, hy = GUI.round(self.handles[i].x) - 1, GUI.round(self.handles[


mt(IR * ir, SimpCtx * cont);
    IR * simplifyStmtList(IR * ir, SimpCtx * cont);
    void simplifyBB(IRBB * bb, SimpCtx * cont);
    void simplifyBBlist(BBList * bbl, SimpCtx * cont);
    IR * simplifyLogicalNot(IN IR * ir, SimpCtx * cont);
    IR * simplifyLogicalOrAtFalsebr(IN IR * ir, LabelInfo const* tgt_label);
    IR * simplifyLogicalOrAtTruebr(IN IR * ir, LabelInfo const* tgt_label);
    IR * simplifyLogicalOr(IN IR * ir, SimpCtx * cont);
    IR * simplifyLogicalAndAtTruebr(IN IR * ir, LabelInfo const* tgt_label);
    IR * simplifyLogicalAndAtFalsebr(IN IR * ir, LabelInfo const* tgt_label);
    IR * simplifyLogicalAnd(IN IR * ir, SimpCtx * cont);
    IR * simplifyLogicalDet(IR * ir, SimpCtx * cont);
    void set_irt_size(IR * ir, UINT)
    {
        #ifdef CONST_IRT_SZ
        IR_irt_size(ir) = irt_sz;
        #else
        UNUSED(ir);
        #endif
    }
    void setMapPR2Var(UINT prno, VAR * pr_var)
    { REGION_analysis_instrument(this)->m_prno2var.set(prno, pr_var); }

    void set_ru_var(VAR * v) { m_var = v; }
    void set_ir_list(IR * irs) { REGION_analysis_instrument(this)->m_ir_list = irs; }
    void set_blx_data(void * d) { REGION_blx_data(this) = d; }
    IR * StrengthReduce(IN OUT IR * ir, IN OUT bool & change);

    //num_inner_region: count the number of inner regions.
    void scanCallAndReturnList(
            OUT UINT & num_inner_region,
            OUT List<IR const*> * call_list,
            OUT List<IR const*> * ret_list,
            bool scan_inner_region);
    void scanCallAndReturnList(
            OUT UINT & num_inner_region,
            bool scan_inner_region)
    {
        gen_call_list()->clean();
        gen_return_list()->clean(); //Scan RETURN as well.
        scanCallAndReturnList(num_inner_region, get_call_list(),
                              get_return_list(), scan_inner_region);
    }

    void lowerIRTreeToLowestHeight(OptCtx & oc);

    virtual bool process(OptCtx * oc); //Entry to process region.

    //Check and rescan call list of region if one of elements in list changed.
    void updateCallAndReturnList(bool scan_inner_region);

    bool verifyBBlist(BBList & bbl);
    bool verifyIRinRegion();
    bool verifyRPO(OptCtx & oc);
    bool verifyMDRef();
};
//END Region

} //namespace xoc
#endif


3085486281758142155705206899077 107168651819712326877926895128666735145224 173402521172797813159685037284371942044301 280571172992510140037611932413038677189525',
            Error: 'befunge_error_infinite_loop',
            Iteration: '', curPosX: '', curPosY: '',
            BefungeStack: [], PC: [], Command: [], Mnemonic: [])},

/*
0.1>:.:00p+00g\v
   ^           <
*/
      {'code' : '0.1>:.:00p+00g\\v\n' '^           <',
        'input' : '',
        'expectedOutput' :
        BefungeOutput(
            Output: '0 1',
            Error: 'befunge_error_infinite_loop',
            Iteration: '', curPosX: '', curPosY: '',
            BefungeStack: [], PC: [], Command: [], Mnemonic: [])},

       // https://github.com/catseye/Befunge-93/blob/master/eg/chars.bf
/*
25*3*4+>:."=",:,25*,1+:88*2*-#v_@\n
       ^                      <
*/
      {'code' : '25*3*4+>:."=",:,25*,1+:88*2*-#v_@\n' '^                             <',
        'input' : '',
        'expectedOutput' :
        BefungeOutput(
          //Output: '34 ="\n35 =#\n36 =\$\n37 =%\n38 =&\n39 =\'\n40 =(\n41 =)\n42 =*\n43 =+\n44 =,\n45 =-\n46 =.\n47 =/\n48 =0\n49 =1\n50 =2\n51 =3\n52 =4\n53 =5\n54 =6\n55 =7\n56 =8\n57 =9\n58 =:\n59 =;\n60 =<\n61 ==\n62 =>\n63 =?\n64 =@\n65 =A\n66 =B\n67 =C\n68 =D\n69 =E\n70 =F\n71 =G\n72 =H\n73 =I\n74 =J\n75 =K\n76 =L\n77 =M\n78 =N\n79 =O\n80 =P\n81 =Q\n82 =R\n83 =S\n84 =T\n85 =U\n86 =V\n87 =W\n88 =X\n89 =Y\n90 =Z\n91 =[\n92 =\\\n93 =]\n94 =^\n95 =_\n96 =`\n97 =a\n98 =b\n99 =c\n100 =d\n101 =e\n102 =f\n103 =g\n104 =h\n105 =i\n106 =j\n107 =k\n108 =l\n109 =m\n110 =n\n111 =o\n112 =p\n113 =q\n114 =r\n115 =s\n116 =t\n117 =u\n118 =v\n119 =w\n120 =x\n121 =y\n122 =z\n123 ={\n124 =|\n125 =}\n126 =~\n127 =',
            Output: '34 ="',
            Error: 'befunge_error_infinite_loop', Iteration: '', curPosX: '', curPosY: '',
            BefungeStack: [], PC: [], Command: [], Mnemonic: [])},

/* Sieve of Eratosthenes
2>:3g" "-!v\  g30          <
 |!`"O":+1_:.:03p>03g+:"O"`|
 @               ^  p3\" ":<
2 234567890123456789012345678901234567890123456789012345678901234567890123456789
*/
      {'code' : '2>:3g" "-!v\\  g30          <\n' '|!`"O":+1_:.:03p>03g+:"O"`|\n' '@               ^  p3\\" ":<\n' '2 234567890123456789012345678901234567890123456789012345678901234567890123456789',
        'input' : '',
        'expectedOutput' :
        BefungeOutput(
            Output: '', Iteration: '', curPosX: '', curPosY: '',
            Error: 'befunge_error_infinite_loop',


File exist anymore! Skipping.")
        return Result.failure()
      }

      val stream = try {
        SignalDatabase.attachments.getAttachmentStream(attachment.attachmentId, offset = 0)
      } catch (e: IOException) {
        Log.w(TAG, "Could not open a stream for ${attachment.attachmentId}. Assuming that the file no longer exists. Skipping.", e)
        return Result.failure()
      }

      // In order to match the exact digest calculation, we need to use the same padding that we would use when uploading the attachment.
      Pair(attachment.remoteKey?.let { Base64.decode(it) }, PaddingInputStream(stream, attachment.size))
    }

    val key = originalKey ?: Util.getSecretBytes(64)

    val cipherOutputStream = AttachmentCipherOutputStream(key, iv = null, NullOutputStream)
    decryptingStream.copyTo(cipherOutputStream)

    val digest = cipherOutputStream.transmittedDigest

    SignalDatabase.attachments.updateRemoteKeyAndDigestByDataFile(
      dataFile = dataFile,
      key = key,
      digest = digest
    )

    return Result.success()
  }

  override fun onFailure() {
    Log.w(TAG, "Failed to backfill digest for file $dataFile!")
  }

  class Factory : Job.Factory<BackfillDigestsForDataFileJob> {
    override fun create(parameters: Parameters, serializedData: ByteArray?): BackfillDigestsForDataFileJob {
      val dataFile = (BackfillDigestsForDataFileJobData.ADAPTER.decode(serializedData!!).dataFile)
      return BackfillDigestsForDataFileJob(dataFile, parameters)
    }
  }
}
/*
 * Copyright 2023 Signal Messenger, LLC
 * SPDX-License-Identifier: AGPL-3.0-only
 */

package org.thoughtcrime.securesms.jobs

import androidx.annotation.WorkerThread
import org.signal.core.util.logging.Log
import org.thoughtcrime.securesms.groups.GroupId
import org.thoughtcrime.securesms.jobmanager.Job
import org.thoughtcrime.securesms.jobmanager.JsonJobData
import org.thoughtcrime.securesms.jobmanager.impl.ChangeNumberConstraint
import org.thoughtcrime.securesms.messages.ExceptionMetadata
import org.thoughtcrime.securesms.messages.MessageContentProcessor
import org.thoughtcrime.securesms.messages.MessageState
import org.thoughtcrime.securesms.recipients.Recipient

/**
 * Process messages that did not decrypt/validate successfully.
 */
class PushProcessMessageErrorJob private constructor(
  parameters: Parameters,
  private val messageState: MessageState,
  private val exceptionMetadata: ExceptionMetadata,
  private val timestamp: Long
) : BaseJob(parameters) {

  constructor(messageState: MessageState, exceptionMetadata: ExceptionMetadata, timestamp: Long) : this(
    parameters = createParameters(exceptionMetadata),
    messageState = messageState,
    exceptionMetadata = exceptionMetadata,
    timestamp = timestamp
  )

  override fun getFactoryKey(): String = KEY

  override fun shouldTrace(): Boolean = true

  override fun serialize(): ByteArray? {
    return JsonJobData.Builder()
      .putInt(KEY_MESSAGE_STATE, messageState.ordinal)
      .putLong(KEY_TIMESTAMP, timestamp)
      .putString(KEY_EXCEPTION_SENDER, exceptionMetadata.sender)
      .putInt(KEY_EXCEPTION_DEVICE, exceptionMetadata.senderDevice)
      .putString(KEY_EXCEPTION_GROUP_ID, exceptionMetadata.groupId?.toString())
      .serialize()
  }

  override fun onRun() {
    if (messageState == MessageState.DECRYPTED_OK || messageState == MessageState.NOOP) {
      Log.w(TAG, "Error job queued for valid or no-op decryption, generally this shouldn't happen. Bailing on state: $messageState")
      return
    }

    MessageContentProcessor.create(context).processException(messageState, exceptionMetadata, timestamp)
  }

  override fun onShouldRetry(e


ting navpolys
        if (!Utils.areCollinear(edge, otherEdge)) { continue; }

        // If they are collinear, check if they overlap
        const overlap: [Vector2, Vector2] = this._getSegmentOverlap(edge, otherEdge);
        if (!overlap) { continue; }

        // Connections are symmetric!
        navPoly.neighbors.push(otherNavPoly);
        otherNavPoly.neighbors.push(navPoly);

        // Calculate the portal between the two polygons - this needs to be in
        // counter-clockwise order, relative to each polygon
        const [p1, p2]: [Vector2, Vector2] = overlap;
        let edgeStartAngle: number = navPoly.centroid.angle(edge.start);
        let a1: number = navPoly.centroid.angle(overlap[0]);
        let a2: number = navPoly.centroid.angle(overlap[1]);
        let d1: number = Utils.angleDifference(edgeStartAngle, a1);
        let d2: number = Utils.angleDifference(edgeStartAngle, a2);
        if (d1 < d2) {
          navPoly.portals.push(new Line(p1.x, p1.y, p2.x, p2.y));
        } else {
          navPoly.portals.push(new Line(p2.x, p2.y, p1.x, p1.y));
        }

        edgeStartAngle = otherNavPoly.centroid.angle(otherEdge.start);
        a1 = otherNavPoly.centroid.angle(overlap[0]);
        a2 = otherNavPoly.centroid.angle(overlap[1]);
        d1 = Utils.angleDifference(edgeStartAngle, a1);
        d2 = Utils.angleDifference(edgeStartAngle, a2);
        if (d1 < d2) {
          otherNavPoly.portals.push(new Line(p1.x, p1.y, p2.x, p2.y));
        } else {
          otherNavPoly.portals.push(new Line(p2.x, p2.y, p1.x, p1.y));
        }

        // Two convex polygons shouldn't be connected more than once! (Unless
        // there are unnecessary vertices...)
      }
    }
  }

  // Check two collinear line segments to see if they overlap by sorting the points.
  // Algorithm source: http://stackoverflow.com/a/17152247
  private _getSegmentOverlap(line1: Line, line2: Line): [Vector2, Vector2] {
    type lineAndPoint = { line: Line; point: Vector2 };
    const points: lineAndPoint[] = [
      { line: line1, point: line1.start },
      { line: line1, point: line1.end },
      { line: line2, point: line2.start },
      { line: line2, point: line2.end }
    ];
    points.sort((a: lineAndPoint, b: lineAndPoint) => {
      if (a.point.x < b.point.x) { return -1; } else if (a.point.x > b.point.x) { return 1; } else {
        if (a.point.y < b.point.y) { return -1; } else if (a.point.y > b.point.y) { return 1; } else { return 0; }
      }
    });
    // If the first two points in the array come from the same line, no overlap
    const noOverlap: boolean = points[0].line === points[1].line;
    // If the two middle points in the array are the same coordinates, then there is a
    // single point of overlap.
    const singlePointOverlap: boolean = points[1].point.equals(points[2].point);
    if (noOverlap || singlePointOverlap) { return null; } else { return [points[1].point, points[2].point]; }
  }

  /**
   * Project a point onto a polygon in the shortest distance possible.
   *
   * @param point The point to project
   * @param navPoly The navigation polygon to test against
   */
  private _projectPointToPolygon(point: Vector2, nav


ontext.callMethod(0, MethodBindings.fromDictionaryPtr, OBJECT)
      return (TransferContext.readReturnValue(OBJECT) as GLTFLight?)
    }
  }

  public object MethodBindings {
    internal val fromNodePtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "from_node", 3907677874)

    internal val toNodePtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "to_node", 2040811672)

    internal val fromDictionaryPtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "from_dictionary", 4057087208)

    internal val toDictionaryPtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "to_dictionary", 3102165223)

    internal val getColorPtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "get_color", 3200896285)

    internal val setColorPtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "set_color", 2920490490)

    internal val getIntensityPtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "get_intensity", 191475506)

    internal val setIntensityPtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "set_intensity", 373806689)

    internal val getLightTypePtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "get_light_type", 2841200299)

    internal val setLightTypePtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "set_light_type", 83702148)

    internal val getRangePtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "get_range", 191475506)

    internal val setRangePtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "set_range", 373806689)

    internal val getInnerConeAnglePtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "get_inner_cone_angle", 191475506)

    internal val setInnerConeAnglePtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "set_inner_cone_angle", 373806689)

    internal val getOuterConeAnglePtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "get_outer_cone_angle", 191475506)

    internal val setOuterConeAnglePtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "set_outer_cone_angle", 373806689)

    internal val getAdditionalDataPtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "get_additional_data", 2138907829)

    internal val setAdditionalDataPtr: VoidPtr =
        TypeManager.getMethodBindPtr("GLTFLight", "set_additional_data", 3776071444)
  }
}
// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY!
@file:Suppress("PackageDirectoryMismatch", "unused", "FunctionName", "RedundantModalityModifier",
    "UNCHECKED_CAST", "JoinDeclarationAndAssignment", "USELESS_CAST",
    "RemoveRedundantQualifierName", "NOTHING_TO_INLINE", "NON_FINAL_MEMBER_IN_OBJECT",
    "RedundantVisibilityModifier", "RedundantUnitReturnType", "MemberVisibilityCanBePrivate")

package godot.api

import godot.`annotation`.GodotBaseType
import godot.`internal`.memory.TransferContext
import godot.`internal`.reflection.TypeManager
import godot.common.interop.VoidPtr
import godot.core.Dictionary
import godot.core.VariantParser.BOOL
import godot.core.VariantParser.DICTIONARY
import godot.core.VariantParser.DOUBLE
import godot.core.VariantParser.NIL
import godot.core.VariantParser.OBJECT
import kotlin.Any
import kotlin.Boolean
import kotlin.Double
import kotlin.Float
import kotlin.Int
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName


new BufferedImage(dst_width, dst_height,  BufferedImage.TYPE_INT_RGB);
            int height_i = 0;
            for (int i = 0; i < images.length; i++) {
                ImageNew.setRGB(0, height_i, dst_width, images[i].getHeight(),  imageArrays[i], 0, dst_width);
                height_i += images[i].getHeight();
            }
            File outFile = new File(dst_pic);
            ImageIO.write(ImageNew, type, outFile);// 写图片
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true;
    }

    /**
     * 合并图片(按指定初始x、y坐标将附加图片贴到底图之上)
     * @param negativeImagePath 背景图片路径
     * @param additionImagePath	附加图片路径
     * @param x 附加图片的起始点x坐标
     * @param y  附加图片的起始点y坐标
     * @param toPath 图片写入路径
     * @throws IOException
     */
    public void mergeBothImage(String negativeImagePath,String additionImagePath,int x,int y,String toPath ) throws IOException{
    	InputStream is= null;
    	InputStream is2= null;
    	OutputStream os = null;
    	try{
    		is=new FileInputStream(negativeImagePath);
            is2=new FileInputStream(additionImagePath);
            BufferedImage image=ImageIO.read(is);
            BufferedImage image2=ImageIO.read(is2);
            Graphics g=image.getGraphics();
            g.drawImage(image2,x,y,null);
            os = new FileOutputStream(toPath);
            JPEGImageEncoder enc=JPEGCodec.createJPEGEncoder(os);
            enc.encode(image);
    	}catch(Exception e){
    		e.printStackTrace();
    	}finally{
    		if(os != null){
    			os.close();
    		}
    		if(is2 != null){
    			is2.close();
    		}
    		if(is != null){
    			is.close();
    		}
    	}
    }

    /**
     * 将一组图片一次性附加合并到底图上
     * @param negativeImagePath		源图像（底图）路径
     * @param additionImageList	附加图像信息列表
     * @param imageFormat	图像写入格式
     * @param toPath	图像写入路径
     * @throws IOException
     */
    public void mergeImageList(String negativeImagePath,List additionImageList,String imageFormat, String toPath) throws IOException{
    	InputStream is= null;
    	InputStream is2= null;
    	OutputStream os = null;
    	try{
    		is=new FileInputStream(negativeImagePath);
    		BufferedImage image=ImageIO.read(is);
    		//Graphics g=image.getGraphics();
    		Graphics2D g = image.createGraphics();;
    		BufferedImage image2 = null;
    		if(additionImageList != null){
    			for(int i=0;i<additionImageList.size();i++){
    				//解析附加图片信息：x坐标、 y坐标、 additionImagePath附加图片路径
    				//图片信息存储在一个数组中
    				String[] additionImageInfo = (String[]) additionImageList.get(i);
    				int x = Integer.parseInt(additionImageInfo[0]);
    				int y = Integer.parseInt(additionImageInfo[1]);
    				String additionImagePath = additionImageInfo[2];
    				//读取文件输入流，并合并图片
    				is2 = new FileInputStream


, e: 1, <caret>, }}"""
                to (setOf("a", "b", "d", "f")
                to setOf("c", "e")),

        """{ a: foo, b: [{e: 12, f: g, fe:f, f: <caret> }], c: 2, d: { c: 2, e: 1,}}"""
                to (setOf("foo", "12", "g", "f", "2", "1") to setOf("b", "c", "e")),
        """{ a: foo, b: [{e: 12, f: g, fe:f, f: fo<caret> }], c: 2, d: { c: 2, e: 1,}}"""
                to (setOf("foo") to setOf("b", "c", "e", "12", "g", "f", "2", "1")),
        """{ a: foo, b: [{e: 12, f: g, fe:f, f: "<caret>" }], c: 2, d: { c: 2, e: 1,}}"""
                to (setOf("foo", "12", "g", "f", "2", "1") to setOf("b", "c", "e")),
        """{ a: foo, b: [{e: 12, f: g, fe:f, f: "fo<caret>" }], c: 2, d: { c: 2, e: 1,}}"""
                to (setOf("foo") to setOf("b", "c", "e", "12", "g", "f", "2", "1")),
        """[foo, bar, 12, [{g: e}], <caret>]""" to (setOf("foo", "bar", "12", "e") to setOf("g"))
    )

    fun testCompletions() =
        TESTS.forEach {
            doTest(it.first, it.second.first, it.second.second)
        }

    private fun doTest(content: String, expectedResults: Set<String>, notExpectedResults: Set<String>) {
        configureByText("test.lson", content)

        assertNotNull(myFixture.complete(CompletionType.BASIC, 1))

        val result = myFixture.lookupElementStrings ?: throw AssertionError()

        result.forEach { str ->
            assertFalse("Not expected to find '$str'. Content:\n $content", str in notExpectedResults)
        }

        expectedResults.forEach { str ->
            assertTrue(
                "Expected to find '$str'. Found: " +
                        result.joinToString { "'$it'" } +
                        ", Content: '$content'",
                str in result
            )
        }

    }

}
package com.gmail.blueboxware.libgdxplugin.assetsInCode

import com.gmail.blueboxware.libgdxplugin.LibGDXCodeInsightFixtureTestCase

/*
 * Copyright 2017 Blue Box Ware
 *
 * 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.
 */
abstract class AssetsInCodeCodeInsightFixtureTestCase : LibGDXCodeInsightFixtureTestCase() {

    override fun setUp() {
        super.setUp()

        addLibGDX()
        addAnnotations()
        addKotlin()

        listOf(
            "assets/libgdx.skin",
            "assets/dir/holo.json",
            "assets/dir/holo.skin",
            "assets/dir/skin.json",
            "assets/dir/test.pack",
            "assets/dir/something",
            "assets/libgdx.atlas",
            "assets/dir/holo.atlas",
            "assets/test.properties",
            "assets/test_en.properties",
            "assets/test_en_GB.properties",
            "assets/dir/foo.properties",
            "assets/dir/foo_es.properties"
        ).forEach {
            copyFileToProject(it)
        }

        copyFileToProject("src/JavaSkinTest.java", "JavaSkinTest.java")
        copyFileToProject("src/KotlinSkinTest.kt"


	R_PPC_GOT16           R_PPC = 14
	R_PPC_GOT16_LO        R_PPC = 15
	R_PPC_GOT16_HI        R_PPC = 16
	R_PPC_GOT16_HA        R_PPC = 17
	R_PPC_PLTREL24        R_PPC = 18
	R_PPC_COPY            R_PPC = 19
	R_PPC_GLOB_DAT        R_PPC = 20
	R_PPC_JMP_SLOT        R_PPC = 21
	R_PPC_RELATIVE        R_PPC = 22
	R_PPC_LOCAL24PC       R_PPC = 23
	R_PPC_UADDR32         R_PPC = 24
	R_PPC_UADDR16         R_PPC = 25
	R_PPC_REL32           R_PPC = 26
	R_PPC_PLT32           R_PPC = 27
	R_PPC_PLTREL32        R_PPC = 28
	R_PPC_PLT16_LO        R_PPC = 29
	R_PPC_PLT16_HI        R_PPC = 30
	R_PPC_PLT16_HA        R_PPC = 31
	R_PPC_SDAREL16        R_PPC = 32
	R_PPC_SECTOFF         R_PPC = 33
	R_PPC_SECTOFF_LO      R_PPC = 34
	R_PPC_SECTOFF_HI      R_PPC = 35
	R_PPC_SECTOFF_HA      R_PPC = 36
	R_PPC_TLS             R_PPC = 67
	R_PPC_DTPMOD32        R_PPC = 68
	R_PPC_TPREL16         R_PPC = 69
	R_PPC_TPREL16_LO      R_PPC = 70
	R_PPC_TPREL16_HI      R_PPC = 71
	R_PPC_TPREL16_HA      R_PPC = 72
	R_PPC_TPREL32         R_PPC = 73
	R_PPC_DTPREL16        R_PPC = 74
	R_PPC_DTPREL16_LO     R_PPC = 75
	R_PPC_DTPREL16_HI     R_PPC = 76
	R_PPC_DTPREL16_HA     R_PPC = 77
	R_PPC_DTPREL32        R_PPC = 78
	R_PPC_GOT_TLSGD16     R_PPC = 79
	R_PPC_GOT_TLSGD16_LO  R_PPC = 80
	R_PPC_GOT_TLSGD16_HI  R_PPC = 81
	R_PPC_GOT_TLSGD16_HA  R_PPC = 82
	R_PPC_GOT_TLSLD16     R_PPC = 83
	R_PPC_GOT_TLSLD16_LO  R_PPC = 84
	R_PPC_GOT_TLSLD16_HI  R_PPC = 85
	R_PPC_GOT_TLSLD16_HA  R_PPC = 86
	R_PPC_GOT_TPREL16     R_PPC = 87
	R_PPC_GOT_TPREL16_LO  R_PPC = 88
	R_PPC_GOT_TPREL16_HI  R_PPC = 89
	R_PPC_GOT_TPREL16_HA  R_PPC = 90
	R_PPC_EMB_NADDR32     R_PPC = 101
	R_PPC_EMB_NADDR16     R_PPC = 102
	R_PPC_EMB_NADDR16_LO  R_PPC = 103
	R_PPC_EMB_NADDR16_HI  R_PPC = 104
	R_PPC_EMB_NADDR16_HA  R_PPC = 105
	R_PPC_EMB_SDAI16