text:
namespace content {

#if BUILDFLAG(IS_ANDROID) && defined(ADDRESS_SANITIZER)
// Renderer crashes under Android ASAN: https://crbug.com/408496.
#define MAYBE_WebRtcBrowserTest DISABLED_WebRtcBrowserTest
#else
#define MAYBE_WebRtcBrowserTest WebRtcBrowserTest
#endif

// This class tests the scenario when permission to access mic or camera is
// granted.
class MAYBE_WebRtcBrowserTest : public WebRtcContentBrowserTestBase {
 public:
  MAYBE_WebRtcBrowserTest() {}
  ~MAYBE_WebRtcBrowserTest() override {}

  void SetUpCommandLine(base::CommandLine* command_line) override {
    WebRtcContentBrowserTestBase::SetUpCommandLine(command_line);
    // Automatically grant device permission.
    AppendUseFakeUIForMediaStreamFlag();
  }

 protected:
  // Convenience function since most peerconnection-call.html tests just load
  // the page, kick off some javascript and wait for the title to change to OK.
  void MakeTypicalPeerConnectionCall(const std::string& javascript) {
    MakeTypicalCall(javascript, "/media/peerconnection-call.html");
  }

  void SetConfigurationTest(const std::string& javascript) {
    // This doesn't actually "make a call", it just loads the page, executes
    // the javascript and waits for "OK".
    MakeTypicalCall(javascript, "/media/peerconnection-setConfiguration.html");
  }
};

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CanSetupAudioAndVideoCall) {
  MakeTypicalPeerConnectionCall("call({video: true, audio: true});");
}

// Flaky on Android and Linux ASAN https://crbug.com/1099365.
#if BUILDFLAG(IS_ANDROID) || (BUILDFLAG(IS_LINUX) && defined(ADDRESS_SANITIZER))
#define MAYBE_NetworkProcessCrashRecovery DISABLED_NetworkProcessCrashRecovery
#else
#define MAYBE_NetworkProcessCrashRecovery NetworkProcessCrashRecovery
#endif

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       MAYBE_NetworkProcessCrashRecovery) {
  if (!IsOutOfProcessNetworkService())
    return;
  MakeTypicalPeerConnectionCall("call({video: true, audio: true});");
  SimulateNetworkServiceCrash();
  MakeTypicalPeerConnectionCall("call({video: true, audio: true});");
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       CanSetupDefaultVideoCallWithOldGetUserMedia) {
  MakeTypicalPeerConnectionCall("oldStyleCall();");
}

// These tests will make a complete PeerConnection-based call and verify that
// video is playing for the call.
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CanSetupDefaultVideoCall) {
  MakeTypicalPeerConnectionCall(
      "callAndExpectResolution({video: true}, 640, 480);");
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       CanSetupVideoCallWith1To1AspectRatio) {
  const std::string javascript =
      "callAndExpectResolution({video: {mandatory: {minWidth: 320,"
      " maxWidth: 320, minHeight: 320, maxHeight: 320}}}, 320, 320);";
  MakeTypicalPeerConnectionCall(javascript);
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       CanSetupVideoCallWith16To9AspectRatio) {
#if BUILDFLAG(IS_ANDROID)
  // Android requires 16x16 alignment for hardware encoding.
  constexpr int kExpectedAlignment = 16;
#else
  constexpr int kExpectedAlignment = 1;
#endif
  const std::string javascript = base::StringPrintf(
      "callAndExpectResolution({video: {mandatory: {minWidth: 640,"
      " maxWidth: 640, minAspectRatio: 1.777}}}, 640, 360, %d);",
      kExpectedAlignment);
  MakeTypicalPeerConnectionCall(javascript);
}

#if BUILDFLAG(IS_MAC)
// TODO(https://crbug.com/1235254): This test is flakey on macOS.
#define MAYBE_CanSetupVideoCallWith4To3AspectRatio \
  DISABLED_CanSetupVideoCallWith4To3AspectRatio
#else
#define MAYBE_CanSetupVideoCallWith4To3AspectRatio \
  CanSetupVideoCallWith4To3AspectRatio
#endif
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       MAYBE_CanSetupVideoCallWith4To3AspectRatio) {
  const std::string javascript =
      "callAndExpectResolution({video: {mandatory: { minWidth: 320,"
      "maxWidth: 320, minAspectRatio: 1.333, maxAspectRatio: 1.333}}}, 320,"
      " 240);";
  MakeTypicalPeerConnectionCall(javascript);
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       CanSetupVideoCallAndDisableLocalVideo) {
  const std::string javascript =
      "callAndDisableLocalVideo({video: true});";
  MakeTypicalPeerConnectionCall(javascript);
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CanSetupCallAndSendDtmf) {
  MakeTypicalPeerConnectionCall("callAndSendDtmf(\'123,ABC\');");
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       CanMakeEmptyCallThenAddStreamsAndRenegotiate) {
  const char* kJavascript =
      "callEmptyThenAddOneStreamAndRenegotiate({video: true, audio: true});";
  MakeTypicalPeerConnectionCall(kJavascript);
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       CanMakeAudioCallAndThenRenegotiateToVideo) {
  const char* kJavascript =
      "callAndRenegotiateToVideo({audio: true}, {audio: true, video:true});";
  MakeTypicalPeerConnectionCall(kJavascript);
}

// This test makes a call between pc1 and pc2 where a video only stream is sent
// from pc1 to pc2. The stream sent from pc1 to pc2 is cloned from the stream
// received on pc2 to test that cloning of remote video and audio tracks works
// as intended and is sent back to pc1.
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CanForwardRemoteStream) {
#if defined (OS_ANDROID)
  // This test fails on Nexus 5 devices.
  // TODO(henrika): see http://crbug.com/362437 and http://crbug.com/359389
  // for details.
  base::CommandLine::ForCurrentProcess()->AppendSwitch(
      switches::kDisableWebRtcHWDecoding);
#endif
  MakeTypicalPeerConnectionCall(
      "callAndForwardRemoteStream({video: true, audio: true});");
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       NoCrashWhenConnectChromiumSinkToRemoteTrack) {
  MakeTypicalPeerConnectionCall("ConnectChromiumSinkToRemoteAudioTrack();");
}

// This test will make a complete PeerConnection-based call but remove the
// MSID and bundle attribute from the initial offer to verify that
// video is playing for the call even if the initiating client don't support
// MSID. http://tools.ietf.org/html/draft-alvestrand-rtcweb-msid-02
// Fails with TSAN. https://crbug.com/756568
#if defined(THREAD_SANITIZER)
#define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle \
  DISABLED_CanSetupAudioAndVideoCallWithoutMsidAndBundle
#else
#define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle \
  CanSetupAudioAndVideoCallWithoutMsidAndBundle
#endif
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle) {
  MakeTypicalPeerConnectionCall("callWithoutMsidAndBundle();");
}

// This test will modify the SDP offer to an unsupported codec, which should
// cause SetLocalDescription to fail.
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       NegotiateUnsupportedVideoCodec) {
  MakeTypicalPeerConnectionCall("negotiateUnsupportedVideoCodec();");
}

// This test will modify the SDP offer to use no encryption, which should
// cause SetLocalDescription to fail.
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, NegotiateNonCryptoCall) {
  MakeTypicalPeerConnectionCall("negotiateNonCryptoCall();");
}

// This test can negotiate an SDP offer that includes a b=AS:xx to control
// the bandwidth for audio and video
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, NegotiateOfferWithBLine) {
  MakeTypicalPeerConnectionCall("negotiateOfferWithBLine();");
}

// This test will make a PeerConnection-based call and send a new Video
// MediaStream that has been created based on a MediaStream created with
// getUserMedia.
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       CallWithNewVideoMediaStream) {
  MakeTypicalPeerConnectionCall("callWithNewVideoMediaStream();");
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, AddTwoMediaStreamsToOnePC) {
  MakeTypicalPeerConnectionCall("addTwoMediaStreamsToOneConnection();");
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CallAndVerifyVideoMutingWorks) {
  MakeTypicalPeerConnectionCall("callAndEnsureVideoTrackMutingWorks();");
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CreateOfferWithOfferOptions) {
  MakeTypicalPeerConnectionCall("testCreateOfferOptions();");
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CallInsideIframe) {
  MakeTypicalPeerConnectionCall("callInsideIframe({video: true, audio:true});");
}

// Tests that SetConfiguration succeeds and triggers an ICE restart on the next
// offer as described by JSEP.
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, SetConfiguration) {
  SetConfigurationTest("testSetConfiguration();");
}

// Tests the error conditions of SetConfiguration as described by webrtc-pc.
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, SetConfigurationErrors) {
  SetConfigurationTest("testSetConfigurationErrors();");
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, ApplyConstraints) {
  MakeTypicalPeerConnectionCall("testApplyConstraints();");
}

IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       GetSettingsReportsValuesForRemoteTracks) {
  MakeTypicalPeerConnectionCall(
      "testGetSettingsReportsValuesForRemoteTracks();");
}

// TODO(crbug.com/988432): This test is a temporary replacement for:
// external/wpt/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html
IN_PROC_BROWSER_TEST_F(
    MAYBE_WebRtcBrowserTest,
    EstablishVideoOnlyCallAndVerifyGetSynchronizationSourcesWorks) {
  MakeTypicalPeerConnectionCall(
      "testEstablishVideoOnlyCallAndVerifyGetSynchronizationSourcesWorks();");
}

#if BUILDFLAG(IS_ANDROID) && BUILDFLAG(USE_PROPRIETARY_CODECS)
// This test is to make sure HW H264 work normally on supported devices, since
// there is no SW H264 fallback available on Android.
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
                       CanSetupH264VideoCallOnSupportedDevice) {
  MakeTypicalPeerConnectionCall("CanSetupH264VideoCallOnSupportedDevice();");
}
#endif

}  // namespace content


text:
#include <aws/s3/model/GetObjectAttributesResult.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

#include <utility>

using namespace Aws::S3::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils;
using namespace Aws;

GetObjectAttributesResult::GetObjectAttributesResult() :
    m_deleteMarker(false),
    m_requestCharged(RequestCharged::NOT_SET),
    m_storageClass(StorageClass::NOT_SET),
    m_objectSize(0)
{
}

GetObjectAttributesResult::GetObjectAttributesResult(const Aws::AmazonWebServiceResult<XmlDocument>& result) :
    m_deleteMarker(false),
    m_requestCharged(RequestCharged::NOT_SET),
    m_storageClass(StorageClass::NOT_SET),
    m_objectSize(0)
{
  *this = result;
}

GetObjectAttributesResult& GetObjectAttributesResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
  const XmlDocument& xmlDocument = result.GetPayload();
  XmlNode resultNode = xmlDocument.GetRootElement();

  if(!resultNode.IsNull())
  {
    XmlNode eTagNode = resultNode.FirstChild("ETag");
    if(!eTagNode.IsNull())
    {
      m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText());
    }
    XmlNode checksumNode = resultNode.FirstChild("Checksum");
    if(!checksumNode.IsNull())
    {
      m_checksum = checksumNode;
    }
    XmlNode objectPartsNode = resultNode.FirstChild("ObjectParts");
    if(!objectPartsNode.IsNull())
    {
      m_objectParts = objectPartsNode;
    }
    XmlNode storageClassNode = resultNode.FirstChild("StorageClass");
    if(!storageClassNode.IsNull())
    {
      m_storageClass = StorageClassMapper::GetStorageClassForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str()).c_str());
    }
    XmlNode objectSizeNode = resultNode.FirstChild("ObjectSize");
    if(!objectSizeNode.IsNull())
    {
      m_objectSize = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(objectSizeNode.GetText()).c_str()).c_str());
    }
  }

  const auto& headers = result.GetHeaderValueCollection();
  const auto& deleteMarkerIter = headers.find("x-amz-delete-marker");
  if(deleteMarkerIter != headers.end())
  {
     m_deleteMarker = StringUtils::ConvertToBool(deleteMarkerIter->second.c_str());
  }

  const auto& lastModifiedIter = headers.find("last-modified");
  if(lastModifiedIter != headers.end())
  {
    m_lastModified = DateTime(lastModifiedIter->second, DateFormat::RFC822);
  }

  const auto& versionIdIter = headers.find("x-amz-version-id");
  if(versionIdIter != headers.end())
  {
    m_versionId = versionIdIter->second;
  }

  const auto& requestChargedIter = headers.find("x-amz-request-charged");
  if(requestChargedIter != headers.end())
  {
    m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second);
  }

  return *this;
}

