text:
package org.apache.uima.fit.util;

import static java.lang.Integer.MAX_VALUE;
import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;
import static org.apache.uima.cas.text.AnnotationPredicates.colocated;
import static org.apache.uima.cas.text.AnnotationPredicates.coveredBy;
import static org.apache.uima.cas.text.AnnotationPredicates.covering;
import static org.apache.uima.cas.text.AnnotationPredicates.following;
import static org.apache.uima.cas.text.AnnotationPredicates.preceding;
import static org.apache.uima.fit.factory.TypeSystemDescriptionFactory.createTypeSystemDescription;
import static org.apache.uima.fit.util.AnnotationPredicateTestData.NON_ZERO_WIDTH_TEST_CASES;
import static org.apache.uima.fit.util.AnnotationPredicateTestData.ZERO_WIDTH_TEST_CASES;
import static org.apache.uima.fit.util.AnnotationPredicateTestData.RelativePosition.COLOCATED;
import static org.apache.uima.fit.util.AnnotationPredicateTestData.RelativePosition.COVERED_BY;
import static org.apache.uima.fit.util.AnnotationPredicateTestData.RelativePosition.COVERING;
import static org.apache.uima.fit.util.AnnotationPredicateTestData.RelativePosition.FOLLOWING;
import static org.apache.uima.fit.util.AnnotationPredicateTestData.RelativePosition.PRECEDING;
import static org.apache.uima.fit.util.CasUtil.exists;
import static org.apache.uima.fit.util.CasUtil.getAnnotationType;
import static org.apache.uima.fit.util.CasUtil.getType;
import static org.apache.uima.fit.util.CasUtil.iterator;
import static org.apache.uima.fit.util.CasUtil.iteratorFS;
import static org.apache.uima.fit.util.CasUtil.select;
import static org.apache.uima.fit.util.CasUtil.selectAt;
import static org.apache.uima.fit.util.CasUtil.selectByIndex;
import static org.apache.uima.fit.util.CasUtil.selectCovered;
import static org.apache.uima.fit.util.CasUtil.selectCovering;
import static org.apache.uima.fit.util.CasUtil.selectFS;
import static org.apache.uima.fit.util.CasUtil.selectFollowing;
import static org.apache.uima.fit.util.CasUtil.selectPreceding;
import static org.apache.uima.fit.util.CasUtil.toText;
import static org.apache.uima.fit.util.SelectionAssert.assertSelection;
import static org.apache.uima.fit.util.SelectionAssert.assertSelectionIsEqualOnRandomData;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

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

import org.apache.uima.UIMAException;
import org.apache.uima.cas.ArrayFS;
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.text.AnnotationFS;
import org.apache.uima.fit.ComponentTestBase;
import org.apache.uima.fit.type.Token;
import org.apache.uima.fit.util.SelectionAssert.TestCase;
import org.apache.uima.jcas.cas.TOP;
import org.apache.uima.jcas.tcas.Annotation;
import org.apache.uima.util.CasCreationUtils;
import org.junit.jupiter.api.Test;

/**
 * Test cases for {@link JCasUtil}.
 *
 */
public class CasUtilTest extends ComponentTestBase {
  private List<TestCase> defaultPredicatesTestCases = union(NON_ZERO_WIDTH_TEST_CASES,
          ZERO_WIDTH_TEST_CASES);

  @Test
  public void testGetType() {
    String text = "Rot wood cheeses dew?";
    tokenBuilder.buildTokens(jCas, text);

    CAS cas = jCas.getCas();

    assertEquals(Token.class.getName(), getType(cas, Token.class.getName()).getName());
    assertEquals(Token.class.getName(), getType(cas, Token.class).getName());
    assertEquals(Token.class.getName(), getAnnotationType(cas, Token.class.getName()).getName());
    assertEquals(Token.class.getName(), getAnnotationType(cas, Token.class).getName());
    assertEquals("uima.cas.TOP", getType(cas, FeatureStructure.class).getName());
    assertEquals("uima.cas.TOP", getType(cas, TOP.class).getName());
    assertEquals("uima.cas.TOP", getType(cas, TOP.class.getName()).getName());
    assertEquals("uima.tcas.Annotation", getType(cas, AnnotationFS.class).getName());
    assertEquals("uima.tcas.Annotation", getType(cas, Annotation.class).getName());
    assertEquals("uima.tcas.Annotation", getType(cas, Annotation.class.getName()).getName());
    assertEquals("uima.tcas.Annotation", getAnnotationType(cas, Annotation.class).getName());
    assertEquals("uima.tcas.Annotation",
            getAnnotationType(cas, Annotation.class.getName()).getName());
  }

  @Test
  public void testGetNonExistingType() {
    String text = "Rot wood cheeses dew?";
    tokenBuilder.buildTokens(jCas, text);

    CAS cas = jCas.getCas();

    assertThatExceptionOfType(IllegalArgumentException.class)
            .isThrownBy(() -> getType(cas, Token.class.getName() + "_dummy"));
  }

  @Test
  public void testGetNonAnnotationType() {
    String text = "Rot wood cheeses dew?";
    tokenBuilder.buildTokens(jCas, text);

    CAS cas = jCas.getCas();

    assertThatExceptionOfType(IllegalArgumentException.class)
            .isThrownBy(() -> getAnnotationType(cas, TOP.class));
  }

