text:
static void sadd(rliteContext* context, char *key, char *element) {
	rliteReply* reply;
	size_t argvlen[100];
	char* argv[100] = {"sadd", key, element, NULL};
	reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
	rliteFreeReplyObject(reply);
}

static int randomSadd(rliteContext* context, char *key, int elements) {
	rliteReply* reply;
	if (elements == 0) {
		elements = 3;
	}
	char* argv[100] = {"sadd", key, NULL};
	int i, j, len;
	for (i = 0; i < elements; i++) {
		len = 5 + floor(((float)rand() / RAND_MAX) * 10);
		argv[2 + i] = malloc(sizeof(char) * len);
		for (j = 0; j < len - 1; j++) {
			argv[2 + i][j] = 'a' + (int)floor(((float)rand() / RAND_MAX) * 25);
		}
		argv[2 + i][len - 1] = 0;
	}

	size_t argvlen[100];
	reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
	EXPECT_REPLY_INTEGER(reply, elements);
	rliteFreeReplyObject(reply);
	for (i = 0; i < elements; i++) {
		free(argv[2 + i]);
	}
	return 0;
}

TEST test_sadd() {
	rliteContext *context = rliteConnect(":memory:", 0);

	rliteReply* reply;
	char* argv[100] = {"sadd", "myset", "member1", "member2", "anothermember", "member1", NULL};
	size_t argvlen[100];
	reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
	EXPECT_REPLY_INTEGER(reply, 3);
	rliteFreeReplyObject(reply);

	rliteFree(context);
	return 0;
}

TEST test_scard() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	if (randomSadd(context, "myset", 5) != 0) {
		return 1;
	}

	rliteReply* reply;
	char* argv[100] = {"scard", "myset", NULL};
	reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
	EXPECT_REPLY_INTEGER(reply, 5);
	rliteFreeReplyObject(reply);

	if (randomSadd(context, "myset", 3) != 0) {
		return 1;
	}

	char* argv2[100] = {"scard", "myset", NULL};
	reply = rliteCommandArgv(context, populateArgvlen(argv2, argvlen), argv2, argvlen);
	EXPECT_REPLY_INTEGER(reply, 8);
	rliteFreeReplyObject(reply);

	rliteFree(context);
	return 0;
}

TEST test_sismember() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	sadd(context, "myset", "mymember");

	rliteReply* reply;
	char* argv[100] = {"sismember", "myset", "mymember", NULL};
	reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
	EXPECT_REPLY_INTEGER(reply, 1);
	rliteFreeReplyObject(reply);

	char* argv2[100] = {"sismember", "myset", "not a member", NULL};
	reply = rliteCommandArgv(context, populateArgvlen(argv2, argvlen), argv2, argvlen);
	EXPECT_REPLY_INTEGER(reply, 0);
	rliteFreeReplyObject(reply);

	rliteFree(context);
	return 0;
}