redpajama_set_name: RedPajamaGithub


text:
var filterNode = require('./node');
var get = require('./_get')(true);

module.exports = function(selector, node) {
    return filterNode(selector) || get(selector, node) || null;
};


text:
var gulp = require("gulp");
var CFG = require("./utils/config.js");
var $ = require("gulp-load-plugins")();
var path = require("path");

/**
 * script:test:report
 * @see www.npmjs.org/package/gulp-coveralls
 */
gulp.task("script:test:report", function () {
  return gulp.src([
      path.join(CFG.DIR.report, CFG.DIR.test, "**", CFG.FILE.coverageReporter.lcov)
    ])
    .pipe($.coveralls());
});


text:
using ReactNative.Bridge;
using ReactNative.Modules.Core;
using ReactNative.UIManager;
using System;
using System.Collections.Generic;

namespace RNDeviceInfo
{
    public class RNDeviceInfoPackage : IReactPackage
    {
        public IReadOnlyList<INativeModule> CreateNativeModules(ReactContext reactContext)
        {
            return new List<INativeModule>
            {
                new RNDeviceInfoModule(reactContext)
            };
        }

        public IReadOnlyList<Type> CreateJavaScriptModulesConfig()
        {
            return new List<Type>(0);
        }

        public IReadOnlyList<IViewManager> CreateViewManagers(
            ReactContext reactContext)
        {
            return new List<IViewManager>(0);
        }
    }
}


text:
/* $XFree86$ */
/*
 * Copyright 2004 Red Hat Inc., Raleigh, North Carolina.
 *
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation on the rights to use, copy, modify, merge,
 * publish, distribute, sublicense, and/or sell copies of the Software,
 * and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial
 * portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/*
 * Authors:
 *   Kevin E. Martin <kem@redhat.com>
 *
 */

/** \file
 * Interface for initialization.  \see dmxinit.c */

#ifndef DMXINIT_H
#define DMXINIT_H

#include "scrnintstr.h"

extern Bool dmxOpenDisplay(DMXScreenInfo *dmxScreen);
extern void dmxSetErrorHandler(DMXScreenInfo *dmxScreen);
extern void dmxCheckForWM(DMXScreenInfo *dmxScreen);
extern void dmxGetScreenAttribs(DMXScreenInfo *dmxScreen);
extern Bool dmxGetVisualInfo(DMXScreenInfo *dmxScreen);
extern void dmxGetColormaps(DMXScreenInfo *dmxScreen);
extern void dmxGetPixmapFormats(DMXScreenInfo *dmxScreen);

#endif /* DMXINIT_H */


text:
import json
# SBaaS
from .stage02_isotopomer_analysis_query import stage02_isotopomer_analysis_query
from SBaaS_base.sbaas_template_io import sbaas_template_io
# Resources
from io_utilities.base_importData import base_importData
from io_utilities.base_exportData import base_exportData

class stage02_isotopomer_analysis_io(stage02_isotopomer_analysis_query,
                                     sbaas_template_io):
    def import_data_stage02_isotopomer_analysis_add(self, filename):
        '''table adds'''
        data = base_importData();
        data.read_csv(filename);
        data.format_data();
        self.add_data_stage02_isotopomer_analysis(data.data);
        data.clear_data();


text:
package com.chimerapps.alexa.home.model.discovery;

import com.chimerapps.alexa.home.model.ResponsePayload;

import java.util.Collection;

/**
 * @author Nicola Verbeeck
 * Date 10/03/2017.
 */
public class DiscoverAppliancesResponse extends ResponsePayload {

	private final Collection<DiscoveredAppliance> discoveredAppliances;

	public DiscoverAppliancesResponse(final Collection<DiscoveredAppliance> discoveredAppliances) {
		super("DiscoverAppliancesResponse");
		this.discoveredAppliances = discoveredAppliances;
	}

	public Collection<DiscoveredAppliance> getDiscoveredAppliances() {
		return discoveredAppliances;
	}
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>Class CI_DB_sqlsrv_driver | Reserv</title>

	<link rel="stylesheet" href="resources/style.css?e99947befd7bf673c6b43ff75e9e0f170c88a60e">

		Overview

Packages

						CodeIgniter

						Drivers

						Libraries

						None

						Reserv

Classes

CI_DB_active_record

CI_DB_cubrid_driver

CI_DB_driver

CI_DB_mssql_driver

CI_DB_mysql_driver

CI_DB_mysqli_driver

CI_DB_odbc_driver

CI_DB_pdo_driver

CI_DB_postgre_driver

CI_DB_sqlite_driver

CI_DB_sqlsrv_driver

	<form id="search">
		<input type="hidden" name="cx" value="">
		<input type="hidden" name="ie" value="UTF-8">
		<input type="text" name="q" class="text" placeholder="Search">
	</form>

				Overview

Package

Class

				Tree

Class CI_DB_sqlsrv_driver

SQLSRV Database Adapter Class

Note: _DB is an extender class that the app controller
creates dynamically based on whether the active record
class is being used or not.

CI_DB

CI_DB_sqlsrv_driver

		Package: CodeIgniter\Drivers

				Category:
				Database

				Author:
				EllisLab Dev Team

				Link:
				http://codeigniter.com/user_guide/database/

			Located at system/database/drivers/sqlsrv/sqlsrv_driver.php

Methods summary

			 public

			resource

		#
		db_connect(  <var>$pooling</var> = false )

Non-persistent database connection

Non-persistent database connection

Returns

					resource

			 public

			resource

		#
		db_pconnect( )

Persistent database connection

Persistent database connection

Returns

					resource

			 public

		#
		reconnect( )

Reconnect

Reconnect

Keep / reestablish the db connection if no queries have been
sent for a length of time exceeding the server's idle timeout

			 public

			resource

		#
		db_select( )

Select the database

Select the database

Returns

					resource

			 public

			resource

		#
		db_set_charset( string <var>$charset</var>, string <var>$collation</var> )

Set client character set

Set client character set

Parameters

<var>$charset</var>

<var>$collation</var>

Returns

					resource

			 public

			resource

		#
		_execute( string <var>$sql</var> )

Execute the query

Execute the query

Parameters

<var>$sql</var>

SQL query

Returns

					resource

			 public

			string

		#
		_prep_query( string <var>$sql</var> )

Prep the query

Prep the query

If needed, each database adapter can prep the query string

Parameters

<var>$sql</var>

SQL query

Returns

					string

			 public

			boolean

		#
		trans_begin(  <var>$test_mode</var> = FALSE )

Begin Transaction

Begin Transaction

Returns

					boolean

			 public

			boolean

		#
		trans_commit( )

Commit Transaction

Commit Transaction

Returns

					boolean

			 public

			boolean

		#
		trans_rollback( )

Rollback Transaction

Rollback Transaction

Returns

					boolean

			 public

			string

		#
		escape_str( string <var>$str</var>, boolean <var>$like</var> = FALSE )

Escape String

Escape String

Parameters

<var>$str</var>

<var>$like</var>

or not the string will be used in a LIKE condition

Returns

					string

			 public

			integer

		#
		affected_rows( )

Affected Rows

Affected Rows

Returns

					integer

			 public

			integer

		#
		insert_id( )

Insert ID

Insert ID

Returns the last id created in the Identity column.

Returns

					integer

			 public

			int16

		#
		_parse_major_version( string <var>$version</var> )

Parse major version

Parse major version

Grabs the major version number from the
database server version string passed in.

Parameters

<var>$version</var>

Returns

					int16
major version number

			 public

			string

		#
		_version( )

Version number query string

Version number query string

Returns

					string

			 public

			string

		#
		count_all( string <var>$table</var> = '' )

"Count All" query

"Count All" query

Generates a platform-specific query string that counts all records in
the specified database

Parameters

<var>$table</var>

Returns

					string

			 public

			string

		#
		_list_tables( boolean <var>$prefix_limit</var> = FALSE )

List table query

List table query

Generates a platform-specific query string so that the table names can be fetched

Parameters

<var>$prefix_limit</var>

Returns

					string

			 public

			string

		#
		_list_columns( string <var>$table</var> = '' )

List column query

List column query

Generates a platform-specific query string so that the column names can be fetched

Parameters

<var>$table</var>

table name

Returns

					string

			 public

			object

		#
		_field_data( string <var>$table</var> )

Field data query

Field data query

Generates a platform-specific query so that the column data can be retrieved

Parameters

<var>$table</var>

table name

Returns

					object

			 public

			string

		#
		_error_message( )

The error message string

The error message string

Returns

					string

			 public

			integer

		#
		_error_number( )

The error message number

The error message number

Returns

					integer

			 public

			string

		#
		_escape_table( string <var>$table</var> )

Escape Table Name

Escape Table Name

This function adds backticks if the table name has a period
in it. Some DBs will get cranky unless periods are escaped

Parameters

<var>$table</var>

table name

Returns

					string

			 public

			string

		#
		_escape_identifiers( string <var>$item</var> )

Escape the SQL Identifiers

Escape the SQL Identifiers

This function escapes column and table names

Parameters

<var>$item</var>

Returns

					string

			 public

			type

		#
		_from_tables( type <var>$tables</var> )

From Tables

From Tables

This function implicitly groups FROM tables so there is no confusion
about operator precedence in harmony with SQL standards

Parameters

<var>$tables</var>

Returns

					type

			 public

			string

		#
		_insert( string <var>$table</var>, array <var>$keys</var>, array <var>$values</var> )

Insert statement

Insert statement

Generates a platform-specific insert string from the supplied data

Parameters

<var>$table</var>

table name

<var>$keys</var>

insert keys

<var>$values</var>

insert values

Returns

					string

			 public

			string

		#
		_update( string <var>$table</var>, array <var>$values</var>, array <var>$where</var> )

Update statement

Update statement

Generates a platform-specific update string from the supplied data

Parameters

<var>$table</var>

table name

<var>$values</var>

update data

<var>$where</var>

where clause

Returns

					string

			 public

			string

		#
		_truncate( string <var>$table</var> )

Truncate statement

Truncate statement

Generates a platform-specific truncate string from the supplied data
If the database does not support the truncate() command
This function maps to "DELETE FROM table"

Parameters

<var>$table</var>

table name

Returns

					string

			 public

			string

		#
		_delete( string <var>$table</var>, array <var>$where</var> )

Delete statement

Delete statement

Generates a platform-specific delete string from the supplied data

Parameters

<var>$table</var>

table name

<var>$where</var>

where clause

Returns

					string

			 public

			string

		#
		_limit( string <var>$sql</var>, integer <var>$limit</var>, integer <var>$offset</var> )

Limit string

Limit string

Generates a platform-specific LIMIT clause

Parameters

<var>$sql</var>

sql query string

<var>$limit</var>

number of rows to limit the query to

<var>$offset</var>

offset value

Returns

					string

			 public