  @Test
  public void testSelectByIndex() {
    String text = "Rot wood cheeses dew?";
    tokenBuilder.buildTokens(jCas, text);

    CAS cas = jCas.getCas();
    Type type = JCasUtil.getType(jCas, Token.class);

    assertEquals("dew?", selectByIndex(cas, type, -1).getCoveredText());
    assertEquals("dew?", selectByIndex(cas, type, 3).getCoveredText());
    assertEquals("Rot", selectByIndex(cas, type, 0).getCoveredText());
    assertEquals("Rot", selectByIndex(cas, type, -4).getCoveredText());
    assertNull(selectByIndex(cas, type, -5));
    assertNull(selectByIndex(cas, type, 4));
  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  @Test
  public void testSelectOnAnnotations() throws Exception {
    String text = "Rot wood cheeses dew?";
    tokenBuilder.buildTokens(jCas, text);

    CAS cas = jCas.getCas();

    assertEquals(asList("Rot", "wood", "cheeses", "dew?"),
            toText(select(cas, getType(cas, Token.class.getName()))));

    assertEquals(asList("Rot", "wood", "cheeses", "dew?"),
            toText((Collection<AnnotationFS>) (Collection) selectFS(cas,
                    getType(cas, Token.class.getName()))));
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  @Test
  public void testSelectOnArrays() throws Exception {
    String text = "Rot wood cheeses dew?";
    tokenBuilder.buildTokens(jCas, text);

    CAS cas = jCas.getCas();

    Collection<FeatureStructure> allFS = selectFS(cas, getType(cas, TOP.class.getName()));
    ArrayFS allFSArray = cas.createArrayFS(allFS.size());
    int i = 0;
    for (FeatureStructure fs : allFS) {
      allFSArray.set(i, fs);
      i++;
    }

    // Print what is expected
    // for (FeatureStructure fs : allFS) {
    // System.out.println("Type: " + fs.getType().getName() + "]");
    // }
    // System.out
    // .println("Tokens: [" + toText(select(cas, getType(cas, Token.class.getName()))) + "]");

    // Document Annotation, one sentence and 4 tokens.
    assertEquals(6, allFS.size());

    assertEquals(toText(select(cas, getType(cas, Token.class.getName()))),
            toText(select(allFSArray, getType(cas, Token.class.getName()))));

    assertEquals(toText((Iterable) selectFS(cas, getType(cas, Token.class.getName()))),
            toText((Iterable) selectFS(allFSArray, getType(cas, Token.class.getName()))));
  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  @Test
  public void testIterator() throws Exception {
    String text = "Rot wood cheeses dew?";
    tokenBuilder.buildTokens(jCas, text);

    CAS cas = jCas.getCas();

    assertEquals(asList("Rot", "wood", "cheeses", "dew?"),
            toText(iterator(cas, getType(cas, Token.class))));

    assertEquals(asList("Rot", "wood", "cheeses", "dew?"),
            toText((Iterator<AnnotationFS>) (Iterator) iteratorFS(cas, getType(cas, Token.class))));
  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  @Test
  public void testIterate() throws Exception {
    String text = "Rot wood cheeses dew?";
    tokenBuilder.buildTokens(jCas, text);

    CAS cas = jCas.getCas();

    assertEquals(asList("Rot", "wood", "cheeses", "dew?"),
            toText(select(cas, getType(cas, Token.class))));

    assertEquals(asList("Rot", "wood", "cheeses", "dew?"),
            toText((Iterable<AnnotationFS>) (Iterable) selectFS(cas, getType(cas, Token.class))));
  }

  @Test
  public void testExists() throws UIMAException {
    CAS cas = CasCreationUtils.createCas(createTypeSystemDescription(), null, null);

    Type tokenType = CasUtil.getAnnotationType(cas, Token.class);

    assertFalse(exists(cas, tokenType));

    cas.addFsToIndexes(cas.createAnnotation(tokenType, 0, 1));

    assertTrue(exists(cas, tokenType));
  }

  @Test
  public void thatSelectFollowingBehaviorAlignsWithPrecedingPredicate() throws Exception {
    // In order to find annotations that X is preceding, we select the following annotations
    assertSelection(PRECEDING,
            (cas, type, x, y) -> selectFollowing(cas, type, x, MAX_VALUE).contains(y),
            defaultPredicatesTestCases);
  }

  @Test
  public void thatSelectPrecedingBehaviorAlignsWithPrecedingPredicateOnRandomData()
          throws Exception {
    assertSelectionIsEqualOnRandomData(
            (cas, type, context) -> cas.getAnnotationIndex(type).select()
                    .filter(candidate -> preceding(candidate, context)).collect(toList()),
            (cas, type, context) -> selectPreceding(cas, type, context, MAX_VALUE));
  }

  @Test
  public void thatSelectPrecedingBehaviorAlignsWithFollowingPredicate() throws Exception {
    // In order to find annotations that X is following, we select the preceding annotations
    assertSelection(FOLLOWING,
            (cas, type, x, y) -> selectPreceding(cas, type, x, MAX_VALUE).contains(y),
            defaultPredicatesTestCases);
  }

  @Test
  public void thatSelectFollowingBehaviorAlignsWithFollowingPredicateOnRandomData()
          throws Exception {
    assertSelectionIsEqualOnRandomData(
            (cas, type, context) -> cas.getAnnotationIndex(type).select()
                    .filter(candidate -> following(candidate, context)).collect(toList()),
            (cas, type, context) -> selectFollowing(cas, type, context, MAX_VALUE));
  }

  @Test
  public void thatSelectCoveringBehaviorAlignsWithCoveredByPredicate() throws Exception {
    // X covered by Y means that Y is covering X, so we need to select the covering annotations
    // below.
    assertSelection(COVERED_BY, (cas, type, x, y) -> selectCovering(cas, type, x).contains(y),
            defaultPredicatesTestCases);
  }

  @Test
  public void thatSelectCoveredBehaviorAlignsWithCoveredByPredicateOnRandomData() throws Exception {
    assertSelectionIsEqualOnRandomData(
            (cas, type, context) -> cas.getAnnotationIndex(type).select()
                    .filter(candidate -> coveredBy(candidate, context)).collect(toList()),
            (cas, type, context) -> selectCovered(cas, type, context));
  }

  @Test
  public void thatSelectCoveredBehaviorAlignsWithCoveringPredicate() throws Exception {
    // X covering Y means that Y is covered by Y, so we need to select the covered by annotations
    // below.
    assertSelection(COVERING, (cas, type, x, y) -> selectCovered(cas, type, x).contains(y),
            defaultPredicatesTestCases);
  }

  @Test
  public void thatSelectFsBehaviorAlignsWithCoveringPredicateOnRandomData() throws Exception {
    assertSelectionIsEqualOnRandomData(
            (cas, type, context) -> cas.getAnnotationIndex(type).select()
                    .filter(candidate -> covering(candidate, context)).collect(toList()),
            (cas, type, context) -> selectCovering(cas, type, context));
  }

  @Test
  public void thatSelectAtBehaviorAlignsWithColocatedPredicate() throws Exception {
    // X covering Y means that Y is covered by Y, so we need to select the covered by annotations
    // below.
    assertSelection(COLOCATED,
            (cas, type, x, y) -> selectAt(cas, type, x.getBegin(), x.getEnd()).contains(y),
            defaultPredicatesTestCases);
  }

  @Test
  public void thatSelectAtBehaviorAlignsWithColocatedPredicateOnRandomData() throws Exception {
    assertSelectionIsEqualOnRandomData(
            (cas, type, context) -> cas.getAnnotationIndex(type).select()
                    .filter(candidate -> colocated(candidate, context)).collect(toList()),
            (cas, type, context) -> selectAt(cas, type, context.getBegin(), context.getEnd()));
  }

  @SafeVarargs
  public static <T> List<T> union(List<T>... aLists) {
    List<T> all = new ArrayList<>();
    for (List<T> list : aLists) {
      all.addAll(list);
    }
    return all;
  }
}


text:
class App

  attr_accessor :path
  attr_accessor :config

  CONFIG_FILENAME = 'magenta.yml'

  def initialize(options)
    @app_path = File.expand_path(options['app'] || ('.'))
    @config_path = File.expand_path(options['config'] || find_config_file) rescue nil
    Log.info "Inspecting #{@app_path}"
    read_config(options)
    detect_config_from_app
  end

  def method_missing(m, *args)
    @config[m.to_s]
  end

private

  def find_config_file
    @config_path = @app_path if File.exist?(File.join(@app_path, CONFIG_FILENAME))
    @config_path ||= File.join(@app_path, 'config') if File.exist?(File.join(@app_path, 'config', CONFIG_FILENAME))
  end
  def rails?
    File.exist?(File.join(@app_path, 'app')) && File.exist?(File.join(@path, 'script'))
  end

  def git?
    File.exist?(File.join(@app_path, '.git'))
  end

  def get_origin_repository
    if git?
      `cd #{@app_path}; git remote show origin` =~ /URL:\s*(.*)$/
      $1
    else
      nil
    end
  end

  def detect_config_from_app
    @config['repository'] ||= get_origin_repository
  end

  def read_config(options)
    if @config_path
      filename = File.join(@config_path, CONFIG_FILENAME)
      if File.exists?(filename)
        Log.info "Reading configuration file #{filename}" do
          @config = YAML.load_file(filename)
          environment = options['environment']
          @config = @config[environment] if @config.keys.include?(environment)
          set_defaults
          Log.info "Config: #{config.inspect}"
        end
      end
    else
      @config = {}
      set_defaults
    end
  end

  def set_defaults
    @config['user'] ||= `whoami`.chomp
  end
end

redpajama_set_name: RedPajamaGithub


text:
<Serializable()> Public Class OscopeMeas
    Private _numFunctions As Integer = 2
    Private _pathLossFile(_numFunctions - 1) As String
    Private _antennaFactorFile(_numFunctions - 1) As String
    Private _name As String
    Private _sampleRate As Double
    Private _sampleRateUnits As String
    Private _memoryDepth As Double
    Private _memoryDepthUnits As String
    Private _timePerDivision As Double
    Private _timePerDivisionUnits As String
    Private _replayDelayMs As String
    Private _maxOscopeMiss As Integer = 50
    Private _oscopeMission(_maxOscopeMiss - 1) As OscopeMiss
    Private _measState(_maxOscopeMiss - 1) As MeasState

    Property GetMeasState() As MeasState()
        Get
            Return _measState
        End Get
        Set(ByVal value As MeasState())
            _measState = Value
        End Set
    End Property

    Property GetOscopeMission() As OscopeMiss()
        Get
            Return _oscopeMission
        End Get
        Set(ByVal value As OscopeMiss())
            _oscopeMission = Value
        End Set
    End Property

    'Private OscopeMission As New OscopeMission

    'Property getOscopeMission() As OscopeMission
    '    Get
    '        Return OscopeMission
    '    End Get
    '    Set(ByVal Value As OscopeMission)
    '        OscopeMission = Value
    '    End Set
    'End Property

    Property GetPathLossFile() As String()
        Get
            Return _pathLossFile
        End Get
        Set(ByVal value As String())
            _pathLossFile = Value
        End Set
    End Property

    Property GetAntennaFactorFile() As String()
        Get
            Return _antennaFactorFile
        End Get
        Set(ByVal value As String())
            _antennaFactorFile = Value
        End Set
    End Property

    Property GetName() As String
        Get
            Return _name
        End Get
        Set(ByVal value As String)
            _name = Value
        End Set
    End Property

    Property GetsampleRate() As Double
        Get
            Return _sampleRate
        End Get
        Set(ByVal value As Double)
            _sampleRate = Value
        End Set
    End Property

    Property GetsampleRateUnits() As String
        Get
            Return _sampleRateUnits
        End Get
        Set(ByVal value As String)
            _sampleRateUnits = Value
        End Set
    End Property

    Property GetmemoryDepth() As Double
        Get
            Return _memoryDepth
        End Get
        Set(ByVal value As Double)
            _memoryDepth = Value
        End Set
    End Property

    Property GetmemoryDepthUnits() As String
        Get
            Return _memoryDepthUnits
        End Get
        Set(ByVal value As String)
            _memoryDepthUnits = Value
        End Set
    End Property

    Property GettimePerDivision() As Double
        Get
            Return _timePerDivision
        End Get
        Set(ByVal value As Double)
            _timePerDivision = Value
        End Set
    End Property

    Property GettimePerDivisionUnits() As String
        Get
            Return _timePerDivisionUnits
        End Get
        Set(ByVal value As String)
            _timePerDivisionUnits = Value
        End Set
    End Property

    Property GetreplayDelayMs() As String
        Get
            Return _replayDelayMs
        End Get
        Set(ByVal value As String)
            _replayDelayMs = Value
        End Set
    End Property

End Class


text:
<!doctype html>

  <title>Investor relations | About</title>
  <link href="images/ios_homescreen_icon.png" rel="apple-touch-icon"/>
  <link href="images/favicon.ico" rel="shortcut icon" type="images/vnd.microsoft.icon"/>
  <meta http-equiv="Content-Type"  content="text/html charset=UTF-8" />

  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="title" content="Investor relations | About" />
  <meta name="description" content="The investor relations website contains information about Twitter, Inc. business for stockholders, potential investors, and financial analysts." />

  <meta property="og:url" content="https://investor.twitterinc.com/"/>

  <meta content="on" name="twitter:widgets:csp" />

    <link rel="canonical" href="https://investor.twitterinc.com/" />

    <link rel="stylesheet" href="css/ndq-icons.css" />
    <link rel="stylesheet" href="css/ndq-styles.css?69" type="text/css" />
    <link rel="stylesheet" href="css/ndq-toolbar.css" type="text/css" />
    <link rel="stylesheet" href="css/ndq-filetypes.css" />

    <link rel="stylesheet" href="/common/css/wsh_script_absent.css" type="text/css" media="screen" />

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="css/global.css">
    <link rel="stylesheet" type="text/css" href="css/colorbox.css" />

    <link rel="stylesheet" href="css/ndq-print.css" type="text/css" media="print" />

    <link rel="stylesheet" href="/common/css/ndq-common-4_1_0.css" />
    <link rel="stylesheet" href="css/ndq-overwrite.css" type="text/css" />
   	<link rel="stylesheet" href="css/ndq-responsive.css" type="text/css" media="screen" />

                            Twitter logo icon

Investor Relations

                            Arrow down icon

Sign out

Go to Twitter

                                    <button type="button">Sign In</button>

                                	<form action="search.cfm" method="get">
                                        <input type="hidden" name="method" value="and" />
                                        <input type="text" maxlength="40" name="ndq_keyword" value="Search Investor Relations" onFocus="if(this.value=='Search Investor Relations'){this.value=''};" onBlur="if(this.value==''){this.value='Search Investor Relations'};" />

                                    </form>

Brand assets

Brand thinking

Brand colors

Brand icons

                                Search icon

Homepage

Financial information

Financial releases

Quarterly results

Annual reports

SEC filings

Events & presentations

Annual meeting

Investor resources

IR blog

Blog directory

Success stories

Stock information

Historic stock lookup

Analyst coverage

Corporate governance

Board of directors

Management

Committee composition

Political contributions

Contact the board

Contact

Email alerts

Printed materials

FAQ

Search Investor Relations

Investor Relations

	Twitter is what’s happening in the world and what people are talking about right now.

                                <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 200 200" preserveAspectRatio="none">
                                    <circle cx="100" cy="100" r="50" fill="none" stroke-width="15" stroke-dasharray="0,20000" transform="rotate(-90,100,100)"></circle>
                                    </svg>

Recent Financial releases

Twitter Announces Appointment of Ned Segal as Chief Financial Officer

July 11, 2017

Twitter to Announce Second Quarter 2017 Results

July 6, 2017

View all

                                <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 200 200" preserveAspectRatio="none">
                                    <circle cx="100" cy="100" r="50" fill="none" stroke-width="15" stroke-dasharray="0,20000" transform="rotate(-90,100,100)"></circle>
                                    </svg>

Q1 2017 Earnings

Twitter First Quarter 2017 Earnings Conference Call

            Q1' 2017 Shareholder Letter

  1.2 MB

    Add to briefcase
    File is in briefcase

            Earnings Press Release

181.7 KB

    Add to briefcase
    File is in briefcase

            Slide Presentation

714.9 KB

    Add to briefcase
    File is in briefcase

            Selected Company Metrics and Financials

133.0 KB

    Add to briefcase
    File is in briefcase

View all

NYSE: TWTR

Events & presentations

NYSE: TWTR

$19.35

Price

3.81%

Change

$25.25

52 Wk. High

20.14M

Volume

$14,142M

Mkt. Cap.

$0.71

Change

$14.12

52 Wk. Low

M

3 Mo. Avg Volume

                Delayed at least 20 minutes.    JUL 12, 2017 - 12:27 PM ET

Events & Presentation

                                                Twitter Second Quarter 2017 Earnings Conference Call

                                            		Jul 27, 2017 at
                										            5:00 AM PT /
                										            8:00 AM ET

		Listen to webcast

View all

                    	Delayed at least 20 minutes.    JUL 12, 2017 - 12:27 PM ET

Latest News from the IR Twitter Blog

View all

Latest Tweets

	                    Tweets from https://twitter.com/TwitterIR

Blog Directory

Success Stories

Briefcase

Printed materials

Email alerts

Downloads

RSS

Print

About

Blogs

Press

Careers

Investors

Engineering

Policy

Brand

Business

About Twitter Ads

Targeting

Analytics

Ads Help Center

Small Business blog

Advertise

Developers

Documentation

Forums

Events

Developer blog

Fabric.io

Help Center

Using Twitter

My account

Fixing a problem

Policies and reporting

Safety Center

© 2017 Twitter, Inc.

Cookies

Privacy

Terms and Conditions

                        Language

English

Arabic

Bengali

Czech

Danish

German

Greek

Spanish

Persian

Finnish

Filipino

French

Hebrew

Hindi

Hungarian

Indonesian

Italian

Japanese

Korean

Malay

Dutch

Norwegian

Polish

Romanian


text:
<?php

/**
 * politico actions.
 *
 * @package    Voota
 * @subpackage Twitter
 * @author     Sergio Viteri
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */

class TwitterManager {
  	public static function requestAuthorization($user){
	  	$culture = $user->getCulture();

	  	$connection = new TwitterOAuth(sfConfig::get("app_twitter_api_consumer_key_$culture"), sfConfig::get("app_twitter_api_consumer_secret_$culture"));
		$request_token = $connection->getRequestToken(sfContext::getInstance()->getController()->genUrl("sfReviewFront/sendTwitter", true));
	  	if ($connection->http_code == 200) {
			$twAuthUrl = $connection->getAuthorizeURL($request_token['oauth_token']);
			$user->setAttribute('oauth_token', $request_token['oauth_token'], 'vo/twitter');
			$user->setAttribute('oauth_token_secret', $request_token['oauth_token_secret'], 'vo/twitter');

			return $twAuthUrl;
		}
		else {
			throw new Exception('Connection failed!');
		}
  	}

  	public static function verify($user){
	  	$culture = $user->getCulture();
  		$profile = $user->getGuardUser()->getProfile();

  		$connection = new TwitterOAuth(sfConfig::get("app_twitter_api_consumer_key_$culture"), sfConfig::get("app_twitter_api_consumer_secret_$culture"), $profile->getTwOauthToken(), $profile->getTwOauthTokenSecret());
  		$content = $connection->get('account/verify_credentials');
  		if( isset($content->error) && $content->error ){
  			return false;
  		}

  		return $content;
  	}

  	public static function authorize($user, $accessToken){
	  	$culture = $user->getCulture();
  		$profile = $user->getGuardUser()->getProfile();

  		$connection = new TwitterOAuth(sfConfig::get("app_twitter_api_consumer_key_$culture"), sfConfig::get("app_twitter_api_consumer_secret_$culture"), $user->getAttribute('oauth_token', false, 'vo/twitter'), $user->getAttribute('oauth_token_secret', false, 'vo/twitter'));
		$accessToken = $connection->getAccessToken($accessToken);
		if ($connection->http_code == 200){
			$profile->setTwOauthToken($accessToken['oauth_token']);
			$profile->setTwOauthTokenSecret($accessToken['oauth_token_secret']);
			$profile->save();
		    $user->setAttribute('oauth_token', false, 'vo/twitter');
		    $user->setAttribute('oauth_token_secret', false, 'vo/twitter');
		}
  	}

  	public static function post($user, $text){
	  	$culture = $user->getCulture();
  		$profile = $user->getGuardUser()->getProfile();

  		$connection = new TwitterOAuth(sfConfig::get("app_twitter_api_consumer_key_$culture"), sfConfig::get("app_twitter_api_consumer_secret_$culture"), $profile->getTwOauthToken(), $profile->getTwOauthTokenSecret());

  		$connection->post('statuses/update', array('status' => $text));
  	}

  	public static function shorten($url){
  		$entityUrl = $url;

  		$login = sfConfig::get("app_bitly_login");
  		$key = sfConfig::get("app_bitly_key");
  		$url = urlencode  (  $entityUrl  );
  		$shortenerUrl = "http://api.bit.ly/v3/shorten?login=$login&apiKey=$key&longUrl=$url&format=json";
  		$shorted = json_decode( file_get_contents( $shortenerUrl ) );
  		if ($shorted->status_code == 200){
  			$entityUrl = $shorted->data->url;
  		}

  		return $entityUrl;
  	}
}


text:
<!doctype html>

  <meta charset="utf-8">
  <title>Camera Try</title>
  <link rel="stylesheet" href="demo.css">
  <link href="bootstrap.min.css" rel="stylesheet">

  <link rel="stylesheet" href="animate.min.css">

Take a picture of yourself and make sure it is good because we will be using it for the facial recognition You can use a exisiting picture of yourself or you can use the camera we provided.

      <video id="video" width="393" height="295" preload autoplay loop muted controls></video>
      <canvas id="canvas" width="800" height="530"></canvas>

        <input class="form-control" id="uploadFile" type="text" placeholder="Choose File" disabled>

           Upload
          <input type="file" style="width:200px" class="upload" id="uploadBtn">


text:
.apps_filter {
    display: flex !important;
    flex: 1;
    align-items: center;
}

.text-nowrap {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app_filter_item {
    flex-grow: 1
}


text:
package templates

import (
	"bytes"
	"net/http"
	"testing"
)

// testWriter implements the net/http ResponseWriter interface
// Write is implemented by the embedded bytes.Buffer
type testWriter struct {
	*bytes.Buffer
}

// Header returns a new header everytime
func (tw *testWriter) Header() http.Header {
	return http.Header{}
}

// WriteHeader does nothing with the code
func (tw *testWriter) WriteHeader(code int) {}

func newTestWriter() *testWriter {
	var b bytes.Buffer
	return &testWriter{&b}
}

// Check that testWriter implements the http.ResponseWriter
var _ http.ResponseWriter = newTestWriter()

func TestEmpty(t *testing.T) {
	empty := Empty()
	if err := empty.Add("{{fsfd"); err == nil {
		t.Errorf("templates: Add failed to error when given a bad template")
	}
	if err := empty.Add(`{{ define "whatever" }}{{ .Whatever }}{{ end }}`); err != nil {
		t.Errorf("templates: Add returned an error when given a proper template")
	}

	// The whatever template should be added to the templates
	var b []byte
	buffer := bytes.NewBuffer(b)
	empty.Execute(buffer, "whatever")
}

func TestTemplates(t *testing.T) {
	// Parse the test_fixtures directory with a local variable
	parsed := New("./test_fixtures/pass", Attrs{"Greeting": "Yo"})

	// Overwrite a local variable
	if err := parsed.SetAttr("Greeting", "Hello"); err == nil {
		t.Errorf("failed to warn of overwritten local attributes")
	}

	// Create a testWriter for testing output
	w := newTestWriter()

	// Render the template with an additional Name attribute
	parsed.Execute(w, "parent", Attrs{"Name": "Lebowski"})

	// Test the output versus expected. If you've modified the test_fixtures
	// templates watch out for newlines - they matter!
	expected := `Parent is named Lebowski
Child says Hello`
	if w.String() != expected {
		t.Errorf("unexpected template execution output: %s", w.String())
	}

	// Test alternate delims
	parsed = NewWithDelims(
		"./test_fixtures/delims",
		`<%`,
		`%>`,
		Attrs{"Greeting": "Yo"},
	)
	w = newTestWriter()
	parsed.Execute(w, "delims")
	expected = `The template says Yo`
	if w.String() != expected {
		t.Errorf("unexpected delim template execution output: %s", w.String())
	}

	// Call a template that doesn't exist
	// Execute the test in an anon block (in case we want more defers)
	func() {
		var panicked interface{}
		defer func() {
			panicked = recover()
		}()
		w = newTestWriter()
		parsed.Execute(w, "dne")
		if panicked == nil {
			t.Fatalf("failed to panic when given a name that does not exist")
		}
	}()

	// Cause an error in filepath.Walk by providing a dir that does not exist
	func() {
		var panicked interface{}
		defer func() {
			panicked = recover()
		}()
		New("./test_fixtures/dne")
		if panicked == nil {
			t.Fatalf("failed to panic when given a dir that does not exist")
		}
	}()

	// Parse a bad template
	func() {
		var panicked interface{}
		defer func() {
			panicked = recover()
		}()
		New("./test_fixtures/fail")
		if panicked == nil {
			t.Fatalf("failed to panic when a bad template is given")
		}
	}()
}


text:
/**
 * Adds rows in dataset2 to dataset1
 */
morpheus.JoinedDataset = function (dataset1, dataset2, dataset1Field,
                                   dataset2Field, sourceFieldName) {
  sourceFieldName = sourceFieldName || 'Source';
  this.dataset1Field = dataset1Field;
  this.dataset2Field = dataset2Field;
  if (dataset1 == null) {
    throw 'dataset1 is null';
  }
  if (dataset2 == null) {
    throw 'dataset2 is null';
  }
  if (dataset1Field) { // reorder dataset 2 to match dataset 1
    var v1 = dataset1.getColumnMetadata().getByName(dataset1Field);
    var dataset2ValueToIndex = morpheus.VectorUtil
    .createValueToIndexMap(dataset2.getColumnMetadata().getByName(
      dataset2Field));
    var dataset2ColumnIndices = [];
    for (var i = 0; i < v1.size(); i++) {
      dataset2ColumnIndices[i] = dataset2ValueToIndex.get(v1.getValue(i));
      // undefined indices are handles in SlicedDatasetWithNulls
    }
    dataset2 = new morpheus.SlicedDatasetWithNulls(dataset2,
      dataset2ColumnIndices, dataset1.getColumnCount(), dataset1
      .getColumnMetadata());
  }

  if (!dataset1.getRowMetadata().getByName(sourceFieldName)) {
    var sourceVector = dataset1.getRowMetadata().add(sourceFieldName);
    var name = dataset1.getName();
    for (var i = 0, nrows = sourceVector.size(); i < nrows; i++) {
      sourceVector.setValue(i, name);
    }
  }
  if (!dataset2.getRowMetadata().getByName(sourceFieldName)) {
    var sourceVector = dataset2.getRowMetadata().add(sourceFieldName);
    var name = dataset2.getName();
    for (var i = 0, nrows = sourceVector.size(); i < nrows; i++) {
      sourceVector.setValue(i, name);
    }

  }

  // make sure dataset1 and dataset2 have the same row metadata fields in the
  // same order
  for (var i = 0, count = dataset1.getRowMetadata().getMetadataCount(); i < count; i++) {
    var name = dataset1.getRowMetadata().get(i).getName();
    if (dataset2.getRowMetadata().getByName(name) == null) {
      dataset2.getRowMetadata().add(name);
    }
  }
  for (var i = 0, count = dataset2.getRowMetadata().getMetadataCount(); i < count; i++) {
    var name = dataset2.getRowMetadata().get(i).getName();
    if (dataset1.getRowMetadata().getByName(name) == null) {
      dataset1.getRowMetadata().add(name);
    }
  }

  // put dataset2 row metadata names in same order as dataset1
  var dataset2RowMetadataOrder = [];
  var metadataInDifferentOrder = false;
  for (var i = 0, count = dataset1.getRowMetadata().getMetadataCount(); i < count; i++) {
    var name = dataset1.getRowMetadata().get(i).getName();
    var index = morpheus.MetadataUtil.indexOf(dataset2.getRowMetadata(),
      name);
    dataset2RowMetadataOrder.push(index);
    if (index !== i) {
      metadataInDifferentOrder = true;
    }
  }
  this.dataset1 = dataset1;
  this.dataset2 = dataset2;
  // TODO put series in same order
  var maxSeriesCount = Math.max(this.dataset1.getSeriesCount(), this.dataset2
  .getSeriesCount());
  for (var i = this.dataset1.getSeriesCount(); i < maxSeriesCount; i++) {
    this.dataset1.addSeries({
      name: this.dataset2.getName(i)
    });
  }
  for (var i = this.dataset2.getSeriesCount(); i < maxSeriesCount; i++) {
    this.dataset2.addSeries({
      name: this.dataset1.getName(i)
    });
  }

  this.rowMetadata = new morpheus.JoinedMetadataModel(this.dataset1
  .getRowMetadata(), !metadataInDifferentOrder ? this.dataset2
    .getRowMetadata() : new morpheus.MetadataModelColumnView(
      this.dataset2.getRowMetadata(), dataset2RowMetadataOrder));
};
morpheus.JoinedDataset.prototype = {
  getName: function (seriesIndex) {
    return this.dataset1.getName(seriesIndex);
  },
  setName: function (seriesIndex, name) {
    this.dataset1.setName(seriesIndex, name);
  },
  getDataType: function (seriesIndex) {
    return this.dataset1.getDataType(seriesIndex);
  },
  getDatasets: function () {
    return [this.dataset1, this.dataset2];
  },
  getDataset1: function () {
    return this.dataset1;
  },
  getRowMetadata: function () {
    return this.rowMetadata;
  },
  getColumnMetadata: function () {
    return this.dataset1.getColumnMetadata();
  },
  getRowCount: function () {
    return this.dataset1.getRowCount() + this.dataset2.getRowCount();
  },
  getColumnCount: function () {
    return this.dataset1.getColumnCount();
  },
  getValue: function (i, j, seriesIndex) {
    return i < this.dataset1.getRowCount() ? this.dataset1.getValue(i, j,
        seriesIndex) : this.dataset2.getValue(i
        - this.dataset1.getRowCount(), j, seriesIndex);
  },
  setValue: function (i, j, value, seriesIndex) {
    i < this.dataset1.getRowCount() ? this.dataset1.setValue(i, j, value,
        seriesIndex) : this.dataset2.setValue(i
        - this.dataset1.getRowCount(), j, value, seriesIndex);
  },
  getSeriesCount: function () {
    return this.dataset1.getSeriesCount();
  },
  addSeries: function (options) {
    this.dataset1.addSeries(options);
    return this.dataset2.addSeries(options);
  },
  removeSeries: function (seriesIndex) {
    this.dataset1.removeSeries(seriesIndex);
    this.dataset2.removeSeries(seriesIndex);
  },
  toString: function () {
    return this.getName();
  }
};
morpheus.SlicedDatasetWithNulls = function (dataset, columnIndices, columnCount,
                                            columnMetadata) {
  morpheus.DatasetAdapter.call(this, dataset);
  this.columnIndices = columnIndices;
  this.columnCount = columnCount;
  this.columnMetadata = columnMetadata;
};
morpheus.SlicedDatasetWithNulls.prototype = {
  getColumnMetadata: function () {
    return this.columnMetadata;
  },
  getColumnCount: function () {
    return this.columnCount;
  },
  getValue: function (i, j, seriesIndex) {
    var index = this.columnIndices[j];
    return index === undefined ? undefined : this.dataset.getValue(i,
        index, seriesIndex);
  },
  setValue: function (i, j, value, seriesIndex) {
    var index = this.columnIndices[j];
    if (index !== undefined) {
      this.dataset.setValue(i, index, value, seriesIndex);
    } else {
      console.log(j + ' out of range');
    }
  }
};
morpheus.Util.extend(morpheus.SlicedDatasetWithNulls, morpheus.DatasetAdapter);
morpheus.JoinedVector = function (v1, v2) {
  this.v1 = v1;
  this.v2 = v2;
  morpheus.VectorAdapter.call(this, v1);
  this.properties = new morpheus.Map();
};
morpheus.JoinedVector.prototype = {
  setValue: function (i, value) {
    i < this.v1.size() ? this.v1.setValue(i, value) : this.v2.setValue(i
        - this.v1.size(), value);
  },
  getValue: function (i) {
    return i < this.v1.size() ? this.v1.getValue(i) : this.v2.getValue(i
        - this.v1.size());
  },
  size: function () {
    return this.v1.size() + this.v2.size();
  },
  getProperties: function () {
    return this.properties;
  }
};
morpheus.Util.extend(morpheus.JoinedVector, morpheus.VectorAdapter);
morpheus.JoinedMetadataModel = function (m1, m2) {
  this.m1 = m1;
  this.m2 = m2;
  this.vectors = [];
  for (var i = 0, count = m1.getMetadataCount(); i < count; i++) {
    var v1 = this.m1.get(i);
    var v2 = this.m2.get(i);
    var v = new morpheus.JoinedVector(v1, v2);
    // copy properties
    v1.getProperties().forEach(function (val, key) {
      if (!morpheus.VectorKeys.COPY_IGNORE.has(key)) {
        v.properties.set(key, val);
      }
    });
    v2.getProperties().forEach(function (val, key) {
      if (!morpheus.VectorKeys.COPY_IGNORE.has(key)) {
        v.properties.set(key, val);
      }
    });

    this.vectors.push(v);
  }
};
morpheus.JoinedMetadataModel.prototype = {
  add: function (name) {
    var index = morpheus.MetadataUtil.indexOf(this, name);
    var oldVector;
    if (index !== -1) {
      oldVector = this.remove(index);
    }
    var v = new morpheus.Vector(name, this.getItemCount());
    if (oldVector != null) {
      // copy properties
      oldVector.getProperties().forEach(function (val, key) {
        v.getProperties().set(key, val);
      });
      // copy values
      for (var i = 0, size = oldVector.size(); i < size; i++) {
        v.setValue(i, oldVector.getValue(i));
      }
    }
    this.vectors.push(v);
    return v;
  },
  getItemCount: function () {
    return this.m1.getItemCount() + this.m2.getItemCount();
  },
  get: function (index) {
    return this.vectors[index];
  },
  remove: function (index) {
    return this.vectors.splice(index, 1)[0];
  },
  getByName: function (name) {
    for (var i = 0, length = this.vectors.length; i < length; i++) {
      if (name === this.vectors[i].getName()) {
        return this.vectors[i];
      }
    }
  },
  getMetadataCount: function () {
    return this.vectors.length;
  }
};


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddForeignPermissions extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::table('permissions', function (Blueprint $table) {
            $table->foreign('user_id')->references('id')->on('users');
            $table->foreign('server_id')->references('id')->on('servers');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::table('permissions', function (Blueprint $table) {
            $table->dropForeign('permissions_user_id_foreign');
            $table->dropForeign('permissions_server_id_foreign');

            $table->dropIndex('permissions_user_id_foreign');
            $table->dropIndex('permissions_server_id_foreign');
        });
    }
}


text:
'use strict';

//Letters service used for communicating with the agencies REST endpoints
angular.module('letters').factory('Agencies', ['$resource',
    function($resource) {
        return $resource('agency/:agencyId', {
            agencyId: '@_id'
        }, {
            update: {
                method: 'PUT'
            }
        });
    }
]);


text:
@interface ASCollectionViewTestDelegate : NSObject <ASCollectionViewDataSource, ASCollectionViewDelegate>

@property (nonatomic, assign) NSInteger numberOfSections;
@property (nonatomic, assign) NSInteger numberOfItemsInSection;

@end

@implementation ASCollectionViewTestDelegate

- (id)initWithNumberOfSections:(NSInteger)numberOfSections numberOfItemsInSection:(NSInteger)numberOfItemsInSection {
  if (self = [super init]) {
    _numberOfSections = numberOfSections;
    _numberOfItemsInSection = numberOfItemsInSection;
  }

  return self;
}

- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForItemAtIndexPath:(NSIndexPath *)indexPath {
  ASTextCellNode *textCellNode = [ASTextCellNode new];
  textCellNode.text = indexPath.description;

  return textCellNode;
}

- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
  return self.numberOfSections;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
  return self.numberOfItemsInSection;
}

@end

@interface ASCollectionViewTestController: UIViewController

@property (nonatomic, strong) ASCollectionViewTestDelegate *asyncDelegate;
@property (nonatomic, strong) ASCollectionView *collectionView;

@end

@implementation ASCollectionViewTestController

- (void)viewDidLoad {
  [super viewDidLoad];

  self.asyncDelegate = [[ASCollectionViewTestDelegate alloc] initWithNumberOfSections:10 numberOfItemsInSection:10];

  self.collectionView = [[ASCollectionView alloc] initWithFrame:self.view.bounds
                                           collectionViewLayout:[UICollectionViewFlowLayout new]];
  self.collectionView.asyncDataSource = self.asyncDelegate;
  self.collectionView.asyncDelegate = self.asyncDelegate;

  [self.view addSubview:self.collectionView];
}

- (void)viewWillLayoutSubviews {
  [super viewWillLayoutSubviews];

  self.collectionView.frame = self.view.bounds;
}

@end

@interface ASCollectionViewTests : XCTestCase

@end

@implementation ASCollectionViewTests

- (void)DISABLED_testCollectionViewController {
  ASCollectionViewTestController *testController = [[ASCollectionViewTestController alloc] initWithNibName:nil bundle:nil];

  UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
  [containerView addSubview:testController.view];

  [testController.collectionView reloadData];

  [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]];
}

@end


text:
package cn.zxl.mapper.config;

public class Relation {

	private String leftName;

	private String rightName;

	private String dateFormat;

	private String rule;

	private boolean reverse;

	public Relation(String leftName, String rightName, String dateFormat, String rule, boolean reverse) {
		super();
		this.leftName = leftName;
		this.rightName = rightName;
		this.dateFormat = dateFormat;
		this.rule = rule;
		this.reverse = reverse;
	}

	public boolean isReverse() {
		return reverse;
	}

	public String getLeftName() {
		return leftName;
	}

	public String getRightName() {
		return rightName;
	}

	public String getDateFormat() {
		return dateFormat;
	}

	public String getRule() {
		return rule;
	}

	@Override
	public String toString() {
		return "Relation [leftName=" + leftName + ", rightName=" + rightName + ", dateFormat=" + dateFormat + ", rule=" + rule + "]";
	}

}


text:
import "reflect-metadata";
import { createTestingConnections, closeTestingConnections, reloadTestingDatabases } from "../../utils/test-utils";
import { Connection } from "../../../src/connection/Connection";
import { expect } from "chai";
it("github issues > #3158 Cannot run sync a second time", async () => {
    let connections: Connection[];
        connections = await createTestingConnections({
            entities: [__dirname + "/entity/*{.js,.ts}"],
            schemaCreate: true,
            dropSchema: true,
            enabledDrivers: ["mysql", "mariadb", "oracle", "mssql", "sqljs", "sqlite", "better-sqlite3"],
            // todo(AlexMesser): check why tests are failing under postgres driver
        });
        await reloadTestingDatabases(connections);
        await Promise.all(connections.map(async connection => {
            const schemaBuilder = connection.driver.createSchemaBuilder();
            const syncQueries = await schemaBuilder.log();
            expect(syncQueries.downQueries).to.be.eql([]);
            expect(syncQueries.upQueries).to.be.eql([]);
        }));
        await closeTestingConnections(connections);
});


text:
package edu.benedictine.game.engine.collision;

import edu.benedictine.game.engine.Terrain;

//created by Joseph Rioux, 2 August 2013
//stores information about a line-terrain intersection

public class Slice
{
	Terrain wall;
	double x, y;

	public Slice(Terrain wall, double interX, double interY)
	{
		this.wall = wall;
		this.x = interX;
		this.y = interY;
	}
}


text:
#include "zanLock.h"
#include "zanLog.h"

//=============================used for zanLock_create==========================
extern int zanMutex_create(zanLock *lock, int use_in_process);
#ifdef HAVE_RWLOCK
extern int zanRWLock_create(zanLock *lock, int use_in_process);
#endif
#ifdef HAVE_SPINLOCK
extern int zanSpinLock_create(zanLock *object, int spin);
#endif
extern int zanFileLock_create(zanLock *lock, int fd);
extern int zanSem_create(zanLock *lock, key_t key);
extern int zanAtomicLock_create(zanLock *object, int spin);

int zanLock_create(zanLock *lock, enum ZAN_LOCK_TYPE lock_type, int lock_arg)
{
    if (lock_type == ZAN_RWLOCK) {
#ifdef HAVE_RWLOCK
        return zanRWLock_create(lock, lock_arg);
#endif
        zanFatalError("ZAN_RWLOCK lock_type not support, exit.");
        return ZAN_ERR;
    } else if (lock_type == ZAN_FILELOCK) {
        return zanFileLock_create(lock, lock_arg);
    } else if (lock_type == ZAN_MUTEX) {
        return zanMutex_create(lock, lock_arg);
    } else if (lock_type == ZAN_SEM) {
        return zanSem_create(lock, lock_arg);
    } else if (lock_type == ZAN_SPINLOCK) {
#ifdef HAVE_SPINLOCK
        return zanSpinLock_create(lock, lock_arg);
#endif
        zanFatalError("ZAN_SPINLOCK lock_type not support, exit.");
        return ZAN_ERR;
    } else if (lock_type == ZAN_ATOMLOCK) {
        return zanAtomicLock_create(lock, lock_arg);
    } else {
        zanFatalError("lock_type=%d not support, exit.", lock_type);
        return ZAN_ERR;
    }
}


text:
Nette Utility Classes
=====================

[![Downloads this Month](https://img.shields.io/packagist/dm/nette/utils.svg)](https://packagist.org/packages/nette/utils)
[![Build Status](https://travis-ci.org/nette/utils.svg?branch=master)](https://travis-ci.org/nette/utils)
[![Latest Stable Version](https://poser.pugx.org/nette/utils/v/stable)](https://github.com/nette/utils/releases)
[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/utils/blob/master/license.md)

Nette\Object: Strict classes
----------------------------

PHP gives a huge freedom to developers, which makes it a perfect language for making mistakes. But you can stop this bad behavior and start writing applications without hardly discoverable mistakes. Do you wonder how? It's really simple -- you just need to have stricter rules.

Can you find an error in this example?

```php
class Circle
{
	public $radius;

	public function getArea()
	{
		return $this->radius * $this->radius * M_PI;
	}

}

$circle = new Circle;
$circle->raduis = 10;
echo $circle->getArea(); // 10² * π ≈ 314
```

On the first look it seems that code will print out 314; but it returns 0. How is this even possible? Accidentaly, `$circle->radius` was mistyped to `raduis`. Just a small typo, which will give you a hard time correcting it, because PHP does not say a thing when something is wrong. Not even a Warning or Notice error message. Because PHP does not think it is an error.

The mentioned mistake could be corrected immediately, if class `Circle` would be descendant of [api:Nette\Object]:

```php
class Circle extends Nette\Object
{
	...
```

Whereas the former code executed successfully (although it contained an error), the latter did not:

![](http://files.nette.org/git/doc-2.1/debugger-circle.png)

Class `Nette\Object` made `Circle` more strict and threw an exception when you tried to access an undeclared property. And `Tracy\Debugger` displayed error message about it. Line of code with fatal typo is now highlighted and error message has meaningful description: *Cannot write to an undeclared property Circle::$raduis*. Programmer can now fix the mistake he might have otherwise missed and which could be a real pain to find later.

One of many remarkable abilities of `Nette\Object` is throwing exceptions when accessing undeclared members.

```php
$circle = new Circle;
echo $circle->undeclared; // throws Nette\MemberAccessException
$circle->undeclared = 1; // throws Nette\MemberAccessException
$circle->unknownMethod(); // throws Nette\MemberAccessException
```

But it has much more to offer!

Properties, getters a setters
-----------------------------

In modern object oriented languages *property* describes members of class, which look like variables but are represented by methods. When reading or assigning values to those "variables", methods are called instead (so-called getters and setters). It is really useful feature, which allows us to control the access to these variables. Using this we can validate inputs or postpone the computation of values of these variables to the time when it is actually accessed.

Any class that is a descendant of `Nette\Object` acquires the ability to imitate properties. Only thing you need to do is to keep simple convention:

- Getter and setter have to be *public* methods.
- Getter's name is `getXyz()` or `isXyz()`, setter's is `setXyz()`
- Getter and setter are optional, so it is possible to have *read-only* or *write-only* properties
- Names of properties are case-sensitive (first letter being an exception)

We will make use of properties in the class Circle to make sure variable `$radius` contains only non-negative numbers:

```php
class Circle extends Nette\Object
{
	private $radius; // not public anymore!

	public function getRadius()
	{
		return $this->radius;
	}

	public function setRadius($radius)
	{
		// sanitizing value before saving it
		$this->radius = max(0.0, (float) $radius);
	}

	public function getArea()
	{
		return $this->radius * $this->radius * M_PI;
	}

	public function isVisible()
	{
		return $this->radius > 0;
	}

}

$circle = new Circle;
// the classic way using method calls
$circle->setRadius(10); // sets circle's radius
echo $circle->getArea(); // gets circle's area

// the alternative way using properties
$circle->radius = 10; // calls setRadius()
echo $circle->area; // calls getArea()
echo $circle->visible; // calls $circle->isVisible()
```

Properties are mostly a syntactic sugar to beautify the code and make programmer's life easier. You do not have to use them, if you don't want to.

Events
------

Now we are going to create functions, which will be called when border radius changes. Let's call it `change` event and those functions event handlers:

```php
class Circle extends Nette\Object
{
	/** @var array */
	public $onChange;

	public function setRadius($radius)
	{
		// call events in onChange
		$this->onChange($this, $this->radius, $radius);

		$this->radius = max(0.0, (float) $radius);
	}
}

$circle = new Circle;

// adding an event handler
$circle->onChange[] = function($circle, $oldValue, $newValue) {
	echo 'there was a change!';
};

$circle->setRadius(10);
```

There is another syntactic sugar in `setRadius`'s code. Instead of iteration on `$onChange` array and calling each method one by one with unreliable (does not report if callback has any errors) function [php:call_user_func], you just have to write simple `onChange(...)` and given parameters will be handed over to the handlers.

Extension methods
-----------------

Do you need to add a new method to an existing object or class at runtime? **Extension methods** is just what you need.

```php
// declaration of future method Circle::getCircumference()
Circle::extensionMethod('getCircumference', function (Circle $that) {
	return $that->radius * 2 * M_PI;
});

$circle = new Circle;
$circle->radius = 10;
echo $circle->getCircumference(); // ≈ 62.8
```

Extensions methods can also take parameters. They don't break encapsulation, because they only have access to the public members of the class. You can also connect them with interfaces, therefore every class implementing that interface will have that method available.


text:
package tools.datasync.db2db.logic;

public class ConflictException extends Exception {

}


text:
import unittest

import fiona

GPX_FILE = 'tests/data/test_gpx.gpx'

class NonCountingLayerTest(unittest.TestCase):
    def setUp(self):
        self.c = fiona.open(GPX_FILE, "r", layer="track_points")

    def tearDown(self):
        self.c.close()

    def test_len_fail(self):
        with self.assertRaises(TypeError):
            len(self.c)

    def test_list(self):
        features = list(self.c)
        self.assertEquals(len(features), 19)

    def test_getitem(self):
        feature = self.c[2]

    def test_fail_getitem_negative_index(self):
        with self.assertRaises(IndexError):
            self.c[-1]

    def test_slice(self):
        features = self.c[2:5]
        self.assertEquals(len(features), 3)

    def test_fail_slice_negative_index(self):
        with self.assertRaises(IndexError):
            self.c[2:-4]


text:
using namespace vlofgren;

// ProtoServer includes
#include <protoserver/ProtoServer.h>

// BoblightServer includes
#include <boblightserver/BoblightServer.h>
#include <sys/prctl.h>

using namespace vlofgren;

void signal_handler(const int signum)
{
	QCoreApplication::quit();

	// reset signal handler to default (in case this handler is not capable of stopping)
	signal(signum, SIG_DFL);
}

Json::Value loadConfig(const std::string & configFile)
{
	// make sure the resources are loaded (they may be left out after static linking)
	Q_INIT_RESOURCE(resource);

	// read the json schema from the resource
	QResource schemaData(":/hyperion-schema");
	assert(schemaData.isValid());

	Json::Reader jsonReader;
	Json::Value schemaJson;
	if (!jsonReader.parse(reinterpret_cast<const char *>(schemaData.data()), reinterpret_cast<const char *>(schemaData.data()) + schemaData.size(), schemaJson, false))
	{
		throw std::runtime_error("ERROR: Json schema wrong: " + jsonReader.getFormattedErrorMessages())	;
	}
	JsonSchemaChecker schemaChecker;
	schemaChecker.setSchema(schemaJson);

	const Json::Value jsonConfig = JsonFactory::readJson(configFile);
	schemaChecker.validate(jsonConfig);

	return jsonConfig;
}

void startNewHyperion(int parentPid, std::string hyperionFile, std::string configFile)
{
	if ( fork() == 0 )
	{
		sleep(3);
		execl(hyperionFile.c_str(), hyperionFile.c_str(), "--parent", QString::number(parentPid).toStdString().c_str(), configFile.c_str(), NULL);
		exit(0);
	}
}

void startBootsequence(const Json::Value &config, Hyperion &hyperion)
{
	// create boot sequence if the configuration is present
	if (config.isMember("bootsequence"))
	{
		const Json::Value effectConfig = config["bootsequence"];

		// Get the parameters for the bootsequence
		const std::string effectName = effectConfig["effect"].asString();
		const unsigned duration_ms   = effectConfig["duration_ms"].asUInt();
		const int priority           = (duration_ms != 0) ? 0 : effectConfig.get("priority",990).asInt();
		const int bootcolor_priority = (priority > 990) ? priority+1 : 990;

		// clear the leds
		ColorRgb boot_color = ColorRgb::BLACK;
		hyperion.setColor(bootcolor_priority, boot_color, 0, false);

		// start boot effect
		if ( ! effectName.empty() )
		{
			int result;
			std::cout << "INFO: Boot sequence '" << effectName << "' ";
			if (effectConfig.isMember("args"))
			{
				std::cout << " (with user defined arguments) ";
				const Json::Value effectConfigArgs = effectConfig["args"];
				result = hyperion.setEffect(effectName, effectConfigArgs, priority, duration_ms);
			}
			else
			{
				result = hyperion.setEffect(effectName, priority, duration_ms);
			}
			std::cout << ((result == 0) ? "started" : "failed") << std::endl;
		}

		// static color
		if ( ! effectConfig["color"].isNull() && effectConfig["color"].isArray() && effectConfig["color"].size() == 3 )
		{
			boot_color = {
				(uint8_t)effectConfig["color"][0].asUInt(),
				(uint8_t)effectConfig["color"][1].asUInt(),
				(uint8_t)effectConfig["color"][2].asUInt()
			};
		}

		hyperion.setColor(bootcolor_priority, boot_color, 0, false);
	}
}

// create XBMC video checker if the configuration is present
void startXBMCVideoChecker(const Json::Value &config, XBMCVideoChecker* &xbmcVideoChecker)
{
	if (config.isMember("xbmcVideoChecker"))
	{
		const Json::Value & videoCheckerConfig = config["xbmcVideoChecker"];
		xbmcVideoChecker = new XBMCVideoChecker(
			videoCheckerConfig["xbmcAddress"].asString(),
			videoCheckerConfig["xbmcTcpPort"].asUInt(),
			videoCheckerConfig["grabVideo"].asBool(),
			videoCheckerConfig["grabPictures"].asBool(),
			videoCheckerConfig["grabAudio"].asBool(),
			videoCheckerConfig["grabMenu"].asBool(),
			videoCheckerConfig.get("grabPause", true).asBool(),
			videoCheckerConfig.get("grabScreensaver", true).asBool(),
			videoCheckerConfig.get("enable3DDetection", true).asBool());

		xbmcVideoChecker->start();
		std::cout << "INFO: Kodi checker created and started" << std::endl;
	}
}

void startNetworkServices(const Json::Value &config, Hyperion &hyperion, JsonServer* &jsonServer, ProtoServer* &protoServer, BoblightServer* &boblightServer, XBMCVideoChecker* &xbmcVideoChecker)
{
	// Create Json server if configuration is present
	unsigned int jsonPort = 19444;
	if (config.isMember("jsonServer"))
	{
		const Json::Value & jsonServerConfig = config["jsonServer"];
		//jsonEnable = jsonServerConfig.get("enable", true).asBool();
		jsonPort   = jsonServerConfig.get("port", jsonPort).asUInt();
	}

	jsonServer = new JsonServer(&hyperion, jsonPort );
	std::cout << "INFO: Json server created and started on port " << jsonServer->getPort() << std::endl;

	// Create Proto server if configuration is present
	unsigned int protoPort = 19445;
	if (config.isMember("protoServer"))
	{
		const Json::Value & protoServerConfig = config["protoServer"];
		//protoEnable = protoServerConfig.get("enable", true).asBool();
		protoPort  = protoServerConfig.get("port", protoPort).asUInt();
	}

	protoServer = new ProtoServer(&hyperion, protoPort );
	if (xbmcVideoChecker != nullptr)
	{
		QObject::connect(xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), protoServer, SIGNAL(grabbingMode(GrabbingMode)));
		QObject::connect(xbmcVideoChecker, SIGNAL(videoMode(VideoMode)), protoServer, SIGNAL(videoMode(VideoMode)));
	}
	std::cout << "INFO: Proto server created and started on port " << protoServer->getPort() << std::endl;

#ifdef ENABLE_ZEROCONF
	const Json::Value & deviceConfig = config["device"];
	const std::string deviceName = deviceConfig.get("name", "").asString();

	const std::string hostname = QHostInfo::localHostName().toStdString();

	std::string mDNSDescr_json = hostname;
	std::string mDNSService_json = "_hyperiond_json._tcp";
	if (config.isMember("jsonServer"))
	{
		const Json::Value & jsonServerConfig = config["jsonServer"];
		mDNSDescr_json = jsonServerConfig.get("mDNSDescr", mDNSDescr_json).asString();
		mDNSService_json = jsonServerConfig.get("mDNSService", mDNSService_json).asString();
	}

	BonjourServiceRegister *bonjourRegister_json = new BonjourServiceRegister();
	bonjourRegister_json->registerService(BonjourRecord((deviceName + " @ " + mDNSDescr_json).c_str(), mDNSService_json.c_str(),
	                                      QString()), jsonServer->getPort() );
	std::cout << "INFO: Json mDNS responder started" << std::endl;

	std::string mDNSDescr_proto = hostname;
	std::string mDNSService_proto = "_hyperiond_proto._tcp";
	if (config.isMember("protoServer"))
	{
		const Json::Value & protoServerConfig = config["protoServer"];
		mDNSDescr_proto = protoServerConfig.get("mDNSDescr", mDNSDescr_proto).asString();
		mDNSService_proto = protoServerConfig.get("mDNSService", mDNSService_proto).asString();
	}

	BonjourServiceRegister *bonjourRegister_proto = new BonjourServiceRegister();
	bonjourRegister_proto->registerService(BonjourRecord((deviceName + " @ " + mDNSDescr_proto).c_str(), mDNSService_proto.c_str(),
	                                       QString()), protoServer->getPort() );
	std::cout << "INFO: Proto mDNS responder started" << std::endl;
#endif

	// Create Boblight server if configuration is present
	if (config.isMember("boblightServer"))
	{
		const Json::Value & boblightServerConfig = config["boblightServer"];
		boblightServer = new BoblightServer(&hyperion, boblightServerConfig.get("priority",900).asInt(), boblightServerConfig["port"].asUInt());
		std::cout << "INFO: Boblight server created and started on port " << boblightServer->getPort() << std::endl;
	}
}

#ifdef ENABLE_DISPMANX
void startGrabberDispmanx(const Json::Value &config, Hyperion &hyperion, ProtoServer* &protoServer, XBMCVideoChecker* &xbmcVideoChecker, DispmanxWrapper* &dispmanx)
{
	// Construct and start the frame-grabber if the configuration is present
	if (config.isMember("framegrabber"))
	{
		const Json::Value & frameGrabberConfig = config["framegrabber"];
		dispmanx = new DispmanxWrapper(
			frameGrabberConfig["width"].asUInt(),
			frameGrabberConfig["height"].asUInt(),
			frameGrabberConfig["frequency_Hz"].asUInt(),
			frameGrabberConfig.get("priority",900).asInt(),
			&hyperion);
		dispmanx->setCropping(
					frameGrabberConfig.get("cropLeft", 0).asInt(),
					frameGrabberConfig.get("cropRight", 0).asInt(),
					frameGrabberConfig.get("cropTop", 0).asInt(),
					frameGrabberConfig.get("cropBottom", 0).asInt());

		if (xbmcVideoChecker != nullptr)
		{
			QObject::connect(xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), dispmanx, SLOT(setGrabbingMode(GrabbingMode)));
			QObject::connect(xbmcVideoChecker, SIGNAL(videoMode(VideoMode)), dispmanx, SLOT(setVideoMode(VideoMode)));
		}

		QObject::connect(dispmanx, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );

		dispmanx->start();
		std::cout << "INFO: Frame grabber created and started" << std::endl;
	}
}
#endif

#ifdef ENABLE_V4L2
void startGrabberV4L2(const Json::Value &config, Hyperion &hyperion, ProtoServer* &protoServer, V4L2Wrapper* &v4l2Grabber )
{
	// construct and start the v4l2 grabber if the configuration is present
	if (config.isMember("grabber-v4l2"))
	{
		const Json::Value & grabberConfig = config["grabber-v4l2"];
		v4l2Grabber = new V4L2Wrapper(
					grabberConfig.get("device", "/dev/video0").asString(),
					grabberConfig.get("input", 0).asInt(),
					parseVideoStandard(grabberConfig.get("standard", "no-change").asString()),
					parsePixelFormat(grabberConfig.get("pixelFormat", "no-change").asString()),
					grabberConfig.get("width", -1).asInt(),
					grabberConfig.get("height", -1).asInt(),
					grabberConfig.get("frameDecimation", 2).asInt(),
					grabberConfig.get("sizeDecimation", 8).asInt(),
					grabberConfig.get("redSignalThreshold", 0.0).asDouble(),
					grabberConfig.get("greenSignalThreshold", 0.0).asDouble(),
					grabberConfig.get("blueSignalThreshold", 0.0).asDouble(),
					&hyperion,
					grabberConfig.get("priority", 900).asInt());
		v4l2Grabber->set3D(parse3DMode(grabberConfig.get("mode", "2D").asString()));
		v4l2Grabber->setCropping(
					grabberConfig.get("cropLeft", 0).asInt(),
					grabberConfig.get("cropRight", 0).asInt(),
					grabberConfig.get("cropTop", 0).asInt(),
					grabberConfig.get("cropBottom", 0).asInt());

		QObject::connect(v4l2Grabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );

		v4l2Grabber->start();
		std::cout << "INFO: V4L2 grabber created and started" << std::endl;
	}

}
#endif

#ifdef ENABLE_AMLOGIC
void startGrabberAmlogic(const Json::Value &config, Hyperion &hyperion, ProtoServer* &protoServer, XBMCVideoChecker* &xbmcVideoChecker, AmlogicWrapper* &amlGrabber)
{
	// Construct and start the framebuffer grabber if the configuration is present
	if (config.isMember("amlgrabber"))
	{
		const Json::Value & grabberConfig = config["amlgrabber"];
		amlGrabber = new AmlogicWrapper(
			grabberConfig["width"].asUInt(),
			grabberConfig["height"].asUInt(),
			grabberConfig["frequency_Hz"].asUInt(),
			grabberConfig.get("priority",900).asInt(),
			&hyperion);

		if (xbmcVideoChecker != nullptr)
		{
			QObject::connect(xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), amlGrabber, SLOT(setGrabbingMode(GrabbingMode)));
			QObject::connect(xbmcVideoChecker, SIGNAL(videoMode(VideoMode)),       amlGrabber, SLOT(setVideoMode(VideoMode)));
		}

		QObject::connect(amlGrabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );

		amlGrabber->start();
		std::cout << "INFO: AMLOGIC grabber created and started" << std::endl;
	}
}
#endif

#ifdef ENABLE_FB
void startGrabberFramebuffer(const Json::Value &config, Hyperion &hyperion, ProtoServer* &protoServer, XBMCVideoChecker* &xbmcVideoChecker, FramebufferWrapper* &fbGrabber)
{
	// Construct and start the framebuffer grabber if the configuration is present
	if (config.isMember("framebuffergrabber") || config.isMember("framegrabber"))
	{
		const Json::Value & grabberConfig = config.isMember("framebuffergrabber")? config["framebuffergrabber"] : config["framegrabber"];
		fbGrabber = new FramebufferWrapper(
			grabberConfig.get("device", "/dev/fb0").asString(),
			grabberConfig["width"].asUInt(),
			grabberConfig["height"].asUInt(),
			grabberConfig["frequency_Hz"].asUInt(),
			grabberConfig.get("priority",900).asInt(),
			&hyperion);

		if (xbmcVideoChecker != nullptr)
		{
			QObject::connect(xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), fbGrabber, SLOT(setGrabbingMode(GrabbingMode)));
			QObject::connect(xbmcVideoChecker, SIGNAL(videoMode(VideoMode)), fbGrabber, SLOT(setVideoMode(VideoMode)));
		}

		QObject::connect(fbGrabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );

		fbGrabber->start();
		std::cout << "INFO: Framebuffer grabber created and started" << std::endl;
	}
}
#endif

#ifdef ENABLE_OSX
void startGrabberOsx(const Json::Value &config, Hyperion &hyperion, ProtoServer* &protoServer, XBMCVideoChecker* &xbmcVideoChecker, OsxWrapper* &osxGrabber)
{
	// Construct and start the osx grabber if the configuration is present
	if (config.isMember("osxgrabber") || config.isMember("framegrabber"))
	{
		const Json::Value & grabberConfig = config.isMember("osxgrabber")? config["osxgrabber"] : config["framegrabber"];
		osxGrabber = new OsxWrapper(
									grabberConfig.get("display", 0).asUInt(),
									grabberConfig["width"].asUInt(),
									grabberConfig["height"].asUInt(),
									grabberConfig["frequency_Hz"].asUInt(),
									grabberConfig.get("priority",900).asInt(),
									&hyperion );

		if (xbmcVideoChecker != nullptr)
		{
			QObject::connect(xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), osxGrabber, SLOT(setGrabbingMode(GrabbingMode)));
			QObject::connect(xbmcVideoChecker, SIGNAL(videoMode(VideoMode)), osxGrabber, SLOT(setVideoMode(VideoMode)));
		}

		QObject::connect(osxGrabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );

		osxGrabber->start();
		std::cout << "INFO: OSX grabber created and started" << std::endl;
	}
}
#endif

int main(int argc, char** argv)
{
	std::cout
		<< "Hyperion Ambilight Deamon (" << getpid() << ")" << std::endl
		<< "\tVersion   : " << HYPERION_VERSION_ID << std::endl
		<< "\tBuild Time: " << __DATE__ << " " << __TIME__ << std::endl;

	// Initialising QCoreApplication
	QCoreApplication app(argc, argv);

	signal(SIGINT,  signal_handler);
	signal(SIGTERM, signal_handler);
	signal(SIGCHLD, signal_handler);

	// force the locale
	setlocale(LC_ALL, "C");
	QLocale::setDefault(QLocale::c());

	OptionsParser optionParser("Hyperion Daemon");
	ParameterSet & parameters = optionParser.getParameters();

	IntParameter           & argParentPid             = parameters.add<IntParameter>          (0x0, "parent",        "pid of parent hyperiond");
	SwitchParameter<>      & argHelp                  = parameters.add<SwitchParameter<>>     ('h', "help",          "Show this help message and exit");

	argParentPid.setDefault(0);
	optionParser.parse(argc, const_cast<const char **>(argv));
	const std::vector<std::string> configFiles = optionParser.getFiles();

	// check if we need to display the usage. exit if we do.
	if (argHelp.isSet())
	{
		optionParser.usage();
		return 0;
	}

	if (configFiles.size() == 0)
	{
		std::cout << "ERROR: Missing required configuration file. Usage:" << std::endl;
		std::cout << "hyperiond <options ...> [config.file ...]" << std::endl;
		return 1;
	}

	if (argParentPid.getValue() > 0 )
	{
		std::cout << "hyperiond client, parent is pid " << argParentPid.getValue() << std::endl;
		prctl(PR_SET_PDEATHSIG, SIGHUP);
	}

	int argvId = -1;
	for(size_t idx=0; idx < configFiles.size(); idx++) {
		if ( QFile::exists(configFiles[idx].c_str()))
		{
			if (argvId < 0) argvId=idx;
			else startNewHyperion(getpid(), argv[0], configFiles[idx].c_str());
		}
	}

	if ( argvId < 0)
	{
		std::cout << "ERROR: No valid config found " << std::endl;
		return 1;
	}

	const std::string configFile = configFiles[argvId];
	std::cout << "INFO: Selected configuration file: " << configFile.c_str() << std::endl;
	const Json::Value config = loadConfig(configFile);

	Hyperion hyperion(config, configFile);
	std::cout << "INFO: Hyperion started and initialised" << std::endl;

	startBootsequence(config, hyperion);

	XBMCVideoChecker * xbmcVideoChecker = nullptr;
	startXBMCVideoChecker(config, xbmcVideoChecker);

	// ---- network services -----
	JsonServer * jsonServer = nullptr;
	ProtoServer * protoServer = nullptr;
	BoblightServer * boblightServer = nullptr;
	startNetworkServices(config, hyperion, jsonServer, protoServer, boblightServer, xbmcVideoChecker);

#ifdef ENABLE_QT5
	WebConfig webConfig(&hyperion, &app);
#endif

// ---- grabber -----

#ifdef ENABLE_DISPMANX
	DispmanxWrapper * dispmanx = nullptr;
	startGrabberDispmanx(config, hyperion, protoServer, xbmcVideoChecker, dispmanx);
#else
#if !defined(ENABLE_OSX) && !defined(ENABLE_FB)
	if (config.isMember("framegrabber"))
	{
		std::cerr << "ERRROR: The dispmanx framegrabber can not be instantiated, because it has been left out from the build" << std::endl;
	}
#endif
#endif

#ifdef ENABLE_V4L2
	V4L2Wrapper * v4l2Grabber = nullptr;
	startGrabberV4L2(config, hyperion, protoServer, v4l2Grabber);
#else
	if (config.isMember("grabber-v4l2"))
	{
		std::cerr << "ERROR: The v4l2 grabber can not be instantiated, because it has been left out from the build" << std::endl;
	}
#endif

#ifdef ENABLE_AMLOGIC
	// Construct and start the framebuffer grabber if the configuration is present
	AmlogicWrapper * amlGrabber = nullptr;
	startGrabberAmlogic(config, hyperion, protoServer, xbmcVideoChecker, amlGrabber);
#else
	if (config.isMember("amlgrabber"))
	{
		std::cerr << "ERROR: The AMLOGIC grabber can not be instantiated, because it has been left out from the build" << std::endl;
	}
#endif

#ifdef ENABLE_FB
	// Construct and start the framebuffer grabber if the configuration is present
	FramebufferWrapper * fbGrabber = nullptr;
	startGrabberFramebuffer(config, hyperion, protoServer, xbmcVideoChecker, fbGrabber);
#else
	if (config.isMember("framebuffergrabber"))
	{
		std::cerr << "ERROR: The framebuffer grabber can not be instantiated, because it has been left out from the build" << std::endl;
	}
#if !defined(ENABLE_DISPMANX) && !defined(ENABLE_OSX)
	else if (config.isMember("framegrabber"))
	{
		std::cerr << "ERROR: The framebuffer grabber can not be instantiated, because it has been left out from the build" << std::endl;
	}
#endif
#endif

#ifdef ENABLE_OSX
	// Construct and start the osx grabber if the configuration is present
	OsxWrapper * osxGrabber = nullptr;
	startGrabberDispmanx(config, hyperion, protoServer, xbmcVideoChecker, osxGrabber);
#else
	if (config.isMember("osxgrabber"))
	{
		std::cerr << "ERROR: The osx grabber can not be instantiated, because it has been left out from the build" << std::endl;
	}
#if !defined(ENABLE_DISPMANX) && !defined(ENABLE_FB)
	else if (config.isMember("framegrabber"))
	{
		std::cerr << "ERROR: The osx grabber can not be instantiated, because it has been left out from the build" << std::endl;
	}
#endif
#endif

	// run the application
	int rc = app.exec();
	std::cout << "INFO: Application closed with code " << rc << std::endl;

	// Delete all component
#ifdef ENABLE_DISPMANX
	delete dispmanx;
#endif
#ifdef ENABLE_FB
	delete fbGrabber;
#endif
#ifdef ENABLE_OSX
	delete osxGrabber;
#endif
#ifdef ENABLE_V4L2
	delete v4l2Grabber;
#endif
	delete xbmcVideoChecker;
	delete jsonServer;
	delete protoServer;
	delete boblightServer;

	// leave application
	return rc;
}


text:
namespace SDK
{

	template<typename T, T N1, T N2, typename Tag, class Enable = void>
	struct GenericHandle;

	template <typename T, T N1, T N2, typename Tag>
	struct GenericHandle <T, N1, N2, Tag, typename std::enable_if<std::is_integral<T>::value>::type>
	{
		T index : N1;
		T generation : N2;
		//using _HandleType = GenericHandle<T, N1, N2, Tag, std::true_type>;
		inline static GenericHandle InvalidHandle()
		{
			return{ -1, -1 };
		}
	};

	struct InternalHandleTag {};
	using InternalHandle = GenericHandle<int, 12, 20, InternalHandleTag>;

	template <typename T, T N1, T N2, typename Tag>
	bool operator == (const GenericHandle<T, N1, N2, Tag>& left, const GenericHandle<T, N1, N2, Tag>& right)
	{
		return left.index == right.index && left.generation == right.generation;
	}
	template <typename T, T N1, T N2, typename Tag>
	bool operator != (const GenericHandle<T, N1, N2, Tag>& left, const GenericHandle<T, N1, N2, Tag>& right)
	{
		return left.index != right.index || left.generation != right.generation;
	}

	template <typename HandlerType, typename BufferType, size_t size = 4096>
	struct GenericBuffersArray
	{
		enum { Size = size };

		uint m_current_index;
		HandlerType m_handlers[size];
		BufferType m_buffer[size];

		GenericBuffersArray()
			: m_current_index(0)
		{
			for (size_t i = 0; i < size; ++i)
			{
				m_handlers[i].index = i;
				m_handlers[i].generation = 0;
				m_buffer[i] = BufferType();
			}
		}
	};

} // SDK

#endif


text:
<!--
CDDL HEADER START

The contents of this file are subject to the terms of the
Common Development and Distribution License (the "License").
You may not use this file except in compliance with the License.

You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
or http://www.opensolaris.org/os/licensing.
See the License for the specific language governing permissions
and limitations under the License.

When distributing Covered Code, include this CDDL HEADER in each
file and include the License file at usr/src/OPENSOLARIS.LICENSE.
If applicable, add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your own identifying
information: Portions Copyright [yyyy] [name of copyright owner]

CDDL HEADER END

Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-->

<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="system configuration">
    <service name="system/install/config" version="1" type="service">
        <instance name="default" enabled="true">
            <property_group name="user_account" type="application">
                <propval name="login" type="astring" value="jack"/>
                <propval name="password" type="astring" value="9Nd/cwBcNWFZg"/>
                <propval name="description" type="astring" value="default_user"/>
                <propval name="shell" type="astring" value="/usr/bin/bash"/>
                <propval name="uid" type='count' value='101'/>
                <propval name="gid" type='count' value='10'/>
                <propval name="type" type="astring" value="normal"/>
                <propval name="roles" type="astring" value="root"/>
            </property_group>

            <property_group name="root_account" type="application">
                <propval name="password" type="astring" value="$5$VgppCOxA$ycFmYW4ObRRHhtsGEygDdexk5bugqgSiaSR9niNCouC"/>
                <propval name="type" type="astring" value="role"/>
            </property_group>

            <property_group name="other_sc_params" type="application">
                <propval name="timezone" type="astring" value="GMT"/>
                <propval name="hostname" type="astring" value="solaris"/>
            </property_group>
        </instance>
    </service>

    <service name="system/console-login" version="1" type="service">
        <property_group name="ttymon" type="application">
            <propval name="terminal_type" type="astring" value="sun"/>
        </property_group>
    </service>

    <service name='system/keymap' version='1' type='service'>
        <instance name='default' enabled='true'>
            <property_group name='keymap' type='system'>
                <propval name='layout' type='astring' value='US-English'/>
            </property_group>
        </instance>
    </service>

    <service name="network/physical" version="1" type="service">
        <instance name="nwam" enabled="false"/>
        <instance name="default" enabled="true"/>
    </service>

    <service name='network/install' version='1' type='service'>
        <instance name='default' enabled='true'>
            <property_group name='install_ipv4_interface' type='application'>
                <propval name='name' type='astring' value='net0/v4'/>
                <propval name='address_type' type='astring' value='static'/>
                <propval name='static_address' type='net_address_v4' value='x.x.x.x/n'/>
                <propval name='default_route' type='net_address_v4' value='x.x.x.x'/>
            </property_group>

            <property_group name='install_ipv6_interface' type='application'>
                <propval name='name' type='astring' value='net0/v6'/>
                <propval name='address_type' type='astring' value='addrconf'/>
                <propval name='stateless' type='astring' value='yes'/>
                <propval name='stateful' type='astring' value='yes'/>
            </property_group>
        </instance>
    </service>

    <service name='network/dns/install' version='1' type='service'>
        <instance name='default' enabled='true'>
            <property_group name='install_props' type='application'>
                <property name='nameserver' type='net_address'>
                    <net_address_list>
                        <value_node value='x.x.x.x'/>
                    </net_address_list>
                </property>
                <property name='search' type='astring'>
                    <astring_list>
                        <value_node value='example.com'/>
                    </astring_list>
                </property>
            </property_group>
        </instance>
    </service>
</service_bundle>


text:
Starts an Amazon EBS-backed AMI that was previously stopped.
## Script Data
---

| **Name** | **Description** |
| --- | --- |
| Script Type | python |
| Tags | Amazon Web Services |

## Dependencies
---
This script uses the following commands and scripts.
* start-instance

## Inputs
---

| **Argument Name** | **Description** |
| --- | --- |
| instanceId | The instance ID. |

## Outputs
---
There are no outputs for this script.


text:
from setuptools import setup, find_packages

setup(
    name='secundus',
    version='0.1.dev0',
    description="Another ecs for Python, one day it'll be special",
    author="Martijn Faassen, Paul Everitt",
    author_email="faassen@startifact.com",
    license="BSD",
    packages=find_packages(),
    include_package_data=True,
    zip_safe=False,
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Topic :: Software Development :: Libraries :: Application Frameworks',
        'Programming Language :: Python :: 3.5',
    ],
    install_requires=[
        'setuptools',
        'pyglet',
        'dectate',
        'pandas',
    ],
    extras_require=dict(
        test=[
            'pytest >= 2.5.2',
            'py >= 1.4.20',
            'pytest-cov',
            'pytest-remove-stale-bytecode',
        ],
    ),
)


text:
<topicMap xmlns="http://www.topicmaps.org/cxtm/1.0/">
<topic id="id1">
</topic>
<topic id="id2">
<subjectIdentity>
<subjectIndicatorRef href="http://psi.example.org/technology/syntax"></subjectIndicatorRef>
</subjectIdentity>
</topic>
<topic id="id3">
<instanceOf href="#id2"></instanceOf>
<subjectIdentity>
<subjectIndicatorRef href="http://psi.example.org/technology/tmxml"></subjectIndicatorRef>
</subjectIdentity>
<baseName>
<baseNameString>TM/XML</baseNameString>
</baseName>
<occurrence>
<instanceOf href="#id1"></instanceOf>
<resourceData>A nice, compact TM syntax.</resourceData>
</occurrence>
</topic>
</topicMap>


text:
export default {
  name: 'time-tracking-spent-only-pane',
  props: {
    timeSpentHumanReadable: {
      type: String,
      required: true,
    },
  },
  template: `

      Spent:
      {{ timeSpentHumanReadable }}

  `,
};


text:
var ret = require('./dispose.share')
var fireDisposeHook = ret.fireDisposeHook
var fireDisposeHooks = ret.fireDisposeHooks
var fireDisposeHookDelay = ret.fireDisposeHookDelay

//用于IE8+, firefox
function byRewritePrototype() {
    if (byRewritePrototype.execute) {
        return
    }
//https://www.web-tinker.com/article/20618.html?utm_source=tuicool&utm_medium=referral
//IE6-8虽然暴露了Element.prototype,但无法重写已有的DOM API
    byRewritePrototype.execute = true
    var p = Node.prototype
    function rewite(name, fn) {
        var cb = p[name]
        p[name] = function (a, b) {
            return  fn.call(this, cb, a, b)
        }
    }
    rewite('removeChild', function (fn, a, b) {
        fn.call(this, a, b)
        if (a.nodeType === 1) {
            fireDisposeHookDelay(a)
        }
        return a
    })

    rewite('replaceChild', function (fn, a, b) {
        fn.call(this, a, b)
        if (a.nodeType === 1) {
            fireDisposeHookDelay(a)
        }
        return a
    })
    //访问器属性需要用getOwnPropertyDescriptor处理
    var ep = Element.prototype
    function newSetter(html) {
        var all = avalon.slice(this.getElementsByTagName('*'))
        oldSetter.call(this, html)
        fireDisposeHooks(all)
    }
    var obj = Object.getOwnPropertyDescriptor(ep, 'innerHTML')
    var oldSetter = obj.set
    obj.set = newSetter
    try {
        Object.defineProperty(ep, 'innerHTML', obj)
    } catch (e) {
        //safari 9.1.2使用Object.defineProperty重写innerHTML会抛
        // Attempting to change the setter of an unconfigurable property.
        if (ep._lookupSetter__) {
            oldSetter = ep.__lookupSetter__('innerHTML')
            ep.__defineSetter__('innerHTML', newSetter)
        }
    }

    rewite('appendChild', function (fn, a) {
        fn.call(this, a)
        if (a.nodeType === 1 && this.nodeType === 11) {
            fireDisposeHookDelay(a)
        }
        return a
    })

    rewite('insertBefore', function (fn, a, b) {
        fn.call(this, a, b)
        if (a.nodeType === 1 && this.nodeType === 11) {
            fireDisposeHookDelay(a)
        }
        return a
    })
}

module.exports = function onComponentDispose(dom) {
    byRewritePrototype(dom)
}


text:
/**
 *     This code was auto-generated by a Codezu.
 *
 *     Changes to this file may cause incorrect behavior and will be lost if
 *     the code is regenerated.
 */
package com.mozu.api.resources.platform;

import com.mozu.api.ApiContext;
import java.util.List;
import java.util.ArrayList;
import com.mozu.api.MozuClient;
import com.mozu.api.MozuClientFactory;
import com.mozu.api.MozuUrl;
import com.mozu.api.Headers;
import com.mozu.api.AsyncCallback;
import com.mozu.api.security.AuthTicket;
import org.apache.commons.lang.StringUtils;
import java.util.concurrent.CountDownLatch;

/**
 * platform/extensions related resources. DOCUMENT_HERE
 *
 */
public class TenantExtensionsResource {
	///
	/// <see cref="Mozu.Api.ApiContext"/>
	///
	private ApiContext _apiContext;

	public TenantExtensionsResource(ApiContext apiContext)
	{
		_apiContext = apiContext;
	}

	/**
	 * platform-extensions Get GetExtensions description DOCUMENT_HERE
	 *

	 *	TenantExtensions tenantextensions = new TenantExtensions();
	 *	TenantExtensions tenantExtensions = tenantextensions.getExtensions();
	 *

	 * @return com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 */
	public com.mozu.api.contracts.installedapplications.TenantExtensions getExtensions() throws Exception
	{
		return getExtensions( null);
	}

	/**
	 * platform-extensions Get GetExtensions description DOCUMENT_HERE
	 *

	 *	TenantExtensions tenantextensions = new TenantExtensions();
	 *	CountDownLatch latch = tenantextensions.getExtensions( callback );
	 *	latch.await()	 *

	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 */
	public CountDownLatch getExtensionsAsync( AsyncCallback<com.mozu.api.contracts.installedapplications.TenantExtensions> callback) throws Exception
	{
		return getExtensionsAsync( null, callback);
	}

	/**
	 * platform-extensions Get GetExtensions description DOCUMENT_HERE
	 *

	 *	TenantExtensions tenantextensions = new TenantExtensions();
	 *	TenantExtensions tenantExtensions = tenantextensions.getExtensions( responseFields);
	 *

	 * @param responseFields A list or array of fields returned for a call. These fields may be customized and may be used for various types of data calls in Mozu. For example, responseFields are returned for retrieving or updating attributes, carts, and messages in Mozu.
	 * @return com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 */
	public com.mozu.api.contracts.installedapplications.TenantExtensions getExtensions(String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.installedapplications.TenantExtensions> client = com.mozu.api.clients.platform.TenantExtensionsClient.getExtensionsClient( responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * platform-extensions Get GetExtensions description DOCUMENT_HERE
	 *

	 *	TenantExtensions tenantextensions = new TenantExtensions();
	 *	CountDownLatch latch = tenantextensions.getExtensions( responseFields, callback );
	 *	latch.await()	 *

	 * @param responseFields A list or array of fields returned for a call. These fields may be customized and may be used for various types of data calls in Mozu. For example, responseFields are returned for retrieving or updating attributes, carts, and messages in Mozu.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 */
	public CountDownLatch getExtensionsAsync(String responseFields, AsyncCallback<com.mozu.api.contracts.installedapplications.TenantExtensions> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.installedapplications.TenantExtensions> client = com.mozu.api.clients.platform.TenantExtensionsClient.getExtensionsClient( responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 * platform-extensions Put UpdateExtensions description DOCUMENT_HERE
	 *

	 *	TenantExtensions tenantextensions = new TenantExtensions();
	 *	TenantExtensions tenantExtensions = tenantextensions.updateExtensions( extensions);
	 *

	 * @param extensions Mozu.InstalledApplications.Contracts.TenantExtensions ApiType DOCUMENT_HERE
	 * @return com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 */
	public com.mozu.api.contracts.installedapplications.TenantExtensions updateExtensions(com.mozu.api.contracts.installedapplications.TenantExtensions extensions) throws Exception
	{
		return updateExtensions( extensions,  null);
	}

	/**
	 * platform-extensions Put UpdateExtensions description DOCUMENT_HERE
	 *

	 *	TenantExtensions tenantextensions = new TenantExtensions();
	 *	CountDownLatch latch = tenantextensions.updateExtensions( extensions, callback );
	 *	latch.await()	 *

	 * @param  callback callback handler for asynchronous operations
	 * @param extensions Mozu.InstalledApplications.Contracts.TenantExtensions ApiType DOCUMENT_HERE
	 * @return com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 */
	public CountDownLatch updateExtensionsAsync(com.mozu.api.contracts.installedapplications.TenantExtensions extensions, AsyncCallback<com.mozu.api.contracts.installedapplications.TenantExtensions> callback) throws Exception
	{
		return updateExtensionsAsync( extensions,  null, callback);
	}

	/**
	 * platform-extensions Put UpdateExtensions description DOCUMENT_HERE
	 *

	 *	TenantExtensions tenantextensions = new TenantExtensions();
	 *	TenantExtensions tenantExtensions = tenantextensions.updateExtensions( extensions,  responseFields);
	 *

	 * @param responseFields A list or array of fields returned for a call. These fields may be customized and may be used for various types of data calls in Mozu. For example, responseFields are returned for retrieving or updating attributes, carts, and messages in Mozu.
	 * @param extensions Mozu.InstalledApplications.Contracts.TenantExtensions ApiType DOCUMENT_HERE
	 * @return com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 */
	public com.mozu.api.contracts.installedapplications.TenantExtensions updateExtensions(com.mozu.api.contracts.installedapplications.TenantExtensions extensions, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.installedapplications.TenantExtensions> client = com.mozu.api.clients.platform.TenantExtensionsClient.updateExtensionsClient( extensions,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 * platform-extensions Put UpdateExtensions description DOCUMENT_HERE
	 *

	 *	TenantExtensions tenantextensions = new TenantExtensions();
	 *	CountDownLatch latch = tenantextensions.updateExtensions( extensions,  responseFields, callback );
	 *	latch.await()	 *

	 * @param responseFields A list or array of fields returned for a call. These fields may be customized and may be used for various types of data calls in Mozu. For example, responseFields are returned for retrieving or updating attributes, carts, and messages in Mozu.
	 * @param  callback callback handler for asynchronous operations
	 * @param extensions Mozu.InstalledApplications.Contracts.TenantExtensions ApiType DOCUMENT_HERE
	 * @return com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 * @see com.mozu.api.contracts.installedapplications.TenantExtensions
	 */
	public CountDownLatch updateExtensionsAsync(com.mozu.api.contracts.installedapplications.TenantExtensions extensions, String responseFields, AsyncCallback<com.mozu.api.contracts.installedapplications.TenantExtensions> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.installedapplications.TenantExtensions> client = com.mozu.api.clients.platform.TenantExtensionsClient.updateExtensionsClient( extensions,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: Terminator Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

My Project

Public Member Functions |
List of all members

Terminator Class Reference

#include <Terminator.h>

Collaboration diagram for Terminator:

<map name="Terminator_coll__map" id="Terminator_coll__map">
</map>

Public Member Functions

 	Terminator ()

 	Terminator (const unsigned long TimeSpent_, const unsigned long PathsDone_)

unsigned long 	getTimeSpent ()

unsigned long 	getPathsDone ()

Constructor & Destructor Documentation

§ Terminator() [1/2]

          Terminator::Terminator
          (
          	)

§ Terminator() [2/2]

          Terminator::Terminator
          (
          const unsigned long
          TimeSpent_,

          const unsigned long
          PathsDone_

          )

Member Function Documentation

§ getPathsDone()

          unsigned long Terminator::getPathsDone
          (
          	)

§ getTimeSpent()

          unsigned long Terminator::getTimeSpent
          (
          	)

The documentation for this class was generated from the following file:

Terminator.h

<address class="footer">
Generated by

 1.8.12
</address>


text:
using System;
using System.Reflection;

namespace Python.Runtime
{
    /// <summary>
    /// Module level properties (attributes)
    /// </summary>
    internal class ModulePropertyObject : ExtensionType
    {
        public ModulePropertyObject(PropertyInfo md)
        {
            throw new NotImplementedException("ModulePropertyObject");
        }
    }
}