text:
<?php

namespace Liip\MonitorBundle\Tests\DependencyInjection;

use Liip\MonitorBundle\DependencyInjection\Compiler\CheckCollectionTagCompilerPass;
use Liip\MonitorBundle\DependencyInjection\Compiler\CheckTagCompilerPass;
use Liip\MonitorBundle\DependencyInjection\LiipMonitorExtension;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;

/**
 * @author Kevin Bond <kevinbond@gmail.com>
 */
class LiipMonitorExtensionTest extends AbstractExtensionTestCase
{
    /**
     * @dataProvider checkProvider
     */
    public function testChecksLoaded($name, $config, $checkClass, $checkAlias = null, $checkCount = 1)
    {
        if (!$checkAlias) {
            $checkAlias = $name;
        }

        $this->load(array('checks' => array($name => $config)));
        $this->compile();

        $runner = $this->container->get('liip_monitor.runner');

        $this->assertCount($checkCount, $runner->getChecks());
        $this->assertInstanceOf($checkClass, $runner->getCheck($checkAlias));
    }

    public function testDefaultNoChecks()
    {
        $this->load();
        $this->compile();

        $this->assertCount(0, $this->container->get('liip_monitor.runner')->getChecks());
    }

    public function testEnableController()
    {
        $this->load();

        $this->assertFalse($this->container->has('liip_monitor.health_controller'));

        $this->load(array('enable_controller' => true));

        $this->assertTrue($this->container->has('liip_monitor.health_controller'));
    }

    public function testMailer()
    {
        $this->load();

        $this->assertEquals(false, $this->container->has('liip_monitor.reporter.swift_mailer'));

        $this->load(
            array(
                'mailer' => array(
                    'recipient' => 'foo@example.com',
                    'sender' => 'bar@example.com',
                    'subject' => 'Health Check'
                )
            )
        );

        $this->assertEquals(true, $this->container->has('liip_monitor.reporter.swift_mailer'));
    }

    /**
     * @dataProvider mailerConfigProvider
     * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
     */
    public function testInvalidMailerConfig($config)
    {
        $this->load($config);
    }

    public function mailerConfigProvider()
    {
        return array(
            array(
                array(
                    'mailer' => array(
                        'recipient' => 'foo@example.com'
                    )
                )
            ),
            array(
                array(
                    'mailer' => array(
                        'recipient' => 'foo@example.com',
                        'sender' => 'bar@example.com',
                        'subject' => null
                    )
                )
            )
        );
    }

    /**
     * @dataProvider invalidCheckProvider
     * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
     */
    public function testInvalidExpressionConfig(array $config)
    {
        $this->load(array('checks' => array('expressions' => $config)));
        $this->compile();
    }

    public function invalidCheckProvider()
    {
        return array(
            array(array('foo')),
            array(array('foo' => array('critical_expression' => 'true'))),
            array(array('foo' => array('label' => 'foo'))),
        );
    }

    public function checkProvider()
    {
        return array(
            array('php_extensions', array('foo'), 'ZendDiagnostics\Check\ExtensionLoaded'),
            array('php_flags', array('foo' => 'true'), 'ZendDiagnostics\Check\PhpFlag', 'php_flag_foo'),
            array('php_version', array('5.3.3' => '='), 'ZendDiagnostics\Check\PhpVersion', 'php_version_5.3.3'),
            array('process_running', 'foo', 'ZendDiagnostics\Check\ProcessRunning', 'process_foo_running'),
            array('process_running', array('foo'), 'ZendDiagnostics\Check\ProcessRunning', 'process_foo_running'),
            array('process_running', array('foo', 'bar'), 'ZendDiagnostics\Check\ProcessRunning', 'process_foo_running', 2),
            array('process_running', array('foo', 'bar'), 'ZendDiagnostics\Check\ProcessRunning', 'process_bar_running', 2),
            array('readable_directory', array('foo'), 'ZendDiagnostics\Check\DirReadable'),
            array('writable_directory', array('foo'), 'ZendDiagnostics\Check\DirWritable'),
            array('class_exists', array('Foo'), 'ZendDiagnostics\Check\ClassExists'),
            array('cpu_performance', 0.5, 'ZendDiagnostics\Check\CpuPerformance'),
            array('disk_usage', array('path' => __DIR__), 'ZendDiagnostics\Check\DiskUsage'),
            array('symfony_requirements', array('file' => __DIR__.'/../../LiipMonitorBundle.php'), 'Liip\MonitorBundle\Check\SymfonyRequirements'),
            array('opcache_memory', null, 'ZendDiagnostics\Check\OpCacheMemory'),
            array('apc_memory', null, 'ZendDiagnostics\Check\ApcMemory'),
            array('apc_fragmentation', null, 'ZendDiagnostics\Check\ApcFragmentation'),
            array('doctrine_dbal', 'foo', 'Liip\MonitorBundle\Check\DoctrineDbal', 'doctrine_dbal_foo_connection'),
            array('doctrine_dbal', array('foo'), 'Liip\MonitorBundle\Check\DoctrineDbal', 'doctrine_dbal_foo_connection'),
            array('doctrine_dbal', array('foo', 'bar'), 'Liip\MonitorBundle\Check\DoctrineDbal', 'doctrine_dbal_foo_connection', 2),
            array('doctrine_dbal', array('foo', 'bar'), 'Liip\MonitorBundle\Check\DoctrineDbal', 'doctrine_dbal_bar_connection', 2),
            array('memcache', array('foo' => null), 'ZendDiagnostics\Check\Memcache', 'memcache_foo'),
            array('redis', array('foo' => null), 'ZendDiagnostics\Check\Redis', 'redis_foo'),
            array('http_service', array('foo' => null), 'ZendDiagnostics\Check\HttpService', 'http_service_foo'),
            array('guzzle_http_service', array('foo' => null), 'ZendDiagnostics\Check\GuzzleHttpService', 'guzzle_http_service_foo'),
            array('rabbit_mq', array('foo' => null), 'ZendDiagnostics\Check\RabbitMQ', 'rabbit_mq_foo'),
            array('symfony_version', null, 'Liip\MonitorBundle\Check\SymfonyVersion'),
            array('custom_error_pages', array('error_codes' => array(500), 'path' => __DIR__, 'controller' => 'foo'), 'Liip\MonitorBundle\Check\CustomErrorPages'),
            array('security_advisory', array('lock_file' => __DIR__.'/../../composer.lock'), 'ZendDiagnostics\Check\SecurityAdvisory'),
            array('stream_wrapper_exists', array('foo'), 'ZendDiagnostics\Check\StreamWrapperExists'),
            array('file_ini', array('foo.ini'), 'ZendDiagnostics\Check\IniFile'),
            array('file_json', array('foo.json'), 'ZendDiagnostics\Check\JsonFile'),
            array('file_xml', array('foo.xml'), 'ZendDiagnostics\Check\XmlFile'),
            array('file_yaml', array('foo.yaml'), 'ZendDiagnostics\Check\YamlFile'),
            array('expressions', array('foo' => array('label' => 'foo', 'critical_expression' => 'true')), 'Liip\MonitorBundle\Check\Expression', 'expression_foo'),
        );
    }

    protected function getContainerExtensions()
    {
        return array(new LiipMonitorExtension());
    }

    protected function compile()
    {
        $this->container->set('doctrine', $this->getMock('Doctrine\Common\Persistence\ConnectionRegistry'));
        $this->container->addCompilerPass(new CheckTagCompilerPass());
        $this->container->addCompilerPass(new CheckCollectionTagCompilerPass());

        parent::compile();
    }
}


text:
layout: fellowship_post
title: Application received
section: fellowships
sub-section: fellows_apply
---
Thanks very much for applying to become a 2016 Knight-Mozilla Fellow.

Here's what happens now:

* After August 21, 2015 all applications will be reviewed by a small reviewing panel.
* By early September, a final batch of 20-30 semifinalists will be selected and interviews conducted.
* Final candidates for the Knight-Mozilla Fellowship will be notified by early October.
* A public announcement of our 2016 fellows will be made at the Mozilla Festival in London November 5.

