text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Umbraco.Core.Collections;
using Umbraco.Core.Composing;
using Umbraco.Core.Exceptions;
using Umbraco.Core.Logging;
using Umbraco.Core.Scoping;

namespace Umbraco.Core.Components
{
    // note: this class is NOT thread-safe in any ways

    /// <summary>
    /// Handles the composers.
    /// </summary>
    internal class Composers
    {
        private readonly Composition _composition;
        private readonly IProfilingLogger _logger;
        private readonly IEnumerable<Type> _composerTypes;

        private const int LogThresholdMilliseconds = 100;

        /// <summary>
        /// Initializes a new instance of the <see cref="Composers"/> class.
        /// </summary>
        /// <param name="composition">The composition.</param>
        /// <param name="composerTypes">The composer types.</param>
        /// <param name="logger">A profiling logger.</param>
        public Composers(Composition composition, IEnumerable<Type> composerTypes, IProfilingLogger logger)
        {
            _composition = composition ?? throw new ArgumentNullException(nameof(composition));
            _composerTypes = composerTypes ?? throw new ArgumentNullException(nameof(composerTypes));
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
        }

        private class EnableInfo
        {
            public bool Enabled;
            public int Weight = -1;
        }

        /// <summary>
        /// Instantiates and composes the composers.
        /// </summary>
        public void Compose()
        {
            // make sure it is there
            _composition.WithCollectionBuilder<ComponentCollectionBuilder>();

            IEnumerable<Type> orderedComposerTypes;

            using (_logger.DebugDuration<Composers>("Preparing composer types.", "Prepared composer types."))
            {
                orderedComposerTypes = PrepareComposerTypes();
            }

            var composers = InstantiateComposers(orderedComposerTypes);

            using (_logger.DebugDuration<Composers>($"Composing composers. (log when >{LogThresholdMilliseconds}ms)", "Composed composers."))
            {
                foreach (var composer in composers)
                {
                    var componentType = composer.GetType();
                    using (_logger.DebugDuration<Composers>($"Composing {componentType.FullName}.", $"Composed {componentType.FullName}.", thresholdMilliseconds: LogThresholdMilliseconds))
                    {
                        composer.Compose(_composition);
                    }
                }
            }
        }

        private IEnumerable<Type> PrepareComposerTypes()
        {
            // create a list, remove those that cannot be enabled due to runtime level
            var composerTypeList = _composerTypes
                .Where(x =>
                {
                    // use the min level specified by the attribute if any
                    // otherwise, user composers have Run min level, anything else is Unknown (always run)
                    var attr = x.GetCustomAttribute<RuntimeLevelAttribute>();
                    var minLevel = attr?.MinLevel ?? (x.Implements<IUserComposer>() ? RuntimeLevel.Run : RuntimeLevel.Unknown);
                    return _composition.RuntimeState.Level >= minLevel;
                })
                .ToList();

            // enable or disable composers
            EnableDisableComposers(composerTypeList);

            // sort the composers according to their dependencies
            var requirements = new Dictionary<Type, List<Type>>();
            foreach (var type in composerTypeList) requirements[type] = null;
            foreach (var type in composerTypeList)
            {
                GatherRequirementsFromRequireAttribute(type, composerTypeList, requirements);
                GatherRequirementsFromRequiredByAttribute(type, composerTypeList, requirements);
            }

            // only for debugging, this is verbose
            //_logger.Debug<Composers>(GetComposersReport(requirements));

            // sort composers
            var graph = new TopoGraph<Type, KeyValuePair<Type, List<Type>>>(kvp => kvp.Key, kvp => kvp.Value);
            graph.AddItems(requirements);
            List<Type> sortedComposerTypes;
            try
            {
                sortedComposerTypes = graph.GetSortedItems().Select(x => x.Key).ToList();
            }
            catch (Exception e)
            {
                // in case of an error, force-dump everything to log
                _logger.Info<Composers>("Composer Report:\r\n{ComposerReport}", GetComposersReport(requirements));
                _logger.Error<Composers>(e, "Failed to sort composers.");
                throw;
            }

            // bit verbose but should help for troubleshooting
            //var text = "Ordered Composers: " + Environment.NewLine + string.Join(Environment.NewLine, sortedComposerTypes) + Environment.NewLine;
            _logger.Debug<Composers>("Ordered Composers: {SortedComposerTypes}", sortedComposerTypes);

            return sortedComposerTypes;
        }

        private static string GetComposersReport(Dictionary<Type, List<Type>> requirements)
        {
            var text = new StringBuilder();
            text.AppendLine("Composers & Dependencies:");
            text.AppendLine();

            foreach (var kvp in requirements)
            {
                var type = kvp.Key;

                text.AppendLine(type.FullName);
                foreach (var attribute in type.GetCustomAttributes<RequireAttribute>())
                    text.AppendLine("  -> " + attribute.RequiredType + (attribute.Weak.HasValue
                        ? (attribute.Weak.Value ? " (weak)" : (" (strong" + (requirements.ContainsKey(attribute.RequiredType) ? ", missing" : "") + ")"))
                        : ""));
                foreach (var attribute in type.GetCustomAttributes<RequiredByAttribute>())
                    text.AppendLine("  -< " + attribute.RequiringType);
                foreach (var i in type.GetInterfaces())
                {
                    text.AppendLine("  : " + i.FullName);
                    foreach (var attribute in i.GetCustomAttributes<RequireAttribute>())
                        text.AppendLine("    -> " + attribute.RequiredType + (attribute.Weak.HasValue
                            ? (attribute.Weak.Value ? " (weak)" : (" (strong" + (requirements.ContainsKey(attribute.RequiredType) ? ", missing" : "") + ")"))
                            : ""));
                    foreach (var attribute in i.GetCustomAttributes<RequiredByAttribute>())
                        text.AppendLine("    -< " + attribute.RequiringType);
                }
                if (kvp.Value != null)
                    foreach (var t in kvp.Value)
                        text.AppendLine("  = " + t);
                text.AppendLine();
            }
            text.AppendLine("/");
            text.AppendLine();
            return text.ToString();
        }

        private static void EnableDisableComposers(ICollection<Type> types)
        {
            var enabled = new Dictionary<Type, EnableInfo>();

            // process the enable/disable attributes
            // these two attributes are *not* inherited and apply to *classes* only (not interfaces).
            // remote declarations (when a composer enables/disables *another* composer)
            // have priority over local declarations (when a composer disables itself) so that
            // ppl can enable composers that, by default, are disabled.
            // what happens in case of conflicting remote declarations is unspecified. more
            // precisely, the last declaration to be processed wins, but the order of the
            // declarations depends on the type finder and is unspecified.
            foreach (var composerType in types)
            {
                foreach (var attr in composerType.GetCustomAttributes<EnableAttribute>())
                {
                    var type = attr.EnabledType ?? composerType;
                    if (enabled.TryGetValue(type, out var enableInfo) == false) enableInfo = enabled[type] = new EnableInfo();
                    var weight = type == composerType ? 1 : 2;
                    if (enableInfo.Weight > weight) continue;

                    enableInfo.Enabled = true;
                    enableInfo.Weight = weight;
                }
                foreach (var attr in composerType.GetCustomAttributes<DisableAttribute>())
                {
                    var type = attr.DisabledType ?? composerType;
                    if (enabled.TryGetValue(type, out var enableInfo) == false) enableInfo = enabled[type] = new EnableInfo();
                    var weight = type == composerType ? 1 : 2;
                    if (enableInfo.Weight > weight) continue;

                    enableInfo.Enabled = false;
                    enableInfo.Weight = weight;
                }
            }

            // remove composers that end up being disabled
            foreach (var kvp in enabled.Where(x => x.Value.Enabled == false))
                types.Remove(kvp.Key);
        }

        private static void GatherRequirementsFromRequireAttribute(Type type, ICollection<Type> types, IDictionary<Type, List<Type>> requirements)
        {
            // get 'require' attributes
            // these attributes are *not* inherited because we want to "custom-inherit" for interfaces only
            var requireAttributes = type
                .GetInterfaces().SelectMany(x => x.GetCustomAttributes<RequireAttribute>()) // those marking interfaces
                .Concat(type.GetCustomAttributes<RequireAttribute>()); // those marking the composer

            // what happens in case of conflicting attributes (different strong/weak for same type) is not specified.
            foreach (var attr in requireAttributes)
            {
                if (attr.RequiredType == type) continue; // ignore self-requirements (+ exclude in implems, below)

                // requiring an interface = require any enabled composer implementing that interface
                // unless strong, and then require at least one enabled composer implementing that interface
                if (attr.RequiredType.IsInterface)
                {
                    var implems = types.Where(x => x != type && attr.RequiredType.IsAssignableFrom(x)).ToList();
                    if (implems.Count > 0)
                    {
                        if (requirements[type] == null) requirements[type] = new List<Type>();
                        requirements[type].AddRange(implems);
                    }
                    else if (attr.Weak == false) // if explicitly set to !weak, is strong, else is weak
                        throw new Exception($"Broken composer dependency: {type.FullName} -> {attr.RequiredType.FullName}.");
                }
                // requiring a class = require that the composer is enabled
                // unless weak, and then requires it if it is enabled
                else
                {
                    if (types.Contains(attr.RequiredType))
                    {
                        if (requirements[type] == null) requirements[type] = new List<Type>();
                        requirements[type].Add(attr.RequiredType);
                    }
                    else if (attr.Weak != true) // if not explicitly set to weak, is strong
                        throw new Exception($"Broken composer dependency: {type.FullName} -> {attr.RequiredType.FullName}.");
                }
            }
        }

        private static void GatherRequirementsFromRequiredByAttribute(Type type, ICollection<Type> types, IDictionary<Type, List<Type>> requirements)
        {
            // get 'required' attributes
            // these attributes are *not* inherited because we want to "custom-inherit" for interfaces only
            var requiredAttributes = type
                .GetInterfaces().SelectMany(x => x.GetCustomAttributes<RequiredByAttribute>()) // those marking interfaces
                .Concat(type.GetCustomAttributes<RequiredByAttribute>()); // those marking the composer

            foreach (var attr in requiredAttributes)
            {
                if (attr.RequiringType == type) continue; // ignore self-requirements (+ exclude in implems, below)

                // required by an interface = by any enabled composer implementing this that interface
                if (attr.RequiringType.IsInterface)
                {
                    var implems = types.Where(x => x != type && attr.RequiringType.IsAssignableFrom(x)).ToList();
                    foreach (var implem in implems)
                    {
                        if (requirements[implem] == null) requirements[implem] = new List<Type>();
                        requirements[implem].Add(type);
                    }
                }
                // required by a class
                else
                {
                    if (types.Contains(attr.RequiringType))
                    {
                        if (requirements[attr.RequiringType] == null) requirements[attr.RequiringType] = new List<Type>();
                        requirements[attr.RequiringType].Add(type);
                    }
                }
            }
        }

        private IEnumerable<IComposer> InstantiateComposers(IEnumerable<Type> types)
        {
            IComposer InstantiateComposer(Type type)
            {
                var ctor = type.GetConstructor(Array.Empty<Type>());
                if (ctor == null)
                    throw new InvalidOperationException($"Composer {type.FullName} does not have a parameter-less constructor.");
                return (IComposer) ctor.Invoke(Array.Empty<object>());
            }

            using (_logger.DebugDuration<Composers>("Instantiating composers.", "Instantiated composers."))
            {
                return types.Select(InstantiateComposer).ToArray();
            }
        }
    }
}


text:
package main

import (
	"errors"
	"flag"
	"fmt"
	"os"
	"os/exec"
	"strings"

	"github.com/blang/semver"
	"github.com/sirupsen/logrus"
)

type options struct {
	project string
	zone    string
	cluster string
	master  string
	pools   string
	ceiling string
}

func (o *options) parse(flags *flag.FlagSet, args []string) error {
	flags.StringVar(&o.project, "project", "", "GCP project of cluster")
	flags.StringVar(&o.zone, "zone", "", "GCP zone of cluster")
	flags.StringVar(&o.cluster, "cluster", "", "GCP cluster name to upgrade")
	flags.StringVar(&o.master, "master", "", "Force target master version instead of latest")
	flags.StringVar(&o.pools, "pools", "", "Force target node pool version instead of latest")
	flags.StringVar(&o.ceiling, "ceiling", "", "Limit to versions < this one when set, so --ceiling=1.15.0 match anything less than 1.15.0")
	if err := flags.Parse(args); err != nil {
		return fmt.Errorf("parse: %w", err)
	}
	if o.cluster == "" {
		return errors.New("empty --cluster")
	}
	return nil
}

