text:
package alicloud

import (
	"fmt"

	"time"

	"reflect"

	"github.com/alibaba/terraform-provider/alicloud/connectivity"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/services/ess"
	"github.com/hashicorp/terraform/helper/resource"
	"github.com/hashicorp/terraform/helper/schema"
)

func resourceAlicloudEssScalingGroup() *schema.Resource {
	return &schema.Resource{
		Create: resourceAliyunEssScalingGroupCreate,
		Read:   resourceAliyunEssScalingGroupRead,
		Update: resourceAliyunEssScalingGroupUpdate,
		Delete: resourceAliyunEssScalingGroupDelete,
		Importer: &schema.ResourceImporter{
			State: schema.ImportStatePassthrough,
		},

		Schema: map[string]*schema.Schema{
			"min_size": &schema.Schema{
				Type:         schema.TypeInt,
				Required:     true,
				ValidateFunc: validateIntegerInRange(0, 100),
			},
			"max_size": &schema.Schema{
				Type:         schema.TypeInt,
				Required:     true,
				ValidateFunc: validateIntegerInRange(0, 100),
			},
			"scaling_group_name": &schema.Schema{
				Type:     schema.TypeString,
				Optional: true,
			},
			"default_cooldown": &schema.Schema{
				Type:         schema.TypeInt,
				Default:      300,
				Optional:     true,
				ValidateFunc: validateIntegerInRange(0, 86400),
			},
			"vswitch_id": &schema.Schema{
				Type:       schema.TypeString,
				Optional:   true,
				Deprecated: "Field 'vswitch_id' has been deprecated from provider version 1.7.1, and new field 'vswitch_ids' can replace it.",
			},
			"vswitch_ids": &schema.Schema{
				Type:     schema.TypeSet,
				Optional: true,
				ForceNew: true,
				Elem:     &schema.Schema{Type: schema.TypeString},
				MinItems: 1,
			},
			"removal_policies": &schema.Schema{
				Type:     schema.TypeSet,
				Elem:     &schema.Schema{Type: schema.TypeString},
				Optional: true,
				MaxItems: 2,
				MinItems: 1,
			},
			"db_instance_ids": &schema.Schema{
				Type:     schema.TypeSet,
				Elem:     &schema.Schema{Type: schema.TypeString},
				Optional: true,
				ForceNew: true,
				MinItems: 1,
			},
			"loadbalancer_ids": &schema.Schema{
				Type:     schema.TypeSet,
				Elem:     &schema.Schema{Type: schema.TypeString},
				Optional: true,
				ForceNew: true,
				MinItems: 0,
			},
			"multi_az_policy": &schema.Schema{
				Type:         schema.TypeString,
				Optional:     true,
				Default:      Priority,
				ValidateFunc: validateAllowedStringValue([]string{string(Priority), string(Balance)}),
				ForceNew:     true,
			},
		},
	}
}

func resourceAliyunEssScalingGroupCreate(d *schema.ResourceData, meta interface{}) error {

	args, err := buildAlicloudEssScalingGroupArgs(d, meta)
	if err != nil {
		return err
	}

	client := meta.(*connectivity.AliyunClient)

	if err := resource.Retry(5*time.Minute, func() *resource.RetryError {
		raw, err := client.WithEssClient(func(essClient *ess.Client) (interface{}, error) {
			return essClient.CreateScalingGroup(args)
		})
		if err != nil {
			if IsExceptedError(err, EssThrottling) {
				return resource.RetryableError(fmt.Errorf("CreateScalingGroup timeout and got an error: %#v.", err))
			}
			return resource.NonRetryableError(fmt.Errorf("CreateScalingGroup got an error: %#v.", err))
		}
		scaling, _ := raw.(*ess.CreateScalingGroupResponse)
		d.SetId(scaling.ScalingGroupId)
		return nil
	}); err != nil {
		return err
	}

	return resourceAliyunEssScalingGroupUpdate(d, meta)
}

func resourceAliyunEssScalingGroupRead(d *schema.ResourceData, meta interface{}) error {

	client := meta.(*connectivity.AliyunClient)
	essService := EssService{client}

	scaling, err := essService.DescribeScalingGroupById(d.Id())
	if err != nil {
		if NotFoundError(err) {
			d.SetId("")
			return nil
		}
		return fmt.Errorf("Error Describe ESS scaling group Attribute: %#v", err)
	}

	d.Set("min_size", scaling.MinSize)
	d.Set("max_size", scaling.MaxSize)
	d.Set("scaling_group_name", scaling.ScalingGroupName)
	d.Set("default_cooldown", scaling.DefaultCooldown)
	var polices []string
	if len(scaling.RemovalPolicies.RemovalPolicy) > 0 {
		for _, v := range scaling.RemovalPolicies.RemovalPolicy {
			polices = append(polices, v)
		}
	}
	d.Set("removal_policies", polices)
	var dbIds []string
	if len(scaling.DBInstanceIds.DBInstanceId) > 0 {
		for _, v := range scaling.DBInstanceIds.DBInstanceId {
			dbIds = append(dbIds, v)
		}
	}
	d.Set("db_instance_ids", dbIds)

	var slbIds []string
	if len(scaling.LoadBalancerIds.LoadBalancerId) > 0 {
		for _, v := range scaling.LoadBalancerIds.LoadBalancerId {
			slbIds = append(slbIds, v)
		}
	}
	d.Set("loadbalancer_ids", slbIds)

	var vswitchIds []string
	if len(scaling.VSwitchIds.VSwitchId) > 0 {
		for _, v := range scaling.VSwitchIds.VSwitchId {
			vswitchIds = append(vswitchIds, v)
		}
	}
	d.Set("vswitch_ids", vswitchIds)

	return nil
}

func resourceAliyunEssScalingGroupUpdate(d *schema.ResourceData, meta interface{}) error {

	client := meta.(*connectivity.AliyunClient)
	args := ess.CreateModifyScalingGroupRequest()
	args.ScalingGroupId = d.Id()

	d.Partial(true)

	if d.HasChange("scaling_group_name") {
		args.ScalingGroupName = d.Get("scaling_group_name").(string)
		d.SetPartial("scaling_group_name")
	}

	if d.HasChange("min_size") {
		args.MinSize = requests.NewInteger(d.Get("min_size").(int))
		d.SetPartial("min_size")
	}

	if d.HasChange("max_size") {
		args.MaxSize = requests.NewInteger(d.Get("max_size").(int))
		d.SetPartial("max_size")
	}

	if d.HasChange("default_cooldown") {
		args.DefaultCooldown = requests.NewInteger(d.Get("default_cooldown").(int))
		d.SetPartial("default_cooldown")
	}

	if d.HasChange("removal_policies") {
		policyies := d.Get("removal_policies").(*schema.Set).List()
		s := reflect.ValueOf(args).Elem()
		for i, p := range policyies {
			s.FieldByName(fmt.Sprintf("RemovalPolicy%d", i+1)).Set(reflect.ValueOf(p.(string)))
		}
		d.SetPartial("removal_policies")
	}

	_, err := client.WithEssClient(func(essClient *ess.Client) (interface{}, error) {
		return essClient.ModifyScalingGroup(args)
	})
	if err != nil {
		return err
	}

	d.Partial(false)

	return resourceAliyunEssScalingGroupRead(d, meta)
}

func resourceAliyunEssScalingGroupDelete(d *schema.ResourceData, meta interface{}) error {
	client := meta.(*connectivity.AliyunClient)
	essService := EssService{client}
	return essService.DeleteScalingGroupById(d.Id())
}

func buildAlicloudEssScalingGroupArgs(d *schema.ResourceData, meta interface{}) (*ess.CreateScalingGroupRequest, error) {
	client := meta.(*connectivity.AliyunClient)
	slbService := SlbService{client}
	args := ess.CreateCreateScalingGroupRequest()

	args.MinSize = requests.NewInteger(d.Get("min_size").(int))
	args.MaxSize = requests.NewInteger(d.Get("max_size").(int))
	args.DefaultCooldown = requests.NewInteger(d.Get("default_cooldown").(int))

	if v := d.Get("scaling_group_name").(string); v != "" {
		args.ScalingGroupName = v
	}

	if v, ok := d.GetOk("vswitch_ids"); ok {
		ids := expandStringList(v.(*schema.Set).List())
		args.VSwitchIds = &ids
	}

	if dbs, ok := d.GetOk("db_instance_ids"); ok {
		args.DBInstanceIds = convertListToJsonString(dbs.(*schema.Set).List())
	}

	if lbs, ok := d.GetOk("loadbalancer_ids"); ok {
		for _, lb := range lbs.(*schema.Set).List() {
			if err := slbService.WaitForLoadBalancer(lb.(string), Active, DefaultTimeout); err != nil {
				return nil, fmt.Errorf("WaitForLoadbalancer %s %s got error: %#v", lb.(string), Active, err)
			}
		}
		args.LoadBalancerIds = convertListToJsonString(lbs.(*schema.Set).List())
	}

	if v := d.Get("multi_az_policy").(string); v != "" {
		args.MultiAZPolicy = v
	}

	return args, nil
}


text:
'use strict';

// Configuring the A module
angular.module('accomodations').run(['Menus',
	function(Menus) {
		// Set top bar menu items
		Menus.addMenuItem('topbar', 'Accomodations', 'accomodations', 'dropdown', '/accomodations(/create)?');
		Menus.addSubMenuItem('topbar', 'accomodations', 'List Accomodations', 'accomodations');
		Menus.addSubMenuItem('topbar', 'accomodations', 'New Accomodation', 'accomodations/create');
		Menus.addMenuItem('topbar', 'List a Property', 'accomodations/create',  'accomodations/create');
	}
]);

redpajama_set_name: RedPajamaGithub


text:
(function () {
    'use strict';

    angular
        .module('portal')
        .config(ConfigConfig)

    function ConfigConfig($mdThemingProvider, $mdIconProvider, $stateProvider) {
        $mdIconProvider.defaultIconSet("./assets/svg/avatars.svg", 128)
            .icon("menu", "./assets/svg/menu.svg", 24)
            .icon("share", "./assets/svg/share.svg", 24)
            .icon("google_plus", "./assets/svg/google_plus.svg", 512)
            .icon("hangouts", "./assets/svg/hangouts.svg", 512)
            .icon("twitter", "./assets/svg/twitter.svg", 512)
            .icon("phone", "./assets/svg/phone.svg", 512);
        $mdThemingProvider.theme('default').primaryPalette('teal').accentPalette('orange');
        $stateProvider.state('futuras', {
            url: "",
            templateUrl: "src/layout.html",
            abstract: true
        }).state('futuras.home', {
            url: "/home",
            templateUrl: "src/home/view/actualite.html",
            controller: "actualiteCtrl",
            controllerAs: "$ctrl"
        }).state("futuras.profile", {
            url: "/profile",
            templateUrl: "src/profile/view/profile.html",
            controller: "ProfileCtrl",
            controllerAs: "$ctrl"
        }).state("futuras.offre-add", {
            url: "/offre-add",
            templateUrl: "src/offre/ajouter.html",
            controller: "OffreCtrl",
            controllerAs: "$ctrl"
        }).state("futuras.propositions", {
            url: "/propositions",
            templateUrl: "src/offre/proposition.html",
            controller: "PropositionCtrl",
            controllerAs: "$ctrl"
        }).state("login", {
            url: "/login",
            templateUrl: "src/authentification/view/login.html",
            controller: function(UserService, $state){
                vm = this;
                vm.login = login;

                function login(){
                    UserService.login(vm.user).then(function(){
                        $state.go("futuras.login");
                    });
                }
            },
            controllerAs: '$ctrl'
        }).state("inscription", {
            url: "/inscription",
            templateUrl: "src/authentification/view/inscription.html",
            controller: "inscriptionCtrl",
            controllerAs: '$ctrl'
        });
    }

} ());


text:
<resources>

    <style name="stfContainer">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">match_parent</item>
        <item name="android:gravity">center</item>
        <item name="android:orientation">vertical</item>
    </style>

    <style name="stfProgress">
        <item name="android:layout_width">@dimen/stfProgressSize</item>
        <item name="android:layout_height">@dimen/stfProgressSize</item>
    </style>

    <style name="stfImage">
        <item name="android:layout_width">@dimen/stfImageSize</item>
        <item name="android:layout_height">@dimen/stfImageSize</item>
        <item name="android:tint">@color/stfImageColor</item>
    </style>

    <style name="stfMessage">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_marginLeft">20dp</item>
        <item name="android:layout_marginRight">20dp</item>
        <item name="android:layout_marginTop">10dp</item>
        <item name="android:gravity">center</item>
    </style>

    <style name="stfButton">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_marginTop">10dp</item>
        <item name="android:gravity">center</item>
    </style>

</resources>


