text:
import React from 'react';
import { useStaticQuery, graphql } from 'gatsby';

import Container from 'components/ui/Container';
import Button from 'components/ui/Button';
import TitleSection from 'components/ui/TitleSection';

import * as Styled from './styles';

const Newsletter = () => {
  const { markdownRemark } = useStaticQuery(graphql`
    query {
      markdownRemark(frontmatter: { category: { eq: "newsletter section" } }) {
        frontmatter {
          title
          subtitle
          namePlaceholder
          emailPlaceholder
          submitPlaceholder
        }
      }
    }
  `);

  const newsletter = markdownRemark.frontmatter;

  return (
    <Styled.Newsletter>
      <Container section>
        <TitleSection title={newsletter.title} subtitle={newsletter.subtitle} center />
        <Styled.Form>
          <Styled.Input type="text" placeholder={newsletter.namePlaceholder} />
          <Styled.Input type="email" placeholder={newsletter.emailPlaceholder} />
          <Button primary block>
            {newsletter.submitPlaceholder}
          </Button>
        </Styled.Form>
      </Container>
    </Styled.Newsletter>
  );
};

export default Newsletter;


text:
<?php
/**
 * @link https://github.com/Chiliec/yii2-vote
 * @author Vladimir Babin <vovababin@gmail.com>
 * @license http://opensource.org/licenses/BSD-3-Clause
 */

namespace chiliec\vote\components;

use Yii;
use yii\base\BootstrapInterface;
use yii\base\Event;
use chiliec\vote\behaviors\RatingBehavior;
use chiliec\vote\models\Rating;

class VoteBootstrap implements BootstrapInterface
{
    /**
     * Bootstrap method to be called during application bootstrap stage.
     * @param Application $app the application currently running
     */
    public function bootstrap($app)
    {
		$models = Yii::$app->getModule('vote')->models;
		foreach ($models as $value) {
			$modelId = Rating::getModelIdByName($value);
			$modelName = Rating::getModelNameById($modelId);
			Event::on($modelName::className(), $modelName::EVENT_INIT, function ($event) {
			    if (null === $event->sender->getBehavior('rating')) {
					$event->sender->attachBehavior('rating', [
						'class' => RatingBehavior::className(),
					]);
				}
			});
		}
    }
}

redpajama_set_name: RedPajamaGithub


text:
import re, time

file_path = "/home/velosa/mushroomobserver.org/log/production.log"
pat = re.compile('Processing ObservationsController#index \(for 65\.111\.164\.187 at (.+)\)')
time_format = '%Y-%m-%d %H:%M:%S'
f = open(file_path)
line = f.readline()
matches = []
while line:
  m = pat.match(line)
  if m:
    matches.append(time.strptime(m.group(1), time_format))
    pass
  line = f.readline()
  pass

matches.reverse()
p = time.localtime()
for m in matches:
  print "%s: %s, %s" % (time.mktime(p) - time.mktime(m), time.asctime(p), time.asctime(m))
  p = m
  pass


text:
#ifndef SkPatchUtils_DEFINED
#define SkPatchUtils_DEFINED

#include "SkColorPriv.h"
#include "SkMatrix.h"

class SK_API SkPatchUtils {

public:
    /**
     * Structure that holds the vertex data related to the tessellation of a patch. It is passed
     * as a parameter to the function getVertexData which sets the points, colors and texture
     * coordinates of the vertices and the indices for them to be drawn as triangles.
     */
    struct VertexData {
        int fVertexCount, fIndexCount;
        SkPoint* fPoints;
        SkPoint* fTexCoords;
        uint32_t* fColors;
        uint16_t* fIndices;

        VertexData()
        : fVertexCount(0)
        , fIndexCount(0)
        , fPoints(nullptr)
        , fTexCoords(nullptr)
        , fColors(nullptr)
        , fIndices(nullptr) { }

        ~VertexData() {
            delete[] fPoints;
            delete[] fTexCoords;
            delete[] fColors;
            delete[] fIndices;
        }
    };

    // Enums for control points based on the order specified in the constructor (clockwise).
    enum CubicCtrlPts {
        kTopP0_CubicCtrlPts = 0,
        kTopP1_CubicCtrlPts = 1,
        kTopP2_CubicCtrlPts = 2,
        kTopP3_CubicCtrlPts = 3,

        kRightP0_CubicCtrlPts = 3,
        kRightP1_CubicCtrlPts = 4,
        kRightP2_CubicCtrlPts = 5,
        kRightP3_CubicCtrlPts = 6,

        kBottomP0_CubicCtrlPts = 9,
        kBottomP1_CubicCtrlPts = 8,
        kBottomP2_CubicCtrlPts = 7,
        kBottomP3_CubicCtrlPts = 6,

        kLeftP0_CubicCtrlPts = 0,
        kLeftP1_CubicCtrlPts = 11,
        kLeftP2_CubicCtrlPts = 10,
        kLeftP3_CubicCtrlPts = 9,
    };

    // Enum for corner also clockwise.
    enum Corner {
        kTopLeft_Corner = 0,
        kTopRight_Corner,
        kBottomRight_Corner,
        kBottomLeft_Corner
    };

    enum {
        kNumCtrlPts = 12,
        kNumCorners = 4,
        kNumPtsCubic = 4
    };

    /**
     * Method that calculates a level of detail (number of subdivisions) for a patch in both axis.
     */
    static SkISize GetLevelOfDetail(const SkPoint cubics[12], const SkMatrix* matrix);

    /**
     * Get the points corresponding to the top cubic of cubics.
     */
    static void getTopCubic(const SkPoint cubics[12], SkPoint points[4]);

    /**
     * Get the points corresponding to the bottom cubic of cubics.
     */
    static void getBottomCubic(const SkPoint cubics[12], SkPoint points[4]);

    /**
     * Get the points corresponding to the left cubic of cubics.
     */
    static void getLeftCubic(const SkPoint cubics[12], SkPoint points[4]);

    /**
     * Get the points corresponding to the right cubic of cubics.
     */
    static void getRightCubic(const SkPoint cubics[12], SkPoint points[4]);

    /**
     * Function that evaluates the coons patch interpolation.
     * data refers to the pointer of the PatchData struct in which the tessellation data is set.
     * cubics refers to the points of the cubics.
     * lod refers the level of detail for each axis.
     * colors refers to the corner colors that will be bilerp across the patch (optional parameter)
     * texCoords refers to the corner texture coordinates that will be bilerp across the patch
        (optional parameter)
     */
    static bool getVertexData(SkPatchUtils::VertexData* data, const SkPoint cubics[12],
                              const SkColor colors[4], const SkPoint texCoords[4],
                              int lodX, int lodY);
};

#endif


text:
/**************************************************************************************
 * This source file is a test file for seven segment display implementation
 * Author: huhao
 * Date: 2017.07.31
 * Modification record:
 *
 **************************************************************************************/

#include "seven_segment.h"

int main(int argc, char *argv[])
{
    seven_segment_dispaly(12340);
    seven_segment_dispaly(56789);
    return 0;
}


text:
package com.ystore.lib.chess;

public abstract interface Step
{
    public abstract String getComment();

    public abstract byte getFrom();

    public abstract int getIndex();

    public abstract String getStepDesc();

    public abstract byte getTo();
}


text:
using UnityEngine;
using System.Collections;

public class Readfile : MonoBehaviour {
	string lecturetext = "http://localhost/vitesse.txt";
	// Use this for initialization
	void Start () {
		StartCoroutine (readfile (lecturetext));
	}

	// Update is called once per frame
	void Update () {

	}
	IEnumerator readfile(string url)
	{
		print("Loading");
		WWW w = new WWW(lecturetext);
		yield  return w;
		print(w.url);
		//System.IO.File.ReadAllText("C:\Users\anis\Desktop\bourse.txt");
		Debug.Log(w.text);

		/* create an array to store the floats we find in the file */
		float[] floatArray = new float[1000] ;
		int j = 0;
		/* split the text file by newline characters */
		string[] lineArray = w.text.Split("\n"[0]);

		/* loop over each line in the file */
		foreach( string thisLine in lineArray ) {
			/* split each line by commas */
			string[] numberStrings =thisLine.Split(","[0]);
			/* loop over the numbers in this line */
			foreach( string thisNumber in numberStrings ) {
				/* parse the string into a float */
				float someFloat = float.Parse(thisNumber);
				print("Found this float: " + someFloat);
				/* put the float into an array you can use later */

				floatArray [j++]= someFloat  ;
			}
		}

		print("I found " + floatArray.Length + "numbers: ");

		for ( int i= 0; i < floatArray.Length ; i ++ ) {
			print(floatArray[i]);
		}

		/* convert the array to a builtin array for fun */

		//float[] fastFloatArray  = new float[floatArray.ToBuiltin(float)];
	}
}


text:
export default function numberIsFloat(value) {
	// eslint-disable-next-line unicorn/prefer-math-trunc
	return Number.isFinite(value) && value !== (value | 0);
}


text:
package com.roboo.like.google.adapters;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.SectionIndexer;
import android.widget.TextView;

import com.nineoldandroids.animation.AnimatorSet;
import com.nineoldandroids.animation.ObjectAnimator;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.roboo.like.google.R;
import com.roboo.like.google.models.NewsItem;
import com.roboo.like.google.views.StickyGridHeadersGridView;

public class NewsGridAdapter extends BaseAdapter implements StickyHeadersAdapter, SectionIndexer
{
	private static final boolean IS_CUSTOM_FAST_SCROLL_LABEL = false;
	private Context context;
	private LinkedList<NewsItem> mData;
	private ImageLoader mImageLoader;
	private LayoutInflater mInflater;
	/** 用于记录兩條新聞日期不相同时,该比较字符串所在List集合的索引位置,在生成HeaderId时进行获取 */
	private LinkedList<Integer> mSectionIndex = new LinkedList<Integer>();
	private HashMap<String, Integer> mNewsCountInDay = new HashMap<String, Integer>();

	public NewsGridAdapter(Context context, LinkedList<NewsItem> data)
	{
		super();
		this.context = context;
		this.mData = data;
		this.mImageLoader = ImageLoader.getInstance();
		mInflater = LayoutInflater.from(context);
		mImageLoader.init(ImageLoaderConfiguration.createDefault(context));

	}

