text:
#include "config.h"
#include "core/animation/Animation.h"

#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
#include "core/animation/ActiveAnimations.h"
#include "core/animation/AnimationPlayer.h"
#include "core/animation/AnimationTimeline.h"
#include "core/animation/CompositorAnimations.h"
#include "core/animation/Interpolation.h"
#include "core/animation/KeyframeEffectModel.h"
#include "core/dom/Element.h"
#include "core/dom/NodeRenderStyle.h"
#include "core/frame/UseCounter.h"
#include "core/rendering/RenderLayer.h"

namespace blink {

PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, PassOwnPtrWillBeRawPtr<EventDelegate> eventDelegate)
{
    return adoptRefWillBeNoop(new Animation(target, effect, timing, priority, eventDelegate));
}

PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Dictionary& timingInputDictionary)
{
    ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
    return create(element, effect, TimingInput::convert(timingInputDictionary));
}
PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr<AnimationEffect> effect, double duration)
{
    ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
    return create(element, effect, TimingInput::convert(duration));
}
PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr<AnimationEffect> effect)
{
    ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
    return create(element, effect, Timing());
}
PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, ExceptionState& exceptionState)
{
    ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
    if (element)
        UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
    return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(timingInputDictionary));
}
PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
{
    ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
    if (element)
        UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectDoubleTiming);
    return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(duration));
}
PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState)
{
    ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
    if (element)
        UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectNoTiming);
    return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), Timing());
}

Animation::Animation(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, PassOwnPtrWillBeRawPtr<EventDelegate> eventDelegate)
    : AnimationNode(timing, eventDelegate)
    , m_target(target)
    , m_effect(effect)
    , m_sampledEffect(nullptr)
    , m_priority(priority)
{
#if !ENABLE(OILPAN)
    if (m_target)
        m_target->ensureActiveAnimations().addAnimation(this);
#endif
}

Animation::~Animation()
{
#if !ENABLE(OILPAN)
    if (m_target)
        m_target->activeAnimations()->notifyAnimationDestroyed(this);
#endif
}

void Animation::attach(AnimationPlayer* player)
{
    if (m_target) {
        m_target->ensureActiveAnimations().players().add(player);
        m_target->setNeedsAnimationStyleRecalc();
    }
    AnimationNode::attach(player);
}

void Animation::detach()
{
    if (m_target)
        m_target->activeAnimations()->players().remove(player());
    if (m_sampledEffect)
        clearEffects();
    AnimationNode::detach();
}

void Animation::specifiedTimingChanged()
{
    if (player()) {
        // FIXME: Needs to consider groups when added.
        ASSERT(player()->source() == this);
        player()->setCompositorPending(true);
    }
}

static AnimationStack& ensureAnimationStack(Element* element)
{
    return element->ensureActiveAnimations().defaultStack();
}

void Animation::applyEffects()
{
    ASSERT(isInEffect());
    ASSERT(player());
    if (!m_target || !m_effect)
        return;

    double iteration = currentIteration();
    ASSERT(iteration >= 0);
    OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > interpolations = m_sampledEffect ? m_sampledEffect->mutableInterpolations() : nullptr;
    // FIXME: Handle iteration values which overflow int.
    m_effect->sample(static_cast<int>(iteration), timeFraction(), iterationDuration(), interpolations);
    if (m_sampledEffect) {
        m_sampledEffect->setInterpolations(interpolations.release());
    } else if (interpolations && !interpolations->isEmpty()) {
        OwnPtrWillBeRawPtr<SampledEffect> sampledEffect = SampledEffect::create(this, interpolations.release());
        m_sampledEffect = sampledEffect.get();
        ensureAnimationStack(m_target).add(sampledEffect.release());
    } else {
        return;
    }

    m_target->setNeedsAnimationStyleRecalc();
}

void Animation::clearEffects()
{
    ASSERT(player());
    ASSERT(m_sampledEffect);

    m_sampledEffect->clear();
    m_sampledEffect = nullptr;
    cancelAnimationOnCompositor();
    m_target->setNeedsAnimationStyleRecalc();
    invalidate();
}

void Animation::updateChildrenAndEffects() const
{
    if (!m_effect)
        return;
    if (isInEffect())
        const_cast<Animation*>(this)->applyEffects();
    else if (m_sampledEffect)
        const_cast<Animation*>(this)->clearEffects();
}

double Animation::calculateTimeToEffectChange(bool forwards, double localTime, double timeToNextIteration) const
{
    const double start = startTimeInternal() + specifiedTiming().startDelay;
    const double end = start + activeDurationInternal();

    switch (phase()) {
    case PhaseNone:
        return std::numeric_limits<double>::infinity();
    case PhaseBefore:
        ASSERT(start >= localTime);
        return forwards
            ? start - localTime
            : std::numeric_limits<double>::infinity();
    case PhaseActive:
        if (forwards) {
            // Need service to apply fill / fire events.
            const double timeToEnd = end - localTime;
            if (requiresIterationEvents()) {
                return std::min(timeToEnd, timeToNextIteration);
            }
            return timeToEnd;
        }
        return 0;
    case PhaseAfter:
        ASSERT(localTime >= end);
        // If this Animation is still in effect then it will need to update
        // when its parent goes out of effect. We have no way of knowing when
        // that will be, however, so the parent will need to supply it.
        return forwards
            ? std::numeric_limits<double>::infinity()
            : localTime - end;
    default:
        ASSERT_NOT_REACHED();
        return std::numeric_limits<double>::infinity();
    }
}

void Animation::notifySampledEffectRemovedFromAnimationStack()
{
    ASSERT(m_sampledEffect);
    m_sampledEffect = nullptr;
}

#if !ENABLE(OILPAN)
void Animation::notifyElementDestroyed()
{
    // If our player is kept alive just by the sampledEffect, we might get our
    // destructor called when we call SampledEffect::clear(), so we need to
    // clear m_sampledEffect first.
    m_target = nullptr;
    clearEventDelegate();
    SampledEffect* sampledEffect = m_sampledEffect;
    m_sampledEffect = nullptr;
    if (sampledEffect)
        sampledEffect->clear();
}
#endif

bool Animation::isCandidateForAnimationOnCompositor(double playerPlaybackRate) const
{
    if (!effect()
        || !m_target
        || (m_target->renderStyle() && m_target->renderStyle()->hasMotionPath()))
        return false;

    return CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(specifiedTiming(), *effect(), playerPlaybackRate);
}

bool Animation::maybeStartAnimationOnCompositor(int group, double startTime, double currentTime, double playerPlaybackRate)
{
    ASSERT(!hasActiveAnimationsOnCompositor());
    if (!isCandidateForAnimationOnCompositor(playerPlaybackRate))
        return false;
    if (!CompositorAnimations::instance()->canStartAnimationOnCompositor(*m_target))
        return false;
    if (!CompositorAnimations::instance()->startAnimationOnCompositor(*m_target, group, startTime, currentTime, specifiedTiming(), *effect(), m_compositorAnimationIds, playerPlaybackRate))
        return false;
    ASSERT(!m_compositorAnimationIds.isEmpty());
    return true;
}

bool Animation::hasActiveAnimationsOnCompositor() const
{
    return !m_compositorAnimationIds.isEmpty();
}

bool Animation::hasActiveAnimationsOnCompositor(CSSPropertyID property) const
{
    return hasActiveAnimationsOnCompositor() && affects(property);
}

bool Animation::affects(CSSPropertyID property) const
{
    return m_effect && m_effect->affects(property);
}

void Animation::cancelAnimationOnCompositor()
{
    // FIXME: cancelAnimationOnCompositor is called from withins style recalc.
    // This queries compositingState, which is not necessarily up to date.
    // https://code.google.com/p/chromium/issues/detail?id=339847
    DisableCompositingQueryAsserts disabler;
    if (!hasActiveAnimationsOnCompositor())
        return;
    if (!m_target || !m_target->renderer())
        return;
    for (const auto& compositorAnimationId : m_compositorAnimationIds)
        CompositorAnimations::instance()->cancelAnimationOnCompositor(*m_target, compositorAnimationId);
    m_compositorAnimationIds.clear();
    player()->setCompositorPending(true);
}

void Animation::pauseAnimationForTestingOnCompositor(double pauseTime)
{
    ASSERT(hasActiveAnimationsOnCompositor());
    if (!m_target || !m_target->renderer())
        return;
    for (const auto& compositorAnimationId : m_compositorAnimationIds)
        CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*m_target, compositorAnimationId, pauseTime);
}

void Animation::trace(Visitor* visitor)
{
    visitor->trace(m_target);
    visitor->trace(m_effect);
    visitor->trace(m_sampledEffect);
    AnimationNode::trace(visitor);
}

} // namespace blink


text:
package org.testng.junit;

import org.junit.runner.Description;

/**
 *
 * @author lukas
 */
