text:
module Database.Riak (
	M.RiakException(..),
	M.VClock(..),
	M.BucketName(..),
	M.Key(..),
	M.ClientId(..),
	M.Quorum(..),
	B.Riak,
	B.Basic(..),
	B.Pong(..),
	B.ping,
	B.getClientId,
	B.setClientId,
	B.getServerInfo,
	B.get,
	B.put,
	B.delete,
	B.listBuckets,
	B.listKeys,
	B.getBucket,
	B.setBucket,
	B.mapReduce,
	B.indexQuery,
	B.searchQuery,
	B.runRiak,
	numFound,
	maxScore,
	documents,
	start,
	sort,
	rows,
	query,
	presort,
	operation,
	fieldsLimit,
	searchFilter,
	df,
	returnHead,
	returnBody,
	ifNotModified,
	ifNoneMatch,
	response,
	phase,
	request,
	buckets,
	tag,
	rangeMin,
	rangeMax,
	qtype,
	serverVersion,
	node,
	unchanged,
	notFoundOk,
	ifModified,
	onlyHead,
	deletedVClock,
	basicQuorum,
	errorMessage,
	errorCode,
	rw,
	vTag,
	userMeta,
	links,
	lastModUsecs,
	lastMod,
	indexes,
	deleted,
	contentEncoding,
	charset,
	nVal,
	allowMult,
	r,
	pr,
	keys,
	contentType,
	done,
	value,
	w,
	pw,
	dw,
	vClock,
	key,
	content,
	indexValue,
	bucket,
	clientId,
	props,
	L.HasR,
	L.HasPR,
	L.HasKeys,
	L.HasContentType,
	L.HasDone,
	L.HasValue,
	L.HasW,
	L.HasPW,
	L.HasDW,
	L.HasVClock,
	L.HasKey,
	L.HasContent,
	L.HasIndex,
	L.HasBucket,
	L.HasClientId,
	L.HasProps,
	BucketProps,
	Content,
	DeleteRequest,
	ErrorResponse,
	GetBucketRequest,
	GetBucketResponse,
	GetClientIDResponse,
	GetRequest,
	GetResponse,
	GetServerInfoResponse,
	IndexRequest,
	IndexQueryType,
	IndexResponse,
	Link,
	ListBucketsResponse,
	ListKeysRequest,
	ListKeysResponse,
	MapReduceRequest,
	MapReduceResponse,
	Pair,
	PutRequest,
	PutResponse,
	SearchDocument,
	SearchQueryRequest,
	SearchQueryResponse,
	SetBucketRequest,
	SetClientIDRequest,
	module Database.Riak.Connection
) where
import qualified Control.Lens as Lens

import Data.ByteString.Lazy (ByteString)
import Data.Sequence (Seq)
import Data.Word

import qualified Database.Riak.Basic as B
import Database.Riak.Connection
import qualified Database.Riak.Messages as M
import qualified Database.Riak.Lens as L
import Database.Riak.Protocol.BucketProps           (BucketProps)
import Database.Riak.Protocol.Content               (Content)
import Database.Riak.Protocol.DeleteRequest       	(DeleteRequest)
import Database.Riak.Protocol.ErrorResponse         (ErrorResponse)
import Database.Riak.Protocol.GetBucketRequest    	(GetBucketRequest)
import Database.Riak.Protocol.GetBucketResponse   	(GetBucketResponse)
import Database.Riak.Protocol.GetClientIDResponse   (GetClientIDResponse)
import Database.Riak.Protocol.GetRequest          	(GetRequest)
import Database.Riak.Protocol.GetResponse         	(GetResponse)
import Database.Riak.Protocol.GetServerInfoResponse (GetServerInfoResponse)
import Database.Riak.Protocol.IndexRequest        	(IndexRequest)
import Database.Riak.Protocol.IndexRequest.IndexQueryType (IndexQueryType)
import Database.Riak.Protocol.IndexResponse       	(IndexResponse)
import Database.Riak.Protocol.Link                	(Link)
import Database.Riak.Protocol.ListBucketsResponse	(ListBucketsResponse)
import Database.Riak.Protocol.ListKeysRequest     	(ListKeysRequest)
import Database.Riak.Protocol.ListKeysResponse    	(ListKeysResponse)
import Database.Riak.Protocol.MapReduceRequest    	(MapReduceRequest)
import Database.Riak.Protocol.MapReduceResponse   	(MapReduceResponse)
import Database.Riak.Protocol.Pair                	(Pair)
import Database.Riak.Protocol.PutRequest          	(PutRequest)
import Database.Riak.Protocol.PutResponse         	(PutResponse)
import Database.Riak.Protocol.SearchDocument        (SearchDocument)
import Database.Riak.Protocol.SearchQueryRequest  	(SearchQueryRequest)
import Database.Riak.Protocol.SearchQueryResponse   (SearchQueryResponse)
import Database.Riak.Protocol.SetBucketRequest    	(SetBucketRequest)
import Database.Riak.Protocol.SetClientIDRequest  	(SetClientIDRequest)

numFound :: Lens.Simple Lens.Lens SearchQueryResponse (Maybe Word32)
numFound = L.numFound

maxScore :: Lens.Simple Lens.Lens SearchQueryResponse (Maybe Float)
maxScore = L.maxScore

documents :: Lens.Simple Lens.Lens SearchQueryResponse (Seq SearchDocument)
documents = L.documents

start :: Lens.Simple Lens.Lens SearchQueryRequest (Maybe Word32)
start = L.start

sort :: Lens.Simple Lens.Lens SearchQueryRequest (Maybe ByteString)
sort = L.sort

rows :: Lens.Simple Lens.Lens SearchQueryRequest (Maybe Word32)
rows = L.rows

query :: Lens.Simple Lens.Lens SearchQueryRequest ByteString
query = L.searchQuery

presort :: Lens.Simple Lens.Lens SearchQueryRequest (Maybe ByteString)
presort = L.presort

operation :: Lens.Simple Lens.Lens SearchQueryRequest (Maybe ByteString)
operation = L.operation

fieldsLimit :: Lens.Simple Lens.Lens SearchQueryRequest (Seq ByteString)
fieldsLimit = L.fieldsLimit

searchFilter :: Lens.Simple Lens.Lens SearchQueryRequest (Maybe ByteString)
searchFilter = L.searchFilter

df :: Lens.Simple Lens.Lens SearchQueryRequest (Maybe ByteString)
df = L.df

returnHead :: Lens.Simple Lens.Lens PutRequest (Maybe Bool)
returnHead = L.returnHead

returnBody :: Lens.Simple Lens.Lens PutRequest (Maybe Bool)
returnBody = L.returnBody

ifNotModified :: Lens.Simple Lens.Lens PutRequest (Maybe Bool)
ifNotModified = L.ifNotModified

ifNoneMatch :: Lens.Simple Lens.Lens PutRequest (Maybe Bool)
ifNoneMatch = L.ifNoneMatch

response :: Lens.Simple Lens.Lens MapReduceResponse (Maybe ByteString)
response = L.response

phase :: Lens.Simple Lens.Lens MapReduceResponse (Maybe Word32)
phase = L.phase

request :: Lens.Simple Lens.Lens MapReduceRequest ByteString
request = L.request

buckets :: Lens.Simple Lens.Lens ListBucketsResponse (Seq ByteString)
buckets = L.buckets

tag :: Lens.Simple Lens.Lens Link (Maybe ByteString)
tag = L.tag

rangeMin :: Lens.Simple Lens.Lens IndexRequest (Maybe ByteString)
rangeMin = L.rangeMin

rangeMax :: Lens.Simple Lens.Lens IndexRequest (Maybe ByteString)
rangeMax = L.rangeMax

qtype :: Lens.Simple Lens.Lens IndexRequest IndexQueryType
qtype = L.qtype

serverVersion :: Lens.Simple Lens.Lens GetServerInfoResponse (Maybe ByteString)
serverVersion = L.serverVersion

node :: Lens.Simple Lens.Lens GetServerInfoResponse (Maybe ByteString)
node = L.node

unchanged :: Lens.Simple Lens.Lens GetResponse (Maybe Bool)
unchanged = L.unchanged

notFoundOk :: Lens.Simple Lens.Lens GetRequest (Maybe Bool)
notFoundOk = L.notfoundOk

ifModified :: Lens.Simple Lens.Lens GetRequest (Maybe ByteString)
ifModified = L.ifModified