	public NewsGridAdapter(Context context, LinkedList<NewsItem> data, LinkedList<Integer> sectionIndex)
	{
		super();
		this.context = context;
		this.mData = data;
		this.mImageLoader = ImageLoader.getInstance();
		mInflater = LayoutInflater.from(context);
		mImageLoader.init(ImageLoaderConfiguration.createDefault(context));
		this.mSectionIndex = sectionIndex;
	}

	public int getCount()
	{
		return null == mData ? 0 : mData.size();
	}

	@Override
	public Object getItem(int position)
	{
		return null == mData ? null : mData.get(position);
	}

	@Override
	public long getItemId(int position)
	{
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent)// TODO
	{
		NewsItem item = mData.get(position);
		if (null != item)
		{
//			String time = mData.get(position).getTime();
//			int count = null == mNewsCountInDay.get(time) ? 0 : mNewsCountInDay.get(time).intValue();
			// if (count % 2 == 1 && (count == (position + 1)))
			// {
			// StickyGridHeadersGridView gridView = (StickyGridHeadersGridView) parent;
			// gridView.setNumColumns(1);
			// convertView = mInflater.inflate(R.layout.list_news_item, null);
			// }
			// else
			// {
			if(convertView == null)
			{
			convertView = mInflater.inflate(R.layout.grid_news_item, null);
			}
			// }
			ImageView imageView = ViewHolder.getView(convertView, R.id.iv_image);
			TextView tvTitle = ViewHolder.getView(convertView, R.id.tv_title);
			TextView tvSubTitle = ViewHolder.getView(convertView, R.id.tv_sub_title);
			if (parent instanceof StickyGridHeadersGridView)
			{
				tvTitle.setLines(3);
				tvSubTitle.setLines(4);
			}
			tvTitle.setText(item.getTitle());
			tvSubTitle.setText(item.getSubTitle());
			DisplayImageOptions options = new DisplayImageOptions.Builder().showStubImage(R.drawable.ic_default_image).showImageForEmptyUri(R.drawable.ic_default_image).showImageOnFail(R.drawable.ic_default_image).cacheInMemory().cacheOnDisc().bitmapConfig(Bitmap.Config.RGB_565).build();
			mImageLoader.displayImage(item.getSrc(), imageView, options);
			// addAnimation(convertView);
		}
		return convertView;
	}

	protected void addAnimation(View convertView)
	{
		// ObjectAnimator translateX = ObjectAnimator.ofFloat(convertView,
		// "translationX",screenWidth/3, screenWidth );
		// AnimatorSet set = new AnimatorSet();
		// set.play(translateX);
		// set.setStartDelay(0);
		// set.setDuration( 0);
		// set.start();
		// AnimatorSet set = new AnimatorSet();
		// ObjectAnimator translateY = ObjectAnimator.ofFloat(convertView,
		// "translationY", 500, 0);
		// set.play(translateY);
		// set.setStartDelay(100);
		// set.setDuration(300);
		// set.start();

		int screenWidth = context.getResources().getDisplayMetrics().widthPixels;
		ObjectAnimator scaleX = ObjectAnimator.ofFloat(convertView, "scaleX", 0f, 1f);
		ObjectAnimator scaleY = ObjectAnimator.ofFloat(convertView, "alpha", 0f, 1f);
		AnimatorSet set = new AnimatorSet();
		// set.playTogether(new Animator[]{scaleX,scaleY});
		ObjectAnimator translateX = ObjectAnimator.ofFloat(convertView, "translationX", screenWidth, 0f);
		ObjectAnimator translateY = ObjectAnimator.ofFloat(convertView, "translationY", 500, 0);
		set.play(translateX);
		set.setStartDelay(100);
		set.setDuration(300);
		set.start();
	}

	public long getHeaderId(int position)
	{
		return mData.get(position).getHeaderId();
	}

	public View getHeaderView(int position, View convertView, ViewGroup parent)
	{
		convertView = mInflater.inflate(R.layout.sticky_header_view, parent, false);
		TextView textView = (TextView) convertView.findViewById(R.id.tv_text);
		TextView tvTodayNewsCount = (TextView) convertView.findViewById(R.id.tv_today_news_count);
		String time = mData.get(position).getTime();
		int count = null == mNewsCountInDay.get(time) ? 0 : mNewsCountInDay.get(time).intValue();
		textView.setText(time);
		tvTodayNewsCount.setText("总共 " + count + " 条");
		return convertView;
	}

	@Override
	public Object[] getSections()
	{
		String[] sections = new String[mSectionIndex.size()];
		for (int i = 0; i < mSectionIndex.size(); i++)
		{
			sections[i] = getFastScrollLabel(mData.get(mSectionIndex.get(i)).getTime());
		}
		return sections;
	}

	/** 获取快速滑动时显示的文字 */
	private String getFastScrollLabel(String time)
	{
		if (IS_CUSTOM_FAST_SCROLL_LABEL)
		{
			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM月");
			String currentMonth = simpleDateFormat.format(new Date(System.currentTimeMillis()));
			String newsPublishMonth = null;
			String newsPublishDay = null;
			if (time.contains("月") && time.contains("日"))
			{
				newsPublishMonth = time.split("月")[0] + "月";
				newsPublishDay = time.split("月")[1].split("日")[0];
			}
			System.out.println("currentMonth = " + currentMonth + " newsPublishMonth = " + newsPublishMonth);
			if (currentMonth.equals(newsPublishMonth))
			{
				return newsPublishDay;
			}
			else
			{
				return newsPublishMonth;
			}
		}
		else
		{
			return time;
		}
	}

	public int getPositionForSection(int section)
	{
		if (section >= mSectionIndex.size())
		{
			section = mSectionIndex.size() - 1;
		}
		else if (section < 0)
		{
			section = 0;
		}
		if (section < mSectionIndex.size() && mSectionIndex.size() > 0)
		{
			return mSectionIndex.get(section);
		}
		return 0;
	}

	public int getSectionForPosition(int position)
	{
		for (int i = 0; i < mSectionIndex.size(); i++)
		{
			if (position < mSectionIndex.get(i))
			{
				return i - 1;
			}
		}
		return mSectionIndex.size() - 1;
	}

	public void setSectionIndex(LinkedList<Integer> sectionIndex)
	{
		mSectionIndex = sectionIndex;
		String currentNewsTime = mData.get(0).getTime();
		int count = 0;
		for (int i = 0; i < mData.size(); i++)
		{
			NewsItem item = mData.get(i);
			if (currentNewsTime.equals(item.getTime()))
			{
				count++;
			}
			else
			{
				mNewsCountInDay.put(currentNewsTime, count);
				currentNewsTime = item.getTime();
				count = 1;
			}
		}
		mNewsCountInDay.put(currentNewsTime, count);// 最后一个日期
	}

}


text:
/**
 * some js functions used by mongodb mapreduce
 */

//////////////////////////////////////////////////////////////////////////////////////////////////////
function MapOrphans () {
	//	just finds how many documents exists with given field in each collection
	//	exaple scope= {'phase':1}  phase =1 on first Map call, =2 on second
	var emkey= this.%s  // s   it will be replaced by caller with exact field name
	if (phase==1) {var vl={A:1,B:0,sum:1};}
	else          {var vl={A:0,B:1,sum:1};}
	emit(emkey, vl);
}

function ReduceOrphans(key, values) {
	   var result={A:0,B:0,sum:0};
	   for(var i in values) {
		  result.A += values[i].A;
		  result.B += values[i].B;
		  result.sum += values[i].sum;
	   	}
	   return result;
	}
///////////////////////////////////////////////////////////////////////////////////////////////////////
function MapJoin () {
	//	just finds how many documents exists with given field in each collection
	//	exaple scope= {'phase':1}  phase =1 on first Map call, =2 on second
	var emkey= this.%s  // s   it will be replaced by caller with exact field name
	if (phase==1) {var vl={A:this,B:null};}
	else          {var vl={A:null,B:this};}
	emit(emkey, vl);
}

