text:
package org.sleuthkit.autopsy.experimental.autoingest;

import java.io.Serializable;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Instant;
import java.util.Comparator;
import java.util.Date;
import java.util.Objects;
import javax.annotation.concurrent.GuardedBy;
import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.ThreadSafe;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor;
import org.sleuthkit.autopsy.coreutils.NetworkUtils;
import org.sleuthkit.autopsy.ingest.IngestJob;

/**
 * An automated ingest job for a manifest. The manifest specifies a co-located
 * data source and a case to which the data source is to be added.
 */
@ThreadSafe
public final class AutoIngestJob implements Comparable<AutoIngestJob>, Serializable {

    private static final long serialVersionUID = 1L;
    private static final String LOCAL_HOST_NAME = NetworkUtils.getLocalHostName();
    private final Manifest manifest;
    private final String nodeName;
    @GuardedBy("this")
    private String caseDirectoryPath;
    @GuardedBy("this")
    private Integer priority;
    @GuardedBy("this")
    private Stage stage;
    @GuardedBy("this")
    private Date stageStartDate;
    @GuardedBy("this")
    transient private DataSourceProcessor dataSourceProcessor;
    @GuardedBy("this")
    transient private IngestJob ingestJob;
    @GuardedBy("this")
    transient private boolean cancelled;
    @GuardedBy("this")
    transient private boolean completed;
    @GuardedBy("this")
    private Date completedDate;
    @GuardedBy("this")
    private boolean errorsOccurred;

    /**
     * Constructs an automated ingest job for a manifest. The manifest specifies
     * a co-located data source and a case to which the data source is to be
     * added.
     *
     * @param manifest          The manifest
     * @param caseDirectoryPath The path to the case directory for the job, may
     *                          be null.
     * @param priority          The priority of the job. The higher the number,
     *                          the higher the priority.
     * @param nodeName          If the job is in progress, the node doing the
     *                          processing, otherwise the locla host.
     * @param stage             The processing stage for display purposes.
     * @param completedDate     The date when the job was completed. Use the
     *                          epoch (January 1, 1970, 00:00:00 GMT) to
     *                          indicate the the job is not completed, i.e., new
     *                          Date(0L).
     */
    AutoIngestJob(Manifest manifest, Path caseDirectoryPath, int priority, String nodeName, Stage stage, Date completedDate, boolean errorsOccurred) {
        this.manifest = manifest;
        if (null != caseDirectoryPath) {
            this.caseDirectoryPath = caseDirectoryPath.toString();
        } else {
            this.caseDirectoryPath = "";
        }
        this.priority = priority;
        this.nodeName = nodeName;
        this.stage = stage;
        this.stageStartDate = manifest.getDateFileCreated();
        this.completedDate = completedDate;
        this.errorsOccurred = errorsOccurred;
    }

    /**
     * Gets the auto ingest jobmanifest.
     *
     * @return The manifest.
     */
    Manifest getManifest() {
        return this.manifest;
    }

    /**
     * Queries whether or not a case directory path has been set for this auto
     * ingest job.
     *
     * @return True or false
     */
    synchronized boolean hasCaseDirectoryPath() {
        return (false == this.caseDirectoryPath.isEmpty());
    }

    /**
     * Sets the path to the case directory of the case associated with this job.
     *
     * @param caseDirectoryPath The path to the case directory.
     */
    synchronized void setCaseDirectoryPath(Path caseDirectoryPath) {
        this.caseDirectoryPath = caseDirectoryPath.toString();
    }

    /**
     * Gets the path to the case directory of the case associated with this job,
     * may be null.
     *
     * @return The case directory path or null if the case directory has not
     *         been created yet.
     */
    synchronized Path getCaseDirectoryPath() {
        if (!caseDirectoryPath.isEmpty()) {
            return Paths.get(caseDirectoryPath);
        } else {
            return null;
        }
    }

    /**
     * Sets the priority of the job. A higher number indicates a higher
     * priority.
     *
     * @param priority The priority.
     */
    synchronized void setPriority(Integer priority) {
        this.priority = priority;
    }

    /**
     * Gets the priority of the job. A higher number indicates a higher
     * priority.
     *
     * @return The priority.
     */
    synchronized Integer getPriority() {
        return this.priority;
    }

    synchronized void setStage(Stage newStage) {
        setStage(newStage, Date.from(Instant.now()));
    }

    synchronized void setStage(Stage newState, Date stateStartedDate) {
        if (Stage.CANCELLING == this.stage && Stage.COMPLETED != newState) {
            return;
        }
        this.stage = newState;
        this.stageStartDate = stateStartedDate;
    }

    synchronized Stage getStage() {
        return this.stage;
    }

    synchronized Date getStageStartDate() {
        return this.stageStartDate;
    }

    synchronized StageDetails getStageDetails() {
        String description;
        Date startDate;
        if (Stage.CANCELLING != this.stage && null != this.ingestJob) {
            IngestJob.ProgressSnapshot progress = this.ingestJob.getSnapshot();
            IngestJob.DataSourceIngestModuleHandle ingestModuleHandle = progress.runningDataSourceIngestModule();
            if (null != ingestModuleHandle) {
                /**
                 * A first or second stage data source level ingest module is
                 * running. Reporting this takes precedence over reporting
                 * generic file analysis.
                 */
                startDate = ingestModuleHandle.startTime();
                if (!ingestModuleHandle.isCancelled()) {
                    description = ingestModuleHandle.displayName();
                } else {
                    description = String.format(Stage.CANCELLING_MODULE.getDisplayText(), ingestModuleHandle.displayName());
                }
            } else {
                /**
                 * If no data source level ingest module is running, then either
                 * it is still the first stage of analysis and file level ingest
                 * modules are running or another ingest job is still running.
                 * Note that there can be multiple ingest jobs running in
                 * parallel. For example, there is an ingest job created to
                 * ingest each extracted virtual machine.
                 */
                description = Stage.ANALYZING_FILES.getDisplayText();
                startDate = progress.fileIngestStartTime();
            }
        } else {
            description = this.stage.getDisplayText();
            startDate = this.stageStartDate;
        }
        return new StageDetails(description, startDate);
    }

    synchronized void setDataSourceProcessor(DataSourceProcessor dataSourceProcessor) {
        this.dataSourceProcessor = dataSourceProcessor;
    }

    synchronized void setIngestJob(IngestJob ingestJob) {
        this.ingestJob = ingestJob;
    }

    synchronized IngestJob getIngestJob() {
        return this.ingestJob;
    }

    synchronized void cancel() {
        setStage(Stage.CANCELLING);
        cancelled = true;
        errorsOccurred = true;
        if (null != dataSourceProcessor) {
            dataSourceProcessor.cancel();
        }
        if (null != ingestJob) {
            ingestJob.cancel(IngestJob.CancellationReason.USER_CANCELLED);
        }
    }

    synchronized boolean isCancelled() {
        return cancelled;
    }

    synchronized void setCompleted() {
        setStage(Stage.COMPLETED);
        completed = true;
    }

    synchronized boolean isCompleted() {
        return completed;
    }

    /**
     * Sets the date the job was completed, with or without cancellation or
     * errors.
     *
     * @param completedDate The completion date.
     */
    synchronized void setCompletedDate(Date completedDate) {
        this.completedDate = completedDate;
    }

    /**
     * Gets the date the job was completed, with or without cancellation or
     * errors.
     *
     * @return True or false.
     */
    synchronized Date getCompletedDate() {
        return completedDate;
    }

    /**
     * Sets whether or not erros occurred during the processing of the job.
     *
     * @param errorsOccurred True or false;
     */
    synchronized void setErrorsOccurred(boolean errorsOccurred) {
        this.errorsOccurred = errorsOccurred;
    }

