text:
<?php

namespace Symfony\Component\HttpKernel\Tests\DataCollector;

use Symfony\Component\HttpKernel\DataCollector\EventDataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpKernel\Tests\Fixtures\TestEventDispatcher;

class EventDataCollectorTest extends \PHPUnit_Framework_TestCase
{
    protected function setUp()
    {
        if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
            $this->markTestSkipped('The "EventDispatcher" component is not available');
        }

        if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
            $this->markTestSkipped('The "HttpFoundation" component is not available');
        }
    }

    public function testCollect()
    {
        $c = new EventDataCollector();
        $c->setEventDispatcher(new TestEventDispatcher());

        $c->collect(new Request(), new Response());

        $this->assertSame('events',$c->getName());
        $this->assertSame(array('foo'),$c->getCalledListeners());
        $this->assertSame(array('bar'),$c->getNotCalledListeners());
    }

}

redpajama_set_name: RedPajamaGithub


text:
package org.semanticweb.elk.owl.filters;

import org.semanticweb.elk.owl.interfaces.ElkObjectInverseOf;
import org.semanticweb.elk.owl.visitors.ElkObjectInverseOfVisitor;

/**
 * A filter producing objects in {@link ElkObjectInverseOf} from objects of this
 * type.
 *
 * @author "Yevgeny Kazakov"
 *
 */
public interface ElkObjectInverseOfFilter extends
		ElkObjectInverseOfVisitor<ElkObjectInverseOf> {

	// nothing else

}


text:
package VMOMI::HostUnresolvedVmfsResignatureSpec;
use parent 'VMOMI::DynamicData';

use strict;
use warnings;

our @class_ancestors = (
    'DynamicData',
);

our @class_members = (
    ['extentDevicePath', undef, 1, ],
);

sub get_class_ancestors {
    return @class_ancestors;
}

sub get_class_members {
    my $class = shift;
    my @super_members = $class->SUPER::get_class_members();
    return (@super_members, @class_members);
}

1;


text:
/**
 * This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus).
 * It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
 */

using UnityEngine;
using System.Collections;

namespace Fungus
{
    [VariableInfo("", "Float")]
    [AddComponentMenu("")]
    [System.Serializable]
    public class FloatVariable : VariableBase<float>
    {
        public virtual bool Evaluate(CompareOperator compareOperator, float floatValue)
        {
            float lhs = value;
            float rhs = floatValue;

            bool condition = false;

            switch (compareOperator)
            {
            case CompareOperator.Equals:
                condition = lhs == rhs;
                break;
            case CompareOperator.NotEquals:
                condition = lhs != rhs;
                break;
            case CompareOperator.LessThan:
                condition = lhs < rhs;
                break;
            case CompareOperator.GreaterThan:
                condition = lhs > rhs;
                break;
            case CompareOperator.LessThanOrEquals:
                condition = lhs <= rhs;
                break;
            case CompareOperator.GreaterThanOrEquals:
                condition = lhs >= rhs;
                break;
            }

            return condition;
        }
    }

    [System.Serializable]
    public struct FloatData
    {
        [SerializeField]
        [VariableProperty("<Value>", typeof(FloatVariable))]
        public FloatVariable floatRef;

        [SerializeField]
        public float floatVal;

        public FloatData(float v)
        {
            floatVal = v;
            floatRef = null;
        }

        public static implicit operator float(FloatData floatData)
        {
            return floatData.Value;
        }

        public float Value
        {
            get { return (floatRef == null) ? floatVal : floatRef.value; }
            set { if (floatRef == null) { floatVal = value; } else { floatRef.value = value; } }
        }

        public string GetDescription()
        {
            if (floatRef == null)
            {
                return floatVal.ToString();
            }
            else
            {
                return floatRef.key;
            }
        }
    }

}


text:
package org.apache.zeppelin;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.openqa.selenium.WebDriver;
import java.util.concurrent.TimeUnit;

public class ZeppelinITUtils {

  public final static Logger LOG = LoggerFactory.getLogger(ZeppelinITUtils.class);

  public static void sleep(long millis, boolean logOutput) {
    if (logOutput) {
      LOG.info("Starting sleeping for " + (millis / 1000) + " seconds...");
      LOG.info("Caller: " + Thread.currentThread().getStackTrace()[2]);
    }
    try {
      Thread.sleep(millis);
    } catch (InterruptedException e) {
      LOG.error("Exception in WebDriverManager while getWebDriver ", e);
    }
    if (logOutput) {
      LOG.info("Finished.");
    }
  }
}


text:
Transloadit .NET SDK works with .NET 3.5 or with later version.

#Used third parties#

This SDK uses **Json.NET 6.0** (released on Sat Feb 1, 2014 at 9:00 AM). You can find more information on http://json.codeplex.com/. Documentation can be found on http://james.newtonking.com/json/help/index.html website. Working assembly can be found in the *"bin"* directory.

#Purpose#

This is the official .NET SDK for the transloadit.com API.

You can use it to setup file upload forms for your users, or to upload existing files from your server.

Transloadit SDK for .NET allows you to use Transloadit services easily with .NET applications (Web applications, desktop applications, windows phone applications)

#Directory structure#

- ***"bin"*** - precompiled SDK with the necessary third parties
- ***"build"*** - added to .gitignore (directory will be created automatically when the class libraries are built on your workspace)
- ***"lib"*** - third party libs/DLLs
- ***"src"*** - whole source of the SDK
- ***"test"*** - source of unit tests

#Examples#

Transloadit .NET SDK is easy to configure, easy to use, easy to develop and easy to extend. Please see the details below.

##Sample application##

The sample application below is the part of a simple console application. You can use that example in each kind of application (desktop applications, web applications, mobile applications).

###1. Upload file, use pre-created template with all required settings###

```C#
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Specialized;

using Transloadit;
using Transloadit.Assembly;
using Transloadit.Log;

namespace TestConsole
{
	class Program
	{
		static void Main(string[] args)
		{
			//Create Transloadit instance with your API credentials
			ITransloadit transloadit = new Transloadit.Transloadit("YOUR-PUBLIC-API-KEY", "YOUR-SECRET-KEY");

			//Set template ID
			transloadit.SetTemplateID("YOUR-PRECREATED-TEMPLATE-ID");

			//Create assembly builder to build up the assembly
			IAssemblyBuilder assembly = new AssemblyBuilder();

			//Add a file to be uploaded (with autogenerated key)
			assembly.AddFile(@"C:\temp\test.jpg");

			//Invoke assembly, and wait for the result
			TransloaditResponse response = transloadit.InvokeAssembly(assembly);

			if (response.Success)
			{
				LoggerFactory.GetLogger().LogInfo(Type.GetType("TestConsole.Program"), "Assembly {0} result", response.Data["assembly_id"]);
			}
			else
			{
				LoggerFactory.GetLogger().LogError(Type.GetType("TestConsole.Program"), "Error has occured while completing assembly");
			}
			Console.ReadLine();
		}
	}
}
```

###2. Upload file, with custom assembly with all required also with optional settings###

```C#
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Specialized;

using Transloadit;
using Transloadit.Assembly;
using Transloadit.Log;

namespace TestConsole
{
	class Program
	{
		static void Main(string[] args)
		{
			//Create Transloadit instance with your API credentials
			ITransloadit transloadit = new Transloadit.Transloadit("YOUR-PUBLIC-API-KEY", "YOUR-SECRET-KEY");

			//Create assembly builder to build up the assembly
			IAssemblyBuilder assembly = new AssemblyBuilder();

			//Add a file to be uploaded (with autogenerated key)
			assembly.AddFile(@"C:\temp\test_1.jpg");

			//Add a file to be uploaded (with custom key)
			assembly.AddFile("custom_file", @"C:\temp\test_2.jpg");

			//Define the step, you can define more in the same assembly
			IStep step = new Step();
			step.SetOption("robot", "/image/resize");
			step.SetOption("width", 75);
			step.SetOption("height", 75);
			step.SetOption("resize_strategy", "pad");
			step.SetOption("background", "#000000");

			//Add the step to the assembly
			assembly.AddStep("thumb", step);

			//Set notification URL
			assembly.SetNotifyURL("http://your-service.net/ready");

			//Set the expiration date time of the request for the assembly
			//Assembly will be expired in 120 minutes from now
			assembly.SetAuthExpire(Date.Now.AddMinutes(120));

			//Invoke assembly, and wait for the result
			TransloaditResponse response = transloadit.InvokeAssembly(assembly);

			if (response.Success)
			{
				LoggerFactory.GetLogger().LogInfo(Type.GetType("TestConsole.Program"), "Assembly {0} result", response.Data["assembly_id"]);
			}
			else
			{
				LoggerFactory.GetLogger().LogError(Type.GetType("TestConsole.Program"), "Error has occured while completing assembly");
			}
            Console.ReadLine();
		}
	}
}
```

#Transloadit .NET API#

You need to download the necessary assembly and integrate it to your application. Also you can pull the source and compile with your application.

##1. Configuration##

You can configure this SDK via some constant values.

###1.1. Logger configuration

- `Transloadit.Log.LoggerFactory.LoggerClass` - defines the class to be used for logging
- `Transloadit.Log.TransloaditLogger.Enabled` - enables logging with default TransloaditLogger

##2. Use of the SDK##

If you would like to use .NET SDK for Transloadit in your application, you need to add it as a reference, or you need to pull the latest commit, and use the source directly.

Transloadit services work with assemblies. An assembly must contain each information which will be used for authentication and processing. Each assembly must contain authentication information and step(s) or template ID. You can set custom, and optional values like custom fields and files too.

> **Note:** template ID is the ID of a Transloadit templates that can be defined on Transloadit admin surface

###2.1. Use of `Transloadit.Transloadit` class###

By that class you are able to create a Transloadit instance, which will process all the assemblies sent by your application.

`ITransloadit transloadit = new Transloadit("YOUR-PUBLIC-API-KEY", "YOUR-SECRET-KEY");`

> **Note:** You can use Transloadit instance as singleton instance.

###2.2. Build an assembly###

To build up an assembly you need to use `Transloadit.Assembly.AssemblyBuilder`.

`IAssemblyBuilder builder = new AssemblyBuilder();`

As described above, you can define steps for an assembly, you can use `Transloadit.Assembly.Step` class for that. Each step must have option(s), can be set by `SetOption(string key, object value)` method. That step will be proceed on your uploaded, or predefined resources.

```C#
//Step below will resize the uploaded image to 75x75 size
//with pad resize strategy also with #000000 background color

IStep step = new Step();
step.SetOption("robot", "/image/resize");
step.SetOption("width", 75);
step.SetOption("height", 75);
step.SetOption("resize_strategy", "pad");
step.SetOption("background", "#000000");
```