function ReduseJoin(key, values) {
	   var result={A:null,B:null,sum:0};
	   for(var i in values) {
		  result.A = values[i].A;
		  result.B = values[i].B;
	   	}
	   return result;
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////
function MapKeys() {
	var tmp,tmpEmpty,ChildObjTp,ChildIsAr;
	var levelCurrent=0;
	var record=this;
	function isArray(obj) {return typeof(obj)=='object'&&(obj instanceof Array);}
	//function emptyIf(obj){if (obj=='tojson')   {return  ' ';} else {return obj+' '}; }  //@note date fields return .tojson so strip it
	function emptyIf(obj){if (typeof(this[obj])=='function')   {return  ' ';} else {return obj+' ';} }  //@note date fields return .tojson so strip it
	//var toType = function(obj) { 		// * http://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/
	//	  return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase()
	//	}
	function keysToArray(obj,propArr,levelMax, _level) {
		/**	example: r1=keysToArray(doc,[null,[] ],2,0)
		 	_level is used for recursion and should always called with 0
		 	if levelMax is negative returns maximum level
		 	levelMax=0 means top level only 2 up to 2nd depth level etc.
		*/
			for (var key in obj) {
				if (obj.hasOwnProperty(key)) {
					if (obj[key] instanceof Object && ! (obj[key]  instanceof Array))
						if (levelMax < 0 || _level+1  <= levelMax) {
							{propArr[1].push(keysToArray(obj[key],[key,[] ],levelMax,_level+1));}
						}
						else {}  //needed coz nested if ?
					{propArr[1].push(key);}
				}
			}
			return  propArr;
		}
	//----------------------------------------------------------------------------------------------
	function arrayToStr(lst,prevKey,delimiter, inclKeys,levelMax,_level,_levelMaxFound) {
		/**	example: r2=arrayToStr(r1,'','|',true,2,0,0)
		 	_level and _levelMaxFound is used for recursion and should always called with value 0
		 	if levelMax is negative returns maximum level
		 	levelMax=0 means top level only 2 up to 2nd depth level etc.
		*/
			var rt,i;
			_levelMaxFound=Math.max(_level,_levelMaxFound);
			if (prevKey !=='') {prevKey += '.';}
			var rtStr ='';
			if (lst[0])		{prevKey += lst[0]+'.';}
			if (inclKeys)	{rtStr += prevKey.slice(0,-1);}
			for (var n in lst[1]) {
				i=lst[1][n];
				if (typeof(i)=='string') {
					rtStr += delimiter + prevKey + i;
				}
				else
				{
					if (levelMax < 0 || _level+1  <= levelMax) {
						rt=arrayToStr(i,prevKey.slice(0,-1),delimiter, inclKeys,levelMax,_level+1,_levelMaxFound);
						rtStr += delimiter + rt[0];
						_levelMaxFound=Math.max(rt[1],_levelMaxFound);
					}
					else {}
				}
			}
			if (rtStr[0] == delimiter) {rtStr=rtStr.slice(1);}  // Lstrip delimiters if any
			return [rtStr,_levelMaxFound]
		}
	//----------------------------------------------------------------------------------------------

	var keysV=keysToArray(this,[null,[] ] ,parms.levelMax, 0);   // we can't sort here coz array is nested
	keysV = arrayToStr(keysV,'',' ', parms.inclHeaderKeys,-1,0,0);
	var MaxDepth=keysV[1];
	keysV=keysV[0].split(' ');	// so we can sort
	keysV.sort();				// sort to make sure indentical records map to same id
	keysV=keysV.join(' ');
	emit  ({type:'fieldsGrp',fields:keysV}, {cnt:1, percent:0.0,depth:MaxDepth,exampleIds:[this._id]});
}

function ReduceKeys (key, values) {
    //var total = {cnt:0,percent:0.0,exampleIds:[]}
    var total = {cnt:0, percent:0.0,depth:values[0].depth,exampleIds:[]}
    for(var i in values) {
    	total.cnt += values[i].cnt;
    	if (total.exampleIds.length < parms.Reduce_ExamplesMax){
    		total.exampleIds = values[i].exampleIds.concat(total.exampleIds);
    		}
    	}
    return total;
}

function MetaMapKeys() {
  fields=this._id.fields.split(' ');
  value=this.value;
  var fldname;
  for (var fld in fields) {
	  fldname=fields[fld];
	  emit ({type:'field',fields:fldname}, {cnt:value.cnt, percent:value.percent,depth:(fldname.match(/\./g)||[]).length,exampleIds:value.exampleIds});
  }
}

function MetaReduceKeys (key, values) {
    var total = {cnt:0,percent:0.0,depth:values[0].depth,exampleIds:values[0].exampleIds}
    for(var i in values) {
    	total.cnt += values[i].cnt;
    	total.percent += values[i].percent;
    	}
    return total;
}
//////////////////////////////////////////////////////////////////////////////////////////  edu tests
function map_closest() {
    var pitt = [-80.064879, 40.612044];
    var phil = [-74.978052, 40.089738];

    function distance(a, b) {
        var dx = a[0] - b[0];
        var dy = a[1] - b[1];
        return Math.sqrt(dx * dx + dy * dy);
    }

    if (distance(this.loc, pitt) < distance(this.loc, phil)) {
        emit("pitt", 1);
    } else {
        emit("phil", 1);
    }
}

function red_closest (key, values) {
    var total =  0
    for(var i in values) {
    	total += values[i];
    	print ('val',key,JSON.stringify(values[i]));

    	}
    return total;
}

/////////////////////////////////////////////////////////////////////////////////////////

//eof//


text:
#ifndef _TCUANDROIDPLATFORM_HPP
#define _TCUANDROIDPLATFORM_HPP
/*!
 * \file
 * \brief Android EGL platform.
 *//*--------------------------------------------------------------------*/

#include "tcuDefs.hpp"
#include "tcuPlatform.hpp"
#include "egluPlatform.hpp"
#include "gluPlatform.hpp"
#include "vkPlatform.hpp"
#include "tcuAndroidWindow.hpp"
#include "tcuAndroidNativeActivity.hpp"

namespace tcu
{
namespace Android
{

class Platform : public tcu::Platform, private eglu::Platform, private glu::Platform, private vk::Platform
{
public:
									Platform			(NativeActivity& activity);
	virtual							~Platform			(void);

	virtual bool					processEvents		(void);

	virtual const glu::Platform&	getGLPlatform		(void) const { return static_cast<const glu::Platform&>(*this);		}
	virtual const eglu::Platform&	getEGLPlatform		(void) const { return static_cast<const eglu::Platform&>(*this);	}
	virtual const vk::Platform&		getVulkanPlatform	(void) const { return static_cast<const vk::Platform&>(*this);		}
	virtual void					getMemoryLimits		(tcu::PlatformMemoryLimits& limits) const;

	WindowRegistry&					getWindowRegistry	(void) { return m_windowRegistry; }

	// Vulkan Platform API
	vk::Library*					createLibrary		(const char* libraryPath) const;
	void							describePlatform	(std::ostream& dst) const;
	vk::wsi::Display*				createWsiDisplay	(vk::wsi::Type wsiType) const;
	bool							hasDisplay			(vk::wsi::Type wsiType) const;

private:
	NativeActivity&					m_activity;
	WindowRegistry					m_windowRegistry;
	const size_t					m_totalSystemMemory;
};

} // Android
} // tcu

#endif // _TCUANDROIDPLATFORM_HPP


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>Uses of Package com.thinkaurelius.titan.core (Titan 1.0.0 API)</title>
<meta name="date" content="2015-09-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
com.thinkaurelius.titan.core

Packages that use com.thinkaurelius.titan.core

Package
Description

com.thinkaurelius.titan.core

com.thinkaurelius.titan.core.log

com.thinkaurelius.titan.core.schema

com.thinkaurelius.titan.core.util

com.thinkaurelius.titan.diskstorage

com.thinkaurelius.titan.diskstorage.indexing

com.thinkaurelius.titan.diskstorage.util

com.thinkaurelius.titan.example

com.thinkaurelius.titan.graphdb.database

com.thinkaurelius.titan.graphdb.database.idassigner

com.thinkaurelius.titan.graphdb.database.log

com.thinkaurelius.titan.graphdb.database.management

com.thinkaurelius.titan.graphdb.database.serialize

com.thinkaurelius.titan.graphdb.internal

com.thinkaurelius.titan.graphdb.log

com.thinkaurelius.titan.graphdb.olap

com.thinkaurelius.titan.graphdb.olap.computer

com.thinkaurelius.titan.graphdb.olap.job

com.thinkaurelius.titan.graphdb.query

com.thinkaurelius.titan.graphdb.query.condition

com.thinkaurelius.titan.graphdb.query.graph

com.thinkaurelius.titan.graphdb.query.vertex

com.thinkaurelius.titan.graphdb.relations

com.thinkaurelius.titan.graphdb.schema

com.thinkaurelius.titan.graphdb.tinkerpop

com.thinkaurelius.titan.graphdb.tinkerpop.optimize

com.thinkaurelius.titan.graphdb.transaction

com.thinkaurelius.titan.graphdb.transaction.indexcache

com.thinkaurelius.titan.graphdb.types

com.thinkaurelius.titan.graphdb.types.indextype

com.thinkaurelius.titan.graphdb.types.system

com.thinkaurelius.titan.graphdb.types.typemaker

com.thinkaurelius.titan.graphdb.types.vertices

com.thinkaurelius.titan.graphdb.util

com.thinkaurelius.titan.graphdb.vertices

com.thinkaurelius.titan.util.system

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.core

Class and Description

BaseVertexQuery

BaseVertexQuery constructs and executes a query over incident edges or properties from the perspective of a vertex.

Cardinality

The cardinality of the values associated with given key for a particular element.

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

Idfiable

Represents an entity that can be uniquely identified by a long id.

Multiplicity

The multiplicity of edges between vertices for a given label.

Namifiable

Represents an entity that can be uniquely identified by a String name.

PropertyKey

PropertyKey is an extension of RelationType for properties.

QueryDescription.SubQuery

Represents one sub-query of this query.

RelationType

RelationType defines the schema for TitanRelation.

TitanEdge

A TitanEdge connects two TitanVertex.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanException

Most general type of exception thrown by the Titan graph database.

TitanFactory.Builder

TitanGraph

Titan graph database implementation of the Blueprint's interface.

TitanGraphComputer

TitanGraphComputer.ResultMode

TitanGraphQuery

Constructs a query against a mixed index to retrieve all elements (either vertices or edges)
 that match all conditions.

TitanGraphTransaction

TitanGraphTransaction defines a transactional context for a TitanGraph.

TitanIndexQuery

A GraphQuery that queries for graph elements directly against a particular indexing backend and hence allows this
 query mechanism to exploit the full range of features and functionality of the indexing backend.

TitanIndexQuery.Result

Container of a query result with its score.

TitanMultiVertexQuery

A MultiVertexQuery is identical to a TitanVertexQuery but executed against a set of vertices simultaneously.

TitanProperty

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

TitanVertexQuery

A TitanVertexQuery is a VertexQuery executed for a single vertex.

TransactionBuilder

Constructor returned by TitanGraph.buildTransaction() to build a new transaction.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

VertexList

List of TitanVertexs.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.core.log

Class and Description

RelationType

RelationType defines the schema for TitanRelation.

TitanEdge

A TitanEdge connects two TitanVertex.

TitanException

Most general type of exception thrown by the Titan graph database.

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.core.schema

Class and Description

Cardinality

The cardinality of the values associated with given key for a particular element.

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

Multiplicity

The multiplicity of edges between vertices for a given label.

Namifiable

Represents an entity that can be uniquely identified by a String name.

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.core.util

Class and Description

TitanGraph

Titan graph database implementation of the Blueprint's interface.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.diskstorage

Class and Description

TitanException

Most general type of exception thrown by the Titan graph database.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.diskstorage.indexing

Class and Description

Cardinality

The cardinality of the values associated with given key for a particular element.

PropertyKey

PropertyKey is an extension of RelationType for properties.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.diskstorage.util

Class and Description

TitanException

Most general type of exception thrown by the Titan graph database.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.example

Class and Description

TitanGraph

Titan graph database implementation of the Blueprint's interface.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.database

Class and Description

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanException

Most general type of exception thrown by the Titan graph database.

TitanGraph

Titan graph database implementation of the Blueprint's interface.

TitanGraphTransaction

TitanGraphTransaction defines a transactional context for a TitanGraph.

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.database.idassigner

Class and Description

TitanException

Most general type of exception thrown by the Titan graph database.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.database.log

Class and Description

TransactionBuilder

Constructor returned by TitanGraph.buildTransaction() to build a new transaction.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.database.management

Class and Description

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

Namifiable

Represents an entity that can be uniquely identified by a String name.

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanGraph

Titan graph database implementation of the Blueprint's interface.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.database.serialize

Class and Description

PropertyKey

PropertyKey is an extension of RelationType for properties.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.internal

Class and Description

Idfiable

Represents an entity that can be uniquely identified by a long id.

Multiplicity

The multiplicity of edges between vertices for a given label.

Namifiable

Represents an entity that can be uniquely identified by a String name.

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexQuery

A TitanVertexQuery is a VertexQuery executed for a single vertex.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.log

Class and Description

TitanException

Most general type of exception thrown by the Titan graph database.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.olap

Class and Description

BaseVertexQuery

BaseVertexQuery constructs and executes a query over incident edges or properties from the perspective of a vertex.

RelationType

RelationType defines the schema for TitanRelation.

TitanGraph

Titan graph database implementation of the Blueprint's interface.

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.olap.computer

Class and Description

Idfiable

Represents an entity that can be uniquely identified by a long id.

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanGraph

Titan graph database implementation of the Blueprint's interface.

TitanGraphComputer

TitanProperty

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.olap.job

Class and Description

RelationType

RelationType defines the schema for TitanRelation.

TitanGraph

Titan graph database implementation of the Blueprint's interface.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.query

Class and Description

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanEdge

A TitanEdge connects two TitanVertex.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.query.condition

Class and Description

RelationType

RelationType defines the schema for TitanRelation.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.query.graph

Class and Description

PropertyKey

PropertyKey is an extension of RelationType for properties.

TitanEdge

A TitanEdge connects two TitanVertex.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanGraphQuery

Constructs a query against a mixed index to retrieve all elements (either vertices or edges)
 that match all conditions.

TitanIndexQuery

A GraphQuery that queries for graph elements directly against a particular indexing backend and hence allows this
 query mechanism to exploit the full range of features and functionality of the indexing backend.

TitanIndexQuery.Result

Container of a query result with its score.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.query.vertex

Class and Description

BaseVertexQuery

BaseVertexQuery constructs and executes a query over incident edges or properties from the perspective of a vertex.

RelationType

RelationType defines the schema for TitanRelation.

TitanEdge

A TitanEdge connects two TitanVertex.

TitanMultiVertexQuery

A MultiVertexQuery is identical to a TitanVertexQuery but executed against a set of vertices simultaneously.

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

TitanVertexQuery

A TitanVertexQuery is a VertexQuery executed for a single vertex.

VertexList

List of TitanVertexs.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.relations

Class and Description

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

Idfiable

Represents an entity that can be uniquely identified by a long id.

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanEdge

A TitanEdge connects two TitanVertex.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanProperty

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.schema

Class and Description

Cardinality

The cardinality of the values associated with given key for a particular element.

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

Multiplicity

The multiplicity of edges between vertices for a given label.

PropertyKey

PropertyKey is an extension of RelationType for properties.

TitanGraph

Titan graph database implementation of the Blueprint's interface.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.tinkerpop

Class and Description

Cardinality

The cardinality of the values associated with given key for a particular element.

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanGraph

Titan graph database implementation of the Blueprint's interface.

TitanGraphQuery

Constructs a query against a mixed index to retrieve all elements (either vertices or edges)
 that match all conditions.

TitanGraphTransaction

TitanGraphTransaction defines a transactional context for a TitanGraph.

TitanIndexQuery

A GraphQuery that queries for graph elements directly against a particular indexing backend and hence allows this
 query mechanism to exploit the full range of features and functionality of the indexing backend.

TitanMultiVertexQuery

A MultiVertexQuery is identical to a TitanVertexQuery but executed against a set of vertices simultaneously.

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.tinkerpop.optimize

Class and Description

BaseVertexQuery

BaseVertexQuery constructs and executes a query over incident edges or properties from the perspective of a vertex.

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.transaction

Class and Description

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanEdge

A TitanEdge connects two TitanVertex.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanGraphTransaction

TitanGraphTransaction defines a transactional context for a TitanGraph.

TitanIndexQuery

A GraphQuery that queries for graph elements directly against a particular indexing backend and hence allows this
 query mechanism to exploit the full range of features and functionality of the indexing backend.

TitanMultiVertexQuery

A MultiVertexQuery is identical to a TitanVertexQuery but executed against a set of vertices simultaneously.

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

TransactionBuilder

Constructor returned by TitanGraph.buildTransaction() to build a new transaction.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.transaction.indexcache

Class and Description

PropertyKey

PropertyKey is an extension of RelationType for properties.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.types

Class and Description

Cardinality

The cardinality of the values associated with given key for a particular element.

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

Idfiable

Represents an entity that can be uniquely identified by a long id.

Multiplicity

The multiplicity of edges between vertices for a given label.

Namifiable

Represents an entity that can be uniquely identified by a String name.

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.types.indextype

Class and Description

Cardinality

The cardinality of the values associated with given key for a particular element.

PropertyKey

PropertyKey is an extension of RelationType for properties.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.types.system

Class and Description

Cardinality

The cardinality of the values associated with given key for a particular element.

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

Idfiable

Represents an entity that can be uniquely identified by a long id.

Multiplicity

The multiplicity of edges between vertices for a given label.

Namifiable

Represents an entity that can be uniquely identified by a String name.

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanEdge

A TitanEdge connects two TitanVertex.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.types.typemaker

Class and Description

Cardinality

The cardinality of the values associated with given key for a particular element.

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

PropertyKey

PropertyKey is an extension of RelationType for properties.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.types.vertices

Class and Description

Cardinality

The cardinality of the values associated with given key for a particular element.

EdgeLabel

EdgeLabel is an extension of RelationType for edges.

Idfiable

Represents an entity that can be uniquely identified by a long id.

Multiplicity

The multiplicity of edges between vertices for a given label.

Namifiable

Represents an entity that can be uniquely identified by a String name.

PropertyKey

PropertyKey is an extension of RelationType for properties.

RelationType

RelationType defines the schema for TitanRelation.

TitanEdge

A TitanEdge connects two TitanVertex.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.util

Class and Description

PropertyKey

PropertyKey is an extension of RelationType for properties.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.graphdb.vertices

Class and Description

Idfiable

Represents an entity that can be uniquely identified by a long id.

PropertyKey

PropertyKey is an extension of RelationType for properties.

TitanEdge

A TitanEdge connects two TitanVertex.

TitanElement

TitanElement represents the abstract concept of an entity in the graph and specifies basic methods for interacting
 with entities.

TitanRelation

TitanRelation is the most abstract form of a relation between a vertex and some other entity, where
 relation is understood in its mathematical sense.

TitanVertex

TitanVertex is the basic unit of a TitanGraph.

TitanVertexProperty

TitanProperty is a TitanRelation connecting a vertex to a value.

VertexLabel

A vertex label is a label attached to vertices in a Titan graph.

Classes in com.thinkaurelius.titan.core used by com.thinkaurelius.titan.util.system

Class and Description

TitanTransaction

TitanTransaction defines a transactional context for a TitanGraph.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2012–2015. All rights reserved.


text:
package gov.nasa.jpf.test.java.net;

import gov.nasa.jpf.util.test.TestJPF;

import java.net.URLDecoder;
import java.net.URLEncoder;

import org.junit.Test;

/**
 * regression test for URLEncoder/Decoder
 */
public class URLEncoderTest extends TestJPF {

  /************************** test methods ************************/
  @Test
  public void testEncodeCycle (){
    if (verifyNoPropertyViolation()){
      String s = "< what a mess >";
      String enc = "UTF-8";

      try {
        System.out.println("original: " + s);
        String e = URLEncoder.encode(s, enc);
        System.out.println("encoded:  " + e);
        String d = URLDecoder.decode(e,enc);
        System.out.println("decoded:  " + d);

        assert s.equals(d) : "encode/decode roundtrip failed";

      } catch (Throwable t){
        fail("unexpected exception: " + t);
      }
    }
  }

  @Test
  public void testEncodingException (){
    if (verifyNoPropertyViolation()){
      String s = "< what a mess >";
      String enc = "wrgsGrff";

      try {
        System.out.println("original: " + s);
        String e = URLEncoder.encode(s, enc);
        System.out.println("encoded:  " + e);

        fail("this is really not a known encoding: " + enc);

      } catch (java.io.UnsupportedEncodingException x){
        System.out.println("rightfully throws " + x);
      }
    }
  }
}


text:
import re
from ._base import DirectiveParser, BaseDirective

__all__ = ['FencedDirective']

_directive_re = re.compile(
    r'\{(?P<name>[a-zA-Z0-9_-]+)\} *(?P<title>[^\n]*)(?:\n|$)'
    r'(?P<options>(?:\:[a-zA-Z0-9_-]+\: *[^\n]*\n+)*)'
    r'\n*(?P<text>(?:[^\n]*\n+)*)'
)

class FencedParser(DirectiveParser):
    NAME = 'fenced_directive'

    @staticmethod
    def parse_name(m: re.Match):
        return m.group('name')

    @staticmethod
    def parse_title(m: re.Match):
        return m.group('title')

    @staticmethod
    def parse_content(m: re.Match):
        return m.group('text')

class FencedDirective(BaseDirective):
    """A **fenced** style of directive looks like a fenced code block, it is
    inspired by markdown-it-docutils. The syntax looks like:

    .. code-block:: text

        ```{directive-name} title
        :option-key: option value
        :option-key: option value

        content text here
        ```

    To use ``FencedDirective``, developers can add it into plugin list in
    the :class:`Markdown` instance:

    .. code-block:: python

        import mistune
        from mistune.directives import FencedDirective, Admonition

        md = mistune.create_markdown(plugins=[
            # ...
            FencedDirective([Admonition()]),
        ])

    FencedDirective is using >= 3 backticks or curly-brackets for the fenced
    syntax. Developers can change it to other characters, e.g. colon:

    .. code-block:: python

            directive = FencedDirective([Admonition()], ':')

    And then the directive syntax would look like:

    .. code-block:: text

        ::::{note} Nesting directives
        You can nest directives by ensuring the start and end fence matching
        the length. For instance, in this example, the admonition is started
        with 4 colons, then it should end with 4 colons.

        You can nest another admonition with other length of colons except 4.

        :::{tip} Longer outermost fence
        It would be better that you put longer markers for the outer fence,
        and shorter markers for the inner fence. In this example, we put 4
        colons outsie, and 3 colons inside.
        :::
        ::::

    :param plugins: list of directive plugins
    :param markers: characters to determine the fence, default is backtick
                    and curly-bracket
    """
    parser = FencedParser
    register_before = 'fenced_code'

    def __init__(self, plugins, markers='`~'):
        super(FencedDirective, self).__init__(plugins)
        _marker_pattern = '|'.join(re.escape(c) for c in markers)
        self.directive_pattern = (
            r'^(?P<fenced_directive_mark>(?:' + _marker_pattern + r'){3,})'
            r'\{[a-zA-Z0-9_-]+\}'
        )

    def parse_directive(self, block, m, state):
        marker = m.group('fenced_directive_mark')
        mlen = len(marker)
        _end_pattern = (
            r'^ {0,3}' + marker[0] + '{' + str(mlen) + r',}'
            r'[ \t]*(?:\n|$)'
        )
        _end_re = re.compile(_end_pattern, re.M)
        cursor_start = m.start() + mlen

        _end_m = _end_re.search(state.src, cursor_start)
        if _end_m:
            text = state.src[cursor_start:_end_m.start()]
            end_pos = _end_m.end()
        else:
            text = state.src[cursor_start:]
            end_pos = state.cursor_max

        _new_m = _directive_re.match(text)
        if not _new_m:
            return

        name = _new_m.group('name')
        self.parse_method(name, block, _new_m, state)
        return end_pos


text:
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
#endif

#endif


text:
#import <CoreGraphics/CGEvent.h>

@implementation CGEvent

@end


text:
(function () {
	"use strict";

	var bConfig = require('./config.js');
	var siteBuilder = require('./builder.js');

	var preview = {

        modalPreview: document.getElementById('previewModal'),
        buttonPreview: document.getElementById('buttonPreview'),

        init: function() {

            //events
            $(this.modalPreview).on('shown.bs.modal', this.prepPreview);
            $(this.modalPreview).on('show.bs.modal', this.prepPreviewLink);

            //reveal preview button
            $(this.buttonPreview).show();

        },

        /*
            prepares the preview data
        */
        prepPreview: function() {

            $('#previewModal form input[type="hidden"]').remove();

            //build the page
            siteBuilder.site.activePage.fullPage();

            var newInput;

            //markup
            newInput = $('<input type="hidden" name="page" value="">');
            $('#previewModal form').prepend( newInput );
            newInput.val( "<html>"+$('iframe#skeleton').contents().find('html').html()+"</html>" );

            //page title
            newInput = $('<input type="hidden" name="meta_title" value="">');
            $('#previewModal form').prepend( newInput );
            newInput.val( siteBuilder.site.activePage.pageSettings.title );
            //alert(JSON.stringify(siteBuilder.site.activePage.pageSettings));

            //page meta description
            newInput = $('<input type="hidden" name="meta_description" value="">');
            $('#previewModal form').prepend( newInput );
            newInput.val( siteBuilder.site.activePage.pageSettings.meta_description );

            //page meta keywords
            newInput = $('<input type="hidden" name="meta_keywords" value="">');
            $('#previewModal form').prepend( newInput );
            newInput.val( siteBuilder.site.activePage.pageSettings.meta_keywords );

            //page header includes
            newInput = $('<input type="hidden" name="header_includes" value="">');
            $('#previewModal form').prepend( newInput );
            newInput.val( siteBuilder.site.activePage.pageSettings.header_includes );

            //page css
            newInput = $('<input type="hidden" name="page_css" value="">');
            $('#previewModal form').prepend( newInput );
            newInput.val( siteBuilder.site.activePage.pageSettings.page_css );

            //site ID
            newInput = $('<input type="hidden" name="siteID" value="">');
            $('#previewModal form').prepend( newInput );
            newInput.val( siteBuilder.site.data.id );

            //CSRF token
            newInput = $('<input type="hidden" name="_token" value="">');
            $('#previewModal form').prepend( newInput );
            newInput.val( $('meta[name="csrf-token"]').attr('content') );

        },

        /*
            prepares the actual preview link
        */
        prepPreviewLink: function() {

            $('#pagePreviewLink').attr( 'href', $('#pagePreviewLink').attr('data-defurl')+$('#pages li.active a').text() );

        }

    };

    preview.init();

}());


text:
package jsp;

import lombok.Builder;
import lombok.Value;

import java.util.Calendar;

/**
 * Class User.
 *
 * @author Andrey Lemdyanov {lemdyanov5@mail.ru)
 * @version $Id$
 * @since 16.05.2018
 */
@Builder
@Value
public class User {

    private int id;
    private String name;
    private String login;
    private String password;
    private String email;
    private Calendar createDate;
    private Role role;
    private String country;
    private String city;

}


text:
<?php

$model->protect(false)
    ->insert($data)
    ->protect(true);


text:
<?php

namespace Soda\Cms\InterfaceBuilder\Forms\Fields;

use Soda\Cms\InterfaceBuilder\Forms\AbstractFormField;

class StaticImage extends AbstractFormField
{
    protected $view = 'static_image';
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using log4net;

namespace spectator.Sources.PerformanceCounters
{
    public class PerformanceCounterSource : IQueryableSource
    {
        private static readonly ILog Log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        private readonly IPerformanceCounterRegistry _registry;
        private readonly IPerformanceCounterCategoryRepository _categoryRepository;

        public PerformanceCounterSource(IPerformanceCounterRegistry registry, IPerformanceCounterCategoryRepository categoryRepository)
        {
            _registry = registry;
            _categoryRepository = categoryRepository;
        }

        public IEnumerable<Sample> QueryValue(string path)
        {
            try
            {
                var samples = new List<Sample>();
                var definition = new PerformanceCounterDefinition(path);

                if (definition.AllInstances)
                {
                    var instances = _categoryRepository.GetInstances(definition.CategoryName);

                    foreach (var instance in instances)
                    {
                        var value = _registry.Read(definition.CategoryName, definition.CounterName, instance);

                        if (value.HasValue)
                        {
                            samples.Add(new Sample(instance, value.Value));
                        }
                    }
                }
                else
                {
                    var value = _registry.Read(definition.CategoryName, definition.CounterName, definition.InstanceName);

                    if (value.HasValue)
                    {
                        samples.Add(new Sample(definition.InstanceName, value.Value));
                    }
                }

                return samples;
            }
            catch (Exception ex)
            {
                ex.Data.Add("Path", path);
                Log.Error("Exception occurred querying performance counter", ex);
            }

            return Enumerable.Empty<Sample>();
        }
    }
}


text:
static secp256k1_context_t* secp256k1_context = NULL;

bool CKey::Check(const unsigned char *vch) {
    return eccrypto::Check(vch);
}

void CKey::MakeNewKey(bool fCompressedIn) {
    do {
        GetRandBytes(vch, sizeof(vch));
    } while (!Check(vch));
    fValid = true;
    fCompressed = fCompressedIn;
}

bool CKey::SetPrivKey(const CPrivKey &privkey, bool fCompressedIn) {
    if (!secp256k1_ec_privkey_import(secp256k1_context, (unsigned char*)begin(), &privkey[0], privkey.size()))
        return false;
    fCompressed = fCompressedIn;
    fValid = true;
    return true;
}

CPrivKey CKey::GetPrivKey() const {
    assert(fValid);
    CPrivKey privkey;
    int privkeylen, ret;
    privkey.resize(279);
    privkeylen = 279;
    ret = secp256k1_ec_privkey_export(secp256k1_context, begin(), (unsigned char*)&privkey[0], &privkeylen, fCompressed);
    assert(ret);
    privkey.resize(privkeylen);
    return privkey;
}

CPubKey CKey::GetPubKey() const {
    assert(fValid);
    CPubKey result;
    int clen = 65;
    int ret = secp256k1_ec_pubkey_create(secp256k1_context, (unsigned char*)result.begin(), &clen, begin(), fCompressed);
    assert((int)result.size() == clen);
    assert(ret);
    assert(result.IsValid());
    return result;
}

CPubKey CKey::ECDH(const CPubKey& pubkey) const {
    assert(fValid);
    CPubKey result = pubkey;
    int clen = result.size();
    int ret = secp256k1_point_multiply((unsigned char*)result.begin(), &clen, begin());
    assert((int)result.size() == clen);
    assert(ret);
    assert(result.IsValid());
    return result;
}

bool CKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, uint32_t test_case) const {
    if (!fValid)
        return false;
    vchSig.resize(72);
    int nSigLen = 64;
    unsigned char extra_entropy[32] = {0};
    WriteLE32(extra_entropy, test_case);
    int ret = secp256k1_schnorr_sign(secp256k1_context, hash.begin(), (unsigned char*)&vchSig[0], begin(), secp256k1_nonce_function_rfc6979, test_case ? extra_entropy : NULL);
    assert(ret);
    vchSig.resize(nSigLen);
    return true;
}

bool CKey::VerifyPubKey(const CPubKey& pubkey) const {
    if (pubkey.IsCompressed() != fCompressed) {
        return false;
    }
    unsigned char rnd[8];
    std::string str = "Bitcoin key verification\n";
    GetRandBytes(rnd, sizeof(rnd));
    uint256 hash;
    CHash256().Write((unsigned char*)str.data(), str.size()).Write(rnd, sizeof(rnd)).Finalize((unsigned char*)&hash);
    std::vector<unsigned char> vchSig;
    Sign(hash, vchSig);
    return pubkey.Verify(hash, vchSig);
}

bool CKey::SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig) const {
    if (!fValid)
        return false;
    vchSig.resize(65);
    int rec = -1;
    int ret = secp256k1_ecdsa_sign_compact(secp256k1_context, hash.begin(), &vchSig[1], begin(), secp256k1_nonce_function_rfc6979, NULL, &rec);
    assert(ret);
    assert(rec != -1);
    vchSig[0] = 27 + rec + (fCompressed ? 4 : 0);
    return true;
}