onlyHead :: Lens.Simple Lens.Lens GetRequest (Maybe Bool)
onlyHead = L.onlyHead

deletedVClock :: Lens.Simple Lens.Lens GetRequest (Maybe Bool)
deletedVClock = L.deletedVClock

basicQuorum :: Lens.Simple Lens.Lens GetRequest (Maybe Bool)
basicQuorum = L.basicQuorum

errorMessage :: Lens.Simple Lens.Lens ErrorResponse ByteString
errorMessage = L.errmsg

errorCode :: Lens.Simple Lens.Lens ErrorResponse Word32
errorCode = L.errcode

rw :: Lens.Simple Lens.Lens DeleteRequest (Maybe Word32)
rw = L.rw

vTag :: Lens.Simple Lens.Lens Content (Maybe ByteString)
vTag = L.vtag

userMeta :: Lens.Simple Lens.Lens Content (Seq Pair)
userMeta = L.usermeta

links :: Lens.Simple Lens.Lens Content (Seq Link)
links = L.links

lastModUsecs :: Lens.Simple Lens.Lens Content (Maybe Word32)
lastModUsecs = L.lastModUsecs

lastMod :: Lens.Simple Lens.Lens Content (Maybe Word32)
lastMod = L.lastMod

indexes :: Lens.Simple Lens.Lens Content (Seq Pair)
indexes = L.indexes

deleted :: Lens.Simple Lens.Lens Content (Maybe Bool)
deleted = L.deleted

contentEncoding :: Lens.Simple Lens.Lens Content (Maybe ByteString)
contentEncoding = L.contentEncoding

charset :: Lens.Simple Lens.Lens Content (Maybe ByteString)
charset = L.charset

nVal :: Lens.Simple Lens.Lens BucketProps (Maybe Word32)
nVal = L.nVal

allowMult :: Lens.Simple Lens.Lens BucketProps (Maybe Bool)
allowMult = L.allowMult

r :: L.HasR a => Lens.Simple Lens.Lens a (Maybe M.Quorum)
r = L.r

pr :: L.HasPR a => Lens.Simple Lens.Lens a (Maybe M.Quorum)
pr = L.pr

keys :: L.HasKeys a => Lens.Simple Lens.Lens a (Seq ByteString)
keys = L.keys

contentType :: L.HasContentType a => Lens.Simple Lens.Lens a (L.ContentTypeValue a)
contentType = L.contentType

done :: L.HasDone a => Lens.Simple Lens.Lens a (Maybe Bool)
done = L.done

value :: L.HasValue a => Lens.Simple Lens.Lens a (L.Value a)
value = L.value

w :: L.HasW a => Lens.Simple Lens.Lens a (Maybe M.Quorum)
w = L.w

pw :: L.HasPW a => Lens.Simple Lens.Lens a (Maybe M.Quorum)
pw = L.pw

dw :: L.HasDW a => Lens.Simple Lens.Lens a (Maybe M.Quorum)
dw = L.dw

vClock :: L.HasVClock a => Lens.Simple Lens.Lens a (Maybe ByteString)
vClock = L.vclock

key :: L.HasKey a => Lens.Simple Lens.Lens a (L.KeyValue a)
key = L.key

content :: L.HasContent a => Lens.Simple Lens.Lens a (L.ContentValue a)
content = L.content

indexValue :: L.HasIndex a => Lens.Simple Lens.Lens a ByteString
indexValue = L.index

bucket :: L.HasBucket a => Lens.Simple Lens.Lens a (L.BucketValue a)
bucket = L.bucket

clientId :: L.HasClientId a => Lens.Simple Lens.Lens a ByteString
clientId = L.clientId

props :: L.HasProps a => Lens.Simple Lens.Lens a BucketProps
props = L.props


text:
package suadb.parse;
import java.util.*;
/**
 * The operator : project()
 *
 * Synopsis :
 *      project( srcArray, attribute1, attribute2, ... )
 *
 * Created by Aram on 2016-11-15.
 */
public class ProjectData implements QueryData
{
	private QueryData array;
	private List<String> attributes ;
	/**
	 * Saves the table name and the field and value lists.
	 */
	public ProjectData(QueryData array, List<String> attributes) {
		this.array = array;
		this.attributes = attributes;
	}

	/**
	 * Returns the name of the affected table.
	 * @return the name of the affected table
	 */
	public QueryData array() {
		return array;
	}

	public List<String> getAttributes() {
		return attributes;
	}

	public String toString()
	{
		String result = "project("+ array.toString()+",";
		for (String attname : attributes)
		{
			result += attname + ",";
		}
		result = result.substring(0, result.length() - 2);
		result += ")";
		return result;
	}
}

redpajama_set_name: RedPajamaGithub


text:
A change data capture framework for  Confluent Kafka
====================================================

A framework for creating change data capture systems for Confluent Kafka

## Compiling
This library uses some features that have been added to Confluent schema-registry 2.1.0. Confluent has not  published this version (they skipped to 3.0.0), so you will have to build it yourself. Bellow are the sources we used
* schema-registry - https://github.com/confluentinc/schema-registry/commit/1918d7e3277a53df91162abc0089aca131e5c23c
* rest-util - https://github.com/confluentinc/rest-utils/tree/161ae74484f21f6e8dfba1f2cabc77dcbd8bd2e6
* common - https://github.com/confluentinc/common/tree/e9fc841dde53293b3fa5b223346d277233ad3e88

## Features (Need to add details)
* Integration with Confluent Kafka
* An generic framework to integrate with Change Data Captures systems such as Oracle GoldenGate


text:
FOUNDATION_EXPORT double BBDesignableVersionNumber;

//! Project version string for BBDesignable.
FOUNDATION_EXPORT const unsigned char BBDesignableVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <BBDesignable/PublicHeader.h>


text:
static_file_server
==================

Node Static file http server


text: module.exports = require('kolibri-tools/.stylelintrc');


text:
extern "C" {

  typedef enum {
    JIT_NOACTION = 0,
    JIT_REGISTER_FN,
    JIT_UNREGISTER_FN
  } jit_actions_t;

  struct jit_code_entry {
    struct jit_code_entry *next_entry;
    struct jit_code_entry *prev_entry;
    const char *symfile_addr;
    uint64_t symfile_size;
  };

  struct jit_descriptor {
    uint32_t version;
    // This should be jit_actions_t, but we want to be specific about the
    // bit-width.
    uint32_t action_flag;
    struct jit_code_entry *relevant_entry;
    struct jit_code_entry *first_entry;
  };

}

namespace llvm {

class ELFSection;
class Function;
class TargetMachine;

/// This class encapsulates information we want to send to the debugger.
///
struct DebugInfo {
  uint8_t *FnStart;
  uint8_t *FnEnd;
  uint8_t *EhStart;
  uint8_t *EhEnd;

  DebugInfo() : FnStart(0), FnEnd(0), EhStart(0), EhEnd(0) {}
};

typedef DenseMap< const Function*, std::pair<std::string, jit_code_entry*> >
  RegisteredFunctionsMap;

/// This class registers debug info for JITed code with an attached debugger.
/// Without proper debug info, GDB can't do things like source level debugging
/// or even produce a proper stack trace on linux-x86_64.  To use this class,
/// whenever a function is JITed, create a DebugInfo struct and pass it to the
/// RegisterFunction method.  The method will then do whatever is necessary to
/// inform the debugger about the JITed function.
class JITDebugRegisterer {

  TargetMachine &TM;

  /// FnMap - A map of functions that have been registered to the associated
  /// temporary files.  Used for cleanup.
  RegisteredFunctionsMap FnMap;

  /// MakeELF - Builds the ELF file in memory and returns a std::string that
  /// contains the ELF.
  std::string MakeELF(const Function *F, DebugInfo &I);

public:
  JITDebugRegisterer(TargetMachine &tm);

  /// ~JITDebugRegisterer - Unregisters all code and frees symbol files.
  ///
  ~JITDebugRegisterer();

  /// RegisterFunction - Register debug info for the given function with an
  /// attached debugger.  Clients must call UnregisterFunction on all
  /// registered functions before deleting them to free the associated symbol
  /// file and unregister it from the debugger.
  void RegisterFunction(const Function *F, DebugInfo &I);

  /// UnregisterFunction - Unregister the debug info for the given function
  /// from the debugger and free associated memory.
  void UnregisterFunction(const Function *F);

private:
  /// UnregisterFunctionInternal - Unregister the debug info for the given
  /// function from the debugger and delete any temporary files.  The private
  /// version of this method does not remove the function from FnMap so that it
  /// can be called while iterating over FnMap.
  void UnregisterFunctionInternal(RegisteredFunctionsMap::iterator I);

};

} // end namespace llvm