TEST test_smove() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	sadd(context, "myset", "mymember");

	rliteReply* reply;
	{
		char* argv[100] = {"smove", "myset", "otherset", "mymember", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_INTEGER(reply, 1);
		rliteFreeReplyObject(reply);
	}

	{
		char* argv[100] = {"sismember", "myset", "mymember", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_INTEGER(reply, 0);
		rliteFreeReplyObject(reply);
	}

	{
		char* argv[100] = {"sismember", "otherset", "mymember", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_INTEGER(reply, 1);
		rliteFreeReplyObject(reply);
	}

	{
		char* argv[100] = {"smove", "otherset", "myset", "member2", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_INTEGER(reply, 0);
		rliteFreeReplyObject(reply);
	}

	{
		char* argv[100] = {"sismember", "myset", "member2", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_INTEGER(reply, 0);
		rliteFreeReplyObject(reply);
	}

	rliteFree(context);
	return 0;
}

TEST test_spop() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2";
	sadd(context, "myset", m1);
	sadd(context, "myset", m2);

	rliteReply* reply;
	{
		char* argv[100] = {"spop", "myset", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		ASSERT_EQ(reply->type, RLITE_REPLY_STRING);
		if (!(reply->len == (int)strlen(m1) && memcmp(reply->str, m1, reply->len) == 0) &&
			!(reply->len == (int)strlen(m2) && memcmp(reply->str, m2, reply->len) == 0)) {
			FAIL();
		}
		rliteFreeReplyObject(reply);
	}

	{
		char* argv[100] = {"spop", "myset", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		ASSERT_EQ(reply->type, RLITE_REPLY_STRING);
		if (!(reply->len == (int)strlen(m1) && memcmp(reply->str, m1, reply->len) == 0) &&
			!(reply->len == (int)strlen(m2) && memcmp(reply->str, m2, reply->len) == 0)) {
			FAIL();
		}
		rliteFreeReplyObject(reply);
	}

	{
		char* argv[100] = {"spop", "myset", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_NIL(reply);
		rliteFreeReplyObject(reply);
	}

	rliteFree(context);
	return 0;
}

TEST test_srandmember_nocount() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2";
	sadd(context, "myset", m1);
	sadd(context, "myset", m2);

	rliteReply* reply;
	{
		char* argv[100] = {"srandmember", "myset", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		ASSERT_EQ(reply->type, RLITE_REPLY_STRING);
		if (!(reply->len == (int)strlen(m1) && memcmp(reply->str, m1, reply->len) == 0) &&
			!(reply->len == (int)strlen(m2) && memcmp(reply->str, m2, reply->len) == 0)) {
			FAIL();
		}
		rliteFreeReplyObject(reply);
	}
	rliteFree(context);
	return 0;
}

TEST test_srandmember_1() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2";
	sadd(context, "myset", m1);
	sadd(context, "myset", m2);

	rliteReply* reply;
	{
		char* argv[100] = {"srandmember", "myset", "1", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_LEN(reply, 1);
		if (!(reply->element[0]->len == (int)strlen(m1) && memcmp(reply->element[0]->str, m1, reply->element[0]->len) == 0) &&
			!(reply->element[0]->len == (int)strlen(m2) && memcmp(reply->element[0]->str, m2, reply->element[0]->len) == 0)) {
			FAIL();
		}
		rliteFreeReplyObject(reply);
	}
	rliteFree(context);
	return 0;
}

TEST test_srandmember_10_unique() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2";
	sadd(context, "myset", m1);
	sadd(context, "myset", m2);

	rliteReply* reply;
	{
		char* argv[100] = {"srandmember", "myset", "10", NULL};

		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_LEN(reply, 2);

		if (!(reply->element[0]->len == (int)strlen(m1) && memcmp(reply->element[0]->str, m1, reply->element[0]->len) == 0) &&
			!(reply->element[0]->len == (int)strlen(m2) && memcmp(reply->element[0]->str, m2, reply->element[0]->len) == 0)) {
			FAIL();
		}

		if (!(reply->element[1]->len == (int)strlen(m1) && memcmp(reply->element[1]->str, m1, reply->element[1]->len) == 0) &&
			!(reply->element[1]->len == (int)strlen(m2) && memcmp(reply->element[1]->str, m2, reply->element[1]->len) == 0)) {
			FAIL();
		}

		if (reply->element[0]->len == reply->element[1]->len) {
			FAIL();
		}

		rliteFreeReplyObject(reply);
	}
	rliteFree(context);
	return 0;
}

TEST test_srandmember_10_non_unique() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	long i;
	char *m1 = "mymember", *m2 = "member2";
	sadd(context, "myset", m1);
	sadd(context, "myset", m2);

	rliteReply* reply;
	{
		char* argv[100] = {"srandmember", "myset", "-10", NULL};

		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_LEN(reply, 10);

		for (i = 0; i < 10; i++) {
			if (!(reply->element[i]->len == (int)strlen(m1) && memcmp(reply->element[i]->str, m1, reply->element[i]->len) == 0) &&
				!(reply->element[i]->len == (int)strlen(m2) && memcmp(reply->element[i]->str, m2, reply->element[i]->len) == 0)) {
				FAIL();
			}
		}

		rliteFreeReplyObject(reply);
	}
	rliteFree(context);
	return 0;
}

TEST test_srem() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2";
	sadd(context, "myset", m1);
	sadd(context, "myset", m2);

	rliteReply* reply;
	{
		char* argv[100] = {"srem", "myset", m1, "other", m2, NULL};

		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_INTEGER(reply, 2);
		rliteFreeReplyObject(reply);
	}

	{
		char* argv[100] = {"exists", "mykey", NULL};

		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_INTEGER(reply, 0);
		rliteFreeReplyObject(reply);
	}

	rliteFree(context);
	return 0;
}

TEST test_smembers() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2";
	sadd(context, "myset", m1);
	sadd(context, "myset", m2);

	rliteReply* reply;
	{
		char* argv[100] = {"smembers", "myset", NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_LEN(reply, 2);
		rliteFreeReplyObject(reply);
	}

	rliteFree(context);
	return 0;
}

TEST test_sinter() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2", *s1 = "myset", *s2 = "myset2";
	sadd(context, s1, m1);
	sadd(context, s1, m2);
	sadd(context, s2, m1);
	sadd(context, s2, "meh");

	rliteReply* reply;
	{
		char* argv[100] = {"sinter", s1, s2, NULL};

		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_LEN(reply, 1);
		EXPECT_REPLY_STR(reply->element[0], m1, strlen(m1));
		rliteFreeReplyObject(reply);
	}

	rliteFree(context);
	return 0;
}

TEST test_sinterstore() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2", *s1 = "myset", *s2 = "myset2", *t = "target";
	sadd(context, s1, m1);
	sadd(context, s1, m2);
	sadd(context, s2, m1);
	sadd(context, s2, "meh");

	rliteReply* reply;
	{
		char* argv[100] = {"sinterstore", t, s1, s2, NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_INTEGER(reply, 1);
		rliteFreeReplyObject(reply);
	}

	{
		char* argv[100] = {"smembers", t, NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_LEN(reply, 1);
		EXPECT_REPLY_STR(reply->element[0], m1, strlen(m1));
		rliteFreeReplyObject(reply);
	}

	rliteFree(context);
	return 0;
}

TEST test_sunion() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2", *s1 = "myset", *s2 = "myset2";
	sadd(context, s1, m1);
	sadd(context, s1, m2);
	sadd(context, s2, m1);
	sadd(context, s2, "meh");

	rliteReply* reply;
	{
		char* argv[100] = {"sunion", s1, s2, NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_LEN(reply, 3);
		rliteFreeReplyObject(reply);
	}

	rliteFree(context);
	return 0;
}

TEST test_sunionstore() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2", *s1 = "myset", *s2 = "myset2", *t = "target";
	sadd(context, s1, m1);
	sadd(context, s1, m2);
	sadd(context, s2, m1);
	sadd(context, s2, "meh");

	rliteReply* reply;
	{
		char* argv[100] = {"sunionstore", t, s1, s2, NULL};

		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_INTEGER(reply, 3);
		rliteFreeReplyObject(reply);
	}

	{
		char* argv[100] = {"smembers", t, NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_LEN(reply, 3);
		rliteFreeReplyObject(reply);
	}

	rliteFree(context);
	return 0;
}

TEST test_sdiff() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2", *s1 = "myset", *s2 = "myset2";
	sadd(context, s1, m1);
	sadd(context, s1, m2);
	sadd(context, s2, m1);
	sadd(context, s2, "meh");

	rliteReply* reply;
	{
		char* argv[100] = {"sdiff", s1, s2, NULL};

		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_LEN(reply, 1);
		EXPECT_REPLY_STR(reply->element[0], m2, strlen(m2));
		rliteFreeReplyObject(reply);
	}

	rliteFree(context);
	return 0;
}

TEST test_sdiffstore() {
	rliteContext *context = rliteConnect(":memory:", 0);
	size_t argvlen[100];

	char *m1 = "mymember", *m2 = "member2", *s1 = "myset", *s2 = "myset2", *t = "target";
	sadd(context, s1, m1);
	sadd(context, s1, m2);
	sadd(context, s2, m1);
	sadd(context, s2, "meh");

	rliteReply* reply;
	{
		char* argv[100] = {"sdiffstore", t, s1, s2, NULL};
		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_INTEGER(reply, 1);
		rliteFreeReplyObject(reply);
	}

	{
		char* argv[100] = {"smembers", t, NULL};

		reply = rliteCommandArgv(context, populateArgvlen(argv, argvlen), argv, argvlen);
		EXPECT_REPLY_LEN(reply, 1);
		EXPECT_REPLY_STR(reply->element[0], m2, strlen(m2));
		rliteFreeReplyObject(reply);
	}

	rliteFree(context);
	return 0;
}

SUITE(set_test)
{
	RUN_TEST(test_sadd);
	RUN_TEST(test_scard);
	RUN_TEST(test_sismember);
	RUN_TEST(test_smove);
	RUN_TEST(test_spop);
	RUN_TEST(test_srandmember_nocount);
	RUN_TEST(test_srandmember_1);
	RUN_TEST(test_srandmember_10_unique);
	RUN_TEST(test_srandmember_10_non_unique);
	RUN_TEST(test_srem);
	RUN_TEST(test_smembers);
	RUN_TEST(test_sinter);
	RUN_TEST(test_sinterstore);
	RUN_TEST(test_sunion);
	RUN_TEST(test_sunionstore);
	RUN_TEST(test_sdiff);
	RUN_TEST(test_sdiffstore);
}


text:
using System;
using System.Security;
using System.Threading;
using System.Globalization;
using System.Runtime.InteropServices;
#pragma warning disable 618

public partial class FunctionPtr
{

    public static int RunGetDelForFcnPtrTest()
    {
        int retVal = 100;
        VoidDelegate md = new VoidDelegate(FunctionPtr.Method);
        IntPtr fcnptr = (IntPtr)0;
        Console.WriteLine("\r\nTesting Marshal.GetDelegateForFunctionPointer().");

        try
        {
            fcnptr = Marshal.GetFunctionPointerForDelegate<VoidDelegate>(md);
        }
        catch (Exception e)
        {
            retVal = 0;
            Console.WriteLine("Exception during initialization: {0}", e.ToString());
            return retVal;
        }

        try
        {
            Marshal.GetDelegateForFunctionPointer((IntPtr)0, typeof(VoidDelegate));
            retVal = 0;
            Console.WriteLine("Failure - did not receive an exception while passing 0 as the function pointer");
        }
        catch (ArgumentNullException e)
        {
            Console.WriteLine("Pass - threw the right exception passing a 0 function pointer");
        }
        catch (Exception e)
        {
            retVal = 0;
            Console.WriteLine("Failure - receive an incorrect exception while passing 0 as the function pointer");
            Console.WriteLine(e);
        }

        try
        {
            Marshal.GetDelegateForFunctionPointer(fcnptr, null);
            retVal = 0;
            Console.WriteLine("Failure - did not receive an exception while passing a null type");
        }
        catch (ArgumentException e)
        {
             Console.WriteLine("Fail - passing a null type received the right exception type, wrong message, message was '{0}'", e.Message);
        }
        catch (Exception e)
        {
            retVal = 0;
            Console.WriteLine("Failure - receive an incorrect exception while passing a null type");
            Console.WriteLine(e);
        }

        try
        {
            Marshal.GetDelegateForFunctionPointer(fcnptr, typeof(Object));
            retVal = 0;
            Console.WriteLine("Failure - did not receive an exception while passing a non-delegate type");
        }
        catch (ArgumentException e)
        {
            Console.WriteLine("Faile - threw the right exception passing a non-delegate type, but a wrong message, message was '{0}'", e.Message);
        }
        catch (Exception e)
        {
            retVal = 0;
            Console.WriteLine("Failure - receive an incorrect exception while passing a non-delegate type");
            Console.WriteLine(e);
        }

        Console.WriteLine(retVal == 100 ? "Done - PASSED" : "Done - FAILED");
        return retVal;
    }

    public static void Method()
    {
        Console.WriteLine("Simple method to get a delegate for");
    }
}
#pragma warning restore 618

redpajama_set_name: RedPajamaGithub


text:
---
uid: SolidEdgePart.KeyPointCurve.SystemName
summary: This read-only String property returns the system name for the referenced object.
remarks:
---


text:
<bill session="110" type="h" number="4989" updated="2009-01-09T03:18:00-05:00">
	<status><introduced date="1200459600" datetime="2008-01-16"/></status>

	<introduced date="1200459600" datetime="2008-01-16"/>
	<titles>
		<title type="official" as="introduced">To suspend temporarily the duty on stainless steel single piece exhaust gas manifolds.</title>
	</titles>
	<sponsor id="400317"/>
	<cosponsors>

	</cosponsors>
	<actions>
		<action date="1200459600" datetime="2008-01-16"><text>Referred to the House Committee on Ways and Means.</text></action>
		<action date="1200546000" datetime="2008-01-17"><text>Referred to the Subcommittee on Trade.</text></action>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>

	1/16/2008--Introduced.
Amends the Harmonized Tariff Schedule of the United States to suspend temporarily the duty on stainless steel single piece exhaust gas manifolds.

</bill>


text:
package egoscale

// BucketUsage represents the usage (in bytes) for a bucket
type BucketUsage struct {
	Created string `json:"created"`
	Name    string `json:"name"`
	Region  string `json:"region"`
	Usage   int    `json:"usage"`
}

// ListBucketsUsage represents a listBucketsUsage API request
type ListBucketsUsage struct {
	_ bool `name:"listBucketsUsage" description:"List"`
}

// ListBucketsUsageResponse represents a listBucketsUsage API response
type ListBucketsUsageResponse struct {
	Count        int           `json:"count"`
	BucketsUsage []BucketUsage `json:"bucketsusage"`
}

// Response returns the struct to unmarshal
func (ListBucketsUsage) Response() interface{} {
	return new(ListBucketsUsageResponse)
}


text:
import { composeWithTracker } from 'react-komposer';
import { Meteor } from 'meteor/meteor';
import { AppNavigation } from '../components/app-navigation';
import {LoadingAppHeader} from '/imports/ui/components/loading';
import Folders from '/imports/api/folders/folders';

const composer = (props, onData) => {
  const userId = Meteor.userId();
  const subscription1 = Meteor.subscribe('userData', userId);

  if (subscription1.ready()) {
    if(Meteor.user()){
      const invitedFoldersIds =  Meteor.user().profile.invitedFolders;
      const subscription2 = Meteor.subscribe('accessedFolders', userId, invitedFoldersIds);

      if(subscription2.ready()){
        const folders = Folders.find({createdBy: userId}).fetch();
        const invitedFolders = Folders.find({"_id": {$in: invitedFoldersIds}}).fetch();

        onData(null, {folders: folders, invitedFolders: invitedFolders, hasUser: true});
      }
    }
    else{
      onData(null, {folders: null, invitedFolders: null, hasUser: false});
    }
  }
};

export default composeWithTracker(composer, LoadingAppHeader)(AppNavigation);


text:
Pictures from example
=====================

[FIGURE src="image/kmom05/Capture1.png" class="figure left w50" caption=".figure .left .w50 - Skärmdump 1."]

[FIGURE src="image/kmom05/Capture2.png" class="figure right w25" caption=".figure .right .w25 - Skärmdump 2."]

[FIGURE src="image/kmom05/2.png" class="figure left w25" caption=".figure .left .w50 - and a very very very long and breaking caption to the image and hoping that the figure structure manages this."]

[FIGURE src="image/kmom05/3.png" class="figure right w50" caption=".figure .right .w50"]

[FIGURE src="image/kmom05/4.png" class="figure left w25" caption=".figure .left .w25"]

[FIGURE src="image/kmom05/5.png" class="figure center" caption=".figure .center - and a very very very long and breaking caption to the image and hoping that the figure structure manages this."]

[FIGURE src="image/kmom05/6.png" class="figure right w50" caption=".figure .right .w50"]

[FIGURE src="image/kmom05/7.png" class="figure" caption=".figure"]

[FIGURE src="image/kmom05/8.png" class="figure" caption=".figure"]

[FIGURE src="image/kmom05/9.png" class="figure" caption=".figure"]

[FIGURE src="image/kmom05/10.png" class="figure" caption=".figure"]


text:
package org.apache.syncope.fit.core.reference;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import org.apache.commons.io.IOUtils;
import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.report.UserReportletConf;
import org.apache.syncope.common.lib.to.PagedResult;
import org.apache.syncope.common.lib.to.ReportExecTO;
import org.apache.syncope.common.lib.to.ReportTO;
import org.apache.syncope.common.lib.types.ReportExecExportFormat;
import org.apache.syncope.common.lib.types.ReportExecStatus;
import org.apache.syncope.common.lib.wrap.ReportletConfClass;
import org.apache.syncope.common.rest.api.service.ReportService;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

@FixMethodOrder(MethodSorters.JVM)
public class ReportITCase extends AbstractITCase {

    private ReportTO createReport(final ReportTO report) {
        Response response = reportService.create(report);
        assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatusInfo().getStatusCode());
        return getObject(response.getLocation(), ReportService.class, ReportTO.class);
    }

    @Test
    public void getReportletClasses() {
        List<ReportletConfClass> reportletClasses = reportService.getReportletConfClasses();
        assertNotNull(reportletClasses);
        assertFalse(reportletClasses.isEmpty());
    }

    @Test
    public void list() {
        PagedResult<ReportTO> reports = reportService.list();
        assertNotNull(reports);
        assertFalse(reports.getResult().isEmpty());
        for (ReportTO report : reports.getResult()) {
            assertNotNull(report);
        }
    }

    @Test
    public void read() {
        ReportTO reportTO = reportService.read(1L);

        assertNotNull(reportTO);
        assertNotNull(reportTO.getExecutions());
        assertFalse(reportTO.getExecutions().isEmpty());
    }

    @Test
    public void readExecution() {
        ReportExecTO reportExecTO = reportService.readExecution(1L);
        assertNotNull(reportExecTO);
    }

    @Test
    public void create() {
        ReportTO report = new ReportTO();
        report.setName("testReportForCreate" + getUUIDString());
        report.getReportletConfs().add(new UserReportletConf("first"));
        report.getReportletConfs().add(new UserReportletConf("second"));

        report = createReport(report);
        assertNotNull(report);

        ReportTO actual = reportService.read(report.getKey());
        assertNotNull(actual);

        assertEquals(actual, report);
    }

    @Test
    public void update() {
        ReportTO report = new ReportTO();
        report.setName("testReportForUpdate" + getUUIDString());

        report.getReportletConfs().add(new UserReportletConf("first"));
        report.getReportletConfs().add(new UserReportletConf("second"));

        report = createReport(report);
        assertNotNull(report);
        assertEquals(2, report.getReportletConfs().size());

        report.getReportletConfs().add(new UserReportletConf("last"));

        reportService.update(report.getKey(), report);
        ReportTO updated = reportService.read(report.getKey());
        assertNotNull(updated);
        assertEquals(3, updated.getReportletConfs().size());
    }

    @Test
    public void delete() {
        ReportTO report = new ReportTO();
        report.setName("testReportForDelete" + getUUIDString());
        report.getReportletConfs().add(new UserReportletConf("first"));
        report.getReportletConfs().add(new UserReportletConf("second"));

        report = createReport(report);
        assertNotNull(report);

        reportService.delete(report.getKey());

        try {
            reportService.read(report.getKey());
            fail();
        } catch (SyncopeClientException e) {
            assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
        }
    }

    private void checkExport(final Long execId, final ReportExecExportFormat fmt) throws IOException {
        final Response response = reportService.exportExecutionResult(execId, fmt);
        assertNotNull(response);
        assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
        assertNotNull(response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION));
        assertTrue(response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION).
                endsWith("." + fmt.name().toLowerCase()));

        Object entity = response.getEntity();
        assertTrue(entity instanceof InputStream);
        assertFalse(IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING).isEmpty());
    }

    @Test
    public void executeAndExport() throws IOException {
        ReportTO reportTO = reportService.read(1L);
        reportTO.setKey(0);
        reportTO.setName("executeAndExport" + getUUIDString());
        reportTO.getExecutions().clear();
        reportTO = createReport(reportTO);
        assertNotNull(reportTO);

        ReportExecTO execution = reportService.execute(reportTO.getKey());
        assertNotNull(execution);

        int i = 0;
        int maxit = 50;

        // wait for report execution completion (executions incremented)
        do {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }

            reportTO = reportService.read(reportTO.getKey());

            assertNotNull(reportTO);
            assertNotNull(reportTO.getExecutions());

            i++;
        } while (reportTO.getExecutions().isEmpty()
                || (!ReportExecStatus.SUCCESS.name().equals(reportTO.getExecutions().get(0).getStatus()) && i < maxit));
        assertEquals(ReportExecStatus.SUCCESS.name(), reportTO.getExecutions().get(0).getStatus());

        long execId = reportTO.getExecutions().get(0).getKey();

        checkExport(execId, ReportExecExportFormat.XML);
        checkExport(execId, ReportExecExportFormat.HTML);
        checkExport(execId, ReportExecExportFormat.PDF);
        checkExport(execId, ReportExecExportFormat.RTF);
        checkExport(execId, ReportExecExportFormat.CSV);
    }

    @Test
    public void issueSYNCOPE43() {
        ReportTO reportTO = new ReportTO();
        reportTO.setName("issueSYNCOPE43" + getUUIDString());
        reportTO = createReport(reportTO);
        assertNotNull(reportTO);

        ReportExecTO execution = reportService.execute(reportTO.getKey());
        assertNotNull(execution);

        int maxit = 50;
        do {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }

            reportTO = reportService.read(reportTO.getKey());

            maxit--;
        } while (reportTO.getExecutions().isEmpty() && maxit > 0);

        assertEquals(1, reportTO.getExecutions().size());
    }

    @Test
    public void issueSYNCOPE102() throws IOException {
        // Create
        ReportTO reportTO = reportService.read(1L);
        reportTO.setKey(0);
        reportTO.setName("issueSYNCOPE102" + getUUIDString());
        reportTO = createReport(reportTO);
        assertNotNull(reportTO);

        // Execute (multiple requests)
        for (int i = 0; i < 10; i++) {
            ReportExecTO execution = reportService.execute(reportTO.getKey());
            assertNotNull(execution);
        }

        // Wait for one execution
        int maxit = 50;
        do {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }

            reportTO = reportService.read(reportTO.getKey());

            maxit--;
        } while (reportTO.getExecutions().isEmpty() && maxit > 0);
        assertFalse(reportTO.getExecutions().isEmpty());
    }
}