    /**
     * Queries whether or not erros occurred during the processing of the job.
     *
     * @return True or false.
     */
    synchronized boolean hasErrors() {
        return this.errorsOccurred;
    }

    String getNodeName() {
        return nodeName;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof AutoIngestJob)) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        return this.getManifest().getFilePath().equals(((AutoIngestJob) obj).getManifest().getFilePath());
    }

    @Override
    public int hashCode() {
        int hash = 71 * (Objects.hashCode(this.caseDirectoryPath));
        return hash;
    }

    @Override
    public int compareTo(AutoIngestJob o) {
        return -this.getManifest().getDateFileCreated().compareTo(o.getManifest().getDateFileCreated());
    }

    /**
     * Custom comparator that allows us to sort List<AutoIngestJob> on reverse
     * chronological date modified (descending)
     */
    static class ReverseDateCompletedComparator implements Comparator<AutoIngestJob> {

        @Override
        public int compare(AutoIngestJob o1, AutoIngestJob o2) {
            return -o1.getStageStartDate().compareTo(o2.getStageStartDate());
        }
    }

    /**
     * Comparator that sorts auto ingest jobs by priority in descending order.
     */
    public static class PriorityComparator implements Comparator<AutoIngestJob> {

        @Override
        public int compare(AutoIngestJob job, AutoIngestJob anotherJob) {
            return -(job.getPriority().compareTo(anotherJob.getPriority()));
        }

    }

    /**
     * Custom comparator that allows us to sort List<AutoIngestJob> on case name
     * alphabetically except for jobs for the current host, which are placed at
     * the top of the list.
     */
    static class AlphabeticalComparator implements Comparator<AutoIngestJob> {

        @Override
        public int compare(AutoIngestJob o1, AutoIngestJob o2) {
            if (o1.getNodeName().equalsIgnoreCase(LOCAL_HOST_NAME)) {
                return -1; // o1 is for current case, float to top
            } else if (o2.getNodeName().equalsIgnoreCase(LOCAL_HOST_NAME)) {
                return 1; // o2 is for current case, float to top
            } else {
                return o1.getManifest().getCaseName().compareToIgnoreCase(o2.getManifest().getCaseName());
            }
        }
    }

    enum Stage {

        PENDING("Pending"),
        STARTING("Starting"),
        UPDATING_SHARED_CONFIG("Updating shared configuration"),
        CHECKING_SERVICES("Checking services"),
        OPENING_CASE("Opening case"),
        IDENTIFYING_DATA_SOURCE("Identifying data source type"),
        ADDING_DATA_SOURCE("Adding data source"),
        ANALYZING_DATA_SOURCE("Analyzing data source"),
        ANALYZING_FILES("Analyzing files"),
        EXPORTING_FILES("Exporting files"),
        CANCELLING_MODULE("Cancelling module"),
        CANCELLING("Cancelling"),
        COMPLETED("Completed");

        private final String displayText;

        private Stage(String displayText) {
            this.displayText = displayText;
        }

        String getDisplayText() {
            return displayText;
        }

    }

    @Immutable
    static final class StageDetails {

        private final String description;
        private final Date startDate;

        private StageDetails(String description, Date startDate) {
            this.description = description;
            this.startDate = startDate;
        }

        String getDescription() {
            return this.description;
        }

        Date getStartDate() {
            return this.startDate;
        }

    }

}


text:
var app = angular.module("bhimgeete", ['ui.bootstrap','ngRoute' ,'djds4rce.angular-socialshare']);

app.filter('startFrom', function() {
    return function(input, start) {
        if (!input || !input.length) { return; }
        start = +start; //parse to int
        return input.slice(start);
    }
});

app.config(['$routeProvider','$locationProvider', function($routeProvider,$locationProvider){
  // routeProvider config, allows minification
    //$routeProvider.when('/',{title:'index',templateUrl:'modules/test.html',controller: 'HomeCtrl'})
  //  $routeProvider.when('/home/:id',{title:'home',templateUrl:'modules/home.html',controller: 'AlbmCtrl'})
    // $routeProvider.when('/albums',{title:'album',templateUrl:'modules/album.html',controller: 'HomeCtrl'})
    // $routeProvider.when('/contact',{title:'contact',templateUrl:'modules/test.html',controller: 'HomeCtrl'})
     $routeProvider.when('/',{title:'contact',templateUrl:'modules/contact.html',controller: 'contactCtrl'})
    $routeProvider.otherwise({redirectTo:'/'})
 //  $locationProvider.html5Mode(true);

}]);
app.run(function($FB){
  $FB.init('1617467908502490');
});

app.controller('HomeCtrl', function($scope, $http,$timeout,$rootScope)
{
    $scope.albums={};
    $scope.singers={};
    $scope.categories={};
    $scope.songs={};
    $scope.totalalbum = {};
    $scope.currentPage = 1; //current page
    $scope.entryLimit = 10;
    $http.get('index.php/home/alldt')
    .success(function(data){
    $scope.albums=data.albums;
    $scope.singers=data.singers;
    $scope.categories=data.categories;
    $scope.songs=data.songs;
    $scope.filteredItems_songs = $scope.songs.length; //Initially for no filter
    $scope.totalItems_songs = $scope.songs.length;
    $scope.filteredItems = $scope.albums.length; //Initially for no filter
    $scope.totalItems = $scope.albums.length;
    $scope.music = null;
    });
     $scope.setPage = function(pageNo) {
        $scope.currentPage = pageNo;
    };
    $scope.filter = function() {
        $timeout(function() {
            $scope.filteredItems = $scope.filtered.length;

        }, 10);
    };$scope.songfilter = function() {
        $timeout(function() {
            $scope.filteredItems_songs = $scope.filtered.length;

        }, 10);
    };
    $scope.sort_by = function(predicate) {
        $scope.predicate = predicate;
        $scope.reverse = !$scope.reverse;
    };
    $scope.test = function(user)
    {
      $scope.song={};
        $http.get('index.php/home/addToPlay/'+user)
    .success(function(data){
            if(data.success)
            {
                $rootScope.$broadcast('playMusic',data.song);
            }
    });
    }
    $scope.getShareCount= function (i,j,k,url) {
        apiUtility.executeApi('GET','http://graph.facebook.com/?id='+url)
            .then(function(data)
            {
                $scope.GalleryModel.gallery[i].events[j].photos[k].shared=(data.shares!=undefined?data.shares:0);
            });
}
});
app.controller('musicPlayerCtrl',function($scope){
    $scope.currentMusic = null;
    $scope.$on('playMusic', function(event,music){
        $scope.currentMusic = music;
    });

});app.controller('contactCtrl',function ($scope, $http) {
    $scope.result = 'hidden'
    $scope.resultMessage;
    $scope.formData; //formData is an object holding the name, email, subject, and message
    $scope.submitButtonDisabled = false;
    $scope.submitted = false; //used so that form errors are shown only after the form has been submitted
    $scope.submit = function(contactform) {
        $scope.submitted = true;
        $scope.submitButtonDisabled = true;
        if (contactform.$valid) {
            $http({
                method  : 'POST',
                url     : 'index.php/home/contactus',
                data    : $.param($scope.formData),  //param method from jQuery
                headers : { 'Content-Type': 'application/x-www-form-urlencoded' }  //set the headers so angular passing info as form data (not request payload)
            }).success(function(data){
                console.log(data);
                if (data.success) { //success comes from the return json object
                    $scope.submitButtonDisabled = true;
                    $scope.resultMessage = data.message;
                    $scope.result='bg-success';
                } else {
                    $scope.submitButtonDisabled = false;
                    $scope.resultMessage = data.message;
                    $scope.result='bg-danger';
                }
            });
        }
    }
});
app.controller('AlbmCtrl',function($scope,$routeParams,$http,$rootScope){
   var id=$routeParams.id;
    $http.get('index.php/home/albumSongs/'+id)
    .success(function(data){
        console.log(data.AlbumSongs);
    $scope.albumsdata=data.AlbumSongs;
    $scope.albums=data.albums;
    $scope.selectalbuminfo=data.selectalbuminfo;
    });
     $scope.test = function(user)
    {
      $scope.song={};
        $http.get('index.php/home/addToPlay/'+user)
    .success(function(data){
            if(data.success)
            {
                $rootScope.$broadcast('playMusic',data.song);
            }
    });
    }
        $scope.getShareCount= function (i,j,k,url) {
        apiUtility.executeApi('GET','http://graph.facebook.com/?id='+url)
            .then(function(data)
            {
                $scope.GalleryModel.gallery[i].events[j].photos[k].shared=(data.shares!=undefined?data.shares:0);
            });
}
    });

