text:
package com.five35.minecraft.ice;

import com.mojang.authlib.GameProfile;
import java.io.File;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.scoreboard.Team;
import net.minecraftforge.common.config.Configuration;

public class IceConfiguration {
	private static enum SecurityType {
		NO, OWNER, TEAM, YES
	}

	private static SecurityType getSecurityType(final String value, final SecurityType fallback) {
		try {
			return SecurityType.valueOf(value.toUpperCase());
		} catch (final IllegalArgumentException ex) {
			final String message = String.format("Unrecognized security type '%s', defaulting to '%s'.", value, fallback);
			Ice.getProxy().getLogger().warn(message, ex);

			return fallback;
		}
	}

	private static boolean hasAccess(final SecurityType securityType, final GameProfile owner, final EntityPlayer player) {
		if (securityType == SecurityType.NO) {
			return false;
		}

		if (securityType == SecurityType.YES) {
			return true;
		}

		if (owner.getId().equals(player.getGameProfile().getId())) {
			return true;
		}

		if (securityType == SecurityType.TEAM) {
			final Team ownerTeam = player.getWorldScoreboard().getPlayersTeam(owner.getName());

			if (ownerTeam == null) {
				return false;
			}

			return ownerTeam.isSameTeam(player.getTeam());
		}

		return false;
	}

	private final SecurityType popping;
	private final SecurityType recovering;

	IceConfiguration(final File file) {
		final Configuration config = new Configuration(file);

		config.setCategoryComment("security", "The allowable values for these actions are 'no' (completely disabled), 'owner' (only the player whose death created the ice), 'team' (anyone on the dying player's team), or 'yes' (anyone).");

		Ice.getProxy().getLogger().debug("Reading 'security.popping'.");
		final String poppingValue = config.get("security", "popping", "team", "Whether death markers can be 'popped' by hitting them.").getString();
		this.popping = IceConfiguration.getSecurityType(poppingValue, SecurityType.TEAM);

		Ice.getProxy().getLogger().debug("Reading 'security.recovering'.");
		final String recoveringValue = config.get("security", "recovering", "owner", "Whether the contents of death markers can be recovered by right-clicking them.").getString();
		this.recovering = IceConfiguration.getSecurityType(recoveringValue, SecurityType.OWNER);

		if (this.popping == SecurityType.NO && this.recovering == SecurityType.NO) {
			Ice.getProxy().getLogger().warn("All actions disabled!  Death markers cannot be removed without creative mode.  (That probably isn't what you want.)");
		}

		config.save();
	}

	boolean canPop(final GameProfile owner, final EntityPlayer player) {
		return IceConfiguration.hasAccess(this.popping, owner, player);
	}

	boolean canRecover(final GameProfile owner, final EntityPlayer player) {
		return IceConfiguration.hasAccess(this.recovering, owner, player);
	}
}

redpajama_set_name: RedPajamaGithub


text:
Package.describe({
	name: 'simply:strict-reactive-var',
	version: '1.1.0',
	summary: 'Thin strictly type checking wrapper around reactive-var.',
	git: 'https://github.com/simplyGits/strict-reactive-var',
	documentation: 'README.md',
})

Package.onUse(function(api) {
	api.versionsFrom('1.3.2.4')
	api.use([
		'reactive-var',
		'ecmascript',
	])
	api.mainModule('strict-reactive-var.js')
})

Package.onTest(function(api) {
	api.use('tinytest')
	api.use('simply:strict-reactive-var')
	api.addFiles('strict-reactive-var-tests.js')
})


text:
include_recipe 'supervisor'

hubot_name = node['hubot']['name']
hubot_bin = File.join(node['hubot']['install_dir'], 'node_modules', '.bin', 'hubot')
hubot_adapter = node['hubot']['adapter']

node.default['hubot']['config']['PATH'] = "#{node['hubot']['install_dir']}/node_modules/.bin:%(ENV_PATH)s"

supervisor_service 'hubot' do
  action [:enable, :start]
  autostart true
  autorestart true
  directory node['hubot']['install_dir']
  command "#{hubot_bin} -n \"#{hubot_name}\" -a #{hubot_adapter}"
  stopsignal 'TERM'
  user node['hubot']['user']
  startretries 3
  stdout_logfile node['hubot']['supervisor']['stdout_logfile']
  stdout_logfile_maxbytes node['hubot']['supervisor']['stdout_logfile_maxbytes']
  stdout_logfile_backups node['hubot']['supervisor']['stdout_logfile_backups']
  stderr_logfile node['hubot']['supervisor']['stderr_logfile']
  stderr_logfile_maxbytes node['hubot']['supervisor']['stderr_logfile_maxbytes']
  stderr_logfile_backups node['hubot']['supervisor']['stderr_logfile_backups']
  environment node['hubot']['config']
end


text:
Deploying Cloudera Data Hub (CDH) on Google Compute Engine
==========================================================

Basic Usage
-----------

