text:
package com.twitter.finagle.redis.integration

import com.twitter.conversions.DurationOps._
import com.twitter.finagle.redis.RedisClientTest
import com.twitter.finagle.redis.tags.{ClientTest, RedisTest}
import com.twitter.finagle.redis.util.BufToString
import com.twitter.io.Buf
import com.twitter.util.Await

final class HashClientIntegrationSuite extends RedisClientTest {

  val TIMEOUT = 5.seconds

  test("Correctly perform hash set and get commands", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hSet(bufFoo, bufBar, bufBaz), TIMEOUT)

      assert(BufToString(Await.result(client.hGet(bufFoo, bufBar), TIMEOUT).get) == "baz")
      assert(Await.result(client.hGet(bufFoo, bufBoo), TIMEOUT) == None)
      assert(Await.result(client.hGet(bufBar, bufBaz), TIMEOUT) == None)
    }
  }

  test("Correctly perform hash set and get an empty value", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hSet(bufFoo, bufBar, Buf.Empty), TIMEOUT)
      assert(BufToString(Await.result(client.hGet(bufFoo, bufBar), TIMEOUT).get) == "")
    }
  }

  test("Correctly perform hash and field exists", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hSet(bufFoo, bufBar, bufBaz), TIMEOUT)
      assert(Await.result(client.hExists(bufFoo, bufBar), TIMEOUT) == true)
      assert(Await.result(client.hExists(bufFoo, bufBaz), TIMEOUT) == false)
    }
  }

  test("Correctly delete a single field", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hSet(bufFoo, bufBar, bufBaz), TIMEOUT)
      assert(Await.result(client.hDel(bufFoo, Seq(bufBar)), TIMEOUT) == 1)
      assert(Await.result(client.hDel(bufFoo, Seq(bufBaz)), TIMEOUT) == 0)
    }
  }

  test("Correctly delete multiple fields", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hSet(bufFoo, bufBar, bufBaz), TIMEOUT)
      Await.result(client.hSet(bufFoo, bufBoo, bufMoo), TIMEOUT)
      assert(Await.result(client.hDel(bufFoo, Seq(bufBar, bufBoo)), TIMEOUT) == 2)
    }
  }

  test("Correctly get multiple values", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hSet(bufFoo, bufBar, bufBaz), TIMEOUT)
      Await.result(client.hSet(bufFoo, bufBoo, bufMoo), TIMEOUT)
      val result = Await.result(client.hMGet(bufFoo, Seq(bufBar, bufBoo)), TIMEOUT).toList

      assert(result.map(Buf.Utf8.unapply).flatten == Seq("baz", "moo"))
    }
  }

  test("Correctly set multiple values", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hMSet(bufFoo, Map(bufBaz -> bufBar, bufMoo -> bufBoo)), TIMEOUT)
      val result = Await.result(client.hMGet(bufFoo, Seq(bufBaz, bufMoo)), TIMEOUT).toList

      assert(result.map(Buf.Utf8.unapply).flatten == Seq("bar", "boo"))
    }
  }

  ignore("Correctly merge lkeys with destination and set expiry", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hMSet(bufFoo, Map(bufBaz -> bufBar)), TIMEOUT)
      Await.result(client.pExpire(bufFoo, 10000), TIMEOUT)
      var result = Await.result(client.hMGet(bufFoo, Seq(bufBaz)), TIMEOUT).toList
      var ttl = Await.result(client.pTtl(bufFoo), TIMEOUT).get
      assert(result.map(Buf.Utf8.unapply).flatten == Seq("bar"))
      assert(ttl > 0)

      Await.result(client.hMergeEx(bufFoo, Map(bufBaz -> bufBoo, bufMoo -> bufBoo), 90000), TIMEOUT)
      result = Await.result(client.hMGet(bufFoo, Seq(bufBaz, bufMoo)), TIMEOUT).toList
      ttl = Await.result(client.pTtl(bufFoo), TIMEOUT).get
      assert(result.map(Buf.Utf8.unapply).flatten == Seq("bar", "boo")) //baz's value is unchanged
      assert(ttl > 10000 && ttl < 90000) // ttl is updated only if a field was added
    }
  }

  ignore("Correctly merge lkeys with destination without expiry", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hMSet(bufFoo, Map(bufBaz -> bufBar)), TIMEOUT)
      var result = Await.result(client.hMGet(bufFoo, Seq(bufBaz)), TIMEOUT).toList
      assert(result.map(Buf.Utf8.unapply).flatten == Seq("bar"))

      Await.result(client.hMergeEx(bufFoo, Map(bufBaz -> bufBoo, bufMoo -> bufBoo), -1), TIMEOUT)
      result = Await.result(client.hMGet(bufFoo, Seq(bufBaz, bufMoo)), TIMEOUT).toList
      var ttl = Await.result(client.pTtl(bufFoo), TIMEOUT).get
      assert(ttl == -1)
      assert(result.map(Buf.Utf8.unapply).flatten == Seq("bar", "boo")) //baz's value is unchanged
    }
  }

  ignore("TTL updated on merge only if a field was added.", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hMSet(bufFoo, Map(bufBaz -> bufBar)), TIMEOUT)
      Await.result(client.pExpire(bufFoo, 10000), TIMEOUT)
      var result = Await.result(client.hMGet(bufFoo, Seq(bufBaz)), TIMEOUT).toList
      var ttl = Await.result(client.pTtl(bufFoo), TIMEOUT).get

      assert(result.map(Buf.Utf8.unapply).flatten == Seq("bar"))
      assert(ttl > 0 && ttl < 10000)

      Await.result(client.hMergeEx(bufFoo, Map(bufBaz -> bufMoo, bufMoo -> bufBoo), 90000), TIMEOUT)
      result = Await.result(client.hMGet(bufFoo, Seq(bufBaz, bufMoo)), TIMEOUT).toList
      ttl = Await.result(client.pTtl(bufFoo), TIMEOUT).get
      assert(result.map(Buf.Utf8.unapply).flatten == Seq("bar", "boo")) // only boo is added
      assert(ttl > 10000 && ttl < 90000) // ttl updated.
    }
  }

  test(
    "Correctly set multiple values one of which is an empty string value",
    RedisTest,
    ClientTest
  ) {
    withRedisClient { client =>
      Await.result(client.hMSet(bufFoo, Map(bufBaz -> bufBar, bufMoo -> Buf.Empty)), TIMEOUT)
      val result = Await.result(client.hMGet(bufFoo, Seq(bufBaz, bufMoo)), TIMEOUT).toList

      assert(result.map(Buf.Utf8.unapply).flatten == Seq("bar", ""))
    }
  }

  test("Correctly get multiple values at once", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hSet(bufFoo, bufBar, bufBaz), TIMEOUT)
      Await.result(client.hSet(bufFoo, bufBoo, bufMoo), TIMEOUT)
      val result = Await.result(client.hGetAll(bufFoo), TIMEOUT)

      assert(
        result.map({ case (a, b) => Buf.Utf8.unapply(a).get -> Buf.Utf8.unapply(b).get }) ==
          Seq(("bar", "baz"), ("boo", "moo"))
      )
    }
  }

  test("Correctly get multiple values including one empty string", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hSet(bufFoo, bufBar, Buf.Empty), TIMEOUT)
      Await.result(client.hSet(bufFoo, bufBoo, bufMoo), TIMEOUT)
      val result = Await.result(client.hGetAll(bufFoo), TIMEOUT)

      assert(result == Seq(bufBar -> Buf.Utf8(""), bufBoo -> bufMoo))
    }
  }

  test("Correctly increment a value", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hIncrBy(bufFoo, bufNum, 4L), TIMEOUT)
      assert(Await.result(client.hGet(bufFoo, bufNum), TIMEOUT) == Some(Buf.Utf8(4L.toString)))
      Await.result(client.hIncrBy(bufFoo, bufNum, 4L), TIMEOUT)
      assert(Await.result(client.hGet(bufFoo, bufNum), TIMEOUT) == Some(Buf.Utf8(8L.toString)))
    }
  }

  test("Correctly do a setnx", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hDel(bufFoo, Seq(bufBar)))
      assert(Await.result(client.hSetNx(bufFoo, bufBar, bufBaz), TIMEOUT) == 1)
      assert(Await.result(client.hSetNx(bufFoo, bufBar, bufMoo), TIMEOUT) == 0)
      assert(BufToString(Await.result(client.hGet(bufFoo, bufBar), TIMEOUT).get) == "baz")
    }
  }

  test("Correctly get all the values", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.dels(Seq(bufFoo)), TIMEOUT)
      Await.result(client.hMSet(bufFoo, Map(bufBaz -> bufBar, bufMoo -> bufBoo)), TIMEOUT)
      assert(Await.result(client.hVals(bufFoo), TIMEOUT).map(BufToString(_)) == Seq("bar", "boo"))
    }
  }

  test("Correctly count fields", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hMSet(bufFoo, Map(bufBaz -> bufBar, bufMoo -> bufBoo)), TIMEOUT)
      assert(Await.result(client.hLen(bufFoo), TIMEOUT) == 2)
      Await.result(client.hDel(bufFoo, Seq(bufBaz)), TIMEOUT)
      assert(Await.result(client.hLen(bufFoo), TIMEOUT) == 1)
      assert(Await.result(client.hLen(bufBoo), TIMEOUT) == 0)
    }
  }

  test("Correctly perform an hscan operation", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hSet(bufFoo, bufBar, bufBaz), TIMEOUT)
      Await.result(client.hSet(bufFoo, bufBoo, bufMoo), TIMEOUT)

      val res = Await.result(client.hScan(bufFoo, 0L, None, None), TIMEOUT)
      val resList = res.flatMap(Buf.Utf8.unapply)
      assert(resList == Seq("0", "bar", "baz", "boo", "moo"))

      val withCount = Await.result(client.hScan(bufFoo, 0L, Some(2L), None), TIMEOUT)
      val withCountList = withCount.flatMap(Buf.Utf8.unapply)
      assert(withCountList == Seq("0", "bar", "baz", "boo", "moo"))

      val pattern = Buf.Utf8("bo*")
      val withPattern = Await.result(client.hScan(bufFoo, 0L, None, Some(pattern)), TIMEOUT)
      val withMatchList = withPattern.flatMap(Buf.Utf8.unapply)
      assert(withMatchList == Seq("0", "boo", "moo"))
    }
  }

  test("Correctly get the length of values of a field", RedisTest, ClientTest) {
    withRedisClient { client =>
      Await.result(client.hSet(bufFoo, bufBar, bufBaz), TIMEOUT)
      Await.result(client.hSet(bufFoo, bufBoo, Buf.U32LE(12)), TIMEOUT)
      Await.result(client.hSet(bufFoo, bufMoo, Buf.Empty), TIMEOUT)

      val res1 = Await.result(client.hStrlen(bufFoo, bufBar), TIMEOUT)
      assert(res1 == 3)

      val res2 = Await.result(client.hStrlen(bufFoo, bufBoo), TIMEOUT)
      assert(res2 == 4)

      val res3 = Await.result(client.hStrlen(bufFoo, bufMoo), TIMEOUT)
      assert(res3 == 0)
    }
  }
}


