text:
package com.venky.swf.sql.parser;

import java.io.InputStream;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.venky.core.string.StringUtil;
import com.venky.swf.db.Database;
import com.venky.swf.db.model.Model;
import com.venky.swf.db.table.BindVariable;
import com.venky.swf.db.table.Table;
import com.venky.swf.sql.Conjunction;
import com.venky.swf.sql.Expression;
import com.venky.swf.sql.Operator;
import com.venky.xml.XMLDocument;
import com.venky.xml.XMLElement;

public class XMLExpressionParser {
	Table<? extends Model> table = null;
	public XMLExpressionParser(Class<? extends Model> modelClass){
		table = Database.getTable(modelClass);
	}
	public Expression parse(InputStream is) {
		return parse(StringUtil.read(is));
	}
	public Expression parse(String input){
		XMLDocument docExpression = XMLDocument.getDocumentFor(input);
		return parse(docExpression.getDocumentRoot());
	}

	public Expression parse(XMLElement elem) {
		Expression e = null;
		if (elem.getNodeName().equals(Conjunction.AND.toString()) || elem.getNodeName().equals(Conjunction.OR.toString())){
			if (elem.getNodeName().equals(Conjunction.AND.toString())){
				e = new Expression(table.getReflector().getPool(),Conjunction.AND);
			}else {
				e = new Expression(table.getReflector().getPool(),Conjunction.OR);
			}
			for (Iterator<XMLElement> childIter = elem.getChildElements() ; childIter.hasNext() ;){
				XMLElement child = childIter.next();
				e.add(parse(child));
			}
		}else {
			XMLElement columnName = elem.getChildElement("ColumnName");
			int columnType = table.getColumnDescriptor(columnName.getNodeValue()).getJDBCType();

			List<BindVariable> bvalues =  new ArrayList<BindVariable>();
			Operator op = getOperator(elem.getNodeName());

			if (op.isMultiValued()){
				XMLElement values = elem.getChildElement("Values");
				for (Iterator<XMLElement> valueIter  = values.getChildElements() ; valueIter.hasNext() ; ){
					addBindVariable(bvalues, columnType, valueIter.next());
				}
			}else{
				XMLElement eValue = elem.getChildElement("Value");
				addBindVariable(bvalues, columnType, eValue);
			}
			e = new Expression(table.getReflector().getPool(),columnName.getNodeValue(),op,bvalues.toArray());
		}

		return e;
	}
	public Operator getOperator(String s){
		if (s.equals("EQ")){
			return Operator.EQ;
		}else if (s.equals("GE")){
			return Operator.GE;
		}else if (s.equals("GT")){
			return Operator.GT;
		}else if (s.equals("IN")){
			return Operator.IN;
		}else if (s.equals("LE")){
			return Operator.LE;
		}else if (s.equals("LK")){
			return Operator.LK;
		}else if (s.equals("LT")){
			return Operator.LT;
		}else if (s.equals("NE")){
			return Operator.NE;
		}else {
			throw new UnsupportedOperationException(s);
		}
	}

	private void addBindVariable(List<BindVariable> bValues,int columnType , XMLElement eValue) {
		String sValue = eValue.getNodeValue();

		Object value = sValue;
		if (columnType != Types.VARCHAR){
			value = Database.getJdbcTypeHelper(table.getReflector().getPool()).getTypeRef(columnType).getTypeConverter().valueOf(sValue);
		}
		bValues.add(new BindVariable(table.getReflector().getPool(),value,columnType));

	}
}


text:
namespace shadow {

	class ring_buffer
	{
	public:
		ring_buffer();
		~ring_buffer();
		bool init(int init_size, int step_size, int max_size, int max_block_size);
		bool fini();
		bool reset();
		bool putd(void* phead, int headlen, void* pdata, int datalen);
		bool getd(void* phead, int& headlen, void* pdata, int& datalen);
		int  get_data_count();
		int  get_data_size();

	private:
		std::mutex mutex_;

		char* m_data_ptr;
		int m_init_size;
		int m_step_size;
		int m_max_size;
		int m_max_buffer_size;
		int m_max_block_size;

		int m_write_tail;
		int m_write_head;
		int m_read_head;

		int m_data_count;
		int m_data_size;
	};

}

redpajama_set_name: RedPajamaGithub


text:
<resources>

    <!--
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
    -->
    <style name="AppBaseTheme" parent="android:Theme.Light">
        <!--
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.
        -->
    </style>

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    </style>

    <!-- current location -->
    <style name="location_current">
        <item name="android:layout_width">fill_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:gravity">center_horizontal</item>
        <item name="android:paddingLeft">5dip</item>
        <item name="android:paddingRight">5dip</item>
        <item name="android:lines">1</item>
        <item name="android:singleLine">true</item>
        <item name="android:scrollHorizontally">true</item>
        <item name="android:ellipsize">marquee</item>
        <item name="android:textSize">14sp</item>
        <item name="android:textColor">#FFFFFFFF</item>
        <item name="android:background">@drawable/icon_bcg</item>
    </style>

    <style name="location_current_style">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_gravity">right</item>
        <item name="android:paddingLeft">3dip</item>
        <item name="android:paddingRight">3dip</item>
        <item name="android:lines">1</item>
        <item name="android:singleLine">true</item>
        <item name="android:scrollHorizontally">true</item>
        <item name="android:ellipsize">marquee</item>
        <item name="android:textSize">12sp</item>
        <item name="android:textColor">#FFFFFFFF</item>
    </style>

    <style name="location_current_type" parent="location_current_style">
        <item name="android:layout_alignParentRight">true</item>
    </style>

    <style name="location_current_accuracy" parent="location_current_style">
        <item name="android:layout_centerHorizontal">true</item>
    </style>

    <style name="location_current_satellites" parent="location_current_style">
        <item name="android:layout_alignParentLeft">true</item>
        <item name="android:layout_gravity">left</item>
    </style>

</resources>


text:
namespace crashpad {

//! \brief A ProcessSnapshot of a running (or crashed) process running on a
//!     Linux system.
class ProcessSnapshotLinux final : public ProcessSnapshot {
 public:
  ProcessSnapshotLinux();
  ~ProcessSnapshotLinux() override;

  //! \brief Initializes the object.
  //!
  //! \param[in] connection A connection to the process to snapshot.
  //!
  //! \return `true` if the snapshot could be created, `false` otherwise with
  //!     an appropriate message logged.
  bool Initialize(PtraceConnection* connection);

#if defined(STARBOARD)
  //! \brief Initializes the object with Evergreen information.
  //!
  //! \param[in] connection A connection to the process to snapshot.
  //! \param[in] evergreen_information_address An address sent to the handler
  //!     server that points to a populated EvergreenInfo struct.
  //! \param[in] annotations_address An address sent to the handler server that
  //!     that points to a populated CrashpadAnnotations struct.
  //!
  //! \return `true` if the snapshot could be created, `false` otherwise with
  //!     an appropriate message logged.
  bool Initialize(PtraceConnection* connnection,
                  VMAddress evergreen_information_address,
                  VMAddress serialized_annotations_address,
                  int serialized_annotations_size,
                  ExceptionHandlerProtocol::HandlerStartType handler_start_type);
#endif

  //! \brief Finds the thread whose stack contains \a stack_address.
  //!
  //! \param[in] stack_address A stack address to search for.
  //! \return The thread ID of the thread whose stack contains \a stack_address
  //!     or -1 if no matching thread is found.
  pid_t FindThreadWithStackAddress(VMAddress stack_address);

  //! \brief Initializes the object's exception.
  //!
  //! \param[in] exception_info The address of an ExceptionInformation in the
  //!     target process' address space.
  //! \param[in] exception_thread_id The thread ID to assocaite the thread with.
  //!     Optional. If -1, the exception thread will be identified by the
  //!     ExceptionInformation struct which contains the thread ID in the target
  //!     process' namespace.
  bool InitializeException(LinuxVMAddress exception_info,
                           pid_t exception_thread_id = -1);

  //! \brief Sets the value to be returned by ReportID().
  //!
  //! The crash report ID is under the control of the snapshot
  //! producer, which may call this method to set the report ID. If this is not
  //! done, ReportID() will return an identifier consisting entirely of zeroes.
  void SetReportID(const UUID& report_id) { report_id_ = report_id; }

  //! \brief Sets the value to be returned by ClientID().
  //!
  //! The client ID is under the control of the snapshot producer,
  //! which may call this method to set the client ID. If this is not done,
  //! ClientID() will return an identifier consisting entirely of zeroes.
  void SetClientID(const UUID& client_id) { client_id_ = client_id; }

  //! \brief Add an annotation to be returned by AnnotationsSimpleMap().
  //!
  //! Most process annotations are under the control of the snapshot
  //! producer, which may call this method to establish these annotations.
  //! On Android Q or later, the process snapshot may add an "abort_message"
  //! annotation, which will contain the abort message passed to the
  //! android_set_abort_message() function. Contrast this with module
  //! annotations, which are under the control of the process being snapshotted.
  void AddAnnotation(const std::string& key, const std::string& value) {
    if (annotations_simple_map_.find(key) == annotations_simple_map_.end())
      annotations_simple_map_[key] = value;
  }

  //! \brief Returns options from CrashpadInfo structures found in modules in
  //!     the process.
  //!
  //! \param[out] options Options set in CrashpadInfo structures in modules in
  //!     the process.
  void GetCrashpadOptions(CrashpadInfoClientOptions* options);

  // ProcessSnapshot:

  crashpad::ProcessID ProcessID() const override;
  crashpad::ProcessID ParentProcessID() const override;
  void SnapshotTime(timeval* snapshot_time) const override;
  void ProcessStartTime(timeval* start_time) const override;
  void ProcessCPUTimes(timeval* user_time, timeval* system_time) const override;
  void ReportID(UUID* report_id) const override;
  void ClientID(UUID* client_id) const override;
  const std::map<std::string, std::string>& AnnotationsSimpleMap()
      const override;
  const SystemSnapshot* System() const override;
  std::vector<const ThreadSnapshot*> Threads() const override;
  std::vector<const ModuleSnapshot*> Modules() const override;
  std::vector<UnloadedModuleSnapshot> UnloadedModules() const override;
  const ExceptionSnapshot* Exception() const override;
  std::vector<const MemoryMapRegionSnapshot*> MemoryMap() const override;
  std::vector<HandleSnapshot> Handles() const override;
  std::vector<const MemorySnapshot*> ExtraMemory() const override;
  const ProcessMemory* Memory() const override;

 private:
  void InitializeThreads();
  void InitializeModules();
#if defined(STARBOARD)
  void InitializeModules(VMAddress evergreen_information_address);
  void AddAnnotations(VMAddress serialized_annotations_address,
                      int serialized_annotations_size);
#endif
  void InitializeAnnotations();