text:
<DataCollectorSet>
<Name>PAL - SQL Server 2012</Name>
<DisplayName>PAL - SQL Server 2012</DisplayName>
<DisplayNameUnresolved>PAL - SQL Server 2012</DisplayNameUnresolved>
<Description>Data Collector Sets from PAL, a performance monitor data aggregation tool by Microsoft. The toolset was created by Microsoft PFE Clint Huffman who worked with fellow experts to create a list specialized lists of counters. You can find the project at github.com/clinthuffman/PAL</Description>
<DescriptionUnresolved>Data Collector Sets from PAL, a performance monitor data aggregation tool by Microsoft. The toolset was created by Microsoft PFE Clint Huffman who worked with fellow experts to create a list specialized lists of counters. You can find the project at github.com/clinthuffman/PAL</DescriptionUnresolved>
<SubdirectoryFormat>3</SubdirectoryFormat>
<SubdirectoryFormatPattern>yyyyMMdd\-NNNNNN</SubdirectoryFormatPattern>
<PerformanceCounterDataCollector>
    <Name>PAL - SQL Server 2012 Collector</Name>
    <SampleInterval>15</SampleInterval>
    <Counter>\Cache\Dirty Pages</Counter>
    <Counter>\Cache\Lazy Write Flushes/sec</Counter>
    <Counter>\LogicalDisk(*)\% Free Space</Counter>
    <Counter>\LogicalDisk(*)\% Idle Time</Counter>
    <Counter>\LogicalDisk(*)\Avg. Disk Bytes/Read</Counter>
    <Counter>\LogicalDisk(*)\Avg. Disk Bytes/Transfer</Counter>
    <Counter>\LogicalDisk(*)\Avg. Disk Bytes/Write</Counter>
    <Counter>\LogicalDisk(*)\Avg. Disk Queue Length</Counter>
    <Counter>\LogicalDisk(*)\Avg. Disk sec/Read</Counter>
    <Counter>\LogicalDisk(*)\Avg. Disk sec/Transfer</Counter>
    <Counter>\LogicalDisk(*)\Avg. Disk sec/Write</Counter>
    <Counter>\LogicalDisk(*)\Current Disk Queue Length</Counter>
    <Counter>\LogicalDisk(*)\Disk Bytes/sec</Counter>
    <Counter>\LogicalDisk(*)\Disk Reads/sec</Counter>
    <Counter>\LogicalDisk(*)\Disk Transfers/sec</Counter>
    <Counter>\LogicalDisk(*)\Disk Writes/sec</Counter>
    <Counter>\LogicalDisk(*)\Free Megabytes</Counter>
    <Counter>\Memory\% Committed Bytes In Use</Counter>
    <Counter>\Memory\Available MBytes</Counter>
    <Counter>\Memory\Commit Limit</Counter>
    <Counter>\Memory\Committed Bytes</Counter>
    <Counter>\Memory\Free & Zero Page List Bytes</Counter>
    <Counter>\Memory\Free System Page Table Entries</Counter>
    <Counter>\Memory\Long-Term Average Standby Cache Lifetime (s)</Counter>
    <Counter>\Memory\Pages Input/sec</Counter>
    <Counter>\Memory\Pages Output/sec</Counter>
    <Counter>\Memory\Pages/sec</Counter>
    <Counter>\Memory\Pool Nonpaged Bytes</Counter>
    <Counter>\Memory\Pool Paged Bytes</Counter>
    <Counter>\Memory\Pool Paged Resident Bytes</Counter>
    <Counter>\Memory\System Cache Resident Bytes</Counter>
    <Counter>\Memory\Transition Pages RePurposed/sec</Counter>
    <Counter>\MSRS 2011 Web Service\Cache Misses/Sec</Counter>
    <Counter>\MSRS 2011 Web Service\Report Requests</Counter>
    <Counter>\MSRS 2011 Web Service\Total Memory Cache Misses</Counter>
    <Counter>\MSRS 2011 Web Service\Total Requests</Counter>
    <Counter>\Network Inspection System\Average inspection latency (sec/bytes)</Counter>
    <Counter>\Network Interface(*)\Bytes Received/sec</Counter>
    <Counter>\Network Interface(*)\Bytes Sent/sec</Counter>
    <Counter>\Network Interface(*)\Bytes Total/sec</Counter>
    <Counter>\Network Interface(*)\Current Bandwidth</Counter>
    <Counter>\Network Interface(*)\Output Queue Length</Counter>
    <Counter>\Network Interface(*)\Packets Outbound Errors</Counter>
    <Counter>\Network Interface(*)\Packets Received/sec</Counter>
    <Counter>\Network Interface(*)\Packets Sent/sec</Counter>
    <Counter>\Network Interface(*)\Packets/sec</Counter>
    <Counter>\Paging File(*)\% Usage</Counter>
    <Counter>\PhysicalDisk(*)\Avg. Disk Queue Length</Counter>
    <Counter>\PhysicalDisk(*)\Avg. Disk sec/Read</Counter>
    <Counter>\PhysicalDisk(*)\Avg. Disk sec/Write</Counter>
    <Counter>\PhysicalDisk(*)\Current Disk Queue Length</Counter>
    <Counter>\PhysicalDisk(*)\Disk Bytes/sec</Counter>
    <Counter>\Process(*)\Handle Count</Counter>
    <Counter>\Process(*)\ID Process</Counter>
    <Counter>\Process(*)\IO Data Operations/sec</Counter>
    <Counter>\Process(*)\IO Other Operations/sec</Counter>
    <Counter>\Process(*)\IO Read Operations/sec</Counter>
    <Counter>\Process(*)\IO Write Operations/sec</Counter>
    <Counter>\Process(*)\Private Bytes</Counter>
    <Counter>\Process(*)\Thread Count</Counter>
    <Counter>\Process(*)\Virtual Bytes</Counter>
    <Counter>\Process(*)\Working Set</Counter>
    <Counter>\Process(sqlservr)\% Privileged Time</Counter>
    <Counter>\Process(sqlservr)\% Processor Time</Counter>
    <Counter>\Processor Information(*)\% DPC Time</Counter>
    <Counter>\Processor Information(*)\% Interrupt Time</Counter>
    <Counter>\Processor Information(*)\% of Maximum Frequency</Counter>
    <Counter>\Processor Information(*)\% Privileged Time</Counter>
    <Counter>\Processor Information(*)\% Processor Time</Counter>
    <Counter>\Processor Information(*)\% User Time</Counter>
    <Counter>\Processor Information(*)\DPC Rate</Counter>
    <Counter>\Processor Information(*)\Parking Status</Counter>
    <Counter>\Processor(*)\% DPC Time</Counter>
    <Counter>\Processor(*)\% Interrupt Time</Counter>
    <Counter>\Processor(*)\% Privileged Time</Counter>
    <Counter>\Processor(*)\% Processor Time</Counter>
    <Counter>\Processor(*)\% User Time</Counter>
    <Counter>\Processor(*)\DPC Rate</Counter>
    <Counter>\ReportServer:Service\Errors Total</Counter>
    <Counter>\ReportServer:Service\Errors/sec</Counter>
    <Counter>\ReportServer:Service\Memory Pressure State</Counter>
    <Counter>\ReportServer:Service\Memory Shrink Amount</Counter>
    <Counter>\ReportServer:Service\Memory Shrink Notifications/sec</Counter>
    <Counter>\Server\Pool Nonpaged Failures</Counter>
    <Counter>\Server\Pool Paged Failures</Counter>
    <Counter>\SQLAgent:Jobs\Active jobs</Counter>
    <Counter>\SQLAgent:Jobs\Failed jobs</Counter>
    <Counter>\SQLAgent:Jobs\Job success rate</Counter>
    <Counter>\SQLAgent:Jobs\Successful jobs</Counter>
    <Counter>\SQLAgent:JobSteps\Active steps</Counter>
    <Counter>\SQLAgent:JobSteps\Total step retries</Counter>
    <Counter>\SQLServer:Access Methods\Forwarded Records/sec</Counter>
    <Counter>\SQLServer:Access Methods\FreeSpace Scans/sec</Counter>
    <Counter>\SQLServer:Access Methods\Full Scans/sec</Counter>
    <Counter>\SQLServer:Access Methods\Index Searches/sec</Counter>
    <Counter>\SQLServer:Access Methods\Page Splits/sec</Counter>
    <Counter>\SQLServer:Access Methods\Scan Point Revalidations/sec</Counter>
    <Counter>\SQLServer:Access Methods\Table Lock Escalations/sec</Counter>
    <Counter>\SQLServer:Access Methods\Workfiles Created/sec</Counter>
    <Counter>\SQLServer:Access Methods\Worktables Created/sec</Counter>
    <Counter>\SQLServer:Access Methods\Worktables From Cache Ratio</Counter>
    <Counter>\SQLServer:Availability Replica(*)\Bytes Received from Replica/sec</Counter>
    <Counter>\SQLServer:Availability Replica(*)\Bytes Sent to Replica/sec</Counter>
    <Counter>\SQLServer:Availability Replica(*)\Bytes Sent to Transport/sec</Counter>
    <Counter>\SQLServer:Availability Replica(_Total)\Receives from Replica/sec</Counter>
    <Counter>\SQLServer:Availability Replica(_Total)\Resent Messages/sec</Counter>
    <Counter>\SQLServer:Availability Replica(_Total)\Sends to Replica/sec</Counter>
    <Counter>\SQLServer:Buffer Manager\Background writer pages/sec</Counter>
    <Counter>\SQLServer:Buffer Manager\Buffer cache hit ratio</Counter>
    <Counter>\SQLServer:Buffer Manager\Checkpoint pages/sec</Counter>
    <Counter>\SQLServer:Buffer Manager\Free list stalls/sec</Counter>
    <Counter>\SQLServer:Buffer Manager\Free pages</Counter>
    <Counter>\SQLServer:Buffer Manager\Lazy writes/sec</Counter>
    <Counter>\SQLServer:Buffer Manager\Page life expectancy</Counter>
    <Counter>\SQLServer:Buffer Manager\Page lookups/sec</Counter>
    <Counter>\SQLServer:Buffer Manager\Page reads/sec</Counter>
    <Counter>\SQLServer:Buffer Manager\Page writes/sec</Counter>
    <Counter>\SQLServer:Buffer Manager\Readahead pages/sec</Counter>
    <Counter>\SQLServer:Buffer Manager\Target pages</Counter>
    <Counter>\SQLServer:Buffer Node(*)\Database pages</Counter>
    <Counter>\SQLServer:Buffer Node(*)\Foreign pages</Counter>
    <Counter>\SQLServer:Buffer Node(*)\Local node page lookups/sec</Counter>
    <Counter>\SQLServer:Buffer Node(*)\Page life expectancy</Counter>
    <Counter>\SQLServer:Buffer Node(*)\Remote node page lookups/sec</Counter>
    <Counter>\SQLServer:Database Replica(*)\Log Bytes Received/sec</Counter>
    <Counter>\SQLServer:Database Replica(*)\Mirrored Write Transactions/sec</Counter>
    <Counter>\SQLServer:Database Replica(*)\Recovery Queue</Counter>
    <Counter>\SQLServer:Database Replica(_Total)\Log remaining for undo</Counter>
    <Counter>\SQLServer:Database Replica(_Total)\Log Send Queue</Counter>
    <Counter>\SQLServer:Database Replica(_Total)\Redo blocked/sec</Counter>
    <Counter>\SQLServer:Database Replica(_Total)\Redo Bytes Remaining</Counter>
    <Counter>\SQLServer:Database Replica(_Total)\Redone Bytes/sec</Counter>
    <Counter>\SQLServer:Database Replica(_Total)\Total Log requiring undo</Counter>
    <Counter>\SQLServer:Database Replica(_Total)\Transaction Delay</Counter>
    <Counter>\SQLServer:Databases(*)\Active Transactions</Counter>
    <Counter>\SQLServer:Databases(*)\Backup/Restore Throughput/sec</Counter>
    <Counter>\SQLServer:Databases(*)\Bulk Copy Throughput/sec</Counter>
    <Counter>\SQLServer:Databases(*)\Data File(s) Size (KB)</Counter>
    <Counter>\SQLServer:Databases(*)\Log Bytes Flushed/sec</Counter>
    <Counter>\SQLServer:Databases(*)\Log File(s) Size (KB)</Counter>
    <Counter>\SQLServer:Databases(*)\Log File(s) Used Size (KB)</Counter>
    <Counter>\SQLServer:Databases(*)\Log Flush Wait Time</Counter>
    <Counter>\SQLServer:Databases(*)\Log Flush Waits/sec</Counter>
    <Counter>\SQLServer:Databases(*)\Log Flushes/sec</Counter>
    <Counter>\SQLServer:Databases(*)\Log Growths</Counter>
    <Counter>\SQLServer:Databases(*)\Log Shrinks</Counter>
    <Counter>\SQLServer:Databases(*)\Log Truncations</Counter>
    <Counter>\SQLServer:Databases(*)\Percent Log Used</Counter>
    <Counter>\SQLServer:Deprecated Features(*)\Usage</Counter>
    <Counter>\SQLServer:General Statistics\Active Temp Tables</Counter>
    <Counter>\SQLServer:General Statistics\Logins/sec</Counter>
    <Counter>\SQLServer:General Statistics\Logouts/sec</Counter>
    <Counter>\SQLServer:General Statistics\Temp Tables Creation Rate</Counter>
    <Counter>\SQLServer:General Statistics\Temp Tables For Destruction</Counter>
    <Counter>\SQLServer:General Statistics\User Connections</Counter>
    <Counter>\SQLServer:Latches\Latch Waits/sec</Counter>
    <Counter>\SQLServer:Latches\Total Latch Wait Time (ms)</Counter>
    <Counter>\SQLServer:Locks(*)\Average Wait Time (ms)</Counter>
    <Counter>\SQLServer:Locks(*)\Lock Requests/sec</Counter>
    <Counter>\SQLServer:Locks(*)\Lock Timeouts/sec</Counter>
    <Counter>\SQLServer:Locks(*)\Lock Wait Time (ms)</Counter>
    <Counter>\SQLServer:Locks(*)\Lock Waits/sec</Counter>
    <Counter>\SQLServer:Locks(*)\Number of Deadlocks/sec</Counter>
    <Counter>\SQLServer:Memory Manager\Granted Workspace Memory (KB)</Counter>
    <Counter>\SQLServer:Memory Manager\Maximum Workspace Memory (KB)</Counter>
    <Counter>\SQLServer:Memory Manager\Memory Grants Outstanding</Counter>
    <Counter>\SQLServer:Memory Manager\Memory Grants Pending</Counter>
    <Counter>\SQLServer:Memory Manager\Optimizer Memory (KB)</Counter>
    <Counter>\SQLServer:Memory Manager\Stolen Server Memory (KB)</Counter>
    <Counter>\SQLServer:Memory Manager\Target Server Memory (KB)</Counter>
    <Counter>\SQLServer:Memory Manager\Target Server Memory(KB)</Counter>
    <Counter>\SQLServer:Memory Manager\Total Server Memory (KB)</Counter>
    <Counter>\SQLServer:Memory Node(*)\Database Node Memory (KB)</Counter>
    <Counter>\SQLServer:Memory Node(*)\Foreign Node Memory (KB)</Counter>
    <Counter>\SQLServer:Memory Node(*)\Stolen Node Memory (KB)</Counter>
    <Counter>\SQLServer:Memory Node(*)\Target Node Memory (KB)</Counter>
    <Counter>\SQLServer:Memory Node(000)\Total Node Memory (KB)</Counter>
    <Counter>\SQLServer:Plan Cache(*)\Cache Hit Ratio</Counter>
    <Counter>\SQLServer:Resource Pool Stats(*)\CPU usage %</Counter>
    <Counter>\SQLServer:Resource Pool Stats(*)\Max memory (KB)</Counter>
    <Counter>\SQLServer:Resource Pool Stats(*)\Target memory (KB)</Counter>
    <Counter>\SQLServer:Resource Pool Stats(*)\Used memory (KB)</Counter>
    <Counter>\SQLServer:SQL Errors(*)\Errors/sec</Counter>
    <Counter>\SQLServer:SQL Statistics\Auto-Param Attempts/sec</Counter>
    <Counter>\SQLServer:SQL Statistics\Batch Requests/sec</Counter>
    <Counter>\SQLServer:SQL Statistics\Failed Auto-Params/sec</Counter>
    <Counter>\SQLServer:SQL Statistics\Safe Auto-Params/sec</Counter>
    <Counter>\SQLServer:SQL Statistics\SQL Attention rate</Counter>
    <Counter>\SQLServer:SQL Statistics\SQL Compilations/sec</Counter>
    <Counter>\SQLServer:SQL Statistics\SQL Re-Compilations/sec</Counter>
    <Counter>\SQLServer:SQL Statistics\Unsafe Auto-Params/sec</Counter>
    <Counter>\SQLServer:Transactions\Free Space in tempdb (KB)</Counter>
    <Counter>\SQLServer:Transactions\Longest Transaction Running Time</Counter>
    <Counter>\SQLServer:Transactions\NonSnapshot Version Transactions</Counter>
    <Counter>\SQLServer:Transactions\Snapshot Transactions</Counter>
    <Counter>\SQLServer:Transactions\Transactions</Counter>
    <Counter>\SQLServer:Transactions\Version Cleanup rate (KB/s)</Counter>
    <Counter>\SQLServer:Transactions\Version Generation rate (KB/s)</Counter>
    <Counter>\SQLServer:Transactions\Version Store Size (KB)</Counter>
    <Counter>\SQLServer:User Settable(*)\Query</Counter>
    <Counter>\SQLServer:Workload Group Stats(*)\Active parallel threads</Counter>
    <Counter>\SQLServer:Workload Group Stats(*)\Active requests</Counter>
    <Counter>\SQLServer:Workload Group Stats(*)\CPU usage %</Counter>
    <Counter>\SQLServer:Workload Group Stats(*)\Queued requests</Counter>
    <Counter>\SQLServer:Workload Group Stats(*)\Reduced memory grants/sec</Counter>
    <Counter>\SQLServer:Workload Group Stats(*)\Requests completed/sec</Counter>
    <Counter>\SQLServer:Workload Group Stats(*)\Suboptimal plans/sec</Counter>
    <Counter>\System\Context Switches/sec</Counter>
    <Counter>\System\Processor Queue Length</Counter>
    <Counter>\System\System Calls/sec</Counter>
    <Counter>\TCPv4\Connection Failures</Counter>
