text:
#region MIT license
//
// MIT license
//
// Copyright (c) 2007-2008 Jiri Moudry, Pascal Craponne
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#endregion

using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;

using DbLinq.Data.Linq.Database;
using DbLinq.Data.Linq.Sql;
using DbLinq.Data.Linq.Sugar.Expressions;
using DbLinq.Util;

#if MONO_STRICT
using System.Data.Linq;
#endif

namespace DbLinq.Data.Linq.Sugar.Implementation
{
    internal class QueryRunner : IQueryRunner
    {
        /// <summary>
        /// Enumerates all records return by SQL request
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="selectQuery"></param>
        /// <returns></returns>
        public virtual IEnumerable<T> Select<T>(SelectQuery selectQuery)
        {
            var rowObjectCreator = selectQuery.GetRowObjectCreator<T>();

            IList<T> results = new List<T>();

            // handle the special case where the query is empty, meaning we don't need the DB
            if (string.IsNullOrEmpty(selectQuery.Sql.ToString()))
            {
                results.Add(rowObjectCreator(null, null));
            }
            else
            {
                using (var dbCommand = selectQuery.GetCommand())
                {
                    // write query to log
                    selectQuery.DataContext.WriteLog(dbCommand.Command);

                    using (var reader = dbCommand.Command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            // someone told me one day this could happen (in SQLite)
                            if (reader.FieldCount == 0)
                                continue;

                            var row = rowObjectCreator(reader, selectQuery.DataContext._MappingContext);
                            // the conditions to register and watch an entity are:
                            // - not null (can this happen?)
                            // - registered in the model
                            if (row != null && selectQuery.DataContext.ObjectTrackingEnabled &&
                                    selectQuery.DataContext.Mapping.GetTable(row.GetType()) != null)
                            {
                                row = (T)selectQuery.DataContext.Register(row);
                            }
                            results.Add(row);
                        }
                    }
                }
            }
            return results;
        }

        /// <summary>
        /// Returns a unique row (common reference)
        /// </summary>
        /// <param name="row"></param>
        /// <param name="t"></param>
        /// <param name="dataContext"></param>
        /// <returns></returns>
        protected virtual object GetUniqueRow(object row, Type t, DataContext dataContext)
        {
            if (row != null && dataContext.Mapping.GetTable(row.GetType()) != null)
                row = dataContext.Register(row);
            return row;
        }

        /// <summary>
        /// Returns a unique row (common reference)
        /// </summary>
        /// <param name="row"></param>
        /// <param name="dataContext"></param>
        /// <returns></returns>
        protected virtual T GetUniqueRow<T>(object row, DataContext dataContext)
        {
            return (T)GetUniqueRow(row, typeof(T), dataContext);
        }

        public virtual S SelectScalar<S>(SelectQuery selectQuery)
        {
            switch (selectQuery.ExecuteMethodName)
            {
                case null: // some calls, like Count() generate SQL and the resulting projection method name is null (never initialized)
                    return SelectSingle<S>(selectQuery, false); // Single() for safety, but First() should work
                case "First":
                    return SelectFirst<S>(selectQuery, false);
                case "FirstOrDefault":
                    return SelectFirst<S>(selectQuery, true);
                case "Single":
                    return SelectSingle<S>(selectQuery, false);
                case "SingleOrDefault":
                    return SelectSingle<S>(selectQuery, true);
                case "Last":
                    return SelectLast<S>(selectQuery, false);
            }
            throw Error.BadArgument("S0077: Unhandled method '{0}'", selectQuery.ExecuteMethodName);
        }

        /// <summary>
        /// Returns first item in query.
        /// If no row is found then if default allowed returns default(S), throws exception otherwise
        /// </summary>
        /// <typeparam name="S"></typeparam>
        /// <param name="selectQuery"></param>
        /// <param name="allowDefault"></param>
        /// <returns></returns>
        protected virtual S SelectFirst<S>(SelectQuery selectQuery, bool allowDefault)
        {
            foreach (var row in Select<S>(selectQuery))
                return row;
            if (!allowDefault)
                throw new InvalidOperationException();
            return default(S);
        }

        /// <summary>
        /// Returns single item in query
        /// If more than one item is found, throws an exception
        /// If no row is found then if default allowed returns default(S), throws exception otherwise
        /// </summary>
        /// <typeparam name="S"></typeparam>
        /// <param name="selectQuery"></param>
        /// <param name="allowDefault"></param>
        /// <returns></returns>
        protected virtual S SelectSingle<S>(SelectQuery selectQuery, bool allowDefault)
        {
            S firstRow = default(S);
            int rowCount = 0;
            foreach (var row in Select<S>(selectQuery))
            {
                if (rowCount > 1)
                    throw new InvalidOperationException();
                firstRow = row;
                rowCount++;
            }
            if (!allowDefault && rowCount == 0)
                throw new InvalidOperationException();
            return firstRow;
        }

        /// <summary>
        /// Returns last item in query
        /// </summary>
        /// <typeparam name="S"></typeparam>
        /// <param name="selectQuery"></param>
        /// <param name="allowDefault"></param>
        /// <returns></returns>
        protected virtual S SelectLast<S>(SelectQuery selectQuery, bool allowDefault)
        {
            S lastRow = default(S);
            int rowCount = 0;
            foreach (var row in Select<S>(selectQuery))
            {
                lastRow = row;
                rowCount++;
            }
            if (!allowDefault && rowCount == 0)
                throw new InvalidOperationException();
            return lastRow;
        }

        /// <summary>
        /// Runs an InsertQuery on a provided object
        /// </summary>
        /// <param name="target"></param>
        /// <param name="insertQuery"></param>
        public void Insert(object target, UpsertQuery insertQuery)
        {
            Upsert(target, insertQuery);
        }

        private void Upsert(object target, UpsertQuery insertQuery)
        {
            insertQuery.Target = target;
            var dataContext = insertQuery.DataContext;
            using (var dbCommand = insertQuery.GetCommand())
            {

                // log first command
                dataContext.WriteLog(dbCommand.Command);

                // we may have two commands
                int rowsCount = dbCommand.Command.ExecuteNonQuery();
                // the second reads output parameters
                if (!string.IsNullOrEmpty(insertQuery.IdQuerySql.ToString()))
                {
                    var outputCommandTransaction = new ParameterizedQuery(dataContext, insertQuery.IdQuerySql, insertQuery.PrimaryKeyParameters);
                    outputCommandTransaction.Target = target;

                    var outputCommand = outputCommandTransaction.GetCommandTransactional(false);

                    // then run commands
                    outputCommand.Command.Transaction = dbCommand.Command.Transaction;

                    // log second command
                    dataContext.WriteLog(outputCommand.Command);

                    using (var dataReader = outputCommand.Command.ExecuteReader())
                    {
                        if (! dataReader.Read())
                            throw new InvalidOperationException("Could not retrieve data for inserted row on " + target.GetType());

                        int outputParameterIndex = 0;
                        for (IEnumerator<ObjectOutputParameterExpression> output = insertQuery.OutputParameters.GetEnumerator(); output.MoveNext(); ++outputParameterIndex)
                        {
                            var outputDbParameter = dataReader.GetValue(outputParameterIndex);
                            SetOutputParameterValue(target, output.Current, outputDbParameter);
                        }
                    }
                }
                dbCommand.Commit();
            }
        }

        protected virtual void SetOutputParameterValue(object target, ObjectOutputParameterExpression outputParameter, object value)
        {
            // depending on vendor, we can have DBNull or null
            // so we handle both
            if (value is DBNull || value == null)
                outputParameter.SetValue(target, null);
            else
                outputParameter.SetValue(target, TypeConvert.To(value, outputParameter.ValueType));
        }

        /// <summary>
        /// Performs an update
        /// </summary>
        /// <param name="target">Entity to be flushed</param>
        /// <param name="updateQuery">SQL update query</param>
        /// <param name="modifiedMembers">List of modified members, or null to update all members</param>
        public void Update(object target, UpsertQuery updateQuery, IList<MemberInfo> modifiedMembers)
        {
            Upsert(target, updateQuery);
        }

        /// <summary>
        /// Performs a delete
        /// </summary>
        /// <param name="target">Entity to be deleted</param>
        /// <param name="deleteQuery">SQL delete query</param>
        public void Delete(object target, DeleteQuery deleteQuery)
        {
            deleteQuery.Target = target;
            using (var dbCommand = deleteQuery.GetCommand())
            {

                // log command
                deleteQuery.DataContext.WriteLog(dbCommand.Command);

                int rowsCount = dbCommand.Command.ExecuteNonQuery();
                dbCommand.Commit();
            }
        }

        /// <summary>
        /// Fills dbCommand parameters, given names and values
        /// </summary>
        /// <param name="dbCommand"></param>
        /// <param name="parameterNames"></param>
        /// <param name="parameterValues"></param>
        private void FeedParameters(IDbCommand dbCommand, IList<string> parameterNames, IList<object> parameterValues)
        {
            for (int parameterIndex = 0; parameterIndex < parameterNames.Count; parameterIndex++)
            {
                var dbParameter = dbCommand.CreateParameter();
                dbParameter.ParameterName = parameterNames[parameterIndex];
                dbParameter.SetValue(parameterValues[parameterIndex]);
                dbCommand.Parameters.Add(dbParameter);
            }
        }

        /// <summary>
        /// Runs a direct scalar command
        /// </summary>
        /// <param name="directQuery"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public int Execute(DirectQuery directQuery, params object[] parameters)
        {
            directQuery.parameterValues = parameters;
            using (var dbCommand = directQuery.GetCommand())
            {

                // log command
                directQuery.DataContext.WriteLog(dbCommand.Command);

                var result = dbCommand.Command.ExecuteScalar();
                if (result == null || result is DBNull)
                    return 0;
                var intResult = TypeConvert.ToNumber<int>(result);
                return intResult;
            }
        }

        // TODO: move method?
        protected virtual Delegate GetTableBuilder(Type elementType, IDataReader dataReader, DataContext dataContext)
        {
            var fields = new List<string>();
            for (int fieldIndex = 0; fieldIndex < dataReader.FieldCount; fieldIndex++)
                fields.Add(dataReader.GetName(fieldIndex));
            return dataContext.QueryBuilder.GetTableReader(elementType, fields, new QueryContext(dataContext));
        }

        /// <summary>
        /// Runs a query with a direct statement
        /// </summary>
        /// <param name="tableType"></param>
        /// <param name="directQuery"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public IEnumerable ExecuteSelect(Type tableType, DirectQuery directQuery, params object[] parameters)
        {
            directQuery.parameterValues = parameters;
            using (var dbCommand = directQuery.GetCommand())
            {

                // log query
                directQuery.DataContext.WriteLog(dbCommand.Command);

                using (var dataReader = dbCommand.Command.ExecuteReader())
                {
                    // Did you know? "return EnumerateResult(tableType, dataReader, dataContext);" disposes resources first
                    // before the enumerator is used
                    foreach (var result in EnumerateResult(tableType, dataReader, directQuery.DataContext))
                        yield return result;
                }
            }
        }