public class JUnit4TestClass extends JUnitTestClass {

    public JUnit4TestClass(Description test) {
        super(test.getTestClass());
    }
}

redpajama_set_name: RedPajamaGithub


text:
partial class frmMain : System.Windows.Forms.Form
{

    //Form 重写 Dispose,以清理组件列表。
    [System.Diagnostics.DebuggerNonUserCode()]
    protected override void Dispose(bool disposing)
    {
        try
        {
            if (disposing && components != null)
            {
                components.Dispose();
            }
            if (disposing && server != null)
            {
                server.StopServer();
            }
        }
        finally
        {
            base.Dispose(disposing);
        }
    }

    //Windows 窗体设计器所必需的

    private System.ComponentModel.IContainer components;
    //注意:  以下过程是 Windows 窗体设计器所必需的
    //可以使用 Windows 窗体设计器修改它。
    //不要使用代码编辑器修改它。
    [System.Diagnostics.DebuggerStepThrough()]
    private void InitializeComponent()
    {
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
        this.labNets = new System.Windows.Forms.Label();
        this.combNets = new System.Windows.Forms.ComboBox();
        this.txtNetAddress = new System.Windows.Forms.TextBox();
        this.Label1 = new System.Windows.Forms.Label();
        this.labTCPPort = new System.Windows.Forms.Label();
        this.labHTTPPort = new System.Windows.Forms.Label();
        this.txtTcpPort = new System.Windows.Forms.TextBox();
        this.txtHTTPPort = new System.Windows.Forms.TextBox();
        this.btnSetting = new System.Windows.Forms.Button();
        this.qrcodeControl = new Smobiler.Utility.Encoding.Windows.Forms.QrCodeImgControl();
        this.btnHelp = new System.Windows.Forms.Button();
        this.label2 = new System.Windows.Forms.Label();
        this.btnsavename = new System.Windows.Forms.Button();
        this.txtName = new System.Windows.Forms.TextBox();
        this.btnGenerateQRcode = new System.Windows.Forms.Button();
        ((System.ComponentModel.ISupportInitialize)(this.qrcodeControl)).BeginInit();
        this.SuspendLayout();
        //
        // labNets
        //
        this.labNets.AutoSize = true;
        this.labNets.Location = new System.Drawing.Point(19, 14);
        this.labNets.Name = "labNets";
        this.labNets.Size = new System.Drawing.Size(53, 12);
        this.labNets.TabIndex = 2;
        this.labNets.Text = "选择网卡";
        //
        // combNets
        //
        this.combNets.BackColor = System.Drawing.Color.White;
        this.combNets.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        this.combNets.FormattingEnabled = true;
        this.combNets.Location = new System.Drawing.Point(90, 10);
        this.combNets.Name = "combNets";
        this.combNets.Size = new System.Drawing.Size(236, 20);
        this.combNets.TabIndex = 3;
        this.combNets.SelectedIndexChanged += new System.EventHandler(this.combNets_SelectedIndexChanged);
        //
        // txtNetAddress
        //
        this.txtNetAddress.BackColor = System.Drawing.Color.White;
        this.txtNetAddress.Location = new System.Drawing.Point(90, 57);
        this.txtNetAddress.Name = "txtNetAddress";
        this.txtNetAddress.ReadOnly = true;
        this.txtNetAddress.Size = new System.Drawing.Size(237, 21);
        this.txtNetAddress.TabIndex = 4;
        //
        // Label1
        //
        this.Label1.AutoSize = true;
        this.Label1.Location = new System.Drawing.Point(19, 60);
        this.Label1.Name = "Label1";
        this.Label1.Size = new System.Drawing.Size(65, 12);
        this.Label1.TabIndex = 2;
        this.Label1.Text = "服务器地址";
        //
        // labTCPPort
        //
        this.labTCPPort.AutoSize = true;
        this.labTCPPort.Location = new System.Drawing.Point(19, 87);
        this.labTCPPort.Name = "labTCPPort";
        this.labTCPPort.Size = new System.Drawing.Size(47, 12);
        this.labTCPPort.TabIndex = 2;
        this.labTCPPort.Text = "TCP端口";
        //
        // labHTTPPort
        //
        this.labHTTPPort.AutoSize = true;
        this.labHTTPPort.Location = new System.Drawing.Point(192, 87);
        this.labHTTPPort.Name = "labHTTPPort";
        this.labHTTPPort.Size = new System.Drawing.Size(53, 12);
        this.labHTTPPort.TabIndex = 2;
        this.labHTTPPort.Text = "HTTP端口";
        //
        // txtTcpPort
        //
        this.txtTcpPort.BackColor = System.Drawing.Color.White;
        this.txtTcpPort.Location = new System.Drawing.Point(90, 84);
        this.txtTcpPort.Name = "txtTcpPort";
        this.txtTcpPort.ReadOnly = true;
        this.txtTcpPort.Size = new System.Drawing.Size(76, 21);
        this.txtTcpPort.TabIndex = 4;
        //
        // txtHTTPPort
        //
        this.txtHTTPPort.BackColor = System.Drawing.Color.White;
        this.txtHTTPPort.Location = new System.Drawing.Point(251, 84);
        this.txtHTTPPort.Name = "txtHTTPPort";
        this.txtHTTPPort.ReadOnly = true;
        this.txtHTTPPort.Size = new System.Drawing.Size(76, 21);
        this.txtHTTPPort.TabIndex = 4;
        //
        // btnSetting
        //
        this.btnSetting.Location = new System.Drawing.Point(21, 111);
        this.btnSetting.Name = "btnSetting";
        this.btnSetting.Size = new System.Drawing.Size(110, 23);
        this.btnSetting.TabIndex = 6;
        this.btnSetting.Text = "更多设置";
        this.btnSetting.UseVisualStyleBackColor = true;
        this.btnSetting.Click += new System.EventHandler(this.btnSetting_Click);
        //
        // qrcodeControl
        //
        this.qrcodeControl.ErrorCorrectLevel = Smobiler.Utility.Encoding.ErrorCorrectionLevel.M;
        this.qrcodeControl.Image = ((System.Drawing.Image)(resources.GetObject("qrcodeControl.Image")));
        this.qrcodeControl.Location = new System.Drawing.Point(21, 140);
        this.qrcodeControl.Name = "qrcodeControl";
        this.qrcodeControl.QuietZoneModule = Smobiler.Utility.Encoding.Windows.Render.QuietZoneModules.Two;
        this.qrcodeControl.Size = new System.Drawing.Size(306, 276);
        this.qrcodeControl.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
        this.qrcodeControl.TabIndex = 7;
        this.qrcodeControl.TabStop = false;
        this.qrcodeControl.Text = "lgdY7aMX70DtIt/TmG1ANg==";
        //
        // btnHelp
        //
        this.btnHelp.Location = new System.Drawing.Point(251, 111);
        this.btnHelp.Name = "btnHelp";
        this.btnHelp.Size = new System.Drawing.Size(76, 23);
        this.btnHelp.TabIndex = 8;
        this.btnHelp.Text = "帮助";
        this.btnHelp.UseVisualStyleBackColor = true;
        this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click);
        //
        // label2
        //
        this.label2.AutoSize = true;
        this.label2.Location = new System.Drawing.Point(19, 39);
        this.label2.Name = "label2";
        this.label2.Size = new System.Drawing.Size(29, 12);
        this.label2.TabIndex = 10;
        this.label2.Text = "名称";
        //
        // btnsavename
        //
        this.btnsavename.Location = new System.Drawing.Point(262, 33);
        this.btnsavename.Name = "btnsavename";
        this.btnsavename.Size = new System.Drawing.Size(65, 21);
        this.btnsavename.TabIndex = 11;
        this.btnsavename.Text = "保存";
        this.btnsavename.UseVisualStyleBackColor = true;
        this.btnsavename.Click += new System.EventHandler(this.btnsavename_Click);
        //
        // txtName
        //
        this.txtName.BackColor = System.Drawing.Color.White;
        this.txtName.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::SmoONE.UI.Properties.Settings.Default, "txtName", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
        this.txtName.Location = new System.Drawing.Point(90, 33);
        this.txtName.Name = "txtName";
        this.txtName.Size = new System.Drawing.Size(166, 21);
        this.txtName.TabIndex = 9;
        this.txtName.Text = global::SmoONE.UI.Properties.Settings.Default.txtName;
        //
        // btnGenerateQRcode
        //
        this.btnGenerateQRcode.Location = new System.Drawing.Point(137, 111);
        this.btnGenerateQRcode.Name = "btnGenerateQRcode";
        this.btnGenerateQRcode.Size = new System.Drawing.Size(110, 23);
        this.btnGenerateQRcode.TabIndex = 12;
        this.btnGenerateQRcode.Text = "生成二维码";
        this.btnGenerateQRcode.UseVisualStyleBackColor = true;
        this.btnGenerateQRcode.Click += new System.EventHandler(this.btnGenerateQRcode_Click);
        //
        // frmMain
        //
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.BackColor = System.Drawing.Color.White;
        this.ClientSize = new System.Drawing.Size(348, 418);
        this.Controls.Add(this.btnGenerateQRcode);
        this.Controls.Add(this.btnsavename);
        this.Controls.Add(this.label2);
        this.Controls.Add(this.txtName);
        this.Controls.Add(this.btnHelp);
        this.Controls.Add(this.btnSetting);
        this.Controls.Add(this.txtHTTPPort);
        this.Controls.Add(this.txtTcpPort);
        this.Controls.Add(this.txtNetAddress);
        this.Controls.Add(this.combNets);
        this.Controls.Add(this.labHTTPPort);
        this.Controls.Add(this.labTCPPort);
        this.Controls.Add(this.Label1);
        this.Controls.Add(this.labNets);
        this.Controls.Add(this.qrcodeControl);
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
        this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
        this.MaximizeBox = false;
        this.Name = "frmMain";
        this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
        this.Text = "Smobiler Launcher";
        this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing);
        this.Load += new System.EventHandler(this.frmMain_Load);
        ((System.ComponentModel.ISupportInitialize)(this.qrcodeControl)).EndInit();
        this.ResumeLayout(false);
        this.PerformLayout();

    }
    internal System.Windows.Forms.Label labNets;
    internal System.Windows.Forms.ComboBox combNets;
    internal System.Windows.Forms.TextBox txtNetAddress;
    internal System.Windows.Forms.Label Label1;
    public frmMain()
    {
        InitializeComponent();
    }

    internal System.Windows.Forms.Label labTCPPort;
    internal System.Windows.Forms.Label labHTTPPort;
    internal System.Windows.Forms.TextBox txtTcpPort;
    internal System.Windows.Forms.TextBox txtHTTPPort;
    private System.Windows.Forms.Button btnSetting;
    internal Smobiler.Utility.Encoding.Windows.Forms.QrCodeImgControl qrcodeControl;
    private System.Windows.Forms.Button btnHelp;
    internal System.Windows.Forms.TextBox txtName;
    internal System.Windows.Forms.Label label2;
    private System.Windows.Forms.Button btnsavename;
    private System.Windows.Forms.Button btnGenerateQRcode;
}