text:
#region Using

using System;
using SharpFont.Internal;

#endregion

namespace SharpFont
{
    /// <summary>
    /// This structure models the metrics of a bitmap strike (i.e., a set of
    /// glyphs for a given point size and resolution) in a bitmap font. It is
    /// used for the <see cref="Face.AvailableSizes" /> field of
    /// <see cref="Face" />.
    /// </summary>
    /// <remarks>
    ///     <para>
    ///     Windows FNT: The nominal size given in a FNT font is not reliable. Thus
    ///     when the driver finds it incorrect, it sets 'size' to some calculated
    ///     values and sets 'x_ppem' and 'y_ppem' to the pixel width and height
    ///     given in the font, respectively.
    ///     </para>
    ///     <para>
    ///     TrueType embedded bitmaps: 'size', 'width', and 'height' values are not
    ///     contained in the bitmap strike itself. They are computed from the
    ///     global font parameters.
    ///     </para>
    /// </remarks>
    public sealed class BitmapSize
    {
        #region Fields

        private IntPtr reference;
        private BitmapSizeRec rec;

        #endregion

        #region Constructors

        internal BitmapSize(IntPtr reference)
        {
            Reference = reference;
        }

        internal BitmapSize(BitmapSizeRec bmpSizeInt)
        {
            rec = bmpSizeInt;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets the vertical distance, in pixels, between two consecutive
        /// baselines. It is always positive.
        /// </summary>
        public short Height
        {
            get => rec.height;
        }

        /// <summary>
        /// Gets the average width, in pixels, of all glyphs in the strike.
        /// </summary>
        public short Width
        {
            get => rec.width;
        }

        /// <summary>
        /// Gets the nominal size of the strike in 26.6 fractional points. This
        /// field is not very useful.
        /// </summary>
        public Fixed26Dot6 Size
        {
            get => Fixed26Dot6.FromRawValue((int) rec.size);
        }

        /// <summary>
        /// Gets the horizontal ppem (nominal width) in 26.6 fractional pixels.
        /// </summary>
        public Fixed26Dot6 NominalWidth
        {
            get => Fixed26Dot6.FromRawValue((int) rec.x_ppem);
        }

        /// <summary>
        /// Gets the vertical ppem (nominal height) in 26.6 fractional pixels.
        /// </summary>
        public Fixed26Dot6 NominalHeight
        {
            get => Fixed26Dot6.FromRawValue((int) rec.y_ppem);
        }

        internal IntPtr Reference
        {
            get => reference;

            set
            {
                reference = value;
                rec = PInvokeHelper.PtrToStructure<BitmapSizeRec>(reference);
            }
        }

        #endregion
    }
}

redpajama_set_name: RedPajamaGithub


text:
import connect from './connect'
import { createStore } from './store'

let flux = {
  decorate: connect
}

export function initializeStore(store = createStore()) {
  flux = { ...store, decorate: connect }
}

export function bindActions(actions) {
  return Object.keys(actions).reduce((boundActions, k) => ({
    ...boundActions,
    [k]: (...args) => flux.dispatch(actions[k](...args))
  }), {})
}

export const getFlux = () => flux


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starters</artifactId>
		<version>${revision}</version>
	</parent>
	<artifactId>spring-boot-starter-jdbc</artifactId>
	<name>Spring Boot JDBC Starter</name>
	<description>Starter for using JDBC with the HikariCP connection pool</description>
	<properties>
		<main.basedir>${basedir}/../../..</main.basedir>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>com.zaxxer</groupId>
			<artifactId>HikariCP</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
		</dependency>
	</dependencies>
</project>


text:
<template bindable="context">
  <form  class="col-md-6">

        Name
        <input class="form-control" id="name" value.bind="context.myCurrentEntity.name" disabled.bind="!context.myCurrentEntity.__vGridKey">

        Number
        <input  class="form-control" id="Number" value.bind="context.myCurrentEntity.number" disabled.bind="!context.myCurrentEntity.__vGridKey">

        Date
        <input  class="form-control" id="Date" value.bind="context.myCurrentEntity.date" disabled.bind="!context.myCurrentEntity.__vGridKey">

          <input type="checkbox" checked.bind="context.myCurrentEntity.bool" disabled.bind="!context.myCurrentEntity.__vGridKey"> Bool

    <input type="checkbox" checked.bind="context.showButtonsForm" />show buttons
  </form>
</template>


text:
namespace com {
namespace amazonaws {
namespace kinesis {
namespace video {
namespace webrtcclient {

// This comes from Producer-C, but is not exported. We are copying it here instead of making it part of the public API.
// It *MAY* become de-synchronized. If you hit issues after updating Producer-C confirm these two structs are in sync
typedef struct {
    AwsCredentialProvider credentialProvider;
    PAwsCredentials pAwsCredentials;
} StaticCredentialProvider, *PStaticCredentialProvider;

STATUS createRtpPacketWithSeqNum(UINT16 seqNum, PRtpPacket* ppRtpPacket);

class WebRtcClientTestBase : public ::testing::Test {
  public:
    PUINT32 mExpectedFrameSizeArr;
    PBYTE* mPExpectedFrameArr;
    UINT32 mExpectedFrameCount;
    PUINT32 mExpectedDroppedFrameTimestampArr;
    UINT32 mExpectedDroppedFrameCount;
    PRtpPacket* mPRtpPackets;
    UINT32 mRtpPacketCount;
    SIGNALING_CLIENT_HANDLE mSignalingClientHandle;

    WebRtcClientTestBase();

    PCHAR getAccessKey()
    {
        return mAccessKey;
    }

    PCHAR getSecretKey()
    {
        return mSecretKey;
    }

    PCHAR getSessionToken()
    {
        return mSessionToken;
    }

    VOID initializeSignalingClientStructs()
    {
        mTags[0].version = TAG_CURRENT_VERSION;
        mTags[0].name = (PCHAR) "Tag Name 0";
        mTags[0].value = (PCHAR) "Tag Value 0";
        mTags[1].version = TAG_CURRENT_VERSION;
        mTags[1].name = (PCHAR) "Tag Name 1";
        mTags[1].value = (PCHAR) "Tag Value 1";
        mTags[2].version = TAG_CURRENT_VERSION;
        mTags[2].name = (PCHAR) "Tag Name 2";
        mTags[2].value = (PCHAR) "Tag Value 2";

        mSignalingClientCallbacks.version = SIGNALING_CLIENT_CALLBACKS_CURRENT_VERSION;
        mSignalingClientCallbacks.customData = (UINT64) this;
        mSignalingClientCallbacks.messageReceivedFn = NULL;
        mSignalingClientCallbacks.errorReportFn = NULL;
        mSignalingClientCallbacks.stateChangeFn = NULL;
        mSignalingClientCallbacks.getCurrentTimeFn = NULL;

        mClientInfo.version = SIGNALING_CLIENT_INFO_CURRENT_VERSION;
        mClientInfo.loggingLevel = LOG_LEVEL_VERBOSE;
        mClientInfo.cacheFilePath = NULL; // Use the default path
        STRCPY(mClientInfo.clientId, TEST_SIGNALING_MASTER_CLIENT_ID);

        mClientInfo.signalingRetryStrategyCallbacks.createRetryStrategyFn = createRetryStrategyFn;
        mClientInfo.signalingRetryStrategyCallbacks.getCurrentRetryAttemptNumberFn = getCurrentRetryAttemptNumberFn;
        mClientInfo.signalingRetryStrategyCallbacks.freeRetryStrategyFn = freeRetryStrategyFn;
        mClientInfo.signalingRetryStrategyCallbacks.executeRetryStrategyFn = executeRetryStrategyFn;
        mClientInfo.signalingClientCreationMaxRetryAttempts = 0;

        MEMSET(&mChannelInfo, 0x00, SIZEOF(mChannelInfo));
        mChannelInfo.version = CHANNEL_INFO_CURRENT_VERSION;
        mChannelInfo.pChannelName = mChannelName;
        mChannelInfo.pKmsKeyId = NULL;
        mChannelInfo.tagCount = 3;
        mChannelInfo.pTags = mTags;
        mChannelInfo.channelType = SIGNALING_CHANNEL_TYPE_SINGLE_MASTER;
        mChannelInfo.channelRoleType = SIGNALING_CHANNEL_ROLE_TYPE_MASTER;
        mChannelInfo.cachingPolicy = SIGNALING_API_CALL_CACHE_TYPE_NONE;
        mChannelInfo.cachingPeriod = 0;
        mChannelInfo.retry = TRUE;
        mChannelInfo.reconnect = TRUE;
        mChannelInfo.pCertPath = mCaCertPath;
        mChannelInfo.messageTtl = TEST_SIGNALING_MESSAGE_TTL;
        if ((mChannelInfo.pRegion = getenv(DEFAULT_REGION_ENV_VAR)) == NULL) {
            mChannelInfo.pRegion = (PCHAR) TEST_DEFAULT_REGION;
        }
    }

    STATUS initializeSignalingClient(PAwsCredentialProvider pCredentialProvider = NULL)
    {
        STATUS retStatus;

        initializeSignalingClientStructs();

        retStatus = createSignalingClientSync(&mClientInfo, &mChannelInfo, &mSignalingClientCallbacks,
                                              pCredentialProvider != NULL ? pCredentialProvider : mTestCredentialProvider, &mSignalingClientHandle);

        if (mAccessKeyIdSet) {
            EXPECT_EQ(STATUS_SUCCESS, retStatus);
        } else {
            mSignalingClientHandle = INVALID_SIGNALING_CLIENT_HANDLE_VALUE;
            EXPECT_NE(STATUS_SUCCESS, retStatus);
        }

        retStatus = signalingClientFetchSync(mSignalingClientHandle);

        return retStatus;
    }

    STATUS deinitializeSignalingClient()
    {
        // Delete the created channel
        if (mAccessKeyIdSet) {
            deleteChannelLws(FROM_SIGNALING_CLIENT_HANDLE(mSignalingClientHandle), 0);
        }

        EXPECT_EQ(STATUS_SUCCESS, freeSignalingClient(&mSignalingClientHandle));

        return STATUS_SUCCESS;
    }

