text:
using ::testing::_;
using ::testing::AnyNumber;
using ::testing::InSequence;
using ::testing::Invoke;
using ::testing::NotNull;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::StrictMock;

namespace media {

static const int64 kFrameDuration = 10;
static const int64 kVideoDuration = kFrameDuration * 100;
static const int64 kEndOfStream = kint64min;
static const gfx::Size kNaturalSize(16u, 16u);

class VideoRendererBaseTest : public ::testing::Test {
 public:
  VideoRendererBaseTest()
      : decoder_(new MockVideoDecoder()),
        cv_(&lock_),
        event_(false, false),
        timeout_(base::TimeDelta::FromMilliseconds(
            TestTimeouts::action_timeout_ms())),
        seeking_(false),
        paint_cv_(&lock_),
        paint_was_called_(false),
        should_queue_read_cb_(false) {
    renderer_ = new VideoRendererBase(
        base::Bind(&VideoRendererBaseTest::Paint, base::Unretained(this)),
        base::Bind(&VideoRendererBaseTest::SetOpaqueCBWasCalled,
                   base::Unretained(this)),
        true);
    renderer_->set_host(&host_);

    EXPECT_CALL(*decoder_, natural_size())
        .WillRepeatedly(ReturnRef(kNaturalSize));
    EXPECT_CALL(statistics_cb_object_, OnStatistics(_))
        .Times(AnyNumber());
    EXPECT_CALL(*this, SetOpaqueCBWasCalled(_))
        .WillRepeatedly(::testing::Return());
    EXPECT_CALL(*decoder_, Stop(_))
        .WillRepeatedly(Invoke(RunClosure));
    EXPECT_CALL(*this, TimeCBWasCalled(_))
        .WillRepeatedly(::testing::Return());
  }

  virtual ~VideoRendererBaseTest() {
    read_queue_.clear();

    if (renderer_) {
      Stop();
    }
  }

  MOCK_METHOD1(TimeCBWasCalled, void(base::TimeDelta));

  MOCK_CONST_METHOD1(SetOpaqueCBWasCalled, void(bool));

  void Initialize() {
    // TODO(scherkus): really, really, really need to inject a thread into
    // VideoRendererBase... it makes mocking much harder.
    EXPECT_CALL(host_, GetTime())
        .WillRepeatedly(Invoke(this, &VideoRendererBaseTest::GetTime));

    // Expects the video renderer to get duration from the host.
    EXPECT_CALL(host_, GetDuration())
        .WillRepeatedly(Return(
            base::TimeDelta::FromMicroseconds(kVideoDuration)));

    // Monitor reads from the decoder.
    EXPECT_CALL(*decoder_, Read(_))
        .WillRepeatedly(Invoke(this, &VideoRendererBaseTest::FrameRequested));

    EXPECT_CALL(*decoder_, Reset(_))
        .WillRepeatedly(Invoke(this, &VideoRendererBaseTest::FlushRequested));

    InSequence s;

    // We expect the video size to be set.
    EXPECT_CALL(host_, SetNaturalVideoSize(kNaturalSize));

    // Set playback rate before anything else happens.
    renderer_->SetPlaybackRate(1.0f);

    // Initialize, we shouldn't have any reads.
    renderer_->Initialize(decoder_,
                          NewExpectedStatusCB(PIPELINE_OK),
                          NewStatisticsCB(),
                          NewTimeCB());

    // Now seek to trigger prerolling.
    Seek(0);
  }

  // Instead of immediately satisfying a decoder Read request, queue it up.
  void QueueReadCB() {
    should_queue_read_cb_ = true;
  }

  void SatisfyQueuedReadCB() {
    base::AutoLock l(lock_);
    CHECK(should_queue_read_cb_ && !queued_read_cb_.is_null());
    should_queue_read_cb_ = false;
    VideoDecoder::ReadCB read_cb(queued_read_cb_);
    queued_read_cb_.Reset();
    base::AutoUnlock u(lock_);
    read_cb.Run(VideoDecoder::kOk, VideoFrame::CreateEmptyFrame());
  }

  void StartSeeking(int64 timestamp, PipelineStatus expected_status) {
    EXPECT_FALSE(seeking_);

    // Seek to trigger prerolling.
    seeking_ = true;
    renderer_->Seek(base::TimeDelta::FromMicroseconds(timestamp),
                    base::Bind(&VideoRendererBaseTest::OnSeekComplete,
                               base::Unretained(this), expected_status));
  }

  void Play() {
    SCOPED_TRACE("Play()");
    renderer_->Play(NewWaitableClosure());
    WaitForClosure();
  }

  // Seek and preroll to the given timestamp.
  //
  // Use |kEndOfStream| to preroll end of stream frames.
  void Seek(int64 timestamp) {
    SCOPED_TRACE(base::StringPrintf("Seek(%" PRId64 ")", timestamp));
    StartSeeking(timestamp, PIPELINE_OK);
    FinishSeeking(timestamp);
  }

  void Pause() {
    SCOPED_TRACE("Pause()");
    renderer_->Pause(NewWaitableClosure());
    WaitForClosure();
  }

  void Flush() {
    SCOPED_TRACE("Flush()");
    renderer_->Flush(NewWaitableClosure());
    WaitForClosure();
  }

  void Stop() {
    SCOPED_TRACE("Stop()");
    renderer_->Stop(NewWaitableClosure());
    WaitForClosure();
  }

  void Shutdown() {
    Pause();
    Flush();
    Stop();
  }

  // Delivers a frame with the given timestamp to the video renderer.
  //
  // Use |kEndOfStream| to pass in an end of stream frame.
  void DeliverFrame(int64 timestamp) {
    // Lock+swap to avoid re-entrancy issues.
    VideoDecoder::ReadCB read_cb;
    {
      base::AutoLock l(lock_);
      std::swap(read_cb, read_cb_);
    }

    if (timestamp == kEndOfStream) {
      read_cb.Run(VideoDecoder::kOk, VideoFrame::CreateEmptyFrame());
    } else {
      read_cb.Run(VideoDecoder::kOk, CreateFrame(timestamp, kFrameDuration));
    }
  }

  void DecoderError() {
    // Lock+swap to avoid re-entrancy issues.
    VideoDecoder::ReadCB read_cb;
    {
      base::AutoLock l(lock_);
      std::swap(read_cb, read_cb_);
    }

    read_cb.Run(VideoDecoder::kDecodeError, NULL);
  }

  void AbortRead() {
    // Lock+swap to avoid re-entrancy issues.
    VideoDecoder::ReadCB read_cb;
    {
      base::AutoLock l(lock_);
      std::swap(read_cb, read_cb_);
    }

    read_cb.Run(VideoDecoder::kOk, NULL);
  }

  void ExpectCurrentFrame(bool present) {
    scoped_refptr<VideoFrame> frame;
    renderer_->GetCurrentFrame(&frame);
    if (present) {
      EXPECT_TRUE(frame);
    } else {
      EXPECT_FALSE(frame);
    }
    renderer_->PutCurrentFrame(frame);
  }

  void ExpectCurrentTimestamp(int64 timestamp) {
    scoped_refptr<VideoFrame> frame;
    renderer_->GetCurrentFrame(&frame);
    EXPECT_EQ(timestamp, frame->GetTimestamp().InMicroseconds());
    renderer_->PutCurrentFrame(frame);
  }

  base::Closure NewWaitableClosure() {
    return base::Bind(&base::WaitableEvent::Signal, base::Unretained(&event_));
  }

  void WaitForClosure() {
    ASSERT_TRUE(event_.TimedWait(timeout_));
    event_.Reset();
  }

  // Creates a frame with given timestamp and duration.
  scoped_refptr<VideoFrame> CreateFrame(int64 timestamp, int64 duration) {
    scoped_refptr<VideoFrame> frame =
        VideoFrame::CreateFrame(VideoFrame::RGB32, kNaturalSize.width(),
                                kNaturalSize.height(),
                                base::TimeDelta::FromMicroseconds(timestamp),
                                base::TimeDelta::FromMicroseconds(duration));
    return frame;
  }

  // Advances clock to |timestamp| and waits for the frame at |timestamp| to get
  // rendered using |read_cb_| as the signal that the frame has rendered.
  void RenderFrame(int64 timestamp) {
    base::AutoLock l(lock_);
    time_ = base::TimeDelta::FromMicroseconds(timestamp);
    paint_was_called_ = false;
    if (read_cb_.is_null()) {
      cv_.TimedWait(timeout_);
      CHECK(!read_cb_.is_null()) << "Timed out waiting for read to occur.";
    }
    WaitForPaint_Locked();
  }

  // Advances clock to |timestamp| (which should be the timestamp of the last
  // frame plus duration) and waits for the ended signal before returning.
  void RenderLastFrame(int64 timestamp) {
    EXPECT_CALL(host_, NotifyEnded())
        .WillOnce(Invoke(&event_, &base::WaitableEvent::Signal));
    {
      base::AutoLock l(lock_);
      time_ = base::TimeDelta::FromMicroseconds(timestamp);
    }
    CHECK(event_.TimedWait(timeout_)) << "Timed out waiting for ended signal.";
  }

  base::WaitableEvent* event() { return &event_; }
  const base::TimeDelta& timeout() { return timeout_; }

  void VerifyNotSeeking() {
    base::AutoLock l(lock_);
    ASSERT_FALSE(seeking_);
  }

 protected:
  StatisticsCB NewStatisticsCB() {
    return base::Bind(&MockStatisticsCB::OnStatistics,
                      base::Unretained(&statistics_cb_object_));
  }

  VideoRenderer::TimeCB NewTimeCB() {
    return base::Bind(&VideoRendererBaseTest::TimeCBWasCalled,
                      base::Unretained(this));
  }

  // Fixture members.
  scoped_refptr<VideoRendererBase> renderer_;
  scoped_refptr<MockVideoDecoder> decoder_;
  StrictMock<MockFilterHost> host_;
  MockStatisticsCB statistics_cb_object_;

  // Receives all the buffers that renderer had provided to |decoder_|.
  std::deque<scoped_refptr<VideoFrame> > read_queue_;

 private:
  // Called by VideoRendererBase for accessing the current time.
  base::TimeDelta GetTime() {
    base::AutoLock l(lock_);
    return time_;
  }

  // Called by VideoRendererBase when it wants a frame.
  void FrameRequested(const VideoDecoder::ReadCB& callback) {
    base::AutoLock l(lock_);
    if (should_queue_read_cb_) {
      CHECK(queued_read_cb_.is_null());
      queued_read_cb_ = callback;
      return;
    }
    CHECK(read_cb_.is_null());
    read_cb_ = callback;
    cv_.Signal();
  }

  void FlushRequested(const base::Closure& callback) {
    // Lock+swap to avoid re-entrancy issues.
    VideoDecoder::ReadCB read_cb;
    {
      base::AutoLock l(lock_);
      std::swap(read_cb, read_cb_);
    }

    // Abort pending read.
    if (!read_cb.is_null())
      read_cb.Run(VideoDecoder::kOk, NULL);

    callback.Run();
  }

  void OnSeekComplete(PipelineStatus expected_status, PipelineStatus status) {
    base::AutoLock l(lock_);
    EXPECT_EQ(status, expected_status);
    EXPECT_TRUE(seeking_);
    seeking_ = false;
    cv_.Signal();
  }

  void FinishSeeking(int64 timestamp) {
    // Satisfy the read requests.  The callback must be executed in order
    // to exit the loop since VideoRendererBase can read a few extra frames
    // after |timestamp| in order to preroll.
    base::AutoLock l(lock_);
    EXPECT_TRUE(seeking_);
    paint_was_called_ = false;
    int i = 0;
    while (seeking_) {
      if (!read_cb_.is_null()) {
        VideoDecoder::ReadCB read_cb;
        std::swap(read_cb, read_cb_);

        // Unlock to deliver the frame to avoid re-entrancy issues.
        base::AutoUnlock ul(lock_);
        if (timestamp == kEndOfStream) {
          read_cb.Run(VideoDecoder::kOk, VideoFrame::CreateEmptyFrame());
        } else {
          read_cb.Run(VideoDecoder::kOk,
                      CreateFrame(i * kFrameDuration, kFrameDuration));
          i++;
        }
      } else {
        // We want to wait iff we're still seeking but have no pending read.
        cv_.TimedWait(timeout_);
        CHECK(!seeking_ || !read_cb_.is_null())
            << "Timed out waiting for seek or read to occur.";
      }
    }

    EXPECT_TRUE(read_cb_.is_null());
    WaitForPaint_Locked();
  }