  std::map<std::string, std::string> annotations_simple_map_;
  timeval snapshot_time_;
  UUID report_id_;
  UUID client_id_;
  std::vector<std::unique_ptr<internal::ThreadSnapshotLinux>> threads_;
  std::vector<std::unique_ptr<internal::ModuleSnapshotElf>> modules_;
#if defined(STARBOARD)
  std::unique_ptr<internal::ModuleSnapshotEvergreen> evergreen_module_;
#endif
  std::unique_ptr<internal::ExceptionSnapshotLinux> exception_;
  internal::SystemSnapshotLinux system_;
  ProcessReaderLinux process_reader_;
  ProcessMemoryRange memory_range_;
  InitializationStateDcheck initialized_;

  DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotLinux);
};

}  // namespace crashpad

#endif  // CRASHPAD_SNAPSHOT_LINUX_PROCESS_SNAPSHOT_LINUX_H_


text:
<!DOCTYPE html>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="assets/images/favicon.ico">

    <title>Negotiation</title>

    <link href="assets/bs3/css/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/bootstrap-reset.css" rel="stylesheet">
    <link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />

    <link href="assets/js/mini-upload-form/assets/css/bucketmin.css" rel="stylesheet" />

    <link rel="stylesheet" href="assets/js/data-tables/DT_bootstrap.css" />

    <link rel="stylesheet" type="text/css" href="assets/js/bootstrap-datepicker/css/datepicker.css" />

    <link href="assets/css/style.css" rel="stylesheet">
    <link href="assets/css/style-responsive.css" rel="stylesheet" />

        <?php
        $this->load->view('template/header');
        $this->load->view('template/sidebar_left');
        ?>

Data Supplier -

                                    <?= form_open(base_url('#'), 'class = "form-inline"'); ?>

                                        <input id="search_id" type="text" size="10" class="form-control" placeholder="ID-Supplier" autofocus name="idsup">
                                        <input id="search_name" list="languages" type="text" size="30" class="form-control" placeholder="Supplier's Name" name="namesup">
                                        <datalist id="languages">

                                        </datalist>

                                    <?= form_close()?>

Edit

Upload

Export to Excel

                                        Warning! This supplier data is not approved yet. Approve now?

                                        Warning! ID not found

                <?= form_open(base_url('#'), array('class' => 'form-horizontal', 'id' => 'form-nego')); ?>

  Basic Data

  Payment Data

  Order & Delivery Schedule

  Stop Payment / Business Data

                <?= form_close()?>


text:
import urlparse

from scrapy.conf import settings
from scrapy.core.exceptions import NotConfigured
from scrapy.selector import HtmlXPathSelector
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.spider import BaseSpider
from scrapy.http import Request
from scrapy.utils.url import urljoin_rfc

from ocw.items import MaterialItemLoader

class MaterialsSpider(BaseSpider):
    name = 'materials'
    allowed_domains = ['ocw.mit.edu']

    WORD_RE = r'[\w\-]+'
    # /courses/<department>/<course-id>
    COURSE_LINK_RE = r'/courses/%s/%s/?$' % (WORD_RE, WORD_RE)
    COURSE_LINK_XPATH = '//div[@class="course_detail"]'

    course_le = SgmlLinkExtractor(allow=COURSE_LINK_RE, restrict_xpaths=COURSE_LINK_XPATH)

    _department_url = 'http://ocw.mit.edu/courses/%s/'

    def department_url(self, cid):
        return self._department_url % cid

    def start_requests(self):
        department_id = settings.get('DEPARTMENT_ID')
        if not department_id:
            raise NotConfigured("Requires DEPARTMENT_ID setting. Use --set DEPARTMENT_ID=name")

        url = self.department_url(department_id)

        yield self.make_requests_from_url(url)

    def parse(self, response):
        # follow course links
        for link in self.course_le.extract_links(response):
            # go directly to download materials link
            url = '%s/download-course-materials/' % link.url.rstrip('/')
            yield Request(url, callback=self.parse_item)

    def parse_item(self, response):
        # get url's path parts
        # /course/<department>/<course>/download.../
        path = urlparse.urlparse(response.url).path.strip('/').split('/')

        hxs = HtmlXPathSelector(response)
        breads = hxs.select('//div[@id="portal-breadcrumbs"]//a/text()').extract()
        dlink = hxs.select('//div[@class="downloadLink"]')

        url = urljoin_rfc(response.url, dlink.select('./a/@href').extract()[0])
        size = dlink.select('./a//text()').extract()

        loader = MaterialItemLoader(selector=hxs)
        loader.add_value('department_id', path[1])
        loader.add_value('department', breads[2])
        loader.add_value('course_id', path[2])
        loader.add_value('course', breads[2])
        loader.add_value('download_size', size)
        loader.add_value('download_url', url)
        loader.add_value('origin_url', response.url)

        return loader.load_item()

SPIDER = MaterialsSpider()


text:
docker ps -a
docker ps |grep elastic
if [ ? != 0 ] ; then
  docker run -dit --name=elastic551 --restart=unless-stopped  -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" docker.elastic.co/elasticsearch/elasticsearch:5.5.1
  docker ps -a
fi

echo The vm_max_map_count kernel setting needs to be set to at least 262144 for production use. Depending on your platform:
echo The vm_map_max_count setting should be set permanently in /etc/sysctl.conf:

grep vm.max_map_count /etc/sysctl.conf
echo To apply the setting on a live system type: sysctl -w vm.max_map_count=262144

echo test elasticsearch service is alive ...

curl -u elastic:changeme 'localhost:9200/_cat/master?v'
curl -u elastic:changeme 'localhost:9200/_cat/health?v'
curl -u elastic:changeme 'localhost:9200/_cat/indices?format=json&pretty'


text:
'use strict'

acas.module('acDataCache', 'acas.utility.angular', 'underscorejs', function () {
	acas.utility.angular.factory('acDataCache', ['$q', '$http', function ($q, $http) {
		return new function () {

			var dataCache = {}

			var utilities = {
				dataInCache: function (url) {
					return dataCache[url] !== undefined
				},

				storeData: function (url, data) {
					dataCache[url] = data
				},

				retrieveData: function (url) {
					return dataCache[url]
				}
			}

			var api = {
				getData: function (url) {
					var deferred = $q.defer()
					if (utilities.dataInCache(url)) {
						deferred.resolve(utilities.retrieveData(url))
					}
					else {
						$http({ method: 'GET', url: url })
							.success(function (data) {
								utilities.storeData(url, data)
								deferred.resolve(data)
							})
							.error(function (data) {
								deferred.reject(data)
							})
					}
					return deferred.promise
				}
			}

			return api

		}
	}])

})


text:
#include "Precompiled.h"
#include "TestEaseActions.h"

enum
{
	kTagAction1 = 1,
	kTagAction2 = 2,
	kTagSlider  = 1,
};

TestEaseActions* TestEaseActions::create ( KDvoid )
{
	TestEaseActions*  pLayer = KD_NULL;

	switch ( s_nSubTestIndex )
	{
		case  0 : pLayer = new SpriteEase                 ( ); break;
		case  1 : pLayer = new SpriteEaseInOut            ( ); break;
		case  2 : pLayer = new SpriteEaseExponential      ( ); break;
		case  3 : pLayer = new SpriteEaseExponentialInOut ( ); break;
		case  4 : pLayer = new SpriteEaseSine             ( ); break;
		case  5 : pLayer = new SpriteEaseSineInOut        ( ); break;
		case  6 : pLayer = new SpriteEaseElastic          ( ); break;
		case  7 : pLayer = new SpriteEaseElasticInOut     ( ); break;
		case  8 : pLayer = new SpriteEaseBounce           ( ); break;
		case  9 : pLayer = new SpriteEaseBounceInOut      ( ); break;
		case 10 : pLayer = new SpriteEaseBack             ( ); break;
		case 11 : pLayer = new SpriteEaseBackInOut        ( ); break;
		case 12 : pLayer = new SpeedTest                  ( ); break;
	}

	if ( pLayer && pLayer->init ( ) )
	{
		pLayer->autorelease ( );
	}
	else
	{
		CC_SAFE_DELETE ( pLayer );
	}

	return pLayer;
}

KDuint TestEaseActions::count ( KDvoid )
{
	return 13;
}

KDbool TestEaseActions::init ( KDvoid )
{
	if ( !TestBasic::init ( ) )
	{
		return KD_FALSE;
	}

	const CCSize&  tLyrSize = this->getContentSize ( );

	m_grossini = CCSprite::create ( "Images/grossini.png" );
	m_grossini->setPosition ( ccp ( 60, tLyrSize.cy / 5 * 1 ) );
	this->addChild ( m_grossini, 3 );

	m_tamara = CCSprite::create ( "Images/grossinis_sister1.png" );
	m_tamara->setPosition ( ccp ( 60, tLyrSize.cy / 5 * 4 ) );
	this->addChild ( m_tamara, 1 );

	m_kathia = CCSprite::create ( "Images/grossinis_sister2.png" );
	m_kathia->setPosition ( ccp ( 60, tLyrSize.cy / 2 ) );
	this->addChild ( m_kathia, 2 );

	return KD_TRUE;
}

KDvoid TestEaseActions::positionForTwo ( KDvoid )
{
	const CCSize&  tLyrSize = this->getContentSize ( );

	m_grossini->setPosition ( ccp ( 60, tLyrSize.cy / 3 * 1 ) );
	m_tamara  ->setPosition ( ccp ( 60, tLyrSize.cy / 3 * 2 ) );
	m_kathia  ->setVisible ( KD_FALSE );
}

#define CCCA(x)   ( (CCActionInterval*) x->copy ( )->autorelease ( ) )

//------------------------------------------------------------------
//
// SpriteEase
//
//------------------------------------------------------------------
KDvoid SpriteEase::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    const CCSize&  s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130,0 ) );
    CCActionInterval* move_back = move->reverse();

    CCActionInterval* move_ease_in = CCEaseIn::create ( CCCA ( move ), 2.5f);
    CCActionInterval* move_ease_in_back = move_ease_in->reverse();

    CCActionInterval* move_ease_out = CCEaseOut::create ( CCCA ( move ), 2.5f);
    CCActionInterval* move_ease_out_back = move_ease_out->reverse();

    CCDelayTime *delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), KD_NULL);
    CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), KD_NULL);

    CCAction *a2 = m_grossini->runAction(CCRepeatForever::create ( seq1 ) );
    a2->setTag(1);

    CCAction *a1 = m_tamara->runAction(CCRepeatForever::create ( seq2 ) );
    a1->setTag(1);

    CCAction *a = m_kathia->runAction(CCRepeatForever::create ( seq3 ) );
    a->setTag(1);

    schedule(schedule_selector(SpriteEase::testStopAction), 6.25f);

}

KDvoid SpriteEase::testStopAction ( KDfloat dt )
{
	unschedule ( schedule_selector ( SpriteEase::testStopAction ) );

	m_tamara  ->stopActionByTag ( 1 );
	m_kathia  ->stopActionByTag ( 1 );
	m_grossini->stopActionByTag ( 1 );
}

const KDchar* SpriteEase::title ( KDvoid )
{
	return "EaseIn - EaseOut - Stop";
}