redpajama_set_name: RedPajamaGithub


text:
package io.infinicast;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;

import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class JObject extends JToken {
    public JObject() {
        super();
    }

    public JObject(JObject rhs) {
        this(rhs.node);
    }

    JObject(JsonNode node) {
        super(node);
    }

    public static JObject Parse(String rhs) {
        ObjectNode node = JsonHelpers.parse(rhs);
        return new JObject(node);
    }

    public boolean containsKey(String key) {
        return node.get(key) != null;
    }

    public Collection<String> getKeys() {

        Iterator<String> stringIterator = node.fieldNames();
        Set<String> col = new HashSet<>();
        while (stringIterator.hasNext()) {
            col.add(stringIterator.next());
        }
        return col;
    }

}


text:
'use strict';

var transports = require('transports');
var data = require('./data');
var local = require('./local');
var providerHandler = require('./providerHandler');

function initialize () {
  transports.configure(data);
  transports.serialization();
  transports.passports(providerHandler);

  local();
}

module.exports = {
  initialize: initialize
};


text:
require 'helper'
require 'write_xlsx'
require 'stringio'

class TestStyles01 < Minitest::Test
  def test_styles_01
    workbook = WriteXLSX.new(StringIO.new)
    workbook.__send__('prepare_format_properties')

    @style = Writexlsx::Package::Styles.new
    @style.set_style_properties(*workbook.style_properties)
    @style.assemble_xml_file
    result = got_to_array(@style.xml_str)
    expected = expected_to_array(<<EOS
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
  <fonts count="1">
    <font>
      <sz val="11"/>
      <color theme="1"/>
      <name val="Calibri"/>
      <family val="2"/>
      <scheme val="minor"/>
    </font>
  </fonts>
  <fills count="2">
    <fill>
      <patternFill patternType="none"/>
    </fill>
    <fill>
      <patternFill patternType="gray125"/>
    </fill>
  </fills>
  <borders count="1">
    <border>
      <left/>
      <right/>
      <top/>
      <bottom/>
      <diagonal/>
    </border>
  </borders>
  <cellStyleXfs count="1">
    <xf numFmtId="0" fontId="0" fillId="0" borderId="0"/>
  </cellStyleXfs>
  <cellXfs count="1">
    <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>
  </cellXfs>
  <cellStyles count="1">
    <cellStyle name="Normal" xfId="0" builtinId="0"/>
  </cellStyles>
  <dxfs count="0"/>
  <tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleLight16"/>
</styleSheet>
EOS
                                )
    assert_equal(expected, result)
  end
end


text:
package org.xdi.oxauth.service.external.internal;

import org.xdi.model.SimpleCustomProperty;
import org.xdi.model.custom.script.type.auth.DummyPersonAuthenticationType;
import org.xdi.model.security.Credentials;
import org.xdi.oxauth.service.AuthenticationService;

import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.Map;

/**
 * Wrapper to call internal authentication method
 *
 * @author Yuriy Movchan Date: 06/04/2015
 */
@Stateless
@Named
public class InternalDefaultPersonAuthenticationType extends DummyPersonAuthenticationType {

	@Inject
	private AuthenticationService authenticationService;

	@Inject
	private Credentials credentials;

	public InternalDefaultPersonAuthenticationType() {
	}

	@Override
	public boolean authenticate(Map<String, SimpleCustomProperty> configurationAttributes, Map<String, String[]> requestParameters, int step) {
		if (!credentials.isSet()) {
			return false;
		}

		return authenticationService.authenticate(credentials.getUsername(), credentials.getPassword());
	}

	@Override
	public boolean prepareForStep(Map<String, SimpleCustomProperty> configurationAttributes, Map<String, String[]> requestParameters, int step) {
		if (step == 1) {
			return true;
		}

		return super.prepareForStep(configurationAttributes, requestParameters, step);
	}

	@Override
	public int getCountAuthenticationSteps(Map<String, SimpleCustomProperty> configurationAttributes) {
		return 1;
	}

	@Override
	public boolean logout(Map<String, SimpleCustomProperty> configurationAttributes, Map<String, String[]> requestParameters) {
		return true;
	}

}


text:
package com.arangodb.entity;

import com.arangodb.velocypack.annotations.SerializedName;

/**
 * @author Mark Vollmary
 */
public class VertexUpdateEntity extends DocumentEntity {

    @SerializedName("_oldRev")
    private String oldRev;

    public VertexUpdateEntity() {
        super();
    }

    public String getOldRev() {
        return oldRev;
    }

}


text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Appleseed.Base.Data.Model;
using Appleseed.Base.Data.Repository.Contracts;
using Appleseed.Base.Data.Service;
using Appleseed.Base.Data.Utility;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.QueryParsers;
using Lucene.Net.Search;
using Version = Lucene.Net.Util.Version;

namespace Appleseed.Base.Data.Repository
{
    public class LuceneRepository:ILuceneRepository
    {
        public void Insert(BaseCollectionItem baseCollectionItem)
        {
            baseCollectionItem.Id = Guid.NewGuid();
            baseCollectionItem.CreatedDate = DateTime.Now;
            var analyzer = new StandardAnalyzer(Version.LUCENE_30);
            using (var writer = new IndexWriter(LuceneService.Directory, analyzer, IndexWriter.MaxFieldLength.UNLIMITED))
            {
                // add data to lucene search index (replaces older entry if any)

                AddToLuceneIndex(baseCollectionItem, writer);
                // close handles
                analyzer.Close();
                writer.Dispose();
            }
        }

        public void Update(BaseCollectionItem baseCollectionItem)
        {
            var query = baseCollectionItem.Id.ToString();
            var items = SearchItems(query, "Id");
            foreach (var item in items)
            {
                ClearLuceneIndexRecord(item.Id);
                Insert(baseCollectionItem);
            }
        }

        public void DeleteProcessedItems()
        {
            ////TODO :  find all the processed items and delete them one by one or all at once

            var query = "true";
            var items = SearchItems(query, "ItemProcessed");

            foreach (var item in items)
            {
                ClearLuceneIndexRecord(item.Id);
            }
        }

        //public List<BaseCollectionItem> GetAllFromQueue()
        //{
        //    var itemCollection = new List<BaseCollectionItem>();
        //    foreach (var baseCollectionItem in InMemoryCollectionItemQueue.InMemoryCollectionItems)
        //    {
        //        var baseCollectionItemData = new BaseCollectionItemData
        //        {
        //            ItemID = baseCollectionItem.ItemId,
        //            ItemTitle = baseCollectionItem.ItemTitle,
        //            ItemUrl = baseCollectionItem.ItemUrl,
        //            ItemContent_Image = "",
        //            ItemContent_Raw = "",
        //            ItemDescription = baseCollectionItem.ItemDescription,
        //            ItemTags = baseCollectionItem.ItemTags,
        //            ItemProcessedDate = DateTime.Today
        //        };

