text:
package com.louji.bookshelf;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.Header;
import org.json.JSONArray;
import org.json.JSONObject;

import com.gc.materialdesign.views.ButtonFlat;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.louji.adapter.BookMarkAdapter;
import com.louji.adapter.BookMarkAdapter.OnDownLoadListener;
import com.louji.adapter.BookMarkAdapter.OnLineReaderListener;
import com.louji.base.R;
import com.louji.bean.BookBean;
import com.louji.bookread.ReadActivity;
import com.louji.contacts.Contacts;
import com.louji.db.DatabaseFactory;
import com.louji.http.BinaryHttpResponseHandler;
import com.louji.http.JsonHttpResponseHandler;
import com.louji.httputil.Binary;
import com.louji.httputil.HttpUtil;
import com.louji.jsonbean.BookJsonBean;
import com.louji.readtwo.Read;
import com.louji.util.FileUtil;
import com.louji.util.Logger;
import com.yalantis.taurus.PullToRefreshView;
import com.yalantis.taurus.PullToRefreshView.OnRefreshListener;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ListView;

/**
 * ÍƼöÒ³
 *
 * @author Ê¢ÔÂï
 *
 */
@SuppressLint("InflateParams")
public class RecommendFragment extends Fragment
{

	public static final int REFRESH_DELAY = 4000;// ˢмä¸ô

	private PullToRefreshView pullToRefreshView;// ÁбíÍâ²ã
	private ListView listView;// Áбí

	private List<BookBean> bookBeans;

	private com.louji.dbbean.BookBean bookBean;

	private BookMarkAdapter bookMarkAdapter;

	@Override
	public View onCreateView(LayoutInflater inflater,
			@Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
	{
		View view = inflater.inflate(R.layout.fragment_recommend, null);

		initData();

		initView(view);

		return view;
	}

	/**
	 * ³õ'»¯Êý¾Ý
	 */
	private void initData()
	{
		bookBeans = new ArrayList<BookBean>(); // ³õ'»¯bookBeans;
		bookBean = new com.louji.dbbean.BookBean();

		HttpUtil.get(Contacts.RECOMMEND_URL, new JsonHttpResponseHandler()
		{

			@Override
			public void onSuccess(int statusCode, Header[] headers,
					JSONArray response)
			{
				// TODO Auto-generated method stub
				parserNetData(response);

				super.onSuccess(statusCode, headers, response);
			}

			@Override
			public void onSuccess(int statusCode, Header[] headers,
					JSONObject response)
			{
				// TODO Auto-generated method stub
				super.onSuccess(statusCode, headers, response);

			}

			@Override
			public void onFailure(int statusCode, Header[] headers,
					Throwable throwable, JSONArray errorResponse)
			{

				super.onFailure(statusCode, headers, throwable, errorResponse);
			}

		});

	}

	/**
	 * ³õ'»¯¿Ø¼þ
	 *
	 * @param view
	 */
	public void initView(View view)
	{
		pullToRefreshView = (PullToRefreshView) view
				.findViewById(R.id.recommendfragment_refresh);
		pullToRefreshView.setOnRefreshListener(new RefreshListener());

		listView = (ListView) view
				.findViewById(R.id.recommendfragment_list_view);
		bookMarkAdapter = new BookMarkAdapter(getActivity(), bookBeans);
		listView.setAdapter(bookMarkAdapter);
		bookMarkAdapter.setOnLineReaderListener(new OnLineReader());
		bookMarkAdapter.setOnDownLoadListener(new OnDownLoad());

	}

	/**
	 * ¶¨ÒåÏÂÔØ'þ
	 *
	 * @author Ê¢ÔÂï
	 * @since 2015Äê6ÔÂ9ºÅ
	 *
	 */
	private class OnDownLoad implements OnDownLoadListener
	{

		@Override
		public void download(BookBean bookBean1, View v)
		{
			Logger.v(bookBean1.getBookUrl());

			bookBean.setBookcontent(bookBean1.getBookInfo());
			bookBean.setBookimage(bookBean1.getImageUrl());
			bookBean.setBooktitle(bookBean1.getBookTitle());
			bookBean.setBookurl(bookBean1.getBookUrl());
			bookBean.setIsrecommend(bookBean1.getIsrecommend());

			String[] contentType = new String[]
			{ "text/plain" };

			Binary binary = new Binary(getActivity());
			binary.setResponseHandlerInterface(BinaryHttp(v, contentType));

			binary.onRun(bookBean1.getBookUrl(), "", "");
		}

		/**
		 * ×Ö½ÚÁ÷дÈë
		 *
		 * @param v
		 * @param contentType
		 * @param slider
		 * @return
		 */
		private BinaryHttpResponseHandler BinaryHttp(final View v,
				String[] contentType)
		{
			return new BinaryHttpResponseHandler(contentType)
			{
				String filePath;

				@Override
				public void onProgress(int bytesWritten, int totalSize)
				{
					super.onProgress(bytesWritten, totalSize);

				}

				@Override
				public void onSuccess(int statusCode, Header[] headers,
						byte[] binaryData)
				{

					try
					{

						filePath = FileUtil.writeFiletoSdcard(getActivity(),
								binaryData);

						bookBean.setBooklocalpath(filePath);

						DatabaseFactory.bookData(getActivity()).save(bookBean, "think_louji_book");//±£´æÊý¾Ý

						v.setOnClickListener(new OnChangeListener());
						((ButtonFlat) v).setText("ÔĶÁ");

						} catch (IOException e)
					{
						Logger.i("û·¨Ð´Èë");
						e.printStackTrace();
					}
				}

				@Override
				public void onFailure(int statusCode, Header[] headers,
						byte[] binaryData, Throwable error)
				{
					if (binaryData != null)
					{
						String data = new String(binaryData);
						Logger.v(data);
					} else
					{
						Logger.v("error");
					}
				}

				/**
				 * ÔĶÁ°´Å¥Ê¼þ
				 *
				 * @author Administrator
				 *
				 */
				class OnChangeListener implements OnClickListener
				{
					@Override
					public void onClick(View v)
					{
						Bundle bundle = new Bundle();
						bundle.putString("filePath", filePath);

						Intent intent = new Intent();
						intent.setClass(getActivity(), Read.class);
						intent.putExtras(bundle);
						getActivity().startActivity(intent);

					}
				}
			};
		}
	}

	/**
	 * ½âÎöÍøÂçÊý¾Ý
	 * @param response
	 */
	private void parserNetData(JSONArray response)
	{
		Gson gson = new Gson();
		List<BookJsonBean> bookJsonBeans = gson.fromJson(
				response.toString(),
				new TypeToken<List<BookJsonBean>>()
				{
				}.getType());

		for (int i = 0; i < bookJsonBeans.size(); i++)
		{
			BookBean bookBean = new BookBean();
			bookBean.setBookUrl(bookJsonBeans.get(i).getBookurl());
			bookBean.setBookTitle(bookJsonBeans.get(i).getBooktitle());
			bookBean.setBookInfo(bookJsonBeans.get(i).getBookcontent());
			bookBean.setImageUrl(bookJsonBeans.get(i).getBookimage());
			bookBean.setIsrecommend(bookJsonBeans.get(i)
					.getIsrecommend());
			com.louji.dbbean.BookBean bean = DatabaseFactory.bookData(getActivity()).selectline(bookBean.getBookTitle()) ;//
			if (bean != null)
			{
				bookBean.setBookFilePath(bean.getBooklocalpath());
			}
			bookBeans.add(bookBean) ;
		}
	}

	/**
	 * ÔÚÏßÔĶÁ'þ
	 *
	 * @author Ê¢ÔÂï
	 *
	 */
	private class OnLineReader implements OnLineReaderListener
	{
		@Override
		public void onReader(BookBean bookBean)
		{
			// Ìøתµ½ÔĶÁ½çÃæ
			Bundle bundle = new Bundle();

			Intent intent = new Intent();
			intent.setClass(getActivity(), ReadActivity.class);
			bundle.putString("filePath", bookBean.getBookUrl());
			intent.putExtras(bundle);
			getActivity().startActivity(intent);

		}
	}

	/**
	 * Ë¢ÐÂ'þ
	 *
	 * @author Ê¢ÔÂï
	 *
	 */
	private class RefreshListener implements OnRefreshListener
	{
		@Override
		public void onRefresh()
		{
			// ²âÊÔË¢ÐÂ
			pullToRefreshView.postDelayed(new Runnable()
			{

				@Override
				public void run()
				{
					pullToRefreshView.setRefreshing(false);

				}
			}, REFRESH_DELAY);

		}
	}

}


text:
/*
 * ODE_RHS_Gas_Phase.cpp
 *
 *  Created on: 26.10.2017
 *      Author: DetlevCM
 */

#include "../headers/Headers.hpp"

void ODE_RHS_Gas_Phase(int*n, double*t, double*y, double*f)
{
	// A namespace allows global variables without causing a mess, should be quicker than redefining too
	using namespace ODE_RHS;
	using namespace Jacobian_ODE_RHS;

	size_t i;

	/* 2002 CODATA values */
	//double R = 8.314472e0;
	//double Na = 6.0221415e23;

cout << n << "\n";
	// stability hack
	if(InitialDataConstants.EnforceStability)
	{
		for (i = 0; i <= Number_Species; i++)
		{
			if(y[i]<0){
				//if(y[i]<1.e-24){
				Concentration[i] = 0;
			}
			else
			{
				Concentration[i] = y[i];
			}
		}
	}
	else{
		for (i = 0; i <= Number_Species; i++)
		{
			Concentration[i] = y[i];
		}
	}

	// retain previous thermo if temperature change is effectively zero
	if(f[Number_Species] > 1e-6)
	{
		// Thermodynamic data, Rate Constant, Rates, new Concentrations
		Evaluate_Thermodynamic_Parameters(CalculatedThermo, Thermodynamics, Concentration[Number_Species]);
		Calculate_Rate_Constant(Kf, Kr, Concentration[Number_Species],ReactionParameters, CalculatedThermo, SpeciesLossAll, Delta_N);
	}
	CalculateReactionRates(Rates, Concentration, Kf, Kr, ReactantsForReactions, ProductsForReactions);
	SpeciesConcentrationChange = SpeciesLossRate(Number_Species, Rates, SpeciesLossAll);

	double ctot=0;
	double qint=0;
	double qtot=0;

	for (i = 0; i < Number_Species; i++)
	{
		ctot = ctot + CalculatedThermo[i].Cv * Concentration[i];
		//cout << CalculatedThermo[i].Hf << " ";

		// reduce number of loops
		f[i] = SpeciesConcentrationChange[i];
	}
	//cout << "\n";
	// ctot = ctot / 1000; // working in moles/l so no Na;

	for (i = 0; i < Number_Reactions; i++)
	{
		qint = qint + Delta_N[i] * Rates[i];
	}
	qtot = -qint / (ctot);//*1000); // scale l to ml and Na not needed for moles/l * Na); //*/

	// Checked f[i] -> no unexpected rates of change for "inert gases", all 0.
	/*
	for (i = 0; i < Number_Species; i++)
	{
		f[i] = SpeciesConcentrationChange[i]; // Species equations //
	}//*/
	f[Number_Species] = qtot; // Temperature equation //
	//cout << ctot << " " << qint << " " << qtot << "\n";

	// Settings relevant rates to zero
	if(InitialDataConstants.ConstantConcentration)
	{
		//cout << "preparing constant species \n";
		for(i=0;i<Number_Species;i++)
		{
			if(InitialDataConstants.ConstantSpecies[i] != 0){
				f[i] = 0 ; // concentration reset
				//cout << "f[" << i << "] = " << f[i];
			}
		}
	}

	// IEEE standard hack to check for NaN
	// if temperature blows up, freeze it
	//*
	if(qtot != qtot)
	{
		f[Number_Species] = 0;
	}
	//*/

}

redpajama_set_name: RedPajamaGithub


text:
//---------------------------------------------------------------------------
#ifndef uVdp3006H
#define uVdp3006H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "uRelatBase01.h"
#include <ExtCtrls.hpp>
#include "ZAbstractRODataset.hpp"
#include "ZDataset.hpp"
#include <DB.hpp>
#include "frxClass.hpp"
#include "frxDBSet.hpp"
//---------------------------------------------------------------------------
class TVdp3006 : public TfrmRelatBase01
{
__published:	// IDE-managed Components
	TZReadOnlyQuery *QyCctPedidoVenda;
	TZReadOnlyQuery *QyCentroCusto;
	TDataSource *DsCctPedidoVenda;
   TfrxDBDataset *frxQyCentroCusto;
   TfrxDBDataset *frxQyCctPedidoVenda;
private:	// User declarations
public:		// User declarations
	__fastcall TVdp3006(TComponent* Owner);
};
//---------------------------------------------------------------------------
#endif


text:
/**
 * Classes for constructing {@link fm.last.commons.kyoto.KyotoDb} instances.
 */
package fm.last.commons.kyoto.factory;

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


text:
//
//  CollectionViewController.m
//  Soulscour
//
//  Created by lanou on 16/10/28.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "CollectionViewController.h"
#import "PoeTool.h"
#import "PoeModel.h"
#import "PoeViewController.h"

@interface CollectionViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic, strong) NSMutableArray *dataArray;