//------------------------------------------------------------------
//
// SpriteEaseInOut
//
//------------------------------------------------------------------
KDvoid SpriteEaseInOut::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval*  move = CCMoveBy::create(3, ccp(s.cx-130,0 ) );
//    id move_back = move->reverse();

    CCActionInterval*  move_ease_inout1 = CCEaseInOut::create ( CCCA ( move ), 0.65f);
    CCActionInterval*  move_ease_inout_back1 = move_ease_inout1->reverse();

    CCActionInterval*  move_ease_inout2 = CCEaseInOut::create ( CCCA ( move ), 1.35f);
    CCActionInterval*  move_ease_inout_back2 = move_ease_inout2->reverse();

    CCActionInterval*  move_ease_inout3 = CCEaseInOut::create ( CCCA ( move ), 1.0f);
    CCActionInterval*  move_ease_inout_back3 = move_ease_inout3->reverse();

    CCDelayTime*  delay = CCDelayTime::create(0.25f);

    CCSequence*  seq1 = CCSequence::create( move_ease_inout1, delay, move_ease_inout_back1, CCCA(delay), KD_NULL);
    CCSequence*  seq2 = CCSequence::create( move_ease_inout2, CCCA(delay), move_ease_inout_back2, CCCA(delay), KD_NULL);
    CCSequence*  seq3 = CCSequence::create( move_ease_inout3, CCCA(delay), move_ease_inout_back3, CCCA(delay), KD_NULL);

    m_tamara->runAction(CCRepeatForever::create ( seq1 ) );
    m_kathia->runAction(CCRepeatForever::create ( seq2 ) );
    m_grossini->runAction(CCRepeatForever::create ( seq3 ) );

}

const KDchar* SpriteEaseInOut::title ( KDvoid )
{
	return "EaseInOut and rates";
}

//------------------------------------------------------------------
//
// SpriteEaseExponential
//
//------------------------------------------------------------------
KDvoid SpriteEaseExponential::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130,0 ) );
    CCActionInterval* move_back = move->reverse();

    CCActionInterval* move_ease_in = CCEaseExponentialIn::create ( CCCA ( move ) );
    CCActionInterval* move_ease_in_back = move_ease_in->reverse();

    CCActionInterval* move_ease_out = CCEaseExponentialOut::create ( CCCA ( move ) );
    CCActionInterval* move_ease_out_back = move_ease_out->reverse();

    CCDelayTime *delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), KD_NULL);
    CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), KD_NULL);

    m_grossini->runAction( CCRepeatForever::create ( seq1 ) );
    m_tamara->runAction( CCRepeatForever::create ( seq2 ) );
    m_kathia->runAction( CCRepeatForever::create ( seq3 ) );
}

const KDchar* SpriteEaseExponential::title ( KDvoid )
{
	return "ExpIn - ExpOut actions";
}

//------------------------------------------------------------------
//
// SpriteEaseExponentialInOut
//
//------------------------------------------------------------------
KDvoid SpriteEaseExponentialInOut::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130, 0 ) );
    CCActionInterval* move_back = move->reverse();

    CCActionInterval* move_ease = CCEaseExponentialInOut::create ( CCCA ( move ) );
    CCActionInterval* move_ease_back = move_ease->reverse();    //--> reverse()

    CCDelayTime *delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create( move, delay, move_back, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create( move_ease, delay, move_ease_back, CCCA(delay), KD_NULL);

    this->positionForTwo();

    m_grossini->runAction( CCRepeatForever::create ( seq1 ) );
    m_tamara->runAction( CCRepeatForever::create ( seq2 ) );

}

const KDchar* SpriteEaseExponentialInOut::title ( KDvoid )
{
	return "EaseExponentialInOut action";
}

//------------------------------------------------------------------
//
// SpriteEaseSine
//
//------------------------------------------------------------------
KDvoid SpriteEaseSine::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130, 0 ) );
    CCActionInterval* move_back = move->reverse();

    CCActionInterval* move_ease_in = CCEaseSineIn::create ( CCCA ( move ) );
    CCActionInterval* move_ease_in_back = move_ease_in->reverse();

    CCActionInterval* move_ease_out = CCEaseSineOut::create ( CCCA ( move ) );
    CCActionInterval* move_ease_out_back = move_ease_out->reverse();

    CCDelayTime*  delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), KD_NULL);
    CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), KD_NULL);

    m_grossini->runAction( CCRepeatForever::create ( seq1 ) );
    m_tamara->runAction( CCRepeatForever::create ( seq2 ) );
    m_kathia->runAction( CCRepeatForever::create ( seq3 ) );

}

const KDchar* SpriteEaseSine::title ( KDvoid )
{
	return "EaseSineIn - EaseSineOut";
}

//------------------------------------------------------------------
//
// SpriteEaseSineInOut
//
//------------------------------------------------------------------
KDvoid SpriteEaseSineInOut::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130,0 ) );
    CCActionInterval* move_back = move->reverse();

    CCActionInterval* move_ease = CCEaseSineInOut::create ( CCCA ( move ) );
    CCActionInterval* move_ease_back = move_ease->reverse();

    CCDelayTime *delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create(move_ease, CCCA(delay), move_ease_back, CCCA(delay), KD_NULL);

    this->positionForTwo();

    m_grossini->runAction( CCRepeatForever::create ( seq1 ) );
    m_tamara->runAction( CCRepeatForever::create ( seq2 ) );

}

const KDchar* SpriteEaseSineInOut::title ( KDvoid )
{
	return "EaseSineInOut action";
}

//------------------------------------------------------------------
//
// SpriteEaseElastic
//
//------------------------------------------------------------------
KDvoid SpriteEaseElastic::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130, 0 ) );
    CCActionInterval* move_back = move->reverse();

    CCActionInterval* move_ease_in = CCEaseElasticIn::create ( CCCA ( move ) );
    CCActionInterval* move_ease_in_back = move_ease_in->reverse();

    CCActionInterval* move_ease_out = CCEaseElasticOut::create ( CCCA ( move ) );
    CCActionInterval* move_ease_out_back = move_ease_out->reverse();

    CCDelayTime *delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), KD_NULL);
    CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), KD_NULL);

    m_grossini->runAction( CCRepeatForever::create ( seq1 ) );
    m_tamara->runAction( CCRepeatForever::create ( seq2 ) );
    m_kathia->runAction( CCRepeatForever::create ( seq3 ) );

}

const KDchar* SpriteEaseElastic::title ( KDvoid )
{
	return "Elastic In - Out actions";
}

//------------------------------------------------------------------
//
// SpriteEaseElasticInOut
//
//------------------------------------------------------------------
KDvoid SpriteEaseElasticInOut::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130, 0 ) );

    CCActionInterval* move_ease_inout1 = CCEaseElasticInOut::create ( CCCA ( move ), 0.3f);
    CCActionInterval* move_ease_inout_back1 = move_ease_inout1->reverse();

    CCActionInterval* move_ease_inout2 = CCEaseElasticInOut::create ( CCCA ( move ), 0.45f);
    CCActionInterval* move_ease_inout_back2 = move_ease_inout2->reverse();

    CCActionInterval* move_ease_inout3 = CCEaseElasticInOut::create ( CCCA ( move ), 0.6f);
    CCActionInterval* move_ease_inout_back3 = move_ease_inout3->reverse();

    CCDelayTime *delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create(move_ease_inout1, delay, move_ease_inout_back1, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create(move_ease_inout2, CCCA(delay), move_ease_inout_back2, CCCA(delay), KD_NULL);
    CCSequence* seq3 = CCSequence::create(move_ease_inout3, CCCA(delay), move_ease_inout_back3, CCCA(delay), KD_NULL);

    m_tamara->runAction( CCRepeatForever::create ( seq1 ) );
    m_kathia->runAction( CCRepeatForever::create ( seq2 ) );
    m_grossini->runAction( CCRepeatForever::create ( seq3 ) );
}

const KDchar* SpriteEaseElasticInOut::title ( KDvoid )
{
	return "EaseElasticInOut action";
}

//------------------------------------------------------------------
//
// SpriteEaseBounce
//
//------------------------------------------------------------------
KDvoid SpriteEaseBounce::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130, 0 ) );
    CCActionInterval* move_back = move->reverse();

    CCActionInterval* move_ease_in = CCEaseBounceIn::create ( CCCA ( move ) );
    CCActionInterval* move_ease_in_back = move_ease_in->reverse();

    CCActionInterval* move_ease_out = CCEaseBounceOut::create ( CCCA ( move ) );
    CCActionInterval* move_ease_out_back = move_ease_out->reverse();

    CCDelayTime *delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), KD_NULL);
    CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), KD_NULL);

    m_grossini->runAction( CCRepeatForever::create ( seq1 ) );
    m_tamara->runAction( CCRepeatForever::create ( seq2 ) );
    m_kathia->runAction( CCRepeatForever::create ( seq3 ) );

}

const KDchar* SpriteEaseBounce::title ( KDvoid )
{
	return "Bounce In - Out actions";
}

//------------------------------------------------------------------
//
// SpriteEaseBounceInOut
//
//------------------------------------------------------------------
KDvoid SpriteEaseBounceInOut::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130, 0 ) );
    CCActionInterval* move_back = move->reverse();

    CCActionInterval* move_ease = CCEaseBounceInOut::create ( CCCA ( move ) );
    CCActionInterval* move_ease_back = move_ease->reverse();

    CCDelayTime *delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create(move_ease, CCCA(delay), move_ease_back, CCCA(delay), KD_NULL);

    this->positionForTwo();

    m_grossini->runAction( CCRepeatForever::create ( seq1 ) );
    m_tamara->runAction( CCRepeatForever::create ( seq2 ) );
}

const KDchar* SpriteEaseBounceInOut::title ( KDvoid )
{
	return "EaseBounceInOut action";
}

//------------------------------------------------------------------
//
// SpriteEaseBack
//
//------------------------------------------------------------------
KDvoid SpriteEaseBack::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130, 0 ) );
    CCActionInterval* move_back = move->reverse();

    CCActionInterval* move_ease_in = CCEaseBackIn::create ( CCCA ( move ) );
    CCActionInterval* move_ease_in_back = move_ease_in->reverse();

    CCActionInterval* move_ease_out = CCEaseBackOut::create ( CCCA ( move ) );
    CCActionInterval* move_ease_out_back = move_ease_out->reverse();

    CCDelayTime *delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), KD_NULL);
    CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), KD_NULL);

    m_grossini->runAction(CCRepeatForever::create ( seq1 ) );
    m_tamara->runAction(CCRepeatForever::create ( seq2 ) );
    m_kathia->runAction(CCRepeatForever::create ( seq3 ) );
}

const KDchar* SpriteEaseBack::title ( KDvoid )
{
	return "Back In - Out actions";
}