        //        itemCollection.Add(new BaseCollectionItem
        //        {
        //            Id = Guid.NewGuid(),
        //            Data = baseCollectionItemData
        //        });
        //    }

        //    return itemCollection;
        //}

        public BaseCollectionItem GetById(Guid id)
        {
            throw new NotImplementedException();
        }

        public IQueryable<BaseCollectionItem> GetUnProcessedBaseCollectionItems()
        {
            var query = "False";
            var items = SearchItems(query, "ItemProcessed");
            var allItems = GetAllIndexRecords();

            return items.AsQueryable();
        }

        private static void AddToLuceneIndex(BaseCollectionItem baseCollectionItem, IndexWriter writer)
        {
            // remove older index entry
            var searchQuery = new TermQuery(new Term("Id", baseCollectionItem.Id.ToString()));
            writer.DeleteDocuments(searchQuery);

            // add new index entry
            var doc = new Document();

            // add lucene fields mapped to db fields
            doc.Add(new Field("Id", baseCollectionItem.Id.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
            doc.Add(new Field("TableId", baseCollectionItem.TableId.ToString(), Field.Store.YES, Field.Index.ANALYZED));
            doc.Add(new Field("Data", baseCollectionItem.Data.XmlSerializeToString(), Field.Store.YES, Field.Index.ANALYZED));
            doc.Add(new Field("ItemProcessed", baseCollectionItem.ItemProcessed.ToString(), Field.Store.YES, Field.Index.ANALYZED));
            doc.Add(new Field("AggregationType", baseCollectionItem.AggregationType, Field.Store.YES, Field.Index.ANALYZED));
            doc.Add(new Field("CreatedDate", baseCollectionItem.CreatedDate.ToString(CultureInfo.InvariantCulture), Field.Store.YES, Field.Index.ANALYZED));

            // add entry to index
            writer.AddDocument(doc);
        }

        private static void ClearLuceneIndexRecord(Guid recordId)
        {
            // init lucene
            var analyzer = new StandardAnalyzer(Version.LUCENE_30);
            using (var writer = new IndexWriter(LuceneService.Directory, analyzer, IndexWriter.MaxFieldLength.UNLIMITED))
            {
                // remove older index entry
                var searchQuery = new TermQuery(new Term("Id", recordId.ToString()));
                writer.DeleteDocuments(searchQuery);

                // close handles
                analyzer.Close();
                writer.Dispose();
            }
        }

        private static IEnumerable<BaseCollectionItem> SearchLucene(string searchQuery, string searchField = "")
        {
            // validation
            if (string.IsNullOrEmpty(searchQuery.Replace("*", "").Replace("?", ""))) return new List<BaseCollectionItem>();

            // set up lucene searcher
            using (var searcher = new IndexSearcher(LuceneService.Directory, false))
            {
                var hits_limit = 1000;
                var analyzer = new StandardAnalyzer(Version.LUCENE_30);

                // search by single field
                if (!string.IsNullOrEmpty(searchField))
                {
                    var parser = new QueryParser(Version.LUCENE_30, searchField, analyzer);
                    var query = ParseQuery(searchQuery, parser);
                    var hits = searcher.Search(query, hits_limit).ScoreDocs;
                    var results = MapLuceneToDataList(hits, searcher);
                    analyzer.Close();
                    searcher.Dispose();
                    return results;
                }
                // search by multiple fields (ordered by RELEVANCE)
                else
                {
                    var parser = new MultiFieldQueryParser
                        (Version.LUCENE_30, new[] { "Id", "TableId", "Data", "ItemProcessed", "CreatedDate", "AggregationType" }, analyzer);
                    var query = ParseQuery(searchQuery, parser);
                    var hits = searcher.Search(query, null, hits_limit, Sort.RELEVANCE).ScoreDocs;
                    var results = MapLuceneToDataList(hits, searcher);
                    analyzer.Close();
                    searcher.Dispose();
                    return results;
                }
            }
        }
        private static Query ParseQuery(string searchQuery, QueryParser parser)
        {
            Query query;
            try
            {
                query = parser.Parse(searchQuery.Trim());
            }
            catch (ParseException)
            {
                query = parser.Parse(QueryParser.Escape(searchQuery.Trim()));
            }
            return query;
        }

        private static BaseCollectionItem MapLuceneDocumentToData(Document doc)
        {
            //var docData = doc.Get("Data");

            return new BaseCollectionItem
            {
                Id = Guid.Parse(doc.Get("Id")),
                TableId = Convert.ToInt32(doc.Get("TableId")),
                Data = doc.Get("Data").XmlDeserializeFromString<BaseCollectionItemData>(),
                ItemProcessed = Convert.ToBoolean(doc.Get("ItemProcessed")),
                CreatedDate = Convert.ToDateTime(doc.Get("CreatedDate")),
                AggregationType = doc.Get("AggregationType")
            };
        }

        private static IEnumerable<BaseCollectionItem> MapLuceneToDataList(IEnumerable<Document> hits)
        {
            return hits.Select(MapLuceneDocumentToData).ToList();
        }
        private static IEnumerable<BaseCollectionItem> MapLuceneToDataList(IEnumerable<ScoreDoc> hits,
            IndexSearcher searcher)
        {
            return hits.Select(hit => MapLuceneDocumentToData(searcher.Doc(hit.Doc))).ToList();
        }

        private static IEnumerable<BaseCollectionItem> GetAllIndexRecords()
        {
            // validate search index
            if (!System.IO.Directory.EnumerateFiles(LuceneService.LuceneDir).Any()) return new List<BaseCollectionItem>();

            // set up lucene searcher
            var searcher = new IndexSearcher(LuceneService.Directory, false);
            var reader = IndexReader.Open(LuceneService.Directory, false);
            var docs = new List<Document>();
            var term = reader.TermDocs();
            while (term.Next()) docs.Add(searcher.Doc(term.Doc));
            reader.Dispose();
            searcher.Dispose();
            return MapLuceneToDataList(docs);
        }

        public static IEnumerable<BaseCollectionItem> SearchItems(string input, string fieldName = "")
        {
            if (string.IsNullOrEmpty(input)) return new List<BaseCollectionItem>();

            var terms = input.Trim().Replace("-", " ").Split(' ')
                .Where(x => !string.IsNullOrEmpty(x)).Select(x => x.Trim() + "*");
            input = string.Join(" ", terms);

            return SearchLucene(input, fieldName);
        }
    }
}


text:
package org.springframework.social.twitter.api;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonAnySetter;

/**
 * Represents the results of a similar places search.
 * Includes places that match the search criteria and a {@link PlacePrototype} that can be used to create a new place.
 * @author Craig Walls
 */
@SuppressWarnings("serial")
public class SimilarPlaces extends ArrayList<Place> {

	private final PlacePrototype placePrototype;

	private Map<String, Object> extraData;

	public SimilarPlaces(List<Place> places, PlacePrototype placePrototype) {
		super(places);
		this.placePrototype = placePrototype;
		this.extraData = new HashMap<String, Object>();
	}

	/**
	 * A prototype place that matches the criteria for the call to {@link GeoOperations#findSimilarPlaces(double, double, String)},
	 * including a create token that can be used to create the place.
	 */
	public PlacePrototype getPlacePrototype() {
		return placePrototype;
	}

