text:
#pragma once
#include <aws/ssm/SSM_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/DateTime.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace SSM
{
namespace Model
{

  /**
   *
Represents metadata about a patch.

See Also:
   AWS API
   * Reference

   */
  class AWS_SSM_API Patch
  {
  public:
    Patch();
    Patch(const Aws::Utils::Json::JsonValue& jsonValue);
    Patch& operator=(const Aws::Utils::Json::JsonValue& jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The ID of the patch (this is different than the Microsoft Knowledge Base
     * ID).

     */
    inline const Aws::String& GetId() const{ return m_id; }

    /**
     *
The ID of the patch (this is different than the Microsoft Knowledge Base
     * ID).

     */
    inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; }

    /**
     *
The ID of the patch (this is different than the Microsoft Knowledge Base
     * ID).

     */
    inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); }

    /**
     *
The ID of the patch (this is different than the Microsoft Knowledge Base
     * ID).

     */
    inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); }

    /**
     *
The ID of the patch (this is different than the Microsoft Knowledge Base
     * ID).

     */
    inline Patch& WithId(const Aws::String& value) { SetId(value); return *this;}

    /**
     *
The ID of the patch (this is different than the Microsoft Knowledge Base
     * ID).

     */
    inline Patch& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}

    /**
     *
The ID of the patch (this is different than the Microsoft Knowledge Base
     * ID).

     */
    inline Patch& WithId(const char* value) { SetId(value); return *this;}

    /**
     *
The date the patch was released.

     */
    inline const Aws::Utils::DateTime& GetReleaseDate() const{ return m_releaseDate; }

    /**
     *
The date the patch was released.

     */
    inline void SetReleaseDate(const Aws::Utils::DateTime& value) { m_releaseDateHasBeenSet = true; m_releaseDate = value; }

    /**
     *
The date the patch was released.

     */
    inline void SetReleaseDate(Aws::Utils::DateTime&& value) { m_releaseDateHasBeenSet = true; m_releaseDate = std::move(value); }

    /**
     *
The date the patch was released.

     */
    inline Patch& WithReleaseDate(const Aws::Utils::DateTime& value) { SetReleaseDate(value); return *this;}

    /**
     *
The date the patch was released.

     */
    inline Patch& WithReleaseDate(Aws::Utils::DateTime&& value) { SetReleaseDate(std::move(value)); return *this;}

    /**
     *
The title of the patch.

     */
    inline const Aws::String& GetTitle() const{ return m_title; }

    /**
     *
The title of the patch.

     */
    inline void SetTitle(const Aws::String& value) { m_titleHasBeenSet = true; m_title = value; }

    /**
     *
The title of the patch.

     */
    inline void SetTitle(Aws::String&& value) { m_titleHasBeenSet = true; m_title = std::move(value); }

    /**
     *
The title of the patch.

     */
    inline void SetTitle(const char* value) { m_titleHasBeenSet = true; m_title.assign(value); }

    /**
     *
The title of the patch.

     */
    inline Patch& WithTitle(const Aws::String& value) { SetTitle(value); return *this;}

    /**
     *
The title of the patch.

     */
    inline Patch& WithTitle(Aws::String&& value) { SetTitle(std::move(value)); return *this;}

    /**
     *
The title of the patch.

     */
    inline Patch& WithTitle(const char* value) { SetTitle(value); return *this;}

    /**
     *
The description of the patch.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
The description of the patch.

     */
    inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }

    /**
     *
The description of the patch.

     */
    inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); }

    /**
     *
The description of the patch.

     */
    inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }

    /**
     *
The description of the patch.

     */
    inline Patch& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
The description of the patch.

     */
    inline Patch& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}

    /**
     *
The description of the patch.

     */
    inline Patch& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
