text:
<?php

/**
 * Created by PhpStorm.
 * User: Angelo
 * Date: 03/01/2017
 * Time: 18:29
 */
include_once(__DIR__ .  '/../../model/MacroCategoria.php');

class MacroCategoriaTest extends PHPUnit_Framework_TestCase
{
    protected $macro;

    public function setUp()
    {
        $this->macro = new MacroCategoria(1,"Informatica");
    }

    public function testGetId(){
        self::assertEquals(1,$this->macro->getId());
    }

    public function testGetName(){
        self::assertEquals("Informatica",$this->macro->getNome());
    }

    public function testSetName(){
        $this->macro->setNome("Legge");
        self::assertEquals("Legge",$this->macro->getNome());
    }
}


text:
from collections import OrderedDict
from typing import Dict, Type

from .base import SubscriberTransport
from .grpc import SubscriberGrpcTransport
from .grpc_asyncio import SubscriberGrpcAsyncIOTransport

# Compile a registry of transports.
_transport_registry = OrderedDict()  # type: Dict[str, Type[SubscriberTransport]]
_transport_registry["grpc"] = SubscriberGrpcTransport
_transport_registry["grpc_asyncio"] = SubscriberGrpcAsyncIOTransport

__all__ = (
    "SubscriberTransport",
    "SubscriberGrpcTransport",
    "SubscriberGrpcAsyncIOTransport",
)

redpajama_set_name: RedPajamaGithub


text:
CREATE TABLE [Purchasing].[SupplierCategories] (
    [SupplierCategoryID]   INT                                         CONSTRAINT [DF_Purchasing_SupplierCategories_SupplierCategoryID] DEFAULT (NEXT VALUE FOR [Sequences].[SupplierCategoryID]) NOT NULL,
    [SupplierCategoryName] NVARCHAR (50)                               NOT NULL,
    [LastEditedBy]         INT                                         NOT NULL,
    [ValidFrom]            DATETIME2 (7) GENERATED ALWAYS AS ROW START NOT NULL,
    [ValidTo]              DATETIME2 (7) GENERATED ALWAYS AS ROW END   NOT NULL,
    CONSTRAINT [PK_Purchasing_SupplierCategories] PRIMARY KEY CLUSTERED ([SupplierCategoryID] ASC),
    CONSTRAINT [FK_Purchasing_SupplierCategories_Application_People] FOREIGN KEY ([LastEditedBy]) REFERENCES [Application].[People] ([PersonID]),
    CONSTRAINT [UQ_Purchasing_SupplierCategories_SupplierCategoryName] UNIQUE NONCLUSTERED ([SupplierCategoryName] ASC),
    PERIOD FOR SYSTEM_TIME ([ValidFrom], [ValidTo])
)
WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE=[Purchasing].[SupplierCategories_Archive], DATA_CONSISTENCY_CHECK=ON));

GO
EXECUTE sp_addextendedproperty @name = N'Description', @value = 'Full name of the category that suppliers can be assigned to', @level0type = N'SCHEMA', @level0name = N'Purchasing', @level1type = N'TABLE', @level1name = N'SupplierCategories', @level2type = N'COLUMN', @level2name = N'SupplierCategoryName';

GO
EXECUTE sp_addextendedproperty @name = N'Description', @value = 'Numeric ID used for reference to a supplier category within the database', @level0type = N'SCHEMA', @level0name = N'Purchasing', @level1type = N'TABLE', @level1name = N'SupplierCategories', @level2type = N'COLUMN', @level2name = N'SupplierCategoryID';

GO
EXECUTE sp_addextendedproperty @name = N'Description', @value = N'Categories for suppliers (ie novelties, toys, clothing, packaging, etc.)', @level0type = N'SCHEMA', @level0name = N'Purchasing', @level1type = N'TABLE', @level1name = N'SupplierCategories';


text:
package org.dbpedia.lookup.lucene

import java.io.File
import org.apache.lucene.store.FSDirectory
import org.apache.lucene.search._
import org.apache.lucene.index.{Term, IndexReader}
import org.dbpedia.extraction.util.WikiUtil
import org.dbpedia.lookup.entities._
import org.apache.lucene.queryParser.QueryParser
import com.typesafe.config.ConfigFactory

/**
 * Created by IntelliJ IDEA.
 * User: Max Jakob
 * Date: 14.01.11
 * Time: 14:43
 * Class to query the Lucene index for the best URI given a surface form.
  *
  *
  * NOTICE: this file has been changed by Paolo Albano, Politecnico di Bari
 */

class Searcher(val indexDir: File) {

    private val indexReader = IndexReader.open(FSDirectory.open(indexDir))
    private val indexSearcher = new IndexSearcher(indexReader)
    private val sort = new Sort(new SortField(LuceneConfig.Fields.REFCOUNT, SortField.INT, true))
    private val queryParser = new QueryParser(LuceneConfig.version, LuceneConfig.Fields.SURFACE_FORM_KEYWORD, LuceneConfig.analyzer)
    private val conf = ConfigFactory.load("configuration.conf")

    def keywordSearch(keyword: String, ontologyClass: String="", maxResults: Int=5): List[Result] = {
        if(keyword == null || keyword.isEmpty) {
            return List.empty
        }
        val query = getQuery(keyword, ontologyClass, prefixQuery = false)
        search(query, maxResults)
    }

    def prefixSearch(keyword: String, ontologyClass: String="", maxResults: Int=5): List[Result] = {
        if(keyword == null || keyword.isEmpty) {
            return List.empty
        }
        val query = getQuery(keyword, ontologyClass, prefixQuery = true)
        search(query, maxResults)
    }

    def close() {
        indexSearcher.close()
        indexReader.close()
    }

    private def search(query: Query, maxResults: Int): List[Result] = {
        indexSearcher.search(query, null, maxResults, sort).scoreDocs.toList.map(getResult)
    }

    private def getQuery(keyword: String, ontologyClass: String, prefixQuery: Boolean = false): Query = {
        val bq = new BooleanQuery

        val decodedKeyword = WikiUtil.wikiDecode(keyword)

        if(prefixQuery) {
            val pseudoAnalyzedKeyword = LuceneConfig.PrefixSearchPseudoAnalyzer.analyze(decodedKeyword)
            val prefixQuery = new PrefixQuery(new Term(LuceneConfig.Fields.SURFACE_FORM_PREFIX, pseudoAnalyzedKeyword))
            bq.add(prefixQuery, BooleanClause.Occur.MUST)
        }
        else {
            val escapedKeyword = QueryParser.escape(decodedKeyword)
            val phraseQuery = synchronized { // query parser is not thread safe!
              queryParser.parse('"' + escapedKeyword + '"')  //quotes keep word order
            }
            bq.add(phraseQuery, BooleanClause.Occur.MUST)
        }

        getOntologyClassQuery(ontologyClass) match {
            case Some(q: Query) => bq.add(q, BooleanClause.Occur.MUST)
            case _ =>
        }

        bq
    }

    private def getOntologyClassQuery(ontologyClass: String): Option[Query] = {
        if(ontologyClass == null || ontologyClass.trim == "") {
            None
        }
        else if(ontologyClass.toLowerCase == "thing" || ontologyClass.toLowerCase.endsWith("#thing")) {
            None
        }
        else {
//            val ontologyPrefix = "http://dbpedia.org/ontology/"
            val ontologyPrefix = conf.getString("lookup.ontologyPrefix")
            //is full class URI
            if(ontologyClass startsWith ontologyPrefix) {
                Some(new TermQuery(new Term(LuceneConfig.Fields.CLASS, ontologyClass.trim)))
            }
            //abbreviated namespace prefix
            else if(ontologyClass.startsWith("dbpedia:") || ontologyClass.startsWith("dbpedia-owl:") || ontologyClass.startsWith(conf.getString("lookup.ontologyAbbreviation"))) {
                val c = ontologyClass.trim.replace("dbpedia:", "").replace("dbpedia-owl:", "").replace(conf.getString("lookup.ontologyAbbreviation"), "")
                Some(new TermQuery(new Term(LuceneConfig.Fields.CLASS, ontologyPrefix+c)))
            }
            //label given: make camel case and attach namespace
            else {
                val camel = ontologyClass.trim.split(" ").map(_.capitalize).mkString("")
                Some(new TermQuery(new Term(LuceneConfig.Fields.CLASS, ontologyPrefix+camel)))
            }
        }
    }

    private def getResult(scoreDoc: ScoreDoc): Result = {
        val doc = indexReader.document(scoreDoc.doc)

        val uri: String = doc.get(LuceneConfig.Fields.URI)
        val description: String = doc.get(LuceneConfig.Fields.DESCRIPTION)
        val ontologyClasses: Set[OntologyClass] = doc.getValues(LuceneConfig.Fields.CLASS) match {
            case null => Set.empty
            case classes => classes.map(uri => new OntologyClass(uri)).toSet
        }
        val categories: Set[Category] = doc.getValues(LuceneConfig.Fields.CATEGORY) match {
            case null => Set.empty
            case cats => cats.map(uri => new Category(uri)).toSet
        }
        val templates: Set[Template] = doc.getValues(LuceneConfig.Fields.TEMPLATE) match {
            case null => Set.empty
            case temps => temps.map(uri => new Template(uri)).toSet
        }
        val redirects: Set[Redirect] = doc.getValues(LuceneConfig.Fields.REDIRECT) match {
            case null => Set.empty
            case reds => reds.map(uri => new Redirect(uri)).toSet
        }
        val refCount: Int = doc.get(LuceneConfig.Fields.REFCOUNT) match {
            case null => 0
            case count: String => count.toInt
        }

        new Result(uri, description, ontologyClasses, categories, templates, redirects, refCount)
    }

}