  void Paint() {
    base::AutoLock l(lock_);
    paint_was_called_ = true;
    paint_cv_.Signal();
  }

  void WaitForPaint_Locked() {
    lock_.AssertAcquired();
    if (paint_was_called_)
      return;
    paint_cv_.TimedWait(timeout_);
    EXPECT_TRUE(paint_was_called_);
  }

  base::Lock lock_;
  base::ConditionVariable cv_;
  base::WaitableEvent event_;
  base::TimeDelta timeout_;

  // Used in conjunction with |lock_| and |cv_| for satisfying reads.
  bool seeking_;
  VideoDecoder::ReadCB read_cb_;
  base::TimeDelta time_;

  // Used in conjunction with |lock_| to wait for Paint() calls.
  base::ConditionVariable paint_cv_;
  bool paint_was_called_;

  // Holding queue for Read callbacks for exercising delayed demux/decode.
  bool should_queue_read_cb_;
  VideoDecoder::ReadCB queued_read_cb_;

  DISALLOW_COPY_AND_ASSIGN(VideoRendererBaseTest);
};

TEST_F(VideoRendererBaseTest, Initialize) {
  Initialize();
  ExpectCurrentTimestamp(0);
  Shutdown();
}

TEST_F(VideoRendererBaseTest, Play) {
  Initialize();
  Play();
  Shutdown();
}

TEST_F(VideoRendererBaseTest, EndOfStream) {
  Initialize();
  Play();

  // Finish rendering up to the next-to-last frame.
  for (int i = 1; i < limits::kMaxVideoFrames; ++i)
    RenderFrame(kFrameDuration * i);

  // Finish rendering the last frame, we should NOT get a new frame but instead
  // get notified of end of stream.
  DeliverFrame(kEndOfStream);
  RenderLastFrame(kFrameDuration * limits::kMaxVideoFrames);

  Shutdown();
}

TEST_F(VideoRendererBaseTest, DecoderError) {
  Initialize();
  Play();
  RenderFrame(kFrameDuration);
  EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
  DecoderError();
  Shutdown();
}

TEST_F(VideoRendererBaseTest, DecoderErrorDuringSeek) {
  Initialize();
  Pause();
  Flush();
  StartSeeking(kFrameDuration * 6, PIPELINE_ERROR_DECODE);
  DecoderError();
  Shutdown();
}

TEST_F(VideoRendererBaseTest, Seek_Exact) {
  Initialize();
  Pause();
  Flush();
  Seek(kFrameDuration * 6);
  ExpectCurrentTimestamp(kFrameDuration * 6);
  Shutdown();
}

TEST_F(VideoRendererBaseTest, Seek_RightBefore) {
  Initialize();
  Pause();
  Flush();
  Seek(kFrameDuration * 6 - 1);
  ExpectCurrentTimestamp(kFrameDuration * 5);
  Shutdown();
}

TEST_F(VideoRendererBaseTest, Seek_RightAfter) {
  Initialize();
  Pause();
  Flush();
  Seek(kFrameDuration * 6 + 1);
  ExpectCurrentTimestamp(kFrameDuration * 6);
  Shutdown();
}

TEST_F(VideoRendererBaseTest, GetCurrentFrame_Initialized) {
  Initialize();
  ExpectCurrentFrame(true);  // Due to prerolling.
  Shutdown();
}

TEST_F(VideoRendererBaseTest, GetCurrentFrame_Playing) {
  Initialize();
  Play();
  ExpectCurrentFrame(true);
  Shutdown();
}

TEST_F(VideoRendererBaseTest, GetCurrentFrame_Paused) {
  Initialize();
  Play();
  Pause();
  ExpectCurrentFrame(true);
  Shutdown();
}

TEST_F(VideoRendererBaseTest, GetCurrentFrame_Flushed) {
  Initialize();
  Play();
  Pause();
  Flush();
  ExpectCurrentFrame(false);
  Shutdown();
}

#if defined(OS_MACOSX)
// http://crbug.com/109405
#define MAYBE_GetCurrentFrame_EndOfStream DISABLED_GetCurrentFrame_EndOfStream
#else
#define MAYBE_GetCurrentFrame_EndOfStream GetCurrentFrame_EndOfStream
#endif
TEST_F(VideoRendererBaseTest, MAYBE_GetCurrentFrame_EndOfStream) {
  Initialize();
  Play();
  Pause();
  Flush();

  // Seek and preroll only end of stream frames.
  Seek(kEndOfStream);
  ExpectCurrentFrame(false);

  // Start playing, we should immediately get notified of end of stream.
  EXPECT_CALL(host_, NotifyEnded())
      .WillOnce(Invoke(event(), &base::WaitableEvent::Signal));
  Play();
  CHECK(event()->TimedWait(timeout())) << "Timed out waiting for ended signal.";

  Shutdown();
}

TEST_F(VideoRendererBaseTest, GetCurrentFrame_Shutdown) {
  Initialize();
  Shutdown();
  ExpectCurrentFrame(false);
}

// Stop() is called immediately during an error.
TEST_F(VideoRendererBaseTest, GetCurrentFrame_Error) {
  Initialize();
  Stop();
  ExpectCurrentFrame(false);
}

// Verify that shutdown can only proceed after we return the current frame.
TEST_F(VideoRendererBaseTest, Shutdown_DuringPaint) {
  Initialize();
  Play();

  // Grab the frame.
  scoped_refptr<VideoFrame> frame;
  renderer_->GetCurrentFrame(&frame);
  EXPECT_TRUE(frame);

  Pause();

  // Start flushing -- it won't complete until we return the frame.
  renderer_->Flush(NewWaitableClosure());

  // Return the frame and wait.
  renderer_->PutCurrentFrame(frame);
  WaitForClosure();

  Stop();
}

// Verify that a late decoder response doesn't break invariants in the renderer.
TEST_F(VideoRendererBaseTest, StopDuringOutstandingRead) {
  Initialize();
  Pause();
  Flush();
  QueueReadCB();
  StartSeeking(kFrameDuration * 6, PIPELINE_OK);  // Force-decode some more.
  renderer_->Stop(NewWaitableClosure());
  SatisfyQueuedReadCB();
  WaitForClosure();  // Finish the Stop().
}

TEST_F(VideoRendererBaseTest, AbortPendingRead_Playing) {
  Initialize();
  Play();

  // Render a frame to trigger a Read().
  RenderFrame(kFrameDuration);

  AbortRead();

  Pause();
  Flush();
  Seek(kFrameDuration * 6);
  ExpectCurrentTimestamp(kFrameDuration * 6);
  Shutdown();
}

TEST_F(VideoRendererBaseTest, AbortPendingRead_Flush) {
  Initialize();
  Play();

  // Render a frame to trigger a Read().
  RenderFrame(kFrameDuration);

  Pause();
  Flush();
  Shutdown();
}

TEST_F(VideoRendererBaseTest, AbortPendingRead_Seek) {
  Initialize();
  Pause();
  Flush();
  StartSeeking(kFrameDuration * 6, PIPELINE_OK);
  AbortRead();
  VerifyNotSeeking();
  Shutdown();
}

}  // namespace media


text: <!doctype html>

redpajama_set_name: RedPajamaGithub


text:
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!

#include "config.h"
#include "V8RTCDataChannelEvent.h"

#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8HiddenValue.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
#include "bindings/modules/v8/V8RTCDataChannel.h"
#include "core/dom/ContextFeatures.h"
#include "core/dom/Document.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/TraceEvent.h"
#include "wtf/GetPtr.h"
#include "wtf/RefPtr.h"

namespace blink {

// Suppress warning: global constructors, because struct WrapperTypeInfo is trivial
// and does not depend on another global objects.
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
const WrapperTypeInfo V8RTCDataChannelEvent::wrapperTypeInfo = { gin::kEmbedderBlink, V8RTCDataChannelEvent::domTemplate, V8RTCDataChannelEvent::refObject, V8RTCDataChannelEvent::derefObject, V8RTCDataChannelEvent::trace, 0, 0, V8RTCDataChannelEvent::preparePrototypeObject, V8RTCDataChannelEvent::installConditionallyEnabledProperties, "RTCDataChannelEvent", &V8Event::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Independent, WrapperTypeInfo::WillBeGarbageCollectedObject };
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic pop
#endif

// This static member must be declared by DEFINE_WRAPPERTYPEINFO in RTCDataChannelEvent.h.
// For details, see the comment of DEFINE_WRAPPERTYPEINFO in
// bindings/core/v8/ScriptWrappable.h.
const WrapperTypeInfo& RTCDataChannelEvent::s_wrapperTypeInfo = V8RTCDataChannelEvent::wrapperTypeInfo;

namespace RTCDataChannelEventV8Internal {

static void channelAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    RTCDataChannelEvent* impl = V8RTCDataChannelEvent::toImpl(holder);
    RawPtr<RTCDataChannel> cppValue(impl->channel());
    if (cppValue && DOMDataStore::setReturnValue(info.GetReturnValue(), cppValue.get()))
        return;
    v8::Local<v8::Value> v8Value(toV8(cppValue.get(), holder, info.GetIsolate()));
    if (!v8Value.IsEmpty()) {
        V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "channel"), v8Value);
        v8SetReturnValue(info, v8Value);
    }
}

static void channelAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    RTCDataChannelEventV8Internal::channelAttributeGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

} // namespace RTCDataChannelEventV8Internal

static const V8DOMConfiguration::AccessorConfiguration V8RTCDataChannelEventAccessors[] = {
    {"channel", RTCDataChannelEventV8Internal::channelAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
};

static void installV8RTCDataChannelEventTemplate(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
{
    functionTemplate->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "RTCDataChannelEvent", V8Event::domTemplate(isolate), V8RTCDataChannelEvent::internalFieldCount,
        0, 0,
        V8RTCDataChannelEventAccessors, WTF_ARRAY_LENGTH(V8RTCDataChannelEventAccessors),
        0, 0);
    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
    ALLOW_UNUSED_LOCAL(instanceTemplate);
    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
    ALLOW_UNUSED_LOCAL(prototypeTemplate);

    // Custom toString template
    functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
}

v8::Local<v8::FunctionTemplate> V8RTCDataChannelEvent::domTemplate(v8::Isolate* isolate)
{
    return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8RTCDataChannelEventTemplate);
}

bool V8RTCDataChannelEvent::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
{
    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
}

v8::Local<v8::Object> V8RTCDataChannelEvent::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
{
    return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
}

RTCDataChannelEvent* V8RTCDataChannelEvent::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
{
    return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0;
}

void V8RTCDataChannelEvent::refObject(ScriptWrappable* scriptWrappable)
{
#if !ENABLE(OILPAN)
    scriptWrappable->toImpl<RTCDataChannelEvent>()->ref();
#endif
}

void V8RTCDataChannelEvent::derefObject(ScriptWrappable* scriptWrappable)
{
#if !ENABLE(OILPAN)
    scriptWrappable->toImpl<RTCDataChannelEvent>()->deref();
#endif
}

} // namespace blink