	/**
	 * @return Any fields in response from Facebook that are otherwise not mapped to any properties.
	 */
	public Map<String, Object> getExtraData() {
		return extraData;
	}

	/**
	 * {@link JsonAnySetter} hook. Called when an otherwise unmapped property is being processed during JSON deserialization.
	 * @param key The property's key.
	 * @param value The property's value.
	 */
	protected void add(String key, Object value) {
		extraData.put(key, value);
	}

}


text:
extern NSString * const RCMarvelAPITestValueValidPublicKey;
extern NSString * const RCMarvelAPITestValueInvalidPublicKey;
extern NSString * const RCMarvelAPITestValueValidPrivateKey;
extern NSString * const RCMarvelAPITestValueInvalidPrivateKey;
extern NSString * const RCMarvelAPITestValueVersion;

extern NSInteger const RCMarvelAPITestValueValidIdentifier;
extern NSInteger const RCMarvelAPITestValueInvalidIdentifier;


text:
//------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated from a template.
//
//    Manual changes to this file may cause unexpected behavior in your application.
//    Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.ComponentModel;
using System.Data.EntityClient;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Linq;
using System.Runtime.Serialization;
using System.Xml.Serialization;

[assembly: EdmSchemaAttribute()]
#region EDM Relationship Metadata

[assembly: EdmRelationshipAttribute("MailModel", "RecipientFolder", "Recipient", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(WebApi.Models.Recipient), "Folder", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(WebApi.Models.Folder))]
[assembly: EdmRelationshipAttribute("MailModel", "ServerAddress", "Server", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(WebApi.Models.Server), "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(WebApi.Models.Address))]
[assembly: EdmRelationshipAttribute("MailModel", "RecipientAddress", "Recipient", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(WebApi.Models.Recipient), "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(WebApi.Models.Address))]
[assembly: EdmRelationshipAttribute("MailModel", "AddressMessage", "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(WebApi.Models.Address), "Message", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(WebApi.Models.Message), true)]

#endregion

namespace WebApi.Models
{
    #region Contexts

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    public partial class MailModelContainer : ObjectContext
    {
        #region Constructors

        /// <summary>
        /// Initializes a new MailModelContainer object using the connection string found in the 'MailModelContainer' section of the application configuration file.
        /// </summary>
        public MailModelContainer() : base("name=MailModelContainer", "MailModelContainer")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        /// <summary>
        /// Initialize a new MailModelContainer object.
        /// </summary>
        public MailModelContainer(string connectionString) : base(connectionString, "MailModelContainer")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        /// <summary>
        /// Initialize a new MailModelContainer object.
        /// </summary>
        public MailModelContainer(EntityConnection connection) : base(connection, "MailModelContainer")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        #endregion

        #region Partial Methods

        partial void OnContextCreated();

        #endregion

        #region ObjectSet Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Message> Messages
        {
            get
            {
                if ((_Messages == null))
                {
                    _Messages = base.CreateObjectSet<Message>("Messages");
                }
                return _Messages;
            }
        }
        private ObjectSet<Message> _Messages;

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Folder> Folders
        {
            get
            {
                if ((_Folders == null))
                {
                    _Folders = base.CreateObjectSet<Folder>("Folders");
                }
                return _Folders;
            }
        }
        private ObjectSet<Folder> _Folders;

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Recipient> Recipients
        {
            get
            {
                if ((_Recipients == null))
                {
                    _Recipients = base.CreateObjectSet<Recipient>("Recipients");
                }
                return _Recipients;
            }
        }
        private ObjectSet<Recipient> _Recipients;

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Receiver> Receivers
        {
            get
            {
                if ((_Receivers == null))
                {
                    _Receivers = base.CreateObjectSet<Receiver>("Receivers");
                }
                return _Receivers;
            }
        }
        private ObjectSet<Receiver> _Receivers;

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Address> Addresses
        {
            get
            {
                if ((_Addresses == null))
                {
                    _Addresses = base.CreateObjectSet<Address>("Addresses");
                }
                return _Addresses;
            }
        }
        private ObjectSet<Address> _Addresses;

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Server> Servers
        {
            get
            {
                if ((_Servers == null))
                {
                    _Servers = base.CreateObjectSet<Server>("Servers");
                }
                return _Servers;
            }
        }
        private ObjectSet<Server> _Servers;

        #endregion

        #region AddTo Methods

        /// <summary>
        /// Deprecated Method for adding a new object to the Messages EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
        /// </summary>
        public void AddToMessages(Message message)
        {
            base.AddObject("Messages", message);
        }

        /// <summary>
        /// Deprecated Method for adding a new object to the Folders EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
        /// </summary>
        public void AddToFolders(Folder folder)
        {
            base.AddObject("Folders", folder);
        }

        /// <summary>
        /// Deprecated Method for adding a new object to the Recipients EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
        /// </summary>
        public void AddToRecipients(Recipient recipient)
        {
            base.AddObject("Recipients", recipient);
        }

        /// <summary>
        /// Deprecated Method for adding a new object to the Receivers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
        /// </summary>
        public void AddToReceivers(Receiver receiver)
        {
            base.AddObject("Receivers", receiver);
        }

        /// <summary>
        /// Deprecated Method for adding a new object to the Addresses EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
        /// </summary>
        public void AddToAddresses(Address address)
        {
            base.AddObject("Addresses", address);
        }

        /// <summary>
        /// Deprecated Method for adding a new object to the Servers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
        /// </summary>
        public void AddToServers(Server server)
        {
            base.AddObject("Servers", server);
        }

        #endregion

    }

    #endregion

    #region Entities

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MailModel", Name="Address")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Address : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new Address object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="nickName">Initial value of the NickName property.</param>
        /// <param name="serverId">Initial value of the ServerId property.</param>
        /// <param name="recipientId">Initial value of the RecipientId property.</param>
        public static Address CreateAddress(global::System.Int32 id, global::System.String nickName, global::System.String serverId, global::System.String recipientId)
        {
            Address address = new Address();
            address.Id = id;
            address.NickName = nickName;
            address.ServerId = serverId;
            address.RecipientId = recipientId;
            return address;
        }

        #endregion

        #region Simple Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 Id
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    OnIdChanging(value);
                    ReportPropertyChanging("Id");
                    _Id = StructuralObject.SetValidValue(value, "Id");
                    ReportPropertyChanged("Id");
                    OnIdChanged();
                }
            }
        }
        private global::System.Int32 _Id;
        partial void OnIdChanging(global::System.Int32 value);
        partial void OnIdChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String NickName
        {
            get
            {
                return _NickName;
            }
            set
            {
                OnNickNameChanging(value);
                ReportPropertyChanging("NickName");
                _NickName = StructuralObject.SetValidValue(value, false, "NickName");
                ReportPropertyChanged("NickName");
                OnNickNameChanged();
            }
        }
        private global::System.String _NickName;
        partial void OnNickNameChanging(global::System.String value);
        partial void OnNickNameChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String ServerId
        {
            get
            {
                return _ServerId;
            }
            set
            {
                OnServerIdChanging(value);
                ReportPropertyChanging("ServerId");
                _ServerId = StructuralObject.SetValidValue(value, false, "ServerId");
                ReportPropertyChanged("ServerId");
                OnServerIdChanged();
            }
        }
        private global::System.String _ServerId;
        partial void OnServerIdChanging(global::System.String value);
        partial void OnServerIdChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String RecipientId
        {
            get
            {
                return _RecipientId;
            }
            set
            {
                OnRecipientIdChanging(value);
                ReportPropertyChanging("RecipientId");
                _RecipientId = StructuralObject.SetValidValue(value, false, "RecipientId");
                ReportPropertyChanged("RecipientId");
                OnRecipientIdChanged();
            }
        }
        private global::System.String _RecipientId;
        partial void OnRecipientIdChanging(global::System.String value);
        partial void OnRecipientIdChanged();

        #endregion

        #region Navigation Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MailModel", "ServerAddress", "Server")]
        public Server Server
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Server>("MailModel.ServerAddress", "Server").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Server>("MailModel.ServerAddress", "Server").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Server> ServerReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Server>("MailModel.ServerAddress", "Server");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Server>("MailModel.ServerAddress", "Server", value);
                }
            }
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MailModel", "RecipientAddress", "Recipient")]
        public Recipient Recipient
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Recipient>("MailModel.RecipientAddress", "Recipient").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Recipient>("MailModel.RecipientAddress", "Recipient").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Recipient> RecipientReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Recipient>("MailModel.RecipientAddress", "Recipient");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Recipient>("MailModel.RecipientAddress", "Recipient", value);
                }
            }
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MailModel", "AddressMessage", "Message")]
        public EntityCollection<Message> Messages
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Message>("MailModel.AddressMessage", "Message");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Message>("MailModel.AddressMessage", "Message", value);
                }
            }
        }

        #endregion

    }

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MailModel", Name="Folder")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Folder : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new Folder object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        public static Folder CreateFolder(global::System.Int32 id)
        {
            Folder folder = new Folder();
            folder.Id = id;
            return folder;
        }

        #endregion

        #region Simple Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 Id
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    OnIdChanging(value);
                    ReportPropertyChanging("Id");
                    _Id = StructuralObject.SetValidValue(value, "Id");
                    ReportPropertyChanged("Id");
                    OnIdChanged();
                }
            }
        }
        private global::System.Int32 _Id;
        partial void OnIdChanging(global::System.Int32 value);
        partial void OnIdChanged();

        #endregion

        #region Navigation Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MailModel", "RecipientFolder", "Recipient")]
        public Recipient Recipient
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Recipient>("MailModel.RecipientFolder", "Recipient").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Recipient>("MailModel.RecipientFolder", "Recipient").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Recipient> RecipientReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Recipient>("MailModel.RecipientFolder", "Recipient");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Recipient>("MailModel.RecipientFolder", "Recipient", value);
                }
            }
        }

        #endregion

    }

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MailModel", Name="Message")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Message : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new Message object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="sentBy">Initial value of the SentBy property.</param>
        /// <param name="sentOn">Initial value of the SentOn property.</param>
        /// <param name="subject">Initial value of the Subject property.</param>
        /// <param name="content">Initial value of the Content property.</param>
        public static Message CreateMessage(global::System.Int32 id, global::System.Int32 sentBy, global::System.DateTimeOffset sentOn, global::System.String subject, global::System.String content)
        {
            Message message = new Message();
            message.Id = id;
            message.SentBy = sentBy;
            message.SentOn = sentOn;
            message.Subject = subject;
            message.Content = content;
            return message;
        }

        #endregion

        #region Simple Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 Id
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    OnIdChanging(value);
                    ReportPropertyChanging("Id");
                    _Id = StructuralObject.SetValidValue(value, "Id");
                    ReportPropertyChanged("Id");
                    OnIdChanged();
                }
            }
        }
        private global::System.Int32 _Id;
        partial void OnIdChanging(global::System.Int32 value);
        partial void OnIdChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SentBy
        {
            get
            {
                return _SentBy;
            }
            set
            {
                OnSentByChanging(value);
                ReportPropertyChanging("SentBy");
                _SentBy = StructuralObject.SetValidValue(value, "SentBy");
                ReportPropertyChanged("SentBy");
                OnSentByChanged();
            }
        }
        private global::System.Int32 _SentBy;
        partial void OnSentByChanging(global::System.Int32 value);
        partial void OnSentByChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTimeOffset SentOn
        {
            get
            {
                return _SentOn;
            }
            set
            {
                OnSentOnChanging(value);
                ReportPropertyChanging("SentOn");
                _SentOn = StructuralObject.SetValidValue(value, "SentOn");
                ReportPropertyChanged("SentOn");
                OnSentOnChanged();
            }
        }
        private global::System.DateTimeOffset _SentOn;
        partial void OnSentOnChanging(global::System.DateTimeOffset value);
        partial void OnSentOnChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Subject
        {
            get
            {
                return _Subject;
            }
            set
            {
                OnSubjectChanging(value);
                ReportPropertyChanging("Subject");
                _Subject = StructuralObject.SetValidValue(value, false, "Subject");
                ReportPropertyChanged("Subject");
                OnSubjectChanged();
            }
        }
        private global::System.String _Subject;
        partial void OnSubjectChanging(global::System.String value);
        partial void OnSubjectChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Content
        {
            get
            {
                return _Content;
            }
            set
            {
                OnContentChanging(value);
                ReportPropertyChanging("Content");
                _Content = StructuralObject.SetValidValue(value, false, "Content");
                ReportPropertyChanged("Content");
                OnContentChanged();
            }
        }
        private global::System.String _Content;
        partial void OnContentChanging(global::System.String value);
        partial void OnContentChanged();

        #endregion

        #region Navigation Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MailModel", "AddressMessage", "Address")]
        public Address Address
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("MailModel.AddressMessage", "Address").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("MailModel.AddressMessage", "Address").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Address> AddressReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("MailModel.AddressMessage", "Address");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Address>("MailModel.AddressMessage", "Address", value);
                }
            }
        }

        #endregion

    }

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MailModel", Name="Receiver")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Receiver : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new Receiver object.
        /// </summary>
        /// <param name="folderId">Initial value of the FolderId property.</param>
        /// <param name="messageId">Initial value of the MessageId property.</param>
        /// <param name="sentOn">Initial value of the SentOn property.</param>
        /// <param name="cC">Initial value of the CC property.</param>
        /// <param name="bCC">Initial value of the BCC property.</param>
        public static Receiver CreateReceiver(global::System.Int32 folderId, global::System.Int32 messageId, global::System.String sentOn, global::System.String cC, global::System.String bCC)
        {
            Receiver receiver = new Receiver();
            receiver.FolderId = folderId;
            receiver.MessageId = messageId;
            receiver.SentOn = sentOn;
            receiver.CC = cC;
            receiver.BCC = bCC;
            return receiver;
        }

        #endregion

        #region Simple Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 FolderId
        {
            get
            {
                return _FolderId;
            }
            set
            {
                if (_FolderId != value)
                {
                    OnFolderIdChanging(value);
                    ReportPropertyChanging("FolderId");
                    _FolderId = StructuralObject.SetValidValue(value, "FolderId");
                    ReportPropertyChanged("FolderId");
                    OnFolderIdChanged();
                }
            }
        }
        private global::System.Int32 _FolderId;
        partial void OnFolderIdChanging(global::System.Int32 value);
        partial void OnFolderIdChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 MessageId
        {
            get
            {
                return _MessageId;
            }
            set
            {
                if (_MessageId != value)
                {
                    OnMessageIdChanging(value);
                    ReportPropertyChanging("MessageId");
                    _MessageId = StructuralObject.SetValidValue(value, "MessageId");
                    ReportPropertyChanged("MessageId");
                    OnMessageIdChanged();
                }
            }
        }
        private global::System.Int32 _MessageId;
        partial void OnMessageIdChanging(global::System.Int32 value);
        partial void OnMessageIdChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String SentOn
        {
            get
            {
                return _SentOn;
            }
            set
            {
                OnSentOnChanging(value);
                ReportPropertyChanging("SentOn");
                _SentOn = StructuralObject.SetValidValue(value, false, "SentOn");
                ReportPropertyChanged("SentOn");
                OnSentOnChanged();
            }
        }
        private global::System.String _SentOn;
        partial void OnSentOnChanging(global::System.String value);
        partial void OnSentOnChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CC
        {
            get
            {
                return _CC;
            }
            set
            {
                OnCCChanging(value);
                ReportPropertyChanging("CC");
                _CC = StructuralObject.SetValidValue(value, false, "CC");
                ReportPropertyChanged("CC");
                OnCCChanged();
            }
        }
        private global::System.String _CC;
        partial void OnCCChanging(global::System.String value);
        partial void OnCCChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String BCC
        {
            get
            {
                return _BCC;
            }
            set
            {
                OnBCCChanging(value);
                ReportPropertyChanging("BCC");
                _BCC = StructuralObject.SetValidValue(value, false, "BCC");
                ReportPropertyChanged("BCC");
                OnBCCChanged();
            }
        }
        private global::System.String _BCC;
        partial void OnBCCChanging(global::System.String value);
        partial void OnBCCChanged();

        #endregion

    }

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MailModel", Name="Recipient")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Recipient : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new Recipient object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="fullName">Initial value of the FullName property.</param>
        public static Recipient CreateRecipient(global::System.Int32 id, global::System.String fullName)
        {
            Recipient recipient = new Recipient();
            recipient.Id = id;
            recipient.FullName = fullName;
            return recipient;
        }

        #endregion

        #region Simple Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 Id
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    OnIdChanging(value);
                    ReportPropertyChanging("Id");
                    _Id = StructuralObject.SetValidValue(value, "Id");
                    ReportPropertyChanged("Id");
                    OnIdChanged();
                }
            }
        }
        private global::System.Int32 _Id;
        partial void OnIdChanging(global::System.Int32 value);
        partial void OnIdChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String FullName
        {
            get
            {
                return _FullName;
            }
            set
            {
                OnFullNameChanging(value);
                ReportPropertyChanging("FullName");
                _FullName = StructuralObject.SetValidValue(value, false, "FullName");
                ReportPropertyChanged("FullName");
                OnFullNameChanged();
            }
        }
        private global::System.String _FullName;
        partial void OnFullNameChanging(global::System.String value);
        partial void OnFullNameChanged();

        #endregion

        #region Navigation Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MailModel", "RecipientFolder", "Folder")]
        public EntityCollection<Folder> Folders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Folder>("MailModel.RecipientFolder", "Folder");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Folder>("MailModel.RecipientFolder", "Folder", value);
                }
            }
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MailModel", "RecipientAddress", "Address")]
        public EntityCollection<Address> Addresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Address>("MailModel.RecipientAddress", "Address");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Address>("MailModel.RecipientAddress", "Address", value);
                }
            }
        }

        #endregion

    }

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MailModel", Name="Server")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Server : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new Server object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="address">Initial value of the Address property.</param>
        /// <param name="iP">Initial value of the IP property.</param>
        public static Server CreateServer(global::System.Int32 id, global::System.String address, global::System.String iP)
        {
            Server server = new Server();
            server.Id = id;
            server.Address = address;
            server.IP = iP;
            return server;
        }

        #endregion

        #region Simple Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 Id
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    OnIdChanging(value);
                    ReportPropertyChanging("Id");
                    _Id = StructuralObject.SetValidValue(value, "Id");
                    ReportPropertyChanged("Id");
                    OnIdChanged();
                }
            }
        }
        private global::System.Int32 _Id;
        partial void OnIdChanging(global::System.Int32 value);
        partial void OnIdChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Address
        {
            get
            {
                return _Address;
            }
            set
            {
                OnAddressChanging(value);
                ReportPropertyChanging("Address");
                _Address = StructuralObject.SetValidValue(value, false, "Address");
                ReportPropertyChanged("Address");
                OnAddressChanged();
            }
        }
        private global::System.String _Address;
        partial void OnAddressChanging(global::System.String value);
        partial void OnAddressChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String IP
        {
            get
            {
                return _IP;
            }
            set
            {
                OnIPChanging(value);
                ReportPropertyChanging("IP");
                _IP = StructuralObject.SetValidValue(value, false, "IP");
                ReportPropertyChanged("IP");
                OnIPChanged();
            }
        }
        private global::System.String _IP;
        partial void OnIPChanging(global::System.String value);
        partial void OnIPChanged();

        #endregion

        #region Navigation Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MailModel", "ServerAddress", "Address")]
        public EntityCollection<Address> Addresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Address>("MailModel.ServerAddress", "Address");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Address>("MailModel.ServerAddress", "Address", value);
                }
            }
        }

        #endregion

    }

    #endregion

}


