text:
<?xml version="1.0"?>
<question id="II_13a" module="II">
  <questionText>Look at the finger patterns below, then answer the questions. What is the same about the finger patterns?</questionText>
  <referenceAnswers>
    <referenceAnswer id="II_13a-a1" text="Both finger patterns are loops.">
      <tokens>
        <token id="II_13a_ra1">Both</token>
        <token id="II_13a_ra2">finger</token>
        <token id="II_13a_ra3">patterns</token>
        <token id="II_13a_ra4">are</token>
        <token id="II_13a_ra5">loops</token>
        <token id="II_13a_ra6">.</token>
      </tokens>
      <facets>
        <facet id="II_13a_f1" govNum="II_13a_ra3" modNum="II_13a_ra2" reltn="NMod" govText="patterns" isAssumed="true" modText="finger"/>
        <facet id="II_13a_f2" govNum="II_13a_ra3" modNum="II_13a_ra1" reltn="Quantifier" govText="patterns" isAssumed="true" modText="Both"/>
        <facet id="II_13a_f3" govNum="II_13a_ra3" modNum="II_13a_ra5" reltn="Be" govText="patterns" modText="loops"/>
      </facets>
    </referenceAnswer>
  </referenceAnswers>
  <studentAnswers>
    <studentAnswer id="II.13a.303.1" answerText="They are loop." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.391.1" answerText="One is a loop and one is arch." accuracy="irrelevant">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Diff-Arg"/>
    </studentAnswer>
    <studentAnswer id="II.13a.396.1" answerText="They are the same." accuracy="irrelevant">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Unaddressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.401.1" answerText="The both finer patterns are loop." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Expressed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.409.1" answerText="They are same loop." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.420.1" answerText="They are both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.424.1" answerText="They are loop." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.428.1" answerText="Because you look at the finger patterns." accuracy="irrelevant">
      <facetEntailment facetID="II_13a_f1" label="Expressed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Unaddressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.430.1" answerText="They are loop." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.432.1" answerText="They are both a loop." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.439.1" answerText="Loop." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Inferred"/>
    </studentAnswer>
    <studentAnswer id="II.13a.441.1" answerText="Both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.457.1" answerText="They are both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.465.1" answerText="They are both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.472.1" answerText="They are both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.474.1" answerText="They are loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.493.1" answerText="They both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.497.1" answerText="They are both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.499.1" answerText="They are both the same pattern." accuracy="irrelevant">
      <facetEntailment facetID="II_13a_f1" label="Expressed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Unaddressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.510.1" answerText="Their shape is the same." accuracy="irrelevant">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Unaddressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.524.1" answerText="They have lines." accuracy="irrelevant">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Diff-Arg"/>
    </studentAnswer>
    <studentAnswer id="II.13a.528.1" answerText="They are both arches." accuracy="contradictory">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Contra-Expr"/>
    </studentAnswer>
    <studentAnswer id="II.13a.540.1" answerText="It is the same because it has loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.541.1" answerText="Patterns below then." accuracy="irrelevant">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Unaddressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.546.1" answerText="They both have loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.556.1" answerText="They all have lines." accuracy="irrelevant">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Diff-Arg"/>
    </studentAnswer>
    <studentAnswer id="II.13a.557.1" answerText="They are both are loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.558.1" answerText="They are both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.563.1" answerText="They are both thumbs." accuracy="irrelevant">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Assumed"/>
      <facetEntailment facetID="II_13a_f3" label="Diff-Arg"/>
    </studentAnswer>
    <studentAnswer id="II.13a.564.1" answerText="Both of the finger points have a loop." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Expressed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.566.1" answerText="They are both a loop." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.571.1" answerText="They both have a loop in them." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.578.1" answerText="They are both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.596.1" answerText="They are both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.597.1" answerText="They are the same kind of finger patterns." accuracy="irrelevant">
      <facetEntailment facetID="II_13a_f1" label="Expressed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Unaddressed"/>
    </studentAnswer>
    <studentAnswer id="II.13a.615.1" answerText="They are both loops." accuracy="correct">
      <facetEntailment facetID="II_13a_f1" label="Assumed"/>
      <facetEntailment facetID="II_13a_f2" label="Expressed"/>
      <facetEntailment facetID="II_13a_f3" label="Expressed"/>
    </studentAnswer>
  </studentAnswers>
</question>


text:
<?php

namespace BDK\EnquiryBundle\DependencyInjection;

final class DriversSupported
{
    const ORM = "orm";
    const MONGODB = "mongodb";