The URL where more information can be obtained about the patch.

     */
    inline const Aws::String& GetContentUrl() const{ return m_contentUrl; }

    /**
     *
The URL where more information can be obtained about the patch.

     */
    inline void SetContentUrl(const Aws::String& value) { m_contentUrlHasBeenSet = true; m_contentUrl = value; }

    /**
     *
The URL where more information can be obtained about the patch.

     */
    inline void SetContentUrl(Aws::String&& value) { m_contentUrlHasBeenSet = true; m_contentUrl = std::move(value); }

    /**
     *
The URL where more information can be obtained about the patch.

     */
    inline void SetContentUrl(const char* value) { m_contentUrlHasBeenSet = true; m_contentUrl.assign(value); }

    /**
     *
The URL where more information can be obtained about the patch.

     */
    inline Patch& WithContentUrl(const Aws::String& value) { SetContentUrl(value); return *this;}

    /**
     *
The URL where more information can be obtained about the patch.

     */
    inline Patch& WithContentUrl(Aws::String&& value) { SetContentUrl(std::move(value)); return *this;}

    /**
     *
The URL where more information can be obtained about the patch.

     */
    inline Patch& WithContentUrl(const char* value) { SetContentUrl(value); return *this;}

    /**
     *
The name of the vendor providing the patch.

     */
    inline const Aws::String& GetVendor() const{ return m_vendor; }

    /**
     *
The name of the vendor providing the patch.

     */
    inline void SetVendor(const Aws::String& value) { m_vendorHasBeenSet = true; m_vendor = value; }

    /**
     *
The name of the vendor providing the patch.

     */
    inline void SetVendor(Aws::String&& value) { m_vendorHasBeenSet = true; m_vendor = std::move(value); }

    /**
     *
The name of the vendor providing the patch.

     */
    inline void SetVendor(const char* value) { m_vendorHasBeenSet = true; m_vendor.assign(value); }

    /**
     *
The name of the vendor providing the patch.

     */
    inline Patch& WithVendor(const Aws::String& value) { SetVendor(value); return *this;}

    /**
     *
The name of the vendor providing the patch.

     */
    inline Patch& WithVendor(Aws::String&& value) { SetVendor(std::move(value)); return *this;}

    /**
     *
The name of the vendor providing the patch.

     */
    inline Patch& WithVendor(const char* value) { SetVendor(value); return *this;}

    /**
     *
The product family the patch is applicable for (for example, Windows).

     */
    inline const Aws::String& GetProductFamily() const{ return m_productFamily; }

    /**
     *
The product family the patch is applicable for (for example, Windows).

     */
    inline void SetProductFamily(const Aws::String& value) { m_productFamilyHasBeenSet = true; m_productFamily = value; }

    /**
     *
The product family the patch is applicable for (for example, Windows).

     */
    inline void SetProductFamily(Aws::String&& value) { m_productFamilyHasBeenSet = true; m_productFamily = std::move(value); }

    /**
     *
The product family the patch is applicable for (for example, Windows).

     */
    inline void SetProductFamily(const char* value) { m_productFamilyHasBeenSet = true; m_productFamily.assign(value); }

    /**
     *
The product family the patch is applicable for (for example, Windows).

     */
    inline Patch& WithProductFamily(const Aws::String& value) { SetProductFamily(value); return *this;}

    /**
     *
The product family the patch is applicable for (for example, Windows).

     */
    inline Patch& WithProductFamily(Aws::String&& value) { SetProductFamily(std::move(value)); return *this;}

    /**
     *
The product family the patch is applicable for (for example, Windows).

     */
    inline Patch& WithProductFamily(const char* value) { SetProductFamily(value); return *this;}

    /**
     *
The specific product the patch is applicable for (for example,
     * WindowsServer2016).

     */
    inline const Aws::String& GetProduct() const{ return m_product; }

    /**
     *
The specific product the patch is applicable for (for example,
     * WindowsServer2016).

     */
    inline void SetProduct(const Aws::String& value) { m_productHasBeenSet = true; m_product = value; }

    /**
     *
The specific product the patch is applicable for (for example,
     * WindowsServer2016).

     */
    inline void SetProduct(Aws::String&& value) { m_productHasBeenSet = true; m_product = std::move(value); }

    /**
     *
The specific product the patch is applicable for (for example,
     * WindowsServer2016).

     */
    inline void SetProduct(const char* value) { m_productHasBeenSet = true; m_product.assign(value); }

    /**
     *
The specific product the patch is applicable for (for example,
     * WindowsServer2016).

     */
    inline Patch& WithProduct(const Aws::String& value) { SetProduct(value); return *this;}

    /**
     *
The specific product the patch is applicable for (for example,
     * WindowsServer2016).

     */
    inline Patch& WithProduct(Aws::String&& value) { SetProduct(std::move(value)); return *this;}

    /**
     *
The specific product the patch is applicable for (for example,
     * WindowsServer2016).

     */
    inline Patch& WithProduct(const char* value) { SetProduct(value); return *this;}

    /**
     *
The classification of the patch (for example, SecurityUpdates, Updates,
     * CriticalUpdates).

     */
    inline const Aws::String& GetClassification() const{ return m_classification; }

    /**
     *
The classification of the patch (for example, SecurityUpdates, Updates,
     * CriticalUpdates).

     */
    inline void SetClassification(const Aws::String& value) { m_classificationHasBeenSet = true; m_classification = value; }

    /**
     *
The classification of the patch (for example, SecurityUpdates, Updates,
     * CriticalUpdates).

     */
    inline void SetClassification(Aws::String&& value) { m_classificationHasBeenSet = true; m_classification = std::move(value); }

    /**
     *
The classification of the patch (for example, SecurityUpdates, Updates,
     * CriticalUpdates).

     */
    inline void SetClassification(const char* value) { m_classificationHasBeenSet = true; m_classification.assign(value); }

    /**
     *
The classification of the patch (for example, SecurityUpdates, Updates,
     * CriticalUpdates).

     */
    inline Patch& WithClassification(const Aws::String& value) { SetClassification(value); return *this;}

    /**
     *
The classification of the patch (for example, SecurityUpdates, Updates,
     * CriticalUpdates).

     */
    inline Patch& WithClassification(Aws::String&& value) { SetClassification(std::move(value)); return *this;}

    /**
     *
The classification of the patch (for example, SecurityUpdates, Updates,
     * CriticalUpdates).

     */
    inline Patch& WithClassification(const char* value) { SetClassification(value); return *this;}

    /**
     *
The severity of the patch (for example Critical, Important, Moderate).

     */
    inline const Aws::String& GetMsrcSeverity() const{ return m_msrcSeverity; }

    /**
     *
The severity of the patch (for example Critical, Important, Moderate).

     */
    inline void SetMsrcSeverity(const Aws::String& value) { m_msrcSeverityHasBeenSet = true; m_msrcSeverity = value; }

    /**
     *
The severity of the patch (for example Critical, Important, Moderate).

     */
    inline void SetMsrcSeverity(Aws::String&& value) { m_msrcSeverityHasBeenSet = true; m_msrcSeverity = std::move(value); }

    /**
     *
The severity of the patch (for example Critical, Important, Moderate).

     */
    inline void SetMsrcSeverity(const char* value) { m_msrcSeverityHasBeenSet = true; m_msrcSeverity.assign(value); }

    /**
     *
The severity of the patch (for example Critical, Important, Moderate).

     */
    inline Patch& WithMsrcSeverity(const Aws::String& value) { SetMsrcSeverity(value); return *this;}

    /**
     *
The severity of the patch (for example Critical, Important, Moderate).

     */
    inline Patch& WithMsrcSeverity(Aws::String&& value) { SetMsrcSeverity(std::move(value)); return *this;}

    /**
     *
The severity of the patch (for example Critical, Important, Moderate).

     */
    inline Patch& WithMsrcSeverity(const char* value) { SetMsrcSeverity(value); return *this;}

    /**
     *
The Microsoft Knowledge Base ID of the patch.

     */
    inline const Aws::String& GetKbNumber() const{ return m_kbNumber; }

    /**
     *
The Microsoft Knowledge Base ID of the patch.

     */
    inline void SetKbNumber(const Aws::String& value) { m_kbNumberHasBeenSet = true; m_kbNumber = value; }

    /**
     *
The Microsoft Knowledge Base ID of the patch.

     */
    inline void SetKbNumber(Aws::String&& value) { m_kbNumberHasBeenSet = true; m_kbNumber = std::move(value); }

    /**
     *
The Microsoft Knowledge Base ID of the patch.

     */
    inline void SetKbNumber(const char* value) { m_kbNumberHasBeenSet = true; m_kbNumber.assign(value); }

    /**
     *
The Microsoft Knowledge Base ID of the patch.

     */
    inline Patch& WithKbNumber(const Aws::String& value) { SetKbNumber(value); return *this;}

    /**
     *
The Microsoft Knowledge Base ID of the patch.

     */
    inline Patch& WithKbNumber(Aws::String&& value) { SetKbNumber(std::move(value)); return *this;}

    /**
     *
The Microsoft Knowledge Base ID of the patch.

     */
    inline Patch& WithKbNumber(const char* value) { SetKbNumber(value); return *this;}

    /**
     *
The ID of the MSRC bulletin the patch is related to.

     */
    inline const Aws::String& GetMsrcNumber() const{ return m_msrcNumber; }

    /**
     *
The ID of the MSRC bulletin the patch is related to.

     */
    inline void SetMsrcNumber(const Aws::String& value) { m_msrcNumberHasBeenSet = true; m_msrcNumber = value; }

    /**
     *
The ID of the MSRC bulletin the patch is related to.

     */
    inline void SetMsrcNumber(Aws::String&& value) { m_msrcNumberHasBeenSet = true; m_msrcNumber = std::move(value); }

    /**
     *
The ID of the MSRC bulletin the patch is related to.

     */
    inline void SetMsrcNumber(const char* value) { m_msrcNumberHasBeenSet = true; m_msrcNumber.assign(value); }

    /**
     *
The ID of the MSRC bulletin the patch is related to.

     */
    inline Patch& WithMsrcNumber(const Aws::String& value) { SetMsrcNumber(value); return *this;}

    /**
     *
The ID of the MSRC bulletin the patch is related to.

     */
    inline Patch& WithMsrcNumber(Aws::String&& value) { SetMsrcNumber(std::move(value)); return *this;}

    /**
     *
The ID of the MSRC bulletin the patch is related to.

     */
    inline Patch& WithMsrcNumber(const char* value) { SetMsrcNumber(value); return *this;}

    /**
     *
The language of the patch if it's language-specific.

     */
    inline const Aws::String& GetLanguage() const{ return m_language; }

    /**
     *
The language of the patch if it's language-specific.

     */
    inline void SetLanguage(const Aws::String& value) { m_languageHasBeenSet = true; m_language = value; }

    /**
     *
The language of the patch if it's language-specific.

     */
    inline void SetLanguage(Aws::String&& value) { m_languageHasBeenSet = true; m_language = std::move(value); }

    /**
     *
The language of the patch if it's language-specific.

     */
    inline void SetLanguage(const char* value) { m_languageHasBeenSet = true; m_language.assign(value); }

    /**
     *
The language of the patch if it's language-specific.

     */
    inline Patch& WithLanguage(const Aws::String& value) { SetLanguage(value); return *this;}

    /**
     *
The language of the patch if it's language-specific.

     */
    inline Patch& WithLanguage(Aws::String&& value) { SetLanguage(std::move(value)); return *this;}

    /**
     *
The language of the patch if it's language-specific.

     */
    inline Patch& WithLanguage(const char* value) { SetLanguage(value); return *this;}

  private:
    Aws::String m_id;
    bool m_idHasBeenSet;
    Aws::Utils::DateTime m_releaseDate;
    bool m_releaseDateHasBeenSet;
    Aws::String m_title;
    bool m_titleHasBeenSet;
    Aws::String m_description;
    bool m_descriptionHasBeenSet;
    Aws::String m_contentUrl;
    bool m_contentUrlHasBeenSet;
    Aws::String m_vendor;
    bool m_vendorHasBeenSet;
    Aws::String m_productFamily;
    bool m_productFamilyHasBeenSet;
    Aws::String m_product;
    bool m_productHasBeenSet;
    Aws::String m_classification;
    bool m_classificationHasBeenSet;
    Aws::String m_msrcSeverity;
    bool m_msrcSeverityHasBeenSet;
    Aws::String m_kbNumber;
    bool m_kbNumberHasBeenSet;
    Aws::String m_msrcNumber;
    bool m_msrcNumberHasBeenSet;
    Aws::String m_language;
    bool m_languageHasBeenSet;
  };

} // namespace Model
} // namespace SSM
} // namespace Aws


text:
<!--
  ~ Copyright (c) 2015 Zelory.
  ~
  ~  Licensed under the Apache License, Version 2.0 (the "License");
  ~  you may not use this file except in compliance with the License.
  ~  You may obtain a copy of the License at
  ~
  ~       http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~  Unless required by applicable law or agreed to in writing, software
  ~  distributed under the License is distributed on an "AS IS" BASIS,
  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~  See the License for the specific language governing permissions and
  ~  limitations under the License.
  -->

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:statusBarBackground="@color/primary"
    tools:context=".MainActivity">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:theme="@style/Appbar"
            app:layout_scrollFlags="scroll|enterAlways"
            app:popupTheme="@style/Popup">

            <Spinner
                android:id="@+id/spinner_nav"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:dropDownVerticalOffset="@dimen/dropDownVerticalOffset"/>
        </android.support.v7.widget.Toolbar>

        <android.support.design.widget.TabLayout
            android:id="@+id/tab_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFF"
            app:tabGravity="fill"
            app:tabIndicatorColor="@color/accent"
            app:tabMode="fixed"
            app:tabPaddingBottom="10dp"
            app:tabPaddingTop="10dp"/>
    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>

redpajama_set_name: RedPajamaGithub


text:
package org.jbpm.kie.services.impl.model;

import java.util.Collection;

import org.jbpm.bpmn2.core.Signal;
import org.jbpm.services.api.model.SignalDesc;
import org.kie.api.definition.process.Node;

public class SignalDescImpl  extends SignalDescBaseImpl implements SignalDesc {

    private static final long serialVersionUID = 1L;