		#
		_close( resource <var>$conn_id</var> )

Close DB Connection

Close DB Connection

Parameters

<var>$conn_id</var>

Properties summary

			public
			string

				<var>$dbdriver</var>

				#
				'sqlsrv'

			public
			string

				<var>$_escape_char</var>

				#
				''

			public
			string

				<var>$_like_escape_str</var>

				#
				" ESCAPE '%s' "

			public
			string

				<var>$_like_escape_chr</var>

				#
				'!'

			public
			string

				<var>$_count_string</var>

The syntax to count rows is slightly different across different
database engines, so this string appears in each driver and is
used for the count_all() and count_all_results() functions.

The syntax to count rows is slightly different across different
database engines, so this string appears in each driver and is
used for the count_all() and count_all_results() functions.

				#
				"SELECT COUNT(*) AS "

			public
			string

				<var>$_random_keyword</var>

				#
				' ASC'

		Reserv API documentation generated by ApiGen


text:
/***************************************************************************
 *   This library is free software; you can redistribute it and/or modify  *
 *   it  under the terms of the GNU Lesser General Public License version  *
 *   2.1 as published by the Free Software Foundation.                     *
 *                                                                         *
 *   This library is distributed in the hope that it will be useful, but   *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 *   Lesser General Public License for more details.                       *
 *                                                                         *
 *   You should have received a copy of the GNU Lesser General Public      *
 *   License along with this library; if not, write to the Free Software   *
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
 *   USA                                                                   *
 ***************************************************************************/

#ifndef TAGLIB_ID3V2HEADER_H
#define TAGLIB_ID3V2HEADER_H

#include <tbytevector.h>

namespace TagLib {

  namespace ID3v2 {

    //! An implementation of ID3v2 headers

    /*!
     * This class implements ID3v2 headers.  It attempts to follow, both
     * semantically and programatically, the structure specified in
     * the ID3v2 standard.  The API is based on the properties of ID3v2 headers
     * specified there.  If any of the terms used in this documentation are
     * unclear please check the specification in the linked section.
     * (Structure, 3.1)
     */

    class Header
    {
    public:
      /*!
       * Constructs an empty ID3v2 header.
       */
      Header();

      /*!
       * Constructs an ID3v2 header based on \a data.  parse() is called
       * immediately.
       */
      Header(const ByteVector &data);

      /*!
       * Destroys the header.
       */
      virtual ~Header();

      /*!
       * Returns the major version number.  (Note: This is the 4, not the 2 in
       * ID3v2.4.0.  The 2 is implied.)
       */
      uint majorVersion() const;

      /*!
       * Returns the revision number.  (Note: This is the 0, not the 4 in
       * ID3v2.4.0.  The 2 is implied.)
       */
      uint revisionNumber() const;

      /*!
       * Returns true if unsynchronisation has been applied to all frames.
       */
      bool unsynchronisation() const;

      /*!
       * Returns true if an extended header is present in the tag.
       */
      bool extendedHeader() const;

      /*!
       * Returns true if the experimental indicator flag is set.
       */
      bool experimentalIndicator() const;

      /*!
       * Returns true if a footer is present in the tag.
       */
      bool footerPresent() const;
      /*!
       * Returns the tag size in bytes.  This is the size of the frame content.
       * The size of the \e entire tag will be this plus the header size (10
       * bytes) and, if present, the footer size (potentially another 10 bytes).
       *
       * \note This is the value as read from the header to which TagLib attempts
       * to provide an API to; it was not a design decision on the part of TagLib
       * to not include the mentioned portions of the tag in the \e size.
       *
       * \see completeTagSize()
       */
      uint tagSize() const;

      /*!
       * Returns the tag size, including the header and, if present, the footer
       * size.
       *
       * \see tagSize()
       */
      uint completeTagSize() const;

      /*!
       * Set the tag size to \a s.
       * \see tagSize()
       */
      void setTagSize(uint s);

      /*!
       * Returns the size of the header.  Presently this is always 10 bytes.
       */
      static uint size();

      /*!
       * Returns the string used to identify and ID3v2 tag inside of a file.
       * Presently this is always "ID3".
       */
      static ByteVector fileIdentifier();

      /*!
       * Sets the data that will be used as the extended header.  10 bytes,
       * starting from \a data will be used.
       */
      void setData(const ByteVector &data);

      /*!
       * Renders the Header back to binary format.
       */
      ByteVector render() const;

    protected:
      /*!
       * Called by setData() to parse the header data.  It makes this information
       * available through the public API.
       */
      void parse(const ByteVector &data);

    private:
      Header(const Header &);
      Header &operator=(const Header &);

      class HeaderPrivate;
      HeaderPrivate *d;
    };

  }
}

#endif


text:
using System;
using System.Collections.ObjectModel;
using Caliburn.Micro;
using ElasticOps.Attributes;
using ElasticOps.Commands;
using ElasticOps.Events;

namespace ElasticOps.ViewModels.ManagementScreens
{
    public class LogEventViewModel
    {
        public string Text { get; set; }
        public string Level { get; set; }
        public DateTimeOffset Timestamp { get; set; }
    }

    [Priority(100)]
    public class ConsoleViewModel : Screen, IManagementScreen, IHandle<LogEntryCreatedEvent>
    {

        public ConsoleViewModel(Infrastructure infrastructure)
        {
            Ensure.ArgumentNotNull(infrastructure, "infrastructure");

            base.DisplayName = "Logs";
            LogEntries = new ObservableCollection<LogEventViewModel>();
            infrastructure.EventAggregator.Subscribe(this);
        }

        public ObservableCollection<LogEventViewModel> LogEntries { get; private set; }

        public void Handle(LogEntryCreatedEvent message)
        {
            Ensure.ArgumentNotNull(message, "message");

            LogEntries.Add(new LogEventViewModel
            {
                Level = message.LogEvent.Level.ToString(),
                Text = message.LogEvent.RenderMessage(),
                Timestamp = message.LogEvent.Timestamp,
            });
        }
    }
}


text:
package org.apache.eagle.security.util;

public class LogParseUtil {

    /**
     * @param ugi UGI field of audit log
     * @return resultToMetrics user from UGI field
     * e.g.
     * 1)user@APD.xyz.com
     * 2)hadoop/123.dc1.xyz.com@xyz.com (auth:KERBEROS)
     * 3)hadoop (auth:KERBEROS)
     * 4)hadoop
     */
    public static String parseUserFromUGI(String newUgi) {
        if(newUgi == null) return null;
        int index = newUgi.indexOf("/");
        if (index != -1) return newUgi.substring(0, index);
        index = newUgi.indexOf("@");
        if (index != -1) return newUgi.substring(0, index);
        index = newUgi.indexOf("(");
        if (index != -1) return newUgi.substring(0, index).trim();
        return newUgi.trim();
    }
}


text:
iml-java
========

IML - Indentation Markup Language - Java Parser

Forum
---
Give your opinion about IML on the forum: http://628906.xobor.com/f3-IML.html

What is IML ?
===

IML means " Indentation Markup Language " because the indentation delimits elements informations area.

The main objective  is to have the most simplified syntax than others in order to describe data easily.
An IML file must be comprehensive and editable by any human.

This syntax permits to describe the same data structure than JSON or YAML, but in a simplified way.

And why not YAML ?
---
The IML syntax is similar to YAML syntax, but IML is more easy to edit with less pitfalls :
 - we have not to add ```:``` at the end of each map keys
 - we have not to add a tiret ```-``` before each element of a list : only one line with a tiret ```-``` at the beginning of the list indicates that all children elements are in this list
 - multilines are easy to define with ```>``` symbol before the first line with no break line after it

```
My recipes
  -
    Best Chocolate Chip Cookies
      Ingredients
        -
          1 cup butter
          1 cup white sugar
          1 cup packed bown brown sugar
          2 eggs
          2 teaspoons vanilla extract
          1 teaspoon baking soda
          2 teaspoons hot water
          1/2 teaspoon salt
          2 cups semisweet chocolate
          1 cup chopped walnuts
      Preparation
        -
          > Preheat oven to 350 degrees F (175 degrees C)
          > Cream together the butter, white sugar, and brown sugar until smooth.
            Beat in the eggs one at a time, then stir in the vanilla. Dissolve
            baking soda in hot water. Add to batter along with salt. Stir in flour,
            chocolate chips, and nuts. Drop by large spoonfuls onto ungreased pans.
          > Bake for about 10 minutes in the preheated oven, or until edges are
            nicely browned.
```

IML syntax is described in the README file of the IML project :
https://github.com/lchaboud/iml/blob/master/SYNTAX.md

You can see a comparison between IML and YAML and JSON here :
https://github.com/lchaboud/iml/blob/master/SAMPLE.md


text:
<?php

namespace ymaker\social\share\drivers;

use ymaker\social\share\base\AbstractDriver;

/**
 * Driver for Ok.ru.
 *
 * @link https://ok.ru
 *
 * @author Petro Sokolnykov <info@xyz.net.ua>
 * @since 2.1
 */
class Odnoklassniki extends AbstractDriver
{
    /**
     * {@inheritdoc}
     */
    protected function processShareData()
    {
        $this->url = static::encodeData($this->url);
        $this->title = static::encodeData($this->title);
        $this->description = static::encodeData($this->description);
        $this->imageUrl = static::encodeData($this->imageUrl);
    }

    /**
     * {@inheritdoc}
     */
    protected function buildLink()
    {
        return 'https://connect.ok.ru/offer'
            . '?url={url}'
            . '&title={title}'
            . '&description={description}'
            . '&imageUrl={imageUrl}';
    }
}


text:
package com.facebook.buck.swift;

import com.facebook.buck.config.BuckConfig;
import com.google.common.base.Splitter;
import java.util.Optional;

/** A Swift-specific "view" of BuckConfig. */
public class SwiftBuckConfig {
  private static final String SECTION_NAME = "swift";
  public static final String COMPILER_FLAGS_NAME = "compiler_flags";
  public static final String VERSION_NAME = "version";

  private final BuckConfig delegate;

  public SwiftBuckConfig(BuckConfig delegate) {
    this.delegate = delegate;
  }

  private Optional<Iterable<String>> getFlags(String field) {
    Optional<String> value = delegate.getValue(SECTION_NAME, field);
    return value.map(input -> Splitter.on(" ").split(input.trim()));
  }

  public Optional<Iterable<String>> getCompilerFlags() {
    return getFlags(COMPILER_FLAGS_NAME);
  }

  public Optional<String> getVersion() {
    return delegate.getValue(SECTION_NAME, VERSION_NAME);
  }
}


text:
var url = require('url');
var fs = require('fs');
var argv = require('optimist').default('hosted', __dirname + '/hosted-sites').argv;

var HOST_PATH = argv.hosted;

function siteExists (req, res, next) {
    var uri = url.parse('http://'+req.headers.host + req.url);
    fs.exists(HOST_PATH+'/'+uri.hostname, function(exists) {
        if (exists) {
            deliverSite(req, res, next);
        } else {
            next();
        }
    });
}

function deliverSite (req, res, next) {

    var mimeTypes = {
        "html": "text/html",
        "jpeg": "image/jpeg",
        "jpg": "image/jpeg",
        "png": "image/png",
        "svg": "image/svg+xml",
        "js": "text/javascript",
        "css": "text/css"
    };

    var uri = url.parse('http://'+req.headers.host + req.url);
    var filename = HOST_PATH+'/'+uri.hostname + req.url;
    if (filename.substr(-1,1) === '/') {
        filename = filename + 'index.html';
    }
    fs.exists(filename, function(exists) {
        if(!exists) {
            res.writeHead(404, {'Content-Type': 'text/plain'});
            res.write('404 Not Found\n');
            res.end();
            return;
        }
        var parts = filename.split(".");
        var mimeType = mimeTypes[parts[parts.length-1]];
        res.writeHead(200, {'Content-Type': mimeType} );
        var fileStream = fs.createReadStream(filename);
        fileStream.pipe(res);
    });
}

module.exports = function (req, res, next) {
    // if no hostmore request, call through
    siteExists(req, res, next);
};


text:
	hide