</PerformanceCounterDataCollector>
</DataCollectorSet>


text:
package org.apache.xbean.osgi;

/**
 * @author Dain Sundstrom
 * @version $Id$
 * @since 2.0
 */
public interface Artifact {
    String getGroupId();

    String getArtifactId();

    String getVersion();

    String getType();
}


text:
module GitHelper
  def current_git_branch
    `git rev-parse --abbrev-ref HEAD`.strip
  end

  def git_root
    `git rev-parse --show-toplevel`.strip
  end

  def last_git_commit_message
    `git log -1 --pretty=%B`.strip
  end

  def last_git_commit_message_and_tag_name
    [last_git_commit_message, last_git_tag_name]
  end

  def last_git_tag_name
    `git tag`.split(/\n+/).first.strip
  end
end

RSpec.configure do |c|
  c.include GitHelper
end


text:
package cn.droidlover.xdroidmvp.mvp;

import android.os.Bundle;
import android.view.View;

/**
 * Created by wanglei on 2016/12/29.
 */

public interface IView<P> {
    void bindUI(View rootView);

    void bindEvent();

    void initData(Bundle savedInstanceState);

    void initView(Bundle savedInstanceState);

    int getOptionsMenuId();

    int getLayoutId();

    boolean useEventBus();

    P newP();
}


text:
/**
 * Location Intelligence APIs
 * Incorporate our extensive geodata into everyday applications, business processes and workflows.
 *
 * OpenAPI spec version: 8.5.0
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 *
 * 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.
 */

package pb.locationintelligence.model;

import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import pb.locationintelligence.model.Crs;

/**
 * GeoPos
 */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2020-04-16T15:55:12.092+05:30")
public class GeoPos   {
  @SerializedName("type")
  private String type = null;

  @SerializedName("coordinates")
  private List<Double> coordinates = new ArrayList<Double>();

  @SerializedName("crs")
  private Crs crs = null;

  public GeoPos type(String type) {
    this.type = type;
    return this;
  }

   /**
   * Get type
   * @return type
  **/
  @ApiModelProperty(example = "null", value = "")
  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

  public GeoPos coordinates(List<Double> coordinates) {
    this.coordinates = coordinates;
    return this;
  }

   /**
   * Get coordinates
   * @return coordinates
  **/
  @ApiModelProperty(example = "null", value = "")
  public List<Double> getCoordinates() {
    return coordinates;
  }

  public void setCoordinates(List<Double> coordinates) {
    this.coordinates = coordinates;
  }

  public GeoPos crs(Crs crs) {
    this.crs = crs;
    return this;
  }

   /**
   * Get crs
   * @return crs
  **/
  @ApiModelProperty(example = "null", value = "")
  public Crs getCrs() {
    return crs;
  }