//------------------------------------------------------------------
//
// SpriteEaseBackInOut
//
//------------------------------------------------------------------
KDvoid SpriteEaseBackInOut::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    CCActionInterval* move = CCMoveBy::create(3, ccp(s.cx-130, 0 ) );
    CCActionInterval* move_back = move->reverse();

    CCActionInterval* move_ease = CCEaseBackInOut::create ( CCCA ( move ) );
    CCActionInterval* move_ease_back = move_ease->reverse();

    CCDelayTime *delay = CCDelayTime::create(0.25f);

    CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), KD_NULL);
    CCSequence* seq2 = CCSequence::create(move_ease, CCCA(delay), move_ease_back, CCCA(delay), KD_NULL);

    this->positionForTwo();

    m_grossini->runAction( CCRepeatForever::create ( seq1 ) );
    m_tamara->runAction( CCRepeatForever::create ( seq2 ) );
}

const KDchar* SpriteEaseBackInOut::title ( KDvoid )
{
	return "EaseBackInOut action";
}

//------------------------------------------------------------------
//
// SpeedTest
//
//------------------------------------------------------------------

KDvoid SpeedTest::onEnter ( KDvoid )
{
	TestEaseActions::onEnter ( );

    CCSize s = this->getContentSize ( );

    // rotate and jump
    CCActionInterval *jump1 = CCJumpBy::create(4, ccp(-s.cx+80, 0), 100, 4);
    CCActionInterval *jump2 = jump1->reverse();
    CCActionInterval *rot1 = CCRotateBy::create(4, 360*2);
    CCActionInterval *rot2 = rot1->reverse();

    CCSequence* seq3_1 = CCSequence::create(jump2, jump1, KD_NULL);
    CCSequence* seq3_2 = CCSequence::create( rot1, rot2, KD_NULL);
    CCSpawn* spawn = CCSpawn::create(seq3_1, seq3_2, KD_NULL);
    CCSpeed* action = CCSpeed::create(CCRepeatForever::create ( spawn), 1.0f);
    action->setTag(kTagAction1);

    CCAction* action2 = (CCAction*)(action->copy()->autorelease( ) );
    CCAction* action3 = (CCAction*)(action->copy()->autorelease( ) );

    action2->setTag(kTagAction1);
    action3->setTag(kTagAction1);

    m_grossini->runAction(action2);
    m_tamara->runAction(action3);
    m_kathia->runAction(action);

    this->schedule(schedule_selector(SpeedTest::altertime), 1.0f);
}

KDvoid SpeedTest::altertime ( KDfloat dt )
{
	CCSpeed*  action1 = (CCSpeed*) ( m_grossini->getActionByTag ( kTagAction1 ) );
	CCSpeed*  action2 = (CCSpeed*) ( m_tamara  ->getActionByTag ( kTagAction1 ) );
	CCSpeed*  action3 = (CCSpeed*) ( m_kathia  ->getActionByTag ( kTagAction1 ) );

	action1->setSpeed ( CCRANDOM_0_1 ( ) * 2 );
	action2->setSpeed ( CCRANDOM_0_1 ( ) * 2 );
	action3->setSpeed ( CCRANDOM_0_1 ( ) * 2 );
}

const KDchar* SpeedTest::title ( KDvoid )
{
	return "Speed action";
}


text:
- Many functions in this implementation tell the user warnings such as
"Not a valid response. Canceling transaction." However, a programmer fixing
and extending this application might wish to throw errors and raise
actual exceptions "behind the scenes" for efficient debugging.

- There needs to be more (and more consistent) error handling in general.

- There are several blocks like the following scattered among the modules,
none of them standardized:
```python
        attempts = 0
        while answer not in ["w", "d", "x"]:
            answer = clean(raw_input(retry_instructions))
            attempts += 1
            if attempts >= 3:
                print "Canceling transaction after three attempts."
                break
                return
```
It would be worthwhile to abstract this behavior. For example, we
could try writing a decorator called `retry()` that would take in a
`max_attempts` argument, then decorate any action allowing more than one try.

- Withdrawals and deposits are not that different from one another.
Perhaps we could write a `Transaction` class that both would inherit from.

- The application is currently small enough to hold the main method,
all modules, and all tests in one folder. However, as it grows, we will need
to introduce cleaner folder structure--perhaps two subfolders called `tests`
and `lib` to start out.

- At this time, only unit tests for the individual modules are
included. A full test suite would also include an end-to-end test for
the application named `test_app.py`.

## Extensions
As this is only a partial implementation, there are many extensions to explore.
A sample:

- In real life, a customer would dip their bank card into a slot. The card
reader would retrieve the customer's information based on this unique card
number, *then* ask for the PIN to confirm the customer's identity.

- Banks typically allow a given customer no more than six withdrawals per month
from their savings account. How can we introduce this rule?

- This prototype reads in seed data from a JSON file, but the data
schema is relatively flat; would it make more sense to store customer
data in a SQL table? If so, how would we implement that?

- The program currently allows the customer only one chance to enter a number
for deposit or withdrawal. We could ask the user to confirm or correct the
amount before proceeding.

- The only transactions allowed at this time are withdrawal and deposit.
Customers with multiple accounts may wish to transfer money between accounts.

- The current user interface is the command line. To make a user-friendly UI,
we would set up routes that a front-end framework could access for programming
buttons and displays.

- Transaction logging is enabled. A next step would be to give the user options
such as printing a more detailed receipt and viewing recent account activity.


text:
package testedGists

import java.io._
import java.util.zip._
import org.slf4j._
import ZipUtils._

/** Tool to find and transform an arbitrary file in a zip file or nested zip files. */
object TransformFileInZip {

  private val logger = LoggerFactory.getLogger(this.getClass())

  def copy(from: InputStream, to: OutputStream) {
    val buffer1 = new Array[Byte](1024)
    Stream.continually {
      val read1 = from.read(buffer1, 0, buffer1.length)
      to.write(buffer1, 0, read1)
      read1 != -1
    }.takeWhile(_ == true)
  }

  /** Wrapper around a ZipInputStream to avoid the xml parsing to close the stream */
  class ZipInputGuard(is: InputStream) extends FilterInputStream(is) {
    override def close() {
      in match {
        case zis: ZipInputStream => zis.closeEntry
        case _ => in.close
      }
    }
  }

  /** Wrapper around a ZipInputStream to avoid the xml parsing to close the stream */
  class ZipOutputGuard(os: OutputStream) extends FilterOutputStream(os) {
    override def close() {
      out match {
        case zos: ZipOutputStream => zos.closeEntry
        case _ => out.close
      }
    }
  }

  /** How fileToTransformPath works:

    *

    *
when parsing the given path, zip file names are considered as
    * directories
    *
file contained in a zip inside zip,
    * "[directory/]zipFile/[directory/]file"

    *
you can add more levels of zip containing zips,
    * "zipLevel1/zipLevel2/.../zipLeveln/file"

    *
full filename and directory is expected, no partial name search

    *

    * fileToTransformPath sample:
    * uwb-war-4.7-SNAPSHOT.war/WEB-INF/web.xml
    *
    * @param zipFile
    * @param targetZipFilePath
    *          the path of the new zip file to create
    * @param fileToTransformPath
    *          the path inside the zip (or multiple zips) to the file to
    *          transform, cannot be a directory or a zip file
    * @param transformer
    *          the function object which will be applied to the target file
    * @return true if the fileToTransform was transformed, false otherwise
    */
  def transformFile(zipFile: ZipFile, targetZipFilePath: String, fileToTransformPath: String)(
      transformer: (InputStream, OutputStream) => Unit): Boolean = {
    val start = System.currentTimeMillis()
    logger.debug("Processing zip file \"" + zipFile.getName() + "\".")
    safeClose(new ZipInputStream(new FileInputStream(zipFile.getName()))) { zis =>
      safeClose(new ZipOutputStream(new FileOutputStream(targetZipFilePath))) { zos =>
        if (!transformZipStream(zis, zos, fileToTransformPath, transformer)) {
          logger.error("The given file has not been found in the given zip file. No transformation applied. No file created.")
          zos.close()
          new File(targetZipFilePath).delete()
          false
        } else {
          logger.debug("New zip file: \"" + targetZipFilePath + "\"")
          logger.info("Execution time: " + (System.currentTimeMillis() - start) + "ms")
          true
        }
      }
    }
  }

  /** Recursive method which digs into the relevant war or modifies the target
    * file.
    *
    * @param zipInputStream
    * @param zipOutputStream
    * @param fileToTransformPath
    *          the path to the file to transform (see transformFile() doc for
    *          details)
    * @param transformer
    * @return true if the file has been found and transformed, false otherwise
    */
  def transformZipStream(zipInputStream: ZipInputStream,
      zipOutputStream: ZipOutputStream, fileToTransformPath: String,
      transformer: (InputStream, OutputStream) => Unit): Boolean = {
    var applied = false
    Stream.continually(zipInputStream.getNextEntry).takeWhile(_ != null).filter(!_.isDirectory()).foreach { zipEntry =>
      logger.debug("Processing entry '"+zipEntry.getName()+"'")
      val zipEntryName = zipEntry.getName()
      zipOutputStream.putNextEntry(new ZipEntry(zipEntryName))
      if (fileToTransformPath.startsWith(zipEntryName)) {
        if (fileToTransformPath.equals(zipEntryName)) { // found it!
          transformer(new ZipInputGuard(zipInputStream), new ZipOutputGuard(zipOutputStream))
          applied = true
        } else { // zipEntryName is an embedded zip, we need to dig into
                 // more zip files
          applied = transformZipStream(new ZipInputStream(zipInputStream),
              new ZipOutputStream(zipOutputStream),
              fileToTransformPath.substring(zipEntryName.length() + 1),
              transformer)
        }
      } else {
        if (!zipEntry.isDirectory())
          copy(zipInputStream, zipOutputStream)
      }
      zipOutputStream.closeEntry()
      zipInputStream.closeEntry()
    }
    applied
  }
}


text:
package binding

import (
	"errors"
	"reflect"
	"strconv"
	"time"
)

func mapForm(ptr interface{}, form map[string][]string) error {
	typ := reflect.TypeOf(ptr).Elem()
	val := reflect.ValueOf(ptr).Elem()
	for i := 0; i < typ.NumField(); i++ {
		typeField := typ.Field(i)
		structField := val.Field(i)
		if !structField.CanSet() {
			continue
		}

		structFieldKind := structField.Kind()
		inputFieldName := typeField.Tag.Get("form")
		if inputFieldName == "" {
			inputFieldName = typeField.Name

			// if "form" tag is nil, we inspect if the field is a struct.
			// this would not make sense for JSON parsing but it does for a form
			// since data is flatten
			if structFieldKind == reflect.Struct {
				err := mapForm(structField.Addr().Interface(), form)
				if err != nil {
					return err
				}
				continue
			}
		}
		inputValue, exists := form[inputFieldName]
		if !exists {
			continue
		}

		numElems := len(inputValue)
		if structFieldKind == reflect.Slice && numElems > 0 {
			sliceOf := structField.Type().Elem().Kind()
			slice := reflect.MakeSlice(structField.Type(), numElems, numElems)
			for i := 0; i < numElems; i++ {
				if err := setWithProperType(sliceOf, inputValue[i], slice.Index(i)); err != nil {
					return err
				}
			}
			val.Field(i).Set(slice)
		} else {
			if _, isTime := structField.Interface().(time.Time); isTime {
				if err := setTimeField(inputValue[0], typeField, structField); err != nil {
					return err
				}
				continue
			}
			if err := setWithProperType(typeField.Type.Kind(), inputValue[0], structField); err != nil {
				return err
			}
		}
	}
	return nil
}