	help

What is a Supporter?

	A Supporter is a person, project or organisation that wants to show appreciation for the Open Source projects they are using. You don't need to make any financial contribution, just setting up a Supporter page and linking to it from your README.md or web site tells the world you are grateful for the existence of the Open Source projects you support.

How It Works?

1. Specify the capacity in which you're supporting

			Click on the 'You are editing' drop down at the top of the screen.
			You can support in more than on of the capacities you see in the drop down.
			For each one where you are supporting, you will see a heart icon.

			You can choose to give support generally without being project specific (in which case select 'General support') and you can also give support at the individual project level (in which case you can select an individual repo).

			Wherever you are either an Administrator at the Organizational level, you will see those organizations listed. As with personal account, you can choose to offer support at the general level and/or the project level.

2. Specify Open Source projects you use

You can find the open source projects you are using by the four methods shown (Search, Owned, Watched and Starred). Having located the repo, you indicate the way you are supporting that project by clicking on any or all of the 3 icons. Hover over the icon to see what each one means.

Each time you indicate support for a repo, it will be added to SELECTED PROJECTS which you can click on at any time.

3. You might want to donate now

There is absolutely no obligation to donate. Just acknowledging your support (the heart icon) is great. But if you do want to donate then you can donate by clicking on any of the donate icons on the right side. I Love Open Source (itself an Open Source project) does not process any financial transactions at all. The Repo Maintainers are responsible for saying how they would like donations to be given and this involves 3rd party systems such as Gittip, Flattr, Paypal etc.

4. Preview your page and generate link code

You can press the Preview Project button at any time in order to see how your support page looks.

At any time, you can press the 'Share' button to get the code to paste into your web site or README.md file. By inlacing the "I Love Open Source" icon, you are helping people drive awareness and encouraging others to acknowledge and also donate.


text:
ES5Harness.registerTest( {
    id: "15.2.3.6-3-113",

    path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-3-113.js",

    description: "Object.defineProperty - 'configurable' property in 'Attributes' is a String object (8.10.5 step 4.b)",

    test: function testcase() {
        var obj = {};

        Object.defineProperty(obj, "property", { configurable: new String("bbq") });

        var beforeDeleted = obj.hasOwnProperty("property");

        delete obj.property;

        var afterDeleted = obj.hasOwnProperty("property");

        return beforeDeleted === true && afterDeleted === false;
    },

    precondition: function prereq() {
        return fnExists(Object.defineProperty);
    }
});


text:
#include <stdbool.h>

// ACCELERATOR

bool acceleratorArmOn(int* context);

bool acceleratorRotationIfNeeded(int* context);

bool acceleratorArmOff(int* context);

// GOLDENIUM

bool goldeniumPrepareTake(int* context);

bool goldeniumTake(int* context);

bool goldeniumPrepareDrop(int* context);

bool goldeniumDrop(int* context);

// SMALL DISTRIBUTOR

bool smallDistributorLinePrepare(int* context);

bool smallDistributorLineTake(int* context);

bool smallDistributorAcceleratorDrop(int* context);

// BIG DISTRIBUTOR LINE 3

bool bigDistributorLine3Prepare(int* context);

bool bigDistributorLine3Take(int* context);

bool bigDistributorLine3Drop(int* context);

// BIG DISTRIBUTOR LINE 2

bool bigDistributorLine2Prepare(int* context);

bool bigDistributorLine2Take(int* context);

bool bigDistributorLine2Drop(int* context);

#endif


text:
package org.kie.workbench.common.screens.projecteditor.client.forms;

import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HasHandlers;

public interface HasAddItemHandlers
        extends HasHandlers {

    HandlerRegistration addAddItemHandler(AddItemHandler handler);

}


text:
package setters2

import (
	"encoding/json"

	"k8s.io/kube-openapi/pkg/validation/spec"
	"sigs.k8s.io/kustomize/kyaml/errors"
	"sigs.k8s.io/kustomize/kyaml/openapi"
)

type CliExtension struct {
	Setter       *setter       `yaml:"setter,omitempty" json:"setter,omitempty"`
	Substitution *substitution `yaml:"substitution,omitempty" json:"substitution,omitempty"`
}

type setter struct {
	Name       string            `yaml:"name,omitempty" json:"name,omitempty"`
	Value      string            `yaml:"value,omitempty" json:"value,omitempty"`
	ListValues []string          `yaml:"listValues,omitempty" json:"listValues,omitempty"`
	EnumValues map[string]string `yaml:"enumValues,omitempty" json:"enumValues,omitempty"`
	Required   bool              `yaml:"required,omitempty" json:"required,omitempty"`
	IsSet      bool              `yaml:"isSet,omitempty" json:"isSet,omitempty"`
}

type substitution struct {
	Name    string                        `yaml:"name,omitempty" json:"name,omitempty"`
	Pattern string                        `yaml:"pattern,omitempty" json:"pattern,omitempty"`
	Values  []substitutionSetterReference `yaml:"values,omitempty" json:"values,omitempty"`
}

type substitutionSetterReference struct {
	Ref    string `yaml:"ref,omitempty" json:"ref,omitempty"`
	Marker string `yaml:"marker,omitempty" json:"marker,omitempty"`
}

// K8sCliExtensionKey is the name of the OpenAPI field containing the setter extensions
const K8sCliExtensionKey = "x-k8s-cli"

// GetExtFromSchema returns the cliExtension openAPI extension if it is present in schema
func GetExtFromSchema(schema *spec.Schema) (*CliExtension, error) {
	cep := schema.VendorExtensible.Extensions[K8sCliExtensionKey]
	if cep == nil {
		return nil, nil
	}
	b, err := json.Marshal(cep)
	if err != nil {
		return nil, err
	}
	val := &CliExtension{}
	if err := json.Unmarshal(b, val); err != nil {
		return nil, err
	}
	return val, nil
}

// getExtFromComment returns the cliExtension openAPI extension if it is present as
// a comment on the field.
func getExtFromComment(schema *openapi.ResourceSchema) (*CliExtension, error) {
	if schema == nil {
		// no schema found
		// TODO(pwittrock): should this be an error if it doesn't resolve?
		return nil, nil
	}

	// get the cli extension from the openapi (contains setter information)
	ext, err := GetExtFromSchema(schema.Schema)
	if err != nil {
		return nil, errors.Wrap(err)
	}
	return ext, nil
}


text:
'use strict';

import request from 'supertest';
import {expect} from 'chai';

import client from '../src/data/client';
import Users from '../src/models/users';
import Polls from '../src/models/polls';
import app from '../src/routes/express-config';

const agent = request.agent(app);

describe('Express Routes', () => {
  beforeEach(() => { client.flushdb(); });
  afterEach(() => { client.flushdb(); });

  describe('Get request to /', () => {
    it('Returns 200 status', (done) => {
      agent.get('/')
        .expect(200, done)
    });
    it('Returns a Content-Type of HTML', (done) => {
      agent.get('/')
        .expect('Content-Type', /html/, done)
    });
    it('Should return HTML with initial state', (done) => {
      const user = Users('unchained', 'django', 'password')
        .saveToDB();
      const poll = Polls('A New Poll', {yes: 0, no: 0}, 'unchained')
        .saveToDB();

      agent.get('/')
        .end((err, res) => {
          expect(res.text).to.contain('window.__INITIAL_STATE__');
          expect(res.text).to.contain(JSON.stringify(Users.format(user)));
          expect(res.text).to.contain(JSON.stringify(poll.format()));
          done();
        })
    });
  });
  describe('Post request to /signup', () => {
    const newUser = Users('unchained', 'django', 'password');
    it(`Should signup a new user and return their username/name
      if the username doesn't exist`, (done) => {
      agent.post('/signup')
        .send(newUser)
        .expect(201)
        .expect({username: 'unchained', name:'django'}, done);
    });
    it('Should return a 409 status error if the username already exists', (done) => {
      newUser.saveToDB();
      agent.post('/signup')
        .send(newUser)
        .expect(409, done);
    });
    it('Should return a 400 error if username, name or password are missing', (done) => {
      agent.post('/signup')
        .send({username: 'hey'})
        .expect(400, done);
    });
  });
  describe('Post request to /login', () => {
    it(`Should login a user if their username and password is correct.
      Then return their username / name`, (done) => {
      Users('unchained', 'django', 'password')
        .encryptPassword()
        .saveToDB();

      agent.post('/login')
        .send({username: 'unchained', password: 'password'})
        .expect(200)
        .expect({username: 'unchained', name:'django'}, done);
    });
    it(`Should return a 401 error if either the username
      or passwrod is incorrect`, (done) => {
      agent.post('/login')
        .send({username: 'wrong', password: 'details'})
        .expect(401, done);
    });
  });
  describe('Get reqeust to /api/users', () => {
    it('Should return 200 status', (done) => {
      agent.get('/api/users')
        .expect(200, done);
    });
    it('Should a Content-Type of JSON', (done) => {
      agent.get('/api/users')
        .expect('Content-Type', /json/, done)
    });
    it('Should return no data found when there are no active users', (done) => {
      agent.get('/api/users')
        .expect({'no-data': 'No active users found'}, done)
    })
    it(`Should return an array of active users, containing only their
      username and created polls`, (done) => {
      const user = Users('unchained', 'django', 'password')
        .saveToDB();

      agent.get('/api/users')
        .expect(res => {
          expect(res.body).to.be.an('array')
          expect(res.body[0]).to.deep.equal(Users.format(user))
        })
        .end(done)
    });
  });
  describe('Get request to /api/polls', () => {
    it('Should return 200 status', (done) => {
      agent.get('/api/polls')
        .expect(200, done);
    });
    it('Returns a Content-Type of JSON', (done) => {
      agent.get('/api/polls')
        .expect('Content-Type', /json/, done)
    });
    it('Should return no data found when there are no active polls', (done) => {
      agent.get('/api/polls')
        .expect({'no-data': 'No active polls found'}, done)
    });
    it(`Should return an array of active polls,
      containing only it's name, options and submitter`, (done) => {
      const poll = Polls('A New Poll', {yes: 0, no: 0}, 'unchained')
        .saveToDB();

      agent.get('/api/polls')
        .expect(res => {
          expect(res.body).to.be.an('array')
          expect(res.body[0]).to.deep.equal(poll.format())
        })
        .end(done)
    });
  });
  describe('Post request to /api/polls', () => {
    beforeEach(() => {
      Users('unchained', 'django', 'password').saveToDB();
    });
    it(`Should return a 201 status - and the formatted poll -
      if the poll doesn't exist`, (done) => {
      let expectedResponse = {
        name: 'A New Poll',
        options: {
          yes: 0,
          no: 0
        },
        submitter: 'unchained'
      };

      agent.post('/api/polls')
        .send({pollName: 'A New Poll', options: ['yes', 'no']})
        .expect(201)
        .expect(expectedResponse, done);
    });
    it('Should save the poll to the database', (done) => {
      agent.post('/api/polls')
        .send({pollName: 'A New Poll', options: ['yes', 'no']})
        .end((err, res) => {
          Polls.exists('A New Poll')
            .then(exists => {
              expect(exists).to.equal(1);
              done();
            })
        });
    })
    it('Should return a 409 status if the poll already exists', (done) => {
      Polls('A New Poll', {yes: 0, no: 0}, 'unchained')
        .saveToDB();

      agent.post('/api/polls')
        .send({pollName: 'A New Poll', options: ['yes', 'no']})
        .expect(409, done);
    });
  });
  describe('Put request to /api/polls', () => {
    beforeEach(() => {
      Users('unchained', 'django', 'password').saveToDB();
    });
    it('Should return the edited poll', (done) => {
      Polls('A New Poll', {yes: 0, no: 0}, 'unchained')
        .saveToDB();

      const editedPoll = {
        pollName: 'A New Poll',
        newOptions: ['yes', 'no', 'maybe']
      }
      const expectedResponse = {
        name: 'A New Poll',
        options: {
          yes: 0, no: 0, maybe: 0
        },
        submitter: 'unchained'
      }
      agent.put('/api/polls')
        .send(editedPoll)
        .expect(expectedResponse, done)
    })
    it('Should return 400 if the poll doesn\'t exist', (done) => {
      agent.put('/api/polls')
        .send({pollName: 'fakename'})
        .expect(400)
        .expect('Unable to find poll, please check the name and try again', done);
    });
  });
  describe('Delete request to /api/polls', () => {
    beforeEach(() => {
      Users('unchained', 'django', 'password').saveToDB();
    });
    it('It should delete the poll if it exists and return the username', (done) => {
      Polls('A New Poll', {yes: 0, no: 0}, 'unchained')
        .saveToDB();

      agent.delete('/api/polls')
        .send({pollName: 'A New Poll'})
        .end((err, res) => {
          expect(res.status).to.equal(200);
          expect(res.body).to.equal('unchained');
          Polls.exists('A New Poll')
            .then(exists => {
              expect(exists).to.equal(0)
              done();
            })
          }
        )
    });
  });
  describe('Put request to /api/polls/vote', () => {
    beforeEach(() => {
      Users('unchained', 'django', 'password').saveToDB();
    });
    it('Should return the poll with the updated vote count', (done) => {
      Polls('A New Poll', {yes: 0, no: 0}, 'unchained')
        .saveToDB();

      const expectedResponse = {
        name: 'A New Poll',
        options: {
          no: 0,
          yes: 1
        },
        submitter: 'unchained'
      }

      agent.put('/api/polls/vote')
        .send({pollName: 'A New Poll', option: 'yes'})
        .expect(200)
        .expect(expectedResponse, done)
    });
    it('Should return a 409 error if someone has already voted on a poll', (done) => {
      Polls('A New Poll', {yes: 0, no: 0}, 'unchained')
        .vote('yes', '::ffff:127.0.0.1')
        .saveToDB();

      agent.put('/api/polls/vote')
        .send({pollName: 'A New Poll', option: 'yes'})
        .expect(409, done)
    });
  });
});


text:
package ru.org.linux.tag

import java.util.concurrent.CompletionStage
import javax.annotation.Nonnull
import javax.servlet.http.HttpServletRequest

import akka.actor.ActorSystem
import com.typesafe.scalalogging.StrictLogging
import org.apache.commons.lang3.text.WordUtils
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.{PathVariable, RequestMapping, RequestMethod}
import org.springframework.web.servlet.ModelAndView
import ru.org.linux.gallery.ImageService
import ru.org.linux.group.GroupDao
import ru.org.linux.section.{Section, SectionService}
import ru.org.linux.site.Template
import ru.org.linux.topic.TopicListDao.CommitMode
import ru.org.linux.topic._
import ru.org.linux.user.UserTagService
import ru.org.linux.util.RichFuture._

import scala.collection.JavaConverters._
import scala.compat.java8.FutureConverters._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent._
import scala.concurrent.duration._

object TagPageController {
  val TotalNewsCount = 21
  val ForumTopicCount = 20
  val GalleryCount = 6