text:
void test_register_args(void) {
    boz_disc_t mgr;
    int ret=0;

    // test bad manager
    mgr=BOZ_DISC_ZERO;
    ret=boz_discovery_register(mgr, NULL);
    CU_ASSERT(ret == -1);
    CU_ASSERT(errno == EINVAL);
    CU_ASSERT(mgr == BOZ_DISC_ZERO);

    // test bad URI
    mgr=BOZ_DISC_ZERO;
    boz_discovery_init(&mgr);
    ret=boz_discovery_register(mgr, NULL);
    CU_ASSERT(ret == -1);
    CU_ASSERT(errno == EFAULT);
    ret=boz_discovery_term(&mgr);

    // test URI exceed length
    mgr=BOZ_DISC_ZERO;
    boz_discovery_init(&mgr);
    ret=boz_discovery_register(mgr, "tcp://totototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototototo");
    CU_ASSERT(ret == -1);
    CU_ASSERT(errno == EFBIG);
    ret=boz_discovery_term(&mgr);

    // test double register on same URI
    mgr=BOZ_DISC_ZERO;
    boz_discovery_init(&mgr);
    ret=boz_discovery_register(mgr, "tcp://toto:3142");
    CU_ASSERT(ret >= 0);
    CU_ASSERT(errno == 0);
    ret=boz_discovery_register(mgr, "tcp://toto:3142");
    CU_ASSERT(ret == -1);
    CU_ASSERT(errno == EEXIST);
    ret=boz_discovery_term(&mgr);
}


text:
layout: post
navbar: Blog
title: "Meeting Agenda - September 13th, 2018"
date: 2018-09-13 12:00:00 -0400
comments: true
categories: Agenda
---

**6:00pm:**

Food and drinks served

### Introduction

A brief overview of the Ohio Information Security Forum.

### **Assessing Vulnerabilities**
_By: John Carls_


text:
Coinkit
=====

Python library with tools for Bitcoin and other cryptocurrencies.

## Sample Usage

### Keypairs

#### Random keypairs

    >>> from coinkit import BitcoinKeypair
    >>> keypair = BitcoinKeypair()
    >>> keypair.private_key()
    '91149ee24f1ee9a6f42c3dd64c2287781c8c57a6e8e929c80976e586d5322a3d'
    >>> keypair.public_key()
    '042c6b7e6da7633c8f226891cc7fa8e5ec84f8eacc792a46786efc869a408d29539a5e6f8de3f71c0014e8ea71691c7b41f45c083a074fef7ab5c321753ba2b3fe'
    >>> keypair.wif_pk()
    '5JvBUBPzU42Y7BHD7thTnySXQXMk8XEJGGQGcyBw7CCkw8RAH7m'
    >>> keypair.address()
    '13mtgVARiB1HiRyCHnKTi6rEwyje5TYKBW'

#### Custom keypairs

    >>> hex_private_key = '91149ee24f1ee9a6f42c3dd64c2287781c8c57a6e8e929c80976e586d5322a3d'
    >>> keypair = BitcoinKeypair(hex_private_key)

#### Random brain wallet keypairs

    >>> keypair = BitcoinKeypair.from_passphrase()
    >>> keypair.passphrase()
    'shepherd mais pack rate enamel horace diva filesize maximum really roar mall'
    >>> keypair.address()
    '13mtgVARiB1HiRyCHnKTi6rEwyje5TYKBW'

#### Custom brain wallet keypairs

    >>> passphrase = 'shepherd mais pack rate enamel horace diva filesize maximum really roar mall'
    >>> keypair = BitcoinKeypair.from_passphrase(passphrase)

#### Altcoin keypairs

    >>> from coinkit import LitecoinKeypair
    >>> litecoin_keypair = LitecoinKeypair()
    >>> litecoin_keypair.address()
    'LMzqwhUFnqFLyEfMTvJkz7v1AC6v8N9Qcd'

### Wallets

#### Sequential Deterministic Wallets

    >>> from coinkit import SDWallet, BitcoinKeypair
    >>> passphrase = 'shepherd mais pack rate enamel horace diva filesize maximum really roar mall'
    >>> wallet = SDWallet(passphrase)
    >>> bitcoin_keypair_1 = wallet.keypair(1, BitcoinKeypair)
    >>> bitcoin_keypair_1.passphrase()
    'shepherd mais pack rate enamel horace diva filesize maximum really roar mall bitcoin1'
    >>> bitcoin_keypair_1.address()
    '1DS2vmsqTwtXp1DfmDHi55Aqc6w4LBUC9k'

### Utilities

#### Random passphrases

    >>> from coinkit import random_160bit_passphrase
    >>> random_160bit_passphrase()
    'shepherd mais pack rate enamel horace diva filesize maximum really roar mall'

## Supported currencies

- Litecoin
- Namecoin
- Peercoin
- Primecoin
- Testnet
- Worldcoin
- Megacoin
- Feathercoin
- Terracoin
- Novacoin
- Dogecoin
- Anoncoin
- Protoshares
- Ixcoin
- Memorycoin
- Infinitecoin
- Cryptogenic Bullion
- Quarkcoin
- Netcoin
- Earthcoin
- Reddcoin

## Developers

**Q:** Can I contribute to Coinkit?

**A:** Of course! Any and all are encouraged to contribute. Just fork a copy of the repo and get started on something that you think would improve the current offering.

**Q:** What should I work on?

**A:** That's up to you! For a quick project, consider adding support for a new cryptocurrency (should only require two lines of code, not including the unit tests).

Meanwhile, for something a bit more ambitious, check the issues section for outstanding feature requests.

## Notice

Coinkit is still in beta. Developers using Coinkit are encouraged to inspect the code for themselves and perform their own tests. We are committed to ensuring that this library behaves exactly as it is supposed to under all conditions, and have plans to ramp up our testing efforts going forward.


text:
package org.apache.sis.internal.storage.image;

import java.util.Set;
import java.util.HashSet;
import java.io.IOException;
import javax.imageio.spi.ImageReaderSpi;
import org.apache.sis.storage.DataStoreException;
import org.apache.sis.storage.StorageConnector;
import org.apache.sis.internal.storage.Capability;
import org.apache.sis.internal.storage.StoreMetadata;
import org.apache.sis.internal.storage.PRJDataStore;
import org.apache.sis.internal.storage.io.IOUtilities;
import org.apache.sis.storage.GridCoverageResource;
import org.apache.sis.storage.Aggregate;
import org.apache.sis.storage.ProbeResult;
import org.apache.sis.util.ArraysExt;