To add that step to your assembly you need to call the `AddStep(string name, IStep step)` method, where the `name` parameter is the key of the step. You can refer to that key in further steps in the same assmebly, even if you add more.

`builder.AddStep("resize", step);`

####2.2.1. Add custom field to the assembly####

Custom fields can be set for each assembly as a parameter of a precreated template. You can set custom fields with `SetField(string key, object value)` method, where the `key` parameter is the unique key of the field and `value` parameter is the value of the field.

If a valid key is not defined in the custom field collection, then it will be created, also the related value will be set. If a valid key is already defined then it will be overriden with the passed value.

There are some field keys which are used by the SDK. You are not able to use these keys as custom field keys such as "notify_url", "params", "signature", "template_id". If you try to use one of those keys, then a `Transloadit.Assembly.Exceptions.InvalidKeyFieldKeyException` will be thrown.

`Transloadit.Assembly.Exceptions.AlreadyDefinedFieldKeyException` will be thrown, if you try to use a custom field key, which is already defined as a key of a file (read about files in the next section below).

`builder.SetField("field_key", "field_value");`

####2.2.2. Add file to the assembly####

You can call `AddFile(string path)` or `AddFile(string key, string path)` method - where the `key` parameter is the unique key of the file and the `path` parameter is the absolute or relative path of the file - on the created `builder` object to add a file to your assembly.

If you call the method with only the `path` parameter, then the key of the file will be an autogenerated key. If you call the method with both parameters, then the file will be added by the specified key. If the key is already defined as a custom field key or a file key, then an autogenerated key will be set for the file.

`builder.AddFile(@"c:\temp\test.jpg");`

or

`builder.AddFile("custom_file", @"c:\temp\test.jpg");`

####2.2.3. Set authentication information####

As described above, you can set manually authentication information. Some methods give you the possibility to do that, please see examples below. Methods can be called on the `builder` object.

- `SetAuthExpires(DateTime date)` - sets the request expiration date
- `SetAuthMaxSize(int size)` - sets the max size (in bytes) of the requests

```C#
builder.SetAuthExpires(DateTime.Now.AddMinutes(120)); //Request will be expired after the current date time + 120 minutes
builder.SetAuthMaxSize(1024);
```

> **Note:** These methods are optional

####2.2.4. Set notify URL####

You can define notify URL for your assembly by calling `SetNotifyURL(string notifyURL)` on the `builder` object, which will be requested after the assembly is invoked on Transloadit server.

`builder.SetNotifyURL("http://your-service.net/ready");`

If your assembly is ready, then a POST request will be sent to the specified notify URL. By that request you will get information about the status of the created assembly by the posted `transloadit` field.
If you get `assembly_url` as a GET parameter, then that URL will be called by a TransloaditRequest.

> **For example:** You have a mobile .NET application, which invokes assemblies via that .NET SDK, and you have a REST API service written in PHP, which can handle the request which will be sent after the assembly is created. What you need to do is to integrate PHP Transloadit SDK to your PHP REST API service and call `Transloadit::response()` method, then you will be able to use the result of the assembly in your service (like for creating database records, or do something).

####2.2.5. Set template ID####

You can define the template ID which will be used to proceed your assembly on Transloadit server. You can use `SetTemplateID(string templateID)` for that, where the `templateID` parameter is the ID of the precreated template.

`builder.SetTemplateID("ID-OF-PRECEREATED-TEMPLATE");`

####2.2.6. Create assembly on Transloadit####

After your assembly is built up you can send it to Transloadit server by `InvokeAssembly(IAssmeblyBuilder builder)` method - where the `builder` parameter is the built up instance of `AssemblyBuilder` class - that can be called on `transloadit` object. The result of the assembly will be represented in an `ITransloaditJsonResponse` implementation.

`ITransloaditJsonResponse response = transloadit.InvokeAssembly(builder);`

After the request is done and `response` object was created, you are able to use it to handle the result by some `response` object properties, please see them below.

- `response.Data` - gets the response as an object (JObject, provided by the third party JSON handler), which stores the associative tree
- `response.ResponseString` - gets the response string
- `response.Success` - gets the success of the request

> **Note:** You can refer to parsed JSON values by string keys in `response.Data`

####2.2.7. Delete assembly on Transloadit####

Transloadit .NET SDK gives you the possibility to delete an assembly on the server. You can call `DeleteAssembly(string assemblyID)` method - where `assemblyID` parameter is the ID of an exisiting assembly - on the created `transloadit` object. That call can be useful, when you would like to cancel your assembly invoke process.

`ITransloaditJsonResponse response = transloadit.DeleteAssembly("YOUR-CREATED-ASSEMBLY-ID");`

You can handle the response like in case of invoke an assembly.

###2.3. Use of Transloadit logger###

As described above the SDK provides you the possibility to log information and errors. You can use the default `Transloadit.Log.TransloaditLogger`, also you can implement the `Transloadit.Log.ITransloaditLogger` interface to create a custom one.

Logger object can be accessed by the `Transloadit.Log.LoggerFactory.GetLogger()` method. That static factory will get the singleton `Transloadit.Log.ITransloaditLogger` implementation. The returned type can be configured (see the description above). One method provides the possibility to log info, also some other methods provides the possibility to log errors, please see the examples below.

- `LogInfo(Type type, string message, params object[] parameters)` - logs information, where the `type` is the type of the sender object, `message` is the custom log message with parameters and `parameters` are the parameters of the custom log message
- `LogError(Type type, Exception exception, string message, params object[] parameters)` - logs error (preferred to use in case of an exception thrown), where the `type` is the type of the sender object, `exception` is the thrown exception, `message` is the custom log message with parameters and `parameters` are the parameters of the custom log message

> **Note: ** `LogError(...)` method has more definition

##3. Extend Transloadit .NET API##

The SDK is able to be extended. You can use the interfaces to create own implementation, also you can extend the precreated classes to have an extended SDK. Transloadit logger is preferred to be extended.

###3.1. Extend Transloadit logger###

You need to create a class, which implements `Transloadit.Log.ITransloaditLogger` interface. After you have a working implementation, you can set path of your class in the `Transloadit.Log.LoggerFactory.LoggerClass` constant.

`Transloadit.Log.LoggerFactory.LoggerClass = "YourLogger.LoggerForTransloadit, YourLogger";`

The `Transloadit.Log.LoggerFactory.LoggerClass` constant represents the whole definition of your custom logger, where `YourLogger.LoggerForTransloadit` is the exact definition of the logger class and comma separated `YourLogger` is the name of the assembly, which stores your custom logger. `YourLogger.LoggerForTransloadit` must implement `Transloadit.Log.ITransloaditLogger` interface.

##4. Run unit tests##

To pass all the unit tests you need NUnit to be installed on your machine. Update (replace **"YOUR-PUBLIC-API-KEY"** and **"YOUR-SECRET-KEY"** to your keys) your API credentials in the test cases, then compile the test project, then use "Tests.dll" for testing.

> **Note: ** You need to compile the **"Tests"** project.


text:
import { AuthenticatedTwitterCallHandler } from '../../twitter-call-handler';
export declare function available(callHandler: AuthenticatedTwitterCallHandler): Promise<any>;


text:
layout: things
---

metal crate for storage

[welded mild steel tubing and flat stock, gloss white rattle can paint]