  public void setCrs(Crs crs) {
    this.crs = crs;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    GeoPos geoPos = (GeoPos) o;
    return Objects.equals(this.type, geoPos.type) &&
        Objects.equals(this.coordinates, geoPos.coordinates) &&
        Objects.equals(this.crs, geoPos.crs);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, coordinates, crs);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class GeoPos {\n");

    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    coordinates: ").append(toIndentedString(coordinates)).append("\n");
    sb.append("    crs: ").append(toIndentedString(crs)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php" colors="true">

    <filter>
        <whitelist>
            <directory suffix=".php">./src</directory>
        </whitelist>
    </filter>

    <testsuites>
        <testsuite name="PHP Video URL Parser Test Suite">
            <directory>./test</directory>
        </testsuite>
    </testsuites>
</phpunit>


text:
This library is used to extract values from an objet and return them with some
transformations. It can be used to valid the parameters received from a web
application.

# Usage

```javascript
var validParams = require('valid-params');

var params = {
  firstName:   "Antoine",
  lastName:    "Proulx",
  phoneNumber: "123 456-7890",
  admin:       true
};

// The model defines what will be the object returned by validParams. The value
// of the key is a function that takes an argument representing the parameters
// to valid. This function should extract the required parameter(s) from it,
// transform it/them (if needed) and return the value. If it only needs to take
// the literal value from the params object, just assign the name of the the
// key.
var model  = {
  firstName:   'firstName',
  lastName:    'lastName',
  phoneNumber: function(params) {
    return params.phoneNumber.replace(/\D/g, "");
  }
};

validParams(params, model);
// Result
// { firstName: "Antoine", lastName: "Proulx", phoneNumber: "1234567890" }
```


text:
// Copyright (c) Microsoft Open Technologies, Inc.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Runtime.Serialization;

namespace Microsoft.CodeAnalysis
{
    /// <summary>
    /// A single element of a symbol description.  For example, a keyword, a punctuation character or
    /// a class name.
    /// </summary>
    /// <seealso cref="ISymbol.ToDisplayParts"/>
    /// <seealso cref="ISymbol.ToMinimalDisplayParts"/>
    /// <seealso cref="SymbolDisplayPartKind"/>
    [Serializable]
    public struct SymbolDisplayPart : ISerializable
    {
        private const string KindKey = "Kind";
        private const string TextKey = "Text";

        private readonly SymbolDisplayPartKind kind;
        private readonly string text;
        private readonly ISymbol symbol;

        /// <summary>
        /// Gets the kind of this display part.
        /// </summary>
        public SymbolDisplayPartKind Kind { get { return kind; } }

        /// <summary>
        /// Gets the symbol associated with this display part, if there is one.
        /// For example, the <see cref="ITypeSymbol"/> associated with a class name.
        /// </summary>
        /// <returns></returns>
        public ISymbol Symbol { get { return symbol; } }

        /// <summary>
        /// Construct a non-formattable <see cref="SymbolDisplayPart"/> (i.e. with a fixed string value).
        /// </summary>
        /// <param name="kind">The kind of the display part.</param>
        /// <param name="symbol">An optional associated symbol.</param>
        /// <param name="text">The fixed string value of the part.</param>
        public SymbolDisplayPart(SymbolDisplayPartKind kind, ISymbol symbol, string text)
        {
            if (!kind.IsValid())
            {
                throw new ArgumentOutOfRangeException("kind");
            }

            if (text == null)
            {
                throw new ArgumentNullException("text");
            }

            this.kind = kind;
            this.text = text;
            this.symbol = symbol;
        }

        private SymbolDisplayPart(SerializationInfo info, StreamingContext context)
            : this((SymbolDisplayPartKind)info.GetInt32(KindKey), null, info.GetString(TextKey))
        {
        }

        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue(KindKey, (int)this.Kind);
            info.AddValue(TextKey, text);
        }

        /// <summary>
        /// Returns the string value of this symbol display part.
        /// </summary>
        public override string ToString()
        {
            return text;
        }
    }
}


text:
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest. Come back soon for more!

BASH
* In bash, 'ctrl-r' searches your command history as you type
- Input from the commandline as if it were a file by replacing
  'command < file.in' with 'command <<< "some input text"'
- '^' is a sed-like operator to replace chars from last command
  'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty.
* '!!:n' selects the nth argument of the last command, and '!$' the last arg
  'ls file1 file2 file3; cat !!:1-2' shows all files and cats only 1 and 2
- More in-line substitutions: http://tiny.cc/ecv0cw http://tiny.cc/8zbltw
- 'nohup ./long_script &' to leave stuff in background even if you logout
- 'cd -' change to the previous directory you were working on
- 'ctrl-x ctrl-e' opens an editor to work with long or complex command lines
* Use traps for cleaning up bash scripts on exit http://tiny.cc/traps
* 'shopt -s cdspell' automatically fixes your 'cd folder' spelling mistakes
* Add 'set editing-mode vi' in your ~/.inputrc to use the vi keybindings
  for bash and all readline-enabled applications (python, mysql, etc)

PSEUDO ALIASES FOR COMMONLY USED LONG COMMANDS
- function lt() { ls -ltrsa "$@" | tail; }
- function psgrep() { ps axuf | grep -v grep | grep "$@" -i --color=auto; }
- function fname() { find . -iname "*$@*"; }
- function remove_lines_from() { grep -F -x -v -f $2 $1; }
  removes lines from $1 if they appear in $2
- alias pp="ps axuf | pager"
- alias sum="xargs | tr ' ' '+' | bc" ## Usage: echo 1 2 3 | sum
- function mcd() { mkdir $1 && cd $1; }

VIM
- ':set spell' activates vim spellchecker. Use ']s' and '[s' to move between
  mistakes, 'zg' adds to the dictionary, 'z=' suggests correctly spelled words
- check my .vimrc http://tiny.cc/qxzktw and here http://tiny.cc/kzzktw for more

TOOLS
* 'htop' instead of 'top'
- 'ranger' is a nice console file manager for vi fans
- Use 'apt-file' to see which package provides that file you're missing
- 'dict' is a commandline dictionary
- Learn to use 'find' and 'locate' to look for files
- Compile your own version of 'screen' from the git sources. Most versions
  have a slow scrolling on a vertical split or even no vertical split at all
* 'trash-cli' sends files to the trash instead of deleting them forever.
  Be very careful with 'rm' or maybe make a wrapper to avoid deleting '*' by
  accident (e.g. you want to type 'rm tmp*' but type 'rm tmp *')
- 'file' gives information about a file, as image dimensions or text encoding
- 'sort | uniq' to check for duplicate lines
- 'echo start_backup.sh | at midnight' starts a command at the specified time
- Pipe any command over 'column -t' to nicely align the columns
* Google 'magic sysrq' to bring a Linux machine back from the dead
- 'diff --side-by-side fileA.txt fileB.txt | pager' to see a nice diff
* 'j.py' http://tiny.cc/62qjow remembers your most used folders and is an
  incredible substitute to browse directories by name instead of 'cd'
- 'dropbox_uploader.sh' http://tiny.cc/o2qjow is a fantastic solution to
  upload by commandline via Dropbox's API if you can't use the official client
- learn to use 'pushd' to save time navigating folders (j.py is better though)
- if you liked the 'psgrep' alias, check 'pgrep' as it is far more powerful
* never run 'chmod o+x * -R', capitalize the X to avoid executable files. If
  you want _only_ executable folders: 'find . -type d -exec chmod g+x {} \;'
- 'xargs' gets its input from a pipe and runs some command for each argument
* run jobs in parallel easily: 'ls *.png | parallel -j4 convert {} {.}.jpg'

NETWORKING
- Don't know where to start? SMB is usually better than NFS for most cases.
  'sshfs_mount' is not really stable, any network failure will be troublesome
- 'python -m SimpleHTTPServer 8080' shares all the files in the current
  folder over HTTP, port 8080
- 'ssh -R 12345:localhost:22 server.com "sleep 1000; exit"' forwards
  server.com's port 12345 to your local ssh port, even if you machine
  is not externally visible on the net.
  Now you can 'ssh localhost -p 12345' from server.com and you will
  log into your machine.
  'sleep' avoids getting kicked out from server.com for inactivity
* Read on 'ssh-agent' to strenghten your ssh connections using private keys,
  while avoiding typing passwords every time you ssh.
- 'socat TCP4-LISTEN:1234,fork TCP4:192.168.1.1:22' forwards your port
  1234 to another machine's port 22. Very useful for quick NAT redirection.
- Some tools to monitor network connections and bandwith:
  'lsof -i' monitors network connections in real time
  'iftop' shows bandwith usage per *connection*
  'nethogs' shows the bandwith usage per *process*
* Use this trick on .ssh/config to directly access 'host2' which is on a private
  network, and must be accessed by ssh-ing into 'host1' first
  Host host2
      ProxyCommand ssh -T host1 'nc %h %p'
  	  HostName host2
* Pipe a compressed file over ssh to avoid creating large temporary .tgz files
  'tar cz folder/ | ssh server "tar xz"' or even better, use 'rsync'
* ssmtp can use a Gmail account as SMTP and send emails from the command line.
  'echo "Hello, User!" | mail user@domain.com' ## Thanks to Adam Ziaja.
  Configure your /etc/ssmtp/ssmtp.conf:
      root=***E-MAIL***
      mailhub=smtp.gmail.com:587
      rewriteDomain=
      hostname=smtp.gmail.com:587
      UseSTARTTLS=YES
      UseTLS=YES
      AuthUser=***E-MAIL***
      AuthPass=***PASSWORD***
      AuthMethod=LOGIN
      FromLineOverride=YES

                                     -~-

(CC) by-nc, Carles Fenollosa <carles.fenollosa@bsc.es>
Retrieved from http://mmb.pcb.ub.es/~carlesfe/unix/tricks.txt
Last modified: mié 17 jul 2013 03:35:06  CEST


text:
import { Tiles } from '../../app/app.component';
import { Component } from '@angular/core';
import { TestBed, ComponentFixture, async } from '@angular/core/testing';
import { BackgroundFetch } from '@ionic-native/background-fetch';
import { Storage } from '@ionic/storage';
import { IonicModule, ViewController, AlertController } from 'ionic-angular';
import { LoginPage } from './login';
import { UtilsService, LoginData  }from '../../providers/utils.service';
import { MqttClient } from '../../providers/mqttClient';
import { Logger } from '../../providers/logger.service';
import { TilesApi } from '../../providers/tilesApi.service';
import { StorageMock, ViewControllerMock, BackgroundFetchMock } from '../../mocks';

let logIn: LoginPage;
let fixture: ComponentFixture<LoginPage>;

describe('logIn', () => {

    beforeEach(async(() => {
        TestBed.configureTestingModule({
            declarations: [
                Tiles,
                LoginPage,
            ],
            providers: [
                Logger,
                UtilsService,
                MqttClient,
                TilesApi,
                AlertController,
                { provide: Storage, useClass: StorageMock },
                { provide: ViewController, useClass: ViewControllerMock },
                { provide: BackgroundFetch, useClass: BackgroundFetchMock },
            ],
            imports: [
                IonicModule.forRoot(Tiles),
            ],
        }).compileComponents();
    }));

    beforeEach(() => {
        fixture = TestBed.createComponent(LoginPage);
        logIn = fixture.componentInstance;
    });

    afterEach(() => {
        fixture.destroy();
        logIn = null;
    });

    it('is created', () => {
        expect(logIn).toBeTruthy();
        expect(fixture).toBeTruthy();
    });

});


text:
namespace MyVote.Data.Entities
{
    using System;
    using System.Collections.Generic;

    public partial class MVReportedPoll
    {
        public MVReportedPoll()
        {
            this.MVReportedPollStateLogs = new HashSet<MVReportedPollStateLog>();
        }

        public int ReportedPollID { get; set; }
        public int PollID { get; set; }
        public int ReportedByUserID { get; set; }
        public Nullable<int> CurrentStateAdminUserID { get; set; }
        public System.DateTime DateReported { get; set; }
        public Nullable<System.DateTime> DateCurrentStateChanged { get; set; }
        public int ReportedPollStateOptionID { get; set; }
        public string ReportComments { get; set; }

        public virtual MVPoll MVPoll { get; set; }
        public virtual MVUser MVUser { get; set; }
        public virtual ICollection<MVReportedPollStateLog> MVReportedPollStateLogs { get; set; }
        public virtual MVReportedPollStateOption MVReportedPollStateOption { get; set; }
        public virtual MVUser MVUser1 { get; set; }
    }
}


text:
require 'rails_helper'

describe "routing to release_notes" do
  routes { ReleaseNotes::Engine.routes }

  it "routes /release_notes to release_notes#index" do
    expect(:get => "/").to route_to(
      :controller => "release_notes/release_notes",
      :action => "index"
    )
  end

  it "routes /release_notes/:version to release_notes#show" do
    expect(:get => "/:version").to route_to(
      :controller => "release_notes/release_notes",
      :action => "show",
      :version => ":version"
    )
  end
end


text:
package ru.job4j.calculator;

import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * Test Calculator Class.
 *
 * @author Kuzmin Danila (mailto:bus1d0@mail.ru)
 * @version $Id$
 * @since 0.1
 */

public class CalculatorTest {
    /**
     * Test Add.
     */
    @Test
    public void whenAddOnePlusOneThenTwo() {
        Calculator calc = new Calculator();
        calc.add(1D, 1D);
        double result = calc.getResult();
        double expected = 2D;
        assertThat(result, is(expected));
    }
    /**
     * Test Subtract.
     */
    @Test
    public void whenSubtractTenMinusNineThenOne() {
        Calculator calc = new Calculator();
        calc.subtract(10D, 9D);
        double result = calc.getResult();
        double expected = 1D;
        assertThat(result, is(expected));
    }
    /**
     * Test Divide.
     */
    @Test
    public void whenDivSixDivideTwoThenThree() {
        Calculator calc = new Calculator();
        calc.div(6D, 2D);
        double result = calc.getResult();
        double expected = 3D;
        assertThat(result, is(expected));
    }
    /**
     * Test Multiple.
     */
    @Test
    public void whenMultipleSixAndThreeThenEighteen() {
        Calculator calc = new Calculator();
        calc.multiple(6D, 3D);
        double result = calc.getResult();
        double expected = 18D;
        assertThat(result, is(expected));
    }
}


text:
"""
Haptic module
-------------

Created by hbldh <henrik.blidh@nedomkull.com> on 2016-04-14

"""

from __future__ import division
from __future__ import print_function
from __future__ import absolute_import

import logging
from ctypes import c_float, c_uint16

from pymetawear import libmetawear
from pymetawear.exceptions import PyMetaWearException
from pymetawear.modules.base import PyMetaWearModule

log = logging.getLogger(__name__)

class HapticModule(PyMetaWearModule):
    """MetaWear Haptic module implementation.

    :param ctypes.c_long board: The MetaWear board pointer value.
    :param bool debug: If ``True``, module prints out debug information.

    """

    def __str__(self):
        return "{0}".format(self.module_name)

    def __repr__(self):
        return super(HapticModule, self).__repr__()

    @property
    def module_name(self):
        return 'Haptic'

    def notifications(self, callback=None):
        """No subscriptions possible for Haptic module.

        :raises: :py:exc:`~PyMetaWearException`

        """
        raise PyMetaWearException("Haptic module has no notifications.")

    def start_motor(self, duty_cycle_per, pulse_width_ms):
        """Activate the haptic motor.

        :param float duty_cycle_per: Strength of the motor,
            between [0, 100] percent
        :param int pulse_width_ms: How long to run the motor, in milliseconds

        """
        libmetawear.mbl_mw_haptic_start_motor(
            self.board,
            c_float(float(duty_cycle_per)),
            c_uint16(int(pulse_width_ms)))

    def start_buzzer(self, pulse_width_ms):
        """Activate the haptic buzzer.

        :param int pulse_width_ms: How long to run the motor, in milliseconds

        """
        libmetawear.mbl_mw_haptic_start_buzzer(
            self.board,
            c_uint16(int(pulse_width_ms)))


text:
IMPLEMENT_CONOBJECT(GuiGradientSwatchCtrl);

ConsoleDocClass( GuiGradientSwatchCtrl,
   "@brief Swatch selector that appears inside the GuiGradientCtrl object. These objects are automatically created by GuiGradientCtrl. \n\n"
   "Currently only appears to be editor specific\n\n"
   "@see GuiSwatchButtonCtrl\n"
   "@see GuiGradientCtrl\n\n"
   "@ingroup GuiCore\n"
   "@internal"
);

IMPLEMENT_CALLBACK( GuiGradientSwatchCtrl, onMouseDown, void, (),(),
   "@brief Called whenever the left mouse button has entered the down state while in this control.\n\n"
   "@tsexample\n"
   "// The left mouse button is down on the control, causing the callback to occur.\n"
   "GuiGradientSwatchCtrl::onMouseDown(%this)\n"
   "	{\n"
   "		// Code to run when the callback occurs\n"
   "	}\n"
   "@endtsexample\n\n"
   "@see GuiControl\n"
   "@see GuiSwatchButtonCtrl\n\n"
   "@internal"
);

IMPLEMENT_CALLBACK( GuiGradientSwatchCtrl, onDoubleClick, void, (),(),
   "@brief Called whenever the left mouse button performs a double click while in this control.\n\n"
   "@tsexample\n"
   "// The left mouse button has performed a double click on the control, causing the callback to occur.\n"
   "GuiGradientSwatchCtrl::onDoubleClick(%this)\n"
   "	{\n"
   "		// Code to run when the callback occurs\n"
   "	}\n"
   "@endtsexample\n\n"
   "@see GuiControl\n"
   "@see GuiSwatchButtonCtrl\n\n"
   "@internal"
);

GuiGradientSwatchCtrl::GuiGradientSwatchCtrl()
{
	setPosition(0, 0);
	setExtent(14, 14);
	mMouseDownPosition = Point2I(0, 0);
	mSwatchColor = ColorI( 1, 1, 1, 1 );
	mColorFunction = StringTable->insert("getColorF");
	setDataField( StringTable->insert("Profile"), NULL, "GuiInspectorSwatchButtonProfile" );
}

bool GuiGradientSwatchCtrl::onWake()
{
	if ( !Parent::onWake() )
      return false;

	if ( mPointer.isNull() )
		mPointer.set( "core/art/gui/images/arrowbtn_d", &GFXDefaultGUIProfile, avar("%s() - mGrid (line %d)", __FUNCTION__, __LINE__) );

	char* altCommand = Con::getReturnBuffer(512);
	dSprintf( altCommand, 512, "%s(%i.color, \"%i.setColor\");", mColorFunction, getId(), getId() );
	setField( "altCommand", altCommand );

	return true;
}

void GuiGradientSwatchCtrl::onRender( Point2I offset, const RectI &updateRect )
{
   bool highlight = mMouseOver;

   ColorI backColor   = mSwatchColor;
   ColorI borderColor = mActive ? ( highlight ? mProfile->mBorderColorHL : mProfile->mBorderColor ) : mProfile->mBorderColorNA;
   RectI renderRect( offset, getExtent() );

	if ( !highlight )
      renderRect.inset( 1, 1 );

   GFXDrawUtil *drawer = GFX->getDrawUtil();
   drawer->clearBitmapModulation();

   // Draw background transparency grid texture...
   if ( mGrid.isValid() )
      drawer->drawBitmapStretch( mGrid, renderRect );

   // Draw swatch color as fill...
   drawer->drawRectFill( renderRect, mSwatchColor );

   // Draw any borders...
   drawer->drawRect( renderRect, borderColor );
}

void GuiGradientSwatchCtrl::onMouseDown(const GuiEvent &event)
{
   if (! mActive)
      return;

   if (mProfile->mCanKeyFocus)
      setFirstResponder();

	//capture current bounds and mouse down position
	mOrigBounds = getBounds();
	mMouseDownPosition = event.mousePoint;

   if(mUseMouseEvents)
      onMouseDown_callback();

   //lock the mouse
   mouseLock();
   mDepressed = true;

   // If we have a double click then execute the alt command.
   if ( event.mouseClickCount == 2 )
   {
      onDoubleClick_callback();

      execAltConsoleCallback();
   }

   setUpdate();
}

void GuiGradientSwatchCtrl::onMouseDragged(const GuiEvent &event)
{
	//gradientCtrl owns the y, x here however is regulated by the extent currently
	//dirty, please fix
	GuiGradientCtrl* parent = dynamic_cast<GuiGradientCtrl*>(getParent());
	if( !parent )
		return;

	//use bounds and delta to move the ctrl
	Point2I newPosition = mMouseDownPosition;
	Point2I deltaMousePosition = event.mousePoint - mMouseDownPosition;

	newPosition.x = mOrigBounds.point.x + deltaMousePosition.x;

	// default position but it needs to be standard; currently using this cops out a static y value
	newPosition.y = mOrigBounds.point.y;

	if( newPosition.x + parent->mSwatchFactor >= parent->mBlendRangeBox.point.x &&
		newPosition.x + parent->mSwatchFactor <= parent->mBlendRangeBox.extent.x )
	{
		setPosition(newPosition);
		if( parent )
			parent->sortColorRange();
	}
}

void GuiGradientSwatchCtrl::onRightMouseDown(const GuiEvent &event)
{
	GuiGradientCtrl* parent = dynamic_cast<GuiGradientCtrl*>(getParent());
	if( parent )
		parent->removeColorRange( this );
}

//-----------------------------------------------------------------------------
// GuiGradientCtrl

static S32 QSORT_CALLBACK _numIncreasing( const void* a, const void* b )
{
	GuiGradientCtrl::ColorRange *crA = (GuiGradientCtrl::ColorRange *) (a);
   GuiGradientCtrl::ColorRange *crB = (GuiGradientCtrl::ColorRange *) (b);
   S32 posA = crA->swatch->getPosition().x;
   S32 posB = crB->swatch->getPosition().x;
	return ( (posA < posB) ? -1 : ((posA > posB) ? 1 : 0) );
}

ImplementEnumType( GuiGradientPickMode,
   "\n\n"
   "@ingroup GuiCore"
   "@internal")
   { GuiGradientCtrl::pHorizColorRange,	"HorizColor"},
   { GuiGradientCtrl::pHorizAlphaRange,	"HorizAlpha"},
EndImplementEnumType;

IMPLEMENT_CONOBJECT(GuiGradientCtrl);

ConsoleDocClass( GuiGradientCtrl,
   "@brief Visual representation of color box used with the GuiColorPickerCtrl\n\n"
   "Editor use only.\n\n"
   "@internal"
);

GuiGradientCtrl::GuiGradientCtrl()
{
   setExtent(140, 30);
   mDisplayMode = pHorizColorRange;
	mSaveDisplayMode = pHorizColorRange;
   mBaseColor = ColorF(1.,.0,1.);
   mPickColor = ColorF(.0,.0,.0);
   mMouseDown = mMouseOver = false;
   mActive = true;
   mPositionChanged = false;
   mActionOnMove = false;
	mShowReticle = true;
	colorWhiteBlend = ColorF(1.,1.,1.,.75);
	mSwatchFactor = 7;
}

//--------------------------------------------------------------------------
void GuiGradientCtrl::initPersistFields()
{
   addGroup("ColorPicker");
   addField("baseColor", TypeColorF, Offset(mBaseColor, GuiGradientCtrl));
   addField("pickColor", TypeColorF, Offset(mPickColor, GuiGradientCtrl));
   addField("displayMode", TYPEID< PickMode >(), Offset(mDisplayMode, GuiGradientCtrl) );
   addField("actionOnMove", TypeBool,Offset(mActionOnMove, GuiGradientCtrl));
	addField("showReticle", TypeBool, Offset(mShowReticle, GuiGradientCtrl));
	addField("swatchFactor", TypeS32, Offset(mSwatchFactor, GuiGradientCtrl));
   endGroup("ColorPicker");

   Parent::initPersistFields();
}

bool GuiGradientCtrl::onAdd()
{
	Parent::onAdd();

	S32 l = getBounds().point.x + mSwatchFactor, r = getBounds().point.x + getBounds().extent.x - mSwatchFactor;
   S32 t = getBounds().point.y, b = getBounds().point.y + getBounds().extent.y - mSwatchFactor;
	mBlendRangeBox = RectI( Point2I(l, t), Point2I(r, b) );

	setupDefaultRange();
	reInitSwatches( mDisplayMode );
	return true;
}

void GuiGradientCtrl::inspectPreApply()
{
	mSaveDisplayMode = mDisplayMode;
}

void GuiGradientCtrl::inspectPostApply()
{
   if((mSaveDisplayMode != mDisplayMode) )
      reInitSwatches( mDisplayMode );

   // Apply any transformations set in the editor
   Parent::inspectPostApply();
}

void GuiGradientCtrl::onRender(Point2I offset, const RectI& updateRect)
{
   if (mStateBlock.isNull())
   {
      GFXStateBlockDesc desc;
      desc.setBlend(true, GFXBlendSrcAlpha, GFXBlendInvSrcAlpha);
      desc.setZReadWrite(false);
      desc.zWriteEnable = false;
      desc.setCullMode(GFXCullNone);
      mStateBlock = GFX->createStateBlock( desc );
   }

   RectI boundsRect(offset, getExtent());
   renderColorBox(boundsRect);

   if (mPositionChanged)
   {
      mPositionChanged = false;

      // Now do onAction() if we are allowed
      if (mActionOnMove)
			onAction();
   }

   //render the children
   renderChildControls( offset, updateRect);
}

/// Function to invoke calls to draw the picker box and swatch controls
void GuiGradientCtrl::renderColorBox(RectI &bounds)
{
   // Draw color box differently depending on mode
	if( mDisplayMode == pHorizColorRange )
	{
      drawBlendRangeBox( bounds, false, mColorRange);
	}
	else if( mDisplayMode == pHorizAlphaRange )
	{
      drawBlendRangeBox( bounds, false, mAlphaRange);
   }
}

/// Function to draw a set of boxes blending throughout an array of colors
void GuiGradientCtrl::drawBlendRangeBox(RectI &bounds, bool vertical, Vector<ColorRange> colorRange)
{
   GFX->setStateBlock(mStateBlock);

	// Create new global dimensions
   S32 l = bounds.point.x + mSwatchFactor, r = bounds.point.x + bounds.extent.x - mSwatchFactor;
   S32 t = bounds.point.y, b = bounds.point.y + bounds.extent.y - mSwatchFactor;

	// Draw border using new global dimensions
	if (mProfile->mBorder)
      GFX->getDrawUtil()->drawRect( RectI( Point2I(l,t),Point2I(r,b) ), mProfile->mBorderColor);

	// Update local dimensions
	mBlendRangeBox.point = globalToLocalCoord(Point2I(l, t));
	mBlendRangeBox.extent = globalToLocalCoord(Point2I(r, b));

	if(colorRange.size() == 1) // Only one color to draw
	{
		PrimBuild::begin( GFXTriangleFan, 4 );

		PrimBuild::color( colorRange.first().swatch->getColor() );
		PrimBuild::vertex2i( l, t );
		PrimBuild::vertex2i( l, b );

		PrimBuild::color( colorRange.first().swatch->getColor() );
		PrimBuild::vertex2i( r, b );
		PrimBuild::vertex2i( r, t );

		PrimBuild::end();
	}
	else
	{
		PrimBuild::begin( GFXTriangleFan, 4 );

		PrimBuild::color( colorRange.first().swatch->getColor() );
		PrimBuild::vertex2i( l, t );
		PrimBuild::vertex2i( l, b );

		PrimBuild::color( colorRange.first().swatch->getColor() );
		PrimBuild::vertex2i( l + colorRange.first().swatch->getPosition().x, b );
		PrimBuild::vertex2i( l + colorRange.first().swatch->getPosition().x, t );

		PrimBuild::end();

		for( U16 i = 0;i < colorRange.size() - 1; i++ )
		{
			PrimBuild::begin( GFXTriangleFan, 4 );
			if (!vertical)  // Horizontal (+x)
			{
				// First color
				PrimBuild::color( colorRange[i].swatch->getColor() );
				PrimBuild::vertex2i( l + colorRange[i].swatch->getPosition().x, t );
				PrimBuild::vertex2i( l + colorRange[i].swatch->getPosition().x, b );

				// First color
				PrimBuild::color( colorRange[i+1].swatch->getColor() );
				PrimBuild::vertex2i( l + colorRange[i+1].swatch->getPosition().x, b );
				PrimBuild::vertex2i( l + colorRange[i+1].swatch->getPosition().x, t );
			}
			PrimBuild::end();
		}

		PrimBuild::begin( GFXTriangleFan, 4 );

		PrimBuild::color( colorRange.last().swatch->getColor() );
		PrimBuild::vertex2i( l + colorRange.last().swatch->getPosition().x, t );
		PrimBuild::vertex2i( l + colorRange.last().swatch->getPosition().x, b );

		PrimBuild::color( colorRange.last().swatch->getColor() );
		PrimBuild::vertex2i( r, b );
		PrimBuild::vertex2i( r, t );

		PrimBuild::end();
	}
}

void GuiGradientCtrl::onMouseDown(const GuiEvent &event)
{
   if (!mActive)
      return;

   mouseLock(this);

   if (mProfile->mCanKeyFocus)
      setFirstResponder();

	if (mActive)
      onAction();

	Point2I extent = getRoot()->getExtent();
   Point2I resolution = getRoot()->getExtent();
   GFXTexHandle bb( resolution.x,
                    resolution.y,
                    GFXFormatR8G8B8A8, &GFXDefaultRenderTargetProfile, avar("%s() - bb (line %d)", __FUNCTION__, __LINE__) );

   Point2I tmpPt( event.mousePoint.x, event.mousePoint.y );
   GFXTarget *targ = GFX->getActiveRenderTarget();
   targ->resolveTo( bb );
   GBitmap bmp( bb.getWidth(), bb.getHeight() );
   bb.copyToBmp( &bmp );
   ColorI tmp;
   bmp.getColor( event.mousePoint.x, event.mousePoint.y, tmp );

	addColorRange( globalToLocalCoord(event.mousePoint), ColorF(tmp) );

   mMouseDown = true;
}

void GuiGradientCtrl::onMouseUp(const GuiEvent &)
{
   //if we released the mouse within this control, perform the action
	if (mActive && mMouseDown )
      mMouseDown = false;

   mouseUnlock();
}

void GuiGradientCtrl::onMouseEnter(const GuiEvent &event)
{
   mMouseOver = true;
}

void GuiGradientCtrl::onMouseLeave(const GuiEvent &)
{
   // Reset state
   mMouseOver = false;
}

void GuiGradientCtrl::setupDefaultRange()
{
	S32 l = mBlendRangeBox.point.x - mSwatchFactor;
	S32 r = mBlendRangeBox.extent.x - mSwatchFactor;

	//setup alpha range (white/black only)
	ColorRange crW;
	crW.pos = l;
   crW.color = ColorI(255,255,255);
	crW.swatch = NULL;
	mAlphaRange.push_back( crW );

	ColorRange crB;
	crB.pos = r;
	crB.color = ColorI(0,0,0);
	crB.swatch = NULL;
	mAlphaRange.push_back( crB );

	//setup color range (only 1 color necessary)
	ColorRange crD;
   crD.pos = l;
   crD.color = ColorI(255,0,0);
	crD.swatch = NULL;
	mColorRange.push_back( crD );
}

void GuiGradientCtrl::reInitSwatches( GuiGradientCtrl::PickMode )
{
	//liable to crash in the guiEditor, needs fix
	for( S32 i = 0;i < mColorRange.size(); i++ )
	{
		if(mColorRange[i].swatch != NULL)
		{
			mColorRange[i].pos = mColorRange[i].swatch->getPosition().x;
			mColorRange[i].color = mColorRange[i].swatch->getColor();
			mColorRange[i].swatch->deleteObject();
			mColorRange[i].swatch = NULL;
		}
	}

	for( S32 i = 0;i < mAlphaRange.size(); i++ )
	{
		if(mAlphaRange[i].swatch != NULL)
		{
			mAlphaRange[i].pos = mAlphaRange[i].swatch->getPosition().x;
			mAlphaRange[i].color = mAlphaRange[i].swatch->getColor();
			mAlphaRange[i].swatch->deleteObject();
			mAlphaRange[i].swatch = NULL;
		}
	}

	S32 b = mBlendRangeBox.extent.y - mSwatchFactor;

   if( mDisplayMode == pHorizColorRange )
	{
		for( S32 i = 0;i < mColorRange.size(); i++ )
		{
			mColorRange[i].swatch = new GuiGradientSwatchCtrl();
			mColorRange[i].swatch->registerObject();
			addObject(mColorRange[i].swatch);
			mColorRange[i].swatch->setPosition( Point2I( mColorRange[i].pos, b ) );// needs to be adjusted
			mColorRange[i].swatch->setColor(ColorF(mColorRange[i].color));
		}
	}

   else if( mDisplayMode == pHorizAlphaRange )
	{
		for( S32 i = 0;i < mAlphaRange.size(); i++ )
		{
			mAlphaRange[i].swatch = new GuiGradientSwatchCtrl();
			mAlphaRange[i].swatch->registerObject();
			addObject(mAlphaRange[i].swatch);
			mAlphaRange[i].swatch->setPosition( Point2I( mAlphaRange[i].pos, b ) );// needs to be adjusted
			mAlphaRange[i].swatch->setColor(ColorF(mAlphaRange[i].color));
		}
	}
}

void GuiGradientCtrl::addColorRange( Point2I pos, ColorF color )
{
	if( pos.x + mSwatchFactor < mBlendRangeBox.point.x &&
		pos.x + mSwatchFactor > mBlendRangeBox.extent.x )
	{
		return;
	}

	ColorRange range;
   range.pos = pos.x - mSwatchFactor;
   range.color = color;

	S32 b = mBlendRangeBox.extent.y - mSwatchFactor;

	range.swatch = new GuiGradientSwatchCtrl();
	range.swatch->registerObject();
	addObject( range.swatch );
	range.swatch->setPosition( pos.x - mSwatchFactor, b );//swatch factor and default location is going to have to be placed
	range.swatch->setColor( color );

	if( mDisplayMode == pHorizColorRange )
	{
		mColorRange.push_back( range );
		S32 size = mColorRange.size();
		if( size > 0 )
			dQsort( mColorRange.address(), size, sizeof(ColorRange), _numIncreasing);
	}
	else if( mDisplayMode == pHorizAlphaRange )
	{
		mAlphaRange.push_back( range );
		S32 size = mAlphaRange.size();
		if( size > 0 )
			dQsort( mAlphaRange.address(), size, sizeof(ColorRange), _numIncreasing);
	}
}

void GuiGradientCtrl::removeColorRange( GuiGradientSwatchCtrl* swatch )
{
	if( mDisplayMode == pHorizColorRange )
	{
		if( mColorRange.size() <= 1 )
			return;

		for( S32 i = 0;i < mColorRange.size(); i++ )
		{
			if( mColorRange[i].swatch == swatch )
			{
				mColorRange.erase( U32(i) );
				swatch->safeDeleteObject();
				break;
			}
		}
	}
   else if( mDisplayMode == pHorizAlphaRange )
	{
		if( mAlphaRange.size() <= 1 )
			return;

		for( S32 i = 0;i < mAlphaRange.size(); i++ )
		{
			if( mAlphaRange[i].swatch == swatch )
			{
				mAlphaRange.erase( U32(i) );
				swatch->safeDeleteObject();
				break;
			}
		}
	}
}

void GuiGradientCtrl::sortColorRange()
{
	if( mDisplayMode == pHorizColorRange )
		dQsort( mColorRange.address(), mColorRange.size(), sizeof(ColorRange), _numIncreasing);
	else if( mDisplayMode == pHorizAlphaRange )
		dQsort( mAlphaRange.address(), mAlphaRange.size(), sizeof(ColorRange), _numIncreasing);
}

ConsoleMethod(GuiGradientCtrl, getColorCount, S32, 2, 2, "Get color count")
{
	if( object->getDisplayMode() == GuiGradientCtrl::pHorizColorRange )
		return object->mColorRange.size();
	else if( object->getDisplayMode() == GuiGradientCtrl::pHorizColorRange )
		return object->mColorRange.size();

	return 0;
}

ConsoleMethod(GuiGradientCtrl, getColor, const char*, 3, 3, "Get color value")
{
	S32 idx = dAtoi(argv[2]);

	if( object->getDisplayMode() == GuiGradientCtrl::pHorizColorRange )
	{
		if ( idx >= 0 && idx < object->mColorRange.size() )
		{
			char* rColor = Con::getReturnBuffer(256);
			rColor[0] = 0;

			dSprintf(rColor, 256, "%f %f %f %f",
				object->mColorRange[idx].swatch->getColor().red,
				object->mColorRange[idx].swatch->getColor().green,
				object->mColorRange[idx].swatch->getColor().blue,
				object->mColorRange[idx].swatch->getColor().alpha);

			return rColor;
		}
	}
	else if( object->getDisplayMode() == GuiGradientCtrl::pHorizColorRange )
	{
		if ( idx >= 0 && idx < object->mAlphaRange.size() )
		{
			char* rColor = Con::getReturnBuffer(256);
			rColor[0] = 0;

			dSprintf(rColor, 256, "%f %f %f %f",
				object->mAlphaRange[idx].swatch->getColor().red,
				object->mAlphaRange[idx].swatch->getColor().green,
				object->mAlphaRange[idx].swatch->getColor().blue,
				object->mAlphaRange[idx].swatch->getColor().alpha);

			return rColor;
		}
	}

	return "1 1 1 1";
}


text:
<?php

declare(strict_types=1);

namespace BlockHorizons\BlockSniper\data;

use BlockHorizons\BlockSniper\Loader;

class TranslationData{

	/** @var array */
	private $messages = [];
	/** @var Loader */
	private $loader = null;

	public function __construct(Loader $loader){
		$this->loader = $loader;

		$this->collectTranslations();
		new Translation($this);
	}

	/**
	 * @return bool
	 */
	public function collectTranslations() : bool{
		$languageSelected = false;
		$language = "";
		foreach(Loader::getAvailableLanguages() as $availableLanguage){
			if($this->loader->config->messageLanguage === $availableLanguage){
				$this->loader->saveResource("languages/" . $availableLanguage . ".json");
				$language = file_get_contents($this->loader->getDataFolder() . "languages/" . $availableLanguage . ".json");
				$languageSelected = true;
				break;
			}
		}
		if(!$languageSelected){
			$this->loader->saveResource("languages/en.json");
			$language = file_get_contents($this->loader->getDataFolder() . "languages/en.json");
		}
		$this->messages = json_decode($language, true);

		return $languageSelected;
	}

	/**
	 * @return Loader
	 */
	public function getLoader() : Loader{
		return $this->loader;
	}

	/**
	 * @return array
	 */
	public function getMessages() : array{
		return $this->messages;
	}
}


text:
using Crystal3.Core;
using Crystal3.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Foundation.Metadata;
using Windows.UI;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;

namespace Crystal3.UI.StatusManager
{
    public class StatusManager : INotifyPropertyChanged
    {
        private Crystal3.Core.Platform currentPlatform = Crystal3.Core.Platform.Unknown;
        private string normalStatusText = null;
        private bool isBusyValue = false;
        private StatusBar mobileStatusBar = null;
        private Window boundWindow = null;
        private List<StatusManagerControl> controllers = null;

        public event PropertyChangedEventHandler PropertyChanged;

        internal StatusManager(Window window)
        {
            currentPlatform = DeviceInformation.GetDevicePlatform();

            boundWindow = window;

            controllers = new List<StatusManagerControl>();

            StatusBarForegroundColor = Colors.White;
        }

        internal async void Initialize()
        {
            if (currentPlatform == Core.Platform.Mobile && CanAccessMobileStatusBar())
            {
                mobileStatusBar = StatusBar.GetForCurrentView();
                mobileStatusBar.ProgressIndicator.ProgressValue = 0;

                await mobileStatusBar.ShowAsync();
            }

            NormalStatusText = ApplicationView.GetForCurrentView().Title;

        }

        internal bool CanAccessMobileStatusBar()
        {
            return ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar");
        }

        private void UpdateStatusText(string status)
        {
            if (currentPlatform == Core.Platform.Mobile)
            {
                //todo fix rare bug where this is called on launch and dispatcher is null
                CrystalApplication.Dispatcher.RunAsync(async () =>
                {
                    if (CanAccessMobileStatusBar())
                    {
                        if (mobileStatusBar != null)
                        {
                            if (AnimateStatusBarText)
                                await mobileStatusBar.ProgressIndicator.HideAsync();
                            mobileStatusBar.ProgressIndicator.Text = status;
                            await mobileStatusBar.ProgressIndicator.ShowAsync();
                        }
                    }
                });
            }
        }
        private void UpdateNormalStatus()
        {
            UpdateStatusText(NormalStatusText);
        }

        private void UpdateProgress(double? status)
        {
            if (currentPlatform == Core.Platform.Mobile)
            {
                CrystalApplication.Dispatcher.RunAsync(() =>
                {
                    if (CanAccessMobileStatusBar())
                    {
                        if (mobileStatusBar != null)
                        {
                            mobileStatusBar.ProgressIndicator.ProgressValue = status;

                            mobileStatusBar.ForegroundColor = StatusBarForegroundColor;
                        }
                    }
                });
            }
        }

        /// <summary>
        /// The text to show in the status bar when there aren't any controllers active. Think of it as the titlebar in a mobile application.
        /// </summary>
        public string NormalStatusText
        {
            get
            {
                return normalStatusText;
            }
            set
            {
                normalStatusText = value;

                UpdateNormalStatus();

                //makes this property binding-friendly.
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(NormalStatusText)));
            }
        }

        public bool IsBusy
        {
            get { return isBusyValue; }
            private set
            {
                isBusyValue = value;

                //makes this property binding-friendly.
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsBusy)));
            }
        }

        public bool AnimateStatusBarText { get; set; }

        public Color? StatusBarForegroundColor { get; set; }

        private void RefreshStatus()
        {
            //as long as there are active controllers, the status manager should say that it is busy.
            IsBusy = controllers.Count > 0;
        }

        internal void RemoveAllControllersForCallingViewModel(ViewModelBase callingViewModel)
        {
            lock (controllers)
            {
                foreach (var control in controllers.Where(x => object.ReferenceEquals(x.ParentViewModel, callingViewModel)).ToArray())
                    control.Dispose();

                RefreshStatus();
            }
        }

        public IndefiniteWorkStatusManagerControl DoIndefiniteWork(ViewModelBase callingViewModel, string statusText)
        {
            var control = new IndefiniteWorkStatusManagerControl(this, statusText, callingViewModel);
            RefreshStatus();
            return control;
        }

        public DefiniteWorkStatusManagerControl DoWork(ViewModelBase callingViewModel, string statusText)
        {
            var control = new DefiniteWorkStatusManagerControl(this, statusText, callingViewModel);
            RefreshStatus();
            return control;
        }

        public abstract class StatusManagerControl : IDisposable
        {
            internal StatusManagerControl(StatusManager manager, ViewModelBase callingViewModel)
            {
                ParentStatusManager = manager;
                ParentViewModel = callingViewModel;

                if (!ParentStatusManager.controllers.Contains(this))
                    ParentStatusManager.controllers.Add(this);
                else
                    throw new Exception("StatusManagerControl is already present in the ParentStatusManager's controller list.");
            }

            public StatusManager ParentStatusManager { get; private set; }

            internal ViewModelBase ParentViewModel { get; private set; }

            public abstract void Dispose();
        }

        public class IndefiniteWorkStatusManagerControl : StatusManagerControl
        {
            internal IndefiniteWorkStatusManagerControl(StatusManager manager, string statusText, ViewModelBase callingViewModel) : base(manager, callingViewModel)
            {
                if (manager.currentPlatform == Core.Platform.Mobile)
                {
                    manager.UpdateStatusText(statusText);
                    manager.UpdateProgress(null);
                }
            }

            public override void Dispose()
            {
                if (ParentStatusManager.currentPlatform == Core.Platform.Mobile)
                {
                    this.ParentStatusManager.UpdateNormalStatus();
                    this.ParentStatusManager.UpdateProgress(0);
                }

                ParentStatusManager.controllers.Remove(this);
                ParentStatusManager.RefreshStatus();
            }

            public void SetStatus(string text)
            {
                ParentStatusManager.UpdateStatusText(text);
            }

            public async Task SetStatusWithPauseAsync(string text, int showTimeSeconds)
            {
                ParentStatusManager.UpdateStatusText(text);

                await Task.Delay(showTimeSeconds * 1000);
            }

        }

        public class DefiniteWorkStatusManagerControl : IndefiniteWorkStatusManagerControl
        {
            internal DefiniteWorkStatusManagerControl(StatusManager manager, string statusText, ViewModelBase callingViewModel) : base(manager, statusText, callingViewModel)
            {
                if (manager.currentPlatform == Core.Platform.Mobile)
                {
                    manager.UpdateStatusText(statusText);
                    manager.UpdateProgress(0);
                }
            }

            public void SetProgress(double value)
            {
                ParentStatusManager.UpdateProgress(value);
            }

            public override void Dispose()
            {
                ParentStatusManager.controllers.Remove(this);
                ParentStatusManager.RefreshStatus();
            }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.maxcriser.copytwitter">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name=".MainActivity"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name=".SecondActivity"
            android:label="@string/text_second_page"
            android:launchMode="singleTask"
            android:exported="true"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>


text:
* * *

title: Blurbs and Stats layout: wide nav: resources_nav

* * *

# 宣伝と役に立つ統計データ

## Use this short blurb in newsletters

### あなたの学校にもコンピューターサイエンスを導入しましょう。Hour of Codeで始めましょう。

コンピューターはありふれていますが、コンピューター科学を教える学校は10年前より少なくなっています。 良いお知らせは、私たちはこれを変えようとしているということです。 If you heard about the [Hour of Code](<%= hoc_uri('/') %>) last year, you might know it made history. たった一週間で、1500万人の学生がコンピューター科学を試したのです! The [Hour of Code](<%= hoc_uri('/') %>) is a one-hour introduction to computer science, designed to demystify code and show that anybody can learn the basics. [Sign up](<%= hoc_uri('/') %>) to host an Hour of Code this December 8-14 during Computer Science Education Week and help reach 100 million students by the end of the year. Add your school to the map, go to <http://hourofcode.com>

## Infographic version:

![画像](http://code.org/images/fit-8000/Code.org_infographic.png)


text:
#region copyright

/* * * * * * * * * * * * * * * * * * * * * * * * * */
/* Carl Zeiss IMT (IZfM Dresden)                   */
/* Softwaresystem PiWeb                            */
/* (c) Carl Zeiss 2016                             */
/* * * * * * * * * * * * * * * * * * * * * * * * * */

#endregion

namespace Zeiss.PiWeb.Api.Rest.Common.Data.FilterString.Tree
{
	#region usings

	using System;
	using System.Globalization;
	using JetBrains.Annotations;

	#endregion

	public static class FilterTreeHelper
	{
		#region methods

		/// <exception cref="ArgumentNullException"><paramref name="expected"/> or <paramref name="actual"/> is <see langword="null" />.</exception>
		public static bool CompareTrees( [NotNull] IFilterTree expected, [NotNull] IFilterTree actual )
		{
			if( expected == null ) throw new ArgumentNullException( nameof( expected ) );
			if( actual == null ) throw new ArgumentNullException( nameof( actual ) );

			if( expected.Token.Type != actual.Token.Type )
				return false;

			if( expected.ChildCount != actual.ChildCount )
				return false;

			if( IsContentToken( expected.Token.Type ) )
			{
				if( expected.Token.Type == TokenType.Real )
				{
					var expectedValue = ToDouble( expected.Token.Value );
					var actualValue = ToDouble( actual.Token.Value );

					// a precision of 10^-12 is enough (same as defined in Zeiss.PiWeb.Common.Util.DoubleCompareHelper)
					return Math.Abs( expectedValue - actualValue ) <= 1e-12;
				}

				if( expected.Token.Type == TokenType.Integer )
				{
					var expectedValue = int.Parse( expected.Token.Value );
					var actualValue = int.Parse( actual.Token.Value );

					return expectedValue == actualValue;
				}

				if( !string.Equals( expected.Token.Value, actual.Token.Value ) )
					return false;
			}

			for( var i = 0; i < expected.ChildCount; ++i )
			{
				if( !CompareTrees( expected.GetChild( i ), actual.GetChild( i ) ) )
					return false;
			}

			return true;
		}

		public static double ToDouble( string value )
		{
			if( value.StartsWith( "." ) )
				value = "0" + value;

			if( value.StartsWith( "-." ) )
				value = "-0" + value.Substring( 1 );

			if( value.StartsWith( "+." ) )
				value = "+0" + value.Substring( 1 );

			return double.Parse( value, CultureInfo.InvariantCulture );
		}

		public static bool IsContentToken( TokenType tokenType )
		{
			return
				tokenType == TokenType.AttributeIdentifier ||
				tokenType == TokenType.LegacyValue ||
				tokenType == TokenType.Integer ||
				tokenType == TokenType.Real ||
				tokenType == TokenType.String;
		}

		#endregion
	}
}


text:
#ifndef Texture_h
#define Texture_h

#if USE(ACCELERATED_COMPOSITING)

#include "IntSize.h"

#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>

class SkBitmap;

namespace WebCore {

class Color;
class IntRect;
class TextureCacheCompositingThread;

// Texture encapsulates a volatile texture - at any time, the underlying OpenGL
// texture may be deleted by the TextureCacheCompositingThread. The user must
// check using Texture::isDirty() immediately before using it, every time.
// The only way to prevent eviction this is to call Texture::protect().
// If the texture isDirty(), you must updateContents() before you can use it.
class Texture : public RefCounted<Texture> {
public:
    static PassRefPtr<Texture> create(bool isColor = false)
    {
        return adoptRef(new Texture(isColor));
    }

    ~Texture();

    unsigned textureId() const { return m_textureId; }

    bool isDirty() const { return !m_textureId; }
    bool hasTexture() const { return m_textureId; }

    bool isColor() const { return m_isColor; }
    bool isOpaque() const { return m_isOpaque; }

    bool isProtected() const { return m_protectionCount > 0; }
    void protect() { ++m_protectionCount; }
    void unprotect() { --m_protectionCount; }
    bool protect(const IntSize&);

    void updateContents(const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tile, bool isOpaque);
    void setContentsToColor(const Color&);

    IntSize size() const { return m_size; }
    int width() const { return m_size.width(); }
    int height() const { return m_size.height(); }
    static int bytesPerPixel() { return 4; }

private:
    friend class TextureCacheCompositingThread;

    Texture(bool isColor = false);

    void setTextureId(unsigned id)
    {
        m_textureId = id;

        // We assume it is a newly allocated texture,
        // and thus empty, or 0, which would of course
        // be empty.
        m_size = IntSize();
    }

    int m_protectionCount;
    unsigned m_textureId;
    IntSize m_size;
    bool m_isColor;
    bool m_isOpaque;
};

} // namespace WebCore

#endif // USE(ACCELERATED_COMPOSITING)

#endif // Texture_h


text:
FROM ornladios/adios2:ci-fedora-sanitizers-base

# Set up some arguments
ONBUILD ARG INSTALL_PREFIX
ONBUILD ARG TOOLCHAIN_FILE
ONBUILD ARG CFLAGS
ONBUILD ARG CXXFLAGS
ONBUILD ARG LLVM_USE_SANITIZER

# Build and install libc++
# Have to build in debug mode due to a bug in LLVM:
# https://bugs.llvm.org/show_bug.cgi?id=44586
ONBUILD WORKDIR /root/llvm
ONBUILD RUN git clone --branch llvmorg-9.0.0 --depth 1 \
        https://github.com/llvm/llvm-project.git source && \
    mkdir -p build && \
    cd build && \
    /opt/cmake/bin/cmake \
        -GNinja \
        -DCMAKE_BUILD_TYPE=Debug \
        -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
        -DCMAKE_C_COMPILER=/usr/bin/clang \
        -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
        -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
        -DLLVM_USE_SANITIZER=${LLVM_USE_SANITIZER} \
        ../source/llvm && \
    ninja install-cxxabi install-cxx

# Copy in the toolchain
ONBUILD COPY \
    ${TOOLCHAIN_FILE} \
    ${INSTALL_PREFIX}/toolchain.cmake

# Build and install zlib
ONBUILD WORKDIR /root/zlib
ONBUILD RUN git clone --branch v1.2.11 --depth 1 \
        https://github.com/madler/zlib.git source && \
    mkdir -p build && \
    cd build && \
    /opt/cmake/bin/cmake \
        -GNinja \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_TOOLCHAIN_FILE=${INSTALL_PREFIX}/toolchain.cmake \
        -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
        ../source && \
    ninja install

# Build and install bzip2
ONBUILD WORKDIR /root/bzip2
ONBUILD RUN git clone --branch bzip2-1.0.8 \
        https://sourceware.org/git/bzip2.git source && \
    cd source && \
    sed -e "s_^CC=.*\$_CC=/usr/bin/clang_" \
        -e "s_^CFLAGS=.*\$_CFLAGS=-fpic -fPIC -Wall -Winline -O2 ${CFLAGS} \$(BIGFILES)_" \
        -i Makefile-libbz2_so && \
    make -f Makefile-libbz2_so && \
    sed -e "s_^CC=.*\$_CC=/usr/bin/clang_" \
        -e "s_^PREFIX=.*\$_PREFIX=${INSTALL_PREFIX}_" \
        -e "s_^CFLAGS=.*\$_CFLAGS=-Wall -Winline -O2 ${CFLAGS} \$(BIGFILES)_" \
        -i Makefile && \
    make install && \
    install libbz2.so.1.0.8 ${INSTALL_PREFIX}/lib && \
    ln -s -T libbz2.so.1.0.8 ${INSTALL_PREFIX}/lib/libbz2.so.1.0 && \
    ln -s -T libbz2.so.1.0 ${INSTALL_PREFIX}/lib/libbz2.so

# Build and install zeromq
ONBUILD WORKDIR /root/zeromq
ONBUILD RUN git clone --branch v4.3.2 \
        https://github.com/zeromq/libzmq.git source && \
    mkdir -p build && \
    cd build && \
    /opt/cmake/bin/cmake \
        -GNinja \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_TOOLCHAIN_FILE=${INSTALL_PREFIX}/toolchain.cmake \
        -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
        ../source && \
    ninja install

# Build and install libpng
ONBUILD WORKDIR /root/libpng
ONBUILD RUN git clone --branch v1.6.9 \
        https://git.code.sf.net/p/libpng/code.git source && \
    mkdir -p build && \
    cd build && \
    /opt/cmake/bin/cmake \
        -GNinja \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_TOOLCHAIN_FILE=${INSTALL_PREFIX}/toolchain.cmake \
        -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
        ../source && \
    ninja install

# Build and install hdf5
ONBUILD WORKDIR /root/hdf5
ONBUILD RUN git clone --branch hdf5-1_10_6 \
        https://bitbucket.hdfgroup.org/scm/hdffv/hdf5.git source && \
    mkdir -p build && \
    cd build && \
    /opt/cmake/bin/cmake \
        -GNinja \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_TOOLCHAIN_FILE=${INSTALL_PREFIX}/toolchain.cmake \
        -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
        ../source && \
    ninja install

# Build and install blosc
ONBUILD WORKDIR /root/blosc
ONBUILD RUN git clone --branch v1.17.1 \
        https://github.com/Blosc/c-blosc.git source && \
    mkdir -p build && \
    cd build && \
    /opt/cmake/bin/cmake \
        -GNinja \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_TOOLCHAIN_FILE=${INSTALL_PREFIX}/toolchain.cmake \
        -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
        ../source && \
    ninja install

# Build and install libfabric
ONBUILD WORKDIR /root/libfabric
ONBUILD RUN mkdir -p source build && \
    curl -L \
        https://github.com/ofiwg/libfabric/releases/download/v1.9.0/libfabric-1.9.0.tar.bz2 | \
    tar -C source -xj --strip-components=1 && \
    cd build && \
    ../source/configure \
        --prefix=${INSTALL_PREFIX} \
        CC="/usr/bin/clang ${CFLAGS} -L${INSTALL_PREFIX}/lib -Wl,-rpath,${INSTALL_PREFIX}/lib -Wno-unused-command-line-argument" \
        CXX="/usr/bin/clang++ ${CXXFLAGS} -L${INSTALL_PREFIX}/lib -Wl,-rpath,${INSTALL_PREFIX}/lib -Wno-unused-command-line-argument -nostdinc++ -isystem ${INSTALL_PREFIX}/include/c++/v1 -stdlib=libc++" && \
    make -j4 install

# Build and install libffi
ONBUILD WORKDIR /root/libffi
ONBUILD RUN mkdir -p source build && \
    curl -L \
        https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz | \
    tar -C source -xz --strip-components=1 && \
    cd build && \
    ../source/configure \
        --prefix=${INSTALL_PREFIX} \
        CC="/usr/bin/clang ${CFLAGS} -L${INSTALL_PREFIX}/lib -Wl,-rpath,${INSTALL_PREFIX}/lib -Wno-unused-command-line-argument" \
        CXX="/usr/bin/clang++ ${CXXFLAGS} -L${INSTALL_PREFIX}/lib -Wl,-rpath,${INSTALL_PREFIX}/lib -Wno-unused-command-line-argument -nostdinc++ -isystem ${INSTALL_PREFIX}/include/c++/v1 -stdlib=libc++" && \
    make -j4 install


text:
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd
                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

    <property name="now" value="now()" dbms="h2"/>

    <property name="now" value="now()" dbms="mysql"/>
    <property name="autoIncrement" value="true"/>

    <property name="floatType" value="float4" dbms="postgresql, h2"/>
    <property name="floatType" value="float" dbms="mysql, oracle, mssql"/>

    <!--
        Added the entity Portfolio.
    -->
    <changeSet id="20181021015302-1" author="jhipster">
        <createTable tableName="portfolio">
            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="title" type="varchar(255)">
                <constraints nullable="false" />
            </column>

            <column name="url" type="varchar(255)">
                <constraints nullable="false" />
            </column>

            <column name="cover_photo_url" type="varchar(255)">
                <constraints nullable="false" />
            </column>

            <column name="description" type="clob">
                <constraints nullable="false" />
            </column>

            <column name="sp_date" type="datetime">
                <constraints nullable="false" />
            </column>

            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
        </createTable>
        <dropDefaultValue tableName="portfolio" columnName="sp_date" columnDataType="datetime"/>

    </changeSet>
    <!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here, do not remove-->
</databaseChangeLog>


text:
package org.xmly.thrall.rec.service

import org.springframework.stereotype.Component
import org.xmly.thrall.rec.protocol.RecRequest
import org.apache.spark.mllib.recommendation.MatrixFactorizationModel
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

@Component
class ScoreService {

    val conf = new SparkConf().setAppName("ScorePredictor").setMaster("local[2]")
    val sc = new SparkContext(conf)

    val model = MatrixFactorizationModel.load(sc, "./score.model")

    def estimateScore(req: RecRequest): Long = {
        if (model != null) model.predict(req.uid, req.qid).toLong else -1L
    }
}


text:
/* check-regexp_cmd.h */

/* File autogenerated by gengetopt version 2.19.2  */

#ifndef CHECK_REGEXP_CMD_H
#define CHECK_REGEXP_CMD_H

/* If we use autoconf.  */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#ifndef CMDLINE_PARSER_PACKAGE
#define CMDLINE_PARSER_PACKAGE "check-regexp (GNU Source-highlight)"
#endif

#ifndef CMDLINE_PARSER_VERSION
#define CMDLINE_PARSER_VERSION VERSION
#endif

struct gengetopt_args_info
{
  const char *help_help; /* Print help and exit help description.  */
  const char *version_help; /* Print version and exit help description.  */

  int help_given ;	/* Whether help was given.  */
  int version_given ;	/* Whether version was given.  */

  char **inputs ; /* unamed options */
  unsigned inputs_num ; /* unamed options number */
} ;

extern const char *gengetopt_args_info_purpose;
extern const char *gengetopt_args_info_usage;
extern const char *gengetopt_args_info_help[];

int cmdline_parser (int argc, char * const *argv,
  struct gengetopt_args_info *args_info);
int cmdline_parser2 (int argc, char * const *argv,
  struct gengetopt_args_info *args_info,
  int override, int initialize, int check_required);
int cmdline_parser_file_save(const char *filename,
  struct gengetopt_args_info *args_info);

void cmdline_parser_print_help(void);
void cmdline_parser_print_version(void);

void cmdline_parser_init (struct gengetopt_args_info *args_info);
void cmdline_parser_free (struct gengetopt_args_info *args_info);

int cmdline_parser_required (struct gengetopt_args_info *args_info,
  const char *prog_name);

#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CHECK_REGEXP_CMD_H */


text:
Create beautiful Javascript charts with minimal code.

[See it in action](http://ankane.github.io/chartkick.js/examples/)

Supports [Google Charts](https://developers.google.com/chart/) and [Highcharts](http://www.highcharts.com/) and works with most browsers (including IE 6)

#### Server-side Integration

- [Ruby](https://github.com/ankane/chartkick)
- [Python](https://github.com/mher/chartkick.py)

I would love to see this implemented in other languages too!!

## Usage

Create a div for the chart

```html
<div id="chart-1" style="height: 300px;"></div>
```

Line chart

```javascript
new Chartkick.LineChart("chart-1", {"2013-02-10 00:00:00 -0800": 11, "2013-02-11 00:00:00 -0800": 6});
```

Pie chart

```javascript
new Chartkick.PieChart("chart-1", [["Blueberry", 44],["Strawberry", 23]]);
```

Column chart

```javascript
new Chartkick.ColumnChart("chart-1", [["Sun", 32],["Mon", 46],["Tue", 28]]);
```

Bar chart

```javascript
new Chartkick.BarChart("chart-1", [["Work", 32],["Play", 1492]]);
```

Area chart

```javascript
new Chartkick.AreaChart("chart-1", {"2013-02-10 00:00:00 -0800": 11, "2013-02-11 00:00:00 -0800": 6});
```

Scatter chart

```javascript
new Chartkick.ScatterChart("chart-1", [[174.0, 80.0], [176.5, 82.3], [180.3, 73.6], [167.6, 74.1], [188.0, 85.9]]);
```

Geo chart

```javascript
new Chartkick.GeoChart("chart-1", [["United States",44],["Germany",23],["Brazil",22]]);
```

Timeline

```javascript
new Chartkick.Timeline("chart-1", [["Washington", "1789-04-29", "1797-03-03"],["Adams", "1797-03-03", "1801-03-03"]]);
```

Multiple series

```javascript
data = [
  {"name":"Workout", "data": {"2013-02-10 00:00:00 -0800": 3, "2013-02-17 00:00:00 -0800": 4}},
  {"name":"Call parents", "data": {"2013-02-10 00:00:00 -0800": 5, "2013-02-17 00:00:00 -0800": 3}}
];
new Chartkick.LineChart("chart-1", data);
```

### Say Goodbye To Timeouts

Make your pages load super fast and stop worrying about timeouts.  Give each chart its own endpoint.

```javascript
new Chartkick.LineChart("chart-1", "/stocks");
```

**Note:** This feature requires [jQuery](http://jquery.com/) or [Zepto](http://zeptojs.com/) at the moment.

### Options

Min and max values

```javascript
new Chartkick.LineChart("chart-1", data, {"min": 1000, "max": 5000});
```

`min` defaults to 0 for charts with non-negative values. Use `null` to let the charting library decide.

Colors

```javascript
new Chartkick.LineChart("chart-1", data, {"colors": ["pink", "#999"]});
```

Stacked columns or bars

```javascript
new Chartkick.ColumnChart("chart-1", data, {"stacked": true});
```

Discrete axis

```javascript
new Chartkick.LineChart("chart-1", data, {"discrete": true});
```

Axis titles

```javascript
new Chartkick.LineChart("chart-1", data, {"xtitle": "Time", "ytitle": "Population"});
```

You can pass options directly to the charting library with:

```javascript
new Chartkick.LineChart("chart-1", data, {"library": {"backgroundColor": "pink"}});
```

### Data

Pass data as a Hash or Array

```javascript
new Chartkick.PieChart("chart-1", {"Blueberry": 44, "Strawberry": 23});
new Chartkick.PieChart("chart-1", [["Blueberry", 44],["Strawberry", 23]]);
```

Times can be a `Date`, a timestamp, or a string (strings are parsed)

```javascript
new Chartkick.LineChart("chart-1", [[new Date(), 5],[1368174456, 4],["2013-05-07 00:00:00 UTC", 7]]);
```

## Installation

Download [directly](https://raw.githubusercontent.com/ankane/chartkick.js/master/chartkick.js), or with npm or Bower:

```sh
npm install chartkick
# or
bower install chartkick
```

For Google Charts, use:

```html
<script src="//www.google.com/jsapi"></script>
<script src="chartkick.js"></script>
```

If you prefer Highcharts, use:

```html
<script src="/path/to/highcharts.js"></script>
<script src="chartkick.js"></script>
```

Works with Highcharts 2.1+

### Localization

To specify a language for Google Charts, add:

```html
<script>
  var Chartkick = {"language": "de"};
</script>
```

**before** the javascript files.

### Adapter

If both Google Charts and Highcharts are loaded, choose between them with:

```javascript
new Chartkick.LineChart("chart-1", data, {"adapter": "google"}); // or highcharts
```

## Examples

To run the files in the `examples` directory, you'll need a web server.  Run:

```sh
python -m SimpleHTTPServer
```

and visit [http://localhost:8000/examples/](http://localhost:8000/examples/)

## Credits

Chartkick uses [iso8601.js](https://github.com/Do/iso8601.js) to parse dates and times.

## History

View the [changelog](https://github.com/ankane/chartkick.js/blob/master/CHANGELOG.md)

Chartkick.js follows [Semantic Versioning](http://semver.org/)

## Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

- [Report bugs](https://github.com/ankane/chartkick.js/issues)
- Fix bugs and [submit pull requests](https://github.com/ankane/chartkick.js/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features


text:
package org.apache.camel.component.undertow.rest;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.undertow.BaseUndertowTest;
import org.junit.Test;

public class UndertowHttpEmptyQueryParameterTest extends BaseUndertowTest {

    @Test
    public void testEmpty() throws Exception {
        getMockEndpoint("mock:input").expectedHeaderReceived("id", 123);
        String out = fluentTemplate.to("undertow:http://localhost:{{port}}/foo?id=123").request(String.class);
        assertEquals("Header: 123", out);
        assertMockEndpointsSatisfied();

        resetMocks();

        getMockEndpoint("mock:input").expectedHeaderReceived("id", "");
        out = fluentTemplate.to("undertow:http://localhost:{{port}}/foo?id=").request(String.class);
        assertEquals("Header: ", out);
        assertMockEndpointsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("undertow:http://0.0.0.0:{{port}}/foo")
                    .to("mock:input")
                    .transform().simple("Header: ${header.id}");
            }
        };
    }

}