text:
![Github Widget Image](http://i.imgur.com/KfiQIXL.png)

#### How to use

##### Copy paste this code in your HTML, replacing data-username with your GitHub username

```html
<div class="github-widget" data-username="surbhioberoi"></div>
<script src="https://unpkg.com/github-card@1.2.1/dist/widget.js"></script>
```

##### Via npm

`npm install github-card`

Then add this to your HTML, replacing data-username value with your own GitHub username

```html
<div class="github-widget" data-username="surbhioberoi"></div>
<script src="../node_modules/github-card/dist/widget.js"></script>
```

##### Via bower

`bower install github-widget`

Then add this to your HTML, replacing data-username value with your own GitHub username

```html
<div class="github-widget" data-username="surbhioberoi"></div>
<script src="/bower_components/github-card/dist/widget.js"></script>
```

#### Using multiple widgets in same page

```html
<div class="github-widget" data-username="github"></div>
<div class="github-widget" data-username="surbhioberoi"></div>
<script src="https://unpkg.com/github-card@1.2.1/dist/widget.js"></script>
```


text:
package org.docksidestage.remote.harbor.base;

import java.util.List;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import org.dbflute.Entity;
import org.dbflute.cbean.result.PagingResultBean;
import org.lastaflute.core.util.Lato;
import org.lastaflute.web.validation.Required;

/**
 * @param <BEAN> The type of row bean
 * @author jflute
 */
public class RemoteHbPagingReturn<BEAN> {

    /** row count per one page */
    @Required
    public final Integer pageSize;

    /** number of current page */
    @Required
    public final Integer currentPageNumber;

    /** count of all records */
    @Required
    public final Integer allRecordCount;

    /** count of all pages */
    @Required
    public final Integer allPageCount;

    /** paging data for current page */
    @NotNull
    @Valid
    public final List<BEAN> rows;

    public RemoteHbPagingReturn(PagingResultBean<? extends Entity> page, List<BEAN> rows) {
        this.pageSize = page.getPageSize();
        this.currentPageNumber = page.getCurrentPageNumber();
        this.allRecordCount = page.getAllRecordCount();
        this.allPageCount = page.getAllPageCount();
        this.rows = rows;
    }

    @Override
    public String toString() {
        return Lato.string(this);
    }
}


text:
<?php
/**
 * [PHPFOX_HEADER]
 */

defined('PHPFOX') or exit('NO DICE!');

/**
 *
 *
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Raymond Benc
 * @package 		Phpfox_Service
 * @version 		$Id: data.class.php 2525 2011-04-13 18:03:20Z Raymond_Benc $
 */
class Report_Service_Data_Data extends Phpfox_Service
{
	/**
	 * Class constructor
	 */
	public function __construct()
	{
		$this->_sTable = Phpfox::getT('report_data');
	}

	public function getReports($iId)
	{
		$aReport = $this->database()->select('item_id')
			->from($this->_sTable)
			->where('data_id = ' . (int) $iId)
			->execute('getRow');

		if (!isset($aReport['item_id']) && !isset($aReport['feedback']))
		{
			return false;
		}

		$aReports = $this->database()->select('rd.*, r.message, ' . Phpfox::getUserField())
			->from($this->_sTable, 'rd')
			->join(Phpfox::getT('user'), 'u', 'u.user_id = rd.user_id')
			->join(Phpfox::getT('report'), 'r', 'r.report_id = rd.report_id')
			->where('item_id = \'' . $aReport['item_id'] . '\'')
			->execute('getRows');

		return $aReports;
	}

	/**
	 * If a call is made to an unknown method attempt to connect
	 * it to a specific plug-in with the same name thus allowing
	 * plug-in developers the ability to extend classes.
	 *
	 * @param string $sMethod is the name of the method
	 * @param array $aArguments is the array of arguments of being passed
	 */
	public function __call($sMethod, $aArguments)
	{
		/**
		 * Check if such a plug-in exists and if it does call it.
		 */
		if ($sPlugin = Phpfox_Plugin::get('report.service_data_data__call'))
		{
			return eval($sPlugin);
		}

		/**
		 * No method or plug-in found we must throw a error.
		 */
		Phpfox_Error::trigger('Call to undefined method ' . __CLASS__ . '::' . $sMethod . '()', E_USER_ERROR);
	}
}

?>


text:
package com.alibaba.druid.support.logging;

/**
 * A class to simplify access to resources through the classloader.
 */
public final class Resources extends Object {

    private static ClassLoader defaultClassLoader;

    private Resources(){
    }

    /**
     * Returns the default classloader (may be null).
     *
     * @return The default classloader
     */
    public static ClassLoader getDefaultClassLoader() {
        return defaultClassLoader;
    }

    /**
     * Sets the default classloader
     *
     * @param defaultClassLoader - the new default ClassLoader
     */
    public static void setDefaultClassLoader(ClassLoader defaultClassLoader) {
        Resources.defaultClassLoader = defaultClassLoader;
    }

    /**
     * Loads a class
     *
     * @param className - the class to load
     * @return The loaded class
     * @throws ClassNotFoundException If the class cannot be found (duh!)
     */
    public static Class<?> classForName(String className) throws ClassNotFoundException {
        Class<?> clazz = null;
        try {
            clazz = getClassLoader().loadClass(className);
        } catch (Exception e) {
            // Ignore. Failsafe below.
        }
        if (clazz == null) {
            clazz = Class.forName(className);
        }
        return clazz;
    }

    private static ClassLoader getClassLoader() {
        if (defaultClassLoader != null) {
            return defaultClassLoader;
        } else {
            return Thread.currentThread().getContextClassLoader();
        }
    }

}


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const articles_1 = require("./articles");
exports.Articles = articles_1.default;
const store_1 = require("./store");
exports.Store = store_1.default;
class Core {
}
exports.default = Core;


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Payment System</title>

    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="css/rentpayment.css" >

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                Navigation

            </button>
            Payment System

Logout

Jermaine Davis

        <form class="form-horizontal">
            <fieldset>

                <legend>Profile</legend>

                    First Name:

                        <input id="firstName" name="firstName" type="text" placeholder="" class="form-control input-md">

                    Last Name:

                        <input id="lastName" name="lastName" type="text" placeholder="" class="form-control input-md">

                    Email:

                        <input id="email" name="email" type="text" placeholder="" class="form-control input-md">

            </fieldset>
        </form>


text:
package com.netflix.iep.lwc

import akka.http.scaladsl.model.HttpEntity
import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.model.MediaTypes
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import com.netflix.atlas.akka.CustomDirectives._
import com.netflix.atlas.akka.WebApi
import com.netflix.atlas.json.Json

/**
  * Dump the stats for the expressions flowing through the bridge.
  */
class StatsApi(evaluator: ExpressionsEvaluator) extends WebApi {

  override def routes: Route = {
    endpointPathPrefix("api" / "v1" / "stats") {
      get {
        val stats = Json.encode(evaluator.stats)
        val entity = HttpEntity(MediaTypes.`application/json`, stats)
        val response = HttpResponse(StatusCodes.OK, Nil, entity)
        complete(response)
      }
    }
  }
}


text:
class Automaton:
    def __init__(self):
        self.name2state = dict()
        self.state_names = []
        self.transitions = []
    def num_states(self):
        return len(self.transitions)
    def add_state(self, name):
        if name in self.name2state:
            raise ValueError("State {} already exists".format(name))
        state = len(self.transitions)
        self.name2state[name] = state
        self.state_names.append(name)
        self.transitions.append(dict()) #empty state without transitions
        return state

    def add_transition(self, state, input, new_state ):
        self.transitions[state][input] = new_state

    def next(self, state, input):
        """returns next state, or raises KeyError, if input is not accepted"""
        return self.transitions[state][input]

    def accept_seq(self, initial_state, inputs):
        """Returns final state if the string is accepted or raises KeyError"""
        s = initial_state
        ts = self.transitions
        for inp in inputs:
            s = ts[s][inp]
        return s

def growth_matrices( automaton, initial_state ):
    """Returns 2 matrices: A,b,c, defining a discrete-time linear system whose impulse responce
    is number of accepted strings.
    """
    n  = automaton.num_states()
    a = [ [0 for _ in range(n)]
          for __ in range(n)]
    for state, state_transitions in enumerate(automaton.transitions ):
        for new_state in state_transitions.values():
            a[new_state][state] = 1
    b = [0]*n
    b[initial_state] = 1

    c = [1]*n
    return a,b,c

#actually useless
"""
def growth_function_numpy( automaton, initial_state ):
    import numpy as np
    a,b,c = (np.array(x)
             for x in growth_matrices(automaton, initial_state))

    from ss2tf import ss2tf
    num, den = ss2tf(a,b,c)
    return list(map(round, num)), list(map(round, den))
"""

def automaton_growth_func( automaton, initial_state, variable='z' ):
    """Returns Z-transform of the growth function of this automaton
    Uses SYmpy for calculations"""
    from sympy import Symbol, Matrix, eye, cancel
    z = variable if isinstance(variable,Symbol) else Symbol(variable)

    n  = automaton.num_states()
    a_,b_,c_ = growth_matrices(automaton, initial_state)
    #a.print_nonzero()
    c = Matrix( 1, n, c_)
    b = Matrix( n, 1, b_)
    a = Matrix( a_)
    del a_, b_, c_

    #(z*eye(n)-a).inv().print_nonzero()

    if False: #naiive implementation
        q = z*eye(n)-a
        f = c * q.LUsolve(b) * z
        assert f.shape == (1,1)
        return f[0,0]

    if True:
        #use trick...
        den = a.berkowitz_charpoly(z)
        #print("#### charpoly:", den)
        num = (a - b*c).berkowitz_charpoly(z) - den
        #print("#### numerator:", num)
        return num/den

    #f = (c * q.adjugate() * b * z)/q.det()

    #f_num = c * q.adjugate() * b
    #f_den = q.det() / z
    #assert f_num.shape == (1,1)
    #return f_num[0,0] / f_den

def make_2step_automaton( automaton ):
    """Make an automaton that accepts pairs of the inputs, accepted by the original automaton"""
    a1 = Automaton()
    for state, name in enumerate(automaton.state_names):
        state_ = a1.add_state(name)
        assert state_ == state

    for state, state_transitions in enumerate(automaton.transitions):
        for input1, state1 in state_transitions.items():
            for input2, state2 in automaton.transitions[state1].items():
                a1.add_transition( state, (input1, input2), state2 )
    return a1

def export_dot( automaton, dotfile ):
    def escape(s):
        return '"' + s.replace('"', '\\"') + '"'
    w = dotfile.write
    w("digraph{\n")
    for statename in automaton.state_names:
        w('  {};\n'.format(escape(statename)))

    for state, state_transitions in enumerate(automaton.transitions):
        for input, new_state in state_transitions.items():
            w('  {a} -> {b} [label={lbl}];\n'.format(
                a=escape(automaton.state_names[state]),
                b=escape(automaton.state_names[new_state]),
                lbl=escape(str(input))))
    w('}\n')

def build_accepting_automaton( alphabet, forbidden_suffices, suffix2name=str ):
    """Builds a finite automaton that accepts strings without any forbidden ones
    """
    def initials(s):
        for l in range(len(s)):
            yield s[:l]

    forbidden_set = set( tuple(seq) for seq in forbidden_suffices )

    states = set( tuple(pref)
                  for suffix in forbidden_suffices
                  for pref in initials(suffix)
    )

    #print ("FOrbidden:", forbidden_set)
    #print ("States:", states)
    state2index = {}
    automaton = Automaton()
    for state in states:
        state_name = suffix2name(state)
        state_index = automaton.add_state(state_name)
        state2index[state] = state_index

    #now encode transitions
    for state in states:
        state_index = state2index[state]
        for letter in alphabet:
            state1 = state + (letter,)
            #now truncate it, until it is either one of the alowed states,
            # or one of forbidden.
            while True:
                if state1 in forbidden_set:
                    #this state is forbidden.
                    break
                if state1 in states:
                    #allowed state found
                    #add a transition
                    automaton.add_transition( state_index, letter, state2index[state1] )
                    break
                #truncate head
                state1 = state1[1:]
    return automaton, state2index[()]


text:
package org.kie.workbench.common.stunner.project.diagram.impl;

import org.jboss.errai.common.client.api.annotations.MapsTo;
import org.jboss.errai.common.client.api.annotations.NonPortable;
import org.jboss.errai.common.client.api.annotations.Portable;
import org.kie.workbench.common.stunner.core.diagram.AbstractMetadata;
import org.kie.workbench.common.stunner.core.diagram.Metadata;
import org.kie.workbench.common.stunner.core.util.HashUtil;
import org.kie.workbench.common.stunner.project.diagram.ProjectMetadata;
import org.uberfire.backend.vfs.Path;

@Portable
public class ProjectMetadataImpl extends AbstractMetadata implements ProjectMetadata {

    private String projectName;
    private String projectPkg;

    public ProjectMetadataImpl() {
    }

    private ProjectMetadataImpl(final @MapsTo("definitionSetId") String definitionSetId,
                                final @MapsTo("projectPkg") String projectPkg,
                                final @MapsTo("projectName") String projectName) {
        super(definitionSetId);
        this.projectName = projectName;
        this.projectPkg = projectPkg;
    }

    @Override
    public String getProjectName() {
        return projectName;
    }

    @Override
    public String getProjectPackage() {
        return projectPkg;
    }

    @Override
    public int hashCode() {
        return HashUtil.combineHashCodes(super.hashCode(),
                                         (null != projectName) ? projectName.hashCode() : 0,
                                         (null != projectPkg) ? projectPkg.hashCode() : 0);
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof ProjectMetadataImpl) {
            ProjectMetadataImpl other = (ProjectMetadataImpl) o;
            return super.equals(other) &&
                    (null != projectName) ? projectName.equals(other.projectName) : null == other.projectName &&
                    (null != projectPkg) ? projectPkg.equals(other.projectPkg) : null == other.projectPkg;
        }
        return false;
    }

    @Override
    public Class<? extends Metadata> getMetadataType() {
        return ProjectMetadata.class;
    }

    @NonPortable
    public static class ProjectMetadataBuilder {

        private String defSetId;
        private String title;
        private String pName;
        private String pPkg;
        private Path path;

        public ProjectMetadataBuilder forDefinitionSetId(final String s) {
            this.defSetId = s;
            return this;
        }

        public ProjectMetadataBuilder forTitle(final String t) {
            this.title = t;
            return this;
        }

        public ProjectMetadataBuilder forProjectName(final String pName) {
            this.pName = pName;
            return this;
        }

        public ProjectMetadataBuilder forProjectPackage(final String pPkg) {
            this.pPkg = pPkg;
            return this;
        }

        public ProjectMetadataBuilder forPath(final Path path) {
            this.path = path;
            return this;
        }

        public ProjectMetadataImpl build() {
            final ProjectMetadataImpl result = new ProjectMetadataImpl(defSetId,
                                                                       pPkg,
                                                                       pName);
            result.setPath(path);
            result.setTitle(title);
            return result;
        }
    }
}