    public static function getList()
    {
        return array(self::ORM, self::MONGODB);
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:id="@+id/origin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:gravity="center_horizontal"
        android:textAppearance="?android:attr/textAppearanceSmall" />

    <TextView
        android:id="@+id/destination"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/origin"
        android:gravity="center_horizontal"
        android:textAppearance="?android:attr/textAppearanceSmall" />

    <TextView
        android:id="@+id/distance"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/destination"
        android:layout_alignParentStart="true"
        android:layout_alignParentLeft="true"
        android:gravity="start"
        android:textAppearance="?android:attr/textAppearanceSmall" />

    <TextView
        android:id="@+id/duration"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/destination"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:gravity="end"
        android:textAppearance="?android:attr/textAppearanceSmall" />

</RelativeLayout>


text:
namespace nofx
{
	namespace Pointer
	{
		using namespace v8;

		Persistent<Function> RawPointerWrap<int>::constructor;
		Persistent<Function> RawPointerWrap<float>::constructor;
		Persistent<Function> RawPointerWrap<double>::constructor;
		Persistent<Function> RawPointerWrap<unsigned char>::constructor;
		Persistent<Function> RawPointerWrap<unsigned short>::constructor;
		Persistent<Function> RawPointerWrap<void>::constructor;
		Persistent<Function> RawPointerWrap<char>::constructor;

		void Initialize(v8::Handle<Object> target,
			v8::Handle<Value> unused,
			v8::Handle<Context> context)
		{

			RawPointerWrap<int>::Initialize(target, "intPtr", NOFX_TYPES::INTPTR);
			RawPointerWrap<float>::Initialize(target, "floatPtr", NOFX_TYPES::FLOATPTR);
			RawPointerWrap<double>::Initialize(target, "doublePtr", NOFX_TYPES::DOUBLEPTR);
			RawPointerWrap<unsigned char>::Initialize(target, "unsignedCharPtr", NOFX_TYPES::UNSIGNEDCHARPTR);
			RawPointerWrap<unsigned short>::Initialize(target, "unsignedShortPtr", NOFX_TYPES::UNSIGNEDSHORTPTR);
			RawPointerWrap<void>::Initialize(target, "voidPtr", NOFX_TYPES::VOIDPTR);
			RawPointerWrap<char>::Initialize(target, "charPtr", NOFX_TYPES::CHARPTR);

		} //!Initialize
	}
} //!namespace nofx

NODE_MODULE_CONTEXT_AWARE(nofx_pointer, nofx::Pointer::Initialize)


text:
package org.jbpm.formModeler.components.editor;

import org.slf4j.Logger;
import org.jbpm.formModeler.service.bb.mvc.taglib.formatter.Formatter;
import org.jbpm.formModeler.service.bb.mvc.taglib.formatter.FormatterException;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Named("WysiwygEditFormTemplateFormatter")
public class WysiwygEditFormTemplateFormatter extends Formatter {
    private Logger log = LoggerFactory.getLogger(WysiwygEditFormTemplateFormatter.class);

    @Inject
    private FormTemplateEditor formTemplateEditor;

    public void service(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws FormatterException {
        try {
            WysiwygFormEditor editor = WysiwygFormEditor.lookup();
            FormTemplateEditor templateEditor = formTemplateEditor;
            setAttribute("templateContent", templateEditor.getTemplateContent());
            setAttribute("templateToLoad", templateEditor.getTemplateToLoad());
            setAttribute("loadTemplate", Boolean.valueOf(templateEditor.isLoadTemplate()));
            setAttribute("genMode", templateEditor.getGenMode());
            setAttribute("formId", templateEditor.getFormId());
            setAttribute("form", templateEditor.getForm());
            renderFragment("output");
        }catch (Exception e){
            log.error("Something unexpected has happened editing Form template", e);
        }
    }
}


text:
(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define([], factory);
  } else if (typeof exports !== "undefined") {
    factory();
  } else {
    var mod = {
      exports: {}
    };
    factory();
    global.listConfig = mod.exports;
  }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function () {

  'use strict';

  var _require = require('../../globals/js/settings'),
      prefix = _require.prefix;

  module.exports = {
    context: {
      prefix: prefix
    },
    variants: [{
      name: 'default',
      label: 'Unordered',
      context: {
        tag: 'ul',
        type: 'unordered',
        displayType: 'Unordered'
      }
    }, {
      name: 'ordered',
      label: 'Ordered',
      context: {
        tag: 'ol',
        type: 'ordered',
        displayType: 'Ordered'
      }
    }, {
      name: 'ordered-native',
      label: 'Ordered native',
      context: {
        tag: 'ol',
        type: 'ordered--native',
        displayType: 'Ordered'
      }
    }]
  };
});


text:
<?php

/**
 * This code was generated by
 * \ / _    _  _|   _  _
 * | (_)\/(_)(_|\/| |(/_  v1.0.0
 * /       /
 */

namespace Twilio\Tests\Integration\Api\V2010\Account;

use Twilio\Exceptions\DeserializeException;
use Twilio\Exceptions\TwilioException;
use Twilio\Http\Response;
use Twilio\Tests\HolodeckTestCase;
use Twilio\Tests\Request;

class ConnectAppTest extends HolodeckTestCase {
    public function testFetchRequest(): void {
        $this->holodeck->mock(new Response(500, ''));

        try {
            $this->twilio->api->v2010->accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
                                     ->connectApps("CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")->fetch();
        } catch (DeserializeException $e) {}
          catch (TwilioException $e) {}

        $this->assertRequest(new Request(
            'get',
            'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps/CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json'
        ));
    }

    public function testFetchResponse(): void {
        $this->holodeck->mock(new Response(
            200,
            '
            {
                "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "authorize_redirect_url": "http://example.com/redirect",
                "company_name": "Twilio",
                "deauthorize_callback_method": "GET",
                "deauthorize_callback_url": "http://example.com/deauth",
                "description": null,
                "friendly_name": "Connect app for deletion",
                "homepage_url": "http://example.com/home",
                "permissions": [],
                "sid": "CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
            }
            '
        ));

        $actual = $this->twilio->api->v2010->accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
                                           ->connectApps("CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")->fetch();

        $this->assertNotNull($actual);
    }

    public function testUpdateRequest(): void {
        $this->holodeck->mock(new Response(500, ''));

        try {
            $this->twilio->api->v2010->accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
                                     ->connectApps("CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")->update();
        } catch (DeserializeException $e) {}
          catch (TwilioException $e) {}

        $this->assertRequest(new Request(
            'post',
            'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps/CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json'
        ));
    }

    public function testUpdateResponse(): void {
        $this->holodeck->mock(new Response(
            200,
            '
            {
                "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "authorize_redirect_url": "http://example.com/redirect",
                "company_name": "Twilio",
                "deauthorize_callback_method": "GET",
                "deauthorize_callback_url": "http://example.com/deauth",
                "description": null,
                "friendly_name": "Connect app for deletion",
                "homepage_url": "http://example.com/home",
                "permissions": [],
                "sid": "CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
            }
            '
        ));

        $actual = $this->twilio->api->v2010->accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
                                           ->connectApps("CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")->update();

        $this->assertNotNull($actual);
    }

    public function testReadRequest(): void {
        $this->holodeck->mock(new Response(500, ''));

        try {
            $this->twilio->api->v2010->accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
                                     ->connectApps->read();
        } catch (DeserializeException $e) {}
          catch (TwilioException $e) {}

        $this->assertRequest(new Request(
            'get',
            'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps.json'
        ));
    }

    public function testReadFullResponse(): void {
        $this->holodeck->mock(new Response(
            200,
            '
            {
                "connect_apps": [
                    {
                        "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                        "authorize_redirect_url": "http://example.com/redirect",
                        "company_name": "Twilio",
                        "deauthorize_callback_method": "GET",
                        "deauthorize_callback_url": "http://example.com/deauth",
                        "description": null,
                        "friendly_name": "Connect app for deletion",
                        "homepage_url": "http://example.com/home",
                        "permissions": [],
                        "sid": "CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                        "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
                    }
                ],
                "end": 0,
                "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50",
                "next_page_uri": null,
                "page": 0,
                "page_size": 50,
                "previous_page_uri": null,
                "start": 0,
                "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json"
            }
            '
        ));

        $actual = $this->twilio->api->v2010->accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
                                           ->connectApps->read();

        $this->assertGreaterThan(0, \count($actual));
    }

    public function testReadEmptyResponse(): void {
        $this->holodeck->mock(new Response(
            200,
            '
            {
                "connect_apps": [],
                "end": 0,
                "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50",
                "next_page_uri": null,
                "page": 0,
                "page_size": 50,
                "previous_page_uri": null,
                "start": 0,
                "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json"
            }
            '
        ));

        $actual = $this->twilio->api->v2010->accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
                                           ->connectApps->read();

        $this->assertNotNull($actual);
    }

    public function testDeleteRequest(): void {
        $this->holodeck->mock(new Response(500, ''));

        try {
            $this->twilio->api->v2010->accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
                                     ->connectApps("CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")->delete();
        } catch (DeserializeException $e) {}
          catch (TwilioException $e) {}

        $this->assertRequest(new Request(
            'delete',
            'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps/CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json'
        ));
    }

    public function testDeleteResponse(): void {
        $this->holodeck->mock(new Response(
            204,
            null
        ));

        $actual = $this->twilio->api->v2010->accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
                                           ->connectApps("CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")->delete();

        $this->assertTrue($actual);
    }
}


text:
%IROTATE Rotate image
%
% OUT = IROTATE(IM, ANGLE, OPTIONS) is a version of the image IM
% that has been rotated about its centre.
%
% Options::
% 'outsize',S     set size of output image to HxW where S=[W,H]
% 'crop'          return central part of image, same size as IM
% 'scale',S       scale the image size by S (default 1)
% 'extrapval',V   set background pixels to V (default 0)
% 'smooth',S      initially smooth the image with a Gaussian of standard
%                 deviation S
%
% Notes::
% - Rotation is defined with respect to a z-axis which is into the image.
% - Counter-clockwise is a positive angle.
% - The pixels in the corners of the resulting image will be undefined and
%   set to the 'extrapval'.
%
% See also ISCALE.

% Copyright (C) 1993-2011, by Peter I. Corke
%
% This file is part of The Machine Vision Toolbox for Matlab (MVTB).
%
% MVTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% MVTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with MVTB.  If not, see <http://www.gnu.org/licenses/>.

function im2 = irotate(im, angle, varargin)

    opt.outsize = [];
    opt.crop = false;
    opt.scale = 1.0;
    opt.extrapval = 0;
    opt.smooth = [];

    opt = tb_optparse(opt, varargin);

    if isfloat(im)
        is_int = false;
    else
        is_int = true;
        im = idouble(im);
    end

    if ~isempty(opt.smooth)
        im = ismooth(im, opt.smooth);
    end

    [nr,nc,np] = size(im);

    if isempty(opt.outsize)
        % output image size is determined by input size
        [Uo,Vo] = imeshgrid(im);

    else
        % else from specified size
        [Uo,Vo] = meshgrid(1:opt.outsize(1), 1:opt.outsize(2));
    end

    % create the coordinate matrices for warping
    [Ui,Vi] = imeshgrid(im);

    % rotation and scale
    R = rotz(angle);
    uc = nc/2; vc = nr/2;
    Uo2 = 1/opt.scale*(R(1,1)*(Uo-uc)+R(2,1)*(Vo-vc))+uc;
    Vo2 = 1/opt.scale*(R(1,2)*(Uo-uc)+R(2,2)*(Vo-vc))+vc;

    Uo = Uo2;
    Vo = Vo2;

    if opt.crop
        trimx = abs(nr/2*sin(angle));
        trimy = abs(nc/2*sin(angle));
        if opt.scale < 1
            trimx = trimx + nc/2*(1-opt.scale);
            trimy = trimy + nr/2*(1-opt.scale);
        end
        trimx = ceil(trimx) + 1;
        trimy = ceil(trimy) + 1;
        trimx
        trimy
        Uo = Uo(trimy:end-trimy,trimx:end-trimx);
        Vo = Vo(trimy:end-trimy,trimx:end-trimx);

    end

    for k=1:size(im,3)
        im2(:,:,k) = interp2(Ui, Vi, im(:,:,k), Uo, Vo, 'linear', opt.extrapval);
    end

    if is_int
        im2 = iint(im2);
    end


text:
if(!dojo._hasResource["tests._base.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["tests._base.fx"] = true;
dojo.provide("tests._base.fx");
if(dojo.isBrowser){
	doh.registerUrl("tests._base.fx", dojo.moduleUrl("tests", "_base/fx.html"), 15000);
}

}


text:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sum.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0"
         metadata-complete="true">

    <display-name>neo-web</display-name>
<!--
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:META-INF/spring.xml</param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>-->

    <servlet>
        <servlet-name>Way REST Service</servlet-name>
        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>jersey.config.server.provider.packages</param-name>
            <param-value>com.neo.webservice.rest.resource</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>Way REST Service</servlet-name>
        <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>
</web-app>


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_snprintf_43.cpp
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE805.string.label.xml
Template File: sources-sink-43.tmpl.cpp
*/
/*
 * @description
 * CWE: 122 Heap Based Buffer Overflow
 * BadSource:  Allocate using malloc() and set data pointer to a small buffer
 * GoodSource: Allocate using malloc() and set data pointer to a large buffer
 * Sinks: swprintf
 *    BadSink : Copy string to data using swprintf
 * Flow Variant: 43 Data flow: data flows using a C++ reference from one function to another in the same source file
 *
 * */

#include "std_testcase.h"

#include <wchar.h>

#ifdef _WIN32
#define SNPRINTF _snwprintf
#else
#define SNPRINTF swprintf
#endif

namespace CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_snprintf_43
{

#ifndef OMITBAD

static void badSource(wchar_t * &data)
{
    /* FLAW: Allocate and point data to a small buffer that is smaller than the large buffer used in the sinks */
    data = (wchar_t *)malloc(50*sizeof(wchar_t));
    if (data == NULL) {exit(-1);}
    data[0] = L'\0'; /* null terminate */
}

void bad()
{
    wchar_t * data;
    data = NULL;
    badSource(data);
    {
        wchar_t source[100];
        wmemset(source, L'C', 100-1); /* fill with L'C's */
        source[100-1] = L'\0'; /* null terminate */
        /* POTENTIAL FLAW: Possible buffer overflow if source is larger than data */
        SNPRINTF(data, 100, L"%s", source);
        printWLine(data);
        free(data);
    }
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B() uses the GoodSource with the BadSink */
static void goodG2BSource(wchar_t * &data)
{
    /* FIX: Allocate and point data to a large buffer that is at least as large as the large buffer used in the sink */
    data = (wchar_t *)malloc(100*sizeof(wchar_t));
    if (data == NULL) {exit(-1);}
    data[0] = L'\0'; /* null terminate */
}

static void goodG2B()
{
    wchar_t * data;
    data = NULL;
    goodG2BSource(data);
    {
        wchar_t source[100];
        wmemset(source, L'C', 100-1); /* fill with L'C's */
        source[100-1] = L'\0'; /* null terminate */
        /* POTENTIAL FLAW: Possible buffer overflow if source is larger than data */
        SNPRINTF(data, 100, L"%s", source);
        printWLine(data);
        free(data);
    }
}

void good()
{
    goodG2B();
}

#endif /* OMITGOOD */

} /* close namespace */

/* Below is the main(). It is only used when building this testcase on
 * its own for testing or for building a binary to use in testing binary
 * analysis tools. It is not used when compiling all the testcases as one
 * application, which is how source code analysis tools are tested.
 */

#ifdef INCLUDEMAIN

using namespace CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_snprintf_43; /* so that we can use good and bad easily */

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


text:
import {database} from './database';

export class Server {
  newNote() {
    return {
      title: 'New Note',
      body: '',
      notebookId: database.notebooks[0].id
    };
  }

  hasChanged(a, b) {
    return a.title !== b.title || a.body !== b.body || a.notebookId !== b.notebookId;
  }

  getNoteList(filter) {
    let results = filter && filter !== 'none'
      ? database.notes.filter(x => x.notebookId === parseInt(filter))
      : database.notes;

    results = results.map(x => ({
      id: x.id,
      title: x.title,
      body: x.body
    }));

    return Promise.resolve(results);
  }

  getNote(id) {
    let found = database.notes.find(x => x.id == id);
    return Promise.resolve(found ? JSON.parse(JSON.stringify(found)) : null);
  }

  getNotebookList() {
    return Promise.resolve(database.notebooks.map(x => ({
      id: x.id,
      title: x.title
    })));
  }

  saveNote(note) {
    let existing;

    if(note.id) {
      existing = database.notes.find(x => x.id === note.id);
    } else {
      existing = {id: database.nextId()};
      database.notes.push(existing);
    }

    Object.assign(existing, note);
    return Promise.resolve(JSON.parse(JSON.stringify(existing)));
  }

  createNotebook(name) {
    let notebook = {
      id: database.nextId(),
      title: name
    };

    database.notebooks.push(notebook);

    return Promise.resolve(JSON.parse(JSON.stringify(notebook)));
  }
}


text:
@interface KeyChain : NSObject

+ (int)storeWithUsername: (NSString *)Username WithPassword:(NSString *)Password;
+ (int)updateWithUsername: (NSString *)Username WithPassword:(NSString *)Password;
+ (NSDictionary *)getDataWithUsername: (NSString *)Username;

+ (void)deleteAllKeysForSecClass:(CFTypeRef)secClass;

@end


text:
extern volatile char jv_mem_uninitialised;
#endif

static void jv_mem_invalidate(void* mem, size_t n) {
#ifndef NDEBUG
  char* m = mem;
  while (n--) *m++ ^= jv_mem_uninitialised ^ jv_mem_uninitialised;
#endif
}

void* jv_mem_alloc(size_t);
void* jv_mem_alloc_unguarded(size_t);
void* jv_mem_calloc(size_t, size_t);
void* jv_mem_calloc_unguarded(size_t, size_t);
char* jv_mem_strdup(const char *);
char* jv_mem_strdup_unguarded(const char *);
void jv_mem_free(void*);
__attribute__((warn_unused_result)) void* jv_mem_realloc(void*, size_t);

#endif


text:
using System;
using System.Linq;

namespace _04.Rotate_Array_of_Strings
{
    public class Program
    {
        public static void Main()
        {
            string[] words = Console.ReadLine().Split(' ').ToArray();
            string lastWord = words[words.Length - 1];

            for (int i = words.Length - 1; i > 0; i--)
            {
                words[i] = words[i - 1];
            }

            words[0] = lastWord;
            var answer = string.Join(" ", words);

            Console.WriteLine(answer);
        }
    }
}


text:
package org.terracotta.dynamic_config.entity.topology.client;

import org.terracotta.dynamic_config.entity.topology.common.Codec;
import org.terracotta.dynamic_config.entity.topology.common.Message;
import org.terracotta.dynamic_config.entity.topology.common.Response;
import org.terracotta.entity.EntityClientEndpoint;
import org.terracotta.entity.EntityClientService;

/**
 * @author Mathieu Carbou
 */
public class DynamicTopologyEntityClientService implements EntityClientService<DynamicTopologyEntity, Void, Message, Response, DynamicTopologyEntity.Settings> {

  private final Codec messageCodec = new Codec();

  @Override
  public boolean handlesEntityType(Class<DynamicTopologyEntity> cls) {
    return DynamicTopologyEntity.class.equals(cls);
  }

  @Override
  public byte[] serializeConfiguration(Void configuration) {
    return new byte[0];
  }

  @Override
  public Void deserializeConfiguration(byte[] configuration) {
    return null;
  }

  @Override
  public DynamicTopologyEntity create(EntityClientEndpoint<Message, Response> endpoint, DynamicTopologyEntity.Settings settings) {
    return new DynamicTopologyEntityImpl(endpoint, settings);
  }

  @Override
  public Codec getMessageCodec() {
    return messageCodec;
  }
}


text:
using System;
using System.Windows.Forms;
using XenAdmin.Controls.DataGridViewEx;

namespace XenAdmin.Wizards.RollingUpgradeWizard
{
    partial class RollingUpgradeUpgradePage
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RollingUpgradeUpgradePage));
            this.linkLabel1 = new System.Windows.Forms.LinkLabel();
            this.progressBar1 = new System.Windows.Forms.ProgressBar();
            this.labelTitle = new System.Windows.Forms.Label();
            this.dataGridView1 = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx();
            this.labelOverallProgress = new System.Windows.Forms.Label();
            this.ColumnHost = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.ColumnIcon = new System.Windows.Forms.DataGridViewImageColumn();
            this.ColumnStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
            this.SuspendLayout();
            //
            // linkLabel1
            //
            resources.ApplyResources(this.linkLabel1, "linkLabel1");
            this.linkLabel1.Name = "linkLabel1";
            this.linkLabel1.TabStop = true;
            this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
            //
            // progressBar1
            //
            resources.ApplyResources(this.progressBar1, "progressBar1");
            this.progressBar1.Name = "progressBar1";
            //
            // labelTitle
            //
            resources.ApplyResources(this.labelTitle, "labelTitle");
            this.labelTitle.Name = "labelTitle";
            //
            // dataGridView1
            //
            this.dataGridView1.AllowUserToResizeColumns = false;
            resources.ApplyResources(this.dataGridView1, "dataGridView1");
            this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Window;
            this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.ColumnHost,
            this.ColumnIcon,
            this.ColumnStatus});
            this.dataGridView1.Name = "dataGridView1";
            this.dataGridView1.ReadOnly = true;
            //
            // labelOverallProgress
            //
            resources.ApplyResources(this.labelOverallProgress, "labelOverallProgress");
            this.labelOverallProgress.Name = "labelOverallProgress";
            //
            // ColumnHost
            //
            resources.ApplyResources(this.ColumnHost, "ColumnHost");
            this.ColumnHost.Name = "ColumnHost";
            this.ColumnHost.ReadOnly = true;
            this.ColumnHost.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            //
            // ColumnIcon
            //
            this.ColumnIcon.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            resources.ApplyResources(this.ColumnIcon, "ColumnIcon");
            this.ColumnIcon.Name = "ColumnIcon";
            this.ColumnIcon.ReadOnly = true;
            //
            // ColumnStatus
            //
            this.ColumnStatus.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            resources.ApplyResources(this.ColumnStatus, "ColumnStatus");
            this.ColumnStatus.Name = "ColumnStatus";
            this.ColumnStatus.ReadOnly = true;
            this.ColumnStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            //
            // RollingUpgradeUpgradePage
            //
            resources.ApplyResources(this, "$this");
            this.Controls.Add(this.labelOverallProgress);
            this.Controls.Add(this.dataGridView1);
            this.Controls.Add(this.labelTitle);
            this.Controls.Add(this.progressBar1);
            this.Controls.Add(this.linkLabel1);
            this.Name = "RollingUpgradeUpgradePage";
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private LinkLabel linkLabel1;
        private ProgressBar progressBar1;
        private Label labelTitle;
        private DataGridViewEx dataGridView1;
        private Label labelOverallProgress;
        private DataGridViewTextBoxColumn ColumnHost;
        private DataGridViewImageColumn ColumnIcon;
        private DataGridViewTextBoxColumn ColumnStatus;

    }
}