        /// <summary>
        /// Enumerates results from a request.
        /// The result shape can change dynamically
        /// </summary>
        /// <param name="tableType"></param>
        /// <param name="dataReader"></param>
        /// <param name="dataContext"></param>
        /// <returns></returns>
        public IEnumerable EnumerateResult(Type tableType, IDataReader dataReader, DataContext dataContext)
        {
            return EnumerateResult(tableType, true, dataReader, dataContext);
        }

        /// <summary>
        /// Enumerates results from a request.
        /// The result shape can change dynamically
        /// </summary>
        /// <param name="tableType"></param>
        /// <param name="dynamicallyReadShape">Set True to change reader shape dynamically</param>
        /// <param name="dataReader"></param>
        /// <param name="dataContext"></param>
        /// <returns></returns>
        protected virtual IEnumerable EnumerateResult(Type tableType, bool dynamicallyReadShape, IDataReader dataReader, DataContext dataContext)
        {
            Delegate tableBuilder = null;
            while (dataReader.Read())
            {
                if (tableBuilder == null || dynamicallyReadShape)
                    tableBuilder = GetTableBuilder(tableType, dataReader, dataContext);
                var row = tableBuilder.DynamicInvoke(dataReader, dataContext._MappingContext);
                row = GetUniqueRow(row, tableType, dataContext);
                yield return row;
            }
        }
    }
}


text:
package jycraft.plugin.impl;

import jycraft.plugin.JyCraftPlugin;
import jycraft.plugin.interpreter.PyContext;
import org.python.core.PyException;
import org.python.util.InteractiveInterpreter;

import java.io.File;

public class FileRunnable implements Runnable {
    private final JyCraftPlugin plugin;
    private final boolean exec;
    private final InteractiveInterpreter interpreter;
    private final File script;
    private final TaskResult result;

    public FileRunnable(JyCraftPlugin plugin, InteractiveInterpreter interpreter, File script, boolean exec) {
        this.plugin = plugin;
        this.exec = exec;
        this.script = script;
        this.result = new TaskResult();
        this.interpreter = interpreter;
    }

    @Override
    public void run() {
        try {
            PyContext.setPlugin(this.plugin);
            if (exec) {
                interpreter.execfile(this.script.getAbsolutePath());
            }
        } catch (PyException e){
            result.exception = e;
        } finally {
            PyContext.setPlugin(null);
            synchronized (result){
                result.done = true;
                result.notifyAll();
            }
        }
    }

    public boolean more() throws InterruptedException, PyException{
        synchronized (result) {
            while (!result.done) {
                result.wait();
            }
        }
        // if an exception occurs in the main thread throw it on the web-socket thread
        if(result.exception != null)
            throw result.exception;
        return result.more;
    }
}

redpajama_set_name: RedPajamaGithub


text:
from tempfile import mkdtemp
from settings import *

INSTALLED_APPS += [
    'multipleindex',
]

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
        'URL': 'http://localhost:8983/solr',
    },
    'whoosh': {
        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
        'PATH': mkdtemp(prefix='haystack-multipleindex-whoosh-tests-'),
        'EXCLUDED_INDEXES': ['multipleindex.search_indexes.BarIndex'],
    },
    'filtered_whoosh': {
        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
        'PATH': mkdtemp(prefix='haystack-multipleindex-filtered-whoosh-tests-'),
        'EXCLUDED_INDEXES': ['multipleindex.search_indexes.BarIndex'],
    },
}

HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'


text:
package com.osbcp.csssquasher;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.osbcp.cssparser.PropertyValue;
import com.osbcp.cssparser.Rule;
import com.osbcp.cssparser.Selector;

/**
 * Main logic for refactoring rules.
 *
 * Meaning moving property values between rules to minimize the size.
 *
 * @author Christoffer Pettersson
 */

class LogicRefactor {

	private final StringBuilder log;
	private Map<PropertyValue, List<List<Selector>>> entries = new LinkedHashMap<PropertyValue, List<List<Selector>>>();
	private int fixed;

	/**
	 * Creates the refactor.
	 * @param log For logging.
	 */

	public LogicRefactor(final StringBuilder log) {
		this.log = log;
	}

	/**
	 * Main logic.
	 *
	 * @param rules List of rules that should be refactored.
	 * @return A List of rules that are refactored.
	 */

	public List<Rule> refactor(final List<Rule> rules) {

		for (Rule rule : rules) {

			for (PropertyValue propertyValue : rule.getPropertyValues()) {

				register(propertyValue, rule.getSelectors());

			}

		}

		for (Entry<PropertyValue, List<List<Selector>>> entry : entries.entrySet()) {

			PropertyValue propertyValueKeyString = entry.getKey();
			List<List<Selector>> selectors = entry.getValue();

			if (selectors.size() < 2) {
				continue;
			}

			int selectorNameLength = getSelectorNameLength(selectors);

			// If the size is ok, create a new rule
			if (selectorNameLength < propertyValueKeyString.toString().length()) {

				//				System.out.println("property=" + propertyValueKeyString);
				//				System.out.println("selectors=" + selectors);
				log.append("Refactoring the property '" + propertyValueKeyString + "'.\n");
				fixed++;

				deletePropertyValueFromSelectors(rules, propertyValueKeyString);

				//				selectors.add(new Selector("LOLZ"));

				List<Selector> mmm = new ArrayList<Selector>();
				for (List<Selector> ss : selectors) {
					for (Selector s : ss) {
						mmm.add(s);
					}
				}

				Rule rule = new Rule(mmm);
				rule.addPropertyValue(propertyValueKeyString);

				rules.add(rule);

			}

		}

		return rules;

	}

	/**
	 * Deletes property values from all rules that may have those values.
	 *
	 * @param rules A list of rules to go through.
	 * @param propertyValue Property value that should be removed from the rules.
	 */

	private void deletePropertyValueFromSelectors(final List<Rule> rules, final PropertyValue propertyValue) {

		final List<Rule> rulesToBeRemoved = new ArrayList<Rule>();

		for (Rule rule : rules) {

			Set<PropertyValue> values = new HashSet<PropertyValue>(rule.getPropertyValues());

			for (PropertyValue pv : values) {

				if (pv.equals(propertyValue)) {
					rule.removePropertyValue(pv);
				}

			}

			if (rule.getPropertyValues().size() == 0) {
				rulesToBeRemoved.add(rule);
			}

		}

		for (Rule rule : rulesToBeRemoved) {
			rules.remove(rule);
		}

	}

	/**
	 * Get the total number of selectors.
	 *
	 * @param selectors The nested list of selectors to search through.
	 * @return The total number of selectors.
	 */

	private int getSelectorNameLength(final List<List<Selector>> selectors) {

		int length = 0;

		for (List<Selector> s1 : selectors) {
			for (Selector s2 : s1) {

				length += s2.toString().length();
			}
		}

		return length;
	}

	/**
	 * Registers selectors associated with a property value.
	 *
	 * @param propertyValue The property value.
	 * @param selector The selectors that should be registered.
	 */

	public void register(final PropertyValue propertyValue, final List<Selector> selector) {

		List<List<Selector>> selectors = entries.get(propertyValue);

		if (selectors == null) {
			selectors = new ArrayList<List<Selector>>();
			entries.put(propertyValue, selectors);
		}

		selectors.add(selector);

	}

	/**
	 * Returns the number of refactored rules.
	 *
	 * @return The number of refactored rules.
	 */

	public int getNumberOfRefactored() {
		return fixed;
	}

}


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

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of obl:tmod in UD_English-PUD</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_English-PUD: Relations: obl:tmod

This relation is a language-specific subtype of <tt>obl</tt>.
There are also 1 other language-specific subtypes of obl: <tt>obl:npmod</tt>.

18 nodes (0%) are attached to their parents as obl:tmod.

11 instances of obl:tmod (61%) are left-to-right (parent precedes child).
Average distance between parent and child is 4.44444444444444.

The following 3 pairs of parts of speech are connected with obl:tmod: <tt>VERB</tt>-<tt>NOUN</tt> (16; 89% instances), <tt>ADJ</tt>-<tt>NOUN</tt> (1; 6% instances), <tt>NOUN</tt>-<tt>NOUN</tt> (1; 6% instances).

# visual-style 12	bgColor:blue
# visual-style 12	fgColor:white
# visual-style 6	bgColor:blue
# visual-style 6	fgColor:white
# visual-style 6 12 obl:tmod	color:blue
1	A	a	DET	DT	Definite=Ind|PronType=Art	3	det	3:det	_
2	keen	keen	ADJ	JJ	Degree=Pos	3	amod	3:amod	_
3	guitarist	guitarist	NOUN	NN	Number=Sing	6	dislocated	6:dislocated	SpaceAfter=No
4	,	,	PUNCT	,	_	6	punct	6:punct	_
5	he	he	PRON	PRP	Case=Nom|Gender=Masc|Number=Sing|Person=3|PronType=Prs	6	nsubj	6:nsubj	_
6	played	play	VERB	VBD	Mood=Ind|Tense=Past|VerbForm=Fin	0	root	0:root	_
7	a	a	DET	DT	Definite=Ind|PronType=Art	8	det	8:det	_
8	concert	concert	NOUN	NN	Number=Sing	6	obj	6:obj	_
9	there	there	ADV	RB	PronType=Dem	6	advmod	6:advmod	_
10	the	the	DET	DT	Definite=Def|PronType=Art	12	det	12:det	_
11	same	same	ADJ	JJ	Degree=Pos	12	amod	12:amod	_
12	year	year	NOUN	NN	Number=Sing	6	obl:tmod	6:obl:tmod	SpaceAfter=No
13	.	.	PUNCT	.	_	6	punct	6:punct	_

# visual-style 10	bgColor:blue
# visual-style 10	fgColor:white
# visual-style 6	bgColor:blue
# visual-style 6	fgColor:white
# visual-style 6 10 obl:tmod	color:blue
1	Our	we	PRON	PRP$	Number=Plur|Person=1|Poss=Yes|PronType=Prs	2	nmod:poss	2:nmod:poss	_
2	cellphones	cellphone	NOUN	NNS	Number=Plur	6	nsubj	6:nsubj	_
3	are	be	AUX	VBP	Mood=Ind|Tense=Pres|VerbForm=Fin	6	cop	6:cop	_
4	so	so	ADV	RB	_	5	advmod	5:advmod	_
5	much	much	ADV	RB	_	6	advmod	6:advmod	_
6	more	more	ADJ	JJR	Degree=Cmp	0	root	0:root	_
7	than	than	ADP	IN	_	8	case	8:case	_
8	phones	phone	NOUN	NNS	Number=Plur	6	obl	6:obl:than	_
9	these	these	DET	DT	Number=Plur|PronType=Dem	10	det	10:det	_
10	days	day	NOUN	NNS	Number=Plur	6	obl:tmod	6:obl:tmod	SpaceAfter=No
11	.	.	PUNCT	.	_	6	punct	6:punct	_