    public static SignalDescImpl from(Signal signal) {
        return new SignalDescImpl(signal.getId(), signal.getName(), signal.getStructureRef(), signal.getIncomingNodes(),
                signal.getOutgoingNodes());
    }

    private SignalDescImpl(String id, String name, String structureRef, Collection<Node> incomingNodes,
                           Collection<Node> outgoingNodes) {
        super(id, name, structureRef, incomingNodes, outgoingNodes);
    }
}


text:
import React, { Component } from 'react'

export default class SubmitButton extends React.Component {
  render() {
    const { handleSubmit, buttonDisabled } = this.props
    return(
      <div className='button'>
        <button
          className='submitBtn'
          onClick={handleSubmit}
          disabled={buttonDisabled}>Guess
        </button>
      </div>
    )
  }
}


text:
"use strict";
// Base requires //
var util 		= require('util'),
	http 		= require('http'),
	querystring = require('querystring'),
	fs 			= require('fs'),
	url     	= require('url'),
	parseXMLString = require('xml2js').parseString,
	request = require('request');

var MM = module.parent,
	utils 	= MM.libary.load('utils');

/*

Check if account exists
http://chatango.com/checkname?name=barrykun
Get full profile code
http://barrykun.chatango.com/getfullprofile
Get profile info
http://st.chatango.com/profileimg/b/a/barrykun/mod1.xml
Get full profile info
http://st.chatango.com/profileimg/b/a/barrykun/mod2.xml
Background
http://ust.chatango.com/profileimg/b/a/barrykun/msgbg.xml
Full prof css
http://ust.chatango.com/profileimg/b/a/barrykun/custom_profile.css
Check account status
http://chatango.com/namecheckeraccsales?name=barrykun
Check premium status
http://chatango.com/isprem?sid=barrykun
Image thumbnail
http://ust.chatango.com/profileimg/b/a/barrykun/thumb.jpg
Full Image
http://fp.chatango.com/profileimg/b/a/barrykun/full.jpg
Group css (404 if not a group)
http://st.chatango.com/groupinfo/b/0/b0ty/gprofile.xml

*/

exports.profile = function(name, callback){

	var urlpart = name.length == 1 ? (name.substr(0,1)+'/'+name.substr(0,1)+'/'+name) :  (name.substr(0,1)+'/'+name.substr(1,1)+'/'+name);

	request('http://st.chatango.com/profileimg/'+urlpart+'/mod1.xml', function (error, response, body) {

		if(error || !body){
			callback(false);
			return;
		}

		parseXMLString(body, function(err, result){

			if(err){
				exports.checkName(name, function(exists){
					if(exists === 1)
						callback("no_profile");
					else
						callback("does_not_exist");
				});
				return;
			}

			var user = {
				mini: result.mod.body ? result.mod.body[0] : false,
				age: result.mod.b ? result.mod.b[0] : false,
				bg: result.mod.d ? result.mod.d[0] : false,
				loc: result.mod.l ? result.mod.l[0] : false,
				gender: result.mod.s ? result.mod.s[0] : false,
			};
			if(user.age){
				var year = parseInt(user.age.substr(0,4));
				var month = parseInt(user.age.substr(5,2))-1;
				var day = parseInt(user.age.substr(8,2));
				user.age = Math.round( ( (+new Date/1000) - (+new Date(year, month, day)/1000) ) / ( 60 * 60 * 24 * 365 ) );
			}
			if(user.mini){
				user.mini = decodeURIComponent(user.mini);
			}
			if(user.bg){
				var prem = Math.round( (parseInt(user.bg) - +new Date/1000) / (60 * 60 * 24) );
				user.bg = prem;
			}else{
				user.bg = 0;
			}
			if(user.loc._){
				user.loc = user.loc._;
			}

			callback(user);
		});
	});
}

exports.fullProfile = function(name, callback){

	var urlpart = name.length == 1 ? (name.substr(0,1)+'/'+name.substr(0,1)+'/'+name) :  (name.substr(0,1)+'/'+name.substr(1,1)+'/'+name);

	request('http://st.chatango.com/profileimg/'+urlpart+'/mod2.xml', function (error, response, body) {

		if(error || !body){
			callback(false);
			return;
		}

		parseXMLString(body, function(err, result){

			if(err){
				exports.checkName(name, function(exists){
					if(exists === 1)
						callback("no_profile");
					else
						callback("does_not_exist");
				});
				return;
			}

			if(result.mod.body){
				callback(decodeURIComponent(result.mod.body[0]));
			}
			else{
				callback(false);
			}
		});
	});

}

exports.checkName = function(name, callback){

	request('http://chatango.com/checkname?name='+name, function (error, response, body) {

		if(error || !body){
			callback(false);
			return;
		}

		var result = /^answer=(\d)&name=(.*?)$/.exec(body);

		if(result)
			callback(parseInt(result[1]));
		else
			callback(false);
	});

}


text:
package org.sakaiproject.tool.assessment.services;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.sakaiproject.tool.assessment.facade.SectionFacade;

/**
 * The SectionService calls persistent service locator to reach the
 * manager on the back end.
 */
public class SectionService
{
  private Logger log = LoggerFactory.getLogger(SectionService.class);

  /**
   * Creates a new SectionService object.
   */
  public SectionService()
  {
  }

  /**
   * Get a particular item from the backend, with all questions.
   */
  public SectionFacade getSection(Long secId, String agentId)
  {
    SectionFacade section = null;
    try
    {
      section = PersistenceService.getInstance().getSectionFacadeQueries().get(secId);
    }
    catch(Exception e)
    {
      log.error(e.getMessage(), e);
      throw new RuntimeException(e);
    }

    return section;
  }

}


text:
'''facade - makes brazo_lib package easy to refactor

while keeping its api constant'''
from . helpers import set_up_logging
from . preferences import preferences
from . Window import Window
from . brazoconfig import get_version


text:
import platform

from datetime import date, datetime
from decimal import Decimal, ROUND_UP, ROUND_DOWN
from unittest import TestCase

from wtforms import validators, widgets
from wtforms.fields import *
from wtforms.fields import Label, Field
from wtforms.form import Form

PYTHON_VERSION = platform.python_version_tuple()

class DummyPostData(dict):
    def getlist(self, key):
        v = self[key]
        if not isinstance(v, (list, tuple)):
            v = [v]
        return v

class AttrDict(object):
    def __init__(self, *args, **kw):
        self.__dict__.update(*args, **kw)

def make_form(_name='F', **fields):
    return type(_name, (Form, ), fields)

class DefaultsTest(TestCase):
    def test(self):
        expected = 42

        def default_callable():
            return expected

        test_value = TextField(default=expected).bind(Form(), 'a')
        test_value.process(None)
        self.assertEqual(test_value.data, expected)

        test_callable = TextField(default=default_callable).bind(Form(), 'a')
        test_callable.process(None)
        self.assertEqual(test_callable.data, expected)

class LabelTest(TestCase):
    def test(self):
        expected = u"""Caption"""
        label = Label('test', u'Caption')
        self.assertEqual(label(), expected)
        self.assertEqual(str(label), expected)
        self.assertEqual(unicode(label), expected)
        self.assertEqual(label.__html__(), expected)
        self.assertEqual(label().__html__(), expected)
        self.assertEqual(label('hello'), u"""hello""")
        self.assertEqual(TextField(u'hi').bind(Form(), 'a').label.text, u'hi')
        self.assertEqual(repr(label), "Label('test', u'Caption')")

    def test_auto_label(self):
        t1 = TextField().bind(Form(), 'foo_bar')
        self.assertEqual(t1.label.text, 'Foo Bar')

        t2 = TextField('').bind(Form(), 'foo_bar')
        self.assertEqual(t2.label.text, '')

class FlagsTest(TestCase):
    def setUp(self):
        t = TextField(validators=[validators.Required()]).bind(Form(), 'a')
        self.flags = t.flags

    def test_existing_values(self):
        self.assertEqual(self.flags.required, True)
        self.assert_('required' in self.flags)
        self.assertEqual(self.flags.optional, False)
        self.assert_('optional' not in self.flags)

    def test_assignment(self):
        self.assert_('optional' not in self.flags)
        self.flags.optional = True
        self.assertEqual(self.flags.optional, True)
        self.assert_('optional' in self.flags)

    def test_unset(self):
        self.flags.required = False
        self.assertEqual(self.flags.required, False)
        self.assert_('required' not in self.flags)

    def test_repr(self):
        self.assertEqual(repr(self.flags), '<wtforms.fields.Flags: {required}>')

class FiltersTest(TestCase):
    class F(Form):
        a = TextField(default=' hello', filters=[lambda x: x.strip()])

    def test(self):
        self.assertEqual(self.F().a.data, 'hello')
        self.assertEqual(self.F(DummyPostData(a=['  foo bar  '])).a.data, 'foo bar')