func setWithProperType(valueKind reflect.Kind, val string, structField reflect.Value) error {
	switch valueKind {
	case reflect.Int:
		return setIntField(val, 0, structField)
	case reflect.Int8:
		return setIntField(val, 8, structField)
	case reflect.Int16:
		return setIntField(val, 16, structField)
	case reflect.Int32:
		return setIntField(val, 32, structField)
	case reflect.Int64:
		return setIntField(val, 64, structField)
	case reflect.Uint:
		return setUintField(val, 0, structField)
	case reflect.Uint8:
		return setUintField(val, 8, structField)
	case reflect.Uint16:
		return setUintField(val, 16, structField)
	case reflect.Uint32:
		return setUintField(val, 32, structField)
	case reflect.Uint64:
		return setUintField(val, 64, structField)
	case reflect.Bool:
		return setBoolField(val, structField)
	case reflect.Float32:
		return setFloatField(val, 32, structField)
	case reflect.Float64:
		return setFloatField(val, 64, structField)
	case reflect.String:
		structField.SetString(val)
	default:
		return errors.New("Unknown type")
	}
	return nil
}

func setIntField(val string, bitSize int, field reflect.Value) error {
	if val == "" {
		val = "0"
	}
	intVal, err := strconv.ParseInt(val, 10, bitSize)
	if err == nil {
		field.SetInt(intVal)
	}
	return err
}

func setUintField(val string, bitSize int, field reflect.Value) error {
	if val == "" {
		val = "0"
	}
	uintVal, err := strconv.ParseUint(val, 10, bitSize)
	if err == nil {
		field.SetUint(uintVal)
	}
	return err
}

func setBoolField(val string, field reflect.Value) error {
	if val == "" {
		val = "false"
	}
	boolVal, err := strconv.ParseBool(val)
	if err == nil {
		field.SetBool(boolVal)
	}
	return nil
}

func setFloatField(val string, bitSize int, field reflect.Value) error {
	if val == "" {
		val = "0.0"
	}
	floatVal, err := strconv.ParseFloat(val, bitSize)
	if err == nil {
		field.SetFloat(floatVal)
	}
	return err
}

func setTimeField(val string, structField reflect.StructField, value reflect.Value) error {
	timeFormat := structField.Tag.Get("time_format")
	if timeFormat == "" {
		return errors.New("Blank time format")
	}

	if val == "" {
		value.Set(reflect.ValueOf(time.Time{}))
		return nil
	}

	l := time.Local
	if isUTC, _ := strconv.ParseBool(structField.Tag.Get("time_utc")); isUTC {
		l = time.UTC
	}

	if locTag := structField.Tag.Get("time_location"); locTag != "" {
		loc, err := time.LoadLocation(locTag)
		if err != nil {
			return err
		}
		l = loc
	}

	t, err := time.ParseInLocation(timeFormat, val, l)
	if err != nil {
		return err
	}

	value.Set(reflect.ValueOf(t))
	return nil
}

// Don't pass in pointers to bind to. Can lead to bugs. See:
// https://github.com/codegangsta/martini-contrib/issues/40
// https://github.com/codegangsta/martini-contrib/pull/34#issuecomment-29683659
func ensureNotPointer(obj interface{}) {
	if reflect.TypeOf(obj).Kind() == reflect.Ptr {
		panic("Pointers are not accepted as binding models")
	}
}


text:
package org.openehealth.ipf.commons.ihe.xds.core.transform.ebxml.ebxml30;

import org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLFactory;
import org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLFactory30;
import org.openehealth.ipf.commons.ihe.xds.core.transform.ebxml.AuthorTransformer;
import org.openehealth.ipf.commons.ihe.xds.core.transform.ebxml.AuthorTransformerTestBase;

/**
 * Tests for {@link AuthorTransformer}.
 * @author Jens Riemschneider
 */
public class AuthorTransformerTest extends AuthorTransformerTestBase {
    @Override
    public EbXMLFactory createFactory() {
        return new EbXMLFactory30();
    }
}


text:
'use strict';
const Code = require('code');
const FilterForm = require('./filter-form-fixture.jsx');
const Lab = require('lab');
const React = require('react');
const ReactDOM = require('react-dom');
const ReactTestUtils = require('react-dom/test-utils');

const lab = exports.lab = Lab.script();
const defaultProps = {
    loading: false,
    query: {},
    onChange: () => {}
};

lab.experiment('Filter Form HOC', () => {

    lab.test('it renders', (done) => {

        const FilterFormEl = React.createElement(FilterForm, defaultProps);
        const form = ReactTestUtils.renderIntoDocument(FilterFormEl);

        Code.expect(form).to.exist();

        done();
    });

    lab.test('it updates props with new input state data', (done) => {

        const container = document.createElement('div');

        // initial render
        let FilterFormEl = React.createElement(FilterForm, defaultProps);
        ReactDOM.render(FilterFormEl, container);

        // update props and render again
        const props = Object.assign({}, defaultProps, {
            loading: true
        });
        FilterFormEl = React.createElement(FilterForm, props);
        ReactDOM.render(FilterFormEl, container);

        done();
    });

    lab.test('it handles a select menu change event', (done) => {

        const props = Object.assign({}, defaultProps, {
            query: {
                page: '2'
            }
        });
        const FilterFormEl = React.createElement(FilterForm, props);
        const form = ReactTestUtils.renderIntoDocument(FilterFormEl);
        const select = ReactTestUtils.findRenderedDOMComponentWithTag(form, 'select');

        Code.expect(form.state.page).to.equal('2');

        ReactTestUtils.Simulate.change(select, {
            target: {
                name: 'select',
                value: 'b'
            }
        });

        Code.expect(form.state.page).to.equal('1');

        done();
    });

    lab.test('it handles submit on enter key, but not another key', (done) => {

        const props = Object.assign({}, defaultProps, {
            query: {
                page: '2'
            }
        });
        const FilterFormEl = React.createElement(FilterForm, props);
        const form = ReactTestUtils.renderIntoDocument(FilterFormEl);
        const text = ReactTestUtils.findRenderedDOMComponentWithTag(form, 'input');

        Code.expect(form.state.page).to.equal('2');

        ReactTestUtils.Simulate.keyDown(text, { key: 'a' });
        ReactTestUtils.Simulate.keyDown(text, { key: 'Enter', which: 13 });

        Code.expect(form.state.page).to.equal('1');

        done();
    });

    lab.test('it handles a page change', (done) => {

        const FilterFormEl = React.createElement(FilterForm, defaultProps);
        const form = ReactTestUtils.renderIntoDocument(FilterFormEl);

        Code.expect(form.state.page).to.equal('1');

        form.changePage('2');

        Code.expect(form.state.page).to.equal('2');

        done();
    });
});


text:
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>WeGaS</title>
    <link href="/client/index.css" media="screen" rel="stylesheet" type="text/css">
</head>
<body>

<div class="viewport">
    <script type="text/javascript" src="/socket.io/socket.io.js"></script>
    <script type="text/javascript" src="/client/assets/js/phaser.js"></script>
    <script type="text/javascript" src="/client/game.js"></script>
    <script type="text/javascript" src="/client/assets/js/Map.js"></script>
    <script type="text/javascript" src="/client/assets/js/Unit.js"></script>
    <script type="text/javascript" src="/client/assets/js/Selection.js"></script>
    <script type="text/javascript" src="/client/assets/js/Player.js"></script>
    <script type="text/javascript" src="/client/assets/js/aStar.js"></script>
    <script type="text/javascript" src="/client/assets/js/GUI.js"></script>
    <script type="text/javascript" src="/client/assets/js/Building.js"></script>
</div>

</body>
</html>


text:
(function() {
  var FieldOperator, UpdateQuery, WhereQuery, _,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  _ = require('../utils')._;

  WhereQuery = require('./WhereQuery');

  FieldOperator = require('./FieldOperator');

  UpdateQuery = (function(_super) {
    __extends(UpdateQuery, _super);

    function UpdateQuery(database, _tableName, _resultFactory) {
      this._tableName = _tableName;
      UpdateQuery.__super__.constructor.call(this, database, _resultFactory);
      this._values = {};
    }

    UpdateQuery.prototype.set = function(field, value) {
      if (_.isString(field)) {
        this._values[field] = value;
      } else if (field instanceof FieldOperator) {
        this._values[field.ids.join('.')] = value;
      } else if (_.isObject(field)) {
        _.extend(this._values, field);
      } else {
        throw new Error("Unexpected value '" + field + "'.");
      }
      return this;
    };

    UpdateQuery.prototype.__build = function(cmd) {
      cmd.update(this._tableName);
      cmd.set(this._values);
      if (this._rootCriterion != null) {
        cmd.where(this._rootCriterion);
      }
      return cmd.end();
    };

    return UpdateQuery;

  })(WhereQuery);

  module.exports = UpdateQuery;

}).call(this);


text:
from src.app import app

__author__ = 'glgs'

app.run(debug=app.config['DEBUG'])


text:
package net.fortuna.ical4j.connector.dav;

import org.apache.jackrabbit.webdav.DavConstants;
import org.apache.jackrabbit.webdav.property.DavPropertySet;
import org.apache.jackrabbit.webdav.xml.DomUtil;
import org.apache.jackrabbit.webdav.xml.XmlSerializable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * $Id$
 *
 * Created on 19/11/2008
 *
 * @author Ben
 *
 */
public class MkCalendar implements XmlSerializable {

    /**
     *
     */
    public static final String XML_MKCALENDAR = "mkcalendar";

    private DavPropertySet properties;

    /**
     * @return the properties
     */
    public DavPropertySet getProperties() {
        return properties;
    }

    /**
     * @param properties the properties to set
     */
    public void setProperties(DavPropertySet properties) {
        this.properties = properties;
    }

    /**
     * {@inheritDoc}
     */
    public Element toXml(Document document) {
        Element set = DomUtil.createElement(document, DavConstants.XML_SET, DavConstants.NAMESPACE);
        set.appendChild(properties.toXml(document));

        Element mkcalendar = DomUtil.createElement(document, XML_MKCALENDAR, CalDavConstants.NAMESPACE);
        mkcalendar.appendChild(set);
        return mkcalendar;
    }

}


text:
package com.thoughtworks.go.server.service;