bool CKey::Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck=false) {
    if (!secp256k1_ec_privkey_import(secp256k1_context, (unsigned char*)begin(), &privkey[0], privkey.size()))
        return false;
    fCompressed = vchPubKey.IsCompressed();
    fValid = true;

    if (fSkipCheck)
        return true;

    return VerifyPubKey(vchPubKey);
}

bool CKey::Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const {
    assert(IsValid());
    assert(IsCompressed());
    unsigned char out[64];
    LockObject(out);
    if ((nChild >> 31) == 0) {
        CPubKey pubkey = GetPubKey();
        assert(pubkey.begin() + 33 == pubkey.end());
        BIP32Hash(cc, nChild, *pubkey.begin(), pubkey.begin()+1, out);
    } else {
        assert(begin() + 32 == end());
        BIP32Hash(cc, nChild, 0, begin(), out);
    }
    memcpy(ccChild, out+32, 32);
    memcpy((unsigned char*)keyChild.begin(), begin(), 32);
    bool ret = secp256k1_ec_privkey_tweak_add(secp256k1_context, (unsigned char*)keyChild.begin(), out);
    UnlockObject(out);
    keyChild.fCompressed = true;
    keyChild.fValid = ret;
    return ret;
}

bool CExtKey::Derive(CExtKey &out, unsigned int nChild) const {
    out.nDepth = nDepth + 1;
    CKeyID id = key.GetPubKey().GetID();
    memcpy(&out.vchFingerprint[0], &id, 4);
    out.nChild = nChild;
    return key.Derive(out.key, out.vchChainCode, nChild, vchChainCode);
}