class FieldTest(TestCase):
    class F(Form):
        a = TextField(default='hello')

    def setUp(self):
        self.field = self.F().a

    def test_htmlstring(self):
        self.assert_(isinstance(self.field.__html__(), widgets.HTMLString))

    def test_str_coerce(self):
        self.assert_(isinstance(str(self.field), str))
        self.assertEqual(str(self.field), str(self.field()))

    def test_unicode_coerce(self):
        self.assertEqual(unicode(self.field), self.field())

    def test_process_formdata(self):
        Field.process_formdata(self.field, [42])
        self.assertEqual(self.field.data, 42)

class PrePostTestField(TextField):
    def pre_validate(self, form):
        if self.data == "stoponly":
            raise validators.StopValidation()
        elif self.data.startswith("stop"):
            raise validators.StopValidation("stop with message")

    def post_validate(self, form, stopped):
        if self.data == "p":
            raise ValueError("Post")
        elif stopped and self.data == "stop-post":
            raise ValueError("Post-stopped")

class PrePostValidationTest(TestCase):
    class F(Form):
        a = PrePostTestField(validators=[validators.Length(max=1, message="too long")])

    def _init_field(self, value):
        form = self.F(a=value)
        form.validate()
        return form.a

    def test_pre_stop(self):
        a = self._init_field("long")
        self.assertEqual(a.errors, ["too long"])

        stoponly = self._init_field("stoponly")
        self.assertEqual(stoponly.errors, [])

        stopmessage = self._init_field("stopmessage")
        self.assertEqual(stopmessage.errors, ["stop with message"])

    def test_post(self):
        a = self._init_field("p")
        self.assertEqual(a.errors, ["Post"])
        stopped = self._init_field("stop-post")
        self.assertEqual(stopped.errors, ["stop with message", "Post-stopped"])

class SelectFieldTest(TestCase):
    class F(Form):
        a = SelectField(choices=[('a', 'hello'), ('btest','bye')], default='a')
        b = SelectField(choices=[(1, 'Item 1'), (2, 'Item 2')], coerce=int, option_widget=widgets.TextInput())

    def test_defaults(self):
        form = self.F()
        self.assertEqual(form.a.data, u'a')
        self.assertEqual(form.b.data, None)
        self.assertEqual(form.validate(), False)
        self.assertEqual(form.a(), u"""<select id="a" name="a"><option selected value="a">hello</option><option value="btest">bye</option></select>""")
        self.assertEqual(form.b(), u"""<select id="b" name="b"><option value="1">Item 1</option><option value="2">Item 2</option></select>""")

    def test_with_data(self):
        form = self.F(DummyPostData(a=[u'btest']))
        self.assertEqual(form.a.data, u'btest')
        self.assertEqual(form.a(), u"""<select id="a" name="a"><option value="a">hello</option><option selected value="btest">bye</option></select>""")

    def test_value_coercion(self):
        form = self.F(DummyPostData(b=[u'2']))
        self.assertEqual(form.b.data, 2)
        self.assert_(form.b.validate(form))
        form = self.F(DummyPostData(b=[u'b']))
        self.assertEqual(form.b.data, None)
        self.assert_(not form.b.validate(form))

    def test_iterable_options(self):
        form = self.F()
        self.assert_(isinstance(list(form.a)[0], form.a._Option))
        self.assertEqual(list(unicode(x) for x in form.a), [u'<option selected value="a">hello</option>', '<option value="btest">bye</option>'])
        self.assert_(isinstance(list(form.a)[0].widget, widgets.Option))
        self.assert_(isinstance(list(form.b)[0].widget, widgets.TextInput))

class SelectMultipleFieldTest(TestCase):
    class F(Form):
        a = SelectMultipleField(choices=[('a', 'hello'), ('b','bye'), ('c', 'something')], default=('a', ))
        b = SelectMultipleField(coerce=int, choices=[(1, 'A'), (2, 'B'), (3, 'C')], default=("1", "3"))

    def test_defaults(self):
        form = self.F()
        self.assertEqual(form.a.data, ['a'])
        self.assertEqual(form.b.data, [1, 3])
        # Test for possible regression with null data
        form.a.data = None
        self.assert_(form.validate())
        self.assertEqual(list(form.a.iter_choices()), [(v, l, False) for v, l in form.a.choices])

    def test_with_data(self):
        form = self.F(DummyPostData(a=['a', 'c']))
        self.assertEqual(form.a.data, ['a', 'c'])
        self.assertEqual(list(form.a.iter_choices()), [('a', 'hello', True), ('b', 'bye', False), ('c', 'something', True)])
        self.assertEqual(form.b.data, [])
        form = self.F(DummyPostData(b=['1', '2']))
        self.assertEqual(form.b.data, [1, 2])
        self.assert_(form.validate())
        form = self.F(DummyPostData(b=['1', '2', '4']))
        self.assertEqual(form.b.data, [1, 2, 4])
        self.assert_(not form.validate())

class RadioFieldTest(TestCase):
    class F(Form):
        a = RadioField(choices=[('a', 'hello'), ('b','bye')], default='a')
        b = RadioField(choices=[(1, 'Item 1'), (2, 'Item 2')], coerce=int)

    def test(self):
        form = self.F()
        self.assertEqual(form.a.data, u'a')
        self.assertEqual(form.b.data, None)
        self.assertEqual(form.validate(), False)
        self.assertEqual(form.a(), u"""

<input checked id="a-0" name="a" type="radio" value="a"> hello

<input id="a-1" name="a" type="radio" value="b"> bye

""")
        self.assertEqual(form.b(), u"""

<input id="b-0" name="b" type="radio" value="1"> Item 1

<input id="b-1" name="b" type="radio" value="2"> Item 2

""")
        self.assertEqual([unicode(x) for x in form.a], [u'<input checked id="a-0" name="a" type="radio" value="a">', u'<input id="a-1" name="a" type="radio" value="b">'])

class TextFieldTest(TestCase):
    class F(Form):
        a = TextField()

    def test(self):
        form = self.F()
        self.assertEqual(form.a.data, None)
        self.assertEqual(form.a(), u"""<input id="a" name="a" type="text" value="">""")
        form = self.F(DummyPostData(a=['hello']))
        self.assertEqual(form.a.data, u'hello')
        self.assertEqual(form.a(), u"""<input id="a" name="a" type="text" value="hello">""")
        form = self.F(DummyPostData(b=['hello']))
        self.assertEqual(form.a.data, u'')

class HiddenFieldTest(TestCase):
    class F(Form):
        a = HiddenField(default="LE DEFAULT")

    def test(self):
        form = self.F()
        self.assertEqual(form.a(), u"""<input id="a" name="a" type="hidden" value="LE DEFAULT">""")

class TextAreaFieldTest(TestCase):
    class F(Form):
        a = TextAreaField(default="LE DEFAULT")

    def test(self):
        form = self.F()
        self.assertEqual(form.a(), u"""<textarea id="a" name="a">LE DEFAULT</textarea>""")

class PasswordFieldTest(TestCase):
    class F(Form):
        a = PasswordField(widget=widgets.PasswordInput(hide_value=False), default="LE DEFAULT")
        b = PasswordField(default="Hai")

    def test(self):
        form = self.F()
        self.assertEqual(form.a(), u"""<input id="a" name="a" type="password" value="LE DEFAULT">""")
        self.assertEqual(form.b(), u"""<input id="b" name="b" type="password" value="">""")

class FileFieldTest(TestCase):
    class F(Form):
        a = FileField(default="LE DEFAULT")

    def test(self):
        form = self.F()
        self.assertEqual(form.a(), u"""<input id="a" name="a" type="file" value="LE DEFAULT">""")

class IntegerFieldTest(TestCase):
    class F(Form):
        a = IntegerField()
        b = IntegerField(default=48)

    def test(self):
        form = self.F(DummyPostData(a=['v'], b=['-15']))
        self.assertEqual(form.a.data, None)
        self.assertEqual(form.a.raw_data, [u'v'])
        self.assertEqual(form.a(), u"""<input id="a" name="a" type="text" value="v">""")
        self.assertEqual(form.b.data, -15)
        self.assertEqual(form.b(), u"""<input id="b" name="b" type="text" value="-15">""")
        self.assert_(not form.a.validate(form))
        self.assert_(form.b.validate(form))
        form = self.F(DummyPostData(a=[], b=['']))
        self.assertEqual(form.a.data, None)
        self.assertEqual(form.a.raw_data, [])
        self.assertEqual(form.b.data, 48)
        self.assertEqual(form.b.raw_data, [''])
        self.assert_(not form.validate())
        self.assertEqual(len(form.b.process_errors), 1)
        self.assertEqual(len(form.b.errors), 1)
        form = self.F(b=9)
        self.assertEqual(form.b.data, 9)
        self.assertEqual(form.a._value(), u'')
        self.assertEqual(form.b._value(), u'9')