func parseOptions() options {
	var o options
	if err := o.parse(flag.CommandLine, os.Args[1:]); err != nil {
		logrus.WithError(err).Fatal("Invalid flags")
	}
	return o
}

func main() {
	opt := parseOptions()
	log := logrus.WithFields(logrus.Fields{
		"project": opt.project,
		"zone":    opt.zone,
		"cluster": opt.cluster,
	})

	var ceil *semver.Version
	if opt.ceiling != "" {
		var err error
		if ceil, err = parse(opt.ceiling); err != nil {
			logrus.WithError(err).Fatal("Bad --ceiling")
		}
	}
	masterGoal, poolGoal, err := versions(opt.project, opt.zone, ceil)
	if err != nil {
		log.WithError(err).Fatal("Cannot find available versions")
	}
	if opt.master != "" {
		if masterGoal, err = parse(opt.master); err != nil {
			log.WithError(err).Fatal("Bad --master")
		}
	}
	if opt.pools != "" {
		if poolGoal, err = parse(opt.pools); err != nil {
			log.WithError(err).Fatal("Bad --pool")
		}
	}

	log = log.WithFields(logrus.Fields{
		"masterGoal": masterGoal,
		"poolGoal":   poolGoal,
	})

	if err := upgradeMaster(opt.project, opt.zone, opt.cluster, *masterGoal); err != nil {
		log.WithError(err).Fatal("Could not upgrade master")
	}

	log.Info("Master at goal")

	pools, err := pools(opt.project, opt.zone, opt.cluster)
	if err != nil {
		log.WithError(err).Fatal("Failed to list node pools")
	}

	baseLog := log
	for _, pool := range pools {
		log := log.WithField("pool", pool)
		if err != nil {
			log.WithError(err).Fatal("Could not determine current pool version")
		}
		if err := upgradePool(opt.project, opt.zone, opt.cluster, pool, *poolGoal); err != nil {
			log.WithError(err).Fatal("Could not upgrade pool")
		}
		log.Info("Pool at goal")
	}

	baseLog.Info("Success")
}

// versions returns the available (master, node) versions for the zone
func versions(project, zone string, ceiling *semver.Version) (*semver.Version, *semver.Version, error) {
	out, err := output(
		"gcloud", "container", "get-server-config",
		"--project="+project, "--zone="+zone,
		"--format=value(validMasterVersions,validNodeVersions)",
	)
	if err != nil {
		return nil, nil, fmt.Errorf("get-server-config: %w", err)
	}
	parts := strings.Split(out, "\t")
	master, err := selectVersion(ceiling, strings.Split(parts[0], ";")...)
	if err != nil {
		return nil, nil, fmt.Errorf("select master version: %w", err)
	}
	pool, err := selectVersion(ceiling, strings.Split(parts[0], ";")...)
	if err != nil {
		return nil, nil, fmt.Errorf("select pool version: %w", err)
	}
	return master, pool, nil
}

// selectVersion chooses the largest first value (less than ceiling if set)
func selectVersion(ceiling *semver.Version, values ...string) (*semver.Version, error) {
	for _, val := range values {
		ver, err := parse(val)
		if err != nil {
			return nil, fmt.Errorf("bad version %s: %w", val, err)
		}
		if ceiling != nil && ver.GTE(*ceiling) {
			continue
		}
		return ver, nil
	}
	return nil, errors.New("no matches found")
}

// upgradeMaster upgrades the master to the specified version, one minor version at a time.
func upgradeMaster(project, zone, cluster string, want semver.Version) error {
	doUpgrade := func(goal string) error {
		return run(
			"gcloud", "container", "clusters", "upgrade",
			"--project="+project, "--zone="+zone, cluster, "--master",
			"--cluster-version="+goal,
		)
	}

	getVersion := func() (*semver.Version, error) {
		return masterVersion(project, zone, cluster)
	}
	return upgrade(want, doUpgrade, getVersion)
}

// masterVersion returns the current master version.
func masterVersion(project, zone, cluster string) (*semver.Version, error) {
	out, err := output(
		"gcloud", "container", "clusters", "describe",
		"--project="+project, "--zone="+zone, cluster,
		"--format=value(currentMasterVersion)",
	)
	if err != nil {
		return nil, fmt.Errorf("clusters describe: %w", err)
	}
	return parse(out)
}

// pools returns the current set of pools in the cluster.
func pools(project, zone, cluster string) ([]string, error) {
	out, err := output(
		"gcloud", "container", "node-pools", "list",
		"--project="+project, "--zone="+zone, "--cluster="+cluster,
		"--format=value(name)",
	)
	if err != nil {
		return nil, fmt.Errorf("node-pools list: %w", err)
	}
	return strings.Split(out, "\n"), nil
}

// upgradePool upgrades the pool to the specified version, one minor version at a time.
func upgradePool(project, zone, cluster, pool string, want semver.Version) error {
	doUpgrade := func(goal string) error {
		return run(
			"gcloud", "container", "clusters", "upgrade",
			"--project="+project, "--zone="+zone, cluster, "--node-pool="+pool,
			"--cluster-version="+goal,
		)
	}

	getVersion := func() (*semver.Version, error) {
		return poolVersion(project, zone, cluster, pool)
	}

	return upgrade(want, doUpgrade, getVersion)
}

// poolVersion returns the current version of the pool.
func poolVersion(project, zone, cluster, pool string) (*semver.Version, error) {
	out, err := output(
		"gcloud", "container", "node-pools", "describe",
		"--project="+project, "--zone="+zone, "--cluster="+cluster, pool,
		"--format=value(version)",
	)
	if err != nil {
		return nil, fmt.Errorf("node-pools describe: %w", err)
	}
	return parse(out)
}

type upgrader func(string) error
type versioner func() (*semver.Version, error)

func upgrade(want semver.Version, doUpgrade upgrader, getVersion versioner) error {
	for {
		have, err := getVersion()
		if err != nil {
			return fmt.Errorf("get version: %w", err)
		}
		if have.Equals(want) {
			return nil
		}
		if have.Major != want.Major {
			return fmt.Errorf("cannot change major version %d to %d", have.Major, want.Major)
		}
		var goal string
		switch {
		case have.Minor == want.Minor:
			goal = want.String()
		case have.Minor > want.Minor:
			goal = fmt.Sprintf("%d.%d", have.Major, have.Minor-1)
		default:
			goal = fmt.Sprintf("%d.%d", have.Major, have.Minor+1)
		}
		if err := doUpgrade(goal); err != nil {
			return fmt.Errorf("upgrade to %s: %w", goal, err)
		}
	}
}

// output returns the output and prints Stderr to screen.
func output(command string, args ...string) (string, error) {
	logrus.WithFields(logrus.Fields{
		"command": command,
		"args":    args,
	}).Debug("Grabbing output")
	cmd := exec.Command(command, args...)
	cmd.Stderr = os.Stderr
	cmd.Stdin = os.Stdin
	buf, err := cmd.Output()
	return string(buf), err
}

// run the command, printing stdout, stderr to screen.
func run(command string, args ...string) error {
	logrus.WithFields(logrus.Fields{
		"command": command,
		"args":    args,
	}).Info("Running command")
	cmd := exec.Command(command, args...)
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	cmd.Stdin = os.Stdin
	return cmd.Run()
}

// parse converts the string into a semver struct
func parse(out string) (*semver.Version, error) {
	ver, err := semver.Parse(strings.TrimSpace(out))
	if err != nil {
		return nil, fmt.Errorf("parse: %w", err)
	}
	return &ver, nil
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

import 'core-js';
import 'whatwg-fetch';
import ReactDOM from 'react-dom';
import {routes, clientSide} from './vrf';
import { browserHistory  } from 'react-router';

ReactDOM.render(clientSide({ history: browserHistory, children: routes }), document.getElementById('entry-point'));


text:
class RemoveMimeTypeFromImages < ActiveRecord::Migration[4.2]
  def change
    remove_column :images, :mime_type, :string
  end
end


text:
using solum.core;
using solum.core.http;
using solum.core.http.handlers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace solum.web
{
    public abstract class WebModule : Component
    {
        public WebModule()
        {
            Routes = new List<WebRouter>();
        }
        public List<WebRouter> Routes { get; private set; }

        #region Http Methods
        public void Get(string route, Func<HttpListenerRequest, WebResponse> response)
        {
            var router = new WebRouter("GET", route, response);
            Routes.Add(router);
        }
        public void Get(string route, Func<HttpListenerRequest, Task<WebResponse>> response)
        {
            var router = new WebRouter("GET", route, response);
            Routes.Add(router);
        }
        public void Get<T>(string route, T response) where T : WebResponse
        {
            var router = new WebRouter("GET", route, response);
            Routes.Add(router);
        }
        #endregion

        public abstract void RegisterRoutes();
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Sphaeria tephrocoma Berk. & Broome

### Remarks
null


text:
package com.rafkind.paintown.animator.events;

import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import com.rafkind.paintown.animator.Animation;
import com.rafkind.paintown.animator.DrawArea;
import com.rafkind.paintown.Token;
import com.rafkind.paintown.animator.events.AnimationEvent;
import org.swixml.SwingEngine;

import com.rafkind.paintown.animator.events.scala.AnimationEventNotifier;

public class FaceEvent extends AnimationEventNotifier implements AnimationEvent {
	private String _face = "reverse";

	public void loadToken(Token token){
		_face = token.readString(0);
	}

	public void interact(Animation area){
	}

    public AnimationEvent copy(){
        FaceEvent event = new FaceEvent();
        event._face = _face;
        return event;
    }

	public String getName(){
		return getToken().toString();
	}

	public JPanel getEditor(final Animation animation, final DrawArea area){
		SwingEngine engine = new SwingEngine( "animator/eventface.xml" );
		((JPanel)engine.getRootComponent()).setSize(200,50);

		final JComboBox facebox = (JComboBox) engine.find( "face" );
		facebox.addItem("reverse");

		facebox.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent actionEvent){
				_face = (String)facebox.getSelectedItem();
                updateListeners();
			}
		});
		return (JPanel)engine.getRootComponent();
	}

	public Token getToken(){
		Token temp = new Token("face");
		temp.addToken(new Token("face"));
		temp.addToken(new Token(_face));

		return temp;
	}

    public void destroy(){
    }

    public String getDescription(){
        return "Sets the direction the character is facing (either left or right)";
    }
}


text:
import { is, asEffect } from 'redux-saga/utils'

import * as SagaConstants from './saga-constants'

export default effect => {
  if (!effect) return SagaConstants.UNKNOWN
  if (effect instanceof Promise) return SagaConstants.PROMISE
  if (asEffect.take(effect)) return SagaConstants.TAKE
  if (asEffect.put(effect)) return SagaConstants.PUT
  if (asEffect.call(effect)) return SagaConstants.CALL
  if (asEffect.cps(effect)) return SagaConstants.CPS
  if (asEffect.fork(effect)) return SagaConstants.FORK
  if (asEffect.join(effect)) return SagaConstants.JOIN
  if (asEffect.race(effect)) return SagaConstants.RACE
  if (asEffect.cancel(effect)) return SagaConstants.CANCEL
  if (asEffect.select(effect)) return SagaConstants.SELECT
  if (is.array(effect)) return SagaConstants.PARALLEL
  if (is.iterator(effect)) return SagaConstants.ITERATOR
  return SagaConstants.UNKNOWN
}


text:
package com.anupam.annotations;

import com.google.inject.AbstractModule;
import com.google.inject.matcher.Matchers;

public class RetryModule extends AbstractModule {
  @Override
  protected void configure() {
    bindInterceptor(Matchers.any(), Matchers.annotatedWith(Retry.class),
        new RetryMethodInterceptor());
  }
}


text:
odsTagCloud

directive in module ods-widgets

Description

The odsTagCloud widget displays a "tag cloud" of the values available in a facet.
This facet can be the facet of a dataset or a facet from the dataset catalog.
The "weight" (size) of a tag depends on the number of occurrences (count) for this tag.

Usage

as element:
<ods-tag-cloud
       context="{CatalogContext|DatasetContext}"
       facet-name="{string}"
       max="{number}"
       redirect-to="{string}"
       context-to-refine="{CatalogContext|DatasetContext}">
</ods-tag-cloud>

Directive info

This directive creates new scope.

Parameters

Param	Type	Details

context	CatalogContextDatasetContext

Catalog Context or
Dataset Context to use

facetName	string

Name of the facet to build the tag cloud from

max	number