This plugin replaces the vanilla Apache binary tarballs with [Cloudera Data Hub](http://www.cloudera.com/content/cloudera/en/products-and-services/cdh.html) packages. Cluster configuration is the same as in core bdutil.

    ./bdutil -e platforms/cdh/cdh_env.sh deploy

Or alternatively, using shorthand syntax:

    ./bdutil -e cdh deploy

Status
------

This plugin is currently considered experimental and not officially supported.
Contributions are welcome.


text:
package com.opengamma.analytics.math.interpolation;

import static com.opengamma.analytics.math.linearalgebra.TridiagonalSolver.solvTriDag;

import com.opengamma.analytics.math.linearalgebra.TridiagonalMatrix;
import com.opengamma.analytics.math.matrix.DoubleMatrix1D;
import com.opengamma.analytics.math.matrix.DoubleMatrix2D;

/**
 * For specific cubic spline interpolations, polynomial coefficients are determined by the tridiagonal algorithm.
 */
public class LogCubicSplineNaturalSolver extends CubicSplineSolver {

  @Override
  public DoubleMatrix2D solve(final double[] xValues, final double[] yValues) {
    final double[] intervals = getDiffs(xValues);
    return getCommonSplineCoeffs(xValues, yValues, intervals, matrixEqnSolver(getMatrix(intervals), getCommonVectorElements(yValues, intervals)));
  }

  @Override
  public DoubleMatrix2D[] solveWithSensitivity(final double[] xValues, final double[] yValues) {
    final double[] intervals = getDiffs(xValues);
    final double[][] toBeInv = getMatrix(intervals);
    final double[] commonVector = getCommonVectorElements(yValues, intervals);
    final double[][] commonVecSensitivity = getCommonVectorSensitivity(intervals);

    return getCommonCoefficientWithSensitivity(xValues, yValues, intervals, toBeInv, commonVector, commonVecSensitivity);
  }

  @Override
  public DoubleMatrix2D[] solveMultiDim(final double[] xValues, final DoubleMatrix2D yValuesMatrix) {
    final int dim = yValuesMatrix.getNumberOfRows();
    final DoubleMatrix2D[] coefMatrix = new DoubleMatrix2D[dim];

    for (int i = 0; i < dim; ++i) {
      coefMatrix[i] = solve(xValues, yValuesMatrix.getRowVector(i).getData());
    }

    return coefMatrix;
  }

  /**
   * Cubic spline is obtained by solving a linear problem Ax=b where A is a square matrix and x,b are vector
   *
   * @param intervals
   *          {xValues[1]-xValues[0], xValues[2]-xValues[1],...}
   * @return Matrix A
   */
  private double[][] getMatrix(final double[] intervals) {

    final int nData = intervals.length + 1;
    double[][] res = new double[nData][nData];

    res = getCommonMatrixElements(intervals);
    res[0][0] = 1.;
    res[nData - 1][nData - 1] = 1.;

    return res;
  }

  @Override
  protected double[] matrixEqnSolver(final double[][] doubMat, final double[] doubVec) {
    final int sizeM1 = doubMat.length - 1;
    final double[] a = new double[sizeM1];
    final double[] b = new double[sizeM1 + 1];
    final double[] c = new double[sizeM1];

    for (int i = 0; i < sizeM1; ++i) {
      a[i] = doubMat[i][i + 1];
      b[i] = doubMat[i][i];
      c[i] = doubMat[i + 1][i];
    }
    b[sizeM1] = doubMat[sizeM1][sizeM1];

    final TridiagonalMatrix m = new TridiagonalMatrix(b, a, c);

    return solvTriDag(m, doubVec);
  }

  @Override
  protected DoubleMatrix1D[] combinedMatrixEqnSolver(final double[][] doubMat1, final double[] doubVec, final double[][] doubMat2) {
    final int size = doubVec.length;
    final DoubleMatrix1D[] res = new DoubleMatrix1D[size + 1];
    final DoubleMatrix2D doubMat2Matrix = new DoubleMatrix2D(doubMat2);

    final double[] u = new double[size - 1];
    final double[] d = new double[size];
    final double[] l = new double[size - 1];

    for (int i = 0; i < size - 1; ++i) {
      u[i] = doubMat1[i][i + 1];
      d[i] = doubMat1[i][i];
      l[i] = doubMat1[i + 1][i];
    }
    d[size - 1] = doubMat1[size - 1][size - 1];
    final TridiagonalMatrix m = new TridiagonalMatrix(d, u, l);
    res[0] = new DoubleMatrix1D(solvTriDag(m, doubVec));
    for (int i = 0; i < size; ++i) {
      final double[] doubMat2Colum = doubMat2Matrix.getColumnVector(i).getData();
      res[i + 1] = new DoubleMatrix1D(solvTriDag(m, doubMat2Colum));
    }

    return res;
  }
}


text:
package packets

import "io"

// PacketDirection lets us define whether packets are purely C->S or S->C.
// This will change what the parser reads, depending on its direction.
type PacketDirection int

func (p *PacketDirection) Flip() PacketDirection {
	if *p == ServerBound {
		return ClientBound
	} else if *p == ClientBound {
		return ServerBound
	} else {
		return Anomalous
	}
}

// ServerBound and ClientBound let us designate a parser's direction. This
// defines what kind of packets it'll parse/serialize.
const (
	ServerBound PacketDirection = iota
	ClientBound
	// Anomalous shouldn't come up usually. If it does, something is broken,
	// and you'll probably want to panic() out.
	Anomalous
)

type State int

const (
	Handshake State = iota
	Status
	Login
	Play
)

type Packet interface {
	Id() byte
	Encode(io.Writer) error
	Decode(io.Reader) error
}

type PacketFunc func() Packet

const (
	NumStates     int = 4
	NumDirections     = 3
)

// Packets is a multidimensional array/map used to store packet factories.
// [4] = how many states there are
// [3] = how many directions there are
// [b] = packet ID byte
var Packets [NumStates][NumDirections]map[byte]PacketFunc

// XXX: Catch panics in case of out of bounds? Is that even possible?
func Register(state State, dir PacketDirection, id byte, f PacketFunc) {
	Packets[state][dir][id] = f
}


text:
<template>
  <require from="./class-or-interface.css"></require>

  <au-view class="content class">

    <au-card title-card>

${product.productName} :: ${target.name}

${target.comment.shortText || 'no description available'}

            ${constructorSignature.name}(${param.name}: ${param.type.name})

    </au-card>

 0">Properties

    <au-card variable-card repeat.for="prop of target.properties">

          static
          ${prop.name}: ${prop.type.name}

${prop.comment.shortText || 'no description available'}

    </au-card>

 0">Methods

    <au-card function-card repeat.for="method of target.methods">

          static

            ${method.signature.name}(${param.name}:${param.type.name || 'any'}): ${value.signature.type.name || 'any'}

${method.signature.comment.shortText || 'no description available'}

 0">

Parameters:

            ${param.name}: ${param.type.name || 'any'}

${param.comment.text || 'no description available'}

    </au-card>
  </au-view>
</template>


text:
<?php

namespace Mopsy;

/**
 * A simple service container with dependency injection
 */
class Container implements \ArrayAccess
{
    /**
     * Stack of services
     */
    protected $services = array();

    /**
     * Add an object to the container
     *
     * @param string $key The name of a service to set in the container
     * @param mixed $value A closure or object representing a service
     *
     * @return Container - Provides fluent interface
    */
    public function set($key, $value = null)
    {
        $this->services[$key] = $value;
        return $this;
    }

    /**
     * Get an object from the container
     *
     * @param string $key The name of a service to get from the container
     *
     * @return mixed A closure or object representing a service
     *
     * @throws \InvalidArgumentException
     */
    public function get($key)
    {
        if (!$this->has($key)) {
            throw new \InvalidArgumentException("Object $key does not exist.");
        }

        if ($this->services[$key] instanceof \Closure) {
            $this->services[$key] = $this->services[$key]->__invoke();
        }

        return $this->services[$key];
    }

    /**
     * Check to see if a service has been filled into the container
     *
     * @param string $key The name of a service to check in the container
     *
     * @return bool
     */
    public function has($key)
    {
        return array_key_exists($key, $this->services);
    }

    /**
     *  Create a new instance of a class
     *
     * This method will populate any services that have been wired into the container
     *
     * @param string $class  - Class name to instantiate.
     * @param array  $params - Optional parameters array for $class constructor.
     * @param array  $ignore
     *
     * @return mixed - An instance of the class sent in as a parameter
     */
    public function newInstance($class, array $params = null, array $ignore = array())
    {
        $reflection = new \ReflectionClass($class);

        $params = !is_null($params) ? $params : $this->identifyConstructorParams($reflection);

        $obj = call_user_func_array(array($reflection, 'newInstance'), $params);

        $this->injectSetters($reflection, $obj, $ignore);
        return $obj;
    }

    /**
     * Identify services from constructor parameters
     *
     * @param \ReflectionClass $reflection An instance of a reflection to inspect
     * @return array Collection of services to be applied as parameters to a constructor
     */
    protected function identifyConstructorParams(\ReflectionClass $reflection)
    {
        $params = array();

        if (!$reflection->hasMethod('__construct') || !$reflection->getMethod('__construct')->isPublic()) {
            return $params;
        }

        foreach ($reflection->getMethod('__construct')->getParameters() as $param) {
            if (array_key_exists($param->getName(), $this->services)) {
                $params[] = $this->get($param->getName());
            } else {
                $params[] = null;
            }
        }

        return $params;
    }

    /**
     * Identify setters eligible for service injection and set them.
     *
     * @param \ReflectionClass $reflection A reflection of {@link $obj}.
     * @param object $obj The object to call setters on.
     * @param array  $ignore
     *
     * @uses get()
     */
    protected function injectSetters(\ReflectionClass $reflection, $obj, array $ignore = array())
    {
        foreach ($reflection->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
            $methodName = $method->getName();
            $params = $method->getParameters();
            $serviceName = lcfirst(substr($methodName, 3));

            if (substr($methodName, 0, 3) == 'set' &&
                count($params) == 1 &&
                array_key_exists($serviceName, $this->services) &&
                !in_array($serviceName, $ignore)) {

                $obj->$methodName(
                    $this->get($serviceName)
                );
            }
        }
    }

    /**
     * Array access method for setting a service
     *
     * @uses $this->set()
     * @param string $key The name of a service to set in the container
     * @param mixed $value A closure of object representing a serive
     * @return $this
     */
    public function offsetSet($key, $value)
    {
        return $this->set($key, $value);
    }

    /**
     * Array access method for getting a service
     *
     * @uses $this->get()
     * @param string $key The name of a service to get from the container
     * @return mixed The service being retrieved from the container
     */
    public function offsetGet($key)
    {
        return $this->get($key);
    }

    /**
     * Array access method for unsetting a service
     *
     * This is NOT implemented and will throw an exception
     *
     * @param string $key The name of a service to unset in the container
     * @throws \Exception
     */
    public function offsetUnset($key)
    {
        throw new \BadFunctionCallException("Not implemented! [offsetUnset($key)]");
    }

    /**
     * Array access method for checking is a service is set
     *
     * @param string $key The name of a service to check in the container
     * @return bool True if the service exists, false if it does not
     */
    public function offsetExists($key)
    {
        return $this->has($key);
    }
}


text:
dark.controller("NewsController", function ($http, Config, $scope) {

    $http.jsonp('https://www.googleapis.com/plus/v1/people/' + Config.id +
        '/activities/public?callback=JSON_CALLBACK&maxResults=20&key=' + Config.google_api)
        .success(function (response) {
            console.log(response);
            $scope.news = response.items;
            // var $scope.news = [], i;
            // var item, actor, object, itemTitle, html;
            // var published, actorImage, entry;

            // if (!response.items) {
            //     // handleError('Response from server contained no news items.');
            //     return;
            // }
            // for (i = 0; i < response.items.length; i++) {
            //     item = response.items[i];
            //     actor = item.actor || {};
            //     object = item.object || {};
            //     itemTitle = object.content;
            //     published = $filter('date')(new Date(item.published), 'fullDate');
            //     html = [];

            //     html.push(itemTitle.replace(new RegExp('\n', 'g'), '
').replace('

', '
'));
            //     html = html.join('');
            //     html = $sce.trustAsHtml(html);

            //     actorImage = actor.image.url;
            //     actorImage = actorImage.substr(0, actorImage.length - 2) + '16';

            //     entry = {
            //         via: {
            //             name: 'Google+',
            //             url: item.url
            //         },
            //         published: published,
            //         body: html,
            //         date: item.updated,
            //         reshares: (object.resharers || {}).totalItems,
            //         plusones: (object.plusoners || {}).totalItems,
            //         comments: (object.replies || {}).totalItems,
            //         icon: actorImage,
            //         item: item,
            //         object: object
            //     };

            //     $scope.news.push(entry);
            // }
            // $scope.news = $filter('orderBy')($scope.news, 'date', true);
            // $timeout(function () {
            //     gapi.plusone.go();
            // });
        })
        .error(function(err){
            console.log(err);
        });

        // var handleError = function(error){
        //     console.log(error);
        //     // vm.desc = "Sorry, we failed to retrieve the news from the Google+ API.";
        //     // vm.loading = false;
        //     // vm.status = 'ready';
        //     // $log.debug('Sorry, we failed to retrieve the news from the Google+ API: ' + error);
        // });

});


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

using NetCoreCMS.Framework.Core;
using NetCoreCMS.Framework.Utility;
using NetCoreCMS.Framework.Core.Messages;
using NetCoreCMS.Framework.Modules.Widgets;

using Microsoft.CodeAnalysis;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.DependencyInjection;
using NetCoreCMS.Framework.Modules.Loader;

namespace NetCoreCMS.Framework.Themes
{
    public class ThemeManager
    {
        public static readonly string ThemeInfoFileName = "Theme.json";
        private List<Assembly> _themeDlls;

        public ThemeManager()
        {
            _themeDlls = new List<Assembly>();
        }

        public List<Theme> ScanThemeDirectory(string path)
        {
            var themes = new List<Theme>();
            var directoryInfo = new DirectoryInfo(path);
            bool isThemeActivated = false;

            foreach (var themeDir in directoryInfo.EnumerateDirectories())
            {
                try
                {
                    if (themeDir.Name == "ChildThemes")
                    {
                        continue;
                    }

                    var configFileLocation = Path.Combine(themeDir.FullName, ThemeInfoFileName);
                    if (File.Exists(configFileLocation))
                    {
                        var theme = NccFileHelper.LoadObject<Theme>(configFileLocation);

                        theme.ThemeId = themeDir.Name;
                        theme.Folder = themeDir.Name;
                        theme.ConfigFilePath = configFileLocation;

                        if (Directory.Exists(themeDir.FullName + "\\Bin\\Debug\\netcoreapp2.0"))
                        {
                            theme.ResourceFolder    = themeDir.FullName + "\\Bin\\Debug\\netcoreapp2.0\\Resources";
                            theme.AssemblyPath      = themeDir.FullName + "\\Bin\\Debug\\netcoreapp2.0\\" + theme.ThemeId + ".dll";
                        }
                        else if(Directory.Exists(themeDir.FullName + "\\Bin\\Release\\netcoreapp2.0"))
                        {
                            theme.AssemblyPath      = themeDir.FullName + "\\Bin\\Release\\netcoreapp2.0\\" + theme.ThemeId + ".dll";
                            theme.ResourceFolder    = themeDir.FullName + "\\Bin\\Release\\netcoreapp2.0\\Resources";
                        }

                        if (string.IsNullOrEmpty(theme.AssemblyPath) == false && File.Exists(theme.AssemblyPath))
                        {
                            var themeAssembly = Assembly.LoadFile(theme.AssemblyPath);
                            themes.Add(theme);
                            if (isThemeActivated  == false && theme.IsActive)
                            {
                                isThemeActivated = true;
                                ThemeHelper.ActiveTheme     = theme;
                            }
                            else
                            {
                                if (theme.IsActive)
                                {
                                    theme.IsActive = false;
                                    NccFileHelper.WriteObject<Theme>(configFileLocation, theme);
                                }
                            }
                            GlobalContext.Themes.Add(theme);
                        }
                    }
                    else
                    {
                        //RegisterErrorMessage("Theme config file Theme.json not found");
                    }

                }
                catch(Exception ex)
                {
                    RegisterErrorMessage(ex.Message);
                    throw ex;
                }
            }

            if(ThemeHelper.ActiveTheme == null)
            {
                ActivateDefaultTheme();
            }

            return themes;
        }

        public bool ActivateTheme(string themeId)
        {
            try
            {
                var infoFileLocation = Path.Combine(GlobalContext.ContentRootPath, NccInfo.ThemeFolder, themeId,ThemeInfoFileName);
                if (File.Exists(infoFileLocation))
                {
                    var theme = NccFileHelper.LoadObject<Theme>(infoFileLocation);
                    if (theme.IsActive == false)
                    {
                        if (InactivateTheme(ThemeHelper.ActiveTheme.ThemeId))
                        {
                            theme.IsActive = true;
                            NccFileHelper.WriteObject<Theme>(infoFileLocation, theme);
                            ThemeHelper.ActiveTheme     = theme;
                        }
                        else
                        {
                            RegisterErrorMessage("Previous theme inactivation failed.");
                        }
                    }
                    else
                    {
                        ThemeHelper.ActiveTheme = theme;
                    }

                    return true;
                }
                else
                {
                    RegisterErrorMessage("Theme config file Theme.json not found");
                }

            }
            catch (Exception ex)
            {
                RegisterErrorMessage(ex.Message);
                throw ex;
            }
            return false;
        }

        public bool InactivateTheme(string themeId)
        {
            try
            {
                var infoFileLocation = Path.Combine(GlobalContext.ContentRootPath, NccInfo.ThemeFolder, themeId, ThemeInfoFileName);
                if (File.Exists(infoFileLocation))
                {
                    var theme = NccFileHelper.LoadObject<Theme>(infoFileLocation);

                    if (theme.IsActive == true)
                    {
                        theme.IsActive = false;
                        NccFileHelper.WriteObject<Theme>(infoFileLocation, theme);
                    }

                    return true;
                }
                else
                {
                    RegisterErrorMessage("Theme config file Theme.json not found");
                }

            }
            catch (Exception ex)
            {
                return false;
            }
            return false;
        }

        public bool ActivateDefaultTheme()
        {
            try
            {
                var infoFileLocation = Path.Combine(GlobalContext.ContentRootPath, NccInfo.ThemeFolder, Constants.DefaultThemeId, ThemeInfoFileName);
                if (File.Exists(infoFileLocation))
                {
                    var theme = NccFileHelper.LoadObject<Theme>(infoFileLocation);
                    theme.ThemeId = Constants.DefaultThemeId;
                    theme.IsActive = true;
                    NccFileHelper.WriteObject<Theme>(infoFileLocation, theme);
                    var defaultTheme = GlobalContext.Themes.Where(x => x.ThemeId == Constants.DefaultThemeId).FirstOrDefault();
                    if(defaultTheme != null)
                    {
                        defaultTheme.IsActive = true;
                    }
                    ThemeHelper.ActiveTheme     = theme;
                    return true;
                }
                else
                {
                    RegisterErrorMessage("Theme config file Theme.json not found");
                }

            }
            catch (Exception ex)
            {
                RegisterErrorMessage(ex.Message);
                throw ex;
            }
            return false;
        }

        public void RegisterThemes(IMvcBuilder mvcBuilder, IServiceCollection services, IServiceProvider serviceProvider, IDirectoryContents themes )
        {
            _themeDlls = new List<Assembly>();
            foreach (var themeFolder in themes.Where(x => x.IsDirectory))
            {
                try
                {
                    var binFolder = new DirectoryInfo(Path.Combine(themeFolder.PhysicalPath, "bin"));
                    if (!binFolder.Exists)
                    {
                        continue;
                    }

                    foreach (var file in binFolder.GetFileSystemInfos("*.dll", SearchOption.AllDirectories))
                    {
                        Assembly assembly;
                        try
                        {
                            assembly = NccAssemblyLoader.LoadFromFileName(file.FullName);
                        }
                        catch (FileLoadException ex)
                        {
                            continue;
                        }
                        catch (BadImageFormatException ex)
                        {
                            continue;
                        }

                        if (assembly.FullName.Contains(themeFolder.Name))
                        {
                            _themeDlls.Add(assembly);
                            if (ThemeHelper.ActiveTheme.ThemeId == themeFolder.Name)
                            {
                                mvcBuilder.AddApplicationPart(assembly);
                                var widgetTypeList = assembly.GetTypes().Where(x => typeof(Widget).IsAssignableFrom(x)).ToList();
                                foreach (var widgetType in widgetTypeList)
                                {
                                    services.AddTransient(widgetType);
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    RegisterErrorMessage("Could not load theme from " + themeFolder);
                }
            }

            mvcBuilder.AddRazorOptions(o =>
            {
                foreach (var theme in _themeDlls)
                {
                    var themeFolder = theme.GetName().Name;

                    if (themeFolder == ThemeHelper.ActiveTheme.ThemeId)
                    {
                        o.AdditionalCompilationReferences.Add(MetadataReference.CreateFromFile(theme.Location));
                    }
                }
            });
        }

        public List<Widget> RegisterThemeWidgets(IMvcBuilder mvcBuilder, IServiceCollection services, IServiceProvider serviceProvider, IDirectoryContents themes)
        {
            var widgets = new List<Widget>();

            foreach (var themeFolder in themes.Where(x => x.IsDirectory))
            {
                if (ThemeHelper.ActiveTheme.ThemeId == themeFolder.Name)
                {
                    var assembly = _themeDlls.Where(x => x.ManifestModule.Name == themeFolder.Name+".dll").FirstOrDefault();
                    if(assembly != null)
                    {
                        var widgetTypeList = assembly.GetTypes().Where(x => typeof(Widget).IsAssignableFrom(x)).ToList();
                        foreach (var widgetType in widgetTypeList)
                        {
                            //var widgetInstance = (IWidget)Activator.CreateInstance(widgetType);
                            var widgetInstance = (Widget)serviceProvider.GetService(widgetType);
                            widgets.Add(widgetInstance);
                            ThemeHelper.ActiveTheme.Widgets.Add(widgetInstance);
                            GlobalContext.Widgets.Add(widgetInstance);
                            GlobalContext.WidgetTypes.Add(widgetInstance.WidgetId, widgetType);
                        }
                    }
                }
            }
            return widgets;
        }

        private void RegisterErrorMessage(string message)
        {
            GlobalMessageRegistry.RegisterMessage(
                new GlobalMessage()
                {
                    Registrater = typeof(ThemeManager).Name,
                    Text = message,
                    Type = GlobalMessage.MessageType.Error,
                    For = GlobalMessage.MessageFor.Admin
                },
                new TimeSpan(0, 1, 0)
            );
        }
    }
}


text:
BEM-like class nameing convention which uses only dash as separator.

Used on: [codefights.com](codefights.com), [codetrace.io](codetrace.io), [sharedthings.io](sharedthings.io).

## Block

Block is the main unit, block can not be separated.

Examples:

	button
	modal
	bot-dashboard

## Element

Element is the part of the block. Element can not be used out of the block.

Examples:

	button--icon
	modal--header
	bot-dashboard--application

## Modifier

Modifier can be applied to block or element and changes the appearance.

Examples:

	button -size-big -color-grey
	application--item -expanded

## Prefix

Prefix is a short string in the start of the class name. Similar to namespace in the programming.

Examples:

	v-bot-dashboard (in this case v- means view)
	b-application (in this case b- means block)


text:
"""
  `Unit tests for cargo.expressions.BaseLogic`
--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--
   2016 Jared Lunde © The MIT License (MIT)
   http://github.com/jaredlunde
"""
from cargo.expressions import *
from cargo.fields import Field

from unit_tests import configure
from unit_tests.configure import new_field

class TestBaseLogic(configure.LogicTestCase):

    def setUp(self):
        self.base = Field()
        self.base.field_name = 'test'
        self.base.table = 'tester'

    def test_asc(self):
        expr = self.base.asc()
        self.validate_expression(expr, self.base, 'ASC', _empty, {})

    def test_desc(self):
        expr = self.base.desc()
        self.validate_expression(expr, self.base, 'DESC', _empty, {})

    def test___and__(self):
        for x in ['string', 1234]:
            expr = (self.base & x)
            self.validate_expression(expr, self.base, 'AND', x, values=[x])
        for x in [Function('now'), self.base.asc(), self.base.in_(1, 2, 3)]:
            expr = (self.base & x)
            self.validate_expression(expr, self.base, 'AND', x, x.params)

    def test_in_(self):
        for x in [['sting', 'string2', 'string3'], [1, 2, 3, 4, 5, 6]]:
            expr = (self.base.in_(*x))
            self.validate_expression(
                expr, self.base, 'IN', tuple(x), values=[tuple(x)])

    def test_not_in(self):
        for x in [['sting', 'string2', 'string3'], [1, 2, 3, 4, 5, 6]]:
            expr = (self.base.not_in(*x))
            self.validate_expression(
                expr, self.base, 'NOT IN', tuple(x), values=[tuple(x)])

    def test_is_null(self):
        self.validate_expression(
            self.base.is_null(),
            self.base,
            'IS NULL',
            _empty,
            {})

    def test_not_null(self):
        self.validate_expression(
            self.base.is_not_null(),
            self.base,
            'IS NOT NULL',
            _empty,
            {})

    def test_nullif(self):
        for val in ['some_value', 12345, new_field()]:
            self.validate_function(
                self.base.nullif(val),
                'NULLIF',
                [self.base, val])
        for val in ['some_value', 12345, new_field()]:
            func = self.base.nullif(val, alias='foo')
            self.validate_function(
                func,
                'NULLIF',
                [self.base, val],
                alias='foo')

    def test_distinct_from(self):
        other_field = new_field()
        self.validate_expression(
            self.base.distinct_from(other_field),
            self.base,
            'IS DISTINCT FROM',
            other_field,
            {})

    def test_not_distinct_from(self):
        other_field = new_field()
        self.validate_expression(
            self.base.not_distinct_from(other_field),
            self.base,
            'IS NOT DISTINCT FROM',
            other_field,
            {})

    def test_distinct_on(self):
        self.validate_function(
            self.base.distinct_on(),
            'DISTINCT ON',
            [self.base]
        )
        self.validate_function(
            self.base.distinct_on(alias='test'),
            'DISTINCT ON',
            [self.base],
            alias='test'
        )

    def test_distinct(self):
        self.validate_function(
            self.base.distinct(),
            'distinct',
            [self.base]
        )
        self.validate_function(
            self.base.distinct(alias='test'),
            'distinct',
            [self.base],
            alias='test'
        )

    def test_count(self):
        field = new_field()
        self.validate_function(
            self.base.count(),
            'count',
            [self.base]
        )
        self.validate_function(
            self.base.count(alias='test'),
            'count',
            [self.base],
            alias='test'
        )

    def test_using(self):
        field = new_field()
        self.validate_function(
            self.base.using(field),
            'USING',
            [self.base, field]
        )
        self.validate_function(
            self.base.using(field, alias='test'),
            'USING',
            [self.base, field],
            alias='test'
        )

    def test_lag(self):
        field = new_field(table='foo', name='bar')
        func = field.lag()
        string = 'lag(foo.bar) OVER ()'
        self.assertEqual(func.string % func.params, string)

        func = field.lag('w')
        string = 'lag(foo.bar) OVER w'
        self.assertEqual(func.string % func.params, string)

        func = field.lag(order_by=field.desc())
        string = 'lag(foo.bar) OVER (ORDER BY foo.bar DESC)'
        self.assertEqual(func.string % func.params, string)

        func = field.lag(partition_by=field)
        string = 'lag(foo.bar) OVER (PARTITION BY foo.bar)'
        self.assertEqual(func.string % func.params, string)

        func = field.lag(Clause('ORDER BY', field))
        string = 'lag(foo.bar) OVER (ORDER BY foo.bar)'
        self.assertEqual(func.string % func.params, string)

        func = field.lag(Clause('ORDER BY', field), alias='foo_alias')
        string = 'lag(foo.bar) OVER (ORDER BY foo.bar) foo_alias'
        self.assertEqual(func.string % func.params, string)

    def test_lead(self):
        field = new_field(table='foo', name='bar')
        func = field.lead()
        string = 'lead(foo.bar) OVER ()'
        self.assertEqual(func.string % func.params, string)

        func = field.lead('w')
        string = 'lead(foo.bar) OVER w'
        self.assertEqual(func.string % func.params, string)

        func = field.lead(order_by=field.desc())
        string = 'lead(foo.bar) OVER (ORDER BY foo.bar DESC)'
        self.assertEqual(func.string % func.params, string)

        func = field.lead(partition_by=field)
        string = 'lead(foo.bar) OVER (PARTITION BY foo.bar)'
        self.assertEqual(func.string % func.params, string)

        func = field.lead(Clause('ORDER BY', field))
        string = 'lead(foo.bar) OVER (ORDER BY foo.bar)'
        self.assertEqual(func.string % func.params, string)

        func = field.lead(Clause('ORDER BY', field), alias='foo_alias')
        string = 'lead(foo.bar) OVER (ORDER BY foo.bar) foo_alias'
        self.assertEqual(func.string % func.params, string)

    def test_first_value(self):
        field = new_field(table='foo', name='bar')
        func = field.first_value()
        string = 'first_value(foo.bar) OVER ()'
        self.assertEqual(func.string % func.params, string)

        func = field.first_value('w')
        string = 'first_value(foo.bar) OVER w'
        self.assertEqual(func.string % func.params, string)

        func = field.first_value(order_by=field.desc())
        string = 'first_value(foo.bar) OVER (ORDER BY foo.bar DESC)'
        self.assertEqual(func.string % func.params, string)

        func = field.first_value(partition_by=field)
        string = 'first_value(foo.bar) OVER (PARTITION BY foo.bar)'
        self.assertEqual(func.string % func.params, string)

        func = field.first_value(Clause('ORDER BY', field))
        string = 'first_value(foo.bar) OVER (ORDER BY foo.bar)'
        self.assertEqual(func.string % func.params, string)

        func = field.first_value(Clause('ORDER BY', field), alias='foo_alias')
        string = 'first_value(foo.bar) OVER (ORDER BY foo.bar) foo_alias'
        self.assertEqual(func.string % func.params, string)

    def test_last_value(self):
        field = new_field(table='foo', name='bar')
        func = field.last_value()
        string = 'last_value(foo.bar) OVER ()'
        self.assertEqual(func.string % func.params, string)

        func = field.last_value('w')
        string = 'last_value(foo.bar) OVER w'
        self.assertEqual(func.string % func.params, string)

        func = field.last_value(order_by=field.desc())
        string = 'last_value(foo.bar) OVER (ORDER BY foo.bar DESC)'
        self.assertEqual(func.string % func.params, string)

        func = field.last_value(partition_by=field)
        string = 'last_value(foo.bar) OVER (PARTITION BY foo.bar)'
        self.assertEqual(func.string % func.params, string)

        func = field.last_value(Clause('ORDER BY', field))
        string = 'last_value(foo.bar) OVER (ORDER BY foo.bar)'
        self.assertEqual(func.string % func.params, string)

        func = field.last_value(Clause('ORDER BY', field), alias='foo_alias')
        string = 'last_value(foo.bar) OVER (ORDER BY foo.bar) foo_alias'
        self.assertEqual(func.string % func.params, string)

    def test_nth_value(self):
        field = new_field(table='foo', name='bar')
        func = field.nth_value(5)
        string = 'nth_value(foo.bar, 5) OVER ()'
        self.assertEqual(func.string % func.params, string)

        func = field.nth_value(5, 'w')
        string = 'nth_value(foo.bar, 5) OVER w'
        self.assertEqual(func.string % func.params, string)

        func = field.nth_value(5, order_by=field.desc())
        string = 'nth_value(foo.bar, 5) OVER (ORDER BY foo.bar DESC)'
        self.assertEqual(func.string % func.params, string)

        func = field.nth_value(5, partition_by=field)
        string = 'nth_value(foo.bar, 5) OVER (PARTITION BY foo.bar)'
        self.assertEqual(func.string % func.params, string)

        func = field.nth_value(5, Clause('ORDER BY', field))
        string = 'nth_value(foo.bar, 5) OVER (ORDER BY foo.bar)'
        self.assertEqual(func.string % func.params, string)

        func = field.nth_value(5, Clause('ORDER BY', field), alias='foo_alias')
        string = 'nth_value(foo.bar, 5) OVER (ORDER BY foo.bar) foo_alias'
        self.assertEqual(func.string % func.params, string)

    def test_func(self):
        field = new_field(table='foo', name='bar')
        for x in ['json_encode', 'json_decode', 'find_first']:
            self.validate_function(
                self.base.func(x, field),
                x,
                [self.base, field]
            )
            self.validate_function(
                self.base.func(x, field, alias='test'),
                x,
                [self.base, field],
                alias='test'
            )

if __name__ == '__main__':
    # Unit test
    configure.run_tests(TestBaseLogic, failfast=True, verbosity=2)


text:
_Online documentation for [Pipeline Project](https://www.perforce.com/manuals/jenkins/Content/P4Jenkins/chapter-pipeline.html)_

# Workflow Setup Guide

This guide covers the setup and configuration of Perforce tasks from Jenkins Pipeline scripts and assumes the reader
is experienced with Jenkins Pipeline.  If you are starting out or unfamiliar Pipeline please read The Jenkins Pipeline
documentation:

[https://jenkins.io/doc/book/pipeline/](https://jenkins.io/doc/book/pipeline/)

## Basic Populate

Almost all Perforce operations require a Perforce Credential, as in Freestyle Jobs the plugin for Pipeline requires
either a Perforce Password Credential or Perforce Ticket Credential.  For information about creating a Perforce credential, see
[Credentials](CREDENTIALS.md).

When using a Perforce Credential with Pipeline it is recommended to set the ID field to a short user friendly name.
This might be hidden in the Advanced options depending on the version of your Jenkins server.

The simplest way to populate your Jenkins workspace from Perforce is by using the `p4sync` DSL.  This requires a
minimum of three attributes: the Perforce Credential, a populate class and a codeline.  The 'Pipeline Syntax' snippet
generator can help build the DSL code.  Select 'p4sync: P4 Sync' from the dropdown menu and fill out the attribute
fields as required.

You only need to provide one codeline: 'Stream Codeline' for streams paths, 'Template Workspace' if you have defined
the path in another Workspaces View, or 'Depot path' to refer to a classic depot location in Perforce.

![P4Sync](images/p4sync.png)

This generated the following snippet...

```groovy
p4sync(charset: 'none',
  credential: 'phooey1666',
  populate: [$class: 'AutoCleanImpl',
    delete: true,
    modtime: false,
    pin: '',
    quiet: true,
    replace: true],
  stream: '//streams/st1-main')
```

and you can paste it into a basic script. For example:

```groovy
node {
  stage('Sync') {
    // sync files from //streams/st1-main/...
    p4sync(charset: 'none',
      credential: 'phooey1666',
      populate: [$class: 'AutoCleanImpl',
        delete: true,
        modtime: false,
        pin: '',
        quiet: true,
        replace: true],
      stream: '//streams/st1-main')
  }
}
```

### Mulitple Syncs
If you need more than one sync task in a script you **MUST** use a different workspace name.

You can control this by customising the 'Workspace Name Format' field.  The default value is
`jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}` and will not appear in the generated snippet, however if you change this to
`jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-libs` you will see a new attribute in the snippet
`format: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-libs'`.

## Advanced Populate

If you require full access to the Populate options available with Freestyle Jobs you can use the General SCM checkout
option.  Select `checkout: General SCM` from the dropdown and choose `Perforce Software` from the SCM dropdown.

![P4Sync](images/checkout.png)

This allows full customisation of the Workspace View Mappings, for example:

```groovy
node {
  stage('Sync') {
    // sync files from //streams/st1-main/...
    checkout([$class: 'PerforceScm',
      credential: 'phooey1666',
      populate: [$class: 'AutoCleanImpl',
        delete: true,
        modtime: false,
        parallel: [enable: false, minbytes: '1024', minfiles: '1', path: '/usr/local/bin/p4', threads: '4'],
        pin: '',
        quiet: true,
        replace: true],
      workspace: [$class: 'ManualWorkspaceImpl',
        charset: 'none',
        name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}',
        pinHost: false,
        spec: [allwrite: false,
          clobber: false,
          compress: false,
          line: 'LOCAL',
          locked: false,
          modtime: false,
          rmdir: false,
          streamName: '',
          view: '''//depot/libs/${OS}/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/libs/...
                   //depot/code/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/code/...'''
        ]
      ]
    ])
  }
}
```

## Using standard Freestyle Jobs steps

You can use the Publish, Tag, Unshelve and Cleanup steps from Freestyle.  The are available from the dropdown menu
and use the same Configuration dialogs as Freestyle.
For example: [P4 Publish](POSTBUILDPUBLISHASSETS.md)

```groovy
p4publish(credential: 'phooey1666',
  publish: [$class: 'SubmitImpl',
    delete: false,
    description: 'Submitted by Jenkins. Build: ${BUILD_TAG}',
    onlyOnSuccess: false,
    purge: '',
    reopen: false],
  workspace: [$class: 'StreamWorkspaceImpl',
    charset: 'none',
    format: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-publish',
    pinHost: false,
    streamName: '//streams/st2-rel1'])
```

## Using a versioned Jenkinsfile

Pipeline supports fetching the DSL script from the SCM.  Typically called `Jenkinsfile` and located in the root of
the project.  For the P4 Plugin to operate in this mode you need to provide a Perforce Credential and Workspace
mapping the location of the Jenkinsfile.

To do this; create a Pipeline project and select 'Pipeline script from SCM', choose 'Perforce Software' for the SCM
and fill out the fields as required. For example:

![P4Sync](images/jenkinsfile.png)

### Important recommendations

 * Use a unique workspace name for the Jenkinsfile that will not get reused by the sync steps in the script.  A postfix
   of `-script` will help to identify the workspace's use and make it unique from code sync steps.

 * Only map the Jenkinsfile (and perhaps Pipeline libraries) in the workspace view.  Jenkins may create an '@script'
   directory on the master and you don't want to unnecessarily sync code to an area not used for the actual build.

## Lightweight checkout

The 'Pipeline script from SCM' would normally use a Perforce Sync to fetch the versioned Jenkinsfile, however if the
workspace view included more than just the Jenkinsfile the operation could be expensive.  Jenkins introduced the
'Lightweight checkout' option that can navigate the SCM and fetch files as required.

![Lightweight](images/lightweight.png)

Enabling the option will use a 'p4 print' to fetch the Jenkinsfile negating the need for syncing the script files.

### Important recommendations

If you are using declarative pipeline and not the old DSL, you will need to disable the automatic 'Declarative Checkout
SCM' step.  For example, the declarative pipeline script has three steps, yet the build will show four:

```groovy
pipeline {
    agent any

    stages {
        stage('Build') {
            steps {
                echo 'Building...'
            }
        }
        stage('Test') {
            steps {
                echo 'Testing...'
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying...'
            }
        }
    }
}
```

![Declarative pipeline](images/declarative.png)

Simply add `options { skipDefaultCheckout() }` to the agent.  For example:

```groovy
pipeline {
    agent any

    options { skipDefaultCheckout() }

    stages {
        stage('Build') {
            steps {
                echo 'Building...'
            }
        }
        stage('Test') {
            steps {
                echo 'Testing...'
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying...'
            }
        }
    }
}
```

## Polling

Jenkins will poll for each sync step in a build script and also for the Jenkinsfile if using the 'Pipeline script from
SCM' option.  The advanced populate option `checkout: General SCM` provides check boxes to disable polling (and
changelog).

### Advanced Polling

Polling requires access to previous build data (build.xml). The P4 Plugin tracks the previous build change using a
`syncID` as a polling operation might iterate over multiple sync steps.  The `syncID` is normally calculated from
the client workspace name, but must be unique enough to distinguish between multiple sync steps, but common enough
to identify previous builds.  For this reason if the client Workspace name contains any of the following variables
their values will be ignored when determining the `syncID`:

* NODE_NAME (which might change between slaves)
* BUILD_NUMBER (which changes for each build)
* EXECUTOR_NUMBER (changes based on the execution thread)

In very rare circumstances a user may want to override the `syncID`, this can be done by specifying the attribute on
a `workspace:` class.

## Limitations

### Changelist reporting

Core Jenkins ties changelist reporting to individual 'p4 sync' commands. If the same job has multiple 'checkout' or
'p4sync' steps that sync the same changelist it will be reported once for each individual sync on the 'Status'
and 'Changes' pages. The P4Jenkins plugin is not able to override this behavior.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aspose.Email;
using Aspose.Email.Examples.CSharp.Email;
using Aspose.Email.Mime;
using Aspose.Email.Mapi;
using Aspose.Email.Storage.Pst;
using System.IO;

/*
This project uses Automatic Package Restore feature of NuGet to resolve Aspose.Email for .NET API reference
when the project is build. Please check https://Docs.nuget.org/consume/nuget-faq for more information.
If you do not wish to use NuGet, you can manually download Aspose.Email for .NET API from https://www.nuget.org/packages/Aspose.Email/,
install it and then add its reference to this project. For any issues, questions or suggestions
please feel free to contact us using https://forum.aspose.com/c/email
*/

namespace Aspose.Email.Examples.CSharp.Email.Outlook
{
    class CreateNewMapiCalendarAndAddToCalendarSubfolder
    {
        public static void Run()
        {
            // The path to the File directory.
            // ExStart:CreateNewMapiCalendarAndAddToCalendarSubfolder
            string dataDir = RunExamples.GetDataDir_Outlook();
            MapiMessage message = MapiMessage.FromFile(dataDir + "Note.msg");

            // Note #1
            MapiNote note1 = (MapiNote)message.ToMapiMessageItem();
            note1.Subject = "Yellow color note";
            note1.Body = "This is a yellow color note";

            // Note #2
            MapiNote note2 = (MapiNote)message.ToMapiMessageItem();
            note2.Subject = "Pink color note";
            note2.Body = "This is a pink color note";
            note2.Color = NoteColor.Pink;

            // Note #3
            MapiNote note3 = (MapiNote)message.ToMapiMessageItem();
            note2.Subject = "Blue color note";
            note2.Body = "This is a blue color note";
            note2.Color = NoteColor.Blue;
            note3.Height = 500;
            note3.Width = 500;

            if (File.Exists(dataDir + "SampleNote_out.pst"))
            {
                File.Delete(dataDir + "SampleNote_out.pst");
            }

            using (PersonalStorage pst = PersonalStorage.Create(dataDir + "SampleNote_out.pst", FileFormatVersion.Unicode))
            {
                FolderInfo notesFolder = pst.CreatePredefinedFolder("Notes", StandardIpmFolder.Notes);
                notesFolder.AddMapiMessageItem(note1);
                notesFolder.AddMapiMessageItem(note2);
                notesFolder.AddMapiMessageItem(note3);
            }
            // ExEnd:CreateNewMapiCalendarAndAddToCalendarSubfolder
        }
    }
}


text:
import expect from 'expect';
import jsdomify from 'jsdomify';

import { VERSE_MODE, SEGMENT_MODE, CHAPTER_MODE, RECALL_STAGES } from '../js/constants/AppConstants';
import * as passage from '../js/passage';

import { PassagePage } from '../js/components/pages/PassagePage.react';

describe('PassagePage', () => {
  let React, TestUtils, getInstance;

  beforeEach(() => {
    jsdomify.create();

    React     = require('react');
    TestUtils = require('react-addons-test-utils');

    getInstance = (props = {}) => {
      return TestUtils.renderIntoDocument(
        <PassagePage data={ props } dispatch={ {} } />
      );
    };
  });

  afterEach(() => {
    jsdomify.destroy();
  });

  describe('changing modes', () => {
    let props  = {
          active: {
            VERSE_MODE  : 0,
            SEGMENT_MODE: 0,
            CHAPTER_MODE: 0
          },
          mode: VERSE_MODE,
          recallStage: RECALL_STAGES.FULL,
          verses: passage.verses(),
          segments: passage.segments(),
          chapters: passage.chapters()
        };

    afterEach(() => {
      props.mode = null
    });

    it('should render', () => {
      let element = getInstance(props);

      expect(element).toBeTruthy();
    });

    it('should render the active verse in single mode', () => {
      props.mode       = VERSE_MODE;

      let element        = getInstance(props);
      let renderedVerses = TestUtils.scryRenderedDOMComponentsWithClass(element, 'verse-wrapper');

      expect(renderedVerses[0].innerHTML).toInclude(passage.verses()[0].formattedText());
    });

    it('should render all verses for a segment in segment mode', () => {
      props.mode       = SEGMENT_MODE;

      let element        = getInstance(props);
      let renderedVerses = TestUtils.scryRenderedDOMComponentsWithClass(element, 'verse-wrapper');

      expect(renderedVerses[0].innerHTML).toInclude(passage.segments()[0].formattedText());
    });

    it('should render all verses for a chapter in chapter mode', () => {
      props.mode       = CHAPTER_MODE;

      let element        = getInstance(props);
      let renderedVerses = TestUtils.scryRenderedDOMComponentsWithClass(element, 'verse-wrapper');

      expect(renderedVerses[0].innerHTML).toInclude(passage.chapters()[0].formattedText());
    });
  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<database>
    <table name="m_staff_assignment_history">
        <comment>table explaination</comment>
        <field name="id" key="PRI" type="bigint(20)">
            <comment>field explaination</comment>
        </field>
        <field name="centre_id" key="MUL" type="bigint(20)">
            <comment>field explaination</comment>
        </field>
        <field name="staff_id" key="MUL" type="bigint(20)">
            <comment>field explaination</comment>
        </field>
        <field name="start_date" type="date">
            <comment>field explaination</comment>
        </field>
        <field name="end_date" type="date">
            <comment>field explaination</comment>
        </field>
        <field name="createdby_id" type="bigint(20)">
            <comment>field explaination</comment>
        </field>
        <field name="created_date" type="datetime">
            <comment>field explaination</comment>
        </field>
        <field name="lastmodified_date" type="datetime">
            <comment>field explaination</comment>
        </field>
        <field name="lastmodifiedby_id" type="bigint(20)">
            <comment>field explaination</comment>
        </field>
    </table>
</database>


text:
package org.pentaho.di.trans.steps.getslavesequence;

import org.pentaho.di.cluster.SlaveServer;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.trans.step.BaseStepData;
import org.pentaho.di.trans.step.StepDataInterface;

/**
 * @author Matt
 * @since 24-jan-2005
 */
public class GetSlaveSequenceData extends BaseStepData implements StepDataInterface {
  public RowMetaInterface outputRowMeta;
  public SlaveServer slaveServer;
  public long value;
  public long startValue;
  public long increment;
  public String sequenceName;

  public GetSlaveSequenceData() {
    super();
  }
}


text:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TypedDataGrid.Settings;

namespace TypedDataGrid
{
    /// <summary>
    /// <see cref="TypedDataGridView{TData}.CellStyling"/> イベントのデータを表します。
    /// </summary>
    /// <typeparam name="TData"></typeparam>
    public class CellStylingEventArgs<TData> : EventArgs
    {
        /// <summary>
        /// <see cref="Cell"/> に関連する <see cref="ColumnSetting{TData}"/> を取得します。
        /// </summary>
        public ColumnSetting<TData> ColumnSetting { get; internal set; }

        /// <summary>
        /// <see cref="Cell"/> に関連する <see cref="DataItem{TData}"/> を取得します。
        /// </summary>
        public DataItem<TData> DataItem { get; internal set; }

        /// <summary>
        /// スタイルを設定する <see cref="DataGridViewCell"/> を取得します。
        /// </summary>
        public DataGridViewCell Cell { get; internal set; }
    }
}


text:
/**
 * @typedef {Object} YAMDBFOptions Object containing required {@link Client} properties to be
 * passed to a Client on construction
 * @property {string} [token] Token needed to connect the Client to Discord
 * @property {string[]} [owner=[]] Can also be a single string
See: {@link Client#owner}
 * @property {StorageProviderConstructor} [provider] See: {@link Client#provider}
 * @property {string} [commandsDir] See: {@link Client#commandsDir}
 * @property {string} [eventsDir] See: {@link Client#eventsDir}
 * @property {string} [localeDir] See: {@link Client#localeDir}
 * @property {string} [defaultLang] See: {@link Client#defaultLang}
 * @property {string} [statusText=null] See: {@link Client#statusText}
 * @property {string} [readyText='Client ready!'] See: {@link Client#readyText}
 * @property {boolean} [unknownCommandError=true] See: {@link Client#unknownCommandError}
 * @property {boolean} [dmHelp=true] See: {@link Client#dmHelp}
 * @property {boolean} [passive=false] See: {@link Client#passive}
 * @property {boolean} [pause=false] See: {@link Client#pause}
 * @property {string[]} [disableBase=[]] See: {@link Client#disableBase}
 * @property {string} [ratelimit] Sets a global rate limit on command calls for every user
 * @property {LogLevel} [logLevel] Sets the logging level for the logger. Defaults to `LogLevel.DEBUG`
 * @property {Array<PluginConstructor|string>} [plugins=[]] An array of Plugin classes (not instances)
 * 															or plugin package name strings to be loaded and used
 * @property {ResolverConstructor[]} [customResolvers=[]] An array of Resolver classes (not instances)
 * @property {Function} [argsParser] Function taking an input string, an optional {@link Command} object,
 * 									 and an optional {@link Message} object that returns an array of argument
 * 									 strings. Should be used instead of middleware for providing an
 * 									 alternative to the default args parsing of splitting input on the
 * 									 Command's specified argument separator
 * @property {object} [buttons] Object mapping keys for easy access to unicode emoji strings or custom
 * 								emoji id strings. To be used by the Client when compact mode is active

 * 								See: {@link Client#buttons}
 * @property {boolean} [compact=false] Whether or not compact mode should be used
 * @property {boolean} [tsNode=false] Whether or not ts-node is being used, allowing the CommandLoader to
 * 									  attempt to load .ts files when loading Commands
 */

import { BaseCommandName } from './BaseCommandName';
import { Command } from '../command/Command';
import { LogLevel } from './LogLevel';
import { Message } from './Message';
import { PluginConstructor } from './PluginConstructor';
import { ResolverConstructor } from './ResolverConstructor';
import { StorageProviderConstructor } from './StorageProviderConstructor';

export interface YAMDBFOptions
{
	token?: string;
	owner?: string | string[];
	provider?: StorageProviderConstructor;
	commandsDir?: string;
	eventsDir?: string;
	localeDir?: string;
	defaultLang?: string;
	statusText?: string;
	readyText?: string;
	unknownCommandError?: boolean;
	dmHelp?: boolean;
	passive?: boolean;
	pause?: boolean;
	disableBase?: BaseCommandName[];
	ratelimit?: string;
	logLevel?: LogLevel;
	plugins?: (PluginConstructor | string)[];
	customResolvers?: ResolverConstructor[];
	argsParser?: (input: string, command?: Command, message?: Message) => string[];
	buttons?: { [key: string]: string };
	compact?: boolean;
	tsNode?: boolean;
}


text:
package pspz3

import com.microsoft.z3

trait Zero[+A] { def zero: A }
trait Negation[A] {
  def negate(x: A): A
}

object Zero {
  def apply[A](z: A): Zero[A] = new Zero[A] { def zero: A = z }

  implicit def ratZero: Zero[Rational] = Zero(Rational(0))
  implicit def int32Zero: Zero[Int]    = Zero(0)
  implicit def int64Zero: Zero[Long]   = Zero(0)
}

trait Signed
trait Unsigned
trait Signed32 extends Signed
trait Unsigned32 extends Unsigned
trait Signed64 extends Signed
trait Unsigned64 extends Unsigned

final case class Assign[+E <: z3.Expr](fn: z3.FuncDecl, value: E) extends ToS {
  def name = fn.getName.toString
  def to_s = s"$name = $value"
}

trait Const[A] {
  def make(name: String): A
}

class NameGen[A](f: Int => A, start: Int) {
  private[this] var current = start
  def apply(): A = try f(current) finally current += 1
}
object NameGen extends NameGen[String]("x" + _, 0)


text:
namespace dcmtk { namespace log4cplus { namespace helpers {

///////////////////////////////////////////////////////////////////////////////
// dcmtk::log4cplus::helpers::SharedObject dtor
///////////////////////////////////////////////////////////////////////////////

SharedObject::~SharedObject()
{
    assert(count == 0);
    DCMTK_LOG4CPLUS_MUTEX_FREE( access_mutex );
}

///////////////////////////////////////////////////////////////////////////////
// dcmtk::log4cplus::helpers::SharedObject public methods
///////////////////////////////////////////////////////////////////////////////

void
SharedObject::addReference() const
{
    DCMTK_LOG4CPLUS_BEGIN_SYNCHRONIZE_ON_MUTEX( access_mutex )
        assert (count >= 0);
        ++count;
    DCMTK_LOG4CPLUS_END_SYNCHRONIZE_ON_MUTEX;
}

void
SharedObject::removeReference() const
{
    bool destroy = false;
    DCMTK_LOG4CPLUS_BEGIN_SYNCHRONIZE_ON_MUTEX( access_mutex );
        assert (count > 0);
        if (--count == 0)
            destroy = true;
    DCMTK_LOG4CPLUS_END_SYNCHRONIZE_ON_MUTEX;
    if (destroy)
        delete this;
}

} } } // namespace dcmtk { namespace log4cplus { namespace helpers


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>My Project: RefCounted Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

My Project

Main Page

Related Pages

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Members

Public Member Functions |
Friends |
List of all members

RefCounted Class Reference

Inherit from this class to make a pointer reference countable.
 More...

#include <ref_counted.h>

Public Member Functions

 	RefCounted (const RefCounted &)

void 	operator= (const RefCounted &)

unsigned short 	getRefCount ()

unsigned short 	getWeakRefCount ()

Friends

template<class T >

class 	counted_ptr

template<class T >

class 	counted_weak_ptr

Detailed Description

Inherit from this class to make a pointer reference countable.

The documentation for this class was generated from the following file:

ref_counted.h

<address class="footer">
Generated on Sat Aug 15 2015 14:33:37 for My Project by

 1.8.9.1
</address>


text:
- Original: [Release electron v11.0.0-beta.6 - electron/electron](https://github.com/electron/electron/releases/tag/v11.0.0-beta.6)

Note: This is a beta release. Please file new issues for any bugs you find in it.

This release is published to npm under the beta tag and can be installed via `npm install electron@beta`, or `npm i electron@11.0.0-beta.6`.

> Note: これはベータ リリースです。なにかバグを見つけた場合は issue 報告してください。
>
> 本リリースは `beta` タグの [npm](https://www.npmjs.com/package/electron) として公開しており `npm install electron@beta` または `npm i electron@11.0.0-beta.6` でインストールできます。

## Fixes

- Fixed a crash in the renderer process when invoking the Badging API. [#25370](https://github.com/electron/electron/pull/25370) (Also in [9](https://github.com/electron/electron/pull/25371), [10](https://github.com/electron/electron/pull/25369), [11](https://github.com/electron/electron/pull/25370))
  - Badging API 呼び出し時に Renderer プロセスがクラッシュする問題を修正しました
  - [Badging API](https://w3c.github.io/badging/) の存在をはじめて知った、更新通知の手段としてバッヂ表示は広く普及しているので Web としても価値のある機能となるだろう、Favicon 書き換えによる擬似的なバッヂ再現をしなくても済むようになると嬉しい

## Unknown

- Added support for some `chrome.management` APIs. [#25342](https://github.com/electron/electron/pull/25342) (Also in [9](https://github.com/electron/electron/pull/25344), [10](https://github.com/electron/electron/pull/25345), [11](https://github.com/electron/electron/pull/25342))
  - `chrome.management` API の一部をサポートしました
  - [Chrome 拡張系の機能](https://github.com/electron/electron/blob/master/docs/api/extensions.md)として `chrome.management` API の一部を利用できるようになった


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.trino.spi.connector;

import io.trino.spi.predicate.TupleDomain;

import static java.util.Objects.requireNonNull;

public class ConstraintApplicationResult<T>
{
    private final T handle;
    private final TupleDomain<ColumnHandle> remainingFilter;

    public ConstraintApplicationResult(T handle, TupleDomain<ColumnHandle> remainingFilter)
    {
        this.handle = requireNonNull(handle, "handle is null");
        this.remainingFilter = requireNonNull(remainingFilter, "remainingFilter is null");
    }

    public T getHandle()
    {
        return handle;
    }

    public TupleDomain<ColumnHandle> getRemainingFilter()
    {
        return remainingFilter;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/activity_item_background"
    android:padding="15dp">

    <ImageView
        android:id="@+id/project_pic"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:importantForAccessibility="no"
        android:src="@drawable/ic_work_gray_24dp" />

    <TextView
        android:id="@+id/project_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Project name"
        android:textSize="12sp"
        android:textColor="#808080"
        android:layout_toEndOf="@id/project_pic"
        android:layout_marginStart="6dp"
        android:layout_marginTop="2dp"
        />

     <TextView
        android:id="@+id/news_date"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="2m"
        android:textSize="12sp"
        android:textColor="#808080"
        android:layout_alignParentEnd="true"
        android:layout_alignParentTop="true"
        />

    <ImageView
        android:id="@+id/post_pic"
        android:layout_width="62dp"
        android:layout_height="62dp"
        android:scaleType="fitXY"
        android:layout_marginTop="12dp"
        android:layout_alignParentEnd="true"
        android:importantForAccessibility="no"
        android:layout_below="@id/project_pic"
        android:src="@drawable/ic_work_gray_24dp"
        android:layout_marginStart="10dp" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_alignParentStart="true"
        android:layout_toStartOf="@id/post_pic"
        android:layout_below="@id/project_pic"
        android:layout_marginTop="12dp"
        >
        <TextView
            android:id="@+id/news_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="News title"
            android:textSize="18sp"
            android:textColor="#000000"
            />

        <TextView
            android:id="@+id/news_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:maxLines="2"
            android:ellipsize="end"
            android:text="some news content"
            android:textSize="16sp"
            android:textColor="#808080"
            android:layout_marginTop="0dp"
            />
    </LinearLayout>
</RelativeLayout>


text:
package org.apache.flink.runtime.operators.lifecycle.graph;

import org.apache.flink.api.common.operators.ProcessingTimeService.ProcessingTimeCallback;
import org.apache.flink.runtime.operators.lifecycle.command.TestCommand;
import org.apache.flink.runtime.operators.lifecycle.event.CheckpointCompletedEvent;
import org.apache.flink.runtime.operators.lifecycle.event.CheckpointStartedEvent;
import org.apache.flink.runtime.operators.lifecycle.event.InputEndedEvent;
import org.apache.flink.runtime.operators.lifecycle.event.OperatorFinishedEvent;
import org.apache.flink.runtime.operators.lifecycle.event.OperatorFinishedEvent.LastReceivedVertexDataInfo;
import org.apache.flink.runtime.operators.lifecycle.event.OperatorStartedEvent;
import org.apache.flink.runtime.operators.lifecycle.event.TestEvent;
import org.apache.flink.runtime.operators.lifecycle.event.TestEventQueue;
import org.apache.flink.runtime.operators.lifecycle.event.WatermarkReceivedEvent;
import org.apache.flink.runtime.state.StateSnapshotContext;
import org.apache.flink.streaming.api.operators.AbstractStreamOperatorV2;
import org.apache.flink.streaming.api.operators.BoundedMultiInput;
import org.apache.flink.streaming.api.operators.Input;
import org.apache.flink.streaming.api.operators.MultipleInputStreamOperator;
import org.apache.flink.streaming.api.operators.Output;
import org.apache.flink.streaming.api.operators.StreamOperatorParameters;
import org.apache.flink.streaming.api.watermark.Watermark;
import org.apache.flink.streaming.runtime.streamrecord.LatencyMarker;
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
import org.apache.flink.streaming.runtime.watermarkstatus.WatermarkStatus;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * {@link MultipleInputStreamOperator} that emits {@link TestEvent}s and reacts to {@link
 * TestCommand}s. It processes the data by passing it downstream replacing the relevant fields.
 */
@SuppressWarnings("rawtypes") // Input type parameter not allowed by interface
class MultiInputTestOperator extends AbstractStreamOperatorV2<TestDataElement>
        implements MultipleInputStreamOperator<TestDataElement>,
                ProcessingTimeCallback,
                BoundedMultiInput {
    private final String operatorId;
    private final List<Input> inputs;
    private final TestEventQueue eventQueue;
    // atomic only to update from different static classes, not for // concurrency
    private final AtomicLong lastDataSent;
    private final Map<String, OperatorFinishedEvent.LastVertexDataInfo> lastDataReceived;

    public MultiInputTestOperator(
            int numInputs,
            StreamOperatorParameters<TestDataElement> params,
            TestEventQueue eventQueue,
            String operatorId) {
        super(params, numInputs);
        this.lastDataReceived = new HashMap<>();
        this.lastDataSent = new AtomicLong(0L);
        this.inputs =
                IntStream.rangeClosed(1, numInputs)
                        .mapToObj(
                                id ->
                                        new TestEventInput(
                                                id,
                                                eventQueue,
                                                output,
                                                operatorId,
                                                getRuntimeContext().getIndexOfThisSubtask(),
                                                getRuntimeContext().getAttemptNumber(),
                                                lastDataReceived,
                                                lastDataSent))
                        .collect(Collectors.toList());
        this.eventQueue = eventQueue;
        this.operatorId = operatorId;
    }

    @Override
    public void open() throws Exception {
        super.open();
        registerTimer();
        this.eventQueue.add(
                new OperatorStartedEvent(
                        operatorId,
                        getRuntimeContext().getIndexOfThisSubtask(),
                        getRuntimeContext().getAttemptNumber()));
    }

    @Override
    public List<Input> getInputs() {
        return inputs;
    }

    @Override
    public void finish() throws Exception {
        eventQueue.add(
                new OperatorFinishedEvent(
                        operatorId,
                        getRuntimeContext().getIndexOfThisSubtask(),
                        getRuntimeContext().getAttemptNumber(),
                        lastDataSent.get(),
                        new LastReceivedVertexDataInfo(lastDataReceived)));
        super.finish();
    }

    @Override
    public void snapshotState(StateSnapshotContext context) throws Exception {
        eventQueue.add(
                new CheckpointStartedEvent(
                        operatorId,
                        getRuntimeContext().getIndexOfThisSubtask(),
                        getRuntimeContext().getAttemptNumber(),
                        context.getCheckpointId()));
        super.snapshotState(context);
    }

    @Override
    public void notifyCheckpointComplete(long checkpointId) throws Exception {
        eventQueue.add(
                new CheckpointCompletedEvent(
                        operatorId,
                        getRuntimeContext().getIndexOfThisSubtask(),
                        getRuntimeContext().getAttemptNumber(),
                        checkpointId));
        super.notifyCheckpointComplete(checkpointId);
    }

    @Override
    public void onProcessingTime(long timestamp) {
        registerTimer();
    }

    private void registerTimer() {
        getProcessingTimeService()
                .registerTimer(getProcessingTimeService().getCurrentProcessingTime() + 1, this);
    }

    @Override
    public void endInput(int inputId) throws Exception {
        eventQueue.add(
                new InputEndedEvent(
                        operatorId,
                        getRuntimeContext().getIndexOfThisSubtask(),
                        getRuntimeContext().getAttemptNumber(),
                        inputId));
    }

    private static class TestEventInput implements Input<TestDataElement> {
        private final int id;
        private final TestEventQueue eventQueue;
        private final Output<StreamRecord<TestDataElement>> output;
        private final String operatorId;
        private final int subtaskIndex;
        private final Map<String, OperatorFinishedEvent.LastVertexDataInfo> lastDataReceived;
        private final AtomicLong lastDataSent;
        private final int attemptNumber;

        public TestEventInput(
                int id,
                TestEventQueue eventQueue,
                Output<StreamRecord<TestDataElement>> output,
                String operatorId,
                int subtaskIndex,
                int attemptNumber,
                Map<String, OperatorFinishedEvent.LastVertexDataInfo> lastDataReceived,
                AtomicLong lastDataSent) {
            this.id = id;
            this.eventQueue = eventQueue;
            this.output = output;
            this.operatorId = operatorId;
            this.subtaskIndex = subtaskIndex;
            this.lastDataReceived = lastDataReceived;
            this.lastDataSent = lastDataSent;
            this.attemptNumber = attemptNumber;
        }

        @Override
        public void processElement(StreamRecord<TestDataElement> element) throws Exception {
            TestDataElement e = element.getValue();
            lastDataReceived
                    .computeIfAbsent(
                            e.operatorId, ign -> new OperatorFinishedEvent.LastVertexDataInfo())
                    .bySubtask
                    .put(e.subtaskIndex, e.seq);
            output.collect(
                    new StreamRecord<>(
                            new TestDataElement(
                                    operatorId, subtaskIndex, lastDataSent.incrementAndGet())));
        }

        @Override
        public void processWatermark(Watermark mark) throws Exception {
            eventQueue.add(
                    new WatermarkReceivedEvent(
                            operatorId, subtaskIndex, attemptNumber, mark.getTimestamp(), id));
            output.emitWatermark(mark);
        }

        @Override
        public void processWatermarkStatus(WatermarkStatus watermarkStatus) {}

        @Override
        public void processLatencyMarker(LatencyMarker latencyMarker) {}

        @Override
        public void setKeyContextElement(StreamRecord<TestDataElement> record) {}
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
import java.util.Objects;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.plaf.basic.BasicRadioButtonUI;
import javax.swing.text.View;

/**
 *
 * @author shanaka
 */
class LinkViewRadioButtonUI extends BasicRadioButtonUI {
//     private static final LinkViewRadioButtonUI radioButtonUI = new LinkViewRadioButtonUI();
//     private boolean defaults_initialized = false;

    private static Dimension size = new Dimension();
    private static Rectangle viewRect = new Rectangle();
    private static Rectangle iconRect = new Rectangle();
    private static Rectangle textRect = new Rectangle();

//     public static ComponentUI createUI(JComponent b) {
//         return radioButtonUI;
//     }
//     @Override protected void installDefaults(AbstractButton b) {
//         super.installDefaults(b);
//         if (!defaults_initialized) {
//             icon = null; //UIManager.getIcon(getPropertyPrefix() + "icon");
//             defaults_initialized = true;
//         }
//     }
//     @Override protected void uninstallDefaults(AbstractButton b) {
//         super.uninstallDefaults(b);
//         defaults_initialized = false;
//     }
    @Override
    public Icon getDefaultIcon() {
        return null;
    }

    @Override
    public synchronized void paint(Graphics g, JComponent c) {
        //AbstractButton b = (AbstractButton) c;
        Font f = c.getFont();
        g.setFont(f);
        FontMetrics fm = c.getFontMetrics(f);

        Insets i = c.getInsets();
        c.getSize(size);
        viewRect.x = i.left;
        viewRect.y = i.top;
        viewRect.width = size.width - i.right - viewRect.x;
        viewRect.height = size.height - i.bottom - viewRect.y;
        iconRect.setBounds(0, 0, 0, 0); //.x = iconRect.y = iconRect.width = iconRect.height = 0;
        textRect.setBounds(0, 0, 0, 0); //.x = textRect.y = textRect.width = textRect.height = 0;

        if (c.isOpaque()) {
            g.setColor(c.getBackground());
            g.fillRect(0, 0, size.width, size.height);
        }

        String text;
        AbstractButton b;
        if (c instanceof AbstractButton) {
            b = (AbstractButton) c;
            text = SwingUtilities.layoutCompoundLabel(
                    b, fm, b.getText(), null, //altIcon != null ? altIcon : getDefaultIcon(),
                    b.getVerticalAlignment(), b.getHorizontalAlignment(),
                    b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
                    viewRect, iconRect, textRect,
                    0); //b.getText() == null ? 0 : b.getIconTextGap());
        } else {
            return;
        }

//         // Changing Component State During Painting (an infinite repaint loop)
//         // pointed out by Peter
//         // -note: http://today.java.net/pub/a/today/2007/08/30/debugging-swing.html#changing-component-state-during-the-painting
//         //b.setForeground(Color.BLUE);
//         if (!model.isEnabled()) {
//             //b.setForeground(Color.GRAY);
//         } else if (model.isPressed() && model.isArmed() || model.isSelected()) {
//             //b.setForeground(Color.BLACK);
//         } else if (b.isRolloverEnabled() && model.isRollover()) {
        ButtonModel model = b.getModel();
        g.setColor(c.getForeground());
        if (!model.isSelected() && !model.isPressed() && !model.isArmed() && b.isRolloverEnabled() && model.isRollover()) {
            g.drawLine(viewRect.x, viewRect.y + viewRect.height,
                    viewRect.x + viewRect.width, viewRect.y + viewRect.height);
        }
        View v = (View) c.getClientProperty(BasicHTML.propertyKey);
        if (Objects.nonNull(v)) {
            v.paint(g, textRect);
        } else {
            paintText(g, c, textRect, text);
        }
    }
}


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

namespace WX.Model.ApiRequests
{
    /// <summary>
    /// 获取图文群发总数据(getarticletotal)
    /// </summary>
    public class DatacubeGetarticletotalRequest : DatacubeGetarticlesummaryRequest
    {
        protected override string UrlFormat
        {
            get
            {
                return "https://api.weixin.qq.com/datacube/getarticletotal?access_token={0}";
            }
        }
    }
}


text:
Auto-embed nice embed-able links.

## Installation

```bash
npm install --save autoembed
```

## Example

```javascript
autoEmbed(string, {
  // eg: render cloudmusic only
  cloudmusic: true
  // eg: render every embed-able link
  embed: true
})
```

## What we support

Feel free to send a PR for supporting more embed-able links.

Now we support:

- Youtube, eg `https://www.youtube.com/watch?v=5vOAxP-u5KA`
- Kickstarter, eg: `https://www.kickstarter.com/projects/1546683916/treasures-of-the-universe-unique-astrophotography?ref=home_popular`
- Cloudmusic, eg: `http://music.163.com/#/song?id=36103237`

## Related

- [autolink.js](https://github.com/egoist/autolink.js) : Use this module to embed videos and music, etc.

## License

MIT © [EGOIST](https://github.com/egoist)


text:
<?php

namespace Doctrine\Tests\ORM\Query;

require_once __DIR__ . '/../../TestInit.php';

class QueryTest extends \Doctrine\Tests\OrmTestCase
{
    protected $_em = null;

    protected function setUp()
    {
        $this->_em = $this->_getTestEntityManager();
    }

    /**
     * @expectedException Doctrine\ORM\Query\QueryException
     */
    public function testParameterIndexZeroThrowsException()
    {
        $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1");
        $query->execute(array(42)); // same as array(0 => 42), 0 is invalid parameter position
    }

    public function testGetParameters()
    {
        $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1");
        $this->assertEquals(array(), $query->getParameters());
    }

    public function testGetParameters_HasSomeAlready()
    {
        $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1");
        $query->setParameter(2, 84);
        $this->assertEquals(array(2 => 84), $query->getParameters());
    }

    public function testSetParameters()
    {
        $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1");
        $query->setParameters(array(1 => 'foo', 2 => 'bar'));
        $this->assertEquals(array(1 => 'foo', 2 => 'bar'), $query->getParameters());
    }

    public function testFree()
    {
        $query = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1");
        $query->setParameter(2, 84, \PDO::PARAM_INT);

        $query->free();

        $this->assertEquals(array(), $query->getParameters());
    }

    public function testClone()
    {
        $dql = "select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1";

        $query = $this->_em->createQuery($dql);
        $query->setParameter(2, 84, \PDO::PARAM_INT);
        $query->setHint('foo', 'bar');

        $cloned = clone $query;

        $this->assertEquals($dql, $cloned->getDql());
        $this->assertEquals(array(), $cloned->getParameters());
        $this->assertFalse($cloned->getHint('foo'));
    }

    public function testFluentQueryInterface()
    {
        $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a");
        $q2 = $q->expireQueryCache(true)
          ->setQueryCacheLifetime(3600)
          ->setQueryCacheDriver(null)
          ->expireResultCache(true)
          ->setHint('foo', 'bar')
          ->setHint('bar', 'baz')
          ->setParameter(1, 'bar')
          ->setParameters(array(2 => 'baz'))
          ->setResultCacheDriver(null)
          ->setResultCacheId('foo')
          ->setDql('foo')
          ->setFirstResult(10)
          ->setMaxResults(10);

        $this->assertSame($q2, $q);
    }

    /**
     * @group DDC-968
     */
    public function testHints()
    {
        $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a");
        $q->setHint('foo', 'bar')->setHint('bar', 'baz');

        $this->assertEquals('bar', $q->getHint('foo'));
        $this->assertEquals('baz', $q->getHint('bar'));
        $this->assertEquals(array('foo' => 'bar', 'bar' => 'baz'), $q->getHints());
    }
}


text:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package InsightLT;

import com.sun.squawk.util.Arrays;

/**
*
* @author Wave
*/
public class DecimalData implements DisplayData{
     public DecimalData()
    {
        m_floatData = 0;
        m_precision = 2;
        m_floatHeader = "";
    };

    public DecimalData(String header)
    {
        m_updateString = true;
        m_floatHeader = header;
        m_precision = 2;
        m_floatData = 0;
    }

    public void setData(double data)
    {
        m_updateString = true;
        m_floatData = data;
    }

    public void setPrecision(int precision)
    {
        m_precision = precision;
    }

    public void setHeader(String header)
    {
        m_updateString = true;
        m_floatHeader = header;
    }

    public String getFormattedString(int zoneLength)
    {
        if(m_updateString)
{
            m_updateString = false;
            String tmpString = formatDecimal(m_floatData);

            if(m_floatHeader.length() + tmpString.length() > zoneLength)
            {
                if(tmpString.length() > zoneLength)
                {
                        tmpString = tmpString.substring( 0, (tmpString.length() - (tmpString.length() - zoneLength) - 1));
                }
                m_formattedString = m_floatHeader.substring(0, zoneLength - tmpString.length()) + tmpString;
            }
            else
            {
                byte[] tmp = new byte[zoneLength - (m_floatHeader.length() + tmpString.length())];
                Arrays.fill(tmp, (byte)' ');
                m_formattedString = m_floatHeader + new String(tmp).concat(tmpString);
            }
}
return m_formattedString;
    }

    private String formatDecimal(double convert)
    {
        int exp = 10;
        for(int i = 1; i < m_precision; i++)
        {
            exp *= 10;
        }
        int wholePart = (int)convert;
        double decimalPart = convert - wholePart;
        int convertedDecimal = (int)((decimalPart * exp) + .5);
        String tmpDecimal = Integer.toString(convertedDecimal);
        if(tmpDecimal.length() < m_precision)
        {
            byte[] extraZeros = new byte[m_precision - tmpDecimal.length()];
            Arrays.fill(extraZeros, (byte)'0');
            tmpDecimal = new String(extraZeros).concat(tmpDecimal);
        }
        return new String(Integer.toString(wholePart) + '.' + tmpDecimal);
    }

    private String m_formattedString;
    private String m_floatHeader;
    private double m_floatData;
    private int m_precision;
    private boolean m_updateString;
}