class DecimalFieldTest(TestCase):
    def test(self):
        F = make_form(a=DecimalField())
        form = F(DummyPostData(a='2.1'))
        self.assertEqual(form.a.data, Decimal('2.1'))
        self.assertEqual(form.a._value(), u'2.1')
        form.a.raw_data = None
        self.assertEqual(form.a._value(), u'2.10')
        self.assert_(form.validate())
        form = F(DummyPostData(a='2,1'), a=Decimal(5))
        self.assertEqual(form.a.data, Decimal(5))
        self.assertEqual(form.a.raw_data, ['2,1'])
        self.assert_(not form.validate())

    def test_quantize(self):
        F = make_form(a=DecimalField(places=3, rounding=ROUND_UP), b=DecimalField(places=None))
        form = F(a=Decimal('3.1415926535'))
        self.assertEqual(form.a._value(), u'3.142')
        form.a.rounding = ROUND_DOWN
        self.assertEqual(form.a._value(), u'3.141')
        self.assertEqual(form.b._value(), u'')
        form = F(a=3.14159265, b=72)
        self.assertEqual(form.a._value(), u'3.142')
        self.assert_(isinstance(form.a.data, float))
        self.assertEqual(form.b._value(), u'72')

class FloatFieldTest(TestCase):
    class F(Form):
        a = FloatField()
        b = FloatField(default=48.0)

    def test(self):
        form = self.F(DummyPostData(a=['v'], b=['-15.0']))
        self.assertEqual(form.a.data, None)
        self.assertEqual(form.a.raw_data, [u'v'])
        self.assertEqual(form.a(), u"""<input id="a" name="a" type="text" value="v">""")
        self.assertEqual(form.b.data, -15.0)
        self.assertEqual(form.b(), u"""<input id="b" name="b" type="text" value="-15.0">""")
        self.assert_(not form.a.validate(form))
        self.assert_(form.b.validate(form))
        form = self.F(DummyPostData(a=[], b=['']))
        self.assertEqual(form.a.data, None)
        self.assertEqual(form.b.data, 48.0)
        self.assertEqual(form.b.raw_data, [u''])
        self.assert_(not form.validate())
        self.assertEqual(len(form.b.process_errors), 1)
        self.assertEqual(len(form.b.errors), 1)
        form = self.F(b=9.0)
        self.assertEqual(form.b.data, 9.0)
        self.assertEqual(form.b._value(), u"9.0")

class BooleanFieldTest(TestCase):
    class BoringForm(Form):
        bool1 = BooleanField()
        bool2 = BooleanField(default=True)

    obj = AttrDict(bool1=None, bool2=True)

    def test_defaults(self):
        # Test with no post data to make sure defaults work
        form = self.BoringForm()
        self.assertEqual(form.bool1.raw_data, None)
        self.assertEqual(form.bool1.data, False)
        self.assertEqual(form.bool2.data, True)

    def test_rendering(self):
        form = self.BoringForm(DummyPostData(bool2=u"x"))
        self.assertEqual(form.bool1(), u'<input id="bool1" name="bool1" type="checkbox" value="y">')
        self.assertEqual(form.bool2(), u'<input checked id="bool2" name="bool2" type="checkbox" value="x">')
        self.assertEqual(form.bool2.raw_data, [u'x'])

    def test_with_postdata(self):
        form = self.BoringForm(DummyPostData(bool1=[u'a']))
        self.assertEqual(form.bool1.raw_data, [u'a'])
        self.assertEqual(form.bool1.data, True)

    def test_with_model_data(self):
        form = self.BoringForm(obj=self.obj)
        self.assertEqual(form.bool1.data, False)
        self.assertEqual(form.bool1.raw_data, None)
        self.assertEqual(form.bool2.data, True)

    def test_with_postdata_and_model(self):
        form = self.BoringForm(DummyPostData(bool1=[u'y']), obj=self.obj)
        self.assertEqual(form.bool1.data, True)
        self.assertEqual(form.bool2.data, False)

class DateFieldTest(TestCase):
    class F(Form):
        a = DateField()
        b = DateField(format='%m/%d %Y')

    def test(self):
        d = date(2008, 5, 7)
        form = self.F(DummyPostData(a=['2008-05-07'], b=['05/07', '2008']))
        self.assertEqual(form.a.data, d)
        self.assertEqual(form.a._value(), '2008-05-07')
        self.assertEqual(form.b.data, d)
        self.assertEqual(form.b._value(), '05/07 2008')

class DateTimeFieldTest(TestCase):
    class F(Form):
        a = DateTimeField()
        b = DateTimeField(format='%Y-%m-%d %H:%M')

    def test_basic(self):
        d = datetime(2008, 5, 5, 4, 30, 0, 0)
        form = self.F(DummyPostData(a=['2008-05-05', '04:30:00'], b=['2008-05-05 04:30']))
        self.assertEqual(form.a.data, d)
        self.assertEqual(form.a(), u"""<input id="a" name="a" type="text" value="2008-05-05 04:30:00">""")
        self.assertEqual(form.b.data, d)
        self.assertEqual(form.b(), u"""<input id="b" name="b" type="text" value="2008-05-05 04:30">""")
        self.assert_(form.validate())
        form = self.F(DummyPostData(a=['2008-05-05']))
        self.assert_(not form.validate())
        self.assert_("not match format" in form.a.errors[0])

    def test_microseconds(self):
        if PYTHON_VERSION < (2, 6, 0):
            return # Microsecond formatting support was only added in 2.6

        d = datetime(2011, 5, 7, 3, 23, 14, 424200)
        F = make_form(a=DateTimeField(format='%Y-%m-%d %H:%M:%S.%f'))
        form = F(DummyPostData(a=['2011-05-07 03:23:14.4242']))
        self.assertEqual(d, form.a.data)

class SubmitFieldTest(TestCase):
    class F(Form):
        a = SubmitField(u'Label')

    def test(self):
        self.assertEqual(self.F().a(), """<input id="a" name="a" type="submit" value="Label">""")

class FormFieldTest(TestCase):
    def setUp(self):
        F = make_form(
            a = TextField(validators=[validators.required()]),
            b = TextField(),
        )
        self.F1 = make_form('F1', a = FormField(F))
        self.F2 = make_form('F2', a = FormField(F, separator='::'))

    def test_formdata(self):
        form = self.F1(DummyPostData({'a-a':[u'moo']}))
        self.assertEqual(form.a.form.a.name, 'a-a')
        self.assertEqual(form.a.form.a.data, u'moo')
        self.assertEqual(form.a.form.b.data, u'')
        self.assert_(form.validate())

    def test_iteration(self):
        self.assertEqual([x.name for x in self.F1().a], ['a-a', 'a-b'])

    def test_with_obj(self):
        obj = AttrDict(a=AttrDict(a=u'mmm'))
        form = self.F1(obj=obj)
        self.assertEqual(form.a.form.a.data, u'mmm')
        self.assertEqual(form.a.form.b.data, None)
        obj_inner = AttrDict(a=None, b='rawr')
        obj2 = AttrDict(a=obj_inner)
        form.populate_obj(obj2)
        self.assert_(obj2.a is obj_inner)
        self.assertEqual(obj_inner.a, u'mmm')
        self.assertEqual(obj_inner.b, None)

    def test_widget(self):
        self.assertEqual(self.F1().a(), u'''

A	<input id="a-a" name="a-a" type="text" value="">

B	<input id="a-b" name="a-b" type="text" value="">

''')

    def test_separator(self):
        form = self.F2(DummyPostData({'a-a': 'fake', 'a::a': 'real'}))
        self.assertEqual(form.a.a.name, 'a::a')
        self.assertEqual(form.a.a.data, 'real')
        self.assert_(form.validate())

    def test_no_validators_or_filters(self):
        class A(Form):
            a = FormField(self.F1, validators=[validators.required()])
        self.assertRaises(TypeError, A)
        class B(Form):
            a = FormField(self.F1, filters=[lambda x: x])
        self.assertRaises(TypeError, B)

        class C(Form):
            a = FormField(self.F1)
            def validate_a(form, field):
                pass
        form = C()
        self.assertRaises(TypeError, form.validate)