  val Timeout: FiniteDuration = 500 millis
}

@Controller
@RequestMapping(value = Array("/tag/{tag}"), params = Array("!section"))
class TagPageController(tagService: TagService, prepareService: TopicPrepareService, topicListService: TopicListService,
 sectionService: SectionService, groupDao: GroupDao, userTagService: UserTagService, imageService: ImageService,
 actorSystem: ActorSystem) extends StrictLogging {

  private implicit val akka = actorSystem

  @RequestMapping(method = Array(RequestMethod.GET, RequestMethod.HEAD))
  def tagPage(request: HttpServletRequest, @PathVariable tag: String): CompletionStage[ModelAndView] = {
    val deadline = TagPageController.Timeout.fromNow

    val tmpl = Template.getTemplate(request)

    if (!TagName.isGoodTag(tag)) {
      throw new TagNotFoundException
    }

    val countF = tagService.countTagTopics(tag)

    val relatedF = {
      tagService.getRelatedTags(tag) map { relatedTags ⇒
        if (relatedTags.nonEmpty) {
          Some("relatedTags" -> relatedTags.asJava)
        } else {
          None
        }
      }
    }

    val favs = if (tmpl.isSessionAuthorized) {
      Seq("showFavoriteTagButton" -> !userTagService.hasFavoriteTag(tmpl.getCurrentUser, tag),
        "showUnFavoriteTagButton" -> userTagService.hasFavoriteTag(tmpl.getCurrentUser, tag),
        "showIgnoreTagButton" -> (!tmpl.isModeratorSession && !userTagService.hasIgnoreTag(tmpl.getCurrentUser, tag)),
	      "showUnIgnoreTagButton" -> (!tmpl.isModeratorSession && userTagService.hasIgnoreTag(tmpl.getCurrentUser, tag)))
    } else {
      Seq.empty
    }

    val tagInfo = tagService.getTagInfo(tag, skipZero = true)

    val sections = getNewsSection(request, tag) ++ getGallerySection(tag, tagInfo.id, tmpl) ++
      getForumSection(tag, tagInfo.id, Section.SECTION_FORUM, CommitMode.POSTMODERATED_ONLY) ++
      getForumSection(tag, tagInfo.id, Section.SECTION_POLLS, CommitMode.COMMITED_ONLY)

    val model = Map(
      "tag" -> tag,
      "title" -> WordUtils.capitalize(tag),
      "favsCount" -> userTagService.countFavs(tagInfo.id),
      "ignoreCount" -> userTagService.countIgnore(tagInfo.id),
      "showAdsense" -> Boolean.box(!tmpl.isSessionAuthorized || !tmpl.getProf.isHideAdsense)
    ) ++ sections ++ favs

    val safeRelatedF = relatedF withTimeout deadline.timeLeft recover {
      case ex: TimeoutException ⇒
        logger.warn(s"Tag related search timed out (${ex.getMessage})")
        None
      case ex ⇒
        logger.warn("Unable to find related tags", ex)
        None
    }

    val safeCountF = countF withTimeout deadline.timeLeft recover {
      case ex: TimeoutException ⇒
        logger.warn(s"Tag topics count timed out (${ex.getMessage})")
        tagInfo.topicCount.toLong
      case ex ⇒
        logger.warn("Unable to count tag topics", ex)
        tagInfo.topicCount.toLong
    }

    (for {
      counter <- safeCountF
      related <- safeRelatedF
    } yield {
      new ModelAndView("tag-page", (model + ("counter" -> counter) ++ related).asJava)
    }) toJava
  }

  private def getNewsSection(request: HttpServletRequest, tag: String) = {
    val tmpl = Template.getTemplate(request)
    val newsSection = sectionService.getSection(Section.SECTION_NEWS)
    val newsTopics = topicListService.getTopicsFeed(newsSection, null, tag, 0, null, null, TagPageController.TotalNewsCount)
    val (fullNewsTopics, briefNewsTopics) = newsTopics.asScala.splitAt(1)
    val fullNews = prepareService.prepareMessagesForUser(fullNewsTopics.asJava, tmpl.getCurrentUser, tmpl.getProf, false)

    val briefNewsByDate = TopicListTools.datePartition(briefNewsTopics)

    val more = if (newsTopics.size == TagPageController.TotalNewsCount) {
      Some("moreNews" -> TagTopicListController.tagListUrl(tag, newsSection))
    } else {
      None
    }

    Map(
      "fullNews" -> fullNews,
      "addNews" -> AddTopicController.getAddUrl(newsSection, tag),
      "briefNews" -> TopicListTools.split(briefNewsByDate.map(p ⇒ p._1 -> BriefTopicRef.fromTopicNoGroup(p._2)))
    ) ++ more
  }

  private def getGallerySection(tag: String, tagId: Int, tmpl: Template) = {
    val list = imageService.prepareGalleryItem(imageService.getGalleryItems(TagPageController.GalleryCount, tagId))
    val section = sectionService.getSection(Section.SECTION_GALLERY)

    val add = if (tmpl.isSessionAuthorized) {
      Some("addGallery" -> AddTopicController.getAddUrl(section, tag))
    } else {
      None
    }

    val more = if (list.size == TagPageController.GalleryCount) {
      Some("moreGallery" -> TagTopicListController.tagListUrl(tag, section))
    } else {
      None
    }

    Map(
      "gallery" -> list
    ) ++ add ++ more
  }

  private def getForumSection(@Nonnull tag: String, tagId: Int, section: Int, mode: CommitMode) = {
    val forumSection = sectionService.getSection(section)

    val topicListDto = new TopicListDto
    topicListDto.setSection(forumSection.getId)
    topicListDto.setCommitMode(mode)
    topicListDto.setTag(tagId)
    topicListDto.setLimit(TagPageController.ForumTopicCount)

    val forumTopics = topicListService.getTopics(topicListDto)
    val topicByDate = TopicListTools.datePartition(forumTopics.asScala)

    val more = if (forumTopics.size == TagPageController.ForumTopicCount) {
      Some(forumSection.getUrlName+"More" -> TagTopicListController.tagListUrl(tag, forumSection))
    } else {
      None
    }

    Map(
      forumSection.getUrlName+"Add" -> AddTopicController.getAddUrl(forumSection, tag),
      forumSection.getUrlName -> TopicListTools.split(
        topicByDate.map(p ⇒ p._1 -> BriefTopicRef.fromTopic(p._2, groupDao.getGroup(p._2.getGroupId).getTitle)))
    ) ++ more
  }
}


text:
astyle -j -s4 -p -a --brackets=break-closing-headers --convert-tabs < $1 > listings/$2
#astyle -j -s4 -p --convert-tabs --style=java < $1 > listings/$2


text:
package org.openhubframework.openhub.api.common.quartz;

import org.quartz.CronTrigger;

/**
 * Contains all misfire instruction for cron trigger defined in annotation {@link QuartzCronTrigger}.
 *
 * @author Roman Havlicek
 * @see QuartzJob
 * @see QuartzCronTrigger
 * @see QuartzSimpleTrigger
 * @see CronTrigger
 * @since 2.0
 */
public enum CronTriggerMisfireInstruction {

    /**
     * See documentation in {@link CronTrigger#MISFIRE_INSTRUCTION_SMART_POLICY}.
     */
    SMART_POLICY(CronTrigger.MISFIRE_INSTRUCTION_SMART_POLICY),

    /**
     * See documentation in {@link CronTrigger#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY}.
     */
    IGNORE_MISFIRE_POLICY(CronTrigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY),

    /**
     * See documentation in {@link CronTrigger#MISFIRE_INSTRUCTION_DO_NOTHING}.
     */
    DO_NOTHING(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING),

    /**
     * See documentation in {@link CronTrigger#MISFIRE_INSTRUCTION_FIRE_ONCE_NOW}.
     */
    FIRE_ONCE_NOW(CronTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW);

    /**
     * Misfire instruction.
     */
    private final int misfireInstruction;