/**
 * The provider of {@link WorldFileStore} instances.
 *
 * @author  Martin Desruisseaux (Geomatys)
 * @version 1.2
 * @since   1.2
 * @module
 */
@StoreMetadata(formatName    = WorldFileStoreProvider.NAME,
               fileSuffixes  = {"jpeg", "jpg", "png", "gif", "bmp"},    // Non-exhaustive list, intentionally excluding TIFF.
               capabilities  = {Capability.READ, Capability.WRITE, Capability.CREATE},
               resourceTypes = {Aggregate.class, GridCoverageResource.class})
public final class WorldFileStoreProvider extends PRJDataStore.Provider {
    /**
     * The format name.
     */
    static final String NAME = "World file";

    /**
     * Name of image formats that are considered to allow only one image.
     * There is no public Image I/O API giving this information, so we have to use a hard-coded list.
     * All formats not in this list are assumed to allow more than one image.
     *
     *
Case of JPEG

     * The JPEG image reader implementation in standard JDK seems to count a number of images that can be anything.
     * However, documentation on the web often describes the JPEG format as a container for a single image.
     * It is not clear if we should include JPEG in this list or not.
     */
    private static final String[] SINGLE_IMAGE_FORMATS = {"PNG", "BMP", "WBMP", "JPEG"};

    /**
     * Whether the provider is allowed to create {@link GridCoverageResource} instances
     * instead of {@link Aggregate} instances.
     */
    private final boolean allowSingleton;

    /**
     * Creates a new provider.
     */
    public WorldFileStoreProvider() {
        allowSingleton = true;
    }

    /**
     * Creates a new provider with the given configuration.
     * If {@code allowSingleton} is {@code false}, then this provider will unconditionally create
     * {@link WorldFileStore} instances that implement the {@link Aggregate} interface, regardless
     * if the image format allows many pictures or not.
     *
     * @param allowSingleton  whether the provider is allowed to create {@code GridCoverageResource} instances
     *        instead of {@code Aggregate} instances.
     */
    public WorldFileStoreProvider(final boolean allowSingleton) {
        this.allowSingleton = allowSingleton;
    }

    /**
     * Returns a generic name for this data store, used mostly in warnings or error messages.
     *
     * @return a short name or abbreviation for the data format.
     */
    @Override
    public String getShortName() {
        return NAME;
    }

    /**
     * Returns a {@link WorldFileStore} implementation associated with this provider.
     * The data store will be writable if {@link java.nio.file.StandardOpenOption#WRITE} is provided,
     * or if the storage is a writable object such as {@link javax.imageio.stream.ImageOutputStream}.
     *
     * @param  connector  information about the storage (URL, stream, etc).
     * @return a data store implementation associated with this provider for the given storage.
     * @throws DataStoreException if an error occurred while creating the data store instance.
     */
    @Override
    public WorldFileStore open(final StorageConnector connector) throws DataStoreException {
        final WorldFileStore store;
        try (FormatFinder format = new FormatFinder(this, connector)) {
            boolean isSingleton = false;
            if (allowSingleton) {
                final String[] names = format.getFormatName();
                if (names != null) {
                    for (final String name : names) {
                        isSingleton = ArraysExt.containsIgnoreCase(SINGLE_IMAGE_FORMATS, name);
                        if (isSingleton) break;
                    }
                }
            }
            if (format.isWritable) {
                store = isSingleton ? new SingleImageStore.Writable(format)
                                    : new  MultiImageStore.Writable(format);
            } else {
                store = isSingleton ? new SingleImageStore(format)
                                    : new  MultiImageStore(format);
            }
        } catch (IOException e) {
            throw new DataStoreException(e);
        }
        return store;
    }

    /**
     * Returns the MIME type if the image file is recognized by an Image I/O reader.
     * A {@linkplain ProbeResult#isSupported() supported} status does not guarantee that reading
     * or writing will succeed, only that there appears to be a reasonable chance of success
     * based on a brief inspection of the file header.
     *
     * @return a {@linkplain ProbeResult#isSupported() supported} status with the MIME type
     *         if the given storage seems to be readable as an image.
     * @throws DataStoreException if an I/O error occurred.
     */
    @Override
    public ProbeResult probeContent(final StorageConnector connector) throws DataStoreException {
        final Set<ImageReaderSpi> deferred = new HashSet<>();
        final String suffix = IOUtilities.extension(connector.getStorage());
        ImageReaderSpi provider;
        try {
            provider = FormatFilter.SUFFIX.findProvider(suffix, connector, deferred);
            if (provider == null) {
                provider = FormatFilter.SUFFIX.findProvider(null, connector, deferred);
                if (provider == null) {
                    return ProbeResult.UNSUPPORTED_STORAGE;
                }
            }
        } catch (IOException e) {
            throw new DataStoreException(e);
        }
        final String[] types = provider.getMIMETypes();
        if (types != null && types.length != 0) {
            return new ProbeResult(true, types[0], null);
        }
        return ProbeResult.SUPPORTED;
    }
}


text:
<?php

use Jacopo\LaravelImportExport\Models\StateHandling\Import\GetTableState;
use Jacopo\LaravelImportExport\Models\ParseCsv\CsvFile;
use Jacopo\Bootstrap3Table\BootstrapTable as Table;
use Mockery as m;

class TestGetTableState extends PHPUnit_Framework_TestCase {

	protected $state;

	public function setUp()
	{
		$this->state =  m::mock('Jacopo\LaravelImportExport\Models\StateHandling\Import\GetTableState')->makePartial();
	}

	public function tearDown()
	{
		m::close();
	}

	public function testFillFormInput()
	{
		$input_mock = m::mock('Jacopo\LaravelImportExport\Models\InputWrapper');
		$input_mock->shouldReceive(//array("get"=>2,"get"=>2,"get"=>2,"get"=>2));
   		'get',
   		'get',
   		'get',
   		'get',
   		'get',
   		'get',
   		'get'
   	)->andReturn(
   		'table_name',
   		'2',
   		'1',
   		'first',
   		'string',
   		'second',
   		'string'
   	);
		$this->state->fillFormInput($input_mock);
		$form_input = $this->state->getFormInput();

		$this->assertEquals('table_name', $form_input["table_name"]);
		$expected_vals = array(
				0 => 'first',
				1 => 'second'
			);
		$this->assertEquals($expected_vals, $form_input["columns"]);
		$expected_types = array(
				'first' => 'string',
				'second' => 'string',
			);
		$this->assertEquals($expected_types, $form_input["types"]);
	}

	public function testProcessFormSuccess()
	{
		$mock_validator = m::mock('Jacopo\LaravelImportExport\Models\ValidatorFormInputModel');
		$mock_validator->shouldReceive('validateInput')
		->once()
		->andReturn(true);

		$form_input = array(
					'table_name' => 'table',
					'columns' => array(
							"first" => 0,
							"second" => 1
						),
					'types' => array(),
				);

		$mock_csv_handler = m::mock('Jacopo\LaravelImportExport\Models\ParseCsv\CsvFileHandler');
		$mock_csv_handler->shouldReceive(array(
			'getTemporary' => new CsvFile(),
			'updateHeaders' => true,
			'saveToDb' => true
		));

		$executed = $this->state->processForm($form_input,$mock_validator,$mock_csv_handler);
		$this->assertSame(true,$executed);
	}

}


text:
from authcode import Auth, setup_for_flask

import settings
from app import app, db, mailer

class UserMixin(object):
    email = db.Column(db.Unicode)

auth = Auth(settings.SECRET_KEY, db=db, UserMixin=UserMixin, roles=True,
            **settings.AUTH_SETTINGS)

User = auth.User

def send_email(user, subject, msg):
    if not user.email:
        return
    try:
        print(msg)
        mailer.send(
            subject, html_content=msg,
            from_email=settings.MAILER_SENDER,
            to=user.email
        )
    except:
        pass

setup_for_flask(auth, app, send_email=send_email)


text:
#pragma once
#include <aws/budgets/Budgets_EXPORTS.h>
#include <aws/budgets/BudgetsRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/budgets/model/NotificationType.h>
#include <aws/budgets/model/ActionType.h>
#include <aws/budgets/model/ActionThreshold.h>
#include <aws/budgets/model/Definition.h>
#include <aws/budgets/model/ApprovalModel.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/budgets/model/Subscriber.h>
#include <utility>

namespace Aws
{
namespace Budgets
{
namespace Model
{

  /**
   */
  class AWS_BUDGETS_API CreateBudgetActionRequest : public BudgetsRequest
  {
  public:
    CreateBudgetActionRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "CreateBudgetAction"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    inline const Aws::String& GetAccountId() const{ return m_accountId; }

    inline bool AccountIdHasBeenSet() const { return m_accountIdHasBeenSet; }