# visual-style 1	bgColor:blue
# visual-style 1	fgColor:white
# visual-style 8	bgColor:blue
# visual-style 8	fgColor:white
# visual-style 8 1 obl:tmod	color:blue
1	Today	today	NOUN	NN	Number=Sing	8	obl:tmod	8:obl:tmod	SpaceAfter=No
2	,	,	PUNCT	,	_	8	punct	8:punct	_
3	Khanzir	Khanzir	PROPN	NNP	Number=Sing	8	nsubj	8:nsubj	_
4	may	may	AUX	MD	VerbForm=Fin	8	aux	8:aux	_
5	be	be	AUX	VB	VerbForm=Inf	8	cop	8:cop	_
6	a	a	DET	DT	Definite=Ind|PronType=Art	8	det	8:det	_
7	lonely	lonely	ADJ	JJ	Degree=Pos	8	amod	8:amod	_
8	pig	pig	NOUN	NN	Number=Sing	0	root	0:root	SpaceAfter=No
9	,	,	PUNCT	,	_	8	punct	8:punct	_
10	but	but	CCONJ	CC	_	15	cc	15:cc	_
11	he	he	PRON	PRP	Case=Nom|Gender=Masc|Number=Sing|Person=3|PronType=Prs	15	nsubj	15:nsubj	_
12	is	be	AUX	VBZ	Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin	15	cop	15:cop	SpaceAfter=No
13	n't	n't	ADV	RB	Polarity=Neg	15	advmod	15:advmod	_
14	always	always	ADV	RB	_	15	advmod	15:advmod	_
15	alone	alone	ADJ	JJ	Degree=Pos	8	conj	8:conj:but	SpaceAfter=No
16	.	.	PUNCT	.	_	8	punct	8:punct	_

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
require 'spec_helper'

describe Dummy do
  let(:dummy) { described_class.new(latitude: 7, longitude: 11) }

  it { expect(dummy).to respond_to(:coordinates) }

  it { expect(dummy).to respond_to(:latitude) }
  it { expect(dummy).to respond_to(:latitude=) }
  it { expect(dummy).to respond_to(:latitude_will_change!) }
  it { expect(dummy).to respond_to(:latitude_changed?) }

  it { expect(dummy).to respond_to(:longitude) }
  it { expect(dummy).to respond_to(:longitude=) }
  it { expect(dummy).to respond_to(:longitude_will_change!) }
  it { expect(dummy).to respond_to(:longitude_changed?) }

  describe '#latitude' do
    it { expect(dummy.latitude).to eq 7 }
  end

  describe '#longitude' do
    it { expect(dummy.longitude).to eq 11 }
  end

  describe '#latitude=' do
    it { expect { dummy.latitude = 14 }.to change { dummy.latitude }.from(7).to(14) }
  end

  describe '#longitude=' do
    it { expect { dummy.longitude = 22 }.to change { dummy.longitude }.from(11).to(22) }
  end

  describe '#latitude_will_change!' do
    before { dummy.latitude_will_change! }

    it { expect(dummy).to be_latitude_changed }
  end

  describe '#longitude_will_change!' do
    before { dummy.longitude_will_change! }

    it { expect(dummy).to be_longitude_changed }
  end

  context 'when is new record' do
    describe 'latitude_changed?' do
      it { expect(dummy).to be_latitude_changed }
    end

    describe 'longitude_changed?' do
      it { expect(dummy).to be_longitude_changed }
    end
  end

  context 'when record is persisted' do
    let(:dummy) { described_class.create(latitude: 7, longitude: 11) }

    describe 'latitude_changed?' do
      context 'when latitude is changed' do
        before { dummy.latitude = 7 }

        it { expect(dummy).not_to be_latitude_changed }
      end

      context 'when latitude is changed' do
        before { dummy.latitude = 14 }

        it { expect(dummy).to be_latitude_changed }
      end
    end

    describe 'longitude_changed?' do
      context 'when longitude is changed' do
        before { dummy.longitude = 11 }

        it { expect(dummy).not_to be_longitude_changed }
      end

      context 'when longitude is changed' do
        before { dummy.longitude = 22 }

        it { expect(dummy).to be_longitude_changed }
      end
    end
  end
end


text:
package com.carlosdelachica.sample.fragments;

import android.graphics.Point;
import android.os.Bundle;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import com.carlosdelachica.easyrecycleradapters.adapter.EasyRecyclerAdapter;
import com.carlosdelachica.easyrecycleradapters.sample.R;
import com.carlosdelachica.sample.adapter.view_holder_factories.CustomViewHolderFactory;
import com.carlosdelachica.sample.adapter.view_holders.ImageEasyViewHolder;
import com.carlosdelachica.sample.data.DataGenerator;
import com.carlosdelachica.sample.data.ImageData;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;

import static com.carlosdelachica.easyrecycleradapters.adapter.EasyViewHolder.OnItemClickListener;
import static com.carlosdelachica.easyrecycleradapters.adapter.EasyViewHolder.OnItemLongClickListener;

public class CustomViewHolderFactoryFragment extends Fragment implements OnItemLongClickListener,
        OnItemClickListener {

    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;

    private EasyRecyclerAdapter adapter;

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.simple_recycler_view_layout, container, false);
        ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initUI();
        initData();
    }

    private void initUI() {
        initAdapter();
        initRecyclerView();
    }

    private void initAdapter() {
        adapter = new EasyRecyclerAdapter(
                new CustomViewHolderFactory(getActivity()),
                ImageData.class,
                ImageEasyViewHolder.class);
        adapter.setOnClickListener(this);
        adapter.setOnLongClickListener(this);
    }

    private void initRecyclerView() {
        recyclerView.setLayoutManager(new GridLayoutManager(getActivity(), getResources().getInteger(R.integer.grid_columns)));
        recyclerView.setAdapter(adapter);
        recyclerView.addItemDecoration(new DividerItemDecoration(requireActivity(), DividerItemDecoration.HORIZONTAL));
    }

    private void initData() {
        Display display = requireActivity().getWindowManager().getDefaultDisplay();
        Point size = new Point();
        display.getSize(size);
        int width = size.x;
        int grid_columns = getResources().getInteger(R.integer.grid_columns);
        adapter.addAll(DataGenerator.generateRandomImageDataList(width / grid_columns));
    }

    @Override
    public boolean onLongItemClicked(int position, View view) {
        Toast.makeText(getActivity(), "item long selected " + position, Toast.LENGTH_SHORT).show();
        return true;
    }

    @Override
    public void onItemClick(int position, View view) {
        Toast.makeText(getActivity(), "item selected " + position, Toast.LENGTH_SHORT).show();
    }

}


text:
using System.IO;
using System.Security.Cryptography.X509Certificates;
using Guardtime.Ksi.Samples.Properties;
using Guardtime.KSI.Crypto.Microsoft.Crypto;
using Guardtime.KSI.Publication;
using Guardtime.KSI.Service;
using Guardtime.KSI.Signature;
using Guardtime.KSI.Trust;
using Guardtime.KSI;
using Guardtime.KSI.Crypto.Microsoft;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Guardtime.Ksi.Samples
{
    [TestClass]
    public class KsiSamples
    {
        private static readonly KSI.Ksi Ksi;
        private static readonly IKsiService KsiService;
        private static readonly CertificateSubjectRdnSelector CertificateSubjectRdnSelector;

        static KsiSamples()
        {
            // The end point URL of the Aggregation service, needed for signing, e.g. http://host.net:8080/gt-signingservice.
            string signingServiceUrl = Settings.Default.HttpSigningServiceUrl;

            // The end point URL of the Extender service, needed for extending signature, e.g. *http://host.net:8081/gt-extendingservice
            string extendingServiceUrl = Settings.Default.HttpExtendingServiceUrl;

            // The publications file URL, needed for signature verification, e.g. http://verify.guardtime.com/ksi-publications.bin
            string publicationsFileUrl = Settings.Default.HttpPublicationsFileUrl;

            // The credentials to access the KSI signing service
            ServiceCredentials signingServiceCredentials =
                new ServiceCredentials(Settings.Default.HttpSigningServiceUser, Settings.Default.HttpSigningServicePass);

            // The credentials to access the KSI extending service
            ServiceCredentials extendingServiceCredentials =
                new ServiceCredentials(Settings.Default.HttpExtendingServiceUser, Settings.Default.HttpExtendingServicePass);

            HttpKsiServiceProtocol ksiServiceProtocol = new HttpKsiServiceProtocol(signingServiceUrl,
                extendingServiceUrl, publicationsFileUrl);

            // Certificate selector, used to filter which certificates are trusted when verifying the RSA signature.
            // We only trust certificates, that have issued to the particular e-mail address
            CertificateSubjectRdnSelector = new CertificateSubjectRdnSelector("E=publications@guardtime.com");

            // This is the KSI context which holds the references to the Aggregation service, Extender
            // service and other configuration data to perform the various operations.
            KsiService =
                new KsiService(
                    ksiServiceProtocol,
                    signingServiceCredentials,
                    ksiServiceProtocol,
                    extendingServiceCredentials,
                    ksiServiceProtocol,
                    new PublicationsFileFactory(new PkiTrustStoreProvider(new X509Store(StoreName.Root), CertificateSubjectRdnSelector)));

            Ksi = new KSI.Ksi(GetKsiService());

            // Set crypto provider to be used. Currently MicrosoftCryptoProvider and BouncyCastleCryptoProvider are available.
            KsiProvider.SetCryptoProvider(new MicrosoftCryptoProvider());
        }

        protected static CertificateSubjectRdnSelector GetCertificateSubjectRdnSelector()
        {
            return CertificateSubjectRdnSelector;
        }

        protected static IKsiService GetKsiService()
        {
            return KsiService;
        }

        protected static KSI.Ksi GetKsi()
        {
            return Ksi;
        }

        /// <summary>
        /// Load extended signature from file
        /// </summary>
        /// <returns></returns>
        protected static IKsiSignature LoadExtendedSignature()
        {
            IKsiSignature signature;
            using (FileStream stream = new FileStream("Resources/infile_2016-02-14-extended.ksig", FileMode.Open))
            {
                signature = new KsiSignatureFactory().Create(stream);
            }
            return signature;
        }

        /// <summary>
        /// Load unextended signature from file
        /// </summary>
        /// <returns></returns>
        protected static IKsiSignature LoadUnextendedSignature()
        {
            IKsiSignature signature;
            using (FileStream stream = new FileStream("Resources/infile_2016-02-14.ksig", FileMode.Open))
            {
                signature = new KsiSignatureFactory().Create(stream);
            }
            return signature;
        }
    }
}


text:
from django.conf import settings
from django.urls import reverse
from django.utils.translation import activate

class VinaigretteAdminLanguageMiddleware(object):
    """
    Use this middleware to ensure the admin is always running under the
    default language, to prevent vinaigrette from clobbering the registered
    fields with the user's picked language in the change views. Also make
    sure that this is after any LocaleMiddleware like classes.
    """

    def __init__(self, get_response=None):
        self.get_response = get_response

    def __call__(self, request):
        self.process_request(request)
        return self.get_response(request)

    def is_admin_request(self, request):
        """Returns True if this request is for the admin views"""
        return request.path.startswith(reverse('admin:index'))

    def process_request(self, request):
        if self.is_admin_request(request):
            # We are in the admin site
            activate(settings.LANGUAGE_CODE)


text:
<?php
namespace NoizuLabs\FragmentedKeys;

/**
 * The various key groups are merged together to form our final cache key.
 */