#endif // LLVM_EXECUTION_ENGINE_JIT_DEBUGREGISTERER_H


text:
package trucksimulation;

import java.io.File;

import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

import com.graphhopper.GraphHopper;

import trucksimulation.routing.GraphHopperBuilder;
import trucksimulation.routing.Position;
import trucksimulation.routing.Route;
import trucksimulation.trucks.DestinationArrivedException;
import trucksimulation.trucks.Truck;

public class TruckTest {

	private static GraphHopper hopper;

	@BeforeClass
	public static void initGraphHopper() {
		// use different graphhopper cache directory to avoid conflicts
		String userHome = System.getProperty("user.home");
		String ghCacheLocation = new File(userHome, ".graphhopper-test").getAbsolutePath();
		String osmFile = new File("osm", "andorra-latest.osm.pbf").toString();
		hopper = GraphHopperBuilder.get(osmFile, ghCacheLocation);
	}

	@Test
	public void testMovement() throws InterruptedException {
		Truck t1 = Truck.buildTruck();
		Route r = Route.getRoute(hopper, new Position(42.450656, 1.485264), new Position(42.541762, 1.457115));
		t1.setRoute(r);

		long journeyTime = 0;

		while(true) {
			try {
				t1.move();
				Thread.sleep(1);
				journeyTime++;
			} catch (DestinationArrivedException ex) {
				break;
			}
		}
		System.out.println("Journey took " + journeyTime + " seconds.");
		System.out.println("estimated journey time was " + t1.getRoute().getTimeMs()/1000);
	}

	@Test
	public void testPauseMode() {
		Truck t1 = Truck.buildTruck();
		Route r = Route.getRoute(hopper, new Position(42.541762, 1.457115), new Position(42.450656, 1.485264));
		t1.setRoute(r);
		Assert.assertFalse(t1.isInPauseMode());
		t1.move();
		Position pos = t1.getPos();
		t1.pause(1); // pause for 60 seconds
		Assert.assertTrue(t1.isInPauseMode());

		for(int i = 0; i < 60; i++) {
			t1.move();
			Assert.assertEquals("Truck should not change position in pause mode.", pos, t1.getPos());
		}
		Assert.assertFalse(t1.isInPauseMode());
		t1.move();
		Assert.assertNotEquals(pos,  t1.getPos());
	}

}


text:
package net.yslibrary.photosearcher.graph.module;

import net.yslibrary.photosearcher.graph.qualifier.PerActivity;

import android.app.Activity;

import dagger.Module;
import dagger.Provides;

/**
 * Created by yshrsmz on 15/08/29.
 */
@Module
public class ActivityModule {

    private final Activity activity;

    public ActivityModule(Activity activity) {
        this.activity = activity;
    }

    @Provides
    @PerActivity
    Activity activity() {
        return activity;
    }
}


text:
Snap together components like you would do with lego bricks to create a small Todo application.

```vomit
function component(todos) {
  var list = vomit(ul)
  var add = function(ev) {
    var input = this.todo
    todos.push(input.value)
    list(todos)
    ev.preventDefault()
    input.value = ''
  }
  return vomit`<div>
    <h3>TODO</h3>
    ${list(todos)}
    <form onsubmit="${add}">
      <input name="todo"/>
      <button>Add</button>
    </form>
  </div>`
}

function ul(arr) {
  return vomit`<ul>
    ${arr.map(item => vomit`<li>${item}</li>`)}
  </ul>`
}
```

Have you noticed? Vomit allows you to easily compose together functions and elements with the placeholder syntax `${}`. Most important you are not limited by the architectural choices made for you.


text:
/// <reference path="../_references.ts"/>

module powerbi.visuals {
    export interface CardItemData {
        caption: string;
        details: string;
        showURL: boolean;
    }

    export interface CardData {
        title?: string;
        showTitleAsURL?: boolean;
        cardItemsData: CardItemData[];
    }

    interface MultiRowCardStyle {
        card: {
            bottomBorderWidth: number;
            leftBorderWidth: number;
            borderStyle: string;
            leftBorderColor: string;
            borderColor: string;
            bottomPadding: number;
            topPadding: number;
            leftPadding: number;
            color: string;
            marginBottom: number;
        };
        title: {
            height: number;
            marginBottom: number;
        };
        cardItemContainer: {
            marginRight: number;
            maxWidth: number;
            topPadding: number;
            topPaddingCanvas: number;
        };
        caption: {
            height: number;
            fontSize: number;
            color: string;
        };
        details: {
            height: number;
            fontSize: number;
            color: string;
        };
        scrollbar: {
            padding: number;
        };
        cardItems: {
            maxItemsSmallTile: number;
            maxItemsMediumTile: number;
            maxItemsLargeTile: number;
        };
        cardRowColumns: {
            maxRowColumnsSmallTile: number;
            maxRowColumnsMediumTile: number;
            maxRowColumnsLargeTile: number;
        };
        cards: {
            maxCardsSmallTile: number;
            maxCardsMediumTile: number;
            maxCardsLargeTile: number;
        };
    }

    export class MultiRowCard implements IVisual {
        private currentViewport: IViewport;
        private options: VisualInitOptions;
        private dataView: DataView;
        private style: IVisualStyle;
        private element: JQuery;
        private listView: IListView;
        private cardHeight: number;
        private cardWidth: number;
        private columnWidth: number;
        private maxCardsDisplayed: number;
        private cardItemContainerHeight: number;
        private isCardWrapped: boolean = false;
        /**
         * This includes card height with margin that will be passed to list view.
         */
        private cardHeightTotal: number;
        private settings: MultiRowCardStyle;
        private dataModel: CardData[];
        private interactivity: InteractivityOptions;
        private isInteractivityOverflowHidden: boolean = false;
        private waitingForData: boolean;
        private cardHasTitle: boolean;
        private isSingleRowCard: boolean;
        private isSingleValueCard: boolean;

        /**
         * Note: Public for testability.
         */
        public static formatStringProp: DataViewObjectPropertyIdentifier = {
            objectName: 'general',
            propertyName: 'formatString',
        };
        private static multiRowCardClass = 'multiRowCard';
        private static Card: ClassAndSelector = {
            class: 'card',
            selector: '.card'
        };

        private static Title: ClassAndSelector = {
            class: 'title',
            selector: '.title'
        };

        private static CardItemContainer: ClassAndSelector = {
            class: 'cardItemContainer',
            selector: '.cardItemContainer'
        };

        private static Caption: ClassAndSelector = {
            class: 'caption',
            selector: '.caption'
        };

        private static Details: ClassAndSelector = {
            class: 'details',
            selector: '.details'
        };
        private static TitleUrlSelector: string = MultiRowCard.Title.selector + ' a';
        private static CaptionUrlSelector: string = MultiRowCard.Caption.selector + ' a';

        private static SmallTileWidth = 250;
        private static MediumTileWidth = 490;
        private static LargeTileWidth = 750;

        /**
         * Cards have specific styling so defined inline styles and also to support theming and improve performance.
         */
        private static DefaultStyle: MultiRowCardStyle = {
            card: {
                bottomBorderWidth: 1,
                leftBorderWidth: 3,
                borderStyle: 'solid',
                leftBorderColor: '#A6A6A6',
                borderColor: '#C8C8C8',
                bottomPadding: 5,
                leftPadding: 10,
                topPadding: 5,
                color: '#767676',
                marginBottom: 20
            },
            title: {
                height: 24,
                marginBottom: 5,
            },
            cardItemContainer: {
                marginRight: 20,
                maxWidth: 100,
                topPadding: 5,
                topPaddingCanvas: 7
            },
            caption: {
                height: 20,
                fontSize: 14,
                color: '#333333'
            },
            details: {
                height: 16,
                fontSize: 12,
                color: '#A6A6A6'
            },
            scrollbar: {
                padding: 8
            },
            cardItems: {
                maxItemsSmallTile: 4,
                maxItemsMediumTile: 6,
                maxItemsLargeTile: 6
            },
            cardRowColumns: {
                maxRowColumnsSmallTile: 2,
                maxRowColumnsMediumTile: 3,
                maxRowColumnsLargeTile: 6
            },
            cards: {
                maxCardsSmallTile: 1,
                maxCardsMediumTile: 3,
                maxCardsLargeTile: 8
            }
        };