text:
package com.github.dumpram.mesh.gateway;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.github.dumpram.mesh.data.ConfigAckMeshData;
import com.github.dumpram.mesh.data.MeshPacket;
import com.github.dumpram.mesh.data.NormalStateMeshData;
import com.github.dumpram.mesh.data.StartMeshData;
import com.github.dumpram.mesh.network.MeshNetwork;
import com.github.dumpram.mesh.node.ConfigData;
import com.github.dumpram.mesh.node.Location;
import com.github.dumpram.mesh.node.MeshNode;

public class MeshGateway extends MeshNode {

	private static final long serialVersionUID = 1L;

	private List<MeshNode> childNodes;

	public MeshGateway(int id, Location location) {
		super(id, location);
		childNodes = new ArrayList<MeshNode>();
		this.isGateway = true;
	}

	public void run() {
		gatewayConfigureData();
		gatewayStartData();
		while(true) {
			gatewayGetData();
		}
	}

	private void gatewayConfigureData() {
		configData = new ConfigData(null, childNodes);
		propagateConfigData();
		waitForConfigAck();
		log("Gateway configuration ended!");
		log(configAckMeshData.toString());
	}

	private void gatewayStartData() {
		int maxStartNumber = Collections.max(configAckMeshData.getPreviousNumbers());
		log("Max start number: " + maxStartNumber);
		for (MeshNode i : configData.getChildNodes()) {
			MeshNetwork.getInstance().sendStartData(this, i, new StartMeshData(maxStartNumber));
		}
	}

	@Override
	protected void waitForConfigAck() {
		configAckMeshData = new ConfigAckMeshData(new ArrayList<Integer>());
		if (!configData.getChildNodes().isEmpty()) {
			while(!configAck()) {
				sleep(10);
			}
			log("Got config ack");
			log(configData.getChildNodes().toString());
		}
	}

	private void gatewayGetData() {
		this.currentMeshData = new NormalStateMeshData();
		for (int i = 0; i < configData.getChildNodes().size(); i++) {
			getDataFromNode(configData.getChildNodes().get(i).getId());
		}
		checkDataFromNodes();
		MeshNetwork.getInstance().getMeshDataGenerator().refreshData();
	}

	/**
	 * Sanity test for data.
	 */
	private void checkDataFromNodes() {
		List<MeshPacket> packets = currentMeshData.getPackets();
		for (int i = 0; i < packets.size(); i++) {
			MeshNetwork.getInstance().getMeshDataGenerator().verifyData(
					currentMeshData.getPackets().get(i).getId(),
					currentMeshData.getPackets().get(i).getData());
		}
	}

	@Override
	public void setMeshData(NormalStateMeshData data) {
		super.setMeshData(data);
	}

	public void addNode(MeshNode node) {
		childNodes.add(node);
	}

	public List<MeshNode> getNodes() {
		return childNodes;
	}

	@Override
	protected void stopListening() {
		isListening = true;
		repaint();
	}

}


text:
<?php

/**
 *	@author Félix Girault <felix.girault@gmail.com>
 *	@license FreeBSD License (http://opensource.org/licenses/BSD-2-Clause)
 */
namespace Essence;

use PHPUnit_Framework_TestCase as TestCase;
use Essence\Di\Container\Standard as StandardContainer;
use Essence\Dom\Document\Factory\Native as NativeDomDocument;
use Essence\Http\Client\Native as NativeHttpClient;

/**
 *	Test case for Crawler.
 */
class CrawlerTest extends TestCase {

	/**
	 *
	 */
	public $Crawler = null;

	/**
	 *
	 */
	public function setUp() {
		$Container = new StandardContainer();
		$Container->set('filters', [
			'Provider' => '~pass~i'
		]);

		$this->Crawler = new Crawler(
			$Container->get('Collection'),
			new NativeDomDocument()
		);
	}

	/**
	 *
	 */
	public function testCrawlSource() {
		$html = <<<HTML
			Foo
			Bar
			<embed src="http://pass.embed.com"></embed>

HTML;

		$this->assertEquals([
			'http://pass.iframe.com',
			'http://pass.embed.com',
			'http://pass.foo.com'
		], $this->Crawler->crawl($html));
	}
}


text:
Changes:
* Update to Spigot 1.18.1
* Add config conversion!
  * Config values under the `protection` category of the config *should* be automatically converted and removed from your config.yml files.
* Reduce debug spam