text:
<?php
class Controller_Admin_Setting_Index extends ypAdminController {
	public function Index() {
		$this->checkLogin();

		$this->redirect($this->Link->build('Admin/Setting/Site'));

		$this->setTemplate('module/Setting/Index.php');
		$this->setTemplateChild(array(
			'Admin/System/Header',
			'Admin/System/Footer'
		));
		$this->Document->setTitle("All Setting");
		$this->Response->setOutput($this->render());
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _08.Calories_Counter
{
    class Program
    {
        static void Main(string[] args)
        {
            int numOfIngreeds = int.Parse(Console.ReadLine());
            int calories;
            int calSum = 0;

            for (int i = 0; i < numOfIngreeds; i++)
            {
                string input = Console.ReadLine().ToLower();
                switch (input)
                {
                    case "cheese":
                        calories = 500;
                        calSum += calories;
                        break;
                    case "tomato sauce":
                        calories = 150;
                        calSum += calories;

                        break;
                    case "salami":
                        calories = 600;
                        calSum += calories;

                        break;
                    case "pepper":

                        calories = 50;
                        calSum += calories;
                        break;
                }
            }

            Console.WriteLine($"Total calories: {calSum}");
        }
    }
}


text:
franky
======

We'll se what is going to happen...thus far this will be a backend for HTML5 templates


text:
//sample.h:

#ifndef _ROARAUDIO_SAMPLE_H_
#define _ROARAUDIO_SAMPLE_H_

// we do not need any roar_audio_info struct because it IS in servers native format
struct roar_sample {
 char                 name[ROAR_BUFFER_NAME];
 struct roar_buffer * data;
};

#endif

//ll


text:
#ifndef _QEDE_ETH_IF_H
#define _QEDE_ETH_IF_H

#include "qede_if.h"

/*forward decl */
struct eth_slow_path_rx_cqe;

#define INIT_STRUCT_FIELD(field, value) .field = value

#define QED_ETH_INTERFACE_VERSION       609

#define QEDE_MAX_MCAST_FILTERS		64

enum qed_filter_rx_mode_type {
	QED_FILTER_RX_MODE_TYPE_REGULAR,
	QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC,
	QED_FILTER_RX_MODE_TYPE_PROMISC,
};

enum qed_filter_type {
	QED_FILTER_TYPE_UCAST,
	QED_FILTER_TYPE_MCAST,
	QED_FILTER_TYPE_RX_MODE,
	QED_MAX_FILTER_TYPES,
};

struct qed_dev_eth_info {
	struct qed_dev_info common;

	uint8_t num_queues;
	uint8_t num_tc;

	struct ether_addr port_mac;
	uint16_t num_vlan_filters;
	uint32_t num_mac_addrs;

	/* Legacy VF - this affects the datapath */
	bool is_legacy;
};

struct qed_stop_rxq_params {
	uint8_t rss_id;
	uint8_t rx_queue_id;
	uint8_t vport_id;
	bool eq_completion_only;
};

struct qed_update_vport_params {
	uint8_t vport_id;
	uint8_t update_vport_active_flg;
	uint8_t vport_active_flg;
	uint8_t update_inner_vlan_removal_flg;
	uint8_t inner_vlan_removal_flg;
	uint8_t update_tx_switching_flg;
	uint8_t tx_switching_flg;
	uint8_t update_accept_any_vlan_flg;
	uint8_t accept_any_vlan;
	uint8_t update_rss_flg;
	uint16_t mtu;
};

struct qed_start_vport_params {
	bool remove_inner_vlan;
	bool handle_ptp_pkts;
	bool gro_enable;
	bool drop_ttl0;
	uint8_t vport_id;
	uint16_t mtu;
	bool clear_stats;
};

struct qed_stop_txq_params {
	uint8_t rss_id;
	uint8_t tx_queue_id;
};

struct qed_eth_ops {
	const struct qed_common_ops *common;

	int (*fill_dev_info)(struct ecore_dev *edev,
			     struct qed_dev_eth_info *info);

	int (*vport_start)(struct ecore_dev *edev,
			   struct qed_start_vport_params *params);

	int (*vport_stop)(struct ecore_dev *edev, uint8_t vport_id);

	int (*vport_update)(struct ecore_dev *edev,
			    struct qed_update_vport_params *params);

	int (*q_rx_start)(struct ecore_dev *cdev,
			  uint8_t rss_num,
			  struct ecore_queue_start_common_params *p_params,
			  uint16_t bd_max_bytes,
			  dma_addr_t bd_chain_phys_addr,
			  dma_addr_t cqe_pbl_addr,
			  uint16_t cqe_pbl_size, void OSAL_IOMEM * *pp_prod);

	int (*q_rx_stop)(struct ecore_dev *edev,
			 struct qed_stop_rxq_params *params);

	int (*q_tx_start)(struct ecore_dev *edev,
			  uint8_t rss_num,
			  struct ecore_queue_start_common_params *p_params,
			  dma_addr_t pbl_addr,
			  uint16_t pbl_size, void OSAL_IOMEM * *pp_doorbell);

	int (*q_tx_stop)(struct ecore_dev *edev,
			 struct qed_stop_txq_params *params);

	int (*eth_cqe_completion)(struct ecore_dev *edev,
				  uint8_t rss_id,
				  struct eth_slow_path_rx_cqe *cqe);

	int (*fastpath_stop)(struct ecore_dev *edev);

	void (*fastpath_start)(struct ecore_dev *edev);

	void (*get_vport_stats)(struct ecore_dev *edev,
				struct ecore_eth_stats *stats);
};

/* externs */

extern const struct qed_common_ops qed_common_ops_pass;

const struct qed_eth_ops *qed_get_eth_ops(void);

int qed_configure_filter_rx_mode(struct rte_eth_dev *eth_dev,
				 enum qed_filter_rx_mode_type type);

bool qed_update_rss_parm_cmt(struct ecore_dev *edev, uint16_t *p_tbl);

#endif /* _QEDE_ETH_IF_H */


text:
extern char exit_now;

// Start of the main program
int main(int argc, char *argv[]) {
    // Local variables in main() routine

    // Input buffer (the input stream will be stored in this variable)
    char input_buffer[MAX_MSG_LENGTH];
    // Argument Counter for the input commands
    int  input_argc;
    // Argument Values for the input commands
    char *input_argv[MAX_ARGV_LENGTH];
    // General purpose integer counter
    int i;
    // Availability of a command (treated as boolean)
    char command_available = 0;

    printf(
        "\n"
        "UniversalShellBuilder - Example for GNU/Linux v0.2\n"
        "\n"
        "Copyright (c) 2017 Cristian G Guerrero\n"
        "\n"
        "\n"
        "Type 'help' to get a list of the available commands.\n"
    );

    if (argc > 1) {
        // If the program is executed with arguments,
        // execute the provided command
        printf("> ");
        for (i=1; i<argc; i++) {
            printf("%s ", argv[i]);
        }
        execute_command(argc-1, &argv[1]);
    } else {
        while (TRUE) {
            // Terminal prompt
            printf("\n> ");

            // Terminal input
            // (read a line from the standard input into `input_buffer`.
            // the maximum length of the string will be MAX_MSG_LENGTH-3)
            fgets(input_buffer, MAX_MSG_LENGTH-3, stdin);

            // Analyse the input_buffer and detect EOL
            // (end of line = end of the command)
            for (i=0; input_buffer[i]; i++) {
                if (input_buffer[i] == '\n' || input_buffer[i] == '\r') {
                    input_buffer[i] = 0;

                    // Signal the availability of a command
                    command_available = 1;
                }
            }

            if (command_available) {
                // Get the command and the arguments in a list
                input_argc = separate_args(input_buffer, input_argv);

                // Execute the command
                if (input_argc) execute_command(input_argc, input_argv);

                command_available = 0;

                // Detect exit signal
                if (exit_now) return 0;
            }
        }
    }

    return 0;
}


text:
typedef NS_ENUM(NSUInteger,TangramFlowLayoutBgImageScaleType)
{
    TangramFlowLayoutBgImageScaleTypeFitXY = 0,
    TangramFlowLayoutBgImageScaleTypeFitStart
};
@interface TangramFlowLayout : UIView<TangramLayoutProtocol>

// Models Array , as protocol request.
@property   (nonatomic, strong) NSArray         *itemModels;
// Number of columns.The default value is 1.
@property   (nonatomic, assign) NSUInteger      numberOfColumns;
// Percentage number of every cols
@property   (nonatomic, strong) NSArray         *cols;
// Aspect ratio of every row
@property   (nonatomic, strong) NSString        *aspectRatio;
// Margin , the sequence of top, right, bottom, left, the class type in array can be NSNumber or NSString
@property   (nonatomic, strong) NSArray         *margin;
// Padding ,  the sequence of top, right, bottom, left, the class type in array can be NSNumber or NSString
@property   (nonatomic, strong) NSArray         *padding;
// Gap in horizontal direction
@property   (nonatomic, assign) CGFloat          hGap;
// Gap in vertical direction
@property   (nonatomic, assign) CGFloat          vGap;
// Only for first row,if `autoFill` is true,flowlayout will change the number of columns to fill a row,
// when the count of `itemModels` less than the number of columns
@property   (nonatomic, assign) BOOL             autoFill;
// id
@property   (nonatomic, strong) NSString        *layoutLoadAPI;
// Background Image View
@property   (nonatomic, strong) UIImageView     *bgImageView;
// Background ImageUrl
@property   (nonatomic, strong) NSString        *bgImgURL;
// TangramBus
@property   (nonatomic, weak)   TangramBus      *tangramBus;

@property   (nonatomic, weak)   TangramView     *tangramView;
// Background ImageView scale.
@property   (nonatomic, assign) TangramFlowLayoutBgImageScaleType bgScaleType;
// Params for LoadAPI
@property   (nonatomic, strong) NSDictionary          *loadParams;

@property   (nonatomic, assign) TangramLayoutLoadType loadType;

@property   (nonatomic, strong) NSDictionary    *subLayoutDict;

@property   (nonatomic, strong) NSArray         *subLayoutIdentifiers;

@end


text:
package org.bouncycastle.asn1.cmc;

import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1GeneralizedTime;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.util.Arrays;

/**
 * <pre>
 * PendInfo ::= SEQUENCE {
 *    pendToken        OCTET STRING,
 *    pendTime         GeneralizedTime
 * }
 * </pre>
 */
public class PendInfo
    extends ASN1Object
{
    private final byte[] pendToken;
    private final ASN1GeneralizedTime pendTime;

    public PendInfo(byte[] pendToken, ASN1GeneralizedTime pendTime)
    {
        this.pendToken = Arrays.clone(pendToken);
        this.pendTime = pendTime;
    }

    private PendInfo(ASN1Sequence seq)
    {
        if (seq.size() != 2)
        {
            throw new IllegalArgumentException("incorrect sequence size");
        }
        this.pendToken = Arrays.clone(ASN1OctetString.getInstance(seq.getObjectAt(0)).getOctets());
        this.pendTime = ASN1GeneralizedTime.getInstance(seq.getObjectAt(1));
    }

    public static PendInfo getInstance(Object o)
    {
        if (o instanceof PendInfo)
        {
            return (PendInfo)o;
        }

        if (o != null)
        {
            return new PendInfo(ASN1Sequence.getInstance(o));
        }

        return null;
    }

    public ASN1Primitive toASN1Primitive()
    {
        ASN1EncodableVector v = new ASN1EncodableVector(2);

        v.add(new DEROctetString(pendToken));
        v.add(pendTime);

        return new DERSequence(v);
    }

    public byte[] getPendToken()
    {
        return Arrays.clone(pendToken);
    }

    public ASN1GeneralizedTime getPendTime()
    {
        return pendTime;
    }
}


text:
<?php

namespace App\Models\Admin;

use Eloquent as Model;

/**
 * Class EstadoEnvio
 * @package App\Models\Admin
 */
class EstadoEnvio extends Model
{

    public $table = 'estados_envios';

    public $fillable = [
        'nombre',
        'slug'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'nombre' => 'string',
        'slug' => 'string'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [

    ];
}


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $searchModel common\models\BfpSettingsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Bfp Settings');
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

        <?= Html::a(Yii::t('app', 'Create Bfp Settings'), ['create'], ['class' => 'btn btn-success']) ?>

<?php Pjax::begin(); ?>    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'page_name',
            'form_time_submite',
            'form_sleep',
            'confirm_page',
            'confirm_sleep',

            ['class' => 'yii\grid\ActionColumn',
                'visibleButtons' => [
                    'view' => false,
                ]
            ],

        ],
    ]); ?>
<?php Pjax::end(); ?>


text:
id: installation-and-setup
title: Installation and Setup
---

## Installation

Install React and Relay using `yarn` or `npm`:

```sh
yarn add react react-dom react-relay
```

## Set up babel-plugin-relay

Relay Modern requires a Babel plugin to convert GraphQL to runtime artifacts:

```sh
yarn add --dev babel-plugin-relay graphql
```

Add `"relay"` to the list of plugins your `.babelrc` file:

```javascript
{
  "plugins": [
    "relay"
  ]
}
```

Please note that the `"relay"` plugin should run before other plugins or
presets to ensure the `graphql` template literals are correctly transformed. See
Babel's [documentation on this topic](https://babeljs.io/docs/plugins/#pluginpreset-ordering).

Alternatively, instead of using `babel-plugin-relay`, you can use Relay with [babel-plugin-macros](https://github.com/kentcdodds/babel-plugin-macros). After installing `babel-plugin-macros` and adding it to your Babel config:

```javascript
const graphql = require('babel-plugin-relay/macro');
```

If you need to configure `babel-plugin-relay` further (e.g. to enable `compat` mode), you can do so by [specifying the options in a number of ways](https://github.com/kentcdodds/babel-plugin-macros/blob/master/other/docs/user.md#config-experimental).

For example:

```
// babel-plugin-macros.config.js
module.exports = {
  // ...
  // Other macros config
  relay: {
    compat: true,
  },
}
```

## Set up relay-compiler

Relay's ahead-of-time compilation requires the [Relay Compiler](./graphql-in-relay.html#relay-compiler), which you can install via `yarn` or `npm`:

```sh
yarn add --dev relay-compiler
```

This installs the bin script `relay-compiler` in your node_modules folder. It's recommended to run this from a `yarn`/`npm` script by adding a script to your `package.json` file:

```js
"scripts": {
  "relay": "relay-compiler --src ./src --schema ./schema.graphql"
}
```

or if you are using jsx:

```js
"scripts": {
  "relay": "relay-compiler --src ./src --schema ./schema.graphql --extensions js jsx"
}
```

Then, after making edits to your application files, just run the `relay` script to generate new compiled artifacts:

```sh
yarn run relay
```

Alternatively, you can pass the `--watch` option to watch for file changes in your source code and automatically re-generate the compiled artifacts (**Note:** Requires [watchman](https://facebook.github.io/watchman) to be installed):

```sh
yarn run relay --watch
```

For more details, check out our [Relay Compiler docs](./graphql-in-relay.html#relay-compiler).

## JavaScript environment requirements

The Relay Modern packages distributed on NPM use the widely-supported ES5
version of JavaScript to support as many browser environments as possible.

However, Relay Modern expects modern JavaScript global types (`Map`, `Set`,
`Promise`, `Object.assign`) to be defined. If you support older browsers and
devices which may not yet provide these natively, consider including a global
polyfill in your bundled application, such as [core-js][] or
[@babel/polyfill](https://babeljs.io/docs/usage/polyfill/).

A polyfilled environment for Relay using [core-js][] to support older browsers
might look like:

```js
require('core-js/es6/map');
require('core-js/es6/set');
require('core-js/es6/promise');
require('core-js/es6/object');

require('./myRelayApplication');
```

[core-js]: https://github.com/zloirock/core-js


text:
require 'spec_helper'

class MyModel
  include ArtirixDataModels::Model::OnlyData

  attribute :id, :name

  attribute :public_title, writer_visibility: :public
  attribute :private_title, reader_visibility: :private

  attribute :remember_me, :and_me, skip: :predicate
  attribute :remember_me2, :and_me2, skip: :presence

end

RSpec.describe MyModel, type: :model do

  subject { described_class.new data }

  let(:data) do
    {
      name:         name,
      remember_me:  remember_me,
      and_me:       and_me,
      remember_me2: remember_me2,
      and_me2:      and_me2,
    }
  end

  let(:name) { 'Paco' }
  let(:remember_me) { 'yeah' }
  let(:and_me) { 'and' }
  let(:remember_me2) { 'other' }
  let(:and_me2) { 'stuff' }

  describe '.attribute' do
    it 'creates public getter' do
      expect(subject).to respond_to :id
      expect(subject).to respond_to :name
    end

    it 'loads info from hash passed in object creation' do
      expect(subject.id).to be_nil
      expect(subject.name).to eq name
    end

    it 'creates private setter' do
      expect(subject.respond_to? :name=).to be_falsey
      expect(subject.respond_to? :name=, true).to be_truthy

      expect(subject.name).to eq name
      subject.send :name=, 123
      expect(subject.name).to eq 123
    end

    it 'creates predicate method' do
      expect(subject).to respond_to :id?
      expect(subject).to respond_to :name?

      expect(subject.id?).to be_falsey
      expect(subject.name?).to be_truthy
    end

    it 'creates private setter' do
      expect(subject.respond_to? :name=).to be_falsey
      expect(subject.respond_to? :name=, true).to be_truthy

      expect(subject.name).to eq name
      subject.send :name=, 123
      expect(subject.name).to eq 123
    end

    context 'with option `writer_visibility: :public`' do
      it 'writer is public' do
        expect(subject.respond_to? :public_title=).to be_truthy
        expect(subject.respond_to? :public_title=, true).to be_truthy

        expect(subject.public_title).to be_nil
        subject.public_title = 411
        expect(subject.public_title).to eq 411
      end
    end

    context 'with option `reader_visibility: :private`' do
      it 'reader is private' do
        expect(subject.respond_to? :private_title).to be_falsey
        expect(subject.respond_to? :private_title, true).to be_truthy

        expect(subject.send :private_title).to be_nil
        subject.send :private_title=, 411
        expect(subject.send :private_title).to eq 411
      end
    end

    context 'with option `skip: :predicate` or `skip: :presence`' do

      it 'does not create predicate method' do
        expect(subject).to respond_to :remember_me
        expect(subject).to respond_to :and_me
        expect(subject).to respond_to :remember_me2
        expect(subject).to respond_to :and_me2

        #not public
        expect(subject.respond_to? :remember_me?).to be_falsey
        expect(subject.respond_to? :and_me?).to be_falsey
        expect(subject.respond_to? :remember_me2?).to be_falsey
        expect(subject.respond_to? :and_me2?).to be_falsey

        #not private either
        expect(subject.respond_to? :remember_me?, true).to be_falsey
        expect(subject.respond_to? :and_me?, true).to be_falsey
        expect(subject.respond_to? :remember_me2?, true).to be_falsey
        expect(subject.respond_to? :and_me2?, true).to be_falsey

        expect(subject.remember_me).to eq remember_me
        expect(subject.and_me).to eq and_me
        expect(subject.remember_me2).to eq remember_me2
        expect(subject.and_me2).to eq and_me2
      end

    end
  end

end

class MyModelFullMode
  include ArtirixDataModels::Model

  mark_full_mode_by_default

  attribute :id, :name
end

RSpec.describe MyModelFullMode, type: :model do

  subject { described_class.new data }

  let(:data) { { id: 1, name: 'some name' } }

  describe '.mark_full_mode_by_default' do
    it 'makes new instances full mode by default' do
      expect(subject.full_mode?).to be_truthy
    end
  end
end


text:
package fr.lteconsulting.hexa.server.rpc;

import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.HashMap;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import fr.lteconsulting.hexa.server.tools.Trace;
import fr.lteconsulting.hexa.shared.rpc.ListInteger;

class ServiceDescription
{
	String name;
	String checksum;
	Object delegate;
	String[] methodShortcuts;

	// cache methods informations
	private final HashMap<String, MethodInfo> methodsCache = new HashMap<String, MethodInfo>();

	private static class MethodInfo
	{
		MethodInfo( Method method )
		{
			this.method = method;
			paramTypes = method.getParameterTypes();
		}

		Method method;

		Class<?>[] paramTypes;
	}

	public ServiceDescription( String name, String checksum, Object delegate, String[] methodShortcuts )
	{
		this.name = name;
		this.checksum = checksum;
		this.delegate = delegate;
		this.methodShortcuts = methodShortcuts;
	}

	private MethodInfo findMethod( String methodName )
	{
		MethodInfo result = methodsCache.get( methodName );
		if( result != null )
			return result;

		Method[] methods = delegate.getClass().getMethods();
		for( int i = 0; i < methods.length; i++ )
		{
			Method method = methods[i];
			if( method.getName().equals( methodName ) )
			{
				MethodInfo methodInfo = new MethodInfo( method );
				methodsCache.put( methodName, methodInfo );
				return methodInfo;
			}
		}

		return null;
	}

	public Object call( String method, JsonArray parameters )
	{
		// Try parsing a numeric encoded value of the called method
		try
		{
			method = methodShortcuts[Integer.parseInt( method )];
		}
		catch( NumberFormatException badFormat )
		{
		}

		Trace.it( "Calling method " + method );

		MethodInfo jmethod = findMethod( method );
		if( jmethod == null )
		{
			throw new RuntimeException( "Called method not found in delegate of class " + delegate.getClass().getName() );
		}

		Trace.it( "Deserialize parameters" );

		// Deserialize the parameters
		Class<?>[] paramTypes = jmethod.paramTypes;
		if( !(parameters == null && paramTypes.length == 0) && parameters.size() != paramTypes.length )
			throw new InvalidParameterException( "parameters.size()!=paramTypes.length" );

		Object[] jparams = new Object[paramTypes.length];

		for( int i = 0; i < paramTypes.length; i++ )
		{
			Trace.it( "Param " + i );

			Class<?> classType = paramTypes[i];
			JsonElement p = parameters.get( i );

			jparams[i] = deserializeParameters( classType, p );
		}

		// Call the delegate
		try
		{
			Trace.it( "Real call..." );
			Object res = jmethod.method.invoke( delegate, jparams );
			Trace.it( "Ok" );
			return res;
		}
		catch( Exception e )
		{
			Trace.it( "Failed with: " + e.getClass().getName() );
			Trace.throwable( e.getCause() );
			throw new RuntimeException( e );
		}
	}

	private Object deserializeParameters( Class<?> classType, JsonElement p )
	{
		if( p == null )
			return null;

		if( classType == String.class )
			return p.getAsString();
		else if( classType == int.class )
			return p.getAsInt();
		else if( classType == Integer.class )
			return new Integer( p.getAsInt() );
		else if( classType == ListInteger.class )
		{
			JsonArray jsonArray = p.getAsJsonArray();
			int size = jsonArray.size();

			ListInteger res = new ListInteger();
			for( int i = 0; i < size; i++ )
				res.add( (Integer) deserializeParameters( Integer.class, jsonArray.get( i ) ) );

			return res;
		}
		else if( classType.isArray() )
		{
			JsonArray jsonArray = p.getAsJsonArray();
			int size = jsonArray.size();

			Class<?> componentClass = classType.getComponentType();

			if( componentClass.isPrimitive() )
			{
				if( componentClass == int.class )
				{
					int[] res = new int[size];
					for( int i = 0; i < size; i++ )
						res[i] = jsonArray.get( i ).getAsInt();
					return res;
				}
				else if( componentClass == String.class )
				{
					String[] res = new String[size];
					for( int i = 0; i < size; i++ )
						res[i] = jsonArray.get( i ).getAsString();
					return res;
				}
			}

			Object res = Array.newInstance( componentClass, size );
			for( int i = 0; i < size; i++ )
				Array.set( res, i, deserializeParameters( componentClass, jsonArray.get( i ) ) );

			return res;
		}
		else if( classType == ArrayList.class )
		{
			throw new RuntimeException( "Deserialization of an ArrayList<?>, please use one of the wrapping types like ListInteger...)" );
		}
		else
		{
			throw new RuntimeException( "Unknown deserialization of parameter for class " + classType.getName() + " json element is " + p.toString() );
		}
	}
}


text:
<!DOCTYPE html>

<title>test3</title>
<link rel="Stylesheet" type="text/css" href="css/dossier.css"/>
<meta charset="UTF-8"/>

Home

test3

A

B

property1

property2

test3

Metadata

owl:versionInfo
Created with TopBraid Composer

test3: http://localhost/dot/test3

Classes

A

http://localhost/dot/test3#A

en Class A

en Test class A

B

http://localhost/dot/test3#B

en Class B

en Test class B

Properties

property1

http://localhost/dot/test3#property1

signature
A → property1 → B

property2

http://localhost/dot/test3#property2

signature
A → property2 → xsd:integer
 data type


text:
import {LightningElement, api} from 'lwc';

export default class UtilProgressBar extends LightningElement {
    @api title;

    @api actualValue;
    @api expectedValue;

    @api formatStyle;
    @api currencyCode;

    get progress() {
        return Math.round(this.actualValue / this.expectedValue * 100);
    }

    get isCurrency() {
        return this.formatStyle === 'currency';
    }

}


text:
package org.ovirt.engine.core.dao;

import java.util.List;

import org.ovirt.engine.core.common.businessentities.Tags;
import org.ovirt.engine.core.common.businessentities.TagsTemplateMap;
import org.ovirt.engine.core.common.businessentities.TagsUserGroupMap;
import org.ovirt.engine.core.common.businessentities.TagsUserMap;
import org.ovirt.engine.core.common.businessentities.TagsVdsMap;
import org.ovirt.engine.core.common.businessentities.TagsVmMap;
import org.ovirt.engine.core.common.businessentities.TagsVmPoolMap;
import org.ovirt.engine.core.compat.Guid;

/**
 * TagDao defines a type for performing CRUD operations on instances of {@link org.ovirt.engine.core.common.businessentities.Tags}.
 *
 *
 */
public interface TagDao extends Dao {

    /**
     * Retrieves the tag with the specified id.
     *
     * @param id
     *            the tag id
     * @return the tag
     */
    Tags get(Guid id);

    /**
     * Retrieves the tag with the specified name.
     *
     * @param name
     *            the tag name
     * @return the tag
     */
    Tags getByName(String name);

    /**
     * Retrieves all tags.
     *
     * @return the list of tags
     */
    List<Tags> getAll();

    /**
     * Retrieves all tags with the given parent id.
     *
     * @param id
     *            the parent id
     * @return the list of tags
     */
    List<Tags> getAllForParent(Guid id);

    /**
     * Retrieves the list of tags for the given user group ids.
     *
     * @param ids
     *            the group ids
     * @return the list of tags
     */
    List<Tags> getAllForUserGroups(String ids);

    /**
     * Retrieves the list of user group tags by the given ids.
     *
     * @param ids
     *            the ids
     * @return the list of tags
     */
    List<Tags> getAllUserGroupTagsWithIds(String ids);

    /**
     * Retrieves the list of tags for the given VDS ids.
     *
     * @param ids
     *            the VDS ids
     * @return the list of tags
     */
    List<Tags> getAllForVds(String ids);

    /**
     * Retrieves the list of VDS tags with the given tag ids.
     *
     * @param ids
     *            the tag ids
     * @return the list of tags
     */
    List<Tags> getAllForVdsWithIds(String ids);

    /**
     * Retrieves the list of tags for the given VM ids.
     *
     * @param ids
     *            the VM ids
     * @return the list of tags
     */
    List<Tags> getAllForVm(String ids);

    /**
     * Retrieves the list of tags for the given Template ids.
     *
     * @param ids
     *            the Template ids
     * @return the list of tags
     */
    List<Tags> getAllForTemplate(String ids);

    /**
     * Retrieves the list of VM tags for the given tag ids.
     *
     * @param ids
     *            the tag ids
     * @return the list of tags
     */
    List<Tags> getAllVmTagsWithIds(String ids);

    /**
     * Retrieves the list of tags for the given VM pool ids.
     *
     * @param ids
     *            the pool ids
     * @return the list of tags
     */
    List<Tags> getAllForVmPools(String ids);

    /**
     * Retrieves the list of tags for a given user ids.
     *
     * @param ids
     *            the user ids
     * @return the list of tags
     */
    List<Tags> getAllForUsers(String ids);

    /**
     * Retrieves the list of user tags for a given tag id.
     *
     * @param ids
     *            the tag ids
     * @return the list of tags
     */
    List<Tags> getAllForUsersWithIds(String ids);

    /**
     * Saves the supplied tag.
     *
     * @param tag
     *            the tag
     */
    void save(Tags tag);

    /**
     * Updates the supplied tag.
     *
     * @param tag
     *            the tag
     */
    void update(Tags tag);

    /**
     * Removes the tag with the specified id.
     *
     * @param id
     */
    void remove(Guid id);

    void attachUserGroupToTag(TagsUserGroupMap map);

    TagsUserGroupMap getTagUserGroupByGroupIdAndByTagId(Guid tagId, Guid groupId);

    void detachUserGroupFromTag(Guid tagId, Guid groupId);

    TagsUserMap getTagUserByTagIdAndByuserId(Guid tagId, Guid userId);

    void attachUserToTag(TagsUserMap tagUserMap);

    void detachUserFromTag(Guid tagId, Guid userId);

    TagsVdsMap getTagVdsByTagIdAndByVdsId(Guid tagId, Guid vdsId);

    void attachVdsToTag(TagsVdsMap tagVdsMap);

    void detachVdsFromTag(Guid tagId, Guid vdsId);

    TagsVmMap getTagVmByTagIdAndByVmId(Guid tagId, Guid vmId);

    void attachVmToTag(TagsVmMap tagVmMap);

    void updateDefaultDisplayForVmTag(TagsVmMap tagsVmMap);

    void detachVmFromTag(Guid tagId, Guid vmId);

    List<TagsVmMap> getTagVmMapByVmIdAndDefaultTag(Guid vmid);

    TagsTemplateMap getTagTemplateByTagIdAndByTemplateId(Guid tagId, Guid templateId);

    void attachTemplateToTag(TagsTemplateMap tagVmMap);

    void detachTemplateFromTag(Guid tagId, Guid vmId);

    List<TagsVmPoolMap> getVmPoolTagsByVmPoolIdAndAdElementId(Guid vmPoolId, Guid adElementId);
}


text:
.class public interface abstract Ljava/io/FileFilter;
.super Ljava/lang/Object;
.source "FileFilter.java"

# virtual methods
.method public abstract accept(Ljava/io/File;)Z
.end method


text:
#pragma config(Sensor, S1,     PSPNXV4,        sensorI2CCustom)
#pragma config(Motor,  motorA,          ARMS,          tmotorNormal, PIDControl, encoder)
#pragma config(Motor,  motorB,          RIGHT,         tmotorNormal, PIDControl, encoder)
#pragma config(Motor,  motorC,          LEFT,          tmotorNormal, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

/*
 * $Id: mindsensors-ps2ctrl-v4-test2.c 123 2012-11-02 16:35:15Z xander $
 */

/**
 * mindsensors-ps2ctrl-v4.h provides an API for the Mindsensors PS2 controller sensor
 * with referee signal receiver.  This program demonstrates how to use that API
 *
 * Changelog:
 * - 0.1: Initial release
 *
 * Credits:
 * - Big thanks to Mindsensors for providing me with the hardware necessary to write and test this.
 *
 * License: You may use this code as you wish, provided you give credit where it's due.
 *
 * THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.54 AND HIGHER.
 * Xander Soldaat (xander_at_botbench.com)
 * 02 August 2012
 * version 0.1
 */

#include "drivers/mindsensors-ps2ctrl-v4.h"

task main ()
{
  ubyte counter = 0;
  ubyte oldCounter = 0;
  ubyte refSignal = 0;
  ubyte oldRefSignal = 0;
  ubyte txType = 0;
  long rawValue = 0;

  nxtDisplayCenteredTextLine(0, "Mindsensors");
  nxtDisplayCenteredBigTextLine(1, "PSP-Nx");
  nxtDisplayCenteredTextLine(3, "Test 2");
  wait1Msec(2000);

  PlaySound(soundBeepBeep);
  while(bSoundActive) EndTimeSlice();

  eraseDisplay();
  while (true)
  {
    // Get the current counter value, wraps at 255
    counter = PSPV4readRefSignalCount(PSPNXV4);

    if (oldCounter != counter)
    {
      // This is the command sent by the remote control, can be:
      // PSPV4_SIGNAL_FAST_REWIND
      // PSPV4_SIGNAL_FAST_FORWARD
      // PSPV4_SIGNAL_PLAY
      // PSPV4_SIGNAL_STOP
      refSignal =  PSPV4readRefSignal(PSPNXV4);

      // Get the transmitted type.  Not very useful in most cases unless
      // you need to know what type of transmitter sent the command
			txType = PSPV4readRefTXType(PSPNXV4);

			// Raw value will also "see" commands from the remote
			// that are not recognised as "play", "stop", "forward" or "rewind".
			// You could use this to control additional aspects of your robot!
			rawValue = PSPV4readRawRefTXValue(PSPNXV4);

      if (oldRefSignal != refSignal)
      {
	      PlaySound(soundShortBlip);
		    switch(refSignal)
		    {
		      case PSPV4_SIGNAL_FAST_REWIND:   nxtDisplayCenteredBigTextLine(3,"REWIND"); break;
		      case PSPV4_SIGNAL_FAST_FORWARD:  nxtDisplayCenteredBigTextLine(3,"FORWARD"); break;
		      case PSPV4_SIGNAL_PLAY:          nxtDisplayCenteredBigTextLine(3,"PLAY"); break;
		      case PSPV4_SIGNAL_STOP:          nxtDisplayCenteredBigTextLine(3,"STOP"); break;
		    }
		  }

		  // Always display the raw value, even if it's not one of the four
		  // referee signals.  Handy if you want to add more commands to your robot!
	    nxtDisplayTextLine(6, "Type:  0x%02X", txType);
	    nxtDisplayTextLine(7, "Raw:  0x%03X", rawValue);

	    // Update the counters and signals
	    oldCounter = counter;
	    oldRefSignal = refSignal;
	  }
    wait1Msec(50);
  }
}

/*
 * $Id: mindsensors-ps2ctrl-v4-test2.c 123 2012-11-02 16:35:15Z xander $
 */


text:
<?php

declare (strict_types=1);
namespace RectorPrefix20210615\Nette\Utils;

/**
 * The exception that is thrown when an image error occurs.
 */
class ImageException extends \Exception
{
}
/**
 * The exception that indicates invalid image file.
 */
class UnknownImageFileException extends \RectorPrefix20210615\Nette\Utils\ImageException
{
}
/**
 * The exception that indicates error of JSON encoding/decoding.
 */
class JsonException extends \Exception
{
}
/**
 * The exception that indicates error of the last Regexp execution.
 */
class RegexpException extends \Exception
{
    public const MESSAGES = [\PREG_INTERNAL_ERROR => 'Internal error', \PREG_BACKTRACK_LIMIT_ERROR => 'Backtrack limit was exhausted', \PREG_RECURSION_LIMIT_ERROR => 'Recursion limit was exhausted', \PREG_BAD_UTF8_ERROR => 'Malformed UTF-8 data', \PREG_BAD_UTF8_OFFSET_ERROR => 'Offset didn\'t correspond to the begin of a valid UTF-8 code point', 6 => 'Failed due to limited JIT stack space'];
}
/**
 * The exception that indicates assertion error.
 */
class AssertionException extends \Exception
{
}


text:
using GladNet.Common;
using GladNet.Server;
using GladNet.Server.Connections.Readers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestServer
{
	public class TestClient : ClientPeer
	{
		public TestClient(IConnectionDetails details)
			: base(details)
		{

		}

		public override void PackageRecieve(RequestPackage package)
		{
			switch(package.Code)
			{
				case 5:
					MessagePacket message = package.PacketObject as MessagePacket;

					if (message != null)
						AsyncConsoleLogger.Instance.LogDebug(message.GetMessage());

					this.SendResponse(new ResponsePacket("Okie dokie"), 5, Packet.DeliveryMethod.ReliableUnordered);
					break;
			}
		}

		public override void OnDisconnection()
		{
			AsyncConsoleLogger.Instance.LogDebug("Disconnected a client.");
		}
	}
}


text:
<md-dialog aria-label="Adicionar Widget">
    <form ng-cloak>
        <md-toolbar>

Configure Custom APIs PostIt Widget

                <md-button class="md-icon-button" ng-click="ctrl.ok()">
                    <md-icon aria-label="Close">close</md-icon>
                </md-button>

        </md-toolbar>

        <md-dialog-content layout-gt-sm="row" layout-padding style="width: 700px">

                    <md-input-container flex="80">
                        Title:
                        <input ng-model="ctrl.vm.title" placeholder="Widget title" type="text" />
                    </md-input-container>
                    <md-input-container flex="20">
                        Color:
                        <md-select ng-model="ctrl.vm.postItColor" placeholder="Select the background">
                            <md-option ng-value="color.code" ng-repeat="color in ctrl.colors">{{color.desc}}</md-option>
                        </md-select>
                    </md-input-container>

                    <md-input-container flex="20">
                        Account:
                        <md-select ng-model="ctrl.vm.label" placeholder="Select an account">
                            <md-option ng-value="opt" ng-repeat="opt in ctrl.labels">{{ opt }}</md-option>
                        </md-select>
                    </md-input-container>
                    <md-input-container flex="20">
                        Api Relative Route:
                        <input ng-model="ctrl.vm.route" placeholder="/example/to/api" type="text" />
                    </md-input-container>
                    <md-input-container flex="40">
                        Api Query Params:
                        <input ng-model="ctrl.vm.params" placeholder="q=value&p=param" type="text" />
                    </md-input-container>
                    <md-input-container flex="20">
                        Interval:
                        <md-select ng-model="ctrl.vm.poolInterval" placeholder="Select the pool interval">
                            <md-option ng-value="opt.value" ng-repeat="opt in ctrl.intervals">{{ opt.desc }}</md-option>
                        </md-select>
                    </md-input-container>

                    <md-input-container flex="25">
                        Header Json Token:
                        <input ng-model="ctrl.vm.headerTokens" placeholder="comma separated jsonTokenPropertyName" type="text" />
                    </md-input-container>
                    <md-input-container flex="25">
                        First Line Json Token:
                        <input ng-model="ctrl.vm.line1Tokens" placeholder="comma separated jsonTokenPropertyName" type="text" />
                    </md-input-container>
                    <md-input-container flex="25">
                        Second Line Json Token:
                        <input ng-model="ctrl.vm.line2Tokens" placeholder="comma separated jsonTokenPropertyName" type="text" />
                    </md-input-container>
                    <md-input-container flex="25">
                        Avatar Url Json Token:
                        <input ng-model="ctrl.vm.avatarToken" placeholder="jsonTokenPropertyName" type="text" />
                    </md-input-container>

                    <md-input-container flex="25">
                        Columns:
                        <input ng-model="ctrl.vm.columns" type="number" min="1" max="5" />
                    </md-input-container>

        </md-dialog-content>

        <md-dialog-actions layout="row">

        </md-dialog-actions>
    </form>
</md-dialog>


text:
<?php

namespace Kyklydse\ChristmasListBundle\Form;

use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class ListType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $owners = $options['data']->getOwners()->toArray();
        $users = $owners;
        foreach ($owners as $owner) {
            $users = array_merge($users, $owner->getFriends());
        }

        $builder
            ->add('owners', null, array(
                'label' => 'Owners',
                'expanded' => true,
                'choices' => $users,
            ))
            ->add('name', null, array('label' => 'List name'))
            ->add('date', 'date', array('widget' => 'single_text'))
        ;
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array('data_class' => 'Kyklydse\\ChristmasListBundle\\Entity\\ChristmasList'));
    }

    public function getBlockPrefix()
    {
        return 'list';
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Gard. Bull. Singapore 26:227, t. 1, 2. 1973

#### Original name
null

### Remarks
null


text:
package org.cfeclipse.cfml.views.snips;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

import org.eclipse.core.runtime.IPath;
/**
 * @author Stephen Milligan
 */
public class SnipWriter {

	File snippetFile, parentFolder;
	String snippetType;
	String fileExtension;
	IPath snipBase;
	/**
	 *
	 */
	public SnipWriter(File parentFolder, String snippetType, IPath snipBase) {
		super();

		//if the parentFolder is null, then we are at the root surely?
		if(parentFolder == null){
			this.parentFolder = (File)snipBase;
		}else{
			this.parentFolder = parentFolder;
		}
		this.snippetType = snippetType;
		this.snipBase = snipBase;
		if (snippetType == SnipTreeView.DREAMWEAVER_SNIP_TYPE) {
			fileExtension = "." + SnipTreeView.DW_SNIP_EXT;
		}
		else {
			fileExtension = "." + SnipTreeView.CFE_SNIP_EXT;
		}
	}

	public void writeSnippet(String snippetName, String snippetKeyCombo, String snippetDescription, String startText, String endText, boolean useAsTemplate, String templateExtension) {

		File snippetFile = new File(parentFolder.toString() + File.separator + snippetName + fileExtension);
		String snippetContents = createFormattedSnip(snippetName,snippetDescription, startText,endText,useAsTemplate,templateExtension);
		try {

			if (!snippetFile.isFile()) {
				snippetFile.createNewFile();
			}
			FileWriter writer = new FileWriter(snippetFile);
			writer.write(snippetContents);
			writer.close();
			if (snippetKeyCombo.length() > 0) {
			    SnipKeyCombos snipKeyCombos = new SnipKeyCombos();

				String filepath = snippetFile.getAbsolutePath().replaceAll("\\\\","/");
				String basePath = snipBase.toString();

				String relativePath = filepath.replaceFirst(basePath,"");

			    String sequence = snipKeyCombos.getSequence(relativePath);

			    if (sequence != null){
			        snipKeyCombos.clearKeyCombo(sequence);
			    }
			    snipKeyCombos.setKeyCombo(snippetKeyCombo,relativePath);
			}
		}
		catch (IOException e) {
			e.printStackTrace(System.err);
		}
	}

	private String createFormattedSnip(String snippetName, String snippetDescription, String startText, String endText, boolean useAsTemplate, String templateExtension) {
		String snippetContents;
		String useSnippetAsTemplate = useAsTemplate ? "true" : "false";
		if (snippetType == SnipTreeView.CFECLIPSE_SNIP_TYPE) {
			snippetContents = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
			snippetContents += "<snippet filetemplate=\"" + useSnippetAsTemplate + "\" extension=\"" + templateExtension + "\">\n";
			snippetContents += "<name>"+snippetName+"</name>\n";
			snippetContents += "<help>"+snippetDescription+"</help>\n";
			snippetContents += "<starttext><![CDATA["+startText+"]]></starttext>\n";
			snippetContents += "<endtext><![CDATA["+endText+"]]></endtext>\n";
			snippetContents += "</snippet>";
		}
		else {
			snippetContents = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
			snippetContents += "<snippet name = \""+snippetName+"\" description = \""+snippetDescription+"\" preview=\"html\" type=\"block\">\n";
			snippetContents += "<insertText location=\"beforeSelection\"><![CDATA["+startText+"]]></insertText>\n";
			snippetContents += "<insertText location=\"afterSelection\"><![CDATA["+endText+"]]></insertText>\n";
			snippetContents += "</snippet>\n";

		}
		return snippetContents;
	}

	public void writeFolder (String folderName) {
		/**
		 * TODO: This bit of code is throwing an exception when you first install CFE. This cases a NPE.
		 */
		File newFolder = new File(parentFolder.toString() + File.separator + folderName);
		newFolder.mkdir();
	}

}


text:
require 'spec_helper_system'

case node.facts['osfamily']
when 'RedHat'
  servicename = 'httpd'
when 'Debian'
  servicename = 'apache2'
when 'FreeBSD'
  servicename = 'apache22'
else
  raise "Unconfigured OS for apache service on #{node.facts['osfamily']}"
end

describe 'apache::default_mods class' do
  describe 'no default mods' do
    # Using puppet_apply as a helper
    it 'should apply with no errors' do
      pp = <<-EOS
        class { 'apache':
          default_mods => false,
        }
      EOS

      # Run it twice and test for idempotency
      puppet_apply(pp) do |r|
        [0,2].should include(r.exit_code)
        r.refresh
        r.exit_code.should be_zero
      end
    end

    describe service(servicename) do
      it { should be_running }
    end
  end

  describe 'no default mods and failing' do
    # Using puppet_apply as a helper
    it 'should apply with errors' do
      pp = <<-EOS
        class { 'apache':
          default_mods => false,
        }
        apache::vhost { 'defaults.example.com':
          docroot => '/var/www/defaults',
          aliases => {
            alias => '/css',
            path  => '/var/www/css',
          },
          setenv  => 'TEST1 one',
        }
      EOS

      # Run it twice and test for idempotency
      puppet_apply(pp) do |r|
        [4,6].should include(r.exit_code)
      end
    end

    describe "service #{servicename}" do
      it 'should not be running' do
        shell("pidof #{servicename}") do |r|
          r.exit_code.should eq(1)
        end
      end
    end
  end

  describe 'alternative default mods' do
    # Using puppet_apply as a helper
    it 'should apply with no errors' do
      pp = <<-EOS
        class { 'apache':
          default_mods => [
            'info',
            'alias',
            'mime',
            'env',
            'expires',
          ],
        }
        apache::vhost { 'defaults.example.com':
          docroot => '/var/www/defaults',
          aliases => {
            alias => '/css',
            path  => '/var/www/css',
          },
          setenv  => 'TEST1 one',
        }
      EOS

      # Run it twice and test for idempotency
      puppet_apply(pp) do |r|
        [0,2].should include(r.exit_code)
        sleep 10 # avoid race condition on centos :(
        r.refresh
        r.exit_code.should be_zero
      end
    end

    describe service(servicename) do
      it { should be_running }
    end
  end
end


text:
<!--
  ~ Copyright (c) 2016. Microlands Systems
  ~
  ~ {project}  Copyright (C) {year}  {fullname}
  ~ This program comes with ABSOLUTELY NO WARRANTY.
  ~ This is free software, and you are welcome to redistribute it
  ~ under certain conditions.
  -->

<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical">

    <include layout="@layout/view_camera_and_title"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/crime_details_label"
        style="?android:listSeparatorTextViewStyle"
        />

    <Button
        android:id="@+id/crime_date"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        />

    <CheckBox
        android:id="@+id/crime_solved"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:text="@string/crime_solved_label"
        />

    <Button
        android:id="@+id/crime_suspect"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:text="@string/crime_suspect_text"/>

    <Button
        android:id="@+id/crime_report"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:text="@string/crime_report_text"/>

</LinearLayout>


text:
from django.apps import AppConfig

class QgenConfig(AppConfig):
    name = 'QGen'


text:
<?php

defined('C5_EXECUTE') or die('Access Denied.');

/** @var Concrete\Core\ConcreteCms\ActivitySlotItem|null $slot */
/** @var string|null $key */
?>
<?php if (is_object($slot)) { ?>
<div class="ccm-block-dashboard-concrete-latest-wrapper <?php if ($key == 'C') { ?>ccm-block-dashboard-concrete-slot-c<?php } ?>">

        <?=$slot->getContent()?>

<?php
}


text:
<?php

namespace ZendTest\Log\Writer;

use ZendTest\Log\TestAsset\MockChromePhp;
use Zend\Log\Writer\ChromePhp;
use Zend\Log\Writer\ChromePhp\ChromePhpInterface;
use Zend\Log\Logger;

/**
 * @copyright  Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @group      Zend_Log
 */
class ChromePhpTest extends \PHPUnit_Framework_TestCase
{
    protected $chromephp;

    public function setUp()
    {
        $this->chromephp = new MockChromePhp();
    }

    public function testGetChromePhp()
    {
        $writer = new ChromePhp($this->chromephp);
        $this->assertTrue($writer->getChromePhp() instanceof ChromePhpInterface);
    }

    public function testSetChromePhp()
    {
        $writer   = new ChromePhp($this->chromephp);
        $chromephp2 = new MockChromePhp();

        $writer->setChromePhp($chromephp2);
        $this->assertTrue($writer->getChromePhp() instanceof ChromePhpInterface);
        $this->assertEquals($chromephp2, $writer->getChromePhp());
    }

    public function testWrite()
    {
        $writer = new ChromePhp($this->chromephp);
        $writer->write(array(
            'message' => 'my msg',
            'priority' => Logger::DEBUG
        ));
        $this->assertEquals('my msg', $this->chromephp->calls['trace'][0]);
    }

    public function testWriteDisabled()
    {
        $chromephp = new MockChromePhp(false);
        $writer = new ChromePhp($chromephp);
        $writer->write(array(
            'message' => 'my msg',
            'priority' => Logger::DEBUG
        ));
        $this->assertTrue(empty($this->chromephp->calls));
    }

    public function testConstructWithOptions()
    {
        $formatter = new \Zend\Log\Formatter\Simple();
        $filter    = new \Zend\Log\Filter\Mock();
        $writer = new ChromePhp(array(
            'filters'   => $filter,
            'formatter' => $formatter,
            'instance'  => $this->chromephp,
        ));
        $this->assertTrue($writer->getChromePhp() instanceof ChromePhpInterface);
        $this->assertAttributeInstanceOf('Zend\Log\Formatter\ChromePhp', 'formatter', $writer);

        $filters = self::readAttribute($writer, 'filters');
        $this->assertCount(1, $filters);
        $this->assertEquals($filter, $filters[0]);
    }
}


text:
/** @file
 * @section buffer Corto
 * @brief Generic corto functions.
 */

#ifndef CORTO_H
#define CORTO_H

/* $header() */

/* Generic functionality (os abstraction, lockless admin) */
#include "bake_config.h"

/* Types must be included first because builtin packages cross reference */
#include "vstore/_type.h"
#include "lang/_type.h"
#include "secure/_type.h"
#include "native/_type.h"

/* Standard C library */
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

/* OS-specific headers */
#if defined(WIN32) || defined(WIN64)
#include <windows.h>
#define alloca _alloca
#else
#include <alloca.h>
#include <fnmatch.h>
#include <inttypes.h>
#include <execinfo.h>
#include <dlfcn.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ptrace.h>
#include <dirent.h>
#include <unistd.h>
#include <signal.h>
#include <pthread.h>
#include <ftw.h>
#include <fcntl.h>

#ifdef __MACH__
#include <mach/clock.h>
#include <mach/mach.h>
#endif
#endif

#ifndef NDEBUG
#define CORTO_MAGIC (0x6B6F7274)
#define CORTO_MAGIC_DESTRUCT (0x74726F6B)
#endif

/*
 * Configuration parameters
 *   Increasing these numbers will increase memory usage of Corto in various
 *   scenario's.
 */

/* The maximum nesting level of objects in the hierarchy. There are in total
 * 62 orders of magnitude in the universe, so 64 should be adequate to organize
 * most information sets.
 */
#define CORTO_MAX_SCOPE_DEPTH (64)

/* The maximum inheritance depth. Think 16 is too small? The Java world record
 * is set at 12 levels of inheritance:
 * http://www.javaspecialists.eu/records/index.jsp
 *
 * Please don't use 16 levels of inheritance.
 */
#define CORTO_MAX_INHERITANCE_DEPTH (16)

/* The maximum number of languages you can construct to a single Corto process. */
#define CORTO_MAX_BINDINGS (16)

/* The maximum number of threads that can make use of the Corto
 * API simultaneously. */
#define CORTO_MAX_THREADS (64)

/* The maximum number of nested notifications. */
#define CORTO_MAX_NOTIFY_DEPTH (16)

/* The max length of a scoped identifier (incl \0). When combining this with the
 * MAX_SCOPE_DEPTH, and taking into consideration the scope separator (/) you
 * can have a tree that is 64 levels deep, where each object has a 7-character
 * name, and one object with 6, to compensate for \0. Or, you can have an object
 * in the root with a 510 character name with no children. */
#define CORTO_MAX_PATH_LENGTH (512)

/* The maximum number of objects that a thread can wait for simultaneously */
#define CORTO_MAX_WAIT_FOR_OBJECTS (32)

/* Corto can't load files with extensions longer than 16 characters */
#define CORTO_MAX_FILE_EXTENSION (16)

/* Maximum number of OLS extensions that is supported by the core */
#define CORTO_MAX_OLS_KEY (256)

/* Maximum number of TLS keys that is supported by the core */
#define CORTO_MAX_THREAD_KEY (256)

/* The maximum number of arguments that can be passed to the Corto arg parser */
#define CORTO_ARG_MAX (256)

/* The maximum number of TLS strings that can exist simultaneously */
#define CORTO_MAX_TLS_STRINGS (5)

/* Maximum retained buffer length for TLS string. This ensures that when a very
 * large string is stored in TLS, it will be cleaned up eventually. Keeping it
 * around would be wasteful since chances are low that a string of similar
 * length will take advantage of the memory. */
#define CORTO_MAX_TLS_STRINGS_MAX (1024)

/* Maximum number of arguments for command */
#define CORTO_MAX_CMD_ARGS (256)

/* Maximum number of operations in an id expression */
#define CORTO_MATCHER_MAX_OP (32)

/* Maximum number of content types in a process */
#define CORTO_MAX_CONTENTTYPE (32)

/* Maximum number of simultaneous benchmarks */
#define CORTO_MAX_BENCHMARK (64)

/* Maximum number of categories in logmsg, like: "comp1: comp2: comp3: msg" */
#define CORTO_MAX_LOG_CATEGORIES (24)

/* Maximum number of code frames in logmsg */
#define CORTO_MAX_LOG_CODEFRAMES (16)

typedef char corto_id[CORTO_MAX_PATH_LENGTH];

/* Builtin procedure kinds */
#define CORTO_PROCEDURE_STUB (0)
#define CORTO_PROCEDURE_CDECL (1)

/* C language binding type definition macro's */
#define CORTO_ANY(__type) typedef struct __type {corto_type type; void *value; uint8_t owner;} __type
#define CORTO_SEQUENCE(type, subtype, postexpr) typedef struct type {uint32_t length; subtype _()(*buffer) postexpr;} type
#define CORTO_SEQUENCE_EMPTY(type) (type){0}

/* Macro's used to prevent type checking macro's from expanding */
#define ___

/* Macro used to annotate parameters in bootstrap.h */
#define _(txt)

/* Corto string representing null */
#define CORTO_NULL_STRING ("null")

/* Include main headers from builtin packages */
#include "lang/lang.h"
#include "vstore/vstore.h"
#include "native/native.h"
#include "secure/secure.h"
#include "store/store.h"

#ifdef __cplusplus
extern "C" {
#endif

/* -- GLOBAL VARIABLES -- */
CORTO_EXPORT extern const char* BAKE_VERSION;
CORTO_EXPORT extern const char* BAKE_VERSION_MAJOR;
CORTO_EXPORT extern const char* BAKE_VERSION_MINOR;
CORTO_EXPORT extern const char* BAKE_VERSION_PATCH;
CORTO_EXPORT extern const char* BAKE_VERSION_SUFFIX;

CORTO_EXPORT extern bool CORTO_TRACE_MEM;
CORTO_EXPORT extern bool CORTO_COLLECT_CYCLES;
CORTO_EXPORT extern bool CORTO_COLLECT_TLS;

/* -- FRAMEWORK FUNCTIONS -- */

/** Start corto.
 * This function will initialize the corto object store. Should only be called
 * once per process.
 *
 * @param appName Name of the application. Used in tracing.
 * @return 0 if success, nonzero if failed.
 */
CORTO_EXPORT
int corto_start(
    char *appName);

/** Stop corto.
 * This function deinitializes the corto object store. Should only be called once
 * per process, and after corto_start.
 */
CORTO_EXPORT
int corto_stop(void);

/** Load configuration.
 * This function loads configuration from the path configured in $CORTO_CONFIG
 * if this environment variable is set.
 */
CORTO_EXPORT
int corto_load_config(void);

/** Get a unique string that identifies the current corto build.
 * This function is used to determine whether a package is linked with the
 * correct corto library before allowing it to be loaded.
 *
 * @return String that uniquely identifies the current corto build
 */
CORTO_EXPORT
char* corto_get_build(void);

/** Specify function to be executed when corto exits.
 *
 * @param handler Pointer to function to be executed.
 */
CORTO_EXPORT
void corto_atexit(
    void(*handler)(void*),
    void* userData);

/* -- SECURITY -- */

/** Enable or disable security.
 * This function enables or disables corto security. When no instance of
 * corto/secure/key instance has been created this function does nothing.
 *
 * By default security is disabled, even after creation of a lock. The reason
 * for this is that a lock is typically created during loading of configuration
 * and other configuration items may be loaded after it.
 *
 * If the lock would be effective immediately after creating it, it could
 * prevent other configuration items from loading successfully, as they most
 * likely rely on data to which access will be restricted by the lock.
 *
 * @param enable Specifies whether to enable security.
 * @return true if security has been enabled, false if failed. The function will
 *         fail of no instance of corto/secure/key has been created.
 */
 CORTO_EXPORT
 bool corto_enable_security(
     bool enabled);

/* -- AUTOMATIC PACKAGE LOADING -- */

/** Mount package data
 * The package loader mounts corto packages into the corto hierarchy so they can
 * be discovered with corto_select and resolved with corto_lookup and
 * corto_resolve.
 *
 * @param enable Specifies whether to enable mounting package data.
 * @return Previous value.
 */
CORTO_EXPORT
bool corto_enable_load(
    corto_bool enable);

/** Enable automatic loading of packages
 * When enabled, an application that is requesting objects from a package will
 * trigger the package to be loaded into corto automatically.
 *
 * @param autoload Specifies whether to enable automatic package loading.
 * @return Previous value.
 */
CORTO_EXPORT
bool corto_autoload(
    corto_bool autoload);

/** Utility to generate random id */
CORTO_EXPORT
char* corto_random_id(
    uint16_t n);

/* -- RUNTIME CONSISTENCY CHECKING -- */

/* Used in type checking macro */
CORTO_EXPORT
corto_object _ut_assert_type(
    corto_type type,
    corto_object o);

    /* Is pointer a valid object */
#ifndef NDEBUG
CORTO_EXPORT
corto_object _ut_assert_object(
    char const *file,
    unsigned int line,
    corto_object o);
#define ut_assert_object(o) _ut_assert_object(__FILE__, __LINE__, o)
#else
#define ut_assert_object(o) o
#endif

/* Is object of specified type */
#ifndef NDEBUG
#define ut_assert_type(type, o) _ut_assert_type((type), (o))
#else
#define ut_assert_type(type, o) (o)
#endif

/* Mark variable(parameter) as unused */
#define CORTO_UNUSED(p) (void)(p)

/* Calculate offset */
#define CORTO_OFFSET(o, offset) (void*)(((uintptr_t)(o)) + ((uintptr_t)(offset)))

/* Determine alignment of struct */
#define CORTO_ALIGNMENT(t) ((uintptr_t)(&((struct {corto_char dummy;t alignMember;}*)(void *)0)->alignMember))

/* Determine offset based on size of type and alignment */
#define CORTO_ALIGN(size, alignment) (((((size) - 1) / (alignment)) + 1) * (alignment))

/* Hash for primitive typekinds. Enables quick lookup of transformations and operators for primitive types. */
#define CORTO_PWIDTH(width) (((width) == CORTO_WIDTH_8) ? 0 : ((width) == CORTO_WIDTH_16) ? 1 : ((width) == CORTO_WIDTH_32) ? 2 : ((width) == CORTO_WIDTH_64) ? 3 : -1)
#define CORTO_TYPEHASH_VARWIDTH(kind, width) ((kind) * (CORTO_FLOAT+1)) + ((int[4]){0, CORTO_FLOAT, CORTO_FLOAT * 2, CORTO_FLOAT * 3}[CORTO_PWIDTH(width)])
#define CORTO_TYPEHASH(kind, width) ((kind) <= CORTO_FLOAT ? CORTO_TYPEHASH_VARWIDTH((kind), (width)) : CORTO_TYPEHASH_VARWIDTH(CORTO_FLOAT, CORTO_WIDTH_64) + ((kind) - CORTO_FLOAT))
#define CORTO_TYPEHASH_MAX (50)

#define CORTO_ISNAN(x) ((x) != (x))

/* Macros for memory allocation functions */
#define corto_calloc(n) calloc(n, 1)
#define corto_alloc(n) malloc(n)
#define corto_dealloc free
#define corto_realloc realloc

/* Set intern TLS string */
CORTO_EXPORT char* ut_setThreadString(char* string);

CORTO_EXPORT char* corto_itoa(int num, char* buff);
CORTO_EXPORT char* ut_ulltoa(uint64_t value, char *ptr, int base);

#ifdef __cplusplus
}
#endif
/* $end */

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
}
#endif
#endif


text:
package com.kmshack.newsstand;

import android.widget.AbsListView;

public interface ScrollTabHolder {

	void adjustScroll(int scrollHeight);

	void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount, int pagePosition);
}


text:
package org.apache.activemq.artemis.core.postoffice.impl;

import java.util.Collection;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.postoffice.Address;
import org.apache.activemq.artemis.core.postoffice.AddressManager;
import org.apache.activemq.artemis.core.postoffice.Binding;
import org.apache.activemq.artemis.core.postoffice.Bindings;
import org.apache.activemq.artemis.core.postoffice.BindingsFactory;
import org.apache.activemq.artemis.core.postoffice.QueueBinding;
import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
import org.apache.activemq.artemis.core.server.RoutingType;
import org.apache.activemq.artemis.core.server.impl.AddressInfo;
import org.apache.activemq.artemis.core.transaction.Transaction;
import org.jboss.logging.Logger;

/**
 * A simple address manager that maintains the addresses and bindings.
 */
public class SimpleAddressManager implements AddressManager {

   private static final Logger logger = Logger.getLogger(SimpleAddressManager.class);

   private final ConcurrentMap<SimpleString, AddressInfo> addressInfoMap = new ConcurrentHashMap<>();

   /**
    * HashMap<Address, Binding>
    */
   private final ConcurrentMap<SimpleString, Bindings> mappings = new ConcurrentHashMap<>();

   /**
    * HashMap<QueueName, Binding>
    */
   private final ConcurrentMap<SimpleString, Binding> nameMap = new ConcurrentHashMap<>();

   private final BindingsFactory bindingsFactory;

   public SimpleAddressManager(final BindingsFactory bindingsFactory) {
      this.bindingsFactory = bindingsFactory;
   }

   @Override
   public boolean addBinding(final Binding binding) throws Exception {
      if (nameMap.putIfAbsent(binding.getUniqueName(), binding) != null) {
         throw ActiveMQMessageBundle.BUNDLE.bindingAlreadyExists(binding);
      }

      if (logger.isTraceEnabled()) {
         logger.trace("Adding binding " + binding + " with address = " + binding.getUniqueName(), new Exception("trace"));
      }

      return addMappingInternal(binding.getAddress(), binding);
   }

   @Override
   public Binding removeBinding(final SimpleString uniqueName, Transaction tx) throws Exception {
      final Binding binding = nameMap.remove(uniqueName);

      if (binding == null) {
         return null;
      }

      removeBindingInternal(binding.getAddress(), uniqueName);

      return binding;
   }

   @Override
   public Bindings getBindingsForRoutingAddress(final SimpleString address) throws Exception {
      return mappings.get(address);
   }

   @Override
   public Binding getBinding(final SimpleString bindableName) {
      return nameMap.get(bindableName);
   }

   @Override
   public Map<SimpleString, Binding> getBindings() {
      return nameMap;
   }

   @Override
   public Bindings getMatchingBindings(final SimpleString address) throws Exception {
      Address add = new AddressImpl(address);

      Bindings bindings = bindingsFactory.createBindings(address);

      for (Binding binding : nameMap.values()) {
         Address addCheck = new AddressImpl(binding.getAddress());

         if (addCheck.matches(add)) {
            bindings.addBinding(binding);
         }
      }

      return bindings;
   }

   @Override
   public SimpleString getMatchingQueue(final SimpleString address, RoutingType routingType) throws Exception {

      Binding binding = nameMap.get(address);

      if (binding == null || !(binding instanceof  LocalQueueBinding)
            || !binding.getAddress().equals(address)) {
         Bindings bindings = mappings.get(address);
         if (bindings != null) {
            for (Binding theBinding : bindings.getBindings()) {
               if (theBinding instanceof LocalQueueBinding) {
                  binding = theBinding;
                  break;
               }
            }
         }
      }

      return binding != null ? binding.getUniqueName() : null;
   }

   @Override
   public SimpleString getMatchingQueue(final SimpleString address, final SimpleString queueName, RoutingType routingType) throws Exception {
      Binding binding = nameMap.get(queueName);

      if (binding != null && !binding.getAddress().equals(address)) {
         throw new IllegalStateException("queue belongs to address" + binding.getAddress());
      }
      return binding != null ? binding.getUniqueName() : null;
   }

   @Override
   public void clear() {
      nameMap.clear();
      mappings.clear();
   }

   @Override
   public Set<SimpleString> getAddresses() {
      Set<SimpleString> addresses = new HashSet<>();
      addresses.addAll(mappings.keySet());
      return addresses;
   }

   protected void removeBindingInternal(final SimpleString address, final SimpleString bindableName) {
      Bindings bindings = mappings.get(address);

      if (bindings != null) {
         removeMapping(bindableName, bindings);

         if (bindings.getBindings().isEmpty()) {
            mappings.remove(address);
         }
      }
   }

   protected Binding removeMapping(final SimpleString bindableName, final Bindings bindings) {
      Binding theBinding = null;

      for (Binding binding : bindings.getBindings()) {
         if (binding.getUniqueName().equals(bindableName)) {
            theBinding = binding;

            break;
         }
      }

      if (theBinding == null) {
         throw new IllegalStateException("Cannot find binding " + bindableName);
      }

      bindings.removeBinding(theBinding);

      return theBinding;
   }

   protected boolean addMappingInternal(final SimpleString address, final Binding binding) throws Exception {
      Bindings bindings = mappings.get(address);

      Bindings prevBindings = null;

      if (bindings == null) {
         bindings = bindingsFactory.createBindings(address);

         prevBindings = mappings.putIfAbsent(address, bindings);

         if (prevBindings != null) {
            bindings = prevBindings;
         }
      }

      bindings.addBinding(binding);

      return prevBindings != null;
   }

   @Override
   public boolean addAddressInfo(AddressInfo addressInfo) {
      return addressInfoMap.putIfAbsent(addressInfo.getName(), addressInfo) == null;
   }

   @Override
   public AddressInfo updateAddressInfo(SimpleString addressName,
                                        Collection<RoutingType> routingTypes) throws Exception {
      if (routingTypes == null) {
         return this.addressInfoMap.get(addressName);
      } else {
         return this.addressInfoMap.computeIfPresent(addressName, (name, oldAddressInfo) -> {
            validateRoutingTypes(name, routingTypes);
            final Set<RoutingType> updatedRoutingTypes = EnumSet.copyOf(routingTypes);
            oldAddressInfo.setRoutingTypes(updatedRoutingTypes);
            return oldAddressInfo;
         });
      }
   }

   private void validateRoutingTypes(SimpleString addressName, Collection<RoutingType> routingTypes) {
      final Bindings bindings = this.mappings.get(addressName);
      if (bindings != null) {
         for (Binding binding : bindings.getBindings()) {
            if (binding instanceof QueueBinding) {
               final QueueBinding queueBinding = (QueueBinding) binding;
               final RoutingType routingType = queueBinding.getQueue().getRoutingType();
               if (!routingTypes.contains(routingType)) {
                  throw ActiveMQMessageBundle.BUNDLE.invalidRoutingTypeDelete(routingType, addressName.toString());
               }
            }
         }
      }
   }

   @Override
   public AddressInfo addOrUpdateAddressInfo(AddressInfo addressInfo) {
      return this.addressInfoMap.compute(addressInfo.getName(), (name, oldAddressInfo) -> {
         if (oldAddressInfo != null) {
            final Set<RoutingType> routingTypes = addressInfo.getRoutingTypes();
            validateRoutingTypes(name, routingTypes);
            final Set<RoutingType> updatedRoutingTypes = EnumSet.copyOf(routingTypes);
            oldAddressInfo.setRoutingTypes(updatedRoutingTypes);
            return oldAddressInfo;
         } else {
            return addressInfo;
         }
      });
   }

   @Override
   public AddressInfo removeAddressInfo(SimpleString address) {
      return addressInfoMap.remove(address);
   }

   @Override
   public AddressInfo getAddressInfo(SimpleString addressName) {
      return addressInfoMap.get(addressName);
   }
}


text:
<?php

namespace crewstyle\TeaThemeOptions\Core\Field\Select;

use crewstyle\TeaThemeOptions\TeaThemeOptions;
use crewstyle\TeaThemeOptions\Core\Field\Field;

/**
 * TTO SELECT FIELD
 *
 * To add this field, simply make the same as follow:
 * array(
 *     'type' => 'select',
 *     'title' => 'Prove it: what do they mean by "Bapouet"?',
 *     'id' => 'my_select_field_id',
 *     'default' => '',
 *     'description' => "Don't cheat: the movie is NOT the solution :)",
 *     'options' => array(
 *         'toy' => 'A simple toy',
 *         'milk' => 'Just milk',
 *         'unicorn-toy' => 'A unicorn toy... Very stupid :p',
 *         'tails' => 'A red fox with a tiny cute fire tail with his blue faster hedgedog friend'
 *     )
 * )
 *
 */

if (!defined('TTO_CONTEXT')) {
    die('You are not authorized to directly access to this page');
}

//----------------------------------------------------------------------------//

/**
 * TTO Field Select
 *
 * Class used to build Select field.
 *
 * @package Tea Theme Options
 * @subpackage Core\Field\Select
 * @author Achraf Chouk <achrafchouk@gmail.com>
 * @since 3.3.0
 *
 */
class Select extends Field
{
    /**
     * @var string
     */
    public static $faicon = 'fa-list';

    /**
     * Constructor.
     *
     * @since 3.0.0
     */
    public function __construct(){}

    /**
     * Display HTML component.
     *
     * @param array $content Contains all field data
     * @param array $details Contains all field options
     *
     * @since 3.0.0
     */
    public function prepareField($content, $details = array())
    {
        //Build details
        $post = isset($details['post']) ? $details['post'] : 0;
        $prefix = isset($details['prefix']) ? $details['prefix'] : '';
        $tpl = empty($prefix) ? 'pages' : 'terms';

        //Build defaults data
        $template = array(
            'id' => $content['id'],
            'title' => isset($content['title']) ? $content['title'] : TeaThemeOptions::__('Tea Select'),
            'description' => isset($content['description']) ? $content['description'] : '',
            'default' => isset($content['default']) ? $content['default'] : '',
            'options' => isset($content['options']) ? $content['options'] : array(),

            //details
            'post' => $post,
            'prefix' => $prefix,
            'template' => $tpl,

            //texts
            't_no_options' => TeaThemeOptions::__('Something went wrong in your parameters definition:
                no options have been defined.'),
        );

        //Retrieve field value
        $template['val'] = $this->getFieldValue($details, $template['default'], $content['id']);

        //Get template
        return $this->renderField('fields/select.html.twig', $template);
    }
}


text:
layout: page
title: "Julian Martin Michaels"
comments: true
description: "blanks"
keywords: "Julian Martin Michaels,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: College of Arts and Sciences

**Classes taught**: GEOL 1030

#### GEOL 1030: Introduction to Geology Laboratory 1

**Terms taught**: Fall 2011, Fall 2011, Spring 2012, Spring 2012

**Instructor rating**: 5.59

**Standard deviation in instructor rating**: 0.08

**Average grade** (4.0 scale): 3.31

**Standard deviation in grades** (4.0 scale): 0.1

**Average workload** (raw): 1.8

**Standard deviation in workload** (raw): 0.06


text:
var take = function(array, number) {
  if(number === undefined){
    return number = 1}
  return array.slice(0, number)
}

module.exports = {take};


text:
// Dependencies
var Bind = require("github/jxmono/bind")
  , Events = require("github/jxmono/events")
  ;

/**
 *  This module creates the UI part for user actions in a DMS
 *  application.
 *
 * */
module.exports = function init (config) {

    // get the module
    var self = this;

    // normalize the configuration
    self.config = config;
    self.config.ui = self.config.ui || {};
    self.config.ui.selectors = self.config.selectors || {};
    self.config.ui.selectors.action = self.config.selectors || "[data-action]";

    // call Events
    Events.call(self, config);

    // run binds
    if (config.binds) {
        for (var i = 0; i < config.binds.length; ++i) {
            Bind.call(self, config.binds[i]);
        }
    }

    // module cache
    self.cache = {
        // { "selector": jQueryObjectsMatchedBySelector  }
        selectors: {}
    };

    /**
     * updateActionControls
     * This function updates the user controls in UI
     *
     * @param options: TODO
     * @param callback: the callback function
     * @return
     */
    self.updateActionControls = function (options, callback) {

        // conversions and defaults
        options = Object(options);
        callback = callback || function () {};

        // call the server operation
        self.link("getUserControls", {data: options}, function (err, responseObject) {

            // handle error
            if (err) {
                return callback (err, null);
            }

            // hide all the actions first
            $(self.config.ui.selectors.action, self.dom).hide();

            // get selectors
            var selectors = Object.keys(responseObject);

            // each selector
            for (var i = 0; i < selectors.length; ++i) {

                // get the current selector
                var cSelector = selectors[i]
                  , $jQueryObject = self.cache.selectors[cSelector]
                  ;

                // the jquery object was taken from cache
                if (!$jQueryObject) {
                    $jQueryObject = self.cache.selectors[cSelector] = $(cSelector, self.dom);
                }

                // show the action
                if (responseObject[cSelector]) {
                    $jQueryObject.show()
                }
            }

            // remove corner radius classes
            $(".btn-group button:visible").removeClass("radius-left radius-right");

            // update BS3 button group buttons corner radius
            $(".btn-group button:visible")
                .first()
                .addClass('radius-left')
                .end()
                .last()
                .addClass('radius-right');

            // callback
            callback (null, responseObject);
        });
    };

    /**
     * runAction
     *
     * This function calls the server operation which validates the
     * rights of this user to run the action.
     *
     * @param options: TODO
     * @param callback: the callback function
     * @return
     */
    self.runAction = function (options, callback) {

        // conversions and defaults
        options = Object(options);
        callback = callback || function () {};

        // call the server operation
        self.link("runAction", {data: options}, callback);
    };

    // ready
    self.emit("ready", config);
};


text:
.highlight{
  position:relative;
}

.highlight .show{
  display:block;
}

.highlight .hide{
  display:none;
}

.highlight.glow{
  background-color:#ffa;
}

.highlight .highlight-buttons{
  position:absolute;
  top:0;
  right:0;
}

.highlight .on,
.highlight .off{
  float:right;
  display:inline-block;
  font-size:12px;
  padding:2px;
  margin:0;
  background-color:#ccc;
  border:1px solid #000;
  cursor:pointer;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using System.Web.Http.Cors;

namespace MovieHunter.API
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services

            // Web API routes
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );

            // Cross-origin resource sharing
            // Allows acces from a domain outside of the domain the resource
            // originated from.
            config.EnableCors(new EnableCorsAttribute("*", "*", "*"));
        }
    }
}


text:
#ifndef _MSM_H
#define _MSM_H

#include <linux/version.h>
#include <linux/completion.h>
#include <linux/i2c.h>
#include <linux/videodev2.h>
#include <linux/pm_qos.h>
#include <linux/msm_ion.h>
#include <linux/iommu.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-event.h>
#include <media/v4l2-mediabus.h>
#include <media/videobuf2-dma-contig.h>
#include <media/videobuf2-msm-mem.h>
#include <media/msmb_camera.h>

#define MSM_POST_EVT_TIMEOUT 5000
#define MSM_POST_EVT_NOTIMEOUT 0xFFFFFFFF
#define MSM_CAMERA_STREAM_CNT_BITS  32

struct msm_video_device {
	struct video_device *vdev;
	atomic_t opened;
};

struct msm_queue_head {
	struct list_head list;
	spinlock_t lock;
	int len;
	int max;
};

/** msm_event:
 *
 *  event sent by imaging server
 **/
struct msm_event {
	struct video_device *vdev;
	atomic_t on_heap;
};

struct msm_command {
	struct list_head list;
	struct v4l2_event event;
	atomic_t on_heap;
};

/** struct msm_command_ack
 *
 *  Object of command_ack_q, which is
 *  created per open operation
 *
 *  contains struct msm_command
 **/
struct msm_command_ack {
	struct list_head list;
	struct msm_queue_head command_q;
	struct completion wait_complete;
	int stream_id;
};

struct msm_v4l2_subdev {
	/* FIXME: for session close and error handling such
	 * as daemon shutdown */
	int    close_sequence;
};

struct msm_session {
	struct list_head list;

	/* session index */
	unsigned int session_id;

	/* event queue sent by imaging server */
	struct msm_event event_q;

	/* ACK by imaging server. Object type of
	 * struct msm_command_ack per open,
	 * assumption is application can send
	 * command on every opened video node */
	struct msm_queue_head command_ack_q;

	/* real streams(either data or metadate) owned by one
	 * session struct msm_stream */
	struct msm_queue_head stream_q;
	struct mutex lock;
};

int msm_post_event(struct v4l2_event *event, int timeout);
int  msm_create_session(unsigned int session, struct video_device *vdev);
int msm_destroy_session(unsigned int session_id);

int msm_create_stream(unsigned int session_id,
	unsigned int stream_id, struct vb2_queue *q);
void msm_delete_stream(unsigned int session_id, unsigned int stream_id);
int  msm_create_command_ack_q(unsigned int session_id, unsigned int stream_id);
void msm_delete_command_ack_q(unsigned int session_id, unsigned int stream_id);
struct msm_stream *msm_get_stream(unsigned int session_id,
	unsigned int stream_id);
struct vb2_queue *msm_get_stream_vb2q(unsigned int session_id,
	unsigned int stream_id);
struct msm_stream *msm_get_stream_from_vb2q(struct vb2_queue *q);
struct msm_session *msm_session_find(unsigned int session_id);
#endif /*_MSM_H */


text:
pub struct Protocol(pub u8);

impl Protocol {
    pub const ICMP: Protocol = Protocol(1);
    pub const TCP: Protocol = Protocol(6);
    pub const UDP: Protocol = Protocol(17);
    pub const RESERVED: Protocol = Protocol(255);

    /// Returns the numeric representation of this protocol.
    #[inline]
    pub fn value(&self) -> u8 {
        self.0
    }

    pub fn is_unassigned(&self) -> bool {
        self.0 >= 143 && self.0 <= 252
    }

    pub fn is_experimental(&self) -> bool {
        self.0 >= 253 && self.0 <= 254
    }
}