    inline void SetAccountId(const Aws::String& value) { m_accountIdHasBeenSet = true; m_accountId = value; }

    inline void SetAccountId(Aws::String&& value) { m_accountIdHasBeenSet = true; m_accountId = std::move(value); }

    inline void SetAccountId(const char* value) { m_accountIdHasBeenSet = true; m_accountId.assign(value); }

    inline CreateBudgetActionRequest& WithAccountId(const Aws::String& value) { SetAccountId(value); return *this;}

    inline CreateBudgetActionRequest& WithAccountId(Aws::String&& value) { SetAccountId(std::move(value)); return *this;}

    inline CreateBudgetActionRequest& WithAccountId(const char* value) { SetAccountId(value); return *this;}

    inline const Aws::String& GetBudgetName() const{ return m_budgetName; }

    inline bool BudgetNameHasBeenSet() const { return m_budgetNameHasBeenSet; }

    inline void SetBudgetName(const Aws::String& value) { m_budgetNameHasBeenSet = true; m_budgetName = value; }

    inline void SetBudgetName(Aws::String&& value) { m_budgetNameHasBeenSet = true; m_budgetName = std::move(value); }

    inline void SetBudgetName(const char* value) { m_budgetNameHasBeenSet = true; m_budgetName.assign(value); }

    inline CreateBudgetActionRequest& WithBudgetName(const Aws::String& value) { SetBudgetName(value); return *this;}

    inline CreateBudgetActionRequest& WithBudgetName(Aws::String&& value) { SetBudgetName(std::move(value)); return *this;}

    inline CreateBudgetActionRequest& WithBudgetName(const char* value) { SetBudgetName(value); return *this;}

    inline const NotificationType& GetNotificationType() const{ return m_notificationType; }

    inline bool NotificationTypeHasBeenSet() const { return m_notificationTypeHasBeenSet; }

    inline void SetNotificationType(const NotificationType& value) { m_notificationTypeHasBeenSet = true; m_notificationType = value; }

    inline void SetNotificationType(NotificationType&& value) { m_notificationTypeHasBeenSet = true; m_notificationType = std::move(value); }

    inline CreateBudgetActionRequest& WithNotificationType(const NotificationType& value) { SetNotificationType(value); return *this;}

    inline CreateBudgetActionRequest& WithNotificationType(NotificationType&& value) { SetNotificationType(std::move(value)); return *this;}

    /**
     * <p> The type of action. This defines the type of tasks that can be carried out
     * by this action. This field also determines the format for definition. </p>
     */
    inline const ActionType& GetActionType() const{ return m_actionType; }

    /**
     * <p> The type of action. This defines the type of tasks that can be carried out
     * by this action. This field also determines the format for definition. </p>
     */
    inline bool ActionTypeHasBeenSet() const { return m_actionTypeHasBeenSet; }

    /**
     * <p> The type of action. This defines the type of tasks that can be carried out
     * by this action. This field also determines the format for definition. </p>
     */
    inline void SetActionType(const ActionType& value) { m_actionTypeHasBeenSet = true; m_actionType = value; }

    /**
     * <p> The type of action. This defines the type of tasks that can be carried out
     * by this action. This field also determines the format for definition. </p>
     */
    inline void SetActionType(ActionType&& value) { m_actionTypeHasBeenSet = true; m_actionType = std::move(value); }

    /**
     * <p> The type of action. This defines the type of tasks that can be carried out
     * by this action. This field also determines the format for definition. </p>
     */
    inline CreateBudgetActionRequest& WithActionType(const ActionType& value) { SetActionType(value); return *this;}

    /**
     * <p> The type of action. This defines the type of tasks that can be carried out
     * by this action. This field also determines the format for definition. </p>
     */
    inline CreateBudgetActionRequest& WithActionType(ActionType&& value) { SetActionType(std::move(value)); return *this;}

    inline const ActionThreshold& GetActionThreshold() const{ return m_actionThreshold; }

    inline bool ActionThresholdHasBeenSet() const { return m_actionThresholdHasBeenSet; }

    inline void SetActionThreshold(const ActionThreshold& value) { m_actionThresholdHasBeenSet = true; m_actionThreshold = value; }

    inline void SetActionThreshold(ActionThreshold&& value) { m_actionThresholdHasBeenSet = true; m_actionThreshold = std::move(value); }

    inline CreateBudgetActionRequest& WithActionThreshold(const ActionThreshold& value) { SetActionThreshold(value); return *this;}

    inline CreateBudgetActionRequest& WithActionThreshold(ActionThreshold&& value) { SetActionThreshold(std::move(value)); return *this;}

    inline const Definition& GetDefinition() const{ return m_definition; }

    inline bool DefinitionHasBeenSet() const { return m_definitionHasBeenSet; }

    inline void SetDefinition(const Definition& value) { m_definitionHasBeenSet = true; m_definition = value; }

    inline void SetDefinition(Definition&& value) { m_definitionHasBeenSet = true; m_definition = std::move(value); }

    inline CreateBudgetActionRequest& WithDefinition(const Definition& value) { SetDefinition(value); return *this;}

    inline CreateBudgetActionRequest& WithDefinition(Definition&& value) { SetDefinition(std::move(value)); return *this;}

    /**
     * <p> The role passed for action execution and reversion. Roles and actions must
     * be in the same account. </p>
     */
    inline const Aws::String& GetExecutionRoleArn() const{ return m_executionRoleArn; }

    /**
     * <p> The role passed for action execution and reversion. Roles and actions must
     * be in the same account. </p>
     */
    inline bool ExecutionRoleArnHasBeenSet() const { return m_executionRoleArnHasBeenSet; }

    /**
     * <p> The role passed for action execution and reversion. Roles and actions must
     * be in the same account. </p>
     */
    inline void SetExecutionRoleArn(const Aws::String& value) { m_executionRoleArnHasBeenSet = true; m_executionRoleArn = value; }

    /**
     * <p> The role passed for action execution and reversion. Roles and actions must
     * be in the same account. </p>
     */
    inline void SetExecutionRoleArn(Aws::String&& value) { m_executionRoleArnHasBeenSet = true; m_executionRoleArn = std::move(value); }

    /**
     * <p> The role passed for action execution and reversion. Roles and actions must
     * be in the same account. </p>
     */
    inline void SetExecutionRoleArn(const char* value) { m_executionRoleArnHasBeenSet = true; m_executionRoleArn.assign(value); }

    /**
     * <p> The role passed for action execution and reversion. Roles and actions must
     * be in the same account. </p>
     */
    inline CreateBudgetActionRequest& WithExecutionRoleArn(const Aws::String& value) { SetExecutionRoleArn(value); return *this;}

    /**
     * <p> The role passed for action execution and reversion. Roles and actions must
     * be in the same account. </p>
     */
    inline CreateBudgetActionRequest& WithExecutionRoleArn(Aws::String&& value) { SetExecutionRoleArn(std::move(value)); return *this;}

    /**
     * <p> The role passed for action execution and reversion. Roles and actions must
     * be in the same account. </p>
     */
    inline CreateBudgetActionRequest& WithExecutionRoleArn(const char* value) { SetExecutionRoleArn(value); return *this;}

    /**
     * <p> This specifies if the action needs manual or automatic approval. </p>
     */
    inline const ApprovalModel& GetApprovalModel() const{ return m_approvalModel; }

    /**
     * <p> This specifies if the action needs manual or automatic approval. </p>
     */
    inline bool ApprovalModelHasBeenSet() const { return m_approvalModelHasBeenSet; }

    /**
     * <p> This specifies if the action needs manual or automatic approval. </p>
     */
    inline void SetApprovalModel(const ApprovalModel& value) { m_approvalModelHasBeenSet = true; m_approvalModel = value; }

    /**
     * <p> This specifies if the action needs manual or automatic approval. </p>
     */
    inline void SetApprovalModel(ApprovalModel&& value) { m_approvalModelHasBeenSet = true; m_approvalModel = std::move(value); }

    /**
     * <p> This specifies if the action needs manual or automatic approval. </p>
     */
    inline CreateBudgetActionRequest& WithApprovalModel(const ApprovalModel& value) { SetApprovalModel(value); return *this;}

    /**
     * <p> This specifies if the action needs manual or automatic approval. </p>
     */
    inline CreateBudgetActionRequest& WithApprovalModel(ApprovalModel&& value) { SetApprovalModel(std::move(value)); return *this;}

    inline const Aws::Vector<Subscriber>& GetSubscribers() const{ return m_subscribers; }

    inline bool SubscribersHasBeenSet() const { return m_subscribersHasBeenSet; }

    inline void SetSubscribers(const Aws::Vector<Subscriber>& value) { m_subscribersHasBeenSet = true; m_subscribers = value; }