@property (nonatomic, strong) UITableView *tableView;

@end

@implementation CollectionViewController

-(void)getAllpoe {
    self.dataArray = [[PoeTool searchAllpoe] mutableCopy];
}

-(void)initTableView {
    self.title = @"收藏";
    self.view.backgroundColor = [UIColor whiteColor];
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height-113)];
    [self.view addSubview:self.tableView];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.dataArray = [[NSMutableArray alloc] init];
    [self getAllpoe];
    [self initTableView];
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.dataArray.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];

    PoeModel *model = self.dataArray[indexPath.row];
    cell.textLabel.text = model.title;

    return cell;
}

//自带编辑按钮的响应方法
-(void)setEditing:(BOOL)editing animated:(BOOL)animated
{
    [super setEditing:editing animated:animated];

    [self.tableView setEditing:editing animated:animated];
}

//返回指定cell是否处于可编辑状态
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    return YES;
}

//返回cell的编辑样式
-(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
    //默认为删除
    return UITableViewCellEditingStyleDelete;
}

//处理编辑结果
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    [PoeTool deletePoe:self.dataArray[indexPath.row]];
    [self getAllpoe];
    [self.tableView reloadData];
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    PoeModel *model = self.dataArray[indexPath.row];
    self.sendBlock(model.poe_id);
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
This is a multiple object tracker with human label interface created by OpenCV and Python. Given a proper trained model (like a keras model in model directory in this repository), it can auto stop while the tracker lost the objects and auto retarget the objects.

## Version and Dependencies