    static STATUS testFrameReadyFunc(UINT64 customData, UINT16 startIndex, UINT16 endIndex, UINT32 frameSize)
    {
        WebRtcClientTestBase* base = (WebRtcClientTestBase*) customData;
        UINT32 filledSize;
        EXPECT_GT(base->mExpectedFrameCount, base->mReadyFrameIndex);
        EXPECT_EQ(base->mExpectedFrameSizeArr[base->mReadyFrameIndex], frameSize);
        if (base->mFrame != NULL) {
            MEMFREE(base->mFrame);
            base->mFrame = NULL;
        }
        base->mFrame = (PBYTE) MEMALLOC(frameSize);
        EXPECT_EQ(STATUS_SUCCESS, jitterBufferFillFrameData(base->mJitterBuffer, base->mFrame, frameSize, &filledSize, startIndex, endIndex));
        EXPECT_EQ(frameSize, filledSize);
        EXPECT_EQ(0, MEMCMP(base->mPExpectedFrameArr[base->mReadyFrameIndex], base->mFrame, frameSize));
        base->mReadyFrameIndex++;
        return STATUS_SUCCESS;
    }

    static STATUS testFrameDroppedFunc(UINT64 customData, UINT16 startIndex, UINT16 endIndex, UINT32 timestamp)
    {
        UNUSED_PARAM(startIndex);
        UNUSED_PARAM(endIndex);
        auto* base = (WebRtcClientTestBase*) customData;
        EXPECT_GT(base->mExpectedDroppedFrameCount, base->mDroppedFrameIndex);
        EXPECT_EQ(base->mExpectedDroppedFrameTimestampArr[base->mDroppedFrameIndex], timestamp);
        base->mDroppedFrameIndex++;
        return STATUS_SUCCESS;
    }

    static STATUS testDepayRtpFunc(PBYTE payload, UINT32 payloadLength, PBYTE outBuffer, PUINT32 pBufferSize, PBOOL pIsStart)
    {
        ENTERS();
        STATUS retStatus = STATUS_SUCCESS;
        UINT32 bufferSize = 0;
        BOOL sizeCalculationOnly = (outBuffer == NULL);

        UNUSED_PARAM(pIsStart);
        CHK(payload != NULL && pBufferSize != NULL, STATUS_NULL_ARG);
        CHK(payloadLength > 0, retStatus);

        bufferSize = payloadLength;

        // Only return size if given buffer is NULL
        CHK(!sizeCalculationOnly, retStatus);
        CHK(payloadLength <= *pBufferSize, STATUS_BUFFER_TOO_SMALL);

        MEMCPY(outBuffer, payload, payloadLength);

    CleanUp:
        if (STATUS_FAILED(retStatus) && sizeCalculationOnly) {
            bufferSize = 0;
        }

        if (pBufferSize != NULL) {
            *pBufferSize = bufferSize;
        }

        if (pIsStart != NULL) {
            *pIsStart = (payload[payloadLength] != 0);
        }

        LEAVES();
        return retStatus;
    }

    static STATUS createRetryStrategyFn(PKvsRetryStrategy pKvsRetryStrategy)
    {
        STATUS retStatus = STATUS_SUCCESS;
        PExponentialBackoffRetryStrategyState pExponentialBackoffRetryStrategyState = NULL;

        CHK_STATUS(exponentialBackoffRetryStrategyCreate(pKvsRetryStrategy));
        CHK(pKvsRetryStrategy->retryStrategyType == KVS_RETRY_STRATEGY_EXPONENTIAL_BACKOFF_WAIT, STATUS_INTERNAL_ERROR);

        pExponentialBackoffRetryStrategyState = TO_EXPONENTIAL_BACKOFF_STATE(pKvsRetryStrategy->pRetryStrategy);

        // Overwrite retry config to avoid slow long running tests
        pExponentialBackoffRetryStrategyState->exponentialBackoffRetryStrategyConfig.retryFactorTime = HUNDREDS_OF_NANOS_IN_A_MILLISECOND * 5;
        pExponentialBackoffRetryStrategyState->exponentialBackoffRetryStrategyConfig.maxRetryWaitTime = HUNDREDS_OF_NANOS_IN_A_MILLISECOND * 75;

    CleanUp:
        return retStatus;
    }

    static STATUS getCurrentRetryAttemptNumberFn(PKvsRetryStrategy pKvsRetryStrategy, PUINT32 pRetryCount)
    {
        return getExponentialBackoffRetryCount(pKvsRetryStrategy, pRetryCount);
    }

    static STATUS freeRetryStrategyFn(PKvsRetryStrategy pKvsRetryStrategy)
    {
        return exponentialBackoffRetryStrategyFree(pKvsRetryStrategy);
    }

    static STATUS executeRetryStrategyFn(PKvsRetryStrategy pKvsRetryStrategy, PUINT64 retryWaitTime)
    {
        return getExponentialBackoffRetryStrategyWaitTime(pKvsRetryStrategy, retryWaitTime);
    }

    STATUS readFrameData(PBYTE pFrame, PUINT32 pSize, UINT32 index, PCHAR frameFilePath)
    {
        STATUS retStatus = STATUS_SUCCESS;
        CHAR filePath[MAX_PATH_LEN + 1];
        UINT64 size = 0;

        CHK(pFrame != NULL && pSize != NULL, STATUS_NULL_ARG);

        SNPRINTF(filePath, MAX_PATH_LEN, "%s/frame-%04d.h264", frameFilePath, index);

        // Get the size and read into frame
        CHK_STATUS(readFile(filePath, TRUE, NULL, &size));
        CHK_STATUS(readFile(filePath, TRUE, pFrame, &size));

        *pSize = (UINT32) size;

    CleanUp:

        return retStatus;
    }

    bool connectTwoPeers(PRtcPeerConnection offerPc, PRtcPeerConnection answerPc, PCHAR pOfferCertFingerprint = NULL,
                         PCHAR pAnswerCertFingerprint = NULL);
    void addTrackToPeerConnection(PRtcPeerConnection pRtcPeerConnection, PRtcMediaStreamTrack track, PRtcRtpTransceiver* transceiver, RTC_CODEC codec,
                                  MEDIA_STREAM_TRACK_KIND kind);
    void getIceServers(PRtcConfiguration pRtcConfiguration);

  protected:
    virtual void SetUp();
    virtual void TearDown();
    PCHAR GetTestName();
    VOID initializeJitterBuffer(UINT32, UINT32, UINT32);
    VOID clearJitterBufferForTest();
    VOID setPayloadToFree();

    PAwsCredentialProvider mTestCredentialProvider;

    PCHAR mAccessKey;
    PCHAR mSecretKey;
    PCHAR mSessionToken;
    PCHAR mRegion;
    PCHAR mCaCertPath;
    UINT64 mStreamingRotationPeriod;
    UINT32 mLogLevel;

    SIZE_T stateChangeCount[RTC_PEER_CONNECTION_TOTAL_STATE_COUNT] = {0};

    CHAR mDefaultRegion[MAX_REGION_NAME_LEN + 1];
    BOOL mAccessKeyIdSet;
    CHAR mChannelName[MAX_CHANNEL_NAME_LEN + 1];

    PJitterBuffer mJitterBuffer;
    PBYTE mFrame;
    UINT32 mReadyFrameIndex;
    UINT32 mDroppedFrameIndex;

    ChannelInfo mChannelInfo;
    SignalingClientCallbacks mSignalingClientCallbacks;
    SignalingClientInfo mClientInfo;
    Tag mTags[3];
};

} // namespace webrtcclient
} // namespace video
} // namespace kinesis
} // namespace amazonaws
} // namespace com


text:
<?php

namespace XApi\LrsBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;

/**
 * @author Christian Flothmann <christian.flothmann@xabbuh.de>
 */
final class XApiLrsExtension extends Extension
{
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

        $loader->load('controller.xml');
        $loader->load('event_listener.xml');
        $loader->load('factory.xml');
        $loader->load('serializer.xml');

        switch ($config['type']) {
            case 'in_memory':
                break;
            case 'mongodb':
                $loader->load('doctrine.xml');
                $loader->load('mongodb.xml');

                $container->setAlias('xapi_lrs.doctrine.object_manager', $config['object_manager_service']);
                $container->setAlias('xapi_lrs.repository.statement', 'xapi_lrs.repository.statement.doctrine');
                break;
            case 'orm':
                $loader->load('doctrine.xml');
                $loader->load('orm.xml');

                $container->setAlias('xapi_lrs.doctrine.object_manager', $config['object_manager_service']);
                $container->setAlias('xapi_lrs.repository.statement', 'xapi_lrs.repository.statement.doctrine');
                break;
        }
    }

    public function getAlias()
    {
        return 'xapi_lrs';
    }
}


text:
layout          : blocks/page-participant
title           : Steven van der Baan
type            : participant
time            : vacation
travel-from     : Cambridge
expenses        : owasp
funded          : yes
funded-who      : Summit Budget
flight-cost     : 0
ticket-cost     : 1500
funded-amount   : 1500
required-funds  : 1500
project-leader  : Development Guide, CTF
chapter-leader  : Cambridge
job-title       : Security Consultant
image           : https://pbs.twimg.com/profile_images/2150492060/P7310595_400x400.JPG
email           : steven@vdbaan.net
linkedin        : vdbaan
twitter         : vdbaan
facebook        :
status          : done
ticket          : 5x24h
regonline       : No
working-sessions:
---

At that time I will just have changed employers, and my new employer has granted me the time to attend (although it will only be my second week)

### OWASP Contributions