        public init(options: VisualInitOptions) {
            debug.assertValue(options, 'options');
            this.options = options;
            this.style = options.style;
            var viewport = this.currentViewport = options.viewport;
            var interactivity = this.interactivity = options.interactivity;

            if (interactivity && interactivity.overflow === 'hidden')
                this.isInteractivityOverflowHidden = true;

            this.settings = MultiRowCard.DefaultStyle;

            var multiRowCardDiv = $('<div/>').addClass(MultiRowCard.multiRowCardClass);
            options.element.append(multiRowCardDiv);
            var element = this.element = multiRowCardDiv;
            element.css('height', this.getPixelString(viewport.height));

            this.initializeCardRowSelection();
        }

        public onDataChanged(options: VisualDataChangedOptions): void {
            debug.assertValue(options, 'options');

            var dataViews = options.dataViews;
            if (dataViews && dataViews.length > 0) {
                this.dataView = dataViews[0];
            }

            var resetScrollbarPosition = options.operationKind !== VisualDataChangeOperationKind.Append;
            this.updateInternal(resetScrollbarPosition);
            this.waitingForData = false;
        }

        public onResizing(viewport: IViewport): void {
            var viewport = this.currentViewport = viewport;
            this.element.css('height', this.getPixelString(viewport.height));
            this.updateInternal();
        }

        public static converter(dataView: DataView, columnCount: number, maxCards: number, isDashboardVisual: boolean = false): CardData[] {
            var details: CardData[] = [];
            var tableDataRows = dataView.table.rows;
            var columnMetadata: DataViewMetadataColumn[] = dataView.table.columns;

            for (var i = 0, len = maxCards; i < len; i++) {
                var row = tableDataRows[i];
                var isValuePromoted: boolean = undefined;
                var title: string = undefined;
                var showTitleAsURL: boolean = false;
                var cardData: CardItemData[] = [];
                for (var j = 0; j < columnCount; j++) {
                    var column = columnMetadata[j];
                    var columnCaption: string = valueFormatter.format(row[j], valueFormatter.getFormatString(column, MultiRowCard.formatStringProp));

                    // The columnDetail represents column name. In card the column name is shown as details
                    var columnDetail: string = columnMetadata[j].displayName;

                    //Title is shown only on Canvas and only if there is one Category field.
                    if (!isDashboardVisual && !column.type.numeric) {
                        if (isValuePromoted === undefined) {
                            isValuePromoted = true;
                            title = columnCaption;
                            showTitleAsURL = UrlHelper.isValidUrl(column, title);
                        }
                        else if (isValuePromoted) {
                            isValuePromoted = false;
                        }
                    }
                    cardData.push({
                        caption: columnCaption,
                        details: columnDetail,
                        showURL: UrlHelper.isValidUrl(column, columnCaption)
                    });
                }
                details.push({
                    title: isValuePromoted ? title : undefined,
                    showTitleAsURL: showTitleAsURL,
                    cardItemsData: isValuePromoted ? cardData.filter((d: CardItemData) => d.caption !== title) : cardData

                });
            }
            return details;
        }

        private updateInternal(resetScrollbarPosition: boolean = false) {
            var dataView = this.dataView;
            if (!(dataView && dataView.metadata && dataView.table && dataView.table.rows && dataView.table.rows.length > 0 && dataView.table.columns && dataView.table.columns.length > 0)) {
                this.listView.empty();
                return;
            }

            this.setCardDimensions();
            var cardHeightTotal = this.cardHeightTotal;
            var dataModel = this.dataModel;

            debug.assertValue(cardHeightTotal, 'cardHeightTotal');
            debug.assert(cardHeightTotal > 0, 'cardHeightTotal should be more than 0');

            this.listView
                .viewport(this.currentViewport)
                .rowHeight(cardHeightTotal)
                .data(dataModel, (d: CardData) => dataModel.indexOf(d))
                .render(true, resetScrollbarPosition);
        }

        private initializeCardRowSelection() {
            var settings = this.settings;
            var cardHeightTotal = this.cardHeightTotal;
            var rowHeight = this.cardHeight;
            var isDashboardVisual = this.isInteractivityOverflowHidden;

            var rowEnter = (rowSelection: D3.Selection) => {
                var cardRow = rowSelection
                    .append("div")
                    .style({
                        'color': settings.card.color,
                        'overflow-y': 'hidden',
                        'box-sizing': 'border-box',
                    })
                    .classed(MultiRowCard.Card.class, true);

                // The card top padding is not needed when card items are wrapped as top padding is added to each carditemcontainer when wrapped
                if (isDashboardVisual) {
                    cardRow.style('padding-top', this.isCardWrapped ? '0px' : this.getPixelString(settings.card.topPadding));
                }
                else {
                    cardRow
                        .style({
                            'border-left': this.getPixelString(settings.card.leftBorderWidth) + " " + settings.card.borderStyle,
                            'border-left-color': settings.card.leftBorderColor,
                            'padding-left': this.getPixelString(settings.card.leftPadding)
                        });

                    if (this.cardHasTitle) {
                        cardRow.append("div").classed(MultiRowCard.Title.class, true)
                            .style({
                                'height': this.getPixelString(settings.title.height),
                                'margin-bottom': this.isCardWrapped ? '0px' : this.getPixelString(settings.title.marginBottom),
                            })
                            .each(function (d: CardData) {
                                if (d.showTitleAsURL)
                                    d3.select(this).append('a');
                            });
                    }
                }

                var cardItem = cardRow
                    .selectAll(MultiRowCard.CardItemContainer.selector)
                    .data((d: CardData) => d.cardItemsData)
                    .enter()
                    .append('div')
                    .classed(MultiRowCard.CardItemContainer.class, true)
                    .style({
                        'box-sizing': 'border-box',
                        'height': this.getPixelString(this.cardItemContainerHeight),
                        'margin-right': this.isSingleValueCard ? '0px' : this.getPixelString(settings.cardItemContainer.marginRight),
                        'float': 'left',
                        // If card is wrapped, padding is added to the itemcontainer as top padding so we don't have to add the bottom padding to the title
                        'padding-top': this.isCardWrapped ? (isDashboardVisual ? this.getPixelString(settings.cardItemContainer.topPadding) : this.getPixelString(settings.cardItemContainer.topPaddingCanvas)) : '0px'
                    });

                cardItem
                    .append('div')
                    .classed(MultiRowCard.Caption.class, true)
                    .style({
                        'height': this.getPixelString(settings.caption.height),
                        'font-size': this.getPixelString(settings.caption.fontSize),
                        'color': settings.caption.color,
                        'text-align': 'left',
                        'white-space': 'nowrap',
                        'text-overflow': 'ellipsis',
                        'overflow': 'hidden'
                    })
                    .each(function (d: CardItemData) {
                        if (d.showURL)
                            d3.select(this).append('a');
                    });

                cardItem
                    .append('div')
                    .classed(MultiRowCard.Details.class, true)
                    .style({
                        'height': this.getPixelString(settings.details.height),
                        'font-size': this.getPixelString(settings.details.fontSize),
                        'color': settings.details.color,
                        'text-align': 'left',
                        'white-space': 'nowrap',
                        'text-overflow': 'ellipsis',
                        'overflow': 'hidden'
                    });
            };

            var rowUpdate = (rowSelection: D3.Selection) => {
                rowHeight = this.cardHeight;

                if (!isDashboardVisual && this.cardHasTitle) {
                    rowSelection.selectAll(MultiRowCard.Title.selector).filter((d: CardData) => !d.showTitleAsURL).text((d: CardData) => d.title);
                    rowSelection
                        .selectAll(MultiRowCard.TitleUrlSelector)
                        .attr('href', (d: CardData) => d.title)
                        .attr('target', '_blank')
                        .text((d: CardData) => d.title);
                }

                var cardSelection = rowSelection.selectAll(MultiRowCard.Card.selector)
                    .style({
                        'height': this.getPixelString(rowHeight),
                        'width': this.getPixelString(this.cardWidth)
                    });

                var cardItemContainerWidth = this.isSingleValueCard ? this.columnWidth : this.columnWidth - settings.cardItemContainer.marginRight;
                cardSelection
                    .selectAll(MultiRowCard.CardItemContainer.selector)
                    .style("width", this.getPixelString(cardItemContainerWidth));

                cardSelection
                    .selectAll(MultiRowCard.Caption.selector).filter((d: CardItemData) => !d.showURL).text((d: CardItemData) => d.caption);

                cardSelection
                    .selectAll(MultiRowCard.CaptionUrlSelector)
                    .attr('href', (d: CardItemData) => d.caption)
                    .attr('target', '_blank')
                    .text((d: CardItemData) => d.caption);

                cardSelection
                    .selectAll(MultiRowCard.Details.selector).text((d: CardItemData) => d.details);

                // The last card styling is different in the dashboard
                if (isDashboardVisual) {
                    var dataModel = this.dataModel;

                    if (dataModel && dataModel.length > 0)
                        cardSelection = cardSelection.filter((d: CardData) => d !== dataModel[dataModel.length - 1]);

                    cardSelection
                        .style({
                            'border-bottom-style': settings.card.borderStyle,
                            'border-bottom-width': this.getPixelString(settings.card.bottomBorderWidth),
                            'border-bottom-color': settings.card.borderColor,
                            'padding-bottom': this.getPixelString(settings.card.bottomPadding),
                        });
                }

                cardSelection
                    .style('margin-bottom', isDashboardVisual ? '0px' : (this.isSingleRowCard ? '0px' : this.getPixelString(settings.card.marginBottom)));
            };

            var rowExit = (rowSelection: D3.Selection) => {
                rowSelection.remove();
            };

            var listViewOptions: ListViewOptions = {
                rowHeight: cardHeightTotal,
                enter: rowEnter,
                exit: rowExit,
                update: rowUpdate,
                loadMoreData: () => this.onLoadMoreData(),
                viewport: this.currentViewport,
                baseContainer: d3.select(this.element.get(0))
            };

            this.listView = ListViewFactory.createHTMLListView(listViewOptions);
        }