class FieldListTest(TestCase):
    t = TextField(validators=[validators.Required()])

    def test_form(self):
        F = make_form(a = FieldList(self.t))
        data = ['foo', 'hi', 'rawr']
        a = F(a=data).a
        self.assertEqual(a.entries[1].data, 'hi')
        self.assertEqual(a.entries[1].name, 'a-1')
        self.assertEqual(a.data, data)
        self.assertEqual(len(a.entries), 3)

        pdata = DummyPostData({'a-0': ['bleh'], 'a-3': ['yarg'], 'a-4': [''], 'a-7': ['mmm']})
        form = F(pdata)
        self.assertEqual(len(form.a.entries), 4)
        self.assertEqual(form.a.data, [u'bleh', u'yarg', u'', u'mmm'])
        self.assert_(not form.validate())

        form = F(pdata, a=data)
        self.assertEqual(form.a.data, [u'bleh', u'yarg', u'', u'mmm'])
        self.assert_(not form.validate())

        # Test for formdata precedence
        pdata = DummyPostData({'a-0': ['a'], 'a-1': ['b']})
        form = F(pdata, a=data)
        self.assertEqual(len(form.a.entries), 2)
        self.assertEqual(form.a.data, [u'a', u'b'])

    def test_enclosed_subform(self):
        make_inner = lambda: AttrDict(a=None)
        F = make_form(
            a = FieldList(FormField(make_form('FChild', a=self.t), default=make_inner))
        )
        data = [{'a': 'hello'}]
        form = F(a=data)
        self.assertEqual(form.a.data, data)
        self.assert_(form.validate())
        form.a.append_entry()
        self.assertEqual(form.a.data, data + [{'a': None}])
        self.assert_(not form.validate())

        pdata = DummyPostData({'a-0': ['fake'], 'a-0-a': ['foo'], 'a-1-a': ['bar']})
        form = F(pdata, a=data)
        self.assertEqual(form.a.data, [{'a': 'foo'}, {'a': 'bar'}])

        inner_obj = make_inner()
        inner_list = [inner_obj]
        obj = AttrDict(a=inner_list)
        form.populate_obj(obj)
        self.assert_(obj.a is not inner_list)
        self.assertEqual(len(obj.a), 2)
        self.assert_(obj.a[0] is inner_obj)
        self.assertEqual(obj.a[0].a, 'foo')
        self.assertEqual(obj.a[1].a, 'bar')

    def test_entry_management(self):
        F = make_form(a = FieldList(self.t))
        a = F(a=['hello', 'bye']).a
        self.assertEqual(a.pop_entry().name, 'a-1')
        self.assertEqual(a.data, ['hello'])
        a.append_entry('orange')
        self.assertEqual(a.data, ['hello', 'orange'])
        self.assertEqual(a[-1].name, 'a-1')
        self.assertEqual(a.pop_entry().data, 'orange')
        self.assertEqual(a.pop_entry().name, 'a-0')
        self.assertRaises(IndexError, a.pop_entry)

    def test_min_max_entries(self):
        F = make_form(a = FieldList(self.t, min_entries=1, max_entries=3))
        a = F().a
        self.assertEqual(len(a), 1)
        self.assertEqual(a[0].data, None)
        big_input = ['foo',  'flaf', 'bar', 'baz']
        self.assertRaises(AssertionError, F, a=big_input)
        pdata = DummyPostData(('a-%d' % i, v) for i, v in enumerate(big_input))
        a = F(pdata).a
        self.assertEqual(a.data, ['foo', 'flaf', 'bar'])
        self.assertRaises(AssertionError, a.append_entry)

if __name__ == '__main__':
    from unittest import main
    main()


text:
#include "test_intrusive_msqueue.h"

#include <cds/gc/hp.h>
#include <cds/intrusive/moir_queue.h>
#include <vector>

namespace {
    namespace ci = cds::intrusive;
    typedef cds::gc::HP gc_type;

    class IntrusiveMoirQueue_HP : public cds_test::intrusive_msqueue
    {
        typedef cds_test::intrusive_msqueue base_class;

    protected:
        typedef typename base_class::base_hook_item< ci::msqueue::node<gc_type>> base_item_type;
        typedef typename base_class::member_hook_item< ci::msqueue::node<gc_type>> member_item_type;

        void SetUp()
        {
            typedef ci::MoirQueue< gc_type, base_item_type > queue_type;

            cds::gc::hp::GarbageCollector::Construct( queue_type::c_nHazardPtrCount, 1, 16 );
            cds::threading::Manager::attachThread();
        }

        void TearDown()
        {
            cds::threading::Manager::detachThread();
            cds::gc::hp::GarbageCollector::Destruct( true );
        }

        template <typename V>
        void check_array( V& arr )
        {
            for ( size_t i = 0; i < arr.size() - 1; ++i ) {
                ASSERT_EQ( arr[i].nDisposeCount, 2 );
            }
            ASSERT_EQ( arr.back().nDisposeCount, 1 );
        }
    };

    TEST_F( IntrusiveMoirQueue_HP, defaulted )
    {
        typedef cds::intrusive::MoirQueue< gc_type, base_item_type,
            typename ci::msqueue::make_traits<
                ci::opt::disposer< mock_disposer >
            >::type
        > test_queue;

        std::vector<base_item_type> arr;
        arr.resize(100);
        {
            test_queue q;
            test(q, arr);
        }
        gc_type::scan();
        check_array( arr );
    }

    TEST_F( IntrusiveMoirQueue_HP, base_hook )
    {
        typedef cds::intrusive::MoirQueue< gc_type, base_item_type,
            typename ci::msqueue::make_traits<
                ci::opt::disposer< mock_disposer >
                ,ci::opt::hook< ci::msqueue::base_hook< ci::opt::gc<gc_type>>>
            >::type
        > test_queue;

        std::vector<base_item_type> arr;
        arr.resize(100);
        {
            test_queue q;
            test(q, arr);
        }
        gc_type::scan();
        check_array( arr );
    }

    TEST_F( IntrusiveMoirQueue_HP, base_item_counting )
    {
        typedef cds::intrusive::MoirQueue< gc_type, base_item_type,
            typename ci::msqueue::make_traits<
                ci::opt::disposer< mock_disposer >
                , cds::opt::item_counter< cds::atomicity::item_counter >
                , ci::opt::hook< ci::msqueue::base_hook< ci::opt::gc<gc_type>>>
            >::type
        > test_queue;

        std::vector<base_item_type> arr;
        arr.resize(100);
        {
            test_queue q;
            test(q, arr);
        }
        gc_type::scan();
        check_array( arr );
    }

    TEST_F( IntrusiveMoirQueue_HP, base_stat )
    {
        struct traits : public ci::msqueue::traits
        {
            typedef mock_disposer disposer;
            typedef cds::atomicity::item_counter item_counter;
            typedef ci::msqueue::stat<> stat;
            typedef cds::opt::v::sequential_consistent memory_model;
        };
        typedef cds::intrusive::MoirQueue< gc_type, base_item_type, traits > test_queue;

        std::vector<base_item_type> arr;
        arr.resize(100);
        {
            test_queue q;
            test(q, arr);
        }
        gc_type::scan();
        check_array( arr );
    }

    TEST_F( IntrusiveMoirQueue_HP, member_hook )
    {
        typedef cds::intrusive::MoirQueue< gc_type, member_item_type,
            typename ci::msqueue::make_traits<
                ci::opt::disposer< mock_disposer >
                ,ci::opt::hook< ci::msqueue::member_hook<
                    offsetof( member_item_type, hMember ),
                    ci::opt::gc<gc_type>
                >>
            >::type
        > test_queue;

        std::vector<member_item_type> arr;
        arr.resize( 100 );
        {
            test_queue q;
            test( q, arr );
        }
        gc_type::scan();
        check_array( arr );
    }

    TEST_F( IntrusiveMoirQueue_HP, member_hook_stat )
    {
        struct traits : public ci::msqueue::traits
        {
            typedef ci::msqueue::member_hook<
                offsetof( member_item_type, hMember ),
                ci::opt::gc<gc_type>
            > hook;
            typedef mock_disposer disposer;
            typedef cds::atomicity::item_counter item_counter;
            typedef ci::msqueue::stat<> stat;
            typedef cds::opt::v::sequential_consistent memory_model;
        };
        typedef cds::intrusive::MoirQueue< gc_type, member_item_type, traits > test_queue;

        std::vector<member_item_type> arr;
        arr.resize( 100 );
        {
            test_queue q;
            test( q, arr );
        }
        gc_type::scan();
        check_array( arr );
    }

} // namespace


text:
import React, {Component, PropTypes} from 'react'
import {BoardDiv} from '../styles/Base'
import {bindActionCreators} from 'redux'
import {connect} from 'react-redux'
import {DragDropContext} from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import Lane from './Lane'

const boardActions = require('../actions/BoardActions')
const laneActions = require('../actions/LaneActions')

class BoardContainer extends Component {

  state = {data: this.props.data}

  wireEventBus = () => {
    let eventBus = {
      publish: (event) => {
        switch (event.type) {
          case 'ADD_CARD':
            this.props.actions.addCard({laneId: event.laneId, card: event.card})
          case 'REMOVE_CARD':
            this.props.actions.removeCard({laneId: event.laneId, cardId: event.cardId})
        }
      }
    }
    this.props.eventBusHandle(eventBus)
  }

  componentDidMount () {
    this.props.actions.loadBoard(this.props.data)
    if (this.props.eventBusHandle) {
      this.wireEventBus()
    }
  }

  componentWillReceiveProps (nextProps) {
    if (nextProps.newData) {
      const dataToUpdate = this.state.data
      dataToUpdate.lanes = nextProps.newData.lanes
      this.setState({data: dataToUpdate})
      this.props.onDataChange && this.props.onDataChange(nextProps.newData)
    }
  }

  render () {
    const {data} = this.state
    return <BoardDiv>
      {
        data.lanes.map((lane) => {
          const {id, ...otherProps} = lane
          const {draggable, handleDragStart, handleDragEnd, onCardClick, onLaneScroll, laneSortFunction} = this.props
          return <Lane key={id}
            id={id}
            {...otherProps}
            {...{draggable, handleDragStart, handleDragEnd, onCardClick, onLaneScroll, laneSortFunction}}
          />
        })}
    </BoardDiv>
  }
}