    /**
     * New instance.
     *
     * @param misfireInstruction misfire instruction
     */
    CronTriggerMisfireInstruction(int misfireInstruction) {
        this.misfireInstruction = misfireInstruction;
    }

    //----------------------------------------------------- SET / GET --------------------------------------------------

    /**
     * Gets misfire instruction.
     *
     * @return misfire instruction
     */
    public int getMisfireInstruction() {
        return misfireInstruction;
    }
}


text:
package com.kaleksandrov.smp.notification.builder;

import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.graphics.Bitmap;
import android.widget.RemoteViews;

import com.kaleksandrov.smp.R;

public class PlayerNotificationBuilder extends AbstractNotificationBuilder {
	private static final int NOTIFICATION_LAYOUT_SMALL_ID = R.layout.notification_media_player_small;

	private RemoteViews contentView;

	public PlayerNotificationBuilder(final Context context,
			final int smallIcon,
			final PendingIntent contentInten) {
		super(context, smallIcon, contentInten);

		contentView = new RemoteViews(context.getPackageName(), NOTIFICATION_LAYOUT_SMALL_ID);
		setContent(contentView);
	}

	@Override
	public Notification build() {
		final Notification notification = super.build();
		notification.contentView = contentView;
		return notification;
	}

	public PlayerNotificationBuilder setToggleButton(final PendingIntent buttonIntent) {
		contentView.setOnClickPendingIntent(R.id.play, buttonIntent);
		return this;
	}

	public PlayerNotificationBuilder setToggleButtonIcon(final int resourceId) {
		contentView.setImageViewResource(R.id.play, resourceId);
		return this;
	}

	public PlayerNotificationBuilder setNextIconButton(final int resourceId) {
		contentView.setImageViewResource(R.id.next, resourceId);
		return this;
	}

	public PlayerNotificationBuilder setNextButton(final PendingIntent buttonIntent) {
		contentView.setOnClickPendingIntent(R.id.next, buttonIntent);
		return this;
	}

	public PlayerNotificationBuilder setDescription(final String description) {
		contentView.setTextViewText(R.id.artist, description);
		return this;
	}

	public PlayerNotificationBuilder setTitle(final String title) {
		contentView.setTextViewText(R.id.title, title);
		return this;
	}

	public PlayerNotificationBuilder setIcon(final int icon) {
		contentView.setImageViewResource(R.id.icon, icon);
		return this;
	}

	public PlayerNotificationBuilder setIcon(final Bitmap icon) {
		contentView.setImageViewBitmap(R.id.icon, icon);
		return this;
	}
}


text:
/*global Backbone */
var app = app || {};

(function () {
	'use strict';

    var appName = 'requestAnimationFrame';

	app[appName] = app.BaseTest.extend({
		defaults: {
			title: appName,
			completed: false,
            permissionRequired: true
		},

        data: {
            spheres: {
                direct: ['SOCIAL']
            },

            userAgentsApiDetails : {
                Chrome: {
                    any: {
                        strictPolicy: true,
                        simpleManagement: false
                    }
                },
                Firefox: {
                    any: {
                        strictPolicy: true,
                        simpleManagement: false
                    }
                },
                Safari: {
                    any: {
                        strictPolicy: true,
                        simpleManagement: false
                    }
                },
                MSIE: {
                    any: {
                        strictPolicy: true,
                        simpleManagement: false
                    }
                }
            }
        },

        run: function () {

			this.runSimpleTest(Modernizr.raf);
		}
	});

    app.events.publish('processTest', [app[appName]]);

})();


text:
<bill session="110" type="h" number="6394" updated="2009-01-09T06:03:29-05:00">
	<status><introduced date="1214452800" datetime="2008-06-26"/></status>

	<introduced date="1214452800" datetime="2008-06-26"/>
	<titles>
		<title type="short" as="introduced">Border Health Care Relief Act of 2008</title>
		<title type="official" as="introduced">To amend the Medicare Prescription Drug, Improvement, and Modernization Act of 2003 to extend Federal reimbursement of emergency health services furnished to undocumented aliens, and for other purposes.</title>
	</titles>
	<sponsor id="412188"/>
	<cosponsors>
		<cosponsor id="400133" joined="2008-06-26"/>
		<cosponsor id="400031" joined="2008-07-10"/>
		<cosponsor id="400337" joined="2008-06-26"/>
		<cosponsor id="400160" joined="2008-07-30"/>
		<cosponsor id="400162" joined="2008-06-26"/>
		<cosponsor id="400302" joined="2008-06-26"/>
		<cosponsor id="400355" joined="2008-06-26"/>
		<cosponsor id="412187" joined="2008-06-26"/>
		<cosponsor id="400570" joined="2008-07-10"/>
		<cosponsor id="400009" joined="2008-06-26"/>
		<cosponsor id="400310" joined="2008-06-26"/>
		<cosponsor id="400179" joined="2008-06-26"/>
	</cosponsors>
	<actions>
		<action date="1214452800" datetime="2008-06-26"><text>Referred to the House Committee on Energy and Commerce.</text></action>
		<action date="1214452800" datetime="2008-06-26"><text>Referred to the Subcommittee on Health.</text></action>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>
	<summary>
	6/26/2008--Introduced.<br/>Border Health Care Relief Act of 2008 - Amends the Medicare Prescription Drug, Improvement, and Modernization Act of 2003 to extend through FY2012 federal reimbursement of emergency health services furnished to undocumented aliens.
	</summary>
</bill>


text:
local alert    = require("hs.alert")
local timer    = require("hs.timer")
local eventtap = require("hs.eventtap")

local events   = eventtap.event.types

local ctrltap   = {}

-- timeout for ctrol key
ctrltap.timeFrame = .25

-- what to do when the ctrl key has been tapped
ctrltap.action = function()
    eventtap.keyStroke({}, 'escape')
--    alert("esc")
end

local ctrlPressed = false

-- Synopsis:

-- what we're looking for is the ctrl key down event followed by
-- the key up within a short time frame with no other key or flag
-- change event before the specified time has passed

-- verify that *only* the ctrl key flag is being pressed
local onlyCtrl = function(ev)
    local result = ev:getFlags().ctrl
    for k,v in pairs(ev:getFlags()) do
        if k ~= "ctrl" and v then
            result = false
            break
        end
    end
    return result
end

-- verify that no modifier keys are being pressed
local noModifiers = function(ev)
    result = true
    for k,v in pairs(ev:getFlags()) do
        if v == true then
            result = false
            break
        end
    end
    return result
end

ctrltap.eventwatcher = eventtap.new({events.flagsChanged, events.keyDown}, function(ev)
    ev_type = ev:getType()

    if ev_type == events.flagsChanged then
        if onlyCtrl(ev) then
            ctrltap.countDownTimer = timer.doAfter(ctrltap.timeFrame, function()
                ctrltap.countDownTimer = nil
                ctrlPressed = false
            end)
            ctrlPressed = true
        elseif noModifiers(ev) then
            if ctrlPressed and ctrltap.action then
                ctrltap.action()
            end
        else
            ctrlPressed = false
        end
    elseif ev_type == events.keyDown then
        ctrlPressed = false
    end

    return false ;
end):start()

return ctrltap


text:
require 'spec_helper'
require 'shared_examples_param_validation'

describe 'kafka::broker', type: :class do
  on_supported_os.each do |os, os_facts|
    context "on #{os}" do
      let(:facts) do
        os_facts
      end

      let :params do
        {
          config: {
            'zookeeper.connect' => 'localhost:2181'
          }
        }
      end

      it { is_expected.to contain_class('kafka::broker::install').that_comes_before('Class[kafka::broker::config]') }
      it { is_expected.to contain_class('kafka::broker::config').that_comes_before('Class[kafka::broker::service]') }
      it { is_expected.to contain_class('kafka::broker::service').that_comes_before('Class[kafka::broker]') }
      it { is_expected.to contain_class('kafka::broker') }

      describe 'kafka::broker::install' do
        context 'defaults' do
          it { is_expected.to contain_class('kafka') }
        end
      end

      describe 'kafka::broker::config' do
        context 'defaults' do
          it { is_expected.to contain_file('/opt/kafka/config/server.properties') }
        end
      end

      describe 'kafka::broker::service' do
        context 'manage_service false' do
          let(:params) { super().merge(manage_service: false) }

          it { is_expected.not_to contain_file('/etc/init.d/kafka') }
          it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service') }
          it { is_expected.not_to contain_service('kafka') }
        end

        context 'defaults' do
          if os_facts[:service_provider] == 'systemd'
            it { is_expected.to contain_file('/etc/init.d/kafka').with_ensure('absent') }
            it { is_expected.to contain_file('/etc/systemd/system/kafka.service').that_notifies('Exec[systemctl-daemon-reload]') }
            it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^After=network\.target syslog\.target$} }
            it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^Wants=network\.target syslog\.target$} }
            it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=} }
            it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=} }
            it { is_expected.to contain_exec('systemctl-daemon-reload').that_comes_before('Service[kafka]') }
          else
            it { is_expected.to contain_file('/etc/init.d/kafka') }
          end

          it { is_expected.to contain_service('kafka') }
        end

        context 'limit_nofile set' do
          let(:params) { super().merge(limit_nofile: '65536') }

          if os_facts[:service_provider] == 'systemd'
            it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=65536$} }
          else
            it { is_expected.to contain_file('/etc/init.d/kafka').with_content %r{ulimit -n 65536$} }
          end
        end

        context 'limit_core set' do
          let(:params) { super().merge(limit_core: 'infinity') }

          if os_facts[:service_provider] == 'systemd'
            it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=infinity$} }
          else
            it { is_expected.to contain_file('/etc/init.d/kafka').with_content %r{ulimit -c infinity$} }
          end
        end

        context 'service_requires set', if: os_facts[:service_provider] == 'systemd' do
          let(:params) { super().merge(service_requires: ['dummy.target']) }

          it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^After=dummy\.target$} }
          it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^Wants=dummy\.target$} }
        end
      end

      it_validates_parameter 'mirror_url'
    end
  end
end