void CExtKey::SetMaster(const unsigned char *seed, unsigned int nSeedLen) {
    static const unsigned char hashkey[] = {'B','i','t','c','o','i','n',' ','s','e','e','d'};
    unsigned char out[64];
    LockObject(out);
    CHMAC_SHA512(hashkey, sizeof(hashkey)).Write(seed, nSeedLen).Finalize(out);
    key.Set(&out[0], &out[32], true);
    memcpy(vchChainCode, &out[32], 32);
    UnlockObject(out);
    nDepth = 0;
    nChild = 0;
    memset(vchFingerprint, 0, sizeof(vchFingerprint));
}

CExtPubKey CExtKey::Neuter() const {
    CExtPubKey ret;
    ret.nDepth = nDepth;
    memcpy(&ret.vchFingerprint[0], &vchFingerprint[0], 4);
    ret.nChild = nChild;
    ret.pubkey = key.GetPubKey();
    memcpy(&ret.vchChainCode[0], &vchChainCode[0], 32);
    return ret;
}

void CExtKey::Encode(unsigned char code[74]) const {
    code[0] = nDepth;
    memcpy(code+1, vchFingerprint, 4);
    code[5] = (nChild >> 24) & 0xFF; code[6] = (nChild >> 16) & 0xFF;
    code[7] = (nChild >>  8) & 0xFF; code[8] = (nChild >>  0) & 0xFF;
    memcpy(code+9, vchChainCode, 32);
    code[41] = 0;
    assert(key.size() == 32);
    memcpy(code+42, key.begin(), 32);
}