interface IKeyRing
{
    public function __construct(array $globalOptions, array $globalTagOptions, $defaultCacheHandler = "default", array $cacheHandlers = array(), $defaultPrefix = null);
    public function setTagOptions($tag, array $options) ;
    public function setGlobalOptions(array $options);
    public function getTagOptions($tag, $options);
    public function getGlobalOptions();
    public function DefineKey($key, array $params, array $globals = array());
}


text:
package server

import (
	"log"
	"net/http"
	"reflect"

	"github.com/go-martini/martini"
	"github.com/martini-contrib/gzip"
	"github.com/martini-contrib/render"

	"SimpleReader/server/models/storage"
)

type Server struct {
	martini *martini.ClassicMartini
	Host    string
}

func CreateServer(host string) *Server {
	s := storage.GetStorage()
	s.SetPath("db/storage")

	server := Server{}
	r := martini.NewRouter()
	m := martini.New()
	//m.Use(martini.Logger())
	m.Use(gzip.All())
	m.Use(martini.Recovery())
	m.Use(martini.Static("public"))
	m.MapTo(r, (*martini.Routes)(nil))
	m.Action(r.Handle)

	server.martini = &martini.ClassicMartini{m, r}
	server.martini.Use(storage.Sessions())
	server.martini.Use(martini.Static("db/storage/"))
	views := "views"
	// if martini.Env == martini.Dev {
	// 	views = "server/server/" + views
	// }
	server.martini.Use(render.Renderer(render.Options{Directory: views, Extensions: []string{".go.html", ".html"}}))
	server.martini.MapTo(s, (*storage.Storages)(nil))
	server.Host = host
	return &server
}

func (s *Server) GetMartini() *martini.ClassicMartini {
	return s.martini
}

func (s *Server) AddControler(controler interface{}) {
	if c, ok := controler.(Controller); ok {
		c.InitController(s)
	} else {
		panic(reflect.TypeOf(controler).String() + " not implement Controller interface")
	}
}

func (s *Server) Run() {
	log.Fatalln(http.ListenAndServe(s.Host, s.martini))
}


text:
package com.icrany.dao;

import java.util.List;

import com.icrany.pojo.Comment;

public interface CommentDao {
	public boolean insert(Comment entity);
	public boolean delete(Comment entity);
	public Comment findById(int id);
	public List<Comment> findAllComment();
	public List<Comment> findNewestComment();
	public List<Comment> findByArticleId(int articleId);
	public boolean update(Comment entity);
	public boolean updateAttribute(String name,Comment entity);
}


text:
using UnityEngine;

namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody
{
    [TaskCategory("Basic/Rigidbody")]
    [TaskDescription("Stores the mass of the Rigidbody. Returns Success.")]
    public class GetMass : Action
    {
        [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
        public SharedGameObject targetGameObject;
        [Tooltip("The mass of the Rigidbody")]
        [RequiredField]
        public SharedFloat storeValue;

        // cache the rigidbody component
        private Rigidbody rigidbody;
        private GameObject prevGameObject;

        public override void OnStart()
        {
            var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
            if (currentGameObject != prevGameObject) {
                rigidbody = currentGameObject.GetComponent<Rigidbody>();
                prevGameObject = currentGameObject;
            }
        }

        public override TaskStatus OnUpdate()
        {
            if (rigidbody == null) {
                Debug.LogWarning("Rigidbody is null");
                return TaskStatus.Failure;
            }

            storeValue.Value = rigidbody.mass;

            return TaskStatus.Success;
        }

        public override void OnReset()
        {
            targetGameObject = null;
            storeValue = 0;
        }
    }
}


text:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Uniduino;
using Uniduino.Helpers;

#if (UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5)
public class UniduinoTestPanel : Uniduino.Examples.UniduinoTestPanel { }
#endif

namespace Uniduino.Examples
{

	/// <summary>
	/// Uniduino TestPanel - a GUI tool for easy visualization and manipulation of I/O functions
	/// </summary>
public class UniduinoTestPanel : MonoBehaviour {

	public GUISkin skin;
	public Arduino arduino;

	void Start () {

		if (!UniduinoSetupHelpers.SerialPortAvailable())
		{
#if UNITY_EDITOR

			UniduinoSetupHelpers.OpenSetupWindow();
#else
			Debug.LogError("Uniduino SerialPort Support must be installed: is libMonoPosixHelper on your path?");
#endif
		}

		arduino = Arduino.global; 						// convenience, alias the global arduino singleton
		arduino.Log = (s) => Debug.Log("Arduino: " +s); // Attach arduino logs to Debug.Log
		hookEvents();									// set up event callbacks for received data

	}

	List<Arduino.Pin> received_pins;

	protected void hookEvents()
	{
		arduino.AnalogDataReceived += delegate(int pin, int value)
		{
			Debug.Log("Analog data received: pin " + pin.ToString() + "=" + value.ToString());
		};

		arduino.DigitalDataReceived += delegate(int portNumber, int portData)
		{
			Debug.Log("Digital data received: port " + portNumber.ToString() + "=" + System.Convert.ToString(portData, 2));
		};

		arduino.VersionDataReceived += delegate(int majorVersion, int minorVersion)
		{
			Debug.Log("Version data received");
			arduino.queryCapabilities();
		};

		arduino.CapabilitiesReceived += delegate(List<Arduino.Pin> pins)
		{
			Debug.Log("Pin capabilities received");
			received_pins = pins; // cache the complete pin list here so we can use it without worrying about it being complete yet

		};

		//arduino.reportVersion(); // some boards (like the micro) do not send the version right away for some reason. perhaps a timing issue.

	}

	protected void connect()
	{
		//Debug.Log ("Connectiong to arduino at " + PortName + "...");
		//try {

			arduino.Connect();

		/*} catch ( Exception e)
		{
			Debug.Log("Exception initializing arduino:" + e.ToString());
		}*/
	}

	Coroutine blinker;
	int label_column_width = 100;
	int test_column_width = 70;
	Vector2 scroll_position = new Vector2(0,0);
	void OnGUI()
	{
		GUI.skin = skin;

		GUILayout.BeginArea(new Rect(50, 50, 2*Screen.width/2-100, Screen.height-100));
		{

			GUILayout.BeginVertical();
			{
				GUILayout.BeginHorizontal();
				{

						if (GUILayout.Button("Connect"))
						{
							connect();
						}

						if (GUILayout.Button("Disconnect"))
						{
							Debug.Log ("Closing connection to arduino");
							//try {
								arduino.Disconnect();
							/*} catch ( Exception e)
							{
								Debug.Log("Exception initializing arduino:" + e.ToString());
							}*/
							received_pins = null;
						}

						GUILayout.FlexibleSpace();

						GUILayout.Label("Serial port:");
						arduino.PortName = GUILayout.TextField(arduino.PortName);
						if (GUILayout.Button("Guess"))
						{
							string pn = Arduino.guessPortName();
							if (pn.Length > 0) arduino.PortName = pn;
						}

					}
					GUILayout.EndHorizontal();
					GUILayout.BeginHorizontal();
					{
						string connection_status;
						if (arduino != null && arduino.IsOpen && arduino.Connected)
						{
							connection_status = "Connected to Firmata protocol version " + arduino.MajorVersion + "." + arduino.MinorVersion;
							GUILayout.Label(connection_status);

						} else if (arduino != null && arduino.IsOpen)
						{
							GUILayout.Label("Connected but waiting for Firmata protocol version" );
						} else
						{
							GUILayout.Label("Not connected");
						}

						GUILayout.FlexibleSpace();
						if (GUILayout.Button("Query capabilities"))
						{
							arduino.queryCapabilities();
						}
					}
					GUILayout.EndHorizontal();

					GUILayout.Space(20);

					// draw pin states and controls
					if (received_pins != null) //arduino != null && arduino.Pins != null)
					{

						GUILayout.BeginHorizontal();
						{
							GUIStyle style = new GUIStyle(GUI.skin.label);

							style.fontSize +=3;
							style.fontStyle = FontStyle.Bold;

							GUILayout.Label("Pin:Value", style, GUILayout.Width(label_column_width));
							GUILayout.Label("Output", style, GUILayout.Width(test_column_width));
							GUILayout.Label("Modes",style, GUILayout.Width(label_column_width)); // these widths hacked due to awful unity bug in label size calculations
							GUILayout.FlexibleSpace();
							GUILayout.Label("Reporting",style, GUILayout.MinWidth(style.CalcSize(new GUIContent("Reporting")).x));
							GUILayout.Space(15);

						}
						GUILayout.EndHorizontal();

					 	scroll_position = GUILayout.BeginScrollView (scroll_position /*, GUILayout.Width (100), GUILayout.Height (100)*/);
						{

							foreach (var pin in received_pins)
							{
								drawPinGUI(pin);
							}
						}
						GUILayout.EndScrollView();

					}
				}
				GUILayout.EndVertical();
			}
			GUILayout.EndArea();

		}

		// ui states to track what states pins *should* be in.
		// currently fetching actual pin status from firmata
		// is not implemented so these are lazily updated
		// when the user changes something through the ui
		class PinUI
		{
			public bool reporting_analog;
			public bool reporting_digital;
			public bool test_state;
			public PinMode last_pin_mode = PinMode.OUTPUT;
			public string pwm_value_buffer = "";

		}

		Dictionary<Arduino.Pin, PinUI> pin_ui_states = new Dictionary<Arduino.Pin, PinUI>();

		void drawPinGUI(Arduino.Pin pin)
		{
			GUIStyle green_button = new GUIStyle(GUI.skin.button);
			green_button.normal.textColor = Color.green;

			GUIStyle gray_button = new GUIStyle(GUI.skin.button);
			gray_button.normal.textColor = Color.gray;

			bool show_analog_report_button = false;
			bool show_digital_report_button = false;

			if (!pin_ui_states.ContainsKey(pin))
				pin_ui_states[pin] = new PinUI();

			var ui = pin_ui_states[pin];

			foreach ( var pc in pin.capabilities)
			{
				if (pc.Mode == PinMode.ANALOG)
					show_analog_report_button = true;

				if (pc.Mode == PinMode.OUTPUT)
					show_digital_report_button = true;

			}

			GUILayout.BeginHorizontal();

			string label = "";

			label = "D"+pin.number.ToString() + ":" + arduino.digitalRead(pin.number).ToString();
			if (pin.analog_number >= 0)
				label += " A"+pin.analog_number.ToString() + ":" + arduino.analogRead(pin.analog_number).ToString();

			GUILayout.Label(label, GUILayout.Width(100));

			// write test
			GUILayout.BeginHorizontal(GUILayout.Width(test_column_width));

			if (ui.last_pin_mode == PinMode.OUTPUT)
			{

				if (GUILayout.Button(ui.test_state ? "HIGH": "low", ui.test_state ? green_button : gray_button, GUILayout.Width(50)))
				{
					ui.test_state = !ui.test_state;
					arduino.digitalWrite(pin.number, ui.test_state ? 1 : 0);

					// NB: this appears not to interfere input pins for now, but the semantics are not
					// well-defined so this could break later if either firmata implementation changes
					// to autamatically update the pin mode on a digitalWrite
				}
			} else if (ui.last_pin_mode == PinMode.PWM || ui.last_pin_mode == PinMode.SERVO)
			{
				float current_pwm_value;
				float.TryParse(ui.pwm_value_buffer, out current_pwm_value);
				float pwm_value = GUILayout.HorizontalSlider(current_pwm_value, 0, ui.last_pin_mode == PinMode.SERVO ? 180 : 255, GUILayout.Height(21), GUILayout.Width(50));

				if (pwm_value != current_pwm_value)
				{
					arduino.pinMode(pin.number, (int)ui.last_pin_mode);
					arduino.analogWrite(pin.number, (int)pwm_value);
					ui.pwm_value_buffer = pwm_value.ToString();
				}

				/* Old style: text entry of pwm values--could be useful for some
				ui.pwm_value_buffer = GUILayout.TextField(ui.pwm_value_buffer, GUILayout.Width(30));
				int pwm_value;
				if (GUILayout.Button("!",GUILayout.Width(20)) && int.TryParse(ui.pwm_value_buffer, out pwm_value))
				{
					arduino.pinMode(pin.number, (int)PinMode.PWM);
					arduino.analogWrite(pin.number, pwm_value);
				}
				*/

			} else
			{
				GUILayout.Label(""); // workaround unity gui silliness
			}
			GUILayout.EndHorizontal();

			foreach ( var pc in pin.capabilities)
			{

				if (GUILayout.Button(pc.Mode.ToString(), ui.last_pin_mode==pc.Mode ? green_button : gray_button))
				{
					arduino.pinMode(pin.number, pc.mode);
					ui.last_pin_mode = pc.Mode;
					if (pc.Mode == PinMode.ANALOG)
					{
						// mirror behavior of StardardFirmata. note that this behavior is different from digital ports, which do require an explicit reportDigital call to enable reporting
						ui.reporting_analog = true;
						//	arduino.reportAnalog(k, (byte)analog_pins_reporting[k]);
					}
				}
			}

			GUILayout.FlexibleSpace();

			if (show_analog_report_button)
			{
				if (GUILayout.Button("Analog", ui.reporting_analog ? green_button : gray_button ))
				{
					ui.reporting_analog = !ui.reporting_analog;
					arduino.reportAnalog(pin.analog_number, (byte)(ui.reporting_analog ? 1 : 0));
				}
			}

			if (show_digital_report_button)
			{
				if (GUILayout.Button("Digital", ui.reporting_digital ? green_button : gray_button ))
				{
					ui.reporting_digital = !ui.reporting_digital;
					arduino.reportDigital((byte)pin.port, (byte)(ui.reporting_digital ? 1 : 0));

					foreach (var p in pin_ui_states.Keys)
					{
						if (p.port == pin.port)
						{
							pin_ui_states[p].reporting_digital = ui.reporting_digital;
						}
					}
				}

			}
			GUILayout.EndHorizontal();

		}

		void OnDestroy()
		{

			if (arduino != null)
				arduino.Disconnect();
			Debug.Log("OnDestroy called");
		}

		void Update ()
		{
			if (arduino != null)
			{

			}

		}

	}
}


text:
package auth

import "github.com/onsi/ginkgo/v2"

// SIGDescribe annotates the test with the SIG label.
func SIGDescribe(text string, body func()) bool {
	return ginkgo.Describe("[sig-auth] "+text, body)
}


text:
package io.github.sifu.springbootsell.converter;

import io.github.sifu.springbootsell.dto.OrderDto;
import io.github.sifu.springbootsell.pojo.OrderMaster;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

/**
 * OrderMaster转OrderDto
 *
 * @author sifu
 */
public class OrderMasterToOrderDtoConverter {
    public static OrderDto convert(OrderMaster orderMaster) {
        OrderDto orderDto = new OrderDto();

        BeanUtils.copyProperties(orderMaster, orderDto);

        return orderDto;
    }

    public static List<OrderDto> convert(List<OrderMaster> orderMasterList) {
        return orderMasterList.stream().map(
                e -> convert(e)
        ).collect(Collectors.toList());
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <groupId>org.apache.manifoldcf</groupId>
    <artifactId>mcf-framework</artifactId>
    <version>2.4-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>mcf-api-service</artifactId>
  <name>ManifoldCF - Framework - API Service</name>
  <packaging>war</packaging>

  <dependencies>
    <!-- Internal dependencies -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>mcf-api-servlet</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>mcf-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>mcf-pull-agent</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>mcf-ui-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- web dependencies -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>${servlet-api.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- runtime dependencies -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>${slf4j.version}</version>
      <scope>runtime</scope>
    </dependency>

    <!-- database dependencies -->
    <dependency>
      <groupId>org.hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>${hsqldb.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>${postgresql.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>${mysql.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.mariadb.jdbc</groupId>
      <artifactId>mariadb-java-client</artifactId>
      <version>${mariadb.version}</version>
      <scope>runtime</scope>
    </dependency>

    <!-- jdbc connector databases -->
    <dependency>
      <groupId>net.sourceforge.jtds</groupId>
      <artifactId>jtds</artifactId>
      <version>${jtds.version}</version>
      <scope>runtime</scope>
    </dependency>

  </dependencies>
</project>


text:
package com.siyeh.ig.fixes.performance;

import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.IGQuickFixesTestCase;
import com.siyeh.ig.performance.ManualArrayCopyInspection;

public class ManualArrayCopyFixTest extends IGQuickFixesTestCase {

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    myFixture.enableInspections(new ManualArrayCopyInspection());
    myRelativePath = "performance/replace_with_system_arraycopy";
    myDefaultHint = InspectionGadgetsBundle.message("manual.array.copy.replace.quickfix");
  }

  public void testSimple() { doTest(); }
  public void testDecrement() { doTest(); }
}


text:
"use strict";

var Demo = function ( $core, $control, $self ) {

	//Create the vars
	var self =        Object.create( module, {
	core:{ 				      value:$core    	},
	control:{ 			      value:$control    },
    content:{                 value:$self       }
	});

    self.blocks = [];

	self.awake = function (){

    self.engine           = null;
    self.world            = null;

    trace("alligator");

    var container = document.getElementsByTagName("div")[0];

    var render = { element: container, context:self.content.renderer, stage:self.content.stage, controller: Matter.RenderPixi };
    var options =  { positionIterations: 6, velocityIterations: 4, enableSleeping: false, render:render };

    self.engine = Matter.Engine.create(container, options);
    self.mouseConstraint = Matter.MouseConstraint.create( self.engine);
    Matter.World.add( self.engine.world, self.mouseConstraint);
    Matter.Engine.run( self.engine);
    self.engine.world.gravity = {x:0, y:0};

    //Matter.World.add( self.engine.world );

    self.hero = Matter.Bodies.rectangle( 395, 500, 200, 200 );

    var ground = Matter.Bodies.rectangle(395, 1080, 815, 50, { isStatic: true, render: { visible: true } } );

    Matter.Events.on( self.engine, 'tick', self.focus );
    Matter.World.add( self.engine.world, [ self.hero, ground ] );

    setInterval( self.addBlock, 200 );

    $("body").keydown(function (key) {  self.keydown(   key.which ); });
    $("body").keyup(function (key)   {  self.keyup(     key.which ); });

   }

   self.keydown = function( key ){

    self.time = self.core.glob.now;

    trace("what does time look like " + self.time );

   }

   self.keyup = function( key ){

     var block = self.blocks.shift();
     if ( block == null ) return;
     Matter.World.remove( self.engine.world, [ block ] );

  };

  self.addBlock = function(){

    var rockOptions = { density: 1.004 };
    var rock = Matter.Bodies.rectangle( self.hero.position.x , self.hero.position.y + 50, 400, 20, rockOptions);
    Matter.World.add( self.engine.world, [ rock ] );

    self.blocks.push( rock );
    //self.focus();

  }

   self.focus = function( ){

   Matter.Body.applyForce( self.hero, {x:0, y:0}, {x:0, y:1} );

   var max = self.blocks.length;

   for ( var i = 0; i < max; i++ ){
    var body = self.blocks[i];
    trace("u got a body " + body );
    if ( body == null ) continue;
    Matter.Body.applyForce( body, {x:0, y:0}, {x:0, y:5} );
    }
   }

	return self;
};

exports = module.exports = Demo;


text:
/*
 * Timeline.cpp
 *
 *  Created on: 2014-2-19
 *      Author: Hali
 */

#include "Timeline.h"
#include "Frame.h"
#include <algorithm>
#include <stdio.h>

Timeline::Timeline() {
	_duration = 0;
	_scale = 1;
}

Timeline::~Timeline() {
	// TODO Auto-generated destructor stub
}

const FrameArr & Timeline::getFrameList() {
	return _frameList;
}

float Timeline::getDuration() {
	return _duration;
}

void Timeline::setDuration(float value) {
	_duration = value >= 0 ? value : 0;
}

float Timeline::getScale() {
	return _scale;
}

void Timeline::setScale(float value) {
	_scale = value >= 0 ? value : 1;
}

void Timeline::dispose() {
	int i = _frameList.size();
	while (i--) {
		_frameList[i]->dispose();
		delete _frameList[i];
	}
	_frameList.clear();
}

void Timeline::addFrame(Frame* frame) {
	if (!frame) {
		printf("[Timeline] addFrame arg == NULL is invalid!\n");
	}

	typedef FrameArr::iterator FrameArrIt;
	FrameArrIt begin = _frameList.begin();
	FrameArrIt end = _frameList.end();
	FrameArrIt it = std::find(begin, end, frame);

	if (it == end) {
		_frameList.push_back(frame);
	} else {
		printf("[Timeline] addFrame arg is already added!\n");
	}
}


text:
#ifndef	_copaas_c
#define	_copaas_c

#include "standard.h"
#include "broker.h"
#include "rest.h"
#include "occi.h"
#include "document.h"
#include "cordspublic.h"
#include "occipublisher.h"

/* 	----------------------------------------	*/
/*	Prototype Contract Negotiation Functions	*/
/* 	----------------------------------------	*/

struct	accords_configuration CoPaas = {
	0,0,
	0,0,0,0,
	(char *) 0,
	(char *) 0,
	_CORDS_DEFAULT_PUBLISHER,
	_CORDS_DEFAULT_OPERATOR,
	_CORDS_DEFAULT_USER,
	_CORDS_DEFAULT_PASSWORD,
	"http",  80,
	"xmpp",  8000,
	"domain",
	"europe",
	"copaas.xml",
	"storage",
	"copaas",
	(struct occi_category *) 0,
	(struct occi_category *) 0
	};

public	int	check_debug()		{	return(CoPaas.debug);		}
public	int	check_verbose()		{	return(CoPaas.verbose);		}
public	char *	default_publisher()	{	return(CoPaas.publisher);	}
public	char *	default_operator()	{	return(CoPaas.operator);		}
public	char *	default_tls()		{	return(CoPaas.tls);		}
public	char *	default_zone()		{	return(CoPaas.zone);		}

public	int	failure( int e, char * m1, char * m2 )
{
	if ( e )
	{
		printf("\n*** failure %u",e);
		if ( m1 )
			printf(" : %s",m1);
		if ( m2 )
			printf(" : %s",m2);
		printf(" **`\n");
	}
	return( e );
}

#include "paas_application_deployable.c"
#include "paas_application.c"
#include "paas_application_manifest.c"
#include "paas_application_version.c"
#include "paas_application_version_instance.c"
#include "paas_environment_configuration.c"
#include "paas_environment.c"
#include "paas_environment_link.c"
#include "paas_environment_node.c"
#include "paas_environment_relation.c"
#include "paas_environment_template.c"
#include "paas_environment_variable.c"

#include "occipaas_application_deployable.c"
#include "occipaas_application.c"
#include "occipaas_application_manifest.c"
#include "occipaas_application_version.c"
#include "occipaas_application_version_instance.c"
#include "occipaas_environment_configuration.c"
#include "occipaas_environment.c"
#include "occipaas_environment_link.c"
#include "occipaas_environment_node.c"
#include "occipaas_environment_relation.c"
#include "occipaas_environment_template.c"
#include "occipaas_environment_variable.c"

/*	---------------------------------------------------------------	*/
/*	c o p a a s _ c o n f i g u r a t i o n				*/
/*	---------------------------------------------------------------	*/
/*	this function loads copaas configuration			*/
/*	from the xml configuration file.				*/
/*	---------------------------------------------------------------	*/
private	void	copaas_configuration()
{
	load_accords_configuration( &CoPaas, "copaas" );
	return;
}

/*	-----------------------------------------------------	----------	*/
/*	c o p a a s _ b a n n e r				*/
/*	---------------------------------------------------------------	*/
/*	this function will be called to display module identification 	*/
/*	when launched from the command line without any parameters.	*/
/*	---------------------------------------------------------------	*/
private	int	copaas_banner()
{
	printf("\n   CompatibleOne Generic CoPaas Service : Version 2.0a.0.01");
	printf("\n   Beta Version : 10/02/2013 ");
	printf("\n   Copyright (c) 2013 Iain James Marshall, Mohamed Mohamed, Sami Yangui");
	printf("\n");
	accords_configuration_options();
	printf("\n\n");
	return(0);

}

/*	------------------------------------------- */
/*	c o p a a s _ i n i t i a l i s e	    */
/*	------------------------------------------- */

private	struct rest_server * copaas_initialise(  void * v,struct rest_server * sptr )
{
	struct	rest_extension * xptr;
	if (!( xptr = rest_add_extension( sptr ) ))
		return((struct rest_server *) 0);
	else
	{
		xptr->net = (struct connection *) 0;
		return( sptr );
	}
}

/*	-------------------------------------------	*/
/*	c o p a a s _ a u t h o r i s e 		*/
/*	------------------------------------------- 	*/
private	int	copaas_authorise(  void * v,struct rest_client * cptr, char * username, char * password )
{
	if ( strcmp( username, CoPaas.user ) )
		return(0);
	else if ( strcmp( password, CoPaas.password ) )
		return(0);
	else if (!( cptr->user = allocate_string( username ) ))
		return(0);
	else if (!( cptr->pass = allocate_string( password ) ))
		return(0);
	else	return(1);
}

/*	-------------------------------------------	*/
/*	c o p a a s _ e x t e n s i o n 		*/
/*	-------------------------------------------	*/
private	struct rest_extension * copaas_extension( void * v,struct rest_server * sptr, struct rest_extension * xptr)
{
	return( xptr );
}

/*	--------------------------------------------	*/
/*	c o p a a s _ o p e r a t i o n 		*/
/*	--------------------------------------------	*/
/*	environment and category preparation		*/
/*	--------------------------------------------	*/
private	int	copaas_operation( char * nptr )
{

	struct	occi_category * first=(struct occi_category *) 0;
	struct	occi_category * last=(struct occi_category *) 0;
	struct	occi_category * optr=(struct occi_category *) 0;

	set_autosave_cords_xlink_name("links_copaas.xml");

	rest_initialise_log( CoPaas.monitor );

	/* ---------------------------------------- */
	/* preparation of application category list */
	/* ---------------------------------------- */
	if (!( optr = occi_paas_application_builder( CoPaas.domain, "paas_application" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_application_deployable_builder( CoPaas.domain, "paas_application_deployable" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_environment_link_builder( CoPaas.domain, "paas_environment_link" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_environment_builder( CoPaas.domain, "paas_environment" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_application_manifest_builder( CoPaas.domain, "paas_application_manifest" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_environment_node_builder( CoPaas.domain, "paas_environment_node" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_application_version_builder( CoPaas.domain, "paas_application_version" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_environment_variable_builder( CoPaas.domain, "paas_environment_variable" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_environment_relation_builder( CoPaas.domain, "paas_environment_relation" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_application_version_instance_builder( CoPaas.domain, "paas_application_version_instance" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_environment_configuration_builder( CoPaas.domain, "paas_environment_configuration" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( optr = occi_paas_environment_template_builder( CoPaas.domain, "paas_environment_template" ) ))
		return( 27 );
	else if (!( optr->previous = last ))
		first = optr;
	else	optr->previous->next = optr;
	last = optr;

	if (!( CoPaas.identity ))
	{
		/* --------------------------	*/
		/* launch simple occi server 	*/
		/* --------------------------	*/
		return( occi_server(
			nptr,
			CoPaas.restport, CoPaas.tls,
			CoPaas.threads, first, (char *) 0 ) );
	}
	else
	{
		/* --------------------------------------------------------------- */
		/* publication and pricing of categories before occi server launch */
		/* --------------------------------------------------------------- */
		initialise_occi_publisher(
			CoPaas.publisher, (char*) 0, (char *) 0, (char *) 0);

		return( publishing_occi_server(
				CoPaas.user, CoPaas.password,
				CoPaas.identity,  nptr,
				CoPaas.restport, CoPaas.tls,
				CoPaas.threads, first ) );
	}
}

/*	------------------------------------------- */
/*	c o p a a s _ o p t i o n s		    */
/*	------------------------------------------- */
/*	Command line option analysis		    */
/*	------------------------------------------- */
private	int	copaas_options(int argc, char * argv[] )
{
	int	status=0;
	int	argi=0;
	char *	aptr;
	copaas_configuration();
	while ( argi < argc )
	{
		if (!( aptr = argv[++argi] ))
			break;
		else if ( *aptr == '-' )
		{
			aptr++;
			switch( *(aptr++) )
			{
			case	'v'	:
				CoPaas.verbose=1;
				continue;
			case	'd'	:
				CoPaas.debug = 0xFFFF;
				continue;
			case	'-'	:
				if (!( argi = accords_configuration_option( aptr, argi, argv )))
					break;
				else	continue;
			}
			status = 30;
			break;
		}
		else if (!( status = copaas_operation(aptr) ))
			continue;
		else	break;
	}
	return(status);
}

/*	--------------------------------------------	*/
/*	m a i n 					*/
/*	--------------------------------------------	*/
/*	Entry point from the command line		*/
/*	--------------------------------------------	*/
public	int	main(int argc, char * argv[] )
{
	if ( argc == 1 )
		return( copaas_banner() );
	else	return( copaas_options( argc, argv ) );
}

	/* ---------- */
#endif 	/* _copaas_c */
	/* ---------- */


text:
App Status
=======================

Introduction
------------

Installation
------------

Virtual Host
------------
Afterwards, set up a virtual host to point to the public/ directory of the
project and you should be ready to go!


text:
title: "Carnivore Diet: 75 Hard Challenge"
author: Austin
date: 2020-04-21 10:02
categories: [Nutrition, Carnivore]
tags: [carnivore, carnivore diet, carnivore75hard, challenge, stoicism, carnivore aurelius]
toc: false
---

Sixty something days into my carnivore journey I came across a new challenge -- enter [#carnivore75hard](https://nutritionwithjudy.com/carnivore75hard/).  I like a good challenge, be that fitness or nutrition.  30 days "sprints" can be a good way to reset, re-calibrate, and get back on track if you've fallen of the wagon or just want to re-up your motivation.

I'm also inherently skeptical of anything trendy -- movies, music, politics, etc...  However, a few things stood out to me about this challenge that I couldn't resist.

First, it's much longer than your run of the mill 4 week / 30 day challenge.  You, or at least I, can bite my lip and grind through a month of just about anything.  75 days, you're really going to have to invest.  You're going to encounter road blocks, setbacks, and a much wider variety of *challenge* in 75 days than you will in 30.  You're also much further down the road of building sustainable habits.  E.g. rather than rebound after 30 days of white-knuckling it, your establishing a routine that *"just becomes part of life."*

Second, said habits aren't just about physical wellness.  Those identified (below) will benefit your life in virtually every way.  Your physical heath and fitness will improve.  Your peer and social relationships will improve.  Your mood, metabolism, and sleep will improve.

So, what do I have to do?  For the next 75 days, on each day you'll do the following:

- Eat only meat, organs, eggs, salt, and water.
- Spend 30 minutes exercising, 15 of which *must be in the sun.*
- Write down 3 things you're grateful for.
- Fast for at least 16 hours (can include while  you're sleeping).
- Give someone a genuine compliment (in person).
    - during quarantine times, I've allowed myself to substitute this with "call someone on the phone, just to talk (with no time limit)" or "call (not text) someone tell them I was thinking of or am grateful for them."

The complete "course" (linked above) actually provides pretty good wrap around support from a behavioral science perspective.  For instance, prior to beginning ask  yourself:

- What is my "why"?  What do I want to get out of this process, specifically?  Is my motivation sufficient or superficial?  How serious am I about this?
- Plan for problems.  What are you going to do when you get cravings?  How are you going to navigate social events (you'll encounter more in 75 days than 30!)?  Don't let inconvenience turn into an excuse that leads to failure.
- Where / who do you want to be?  Where do you want to get to / achieve / accomplish in the next 1 year?  How about 5 years.  10 years?

That's all great stuff!  Stay tuned for updates on my process.  Of course, feel free to comment your responses to the above.

---

Stoic Thought for the Day:

> Enjoy when you can, and endure when you must ~ Goethe

Daily Gratitude:

- Stability
- My home
- Time in the sun


text:
#ifndef CRL_MULTISENSE_DETAILS_PORTABILITY_HH
#define CRL_MULTISENSE_DETAILS_PORTABILITY_HH

#if __cplusplus > 199711L
    // This compiler supports C++11.
    #define CRL_CONSTEXPR constexpr
#else
    // This compiler does not support C++11.
    #define CRL_CONSTEXPR const
#endif

#if __cplusplus > 199711L
    // Use C++ 11 standard language features.
    #define CRL_THREAD_LOCAL thread_local
#elif defined (__GNUC__)
    // GNU GCC uses __thread to declare thread local variables.
    #define CRL_THREAD_LOCAL __thread
#elif defined (_MSC_VER)
    // MS Visual C++ uses __declspec(thread) to declare thread local variables.
    #define CRL_THREAD_LOCAL __declspec(thread)
#else
    #error "This compiler is not yet supported. Please contact Carnegie Robotics support at http://support.carnegierobotics.com for assistance."
#endif

#if defined (__GNUC__)
    // GNU GCC uses __PRETTY_FUNCTION__ to get the undecorated name of the current function
    // with its type signature.
    #define CRL_PRETTY_FUNCTION __PRETTY_FUNCTION__
#elif defined (_MSC_VER)
    // MS Visual C++ uses __FUNCSIG__ to get the undecorated name of the current function
    #define CRL_PRETTY_FUNCTION __FUNCSIG__
#elif __STDC_VERSION >= 199901L
    // Use C99 standard macros to get the undecorated name of the current function
    #define CRL_PRETTY_FUNCTION __func__
#else
    #error "This compiler is not yet supported. Please contact Carnegie Robotics support at http://support.carnegierobotics.com for assistance."
#endif

#if !defined(MULTISENSE_API)
#if defined (_MSC_VER)
#if defined (MultiSense_EXPORTS)
#define MULTISENSE_API __declspec(dllexport)
#else
#define MULTISENSE_API __declspec(dllimport)
#endif
#else
#define MULTISENSE_API
#endif
#endif

#ifdef WIN32
#ifndef NOMINMAX
#define NOMINMAX 1
#endif

#define usleep(usec) Sleep((usec)/1000)
#endif

#ifndef WIN32
#define closesocket close
#endif

#endif /* #ifndef CRL_MULTISENSE_DETAILS_PORTABILITY_HH */


text:
from  __future__ import print_function

import os
import sys
import subprocess
import re
import difflib

import scriptCommon
from scriptCommon import catchPath

rootPath = os.path.join(catchPath, 'projects/SelfTest/Baselines')

filelocParser = re.compile(r'''
    .*/
    (.+\.[ch]pp)  # filename
    (?::|\()      # : is starting separator between filename and line number on Linux, ( on Windows
    ([0-9]*)      # line number
    \)?           # Windows also has an ending separator, )
''', re.VERBOSE)
lineNumberParser = re.compile(r' line="[0-9]*"')
hexParser = re.compile(r'\b(0[xX][0-9a-fA-F]+)\b')
durationsParser = re.compile(r' time="[0-9]*\.[0-9]*"')
timestampsParser = re.compile(r' timestamp="\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}Z"')
versionParser = re.compile(r'Catch v[0-9]+\.[0-9]+\.[0-9]+(-develop\.[0-9]+)?')
nullParser = re.compile(r'\b(__null|nullptr)\b')
exeNameParser = re.compile(r'''
    \b
    (CatchSelfTest|SelfTest)  # Expected executable name
    (?:.exe)?                 # Executable name contains .exe on Windows.
    \b
''', re.VERBOSE)
# This is a hack until something more reasonable is figured out
specialCaseParser = re.compile(r'file\((\d+)\)')

# errno macro expands into various names depending on platform, so we need to fix them up as well
errnoParser = re.compile(r'''
    \(\*__errno_location\ \(\)\)
    |
    \(\*__error\(\)\)
''', re.VERBOSE)

if len(sys.argv) == 2:
    cmdPath = sys.argv[1]
else:
    cmdPath = os.path.join(catchPath, scriptCommon.getBuildExecutable())

overallResult = 0

def diffFiles(fileA, fileB):
    with open(fileA, 'r') as file:
        aLines = [line.rstrip() for line in file.readlines()]
    with open(fileB, 'r') as file:
        bLines = [line.rstrip() for line in file.readlines()]

    shortenedFilenameA = fileA.rsplit(os.sep, 1)[-1]
    shortenedFilenameB = fileB.rsplit(os.sep, 1)[-1]

    diff = difflib.unified_diff(aLines, bLines, fromfile=shortenedFilenameA, tofile=shortenedFilenameB, n=0)
    return [line for line in diff if line[0] in ('+', '-')]

def filterLine(line):
    if catchPath in line:
        # make paths relative to Catch root
        line = line.replace(catchPath + os.sep, '')
        # go from \ in windows paths to /
        line = line.replace('\\', '/')

    # strip source line numbers
    m = filelocParser.match(line)
    if m:
        # note that this also strips directories, leaving only the filename
        filename, lnum = m.groups()
        lnum = ":<line number>" if lnum else ""
        line = filename + lnum + line[m.end():]
    else:
        line = lineNumberParser.sub(" ", line)

    # strip Catch version number
    line = versionParser.sub("<version>", line)

    # replace *null* with 0
    line = nullParser.sub("0", line)

    # strip executable name
    line = exeNameParser.sub("<exe-name>", line)

    # strip hexadecimal numbers (presumably pointer values)
    line = hexParser.sub("0x<hex digits>", line)

    # strip durations and timestamps
    line = durationsParser.sub(' time="{duration}"', line)
    line = timestampsParser.sub(' timestamp="{iso8601-timestamp}"', line)
    line = specialCaseParser.sub('file:\g<1>', line)
    line = errnoParser.sub('errno', line)
    return line

def approve(baseName, args):
    global overallResult
    args[0:0] = [cmdPath]
    if not os.path.exists(cmdPath):
        raise Exception("Executable doesn't exist at " + cmdPath)
    baselinesPath = os.path.join(rootPath, '{0}.approved.txt'.format(baseName))
    rawResultsPath = os.path.join(rootPath, '_{0}.tmp'.format(baseName))
    filteredResultsPath = os.path.join(rootPath, '{0}.unapproved.txt'.format(baseName))

    f = open(rawResultsPath, 'w')
    subprocess.call(args, stdout=f, stderr=f)
    f.close()

    rawFile = open(rawResultsPath, 'r')
    filteredFile = open(filteredResultsPath, 'w')
    for line in rawFile:
        filteredFile.write(filterLine(line).rstrip() + "\n")
    filteredFile.close()
    rawFile.close()

    os.remove(rawResultsPath)
    print()
    print(baseName + ":")
    if os.path.exists(baselinesPath):
        diffResult = diffFiles(baselinesPath, filteredResultsPath)
        if diffResult:
            print('\n'.join(diffResult))
            print("  \n****************************\n  \033[91mResults differed")
            if len(diffResult) > overallResult:
                overallResult = len(diffResult)
        else:
            os.remove(filteredResultsPath)
            print("  \033[92mResults matched")
        print("\033[0m")
    else:
        print("  first approval")
        if overallResult == 0:
            overallResult = 1

print("Running approvals against executable:")
print("  " + cmdPath)

# Standard console reporter
approve("console.std", ["~[c++11]~[!nonportable]", "--order", "lex"])
# console reporter, include passes, warn about No Assertions
approve("console.sw", ["~[c++11]~[!nonportable]", "-s", "-w", "NoAssertions", "--order", "lex"])
# console reporter, include passes, warn about No Assertions, limit failures to first 4
approve("console.swa4", ["~[c++11]~[!nonportable]", "-s", "-w", "NoAssertions", "-x", "4", "--order", "lex"])
# junit reporter, include passes, warn about No Assertions
approve("junit.sw", ["~[c++11]~[!nonportable]", "-s", "-w", "NoAssertions", "-r", "junit", "--order", "lex"])
# xml reporter, include passes, warn about No Assertions
approve("xml.sw", ["~[c++11]~[!nonportable]", "-s", "-w", "NoAssertions", "-r", "xml", "--order", "lex"])

if overallResult != 0:
    print("If these differences are expected, run approve.py to approve new baselines.")
exit(overallResult)


text:
/*************************************************************************/
/*  collision_object.cpp                                                 */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                    http://www.godotengine.org                         */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)    */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/
#include "collision_object.h"
#include "scene/scene_string_names.h"
#include "servers/physics_server.h"
void CollisionObject::_update_shapes_from_children() {

	shapes.clear();
	for (int i = 0; i < get_child_count(); i++) {

		Node *n = get_child(i);
		n->call("_add_to_collision_object", this);
	}

	_update_shapes();
}

void CollisionObject::_notification(int p_what) {

	switch (p_what) {

		case NOTIFICATION_ENTER_WORLD: {

			if (area)
				PhysicsServer::get_singleton()->area_set_transform(rid, get_global_transform());
			else
				PhysicsServer::get_singleton()->body_set_state(rid, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform());

			RID space = get_world()->get_space();
			if (area) {
				PhysicsServer::get_singleton()->area_set_space(rid, space);
			} else
				PhysicsServer::get_singleton()->body_set_space(rid, space);

			_update_pickable();
			//get space
		};

		case NOTIFICATION_TRANSFORM_CHANGED: {

			if (area)
				PhysicsServer::get_singleton()->area_set_transform(rid, get_global_transform());
			else
				PhysicsServer::get_singleton()->body_set_state(rid, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform());

		} break;
		case NOTIFICATION_VISIBILITY_CHANGED: {

			_update_pickable();

		} break;
		case NOTIFICATION_EXIT_WORLD: {

			if (area) {
				PhysicsServer::get_singleton()->area_set_space(rid, RID());
			} else
				PhysicsServer::get_singleton()->body_set_space(rid, RID());

		} break;
	}
}

void CollisionObject::_update_shapes() {

	if (!rid.is_valid())
		return;

	if (area)
		PhysicsServer::get_singleton()->area_clear_shapes(rid);
	else
		PhysicsServer::get_singleton()->body_clear_shapes(rid);

	for (int i = 0; i < shapes.size(); i++) {

		if (shapes[i].shape.is_null())
			continue;
		if (area)
			PhysicsServer::get_singleton()->area_add_shape(rid, shapes[i].shape->get_rid(), shapes[i].xform);
		else {
			PhysicsServer::get_singleton()->body_add_shape(rid, shapes[i].shape->get_rid(), shapes[i].xform);
			if (shapes[i].trigger)
				PhysicsServer::get_singleton()->body_set_shape_as_trigger(rid, i, shapes[i].trigger);
		}
	}
}

bool CollisionObject::_set(const StringName &p_name, const Variant &p_value) {
	String name = p_name;

	if (name == "shape_count") {

		shapes.resize(p_value);
		_update_shapes();
		_change_notify();

	} else if (name.begins_with("shapes/")) {

		int idx = name.get_slicec('/', 1).to_int();
		String what = name.get_slicec('/', 2);
		if (what == "shape")
			set_shape(idx, RefPtr(p_value));
		else if (what == "transform")
			set_shape_transform(idx, p_value);
		else if (what == "trigger")
			set_shape_as_trigger(idx, p_value);

	} else
		return false;

	return true;
}

bool CollisionObject::_get(const StringName &p_name, Variant &r_ret) const {

	String name = p_name;

	if (name == "shape_count") {
		r_ret = shapes.size();
	} else if (name.begins_with("shapes/")) {

		int idx = name.get_slicec('/', 1).to_int();
		String what = name.get_slicec('/', 2);
		if (what == "shape")
			r_ret = get_shape(idx);
		else if (what == "transform")
			r_ret = get_shape_transform(idx);
		else if (what == "trigger")
			r_ret = is_shape_set_as_trigger(idx);

	} else
		return false;

	return true;
}

void CollisionObject::_get_property_list(List<PropertyInfo> *p_list) const {

	p_list->push_back(PropertyInfo(Variant::INT, "shape_count", PROPERTY_HINT_RANGE, "0,256,1", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));

	for (int i = 0; i < shapes.size(); i++) {
		String path = "shapes/" + itos(i) + "/";
		p_list->push_back(PropertyInfo(Variant::OBJECT, path + "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));
		p_list->push_back(PropertyInfo(Variant::TRANSFORM, path + "transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));
		p_list->push_back(PropertyInfo(Variant::BOOL, path + "trigger", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE));
	}
}

void CollisionObject::_input_event(Node *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape) {

	if (get_script_instance()) {
		get_script_instance()->call(SceneStringNames::get_singleton()->_input_event, p_camera, p_input_event, p_pos, p_normal, p_shape);
	}
	emit_signal(SceneStringNames::get_singleton()->input_event, p_camera, p_input_event, p_pos, p_normal, p_shape);
}

void CollisionObject::_mouse_enter() {

	if (get_script_instance()) {
		get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_enter);
	}
	emit_signal(SceneStringNames::get_singleton()->mouse_entered);
}

void CollisionObject::_mouse_exit() {

	if (get_script_instance()) {
		get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_exit);
	}
	emit_signal(SceneStringNames::get_singleton()->mouse_exited);
}

void CollisionObject::_update_pickable() {
	if (!is_inside_tree())
		return;
	bool pickable = ray_pickable && is_inside_tree() && is_visible_in_tree();
	if (area)
		PhysicsServer::get_singleton()->area_set_ray_pickable(rid, pickable);
	else
		PhysicsServer::get_singleton()->body_set_ray_pickable(rid, pickable);
}

void CollisionObject::set_ray_pickable(bool p_ray_pickable) {

	ray_pickable = p_ray_pickable;
	_update_pickable();
}

bool CollisionObject::is_ray_pickable() const {

	return ray_pickable;
}

void CollisionObject::_bind_methods() {

	ClassDB::bind_method(D_METHOD("add_shape", "shape:Shape", "transform"), &CollisionObject::add_shape, DEFVAL(Transform()));
	ClassDB::bind_method(D_METHOD("get_shape_count"), &CollisionObject::get_shape_count);
	ClassDB::bind_method(D_METHOD("set_shape", "shape_idx", "shape:Shape"), &CollisionObject::set_shape);
	ClassDB::bind_method(D_METHOD("set_shape_transform", "shape_idx", "transform"), &CollisionObject::set_shape_transform);
	//    ClassDB::bind_method(D_METHOD("set_shape_transform","shape_idx","transform"),&CollisionObject::set_shape_transform);
	ClassDB::bind_method(D_METHOD("set_shape_as_trigger", "shape_idx", "enable"), &CollisionObject::set_shape_as_trigger);
	ClassDB::bind_method(D_METHOD("is_shape_set_as_trigger", "shape_idx"), &CollisionObject::is_shape_set_as_trigger);
	ClassDB::bind_method(D_METHOD("get_shape:Shape", "shape_idx"), &CollisionObject::get_shape);
	ClassDB::bind_method(D_METHOD("get_shape_transform", "shape_idx"), &CollisionObject::get_shape_transform);
	ClassDB::bind_method(D_METHOD("remove_shape", "shape_idx"), &CollisionObject::remove_shape);
	ClassDB::bind_method(D_METHOD("clear_shapes"), &CollisionObject::clear_shapes);
	ClassDB::bind_method(D_METHOD("set_ray_pickable", "ray_pickable"), &CollisionObject::set_ray_pickable);
	ClassDB::bind_method(D_METHOD("is_ray_pickable"), &CollisionObject::is_ray_pickable);
	ClassDB::bind_method(D_METHOD("set_capture_input_on_drag", "enable"), &CollisionObject::set_capture_input_on_drag);
	ClassDB::bind_method(D_METHOD("get_capture_input_on_drag"), &CollisionObject::get_capture_input_on_drag);
	ClassDB::bind_method(D_METHOD("get_rid"), &CollisionObject::get_rid);
	BIND_VMETHOD(MethodInfo("_input_event", PropertyInfo(Variant::OBJECT, "camera"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"), PropertyInfo(Variant::VECTOR3, "click_pos"), PropertyInfo(Variant::VECTOR3, "click_normal"), PropertyInfo(Variant::INT, "shape_idx")));

	ADD_SIGNAL(MethodInfo("input_event", PropertyInfo(Variant::OBJECT, "camera"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"), PropertyInfo(Variant::VECTOR3, "click_pos"), PropertyInfo(Variant::VECTOR3, "click_normal"), PropertyInfo(Variant::INT, "shape_idx")));
	ADD_SIGNAL(MethodInfo("mouse_entered"));
	ADD_SIGNAL(MethodInfo("mouse_exited"));

	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "input_ray_pickable"), "set_ray_pickable", "is_ray_pickable");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "input_capture_on_drag"), "set_capture_input_on_drag", "get_capture_input_on_drag");
}

void CollisionObject::add_shape(const Ref<Shape> &p_shape, const Transform &p_transform) {

	ShapeData sdata;
	sdata.shape = p_shape;
	sdata.xform = p_transform;
	shapes.push_back(sdata);
	_update_shapes();
}
int CollisionObject::get_shape_count() const {

	return shapes.size();
}
void CollisionObject::set_shape(int p_shape_idx, const Ref<Shape> &p_shape) {

	ERR_FAIL_INDEX(p_shape_idx, shapes.size());
	shapes[p_shape_idx].shape = p_shape;
	_update_shapes();
}

void CollisionObject::set_shape_transform(int p_shape_idx, const Transform &p_transform) {

	ERR_FAIL_INDEX(p_shape_idx, shapes.size());
	shapes[p_shape_idx].xform = p_transform;

	_update_shapes();
}

Ref<Shape> CollisionObject::get_shape(int p_shape_idx) const {

	ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), Ref<Shape>());
	return shapes[p_shape_idx].shape;
}
Transform CollisionObject::get_shape_transform(int p_shape_idx) const {

	ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), Transform());
	return shapes[p_shape_idx].xform;
}
void CollisionObject::remove_shape(int p_shape_idx) {

	ERR_FAIL_INDEX(p_shape_idx, shapes.size());
	shapes.remove(p_shape_idx);

	_update_shapes();
}

void CollisionObject::clear_shapes() {

	shapes.clear();

	_update_shapes();
}

void CollisionObject::set_shape_as_trigger(int p_shape_idx, bool p_trigger) {

	ERR_FAIL_INDEX(p_shape_idx, shapes.size());
	shapes[p_shape_idx].trigger = p_trigger;
	if (!area && rid.is_valid()) {

		PhysicsServer::get_singleton()->body_set_shape_as_trigger(rid, p_shape_idx, p_trigger);
	}
}

bool CollisionObject::is_shape_set_as_trigger(int p_shape_idx) const {

	ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), false);
	return shapes[p_shape_idx].trigger;
}

CollisionObject::CollisionObject(RID p_rid, bool p_area) {

	rid = p_rid;
	area = p_area;
	capture_input_on_drag = false;
	ray_pickable = true;
	set_notify_transform(true);
	if (p_area) {
		PhysicsServer::get_singleton()->area_attach_object_instance_ID(rid, get_instance_ID());
	} else {
		PhysicsServer::get_singleton()->body_attach_object_instance_ID(rid, get_instance_ID());
	}
	//set_transform_notify(true);
}

void CollisionObject::set_capture_input_on_drag(bool p_capture) {

	capture_input_on_drag = p_capture;
}

bool CollisionObject::get_capture_input_on_drag() const {

	return capture_input_on_drag;
}

CollisionObject::CollisionObject() {

	capture_input_on_drag = false;
	ray_pickable = true;
	set_notify_transform(true);
	//owner=

	//set_transform_notify(true);
}

CollisionObject::~CollisionObject() {

	PhysicsServer::get_singleton()->free(rid);
}


text:
class CrosspackAvr < Cask
  version '2013-12-16'
  sha256 '959f9bf00429a0e46e649a14d7891cb4086c9cf2d032d9f66899d6efbb628f6e'

  url "http://www.obdev.at/downloads/crosspack/CrossPack-AVR-#{version.gsub('-','')}.dmg"
  homepage 'http://www.obdev.at/products/crosspack/'
  license :unknown

  pkg 'CrossPack-AVR.pkg'
  uninstall_postflight do
    IO.popen('/usr/bin/yes | /usr/bin/sudo -E -- /usr/local/CrossPack-AVR/uninstall && /usr/bin/sudo -- /usr/sbin/pkgutil --forget at.obdev.CrossPack-AVR', 'r+') do |pipe|
      pipe.close_write
      while line = pipe.gets
        puts line
      end
    end
  end

  caveats do
    files_in_usr_local
    <<-EOS.undent
      CrossPack-AVR can normally install multiple versions side-by-side.
      Therefore, running install will typically install multiple versions
      of the tools in /usr/local/ (e.g. /usr/local/CrossPack-AVR-20131216).

      This cask will invoke the CrossPack-AVR uninstall script when it is
      uninstalled, removing the most recent version of the tools.
    EOS
  end
end


text:
package common.exceptions.join;

import java.io.Serializable;

import common.exceptions.CustomBaseException;

public class UnableToJoinGame extends CustomBaseException implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = -4144335932413655730L;

}


text:
!
! This file is released under terms of BSD license
! See LICENSE file for more information
!
! Simple program to test the to-loop directive
!

PROGRAM VECTOR_LOOP
  CALL claw
  CALL claw_transformed
END

! Before the transformation
SUBROUTINE claw
  INTEGER :: j
  INTEGER, DIMENSION(0:10) :: vec1

  DO j = 0, 10
    vec1(j) = j
  END DO

  !$claw expand parallel
  vec1(:) = vec1(:) + 10

  PRINT*,vec1
END SUBROUTINE claw

! Example of the transformation for development purpose
SUBROUTINE claw_transformed
  INTEGER :: i = 10
  INTEGER, DIMENSION(0:10) :: vec1
  INTEGER :: claw_induc1 ! induction variable is declared

  DO j = 0, i
    vec1(j) = j
  END DO

  ! Do stmt is inserted
  DO claw_induc1=0,i
    ! index range are replaced with arrayIndex
    vec1(claw_induc1) = vec1(claw_induc1) + 10
  END DO

  PRINT*,vec1
END SUBROUTINE claw_transformed


text:
<component name="ProjectDictionaryState">
  <dictionary name="cesar.mejia" />
</component>


text:
angular.module('cleave.js', [])
    .directive('cleave', function () {
        return {
            restrict: 'A',
            require: 'ngModel',

            scope: {
                cleave: '&',
                onInit: '&?',
                onValueChange: '&?'
            },

            compile: function () {
                return {
                    pre: function ($scope, $element, attrs, ngModelCtrl) {
                        // eslint-disable-next-line
                        $scope.instance = new Cleave($element[0], $scope.cleave());

                        if ($scope.onInit) {
                            $scope.onInit()($scope.instance);
                        }

                        ngModelCtrl.$formatters.push(function (val) {
                            $scope.instance.setRawValue(val);

                            return $scope.instance.getFormattedValue();
                        });

                        ngModelCtrl.$parsers.push(function (newFormattedValue) {
                            if ($scope.onValueChange) {
                                $scope.onValueChange()(newFormattedValue);
                            }

                            return $scope.instance.getRawValue();
                        });

                        // Recreate cleave instance if any cleave options change
                        $scope.$watch(function() {
                            return $scope.cleave();
                            // eslint-disable-next-line
                        }, function (newOptions, oldOptions) {
                            $scope.instance.destroy();
                            // eslint-disable-next-line
                            $scope.instance = new Cleave($element[0], newOptions);
                        }, true);

                        $scope.$on('$destroy', function () {

                            $scope.instance.destroy();
                            $scope.instance = null;
                        });
                    }
                };
            }
        };
    });