PyCThostFtdcLinkManField_get_ZipCode, (setter)PyCThostFtdcLinkManField_set_ZipCode, (char *)"ZipCode", NULL},
	 {(char *)"Priority", (getter)PyCThostFtdcLinkManField_get_Priority, (setter)PyCThostFtdcLinkManField_set_Priority, (char *)"Priority", NULL},
	 {(char *)"UOAZipCode", (getter)PyCThostFtdcLinkManField_get_UOAZipCode, (setter)PyCThostFtdcLinkManField_set_UOAZipCode, (char *)"UOAZipCode", NULL},
	 {(char *)"PersonFullName", (getter)PyCThostFtdcLinkManField_get_PersonFullName, (setter)PyCThostFtdcLinkManField_set_PersonFullName, (char *)"PersonFullName", NULL},

    {NULL}
};

PyTypeObject PyCThostFtdcLinkManFieldType = {
	PyVarObject_HEAD_INIT(NULL, 0)  /* ob_base */
	"CThostFtdcLinkManField",	/* tp_name */
	sizeof(PyCThostFtdcLinkManField),/* tp_basicsize */
	0,                          /* tp_itemsize */
	(destructor)PyCThostFtdcLinkManField_dealloc,/* tp_dealloc */
	0,                          /* tp_print */
	0,                          /* tp_getattr */
	0,                          /* tp_setattr */
	0,                          /* tp_reserved */
	(reprfunc)PyCThostFtdcLinkManField_repr,   /* tp_repr */
	0,                          /* tp_as_number */
	0,                          /* tp_as_sequence */
	0,                          /* tp_as_mapping */
	0,                          /* tp_hash  */
	0,                          /* tp_call */
	0,                          /* tp_str */
	0,                          /* tp_getattro */
	0,                          /* tp_setattro */
	0,                          /* tp_as_buffer */
	Py_TPFLAGS_DEFAULT,         /* tp_flags */
	"CThostFtdcLinkManField",           /* tp_doc */
	0,                          /* tp_traverse */
	0,                          /* tp_clear */
	0,                          /* tp_richcompare */
	0,                          /* tp_weaklistoffset */
	0,                          /* tp_iter */
	0,                          /* tp_iternext */
	0,                          /* tp_methods */
	0,                          /* tp_members */
	PyCThostFtdcLinkManField_getset,   /* tp_getset */
	0,                          /* tp_base */
	0,                          /* tp_dict */
	0,                          /* tp_descr_get */
	0,                          /* tp_descr_set */
	0,                          /* tp_dictoffset */
	(initproc)PyCThostFtdcLinkManField_init, /* tp_init */
	0,                          /* tp_alloc */
	PyCThostFtdcLinkManField_new,       /* tp_new */
};

int PyCThostFtdcLinkManFieldType_init(PyObject *module) {

	/* 准备好对象使用 CThostFtdcLinkManField  */
	if (PyType_Ready(&PyCThostFtdcLinkManFieldType) < 0) {
		PyErr_SetString(PyExc_RuntimeError, "can't initialize PyCTP.CThostFtdcLinkManField");
		return -1;
	}

    Py_


4CNF_WEAPONS", index)
        menu.trigger_commands("hccprefreshboard")
    end)

    menu.list_action(PERICO_HEIST, TRANSLATE("Equipment Spawn Location"), {"hccpequipment"}, "", {
        { 1, TRANSLATE("Airport"), {"airport"}, TRANSLATE("- Guard Clothing") .. "\n" .. TRANSLATE("- Bolt Cutters") },
        { 2, TRANSLATE("Docks"), {"dock"}, TRANSLATE("- Guard Clothing") .. "\n" .. TRANSLATE("- Bolt Cutters") },
        { 3, TRANSLATE("Compound"), {"compound"}, TRANSLATE("- Guard Clothing") .. "\n" .. TRANSLATE("- Bolt Cutters") },
    }, function(index)
        if index == 1 then
            STAT_SET_INT("H4CNF_GRAPPEL", 2022)
            STAT_SET_INT("H4CNF_UNIFORM", 12)
            STAT_SET_INT("H4CNF_BOLTCUT", 4161)
            STAT_SET_INT("H4CNF_TROJAN", 1)
        elseif index == 2 then
            STAT_SET_INT("H4CNF_GRAPPEL", 3671)
            STAT_SET_INT("H4CNF_UNIFORM", 5256)
            STAT_SET_INT("H4CNF_BOLTCUT", 4424)
            STAT_SET_INT("H4CNF_TROJAN", 2)
        elseif index == 3 then
            STAT_SET_INT("H4CNF_GRAPPEL", 85324)
            STAT_SET_INT("H4CNF_UNIFORM", 61034)
            STAT_SET_INT("H4CNF_BOLTCUT", 4612)
            STAT_SET_INT("H4CNF_TROJAN", 5)
        end

        menu.trigger_commands("hccprefreshboard")
    end)

    menu.list_action(PERICO_HEIST, TRANSLATE("Supply Truck Location"), {"hccptruck"}, "", {
        { 1, TRANSLATE("Airport"), {"airport"}, "" },
        { 2, TRANSLATE("North Dock"), {"ndock"}, "" },
        { 3, TRANSLATE("Main Dock (East)"), {"edock"}, "" },
        { 4, TRANSLATE("Main Dock (West)"), {"wdock"}, "" },
        { 5, TRANSLATE("Compound"), {"compound"}, "" },
    }, function(index)
        STAT_SET_INT("H4CNF_TROJAN", index)
        menu.trigger_commands("hccprefreshboard")
    end)

    menu.list_action(PERICO_HEIST, TRANSLATE("Heist Difficulty"), {"hccpdifficulty"}, "", {
        { 1, TRANSLATE("Normal"), {"normal"}, "" },
        { 2, TRANSLATE("Hard"), {"hard"}, "" },
    }, function(index)
        if index == 1 then
            STAT_SET_INT("H4_PROGRESS", 126823)
        elseif index == 2 then
            STAT_SET_INT("H4_PROGRESS", 131055)
        end

        menu.trigger_commands("hccprefreshboard")
    end)

    CP_MORE_OPTIONS = menu.list(PERICO_HEIST, TRANSLATE("Others"), {}, "", function(); end)

        menu.action(CP_MORE_OPTIONS, TRANSLATE("Complete All Prep Missions"), {}, "", function()
            STAT_SET_INT("H4_MISSIONS", -1)
            STAT_SET_INT("H4CNF_APPROACH", -1)
            STAT_SET_INT("H4CNF_BS_ENTR", 63)
            STAT_SET_INT("H4CNF_BS_GEN", 63)
            STAT_SET_INT("H4CNF_WEP_DISRP", 3)
            STAT_SET_INT("H4CNF_ARM_DISRP", 3)
            STAT_SET_INT("H4CNF_HEL_DISRP", 3)

            menu.trigger_commands("hccprefreshboard")
        end)

        menu.action(CP_MORE_OPTIONS, TRANSLATE("Set Heist to Default (Reset)"), {"hccpreset"}, "", function()
            STAT_SET_


xt.} {MA} {N } {2:} {row 14, column 00, with plain white text.} {row 14, column 00, with plain white text.} {E } {eq} {ua} {ls} { m} { c} {-s} {qu} {ar} {ed} { i} {s} {row 15, column 00, with plain white text.} {row 15, column 00, with plain white text.} {no} {t } {ab} {ou} {t } {an} { o} {ld} { E} {in} {st} {ei} {n.} {Erase Displayed Memory} {Erase Displayed Memory} {End Of Caption} {End Of Caption}