As always please report any bugs you find to the [GitHub issue tracker](https://github.com/cjburkey01/ClaimChunk/issues) or our [Discord server](https://discord.gg/swW8xX665Z).


text:
#ifndef __PERFORMANCE_MONITOR__
#define __PERFORMANCE_MONITOR__

#include <stdarg.h>

#include <string>
#include <map>

#include "misc.h"
#include "ThreadLock.h"

BBC_AUDIOTOOLBOX_START

// unless specified as enabled or disabled before this include, allow use of PERFMON() macro
#ifndef PERFORMANCE_MONITORING_ENABLED
#define PERFORMANCE_MONITORING_ENABLED 1
#endif

/*--------------------------------------------------------------------------------*/
/** Simple averaging performance monitor
 *
 * Not to be used directly but instead used by PerformanceMonitorMarker class and PERFMON macro
 */
/*--------------------------------------------------------------------------------*/
class PerformanceMonitor
{
public:
  /*--------------------------------------------------------------------------------*/
  /** Get access to Performance Monitor singleton
   */
  /*--------------------------------------------------------------------------------*/
  static PerformanceMonitor& Get();

  /*--------------------------------------------------------------------------------*/
  /** Enable measuring
   */
  /*--------------------------------------------------------------------------------*/
  static void StartMeasuring();

  /*--------------------------------------------------------------------------------*/
  /** Disable measuring
   */
  /*--------------------------------------------------------------------------------*/
  static void StopMeasuring();

  /*--------------------------------------------------------------------------------*/
  /** Start logging to file
   */
  /*--------------------------------------------------------------------------------*/
  static void StartLogging();

  /*--------------------------------------------------------------------------------*/
  /** Stop logging to file
   */
  /*--------------------------------------------------------------------------------*/
  static void StopLogging();

  /*--------------------------------------------------------------------------------*/
  /** Start logging to individual files
   */
  /*--------------------------------------------------------------------------------*/
  static void StartIndividualLogging();

  /*--------------------------------------------------------------------------------*/
  /** Stop logging to individual files
   */
  /*--------------------------------------------------------------------------------*/
  static void StopIndividualLogging();

  /*--------------------------------------------------------------------------------*/
  /** Enable performance report at destruction
   */
  /*--------------------------------------------------------------------------------*/
  static void EnablePerformanceReport(bool enable = true);

  /*--------------------------------------------------------------------------------*/
  /** Enable production of GNUPlot file (forces individual logging files)
   */
  /*--------------------------------------------------------------------------------*/
  static void EnableGNUPlotFile(bool enable = true);

  /*--------------------------------------------------------------------------------*/
  /** Start performance measurement
   */
  /*--------------------------------------------------------------------------------*/
  void Start(const std::string& id);

  /*--------------------------------------------------------------------------------*/
  /** Stop performance measurement
   */
  /*--------------------------------------------------------------------------------*/
  void Stop(const std::string& id);

  /*--------------------------------------------------------------------------------*/
  /** Return textual performance report
   */
  /*--------------------------------------------------------------------------------*/
  static std::string GetReport();

private:
  PerformanceMonitor(uint_t _avglen = 10);
  ~PerformanceMonitor();

protected:
  typedef uint64_t perftime_t;

  perftime_t GetCurrent();

  typedef struct
  {
    perftime_t  start;
    perftime_t  stop;
    perftime_t  elapsed;
    perftime_t  taken;
  } TIMING;

  typedef struct
  {
    std::string id;
    struct {
      FILE      *fp;
      uint_t    instance;
    } config;

    TIMING      *timings;
    uint_t      ntimings, index;
    bool        wrapped;

    struct {
      perftime_t  elapsed;
      perftime_t  taken;
      perftime_t  total_elapsed;
      perftime_t  total_taken;
      perftime_t  max_elapsed;
      perftime_t  max_taken;
      perftime_t  min_elapsed;
      perftime_t  min_taken;
      double      utilization;
      double      max_utilization;
      double      min_utilization;
    } stats;
  } TIMING_DATA;

  void LogToFile(FILE *fp, perftime_t t, const TIMING_DATA& data, const std::string& id, bool start) const;

  /*--------------------------------------------------------------------------------*/
  /** Return textual performance report
   */
  /*--------------------------------------------------------------------------------*/
  std::string GetReportEx();

protected:
  ThreadLockObject tlock;
  perftime_t       t0;
  uint_t           avglen;
  std::map<std::string,TIMING_DATA> timings;
  std::vector<const TIMING_DATA *>  timingslist;
  std::string      logfiledir;

  FILE *fp;
  bool measure;
  bool logtofile;
  bool logtofiles;
  bool reportatend;
  bool generategnuplotfile;
};

/*--------------------------------------------------------------------------------*/
/** Simple class wrapper for performance start/stop
 */
/*--------------------------------------------------------------------------------*/
class PerformanceMonitorMarker
{
public:
  PerformanceMonitorMarker(const char *_id) : id(_id) {PerformanceMonitor::Get().Start(id);}
  ~PerformanceMonitorMarker() {PerformanceMonitor::Get().Stop(id);}

protected:
  std::string id;
};

#if PERFORMANCE_MONITORING_ENABLED
/*--------------------------------------------------------------------------------*/
/** Macro for monitoring which allows flexible naming
 */
/*--------------------------------------------------------------------------------*/
#define PERFMON(id) PerformanceMonitorMarker _mon(StringStream() << id)
#else
// disable macro -> disable monitoring
#define PERFMON(id) (void)0
#endif

BBC_AUDIOTOOLBOX_END

#endif


text:
import threading, logging, time
import pickle
import uniout

from kafka.client import KafkaClient
from kafka.consumer import SimpleConsumer

import mongo_credentials
from pymongo import MongoClient

def main():
    kafka_client = KafkaClient("localhost:9092")
    consumer = SimpleConsumer(kafka_client, "test-group", "twitter_raw")
    consumer.seek(0,2)

    mongo_client = MongoClient(mongo_credentials.connection_string)

    tweets_db = mongo_client.tweets
    filtered_tweets_collection = tweets_db.filtered_tweets_collection
    # raw_tweet_objects_collection = tweets_db.raw_tweets_collection
    # raw_tweets_collection = tweets_db.raw_tweets_collection
    # raw_user_collection = tweets_db.raw_user_collection
    # raw_author_collection = tweets_db.raw_author_collection
    count = 0
    for message in consumer:
        try:
            print count
            count+=1
            filtered_tweet_string = message.message.value.decode('utf-8')
            data_depickled = pickle.loads(filtered_tweet_string)
            filtered_tweets_collection.insert_one(data_depickled)
            # print data_depickled
            # break
            # print message.offset, message.message.value
        except Exception, e:
            print filtered_tweet_string
            raise e
            continue

if __name__ == "__main__":
    # logging.basicConfig(
    #     format='%(asctime)s.%(msecs)s:%(name)s:%(thread)d:%(levelname)s:%(process)d:%(message)s',
    #     level=logging.DEBUG
    #     )
    main()


text:
<?php

namespace spectrum\core\plugins\basePlugins\worldCreators;

class Destroyers extends WorldCreators
{
	public function applyToWorld($world)
	{
		foreach ($this->getAllAppendAncestorsWithRunningContexts() as $creator)
			\spectrum\core\Tools::callClosureInWorld($creator['callback'], array(), $world);

		return $world;
	}
}


text:
/*eslint-env node, mocha */
/*global expect */
/*eslint no-console: 0*/
'use strict';

import React from 'react';
import TestUtils from 'react-addons-test-utils';

// import sinon from 'sinon';

// const TestUtils = React.addons.TestUtils;
import createComponent from 'helpers/shallowRenderHelper';

import Main from 'components/Main';

describe('MainComponent', () => {
  let getItemStub;
  let setItemStub;
  let clock;

  beforeEach(() => {
    getItemStub = sinon.stub(Storage.prototype, 'getItem');
    setItemStub = sinon.stub(Storage.prototype, 'setItem');
    clock = sinon.useFakeTimers(new Date().getTime());
  });

  afterEach(() => {
    Storage.prototype.getItem.restore();
    Storage.prototype.setItem.restore();
    clock.restore();
  });

  function createMain(initialStorage=[]) {
    getItemStub.withArgs('timebox.boxes').returns(JSON.stringify(initialStorage));
    getItemStub.withArgs('timebox.lastCheckTime').returns(JSON.stringify(clock.now));
    return TestUtils.renderIntoDocument(<Main />);
  }

  it('initializes boxes from local storage', () => {
    let main = createMain([{id: 1, name: 'Default', duration: 42}]);

    expect(getItemStub).to.have.been.called;
    expect(main.state.boxes).to.deep.equal([{id: 1, name: 'Default', duration: 42}]);
  });

  it('keeps track of the last checked time', () => {
    let main = createMain();

    expect(getItemStub).to.have.been.called;
    expect(main.state.lastCheckTime).to.equal(clock.now);
  });

  it('starts a timer immediately after mounting', () => {
    let main = createMain();
    let setIntervalStub = sinon.stub(window, 'setInterval').returns(1);

    main.componentDidMount();
    expect(setIntervalStub).to.have.been.called;
    expect(main.intervalID).to.equal(1);
  });

  it('clears the timer when unmounting', () => {
    let main = createMain();
    let clearIntervalSpy = sinon.spy(window, 'clearInterval');
    main.intervalID = 1;

    main.componentWillUnmount();
    expect(clearIntervalSpy).to.have.been.calledWith(1);
  });

  describe('toggleConfig', () => {
    let main;
    beforeEach(() => { main = createMain(); });
    describe('when toggling from false to true', () => {
      beforeEach(() => {
        main.state.showConfig = false;
        main.intervalID = 14;
        main.state.lastCheckTime = 1;
      });
      it('stops the timer and unsets the last checked time', () => {
        let clearIntervalSpy = sinon.spy(window, 'clearInterval');

        main.toggleConfig();
        expect(clearIntervalSpy).to.have.been.calledWith(14);
        expect(main.state.lastCheckTime).to.be.undefined;
        clearIntervalSpy.restore();
      });
    });
    describe('when toggling from true to false', () => {
      beforeEach(() => { main.state.showConfig = true; });
      it('starts the timer', () => {
        let startTimerSpy = sinon.spy(main, 'startTimer');

        main.toggleConfig();
        expect(startTimerSpy).to.have.been.called;
        startTimerSpy.restore();
      });
    });
  });

  describe('addBox', () => {
    it('adds boxes to local storage', () => {
      let main = createMain();

      main.addBox('New Box');
      expect(setItemStub).to.have.been.calledWith('timebox.boxes', JSON.stringify([{id: 1, name: 'New Box', duration: 0, active: false}]));
    });

    it('increments box IDs', () => {
      let main = createMain([
        {id: 1, name: 'First', duration: 42, active: false},
        // let's assume a Second box was deleted at some point, just to make things interesting?
        {id: 3, name: 'Third', duration: 42, active: false}
      ]);

      main.addBox('New Box');
      expect(setItemStub).to.have.been.calledWith('timebox.boxes', JSON.stringify([
        {id: 1, name: 'First', duration: 42, active: false},
        {id: 3, name: 'Third', duration: 42, active: false},
        {id: 4, name: 'New Box', duration: 0, active: false}
      ]));
    });
  });

  describe('removeBox', () => {
    it('removes boxes by ID and resets localStorage', () => {
      let main = createMain([
        {id: 1, name: 'First', duration: 42, active: false},
        {id: 2, name: 'Second', duration: 42, active: false},
        {id: 3, name: 'Third', duration: 42, active: false}
      ]);

      main.removeBox(2);
      expect(main.state.boxes).to.deep.equal([
        {id: 1, name: 'First', duration: 42, active: false},
        {id: 3, name: 'Third', duration: 42, active: false}
      ]);
      expect(setItemStub).to.have.been.calledWith('timebox.boxes', JSON.stringify([
        {id: 1, name: 'First', duration: 42, active: false},
        {id: 3, name: 'Third', duration: 42, active: false}
      ]));
    });
  });

  describe('resetBox', () => {
    it('resets the time for a given box', () => {
      let main = createMain([
        {id: 1, name: 'First', duration: 42, active: false},
        {id: 2, name: 'Second', duration: 42, active: false}
      ]);

      main.resetBox(2);
      expect(main.state.boxes).to.deep.equal([
        {id: 1, name: 'First', duration: 42, active: false},
        {id: 2, name: 'Second', duration: 0, active: false}
      ]);
      expect(setItemStub).to.have.been.calledWith('timebox.boxes', JSON.stringify([
        {id: 1, name: 'First', duration: 42, active: false},
        {id: 2, name: 'Second', duration: 0, active: false}
      ]));
    });
  });

  describe('resetAll', () => {
    it('pauses and resets the time for all boxes', () => {
      let main = createMain([
        {id: 1, name: 'First', duration: 42, active: true},
        {id: 2, name: 'Second', duration: 42, active: false}
      ]);

      main.resetAll();
      expect(main.state.boxes).to.deep.equal([
        {id: 1, name: 'First', duration: 0, active: false},
        {id: 2, name: 'Second', duration: 0, active: false}
      ]);
      expect(setItemStub).to.have.been.calledWith('timebox.boxes', JSON.stringify([
        {id: 1, name: 'First', duration: 0, active: false},
        {id: 2, name: 'Second', duration: 0, active: false}
      ]));
    });
  });

  describe('toggleActive', () => {
    let main;
    beforeEach(() => {
      main = createMain([
        {id: 1, name: 'First', duration: 42, active: false},
        {id: 2, name: 'Second', duration: 42, active: true},
        {id: 3, name: 'Second', duration: 42, active: false},
      ]);
    });
    it('sets the given box as the only active box if currently inactive', () => {
      main.toggleActive(1);
      expect(main.state.boxes[0].active).to.be.true;
      expect(main.state.boxes[1].active).to.be.false;
      expect(main.state.boxes[2].active).to.be.false;
    });
    it('sets all boxes inactive if current box is active', () => {
      main.toggleActive(2);
      expect(main.state.boxes[0].active).to.be.false;
      expect(main.state.boxes[1].active).to.be.false;
      expect(main.state.boxes[2].active).to.be.false;
    })
  });

  describe('incrementDurations', () => {
    it('should add time to active boxes', () => {
      let main = createMain([
        {id: 1, name: 'One', duration: 1, active: true},
        {id: 2, name: 'Two', duration: 1, active: false}
      ]);

      main.incrementDurations();
      expect(setItemStub).to.have.been.calledWith('timebox.boxes', JSON.stringify([
        {id: 1, name: 'One', duration: 1, active: true},
        {id: 2, name: 'Two', duration: 1, active: false}
      ]));

      clock.tick(1000);
      main.incrementDurations();
      expect(setItemStub).to.have.been.calledWith('timebox.boxes', JSON.stringify([
        {id: 1, name: 'One', duration: 1001, active: true},
        {id: 2, name: 'Two', duration: 1, active: false}
      ]));
    });

    it('should update the last checked time', () => {
      let main = createMain();
      expect(main.state.lastCheckTime).to.equal(clock.now);

      clock.tick(1000);
      main.incrementDurations();
      expect(setItemStub).to.have.been.calledWith('timebox.lastCheckTime', clock.now);
    });
  });
});


text:
package com.azilen.spring.actuate.endpoint.health;

import java.util.Map;

/**
 * Strategy interface used by {@link CompositeHealthIndicator} to aggregate
 * {@link Health} instances into a final one.
 *

 * This is especially useful to combine subsystem states expressed through
 * {@link Health#getStatus()} into one state for the entire system. The default
 * implementation {@link OrderedHealthAggregator} sorts {@link Status} instances
 * based on a priority list.
 *

 * It is possible to add more complex {@link Status} types to the system. In
 * that case either the {@link OrderedHealthAggregator} needs to be properly
 * configured or users need to register a custom {@link HealthAggregator} as
 * bean.
 *
 * @author Christian Dupuis
 * @since 1.1.0
 */
public interface HealthAggregator {

    /**
     * Aggregate several given {@link Health} instances into one.
     *
     * @param healths the health instances to aggregate
     * @return the aggregated health
     */
    Health aggregate(Map<String, Health> healths);
}


text:
require 'find'

class FilesForBackup
  def initialize(backup_folder, backup_folder_excludes)
    @backup_folder = backup_folder
    @backup_folder_excludes = backup_folder_excludes
  end

  def files(logger=nil)
    # warn if some folder doesn't exist
    @backup_folder_excludes.each do |folder_exclude|
      unless Pathname(folder_exclude).exist?
        logger.error "ALERT: #{folder_exclude} exclude path not found." unless logger.nil?
      end
    end

    # exclude directories
    find_files = Find.find(@backup_folder).to_a
    files_only = []
    find_files.each do |file|
      if Pathname(file).file?
        files_only.push(file)
      end
    end

    all_files_minus_excludes = remove_excludes(files_only, logger)

    # convert to Pathname
    all_files = []
    all_files_minus_excludes.each do |file|
      all_files.push(Pathname(file))
    end

    all_files
  end

  def remove_excludes(all_files, logger=nil)
    new_file_list = []
    all_files.each do |file|
      exclude = false
      @backup_folder_excludes.each do |folder_exclude|
        if file.start_with?(folder_exclude)
          exclude = true
          break
        end
      end
      unless exclude
        new_file_list.push(file)
      end
    end
    new_file_list
  end
end


text:
/**CFile****************************************************************

  FileName    [fxuCreate.c]

  PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]

  Synopsis    [Create matrix from covers and covers from matrix.]

  Author      [MVSIS Group]

  Affiliation [UC Berkeley]

  Date        [Ver. 1.0. Started - February 1, 2003.]

  Revision    [$Id: fxuCreate.c,v 1.0 2003/02/01 00:00:00 alanmi Exp $]

***********************************************************************/

#include "abc.h"
#include "fxuInt.h"
#include "fxu.h"

////////////////////////////////////////////////////////////////////////
///                        DECLARATIONS                              ///
////////////////////////////////////////////////////////////////////////

static void        Fxu_CreateMatrixAddCube( Fxu_Matrix * p, Fxu_Cube * pCube, char * pSopCube, Vec_Int_t * vFanins, int * pOrder );
static int         Fxu_CreateMatrixLitCompare( int * ptrX, int * ptrY );
static void        Fxu_CreateCoversNode( Fxu_Matrix * p, Fxu_Data_t * pData, int iNode, Fxu_Cube * pCubeFirst, Fxu_Cube * pCubeNext );
static Fxu_Cube *  Fxu_CreateCoversFirstCube( Fxu_Matrix * p, Fxu_Data_t * pData, int iNode );
static int * s_pLits;

extern int         Fxu_PreprocessCubePairs( Fxu_Matrix * p, Vec_Ptr_t * vCovers, int nPairsTotal, int nPairsMax );

////////////////////////////////////////////////////////////////////////
///                     FUNCTION DEFINITIONS                         ///
////////////////////////////////////////////////////////////////////////

/**Function*************************************************************

  Synopsis    [Creates the sparse matrix from the array of SOPs.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
Fxu_Matrix * Fxu_CreateMatrix( Fxu_Data_t * pData )
{
    Fxu_Matrix * p;
    Fxu_Var * pVar;
    Fxu_Cube * pCubeFirst, * pCubeNew;
    Fxu_Cube * pCube1, * pCube2;
    Vec_Int_t * vFanins;
    char * pSopCover;
    char * pSopCube;
    int * pOrder, nBitsMax;
    int i, v, c;
    int nCubesTotal;
    int nPairsTotal;
    int nPairsStore;
    int nCubes;
    int iCube, iPair;
    int nFanins;

    // collect all sorts of statistics
    nCubesTotal =  0;
    nPairsTotal =  0;
    nPairsStore =  0;
    nBitsMax    = -1;
    for ( i = 0; i < pData->nNodesOld; i++ )
        if ( pSopCover = pData->vSops->pArray[i] )
        {
            nCubes       = Abc_SopGetCubeNum( pSopCover );
            nFanins      = Abc_SopGetVarNum( pSopCover );
            assert( nFanins > 1 && nCubes > 0 );

            nCubesTotal += nCubes;
            nPairsTotal += nCubes * (nCubes - 1) / 2;
            nPairsStore += nCubes * nCubes;
            if ( nBitsMax < nFanins )
                nBitsMax = nFanins;
        }
    if ( nBitsMax <= 0 )
    {
        printf( "The current network does not have SOPs to perform extraction.\n" );
        return NULL;
    }
/*
    if ( nPairsStore > 10000000 )
    {
        printf( "The problem is too large to be solved by \"fxu\" (%d cubes and %d cube pairs)\n", nCubesTotal, nPairsStore );
        return NULL;
    }
*/
    // start the matrix
	p = Fxu_MatrixAllocate();
    // create the column labels
    p->ppVars = ALLOC( Fxu_Var *, 2 * (pData->nNodesOld + pData->nNodesExt) );
    for ( i = 0; i < 2 * pData->nNodesOld; i++ )
        p->ppVars[i] = Fxu_MatrixAddVar( p );

    // allocate storage for all cube pairs at once
    p->pppPairs = ALLOC( Fxu_Pair **, nCubesTotal + 100 );
    p->ppPairs  = ALLOC( Fxu_Pair *,  nPairsStore + 100 );
    memset( p->ppPairs, 0, sizeof(Fxu_Pair *) * nPairsStore );
    iCube = 0;
    iPair = 0;
    for ( i = 0; i < pData->nNodesOld; i++ )
        if ( pSopCover = pData->vSops->pArray[i] )
        {
            // get the number of cubes
            nCubes = Abc_SopGetCubeNum( pSopCover );
            // get the new var in the matrix
            pVar = p->ppVars[2*i+1];
            // assign the pair storage
            pVar->nCubes     = nCubes;
            if ( nCubes > 0 )
            {
                pVar->ppPairs    = p->pppPairs + iCube;
                pVar->ppPairs[0] = p->ppPairs  + iPair;
                for ( v = 1; v < nCubes; v++ )
                    pVar->ppPairs[v] = pVar->ppPairs[v-1] + nCubes;
            }
            // update
            iCube += nCubes;
            iPair += nCubes * nCubes;
        }
    assert( iCube == nCubesTotal );
    assert( iPair == nPairsStore );

    // allocate room for the reordered literals
    pOrder = ALLOC( int, nBitsMax );
    // create the rows
    for ( i = 0; i < pData->nNodesOld; i++ )
    if ( pSopCover = pData->vSops->pArray[i] )
    {
        // get the new var in the matrix
        pVar = p->ppVars[2*i+1];
        // here we sort the literals of the cover
        // in the increasing order of the numbers of the corresponding nodes
        // because literals should be added to the matrix in this order
        vFanins = pData->vFanins->pArray[i];
        s_pLits = vFanins->pArray;
        // start the variable order
        nFanins = Abc_SopGetVarNum( pSopCover );
        for ( v = 0; v < nFanins; v++ )
            pOrder[v] = v;
        // reorder the fanins
        qsort( (void *)pOrder, nFanins, sizeof(int),(int (*)(const void *, const void *))Fxu_CreateMatrixLitCompare);
        assert( s_pLits[ pOrder[0] ] < s_pLits[ pOrder[nFanins-1] ] );
        // create the corresponding cubes in the matrix
        pCubeFirst = NULL;
        c = 0;
        Abc_SopForEachCube( pSopCover, nFanins, pSopCube )
        {
            // create the cube
	        pCubeNew = Fxu_MatrixAddCube( p, pVar, c++ );
            Fxu_CreateMatrixAddCube( p, pCubeNew, pSopCube, vFanins, pOrder );
            if ( pCubeFirst == NULL )
                pCubeFirst = pCubeNew;
            pCubeNew->pFirst = pCubeFirst;
        }
        // set the first cube of this var
        pVar->pFirst = pCubeFirst;
        // create the divisors without preprocessing
        if ( nPairsTotal <= pData->nPairsMax )
        {
		    for ( pCube1 = pCubeFirst; pCube1; pCube1 = pCube1->pNext )
			    for ( pCube2 = pCube1? pCube1->pNext: NULL; pCube2; pCube2 = pCube2->pNext )
				    Fxu_MatrixAddDivisor( p, pCube1, pCube2 );
        }
    }
    FREE( pOrder );

    // consider the case when cube pairs should be preprocessed
    // before adding them to the set of divisors
    if ( nPairsTotal > pData->nPairsMax )
        if ( !Fxu_PreprocessCubePairs( p, pData->vSops, nPairsTotal, pData->nPairsMax ) )
            return NULL;

    // add the var pairs to the heap
    Fxu_MatrixComputeSingles( p );

    // print stats
    if ( pData->fVerbose )
    {
        double Density;
        Density = ((double)p->nEntries) / p->lVars.nItems / p->lCubes.nItems;
	    fprintf( stdout, "Matrix: [vars x cubes] = [%d x %d]  ",
            p->lVars.nItems, p->lCubes.nItems );
	    fprintf( stdout, "Lits = %d  Density = %.5f%%\n",
            p->nEntries, Density );
	    fprintf( stdout, "1-cube divisors = %6d.  ",  p->lSingles.nItems );
	    fprintf( stdout, "2-cube divisors = %6d.  ",  p->nDivsTotal );
	    fprintf( stdout, "Cube pairs = %6d.",    nPairsTotal );
	    fprintf( stdout, "\n" );
    }
//    Fxu_MatrixPrint( stdout, p );
    return p;
}