* OS: Windows 7
* Python 3.5.2
* [Keras 2.0.4](https://github.com/fchollet/keras)
* [OpenCV 3.1.0](https://anaconda.org/menpo/opencv3)

## Usage description
Type `python main.py` at command prompt and choose the video to initialze tracker by drawing target objects.
Press 'h' in this tracker for more details.

## Model
OpenCV build-in tracker has been already performing very well. However, since video of this project is grayscale and our target object is very similar with the context, human involvement to label target object is inevitable. Here is our procedures for training auto stop model:

1. Generate images that contain desired object by the tracker without auto stop model
2. Randomly generate  a bunch of image without object.
3. Train the network by labeling image without object as 1 and image contains object as 0

After adding model in the tracker, if model detects there is no object in the any bounding boxes then the tracker will random a number of some candidates. If model predicts that there is beetle inside the candidate bounding box,  tracking process continue with the candidate bounding box. Otherwise, tracking will stop and let's user to decide the next move.

In our case, we use and transfer [ResNet50](https://github.com/fchollet/deep-learning-models) as our predictive model.

## TO-DO
The precision and recall of our autoupdate tracker is about 98% but the speed is around 1ps, I am trying to implement another state-of-art object detector [YOLO](https://github.com/philipperemy/yolo-9000) and modify it to suit our case for faster performance.


text:
namespace DLaB.Xrm.Entities
{

	[System.Runtime.Serialization.DataContractAttribute()]
	[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "9.0.0.9369")]
	public enum ChannelPropertyState
	{

		[System.Runtime.Serialization.EnumMemberAttribute()]
		Active = 0,

		[System.Runtime.Serialization.EnumMemberAttribute()]
		Inactive = 1,
	}

	/// <summary>
	/// Instance of a channel property containing its name and corresponding data type.
	/// </summary>
	[System.Runtime.Serialization.DataContractAttribute()]
	[Microsoft.Xrm.Sdk.Client.EntityLogicalNameAttribute("channelproperty")]
	[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "9.0.0.9369")]
	public partial class ChannelProperty : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
	{

		public static class Fields
		{
			public const string Applicationsource = "applicationsource";
			public const string ChannelPropertyId = "channelpropertyid";
			public const string Id = "channelpropertyid";
			public const string ChannelPropertyIdUnique = "channelpropertyidunique";
			public const string ComponentState = "componentstate";
			public const string CreatedBy = "createdby";
			public const string CreatedOn = "createdon";
			public const string CreatedOnBehalfBy = "createdonbehalfby";
			public const string DataType = "datatype";
			public const string Description = "description";
			public const string ImportSequenceNumber = "importsequencenumber";
			public const string IsManaged = "ismanaged";
			public const string ModifiedBy = "modifiedby";
			public const string ModifiedOn = "modifiedon";
			public const string ModifiedOnBehalfBy = "modifiedonbehalfby";
			public const string Name = "name";
			public const string OrganizationId = "organizationid";
			public const string OverriddenCreatedOn = "overriddencreatedon";
			public const string OverwriteTime = "overwritetime";
			public const string RegardingObjectId = "regardingobjectid";
			public const string SolutionId = "solutionid";
			public const string StateCode = "statecode";
			public const string StatusCode = "statuscode";
			public const string VersionNumber = "versionnumber";
			public const string channelproperty_organization = "channelproperty_organization";
			public const string ChannelPropertyGroup_ChannelProperty = "ChannelPropertyGroup_ChannelProperty";
			public const string lk_ChannelProperty_createdby = "lk_ChannelProperty_createdby";
			public const string lk_ChannelProperty_createdonbehalfby = "lk_ChannelProperty_createdonbehalfby";
			public const string lk_ChannelProperty_modifiedby = "lk_ChannelProperty_modifiedby";
			public const string lk_ChannelProperty_modifiedonbehalfby = "lk_ChannelProperty_modifiedonbehalfby";
		}

		/// <summary>
		/// Default Constructor.
		/// </summary>
		[System.Diagnostics.DebuggerNonUserCode()]
		public ChannelProperty() :
				base(EntityLogicalName)
		{
		}

		public const string EntityLogicalName = "channelproperty";

		public const string PrimaryIdAttribute = "channelpropertyid";

		public const string PrimaryNameAttribute = "name";

		public const int EntityTypeCode = 1236;

		public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

		public event System.ComponentModel.PropertyChangingEventHandler PropertyChanging;

		[System.Diagnostics.DebuggerNonUserCode()]
		private void OnPropertyChanged(string propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
			}
		}

		[System.Diagnostics.DebuggerNonUserCode()]
		private void OnPropertyChanging(string propertyName)
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, new System.ComponentModel.PropertyChangingEventArgs(propertyName));
			}
		}

		/// <summary>
		/// Type the name of the application that the property is associated with.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("applicationsource")]
		public string Applicationsource
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("applicationsource");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("Applicationsource");
				this.SetAttributeValue("applicationsource", value);
				this.OnPropertyChanged("Applicationsource");
			}
		}

		/// <summary>
		/// Unique identifier of the channel property
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("channelpropertyid")]
		public System.Nullable<System.Guid> ChannelPropertyId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.Guid>>("channelpropertyid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ChannelPropertyId");
				this.SetAttributeValue("channelpropertyid", value);
				if (value.HasValue)
				{
					base.Id = value.Value;
				}
				else
				{
					base.Id = System.Guid.Empty;
				}
				this.OnPropertyChanged("ChannelPropertyId");
			}
		}

		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("channelpropertyid")]
		public override System.Guid Id
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return base.Id;
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.ChannelPropertyId = value;
			}
		}

		/// <summary>
		/// For Internal Use Only
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("channelpropertyidunique")]
		public System.Nullable<System.Guid> ChannelPropertyIdUnique
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.Guid>>("channelpropertyidunique");
			}
		}

		/// <summary>
		/// For internal use only.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("componentstate")]
		public Microsoft.Xrm.Sdk.OptionSetValue ComponentState
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("componentstate");
			}
		}

		/// <summary>
		/// Shows who created the record.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdby")]
		public Microsoft.Xrm.Sdk.EntityReference CreatedBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("createdby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("CreatedBy");
				this.SetAttributeValue("createdby", value);
				this.OnPropertyChanged("CreatedBy");
			}
		}

		/// <summary>
		/// Shows the date and time when the record was created.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdon")]
		public System.Nullable<System.DateTime> CreatedOn
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.DateTime>>("createdon");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("CreatedOn");
				this.SetAttributeValue("createdon", value);
				this.OnPropertyChanged("CreatedOn");
			}
		}

		/// <summary>
		/// Shows who created the record on behalf of another user.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdonbehalfby")]
		public Microsoft.Xrm.Sdk.EntityReference CreatedOnBehalfBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("createdonbehalfby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("CreatedOnBehalfBy");
				this.SetAttributeValue("createdonbehalfby", value);
				this.OnPropertyChanged("CreatedOnBehalfBy");
			}
		}

		/// <summary>
		/// Enter the data type for the property.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("datatype")]
		public Microsoft.Xrm.Sdk.OptionSetValue DataType
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("datatype");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("DataType");
				this.SetAttributeValue("datatype", value);
				this.OnPropertyChanged("DataType");
			}
		}

		/// <summary>
		/// Description of property
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("description")]
		public string Description
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("description");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("Description");
				this.SetAttributeValue("description", value);
				this.OnPropertyChanged("Description");
			}
		}

		/// <summary>
		/// Unique identifier of the data import or data migration that created this property.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("importsequencenumber")]
		public System.Nullable<int> ImportSequenceNumber
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<int>>("importsequencenumber");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ImportSequenceNumber");
				this.SetAttributeValue("importsequencenumber", value);
				this.OnPropertyChanged("ImportSequenceNumber");
			}
		}

		/// <summary>
		/// For internal use only.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("ismanaged")]
		public System.Nullable<bool> IsManaged
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<bool>>("ismanaged");
			}
		}

		/// <summary>
		/// Shows who last updated the record.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedby")]
		public Microsoft.Xrm.Sdk.EntityReference ModifiedBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("modifiedby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ModifiedBy");
				this.SetAttributeValue("modifiedby", value);
				this.OnPropertyChanged("ModifiedBy");
			}
		}

		/// <summary>
		/// Shows the date and time when the record was last updated.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedon")]
		public System.Nullable<System.DateTime> ModifiedOn
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.DateTime>>("modifiedon");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ModifiedOn");
				this.SetAttributeValue("modifiedon", value);
				this.OnPropertyChanged("ModifiedOn");
			}
		}

		/// <summary>
		/// Shows who updated the record on behalf of another user.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedonbehalfby")]
		public Microsoft.Xrm.Sdk.EntityReference ModifiedOnBehalfBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("modifiedonbehalfby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ModifiedOnBehalfBy");
				this.SetAttributeValue("modifiedonbehalfby", value);
				this.OnPropertyChanged("ModifiedOnBehalfBy");
			}
		}

		/// <summary>
		/// Type the name of the property as received in the information provided by the external application.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("name")]
		public string Name
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("name");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("Name");
				this.SetAttributeValue("name", value);
				this.OnPropertyChanged("Name");
			}
		}

		/// <summary>
		/// Unique identifier of the organization associated with the channel property.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("organizationid")]
		public Microsoft.Xrm.Sdk.EntityReference OrganizationId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("organizationid");
			}
		}

		/// <summary>
		/// Date and time that the attribute was migrated.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("overriddencreatedon")]
		public System.Nullable<System.DateTime> OverriddenCreatedOn
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.DateTime>>("overriddencreatedon");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("OverriddenCreatedOn");
				this.SetAttributeValue("overriddencreatedon", value);
				this.OnPropertyChanged("OverriddenCreatedOn");
			}
		}

		/// <summary>
		/// For internal use only.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("overwritetime")]
		public System.Nullable<System.DateTime> OverwriteTime
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.DateTime>>("overwritetime");
			}
		}

		/// <summary>
		/// Properties contained with a particular bag.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("regardingobjectid")]
		public Microsoft.Xrm.Sdk.EntityReference RegardingObjectId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("regardingobjectid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("RegardingObjectId");
				this.SetAttributeValue("regardingobjectid", value);
				this.OnPropertyChanged("RegardingObjectId");
			}
		}

		/// <summary>
		/// Unique identifier of the associated solution.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("solutionid")]
		public System.Nullable<System.Guid> SolutionId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.Guid>>("solutionid");
			}
		}

		/// <summary>
		/// State of the channel property
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("statecode")]
		public System.Nullable<DLaB.Xrm.Entities.ChannelPropertyState> StateCode
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				Microsoft.Xrm.Sdk.OptionSetValue optionSet = this.GetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("statecode");
				if ((optionSet != null))
				{
					return ((DLaB.Xrm.Entities.ChannelPropertyState)(System.Enum.ToObject(typeof(DLaB.Xrm.Entities.ChannelPropertyState), optionSet.Value)));
				}
				else
				{
					return null;
				}
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("StateCode");
				if ((value == null))
				{
					this.SetAttributeValue("statecode", null);
				}
				else
				{
					this.SetAttributeValue("statecode", new Microsoft.Xrm.Sdk.OptionSetValue(((int)(value))));
				}
				this.OnPropertyChanged("StateCode");
			}
		}

		/// <summary>
		/// Status of the channel property
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("statuscode")]
		public Microsoft.Xrm.Sdk.OptionSetValue StatusCode
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("statuscode");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("StatusCode");
				this.SetAttributeValue("statuscode", value);
				this.OnPropertyChanged("StatusCode");
			}
		}

		/// <summary>
		/// Version number of the channel property.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("versionnumber")]
		public System.Nullable<long> VersionNumber
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<long>>("versionnumber");
			}
		}

		/// <summary>
		/// N:1 channelproperty_organization
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("organizationid")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("channelproperty_organization")]
		public DLaB.Xrm.Entities.Organization channelproperty_organization
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.Organization>("channelproperty_organization", null);
			}
		}

		/// <summary>
		/// N:1 ChannelPropertyGroup_ChannelProperty
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("regardingobjectid")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("ChannelPropertyGroup_ChannelProperty")]
		public DLaB.Xrm.Entities.ChannelPropertyGroup ChannelPropertyGroup_ChannelProperty
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.ChannelPropertyGroup>("ChannelPropertyGroup_ChannelProperty", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ChannelPropertyGroup_ChannelProperty");
				this.SetRelatedEntity<DLaB.Xrm.Entities.ChannelPropertyGroup>("ChannelPropertyGroup_ChannelProperty", null, value);
				this.OnPropertyChanged("ChannelPropertyGroup_ChannelProperty");
			}
		}

		/// <summary>
		/// N:1 lk_ChannelProperty_createdby
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("lk_ChannelProperty_createdby")]
		public DLaB.Xrm.Entities.SystemUser lk_ChannelProperty_createdby
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_ChannelProperty_createdby", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("lk_ChannelProperty_createdby");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_ChannelProperty_createdby", null, value);
				this.OnPropertyChanged("lk_ChannelProperty_createdby");
			}
		}

		/// <summary>
		/// N:1 lk_ChannelProperty_createdonbehalfby
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdonbehalfby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("lk_ChannelProperty_createdonbehalfby")]
		public DLaB.Xrm.Entities.SystemUser lk_ChannelProperty_createdonbehalfby
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_ChannelProperty_createdonbehalfby", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("lk_ChannelProperty_createdonbehalfby");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_ChannelProperty_createdonbehalfby", null, value);
				this.OnPropertyChanged("lk_ChannelProperty_createdonbehalfby");
			}
		}

		/// <summary>
		/// N:1 lk_ChannelProperty_modifiedby
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("lk_ChannelProperty_modifiedby")]
		public DLaB.Xrm.Entities.SystemUser lk_ChannelProperty_modifiedby
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_ChannelProperty_modifiedby", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("lk_ChannelProperty_modifiedby");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_ChannelProperty_modifiedby", null, value);
				this.OnPropertyChanged("lk_ChannelProperty_modifiedby");
			}
		}

		/// <summary>
		/// N:1 lk_ChannelProperty_modifiedonbehalfby
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedonbehalfby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("lk_ChannelProperty_modifiedonbehalfby")]
		public DLaB.Xrm.Entities.SystemUser lk_ChannelProperty_modifiedonbehalfby
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_ChannelProperty_modifiedonbehalfby", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("lk_ChannelProperty_modifiedonbehalfby");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_ChannelProperty_modifiedonbehalfby", null, value);
				this.OnPropertyChanged("lk_ChannelProperty_modifiedonbehalfby");
			}
		}

		/// <summary>
		/// Constructor for populating via LINQ queries given a LINQ anonymous type
		/// <param name="anonymousType">LINQ anonymous type.</param>
		/// </summary>
		[System.Diagnostics.DebuggerNonUserCode()]
		public ChannelProperty(object anonymousType) :
				this()
		{
            foreach (var p in anonymousType.GetType().GetProperties())
            {
                var value = p.GetValue(anonymousType, null);
                var name = p.Name.ToLower();

                if (name.EndsWith("enum") && value.GetType().BaseType == typeof(System.Enum))
                {
                    value = new Microsoft.Xrm.Sdk.OptionSetValue((int) value);
                    name = name.Remove(name.Length - "enum".Length);
                }

                switch (name)
                {
                    case "id":
                        base.Id = (System.Guid)value;
                        Attributes["channelpropertyid"] = base.Id;
                        break;
                    case "channelpropertyid":
                        var id = (System.Nullable<System.Guid>) value;
                        if(id == null){ continue; }
                        base.Id = id.Value;
                        Attributes[name] = base.Id;
                        break;
                    case "formattedvalues":
                        // Add Support for FormattedValues
                        FormattedValues.AddRange((Microsoft.Xrm.Sdk.FormattedValueCollection)value);
                        break;
                    default:
                        Attributes[name] = value;
                        break;
                }
            }
		}

		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("componentstate")]
		public virtual ComponentState? ComponentStateEnum
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return ((ComponentState?)(EntityOptionSetEnum.GetEnum(this, "componentstate")));
			}
		}

		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("datatype")]
		public virtual ChannelProperty_DataType? DataTypeEnum
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return ((ChannelProperty_DataType?)(EntityOptionSetEnum.GetEnum(this, "datatype")));
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				DataType = value.HasValue ? new Microsoft.Xrm.Sdk.OptionSetValue((int)value) : null;
			}
		}

		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("statuscode")]
		public virtual ChannelProperty_StatusCode? StatusCodeEnum
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return ((ChannelProperty_StatusCode?)(EntityOptionSetEnum.GetEnum(this, "statuscode")));
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				StatusCode = value.HasValue ? new Microsoft.Xrm.Sdk.OptionSetValue((int)value) : null;
			}
		}
	}
}