void CExtKey::Decode(const unsigned char code[74]) {
    nDepth = code[0];
    memcpy(vchFingerprint, code+1, 4);
    nChild = (code[5] << 24) | (code[6] << 16) | (code[7] << 8) | code[8];
    memcpy(vchChainCode, code+9, 32);
    key.Set(code+42, code+74, true);
}

bool ECC_InitSanityCheck() {
    CKey key;
    key.MakeNewKey(true);
    CPubKey pubkey = key.GetPubKey();
    return key.VerifyPubKey(pubkey);
}

void ECC_Start() {
    assert(secp256k1_context == NULL);

    secp256k1_context_t *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);
    assert(ctx != NULL);

    {
        // Pass in a random blinding seed to the secp256k1 context.
        unsigned char seed[32];
        LockObject(seed);
        GetRandBytes(seed, 32);
        bool ret = secp256k1_context_randomize(ctx, seed);
        assert(ret);
        UnlockObject(seed);
    }

    secp256k1_context = ctx;
}

void ECC_Stop() {
    secp256k1_context_t *ctx = secp256k1_context;
    secp256k1_context = NULL;

    if (ctx) {
        secp256k1_context_destroy(ctx);
    }
}


text:
require "spec_helper"

module ThreeLittlePigs
  module Chapters
    RSpec.describe Chapter03PigsLeaveTheHouse do
      let(:story) { Story.until_chapter(described_class) }
      let(:mother_pig) { story.mother_pig }

      before { described_class.tell(story) }

      specify "the mother pig did not have enough to keep her children" do
        expect(mother_pig.wealth).not_to eq(Wealth.level(:enough))
      end

      specify "the mother pig sent the three little pigs away" do
        expect(mother_pig.house.occupants).to eq([mother_pig])
      end
    end
  end
end


text:
class GURL;
class Profile;

namespace ash {

enum PrintServerQueryResult {
  kNoErrors = 0,
  kIncorrectUrl,
  kConnectionError,
  kHttpError,
  kCannotParseIppResponse
};

// Instances of this class are used to query list of available printers from
// given print server. The constructor posts to an internal task runner
// a procedure responsible for building and sending the query request. When the
// response is obtained and parsed, the callback passed as a constructor's
// parameter is posted on the same sequence that constructor was called from.
// The object can be safely destroyed during query execution and on any
// sequence/thread.
class ServerPrintersFetcher {
 public:
  // The callback: |sender| is a pointer to the object calling the callback,
  // |printers| is a list of queried printers.
  using OnPrintersFetchedCallback = base::RepeatingCallback<void(
      const ServerPrintersFetcher* sender,
      const GURL& server_url,
      std::vector<PrinterDetector::DetectedPrinter>&& printers)>;

  ServerPrintersFetcher(Profile* profile,
                        const GURL& server_url,
                        const std::string& server_name,
                        OnPrintersFetchedCallback cb);

  ServerPrintersFetcher(const ServerPrintersFetcher&) = delete;
  ServerPrintersFetcher& operator=(const ServerPrintersFetcher&) = delete;

  virtual ~ServerPrintersFetcher();

  PrintServerQueryResult GetLastError() const;

 private:
  // Forward declaration of a type of an internal object.
  class PrivateImplementation;
  // Deleter of the internal object (called when unique_ptr is deleted).
  struct PimDeleter {
    void operator()(PrivateImplementation* pim) const;
  };
  // Internal object.
  std::unique_ptr<PrivateImplementation, PimDeleter> pim_;
};

}  // namespace ash

#endif  // CHROME_BROWSER_ASH_PRINTING_SERVER_PRINTERS_FETCHER_H_


text:
using System;
using System.Runtime.InteropServices;
using GraphX.Measure;
using Point = Windows.Foundation.Point;
using Rect = Windows.Foundation.Rect;
using Size = Windows.Foundation.Size;

namespace GraphX.Controls
{
  internal static class DoubleHelper
  {
    public static bool AreVirtuallyEqual( double d1, double d2 )
    {
      if( double.IsPositiveInfinity( d1 ) )
        return double.IsPositiveInfinity( d2 );

      if( double.IsNegativeInfinity( d1 ) )
        return double.IsNegativeInfinity( d2 );

      if( IsNaN( d1 ) )
        return IsNaN( d2 );

      var n = d1 - d2;
      var d = ( Math.Abs( d1 ) + Math.Abs( d2 ) + 10 ) * 1.0e-15;
      return ( -d < n ) && ( d > n );
    }

    public static bool AreVirtuallyEqual( Size s1, Size s2 )
    {
      return ( AreVirtuallyEqual( s1.Width, s2.Width )
          && AreVirtuallyEqual( s1.Height, s2.Height ) );
    }

    public static bool AreVirtuallyEqual( Point p1, Point p2 )
    {
      return ( AreVirtuallyEqual( p1.X, p2.X )
          && AreVirtuallyEqual( p1.Y, p2.Y ) );
    }

    public static bool AreVirtuallyEqual( Rect r1, Rect r2 )
    {
      return ( AreVirtuallyEqual( r1.TopLeft(), r2.TopLeft() )
          && AreVirtuallyEqual( r1.BottomRight(), r2.BottomRight() ) );
    }

    public static bool AreVirtuallyEqual( Vector v1, Vector v2 )
    {
      return ( AreVirtuallyEqual( v1.X, v2.X )
          && AreVirtuallyEqual( v1.Y, v2.Y ) );
    }

    public static bool IsNaN( double value )
    {
      // used reflector to borrow the high performance IsNan function
      // from the WPF MS.Internal namespace
      var t = new NanUnion {DoubleValue = value};

        var exp = t.UintValue & 0xfff0000000000000;
      var man = t.UintValue & 0x000fffffffffffff;

      return ( exp == 0x7ff0000000000000 || exp == 0xfff0000000000000 ) && ( man != 0 );
    }

    #region NanUnion Nested Types

    [StructLayout( LayoutKind.Explicit )]
    private struct NanUnion
    {
      [FieldOffset( 0 )]
      internal double DoubleValue;
      [FieldOffset( 0 )]
      internal UInt64 UintValue;
    }

    #endregion
  }
}