/**Function*************************************************************

  Synopsis    [Adds one cube with literals to the matrix.]

  Description [Create the cube and literals in the matrix corresponding
  to the given cube in the SOP cover. Co-singleton transform is performed here.]

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Fxu_CreateMatrixAddCube( Fxu_Matrix * p, Fxu_Cube * pCube, char * pSopCube, Vec_Int_t * vFanins, int * pOrder )
{
	Fxu_Var * pVar;
    int Value, i;
    // add literals to the matrix
    Abc_CubeForEachVar( pSopCube, Value, i )
    {
        Value = pSopCube[pOrder[i]];
        if ( Value == '0' )
        {
            pVar = p->ppVars[ 2 * vFanins->pArray[pOrder[i]] + 1 ];  // CST
		    Fxu_MatrixAddLiteral( p, pCube, pVar );
        }
        else if ( Value == '1' )
        {
            pVar = p->ppVars[ 2 * vFanins->pArray[pOrder[i]] ];  // CST
		    Fxu_MatrixAddLiteral( p, pCube, pVar );
        }
    }
}

/**Function*************************************************************

  Synopsis    [Creates the new array of Sop covers from the sparse matrix.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Fxu_CreateCovers( Fxu_Matrix * p, Fxu_Data_t * pData )
{
    Fxu_Cube * pCube, * pCubeFirst, * pCubeNext;
    char * pSopCover;
    int iNode, n;

    // get the first cube of the first internal node
    pCubeFirst = Fxu_CreateCoversFirstCube( p, pData, 0 );

    // go through the internal nodes
    for ( n = 0; n < pData->nNodesOld; n++ )
    if ( pSopCover = pData->vSops->pArray[n] )
    {
        // get the number of this node
        iNode = n;
        // get the next first cube
        pCubeNext = Fxu_CreateCoversFirstCube(  p, pData, iNode + 1 );
        // check if there any new variables in these cubes
        for ( pCube = pCubeFirst; pCube != pCubeNext; pCube = pCube->pNext )
            if ( pCube->lLits.pTail && pCube->lLits.pTail->iVar >= 2 * pData->nNodesOld )
                break;
        if ( pCube != pCubeNext )
            Fxu_CreateCoversNode( p, pData, iNode, pCubeFirst, pCubeNext );
        // update the first cube
        pCubeFirst = pCubeNext;
    }

    // add the covers for the extracted nodes
    for ( n = 0; n < pData->nNodesNew; n++ )
    {
        // get the number of this node
        iNode = pData->nNodesOld + n;
        // get the next first cube
        pCubeNext = Fxu_CreateCoversFirstCube( p, pData, iNode + 1 );
        // the node should be added
        Fxu_CreateCoversNode( p, pData, iNode, pCubeFirst, pCubeNext );
        // update the first cube
        pCubeFirst = pCubeNext;
    }
}

/**Function*************************************************************

  Synopsis    [Create Sop covers for one node that has changed.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Fxu_CreateCoversNode( Fxu_Matrix * p, Fxu_Data_t * pData, int iNode, Fxu_Cube * pCubeFirst, Fxu_Cube * pCubeNext )
{
    Vec_Int_t * vInputsNew;
    char * pSopCover, * pSopCube;
    Fxu_Var * pVar;
    Fxu_Cube * pCube;
    Fxu_Lit * pLit;
    int iNum, nCubes, v;

    // collect positive polarity variable in the cubes between pCubeFirst and pCubeNext
    Fxu_MatrixRingVarsStart( p );
    for ( pCube = pCubeFirst; pCube != pCubeNext; pCube = pCube->pNext )
        for ( pLit = pCube->lLits.pHead; pLit; pLit = pLit->pHNext )
        {
            pVar = p->ppVars[ 2 * (pLit->pVar->iVar/2) + 1 ];
            if ( pVar->pOrder == NULL )
                Fxu_MatrixRingVarsAdd( p, pVar );
        }
    Fxu_MatrixRingVarsStop( p );

    // collect the variable numbers
    vInputsNew = Vec_IntAlloc( 4 );
    Fxu_MatrixForEachVarInRing( p, pVar )
        Vec_IntPush( vInputsNew, pVar->iVar / 2 );
    Fxu_MatrixRingVarsUnmark( p );

    // sort the vars by their number
    Vec_IntSort( vInputsNew, 0 );

    // mark the vars with their numbers in the sorted array
    for ( v = 0; v < vInputsNew->nSize; v++ )
    {
        p->ppVars[ 2 * vInputsNew->pArray[v] + 0 ]->lLits.nItems = v; // hack - reuse lLits.nItems
        p->ppVars[ 2 * vInputsNew->pArray[v] + 1 ]->lLits.nItems = v; // hack - reuse lLits.nItems
    }

    // count the number of cubes
    nCubes = 0;
    for ( pCube = pCubeFirst; pCube != pCubeNext; pCube = pCube->pNext )
        if ( pCube->lLits.nItems )
            nCubes++;

    // allocate room for the new cover
    pSopCover = Abc_SopStart( pData->pManSop, nCubes, vInputsNew->nSize );
    // set the correct polarity of the cover
    if ( iNode < pData->nNodesOld && Abc_SopGetPhase( pData->vSops->pArray[iNode] ) == 0 )
        Abc_SopComplement( pSopCover );

    // add the cubes
    nCubes = 0;
    for ( pCube = pCubeFirst; pCube != pCubeNext; pCube = pCube->pNext )
    {
        if ( pCube->lLits.nItems == 0 )
            continue;
        // get hold of the SOP cube
        pSopCube = pSopCover + nCubes * (vInputsNew->nSize + 3);
        // insert literals
        for ( pLit = pCube->lLits.pHead; pLit; pLit = pLit->pHNext )
        {
            iNum = pLit->pVar->lLits.nItems; // hack - reuse lLits.nItems
            assert( iNum < vInputsNew->nSize );
            if ( pLit->pVar->iVar / 2 < pData->nNodesOld )
                pSopCube[iNum] = (pLit->pVar->iVar & 1)? '0' : '1';   // reverse CST
            else
                pSopCube[iNum] = (pLit->pVar->iVar & 1)? '1' : '0';   // no CST
        }
        // count the cube
        nCubes++;
    }
    assert( nCubes == Abc_SopGetCubeNum(pSopCover) );

    // set the new cover and the array of fanins
    pData->vSopsNew->pArray[iNode]   = pSopCover;
    pData->vFaninsNew->pArray[iNode] = vInputsNew;
}

/**Function*************************************************************

  Synopsis    [Adds the var to storage.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
Fxu_Cube * Fxu_CreateCoversFirstCube( Fxu_Matrix * p, Fxu_Data_t * pData, int iVar )
{
    int v;
    for ( v = iVar; v < pData->nNodesOld + pData->nNodesNew; v++ )
        if ( p->ppVars[ 2*v + 1 ]->pFirst )
            return p->ppVars[ 2*v + 1 ]->pFirst;
    return NULL;
}

/**Function*************************************************************

  Synopsis    [Compares the vars by their number.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
int Fxu_CreateMatrixLitCompare( int * ptrX, int * ptrY )
{
    return s_pLits[*ptrX] - s_pLits[*ptrY];
}

////////////////////////////////////////////////////////////////////////
///                       END OF FILE                                ///
////////////////////////////////////////////////////////////////////////


text:
using System.ComponentModel.DataAnnotations;

namespace Equinox.Infra.CrossCutting.Identity.Models.AccountViewModels
{
    public class ExternalLoginConfirmationViewModel
    {
        [Required]
        [EmailAddress]
        public string Email { get; set; }
    }
}


text:
class Event < ActiveRecord::Base
    belongs_to :user, foreign_key: :userid, primary_key: :userid
    belongs_to :layertype, foreign_key: :layername, primary_key: :name
    has_paper_trail
    scope :latest, -> { order(date: :asc) }
end


text:
#ifndef WEBRTC_VIDEO_VIE_ENCODER_H_
#define WEBRTC_VIDEO_VIE_ENCODER_H_

#include <map>
#include <vector>

#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/call/bitrate_allocator.h"
#include "webrtc/common_types.h"
#include "webrtc/frame_callback.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "webrtc/modules/video_coding/include/video_coding_defines.h"
#include "webrtc/modules/video_processing/include/video_processing.h"
#include "webrtc/typedefs.h"
#include "webrtc/video/video_capture_input.h"

namespace webrtc {

class BitrateAllocator;
class BitrateObserver;
class Config;
class CriticalSectionWrapper;
class EncodedImageCallback;
class PacedSender;
class PayloadRouter;
class ProcessThread;
class QMVideoSettingsCallback;
class SendStatisticsProxy;
class ViEBitrateObserver;
class ViEEffectFilter;
class VideoCodingModule;

class ViEEncoder : public RtcpIntraFrameObserver,
                   public VideoEncoderRateObserver,
                   public VCMPacketizationCallback,
                   public VCMSendStatisticsCallback,
                   public VideoCaptureCallback {
 public:
  friend class ViEBitrateObserver;

  ViEEncoder(uint32_t number_of_cores,
             ProcessThread* module_process_thread,
             SendStatisticsProxy* stats_proxy,
             I420FrameCallback* pre_encode_callback,
             PacedSender* pacer,
             BitrateAllocator* bitrate_allocator);
  ~ViEEncoder();

  bool Init();

  // This function is assumed to be called before any frames are delivered and
  // only once.
  // Ideally this would be done in Init, but the dependencies between ViEEncoder
  // and ViEChannel makes it really hard to do in a good way.
  void StartThreadsAndSetSharedMembers(
      rtc::scoped_refptr<PayloadRouter> send_payload_router,
      VCMProtectionCallback* vcm_protection_callback);

  // This function must be called before the corresponding ViEChannel is
  // deleted.
  void StopThreadsAndRemoveSharedMembers();

  void SetNetworkTransmissionState(bool is_transmitting);

  // Returns the id of the owning channel.
  int Owner() const;

  // Drops incoming packets before they get to the encoder.
  void Pause();
  void Restart();

  // Codec settings.
  int32_t RegisterExternalEncoder(VideoEncoder* encoder,
                                  uint8_t pl_type,
                                  bool internal_source);
  int32_t DeRegisterExternalEncoder(uint8_t pl_type);
  int32_t SetEncoder(const VideoCodec& video_codec);

  // Implementing VideoCaptureCallback.
  void DeliverFrame(VideoFrame video_frame) override;

  int32_t SendKeyFrame();

  uint32_t LastObservedBitrateBps() const;
  int CodecTargetBitrate(uint32_t* bitrate) const;
  // Loss protection. Must be called before SetEncoder() to have max packet size
  // updated according to protection.
  // TODO(pbos): Set protection method on construction or extract vcm_ outside
  // this class and set it on construction there.
  void SetProtectionMethod(bool nack, bool fec);

  // Buffering mode.
  void SetSenderBufferingMode(int target_delay_ms);

  // Implements VideoEncoderRateObserver.
  void OnSetRates(uint32_t bitrate_bps, int framerate) override;

  // Implements VCMPacketizationCallback.
  int32_t SendData(uint8_t payload_type,
                   const EncodedImage& encoded_image,
                   const RTPFragmentationHeader& fragmentation_header,
                   const RTPVideoHeader* rtp_video_hdr) override;
  void OnEncoderImplementationName(const char* implementation_name) override;

  // Implements VideoSendStatisticsCallback.
  int32_t SendStatistics(const uint32_t bit_rate,
                         const uint32_t frame_rate) override;

  // Implements RtcpIntraFrameObserver.
  void OnReceivedIntraFrameRequest(uint32_t ssrc) override;
  void OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) override;
  void OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) override;
  void OnLocalSsrcChanged(uint32_t old_ssrc, uint32_t new_ssrc) override;

  // Sets SSRCs for all streams.
  void SetSsrcs(const std::vector<uint32_t>& ssrcs);

  void SetMinTransmitBitrate(int min_transmit_bitrate_kbps);

  // Lets the sender suspend video when the rate drops below
  // |threshold_bps|, and turns back on when the rate goes back up above
  // |threshold_bps| + |window_bps|.
  void SuspendBelowMinBitrate();

  // New-style callbacks, used by VideoSendStream.
  void RegisterPostEncodeImageCallback(
        EncodedImageCallback* post_encode_callback);

  int GetPaddingNeededBps() const;

 protected:
  // Called by BitrateObserver.
  void OnNetworkChanged(uint32_t bitrate_bps,
                        uint8_t fraction_lost,
                        int64_t round_trip_time_ms);

 private:
  bool EncoderPaused() const EXCLUSIVE_LOCKS_REQUIRED(data_cs_);
  void TraceFrameDropStart() EXCLUSIVE_LOCKS_REQUIRED(data_cs_);
  void TraceFrameDropEnd() EXCLUSIVE_LOCKS_REQUIRED(data_cs_);

  const uint32_t number_of_cores_;

  const rtc::scoped_ptr<VideoProcessing> vp_;
  const rtc::scoped_ptr<QMVideoSettingsCallback> qm_callback_;
  const rtc::scoped_ptr<VideoCodingModule> vcm_;
  rtc::scoped_refptr<PayloadRouter> send_payload_router_;

  rtc::scoped_ptr<CriticalSectionWrapper> data_cs_;
  rtc::scoped_ptr<BitrateObserver> bitrate_observer_;

  SendStatisticsProxy* const stats_proxy_;
  I420FrameCallback* const pre_encode_callback_;
  PacedSender* const pacer_;
  BitrateAllocator* const bitrate_allocator_;

  // The time we last received an input frame or encoded frame. This is used to
  // track when video is stopped long enough that we also want to stop sending
  // padding.
  int64_t time_of_last_frame_activity_ms_ GUARDED_BY(data_cs_);
  VideoCodec encoder_config_ GUARDED_BY(data_cs_);
  int min_transmit_bitrate_kbps_ GUARDED_BY(data_cs_);
  uint32_t last_observed_bitrate_bps_ GUARDED_BY(data_cs_);
  int target_delay_ms_ GUARDED_BY(data_cs_);
  bool network_is_transmitting_ GUARDED_BY(data_cs_);
  bool encoder_paused_ GUARDED_BY(data_cs_);
  bool encoder_paused_and_dropped_frame_ GUARDED_BY(data_cs_);
  std::map<unsigned int, int64_t> time_last_intra_request_ms_
      GUARDED_BY(data_cs_);

  ProcessThread* module_process_thread_;

  bool has_received_sli_ GUARDED_BY(data_cs_);
  uint8_t picture_id_sli_ GUARDED_BY(data_cs_);
  bool has_received_rpsi_ GUARDED_BY(data_cs_);
  uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_);
  std::map<uint32_t, int> ssrc_streams_ GUARDED_BY(data_cs_);

  bool video_suspended_ GUARDED_BY(data_cs_);
};

}  // namespace webrtc

#endif  // WEBRTC_VIDEO_VIE_ENCODER_H_


text:
module Fudge
  #Generator for default Fudgefile
  class Generator
    attr_reader :pwd

    def initialize(pwd)
      @pwd = pwd
    end

    #Writes the fudgefile to initialized directory unless on present
    def write_fudgefile
      if exists?
        "Fudgefile already exists."
      else
        writer { |file| file << build_templated }
        "Fudgefile created."
      end
    end

    private

    def writer
      File.open(path, 'w') { |f| yield f }
    end

    def path
      @path ||= File.expand_path('Fudgefile', pwd)
    end

    def exists?
      File.exists?(path)
    end

    def build_templated
      contents = ""
      contents << "build :default do\n"
      contents << "  task :rspec\n"
      contents << "end"
    end

  end
end


text:
require 'rubygems'
require 'treequel'
require 'treequel/controls/pagedresults'

unless ARGV[0]
	$stderr.puts "Please give a page size."
	exit
end
page_size = ARGV[0].to_i

dir = Treequel.directory
dir.register_controls( Treequel::PagedResultsControl )

#Treequel.logger.level = Logger::DEBUG
people = dir.ou( :people ).filter( :objectClass => 'person' ).with_paged_results( page_size )

count = page = 0
begin
	records = people.all
	count += records.length
	page += 1

	$stderr.puts "Page %d has %d entries." % [ page, records.length ],
		"That's %d entries in total." % [ count ]
	$stderr.puts "Cookie is: 0x%s" % [ people.paged_results_cookie.unpack('H*').first ]
end while people.has_more_results?


text:
<TITLE>Review for Phantom, The (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Phantom, The (1996)

reviewed by
Mark R. Leeper

                                THE PHANTOM
                      A film review by Mark R. Leeper
                       Copyright 1996 Mark R. Leeper

               Capsule: Another comic strip character makes
          it to the big screen as Lee Falk's Phantom becomes
          involved in a chase for three mystical skulls.  The
          plot has more holes than the face of The Phantom's
          cave but does have some of the feel of the old
          serials.  Billy Zane is a curious choice for The
          Phantom, but he manages to hold his own.  This is
          not a good film--along similar lines I much prefer
          THE SHADOW--but does have some fun.  Still, not
          enough for actual respect.  Rating: high 0 (-4 to
          +4) (Minor spoilers in the review.)

     The legend of The Phantom began in the 16th Century when off the
shores of the Island of Bangalla ("Bengalla" in the film) Singg pirates
captured a British merchantman ship and put all to the sword but for a
young boy, Kit, who dived over the side just in time to see his father
killed.  The boy swam to shore and was rescued by pygmies (not so small
in the film).  The boy swore revenge on the pirate who killed his
beloved father, but days later he found the pirate washed up on shore
dead.  His goal in life gone, he instead devoted his life to fighting
piracy, greed, cruelty, and injustice wherever it occurred.  He swore
that this would be not just his mission, but that of his sons and their
sons.  When he died they would carry on after him.  So began a long
line of Phantoms.  As there always was a Phantom around fighting evil,
even as generations and even centuries passed, the legend grew that The
Phantom could not die.  He could appear to die, but would return ever
and again looking just the same.  He was called "The Man Who Cannot
Die" and "The Ghost Who Walks."  The pygmies kept the secret that The
Phantom was a mortal and gave each Phantom the secrets of their
deadliest hunting poisons.  He made his home Skull Cave in the deep
woods of Bangalla and found other Skull Caves in other parts of the
world including the American Southwest.  From these he could fight
evil-doers everywhere.  But when one Phantom's adventures were ended a
Phantom would always return to Bangalla, his true home.  The pygmies
knew that the day would come when each Phantom would die, usually
violently, and The Phantom's son would be summoned to don the costume
and assume the role of The Phantom.

     I have to admit that even as a child I was not very interested in
The Phantom.  He was just about the least intriguing-looking super-hero
I could think of.  A black mask and a skin-tight purple suit was just
too little costume.  He looked a lot like a professional wrestler.  But
what really unsold me on The Phantom were his garish purple and black
diagonally striped shorts (missing in the film).  Because I thought the
shorts looked silly, the stories probably never got much of a chance to
impress me, though modern critics say that it was one of the better
adventure comic strips.  The Phantom was the creation of Lee Falk, who
previously had created Mandrake the Magician.  The strip began its long
run on February 17, 1936, and sixty years later it was still running.
The strip was adapted into a fifteen-chapter Columbia serial in 1943,
with Tom Tyler playing the title role.  Now, with the character a
little over sixty years old, The Phantom is back on the wide screen in
a story with a strong serial feel.

     The year is 1938 and the world is in turmoil as dictators try to
bring about a New World Order.  The United States has its own would-be
dictator, the ruthless gangster/businessman Xander Drax (played by
Treat Williams).  Drax's plan to is to get power through the use of
supernatural means.  He wants to gain possession of three mystical
jeweled skulls which when brought together will bring their owner about
the same power that the Lost Ark would.  (And this film does borrow
heavily and repeatedly from RAIDERS OF THE LOST ARK, albeit lacking the
style to make it all work.)  As the film opens we see three ruthless
Indiana-Jones-like characters who have tracked the first skull to the
Island of Bengalla (ugh-oh!).  The skull is in a cave somewhere in the
deep woods (UGH-OH!).  But it is safe, you see, because one of the
mercenary explorers had actually killed The Phantom several years
before (Dead meat!!!).  Out of the forest, on a white horse and
followed by the wolf, Devil, comes riding The Phantom.  And so begins
an adventure that will carry The Phantom to New York City and later to
a meeting with the last descendants of the Singg pirates, killers of
the father of the original Phantom.

     Billy Zane is a reasonable actor, best remembered, at least by me,
as the sea-going psychopath in the taut thriller DEAD CALM.  And in the
purple suit he physically looks the part, even without the striped
shorts.  Treat Williams plays his villain with a subtle tongue-in-
cheek.  He does not interpret the role so broadly that he could be in a
Batman film, but he is not really playing it straight either.  Kristy
Swanson, known too well as BUFFY, THE VAMPIRE SLAYER, puts the most
character in her maiden-in-distress that I have seen from her in any
film, but she has a long way to go.  And veteran Patrick McGoohan is
known for underplaying his roles and so fits right in.  Some of the
most interesting faces are in bit parts: a gangster here, a cab driver
there.

     Perhaps the most intriguing part about Jeffrey Boam's script is
its unwillingness to commit to whether The Phantom is supernatural or
not.  The legend is that The Phantom is supernatural and supposedly the
truth is that he is not, but there are bits in the film that imply he
is able to do what no mortal man could.  Does he commune with the ghost
of his father or is it only a memory?  The supernatural certainly
mingles with the natural world in this film.  Some of his abilities
seem to be just on the edge of what is naturally possible, but it could
be just the writing.  Certainly Boam is willing to contrive some absurd
coincidences, particularly having villains fall a little too perfectly
into some set traps.

     One problem with the script is that while it is sort of explained
how The Phantoms find mates to extend their line, it is a little less
clear how the Singg pirates find sufficient mates considering where
they are.  Nor is it really clear why, lacking the dedication of the
Phantoms, they continue their line in the same profession.  And it is a
little hokey having everybody be descendants of originals, repeating
the same battles that have gone on for 400 years.  Many of the scenes
are not staged very well.  When someone swings on a rope, if you watch
the angle that the rope hangs you will see definite continuity errors.
One odd departure from the original suit is the addition of surface
designs.  It is like little black lines were added to accentuate muscle
definition.  One absurd scene has the wolf Devil apparently talking to
The Phantom's white horse and telling the horse where to go to pick up
his master.  The horse then outruns an airplane.  Some horse.  There is
little on-screen violence, but there is a gruesome scene of implied
violence (borrowed from the film THE HORRORS OF THE BLACK MUSEUM).

     In spite of a valiant effort to recreate a feel of the 1930s, THE
PHANTOM never really works perfectly and often not even well.  Then
again the same can be said of the old serials.  And it is good-natured
fun in the style of the old movie serials.  If you did not like THE
SHADOW which had a good deal more panache, it is a good bet you will
not like THE PHANTOM.  For the sake of that fun I give it a high 0 on
the -4 to +4 scale.

                                        Mark R. Leeper
                                        mleeper@lucent.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
using System.Collections.ObjectModel;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Model.RequestParams.Leads;
using VkNet.Utils;

namespace VkNet.Categories
{
	/// <inheritdoc />
	public partial class LeadsCategory : ILeadsCategory
	{
		/// <summary>
		/// API.
		/// </summary>
		private readonly IVkApiInvoke _vk;

		/// <inheritdoc />
		/// <param name="api">
		/// Api vk.com
		/// </param>
		public LeadsCategory(VkApi api = null)
		{
			_vk = api;
		}

		/// <inheritdoc />
		public Checked CheckUser(CheckUserParams checkUserParams)
		{
			var result = new VkParameters
			{
					{ "lead_id", checkUserParams.LeadId }
					, { "country", checkUserParams.Country }
					, { "test_result", checkUserParams.TestResult }
					, { "test_mode", checkUserParams.TestMode }
					, { "auto_start", checkUserParams.AutoStart }
					, { "age", checkUserParams.Age }
			};

			return _vk.Call<Checked>(methodName: "leads.checkUser", parameters: result);
		}

		/// <inheritdoc />
		public LeadsComplete Complete(string vkSid, string secret, string comment)
		{
			return _vk.Call<LeadsComplete>(methodName: "leads.complete"
					, parameters: new VkParameters
					{
							{ "vk_sid", vkSid }
							, { "secret", secret }
							, { "comment", comment }
					});
		}

		/// <inheritdoc />
		public Lead GetStats(ulong leadId, string secret, string dateStart, string dateEnd)
		{
			return _vk.Call<Lead>(methodName: "leads.getStats"
					, parameters: new VkParameters
					{
							{ "lead_id", leadId }
							, { "secret", secret }
							, { "date_start", dateStart }
							, { "date_end", dateEnd }
					});
		}

		/// <inheritdoc />
		public ReadOnlyCollection<Entry> GetUsers(GetUsersParams getUsersParams)
		{
			var result = new VkParameters
			{
					{ "offer_id", getUsersParams.OfferId }
					, { "secret", getUsersParams.Secret }
					, { "offset", getUsersParams.Offset }
					, { "count", getUsersParams.Count }
					, { "status", getUsersParams.Status }
					, { "reverse", getUsersParams.Reverse }
			};

			return _vk.Call<ReadOnlyCollection<Entry>>(methodName: "leads.getUsers", parameters: result);
		}

		/// <inheritdoc />
		public MetricHitResponse MetricHit(string data)
		{
			return _vk.Call<MetricHitResponse>(methodName: "leads.metricHit"
					, parameters: new VkParameters
					{
							{ "data", data }
					});
		}

		/// <inheritdoc />
		public Start Start(StartParams startParams)
		{
			var result = new VkParameters
			{
					{ "lead_id", startParams.LeadId }
					, { "secret", startParams.Secret }
					, { "uid", startParams.Uid }
					, { "aid", startParams.Aid }
					, { "test_mode", startParams.TestMode }
					, { "force", startParams.Force }
			};

			return _vk.Call<Start>(methodName: "leads.start", parameters: result);
		}
	}
}


text:
/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package org.apache.hadoop.hbase.avro.generated;
@SuppressWarnings("all")
public class AColumn extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  public static final org.apache.avro.Schema SCHEMA$ = org.apache.avro.Schema.parse("{\"type\":\"record\",\"name\":\"AColumn\",\"namespace\":\"org.apache.hadoop.hbase.avro.generated\",\"fields\":[{\"name\":\"family\",\"type\":\"bytes\"},{\"name\":\"qualifier\",\"type\":[\"bytes\",\"null\"]}]}");
  public java.nio.ByteBuffer family;
  public java.nio.ByteBuffer qualifier;
  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call.
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return family;
    case 1: return qualifier;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }
  // Used by DatumReader.  Applications should not call.
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: family = (java.nio.ByteBuffer)value$; break;
    case 1: qualifier = (java.nio.ByteBuffer)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Anhalonium elongatum Salm-Dyck

### Remarks
null


text:
package com.twitter.common.util.testing;

import java.util.concurrent.TimeUnit;

import com.google.common.base.Preconditions;
import com.google.common.base.Ticker;

import org.omg.CORBA.PUBLIC_MEMBER;

import com.twitter.common.quantity.Amount;
import com.twitter.common.quantity.Time;

/**
 * A ticker for use in testing with a configurable value for {@link #Ticker#read()}.
 */