* [OWASP Cambridge Chapter Leader](https://www.owasp.org/index.php/Cambridge)
* [OWASP AppSec Europe 2014 Conference team member](https://2014.appsec.eu)
* [OWASP Capture the Flag Project](https://www.owasp.org/index.php/Category:OWASP_CTF_Project)
* [OWASP Developers Guide Leader](https://www.owasp.org/index.php/OWASP_Guide_Project)


text:
title: "Getting Started"
menu:
  main:
    weight: 0
---

## Document overview

The Prepaid Utility Interface is intended to facilitate transactions between retailers on the one side and providers of prepaid services for utilities (such as electricity, water and gas) on the other. The service takes the form of an HTTP-based RESTful interface and is released under the Apache 2.0 license.

This service is aimed at two groups of users: a) a retailer wishing to develop a point-of-sale client application to access the Electrum Prepaid Utility Service, or b) a prepaid utility service provider or aggregator wishing to develop a server application to integrate directly with the Electrum service. If you fall into one of these categories, then this is the solution for you!

Basics of the connection protocol are described in [Protocol Basics](/protocol-basics); some specifics related to the transaction messaging are presented in [Advanced Topics](/advanced-topics); details of the business process behind prepaid utility transactions can be found under [Transaction Flows](/transaction-flows); jargon is demystified in the [Terminology](/terminology) section.

The full interface specification is found [here](/specification/introduction), including definitions of all resources, operations and data types.

## Supported languages

### Java
The Electrum implementation of the API is written in Java. If are planning a Java implementation, then simply include the [Prepaid Utility Interface](https://github.com/electrumpayments/prepaidutility-service-interface) Maven dependency to your project. Further instructions can be found in the project [README](https://github.com/electrumpayments/prepaidutility-service-interface).

### Other languages
Should you wish your implementation to be in a language other than Java, the interface is described as a [Swagger (OpenApi) document](/specification/swagger). This can be used in conjunction with the widely available [Swagger](http://swagger.io/) tooling to generate a project in your preferred language.


text:
/**
 * Contains that the {@link me.moodcat.backend.rooms.RoomBackend}
 * that uses instances like {@link me.moodcat.backend.rooms.RoomInstance}
 * and {@link me.moodcat.backend.rooms.SongInstance}.
 */
package me.moodcat.backend.rooms;


text:
package xyz.lgvalle.tddpersistence;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.Arrays;
import java.util.List;

import xyz.lgvalle.tddpersistence.db.TaskReaderDbHelper;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static xyz.lgvalle.tddpersistence.TaskRepositoryTest.TaskBuilder.aTask;

@RunWith(AndroidJUnit4.class)
public class PersistabilityTest {
    private TaskRepository taskRepository;

    List<TestBuilder<Task>> persistentObjectBuilders = Arrays.<TestBuilder<Task>>asList(
            aTask().withName("A task").withExpirationDate("2017-03-16"),
            aTask().withName("A task (with date in the past)").withExpirationDate("2017-01-01")

    );
    private TaskDBStorage storage;

    @Before
    public void setUp() throws Exception {
        Context appContext = InstrumentationRegistry.getTargetContext();

        TaskReaderDbHelper dbHelper = new TaskReaderDbHelper(appContext);
        storage = new TaskDBStorage(dbHelper);
        TaskMapper mapper = new TaskMapper();

        taskRepository = new TaskRepository(mapper, storage);

        DatabaseCleaner cleaner = new DatabaseCleaner(dbHelper);
        cleaner.clean();

    }

    @Test
    public void roundTripsPersistentObjects() {
        for (TestBuilder builder : persistentObjectBuilders) {
            assertCanBePersisted(builder);
        }
    }

    private void assertCanBePersisted(TestBuilder<Task> builder) {
        assertReloadsWithSameStateAs(persistedObjectFrom(builder));
    }

    private void assertReloadsWithSameStateAs(Task original) {
        Task savedTask = taskRepository.taskWithName(original.getName());

        // Without reflection this can fail:
        // If a new field is added to the object without including it on the equals method and it is wrongly mapped this matcher won't pick it up.
        assertThat(savedTask, equalTo(original));
    }

    private Task persistedObjectFrom(TestBuilder<Task> builder) {
        Task original = builder.build();

        taskRepository.persistTask(original);
        return original;
    }

}


text:
worker_processes 2

app_path = "/var/www/Sakura"
working_directory "#{app_path}/current"
pid "#{app_path}/current/tmp/pids/unicorn.pid"

listen "/tmp/sakura.sock"

stderr_path "log/unicorn.stderr.log"
stdout_path "log/unicorn.stdout.log"


text:
import ctypes
import utils.exceptions as exceptions
from utils.utils import _call
from libvhd import ListHead

class VHDUtilCheckOptions(ctypes.Structure):
    _fields_ = [
        ('ignore_footer', ctypes.c_char),
        ('ignore_parent_uuid', ctypes.c_char),
        ('ignore_timestamps', ctypes.c_char),
        ('check_data', ctypes.c_char),
        ('no_check_bat', ctypes.c_char),
        ('collect_stats', ctypes.c_char)]

class VHDUtilCheckStats(ctypes.Structure):
    _fields_ = [
        ('name', ctypes.c_char_p),
        ('bitmap', ctypes.c_char_p),
        ('secs_total', ctypes.c_uint64),
        ('secs_allocated', ctypes.c_uint64),
        ('secs_written', ctypes.c_uint64),
        ('next', ListHead)]

class VHDUtilCheckCtx(ctypes.Structure):
    _fields_ = [
        ('opts', VHDUtilCheckOptions),
        ('stats', ListHead),
        ('primary_footer_missing', ctypes.c_int)]

def coalesce(name, output=None, ancestor=None, step_parent=None, sparse=False):
    """Coalesce the VHD given by 'name'.
    Exactly one of 'output', 'ancestor', or 'step_parent' is required.
    """
    if name is None:
        raise exceptions.VHDUtilMissingArgument("'name' must be specified")

    def _f(x, y):
        if y:
            return x + 1
        else:
            return x

    c = reduce(_f, [output, ancestor, step_parent], 0)

    if c != 1:
        raise exceptions.VHDUtilMutuallyExclusiveArguments(
            "Exactly one of 'output', 'ancestor', or 'step_parent' is required.")

    sparse_i = 0
    if sparse:
        sparse_i = 1

    ret = None
    if output:
        ret = _call('vhd_util_coalesce_out',
                    ctypes.c_char_p(name), ctypes.c_char_p(output),
                    ctypes.c_int(sparse_i), ctypes.c_int(0))
    elif ancestor:
        ret = _call('vhd_util_coalesce_ancestor',
                    ctypes.c_char_p(name), ctypes.c_char_p(ancestor),
                    ctypes.c_int(sparse_i), ctypes.c_int(0))
    elif step_parent:
        ret = _call('vhd_util_coalesce_parent',
                    ctypes.c_char_p(name), ctypes.c_int(sparse_i),
                    ctypes.c_int(0), ctypes.c_char_p(step_parent))

    if ret != 0:
        raise exceptions.VHDUtilCoalesceError(errcode=ret.value)

def _set_bool_opt(obj, attr, bool_val):
    val = 1 if bool_val else 0
    setattr(obj, attr, ctypes.c_char(chr(val)))

def check(name, ignore_missing_primary_footers=False, ignore_parent_uuids=False,
          ignore_timestamps=False, skip_bat_overlap_check=False,
          check_parents=False, check_bitmaps=False):

    if name is None:
        raise exceptions.VHDUtilMissingArgument("'name' must be specified")

    if skip_bat_overlap_check and check_bitmaps:
        raise exceptions.VHDUtilMutuallyExclusiveArguments(
            "Cannot specify 'check_bitmaps' as True when "
            "'no_bat_overlap_check' is also True")

    o = VHDUtilCheckOptions()
    _set_bool_opt(o, 'ignore_footer', ignore_missing_primary_footers)
    _set_bool_opt(o, 'ignore_parent_uuid', ignore_parent_uuids)
    _set_bool_opt(o, 'ignore_timestamps', ignore_timestamps)
    _set_bool_opt(o, 'check_data', check_bitmaps)
    _set_bool_opt(o, 'no_check_bat', skip_bat_overlap_check)
    _set_bool_opt(o, 'collect_stats', False)

    list_head = ListHead()
    setattr(list_head, 'next', ctypes.pointer(list_head))
    setattr(list_head, 'prev', ctypes.pointer(list_head))

    vhd_check_ctx = VHDUtilCheckCtx()
    setattr(vhd_check_ctx, 'opts', o)
    setattr(vhd_check_ctx, 'stats', list_head)

    ret = _call('vhd_util_check_vhd',
                ctypes.pointer(vhd_check_ctx),
                ctypes.c_char_p(name))

    if ret == 0:
        if check_parents:
            ret = _call('vhd_util_check_parents',
                        ctypes.pointer(vhd_check_ctx),
                        ctypes.c_char_p(name))

    if ret != 0:
        raise exceptions.VHDUtilCheckError(errcode=ret.value)


text:
<?php
class Lib_Test_Partner_FieldsToNullTest extends Lib_Test_TestAbstractPartner
{
	public function getTestName()
	{
		return 'FieldsToNull';
	}

	protected function _run()
	{
//		//Used for sample fieldsToNull from file fieldsToNull.php
//		$LEADID = '00QA0000001QSQl';
//
//		// TODO Create lead
//		$leadid = $LEADID;
//		$query = "select id, title, firstname, lastname from lead where id = '$leadid'";
//
//		$queryResponse = $this->_mySforceConnection->query($query);
//		$queryResult = new QueryResult($queryResponse);
//		echo "***** Initial query response *****\n";
//		print_r($queryResult);
//
//		$sObject = new SObject();
//		$sObject->fieldsToNull = array (
//			"Title", "FirstName"
//		);
//		$sObject->type = 'Lead';
//		$sObject->Id = $leadid;
//		$updateResponse = $this->_mySforceConnection->update(array ($sObject));
//
//		echo "***** Updated object with fields to null *****\n";
//		print_r($updateResponse);
//
//		$queryResponse = $this->_mySforceConnection->query($query);
//		$queryResult = new QueryResult($queryResponse);
//		echo "***** Final query response *****\n";
//		print_r($queryResult);
		$sObject = new SObject();

		$fields = array(
			'FirstName' => 'Mary',
			'LastName' => 'Jane',
			'Phone' => '510-555-5555'
		);

		$sObject->fields = $fields;
		$sObject->type = 'Contact';

		$createResponse = $this->_mySforceConnection->create(array($sObject));

		$retrieveResult= $this->_mySforceConnection->retrieve("FirstName, LastName, Phone", "Contact", $createResponse->id);
		echo "***** Before fieldsToNull\r\n";
		print_r($retrieveResult);

		$sObject = new SObject();
		$fields = array(
			'fieldsToNull' => 'Phone',
			'Id' => $createResponse->id
		);
		$sObject->fields = $fields;
		$sObject->type = 'Contact';

		$updateResult = $this->_mySforceConnection->update(array($sObject));

		$queryResult = $this->_mySforceConnection->retrieve("FirstName, LastName, Phone", "Contact", $createResponse->id);
		echo "***** After fieldsToNull\r\n";
		print_r($queryResult);
	}
}


text:
using RegulatedNoise.Enums_and_Utility_Classes;

namespace RegulatedNoise
{
    public partial class HelpCommodities : RNBaseForm
    {
        public HelpCommodities()
        {
            InitializeComponent();
        }
    }
}


text:
/**
* Contains classes for the built-in Barcode4J component.
*

*
The Barcode4J Component

* This component relies on the Barcode4J library (http://barcode4j.sourceforge.net).
*

* Unlike the Barbecue barcode component, there is only one component per Barcode4J
* barcode type. All the barcode's components derive from a base type which defines its
* common attributes.
*

* All barcodes in this library include a code expression, which provides the textual data to
* be encoded in the barcode, and an optional expression that provides a pattern to be
* applied on the message displayed in the barcode. Delayed evaluation of the barcode can
* be configured using the two evaluation attributes and works in the same way as for
* Barbecue barcodes.
*

* Several optional barcode rendering attributes can be set:
*

*
orientation - specifies how the barcode and any accompanying text are to be
* oriented when rendered. There are 4 possible values:
*

*
0 - indicates that the barcode is to be rendered in the default orientation
* (which for linear barcodes is with vertical bars arranged from left to right)

*
90 - indicates that the barcode is to be rotated anti-clockwise by 90 degrees

*
180 - indicates that the barcode is to be rotated anti-clockwise by 180 degrees

*
270 - indicates that the barcode is to be rotated anti-clockwise by 270 degrees

*

*
moduleWidth - specifies the width (in pixels) of the thinnest bar/module.

*
textPosition - Sets the placement of the human-readable barcode message. It has
* three possible values: none - meaning no human-readable message, and
* bottom and top.
*

* Note that the message and barcode are oriented together as a unit, so if the orientation
* is set to 180 and the text position to top, the code appears reversed and the text
* appears upside down beneath the image.

*
quietZone - Specifies the width of the quiet zone (in pixels).

*
verticalQuietZone - Specifies the height of the vertical quiet zone (in pixels).

*

* Concrete barcode types extend the base type by adding further attributes supported by the specific symboloy:
*

*
Codabar barcodes have a wideFactor attribute that specifies the factor between the
* width of wide bars and the width of narrow bars.

*
Code128 barcodes do not have any specific attributes.

*
EAN128, EAN13, EAN8, UPCA and UPCE barcodes have a checksumMode
* attribute which indicates how the check digit is to be handled. The attribute accepts
* four values:
*

*
add - adds the checksum to the data;

*
check - indicates that the data should already contain a checksum;

*
ignore - doesn't expect or add a checksum to the data;

*
auto - attempts to detect whether a checksum is already present in the
* data or one should be added.

*

*
Data Matrix barcodes can be configured to render as a square or rectangle by the
* shape attribute.

*
Code39 barcodes have a checksumMode attribute, a displayChecksum
* attribute that controls whether the human-readable message shows the checksum
* character, a displayStartStop attribute which decides whether start/stop
* characters are to be displayed in the human-readable message,
* extendedCharSetEnabled to indicate that the barcode can display characters
* from the entire 7-bit ASCII set, intercharGapWidth to control the width between
* the characters and a wideFactor attribute.

*
Interleaved2Of5 barcodes can specify checksumMode, displayChecksum and
* wideFactor attributes with the same meanings as in Code39 barcodes.

*
RoyalMailCustomer and USPSIntelligentMail barcodes have a checksumMode
* attribute, an intercharGapWidth attribute, an ascenderHeight attribute which
* sets the length of the bar ascender/descender, and a trackHeight attribute which
* provides the height of the barcode track.

*
POSTNET barcodes can specify checksumMode, displayChecksum and
* intercharGapWidth attributes, plus shortBarHeight for setting the height of
* the short bar, and baselinePosition which can be top or bottom
* to indicate how bars should align.

*
PDF417 barcode can control the number of columns and rows with the
* minColumns, maxColumns, minRows, maxRows and
* widthToHeightRatio attributes. The error correction level can be set using the
* errorCorrectionLevel attribute.

*

* The object model for the barcode components uses
* {@link net.sf.jasperreports.components.barcode4j.BarcodeComponent BarcodeComponent}
* as base class and concrete classes for each barcode type.
*

* When a report that contains barcodes is filled, the data and attributes of the barcode are
* collected into an object and passed to an image producer whose responsibility is to create
* a renderer for the barcode. The image producer implements the
* {@link net.sf.jasperreports.components.barcode4j.BarcodeImageProducer BarcodeImageProducer}
* interface. As for Barbecue barcode elements, the resulting images have the size of the
* design barcode element and use RetainShape as scale type.
*

* Determining which image producer to use for a barcode component element relies on
* custom properties defined at the element, report and global levels. The
* net.sf.jasperreports.components.barcode4j.image.producer property can
* have a value of the name of the class that implements the image producer interface or an
* alias that has been set for such a class, using a property of the form
* net.sf.jasperreports.components.barcode4j.image.producer.<alias>.
* JasperReports has two barcode image producer implementations: one which renders the
* barcode in SVG format and one which renders the barcode as a rasterized image. The
* first implementation is registered under the svg alias and is used by default;
* the second one has image as alias and can be used by changing the
* net.sf.jasperreports.components.barcode4j.image.producer.<alias>
* property at any level.
*

* The SVG barcode image producer uses the Barcode4J API to export the barcode to SVG,
* then it creates an SVG renderer based on the Batik SVG library. Hence, this option
* introduces a dependency on Batik for viewing or exporting a report that includes
* barcodes.
*

* The rasterized image producer draws the barcode on a PNG image which can be then
* displayed in the generated report. This producer uses further properties, set at the same
* levels as the image producer property, to allow the customization of the generated image.
*

*/
package net.sf.jasperreports.components.barcode4j;


text:
\problemname{Elementary Math}

\illustration{.35}{elementarymath.jpg}{Example exam by Ellen}%
Ellen is teaching elementary math to her students and the time for the final exam has
come. The exam consists of $n$ questions. In each question the students have to
add ($+$), subtract ($-$) or multiply ($*$) a pair of numbers.

Ellen has already chosen the $n$ pairs of numbers. All that remains is to decide
for each pair which of the three possible operations the students should perform.
To avoid students getting bored, Ellen wants to make sure that the $n$ correct answers
to her exam are all different.

Please help Ellen finish constructing the exam by automating this task.

\section*{Input}

The input consists of:
\begin{itemize}
   \item one line with one integer $n$ ($1\leq n \leq 2\,500$), the number of pairs of numbers;
   \item $n$ lines each with two integers $a$ and $b$ ($-10^6 \leq a, b \leq 10^6$), a pair of numbers used.
\end{itemize}

\section*{Output}

For each pair of numbers $(a,b)$ in the same order as in the input,
output a line containing a valid equation.
Each equation should consist of five parts: $a$, one of the three operators, $b$,
an equals sign ($=$), and the result of the expression.
All the $n$ expression results must be different.

If there are multiple valid answers you may output any of them.
If there is no valid answer, output a single line with the string ``\texttt{impossible}'' instead.


text:
package com.cisco.oss.foundation.directory;

import com.cisco.oss.foundation.directory.entity.ServiceInstance;

public class DefaultNotificationHandler implements NotificationHandler {

    @Override
    public void serviceInstanceAvailable(ServiceInstance service) {
        System.out.println("[" + service.getServiceName()+"] - "+service.getInstanceId() +": created!");
    }

    @Override
    public void serviceInstanceUnavailable(ServiceInstance service) {
        System.out.println("[" + service.getServiceName()+"] - "+service.getInstanceId() +": unavailable!");
    }

    @Override
    public void serviceInstanceChange(ServiceInstance service) {
        System.out.println("[" + service.getServiceName()+"] - "+service.getInstanceId() +": change!");
    }

}


text:
package top.myetl.lucenerdd

import com.holdenkarau.spark.testing.SharedSparkContext
import org.apache.lucene.document.{Document, Field, IntPoint, StringField}
import org.apache.lucene.search.ScoreDoc
import org.scalatest.{BeforeAndAfterEach, FlatSpec, Ignore, Matchers}
import top.myetl.lucenerdd.convert.{BeanToDoc, DocToBean}
import top.myetl.lucenerdd.query.MyQuery
import top.myetl.lucenerdd.util.{Constants, LuceneRDDKryoRegistrator}

/**
  * Created by pengda on 17/1/12.
  */
class LuceneWriteTest extends FlatSpec
  with Matchers
  with BeforeAndAfterEach
  with SharedSparkContext {

  override def beforeAll(): Unit = {
    conf.set(Constants.HdfsBaseDirKey, "hdfs://ubuntu:9000/sparklu/")
    conf.setAppName("test2app")

    LuceneRDDKryoRegistrator.registerKryoClasses(conf)
    super.beforeAll()
  }

  "write record to lucene " should "write lucene index file to hdfs" in {

    val data = Seq("Person1", "Person2", "Person3", "Person4", "Person5", "Person6")

    val convert = new BeanToDoc[String] {
      override def toDoc(t: String): Document =  {
        val doc = new Document
        doc.add(new StringField("name", t, Field.Store.YES))
        doc
      }
    }
    val rdd = sc.parallelize(data, 3)

    val luceneRdd = rdd.saveToLucene("w1")(convert)
    println("run ........"+luceneRdd.run())
  }

  "query" should "query from lucene index" in {

    val convert = new DocToBean[String] {
      override def toBean(score: ScoreDoc, doc: Document): String = {
        println("--------------- to bean -----------")
        doc.get("name")
      }
    }

    val rdd = sc.luceneRDD("w1")(convert)
    val rdd2 = rdd.query(MyQuery.term("name", "Person1"))
    println("---------------")
    println("-------- count ------"+rdd2.count())
  }

}


text:
class DropdownMenuController  {

  /**
   * Constructor
   *
   * @param $log
   */
  constructor($mdDialog, $rootScope, $scope) {
    var originatorEv;

    this.openMenu = function($mdMenu, ev) {
      originatorEv = ev;
      $mdMenu.open(ev);
    };
    this.redial = function () {
      $rootScope.$broadcast('editProj', this.selected);
    };
    this.delete = function () {
      $rootScope.$broadcast('deleteProject', this.selected, this.users);
    };

    $scope.$on('hideBtn', angular.bind(this, function(event, taskName, description){
      this.selected = null;
    }));
  }
}
export default DropdownMenuController;


text:
#import "NSNumberExtensions.h"

@implementation NSNumber(CPTExtensions)

/**	@brief Creates and returns an NSNumber object containing a given value, treating it as a CGFloat.
 *	@param number The value for the new number.
 *	@return An NSNumber object containing value, treating it as a CGFloat.
 **/
+(NSNumber *)numberWithCGFloat:(CGFloat)number
{
#if CGFLOAT_IS_DOUBLE
	return [NSNumber numberWithDouble:number];
#else
	return [NSNumber numberWithFloat:number];
#endif
}

/**	@brief Returns the value of the receiver as a CGFloat.
 *	@return The value of the receiver as a CGFloat.
 **/
-(CGFloat)cgFloatValue
{
#if CGFLOAT_IS_DOUBLE
    return [self doubleValue];
#else
    return [self floatValue];
#endif
}

/**	@brief Returns an NSNumber object initialized to contain a given value, treated as a CGFloat.
 *	@param number The value for the new number.
 *	@return An NSNumber object containing value, treating it as a CGFloat.
 **/
-(id)initWithCGFloat:(CGFloat)number
{
#if CGFLOAT_IS_DOUBLE
	return [self initWithDouble:number];
#else
	return [self initWithFloat:number];
#endif
}

/**	@brief Returns the value of the receiver as an NSDecimalNumber.
 *	@return The value of the receiver as an NSDecimalNumber.
 **/
-(NSDecimalNumber *)decimalNumber
{
    if ([self isMemberOfClass:[NSDecimalNumber class]]) {
        return (NSDecimalNumber *)self;
    }
    return [NSDecimalNumber decimalNumberWithDecimal:[self decimalValue]];
}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.kaazing</groupId>
        <artifactId>java.client</artifactId>
        <version>develop-SNAPSHOT</version>
    </parent>

    <groupId>org.kaazing</groupId>
    <artifactId>java.client.apidoc</artifactId>
    <name>Kaazing Java Client - API Documentation</name>
    <version>develop-SNAPSHOT</version>
    <packaging>jar</packaging>

    <url>https://github.com/kaazing/java.client</url>
    <scm>
        <connection>scm:git:${project.scm.url}</connection>
        <developerConnection>scm:git:${project.scm.url}</developerConnection>
        <url>git@github.com:kaazing/java.client.git</url>
    </scm>

    <dependencies>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.client.java</artifactId>
            <version>${project.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>amqp.client.java</artifactId>
            <version>${project.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>net.api</artifactId>
            <version>${project.version}</version>
            <type>jar</type>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <!-- The id "attach-javadocs" is critical. Otherwise, these settings are not applied at release:perform. -->
                        <id>attach-javadocs</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <attach>true</attach>
                            <includeDependencySources>true</includeDependencySources>
                            <excludePackageNames>
                                org.kaazing.gateway.*:org.kaazing.net.impl.*:org.kaazing.net.sse.impl.*:
                                org.kaazing.net.ws.impl.*:org.kaazing.net.sse.impl:org.kaazing.net.ws.impl:*bridge*:*internal*:*impl*
                            </excludePackageNames>
                            <dependencySourceIncludes>
                                <dependencySourceInclude>org.kaazing:net.api</dependencySourceInclude>
                                <dependencySourceInclude>org.kaazing:gateway.client.java</dependencySourceInclude>
                                <dependencySourceInclude>org.kaazing:amqp.client.java</dependencySourceInclude>
                            </dependencySourceIncludes>
                            <overview>${basedir}/src/main/javadoc/overview.html</overview>
                            <windowtitle>Kaazing Java Client API Documentation</windowtitle>
                            <doctitle>"All Classes - API Documentation"</doctitle>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <properties>
        <jgitflow.masterBranchName>master-5.0</jgitflow.masterBranchName>
        <jgitflow.developBranchName>support-5.0</jgitflow.developBranchName>
    </properties>
</project>


text:
#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <elf.h>

#define ElfHeaderSize  (64 * 1024)
#define ElfPages  (ElfHeaderSize / 4096)
#define KERNELBASE (0xc000000000000000)
#define _ALIGN_UP(addr,size)	(((addr)+((size)-1))&(~((size)-1)))

struct addr_range {
	unsigned long long addr;
	unsigned long memsize;
	unsigned long offset;
};

static int check_elf64(void *p, int size, struct addr_range *r)
{
	Elf64_Ehdr *elf64 = p;
	Elf64_Phdr *elf64ph;

	if (elf64->e_ident[EI_MAG0] != ELFMAG0 ||
	    elf64->e_ident[EI_MAG1] != ELFMAG1 ||
	    elf64->e_ident[EI_MAG2] != ELFMAG2 ||
	    elf64->e_ident[EI_MAG3] != ELFMAG3 ||
	    elf64->e_ident[EI_CLASS] != ELFCLASS64 ||
	    elf64->e_ident[EI_DATA] != ELFDATA2MSB ||
	    elf64->e_type != ET_EXEC || elf64->e_machine != EM_PPC64)
		return 0;

	if ((elf64->e_phoff + sizeof(Elf64_Phdr)) > size)
		return 0;

	elf64ph = (Elf64_Phdr *) ((unsigned long)elf64 +
				  (unsigned long)elf64->e_phoff);

	r->memsize = (unsigned long)elf64ph->p_memsz;
	r->offset = (unsigned long)elf64ph->p_offset;
	r->addr = (unsigned long long)elf64ph->p_vaddr;

#ifdef DEBUG
	printf("PPC64 ELF file, ph:\n");
	printf("p_type   0x%08x\n", elf64ph->p_type);
	printf("p_flags  0x%08x\n", elf64ph->p_flags);
	printf("p_offset 0x%016llx\n", elf64ph->p_offset);
	printf("p_vaddr  0x%016llx\n", elf64ph->p_vaddr);
	printf("p_paddr  0x%016llx\n", elf64ph->p_paddr);
	printf("p_filesz 0x%016llx\n", elf64ph->p_filesz);
	printf("p_memsz  0x%016llx\n", elf64ph->p_memsz);
	printf("p_align  0x%016llx\n", elf64ph->p_align);
	printf("... skipping 0x%08lx bytes of ELF header\n",
	       (unsigned long)elf64ph->p_offset);
#endif

	return 64;
}
static void get4k(FILE *file, char *buf )
{
	unsigned j;
	unsigned num = fread(buf, 1, 4096, file);
	for ( j=num; j<4096; ++j )
		buf[j] = 0;
}

static void put4k(FILE *file, char *buf )
{
	fwrite(buf, 1, 4096, file);
}

static void death(const char *msg, FILE *fdesc, const char *fname)
{
	fprintf(stderr, msg);
	fclose(fdesc);
	unlink(fname);
	exit(1);
}

int main(int argc, char **argv)
{
	char inbuf[4096];
	struct addr_range vmlinux;
	FILE *ramDisk;
	FILE *inputVmlinux;
	FILE *outputVmlinux;

	char *rd_name, *lx_name, *out_name;

	size_t i;
	unsigned long ramFileLen;
	unsigned long ramLen;
	unsigned long roundR;
	unsigned long offset_end;

	unsigned long kernelLen;
	unsigned long actualKernelLen;
	unsigned long round;
	unsigned long roundedKernelLen;
	unsigned long ramStartOffs;
	unsigned long ramPages;
	unsigned long roundedKernelPages;
	unsigned long hvReleaseData;
	u_int32_t eyeCatcher = 0xc8a5d9c4;
	unsigned long naca;
	unsigned long xRamDisk;
	unsigned long xRamDiskSize;
	long padPages;

	if (argc < 2) {
		fprintf(stderr, "Name of RAM disk file missing.\n");
		exit(1);
	}
	rd_name = argv[1];

	if (argc < 3) {
		fprintf(stderr, "Name of vmlinux file missing.\n");
		exit(1);
	}
	lx_name = argv[2];

	if (argc < 4) {
		fprintf(stderr, "Name of vmlinux output file missing.\n");
		exit(1);
	}
	out_name = argv[3];

	ramDisk = fopen(rd_name, "r");
	if ( ! ramDisk ) {
		fprintf(stderr, "RAM disk file \"%s\" failed to open.\n", rd_name);
		exit(1);
	}

	inputVmlinux = fopen(lx_name, "r");
	if ( ! inputVmlinux ) {
		fprintf(stderr, "vmlinux file \"%s\" failed to open.\n", lx_name);
		exit(1);
	}

	outputVmlinux = fopen(out_name, "w+");
	if ( ! outputVmlinux ) {
		fprintf(stderr, "output vmlinux file \"%s\" failed to open.\n", out_name);
		exit(1);
	}

	i = fread(inbuf, 1, sizeof(inbuf), inputVmlinux);
	if (i != sizeof(inbuf)) {
		fprintf(stderr, "can not read vmlinux file %s: %u\n", lx_name, i);
		exit(1);
	}

	i = check_elf64(inbuf, sizeof(inbuf), &vmlinux);
	if (i == 0) {
		fprintf(stderr, "You must have a linux kernel specified as argv[2]\n");
		exit(1);
	}

	/* Input Vmlinux file */
	fseek(inputVmlinux, 0, SEEK_END);
	kernelLen = ftell(inputVmlinux);
	fseek(inputVmlinux, 0, SEEK_SET);
	printf("kernel file size = %lu\n", kernelLen);

	actualKernelLen = kernelLen - ElfHeaderSize;

	printf("actual kernel length (minus ELF header) = %lu\n", actualKernelLen);

	round = actualKernelLen % 4096;
	roundedKernelLen = actualKernelLen;
	if ( round )
		roundedKernelLen += (4096 - round);
	printf("Vmlinux length rounded up to a 4k multiple = %ld/0x%lx \n", roundedKernelLen, roundedKernelLen);
	roundedKernelPages = roundedKernelLen / 4096;
	printf("Vmlinux pages to copy = %ld/0x%lx \n", roundedKernelPages, roundedKernelPages);

	offset_end = _ALIGN_UP(vmlinux.memsize, 4096);
	/* calc how many pages we need to insert between the vmlinux and the start of the ram disk */
	padPages = offset_end/4096 - roundedKernelPages;

	/* Check and see if the vmlinux is already larger than _end in System.map */
	if (padPages < 0) {
		/* vmlinux is larger than _end - adjust the offset to the start of the embedded ram disk */
		offset_end = roundedKernelLen;
		printf("vmlinux is larger than _end indicates it needs to be - offset_end = %lx \n", offset_end);
		padPages = 0;
		printf("will insert %lx pages between the vmlinux and the start of the ram disk \n", padPages);
	}
	else {
		/* _end is larger than vmlinux - use the offset to _end that we calculated from the system map */
		printf("vmlinux is smaller than _end indicates is needed - offset_end = %lx \n", offset_end);
		printf("will insert %lx pages between the vmlinux and the start of the ram disk \n", padPages);
	}

	/* Input Ram Disk file */
	// Set the offset that the ram disk will be started at.
	ramStartOffs = offset_end;  /* determined from the input vmlinux file and the system map */
	printf("Ram Disk will start at offset = 0x%lx \n", ramStartOffs);

	fseek(ramDisk, 0, SEEK_END);
	ramFileLen = ftell(ramDisk);
	fseek(ramDisk, 0, SEEK_SET);
	printf("%s file size = %ld/0x%lx \n", rd_name, ramFileLen, ramFileLen);

	ramLen = ramFileLen;

	roundR = 4096 - (ramLen % 4096);
	if ( roundR ) {
		printf("Rounding RAM disk file up to a multiple of 4096, adding %ld/0x%lx \n", roundR, roundR);
		ramLen += roundR;
	}

	printf("Rounded RAM disk size is %ld/0x%lx \n", ramLen, ramLen);
	ramPages = ramLen / 4096;
	printf("RAM disk pages to copy = %ld/0x%lx\n", ramPages, ramPages);

  // Copy 64K ELF header
	for (i=0; i<(ElfPages); ++i) {
		get4k( inputVmlinux, inbuf );
		put4k( outputVmlinux, inbuf );
	}

	/* Copy the vmlinux (as full pages). */
	fseek(inputVmlinux, ElfHeaderSize, SEEK_SET);
	for ( i=0; i<roundedKernelPages; ++i ) {
		get4k( inputVmlinux, inbuf );
		put4k( outputVmlinux, inbuf );
	}

	/* Insert pad pages (if appropriate) that are needed between */
	/* | the end of the vmlinux and the ram disk. */
	for (i=0; i<padPages; ++i) {
		memset(inbuf, 0, 4096);
		put4k(outputVmlinux, inbuf);
	}

	/* Copy the ram disk (as full pages). */
	for ( i=0; i<ramPages; ++i ) {
		get4k( ramDisk, inbuf );
		put4k( outputVmlinux, inbuf );
	}

	/* Close the input files */
	fclose(ramDisk);
	fclose(inputVmlinux);
	/* And flush the written output file */
	fflush(outputVmlinux);

	/* Fixup the new vmlinux to contain the ram disk starting offset (xRamDisk) and the ram disk size (xRamDiskSize) */
	/* fseek to the hvReleaseData pointer */
	fseek(outputVmlinux, ElfHeaderSize + 0x24, SEEK_SET);
	if (fread(&hvReleaseData, 4, 1, outputVmlinux) != 1) {
		death("Could not read hvReleaseData pointer\n", outputVmlinux, out_name);
	}
	hvReleaseData = ntohl(hvReleaseData); /* Convert to native int */
	printf("hvReleaseData is at %08lx\n", hvReleaseData);

	/* fseek to the hvReleaseData */
	fseek(outputVmlinux, ElfHeaderSize + hvReleaseData, SEEK_SET);
	if (fread(inbuf, 0x40, 1, outputVmlinux) != 1) {
		death("Could not read hvReleaseData\n", outputVmlinux, out_name);
	}
	/* Check hvReleaseData sanity */
	if (memcmp(inbuf, &eyeCatcher, 4) != 0) {
		death("hvReleaseData is invalid\n", outputVmlinux, out_name);
	}
	/* Get the naca pointer */
	naca = ntohl(*((u_int32_t*) &inbuf[0x0C])) - KERNELBASE;
	printf("Naca is at offset 0x%lx \n", naca);

	/* fseek to the naca */
	fseek(outputVmlinux, ElfHeaderSize + naca, SEEK_SET);
	if (fread(inbuf, 0x18, 1, outputVmlinux) != 1) {
		death("Could not read naca\n", outputVmlinux, out_name);
	}
	xRamDisk = ntohl(*((u_int32_t *) &inbuf[0x0c]));
	xRamDiskSize = ntohl(*((u_int32_t *) &inbuf[0x14]));
	/* Make sure a RAM disk isn't already present */
	if ((xRamDisk != 0) || (xRamDiskSize != 0)) {
		death("RAM disk is already attached to this kernel\n", outputVmlinux, out_name);
	}
	/* Fill in the values */
	*((u_int32_t *) &inbuf[0x0c]) = htonl(ramStartOffs);
	*((u_int32_t *) &inbuf[0x14]) = htonl(ramPages);

	/* Write out the new naca */
	fflush(outputVmlinux);
	fseek(outputVmlinux, ElfHeaderSize + naca, SEEK_SET);
	if (fwrite(inbuf, 0x18, 1, outputVmlinux) != 1) {
		death("Could not write naca\n", outputVmlinux, out_name);
	}
	printf("Ram Disk of 0x%lx pages is attached to the kernel at offset 0x%08lx\n",
	       ramPages, ramStartOffs);

	/* Done */
	fclose(outputVmlinux);
	/* Set permission to executable */
	chmod(out_name, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);

	return 0;
}


text:
*   Change `order.promotion_credit_exists?` api. Now it receives an adjustment
    originator (PromotionAction instance) instead of a promotion. Allowing
    multiple adjustments being created for the same promotion as the current
    PromotionAction / Promotion api suggests #3262

*   Remove after_save callback for stock items backorders processing and
    fixes count on hand updates when there are backordered units #3066

    *Washington Luiz*

*   InventoryUnit#backordered_for_stock_item no longer returns readonly objects
    neither return an ActiveRecored::Association. It returns only an array of
    writable backordered units for a given stock item #3066

    *Washington Luiz*

*   Scope shipping rates as per shipping method display_on #3119
    e.g. Shipping methods set to back_end only should not be displayed on frontend too

    *Washington Luiz*

*   Add `propagate_all_variants` attribute to StockLocation. It controls
    whether a stock items should be created fot the stock location every time
    a variant or a stock location is created

    *Washington Luiz*

*   Add `backorderable_default` attribute to StockLocation. It sets the
    backorderable attribute of each new stock item

    *Washington Luiz*

*   Removed `t()` override in `Spree::BaseHelper`. #3083

    *Washington Luiz*

*   Improve performance of `Order#payment_required?` by not updating the totals every time. #3040 #3086

    *Washington Luiz*

*   Fixed the FlexiRate Calculator for cases when max_items is set. #3159

    *Dana Jones*

* Translation for admin tabs are now located under the `spree.admin.tab` key. Previously, they were on the top-level, which lead to conflicts when users wanted to override view translations, like this:

```yml
en:
  spree:
    orders:
      show:
        thank_you: "Thanks, buddy!"
```

See #3133 for more information.

    * Ryan Bigg*

* CreditCard model now validates that the card is not expired.

    *Ryan Bigg*

* Payment model will now no longer provide a vague error message for when the source is invalid. Instead, it will provide error messages like "Credit Card Number can't be blank"

    *Ryan Bigg*


text:
package sias.model.base.service;

import sias.model.base.BaseService;
import sias.model.pojo.UnidadeAtendimento;

public interface BaseUnidadeAtendimentoService extends BaseService<UnidadeAtendimento>{

}


text:
from contextlib import contextmanager, nested
import imp
import io
import unittest

from mock import patch

GITHUB_API = "https://api.github.com"
ghb = imp.load_source('ghb', 'github_tarballs')

class TestGitHubTarballs(unittest.TestCase):

    def test_version_parse(self):
        with mock_open(u"\nVersion: 2012.2.3+git.1355917214.0c8c2a3\n"):
            self.assertEqual('0c8c2a3',
                             ghb.get_commit_from_spec('example_pkg'))

    def test_version_parse_comment(self):
        with mock_open(
                u"\nVersion: 2012.2.3+git.1355917214.0c8c2a3 # oi comment\n"):
            self.assertEqual('0c8c2a3',
                             ghb.get_commit_from_spec('example_pkg'))

    def test_download_tarball(self):
        with patch("urllib.urlretrieve") as urlretrieve:
            ghb.download_tarball('https://example.com/target.tar.gz',
                                 'filename')
            self.assertEqual(
                (("https://example.com/target.tar.gz",
                  "filename"),),
                urlretrieve.call_args)

    def test_get_changes(self):
        response = io.StringIO(u'{"commits": [1, 2, 3]}')
        response.code = 200
        with nested(patch("ghb.get_commit_from_spec", return_value="1234"),
                    patch("ghb.github_credentials", return_value=""),
                    patch("urllib.urlopen", return_value=response)
                    ) as (_, _, urlopen):
            self.assertEqual({'commits': [1, 2, 3]},
                             ghb.get_changes("package", "owner", "repo",
                                             "target"))
            self.assertEqual(
                ((GITHUB_API + "/repos/owner/repo/compare/1234...target",),),
                urlopen.call_args)

    def test_github_credentials_empty_file(self):
        with mock_open(u""):
            self.assertEqual("", ghb.github_credentials())

    def test_github_credentials_ioerror(self):
        with patch("__builtin__.open", side_effect=IOError):
            self.assertEqual("", ghb.github_credentials())

    def test_github_credentials_read_from_file(self):
        with mock_open(u"user:pass"):
            self.assertEqual("user:pass@", ghb.github_credentials())

@contextmanager
def mock_open(contents):
    with patch("__builtin__.open", return_value=io.StringIO(contents)):
        yield


text:
* Similar to Ethereum and often cited as technically superior ([here](https://www.quora.com/Whats-the-price-prediction-for-Ethereum-in-the-next-3-to-5-years-best-educated-guess-I-do-understand-that-it-is-hard-to-actually-predict/answer/Tony-Aidinis))
* [Lisk](https://lisk.io/)
* [Stratis](https://stratisplatform.com/)
* [Neo](https://neo.org/)


text:
from pyramid.config import Configurator

def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    config = Configurator(settings=settings)
    config.include('pyramid_chameleon')
    config.add_static_view('static', 'static', cache_max_age=3600)
    config.add_route('home', '/')
    config.add_route('getAnnotation', 'getAnnotation')
    config.add_route('tissueOntology', 'tissueOntology')
    config.add_route('getAnnotationRegistry', 'getAnnotationRegistry')
    config.scan()
    return config.make_wsgi_app()


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitReportReporter -->
<testsuite hostname="Asus" name="ihstdo.pages.TaskDetailTest" tests="1" failures="0" timestamp="31 Mar 2016 06:08:35 GMT" time="91.638" errors="0">
  <testcase name="verifyTaskDetail" time="91.638" classname="ihstdo.pages.TaskDetailTest"/>
</testsuite> <!-- ihstdo.pages.TaskDetailTest -->


text:
Faraday Middleware
==================

A collection of useful [Faraday][] middleware. [See the documentation][docs].

    gem install faraday_middleware

Dependencies
------------

Some dependent libraries are needed only when using specific middleware:

* FaradayMiddleware::EncodeJson & FaradayMiddleware::ParseJson: "json"
  for ruby older than 1.9
* FaradayMiddleware::ParseXml: "multi_xml"
* FaradayMiddleware::OAuth: "simple_oauth"
* FaradayMiddleware::Mashify: "hashie"
* FaradayMiddleware::Rashify: "rash_alt" (Make sure to uninstall original rash gem to avoid conflict)
* FaradayMiddleware::Instrumentation: "activesupport"

Examples
--------

``` rb
require 'faraday_middleware'

## in Faraday 0.8 or above:
connection = Faraday.new 'http://example.com/api' do |conn|
  conn.request :oauth2, 'TOKEN'
  conn.request :json

  conn.response :xml,  :content_type => /\bxml$/
  conn.response :json, :content_type => /\bjson$/

  conn.use :instrumentation
  conn.adapter Faraday.default_adapter
end

## with Faraday 0.7:
connection = Faraday.new 'http://example.com/api' do |builder|
  builder.use FaradayMiddleware::OAuth2, 'TOKEN'
  builder.use FaradayMiddleware::EncodeJson

  builder.use FaradayMiddleware::ParseXml,  :content_type => /\bxml$/
  builder.use FaradayMiddleware::ParseJson, :content_type => /\bjson$/

  builder.use FaradayMiddleware::Instrumentation
  builder.adapter Faraday.default_adapter
end
```

  [faraday]: https://github.com/lostisland/faraday#readme
  [docs]: https://github.com/lostisland/faraday_middleware/wiki


text:
<!DOCTYPE html>

        <link rel="icon" href="favicon.png"/>
        <meta charset="utf-8">
        <meta name="viewport" content="user-scalable=no" />

        {{#each project.app.web.libs~}}

        {{/each}}

Luxe implementation of Sight & Light by the wonderfully talented Nicky Case

Move the mouse to change the lightsource position. Press R to re-randomize the walls.

Beside the concepts behind producing a 2D "shadow mask" like this, the demo source also shows how to implement custom geometry (in this case, using a triangle fan to cut down on the number of vertices pushed to the GPU [which probably isn't a bottleneck here anyway, but hey.])


text:
FROM mesosphere/mesos:0.28.1-2.0.20.ubuntu1404
## mesos + java used to build hubspot/singularitybase

MAINTAINER platform-infrastructure-groups@hubspot.com

# Java Version
ENV JAVA_VERSION_MAJOR 8
ENV JAVA_VERSION_MINOR 77
ENV JAVA_VERSION_BUILD 03
ENV JAVA_PACKAGE       server-jre

RUN apt-get update && \
    apt-get install -y curl tar logrotate ca-certificates apt-transport-https lxc iptables && \
    apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \
    echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main"  > /etc/apt/sources.list.d/docker.list && \
    apt-get update && \
    apt-get -y install docker-engine && \
    curl -kLOH "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
      http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz && \
    gunzip ${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz && \
    tar -xf ${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar -C /opt && \
    rm ${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar && \
    ln -s /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} /opt/jdk && \
    apt-get clean autoclean && \
    apt-get autoremove -y && \
    rm -rf /var/lib/{apt,dpkg,cache,log}/

RUN mkdir -p /usr/share/mesos/logwatcher && \
    mkdir -p /usr/share/mesos/s3 && \
    mkdir -p /usr/share/mesos/artifacts

ENV JAVA_HOME /usr/lib/jvm/java-8-oracle


text:
package commitgraph

import (
	"fmt"
	"time"

	"gopkg.in/src-d/go-git.v4/plumbing"
	"gopkg.in/src-d/go-git.v4/plumbing/format/commitgraph"
	"gopkg.in/src-d/go-git.v4/plumbing/object"
	"gopkg.in/src-d/go-git.v4/plumbing/storer"
)

// graphCommitNode is a reduced representation of Commit as presented in the commit
// graph file (commitgraph.Node). It is merely useful as an optimization for walking
// the commit graphs.
//
// graphCommitNode implements the CommitNode interface.
type graphCommitNode struct {
	// Hash for the Commit object
	hash plumbing.Hash
	// Index of the node in the commit graph file
	index int

	commitData *commitgraph.CommitData
	gci        *graphCommitNodeIndex
}

// graphCommitNodeIndex is an index that can load CommitNode objects from both the commit
// graph files and the object store.
//
// graphCommitNodeIndex implements the CommitNodeIndex interface
type graphCommitNodeIndex struct {
	commitGraph commitgraph.Index
	s           storer.EncodedObjectStorer
}

// NewGraphCommitNodeIndex returns CommitNodeIndex implementation that uses commit-graph
// files as backing storage and falls back to object storage when necessary
func NewGraphCommitNodeIndex(commitGraph commitgraph.Index, s storer.EncodedObjectStorer) CommitNodeIndex {
	return &graphCommitNodeIndex{commitGraph, s}
}

func (gci *graphCommitNodeIndex) Get(hash plumbing.Hash) (CommitNode, error) {
	// Check the commit graph first
	parentIndex, err := gci.commitGraph.GetIndexByHash(hash)
	if err == nil {
		parent, err := gci.commitGraph.GetCommitDataByIndex(parentIndex)
		if err != nil {
			return nil, err
		}

		return &graphCommitNode{
			hash:       hash,
			index:      parentIndex,
			commitData: parent,
			gci:        gci,
		}, nil
	}

	// Fallback to loading full commit object
	commit, err := object.GetCommit(gci.s, hash)
	if err != nil {
		return nil, err
	}

	return &objectCommitNode{
		nodeIndex: gci,
		commit:    commit,
	}, nil
}

func (c *graphCommitNode) ID() plumbing.Hash {
	return c.hash
}

func (c *graphCommitNode) Tree() (*object.Tree, error) {
	return object.GetTree(c.gci.s, c.commitData.TreeHash)
}

func (c *graphCommitNode) CommitTime() time.Time {
	return c.commitData.When
}

func (c *graphCommitNode) NumParents() int {
	return len(c.commitData.ParentIndexes)
}

func (c *graphCommitNode) ParentNodes() CommitNodeIter {
	return newParentgraphCommitNodeIter(c)
}

func (c *graphCommitNode) ParentNode(i int) (CommitNode, error) {
	if i < 0 || i >= len(c.commitData.ParentIndexes) {
		return nil, object.ErrParentNotFound
	}

	parent, err := c.gci.commitGraph.GetCommitDataByIndex(c.commitData.ParentIndexes[i])
	if err != nil {
		return nil, err
	}

	return &graphCommitNode{
		hash:       c.commitData.ParentHashes[i],
		index:      c.commitData.ParentIndexes[i],
		commitData: parent,
		gci:        c.gci,
	}, nil
}

func (c *graphCommitNode) ParentHashes() []plumbing.Hash {
	return c.commitData.ParentHashes
}

func (c *graphCommitNode) Generation() uint64 {
	// If the commit-graph file was generated with older Git version that
	// set the generation to zero for every commit the generation assumption
	// is still valid. It is just less useful.
	return uint64(c.commitData.Generation)
}

func (c *graphCommitNode) Commit() (*object.Commit, error) {
	return object.GetCommit(c.gci.s, c.hash)
}

func (c *graphCommitNode) String() string {
	return fmt.Sprintf(
		"%s %s\nDate:   %s",
		plumbing.CommitObject, c.ID(),
		c.CommitTime().Format(object.DateFormat),
	)
}


text:
<title>Numbers - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Controlling-GDB.html#Controlling-GDB" title="Controlling GDB">
<link rel="prev" href="Screen-Size.html#Screen-Size" title="Screen Size">
<link rel="next" href="ABI.html#ABI" title="ABI">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Next: ABI,
Previous: Screen Size,
Up: Controlling GDB

22.5 Numbers

You can always enter numbers in octal, decimal, or hexadecimal in
gdb by the usual conventions: octal numbers begin with
‘<samp>0</samp>’, decimal numbers end with ‘<samp>.</samp>’, and hexadecimal numbers
begin with ‘<samp>0x</samp>’.  Numbers that neither begin with ‘<samp>0</samp>’ or
‘<samp>0x</samp>’, nor end with a ‘<samp>.</samp>’ are, by default, entered in base
10; likewise, the default display for numbers—when no particular
format is specified—is base 10.  You can change the default base for
both input and output with the commands described below.

set input-radix <var>base</var>
Set the default base for numeric input.  Supported choices
for <var>base</var> are decimal 8, 10, or 16.  <var>base</var> must itself be
specified either unambiguously or using the current input radix; for
example, any of

          set input-radix 012
          set input-radix 10.
          set input-radix 0xa

sets the input base to decimal.  On the other hand, ‘<samp>set input-radix 10</samp>’
leaves the input radix unchanged, no matter what it was, since
‘<samp>10</samp>’, being without any leading or trailing signs of its base, is
interpreted in the current radix.  Thus, if the current radix is 16,
‘<samp>10</samp>’ is interpreted in hex, i.e. as 16 decimal, which doesn't
change the radix.

set output-radix <var>base</var>
Set the default base for numeric display.  Supported choices
for <var>base</var> are decimal 8, 10, or 16.  <var>base</var> must itself be
specified either unambiguously or using the current input radix.

show input-radix
Display the current default base for numeric input.

show output-radix
Display the current default base for numeric display.

set radix [<var>base</var>]
show radix
These commands set and show the default base for both input and output
of numbers.  set radix sets the radix of input and output to
the same base; without an argument, it resets the radix back to its
default value of 10.


text:
package multisyncer

type syncer chan cmdData

type cmdData struct {
	action cmdAction
	token  interface{}
	done   chan struct{}
}

type cmdAction int

const (
	lock cmdAction = iota
	unlock
)

// MultiSyncer synchronizes access based on a given token
type MultiSyncer interface {
	Lock(interface{})
	Unlock(interface{})
}

// New returns a new MultiSyncer
func New() MultiSyncer {
	s := make(syncer)
	go s.run()
	return s
}

func (s syncer) run() {
	store := make(map[interface{}]chan struct{})

	for cmd := range s {
		l, ok := store[cmd.token]

		if !ok && cmd.action == lock {
			l = make(chan struct{}, 1)
			store[cmd.token] = l
		}

		go func(cmd cmdData) {
			switch cmd.action {
			case lock:
				l <- struct{}{}
			case unlock:
				if ok {
					<-l
				}
			}

			cmd.done <- struct{}{}
		}(cmd)
	}
}

// Lock implements the MultiSyncer interface
func (s syncer) Lock(token interface{}) {
	done := make(chan struct{})
	s <- cmdData{action: lock, token: token, done: done}
	<-done
}

// Unlock implements the MultiSyncer interface
func (s syncer) Unlock(token interface{}) {
	done := make(chan struct{})
	s <- cmdData{action: unlock, token: token, done: done}
	<-done
}