text:
This module helps install [OpenShift Origin](https://openshift.redhat.com/community/open-source) Platform As A Service.
Through the declaration of the `openshift_origin` class, you can configure the OpenShift Origin Broker, Node and support
services including ActiveMQ, Qpid, MongoDB, named and OS settings including firewall, startup services, and ntp.

## Authors

* Jamey Owens
* Ben Klang
* Ben Langfeld
* Krishna Raman

# Requirements

* Puppet >= 2.7
* Facter >= 1.6.17
* Puppetlabs/stdlib module.  Can be obtained
  [here](http://forge.puppetlabs.com/puppetlabs/stdlib) or with the command
  `puppet module install puppetlabs/stdlib`
* Puppetlabs/ntp module.  Can be obtained
  [here](http://forge.puppetlabs.com/puppetlabs/ntp) or with the command
  `puppet module install puppetlabs/ntp`

# Installation

The module can be obtained from the
[github repository](https://github.com/kraman/puppet-openshift_origin).

1. Download the [Zip file from github](https://github.com/kraman/puppet-openshift_origin/archive/master.zip)
1. Upload the Zip file to your Puppet Master.
1. Unzip the file.  This will create a new directory called puppet-openshift_origin-{commit hash}
1. Rename this directory to just `openshift_origin` and place it in your
	   [modulepath](http://docs.puppetlabs.com/learning/modules1.html#modules).

# Configuration

There is one class (`openshift_origin`) that needs to be declared on all nodes managing
any component of OpenShift Origin. These nodes are configured using the parameters of
this class.

## Using Parameterized Classes

[Using Parameterized Classes](http://docs.puppetlabs.com/guides/parameterized_classes.html)

### Example: Single host (broker+console+node) which uses the Avahi MDNS and mongo Auth plugin:

    class { 'openshift_origin' :
      node_fqdn                  => "${hostname}.${domain}",
      cloud_domain               => 'openshift.local',
      dns_servers                => ['8.8.8.8'],
      os_unmanaged_users         => [],
      enable_network_services    => true,
      configure_firewall         => true,
      configure_ntp              => true,
      configure_activemq         => true,
      configure_mongodb          => true,
      configure_named            => false,
      configure_avahi            => true,
      configure_broker           => true,
      configure_node             => true,
      development_mode           => true,
      update_network_dns_servers => false,
      avahi_ipaddress            => '127.0.0.1',
      broker_dns_plugin          => 'avahi',
    }

### Example: Single host (broker+console+node) which uses the **Kerberos** Auth plugin and GSS-TSIG.

    class { 'openshift_origin' :
      node_fqdn                  => "${hostname}.${domain}",
      cloud_domain               => 'openshift.local',
      dns_servers                => ['8.8.8.8'],
      os_unmanaged_users         => [],
      enable_network_services    => true,
      configure_firewall         => true,
      configure_ntp              => true,
      configure_activemq         => true,
      configure_mongodb          => true,
      configure_named            => false,
      configure_avahi            => true,
      configure_broker           => true,
      configure_node             => true,
      development_mode           => true,
      broker_auth_plugin         => 'kerberos',
      broker_dns_plugin          => 'nsupdate',
      broker_dns_gsstsig         => true,
      http_kerberos_keytab       => '/etc/http.keytab',
      dns_kerberos_keytab        => '/etc/dns.keytab'
      kerberos_realm             => 'EXAMPLE.COM',
      kerberos_service           => $node_fqdn,
    }

Please note:

* The Broker needs to be enrolled in the KDC as a host, `host/node_fqdn` as well as a service, `HTTP/node_fqdn`
* Keytab should be generated, is located on the Broker machine, and Apache should be able to access it (`chown apache <kerberos_keytab>`)
* Like the example config below:
  * set `broker_auth_plugin` to `'kerberos'`
  * set `http_kerberos_keytab` and `dns_kerberos_keytab` to the absolute file location of the keytab
  * set `kerberos_realm` to the kerberos realm that the Broker host is enrolled with
  * set `kerberos_service` to the FQDN of the enrolled kerberos service, e.g. `node_fqdn`
* After setup, to test:
  * authentication: `kinit <user>` then `curl -Ik --negotiate -u : <node_fqdn>`
  * GSS-TSIG (should return `nil`):
    `$ cd /var/www/openshift/broker`
    `$ bundle --local`
    `$ rails console`
    `$ d = OpenShift::DnsService.instance`
    `$ d.register_application "appname", "namespace", "node_fqdn"`
    `=> nil`
* For any errors, on the Broker, check `/var/log/openshift/broker/httpd/error_log`.

# Parameters

The following lists all the class parameters the `openshift_origin` class accepts.

### node_fqdn

The FQDN for this host

### create_origin_yum_repos

True if OpenShift Origin dependencies and OpenShift Origin nightly yum repositories should be created on this node.

### install_client_tools

True if OpenShift Client tools be installed on this node.

### enable_network_services

True if all support services be enabled. False if they are enabled by other classes in your catalog.

### configure_firewall

True if firewall should be configured for this node (Will blow away any existing configuration)

### configure_ntp

True if NTP should be configured on this node. False if ntp is configured by other classes in your catalog.

### configure_activemq

True if ActiveMQ should be installed and configured on this node (Used by m-collective)

### configure_qpid

True if Qpid message broker should be installed and configured on this node. (Optionally, used by m-collective. Replaced ActiveMQ)

### configure_mongodb

Set to true to setup mongo (This will start mongod). Set to 'delayed' to setup mongo upon next boot.

### configure_named

True if a Bind server should be configured and run on this node.

### configure_avahi

True if a Avahi server should be configured and run on this node. (This is an alternative to named. Only one should be enabled)

### configure_broker

True if an OpenShift Origin broker should be installed and configured on this node.

### configure_console

True if an OpenShift Origin console should be installed and configured on this node.

### configure_node

True if an OpenShift Origin node should be installed and configured on this node.

### set_sebooleans

Set to true to setup selinux booleans. Set to 'delayed' to setup selinux booleans upon next boot.

### install_repo

The YUM repository to use when installing OpenShift Origin packages. Specify `nightlies` to pull latest nightly
build or provide a URL for another YUM repository.

### named_ipaddress

IP Address of DNS Bind server (If running on a different node)

### avahi_ipaddress

IP Address of Avahi MDNS server (If running on a different node)

### mongodb_fqdn

FQDN of node running the MongoDB server (If running on a different node)

### mq_fqdn

FQDN of node running the message queue (ActiveMQ or Qpid) server (If running on a different node)

### broker_fqdn

FQDN of node running the OpenShift OpenShift broker server (If running on a different node)

### cloud_domain

DNS suffix for applications running on this PaaS. Eg. `cloud.example.com` applications will be
`<app>-<namespace>.cloud.example.com`

### dns_servers

Array of DNS servers to use when configuring named forwarding. Defaults to `['8.8.8.8', '8.8.4.4']`

### configure_fs_quotas

Enables quotas on the local node. Applicable only to OpenShift OpenShift Nodes.  If this setting is set to false, it is expected
that Quotas are configured elsewhere in the Puppet catalog

### console_session_secret

Secret used for signing Rails sessions.

### oo_device

Device on which gears are stored (`/var/lib/openshift`)

### oo_mount

Base mount point for `/var/lib/openshift directory`

### configure_cgroups

Enables cgoups on the local node. Applicable only to OpenShift OpenShift Nodes. If this setting is set to false, it is expected
that cgroups are configured elsewhere in the Puppet catalog

### configure_pam

Updates PAM settings on the local node to secure gear logins. Applicable only to OpenShift OpenShift Nodes. If this setting is
set to false, it is expected that cgroups are configured elsewhere in the Puppet catalog

### broker_auth_plugin

The authentication plugin to use with the OpenShift OpenShift Broker. Supported values are `'mongo'`,
`'basic-auth'`, and `'kerberos'`

### broker_auth_pub_key

Public key used to authenticate communication between node and broker. If left blank, this file is auto generated.

### broker_auth_priv_key

Private key used to authenticate communication between node and broker. If `broker_auth_pub_key` is left blank, this
file is auto generated.

### broker_auth_key_password

Password for `broker_auth_priv_key` private key

### broker_auth_salt

Salt used to generate authentication tokens for communication between node and broker.

### broker_session_secret

Secret used for signing Rails sessions.

### kerberos_keytab

The full/absolute path to the Kerberos keytab for the Broker service, e.g. `'/var/www/openshift/broker/http/conf.d/http.keytab'`.

### kerberos_realm

The hostname in all caps that the Broker host/service is enrolled with, e.g. `'EXAMPLE.COM'`

### kerberos_service

The fully-qualified domain name that the service is enrolled with in your Kerberos setup. Do not include `HTTP/`, just the fqdn, e.g. `'example.com'` or just `$node_fqdn`.

### broker_rsync_key

RSync Key used during move gear admin operations

### mq_provider

Message queue plugin to configure for mcollecitve. Defaults to `'activemq'` Acceptable values are
`'activemq'`, `'stomp'` and `'qpid'`

### mq_server_user

User to authenticate against message queue server

### mq_server_password

Password to authenticate against message queue server

### mongo_auth_user

User to authenticate against Mongo DB server

### mongo_db_name

name of the MongoDB database

### mongo_auth_password

Password to authenticate against Mongo DB server

### named_tsig_priv_key

TSIG signature to authenticate against the Bind DNS server.

### os_unmanaged_users

List of users with UID which should not be managed by OpenShift. (By default OpenShift Origin PAM will reserve all
UID's > 500 and prevent user logins)

### update_network_dns_servers

True if Bind DNS server specified in `named_ipaddress` should be added as first DNS server for application name.
resolution. (This should be false if using Avahi for MDNS updates)

### development_mode

Set to true to enable development mode and detailed logging

# Known Issues

## Facter

Facter broken on Fedora 17. http://projects.puppetlabs.com/issues/15001

    yumrepo { 'puppetlabs-products':
      name     => 'puppetlabs-products',
      descr    => 'Puppet Labs Products Fedora 17 - $basearch',
      baseurl  => 'http://yum.puppetlabs.com/fedora/f17/dependencies/\$basearch',
      gpgkey   => 'http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs',
      enabled  => 1,
      gpgcheck => 1,
    }

    yumrepo { 'puppetlabs-deps':
      name     => 'puppetlabs-deps',
      descr    => 'Puppet Labs Dependencies Fedora 17 - $basearch',
      baseurl  => 'http://yum.puppetlabs.com/fedora/f17/products/\$basearch',
      gpgkey   => 'http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs',
      enabled  => 1,
      gpgcheck => 1,
    }

    package { 'facter':
      ensure  => latest,
      require => [Yumrepo['puppetlabs-products'],Yumrepo['puppetlabs-deps']],
    }


text:
Clazz.declarePackage ("J.adapter.readers.quantum");
Clazz.load (["J.adapter.readers.quantum.MOReader", "java.util.Hashtable", "JU.List"], "J.adapter.readers.quantum.PsiReader", ["java.lang.Float", "JU.AU", "$.PT", "J.api.JmolAdapter", "J.util.Logger"], function () {
c$ = Clazz.decorateAsClass (function () {
this.atomNames = null;
this.shellsByUniqueAtom = null;
this.uniqueAtomMap = null;
Clazz.instantialize (this, arguments);
}, J.adapter.readers.quantum, "PsiReader", J.adapter.readers.quantum.MOReader);
Clazz.prepareFields (c$, function () {
this.atomNames =  new JU.List ();
this.shellsByUniqueAtom =  new JU.List ();
this.uniqueAtomMap =  new java.util.Hashtable ();
});
$_V(c$, "checkLine",
function () {
if (this.line.indexOf ("-Geometry after Center-of-Mass shift and reorientation (a.u.):") >= 0) {
this.readAtoms (true);
this.doProcessLines = true;
return true;
}if (this.line.indexOf ("-Unique atoms in the canonical coordinate system (a.u.):") >= 0) {
this.readUniqueAtoms ();
this.doProcessLines = true;
return true;
}if (!this.doProcessLines) return true;
if (this.line.indexOf ("New Cartesian Geometry in a.u.") >= 0) {
this.readAtoms (false);
return true;
}if (this.line.startsWith ("  label        = ")) {
this.moData.put ("calculationType", this.calculationType = this.line.substring (17).trim ());
return true;
}if (this.line.startsWith ("molecular orbitals for ")) {
this.moData.put ("energyUnits", "");
return true;
}if (this.line.startsWith ("  -BASIS SETS:")) {
this.readBasis ();
return true;
}if (this.line.indexOf ("Molecular Orbital Coefficients") >= 0) {
if (this.filterMO ()) this.readPsiMolecularOrbitals ();
return true;
}if (this.line.indexOf ("SCF total energy   =") >= 0) {
this.readSCFDone ();
return true;
}if (this.line.indexOf ("Normal Modes") >= 0) {
this.readFrequencies ();
return true;
}return this.checkNboLine ();
});
$_M(c$, "readSCFDone",
($fz = function () {
this.atomSetCollection.setAtomSetName (this.line);
}, $fz.isPrivate = true, $fz));
$_M(c$, "readAtoms",
($fz = function (isInitial) {
if (isInitial) {
this.atomSetCollection.newAtomSet ();
this.atomSetCollection.setAtomSetName ("");
this.discardLinesUntilContains ("----");
}var atomPt = 0;
while (this.readLine () != null && this.line.length > 0) {
var tokens = this.getTokens ();
var atom = (isInitial ? this.atomSetCollection.addNewAtom () : this.atomSetCollection.getAtom (atomPt++));
if (isInitial) {
this.atomNames.addLast (tokens[0]);
if (tokens[0].length <= 2) atom.elementNumber = J.api.JmolAdapter.getElementNumber (tokens[0]);
} else {
atom.elementNumber = this.parseIntStr (tokens[0]);
}if (atom.elementNumber < 0) atom.elementNumber = 0;
this.setAtomCoordXYZ (atom, this.parseFloatStr (tokens[1]) * 0.5291772, this.parseFloatStr (tokens[2]) * 0.5291772, this.parseFloatStr (tokens[3]) * 0.5291772);
}
}, $fz.isPrivate = true, $fz), "~B");
$_M(c$, "readBasis",
function () {
var gdata =  new JU.List ();
this.gaussianCount = 0;
this.shellCount = 0;
var tokens;
var slater = null;
var slatersByUniqueAtom = null;
this.readLine ();
while (this.readLine () != null && this.line.startsWith ("   -Basis set on")) {
slatersByUniqueAtom =  new JU.List ();
var nGaussians = 0;
while (this.readLine () != null && !this.line.startsWith ("       )")) {
this.line = this.line.$replace ('(', ' ').$replace (')', ' ');
tokens = this.getTokens ();
var ipt = 0;
switch (tokens.length) {
case 3:
if (slater != null) {
slatersByUniqueAtom.addLast (slater);
}ipt = 1;
slater =  Clazz.newIntArray (3, 0);
slater[0] = J.api.JmolAdapter.getQuantumShellTagID (tokens[0]);
slater[1] = this.gaussianCount;
this.shellCount++;
break;
case 2:
break;
}
nGaussians++;
gdata.addLast ([tokens[ipt], tokens[ipt + 1]]);
slater[2] = nGaussians;
}
if (slater != null) {
slatersByUniqueAtom.addLast (slater);
}this.shellsByUniqueAtom.addLast (slatersByUniqueAtom);
this.gaussianCount += nGaussians;
this.readLine ();
}
var garray = JU.AU.newFloat2 (this.gaussianCount);
for (var i = 0; i < this.gaussianCount; i++) {
tokens = gdata.get (i);
garray[i] =  Clazz.newFloatArray (tokens.length, 0);
for (var j = 0; j < tokens.length; j++) garray[i][j] = this.parseFloatStr (tokens[j]);

}
this.moData.put ("gaussians", garray);
if (J.util.Logger.debugging) {
J.util.Logger.debug (this.shellCount + " slater shells read");
J.util.Logger.debug (this.gaussianCount + " gaussian primitives read");
}});
$_M(c$, "readUniqueAtoms",
($fz = function () {
var sdata =  new JU.List ();
this.discardLinesUntilContains ("----");
var n = 0;
while (this.readLine () != null && this.line.length > 0) {
var tokens = this.getTokens ();
this.uniqueAtomMap.put (tokens[0], Integer.$valueOf (n++));
}
var atomCount = this.atomNames.size ();
for (var i = 0; i < atomCount; i++) {
var atomType = this.atomNames.get (i);
var iUnique = this.uniqueAtomMap.get (atomType).intValue ();
var slaters = this.shellsByUniqueAtom.get (iUnique);
if (slaters == null) {
J.util.Logger.error ("slater for atom " + i + " atomType " + atomType + " was not found in listing. Ignoring molecular orbitals");
return;
}for (var j = 0; j < slaters.size (); j++) {
var slater = slaters.get (j);
sdata.addLast ([i, slater[0], slater[1], slater[2]]);
}
}
this.moData.put ("shells", sdata);
}, $fz.isPrivate = true, $fz));
$_M(c$, "readPsiMolecularOrbitals",
function () {
var mos = JU.AU.createArrayOfHashtable (5);
var data = JU.AU.createArrayOfArrayList (5);
var nThisLine = 0;
while (this.readLine () != null && this.line.toUpperCase ().indexOf ("DENS") < 0) {
var tokens = this.getTokens ();
var ptData = (this.line.charAt (5) == ' ' ? 2 : 4);
if (this.line.indexOf ("                    ") == 0) {
this.addMOData (nThisLine, data, mos);
nThisLine = tokens.length;
tokens = J.adapter.smarter.AtomSetCollectionReader.getTokensStr (this.readLine ());
for (var i = 0; i < nThisLine; i++) {
mos[i] =  new java.util.Hashtable ();
data[i] =  new JU.List ();
mos[i].put ("symmetry", tokens[i]);
}
tokens = J.adapter.smarter.AtomSetCollectionReader.getStrings (this.readLine ().substring (21), nThisLine, 10);
for (var i = 0; i < nThisLine; i++) {
mos[i].put ("energy", Float.$valueOf (JU.PT.fVal (tokens[i])));
}
continue;
}try {
for (var i = 0; i < nThisLine; i++) {
data[i].addLast (tokens[i + ptData]);
}
} catch (e) {
if (Clazz.exceptionOf (e, Exception)) {
J.util.Logger.error ("Error reading Psi3 file molecular orbitals at line: " + this.line);
break;
} else {
throw e;
}
}
}
this.addMOData (nThisLine, data, mos);
this.moData.put ("mos", this.orbitals);
this.finalizeMOData (this.moData);
});
$_M(c$, "readFrequencies",
($fz = function () {
this.readLine ();
var atomCount = this.atomSetCollection.getLastAtomSetAtomCount ();
var tokens;
while (this.readLine () != null && this.line.indexOf ("Frequency") >= 0) {
tokens = this.getTokens ();
var iAtom0 = this.atomSetCollection.getAtomCount ();
var ignore =  Clazz.newBooleanArray (1, false);
if (!this.doGetVibration (++this.vibrationNumber)) continue;
this.atomSetCollection.cloneLastAtomSet ();
this.atomSetCollection.setAtomSetFrequency (null, null, tokens[1], null);
this.readLines (2);
this.fillFrequencyData (iAtom0, atomCount, atomCount, ignore, true, 0, 0, null, 0);
this.readLine ();
}
}, $fz.isPrivate = true, $fz));
});


text:
class DispParamMarshaler
{
public:
    DispParamMarshaler()
    {
        LIMITED_METHOD_CONTRACT;
    }

    virtual ~DispParamMarshaler()
    {
        LIMITED_METHOD_CONTRACT;
    }

    virtual BOOL RequiresManagedCleanup();
    virtual void MarshalNativeToManaged(VARIANT *pSrcVar, OBJECTREF *pDestObj);
    virtual void MarshalManagedToNative(OBJECTREF *pSrcObj, VARIANT *pDestVar);
    virtual void MarshalManagedToNativeRef(OBJECTREF *pSrcObj, VARIANT *pRefVar);
    virtual void CleanUpManaged(OBJECTREF *pObj);
};

class DispParamCurrencyMarshaler : public DispParamMarshaler
{
public:
    DispParamCurrencyMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual ~DispParamCurrencyMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual void MarshalManagedToNative(OBJECTREF *pSrcObj, VARIANT *pDestVar);
};

class DispParamOleColorMarshaler : public DispParamMarshaler
{
public:
    DispParamOleColorMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual ~DispParamOleColorMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual void MarshalNativeToManaged(VARIANT *pSrcVar, OBJECTREF *pDestObj);
    virtual void MarshalManagedToNative(OBJECTREF *pSrcObj, VARIANT *pDestVar);
    virtual void MarshalManagedToNativeRef(OBJECTREF *pSrcObj, VARIANT *pRefVar);
};

class DispParamErrorMarshaler : public DispParamMarshaler
{
public:
    DispParamErrorMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual ~DispParamErrorMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual void MarshalManagedToNative(OBJECTREF *pSrcObj, VARIANT *pDestVar);
};

class DispParamInterfaceMarshaler : public DispParamMarshaler
{
public:
    DispParamInterfaceMarshaler(BOOL bDispatch, MethodTable* pIntfMT, MethodTable *pClassMT, BOOL bClassIsHint) :
    m_bDispatch(bDispatch),
    m_pIntfMT(pIntfMT),
    m_pClassMT(pClassMT),
    m_bClassIsHint(bClassIsHint)
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual ~DispParamInterfaceMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual void MarshalNativeToManaged(VARIANT *pSrcVar, OBJECTREF *pDestObj);
    virtual void MarshalManagedToNative(OBJECTREF *pSrcObj, VARIANT *pDestVar);

private:
    // if return type is an interface, then the method table of the interface is cached here.
    // we need to cache this and use it when we call GetCOMIPFromObjectRef
    MethodTable*            m_pIntfMT;
    MethodTable*            m_pClassMT;
    BOOL                    m_bDispatch;
    BOOL                    m_bClassIsHint;
};

#ifdef FEATURE_CLASSIC_COMINTEROP
class DispParamArrayMarshaler : public DispParamMarshaler
{
public:
    DispParamArrayMarshaler(VARTYPE ElementVT, MethodTable *pElementMT) :
    m_ElementVT(ElementVT),
    m_pElementMT(pElementMT)
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual ~DispParamArrayMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual void MarshalNativeToManaged(VARIANT *pSrcVar, OBJECTREF *pDestObj);
    virtual void MarshalManagedToNative(OBJECTREF *pSrcObj, VARIANT *pDestVar);
    virtual void MarshalManagedToNativeRef(OBJECTREF *pSrcObj, VARIANT *pDestVar);

private:
    VARTYPE                 m_ElementVT;
    MethodTable*            m_pElementMT;
};
#endif // FEATURE_CLASSIC_COMINTEROP

class DispParamRecordMarshaler : public DispParamMarshaler
{
public:
    DispParamRecordMarshaler(MethodTable *pRecordMT) :
    m_pRecordMT(pRecordMT)
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual ~DispParamRecordMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual void MarshalNativeToManaged(VARIANT *pSrcVar, OBJECTREF *pDestObj);
    virtual void MarshalManagedToNative(OBJECTREF *pSrcObj, VARIANT *pDestVar);

private:
    MethodTable*            m_pRecordMT;
};

class DispParamDelegateMarshaler : public DispParamMarshaler
{
public:
    DispParamDelegateMarshaler(MethodTable *pDelegateMT) :
	m_pDelegateMT(pDelegateMT)
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual ~DispParamDelegateMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual void MarshalNativeToManaged(VARIANT *pSrcVar, OBJECTREF *pDestObj);
    virtual void MarshalManagedToNative(OBJECTREF *pSrcObj, VARIANT *pDestVar);

private:
	MethodTable*			m_pDelegateMT;
};

class DispParamCustomMarshaler : public DispParamMarshaler
{
public:
    DispParamCustomMarshaler(CustomMarshalerHelper *pCMHelper, VARTYPE vt) :
    m_pCMHelper(pCMHelper),
    m_vt(vt)
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual ~DispParamCustomMarshaler()
    {
        WRAPPER_NO_CONTRACT;
    }

    virtual BOOL RequiresManagedCleanup();
    virtual void MarshalNativeToManaged(VARIANT *pSrcVar, OBJECTREF *pDestObj);
    virtual void MarshalManagedToNative(OBJECTREF *pSrcObj, VARIANT *pDestVar);
    virtual void MarshalManagedToNativeRef(OBJECTREF *pSrcObj, VARIANT *pRefVar);
    virtual void CleanUpManaged(OBJECTREF *pObj);

private:
    CustomMarshalerHelper*  m_pCMHelper;
    VARTYPE                 m_vt;
};

#endif //#ifndef CROSSGEN_COMPILE
#endif // _DISPPARAMMARSHALER_H