public class FakeTicker extends Ticker{
  private long nowNanos;

  /**
   * Sets what {@link #read()} will return until this method is called again with a new value
   * for {@code now}.
   *
   * @param nowNanos the current time in nanoseconds
   */
  public void setNowNanos(long nowNanos) {
    this.nowNanos = nowNanos;
  }

  @Override
  public long read(){
    return nowNanos;
  }

  /**
   * Advances the current time by the given {@code period}.  Time can be retarded by passing a
   * negative value.
   *
   * @param period the amount of time to advance the current time by
   */
  public void advance(Amount<Long, Time> period) {
    Preconditions.checkNotNull(period);
    nowNanos = nowNanos + period.as(Time.NANOSECONDS);
  }

  /**
   * Waits in fake time, immediately returning in real time; however a check of {@link #Ticker#read()}
   * after this method completes will consistently reveal that {@code nanos} did in fact pass while
   * waiting.
   *
   * @param nanos the amount of time to wait in nanoseconds
   */
  public void waitNanos(long nanos) {
    advance(Amount.of(nanos, Time.NANOSECONDS));
  }
}


text:
package org.patriques.input.symbol;

import org.patriques.input.ApiParameter;

/**
 * @author ilker Kopan
 */
public class ToSymbol implements ApiParameter {
    String toSymbol;