import com.thoughtworks.go.config.CaseInsensitiveString;
import com.thoughtworks.go.config.CruiseConfig;
import com.thoughtworks.go.config.PipelineConfig;
import com.thoughtworks.go.config.TimerConfig;
import com.thoughtworks.go.listener.PipelineConfigChangedListener;
import com.thoughtworks.go.server.scheduling.BuildCauseProducerService;
import com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult;
import com.thoughtworks.go.serverhealth.HealthStateScope;
import com.thoughtworks.go.serverhealth.HealthStateType;
import com.thoughtworks.go.serverhealth.ServerHealthService;
import com.thoughtworks.go.serverhealth.ServerHealthState;
import org.apache.log4j.Logger;
import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import java.text.ParseException;
import java.util.List;

/**
 * @understands scheduling pipelines based on a timer
 */
@Component
public class TimerScheduler implements PipelineConfigChangedListener {
    private static final Logger LOG = Logger.getLogger(TimerScheduler.class);

    private GoConfigService goConfigService;
    private BuildCauseProducerService buildCauseProducerService;
    private SchedulerFactory quartzSchedulerFactory;
    private ServerHealthService serverHealthService;
    private Scheduler quartzScheduler;
    protected static final String QUARTZ_GROUP = "CruiseTimers";
    protected static final String BUILD_CAUSE_PRODUCER_SERVICE = "BuildCauseProducerService";
    protected static final String PIPELINE_CONFIG = "PipelineConfig";

    @Autowired
    public TimerScheduler(SchedulerFactory quartzSchedulerFactory, GoConfigService goConfigService,
                          BuildCauseProducerService buildCauseProducerService, ServerHealthService serverHealthService) {
        this.goConfigService = goConfigService;
        this.buildCauseProducerService = buildCauseProducerService;
        this.quartzSchedulerFactory = quartzSchedulerFactory;
        this.serverHealthService = serverHealthService;
    }

    public void initialize() {
        try {
            quartzScheduler = quartzSchedulerFactory.getScheduler();
            quartzScheduler.start();
            scheduleAllJobs(goConfigService.getAllPipelineConfigs());
            goConfigService.register(this);
        } catch (SchedulerException e) {
            showGlobalError("Failed to initialize timer", e);
        }
    }

    private void scheduleAllJobs(List<PipelineConfig> pipelineConfigs) {
        for (PipelineConfig pipelineConfig : pipelineConfigs) {
            scheduleJob(quartzScheduler, pipelineConfig);
        }
    }

    private void scheduleJob(Scheduler scheduler, PipelineConfig pipelineConfig) {
        TimerConfig timer = pipelineConfig.getTimer();
        if (timer != null) {
            try {
                Trigger trigger = new CronTrigger(CaseInsensitiveString.str(pipelineConfig.name()), QUARTZ_GROUP, timer.getTimerSpec());

                JobDetail jobDetail = new JobDetail(CaseInsensitiveString.str(pipelineConfig.name()), QUARTZ_GROUP, SchedulePipelineQuartzJob.class);
                jobDetail.setJobDataMap(jobDataMapFor(pipelineConfig));

                scheduler.scheduleJob(jobDetail, trigger);
                LOG.info("Initialized timer for pipeline " + pipelineConfig.name() + " with " + timer.getTimerSpec());
            } catch (ParseException e) {
                showPipelineError(pipelineConfig, e,
                        "Bad timer specification for timer in Pipeline: " + pipelineConfig.name(),
                        "Cannot schedule pipeline using the timer");
            } catch (SchedulerException e) {
                showPipelineError(pipelineConfig, e,
                        "Could not register pipeline '" + pipelineConfig.name() + "' with timer",
                        "");
            }
        }
    }

    private void showGlobalError(String msg, SchedulerException e) {
        LOG.error(msg, e);
        serverHealthService.update(
                ServerHealthState.error(msg, "Cannot schedule pipelines using the timer",
                        HealthStateType.general(HealthStateScope.GLOBAL)));
    }

    private void showPipelineError(PipelineConfig pipelineConfig, Exception e, String msg, String description) {
        LOG.error(msg, e);
        serverHealthService.update(
                ServerHealthState.error(msg,
                        description,
                        HealthStateType.general(HealthStateScope.forPipeline(CaseInsensitiveString.str(pipelineConfig.name())))));
    }

    private JobDataMap jobDataMapFor(PipelineConfig pipelineConfig) {
        JobDataMap map = new JobDataMap();
        map.put(BUILD_CAUSE_PRODUCER_SERVICE, buildCauseProducerService);
        map.put(PIPELINE_CONFIG, pipelineConfig);
        return map;
    }

    public void onConfigChange(CruiseConfig newCruiseConfig) {
        unscheduleAllJobs();
        scheduleAllJobs(newCruiseConfig.getAllPipelineConfigs());
    }

    @Override
    public void onPipelineConfigChange(PipelineConfig pipelineConfig, String group) {
        unscheduleJob(CaseInsensitiveString.str(pipelineConfig.name()));
        scheduleJob(quartzScheduler, pipelineConfig);
    }

    private void unscheduleAllJobs() {
        try {
            String[] jobNames = quartzScheduler.getJobNames(QUARTZ_GROUP);
            for (String jobName : jobNames) {
                unscheduleJob(jobName);
            }
        } catch (SchedulerException e) {
            LOG.error("Could not unschedule quartz jobs", e);
        }
    }

    private void unscheduleJob(String jobName) {
        try {
            if (quartzScheduler.getJobDetail(jobName, QUARTZ_GROUP) != null) {
                quartzScheduler.unscheduleJob(jobName, QUARTZ_GROUP);
                quartzScheduler.deleteJob(jobName, QUARTZ_GROUP);
            }
        } catch (SchedulerException e) {
            LOG.error("Could not unschedule quartz jobs", e);
        }
    }

    public static class SchedulePipelineQuartzJob implements Job {
        public void execute(JobExecutionContext context) throws JobExecutionException {
            JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
            BuildCauseProducerService buildCauseProducerService = (BuildCauseProducerService) jobDataMap.get(BUILD_CAUSE_PRODUCER_SERVICE);
            PipelineConfig pipelineConfig = (PipelineConfig) jobDataMap.get(PIPELINE_CONFIG);
            buildCauseProducerService.timerSchedulePipeline(pipelineConfig, new ServerHealthStateOperationResult());
        }
    }
}


text:
package mount

import (
	"fmt"
	"strings"
)

var flags = map[string]struct {
	clear bool
	flag  int
}{
	"defaults":      {false, 0},
	"ro":            {false, RDONLY},
	"rw":            {true, RDONLY},
	"suid":          {true, NOSUID},
	"nosuid":        {false, NOSUID},
	"dev":           {true, NODEV},
	"nodev":         {false, NODEV},
	"exec":          {true, NOEXEC},
	"noexec":        {false, NOEXEC},
	"sync":          {false, SYNCHRONOUS},
	"async":         {true, SYNCHRONOUS},
	"dirsync":       {false, DIRSYNC},
	"remount":       {false, REMOUNT},
	"mand":          {false, MANDLOCK},
	"nomand":        {true, MANDLOCK},
	"atime":         {true, NOATIME},
	"noatime":       {false, NOATIME},
	"diratime":      {true, NODIRATIME},
	"nodiratime":    {false, NODIRATIME},
	"bind":          {false, BIND},
	"rbind":         {false, RBIND},
	"unbindable":    {false, UNBINDABLE},
	"runbindable":   {false, RUNBINDABLE},
	"private":       {false, PRIVATE},
	"rprivate":      {false, RPRIVATE},
	"shared":        {false, SHARED},
	"rshared":       {false, RSHARED},
	"slave":         {false, SLAVE},
	"rslave":        {false, RSLAVE},
	"relatime":      {false, RELATIME},
	"norelatime":    {true, RELATIME},
	"strictatime":   {false, STRICTATIME},
	"nostrictatime": {true, STRICTATIME},
}

var validFlags = map[string]bool{
	"":          true,
	"size":      true,
	"mode":      true,
	"uid":       true,
	"gid":       true,
	"nr_inodes": true,
	"nr_blocks": true,
	"mpol":      true,
}

var propagationFlags = map[string]bool{
	"bind":        true,
	"rbind":       true,
	"unbindable":  true,
	"runbindable": true,
	"private":     true,
	"rprivate":    true,
	"shared":      true,
	"rshared":     true,
	"slave":       true,
	"rslave":      true,
}

// MergeTmpfsOptions merge mount options to make sure there is no duplicate.
func MergeTmpfsOptions(options []string) ([]string, error) {
	// We use collisions maps to remove duplicates.
	// For flag, the key is the flag value (the key for propagation flag is -1)
	// For data=value, the key is the data
	flagCollisions := map[int]bool{}
	dataCollisions := map[string]bool{}

	var newOptions []string
	// We process in reverse order
	for i := len(options) - 1; i >= 0; i-- {
		option := options[i]
		if option == "defaults" {
			continue
		}
		if f, ok := flags[option]; ok && f.flag != 0 {
			// There is only one propagation mode
			key := f.flag
			if propagationFlags[option] {
				key = -1
			}
			// Check to see if there is collision for flag
			if !flagCollisions[key] {
				// We prepend the option and add to collision map
				newOptions = append([]string{option}, newOptions...)
				flagCollisions[key] = true
			}
			continue
		}
		opt := strings.SplitN(option, "=", 2)
		if len(opt) != 2 || !validFlags[opt[0]] {
			return nil, fmt.Errorf("invalid tmpfs option %q", opt)
		}
		if !dataCollisions[opt[0]] {
			// We prepend the option and add to collision map
			newOptions = append([]string{option}, newOptions...)
			dataCollisions[opt[0]] = true
		}
	}

	return newOptions, nil
}

// ParseOptions parses fstab type mount options into mount() flags
// and device specific data
func ParseOptions(options string) (int, string) {
	var (
		flag int
		data []string
	)

	for _, o := range strings.Split(options, ",") {
		// If the option does not exist in the flags table or the flag
		// is not supported on the platform,
		// then it is a data value for a specific fs type
		if f, exists := flags[o]; exists && f.flag != 0 {
			if f.clear {
				flag &= ^f.flag
			} else {
				flag |= f.flag
			}
		} else {
			data = append(data, o)
		}
	}
	return flag, strings.Join(data, ",")
}

// ParseTmpfsOptions parse fstab type mount options into flags and data
func ParseTmpfsOptions(options string) (int, string, error) {
	flags, data := ParseOptions(options)
	for _, o := range strings.Split(data, ",") {
		opt := strings.SplitN(o, "=", 2)
		if !validFlags[opt[0]] {
			return 0, "", fmt.Errorf("invalid tmpfs option %q", opt)
		}
	}
	return flags, data, nil
}


text:
import { Component, ViewChild } from '@angular/core';
import {
  MenuController,
  NavController
} from '@ionic/angular';
import { Storage } from '@ionic/Storage';

@Component({
  selector: 'page-guide',
  templateUrl: 'guide.html',
  styleUrls: ['./guide.scss']
})
export class GuidePage {
  showSkip = true;

  @ViewChild('slides') slides;

  constructor(
    private menu: MenuController,
    private storage: Storage,
    private navCtrl: NavController
  ) { }

  startApp() {
    this.storage.set('hasSeenGuide', 'true');
    this.navCtrl.navigateForward(['login']);
  }