text:
package semanticMarkup.ling.learn.knowledge;

import semanticMarkup.ling.learn.dataholder.DataHolder;

public interface IModule {
	public void run (DataHolder dataholderHandler);
}


text:
require "rails_helper"

RSpec.describe User, type: :model do
  let(:user) { FactoryGirl.build :user }

  subject { user }

  it { should validate_presence_of :username }
  it { should be_valid }

  it { should have_many(:votes) }
  it { should have_many(:moderations) }
  it { should have_many(:moderated_subphezes) }
  it { should have_many(:messages) }
  it { should have_many(:posts) }
  it { should have_many(:comments) }
  it { should have_many(:subphezes) }
  it { should have_many(:subscriptions) }
  it { should have_many(:subscribed_subphezes) }
  it { should have_many(:transactions) }
  it { should have_many(:oauth_applications) }
end
  # context "method calls" do
  #   it "should set_secret successfully" do
  #     @user = FactoryGirl.build(:user)
  #
  #
  #   end
  #
  #
  # end
# end


text:
#include "Wt/Ext/MessageBox"

#include "Wt/WApplication"
#include "Wt/WEnvironment"
#include "Wt/WException"

namespace Wt {
  namespace Ext {

const char *MessageBox::buttonText_[] = { "Ok", "Yes", "No", "Cancel" };

MessageBox::MessageBox(bool i18n)
  : Dialog(Bla()),
    buttonClicked_(this),
    buttons_(NoButton),
    i18n_(i18n),
    prompt_(false),
    textArea_(false),
    progress_(false),
    progressValue_(0),
    progressInfinite_(false),
    firstDisplay_(true),
    catchDelete_(0),
    result_(NoButton),
    extButtonClicked_(this, "btnclk", false)
{
  extButtonClicked_.connect(this, &MessageBox::onClick);
}

MessageBox::MessageBox(const WString& caption, const WString& text,
		       Icon icon, WFlags<StandardButton> buttons, bool i18n)
  : Dialog(Bla()),
    text_(text),
    buttons_(buttons),
    icon_(icon),
    i18n_(i18n),
    prompt_(false),
    textArea_(false),
    progress_(false),
    progressValue_(0),
    progressInfinite_(false),
    firstDisplay_(true),
    catchDelete_(0),
    result_(NoButton),
    extButtonClicked_(this, "btnclk", false)
{
  setWindowTitle(caption);
  extButtonClicked_.connect(this, &MessageBox::onClick);
}

MessageBox::~MessageBox()
{
  hide();

  if (catchDelete_)
    *catchDelete_ = true;
}

void MessageBox::setText(const WString& text)
{
  text_ = text;
  if (!hidden_)
    WApplication::instance()
      ->doJavaScript(elRef() + ".updateText(" + text.jsStringLiteral() + ");");
}

void MessageBox::setIcon(Icon icon)
{
  icon_ = icon;
}

void MessageBox::setButtons(WFlags<StandardButton> buttons)
{
  buttons_ = buttons;
}

void MessageBox::enablePrompt(bool enable)
{
  prompt_ = enable;
}

void MessageBox::enableTextArea(bool enable)
{
  textArea_ = enable;
}

void MessageBox::enableProgressBar(bool enable, bool infinite)
{
  progress_ = enable;
  progressInfinite_ = infinite;
}

void MessageBox::updateProgress(double v)
{
  progressValue_ = std::min(1.0, std::max(0.0, v));

  if (!hidden_)
    WApplication::instance()
      ->doJavaScript(elRef() + ".updateProgress("
		     + boost::lexical_cast<std::string>(progressValue_) + ");");
}

void MessageBox::setValue(const WString& value)
{
  value_ = value;
}

void MessageBox::setHidden(bool hidden, const WAnimation& animation)
{
  if (hidden != hidden_) {
    hidden_ = hidden;

    WApplication *app = WApplication::instance();

    if (!hidden)
      setExposeMask(app);
    else
      restoreExposeMask(app);

    if (hidden)
      app->doJavaScript(elRef() + ".hide();");
    else {
      std::stringstream config;
      config << "{a:0";
      createConfig(config);
      config << "}";

      std::string var;
      if (firstDisplay_) {
	var = elRef() + "=Ext.Msg";

	/* fix cursor problem in FF 1.5, 2 */
	if (!app->environment().agentIsIE())
	  app->doJavaScript
	  ("Ext.Msg.getDialog().on('show', function(d) {"
	   "var div = Ext.get(d.el);"
	   "div.setStyle('overflow', 'auto');"
	   "var text = div.select('.ext-mb-textarea', true);"
	   "if (!text.item(0))"
	   "text = div.select('.ext-mb-text', true);"
	   "if (text.item(0))"
	   "text.item(0).dom.select();});");
      } else
	var = elRef();

      WApplication::instance()
	->doJavaScript(var + ".show(" + config.str() + ");");

      if (progress_) {
	WApplication::instance()
	  ->doJavaScript(elRef() + ".updateProgress("
			 + boost::lexical_cast<std::string>(progressValue_)
			 + ");");
      }

      firstDisplay_ = false;
    }
  }
}

void MessageBox::refresh()
{
  if (text_.refresh())
    setText(text_);

  Dialog::refresh();
}

void MessageBox::createConfig(std::ostream& config)
{
  config << ",title:" << windowTitle().jsStringLiteral();

  if (!text_.empty())
    config << ",msg:" << text_.jsStringLiteral();
  if (prompt_)
    config << ",prompt:true";
  if (textArea_)
    config << ",multiline:true";
  if (prompt_ || textArea_)
    config << ",value:" << value_.jsStringLiteral();
  if (progress_)
    config << ",progress:true";
  if (buttons_ != NoButton) {
    config << ",buttons:{a:0";
    if (buttons_ & Ok)
      config << ",ok:" + jsStringLiteral(buttonText(0), '\'');
    if (buttons_ & Cancel)
      config << ",cancel:" + jsStringLiteral(buttonText(3), '\'');
    if (buttons_ & Yes)
      config << ",yes:" + jsStringLiteral(buttonText(1), '\'');
    if (buttons_ & No)
      config << ",no:" + jsStringLiteral(buttonText(2), '\'');
    config << "}";
  }

  config << ",fn:function(b,v){"
	 << extButtonClicked_.createCall("b","v") << "}";
}

std::string MessageBox::renderRemoveJs(bool recursive)
{
  throw WException("MessageBox::renderRemoveJs(): really?");
}

std::string MessageBox::buttonText(int buttonIndex) const
{
  if (i18n_)
    return WString::tr(buttonText_[buttonIndex]).toUTF8();
  else
    return buttonText_[buttonIndex];
}

StandardButton MessageBox::show(const WString& caption,
				const WString& text,
				WFlags<StandardButton> buttons, bool i18n)
{
  MessageBox box(caption, text, NoIcon, buttons, i18n);

  box.exec();

  return box.result();
}

StandardButton MessageBox::prompt(const WString& caption,
				  const WString& text,
				  WString& result,
				  bool multiLine, bool i18n)
{
  MessageBox box(caption, text, NoIcon, Ok | Cancel, i18n);
  if (multiLine)
    box.enableTextArea(true);
  else
    box.enablePrompt(true);
  box.setValue(result);
  box.exec();

  if (box.result() == Ok)
    result = box.value();

  return box.result();
}

void MessageBox::onClick(std::string buttonId, std::string value)
{
  hidden_ = true;
  restoreExposeMask(WApplication::instance());

  StandardButton b = NoButton;

  if      (buttonId == "ok")     b = Ok;
  else if (buttonId == "cancel") b = Cancel;
  else if (buttonId == "yes")    b = Yes;
  else if (buttonId == "no")     b = No;
  else
    throw WException("MessageBox: internal error, unknown buttonId '"
		     + buttonId + "';");

  bool accepted = b == Ok || b == Yes;

  if (accepted)
    value_ = WString::fromUTF8(value);
  result_ = b;

  bool wasDeleted = false;
  catchDelete_ = &wasDeleted;

  done(accepted ? Accepted : Rejected);

  if (!wasDeleted) {
    buttonClicked_.emit(b);
    catchDelete_ = 0;
  }
}

  }
}


text:
module Selenium
  module WebDriver
    class Options

      def initialize(driver)
        @bridge = driver.bridge
      end

      def add_cookie(opts = {})
        raise ArgumentError, "name is required" unless opts[:name]
        raise ArgumentError, "value is required" unless opts[:value]

        opts[:path] ||= "/"
        opts[:secure] ||= false

        @bridge.addCookie opts
      end

      def delete_cookie(name)
        @bridge.deleteCookie name
      end

      def delete_all_cookies
        @bridge.deleteAllCookies
      end

      def all_cookies
        @bridge.getAllCookies.map do |cookie|
          {
            :name    => cookie["name"],
            :value   => cookie["value"],
            :path    => cookie["path"],
            :domain  => cookie["domain"],
            :expires => cookie["expires"],
            :secure  => cookie["secure"]
          }
        end
      end

      def speed
        @bridge.getSpeed.downcase.to_sym
      end

      def speed=(speed)
        @bridge.setSpeed(speed.to_s.upcase)
      end

    end # Options
  end # WebDriver
end # Selenium