Maximum number of tags to show in the cloud

(default: all)

redirectTo	string

URL.
If specified, a click on any tag will redirect to the given URL and apply the filter there.

(default: none)

contextToRefine	CatalogContextDatasetContext

Specifies the context that will be
refined. If not specified at all, the refined context will be the one defined through the context parameter.

(default: current context)

Example

Source

Demo


text:
"""Tests for the diagnostic test player page."""

from __future__ import annotations

from core import feconf
from core.domain import question_services
from core.domain import topic_domain
from core.domain import topic_fetchers
from core.domain import user_services
from core.tests import test_utils

class DiagnosticTestLandingPageTest(test_utils.GenericTestBase):
    """Test class for the diagnostic test player page."""

    def test_diagnostic_test_page_access(self) -> None:
        self.get_html_response(
            feconf.DIAGNOSTIC_TEST_PLAYER_PAGE_URL,
            expected_status_int=200
        )

class DiagnosticTestQuestionsHandlerTest(test_utils.GenericTestBase):
    """Test class for the diagnostic test questions handler."""

    def setUp(self) -> None:
        super().setUp()
        self.signup(self.EDITOR_EMAIL, self.EDITOR_USERNAME)
        self.signup(self.CURRICULUM_ADMIN_EMAIL, self.CURRICULUM_ADMIN_USERNAME)

        self.admin_id = self.get_user_id_from_email(self.CURRICULUM_ADMIN_EMAIL)
        self.editor_id = self.get_user_id_from_email(self.EDITOR_EMAIL)

        self.set_curriculum_admins([self.CURRICULUM_ADMIN_USERNAME])
        self.admin = user_services.get_user_actions_info(self.admin_id)
        self.editor = user_services.get_user_actions_info(self.editor_id)

        self.topic_id = topic_fetchers.get_new_topic_id()
        subtopic_1 = topic_domain.Subtopic.create_default_subtopic(
            1, 'Subtopic Title 1', 'url-frag-one')
        subtopic_1.skill_ids = ['skill_id_1', 'skill_id_2', 'skill_id_3']
        subtopic_1.url_fragment = 'sub-one-frag'
        self.save_new_topic(
            self.topic_id, self.admin_id, name='Name',
            description='Description', canonical_story_ids=[],
            additional_story_ids=[], uncategorized_skill_ids=[],
            subtopics=[subtopic_1], next_subtopic_id=2)

        self.save_new_skill(
            'skill_id_1', self.admin_id, description='Skill Description 1')
        self.save_new_skill(
            'skill_id_2', self.admin_id, description='Skill Description 2')
        self.save_new_skill(
            'skill_id_3', self.admin_id, description='Skill Description 3')

        self.question_id_1 = question_services.get_new_question_id()
        self.question_1 = self.save_new_question(
            self.question_id_1, self.editor_id,
            self._create_valid_question_data('ABC'), ['skill_id_1'])
        self.question_dict_1 = self.question_1.to_dict()

        self.question_id_2 = question_services.get_new_question_id()
        self.question_2 = self.save_new_question(
            self.question_id_2, self.editor_id,
            self._create_valid_question_data('ABC'), ['skill_id_1'])
        self.question_dict_2 = self.question_2.to_dict()

        self.question_id_3 = question_services.get_new_question_id()
        self.question_3 = self.save_new_question(
            self.question_id_3, self.editor_id,
            self._create_valid_question_data('ABC'), ['skill_id_2'])
        self.question_dict_3 = self.question_3.to_dict()

        self.question_id_4 = question_services.get_new_question_id()
        self.question_4 = self.save_new_question(
            self.question_id_4, self.editor_id,
            self._create_valid_question_data('ABC'), ['skill_id_2'])
        self.question_dict_4 = self.question_4.to_dict()

        self.question_id_5 = question_services.get_new_question_id()
        self.question_5 = self.save_new_question(
            self.question_id_5, self.editor_id,
            self._create_valid_question_data('ABC'), ['skill_id_2'])
        self.question_dict_5 = self.question_5.to_dict()

        self.question_id_6 = question_services.get_new_question_id()
        self.question_6 = self.save_new_question(
            self.question_id_6, self.editor_id,
            self._create_valid_question_data('ABC'), ['skill_id_3'])
        self.question_dict_6 = self.question_6.to_dict()

        self.question_id_7 = question_services.get_new_question_id()
        self.question_7 = self.save_new_question(
            self.question_id_7, self.editor_id,
            self._create_valid_question_data('ABC'), ['skill_id_1'])
        self.question_dict_7 = self.question_7.to_dict()

    def test_get_skill_id_to_question_dict_for_valid_topic_id(self) -> None:
        question_services.create_new_question_skill_link(
            self.editor_id, self.question_id_1, 'skill_id_1', 0.5)
        question_services.create_new_question_skill_link(
            self.editor_id, self.question_id_2, 'skill_id_1', 0.5)
        question_services.create_new_question_skill_link(
            self.editor_id, self.question_id_7, 'skill_id_1', 0.5)
        question_services.create_new_question_skill_link(
            self.editor_id, self.question_id_3, 'skill_id_2', 0.5)
        question_services.create_new_question_skill_link(
            self.editor_id, self.question_id_4, 'skill_id_2', 0.5)
        question_services.create_new_question_skill_link(
            self.editor_id, self.question_id_5, 'skill_id_2', 0.5)

        # Skill 3 is only linked to a single question i.e., not satisfying the
        # condition for the main and backup question. So the response dict will
        # not contain skill 3.
        question_services.create_new_question_skill_link(
            self.editor_id, self.question_id_6, 'skill_id_3', 0.5)

        url = '%s/%s?excluded_question_ids=%s' % (
            feconf.DIAGNOSTIC_TEST_QUESTIONS_HANDLER_URL, self.topic_id,
            self.question_id_5
        )

        json_response = self.get_json(url)
        received_skill_id_to_questions_dict = json_response[
            'skill_id_to_questions_dict']

        expected_skill_id_to_question_ids = {
            'skill_id_1': [
                self.question_id_1, self.question_id_2, self.question_id_7],
            'skill_id_2': [self.question_id_3, self.question_id_5]
        }

        # The equality of received dict and expected dict is not directly
        # checked here because the main question and the backup question are
        # of the same priority so the order in which they are fetched from
        # the datastore is not fixed. Hence the items in the nested skill ID
        # dict are validated individually.
        self.assertItemsEqual(
            list(received_skill_id_to_questions_dict.keys()),
            list(expected_skill_id_to_question_ids.keys())
        )

        for skill_id, questions in received_skill_id_to_questions_dict.items():
            self.assertTrue(
                questions['main_question']['id'],
                expected_skill_id_to_question_ids[skill_id]
            )
            self.assertTrue(
                questions['backup_question']['id'],
                expected_skill_id_to_question_ids[skill_id]
            )

    def test_raise_error_for_non_existent_topic_id(self) -> None:
        non_existent_topic_id = topic_fetchers.get_new_topic_id()

        url = '%s/%s?excluded_question_ids=%s' % (
            feconf.DIAGNOSTIC_TEST_QUESTIONS_HANDLER_URL,
            non_existent_topic_id, '')

        self.get_json(url, expected_status_int=404)


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

<script xmlns="http://dtf.org/v1" name="stats_recorder">
    <info>
        <author>
            <name>Rodney Gomes</name>
            <email>rlgomes@yahoo-inc.com</email>
        </author>
        <description>DTF stats recorder unit test.</description>
    </info>

    <local>
        <createstorage id="INPUT" path="${dtf.xml.path}/input"/>
        <createstorage id="OUTPUT" path="${dtf.xml.path}/output"/>

        <loadproperties uri="storage://INPUT/ut.properties"/>
    </local>

    <record type="stats">
        <for property="index" range="1..${iterations.tiny}">
		    <event name="event">
		        <attribute name="constant" value="1"/>
		        <attribute name="int1" value="1234567890"/>
		    </event>
        </for>
    </record>

    <assert><isset property="event.avg_occ"/></assert>
    <assert><isset property="event.avg_dur"/></assert>
    <assert><isset property="event.max_dur"/></assert>
    <assert><isset property="event.min_dur"/></assert>
</script>


text:
package org.uberfire.security.authz;

public interface RuntimeFeatureResource extends RuntimeResource {

}


text:
% Fonts

## Application Fonts

We recommend that developers use files in the WOFF or TTF format when building
apps.

Any font may be used, but the developer is responsible for abiding by any
license and distribution requirements.

If your app uses non-system fonts, they should be downloaded with the app.
While it is technically possible to load fonts from remote sources, this is
discouraged, as it results in slow loading times.

### Fonts in Enyo Apps

In Enyo apps, we recommend that developers use the **Museo Sans** and **MISO**
fonts for languages with Latin scripts.

![](../../assets/dg-fonts-museo-sans-miso.png)

For languages with non-Latin scripts, use the **LG Display** font.

## System Fonts

The webOS for TV operating system uses the **Museo Sans** font family.

### Examples

#### App Tile on Home Screen

![](../../assets/dg-fonts-home-screen.png)

#### App Tile on Apps Screen

![](../../assets/dg-fonts-apps-screen.png)

#### App Tile on Recent Screen

![](../../assets/dg-fonts-recent-screen.png)

#### System Input

![](../../assets/dg-fonts-system-input.png)

#### System Clock

![](../../assets/dg-fonts-system-clock.png)


text:
class CertReportHelper;
class GURL;

namespace security_interstitials {
class BadClockUI;
}

// This class is responsible for showing/hiding the interstitial page that
// occurs when an SSL error is triggered by a clock misconfiguration. It
// creates the UI using security_interstitials::BadClockUI and then
// displays it. It deletes itself when the interstitial page is closed.
class BadClockBlockingPage : public SecurityInterstitialPage {
 public:
  // Interstitial type, used in tests.
  static InterstitialPageDelegate::TypeID kTypeForTesting;

  // If the blocking page isn't shown, the caller is responsible for cleaning
  // up the blocking page. Otherwise, the interstitial takes ownership when
  // shown.
  BadClockBlockingPage(content::WebContents* web_contents,
                       int cert_error,
                       const net::SSLInfo& ssl_info,
                       const GURL& request_url,
                       const base::Time& time_triggered,
                       ssl_errors::ClockState clock_state,
                       scoped_ptr<SSLCertReporter> ssl_cert_reporter,
                       const base::Callback<void(bool)>& callback);

  ~BadClockBlockingPage() override;

  // InterstitialPageDelegate method:
  InterstitialPageDelegate::TypeID GetTypeForTesting() const override;

  void SetSSLCertReporterForTesting(
      scoped_ptr<SSLCertReporter> ssl_cert_reporter);

 protected:
  // InterstitialPageDelegate implementation:
  void CommandReceived(const std::string& command) override;
  void OverrideEntry(content::NavigationEntry* entry) override;
  void OverrideRendererPrefs(content::RendererPreferences* prefs) override;
  void OnDontProceed() override;

  // SecurityInterstitialPage implementation:
  bool ShouldCreateNewNavigation() const override;
  void PopulateInterstitialStrings(
      base::DictionaryValue* load_time_data) override;
  void AfterShow() override;

 private:
  void NotifyDenyCertificate();

  base::Callback<void(bool)> callback_;
  const net::SSLInfo ssl_info_;
  const base::Time time_triggered_;
  scoped_ptr<ChromeControllerClient> controller_;

  scoped_ptr<security_interstitials::BadClockUI> bad_clock_ui_;
  scoped_ptr<CertReportHelper> cert_report_helper_;

  DISALLOW_COPY_AND_ASSIGN(BadClockBlockingPage);
};

#endif  // CHROME_BROWSER_SSL_BAD_CLOCK_BLOCKING_PAGE_H_


text:
package io.pdef.json;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import io.pdef.Message;
import io.pdef.descriptors.*;

import javax.annotation.Nonnull;
import java.io.*;
import java.util.*;

class JsonJacksonFormat {
	private static final JsonJacksonFormat INSTANCE = new JsonJacksonFormat();
	private final JsonFactory factory;
	private final JsonObjectFormat objectFormat;

	public static JsonJacksonFormat getInstance() {
		return INSTANCE;
	}

	private JsonJacksonFormat() {
		factory = new JsonFactory().enable(JsonParser.Feature.ALLOW_COMMENTS);
		objectFormat = JsonObjectFormat.getInstance();
	}

	// Serialization.