        /**
         * This contains the card column wrapping logic.
         * Determines how many columns can be shown per each row inside a Card.
         * To place the fields evenly along the card,
         * the width of each card item is calculated based on the available viewport width.
         */
        private setCardDimensions(): void {
            var dataView = this.dataView;
            debug.assertValue(dataView, 'dataView');

            var columnMetadata: DataViewMetadataColumn[] = dataView.table.columns;
            var tableRows: any[][] = dataView.table.rows;
            var viewport = this.currentViewport;
            var settings = this.settings;
            var cardRowColumnCount: number = 0;
            var maxCardColumns = cardRowColumnCount = columnMetadata.length;
            var viewportWidth = viewport.width;
            this.cardHasTitle = false;

            if (this.isInteractivityOverflowHidden) {
                if (viewportWidth <= MultiRowCard.SmallTileWidth) {
                    cardRowColumnCount = Math.min(settings.cardRowColumns.maxRowColumnsSmallTile, cardRowColumnCount);
                    maxCardColumns = Math.min(settings.cardItems.maxItemsSmallTile, maxCardColumns);
                }

                else if (viewportWidth <= MultiRowCard.MediumTileWidth) {
                    cardRowColumnCount = Math.min(settings.cardRowColumns.maxRowColumnsMediumTile, cardRowColumnCount);
                    maxCardColumns = Math.min(settings.cardItems.maxItemsMediumTile, maxCardColumns);
                }

                else if (viewportWidth <= MultiRowCard.LargeTileWidth) {
                    cardRowColumnCount = Math.min(settings.cardRowColumns.maxRowColumnsLargeTile, cardRowColumnCount);
                    maxCardColumns = Math.min(settings.cardItems.maxItemsLargeTile, maxCardColumns);
                }

                this.calculateCardDimensions(viewport, cardRowColumnCount, maxCardColumns, tableRows.length);
                this.dataModel = MultiRowCard.converter(dataView, maxCardColumns, this.maxCardsDisplayed, this.isInteractivityOverflowHidden);
            }
            else {
                var dataModel = this.dataModel = MultiRowCard.converter(dataView, maxCardColumns, tableRows.length);
                maxCardColumns = 0;

                if (dataModel && dataModel.length > 0) {
                    maxCardColumns = dataModel[0].cardItemsData ? dataModel[0].cardItemsData.length : 0;
                    this.cardHasTitle = dataModel[0].title !== undefined;
                    this.isSingleRowCard = dataModel.length === 1 ? true : false;
                }
                this.calculateCardDimensions(viewport, maxCardColumns, maxCardColumns, dataModel.length);
                if (this.cardHasTitle) {
                    var cardHeight = this.cardHeight += settings.title.height + (this.isCardWrapped ? 0 : settings.title.marginBottom);
                    this.cardHeightTotal = this.getTotalCardHeight(cardHeight);
                }
            }
        }

        private calculateCardDimensions(viewport: IViewport, cardRowColumnCount: number, maxCardColumns: number, maxCards: number): void {
            var settings = this.settings;
            var isDashboardVisual = this.isInteractivityOverflowHidden;
            var cardWidth = viewport.width - settings.scrollbar.padding;
            var cardRowColumnCountDisplayed = cardRowColumnCount;
            var cardItemContainerHeight = settings.caption.height + settings.details.height;
            var isCardWrapped = false;

            if (!isDashboardVisual)
                cardWidth -= (settings.card.leftBorderWidth + settings.card.leftPadding);

            var columnWidth = cardWidth / cardRowColumnCount;

            if (cardRowColumnCount === maxCardColumns) {
                columnWidth = Math.max(columnWidth, settings.cardItemContainer.maxWidth);

                columnWidth = Math.min(columnWidth, cardWidth);

                cardRowColumnCountDisplayed = Math.floor(cardWidth / columnWidth);
            }

            this.isSingleValueCard = cardRowColumnCountDisplayed === 1;

            var totalRowsDisplayed = Math.ceil(maxCardColumns / cardRowColumnCountDisplayed);

            if (totalRowsDisplayed > 1) {
                cardItemContainerHeight += (isDashboardVisual ? settings.cardItemContainer.topPadding : settings.cardItemContainer.topPaddingCanvas);
                columnWidth = cardWidth / cardRowColumnCountDisplayed;
                isCardWrapped = true;
            }

            var cardHeight = Math.ceil(totalRowsDisplayed * cardItemContainerHeight);
            if (isDashboardVisual) {
                cardHeight += settings.card.bottomBorderWidth + settings.card.bottomPadding + settings.card.topPadding;
            }
            var cardHeightTotal = cardHeight;

            if (isDashboardVisual) {
                maxCards = Math.min(Math.floor(viewport.height / cardHeight), maxCards);
            }
            else {
                cardHeightTotal = this.getTotalCardHeight(cardHeight);
                cardWidth += settings.card.leftBorderWidth + settings.card.leftPadding;
            }

            this.cardHeight = cardHeight;
            this.columnWidth = columnWidth;
            this.cardWidth = cardWidth;
            this.cardHeightTotal = cardHeightTotal;
            this.maxCardsDisplayed = maxCards;
            this.cardItemContainerHeight = cardItemContainerHeight;
            this.isCardWrapped = isCardWrapped;
        }

        private getPixelString(value: number): string {
            return value + "px";
        }

        private onLoadMoreData(): void {
            if (!this.waitingForData && this.dataView.metadata && this.dataView.metadata.segment) {
                this.options.host.loadMoreData();
                this.waitingForData = true;
            }
        }

        private getTotalCardHeight(cardHeight: number): number {
            return cardHeight + (this.isSingleRowCard ? 0 : this.settings.card.marginBottom);
        }
    }
}


text:
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.

// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENT_POINT_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENT_POINT_HPP

#include <boost/array.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>

#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/util/range.hpp>
#include <boost/geometry/iterators/ever_circling_iterator.hpp>
#include <boost/geometry/views/closeable_view.hpp>
#include <boost/geometry/views/reversible_view.hpp>