text:
<?php

/**
 * @file GoogleAnalytics.php
 * @brief This file contains the GoogleAnalytics class.
 * @details
 * @authors Alexis Pastouret && Filippo Fadda
 */

//! This namespace contains a class to generate the tracking code for Google Analytics
namespace MatchPint\Google;

/**
 * @brief This class generates the tracking code for Google Analytics.
 * @nosubgrouping
 */
class GoogleAnalytics {

  private $supportedGroups;
  private $supportedDimensions;
  private $trackingId;
  private $groups;
  private $dimensions;

  /**
   * @brief Creates an instance of the class.
   * @param string $gaTrackingId The ID of the view you want track.
   * @param array $supportedGroups (optional) An associative array having as key the name of the supported group
   * and as value an integer matching the group identifier that you have setup in Google Analytics.
   * @param array $supportedDimensions (optional) An associative array having as key the name of the supported dimension
   * and as value an integer matching the dimension identifier that you have setup in Google Analytics.
   */
  public function __construct($gaTrackingId, array $supportedDimensions = [], array $supportedGroups = []) {
    $this->trackingId = $gaTrackingId;
    $this->groups = [];
    $this->dimensions = [];
    $this->supportedDimensions = $supportedDimensions;
    $this->supportedGroups = $supportedGroups;
  }