	/** Serializes an object into a string. */
	public <T> String write(final T object, final DataTypeDescriptor<T> descriptor,
			final boolean indent) throws IOException {
		if (descriptor == null) throw new NullPointerException("descriptor");

		StringWriter out = new StringWriter();
		JsonGenerator generator = factory.createGenerator(out);
		if (indent) {
			generator.useDefaultPrettyPrinter();
		}

		write(object, descriptor, generator);
		generator.flush();
		return out.toString();
	}

	/** Writes an object to an output stream as a JSON string, does not close the stream. */
	public <T> void write(final OutputStream stream, final T object,
			final DataTypeDescriptor<T> descriptor, final boolean indent) throws IOException {
		if (stream == null) throw new NullPointerException("out");
		if (descriptor == null) throw new NullPointerException("descriptor");

		JsonGenerator generator = factory.createGenerator(stream);
		if (indent) {
			generator.useDefaultPrettyPrinter();
		}

		write(object, descriptor, generator);
		generator.flush();
	}

	/** Writes an object to a writer as a JSON string, does not close the writer. */
	public <T> void write(final PrintWriter writer, final T object,
			final DataTypeDescriptor<T> descriptor, final boolean indent) throws IOException {
		if (writer == null) throw new NullPointerException("writer");
		if (descriptor == null) throw new NullPointerException("descriptor");

		JsonGenerator generator = factory.createGenerator(writer);
		if (indent) {
			generator.useDefaultPrettyPrinter();
		}

		write(object, descriptor, generator);
		generator.flush();
	}

	private <T> void write(final T object, final DataTypeDescriptor<T> descriptor,
			final JsonGenerator generator) throws IOException {
		if (object == null) {
			generator.writeNull();
			return;
		}

		switch (descriptor.getType()) {
			case BOOL: generator.writeBoolean((Boolean) object); break;
			case INT16: generator.writeNumber((Short) object); break;
			case INT32: generator.writeNumber((Integer) object); break;
			case INT64: generator.writeNumber((Long) object); break;
			case FLOAT: generator.writeNumber((Float) object); break;
			case DOUBLE: generator.writeNumber((Double) object); break;
			case STRING: generator.writeString((String) object); break;
			case DATETIME: writeDatetime((Date) object, generator); break;
			case LIST: writeList((List) object, (ListDescriptor) descriptor, generator); break;
			case SET: writeSet((Set) object, (SetDescriptor) descriptor, generator); break;
			case MAP: writeMap((Map) object, (MapDescriptor) descriptor, generator); break;
			case VOID: generator.writeNull(); break;
			case ENUM: writeEnum((Enum) object, generator); break;
			case MESSAGE: writeMessage((Message) object, generator); break;
			default: throw new JsonFormatException("Unsupported descriptor " + descriptor);
		}
	}

	private void writeDatetime(final Date date, final JsonGenerator generator) throws IOException {
		String s = objectFormat.writeDate(date);
		generator.writeString(s);
	}

	private <T> void writeList(@Nonnull final List<T> object, final ListDescriptor<T> descriptor,
			final JsonGenerator generator) throws IOException {
		DataTypeDescriptor<T> elementd = descriptor.getElement();

		generator.writeStartArray();
		for (T element : object) {
			write(element, elementd, generator);
		}
		generator.writeEndArray();
	}

	private <T> void writeSet(@Nonnull final Set<T> object, final SetDescriptor<T> descriptor,
			final JsonGenerator generator) throws IOException {
		DataTypeDescriptor<T> elementd = descriptor.getElement();

		generator.writeStartArray();
		for (T element : object) {
			write(element, elementd, generator);
		}
		generator.writeEndArray();
	}

	private <K, V> void writeMap(@Nonnull final Map<K, V> object,
			final MapDescriptor<K, V> descriptor, final JsonGenerator generator)
			throws IOException {
		DataTypeDescriptor<K> keyd = descriptor.getKey();
		DataTypeDescriptor<V> valued = descriptor.getValue();

		generator.writeStartObject();
		for (Map.Entry<K, V> entry : object.entrySet()) {
			K key = entry.getKey();
			V value = entry.getValue();
			if (key == null) {
				throw new JsonFormatException("Null map key");
			}

			String k = objectFormat.writeMapKey(key, keyd);
			generator.writeFieldName(k);
			write(value, valued, generator);
		}
		generator.writeEndObject();
	}

	private <T extends Enum<T>> void writeEnum(@Nonnull final T object,
			final JsonGenerator generator) throws IOException {
		String value = objectFormat.writeEnum(object);
		generator.writeString(value);
	}

	private <T extends Message> void writeMessage(@Nonnull final T object,
			final JsonGenerator generator) throws IOException {
		// Mind polymorphic messages.
		@SuppressWarnings("unchecked")
		MessageDescriptor<T> polymorphic = (MessageDescriptor<T>) object.descriptor();

		generator.writeStartObject();
		for (FieldDescriptor<? super T, ?> field : polymorphic.getFields()) {
			writeMessageField(field, object, generator);
		}
		generator.writeEndObject();
	}

	private <T extends Message, V> void writeMessageField(
			final FieldDescriptor<? super T, V> field, final T message,
			final JsonGenerator generator) throws IOException {
		V value = field.get(message);
		if (value == null) {
			// Skip null fields.
			return;
		}

		DataTypeDescriptor<V> type = field.getType();
		generator.writeFieldName(field.getName());
		write(value, type, generator);
	}

	// Parsing.

	/** Parses an object from a string. */
	public <T> T read(final String s, final DataTypeDescriptor<T> descriptor)
			throws Exception {
		if (descriptor == null) throw new NullPointerException("descriptor");
		if (s == null) return null;

		JsonParser parser = factory.createParser(s);
		return read(parser, descriptor);
	}

	/** Parses an object from an input stream, does not close the input stream. */
	public <T> T read(final InputStream stream, final DataTypeDescriptor<T> descriptor)
			throws Exception {
		if (stream == null) throw new NullPointerException("input");
		if (descriptor == null) throw new NullPointerException("descriptor");

		JsonParser parser = factory.createParser(stream);
		return read(parser, descriptor);
	}

	/** Parses an object from a reader, does not close the reader. */
	public <T> T read(final Reader reader, final DataTypeDescriptor<T> descriptor)
			throws Exception {
		if (reader == null) throw new NullPointerException("reader");
		if (descriptor == null) throw new NullPointerException("descriptor");

		JsonParser parser = factory.createParser(reader);
		return read(parser, descriptor);
	}

	private <T> T read(final JsonParser parser, final DataTypeDescriptor<T> descriptor)
			throws Exception {
		Object jsonObject;

		try {
			parser.nextToken();
			jsonObject = read(parser);
		} finally {
			parser.close();
		}

		return objectFormat.read(jsonObject, descriptor);
	}

	private Object read(final JsonParser parser) throws IOException {
		JsonToken current = parser.getCurrentToken();
		if (current == null || current == JsonToken.VALUE_NULL) {
			return null;
		}

		switch (current) {
			case VALUE_NULL: return null;
			case VALUE_TRUE: return true;
			case VALUE_FALSE: return false;
			case VALUE_STRING: return parser.getValueAsString();
			case VALUE_NUMBER_INT:
			case VALUE_NUMBER_FLOAT: return parser.getNumberValue();
			case START_ARRAY: return readArray(parser);
			case START_OBJECT: return readMap(parser);
			default: throw new JsonFormatException("Bad JSON string");
		}
	}

	private List<?> readArray(final JsonParser parser) throws IOException {
		JsonToken current = parser.getCurrentToken();
		if (current != JsonToken.START_ARRAY) {
			throw new JsonFormatException("Bad JSON string, failed to read an array");
		}

		List<Object> list = new ArrayList<Object>();
		while (true) {
			JsonToken next = parser.nextToken();
			if (next == null) {
				throw new JsonFormatException("End of file");
			} else if (next == JsonToken.END_ARRAY) {
				break;
			}

			Object element = read(parser);
			list.add(element);
		}

		return list;
	}

	private Map<String, Object> readMap(final JsonParser parser) throws IOException {
		JsonToken current = parser.getCurrentToken();
		if (current != JsonToken.START_OBJECT) {
			throw new JsonFormatException("Bad JSON string, failed to read an object");
		}

		Map<String, Object> map = new LinkedHashMap<String, Object>();
		while (true) {
			JsonToken next = parser.nextToken();
			if (next == null) {
				throw new JsonFormatException("End of file");
			} else if (next == JsonToken.END_OBJECT) {
				break;
			} else if (next != JsonToken.FIELD_NAME) {
				throw new JsonFormatException("Failed to read a field name from " + next);
			}

			String field = parser.getCurrentName();
			parser.nextToken();
			Object value = read(parser);
			map.put(field, value);
		}

		return map;
	}
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Jb. nassau. Ver. Naturk. 23-24: 365 (1870)

#### Original name
Stysanus clematidis Fuckel, 1870

### Remarks
null


text:
import React, { Component } from 'react';
import Book from "./book";
import {connect} from "react-redux";

class BookList extends Component {