namespace boost { namespace geometry
{

#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace copy_segments
{

template <typename Range, bool Reverse, typename SegmentIdentifier, typename PointOut>
struct copy_segment_point_range
{
    static inline bool apply(Range const& range,
            SegmentIdentifier const& seg_id, int offset,
            PointOut& point)
    {
        typedef typename closeable_view
        <
            Range const,
            closure<Range>::value
        >::type cview_type;

        typedef typename reversible_view
        <
            cview_type const,
            Reverse ? iterate_reverse : iterate_forward
        >::type rview_type;

        cview_type cview(range);
        rview_type view(cview);

        typedef typename boost::range_iterator<rview_type>::type iterator;
        geometry::ever_circling_iterator<iterator> it(boost::begin(view), boost::end(view),
                    boost::begin(view) + seg_id.segment_index, true);

        for (signed_size_type i = 0; i < offset; ++i, ++it)
        {
        }

        geometry::convert(*it, point);
        return true;
    }
};

template <typename Polygon, bool Reverse, typename SegmentIdentifier, typename PointOut>
struct copy_segment_point_polygon
{
    static inline bool apply(Polygon const& polygon,
            SegmentIdentifier const& seg_id, int offset,
            PointOut& point)
    {
        // Call ring-version with the right ring
        return copy_segment_point_range
            <
                typename geometry::ring_type<Polygon>::type,
                Reverse,
                SegmentIdentifier,
                PointOut
            >::apply
                (
                    seg_id.ring_index < 0
                        ? geometry::exterior_ring(polygon)
                        : range::at(geometry::interior_rings(polygon), seg_id.ring_index),
                    seg_id, offset,
                    point
                );
    }
};

template <typename Box, bool Reverse, typename SegmentIdentifier, typename PointOut>
struct copy_segment_point_box
{
    static inline bool apply(Box const& box,
            SegmentIdentifier const& seg_id, int offset,
            PointOut& point)
    {
        signed_size_type index = seg_id.segment_index;
        for (int i = 0; i < offset; i++)
        {
            index++;
        }

        boost::array<typename point_type<Box>::type, 4> bp;
        assign_box_corners_oriented<Reverse>(box, bp);
        point = bp[index % 4];
        return true;
    }
};

template
<
    typename MultiGeometry,
    typename SegmentIdentifier,
    typename PointOut,
    typename Policy
>
struct copy_segment_point_multi
{
    static inline bool apply(MultiGeometry const& multi,
                             SegmentIdentifier const& seg_id, int offset,
                             PointOut& point)
    {

        BOOST_GEOMETRY_ASSERT
            (
                seg_id.multi_index >= 0
                && seg_id.multi_index < int(boost::size(multi))
            );

        // Call the single-version
        return Policy::apply(range::at(multi, seg_id.multi_index), seg_id, offset, point);
    }
};

}} // namespace detail::copy_segments
#endif // DOXYGEN_NO_DETAIL

#ifndef DOXYGEN_NO_DISPATCH
namespace dispatch
{

template
<
    typename Tag,
    typename GeometryIn,
    bool Reverse,
    typename SegmentIdentifier,
    typename PointOut
>
struct copy_segment_point
{
    BOOST_MPL_ASSERT_MSG
        (
            false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
            , (types<GeometryIn>)
        );
};

template <typename LineString, bool Reverse, typename SegmentIdentifier, typename PointOut>
struct copy_segment_point<linestring_tag, LineString, Reverse, SegmentIdentifier, PointOut>
    : detail::copy_segments::copy_segment_point_range
        <
            LineString, Reverse, SegmentIdentifier, PointOut
        >
{};

template <typename Ring, bool Reverse, typename SegmentIdentifier, typename PointOut>
struct copy_segment_point<ring_tag, Ring, Reverse, SegmentIdentifier, PointOut>
    : detail::copy_segments::copy_segment_point_range
        <
            Ring, Reverse, SegmentIdentifier, PointOut
        >
{};

template <typename Polygon, bool Reverse, typename SegmentIdentifier, typename PointOut>
struct copy_segment_point<polygon_tag, Polygon, Reverse, SegmentIdentifier, PointOut>
    : detail::copy_segments::copy_segment_point_polygon
        <
            Polygon, Reverse, SegmentIdentifier, PointOut
        >
{};

template <typename Box, bool Reverse, typename SegmentIdentifier, typename PointOut>
struct copy_segment_point<box_tag, Box, Reverse, SegmentIdentifier, PointOut>
    : detail::copy_segments::copy_segment_point_box
        <
            Box, Reverse, SegmentIdentifier, PointOut
        >
{};

template
<
    typename MultiGeometry,
    bool Reverse,
    typename SegmentIdentifier,
    typename PointOut
>
struct copy_segment_point
    <
        multi_polygon_tag,
        MultiGeometry,
        Reverse,
        SegmentIdentifier,
        PointOut
    >
    : detail::copy_segments::copy_segment_point_multi
        <
            MultiGeometry,
            SegmentIdentifier,
            PointOut,
            detail::copy_segments::copy_segment_point_polygon
                <
                    typename boost::range_value<MultiGeometry>::type,
                    Reverse,
                    SegmentIdentifier,
                    PointOut
                >
        >
{};

template
<
    typename MultiGeometry,
    bool Reverse,
    typename SegmentIdentifier,
    typename PointOut
>
struct copy_segment_point
    <
        multi_linestring_tag,
        MultiGeometry,
        Reverse,
        SegmentIdentifier,
        PointOut
    >
    : detail::copy_segments::copy_segment_point_multi
        <
            MultiGeometry,
            SegmentIdentifier,
            PointOut,
            detail::copy_segments::copy_segment_point_range
                <
                    typename boost::range_value<MultiGeometry>::type,
                    Reverse,
                    SegmentIdentifier,
                    PointOut
                >
        >
{};

} // namespace dispatch
#endif // DOXYGEN_NO_DISPATCH

/*!
    \brief Helper function, copies a point from a segment
    \ingroup overlay
 */
template<bool Reverse, typename Geometry, typename SegmentIdentifier, typename PointOut>
inline bool copy_segment_point(Geometry const& geometry,
            SegmentIdentifier const& seg_id, int offset,
            PointOut& point_out)
{
    concepts::check<Geometry const>();

    return dispatch::copy_segment_point
        <
            typename tag<Geometry>::type,
            Geometry,
            Reverse,
            SegmentIdentifier,
            PointOut
        >::apply(geometry, seg_id, offset, point_out);
}

/*!
    \brief Helper function, to avoid the same construct several times,
        copies a point, based on a source-index and two geometries
    \ingroup overlay
 */
template
<
    bool Reverse1, bool Reverse2,
    typename Geometry1, typename Geometry2,
    typename SegmentIdentifier,
    typename PointOut
>
inline bool copy_segment_point(Geometry1 const& geometry1, Geometry2 const& geometry2,
            SegmentIdentifier const& seg_id, int offset,
            PointOut& point_out)
{
    concepts::check<Geometry1 const>();
    concepts::check<Geometry2 const>();

    BOOST_GEOMETRY_ASSERT(seg_id.source_index == 0 || seg_id.source_index == 1);

    if (seg_id.source_index == 0)
    {
        return dispatch::copy_segment_point
            <
                typename tag<Geometry1>::type,
                Geometry1,
                Reverse1,
                SegmentIdentifier,
                PointOut
            >::apply(geometry1, seg_id, offset, point_out);
    }
    else if (seg_id.source_index == 1)
    {
        return dispatch::copy_segment_point
            <
                typename tag<Geometry2>::type,
                Geometry2,
                Reverse2,
                SegmentIdentifier,
                PointOut
            >::apply(geometry2, seg_id, offset, point_out);
    }
    // Exception?
    return false;
}

/*!
    \brief Helper function, to avoid the same construct several times,
        copies a point, based on a source-index and two geometries
    \ingroup overlay
 */
template
<
    bool Reverse1, bool Reverse2,
    typename Geometry1, typename Geometry2,
    typename SegmentIdentifier,
    typename PointOut
>
inline bool copy_segment_points(Geometry1 const& geometry1, Geometry2 const& geometry2,
            SegmentIdentifier const& seg_id,
            PointOut& point1, PointOut& point2)
{
    concepts::check<Geometry1 const>();
    concepts::check<Geometry2 const>();

    return copy_segment_point<Reverse1, Reverse2>(geometry1, geometry2, seg_id, 0, point1)
        && copy_segment_point<Reverse1, Reverse2>(geometry1, geometry2, seg_id, 1, point2);
}

/*!
    \brief Helper function, copies three points: two from the specified segment
    (from, to) and the next one
    \ingroup overlay
 */
template
<
    bool Reverse1, bool Reverse2,
    typename Geometry1, typename Geometry2,
    typename SegmentIdentifier,
    typename PointOut
>
inline bool copy_segment_points(Geometry1 const& geometry1, Geometry2 const& geometry2,
            SegmentIdentifier const& seg_id,
            PointOut& point1, PointOut& point2, PointOut& point3)
{
    concepts::check<Geometry1 const>();
    concepts::check<Geometry2 const>();

    return copy_segment_point<Reverse1, Reverse2>(geometry1, geometry2, seg_id, 0, point1)
        && copy_segment_point<Reverse1, Reverse2>(geometry1, geometry2, seg_id, 1, point2)
        && copy_segment_point<Reverse1, Reverse2>(geometry1, geometry2, seg_id, 2, point3);
}

}} // namespace boost::geometry