text:
package executil

import (
	"context"
	"os"
	"os/exec"
	"sync"
)

const (
	// OverrideEnvironmentVariable is the environment variable that will be set if a test has been
	// invoked via CommandContext below and it should behave as if it is faking a call to an
	// executable. The value it is set to should be considered arbitrary and not relied upon.
	OverrideEnvironmentVariable = "SKIA_INFRA_OVERRIDE_TEST"

	// This is the key used in context.Value to correspond to a *fakeTestTracker object.
	overrideKey = "skia_infra_override_cmd"
)

// WithFakeTests returns a context.Context loaded with a special Value containing the given test
// names. When this Context is passed into this package's CommandContext, faked *exec.Cmd objects
// will be returned using the given test names. The first call to CommandContext will be faked
// with the first value of fakeTestNames, the second call to CommandContext will use the
// second value of fakeTestNames and so on. This panics if the provided context was one that
// already has fake tests associated with it.
func WithFakeTests(parent context.Context, fakeTestNames ...string) context.Context {
	if _, ok := parent.Value(overrideKey).(*fakeTestTracker); ok {
		panic("parent context already has fake tests associated with it")
	}
	return context.WithValue(parent, overrideKey, &fakeTestTracker{
		index:         0,
		fakeTestNames: fakeTestNames,
	})
}

// FakeTestsContext is a convenient wrapper around WithFakeTests using context.Background().
func FakeTestsContext(fakeTestNames ...string) context.Context {
	return WithFakeTests(context.Background(), fakeTestNames...)
}

// fakeTestTracker keeps track of which test we should fake out next. We have this be a struct and
// store the pointer to this struct in the ctx.Value so we can mutate the value without having
// to return a new context or something more complex. Contexts are meant to be thread safe, so this
// object has a mutex to avoid problems when being used synchronously, although in practice using
// this package in a multi-threaded fashion would likely lead to flaky tests.
type fakeTestTracker struct {
	index         int
	fakeTestNames []string
	mutex         sync.Mutex
}

// CommandContext looks for a special value on the provided context.Context (see WithFakeTests).
// If that value exists, it will use the next fake test value and return a faked *exec.Cmd. It
// panics if there are not enough fake tests that were provided to the original context. If the
// special value does not exist, it is a passthrough to os/exec.CommandContext.
func CommandContext(ctx context.Context, cmd string, args ...string) *exec.Cmd {
	if override, ok := ctx.Value(overrideKey).(*fakeTestTracker); ok {
		override.mutex.Lock()
		defer override.mutex.Unlock()
		// We are going to shell out to the current test executable...
		testBinary := os.Args[0]
		// ...and tell it to run the next faked test.
		if override.index >= len(override.fakeTestNames) {
			panic("Not enough fake tests provided")
		}
		fakeTest := override.fakeTestNames[override.index]
		override.index++
		// fakeTest is where the client has put their fake implementation of the given command.
		argsWithOverride := []string{"-test.run=" + fakeTest, "--", cmd}
		argsWithOverride = append(argsWithOverride, args...)
		fakedCmd := exec.CommandContext(ctx, testBinary, argsWithOverride...)
		fakedCmd.Env = []string{OverrideEnvironmentVariable + "=1"}
		return fakedCmd
	}
	// Did not find special Context value, so fall back to default impl
	return exec.CommandContext(ctx, cmd, args...)
}

// FakeCommandsReturned returns the count of how many times CommandContext was called using the
// given context. This is a proxy for the number of fake commands run.
func FakeCommandsReturned(ctx context.Context) int {
	if override, ok := ctx.Value(overrideKey).(*fakeTestTracker); ok {
		override.mutex.Lock()
		defer override.mutex.Unlock()
		return override.index
	}
	panic("A Context was passed in that was not produced by the executil package.")
}

// OriginalArgs returns the original arguments passed into a test function. Concretely, it looks
// at the osArgs and strips off the first 3 (the test binary, the test to run, and "--")
func OriginalArgs() []string {
	return os.Args[3:]
}

// IsCallingFakeCommand returns whether the current process is a test process that's running a
// mocked-out CLI invocation. This should be called at the beginning of each Test_FakeExe_... test
// and trigger an early return if false.
func IsCallingFakeCommand() bool {
	return os.Getenv(OverrideEnvironmentVariable) != ""
}


text:
from __future__ import unicode_literals

from django.conf.urls import url, include

from cruds_adminlte.urls import crud_for_app

urlpatterns = [
    url(r'^select2/', include('django_select2.urls')),
]

urlpatterns += crud_for_app('testapp', login_required=True, check_perms=True)


text:
<!DOCTYPE HTML>

  <title>Cinco De Mayo Menu </title>
    <link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet">
     <link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css">

     <link rel="stylesheet" href="_styles/css/main.css">

Home

Chicken Taco on Whole wheat tortilla.

pavo sándwich en la pan de trigo enetro