    inline void SetSubscribers(Aws::Vector<Subscriber>&& value) { m_subscribersHasBeenSet = true; m_subscribers = std::move(value); }

    inline CreateBudgetActionRequest& WithSubscribers(const Aws::Vector<Subscriber>& value) { SetSubscribers(value); return *this;}

    inline CreateBudgetActionRequest& WithSubscribers(Aws::Vector<Subscriber>&& value) { SetSubscribers(std::move(value)); return *this;}

    inline CreateBudgetActionRequest& AddSubscribers(const Subscriber& value) { m_subscribersHasBeenSet = true; m_subscribers.push_back(value); return *this; }

    inline CreateBudgetActionRequest& AddSubscribers(Subscriber&& value) { m_subscribersHasBeenSet = true; m_subscribers.push_back(std::move(value)); return *this; }

  private:

    Aws::String m_accountId;
    bool m_accountIdHasBeenSet = false;

    Aws::String m_budgetName;
    bool m_budgetNameHasBeenSet = false;

    NotificationType m_notificationType;
    bool m_notificationTypeHasBeenSet = false;

    ActionType m_actionType;
    bool m_actionTypeHasBeenSet = false;

    ActionThreshold m_actionThreshold;
    bool m_actionThresholdHasBeenSet = false;

    Definition m_definition;
    bool m_definitionHasBeenSet = false;

    Aws::String m_executionRoleArn;
    bool m_executionRoleArnHasBeenSet = false;

    ApprovalModel m_approvalModel;
    bool m_approvalModelHasBeenSet = false;