text:
import { Component, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';

import { ViewController, NavParams, Searchbar } from 'ionic-angular';

import { Store } from '@ngrx/store';
import { AppState } from '../../store/root.reducer';
import { SearchActions } from '../store';

@Component({
  styles:[],
  template: `
    <ion-header>
      <ion-navbar>
        <ion-title>
          Search
        </ion-title>
        <ion-buttons right>
          <button ion-button icon-only *ngIf="searchLoading | async">
            <ion-icon color="yellow" name="cloud"></ion-icon>
          </button>
          <button ion-button icon-only (click)="closeModal(null)">
            <ion-icon name="close"></ion-icon>
          </button>
        </ion-buttons>
      </ion-navbar>
    </ion-header>
    <ion-content padding class="marginTopAdjusted">
      <ion-searchbar
        [showCancelButton]=false
        (input)="searchInput.next($event.target.value)"
      >
      </ion-searchbar>
      <ion-list>
        <ion-item class="is-hoverable is-displayBlock" (click)="toggleExpand()">
          Search:
          ({{locationsCount}}/{{(searchLocations | async).length}})
          <ion-icon item-right name="arrow-dropdown"></ion-icon>
        </ion-item>
        <ion-item *ngFor="let collection of searchLocations | async; let i = index;" [hidden]="!locationsToggle">
          <ion-label>{{collection.key | capitalizeFirst}}</ion-label>
          <ion-checkbox [ngModel]="collection.check" (ngModelChange)="check(collection.key,$event)">
          </ion-checkbox>
        </ion-item>
        <ion-item>
          Results
          No results
          {{(searchResults | async).length}} results
        </ion-item>

          <ion-item class="is-hoverable">
            {{result.label}}
            {{result.key}}
          </ion-item>

      </ion-list>
    </ion-content>
  `
})
export class SearchModalComponent {

  @ViewChild(Searchbar) searchBar : Searchbar;
  searchInput = new Subject<string>();
  searchLoading = this.store.select(store => (store as any).search.search_loading);
  searchTerm = this.store.select(store => (store as any).search.search_term);
  searchLocations : Observable<any> = this.store.select(store => (store as any).search.search_locations);
  searchParams = Observable.combineLatest(
    this.searchTerm,
    this.searchLocations.flatMap(colls=> {
      return Observable.of(colls.filter((x) => x.check));
    }),
    (term, locations)=>({term,locations}));
  locationsToggle = false;
  locationsCount = 0;

  searchResults = this.store.select(store => (store as any).search.search_results)
  .filter(res=> {
    if (res !== undefined) { return true;}
  });

  constructor(
    private store: Store<AppState>,
    private params: NavParams,
    private viewCtrl: ViewController
  ) {

    // Toggle the state back to initial state to allow future triggers work
    this.store.dispatch(new SearchActions.SearchModalToggle(false));

    const [blankInput, filledInput] =
    this.searchInput.debounceTime(300).partition(value => value.length <= 0);
    blankInput.subscribe((blank) => {this.store.dispatch(new SearchActions.SetSearchTerm('XYZ'));});
    filledInput
      .distinctUntilChanged()
      .filter(term => term.length > 2)
      .subscribe((term) => {
        this.store.dispatch(new SearchActions.SetSearchTerm(term));
      });

    this.searchParams.subscribe(params=> {
      this.locationsCount = params.locations.length;
      if(params.term && (params.term.length > 0) && (params.locations.length > 0)) {
        this.store.dispatch(new SearchActions.Search());
      }
    });

  }

  ngOnInit() {
    this.searchBar.setFocus();
  }

  check(key,newState) {
    this.store.dispatch(new SearchActions.ToggleSearchLocation({key:key,check:newState}));
  }

  closeModal(data) {
    this.viewCtrl.dismiss(data);
  }

  toggleExpand() {
    this.locationsToggle = !this.locationsToggle;
  }

}


text:
describe('chrome service', function () {
    var barFunc = function () {},
        fooObject = {foo: 777},
        fooString = 'foo';

    beforeEach(module('app.core'));

    beforeEach(function (done) {
        chrome = {
            runtime: {
                sendMessage: function () {},
                onMessage: {
                    addListener: function () {}
                },
                lastError: fooString
            },
            extension: {
                sendRequest: function () {}
            },
            tabs: {
                sendMessage: function () {},
                create: function () {},
                get: function () {},
                update: function () {},
                query: function () {},
                captureVisibleTab: function () {}
            },
            storage: {
                sync: {
                    get: function () {},
                    set: function () {}
                }
            },
            windows: {
                create: function () {},
                get: function () {},
                update: function () {},
            }
        };

        spyOn(chrome.runtime, 'sendMessage');
        spyOn(chrome.tabs, 'sendMessage');
        spyOn(chrome.extension, 'sendRequest');

        spyOn(chrome.storage.sync, 'get');
        spyOn(chrome.storage.sync, 'set');

        spyOn(chrome.runtime.onMessage, 'addListener');

        spyOn(chrome.windows, 'create');
        spyOn(chrome.windows, 'get');
        spyOn(chrome.windows, 'update');

        spyOn(chrome.tabs, 'create');
        spyOn(chrome.tabs, 'get');
        spyOn(chrome.tabs, 'update');
        spyOn(chrome.tabs, 'query');
        spyOn(chrome.tabs, 'captureVisibleTab');

        done();
    });

    beforeEach(function (done) {
        inject(function (chromeService) {
            chromeService.sendRequest(fooString, fooObject, function () {});
            chromeService.sendMessage(fooString, fooObject, function () {});
            chromeService.sendMessageToTab(777, fooString, fooObject, function () {});

            chromeService.setStorage(fooObject);
            chromeService.getStorage(fooObject);

            chromeService.addMessageListener({foo: function () {}});

            chromeService.createWindow(fooObject);
            chromeService.createWindow(fooObject, barFunc);
            chromeService.getWindow(777);
            chromeService.getWindow(777, barFunc);
            chromeService.updateWindow(777, fooObject);

            chromeService.createTab(fooObject);
            chromeService.createTab(fooObject, barFunc);
            chromeService.getTab(777);
            chromeService.getTab(777, barFunc);
            chromeService.updateTab(777, fooObject);
            chromeService.queryTab(fooObject);
            chromeService.queryTab(fooObject, barFunc);
            chromeService.captureVisibleTab(777, fooObject);
            chromeService.captureVisibleTab(777, fooObject, barFunc);

            lastError = chromeService.getLastError();

            done();
        });
    });

    it('format of sent runtime message was right', function () {
        expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({type: fooString, data: fooObject}, jasmine.any(Function));
    });

    it('format of sent tab message was right', function () {
        expect(chrome.tabs.sendMessage).toHaveBeenCalledWith(777, {type: fooString, data: fooObject}, jasmine.any(Function));
    });

    it('format of sent extension request was right', function () {
        expect(chrome.extension.sendRequest).toHaveBeenCalledWith({command: fooString, params: fooObject}, jasmine.any(Function));
    });

    it('chrome.storage.sync.get was called', function () {
        expect(chrome.storage.sync.get).toHaveBeenCalledWith(fooObject, undefined);
    });

    it('chrome.storage.sync.set was called', function () {
        expect(chrome.storage.sync.set).toHaveBeenCalledWith(fooObject, undefined);
    });

    it('chrome.runtime.onMessage.addListener was called with right arguments', function () {
        expect(chrome.runtime.onMessage.addListener).toHaveBeenCalledWith(jasmine.any(Function));
    });

    it('chrome.windows.create was called', function () {
        expect(chrome.windows.create).toHaveBeenCalledWith(fooObject, undefined);
    });

    it('chrome.windows.create was called with callback', function () {
        expect(chrome.windows.create).toHaveBeenCalledWith(fooObject, barFunc);
    });

    it('chrome.windows.get was called', function () {
        expect(chrome.windows.get).toHaveBeenCalledWith(777, undefined);
    });

    it('chrome.windows.get was called with callback', function () {
        expect(chrome.windows.get).toHaveBeenCalledWith(777, barFunc);
    });

    it('chrome.windows.update was called', function () {
        expect(chrome.windows.update).toHaveBeenCalledWith(777, fooObject);
    });

    it('chrome.tabs.create was called', function () {
        expect(chrome.tabs.create).toHaveBeenCalledWith(fooObject, undefined);
    });

    it('chrome.tabs.create was called with callback', function () {
        expect(chrome.tabs.create).toHaveBeenCalledWith(fooObject, barFunc);
    });

    it('chrome.tabs.get was called', function () {
        expect(chrome.tabs.get).toHaveBeenCalledWith(777, undefined);
    });

    it('chrome.tabs.get was called with callback', function () {
        expect(chrome.tabs.get).toHaveBeenCalledWith(777, barFunc);
    });

    it('chrome.tabs.update was called', function () {
        expect(chrome.tabs.update).toHaveBeenCalledWith(777, fooObject);
    });

    it('chrome.tabs.query was called', function () {
        expect(chrome.tabs.query).toHaveBeenCalledWith(fooObject, undefined);
    });

    it('chrome.tabs.query was called with callback', function () {
        expect(chrome.tabs.query).toHaveBeenCalledWith(fooObject, barFunc);
    });

    it('chrome.tabs.captureVisibleTab was called', function () {
        expect(chrome.tabs.captureVisibleTab).toHaveBeenCalledWith(777, fooObject, undefined);
    });

    it('chrome.tabs.captureVisibleTab was called with callback', function () {
        expect(chrome.tabs.captureVisibleTab).toHaveBeenCalledWith(777, fooObject, barFunc);
    });

    it('chrome.runtime.getLastError was referenced', function () {
        expect(lastError).toBe(fooString);
    });
});


text:
class CreateContentActivations < ActiveRecord::Migration
  def change
    create_table :content_activations do |t|
      t.integer :user_id, :null => false
      t.integer :content_bucket_id, :null => false

      t.timestamps
    end

    add_index :content_activations, [:user_id, :content_bucket_id], :unique => true

  end
end


text:
function channels = smoothAngleChannels(channels, skel);

% SMOOTHANGLECHANNELS Try and remove artificial discontinuities associated with angles.

% MOCAP

for i=1:length(skel.tree)
  for j=1:length(skel.tree(i).rotInd)
    col = skel.tree(i).rotInd(j);
    if col
      for k=2:size(channels, 1)
        diff=channels(k, col)-channels(k-1, col);
        if abs(diff+360)<abs(diff)
          channels(k:end, col)=channels(k:end, col)+360;
        elseif abs(diff-360)<abs(diff)
          channels(k:end, col)=channels(k:end, col)-360;
        end
      end
    end
  end
end


text:
<?php # -*- coding: utf-8 -*-

namespace Toobo\Matching\Exception;

/**
 * @author  Giuseppe Mazzapica <giuseppe.mazzapica@gmail.com>
 * @package Toobo\Matching
 * @license http://opensource.org/licenses/MIT MIT
 */
class InvalidBindTarget extends Exception
{

    /**
     * @var mixed
     */
    private $value;

    /**
     * @param mixed $value
     * @return InvalidBindTarget
     */
    public static function forValue($value): InvalidBindTarget
    {
        $instance = new static(
            sprintf('Only objects can be bound to callbacks; "%s" given.', gettype($value))
        );
        $instance->value = $value;

        return $instance;
    }

    public function offendingValue()
    {
        return $this->value;
    }

}


text:
package fm.liu.timo;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author xianmao.hexm
 */
public class EchoBioServer implements Runnable {

    private static final byte[] FIRST_BYTES = "Welcome to Timo Server.".getBytes();

    private final ServerSocket serverSocket;

    public EchoBioServer(int port) throws IOException {
        serverSocket = new ServerSocket(port);
    }

    @Override
    public void run() {
        while (true) {
            try {
                Socket socket = serverSocket.accept();
                new Thread(new BioConnection(socket)).start();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }

    private class BioConnection implements Runnable {

        private Socket       socket;
        private InputStream  input;
        private OutputStream output;
        private byte[]       readBuffer;
        private byte[]       writeBuffer;

        private BioConnection(Socket socket) throws IOException {
            this.socket = socket;
            this.input = socket.getInputStream();
            this.output = socket.getOutputStream();
            this.readBuffer = new byte[4096];
            this.writeBuffer = new byte[4096];
        }

        @Override
        public void run() {
            try {
                output.write(FIRST_BYTES);
                output.flush();
                while (true) {
                    int got = input.read(readBuffer);
                    output.write(writeBuffer, 0, got);
                    // output.flush();
                }
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                if (socket != null)
                    try {
                        socket.close();
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
            }
        }
    }

    public static void main(String[] args) throws Exception {
        new Thread(new EchoBioServer(8066)).start();
    }

}


text:
<!--
  ~ Copyright 2001-2006 The Apache Software Foundation.
  ~
  ~ 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.
  -->

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
  <id>moduleSet</id>
  <formats>
    <format>zip</format>
  </formats>
  <moduleSets>
    <moduleSet>
      <includes>
        <include>assembly:reactor-project-1</include>
      </includes>
      <sources/>
      <binaries/>
    </moduleSet>
  </moduleSets>
</assembly>


text:
<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "purchase_method".
 *
 * @property integer $id
 * @property string $name
 *
 * @property PurchaseMethod $id0
 * @property PurchaseMethod $purchaseMethod
 * @property SchedulePlan[] $schedulePlans
 */
class PurchaseMethod extends \yii\db\ActiveRecord
{
    public static function getDb()
    {
        return \Yii::$app->db6;
    }
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'purchase_method';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name'], 'string'],
            [['id'], 'exist', 'skipOnError' => true, 'targetClass' => PurchaseMethod::className(), 'targetAttribute' => ['id' => 'id']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Название',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getSchedulePlans()
    {
        return $this->hasMany(SchedulePlan::className(), ['pm_id' => 'id']);
    }
}


text:
#ifndef DATA_STRUCTS_LINKEDLISTS_TRAITS_ITERATOR_HH
#define DATA_STRUCTS_LINKEDLISTS_TRAITS_ITERATOR_HH

#ifdef DATA_STRUCTS_LINKEDLISTS_ITERATOR_HH

#include <iterator>

namespace datastructs
{
    namespace linkedlists
    {
        enum class iterator_tag
        {
            forward_iterator_tag,
            bidirectional_iterator_tag
        };

        enum class direction {forward, reverse};

        template<direction D>
        struct direction_selector
        {
            template<typename N>
            static N * moveToNext(N * node)
            {
                return node->_next;
            }

            template<typename N>
            static N * moveToPrevious(N * node)
            {
                return node->_previous;
            }
        };

        template<>
        struct direction_selector<direction::reverse>
        {
            template<typename N>
            static N * moveToNext(N * node)
            {
                return node->_previous;
            }

            template<typename N>
            static N * moveToPrevious(N * node)
            {
                return node->_next;
            }
        };

        template<typename N, direction D>
        N * moveToNext(N * node)
        {
            return direction_selector<D>::moveToNext(node);
        }

        template<typename N, direction D>
        N * moveToPrevious(N * node)
        {
            return direction_selector<D>::moveToPrevious(node);
        }
    } // !linkedlists
} // !datastructs

#endif // DATA_STRUCTS_LINKEDLISTS_ITERATOR_HH
#endif // DATA_STRUCTS_LINKEDLISTS_ITERATOR_TRAITS_HH


text:
from __future__ import print_function, unicode_literals
"""
This module includes all the possible permissions. Whenever the application is upgraded,
it can include new permissions, and no change in the database is required (except for granting
groups, roles or users with the new permission).
"""

class PermissionType(object):
    def __init__(self, name, description, parameters):
        self.name        = name
        self.description = description
        self.parameters  = parameters

    def get_parameter(self, name):
        for parameter in self.parameters:
            if parameter.name == name:
                return parameter

class PermissionTypeParameter(object):
    def __init__(self, name, datatype, description):
        self.name        = name
        self.datatype    = datatype
        self.description = description

permission_types = {}
PERMISSION_TYPES = permission_types

def _register(permission_type):
    permission_types[permission_type.name] = permission_type

#############################################################
#
#                Experiment allowed
#
EXPERIMENT_ALLOWED = u'experiment_allowed'
EXPERIMENT_ALLOWED_DESC = u"Users with this permission will be able to use a particular laboratory during an amount of time. The amount of time will contain or not the initialization time."

EXPERIMENT_PERMANENT_ID            = u'experiment_permanent_id'
EXPERIMENT_PERMANENT_ID_DTYPE      = u'string'
EXPERIMENT_PERMANENT_ID_DESC       = u'the unique name of the experiment'

EXPERIMENT_CATEGORY_ID             = u'experiment_category_id'
EXPERIMENT_CATEGORY_ID_DTYPE       = u'string'
EXPERIMENT_CATEGORY_ID_DESC        = u'the unique name of the category of experiment'

TIME_ALLOWED                       = u'time_allowed'
TIME_ALLOWED_DTYPE                 = u'float'
TIME_ALLOWED_DESC                  = u'Time allowed (in seconds)'

PRIORITY                           = u'priority'
PRIORITY_DTYPE                     = u'int'
PRIORITY_DESC                      = u'Priority (the lower value the higher priority)'

INITIALIZATION_IN_ACCOUNTING       = u'initialization_in_accounting'
INITIALIZATION_IN_ACCOUNTING_DTYPE = u'bool'
INITIALIZATION_IN_ACCOUNTING_DESC  = u'time_allowed, should count with the initialization time or not?'

experiment_allowed = PermissionType(EXPERIMENT_ALLOWED, EXPERIMENT_ALLOWED_DESC,
                                    [ PermissionTypeParameter(EXPERIMENT_PERMANENT_ID,      EXPERIMENT_PERMANENT_ID_DTYPE,      EXPERIMENT_PERMANENT_ID_DESC      ),
                                      PermissionTypeParameter(EXPERIMENT_CATEGORY_ID,       EXPERIMENT_CATEGORY_ID_DTYPE,       EXPERIMENT_CATEGORY_ID_DESC       ),
                                      PermissionTypeParameter(TIME_ALLOWED,                 TIME_ALLOWED_DTYPE,                 TIME_ALLOWED_DESC                 ),
                                      PermissionTypeParameter(PRIORITY,                     PRIORITY_DTYPE,                     PRIORITY_DESC                     ),
                                      PermissionTypeParameter(INITIALIZATION_IN_ACCOUNTING, INITIALIZATION_IN_ACCOUNTING_DTYPE, INITIALIZATION_IN_ACCOUNTING_DESC ) ])

_register(experiment_allowed)

#############################################################
#
#                Admin panel access
#

ADMIN_PANEL_ACCESS      = u'admin_panel_access'
ADMIN_PANEL_ACCESS_DESC = u"Users with this permission will be allowed to access the administration panel. The only parameter determines if the user has full_privileges to use the admin panel."

FULL_PRIVILEGES       = u'full_privileges'
FULL_PRIVILEGES_DTYPE = u'bool'
FULL_PRIVILEGES_DESC  = u'full privileges (True) or not (False)'

admin_panel_access = PermissionType(ADMIN_PANEL_ACCESS, ADMIN_PANEL_ACCESS_DESC,
                                    [ PermissionTypeParameter(FULL_PRIVILEGES,      FULL_PRIVILEGES_DTYPE,      FULL_PRIVILEGES_DESC ) ])

_register(admin_panel_access)

#############################################################
#
#                Access forward
#

ACCESS_FORWARD      = u'access_forward'
ACCESS_FORWARD_DESC = u"Users with this permission will be allowed to forward reservations to other external users."

access_forward = PermissionType(ACCESS_FORWARD, ACCESS_FORWARD_DESC, [] )

_register(access_forward)

###############################################################
#
#             Profile editing disabled
#

CANT_CHANGE_PROFILE      = u'profile_editing_disabled'
CANT_CHANGE_PROFILE_DESC = u"Disable profile editing. Useful for demo accounts, for instance"

cant_change_profile = PermissionType(CANT_CHANGE_PROFILE, CANT_CHANGE_PROFILE_DESC, [])

_register(cant_change_profile)

###############################################################
#
#             Access all labs
#

ACCESS_ALL_LABS = u'access_all_labs'
ACCESS_ALL_LABS_DESC = u"Enable access to all labs, with a fixed amount of time and super-low priority"

access_all_labs = PermissionType(ACCESS_ALL_LABS, ACCESS_ALL_LABS_DESC, [])

_register(access_all_labs)

###############################################################
#
#            Instrutor is a teacher of a group
#

INSTRUCTOR_OF_GROUP      = u'instructor_of_group'
INSTRUCTOR_OF_GROUP_DESC = u'Users with this permission will see these groups'

TARGET_GROUP       = u'target_group'
TARGET_GROUP_DTYPE = u'int'
TARGET_GROUP_DESC  = u'Identifier of the group to be instructed.'

instructor_of_group = PermissionType(INSTRUCTOR_OF_GROUP, INSTRUCTOR_OF_GROUP_DESC,
                                                    [ PermissionTypeParameter(TARGET_GROUP, TARGET_GROUP_DTYPE, TARGET_GROUP_DESC) ])

_register(instructor_of_group)


text:
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';

import {getChannelStats} from 'mattermost-redux/actions/channels';

import ChannelMembersDropdown from './channel_members_dropdown.jsx';

function mapStateToProps(state, ownProps) {
    return {
        ...ownProps
    };
}

function mapDispatchToProps(dispatch) {
    return {
        actions: bindActionCreators({
            getChannelStats
        }, dispatch)
    };
}

export default connect(mapStateToProps, mapDispatchToProps)(ChannelMembersDropdown);