text:
/**
 * @module @react-md/media
 */
export * from "./MediaContainer";
export * from "./MediaOverlay";


text:
RSpec.describe RuboCop::Cop::Utils::FormatString do
  def format_sequences(string)
    described_class.new(string).format_sequences
  end

  it 'finds the correct number of fields' do
    expect(format_sequences('').size).to eq(0)
    expect(format_sequences('%s').size).to eq(1)
    expect(format_sequences('%s %s').size).to eq(2)
    expect(format_sequences('%s %s %%').size).to eq(3)
    expect(format_sequences('%s %s %%').size).to eq(3)
    expect(format_sequences('% d').size).to eq(1)
    expect(format_sequences('%+d').size).to eq(1)
    expect(format_sequences('%d').size).to eq(1)
    expect(format_sequences('%+o').size).to eq(1)
    expect(format_sequences('%#o').size).to eq(1)
    expect(format_sequences('%.0e').size).to eq(1)
    expect(format_sequences('%#.0e').size).to eq(1)
    expect(format_sequences('% 020d').size).to eq(1)
    expect(format_sequences('%20d').size).to eq(1)
    expect(format_sequences('%+20d').size).to eq(1)
    expect(format_sequences('%020d').size).to eq(1)
    expect(format_sequences('%+020d').size).to eq(1)
    expect(format_sequences('% 020d').size).to eq(1)
    expect(format_sequences('%-20d').size).to eq(1)
    expect(format_sequences('%-+20d').size).to eq(1)
    expect(format_sequences('%- 20d').size).to eq(1)
    expect(format_sequences('%020x').size).to eq(1)
    expect(format_sequences('%#20.8x').size).to eq(1)
    expect(format_sequences('%+g:% g:%-g').size).to eq(3)
    expect(format_sequences('%+-d').size) # multiple flags
      .to eq(1)
  end

  describe '#named_interpolation?' do
    shared_examples 'named format sequence' do |format_string|
      it 'detects named format sequence' do
        expect(described_class.new(format_string).named_interpolation?).to be_truthy
      end

      it 'does not detect escaped named format sequence' do
        escaped = format_string.gsub(/%/, '%%')

        expect(described_class.new(escaped).named_interpolation?).to be_falsey
        expect(described_class.new("prefix:#{escaped}").named_interpolation?).to be_falsey
      end
    end

    it_behaves_like 'named format sequence', '%<greeting>2s'
    it_behaves_like 'named format sequence', '%2<greeting>s'
    it_behaves_like 'named format sequence', '%+0<num>8.2f'
    it_behaves_like 'named format sequence', '%+08<num>.2f'
  end

  describe '#valid?' do
    it 'returns true when there are only unnumbered formats' do
      fs = described_class.new('%s %d')
      expect(fs.valid?).to eq true
    end

    it 'returns true when there are only numbered formats' do
      fs = described_class.new('%1$s %2$d')
      expect(fs.valid?).to eq true
    end

    it 'returns true when there are only named formats' do
      fs = described_class.new('%{foo}s')
      expect(fs.valid?).to eq true
    end

    it 'returns true when there are only named with escaped `%` formats' do
      fs = described_class.new('%%%{foo}d')
      expect(fs.valid?).to eq true
    end

    it 'returns false when there are unnumbered and numbered formats' do
      fs = described_class.new('%s %1$d')
      expect(fs.valid?).to eq false
    end

    it 'returns false when there are unnumbered and named formats' do
      fs = described_class.new('%s %{foo}d')
      expect(fs.valid?).to eq false
    end

    it 'returns false when there are numbered and named formats' do
      fs = described_class.new('%1$s %{foo}d')
      expect(fs.valid?).to eq false
    end
  end
end


text:
@extends('layouts.app')

@section('headExtra')

@endsection

@section('content')

Medical Diagnosis

			<form action="" method="post" id="form">

Medical Diagnosis

Please select a category below:

		    	<input type="hidden" name="token" value="<?php echo Token::generate();?>">

		    </form>

@endsection


text:
import rospy
import move_base_msgs.msg
from nav_msgs.msg import Odometry
import tf2_ros
from arlobot_ros.srv import GoToGoal

# Brings in the SimpleActionClient
import actionlib
from actionlib_msgs.msg import GoalStatus

"""
This script should start a service,
which allows you to send arbitrary map based
goals to the robot.
It is left to another program to collect and save those
coordinates.

Call this like so:
rosservice call /arlobot_goto/GoToGoal 'pose: { position: { x: -0.136, y: 0.076, z: 0.101 }, orientation: { x: 0.000, y: 0.000, z: 0.017, w: 1.000} }'
"""

class ArlobotGoTo(object):
    def __init__(self):
        rospy.init_node("arlobot_goto")
        # http://wiki.ros.org/rospy_tutorials/Tutorials/WritingPublisherSubscriber

        # Creates the SimpleActionClient, passing the type of the action
        self._MoveBaseClient = actionlib.SimpleActionClient(
            "move_base", move_base_msgs.msg.MoveBaseAction
        )

        # Listen to the transforms http://wiki.ros.org/tf/TfUsingPython
        self.tf_Buffer = tf2_ros.Buffer()
        self.tf_listener = tf2_ros.TransformListener(self.tf_Buffer)

        # Global variable to hold current pose
        self.currentOdom = Odometry()

        # Subscribe to the current pose via odometry and populate our own variable with the data
        rospy.Subscriber("odom", Odometry, self._SetCurrentOdom)
        # Turns out this works great if you have no map and just want to make movements based on odometry,
        # but if you are using a map, you need the /map to /base_link transform!

        # Create a service that can be called to send robot to a map based goal
        # http://wiki.ros.org/ROS/Tutorials/CreatingMsgAndSrv
        # http://wiki.ros.org/ROS/Tutorials/WritingServiceClient%28python%29
        rospy.Service("~GoToGoal", GoToGoal, self._go_to_goal)

        rospy.spin()
        # Now we just wait for someone to call us!

    def _SetCurrentOdom(self, currentOdom):
        self.currentOdom = currentOdom

    def _go_to_goal(self, new_goal):

        # Waits until the action server has started up and started
        # listening for goals.
        """
        This will stall until the move_base comes up,
        in other words, if you don't run move_base before this, this will just wait,
        and it won't go on until move_base says "odom received!"
        """
        rospy.loginfo("Waiting for move_base to come up . . . ")
        self._MoveBaseClient.wait_for_server()
        rospy.loginfo("move_base is UP!")

        # Wait for tf_listener to be ready.
        # NOTE: I'm not sure this is required anymore or not
        # If you call self.tf_listener too soon it has no data in the listener buffer!
        # http://answers.ros.org/question/164911/move_base-and-extrapolation-errors-into-the-future/
        # We could put a static delay in here, but this is faster.
        rospy.loginfo("Waiting for tf_listener to be ready . . . ")
        tf_listener_ready = False
        # http://wiki.ros.org/tf2/Tutorials/Writing%20a%20tf2%20listener%20%28Python%29
        while not tf_listener_ready:
            try:
                self.tf_Buffer.lookup_transform("map", "base_link", rospy.Time())
                tf_listener_ready = True
            except tf2_ros.ExtrapolationException:
                rospy.loginfo("tf_listener not ready . . . ")
                rospy.sleep(0.1)
        rospy.loginfo("tf_listener READY!")

        # Create a variable to hold our goal
        goal = move_base_msgs.msg.MoveBaseGoal()
        # Note that move_base will not go to an all zero target.

        # we'll create a goal to send to move_base
        # If you are just sending commands to the robot with no map use base_link
        # goal.target_pose.header.frame_id = "base_link"
        # But if you have SLAM or Localization active and are using a map, you need to use the map!
        goal.target_pose.header.frame_id = "map"

        goal.target_pose.pose = new_goal.pose

        rospy.loginfo("Populated goal.")

        #######################################
        # This is the part that sends the goal!#
        #######################################

        rospy.loginfo("Sending goal")
        # Sends the goal to the action server.
        result = -1
        timeoutSeconds = 60  # TODO: Should this be sent as part of the call?
        if not rospy.is_shutdown():
            self._MoveBaseClient.cancel_goals_at_and_before_time(rospy.Time.now())
            # NOTE: Do not use cancel_all_goals here as it can cancel future goals sometimes!
        goal.target_pose.header.stamp = rospy.Time.now()
        if not rospy.is_shutdown():
            self._MoveBaseClient.send_goal(goal)
            count = 0
            finished = False
            # Wait for action to finish or timeout to run out
            # Use double timeout, but cancel if timeout is met
            while (
                count < (timeoutSeconds * 2)
                and not finished
                and not rospy.is_shutdown()
            ):
                if count > timeoutSeconds:
                    finished = True
                    rospy.loginfo(
                        "Time-out reached while attempting to reach goal, canceling!"
                    )
                # NOTE: If the robot tends to get stuck without moving at all,
                #       1. Subscribe to cmd_vel
                #       2. Increment a timer.
                #       3. Zero it out whenever cmd_vel is updated.
                #       4. Cancel this if the timer gets too high.
                count += 1
                rospy.sleep(
                    1
                )  # Set this delay as you see fit. If the robot is extremely fast this could be slowing you down!
                result = self._MoveBaseClient.get_state()
                resultText = ""
                # http://docs.ros.org/indigo/api/actionlib_msgs/html/msg/GoalStatus.html
                if result == GoalStatus.PENDING:
                    resultText = "PENDING"
                if result == GoalStatus.ACTIVE:
                    resultText = "ACTIVE"
                if result == GoalStatus.PREEMPTED:
                    finished = True
                    resultText = "PREEMPTED"
                if result == GoalStatus.SUCCEEDED:
                    finished = True
                    resultText = "SUCCEEDED"
                if result == GoalStatus.ABORTED:
                    finished = True
                    resultText = "ABORTED"
                if result == GoalStatus.REJECTED:
                    finished = True
                    resultText = "REJECTED"
                if result == GoalStatus.PREEMPTING:
                    resultText = "PREEMPTING"
                if result == GoalStatus.RECALLING:
                    resultText = "RECALLING"
                if result == GoalStatus.RECALLED:
                    finished = True
                    resultText = "RECALLED"
                if result == GoalStatus.LOST:
                    finished = True
                    resultText = "LOST"
                rospy.loginfo(
                    "Pending result:"
                    + str(result)
                    + " "
                    + resultText
                    + " Time-out in :"
                    + str(timeoutSeconds - count)
                )
                # If it was determined that we are "finished" then cancel
                # any pending goals right now, because the loop will not
                # repeat.
                if finished:
                    # NOTE: Do not use cancel_all_goals here as it can cancel future goals sometimes!
                    self._MoveBaseClient.cancel_goal()

        trans = self.tf_Buffer.lookup_transform("map", "base_link", rospy.Time())

        rospy.loginfo("New Position: ")
        rospy.loginfo(str(trans.transform.translation))
        rospy.loginfo(" New Orientation: ")
        rospy.loginfo(str(trans.transform.rotation))

        if result == GoalStatus.SUCCEEDED:
            return True
        else:
            return False

    def Stop(self):
        rospy.loginfo("Arlobot Goto is shutting down.")
        self._MoveBaseClient.cancel_goals_at_and_before_time(rospy.Time.now())

    def Run(self):
        print("This is a ROS node.")

if __name__ == "__main__":
    node = ArlobotGoTo()
    rospy.on_shutdown(node.Stop)
    try:
        node.Run()
    except rospy.ROSInterruptException:
        node.Stop()


text:
using Microsoft.PowerShell.Activities;
using System.Management.Automation;
using System.Activities;
using System.Collections.Generic;
using System.ComponentModel;

namespace Microsoft.PowerShell.Management.Activities
{
    /// <summary>
    /// Activity to invoke the Microsoft.PowerShell.Management\Remove-Computer command in a Workflow.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
    public sealed class RemoveComputer : PSRemotingActivity
    {
        /// <summary>
        /// Gets the display name of the command invoked by this activity.
        /// </summary>
        public RemoveComputer()
        {
            this.DisplayName = "Remove-Computer";
        }