![crate 1](http://i.imgur.com/u1zHaNfl.jpg)

![crate 2](http://i.imgur.com/aP2PMgzl.jpg)

![crate 3](http://i.imgur.com/xafVwyNl.jpg)


text:
namespace app_list {

// SpeechUIModel provides the interface to update the UI for speech recognition.
class APP_LIST_EXPORT SpeechUIModel {
 public:
  explicit SpeechUIModel(SpeechRecognitionState initial_state);
  virtual ~SpeechUIModel();

  void SetSpeechResult(const base::string16& result, bool is_final);
  void UpdateSoundLevel(int16 level);
  void SetSpeechRecognitionState(SpeechRecognitionState new_state);

  void AddObserver(SpeechUIModelObserver* observer);
  void RemoveObserver(SpeechUIModelObserver* observer);

  const base::string16& result() const { return result_; }
  bool is_final() const { return is_final_; }
  int16 sound_level() const { return sound_level_; }
  SpeechRecognitionState state() const { return state_; }
  const gfx::ImageSkia& logo() const { return logo_; }
  void set_logo(const gfx::ImageSkia& logo) { logo_ = logo; }

 private:
  base::string16 result_;
  bool is_final_;
  int16 sound_level_;
  SpeechRecognitionState state_;

  // The logo image which the speech UI will show at the top-left.
  gfx::ImageSkia logo_;

  // The sound level range to compute visible sound-level.
  int16 minimum_sound_level_;
  int16 maximum_sound_level_;

  ObserverList<SpeechUIModelObserver> observers_;

  DISALLOW_COPY_AND_ASSIGN(SpeechUIModel);
};

}  // namespace app_list

#endif  // UI_APP_LIST_SPEECH_UI_MODEL_H_


text:
require 'benchmark'

module Neo4j
  class Migration
    def migrate
      fail 'not implemented'
    end

    def output(string = '')
      puts string unless !!ENV['silenced']
    end

    def print_output(string)
      print string unless !!ENV['silenced']
    end

    def default_path
      Rails.root if defined? Rails
    end

    def joined_path(path)
      File.join(path.to_s, 'db', 'neo4j-migrate')
    end

    class AddIdProperty < Neo4j::Migration
      attr_reader :models_filename

      def initialize(path = default_path)
        @models_filename = File.join(joined_path(path), 'add_id_property.yml')
      end

      def migrate
        models = ActiveSupport::HashWithIndifferentAccess.new(YAML.load_file(models_filename))[:models]
        output 'This task will add an ID Property every node in the given file.'
        output 'It may take a significant amount of time, please be patient.'
        models.each do |model|
          output
          output
          output "Adding IDs to #{model}"
          add_ids_to model.constantize
        end
      end

      def setup
        FileUtils.mkdir_p('db/neo4j-migrate')

        return if File.file?(models_filename)

        File.open(models_filename, 'w') do |file|
          message = <<MESSAGE
# Provide models to which IDs should be added.
# # It will only modify nodes that do not have IDs. There is no danger of overwriting data.
# # models: [Student,Lesson,Teacher,Exam]\nmodels: []
MESSAGE
          file.write(message)
        end
      end

      private

      def add_ids_to(model)
        max_per_batch = (ENV['MAX_PER_BATCH'] || default_max_per_batch).to_i

        label = model.mapped_label_name
        last_time_taken = nil

        until (nodes_left = idless_count(label, model.primary_key)) == 0
          print_status(last_time_taken, max_per_batch, nodes_left)

          count = [nodes_left, max_per_batch].min
          last_time_taken = Benchmark.realtime do
            max_per_batch = id_batch_set(label, model.primary_key, count.times.map { new_id_for(model) }, count)
          end
        end
      end

      def idless_count(label, id_property)
        Neo4j::Session.query.match(n: label).where("NOT has(n.#{id_property})").pluck('COUNT(n) AS ids').first
      end

      def print_status(last_time_taken, max_per_batch, nodes_left)
        time_per_node = last_time_taken / max_per_batch if last_time_taken
        message = if time_per_node
                    eta_seconds = (nodes_left * time_per_node).round
                    "#{nodes_left} nodes left.  Last batch: #{(time_per_node * 1000.0).round(1)}ms / node (ETA: #{eta_seconds / 60} minutes)\r"
                  else
                    "Running first batch...\r"
                  end

        print_output message
      end

      def id_batch_set(label, id_property, new_ids, count)
        tx = Neo4j::Transaction.new

        Neo4j::Session.query("MATCH (n:`#{label}`) WHERE NOT has(n.#{id_property})
          with COLLECT(n) as nodes, #{new_ids} as ids
          FOREACH(i in range(0,#{count - 1})|
            FOREACH(node in [nodes[i]]|
              SET node.#{id_property} = ids[i]))
          RETURN distinct(true)
          LIMIT #{count}")

        count
      rescue Neo4j::Server::CypherResponse::ResponseError, Faraday::TimeoutError
        new_max_per_batch = (max_per_batch * 0.8).round
        output "Error querying #{max_per_batch} nodes.  Trying #{new_max_per_batch}"
        new_max_per_batch
      ensure
        tx.close
      end

      def default_max_per_batch
        900
      end

      def new_id_for(model)
        if model.id_property_info[:type][:auto]
          SecureRandom.uuid
        else
          model.new.send(model.id_property_info[:type][:on])
        end
      end
    end
  end
end


text:
const Discord = require('discord.js');
const client = new Discord.Client();

//Grab custom modules
const t = require('./config.js');
const log = require('./modules/log.js');
const map = require('./modules/maps.js');
const f = require('./modules/format.js');
const schedule = require('./modules/schedule.js');

//Bot has just started up, begin auto post schedules
client.on('ready', () => {
  console.log('I am ready!');
  schedule.constructScheduleObject(client);

  map.current().then(function(maps){console.log(maps)});
  schedule.scheduleMapPosts(client, channel);
});

//Parse messages, decide if they are commands and react accordingly
//TODO move to module
client.on('message', message => {
  var userPerm = message.member.permissions;

  //Has the Manage Messages permission
  if(userPerm.has(0x00002000)){
    //Clears a bunch of messages to clean up a channel
    if (message.content === '!clear') {
      message.channel.fetchMessages()
        .then(messages => message.channel.bulkDelete(messages)
          .then(console.log("Successfully deleted messages."))
          .catch(console.error)
        )
        .catch(console.error);
    }
    //Destroy the client, log the bot off
    if (message.content === '!destroy') {
      client.destroy();
    }
  }

  //Generate an invite link for the server
  if(message.content === '!invite'){
    var promise = message.member.guild.defaultChannel.createInvite();
    promise.then(function(result) {
      message.channel.send(result.toString());
    }, function(err) {
      console.log(err);
      messageCreator(message); //message @srs_seth
    });
  }
  //Post the current rotation of maps
  if(message.content == "!maps"){
    map.current().then(function(maps){
      message.channel.send(f.formatMapPost(maps));
    })
  }
  //Post the next rotation of maps
  if(message.content == "!next"){
    map.next().then(function(maps){
      message.channel.send(f.formatMapPost(maps))
    })
  }
  //Simple command to see if the bot is alive
  if (message.content === '!ping' || message.content === "!stay" || message.content === "!stayfresh") {
    message.reply('Stay Fresh!');
  }
});

/*
* Pings @srs_Seth to let him know something went wrong
*/
function messageCreator(message){
  message.channel.send(`Something went wrong, ${message.member.guild.members.find('id', '183675563335090176')} you done goofed.`);
}

client.login(t.token);


text:
/**
 * RESOURCE_DESCRIPTION.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package org.openehr.schemas.v1;

public class RESOURCE_DESCRIPTION  implements java.io.Serializable {
    private org.openehr.schemas.v1.StringDictionaryItem[] original_author;

    private java.lang.String[] other_contributors;

    private java.lang.String lifecycle_state;

    private java.lang.String resource_package_uri;

    private org.openehr.schemas.v1.StringDictionaryItem[] other_details;

    private org.openehr.schemas.v1.RESOURCE_DESCRIPTION_ITEM[] details;

    private org.openehr.schemas.v1.AUTHORED_RESOURCE parent_resource;

    public RESOURCE_DESCRIPTION() {
    }

    public RESOURCE_DESCRIPTION(
           org.openehr.schemas.v1.StringDictionaryItem[] original_author,
           java.lang.String[] other_contributors,
           java.lang.String lifecycle_state,
           java.lang.String resource_package_uri,
           org.openehr.schemas.v1.StringDictionaryItem[] other_details,
           org.openehr.schemas.v1.RESOURCE_DESCRIPTION_ITEM[] details,
           org.openehr.schemas.v1.AUTHORED_RESOURCE parent_resource) {
           this.original_author = original_author;
           this.other_contributors = other_contributors;
           this.lifecycle_state = lifecycle_state;
           this.resource_package_uri = resource_package_uri;
           this.other_details = other_details;
           this.details = details;
           this.parent_resource = parent_resource;
    }

    /**
     * Gets the original_author value for this RESOURCE_DESCRIPTION.
     *
     * @return original_author
     */
    public org.openehr.schemas.v1.StringDictionaryItem[] getOriginal_author() {
        return original_author;
    }

    /**
     * Sets the original_author value for this RESOURCE_DESCRIPTION.
     *
     * @param original_author
     */
    public void setOriginal_author(org.openehr.schemas.v1.StringDictionaryItem[] original_author) {
        this.original_author = original_author;
    }

    public org.openehr.schemas.v1.StringDictionaryItem getOriginal_author(int i) {
        return this.original_author[i];
    }

    public void setOriginal_author(int i, org.openehr.schemas.v1.StringDictionaryItem _value) {
        this.original_author[i] = _value;
    }

    /**
     * Gets the other_contributors value for this RESOURCE_DESCRIPTION.
     *
     * @return other_contributors
     */
    public java.lang.String[] getOther_contributors() {
        return other_contributors;
    }

    /**
     * Sets the other_contributors value for this RESOURCE_DESCRIPTION.
     *
     * @param other_contributors
     */
    public void setOther_contributors(java.lang.String[] other_contributors) {
        this.other_contributors = other_contributors;
    }

    public java.lang.String getOther_contributors(int i) {
        return this.other_contributors[i];
    }

    public void setOther_contributors(int i, java.lang.String _value) {
        this.other_contributors[i] = _value;
    }

    /**
     * Gets the lifecycle_state value for this RESOURCE_DESCRIPTION.
     *
     * @return lifecycle_state
     */
    public java.lang.String getLifecycle_state() {
        return lifecycle_state;
    }

    /**
     * Sets the lifecycle_state value for this RESOURCE_DESCRIPTION.
     *
     * @param lifecycle_state
     */
    public void setLifecycle_state(java.lang.String lifecycle_state) {
        this.lifecycle_state = lifecycle_state;
    }

    /**
     * Gets the resource_package_uri value for this RESOURCE_DESCRIPTION.
     *
     * @return resource_package_uri
     */
    public java.lang.String getResource_package_uri() {
        return resource_package_uri;
    }

    /**
     * Sets the resource_package_uri value for this RESOURCE_DESCRIPTION.
     *
     * @param resource_package_uri
     */
    public void setResource_package_uri(java.lang.String resource_package_uri) {
        this.resource_package_uri = resource_package_uri;
    }

    /**
     * Gets the other_details value for this RESOURCE_DESCRIPTION.
     *
     * @return other_details
     */
    public org.openehr.schemas.v1.StringDictionaryItem[] getOther_details() {
        return other_details;
    }

    /**
     * Sets the other_details value for this RESOURCE_DESCRIPTION.
     *
     * @param other_details
     */
    public void setOther_details(org.openehr.schemas.v1.StringDictionaryItem[] other_details) {
        this.other_details = other_details;
    }

    public org.openehr.schemas.v1.StringDictionaryItem getOther_details(int i) {
        return this.other_details[i];
    }

    public void setOther_details(int i, org.openehr.schemas.v1.StringDictionaryItem _value) {
        this.other_details[i] = _value;
    }

    /**
     * Gets the details value for this RESOURCE_DESCRIPTION.
     *
     * @return details
     */
    public org.openehr.schemas.v1.RESOURCE_DESCRIPTION_ITEM[] getDetails() {
        return details;
    }

    /**
     * Sets the details value for this RESOURCE_DESCRIPTION.
     *
     * @param details
     */
    public void setDetails(org.openehr.schemas.v1.RESOURCE_DESCRIPTION_ITEM[] details) {
        this.details = details;
    }

    public org.openehr.schemas.v1.RESOURCE_DESCRIPTION_ITEM getDetails(int i) {
        return this.details[i];
    }

    public void setDetails(int i, org.openehr.schemas.v1.RESOURCE_DESCRIPTION_ITEM _value) {
        this.details[i] = _value;
    }

    /**
     * Gets the parent_resource value for this RESOURCE_DESCRIPTION.
     *
     * @return parent_resource
     */
    public org.openehr.schemas.v1.AUTHORED_RESOURCE getParent_resource() {
        return parent_resource;
    }

    /**
     * Sets the parent_resource value for this RESOURCE_DESCRIPTION.
     *
     * @param parent_resource
     */
    public void setParent_resource(org.openehr.schemas.v1.AUTHORED_RESOURCE parent_resource) {
        this.parent_resource = parent_resource;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof RESOURCE_DESCRIPTION)) return false;
        RESOURCE_DESCRIPTION other = (RESOURCE_DESCRIPTION) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.original_author==null && other.getOriginal_author()==null) ||
             (this.original_author!=null &&
              java.util.Arrays.equals(this.original_author, other.getOriginal_author()))) &&
            ((this.other_contributors==null && other.getOther_contributors()==null) ||
             (this.other_contributors!=null &&
              java.util.Arrays.equals(this.other_contributors, other.getOther_contributors()))) &&
            ((this.lifecycle_state==null && other.getLifecycle_state()==null) ||
             (this.lifecycle_state!=null &&
              this.lifecycle_state.equals(other.getLifecycle_state()))) &&
            ((this.resource_package_uri==null && other.getResource_package_uri()==null) ||
             (this.resource_package_uri!=null &&
              this.resource_package_uri.equals(other.getResource_package_uri()))) &&
            ((this.other_details==null && other.getOther_details()==null) ||
             (this.other_details!=null &&
              java.util.Arrays.equals(this.other_details, other.getOther_details()))) &&
            ((this.details==null && other.getDetails()==null) ||
             (this.details!=null &&
              java.util.Arrays.equals(this.details, other.getDetails()))) &&
            ((this.parent_resource==null && other.getParent_resource()==null) ||
             (this.parent_resource!=null &&
              this.parent_resource.equals(other.getParent_resource())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getOriginal_author() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getOriginal_author());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getOriginal_author(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getOther_contributors() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getOther_contributors());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getOther_contributors(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getLifecycle_state() != null) {
            _hashCode += getLifecycle_state().hashCode();
        }
        if (getResource_package_uri() != null) {
            _hashCode += getResource_package_uri().hashCode();
        }
        if (getOther_details() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getOther_details());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getOther_details(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getDetails() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getDetails());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getDetails(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getParent_resource() != null) {
            _hashCode += getParent_resource().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(RESOURCE_DESCRIPTION.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "RESOURCE_DESCRIPTION"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("original_author");
        elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "original_author"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "StringDictionaryItem"));
        elemField.setNillable(false);
        elemField.setMaxOccursUnbounded(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("other_contributors");
        elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "other_contributors"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        elemField.setMaxOccursUnbounded(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("lifecycle_state");
        elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "lifecycle_state"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("resource_package_uri");
        elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "resource_package_uri"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("other_details");
        elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "other_details"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "StringDictionaryItem"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        elemField.setMaxOccursUnbounded(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("details");
        elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "details"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "RESOURCE_DESCRIPTION_ITEM"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        elemField.setMaxOccursUnbounded(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("parent_resource");
        elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "parent_resource"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.openehr.org/v1", "AUTHORED_RESOURCE"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
module Stradivari
  module Filter
    module Model

      module Rails4
        def stradivari_all
          all
        end
      end

    end
  end
end


text:
f5_vip 'myvip' do
  address '86.75.30.9'
  port '80'
  protocol 'PROTOCOL_TCP'
  pool 'reallybasic'
  enforced_firewall_policy 'myfwpolicy-enforced'
end


text:
<TITLE>Review for Ever After (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Ever After (1998)

reviewed by
Steve Rhodes

EVER AFTER
A film review by Steve Rhodes
Copyright 1998 Steve Rhodes

RATING (0 TO ****):  ***

     EVER AFTER is a delightful retelling and reinventing of the
Cinderella legend by writers Susannah Grant, Rick Parks, and director
Andy Tennant.  Set in a lush, fairytale, sixteenth century France, the
movie floats on gossamer wings.

     Drew Barrymore, last seen so bewitchingly as the waitress in THE
WEDDING SINGER, plays Danielle, a.k.a. Cinderella.  Danielle is a
beautiful tomboy who fights with the best of them but who manages to
stay absolutely charming in every scene.  Barrymore is perfectly cast
for the role, and, given this script, it becomes hard to think of anyone
who could have played it better.  When she smiles, the camera lens
almost melts.

     As Danielle's stepmother, Rodmilla, Anjelica Huston delivers a
reserved but dead-on performance, helped by the bitingly witty script.
"Nothing is final until you're dead, and even then I'm sure God
negotiates," she concludes.  Anyone who plans on negotiating with God,
certainly thinks highly of herself.  And when she catches Danielle
wasting her time reading books, she has an unusual put-down.  "Some
people read because they can't think," she chides her.

     Danielle's stepsisters are played by Megan Dodds as the bitchy
blonde, Marguerite, and Melanie Lynskey as the more lovable Jacqueline.
The former wants to go to the dances to marry the prince, but the latter
goes only for the food - if her mother is to be believed.  In the film's
most satisfying scene, Danielle finally slugs Marguerite when she can
stomach her no more.

     Poor Prince Henry (Dougray Scott) is in an arranged marriage to a
Spanish princess he doesn't love.  Fleeing the castle one day in hopes
of avoiding the marriage, he meets Danielle, a feisty servant.  When he
meets her later, she is dressed in finer garments so he doesn't
recognize her.  He comes to believe, incorrectly, that she is of noble
blood and starts seeing her without the knowledge of her stepmother or
two stepsisters.

     The king, played by Timothy West, feels sorry for his son so he
gives him 5 days to choose a bride.  "Choose wisely, Henry," the queen
(Judy Parfitt) sternly admonishes.  "Divorce is something they only do
in England."

     Of course, the prince will want Danielle for his bride, and, of
course, there will be numerous complications.  "A bird may love a fish,
senor."  Danielle tells Leonardo da Vinci, who conveniently happens by.
"But where would they live."  A prince and a commoner are not a likely
combination in the 1600s.

     Never fear, they will get together and the stepmother and her awful
daughter will get theirs in the end.  But you knew the story.  The
delight of EVER AFTER is that it makes it all seem new and fresh.
Barrymore's performance alone is worth the price of admission.

     EVER AFTER runs 2:01.  It is rated PG-13 for a single mild
profanity, and the picture would be fine for all ages.

     My son Jeffrey, age 9, loved the picture, giving it ****.  He
thought Barrymore was really cute. (When she first kisses the prince, he
leaned over to me and whispered, "I wish I was the man in that picture."
Ditto for his Dad.)  His favorite part was the ball and Danielle's
costume with the fairy-like wings.

Email: Steve.Rhodes@InternetReviews.com
Web: www.InternetReviews.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
@implementation MODProcessor
{
    NSMutableArray *_addedDependencies;
    NSMutableArray *_removedDependencies;
    NSMutableArray *_possiblyUnusedDependencies;
    NSMutableArray *_updatedDependencies;
    NSMutableArray *_unpushableBranches;

    NSMutableArray *_itemsToBeRemoved;

    NSFileManager *_fileManager;
}

#pragma mark - Public methods

+ (instancetype)processor
{
    MODProcessor *processor = [[MODProcessor alloc] init];
    return processor;
}

- (instancetype)init
{
    self = [super init];

    _addedDependencies = [NSMutableArray array];
    _removedDependencies = [NSMutableArray array];
    _possiblyUnusedDependencies = [NSMutableArray array];
    _updatedDependencies = [NSMutableArray array];
    _itemsToBeRemoved = [NSMutableArray array];
    _unpushableBranches = [NSMutableArray array];

    _fileManager = [NSFileManager defaultManager];

    return self;
}

#pragma mark - Public Properties

- (NSArray *)addedDependencies
{
    return [NSArray arrayWithArray:_addedDependencies];
}

- (NSArray *)removedDependencies
{
    return [NSArray arrayWithArray:_removedDependencies];
}

- (NSArray *)possiblyUnusedDependencies
{
    return [NSArray arrayWithArray:_possiblyUnusedDependencies];
}

- (NSArray *)updatedDependencies
{
    return [NSArray arrayWithArray:_updatedDependencies];
}

- (NSArray *)unpushableBranches
{
    return [NSArray arrayWithArray:_unpushableBranches];
}

#pragma mark - Public Methods

- (BOOL)addDependencyWithModuleURL:(NSString *)moduleURL branch:(NSString *)branch;
{
    BOOL result = YES;
    NSString *name = [moduleURL nameFromModuleURL];

    NSInteger status = 0;
    MODSpecModel *dependencyModel = nil;

    NSString *dependencyLocalPath = [[MODSpecModel sharedInstance] dependencyLocalPathFromName:name];
    BOOL isLibrary = [dependencyLocalPath isLibraryPath];

    BOOL isDirectory = NO;
    BOOL pathExists = [_fileManager fileExistsAtPath:dependencyLocalPath isDirectory:&isDirectory];
    if (pathExists && !isDirectory)
    {
        sdprintln(@"%@ exists already and isn't a directory.  Unable to add dependency.", dependencyLocalPath);
        result = NO;
        goto completionLabel;
    }

    // the path doesn't exist, we need to clone it.
    if (!pathExists)
    {
        if (isLibrary)
        {
            // this repo is a library, treat it special.

            // clone command

            NSString *cloneCommand = [NSString stringWithFormat:@"git clone -b %@ %@ %@", branch, moduleURL, dependencyLocalPath];
            status = [self runCommand:cloneCommand];
            if (status != 0)
            {
                // git submodule add failed.  Rewind changes.
                result = NO;
                goto completionLabel;
            }
        }
        else
        {
            // it's not a library, so do the normal consumer stuff.

            // add command

            NSString *addCommand = [NSString stringWithFormat:@"git submodule add -b %@ %@ %@", branch, moduleURL, dependencyLocalPath];
            status = [self runCommand:addCommand];
            if (status != 0)
            {
                // git submodule add failed.  Rewind changes.
                result = NO;
                goto completionLabel;
            }

            // update command

            NSString *updateCommand = [NSString stringWithFormat:@"git submodule update --init --recursive %@", dependencyLocalPath];
            status = [self runCommand:updateCommand];
            if (status != 0)
            {
                // git submodule update/init failed.  Rewind changes.
                result = NO;
                goto completionLabel;
            }

            if (status != 0)
            {
                result = NO;
                goto completionLabel;
            }
        }
    }

completionLabel:

    dependencyModel = [MODSpecModel instanceFromPath:dependencyLocalPath];

    if (!dependencyModel)
        dependencyModel = [[MODSpecModel alloc] init];
    if (!dependencyModel.name)
        dependencyModel.name = name;
    if (!dependencyModel.moduleURL)
        dependencyModel.moduleURL = moduleURL;

    if (result)
    {
        for (MODSpecModel *item in dependencyModel.dependencies)
        {
            result = [self addDependencyWithModuleURL:item.moduleURL branch:item.initialBranch];
            if (!result)
                break;
        }
    }

    if ([[MODSpecModel sharedInstance] addDependency:dependencyModel])
    {
        if (![_addedDependencies containsObject:dependencyModel])
            [_addedDependencies addObject:dependencyModel];
    }
    else
    {
        // it exists already, just update it.
        [[MODSpecModel sharedInstance] updateDependency:dependencyModel];
    }

    return result;
}

- (BOOL)removeDependencyNamed:(NSString *)name
{
    BOOL result = YES;

    MODSpecModel *existing = [[MODSpecModel sharedInstance] dependencyNamed:name];
    if (!existing)
        result = NO;

    if (result)
    {
        // get our depNames before we remove it.
        NSArray<NSString> *names = [existing dependencyNames];
        for (NSString *item in names)
        {
            if ([item isEqualToString:name])
                continue;

            NSMutableArray *otherDeps = [[[MODSpecModel sharedInstance] namesThatDependOn:item] mutableCopy];
            if (otherDeps)
            {
                [otherDeps removeObjectsInArray:names];
                [otherDeps removeObject:name];
                if (otherDeps.count)
                    [_possiblyUnusedDependencies addObjectsFromArray:otherDeps];
                else
                    [_possiblyUnusedDependencies addObject:item];
            }
            else
                [_possiblyUnusedDependencies addObject:item];

        }

        [self _removeDependency:name];
    }

    return result;
}

- (BOOL)updateDependencyNames:(NSArray<NSString> *)names
{
    BOOL result = NO;

    for (NSString *item in names)
    {
        result = [self _updateDependencyNamed:item skipRemove:YES];
        if (!result)
            break;
    }

    if (_itemsToBeRemoved.count)
    {
        //for (NSString *item in _itemsToBeRemoved)
        //    [self removeDependencyNamed:item];
        [_possiblyUnusedDependencies addObjectsFromArray:_itemsToBeRemoved];
    }

    // sync our main project submodules if it's not a module.
    if (![[MODSpecModel sharedInstance].dependenciesPath isLibraryPath])
    {
        NSInteger status = [self runCommand:@"git submodule sync"];
        if (status != 0)
            result = NO;
    }

    return result;
}

- (BOOL)switchBranches:(NSString *)branchName
{
    BOOL result = YES;

    result = [self _switchName:nil toBranch:branchName];

    if (result)
    {
        NSArray<MODSpecModel> *dependencies = [MODSpecModel sharedInstance].dependencies;
        for (MODSpecModel *item in dependencies)
        {
            result = [self _switchName:item.name toBranch:branchName];
        }
    }

    return result;
}

#pragma mark - Running Commands

- (NSInteger)runCommand:(NSString *)command parseBlock:(MODCommandParseBlock)parseBlock
{
    // lets print the command without the redirection stuff.
    if (self.verbose)
        sdprintln(@"Running: %@", command);

    NSString *tempFile = [_fileManager temporaryFile];

    if (parseBlock)
        command = [command stringByAppendingFormat:@" &> %@", tempFile];

    NSInteger status = system([command UTF8String]);

    if (parseBlock)
    {
        NSString *outputString = [NSString stringWithContentsOfFile:tempFile encoding:NSUTF8StringEncoding error:nil];
        status = parseBlock(status, outputString);
        if (status != 0)
            sdprintln(outputString);
        [_fileManager removeItemAtPath:tempFile error:nil];
    }

    return status;
}

- (NSInteger)runCommand:(NSString *)command
{
    return [self runCommand:command parseBlock:nil];
}

#pragma mark - Git callouts

- (NSString *)currentBranchForName:(NSString *)name
{
    NSString *dependencyLocalPath = [[MODSpecModel sharedInstance] dependencyLocalPathFromName:name];

    // get into our dependency dir
    [_fileManager changeCurrentDirectoryPath:dependencyLocalPath];

    __block NSString *branch = nil;
    NSInteger status = [self runCommand:@"git rev-parse --abbrev-ref HEAD" parseBlock:^NSInteger(NSInteger returnStatus, NSString *outputString) {
        if (returnStatus == 0)
            branch = [outputString stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\n"]];
        return returnStatus;
    }];

    // get back home.
    [_fileManager changeCurrentDirectoryPath:[SDCommandLineParser sharedInstance].startingWorkingPath];

    if (status != 0)
        sderror(@"Unable to determine the current branch for %@.", name);

    return branch;
}

- (BOOL)hasOutstandingPushesForName:(NSString *)name
{
    NSString *branch = [self currentBranchForName:name];
    NSString *dependencyLocalPath = [[MODSpecModel sharedInstance] dependencyLocalPathFromName:name];

    // get into our dependency dir
    [_fileManager changeCurrentDirectoryPath:dependencyLocalPath];

    NSString *command = [NSString stringWithFormat:@"git rev-list origin/%@...%@", branch, branch];
    __block BOOL hasPushesToDo = NO;
    NSInteger status = [self runCommand:command parseBlock:^NSInteger(NSInteger returnStatus, NSString *outputString) {
        hasPushesToDo = (outputString.length != 0);
        return returnStatus;
    }];

    // get back home.
    [_fileManager changeCurrentDirectoryPath:[SDCommandLineParser sharedInstance].startingWorkingPath];

    if (status != 0)
        sderror(@"Unable to determine the current branch for %@.", name);

    return hasPushesToDo;
}

- (BOOL)hasStashesForName:(NSString *)name
{
    NSString *dependencyLocalPath = [[MODSpecModel sharedInstance] dependencyLocalPathFromName:name];

    // get into our dependency dir
    [_fileManager changeCurrentDirectoryPath:dependencyLocalPath];

    __block BOOL hasStashes = NO;
    NSInteger status = [self runCommand:@"git stash list" parseBlock:^NSInteger(NSInteger returnStatus, NSString *outputString) {
        hasStashes = (outputString.length != 0);
        return returnStatus;
    }];

    // get back home.
    [_fileManager changeCurrentDirectoryPath:[SDCommandLineParser sharedInstance].startingWorkingPath];

    if (status != 0)
        sderror(@"Unable to determine the current branch for %@.", name);

    return hasStashes;
}

- (BOOL)hasOutstandingChangesForName:(NSString *)name
{
    NSString *dependencyLocalPath = [[MODSpecModel sharedInstance] dependencyLocalPathFromName:name];

    // get into our dependency dir
    [_fileManager changeCurrentDirectoryPath:dependencyLocalPath];

    __block BOOL hasChanges = YES;
    NSInteger status = [self runCommand:@"git status" parseBlock:^NSInteger(NSInteger returnStatus, NSString *outputString) {
        if ([outputString rangeOfString:@"nothing to commit"].location != NSNotFound)
            hasChanges = NO;
        return returnStatus;
    }];

    // get back home.
    [_fileManager changeCurrentDirectoryPath:[SDCommandLineParser sharedInstance].startingWorkingPath];

    if (status != 0)
        sderror(@"Unable to determine the current branch for %@.", name);

    return hasChanges;
}

- (BOOL)hasPushAccessForName:(NSString *)name
{
    NSString *dependencyLocalPath = [[MODSpecModel sharedInstance] dependencyLocalPathFromName:name];

    // get into our dependency dir
    [_fileManager changeCurrentDirectoryPath:dependencyLocalPath];

    __block BOOL hasPushAccess = NO;
    NSInteger status = [self runCommand:@"git push --dry-run" parseBlock:^NSInteger(NSInteger returnStatus, NSString *outputString) {
        if (![outputString containsString:@"Permission to"] && ![outputString containsString:@"denied to"])
            hasPushAccess = YES;
        return 0;
    }];

    // get back home.
    [_fileManager changeCurrentDirectoryPath:[SDCommandLineParser sharedInstance].startingWorkingPath];

    if (status != 0)
        sderror(@"Unable to determine the current branch for %@.", name);

    return hasPushAccess;
}

- (NSArray<NSString> *)uncleanDependencies
{
    return [self uncleanDependenciesForName:nil];
}

- (NSArray<NSString> *)uncleanDependenciesForName:(NSString *)name
{
    NSMutableArray *uncleanDeps = [NSMutableArray array];
    NSMutableArray *deps = [NSMutableArray array];
    if (name && name.length > 0)
    {
        [deps addObject:name]; // Check the top level dependency also
        [deps addObjectsFromArray:[[MODSpecModel sharedInstance] namesThatDependOn:name]];
    }
    else
    {
        [deps addObjectsFromArray:[[MODSpecModel sharedInstance] dependencyNames]];
    }

    for (NSString *item in deps)
    {
        BOOL hasStashes = [self hasStashesForName:item];
        BOOL hasCommitsToPush = [self hasOutstandingPushesForName:item];
        BOOL hasChangesToCommit = [self hasOutstandingChangesForName:item];

        if (hasStashes || hasCommitsToPush || hasChangesToCommit)
            [uncleanDeps addObject:item];
    }

    if (uncleanDeps.count)
        return (NSArray<NSString> *)[NSArray arrayWithArray:uncleanDeps];

    return nil;
}

#pragma mark - Internal utlities

- (void)_removeDependency:(NSString *)name
{
    NSString *dependencyLocalPath = [[MODSpecModel sharedInstance] dependencyLocalPathFromName:name];

    BOOL isLibrary = [dependencyLocalPath isLibraryPath];

    // if it's not a library, we need to muck with git a little.
    if (!isLibrary)
    {
        // it failed, we need to rewind it.
        NSString *removeCommand = [NSString stringWithFormat:@"git submodule deinit -f %@", dependencyLocalPath];
        [self runCommand:removeCommand];

        NSString *cleanupCommand = [NSString stringWithFormat:@"git rm -f -r --cached %@", dependencyLocalPath];
        [self runCommand:cleanupCommand];

        NSString *rmGitCommand = [NSString stringWithFormat:@"rm -rf .git/modules/%@", dependencyLocalPath];
        [self runCommand:rmGitCommand];
    }

    NSString *rmCommand = [NSString stringWithFormat:@"rm -rf %@", dependencyLocalPath];
    [self runCommand:rmCommand];

    [[MODSpecModel sharedInstance] removeDependencyNamed:name];
    [_removedDependencies addObject:name];
}

- (BOOL)_updateDependencyNamed:(NSString *)name skipRemove:(BOOL)skipRemove
{
    BOOL result = YES;

    sdprintln(@"Updating %@...", name);

    NSString *dependencyLocalPath = [[MODSpecModel sharedInstance] dependencyLocalPathFromName:name];

    MODSpecModel *originalSpec = [MODSpecModel instanceFromPath:dependencyLocalPath];

    // get into our dependency dir
    [_fileManager changeCurrentDirectoryPath:dependencyLocalPath];

    // update that mofo.
    NSInteger status = [self runCommand:@"git pull --recurse-submodules"];

    // update any sub-submodules
    if (status == 0)
        status = [self runCommand:@"git submodule update --recursive"];

    // synchronize any sub-submodules
    if (status == 0)
        status = [self runCommand:@"git submodule sync"];

    // get back home.
    [_fileManager changeCurrentDirectoryPath:[SDCommandLineParser sharedInstance].startingWorkingPath];

    if (status != 0)
        sderror(@"There was a problem updating %@.  See the log for details.  After correcting the issue, re-run this command.", name);

    MODSpecModel *updatedSpec = [MODSpecModel instanceFromPath:dependencyLocalPath];

    NSMutableArray *originalNames = [[originalSpec dependencyNames] mutableCopy];
    NSMutableArray *updatedNames = [[updatedSpec dependencyNames] mutableCopy];

    // update the items in our current spec with the changes we just got.
    for (NSString *item in updatedNames)
    {
        MODSpecModel *updatedDep = [updatedSpec dependencyNamed:item];
        [[MODSpecModel sharedInstance] updateDependency:updatedDep];
    }

    // find out which deps have been added
    NSMutableArray *addedNames = [updatedNames mutableCopy];
    [addedNames removeObjectsInArray:originalNames];

    // find out which deps have been removed.
    NSMutableArray *removedNames = [originalNames mutableCopy];
    [removedNames removeObjectsInArray:updatedNames];

    if (addedNames.count)
    {
        for (NSString *item in updatedNames)
        {
            MODSpecModel *updatedDep = [updatedSpec dependencyNamed:item];
            result = [self addDependencyWithModuleURL:updatedDep.moduleURL branch:updatedDep.initialBranch];
        }
    }

    if (removedNames.count && result)
    {
        if (!skipRemove)
        {
            for (NSString *item in removedNames)
            {
                // we don't care if this fails .. it'll only actually get removed if
                // nothing else depends on it.
                [self removeDependencyNamed:item];
            }
        }
        else
        {
            // put these names someplace so we can remove them later.
            [_itemsToBeRemoved addObjectsFromArray:removedNames];
        }
    }

    return result;
}

- (BOOL)_switchName:(NSString *)name toBranch:(NSString *)branchName
{
    BOOL result = YES;
    NSInteger status = 0;

    // if no name was specified, we're working on the main repo and not a dependency.
    if (!name)
    {
        // change branches in the local repo.

        __block BOOL alreadyExists = NO;
        NSString *command = [NSString stringWithFormat:@"git checkout -b %@", branchName];
        status = [self runCommand:command parseBlock:^NSInteger(NSInteger returnStatus, NSString *outputString) {
            if ([outputString containsString:@" already exists."])
            {
                alreadyExists = YES;
                returnStatus = 0;
            }
            return returnStatus;
        }];

        // it already exists, so try to just change to it.
        if (alreadyExists)
        {
            NSString *newCommand = [NSString stringWithFormat:@"git checkout %@", branchName];
            status = [self runCommand:newCommand parseBlock:^NSInteger(NSInteger returnStatus, NSString *outputString) {
                if ([outputString containsString:@"Switched to branch"])
                    returnStatus = 0;
                else
                    if ([outputString containsString:@"Already on"])
                        returnStatus = 0;
                    else
                        sdprintln(outputString);
                return returnStatus;
            }];
        }
    }
    else
    {
        // change branches on the specified module.

        if (![self hasPushAccessForName:name])
        {
            NSString *currentBranchName = [self currentBranchForName:name];
            NSString *nameWithCurrentBranch = [NSString stringWithFormat:@"%@ (%@)", name, currentBranchName];
            [_unpushableBranches addObject:nameWithCurrentBranch];
            return result;
        }

        NSString *dependencyLocalPath = [[MODSpecModel sharedInstance] dependencyLocalPathFromName:name];

        // get into our dependency dir
        [_fileManager changeCurrentDirectoryPath:dependencyLocalPath];

        __block BOOL alreadyExists = NO;
        NSString *command = [NSString stringWithFormat:@"git checkout -b %@", branchName];
        status = [self runCommand:command parseBlock:^NSInteger(NSInteger returnStatus, NSString *outputString) {
            if ([outputString containsString:@" already exists."])
            {
                alreadyExists = YES;
                returnStatus = 0;
            }
            return returnStatus;
        }];

        // it already exists, so try to just change to it.
        if (alreadyExists)
        {
            NSString *newCommand = [NSString stringWithFormat:@"git checkout %@", branchName];
            status = [self runCommand:newCommand parseBlock:^NSInteger(NSInteger returnStatus, NSString *outputString) {
                if ([outputString containsString:@"Switched to branch"])
                    returnStatus = 0;
                else
                    if ([outputString containsString:@"Already on"])
                        returnStatus = 0;
                    else
                        sdprintln(outputString);
                return returnStatus;
            }];
        }

        // get back home.
        [_fileManager changeCurrentDirectoryPath:[SDCommandLineParser sharedInstance].startingWorkingPath];
    }

    if (status != 0)
    {
        result = NO;
        sdprintln(@"Unable to switch module %@ to branch %@.", name, branchName);
        sderror(@"\nPlease fix the issue and re-run this command.  See log for details.");
    }
    else
    {
        if (!name)
            sdprintln(@"Switched %@ to branch %@", [MODSpecModel sharedInstance].name, branchName);
        else
            sdprintln(@"Switched module %@ to branch %@", name, branchName);
    }

    return result;
}

@end


text:
if (typeof self === "undefined") {
  //eslint-disable-next-line no-implicit-globals, no-global-assign
  self = {};
}

self.onmessage = function (event) {
  const array = event.data.array;
  const postMessage = self.webkitPostMessage || self.postMessage;

  try {
    // transfer the test array back to the caller
    postMessage(
      {
        array: array,
      },
      [array.buffer]
    );
  } catch (e) {
    postMessage({});
  }
};


text:
using System.Runtime.InteropServices;

public partial class RayComposerConstants
{

    /// RCAPI_VERSION -> 0x0100
    public const int RCAPI_VERSION = 256;
}

public enum RCReturnCode
{

    /// RCOk -> 0
    RCOk = 0,

    /// RCErrorNotInitialised -> -1
    RCErrorNotInitialised = -1,

    /// RCErrorNotEnumerated -> -2
    RCErrorNotEnumerated = -2,

    /// RCErrorInvalidHandle -> -3
    RCErrorInvalidHandle = -3,

    /// RCErrorNotStarted -> -4
    RCErrorNotStarted = -4,

    /// RCErrorIO -> -5
    RCErrorIO = -5,

    /// RCErrorParameterOutOfRange -> -6
    RCErrorParameterOutOfRange = -6,

    /// RCErrorParameterInvalid -> -7
    RCErrorParameterInvalid = -7,
}

public enum RCUniverseDirection
{

    /// RCOutput -> 0
    RCOutput = 0,

    /// RCInput -> 1
    RCInput = 1,
}

[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct RCPoint
{

    /// short
    public short x;

    /// short
    public short y;

    /// unsigned short
    public ushort red;

    /// unsigned short
    public ushort green;

    /// unsigned short
    public ushort blue;

    /// unsigned short
    public ushort intensity;

    /// unsigned short
    public ushort user1;

    /// unsigned short
    public ushort user2;
}

public partial class RayComposer
{
    const string winStringDLL =  "rcdev64";
    const string macStringDLL = "RayComposer1.6";
    //const string winStringDLL = (UnityEngine.Application.platform == UnityEngine.RuntimePlatform.WindowsEditor) ? winStringDLL : macStringDLL;

    /// Return Type: int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCInit")]
    public static extern int RCInit();

    /// Return Type: int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCExit")]
    public static extern int RCExit();

    /// Return Type: int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCEnumerateDevices")]
    public static extern int RCEnumerateDevices();

    /// Return Type: int
    ///index: unsigned int
    ///deviceId: char*
    ///maxLength: unsigned int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCDeviceID")]
    public static extern int RCDeviceID(uint index, System.Text.StringBuilder deviceId, uint maxLength);

    /// Return Type: int
    ///deviceId: char*
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCOpenDevice")]
    public static extern int RCOpenDevice(System.Text.StringBuilder deviceId);

    /// Return Type: int
    ///handle: int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCCloseDevice")]
    public static extern int RCCloseDevice(int handle);

    /// Return Type: int
    ///handle: int
    ///deviceLabel: char*
    ///maxLength: unsigned int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCDeviceLabel")]
    public static extern int RCDeviceLabel(int handle, System.IntPtr deviceLabel, uint maxLength);

    /// Return Type: int
    ///handle: int
    ///deviceLabel: char*
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCSetDeviceLabel")]
    public static extern int RCSetDeviceLabel(int handle, System.IntPtr deviceLabel);

    /// Return Type: int
    ///handle: int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCStartOutput")]
    public static extern int RCStartOutput(int handle);

    /// Return Type: int
    ///handle: int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCStopOutput")]
    public static extern int RCStopOutput(int handle);

    /// Return Type: int
    ///handle: int
    ///timeout: int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCWaitForReady")]
    public static extern int RCWaitForReady(int handle, int timeout);

    /// Return Type: int
    ///handle: int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCMaxSpeed")]
    public static extern int RCMaxSpeed(int handle);

    /// Return Type: int
    ///handle: int
    ///points: RCPoint*
    ///count: unsigned int
    ///speed: unsigned int
    ///repeat: unsigned int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCWriteFrame")]
    public static extern int RCWriteFrame(int handle, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)]
        RCPoint[] points, uint count, uint speed, uint repeat);

    /// Return Type: int
    ///handle: int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCUniverseCount")]
    public static extern int RCUniverseCount(int handle);

    /// Return Type: int
    ///handle: int
    ///universeIndex: unsigned int
    ///universeName: char*
    ///maxLength: unsigned int
    ///pUniverseDirection: RCUniverseDirection*
    ///pChannelCount: unsigned int*
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCUniverseQuery")]
    public static extern int RCUniverseQuery(int handle, uint universeIndex, System.IntPtr universeName, uint maxLength, ref RCUniverseDirection pUniverseDirection, ref uint pChannelCount);

    /// Return Type: int
    ///handle: int
    ///universeIndex: unsigned int
    ///startChannel: unsigned int
    ///data: unsigned char*
    ///count: unsigned int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCUniverseWrite")]
    public static extern int RCUniverseWrite(int handle, uint universeIndex, uint startChannel, System.IntPtr data, uint count);

    /// Return Type: int
    ///handle: int
    ///universeIndex: unsigned int
    ///startChannel: unsigned int
    ///data: unsigned char*
    ///count: unsigned int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCUniverseRead")]
    public static extern int RCUniverseRead(int handle, uint universeIndex, uint startChannel, System.IntPtr data, uint count);

    /// Return Type: int
    ///handle: int
    ///universeIndex: unsigned int
    [System.Runtime.InteropServices.DllImportAttribute(winStringDLL, EntryPoint = "RCUniverseUpdate")]
    public static extern int RCUniverseUpdate(int handle, uint universeIndex);

}


text:
package org.robolectric.shadows;

import android.R;
import android.app.Activity;
import android.view.View;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import android.widget.TabWidget;
import org.robolectric.Robolectric;
import org.robolectric.internal.Implementation;
import org.robolectric.internal.Implements;
import org.robolectric.internal.RealObject;

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

import static org.robolectric.Robolectric.shadowOf;

@SuppressWarnings({"UnusedDeclaration"})
@Implements(TabHost.class)
public class ShadowTabHost extends ShadowFrameLayout {
    private List<TabHost.TabSpec> tabSpecs = new ArrayList<TabHost.TabSpec>();
    private TabHost.OnTabChangeListener listener;
    private int currentTab = -1;

    @RealObject
    TabHost realObject;

    @Implementation
    public android.widget.TabHost.TabSpec newTabSpec(java.lang.String tag) {
        TabSpec realTabSpec = Robolectric.newInstanceOf(TabHost.TabSpec.class);
        shadowOf(realTabSpec).setTag(tag);
        return realTabSpec;
    }

    @Implementation
    public void addTab(android.widget.TabHost.TabSpec tabSpec) {
        tabSpecs.add(tabSpec);
        View indicatorAsView = shadowOf(tabSpec).getIndicatorAsView();
        if (indicatorAsView != null) {
            realObject.addView(indicatorAsView);
        }
    }

    @Implementation
    public void setCurrentTab(int index) {
        currentTab = index;
        if (listener != null) {
            listener.onTabChanged(getCurrentTabTag());
        }
    }

    @Implementation
    public void setCurrentTabByTag(String tag) {
        for (int x = 0; x < tabSpecs.size(); x++) {
            TabSpec tabSpec = tabSpecs.get(x);
            if (tabSpec.getTag().equals(tag)) {
                currentTab = x;
            }
        }
        if (listener != null) {
            listener.onTabChanged(getCurrentTabTag());
        }
    }

    @Implementation
    public int getCurrentTab() {
        if (currentTab == -1 && tabSpecs.size() > 0) currentTab = 0;
        return currentTab;
    }

    public TabSpec getCurrentTabSpec() {
        return tabSpecs.get(getCurrentTab());
    }

    @Implementation
    public String getCurrentTabTag() {
        int i = getCurrentTab();
        if (i >= 0 && i < tabSpecs.size()) {
            return tabSpecs.get(i).getTag();
        }
        return null;
    }

    @Implementation
    public void setOnTabChangedListener(android.widget.TabHost.OnTabChangeListener listener) {
        this.listener = listener;
    }

    @Implementation
    public View getCurrentView() {
        ShadowTabSpec ts = Robolectric.shadowOf(getCurrentTabSpec());
        View v = ts.getContentView();
        if (v == null) {
            int viewId = ts.getContentViewId();
            if (getContext() instanceof Activity) {
                v = ((Activity) getContext()).findViewById(viewId);
            } else {
                return null;
            }
        }
        return v;
    }

    @Implementation
    public TabWidget getTabWidget() {
        if (context instanceof Activity) {
            return (TabWidget) ((Activity)context).findViewById(R.id.tabs);
        } else {
            return null;
        }
    }

    public TabHost.TabSpec getSpecByTag(String tag) {
        for (TabHost.TabSpec tabSpec : tabSpecs) {
            if (tag.equals(tabSpec.getTag())) {
                return tabSpec;
            }
        }
        return null;
    }
}


text:
package threadsafe

import (
	"sync"

	"github.com/apache/trafficcontrol/traffic_monitor/cache"
)

// CacheAvailableStatus wraps a map of cache available statuses to be safe for
// multiple reader goroutines and one writer.
type CacheAvailableStatus struct {
	caches *cache.AvailableStatuses
	m      *sync.RWMutex
}

// NewCacheAvailableStatus creates and returns a new CacheAvailableStatus,
// initializing internal pointer values.
func NewCacheAvailableStatus() CacheAvailableStatus {
	c := cache.AvailableStatuses(map[string]cache.AvailableStatus{})
	return CacheAvailableStatus{m: &sync.RWMutex{}, caches: &c}
}

// Get returns the internal map of cache statuses. The returned map MUST NOT be
// modified. If modification is necessary, copy.
func (o *CacheAvailableStatus) Get() cache.AvailableStatuses {
	o.m.RLock()
	defer o.m.RUnlock()
	return *o.caches
}

// Set sets the internal map of cache availability. This MUST NOT be called by
// multiple goroutines.
func (o *CacheAvailableStatus) Set(v cache.AvailableStatuses) {
	o.m.Lock()
	*o.caches = v
	o.m.Unlock()
}


text:
/*
 * Angular Imports
 */
import { Component } from "@angular/core";
import { Router } from "@angular/router";
import { FormGroup, AbstractControl, FormBuilder, Validators } from "@angular/forms";

/*
 * Components
 */
import { AuthService } from "./auth.service";

@Component({
    selector: "db-signin",
    templateUrl: "./sign-in.component.html",
    styleUrls: ["./auth.scss"]
})
export class SignInComponent {
    public form: FormGroup;
    public email: AbstractControl;
    public password: AbstractControl;
    public submitted: boolean = false;
    error = "";

    constructor(private auth: AuthService, private router: Router, fb: FormBuilder) {
        this.form = fb.group({
            "email": ["", Validators.compose([Validators.required, Validators.minLength(4)])],
            "password": ["", Validators.compose([Validators.required, Validators.minLength(4)])]
        });

        this.email = this.form.controls["email"];
        this.password = this.form.controls["password"];
    }

    onSubmit(values: any): void {
        this.submitted = true;
        this.auth.signIn(values.email, values.password)
            .then(() => this.postSignIn())
            .catch((error) => {
                this.error = error.toString();
                this.submitted = false;
            });
    }

    private postSignIn(): void {
        this.email.setValue('');
        this.password.setValue('');
        this.router.navigate(["/welcome"]);
    }
}


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Weapon
 *
 * @ORM\Table(name="weapon")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\WeaponRepository")
 */
class Weapon
{
    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Model")
     * @ORM\JoinColumn(nullable=false)
     */
    private $model;
    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Image")
     * @ORM\JoinColumn(nullable=false)
     */
    private $image;
    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Crate")
     * @ORM\JoinColumn(nullable=true)
     */
    private $crate;
    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Collection")
     * @ORM\JoinColumn(nullable=true)
     */
    private $collection;
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="quality", type="string", length=50)
     */
    private $quality;

    /**
     * @var int
     *
     * @ORM\Column(name="quantity", type="integer")
     */
    private $quantity;

    /**
     * @var float
     *
     * @ORM\Column(name="price", type="float")
     */
    private $price;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="date", type="datetime")
     */
    private $date;

    public function __construct(){
        $this->date = new \DateTime();
    }

    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return Weapon
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set quality
     *
     * @param string $quality
     *
     * @return Weapon
     */
    public function setQuality($quality)
    {
        $this->quality = $quality;

        return $this;
    }

    /**
     * Get quality
     *
     * @return string
     */
    public function getQuality()
    {
        return $this->quality;
    }

    /**
     * Set quantity
     *
     * @param integer $quantity
     *
     * @return Weapon
     */
    public function setQuantity($quantity)
    {
        $this->quantity = $quantity;

        return $this;
    }

    /**
     * Get quantity
     *
     * @return int
     */
    public function getQuantity()
    {
        return $this->quantity;
    }

    /**
     * Set price
     *
     * @param float $price
     *
     * @return Weapon
     */
    public function setPrice($price)
    {
        $this->price = $price;

        return $this;
    }

    /**
     * Get price
     *
     * @return float
     */
    public function getPrice()
    {
        return $this->price;
    }

    /**
     * Set image
     *
     * @param \AppBundle\Entity\Image $image
     *
     * @return Weapon
     */
    public function setImage(\AppBundle\Entity\Image $image)
    {
        $this->image = $image;

        return $this;
    }

    /**
     * Get image
     *
     * @return \AppBundle\Entity\Image
     */
    public function getImage()
    {
        return $this->image;
    }

    /**
     * Set model
     *
     * @param \AppBundle\Entity\Model $model
     *
     * @return Weapon
     */
    public function setModel(\AppBundle\Entity\Model $model)
    {
        $this->model = $model;

        return $this;
    }

    /**
     * Get model
     *
     * @return \AppBundle\Entity\Model
     */
    public function getModel()
    {
        return $this->model;
    }

    /**
     * Set crate
     *
     * @param \AppBundle\Entity\Crate $crate
     *
     * @return Weapon
     */
    public function setCrate(\AppBundle\Entity\Crate $crate = null)
    {
        $this->crate = $crate;

        return $this;
    }

    /**
     * Get crate
     *
     * @return \AppBundle\Entity\Crate
     */
    public function getCrate()
    {
        return $this->crate;
    }

    /**
     * Set collection
     *
     * @param \AppBundle\Entity\Collection $collection
     *
     * @return Weapon
     */
    public function setCollection(\AppBundle\Entity\Collection $collection = null)
    {
        $this->collection = $collection;

        return $this;
    }

    /**
     * Get collection
     *
     * @return \AppBundle\Entity\Collection
     */
    public function getCollection()
    {
        return $this->collection;
    }

    /**
     * Set date
     *
     * @param \DateTime $date
     *
     * @return Weapon
     */
    public function setDate($date)
    {
        $this->date = $date;

        return $this;
    }

    /**
     * Get date
     *
     * @return \DateTime
     */
    public function getDate()
    {
        return $this->date;
    }
}


text:
import List from "#SRC/js/structs/List";
import Tree from "#SRC/js/structs/Tree";

import Application from "./Application";
import Framework from "./Framework";
import HealthTypes from "../constants/HealthTypes";
import HealthStatus from "../constants/HealthStatus";
import Pod from "./Pod";
import Service from "./Service";
import * as ServiceStatus from "../constants/ServiceStatus";
import ServiceUtil from "../utils/ServiceUtil";
import ServiceValidatorUtil from "../utils/ServiceValidatorUtil";

export default class ServiceTree extends Tree {
  /*
   * (Marathon) ServiceTree
   * @param {{
   *          id:string,
   *          items:array<({id:string, items:array}|*)>,
   *          groups:array<({id:string, groups:array, apps:array}|*)>,
   *          apps:array,
   *          filterProperties:{propertyName:(null|string|function)}
   *        }} options
   * @constructor
   * @struct
   */
  constructor(options = {}) {
    super(options);

    this.id = "/";
    if (options.id || typeof options.id == "string") {
      this.id = options.id;
    }
    if (
      options.enforceRole !== undefined &&
      typeof options.enforceRole === "boolean"
    ) {
      this.enforceRole = options.enforceRole;
    }

    // Converts items into instances of ServiceTree, Application or Framework
    // based on their properties.
    this.list = this.list.map((item) => {
      if (item instanceof ServiceTree || item instanceof Service) {
        return item;
      }

      // Check item properties and convert items with an items array (sub trees)
      // into ServiceTree instances.
      if (item.items != null && Array.isArray(item.items)) {
        return new this.constructor({
          filterProperties: this.getFilterProperties(),
          ...item,
        });
      }

      // Create the appropriate service according to definition
      if (ServiceValidatorUtil.isPodResponse(item)) {
        return new Pod(item);
      }

      if (ServiceValidatorUtil.isFrameworkResponse(item)) {
        return new Framework(item);
      }

      if (ServiceValidatorUtil.isApplicationResponse(item)) {
        return new Application(item);
      }

      throw Error("Unknown service response: " + JSON.stringify(item));
    });
  }

  getQueue() {
    return null;
  }

  getRegions() {
    return [];
  }

  getHealth() {
    return this.reduceItems((aggregatedHealth, item) => {
      if (item instanceof Service) {
        const health = item.getHealth();
        if (HealthTypes[aggregatedHealth.key] > HealthTypes[health.key]) {
          aggregatedHealth = health;
        }
      }

      return aggregatedHealth;
    }, HealthStatus.NA);
  }

  getId() {
    return this.id;
  }

  getEnforceRole() {
    return this.enforceRole;
  }

  getServiceFromTaskID(taskID) {
    return this.findItemById(ServiceUtil.getServiceIDFromTaskID(taskID));
  }

  getTaskFromTaskID(taskID) {
    const service = this.getServiceFromTaskID(taskID);

    if (service == null || service.tasks == null || !service.tasks.length) {
      return null;
    }

    return service.tasks.find((task) => task.id === taskID);
  }

  getItemParent(id, parent = null) {
    if (this.getId() === id) {
      return parent;
    }

    if (!this.list || this.list.length === 0) {
      return null;
    }

    let parentFound = null;

    for (let i = 0; i < this.list.length; i++) {
      const child = this.list[i];
      if (child instanceof ServiceTree) {
        parentFound = child.getItemParent(id, this);
      } else if (child.getId() === id) {
        parentFound = this;

        break;
      }
    }

    return parentFound;
  }

  /**
   * @param {string} id
   * @return {Service|ServiceTree} matching item
   */
  findItemById(id) {
    if (this.getId() === id) {
      return this;
    }

    return this.findItem((item) => item.getId() === id);
  }

  getInstancesCount() {
    return this.reduceItems((instances, item) => {
      if (item instanceof Service) {
        instances += item.getInstancesCount();
      }

      return instances;
    }, 0);
  }

  getStatusCategoryCounts() {
    const categoryCounts = {
      status: {},
      total: 0,
    };

    return this.reduceItems((counts, item) => {
      if (item instanceof Service) {
        const itemStatus = item.getServiceStatus();
        if (itemStatus === null) {
          return counts;
        }
        counts.total++;
        if (counts.status[itemStatus.category]) {
          counts.status[itemStatus.category]++;
        } else {
          counts.status[itemStatus.category] = 1;
        }
      }

      return counts;
    }, categoryCounts);
  }

  getServiceTreeStatusSummary() {
    const status = this.getServiceStatus();
    const statusCategoryCounts = this.getStatusCategoryCounts();

    return {
      status: status.category,
      counts: statusCategoryCounts,
    };
  }

  getName() {
    return this.getId().split("/").pop();
  }

  getRootGroupName() {
    return this.getId().split("/")[1];
  }

  getResources() {
    return this.reduceItems(
      (resources, item) => {
        if (item instanceof Service) {
          const { cpus = 0, mem = 0, disk = 0, gpus = 0 } = item.getResources();

          resources.cpus += cpus;
          resources.mem += mem;
          resources.disk += disk;
          resources.gpus += gpus;
        }

        return resources;
      },
      { cpus: 0, mem: 0, disk: 0, gpus: 0 }
    );
  }

  getStatus() {
    return this.getServiceStatus().displayName;
  }

  getServiceStatus() {
    return this.reduceItems((serviceTreeStatus, item) => {
      if (item instanceof Service) {
        const status = item.getServiceStatus();
        if (status == null) {
          return serviceTreeStatus;
        }

        if (status.priority > serviceTreeStatus.priority) {
          serviceTreeStatus = status;
        }
      }

      return serviceTreeStatus;
    }, ServiceStatus.NA);
  }

  getServices() {
    const items = this.reduceItems((services, item) => {
      if (item instanceof Service) {
        services.push(item);
      }

      return services;
    }, []);

    return new List({ items });
  }

  getGroups() {
    const items = this.reduceItems((groups, item) => {
      if (item instanceof ServiceTree) {
        groups.push(item);
      }

      return groups;
    }, []);

    return new List({ items });
  }

  getTasksSummary() {
    return this.reduceItems(
      (taskSummary, item) => {
        if (item instanceof Service) {
          const {
            tasksHealthy = 0,
            tasksRunning = 0,
            tasksOverCapacity = 0,
            tasksStaged = 0,
            tasksUnhealthy = 0,
          } = item.getTasksSummary();

          taskSummary.tasksHealthy += tasksHealthy;
          taskSummary.tasksRunning += tasksRunning;
          taskSummary.tasksStaged += tasksStaged;
          taskSummary.tasksUnhealthy += tasksUnhealthy;
          taskSummary.tasksUnknown +=
            tasksRunning - tasksHealthy - tasksUnhealthy;

          taskSummary.tasksOverCapacity += tasksOverCapacity;
        }

        return taskSummary;
      },
      {
        tasksHealthy: 0,
        tasksRunning: 0,
        tasksStaged: 0,
        tasksUnhealthy: 0,
        tasksUnknown: 0,
        tasksOverCapacity: 0,
      }
    );
  }

  getRunningInstancesCount() {
    return this.flattenItems()
      .getItems()
      .reduce((memo, service) => {
        if (service instanceof ServiceTree) {
          return memo;
        }

        return memo + service.getRunningInstancesCount();
      }, 0);
  }

  getFrameworks() {
    return this.reduceItems((frameworks, item) => {
      if (item instanceof Framework) {
        frameworks.push(item);
      }

      return frameworks;
    }, []);
  }

  getVolumes() {
    return this.reduceItems((serviceTreeVolumes, item) => {
      if (item instanceof Service) {
        const itemVolumes = item.getVolumes();
        if (itemVolumes && itemVolumes.length) {
          serviceTreeVolumes.push(itemVolumes);
        }
      }

      return serviceTreeVolumes;
    }, []);
  }

  getLabels() {
    return this.list.reduce((acc, el) => {
      Object.entries(el.labels || {}).forEach(([key, value]) => {
        acc.push({ key, value });
      });
      return acc;
    }, []);
  }

  getQuotaRoleStats(roleName = null, getMesosTasksByService) {
    const name = roleName || this.getName();
    return this.reduceItems(
      (roles, item) => {
        if (item instanceof ServiceTree) {
          return roles;
        }

        roles.count++;
        const itemRole = item.getRole();
        if (itemRole) {
          roles.rolesCount++;
          if (itemRole === name) {
            roles.groupRoleCount++;
          }
        }

        if (item instanceof Framework) {
          const tasks = getMesosTasksByService(item);
          if (tasks) {
            tasks.forEach((t) => {
              roles.count++;

              const marathonTask = (item.get("tasks") || []).find(
                (marathonTask) => marathonTask.id === t.id
              );

              if (marathonTask) {
                const taskRole = marathonTask.role;

                if (taskRole) {
                  roles.rolesCount++;
                  if (taskRole === name) {
                    roles.groupRoleCount++;
                  }
                }
              }
            });
          }
        }

        return roles;
      },
      { count: 0, rolesCount: 0, groupRoleCount: 0 }
    );
  }

  isRoot() {
    return this.getId() === "/";
  }

  isTopLevel() {
    return !this.isRoot() && this.getId().split("/").length === 2;
  }
}


text:
[//]: # (title: 2. Parsing Test)

<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->

<tldr>

**Tested Functionality**: [](lexer_and_parser_definition.md)

</tldr>

<include from="tests_prerequisites.md" element-id="custom_language_testing_tutorial_header"></include>

For more complex Lexers (e.g., having additional logic), it is advisable to add separate tests inheriting from [`LexerTestCase`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/LexerTestCase.java).

## Update Grammar and Regenerate the Parser
Before creating the parsing test, ensure the parser definition (<path>Simple.bnf</path>) includes the lines shown below.
These additional lines facilitate testing incorrect keys.

If the lines below are not present in <path>Simple.bnf</path>, replace the existing `property` definition with the lines below.
Don't forget to regenerate the parser after updating the file!
Right-click on the <path>Simple.bnf</path> file and select <control>Generate Parser Code</control>.

```bnf
property ::= (KEY? SEPARATOR VALUE?) | KEY {
  pin=3
  recoverWhile="recover_property"
  mixin="org.intellij.sdk.language.psi.impl.SimpleNamedElementImpl"
  implements="org.intellij.sdk.language.psi.SimpleNamedElement"
  methods=[getKey getValue getName setName getNameIdentifier getPresentation]
}
private recover_property ::= !(KEY|SEPARATOR|COMMENT)
```

## Define Input Test Data
Create the <path>ParsingTestData.simple</path> properties file in the <path>testData</path> folder.
Note the last few lines define a purposely incorrect key.

```bash
```
{src="simple_language_plugin/src/test/testData/ParsingTestData.simple"}

## Copy the Expected PSI Tree
The easiest way to get the expected PSI structure for any file is to use the PSI Viewer.
Run the project and use <ui-path>Tools | View PSI Structure</ui-path>.

![PSI Tree Copy](plugin_copy_psi.png)

Use the <control>Copy PSI</control> button to copy the expected PSI structure to the clipboard.

## Define the Output Reference Test Data
Create a file <path>ParsingTestData.txt</path> with the copied PSI tree.

```text
```
{src="simple_language_plugin/src/test/testData/ParsingTestData.txt"}

## Define a Parsing Test
Subclass [`ParsingTestCase`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/ParsingTestCase.java) to create `SimpleParsingTest`:
Override `getTestDataPath()`, and return the path from the root of this plugin module to the <path>testData</path> directory.

```java
```
{src="simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleParsingTest.java"}

## Run the Test

Run tests by:
* Opening the <control>Gradle</control> Tool Window.
* Select the <control>simple_language_plugin</control> node.
  You may need to reimport it as a Gradle project.
* Drill down under <control>simple_language_plugin</control> to <control>Tasks</control>, <control>verification</control>, <control>test</control> task.
* Run the <control>test</control> task.

The results are displayed in the <control>Run</control> Tool Window, and also written to the <path>simple_language_plugin/build/test-results/test</path> directory.

If the <control>Run</control> Tool Window displays the error *Test events were not received*, do the following:
* In the <control>Gradle</control> Tool Window, drill down under <control>simple_language_plugin</control> to <control>Tasks</control>, <control>build</control>, <control>clean</control> task.
* Run the <control>clean</control> task, which deletes the <path>simple_language_plugin/build</path> directory.
* Restart the test.