BoardContainer.propTypes = {
  data: PropTypes.object.isRequired,
  onLaneScroll: PropTypes.func,
  onCardClick: PropTypes.func,
  eventBusHandle: PropTypes.func,
  laneSortFunction: PropTypes.func,
  draggable: PropTypes.bool,
  handleDragStart: PropTypes.func,
  handleDragEnd: PropTypes.func,
  onDataChange: PropTypes.func
}

const mapStateToProps = (state) => {
  return {newData: state}
}

const mapDispatchToProps = (dispatch) => ({actions: bindActionCreators({...boardActions, ...laneActions}, dispatch)})

export default connect(mapStateToProps, mapDispatchToProps)(DragDropContext(HTML5Backend)(BoardContainer))


text:
package raft

import (
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"sync"
)

// InmemSnapshotStore implements the SnapshotStore interface and
// retains only the most recent snapshot
type InmemSnapshotStore struct {
	latest      *InmemSnapshotSink
	hasSnapshot bool
	sync.RWMutex
}

// InmemSnapshotSink implements SnapshotSink in memory
type InmemSnapshotSink struct {
	meta     SnapshotMeta
	contents *bytes.Buffer
}

// NewInmemSnapshotStore creates a blank new InmemSnapshotStore
func NewInmemSnapshotStore() *InmemSnapshotStore {
	return &InmemSnapshotStore{
		latest: &InmemSnapshotSink{
			contents: &bytes.Buffer{},
		},
	}
}

// Create replaces the stored snapshot with a new one using the given args
func (m *InmemSnapshotStore) Create(version SnapshotVersion, index, term uint64,
	configuration Configuration, configurationIndex uint64, trans Transport) (SnapshotSink, error) {
	// We only support version 1 snapshots at this time.
	if version != 1 {
		return nil, fmt.Errorf("unsupported snapshot version %d", version)
	}

	name := snapshotName(term, index)

	m.Lock()
	defer m.Unlock()

	sink := &InmemSnapshotSink{
		meta: SnapshotMeta{
			Version:            version,
			ID:                 name,
			Index:              index,
			Term:               term,
			Peers:              encodePeers(configuration, trans),
			Configuration:      configuration,
			ConfigurationIndex: configurationIndex,
		},
		contents: &bytes.Buffer{},
	}
	m.hasSnapshot = true
	m.latest = sink

	return sink, nil
}

// List returns the latest snapshot taken
func (m *InmemSnapshotStore) List() ([]*SnapshotMeta, error) {
	m.RLock()
	defer m.RUnlock()

	if !m.hasSnapshot {
		return []*SnapshotMeta{}, nil
	}
	return []*SnapshotMeta{&m.latest.meta}, nil
}

// Open wraps an io.ReadCloser around the snapshot contents
func (m *InmemSnapshotStore) Open(id string) (*SnapshotMeta, io.ReadCloser, error) {
	m.RLock()
	defer m.RUnlock()

	if m.latest.meta.ID != id {
		return nil, nil, fmt.Errorf("[ERR] snapshot: failed to open snapshot id: %s", id)
	}

	return &m.latest.meta, ioutil.NopCloser(m.latest.contents), nil
}

// Write appends the given bytes to the snapshot contents
func (s *InmemSnapshotSink) Write(p []byte) (n int, err error) {
	written, err := io.Copy(s.contents, bytes.NewReader(p))
	s.meta.Size += written
	return int(written), err
}

// Close updates the Size and is otherwise a no-op
func (s *InmemSnapshotSink) Close() error {
	return nil
}

func (s *InmemSnapshotSink) ID() string {
	return s.meta.ID
}

func (s *InmemSnapshotSink) Cancel() error {
	return nil
}


text:
package cipher2

import "crypto/cipher"

type wrappedStream struct{
	inner cipher.Stream
}
func (w wrappedStream) MaxOverhead() int { return 0 }
func (w wrappedStream) UpdateOutputSize(srcLength int) int { return srcLength }
func (w wrappedStream) ProcessBytes(dst []byte, src []byte) (int,error) {
	w.inner.XORKeyStream(dst,src)
	return len(src),nil
}

// creates a BufferedCipher wrapper for a cipher.Stream object.
// This is especially useful for use in conjunction with CipherWriter, as
// CipherWriter is more efficient than cipher.StreamWriter.
func BufferedStreamCipher(s cipher.Stream) BufferedCipher {
	return wrappedStream{s}
}


text:
package com.example.android.careandshare;

import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.Toast;

import models.ImageAdapter;

/**
 * A placeholder fragment containing a simple view.
 */
public class ListActivityFragment extends Fragment {

    public ListActivityFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_list, container, false);
        return v;
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Man. Brit. Discomyc. (London) 132 (1887)

#### Original name
Helotium subtile Fr., 1818

### Remarks
null


text:
package cn.lechange.happor.springtags;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;

import cn.lechange.happor.ControllerRegistry;
import cn.lechange.happor.HapporWebserver;

public class TagHapporServerParser extends AbstractSimpleBeanDefinitionParser {

	@Override
	protected String resolveId(Element element,
			AbstractBeanDefinition beanDefinition, ParserContext parserContext) {
		return "webserver";
	}

	@Override
	protected void doParse(Element element, ParserContext parserContext,
			BeanDefinitionBuilder builder) {
		String port = element.getAttribute("port");
		String timeout = element.getAttribute("timeout");
		String maxHttpSize = element.getAttribute("maxHttpSize");
		String executeThreads = element.getAttribute("executeThreads");
		String propFile = element.getAttribute("propFile");

		if (!propFile.isEmpty()) {
			FileInputStream in = null;
			try {
				in = new FileInputStream(propFile);
				Properties prop = new Properties();
				prop.load(in);
				port = prop.getProperty("happor.server.port", port);
				timeout = prop.getProperty("happor.server.timeout", timeout);
				maxHttpSize = prop.getProperty("happor.server.maxHttpSize", maxHttpSize);
				executeThreads = prop.getProperty("happor.server.executeThreads", executeThreads);
			} catch (FileNotFoundException e) {
				e.printStackTrace();
				System.exit(-1);
			} catch (IOException e) {
				e.printStackTrace();
				System.exit(-1);
			} finally {
				if (in != null) {
					try {
						in.close();
					} catch (IOException e) {

					}
				}
			}
		}

		HapporWebserver server = new HapporWebserver();
		server.setPort(Integer.valueOf(port));
		server.setTimeout(Integer.valueOf(timeout));
		server.setMaxHttpSize(Integer.valueOf(maxHttpSize));
		server.setExecuteThreads(Integer.valueOf(executeThreads));
		builder.addPropertyValue("server", server);

		Element handler = DomUtils.getChildElementByTagName(element, "handler");
		if (handler != null) {
			String handlerClass = handler.getAttribute("class");
			builder.addPropertyValue("handlerClass", handlerClass);
		}

		List<ControllerRegistry> controllers = new ArrayList<ControllerRegistry>();
		Element controllersTag = DomUtils.getChildElementByTagName(element, "controllers");
		if (controllersTag != null) {
			String packageName = controllersTag.getAttribute("package");
			List<Element> list = DomUtils.getChildElementsByTagName(controllersTag, "controller");
			for (Element controller : list) {
				String className = packageName + "." + controller.getAttribute("class");
				String method = controller.getAttribute("method");
				String uriPattern = controller.getAttribute("uriptn");
				ControllerRegistry registry = new ControllerRegistry();
				registry.setClassName(className);
				registry.setMethod(method);
				registry.setUriPattern(uriPattern);
				controllers.add(registry);
			}
		}
		builder.addPropertyValue("controllers", controllers);

		Element autoScanTag = DomUtils.getChildElementByTagName(element, "controllers-auto-scan");
		if (autoScanTag != null) {
			String packageName = autoScanTag.getAttribute("package");
			builder.addPropertyValue("autoScanPackage", packageName);
			List<String> filters = new ArrayList<String>();
			List<Element> list = DomUtils.getChildElementsByTagName(autoScanTag, "filter");
			for (Element filter : list) {
				String name = filter.getAttribute("name");
				filters.add(name);
			}
			builder.addPropertyValue("filters", filters);
		}

		Map<String, String> configs = new HashMap<String, String>();
		List<Element> configTagList = DomUtils.getChildElementsByTagName(element, "config");
		for (Element configTag : configTagList) {
			String type = configTag.getAttribute("type");
			String file = configTag.getAttribute("file");
			configs.put(type, file);
		}
		builder.addPropertyValue("configs", configs);

	}

	@Override
	protected Class<?> getBeanClass(Element element) {
		return HapporServerElement.class;
	}

}


text:
<?xml version="1.0"?>
<exslt:module xmlns:exslt="http://exslt.org/documentation"
              version="1" prefix="exsl">

<exslt:name>Common</exslt:name>