  /**
   * @brief This anonymously identifies a particular user, device, or browser instance.
   * @return string
   * @see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid
   */
  private function genUuid() {
    return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
      // 32 bits for "time_low"
      mt_rand(0, 0xffff), mt_rand(0, 0xffff),

      // 16 bits for "time_mid"
      mt_rand(0, 0xffff),

      // 16 bits for "time_hi_and_version",
      // four most significant bits holds version number 4
      mt_rand(0, 0x0fff) | 0x4000,

      // 16 bits, 8 bits for "clk_seq_hi_res",
      // 8 bits for "clk_seq_low",
      // two most significant bits holds zero and one for variant DCE1.1
      mt_rand(0, 0x3fff) | 0x8000,

      // 48 bits for "node"
      mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
    );
  }

  /**
   * @brief Add a supported group passing the name and value of it.
   * @param[in] string $name A group's name.
   * @param[in] string $name The value for the provided group.
   */
  public function addSupportedGroup($name, $value) {
    $this->supportedGroups[$name] = $value;
  }

  /**
   * @brief Add a supported dimension passing the name and value of it.
   * @param[in] string $name A dimension's name.
   * @param[in] string $name The value for the provided dimension.
   */
  public function addSupportedDimension($name, $value) {
    $this->supportedDimensions[$name] = $value;
  }

  /**
   * @brief Adds to the tracking the provided group.
   * @param[in] string $name A group's name.
   * @param[in] string $name The value for the provided group.
   */
  public function trackGroup($name, $value) {
    if (array_key_exists($name, $this->supportedGroups)) {
      $i = $this->supportedGroups[$name];
      $this->groups[$i] = $value;
    }
    else
      throw new \InvalidArgumentException('The group provided is not supported.');
  }

  /**
   * @brief Adds to the tracking the provided dimension.
   * @param[in] string $name A dimension's name.
   * @param[in] string $name The value for the provided dimension.
   */
  public function trackDimension($name, $value) {
    if (array_key_exists($name, $this->supportedDimensions)) {
      $i = $this->supportedDimensions[$name];
      $this->dimensions[$i] = $value;
    }
    else
      throw new \InvalidArgumentException('The dimension provided is not supported.');
  }

  /**
   * @brief Returns the tracking code for Google Analytics.
   * @return string
   */
  public function getTrackingCode() {
    $script = <<<EOT
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', '%s', 'auto');
EOT;

    $script = sprintf($script, $this->trackingId) . PHP_EOL;

    foreach ($this->groups as $i => $value)
      $script .= "  ga('set', 'contentGroup{$i}', '{$value}');" . PHP_EOL;

    foreach ($this->dimensions as $i => $value)
      $script .= "  ga('set', 'dimension{$i}', '{$value}');" . PHP_EOL;

    $script .= "  ga('send', 'pageview');";

    return $script;
  }

  /**
   * @brief Send a GA event through the Google Analytics collect endpoint.
   * @param[in] string $category The event category.
   * @param[in] string $action The event action.
   * @param[in] mixed (optional) $label The event label.
   */
  public function sendEvent($category, $action, $label = NULL) {
    $params = [
      "v" => 1, //Version of GA that we use
      "tid" => $this->trackingId,
      "cid" => $this->genUuid(),
      "t" => "event",
      "ec" => $category,
      "ea" => $action
    ];

    if (!empty($label))
      $params["el"] = $label;

    $url = "https://www.google-analytics.com/collect?" . http_build_query($params);

    file_get_contents($url);
  }

}