text:
title: The Remi according to Cesar
menu: the remi
created: 21-10-2017, 17:31
date: 05-03-2018, 00:36
modified: 08-09-2018, 21:33
itempage: Article
taxonomy:
    category: [docs, en]
metadata:
   description: 'Presentation and excerpt of Book II of the Commentaries on the Gallic War written by Julius Caesar (campaign against the Belgians) where appears the tribe of Remi at the origin of the present city of Reims before the Battle of the Aisne'
   keywords: 'tribe of Remi, Reims, Julius Caesar, Book II of the Commentaries on the Gallic War, campaign against the Belgians'
   image: gallia-fr-en_700x490.jpg
   image_height: 700
   image_width: 490
   image_title: "Roman Belgium and Gallic tribes"
   image_legend: "Map of Roman Belgium and Gallic tribes"
   'twitter:card': summary
significantlinks: ["https://github.com/tidiview/francois-vidit.com/blob/master/user/sites/docs/pages/01.home/03.reims/01.remes/docs.en.md"]
specialty: ["History of France", "Roman period", "Champagne region", "Commentaries on the Gallic War Book II", "the Remi Tribe", "Julius Caesar", "campaign against the Belgians"]
shortcode-core:
   active: true
sitemap:
   changefreq: weekly
   priority: 0.4
---
!!!! The « Commentaries on the Gallic War », which is said to have been written by Julius Caesar himself, count as a written historical document concerning the past of France as one of the oldest.
!!!! There would be much to say about this exceptional work, but here it is not so much the whole work as the short part, first half of Book II, where the tribe of the Remi, at the origins of the name of the current Reims, appears, that keeps our attention.
!!!! The extract of the text below is limited to this and to the « Battle of the Aisne river ».
!!!! The [1st][1] and [2nd][2] chapter describe the resulting situation of the progression of the Roman army in Gaul.
!!!! During the [3rd chapter][3], the chiefs of the Remi think fowards and send to Caesar a delegation to ally with Rome.
!!!! From the [4th chapter][4], is the « [Battle of the Aisne river][5] » that sees the victory of the roman army.
!!!! The Remi were to be rewarded notabily by the recognition of Reims as capital city of roman province of Second Belgium.

## [color=#3d8b3d]Commentaries on the Gallic War, Book 2[/color]