  onSlideChangeStart(slider) {
    this.showSkip = !slider.isEnd();
  }

  ionViewWillEnter() {
    this.slides.update();
  }

  ionViewDidEnter() {
    // the root left menu should be disabled on the tutorial page
    this.menu.enable(false);
  }

  ionViewDidLeave() {
    // enable the root left menu when leaving the tutorial page
    this.menu.enable(true);
  }
}


text:
package org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact;

import org.gradle.api.attributes.AttributeContainer;
import org.gradle.api.internal.artifacts.DownloadArtifactBuildOperationType;
import org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvedArtifactSet.AsyncArtifactListener;
import org.gradle.api.internal.attributes.AttributeContainerInternal;
import org.gradle.api.internal.file.FileCollectionInternal;
import org.gradle.api.internal.tasks.TaskDependencyResolveContext;
import org.gradle.internal.DisplayName;
import org.gradle.internal.operations.BuildOperationContext;
import org.gradle.internal.operations.BuildOperationDescriptor;
import org.gradle.internal.operations.BuildOperationQueue;
import org.gradle.internal.operations.RunnableBuildOperation;

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

import static org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvedArtifactSet.EMPTY;

class ArtifactBackedResolvedVariant implements ResolvedVariant {
    private final DisplayName displayName;
    private final AttributeContainerInternal attributes;
    private final ResolvedArtifactSet artifacts;

    private ArtifactBackedResolvedVariant(DisplayName displayName, AttributeContainerInternal attributes, ResolvedArtifactSet artifacts) {
        this.displayName = displayName;
        this.attributes = attributes;
        this.artifacts = artifacts;
    }

    public static ResolvedVariant create(DisplayName displayName, AttributeContainerInternal attributes, Collection<? extends ResolvableArtifact> artifacts) {
        if (artifacts.isEmpty()) {
            return new ArtifactBackedResolvedVariant(displayName, attributes, EMPTY);
        }
        if (artifacts.size() == 1) {
            return new ArtifactBackedResolvedVariant(displayName, attributes, new SingleArtifactSet(displayName, attributes, artifacts.iterator().next()));
        }
        List<SingleArtifactSet> artifactSets = new ArrayList<>(artifacts.size());
        for (ResolvableArtifact artifact : artifacts) {
            artifactSets.add(new SingleArtifactSet(displayName, attributes, artifact));
        }
        return new ArtifactBackedResolvedVariant(displayName, attributes, CompositeResolvedArtifactSet.of(artifactSets));
    }

    @Override
    public String toString() {
        return displayName.getDisplayName();
    }

    @Override
    public DisplayName asDescribable() {
        return displayName;
    }

    @Override
    public ResolvedArtifactSet getArtifacts() {
        return artifacts;
    }

    @Override
    public AttributeContainerInternal getAttributes() {
        return attributes;
    }

    private static class SingleArtifactSet implements ResolvedArtifactSet, ResolvedArtifactSet.Completion {
        private final DisplayName variantName;
        private final AttributeContainer variantAttributes;
        private final ResolvableArtifact artifact;
        private volatile Throwable failure;

        SingleArtifactSet(DisplayName variantName, AttributeContainer variantAttributes, ResolvableArtifact artifact) {
            this.variantName = variantName;
            this.variantAttributes = variantAttributes;
            this.artifact = artifact;
        }

        @Override
        public ResolvedArtifactSet.Completion startVisit(BuildOperationQueue<RunnableBuildOperation> actions, AsyncArtifactListener listener) {
            if (listener.requireArtifactFiles()) {
                if (artifact.isResolveSynchronously()) {
                    // Resolve it now
                    new DownloadArtifactFile(artifact, this, listener).run(null);
                } else {
                    // Resolve it later
                    actions.add(new DownloadArtifactFile(artifact, this, listener));
                }
            }
            return this;
        }

        @Override
        public void visit(ArtifactVisitor visitor) {
            if (failure != null) {
                visitor.visitFailure(failure);
            } else {
                visitor.visitArtifact(variantName, variantAttributes, artifact);
                visitor.endVisitCollection(FileCollectionInternal.OTHER);
            }
        }

        @Override
        public void visitLocalArtifacts(LocalArtifactVisitor listener) {
            listener.visitArtifact(artifact);
        }

        @Override
        public void visitDependencies(TaskDependencyResolveContext context) {
            context.add(artifact);
        }

        @Override
        public String toString() {
            return artifact.getId().getDisplayName();
        }
    }

    private static class DownloadArtifactFile implements RunnableBuildOperation {
        private final ResolvableArtifact artifact;
        private final SingleArtifactSet owner;
        private final AsyncArtifactListener listener;

        DownloadArtifactFile(ResolvableArtifact artifact, SingleArtifactSet owner, AsyncArtifactListener visitor) {
            this.artifact = artifact;
            this.owner = owner;
            this.listener = visitor;
        }

        @Override
        public void run(BuildOperationContext context) {
            try {
                artifact.getFile();
                listener.artifactAvailable(artifact);

                // This method is sometimes called directly (i.e. not via an operation executor).
                // In these cases, the context is null.
                if (context != null) {
                    context.setResult(DownloadArtifactBuildOperationType.RESULT);
                }
            } catch (Exception t) {
                owner.failure = t;
            }
        }

        @Override
        public BuildOperationDescriptor.Builder description() {
            return BuildOperationDescriptor.displayName("Resolve " + artifact)
                .details(new DownloadArtifactBuildOperationType.DetailsImpl(artifact.getId().getDisplayName()));
        }
    }

}


text:
Spree Product Activator
=====================

Simple way to make active/inactive a product

You're going to be able to see a checkbox to make a product active/inactive as you need, this in product admin site

Now you can use it like here:

```ruby
Spree::Product.without_inactive
```

or

```ruby
Spree::Product.with_inactive
```

Installation
------------

Add spree_product_activator to your Gemfile:

```ruby
gem 'spree_product_activator'
```

Bundle your dependencies and run the installation generator:

```shell
bundle
bundle exec rails g spree_product_activator:install
```

Testing
-------

Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.

```shell
bundle
bundle exec rake test_app
bundle exec rspec spec
```

When testing your applications integration with this extension you may use it's factories.
Simply add this require statement to your spec_helper:

```ruby
require 'spree_product_activator/factories'
```

Copyright (c) 2014 jtapia, released under the New BSD License


text:
class AccessController < ApplicationController

  layout 'admin'

  def menu
    # display text & links
  end

  def login
    # login form
  end

  def attempt_login
  end

  def logout
  end

end


text:
package net.cloudkit.enterprises.infrastructure.configuration;

import org.apache.commons.dbcp2.BasicDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.PropertiesFactoryBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.core.io.Resource;

import javax.sql.DataSource;
import java.util.Properties;

/**
 * ApplicationConfiguration.java
 *
 * @author hongquanli <hongquanli@qq.com>
 * @version 1.0 2015/11/19 16:10
 */
@Configuration
@ComponentScan(basePackages={"net.cloudkit.ecosystem.enterprises", "net.cloudkit.ecosystem.enterprises.interfaces"})
@ImportResource("classpath*:application-context.xml")
public class ApplicationConfiguration {

    @Autowired
    private ApplicationContext applicationContext;

    @Value("${jdbc.driver}")
    private String driverClassName;

    @Value("${jdbc.url}")
    private String url;

    @Value("${jdbc.username}")
    private String username;

    @Value("${jdbc.password}")
    private String password;

    public ApplicationConfiguration() {
        System.out.println("AppConfig!");
    }

    @Bean(initMethod = "init", destroyMethod = "close")
    public DataSource dataSource(){
        BasicDataSource basicDataSource = new BasicDataSource();
        basicDataSource.setDriverClassName(driverClassName);
        basicDataSource.setUrl(url);
        basicDataSource.setUsername(username);
        basicDataSource.setPassword(password);
        basicDataSource.setDefaultAutoCommit(false);
        return basicDataSource;
    }

    public PropertiesFactoryBean propertiesFactoryBean() {
        PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
        Properties properties = new Properties();
        properties.put("text", 123456);
        propertiesFactoryBean.setProperties(properties);

        propertiesFactoryBean.setLocations();
        propertiesFactoryBean.setFileEncoding("UTF-8");
        return propertiesFactoryBean;
    }

    /**
     * Actor system singleton for this application.
     */
    /*
    @Bean(name = "ActorSystem")
    public ActorSystem actorSystem() {
        System.out.println("system");
        try {
            ActorSystem system = ActorSystem.create("AkkaJavaSpring");
            System.out.println("system");

            // initialize the application context in the Akka Spring Extension
            SpringExtProvider.get(system).initialize(applicationContext);
            return system;
        } catch (Exception e) {
            System.err.println("ActorSystem initialized exception: " + e);
        }

        System.err.println("no exception!");
        return null;
    }
    */
}


text:
#pragma once

#include "editorfactory_p.h"
#include "chareditwidget.h"

class CharEditorFactory;
class CharEditorFactoryPrivate : public EditorFactoryPrivate<CharEditWidget>
{
    CharEditorFactory* charEditorFactoryPtr_;
    friend class CharEditorFactory;
public:

    void slotPropertyChanged(Property* property, const QChar& value);
    void slotSetValue(const QChar& value);

};


text:
var mongoose = require('mongoose');

var Post = new mongoose.Schema({
  date: {
    type: Number,
    required: true
  },
  text: {
    type: String,
    required: true
  },
  generated: {
    type: Boolean,
    required: true
  }
});