    Aws::Vector<Subscriber> m_subscribers;
    bool m_subscribersHasBeenSet = false;
  };

} // namespace Model
} // namespace Budgets
} // namespace Aws


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class org.apache.poi.hsmf.datatypes.PropertyValue (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.poi.hsmf.datatypes.PropertyValue

Packages that use PropertyValue

Package
Description

org.apache.poi.hsmf.datatypes

Uses of PropertyValue in org.apache.poi.hsmf.datatypes

Subclasses of PropertyValue in org.apache.poi.hsmf.datatypes

Modifier and Type
Class and Description

class
ChunkBasedPropertyValue

A variable length PropertyValue that is
  backed by a Chunk
 TODO Provide a way to link these up with the chunks

static class
PropertyValue.BooleanPropertyValue

static class
PropertyValue.CurrencyPropertyValue

signed 64-bit integer that represents a base ten decimal,
 with four digits to the right of the decimal point

static class
PropertyValue.DoublePropertyValue

static class
PropertyValue.FloatPropertyValue

static class
PropertyValue.LongLongPropertyValue

static class
PropertyValue.LongPropertyValue

static class
PropertyValue.NullPropertyValue

static class
PropertyValue.ShortPropertyValue

static class
PropertyValue.TimePropertyValue

64-bit integer specifying the number of 100ns periods since Jan 1, 1601

Methods in org.apache.poi.hsmf.datatypes that return PropertyValue

Modifier and Type
Method and Description

PropertyValue
PropertiesChunk.getRawValue(MAPIProperty property)

Returns the value / pointer to the value chunk of
  the property, or null if none exists

Methods in org.apache.poi.hsmf.datatypes that return types with arguments of type PropertyValue

Modifier and Type
Method and Description

java.util.Map<MAPIProperty,java.util.List<PropertyValue>>
RecipientChunks.getProperties()

java.util.Map<MAPIProperty,java.util.List<PropertyValue>>
PropertiesChunk.getProperties()

Returns all the properties in the chunk, along with their
  values.

java.util.Map<MAPIProperty,java.util.List<PropertyValue>>
Chunks.getProperties()

java.util.Map<MAPIProperty,java.util.List<PropertyValue>>
ChunkGroupWithProperties.getProperties()

Returns all the Properties contained in the Chunk, along
  with their Values.

java.util.Map<MAPIProperty,PropertyValue>
PropertiesChunk.getRawProperties()

Returns all the properties in the chunk, without
  looking up any chunk-based values

java.util.Map<MAPIProperty,PropertyValue>
Chunks.getRawProperties()

java.util.List<PropertyValue>
PropertiesChunk.getValues(MAPIProperty property)

Returns all values for the given property, looking up chunk based
  ones as required, of null if none exist

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

                Copyright 2015 The Apache Software Foundation or
        its licensors, as applicable.


text:
<?php

namespace Ibuildings\QaTools\Core\Composer;

use Ibuildings\QaTools\Core\Assert\Assertion;
use Psr\Log\LoggerInterface;
use Symfony\Component\Process\ProcessBuilder;

final class CliComposerProject implements Project
{
    /**
     * @var string
     */
    private $directory;

    /**
     * @var string
     */
    private $composerBinary;

    /**
     * @var LoggerInterface
     */
    private $logger;

    /**
     * @var RequireCache
     */
    private $successfulRequires;

    /**
     * @param string          $directory
     * @param string          $composerBinary
     * @param LoggerInterface $logger
     */
    public function __construct($directory, $composerBinary, LoggerInterface $logger)
    {
        Assertion::string($directory, 'Composer project directory ought to be a string, got "%s" of type "%s"');
        Assertion::string($composerBinary, 'Path to Composer binary ought to be a string, got "%s" of type "%s"');

        $this->directory = $directory;
        $this->composerBinary = $composerBinary;
        $this->logger = $logger;

        $this->successfulRequires = new RequireCache();
    }

    /**
     * @return bool
     */
    public function isInitialised()
    {
        return file_exists($this->directory . '/composer.json');
    }

    /**
     * @return void
     */
    public function initialise()
    {
        passthru('composer init', $exitCode);

        if ($exitCode !== 0) {
            throw new RuntimeException(
                sprintf(
                    "Composer project could not be initialised; 'composer init' exited with status code %d",
                    $exitCode
                ),
                ''
            );
        }
    }

    public function verifyDevDependenciesWillNotConflict(PackageSet $packages)
    {
        $targetConfiguration = $this->readConfiguration();

        try {
            $this->requireDevDependencies($packages);

            $newConfiguration = $this->readConfiguration();
            $this->successfulRequires->storeConfiguration($targetConfiguration, $packages, $newConfiguration);
        } finally {
            $this->restoreConfiguration($targetConfiguration);
        }
    }

    public function requireDevDependencies(PackageSet $packages)
    {
        $targetConfiguration = $this->readConfiguration();

        // This optimises repeated requests for new requirements. For example, this happens
        // when first calling `verifyDevDependenciesWillNotConflict()`, and then
        // `requireDevDependencies()`, like done in InstallComposerDevDependencyTaskExecutor.
        if ($this->successfulRequires->containsConfiguration($targetConfiguration, $packages)) {
            $newConfiguration = $this->successfulRequires->getConfiguration($targetConfiguration, $packages);

            $this->restoreConfiguration($newConfiguration);

            return;
        }

        $options = ['--dev', '--no-interaction'];
        $arguments = array_merge([$this->composerBinary, 'require'], $options, $packages->getDescriptors());
        $process = ProcessBuilder::create($arguments)
            ->setWorkingDirectory($this->directory)
            ->setEnv('COMPOSER_HOME', getenv('COMPOSER_HOME'))
            ->setTimeout(null)
            ->getProcess();

        if ($process->run() !== 0) {
            $packageNames = join("\n - ", $packages->getDescriptors());

            $this->logger->error("Failed to require development dependencies");
            $this->logger->error("One of these packages could not be installed (from inside $this->directory):");
            $this->logger->error(" - $packageNames");

            throw new RuntimeException(
                'Failed to require development dependencies',
                $process->getErrorOutput()
            );
        }
    }

    public function readConfiguration()
    {
        if (file_exists('composer.lock')) {
            $backup = Configuration::withLockedDependencies(
                file_get_contents('composer.json'),
                file_get_contents('composer.lock')
            );
        } else {
            $backup = Configuration::withoutLockedDependencies(file_get_contents('composer.json'));
        }

        return $backup;
    }

    public function restoreConfiguration(Configuration $configuration)
    {
        file_put_contents('composer.json', $configuration->getComposerJson());

        if ($configuration->hasLockedDependencies()) {
            file_put_contents('composer.lock', $configuration->getComposerLockJson());
        } elseif (file_exists('composer.lock')) {
            unlink('composer.lock');
        }

        $options = ['--no-interaction'];
        $arguments = array_merge([$this->composerBinary, 'install'], $options);
        $process = ProcessBuilder::create($arguments)
            ->setWorkingDirectory($this->directory)
            ->setEnv('COMPOSER_HOME', getenv('COMPOSER_HOME'))
            ->setTimeout(null)
            ->getProcess();

        if ($process->run() !== 0) {
            throw new RuntimeException(
                'Failed to install Composer dependencies',
                $process->getErrorOutput()
            );
        }
    }
}


text:
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

//friendship Schema

var FriendshipSchema = new Schema({

	fromUser:{
		type: String,
		ref: 'User',
		required: true
	},

	toUser:{
		type: String,
		ref: 'User',
		required: true
	},

	approved:{
		type: Boolean,
		required: true,
		default: false
	}
});

FriendshipSchema.index({ fromUser: 1, toUser: 1 }, { unique: true });
var Friendships = mongoose.model('Friendship', FriendshipSchema);
module.exports = Friendships;


text:
<?php

namespace Symfony\Component\Serializer\Exception;

/**
 * UnexpectedValueException.
 *
 * @author Lukas Kahwe Smith <smith@pooteeweet.org>
 */
class UnexpectedValueException extends \UnexpectedValueException implements Exception
{
}


text:
using SmartRoutes.Model.Gtfs;

namespace SmartRoutes.Graph.Node
{
    public interface IGtfsNode : INode
    {
        StopTime stopTime { get; }
        int StopId { get; }
        int TripId { get; }
        int Sequence { get; }
        int RouteId { get; }
        int? BlockId { get; }

        IGtfsNode CreateGtfsNode(StopTime stopTime, NodeBase node);
    }
}


text:
class CreateDailyItemInviters < ActiveRecord::Migration
  def change
    create_table :daily_item_inviters do |t|
      t.integer :daily_item_id
      t.integer :wx_user_id

      t.timestamps
    end

    add_index :daily_item_inviters, :daily_item_id
    add_index :daily_item_inviters, :wx_user_id
  end
end


text:
 A Collection of users that are associated as site collection adminsitrators

**Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Model](OfficeDevPnP.Core.Framework.Provisioning.Model.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public UserCollection AdditionalAdministrators { get; }
```

### Property Value
Type: [OfficeDevPnP.Core.Framework.Provisioning.Model.UserCollection](OfficeDevPnP.Core.Framework.Provisioning.Model.UserCollection.md)

## See also
- [SiteSecurity](OfficeDevPnP.Core.Framework.Provisioning.Model.SiteSecurity.md)
- [OfficeDevPnP.Core.Framework.Provisioning.Model](OfficeDevPnP.Core.Framework.Provisioning.Model.md)


text:
#include "Globals.h"  // NOTE: MSVC stupidness requires this to be the same across all modules

#include "Pawn.h"
#include "Player.h"
#include "../World.h"
#include "../Bindings/PluginManager.h"
#include "BoundingBox.h"
#include "../Blocks/BlockHandler.h"
#include "EffectID.h"
#include "../Mobs/Monster.h"

cPawn::cPawn(eEntityType a_EntityType, double a_Width, double a_Height) :
	super(a_EntityType, 0, 0, 0, a_Width, a_Height),
	m_EntityEffects(tEffectMap()),
	m_LastGroundHeight(0),
	m_bTouchGround(false)
{
	SetGravity(-32.0f);
	SetAirDrag(0.02f);
}

cPawn::~cPawn()
{
	ASSERT(m_TargetingMe.size() == 0);
}

void cPawn::Destroyed()
{
	StopEveryoneFromTargetingMe();
	super::Destroyed();
}

void cPawn::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
	// Iterate through this entity's applied effects
	for (tEffectMap::iterator iter = m_EntityEffects.begin(); iter != m_EntityEffects.end();)
	{
		// Copies values to prevent pesky wrong accesses and erasures
		cEntityEffect::eType EffectType = iter->first;
		cEntityEffect * Effect = iter->second;

		Effect->OnTick(*this);

		// Iterates (must be called before any possible erasure)
		++iter;

		// Remove effect if duration has elapsed
		if (Effect->GetDuration() - Effect->GetTicks() <= 0)
		{
			RemoveEntityEffect(EffectType);
		}

		// TODO: Check for discrepancies between client and server effect values
	}

	class Pusher : public cEntityCallback
	{
	public:
		cEntity * m_Pusher;

		Pusher(cEntity * a_Pusher) :
			m_Pusher(a_Pusher)
		{
		}

		virtual bool Item(cEntity * a_Entity) override
		{
			if (a_Entity->GetUniqueID() == m_Pusher->GetUniqueID())
			{
				return false;
			}

			// we only push other mobs, boats and minecarts
			if ((a_Entity->GetEntityType() != etMonster) && (a_Entity->GetEntityType() != etMinecart) && (a_Entity->GetEntityType() != etBoat))
			{
				return false;
			}

			// do not push a boat / minecart you're sitting in
			if (m_Pusher->IsAttachedTo(a_Entity))
			{
				return false;
			}

			Vector3d v3Delta = a_Entity->GetPosition() - m_Pusher->GetPosition();
			v3Delta.y = 0.0;  // we only push sideways
			v3Delta *= 1.0 / (v3Delta.Length() + 0.01);  // we push harder if we're close
			// QUESTION: is there an additional multiplier for this? current shoving seems a bit weak

			a_Entity->AddSpeed(v3Delta);
			return false;
		}
	} Callback(this);

	// Spectators cannot push entities around
	if ((!IsPlayer()) || (!reinterpret_cast<cPlayer *>(this)->IsGameModeSpectator()))
	{
		m_World->ForEachEntityInBox(cBoundingBox(GetPosition(), GetWidth(), GetHeight()), Callback);
	}

	super::Tick(a_Dt, a_Chunk);
	if (!IsTicking())
	{
		// The base class tick destroyed us
		return;
	}
	HandleFalling();
}

void cPawn::KilledBy(TakeDamageInfo & a_TDI)
{
	ClearEntityEffects();
	super::KilledBy(a_TDI);
}

bool cPawn::IsFireproof(void) const
{
	return super::IsFireproof() || HasEntityEffect(cEntityEffect::effFireResistance);
}

void cPawn::HandleAir(void)
{
	if (IsSubmerged() && HasEntityEffect(cEntityEffect::effWaterBreathing))
	{
		// Prevent the oxygen from decreasing
		return;
	}

	super::HandleAir();
}

void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, int a_Duration, short a_Intensity, double a_DistanceModifier)
{
	// Check if the plugins allow the addition:
	if (cPluginManager::Get()->CallHookEntityAddEffect(*this, a_EffectType, a_Duration, a_Intensity, a_DistanceModifier))
	{
		// A plugin disallows the addition, bail out.
		return;
	}

	// No need to add empty effects:
	if (a_EffectType == cEntityEffect::effNoEffect)
	{
		return;
	}
	a_Duration = static_cast<int>(a_Duration * a_DistanceModifier);

	m_EntityEffects[a_EffectType] = cEntityEffect::CreateEntityEffect(a_EffectType, a_Duration, a_Intensity, a_DistanceModifier);
	m_World->BroadcastEntityEffect(*this, a_EffectType, a_Intensity, static_cast<short>(a_Duration));
	m_EntityEffects[a_EffectType]->OnActivate(*this);
}

void cPawn::RemoveEntityEffect(cEntityEffect::eType a_EffectType)
{
	m_World->BroadcastRemoveEntityEffect(*this, a_EffectType);
	m_EntityEffects[a_EffectType]->OnDeactivate(*this);
	delete m_EntityEffects[a_EffectType];
	m_EntityEffects.erase(a_EffectType);
}

bool cPawn::HasEntityEffect(cEntityEffect::eType a_EffectType) const
{
	return m_EntityEffects.find(a_EffectType) != m_EntityEffects.end();
}

void cPawn::ClearEntityEffects()
{
	// Iterate through this entity's applied effects
	for (tEffectMap::iterator iter = m_EntityEffects.begin(); iter != m_EntityEffects.end();)
	{
		// Copy values to prevent pesky wrong erasures
		cEntityEffect::eType EffectType = iter->first;

		// Iterates (must be called before any possible erasure)
		++iter;

		// Remove effect
		RemoveEntityEffect(EffectType);
	}
}

void cPawn::NoLongerTargetingMe(cMonster * a_Monster)
{
	ASSERT(IsTicking());  // Our destroy override is supposed to clear all targets before we're destroyed.
	for (auto i = m_TargetingMe.begin(); i != m_TargetingMe.end(); ++i)
	{
		cMonster * Monster = *i;
		if (Monster == a_Monster)
		{
			ASSERT(Monster->GetTarget() != this);  // The monster is notifying us it is no longer targeting us, assert if that's a lie
			m_TargetingMe.erase(i);
			return;
		}
	}
	ASSERT(false);  // If this happens, something is wrong. Perhaps the monster never called TargetingMe() or called NoLongerTargetingMe() twice.
}

void cPawn::TargetingMe(cMonster * a_Monster)
{
	ASSERT(IsTicking());
	ASSERT(m_TargetingMe.size() < 10000);
	ASSERT(a_Monster->GetTarget() == this);
	m_TargetingMe.push_back(a_Monster);
}

void cPawn::HandleFalling(void)
{
	/* Not pretty looking, and is more suited to wherever server-sided collision detection is implemented.
	The following condition sets on-ground-ness if
	The player isn't swimming or flying (client hardcoded conditions) and
	they're on a block (Y is exact) - ensure any they could be standing on (including on the edges) is solid or
	they're on a slab (Y significand is 0.5) - ditto with slab check
	they're on a snow layer (Y divisible by 0.125) - ditto with snow layer check
	*/

	static const auto HalfWidth = GetWidth() / 2;
	static const auto EPS = 0.0001;

	/* Since swimming is decided in a tick and is asynchronous to this, we have to check for dampeners ourselves.
	The behaviour as of 1.8.9 is the following:
	- Landing in water alleviates all fall damage
	- Passing through any liquid (water + lava) and cobwebs "slows" the player down,
	i.e. resets the fall distance to that block, but only after checking for fall damage
	(this means that plummeting into lava will still kill the player via fall damage, although cobwebs
	will slow players down enough to have multiple updates that keep them alive)
	- Slime blocks reverse falling velocity, unless it's a crouching player, in which case they act as standard blocks.
	They also reset the topmost point of the damage calculation with each bounce,
	so if the block is removed while the player is bouncing or crouches after a bounce, the last bounce's zenith is considered as fall damage.

	With this in mind, we first check the block at the player's feet, then the one below that (because fences),
	and decide which behaviour we want to go with.
	*/
	BLOCKTYPE BlockAtFoot = (cChunkDef::IsValidHeight(POSY_TOINT)) ? GetWorld()->GetBlock(POS_TOINT) : E_BLOCK_AIR;

	/* We initialize these with what the foot is really IN, because for sampling we will move down with the epsilon above */
	bool IsFootInWater = IsBlockWater(BlockAtFoot);
	bool IsFootInLiquid = IsFootInWater || IsBlockLava(BlockAtFoot) || (BlockAtFoot == E_BLOCK_COBWEB);  // okay so cobweb is not _technically_ a liquid...
	bool IsFootOnSlimeBlock = false;

	/* The "cross" we sample around to account for the player width/girth */
	static const struct
	{
		int x, z;
	} CrossSampleCoords[] =
	{
		{ 0, 0 },
		{ 1, 0 },
		{ -1, 0 },
		{ 0, 1 },
		{ 0, -1 },
	};

	/* The blocks we're interested in relative to the player to account for larger than 1 blocks.
	This can be extended to do additional checks in case there are blocks that are represented as one block
	in memory but have a hitbox larger than 1 (like fences) */
	static const struct
	{
		int x, y, z;
	} BlockSampleOffsets[] =
	{
		{ 0, 0, 0 },  // TODO: something went wrong here (offset 0?)
		{ 0, -1, 0 },  // Potentially causes mis-detection (IsFootInWater) when player stands on block diagonal to water (i.e. on side of pool)
	};

	/* Here's the rough outline of how this mechanism works:
	We take the player's pointlike position (sole of feet), and expand it into a crosslike shape.
	If any of the five points hit a block, we consider the player to be "on" (or "in") the ground. */
	bool OnGround = false;
	for (size_t i = 0; i < ARRAYCOUNT(CrossSampleCoords); i++)
	{
		/* We calculate from the player's position, one of the cross-offsets above, and we move it down slightly so it's beyond inaccuracy.
		The added advantage of this method is that if the player is simply standing on the floor,
		the point will move into the next block, and the floor() will retrieve that instead of air. */
		Vector3d CrossTestPosition = GetPosition() + Vector3d(CrossSampleCoords[i].x * HalfWidth, -EPS, CrossSampleCoords[i].z * HalfWidth);

		/* We go through the blocks that we consider "relevant" */
		for (size_t j = 0; j < ARRAYCOUNT(BlockSampleOffsets); j++)
		{
			Vector3i BlockTestPosition = CrossTestPosition.Floor() + Vector3i(BlockSampleOffsets[j].x, BlockSampleOffsets[j].y, BlockSampleOffsets[j].z);

			if (!cChunkDef::IsValidHeight(BlockTestPosition.y))
			{
				continue;
			}

			BLOCKTYPE Block = GetWorld()->GetBlock(BlockTestPosition);
			NIBBLETYPE BlockMeta = GetWorld()->GetBlockMeta(BlockTestPosition);

			/* we do the cross-shaped sampling to check for water / liquids, but only on our level because water blocks are never bigger than unit voxels */
			if (j == 0)
			{
				IsFootInWater |= IsBlockWater(Block);
				IsFootInLiquid |= IsFootInWater || IsBlockLava(Block) || (Block == E_BLOCK_COBWEB);  // okay so cobweb is not _technically_ a liquid...
				IsFootOnSlimeBlock |= (Block == E_BLOCK_SLIME_BLOCK);
			}

			/* If the block is solid, and the blockhandler confirms the block to be inside, we're officially on the ground. */
			if ((cBlockInfo::IsSolid(Block)) && (cBlockInfo::GetHandler(Block)->IsInsideBlock(CrossTestPosition - BlockTestPosition, Block, BlockMeta)))
			{
				OnGround = true;
			}
		}
	}

	/* So here's the use of the rules above: */
	/* 1. Falling in water absorbs all fall damage */
	bool FallDamageAbsorbed = IsFootInWater;

	/* 2. Falling in liquid (lava, water, cobweb) or hitting a slime block resets the "fall zenith".
	Note: Even though the pawn bounces back with no damage after hitting the slime block,
	the "fall zenith" will continue to increase back up when flying upwards - which is good */
	bool ShouldBounceOnSlime = true;

	if (IsPlayer())
	{
		auto Player = static_cast<cPlayer *>(this);

		/* 3. If the player is flying or climbing, absorb fall damage */
		FallDamageAbsorbed |= Player->IsFlying() || Player->IsClimbing();

		/* 4. If the player is about to bounce on a slime block and is not crouching, absorb all fall damage  */
		ShouldBounceOnSlime = !Player->IsCrouched();
		FallDamageAbsorbed |= (IsFootOnSlimeBlock && ShouldBounceOnSlime);
	}
	else
	{
		/* 5. Bouncing on a slime block absorbs all fall damage  */
		FallDamageAbsorbed |= IsFootOnSlimeBlock;
	}

	/* If the player is not crouching or is not a player, shoot them back up.
	NOTE: this will only work in some cases; should be done in HandlePhysics() */
	if (IsFootOnSlimeBlock && ShouldBounceOnSlime)
	{
		// TODO: doesn't work too well, causes dissatisfactory experience for players on slime blocks - SetSpeedY(-GetSpeedY());
	}

	// TODO: put player speed into GetSpeedY, and use that.
	// If flying, climbing, swimming, or going up...
	if (FallDamageAbsorbed || ((GetPosition() - m_LastPosition).y > 0))
	{
		// ...update the ground height to have the highest position of the player (i.e. jumping up adds to the eventual fall damage)
		m_LastGroundHeight = GetPosY();
	}

	if (OnGround)
	{
		auto Damage = static_cast<int>(m_LastGroundHeight - GetPosY() - 3.0);
		if ((Damage > 0) && !FallDamageAbsorbed)
		{
			TakeDamage(dtFalling, nullptr, Damage, Damage, 0);

			// Fall particles
			// TODO: Re-enable this when effects in 1.9 aren't broken (right now this uses the wrong effect ID in 1.9 and the right one in 1.8)
			// int ParticleSize = static_cast<int>((std::min(15, Damage) - 1.f) * ((50.f - 20.f) / (15.f - 1.f)) + 20.f);
			// GetWorld()->BroadcastSoundParticleEffect(EffectID::PARTICLE_FALL_PARTICLES, POSX_TOINT, POSY_TOINT - 1, POSZ_TOINT, ParticleSize);
		}

		m_bTouchGround = true;
		m_LastGroundHeight = GetPosY();
	}
	else
	{
		m_bTouchGround = false;
	}

	/* Note: it is currently possible to fall through lava and still die from fall damage
	because of the client skipping an update about the lava block. This can only be resolved by
	somehow integrating these above checks into the tracer in HandlePhysics. */
}

void cPawn::StopEveryoneFromTargetingMe()
{
	std::vector<cMonster*>::iterator i = m_TargetingMe.begin();
	while (i != m_TargetingMe.end())
	{
		cMonster * Monster = *i;
		ASSERT(Monster->GetTarget() == this);
		Monster->UnsafeUnsetTarget();
		i = m_TargetingMe.erase(i);
	}
	ASSERT(m_TargetingMe.size() == 0);
}

std::map<cEntityEffect::eType, cEntityEffect *> cPawn::GetEntityEffects()
{
	return m_EntityEffects;
}

cEntityEffect *cPawn::GetEntityEffect(cEntityEffect::eType a_EffectType)
{
	return m_EntityEffects.at(a_EffectType);
}