#### [color=#3d8b3d]Turmoil in Belgium[/color] {#1chap}
[color=#3d8b3d]Chapter 1[/color]
1
While [color=#3d8b3d]Caesar[/color] was in winter quarters in Hither Gaul, frequent reports were brought to him, and he was also informed by letters from Labienus, that all the Belgae, who we have said are a third part of Gaul, were entering into a confederacy against the Roman people, and giving hostages to one another;
2
that the reasons of the confederacy were these-first, because they feared that, after all [Celtic] Gaul was subdued, our army would be led against them;
3
secondly, because they were instigated by several of the Gauls; some of whom as [on the one hand] they had been unwilling that the Germans should remain any longer in Gaul, so [on the other] they were dissatisfied that the army of the Roman people should pass the winter in it, and settle there;
4
and others of them, from a natural instability and fickleness of disposition, were anxious for a revolution; [the Belgae were instigated] by several, also, because the government in Gaul was generally seized upon by the more powerful persons and by those who had the means of hiring troops, and they could less easily effect this object under our dominion.

#### [color=#3d8b3d]Measures of Caesar[/color] {#2chap}
[color=#3d8b3d]Chapter 2[/color]
1
Alarmed by these tidings and letters, [color=#3d8b3d]Caesar[/color] levied two new legions in Hither Gaul, and, at the beginning of summer, sent Quintus Pedius, his legate, to conduct them further into Gaul.
2
He, himself, as soon as there began to be plenty of forage, came to the army.
3
He gives a commission to the Senones and the other Gauls who were neighbors of the Belgae, to learn what is going on among them [i.e. the Belgae], and inform him of these matters.
4
These all uniformly reported that troops were being raised, and that an army was being collected in one place.
5
Then, indeed, he thought that he ought not to hesitate about proceeding toward them, and having provided supplies, moves his camp, and in about fifteen days arrives at the territories of the Belgae.

#### [color=#3d8b3d]The Remi are declaring themselves for the Romans[/color] {#3chap}
[color=#3d8b3d]Chapter 3[/color]
1
As he arrived there unexpectedly and sooner than any one anticipated, [color=#3d8b3d]the Remi[/color], who are the nearest of the Belgae to [Celtic] Gaul, sent to him Iccius and Andecombogius, [two of] the principal persons of the state, as their embassadors:
2
to tell him that they surrendered themselves and all their possessions to the protection and disposal of the Roman people: and that they had neither combined with the rest of the Belgae, nor entered into any confederacy against the Roman people:
3
and were prepared to give hostages, to obey his commands, to receive him into their towns, and to aid him with corn and other things;
4
that all the rest of the Belgae were in arms; and that the Germans, who dwell on this side of the Rhine, had joined themselves to them; and that so great was the infatuation of them all, that they could not restrain even the Suessiones, their own brethren and kinsmen, who enjoy the same rights, and the, same laws, and who have one government and one magistracy [in common] with themselves, from uniting with them.

#### [color=#3d8b3d]Enumeration of enemy forces[/color] {#4chap}
[color=#3d8b3d]Chapter 4[/color]
1
When [color=#3d8b3d]Caesar[/color] inquired of them what states were in arms, how powerful they were, and what they could do, in war, he received the following information: that the greater part of the Belgae were sprung from the Germans, and that having crossed the Rhine at an early period, they had settled there, on account of the fertility of the country, and had driven out the Gauls who inhabited those regions;
2
and that they were the only people who, in the memory of our fathers, when all Gaul was overrun, had prevented the Teutones and the Cimbri from entering their territories;[1]
3
the effect of which was, that, from the recollection of those events, they assumed to themselves great authority and haughtiness in military matters.
4
The Remi said, that they had known accurately every thing respecting their number, because being united to them by neighborhood and by alliances, they had learned what number each state had in the general council of the Belgae promised for that war.
5
That the Bellovaci were the most powerful among them in valor, influence, and the number of men; that these could muster 100,000 armed men, [and had] promised 60,000 picked men out of that number, and demanded for themselves the command of the whole war.
6
That the Suessiones were their nearest neighbors and possessed a very extensive and fertile country;
7
that among them, even in our own memory, Diviciacus, the most powerful man of all Gaul, had been king; who had held the government of a great part of these regions, as well as of Britain; that their king at present was Galba; that the direction of the whole war was conferred by the consent of all, upon him, on account of his integrity and prudence; that they had twelve towns; that they had promised 50,000 armed men;
8
and that the Nervii, who are reckoned the most warlike among them, and are situated at a very great distance, [had promised] as many;
9
the Atrebates 15,000; the Ambiani, 10,000; the Morini, 25,000; the Menapii, 9,000; the Caleti, 10,000; the Veliocasses and the Viromandui as many; the Aduatuci 19,000;
10
that the Condrusi, the Eburones, the Caeraesi, the Paemani, who are called by the common name of Germans [had promised], they thought, to the number of 40,000.

#### [color=#3d8b3d]Diviciacus attacks the Bellovaci. Caesar crosses the Aisne[/color]

[color=#3d8b3d]Chapter 5[/color]
1
[color=#3d8b3d]Caesar[/color], having encouraged [color=#3d8b3d]the Remi[/color], and addressed them courteously, ordered the whole senate to assemble before him, and the children of their chief men to be brought to him as hostages; all which commands they punctually performed by the day [appointed].
2
He, addressing himself to Diviciacus, the Aeduan, with great earnestness, points out how much it concerns the republic and their common security, that the forces of the enemy should be divided, so that it might not be necessary to engage with so large a number at one time.
3
[He asserts] that this might be affected if the Aedui would lead their forces into the territories of the Bellovaci, and begin to lay waste their country. With these instructions he dismissed him from his presence.
4
After he perceived that all the forces of the Belgae, which had been collected in one place, were approaching toward him, and learned from the scouts whom he had sent out, and [also] from [color=#3d8b3d]the Remi[/color], that they were then not far distant, he hastened to lead his army over the Aisne, which is on the borders of [color=#3d8b3d]the Remi[/color], and there pitched his camp.
5
This position fortified one side of his camp by the banks of the river, rendered the country which lay in his rear secure from the enemy, and furthermore insured that provisions might without danger be brought to him by [color=#3d8b3d]the Remi[/color] and the rest of the states.
6
Over that river was a bridge: there he places a guard; and on the other side of the river he leaves Quintus Titurius Sabinus, his legate, with six cohorts. He orders him to fortify a camp with a rampart twelve feet in height, and a trench eighteen feet in breadth.

#### [color=#3d8b3d]He raised the siege of Bibrax[/color]
[color=#3d8b3d]Chapter 6[/color]
1
There was a town of [color=#3d8b3d]the Remi[/color], by name Bibrax, eight miles distant from this camp. This the Belgae on their march began to attack with great vigor. [The assault] was with difficulty sustained for that day.
2
The Gauls' mode of besieging is the same as that of the Belgae: when after having drawn a large number of men around the whole of the fortifications, stones have begun to be cast against the wall on all sides, and the wall has been stripped of its defenders, [then], forming a testudo, they advance to the gates and undermine the wall:
3
which was easily effected on this occasion; for while so large a number were casting stones and darts, no one was able to maintain his position upon the wall.
4
When night had put an end to the assault, Iccius Remus, who was then in command of the town, one of [color=#3d8b3d]the Remi[/color], a man of the highest rank and influence among his people, and one of those who had come to [color=#3d8b3d]Caesar[/color] as embassador [to sue] for peace, sends messengers to him, [to report] "That, unless assistance were sent to him he could not hold out any longer."

[color=#3d8b3d]Chapter 7[/color]
1
Thither, immediately after midnight, [color=#3d8b3d]Caesar[/color], using as guides the same persons who had come to him as messengers from Iccius, sends some Numidian and Cretan archers, and some Balearian slingers
2
as a relief to the towns-people, by whose arrival both a desire to resist together with the hope of [making good their] defense, was infused into [color=#3d8b3d]the Remi[/color], and, for the same reason, the hope of gaining the town, abandoned the enemy.
3
Therefore, after staying a short time before the town, and laying waste the country of [color=#3d8b3d]the Remi[/color], when all the villages and buildings which they could approach had been burned, they hastened with all their forces to the camp of [color=#3d8b3d]Caesar[/color], and encamped within less than two miles [of it];
4
and their camp, as was indicated by the smoke and fires, extended more than eight miles in breadth.

#### [color=#3d8b3d]Battle of the Aisne[/color] {#8chap}
[color=#3d8b3d]Chapter 8[/color]
1
[color=#3d8b3d]Caesar[/color] at first determined to decline a battle, as well on account of the great number of the enemy as their distinguished reputation for valor:
2
daily, however, in cavalry actions, he strove to ascertain by frequent trials, what the enemy could effect by their prowess and what our men would dare.
3
When he perceived that our men were not inferior, as the place before the camp was naturally convenient and suitable for marshaling an army (since the hill where the camp was pitched, rising gradually from the plain, extended forward in breadth as far as the space which the marshaled army could occupy, and had steep declines of its side in either direction, and gently sloping in front gradually sank to the plain);
4
on either side of that hill he drew a cross trench of about four hundred paces, and at the extremities of that trench built forts, and placed there his military engines, lest, after he had marshaled his army, the enemy, since they were so powerful in point of number, should be able to surround his men in the flank, while fighting.
5
After doing this, and leaving in the camp the two legions which he had last raised, that, if there should be any occasion, they might be brought as a reserve, he formed the other six legions in order of battle before the camp. The enemy, likewise, had drawn up their forces which they had brought out of the camp.

[color=#3d8b3d]Chapter 9[/color]
1
There was a marsh of no great extent between our army and that of the enemy. The latter were waiting to see if our men would pass this; our men, also, were ready in arms to attack them while disordered, if the first attempt to pass should be made by them.
2
In the mean time battle was commenced between the two armies by a cavalry action. When neither army began to pass the marsh, [color=#3d8b3d]Caesar[/color], upon the skirmishes of the horse [proving] favorable to our men, led back his forces into the camp.
3
The enemy immediately hastened from that place to the river Aisne, which it has been stated, was behind our camp.
4
Finding a ford there, they endeavored to lead a part of their forces over it; with the design, that, if they could, they might carry by storm the fort which Quintus Titurius, [color=#3d8b3d]Caesar[/color]'s legate, commanded, and might cut off the bridge;
5
but, if they could not do that, they should lay waste the lands of [color=#3d8b3d]the Remi[/color], which were of great use to us in carrying on the war, and might hinder our men from foraging.

[color=#3d8b3d]Chapter 10[/color]
1
[color=#3d8b3d]Caesar[/color], being apprized of this by Titurius, leads all his cavalry and light-armed Numidians, slingers and archers, over the bridge, and hastens toward them.
2
There was a severe struggle in that place. Our men, attacking in the river the disordered enemy, slew a great part of them.
3
By the immense number of their missiles they drove back the rest, who, in a most courageous manner were attempting to pass over their bodies, and surrounded with their cavalry, and cut to pieces those who had first crossed the river.
4
The enemy, when they perceived that their hopes had deceived them both with regard to their taking the town by storm and also their passing the river, and did not see our men advance to a more disadvantageous place for the purpose of fighting, and when provisions began to fail them, having called a council, determined that it was best for each to return to his country, and resolved to assemble from all quarters to defend those into whose territories the Romans should first march an army; that they might contend in their own rather than in a foreign country, and might enjoy the stores of provision which they possessed at home.
5
Together with other causes, this consideration also led them to that resolution, viz: that they had learned that Diviciacus and the Aedui were approaching the territories of the Bellovaci. And it was impossible to persuade the latter to stay any longer, or to deter them from conveying succor to their own people.

[color=#3d8b3d]Chapter 11[/color]
1
That matter being determined on, marching out of their camp at the second watch, with great noise and confusion, in no fixed order, nor under any command, since each sought for himself the foremost place in the journey, and hastened to reach home, they made their departure appear very like a flight.
2
[color=#3d8b3d]Caesar[/color], immediately learning this through his scouts, [but] fearing an ambuscade, because he had not yet discovered for what reason they were departing, kept his army and cavalry within the camp.
3
At daybreak, the intelligence having been confirmed by the scouts, he sent forward his cavalry to harass their rear; and gave the command of it to two of his legates, Quintus Pedius, and Lucius Aurunculeius Cotta. He ordered Titus Labienus, another of his legates, to follow them closely with three legions.
4
These, attacking their rear, and pursuing them for many miles, slew a great number of them as they were fleeing; while those in the rear with whom they had come up, halted, and bravely sustained the attack of our soldiers;
5
the van, because they appeared to be removed from danger, and were not restrained by any necessity or command, as soon as the noise was heard, broke their ranks, and, to a man, rested their safety in flight.
6
Thus without any risk [to themselves] our men killed as great a number of them as the length of the day allowed; and at sunset desisted from the pursuit, and betook themselves into the camp, as they had been commanded.

[color=#3d8b3d]Chapter 12[/color]
1
On the day following, before the enemy could recover from their terror and flight, [color=#3d8b3d]Caesar[/color] led his army into the territories of the Suessiones, which are next to [color=#3d8b3d]the Remi[/color], and having accomplished a long march, hastens to the town named Noviodunum.
2
Having attempted to take it by storm on his march, because he heard that it was destitute of [sufficient] defenders, he was not able to carry it by assault, on account of the breadth of the ditch and the height of the wall, though few were defending it.
3
Therefore, having fortified the camp, he began to bring up the vineae, and to provide whatever things were necessary for the storm.
4
In the mean time the whole body of the Suessiones, after their flight, came the next night into the town.
5
The vineae having been quickly brought up against the town, a mound thrown up, and towers built, the Gauls, amazed by the greatness of the works, such as they had neither seen nor heard of before, and struck also by the dispatch of the Romans, send embassadors to [color=#3d8b3d]Caesar[/color] respecting a surrender, and succeed in consequence of [color=#3d8b3d]the Remi[/color] requesting that they [the Suessiones] might be spared.

[1]: #1chap "Chapter 1, Turmoil in Belgium"
[2]: #2chap "Chapter 2, Measures of Caesar"
[3]: #3chap "Chapter 3, The Remi are declaring themselves for the Romans"
[4]: #4chap "Chapter 4, Enumeration of enemy forces"
[5]: #8chap "Chapter 8, Battle of the Aisne"


text:
package httpunitdemo;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

public class Test1 {

	private static final Logger log = LoggerFactory.getLogger(Test1.class);

	@Test
	public void test1(){
		//抓取带ajax请求的网页
		try{
		 /**HtmlUnit请求web页面*/
        WebClient wc = new WebClient(BrowserVersion.CHROME);
        wc.getOptions().setJavaScriptEnabled(true); //启用JS解释器,默认为true
        wc.getOptions().setCssEnabled(true); //禁用css支持
        wc.getOptions().setThrowExceptionOnScriptError(false); //js运行错误时,是否抛出异常
        wc.getOptions().setTimeout(20000); //设置连接超时时间 ,这里是10S。如果为0,则无限期等待

        wc.setAjaxController(new NicelyResynchronizingAjaxController());//设置支持AJAX
        wc.waitForBackgroundJavaScript(30 * 1000); /* will wait JavaScript to execute up to 30s */
        wc.waitForBackgroundJavaScriptStartingBefore(30*1000);

        HtmlPage page = wc.getPage("http://info.sporttery.cn/football/hhad_list.php");

        //抓取ajax载入数据,此法有效,且强大
        for(int i=0;i<20;i++){
        	log.debug(i+"|"+page.getElementById("mainTbl").getFirstChild());
        	if(page.getElementById("mainTbl").getFirstChild()!=null){
        		break;
        	}
//        	log.debug(i+"|"+page.getElementById("mainTbl").getFirstChild().asXml());
        	synchronized(page){
        		page.wait(1000);
        	}
        }

        String pageXml = page.asXml(); //以xml的形式获取响应文本

        /**jsoup解析文档*/
        Document doc = Jsoup.parse(pageXml);
        Element pv = doc.getElementById("mainTbl");
        log.debug(pv.html());
        wc.close();
		}catch(Exception e){
			e.printStackTrace();
			log.error(e.getMessage());
		}
	}

}


text:
package com.oculus.vrappframework;

import android.app.Activity;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.util.Log;

// Class that manages the lifecycle of the native application without
// necessitating that everyone use VrActivity.
public class VrApp implements SurfaceHolder.Callback {
    private static final String TAG = "VrApp";

    private static native void nativeOnCreate(Activity act);
    private static native void nativeOnResume(long appPtr);
    private static native void nativeOnPause(long appPtr);
    private static native void nativeOnDestroy(long appPtr);
    private static native void nativeSurfaceCreated(long appPtr, Surface s);
    private static native void nativeSurfaceChanged(long appPtr, Surface s);
    private static native void nativeSurfaceDestroyed(long appPtr);

    // Raw pointer to the App's OVR::AppLocal implementation
    private long mAppPtr;
    // While there is a valid surface holder, onDestroy can destroy the surface
    // when surfaceDestroyed is not called before onDestroy.
    private SurfaceHolder mSurfaceHolder;

    public VrApp(Activity activity, long appPtr) {
        mAppPtr = appPtr;

        // We do not use the Activity's Surface, but instead make our own.
		final SurfaceView sv = new SurfaceView( activity );
		activity.setContentView( sv );
		sv.getHolder().addCallback( this );
    }

    long getAppPtr() {
        return mAppPtr;
    }

    public static void onCreate(Activity activity) {
      nativeOnCreate( activity );
    }

    public void onResume() {
        nativeOnResume( mAppPtr );
    }

    public void onPause() {
        nativeOnPause( mAppPtr );
    }

    public void onDestroy() {
      if ( mSurfaceHolder != null ) {
          nativeSurfaceDestroyed( mAppPtr );
      }

      nativeOnDestroy( mAppPtr );
      mAppPtr = 0L;
    }

    @Override
    public void surfaceCreated(SurfaceHolder holder) {
        Log.d(TAG, this + " surfaceCreated()");
        if ( mAppPtr != 0 ) {
            nativeSurfaceCreated( mAppPtr, holder.getSurface() );
            mSurfaceHolder = holder;
        }
    }

    @Override
    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
        Log.d(TAG, this + " surfaceChanged() format: " + format + " width: " + width + " height: " + height);
        if ( mAppPtr != 0 ) {
            nativeSurfaceChanged( mAppPtr, holder.getSurface() );
            mSurfaceHolder = holder;
        }
    }

    @Override
    public void surfaceDestroyed(SurfaceHolder holder) {
        Log.d(TAG, this + " surfaceDestroyed()");
        if ( mAppPtr != 0 ) {
            nativeSurfaceDestroyed( mAppPtr );
            mSurfaceHolder = null;
        }
    }
}


text:
<?php

return [

    // Setup form fields
    'setup' => [
        'email'            => 'Email',
        'username'         => 'Username',
        'password'         => 'Password',
        'site_name'        => 'Site Name',
        'site_domain'      => 'Site Domain',
        'site_timezone'    => 'Select your timezone',
        'site_locale'      => 'Select your language',
        'enable_google2fa' => 'Enable Google Two Factor Authentication',
    ],

    // Login form fields
    'login' => [
        'email'         => 'Email',
        'password'      => 'Password',
        '2fauth'        => 'Authentication Code',
        'invalid'       => 'Invalid email or password',
        'invalid-token' => 'Invalid token',
    ],

    // Incidents form fields
    'incidents' => [
        'name'         => 'Name',
        'status'       => 'Status',
        'component'    => 'Component',
        'message'      => 'Message',
        'message-help' => 'You may also use Markdown.',

        'templates' => [
            'name'     => 'Name',
            'template' => 'Template',
        ],
    ],

    // Components form fields
    'components' => [
        'name'        => 'Name',
        'status'      => 'Status',
        'group'       => 'Group',
        'description' => 'Description',
        'link'        => 'Link',
        'tags'        => 'Tags',
        'tags-help'   => 'Comma separated.',

        'groups' => [
            'name' => 'Name',
        ],
    ],

    // Settings
    'settings' => [
        /// Application setup
        'app-setup' => [
            'site-name'         => 'Site Name',
            'site-url'          => 'Site URL',
            'site-timezone'     => 'Site Timezone',
            'site-locale'       => 'Site Language',
            'date-format'       => 'Date Format',
            'about-this-page'   => 'About this page',
            'days-of-incidents' => 'How many days of incidents to show?',
            'banner'            => 'Banner Image',
            'banner-help'       => "It's recommended that you upload files no bigger than 930px wide .",
            'google-analytics'  => "Google Analytics code",
        ],
        'security' => [
            'allowed-domains'      => 'Allowed domains',
            'allowed-domains-help' => 'Comma separated. The domain set above is automatically allowed by default.',
        ],
        'stylesheet' => [
            'custom-css' => 'Custom Stylesheet',
        ],
        'theme' => [
            'background-color' => 'Background Color',
            'text-color'       => 'Text Color',
        ],
    ],

    'user' => [
        'username'       => 'Username',
        'email'          => 'Email',
        'password'       => 'Password',
        'api-token'      => 'API Token',
        'api-token-help' => 'Regenerating your API token will revoke all existing applications.',
        '2fa'            => [
            'help' => 'Enabling two factor authentication increases security of your account. You will need to download Google Authenticator or a similar app on to your mobile device. When you login you will be asked to provide a token generated by the app.',
        ],
    ],

    // Buttons
    'add'    => 'Add',
    'save'   => 'Save',
    'update' => 'Update',
    'create' => 'Create',
    'edit'   => 'Edit',
    'delete' => 'Delete',
    'submit' => 'Submit',
    'cancel' => 'Cancel',
    'remove' => 'Remove',

    // Other
    'optional' => '* Optional',
];


text:
using Poco::InvalidArgumentException;

namespace Poco {
namespace Net {

DatagramSocket::DatagramSocket(): Socket(new DatagramSocketImpl)
{
}

DatagramSocket::DatagramSocket(IPAddress::Family family): Socket(new DatagramSocketImpl(family))
{
}

DatagramSocket::DatagramSocket(const SocketAddress& address, bool reuseAddress): Socket(new DatagramSocketImpl(address.family()))
{
	bind(address, reuseAddress);
}

DatagramSocket::DatagramSocket(const Socket& socket): Socket(socket)
{
	if (!dynamic_cast<DatagramSocketImpl*>(impl()))
		throw InvalidArgumentException("Cannot assign incompatible socket");
}

DatagramSocket::DatagramSocket(SocketImpl* pImpl): Socket(pImpl)
{
	if (!dynamic_cast<DatagramSocketImpl*>(impl()))
		throw InvalidArgumentException("Cannot assign incompatible socket");
}

DatagramSocket::~DatagramSocket()
{
}

DatagramSocket& DatagramSocket::operator = (const Socket& socket)
{
	if (dynamic_cast<DatagramSocketImpl*>(socket.impl()))
		Socket::operator = (socket);
	else
		throw InvalidArgumentException("Cannot assign incompatible socket");
	return *this;
}

void DatagramSocket::connect(const SocketAddress& address)
{
	impl()->connect(address);
}

void DatagramSocket::bind(const SocketAddress& address, bool reuseAddress)
{
	impl()->bind(address, reuseAddress);
}

int DatagramSocket::sendBytes(const void* buffer, int length, int flags)
{
	return impl()->sendBytes(buffer, length, flags);
}

int DatagramSocket::receiveBytes(void* buffer, int length, int flags)
{
	return impl()->receiveBytes(buffer, length, flags);
}

int DatagramSocket::sendTo(const void* buffer, int length, const SocketAddress& address, int flags)
{
	return impl()->sendTo(buffer, length, address, flags);
}

int DatagramSocket::receiveFrom(void* buffer, int length, SocketAddress& address, int flags)
{
	return impl()->receiveFrom(buffer, length, address, flags);
}

} } // namespace Poco::Net


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <TITLE>
            Segregator (Encog Core 3.2.0-SNAPSHOT API)
        </TITLE>

        <META NAME="date" CONTENT="2013-04-17">

        <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

                            Overview
                            Package
                          Class
                            Use
                            Tree
                            Deprecated
                            Index
                            Help

                     PREV CLASS
                     NEXT CLASS

                    FRAMES
                     NO FRAMES

                        All Classes

                    SUMMARY: NESTED | FIELD | CONSTR | METHOD

                    DETAIL: FIELD | CONSTR | METHOD

            org.encog.util.normalize.segregate

        Interface Segregator

All Superinterfaces:
Serializable

All Known Implementing Classes:
IndexRangeSegregator, IndexSampleSegregator, IndexSegregator, IntegerBalanceSegregator, RangeSegregator

public interface Segregator
extends Serializable

Segregators are used to exclude certain rows. You may want to exclude rows to
 create training and validation sets. You may also simply wish to exclude some
 rows because they do not apply to what you are currently training for.

Method Summary

 DataNormalization
getNormalization()

 void
init(DataNormalization normalization)

          Setup this object to use the specified normalization object.

 void
passInit()

          Init for a pass.

 boolean
shouldInclude()

          Should this row be included, according to this segregator.

Method Detail

getNormalization

DataNormalization getNormalization()

Returns:
The normalization object that is being used with this segregator.

init

void init(DataNormalization normalization)

Setup this object to use the specified normalization object.

Parameters:
normalization - THe normalization object to use.

shouldInclude

boolean shouldInclude()

Should this row be included, according to this segregator.

Returns:
True if this row should be included.

passInit

void passInit()

Init for a pass.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013. All Rights Reserved.


text:
namespace WizBot.Modules.Searches;

public record CandleData(
    decimal Open,
    decimal Close,
    decimal High,
    decimal Low,
    long Volume);


text:
package sg.ncl.service.mail.logic;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sg.ncl.service.mail.data.jpa.EmailEntity;
import sg.ncl.service.mail.data.jpa.EmailRepository;
import sg.ncl.service.mail.domain.AsyncMailSender;
import sg.ncl.service.mail.domain.Email;
import sg.ncl.service.mail.domain.MailService;

import javax.inject.Inject;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * Created by dcszwang on 8/10/2016.
 * Updated by dcsjnh on 24/4/2017
 *
 * References:
 * [1] http://stackoverflow.com/questions/24798695/spring-async-method-inside-a-service
 */
@Service
@Slf4j
class MailServiceImpl implements MailService {

    private final EmailRepository emailRepository;
    private final AsyncMailSender asyncMailSender;
    // FIXME should not use this format, instead should use auto configuration
    @Value("${ncl.mail.retry:3}")
    private int retryTimes;

    @Inject
    MailServiceImpl(@NotNull final EmailRepository emailRepository,
                    @NotNull final AsyncMailSender asyncMailService) {
        this.emailRepository = emailRepository;
        this.asyncMailSender = asyncMailService;
    }

    @Override
    public void send(
            @NotNull final String from,
            @NotNull final String to,
            @NotNull final String subject,
            @NotNull final String content,
            @NotNull final boolean html,
            final String cc,
            final String bcc
    ) {
        send(from, new String[]{to}, subject, content, html, cc == null ? null : new String[]{cc}, bcc == null ? null : new String[]{bcc});
    }

    @Override
    public void send(
            @NotNull final String from,
            @NotNull final String[] to,
            @NotNull final String subject,
            @NotNull final String content,
            @NotNull final boolean html,
            final String[] cc,
            final String[] bcc
    ) {
        final EmailEntity entity = new EmailEntity();
        entity.setSender(from);
        entity.setRecipients(to);
        entity.setSubject(subject);
        entity.setContent(content);
        entity.setHtml(html);
        entity.setCc(cc);
        entity.setBcc(bcc);

        asyncMailSender.send(entity);
    }

    @Override
    public void send(@NotNull final Email email) {
        if (null == email.getId()) {
            send(email.getSender(), email.getRecipients(), email.getSubject(),
                    email.getContent(), email.isHtml(), email.getCc(), email.getBcc());

        } else {
            asyncMailSender.send(emailRepository.findOne(email.getId()));
        }
    }

    // FIXME should not use this format, instead should use auto configuration
    @Scheduled(initialDelayString = "${ncl.mail.delay:300000}", fixedRateString = "${ncl.mail.interval:600000}")
    @Transactional
    @Override
    public void retry() {
        final List<EmailEntity> emails = emailRepository.findBySentFalseAndRetryTimesLessThanOrderByRetryTimes(3);
        log.info("Retrying {} emails", emails.size());
        emails.forEach(this::send);
    }

}


text:
public class Caretaker {
	private ArrayList<Memento> savedStates = new ArrayList<Memento>();

	public void addMemento(Memento m) {
		savedStates.add(m);
	}

	public Memento getMemento(int index) {
		return savedStates.get(index);
	}
}


text:
CC ?= gcc
CFLAGS = -O3 -g -Wall -std=c89 -pedantic

default: demo stresstest multidemo test

.PHONY: default clean test format

test: stresstest benchmark
	./benchmark | tee benchmark.txt
	./stresstest

clean:
	rm -f demo multidemo stresstest benchmark

demo: demo.c sort.h
	$(CC) $(CFLAGS) demo.c -o demo

multidemo: multidemo.c sort.h
	$(CC) $(CFLAGS) multidemo.c -o multidemo

stresstest: stresstest.c sort.h
	$(CC) $(CFLAGS) stresstest.c -o stresstest

benchmark: benchmark.c sort.h
	$(CC) $(CFLAGS) benchmark.c -o benchmark

format:
	astyle --options=astyle.options sort.h demo.c multidemo.c stresstest.c benchmark.c


text:
package com.adyen.deserializer;

import com.adyen.model.marketpay.notification.AccountCloseNotification;
import com.adyen.model.marketpay.notification.AccountCreateNotification;
import com.adyen.model.marketpay.notification.AccountFundsBelowThresholdNotification;
import com.adyen.model.marketpay.notification.AccountHolderCreateNotification;
import com.adyen.model.marketpay.notification.AccountHolderPayoutNotification;
import com.adyen.model.marketpay.notification.AccountHolderStatusChangeNotification;
import com.adyen.model.marketpay.notification.AccountHolderStoreStatusChangeNotification;
import com.adyen.model.marketpay.notification.AccountHolderUpcomingDeadlineNotification;
import com.adyen.model.marketpay.notification.AccountHolderUpdateNotification;
import com.adyen.model.marketpay.notification.AccountHolderVerificationNotification;
import com.adyen.model.marketpay.notification.AccountUpdateNotification;
import com.adyen.model.marketpay.notification.BeneficiarySetupNotification;
import com.adyen.model.marketpay.notification.CompensateNegativeBalanceNotification;
import com.adyen.model.marketpay.notification.DirectDebitInitiatedNotification;
import com.adyen.model.marketpay.notification.GenericNotification;
import com.adyen.model.marketpay.notification.PaymentFailureNotification;
import com.adyen.model.marketpay.notification.RefundFundsTransferNotification;
import com.adyen.model.marketpay.notification.ReportAvailableNotification;
import com.adyen.model.marketpay.notification.ScheduledRefundsNotification;
import com.adyen.model.marketpay.notification.TransferFundsNotification;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;

import java.lang.reflect.Type;

public class MarketPayNotificationMessageDeserializer implements JsonDeserializer<GenericNotification> {
    @Override
    public GenericNotification deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
        JsonObject jsonObject = jsonElement.getAsJsonObject();

        JsonElement jsonType = jsonObject.get("eventType");
        String eventType = jsonType.getAsString();

        if (GenericNotification.EventTypeEnum.ACCOUNT_CREATED.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountCreateNotification.class);
        }
        if (GenericNotification.EventTypeEnum.ACCOUNT_CLOSED.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountCloseNotification.class);
        }
        if (GenericNotification.EventTypeEnum.ACCOUNT_UPDATED.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountUpdateNotification.class);
        }
        if (GenericNotification.EventTypeEnum.ACCOUNT_FUNDS_BELOW_THRESHOLD.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountFundsBelowThresholdNotification.class);
        }
        if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_CREATED.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountHolderCreateNotification.class);
        }
        if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_VERIFICATION.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountHolderVerificationNotification.class);
        }
        if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_STATUS_CHANGE.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountHolderStatusChangeNotification.class);
        }
        if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_PAYOUT.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountHolderPayoutNotification.class);
        }
        if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_UPDATED.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountHolderUpdateNotification.class);
        }
        if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_STORE_STATUS_CHANGE.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountHolderStoreStatusChangeNotification.class);
        }
        if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_UPCOMING_DEADLINE.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountHolderUpcomingDeadlineNotification.class);
        }
        if (GenericNotification.EventTypeEnum.BENEFICIARY_SETUP.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, BeneficiarySetupNotification.class);
        }
        if (GenericNotification.EventTypeEnum.SCHEDULED_REFUNDS.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, ScheduledRefundsNotification.class);
        }
        if (GenericNotification.EventTypeEnum.COMPENSATE_NEGATIVE_BALANCE.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, CompensateNegativeBalanceNotification.class);
        }
        if (GenericNotification.EventTypeEnum.PAYMENT_FAILURE.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, PaymentFailureNotification.class);
        }
        if (GenericNotification.EventTypeEnum.REPORT_AVAILABLE.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, ReportAvailableNotification.class);
        }
        if (GenericNotification.EventTypeEnum.TRANSFER_FUNDS.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, TransferFundsNotification.class);
        }
        if (GenericNotification.EventTypeEnum.DIRECT_DEBIT_INITIATED.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, DirectDebitInitiatedNotification.class);
        }
        if (GenericNotification.EventTypeEnum.PAYOUT_CONFIRMED.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, AccountHolderPayoutNotification.class);
        }
        if (GenericNotification.EventTypeEnum.REFUND_FUNDS_TRANSFER.toString().equalsIgnoreCase(eventType)) {
            return jsonDeserializationContext.deserialize(jsonElement, RefundFundsTransferNotification.class);
        }
        return jsonDeserializationContext.deserialize(jsonElement, GenericNotification.class);
    }
}