text:
<?php

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.modellist');

/**
 *
 */
class RokSprocketModelSeblodItems extends JModelList
{

    /**
     * @param array $config
     */
    public function __construct($config = array())
    {
        if (empty($config['filter_fields'])) {
            $config['filter_fields'] = array(
                'id', 'a.id',
                'title', 'a.title',
                'alias', 'a.alias',
                'checked_out', 'a.checked_out',
                'checked_out_time', 'a.checked_out_time',
                'catid', 'a.catid', 'category_title',
//                'type', 'st.title',
                'state', 'a.published',
                'access', 'a.access', 'access_level',
                'created', 'a.created',
                'created_by', 'a.created_by',
                'ordering', 'a.ordering',
                'featured', 'a.featured',
                'language', 'a.language',
                'hits', 'a.hits',
                'publish_up', 'a.publish_up',
                'publish_down', 'a.publish_down',
            );
        }

        parent::__construct($config);
    }

    /**
     * @param null $ordering
     * @param null $direction
     */
    protected function populateState($ordering = null, $direction = null)
    {
        // Initialise variables.
        $app = JFactory::getApplication();
        $session = JFactory::getSession();

        // Adjust the context to support modal layouts.
        if ($layout = JFactory::getApplication()->input->getCmd('layout')) {
            $this->context .= '.' . $layout;
        }

        $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
        $this->setState('filter.search', $search);

        $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
        $this->setState('filter.access', $access);

        $authorId = $app->getUserStateFromRequest($this->context . '.filter.author_id', 'filter_author_id');
        $this->setState('filter.author_id', $authorId);

        $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
        $this->setState('filter.published', $published);

        $categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id');
        $this->setState('filter.category_id', $categoryId);

//        $type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type');
//        $this->setState('filter.type', $type);

        $level = $this->getUserStateFromRequest($this->context . '.filter.featured', 'filter_featured', 0, 'int');
        $this->setState('filter.level', $level);

        $language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '');
        $this->setState('filter.language', $language);