text:
#pragma once
#ifndef PRODUCTFORMAT_H
#define PRODUCTFORMAT_H
#include <string>

/*
Specifies a product's format. For a movie, this could be a DVD or Blueray.

The constructor takes in a string and sets the private datamember to it.

The getName method returns the private formatname string.

The equals method checks if two productformats match. Returns true if they
are, false if they're not.
*/

class ProductFormat {
public:
	ProductFormat(std::string); // constructor
	std::string getName() const; // returns the private formatname string
    //Checks if two ProductFormats are equivilent
	bool equals(const ProductFormat);
private:
	std::string formatName;
};

#endif


text:
slider

      <button class="nk-js-button--slider nk-button nk-toolbar__item--right">Code</button>

          &lt:section class="nk-slider">
            &lt:article class="nk-slider">
              ...
              &lt:a class="nk-slider__back" href="#0">Back&lt:/a>
              &lt:a class="nk-slider__next" href="#1">Next&lt:/a>
            &lt:/article>
          &lt:/section>

          nak
          Slider

      Next

      Back
      Next

I am a  slide

      Back
      Next

List items.

List items.

List items.

List items.

      Back
      Next

nakDS

Easy and beautiful

        <button class="nk-button nk-button--color nk-mtx">Try now</button>

      Back
      Next

      Back


text:
<?php

namespace lithium\g11n\catalog\adapter;

use lithium\core\ConfigException;

/**
 * The `Php` class is an adapter for reading from PHP files which hold g11n data
 * in form of arrays.
 *
 * An example PHP file must contain a `return` statement which returns an array if the
 * the file is included.
 *
 * ```
 * <?php
 * return array(
 * 	'postalCode' => '\d+',
 * 	'phone' => '\d+\-\d+'
 * );
 * ?>
 * ```
 *
 * The adapter works with a directory structure below. The example shows the structure
 * for the directory as given by the `'path'` configuration setting. It is similar to
 * the one used by the the `Gettext` adapter.
 *
 * ```
 * resources/g11n/php
 * ├── <locale>
 * |   ├── message
 * |   |   ├── default.php
 * |   |   └── <scope>.php
 * |   ├── validation
 * |   |   └── ...
 * |   └── ...
 * ├── <locale>
 * |   └── ...
 * ├── message_default.php
 * ├── message_<scope>.php
 * ├── validation_default.php
 * ├── validation_<scope>.php
 * └── ...
 * ```
 *
 * @see lithium\g11n\catalog\adapter\Gettext
 */
class Php extends \lithium\g11n\catalog\Adapter {

	/**
	 * Constructor.
	 *
	 * @param array $config Available configuration options are:
	 *        - `'path'`: The path to the directory holding the data.
	 * @return void
	 */
	public function __construct(array $config = array()) {
		$defaults = array('path' => null);
		parent::__construct($config + $defaults);
	}

	/**
	 * Initializer.  Checks if the configured path exists.
	 *
	 * @return void
	 * @throws \Exception
	 */
	protected function _init() {
		parent::_init();
		if (!is_dir($this->_config['path'])) {
			$message = "Php directory does not exist at path `{$this->_config['path']}`.";
			throw new ConfigException($message);
		}
	}

	/**
	 * Reads data.
	 *
	 * @param string $category A category.
	 * @param string $locale A locale identifier.
	 * @param string $scope The scope for the current operation.
	 * @return array
	 */
	public function read($category, $locale, $scope) {
		$path = $this->_config['path'];
		$file = $this->_file($category, $locale, $scope);
		$data = array();

		if (file_exists($file)) {
			foreach (require $file as $id => $translated) {
				if (strpos($id, '|') !== false) {
					list($id, $context) = explode('|', $id);
				}
				$data = $this->_merge($data, compact('id', 'translated', 'context'));
			}
		}
		return $data;
	}

	/**
	 * Helper method for transforming a category, locale and scope into a filename.
	 *
	 * @param string $category Category name.
	 * @param string $locale Locale identifier.
	 * @param string $scope Current operation scope.
	 * @return string Filename.
	 */
	protected function _file($category, $locale, $scope) {
		$path = $this->_config['path'];
		$scope = $scope ?: 'default';

		if (($pos = strpos($category, 'Template')) !== false) {
			$category = substr($category, 0, $pos);
			return "{$path}/{$category}_{$scope}.php";
		}
		return "{$path}/{$locale}/{$category}/{$scope}.php";
	}
}

?>


text:
namespace AjScript.Tests.Expressions
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;
    using AjScript.Expressions;
    using AjScript.Interpreter;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class NewExpressionTests
    {
        [TestMethod]
        public void EvaluateSimpleNewExpression()
        {
            IExpression dotexpr = new DotExpression(new DotExpression(new VariableExpression("System"), "Data"), "DataSet");
            IExpression expression = new NewExpression(dotexpr, null);

            object result = expression.Evaluate(new Context());

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(System.Data.DataSet));
        }

        [TestMethod]
        public void EvaluateNewExpressionWithArguments()
        {
            IExpression dotexpr = new DotExpression(new DotExpression(new VariableExpression("System"), "IO"), "DirectoryInfo");
            IExpression expression = new NewExpression(dotexpr, new IExpression[] { new ConstantExpression(".") });

            object result = expression.Evaluate(new Context());

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(System.IO.DirectoryInfo));

            DirectoryInfo di = (DirectoryInfo)result;

            DirectoryInfo current = new DirectoryInfo(".");

            Assert.AreEqual(current.FullName, di.FullName);
        }

        [TestMethod]
        public void EvaluateNewExpressionWithAliasedType()
        {
            IExpression expression = new NewExpression(new VariableExpression("Lexer"), new List<IExpression>() { new ConstantExpression(string.Empty) });
            Context context = new Context();
            context.SetValue("Lexer", typeof(Lexer));

            object result = expression.Evaluate(context);

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(Lexer));
        }
    }
}