        /// <summary>
        /// Gets the fully qualified name of the command invoked by this activity.
        /// </summary>
        public override string PSCommandName { get { return "Microsoft.PowerShell.Management\\Remove-Computer"; } }

        // Arguments

        /// <summary>
        /// Provides access to the UnjoinDomainCredential parameter.
        /// </summary>
        [ParameterSpecificCategory]
        [DefaultValue(null)]
        public InArgument<System.Management.Automation.PSCredential> UnjoinDomainCredential { get; set; }

        /// <summary>
        /// Provides access to the LocalCredential parameter.
        /// </summary>
        [ParameterSpecificCategory]
        [DefaultValue(null)]
        public InArgument<System.Management.Automation.PSCredential> LocalCredential { get; set; }

        /// <summary>
        /// Provides access to the Restart parameter.
        /// </summary>
        [ParameterSpecificCategory]
        [DefaultValue(null)]
        public InArgument<System.Management.Automation.SwitchParameter> Restart { get; set; }

        /// <summary>
        /// Provides access to the Force parameter.
        /// </summary>
        [ParameterSpecificCategory]
        [DefaultValue(null)]
        public InArgument<System.Management.Automation.SwitchParameter> Force { get; set; }

        /// <summary>
        /// Provides access to the PassThru parameter.
        /// </summary>
        [ParameterSpecificCategory]
        [DefaultValue(null)]
        public InArgument<System.Management.Automation.SwitchParameter> PassThru { get; set; }

        /// <summary>
        /// Provides access to the WorkgroupName parameter.
        /// </summary>
        [ParameterSpecificCategory]
        [DefaultValue(null)]
        public InArgument<System.String> WorkgroupName { get; set; }

        /// <summary>
        /// Declares that this activity supports its own remoting.
        /// </summary>
        protected override bool SupportsCustomRemoting { get { return true; } }

        // Module defining this command

        // Optional custom code for this activity

        /// <summary>
        /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
        /// </summary>
        /// <param name="context">The NativeActivityContext for the currently running activity.</param>
        /// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
        /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
        protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context)
        {
            System.Management.Automation.PowerShell invoker = global::System.Management.Automation.PowerShell.Create();
            System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);

            // Initialize the arguments

            if(UnjoinDomainCredential.Expression != null)
            {
                targetCommand.AddParameter("UnjoinDomainCredential", UnjoinDomainCredential.Get(context));
            }

            if(LocalCredential.Expression != null)
            {
                targetCommand.AddParameter("LocalCredential", LocalCredential.Get(context));
            }

            if(Restart.Expression != null)
            {
                targetCommand.AddParameter("Restart", Restart.Get(context));
            }

            if(Force.Expression != null)
            {
                targetCommand.AddParameter("Force", Force.Get(context));
            }

            if(PassThru.Expression != null)
            {
                targetCommand.AddParameter("PassThru", PassThru.Get(context));
            }

            if(WorkgroupName.Expression != null)
            {
                targetCommand.AddParameter("WorkgroupName", WorkgroupName.Get(context));
            }

            if(GetIsComputerNameSpecified(context) && (PSRemotingBehavior.Get(context) == RemotingBehavior.Custom))
            {
                targetCommand.AddParameter("ComputerName", PSComputerName.Get(context));
            }

            return new ActivityImplementationContext() { PowerShellInstance = invoker };
        }
    }
}


text:
#ifndef _LOW_POWER_MODE_H_
#define _LOW_POWER_MODE_H_

void power_wfi(void);
void power_system_off(void);
void sd_system_off(void);

#endif


text:
/*
*
* Secondary Links
*
*/

/*	Structure
-------------------------------------------------------------- */

#navigation-secondary{
	float: left;
	width: 100%;
	height:40px;
	line-height:40px;
}

#navigation-secondary ul{
	margin:0px 0px 0px 5px;
	padding:0px;
	list-style:none;
}

#navigation-secondary li{
	float:left;
	margin-left: 5px;
	padding:0px;
}

#navigation-secondary li:after{
	content:"|";
}

#navigation-secondary a{ /* make it block-level to fill the entire space */
	padding-right:5px;
}

#navigation-secondary span{
	padding:5px;
}

/*	Look & Feel
-------------------------------------------------------------- */

#navigation-secondary{
	font-size: 1em;
	background:#054b81;
	color:#417297;
}

#navigation-secondary a{
	color: #eee;
}

#navigation-secondary li a:hover{
	text-decoration: none;
	color: white;
}

#navigation-secondary li a.active{
	font-weight: bold;
}

#navigation-secondary li a.active:before{
	content:"↓";
}


text:
@class BlazeRow;
@class BlazeTableHeaderFooterView;

@interface BlazeSection : NSObject
{

}

//Abstract constructors
+(instancetype)sectionWithHeaderTitle:(NSString *)headerTitle;
+(instancetype)sectionWithHeaderXibName:(NSString *)headerXibName;
+(instancetype)sectionWithHeaderXibName:(NSString *)headerXibName headerTitle:(NSString *)headerTitle;

//Constructors
-(void)addRow:(id)row;
-(id)initWithHeaderTitle:(NSString *)headerTitle;
-(id)initWithRowsXibName:(NSString *)rowsXibName;
-(id)initWithHeaderXibName:(NSString *)headerXibName;
-(id)initWithHeaderXibName:(NSString *)headerXibName headerTitle:(NSString *)headerTitle;
-(id)initWithFooterXibName:(NSString *)footerXibName footerTitle:(NSString *)footerTitle;
-(id)initWithID:(int)ID title:(NSString *)title backgroundColor:(UIColor *)backgroundColor;

//Collapsing
@property(nonatomic) bool collapsed;
@property(nonatomic) bool canCollapse;
@property(nonatomic,copy) void (^collapseTapped)(void);
@property(nonatomic) UITableViewRowAnimation collapseAnimation;

//Basic properties
@property(nonatomic) int ID;
@property(nonatomic,strong) NSMutableArray <BlazeRow *> *rows;
@property(nonatomic,strong) NSString *rowsXibName;
@property(nonatomic,strong) NSNumber *headerHeight;
@property(nonatomic,strong) NSNumber *footerHeight;

//Colors
@property(nonatomic,strong) UIColor *viewColor;
@property(nonatomic,strong) UIColor *backgroundColor;

//Header & Footer
@property(nonatomic,strong) NSString *buttonTitle;
@property(nonatomic,strong) NSString *headerTitle;
@property(nonatomic,strong) NSString *headerSubtitle;
@property(nonatomic,strong) NSString *footerTitle;
@property(nonatomic,strong) NSString *footerSubtitle;
@property(nonatomic,strong) NSString *headerXibName;
@property(nonatomic,strong) NSString *footerXibName;

//Custom object
@property(nonatomic,strong) id object;

//Completion blocks
@property(nonatomic,copy) void (^buttonTapped)(void);
@property(nonatomic,copy) void (^configureHeaderView)(BlazeTableHeaderFooterView *headerFooterView);
@property(nonatomic,copy) void (^configureFooterView)(BlazeTableHeaderFooterView *headerFooterView);

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <integer name="block_canary_max_stored_count">500</integer>
</resources>


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	errorHandler = require('./errors'),
	Project = mongoose.model('Project'),
	User = mongoose.model('User'),
	Talent = mongoose.model('Talent'),
	Typecast = mongoose.model('Typecast'),
	Log = mongoose.model('Log'),
	Newproject = mongoose.model('Newproject'),
	fs = require('fs'),
	config = require('../../config/config'),
	_ = require('lodash'),
	path = require('path'),
	async = require('async'),
	mv = require('mv'),
	nodemailer = require('nodemailer'),
	sgTransport = require('nodemailer-sendgrid-transport'),
	archiver = require('archiver'),
	dateFormat = require('dateformat'),
	// set date and timezone
	moment = require('moment-timezone'),
	now = new Date();