00:00:25:16 {Erase Non-displayed Memory} {Erase Non-displayed Memory} {Resume Caption Loading} {Resume Caption Loading} {row 13, column 00, with plain white text.} {row 13, column 00, with plain white text.} {MA} {N } {2:} {row 14, column 00, with plain white text.} {row 14, column 00, with plain white text.} {It} {'s} { a} {ll} { a} {bo} {ut} { a} {n } {et} {er} {na} {l} {row 15, column 00, with plain white text.} {row 15, column 00, with plain white text.} {Ei} {ns} {te} {in} {.} {Erase Displayed Memory} {Erase Displayed Memory} {End Of Caption} {End Of Caption}

00:00:31:15 {Erase Non-displayed Memory} {Erase Non-displayed Memory} {Resume Caption Loading} {Resume Caption Loading} {row 15, column 00, with plain white text.} {row 15, column 00, with plain white text.} {<L} {AU} {GH} {IN} {G } {& } {WH} {OO} {PS} {!>} {Erase Displayed Memory} {Erase Displayed Memory} {End Of Caption} {End Of Caption}

00:00:36:04 {Erase Displayed Memory} {Erase Displayed Memory}

"""

@pytest.fixture(scope="session")
def sample_translated_scc_special_and_extended_characters():
    return """Scenarist_SCC V1.0

00:00:16;29 [ ] [®] [°] [½] [¿] [™] [¢] [£]

00:04:36;06 [♪] [à] [ ] [è] [â] [ê] [î] [ô] [û]

00:08:00;00 [É] [Ó] [Ú] [Ü] [ü] [‘] [¡] [*] [’] [—] [©]

00:12:00;23 [℠] [•] [“] [”] [À] [Â] [Ç] [È] [Ê] [Ë] [ë] [Î] [Ï]

00:16:24;11 [ï] [Ô] [Ù] [ù] [Û] [«] [»] [Ã] [ã] [Í] [Ì] [ì] [Ò]

00:20:19;12 [ò] [Õ] [õ] [{] [}] [\\] [^] [_] [¦] [~] [Ä] [ä] [Ö]

00:24:39;28 [ö] [ß] [¥] [¤] [|] [Å] [å] [Ø] [ø] [┌] [┐] [└] [┘]
"""


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#pragma once

/*
 * This file defines RunOptions Config Keys and format of the Config Values.
 *
 * The Naming Convention for a RunOptions Config Key,
 * "[Area][.[SubArea1].[SubArea2]...].[Keyname]"
 * Such as "ep.cuda.use_arena"
 * The Config Key cannot be empty
 * The maximum length of the Config Key is 128
 *
 * The string format of a RunOptions Config Value is defined individually for each Config.
 * The maximum length of the Config Value is 1024
 */

// Key for enabling shrinkages of user listed device memory arenas.
// Expects a list of semi-colon separated key value pairs separated by colon in the following format:
// "device_0:device_id_0;device_1:device_id_1"
// No white-spaces allowed in the provided list string.
// Currently, the only supported devices are : "cpu", "gpu" (case sensitive).
// If "cpu" is included in the list, DisableCpuMemArena() API must not be called (i.e.) arena for cpu should be enabled.
// Example usage: "cpu:0;gpu:0" (or) "gpu:0"
// By default, the value for this key is empty (i.e.) no memory arenas are shrunk
static const char* const kOrtRunOptionsConfigEnableMemoryArenaShrinkage = "memory.enable_memory_arena_shrinkage";

// Set to '1' to not synchronize execution providers with CPU at the end of session run.
// Per default it will be set to '0'
// Taking CUDA EP as an example, it omit triggering cudaStreamSynchronize on the compute stream.
static const char* const kOrtRunOptionsConfigDisableSynchronizeExecutionProviders = "disable_synchronize_execution_providers";

// Set HTP performance mode for QNN HTP backend before session run.
// options for HTP performance mode: "burst", "balanced", "default", "high_performance",
// "high_power_saver", "low_balanced", "extreme_power_saver", "low_power_saver", "power_saver",
// "sustained_high_performance". Default to "default".
static const char* const kOrtRunOptionsConfigQnnPerfMode = "qnn.htp_perf_mode";

// Set HTP performance mode for QNN HTP backend post session run.
static const char* const kOrtRunOptionsConfigQnnPerfModePostRun = "qnn.htp_perf_mode_post_run";

// Set RPC control latency for QNN HTP backend
static const char* const kOrtRunOptionsConfigQnnRpcControlLatency = "qnn.rpc_control_latency";

// Set graph annotation id for CUDA EP. Use with enable_cuda_graph=true.
// The value should be an integer. If the value is not set, the default value is 0 and
// ORT session only captures one cuda graph before another capture is requested.
// If the value is set to -1, cuda graph capture/replay is disabled in that run.
// User are not expected to set the value to 0 as it is reserved for internal use.
static const char* const kOrtRunOptionsConfigCudaGraphAnnotation = "gpu_graph_id";


E SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND
// LIMITATIONS UNDER THE License.
// GITCODE: https://gitcode.com/AntdUI/AntdUI
// GITEE: https://gitee.com/AntdUI/AntdUI
// GITHUB: https://github.com/AntdUI/AntdUI
// CSDN: https://blog.csdn.net/v_132
// QQ: 17379620

namespace AntdUI
{
    /// <summary>
    /// 交互行为
    /// </summary>
    public enum Trigger
    {
        /// <summary>
        /// 点击
        /// </summary>
        Click,
        /// <summary>
        /// 悬浮
        /// </summary>
        Hover,
        /// <summary>
        /// 双击
        /// </summary>
        DoubleClick
    }
}


mestamp(&self) -> Timestamp {
        Timestamp {
            seconds: self.secs(),
            nanos: self.sub_nanos(),
        }
    }
}

impl Add<Duration> for Instant {
    type Output = Instant;

    fn add(self, rhs: Duration) -> Self::Output {
        if rhs.nanos().is_negative() {
            Instant {
                inner: self.nanos() - rhs.nanos().unsigned_abs(),
            }
        } else {
            Instant {
                inner: self.nanos() + rhs.nanos().unsigned_abs(),
            }
        }
    }
}

impl AddAssign<Duration> for Instant {
    fn add_assign(&mut self, rhs: Duration) {
        *self = *self + rhs;
    }
}

impl Sub<Duration> for Instant {
    type Output = Instant;

    fn sub(self, rhs: Duration) -> Self::Output {
        self + -rhs
    }
}

impl SubAssign<Duration> for Instant {
    fn sub_assign(&mut self, rhs: Duration) {
        *self = *self - rhs;
    }
}

impl Sub<Instant> for Instant {
    type Output = Duration;

    fn sub(self, rhs: Instant) -> Self::Output {
        Duration::from_fixed_nanos(self.inner) - Duration::from_fixed_nanos(rhs.inner)
    }
}

impl Display for Instant {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.inner)
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn values() {
        assert_eq!(
            Instant::from_secs(10).nanos(),
            10_000_000_000u64.to_fixed::<U96F32>()
        );
        assert_eq!(
            Instant::from_millis(10).nanos(),
            10_000_000u64.to_fixed::<U96F32>()
        );
        assert_eq!(
            Instant::from_micros(10).nanos(),
            10_000u64.to_fixed::<U96F32>()
        );
        assert_eq!(Instant::from_nanos(10).nanos(), 10u64.to_fixed::<U96F32>());
        assert_eq!(
            Instant::from_fixed_nanos(10.123f64).nanos(),
            10.123f64.to_fixed::<U96F32>()
        );
        assert_eq!(Instant::from_secs(10).secs(), 10);
        assert_eq!(Instant::from_millis(10).secs(), 0);
        assert_eq!(Instant::from_millis(1001).secs(), 1);
    }
}
use crate::linear_object_pool::LinearObjectPool;
use crate::page::{Page, PageId};
use std::ops::{Deref, DerefMut};
use std::sync::Arc;

/// Wrapper over T used by [`LinearObjectPool`].
///
/// Access is allowed with [`std::ops::Deref`] or [`std::ops::DerefMut`]
/// # Example
/// ```rust
///  use lockfree_object_pool::LinearObjectPool;
///  use std::sync::Arc;
///
///  let pool = Arc::new(LinearObjectPool::<u32>::new(
///    ||  Default::default(),
///    |v| {
///      *v = 0;
///    }
///  ));
///  let mut item = pool.pull_owned();
///
///  *item = 5;
///  let work = *item * 5;
/// ```
pub struct LinearOwnedReusable<T> {
    pool: Arc<LinearObjectPool<T>>,
    page_id: PageId,
    page: *const Page<T


ce_version(bool set_to_zero = false);
## 二. 反向图相关类

### 2.1 AbstractAutogradMeta
AutogradMeta的基类，只有一个虚析构函数，不可以建立对象

### 2.2 AutogradMeta :public AbstractAutogradMeta
动态图模式下用于记录自动微分信息，当前向执行结束后仍可从此类中得到自动微分信息
grad_node:前向op对应的反向节点
grad:前向tensor的梯度tensor（只有叶子tensor默认有，非叶子tensor需要设置retain_grad为true
* 私有成员：
  * std::shared_ptr paddle::experimental::Tensor grad_{std::make_shared paddle::experimental::Tensor()};
tensor的梯度信息，构造一个shared_ptr指向tensor，grad_指向此tensor
  * std::shared_ptr grad_node_ = nullptr;
shared_ptr指向此tensor来源的反向算子（该反向算子的输出是此tensor)
  * size_t out_slot_id_; 记录此tensor是前向算子第几个输出（后向算子第几个输入）
  * size_t out_rank_; 记录一个输出tensor可能内部包含多个子向量的个数
                                       （Tensor X = （X0, X1, ...,Xn) Xi是一个向量
* int stop_gradient_{-1};  是否停止梯度计算
* bool persistable_{false};  是否可以被优化
* bool retain_grads_{false}; 是否需要保留梯度信息
* 公有成员：
     - 参数为Edge显式构造函数：AutogradMeta(const Edge& edge = Edge()) 赋值out_slot_id_，out_rank_，grad_node_
     - 析构函数 ~AutogradMeta() override = default
     - Grad（）：判断grad_是否为空，然后返回grad_的值
     - MutableGrad() :返回grad_的实例
     - WeakGrad()： 返回grad_的shared_ptr
     - SetGradNode(const std::shared_ptr<GradNodeBase>& grad_node): 设置grad_node_
     - GetMutableGradNode(): 返回grad_node_的Shared_ptr
     - GradNode(): 返回grad_node_的实例
     - SetSingleOutRankWithSlot(size_t slot_id, size_t rank)： 单独设置输出tensor个数和位置
     - OutRankInfo()：返回输出tensor个数和位置的pair对
     - IsInitialized() ：判断grad_node是否有值
     - bool StopGradient() { return stop_gradient_ != 0; } ：判断是否不需要梯度（true代表不需要梯度）
     - int NumericStopGradient() { return stop_gradient_; }：判断是否不需要梯度
     - SetStopGradient(bool stop_gradient) : 设置stopGradient
     - Persistable() ; SetPersistable(bool persistable)
     - RetainGrads(); SetRetainGrads(bool value)

          至此，我们通过下图描述上述结构如何在实际运行中存在，如图所示，在执行op时，需要a, b两个输入tensor, b tensor是last_op的输出,op的输出为c tensor, 其中a, b，c使用tensor 数据结构存储。如果这个op不需要反向计算，tensor中的autogradmeta 为 AbstractAutogradMeta类型，如果需要反向计算，则为AutogradMeta类型。对于tensor


/lightning/node/026af41af0e3861ba170cc0eef8f45a1015125dac57c28df53752dcaeea793b28f">BitcoinVN - 1/गतिशील | 6M न्यूनतम चैन | नोट 8/10 | वियतनाम एक्सचेंज / एलएसपी

⚡ FlashSats - 0/0 नीति | 5M न्यूनतम चैन | नोट 8/10 | इनबाउंड एलएसपी प्रदान करता है

⚡ LNServer - 0/0 नीति | 2M न्यूनतम चैन | नोट 8/10 | इनबाउंड एलएसपी प्रदान करता है

⚡ Megalithic - 0/0 नीति | 1M न्यूनतम चैन | नोट 9/10 | इनबाउंड LSP प्रदान करता है

एक्सचेंज / स्वैप नोड्स

लोग ऐसे एक्सचेंजों का अधिक उपयोग करना शुरू कर देते हैं जो LN पर निकासी की सुविधा देते हैं। और उन्हें लिक्विडिटी की आवश्यकता होती है और आप एक्सचेंजों और उपयोगकर्ताओं के बीच सेतु बन सकते हैं। आपके बैंक ग्राहक भी आपके बैंक चैनलों का उपयोग करके अधिक सैट्स खरीदना चाहते हैं।

इन नोड्स को अपनी तरफ़ से अधिक बैलेंस की आवश्यकता होती है। इसलिए आपको उनकी तरफ़ से अधिक सैट्स को आगे बढ़ाने की आवश्यकता होगी, ताकि उपयोगकर्ताओं की निकासी के लिए उनके पास अधिक लिक्विडिटी हो सके। ये व्यापारी चैनलों के साथ परिपत्र पुनर्संतुलन के लिए अच्छी जोड़ी हैं।


 return Observable.Create<Unit>(observer =>
            {
                UnityAction registerHandler = () => observer.OnNext(Unit.Default);
                graphic.RegisterDirtyMaterialCallback(registerHandler);
                return Disposable.Create(() => graphic.UnregisterDirtyMaterialCallback(registerHandler));
            });
        }

        public static IObservable<Unit> DirtyVerticesCallbackAsObservable(this Graphic graphic)
        {
            return Observable.Create<Unit>(observer =>
            {
                UnityAction registerHandler = () => observer.OnNext(Unit.Default);
                graphic.RegisterDirtyVerticesCallback(registerHandler);
                return Disposable.Create(() => graphic.UnregisterDirtyVerticesCallback(registerHandler));
            });
        }
    }
}

#endif


p:.4em;padding-bottom:.5em;margin-top:.75em}.quarto-title .quarto-categories .quarto-category{padding:.25em .75em;font-size:.65em;text-transform:uppercase;border:solid 1px;border-radius:.25rem;opacity:.6}.quarto-title .quarto-categories .quarto-category a{color:inherit}#title-block-header.quarto-title-block.default .quarto-title-meta{display:grid;grid-template-columns:repeat(2, 1fr)}#title-block-header.quarto-title-block.default .quarto-title .title{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-author-orcid img{margin-top:-5px}#title-block-header.quarto-title-block.default .quarto-description p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p,#title-block-header.quarto-title-block.default .quarto-title-authors p,#title-block-header.quarto-title-block.default .quarto-title-affiliations p{margin-bottom:.1em}#title-block-header.quarto-title-block.default .quarto-title-meta-heading{text-transform:uppercase;margin-top:1em;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-contents{font-size:.9em}#title-block-header.quarto-title-block.default .quarto-title-meta-contents a{color:#212529}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p.affiliation:last-of-type{margin-bottom:.7em}#title-block-header.quarto-title-block.default p.affiliation{margin-bottom:.1em}#title-block-header.quarto-title-block.default .description,#title-block-header.quarto-title-block.default .abstract{margin-top:0}#title-block-header.quarto-title-block.default .description>p,#title-block-header.quarto-title-block.default .abstract>p{font-size:.9em}#title-block-header.quarto-title-block.default .description>p:last-of-type,#title-block-header.quarto-title-block.default .abstract>p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .description .abstract-title,#title-block-header.quarto-title-block.default .abstract .abstract-title{margin-top:1em;text-transform:uppercase;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-author{display:grid;grid-template-columns:1fr 1fr}.quarto-title-tools-only{display:flex;justify-content:right}/*# sourceMappingURL=397ef2e52d54cf686e4908b90039e9db.css.map */
/* quarto syntax highlight colors */
:root {
  --quarto-hl-ot-color: #003B4F;
  --quarto-hl-at-color: #657422;
  --quarto-hl-ss-color: #20794D;
  --quarto-hl-an-color: #5E5E5E;
  --


.color(0x80471C).iconSet(ROUGH)
                .build();

        Gelatin = new Material.Builder(1607, gregtechId("gelatin"))
                .dust(1)
                .color(0x588BAE).iconSet(ROUGH)
                .build();

        Agar = new Material.Builder(1608, gregtechId("agar"))
                .dust(1)
                .color(0x4F7942).iconSet(ROUGH)
                .build();

        // FREE ID 1609

        // FREE ID 1610

        // FREE ID 1611

        // Free ID 1612

        Milk = new Material.Builder(1613, gregtechId("milk"))
                .liquid(new FluidBuilder()
                        .temperature(295)
                        .customStill())
                .color(0xFEFEFE).iconSet(FINE)
                .build();

        Cocoa = new Material.Builder(1614, gregtechId("cocoa"))
                .dust(0)
                .color(0x643200).iconSet(FINE)
                .build();

        Wheat = new Material.Builder(1615, gregtechId("wheat"))
                .dust(0)
                .color(0xFFFFC4).iconSet(FINE)
                .build();

        Meat = new Material.Builder(1616, gregtechId("meat"))
                .dust(1)
                .color(0xC14C4C).iconSet(SAND)
                .build();

        Wood = new Material.Builder(1617, gregtechId("wood"))
                .wood()
                .color(0x896727).iconSet(WOOD)
                .flags(GENERATE_PLATE, GENERATE_ROD, GENERATE_BOLT_SCREW, GENERATE_LONG_ROD, GENERATE_GEAR,
                        GENERATE_FRAME)
                .fluidPipeProperties(340, 5, false)
                .build();

        Paper = new Material.Builder(1618, gregtechId("paper"))
                .dust(0)
                .color(0xFAFAFA).iconSet(FINE)
                .flags(GENERATE_PLATE, FLAMMABLE, NO_SMELTING, NO_SMASHING,
                        MORTAR_GRINDABLE, EXCLUDE_PLATE_COMPRESSOR_RECIPE)
                .build();

        FishOil = new Material.Builder(1619, gregtechId("fish_oil"))
                .fluid()
                .color(0xDCC15D)
                .flags(STICKY, FLAMMABLE)
                .build();

        RubySlurry = new Material.Builder(1620, gregtechId("ruby_slurry"))
                .fluid().color(0xff6464).build();

        SapphireSlurry = new Material.Builder(1621, gregtechId("sapphire_slurry"))
                .fluid().color(0x6464c8).build();

        GreenSapphireSlurry = new Material.Builder(1622, gregtechId("green_sapphire_slurry"))
                .fluid().color(0x64c882).build();

        // These colors are much nicer looking than those in MC's EnumDyeColor
        DyeBlack = new Material.Builder(1623, gregtechId("dye_black"))
                .fluid().color(0x202020).build();

        DyeRed = new Material.Builder(1624, gregtechId("dye_red"))
                .fluid().color(0xFF0000).build();

        DyeGreen = new Material.Builder(1625, gregtechId("dye_green"))
                .fluid().color(0x00FF00).build();

        DyeBrown = new Material.Builder(1626, gregtechId("dye_brown"))
                .fluid().color(0x604000).build();

        DyeBlue = new Material.Builder(1627, gregtechId("dye_blue"))
                .fluid().color(0x0020FF).build();

        DyePurple = new Material.Builder(1628, gregtechId("dye_


.Ex70.m1.6.6.3.1.cmml"><msup id="S4.Ex70.m1.6.6.3.1.3" xref="S4.Ex70.m1.6.6.3.1.3.cmml"><mi id="S4.Ex70.m1.6.6.3.1.3.2" xref="S4.Ex70.m1.6.6.3.1.3.2.cmml">e</mi><mrow id="S4.Ex70.m1.6.6.3.1.3.3" xref="S4.Ex70.m1.6.6.3.1.3.3.cmml"><mo id="S4.Ex70.m1.6.6.3.1.3.3a" xref="S4.Ex70.m1.6.6.3.1.3.3.cmml">−</mo><mrow id="S4.Ex70.m1.6.6.3.1.3.3.2" xref="S4.Ex70.m1.6.6.3.1.3.3.2.cmml"><mi id="S4.Ex70.m1.6.6.3.1.3.3.2.2" xref="S4.Ex70.m1.6.6.3.1.3.3.2.2.cmml">r</mi><mo id="S4.Ex70.m1.6.6.3.1.3.3.2.1" xref="S4.Ex70.m1.6.6.3.1.3.3.2.1.cmml"></mo><mi id="S4.Ex70.m1.6.6.3.1.3.3.2.3" xref="S4.Ex70.m1.6.6.3.1.3.3.2.3.cmml">t</mi></mrow></mrow></msup><mo id="S4.Ex70.m1.6.6.3.1.2" xref="S4.Ex70.m1.6.6.3.1.2.cmml"></mo><msub id="S4.Ex70.m1.6.6.3.1.4" xref="S4.Ex70.m1.6.6.3.1.4.cmml"><mi id="S4.Ex70.m1.6.6.3.1.4.2" mathvariant="normal" xref="S4.Ex70.m1.6.6.3.1.4.2.cmml">Δ</mi><mi id="S4.Ex70.m1.6.6.3.1.4.3" xref="S4.Ex70.m1.6.6.3.1.4.3.cmml">i</mi></msub><mo id="S4.Ex70.m1.6.6.3.1.2a" xref="S4.Ex70.m1.6.6.3.1.2.cmml"></mo><mrow id="S4.Ex70.m1.6.6.3.1.1.1" xref="S4.Ex70.m1.6.6.3.1.1.2.cmml"><mo id="S4.Ex70.m1.6.6.3.1.1.1.2" stretchy="false" xref="S4.Ex70.m1.6.6.3.1.1.2.cmml">(</mo><mi id="S4.Ex70.m1.3.3" xref="S4.Ex70.m1.3.3.cmml">t</mi><mo id="S4.Ex70.m1.6.6.3.1.1.1.3" xref="S4.Ex70.m1.6.6.3.1.1.2.cmml">,</mo><mrow id="S4.Ex70.m1.6.6.3.1.1.1.1" xref="S4.Ex70.m1.6.6.3.1.1.1.1.cmml"><


, fail

  test_24: li x1, 0xff00ff00
 xor x2, x0, x1
 li x7, 0xff00ff00
 li gp, 24
 bne x2, x7, fail

  test_25: li x1, 0x00ff00ff
 xor x2, x1, x0
 li x7, 0x00ff00ff
 li gp, 25
 bne x2, x7, fail

  test_26: xor x1, x0, x0
 li x7, 0
 li gp, 26
 bne x1, x7, fail

  test_27: li x1, 0x111111


rValue.maxValue) {
        return value >= filterValue.minValue && value <= filterValue.maxValue;
    } else if (filterValue.minValue) {
        return value >= filterValue.minValue;
    } else if (filterValue.maxValue) {
        return value <= filterValue.maxValue;
    }
    return false;
};

const isDateValuePassedFilter = (
    value: string,
    filterValue: { startDate: string; endDate: string }
) => {
    const dateValue = moment(value, C.DATE_FORMAT);
    if (filterValue.endDate && filterValue.startDate) {
        return (
            dateValue >= moment(filterValue.startDate) &&
            dateValue <= moment(filterValue.endDate)
        );
    } else if (filterValue.endDate) {
        return dateValue <= moment(filterValue.endDate);
    } else if (filterValue.startDate) {
        return dateValue >= moment(filterValue.startDate);
    }
    return false;
};

const isTextValuePassedFilter = (value: string, filterValue: string) => {
    const textValue = value.toString().toLowerCase();
    return textValue.includes(filterValue.toLowerCase());
};

const isValuePassedFilter = (
    columnValueType: ColumnValueType,
    value: any,
    filterValue: any,
    rowData: RowType['data'],
    customFilterOptions?: CustomFilterOptions
) => {
    let result: boolean = false;
    if (value !== undefined && filterValue !== undefined) {
        switch (columnValueType) {
            case COLUMN_TYPE.CUSTOM:
                result = customFilterOptions?.filterFunc
                    ? customFilterOptions.filterFunc(
                          value,
                          filterValue,
                          rowData
                      )
                    : true;
                break;
            case COLUMN_TYPE.NUMBER:
                result = isNumberValuePassedFilter(value, filterValue);
                break;
            case COLUMN_TYPE.DATE:
                result = isDateValuePassedFilter(value, filterValue);
                break;
            default:
                result = isTextValuePassedFilter(value, filterValue);
                break;
        }
    }
    return result;
};

export const filterTableRows = (
    props: TableProps,
    state: ShipTableState,
    tableRows: Array<RowType>
) => {
    return tableRows.filter((row) => {
        if (row.id === C.FILTER_ROW_ID) {
            return true;
        }
        return Object.keys(state.searchInfo).every((columnId) => {
            const { columnValueType, customFilterOptions } = getColumnData(
                props,
                columnId
            );
            const rowData: RowType['data'] = row.data;
            const value = rowData[columnId]?.value;
            const filterValue = state.searchInfo[columnId];
            return isValuePassedFilter(
                columnValueType,
                value,
                filterValue,
                rowData,
                customFilterOptions
            );
        });
    });
};
import {Directive, ElementRef, Renderer2, HostListener, HostBinding, Input, OnInit} from '@angular/core';

@Directive({
  selector:'[bold]'
})

export class BoldDirective{
  private fontColor:string = "black";
  constructor(private elementRef: ElementRef, private renderer: Renderer2) {
    this.elementRef.nativeElement.style.fontWeight="bold";
    //this.renderer.setStyle(this.elementRef.nativeElement, "font-weight", "bold");
    //this.renderer.setStyle(this.elementRef.nativeElement, "color", "blue");
  }
  @Input() defaultSize = '16px';
  @Input() selectedSize = '18px';
  private fontSize;
  OnInit
  @HostBinding("style.color") get


from typing import Type

import pytest

from odata_query import ast, typing

@pytest.mark.parametrize(
    "input_node, expected_type",
    [
        (ast.String("abc"), ast.String),
        (ast.Compare(ast.Eq(), ast.String("abc"), ast.String("def")), ast.Boolean),
        (
            ast.Call(ast.Identifier("contains"), [ast.String("abc"), ast.String("b")]),
            ast.Boolean,
        ),
        (ast.Identifier("a"), None),
    ],
)
def test_infer_type_of_node(input_node: ast._Node, expected_type: Type[ast._Node]):
    res = typing.infer_type(input_node)

    assert res is expected_type

@pytest.mark.parametrize(
    "input_node, expected_type",
    [
        (
            ast.Call(ast.Identifier("contains"), [ast.String("abc"), ast.String("b")]),
            ast.Boolean,
        ),
        (
            ast.Call(ast.Identifier("indexof"), [ast.String("abc"), ast.String("b")]),
            ast.Integer,
        ),
        (
            ast.Call(ast.Identifier("floor"), [ast.Float("10.32")]),
            ast.Float,
        ),
        (
            ast.Call(ast.Identifier("date"), [ast.DateTime("2020-01-01T10:10:10")]),
            ast.Date,
        ),
        (
            ast.Call(ast.Identifier("maxdatetime"), []),
            ast.DateTime,
        ),
        (
            ast.Call(ast.Identifier("unknown_function"), []),
            None,
        ),
    ],
)
def test_infer_return_type_of_call(
    input_node: ast.Call, expected_type: Type[ast._Node]
):
    res = typing.infer_type(input_node)

    assert res is expected_type


20,
        flags = set { 'daily' },
        reward = { sparks = 300, exp = 1500, accolades = 300, item = { xi.item.COPPER_AMAN_VOUCHER } },
    },

    [4084] =
    { -- Heal for 500+ HP (D)
        trigger = xi.roeTrigger.HEAL_ALLY,
        goal = 30,
        reqs = { healMin = 500 },
        flags = set { 'daily' },
        reward = { sparks = 300, exp = 1500, accolades = 300, item = { xi.item.COPPER_AMAN_VOUCHER } },
    },

    -----------------------------------
    -- Timed Records - No Category
    -----------------------------------

    [4008] =
    { -- Vanquish Aquans
        trigger = xi.roeTrigger.DEFEAT_MOB,
        goal = 20,
        reqs = { mobXP = true, zoneNot = abysseaZones, mobSystem = set { xi.eco.AQUAN } },
        flags = set { 'timed', 'repeat' },
        reward = { sparks = 300, exp = 1500, accolades = 300, item = { xi.item.COPPER_AMAN_VOUCHER } },
    },

    [4009] =
    { -- Vanquish Beasts
        trigger = xi.roeTrigger.DEFEAT_MOB,
        goal = 20,
        reqs = { mobXP = true, zoneNot = abysseaZones, mobSystem = set { xi.eco.BEAST } },
        flags = set { 'timed', 'repeat' },
        reward = { sparks = 300, exp = 1500, accolades = 300, item = { xi.item.COPPER_AMAN_VOUCHER } },
    },

    [4010] =
    { -- Vanquish Plantoids
        trigger = xi.roeTrigger.DEFEAT_MOB,
        goal = 20,
        reqs = { mobXP = true, zoneNot = abysseaZones, mobSystem = set { xi.eco.PLANTOID } },
        flags = set { 'timed', 'repeat' },
        reward = { sparks = 300, exp = 1500, accolades = 300, item = { xi.item.COPPER_AMAN_VOUCHER } },
    },

    [4011] =
    { -- Vanquish Lizards
        trigger = xi.roeTrigger.DEFEAT_MOB,
        goal = 20,
        reqs = { mobXP = true, zoneNot = abysseaZones, mobSystem = set { xi.eco.LIZARD } },
        flags = set { 'timed', 'repeat' },
        reward = { sparks = 300, exp = 1500, accolades = 300, item = { xi.item.COPPER_AMAN_VOUCHER } },
    },

    [4012] =
    { -- Vanquish Vermin
        trigger = xi.roeTrigger.DEFEAT_MOB,
        goal = 20,
        reqs = { mobXP = true, zoneNot = abysseaZones, mobSystem = set { xi.eco.VERMIN } },
        flags = set { 'timed', 'repeat' },
        reward = { sparks = 300, exp = 1500, accolades = 300, item = { xi.item.COPPER_AMAN_VOUCHER } },
    },

    [4013] =
    { -- Gain Experience
        trigger = xi.roeTrigger.GAIN_EXPERIENCE,
        goal = 5000,
        increment = 0,
        flags = set { 'timed', 'repeat' },
        reward = { sparks = 300, exp = 1500, accolades = 300, item = { xi.item.COPPER_AMAN_VOUCHER } },
        check = function(self, player, params)
            if params.exp and params.exp > 0 then
                params.progress = params.


; }

/* left side */
#calledShot-head-chance { left: 33px; top: 35px; }
#calledShot-head-label { left: 75px; top: 30px; }

#calledShot-eyes-chance { left: 33px; top: 102px; }
#calledShot-eyes-label { left: 75px; top: 95px; }

#calledShot-rightArm-chance { left: 33px; top: 164px; }
#calledShot-rightArm-label { left: 75px; top: 160px; }

#calledShot-rightLeg-chance { left: 33px; top: 230px; }
#calledShot-rightLeg-label { left: 75px; top: 225px; }
:root {
	--darkest: #2d2d2d;
	--dark: #353535;
	--background: #1b1b1e;
	--medium: #777c85;
	--light: #b3b9c5;
	--lightest: #ffffff;
	--muted: #6c6c6d;
	--red: #f2777a;
	--orange: #fca369;
	--yellow: #ffd479;
	--light-yellow: #ffeea6;
	--green: #92d192;
	--blue: #6ab0f3;
	--aqua: #76d4d6;
	--purple: #e1a6f2;
	--biege: #ac8d58;
	--font-code: Hack, Consolas, 'Courier New', Courier, monospace;
	--font-normal: 'Source Sans Pro', Arial, Helvetica, sans-serif;
	--round-border-radius: 8px;
	--font-size-regular: 13px;
	--font-size-header: 14px;
	--font-size-icon: 14px;
	--scrollbar-color-thumb: #222;

	/* responsive styles */
	--round-border-radius: 8px;
	--font-size-regular: 13px;
	--font-size-header: 14px;
	--font-size-icon: 14px;
}

* {
	box-sizing: border-box;

	&::-moz-selection,
	&::selection {
		background-color: rgba(255, 255, 255, 0.1);
	}
}

strong {
	color: var(--aqua);
}

em {
	color: var(--medium);
	font-style: normal;
}

.muted {
	color: var(--muted);
}

.highlighted {
	color: var(--green);
}

body {
	padding: 0;
	margin: 0;
}

a {
	text-decoration: none;
	color: inherit;

	&:hover {
		text-decoration: underline;
	}
}

@media only screen and (max-width: 700px), (max-height: 300px) {
	:root {
		--font-size-regular: 12px;
		--font-size-header: 13px;
		--round-border-radius: 0;
		--font-size-icon: 13px;
	}
}
@font-face {
	font-family: 'Whitney';
	src: url('./assets/fonts/Whitney-Book.woff') format('woff');
	font-weight: 400;
}
@font-face {
	font-family: 'Whitney';
	src: url('./assets/fonts/Whitney-Medium.woff') format('woff');
	font-weight: 500;
}
@font-face {
	font-family: 'Whitney';
	src: url('./assets/fonts/Whitney-Semibold.woff') format('woff');
	font-weight: 600;
}
@font-face {
	font-family: 'Whitney';
	src: url('./assets/fonts/Whitney-Bold.woff') format('woff');
	font-weight: 700;
}

:root {
	--header-primary: #fff;
	--header-secondary: #b9bbbe;
	--text-normal: #dcddde;
	--text-muted: #72767d;
	--text-link: hsl(197, calc(var(--saturation-factor, 1) * 100%), 47.8%);
	--text-link-low-saturation: hsl(
		197


Display.h"
#include "stdio.h"
#include "util/globalCalib.h"
#include "util/globalFuncs.h"
#include <Eigen/LU>
#include <algorithm>

#include "FullSystem/ImmaturePoint.h"
#include "math.h"
#include <Eigen/Eigenvalues>
#include <Eigen/SVD>

namespace dso {

//@ 优化未成熟点逆深度, 并创建成PointHessian
/// 是优化滑窗内所有关键帧上的未成熟点
/// 然后往最新关键帧上投构造photometric error？(seems like it) (scratch that)
/// it's multiple view triangulate for one point
#define SHOW_MULTI_VIEW_OTP
PointHessian *
FullSystem::optimizeImmaturePoint(ImmaturePoint *point, int minObs,
                                  ImmaturePointTemporaryResidual *residuals,
                                  bool add_to_residuals, bool print_info) {
  ///[ ***step 1*** ] 初始化和其它关键帧的res(点在其它关键帧上投影)
  int nres = 0;
  std::map<int, int> nres_to_target_cid;
  for (FrameHessian *fh : frameHessians) {
    // TODO roger,
    // 现在的实现是只在最新帧极线搜索，就不在host帧的其他cid上搜了，当然也可以搜，但感觉没什么必要
    if (fh != point->host) {
      for (int target_cid = 0; target_cid < kCameraNumUsed; ++target_cid) {
        residuals[nres].state_NewEnergy = residuals[nres].state_energy = 0;
        residuals[nres].state_NewState = ResState::OUTLIER;
        residuals[nres].state_state = ResState::IN;
        residuals[nres].target = fh;
        nres_to_target_cid.emplace(std::make_pair(nres, target_cid));
        nres++;
      }
    }
  }
  assert(nres == kCameraNumUsed * (((int)frameHessians.size()) - 1));

  bool print = print_info; // false; // !add_to_residuals ; // rand()%50==0;

  float lastEnergy = 0, lastEnergy_zncc = 0;
  float lastHdd = 0;
  float lastbd = 0;
  float currentIdepth = (point->idepth_max + point->idepth_min) * 0.5f;

#ifdef SHOW_MULTI_VIEW_OTP

#endif
  for (int lvl_target = pyrLevelsUsed - 1; lvl_target >= 0; lvl_target--) {
    lastEnergy = 0;
    lastHdd = 0;
    lastbd = 0;
    lastEnergy_zncc = 0;
    for (int i = 0; i < nres; i++) {
      residuals[i].state_NewEnergy = residuals[i].state_energy = 0;
      residuals[i].state_NewState = ResState::OUTLIER;
      residuals[i].state_state = ResState::IN;
      lastEnergy += point->linearizeResidual(nres_to_target_cid.at(i), &Hcalib,
                                             1000, residuals + i, lastHdd,
                                             lastbd, currentIdepth, lvl_target);
      residuals[i].state_state = residuals[i].state_NewState;
      residuals[i].state_energy = residuals[i].state_NewEnergy;
      lastEnergy_zncc += point->zncc_opt;
    }

    if (!std::isfinite(lastEnergy) || lastHdd < setting_minIdepthH_act ||
        !isfinite(lastEnergy_zncc)) {
      if (print)
        printf("OptPoint: Not well-constrained (%d res, H=%.1f). E=%f. SKIP!\n",
               nres, lastHdd, lastEnergy);
      return 0;
    }

    if (prin


之间的关联并非真实的因果关系，而是由样本重叠这一外部因素所导致==。 尽管研究人员通过在统计效力大幅降低的较小数据集上进行敏感性分析，试图尽量减少此类偏倚，但受限于数据本身的特性和分析方法的局限性，无法完全消除这种偏倚对结果的潜在影响，这是该研究存在的一项局限性。

总体而言，这项针对相对偏瘦中国成年人的研究表明，肥胖与大量蛋白质存在显著关联，有证据支持300多种蛋白质在体重指数（BMI）对蛋白质的方向上具有因果相关性。双向孟德尔随机化（MR）分析还发现，8种蛋白质可能会影响肥胖水平，这可能为未来的药物研发提供参考。结合富集分析和现有的实验数据，本研究确定了肥胖可能增加疾病风险的多种通路，并为肥胖及肥胖相关疾病的潜在治疗提供了新的蛋白质靶点支持。
## 问题
### 遗传关联和MR分析的区别是什么
在该研究中，遗传关联和孟德尔随机化（MR）分析的区别主要体现在以下方面： ### 1. 定义与核心目的 - **遗传关联**：主要通过遗传工具（如BMI遗传评分）探究遗传预测的BMI与蛋白质水平之间的关联，旨在识别受遗传因素影响的BMI与蛋白质之间的统计学关联，其核心是基于遗传变异对BMI的预测作用，观察这种遗传预测的BMI与蛋白质水平的关系🔶1-67🔶。 - **MR分析**：是一种利用遗传变异作为工具变量来推断暴露因素（如蛋白质水平）与结局（如BMI）之间因果关系的方法，在本研究中，双向MR分析用于明确蛋白质与BMI之间的因果方向，即判断是蛋白质影响BMI，还是BMI影响蛋白质，或存在双向影响🔶1-91🔶。 ### 2. 分析对象与方向 - **遗传关联**：聚焦于遗传预测的BMI对蛋白质水平的影响，方向主要是“BMI（遗传预测）到蛋白质”，分析遗传衍生的BMI与1463种蛋白质之间的关联情况，识别出显著相关的蛋白质🔶1-67🔶。 - **MR分析**：不仅关注“BMI到蛋白质”的方向，更重


--------------------------------
-- @module PhysicsShapeEdgeBox
-- @extend PhysicsShapeEdgePolygon
-- @parent_module cc

--------------------------------
-- Creates a PhysicsShapeEdgeBox with specified value.

-- param   size Size contains this box's width and height.

-- param   material A PhysicsMaterial object, the default value is PHYSICSSHAPE_MATERIAL_DEFAULT.

-- param   border It's a edge's border width.

-- param   offset A Vec2 object, it is the offset from the body's center of gravity in body local coordinates.

-- return  An autoreleased P


JohnTitor/chalk<gh_stars>1-10
/// Many of our internal operations (e.g., unification) are an attempt
/// to perform some operation which may not complete.
pub type Fallible<T> = Result<T, NoSolution>;

/// Indicates that the attempted operation has "no solution" -- i.e.,
/// cannot be performed.
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct NoSolution;
// ベンチマークテストもサポートしている
//
// また，ドキュメントに現れたコード例もコンパイルされる
// すごいな
//
// 関数名を指定すると，その関数のみ実行される
// 指定した文字と合致するテストが実行される．これもすごい

// pubにしないと内部関数となる
// この場合，使われないとdead_codeワーニングがでる
pub fn add_two(a: i32) -> i32 {
    a + 2
}

pub fn greeting(name: &str) -> String {
    format!("hello {}", name)
}

// 関数の出力はテストライブラリによってキャプチャされる(非表示)
// それは制御可能
pub fn prints_and_returns_10(a: i32) -> i32 {
    // cargo testのデフォルトは，この出力をキャプチャする
    // 表示したい場合は-- --nocaptureオプションを付加する
    println!("I got the value: {}", a);
    10
}

// 非公開
fn internal() -> String {
    String::from("I am internal test")
}

pub fn avoid_dead_code() {
    println!("{}", internal());
}

// 単体テストをするときはcfg(test)を使うことが慣例になっている
#[cfg(test)]
mod unit_tests {
    // テスト関数であることを示唆する
    #[test]
    // 無視することもできる
    // #[ignore]
    fn exploration() {
        // アサーションマクロ
        assert_eq!(2 + 2, 4);
    }

    #[test]
    fn another() {
        panic!("Make this test fail");
    }

    use super::add_two;

    #[test]
    fn it_add_two() {
        assert_eq!(4, add_two(2));
    }

    use super::greeting;

    #[test]
    fn greeting_contains_name() {
        let result = greeting("Carol");
        assert!(
            result.contains("Carol"),
            "Greeting did not contain name, value was '{}'",
            result
        );
    }

    use super::prints_and_returns_10;

    #[test]
    fn this_test_will_pass() {
        let value = prints_and_returns_10(0);
        assert_eq!(value, 10);
    }

    #[test]
    fn this_test_will_fail() {
        let value = prints_and_returns_10(0);
        assert_eq!(value, 5);
    }

    use super::internal;

    // もちろん非公開関数のテストも単体テストの範疇
    #[test]
    fn validate_internal() {
        assert_eq!(internal(), "I am internal test");
    }
}
<reponame>TristanCacqueray/sprs
fn main() {
    println!("cargo:rerun-if-changed=build.rs");
    if std::env::var_os("CARGO_FEATURE_STATIC").is_some() {
        let path_to_camd = std::env::var("DEP_SUITESPARSE_SRC_ROOT").unwrap();
        println!("cargo:rustc-link-search=native={}", path_to_camd);
        println!("cargo:rustc-link-lib=static=camd");
        println!("cargo:rustc-link-lib=static=camdl");
        println!("cargo:rustc-link-lib=static=suitesparseconfig");
    } else {
        println!("cargo:rustc-link-lib=camd");
    }
}
<filename>src/io/json.rs
//! # JSON IO
u


ss: string;
    static apiNameSpace: string;
    static gameName: string = 'YZ_BASIC';

    //牛牛
    static nn_apiIp: string;
    static nn_apiPort: number;
    static nn_apiAddress: string;
    static nn_apiNameSpace: string;

    //初始化配置数据
    static init(is_Test: Boolean): void {
        //判断复制
        if(is_Test) {
            //大厅数据
            this.apiIp = "192.168.0.8";
            this.apiPort = 21701;
            this.apiAddress = this.apiIp + ":" + this.apiPort + "/jWebSocket/jWebSocket";
            this.apiNameSpace = "org.jwebsocket.plugins.kaya118";

            //牛牛数据
            this.nn_apiIp = "192.168.0.8";
            this.nn_apiPort = 21705;
            this.nn_apiAddress = this.nn_apiIp + ":" + this.nn_apiPort + "/jWebSocket/jWebSocket";
            this.nn_apiNameSpace = "org.jwebsocket.plugins.nn";

        }
        else {
            //大厅数据
            this.apiIp = "101.37.203.84";
//            this.apiIp = "114.215.171.127";
            this.apiPort = 21701;
            this.apiAddress = this.apiIp + ":" + this.apiPort + "/jWebSocket/jWebSocket";
            this.apiNameSpace = "org.jwebsocket.plugins.kaya118";

            //牛牛数据
            this.nn_apiIp = "101.37.203.84";
//            this.nn_apiIp = "114.215.171.127";
            this.nn_apiPort = 21705;
            this.nn_apiAddress = this.nn_apiIp + ":" + this.nn_apiPort + "/jWebSocket/jWebSocket";
            this.nn_apiNameSpace = "org.jwebsocket.plugins.nn";

        }

        //筹码数据赋值
        setTimeout(() => {
            this.assChipData();
        },this,200);
    }

    //筹码数据赋值
    static assChipData(): void {
        console.log(basic.localStorage.getItem('nowChip'));

        //数据赋值
        if(basic.localStorage.getItem('nowChip') == null) {
            //数据赋值
            GameData.Game_Chip_Now = 0;

            //保存数据
            basic.localStorage.setItem('nowChip',GameData.Game_Chip_Now.toString());
        }
        else {
            GameData.Game_Chip_Now = Number(basic.localStorage.getItem('nowChip'));
        }
        if(basic.localStorage.getItem('ChooseChip') == null) {
            //数据赋值
            GameData.Game_Chip_Gold = [100,500,1000,2500];

            //保存数据
            basic.localStorage.setItem('ChooseChip',GameData.Game_Chip_Gold.toString());
        }
        else {
            var now_chip: string[] = basic.localStorage.getItem('ChooseChip').split(",");

            //数据赋值
            for(var i: number = 0;i < 4;i++) {
                GameData.Game_Chip_Gold[i] = Number(now_chip[i])
            }
        }
    }

    //判断是否是微信环境
     static isWeiXin(): boolean {
         //定义变量
         var ua: string = navigator.userAgent.toString();

         //判断
         var str: any = ua.match(/MicroMessenger/i);
         if(str == "MicroMessenger") {
             return true;
         } else {
             return false;
         }
     }

     //判断是否App
     static isApp(): Boolean {


===================
任务列表
===================
*/
.task_page{
	overflow:hidden;
	padding:0 0 50px;
}
.task_list{
	padding:0 15px 15px;
}
.task_list dl{
	border-bottom:1px dotted #e4e4e4;
	padding:15px 0;
}
.task_list dl.dl_complete dd{
	padding-bottom:15px;
}
.task_list dt{
	float:left;
	width:100px;
	clear:left;
}
.task_list dt img{
	display:block;
}
.task_list dd{
	margin:0 100px 0 100px;
	_display:inline-block;
	color:#666;
}
.task_list dd p{
	margin-bottom:5px;
}
.task_list dd p.tar{
	float:right;
	margin-top:-58px;
	height:30px;
	margin-right:-90px;
	position:relative;
}
.task_list .name{
	color:#333;
}
.task_list .btn{
	width:60px;
}
.task_list button.btn{
	width:80px;
}

/*
===================
进度条
===================
*/
.task_list .progress_wrap{
	display:inline-block;
	width:80px;
	position:relative;
}
.task_list .progress_wrap em{
	position:absolute;
	width:78px;
	text-align:center;
	color:#fff;
	font-family:Tahoma;
	left:0;
	font-size:10px;
	line-height:20px;
	_line-height:13px;
	top:0;
}
.task_list .progress,
.task_list .progress span{
	background-image:url(../../images/task/progress.png);
}
.task_list .progress{
	width:78px;
	background-color:#efefef;
	height:8px;
	display:inline-block;
	vertical-align:middle;
	position:relative;
	border:1px solid #a4a4a4;
	border-radius:5px;
	overflow:hidden;
}
.task_list .progress span{
	background-color: #afc82e;
	display:inline-block;
	height:8px;
	position:absolute;
	margin-top:-1px;
	left:-1px;
	border:1px solid #81a435;
	border-radius:5px;
	background-position:0 -10px;
}

/*#
===================
@explain: 门户-创建自定义页面
@copyright: Copyright 2012,phpwind.com
@author: longwenid@gmail.com
$Id: create.css 22392 2012-12-24 02:58:25Z yanchixia $
===================
#*/

/*
===================

===================
*/
.create_page{
	padding:15px;
	box-shadow:0 0 6px rgba(0,0,0,0.2);
	background:#fff;
}
/*页面标题*/
.create_page h1{
	font-size:14px;
	margin-bottom:15px;
	padding:0 5px;
}
/*标题*/
.create_page h2{
	font-size:12px;
	color:#666;
	border-bottom:1px solid #cdcdcd;
	padding:5px;
	margin-bottom:10px;
}
/*块*/
.create_page .box{
	margin-bottom:30px;
}
/*内容*/
.create_page dl{
	padding:10px 0;
}
.create_page dt{
	float:left;
	width:150px;
	font-size:14px;
	line-height


/*
 * Copyright 2013 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkLerpXfermode_DEFINED
#define SkLerpXfermode_DEFINED

#include "SkXfermode.h"

class SK_API SkLerpXfermode : public SkXfermode {
public:
    /**
     *  result = scale * src + (1 - scale) * dst
     *
     *  When scale == 1, this is the same as kSrc_Mode
     *  When scale == 0, this is the same as kDst_Mode
     */
    static SkXfermode* Create(SkScalar scale);

    // overrides from SkXfermode
    virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
                        const SkAlpha aa[]) const SK_OVERRIDE;
    virtual void xfer16(uint16_t dst[], const SkPMColor src[], int count,
                        const SkAlpha aa[]) const SK_OVERRIDE;
    virtual void xferA8(SkAlpha dst[], const SkPMColor src[], int count,
                        const SkAlpha aa[]) const SK_OVERRIDE;

    SK_DEVELOPER_TO_STRING()
    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLerpXfermode)

protected:
    SkLerpXfermode(SkReadBuffer&);
    virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;

private:
    SkLerpXfermode(unsigned scale256);

    unsigned fScale256;  // 0..256

    typedef SkXfermode INHERITED;
};

#endif


import gradio as gr
import numpy as np

import openvino_genai as ov_genai

MAX_SEED = np.iinfo(np.int32).max
MAX_IMAGE_SIZE = 2048

def make_demo(pipeline, generator_cls, adapters, adapters_meta):

    adapters_selection = {"none": {"prompt": "<subject>"}}
    for idx, adapter in enumerate(adapters):
        adapter_name = adapters_meta[idx]["name"]
        adapters_selection[adapter_name] = adapters_meta[idx]
        adapters_selection[adapter_name]["adapter"] = adapter

    def infer(prompt, seed, randomize_seed, width, height, lora_id, progress=gr.Progress(track_tqdm=True)):
        if randomize_seed:
            seed = np.random.randint(0, MAX_SEED)

        generator = generator_cls(seed)
        adapter_config = ov_genai.AdapterConfig()
        if lora_id != "none":
            adapter_info = adapters_selection[lora_id]
            adapter = adapter_info["adapter"]
            prompt_template = adapter_info.get("prompt", "<subject>")
            alpha = adapter_info.get("weight", 1.0)
            adapter_config.add(adapter, alpha)
            prompt = prompt_template.replace("<subject>", prompt)

        image_tensor = pipeline.generate(
            prompt=prompt,
            num_inference_steps=4,
            guidance_scale=0,
            width=width,
            height=height,
            generator=generator,
            adapters=adapter_config,
        )

        return image_tensor.data[0], seed

    with gr.Blocks() as demo:
        with gr.Column():
            gr.Markdown(
                """
            # Image Generation with LoRA and OpenVINO GenAI
            1. Provide input generation prompt into prompt window
            2. Select one of the predefined adapters (use none for a generation without LoRA)
            3. Click 'Generate' button for start image generation
            """
            )

            with gr.Row():
                prompt = gr.Text(
                    label="Prompt",
                    show_label=False,
                    max_lines=1,
                    placeholder="Enter your prompt",
                    container=False,
                )
                lora_id = gr.Dropdown(label="LoRA", choices=list(adapters_selection.keys()), value="none")

                run_button = gr.Button("Generate", scale=0)

            result = gr.Image(label="Result", show_label=False)

            with gr.Accordion("Advanced Settings", open=False):
                seed = gr.Slider(
                    label="Seed",
                    minimum=0,
                    maximum=MAX_SEED,
                    step=1,
                    value=0,
                )

                randomize_seed = gr.Checkbox(label="Randomize seed", value=True)

                with gr.Row():
                    width = gr.Slider(
                        label="Width",
                        minimum=256,
                        maximum=MAX_IMAGE_SIZE,
                        step=32,
                        value=1024,
                    )

                    height = gr.Slider(
                        label="Height",
                        minimum=256,
                        maximum=MAX_IMAGE_SIZE,
                        step=32,
                        value=1024,
                    )

        gr.on(
            triggers=[run_button.click, prompt.submit],
            fn=infer,
            inputs=[prompt, seed, randomize_seed, width, height, lora_id],
            outputs=[result, seed],
        )

    return demo


1x64_mfma_finishing
    v_mfma_f32_16x16x4f16 a[a_c+32:a_c+47], v[v_a+6:v_a+7], v[v_b+4:v_b+5], a[a_c+32:a_c+47]     ; repeat:1x0, step:0x0, num_a_c:16
    v_mfma_f32_16x16x4f16 a[a_c+48:a_c+63], v[v_a+6:v_a+7], v[v_b+6:v_b+7], a[a_c+48:a_c+63]     ; repeat:1x1, step:0x0, num_a_c:16
    s_waitcnt lgkmcnt(0)
    s_barrier
    s_branch L_igemm_bwd_gtcx_nchw_fp16_bx4_ex0_bt64x256x16_wt16x64x4_ws1x1_wr2x2_ta1x4x1x1_1x4x1x64_tb1x4x1x4_1x4x1x64_mfma_body
L_igemm_bwd_gtcx_nchw_fp16_bx4_ex0_bt64x256x16_wt16x64x4_ws1x1_wr2x2_ta1x4x1x1_1x4x1x64_tb1x4x1x4_1x4x1x64_mfma_finishing:
    v_mfma_f32_16x16x4f16 a[a_c+32:a_c+47], v[v_a+6:v_a+7], v[v_b+4:v_b+5], a[a_c+32:a_c+47]     ; repeat:1x0, step:0x0, num_a_c:16
    v_mfma_f32_16x16x4f16 a[a_c+48:a_c+63], v[v_a+6:v_a+7], v[v_b+6:v_b+7], a[a_c+48:a_c+63]     ; repeat:1x1, step:0x0, num_a_c:16
L_igemm_bwd_gtcx_nchw_fp16_bx4_ex0_bt64x256x16_wt16x64x4_ws1x1_wr2x2_ta1x4x1x1_1x4x1x64_tb1x4x1x4_1x4x1x64_mfma_end:
    s_waitcnt lgkmcnt(0)
    s_barrier
    ds_read_b64 v[v_a:v_a+1], v[v_sld_a_os]
    ds_read_b64 v[v_b:v_b+1], v[v_sld_b_os]
    ds_read_b64 v[v_b+2:v_b+2+1], v[v_sld_b_os] offset:1024
    ds_read_b64 v[v_a+2:v_a+2+1], v[v_sld_a_os] offset:256
    ; k iteration : 0
    s_waitcnt lgkmcnt(2)
    v_mfma_f32_16x16x4f16 a[a_c+0:a_c+15], v[v_a+0:v_a+1], v[v_b+0:v_b+1], a[a_c+0:a_c+15]     ; repeat:0x0, step:0x0, num_a_c:16
    ds_read_b64 v[v_a+4:v_a+4+1], v[v_sld_a_os] offset:512 ; load i_k:1 into local buffer 1, repeat 0
    ds_read_b64 v[v_b+4:v_b+4+1], v[v_sld_b_os] offset:2048 ; load i_k:1 into local buffer 1, repeat


}
    #[doc = "Checks if the value of the field is `VCOMP`"]
    #[inline]
    pub fn is_vcomp(&self) -> bool {
        *self == TRIGSELR::VCOMP
    }
    #[doc = "Checks if the value of the field is `SWT`"]
    #[inline]
    pub fn is_swt(&self) -> bool {
        *self == TRIGSELR::SWT
    }
}
#[doc = "Possible values of the field `DFIFORDEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DFIFORDENR {
    #[doc = "Destructive Reads are prevented.  Reads to the FIFOPR register will not POP an entry off the FIFO. value."]
    DIS,
    #[doc = "Reads to the FIFOPR registger will automatically pop an entry off the FIFO. value."]
    EN,
}
impl DFIFORDENR {
    #[doc = r" Returns `true` if the bit is clear (0)"]
    #[inline]
    pub fn bit_is_clear(&self) -> bool {
        !self.bit()
    }
    #[doc = r" Returns `true` if the bit is set (1)"]
    #[inline]
    pub fn bit_is_set(&self) -> bool {
        self.bit()
    }
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bit(&self) -> bool {
        match *self {
            DFIFORDENR::DIS => false,
            DFIFORDENR::EN => true,
        }
    }
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _from(value: bool) -> DFIFORDENR {
        match value {
            false => DFIFORDENR::DIS,
            true => DFIFORDENR::EN,
        }
    }
    #[doc = "Checks if the value of the field is `DIS`"]
    #[inline]
    pub fn is_dis(&self) -> bool {
        *self == DFIFORDENR::DIS
    }
    #[doc = "Checks if the value of the field is `EN`"]
    #[inline]
    pub fn is_en(&self) -> bool {
        *self == DFIFORDENR::EN
    }
}
#[doc = "Possible values of the field `REFSEL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REFSELR {
    #[doc = "Internal 2.0V Bandgap Reference Voltage value."]
    INT2P0,
    #[doc = "Internal 1.5V Bandgap Reference Voltage value."]
    INT1P5,
    #[doc = "Off Chip 2.0V Reference value."]
    EXT2P0,
    #[doc = "Off Chip 1.5V Reference value."]
    EXT1P5,
}
impl REFSELR {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bits(&self) -> u8 {
        match *self {
            REFSELR::INT2P0 => 0,
            REFSELR::INT1P5 => 1,
            REFSELR::EXT2P0 => 2,
            REFSELR::EXT1P5 => 3,
        }
    }
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _from(value: u8) -> REFSELR {
        match value {
            0 => REFSELR::INT2P0,
            1 => REFSELR::INT1P5,
            2 => REFSELR::EXT2P0,
            3 => REFSELR::EXT1P5,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `INT2P0`"]
    #


herbal-essenses","width":"120","height":"100"}},"Title":{"value":"Herbal Essences"}},"url":"\u002Fmarken\u002Fherbal-essences"},{"id":"5d098e81-1455-43c6-b69c-4d1cb5fd8570","fields":{"Market Segment":{"id":"cdda3d98-610c-4619-b90c-f70aa33a982b","url":"\u002Fde-at\u002Fsitecore\u002Fsystem\u002Fsettings\u002Ffoundation\u002Fsharedsettings\u002Fmarketsegment\u002Fbeauty_feminine","fields":{"Setting":{"value":"b"},"__Updated":{"value":"0001-01-01T00:00:00Z"}}},"Brand":{"value":""},"BrandGroup":{"value":""},"Sector":{"value":""},"Segment":{"value":""},"BrandGroupCode":{"value":""},"Category":{"value":""},"MicsBrandId":{"value":""},"HrefLangTags":[],"NoFollow":{"value":false},"MetaDescription":{"value":"Entdecke die Bartstyling und -pflegeprodukte von King C. Gillette, hol dir praktische Tipps und lies ehrliche Produktbewertungen. Gleich reinschauen!"},"MetaTitle":{"value":"King C. Gillette: Produktbewertungen auf for me"},"NoIndex":{"value":false},"twitterImage":{"value":{}},"twitterTitle":{"value":"King C. Gillette: Produktbewertungen auf for me"},"twitterDescription":{"value":"Entdecke die Bartstyling und -pflegeprodukte von King C. Gillette, hol dir praktische Tipps und lies ehrliche Produktbewertungen. Gleich reinschauen!"},"ogTitle":{"value":"King C. Gillette: Produktbewertungen auf for me"},"ogDescription":{"value":"Entdecke die Bartstyling und -pflegeprodukte von King C. Gillette, hol dir praktische Tipps und lies ehrliche Produktbewertungen. Gleich reinschauen!"},"ogImage":{"value":{"src":"https:\u002F\u002Fprd-cdn-emea1-joltx.pgsitecore.com\u002F-\u002Fmedia\u002Fgrowing-families-version1\u002Fgf-de\u002F2021\u002F09-brand-pages\u002F09\u002F2021-09-07-gillette-kingc\u002Fbrandlandingpage_banner_tablet_1440x825_01.ashx?h=825&w=1440&rev=785fca9401fd4ebd87cfb65dc993b3d9&hash=55C042245E3853030056FA4C9CA7727A","alt":"Gillette King C","width":"1440","height":"825"}},"CustomHeaderScripts":{"value":""},"CustomFooterScripts":{"value":""},"LoadDynamicSegmantaScript":{"value":true},"__Updated":{"value":"2022-02-16T14:31:21Z"},"Image":{"value":{"src":"https:\u002F\u002Fprd-cdn-emea1-joltx.pgsitecore.com\u002F-\u002Fmedia\u002Fgrowing-families-version1\u002Fgf-de\u002F2020\u002Fbrand\u002Flogo\u002F200605-kingc-logo.ashx?h=100&w=120&rev=8da48f3eb0e54c85b6d7fba52711b1e2&hash=B9F4346C8FC9CAD6F683ED0AEC5FBBC1","alt":"Gillette King C","width":"120","height":"100"}},"Title":{"value":"King C Gillette"}},"url":"\u002Fmarken\u002Fking-c-gillette"},{"id":"e4333356-2e62-42e6-b094-163481a92540","fields":{"Market Segment":{"id":"44e81165-a3e4-4ee1-8167-e90bc9b8e73e


 new CompassDialWidget(this);
    compassDial->setObjectName(QStringLiteral("CompassDial"));
    compassDialLayout->addWidget(compassDial);

    pbCCWAdvance = new QPushButton(this);
    pbCCWAdvance->setObjectName(QStringLiteral("pbCCWAdvance"));
    QIcon icon2;
    icon2.addFile(QStringLiteral(":/icons/arrow-ccw.svg"), QSize(), QIcon::Normal, QIcon::On);
    pbCCWAdvance->setIcon(icon2);
    compassDialLayout->addWidget(pbCCWAdvance);

    compassDialLayout->setStretch(1, 2);
    compassLayout->addLayout(compassDialLayout);

    compassControlLayout = new QHBoxLayout();
    compassControlLayout->setObjectName(QStringLiteral("compassControlLayout"));
    compassControlLabel = new QLabel(this);
    compassControlLabel->setObjectName(QStringLiteral("compassControlLabel"));
    QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Minimum);
    sizePolicy2.setHorizontalStretch(0);
    sizePolicy2.setVerticalStretch(0);
    sizePolicy2.setHeightForWidth(compassControlLabel->sizePolicy().hasHeightForWidth());
    compassControlLabel->setSizePolicy(sizePolicy2);

    compassControlLayout->addWidget(compassControlLabel);
    dsbAngle = new Gui::QuantitySpinBox(this);
    dsbAngle->setObjectName(QStringLiteral("dsbAngle"));
    dsbAngle->setUnit(Base::Unit::Angle);
    connect(dsbAngle, QOverload<double>::of(&Gui::QuantitySpinBox::valueChanged),
        this, &CompassWidget::slotSpinBoxEnter);

    compassControlLayout->addWidget(dsbAngle);

    compassControlLayout->setStretch(0, 3);
    compassControlLayout->setStretch(1, 2);

    compassLayout->addLayout(compassControlLayout);

    retranslateUi();
}

void CompassWidget::retranslateUi()
{
    compassControlLabel->setText(
        QApplication::translate("CompassWidget", "View Direction as Angle", nullptr));
#ifndef QT_NO_TOOLTIP
    dsbAngle->setToolTip(QApplication::translate(
        "CompassWidget", "The view direction angle relative to +X in the BaseView.", nullptr));
    pbCWAdvance->setToolTip(QApplication::translate(
        "CompassWidget", "Advance the view direction in clockwise direction.", nullptr));
    pbCCWAdvance->setToolTip(QApplication::translate(
        "CompassWidget", "Advance the view direction in anti-clockwise direction.", nullptr));
#endif// QT_NO_TOOLTIP
}

QSize CompassWidget::sizeHint() const { return m_rect.size(); }

QSize CompassWidget::minimumSizeHint() const
{
    return QRect(0, 0, m_minimumWidth, m_minimumHeight).size();
}

void CompassWidget::paintEvent(QPaintEvent* event)
{
    Q_UNUSED(event);
    QWidget::paintEvent(event);
}

// set the compass dial and spinbox to a new angle
void CompassWidget::setDialAngle(double newAngle)
{
    //    Base::Console().message("CW::setDialAngle(%.3f)\n", newAngle);
    m_angle = newAngle;
    if (compassDial) {
        compassDial->setAngle(m_angle);
    }
    if (dsbAngle) {
        dsbAngle->setValue(m_angle);
    }
}

//slot for updates from spinbox on Enter/Return press.
void CompassWidget::slotSpinBoxEnter(double newAngle)
{
    //    Base::Console().message("CW::slotSpinBoxEnter(%.3f)\n", newAngle);
    if (dsbAngle) {
        m_angle = newAngle;
        Q_EMIT angleChanged(m_angle);
        if (compassDial) {
            compassDial->setAngle(m_angle);
        }
    }
}

void CompassWidget::slotCWAdvance()
{
    double angle = m_angle - m_advanceIncrement;
    if (angle < -360.0) {
        angle = angle + 360.0;
    }
    setDialAngle(angle);
    Q_EMIT angleChanged(angl


cloud,
                                          std::vector<float>* distances) const {
  CHECK_NOTNULL(pointcloud);
  CHECK_NOTNULL(distances);
  pointcloud->clear();
  distances->clear();

  pointcloud->reserve(points_.size());
  distances->reserve(points_.size());

  for (const SkeletonPoint& point : points_) {
    pointcloud->push_back(point.point);
    distances->push_back(point.distance);
  }
}

void Skeleton::getEdgePointcloudWithDistances(
    Pointcloud* pointcloud, std::vector<float>* distances) const {
  CHECK_NOTNULL(pointcloud);
  CHECK_NOTNULL(distances);
  pointcloud->clear();
  distances->clear();

  pointcloud->reserve(edges_.size());
  distances->reserve(edges_.size());

  for (const SkeletonPoint& point : edges_) {
    pointcloud->push_back(point.point);
    distances->push_back(point.distance);
  }
}

void Skeleton::getVertexPointcloudWithDistances(
    Pointcloud* pointcloud, std::vector<float>* distances) const {
  CHECK_NOTNULL(pointcloud);
  CHECK_NOTNULL(distances);
  pointcloud->clear();
  distances->clear();

  pointcloud->reserve(vertices_.size());
  distances->reserve(vertices_.size());

  for (const SkeletonPoint& point : vertices_) {
    pointcloud->push_back(point.point);
    distances->push_back(point.distance);
  }
}

SparseSkeletonGraph::SparseSkeletonGraph()
    : next_vertex_id_(0), next_edge_id_(0) {}

int64_t SparseSkeletonGraph::addVertex(const SkeletonVertex& vertex) {
  int64_t vertex_id = next_vertex_id_++;
  // Returns an iterator...
  auto iter_pair = vertex_map_.emplace(std::make_pair(vertex_id, vertex));
  iter_pair.first->second.vertex_id = vertex_id;
  return vertex_id;
}

int64_t SparseSkeletonGraph::addEdge(const SkeletonEdge& edge) {
  int64_t edge_id = next_edge_id_++;
  // Returns an iterator...
  auto iter_pair = edge_map_.emplace(std::make_pair(edge_id, edge));
  iter_pair.first->second.edge_id = edge_id;

  // Now hook it up to the vertices.
  SkeletonVertex& start_vertex = vertex_map_[edge.start_vertex];
  SkeletonVertex& end_vertex = vertex_map_[edge.end_vertex];

  start_vertex.edge_list.push_back(edge_id);
  end_vertex.edge_list.push_back(edge_id);

  iter_pair.first->second.start_point = start_vertex.point;
  iter_pair.first->second.end_point = end_vertex.point;

  return edge_id;
}

bool SparseSkeletonGraph::hasVertex(int64_t id) const {
  if (vertex_map_.find(id) != vertex_map_.end()) {
    return true;
  }
  return false;
}

bool SparseSkeletonGraph::hasEdge(int64_t id) const {
  if (edge_map_.find(id) != edge_map_.end()) {
    return true;
  }
  return false;
}

const SkeletonVertex& SparseSkeletonGraph::getVertex(int64_t id) const {
  return vertex_map_.find(id)->second;
}

const SkeletonEdge& SparseSkeletonGraph::getEdge(int64_t id) const {
  return edge_map_.find(id)->second;
}

SkeletonVertex& SparseSkeletonGraph::getVertex(int64


2>

{{ 'I18N_VOLUNTEER_PAGE_WHY_VOLUNTEER_SECTION_HEADING_1' | translate }}

{{ 'I18N_VOLUNTEER_PAGE_WHY_VOLUNTEER_SECTION_HEADING_1_CONTENT' | translate }}

{{ 'I18N_VOLUNTEER_PAGE_WHY_VOLUNTEER_SECTION_HEADING_2' | translate }}

{{ 'I18N_VOLUNTEER_PAGE_WHY_VOLUNTEER_SECTION_HEADING_2_CONTENT' | translate }}

{{ 'I18N_VOLUNTEER_PAGE_WHY_VOLUNTEER_SECTION_HEADING_3' | translate }}

{{ 'I18N_VOLUNTEER_PAGE_WHY_VOLUNTEER_SECTION_HEADING_3_CONTENT' | translate }}

{{ 'I18N_VOLUNTEER_PAGE_VOLUNTEER_SECTION' | translate }}

      <button class="oppia-volunteer-tab-prev-btn e2e-test-volunteer-page-tabs-prev-btn"
              *ngIf="screenType !== 'desktop'"
              [disabled]="activeTabGroupIndex === 0"
              (click)="decrementTabGroupIndex()">

        Previous
      </button>

      <mat-tab-group [disablePagination]="true" [animationDuration]="0" [disableRipple]="true">
        <mat-tab *ngIf="tabGroups[screenType][activeTabGroupIndex].includes(0)">
          <ng-template mat-tab-label>
            <picture>
              <source type="image/webp" [srcset]="getStaticImageUrl('/icons/outreach-icon.webp')">
              <source type="image/png" [srcset]="getStaticImageUrl('/icons/outreach-icon.png')">

            </picture>
            {{ 'I18N_VOLUNTEER_PAGE_VOLUNTEER_SECTION_OUTREACH' | translate }}
          </ng-template>

{{ 'I18N_VOLUNTEER_PAGE_VOLUNTEER_SECTION_HEADING' | translate }}


/github.com/dotnet/roslyn/issues/52467")]
        public void UnexpectedExceptionLogsMessage()
        {
            var engine = new MockEngine();
            var vbc = new Vbc()
            {
                BuildEngine = engine,
            };

            vbc.ExecuteTool(@"q:\path\vbc.exe", "", "", new TestableCompilerServerLogger()
            {
                LogFunc = delegate { throw new Exception(""); }
            });
            Assert.False(string.IsNullOrEmpty(engine.Log));
        }

        [Fact]
        public void ReportIVTsSwitch()
        {
            var vbc = new Vbc();
            vbc.ReportIVTs = true;
            AssertEx.Equal("/optionstrict:custom /reportivts", vbc.GenerateResponseFileContents());
        }

        [Fact]
        public void CommandLineArgs1()
        {
            var engine = new MockEngine(TestOutputHelper);
            var vbc = new Vbc()
            {
                BuildEngine = engine,
                Sources = MSBuildUtil.CreateTaskItems("test.vb"),
            };

            TaskTestUtil.AssertCommandLine(vbc, engine, "/optionstrict:custom", "/out:test.exe", "test.vb");
        }

        [Fact]
        public void CommandLineArgs2()
        {
            var engine = new MockEngine(TestOutputHelper);
            var vbc = new Vbc()
            {
                BuildEngine = engine,
                Sources = MSBuildUtil.CreateTaskItems("test.vb", "blah.vb"),
                TargetType = "library"
            };

            TaskTestUtil.AssertCommandLine(vbc, engine, "/optionstrict:custom", "/out:test.dll", "/target:library", "test.vb", "blah.vb");
        }

        [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/79907")]
        public void StdLib()
        {
            var vbc = new Vbc
            {
                Sources = MSBuildUtil.CreateTaskItems("test.vb"),
            };

            AssertEx.Equal("/optionstrict:custom /out:test.exe test.vb", vbc.GenerateResponseFileContents());
        }
    }
}


}

class IsFutureOrSubtypeOf extends TypeRelation<FutureOrType> {
  const IsFutureOrSubtypeOf();

  @override
  IsSubtypeOf isInterfaceRelated(InterfaceType s, FutureOrType t, Types types) {
    return types
        // Rule 11.
        .performNullabilityAwareSubtypeCheck(
            s, t.typeArgument.withDeclaredNullability(t.nullability))
        // Rule 10.
        .orSubtypeCheckFor(
            s,
            new InterfaceType(types.hierarchy.coreTypes.futureClass,
                t.nullability, [t.typeArgument]),
            types);
  }

  @override
  IsSubtypeOf isFutureOrRelated(FutureOrType s, FutureOrType t, Types types) {
    // This follows from combining rules 7, 10, and 11.
    DartType sArgument = s.typeArgument;
    DartType tArgument = t.typeArgument;
    DartType sFutureOfArgument = new InterfaceType(
        types.hierarchy.coreTypes.futureClass,
        Nullability.nonNullable,
        [sArgument]);
    DartType tFutureOfArgument = new InterfaceType(
        types.hierarchy.coreTypes.futureClass,
        Nullability.nonNullable,
        [tArgument]);
    // The following is an optimized is-subtype-of test for the case where
    // both LHS and RHS are FutureOrs.  It's based on the following:
    // FutureOr<X> <: FutureOr<Y> iff X <: Y OR (X <: Future<Y> AND
    // Future<X> <: Y).
    //
    // The correctness of that can be shown as follows:
    //   1. FutureOr<X> <: FutureOr<Y> iff
    //
    //          X <: FutureOr<Y> AND Future<X> <: FutureOr<Y>
    //
    //   2a. X <: FutureOr<Y> iff
    //
    //          X <: Y OR X <: Future<Y>
    //
    //   2b. Future<X> <: FutureOr<Y> iff
    //
    //          Future<X> <: Y OR Future<X> <: Future<Y>
    //
    //   3. 1,2a,2b => FutureOr<X> <: FutureOr<Y> iff
    //
    //          (X <: Y OR X <: Future<Y>) AND
    //            (Future<X> <: Y OR Future<X> <: Future<Y>)
    //
    //   4. X <: Y iff Future<X> <: Future<Y>
    //
    //   5. 3,4 => FutureOr<X> <: FutureOr<Y> iff
    //
    //          (X <: Y OR X <: Future<Y>) AND
    //            (X <: Y OR Future<X> <: Y) iff
    //
    //          X <: Y OR (X <: Future<Y> AND Future<X> <: Y)
    //
    return types
        .performNullabilityAwareSubtypeCheck(sArgument, tArgument)
        .or(types
            .performNullabilityAwareSubtypeCheck(sArgument, tFutureOfArgument)
            .andSubtypeCheckFor(sFutureOfArgument, tArgument, types))
        .and(new IsSubtypeOf.basedSolelyOnNullabilities(s, t));
  }

  @override
  IsSubtypeOf isDynamicRelated(DynamicType s, FutureOrType t, Types types) {
    // Rule 11.
    return types.performNullabilityAwareSubtypeCheck(
        s, t.typeArgument.withDeclaredNullability(t.nullability));
  }

  @override
  IsSubtypeOf isVoidRelated(VoidType s, FutureOrType t, Types types) {
    // Rule 11.
    return types.performNullabilityAwareSubtypeCheck(
        s, t.typeArgument.withDeclaredNullability(t.nullability));
  }

  @override
  IsSubtypeOf isTypeParameterRelated(
      TypeParameterType s, FutureOrType t, Types types) {
    // TODO(cstefantsova): Revise the original optimization.
    return types
        // Rule 11.
        .performNullabilityAwareSubtypeCheck(
            s, t.typeArgument.withDeclaredNullability(t.nullability))


retStr += moment(from.toISOString()).format('LT')
        if (to) {
            to.setHours(to.getHours()+3);
            retStr += ' - ';
            retStr += moment(to.toISOString()).format('LT')
        }
        retStr += '</u>'
    }

    return retStr
}

import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import { TimeState } from './types'
import { toISO, toDate } from '../../utils/time'

export const timeSlice = createSlice({
  name: 'time',
  initialState: {
    displayTime: toISO(new Date())
  } as TimeState,
  reducers: {
    setStationTime: (state: TimeState, action: PayloadAction<string>) => {
      state.stationTime = toISO(toDate(action.payload))
    },
    setLocalTime: (state: TimeState, action: PayloadAction<string>) => {
      state.displayTime = toISO(toDate(action.payload))
    }
  }
})

export const { setStationTime, setLocalTime } = timeSlice.actions

export default timeSlice.reducer
import { DiceRollD20Name, DiceRollType, IRollData, IRollResults } from '../model/DiceRollInterfaces';
import { d20StatisticDisplayNames, IDiceRollerStatistics, IStatistic, IUserStatisticData } from '../model/StatisticsInterfaces';

/**
 * @description Calculates dice roll statistics from a game log.
 * @param rollData Roll data from a game log.
 * @param aliasMap Optional map of roller alias to combine roll data before calculating stats.
 * @returns An array of dice roller statistics.
 */
export const CalculateStatistics = (
  rollData: IRollData,
  aliasMap?: Record<string, string>
): IDiceRollerStatistics[] => {
  const groupedRolls = GroupRollsByAlias(rollData, aliasMap);
  return CalculateStatisticsFromGroupedRolls(groupedRolls);
};

const GroupRollsByAlias = (
  rollData: IRollData,
  aliasMap?: Record<string, string>
): Record<string, IRollResults> => {
  const groupedRolls: Record<string, IRollResults> = {};

  rollData.d20Rolls.forEach((roll) => {
    const rollerName = (aliasMap && aliasMap[roll.rollerName]) ?? roll.rollerName;

    if (!groupedRolls[rollerName]) {
      groupedRolls[rollerName] = { d20: [] };
    }

    groupedRolls[rollerName].d20.push(roll.result);
  });

  return groupedRolls;
};

const CalculateStatisticsFromGroupedRolls = (
  rollData: Record<string, IRollResults>
): IDiceRollerStatistics[] => {
  let playerStatisticsArray: IDiceRollerStatistics[] = [];

  for (const rollerName of Object.keys(rollData)) {
    const playerRollData = rollData[rollerName];

    const playerStatistics: IDiceRollerStatistics = {
      rollerName: rollerName,
      diceRollStatistics: []
    };

    if (playerRollData.d20) {
      const d20Stats = calculateD20Satistics(playerRollData.d20);
      playerStatistics.diceRollStatistics = [
        ...playerStatistics.diceRollStatistics,
        {
          rollCount: playerRollData.d20.length,
          rollType: DiceRollD20Name,
          statisticData: d20Stats
        }
      ];
    }

    playerStatisticsArray = [
      ...playerStatisticsArray,
      playerStatistics
    ]
  }

  return playerStatisticsArray;
}

const calculateD20Satistics = (rollResults: string[]): IUserStatisticData => {
  let totalSum = 0,
    max = 0,
    min = 20,
    oneCount = 0,
    twentyCount = 0,
    resultArray: number[] = [];

  for (const rollResult of rollResults) {
    const rollValue = +rollResult;
    resultArray.push(rollValue);


PrintLog(errMsg)
			}
		}

		if *shutdownType == "ssh" {
			cmd := exec.Command("/usr/bin/sshpass", "-p", *sshPwd, "/usr/bin/ssh", "-o", "StrictHostKeyChecking=no", *sshHost, "-p", *sshPort, *sshRun)
			//cmd := exec.Command("/usr/bin/sshpass", "-p", *sshPwd, "/usr/bin/ssh", "-o", "StrictHostKeyChecking=no", *sshHost, "-p", *sshPort, "shutdown -h now")
			e := cmd.Run()
			if e != nil {
				if e.Error() != "exit status 255" {
					errMsg = fmt.Sprintf("【%s】ssh关机命令执行失败：%s", *name, e.Error())
					PrintLog(errMsg)
				}
			}
		}
	}
}

func Task(url string) {

	startTime, err := GetLastestBootTime()
	if err != nil {
		errMsg := fmt.Sprintf("【%s】获取开机时间报错：%s", *name, err.Error())
		PrintLog(errMsg)
		return
	}

	if startTime < *start {
		log.Println("处于开机延迟时间 不监测")
		return
	}

	json, err := GetUrl(url)
	if err != nil {
		log.Println("Http请求发生错误：", err.Error())
		return
	}

	t := time.Now()

	for _, k := range json.Interfaces {
		if *interfacesName == k.Name {
			for _, m := range k.Traffic.Month {
				if t.Year() == m.Date.Year && int(t.Month()) == m.Date.Month {
					tx := ConvertFileSize(float64(m.Tx)) // 上传
					rx := ConvertFileSize(float64(m.Rx)) // 下载

					log.Printf("%s：%s：↑ %.2fGB  ↓ %.2fGB\n", *name, k.Name, tx, rx)

					if *model == 1 {
						if *gb < tx {
							// 上传流量达到限制
							Exceed(*name, k.Name, tx, rx)
						}
					} else if *model == 2 {
						if *gb < (tx + rx) {
							// 上传+下载流量达到限制
							Exceed(*name, k.Name, tx, rx)
						}
					}
				}
			}
		}
	}
}

func Verify() bool {
	flag.Parse()

	_, err := net.ResolveTCPAddr("tcp", *host)
	if err != nil {
		errMsg := fmt.Sprintf("【%s】vnstat的Host参数解析错误", *name)
		PrintLog(errMsg)
		return false
	}

	if *gb == 0 {
		errMsg := fmt.Sprintf("【%s】GB参数不能为0", *name)
		PrintLog(errMsg)
		return false
	}

	if *model != 1 && *model != 2 {
		errMsg := fmt.Sprintf("【%s】不存在的模式", *name)
		PrintLog(errMsg)
		return false
	}

	if *interfacesName == "" {
		errMsg := fmt.Sprintf("【%s】INTERFACE参数不能为空！", *name)
		PrintLog(errMsg)
		return false
	}

	if *shutdownType == "ssh" {
		if *sshHost == "" {
			errMsg := fmt.Sprintf("【%s】SSHHOST参数不能为空！", *name)
			PrintLog(errMsg)
			return false
		}
	}
	return true
}

var host = flag.String("host", "", "vnstat的IP和端口 格式：IP:


 already built
	if prog.handle != 0 {
		return fmt.Errorf("program already built")
	}

	// Check if shaders were provided
	if len(prog.shaders) == 0 {
		return fmt.Errorf("no shaders supplied")
	}

	// Create program
	prog.handle = prog.gs.CreateProgram()
	if prog.handle == 0 {
		return fmt.Errorf("error creating program")
	}

	// Clean unused GL allocated resources
	defer prog.DeleteShaders()

	// Compile and attach shaders
	for _, sinfo := range prog.shaders {
		shader, err := prog.CompileShader(sinfo.stype, sinfo.source)
		if err != nil {
			prog.gs.DeleteProgram(prog.handle)
			prog.handle = 0
			msg := fmt.Sprintf("error compiling %s: %s", shaderNames[sinfo.stype], err)
			if prog.ShowSource {
				msg += FormatSource(sinfo.source)
			}
			return errors.New(msg)
		}
		sinfo.handle = shader
		prog.gs.AttachShader(prog.handle, shader)
	}

	// Link program and check for errors
	prog.gs.LinkProgram(prog.handle)
	var status int32
	prog.gs.GetProgramiv(prog.handle, LINK_STATUS, &status)
	if status == FALSE {
		log := prog.gs.GetProgramInfoLog(prog.handle)
		prog.handle = 0
		return fmt.Errorf("error linking program: %v", log)
	}

	return nil
}

// GetAttribLocation returns the location of the specified attribute
// in this program. This location is internally cached.
func (prog *Program) GetAttribLocation(name string) int32 {

	return prog.gs.GetAttribLocation(prog.handle, name)
}

// GetUniformLocation returns the location of the specified uniform in this program.
// This location is internally cached.
func (prog *Program) GetUniformLocation(name string) int32 {

	// Try to get from the cache
	loc, ok := prog.uniforms[name]
	if ok {
		prog.gs.stats.UnilocHits++
		return loc
	}

	// Get location from OpenGL
	loc = prog.gs.GetUniformLocation(prog.handle, name)
	prog.gs.stats.UnilocMiss++

	// Cache result
	prog.uniforms[name] = loc
	if loc < 0 {
		log.Warn("Program.GetUniformLocation(%s): NOT FOUND", name)
	}

	return loc
}

// CompileShader creates and compiles an OpenGL shader of the specified type, with
// the specified source code, and returns a non-zero value by which it can be referenced.
func (prog *Program) CompileShader(stype uint32, source string) (uint32, error) {

	// Create shader object
	shader := prog.gs.CreateShader(stype)
	if shader == 0 {
		return 0, fmt.Errorf("error creating shader")
	}

	// Set shader source and compile it
	prog.gs.ShaderSource(shader, source)
	prog.gs.CompileShader(shader)

	// Get the shader compiler log
	slog := prog.gs.GetShaderInfoLog(shader)

	// Get the shader compile status
	var status int32
	prog.gs.GetShaderiv(shader, COMPILE_STATUS, &status)
	if status == FALSE {
		return shader, fmt.Errorf("%s", slog)
	}

	// If the shader compiled OK but the log has data,
	// log this data instead of returning error
	if len(slog) > 2 {
		log.Warn("%s", slog)
	}

	return shader, nil
}

// FormatSource returns the supplied program source code with
// line numbers prepended.
func FormatSource(source string) string {

	// Reads all lines from the source string
	lines := make([]string, 0)
	buf := bytes.NewBu


 once when the socket gets an "error", which will pass true to this callback,
-- and then another time for it finally "disconnecting" (which will pass false).
function ws:onDisconnected(errored)
    print("Socket disconnected", errored, self:getState())
end

-- This is called whenever the socket receives a message.
function ws:onMessage(msg)
    print("Socket got a message: ", msg)

    if msg == "Test" then
        -- Send another message
        self:write("Exit")
    elseif msg == "Exit" then
        -- Close the socket
        self:close()
    end
end

-- Connect to the server
ws:connect()


본인확인제 시행에 따른 본인확인, 서비스 부정이용 방지, 각종 고지·통지, 고충처리, 분쟁 조정을 위한 기록 보존 등을 목적으로 개인정보를 처리합니다.

    - 민원사무 처리

        민원사항 확인, 사실조사를 위한 연락·통지, 처리결과 통보 등을 목적으로 개인정보를 처리합니다.

    - 재화 또는 서비스 제공

        콘텐츠 제공 등을 목적으로 개인정보를 처리합니다.
2. 개인정보 파일 현황

    개인정보 파일명 : 별점개인정보처리방침
    - 개인정보 항목 : 이메일, 비밀번호, 로그인ID, 서비스 이용 기록
    - 수집방법 : 홈페이지, 어플
    - 보유근거 : 비밀번호찾기위한수집, 서비스이용을 위한 수집
    - 보유기간 : 회원이 해지할때 까지

3. 개인정보의 처리 및 보유 기간

    - 회사는 법령에 따른 개인정보 보유·이용기간 또는 정보주체로부터 개인정보를 수집시에 동의 받은 개인정보 보유,이용기간 내에서 개인정보를 처리,보유합니다.
    - 각각의 개인정보 처리 및 보유 기간은 다음과 같습니다.

    <홈페이지 회원가입 및 관리>
    <홈페이지 회원가입 및 관리>와 관련한 개인정보는 수집.이용에 관한 동의일로부터<회원 해지시 까지>까지 위 이용목적을 위하여 보유.이용됩니다.
        -보유근거 : 비밀번호찾기위한수집, 서비스이용을 위한 수집

4. 정보주체와 법정대리인의 권리·의무 및 그 행사방법 이용자는 개인정보주체로써 다음과 같은 권리를 행사할 수 있습니다.

    ① 정보주체는 별점에 대해 언제든지 개인정보 열람,정정,삭제,처리정지 요구 등의 권리를 행사할 수 있습니다.

    ② 제1항에 따른 권리 행사는별점에 대해 개인정보 보호법 시행령 제41조제1항에 따라 서면, 전자우편, 모사전송(FAX) 등을 통하여 하실 수 있으며 �


    console.log('g');
};

```

`f`成功被打印出来,而`g函数`出现了类型错误,这是什么原因呢?

```javascript
executionContextObj = {
    'scopeChain': { ... },
    'variableObject': { f: pointer to function f(), g: undefined},
    'this': {...}
}

f();
g();
//函数声明
function f() {
    console.log('f');
}
//函数表达式
var g = function() {
    console.log('g');
};
```

我们看到,在预解释阶段函数声明的`f`是被指向了正确的函数得以执行,而函数表达式`g`被赋予`undefined`,`undefined`无法被当作函数执行因此报错`g is not a function`.

## 冲突处理

通常情况下我们不会将同一变量变量重复声明,但是出现了类似情况后,编译器会如何处理这些冲突呢?

1. 变量之间冲突

执行以下函数:

```javascript
var a = 3;
var a = 4;
console.log(a);
```

结果显而易见,后声明变量值覆盖前者的值
2. 函数之间冲突

```javascript
f();
function f() {
    console.log('f');
}

function f () {
    console.log('g');
};
```

结果同变量冲突,后者覆盖前者.

3.函数与变量之间冲突

```javascript
console.log(f);

function f() {
    console.log('f');
}
var f ='g';
```

结果如下,函数声明将覆盖变量声明

`[Function: f]`

## ES6中的let

在ES6中出现了两个最新的声明语法`let`与`const`,我们以`let`为例,进行测试看看与`var`的区别.

```javascript
function f() {
  console.log(a);
  let a = 2;
}
f(); // ReferenceError: a is not defined
```

这段代码直接报错显示未定义,`let`与`const`拥有类似的特性,阻止了变量提升,当代码执行到`console.log(a)`时,执行换将中`a`还从未被定义,因此产生了错误.

---

## 公众号

想要实时关注笔者最新的文章和最新的文档更新请关注公众号**程序员面试官**,后续的文章会优先在公众号更新.

**简历模板:** 关注公众号回复「模板」获取

**《前端面试手册》:** 配套于本指南的突击手册,关注公众号回复「fed」获取

![2019-08-12-03-18-41]( https://xiaomuzhu-image.oss-cn-beijing.aliyuncs.com/d846f65d5025c4b6c461966


();
		return this.formatTimeNum(hours) + ":" + this.formatTimeNum(minute) + ":" + this.formatTimeNum(second);
	};
    /**
     * 格式7  X天/X小时/<1小时
     * @param  {number} ms		毫秒
     * @returns string
     */
	public static format_7(ms) {
		if (ms < this.MS_PER_HOUR) {
			return "<1小时";
		}
		else if (ms < this.MS_PER_DAY) {
			return Math.floor(ms / this.MS_PER_HOUR) + "小时";
		}
		else {
			return Math.floor(ms / this.MS_PER_DAY) + "天";
		}
	};
    /**
     * 格式8  yyyy-mm-dd h:m
     * @param  {number} ms		毫秒
     * @returns string			返回自1970年1月1号0点开始的对应的时间点（不包含秒）
     */
	public static format_8(ms) {
		ms -= this.TIME_ZONE_OFFSET; //返回的是本地时间，中国位于东八区，要处理时区偏移
		var date = new Date(ms);
		var year = date.getFullYear();
		var month = date.getMonth() + 1; //返回的月份从0-11；
		var day = date.getDate();
		var hours = date.getHours();
		var minute = date.getMinutes();
		return year + "-" + month + "-" + day + " " + hours + ":" + minute;
	};

	public static format_14(ms: number) {
		var date = new Date(ms || 0);
		var year = date.getFullYear();
		var month = date.getMonth() + 1; //返回的月份从0-11；
		var day = date.getDate();
		var hours = date.getHours();
		var minute = date.getMinutes();
		return year + "年" + month + "月" + day + "日"
	}

	public static format_15(ms: number) {
		var date = new Date(ms || 0);
		var year = date.getFullYear();
		var month = date.getMonth() + 1; //返回的月份从0-11；
		var day = date.getDate();
		var hours = date.getHours();
		var minute = date.getMinutes();
		return year + "-" + month + "-" + day
	}

	public static format_16(time: number, showM?: boolean): string {
		let str
		if (time >= DateUtils.MS_PER_DAY) {
			let d = Math.floor(time / DateUtils.MS_PER_DAY)
			let h = Math.floor(time % DateUtils.MS_PER_DAY / DateUtils.MS_PER_HOUR)
			str = d + "天" + h + "时"
			if (showM)
			{
				let m = Math.floor(time % DateUtils.MS_PER_HOUR / 60)
				str += m + "分"
			}
			return str
		}else
		{
			return this.format_1(time)
		}

	}

	public static format_17(time: number): string {
		let str
		if (time >= DateUtils.MS_PER_DAY) {
			let d = Math.floor(time / DateUtils.MS_PER_DAY)
			let h = Math.floor(time % DateUtils.MS_PER_DAY / DateUtils.MS_PER_HOUR)
			let m = Math.floor(time % DateUtils.MS_PER_HOUR / DateUtils.MS_PER_MINUTE)
			let s = Math.floor(


e operations of [next] lambda
 * using a trampoline method. This allows [next] function to be executed without exhausting call stack.
 */
internal fun  Arb.trampoline(next: (Sample) -> Arb): Arb = when (this) {
   is TrampolineArb -> this.thunk(next)
   else -> TrampolineArb(this).thunk(next)
}

/**
 * The [TrampolineArb] is a special Arb that exchanges call stack with heap.
 * In a nutshell, this arb stores command chains to be applied to the original arb inside a list.
 * This technique is an imperative reduction of Free Monads. This eliminates the need of creating intermediate
 * Trampoline Monad and tail-recursive function on those which can be expensive.
 * This minimizes the amount of code and unnecessary object allocation during sample generation in the expense of typesafety.
 *
 * This is an internal implementation. Do not use this TrampolineArb as is and please do not expose this
 * to users outside of the library. For library maintainers, please use the [Arb.trampoline] extension function.
 * The extension function will provide some type-guardrails to workaround the loss of types within this Arb.
 */
@Suppress("UNCHECKED_CAST")
internal class TrampolineArb private constructor(
   private val first: Arb,
   private val commands: List<(Sample<Any>) -> Arb<Any>>
) : Arb() {
   constructor(first: Arb) : this(first, emptyList())

   fun  thunk(fn: (Sample) -> Arb): TrampolineArb =
      TrampolineArb(
         first,
         commands + (fn as (Sample<Any>) -> Arb<Any>)
      ) as TrampolineArb

   override fun edgecase(rs: RandomSource): Sample? =
      commands
         .fold(first) { currentArb, next ->
            val currentEdge = currentArb.edgecase(rs) ?: currentArb.sample(rs)
            next(currentEdge as Sample<Any>) as Arb
         }
         .edgecase(rs)

   override fun sample(rs: RandomSource): Sample =
      commands
         .fold(first as Arb<Any>) { currentArb, next ->
            next(currentArb.sample(rs))
         }
         .sample(rs) as Sample
}
package io.kotest.property.arbitrary

import io.kotest.property.Arb
import io.kotest.property.Exhaustive
import io.kotest.property.Gen
import io.kotest.property.RTree
import io.kotest.property.RandomSource
import io.kotest.property.Sample
import io.kotest.property.asSample

fun  Arb.Companion.bind(
   genA: Gen,
   genB: Gen,
   bindFn: (A, B) -> T
): Arb<T> =
   Arb.bindN(
      genA,
      genB,
      Arb.unit(),
      Arb.unit(),
      Arb.unit(),
      Arb.unit(),
      Arb.unit(),
      Arb.unit(),
      Arb.unit(),
      Arb.unit(),
      Arb.unit(),
      Arb.unit(),
      Arb.unit(),
      Arb.unit()
   ) { a, b, _, _, _, _, _, _, _, _, _, _, _, _ ->
      bindFn(a, b)
   }

fun  Arb.Companion.bind(
   genA: Gen,
   genB: Gen,
   genC: Gen<C>,
   bindFn: (A, B, C) -> T
): Arb<T> = Arb.bindN(
   genA,
   genB,
   genC,
   Arb.unit(),
   Arb.unit(),
   Arb.unit(),
   Arb.unit(),


_;
    private com.google.protobuf.MapField<java.lang.Integer, emu.grasscutter.net.proto.VintagePresentStageDataOuterClass.VintagePresentStageData>
    internalGetUnk3300PCIIGPJJHGF() {
      if (unk3300PCIIGPJJHGF_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            Unk3300PCIIGPJJHGFDefaultEntryHolder.defaultEntry);
      }
      return unk3300PCIIGPJJHGF_;
    }

    public int getUnk3300PCIIGPJJHGFCount() {
      return internalGetUnk3300PCIIGPJJHGF().getMap().size();
    }
    /**
     * map<uint32, .VintagePresentStageData> Unk3300_PCIIGPJJHGF = 11;
     */

    @java.lang.Override
    public boolean containsUnk3300PCIIGPJJHGF(
        int key) {

      return internalGetUnk3300PCIIGPJJHGF().getMap().containsKey(key);
    }
    /**
     * Use {@link #getUnk3300PCIIGPJJHGFMap()} instead.
     */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.Integer, emu.grasscutter.net.proto.VintagePresentStageDataOuterClass.VintagePresentStageData> getUnk3300PCIIGPJJHGF() {
      return getUnk3300PCIIGPJJHGFMap();
    }
    /**
     * map<uint32, .VintagePresentStageData> Unk3300_PCIIGPJJHGF = 11;
     */
    @java.lang.Override

    public java.util.Map<java.lang.Integer, emu.grasscutter.net.proto.VintagePresentStageDataOuterClass.VintagePresentStageData> getUnk3300PCIIGPJJHGFMap() {
      return internalGetUnk3300PCIIGPJJHGF().getMap();
    }
    /**
     * map<uint32, .VintagePresentStageData> Unk3300_PCIIGPJJHGF = 11;
     */
    @java.lang.Override

    public emu.grasscutter.net.proto.VintagePresentStageDataOuterClass.VintagePresentStageData getUnk3300PCIIGPJJHGFOrDefault(
        int key,
        emu.grasscutter.net.proto.VintagePresentStageDataOuterClass.VintagePresentStageData defaultValue) {

      java.util.Map<java.lang.Integer, emu.grasscutter.net.proto.VintagePresentStageDataOuterClass.VintagePresentStageData> map =
          internalGetUnk3300PCIIGPJJHGF().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * map<uint32, .VintagePresentStageData> Unk3300_PCIIGPJJHGF = 11;
     */
    @java.lang.Override

    public emu.grasscutter.net.proto.VintagePresentStageDataOuterClass.VintagePresentStageData getUnk3300PCIIGPJJHGFOrThrow(
        int key) {

      java.util.Map<java.lang.Integer, emu.grasscutter.net.proto.VintagePresentStageDataOuterClass.VintagePresentStageData> map =
          internalGetUnk3300PCIIGPJJHGF().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public static final int IS_CONTENT_CLOSED_FIELD_NUMBER = 13;
    private boolean isContentClosed_;
    /**
     * bool is_content_closed = 13;
     * @return The isContentClosed.
     */
    @j


workPropertyMetadata((ImageSource)null);
            ImageProperty = DependencyProperty.RegisterAttached(
                "Image",
                typeof(ImageSource),
                typeof(KeyNotPressed),
                metadata);
        }

        /// <summary>
        /// The get image.
        /// </summary>
        /// <param name="obj">
        /// The object.
        /// </param>
        /// <returns>
        /// The <see cref="ImageSource"/>.
        /// </returns>
        public static ImageSource GetImage(DependencyObject obj)
        {
            return (ImageSource)obj.GetValue(ImageProperty);
        }

        /// <summary>
        /// The set image.
        /// </summary>
        /// <param name="obj">
        /// The object.
        /// </param>
        /// <param name="value">
        /// The value.
        /// </param>
        public static void SetImage(DependencyObject obj, ImageSource value)
        {
            obj.SetValue(ImageProperty, value);
        }
    }
}


.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.
 */
@file:Suppress("ktlint:standard:property-naming")

package com.squareup.zstd

import assertk.assertThat
import assertk.assertions.isEqualTo
import assertk.assertions.isNull
import kotlin.test.Test
import okio.Buffer.UnsafeCursor
import okio.ByteString
import okio.ByteString.Companion.decodeHex
import okio.ByteString.Companion.encodeUtf8
import okio.ByteString.Companion.toByteString
import okio.IOException

// From ZSTD_ErrorCode in zstd_errors.h. This is a small subset!
internal const val ZSTD_error_no_error = 0L
internal const val ZSTD_error_GENERIC = -1L

// From ZSTD_cParameter in zstd.h. This is a small subset!
internal const val ZSTD_c_compressionLevel = 100
internal const val ZSTD_c_checksumFlag = 201

/**
 * Exercise the native bindings.
 */
internal class ZstdTest {
  private val helloWorld = "hello world".encodeUtf8()
  private val helloWorldZstd = "28b52ffd200b59000068656c6c6f20776f726c64".decodeHex()

  @Test
  fun getErrorName() {
    assertThat(getErrorName(ZSTD_error_no_error)).isNull()
    assertThat(getErrorName(ZSTD_error_GENERIC))
      .isEqualTo("Error (generic)")
  }

  @Test
  fun compress() {
    assertThat(oneShotCompress(helloWorld)).isEqualTo(helloWorldZstd)
  }

  @Test
  fun customOptions() {
    assertThat(
      oneShotCompress(
        original = helloWorld,
        compressionLevel = 7,
      ),
    ).isEqualTo("28b52ffd200b59000068656c6c6f20776f726c64".decodeHex())

    assertThat(
      oneShotCompress(
        original = helloWorld,
        checksumFlag = 1,
      ),
    ).isEqualTo("28b52ffd240b59000068656c6c6f20776f726c6468691eb2".decodeHex())

    assertThat(
      oneShotCompress(
        original = helloWorld,
        compressionLevel = 7,
        checksumFlag = 1,
      ),
    ).isEqualTo("28b52ffd240b59000068656c6c6f20776f726c6468691eb2".decodeHex())
  }

  @Test
  fun decompress() {
    assertThat(oneShotDecompress(helloWorldZstd)).isEqualTo(helloWorld)
  }

  @Test
  fun compressWithOffsets() {
    assertThat(
      oneShotCompress(
        original = helloWorld,
        inputOffset = 5,
        inputPadding = 7,
        outputOffset = 9,
      ),
    ).isEqualTo(helloWorldZstd)
  }

  @Test
  fun decompressWithOffsets() {
    assertThat(
      oneShotDecompress(
        compressed = helloWorldZstd,
        inputOffset = 5,
        inputPadding = 7,
        outputOffset = 9,
      ),
    ).isEqualTo(helloWorld)
  }
}

fun oneShotCompress(
  original: ByteString,
  inputOffset: Int = 0,
  inputPadding: Int = 0,
  outputOffset: Int = 0,
  compressionLevel: Int? = null,
  checksumFlag: Int? = null,
  outputArraySize: Int = 1024,
): ByteString {
  val compressor = zstdCompressor()
  try {
    compressionLevel?.let {
      compressor.setParameter(ZSTD_c_compressionLevel, it).checkError()
    }
    checksumFlag?.let {
      compressor.setParameter(ZSTD_c_checksumFlag, it).checkError()


UBJSON: write number (signed integer)
    template<typename NumberType, typename std::enable_if<
                 std::is_signed<NumberType>::value and
                 not std::is_floating_point<NumberType>::value, int>::type = 0>
    void write_number_with_ubjson_prefix(const NumberType n,
                                         const bool add_prefix)
    {
        if ((std::numeric_limits<int8_t>::min)() <= n and n <= (std::numeric_limits<int8_t>::max)())
        {
            if (add_prefix)
            {
                oa->write_character(static_cast<CharType>('i'));  // int8
            }
            write_number(static_cast<int8_t>(n));
        }
        else if (static_cast<int64_t>((std::numeric_limits<uint8_t>::min)()) <= n and n <= static_cast<int64_t>((std::numeric_limits<uint8_t>::max)()))
        {
            if (add_prefix)
            {
                oa->write_character(static_cast<CharType>('U'));  // uint8
            }
            write_number(static_cast<uint8_t>(n));
        }
        else if ((std::numeric_limits<int16_t>::min)() <= n and n <= (std::numeric_limits<int16_t>::max)())
        {
            if (add_prefix)
            {
                oa->write_character(static_cast<CharType>('I'));  // int16
            }
            write_number(static_cast<int16_t>(n));
        }
        else if ((std::numeric_limits<int32_t>::min)() <= n and n <= (std::numeric_limits<int32_t>::max)())
        {
            if (add_prefix)
            {
                oa->write_character(static_cast<CharType>('l'));  // int32
            }
            write_number(static_cast<int32_t>(n));
        }
        else if ((std::numeric_limits<int64_t>::min)() <= n and n <= (std::numeric_limits<int64_t>::max)())
        {
            if (add_prefix)
            {
                oa->write_character(static_cast<CharType>('L'));  // int64
            }
            write_number(static_cast<int64_t>(n));
        }
        // LCOV_EXCL_START
        else
        {
            JSON_THROW(out_of_range::create(407, "number overflow serializing " + std::to_string(n)));
        }
        // LCOV_EXCL_STOP
    }

    /*!
    @brief determine the type prefix of container values

    @note This function does not need to be 100% accurate when it comes to
          integer limits. In case a number exceeds the limits of int64_t,
          this will be detected by a later call to function
          write_number_with_ubjson_prefix. Therefore, we return 'L' for any
          value that does not fit the previous limits.
    */
    char ubjson_prefix(const BasicJsonType& j) const noexcept
    {
        switch (j.type())
        {
            case value_t::null:
                return 'Z';

            case value_t::boolean:
                return j.m_value.boolean ? 'T' : 'F';

            case value_t::number_integer:
            {
                if ((std::numeric_limits<int8_t>::min)() <= j.m_value.number_integer and j.m_value.number_integer <= (std::numeric_limits<int8_t>::max)())
                {
                    return 'i';
                }
                else if ((std::numeric_limits<uint8_t>::min)() <= j.m_value.number_integer and j.m_value.number_integer <= (std::numeric_limits<uint8_t>::max)())
                {
                    return 'U';
                }
                else if ((std::numeric_limits<int16_t>::min)() <= j.m_value.number_integer and j.m_value.