#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENT_POINT_HPP


text:
/*
 * Copyright 2001-2005 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.
 */
package com.sun.org.apache.xerces.internal.parsers;

import com.sun.org.apache.xerces.internal.impl.Constants;
import com.sun.org.apache.xerces.internal.util.SymbolTable;
import com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler;
import com.sun.org.apache.xerces.internal.xinclude.XIncludeNamespaceSupport;
import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;

/**
 * This parser configuration includes an XIncludeHandler in the pipeline
 * before the schema validator, or as the last component in the pipeline if there is
 * no schema validator.  Using this pipeline will enable processing according to the
 * XML Inclusions specification, to the conformance level described in
 * XIncludeHandler.
 *
 * @author Peter McCracken, IBM
 * @see com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler
 */
public class XIncludeParserConfiguration extends XML11Configuration {

    private XIncludeHandler fXIncludeHandler;

    /** Feature identifier: allow notation and unparsed entity events to be sent out of order. */
    protected static final String ALLOW_UE_AND_NOTATION_EVENTS =
        Constants.SAX_FEATURE_PREFIX + Constants.ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE;

    /** Feature identifier: fixup base URIs. */
    protected static final String XINCLUDE_FIXUP_BASE_URIS =
        Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE;

    /** Feature identifier: fixup language. */
    protected static final String XINCLUDE_FIXUP_LANGUAGE =
        Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_LANGUAGE_FEATURE;

    /** Property identifier: error reporter. */
    protected static final String XINCLUDE_HANDLER =
        Constants.XERCES_PROPERTY_PREFIX + Constants.XINCLUDE_HANDLER_PROPERTY;

    /** Property identifier: error reporter. */
    protected static final String NAMESPACE_CONTEXT =
        Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_CONTEXT_PROPERTY;

    /** Default constructor. */
    public XIncludeParserConfiguration() {
        this(null, null, null);
    } // <init>()

    /**
     * Constructs a parser configuration using the specified symbol table.
     *
     * @param symbolTable The symbol table to use.
     */
    public XIncludeParserConfiguration(SymbolTable symbolTable) {
        this(symbolTable, null, null);
    } // <init>(SymbolTable)

    /**
     * Constructs a parser configuration using the specified symbol table and
     * grammar pool.
     *

     *
     * @param symbolTable The symbol table to use.
     * @param grammarPool The grammar pool to use.
     */
    public XIncludeParserConfiguration(
        SymbolTable symbolTable,
        XMLGrammarPool grammarPool) {
        this(symbolTable, grammarPool, null);
    } // <init>(SymbolTable,XMLGrammarPool)

    /**
     * Constructs a parser configuration using the specified symbol table,
     * grammar pool, and parent settings.
     *

     *
     * @param symbolTable    The symbol table to use.
     * @param grammarPool    The grammar pool to use.
     * @param parentSettings The parent settings.
     */
    public XIncludeParserConfiguration(
        SymbolTable symbolTable,
        XMLGrammarPool grammarPool,
        XMLComponentManager parentSettings) {
        super(symbolTable, grammarPool, parentSettings);

        fXIncludeHandler = new XIncludeHandler();
        addCommonComponent(fXIncludeHandler);

        final String[] recognizedFeatures = {
            ALLOW_UE_AND_NOTATION_EVENTS,
            XINCLUDE_FIXUP_BASE_URIS,
            XINCLUDE_FIXUP_LANGUAGE
        };
        addRecognizedFeatures(recognizedFeatures);

        // add default recognized properties
        final String[] recognizedProperties =
            { XINCLUDE_HANDLER, NAMESPACE_CONTEXT };
        addRecognizedProperties(recognizedProperties);

        setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true);
        setFeature(XINCLUDE_FIXUP_BASE_URIS, true);
        setFeature(XINCLUDE_FIXUP_LANGUAGE, true);

        setProperty(XINCLUDE_HANDLER, fXIncludeHandler);
        setProperty(NAMESPACE_CONTEXT, new XIncludeNamespaceSupport());
    } // <init>(SymbolTable,XMLGrammarPool)}

        /** Configures the pipeline. */
    protected void configurePipeline() {
        super.configurePipeline();

        //configure DTD pipeline
        fDTDScanner.setDTDHandler(fDTDProcessor);
        fDTDProcessor.setDTDSource(fDTDScanner);
        fDTDProcessor.setDTDHandler(fXIncludeHandler);
        fXIncludeHandler.setDTDSource(fDTDProcessor);
                fXIncludeHandler.setDTDHandler(fDTDHandler);
        if (fDTDHandler != null) {
            fDTDHandler.setDTDSource(fXIncludeHandler);
        }

        // configure XML document pipeline: insert after DTDValidator and
        // before XML Schema validator
        XMLDocumentSource prev = null;
        if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
            // we don't have to worry about fSchemaValidator being null, since
            // super.configurePipeline() instantiated it if the feature was set
            prev = fSchemaValidator.getDocumentSource();
        }
        // Otherwise, insert after the last component in the pipeline
        else {
            prev = fLastComponent;
            fLastComponent = fXIncludeHandler;
        }

         if (prev != null) {
            XMLDocumentHandler next = prev.getDocumentHandler();
            prev.setDocumentHandler(fXIncludeHandler);
            fXIncludeHandler.setDocumentSource(prev);
            if (next != null) {
                fXIncludeHandler.setDocumentHandler(next);
                next.setDocumentSource(fXIncludeHandler);
            }
         }
         else {
            setDocumentHandler(fXIncludeHandler);
         }

    } // configurePipeline()

        protected void configureXML11Pipeline() {
                super.configureXML11Pipeline();

        // configure XML 1.1. DTD pipeline
                fXML11DTDScanner.setDTDHandler(fXML11DTDProcessor);
                fXML11DTDProcessor.setDTDSource(fXML11DTDScanner);
                fXML11DTDProcessor.setDTDHandler(fXIncludeHandler);
                fXIncludeHandler.setDTDSource(fXML11DTDProcessor);
                fXIncludeHandler.setDTDHandler(fDTDHandler);
                if (fDTDHandler != null) {
                        fDTDHandler.setDTDSource(fXIncludeHandler);
                }

                // configure XML document pipeline: insert after DTDValidator and
                // before XML Schema validator
                XMLDocumentSource prev = null;
                if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
                        // we don't have to worry about fSchemaValidator being null, since
                        // super.configurePipeline() instantiated it if the feature was set
                        prev = fSchemaValidator.getDocumentSource();
                }
                // Otherwise, insert after the last component in the pipeline
                else {
                        prev = fLastComponent;
                        fLastComponent = fXIncludeHandler;
                }

                XMLDocumentHandler next = prev.getDocumentHandler();
                prev.setDocumentHandler(fXIncludeHandler);
                fXIncludeHandler.setDocumentSource(prev);
                if (next != null) {
                        fXIncludeHandler.setDocumentHandler(next);
                        next.setDocumentSource(fXIncludeHandler);
                }

        } // configureXML11Pipeline()

    public void setProperty(String propertyId, Object value)
        throws XMLConfigurationException {

        if (propertyId.equals(XINCLUDE_HANDLER)) {
        }

        super.setProperty(propertyId, value);
    } // setProperty(String,Object)
}


text:
package io.swagger.api;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2017-02-13T15:04:21.309Z")
public class NotFoundException extends ApiException {
    private int code;

    public NotFoundException(int code, String msg) {
        super(code, msg);
        this.code = code;
    }
}


text:
Interface for factories that can be used to create datagram instances from a hostname or unix socket path, port number (`null` for unix socket), and list of options.

## create()

    DatagramFactory::create(
        string $host,
        int $port,
        mixed[] $options = []
    ): Icicle\Socket\Datagram\Datagram

Creates a datagram bound and listening on the given IP and port number. No options are defined in this implementation.

### Parameters
`string $host`
:   IP address of receiver.

`int $port`
:   Port of receiver.

`mixed[] $options = []`
:   Array of additional options.


text:
using System.Collections.Generic;

namespace Kachuwa.Localization
{
    public class LocaleRegionEditViewModel : LocaleRegion
    {
        public List<EditLocaleResource> Resources { get; set; }

    }
}