/* custom tools methods */
exports.sendTalentEmails = function(req, res){
	var email = req.body.email;
	var emailClients = req.body.emailClients;

	// email all talents if email all is set to true
	if(email.all === true){

		Talent.find().sort({'locationISDN': 1,'lastName': 1,'-created': -1}).populate('user', 'displayName').exec(function(err, talents) {
			if (err) {
				return res.status(400).send({
					message: errorHandler.getErrorMessage(err)
				});
			} else {

				async.waterfall([
					function(done) {

						// generate email signature
						var emailSig = '';
						if(req.user.emailSignature){
							emailSig = req.user.emailSignature.replace(/\r?\n/g, '
');
						} else {
							emailSig = '';
						}

						res.render('templates/custom-talent-email', {
							email: email,
							emailSignature: emailSig
						}, function(err, talentEmailHTML) {
							done(err, talentEmailHTML);
						});

					},
					function(talentEmailHTML, done) {
						// walk through all available telent and send emails
						async.eachSeries(talents, function (talent, callback) {

							var curTalent = talent;

							// check for talent preferred contact
							var idx = curTalent.type.indexOf('Email');
							if (idx > -1){

								// add both email addresses if talent has backup
								var talentEmails = [];
								talentEmails[0] = curTalent.email;
								if(typeof curTalent.email2 !== 'undefined' && curTalent.email2.length > 0){
									talentEmails[1] = curTalent.email2;
								}

								// send email
								var transporter = nodemailer.createTransport(sgTransport(config.mailer.options));

								var mailOptions = {
													to: talentEmails,
													from: req.user.email || config.mailer.from,
													replyTo: req.user.email || config.mailer.from,
													cc: config.mailer.notifications,
													subject: email.subject,
													html: talentEmailHTML
												};

								transporter.sendMail(mailOptions, function(){

									// write change to log
									var log = {
										type: 'talent',
										sharedKey: String(talent._id),
										description: talent.name + ' ' + talent.lastName + ' sent custom email ',
										user: req.user
									};
									log = new Log(log);
									log.save();

									callback(err);
								});

							}

						}, function (err) {
							done(err);
				       	});
				}
				], function(err) {
					if(err){
						return res.status(400).send({
							message: errorHandler.getErrorMessage(err)
						});
					} else {
						return res.status(200).send();
					}
				});
			}
		});

	// email only selected clients
	} else {

		Talent.where('_id').in(emailClients).sort({'locationISDN': 1,'lastName': 1,'-created': -1}).populate('user', 'displayName').exec(function(err, talents) {
			if (err) {
				return res.status(400).send({
					message: errorHandler.getErrorMessage(err)
				});
			} else {

				async.waterfall([
					function(done) {

						// generate email signature
						var emailSig = '';
						if(req.user.emailSignature){
							emailSig = req.user.emailSignature.replace(/\r?\n/g, '
');
						} else {
							emailSig = '';
						}

						res.render('templates/custom-talent-email', {
							email: email,
							emailSignature: emailSig
						}, function(err, talentEmailHTML) {
							done(err, talentEmailHTML);
						});

					},
					function(talentEmailHTML, done) {
						// walk through all available telent and send emails
						async.eachSeries(talents, function (talent, callback) {

								var curTalent = talent;

								// check for talent preferred contact
								if(curTalent.type.toLowerCase() === 'email'){

									// add both email addresses if talent has backup
									var talentEmails = [];
									talentEmails[0] = curTalent.email;
									if(typeof curTalent.email2 !== 'undefined' && curTalent.email2.length > 0){
										talentEmails[1] = curTalent.email2;
									}

									// send email
									var transporter = nodemailer.createTransport(sgTransport(config.mailer.options));

									var mailOptions = {
														to: talentEmails,
														from: req.user.email || config.mailer.from,
														replyTo: req.user.email || config.mailer.from,
														cc: config.mailer.notifications,
														subject: email.subject,
														html: talentEmailHTML
													};

									transporter.sendMail(mailOptions, function(){
										callback(err);
									});

								}

						}, function (err) {
							done(err);
				       	});
				}
				], function(err) {
					if(err){
						return res.status(400).send({
							message: errorHandler.getErrorMessage(err)
						});
					} else {
						return res.status(200).send();
					}
				});
			}
		});
	}

};

// call list methods
var gatherTalentsSearch = function(req, res, filter){

	var callTalents = [], talentId;
	var searchCriteria = {'talent': {
									$elemMatch: {
										'status': filter
									}
								},
						'status': { $nin: ['Closed - Pending Client Decision','Canceled','Dead','Complete','Booked','ReAuditioned']}
						};

	Project.find(searchCriteria).sort('-estimatedCompletionDate').populate('project', 'displayName').exec(function(err, projects) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {

			// walk through found projects
			async.eachSeries(projects, function (project, callback) {
				// walk through found talents
				if(typeof project.talent !== 'undefined'){

					// walk through project found talent
					async.eachSeries(project.talent, function (talent, talentCallback) {

						if(typeof talent !== 'undefined'){

							async.waterfall([
								// gather info for selected talent
								function(done) {
									Talent.findOne({'_id':talent.talentId}).sort('-created').exec(function(err, talentInfo) {
										done(err, talentInfo);
									});
								},
								function(talentInfo, done){
									if(talent.status === filter){
										callTalents.push(talent);
										talentId = callTalents.length - 1;
										callTalents[talentId].data = talentInfo;
										callTalents[talentId].project = {};
										callTalents[talentId].project._id = project._id;
										callTalents[talentId].project.title = project.title;
										callTalents[talentId].project.estimatedCompletionDate = project.estimatedCompletionDate;
										callTalents[talentId].project.scripts = project.scripts;
										callTalents[talentId].project.note = '';
										if(talentInfo !== null){
											for(var i = 0; i < project.talent.length; ++i){
												if(project.talent[i].talentId === String(talentInfo._id)){
													callTalents[talentId].project.note = project.talent[i].note;
												}
											}
										}
									}
									done('');
								}
								], function(err) {
								if (err) {
									return res.status(400).json(err);
								} else {
									talentCallback();
								}
							});

						}

					}, function (err) {
						if( err ) {
							return res.status(400).send({
								message: errorHandler.getErrorMessage(err)
							});
						} else {
			            	callback();
						}
		           	});

				} else {

					callback();

				}

			}, function (err) {
				if( err ) {
					return res.status(400).send({
						message: errorHandler.getErrorMessage(err)
					});
				} else {
					var socketio = req.app.get('socketio'); // tacke out socket instance from the app container
					socketio.sockets.emit('callListUpdate', {talents: callTalents, filter: filter}); // emit an event for all connected clients

					res.jsonp(callTalents);
				}
           	});

		}
	});
};
exports.gatherTalentsToCall = function(req, res){

	gatherTalentsSearch(req, res, 'Cast');

};
exports.gatherTalentsMessagesLeft = function(req, res){

	gatherTalentsSearch(req, res, 'Message left');

};
exports.gatherTalentsAlreadyScheduled = function(req, res){

	gatherTalentsSearch(req, res, 'Scheduled');

};
exports.gatherEmailedTalent = function(req, res){
	gatherTalentsSearch(req, res, 'Emailed');
};

// gather and send list of pre close summary emails
exports.sendPreCloseSummary = function(req, res){

	// method vars
	var emailCnt = 0;

	var currentTime = new Date();
	//currentTime.setDate(currentTime.getHours() - 1);
	var inOneHour = new Date();
	// modified 12/17/2015 for two hour intervals
	inOneHour.setHours(inOneHour.getHours() + 2);

	var searchCriteria = {
							'estimatedCompletionDate':
													{
														$gte: currentTime,
														$lte: inOneHour
													},
							'preClose': false
						};

	// gather projects ending in the next hour
	Project.find(searchCriteria).sort('-estimatedCompletionDate').populate('project', 'displayName').exec(function(err, projects) {

		// walk through all associated projects
		async.eachSeries(projects, function (project, callback) {

			// gather associated emails per project
			async.waterfall([
				// gather owner data
				function(done) {
					var ownerId;
					if(!project.owner){
						ownerId = project.user;
					} else{
						ownerId = project.owner;
					}

					User.findOne({'_id':ownerId}).sort('-created').exec(function(err, owner) {
						done(err, owner);
					});
				},
				// gather all producers and the talent directors
				function(owner, done){

					var searchGroups = [
										'admin',
										'producer/auditions director',
										'production coordinator',
										'talent director'
										];

					User.where('roles').in(searchGroups).sort('-created').exec(function(err, producers) {
						done(err, owner, producers);
					});
				},
				// gather producers emails
				function(owner, producers, done){

					var producersEmails = [];

					async.eachSeries(producers, function (producer, producerCallback) {

						producersEmails.push(producer.email);

						producerCallback();

					}, function (err) {
						if( err ) {
							return res.status(400).send({
								message: errorHandler.getErrorMessage(err)
							});
						} else {
							done(err, owner, producersEmails);
						}
			       	});
				},
				// gather talent info
				function(owner, producers, done){

					// walk through all current talents assigned to project then query talent data
					var talentIds = [];
					for(var i = 0; i < project.talent.length; ++i){
						talentIds[i] = project.talent[i].talentId;
					}

					Talent.where('_id').in(talentIds).sort('-created').exec(function(err, talents) {
						done(err, talents, owner, producers);
					});

				},
				// filter selected talents
				function(talents, owner, producers, done){
					var shortTblHeader = '

First Name	Last Name
';
					var longTblHeader = '

Name	Parent Name	Phone #	Alt Phone #	Location	Email
';
					var talentPosted = '
Talent Posted:
' + shortTblHeader,
						talentNotCalled = '
Talent Not Called:
' + longTblHeader,
						talentNotPosted = '
Talent Not Posted:
' + shortTblHeader,
						talentOut = '
Talent Out:
' + shortTblHeader;

					async.eachSeries(talents, function (talent, talentCallback) {

						for(var j = 0; j < project.talent.length; ++j){
							if(project.talent[j].talentId === String(talent._id)){

								// sort current talent into correct list
								switch(project.talent[j].status){
									case 'Posted':
										talentPosted += '
' +
														talent.name +
														'	' +
														talent.lastName +
														'
';
									break;
									case 'Cast':
										talentNotCalled += '
' +
														talent.name + ' ' + talent.lastName +
														'	' +
														(talent.parentName || '') +
														'	' +
														talent.phone +
														'	' +
														talent.phone2 +
														'	' +
														talent.locationISDN +
														'	' +
														talent.email +
														'
';
									break;
									case 'Cast':
									case 'Emailed':
									case 'Scheduled':
									case 'Message left':
									case 'Received needs to be posted':
										talentNotPosted += '
' +
														talent.name +
														'	' +
														talent.lastName +
														'
';
									break;
									case 'Out':
										talentOut += '
' +
														talent.name +
														'	' +
														talent.lastName +
														'
';
									break;
								}

								talentCallback();
							}
						}

					}, function (err) {
						if( err ) {
							return res.status(400).send({
								message: errorHandler.getErrorMessage(err)
							});
						} else {
							// close all tables
							talentPosted += '
';
							talentNotCalled += '
';
							talentNotPosted += '
';
							talentOut += '
';

							done(err, talentPosted, talentNotCalled, talentNotPosted, talentOut, owner, producers);
						}
			       	});
				},
				function(talentPosted, talentNotCalled, talentNotPosted, talentOut, owner, producers, done){

					// generate email signature
					var newDate = new Date(project.estimatedCompletionDate);
					newDate = newDate.setHours(newDate.getHours() - 1);
					newDate = dateFormat(newDate, 'dddd, mmmm dS, yyyy, h:MM TT');

					var emailSig = '';
					if(owner.emailSignature){
						emailSig = owner.emailSignature;
					} else {
						emailSig = '';
					}

					// convert project id from object to string for email
					project.id = String(project._id);

					res.render('templates/projects/pre-close-summary-email', {
						talentPosted: talentPosted,
						talentNotCalled: talentNotCalled,
						talentNotPosted: talentNotPosted,
						talentOut: talentOut,
						project: project,
						dueDate: newDate,
						emailSignature: emailSig,
					}, function(err, summaryEmailHTML) {
						done(err, owner, producers, summaryEmailHTML);
					});

				},
				// send out talent project creation email
				function(owner, producers, summaryEmailHTML, done) {
					var log;
					// send email
					// generate email signature
					var newDate = new Date(project.estimatedCompletionDate);
					newDate = newDate.setHours(newDate.getHours());
					newDate = dateFormat(newDate, 'dddd, mmmm dS, yyyy, h:MM TT');

					var transporter = nodemailer.createTransport(sgTransport(config.mailer.options));

					var emailSubject = project.title + ' - Pre-Close Summary (Due in 2 hrs)' + ' - Due ' + newDate + ' EST';

					var mailOptions = {
						to: owner.email,
						cc: [producers, config.mailer.notifications],
						from: owner.email || config.mailer.from,
						replyTo: owner.email || config.mailer.from,
						subject: emailSubject,
						html: summaryEmailHTML
					};

					transporter.sendMail(mailOptions, function(err){

						// log event
						log = {
							type: 'system',
							sharedKey: 'N/A',
							description: ' project ' + project.title + ' preclose summary sent',
							user: owner
						};
						log = new Log(log);
						log.save();

						// log event
						log = {
							type: 'project',
							sharedKey: String(project._id),
							description: ' project ' + project.title + ' preclose summary sent',
							user: owner
						};
						log = new Log(log);
						log.save();

						++emailCnt;
						done(err);
					});
				},
				// update project to prevent resending of email
				function(done){

					Project.findById(project._id).populate('user', 'displayName').exec(function(err, project) {
						req.project = project ;

						// update preclose status
						project.preClose = true;

						project = _.extend(req.project, project);

						project.save(function(err) {

							// update connected clients
							var socketio = req.app.get('socketio');
							socketio.sockets.emit('projectUpdate', {id: project._id});
							socketio.sockets.emit('callListUpdate', {filter: ''});

							done(err);
						});
					});
				}
				], function(err) {
				if (err) {
					return res.status(400).json(err);
				} else {
					callback();
				}
			});

		}, function (err) {
			if( err ) {
				return res.status(400).send({
					message: errorHandler.getErrorMessage(err)
				});
			} else {
				res.jsonp({status: 'success', sendCount: emailCnt});
			}
       	});

	});

};

// upload new talents
exports.uploadTalentCSV = function(req, res){

	// import counts
	var newTalents = 0;
	var updatedTalents = 0;
	var failedImports = [];

	// parse uploaded CSV
	var file = req.files.file;
	var tempPath = file.path;

	var Converter = require('csvtojson').Converter;
	var fileStream = fs.createReadStream(tempPath);

	var converter = new Converter({constructResult:true});
	//end_parsed will be emitted once parsing finished
	converter.on('end_parsed', function (jsonObj) {

	   async.eachSeries(jsonObj, function (talent, talentCallback) {

	   		var unionStatus = (talent.US === '' ? '' : (talent.US === 'U' ? ['union'] : ['union','non-union']));

	   		// cerate new talent
	   		var talentData = {
				name: talent['first name'],
				lastName: talent['last name'],
				email: talent.email,
				email2: talent['email alt'],
				phone: talent.phone,
				phone2: talent['phone alt'],
				type: talent.type,
				gender: talent.gender,
				ageRange: talent.ageRange,
				unionStatus: unionStatus,
				lastNameCode: talent.lastNameCode,
				locationISDN: talent.locationISDN
			};
	   		var newTalent = new Talent(talentData);

			talent.user = req.user;

			// check for missing import data
			var failed = 0;
			var failedReason = {
				name: 0,
				lastName: 0,
				type: 0,
				gender: 0,
				ageRange: 0,
				unionStatus: 0,
				lastNameCode: 0,
				locationISDN: 0
			};
			if(newTalent.name === ''){
				++failed;
				failedReason.name = 1;
			}
			if(newTalent.lastName === ''){
				++failed;
				failedReason.lastName = 1;
			}
			if(newTalent.type === ''){
				++failed;
				failedReason.type = 1;
			}
			if(newTalent.gender === ''){
				++failed;
				failedReason.gender = 1;
			}
			if(newTalent.ageRange === ''){
				++failed;
				failedReason.ageRange = 1;
			}
			if(newTalent.unionStatus === ''){
				++failed;
				failedReason.unionStatus = 1;
			}
			if(newTalent.lastNameCode === ''){
				++failed;
				failedReason.lastNameCode = 1;
			}
			if(newTalent.locationISDN === ''){
				++failed;
				failedReason.locationISDN = 1;
			}

			// check for existing talent before saving new one
			if(failed === 0){
				Talent.findOne({'name': newTalent.name, lastName: newTalent.lastName}).populate('user', 'displayName').exec(function(err, talent) {

					if(talent !== null){
						++updatedTalents;
						newTalent = newTalent.toObject();
						talent = _.extend(talent, newTalent);
					} else {
						++newTalents;
						talent = newTalent;
					}

					talent.save(function(err) {

			   			talentCallback();

			   		});

				});

			} else {
				failedImports.push({name: newTalent.name + ' ' + newTalent.lastName, reason: failedReason});
				talentCallback();
			}

	   	}, function (err) {
			if( err ) {
				return res.status(400).send({
					message: errorHandler.getErrorMessage(err)
				});
			} else {
				res.jsonp({status: 'success', updatedTalents: updatedTalents, newTalents: newTalents, failed: failedImports});
			}
	   	});
	});

	//read from file
	fileStream.pipe(converter);

};

// gather spreadsheet from Google
exports.processGoogleSheet = function(req, res){

	// add code lateer

};

// list stored new projects
exports.listNewprojects = function(req, res) {
	Newproject.find().sort('-created').exec(function(err, newprojects) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(newprojects);
		}
	});
};
exports.newprojectByID = function(req, res, next) {
	Newproject.findById(req.body.id).exec(function(err, newproject) {
		if (err) return next(err);
		if (! newproject) return next(new Error('Failed to load Newproject ' + req.body.id));
		res.jsonp(newproject);
	});
};