    render() {

        let bookList;

        if (undefined !== this.props.bookList) {
            bookList = this.props.bookList.map((book, index) => {
                return <Book key={book.id} bookIndex={index} book={book} />
            });
        }

        return (
            <div>
                {bookList}
            </div>
        );
    }
}

function mapStateToProps(state) {
    return {
        bookList: state.books.bookList
    }
}

export default connect(mapStateToProps)(BookList);


text:
local mod	= DBM:NewMod(742, "DBM-TerraceofEndlessSpring", nil, 320)
local L		= mod:GetLocalizedStrings()
local sndWOP	= mod:SoundMM("SoundWOP")
local sndJK		= mod:SoundMM("SoundWOP")
local sndGH		= mod:NewSound(nil, mod:IsHealer(), "SoundGH")
local sndMY		= mod:NewSound(nil, false, "SoundMY")

mod:SetRevision(("$Revision: 9656 $"):sub(12, -3))
mod:SetCreatureID(62442)--62919 Unstable Sha, 62969 Embodied Terror
mod:SetReCombatTime(60)--fix lfr combat re-starts after killed.

mod:RegisterCombat("combat")
mod:RegisterKill("yell", L.Victory)

mod:RegisterEventsInCombat(
	"SPELL_AURA_APPLIED",
	"SPELL_AURA_APPLIED_DOSE",
	"SPELL_CAST_START",
	"SPELL_CAST_SUCCESS",
	"RAID_BOSS_EMOTE",
	"UNIT_SPELLCAST_SUCCEEDED",
	"UNIT_DIED"
)

local warnNight							= mod:NewSpellAnnounce("ej6310", 2, 108558)
local warnSunbeam						= mod:NewSpellAnnounce(122789, 3)
local warnShadowBreath					= mod:NewSpellAnnounce(122752, 3)
local warnNightmares					= mod:NewTargetAnnounce(122770, 4)--Target scanning will only work on 1 target on 25 man (only is 1 target on 10 man so they luck out)
local warnDarkOfNight					= mod:NewCountAnnounce("ej6550", 4, 130013)--Heroic
local warnDay							= mod:NewSpellAnnounce("ej6315", 2, 122789)
local warnSummonUnstableSha				= mod:NewSpellAnnounce("ej6320", 3, "Interface\\Icons\\achievement_raid_terraceofendlessspring04")
local warnSummonEmbodiedTerror			= mod:NewSpellAnnounce("ej6316", 4, "Interface\\Icons\\achievement_raid_terraceofendlessspring04")
local warnTerrorize						= mod:NewTargetAnnounce(123012, 4, nil, mod:IsHealer())
local warnSunBreath						= mod:NewSpellAnnounce(122855, 3)
local warnLightOfDay					= mod:NewCountAnnounce("ej6551", 4, 123716, mod:IsHealer())--Heroic

local specWarnShadowBreath				= mod:NewSpecialWarningSpell(122752, mod:IsTank() or mod:IsHealer())
local specWarnSunBreath					= mod:NewSpecialWarningSpell(122855, mod:IsHealer())
local specWarnDreadShadows				= mod:NewSpecialWarningStack(122768, nil, 9)--For heroic, 10 is unhealable, and it stacks pretty fast so adaquate warning to get over there would be abou 5-6
local specWarnNightmares				= mod:NewSpecialWarningYou(122770)
local specWarnNightmaresNear			= mod:NewSpecialWarningClose(122770)
local specWarnSunbeam					= mod:NewSpecialWarningSpell(122789)
local yellNightmares					= mod:NewYell(122770)
local specWarnDarkOfNight				= mod:NewSpecialWarningSwitch("ej6550", mod:IsDps())
local specWarnTerrorize					= mod:NewSpecialWarningDispel(123012, mod:IsHealer())
local specWarnLightOfDay				= mod:NewSpecialWarningSpell("ej6551", mod:IsHealer())
local specWarnJSA						= mod:NewSpecialWarning("SpecWarnJSA")

local timerNightCD						= mod:NewNextTimer(121, "ej6310", nil, nil, nil, 130013)
local timerSunbeamCD					= mod:NewCDTimer(41, 122789)
local timerShadowBreathCD				= mod:NewCDTimer(28, 122752, nil, mod:IsTank() or mod:IsHealer())
local timerNightmaresCD					= mod:NewCDTimer(15.5, 122770)
local timerDarkOfNightCD				= mod:NewCDTimer(30.5, "ej6550", nil, nil, nil, 130013)
local timerDayCD						= mod:NewNextTimer(121, "ej6315", nil, nil, nil, 122789)
local timerSummonUnstableShaCD			= mod:NewCDTimer(18, "ej6320", nil, nil,nil, "Interface\\Icons\\achievement_raid_terraceofendlessspring04")
local timerSummonEmbodiedTerrorCD		= mod:NewCDTimer(41, "ej6316", nil, nil, nil, "Interface\\Icons\\achievement_raid_terraceofendlessspring04")
local timerTerrorizeCD					= mod:NewNextTimer(14, 123012)--Besides being cast 14 seconds after they spawn, i don't know if they recast it if they live too long, their health was too undertuned to find out.
local timerSunBreathCD					= mod:NewCDTimer(29, 122855)
local timerBathedinLight				= mod:NewBuffFadesTimer(6, 122858, nil, mod:IsHealer())
local timerLightOfDayCD					= mod:NewCDTimer(10, "ej6551", nil, mod:IsHealer(), nil, 123716)--Don't have timing for this yet, heroic logs i was sent always wiped VERY early in light phase.

local berserkTimer						= mod:NewBerserkTimer(490)--a little over 8 min, basically 3rd dark phase is auto berserk.

local terrorName = EJ_GetSectionInfo(6316)
local targetScansDone = 0

mod:AddBoolOption("HudMAP", true, "sound")
mod:AddBoolOption("WarnJK", mod:IsHealer(), "sound")

local DBMHudMap = DBMHudMap
local free = DBMHudMap.free
local function register(e)
	DBMHudMap:RegisterEncounterMarker(e)
	return e
end
local NightmaresMarkers = {}

local sndJKNext = {}

local DSn = 0
local terrorN = 0
local daytime = 0
local lodcount = 0
local mobcount = 0
local hxcount = 0

for i = 1, 6 do
	mod:AddBoolOption("unseenjs"..i, false, "sound")
end

for i = 1, 11 do
	mod:AddBoolOption("lod"..i, false, "sound")
end

mod:AddDropdownOption("optDS", {"six", "nine", "twelve", "fifteen", "none"}, "six", "sound")

mod:AddDropdownOption("optTS", {"TS1", "TS2", "TS3", "noms"}, "noms", "sound")

local function MyJS()
	if (mod.Options.unseenjs1 and mobcount == 1) or (mod.Options.unseenjs2 and mobcount == 2) or (mod.Options.unseenjs3 and mobcount == 3) or (mod.Options.unseenjs4 and mobcount == 4) or (mod.Options.unseenjs5 and mobcount == 5) or (mod.Options.unseenjs6 and mobcount == 6) then
		return true
	end
	return false
end

local function MyTS()
	if (mod.Options.optTS == "TS1" and hxcount == 1) or (mod.Options.optTS == "TS2" and hxcount == 2) or (mod.Options.optTS == "TS3" and hxcount == 3) then
		return true
	end
	return false
end

local function isTank(unit)
	-- 1. check blizzard tanks first
	-- 2. check blizzard roles second
	-- 3. check boss1's highest threat target
	if GetPartyAssignment("MAINTANK", unit, 1) then
		return true
	end
	if UnitGroupRolesAssigned(unit) == "TANK" then
		return true
	end
	if UnitExists("boss1target") and UnitDetailedThreatSituation(unit, "boss1") then
		return true
	end
	return false
end

function mod:LightOfDayRepeat()
	lodcount = lodcount + 1
	warnLightOfDay:Show(lodcount)
	specWarnLightOfDay:Show()
	sndGH:Play("ex_mop_ghcx")--光華出現
	if lodcount == 1 then
		sndGH:Schedule(1, "countone")
		if self.Options.lod1 then
			sndWOP:Schedule(1.5, "uu") --~
		end
	elseif lodcount == 2 then
		sndGH:Schedule(1, "counttwo")
		if self.Options.lod2 then
			sndWOP:Schedule(1.5, "uu")
		end
	elseif lodcount == 3 then
		sndGH:Schedule(1, "countthree")
		if self.Options.lod3 then
			sndWOP:Schedule(1.5, "uu")
		end
	elseif lodcount == 4 then
		sndGH:Schedule(1, "countfour")
		if self.Options.lod4 then
			sndWOP:Schedule(1.5, "uu")
		end
	elseif lodcount == 5 then
		sndGH:Schedule(1, "countfive")
		if self.Options.lod5 then
			sndWOP:Schedule(1.5, "uu")
		end
	elseif lodcount == 6 then
		sndGH:Schedule(1, "countsix")
		if self.Options.lod6 then
			sndWOP:Schedule(1.5, "uu")
		end
	elseif lodcount == 7 then
		sndGH:Schedule(1, "countseven")
		if self.Options.lod7 then
			sndWOP:Schedule(1.5, "uu")
		end
	elseif lodcount == 8 then
		sndGH:Schedule(1, "counteight")
		if self.Options.lod8 then
			sndWOP:Schedule(1.5, "uu")
		end
	elseif lodcount == 9 then
		sndGH:Schedule(1, "countnine")
		if self.Options.lod9 then
			sndWOP:Schedule(1.5, "uu")
		end
	elseif lodcount == 10 then
		sndGH:Schedule(1, "countten")
		if self.Options.lod10 then
			sndWOP:Schedule(1.5, "uu")
		end
	elseif lodcount == 11 then
		sndGH:Schedule(1, "counteleven")
		if self.Options.lod11 then
			sndWOP:Schedule(2, "uu")
		end
	end
	if self:IsDifficulty("heroic10") then
		timerLightOfDayCD:Start(25)
		self:ScheduleMethod(25, "LightOfDayRepeat")
	else
		timerLightOfDayCD:Start(10)
		self:ScheduleMethod(10, "LightOfDayRepeat")
	end
end

function mod:ShadowsTarget(targetname)
	warnNightmares:Show(targetname)
	if self.Options.HudMAP and self:IsDifficulty("normal10", "heroic10") then
		NightmaresMarkers[targetname] = register(DBMHudMap:PlaceStaticMarkerOnPartyMember("highlight", targetname, 9, 4, 0, 1, 0, 0.5):Appear():RegisterForAlerts())
	end
	if targetname == UnitName("player") then
		specWarnNightmares:Show()
		sndWOP:Play("runaway")--快躲開
		yellNightmares:Yell()
	else
		local uId = DBM:GetRaidUnitId(targetname)
		if uId then
			local inRange = DBM.RangeCheck:GetDistance("player", uId)
			if inRange and inRange < 10 then
				specWarnNightmaresNear:Show(targetname)
				sndWOP:Play("runaway")--快躲開
			end
		end
	end
end

function mod:TargetScanner(ScansDone)
	targetScansDone = targetScansDone + 1
	local targetname, uId = self:GetBossTarget(62442)
	if UnitExists(targetname) then--Better way to check if target exists and prevent nil errors at same time, without stopping scans from starting still. so even if target is nil, we stil do more checks instead of just blowing off a warning.
		if isTank(uId) and not ScansDone then--He's targeting his highest threat target.
			if targetScansDone < 16 then--Make sure no infinite loop.
				self:ScheduleMethod(0.05, "TargetScanner")--Check multiple times to be sure it's not on something other then tank.
			else
				self:TargetScanner(true)--It's still on tank, force true isTank and activate else rule and warn target is on tank.
			end
		else--He's not targeting highest threat target (or isTank was set to true after 16 scans) so this has to be right target.
			self:UnscheduleMethod("TargetScanner")--Unschedule all checks just to be sure none are running, we are done.
			self:ShadowsTarget(targetname)
		end
	else--target was nil, lets schedule a rescan here too.
		if targetScansDone < 16 then--Make sure not to infinite loop here as well.
			self:ScheduleMethod(0.05, "TargetScanner")
		end
	end
end

function mod:OnCombatStart(delay)
	timerShadowBreathCD:Start(8.5-delay)
	timerNightmaresCD:Start(13.5-delay)
	sndMY:Cancel("countseven")
	sndMY:Cancel("countsix")
	sndMY:Cancel("countfive")
	sndMY:Cancel("countfour")
	sndMY:Cancel("countthree")
	sndMY:Cancel("counttwo")
	sndMY:Cancel("countone")
	sndMY:Schedule(7, "countseven")
	sndMY:Schedule(8, "countsix")
	sndMY:Schedule(9, "countfive")
	sndMY:Schedule(10, "countfour")
	sndMY:Schedule(11, "countthree")
	sndMY:Schedule(12, "counttwo")
	sndMY:Schedule(13, "countone")
	timerDayCD:Start(-delay)
	sndWOP:Cancel("dayphase")
	sndWOP:Cancel("countthree")
	sndWOP:Cancel("counttwo")
	sndWOP:Cancel("countone")
	sndWOP:Schedule(116.5, "dayphase")--白天準備
	sndWOP:Schedule(118, "countthree")
	sndWOP:Schedule(119, "counttwo")
	sndWOP:Schedule(120, "countone")
	if not self:IsDifficulty("lfr25") then
		berserkTimer:Start(-delay)
	end
	if self:IsDifficulty("heroic10", "heroic25") then
		timerDarkOfNightCD:Start(10-delay)
	end
	terrorN = 0
	daytime = 0
	lodcount = 0
	mobcount = 0
	hxcount = 0
	table.wipe(NightmaresMarkers)
	table.wipe(sndJKNext)
end

function mod:OnCombatEnd()
	if self.Options.HudMAP then
		DBMHudMap:FreeEncounterMarkers()
	end
end

function mod:SPELL_AURA_APPLIED(args)
	if args:IsSpellID(122768) and args:IsPlayer() then
		DSn = self.Options.optDS == "six" and 6 or self.Options.optDS == "nine" and 9 or self.Options.optDS == "twelve" and 12 or self.Options.optDS == "fifteen" and 15 or self.Options.optDS == "none" and 99
		DSn = tonumber(DSn)
		if (args.amount or 1) >= DSn then
			if args.amount % 3 == 0 then
				specWarnDreadShadows:Show(args.amount)
				sndWOP:Play("ex_mop_kzyg")--快找陽光
			end
		end
	elseif args:IsSpellID(123012) then
		warnTerrorize:Show(args.destName)
		if mod:IsHealer() then
			specWarnTerrorize:Show(args.destName)
			sndWOP:Play("dispelnow")--快驅散
		end
		if self.Options.WarnJK then
			if GetTime() - daytime < 96 then
				sndJKNext[args.sourceGUID] = mod:SoundMM("SoundWOP")
				sndJKNext[args.sourceGUID]:Schedule(18, "ex_mop_qszb")--驅散準備
				sndJKNext[args.sourceGUID]:Schedule(19, "countthree")
				sndJKNext[args.sourceGUID]:Schedule(20, "counttwo")
				sndJKNext[args.sourceGUID]:Schedule(21, "countone")
			end
		end
	elseif args:IsSpellID(122789) then
		if args:IsPlayer() then
			specWarnSunbeam:Show()
		end
	elseif args:IsSpellID(122858) and args:IsPlayer() then
		timerBathedinLight:Start()