mongoose.model('Post', Post);
module.exports = Post;


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.motechproject.mobile</groupId>
    <artifactId>motech-mobile-omp</artifactId>
    <packaging>jar</packaging>
    <version>1.4-SNAPSHOT</version>
    <name>MoTeCH Mobile OMP</name>
    <url>https://motech.rcg.usm.maine.edu/redmine</url>
    <parent>
        <groupId>org.motechproject</groupId>
        <artifactId>motech-mobile</artifactId>
        <version>1.4-SNAPSHOT</version>
    </parent>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>1.10</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <wsdlFiles>
                                <wsdlFile>www.outreachcity.com/orserve/messaging/smsmessenger.asmx.wsdl</wsdlFile>
                            </wsdlFiles>
                            <staleFile>${project.build.directory}/jaxws/stale/smsmessenger.asmx.stale</staleFile>
                        </configuration>
                        <id>wsimport-generate-smsmessenger.asmx</id>
                        <phase>generate-sources</phase>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>javax.xml</groupId>
                        <artifactId>webservices-api</artifactId>
                        <version>1.4</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
                    <xnocompile>true</xnocompile>
                    <verbose>true</verbose>
                    <extension>true</extension>
                    <catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
                </configuration>
            </plugin>
			<plugin>
				<groupId>org.jvnet.jaxb2.maven2</groupId>
				<artifactId>maven-jaxb2-plugin</artifactId>
				<version>0.7.3</version>
				<executions>
					<execution>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
		                    <generatePackage>org.motechproject.mobile.omp.manager.intellivr</generatePackage>
         		            <generateDirectory>${project.build.directory}/generated-sources/jaxb</generateDirectory>
                		    <schemaDirectory>${basedir}/src/main/resources</schemaDirectory>
                		    <schemaIncludes>
                		    	<schemaInclude>intellivr.xsd</schemaInclude>
                		    </schemaIncludes>
							<args>
								<arg>-XtoString</arg>
								<arg>-Xequals</arg>
								<arg>-XhashCode</arg>
								<arg>-Xcopyable</arg>
							</args>
							<plugins>
								<plugin>
									<groupId>org.jvnet.jaxb2_commons</groupId>
									<artifactId>basic</artifactId>
									<version>0.4.1.4</version>
									<exclusions>
										<exclusion>
											<groupId>com.sun.xml.bind</groupId>
											<artifactId>jaxb-impl</artifactId>
										</exclusion>
										<exclusion>
											<groupId>com.sun.xml.bind</groupId>
											<artifactId>jaxb-xjc</artifactId>
										</exclusion>
									</exclusions>
								</plugin>
							</plugins>
						</configuration>
					</execution>
				</executions>
			</plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.mojo
                                        </groupId>
                                        <artifactId>
                                            jaxws-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.10,)
                                        </versionRange>
                                        <goals>
                                            <goal>wsimport</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.motechproject.mobile</groupId>
            <artifactId>motech-mobile-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>webservices-rt</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
        </dependency>
        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz</artifactId>
            <version>2.1.2</version>
        </dependency>
       	<dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.1.12</version>
        </dependency>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>runtime</artifactId>
            <version>0.4.1.4</version>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
</project>


text: Small Minecraft Mod


text:
var Logger;

Logger = {
  log: function() {
    if (console) {
      return console.log.apply(console, arguments);
    }
  }
};


text:
<?php
use common\models\User;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\DetailView;
use common\components\RoslPhpBbClass;

/* @var $this yii\web\View */
/* @var $model common\models\User */
/* @var $user common\models\User */

$this->title = "Добавить свой тур";
$user = Yii::$app->user->identity;
$this->params['sidebarType'] = -1;
$this->params['fullLayout'] = true;
?>

                    <?=$this->title?>

                    Вы можете предложить свой тур!
                    Вы провели незабываемое время в путешествии, заказав его в туристическом агентстве, и хотите заказать его еще раз, только через наш портал ТурфирмНЕТ, то Вы можете заполнить заявку, и мы рассмотрим Ваше предложение внести данный тур в базу путешествий. Ваша заявка будет оправленна на рассмотрение.

                    <form class="profile__form" method="post" action="" id="add_tour_form">

Форма заявки

Ваша фамилия:

                                        <input type="text" name="surname" placeholder="Ваша фамилия">

Ваше имя:

                                        <input type="text" name="firstname" placeholder="Ваше имя">

Ваш e-mail:

                                        <input type="text" name="email" placeholder="Ваш e-mail">

Ваш телефон:

                                        <input type="text" name="phone" placeholder="Ваш телефон">

Название тура:

                                        <input type="text" name="nametour" placeholder="Название тура">

Описание:

                                        <textarea name="texttour" placeholder="Описание тура"></textarea>

                            <input type="submit" class="common-button common-button--solid addbtn" value="Отправить заявку на тур">

                    </form>


text:
using Cofoundry.Core;
using Cofoundry.Domain;
using Hangfire;
using Hangfire.Dashboard;
using Microsoft.AspNetCore.Builder;

namespace Cofoundry.Plugins.BackgroundTasks.Hangfire;

/// <summary>
/// Used to initialize the hangfire server. Override this to fully
/// customize the server initialization process.
/// </summary>
public class HangfireServerInitializer : IHangfireServerInitializer
{
    private readonly HangfireSettings _hangfireSettings;
    private readonly AdminSettings _adminSettings;

    public HangfireServerInitializer(
        HangfireSettings hangfireSettings,
        AdminSettings adminSettings
        )
    {
        _hangfireSettings = hangfireSettings;
        _adminSettings = adminSettings;
    }

    public void Initialize(IApplicationBuilder app)
    {
        // Allow hangfire to be disabled, e.g. when connecting from dev to a production db.
        if (_hangfireSettings.Disabled) return;

        app.UseHangfireServer();

        if (_hangfireSettings.EnableHangfireDashboard && !_adminSettings.Disabled)
        {
            var adminPath = RelativePathHelper.Combine(_adminSettings.DirectoryName, "hangfire");
            app.UseHangfireDashboard(adminPath, new DashboardOptions
            {
                Authorization = new IDashboardAuthorizationFilter[] { new HangfireDashboardAuthorizationFilter() },
                AppPath = "/" + _adminSettings.DirectoryName
            });
        }
    }
}


text:
<?php
/**
 * Plugin Name: Open Graph Manager
 * Description: Add open graph meta tags to your site
 * Version: 0.0.1
 * Author: Danilo Puchelt
 * Author URI: http://www.github.com/tecmec
 */

/*************************************
 * Load Plates Tpl Engine Classes
 */
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Engine.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Template/Data.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Template/Directory.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Template/FileExtension.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Template/Folder.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Template/Folders.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Template/Func.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Template/Functions.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Template/Name.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Template/Template.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Extension/ExtensionInterface.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Extension/Asset.php');
require_once(GSPLUGINPATH . OGM_SUB_FOLDER . '/plates/Extension/URI.php');

/*************************************
 * Init Plates Tpl Engine
 */
$platesTpl = new League\Plates\Engine(GSPLUGINPATH . OGM_SUB_FOLDER . '/templates');

/*************************************
 * Register Tpl Helper Function
 */
$platesTpl->registerFunction('isTab', function ($string) {
    if (@$_POST['tab'] == $string) {
        return true;
    }
    return false;
});

/*************************************
 * Get & save data
 */
$params = $_REQUEST;

$allowedXmlVars = array(
    "general_author",
    "general_publisher",
    "general_image_path",
    "twitter_site",
    "twitter_creator",
    "facebook_page_id",
    "facebook_admins"
);

foreach ($params as $key => $value) {
    if (!in_array($key, $allowedXmlVars)) {
        unset($params[$key]);
    }
}

if (file_exists(GSDATAOTHERPATH . OGM_SETTINGS_FILE)) {
    $data = getXML(GSDATAOTHERPATH . OGM_SETTINGS_FILE);
    if ($data) {
        foreach ($data->children() as $child) {
            if (!array_key_exists($child->getName(), $params)) {
                $params[$child->getName()] = (string)$child;
            }
        }
    }
}

if (isset($_POST['save'])) {
    $data = @new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><settings></settings>');
    foreach ($params as $key => $value) {
        $node = $data->addChild($key);
        $node->addCData((string)$value);
    }
    XMLsave($data, GSDATAOTHERPATH . OGM_SETTINGS_FILE);
}

/*************************************
 * Header Text Tpl
 */
$templateVars = array(
    'OGM_OPTIONS' => i18n('open-graph-manager/OGM_OPTIONS', false),
    'OGM_TEXT_INTRODUCTION' => i18n('open-graph-manager/OGM_TEXT_INTRODUCTION', false),
    'OGM_SAVE_SUCCESS' => i18n('open-graph-manager/OGM_SAVE_SUCCESS', false),
    'formUrl' => $_SERVER['REQUEST_URI'],
);
$headerTemplate = $platesTpl->make('header');
$headerTemplate->data($templateVars);
echo $headerTemplate->render();

/*************************************
 * General Config Form Tpl
 */
if (!isset($_POST['tab']) || $_POST['tab'] == 'general') {
    $templateVars = array(
        'OGM_BUTTON_SAVE' => i18n('open-graph-manager/OGM_BUTTON_SAVE', false),
        'OGM_GENERAL_AUTHOR' => i18n('open-graph-manager/OGM_GENERAL_AUTHOR', false),
        'OGM_GENERAL_PUBLISHER' => i18n('open-graph-manager/OGM_GENERAL_PUBLISHER', false),
        'OGM_GENERAL_IMAGE_PATH' => i18n('open-graph-manager/OGM_GENERAL_IMAGE_PATH', false),
        'OGM_HEADLINE_GENERAL_CONFIGURATION' => i18n('open-graph-manager/OGM_HEADLINE_GENERAL_CONFIGURATION', false),
        'formUrl' => $_SERVER['REQUEST_URI'],
        'general_author' => $params['general_author'],
        'general_publisher' => $params['general_publisher'],
        'general_image_path' => $params['general_image_path'],
    );
    $generalTemplate = $platesTpl->make('general_config');
    $generalTemplate->data($templateVars);
    echo $generalTemplate->render();
}

/*************************************
 * Facebook Config Form Tpl
 */
if (isset($_POST['tab']) && $_POST['tab'] == 'facebook') {
    $templateVars = array(
        'OGM_BUTTON_SAVE' => i18n('open-graph-manager/OGM_BUTTON_SAVE', false),
        'OGM_HEADLINE_FACEBOOK_CONFIGURATION' => i18n('open-graph-manager/OGM_HEADLINE_FACEBOOK_CONFIGURATION', false),
        'OGM_LABEL_FACEBOOK_PAGE_ID' => i18n('open-graph-manager/OGM_LABEL_FACEBOOK_PAGE_ID', false),
        'OGM_LABEL_FACEBOOK_ADMINS' => i18n('open-graph-manager/OGM_LABEL_FACEBOOK_ADMINS', false),
        'formUrl' => $_SERVER['REQUEST_URI'],
        'facebook_page_id' => $params['facebook_page_id'],
        'facebook_admins' => $params['facebook_admins'],
    );
    $facebookTemplate = $platesTpl->make('facebook_config');
    $facebookTemplate->data($templateVars);
    echo $facebookTemplate->render();
}

/*************************************
 * Twitter Config Form Tpl
 */
if (isset($_POST['tab']) && $_POST['tab'] == 'twitter') {
    $templateVars = array(
        'OGM_BUTTON_SAVE' => i18n('open-graph-manager/OGM_BUTTON_SAVE', false),
        'OGM_HEADLINE_TWITTER_CONFIGURATION' => i18n('open-graph-manager/OGM_HEADLINE_TWITTER_CONFIGURATION', false),
        'OGM_LABEL_TWITTER_SITE' => i18n('open-graph-manager/OGM_LABEL_TWITTER_SITE', false),
        'OGM_LABEL_TWITTER_CREATOR' => i18n('open-graph-manager/OGM_LABEL_TWITTER_CREATOR', false),
        'OGM_HEADLINE_TWITTER_CONFIGURATION' => i18n('open-graph-manager/OGM_HEADLINE_TWITTER_CONFIGURATION', false),
        'formUrl' => $_SERVER['REQUEST_URI'],
        'twitter_site' => $params['twitter_site'],
        'twitter_creator' => $params['twitter_creator'],
    );
    $twitterTemplate = $platesTpl->make('twitter_config');
    $twitterTemplate->data($templateVars);
    echo $twitterTemplate->render();
}