    public ToSymbol(String toSymbol) {
        this.toSymbol = toSymbol;
    }

    @Override
    public String getKey() {
        return "to_symbol";
    }

    @Override
    public String getValue() {
        return toSymbol;
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace More.Net.Windows
{
    public static class DependencyObjectEx
    {
        //public static TValue GetValue<TValue, TOwner>(this TOwner source)
        //    where TOwner : DependencyObject
        //{

        //}
    }
}


text:
require 'rails_helper'

RSpec.describe VendorsController, :type => :controller do

  let(:test_user) { create(:admin) }

  before(:each) do
    test_user.organizations << test_user.organization
    test_user.viewable_organizations << test_user.organization
    test_user.save!
    sign_in test_user
  end

  it 'GET index' do
    test_vendor = create(:vendor, :organization => subject.current_user.organization)
    get :index

    expect(assigns(:vendors)).to include(test_vendor)
  end

  it 'GET filter' do
    test_vendor = create(:vendor, :organization => subject.current_user.organization)
    get :filter, params: {:query => test_vendor.name, :format => :json}

    expect(JSON.parse(response.body)).to include({"id" => test_vendor.id, "name" => test_vendor.name})
  end

  it 'GET show' do
    test_vendor = create(:vendor, :organization => subject.current_user.organization)
    get :show, params: {:id => test_vendor.object_key}

    expect(assigns(:vendor)).to eq(test_vendor)
  end

  it 'GET new' do
    get :new

    expect(assigns(:vendor).to_json).to eq(Vendor.new.to_json)
  end

  it 'GET edit' do
    test_vendor = create(:vendor, :organization => subject.current_user.organization)
    get :edit, params: {:id => test_vendor.object_key}

    expect(assigns(:vendor)).to eq(test_vendor)
  end

  it 'POST create' do
    post :create, params: {:vendor => attributes_for(:vendor, :name => 'vendor name2', :organization_id => subject.current_user.organization_id)}

    expect(assigns(:vendor).name).to eq('vendor name2')
  end

  it 'POST update' do
    test_vendor = create(:vendor, :organization => subject.current_user.organization)

    post :update, params: {:id => test_vendor.object_key, :vendor => {:name => 'vendor name3'}}
    test_vendor.reload

    expect(test_vendor.name).to eq('vendor name3')
  end

  it 'DELETE destroy' do
    test_vendor = create(:vendor, :organization => subject.current_user.organization)

    delete :destroy, params: {:id => test_vendor.object_key}

    expect(Vendor.find_by(:object_key => test_vendor.object_key)).to be nil
  end

end


text:
A simple, but very fast, S3 client for Ruby supporting
synchronous (net-http) and asynchronous (em+fibers) io.

## Examples

```ruby
require 'uber-s3'

##########################################################################
# Connecting to S3
# adapter can be :net_http or :em_http_fibered
s3 = UberS3.new({
  :access_key         => 'abc',
  :secret_access_key  => 'def',
  :bucket             => 'funbucket',
  :adapter            => :em_http_fibered
})

##########################################################################
# Saving objects
s3.store('/test.txt', 'Look ma no hands')
s3.store('test2.txt', 'Hey hey', :access => :public_read)

o = s3.object('/test.txt')
o.value = 'Look ma no hands'
o.save

# or..

o = UberS3::Object.new(s3.bucket, '/test.txt', 'heyo')
o.save # => true

##########################################################################
# Reading objects
s3['/test.txt'].class       # => UberS3::Object
s3['/test.txt'].value       # => 'heyo'
s3.get('/test.txt').value   # => 'heyo'

s3.exists?('/anotherone')   # => false

##########################################################################
# Object access control

o.access = :private
o.access = :public_read
# etc.

# Valid options:
# :private, :public_read, :public_read_write, :authenticated_read

# See http://docs.amazonwebservices.com/AmazonS3/2006-03-01/dev/index.html?RESTAccessPolicy.html
# NOTE: default object access level is :private

##########################################################################
# Deleting objects
o.delete # => true

##########################################################################
# Save optional parameters
# See http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?RESTObjectPUT.html

options = { :access => :public_read, :content_type => 'text/plain' }
o = UberS3::Object.new(client.bucket, '/test.txt', 'heyo', options)
o.save

# or..

o = s3.object('/test.txt')
o.value = 'Look ma no hands'
o.access = :public_read
o.content_type = 'text/plain'
o.save

# List of parameter methods:
# :access               -- Object access control
# :cache_control        -- http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
# :content_disposition  -- http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
# :content_encoding     -- http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
# :content_md5          -- End-to-end integrity check
# :content_type         -- http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
# :expires              -- Number of milliseconds before expiration
# :storage_class        -- Amazon S3's storage levels (redundancy for price)

##########################################################################
# Iterating objects in a bucket
s3.objects('/path').each {|obj| puts obj }

```

## Ruby version notes

* Tested on MRI 1.9.2, MRI 1.9.3 (net_http / em_http_fibered adapters)
* Tested on JRuby 1.7-dev in 1.9 mode (net_http)
* Ruby 1.8.7 works for net/http clients, em_http_fibered adapter requires fibers

## Other notes

* If Nokogiri is available, it will be automatically used instead of REXML

## TODO

* Refactor UberS3::Object class, consider putting the operations/headers into separate classes
* Better exception handling and reporting
* Query string authentication -- neat feature for providing temporary public access to a private object
* Object versioning support

## Benchmarks

Benchmarks were run with a speedy MBP on a 10Mbit connection

### Saving lots of 1KB files

                                                       user     system      total        real
saving 100x1024 byte objects (net-http)            0.160000   0.080000   0.240000 ( 26.128499)
saving 100x1024 byte objects (em-http-fibered)     0.080000   0.030000   0.110000 (  0.917334)

### Saving lots of 500KB files

                                                       user     system      total        real
saving 100x512000 byte objects (net-http)          0.190000   0.740000   0.930000 ( 91.559123)
saving 100x512000 byte objects (em-http-fibered)   0.230000   0.700000   0.930000 ( 45.119033)

### Conclusion

Yea... async adapter dominates. The 100x1KB files were 29x faster to upload, and the 100x500KB files were only 2x faster, but that is because my upload bandwidth was tapped.

## S3 API Docs

- S3 REST API: http://docs.amazonwebservices.com/AmazonS3/latest/API/
- S3 Request Authorization: http://docs.amazonwebservices.com/AmazonS3/latest/dev/RESTAuthentication.html

## License

MIT License - Copyright (c) 2012 Nulayer Inc.