	end
end
mod.SPELL_AURA_APPLIED_DOSE = mod.SPELL_AURA_APPLIED

function mod:SPELL_CAST_START(args)
	if args:IsSpellID(122855) then
		warnSunBreath:Show()
		specWarnSunBreath:Show()
		timerSunBreathCD:Start()
		if not mod:IsDps() then
			sndWOP:Play("ex_mop_zbhx")
		end
		hxcount = hxcount + 1
		if MyTS() then
			sndWOP:Schedule(1, "ex_mop_kgts") --快給天使
		end
	end
end

function mod:SPELL_CAST_SUCCESS(args)
	if args:IsSpellID(122752) then
		warnShadowBreath:Show()
		specWarnShadowBreath:Show()
		if self:IsDifficulty("heroic10", "heroic25") then
			timerShadowBreathCD:Start(25)
		else
			timerShadowBreathCD:Start()
		end
	elseif args:IsSpellID(124176, 123630) then
		DBM:EndCombat(self)
	end
end

function mod:RAID_BOSS_EMOTE(msg)
	if msg:find("spell:122789") then
		timerSunbeamCD:Start()
	elseif msg:find(terrorName) then
		timerTerrorizeCD:Start()--always cast 14-15 seconds after one spawns (Unless stunned, if you stun the mob you can delay the cast, using this timer)
		warnSummonEmbodiedTerror:Show()
		sndWOP:Play("ex_mop_kjjx")--恐懼具現
		terrorN = terrorN + 1
		if self.Options.WarnJK then
			sndJK:Schedule(10, "ex_mop_qszb")--驅散準備
			sndJK:Schedule(11, "countthree")
			sndJK:Schedule(12, "counttwo")
			sndJK:Schedule(13, "countone")
		end
		timerSummonEmbodiedTerrorCD:Start()
	end
end

function mod:UNIT_SPELLCAST_SUCCEEDED(uId, _, _, _, spellId)
	if spellId == 122770 and self:AntiSpam(2, 1) then--Nightmares (Night Phase)
		if self:IsDifficulty("normal25", "heroic25", "lfr25") then
			sndWOP:Play("firecircle")--注意火圈
		end
		targetScansDone = 0
		self:TargetScanner()
		if timerDayCD:GetTime() < 106 then
			timerNightmaresCD:Start()
			sndMY:Schedule(9, "countseven")
			sndMY:Schedule(10, "countsix")
			sndMY:Schedule(11, "countfive")
			sndMY:Schedule(12, "countfour")
			sndMY:Schedule(13, "countthree")
			sndMY:Schedule(14, "counttwo")
			sndMY:Schedule(15, "countone")
		end
	elseif spellId == 123252 and self:AntiSpam(2, 2) and self:IsInCombat() then--Dread Shadows Cancel (Sun Phase)
		daytime = GetTime()
		lodcount = 0
		mobcount = 0
		hxcount = 0
		timerShadowBreathCD:Cancel()
		timerSunbeamCD:Cancel()
		timerNightmaresCD:Cancel()
		sndMY:Cancel("countseven")
		sndMY:Cancel("countsix")
		sndMY:Cancel("countfive")
		sndMY:Cancel("countfour")
		sndMY:Cancel("countthree")
		sndMY:Cancel("counttwo")
		sndMY:Cancel("countone")
		timerDarkOfNightCD:Cancel()
		warnDay:Show()
		sndWOP:Cancel("countthree")
		sndWOP:Cancel("counttwo")
		sndWOP:Cancel("countone")
		sndWOP:Play("phasechange")--階段轉換
		timerSunBreathCD:Start()
		timerNightCD:Start()
		sndWOP:Schedule(116.5, "ex_mop_hyzb")--黑夜準備
		sndWOP:Schedule(118, "countthree")
		sndWOP:Schedule(119, "counttwo")
		sndWOP:Schedule(120, "countone")
	elseif spellId == 122953 and self:AntiSpam(2, 1) then--Summon Unstable Sha (122946 is another ID, but it always triggers at SAME time as Dread Shadows Cancel so can just trigger there too without additional ID scanning.
		warnSummonUnstableSha:Show()
		if mod:IsDps() then
			sndWOP:Schedule(4, "ex_mop_kdbwds")--快打不穩定煞
		end
		timerSummonUnstableShaCD:Start()
		mobcount = mobcount + 1
		if MyJS() then
			specWarnJSA:Schedule(6, mobcount)
			sndWOP:Schedule(6, "defensive") --注意減傷
		end
	elseif spellId == 122767 and self:AntiSpam(2, 2) then--Dread Shadows (Night Phase)
		timerSummonUnstableShaCD:Cancel()
		timerSummonEmbodiedTerrorCD:Cancel()
		timerSunBreathCD:Cancel()
		timerLightOfDayCD:Cancel()
		lodcount = 0
		mobcount = 0
		hxcount = 0
		if self:IsDifficulty("heroic10", "heroic25") then
			self:UnscheduleMethod("LightOfDayRepeat")
		end
		warnNight:Show()
		if self.Options.WarnJK then
			sndJK:Cancel("ex_mop_qszb")
			sndJK:Cancel("countthree")
			sndJK:Cancel("counttwo")
			sndJK:Cancel("countone")
			for i,j in pairs(sndJKNext) do
				sndJKNext[i]:Cancel("ex_mop_qszb")
				sndJKNext[i]:Cancel("countthree")
				sndJKNext[i]:Cancel("counttwo")
				sndJKNext[i]:Cancel("countone")
			end
			table.wipe(sndJKNext)
		end
		sndWOP:Play("phasechange")
		timerShadowBreathCD:Start(10)
		timerNightmaresCD:Start(16)
		sndMY:Schedule(9.5, "countseven")
		sndMY:Schedule(10.5, "countsix")
		sndMY:Schedule(11.5, "countfive")
		sndMY:Schedule(12.5, "countfour")
		sndMY:Schedule(13.5, "countthree")
		sndMY:Schedule(14.5, "counttwo")
		sndMY:Schedule(15.5, "countone")
		timerDayCD:Start()
		sndWOP:Schedule(116.5, "dayphase")
		sndWOP:Schedule(118, "countthree")
		sndWOP:Schedule(119, "counttwo")
		sndWOP:Schedule(120, "countone")
		if self:IsDifficulty("heroic10", "heroic25") then
--			timerDarkOfNightCD:Start(10-delay)--Not enough information yet, no logs of this phase starting anywhere but combat start, and those timers differ. This might have first cast IMMEDIATELY on phase start like day does
		end
	elseif spellId == 123813 and self:AntiSpam(2, 3) then--The Dark of Night (Night Phase)
		lodcount = lodcount + 1
		warnDarkOfNight:Show(lodcount)
		specWarnDarkOfNight:Show()
		timerDarkOfNightCD:Start()
		if mod:IsDps() then
			sndWOP:Play("ex_mop_aykd")--暗影快打
		end
	elseif spellId == 123816 and self:AntiSpam(2, 3) then--The Light of Day (Day Phase)
		if self:IsDifficulty("heroic10") then
			timerLightOfDayCD:Start(25)
			self:ScheduleMethod(25, "LightOfDayRepeat")
		else
			timerLightOfDayCD:Start(10)
			self:ScheduleMethod(10, "LightOfDayRepeat")
		end
	end
end

function mod:UNIT_DIED(args)
	local cid = self:GetCIDFromGUID(args.destGUID)
	if cid == 62969 then
		terrorN = terrorN - 1
		if self.Options.WarnJK then
			if terrorN == 0 then
				sndJK:Cancel("ex_mop_qszb")
				sndJK:Cancel("countthree")
				sndJK:Cancel("counttwo")
				sndJK:Cancel("countone")
			end
			if sndJKNext[args.destGUID] then
				sndJKNext[args.destGUID]:Cancel("ex_mop_qszb")
				sndJKNext[args.destGUID]:Cancel("countthree")
				sndJKNext[args.destGUID]:Cancel("counttwo")
				sndJKNext[args.destGUID]:Cancel("countone")
			end
		end
	end
end


text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Org.Apache.REEF.Common.Io;
using Org.Apache.REEF.Common.Tasks;
using Org.Apache.REEF.Driver;
using Org.Apache.REEF.Driver.Bridge;
using Org.Apache.REEF.Network.Examples.GroupCommunication;
using Org.Apache.REEF.Network.Examples.GroupCommunication.PipelineBroadcastReduceDriverAndTasks;
using Org.Apache.REEF.Network.Group.Config;
using Org.Apache.REEF.Network.NetworkService;
using Org.Apache.REEF.Tang.Implementations.Configuration;
using Org.Apache.REEF.Tang.Implementations.Tang;
using Org.Apache.REEF.Tang.Interface;
using Org.Apache.REEF.Tang.Util;
using Org.Apache.REEF.Utilities.Logging;

namespace Org.Apache.REEF.Network.Examples.Client
{
    public class PipelineBroadcastAndReduceClient
    {
        public void RunPipelineBroadcastAndReduce(bool runOnYarn, int numTasks, int startingPortNo, int portRange, int arraySize, int chunkSize)
        {
            IConfiguration driverConfig = TangFactory.GetTang().NewConfigurationBuilder(
                DriverBridgeConfiguration.ConfigurationModule
                    .Set(DriverBridgeConfiguration.OnDriverStarted, GenericType<PipelinedBroadcastReduceDriver>.Class)
                    .Set(DriverBridgeConfiguration.OnEvaluatorAllocated,
                        GenericType<PipelinedBroadcastReduceDriver>.Class)
                    .Set(DriverBridgeConfiguration.OnEvaluatorRequested,
                        GenericType<PipelinedBroadcastReduceDriver>.Class)
                    .Set(DriverBridgeConfiguration.OnEvaluatorFailed, GenericType<PipelinedBroadcastReduceDriver>.Class)
                    .Set(DriverBridgeConfiguration.OnContextActive, GenericType<PipelinedBroadcastReduceDriver>.Class)
                    .Set(DriverBridgeConfiguration.CustomTraceLevel, Level.Info.ToString())
                    .Build())
                .BindNamedParameter<GroupTestConfig.NumIterations, int>(
                    GenericType<GroupTestConfig.NumIterations>.Class,
                    GroupTestConstants.NumIterations.ToString(CultureInfo.InvariantCulture))
                .BindNamedParameter<GroupTestConfig.NumEvaluators, int>(
                    GenericType<GroupTestConfig.NumEvaluators>.Class,
                    numTasks.ToString(CultureInfo.InvariantCulture))
                .BindNamedParameter<GroupTestConfig.ChunkSize, int>(
                    GenericType<GroupTestConfig.ChunkSize>.Class,
                    chunkSize.ToString(CultureInfo.InvariantCulture))
                .BindNamedParameter<GroupTestConfig.StartingPort, int>(
                    GenericType<GroupTestConfig.StartingPort>.Class,
                    startingPortNo.ToString(CultureInfo.InvariantCulture))
                .BindNamedParameter<GroupTestConfig.PortRange, int>(
                    GenericType<GroupTestConfig.PortRange>.Class,
                    portRange.ToString(CultureInfo.InvariantCulture))
                .BindNamedParameter<GroupTestConfig.ArraySize, int>(
                    GenericType<GroupTestConfig.ArraySize>.Class,
                    arraySize.ToString(CultureInfo.InvariantCulture))
                .Build();

            IConfiguration groupCommDriverConfig = TangFactory.GetTang().NewConfigurationBuilder()
                .BindStringNamedParam<GroupCommConfigurationOptions.DriverId>(GroupTestConstants.DriverId)
                .BindStringNamedParam<GroupCommConfigurationOptions.MasterTaskId>(GroupTestConstants.MasterTaskId)
                .BindStringNamedParam<GroupCommConfigurationOptions.GroupName>(GroupTestConstants.GroupName)
                .BindIntNamedParam<GroupCommConfigurationOptions.FanOut>(GroupTestConstants.FanOut.ToString(CultureInfo.InvariantCulture).ToString(CultureInfo.InvariantCulture))
                .BindIntNamedParam<GroupCommConfigurationOptions.NumberOfTasks>(numTasks.ToString(CultureInfo.InvariantCulture))
                .Build();

            IConfiguration merged = Configurations.Merge(driverConfig, groupCommDriverConfig);

            HashSet<string> appDlls = new HashSet<string>();
            appDlls.Add(typeof(IDriver).Assembly.GetName().Name);
            appDlls.Add(typeof(ITask).Assembly.GetName().Name);
            appDlls.Add(typeof(PipelinedBroadcastReduceDriver).Assembly.GetName().Name);
            appDlls.Add(typeof(INameClient).Assembly.GetName().Name);
            appDlls.Add(typeof(INetworkService<>).Assembly.GetName().Name);

            ClrClientHelper.Run(appDlls, merged, new DriverSubmissionSettings() { RunOnYarn = runOnYarn, JavaLogLevel = JavaLoggingSetting.VERBOSE });
        }
    }
}


text:
#ifndef DIXFONT_H
#define DIXFONT_H 1

#include "dix.h"
#include <X11/fonts/font.h>
#include "closure.h"
#include <X11/fonts/fontstruct.h>
#include <X11/fonts/fontproto.h>

#define NullDIXFontProp ((DIXFontPropPtr)0)

typedef struct _DIXFontProp *DIXFontPropPtr;

extern _X_EXPORT Bool SetDefaultFont(char * /*defaultfontname */ );

extern _X_EXPORT void QueueFontWakeup(FontPathElementPtr /*fpe */ );

extern _X_EXPORT void RemoveFontWakeup(FontPathElementPtr /*fpe */ );

extern _X_EXPORT void FontWakeup(pointer /*data */ ,
                                 int /*count */ ,
                                 pointer /*LastSelectMask */ );

extern _X_EXPORT int OpenFont(ClientPtr /*client */ ,
                              XID /*fid */ ,
                              Mask /*flags */ ,
                              unsigned /*lenfname */ ,
                              char * /*pfontname */ );

extern _X_EXPORT int CloseFont(pointer /*pfont */ ,
                               XID /*fid */ );

typedef struct _xQueryFontReply *xQueryFontReplyPtr;

extern _X_EXPORT void QueryFont(FontPtr /*pFont */ ,
                                xQueryFontReplyPtr /*pReply */ ,
                                int /*nProtoCCIStructs */ );

extern _X_EXPORT int ListFonts(ClientPtr /*client */ ,
                               unsigned char * /*pattern */ ,
                               unsigned int /*length */ ,
                               unsigned int /*max_names */ );

extern _X_EXPORT int
 doListFontsWithInfo(ClientPtr /*client */ ,
                     LFWIclosurePtr /*c */ );

extern _X_EXPORT int doPolyText(ClientPtr /*client */ ,
                                PTclosurePtr    /*c */
    );

extern _X_EXPORT int PolyText(ClientPtr /*client */ ,
                              DrawablePtr /*pDraw */ ,
                              GCPtr /*pGC */ ,
                              unsigned char * /*pElt */ ,
                              unsigned char * /*endReq */ ,
                              int /*xorg */ ,
                              int /*yorg */ ,
                              int /*reqType */ ,
                              XID /*did */ );

extern _X_EXPORT int doImageText(ClientPtr /*client */ ,
                                 ITclosurePtr /*c */ );

extern _X_EXPORT int ImageText(ClientPtr /*client */ ,
                               DrawablePtr /*pDraw */ ,
                               GCPtr /*pGC */ ,
                               int /*nChars */ ,
                               unsigned char * /*data */ ,
                               int /*xorg */ ,
                               int /*yorg */ ,
                               int /*reqType */ ,
                               XID /*did */ );

extern _X_EXPORT int SetFontPath(ClientPtr /*client */ ,
                                 int /*npaths */ ,
                                 unsigned char * /*paths */ );

extern _X_EXPORT int SetDefaultFontPath(char * /*path */ );

extern _X_EXPORT int GetFontPath(ClientPtr client,
                                 int *count,
                                 int *length, unsigned char **result);

extern _X_EXPORT void DeleteClientFontStuff(ClientPtr /*client */ );

/* Quartz support on Mac OS X pulls in the QuickDraw
   framework whose InitFonts function conflicts here. */
#ifdef __APPLE__
#define InitFonts Darwin_X_InitFonts
#endif
extern _X_EXPORT void InitFonts(void);

extern _X_EXPORT void FreeFonts(void);

extern _X_EXPORT FontPtr find_old_font(XID /*id */ );

#define GetGlyphs dixGetGlyphs
extern _X_EXPORT void dixGetGlyphs(FontPtr /*font */ ,
                                   unsigned long /*count */ ,
                                   unsigned char * /*chars */ ,
                                   FontEncoding /*fontEncoding */ ,
                                   unsigned long * /*glyphcount */ ,
                                   CharInfoPtr * /*glyphs */ );

extern _X_EXPORT void QueryGlyphExtents(FontPtr /*pFont */ ,
                                        CharInfoPtr * /*charinfo */ ,
                                        unsigned long /*count */ ,
                                        ExtentInfoPtr /*info */ );

extern _X_EXPORT Bool QueryTextExtents(FontPtr /*pFont */ ,
                                       unsigned long /*count */ ,
                                       unsigned char * /*chars */ ,
                                       ExtentInfoPtr /*info */ );

extern _X_EXPORT Bool ParseGlyphCachingMode(char * /*str */ );

extern _X_EXPORT void InitGlyphCaching(void);

extern _X_EXPORT void SetGlyphCachingMode(int /*newmode */ );

extern _X_EXPORT void register_fpe_functions(void);

#endif                          /* DIXFONT_H */


text:
#ifndef PSI_LIBFFI_H
#define PSI_LIBFFI_H

#include "context.h"

#ifdef HAVE_LIBFFI
struct psi_context_ops *psi_libffi_ops(void);
#endif

#endif


text:
class AddNextIssueNumberAndNextDeliveryAtToHiThereSubscriptions < ActiveRecord::Migration
  def change
    add_column :hi_there_subscriptions, :next_issue_number, :integer
    add_column :hi_there_subscriptions, :next_delivery_at, :datetime
  end
end


text:
require 'shell_shock/context'

require 'songbirdsh/player'
require 'songbirdsh/preferences'
require 'songbirdsh/command'

require 'yaml'

module Songbirdsh
  class Cli
    include ShellShock::Context

    def with name, *aliases
      aliases << name.to_s if aliases.empty?
      add_command Command.load(name, @player), *aliases
    end

    def with_all *names
      names.each {|name| with name}
    end

    def initialize
      preferences = Preferences.new
      @player = Player.new preferences
      at_exit { @player.stop }
      @prompt = "songbirdsh > "
      with :status, "'"
      with :show_properties, 'show'
      with :restart, 'next'
      with :enqueue, '+'
      with_all *%w{reload search start stop scrobbling shuffle list setup_scrobbling recent flush}
    end
  end
end


text:
#include <Python.h>

#ifdef _MSC_VER
#include <intrin.h>
#elif defined(__i386__) || defined(__x86_64__)
#include <stdio.h>
#include <sched.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <cpuid.h>
#endif

static PyObject *_pycpuid_cpuid(PyObject* module, PyObject* args) {
    #if defined(__i386__) || defined(__x86_64__)
    pid_t pid;
    cpu_set_t saved, target;
    int affinity_ret, cpuid_ret;
    #endif
    int cpu_num = 0;
    unsigned int level = 0;
    unsigned int info[4] = { 0 };

    if(!PyArg_ParseTuple(args, "I|i", &level, &cpu_num))
        return NULL;

    #ifdef _MSC_VER

    /* Handling CPU affinity on Windows is not supported.  Patches welcome. */
    __cpuid(info, level);
    return Py_BuildValue("(IIII)", info[0], info[1], info[2], info[3]);

    #elif defined(__i386__) || defined(__x86_64__)

    pid = syscall(__NR_gettid);
    if(sched_getaffinity(pid, sizeof(cpu_set_t), &saved) != 0) {
        PyErr_SetString(PyExc_RuntimeError, "Unable to get CPU affinity");
        return NULL;
    }

    CPU_ZERO(&target);
    CPU_SET(cpu_num, &target);
    if(sched_setaffinity(pid, sizeof(cpu_set_t), &target) != 0) {
        PyErr_SetFromErrno(PyExc_OSError);
        return NULL;
    }

    cpuid_ret = __get_cpuid(level, &info[0], &info[1], &info[2], &info[3]);
    affinity_ret = sched_setaffinity(pid, sizeof(cpu_set_t), &saved);

    if(cpuid_ret != 1) {
        PyErr_SetString(PyExc_RuntimeError, "CPUID level not supported");
        return NULL;
    }

    if(affinity_ret != 0) {
        PyErr_SetFromErrno(PyExc_OSError);
        return NULL;
    }

    return Py_BuildValue("(IIII)", info[0], info[1], info[2], info[3]);
    #else
    PyErr_SetString(PyExc_NotImplementedError, "CPUID is only supported on x86");
    return NULL;
    #endif
}

static PyMethodDef _pycpuid_methods[] = {
    { "cpuid", _pycpuid_cpuid, METH_VARARGS, "cpuid(eax) -> (eax, ebx, ecx, edx)"},
    { NULL, NULL, 0, NULL},
};

#if PY_MAJOR_VERSION >= 3

static struct PyModuleDef moduledef = {
    PyModuleDef_HEAD_INIT,
    "_pycpuid",          /* m_name */
    "CPUID info",        /* m_doc */
    -1,                  /* m_size */
    _pycpuid_methods,    /* m_methods */
    NULL,                /* m_reload */
    NULL,                /* m_traverse */
    NULL,                /* m_clear */
    NULL,                /* m_free */
};

PyMODINIT_FUNC PyInit__pycpuid(void) {
    PyObject *m;

    m = PyModule_Create(&moduledef);
    if(m == NULL)
        return NULL;
    return m;
}

#else

PyMODINIT_FUNC init_pycpuid(void) {
    (void)Py_InitModule3("_pycpuid", _pycpuid_methods, "CPUID info");
}

#endif


text:
local luaVersion = _VERSION:match("%d+%.%d+")

-- luacov: disable
if not _G.getSpoonPath then
    function _G.getSpoonPath()
        return debug.getinfo(2, "S").source:sub(2):match("(.*/)"):sub(1, -2)
    end
end

if not _G.requirePackage then
    function _G.requirePackage(name, isInternal)
        local location = not isInternal and "/deps/share/lua/"..luaVersion.."/" or "/"
        local packagePath = _G.getSpoonPath()..location..name..".lua"

        return dofile(packagePath)
    end
end
-- luacov: enable

local class = _G.requirePackage("middleclass")
local lustache = _G.requirePackage("lustache")
local util = _G.requirePackage("util", true)
local cheatsheet = _G.requirePackage("cheatsheet", true)

local Entity = class("Entity")

--- Entity.behaviors
--- Variable
--- A table keyed by mode name to define (optional) entity behavior contextual to the mode at the time of an event. The table values are functions that take in the following arguments to invoke the event handler in some mode-specific way:
---  * `self` - the entity (or subclassed entity) instance
---  * `eventHandler` - the event handler to be invoked within the function
---  * `flags` - A table containing the keyboard modifiers in the keyboard event (from `hs.eventtap.event:getFlags()`)
---  * `keyName` - A string containing the name of a keyboard key (in `hs.keycodes.map`)
---
--- The table is defined with an `__add` metamethod to overwrite the default entity behaviors.
---
--- Currently supported behaviors:
--- * `default` - triggers the event handler and returns a boolean flag whether to auto-exit back to desktop mode or not, depending on the return value of the handler or the `autoExitMode` variable on the entity class
Entity.behaviors = {
    default = function(self, eventHandler)
        local _, autoExit = eventHandler()

        return autoExit == nil and self.autoExitMode or autoExit
    end,
}

-- Allow behaviors to be overwritten
setmetatable(Entity.behaviors, {
    __add = function(lhs, rhs)
        for mode, behavior in pairs(rhs) do
            lhs[mode] = behavior
        end

        return lhs
    end,
})

--- Entity.notifyError(message, details)
--- Method
--- Displays error details in a notification and logs to the Hammerspoon console
---
--- Parameters:
---  * `message` - The main notification message
---  * `details` - The textual body of the notification containing details of the error
---
--- Returns:
---  * None
function Entity.notifyError(message, details)
    hs.notify.show("Ki", message, details)
    print("[Ki] "..message..":", details)
end

--- Entity.renderScriptTemplate(script[, viewModel]) -> string
--- Method
--- Generates an applescript from templates located in `src/osascripts` with some view model object
---
--- Parameters:
---  * `scriptPath` - The absolute file path to the applescript file or the name of an existing Ki applescript file (in src/osascripts)
---  * `viewModel` - An optional [lustache](http://olivinelabs.com/lustache/) view model
---
--- Returns:
---  * The rendered script string or `nil`
function Entity.renderScriptTemplate(script, viewModel)
    viewModel = viewModel or {}

    local scriptPath = script

    if not scriptPath:match("/") then
        local localScriptPath = _G.getSpoonPath().."/osascripts/"..script..".applescript"
        scriptPath = string.match(script, "/") and script or localScriptPath
    end

    local success, file = pcall(function() return assert(io.open(scriptPath, "rb")) end)

    if not success or not file then
        Entity.notifyError("Unable to render script template for the script", script)
        return nil
    end

    local scriptTemplate = file:read("*all")

    file:close()

    return lustache:render(scriptTemplate, viewModel)
end

--- Entity:initialize(name, shortcuts, autoExitMode)
--- Method
--- Initializes a new entity instance with its name and shortcuts. By default, a `cheatsheet` object will be initialized on the entity object with metadata in the provided shortcut keybindings, and dispatched actions will automatically exit the current mode by default unless the `autoExitMode` parameter is explicitly set to `false`.
---
--- Parameters:
---  * `name` - The entity name
---  * `shortcuts` - The list of shortcuts containing keybindings and actions for the entity
---  * `autoExitMode` - A boolean denoting to whether enable or disable automatic mode exit after the action has been dispatched
---
--- Each `shortcut` item should be a list with items at the following indices:
---  * `1` - An optional table containing zero or more of the following keyboard modifiers: `"cmd"`, `"alt"`, `"shift"`, `"ctrl"`, `"fn"`
---  * `2` - The name of a keyboard key. String representations of keys can be found in [`hs.keycodes.map`](https://www.hammerspoon.org/docs/hs.keycodes.html#map).
---  * `3` - The event handler that defines the action for when the shortcut is triggered
---  * `4` - A table containing the metadata for the shortcut, also a list with items at the following indices:
---    * `1` - The category name of the shortcut
---    * `2` - A description of what the shortcut does
---
--- Returns:
---  * None
function Entity:initialize(name, shortcuts, autoExitMode)
    self.name = name
    self.autoExitMode = autoExitMode ~= nil and autoExitMode or true
    self.shortcuts = shortcuts
    self.cheatsheet = cheatsheet

    local cheatsheetDescription = "Ki shortcut keybindings registered for "..self.name
    self.cheatsheet:init(self.name, cheatsheetDescription, self.shortcuts)
end

--- Entity.mergeShortcuts(fromList, toList) -> table
--- Method
--- Merges lists of shortcuts based on their keybindings
---
--- Parameters:
---  * `fromList` - The list of shortcuts to apply onto the second list argument
---  * `toList` - The target list of shortcuts to override with those in the first list argument with conflicting keybindings
---
--- Returns:
---   * `list` - The list of merged shortcut objects
function Entity.mergeShortcuts(fromList, toList)
    if not fromList or #fromList == 0 then
        return toList
    end

    for _, shortcut in pairs(fromList) do
        local modifierKeys = shortcut[_G.SHORTCUT_MODKEY_INDEX] or {}
        local hotkey = shortcut[_G.SHORTCUT_HOTKEY_INDEX]
        local overrideIndex = nil

        for index, registeredAction in pairs(toList) do
            local registeredModifierKeys = registeredAction[_G.SHORTCUT_MODKEY_INDEX] or {}
            local registeredHotkey = registeredAction[_G.SHORTCUT_HOTKEY_INDEX]

            if hotkey == registeredHotkey and util.areListsEqual(modifierKeys, registeredModifierKeys) then
                overrideIndex = index
            end
        end

        if overrideIndex then
            table.remove(toList, overrideIndex)
        end

        table.insert(toList, shortcut)
    end

    return toList
end

--- Entity:getSelectionItems() -> table of choices or nil
--- Method
--- Returns a list of [choice](https://www.hammerspoon.org/docs/hs.chooser.html#choices) objects to display in the selection modal. Entities intended to be used with select mode must implement this method to correctly display items in the selection modal.
---
--- Returns:
---   * `selectionItems` - A list of choices or `nil`
-- luacov: disable
function Entity:getSelectionItems() -- luacheck: ignore
    return nil
end
-- luacov: enable

--- Entity.triggerAfterConfirmation(question, action)
--- Method
--- Opens a dialog block alert for user confirmation before triggering an action
---
--- Parameters:
---  * `question` - Text to display in the block alert
---  * `action` - The callback function to be invoked after user confirmation
---
--- Returns:
---   * None
function Entity.triggerAfterConfirmation(question, action)
    hs.timer.doAfter(0, function()
        hs.focus()

        local answer = hs.dialog.blockAlert(question, "", "Confirm", "Cancel")

        if answer == "Confirm" then action() end
    end)
end

--- Entity.selectionModalShortcuts
--- Variable
--- A list of shortcuts that can be used when the selection modal is visible. The following shortcuts are available by default:
---  * ^k to navigate up an item
---  * ^j to navigate down an item
---  * ^u to navigate a page of rows up
---  * ^d to navigate a page of rows down
Entity.selectionModalShortcuts = {
    { { "ctrl" }, "j", function(modal) modal:selectedRow(modal:selectedRow() + 1) end },
    { { "ctrl" }, "k", function(modal) modal:selectedRow(modal:selectedRow() - 1) end },
    { { "ctrl" }, "d", function(modal) modal:selectedRow(modal:selectedRow() + modal:rows()) end },
    { { "ctrl" }, "u", function(modal) modal:selectedRow(modal:selectedRow() - modal:rows()) end },
}

--- Entity.showSelectionModal(choices, callback)
--- Method
--- Shows a selection modal with a list of choices. The modal can be closed with Escape ⎋.
---
--- Parameters:
---  * `choices` - A list of [choice](https://www.hammerspoon.org/docs/hs.chooser.html#choices) objects to display on the chooser modal
---  * `callback` - The callback function invoked when a choice is selected from the modal
---
--- Returns:
---  * None
function Entity.showSelectionModal(choices, callback)
    local selectionListener = nil
    local modal = hs.chooser.new(function(choice)
        -- Stop selection listener and invoke the event handler
        selectionListener:stop()
        callback(choice)
    end)

    modal:choices(choices)
    modal:searchSubText(true)
    modal:bgDark(true)

    -- Create an event listener while the chooser is visible to select rows with ctrl+j/k
    selectionListener = hs.eventtap.new({ hs.eventtap.event.types.keyDown }, function(event)
        local flags = event:getFlags()
        local keyName = hs.keycodes.map[event:getKeyCode()]
        local modalEventHandler = Entity.getEventHandler(Entity.selectionModalShortcuts, flags, keyName)

        if modalEventHandler then
            modalEventHandler(modal)
            return true
        end
    end)

    -- Start row selection listener and show the modal
    selectionListener:start()
    modal:show()
end

--- Entity:getEventHandler(shortcuts, flags, keyName) -> function or nil
--- Method
--- Returns the event handler within the provided shortcuts with the given shortcut keybindings, or nil if not found
---
--- Parameters:
---  * `shortcuts` - The list of shortcut objects
---  * `flags` - A table containing the keyboard modifiers in the keyboard event (from `hs.eventtap.event:getFlags()`)
---  * `keyName` - A string containing the name of a keyboard key (in `hs.keycodes.map`)
---
--- Returns:
---  * A boolean denoting to whether enable or disable automatic mode exit after the action has been dispatched
function Entity.getEventHandler(shortcuts, flags, keyName)
    for _, registeredShortcut in pairs(shortcuts) do
        local registeredFlags = registeredShortcut[_G.SHORTCUT_MODKEY_INDEX]
        local registeredKeyName = registeredShortcut[_G.SHORTCUT_HOTKEY_INDEX]
        local registeredHandler = registeredShortcut[_G.SHORTCUT_EVENT_HANDLER_INDEX]
        local areFlagsEqual = flags == registeredFlags or
            (flags and flags.containExactly and flags:containExactly(registeredFlags or {}))

        if areFlagsEqual and keyName == registeredKeyName then
            return registeredHandler
        end
    end

    return nil
end

--- Entity:dispatchAction(mode, shortcut) -> boolean
--- Method
--- Dispatch an action from a shortcut within the context of the given mode
---
--- Parameters:
---  * `mode` - The name of the current mode
---  * `shortcut` - A shortcut object containing the keybindings and event handler for the entity
---  * `workflow` - The list of events that compose the current workflow
---
--- Returns:
---  * A boolean denoting to whether enable or disable automatic mode exit after the action has been dispatched
function Entity:dispatchAction(mode, shortcut, workflow)
    local flags = shortcut.flags
    local keyName = shortcut.keyName
    local eventHandler = self.getEventHandler(self.shortcuts, flags, keyName)

    if eventHandler then
        local behaviorFunc = self.behaviors[mode] or self.behaviors.default

        return behaviorFunc(self, eventHandler, flags, keyName, workflow)
    else
        return self.autoExitMode
    end
end

return Entity


text:
using System.Collections.Generic;
using System.Linq;

namespace LightBuzz.Vitruvius.FingerTracking
{
    internal class GrahamScan
    {
        private IList<DepthPointEx> _points;

        public IList<DepthPointEx> ConvexHull(IList<DepthPointEx> points)
        {
            if (points.Count <= 3)
            {
                return points;
            }

            _points = points;

            var pointsSortedByAngle = SortPoints();
            int index = 1;

            while (index + 1 < pointsSortedByAngle.Count)
            {
                var value = PointAngleComparer.Compare(pointsSortedByAngle[index - 1], pointsSortedByAngle[index + 1], pointsSortedByAngle[index]);
                if (value < 0)
                {
                    index++;
                }
                else
                {
                    pointsSortedByAngle.RemoveAt(index);
                    if (index > 1)
                    {
                        index--;
                    }
                }
            }

            pointsSortedByAngle.Add(pointsSortedByAngle.First());

            return pointsSortedByAngle;
        }

        private DepthPointEx GetMinimumPoint()
        {
            var minPoint = _points[0];

            for (int index = 1; index < _points.Count; index++)
            {
                minPoint = GetMinimumPoint(minPoint, _points[index]);
            }

            return minPoint;
        }

        private DepthPointEx GetMinimumPoint(DepthPointEx p1, DepthPointEx p2)
        {
            if (p1.Y < p2.Y)
            {
                return p1;
            }
            else if (p1.Y == p2.Y)
            {
                if (p1.X < p2.X)
                {
                    return p1;
                }
            }

            return p2;
        }

        private IList<DepthPointEx> SortPoints()
        {
            var p0 = GetMinimumPoint();

            var comparer = new PointAngleComparer(p0);

            var sortedPoints = new List<DepthPointEx>(_points);
            sortedPoints.Remove(p0);
            sortedPoints.Insert(0, p0);
            sortedPoints.Sort(1, sortedPoints.Count - 1, comparer);

            return sortedPoints;
        }
    }

    internal class PointAngleComparer : IComparer<DepthPointEx>
    {
        private DepthPointEx p0;

        public PointAngleComparer(DepthPointEx zeroPoint)
        {
            p0 = zeroPoint;
        }

        public int Compare(DepthPointEx p1, DepthPointEx p2)
        {
            if (p1.Equals(p2))
            {
                return 0;
            }

            float value = Compare(p0, p1, p2);

            if (value == 0)
            {
                return 0;
            }
            if (value < 0)
            {
                return 1;
            }
            return -1;
        }

        public static float Compare(DepthPointEx p0, DepthPointEx p1, DepthPointEx p2)
        {
            return (p1.X - p0.X) * (p2.Y - p0.Y) - (p2.X - p0.X) * (p1.Y - p0.Y);
        }
    }
}


text:
const {execSync} = require('child_process');

class GITHooksProcessor {
    public async runFromArgs() {
        const hook = require('yargs').argv.hook as string;
        return this.processGitHook(hook);
    }

    public async processGitHook(hookName: string) {

        switch (hookName) {
            case 'preCommit':
                return this.processPreCommit();

            default:
                throw new Error(`Unknown hook: ${hookName}`);
        }
    }

    private async processPreCommit() {
        const forbiddenFilesMatchers = [/^passwords\/decrypted\//, /passwords\/keys\//];
        const files: string[] = execSync('git diff --cached --name-only').toString().split('\n');

        const forbiddenFiles = files.filter(file => forbiddenFilesMatchers.some(matcher => matcher.test(file)));

        if (forbiddenFiles.length > 0) throw new Error(`Commit includes forbidden files: ${forbiddenFiles.join(', ')}`);

        const lintFiles = files.filter(file => file.endsWith('.ts'));

        if (lintFiles.length > 0) execSync(`./node_modules/.bin/tslint ${lintFiles.join(' ')}`);

    }
}

export {GITHooksProcessor};

if (require.main === module) {
    const processor = new GITHooksProcessor();
    processor.runFromArgs()
        .then(() => {
            console.log('Git hook processed');
            process.exit(0);
        })
        .catch(e => {
            console.error(`Error processing git hook : ${e.message}`);
            process.exit(1);
        });
}


text:
package com.hockeyhurd.item;

import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;

import com.hockeyhurd.extratools.ExtraTools;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class ItemRubber extends Item {

	public ItemRubber() {
		super();
		this.setUnlocalizedName("Rubber");
		this.setCreativeTab(ExtraTools.myCreativeTab);
	}

	@SideOnly(Side.CLIENT)
	public void registerIcons(IIconRegister reg) {
		itemIcon = reg.registerIcon(ExtraTools.assetsDir + "Rubber");
	}

}