/**
 * Tool authorization middleware
 */
exports.hasAuthorization = function(req, res, next) {
	if (req.tool.user.id !== req.user.id) {
		return res.status(403).send('User is not authorized');
	}
	next();
};


text:
<?php

namespace amilna\nivoslider;

use Yii;
use yii\helpers\Html;
use yii\base\Widget;
use yii\helpers\Json;

/**
 * Widget renders a Nivo Slider widget.
 *
 * For example:
 *
 * use amilna\nivoslider\NivoSlider;
 *
 * echo NivoSlider::widget([
 * 		'dataProvider'=>$dataProvider, // active data provider or just array of image,url, title and description, exp: [["image"=>"test1.jpg","url"=>null],["image"=>"test2.jpg","url"=>null]]
 * 		'targetId'=>'nivoslider',	//id of rendered nivoslider (the container will constructed by the widget with the given id)
 * 		'imageKey'=>'image', //model attribute to be used as background
 * 		'theme' => 'default', //available themes: default, bar, dark, light
 *  	'css' => '', // url of css to overide default css relative from @web
 *
 *
 * 		//	example to overide default options	more options on http://docs.dev7studios.com/jquery-plugins/nivo-slider
 * 		'options'=>[
 * 				'effect'=> 'boxRandom',
 * 				'manualAdvance'=>false,
 * 				'controlNav'=> false
 * 			],
 *
 * 	]);
 *
 * @author Amilna
 * @see https://github.com/gilbitron/Nivo-Slider
 * @package amilna\nivoslider
 */
class NivoSlider extends Widget
{

    public $dataProvider = null;
    public $itemView = null;
    public $itemPager = null;
    public $titleKey = 'title';
    public $imageKey = 'image';
    public $descriptionKey = 'description';
    public $urlKey = 'url';

    public $options = [
					'effect'=> 'random',
					'manualAdvance'=>false,
					'controlNav'=> false
				];

	public $targetId = 'sliderNivo';
    public $showText = false;
    public $theme = 'default'; // available options 'dark','light', 'bar'
    public $css = null;

    private $bundle = null;
    private $data = [];

    public function init()
    {
        parent::init();
        $view = $this->getView();

		$bundle = NivoSliderAsset::register($view);
		$this->bundle = $bundle;
		$view->registerCssFile("{$bundle->baseUrl}/nivo-slider/nivo-slider.css");
        if ($this->theme !== false && $this->css == null) {
			$view->registerCssFile("{$bundle->baseUrl}/nivo-slider/themes/{$this->theme}/{$this->theme}.css");
        }
        else
        {
			$view->registerCssFile("@web/{$this->css}");
		}

		if (!empty($this->dataProvider))
		{
			if (count($this->dataProvider->getModels()) > 0)
			{
				$titleKey = $this->titleKey;
				$imageKey = $this->imageKey;
				$descriptionKey = $this->descriptionKey;
				$urlKey = $this->urlKey;
				foreach ($this->dataProvider->getModels() as $key=>$model)
				{
					$this->data[] = [
						"image"=>$model->$imageKey,
						"url"=>$model->$urlKey,
						"title"=>$model->$titleKey,
						"description"=>$model->image_only?'':$model->$descriptionKey,
					];
				}
			}
			else
			{
				$this->data = $this->dataProvider;
			}
		}

		if (!empty($this->data))
		{

		echo '

theme.'">

targetId.'" class="nivoSlider">';

				$banner_count	= 1;
				foreach ($this->data as $b=>$banner)
				{

					$dtrans = ['fade','slideInLeft'];
					$dc = count($dtrans);
					$d = $b%$dc;

					//$html =  Html::img($banner['image'],['data-transition'=>$dtrans[$d],'data-thumb'=>$banner['image'],'alt'=>$banner['title'],'title'=>$banner['description']]);
					$html =  Html::img($banner['image'],['data-thumb'=>$banner['image'],'alt'=>$banner['title'],'title'=>$banner['description']]);

					$islink =false;
					if(isset($banner['url']))
					{
						if(!empty($banner['url']))
						{
							$islink = true;
						}
					}

					if($islink)
					{
						echo Html::a($html,$banner['url'],['target'=>'_blank']);
					}
					else
					{
						echo $html;
					}

					$banner_count++;
				}

		echo '

 ';

		}

        if (!empty($this->targetId)) {
            $script = '';
            $divid = $this->targetId;

			$options = Json::encode($this->options);
			$script .= "
			 $(function() {
				$('#".$divid."').nivoSlider($options);
			});
			" . PHP_EOL;

            $view->registerJs($script);
        }

    }
}


text:
/**
 * Module dependencies.
 */

var Base = require('./base');
var errorStackParser = require('error-stack-parser');

/**
 * Expose `List`.
 */

exports = module.exports = List;

function getFormattedError(test, err, full) {
  test = clean(test);
  test.err = err;
  if (err instanceof Error) {
    test.err = {
      actual: err.actual,
      expected: err.expected,
      message: err.message,
    };
    Object.keys(err).forEach(function (key) {
      if (full) {
        test.err[key] = err[key];
      }
    });
    test.err.stack = errorStackParser.parse(err)
    if (err.at) {
      test.err.at = err.at.filename + ':' + err.at.line + ':' + err.at.column;
    }
  }
  return test;
}

/**
 * Initialize a new `List` test reporter.
 *
 * @api public
 * @param {Runner} runner
 */
function List(runner) {
  Base.call(this, runner);

  var self = this;
  var total = runner.total;

  runner.on('start', function() {
    console.log(JSON.stringify(['start', { total: total }]));
  });

  runner.on('pass', function(test) {
    console.log(JSON.stringify(['pass', clean(test)]));
  });

  runner.on('fail', function(test, err) {
    var errF = getFormattedError(test, err, true);
    try {
      console.log(JSON.stringify(['fail', errF]));
    } catch (e) {
      errF = getFormattedError(test, err, false);
      console.log( Object.keys(errF));
      console.log(JSON.stringify(['fail', errF]));
    }
  });

  runner.on('end', function() {
    console.log(JSON.stringify(['end', self.stats]));
  });
}

/**
 * Return a plain-object representation of `test`
 * free of cyclic properties etc.
 *
 * @api private
 * @param {Object} test
 * @return {Object}
 */
function clean(test) {
  return {
    title: test.title,
    fullTitle: test.fullTitle(),
    duration: test.duration,
    sync: test.sync,
    async: test.async,
    timedOut: test.timedOut,
    pending: test.pending,
    file: test.file,
    parentTitle: test.parent.title,
    state: test.state,
    speed: test.speed
  };
}


text:
<?php

class Nascente_model extends CI_Model
{
  public $nome_nascente;
  public $descricao_nascente;
  public $criador_nascente;
  public $longitude;
  public $latitude;
  public $foto;

  function __construct()
  {
    parent::__construct();
  }

  function salvar()
  {
    return $this->db->insert('cidade_nascente', $this);
  }

  function getLocais()
  {
    $this->db->select('*')
    ->from('cidade_nascente');
    return $this->db->get()->result();
  }

  function listarNascentes(){
    //vai listar apenas as nascentes que o usuário cadastrou
    $this->db->select('*')
    ->from('cidade_nascente')
    ->where('criador_nascente', $id_usuario = $this->session->userdata('id_usuario'));
    return $this->db->get()->result();
  }

  function listarTodasNascentes(){
    //vai listar apenas as nascentes que o usuário cadastrou
    $this->db->select('*')
    ->from('cidade_nascente');
    return $this->db->get()->result();
  }

  function nascenteSozinha($id_nascente)
  {
    $this->db->select('*')
    ->from('cidade_nascente')
    ->where('cd_local', $id_nascente);
    return $this->db->get()->result();
  }

  function alterar($data, $id_nascente) {
    $id_usuario = $this->session->userdata('id_usuario');
    $this->db->where('cd_local', $id_nascente);
    $this->db->set($data);
    return $this->db->update('cidade_nascente');
  }

  function getLocalSozinho($id_nascente){
    $this->db->select('*')
    ->from('cidade_nascente')
    ->where('cd_local', $id_nascente);
    return $this->db->get()->row();
  }
}


text:
package org.goldenorb.algorithms.singleSourceShortestPath;

import java.util.ArrayList;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.goldenorb.Edge;
import org.goldenorb.io.input.VertexBuilder;

public class SingleSourceShortestPathReader extends
    VertexBuilder<SingleSourceShortestPathVertex,LongWritable,Text> {

  @Override
  public SingleSourceShortestPathVertex buildVertex(LongWritable key, Text value) {
    String[] values = value.toString().split("\t");
    ArrayList<Edge<IntWritable>> edgeCollection = new ArrayList<Edge<IntWritable>>();
    for (int i = 1; i < values.length; i++) {
      String[] split = values[i].split(":");
      Edge<IntWritable> edge = new Edge<IntWritable>(Integer.toString(Integer.parseInt(split[0].trim())),
          new IntWritable(Integer.parseInt(split[1])));
      edgeCollection.add(edge);
    }

    PathWritable emptyPathWritable = new PathWritable();

    SingleSourceShortestPathVertex vertex = new SingleSourceShortestPathVertex(Integer.toString(Integer
        .parseInt(values[0].trim())), emptyPathWritable, edgeCollection);

    return vertex;
  }

}


text:
@interface GYSubTagViewController : UITableViewController

@end


text:
module BubbleWrap
  module MIDI
    module Ext
      # Returns the driver version API of the owning driver (only for
      # driver-owned devices). Drivers need not set this property;
      # applications should not write to it.
      #
      # New for CoreMIDI 1.3.
      # Available in iOS 4.2 and later.
      module DriverVersion

        def driver_version
          version_p = Pointer.new(:string)
          MIDI.status{MIDIObjectGetIntegerProperty(midi_id, KMIDIPropertyDriverVersion, version_p)}
          version_p[0]
        end

      end
    end
  end
end