text:
module LastPass
    class Vault
        attr_reader :accounts

        # Fetches a blob from the server and creates a vault
        def self.open_remote username, password, multifactor_password = nil, client_id = nil
            blob = Vault.fetch_blob username, password, multifactor_password, client_id
            open blob, username, password
        end

        # Creates a vault from a locally stored blob
        def self.open_local blob_filename, username, password
            # TODO: read the blob here
            raise NotImplementedError
        end

        # Creates a vault from a blob object
        def self.open blob, username, password
            new blob, blob.encryption_key(username, password)
        end

        # Just fetches the blob, could be used to store it locally
        def self.fetch_blob username, password, multifactor_password = nil, client_id = nil
            session = Fetcher.login username, password, multifactor_password, client_id
            blob = Fetcher.fetch session
            Fetcher.logout session

            blob
        end

        # This more of an internal method, use one of the static constructors instead
        def initialize blob, encryption_key
            chunks = Parser.extract_chunks blob
            if !complete? chunks
                raise InvalidResponseError, "Blob is truncated"
            end

            @accounts = parse_accounts chunks, encryption_key
        end

        def complete? chunks
            !chunks.empty? && chunks.last.id == "ENDM" && chunks.last.payload == "OK"
        end

        def parse_accounts chunks, encryption_key
            accounts = []

            key = encryption_key
            rsa_private_key = nil

            chunks.each do |i|
                case i.id
                when "ACCT"
                    # TODO: Put shared folder name as group in the account
                    account = Parser.parse_ACCT i, key
                    if account
                        accounts << account
                    end
                when "PRIK"
                    rsa_private_key = Parser.parse_PRIK i, encryption_key
                when "SHAR"
                    # After SHAR chunk all the folliwing accounts are enrypted with a new key
                    key = Parser.parse_SHAR(i, encryption_key, rsa_private_key)[:encryption_key]
                end
            end

            accounts
        end
    end
end


text:
[![GoDoc](https://godoc.org/github.com/abieberbach/goplanemp?status.svg)](https://godoc.org/github.com/abieberbach/goplanemp)

Multiplayer-Bibliothek für X-Plane.
Die Umsetzung basiert auf dem Code der libxplanemp Bibliothek.
Weitere Informationen unter https://github.com/wadesworld2112/libxplanemp.

Für die Darstellung können vorhandene CSL-Pakete genutzt werden. Zusätzlich unterstützt diese Bibliothek auch die Darstellung von OBJ8-Objekten.
Bei den OBJ8-Objekte werden auch Animationen unterstützt.

Die Bibliothek kann in einem X-Plane Plugin wie folgt genutzt werden:

## Voraussetzungen

Diese Bibliothek kann in Plugins verwendet werden, die in der Programmiersprace [GO](http://www.golang.org) geschrieben sind.
Zusätzlich verwendet es die GO-Bindings des X-Plane SDKs. Sie werden im Projekt [goplane](https://github.com/abieberbach/goplane) verwaltet.

## Erstellung des MultiplayerManagers

Schritt 1 (während der Start-Phase des Plugins) MultiplayerManager angelegen

```
config := NewDefaultConfiguration()
mpManager, err := New(cslPath, relatedTxt, lightsPng, defaultIcao, config)
```

Schritt 2 (während der Enable-Phase des Plugins) MultiplayerManager aktivieren

```
if mpManager != nil {
	mpManager.Enable()
}
```

## Neue Flugzeuge und Fahrzeuge hinzufügen

Flugzeuge und Fahrzeuge können über die CreatePlane-Funktion hinzugefügt werden. Dazu muss das ICAO-Kürzel des Flugzeugs und der Airline und ggf. ein Livery angegeben werden.
Welches Objekt der MultiplayerManager auswählt, erfolgt nach dieser Reihenfolge:

	1. ICAO, Airline und Livery stimmen überein
	2. ICAO und Airline stimmen überein
	3. verwandter ICAO, Airline und Livery stimmen überein
	4. verwandter ICAO und Airline stimmen überein
	5. ICAO stimmt überein
	6. verwandter ICAO stimmt überein
	7. Standard-ICAO stimmt überein
	8. verwandter Standard-ICAO stimmt überein
	9. beliebiges Flugzeug nehmen

Beispiel zum Hinzufügen eines neuen Flugzeugs

```
planeId := mpManager.CreatePlane("B738", "BER", "WL", dataFunc, ref)
```

## Unterstütze Plattformen

- Linux: x64
- Mac: nicht getestet
- Windows: nicht unterstützt (siehe offenen Issue bei GO https://github.com/golang/go/issues/11058)

## License
This library is distributed under license found in the LICENSE file.


text:
<?php

/**
 * This is the model class for table "{{authorizer}}".
 *
 * The followings are the available columns in table '{{authorizer}}':
 * @property string $id
 * @property string $username
 * @property string $uid
 * @property string $url
 * @property string $version
 * @property integer $type
 * @property string $dateline
 */
class Authorizer extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return Authorizer the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return '{{authorizer}}';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('username, uid, url, version, type, dateline', 'required'),
			array('type', 'numerical', 'integerOnly'=>true),
			array('username, version', 'length', 'max'=>25),
			array('uid', 'length', 'max'=>8),
			array('url,sqm', 'length', 'max'=>255),
			array('dateline', 'length', 'max'=>11),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, username, uid, url, version, type, dateline,sqm', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'username' => 'Username',
			'uid' => 'Uid',
			'url' => 'Url',
			'version' => 'Version',
			'type' => 'Type',
			'dateline' => 'Dateline',
			'sqm' => 'Sqm',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id,true);
		$criteria->compare('username',$this->username,true);
		$criteria->compare('uid',$this->uid,true);
		$criteria->compare('url',$this->url,true);
		$criteria->compare('version',$this->version,true);
		$criteria->compare('type',$this->type);
		$criteria->compare('dateline',$this->dateline,true);
		$criteria->compare('sqm',$this->sqm,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}

	public static function getVersion($version){
		$r = Version::model()->findByAttributes(array('version_number'=>$version));
		if(null != $r){
			return $r->title;
		}else{
			return '未知版本';
		}
		switch ($version){
			case 1:
				$vname = '免费版';break;
			case 2:
				$vname = '基础版';break;
			case 3:
				$vname = '标准版';break;
			case 4:
				$vname = '高级版';break;
			case 5:
				$vname = '豪华版';break;
			default:
				$vname = '免费版';
		}
		return $vname;
	}
}


text:
namespace network {
class SharedURLLoaderFactory;
class SimpleURLLoader;
}  // namespace network

namespace safe_browsing {

class ClientIncidentReport;

// An uploader of incident reports. A report is issued via the UploadReport
// method. The upload can be cancelled by deleting the returned instance. The
// instance is no longer usable after the delegate is notified, and may safely
// be destroyed by the delegate.
class IncidentReportUploaderImpl : public IncidentReportUploader {
 public:
  // The id associated with the URLFetcher, for use by tests.
  static const int kTestUrlFetcherId;

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

  ~IncidentReportUploaderImpl() override;

  // Uploads a report with a caller-provided URL context. |callback| will be run
  // when the upload is complete. Returns NULL if |report| cannot be serialized
  // for transmission, in which case the delegate is not notified.
  static std::unique_ptr<IncidentReportUploader> UploadReport(
      OnResultCallback callback,
      const scoped_refptr<network::SharedURLLoaderFactory>& url_loader_factory,
      const ClientIncidentReport& report);

 private:
  FRIEND_TEST_ALL_PREFIXES(IncidentReportUploaderImplTest, Success);

  IncidentReportUploaderImpl(
      OnResultCallback callback,
      const scoped_refptr<network::SharedURLLoaderFactory>& url_loader_factory,
      const std::string& post_data);

  // Returns the URL to which incident reports are to be sent.
  static GURL GetIncidentReportUrl();

  // Callback when SimpleURLLoader gets the response.
  void OnURLLoaderComplete(std::unique_ptr<std::string> response_body);

  void OnURLLoaderCompleteInternal(const std::string& response_body,
                                   int response_code,
                                   int net_error);

  // The underlying URLLoader. The instance is alive from construction through
  // OnURLLoaderComplete.
  std::unique_ptr<network::SimpleURLLoader> url_loader_;

  // The time at which the upload was initiated.
  base::TimeTicks time_begin_;
};

}  // namespace safe_browsing

#endif  // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_INCIDENT_REPORT_UPLOADER_IMPL_H_