<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                 xmlns:dc="http://purl.org/dc/elements/1.1/"
                 ID="exsl">
   <dc:subject>EXSLT</dc:subject>
   <dc:subject>Common</dc:subject>
   <dc:subject>module</dc:subject>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="exsl.1">
         <exslt:version>1</exslt:version>
         <dc:creator>Jeni Tennison</dc:creator>
         <dc:date>2001-03-28</dc:date>
         <dc:description>A module of common functions.</dc:description>
      </rdf:Description>
   </exslt:revision>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="exsl.1.1">
         <exslt:version>1.1</exslt:version>
         <dc:creator>Jeni Tennison</dc:creator>
         <dc:date>2001-05-22</dc:date>
         <dc:description>Moved exsl:node-set and exsl:object-type into the core.</dc:description>
      </rdf:Description>
   </exslt:revision>
</rdf:Description>

<exslt:doc xmlns="">
   <section>
      <para>
         EXSLT - Common covers common, basic extension elements and functions.
      </para>
   </section>
</exslt:doc>

<exslt:functions>
   <exslt:function name="node-set" version="2" core="yes" />
   <exslt:function name="object-type" version="2" core="yes" />
</exslt:functions>

<exslt:elements>
   <exslt:element name="document" version="1" core="no" />
</exslt:elements>

</exslt:module>


text:
import importlib

from django.conf import settings
from django.core.exceptions import ImproperlyConfigured

from .conf import settings as rosetta_settings

def can_translate(user):
    return get_access_control_function()(user)

def get_access_control_function():
    """
    Return a predicate for determining if a user can
    access the Rosetta views
    """
    access_function = getattr(settings, 'ROSETTA_ACCESS_CONTROL_FUNCTION', None)
    if access_function is None:
        return is_superuser_staff_or_in_translators_group
    elif isinstance(access_function, str):
        # Dynamically load a permissions function
        perm_module, perm_func = access_function.rsplit('.', 1)
        perm_module = importlib.import_module(perm_module)
        return getattr(perm_module, perm_func)
    elif callable(access_function):
        return access_function
    else:
        raise TypeError(access_function)

# Default access control test
def is_superuser_staff_or_in_translators_group(user):
    if not getattr(settings, 'ROSETTA_REQUIRES_AUTH', True):
        return True
    try:
        if not user.is_authenticated:
            return False
        elif user.is_superuser and user.is_staff:
            return True
        else:
            return user.groups.filter(name='translators').exists()
    except AttributeError:
        if not hasattr(user, 'is_authenticated') or not hasattr(user, 'is_superuser') or not hasattr(user, 'groups'):
            raise ImproperlyConfigured('If you are using custom User Models you must implement a custom authentication method for Rosetta. See ROSETTA_ACCESS_CONTROL_FUNCTION here: https://django-rosetta.readthedocs.org/en/latest/settings.html')
        raise

def can_translate_language(user, langid):
    try:
        if not rosetta_settings.ROSETTA_LANGUAGE_GROUPS:
            return can_translate(user)
        elif not user.is_authenticated:
            return False
        elif user.is_superuser and user.is_staff:
            return True
        else:
            return user.groups.filter(name='translators-%s' % langid).exists()

    except AttributeError:
        if not hasattr(user, 'is_authenticated') or not hasattr(user, 'is_superuser') or not hasattr(user, 'groups'):
            raise ImproperlyConfigured('If you are using custom User Models you must implement a custom authentication method for Rosetta. See ROSETTA_ACCESS_CONTROL_FUNCTION here: https://django-rosetta.readthedocs.org/en/latest/settings.html')
        raise


text:
package tv.dyndns.kishibe.qmaclone.client.packet;

import java.util.List;

import name.pehl.piriti.json.client.JsonReader;

import com.google.common.base.Objects;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.IsSerializable;

public class PacketServerStatus implements IsSerializable, Cloneable {
	public static class Json {
		public interface PacketServerStatusReader extends JsonReader<PacketServerStatus> {
		}

		public static final PacketServerStatusReader READER = GWT
				.create(PacketServerStatusReader.class);
	}

	public int numberOfCurrentPlayers;
	public int numberOfTotalPlayers;
	public int numberOfCurrentSessions;
	public int numberOfTotalSessions;
	public int numberOfPageView;
	public int numberOfProblems;
	public int numberOfLoginPlayers;
	public int numberOfActivePlayers;
	public List<PacketPlayerSummary> lastestPlayers;
	public int numberOfPlayersInWhole;

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof PacketServerStatus)) {
			return false;
		}
		PacketServerStatus rh = (PacketServerStatus) obj;
		return numberOfCurrentPlayers == rh.numberOfCurrentPlayers
				&& numberOfTotalPlayers == rh.numberOfTotalPlayers
				&& numberOfCurrentSessions == rh.numberOfCurrentSessions
				&& numberOfTotalSessions == rh.numberOfTotalSessions
				&& numberOfPageView == rh.numberOfPageView
				&& numberOfProblems == rh.numberOfProblems
				&& numberOfLoginPlayers == rh.numberOfLoginPlayers
				&& numberOfActivePlayers == rh.numberOfActivePlayers
				&& Objects.equal(lastestPlayers, rh.lastestPlayers)
				&& numberOfPlayersInWhole == rh.numberOfPlayersInWhole;
	}

	@Override
	public int hashCode() {
		return Objects
				.hashCode(numberOfCurrentPlayers, numberOfTotalPlayers, numberOfCurrentSessions,
						numberOfTotalSessions, numberOfPageView, numberOfProblems,
						numberOfLoginPlayers, numberOfActivePlayers, lastestPlayers,
						numberOfPlayersInWhole);
	}
}


text:
package ru.stqa.pft.addressbook.appmanager;

import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;

/**
 * Created by alexeykozlov on 10/13/17.
 */
public class SessionHelper extends HelperBase {

  public SessionHelper(ChromeDriver wd) {
    super(wd);
  }

  public void login(String username, String password) {
    type(By.name("user"),username);
    type(By.name("pass"), password);
    click(By.xpath("//form[@id='LoginForm']/input[3]"));
  }
}


text:
const logger = { debug() {}, info() {}, warn() {}, error() {} };
const loggerFct = Object.keys(logger);
logger.set = customLogger =>
  loggerFct.forEach(key => (logger[key] = customLogger[key].bind(customLogger)));

export default logger;


text:
set(CPM_DOWNLOAD_VERSION 0.35.0)

if(CPM_SOURCE_CACHE)
  # Expand relative path. This is important if the provided path contains a
  # tilde (~)
  get_filename_component(CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE)
  set(CPM_DOWNLOAD_LOCATION
      "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
  set(CPM_DOWNLOAD_LOCATION
      "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
  set(CPM_DOWNLOAD_LOCATION
      "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()

if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
  message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
  file(
    DOWNLOAD
    https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
    ${CPM_DOWNLOAD_LOCATION})
endif()

include(${CPM_DOWNLOAD_LOCATION})


text:
package org.apache.ivy.osgi.obr.xml;

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

public class Capability {

    private List<CapabilityProperty> properties = new ArrayList<>();

    private String name;

    public Capability(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void addProperty(String n, String value, String type) {
        properties.add(new CapabilityProperty(n, value, type));
    }

    public List<CapabilityProperty> getProperties() {
        return properties;
    }

    @Override
    public String toString() {
        StringBuilder buffer = new StringBuilder();
        buffer.append(name);
        for (CapabilityProperty p : properties) {
            buffer.append(" ");
            buffer.append(p);
        }
        return buffer.toString();
    }
}


text:
namespace libkafka_asio
{
namespace detail
{

inline Int32 RequestMessageWireSize(const MetadataRequest& request)
{
  Int32 size = sizeof(Int32);
  BOOST_FOREACH(const String& topic_name, request.topic_names())
  {
    size += StringWireSize(topic_name);
  }
  return size;
}

inline void WriteRequestMessage(const MetadataRequest& request,
                                std::stringstream& os)
{
  // Topic Names
  WriteInt32(static_cast<Int32>(request.topic_names().size()), os);
  BOOST_FOREACH(const String& topic_name, request.topic_names())
  {
    WriteString(topic_name, os);
  }
}

}  // namespace detail
}  // namespace libkafka_asio

#endif  // METADATA_REQUEST_WRITE_H_28BB9709_A65B_44C9_91C3_0A380BD76F7D


text:
export default angular.module('framework.controller', [])
    .controller('Framework', Framework);

/* @ngInject */
function Framework($scope, $rootScope, $location) {
    "use strict";

    var vm = this;

    $scope.$on('menu-item-selected-event', function (e, data) {
        $location.path(data.route);
    });

    vm.menuToggle = function () {
        $rootScope.$broadcast('menu-toggle');
    }

}


text:
namespace autofill {
class CreditCard;
}

@interface ManualFillCreditCard (CreditCard)

// Convenience initializer from a autofill::CreditCard. It also prepares some
// fields for user presentation, like creating an obfuscated version of the
// credit card number and formatting month/year fields.
- (instancetype)initWithCreditCard:(const autofill::CreditCard&)creditCard;

@end

#endif  // IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_MANUAL_FILL_CREDIT_CARD_CREDITCARD_H_