        // List state information.
        parent::populateState('a.title', 'asc');
    }

    /**
     * @param string $id
     * @return string
     */
    protected function getStoreId($id = '')
    {
        // Compile the store id.
        $id .= ':' . $this->getState('filter.search');
        $id .= ':' . $this->getState('filter.access');
        $id .= ':' . $this->getState('filter.published');
        $id .= ':' . $this->getState('filter.category_id');
//        $id .= ':' . $this->getState('filter.type');
        $id .= ':' . $this->getState('filter.author_id');
        $id .= ':' . $this->getState('filter.language');

        return parent::getStoreId($id);
    }

    /**
     * @return JDatabaseQuery
     */
    protected function getListQuery()
    {
        // Create a new query object.
        $db = $this->getDbo();
        $query = $db->getQuery(true);
        $user = JFactory::getUser();
        $type = JRequest::getWord('type');

        // Select the required fields from the table.
        $query->select(
            $this->getState(
                'list.select',
                'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid' .
                    ', a.state, a.access, a.created, a.created_by, a.ordering, a.featured, a.language, a.hits' .
                    ', a.publish_up, a.publish_down'
            )
        );

        $query->from('#__content AS a');

        //Join over SeBlod Core
        $query->join('LEFT', '#__cck_core AS s ON s.pk = a.id');
        //$query->where('s.storage_location = "joomla_article"');

        //Join over SeBlod Core Types
        $query->select('st.name, st.title AS type_title');
        $query->join('LEFT', '#__cck_core_types AS st ON st.`name` = s.cck');
        if($type = JRequest::getWord('type')){
            $query->where('st.name = "'.$type.'"');
        }

        // Join over the language
        $query->select('l.title AS language_title');
        $query->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language');

        // Join over the users for the checked out user.
        $query->select('uc.name AS editor');
        $query->join('LEFT', '#__users AS uc ON uc.id=a.checked_out');

        // Join over the asset groups.
        $query->select('ag.title AS access_level');
        $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');

        // Join over the categories.
        $query->select('c.title AS category_title');
        $query->join('LEFT', '#__categories AS c ON c.id = a.catid');

        // Join over the users for the author.
        $query->select('ua.name AS author_name');
        $query->join('LEFT', '#__users AS ua ON ua.id = a.created_by');

        // Filter by access level.
        if ($access = $this->getState('filter.access')) {
            $query->where('a.access = ' . (int)$access);
        }

        // Implement View Level Access
        if (!$user->authorise('core.admin')) {
            $groups = implode(',', $user->getAuthorisedViewLevels());
            $query->where('a.access IN (' . $groups . ')');
        }

        // Filter by published state
        $published = $this->getState('filter.published');
        if (is_numeric($published)) {
            $query->where('a.state = ' . (int)$published);
        }
        elseif ($published === '') {
            $query->where('(a.state = 0 OR a.state = 1)');
        }

		// Filter by a single or group of categories.
		$baselevel = 1;
		$categoryId = $this->getState('filter.category_id');
		if (is_numeric($categoryId)) {
			$cat_tbl = JTable::getInstance('Category', 'JTable');
			$cat_tbl->load($categoryId);
			$rgt = $cat_tbl->rgt;
			$lft = $cat_tbl->lft;
			$baselevel = (int) $cat_tbl->level;
			$query->where('c.lft >= '.(int) $lft);
			$query->where('c.rgt <= '.(int) $rgt);
		}
		elseif (is_array($categoryId)) {
			JArrayHelper::toInteger($categoryId);
			$categoryId = implode(',', $categoryId);
			$query->where('a.catid IN ('.$categoryId.')');
		}

//        // Filter by type
//        $typeId = $this->getState('filter.type');
//        if (is_string($typeId) && $typeId !='') {
//            $query->where('st.name = "' . (string)$typeId .'"');
//        }

		// Filter on the level.
		if ($level = $this->getState('filter.level')) {
			$query->where('c.level <= '.((int) $level + (int) $baselevel - 1));
		}

		// Filter by author
		$authorId = $this->getState('filter.author_id');
		if (is_numeric($authorId)) {
			$type = $this->getState('filter.author_id.include', true) ? '= ' : '<>';
			$query->where('a.created_by '.$type.(int) $authorId);
		}

		// Filter by search in title.
		$search = $this->getState('filter.search');
		if (!empty($search)) {
			if (stripos($search, 'id:') === 0) {
				$query->where('a.id = '.(int) substr($search, 3));
			}
			elseif (stripos($search, 'author:') === 0) {
				$search = $db->Quote('%'.$db->escape(substr($search, 7), true).'%');
				$query->where('(ua.name LIKE '.$search.' OR ua.username LIKE '.$search.')');
			}
			else {
				$search = $db->Quote('%'.$db->escape($search, true).'%');
				$query->where('(a.title LIKE '.$search.' OR a.alias LIKE '.$search.')');
			}
		}

		// Filter on the language.
		if ($language = $this->getState('filter.language')) {
			$query->where('a.language = '.$db->quote($language));
		}

		// Add the list ordering clause.
		$orderCol	= $this->state->get('list.ordering', 'a.title');
		$orderDirn	= $this->state->get('list.direction', 'asc');
		if ($orderCol == 'a.ordering' || $orderCol == 'category_title') {
			$orderCol = 'c.title '.$orderDirn.', a.ordering';
		}
		//sqlsrv change
		if($orderCol == 'language')
			$orderCol = 'l.title';
		if($orderCol == 'access_level')
			$orderCol = 'ag.title';
//        if($orderCol == 'type')
//        	$orderCol = 'st.title';
		$query->order($db->escape($orderCol.' '.$orderDirn));

		// echo nl2br(str_replace('#__','jos_',$query));
		return $query;
	}

    /**
     * @return mixed
     */
    public function getAuthors()
    {
        // Create a new query object.
        $db = $this->getDbo();
        $query = $db->getQuery(true);

        // Construct the query
        $query->select('u.id AS value, u.name AS text');
        $query->from('#__users AS u');
        $query->join('INNER', '#__k2_items AS c ON c.created_by = u.id');
        $query->group('u.id, u.name');
        $query->order('u.name');

        // Setup the query
        $db->setQuery($query->__toString());

        // Return the result
        return $db->loadObjectList();
    }

    /**
     * @return mixed
     */
    public function getTypes()
    {
        // Create a new query object.
        $db = $this->getDbo();
        $query = $db->getQuery(true);

        // Construct the query
        $query->select('st.name AS value, st.title AS text');
        $query->from('#__cck_core_types AS st');
        $query->join('LEFT', '#__cck_core AS s ON s.cck = st.`name`');
        $query->where('s.storage_location = "joomla_article"');
        $query->order('st.title');

        // Setup the query
        $db->setQuery($query->__toString());

        // Return the result
        return $db->loadObjectList();
    }

    /**
     * @param null $row
     * @param bool $hideTrashed
     * @param bool $hideUnpublished
     * @return array|mixed
     */
    function getCategories($row = NULL, $hideTrashed = false, $hideUnpublished = true)
    {

        $db = JFactory::getDBO();
        if (isset($row->id)) {
            $idCheck = ' AND id != ' . ( int )$row->id;
        }
        else {
            $idCheck = null;
        }
        if (!isset($row->parent)) {
            $row->parent = 0;
        }
        $query = "SELECT m.* FROM #__k2_categories m WHERE id > 0 {$idCheck}";

        if ($hideUnpublished) {
            $query .= " AND published=1 ";
        }

        if ($hideTrashed) {
            $query .= " AND trash=0 ";
        }

        $query .= " ORDER BY parent, ordering";
        $db->setQuery($query);
        $mitems = $db->loadObjectList();
        $children = array();
        if ($mitems) {
            foreach ($mitems as $v) {
                $v->title = $v->name;
                $v->parent_id = $v->parent;
                $pt = $v->parent;
                $list = @$children[$pt] ? $children[$pt] : array();
                array_push($list, $v);
                $children[$pt] = $list;
            }
        }
        $list = JHtml::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
        $mitems = array();
        foreach ($list as $item) {
            $item->treename = JString::str_ireplace('  -', ' -', $item->treename);
            $item->treename = JString::str_ireplace('  ', ' -', $item->treename);

            if ($item->trash) $item->treename .= ' [**' . JText::_('K2_TRASHED_CATEGORY') . '**]';
            if (!$item->published) $item->treename .= ' [**' . JText::_('K2_UNPUBLISHED_CATEGORY') . '**]';

            $mitems[] = JHtml::_('select.option', $item->id, $item->treename);
        }
        return $mitems;
    }

    /**
     * @return mixed
     */
    public function getItems()
    {
        $items = parent::getItems();
        $app = JFactory::getApplication();
        if ($app->isSite()) {
            $user = JFactory::getUser();
            $groups = $user->getAuthorisedViewLevels();

            for ($x = 0, $count = count($items); $x < $count; $x++) {
                //Check the access level. Remove articles the user shouldn't see
                if (!in_array($items[$x]->access, $groups)) {
                    unset($items[$x]);
                }
            }
        }
        return $items;
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:insetBottom="0dp"
    android:insetLeft="0dp"
    android:insetRight="0dp"
    android:insetTop="0dp">
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
        <corners android:radius="@dimen/md_action_corner_radius" />
        <solid android:color="@color/blue_edf8fe" />
        <padding
            android:bottom="0dp"
            android:left="0dp"
            android:right="0dp"
            android:top="0dp" />
    </shape>
</inset>


text:
{-# LANGUAGE OverloadedStrings #-}

module GitCache
  ( gitClone
  , optimizeCache
  , getCacheDirs
  )
where

import NixPath.Types
import Dedup

import Control.Monad
import Control.Exception
import Data.Foldable
import Data.List.Split
import Data.Maybe
import Data.Typeable
import Data.UUID hiding (fromString)
import Data.UUID.V4
import Network.Types hiding (HEAD)
import System.Directory
import System.Environment
import System.Environment.XDG.BaseDir
import System.Exit
import System.FilePath
import System.Posix.Files
import System.Process
import System.IO (stderr)

cacheVersion :: String
cacheVersion = "002"

data GitCacheException
  = GitCmdException
  | GitFileException
  | NixPrefetchException
  deriving (Show, Typeable)

instance Exception GitCacheException

git :: [String] -> IO ()
git args = do
  let cp = (proc "git" args) { std_out = UseHandle stderr }
  (_, _, _, ph) <- createProcess cp
  ex <- waitForProcess ph
  case ex of
    ExitSuccess -> return ()
    ExitFailure _ -> throw GitCmdException

nixPrefetch :: URI -> String -> IO NixPathTarget
nixPrefetch uri sha = do
  CacheDirs { cdWts = wtsDir, cdGit = gitDir } <- getCacheDirs
  setEnv "QUIET" "1"
  setEnv "PRINT_PATH" "1"
  unsetEnv "GIT_DIR"
  let dir = "file://" ++ gitDir
  (ex,out,err) <- readProcessWithExitCode "nix-prefetch-git" [dir,sha] ""
  setEnv "GIT_DIR" gitDir
  case ex of
    ExitSuccess -> do
      let ln = joinPath [wtsDir,sha++".path"]
          storePath = last (lines out)
      createSymbolicLink storePath ln
      return (FetchedGitPath storePath uri (GitCommit sha))
    ExitFailure _ -> do
      putStrLn err
      throw NixPrefetchException

readLink :: FilePath -> IO (Maybe FilePath)
readLink ln = fmap Just (readSymbolicLink ln) `catch` handler
  where
    handler :: IOError -> IO (Maybe FilePath)
    handler _ = return Nothing

findCache :: Bool -> FilePath -> URI -> String -> IO (Maybe NixPathTarget)
findCache True wtsDir uri sha = do
  let ln = joinPath [wtsDir,sha++".path"]
  mp <- readLink ln
  flip (maybe (return Nothing)) mp $ \p -> do
    pathExists <- doesDirectoryExist p
    if pathExists
      then return (Just (FetchedGitPath p uri (GitCommit sha)))
      else do
        removeFile ln
        return Nothing
findCache False wtsDir uri sha = do
  let wt = joinPath [wtsDir,sha]
  wtExists <- doesDirectoryExist wt
  return $ FetchedGitPath wt uri (GitCommit sha) <$ guard wtExists

gitClone :: Bool -> URI -> GitRev -> IO NixPathTarget
gitClone useNixStore uri rev = do
  CacheDirs { cdWts = wtsDir, cdGit = gitDir, cdLinks = linkDir } <- getCacheDirs
  c <- case rev of
         GitCommit sha -> findCache useNixStore wtsDir uri sha
         _ -> return Nothing
  (flip . flip maybe) return c $ do
    remote <- fmap toString nextRandom
    setEnv "GIT_DIR" gitDir
    git ["init","--quiet","--bare"]
    git ["remote", "add", remote, uriToString uri]
    (sha,ref) <- resolveRev rev remote
    c' <- findCache useNixStore wtsDir uri sha
    (flip . flip maybe) return c' $ do
      gitFetch remote sha ref
      if useNixStore
        then nixPrefetch uri sha
        else gitCheckout uri linkDir gitDir remote wtsDir sha

gitFetch :: String -> String -> Maybe String -> IO ()
gitFetch remote sha ref = do
  let branch = "nixpath/"++sha
  git $ ["fetch","--no-tags",remote] ++ (maybeToList ref)
  git ["branch","--force",branch,sha]

gitCheckout :: URI -> FilePath -> FilePath -> String -> FilePath -> String -> IO NixPathTarget
gitCheckout uri linkDir gitDir remote wtsDir sha = flip onException cleanup $ do
  git ["clone","-b",branch,gitDir,tmpWt]
  removeDirectoryRecursive (combine tmpWt ".git")
  dedupDir linkDir tmpWt
  renameDirectory tmpWt wt
  return (FetchedGitPath wt uri (GitCommit sha))
  where
    branch = "nixpath/"++sha
    wt = combine wtsDir sha
    tmpWt = concat [wt,"-",remote]
    cleanup = do
      dirExists <- doesDirectoryExist tmpWt
      when dirExists (removeDirectoryRecursive tmpWt)

resolveRev :: GitRev -> String -> IO (String, Maybe String)
resolveRev HEAD = resolveSha "HEAD"
resolveRev (GitRef key val) = resolveSha $ concat ["refs/",key,"/",val]
resolveRev (GitCommit sha) = resolveRef sha

resolveRef :: String -> String -> IO (String, Maybe String)
resolveRef sha remote = do
  ls <- fmap lines $ readProcess "git" ["ls-remote",remote] ""
  let f (s:_:_) = s == sha
      f _ = False
  return (sha, fmap (!! 1) $ find f $ map (splitOn "\t") ls)

resolveSha :: String -> String -> IO (String, Maybe String)
resolveSha ref remote = do
  ls <- fmap lines $ readProcess "git" ["ls-remote",remote] ""
  let f (_:r:_) = r == ref
      f _ = False
      sha' = fmap head $ find f $ map (splitOn "\t") ls
      sha = maybe (error $ "Could not find SHA for ref "++ref) id sha'
  return (sha, Just ref)

optimizeCache :: IO ()
optimizeCache = do
  CacheDirs { cdWts = wtsDir, cdLinks = linkDir } <- getCacheDirs
  dedupDir linkDir wtsDir

getCacheDirs :: IO CacheDirs
getCacheDirs = do
  cacheDir <- getUserCacheDir "nix-path"
  [git',wts,links,tmp] <- forM ["git", "wts", "links", "tmp"] $ \d -> do
    let dir = joinPath [cacheDir,cacheVersion,d]
    createDirectoryIfMissing True dir
    return dir
  return $ CacheDirs { cdGit = git', cdWts = wts, cdLinks = links, cdTmp = tmp }


text:
<?xml version="1.0" encoding="UTF-8"?>

<unit id="2"> <!-- supply a unique integer id, which will also appear in the name of the file (we expect a number between 0 and 999 but this can be changed) -->
    <name>FilterSignal</name>
    <description>Filters the EEG data according to given parameters</description>
    <input-files>/specific/netapp5/hezi/EEGPipelineSystem/Experiments/{study}/{subject}/DataAfterManualRemoval/</input-files>
    <output-dir>/specific/netapp5/hezi/EEGPipelineSystem/Experiments/{study}/{subject}/DataAfterFiltering/</output-dir>
    <parameters> <!-- parameters that go in the script - anything other than the input/output files -->
		<parameter>
            <name>locutoff</name>
            <display>Low Cutoff</display>
            <default>0.5</default>
        </parameter>

		<parameter>
            <name>hicutoff</name>
            <display>High Cutoff</display>
            <default>45</default>
        </parameter>

		<parameter>
            <name>revfilt</name>
            <display>Reverse filter polarity</display>
            <default>0</default>
        </parameter>

		<parameter>
            <name>usefft</name>
            <display>Whether to use FFT filtering instead of FIR</display>
            <default>0</default>
        </parameter>

		<parameter>
            <name>plotfreqz</name>
            <display>plot frequency response of filter</display>
            <default>0</default>
        </parameter>

		<parameter>
            <name>firtype</name>
            <display> filter design method</display>
            <default>fir1</default>
        </parameter>

		<parameter>
            <name>causal</name>
            <display>Causal filtering</display>
            <default>0</default>
        </parameter>
    </parameters>
</unit>


text:
class NavTypesController < ApplicationController
  before_action :set_nav_type, only: [:show, :edit, :update, :destroy]

  # GET /nav_types
  # GET /nav_types.json
  def index
    @nav_types = NavType.all
  end

  # GET /nav_types/1
  # GET /nav_types/1.json
  def show
  end

  # GET /nav_types/new
  def new
    @nav_type = NavType.new
  end

  # GET /nav_types/1/edit
  def edit
  end

  # POST /nav_types
  # POST /nav_types.json
  def create
    @nav_type = NavType.new(nav_type_params)

    respond_to do |format|
      if @nav_type.save
        format.html { redirect_to @nav_type, notice: 'Nav type was successfully created.' }
        format.json { render action: 'show', status: :created, location: @nav_type }
      else
        format.html { render action: 'new' }
        format.json { render json: @nav_type.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /nav_types/1
  # PATCH/PUT /nav_types/1.json
  def update
    respond_to do |format|
      if @nav_type.update(nav_type_params)
        format.html { redirect_to @nav_type, notice: 'Nav type was successfully updated.' }
        format.json { head :no_content }
      else
        format.html { render action: 'edit' }
        format.json { render json: @nav_type.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /nav_types/1
  # DELETE /nav_types/1.json
  def destroy
    @nav_type.destroy
    respond_to do |format|
      format.html { redirect_to nav_types_url }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_nav_type
      @nav_type = NavType.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def nav_type_params
      params.require(:nav_type).permit(:name, :show_name, :pic)
    end
end


text:
local eal = require 'lib.eal.manager'

-- registering test system assembly
local function decorator(cls)
  -- also setup configure and destroy chains
  cls.onCreate(function(self)
    self.calledOnCreate = true
  end, 100)

  -- also setup configure and destroy chains
  cls.onDestroy(function(self)
    self.calledOnDestroy = true
  end, 100)

  function cls:ping()
    return self.test.prop
  end
  return cls
end

-- registering test system assembly
local function stronglyDefinedDecorator(cls)
  function cls:ok()
    return true
  end
  return cls
end

-- dummy class extension
local function dummyDecorator(cls)
  function cls:isDummy()
    return true
  end
  return cls
end

-- burple class extension
local function burpleDecorator(cls)
  function cls:isBurple()
    return true
  end
  return cls
end

eal:extend({system="test"}, decorator)
eal:extend({system="test", type="testSystem"}, stronglyDefinedDecorator)

eal:extend({class={name="dummy"}}, dummyDecorator)
eal:extend({class={name="burple", requires={system="test"}}}, burpleDecorator)

local function firstMixinDecorator(cls)
  cls.onCreate(function(self)
    self.firstCreate = true
  end)

  cls.onDestroy(function(self)
    self.firstDestroy = true
  end)

  function cls:firstMixinAdded()
    return true
  end
  return cls
end

local function secondMixinDecorator(cls)
  cls.onCreate(function(self)
    self.sequenceValid = self.firstCreate == true
  end)

  cls.onDestroy(function(self)
    self.sequenceValid = self.firstDestroy == true
  end)

  function cls:checkSequence()
    return self.sequenceValid
  end
  return cls
end

eal:extend({mixin="second"}, secondMixinDecorator)
eal:extend({mixin="first"}, firstMixinDecorator)

describe("test engine abstraction layer #eal", function()
  setup(function()
    game:reset()
  end)

  teardown(function()
    game:reset()
  end)

  it("reset should invalidate all eal entities", function()
    local e = data:createEntity({
      id = "abcd",
      test = {
        prop = "pong"
      }
    })
    local wrapper = eal:getEntity(e.id)
    game:reset()
    assert.is_nil(wrapper.entity)
    assert.truthy(wrapper.calledOnDestroy)
    assert.equals(#eal.entities, 0)
    assert.is_nil(eal.entities[e.id])

    -- create the entity with the same id
    local e = data:createEntity({
      id = "abcd",
      test = {
        prop = "pong"
      }
    })
    assert.equals(wrapper:ping(), "pong")

    -- ensure that cache was cleared
    local wrapper = eal:getEntity(e.id)
    assert.is_not.is_nil(wrapper.entity)
    assert.truthy(wrapper.calledOnCreate)
    assert.equals(wrapper:ping(), "pong")
  end)

  describe("mixins", function()
    local composition = data:createEntity({
      vars = {
        mixins = {"first", "second"},
      },
      test = {
        prop = "ok"
      },
      stats = {
      }
    })

    it("simple case works", function()
      local wrapper = eal:getEntity(composition.id)
      assert.truthy(wrapper:firstMixinAdded())
      assert.truthy(wrapper:checkSequence())
    end)
  end)

  describe("assemble entity", function()
    it("check test system", function()
      local entity = data:createEntity({
        test = {
          prop = "pong"
        }
      })
      assert.equals(type(entity), "userdata")
      local wrapper = eal:getEntity(entity.id)
      assert.is_not.equals(wrapper.ping, nil)
      assert.equals(wrapper:ping(), "pong")
      assert.truthy(wrapper.calledOnCreate)
      assert.truthy(core:removeEntity(entity.id))
      assert.truthy(wrapper.calledOnDestroy)
      -- entity was removed, so the wrapper should be invalid now
      -- should raise errors, but no app crash expected
      assert.has.errors(function() wrapper:ping() end)
    end)

    it("should cache assembled entity", function()
      local entity = data:createEntity({
        test = {
          prop = "pongpong"
        }
      })
      local s = spy.on(eal, "assemble")
      local wrapper = eal:getEntity(entity.id)
      assert.spy(s).was.not_called()
    end)

    it("should reuse assembled class", function()
      local s = spy.on(eal, "assemble")
      local entity = data:createEntity({
        test = {
          prop = "pongpong"
        }
      })
      assert.spy(s).was.called(1)
      s = spy.on(eal, "assembleNew")
      assert.equals(type(entity), "userdata")
      local wrapper = eal:getEntity(entity.id)
      assert.is_not.equals(wrapper.ping, nil)
      assert.spy(s).was.not_called()
      assert.equals(wrapper:ping(), "pongpong")
    end)

    it("should return nil for not existing entity", function()
      local wrapper = eal:getEntity("no one here")
      assert.is_nil(wrapper)
    end)

    it("should also have strongly defined extension", function()
      local s = spy.on(eal, "getEntity")
      local entity = data:createEntity({
        test = {
          prop = "ok"
        }
      })
      assert.spy(s).was.called(1)
      local wrapper = eal:getEntity(entity.id)
      assert.truthy(wrapper:ok())
    end)

    local dummy = data:createEntity({
      vars = {
        class = "dummy"
      }
    })

    it("should extend class", function()
      local wrapper = eal:getEntity(dummy.id)
      assert.is_not.is_nil(wrapper.isDummy, "dummy class was not extended")
      assert.truthy(wrapper:isDummy())
    end)

    local dummyPlus = data:createEntity({
      vars = {
        class = "dummy",
      },
      test = {
        prop = "ok"
      }
    })

    it("should extend both by class and systems decorators", function()
      local wrapper = eal:getEntity(dummyPlus.id)
      assert.is_not.is_nil(wrapper.ping, "dummy class did not get system decorators")
      assert.is_not.is_nil(wrapper.isDummy, "dummy class was not extended")
      assert.truthy(wrapper:isDummy())
    end)

    local burple = data:createEntity({
      vars = {
        class = "burple",
      },
      test = {
        prop = "ok"
      },
      stats = {
      }
    })

    it("should assemble class with the system dependency", function()
      local wrapper = eal:getEntity(burple.id)
      assert.is_not.is_nil(wrapper.ping, "system extension did not work")
      assert.is_not.is_nil(wrapper.isBurple, "class extension did not work")
      assert.truthy(wrapper:isBurple(), "class extension did not work")
    end)

    -- required system not defined, so it should not be defined
    local noBurple = data:createEntity({
      vars = {
        class = "burple"
      }
    })

    it("should consider class system requirements", function()
      local wrapper = eal:getEntity(noBurple.id)
      assert.is_nil(wrapper.ping, "requirements were ignored (system)")
      assert.is_nil(wrapper.isBurple, "requirements were ignored (class)")
    end)
  end)
end)


text:
package com.github.kunai.sink;

import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;

import com.github.kunai.Entry;

/**
 *
 * @author Haruaki Tamada
 */
class ClassFileDataSink extends AbstractDataSink {
    private Entry entry = null;

    ClassFileDataSink(String name){
        super(Type.CLASS_FILE, name);
    }

    @Override
    protected ClassLoader buildClassLoader() {
        return new ClassLoader(){
            @Override
            protected Class<?> findClass(String name) throws ClassNotFoundException {
                if(name.equals(entry.getClassName())){
                    try {
                        byte[] data = getBytes(entry);
                        return defineClass(name, data, 0, data.length);
                    } catch (IOException e) {
                        throw new ClassNotFoundException(e.getMessage(), e);
                    }
                }
                return super.findClass(name);
            }

            private byte[] getBytes(Entry entry) throws IOException {
                try(InputStream in = entry.getInputStream();
                    ByteArrayOutputStream out = new ByteArrayOutputStream()){
                    int data;
                    while((data = in.read()) != -1){
                        out.write(data);
                    }
                    return out.toByteArray();
                }
            }
        };
    }

    @Override
    public void putEntry(Entry param) throws SinkException {
        if(entry != null){
            throw new AlreadySinkEntryException(entry.getResourcePath() + ": already sink");
        }
        this.entry = param;
    }

    @Override
    protected void closeImpl() throws SinkException {
        Path path = FileSystems.getDefault().getPath(getBase());
        if(path == null){
            path = FileSystems.getDefault().getPath(".");
        }
        if(path != null && !Files.exists(path.getParent())){
            try {
                Files.createDirectories(path.getParent());
            } catch (IOException e) {
                throw new SinkIOException(e);
            }
        }
        try(FileOutputStream out = new FileOutputStream(getBase());
                InputStream in = entry.getInputStream()){
            int data;
            while((data = in.read()) != -1){
                out.write(data);
            }
        } catch(IOException e){
            throw new SinkIOException(e);
        }
    }
}


text:
package org.jboss.pnc.common.json.moduleconfig;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.ToString;
import org.jboss.pnc.common.json.AbstractModuleConfig;

import java.net.MalformedURLException;

@ToString
public class BpmModuleConfig extends AbstractModuleConfig {

    public static final String MODULE_NAME = "bpm-config";

    @Getter
    private int httpConnectionRequestTimeout;

    @Getter
    private int httpConnectTimeout;

    @Getter
    private int httpSocketTimeout;

    @Getter
    private final String bpmNewBaseUrl;

    @Getter
    private final String bpmNewDeploymentId;

    @Getter
    private final String bpmNewBuildProcessName;

    @Getter
    private final String bpmNewUsername;

    @Getter
    private final String bpmNewPassword;

    @Getter
    private final String newBcCreationProcessId;

    /** process id when closing a milestone */
    @Getter
    private final String bpmNewReleaseProcessId;

    @Getter
    private final String analyzeDeliverablesBpmProcessId;

    public BpmModuleConfig(
            @JsonProperty("connectionRequestTimeout") Integer httpConnectionRequestTimeout,
            @JsonProperty("connectTimeout") Integer httpConnectTimeout,
            @JsonProperty("socketTimeout") Integer httpSocketTimeout,
            @JsonProperty("bpmNewBaseUrl") String bpmNewBaseUrl,
            @JsonProperty("bpmNewDeploymentId") String bpmNewDeploymentId,
            @JsonProperty("bpmNewBuildProcessName") String bpmNewBuildProcessName,
            @JsonProperty("bpmNewUsername") String bpmNewUsername,
            @JsonProperty("bpmNewPassword") String bpmNewPassword,
            @JsonProperty("newBcCreationProcessId") String newBcCreationProcessId,
            @JsonProperty("bpmNewReleaseProcessId") String bpmNewReleaseProcessId,
            @JsonProperty("analyzeDeliverablesBpmProcessId") String analyzeDeliverablesBpmProcessId)
            throws MalformedURLException {
        this.analyzeDeliverablesBpmProcessId = analyzeDeliverablesBpmProcessId;
        if (httpConnectionRequestTimeout == null) {
            this.httpConnectionRequestTimeout = 5000; // default to 5 sec
        } else {
            this.httpConnectionRequestTimeout = httpConnectionRequestTimeout;
        }
        if (httpConnectTimeout == null) {
            this.httpConnectTimeout = 5000; // default to 5 sec
        } else {
            this.httpConnectTimeout = httpConnectTimeout;
        }
        if (httpSocketTimeout == null) {
            this.httpSocketTimeout = 5000; // default to 5 sec
        } else {
            this.httpSocketTimeout = httpSocketTimeout;
        }
        this.bpmNewBaseUrl = bpmNewBaseUrl;
        this.bpmNewDeploymentId = bpmNewDeploymentId;
        this.bpmNewBuildProcessName = bpmNewBuildProcessName;
        this.bpmNewUsername = bpmNewUsername;
        this.bpmNewPassword = bpmNewPassword;
        this.newBcCreationProcessId = newBcCreationProcessId;
        this.bpmNewReleaseProcessId = bpmNewReleaseProcessId;
    }

}


text:
const Asset = require('./Asset');
let iconv;
let iconvLite;

try {
  iconv = require('iconv');
} catch (e) {
  try {
    iconvLite = require('iconv-lite');
  } catch (e2) {}
}

/**
 * Adds text encoding and decoding support to {@link Asset}. Serves as a
 * superclass for {@link Html}, {@link Xml}, {@link Css}, {@link JavaScript},
 * {@link Json}, and {@link CacheManifest}.
 *
 * In addition to the [config]{@link AssetConfig} already supported by the Asset base
 * class, the options `text` and `encoding` are also available
 *
 * @example
 *     var textAsset = new Text({
 *         // "æøå" in iso-8859-1:
 *         rawSrc: Buffer.from([0xe6, 0xf8, 0xe5]),
 *         encoding: "iso-8859-1"
 *     });
 *     textAsset.text; // "æøå" (decoded JavaScript string)
 *     textAsset.encoding = 'utf-8';
 *     textAsset.rawSrc; // <Buffer c3 a6 c3 b8 c3 a5>
 *
 * @class Text
 * @extends Asset
 * @param {AssetConfig} config The Text assets configuration
 *
 * @param {String} [config.text] The decoded source of the asset. Can be used
 * instead of `rawSrc` and `rawSrcProxy`.
 *
 * @param {String} [config.encoding="utf-8"] Used to decode and reencode the {@link Asset#rawSrc}.
 * Can be any encoding supported by the `iconv` module. Can be changed later
 * using {@link Text#encoding}. See the docs for {@link Text#defaultEncoding}.
 * If the asset is loaded via http, the encoding will be read from the `Content-Type`,
 * and likewise for `data:` urls.
 *
 * @param {AssetGraph} assetGraph Mandatory AssetGraph instance references
 */
class Text extends Asset {
  /**
   * Get or set the encoding (charset) used for re-encoding the raw
   * source of the asset. To affect the initial decoding of the
   * `rawSrc` option, provide the `encoding` option to the
   * constructor.
   *
   * @type {String}
   */
  get encoding() {
    if (!this._encoding) {
      this._encoding = this.defaultEncoding;
    }
    return this._encoding;
  }

  set encoding(encoding) {
    if (encoding !== this.encoding) {
      /*eslint-disable*/
      const text = this.text; // Make sure this._text exists so the rawSrc is decoded before the original encoding is thrown away
      /* eslint-enable */
      this._rawSrc = undefined;
      this._encoding = encoding;
      this.markDirty();
    }
  }

  get rawSrc() {
    if (!this._rawSrc) {
      let error;

      if (typeof this._text === 'string' || this._parseTree) {
        if (/^utf-?8$/i.test(this.encoding)) {
          this._updateRawSrcAndLastKnownByteLength(
            Buffer.from(this.text, 'utf-8')
          );
        } else if (/^(?:us-?)?ascii$/i.test(this.encoding)) {
          this._updateRawSrcAndLastKnownByteLength(
            Buffer.from(this.text, 'ascii')
          );
        } else if (iconv) {
          try {
            this._updateRawSrcAndLastKnownByteLength(
              new iconv.Iconv('utf-8', this.encoding).convert(this.text)
            );
          } catch (err) {
            err.message = `iconv: Converting ${this.url} from UTF-8 to ${this.encoding} failed:\n${err.message}`;
            if (this.assetGraph) {
              if (err.code === 'EILSEQ') {
                err.message +=
                  '\nTransliterating and ignoring further failures. Data corruption may occur.';
                this._updateRawSrcAndLastKnownByteLength(
                  new iconv.Iconv(
                    'utf-8',
                    `${this.encoding}//TRANSLIT//IGNORE`
                  ).convert(this.text)
                );
              }
              this.assetGraph.warn(err);
            } else {
              throw err;
            }
          }
        } else if (iconvLite) {
          try {
            this._updateRawSrcAndLastKnownByteLength(
              iconvLite.encode(this.text, this.encoding)
            );
          } catch (err) {
            err.message = `iconv: Converting ${this.url} from UTF-8 to ${this.encoding} failed:\n${err.message}`;
            if (this.assetGraph) {
              this.assetGraph.warn(err);
            } else {
              throw err;
            }
          }
        } else {
          error = new Error(
            `iconv and iconv-lite not found. Cannot encode ${this} as ${this.encoding}. ` +
              `Please run \`npm install iconv\` or \`npm install iconv-lite\` and try again`
          );
          error.asset = this;
          throw error;
        }
      } else {
        error = new Error(
          'Text.rawSrc getter: No _rawSrc or _text property found, asset not loaded?'
        );
        error.asset = this;

        throw error;
      }
    }
    return this._rawSrc;
  }

  set rawSrc(rawSrc) {
    this.unload();
    this._parseTree = undefined;
    this._text = undefined;
    this._updateRawSrcAndLastKnownByteLength(rawSrc);
    if (this.assetGraph) {
      this.populate();
    }
    this.markDirty();
  }

  /**
   * Get or set the decoded text contents of the of the asset as a
   * JavaScript string. Unlike browsers AssetGraph doesn't try to
   * sniff the charset of your text-based assets. It will fall back
   * to assuming utf-8 if it's unable to determine the
   * encoding/charset from HTTP headers, `<meta
   * http-equiv='Content-Type'>` tags ({@link Html}), `@charset` ({@link Css}), so
   * if for some reason you're not using utf-8 for all your
   * text-based assets, make sure to provide those hints. Other
   * asset types provide no standard way to specify the charset
   * within the file itself, so presently there's no way to load
   * eg. JavaScript from disc if it's not utf-8 or ASCII, except by
   * overriding `Text.prototype.defaultEncoding` globally.
   *
   * If the internal state has been changed since the asset was
   * initialized, it will automatically be reserialized when the
   * `text` property is retrieved, for example:
   *
   *     var htmlAsset = new Html({
   *         rawSrc: Buffer.from("hello");
   *     });
   *     htmlAsset.text; // "hello"
   *     htmlAsset.parseTree.body.innerHTML = "bye";
   *     htmlAsset.markDirty();
   *     htmlAsset.text; // "bye"
   *
   * Setting this property after the outgoing relations have been
   * accessed currently leads to undefined behavior.
   *
   * @type {String}
   */
  get text() {
    if (typeof this._text !== 'string') {
      this._text = this._getTextFromRawSrc();
    }
    return this._text;
  }

  set text(text) {
    this.unload();
    this._text = text;
    this._lastKnownByteLength = undefined;
    if (this.assetGraph) {
      this.populate();
    }
    this.markDirty();
    this._text = text; // markDirty clears _text, but we know that it's still good
  }

  markDirty() {
    if (this._parseTree) {
      this._text = undefined;
      this._sourceMap = undefined;
    }
    super.markDirty();
  }

  _getTextFromRawSrc() {
    if (!this.isLoaded) {
      throw new Error(
        `Text._getTextFromRawSrc(): Asset not loaded: ${this.urlOrDescription}`
      );
    }
    if (!this._rawSrc) {
      throw new Error(
        `Text._getTextFromRawSrc(): No _rawSrc property found: ${this.urlOrDescription}`
      );
    }
    if (/^utf-?8$/i.test(this.encoding)) {
      return this._rawSrc.toString('utf-8');
    } else if (/^(?:us-?)?ascii$/i.test(this.encoding)) {
      return this._rawSrc.toString('ascii');
    } else if (iconv) {
      return new iconv.Iconv(this.encoding, 'utf-8')
        .convert(this._rawSrc)
        .toString('utf-8');
    } else if (iconvLite) {
      return iconvLite.decode(this._rawSrc, this.encoding);
    } else {
      const error = new Error(
        `iconv and iconv-lite not found. Cannot decode ${this} (encoding is ${this.encoding}). ` +
          `Please run \`npm install iconv\` or \`npm install iconv-lite\` and try again`
      );
      error.asset = this;

      throw error;
    }
  }
}

Object.assign(Text.prototype, {
  /**
   * Property that's true for all Text instances. Avoids reliance on
   * the `instanceof` operator.
   *
   * @member Text#isText
   * @type {Boolean}
   * @default true
   */
  isText: true,

  /**
   * The default encoding for the Text (sub)class. Used for decoding
   * the raw source when the encoding cannot be determined by other
   * means, such as a `Content-Type` header (when the asset was
   * fetched via http), or another indicator specific to the given
   * asset type (`@charset` for Css, `<meta
   * http-equiv="Content-Type" ...>` for Html).
   *
   * Factory setting is "utf-8", but you can override it by setting
   * `Text.prototype.defaultEncoding` to another value supported by
   * the `iconv` of `iconv-lite` modules.
   *
   * @member Text#defaultEncoding
   * @type {String}
   * @default "utf-8"
   */
  defaultEncoding: 'utf-8',

  supportedExtensions: [
    '.txt',
    '.htaccess',
    '.md',
    '.rst',
    '.ics',
    '.csv',
    '.tsv',
    '.xtemplate', // For Ext.XTemplate + GETTEXT
  ],

  contentType: 'text/plain',
});

module.exports = Text;


text:
title: Introduction
name: Introduction to the Quickstart, and configuring environment
description: This Quickstart will guide you through the various tasks related to using Auth0-issued JSON Web Tokens to secure your ASP.NET Core Web API.
budicon: 715
---

<%= include('../../_includes/_package', {
  org: 'auth0-samples',
  repo: 'auth0-aspnetcore-webapi-sample',
  path: '00-Starter-Seed',
  requirements: [
    '.NET Core 1.0',
    'Visual Studio 2015 Update 3 (Optional)',
    'Visual Studio Code (Optional)'
  ]
}) %>

<%= include('../../_includes/_api_auth_intro') %>

This Quickstart will guide you through the various tasks related to using Auth0-issued Access Tokens to secure your ASP.NET Core Web API.

## Seed & Samples

If you would like to follow along with this Quickstart you can download the [seed project](https://github.com/auth0-samples/auth0-aspnetcore-webapi-sample/tree/master/00-Starter-Seed). The seed project is just a basic ASP.NET Web API with a simple controller and some of the NuGet packages which will be needed included. It also contains an `appSettings.json` file where you can configure the various Auth0-related settings for your application.

The final project after each of the steps is also available in the [Sample repository](https://github.com/auth0-samples/auth0-aspnetcore-webapi-sample). You can find the final result for each step in the relevant folder inside the repository.

## 1. Enable OAuth 2.0 API Authorization

<%= include('../../_includes/_configure_oauth2aas') %>

## 2. Create a Resource Server (API)

In the [APIs section](${manage_url}/#/apis) of the Auth0 Dashboard, click the **Create API** button. Provide a **Name** and **Identifier** for your API. Be sure to choose the RS256 signing algorithm.

![Create API](/media/articles/server-apis/aspnet-core-webapi/create-api-rs256.png)

Also, update the `appsettings.json` file in your project with the correct **Domain** and **API Identifier** for your API, e.g.

```json
{
  "Auth0": {
    "Domain": "${account.namespace}",
    "ApiIdentifier": "YOUR_API_IDENTIFIER"
  }
}
```

## 3. Install Dependencies

To use Auth0 Access Tokens with ASP.NET Core you will use the JWT Middleware. Add the `Microsoft.AspNetCore.Authentication.JwtBearer` package to your application.

```text
Install-Package Microsoft.AspNetCore.Authentication.JwtBearer
```

This was already done for you in the seed project, so no need to add it if you are using the seed project as a starting point.

That's all you need to start working with Auth0 in your Web API!

Please continue with the [Authentication](/quickstart/backend/aspnet-core-webapi/01-authentication) tutorial to secure your Web API.


text:
<!DOCTYPE html>

	    <meta charset="utf-8" />
	    <meta name="format-detection" content="telephone=no" />
	    <meta name="msapplication-tap-highlight" content="no" />
	    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />

		<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
		<link href="https://fonts.googleapis.com/css?family=Archivo+Narrow" rel="stylesheet">
		<link href="https://fonts.googleapis.com/css?family=Pompiere" rel="stylesheet">

		<link rel="stylesheet"
			href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />

	    <link rel="stylesheet" type="text/css" href="./css/index.css" />
	    <title>GuitApp</title>

Ukulele Chords

Home

Change to Left Handed

Tuner

			<audio controls>

			<source src="440Hz_44100Hz_16bit_05sec.mp3" type="audio/mpeg">
			Your browser does not support the audio element.
			</audio>

Major Chords

					A major

						Close

					B major

						Close

					C major

						Close

					D major

						Close

					E major

						Close

					F major

						Close

					G major

						Close

Minor Chords

					A minor

						Close

					B minor

						Close

					C minor

						Close

					D minor

						Close

					E minor

						Close

					F minor

						Close

					G minor

						Close

Juuso Kosonen

Ukulele Chords

Home

Change to Right Handed

Tuner

			<audio controls>

			<source src="440Hz_44100Hz_16bit_05sec.mp3" type="audio/mpeg">
			Your browser does not support the audio element.
			</audio>

Major Chords

					A major

						Close

					B major

						Close

					C major

						Close

					D major

						Close

					E major

						Close

					F major

						Close

					G major

						Close

Minor Chords

					A minor

						Close

					B minor

						Close

					C minor

						Close

					D minor

						Close

					E minor

						Close

					F minor

						Close

					G minor

						Close

Juuso Kosonen


text:
KITE-MALLORCA

miembro oficial de

{% if page.amp == true %}
<amp-img src="{{ site.baseurl }}/images/logos/VDWS-Logo.gif" alt="Logo de la VWDS, asociación internacional de Kitesurf" width="300" height="120"></amp-img>
{% else %}

{% endif %}


text:
import { Column } from "../entities/column";
import { BeanStub } from "../context/beanStub";
export declare class ColumnHoverService extends BeanStub {
    private columnApi;
    private gridApi;
    private selectedColumns;
    setMouseOver(columns: Column[]): void;
    clearMouseOver(): void;
    isHovered(column: Column): boolean;
}


text:
class FileObjectModel : public QAbstractItemModel
{
        Q_OBJECT
    public:
        FileObjectModel(QObject *parent = 0);

        int rowCount(const QModelIndex &parent) const;
        int columnCount(const QModelIndex &parent) const;

        QModelIndex index(int row, int column, const QModelIndex &parent) const;
        QModelIndex parent(const QModelIndex &child) const;

        QVariant data(const QModelIndex &index, int role) const;
        bool setData(const QModelIndex &index, const QVariant &value, int role);

        FileService *fileService() const;
        void setFileService(FileService *fileService);

        bool isShowingDirectories() const;
        void setIsShowingDirectories(bool showing);

        bool isShowingFiles() const;
        void setIsShowingFiles(bool showing);

    private:
        QList<FileObject *> getChildren(FileObject *obj) const;

        FileService *mFileService;
        bool mShowDirectories;
        bool mShowFiles;
};

#endif // FILEOBJECTMODEL_H


text:
package microsoft.exchange.webservices.data;

import javax.xml.stream.XMLStreamException;
import java.util.Date;

/**
 * Encapsulates information on the deleted occurrence of a recurring
 * appointment.
 */
public class DeletedOccurrenceInfo extends ComplexProperty {
  /**
   * The original start date and time of the deleted occurrence. The EWS
   * schema contains a Start property for deleted occurrences but it's really
   * the original start date and time of the occurrence.
   */
  private Date originalStart;

  /**
   * Initializes a new instance of the "DeletedOccurrenceInfo" class.
   */
  protected DeletedOccurrenceInfo() {
  }

  /**
   * Tries to read element from XML.
   *
   * @param reader The reader.
   * @return True if element was read.
   * @throws Exception the exception
   */
  @Override
  protected boolean tryReadElementFromXml(EwsServiceXmlReader reader)
      throws Exception {
    if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.Start)) {
      try {
        this.originalStart = reader.readElementValueAsDateTime();
      } catch (ServiceXmlDeserializationException e) {
        e.printStackTrace();
      } catch (XMLStreamException e) {
        e.printStackTrace();
      }
      return true;
    } else {
      return false;
    }
  }

  /**
   * Gets the original start date and time of the deleted occurrence.
   *
   * @return the original start
   */
  public Date getOriginalStart() {
    return this.originalStart;
  }

}


text:
using namespace fakeit;

struct SomeInterface {
    virtual int foo() = 0;
};

int main() {
    Mock<SomeInterface> mock;
    When(Method(mock, foo)).Return(0);
    SomeInterface &i = mock.get();
    return i.foo();
}


text:
mkdir -p ~/.gradle

echo "org.gradle.jvmargs=-Xmx2048M" >> ~/.gradle/gradle.properties

echo "trusonaUsername=${ARTIFACTORY_USERNAME}" >> ~/.gradle/gradle.properties
echo "trusonaPassword=${ARTIFACTORY_PASSWORD}" >> ~/.gradle/gradle.properties

echo "RELEASES_REPO=${RELEASES_REPO}" >> ~/.gradle/gradle.properties
echo "SNAPSHOTS_REPO=${SNAPSHOTS_REPO}" >> ~/.gradle/gradle.properties
echo "CONTEXT_REPO_ROOT=${CONTEXT_REPO_ROOT}" >> ~/.gradle/gradle.properties