Feel free to drop us a line if you have any questions. You can [e-mail](mailto:info@opennews.org), reach us [on Twitter](http://twitter.com/opennews), or even find us on IRC via the #opennews channel on irc.mozilla.org.
We are happy to answer any additional questions you may have and look forward to reviewing your application.

redpajama_set_name: RedPajamaGithub


text:
@extends('nrviews::layouts.form')
@section('title','Create a new Node')

@section('content')
@if(count($errors))

            @foreach ($errors->all() as $error)

{{ $error }}

            @endforeach

@endif
<form class="" action="{{route('nr_node_create')}}" method="post">
    {{ csrf_field() }}

                Node Options

                    <select name="nr_parent_id" id="nr_parent_id" class="mdl-textfield__input" required>
                        @foreach ($parents as $node)
                            <option value="{{$node->id}}">{{$node->name}}</option>
                        @endforeach
                    </select>
                    Select the parent Node

                Creating a new Node

                @include('nrviews::nodify.node-new-infoform')

                <input type="submit" value="Submit" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored">

</form>
@endsection

@section('form-scripts')

@endsection


text:
var DataPersister = (function() {
    'use strict';

    var BasePersister = function(rootUrl) {
        this.rootUrl = rootUrl;
        this.students = new StudentPersister(rootUrl);
        return this;
    };

    var StudentPersister = function(rootUrl) {
        this.rootUrl = rootUrl + '/Students';
        return this;
    };

    StudentPersister.prototype = {
        create: function(student) {
            return HttpRequster.postJSON(this.rootUrl, student);
        },
        getAll: function() {
            return HttpRequster.getJSON(this.rootUrl);
        },
        deleteById: function(studentId) {
            return HttpRequster.deleteJSON(this.rootUrl + '/' + studentId);
        }
    };

    return {
        getPersister: function(rootUrl) {
            return new BasePersister(rootUrl);
        }
    };
}());


text:
package io.quarkus.arc.test.observer;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Consumer;

import javax.enterprise.event.Observes;
import javax.inject.Singleton;

import org.jboss.jandex.DotName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.arc.Arc;
import io.quarkus.arc.deployment.ObserverRegistrationPhaseBuildItem;
import io.quarkus.arc.deployment.ObserverRegistrationPhaseBuildItem.ObserverConfiguratorBuildItem;
import io.quarkus.builder.BuildChainBuilder;
import io.quarkus.builder.BuildContext;
import io.quarkus.builder.BuildStep;
import io.quarkus.gizmo.FieldDescriptor;
import io.quarkus.gizmo.MethodDescriptor;
import io.quarkus.gizmo.ResultHandle;
import io.quarkus.test.QuarkusUnitTest;

public class SyntheticObserverTest {

    @RegisterExtension
    static final QuarkusUnitTest config = new QuarkusUnitTest()
            .withApplicationRoot((jar) -> jar
                    .addClasses(MyObserver.class))
            .addBuildChainCustomizer(buildCustomizer());

    static Consumer<BuildChainBuilder> buildCustomizer() {
        return new Consumer<BuildChainBuilder>() {

            @Override
            public void accept(BuildChainBuilder builder) {
                builder.addBuildStep(new BuildStep() {

                    @Override
                    public void execute(BuildContext context) {
                        ObserverRegistrationPhaseBuildItem observerRegistrationPhase = context
                                .consume(ObserverRegistrationPhaseBuildItem.class);
                        context.produce(new ObserverConfiguratorBuildItem(
                                observerRegistrationPhase.getContext().configure()
                                        .beanClass(DotName.createSimple(SyntheticObserverTest.class.getName()))
                                        .observedType(String.class).notify(mc -> {
                                            ResultHandle events = mc
                                                    .readStaticField(
                                                            FieldDescriptor.of(MyObserver.class, "EVENTS", List.class));
                                            mc.invokeInterfaceMethod(
                                                    MethodDescriptor.ofMethod(List.class, "add", boolean.class, Object.class),
                                                    events, mc.load("synthetic"));
                                            mc.returnValue(null);
                                        })));
                    }
                }).consumes(ObserverRegistrationPhaseBuildItem.class).produces(ObserverConfiguratorBuildItem.class).build();
            }
        };
    }

    @Test
    public void testSyntheticObserver() {
        MyObserver.EVENTS.clear();
        Arc.container().beanManager().getEvent().fire("foo");
        assertEquals(2, MyObserver.EVENTS.size(), "Events: " + MyObserver.EVENTS);
        assertTrue(MyObserver.EVENTS.contains("synthetic"));
        assertTrue(MyObserver.EVENTS.contains("foo_MyObserver"));
    }

    @Singleton
    static class MyObserver {

        public static final List<String> EVENTS = new CopyOnWriteArrayList<String>();

        void test(@Observes String event) {
            EVENTS.add(event + "_MyObserver");
        }

    }

}


text:
using System;
using System.Runtime.InteropServices;

// Internal C# wrapper for OVRPlugin.

internal static class OVRPlugin
{
	public static readonly System.Version wrapperVersion = OVRP_1_10_0.version;

	private static System.Version _version;
	public static System.Version version
	{
		get {
			if (_version == null)
			{
				try
				{
					string pluginVersion = OVRP_1_1_0.ovrp_GetVersion();

					if (pluginVersion != null)
					{
						// Truncate unsupported trailing version info for System.Version. Original string is returned if not present.
						pluginVersion = pluginVersion.Split('-')[0];
						_version = new System.Version(pluginVersion);
					}
					else
					{
						_version = _versionZero;
					}
				}
				catch
				{
					_version = _versionZero;
				}

				// Unity 5.1.1f3-p3 have OVRPlugin version "0.5.0", which isn't accurate.
				if (_version == OVRP_0_5_0.version)
					_version = OVRP_0_1_0.version;

				if (_version > _versionZero && _version < OVRP_1_3_0.version)
					throw new PlatformNotSupportedException("Oculus Utilities version " + wrapperVersion + " is too new for OVRPlugin version " + _version.ToString () + ". Update to the latest version of Unity.");
			}

			return _version;
		}
	}

	private static System.Version _nativeSDKVersion;
	public static System.Version nativeSDKVersion
	{
		get {
			if (_nativeSDKVersion == null)
			{
				try
				{
					string sdkVersion = string.Empty;

					if (version >= OVRP_1_1_0.version)
						sdkVersion = OVRP_1_1_0.ovrp_GetNativeSDKVersion();
					else
						sdkVersion = _versionZero.ToString();

					if (sdkVersion != null)
					{
						// Truncate unsupported trailing version info for System.Version. Original string is returned if not present.
						sdkVersion = sdkVersion.Split('-')[0];
						_nativeSDKVersion = new System.Version(sdkVersion);
					}
					else
					{
						_nativeSDKVersion = _versionZero;
					}
				}
				catch
				{
					_nativeSDKVersion = _versionZero;
				}
			}

			return _nativeSDKVersion;
		}
	}

	[StructLayout(LayoutKind.Sequential)]
	private struct GUID
	{
		public int a;
		public short b;
		public short c;
		public byte d0;
		public byte d1;
		public byte d2;
		public byte d3;
		public byte d4;
		public byte d5;
		public byte d6;
		public byte d7;
	}

	public enum Bool
	{
		False = 0,
		True
	}

	public enum Eye
	{
		None  = -1,
		Left  = 0,
		Right = 1,
		Count = 2
	}

	public enum Tracker
	{
		None   = -1,
		Zero   = 0,
		One    = 1,
		Two    = 2,
		Three  = 3,
		Count,
	}

	public enum Node
	{
		None           = -1,
		EyeLeft        = 0,
		EyeRight       = 1,
		EyeCenter      = 2,
		HandLeft       = 3,
		HandRight      = 4,
		TrackerZero    = 5,
		TrackerOne     = 6,
		TrackerTwo     = 7,
		TrackerThree   = 8,
		Head           = 9,
		Count,
	}

	public enum Controller
	{
		None           = 0,
		LTouch         = 0x00000001,
		RTouch         = 0x00000002,
		Touch          = LTouch | RTouch,
		Remote         = 0x00000004,
		Gamepad        = 0x00000010,
		Touchpad       = 0x08000000,
		Active         = unchecked((int)0x80000000),
		All            = ~None,
	}

	public enum TrackingOrigin
	{
		EyeLevel       = 0,
		FloorLevel     = 1,
		Count,
	}

	public enum RecenterFlags
	{
		Default        = 0,
		IgnoreAll      = unchecked((int)0x80000000),
		Count,
	}

	public enum BatteryStatus
	{
		Charging = 0,
		Discharging,
		Full,
		NotCharging,
		Unknown,
	}

	public enum PlatformUI
	{
		None = -1,
		GlobalMenu = 0,
		ConfirmQuit,
        GlobalMenuTutorial,
	}

	public enum SystemRegion
	{
		Unspecified = 0,
		Japan,
		China,
	}

	public enum SystemHeadset
	{
		None = 0,
		GearVR_R320, // Note4 Innovator
		GearVR_R321, // S6 Innovator
		GearVR_R322, // Commercial 1
		GearVR_R323, // Commercial 2 (USB Type C)

		Rift_DK1 = 0x1000,
		Rift_DK2,
		Rift_CV1,
	}

	public enum OverlayShape
	{
		Quad = 0,
		Cylinder = 1,
		Cubemap = 2,
	}

	private const int OverlayShapeFlagShift = 4;
	private enum OverlayFlag
	{
		None        = unchecked((int)0x00000000),
		OnTop       = unchecked((int)0x00000001),
		HeadLocked  = unchecked((int)0x00000002),

		// Using the 5-8 bits for shapes, total 16 potential shapes can be supported 0x000000[0]0 ->  0x000000[F]0
		ShapeFlag_Quad      = unchecked((int)OverlayShape.Quad << OverlayShapeFlagShift),
		ShapeFlag_Cylinder  = unchecked((int)OverlayShape.Cylinder << OverlayShapeFlagShift),
		ShapeFlag_Cubemap   = unchecked((int)OverlayShape.Cubemap << OverlayShapeFlagShift),
		ShapeFlagRangeMask  = unchecked((int)0xF << OverlayShapeFlagShift),
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct Vector2i
	{
		public int x;
		public int y;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct Vector2f
	{
		public float x;
		public float y;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct Vector3f
	{
		public float x;
		public float y;
		public float z;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct Quatf
	{
		public float x;
		public float y;
		public float z;
		public float w;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct Posef
	{
		public Quatf Orientation;
		public Vector3f Position;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct ControllerState
	{
		public uint ConnectedControllers;
		public uint Buttons;
		public uint Touches;
		public uint NearTouches;
		public float LIndexTrigger;
		public float RIndexTrigger;
		public float LHandTrigger;
		public float RHandTrigger;
		public Vector2f LThumbstick;
		public Vector2f RThumbstick;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct HapticsBuffer
	{
		public IntPtr Samples;
		public int SamplesCount;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct HapticsState
	{
		public int SamplesAvailable;
		public int SamplesQueued;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct HapticsDesc
	{
		public int SampleRateHz;
		public int SampleSizeInBytes;
		public int MinimumSafeSamplesQueued;
		public int MinimumBufferSamplesCount;
		public int OptimalBufferSamplesCount;
		public int MaximumBufferSamplesCount;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct AppPerfFrameStats
	{
		public int HmdVsyncIndex;
		public int AppFrameIndex;
		public int AppDroppedFrameCount;
		public float AppMotionToPhotonLatency;
		public float AppQueueAheadTime;
		public float AppCpuElapsedTime;
		public float AppGpuElapsedTime;
		public int CompositorFrameIndex;
		public int CompositorDroppedFrameCount;
		public float CompositorLatency;
		public float CompositorCpuElapsedTime;
		public float CompositorGpuElapsedTime;
		public float CompositorCpuStartToGpuEndElapsedTime;
		public float CompositorGpuEndToVsyncElapsedTime;
	}

	public const int AppPerfFrameStatsMaxCount = 5;

	[StructLayout(LayoutKind.Sequential)]
	public struct AppPerfStats
	{
		[MarshalAs(UnmanagedType.ByValArray, SizeConst=AppPerfFrameStatsMaxCount)]
		public AppPerfFrameStats[] FrameStats;
		public int FrameStatsCount;
		public Bool AnyFrameStatsDropped;
		public float AdaptiveGpuPerformanceScale;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct Sizei
	{
		public int w;
		public int h;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct Frustumf
	{
		public float zNear;
		public float zFar;
		public float fovX;
		public float fovY;
	}

	public enum BoundaryType
	{
		OuterBoundary      = 0x0001,
		PlayArea           = 0x0100,
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct BoundaryTestResult
	{
		public Bool IsTriggering;
		public float ClosestDistance;
		public Vector3f ClosestPoint;
		public Vector3f ClosestPointNormal;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct BoundaryLookAndFeel
	{
		public Colorf Color;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct BoundaryGeometry
	{
		public BoundaryType BoundaryType;
		[MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]
		public Vector3f[] Points;
		public int PointsCount;
	}

	[StructLayout(LayoutKind.Sequential)]
	public struct Colorf
	{
		public float r;
		public float g;
		public float b;
		public float a;
	}

	public static bool initialized
	{
		get {
				return OVRP_1_1_0.ovrp_GetInitialized() == OVRPlugin.Bool.True;
		}
	}

	public static bool chromatic
	{
		get {
			if (version >= OVRP_1_7_0.version)
				return OVRP_1_7_0.ovrp_GetAppChromaticCorrection() == OVRPlugin.Bool.True;

#if UNITY_ANDROID && !UNITY_EDITOR
			return false;
#else
			return true;
#endif
		}

		set {
			if (version >= OVRP_1_7_0.version)
				OVRP_1_7_0.ovrp_SetAppChromaticCorrection(ToBool(value));
		}
	}

	public static bool monoscopic
	{
		get { return OVRP_1_1_0.ovrp_GetAppMonoscopic() == OVRPlugin.Bool.True; }
		set { OVRP_1_1_0.ovrp_SetAppMonoscopic(ToBool(value)); }
	}

	public static bool rotation
	{
		get { return OVRP_1_1_0.ovrp_GetTrackingOrientationEnabled() == Bool.True; }
		set { OVRP_1_1_0.ovrp_SetTrackingOrientationEnabled(ToBool(value)); }
	}

	public static bool position
	{
		get { return OVRP_1_1_0.ovrp_GetTrackingPositionEnabled() == Bool.True; }
		set { OVRP_1_1_0.ovrp_SetTrackingPositionEnabled(ToBool(value)); }
	}

	public static bool useIPDInPositionTracking
	{
		get {
			if (version >= OVRP_1_6_0.version)
				return OVRP_1_6_0.ovrp_GetTrackingIPDEnabled() == OVRPlugin.Bool.True;

			return true;
		}

		set {
			if (version >= OVRP_1_6_0.version)
				OVRP_1_6_0.ovrp_SetTrackingIPDEnabled(ToBool(value));
		}
	}

	public static bool positionSupported { get { return OVRP_1_1_0.ovrp_GetTrackingPositionSupported() == Bool.True; } }

	public static bool positionTracked { get { return OVRP_1_1_0.ovrp_GetNodePositionTracked(Node.EyeCenter) == Bool.True; } }

	public static bool powerSaving { get { return OVRP_1_1_0.ovrp_GetSystemPowerSavingMode() == Bool.True; } }

	public static bool hmdPresent { get { return OVRP_1_1_0.ovrp_GetNodePresent(Node.EyeCenter) == Bool.True; } }

	public static bool userPresent { get { return OVRP_1_1_0.ovrp_GetUserPresent() == Bool.True; } }

	public static bool headphonesPresent { get { return OVRP_1_3_0.ovrp_GetSystemHeadphonesPresent() == OVRPlugin.Bool.True; } }

	public static int recommendedMSAALevel
	{
		get {
			if (version >= OVRP_1_6_0.version)
				return OVRP_1_6_0.ovrp_GetSystemRecommendedMSAALevel ();
			else
				return 2;
		}
	}

	public static SystemRegion systemRegion
	{
		get {
			if (version >= OVRP_1_5_0.version)
				return OVRP_1_5_0.ovrp_GetSystemRegion();
			else
				return SystemRegion.Unspecified;
		}
	}

	private static Guid _cachedAudioOutGuid;
	private static string _cachedAudioOutString;
	public static string audioOutId
	{
		get
		{
				try
				{
					IntPtr ptr = OVRP_1_1_0.ovrp_GetAudioOutId();
					if (ptr != IntPtr.Zero)
					{
						GUID nativeGuid = (GUID)Marshal.PtrToStructure(ptr, typeof(OVRPlugin.GUID));
						Guid managedGuid = new Guid(
								nativeGuid.a,
								nativeGuid.b,
								nativeGuid.c,
								nativeGuid.d0,
								nativeGuid.d1,
								nativeGuid.d2,
								nativeGuid.d3,
								nativeGuid.d4,
								nativeGuid.d5,
								nativeGuid.d6,
								nativeGuid.d7);

						if (managedGuid != _cachedAudioOutGuid)
						{
							_cachedAudioOutGuid = managedGuid;
							_cachedAudioOutString = _cachedAudioOutGuid.ToString();
						}

						return _cachedAudioOutString;
					}
				}
			catch {}

					return string.Empty;
				}
			}

	private static Guid _cachedAudioInGuid;
	private static string _cachedAudioInString;
	public static string audioInId
	{
		get
		{
				try
				{
					IntPtr ptr = OVRP_1_1_0.ovrp_GetAudioInId();
					if (ptr != IntPtr.Zero)
					{
						GUID nativeGuid = (GUID)Marshal.PtrToStructure(ptr, typeof(OVRPlugin.GUID));
						Guid managedGuid = new Guid(
								nativeGuid.a,
								nativeGuid.b,
								nativeGuid.c,
								nativeGuid.d0,
								nativeGuid.d1,
								nativeGuid.d2,
								nativeGuid.d3,
								nativeGuid.d4,
								nativeGuid.d5,
								nativeGuid.d6,
								nativeGuid.d7);

						if (managedGuid != _cachedAudioInGuid)
						{
							_cachedAudioInGuid = managedGuid;
							_cachedAudioInString = _cachedAudioInGuid.ToString();
						}

						return _cachedAudioInString;
					}
				}
			catch {}

			return string.Empty;
		}
	}

	public static bool hasVrFocus { get { return OVRP_1_1_0.ovrp_GetAppHasVrFocus() == Bool.True; } }

	public static bool shouldQuit { get { return OVRP_1_1_0.ovrp_GetAppShouldQuit() == Bool.True; } }

	public static bool shouldRecenter { get { return OVRP_1_1_0.ovrp_GetAppShouldRecenter() == Bool.True; } }

	public static string productName { get { return OVRP_1_1_0.ovrp_GetSystemProductName(); } }

	public static string latency { get { return OVRP_1_1_0.ovrp_GetAppLatencyTimings(); } }

	public static float eyeDepth
	{
		get { return OVRP_1_1_0.ovrp_GetUserEyeDepth(); }
		set { OVRP_1_1_0.ovrp_SetUserEyeDepth(value); }
	}

	public static float eyeHeight
	{
		get { return OVRP_1_1_0.ovrp_GetUserEyeHeight(); }
		set { OVRP_1_1_0.ovrp_SetUserEyeHeight(value); }
	}

	public static float batteryLevel
	{
		get { return OVRP_1_1_0.ovrp_GetSystemBatteryLevel(); }
	}

	public static float batteryTemperature
	{
		get { return OVRP_1_1_0.ovrp_GetSystemBatteryTemperature(); }
	}

	public static int cpuLevel
	{
		get { return OVRP_1_1_0.ovrp_GetSystemCpuLevel(); }
		set { OVRP_1_1_0.ovrp_SetSystemCpuLevel(value); }
	}

	public static int gpuLevel
	{
		get { return OVRP_1_1_0.ovrp_GetSystemGpuLevel(); }
		set { OVRP_1_1_0.ovrp_SetSystemGpuLevel(value); }
	}

	public static int vsyncCount
	{
		get { return OVRP_1_1_0.ovrp_GetSystemVSyncCount(); }
		set { OVRP_1_2_0.ovrp_SetSystemVSyncCount(value); }
		}

	public static float systemVolume
	{
		get { return OVRP_1_1_0.ovrp_GetSystemVolume(); }
	}

	public static float ipd
	{
		get { return OVRP_1_1_0.ovrp_GetUserIPD(); }
		set { OVRP_1_1_0.ovrp_SetUserIPD(value); }
	}

	public static bool occlusionMesh
	{
		get { return OVRP_1_3_0.ovrp_GetEyeOcclusionMeshEnabled() == Bool.True; }
		set { OVRP_1_3_0.ovrp_SetEyeOcclusionMeshEnabled(ToBool(value)); }
	}

	public static BatteryStatus batteryStatus
	{
		get { return OVRP_1_1_0.ovrp_GetSystemBatteryStatus(); }
	}

	public static Posef GetEyeVelocity(Eye eyeId) { return GetNodeVelocity((Node)eyeId, false); }
	public static Posef GetEyeAcceleration(Eye eyeId) { return GetNodeAcceleration((Node)eyeId, false); }
	public static Frustumf GetEyeFrustum(Eye eyeId) { return OVRP_1_1_0.ovrp_GetNodeFrustum((Node)eyeId); }
	public static Sizei GetEyeTextureSize(Eye eyeId) { return OVRP_0_1_0.ovrp_GetEyeTextureSize(eyeId); }
	public static Posef GetTrackerPose(Tracker trackerId) { return GetNodePose((Node)((int)trackerId + (int)Node.TrackerZero), false); }
	public static Frustumf GetTrackerFrustum(Tracker trackerId) { return OVRP_1_1_0.ovrp_GetNodeFrustum((Node)((int)trackerId + (int)Node.TrackerZero)); }
	public static bool ShowUI(PlatformUI ui) { return OVRP_1_1_0.ovrp_ShowSystemUI(ui) == Bool.True; }
	public static bool SetOverlayQuad(bool onTop, bool headLocked, IntPtr leftTexture, IntPtr rightTexture, IntPtr device, Posef pose, Vector3f scale, int layerIndex=0, OverlayShape shape=OverlayShape.Quad)
	{
		if (version >= OVRP_1_6_0.version)
		{
			uint flags = (uint)OverlayFlag.None;
			if (onTop)
				flags |= (uint)OverlayFlag.OnTop;
			if (headLocked)
				flags |= (uint)OverlayFlag.HeadLocked;

			if (shape == OverlayShape.Cylinder || shape == OverlayShape.Cubemap)
			{
#if UNITY_ANDROID
				if (version >= OVRP_1_7_0.version)
					flags |= (uint)(shape) << OverlayShapeFlagShift;
				else
#else
				if (shape == OverlayShape.Cubemap && version >= OVRP_1_10_0.version)
					flags |= (uint)(shape) << OverlayShapeFlagShift;
				else
#endif
					return false;
			}

			return OVRP_1_6_0.ovrp_SetOverlayQuad3(flags, leftTexture, rightTexture, device, pose, scale, layerIndex) == Bool.True;
		}

		if (layerIndex != 0)
			return false;

		return OVRP_0_1_1.ovrp_SetOverlayQuad2(ToBool(onTop), ToBool(headLocked), leftTexture, device, pose, scale) == Bool.True;
	}

	public static bool UpdateNodePhysicsPoses(int frameIndex, double predictionSeconds)
	{
		if (version >= OVRP_1_8_0.version)
			return OVRP_1_8_0.ovrp_Update2(0, frameIndex, predictionSeconds) == Bool.True;

		return false;
	}

	public static Posef GetNodePose(Node nodeId, bool usePhysicsPose)
	{
		if (version >= OVRP_1_8_0.version && usePhysicsPose)
			return OVRP_1_8_0.ovrp_GetNodePose2(0, nodeId);

		return OVRP_0_1_2.ovrp_GetNodePose(nodeId);
	}

	public static Posef GetNodeVelocity(Node nodeId, bool usePhysicsPose)
	{
		if (version >= OVRP_1_8_0.version && usePhysicsPose)
			return OVRP_1_8_0.ovrp_GetNodeVelocity2(0, nodeId);

		return OVRP_0_1_3.ovrp_GetNodeVelocity(nodeId);
	}

	public static Posef GetNodeAcceleration(Node nodeId, bool usePhysicsPose)
	{
		if (version >= OVRP_1_8_0.version && usePhysicsPose)
			return OVRP_1_8_0.ovrp_GetNodeAcceleration2(0, nodeId);

		return OVRP_0_1_3.ovrp_GetNodeAcceleration(nodeId);
	}

	public static bool GetNodePresent(Node nodeId)
	{
		return OVRP_1_1_0.ovrp_GetNodePresent(nodeId) == Bool.True;
	}

	public static bool GetNodeOrientationTracked(Node nodeId)
	{
		return OVRP_1_1_0.ovrp_GetNodeOrientationTracked(nodeId) == Bool.True;
	}

	public static bool GetNodePositionTracked(Node nodeId)
	{
		return OVRP_1_1_0.ovrp_GetNodePositionTracked(nodeId) == Bool.True;
	}

	public static ControllerState GetControllerState(uint controllerMask)
	{
		return OVRP_1_1_0.ovrp_GetControllerState(controllerMask);
	}

	public static bool SetControllerVibration(uint controllerMask, float frequency, float amplitude)
	{
		return OVRP_0_1_2.ovrp_SetControllerVibration(controllerMask, frequency, amplitude) == Bool.True;
	}

	public static HapticsDesc GetControllerHapticsDesc(uint controllerMask)
	{
		if (version >= OVRP_1_6_0.version)
		{
			return OVRP_1_6_0.ovrp_GetControllerHapticsDesc(controllerMask);
		}
		else
		{
			return new HapticsDesc();
		}
	}

	public static HapticsState GetControllerHapticsState(uint controllerMask)
	{
		if (version >= OVRP_1_6_0.version)
		{
			return OVRP_1_6_0.ovrp_GetControllerHapticsState(controllerMask);
		}
		else
		{
			return new HapticsState();
		}
	}

	public static bool SetControllerHaptics(uint controllerMask, HapticsBuffer hapticsBuffer)
	{
		if (version >= OVRP_1_6_0.version)
		{
			return OVRP_1_6_0.ovrp_SetControllerHaptics(controllerMask, hapticsBuffer) == Bool.True;
		}
		else
		{
			return false;
		}
	}

	public static float GetEyeRecommendedResolutionScale()
	{
		if (version >= OVRP_1_6_0.version)
		{
			return OVRP_1_6_0.ovrp_GetEyeRecommendedResolutionScale();
		}
		else
		{
			return 1.0f;
		}
	}

	public static float GetAppCpuStartToGpuEndTime()
	{
		if (version >= OVRP_1_6_0.version)
		{
			return OVRP_1_6_0.ovrp_GetAppCpuStartToGpuEndTime();
		}
		else
		{
			return 0.0f;
		}
	}

	public static bool GetBoundaryConfigured()
	{
		if (version >= OVRP_1_8_0.version)
		{
			return OVRP_1_8_0.ovrp_GetBoundaryConfigured() == OVRPlugin.Bool.True;
		}
		else
		{
			return false;
		}
	}

	public static BoundaryTestResult TestBoundaryNode(Node nodeId, BoundaryType boundaryType)
	{
		if (version >= OVRP_1_8_0.version)
		{
			return OVRP_1_8_0.ovrp_TestBoundaryNode(nodeId, boundaryType);
		}
		else
		{
			return new BoundaryTestResult();
		}
	}

	public static BoundaryTestResult TestBoundaryPoint(Vector3f point, BoundaryType boundaryType)
	{
		if (version >= OVRP_1_8_0.version)
		{
			return OVRP_1_8_0.ovrp_TestBoundaryPoint(point, boundaryType);
		}
		else
		{
			return new BoundaryTestResult();
		}
	}

	public static bool SetBoundaryLookAndFeel(BoundaryLookAndFeel lookAndFeel)
	{
		if (version >= OVRP_1_8_0.version)
		{
			return OVRP_1_8_0.ovrp_SetBoundaryLookAndFeel(lookAndFeel) == OVRPlugin.Bool.True;
		}
		else
		{
			return false;
		}
	}

	public static bool ResetBoundaryLookAndFeel()
	{
		if (version >= OVRP_1_8_0.version)
		{
			return OVRP_1_8_0.ovrp_ResetBoundaryLookAndFeel() == OVRPlugin.Bool.True;
		}
		else
		{
			return false;
		}
	}

	public static BoundaryGeometry GetBoundaryGeometry(BoundaryType boundaryType)
	{
		if (version >= OVRP_1_8_0.version)
		{
			return OVRP_1_8_0.ovrp_GetBoundaryGeometry(boundaryType);
		}
		else
		{
			return new BoundaryGeometry();
		}
	}

	public static bool GetBoundaryGeometry2(BoundaryType boundaryType, IntPtr points, ref int pointsCount)
	{
		if (version >= OVRP_1_9_0.version)
		{
			return OVRP_1_9_0.ovrp_GetBoundaryGeometry2(boundaryType, points, ref pointsCount) == OVRPlugin.Bool.True;
		}
		else
		{
			pointsCount = 0;

			return false;
		}
	}

	public static AppPerfStats GetAppPerfStats()
	{
		if (version >= OVRP_1_9_0.version)
		{
			return OVRP_1_9_0.ovrp_GetAppPerfStats();
		}
		else
		{
			return new AppPerfStats();
		}
	}

	public static bool ResetAppPerfStats()
	{
		if (version >= OVRP_1_9_0.version)
		{
			return OVRP_1_9_0.ovrp_ResetAppPerfStats() == OVRPlugin.Bool.True;
		}
		else
		{
			return false;
		}
	}

	public static Vector3f GetBoundaryDimensions(BoundaryType boundaryType)
	{
		if (version >= OVRP_1_8_0.version)
		{
			return OVRP_1_8_0.ovrp_GetBoundaryDimensions(boundaryType);
		}
		else
		{
			return new Vector3f();
		}
	}

	public static bool GetBoundaryVisible()
	{
		if (version >= OVRP_1_8_0.version)
		{
			return OVRP_1_8_0.ovrp_GetBoundaryVisible() == OVRPlugin.Bool.True;
		}
		else
		{
			return false;
		}
	}

	public static bool SetBoundaryVisible(bool value)
	{
		if (version >= OVRP_1_8_0.version)
		{
			return OVRP_1_8_0.ovrp_SetBoundaryVisible(ToBool(value)) == OVRPlugin.Bool.True;
		}
		else
		{
			return false;
		}
	}

	public static SystemHeadset GetSystemHeadsetType()
	{
		if (version >= OVRP_1_9_0.version)
			return OVRP_1_9_0.ovrp_GetSystemHeadsetType();

		return SystemHeadset.None;
	}

	public static Controller GetActiveController()
	{
		if (version >= OVRP_1_9_0.version)
			return OVRP_1_9_0.ovrp_GetActiveController();

		return Controller.None;
	}

	public static Controller GetConnectedControllers()
	{
		if (version >= OVRP_1_9_0.version)
			return OVRP_1_9_0.ovrp_GetConnectedControllers();

		return Controller.None;
	}

	private static Bool ToBool(bool b)
	{
		return (b) ? OVRPlugin.Bool.True : OVRPlugin.Bool.False;
	}

	public static TrackingOrigin GetTrackingOriginType()
	{
		return OVRP_1_0_0.ovrp_GetTrackingOriginType();
	}

	public static bool SetTrackingOriginType(TrackingOrigin originType)
	{
		return OVRP_1_0_0.ovrp_SetTrackingOriginType(originType) == Bool.True;
	}

	public static Posef GetTrackingCalibratedOrigin()
	{
		return OVRP_1_0_0.ovrp_GetTrackingCalibratedOrigin();
	}

	public static bool SetTrackingCalibratedOrigin()
	{
		return OVRP_1_2_0.ovrpi_SetTrackingCalibratedOrigin() == Bool.True;
	}

	public static bool RecenterTrackingOrigin(RecenterFlags flags)
	{
		return OVRP_1_0_0.ovrp_RecenterTrackingOrigin((uint)flags) == Bool.True;
	}

	//HACK: This makes Unity think it always has VR focus while OVRPlugin.cs reports the correct value.
	internal static bool ignoreVrFocus
	{
		set { OVRP_1_2_1.ovrp_SetAppIgnoreVrFocus(ToBool(value)); }
	}

	private const string pluginName = "OVRPlugin";
	private static Version _versionZero = new System.Version(0, 0, 0);

	private static class OVRP_0_1_0
	{
		public static readonly System.Version version = new System.Version(0, 1, 0);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Sizei ovrp_GetEyeTextureSize(Eye eyeId);
	}

	private static class OVRP_0_1_1
	{
		public static readonly System.Version version = new System.Version(0, 1, 1);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetOverlayQuad2(Bool onTop, Bool headLocked, IntPtr texture, IntPtr device, Posef pose, Vector3f scale);
	}

	private static class OVRP_0_1_2
	{
		public static readonly System.Version version = new System.Version(0, 1, 2);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Posef ovrp_GetNodePose(Node nodeId);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetControllerVibration(uint controllerMask, float frequency, float amplitude);
	}

	private static class OVRP_0_1_3
	{
		public static readonly System.Version version = new System.Version(0, 1, 3);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Posef ovrp_GetNodeVelocity(Node nodeId);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Posef ovrp_GetNodeAcceleration(Node nodeId);
	}

	private static class OVRP_0_5_0
	{
		public static readonly System.Version version = new System.Version(0, 5, 0);
	}

	private static class OVRP_1_0_0
	{
		public static readonly System.Version version = new System.Version(1, 0, 0);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern TrackingOrigin ovrp_GetTrackingOriginType();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetTrackingOriginType(TrackingOrigin originType);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Posef ovrp_GetTrackingCalibratedOrigin();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_RecenterTrackingOrigin(uint flags);
	}

	private static class OVRP_1_1_0
	{
		public static readonly System.Version version = new System.Version(1, 1, 0);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetInitialized();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ovrp_GetVersion")]
		private static extern IntPtr _ovrp_GetVersion();
		public static string ovrp_GetVersion() { return Marshal.PtrToStringAnsi(_ovrp_GetVersion()); }

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ovrp_GetNativeSDKVersion")]
		private static extern IntPtr _ovrp_GetNativeSDKVersion();
		public static string ovrp_GetNativeSDKVersion() { return Marshal.PtrToStringAnsi(_ovrp_GetNativeSDKVersion()); }

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr ovrp_GetAudioOutId();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr ovrp_GetAudioInId();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float ovrp_GetEyeTextureScale();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetEyeTextureScale(float value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetTrackingOrientationSupported();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetTrackingOrientationEnabled();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetTrackingOrientationEnabled(Bool value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetTrackingPositionSupported();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetTrackingPositionEnabled();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetTrackingPositionEnabled(Bool value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetNodePresent(Node nodeId);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetNodeOrientationTracked(Node nodeId);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetNodePositionTracked(Node nodeId);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Frustumf ovrp_GetNodeFrustum(Node nodeId);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern ControllerState ovrp_GetControllerState(uint controllerMask);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int ovrp_GetSystemCpuLevel();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetSystemCpuLevel(int value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int ovrp_GetSystemGpuLevel();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetSystemGpuLevel(int value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetSystemPowerSavingMode();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float ovrp_GetSystemDisplayFrequency();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int ovrp_GetSystemVSyncCount();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float ovrp_GetSystemVolume();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern BatteryStatus ovrp_GetSystemBatteryStatus();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float ovrp_GetSystemBatteryLevel();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float ovrp_GetSystemBatteryTemperature();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ovrp_GetSystemProductName")]
		private static extern IntPtr _ovrp_GetSystemProductName();
		public static string ovrp_GetSystemProductName() { return Marshal.PtrToStringAnsi(_ovrp_GetSystemProductName()); }

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_ShowSystemUI(PlatformUI ui);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetAppMonoscopic();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetAppMonoscopic(Bool value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetAppHasVrFocus();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetAppShouldQuit();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetAppShouldRecenter();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl, EntryPoint = "ovrp_GetAppLatencyTimings")]
		private static extern IntPtr _ovrp_GetAppLatencyTimings();
		public static string ovrp_GetAppLatencyTimings() { return Marshal.PtrToStringAnsi(_ovrp_GetAppLatencyTimings()); }

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetUserPresent();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float ovrp_GetUserIPD();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetUserIPD(float value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float ovrp_GetUserEyeDepth();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetUserEyeDepth(float value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float ovrp_GetUserEyeHeight();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetUserEyeHeight(float value);
	}

	private static class OVRP_1_2_0
	{
		public static readonly System.Version version = new System.Version(1, 2, 0);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetSystemVSyncCount(int vsyncCount);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrpi_SetTrackingCalibratedOrigin();
	}

	private static class OVRP_1_2_1
	{
		public static readonly System.Version version = new System.Version(1, 2, 1);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetAppIgnoreVrFocus(Bool value);
	}

	private static class OVRP_1_3_0
	{
		public static readonly System.Version version = new System.Version(1, 3, 0);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetEyeOcclusionMeshEnabled();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetEyeOcclusionMeshEnabled(Bool value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetSystemHeadphonesPresent();
	}

	private static class OVRP_1_5_0
	{
		public static readonly System.Version version = new System.Version(1, 5, 0);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SystemRegion ovrp_GetSystemRegion();
	}

	private static class OVRP_1_6_0
	{
		public static readonly System.Version version = new System.Version(1, 6, 0);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetTrackingIPDEnabled();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetTrackingIPDEnabled(Bool value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern HapticsDesc ovrp_GetControllerHapticsDesc(uint controllerMask);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern HapticsState ovrp_GetControllerHapticsState(uint controllerMask);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetControllerHaptics(uint controllerMask, HapticsBuffer hapticsBuffer);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetOverlayQuad3(uint flags, IntPtr textureLeft, IntPtr textureRight, IntPtr device, Posef pose, Vector3f scale, int layerIndex);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float ovrp_GetEyeRecommendedResolutionScale();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float ovrp_GetAppCpuStartToGpuEndTime();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int ovrp_GetSystemRecommendedMSAALevel();
	}

	private static class OVRP_1_7_0
	{
		public static readonly System.Version version = new System.Version(1, 7, 0);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetAppChromaticCorrection();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetAppChromaticCorrection(Bool value);
	}

	private static class OVRP_1_8_0
	{
		public static readonly System.Version version = new System.Version(1, 8, 0);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetBoundaryConfigured();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern BoundaryTestResult ovrp_TestBoundaryNode(Node nodeId, BoundaryType boundaryType);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern BoundaryTestResult ovrp_TestBoundaryPoint(Vector3f point, BoundaryType boundaryType);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetBoundaryLookAndFeel(BoundaryLookAndFeel lookAndFeel);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_ResetBoundaryLookAndFeel();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern BoundaryGeometry ovrp_GetBoundaryGeometry(BoundaryType boundaryType);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Vector3f ovrp_GetBoundaryDimensions(BoundaryType boundaryType);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetBoundaryVisible();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_SetBoundaryVisible(Bool value);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_Update2(int stateId, int frameIndex, double predictionSeconds);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Posef ovrp_GetNodePose2(int stateId, Node nodeId);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Posef ovrp_GetNodeVelocity2(int stateId, Node nodeId);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Posef ovrp_GetNodeAcceleration2(int stateId, Node nodeId);
	}

	private static class OVRP_1_9_0
	{
		public static readonly System.Version version = new System.Version(1, 9, 0);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SystemHeadset ovrp_GetSystemHeadsetType();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Controller ovrp_GetActiveController();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Controller ovrp_GetConnectedControllers();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_GetBoundaryGeometry2(BoundaryType boundaryType, IntPtr points, ref int pointsCount);

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern AppPerfStats ovrp_GetAppPerfStats();

		[DllImport(pluginName, CallingConvention = CallingConvention.Cdecl)]
		public static extern Bool ovrp_ResetAppPerfStats();
	}

	private static class OVRP_1_10_0
	{
		public static readonly System.Version version = new System.Version(1, 10, 0);
	}
}


text:
package com.sun.jdmk.discovery;

import java.util.*;
import java.net.*;
import java.io.*;

// jmx-remote
import javax.management.remote.JMXServiceURL;

// ------------------------
// jdmk import
// ------------------------
import javax.management.*;
import com.sun.jdmk.*;
import com.sun.jdmk.comm.ConnectorAddress;
import com.sun.jdmk.comm.RmiConnectorAddress;
import com.sun.jdmk.comm.HttpConnectorAddress;
import com.sun.jdmk.comm.HttpsConnectorAddress;

class ResponsePDU extends DiscoveryMsg {

    private static final long serialVersionUID = -1917939025172594153L;

// ----------------------------------------------------------
// Private variables
// ----------------------------------------------------------
	private Hashtable	objectList	      = new Hashtable () ;
	private boolean		evt		      = false ;
	private int		agtState	      = DiscoveryMonitor.OFFLINE ;
	private String		mbeanServerId	      = null ;
	private String		specificationName     = null ;
	private String		specificationVersion  = null ;
	private String		specificationVendor   = null ;
	private String		implementationName    = null ;
	private String		implementationVersion = null ;
	private String		implementationVendor  = null ;
	private byte[] 	        userData              = null ;

// ----------------------------------------------------------
// Constructor
// ----------------------------------------------------------
  public ResponsePDU (	String mbeanServerId,
			String specificationName,
			String specificationVendor,
			String specificationVersion,
			String implementationName,
			String implementationVendor ,
			String implementationVersion,
			byte[] data) {

	this.mbeanServerId         = mbeanServerId ;
	this.specificationName     = specificationName ;
	this.specificationVersion  = specificationVersion ;
	this.specificationVendor   = specificationVendor ;
	this.implementationName    = implementationName ;
	this.implementationVersion = implementationVersion ;
	this.implementationVendor  = implementationVendor ;
	this.userData              = data;
  }

// ----------------------------------------------------------
// print method
// ----------------------------------------------------------
  public String printState () {
        String state = new String () ;

        // ------------------------
        // Time stamp
        // ------------------------
        state =  state + "(TimeStamp=" + getTimeStamp() + ")";

        // ------------------------
        // Event flag
        // ------------------------
        state =  state + "(Event=" + getEvent() + ")";

        // ------------------------
        // agent state
        // ------------------------
	if ( getEvent() == true ) {
		String s  = null ;
		if ( getAgentState() == DiscoveryMonitor.ONLINE ) s = "ONLINE" ;
		if ( getAgentState() == DiscoveryMonitor.OFFLINE ) s = "OFFLINE" ;
		if ( getAgentState() == DiscoveryMonitor.STOPPING ) s = "STOPPING" ;
        	state =  state + "(Agent State =" + s + ")";
	}

        // ------------------------
        // Ttl
        // ------------------------
        state =  state + "(Ttl=" + getTimeToLive() + ")";

        // ------------------------
        // local Host
        // ------------------------
        state = state + "(local host = " + getHost() + ")" ;

        // ------------------------
        // mbeanServer info
        // ------------------------
        state = state + "(mbeanServerId = "         + mbeanServerId + ")" ;
	state = state + "(specificationName = "     + specificationName + ")" ;
	state = state + "(specificationVersion = "  + specificationVersion + ")" ;
	state = state + "(specificationVendor = "   + specificationVendor + ")" ;
	state = state + "(implementationName = "    + implementationName + ")" ;
	state = state + "(implementationVersion = " + implementationVersion + ")" ;
	state = state + "(implementationVendor = "  + implementationVendor + ")" ;

        // ------------------------
        // object list
        // ------------------------
	if ( objectList != null ) {
		state = state + "(objects " ;
		for( Enumeration e= objectList.keys(); e.hasMoreElements(); ) {
			ObjectName o= (ObjectName) e.nextElement();
			state = state + "-  name=" + o + " addr=" + toString(objectList.get(o)) ;
		}
		state = state + ")" ;
	} else {
		state = state + "(No object)" ;
	}

        return state ;
  }

// ----------------------------------------------------------
// MbeanServer information
// ----------------------------------------------------------
  public String getMbeanServerId () {
	return mbeanServerId ;
  }
  public String getSpecificationName() {
	return specificationName ;
  }
  public String getSpecificationVersion() {
	return specificationVersion ;
  }
  public String getSpecificationVendor() {
	return specificationVendor ;
  }
  public String getImplementationName() {
	return implementationName ;
  }
  public String getImplementationVersion() {
	return implementationVersion ;
  }
  public String getImplementationVendor() {
	return implementationVendor ;
  }
  public byte[] getUserData() {
	return userData ;
  }

// ----------------------------------------------------------
// event flag
// ----------------------------------------------------------
  public void setEvent (boolean evt ) {
	this.evt = evt;
  }
  public boolean getEvent () {
	return evt ;
  }

// ----------------------------------------------------------
// agent state flag
// ----------------------------------------------------------
  public void setAgentState (int agtState ) {
	this.agtState = agtState;
  }
  public int getAgentState () {
	return agtState ;
  }

// ----------------------------------------------------------
// adaptor list method
// ----------------------------------------------------------
  public Hashtable getObjectList () {
	return objectList ;
  }

  public void addObjectList (ObjectName name, ConnectorAddress addr) {
		if (addr !=  null ) {
			this.objectList.put(name,addr) ;
		} else {
			this.objectList.put(name,"Not Relevant") ;
		}
  }

// ----------------------------------------------------------
// Private method
// ----------------------------------------------------------
  private String toString(Object addr) {
	if ( addr instanceof RmiConnectorAddress ) {
		RmiConnectorAddress address = (RmiConnectorAddress) addr ;
		return "type:" + address.getConnectorType() + ";host:" + address.getHost() + ";port:" + address.getPort() + ";name:" + address.getName() ;
	}

	if ( addr instanceof HttpConnectorAddress ) {
		HttpConnectorAddress address = (HttpConnectorAddress) addr ;
		return "type:" + address.getConnectorType() + ";host:" + address.getHost() + ";port:" + address.getPort() ;
	}

	if ( addr instanceof HttpsConnectorAddress ) {
		HttpsConnectorAddress address = (HttpsConnectorAddress) addr ;
		return "type:" + address.getConnectorType() + ";host:" + address.getHost() + ";port:" + address.getPort() ;
	}

	return addr.toString()  ;
  }

    // used for jmx-remote connectors
    JMXServiceURL[]  serverAddresses;
}


text:
@interface ComExampleAndroidDisplayingbitmapsUtilUtils : NSObject

#pragma mark Public

+ (void)enableStrictMode;

+ (jboolean)hasFroyo;

+ (jboolean)hasGingerbread;

+ (jboolean)hasHoneycomb;

+ (jboolean)hasHoneycombMR1;

+ (jboolean)hasJellyBean;

+ (jboolean)hasKitKat;

@end

J2OBJC_EMPTY_STATIC_INIT(ComExampleAndroidDisplayingbitmapsUtilUtils)

FOUNDATION_EXPORT void ComExampleAndroidDisplayingbitmapsUtilUtils_enableStrictMode();

FOUNDATION_EXPORT jboolean ComExampleAndroidDisplayingbitmapsUtilUtils_hasFroyo();

FOUNDATION_EXPORT jboolean ComExampleAndroidDisplayingbitmapsUtilUtils_hasGingerbread();

FOUNDATION_EXPORT jboolean ComExampleAndroidDisplayingbitmapsUtilUtils_hasHoneycomb();

FOUNDATION_EXPORT jboolean ComExampleAndroidDisplayingbitmapsUtilUtils_hasHoneycombMR1();

FOUNDATION_EXPORT jboolean ComExampleAndroidDisplayingbitmapsUtilUtils_hasJellyBean();

FOUNDATION_EXPORT jboolean ComExampleAndroidDisplayingbitmapsUtilUtils_hasKitKat();

J2OBJC_TYPE_LITERAL_HEADER(ComExampleAndroidDisplayingbitmapsUtilUtils)

#endif // _ComExampleAndroidDisplayingbitmapsUtilUtils_H_


text:
import path from 'path';

export const NODE_MODULES = path.sep + 'node_modules' + path.sep;
export const DEFAULT_JS_PATTERN = '^.+\\.[jt]sx?$';
export const DEFAULT_REPORTER_LABEL = 'default';
export const PACKAGE_JSON = 'package.json';
export const JEST_CONFIG = 'jest.config.js';


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

    Copyright 2003 - 2019 The eFaps Team

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

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

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

-->
<datamodel-type xmlns="http://www.efaps.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd">
    <uuid>5aef8988-00e7-42e1-8f2b-07127a829241</uuid>
    <file-application>eFapsApp-POS</file-application>
    <definition>
        <version-expression>(version==latest)</version-expression>
        <name>POS_Workspace</name>
        <attribute>
            <name>OID</name>
            <type>OID</type>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>ID</sqlcolumn>
        </attribute>
        <attribute>
            <name>ID</name>
            <type>Long</type>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>ID</sqlcolumn>
        </attribute>
        <attribute>
            <name>Company</name>
            <type>CompanyLink</type>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>COMPANYID</sqlcolumn>
        </attribute>
        <attribute>
            <name>Name</name>
            <type>String</type>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>NAME</sqlcolumn>
        </attribute>
        <attribute>
            <name>Description</name>
            <type>String</type>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>DESCR</sqlcolumn>
        </attribute>
        <attribute>
            <name>POSLink</name>
            <type>LinkWithRanges</type>
            <typelink>POS_POS</typelink>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>POSID</sqlcolumn>
            <trigger event="RANGE_VALUE" name="POS_Workspace.POSLink.RANGE_VALUE"
                program="org.efaps.esjp.admin.datamodel.RangesValue">
                <property name="Value">Name</property>
                <property name="Type">POS_POS</property>
            </trigger>
        </attribute>
        <attribute>
            <name>DocTypes</name>
            <type>BitEnum</type>
            <className>org.efaps.esjp.pos.util.Pos$DocType</className>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>DOCTYPES</sqlcolumn>
        </attribute>
        <attribute>
            <name>SpotConfig</name>
            <type>Enum</type>
            <defaultvalue>0</defaultvalue>
            <className>org.efaps.esjp.pos.util.Pos$SpotConfig</className>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>SPOTCONF</sqlcolumn>
        </attribute>
        <attribute>
            <name>SpotCount</name>
            <type>Integer</type>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>SPOTCOUNT</sqlcolumn>
        </attribute>
        <attribute>
            <name>WarehouseLink</name>
            <type>LinkWithRanges</type>
            <typelink>Products_Warehouse</typelink>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>WAREHOUSEID</sqlcolumn>
            <trigger event="RANGE_VALUE" name="POS_Workspace.WarehouseLink.RANGE_VALUE"
                program="org.efaps.esjp.admin.datamodel.RangesValue">
                <property name="Value">Name</property>
                <property name="Type">Products_Warehouse</property>
                <property name="EmptyValue">true</property>
            </trigger>
        </attribute>
        <attributeset>
            <name>PrintCmdSet</name>
            <type>MultiLineArray</type>
            <parent>POS_AttributeSetAbstract</parent>
            <sqltable>POS_AttributeSetSQLTable</sqltable>
            <sqlcolumn>RELID</sqlcolumn>
            <uuid>30293a34-0ac7-4843-bd5f-7d1c53e79ca0</uuid>
            <attribute>
                <name>PrinterLink</name>
                <type>LinkWithRanges</type>
                <typelink>POS_Printer</typelink>
                <sqltable>POS_AttributeSetSQLTable</sqltable>
                <sqlcolumn>INT1</sqlcolumn>
                <trigger event="RANGE_VALUE" name="POS_Workspace.PrintCmdSet.PrinterLink.RANGE_VALUE"
                    program="org.efaps.esjp.admin.datamodel.RangesValue">
                    <property name="Value">Name</property>
                    <property name="Type">POS_Printer</property>
                </trigger>
            </attribute>
            <attribute>
                <name>PrintTarget</name>
                <type>Enum</type>
                <className>org.efaps.esjp.pos.util.Pos$PrintTarget</className>
                <sqltable>POS_AttributeSetSQLTable</sqltable>
                <sqlcolumn>INT2</sqlcolumn>
            </attribute>
            <attribute>
                <name>TargetLink</name>
                <type>LinkWithRanges</type>
                <typelink>POS_Category</typelink>
                <sqltable>POS_AttributeSetSQLTable</sqltable>
                <sqlcolumn>INT3</sqlcolumn>
                <trigger event="RANGE_VALUE" name="POS_Workspace.PrintCmdSet.TargetLink.RANGE_VALUE"
                    program="org.efaps.esjp.admin.datamodel.RangesValue">
                    <property name="Value">$<attribute[Name]> - $<attribute[Description]></property>
                    <property name="Type">POS_Category</property>
                    <property name="EmptyValue">true</property>
                </trigger>
            </attribute>
            <attribute>
                <name>ReportLink</name>
                <type>LinkWithRanges</type>
                <typelink>Admin_Program_JasperReportCompiled</typelink>
                <sqltable>POS_AttributeSetSQLTable</sqltable>
                <sqlcolumn>INT4</sqlcolumn>
                <trigger event="RANGE_VALUE" name="POS_Workspace.PrintCmdSet.ReportLink.RANGE_VALUE"
                    program="org.efaps.esjp.admin.datamodel.RangesValue">
                    <property name="Value">$<attribute[Name]></property>
                    <property name="Type">Admin_Program_JasperReportCompiled</property>
                </trigger>
            </attribute>
        </attributeset>
        <attribute>
            <name>PosLayout</name>
            <type>Enum</type>
            <className>org.efaps.esjp.pos.util.Pos$PosLayout</className>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>POSLAYOUT</sqlcolumn>
        </attribute>
        <attribute>
            <name>GridSize</name>
            <type>Enum</type>
            <className>org.efaps.esjp.pos.util.Pos$GridSize</className>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>GRIDSIZE</sqlcolumn>
        </attribute>
        <attribute>
            <name>Flags</name>
            <type>BitEnum</type>
            <className>org.efaps.esjp.pos.util.Pos$WorkspaceFlag</className>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>FLAGS</sqlcolumn>
        </attribute>
        <attributeset>
            <name>DiscountSet</name>
            <type>MultiLineArray</type>
            <parent>POS_AttributeSetAbstract</parent>
            <sqltable>POS_AttributeSetSQLTable</sqltable>
            <sqlcolumn>RELID</sqlcolumn>
            <uuid>91c384ef-fe13-4f0e-88fc-68dbaeaffa99</uuid>
            <attribute>
                <name>DiscountType</name>
                <type>Enum</type>
                <className>org.efaps.esjp.pos.util.Pos$DiscountType</className>
                <sqltable>POS_AttributeSetSQLTable</sqltable>
                <sqlcolumn>INT1</sqlcolumn>
            </attribute>
            <attribute>
                <name>Value</name>
                <type>Decimal</type>
                <sqltable>POS_AttributeSetSQLTable</sqltable>
                <sqlcolumn>DEC1</sqlcolumn>
            </attribute>
            <attribute>
                <name>Label</name>
                <type>String</type>
                <sqltable>POS_AttributeSetSQLTable</sqltable>
                <sqlcolumn>STR1</sqlcolumn>
            </attribute>
            <attribute>
                <name>ProductLink</name>
                <type>LinkWithRanges</type>
                <typelink>Products_ProductTextPosition</typelink>
                <sqltable>POS_AttributeSetSQLTable</sqltable>
                <sqlcolumn>INT2</sqlcolumn>
                <trigger event="RANGE_VALUE" name="POS_Workspace.DiscountSet.ProductLink.RANGE_VALUE"
                    program="org.efaps.esjp.admin.datamodel.RangesValue">
                    <property name="Value">$<attribute[Name]>-$<Description></property>
                    <property name="Type">Products_ProductTextPosition</property>
                </trigger>
            </attribute>
        </attributeset>
        <attributeset>
            <name>CardSet</name>
            <type>MultiLineArray</type>
            <parent>POS_AttributeSetAbstract</parent>
            <sqltable>POS_AttributeSetSQLTable</sqltable>
            <sqlcolumn>RELID</sqlcolumn>
            <uuid>fac487dd-b67a-4f20-b9c6-e9b52346a917</uuid>
            <attribute>
                <name>CardLabel</name>
                <type>String</type>
                <sqltable>POS_AttributeSetSQLTable</sqltable>
                <sqlcolumn>STR1</sqlcolumn>
            </attribute>
            <attribute>
                <name>CardType</name>
                <type>LinkWithRanges</type>
                <typelink>Sales_AttributeDefinitionPaymentCardType</typelink>
                <sqltable>POS_AttributeSetSQLTable</sqltable>
                <sqlcolumn>INT1</sqlcolumn>
                <trigger program="org.efaps.esjp.admin.datamodel.RangesValue"
                     name="POS_Workspace.CardSet.CardType.RANGE_VALUE"
                     event="RANGE_VALUE">
                    <property name="Value">$<attribute[Value]> - $<attribute[Description]></property>
                    <property name="Type">Sales_AttributeDefinitionPaymentCardType</property>
                </trigger>
            </attribute>
        </attributeset>
        <attribute>
            <name>Creator</name>
            <type>CreatorLink</type>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>CREATOR</sqlcolumn>
        </attribute>
        <attribute>
            <name>Created</name>
            <type>Created</type>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>CREATED</sqlcolumn>
        </attribute>
        <attribute>
            <name>Modifier</name>
            <type>ModifierLink</type>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>MODIFIER</sqlcolumn>
        </attribute>
        <attribute>
            <name>Modified</name>
            <type>Modified</type>
            <sqltable>POS_WorkspaceSQLTable</sqltable>
            <sqlcolumn>MODIFIED</sqlcolumn>
        </attribute>
    </definition>
</datamodel-type>


text:
class Submission < ApplicationRecord
  has_many :submitted_documents
  has_many :document_matches, through: :submitted_documents

  has_one :grade

  belongs_to :evaluation
  belongs_to :user

  accepts_nested_attributes_for :submitted_documents

  scope :for, ->(user) { where(user: user) }

  scope :similar_to, lambda { |reference|
    joins(:document_matches)
      .where.not(id: reference.id)
      .group(:id)
      .select("#{quoted_table_name}.*, (sum(document_matches.similarity) / count(documents.id)) as accuracy")
      .order("accuracy DESC")
  }

  validates(
    :submitted_documents,
    :evaluation,
    :user,
    presence: true,
  )

  def accuracy
    @accuracy = self[:accuracy].to_f if has_attribute?(:accuracy)
    @accuracy ||= 0.0
  end

  def compare_with(other)
    document_matches.where(compared_document_id: other.submitted_documents.ids)
  end

  def sanitizable_documents
    submitted_documents
  end
end


text:
package jbomberman.game;

import jbomberman.network.NetworkFacade;

public class ActionDispatcher extends Thread {

	private NetworkFacade network;
	private ActionQueue queue;
	public boolean run;

	public ActionDispatcher(NetworkFacade network, ActionQueue queue) {
		this.network = network;
		this.queue = queue;
		this.setDaemon(true);
		run = true;
	}

	@Override
	public void run() {
		while(run) {
			queue.put(ActionSerializer.deserialize(network.receiveMessage()));
		}
	}

}


text:
class IntrinsicEdNodeView : public QDockWidget
{
  Q_OBJECT

public:
  IntrinsicEdNodeView(QWidget* parent = 0);
  ~IntrinsicEdNodeView();

  void populateNodeTree();
  void onNodeCreatedOrDestroyed(Resources::EventRef p_Event);

private:
  Ui::InstrinsicEdNodeViewClass _ui;
};


text:
<?xml version="1.0"?>
<!DOCTYPE delegatemap [
<!ELEMENT delegatemap (delegate)+>
<!ELEMENT delegate (#PCDATA)>
<!ATTLIST delegate decode CDATA #IMPLIED>
<!ATTLIST delegate encode CDATA #IMPLIED>
<!ATTLIST delegate mode CDATA #IMPLIED>
<!ATTLIST delegate spawn CDATA #IMPLIED>
<!ATTLIST delegate stealth CDATA #IMPLIED>
<!ATTLIST delegate thread-support CDATA #IMPLIED>
<!ATTLIST delegate command CDATA #REQUIRED>
]>
<!--
  Delegate command file.

  Commands which specify

    decode="in_format" encode="out_format"

  specify the rules for converting from in_format to out_format These
  rules may be used to translate directly between formats.

  Commands which specify only

    decode="in_format"

  specify the rules for converting from in_format to some format that
  ImageMagick will automatically recognize. These rules are used to
  decode formats.

  Commands which specify only

   encode="out_format"

  specify the rules for an "encoder" which may accept any input format.

  For delegates other than ps:alpha, ps:color, ps:mono, and mpeg-encode the
  substitution rules are as follows:

    %i  input image filename
    %o  output image filename
    %u  unique temporary filename
    %z  secondary unique temporary filename

    %#  input image signature
    %b  image file size
    %c  input image comment
    %g  window group
    %h  image rows (height)
    %k  input image number colors
    %m  input image format
    %p  page number
    %q  input image depth
    "%s"  scene number
    %w  image columns (width)
    %x  input image x resolution
    %y  input image y resolution

-->
<delegatemap>
  <delegate decode="autotrace" stealth="True" command="autotrace -output-format svg -output-file "%o" "%i""/>
  <delegate decode="png" encode="launch" spawn="True" mode="encode" command="cmd.exe /C start "%m" file:///"%i."" />
  <delegate decode="png" encode="show" spawn="True" mode="encode" command="cmd.exe /C start "%m" file:///"%i."" />
  <delegate decode="png" encode="win" spawn="True" mode="encode" command="cmd.exe /C start "%m" file:///"%i."" />
  <delegate decode="browse" stealth="True" spawn="True" command="cmd /C start "" http://www.imagemagick.org/"/>
  <delegate decode="cgm" thread-support="False" command="ralcgm -d ps "%i." "%o." "%u.""/>
  <delegate decode="compress" stealth="True" command="|uncompress -c "%i""/>
  <delegate decode="dng:decode" stealth="True" command="dcraw.exe -6 -w -O "%u.ppm" "%i""/>
  <delegate decode="dot" command="dot -Tps "%i" -o "%o""/>
  <delegate decode="dvi" command="dvips -q -o "%o" "%i""/>
  <delegate decode="edit" stealth="True" command="notepad "%o""/>
  <delegate decode="emf" command="emfplus.exe -format png -dpi %xx%y "%i" "%o""/>
  <delegate decode="eps" encode="pdf" mode="bi" command=""@PSDelegate@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -sDEVICE=pdfwrite "-sOutputFile=%o" -- "%i""/>
  <delegate decode="eps" encode="ps" mode="bi" command=""@PSDelegate@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=pswrite "-sOutputFile=%o" -- "%i""/>
  <delegate decode="fig" command="/usr/X11R6/bin/fig2dev -L ps "%i" "%o""/>
  <delegate decode="gplt" command="/bin/echo "set size 1.25,0.62     set terminal postscript portrait color solid; set output "%o"; load "%i"" > "%u";gnuplot %u"/>
  <delegate decode="hpg" command="hp2xx -q -m eps -f "%o" "%i""/>
  <delegate decode="hpgl" command="hp2xx -q -m eps -f "%o" "%i""/>
  <delegate decode="htm" command="html2ps -U -o "%o" "%i""/>
  <delegate decode="html" command="html2ps -U -o "%o" "%i""/>
  <delegate decode="ilbm" command="ilbmtoppm "%i" > "%o""/>
  <delegate decode="man" command="groff -man -Tps "%i" > "%o""/>
  <delegate decode="miff" encode="compress" stealth="True" command="|compress -c > "%o""/>
  <delegate decode="mpeg:decode" command=""ffmpeg.exe" -v -1 -i "%i" -vframes %S -vcodec pam -an -f rawvideo -y "%u.pam""/>
  <delegate decode="pcl:cmyk" stealth="True" command=""pcl6.exe" -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pamcmyk32" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "%s""/>
  <delegate decode="pcl:color" stealth="True" command=""pcl6.exe" -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=ppmraw" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "%s""/>
  <delegate decode="pcl:mono" stealth="True" command=""pcl6.exe" -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pbmraw" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "%s""/>
  <delegate decode="pdf" encode="eps" mode="bi" command=""@PSDelegate@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -sDEVICE=epswrite "-sOutputFile=%o" -- "%i""/>
  <delegate decode="pdf" encode="ps" mode="bi" command=""@PSDelegate@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=pswrite "-sOutputFile=%o" -- "%i""/>
  <delegate decode="pgp" command="pgpv -fq "%i""/>
  <delegate decode="pnm" encode="ilbm" mode="encode" command="ppmtoilbm -24if "%i" > "%o""/>
  <delegate decode="pov" command="povray "+i"%i"" -D0 +o"%o" +fn%q +w%w +h%h +a -q9 -kfi"%s" -kff"%n"     convert -concatenate %o*.png "%o""/>
  <delegate decode="ps:alpha" stealth="True" command=""@PSDelegate@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>
  <delegate decode="ps:cmyk" stealth="True" command=""@PSDelegate@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pamcmyk32" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>
  <delegate decode="ps:color" stealth="True" command=""@PSDelegate@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pnmraw" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>
  <delegate decode="ps" encode="eps" mode="bi" command=""@PSDelegate@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=epswrite "-sOutputFile=%o" -- "%i""/>
  <delegate decode="ps" encode="pdf" mode="bi" command=""@PSDelegate@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=pdfwrite "-sOutputFile=%o" -- "%i""/>
  <delegate decode="ps:mono" stealth="True" command=""@PSDelegate@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pnmraw" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>
  <delegate decode="rgba" encode="rle" mode="encode" command="pnmtorle -o "%o" -v "%i""/>
  <delegate decode="scan" command="scanimage -d "%i" > "%o""/>
  <delegate decode="shtml" command="html2ps -U -o "%o" "%i""/>
  <delegate decode="sid" command="mrsidgeodecode -if sid -i "%i" -of tif -o "%o" > "%u""/>
  <delegate decode="svg" command=""rsvg-convert" -o "%o" "%i""/>
  <delegate decode="svg:decode" stealth="True" command=""inkscape" "%s" --export-png="%s" --export-dpi="%s" --export-background="%s" --export-background-opacity="%s" > "%s" 2>&1"/>
  <delegate decode="txt" encode="ps" mode="bi" command="enscript -o "%o" "%i""/>
  <delegate decode="wmf" command="emfplus.exe -format png -dpi %xx%y "%i" "%o""/>
  <delegate decode="xcf" command="xcftopnm "%i" > "%o""/>
  <delegate decode="xps:cmyk" stealth="True" command=""gxps.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pamcmyk32" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "%s""/>
  <delegate decode="xps:color" stealth="True" command=""gxps.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pnmraw" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "%s""/>
  <delegate decode="xps:mono" stealth="True" command=""gxps.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pbmraw" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "%s""/>
  <delegate encode="mpeg:encode" stealth="True" command=""ffmpeg.exe" -v -1 -i "%M%%d.jpg" "%u.%m""/>
  <delegate decode="jxr" command="mv "%i" "%i.jxr"; "@JXRDecodeDelegate@" -i "%i.jxr" -o "%o.pnm"; mv "%i.jxr" "%i"; mv "%o.pnm" "%o""/>
  <delegate decode="wdp" command="mv "%i" "%i.jxr"; "@JXRDecodeDelegate@" -i "%i.jxr" -o "%o.pnm"; mv "%i.jxr" "%i"; mv "%o.pnm" "%o""/>
  <delegate decode="pnm" encode="jxr" command="mv "%i" "%i.pnm"; "@JXREncodeDelegate@" -i "%i.pnm" -o "%o.jxr"; mv "%i.pnm" "%i"; mv "%o.jxr" "%o""/>
  <delegate decode="pnm" encode="wdp" command="mv "%i" "%i.pnm"; "@JXREncodeDelegate@" -i "%i.pnm" -o "%o.jxr"; mv "%i.pnm" "%i"; mv "%o.jxr" "%o""/>
</delegatemap>


text:
package org.hoteia.qalingo.core.solr.bean;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.solr.client.solrj.beans.Field;

public class ProductSkuSolr {

    @Field
    private Long id;

    @Field
    private String description;

    private Boolean isDefault;

    @Field
    private Boolean enabledToB2C;

    @Field
    private String code;

    @Field
    private String name;

    @Field
    private String productBrandCode;

    @Field
    private String defaultCategoryCode;

    @Field
    private String price;

    @Field
    private List<String> catalogCodes = new ArrayList<String>();

    @Field
    private List<String> catalogCategories = new ArrayList<String>();

    @Field
    private List<String> tags = new ArrayList<String>();

    @Field
    private List<String> optionDefinitions = new ArrayList<String>();

    @Field
    private String random;

    @Field("datecreate")
    private Date dateCreate;

    @Field("dateupdate")
    private Date dateUpdate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Boolean getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(Boolean isDefault) {
        this.isDefault = isDefault;
    }

    public Boolean getEnabledToB2C() {
        return enabledToB2C;
    }

    public void setEnabledToB2C(Boolean enabledToB2C) {
        this.enabledToB2C = enabledToB2C;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getProductBrandCode() {
        return productBrandCode;
    }

    public void setProductBrandCode(String productBrandCode) {
        this.productBrandCode = productBrandCode;
    }

    public String getDefaultCategoryCode() {
        return defaultCategoryCode;
    }

    public void setDefaultCategoryCode(String defaultCategoryCode) {
        this.defaultCategoryCode = defaultCategoryCode;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public List<String> getCatalogCodes() {
        return catalogCodes;
    }

    public void setCatalogCodes(List<String> catalogCodes) {
        this.catalogCodes = catalogCodes;
    }

    public void addCatalogCode(String catalogCode){
        if(this.catalogCodes == null){
            this.catalogCodes = new ArrayList<String>();
        }
        if(!this.catalogCodes.contains(catalogCode)){
            this.catalogCodes.add(catalogCode);
        }
    }

    public List<String> getCatalogCategories() {
        return catalogCategories;
    }

    public void setCatalogCategories(List<String> catalogCategories) {
        this.catalogCategories = catalogCategories;
    }

    public void addCatalogCategories(String catalogCategoryCode){
        if(this.catalogCategories == null){
            this.catalogCategories = new ArrayList<String>();
        }
        if(!this.catalogCategories.contains(catalogCategoryCode)){
            this.catalogCategories.add(catalogCategoryCode);
        }
    }

    public List<String> getTags() {
        return tags;
    }

    public void addTag(String tag){
        if(this.tags == null){
            this.tags = new ArrayList<String>();
        }
        if(!this.tags.contains(tag)){
            this.tags.add(tag);
        }
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public List<String> getOptionDefinitions() {
        return optionDefinitions;
    }

    public void addOptionDefinition(String optionDefinition){
        if(this.optionDefinitions == null){
            this.optionDefinitions = new ArrayList<String>();
        }
        if(!this.optionDefinitions.contains(optionDefinition)){
            this.optionDefinitions.add(optionDefinition);
        }
    }

    public void setOptionDefinitions(List<String> optionDefinitions) {
        this.optionDefinitions = optionDefinitions;
    }

    public void addTags(String tag){
        if(this.tags == null){
            this.tags = new ArrayList<String>();
        }
        if(!this.tags.contains(tag)){
            this.tags.add(tag);
        }
    }

    public String getRandom() {
        return random;
    }

    public void setRandom(String random) {
        this.random = random;
    }

    public Date getDateCreate() {
        return dateCreate;
    }

    public void setDateCreate(Date dateCreate) {
        this.dateCreate = dateCreate;
    }

    public Date getDateUpdate() {
        return dateUpdate;
    }

    public void setDateUpdate(Date dateUpdate) {
        this.dateUpdate = dateUpdate;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((code == null) ? 0 : code.hashCode());
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        ProductSkuSolr other = (ProductSkuSolr) obj;
        if (code == null) {
            if (other.code != null)
                return false;
        } else if (!code.equals(other.code))
            return false;
        if (id == null) {
            if (other.id != null)
                return false;
        } else if (!id.equals(other.id))
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "ProductSkuSolr [id=" + id + ", description=" + description + ", isDefault=" + isDefault + ", code=" + code + ", name=" + name + ", defaultCategoryCode=" + defaultCategoryCode
                + ", catalogCodes=" + catalogCodes + ", price=" + price + ", dateCreate=" + dateCreate + ", dateUpdate=" + dateUpdate + "]";
    }

}


text:
require 'test_helper'

class LalalaTest < ActiveSupport::TestCase
  test "truth" do
    assert_kind_of Module, Lalala
  end
end


text:
from django.db import migrations, models

class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='ReaderSource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('source_url', models.URLField(max_length=700, unique=True)),
                ('title', models.CharField(max_length=500)),
                ('thumbnail_url', models.URLField(max_length=700)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
    ]


text:
<component name="ProjectCodeStyleConfiguration">
  <code_scheme name="Project" version="173">
    <codeStyleSettings language="JAVA">
      <option name="BRACE_STYLE" value="2" />
      <option name="CLASS_BRACE_STYLE" value="2" />
      <option name="METHOD_BRACE_STYLE" value="2" />
      <option name="LAMBDA_BRACE_STYLE" value="2" />
      <option name="KEEP_SIMPLE_BLOCKS_IN_ONE_LINE" value="true" />
      <option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
      <option name="KEEP_SIMPLE_LAMBDAS_IN_ONE_LINE" value="true" />
      <option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
    </codeStyleSettings>
  </code_scheme>
</component>


text:
var getTotalWidth = function( pages, marginLeft, marginRight ){
    if( !(pages instanceof $) && !(pages instanceof jQuery) ){
        throw new Error('A valid jQuery element was not passed as the first parameter');
    }
    if( typeof marginLeft !== 'number' || typeof marginRight !== 'number' ) {
        throw new Error('Margin paramters are not valid');
    }
    var totalWidth = 0;
    pages.each(function (index, page) {
        totalWidth += $(page).width() + marginRight + marginLeft;
    });
    return totalWidth;
}


text:
The history of Twitterwall releases is documented below. For details of changes refer to the [project's GitHub issues][twitterwall-issues] or the [GitHub report][github-report].

[twitterwall-issues]: https://github.com/phasenraum2010/twitterwall2/issues?state=closed
[github-report]: github-report.html

## 1.0.0 / 2017-07-02

-   Initial release of Twitterwall.


text:
from __future__ import print_function

import argparse
import calendar
import json
import os
import sys
import time
import uuid
import massage_qps_stats

gcp_utils_dir = os.path.abspath(
    os.path.join(os.path.dirname(__file__), '../../gcp/utils'))
sys.path.append(gcp_utils_dir)
import big_query_utils

_PROJECT_ID = 'grpc-testing'

def _upload_netperf_latency_csv_to_bigquery(dataset_id, table_id, result_file):
    with open(result_file, 'r') as f:
        (col1, col2, col3) = f.read().split(',')
        latency50 = float(col1.strip()) * 1000
        latency90 = float(col2.strip()) * 1000
        latency99 = float(col3.strip()) * 1000

        scenario_result = {
            'scenario': {
                'name': 'netperf_tcp_rr'
            },
            'summary': {
                'latency50': latency50,
                'latency90': latency90,
                'latency99': latency99
            }
        }

    bq = big_query_utils.create_big_query()
    _create_results_table(bq, dataset_id, table_id)

    if not _insert_result(
            bq, dataset_id, table_id, scenario_result, flatten=False):
        print('Error uploading result to bigquery.')
        sys.exit(1)

def _upload_scenario_result_to_bigquery(dataset_id, table_id, result_file):
    with open(result_file, 'r') as f:
        scenario_result = json.loads(f.read())

    bq = big_query_utils.create_big_query()
    _create_results_table(bq, dataset_id, table_id)

    if not _insert_result(bq, dataset_id, table_id, scenario_result):
        print('Error uploading result to bigquery.')
        sys.exit(1)

def _insert_result(bq, dataset_id, table_id, scenario_result, flatten=True):
    if flatten:
        _flatten_result_inplace(scenario_result)
    _populate_metadata_inplace(scenario_result)
    row = big_query_utils.make_row(str(uuid.uuid4()), scenario_result)
    return big_query_utils.insert_rows(bq, _PROJECT_ID, dataset_id, table_id,
                                       [row])

def _create_results_table(bq, dataset_id, table_id):
    with open(os.path.dirname(__file__) + '/scenario_result_schema.json',
              'r') as f:
        table_schema = json.loads(f.read())
    desc = 'Results of performance benchmarks.'
    return big_query_utils.create_table2(bq, _PROJECT_ID, dataset_id, table_id,
                                         table_schema, desc)

def _flatten_result_inplace(scenario_result):
    """Bigquery is not really great for handling deeply nested data
  and repeated fields. To maintain values of some fields while keeping
  the schema relatively simple, we artificially leave some of the fields
  as JSON strings.
  """
    scenario_result['scenario']['clientConfig'] = json.dumps(
        scenario_result['scenario']['clientConfig'])
    scenario_result['scenario']['serverConfig'] = json.dumps(
        scenario_result['scenario']['serverConfig'])
    scenario_result['latencies'] = json.dumps(scenario_result['latencies'])
    scenario_result['serverCpuStats'] = []
    for stats in scenario_result['serverStats']:
        scenario_result['serverCpuStats'].append(dict())
        scenario_result['serverCpuStats'][-1]['totalCpuTime'] = stats.pop(
            'totalCpuTime', None)
        scenario_result['serverCpuStats'][-1]['idleCpuTime'] = stats.pop(
            'idleCpuTime', None)
    for stats in scenario_result['clientStats']:
        stats['latencies'] = json.dumps(stats['latencies'])
        stats.pop('requestResults', None)
    scenario_result['serverCores'] = json.dumps(scenario_result['serverCores'])
    scenario_result['clientSuccess'] = json.dumps(
        scenario_result['clientSuccess'])
    scenario_result['serverSuccess'] = json.dumps(
        scenario_result['serverSuccess'])
    scenario_result['requestResults'] = json.dumps(
        scenario_result.get('requestResults', []))
    scenario_result['serverCpuUsage'] = scenario_result['summary'].pop(
        'serverCpuUsage', None)
    scenario_result['summary'].pop('successfulRequestsPerSecond', None)
    scenario_result['summary'].pop('failedRequestsPerSecond', None)
    massage_qps_stats.massage_qps_stats(scenario_result)

def _populate_metadata_inplace(scenario_result):
    """Populates metadata based on environment variables set by Jenkins."""
    # NOTE: Grabbing the Jenkins environment variables will only work if the
    # driver is running locally on the same machine where Jenkins has started
    # the job. For our setup, this is currently the case, so just assume that.
    build_number = os.getenv('BUILD_NUMBER')
    build_url = os.getenv('BUILD_URL')
    job_name = os.getenv('JOB_NAME')
    git_commit = os.getenv('GIT_COMMIT')
    # actual commit is the actual head of PR that is getting tested
    git_actual_commit = os.getenv('ghprbActualCommit')

    utc_timestamp = str(calendar.timegm(time.gmtime()))
    metadata = {'created': utc_timestamp}

    if build_number:
        metadata['buildNumber'] = build_number
    if build_url:
        metadata['buildUrl'] = build_url
    if job_name:
        metadata['jobName'] = job_name
    if git_commit:
        metadata['gitCommit'] = git_commit
    if git_actual_commit:
        metadata['gitActualCommit'] = git_actual_commit

    scenario_result['metadata'] = metadata

argp = argparse.ArgumentParser(description='Upload result to big query.')
argp.add_argument(
    '--bq_result_table',
    required=True,
    default=None,
    type=str,
    help='Bigquery "dataset.table" to upload results to.')
argp.add_argument(
    '--file_to_upload',
    default='scenario_result.json',
    type=str,
    help='Report file to upload.')
argp.add_argument(
    '--file_format',
    choices=['scenario_result', 'netperf_latency_csv'],
    default='scenario_result',
    help='Format of the file to upload.')

args = argp.parse_args()

dataset_id, table_id = args.bq_result_table.split('.', 2)

if args.file_format == 'netperf_latency_csv':
    _upload_netperf_latency_csv_to_bigquery(dataset_id, table_id,
                                            args.file_to_upload)
else:
    _upload_scenario_result_to_bigquery(dataset_id, table_id,
                                        args.file_to_upload)
print('Successfully uploaded %s to BigQuery.\n' % args.file_to_upload)


text:
package research.android.pl.akaczorowski.placeholderui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

public class MainActivity extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.AppTheme);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setElevation(8);
  }
}


text:
<div [formGroup]="formGroup" class="form-group">
  <label for="{{ config.name }}">
    {{ config.label }}

    <ng-container *ngIf="showAsterisk(config)">
      *
    </ng-container>
  </label>
  <input
    type="file"
    appFileInput
    [formControlName]="config.name"
    class="form-control-file"
    [id]="config.name"
  />

  <div appFormFieldError class="invalid-feedback" [fieldConfig]="config"></div>
</div>